@ones-editor/editor 2.0.8-beta.1 → 2.1.0-beta.1

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.
Files changed (193) hide show
  1. package/@ones-editor/block-menu/src/block-menu-button/drag-preview/element-to-data-url.d.ts +1 -1
  2. package/@ones-editor/block-menu/src/block-menu-button/index.d.ts +4 -15
  3. package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +23 -0
  4. package/@ones-editor/callout-block/package.json +11 -0
  5. package/@ones-editor/callout-block/src/callout-block/callout-block-content.d.ts +3 -0
  6. package/@ones-editor/callout-block/src/callout-block/callout-block-doc.d.ts +2 -0
  7. package/@ones-editor/callout-block/src/callout-block/callout-block.d.ts +3 -0
  8. package/@ones-editor/callout-block/src/callout-block/callout-converter-interceptor.d.ts +8 -0
  9. package/@ones-editor/callout-block/src/callout-block/callout-input-handler.d.ts +11 -0
  10. package/@ones-editor/callout-block/src/callout-block/callout-last-callout-payload.d.ts +9 -0
  11. package/@ones-editor/callout-block/src/callout-block/callout-options.d.ts +2 -0
  12. package/@ones-editor/callout-block/src/callout-block/callout-properties.d.ts +2 -0
  13. package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +7 -0
  14. package/@ones-editor/callout-block/src/callout-block/command-items/bg-color-item.d.ts +22 -0
  15. package/@ones-editor/callout-block/src/callout-block/command-items/delete-icon-item.d.ts +4 -0
  16. package/@ones-editor/callout-block/src/callout-block/command-items/preset-item.d.ts +16 -0
  17. package/@ones-editor/callout-block/src/callout-block/converter.d.ts +3 -0
  18. package/@ones-editor/callout-block/src/callout-block/helper.d.ts +4 -0
  19. package/@ones-editor/callout-block/src/callout-block/index.d.ts +1 -0
  20. package/@ones-editor/callout-block/src/callout-block/types.d.ts +9 -0
  21. package/@ones-editor/callout-block/src/index.d.ts +3 -0
  22. package/@ones-editor/callout-block/src/locale/en-us.d.ts +12 -0
  23. package/@ones-editor/callout-block/src/locale/index.d.ts +1 -0
  24. package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +12 -0
  25. package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +12 -0
  26. package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
  27. package/@ones-editor/context-menu/src/helper/command-items.d.ts +1 -0
  28. package/@ones-editor/core/src/core/blocks/common/block-wrapper.d.ts +2 -1
  29. package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
  30. package/@ones-editor/core/src/core/blocks/common/insert-empty-block.d.ts +3 -2
  31. package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/common.d.ts +1 -0
  32. package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/index.d.ts +1 -0
  33. package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
  34. package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
  35. package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +3 -0
  36. package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +3 -3
  37. package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +4 -3
  38. package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -3
  39. package/@ones-editor/core/src/core/containers/children.d.ts +5 -2
  40. package/@ones-editor/core/src/core/containers/element.d.ts +1 -0
  41. package/@ones-editor/core/src/core/doc/container.d.ts +2 -2
  42. package/@ones-editor/core/src/core/doc/doc.d.ts +1 -1
  43. package/@ones-editor/core/src/core/editor/actions/insert-doc/insert-doc.d.ts +1 -1
  44. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -1
  45. package/@ones-editor/core/src/core/editor-doc/handle-block-data-changed.d.ts +2 -1
  46. package/@ones-editor/core/src/core/types.d.ts +82 -25
  47. package/@ones-editor/core/src/core/undo-manager/undo-manager.d.ts +2 -0
  48. package/@ones-editor/core/src/helper/hovering-block.d.ts +3 -1
  49. package/@ones-editor/core/src/i18n/en-us.d.ts +1 -0
  50. package/@ones-editor/core/src/i18n/i18n.d.ts +3 -0
  51. package/@ones-editor/core/src/i18n/ja-jp.d.ts +1 -0
  52. package/@ones-editor/core/src/i18n/zh-cn.d.ts +1 -0
  53. package/@ones-editor/core/src/utils/clipboard.d.ts +6 -4
  54. package/@ones-editor/core/src/utils/data-url.d.ts +1 -0
  55. package/@ones-editor/drop-target/src/drop-indicator.d.ts +5 -4
  56. package/@ones-editor/drop-target/src/drop-target.d.ts +2 -1
  57. package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
  58. package/@ones-editor/drop-target/src/index.d.ts +2 -1
  59. package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +2 -0
  60. package/@ones-editor/file/src/file-embed/card/index.d.ts +1 -1
  61. package/@ones-editor/file/src/types.d.ts +1 -0
  62. package/@ones-editor/graph-embed/src/config/index.d.ts +1 -0
  63. package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -1
  64. package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +3 -1
  65. package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +2 -1
  66. package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
  67. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +1 -4
  68. package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +3 -2
  69. package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +22 -0
  70. package/@ones-editor/image-embed/src/image-dom/download-image.d.ts +2 -0
  71. package/@ones-editor/image-embed/src/image-object.d.ts +3 -0
  72. package/@ones-editor/image-embed/src/index.d.ts +5 -1
  73. package/@ones-editor/image-embed/src/types.d.ts +1 -0
  74. package/@ones-editor/input-handlers/src/index.d.ts +4 -1
  75. package/@ones-editor/input-handlers/src/markdown-shortcuts/converter-interceptors.d.ts +12 -0
  76. package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +9 -1
  77. package/@ones-editor/{column-block → layout-block}/package.json +1 -1
  78. package/@ones-editor/layout-block/src/block-drop.d.ts +3 -0
  79. package/@ones-editor/layout-block/src/caption.d.ts +8 -0
  80. package/@ones-editor/layout-block/src/child-containers.d.ts +3 -0
  81. package/@ones-editor/layout-block/src/column-resizer/index.d.ts +2 -0
  82. package/@ones-editor/layout-block/src/command-filter.d.ts +7 -0
  83. package/@ones-editor/layout-block/src/constants.d.ts +32 -0
  84. package/@ones-editor/layout-block/src/index.d.ts +6 -0
  85. package/@ones-editor/layout-block/src/layout-creator/index.d.ts +27 -0
  86. package/@ones-editor/layout-block/src/layout-operations.d.ts +11 -0
  87. package/@ones-editor/layout-block/src/locale/en-us.d.ts +10 -0
  88. package/@ones-editor/layout-block/src/locale/index.d.ts +1 -0
  89. package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +10 -0
  90. package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +10 -0
  91. package/@ones-editor/layout-block/src/options.d.ts +2 -0
  92. package/@ones-editor/layout-block/src/percent-bar.d.ts +3 -0
  93. package/@ones-editor/layout-block/src/selection.d.ts +5 -0
  94. package/@ones-editor/layout-block/src/toolbar.d.ts +33 -0
  95. package/@ones-editor/layout-block/src/types.d.ts +17 -0
  96. package/@ones-editor/layout-block/src/utils.d.ts +6 -0
  97. package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +22 -0
  98. package/@ones-editor/misc/src/image.d.ts +2 -1
  99. package/@ones-editor/misc/src/re-auth/index.d.ts +7 -2
  100. package/@ones-editor/misc/src/re-auth/locale/en-us.d.ts +1 -0
  101. package/@ones-editor/misc/src/re-auth/locale/ja-jp.d.ts +1 -0
  102. package/@ones-editor/misc/src/re-auth/locale/zh-cn.d.ts +1 -0
  103. package/@ones-editor/misc/src/re-auth/ui/toolbar.d.ts +2 -0
  104. package/@ones-editor/paste-special/src/paste-special-handler.d.ts +1 -0
  105. package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +2 -0
  106. package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +1 -1
  107. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -1
  108. package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
  109. package/@ones-editor/table-block/src/index.d.ts +1 -0
  110. package/@ones-editor/table-block/src/table-block/doc-table-grid.d.ts +1 -0
  111. package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
  112. package/@ones-editor/table-block/src/table-block/table-grid.d.ts +1 -0
  113. package/@ones-editor/text-commands/src/text-command-provider.d.ts +4 -3
  114. package/@ones-editor/text-commands/src/text-commands.d.ts +3 -3
  115. package/@ones-editor/to-docx/src/doc2other/colors.d.ts +7 -1
  116. package/@ones-editor/to-docx/src/doc2other/core.d.ts +2 -0
  117. package/@ones-editor/to-docx/src/doc2other/layout.d.ts +10 -0
  118. package/@ones-editor/toc/src/build-toc.d.ts +1 -0
  119. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  120. package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +10 -0
  121. package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
  122. package/@ones-editor/ui/src/index.d.ts +7 -7
  123. package/@ones-editor/ui/src/providers/abstract-providers.d.ts +19 -0
  124. package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
  125. package/@ones-editor/ui/src/{toolbar/commands → providers}/align.d.ts +4 -4
  126. package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
  127. package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
  128. package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
  129. package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
  130. package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
  131. package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
  132. package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
  133. package/@ones-editor/ui/src/providers/link.d.ts +17 -0
  134. package/@ones-editor/ui/src/providers/list.d.ts +13 -0
  135. package/@ones-editor/ui/src/providers/paragraph.d.ts +8 -0
  136. package/@ones-editor/ui/src/providers/proxy-provider.d.ts +9 -0
  137. package/@ones-editor/ui/src/providers/quoted.d.ts +10 -0
  138. package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
  139. package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
  140. package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
  141. package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
  142. package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
  143. package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +5 -0
  144. package/@ones-editor/ui/src/quick-menu/index.d.ts +5 -10
  145. package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +10 -0
  146. package/@ones-editor/ui/src/quick-menu/types.d.ts +1 -0
  147. package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
  148. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
  149. package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +2 -1
  150. package/@ones-editor/ui-base/src/color-palette/create-palette.d.ts +8 -0
  151. package/@ones-editor/ui-base/src/color-palette/index.d.ts +2 -2
  152. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -2
  153. package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -0
  154. package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +19 -0
  155. package/@ones-editor/ui-base/src/emoji-item/index.d.ts +2 -0
  156. package/@ones-editor/ui-base/src/emoji-palette/emoji-content.d.ts +21 -0
  157. package/@ones-editor/ui-base/src/emoji-palette/emoji-data.d.ts +60 -0
  158. package/@ones-editor/ui-base/src/emoji-palette/emoji-navigation.d.ts +16 -0
  159. package/@ones-editor/ui-base/src/emoji-palette/emoji-search.d.ts +11 -0
  160. package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +23 -0
  161. package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +0 -0
  162. package/@ones-editor/ui-base/src/icons/index.d.ts +20 -1
  163. package/@ones-editor/ui-base/src/index.d.ts +1 -0
  164. package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
  165. package/@ones-editor/ui-base/src/locale/en-us.d.ts +20 -0
  166. package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +20 -0
  167. package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +20 -0
  168. package/dist/index.d.ts +2 -1
  169. package/dist/index.js +128530 -842
  170. package/dist/lang/en-us.d.ts +1 -0
  171. package/dist/lang/ja-jp.d.ts +1 -0
  172. package/dist/lang/zh-cn.d.ts +1 -0
  173. package/dist/types.d.ts +3 -2
  174. package/package.json +3 -3
  175. package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
  176. package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
  177. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
  178. package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
  179. package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
  180. package/@ones-editor/column-block/src/child-containers.d.ts +0 -2
  181. package/@ones-editor/column-block/src/columns-options.d.ts +0 -2
  182. package/@ones-editor/column-block/src/columns-properties.d.ts +0 -15
  183. package/@ones-editor/column-block/src/index.d.ts +0 -4
  184. package/@ones-editor/column-block/src/types.d.ts +0 -11
  185. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
  186. package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
  187. package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
  188. package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
  189. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -7
  190. package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
  191. package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
  192. package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
  193. /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
