@ones-editor/editor 2.1.8 → 2.1.9

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.
@@ -8,7 +8,4 @@ export { OnesEditorComments };
8
8
  export type { CommentItem } from './comment-item';
9
9
  export type { CommentGroupItem } from './comments-list/group-item';
10
10
  export { removeCommentFromBlock } from './actions/remove-comment-from-block';
11
- export { addCommentToTextBlocks } from './actions/add-comment-to-text-block';
12
- export { addCommentToBlock } from './actions/add-comment-to-block';
13
11
  export { editorAddComment } from './actions/editor-add-comment';
14
- export * from './comments-helper/old-version-comment';
@@ -1,10 +1,10 @@
1
- import { BlockCommands, BlockElement, BoxCommands, OnesEditor, TextBlockContentChild } from '../../types';
1
+ import { BlockCommands, BlockElement, OnesEditor } from '../../types';
2
2
  export declare function getBlockProperties(editor: OnesEditor, block: BlockElement): import("../../types").BlockProperties | undefined;
3
- export declare function getBlockCommandsWithHook(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): Record<string, BlockCommands>;
4
- interface SpecialBlockCommands {
5
- element: HTMLElement | null;
6
- blockCommands: BlockCommands[];
7
- boxCommands: BoxCommands[];
8
- }
9
- export declare function getSpecialBlockCommands(editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null, group: string): SpecialBlockCommands;
10
- export {};
3
+ export declare function getBlockCommandsWithHook(editor: OnesEditor, block: BlockElement): Record<string, BlockCommands>;
4
+ export declare function getSpecialBlockCommands(editor: OnesEditor, blockElement: BlockElement, group: string): {
5
+ element: import("../../types").BlockContentElement;
6
+ commands: import("../../types").CommandItem[];
7
+ } | {
8
+ element: null;
9
+ commands: never[];
10
+ };
@@ -1,8 +1,7 @@
1
- import { BlockElement, OnesEditor, SelectedBlock, SelectionRange } from '../../types';
1
+ import { BlockElement, OnesEditor, SelectedBlock } from '../../types';
2
2
  export type GetAllChildBlocksOptions = {
3
3
  simpleBlockOnly?: boolean;
4
4
  visibleOnly?: boolean;
5
- range?: SelectionRange;
6
5
  };
7
6
  export declare function getAllChildBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): BlockElement[];
8
7
  export declare function getAllSelectedBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): SelectedBlock[];
@@ -1,4 +1,4 @@
1
- import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlockPosition, GetChildContainerOptions, ComplexSelectionRange } from '../../types';
1
+ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlockPosition, GetChildContainerOptions } from '../../types';
2
2
  export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
3
3
  export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
4
4
  export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
@@ -13,4 +13,3 @@ export declare function complexBlockAdjustSelectionPos(editor: OnesEditor, compl
13
13
  anchor: ComplexBlockPosition;
14
14
  focus: ComplexBlockPosition;
15
15
  };
16
- export declare function isFullSelectedOneComplexBlock(editor: OnesEditor, complexRange?: ComplexSelectionRange): boolean;
@@ -1,5 +1,10 @@
1
- import { BlockElement, TextBlockContentTextChild, TextBlockContentBoxChild, TextBlockContentInsertionChild, TextBlockContentChild } from '../../../types';
2
- export type { TextBlockContentTextChild, TextBlockContentBoxChild, TextBlockContentInsertionChild, TextBlockContentChild };
1
+ import { BlockElement, BoxElement, InsertionElement } from '../../../types';
2
+ export type TextBlockContentTextChild = HTMLSpanElement & {
3
+ __neverUse: 'TextBlockContentTextChild';
4
+ };
5
+ export type TextBlockContentInsertionChild = InsertionElement;
6
+ export type TextBlockContentBoxChild = BoxElement;
7
+ export type TextBlockContentChild = TextBlockContentTextChild | TextBlockContentBoxChild | TextBlockContentInsertionChild;
3
8
  export type TextBlockContentChildren = TextBlockContentChild[];
4
9
  export type TextBlockContentChildType = 'text' | 'box' | 'insertion';
5
10
  export declare function isTextBlockContentChild(elem: Element): boolean;
@@ -110,12 +110,10 @@ export interface OnesEditorDocComplexBlockPos {
110
110
  }
111
111
  export type OnesEditorDocBlockPos = OnesEditorDocSimpleBlockPos | OnesEditorDocComplexBlockPos;
