@ones-editor/editor 2.1.8-beta.1 → 2.1.8-beta.10
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/block-menu/src/block-menu-button/menu-button/index.d.ts +1 -1
- package/@ones-editor/block-padding/src/index.d.ts +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +3 -4
- package/@ones-editor/callout-block/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +16 -0
- package/@ones-editor/comments/src/index.d.ts +5 -1
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
- package/@ones-editor/core/src/core/block-renderers/block-renderers.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +9 -9
- package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +3 -5
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +1 -7
- package/@ones-editor/core/src/core/blocks/text-blocks/base/line-breaks.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/range.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-offset.d.ts +1 -2
- package/@ones-editor/core/src/core/command-providers/abstract-providers.d.ts +25 -0
- package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +16 -0
- package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
- package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
- package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +4 -0
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +2 -5
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +5 -14
- package/@ones-editor/core/src/core/command-providers/index.d.ts +3 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +3 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +4 -1
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/clear-selected-contents.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -1
- package/@ones-editor/core/src/core/insertions/editor-insertions.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -1
- package/@ones-editor/core/src/core/selection/adjust-selection-pos.d.ts +5 -1
- package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +53 -28
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +5 -1
- package/@ones-editor/core/src/core/undo-manager/actions/block-action.d.ts +1 -0
- package/@ones-editor/core/src/core/undo-manager/actions/update-block-data-action.d.ts +1 -0
- package/@ones-editor/core/src/helper/hovering-block.d.ts +3 -4
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +2 -0
- package/@ones-editor/core/src/utils/dom.d.ts +4 -1
- package/@ones-editor/core/src/utils/drag-drop.d.ts +8 -3
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +6 -5
- package/@ones-editor/excalidraw/package.json +4 -0
- package/@ones-editor/file/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/file/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/file/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +5 -19
- package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +12 -1
- package/@ones-editor/image-embed/src/image-object.d.ts +1 -0
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/layout-block/src/command-filter.d.ts +6 -0
- package/@ones-editor/layout-block/src/index.d.ts +1 -0
- package/@ones-editor/list-block/src/index.d.ts +2 -1
- package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +12 -1
- package/@ones-editor/media-embed/src/utils/dom.d.ts +2 -0
- package/@ones-editor/mention/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/mention/src/mention.d.ts +24 -1
- package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +15 -0
- package/@ones-editor/mobile-helper/src/embed-mask.d.ts +10 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/active-observer.d.ts +11 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +6 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +18 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +7 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +13 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/paragraph.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/tab-provider.d.ts +10 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +15 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +14 -2
- package/@ones-editor/mobile-helper/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +19 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +3 -0
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/index.d.ts +3 -0
- package/@ones-editor/sharedb-doc/src/versions/sharedb-server.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/versions/simple-client.d.ts +1 -1
- package/@ones-editor/table-block/src/commands/index.d.ts +2 -0
- package/@ones-editor/table-block/src/commands/mobile-command-provider.d.ts +12 -0
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
- package/@ones-editor/table-block/src/index.d.ts +2 -1
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +6 -0
- package/@ones-editor/table-block/src/table-block/table-resize/resize-drag-drop.d.ts +4 -4
- package/@ones-editor/text-commands/src/index.d.ts +1 -3
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/table.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +8 -0
- package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
- package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +10 -0
- package/@ones-editor/ui/src/box-helper/standard-box-provider.d.ts +9 -0
- package/@ones-editor/ui/src/index.d.ts +34 -9
- package/@ones-editor/ui/src/link-popup/mobile-link-popup.d.ts +22 -0
- package/@ones-editor/ui/src/link-popup/types.d.ts +34 -0
- package/@ones-editor/ui/src/link-popup/web-link-popup.d.ts +19 -0
- package/@ones-editor/ui/src/locale/en-us.d.ts +14 -0
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +14 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +14 -0
- package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
- package/@ones-editor/ui/src/providers/align.d.ts +11 -0
- package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/clipboard-provider.d.ts +20 -0
- package/@ones-editor/ui/src/providers/color-provider.d.ts +18 -0
- package/@ones-editor/ui/src/providers/edit-link-provider.d.ts +6 -0
- package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
- package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
- package/@ones-editor/ui/src/providers/link.d.ts +12 -0
- package/@ones-editor/ui/src/providers/list.d.ts +13 -0
- package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +13 -0
- package/@ones-editor/ui/src/providers/paragraph.d.ts +9 -0
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +9 -0
- package/@ones-editor/ui/src/providers/quoted.d.ts +10 -0
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +9 -0
- package/@ones-editor/ui/src/providers/selection-provider.d.ts +9 -0
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/text-script-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
- package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
- package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
- package/@ones-editor/ui/src/providers/utils/clipboard.d.ts +6 -0
- package/@ones-editor/ui/src/providers/utils/index.d.ts +2 -0
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +8 -0
- package/@ones-editor/ui/src/providers/utils/text-styles.d.ts +6 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +7 -19
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +8 -0
- package/@ones-editor/ui/src/quick-menu/types.d.ts +2 -5
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +22 -0
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +29 -0
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +12 -0
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +11 -0
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -1
- package/@ones-editor/ui/src/utils/hide-toolbar.d.ts +2 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +4 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +3 -1
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +18 -8
- package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +7 -1
- package/@ones-editor/ui-base/src/color-palette/index.d.ts +3 -3
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +4 -2
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/init-toolbar-item.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +7 -2
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +5 -1
- package/@ones-editor/ui-base/src/index.d.ts +3 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +24 -3
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/init-menu-item.d.ts +3 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +21 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +3 -0
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/@ones-editor/{ui → ui-base}/src/text-button/index.d.ts +1 -1
- package/@ones-editor/versions/package.json +3 -0
- package/@ones-editor/versions/src/constant/index.d.ts +1 -0
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +2 -2
- package/@ones-editor/versions/src/history-render/index.d.ts +14 -0
- package/@ones-editor/versions/src/history-tooltip/index.d.ts +6 -2
- package/@ones-editor/versions/src/index.d.ts +1 -0
- package/@ones-editor/versions/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +4 -0
- package/@ones-editor/versions/src/utils/block-text.d.ts +3 -1
- package/@ones-editor/versions/src/version-dialog/index.d.ts +0 -1
- package/dist/auto-new-line.d.ts +7 -0
- package/dist/comments/local-doc-comments-provider.d.ts +2 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +30286 -25721
- package/dist/lang/en-us.d.ts +1 -1
- package/dist/lang/ja-jp.d.ts +1 -1
- package/dist/lang/zh-cn.d.ts +1 -1
- package/dist/types.d.ts +5 -2
- package/package.json +2 -1
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
- package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
- package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -13
- package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +0 -13
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -13
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -24
- package/@ones-editor/text-commands/src/text-commands.d.ts +0 -4
- package/@ones-editor/text-commands/src/text-styles.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -9
- package/@ones-editor/ui/src/toolbar/commands/align.d.ts +0 -10
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
- package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
- package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
- /package/@ones-editor/{text-commands → mobile-helper}/src/locale/index.d.ts +0 -0
- /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
2
|
import { DocBlock, DocBlockAttributes, DocBlockDelta, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange, UpdateBlockOptions } from './doc';
|
|
3
|
+
export type TextBlockContentTextChild = HTMLSpanElement & {
|
|
4
|
+
__neverUse: 'TextBlockContentTextChild';
|
|
5
|
+
};
|
|
6
|
+
export type TextBlockContentInsertionChild = InsertionElement;
|
|
7
|
+
export type TextBlockContentBoxChild = BoxElement;
|
|
8
|
+
export type TextBlockContentChild = TextBlockContentTextChild | TextBlockContentBoxChild | TextBlockContentInsertionChild;
|
|
3
9
|
export type ContainerElement = HTMLDivElement & {
|
|
4
10
|
__neverUse: 'ContainerElement';
|
|
5
11
|
};
|
|
@@ -52,6 +58,7 @@ export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
|
|
|
52
58
|
export interface BoxCommands {
|
|
53
59
|
group: string;
|
|
54
60
|
commands: CommandItem[];
|
|
61
|
+
startGroup?: boolean;
|
|
55
62
|
executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
|
|
56
63
|
}
|
|
57
64
|
export interface BoxProperties {
|
|
@@ -119,7 +126,6 @@ export interface Closeable {
|
|
|
119
126
|
click: (item: CommandItem, target: HTMLElement) => void;
|
|
120
127
|
}
|
|
121
128
|
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';
|
|
122
|
-
export type CommandItemMenuType = 'inline' | 'sibling';
|
|
123
129
|
export interface CommandItem {
|
|
124
130
|
id: string;
|
|
125
131
|
name: string;
|
|
@@ -130,13 +136,15 @@ export interface CommandItem {
|
|
|
130
136
|
type?: CommandItemType;
|
|
131
137
|
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
132
138
|
icon?: string;
|
|
133
|
-
childrenType?: 'menu' | 'toolbar';
|
|
139
|
+
childrenType?: 'menu' | 'toolbar' | 'mobile-bottom-menu';
|
|
134
140
|
children?: CommandItem[];
|
|
135
141
|
childrenMenuId?: string;
|
|
136
142
|
data?: unknown;
|
|
137
143
|
group?: string;
|
|
138
144
|
groupOrder?: number;
|
|
139
145
|
dropdown?: boolean;
|
|
146
|
+
dropSplit?: boolean;
|
|
147
|
+
splitTooltip?: string;
|
|
140
148
|
manualShowChildren?: boolean;
|
|
141
149
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
142
150
|
childrenOffset?: [number, number];
|
|
@@ -145,25 +153,17 @@ export interface CommandItem {
|
|
|
145
153
|
defaultCheckedChildren?: string[];
|
|
146
154
|
ellipsisTooltip?: string;
|
|
147
155
|
disableTooltip?: boolean;
|
|
156
|
+
tooltipPlacement?: CommandItemChildrenPlacement;
|
|
148
157
|
disableReason?: string;
|
|
149
158
|
hideGroupItem?: boolean;
|
|
150
159
|
setCloseable?: (closeable: Closeable) => void;
|
|
151
160
|
beforePopup?: (parent: unknown) => void;
|
|
152
|
-
|
|
153
|
-
* defaults to true
|
|
154
|
-
*/
|
|
155
|
-
shouldShown?: (currentBlock: BlockElement | undefined, menuType: CommandItemMenuType) => boolean;
|
|
161
|
+
switchable?: boolean;
|
|
156
162
|
/**
|
|
157
163
|
* defaults to true
|
|
158
164
|
*/
|
|
159
165
|
clickToClose?: boolean;
|
|
160
166
|
}
|
|
161
|
-
export interface BlockCommandItem extends CommandItem {
|
|
162
|
-
blockId: string;
|
|
163
|
-
blockType: string;
|
|
164
|
-
blockKind: BlockKind;
|
|
165
|
-
groupIndex: number;
|
|
166
|
-
}
|
|
167
167
|
export type StyleType = boolean | string | number;
|
|
168
168
|
export type BlockStyles = {
|
|
169
169
|
[index: string]: StyleType;
|
|
@@ -174,9 +174,11 @@ export type BlockPathComponent = {
|
|
|
174
174
|
};
|
|
175
175
|
export type BlockPath = BlockPathComponent[];
|
|
176
176
|
export interface BlockCommands {
|
|
177
|
+
element?: HTMLElement;
|
|
177
178
|
group: string;
|
|
178
179
|
commands: CommandItem[];
|
|
179
|
-
|
|
180
|
+
startGroup?: boolean;
|
|
181
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => unknown;
|
|
180
182
|
}
|
|
181
183
|
export interface BlockProperties {
|
|
182
184
|
blockCommands?: Record<string, BlockCommands>;
|
|
@@ -354,6 +356,8 @@ export interface OnesEditorUndoAction {
|
|
|
354
356
|
redo: (editor: OnesEditor) => boolean;
|
|
355
357
|
combinable: (other: OnesEditorUndoAction) => boolean;
|
|
356
358
|
combine: (other: OnesEditorUndoAction) => void;
|
|
359
|
+
getTimeStamp: () => number;
|
|
360
|
+
getBatchActionId?: () => string | undefined;
|
|
357
361
|
}
|
|
358
362
|
export interface OnesEditorUndoManager {
|
|
359
363
|
reset: () => void;
|
|
@@ -400,12 +404,14 @@ export interface OnesEditorBlockRenderer {
|
|
|
400
404
|
renderBox?: (editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
401
405
|
renderText?: (editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
402
406
|
renderBlock?: (editor: OnesEditor, path: BlockPath, blockData: DocBlock) => OnesEditorBlockRenderResult;
|
|
407
|
+
renderChildContainer?: (editor: OnesEditor, path: BlockPath, containerId: string) => OnesEditorBlockRenderResult;
|
|
403
408
|
updateBlock?: (editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
404
409
|
}
|
|
405
410
|
export interface OnesEditorBlockRenderers {
|
|
406
411
|
renderBox: (path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
407
412
|
renderText: (path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
408
413
|
renderBlock: (editor: OnesEditor, path: BlockPath, blockData: DocBlock) => OnesEditorBlockRenderResult;
|
|
414
|
+
renderChildContainer: (editor: OnesEditor, path: BlockPath, containerId: string) => OnesEditorBlockRenderResult;
|
|
409
415
|
updateBlock: (editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
410
416
|
registerRender: (decorator: OnesEditorBlockRenderer) => void;
|
|
411
417
|
}
|
|
@@ -640,6 +646,7 @@ export type PasteOptions = {
|
|
|
640
646
|
};
|
|
641
647
|
export interface OnesEditorInput {
|
|
642
648
|
readonly inputElement: HTMLTextAreaElement;
|
|
649
|
+
getInput: () => HTMLTextAreaElement;
|
|
643
650
|
destroy: () => void;
|
|
644
651
|
focus: () => void;
|
|
645
652
|
handleDocumentSelectionChange: () => void;
|
|
@@ -659,11 +666,11 @@ export interface OnesEditorInput {
|
|
|
659
666
|
export interface OnesEditorSelectionHandler {
|
|
660
667
|
isSelecting: () => boolean;
|
|
661
668
|
stopSelection: () => void;
|
|
662
|
-
handleMouseDown: (event: MouseEvent, options: {
|
|
669
|
+
handleMouseDown: (event: MouseEvent | TouchEvent, options: {
|
|
663
670
|
autoScroll: boolean;
|
|
664
671
|
}) => void;
|
|
665
672
|
handleMouseMove: (event: MouseEvent) => void;
|
|
666
|
-
handleMouseUp: (event: MouseEvent) => void;
|
|
673
|
+
handleMouseUp: (event: MouseEvent | TouchEvent) => void;
|
|
667
674
|
handleDblClick: (event: MouseEvent) => void;
|
|
668
675
|
handleTripleClick: (event: MouseEvent) => void;
|
|
669
676
|
}
|
|
@@ -714,32 +721,43 @@ export interface OnesEditorInsertions {
|
|
|
714
721
|
}
|
|
715
722
|
export type CommandParams = {
|
|
716
723
|
[index: string]: unknown;
|
|
724
|
+
} & {
|
|
725
|
+
source?: string[];
|
|
726
|
+
isFilter?: boolean;
|
|
717
727
|
};
|
|
718
728
|
export type CommandResult = {
|
|
719
729
|
[index: string]: unknown;
|
|
720
730
|
};
|
|
721
731
|
export interface OnesEditorCommandProvider {
|
|
722
732
|
id: string;
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
733
|
+
groupIndex?: number;
|
|
734
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
735
|
+
getInsertCommands?: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
736
|
+
executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
737
|
+
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
738
|
+
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
739
|
+
filterCommands?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, commands: CommandItemWithSource[]) => CommandItemWithSource[] | undefined;
|
|
740
|
+
beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean | undefined;
|
|
741
|
+
afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result: CommandResult) => void;
|
|
742
|
+
}
|
|
743
|
+
export interface CommandItemWithSource extends CommandItem {
|
|
732
744
|
source: string;
|
|
733
745
|
}
|
|
746
|
+
export interface CommandFilter {
|
|
747
|
+
filter: (editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]) => CommandItemWithSource[];
|
|
748
|
+
}
|
|
749
|
+
export type CommandFilterId = keyof any;
|
|
734
750
|
export interface OnesEditorCommandProviders {
|
|
751
|
+
commandFilters?: Map<CommandFilterId, CommandFilter>;
|
|
752
|
+
addFilter?: (id: CommandFilterId, filter: CommandFilter) => void;
|
|
753
|
+
filterItems?: (range: SelectionRange, items: CommandItemWithSource[]) => CommandItemWithSource[];
|
|
735
754
|
registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
|
|
736
755
|
getCommandProviders: () => OnesEditorCommandProvider[];
|
|
737
756
|
getCommandProvider: (id: string) => OnesEditorCommandProvider;
|
|
738
|
-
getCommands: (range: SelectionRange
|
|
739
|
-
executeCommand: (range: SelectionRange, item:
|
|
757
|
+
getCommands: (range: SelectionRange) => CommandItemWithSource[];
|
|
758
|
+
executeCommand: (range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => {
|
|
740
759
|
[index: string]: CommandResult;
|
|
741
760
|
};
|
|
742
|
-
getEmptyBlockTextAttributes: (editor: OnesEditor, blockId: string) => DocBlockTextAttributes | undefined;
|
|
743
761
|
}
|
|
744
762
|
export interface EditorDocLocalActionCallbacks {
|
|
745
763
|
onBeforeUpdateBlockText: (containerId: string, blockId: string, oldText: DocBlockText, newText: DocBlockText, newRange: OnesEditorDocRange) => void;
|
|
@@ -753,5 +771,12 @@ export interface OnesEditorBlockHook {
|
|
|
753
771
|
create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
754
772
|
update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
755
773
|
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
756
|
-
commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
|
|
774
|
+
commands?: (editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null) => BlockCommands | undefined;
|
|
775
|
+
}
|
|
776
|
+
export interface MobileClient {
|
|
777
|
+
getViewPortHeight: () => number;
|
|
778
|
+
getOffsetHeight: () => number;
|
|
779
|
+
virtualViewportHeight: number;
|
|
780
|
+
virtualViewportOffsetTop: number;
|
|
781
|
+
isAndroidApp: boolean;
|
|
757
782
|
}
|
|
@@ -4,11 +4,15 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
4
4
|
protected containerId: string;
|
|
5
5
|
beforeRange: OnesEditorDocRange;
|
|
6
6
|
afterRange: OnesEditorDocRange;
|
|
7
|
-
|
|
7
|
+
batchActionId?: string;
|
|
8
|
+
ts: number;
|
|
9
|
+
constructor(editor: OnesEditor, containerId: string, afterRange: OnesEditorDocRange, batchActionId?: string);
|
|
10
|
+
getTimeStamp(): number;
|
|
8
11
|
undo(editor: OnesEditor): boolean;
|
|
9
12
|
redo(editor: OnesEditor): boolean;
|
|
10
13
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
11
14
|
combine(other: OnesEditorUndoAction): void;
|
|
15
|
+
getBatchActionId(): string | undefined;
|
|
12
16
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
13
17
|
hasDocContainerId(editor: OnesEditor, id: string): boolean;
|
|
14
18
|
findDocBlockById(editor: OnesEditor, id: string): DocBlock | undefined;
|
|
@@ -7,4 +7,5 @@ export default class BlockAction extends Action {
|
|
|
7
7
|
constructor(editor: OnesEditor, containerId: string, blockIndex: number, data: DocBlock, afterRange: OnesEditorDocRange);
|
|
8
8
|
deleteBlock(editor: OnesEditor, newRange: OnesEditorDocRange): boolean;
|
|
9
9
|
insertBlock(editor: OnesEditor, newRange: OnesEditorDocRange): boolean;
|
|
10
|
+
getBatchActionId(): string | undefined;
|
|
10
11
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import
|
|
3
|
-
import { BlockElement, OnesEditor, OnesEditorCustom } from '../core/types';
|
|
2
|
+
import { BlockElement, OnesEditor, OnesEditorCustom, TextBlockContentChild } from '../core/types';
|
|
4
3
|
export interface OnesEditorHoveringBlockEvents {
|
|
5
4
|
change: (block: BlockElement | null, old: BlockElement | null, event: MouseEvent) => void;
|
|
6
5
|
targetChange: (block: BlockElement | null, old: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|
|
@@ -15,8 +14,8 @@ export interface OnesEditorHoveringBlockFinder extends OnesEditorCustom {
|
|
|
15
14
|
export default class OnesEditorHoveringBlock extends TypedEmitter<OnesEditorHoveringBlockEvents> {
|
|
16
15
|
private editor;
|
|
17
16
|
private hoveringBlock;
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
hoveringElem: EventTarget | null;
|
|
18
|
+
hoveringTextChild: TextBlockContentChild | null;
|
|
20
19
|
private filters;
|
|
21
20
|
private finders;
|
|
22
21
|
constructor(editor: OnesEditor);
|
|
@@ -10,6 +10,7 @@ export interface IUserOptions {
|
|
|
10
10
|
verticalOffset?: number;
|
|
11
11
|
disableHorizontal?: boolean;
|
|
12
12
|
disableVertical?: boolean;
|
|
13
|
+
getClientHeight?: () => number;
|
|
13
14
|
}
|
|
14
15
|
export interface IOptions {
|
|
15
16
|
cancelOnUserAction: boolean;
|
|
@@ -22,6 +23,7 @@ export interface IOptions {
|
|
|
22
23
|
verticalOffset: number;
|
|
23
24
|
disableHorizontal?: boolean;
|
|
24
25
|
disableVertical?: boolean;
|
|
26
|
+
getClientHeight?: () => number;
|
|
25
27
|
}
|
|
26
28
|
declare function animateScrollTo(y: number, userOptions?: IUserOptions): Promise<boolean>;
|
|
27
29
|
declare function animateScrollTo(coords: TCoords, userOptions?: IUserOptions): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSStyles } from '../core/types';
|
|
1
|
+
import type { CSSStyles, OnesEditor } from '../core/types';
|
|
2
2
|
export declare function addClass(dom: Element, ...className: Array<string>): void;
|
|
3
3
|
export declare function hasClass(dom: Node | null, className: string): boolean;
|
|
4
4
|
export declare function removeClass(dom: Element, ...className: Array<string>): void;
|
|
@@ -37,4 +37,7 @@ export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaE
|
|
|
37
37
|
export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
38
38
|
noFilter: boolean;
|
|
39
39
|
}): Element;
|
|
40
|
+
export declare function createMouseEventFromTouchEvent(event: TouchEvent, type: 'mousedown' | 'mousemove' | 'mouseup' | 'click'): MouseEvent;
|
|
41
|
+
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
42
|
+
export declare function bindDbClick(editor: OnesEditor, elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
|
|
40
43
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement) => void;
|
|
2
|
-
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
3
|
-
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
1
|
+
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement) => void;
|
|
2
|
+
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
3
|
+
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
4
4
|
export interface DragDropOptions<T> {
|
|
5
5
|
elem: HTMLElement;
|
|
6
6
|
onDragStart: DragStartHandler<T>;
|
|
@@ -10,6 +10,7 @@ export interface DragDropOptions<T> {
|
|
|
10
10
|
minThreshold?: number;
|
|
11
11
|
cursor?: string;
|
|
12
12
|
mouseDownEvent?: MouseEvent;
|
|
13
|
+
mobile?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const MIN_DISTANCE_THRESHOLD = 3;
|
|
15
16
|
export declare class DragDrop<T> {
|
|
@@ -37,5 +38,9 @@ export declare class DragDrop<T> {
|
|
|
37
38
|
private onDragging;
|
|
38
39
|
private onDragEnd;
|
|
39
40
|
destroy(): void;
|
|
41
|
+
static getEventPosition(event: MouseEvent | TouchEvent): {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
40
45
|
}
|
|
41
46
|
export declare function registerDragDrop<T>(options: DragDropOptions<T>): DragDrop<T>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export type
|
|
3
|
-
export interface StandardEmbedBlockProperties<T =
|
|
2
|
+
export type CommandId = 'edit' | 'add-comment' | 'separator';
|
|
3
|
+
export interface StandardEmbedBlockProperties<T = CommandId> {
|
|
4
4
|
presetIds?: T[];
|
|
5
|
-
|
|
5
|
+
extIds?: T[];
|
|
6
|
+
extCommands?: CommandItem[] | ((editor: OnesEditor, block: BlockElement) => CommandItem[]);
|
|
6
7
|
handleExecuteCommand?: (editor: OnesEditor, block: BlockElement, item: CommandItem) => boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement): boolean;
|
|
9
|
-
export declare class StandardEmbedBlockCommands<T =
|
|
10
|
+
export declare class StandardEmbedBlockCommands<T = CommandId> implements BlockCommands {
|
|
10
11
|
protected editor: OnesEditor;
|
|
11
12
|
protected block: BlockElement;
|
|
12
13
|
protected properties?: StandardEmbedBlockProperties<T> | undefined;
|
|
@@ -18,6 +19,6 @@ export declare class StandardEmbedBlockCommands<T = PresetCommandId> implements
|
|
|
18
19
|
}
|
|
19
20
|
export declare function getStandardEmbedBlockProperties(editor: OnesEditor, block: BlockElement, properties?: StandardEmbedBlockProperties): {
|
|
20
21
|
blockCommands: {
|
|
21
|
-
'hovering-toolbar': StandardEmbedBlockCommands<
|
|
22
|
+
'hovering-toolbar': StandardEmbedBlockCommands<CommandId>;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import type { StandardEmbedBlockProperties } from '../../../../@ones-editor/embed-block-helper';
|
|
5
|
-
export type PresetCommandId = 'edit' | 'help';
|
|
2
|
+
import type { OnesEditor } from '../../../../@ones-editor/core';
|
|
3
|
+
import { CommandId, type StandardEmbedBlockProperties } from '../../../../@ones-editor/embed-block-helper';
|
|
6
4
|
export type GraphType = 'mermaid' | 'flowchart' | 'plantuml';
|
|
7
|
-
export type GraphEmbedBlockProperties = StandardEmbedBlockProperties
|
|
8
|
-
declare class GraphBlockCommands extends StandardEmbedBlockCommands<PresetCommandId> {
|
|
9
|
-
editor: OnesEditor;
|
|
10
|
-
block: BlockElement;
|
|
11
|
-
graphType: GraphType;
|
|
12
|
-
properties?: GraphEmbedBlockProperties | undefined;
|
|
13
|
-
group: string;
|
|
14
|
-
_commands: CommandItem[];
|
|
15
|
-
constructor(editor: OnesEditor, block: BlockElement, graphType: GraphType, properties?: GraphEmbedBlockProperties | undefined);
|
|
16
|
-
get commands(): CommandItem[];
|
|
17
|
-
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
18
|
-
}
|
|
5
|
+
export type GraphEmbedBlockProperties = StandardEmbedBlockProperties;
|
|
19
6
|
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, block: BlockElement, type: 'mermaid' | 'flowchart' | 'plantuml', properties?: GraphEmbedBlockProperties): {
|
|
7
|
+
abstract: string;
|
|
20
8
|
blockCommands: {
|
|
21
|
-
'hovering-toolbar':
|
|
9
|
+
'hovering-toolbar': import("@ones-editor/embed-block-helper").StandardEmbedBlockCommands<CommandId>;
|
|
22
10
|
};
|
|
23
|
-
abstract: string;
|
|
24
11
|
};
|
|
25
|
-
export {};
|
|
@@ -10,13 +10,24 @@ export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
12
|
type?: undefined;
|
|
13
|
+
groupOrder?: undefined;
|
|
14
|
+
order?: undefined;
|
|
13
15
|
} | {
|
|
14
16
|
id: string;
|
|
15
17
|
name: string;
|
|
16
18
|
type: CommandItemType;
|
|
17
19
|
icon?: undefined;
|
|
20
|
+
groupOrder?: undefined;
|
|
21
|
+
order?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
groupOrder: number;
|
|
27
|
+
order: number;
|
|
28
|
+
type?: undefined;
|
|
18
29
|
})[];
|
|
19
|
-
|
|
30
|
+
isHoveringImageEmpty: () => boolean;
|
|
20
31
|
get commands(): CommandItem[];
|
|
21
32
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
22
33
|
}
|
|
@@ -42,4 +42,5 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
42
42
|
private setData;
|
|
43
43
|
static create(editor: OnesEditor, blockData: DocEmbedBlock): ImageObject;
|
|
44
44
|
static getImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject;
|
|
45
|
+
static findImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject | null;
|
|
45
46
|
}
|
|
@@ -11,7 +11,7 @@ export declare class ImageSplitterResizer implements DragDropOptions<ImageSplitt
|
|
|
11
11
|
cursor: string;
|
|
12
12
|
initWidths: number[];
|
|
13
13
|
constructor(editor: OnesEditor, elem: HTMLElement, data: ImageSplitterResizerData, mouseDownEvent: MouseEvent);
|
|
14
|
-
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement): void;
|
|
15
|
-
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
-
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
14
|
+
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement): void;
|
|
15
|
+
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
+
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
17
17
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommandFilter, CommandItemWithSource, OnesEditor, OnesEditorCustom, SelectionRange } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class LayoutQuickMenuItemFilter implements CommandFilter, OnesEditorCustom {
|
|
3
|
+
filter(editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]): CommandItemWithSource[];
|
|
4
|
+
destroy(): void;
|
|
5
|
+
static init(editor: OnesEditor): LayoutQuickMenuItemFilter;
|
|
6
|
+
}
|
|
@@ -7,8 +7,9 @@ import { resetListStart } from './start/reset-list-start';
|
|
|
7
7
|
import './lang';
|
|
8
8
|
import './style.scss';
|
|
9
9
|
import { ListPasteHandler } from './local-events/paste-handler';
|
|
10
|
+
import { handleTab, handleShiftTab } from './keyboard/tab';
|
|
10
11
|
export { type ListOptions, type DocListBlock } from './types';
|
|
11
12
|
declare const ListBlock: TextKindBlock;
|
|
12
13
|
export * from './utils';
|
|
13
14
|
export * from './keyboard/to-text-block';
|
|
14
|
-
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, ListPasteHandler, };
|
|
15
|
+
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, ListPasteHandler, handleTab, handleShiftTab, };
|
|
@@ -9,14 +9,25 @@ export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
|
+
groupOrder: number;
|
|
13
|
+
order: number;
|
|
12
14
|
type?: undefined;
|
|
13
15
|
} | {
|
|
14
16
|
id: string;
|
|
15
17
|
name: string;
|
|
16
18
|
type: CommandItemType;
|
|
17
19
|
icon?: undefined;
|
|
20
|
+
groupOrder?: undefined;
|
|
21
|
+
order?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
groupOrder?: undefined;
|
|
27
|
+
order?: undefined;
|
|
28
|
+
type?: undefined;
|
|
18
29
|
})[];
|
|
19
|
-
|
|
30
|
+
isHoveringImageEmpty: () => boolean;
|
|
20
31
|
get commands(): CommandItem[];
|
|
21
32
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
22
33
|
}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { CommandItem, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
-
import { AutoSuggestAnchor, OnesEditorAutoSuggest } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { AutoSuggestAnchor, EditorInput, OnesEditorAutoSuggest } from '../../../@ones-editor/ui-base';
|
|
3
4
|
import { MentionOptions } from './types';
|
|
5
|
+
interface MobileWrap {
|
|
6
|
+
wrapper: HTMLElement;
|
|
7
|
+
input: EditorInput;
|
|
8
|
+
content: HTMLElement;
|
|
9
|
+
}
|
|
4
10
|
export default class OnesEditorMention implements OnesEditorCustom {
|
|
5
11
|
private editor;
|
|
6
12
|
private options;
|
|
7
13
|
suggest: OnesEditorAutoSuggest;
|
|
14
|
+
private mobileWrap?;
|
|
15
|
+
private items;
|
|
8
16
|
constructor(editor: OnesEditor, options: MentionOptions);
|
|
17
|
+
createMobileHeader: () => HTMLDivElement | undefined;
|
|
9
18
|
onClose: () => void;
|
|
10
19
|
destroy(): void;
|
|
11
20
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
21
|
+
onShown: (bar: OnesEditorAutoSuggest) => void;
|
|
22
|
+
handleClickItem: (item: CommandItem) => void;
|
|
23
|
+
handleMobileWrapClick: (e: Event) => void;
|
|
12
24
|
onClickItem: (menu: OnesEditorAutoSuggest, item: CommandItem, anchor: AutoSuggestAnchor) => void;
|
|
25
|
+
createItemElement: (item: CommandItem, find: string) => HTMLElement;
|
|
26
|
+
createMobileItems: (content: HTMLElement, items: CommandItem[], find: string) => void;
|
|
27
|
+
onInputChanged: import("lodash").DebouncedFunc<(content: HTMLElement, e: Event) => void>;
|
|
28
|
+
createMobileWrap: () => MobileWrap;
|
|
29
|
+
createMobileCommandItem: (items: CommandItem[]) => {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
element: HTMLElement;
|
|
33
|
+
}[];
|
|
34
|
+
_queryItems: (text: string) => Promise<CommandItem[]>;
|
|
13
35
|
queryItems: (menu: OnesEditorAutoSuggest, text: string) => Promise<CommandItem[]>;
|
|
14
36
|
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class CursorToolbarHandler {
|
|
3
|
+
private editor;
|
|
4
|
+
private toolbar;
|
|
5
|
+
private clipboardProvider;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
handleButtonClick: (toolbar: any, item: CommandItem) => void;
|
|
8
|
+
private handleSelectionChange;
|
|
9
|
+
getCommands: () => CommandItem[];
|
|
10
|
+
showToolbar: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const createCursorToolbar: (editor: OnesEditor) => CursorToolbarHandler;
|
|
15
|
+
export declare const hideCursorToolbar: (editor: OnesEditor) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
|
|
3
|
+
export default class MobileEmbedMask {
|
|
4
|
+
private editor;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
addMask: (block: BlockElement) => void;
|
|
7
|
+
removeMask: (block: BlockElement) => void;
|
|
8
|
+
handleSelectionChanged: import("lodash").DebouncedFunc<() => void>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
}
|