@@ -1,2 +1,2 @@
1
1
  import { OnesEditor } from '../../../../../@ones-editor/core';
2
- export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement): Promise<string>;
2
+ export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement, marginIncluded?: boolean): Promise<string>;
@@ -1,19 +1,8 @@
1
- import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
2
- import EmptyBlockMenu from '../empty-block-menu';
3
- import BlockMenu from '../block-menu';
4
- export default class OnesEditorBlockMenuButton {
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ import OnesEditorBlockMenuButton from './menu-button';
3
+ export default class OnesEditorBlockMenuButtons {
5
4
  private editor;
6
- buttonElement: HTMLButtonElement;
7
- emptyBlockMenu: EmptyBlockMenu;
8
- blockMenu: BlockMenu;
9
- private dragHandler;
5
+ rootButton: OnesEditorBlockMenuButton;
10
6
  constructor(editor: OnesEditor);
11
7
  destroy(): void;
12
- handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, event: MouseEvent) => void;
13
- handleButtonClick: () => void;
14
- updatePlaceholder: (block: BlockElement) => void;
15
- handleChanged: () => void;
16
- createButton(): HTMLButtonElement;
17
- setButtonType(type: 'move' | 'insert'): void;
18
- updateButton(block: BlockElement): void;
19
8
  }
