@ones-editor/editor 2.1.7-beta.6 → 2.1.7-beta.8

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 (171) hide show
  1. package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +1 -1
  2. package/@ones-editor/block-menu/src/index.d.ts +0 -1
  3. package/@ones-editor/block-padding/src/index.d.ts +1 -1
  4. package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +3 -4
  5. package/@ones-editor/callout-block/src/index.d.ts +1 -0
  6. package/@ones-editor/comments/src/index.d.ts +2 -1
  7. package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
  8. package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
  9. package/@ones-editor/core/src/core/command-providers/abstract-providers.d.ts +25 -0
  10. package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +14 -0
  11. package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
  12. package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
  13. package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +4 -0
  14. package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +2 -5
  15. package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +5 -14
  16. package/@ones-editor/core/src/core/command-providers/index.d.ts +3 -1
  17. package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
  18. package/@ones-editor/core/src/core/containers/root-container.d.ts +2 -2
  19. package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +2 -0
  20. package/@ones-editor/core/src/core/editor/actions/clear-selected-contents.d.ts +2 -2
  21. package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -1
  22. package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
  23. package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
  24. package/@ones-editor/core/src/core/types.d.ts +29 -26
  25. package/@ones-editor/core/src/helper/hovering-block.d.ts +2 -2
  26. package/@ones-editor/core/src/utils/dom.d.ts +3 -0
  27. package/@ones-editor/core/src/utils/drag-drop.d.ts +8 -3
  28. package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +6 -5
  29. package/@ones-editor/file/src/locale/en-us.d.ts +1 -0
  30. package/@ones-editor/file/src/locale/ja-jp.d.ts +1 -0
  31. package/@ones-editor/file/src/locale/zh-cn.d.ts +1 -0
  32. package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +5 -19
  33. package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +12 -1
  34. package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
  35. package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
  36. package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +1 -0
  37. package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
  38. package/@ones-editor/layout-block/src/command-filter.d.ts +6 -0
  39. package/@ones-editor/layout-block/src/index.d.ts +1 -0
  40. package/@ones-editor/list-block/src/index.d.ts +2 -1
  41. package/@ones-editor/main-toolbar/src/items/font-style.d.ts +1 -1
  42. package/@ones-editor/main-toolbar/src/items/link.d.ts +1 -1
  43. package/@ones-editor/main-toolbar/src/items/list.d.ts +4 -4
  44. package/@ones-editor/main-toolbar/src/items/quote.d.ts +1 -1
  45. package/@ones-editor/main-toolbar/src/items/text-color.d.ts +37 -0
  46. package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +12 -1
  47. package/@ones-editor/media-embed/src/utils/dom.d.ts +2 -0
  48. package/@ones-editor/mention/src/locale/en-us.d.ts +3 -0
  49. package/@ones-editor/mention/src/locale/ja-jp.d.ts +3 -0
  50. package/@ones-editor/mention/src/locale/zh-cn.d.ts +3 -0
  51. package/@ones-editor/mention/src/mention.d.ts +15 -0
  52. package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +14 -0
  53. package/@ones-editor/mobile-helper/src/fixed-toolbar/active-observer.d.ts +11 -0
  54. package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +6 -0
  55. package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +21 -0
  56. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +9 -0
  57. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +7 -0
  58. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +15 -0
  59. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +8 -0
  60. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/paragraph.d.ts +9 -0
  61. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/tab-provider.d.ts +10 -0
  62. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +9 -0
  63. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +8 -0
  64. package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +11 -0
  65. package/@ones-editor/mobile-helper/src/index.d.ts +10 -1
  66. package/@ones-editor/mobile-helper/src/locale/en-us.d.ts +9 -0
  67. package/@ones-editor/mobile-helper/src/locale/index.d.ts +1 -0
  68. package/@ones-editor/mobile-helper/src/locale/ja-jp.d.ts +9 -0
  69. package/@ones-editor/mobile-helper/src/locale/zh-cn.d.ts +9 -0
  70. package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +19 -0
  71. package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +3 -0
  72. package/@ones-editor/table-block/src/commands/index.d.ts +2 -0
  73. package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
  74. package/@ones-editor/table-block/src/commands/table-command-provider.d.ts +12 -0
  75. package/@ones-editor/table-block/src/index.d.ts +6 -2
  76. package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
  77. package/@ones-editor/table-block/src/locale/ja-jp.d.ts +5 -0
  78. package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
  79. package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +6 -0
  80. package/@ones-editor/table-block/src/table-block/table-resize/resize-drag-drop.d.ts +4 -4
  81. package/@ones-editor/text-commands/src/index.d.ts +1 -2
  82. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  83. package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +8 -0
  84. package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
  85. package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +10 -0
  86. package/@ones-editor/ui/src/box-helper/standard-box-provider.d.ts +9 -0
  87. package/@ones-editor/ui/src/index.d.ts +29 -8
  88. package/@ones-editor/ui/src/locale/en-us.d.ts +5 -0
  89. package/@ones-editor/ui/src/locale/ja-jp.d.ts +5 -0
  90. package/@ones-editor/ui/src/locale/zh-cn.d.ts +5 -0
  91. package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
  92. package/@ones-editor/ui/src/providers/align.d.ts +11 -0
  93. package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
  94. package/@ones-editor/ui/src/providers/clipboard-provider.d.ts +19 -0
  95. package/@ones-editor/ui/src/providers/color-provider.d.ts +18 -0
  96. package/@ones-editor/ui/src/providers/edit-link-provider.d.ts +6 -0
  97. package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
  98. package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +10 -0
  99. package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +10 -0
  100. package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
  101. package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
  102. package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
  103. package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
  104. package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
  105. package/@ones-editor/ui/src/providers/link.d.ts +12 -0
  106. package/@ones-editor/ui/src/providers/list.d.ts +13 -0
  107. package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +10 -0
  108. package/@ones-editor/ui/src/providers/paragraph.d.ts +9 -0
  109. package/@ones-editor/ui/src/providers/proxy-provider.d.ts +9 -0
  110. package/@ones-editor/ui/src/providers/quoted.d.ts +10 -0
  111. package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +9 -0
  112. package/@ones-editor/ui/src/providers/text-command-provider.d.ts +16 -0
  113. package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
  114. package/@ones-editor/ui/src/providers/text-script-provider.d.ts +10 -0
  115. package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
  116. package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
  117. package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
  118. package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
  119. package/@ones-editor/ui/src/providers/utils/clipboard.d.ts +6 -0
  120. package/@ones-editor/ui/src/providers/utils/index.d.ts +2 -0
  121. package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +8 -0
  122. package/@ones-editor/ui/src/providers/utils/text-commands.d.ts +3 -0
  123. package/@ones-editor/{text-commands/src → ui/src/providers/utils}/text-styles.d.ts +3 -1
  124. package/@ones-editor/ui/src/quick-menu/index.d.ts +7 -19
  125. package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +8 -0
  126. package/@ones-editor/ui/src/quick-menu/types.d.ts +2 -5
  127. package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +0 -1
  128. package/@ones-editor/ui/src/toolbar/link-commands.d.ts +4 -0
  129. package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
  130. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -0
  131. package/@ones-editor/ui/src/utils/hide-toolbar.d.ts +2 -0
  132. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +2 -1
  133. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +1 -1
  134. package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +7 -1
  135. package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +1 -1
  136. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +3 -2
  137. package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +3 -1
  138. package/@ones-editor/ui-base/src/command-bar/init-toolbar-item.d.ts +1 -0
  139. package/@ones-editor/ui-base/src/command-bar/types.d.ts +4 -1
  140. package/@ones-editor/ui-base/src/icons/index.d.ts +5 -1
  141. package/@ones-editor/ui-base/src/index.d.ts +2 -0
  142. package/@ones-editor/ui-base/src/input/create-input.d.ts +23 -3
  143. package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
  144. package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +1 -0
  145. package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
  146. package/@ones-editor/ui-base/src/mobile-command-bar/init-menu-item.d.ts +3 -0
  147. package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +23 -0
  148. package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
  149. package/@ones-editor/{ui → ui-base}/src/text-button/index.d.ts +1 -1
  150. package/dist/auto-new-line.d.ts +7 -0
  151. package/dist/index.d.ts +7 -4
  152. package/dist/index.js +16894 -13833
  153. package/dist/types.d.ts +3 -1
  154. package/package.json +1 -1
  155. package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
  156. package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
  157. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
  158. package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
  159. package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
  160. package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -24
  161. package/@ones-editor/text-commands/src/text-commands.d.ts +0 -4
  162. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
  163. package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
  164. package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
  165. package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
  166. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -9
  167. package/@ones-editor/ui/src/toolbar/commands/align.d.ts +0 -10
  168. package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
  169. package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
  170. package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
  171. /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { CommandItem, BlockOptions, OnesEditor, BlockElement } from '../../../../@ones-editor/core';
