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.
@@ -0,0 +1,18 @@
1
+ import { EditorState } from '../../core/model.js';
2
+ import { OpaqueTransferManifest } from '../../ooxml/word/opaqueTransferManifest.js';
3
+ /** Native clipboard carries ONLY an unpredictable handle, not raw XML or
4
+ * workbook bytes. A single bounded in-memory record is shared by editor
5
+ * instances in this module's realm. Never hydrate a manifest from an external
6
+ * clipboard. Cross-tab/reload/other-app transfer requires a later trust design.
7
+ */
8
+ export declare const OPAQUE_CHART_CLIPBOARD_TYPE = "application/x-oasis-chart-token";
9
+ export declare const OPAQUE_CHART_WEB_TYPE: string;
10
+ export declare function isOpaqueChartClipboardType(type: string): boolean;
11
+ /** Prepare the copy synchronously in the user gesture. Only a confirmed
12
+ * write publishes the manifest. Superseded asynchronous writes never revive it. */
13
+ export declare function stageOpaqueChartToken(state: EditorState): {
14
+ token: string;
15
+ confirm: () => boolean;
16
+ };
17
+ export declare function writeOpaqueChartToken(state: EditorState, transfer: DataTransfer): boolean;
18
+ export declare function readOpaqueChartToken(token: string): OpaqueTransferManifest | undefined;
@@ -1,12 +1,17 @@
1
- import { ClipboardPasteMode } from '../../ui/app/clipboardPaste.js';
1
+ import { ClipboardIssue, ClipboardPasteMode } from '../../ui/app/clipboardPaste.js';
2
2
  import { EditorPosition, EditorState } from '../../core/model.js';
3
3
  import { EditorTransactionOptions } from '../../ui/editorHistory.js';
4
4
  export interface EditorClipboardDeps {
5
5
  state: () => EditorState;
6
+ /** Actual committed state, never the reactive facade. Required for async opaque paste. */
7
+ stateSnapshot?: () => EditorState;
8
+ onNativeClipboardIssue?: (action: "copy" | "cut" | "paste", issue: ClipboardIssue) => void;
6
9
  isReadOnly: () => boolean;
7
10
  forcePlainTextPaste: () => boolean;
8
11
  consumePasteMode?: () => ClipboardPasteMode | undefined;
9
12
  onNativeClipboardSuccess?: () => void;
13
+ onNativeClipboardStart?: () => void;
14
+ clipboardRequestGeneration?: () => number;
10
15
  setForcePlainTextPaste: (value: boolean) => void;
11
16
  clearPreferredColumn: () => void;
12
17
  resetTransactionGrouping: () => void;
@@ -26,7 +31,7 @@ declare function createEditorClipboardControllerImpl(deps: EditorClipboardDeps):
26
31
  }) => void;
27
32
  handlePaste: (event: ClipboardEvent & {
28
33
  currentTarget: HTMLTextAreaElement;
29
- }) => void;
34
+ }) => void | Promise<void>;
30
35
  handleDrop: (event: DragEvent) => void;
31
36
  };
32
37
  export {};