-
Notifications
You must be signed in to change notification settings - Fork 2
chore(ui): ui package bootstrapped #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ec70605
ui package
neSpecc bdd4d6f
Merge branch 'main' into ui
neSpecc 8df7459
enum added
neSpecc 857e3e7
on demand plugins init
neSpecc f0c3243
lint
neSpecc 45be0e0
Update packages/core/src/entities/Ui.ts
neSpecc f499c94
Update App.vue
neSpecc a3a20ff
Merge branch 'ui' of https://github.com/editor-js/document-model into ui
neSpecc ce084b5
fluent interface
neSpecc fc536d9
Delete .eslintrc.cjs
neSpecc 310e491
upd clear
neSpecc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,48 @@ | ||
| import type { EventBus } from '../components/EventBus/index.js'; | ||
| import type { CoreConfigValidated } from './Config.js'; | ||
| import type { EditorAPI } from '../api/index.js'; | ||
|
|
||
| /** | ||
| * Parameters for EditorjsPlugin constructor | ||
| */ | ||
| export interface EditorjsPluginParams { | ||
| /** | ||
| * EditorJS config | ||
| */ | ||
| config: CoreConfigValidated; | ||
|
|
||
| /** | ||
| * EditorAPI instance | ||
| */ | ||
| api: EditorAPI; | ||
|
|
||
| /** | ||
| * EventBus instance | ||
| */ | ||
| eventBus: EventBus; | ||
| } | ||
|
|
||
| /** | ||
| * Base interface for UI plugins | ||
| */ | ||
| export interface EditorjsPlugin { | ||
| /** | ||
| * Destroy plugin instance | ||
| */ | ||
| destroy?(): void; | ||
| } | ||
|
|
||
| /** | ||
| * Constructor type for EditorjsPlugin | ||
| */ | ||
| export interface EditorjsPluginConstructor { | ||
| /** | ||
| * Create new EditorjsPlugin instance | ||
| */ | ||
| new (params: EditorjsPluginParams): EditorjsPlugin; | ||
|
|
||
| /** | ||
| * Plugin type | ||
| */ | ||
| type: string; | ||
| } |
This file contains hidden or 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,24 @@ | ||
| /** | ||
| * List of reserved UI component names | ||
| */ | ||
| export enum UiComponentType { | ||
| /** | ||
| * Main wrapper UI element | ||
| */ | ||
| Shell = 'shell', | ||
|
|
||
| /** | ||
| * Blocks wrapper | ||
| */ | ||
| Blocks = 'blocks', | ||
|
|
||
| /** | ||
| * Inline toolbar wrapper | ||
| */ | ||
| InlineToolbar = 'inline-toolbar', | ||
|
|
||
| /** | ||
| * Toolbox wrapper | ||
| */ | ||
| Toolbox = 'toolbox' | ||
| } |
This file contains hidden or 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,2 +1,4 @@ | ||
| export * from './Config.js'; | ||
| export * from './UnifiedToolConfig.js'; | ||
| export * from './EditorjsPlugin.js'; | ||
| export * from './Ui.js'; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
|
|
||
| # Swap the comments on the following lines if you don't wish to use zero-installs | ||
| # Documentation here: https://yarnpkg.com/features/zero-installs | ||
| #!.yarn/cache | ||
| #.pnp.* | ||
|
|
||
| # IDE | ||
| .idea/* | ||
|
|
||
| node_modules/* | ||
| dist/* | ||
|
|
||
| # tests | ||
| coverage/ | ||
| reports/ | ||
|
|
||
| # stryker temp files | ||
| .stryker-tmp |
This file contains hidden or 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,3 @@ | ||
| # @editorjs/ui | ||
|
|
||
| Contains in-box EditorJs UI components implementation |
This file contains hidden or 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,26 @@ | ||
| import CodeX from 'eslint-config-codex'; | ||
|
|
||
| export default [ | ||
| ...CodeX, | ||
|
|
||
| { | ||
| /** | ||
| * Override path to the tsconfig.json file. | ||
| */ | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: './tsconfig.json', | ||
| tsconfigRootDir: './', | ||
| sourceType: 'module', | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'n/no-unpublished-import': ['error', { | ||
| allowModules: [ | ||
| 'eslint-config-codex', | ||
| ], | ||
| ignoreTypeImport: true, | ||
| }], | ||
| }, | ||
| }, | ||
| ]; |
This file contains hidden or 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,32 @@ | ||
| <div id="editorjs"></div> | ||
|
|
||
| <script type="module"> | ||
| import Core from '@editorjs/core'; | ||
| import { EditorjsUI, BlocksUI, InlineToolbarUI, ToolboxUI } from './src/index.ts'; | ||
|
|
||
| const core = new Core({ | ||
| holder: document.getElementById('editorjs'), | ||
| data: { | ||
| blocks: [ { | ||
| type: 'paragraph', | ||
| data: { | ||
| text: 'Hello, <b>World</b>!', | ||
| }, | ||
| } ], | ||
| }, | ||
| }); | ||
|
|
||
| core | ||
| .use(EditorjsUI) | ||
| .use(BlocksUI) | ||
| .use(InlineToolbarUI) | ||
| .use(ToolboxUI) | ||
| .initialize(); | ||
| </script> | ||
|
|
||
| <style> | ||
| body, html { | ||
| background-color: #222; | ||
| color: #fff; | ||
| } | ||
| </style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.