fika-editor 3.6.7 → 3.6.9

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.
@@ -101,6 +101,8 @@ export interface FikaCommandResult<TData = unknown> {
101
101
  commandId?: string;
102
102
  type: FikaCommandType;
103
103
  changed: boolean;
104
+ /** Actual changed/inserted/deleted/reordered slide ids; absent on no-ops and rollbacks. */
105
+ changedSlideIds?: string[];
104
106
  documentVersion: number;
105
107
  snapshotId?: number;
106
108
  data?: TData;
@@ -2,5 +2,18 @@ import type { PPTElement } from '../types/slides';
2
2
  export { applyLiveLayoutOntoStore } from './liveLayoutCommit';
3
3
  export declare const commitAllLiveEditors: () => void;
4
4
  export declare const commitAuthoritativeEditors: typeof commitAllLiveEditors;
5
- /** Flush the active editor, then persist live layout onto store-owned elements. */
6
- export declare const commitSlideElements: (liveList: PPTElement[]) => PPTElement[];
5
+ /** The slide a gesture edits and its elements when the pointer went down. */
6
+ export interface SlideCommitBase {
7
+ slideId: string;
8
+ elements: PPTElement[];
9
+ }
10
+ /** Capture at gesture start; pass to `commitSlideElements` at gesture end. */
11
+ export declare const captureSlideCommitBase: () => SlideCommitBase | undefined;
12
+ /**
13
+ * Flush the active editor, then persist live layout onto store-owned elements.
14
+ *
15
+ * With a `base`, the commit lands on the slide the gesture started on, even if
16
+ * the host switched slides meanwhile. Returns the element list the canvas
17
+ * should show now: the CURRENT slide's.
18
+ */
19
+ export declare const commitSlideElements: (liveList: PPTElement[], base?: SlideCommitBase) => PPTElement[];
@@ -1,2 +1,3 @@
1
1
  import type { PPTElement } from '../types/slides';
2
+ export declare const mergeGestureLayout: (liveList: PPTElement[], base: PPTElement[], store: PPTElement[], foreignIds: ReadonlySet<string>) => PPTElement[];
2
3
  export declare const applyLiveLayoutOntoStore: (liveList: PPTElement[], storeList: PPTElement[]) => PPTElement[];
@@ -0,0 +1,11 @@
1
+ import type { Slide } from '../types/slides';
2
+ /**
3
+ * Element ids must be unique across a deck: lookups by id (editor commits,
4
+ * agent commands without a slideId) take the first match. Decks saved while a
5
+ * gesture could commit one slide's element list onto another carry whole
6
+ * slides of repeated ids. Later repeats get a slide-scoped id (deterministic,
7
+ * so reloading the same saved deck yields the same ids), and references inside
8
+ * that slide (frames, animations, notes) follow. Returns `slides` itself when
9
+ * nothing collides.
10
+ */
11
+ export declare function repairDuplicateElementIds(slides: Slide[]): Slide[];
@@ -109,6 +109,7 @@ interface FikaCommandResult<TData = unknown> {
109
109
  commandId?: string
110
110
  type: FikaCommandType
111
111
  changed: boolean
112
+ changedSlideIds?: string[]
112
113
  documentVersion: number
113
114
  snapshotId?: number
114
115
  data?: TData
@@ -134,6 +135,8 @@ Result rules:
134
135
  - `commandId` mirrors the incoming command `id`.
135
136
  - `type` always mirrors the incoming command `type`.
136
137
  - `changed` is true only when the command changed document or view state and was not a dry run.
138
+ - Reapplying an already-applied patch succeeds with `changed: false`; it does not create an undo snapshot or advance the document version. A successful no-op is not a reason to retry.
139
+ - `changedSlideIds` identifies slides whose stored content or position actually changed, including inserted or deleted slides. Hosts should use these ids when capturing edits made without an explicit `slideId`.
137
140
  - `documentVersion` increments after successful, non-dry-run changed commands.
138
141
  - `snapshotId` is present only when that command created its own history snapshot.
139
142
  - `data` contains the command-specific return payload, usually the updated model object or current bridge state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fika-editor",
3
- "version": "3.6.7",
3
+ "version": "3.6.9",
4
4
  "description": "Fika presentation editor embed bundle with a typed agentic bridge.",
5
5
  "type": "module",
6
6
  "main": "dist/embed/fika-embed.js",