@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
@@ -0,0 +1,10 @@
1
+ import { CommandItemWithSource, OnesEditor, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { AbstractProvider } from '../providers/abstract-providers';
3
+ export declare class BlockCommandProviders extends AbstractProvider implements OnesEditorCommandProviders {
4
+ protected editor: OnesEditor;
5
+ id: string;
6
+ constructor(editor: OnesEditor, afterCommandCallback: () => void);
7
+ getCommands(range: SelectionRange): CommandItemWithSource[];
8
+ executeCommand: (range: SelectionRange, item: CommandItemWithSource) => {};
9
+ getEmptyBlockTextAttributes: () => undefined;
10
+ }
@@ -1,11 +1,13 @@
1
- import { BlockElement, OnesEditor, CommandItem } from '../../../../@ones-editor/core';
1
+ import { BlockElement, OnesEditor, CommandFilterId, CommandFilter, CommandItem } from '../../../../@ones-editor/core';
2
2
  import type { ManualShowCommandBarOptions } from '../../../../@ones-editor/ui-base';
3
3
  export default class BlockMenu {
4
4
  private editor;
5
5
  private menu;
6
6
  currentBlock: BlockElement | null;
7
7
  private commandBlock;
8
+ private blockCommandProviders;
8
9
  constructor(editor: OnesEditor);
10
+ addFilter(id: CommandFilterId, filter: CommandFilter): void;
9
11
  show(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
10
12
  isInMenu(eventTarget: EventTarget | null): boolean;
11
13
  handleShow: () => void;
@@ -1,18 +1,18 @@
1
1
  import './style.scss';
2
2
  import OnesEditorToolbar from './toolbar/toolbar-handler';
3
- import OnesEditorQuickMenu, { getAllQuickMenuItems, getHeadingMenuOptions, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, BasicCommands, GetAllQuickMenuItemsOptions, QuickMenuCommandParams, AddMenuCommand } from './quick-menu';
3
+ import { QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, QuickMenuCommandParams, AddMenuCommand, QuickMenuItem, QuickMenuOptions } from './quick-menu/types';
4
+ import OnesEditorQuickMenu from './quick-menu';
5
+ import * as BasicCommands from './providers/utils/basic-commands';
4
6
  import OnesEditorTooltip from './tooltips';
5
7
  import TextStyleShortcuts from './shortcuts';
6
8
  import { editLink } from './link-popup';
7
9
  import { getToolbar } from './toolbar/helper';
8
- import { GroupOrder } from './quick-menu/order';
9
10
  import { getReferenceClientRect } from './toolbar/get-reference-client-rect';
10
11
  import { isSelectBoxOnly } from './toolbar/box-only';
11
- import { InlineBoxCommandProvider } from './quick-menu/inline-box-items';
12
12
  import './locale';
13
13
  import type { OnesEditorToolbarBase } from './toolbar/types';
14
- import type { QuickMenuItem } from './quick-menu';
15
- export type { QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase };
16
- export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, isSelectBoxOnly, InlineBoxCommandProvider, getReferenceClientRect, };
14
+ import { BlockCommandProviders } from './block-menu/block-command-providers';
15
+ import BlockMenu from './block-menu';
16
+ export type { QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, OnesEditorToolbarBase, QuickMenuItem, QuickMenuOptions, };
17
+ export { BlockMenu, BlockCommandProviders, OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, editLink, TextStyleShortcuts, getToolbar, BasicCommands, isSelectBoxOnly, getReferenceClientRect, };
17
18
  export { createTextButton } from './text-button';
18
- export { mergeCommands } from './toolbar/merge-commands';
@@ -0,0 +1,19 @@
1
+ import { CommandFilter, CommandFilterId, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
2
+ import AttributeMap from 'quill-delta/dist/AttributeMap';
3
+ export declare abstract class AbstractProvider implements OnesEditorCommandProviders {
4
+ protected editor: OnesEditor;
5
+ abstract id: string;
6
+ commandProviders: OnesEditorCommandProvider[];
7
+ commandFilters: Map<string | number | symbol, CommandFilter>;
8
+ constructor(editor: OnesEditor);
9
+ abstract getCommands(range: SelectionRange): CommandItemWithSource[];
10
+ abstract executeCommand(range: SelectionRange, item: CommandItemWithSource, params: CommandParams): {
11
+ [index: string]: CommandResult;
12
+ };
13
+ abstract getEmptyBlockTextAttributes(editor: OnesEditor, blockId: string): AttributeMap | undefined;
14
+ addFilter(id: CommandFilterId, filter: CommandFilter): void;
15
+ registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
16
+ getCommandProviders: () => OnesEditorCommandProvider[];
17
+ getCommandProvider: (id: string) => OnesEditorCommandProvider;
18
+ filterItems: (range: SelectionRange, items: CommandItemWithSource[]) => CommandItemWithSource[];
19
+ }
@@ -0,0 +1,10 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class AlignDropdownProvider extends ProxyProvider implements OnesEditorCommandProvider {
4
+ private editor;
5
+ id: string;
6
+ groupIndex: number;
7
+ constructor(editor: OnesEditor);
8
+ getInsertCommands: () => never[];
9
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
10
+ }
@@ -1,10 +1,10 @@
1
- import { BlockCommandItem, BlockElement, DocBlock, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
1
+ import { BlockElement, CommandItem, DocBlock, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
2
  export default class AlignProvider implements OnesEditorCommandProvider {
3
3
  private editor;
4
4
  id: string;
5
5
  constructor(editor: OnesEditor);
6
- applyAlignStyle(editor: OnesEditor, block: BlockElement, align: string): void;
7
6
  isChecked(blockData: DocBlock, id: string): boolean;
8
- getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
9
- executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: BlockCommandItem): boolean;
7
+ getAvailableCommands(editor: OnesEditor, block: BlockElement): CommandItem[];
8
+ getInsertCommands: () => never[];
9
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
10
10
  }
@@ -0,0 +1,16 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ interface CommandWithExecute {
3
+ command: CommandItem;
4
+ executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => unknown;
5
+ }
6
+ export declare class BlockHookProvider implements OnesEditorCommandProvider {
7
+ private editor;
8
+ id: string;
9
+ constructor(editor: OnesEditor);
10
+ commands: CommandWithExecute[];
11
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement) => CommandItem[];
12
+ getInsertCommands: () => CommandItem[];
13
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
14
+ executeInsertCommand: () => boolean;
15
+ }
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export default class HeadingProvider implements OnesEditorCommandProvider {
3
+ private editor;
4
+ private withPlainText;
5
+ id: string;
6
+ constructor(editor: OnesEditor, withPlainText?: boolean);
7
+ getHeadingIndex(): number;
8
+ createHeadingCommandItem(heading: number): CommandItem[];
9
+ getAvailableCommands(editor: OnesEditor, block: BlockElement): CommandItem[];
10
+ getInsertCommands(): CommandItem[];
11
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, command: CommandItem) => boolean;
12
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { BlockElement, CommandItem, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class InsertAboveProvider extends ProxyProvider {
4
+ private editor;
5
+ id: string;
6
+ constructor(editor: OnesEditor);
7
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement) => CommandItem[];
8
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem, params: CommandParams) => boolean;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { BlockElement, CommandItem, CommandParams, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class InsertAfterProvider extends ProxyProvider {
4
+ private editor;
5
+ id: string;
6
+ constructor(editor: OnesEditor);
7
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement) => CommandItem[];
8
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem, params: CommandParams) => boolean;
9
+ }
@@ -0,0 +1,12 @@
1
+ import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export declare class InlineBoxCommandProvider extends ProxyProvider implements OnesEditorCommandProvider {
4
+ private editor;
5
+ id: string;
6
+ constructor(editor: OnesEditor);
7
+ create(commands: CommandItem[]): CommandItem[];
8
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
9
+ getInsertCommands: (editor: OnesEditor, containerId: string, blockIndex: number) => CommandItem[];
10
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean;
11
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem, params: CommandParams) => boolean;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class InsertGroupProvider extends ProxyProvider {
4
+ private editor;
5
+ id: string;
6
+ constructor(editor: OnesEditor);
7
+ }
@@ -0,0 +1,16 @@
1
+ import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ import { QuickMenuCommandProvider } from '../quick-menu/types';
4
+ export default class InsertMenuProvider extends ProxyProvider {
5
+ private editor;
6
+ private withPlainText;
7
+ id: string;
8
+ providersMap: Map<string, OnesEditorCommandProvider>;
9
+ providers: OnesEditorCommandProvider[];
10
+ quickProviders: QuickMenuCommandProvider[];
11
+ constructor(editor: OnesEditor, withPlainText?: boolean);
12
+ getInsertCommands: (editor: OnesEditor, containerId: string, blockIndex: number) => CommandItem[];
13
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
14
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem, params: CommandParams) => boolean;
15
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean;
16
+ }
@@ -0,0 +1,17 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export declare class LinkProvider implements OnesEditorCommandProvider {
3
+ private editor;
4
+ id: string;
5
+ constructor(editor: OnesEditor);
6
+ create(): {
7
+ id: string;
8
+ name: string;
9
+ icon: string;
10
+ order: number;
11
+ subText: string;
12
+ }[];
13
+ getAvailableCommands: () => CommandItem[];
14
+ getInsertCommands: () => CommandItem[];
15
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem) => boolean;
16
+ executeInsertCommand(editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem): boolean;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export default class ListProvider implements OnesEditorCommandProvider {
3
+ private editor;
4
+ id: string;
5
+ constructor(editor: OnesEditor);
6
+ createListCommandItem(block?: BlockElement): CommandItem[];
7
+ getAvailableCommands(editor: OnesEditor, block: BlockElement): CommandItem[];
8
+ getInsertCommands(): CommandItem[];
9
+ convertToList(editor: OnesEditor, block: BlockElement, listType: 'unordered' | 'ordered' | 'unchecked'): void;
10
+ insertList(editor: OnesEditor, containerId: string, blockIndex: number, listType: 'unordered' | 'ordered' | 'unchecked'): void;
11
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
12
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, command: CommandItem) => boolean;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { OnesEditor, OnesEditorCommandProvider } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class ParagraphProvider extends ProxyProvider implements OnesEditorCommandProvider {
4
+ private editor;
5
+ id: string;
6
+ groupIndex: number;
7
+ constructor(editor: OnesEditor);
8
+ }
@@ -0,0 +1,9 @@
1
+ import { BlockElement, CommandItem, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export declare abstract class ProxyProvider implements OnesEditorCommandProvider {
3
+ abstract id: string;
4
+ providers: OnesEditorCommandProvider[];
5
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
6
+ getInsertCommands: (editor: OnesEditor, containerId: string, blockIndex: number) => CommandItem[];
7
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem, params: CommandParams, result?: CommandResult): boolean;
8
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem, params: CommandParams, result?: CommandResult) => boolean;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export default class QuotedProvider implements OnesEditorCommandProvider {
3
+ private editor;
4
+ id: string;
5
+ constructor(editor: OnesEditor);
6
+ getAvailableCommands(editor: OnesEditor, block: BlockElement): CommandItem[];
7
+ getInsertCommands(): CommandItem[];
8
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
9
+ executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, command: CommandItem) => boolean;
10
+ }
@@ -0,0 +1,16 @@
1
+ import { BlockElement, CommandItem, OnesEditor, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class TextStylesFixedProvider extends ProxyProvider {
4
+ private editor;
5
+ private afterCommandCallback;
6
+ id: string;
7
+ constructor(editor: OnesEditor, afterCommandCallback: () => void);
8
+ commands: CommandItem[];
9
+ block: BlockElement | null;
10
+ range: SelectionRange | null;
11
+ handleClick: (editor: OnesEditor, event: Event) => void;
12
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
13
+ getInsertCommands: () => never[];
14
+ executeCommand: () => boolean;
15
+ executeInsertCommand: () => boolean;
16
+ }
@@ -0,0 +1,9 @@
1
+ import { OnesEditor, OnesEditorCommandProvider } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class TextStylesProvider extends ProxyProvider {
4
+ private editor;
5
+ private withPlainText;
6
+ id: string;
7
+ providers: OnesEditorCommandProvider[];
8
+ constructor(editor: OnesEditor, withPlainText?: boolean);
9
+ }
@@ -0,0 +1,9 @@
1
+ import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { ProxyProvider } from './proxy-provider';
3
+ export default class BlockTurnIntoCommandProvider extends ProxyProvider implements OnesEditorCommandProvider {
4
+ private editor;
5
+ id: string;
6
+ groupIndex: number;
7
+ constructor(editor: OnesEditor);
8
+ getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
9
+ }
@@ -0,0 +1,2 @@
1
+ import { CommandItem } from '../../../../../@ones-editor/core';
2
+ export declare const addSection: (items: CommandItem[]) => CommandItem[];
@@ -1,5 +1,4 @@
1
- import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
1
+ import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
2
2
  export declare function applyHeadingStyle(editor: OnesEditor, block: BlockElement, heading: number | null): void;
3
3
  export declare function applyAlignStyle(editor: OnesEditor, block: BlockElement, align: string): void;
4
4
  export declare function applyQuoteStyle(editor: OnesEditor, block: BlockElement): void;
5
- export declare function applyList(editor: OnesEditor, block: BlockElement, id: 'unordered-list' | 'ordered-list' | 'check-list'): void;
@@ -0,0 +1,5 @@
1
+ import { BlockOptions, CommandItem } from '../../../../../@ones-editor/core';
2
+ export interface QuickMenuItem extends CommandItem {
3
+ blockOptions?: BlockOptions;
4
+ }
5
+ export declare const injectBlockOptions: (commands: QuickMenuItem[], blockOptions: BlockOptions) => void;
@@ -1,26 +1,21 @@
1
- import { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
1
+ import { OnesEditor, CommandItem, CommandFilterId, CommandFilter } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
3
- import { QuickMenuItem, QuickMenuOptions } from './types';
4
- import { getHeadingMenuOptions } from './basic-menu-items';
5
- import * as BasicCommands from './basic-commands';
6
- export * from './types';
7
- export * from './quick-menu-items';
8
- export { getHeadingMenuOptions, BasicCommands };
3
+ import { QuickMenuOptions } from './types';
9
4
  export default class OnesEditorQuickMenu {
10
5
  protected editor: OnesEditor;
11
6
  private options;
12
7
  protected suggest: OnesEditorAutoSuggest;
13
8
  private items;
14
- private maxHeading;
15
9
  private firstEmptyOffset;
10
+ private quickCommandProviders;
16
11
  constructor(editor: OnesEditor, options?: QuickMenuOptions);
17
12
  get menu(): import("@ones-editor/ui-base").ManualMenu;
13
+ addFilter(id: CommandFilterId, filter: CommandFilter): void;
18
14
  destroy(): void;
19
- queryItems: (suggest: unknown, text: string) => Promise<QuickMenuItem[]>;
15
+ queryItems: (suggest: unknown, text: string) => Promise<CommandItem[]>;
20
16
  onClose: () => void;
21
17
  onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
22
18
  onClickItem: (suggest: unknown, item: CommandItem) => void;
23
19
  private initMenuItems;
24
- private refreshMenuItems;
25
20
  private handleEmptySearch;
26
21
  }
@@ -0,0 +1,10 @@
1
+ import { CommandItemWithSource, OnesEditor, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
2
+ import { AbstractProvider } from '../providers/abstract-providers';
3
+ export declare class QuickCommandProviders extends AbstractProvider implements OnesEditorCommandProviders {
4
+ protected editor: OnesEditor;
5
+ id: string;
6
+ constructor(editor: OnesEditor);
7
+ getCommands(range: SelectionRange): CommandItemWithSource[];
8
+ executeCommand: (range: SelectionRange, item: CommandItemWithSource) => {};
9
+ getEmptyBlockTextAttributes: () => undefined;
10
+ }
@@ -1,6 +1,7 @@
1
1
  import { CommandItem, BlockOptions, OnesEditor, BlockElement } from '../../../../@ones-editor/core';
2
2
  export interface QuickMenuItem extends CommandItem {
3
3
  itemType: 'insert-block';
4
+ blockType?: string;
4
5
  blockOptions?: BlockOptions;
5
6
  commandProvider?: QuickMenuCommandProvider;
6
7
  }
@@ -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[];
@@ -30,6 +30,8 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
30
30
  handleDocumentMouseUp: () => void;
31
31
  private handleHoveringBlockChildChange;
32
32
  handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
33
+ updateItems(updater: (items: CommandItem[]) => CommandItem[]): void;
34
+ updateItemStates(id: CommandItem['id'], states: Required<CommandItem>['states']): void;
33
35
  update(reason: ShowToolbarReason): void;
34
36
  private showTextToolbar;
35
37
  private showObjectToolbar;
@@ -3,8 +3,9 @@ import type { ColorPaletteOptions } from './create-palette';
3
3
  import './palette.scss';
4
4
  export { ColorPaletteOptions };
5
5
  export type ColorType = 'color' | 'backgroundColor';
6
+ export type PaletteClickHandler = (type: ColorType | 'clearColor', value: number) => void;
6
7
  export interface ColorPaletteEvents {
7
- onClick: (type: ColorType | 'clearColor', value: number) => void;
8
+ onClick: PaletteClickHandler;
8
9
  beforePopup: () => void;
9
10
  }
10
11
  export default class ColorPalette extends TypedEmitter<ColorPaletteEvents> {
@@ -1,7 +1,15 @@
1
+ type DefaultPaletteCreator<T> = (count: number, rows: number, fun: ColorButtonCreator, containerClass: T) => HTMLElement;
2
+ type CustomPaletteCreator<T extends 'color' | 'background-color'> = (defaultPaletteCreator: DefaultPaletteCreator<T>) => HTMLElement;
1
3
  export interface ColorPaletteOptions {
2
4
  color?: boolean;
3
5
  backgroundColor?: boolean;
4
6
  clearColorButton?: boolean;
7
+ defaultColor?: number;
8
+ defaultBgColor?: number;
9
+ customColorPalette?: CustomPaletteCreator<'color'>;
10
+ customBgColorPalette?: CustomPaletteCreator<'background-color'>;
5
11
  }
12
+ type ColorButtonCreator = (index: number) => HTMLElement;
6
13
  export declare function createPalette(options: ColorPaletteOptions): HTMLDivElement;
7
14
  export declare function selectPaletteColor(root: HTMLElement, type: 'color' | 'backgroundColor', value: number | null): void;
15
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ColorPaletteOptions } from './color-palette';
1
+ import type { ColorPaletteOptions, PaletteClickHandler } from './color-palette';
2
2
  import ColorPalette from './color-palette';
3
3
  import ColorPaletteItem from './color-palette-item';
4
- export { ColorPalette, ColorPaletteOptions, ColorPaletteItem };
4
+ export { ColorPalette, ColorPaletteOptions, ColorPaletteItem, PaletteClickHandler };
@@ -1,6 +1,6 @@
1
1
  import { TypedEmitter } from 'tiny-typed-emitter';
2
2
  import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
3
- import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions } from './types';
3
+ import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
4
4
  import 'tippy.js/dist/tippy.css';
5
5
  export default abstract class CommandBar extends TypedEmitter<CommandBarEvents> implements AbstractCommandBar {
6
6
  content: HTMLElement;
@@ -30,7 +30,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
30
30
  private getPrevItemIndex;
31
31
  private getNextItemIndex;
32
32
  protected clearSelectedItem(): void;
33
- selectItem(id: string): void;
33
+ selectItem(id: string, from?: SelectItemFrom): void;
34
34
  private lastEnterPauseTime;
35
35
  private startPauseMouseEnter;
36
36
  private handleItemMouseEnter;
@@ -34,6 +34,7 @@ export interface ShowCommandBarOptions {
34
34
  }
35
35
  export interface AbstractManualCommandBar extends AbstractCommandBar {
36
36
  manualShow: (target: HTMLElement, options?: ShowCommandBarOptions) => void;
37
+ popper: Element | null;
37
38
  }
38
39
  export interface AbstractHoveringCommandBar extends AbstractCommandBar {
39
40
  setTarget: (target: HTMLElement, options: ShowCommandBarOptions) => void;
@@ -66,3 +67,4 @@ export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable
66
67
  export type PopoverOptions = {
67
68
  overflowBoundary?: Element;
68
69
  };
70
+ export type SelectItemFrom = 'event' | 'manual';
@@ -0,0 +1,19 @@
1
+ import { Closeable, CommandItem, OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
2
+ import { EmojiPalette } from '../emoji-palette';
3
+ export declare class EmojiItem implements CommandItem, OnesEditorCustom {
4
+ id: string;
5
+ name: string;
6
+ element: HTMLButtonElement;
7
+ dropdown: boolean;
8
+ children: CommandItem[];
9
+ palette: EmojiPalette;
10
+ manualShowChildren: boolean;
11
+ childrenPlacement: "bottom-start";
12
+ childrenMenuId: string;
13
+ closeable: Closeable;
14
+ constructor();
15
+ beforePopup(): void;
16
+ setCloseable(closeable: Closeable): void;
17
+ destroy(): void;
18
+ static get(editor: OnesEditor): EmojiItem;
19
+ }
@@ -0,0 +1,2 @@
1
+ import './index.scss';
2
+ export { EmojiItem } from './emoji-item';
@@ -0,0 +1,21 @@
1
+ import { Emojis } from './emoji-data';
2
+ interface EmojiContentOptions {
3
+ onSelectEmoji: (emoji: string) => void;
4
+ onCategoryReach: (category: string) => void;
5
+ }
6
+ export declare class EmojiContent {
7
+ private parent;
8
+ private options;
9
+ private root;
10
+ private observer;
11
+ constructor(parent: HTMLElement, options: EmojiContentOptions);
12
+ private handleIntersectionObserver;
13
+ private handleRootClick;
14
+ private updateCategoryGroupContent;
15
+ private createCategoryGroup;
16
+ updateFrequentlyUsedContent(emojis: Emojis): void;
17
+ updateContent: (emojis: Emojis) => void;
18
+ scrollToCategory(categoryId: string): void;
19
+ destroy(): void;
20
+ }
21
+ export {};
@@ -0,0 +1,60 @@
1
+ export type Emoji = string;
2
+ export type EmojiCategory = string;
3
+ export type Emojis = EmojiMetaData['emojis'];
4
+ interface EmojiMetaData {
5
+ emojis: Record<EmojiCategory, Emoji[]>;
6
+ keywords: Record<Emoji, string[]>;
7
+ }
8
+ type EmojiEntity = {
9
+ category: EmojiCategory;
10
+ emoji: Emoji;
11
+ keyword: string;
12
+ };
13
+ export declare function getCategoryInfo(category: string): {
14
+ icon: string;
15
+ label: string;
16
+ } | {
17
+ icon: string;
18
+ label: string;
19
+ } | {
20
+ icon: string;
21
+ label: string;
22
+ } | {
23
+ icon: string;
24
+ label: string;
25
+ } | {
26
+ icon: string;
27
+ label: string;
28
+ } | {
29
+ icon: string;
30
+ label: string;
31
+ } | {
32
+ icon: string;
33
+ label: string;
34
+ } | {
35
+ icon: string;
36
+ label: string;
37
+ };
38
+ export declare class EmojiData {
39
+ static metaData: EmojiMetaData | null;
40
+ private emojiEntities;
41
+ private localMetaData;
42
+ constructor();
43
+ get recentlyUsedEmojis(): EmojiMetaData['emojis'];
44
+ get emojis(): {
45
+ [x: string]: string[];
46
+ };
47
+ get categories(): EmojiCategory[];
48
+ static get loaded(): boolean;
49
+ saveEmojiToRecentlyUsed(emoji: Emoji): void;
50
+ filterEmojis(v: string): {
51
+ emojis: {
52
+ [x: string]: string[];
53
+ };
54
+ categories: string[];
55
+ };
56
+ getEmojiEntity(emoji: string): EmojiEntity | null;
57
+ static loadData(): Promise<EmojiMetaData>;
58
+ }
59
+ export declare function isEmptyEmojiData(emojis: Emojis): boolean;
60
+ export {};
@@ -0,0 +1,16 @@
1
+ import { EmojiCategory } from './emoji-data';
2
+ interface EmojiNavigationOptions {
3
+ onSelectCategory: (category: string) => void;
4
+ }
5
+ export declare class EmojiNavigation {
6
+ private parent;
7
+ private options;
8
+ private root;
9
+ constructor(parent: HTMLElement, options: EmojiNavigationOptions);
10
+ private handleRootClick;
11
+ private createCategoryItem;
12
+ updateFrequentlyUsedItem(): void;
13
+ updateContent(categories: EmojiCategory[]): void;
14
+ updateActiveCategory(category: string): void;
15
+ }
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import { createInput } from '../input/create-input';
2
+ interface EmojiSearchOptions {
3
+ onSearch: (value: string) => void;
4
+ }
5
+ export declare class EmojiSearch {
6
+ private parent;
7
+ private options;
8
+ input: ReturnType<typeof createInput>;
9
+ constructor(parent: HTMLElement, options: EmojiSearchOptions);
10
+ }
11
+ export {};
@@ -0,0 +1,23 @@
1
+ import { CommandItem } from '../../../../@ones-editor/core';
2
+ import { TypedEmitter } from 'tiny-typed-emitter';
3
+ import './index.scss';
4
+ export interface EmojiPaletteEvents {
5
+ onSelectEmoji: (emoji: string) => void;
6
+ }
7
+ export declare class EmojiPalette extends TypedEmitter<EmojiPaletteEvents> implements CommandItem {
8
+ id: string;
9
+ name: string;
10
+ element: HTMLDivElement;
11
+ private emojiData;
12
+ private emojiSearch;
13
+ private emojiContent;
14
+ private emojiNavigation;
15
+ constructor();
16
+ private initEmojiData;
17
+ private handleSearch;
18
+ private handleEmojiSelect;
19
+ private handleSelectCategory;
20
+ private handleCategoryReach;
21
+ updateComponents(): void;
22
+ destroy(): void;
23
+ }