112
112
  export interface OnesEditorDocSimpleRange {
113
- reverse?: boolean;
114
113
  anchor: OnesEditorDocSimpleBlockPos;
115
114
  focus: OnesEditorDocSimpleBlockPos;
116
115
  }
117
116
  export interface OnesEditorDocComplexRange {
118
- reverse?: boolean;
119
117
  anchor: OnesEditorDocComplexBlockPos;
120
118
  focus: OnesEditorDocComplexBlockPos;
121
119
  }
@@ -204,7 +202,6 @@ export interface OnesEditorDocServerMeta {
204
202
  serverId?: string;
205
203
  docId?: string;
206
204
  appId?: string;
207
- apiServer?: string;
208
205
  }
209
206
  export interface RecognizeLinkResult {
210
207
  type?: 'iframe' | 'video' | 'audio' | 'image';
@@ -1,11 +1,5 @@
1
1
  import { TypedEmitter } from 'tiny-typed-emitter';
2
2
  import { DocBlock, DocBlockAttributes, DocBlockDelta, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange, UpdateBlockOptions } from './doc';
3
- export type TextBlockContentTextChild = HTMLSpanElement & {
4
- __neverUse: 'TextBlockContentTextChild';
5
- };
6
- export type TextBlockContentInsertionChild = InsertionElement;
7
- export type TextBlockContentBoxChild = BoxElement;
8
- export type TextBlockContentChild = TextBlockContentTextChild | TextBlockContentBoxChild | TextBlockContentInsertionChild;
9
3
  export type ContainerElement = HTMLDivElement & {
10
4
  __neverUse: 'ContainerElement';
11
5
  };
@@ -58,7 +52,6 @@ export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
58
52
  export interface BoxCommands {
59
53
  group: string;
60
54
  commands: CommandItem[];
61
- startGroup?: boolean;
62
55
  executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
63
56
  }
64
57
  export interface BoxProperties {
@@ -181,11 +174,9 @@ export type BlockPathComponent = {
181
174
  };
182
175
  export type BlockPath = BlockPathComponent[];
183
176
  export interface BlockCommands {
184
- element?: HTMLElement;
185
177
  group: string;
186
178
  commands: CommandItem[];
187
- startGroup?: boolean;
188
- executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => unknown;
179
+ executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => unknown;
189
180
  }
190
181
  export interface BlockProperties {
191
182
  blockCommands?: Record<string, BlockCommands>;
@@ -762,5 +753,5 @@ export interface OnesEditorBlockHook {
762
753
  create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
763
754
  update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
764
755
  writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
765
- commands?: (editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null) => BlockCommands | undefined;
756
+ commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
766
757
  }
@@ -11,9 +11,6 @@ export default class ShareDBClient {
11
11
  private reauthFunc?;
12
12
  clientId: string;
13
13
  constructor(auth: AuthMessage, serverUrl: string, reauthFunc?: ReauthFunc);
14
- token(): string;
15
- resourceToken(): string;
16
- docId(): string;
17
14
  editorServer(): string;
18
15
  close(logout: boolean): void;
19
16
  on(event: 'open' | 'close' | 'error', callback: (event: Event | Error) => void): void;
@@ -55,7 +52,7 @@ export default class ShareDBClient {
55
52
  revertVersion(ver: number): Promise<void>;
56
53
  createVersion(tag: string, publish: boolean): Promise<any>;
57
54
  recognizeLink(url: string): Promise<LinkDetails>;
58
- getResourceId(url: string): string;
55
+ private getResourceId;
59
56
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
60
57
  reAuth(auto?: boolean): void;
61
58
  }
@@ -1,13 +1,6 @@
1
- import axios from 'axios';
2
1
  import ShareDBDoc from './doc/sharedb-doc';
3
2
  import { RemoteCarets, RemoteCaretsDecorator } from './remote-carets';
4
- import ShareDBClientBase from './doc/sharedb-client-base';
5
- import ShareDBLocalDoc from './doc/sharedb-local-doc';
6
- import type { ShareDBLocalDocOptions } from './doc/sharedb-local-doc';
7
- export { ShareDBDoc, RemoteCarets, RemoteCaretsDecorator, ShareDBClientBase, ShareDBLocalDoc };
8
- export type { ShareDBLocalDocOptions };
3
+ export { ShareDBDoc, RemoteCarets, RemoteCaretsDecorator };
9
4
  export * from './doc/comments';
10
5
  export * from './types';
11
6
  export * from './versions';
12
- export * from './utils/converter';
13
- export { axios };