@@ -0,0 +1,23 @@
1
+ import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
2
+ import { BlockMenu } from '../../../../../@ones-editor/ui';
3
+ import EmptyBlockMenu from '../../empty-block-menu';
4
+ export default class OnesEditorBlockMenuButton {
5
+ private editor;
6
+ buttonElement: HTMLButtonElement;
7
+ emptyBlockMenu: EmptyBlockMenu;
8
+ blockMenu: BlockMenu;
9
+ private dragHandler;
10
+ constructor(editor: OnesEditor);
11
+ destroy(): void;
12
+ handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
13
+ showRootButton(hoverBlock: BlockElement): void;
14
+ showParentButton(hoverBlock: BlockElement): boolean;
15
+ removeParentButton: () => void;
16
+ addButtonToView(block: BlockElement): void;
17
+ handleButtonClick: () => void;
18
+ updatePlaceholder: (block: BlockElement) => void;
19
+ handleChanged: () => void;
20
+ createButton(): HTMLButtonElement;
21
+ setButtonType(type: 'move' | 'insert'): void;
22
+ updateButton(block: BlockElement): void;
23
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@ones-editor/callout-block",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "main": "./src/index.ts",
7
+ "devDependencies": {
8
+ "@types/lodash.isequal": "^4.5.7"
9
+ },
10
+ "types": "src/index.d.ts"
11
+ }
@@ -0,0 +1,3 @@
1
+ import type { OnesEditor, BlockPath, BlockElement } from '../../../../@ones-editor/core';
2
+ import type { DocCalloutBlockData } from './types';
3
+ export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData): import("@ones-editor/core").BlockContentElement;
@@ -0,0 +1,2 @@
1
+ import { DocCalloutBlockData } from './types';
2
+ export declare function isCalloutBlockData(v: unknown): v is DocCalloutBlockData;
@@ -0,0 +1,3 @@
1
+ import type { ComplexKindBlock } from '../../../../@ones-editor/core';
2
+ declare const CalloutBlock: ComplexKindBlock;
3
+ export { CalloutBlock, };
@@ -0,0 +1,8 @@
1
+ import { BlockConverter, ConverterInterceptor } from '../../../../@ones-editor/input-handlers';
2
+ import { OnesEditor, BlockElement, OnesEditorCustom } from '../../../../@ones-editor/core';
3
+ export declare class CalloutConverterInterceptor implements ConverterInterceptor, OnesEditorCustom {
4
+ constructor(editor: OnesEditor);
5
+ handler(editor: OnesEditor, block: BlockElement, converter: BlockConverter): boolean;
6
+ destroy(): void;
7
+ static init(editor: OnesEditor): CalloutConverterInterceptor;
8
+ }
@@ -0,0 +1,11 @@
1
+ import type { OnesEditorInputHandler, OnesEditor, OnesEditorCustom, DocObject } from '../../../../@ones-editor/core';
2
+ export declare class CalloutInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
3
+ constructor(editor: OnesEditor);
4
+ private pasteHasForbidden;
5
+ private handleBackspaceEvent;
6
+ handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
7
+ handleBeforePasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
8
+ handleAfterPaste(): Promise<boolean>;
9
+ destroy(): void;
10
+ static init(editor: OnesEditor): void;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
2
+ import { CalloutBlockPayload } from './types';
3
+ export declare class CalloutLastUpdateData implements OnesEditorCustom {
4
+ private lastCalloutBlockPayload;
5
+ get(): CalloutBlockPayload;
6
+ update(payload: Partial<CalloutBlockPayload>): void;
7
+ destroy(): void;
8
+ static init(editor: OnesEditor): CalloutLastUpdateData;
9
+ }
@@ -0,0 +1,2 @@
1
+ import { BlockOptions } from '../../../../@ones-editor/core';
2
+ export declare function getOptions(): BlockOptions;
@@ -0,0 +1,2 @@
1
+ import type { OnesEditor, BlockElement, BlockProperties } from '../../../../@ones-editor/core';
2
+ export declare function getBlockProperties(editor: OnesEditor, blockElement: BlockElement): BlockProperties;
@@ -0,0 +1,7 @@
1
+ import { CommandFilter, CommandItemWithSource, OnesEditor, OnesEditorCustom, SelectionRange } from '../../../../@ones-editor/core';
2
+ export declare class CalloutQuickMenuItemFilter implements CommandFilter, OnesEditorCustom {
3
+ constructor(editor: OnesEditor);
4
+ filter(editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]): CommandItemWithSource[];
5
+ destroy(): void;
6
+ static init(editor: OnesEditor): CalloutQuickMenuItemFilter;
7
+ }
@@ -0,0 +1,22 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCustom } from '../../../../../@ones-editor/core';
2
+ import { ColorPaletteItem } from '../../../../../@ones-editor/ui-base';
3
+ import { ColorId } from '../types';
4
+ export declare class BgColorItem implements CommandItem, OnesEditorCustom {
5
+ private editor;
6
+ id: string;
7
+ name: string;
8
+ manualShowChildren: boolean;
9
+ dropdown: boolean;
10
+ childrenPlacement: "bottom-start";
11
+ private bgColorButton;
12
+ bgColorPaletteItem: ColorPaletteItem;
13
+ element: HTMLButtonElement;
14
+ children: CommandItem[];
15
+ private constructor();
16
+ private createPaletteButton;
17
+ private getBgColorFromBlock;
18
+ updateButtonColor(bgColor: ColorId): void;
19
+ updateItem(block: BlockElement): void;
20
+ destroy(): void;
21
+ static get(editor: OnesEditor): BgColorItem;
22
+ }
@@ -0,0 +1,4 @@
1
+ import { BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
2
+ export declare const EMPTY_ICON = "";
3
+ export declare function createDeleteIconItem(editor: OnesEditor, block: BlockElement): CommandItem;
4
+ export declare function updateDeleteIconStatus(editor: OnesEditor, block: BlockElement): void;
@@ -0,0 +1,16 @@
1
+ import { BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
2
+ import { CalloutBlockPayload } from '../types';
3
+ export type PresetId = `preset-${0 | 1}`;
4
+ type Preset = CalloutBlockPayload & {
5
+ name: string;
6
+ };
7
+ export declare function isPresetId(id: string): id is PresetId;
8
+ export declare function getPresetId(id: PresetId): string;
9
+ export declare function getPreset(id: PresetId): Preset;
10
+ export declare function getPresetIcon(id: string): string;
11
+ export declare function getPresetPayload(presetId: PresetId): {
12
+ backgroundColor: number;
13
+ icon: "preset-0" | "preset-1";
14
+ };
15
+ export declare function createPresetItem(presetId: PresetId, editor: OnesEditor, block: BlockElement): CommandItem;
16
+ export {};
@@ -0,0 +1,3 @@
1
+ import { OnesEditor, DocBlock, DocObject, BlockPath } from '../../../../@ones-editor/core';
2
+ export declare function toStandardDoc(editor: OnesEditor, blockData: DocBlock, doc: DocObject): Promise<DocObject>;
3
+ export declare function convertTo(editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath): string;
@@ -0,0 +1,4 @@
1
+ import { DocBlock } from '../../../../@ones-editor/core';
2
+ import { ColorId } from './types';
3
+ export declare function checkBlockAllowInCallout(block: DocBlock): boolean;
4
+ export declare function getHexBackgroundColor(backgroundColor: ColorId): string;
@@ -0,0 +1 @@
1
+ export { CalloutBlock } from './callout-block';
@@ -0,0 +1,9 @@
1
+ import { DocBlock } from '../../../../@ones-editor/core';
2
+ export type ColorId = number;
3
+ export interface DocCalloutBlockData extends DocBlock {
4
+ type: 'callout';
5
+ icon: string;
6
+ backgroundColor: ColorId;
7
+ children: string[];
8
+ }
9
+ export type CalloutBlockPayload = Pick<DocCalloutBlockData, 'icon' | 'backgroundColor'>;
@@ -0,0 +1,3 @@
1
+ import './index.scss';
2
+ import './locale';
3
+ export { CalloutBlock } from './callout-block';
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ callout: {
3
+ name: string;
4
+ command: {
5
+ presetInfo: string;
6
+ presetAlert: string;
7
+ clearEmoji: string;
8
+ background: string;
9
+ };
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ callout: {
3
+ name: string;
4
+ command: {
5
+ presetInfo: string;
6
+ presetAlert: string;
7
+ clearEmoji: string;
8
+ background: string;
9
+ };
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ callout: {
3
+ name: string;
4
+ command: {
5
+ presetInfo: string;
6
+ presetAlert: string;
7
+ clearEmoji: string;
8
+ background: string;
9
+ };
10
+ };
11
+ };
12
+ export default _default;
@@ -1,12 +1,13 @@
1
- import { BlockCommandItem, BlockCommandItemWithSource, BlockElement, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
1
+ import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorCommentsProvider } from '../types';
3
3
  import type { OnesEditorComments } from '../comments';
4
4
  export default class CommentsCommandProvider implements OnesEditorCommandProvider {
5
5
  private provider;
6
6
  private editorComments;
7
7
  id: string;
8
+ groupIndex: number;
8
9
  constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
9
- getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
10
+ getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
10
11
  hideToolbar(editor: OnesEditor): void;
11
- executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult): boolean;
12
+ executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult): boolean;
12
13
  }
@@ -23,4 +23,5 @@ export default class ContextMenuCommandItems {
23
23
  private secureEnvTips;
24
24
  private isFocusImageBlock;
25
25
  private isFocusImageTypeEmbed;
26
+ private isEmptyImageTypeEmbed;
26
27
  }
@@ -1,9 +1,10 @@
1
- import { OnesEditor, BlockElement, BlockPosition, ConvertBlockResult, SelectionRange, BlockStyles } from '../../types';
1
+ import { OnesEditor, BlockElement, BlockPosition, ConvertBlockResult, SelectionRange, BlockStyles, ContainerElement } from '../../types';
2
2
  import { DocBlock, DocBlockAttributes } from '../../doc';
3
3
  export declare function getBlockTextLength(editor: OnesEditor, block: BlockElement): number;
4
4
  export declare function clearAllSelection(editor: OnesEditor): void;
5
5
  export declare function updateBlockSelection(editor: OnesEditor, block: BlockElement, from: BlockPosition, to: BlockPosition): void;
6
6
  export declare function getRootBlock(block: BlockElement): BlockElement;
7
+ export declare function getClosestContainerByCondition(_block: BlockElement, condition: (container: ContainerElement) => boolean): BlockElement | undefined;
7
8
  export declare function getBlockMinWidth(editor: OnesEditor, block: BlockElement): number | undefined;
8
9
  export declare function handleBlockElementUpdated(editor: OnesEditor, block: BlockElement, data: DocBlock): void;
9
10
  export declare function convertBlockFrom(editor: OnesEditor, block: BlockElement, type: string, options: {
@@ -1,3 +1,3 @@
1
- import { BlockCommandItemWithSource, BlockElement, CommandItem, OnesEditor } from '../../types';
1
+ import { BlockElement, CommandItem, CommandItemWithSource, OnesEditor } from '../../types';
2
2
  export declare function executeEmbedBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItem): unknown;
3
- export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: BlockCommandItemWithSource): unknown;
3
+ export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItemWithSource): unknown;
@@ -1,3 +1,4 @@
1
- import { OnesEditor } from '../../types';
1
+ import { ContainerBlockOverrideInsertEmptyBlockInsideOptions, OnesEditor } from '../../types';
2
+ export declare function getContainerBlockOverrideOptions(editor: OnesEditor, containerID: string, blockType?: string): ContainerBlockOverrideInsertEmptyBlockInsideOptions | undefined;
2
3
  export declare function insertEmptyEmbedBlock(editor: OnesEditor, embedType: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null>;
3
- export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null> | null;
4
+ export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown>, item?: Record<string, unknown>): Promise<import("../../types").BlockElement | null> | null;
@@ -1,3 +1,4 @@
1
1
  import { BlockElement } from '../../../types';
2
+ export declare function isColumnsBlock(block: BlockElement): boolean;
2
3
  export declare function isEmbedBlock(block: BlockElement): boolean;
3
4
  export declare function getEmbedType(block: BlockElement): string;
@@ -1,3 +1,4 @@
1
1
  import EmbedBlock from './embed-block';
2
2
  export * from './common';
3
+ export * from './helper';
3
4
  export { EmbedBlock };
@@ -1,2 +1,4 @@
1
1
  export * from './intersection-commands';
2
2
  export * from './range-commands';
3
+ export * from './merge-commands';
4
+ export * from './inject-source';
@@ -0,0 +1,3 @@
1
+ import { CommandItemWithSource } from '../../types';
2
+ export declare const injectSource: (commands: CommandItemWithSource[], source?: string[]) => void;
3
+ export declare const getSourceList: (source: string) => string[];
@@ -0,0 +1,3 @@
1
+ import { CommandItem } from '../../types';
2
+ export declare function mergeCommands(blockCommands: CommandItem[]): CommandItem[];
3
+ export declare const flatCommands: (allCommands: Map<number, CommandItem[]>, sort?: boolean) => CommandItem[];
@@ -1,5 +1,5 @@
1
- import { BlockCommandItemWithSource, CommandParams, CommandResult, SelectionRange } from '../../types';
2
- export declare function getRangeCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
3
- export declare function executeRangeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
1
+ import { CommandItemWithSource, CommandParams, CommandResult, SelectionRange } from '../../types';
2
+ export declare function getRangeCommands(range: SelectionRange, source: string): CommandItemWithSource[];
3
+ export declare function executeRangeCommand(range: SelectionRange, command: CommandItemWithSource, params: CommandParams): {
4
4
  [index: string]: CommandResult;
5
5
  };
