@ones-editor/editor 0.0.3-beta.118 → 0.0.3-beta.119

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.
@@ -1,6 +1,6 @@
1
1
  import './style.scss';
2
2
  import OnesEditorToolbar from './toolbar/toolbar-handler';
3
- import OnesEditorQuickMenu, { getAllQuickMenuItems, getHeadingMenuOptions, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, BasicCommands } from './quick-menu';
3
+ import OnesEditorQuickMenu, { getAllQuickMenuItems, getHeadingMenuOptions, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, BasicCommands, GetAllQuickMenuItemsOptions } from './quick-menu';
4
4
  import OnesEditorTooltip from './tooltips';
5
5
  import TextStyleShortcuts from './shortcuts';
6
6
  import { editLink } from './link-popup';
@@ -8,7 +8,7 @@ import { getToolbar } from './toolbar/helper';
8
8
  import { GroupOrder } from './quick-menu/order';
9
9
  import './locale';
10
10
  import type { QuickMenuItem } from './quick-menu';
11
- export type { QuickMenuCommandProvider, QuickMenuCommandBetween, QuickMenuCommandInline };
11
+ export type { QuickMenuCommandProvider, QuickMenuCommandBetween, QuickMenuCommandInline, GetAllQuickMenuItemsOptions };
12
12
  export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, };
13
13
  export { createTextButton } from './text-button';
14
14
  export { mergeCommands } from './toolbar/merge-commands';
@@ -2,9 +2,12 @@ import { BlockElement } from '../../../../@ones-editor/core';
2
2
  import type { BlockOptions, CommandItem, OnesEditor, InsertEmptyBlockOptions } from '../../../../@ones-editor/core';
3
3
  import type { QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider } from './types';
4
4
  export declare function addQuickMenuItemFields(item: CommandItem, options: BlockOptions): void;
5
+ export declare function getPlainTextMenuOptions(): BlockOptions;
5
6
  export declare function getHeadingMenuOptions(start?: number): BlockOptions;
6
7
  export declare function getCompleteHeadingMenuOptions(): CommandItem[];
7
8
  export declare class BasicCommandProvider implements QuickMenuCommandProvider {
9
+ private withPlainText?;
10
+ constructor(withPlainText?: boolean | undefined);
8
11
  getCommands(): CommandItem[];
9
12
  updateBlock(editor: OnesEditor, containerId: string, block: BlockElement, item: CommandItem): null;
10
13
  handleUpdateBlockCore(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<null>;
@@ -1,3 +1,6 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { QuickMenuItem } from './types';
3
- export declare function getAllQuickMenuItems(editor: OnesEditor): QuickMenuItem[];
3
+ export interface GetAllQuickMenuItemsOptions {
4
+ withPlainText: boolean;
5
+ }
6
+ export declare function getAllQuickMenuItems(editor: OnesEditor, options?: GetAllQuickMenuItemsOptions): QuickMenuItem[];
@@ -1,5 +1,5 @@
1
1
  import { TypedEmitter } from 'tiny-typed-emitter';
2
- import { CommandItem, Closeable } from '../../../../@ones-editor/core';
2
+ import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
3
3
  import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions } from './types';
4
4
  import 'tippy.js/dist/tippy.css';
5
5
  export default abstract class CommandBar extends TypedEmitter<CommandBarEvents> implements AbstractCommandBar {
@@ -8,10 +8,11 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
8
8
  subBar: AbstractManualCommandBar | null;
9
9
  parentItem: CommandItem | null;
10
10
  closeable: Closeable | null;
11
+ closeReason: CloseReason;
11
12
  options: CommandBarOptions;
12
13
  id: string;
13
14
  constructor(items: CommandItem[], closeable?: Closeable, options?: CommandBarOptions);
14
- close(): void;
15
+ close(reason: CloseReason): void;
15
16
  click(item: CommandItem, target: HTMLElement): void;
16
17
  createPopperOptions(): Partial<import("@popperjs/core").Options>;
17
18
  destroy(): void;
@@ -1,10 +1,11 @@
1
+ import { CloseReason } from '../../../../@ones-editor/core';
1
2
  import { Instance } from 'tippy.js';
2
3
  import CommandBar from './command-bar';
3
4
  import { AbstractManualCommandBar, ManualShowCommandBarOptions } from './types';
4
5
  export default abstract class ManualCommandBar extends CommandBar implements AbstractManualCommandBar {
5
6
  tippyInstance: Instance | null;
6
7
  manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
7
- close(): void;
8
+ close(reason: CloseReason): void;
8
9
  destroy(): void;
9
10
  protected getCommandBarRoot(): HTMLElement | null;
10
11
  get isVisible(): boolean;
@@ -1,4 +1,4 @@
1
- import { Closeable, CommandItem } from '../../../../@ones-editor/core';
1
+ import { CloseReason, Closeable, CommandItem } from '../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
3
  import type { GetReferenceClientRect, Placement } from 'tippy.js';
4
4
  export { Placement };
@@ -22,7 +22,7 @@ export interface ManualShowCommandBarOptions {
22
22
  export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
23
23
  readonly isVisible: boolean;
24
24
  readonly parentItem: CommandItem | null;
25
- close: () => void;
25
+ close: (reason: CloseReason) => void;
26
26
  destroy: () => void;
27
27
  isInCommandBar: (target: EventTarget | null) => boolean;
28
28
  handleDocumentKeydown: (event: KeyboardEvent) => void;