@ones-editor/editor 2.1.7-beta.15 → 2.1.7-beta.17

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 (44) hide show
  1. package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +2 -0
  2. package/@ones-editor/core/src/core/containers/root-container.d.ts +0 -3
  3. package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +1 -0
  4. package/@ones-editor/core/src/core/editor/index.d.ts +1 -1
  5. package/@ones-editor/core/src/core/types.d.ts +6 -0
  6. package/@ones-editor/core/src/utils/animate-scroll.d.ts +2 -0
  7. package/@ones-editor/core/src/utils/dom.d.ts +2 -2
  8. package/@ones-editor/mention/src/mention.d.ts +9 -3
  9. package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +1 -1
  10. package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +4 -5
  11. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +2 -4
  12. package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +3 -1
  13. package/@ones-editor/mobile-helper/src/index.d.ts +2 -1
  14. package/@ones-editor/sharedb-doc/src/types.d.ts +3 -3
  15. package/@ones-editor/table-block/src/index.d.ts +2 -5
  16. package/@ones-editor/text-commands/src/index.d.ts +0 -1
  17. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  18. package/@ones-editor/ui/src/locale/en-us.d.ts +9 -0
  19. package/@ones-editor/ui/src/locale/ja-jp.d.ts +9 -0
  20. package/@ones-editor/ui/src/locale/zh-cn.d.ts +9 -0
  21. package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +4 -1
  22. package/@ones-editor/ui/src/providers/selection-provider.d.ts +9 -0
  23. package/@ones-editor/ui/src/providers/utils/text-styles.d.ts +1 -1
  24. package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +1 -1
  25. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -1
  26. package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +1 -1
  27. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +3 -3
  28. package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +1 -0
  29. package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -1
  30. package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
  31. package/@ones-editor/ui-base/src/index.d.ts +1 -1
  32. package/@ones-editor/ui-base/src/input/create-input.d.ts +2 -2
  33. package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -1
  34. package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +537 -607
  37. package/dist/types.d.ts +5 -4
  38. package/package.json +1 -1
  39. package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -13
  40. package/@ones-editor/text-commands/src/locale/index.d.ts +0 -1
  41. package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +0 -13
  42. package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -13
  43. package/@ones-editor/ui/src/providers/utils/text-commands.d.ts +0 -3
  44. /package/@ones-editor/table-block/src/commands/{table-command-provider.d.ts → mobile-command-provider.d.ts} +0 -0
@@ -43,6 +43,15 @@ declare const _default: {
43
43
  paste: string;
44
44
  tab: string;
45
45
  shiftTab: string;
46
+ bold: string;
47
+ italic: string;
48
+ underline: string;
49
+ strikethrough: string;
50
+ code: string;
51
+ subscript: string;
52
+ superscript: string;
53
+ more: string;
54
+ selectBlock: string;
46
55
  };
47
56
  };
48
57
  export default _default;
@@ -43,6 +43,15 @@ declare const _default: {
43
43
  paste: string;
44
44
  tab: string;
45
45
  shiftTab: string;
46
+ bold: string;
47
+ italic: string;
48
+ underline: string;
49
+ strikethrough: string;
50
+ code: string;
51
+ subscript: string;
52
+ superscript: string;
53
+ more: string;
54
+ selectBlock: string;
46
55
  };
47
56
  };
48
57
  export default _default;
@@ -43,6 +43,15 @@ declare const _default: {
43
43
  paste: string;
44
44
  tab: string;
45
45
  shiftTab: string;
46
+ bold: string;
47
+ italic: string;
48
+ underline: string;
49
+ strikethrough: string;
50
+ code: string;
51
+ subscript: string;
52
+ superscript: string;
53
+ more: string;
54
+ selectBlock: string;
46
55
  };
47
56
  };
48
57
  export default _default;
@@ -1,9 +1,12 @@
1
1
  import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