@@ -1,14 +1,15 @@
1
1
  import { DocBlockTextAttributes } from '../doc';
2
- import { OnesEditor, OnesEditorCommandProviders, OnesEditorCommandProvider, SelectionRange, CommandParams, BlockCommandItemWithSource } from '../types';
2
+ import { OnesEditor, OnesEditorCommandProviders, OnesEditorCommandProvider, SelectionRange, CommandParams, CommandItemWithSource } from '../types';
3
3
  export default class EditorCommandProviders implements OnesEditorCommandProviders {
4
4
  private editor;
5
+ id: string;
5
6
  private providers;
6
7
  constructor(editor: OnesEditor);
7
8
  registerCommandProvider(provider: OnesEditorCommandProvider): void;
8
9
  getCommandProviders(): OnesEditorCommandProvider[];
9
10
  getCommandProvider(id: string): OnesEditorCommandProvider;
10
- getCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
11
- executeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
11
+ getCommands(range: SelectionRange): CommandItemWithSource[];
12
+ executeCommand(range: SelectionRange, command: CommandItemWithSource, params: CommandParams): {
12
13
  [index: string]: import("../types").CommandResult;
13
14
  };
14
15
  getEmptyBlockTextAttributes(editor: OnesEditor, blockId: string): DocBlockTextAttributes | undefined;
@@ -25,12 +25,12 @@ export declare class EditorInput implements OnesEditorInput {
25
25
  editor: OnesEditor;
26
26
  composing: boolean;
27
27
  callbacks: EditorInputCallbacks;
28
- inputElement: HTMLInputElement;
28
+ inputElement: HTMLTextAreaElement;
29
29
  constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
30
30
  private isInCommandBar;
31
31
  destroy(): void;
32
- getInput(): HTMLInputElement;
33
- focus(): void;
32
+ getInput(): HTMLTextAreaElement;
33
+ focus(options?: FocusOptions): void;
34
34
  isInDisableScrollMask(target: Node): boolean;
35
35
  handleWindowBlur: () => void;
36
36
  handleWindowFocus: () => void;
@@ -1,5 +1,8 @@
1
- import { BlockElement, ContainerElement } from '../types';
2
- export declare function getChildBlocks(container: ContainerElement): BlockElement[];
1
+ import { BlockElement, ContainerElement, OnesEditor } from '../types';
2
+ export declare function getChildBlocks(container: ContainerElement, traverseChild?: {
3
+ condition: (block: BlockElement) => boolean;
4
+ editor: OnesEditor;
5
+ }): BlockElement[];
3
6
  export declare function getFirstChildBlock(container: ContainerElement): BlockElement;
4
7
  export declare function getLastChildBlock(container: ContainerElement): BlockElement;
5
8
  export declare function getChildBlockCount(container: ContainerElement): number;
@@ -4,3 +4,4 @@ export declare function getContainerById(editor: OnesEditor, containerId: string
4
4
  export declare function getExistsContainerById(editor: OnesEditor, containerId: string): ContainerElement | null;
5
5
  export declare function getContainerBlocksElement(container: ContainerElement): ContainerBlocksElement;
6
6
  export declare function getContainerToolsElement(container: ContainerElement): ContainerToolsElement;
7
+ export declare function isContainerBlocksElement(element: Element): element is ContainerBlocksElement;
@@ -1,3 +1,3 @@
1
- import { DocBlock, OnesEditorDoc } from './doc';
2
- export declare function createContainer(doc: OnesEditorDoc, blocks: DocBlock[]): string;
1
+ import { DocBlock, DocObject, OnesEditorDoc } from './doc';
2
+ export declare function createContainer(doc: OnesEditorDoc, docsOrDocObject: DocBlock[] | DocObject): string;
3
3
  export declare function createEmptyContainer(doc: OnesEditorDoc, text?: string): string;
@@ -244,7 +244,7 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
244
244
  recognizeLink?: (link: string) => Promise<RecognizeLinkResult>;
245
245
  beginBatchUpdate: () => number;
246
246
  endBatchUpdate: () => number;
247
- triggerReAuth?: () => void;
247
+ triggerReAuth?: (auto?: boolean) => void;
248
248
  }
249
249
  export interface OnesEditorDocHistoryData {
250
250
  user: {
@@ -1,4 +1,4 @@
1
1
  import { DocObject } from '../../../doc';
2
2
  import { BlockElement, CloneBlockResultInfo, ContainerElement, OnesEditor } from '../../../types';
3
3
  export declare function editorInsertDoc(editor: OnesEditor, block: BlockElement, offset: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): void;
4
- export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): BlockElement[];
4
+ export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number, _docToInsert: DocObject, cloneDocResult?: CloneBlockResultInfo): BlockElement[];
@@ -42,7 +42,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
42
42
  broadcastMessage(data: unknown): void;
43
43
  getUser(): import("../doc").OnesEditorUser;
44
44
  getRemoteUsers(): import("../doc").OnesEditorRemoteUsers;
45
- triggerReAuth(): void | undefined;
45
+ triggerReAuth(auto?: boolean): void;
46
46
  destroy(): void;
47
47
  getServerMeta(): OnesEditorDocServerMeta;
48
48
  reset(doc: OnesEditorDoc): void;
@@ -1,2 +1,3 @@
1
+ import type { DocBlockDelta } from '../doc';
1
2
  import { OnesEditor } from '../types';
2
- export declare function onBlockDataChanged(editor: OnesEditor, containerId: string, blockIndex: number): void;
3
+ export declare function onBlockDataChanged(editor: OnesEditor, containerId: string, blockIndex: number, delta?: DocBlockDelta): void;