oasis-editor 0.0.372 → 0.0.374

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.
@@ -3,6 +3,8 @@ export type ClipboardIssue = "access-denied" | "empty" | "unsupported" | "docume
3
3
  export type ClipboardPasteMode = "rich" | "text" | "merge";
4
4
  export interface ClipboardPasteDeps {
5
5
  state: () => EditorState;
6
+ /** Immutable committed state, not the live reactive facade. */
7
+ stateSnapshot?: () => EditorState;
6
8
  isReadOnly: () => boolean;
7
9
  applyTransactionalState: (producer: (current: EditorState) => EditorState) => void;
8
10
  applyTableAwareParagraphEdit: (state: EditorState, edit: (state: EditorState) => EditorState) => EditorState;
@@ -10,6 +10,8 @@ export type EditorClipboardActions = ReturnType<typeof createEditorClipboardActi
10
10
  declare function createClipboardActions(deps: ClipboardPasteDeps): {
11
11
  notice: import('solid-js').Accessor<ClipboardNotice | undefined>;
12
12
  dismiss: () => void;
13
+ reportNativeIssue: (action: ClipboardNotice["action"], issue: ClipboardIssue) => void;
14
+ requestGeneration: () => number;
13
15
  consumePasteMode: () => ClipboardPasteMode | undefined;
14
16
  copy: () => Promise<boolean>;
15
17
  cut: () => Promise<boolean>;
@@ -9,6 +9,7 @@ type CommandsController = ReturnType<typeof createEditorCommandsController>;
9
9
  export interface EditorInteractionRuntimeDeps {
10
10
  clipboardActions?: EditorClipboardActions;
11
11
  state: EditorState;
12
+ getStateSnapshot: () => EditorState;
12
13
  logger: EditorLogger;
13
14
  isReadOnly: () => boolean;
14
15
  applyState: (next: EditorState) => void;
@@ -231,7 +232,7 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
231
232
  }) => void;
232
233
  handlePaste: (event: ClipboardEvent & {
233
234
  currentTarget: HTMLTextAreaElement;
234
- }) => void;
235
+ }) => void | Promise<void>;
235
236
  handleDrop: (event: DragEvent) => void;
236
237
  };
237
238
  export {};
@@ -28,6 +28,7 @@ type ClipboardParams = Parameters<typeof createEditorClipboardController>[0];
28
28
  export interface EditorInteractionWiringContext {
29
29
  clipboardActions?: EditorClipboardActions;
30
30
  state: EditorState;
31
+ getStateSnapshot: () => EditorState;
31
32
  applyState: NavigationParams["applyState"];
32
33
  applyTransactionalState: TextDragParams["applyTransactionalState"];
33
34
  isReadOnly: TextDragParams["isReadOnly"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.372",
3
+ "version": "0.0.374",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {