-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(monorepo): handlers in plugins
- Loading branch information
Showing
9 changed files
with
52 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { PluginTypes } from 'better-write-types' | ||
|
||
export const PluginHandlerSet = ( | ||
emitter: PluginTypes.PluginEmitter, | ||
stores: PluginTypes.PluginStores, | ||
hooks: PluginTypes.PluginHooks | ||
) => { | ||
emitter.on('call-editor-mounted', () => { | ||
// for set color in all entities with character exists | ||
hooks.characters.handler() | ||
|
||
hooks.emitter.on( | ||
'characters-handler', | ||
({ index, inner }: { index: number; inner: string }) => { | ||
hooks.characters.handler(index, inner) | ||
} | ||
) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { PluginTypes } from 'better-write-types' | ||
import { createPlugin } from 'better-write-plugin-core' | ||
import { BackgroundColorSet } from './color' | ||
import { PluginBackgroundColorSet } from './color' | ||
import { PluginHandlerSet } from './handler' | ||
|
||
export const CharactersPlugin = (): PluginTypes.Plugin => | ||
createPlugin({ name: 'characters' }, [BackgroundColorSet]) | ||
createPlugin({ name: 'characters' }, [ | ||
PluginHandlerSet, | ||
PluginBackgroundColorSet, | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { PluginTypes } from 'better-write-types' | ||
|
||
export const PluginHandlerSet = ( | ||
emitter: PluginTypes.PluginEmitter, | ||
stores: PluginTypes.PluginStores, | ||
hooks: PluginTypes.PluginHooks | ||
) => { | ||
emitter.on('call-editor-mounted', () => { | ||
hooks.vueuse.core.useEventListener('dragover', (e: DragEvent) => { | ||
e.preventDefault() | ||
e.stopPropagation() | ||
}) | ||
|
||
hooks.vueuse.core.useEventListener('drop', (event: DragEvent) => { | ||
event.preventDefault() | ||
event.stopPropagation() | ||
|
||
hooks.plugin.emit('plugin-window-drop', event) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { PluginTypes } from 'better-write-types' | ||
import { createPlugin } from 'better-write-plugin-core' | ||
import { PluginDropSet } from './drop' | ||
import { PluginHandlerSet } from './handler' | ||
|
||
export const WindowPlugin = (): PluginTypes.Plugin => | ||
createPlugin({ name: 'window' }, [PluginDropSet]) | ||
createPlugin({ name: 'window' }, [PluginHandlerSet, PluginDropSet]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters