@ones-editor/editor 0.0.3 → 0.0.4
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/@ones-editor/auto-link/package.json +8 -0
- package/@ones-editor/auto-link/src/index.d.ts +3 -0
- package/@ones-editor/block-locker/src/hook.d.ts +2 -1
- package/@ones-editor/block-locker/src/i18n/en-US.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/ja-JP.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
- package/@ones-editor/block-locker/src/index.d.ts +4 -1
- package/@ones-editor/block-locker/src/paste-handler.d.ts +4 -0
- package/@ones-editor/block-menu/src/block-menu/index.d.ts +3 -1
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +3 -2
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +3 -0
- package/@ones-editor/block-menu/src/block-menu-button/drag-drop/drag-handler.d.ts +5 -4
- package/@ones-editor/block-menu/src/block-menu-button/drag-drop/find-preview-element.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/drag-preview/index.d.ts +2 -2
- package/@ones-editor/block-menu/src/locale/en-us.d.ts +4 -0
- package/@ones-editor/block-menu/src/locale/ja-jp.d.ts +25 -0
- package/@ones-editor/block-menu/src/locale/zh-cn.d.ts +4 -0
- package/@ones-editor/block-resizer/src/index.d.ts +1 -0
- package/@ones-editor/code-block/src/code-block/caption/caption-input-handler.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/child-container.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
- package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
- package/@ones-editor/code-block/src/code-block/create-empty-code.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
- package/@ones-editor/code-block/src/code-block/settings/index.d.ts +3 -0
- package/@ones-editor/code-block/src/code-block/types.d.ts +3 -0
- package/@ones-editor/code-block/src/icons/copy.d.ts +1 -1
- package/@ones-editor/code-block/src/icons/wrap.d.ts +1 -1
- package/@ones-editor/code-block/src/index.d.ts +2 -0
- package/@ones-editor/code-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/code-block/src/locale/ja-jp.d.ts +12 -0
- package/@ones-editor/code-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/column-block/package.json +8 -0
- package/@ones-editor/column-block/src/child-containers.d.ts +2 -0
- package/@ones-editor/column-block/src/columns-options.d.ts +2 -0
- package/@ones-editor/column-block/src/columns-properties.d.ts +15 -0
- package/@ones-editor/column-block/src/index.d.ts +4 -0
- package/@ones-editor/column-block/src/types.d.ts +11 -0
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
- package/@ones-editor/comments/src/comment-input-handler/paste-handler.d.ts +5 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +2 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/mobile-comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +4 -4
- package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +1 -1
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +3 -11
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +6 -4
- package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -4
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-list.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +5 -3
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +16 -4
- package/@ones-editor/core/src/core/block-renderers/standard-block-render.d.ts +2 -0
- package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/common/block-dom.d.ts +2 -0
- package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +7 -1
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +4 -4
- package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
- package/@ones-editor/core/src/core/boxes/anchor-box/index.d.ts +3 -0
- package/@ones-editor/core/src/core/boxes/editor-boxes.d.ts +1 -0
- package/@ones-editor/core/src/core/boxes/image-box/index.d.ts +3 -0
- package/@ones-editor/core/src/core/boxes/index.d.ts +3 -1
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +3 -2
- package/@ones-editor/core/src/core/composition/clipboard/cut.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/clipboard/paste.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +6 -1
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +3 -1
- package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
- package/@ones-editor/core/src/core/data-converter/editor-data-converter.d.ts +4 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +18 -3
- package/@ones-editor/core/src/core/doc/rich-text/insert-text.d.ts +2 -1
- package/@ones-editor/core/src/core/doc/to-plain-text.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/add-text-attribute.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/auto-insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/delete-block-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
- package/@ones-editor/core/src/core/editor/actions/insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +3 -2
- package/@ones-editor/core/src/core/editor/actions/is-writable.d.ts +1 -1
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +2 -2
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +10 -4
- package/@ones-editor/core/src/core/index.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +5 -1
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/actions/select-block.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/word-offset.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +3 -2
- package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/range/simple-range.d.ts +2 -1
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +5 -1
- package/@ones-editor/core/src/core/settings/index.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +69 -28
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +4 -1
- package/@ones-editor/core/src/helper/block-helper.d.ts +1 -1
- package/@ones-editor/core/src/helper/find-block.d.ts +3 -0
- package/@ones-editor/core/src/helper/index.d.ts +1 -0
- package/@ones-editor/core/src/i18n/en-us.d.ts +3 -0
- package/@ones-editor/core/src/i18n/i18n.d.ts +63 -1
- package/@ones-editor/core/src/i18n/ja-jp.d.ts +20 -0
- package/@ones-editor/core/src/i18n/zh-cn.d.ts +3 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +11 -3
- package/@ones-editor/core/src/utils/abbreviation.d.ts +27 -0
- package/@ones-editor/core/src/utils/client.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
- package/@ones-editor/core/src/utils/dom.d.ts +3 -0
- package/@ones-editor/core/src/utils/file.d.ts +3 -0
- package/@ones-editor/core/src/utils/index.d.ts +2 -0
- package/@ones-editor/core/src/utils/logger/index.d.ts +9 -0
- package/@ones-editor/core/src/utils/overflow-text.d.ts +1 -0
- package/@ones-editor/details-block/package.json +8 -0
- package/@ones-editor/details-block/src/auto-expand.d.ts +7 -0
- package/@ones-editor/details-block/src/create-empty-details.d.ts +8 -0
- package/@ones-editor/details-block/src/details-dom.d.ts +3 -0
- package/@ones-editor/details-block/src/details-object.d.ts +11 -0
- package/@ones-editor/details-block/src/details-options.d.ts +2 -0
- package/@ones-editor/details-block/src/index.d.ts +4 -0
- package/@ones-editor/details-block/src/types.d.ts +5 -0
- package/@ones-editor/details-block/src/update-expand.d.ts +3 -0
- package/@ones-editor/dividing-line-embed/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/dividing-line-embed/src/i18n/ja-jp.d.ts +7 -0
- package/@ones-editor/dividing-line-embed/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/drawio-embed.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/helper/index.d.ts +16 -10
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +9 -4
- package/@ones-editor/drawio-embed/src/lang/index.d.ts +1 -1
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +12 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +9 -4
- package/@ones-editor/drawio-embed/types/index.d.ts +4 -4
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +3 -1
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +7 -0
- package/@ones-editor/drop-target/src/handlers/patch-insert-file.d.ts +2 -0
- package/@ones-editor/drop-target/src/index.d.ts +2 -1
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +3 -1
- package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +14 -0
- package/@ones-editor/embed-block-helper/src/index.d.ts +2 -0
- package/@ones-editor/embed-block-helper/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/embed-block-helper/src/locale/index.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/embed-block-helper/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/excalidraw/package.json +11 -0
- package/@ones-editor/excalidraw/src/excalidraw/block-properties.d.ts +2 -0
- package/@ones-editor/excalidraw/src/excalidraw/editor.d.ts +2 -0
- package/@ones-editor/excalidraw/src/index.d.ts +4 -0
- package/@ones-editor/excalidraw/src/types.d.ts +9 -0
- package/@ones-editor/excalidraw/src/utils/excalidraw-data.d.ts +4 -0
- package/@ones-editor/exclusive-block/package.json +6 -0
- package/@ones-editor/exclusive-block/src/exclusive-block-hook.d.ts +6 -0
- package/@ones-editor/exclusive-block/src/exclusive-block.d.ts +22 -0
- package/@ones-editor/exclusive-block/src/exclusive-dom.d.ts +5 -0
- package/@ones-editor/exclusive-block/src/handle-remote-exclusive-message.d.ts +3 -0
- package/@ones-editor/exclusive-block/src/index.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/locale/index.d.ts +1 -0
- package/@ones-editor/exclusive-block/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/types.d.ts +7 -0
- package/@ones-editor/file/package.json +8 -0
- package/@ones-editor/file/src/file-box/index.d.ts +4 -0
- package/@ones-editor/file/src/file-embed/card/file-icon.d.ts +1 -0
- package/@ones-editor/file/src/file-embed/card/index.d.ts +6 -0
- package/@ones-editor/file/src/file-embed/download-file.d.ts +2 -0
- package/@ones-editor/file/src/file-embed/index.d.ts +4 -0
- package/@ones-editor/file/src/index.d.ts +5 -0
- package/@ones-editor/file/src/locale/en-us.d.ts +12 -0
- package/@ones-editor/file/src/locale/index.d.ts +1 -0
- package/@ones-editor/file/src/locale/ja-jp.d.ts +12 -0
- package/@ones-editor/file/src/locale/zh-cn.d.ts +12 -0
- package/@ones-editor/file/src/types.d.ts +24 -0
- package/@ones-editor/find-dialog/src/doc/doc-handler.d.ts +15 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +4 -1
- package/@ones-editor/find-dialog/src/highlights/highligh-text.d.ts +3 -0
- package/@ones-editor/find-dialog/src/highlights/highlight-dom.d.ts +1 -0
- package/@ones-editor/find-dialog/src/locale/ja-jp.d.ts +13 -0
- package/@ones-editor/graph-embed/assets/index.d.ts +2 -0
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +9 -3
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +5 -3
- package/@ones-editor/graph-embed/src/lang/en-us.d.ts +10 -5
- package/@ones-editor/graph-embed/src/lang/ja-jp.d.ts +13 -0
- package/@ones-editor/graph-embed/src/lang/zh-cn.d.ts +6 -3
- package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
- package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/heading-collapse/src/locale/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/heading-collapse/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/code.d.ts +1 -0
- package/@ones-editor/image-embed/package.json +2 -1
- package/@ones-editor/image-embed/src/copy-handler.d.ts +8 -0
- package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +9 -2
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
- package/@ones-editor/image-embed/src/empty-image-converter.d.ts +5 -0
- package/@ones-editor/image-embed/src/image-data.d.ts +6 -4
- package/@ones-editor/image-embed/src/image-file.d.ts +4 -0
- package/@ones-editor/image-embed/src/image-object.d.ts +5 -1
- package/@ones-editor/image-embed/src/image-resizer.d.ts +3 -0
- package/@ones-editor/image-embed/src/index.d.ts +5 -2
- package/@ones-editor/image-embed/src/locale/en-us.d.ts +2 -1
- package/@ones-editor/image-embed/src/locale/ja-jp.d.ts +17 -0
- package/@ones-editor/image-embed/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/image-embed/src/paste-handler.d.ts +7 -0
- package/@ones-editor/image-embed/src/shortcuts/copy-image.d.ts +2 -0
- package/@ones-editor/image-embed/src/shortcuts/image-clipboard-data.d.ts +7 -0
- package/@ones-editor/image-embed/src/shortcuts/index.d.ts +3 -2
- package/@ones-editor/image-embed/src/types.d.ts +9 -2
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +11 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/input-handlers/src/index.d.ts +2 -2
- package/@ones-editor/input-handlers/src/markdown-shortcuts/index.d.ts +2 -1
- package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +1 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/table-converter.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
- package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
- package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
- package/@ones-editor/list-block/src/index.d.ts +7 -3
- package/@ones-editor/list-block/src/keyboard/shortcut.d.ts +3 -0
- package/@ones-editor/list-block/src/lang/ja-jp.d.ts +21 -0
- package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
- package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
- package/@ones-editor/list-block/src/marker/customize-start-dialog.d.ts +1 -0
- package/@ones-editor/list-block/src/mindmap/index.d.ts +1 -1
- package/@ones-editor/list-block/src/mindmap/to-mindmap/close-mindmap.d.ts +1 -0
- package/@ones-editor/list-block/src/mindmap/to-mindmap/index.d.ts +3 -1
- package/@ones-editor/list-block/src/start/fix-start-by-list.d.ts +9 -0
- package/@ones-editor/list-block/src/types.d.ts +2 -1
- package/@ones-editor/list-block/src/utils/list-brother.d.ts +5 -1
- package/@ones-editor/list-block/src/utils/list-parent.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/latex.d.ts +4 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/paragraph.d.ts +1 -0
- package/@ones-editor/mathjax/package.json +3 -0
- package/@ones-editor/mathjax/src/index.d.ts +2 -1
- package/@ones-editor/mathjax/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/mathjax/src/mathjax-box/convert-mathjax.d.ts +5 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +18 -2
- package/@ones-editor/media-embed/src/core/media-embed.d.ts +4 -2
- package/@ones-editor/media-embed/src/core/media.d.ts +10 -4
- package/@ones-editor/media-embed/src/core/video-resizer.d.ts +1 -0
- package/@ones-editor/media-embed/src/locale/ja-jp.d.ts +19 -0
- package/@ones-editor/media-embed/src/utils/file.d.ts +1 -2
- package/@ones-editor/mention/src/block-mention.d.ts +1 -1
- package/@ones-editor/mention/src/dom/mention-button.d.ts +1 -1
- package/@ones-editor/mention/src/index.d.ts +1 -0
- package/@ones-editor/mention/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/mention/src/locale/index.d.ts +1 -0
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +6 -0
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/mention/src/mention.d.ts +2 -9
- package/@ones-editor/mention/src/types.d.ts +12 -1
- package/@ones-editor/misc/src/index.d.ts +2 -1
- package/@ones-editor/misc/src/is-secure-env.d.ts +1 -0
- package/@ones-editor/mobile-helper/package.json +9 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +11 -0
- package/@ones-editor/paste-handler/src/paste-handler.d.ts +1 -1
- package/@ones-editor/paste-handler/src/text-data-converter.d.ts +2 -2
- package/@ones-editor/paste-special/src/index.d.ts +1 -0
- package/@ones-editor/paste-special/src/locale/en-us.d.ts +8 -0
- package/@ones-editor/paste-special/src/locale/index.d.ts +1 -0
- package/@ones-editor/paste-special/src/locale/ja-jp.d.ts +8 -0
- package/@ones-editor/paste-special/src/locale/zh-cn.d.ts +8 -0
- package/@ones-editor/paste-special/src/paste-special-handler.d.ts +2 -2
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +8 -0
- package/@ones-editor/scroll-container/src/index.d.ts +8 -18
- package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +13 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +3 -0
- package/@ones-editor/scroll-container/src/types.d.ts +3 -1
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +0 -1
- package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +25 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +5 -4
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +14 -4
- package/@ones-editor/sharedb-doc/src/index.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -2
- package/@ones-editor/table-block/src/constant/index.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +27 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-handler.d.ts +14 -1
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-scroll.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar.d.ts +2 -1
- package/@ones-editor/table-block/src/table-block/border-bar/table-row-column-toolbar.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/convert-table-to.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/doc-change-handler.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +2 -2
- package/@ones-editor/table-block/src/table-block/selection-range.d.ts +2 -1
- package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-dom.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +2 -0
- package/@ones-editor/table-block/src/types.d.ts +5 -0
- package/@ones-editor/tabs-block/package.json +8 -0
- package/@ones-editor/tabs-block/src/active-tab.d.ts +2 -0
- package/@ones-editor/tabs-block/src/create-empty-tabs.d.ts +8 -0
- package/@ones-editor/tabs-block/src/index.d.ts +4 -0
- package/@ones-editor/tabs-block/src/tabs-dom.d.ts +4 -0
- package/@ones-editor/tabs-block/src/tabs-object.d.ts +14 -0
- package/@ones-editor/tabs-block/src/tabs-options.d.ts +2 -0
- package/@ones-editor/tabs-block/src/types.d.ts +8 -0
- package/@ones-editor/templates/package.json +9 -0
- package/@ones-editor/templates/src/index.d.ts +4 -0
- package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/templates/src/locale/index.d.ts +1 -0
- package/@ones-editor/templates/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/templates/src/templates/select-template.d.ts +7 -0
- package/@ones-editor/templates/src/templates/types.d.ts +14 -0
- package/@ones-editor/text-commands/src/index.d.ts +2 -1
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -14
- package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +13 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -14
- package/@ones-editor/text-commands/src/shortcut-handler.d.ts +2 -0
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/toc/src/build-toc.d.ts +4 -2
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
- package/@ones-editor/toc/src/index.d.ts +3 -0
- package/@ones-editor/toc/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/toc/src/locale/index.d.ts +1 -0
- package/@ones-editor/toc/src/locale/ja-jp.d.ts +6 -0
- package/@ones-editor/toc/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/toc/src/toc-provider.d.ts +2 -1
- package/@ones-editor/toc/src/types.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +7 -3
- package/@ones-editor/ui/src/locale/en-us.d.ts +12 -20
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +43 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +4 -12
- package/@ones-editor/ui/src/quick-menu/basic-commands.d.ts +5 -0
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +13 -12
- package/@ones-editor/ui/src/quick-menu/index.d.ts +7 -6
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +8 -14
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -2
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +4 -1
- package/@ones-editor/ui/src/quick-menu/types.d.ts +24 -1
- package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/helper.d.ts +1 -1
- package/@ones-editor/ui/src/toolbar/object-commands.d.ts +5 -1
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +3 -1
- package/@ones-editor/ui/src/tooltips/index.d.ts +6 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +24 -13
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +12 -2
- package/@ones-editor/ui-base/src/auto-suggest/editor-auto-suggest-menu.d.ts +12 -0
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/should-focus-to-editor.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +9 -3
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +12 -0
- package/@ones-editor/ui-base/src/command-bar/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/init-toolbar-item.d.ts +6 -0
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +13 -2
- package/@ones-editor/ui-base/src/components/button.d.ts +1 -1
- package/@ones-editor/ui-base/src/components/checkbox.d.ts +3 -0
- package/@ones-editor/ui-base/src/components/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/components/loading.d.ts +2 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/dialog/types.d.ts +4 -0
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +44 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +7 -1
- package/@ones-editor/ui-base/src/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +12 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +6 -5
- package/@ones-editor/versions/src/index.d.ts +1 -1
- package/@ones-editor/versions/src/locale/en-us.d.ts +29 -0
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +44 -0
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +29 -0
- package/@ones-editor/versions/src/types.d.ts +8 -8
- package/@ones-editor/versions/src/utils/index.d.ts +2 -2
- package/@ones-editor/versions/src/version-dialog/index.d.ts +26 -2
- package/@ones-editor/versions/src/version-dialog/play-history.d.ts +1 -2
- package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +23 -0
- package/@ones-editor/versions/src/version-dialog/version-helper.d.ts +3 -0
- package/@ones-editor/versions/src/version-dialog/version-info-header.d.ts +13 -0
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +23 -9
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +27 -0
- package/@ones-editor/webpage-embed/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/webpage-embed/src/locale/ja-jp.d.ts +27 -0
- package/@ones-editor/webpage-embed/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/webpage-embed/src/types.d.ts +3 -0
- package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
- package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -14
- package/dist/comments/create-comment-editor.d.ts +4 -7
- package/dist/comments/local-doc-comments-provider.d.ts +19 -0
- package/dist/comments/{comments-provider.d.ts → sharedb-doc-comments-provider.d.ts} +4 -6
- package/dist/index.d.ts +24 -4
- package/dist/index.js +483 -374
- package/dist/lang/en-us.d.ts +19 -0
- package/dist/lang/index.d.ts +1 -0
- package/dist/lang/ja-jp.d.ts +19 -0
- package/dist/lang/zh-cn.d.ts +19 -0
- package/dist/standard-components.d.ts +3 -0
- package/dist/types.d.ts +45 -5
- package/dist/versions/versions-provider.d.ts +1 -1
- package/package.json +7 -1
- package/@ones-editor/block-menu/src/icons/index.d.ts +0 -4
- package/@ones-editor/graph-embed/src/lang/utils.d.ts +0 -3
- package/@ones-editor/list-block/src/command/covert-to-list.d.ts +0 -3
- package/@ones-editor/versions/src/version-dialog/actions-buttons.d.ts +0 -17
- /package/@ones-editor/block-menu/src/block-menu-button/{drag-drop → drag-preview}/element-to-data-url.d.ts +0 -0
|
@@ -22,5 +22,5 @@ import { editorMovePageUp } from './move-page-up';
|
|
|
22
22
|
import { editorMovePageDown } from './move-page-down';
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
|
-
import { editorSelectAll } from './select-all';
|
|
26
|
-
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, };
|
|
25
|
+
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { ContainerElement, OnesEditor, SimpleSelectionRange } from '../../types';
|
|
2
|
+
export declare function isContainerSelectedAllChildBlocks(container: ContainerElement, range: SimpleSelectionRange): boolean;
|
|
2
3
|
export declare function editorSelectAll(editor: OnesEditor): boolean;
|
|
4
|
+
export declare function editorSelectContainer(editor: OnesEditor, container: ContainerElement): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetWordLeftPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function editorGetWordRightPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorCaret } from '../blocks/text-blocks/caret/editor-caret';
|
|
2
|
-
import { OnesEditorSelection, BlockElement, BlockPosition, SelectionRange, OnesEditor,
|
|
2
|
+
import { OnesEditorSelection, BlockElement, BlockPosition, SelectionRange, OnesEditor, DeleteBlockEventOptions, ChangeSelectionOptions } from '../types';
|
|
3
3
|
export declare class EditorSelection implements OnesEditorSelection {
|
|
4
4
|
readonly editor: OnesEditor;
|
|
5
5
|
readonly caret: EditorCaret;
|
|
@@ -16,7 +16,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
16
16
|
getEndBlock(): BlockElement;
|
|
17
17
|
selectBlock(block: BlockElement, start: number, end?: number): void;
|
|
18
18
|
setSelection(anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions): SelectionRange;
|
|
19
|
-
setRange(range: SelectionRange): SelectionRange;
|
|
19
|
+
setRange(range: SelectionRange, options?: ChangeSelectionOptions): SelectionRange;
|
|
20
20
|
updateSelection(): void;
|
|
21
21
|
getFocusedPos(): BlockPosition;
|
|
22
22
|
getAnchorPos(): BlockPosition;
|
|
@@ -29,6 +29,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
29
29
|
private verifyPos;
|
|
30
30
|
private updateFocusedBlock;
|
|
31
31
|
verify(): void;
|
|
32
|
+
to(type: 'text' | 'markdown' | 'html'): string;
|
|
32
33
|
private removeAllBlockFocusedClass;
|
|
33
34
|
private setBlockFocused;
|
|
34
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnesEditorDocRange } from '../../doc';
|
|
2
|
-
import { OnesEditor, SelectionRange, SelectedBlock, ContainerElement } from '../../types';
|
|
2
|
+
import { OnesEditor, SelectionRange, SelectedBlock, ContainerElement, SimpleSelectionRange } from '../../types';
|
|
3
3
|
import { EditorSimpleBlockPosition } from '../editor-position';
|
|
4
4
|
interface SimpleRangeOptions {
|
|
5
5
|
anchor: EditorSimpleBlockPosition;
|
|
@@ -26,5 +26,6 @@ export default class EditorSimpleSelectionRange implements SelectionRange {
|
|
|
26
26
|
getFocusedPos(): EditorSimpleBlockPosition;
|
|
27
27
|
clone(): EditorSimpleSelectionRange;
|
|
28
28
|
toDocRange(): OnesEditorDocRange;
|
|
29
|
+
static from(editor: OnesEditor, other: SimpleSelectionRange): EditorSimpleSelectionRange;
|
|
29
30
|
}
|
|
30
31
|
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { OnesEditorSelectionHandler, BlockPosition, OnesEditor } from '../types';
|
|
2
|
+
import { AutoScroll } from '../../utils';
|
|
2
3
|
export declare class EditorSelectionHandler implements OnesEditorSelectionHandler {
|
|
3
4
|
editor: OnesEditor;
|
|
4
5
|
startPos: BlockPosition | null;
|
|
5
6
|
lastCaretRect: DOMRect;
|
|
6
7
|
mouseDownEvent: MouseEvent | null;
|
|
8
|
+
autoScroll: AutoScroll | null;
|
|
7
9
|
constructor(editor: OnesEditor);
|
|
8
10
|
isSelecting(): boolean;
|
|
9
11
|
stopSelection(): void;
|
|
10
|
-
handleMouseDown: (event: MouseEvent
|
|
12
|
+
handleMouseDown: (event: MouseEvent, options: {
|
|
13
|
+
autoScroll: boolean;
|
|
14
|
+
}) => void;
|
|
11
15
|
handleMouseMove: (event: MouseEvent) => void;
|
|
12
16
|
handleMouseUp: (event: MouseEvent) => void;
|
|
13
17
|
handleDblClick(event: MouseEvent): void;
|
|
@@ -3,7 +3,7 @@ export default class DefaultSettingsProvider implements OnesEditorSettingsProvid
|
|
|
3
3
|
private editor;
|
|
4
4
|
constructor(editor: OnesEditor);
|
|
5
5
|
getKey(key: string): string;
|
|
6
|
-
getItem(key: string):
|
|
7
|
-
setItem(key: string, value: string | null):
|
|
8
|
-
removeItem(key: string):
|
|
6
|
+
getItem(key: string): string | null;
|
|
7
|
+
setItem(key: string, value: string | null): void;
|
|
8
|
+
removeItem(key: string): void;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import { DocBlock, DocBlockAttributes, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, OnesEditorDoc, OnesEditorDocRange } from './doc';
|
|
2
|
+
import { DocBlock, DocBlockAttributes, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange } from './doc';
|
|
3
3
|
export type ContainerElement = HTMLDivElement & {
|
|
4
4
|
__neverUse: 'ContainerElement';
|
|
5
5
|
};
|
|
@@ -49,12 +49,23 @@ export interface ComplexBlockPosition {
|
|
|
49
49
|
isSimple: () => false;
|
|
50
50
|
}
|
|
51
51
|
export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
|
|
52
|
+
export interface BoxCommands {
|
|
53
|
+
group: string;
|
|
54
|
+
commands: CommandItem[];
|
|
55
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
|
|
56
|
+
}
|
|
57
|
+
export interface BoxProperties {
|
|
58
|
+
boxCommands?: Record<string, BoxCommands>;
|
|
59
|
+
abstract?: string;
|
|
60
|
+
}
|
|
52
61
|
export interface Box {
|
|
53
62
|
boxType: string;
|
|
54
63
|
updateBoxContent: (editor: OnesEditor, boxElement: BoxElement, boxContent: BoxContentElement, boxData: DocBox) => void;
|
|
55
64
|
convertFrom?: (editor: OnesEditor, text: string) => DocBox | null;
|
|
65
|
+
convertTo?: (editor: OnesEditor, boxData: DocBox, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
56
66
|
handleClickBox?: (editor: OnesEditor, box: BoxElement, event: MouseEvent) => void;
|
|
57
67
|
toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
|
|
68
|
+
getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
|
|
58
69
|
}
|
|
59
70
|
export interface Insertion {
|
|
60
71
|
insertionType: string;
|
|
@@ -79,12 +90,13 @@ export interface Embed {
|
|
|
79
90
|
getOptions?: (editor: OnesEditor) => EmbedOptions;
|
|
80
91
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
81
92
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock) => boolean;
|
|
82
|
-
handleDropOver?: (editor: OnesEditor, block: BlockElement,
|
|
83
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement,
|
|
93
|
+
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | undefined;
|
|
94
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
84
95
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
85
96
|
offset: number;
|
|
86
97
|
data?: DocBlockAttributes;
|
|
87
98
|
}) => ConvertBlockResult | null;
|
|
99
|
+
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath) => Promise<DocObject | undefined>;
|
|
88
100
|
}
|
|
89
101
|
export interface ConvertBlockResult {
|
|
90
102
|
blockData: DocBlock;
|
|
@@ -96,8 +108,9 @@ export interface DeleteBlockEventOptions {
|
|
|
96
108
|
}
|
|
97
109
|
export type CommandItemType = 'normal' | 'separator' | 'section';
|
|
98
110
|
export type CommandItemState = 'disabled' | 'checked' | 'selected';
|
|
111
|
+
export type CloseReason = 'selectionChange' | 'clickItem' | 'clickBackground' | 'cancelBar' | 'fromHover' | 'switchItem' | null;
|
|
99
112
|
export interface Closeable {
|
|
100
|
-
close: () => void;
|
|
113
|
+
close: (reason: CloseReason) => void;
|
|
101
114
|
click: (item: CommandItem, target: HTMLElement) => void;
|
|
102
115
|
}
|
|
103
116
|
export type CommandItemChildrenPlacement = 'auto' | 'top' | 'left' | 'right' | 'bottom' | 'auto-start' | 'auto-end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
@@ -109,7 +122,7 @@ export interface CommandItem {
|
|
|
109
122
|
value?: string;
|
|
110
123
|
order?: number;
|
|
111
124
|
type?: CommandItemType;
|
|
112
|
-
element?: HTMLElement;
|
|
125
|
+
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
113
126
|
icon?: string;
|
|
114
127
|
childrenType?: 'menu' | 'toolbar';
|
|
115
128
|
children?: CommandItem[];
|
|
@@ -121,6 +134,12 @@ export interface CommandItem {
|
|
|
121
134
|
manualShowChildren?: boolean;
|
|
122
135
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
123
136
|
childrenOffset?: [number, number];
|
|
137
|
+
childArrow?: boolean;
|
|
138
|
+
subText?: string;
|
|
139
|
+
defaultCheckedChildren?: string[];
|
|
140
|
+
ellipsisTooltip?: string;
|
|
141
|
+
disableTooltip?: boolean;
|
|
142
|
+
disableReason?: string;
|
|
124
143
|
setCloseable?: (closeable: Closeable) => void;
|
|
125
144
|
beforePopup?: (parent: unknown) => void;
|
|
126
145
|
}
|
|
@@ -189,13 +208,13 @@ export interface Block {
|
|
|
189
208
|
clearSelection: (editor: OnesEditor) => void;
|
|
190
209
|
getBlockProperties?: (editor: OnesEditor, block: BlockElement) => BlockProperties;
|
|
191
210
|
getOptions?: (editor: OnesEditor) => BlockOptions;
|
|
192
|
-
notify?: (editor: OnesEditor, command: string, params?: unknown) =>
|
|
211
|
+
notify?: (editor: OnesEditor, command: string, params?: unknown) => unknown | undefined;
|
|
193
212
|
handleBlockElementUpdated?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => void;
|
|
194
213
|
handleContainerResized?: (editor: OnesEditor, block: BlockElement) => void;
|
|
195
214
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
196
215
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => boolean;
|
|
197
|
-
handleDropOver?: (editor: OnesEditor, block: BlockElement,
|
|
198
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement,
|
|
216
|
+
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | false | undefined;
|
|
217
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
199
218
|
getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
|
|
200
219
|
getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
|
|
201
220
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
@@ -203,7 +222,7 @@ export interface Block {
|
|
|
203
222
|
data?: DocBlockAttributes;
|
|
204
223
|
}) => ConvertBlockResult | null;
|
|
205
224
|
selectionToDoc?: (editor: OnesEditor, selectedBlock: SelectedBlock) => DocObject;
|
|
206
|
-
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
225
|
+
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath) => string;
|
|
207
226
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
208
227
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
209
228
|
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
|
|
@@ -219,9 +238,12 @@ export interface TextKindBlock extends Block {
|
|
|
219
238
|
export interface NextContainerOptions {
|
|
220
239
|
noWrap?: boolean;
|
|
221
240
|
}
|
|
241
|
+
export interface GetChildContainerOptions {
|
|
242
|
+
visibleOnly?: boolean;
|
|
243
|
+
}
|
|
222
244
|
export interface ComplexKindBlock extends Block {
|
|
223
245
|
enableKeyboardSelect?: boolean;
|
|
224
|
-
getChildContainers: (editor: OnesEditor, complexBlock: BlockElement) => ContainerElement[];
|
|
246
|
+
getChildContainers: (editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions) => ContainerElement[];
|
|
225
247
|
getNextContainer: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement, type: MoveDirection, options?: NextContainerOptions) => ContainerElement | null;
|
|
226
248
|
getSelectedContainers: (editor: OnesEditor, complexBlock: BlockElement, start: ComplexBlockPosition, end: ComplexBlockPosition) => ContainerElement[];
|
|
227
249
|
adjustSelectionPos?: (editor: OnesEditor, complexBlock: BlockElement, anchor: ComplexBlockPosition, focus: ComplexBlockPosition) => {
|
|
@@ -325,18 +347,19 @@ export interface OnesEditorBlockRenderers {
|
|
|
325
347
|
export type OnesEditorDocSource = 'text/html' | 'text/office-html' | 'text/plain' | 'text/markdown' | 'image/*' | 'text/x-ones-editor-doc' | '*';
|
|
326
348
|
export type OnesEditorDocs = Partial<Record<OnesEditorDocSource, DocObject>>;
|
|
327
349
|
export interface OnesEditorDataConverter {
|
|
328
|
-
fromData: (editor: OnesEditor, data: DataTransfer) => Promise<OnesEditorDocs | undefined>;
|
|
350
|
+
fromData: (editor: OnesEditor, data: DataTransfer, options?: PasteOptions) => Promise<OnesEditorDocs | undefined>;
|
|
329
351
|
}
|
|
330
352
|
export interface OnesEditorDataConverters {
|
|
331
|
-
fromData: (editor: OnesEditor, data: DataTransfer) => Promise<OnesEditorDocs | undefined>;
|
|
353
|
+
fromData: (editor: OnesEditor, data: DataTransfer, options?: PasteOptions) => Promise<OnesEditorDocs | undefined>;
|
|
332
354
|
addConverter: (converter: OnesEditorDataConverter) => void;
|
|
333
355
|
}
|
|
334
356
|
export interface BreakTextOptions {
|
|
335
357
|
forceInsertAfter?: boolean;
|
|
336
358
|
newBlockData?: DocBlock;
|
|
359
|
+
copyBlockAttributes?: boolean;
|
|
337
360
|
}
|
|
338
361
|
export interface OnesEditorEvents {
|
|
339
|
-
'docChanged': (editor: OnesEditor) => void;
|
|
362
|
+
'docChanged': (editor: OnesEditor, local: boolean) => void;
|
|
340
363
|
'readonlyChanged': (editor: OnesEditor) => void;
|
|
341
364
|
'selectionChanged': (editor: OnesEditor) => void;
|
|
342
365
|
'focusBlockChanged': (editor: OnesEditor, newBlock: BlockElement | null, oldBlock: BlockElement | null) => void;
|
|
@@ -345,15 +368,17 @@ export interface OnesEditorEvents {
|
|
|
345
368
|
'resize': (editor: OnesEditor) => void;
|
|
346
369
|
'load': (editor: OnesEditor, reload: boolean) => void;
|
|
347
370
|
'click': (editor: OnesEditor, event: MouseEvent) => void;
|
|
371
|
+
'clickLink': (editor: OnesEditor, event: MouseEvent, link: Element) => void;
|
|
348
372
|
'beforeClearSelection': (editor: OnesEditor) => void;
|
|
349
373
|
'afterClearSelection': (editor: OnesEditor) => void;
|
|
350
374
|
'blur': (editor: OnesEditor) => void;
|
|
351
375
|
'focus': (editor: OnesEditor) => void;
|
|
376
|
+
'containerRemount': (editor: OnesEditor, containerId: string) => void;
|
|
352
377
|
}
|
|
353
378
|
export interface OnesEditorSettingsProvider {
|
|
354
|
-
getItem: (key: string) =>
|
|
355
|
-
setItem: (key: string, value: string | null) =>
|
|
356
|
-
removeItem: (key: string) =>
|
|
379
|
+
getItem: (key: string) => string | null;
|
|
380
|
+
setItem: (key: string, value: string | null) => void;
|
|
381
|
+
removeItem: (key: string) => void;
|
|
357
382
|
}
|
|
358
383
|
export interface OnesEditorOptionalOptions {
|
|
359
384
|
shortcuts?: ShortcutRecords[];
|
|
@@ -361,6 +386,7 @@ export interface OnesEditorOptionalOptions {
|
|
|
361
386
|
components?: OnesEditorComponents;
|
|
362
387
|
colors?: string[];
|
|
363
388
|
scrollContainer?: HTMLElement;
|
|
389
|
+
enableComments?: boolean;
|
|
364
390
|
settingsProvider?: OnesEditorSettingsProvider;
|
|
365
391
|
}
|
|
366
392
|
export interface OnesEditorOptions {
|
|
@@ -368,6 +394,7 @@ export interface OnesEditorOptions {
|
|
|
368
394
|
componentsOptions: {
|
|
369
395
|
[index: string]: unknown;
|
|
370
396
|
};
|
|
397
|
+
enableComments?: boolean;
|
|
371
398
|
scrollContainer?: HTMLElement;
|
|
372
399
|
}
|
|
373
400
|
export interface OnesEditorComponents {
|
|
@@ -401,7 +428,7 @@ export declare class OnesEditorCustomDataWrapper<T> {
|
|
|
401
428
|
private editor;
|
|
402
429
|
private data;
|
|
403
430
|
constructor(editor: OnesEditor, data: T);
|
|
404
|
-
getData
|
|
431
|
+
getData(): T;
|
|
405
432
|
getEditor(): OnesEditor;
|
|
406
433
|
destroy(): void;
|
|
407
434
|
}
|
|
@@ -411,10 +438,11 @@ export interface CloneBlockResultInfo {
|
|
|
411
438
|
blockIdMap: Map<string, string>;
|
|
412
439
|
}
|
|
413
440
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
414
|
-
addEventListener: (element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event:
|
|
441
|
+
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
415
442
|
removeEventListener: (element: Element | Document | Window | null, eventName: string | null, eventHandler: (editor: OnesEditor, event: Event) => void) => void;
|
|
416
443
|
removeAllListeners: (element: Element | Document | Window, eventName?: string) => void;
|
|
417
444
|
}
|
|
445
|
+
export type InsertTextOptions = InsertBlockOptions;
|
|
418
446
|
export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
419
447
|
readonly parent: HTMLElement;
|
|
420
448
|
readonly rootElement: HTMLDivElement;
|
|
@@ -460,7 +488,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
460
488
|
tryFocusToChildSimpleBlock?: boolean;
|
|
461
489
|
}) => void;
|
|
462
490
|
isWritable: () => boolean;
|
|
463
|
-
isBlockWritable: (block: BlockElement) => boolean;
|
|
491
|
+
isBlockWritable: (block: BlockElement | BlockElement[]) => boolean;
|
|
464
492
|
reload: () => void;
|
|
465
493
|
getChildContainerData: (childContainerId: string) => DocBlocks;
|
|
466
494
|
createChildContainer: (path: BlockPath, parentElement: HTMLElement, childContainerId: string) => ContainerElement;
|
|
@@ -479,7 +507,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
479
507
|
contains: (node: Node) => boolean;
|
|
480
508
|
getSelectedText: () => string;
|
|
481
509
|
clearSelectedContents: () => void;
|
|
482
|
-
insertBlock: (containerId: string, blockIndex: number, blockData: DocBlock, newRange?: OnesEditorDocRange) => BlockElement;
|
|
510
|
+
insertBlock: (containerId: string, blockIndex: number, blockData: DocBlock, newRange?: OnesEditorDocRange, options?: InsertBlockOptions) => BlockElement;
|
|
483
511
|
insertEmbed: (containerId: string, blockIndex: number, embedType: string, embedData: DocEmbedData, newRange?: OnesEditorDocRange) => BlockElement;
|
|
484
512
|
deleteBlock: (block: BlockElement, newRange?: OnesEditorDocRange) => void;
|
|
485
513
|
getTextPosition: () => BlockTextPosition;
|
|
@@ -490,8 +518,8 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
490
518
|
getBlockText: (block: BlockElement) => DocBlockText;
|
|
491
519
|
setBlockText: (block: BlockElement, text: DocBlockText) => void;
|
|
492
520
|
getBoxData: (box: BoxElement) => DocBox;
|
|
493
|
-
deleteTextFromBlock: (block: BlockElement, offset: number, count: number) => number;
|
|
494
|
-
insertTextToBlock: (block: BlockElement, offset: number, text: string | DocBlockText) => DocBlockText;
|
|
521
|
+
deleteTextFromBlock: (block: BlockElement, offset: number, count: number, options?: InsertTextOptions) => number;
|
|
522
|
+
insertTextToBlock: (block: BlockElement, offset: number, text: string | DocBlockText, options?: InsertTextOptions) => DocBlockText;
|
|
495
523
|
insertBoxToBlock: (block: BlockElement, offset: number, boxData: DocBox) => DocBlockText;
|
|
496
524
|
mergeTextBlock: (block1: BlockElement, block2: BlockElement, options?: {
|
|
497
525
|
focus?: boolean;
|
|
@@ -499,6 +527,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
499
527
|
breakTextBlock: (block: BlockElement, offset: number, options?: BreakTextOptions) => BlockElement;
|
|
500
528
|
insertTextBlock: (text?: string | DocBlockText, containerId?: string, blockIndex?: number, options?: {
|
|
501
529
|
newRange?: OnesEditorDocRange;
|
|
530
|
+
insertBlockOptions?: InsertBlockOptions;
|
|
502
531
|
}) => BlockElement;
|
|
503
532
|
insertDoc: (block: BlockElement, offset: number, doc: DocObject, cloneDocResult?: CloneBlockResultInfo) => void;
|
|
504
533
|
insertDocAt: (container: ContainerElement, blockIndex: number, doc: DocObject, cloneDocResult?: CloneBlockResultInfo) => BlockElement[];
|
|
@@ -520,7 +549,7 @@ export interface OnesEditorSelection {
|
|
|
520
549
|
readonly startBlock: BlockElement;
|
|
521
550
|
readonly endBlock: BlockElement;
|
|
522
551
|
setSelection: (anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions) => SelectionRange;
|
|
523
|
-
setRange: (range: SelectionRange) => SelectionRange;
|
|
552
|
+
setRange: (range: SelectionRange, options?: ChangeSelectionOptions) => SelectionRange;
|
|
524
553
|
selectBlock: (block: BlockElement, start: number, end?: number) => void;
|
|
525
554
|
updateSelection: (old: SelectionRange | null) => void;
|
|
526
555
|
updateLastCaretRect: () => void;
|
|
@@ -528,8 +557,12 @@ export interface OnesEditorSelection {
|
|
|
528
557
|
getAnchorPos: () => BlockPosition;
|
|
529
558
|
getFocusedPos: () => BlockPosition;
|
|
530
559
|
scrollIntoView: () => void;
|
|
560
|
+
to: (type: 'text' | 'markdown' | 'html') => string;
|
|
531
561
|
}
|
|
532
562
|
export type RemoteChangeType = 'UpdateBlockText' | 'UpdateBlockData' | 'InsertBlock' | 'DeleteBlock' | 'InsertChildContainer' | 'DeleteChildContainer';
|
|
563
|
+
export type PasteOptions = {
|
|
564
|
+
toPlainText?: boolean;
|
|
565
|
+
};
|
|
533
566
|
export interface OnesEditorInput {
|
|
534
567
|
readonly inputElement: HTMLInputElement;
|
|
535
568
|
destroy: () => void;
|
|
@@ -541,6 +574,7 @@ export interface OnesEditorInput {
|
|
|
541
574
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
542
575
|
handleChanged: (action: OnesEditorUndoAction) => void;
|
|
543
576
|
handleRemoteChanged: (type: RemoteChangeType) => void;
|
|
577
|
+
handlePasteText: (text: string, options?: PasteOptions) => void;
|
|
544
578
|
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
545
579
|
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
546
580
|
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
@@ -549,7 +583,9 @@ export interface OnesEditorInput {
|
|
|
549
583
|
export interface OnesEditorSelectionHandler {
|
|
550
584
|
isSelecting: () => boolean;
|
|
551
585
|
stopSelection: () => void;
|
|
552
|
-
handleMouseDown: (event: MouseEvent
|
|
586
|
+
handleMouseDown: (event: MouseEvent, options: {
|
|
587
|
+
autoScroll: boolean;
|
|
588
|
+
}) => void;
|
|
553
589
|
handleMouseMove: (event: MouseEvent) => void;
|
|
554
590
|
handleMouseUp: (event: MouseEvent) => void;
|
|
555
591
|
handleDblClick: (event: MouseEvent) => void;
|
|
@@ -560,14 +596,17 @@ export interface OnesEditorCaret {
|
|
|
560
596
|
visible: () => boolean;
|
|
561
597
|
}
|
|
562
598
|
export interface OnesEditorInputHandler {
|
|
599
|
+
order?: number;
|
|
563
600
|
handleBeforeInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
|
|
564
601
|
handleAfterInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
|
|
565
602
|
handleBeforeKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
566
603
|
handleAfterKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
567
|
-
|
|
568
|
-
|
|
604
|
+
handleBeforeCopy?: (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
605
|
+
handleBeforeCut?: (editor: OnesEditor, event: ClipboardEvent) => DocObject | boolean | undefined;
|
|
606
|
+
handleBeforePaste?: (editor: OnesEditor, event: ClipboardEvent | null, doc: OnesEditorDocs) => Promise<boolean>;
|
|
607
|
+
handleAfterPaste?: (editor: OnesEditor, event: ClipboardEvent | null, doc: OnesEditorDocs) => Promise<boolean>;
|
|
569
608
|
handleBeforePasteDoc?: (editor: OnesEditor, doc: DocObject) => Promise<boolean>;
|
|
570
|
-
handleAfterPasteDoc?: (editor: OnesEditor, doc: DocObject) => Promise<boolean>;
|
|
609
|
+
handleAfterPasteDoc?: (editor: OnesEditor, doc: DocObject, cloneDocResult: CloneBlockResultInfo) => Promise<boolean>;
|
|
571
610
|
handleChanged?: (editor: OnesEditor, action: OnesEditorUndoAction) => void;
|
|
572
611
|
handleRemoteChanged?: (editor: OnesEditor, type: RemoteChangeType) => void;
|
|
573
612
|
handleCompositionStart?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number) => void;
|
|
@@ -579,6 +618,7 @@ export interface OnesEditorBlocks {
|
|
|
579
618
|
getBlockClass: (type: string) => Block;
|
|
580
619
|
createBlock: (path: BlockPath, container: ContainerElement, block: DocBlock) => BlockElement;
|
|
581
620
|
forEach: (callback: (blockClass: Block) => void) => void;
|
|
621
|
+
hasBlock: (type: string) => boolean;
|
|
582
622
|
}
|
|
583
623
|
export interface OnesEditorEmbeds {
|
|
584
624
|
registerEmbedClass: (embedClass: Embed) => void;
|
|
@@ -589,6 +629,7 @@ export interface OnesEditorBoxes {
|
|
|
589
629
|
registerBoxClass: (boxClass: Box) => void;
|
|
590
630
|
getBoxClass: (type: string) => Box;
|
|
591
631
|
createBox: (blockContent: BlockContentElement, box: DocBox) => BoxElement;
|
|
632
|
+
forEach: (callback: (boxClass: Box) => void) => void;
|
|
592
633
|
}
|
|
593
634
|
export interface OnesEditorInsertions {
|
|
594
635
|
registerInsertionClass: (insertionClass: Insertion) => void;
|
|
@@ -635,6 +676,6 @@ export interface EditorDocLocalActionCallbacks {
|
|
|
635
676
|
export interface OnesEditorBlockHook {
|
|
636
677
|
create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
637
678
|
update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
638
|
-
writable?: (editor: OnesEditor, blockElement: BlockElement) => boolean | undefined;
|
|
679
|
+
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
639
680
|
commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
|
|
640
681
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnesEditorDocRange } from '../../doc/doc';
|
|
1
|
+
import { DocBlock, OnesEditorDocRange } from '../../doc/doc';
|
|
2
2
|
import { OnesEditor, OnesEditorUndoAction } from '../../types';
|
|
3
3
|
export default class Action implements OnesEditorUndoAction {
|
|
4
4
|
protected containerId: string;
|
|
@@ -10,4 +10,7 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
10
10
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
11
11
|
combine(other: OnesEditorUndoAction): void;
|
|
12
12
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
13
|
+
findContainerById(editor: OnesEditor, id: string): boolean;
|
|
14
|
+
findBlockById(editor: OnesEditor, id: string): boolean;
|
|
15
|
+
checkBlockData(editor: OnesEditor, blockData: DocBlock): boolean;
|
|
13
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BlockElement } from '../core';
|
|
1
|
+
import { BlockElement } from '../core/types';
|
|
2
2
|
export declare function isRootBlock(block: BlockElement): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../core/types';
|
|
2
|
+
export declare function findPrevVisibleSimpleBlock(editor: OnesEditor, block: BlockElement): BlockElement | null;
|
|
3
|
+
export declare function findNextVisibleSimpleBlock(editor: OnesEditor, block: BlockElement): BlockElement | null;
|
|
@@ -3,3 +3,4 @@ import type { OnesEditorHoveringBlockFilter, OnesEditorHoveringBlockFinder } fro
|
|
|
3
3
|
export { OnesEditorHoveringBlock, OnesEditorHoveringBlockFilter, OnesEditorHoveringBlockFinder };
|
|
4
4
|
export * from './block-helper';
|
|
5
5
|
export * from './run-once';
|
|
6
|
+
export * from './find-block';
|
|
@@ -1,3 +1,65 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type LANGS = keyof typeof langs;
|
|
2
|
+
declare const langs: {
|
|
3
|
+
'en-US': {
|
|
4
|
+
name: string;
|
|
5
|
+
date: {
|
|
6
|
+
dateFromFuture: string;
|
|
7
|
+
dateJustNow: string;
|
|
8
|
+
dateYesterday: string;
|
|
9
|
+
dateMinutesAgo: string;
|
|
10
|
+
date1HourAgo: string;
|
|
11
|
+
dateHoursAgo: string;
|
|
12
|
+
dateDaysAgo: string;
|
|
13
|
+
dateWeeksAgo: string;
|
|
14
|
+
};
|
|
15
|
+
common: {
|
|
16
|
+
cancel: string;
|
|
17
|
+
};
|
|
18
|
+
docx: {
|
|
19
|
+
imageExportFailed: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
'zh-CN': {
|
|
23
|
+
name: string;
|
|
24
|
+
date: {
|
|
25
|
+
dateFromFuture: string;
|
|
26
|
+
dateJustNow: string;
|
|
27
|
+
dateYesterday: string;
|
|
28
|
+
dateMinutesAgo: string;
|
|
29
|
+
date1HourAgo: string;
|
|
30
|
+
dateHoursAgo: string;
|
|
31
|
+
dateDaysAgo: string;
|
|
32
|
+
dateWeeksAgo: string;
|
|
33
|
+
};
|
|
34
|
+
common: {
|
|
35
|
+
cancel: string;
|
|
36
|
+
};
|
|
37
|
+
docx: {
|
|
38
|
+
imageExportFailed: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
'ja-JP': {
|
|
42
|
+
name: string;
|
|
43
|
+
date: {
|
|
44
|
+
dateFromFuture: string;
|
|
45
|
+
dateJustNow: string;
|
|
46
|
+
dateYesterday: string;
|
|
47
|
+
dateMinutesAgo: string;
|
|
48
|
+
date1HourAgo: string;
|
|
49
|
+
dateHoursAgo: string;
|
|
50
|
+
dateDaysAgo: string;
|
|
51
|
+
dateWeeksAgo: string;
|
|
52
|
+
};
|
|
53
|
+
common: {
|
|
54
|
+
cancel: string;
|
|
55
|
+
};
|
|
56
|
+
docx: {
|
|
57
|
+
imageExportFailed: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export declare function setLang(lang?: LANGS | null | undefined): void;
|
|
2
62
|
export declare function mergeLang(l: any): void;
|
|
3
63
|
export declare function t(key: string, args?: Record<string, string>): string;
|
|
64
|
+
export declare function getCurrentLang(): "en-US" | "zh-CN" | "ja-JP";
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
date: {
|
|
4
|
+
dateFromFuture: string;
|
|
5
|
+
dateJustNow: string;
|
|
6
|
+
dateYesterday: string;
|
|
7
|
+
dateMinutesAgo: string;
|
|
8
|
+
date1HourAgo: string;
|
|
9
|
+
dateHoursAgo: string;
|
|
10
|
+
dateDaysAgo: string;
|
|
11
|
+
dateWeeksAgo: string;
|
|
12
|
+
};
|
|
13
|
+
common: {
|
|
14
|
+
cancel: string;
|
|
15
|
+
};
|
|
16
|
+
docx: {
|
|
17
|
+
imageExportFailed: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import { DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorUser, UploadResourceOptions, UploadResourceResult } from '../core/doc';
|
|
1
|
+
import { DocBlock, DocBlockDelta, DocBlockText, OnesEditorDocServerMeta, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorUser, UploadResourceOptions, UploadResourceResult } from '../core/doc';
|
|
2
2
|
import { EventCallbacks } from '../utils';
|
|
3
3
|
import { RemoteUsers } from '../users';
|
|
4
4
|
export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> implements OnesEditorDoc {
|
|
5
5
|
doc: DocObject;
|
|
6
|
-
|
|
6
|
+
serviceUrl: string;
|
|
7
|
+
constructor(doc: DocObject | null, options?: {
|
|
8
|
+
serverUrl?: string;
|
|
9
|
+
});
|
|
7
10
|
beginBatchUpdate(): number;
|
|
8
11
|
endBatchUpdate(): number;
|
|
9
12
|
toJSON(): DocObject;
|
|
10
13
|
getContainerBlocks(containerId: string): DocBlock[];
|
|
14
|
+
findContainerBlocks(containerId: string): DocBlock[];
|
|
11
15
|
getBlockData(containerId: string, blockIndex: number): DocBlock;
|
|
12
16
|
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): DocBlockText;
|
|
13
17
|
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta): DocBlock;
|
|
14
18
|
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock): DocBlock;
|
|
15
19
|
localDeleteBlock(containerId: string, blockIndex: number): DocBlock;
|
|
16
|
-
|
|
20
|
+
localInsertChildContainers(containers: {
|
|
21
|
+
containerId: string;
|
|
22
|
+
blocks: DocBlock[];
|
|
23
|
+
}[]): void;
|
|
17
24
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
18
25
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
19
26
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
20
27
|
buildResourceUrl(src: string): string;
|
|
21
28
|
request<T>(url: string, opt?: any): Promise<T>;
|
|
22
29
|
broadcastMessage(data: unknown): void;
|
|
30
|
+
getServerMeta(): OnesEditorDocServerMeta;
|
|
23
31
|
getUser(): OnesEditorUser;
|
|
24
32
|
getRemoteUsers(): RemoteUsers;
|
|
25
33
|
setDoc(doc: DocObject): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function hashCode(str: string): number;
|
|
2
|
+
/**
|
|
3
|
+
* 用户名缩写
|
|
4
|
+
* @param name 用户名
|
|
5
|
+
* @param maxLength 最大展示长度
|
|
6
|
+
* @returns 缩写
|
|
7
|
+
* 规则:
|
|
8
|
+
* 1. 中日韩字符,从后往前取
|
|
9
|
+
* 2. 英文字符、特殊字符、数字,从前往后取,如果有空格比如 `Mike Tracy` 取 MT
|
|
10
|
+
* 3. emoji,从后往前取
|
|
11
|
+
* 4. 默认处理从前取
|
|
12
|
+
*/
|
|
13
|
+
export declare function abbreviation(name: string, maxLength?: number): string;
|
|
14
|
+
declare enum EColor {
|
|
15
|
+
blue = "#338FE5",
|
|
16
|
+
cyan = "#34AFDE",
|
|
17
|
+
teal = "#2CB2AE",
|
|
18
|
+
green = "#24B47E",
|
|
19
|
+
kelly = "#8AAB3F",
|
|
20
|
+
yellow = "#F0A100",
|
|
21
|
+
orange = "#EB6414",
|
|
22
|
+
red = "#E52727",
|
|
23
|
+
fuchsia = "#BE507D",
|
|
24
|
+
purple = "#9678D3"
|
|
25
|
+
}
|
|
26
|
+
export declare function getColorFromContent(content: string): EColor;
|
|
27
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare function getScrollContainer(element: HTMLElement
|
|
1
|
+
export declare function getScrollContainer(element: HTMLElement, options?: {
|
|
2
|
+
horizontal?: boolean;
|
|
3
|
+
}): HTMLElement;
|
|
2
4
|
export declare function disablePageScroll(id: string): void;
|
|
3
5
|
export declare function enablePageScroll(id: string): void;
|