@ones-editor/editor 1.0.9 → 1.1.0

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,5 +1,5 @@
1
- import { CodeBlock, CodeLineBlock, CodeTextDecorator, CopyCodeInputHandler } from './code-block';
1
+ import { CodeBlock, CodeLineBlock, CodeTextDecorator } from './code-block';
2
2
  import './locale';
3
3
  export * from './code-block/types';
4
- export { CodeBlock, CodeLineBlock, CodeTextDecorator, CopyCodeInputHandler };
4
+ export { CodeBlock, CodeLineBlock, CodeTextDecorator };
5
5
  export { isCodeBlock } from './code-block/code-block-dom';
@@ -1,4 +1,5 @@
1
- import type { OnesEditor } from '../../../../@ones-editor/core';
1
+ import type { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
2
2
  export declare function handleCopyAction(editor: OnesEditor): Promise<void>;
3
3
  export declare function handleCopyMarkdownAction(editor: OnesEditor): Promise<void>;
4
4
  export declare function handleCutAction(editor: OnesEditor): Promise<void>;
5
+ export declare function handleSaveImageFromImageEmbedTypeBlock(editor: OnesEditor, block: BlockElement): Promise<void>;
@@ -2,10 +2,12 @@ import type { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
2
2
  export default class ContextMenuCommandItems {
3
3
  private editor;
4
4
  private t;
5
- private supportClipboard;
5
+ private clipboardPermission;
6
6
  private isSecureContext;
7
7
  private externalActionHandleMap;
8
8
  constructor(editor: OnesEditor);
9
+ get hasClipboardReadPermission(): boolean;
10
+ get hasClipboardWritePermission(): boolean;
9
11
  clipboardSupport(): void;
10
12
  get isRangeCollapsed(): boolean;
11
13
  get imageTypeCommandItems(): CommandItem[];
@@ -20,4 +22,5 @@ export default class ContextMenuCommandItems {
20
22
  private getExternalContextMenuOptions;
21
23
  private secureEnvTips;
22
24
  private isFocusImageBlock;
25
+ private isFocusImageTypeEmbed;
23
26
  }
@@ -1,4 +1,3 @@
1
- import type { ImageObject } from '../../../../@ones-editor/image-embed';
2
1
  export declare function blobToString(blob: Blob): Promise<string>;
3
2
  export declare function isClipboardEmpty(): Promise<boolean>;
4
- export declare function saveAs(resourceUrl: string, imageObject: ImageObject): void;
3
+ export declare function saveAs(resourceUrl: string, resourceId: string): void;
@@ -1,6 +1,6 @@
1
- import type { OnesEditor } from '../../../../@ones-editor/core';
1
+ import type { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
2
2
  import './context-menu.scss';
3
- declare class OnesEditorContextMenu {
3
+ declare class OnesEditorContextMenu implements OnesEditorCustom {
4
4
  private editor;
5
5
  private contextMenu;
6
6
  private contextMenuCommandItems;
@@ -213,7 +213,6 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
213
213
  }[]) => void;
214
214
  localDeleteChildContainers: (containerIds: string[]) => void;
215
215
  addResources: (resourceIds: string[]) => Promise<string[]>;
216
- patchSyncResources: (resourceIds: string[]) => Promise<string[]>;
217
216
  uploadResource: (file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
218
217
  request: <T = unknown>(url: string, options?: unknown) => Promise<T>;
219
218
  broadcastMessage: (data: unknown) => void;
@@ -36,7 +36,6 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
36
36
  onError(error: Error): void;
37
37
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
38
38
  addResources(resourceIds: string[]): Promise<string[]>;
39
- patchSyncResources(resourceIds: string[]): Promise<string[]>;
40
39
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
41
40
  request<T = unknown>(url: string, options?: unknown): Promise<T>;
42
41
  broadcastMessage(data: unknown): void;
@@ -66,7 +66,7 @@ export interface Box {
66
66
  handleClickBox?: (editor: OnesEditor, box: BoxElement, event: MouseEvent) => void;
67
67
  toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
68
68
  getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
69
- getResources?: (editor: OnesEditor, box: DocBox) => string[];
69
+ getResources?: (editor: OnesEditor, box: DocBox) => string[] | null;
70
70
  }
71
71
  export interface Insertion {
72
72
  insertionType: string;
@@ -228,7 +228,7 @@ export interface Block {
228
228
  toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
229
229
  getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
230
230
  blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
231
- getResources?: (editor: OnesEditor, data: DocBlock) => string[];
231
+ getResources?: (editor: OnesEditor, data: DocBlock) => string[] | null;
232
232
  replaceResources?: (data: DocBlock, resources: Map<string, string>) => void;
233
233
  }
234
234
  export type TextStyles = {
@@ -24,7 +24,6 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
24
24
  localDeleteChildContainers(containerIds: string[]): void;
25
25
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
26
26
  addResources(resourceIds: string[]): Promise<string[]>;
27
- patchSyncResources(resourceIds: string[]): Promise<string[]>;
28
27
  buildResourceUrl(src: string): string;
29
28
  request<T>(url: string, opt?: any): Promise<T>;
30
29
  broadcastMessage(data: unknown): void;
@@ -30,11 +30,7 @@ export default class ShareDBClient {
30
30
  getFileUrlByHash(uploadFileUrl: string, hash: string, name: string, size: number, headers: {
31
31
  [index: string]: string;
32
32
  }): Promise<any>;
33
- patchSyncResourceByHash(uploadFileUrl: string, hash: string[], headers: {
34
- [index: string]: string;
35
- }): Promise<any[]>;
36
33
  getFileUrlsByHashes(resourceHashes: string[]): Promise<any[]>;
37
- patchSyncResourceByHashes(resourceHashes: string[]): Promise<any[]>;
38
34
  uploadFile(url: string, file: File, headers: {
39
35
  [index: string]: string;
40
36
  }, onProgress: OnProgress, options?: {
@@ -76,7 +76,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
76
76
  onUpdateComment(commentId: string, local: boolean): void;
77
77
  onCustomMessage(msg: unknown): void;
78
78
  addResources(resourceIds: string[]): Promise<string[]>;
79
- patchSyncResources(resourceIds: string[]): Promise<any[]>;
80
79
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
81
80
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
82
81
  request<T = unknown>(url: string, options?: unknown): Promise<T>;