1
+ import { CommandItem, BlockOptions, OnesEditor, BlockElement, SelectionRange } from '../../../../@ones-editor/core';
2
2
  export interface QuickMenuItem extends CommandItem {
3
3
  itemType: 'insert-block';
4
4
  blockType?: string;
@@ -26,11 +26,8 @@ export interface QuickMenuCommandBetween extends QuickMenuCommandParams {
26
26
  export interface QuickMenuCommandProvider {
27
27
  getCommands: (editor: OnesEditor, params: QuickMenuCommandParams) => CommandItem[];
28
28
  executeCommand: (editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween | AddMenuCommand) => Promise<BlockElement | null>;
29
+ filterCommands?: (editor: OnesEditor, items: CommandItem[], range: SelectionRange) => CommandItem[];
29
30
  }
30
- export interface QuickMenuItemFilter {
31
- filter: (editor: OnesEditor, items: QuickMenuItem[], from: QuickMenuCommandParams['from']) => QuickMenuItem[];
32
- }
33
- export type QuickMenuItemFilterId = keyof any;
34
31
  export interface QuickMenuOptions {
35
32
  id?: string;
36
33
  trigger: string[];
@@ -26,5 +26,4 @@ export declare class ReadonlyToolbar implements OnesEditorCustom {
26
26
  private handleHoveringBlockChildChange;
27
27
  groupCommands: (allCommands: CommandItem[]) => CommandItem[];
28
28
  showTextToolbar(reason: string): void;
29
- showObjectToolbar(event: MouseEvent | null): void;
30
29
  }
@@ -1,6 +1,10 @@
1
1
  import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
2
+ import { EditLinkProvider } from '../providers/edit-link-provider';
3
+ import ClipboardProvider from '../providers/clipboard-provider';
2
4
  export declare class LinkCommands implements OnesEditorBlockHook {
3
5
  private editor;
6
+ provider: EditLinkProvider;
7
+ clipboardProvider: ClipboardProvider;
4
8
  constructor(editor: OnesEditor);
5
9
  commands(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
6
10
  executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
@@ -1,2 +1,2 @@
1
- import { BlockCommandItem, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
2
- export declare function getTextCommands(editor: OnesEditor, blockCommands: BlockCommandItem[]): CommandItem[];
1
+ import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare function getTextCommands(editor: OnesEditor, blockCommands: CommandItem[]): CommandItem[];
@@ -29,6 +29,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
29
29
  unbindEvents(): void;
30
30
  handleDocumentMouseDown: (event: MouseEvent) => void;
31
31
  handleDocumentMouseUp: () => void;
32
+ isHoveringBlockContent(block: BlockElement): boolean;
32
33
  private handleHoveringBlockChildChange;
33
34
  handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
34
35
  updateItems(updater: (items: CommandItem[]) => CommandItem[]): void;
@@ -0,0 +1,2 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare const hideToolbar: (editor: OnesEditor) => void;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="lodash" />
2
2
  import { CommandItem } from '../../../../@ones-editor/core';
3
3
  import { AbstractCommandBar, ManualMenu } from '../command-bar';
4
+ import { MobileBottomMenu } from '../mobile-command-bar/mobile-bottom-menu';
4
5
  export interface AutoSuggestMenuOptions {
5
6
  id: string;
6
7
  showLoading?: boolean;
@@ -21,7 +22,7 @@ export interface AutoSuggestMenuOptions {
21
22
  }
22
23
  export default class AutoSuggestMenu {
23
24
  protected options: AutoSuggestMenuOptions;
24
- menu: ManualMenu;
25
+ menu: ManualMenu | MobileBottomMenu;
25
26
  private currentText;
26
27
  handleSearchText: (text: string) => void;
27
28
  constructor(options: AutoSuggestMenuOptions);
@@ -43,7 +43,7 @@ declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
43
43
  handleUpdateCompositionText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, end: boolean): boolean;
44
44
  handleSelectionChanged: (editor: OnesEditor) => void;
45
45
  private resetItems;
46
- private deleteTrigger;
46
+ deleteTrigger: () => boolean;
47
47
  private onClose;
48
48
  private onShow;
49
49
  private onClickItem;
@@ -2,19 +2,25 @@ import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
3
  import { ColorPaletteItem } from '../color-palette';
4
4
  import { ColorPaletteEvents } from '../color-palette/color-palette';
5
+ import './text-color-item.scss';
5
6
  export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> implements CommandItem {
6
7
  editor: OnesEditor;
8
+ private storageName;
7
9
  id: string;
8
10
  name: string;
9
11
  dropdown: boolean;
12
+ dropSplit: boolean;
13
+ splitTooltip: string;
10
14
  manualShowChildren: boolean;
15
+ childrenType: "mobile-bottom-menu" | undefined;
11
16
  children: CommandItem[];
12
17
  element: HTMLButtonElement;
13
18
  colorPaletteItem: ColorPaletteItem;
14
19
  latestColors: [number | null, number | null];
15
- constructor(editor: OnesEditor);
20
+ constructor(editor: OnesEditor, storageName?: string);
16
21
  destroy(): void;
17
22
  handlePaletteClick: (type: 'color' | 'backgroundColor' | 'clearColor', value: number) => void;
23
+ handleButtonClick: (event: MouseEvent) => void;
18
24
  setLatestColors: (type: 'color' | 'backgroundColor' | 'clearColor', value: number) => void;
19
25
  beforePopup: () => void;
20
26
  updatePaletteColor(colors: [number | null, number | null]): void;
@@ -14,5 +14,5 @@ export default class ColorPalette extends TypedEmitter<ColorPaletteEvents> {
14
14
  constructor(options?: ColorPaletteOptions);
15
15
  destroy(): void;
16
16
  setColor(type: ColorType, value: number | null): void;
17
- handleClick: (event: MouseEvent) => void;
17
+ handleClick: (event: MouseEvent | PointerEvent) => void;
18
18
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  import { TypedEmitter } from 'tiny-typed-emitter';
2
3
  import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
3
4
  import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
@@ -29,13 +30,13 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
29
30
  private getSelectedItemIndex;
30
31
  private getPrevItemIndex;
31
32
  private getNextItemIndex;
32
- protected clearSelectedItem(): void;
33
+ protected clearSelectedItem: import("lodash").DebouncedFunc<() => void>;
33
34
  selectItem(id: string, from?: SelectItemFrom): void;
34
35
  private lastEnterPauseTime;
35
36
  private startPauseMouseEnter;
36
37
  private handleItemMouseEnter;
37
38
  private handleItemMouseLeave;
38
- protected handleItemClick: (event: MouseEvent) => void;
39
+ protected handleItemClick: (event: MouseEvent | TouchEvent) => void;
39
40
  private showSubCommandBar;
40
41
  isInCommandBar(target: EventTarget | null): boolean;
41
42
  createCommandItem(item: CommandItem): CommandItemElement;
@@ -1,11 +1,13 @@
1
1
  import { CommandItem } from '../../../../@ones-editor/core';
2
2
  import CommandBar from './command-bar';
3
- import { CommandBarOptions, CommandItemElement } from './types';
3
+ import { AbstractManualCommandBar, CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from './types';
4
4
  export default class FixedToolbar extends CommandBar {
5
5
  constructor(parent: HTMLElement, items: CommandItem[], options?: CommandBarOptions);
6
6
  protected initCommandBarElement(elem: HTMLElement): void;
7
7
  protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
8
8
  close(): void;
9
+ onShown: (instance: AbstractManualCommandBar) => void;
10
+ getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
9
11
  destroy(): void;
10
12
  protected getCommandBarRoot(): HTMLElement | null;
11
13
  get isVisible(): boolean;
@@ -2,5 +2,6 @@ import { CommandItem } from '../../../../@ones-editor/core';
2
2
  import { CommandItemElement } from './types';
3
3
  export type InitToolbarItemOptions = {
4
4
  tooltipId?: string;
5
+ showName?: boolean;
5
6
  };
6
7
  export declare function initToolbarItem(item: CommandItem, elem: CommandItemElement, options: InitToolbarItemOptions): void;
@@ -19,6 +19,7 @@ export interface ManualShowCommandBarOptions {
19
19
  getReferenceClientRect?: GetReferenceClientRect | null | undefined;
20
20
  offset?: [number, number];
21
21
  arrow?: boolean;
22
+ onShown?(instance: AbstractManualCommandBar): void;
22
23
  }
23
24
  export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
24
25
  readonly isVisible: boolean;
@@ -28,6 +29,7 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
28
29
  isInCommandBar: (target: EventTarget | null) => boolean;
29
30
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
30
31
  getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
32
+ updateItems: (items: CommandItem[]) => void;
31
33
  }
32
34
  export interface ShowCommandBarOptions {
33
35
  placement?: Placement;
@@ -61,7 +63,8 @@ export interface CommandBarOptions {
61
63
  header?: HTMLElement | (() => HTMLElement | null);
62
64
  footer?: HTMLElement | (() => HTMLElement | null);
63
65
  padding?: number;
64
- beforeClose?: (event?: MouseEvent) => boolean;
66
+ beforeClose?: (event?: MouseEvent | TouchEvent) => boolean;
67
+ showName?: boolean;
65
68
  }
66
69
  export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
67
70
  export type PopoverOptions = {
@@ -120,4 +120,8 @@ import SymbolIcon from './symbol.svg?raw';
120
120
  import TreeIcon from './tree.svg?raw';
121
121
  import TimeIcon from './time.svg?raw';
122
122
  import SearchIcon from './search.svg?raw';
123
- export { DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, };
123
+ import TextGroupIcon from './text-group.svg?raw';
124
+ import TabIcon from './tab.svg?raw';
125
+ import ShiftTabIcon from './shift-tab.svg?raw';
126
+ import TableEditIcon from './table-edit.svg?raw';
127
+ export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, };
@@ -15,4 +15,6 @@ export * from './input/create-input';
15
15
  export * from './auto-suggest';
16
16
  export * from './item-shortcuts';
17
17
  export * from './emoji-item';
18
+ export * from './mobile-command-bar/mobile-bottom-menu';
19
+ export * from './text-button';
18
20
  export { tippy, };
@@ -1,5 +1,5 @@
1
1
  import './input.scss';
2
- export declare function createInput(parent: HTMLElement, options: {
2
+ export type EditorInputOptions = {
3
3
  label?: string;
4
4
  placeholder?: string;
5
5
  required?: boolean;
@@ -9,9 +9,29 @@ export declare function createInput(parent: HTMLElement, options: {
9
9
  onKeyDown?: (e: KeyboardEvent, composing: boolean) => void;
10
10
  maxLength?: number;
11
11
  prefix?: Element;
12
- }): {
12
+ suffixClose?: boolean;
13
+ };
14
+ declare class EditorInput {
15
+ private parent;
16
+ private options;
17
+ private unbindKeyDownEvent;
18
+ constructor(parent: HTMLElement, options: EditorInputOptions);
19
+ private container;
20
+ private get errorContent();
21
+ private get input();
22
+ private get suffix();
23
+ private get prefix();
13
24
  getField: () => HTMLInputElement;
14
25
  getInputValue: () => string;
15
26
  setFieldError: (error: string) => void;
16
27
  focus: () => void;
17
- };
28
+ handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
29
+ showSuffix: () => void;
30
+ hideSuffix: () => void;
31
+ handleInput: (e: Event) => void;
32
+ handleClose: (e: Event | TouchEvent) => void;
33
+ init(): HTMLDivElement;
34
+ destroy(): void;
35
+ }
36
+ export declare function createInput(parent: HTMLElement, options: EditorInputOptions): EditorInput;
37
+ export {};
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  name: string;
5
5
  backgroundDesc: string;
6
6
  reset: string;
7
+ more: string;
7
8
  };
8
9
  emojiPalette: {
9
10
  name: string;
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  name: string;
5
5
  backgroundDesc: string;
6
6
  reset: string;
7
+ more: string;
7
8
  };
8
9
  emojiPalette: {
9
10
  name: string;
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  name: string;
5
5
  backgroundDesc: string;
6
6
  reset: string;
7
+ more: string;
7
8
  };
8
9
  emojiPalette: {
9
10
  name: string;
@@ -0,0 +1,3 @@
1
+ import { CommandItem } from '../../../../@ones-editor/core';
2
+ import { CommandItemElement } from '../command-bar';
3
+ export declare function initMenuItem(item: CommandItem, elem: CommandItemElement): void;
@@ -0,0 +1,23 @@
1
+ import { Closeable, CloseReason, CommandItem } from '../../../../@ones-editor/core';
2
+ import { Instance } from 'tippy.js';
3
+ import './mobile-bottom-menu.scss';
4
+ import { AbstractManualCommandBar, CommandBar, CommandBarContentElement, CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from '../command-bar';
5
+ declare class MobileBottomMenu extends CommandBar implements AbstractManualCommandBar {
6
+ tippyInstance: Instance | null;
7
+ constructor(items: CommandItem[], closeable?: Closeable, options?: CommandBarOptions);
8
+ createContentWithHeader: () => HTMLDivElement;
9
+ handleClose: () => void;
10
+ oldActiveElement: HTMLElement | null;
11
+ handleShown: () => void;
12
+ manualShow: (target: HTMLElement, options?: ManualShowCommandBarOptions) => void;
13
+ close(reason: CloseReason): void;
14
+ destroy(): void;
15
+ get isVisible(): boolean;
16
+ get popper(): Element | null;
17
+ getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
18
+ protected initCommandBarElement(elem: CommandBarContentElement): void;
19
+ protected getCommandBarRoot(): HTMLElement | null;
20
+ protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
21
+ }
22
+ declare function createMobileBottomMenu(): void;
23
+ export { createMobileBottomMenu, MobileBottomMenu, };
@@ -3,7 +3,7 @@ import ManualCommandBar from '../command-bar/manual-command-bar';
3
3
  import { CommandBarContentElement, CommandItemElement } from '../command-bar/types';
4
4
  export type PopupOptions = {
5
5
  id?: string;
6
- beforeClose?: (event?: MouseEvent) => boolean;
6
+ beforeClose?: (event?: MouseEvent | TouchEvent) => boolean;
7
7
  };
8
8
  export default class Popup extends ManualCommandBar {
9
9
  constructor(content: HTMLElement, options?: PopupOptions);
@@ -1,3 +1,3 @@
1
- import type { ButtonOptions } from '../../../../@ones-editor/ui-base';
1
+ import { ButtonOptions } from '../components';
2
2
  import './index.scss';
3
3
  export declare function createTextButton(parent: HTMLElement, ...args: ButtonOptions): HTMLButtonElement;
@@ -0,0 +1,7 @@
1
+ import { OnesEditor, OnesEditorCustom } from '../@ones-editor/core';
2
+ export default class AutoNewLine implements OnesEditorCustom {
3
+ private editor;
4
+ constructor(editor: OnesEditor);
5
+ destroy(): void;
6
+ handleClick: (e: MouseEvent) => void;
7
+ }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,9 @@ import { CodeTextDecorator } from '../@ones-editor/code-block';
5
5
  import * as OnesEditorIcons from '../@ones-editor/ui-base/src/icons';
6
6
  import { BlockExclusiveHook } from '../@ones-editor/exclusive-block';
7
7
  import { OnesEditorVersionsDialog, VersionDialogOptions } from '../@ones-editor/versions';
8
+ import { CalloutQuickMenuItemFilter } from '../@ones-editor/callout-block';
9
+ import { MobileCommandHandler } from '../@ones-editor/mobile-helper';
10
+ import { LayoutQuickMenuItemFilter, isLayoutBlock } from '../@ones-editor/layout-block';
8
11
  import ShareDBDocVersionsProvider from './versions/versions-provider';
9
12
  import { CreateLocalEditorOptions, CreateOnesEditorOptions } from './types';
10
13
  import './lang';
@@ -24,10 +27,10 @@ export * from '../@ones-editor/layout-block';
24
27
  export * from '../@ones-editor/markdown-to-doc';
25
28
  export * from '../@ones-editor/html-to-doc';
26
29
  export * from '../@ones-editor/main-toolbar';
27
- export { Popup, ManualMenu, OnesEditorAutoSuggest, tippy, ManualToolbar, ManualCloseDialog, TextColorItem, shouldFocusToEditor, } from '../@ones-editor/ui-base';
30
+ export { Popup, ManualMenu, OnesEditorAutoSuggest, tippy, ManualToolbar, ManualCloseDialog, TextColorItem, shouldFocusToEditor, FixedToolbar, } from '../@ones-editor/ui-base';
28
31
  export * from '../@ones-editor/drawio-embed';
29
32
  export * from '../@ones-editor/block-resizer';
30
- export { editorAddComment } from '../@ones-editor/comments';
33
+ export { editorAddComment, CommentsCommandProvider } from '../@ones-editor/comments';
31
34
  export { editorShowFindDialog } from '../@ones-editor/find-dialog';
32
35
  export * from '../@ones-editor/toc';
33
36
  export * from '../@ones-editor/embed-block-helper';
@@ -36,7 +39,7 @@ export { resetListStart, getListAllNextBrothers, toMindmap, Mindmap } from '../@
36
39
  export * from '../@ones-editor/exclusive-block';
37
40
  export * from '../@ones-editor/templates';
38
41
  export * from 'tiny-typed-emitter';
39
- export { ShareDBDocVersionsProvider, OnesEditorIcons };
42
+ export { ShareDBDocVersionsProvider, OnesEditorIcons, isLayoutBlock, LayoutQuickMenuItemFilter, CalloutQuickMenuItemFilter, MobileCommandHandler };
40
43
  export type { FileBoxData, FileEmbedData } from '../@ones-editor/file';
41
44
  export { type DocListBlock } from '../@ones-editor/list-block';
42
45
  export declare function getDefaultOnesEditorOptions(options: CreateOnesEditorOptions): {
@@ -66,7 +69,7 @@ export declare function getDefaultOnesEditorOptions(options: CreateOnesEditorOpt
66
69
  mention?: import("@ones-editor/mention").MentionOptions | undefined;
67
70
  comment?: import("@ones-editor/comments").OnesEditorCommentOptions | undefined;
68
71
  list?: import("@ones-editor/list-block").ListOptions | undefined;
69
- quickMenu?: import("@ones-editor/ui/src/quick-menu").QuickMenuOptions | undefined;
72
+ quickMenu?: import("@ones-editor/ui").QuickMenuOptions | undefined;
70
73
  templates?: import("@ones-editor/templates").TemplateOptions | undefined;
71
74
  custom?: Record<string, unknown> | undefined;
72
75
  popover?: import("@ones-editor/ui-base").PopoverOptions | undefined;