@ones-editor/editor 2.9.8-beta.4 → 2.9.8-beta.41

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 (34) hide show
  1. package/@ones-editor/cke-html/package.json +7 -0
  2. package/@ones-editor/cke-html/src/html/cke-html.d.ts +4 -0
  3. package/@ones-editor/cke-html/src/html/combine-html.d.ts +2 -0
  4. package/@ones-editor/cke-html/src/html/comment.d.ts +6 -0
  5. package/@ones-editor/cke-html/src/html/converter.d.ts +7 -0
  6. package/@ones-editor/cke-html/src/html/data-helper/link-data.d.ts +0 -0
  7. package/@ones-editor/cke-html/src/html/image.d.ts +4 -0
  8. package/@ones-editor/cke-html/src/html/link.d.ts +2 -0
  9. package/@ones-editor/cke-html/src/html/markdown.d.ts +2 -0
  10. package/@ones-editor/cke-html/src/html/mention.d.ts +4 -0
  11. package/@ones-editor/cke-html/src/index.d.ts +2 -0
  12. package/@ones-editor/core/src/core/doc/doc.d.ts +2 -1
  13. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -0
  14. package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
  15. package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +1 -0
  16. package/@ones-editor/core/src/core/types.d.ts +2 -0
  17. package/@ones-editor/core/src/local-doc/index.d.ts +1 -0
  18. package/@ones-editor/core/src/users/remote-users.d.ts +1 -1
  19. package/@ones-editor/graph-embed/src/helper/graph-dom/code-editor.d.ts +1 -0
  20. package/@ones-editor/list-block/src/index.d.ts +2 -0
  21. package/@ones-editor/main-toolbar/src/items/insert.d.ts +3 -0
  22. package/@ones-editor/server-tools/src/index.d.ts +4 -1
  23. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +2 -0
  24. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  25. package/@ones-editor/ui/src/providers/list.d.ts +1 -1
  26. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
  27. package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
  28. package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +7 -3
  29. package/@ones-editor/ui-base/src/command-bar/types.d.ts +6 -1
  30. package/@ones-editor/versions/src/history-doc/history-doc.d.ts +3 -1
  31. package/@ones-editor/versions/src/version-dialog/index.d.ts +2 -1
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.js +733 -157
  34. package/package.json +1 -1
@@ -7,7 +7,7 @@ export default class ListProvider implements OnesEditorCommandProvider {
7
7
  getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams): CommandItem[];
8
8
  getInsertCommands(): CommandItem[];
9
9
  convertToList(editor: OnesEditor, block: BlockElement, listType: 'unordered' | 'ordered' | 'unchecked'): void;
10
- insertList(editor: OnesEditor, containerId: string, blockIndex: number, listType: 'unordered' | 'ordered' | 'unchecked'): void;
10
+ insertList(editor: OnesEditor, containerId: string, blockIndex: number, listType: 'unordered' | 'ordered' | 'unchecked', command: CommandItem): void;
11
11
  executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
12
12
  executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, command: CommandItem) => boolean;
13
13
  }
@@ -14,7 +14,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
14
14
  private header;
15
15
  private footer;
16
16
  constructor(items: CommandItem[], closeable?: Closeable, options?: CommandBarOptions);
17
- close(reason: CloseReason): void;
17
+ close(reason: CloseReason, e?: MouseEvent | null): void;
18
18
  click(item: CommandItem, target: HTMLElement): void;
19
19
  createPopperOptions(flip?: boolean): Partial<import("@popperjs/core").Options>;
20
20
  destroy(): void;
@@ -22,6 +22,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
22
22
  get isSubCommandBar(): boolean;
23
23
  updateItems(items: CommandItem[]): void;
24
24
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
25
+ protected canClose(): boolean;
25
26
  protected handleDocumentMouseDown: (event: MouseEvent | TouchEvent) => void;
26
27
  protected handleHidden: () => void;
27
28
  protected handleShown: () => void;