2
  export declare class MobileLinkProvider implements OnesEditorCommandProvider {
3
+ private options?;
3
4
  id: string;
4
5
  insertProvider: OnesEditorCommandProvider;
5
6
  editProvider: OnesEditorCommandProvider;
6
- constructor(editor: OnesEditor);
7
+ constructor(editor: OnesEditor, options?: {
8
+ linkMode: 'insert' | 'edit';
9
+ } | undefined);
7
10
  getSelectedLinkChild: (editor: OnesEditor, range: SelectionRange) => import("@ones-editor/core").TextBlockContentChild | null;
8
11
  getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
9
12
  executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
@@ -0,0 +1,9 @@
1
+ import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
+ export default class SelectionProvider implements OnesEditorCommandProvider {
3
+ private editor;
4
+ id: string;
5
+ constructor(editor: OnesEditor);
6
+ getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams): CommandItem[];
7
+ getInsertCommands: () => never[];
8
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
9
+ }
@@ -2,5 +2,5 @@ import { BlockElement, CommandItem, DocBlockText, OnesEditor, SelectionRange, Te
2
2
  export declare function getIntersectionStyles(text: DocBlockText): Map<any, any>;
3
3
  export declare function getTextStyles(editor: OnesEditor, block: BlockElement, range: SelectionRange): TextStyles;
4
4
  export declare function applyTextStyle(editor: OnesEditor, block: BlockElement, range: SelectionRange, style: string, value?: boolean | string | number): DocBlockText;
5
- export declare function getStandardTextStyles(textStyles: CommandItem[], text: DocBlockText): CommandItem[];
5
+ export declare function getStandardTextStyles(editor: OnesEditor, textStyles: CommandItem[], text: DocBlockText): CommandItem[];
6
6
  export declare function getSubText(editor: OnesEditor, block: BlockElement, range: SelectionRange): DocBlockText;
@@ -17,7 +17,7 @@ export declare class ReadonlyToolbar implements OnesEditorCustom {
17
17
  isInBlock(block: BlockElement, event: MouseEvent): boolean;
18
18
  handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
19
19
  handleClose: () => void;
20
- handleClosing: (bar: unknown, event: MouseEvent) => boolean;
20
+ handleClosing: (bar: unknown, event: MouseEvent | TouchEvent) => boolean;
21
21
  bindEvents(): void;
22
22
  unbindEvents(): void;
23
23
  handleDocumentMouseDown: (event: MouseEvent) => void;
@@ -24,7 +24,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
24
24
  isInBlock(block: BlockElement, event: MouseEvent): boolean;
25
25
  handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
26
26
  handleClose: () => void;
27
- handleClosing: (bar: unknown, event: MouseEvent) => boolean;
27
+ handleClosing: (bar: unknown, event: MouseEvent | TouchEvent) => boolean;
28
28
  bindEvents(): void;
29
29
  unbindEvents(): void;
30
30
  handleDocumentMouseDown: (event: MouseEvent) => 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 | PointerEvent) => void;
17
+ handleClick: (event: MouseEvent) => void;
18
18
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import { TypedEmitter } from 'tiny-typed-emitter';
3
2
  import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
4
3
  import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
@@ -23,7 +22,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
23
22
  get isSubCommandBar(): boolean;
24
23
  updateItems(items: CommandItem[]): void;
25
24
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
26
- protected handleDocumentMouseDown: (event: MouseEvent) => void;
25
+ protected handleDocumentMouseDown: (event: MouseEvent | TouchEvent) => void;
27
26
  protected handleHidden: () => void;
28
27
  protected handleShown: () => void;
29
28
  protected handleShow: () => void;
@@ -31,7 +30,8 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
31
30
  private getSelectedItemIndex;
32
31
  private getPrevItemIndex;
33
32
  private getNextItemIndex;
34
- protected clearSelectedItem: import("lodash").DebouncedFunc<() => void>;
33
+ protected clearSelectedItem(): void;
34
+ private debounceClearSelectedItem;
35
35
  selectItem(id: string, from?: SelectItemFrom): void;
36
36
  private lastEnterPauseTime;
37
37
  private startPauseMouseEnter;
@@ -4,6 +4,7 @@ import CommandBar from './command-bar';
4
4
  import { AbstractManualCommandBar, ManualShowCommandBarOptions } from './types';
5
5
  export default abstract class ManualCommandBar extends CommandBar implements AbstractManualCommandBar {
6
6
  tippyInstance: Instance | null;
7
+ setProps: (props: ManualShowCommandBarOptions) => void;
7
8
  manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
8
9
  close(reason: CloseReason): void;
9
10
  destroy(): void;
@@ -8,7 +8,7 @@ export interface CommandBarEvents {
8
8
  'click': (bar: AbstractCommandBar, item: CommandItem, elem: HTMLElement) => void;
9
9
  'close': (bar: AbstractCommandBar) => void;
10
10
  'selectionChange': (bar: AbstractCommandBar, id: string) => void;
11
- 'closing': (bar: AbstractCommandBar, event: MouseEvent) => boolean | undefined;
11
+ 'closing': (bar: AbstractCommandBar, event: MouseEvent | TouchEvent) => boolean | undefined;
12
12
  'subBarShown': (bar: AbstractCommandBar, subBar: AbstractCommandBar) => void;
13
13
  }
14
14
  export interface ManualShowCommandBarOptions {
@@ -31,6 +31,7 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
31
31
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
32
32
  getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
33
33
  updateItems: (items: CommandItem[]) => void;
34
+ setProps?: (props: ManualShowCommandBarOptions) => void;
34
35
  }
35
36
  export interface ShowCommandBarOptions {
36
37
  placement?: Placement;
@@ -20,6 +20,6 @@ export default class ManualCloseDialog extends ManualCommandBar {
20
20
  getReferenceClientRect?: GetReferenceClientRect | null | undefined;
21
21
  }): void;
22
22
  get dialogContent(): HTMLElement | ((item: CommandItem) => HTMLElement);
23
- handleDocumentMouseDown: (event: MouseEvent) => void;
23
+ handleDocumentMouseDown: () => void;
24
24
  static getCommandItems(content: HTMLElement, options?: ManualCloseDialogOptions): CommandItem[];
25
25
  }
@@ -17,5 +17,5 @@ export * from './item-shortcuts';
17
17
  export * from './emoji-item';
18
18
  export * from './mobile-command-bar/mobile-bottom-menu';
19
19
  export * from './text-button';
20
- export { scrollIntoView } from './mobile-command-bar/scroll-into-view';
20
+ export { scrollBarIntoView } from './mobile-command-bar/scroll-into-view';
21
21
  export { tippy, };
@@ -11,7 +11,7 @@ export type EditorInputOptions = {
11
11
  prefix?: Element;
12
12
  suffixClose?: boolean;
13
13
  };
14
- declare class EditorInput {
14
+ export declare class EditorInput {
15
15
  private parent;
16
16
  private options;
17
17
  private unbindKeyDownEvent;
@@ -28,10 +28,10 @@ declare class EditorInput {
28
28
  handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
29
29
  showSuffix: () => void;
30
30
  hideSuffix: () => void;
31
+ reset: () => void;
31
32
  handleInput: (e: Event) => void;
32
33
  handleClose: (e: Event | TouchEvent) => void;
33
34
  init(): HTMLDivElement;
34
35
  destroy(): void;
35
36
  }
36
37
  export declare function createInput(parent: HTMLElement, options: EditorInputOptions): EditorInput;
37
- export {};
@@ -13,7 +13,6 @@ declare class MobileBottomMenu extends CommandBar implements AbstractManualComma
13
13
  destroy(): void;
14
14
  get isVisible(): boolean;
15
15
  get popper(): Element | null;
16
- getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
17
16
  protected initCommandBarElement(elem: CommandBarContentElement): void;
18
17
  protected getCommandBarRoot(): HTMLElement | null;
19
18
  protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
@@ -1,3 +1,3 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { AbstractCommandBar } from '../command-bar';
3
- export declare const scrollIntoView: (bar: AbstractCommandBar, editor: OnesEditor) => void;
3
+ export declare const scrollBarIntoView: (editor: OnesEditor, bar: AbstractCommandBar) => void;
package/dist/index.d.ts CHANGED
@@ -80,6 +80,7 @@ export declare function getDefaultOnesEditorOptions(options: CreateOnesEditorOpt
80
80
  mathjax?: import("@ones-editor/mathjax").MathjaxOptions | undefined;
81
81
  link?: import("@ones-editor/ui/src/link-popup").LinkOptions | undefined;
82
82
  columns?: import("@ones-editor/layout-block/src/types").EditorConfigLayoutOptions | undefined;
83
+ mobile?: import("@ones-editor/core").MobileClient | undefined;
83
84
  };
84
85
  };
85
86
  shortcuts: import("@ones-editor/core").ShortcutRecords[];