@ones-editor/editor 2.1.7-beta.21 → 2.1.7-beta.25
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/{ui → block-menu}/src/block-menu/index.d.ts +1 -3
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +3 -0
- package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +5 -0
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +5 -0
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +30 -0
- package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +5 -0
- 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/block-resizer/src/index.d.ts +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +4 -3
- package/@ones-editor/callout-block/src/index.d.ts +0 -1
- package/@ones-editor/comments/src/index.d.ts +1 -5
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +3 -4
- 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 +1 -2
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +5 -3
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +7 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/line-breaks.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/range.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-offset.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +2 -2
- package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +0 -2
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +5 -2
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +14 -5
- package/@ones-editor/core/src/core/command-providers/index.d.ts +1 -3
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/index.d.ts +0 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +2 -3
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -3
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +0 -2
- 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 +0 -1
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -1
- package/@ones-editor/core/src/core/insertions/editor-insertions.d.ts +0 -1
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +1 -2
- package/@ones-editor/core/src/core/selection/adjust-selection-pos.d.ts +1 -5
- package/@ones-editor/core/src/core/selection/index.d.ts +0 -1
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +28 -51
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +1 -5
- package/@ones-editor/core/src/core/undo-manager/actions/block-action.d.ts +0 -1
- package/@ones-editor/core/src/core/undo-manager/actions/update-block-data-action.d.ts +0 -1
- package/@ones-editor/core/src/helper/hovering-block.d.ts +4 -3
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +0 -2
- package/@ones-editor/core/src/utils/dom.d.ts +1 -4
- package/@ones-editor/core/src/utils/drag-drop.d.ts +3 -8
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +5 -6
- package/@ones-editor/excalidraw/package.json +0 -4
- package/@ones-editor/file/src/locale/en-us.d.ts +0 -1
- package/@ones-editor/file/src/locale/ja-jp.d.ts +0 -1
- package/@ones-editor/file/src/locale/zh-cn.d.ts +0 -1
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +19 -5
- package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +1 -12
- package/@ones-editor/image-embed/src/image-data.d.ts +4 -1
- package/@ones-editor/image-embed/src/image-object.d.ts +2 -2
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/image-embed/src/types.d.ts +2 -1
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +0 -1
- package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +0 -1
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +0 -1
- package/@ones-editor/layout-block/src/index.d.ts +0 -1
- package/@ones-editor/list-block/src/index.d.ts +1 -2
- package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +1 -12
- package/@ones-editor/mention/src/locale/en-us.d.ts +0 -3
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +0 -3
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +0 -3
- package/@ones-editor/mention/src/mention.d.ts +1 -24
- package/@ones-editor/mobile-helper/src/index.d.ts +2 -14
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +1 -4
- package/@ones-editor/sharedb-doc/src/index.d.ts +1 -8
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -3
- package/@ones-editor/table-block/src/commands/index.d.ts +0 -2
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +3 -4
- package/@ones-editor/table-block/src/index.d.ts +1 -2
- package/@ones-editor/table-block/src/locale/en-us.d.ts +0 -5
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +0 -5
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +0 -5
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +0 -6
- 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 +3 -1
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +13 -0
- package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +13 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +13 -0
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +24 -0
- package/@ones-editor/text-commands/src/text-commands.d.ts +4 -0
- package/@ones-editor/text-commands/src/text-styles.d.ts +4 -0
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/table.d.ts +0 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +8 -32
- package/@ones-editor/ui/src/locale/en-us.d.ts +0 -14
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +0 -14
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +0 -14
- package/@ones-editor/ui/src/{providers/utils → quick-menu}/basic-commands.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +16 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +19 -7
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +8 -0
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -0
- package/@ones-editor/ui/src/quick-menu/order.d.ts +1 -0
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +9 -0
- package/@ones-editor/ui/src/quick-menu/types.d.ts +5 -2
- package/@ones-editor/{ui-base → ui}/src/text-button/index.d.ts +1 -1
- package/@ones-editor/ui/src/toolbar/commands/align.d.ts +10 -0
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +11 -0
- package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +10 -0
- package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -4
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +1 -4
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +1 -3
- package/@ones-editor/ui-base/src/color-button/color-button.d.ts +0 -1
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +4 -12
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -4
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -2
- package/@ones-editor/ui-base/src/command-bar/init-toolbar-item.d.ts +0 -1
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +0 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -7
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +0 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +1 -5
- package/@ones-editor/ui-base/src/index.d.ts +0 -3
- package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -24
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +0 -1
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +0 -1
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +0 -1
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/@ones-editor/versions/src/types.d.ts +0 -1
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +0 -2
- package/dist/comments/local-doc-comments-provider.d.ts +1 -2
- package/dist/index.d.ts +4 -67
- package/dist/index.js +24017 -28901
- 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 +4 -15
- package/package.json +1 -1
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +0 -16
- package/@ones-editor/core/src/core/command-providers/abstract-providers.d.ts +0 -25
- package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +0 -16
- package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +0 -3
- package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +0 -4
- package/@ones-editor/layout-block/src/command-filter.d.ts +0 -6
- package/@ones-editor/main-toolbar/package.json +0 -7
- package/@ones-editor/main-toolbar/src/index.d.ts +0 -18
- package/@ones-editor/main-toolbar/src/items/comment.d.ts +0 -8
- package/@ones-editor/main-toolbar/src/items/find.d.ts +0 -8
- package/@ones-editor/main-toolbar/src/items/font-style.d.ts +0 -40
- package/@ones-editor/main-toolbar/src/items/image.d.ts +0 -8
- package/@ones-editor/main-toolbar/src/items/index.d.ts +0 -16
- package/@ones-editor/main-toolbar/src/items/insert.d.ts +0 -12
- package/@ones-editor/main-toolbar/src/items/link.d.ts +0 -11
- package/@ones-editor/main-toolbar/src/items/list.d.ts +0 -29
- package/@ones-editor/main-toolbar/src/items/paragraph.d.ts +0 -14
- package/@ones-editor/main-toolbar/src/items/quote.d.ts +0 -11
- package/@ones-editor/main-toolbar/src/items/separator.d.ts +0 -7
- package/@ones-editor/main-toolbar/src/items/text-align.d.ts +0 -21
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +0 -48
- package/@ones-editor/main-toolbar/src/items/undo.d.ts +0 -18
- package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +0 -9
- package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +0 -9
- package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +0 -9
- package/@ones-editor/main-toolbar/src/types.d.ts +0 -5
- package/@ones-editor/media-embed/src/utils/dom.d.ts +0 -2
- package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +0 -15
- package/@ones-editor/mobile-helper/src/embed-mask.d.ts +0 -10
- package/@ones-editor/mobile-helper/src/fixed-toolbar/active-observer.d.ts +0 -11
- package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +0 -6
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +0 -18
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +0 -7
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +0 -13
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +0 -8
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/paragraph.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/tab-provider.d.ts +0 -10
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +0 -8
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +0 -15
- package/@ones-editor/mobile-helper/src/locale/en-us.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/locale/index.d.ts +0 -1
- package/@ones-editor/mobile-helper/src/locale/ja-jp.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/locale/zh-cn.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +0 -19
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +0 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client-base.d.ts +0 -24
- package/@ones-editor/sharedb-doc/src/doc/sharedb-local-doc.d.ts +0 -17
- package/@ones-editor/table-block/src/commands/mobile-command-provider.d.ts +0 -12
- package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +0 -8
- package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +0 -10
- package/@ones-editor/ui/src/box-helper/standard-box-provider.d.ts +0 -9
- package/@ones-editor/ui/src/link-popup/mobile-link-popup.d.ts +0 -22
- package/@ones-editor/ui/src/link-popup/types.d.ts +0 -34
- package/@ones-editor/ui/src/link-popup/web-link-popup.d.ts +0 -19
- package/@ones-editor/ui/src/providers/align-dropdown.d.ts +0 -10
- package/@ones-editor/ui/src/providers/align.d.ts +0 -11
- package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/clipboard-provider.d.ts +0 -20
- package/@ones-editor/ui/src/providers/color-provider.d.ts +0 -18
- package/@ones-editor/ui/src/providers/edit-link-provider.d.ts +0 -6
- package/@ones-editor/ui/src/providers/heading.d.ts +0 -13
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/insert-above.d.ts +0 -9
- package/@ones-editor/ui/src/providers/insert-after.d.ts +0 -9
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +0 -12
- package/@ones-editor/ui/src/providers/insert-group.d.ts +0 -7
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +0 -16
- package/@ones-editor/ui/src/providers/link.d.ts +0 -12
- package/@ones-editor/ui/src/providers/list.d.ts +0 -13
- package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +0 -13
- package/@ones-editor/ui/src/providers/paragraph.d.ts +0 -9
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +0 -9
- package/@ones-editor/ui/src/providers/quoted.d.ts +0 -10
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +0 -9
- package/@ones-editor/ui/src/providers/selection-provider.d.ts +0 -9
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/text-script-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/text-styles.d.ts +0 -9
- package/@ones-editor/ui/src/providers/turn-into.d.ts +0 -9
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +0 -2
- package/@ones-editor/ui/src/providers/utils/clipboard.d.ts +0 -6
- package/@ones-editor/ui/src/providers/utils/index.d.ts +0 -2
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +0 -8
- package/@ones-editor/ui/src/providers/utils/text-styles.d.ts +0 -6
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +0 -8
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +0 -23
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +0 -29
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +0 -12
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +0 -11
- package/@ones-editor/ui/src/utils/hide-toolbar.d.ts +0 -2
- package/@ones-editor/ui-base/src/mobile-command-bar/init-menu-item.d.ts +0 -3
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -21
- package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +0 -3
- package/dist/auto-new-line.d.ts +0 -7
- /package/@ones-editor/{ui → block-menu}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
- /package/@ones-editor/{main-toolbar → text-commands}/src/locale/index.d.ts +0 -0
|
@@ -1,11 +1,5 @@
|
|
|
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;
|
|
9
3
|
export type ContainerElement = HTMLDivElement & {
|
|
10
4
|
__neverUse: 'ContainerElement';
|
|
11
5
|
};
|
|
@@ -58,7 +52,6 @@ export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
|
|
|
58
52
|
export interface BoxCommands {
|
|
59
53
|
group: string;
|
|
60
54
|
commands: CommandItem[];
|
|
61
|
-
startGroup?: boolean;
|
|
62
55
|
executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
|
|
63
56
|
}
|
|
64
57
|
export interface BoxProperties {
|
|
@@ -126,6 +119,7 @@ export interface Closeable {
|
|
|
126
119
|
click: (item: CommandItem, target: HTMLElement) => void;
|
|
127
120
|
}
|
|
128
121
|
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';
|
|
129
123
|
export interface CommandItem {
|
|
130
124
|
id: string;
|
|
131
125
|
name: string;
|
|
@@ -136,15 +130,13 @@ export interface CommandItem {
|
|
|
136
130
|
type?: CommandItemType;
|
|
137
131
|
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
138
132
|
icon?: string;
|
|
139
|
-
childrenType?: 'menu' | 'toolbar'
|
|
133
|
+
childrenType?: 'menu' | 'toolbar';
|
|
140
134
|
children?: CommandItem[];
|
|
141
135
|
childrenMenuId?: string;
|
|
142
136
|
data?: unknown;
|
|
143
137
|
group?: string;
|
|
144
138
|
groupOrder?: number;
|
|
145
139
|
dropdown?: boolean;
|
|
146
|
-
dropSplit?: boolean;
|
|
147
|
-
splitTooltip?: string;
|
|
148
140
|
manualShowChildren?: boolean;
|
|
149
141
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
150
142
|
childrenOffset?: [number, number];
|
|
@@ -153,17 +145,25 @@ export interface CommandItem {
|
|
|
153
145
|
defaultCheckedChildren?: string[];
|
|
154
146
|
ellipsisTooltip?: string;
|
|
155
147
|
disableTooltip?: boolean;
|
|
156
|
-
tooltipPlacement?: CommandItemChildrenPlacement;
|
|
157
148
|
disableReason?: string;
|
|
158
149
|
hideGroupItem?: boolean;
|
|
159
150
|
setCloseable?: (closeable: Closeable) => void;
|
|
160
151
|
beforePopup?: (parent: unknown) => void;
|
|
161
|
-
|
|
152
|
+
/**
|
|
153
|
+
* defaults to true
|
|
154
|
+
*/
|
|
155
|
+
shouldShown?: (currentBlock: BlockElement | undefined, menuType: CommandItemMenuType) => boolean;
|
|
162
156
|
/**
|
|
163
157
|
* defaults to true
|
|
164
158
|
*/
|
|
165
159
|
clickToClose?: boolean;
|
|
166
160
|
}
|
|
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,11 +174,9 @@ export type BlockPathComponent = {
|
|
|
174
174
|
};
|
|
175
175
|
export type BlockPath = BlockPathComponent[];
|
|
176
176
|
export interface BlockCommands {
|
|
177
|
-
element?: HTMLElement;
|
|
178
177
|
group: string;
|
|
179
178
|
commands: CommandItem[];
|
|
180
|
-
|
|
181
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => unknown;
|
|
179
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => unknown;
|
|
182
180
|
}
|
|
183
181
|
export interface BlockProperties {
|
|
184
182
|
blockCommands?: Record<string, BlockCommands>;
|
|
@@ -356,8 +354,6 @@ export interface OnesEditorUndoAction {
|
|
|
356
354
|
redo: (editor: OnesEditor) => boolean;
|
|
357
355
|
combinable: (other: OnesEditorUndoAction) => boolean;
|
|
358
356
|
combine: (other: OnesEditorUndoAction) => void;
|
|
359
|
-
getTimeStamp: () => number;
|
|
360
|
-
getBatchActionId?: () => string | undefined;
|
|
361
357
|
}
|
|
362
358
|
export interface OnesEditorUndoManager {
|
|
363
359
|
reset: () => void;
|
|
@@ -644,7 +640,6 @@ export type PasteOptions = {
|
|
|
644
640
|
};
|
|
645
641
|
export interface OnesEditorInput {
|
|
646
642
|
readonly inputElement: HTMLTextAreaElement;
|
|
647
|
-
getInput: () => HTMLTextAreaElement;
|
|
648
643
|
destroy: () => void;
|
|
649
644
|
focus: () => void;
|
|
650
645
|
handleDocumentSelectionChange: () => void;
|
|
@@ -664,11 +659,11 @@ export interface OnesEditorInput {
|
|
|
664
659
|
export interface OnesEditorSelectionHandler {
|
|
665
660
|
isSelecting: () => boolean;
|
|
666
661
|
stopSelection: () => void;
|
|
667
|
-
handleMouseDown: (event: MouseEvent
|
|
662
|
+
handleMouseDown: (event: MouseEvent, options: {
|
|
668
663
|
autoScroll: boolean;
|
|
669
664
|
}) => void;
|
|
670
665
|
handleMouseMove: (event: MouseEvent) => void;
|
|
671
|
-
handleMouseUp: (event: MouseEvent
|
|
666
|
+
handleMouseUp: (event: MouseEvent) => void;
|
|
672
667
|
handleDblClick: (event: MouseEvent) => void;
|
|
673
668
|
handleTripleClick: (event: MouseEvent) => void;
|
|
674
669
|
}
|
|
@@ -719,43 +714,32 @@ export interface OnesEditorInsertions {
|
|
|
719
714
|
}
|
|
720
715
|
export type CommandParams = {
|
|
721
716
|
[index: string]: unknown;
|
|
722
|
-
} & {
|
|
723
|
-
source?: string[];
|
|
724
|
-
isFilter?: boolean;
|
|
725
717
|
};
|
|
726
718
|
export type CommandResult = {
|
|
727
719
|
[index: string]: unknown;
|
|
728
720
|
};
|
|
729
721
|
export interface OnesEditorCommandProvider {
|
|
730
722
|
id: string;
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
export interface CommandItemWithSource extends CommandItem {
|
|
723
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => BlockCommandItem[];
|
|
724
|
+
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: BlockCommandItem, params: CommandParams, result: CommandResult) => boolean;
|
|
725
|
+
filterCommands?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, commands: BlockCommandItemWithSource[]) => BlockCommandItemWithSource[] | undefined;
|
|
726
|
+
beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: BlockCommandItem, params: CommandParams) => boolean | undefined;
|
|
727
|
+
afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: BlockCommandItem, params: CommandParams, result: CommandResult) => void;
|
|
728
|
+
getEmptyBlockTextAttributes?: (editor: OnesEditor, blockId: string) => DocBlockTextAttributes | undefined;
|
|
729
|
+
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult) => boolean;
|
|
730
|
+
}
|
|
731
|
+
export interface BlockCommandItemWithSource extends BlockCommandItem {
|
|
742
732
|
source: string;
|
|
743
733
|
}
|
|
744
|
-
export interface CommandFilter {
|
|
745
|
-
filter: (editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]) => CommandItemWithSource[];
|
|
746
|
-
}
|
|
747
|
-
export type CommandFilterId = keyof any;
|
|
748
734
|
export interface OnesEditorCommandProviders {
|
|
749
|
-
commandFilters?: Map<CommandFilterId, CommandFilter>;
|
|
750
|
-
addFilter?: (id: CommandFilterId, filter: CommandFilter) => void;
|
|
751
|
-
filterItems?: (range: SelectionRange, items: CommandItemWithSource[]) => CommandItemWithSource[];
|
|
752
735
|
registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
|
|
753
736
|
getCommandProviders: () => OnesEditorCommandProvider[];
|
|
754
737
|
getCommandProvider: (id: string) => OnesEditorCommandProvider;
|
|
755
|
-
getCommands: (range: SelectionRange) =>
|
|
756
|
-
executeCommand: (range: SelectionRange, item:
|
|
738
|
+
getCommands: (range: SelectionRange, source: string) => BlockCommandItemWithSource[];
|
|
739
|
+
executeCommand: (range: SelectionRange, item: BlockCommandItemWithSource, params: CommandParams) => {
|
|
757
740
|
[index: string]: CommandResult;
|
|
758
741
|
};
|
|
742
|
+
getEmptyBlockTextAttributes: (editor: OnesEditor, blockId: string) => DocBlockTextAttributes | undefined;
|
|
759
743
|
}
|
|
760
744
|
export interface EditorDocLocalActionCallbacks {
|
|
761
745
|
onBeforeUpdateBlockText: (containerId: string, blockId: string, oldText: DocBlockText, newText: DocBlockText, newRange: OnesEditorDocRange) => void;
|
|
@@ -769,12 +753,5 @@ export interface OnesEditorBlockHook {
|
|
|
769
753
|
create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
770
754
|
update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
771
755
|
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
772
|
-
commands?: (editor: OnesEditor, blockElement: BlockElement
|
|
773
|
-
}
|
|
774
|
-
export interface MobileClient {
|
|
775
|
-
getViewPortHeight: () => number;
|
|
776
|
-
getOffsetHeight: () => number;
|
|
777
|
-
virtualViewportHeight: number;
|
|
778
|
-
virtualViewportOffsetTop: number;
|
|
779
|
-
isAndroidApp: boolean;
|
|
756
|
+
commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
|
|
780
757
|
}
|
|
@@ -4,15 +4,11 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
4
4
|
protected containerId: string;
|
|
5
5
|
beforeRange: OnesEditorDocRange;
|
|
6
6
|
afterRange: OnesEditorDocRange;
|
|
7
|
-
|
|
8
|
-
ts: number;
|
|
9
|
-
constructor(editor: OnesEditor, containerId: string, afterRange: OnesEditorDocRange, batchActionId?: string);
|
|
10
|
-
getTimeStamp(): number;
|
|
7
|
+
constructor(editor: OnesEditor, containerId: string, afterRange: OnesEditorDocRange);
|
|
11
8
|
undo(editor: OnesEditor): boolean;
|
|
12
9
|
redo(editor: OnesEditor): boolean;
|
|
13
10
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
14
11
|
combine(other: OnesEditorUndoAction): void;
|
|
15
|
-
getBatchActionId(): string | undefined;
|
|
16
12
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
17
13
|
hasDocContainerId(editor: OnesEditor, id: string): boolean;
|
|
18
14
|
findDocBlockById(editor: OnesEditor, id: string): DocBlock | undefined;
|
|
@@ -7,5 +7,4 @@ 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;
|
|
11
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import {
|
|
2
|
+
import type { TextBlockContentChild } from '../core/blocks/text-blocks/base/child';
|
|
3
|
+
import { BlockElement, OnesEditor, OnesEditorCustom } from '../core/types';
|
|
3
4
|
export interface OnesEditorHoveringBlockEvents {
|
|
4
5
|
change: (block: BlockElement | null, old: BlockElement | null, event: MouseEvent) => void;
|
|
5
6
|
targetChange: (block: BlockElement | null, old: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|
|
@@ -14,8 +15,8 @@ export interface OnesEditorHoveringBlockFinder extends OnesEditorCustom {
|
|
|
14
15
|
export default class OnesEditorHoveringBlock extends TypedEmitter<OnesEditorHoveringBlockEvents> {
|
|
15
16
|
private editor;
|
|
16
17
|
private hoveringBlock;
|
|
17
|
-
hoveringElem
|
|
18
|
-
hoveringTextChild
|
|
18
|
+
private hoveringElem;
|
|
19
|
+
private hoveringTextChild;
|
|
19
20
|
private filters;
|
|
20
21
|
private finders;
|
|
21
22
|
constructor(editor: OnesEditor);
|
|
@@ -10,7 +10,6 @@ export interface IUserOptions {
|
|
|
10
10
|
verticalOffset?: number;
|
|
11
11
|
disableHorizontal?: boolean;
|
|
12
12
|
disableVertical?: boolean;
|
|
13
|
-
getClientHeight?: () => number;
|
|
14
13
|
}
|
|
15
14
|
export interface IOptions {
|
|
16
15
|
cancelOnUserAction: boolean;
|
|
@@ -23,7 +22,6 @@ export interface IOptions {
|
|
|
23
22
|
verticalOffset: number;
|
|
24
23
|
disableHorizontal?: boolean;
|
|
25
24
|
disableVertical?: boolean;
|
|
26
|
-
getClientHeight?: () => number;
|
|
27
25
|
}
|
|
28
26
|
declare function animateScrollTo(y: number, userOptions?: IUserOptions): Promise<boolean>;
|
|
29
27
|
declare function animateScrollTo(coords: TCoords, userOptions?: IUserOptions): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSStyles
|
|
1
|
+
import type { CSSStyles } 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,7 +37,4 @@ 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;
|
|
43
40
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
2
|
-
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
3
|
-
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
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;
|
|
4
4
|
export interface DragDropOptions<T> {
|
|
5
5
|
elem: HTMLElement;
|
|
6
6
|
onDragStart: DragStartHandler<T>;
|
|
@@ -10,7 +10,6 @@ export interface DragDropOptions<T> {
|
|
|
10
10
|
minThreshold?: number;
|
|
11
11
|
cursor?: string;
|
|
12
12
|
mouseDownEvent?: MouseEvent;
|
|
13
|
-
mobile?: boolean;
|
|
14
13
|
}
|
|
15
14
|
export declare const MIN_DISTANCE_THRESHOLD = 3;
|
|
16
15
|
export declare class DragDrop<T> {
|
|
@@ -38,9 +37,5 @@ export declare class DragDrop<T> {
|
|
|
38
37
|
private onDragging;
|
|
39
38
|
private onDragEnd;
|
|
40
39
|
destroy(): void;
|
|
41
|
-
static getEventPosition(event: MouseEvent | TouchEvent): {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
};
|
|
45
40
|
}
|
|
46
41
|
export declare function registerDragDrop<T>(options: DragDropOptions<T>): DragDrop<T>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export type
|
|
3
|
-
export interface StandardEmbedBlockProperties<T =
|
|
2
|
+
export type PresetCommandId = 'edit' | 'add-comment';
|
|
3
|
+
export interface StandardEmbedBlockProperties<T = PresetCommandId> {
|
|
4
4
|
presetIds?: T[];
|
|
5
|
-
|
|
6
|
-
extCommands?: CommandItem[] | ((editor: OnesEditor, block: BlockElement) => CommandItem[]);
|
|
5
|
+
extCommands?: CommandItem[];
|
|
7
6
|
handleExecuteCommand?: (editor: OnesEditor, block: BlockElement, item: CommandItem) => boolean;
|
|
8
7
|
}
|
|
9
8
|
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement): boolean;
|
|
10
|
-
export declare class StandardEmbedBlockCommands<T =
|
|
9
|
+
export declare class StandardEmbedBlockCommands<T = PresetCommandId> implements BlockCommands {
|
|
11
10
|
protected editor: OnesEditor;
|
|
12
11
|
protected block: BlockElement;
|
|
13
12
|
protected properties?: StandardEmbedBlockProperties<T> | undefined;
|
|
@@ -19,6 +18,6 @@ export declare class StandardEmbedBlockCommands<T = CommandId> implements BlockC
|
|
|
19
18
|
}
|
|
20
19
|
export declare function getStandardEmbedBlockProperties(editor: OnesEditor, block: BlockElement, properties?: StandardEmbedBlockProperties): {
|
|
21
20
|
blockCommands: {
|
|
22
|
-
'hovering-toolbar': StandardEmbedBlockCommands<
|
|
21
|
+
'hovering-toolbar': StandardEmbedBlockCommands<PresetCommandId>;
|
|
23
22
|
};
|
|
24
23
|
};
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { StandardEmbedBlockCommands } from '../../../../@ones-editor/embed-block-helper';
|
|
3
|
+
import type { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
4
|
+
import type { StandardEmbedBlockProperties } from '../../../../@ones-editor/embed-block-helper';
|
|
5
|
+
export type PresetCommandId = 'edit' | 'help';
|
|
4
6
|
export type GraphType = 'mermaid' | 'flowchart' | 'plantuml';
|
|
5
|
-
export type GraphEmbedBlockProperties = StandardEmbedBlockProperties
|
|
7
|
+
export type GraphEmbedBlockProperties = StandardEmbedBlockProperties<PresetCommandId>;
|
|
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
|
+
}
|
|
6
19
|
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, block: BlockElement, type: 'mermaid' | 'flowchart' | 'plantuml', properties?: GraphEmbedBlockProperties): {
|
|
7
|
-
abstract: string;
|
|
8
20
|
blockCommands: {
|
|
9
|
-
'hovering-toolbar':
|
|
21
|
+
'hovering-toolbar': GraphBlockCommands;
|
|
10
22
|
};
|
|
23
|
+
abstract: string;
|
|
11
24
|
};
|
|
25
|
+
export {};
|
|
@@ -10,24 +10,13 @@ export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
12
|
type?: undefined;
|
|
13
|
-
groupOrder?: undefined;
|
|
14
|
-
order?: undefined;
|
|
15
13
|
} | {
|
|
16
14
|
id: string;
|
|
17
15
|
name: string;
|
|
18
16
|
type: CommandItemType;
|
|
19
17
|
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;
|
|
29
18
|
})[];
|
|
30
|
-
|
|
19
|
+
private createIconItem;
|
|
31
20
|
get commands(): CommandItem[];
|
|
32
21
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
33
22
|
}
|
|
@@ -7,7 +7,10 @@ export declare function isRemoteImage(data: ImageItemData): boolean;
|
|
|
7
7
|
export declare function calcImagesFlexIfNeeded(images: ImageItemData[]): void;
|
|
8
8
|
export declare function getImages(data: ImageEmbedData): ImageItemData[];
|
|
9
9
|
export declare function getWidthPercent(blockData: DocEmbedBlock): number | undefined;
|
|
10
|
+
export declare function getWidthReal(blockData: DocEmbedBlock): number | undefined;
|
|
11
|
+
export declare function clearWidthReal(imageData: ImageEmbedData): void;
|
|
12
|
+
export declare function setWidthPercentAndWidthReal(blockData: DocEmbedBlock, widthPercent: number, widthReal?: number): void;
|
|
10
13
|
export declare function calImageBlockStyleWidth(editor: OnesEditor, blockData: DocEmbedBlock, parentContainerElement: ContainerElement, failedLoad?: boolean): string;
|
|
11
|
-
export declare function toImageEmbedData(images: ImageItemData[], widthPercent?: number): ImageEmbedData;
|
|
14
|
+
export declare function toImageEmbedData(editor: OnesEditor, images: ImageItemData[], widthPercent?: number): ImageEmbedData;
|
|
12
15
|
export declare function calBlockHeight(editor: OnesEditor, imageData: DocEmbedBlock, parentContainerElement: ContainerElement, failedLoad?: boolean): string;
|
|
13
16
|
export declare function getTotalFlex(images: ImageItemData[]): number;
|
|
@@ -7,6 +7,7 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
7
7
|
private images;
|
|
8
8
|
private selectedIndex;
|
|
9
9
|
blockResizer: BlockResizer;
|
|
10
|
+
private disableResizing;
|
|
10
11
|
private resizing;
|
|
11
12
|
private parentContainerResizerObserver;
|
|
12
13
|
private autoFix;
|
|
@@ -21,7 +22,7 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
21
22
|
getImages(): ImageItemData[];
|
|
22
23
|
getWidthPercent(): number | undefined;
|
|
23
24
|
isEmpty(): boolean;
|
|
24
|
-
|
|
25
|
+
setDisableResizing(disable: boolean): void;
|
|
25
26
|
getSelectedIndex(): number;
|
|
26
27
|
getBlock(): BlockElement | null;
|
|
27
28
|
setSelectedIndex(index: number): void;
|
|
@@ -42,5 +43,4 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
42
43
|
private setData;
|
|
43
44
|
static create(editor: OnesEditor, blockData: DocEmbedBlock): ImageObject;
|
|
44
45
|
static getImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject;
|
|
45
|
-
static findImageObject(editor: OnesEditor, block: BlockElement | string): ImageObject | null;
|
|
46
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
|
|
15
|
-
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent
|
|
16
|
-
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: 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;
|
|
17
17
|
}
|
|
@@ -20,6 +20,7 @@ export interface ImageItemData {
|
|
|
20
20
|
flex: number;
|
|
21
21
|
virtualSize: boolean;
|
|
22
22
|
downloading?: boolean;
|
|
23
|
+
widthReal?: number;
|
|
23
24
|
}
|
|
24
25
|
export interface ImageObjectBase extends OnesEditorCustom {
|
|
25
26
|
getImages: () => ImageItemData[];
|
|
@@ -30,7 +31,7 @@ export interface ImageObjectBase extends OnesEditorCustom {
|
|
|
30
31
|
replaceImage: (index: number, file: File) => Promise<boolean>;
|
|
31
32
|
updateFlex: (flex: number[]) => void;
|
|
32
33
|
requestUploadImage: (index: number) => Promise<void>;
|
|
33
|
-
|
|
34
|
+
setDisableResizing: (disable: boolean) => void;
|
|
34
35
|
resetFlex: () => void;
|
|
35
36
|
setAutoFix: (val: boolean) => void;
|
|
36
37
|
isAutoFix: () => boolean;
|
|
@@ -7,9 +7,8 @@ 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';
|
|
11
10
|
export { type ListOptions, type DocListBlock } from './types';
|
|
12
11
|
declare const ListBlock: TextKindBlock;
|
|
13
12
|
export * from './utils';
|
|
14
13
|
export * from './keyboard/to-text-block';
|
|
15
|
-
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, ListPasteHandler,
|
|
14
|
+
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, ListPasteHandler, };
|
|
@@ -9,25 +9,14 @@ export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
|
-
groupOrder: number;
|
|
13
|
-
order: number;
|
|
14
12
|
type?: undefined;
|
|
15
13
|
} | {
|
|
16
14
|
id: string;
|
|
17
15
|
name: string;
|
|
18
16
|
type: CommandItemType;
|
|
19
17
|
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;
|
|
29
18
|
})[];
|
|
30
|
-
|
|
19
|
+
private createIconItem;
|
|
31
20
|
get commands(): CommandItem[];
|
|
32
21
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
33
22
|
}
|
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { CommandItem, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
3
|
-
import { AutoSuggestAnchor,
|
|
2
|
+
import { AutoSuggestAnchor, OnesEditorAutoSuggest } from '../../../@ones-editor/ui-base';
|
|
4
3
|
import { MentionOptions } from './types';
|
|
5
|
-
interface MobileWrap {
|
|
6
|
-
wrapper: HTMLElement;
|
|
7
|
-
input: EditorInput;
|
|
8
|
-
content: HTMLElement;
|
|
9
|
-
}
|
|
10
4
|
export default class OnesEditorMention implements OnesEditorCustom {
|
|
11
5
|
private editor;
|
|
12
6
|
private options;
|
|
13
7
|
suggest: OnesEditorAutoSuggest;
|
|
14
|
-
private mobileWrap?;
|
|
15
|
-
private items;
|
|
16
8
|
constructor(editor: OnesEditor, options: MentionOptions);
|
|
17
|
-
createMobileHeader: () => HTMLDivElement | undefined;
|
|
18
9
|
onClose: () => void;
|
|
19
10
|
destroy(): void;
|
|
20
11
|
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;
|
|
24
12
|
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[]>;
|
|
35
13
|
queryItems: (menu: OnesEditorAutoSuggest, text: string) => Promise<CommandItem[]>;
|
|
36
14
|
}
|
|
37
|
-
export {};
|