@@ -6,6 +6,7 @@ export default class FixedToolbar extends CommandBar {
6
6
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
7
7
  protected initCommandBarElement(elem: HTMLElement): void;
8
8
  protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
9
+ protected canClose(): boolean;
9
10
  close(): void;
10
11
  getSubBarCreateOptions: (item: CommandItem) => CommandBarOptions;
11
12
  getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
@@ -1,12 +1,16 @@
1
- import { CloseReason } from '../../../../@ones-editor/core';
1
+ import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
2
2
  import { Instance } from 'tippy.js';
3
3
  import CommandBar from './command-bar';
4
- import { AbstractManualCommandBar, ManualShowCommandBarOptions } from './types';
4
+ import { AbstractManualCommandBar, CommandBarOptions, ManualShowCommandBarOptions } from './types';
5
5
  export default abstract class ManualCommandBar extends CommandBar implements AbstractManualCommandBar {
6
+ private manualCommandBarOptions?;
6
7
  tippyInstance: Instance | null;
8
+ _target: HTMLElement | null;
9
+ constructor(items: CommandItem[], closeable?: Closeable, manualCommandBarOptions?: CommandBarOptions | undefined);
10
+ handleBeforeClose: (event?: MouseEvent | TouchEvent) => boolean;
7
11
  setProps: (props: ManualShowCommandBarOptions) => void;
8
12
  manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
9
- close(reason: CloseReason): void;
13
+ close(reason: CloseReason, e?: MouseEvent | null): void;
10
14
  destroy(): void;
11
15
  protected getCommandBarRoot(): HTMLElement | null;
12
16
  get isVisible(): boolean;
@@ -25,7 +25,7 @@ export interface ManualShowCommandBarOptions {
25
25
  export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
26
26
  readonly isVisible: boolean;
27
27
  readonly parentItem: CommandItem | null;
28
- close: (reason: CloseReason) => void;
28
+ close: (reason: CloseReason, e?: MouseEvent | null) => void;
29
29
  destroy: () => void;
30
30
  isInCommandBar: (target: EventTarget | null) => boolean;
31
31
  handleDocumentKeydown: (event: KeyboardEvent) => boolean;
@@ -69,9 +69,14 @@ export interface CommandBarOptions {
69
69
  beforeClose?: (event?: MouseEvent | TouchEvent) => boolean;
70
70
  showName?: boolean;
71
71
  maxWidth?: number | string;
72
+ appendTo?: Element;
72
73
  }
73
74
  export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
74
75
  export type PopoverOptions = {
75
76
  overflowBoundary?: Element;
77
+ appendTo?: Element;
78
+ };
79
+ export type ObjectToolbarOptions = {
80
+ appendTo?: Element;
76
81
  };
77
82
  export type SelectItemFrom = 'event' | 'manual';
@@ -3,10 +3,12 @@ import { HistoryUser } from '../types';
3
3
  export default class HistoryDoc extends EventCallbacks<OnesEditorDocCallbacks> implements OnesEditorDoc {
4
4
  private server;
5
5
  private docObject;
6
- constructor(server: OnesEditorDocServer, docObject: DocObject);
6
+ private editorOptions?;
7
+ constructor(server: OnesEditorDocServer, docObject: DocObject, editorOptions?: unknown);
7
8
  beginBatchUpdate(): number;
8
9
  endBatchUpdate(): number;
9
10
  toJSON(): DocObject;
11
+ applyingOps(): boolean;
10
12
  getContainerBlocks(containerId: string): DocBlock[];
11
13
  findContainerBlocks(containerId: string): DocBlock[];
12
14
  getBlockData(containerId: string, blockIndex: number): DocBlock;
@@ -2,6 +2,7 @@ import { OnesEditor, OnesEditorCustom, OnesEditorDocServer } from '../../../../@
2
2
  import type { OnesEditorVersionsProvider, VersionDialogOptions } from '../types';
3
3
  export declare class OnesEditorVersionsDialog implements OnesEditorCustom {
4
4
  private server;
5
+ private editorOptions?;
5
6
  private dialog;
6
7
  private oldViewer;
7
8
  private versionOptions?;
@@ -11,7 +12,7 @@ export declare class OnesEditorVersionsDialog implements OnesEditorCustom {
11
12
  private components;
12
13
  get versionHelper(): import("@ones-editor/core").OnesEditorDocVersionHelper;
13
14
  get editor(): OnesEditor | null;
14
- constructor(server: OnesEditorDocServer, provider: OnesEditorVersionsProvider);
15
+ constructor(server: OnesEditorDocServer, provider: OnesEditorVersionsProvider, editorOptions?: unknown);
15
16
  private handleRevert;
16
17
  private handleSelectVersion;
17
18
  private handleCompareWithVersion;
package/dist/index.d.ts CHANGED
@@ -46,6 +46,7 @@ export { ShareDBDocVersionsProvider, OnesEditorIcons, isLayoutBlock, LayoutQuick
46
46
  export type { FileBoxData, FileEmbedData } from '../@ones-editor/file';
47
47
  export * from './helper';
48
48
  export { OnesEditorComments, OnesEditorCommentsRender } from '../@ones-editor/comments';
49
+ export * from '../@ones-editor/cke-html';
49
50
  export { type DocListBlock } from '../@ones-editor/list-block';
50
51
  export declare function getDefaultOnesEditorOptions(options: CreateOnesEditorOptions): {
51
52
  id: string | undefined;
@@ -103,5 +104,6 @@ export interface ShowDocVersionsOptions2 {
103
104
  userId: string;
104
105
  displayName: string;
105
106
  options?: VersionDialogOptions;
107
+ editorOptions?: CreateOnesEditorOptions;
106
108
  }
107
109
  export declare function showDocVersions2(parent: HTMLElement, options: ShowDocVersionsOptions2): Promise<OnesEditorVersionsDialog>;