oasis-editor 0.0.371 → 0.0.373

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,10 @@
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 function writeOpaqueChartToken(state: EditorState, transfer: DataTransfer): boolean;
10
+ export declare function readOpaqueChartToken(token: string): OpaqueTransferManifest | undefined;
@@ -0,0 +1,11 @@
1
+ import { EditorState } from '../../core/model.js';
2
+ import { OpaqueTransferManifest } from '../../ooxml/word/opaqueTransferManifest.js';
3
+ /** Capture from a single selected original chart. No clipboard API yet. */
4
+ export declare function captureSelectedOpaqueChart(state: EditorState): OpaqueTransferManifest;
5
+ /** Prepare an asynchronous, immutable editor transaction, not an immediate
6
+ * mutation. The caller MUST compare the current state to the captured input
7
+ * before committing the returned state as a single undoable transaction.
8
+ * No native clipboard, arbitrary selection replacement or collaboration yet.
9
+ * Rebase onto a privately staged, audited source snapshot, retaining model IDs.
10
+ */
11
+ export declare function prepareOpaqueChartPaste(state: EditorState, manifest: unknown): Promise<EditorState>;
@@ -1,8 +1,11 @@
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;
@@ -26,7 +29,7 @@ declare function createEditorClipboardControllerImpl(deps: EditorClipboardDeps):
26
29
  }) => void;
27
30
  handlePaste: (event: ClipboardEvent & {
28
31
  currentTarget: HTMLTextAreaElement;
29
- }) => void;
32
+ }) => void | Promise<void>;
30
33
  handleDrop: (event: DragEvent) => void;
31
34
  };
32
35
  export {};