@licium/editor 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +176 -0
- package/dist/esm/i18n/__test__/integration/ui/layout.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/integration/ui/toolbar.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/integration/vdom/render.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/integration/widget/widgetNode.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/convertor.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/dom.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/editor.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/eventEmitter.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/helper/common.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/helper/image.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/linkXss.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/keymap.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/mdCommand.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/mdEditor.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/mdPreview.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/smartTask.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/syntaxHighlight.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/markdown/util.d.ts +7 -0
- package/dist/esm/i18n/__test__/unit/repro_3296.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/sanitizer.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/utils/escape.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/utils/pollution.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/vdom/template.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/viewer.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/customBlock.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/helper/pasteMsoList.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/imageInsertion.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/keymap.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/wwCommand.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/wwEditor.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/wwTableCommand.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/wysiwyg/wwToDOMAdaptor.spec.d.ts +1 -0
- package/dist/esm/i18n/__test__/unit/xssSanitizer.spec.d.ts +1 -0
- package/dist/esm/i18n/ar.d.ts +1 -0
- package/dist/esm/i18n/ar.js +63 -0
- package/dist/esm/i18n/base.d.ts +60 -0
- package/dist/esm/i18n/commands/commandManager.d.ts +16 -0
- package/dist/esm/i18n/commands/defaultCommands.d.ts +2 -0
- package/dist/esm/i18n/commands/wwCommands.d.ts +2 -0
- package/dist/esm/i18n/convertors/convertor.d.ts +19 -0
- package/dist/esm/i18n/convertors/toMarkdown/toMdConvertorState.d.ts +30 -0
- package/dist/esm/i18n/convertors/toMarkdown/toMdConvertors.d.ts +7 -0
- package/dist/esm/i18n/convertors/toMarkdown/toMdNodeTypeWriters.d.ts +8 -0
- package/dist/esm/i18n/convertors/toWysiwyg/htmlToWwConvertors.d.ts +7 -0
- package/dist/esm/i18n/convertors/toWysiwyg/toWwConvertorState.d.ts +23 -0
- package/dist/esm/i18n/convertors/toWysiwyg/toWwConvertors.d.ts +4 -0
- package/dist/esm/i18n/cs-cz.d.ts +1 -0
- package/dist/esm/i18n/cs-cz.js +63 -0
- package/dist/esm/i18n/de-de.d.ts +1 -0
- package/dist/esm/i18n/de-de.js +63 -0
- package/dist/esm/i18n/editor.d.ts +36 -0
- package/dist/esm/i18n/editorCore.d.ts +330 -0
- package/dist/esm/i18n/en-us.d.ts +1 -0
- package/dist/esm/i18n/en-us.js +63 -0
- package/dist/esm/i18n/es-es.d.ts +1 -0
- package/dist/esm/i18n/es-es.js +63 -0
- package/dist/esm/i18n/esm/index.d.ts +5 -0
- package/dist/esm/i18n/esm/indexViewer.d.ts +2 -0
- package/dist/esm/i18n/event/eventEmitter.d.ts +73 -0
- package/dist/esm/i18n/fi-fi.d.ts +1 -0
- package/dist/esm/i18n/fi-fi.js +63 -0
- package/dist/esm/i18n/fr-fr.d.ts +1 -0
- package/dist/esm/i18n/fr-fr.js +63 -0
- package/dist/esm/i18n/gl-es.d.ts +5 -0
- package/dist/esm/i18n/gl-es.js +63 -0
- package/dist/esm/i18n/helper/image.d.ts +4 -0
- package/dist/esm/i18n/helper/manipulation.d.ts +16 -0
- package/dist/esm/i18n/helper/plugin.d.ts +3 -0
- package/dist/esm/i18n/hr-hr.d.ts +1 -0
- package/dist/esm/i18n/hr-hr.js +63 -0
- package/dist/esm/i18n/i18n.d.ts +20 -0
- package/dist/esm/i18n/i18n.js +217 -0
- package/dist/esm/i18n/index.d.ts +10 -0
- package/dist/esm/i18n/indexEditorOnlyStyle.d.ts +3 -0
- package/dist/esm/i18n/indexViewer.d.ts +3 -0
- package/dist/esm/i18n/it-it.d.ts +1 -0
- package/dist/esm/i18n/it-it.js +63 -0
- package/dist/esm/i18n/ja-jp.d.ts +1 -0
- package/dist/esm/i18n/ja-jp.js +63 -0
- package/dist/esm/i18n/ko-kr.d.ts +1 -0
- package/dist/esm/i18n/ko-kr.js +63 -0
- package/dist/esm/i18n/markdown/helper/list.d.ts +55 -0
- package/dist/esm/i18n/markdown/helper/mdCommand.d.ts +5 -0
- package/dist/esm/i18n/markdown/helper/pos.d.ts +22 -0
- package/dist/esm/i18n/markdown/helper/query.d.ts +3 -0
- package/dist/esm/i18n/markdown/htmlRenderConvertors.d.ts +5 -0
- package/dist/esm/i18n/markdown/marks/blockQuote.d.ts +19 -0
- package/dist/esm/i18n/markdown/marks/code.d.ts +25 -0
- package/dist/esm/i18n/markdown/marks/codeBlock.d.ts +18 -0
- package/dist/esm/i18n/markdown/marks/customBlock.d.ts +10 -0
- package/dist/esm/i18n/markdown/marks/emph.d.ts +17 -0
- package/dist/esm/i18n/markdown/marks/heading.d.ts +23 -0
- package/dist/esm/i18n/markdown/marks/html.d.ts +8 -0
- package/dist/esm/i18n/markdown/marks/link.d.ts +29 -0
- package/dist/esm/i18n/markdown/marks/listItem.d.ts +42 -0
- package/dist/esm/i18n/markdown/marks/simpleMark.d.ts +32 -0
- package/dist/esm/i18n/markdown/marks/strike.d.ts +14 -0
- package/dist/esm/i18n/markdown/marks/strong.d.ts +18 -0
- package/dist/esm/i18n/markdown/marks/table.d.ts +27 -0
- package/dist/esm/i18n/markdown/marks/thematicBreak.d.ts +17 -0
- package/dist/esm/i18n/markdown/mdEditor.d.ts +48 -0
- package/dist/esm/i18n/markdown/mdPreview.d.ts +50 -0
- package/dist/esm/i18n/markdown/nodes/doc.d.ts +7 -0
- package/dist/esm/i18n/markdown/nodes/paragraph.d.ts +46 -0
- package/dist/esm/i18n/markdown/nodes/text.d.ts +7 -0
- package/dist/esm/i18n/markdown/plugins/helper/markInfo.d.ts +19 -0
- package/dist/esm/i18n/markdown/plugins/previewHighlight.d.ts +3 -0
- package/dist/esm/i18n/markdown/plugins/smartTask.d.ts +3 -0
- package/dist/esm/i18n/markdown/plugins/syntaxHighlight.d.ts +3 -0
- package/dist/esm/i18n/markdown/scroll/animation.d.ts +2 -0
- package/dist/esm/i18n/markdown/scroll/dom.d.ts +16 -0
- package/dist/esm/i18n/markdown/scroll/offset.d.ts +9 -0
- package/dist/esm/i18n/markdown/scroll/scrollSync.d.ts +30 -0
- package/dist/esm/i18n/nb-no.d.ts +1 -0
- package/dist/esm/i18n/nb-no.js +63 -0
- package/dist/esm/i18n/nl-nl.d.ts +1 -0
- package/dist/esm/i18n/nl-nl.js +63 -0
- package/dist/esm/i18n/pl-pl.d.ts +1 -0
- package/dist/esm/i18n/pl-pl.js +63 -0
- package/dist/esm/i18n/plugins/dropImage.d.ts +3 -0
- package/dist/esm/i18n/plugins/placeholder.d.ts +7 -0
- package/dist/esm/i18n/plugins/popupWidget.d.ts +3 -0
- package/dist/esm/i18n/pt-br.d.ts +1 -0
- package/dist/esm/i18n/pt-br.js +63 -0
- package/dist/esm/i18n/queries/queryManager.d.ts +2 -0
- package/dist/esm/i18n/ru-ru.d.ts +1 -0
- package/dist/esm/i18n/ru-ru.js +64 -0
- package/dist/esm/i18n/sanitizer/htmlSanitizer.d.ts +3 -0
- package/dist/esm/i18n/spec/mark.d.ts +12 -0
- package/dist/esm/i18n/spec/node.d.ts +12 -0
- package/dist/esm/i18n/spec/specManager.d.ts +16 -0
- package/dist/esm/i18n/sv-se.d.ts +1 -0
- package/dist/esm/i18n/sv-se.js +63 -0
- package/dist/esm/i18n/tr-tr.d.ts +1 -0
- package/dist/esm/i18n/tr-tr.js +63 -0
- package/dist/esm/i18n/ui/components/contextMenu.d.ts +21 -0
- package/dist/esm/i18n/ui/components/layout.d.ts +36 -0
- package/dist/esm/i18n/ui/components/popup.d.ts +21 -0
- package/dist/esm/i18n/ui/components/switch.d.ts +17 -0
- package/dist/esm/i18n/ui/components/tabs.d.ts +12 -0
- package/dist/esm/i18n/ui/components/toolbar/customPopupBody.d.ts +16 -0
- package/dist/esm/i18n/ui/components/toolbar/headingPopupBody.d.ts +12 -0
- package/dist/esm/i18n/ui/components/toolbar/imagePopupBody.d.ts +30 -0
- package/dist/esm/i18n/ui/components/toolbar/linkPopupBody.d.ts +18 -0
- package/dist/esm/i18n/ui/components/toolbar/tablePopupBody.d.ts +29 -0
- package/dist/esm/i18n/ui/components/toolbar/toolbar.d.ts +45 -0
- package/dist/esm/i18n/ui/components/toolbar/toolbarGroup.d.ts +21 -0
- package/dist/esm/i18n/ui/toolbarItemFactory.d.ts +13 -0
- package/dist/esm/i18n/ui/vdom/commit.d.ts +2 -0
- package/dist/esm/i18n/ui/vdom/component.d.ts +10 -0
- package/dist/esm/i18n/ui/vdom/dom.d.ts +6 -0
- package/dist/esm/i18n/ui/vdom/render.d.ts +4 -0
- package/dist/esm/i18n/ui/vdom/renderer.d.ts +4 -0
- package/dist/esm/i18n/ui/vdom/template.d.ts +3 -0
- package/dist/esm/i18n/ui/vdom/vnode.d.ts +30 -0
- package/dist/esm/i18n/uk-ua.d.ts +1 -0
- package/dist/esm/i18n/uk-ua.js +63 -0
- package/dist/esm/i18n/utils/common.d.ts +19 -0
- package/dist/esm/i18n/utils/constants.d.ts +8 -0
- package/dist/esm/i18n/utils/dom.d.ts +25 -0
- package/dist/esm/i18n/utils/map.d.ts +19 -0
- package/dist/esm/i18n/utils/markdown.d.ts +23 -0
- package/dist/esm/i18n/viewer.d.ts +77 -0
- package/dist/esm/i18n/widget/rules.d.ts +28 -0
- package/dist/esm/i18n/widget/widgetNode.d.ts +28 -0
- package/dist/esm/i18n/wysiwyg/adaptor/mdLikeNode.d.ts +5 -0
- package/dist/esm/i18n/wysiwyg/adaptor/wwToDOMAdaptor.d.ts +13 -0
- package/dist/esm/i18n/wysiwyg/clipboard/paste.d.ts +6 -0
- package/dist/esm/i18n/wysiwyg/clipboard/pasteMsoList.d.ts +2 -0
- package/dist/esm/i18n/wysiwyg/clipboard/pasteTextParser.d.ts +2 -0
- package/dist/esm/i18n/wysiwyg/clipboard/pasteToTable.d.ts +3 -0
- package/dist/esm/i18n/wysiwyg/command/list.d.ts +7 -0
- package/dist/esm/i18n/wysiwyg/command/table.d.ts +16 -0
- package/dist/esm/i18n/wysiwyg/helper/node.d.ts +37 -0
- package/dist/esm/i18n/wysiwyg/helper/table.d.ts +25 -0
- package/dist/esm/i18n/wysiwyg/helper/tableOffsetMap.d.ts +88 -0
- package/dist/esm/i18n/wysiwyg/markdownInputRules.d.ts +3 -0
- package/dist/esm/i18n/wysiwyg/marks/code.d.ts +31 -0
- package/dist/esm/i18n/wysiwyg/marks/emph.d.ts +34 -0
- package/dist/esm/i18n/wysiwyg/marks/link.d.ts +59 -0
- package/dist/esm/i18n/wysiwyg/marks/strike.d.ts +31 -0
- package/dist/esm/i18n/wysiwyg/marks/strong.d.ts +34 -0
- package/dist/esm/i18n/wysiwyg/nodes/blockQuote.d.ts +33 -0
- package/dist/esm/i18n/wysiwyg/nodes/bulletList.d.ts +43 -0
- package/dist/esm/i18n/wysiwyg/nodes/codeBlock.d.ts +45 -0
- package/dist/esm/i18n/wysiwyg/nodes/customBlock.d.ts +26 -0
- package/dist/esm/i18n/wysiwyg/nodes/doc.d.ts +7 -0
- package/dist/esm/i18n/wysiwyg/nodes/frontMatter.d.ts +21 -0
- package/dist/esm/i18n/wysiwyg/nodes/hardBreak.d.ts +14 -0
- package/dist/esm/i18n/wysiwyg/nodes/heading.d.ts +38 -0
- package/dist/esm/i18n/wysiwyg/nodes/html.d.ts +11 -0
- package/dist/esm/i18n/wysiwyg/nodes/htmlComment.d.ts +21 -0
- package/dist/esm/i18n/wysiwyg/nodes/image.d.ts +45 -0
- package/dist/esm/i18n/wysiwyg/nodes/listItem.d.ts +36 -0
- package/dist/esm/i18n/wysiwyg/nodes/orderedList.d.ts +39 -0
- package/dist/esm/i18n/wysiwyg/nodes/paragraph.d.ts +21 -0
- package/dist/esm/i18n/wysiwyg/nodes/table.d.ts +80 -0
- package/dist/esm/i18n/wysiwyg/nodes/tableBody.d.ts +26 -0
- package/dist/esm/i18n/wysiwyg/nodes/tableBodyCell.d.ts +36 -0
- package/dist/esm/i18n/wysiwyg/nodes/tableHead.d.ts +26 -0
- package/dist/esm/i18n/wysiwyg/nodes/tableHeadCell.d.ts +39 -0
- package/dist/esm/i18n/wysiwyg/nodes/tableRow.d.ts +26 -0
- package/dist/esm/i18n/wysiwyg/nodes/text.d.ts +14 -0
- package/dist/esm/i18n/wysiwyg/nodes/thematicBreak.d.ts +33 -0
- package/dist/esm/i18n/wysiwyg/nodeview/codeBlockView.d.ts +29 -0
- package/dist/esm/i18n/wysiwyg/nodeview/customBlockView.d.ts +29 -0
- package/dist/esm/i18n/wysiwyg/nodeview/imageView.d.ts +20 -0
- package/dist/esm/i18n/wysiwyg/plugins/selection/cellSelection.d.ts +14 -0
- package/dist/esm/i18n/wysiwyg/plugins/selection/tableSelection.d.ts +2 -0
- package/dist/esm/i18n/wysiwyg/plugins/selection/tableSelectionView.d.ts +19 -0
- package/dist/esm/i18n/wysiwyg/plugins/tableContextMenu.d.ts +3 -0
- package/dist/esm/i18n/wysiwyg/plugins/task.d.ts +2 -0
- package/dist/esm/i18n/wysiwyg/plugins/toolbarState.d.ts +3 -0
- package/dist/esm/i18n/wysiwyg/specCreator.d.ts +3 -0
- package/dist/esm/i18n/wysiwyg/wwEditor.d.ts +57 -0
- package/dist/esm/i18n/zh-cn.d.ts +1 -0
- package/dist/esm/i18n/zh-cn.js +63 -0
- package/dist/esm/i18n/zh-tw.d.ts +1 -0
- package/dist/esm/i18n/zh-tw.js +63 -0
- package/dist/esm/index.js +25133 -0
- package/dist/esm/indexViewer.js +12757 -0
- package/dist/i18n/ar.js +162 -0
- package/dist/i18n/cs-cz.js +162 -0
- package/dist/i18n/de-de.js +162 -0
- package/dist/i18n/es-es.js +162 -0
- package/dist/i18n/fi-fi.js +162 -0
- package/dist/i18n/fr-fr.js +162 -0
- package/dist/i18n/gl-es.js +162 -0
- package/dist/i18n/hr-hr.js +162 -0
- package/dist/i18n/it-it.js +162 -0
- package/dist/i18n/ja-jp.js +162 -0
- package/dist/i18n/ko-kr.js +162 -0
- package/dist/i18n/nb-no.js +162 -0
- package/dist/i18n/nl-nl.js +162 -0
- package/dist/i18n/pl-pl.js +162 -0
- package/dist/i18n/pt-br.js +162 -0
- package/dist/i18n/ru-ru.js +163 -0
- package/dist/i18n/sv-se.js +162 -0
- package/dist/i18n/tr-tr.js +162 -0
- package/dist/i18n/uk-ua.js +162 -0
- package/dist/i18n/zh-cn.js +162 -0
- package/dist/i18n/zh-tw.js +162 -0
- package/dist/theme/toastui-editor-dark.css +474 -0
- package/dist/toastui-editor-only.css +1068 -0
- package/dist/toastui-editor-viewer.css +492 -0
- package/dist/toastui-editor-viewer.js +14079 -0
- package/dist/toastui-editor.css +1606 -0
- package/dist/toastui-editor.js +26464 -0
- package/package.json +95 -0
- package/types/convertor.d.ts +143 -0
- package/types/editor.d.ts +383 -0
- package/types/event.d.ts +56 -0
- package/types/index.d.ts +70 -0
- package/types/map.d.ts +8 -0
- package/types/markdown.d.ts +60 -0
- package/types/plugin.d.ts +59 -0
- package/types/prosemirror-commands.d.ts +15 -0
- package/types/prosemirror-model.d.ts +15 -0
- package/types/prosemirror-transform.d.ts +35 -0
- package/types/spec.d.ts +42 -0
- package/types/toastmark.d.ts +357 -0
- package/types/toastui-editor-viewer.d.ts +39 -0
- package/types/ui.d.ts +165 -0
- package/types/wysiwyg.d.ts +36 -0
package/types/ui.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export interface PopupOptions {
|
|
2
|
+
body: HTMLElement;
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ToolbarButtonOptions {
|
|
8
|
+
name: string;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
command?: string;
|
|
12
|
+
text?: string;
|
|
13
|
+
style?: Record<string, any>;
|
|
14
|
+
popup?: PopupOptions;
|
|
15
|
+
state?: ToolbarStateKeys;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ToolbarCustomOptions {
|
|
19
|
+
name: string;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
el?: HTMLElement;
|
|
22
|
+
popup?: PopupOptions;
|
|
23
|
+
hidden?: boolean;
|
|
24
|
+
state?: ToolbarStateKeys;
|
|
25
|
+
onMounted?: (execCommand: ExecCommand) => void;
|
|
26
|
+
onUpdated?: (toolbarState: ToolbarItemState) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ToolbarButtonInfo = {
|
|
30
|
+
hidden?: boolean;
|
|
31
|
+
} & ToolbarButtonOptions;
|
|
32
|
+
|
|
33
|
+
export interface Component<T = {}, R = {}> {
|
|
34
|
+
props: T;
|
|
35
|
+
prevProps?: T;
|
|
36
|
+
state: R;
|
|
37
|
+
vnode: VNode;
|
|
38
|
+
refs: Record<string, HTMLElement>;
|
|
39
|
+
render(): VNode;
|
|
40
|
+
addEvent?(): void;
|
|
41
|
+
mounted?(): void;
|
|
42
|
+
updated?(prevProps: T): void;
|
|
43
|
+
beforeDestroy?(): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface VNodeWalker {
|
|
47
|
+
current: VNode | null;
|
|
48
|
+
|
|
49
|
+
root: VNode | null;
|
|
50
|
+
|
|
51
|
+
entering: boolean;
|
|
52
|
+
|
|
53
|
+
walk: () => { vnode: VNode; entering: boolean } | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface VNode {
|
|
57
|
+
type: string | ComponentClass;
|
|
58
|
+
|
|
59
|
+
props: Record<string, any>;
|
|
60
|
+
|
|
61
|
+
children: VNode[];
|
|
62
|
+
|
|
63
|
+
parent: VNode | null;
|
|
64
|
+
|
|
65
|
+
old: VNode | null;
|
|
66
|
+
|
|
67
|
+
firstChild: VNode | null;
|
|
68
|
+
|
|
69
|
+
next: VNode | null;
|
|
70
|
+
|
|
71
|
+
ref?: (node: Node | Component) => void | Node | Component;
|
|
72
|
+
|
|
73
|
+
node: Node | null;
|
|
74
|
+
|
|
75
|
+
effect: 'A' | 'U' | 'D';
|
|
76
|
+
|
|
77
|
+
component?: Component;
|
|
78
|
+
|
|
79
|
+
skip: boolean;
|
|
80
|
+
|
|
81
|
+
walker: () => VNodeWalker;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ComponentClass {
|
|
85
|
+
new (props?: any): Component;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface Pos {
|
|
89
|
+
left: number;
|
|
90
|
+
top: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type TooltipStyle = {
|
|
94
|
+
display: 'none' | 'block';
|
|
95
|
+
} & Partial<Pos>;
|
|
96
|
+
|
|
97
|
+
export interface PopupInfo {
|
|
98
|
+
className?: string;
|
|
99
|
+
style?: Record<string, any>;
|
|
100
|
+
fromEl: HTMLElement;
|
|
101
|
+
pos: Pos;
|
|
102
|
+
render: (props: Record<string, any>) => VNode | VNode[];
|
|
103
|
+
initialValues?: PopupInitialValues;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type PopupInitialValues = Record<string, any>;
|
|
107
|
+
|
|
108
|
+
export interface TabInfo {
|
|
109
|
+
name: string;
|
|
110
|
+
text: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface ToolbarItemState {
|
|
114
|
+
active: boolean;
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface ToolbarStateMap {
|
|
119
|
+
taskList: ToolbarItemState;
|
|
120
|
+
orderedList: ToolbarItemState;
|
|
121
|
+
bulletList: ToolbarItemState;
|
|
122
|
+
table: ToolbarItemState;
|
|
123
|
+
strong: ToolbarItemState;
|
|
124
|
+
emph: ToolbarItemState;
|
|
125
|
+
strike: ToolbarItemState;
|
|
126
|
+
heading: ToolbarItemState;
|
|
127
|
+
thematicBreak: ToolbarItemState;
|
|
128
|
+
blockQuote: ToolbarItemState;
|
|
129
|
+
code: ToolbarItemState;
|
|
130
|
+
codeBlock: ToolbarItemState;
|
|
131
|
+
indent: ToolbarItemState;
|
|
132
|
+
outdent: ToolbarItemState;
|
|
133
|
+
}
|
|
134
|
+
export type ToolbarStateKeys = keyof ToolbarStateMap;
|
|
135
|
+
|
|
136
|
+
export type ToolbarItemInfo = ToolbarCustomOptions | ToolbarButtonInfo;
|
|
137
|
+
export type ToolbarGroupInfo = ToolbarItemInfo[] & { hidden?: boolean };
|
|
138
|
+
export type ToolbarItemOptions = ToolbarCustomOptions | ToolbarButtonOptions;
|
|
139
|
+
export type ToolbarItem = (string | ToolbarItemOptions)[];
|
|
140
|
+
|
|
141
|
+
export type ExecCommand = (command: string, payload?: Record<string, any>) => void;
|
|
142
|
+
export type HidePopup = () => void;
|
|
143
|
+
export type SetPopupInfo = (info: PopupInfo) => void;
|
|
144
|
+
export type SetItemWidth = (name: string, width: number) => void;
|
|
145
|
+
export type ShowTooltip = (el: HTMLElement) => void;
|
|
146
|
+
export type HideTooltip = () => void;
|
|
147
|
+
export type GetBound = (el: HTMLElement, active?: boolean) => Pos;
|
|
148
|
+
|
|
149
|
+
export interface ContextMenuItem {
|
|
150
|
+
label: string;
|
|
151
|
+
className?: string;
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
onClick?: () => void;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface IndexList {
|
|
157
|
+
groupIndex: number;
|
|
158
|
+
itemIndex: number;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface DefaultUI {
|
|
162
|
+
destroy: () => void;
|
|
163
|
+
insertToolbarItem: (indexList: IndexList, item: string | ToolbarItemOptions) => void;
|
|
164
|
+
removeToolbarItem: (name: string) => void;
|
|
165
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ResolvedPos } from 'prosemirror-model';
|
|
2
|
+
import { Selection } from 'prosemirror-state';
|
|
3
|
+
|
|
4
|
+
export type WwNodeType =
|
|
5
|
+
| 'text'
|
|
6
|
+
| 'paragraph'
|
|
7
|
+
| 'heading'
|
|
8
|
+
| 'codeBlock'
|
|
9
|
+
| 'bulletList'
|
|
10
|
+
| 'orderedList'
|
|
11
|
+
| 'listItem'
|
|
12
|
+
| 'table'
|
|
13
|
+
| 'tableHead'
|
|
14
|
+
| 'tableBody'
|
|
15
|
+
| 'tableRow'
|
|
16
|
+
| 'tableHeadCell'
|
|
17
|
+
| 'tableBodyCell'
|
|
18
|
+
| 'blockQuote'
|
|
19
|
+
| 'thematicBreak'
|
|
20
|
+
| 'image'
|
|
21
|
+
| 'hardBreak'
|
|
22
|
+
| 'lineBreak'
|
|
23
|
+
| 'customBlock'
|
|
24
|
+
| 'frontMatter'
|
|
25
|
+
| 'widget'
|
|
26
|
+
| 'html'
|
|
27
|
+
| 'htmlComment';
|
|
28
|
+
|
|
29
|
+
export type WwMarkType = 'strong' | 'emph' | 'strike' | 'link' | 'code' | 'html';
|
|
30
|
+
|
|
31
|
+
export interface CellSelection extends Selection {
|
|
32
|
+
startCell: ResolvedPos;
|
|
33
|
+
endCell: ResolvedPos;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ColumnAlign = 'left' | 'right' | 'center';
|