@ones-editor/editor 3.0.1-beta.9 → 3.0.2-beta.2

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.
@@ -187,11 +187,11 @@ export interface OnesEditorDocVersionExtra {
187
187
  memo?: string;
188
188
  }
189
189
  export interface DocVersion {
190
+ versionIndex: number;
190
191
  version: number;
191
192
  tag?: string;
192
193
  published?: boolean;
193
194
  type?: 'major' | 'minor';
194
- minorVersions?: DocVersion[];
195
195
  authors?: {
196
196
  userId: string;
197
197
  displayName: string;
@@ -207,6 +207,7 @@ export interface DocVersion {
207
207
  tagId: string;
208
208
  extra?: OnesEditorDocVersionExtra;
209
209
  }
210
+ export declare function apiResultToDocVersions(versions: unknown): DocVersion[];
210
211
  export interface OnesEditorDocServerMeta {
211
212
  serverId?: string;
212
213
  docId?: string;
@@ -289,6 +290,7 @@ export interface OnesEditorDocVersionHelper {
289
290
  createVersion: (tag: string, publish: boolean) => Promise<DocVersion>;
290
291
  parseHistoryData: (historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler) => void;
291
292
  updateVersionExtra: (version: number, tagId: string, extra: OnesEditorDocVersionExtra) => Promise<void>;
293
+ copyLink?: (ver: DocVersion) => void;
292
294
  }
293
295
  export interface OnesEditorComment {
294
296
  id: string;
@@ -1,7 +1,7 @@
1
- import { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
1
+ import { BlockElement, OnesEditor, OnesEditorInputHandler, OnesEditorBlockHook, BlockPath } from '../../../../@ones-editor/core';
2
2
  import './placeholder.scss';
3
3
  import { EnforceWithDocumentTitleHandlerOptions } from './types';
4
- declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler {
4
+ declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler, OnesEditorBlockHook {
5
5
  private options;
6
6
  constructor(editor: OnesEditor, options?: EnforceWithDocumentTitleHandlerOptions);
7
7
  destroy(editor: OnesEditor): void;
@@ -10,6 +10,7 @@ declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler
10
10
  handleRemoteChanged(editor: OnesEditor): void;
11
11
  handleUpdateCompositionText(editor: OnesEditor): void;
12
12
  handleSelectionChange: (editor: OnesEditor) => void;
13
+ update(editor: OnesEditor, path: BlockPath, container: unknown, blockElement: BlockElement, blockData: unknown): void;
13
14
  private reload;
14
15
  private applyPlaceholder;
15
16
  private removePlaceholder;
@@ -1,4 +1,4 @@
1
- import { BuildResourceUrlOptions, DocBlock, DocComment, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorUser, OnesEditorUserPermission, UploadResourceOptions, UploadResourceResult } from '../../../@ones-editor/core';
1
+ import { BuildResourceUrlOptions, DocBlock, DocComment, DocVersion, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorUser, OnesEditorUserPermission, UploadResourceOptions, UploadResourceResult } from '../../../@ones-editor/core';
2
2
  import { Op } from 'sharedb';
3
3
  export type { Op } from 'sharedb/lib/client';
4
4
  export type BlocksType = DocBlock[];
@@ -89,6 +89,7 @@ export interface ShareDBDocOptions {
89
89
  buildResourceUrl?: (doc: OnesEditorDoc, resourceId: string, options?: BuildResourceUrlOptions) => string;
90
90
  uploadResource?: (doc: OnesEditorDoc, file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
91
91
  onReady?: () => void;
92
+ onCopyVersionLink?: (ver: DocVersion) => void;
92
93
  }
93
94
  export interface EditorOp {
94
95
  c: string;
@@ -5,6 +5,7 @@ export default class ShareDBServer extends EventCallbacks<ShareDBDocCallbacks> i
5
5
  private options;
6
6
  remoteUsers: RemoteUsers;
7
7
  client: ShareDBSimpleClient;
8
+ copyLink?: (v: DocVersion) => void;
8
9
  constructor(options: ShareDBDocOptions);
9
10
  destroy(): void;
10
11
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;