@ikonai/sdk-ui 0.0.41 → 0.0.43

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk-ui",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/ui-store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ParsedUiUpdate, UiNode, UiStoreSnapshot } from './ui-types';
2
- import { UiStoreOp, UiStreamSnapshotWire } from './ui-store-ops';
3
1
  import { HandlerCache } from './handler-cache';
2
+ import { UiStoreOp, UiStreamSnapshotWire } from './ui-store-ops';
3
+ import { ParsedUiUpdate, UiNode, UiStoreSnapshot } from './ui-types';
4
4
  type StreamListener = (streamId: string) => void;
5
5
  type StoreListener = () => void;
6
6
  export interface StreamSnapshot extends UiStoreSnapshot {
package/ui-types.d.ts CHANGED
@@ -15,11 +15,41 @@ export interface TextDelta {
15
15
  readonly end?: number;
16
16
  readonly insertedText: string;
17
17
  }
18
+ export interface ChildInsertOp {
19
+ readonly index: number;
20
+ readonly node: UiNode;
21
+ }
22
+ export interface ChildMoveOp {
23
+ readonly nodeId: string;
24
+ readonly fromIndex: number;
25
+ readonly toIndex: number;
26
+ }
27
+ export interface ChildRemoveOp {
28
+ readonly nodeId: string;
29
+ readonly index: number;
30
+ }
31
+ /**
32
+ * Flat representation of changes to a single node.
33
+ * Only includes properties that have actual changes.
34
+ */
35
+ export interface NodeChange {
36
+ readonly nodeId: string;
37
+ readonly inserts?: readonly ChildInsertOp[];
38
+ readonly moves?: readonly ChildMoveOp[];
39
+ readonly removals?: readonly ChildRemoveOp[];
40
+ readonly changedProps?: ReadonlyMap<string, unknown>;
41
+ readonly textUpdates?: readonly TextDelta[];
42
+ readonly styleIds?: readonly string[];
43
+ }
44
+ /**
45
+ * @deprecated Use NodeChange instead. Kept for backwards compatibility.
46
+ */
18
47
  export interface UiNodeDiff {
19
48
  readonly id: string;
20
49
  readonly type: string;
21
- readonly added: readonly UiNode[];
22
- readonly removed: readonly string[];
50
+ readonly inserts: readonly ChildInsertOp[];
51
+ readonly moves: readonly ChildMoveOp[];
52
+ readonly removals: readonly ChildRemoveOp[];
23
53
  readonly updated: readonly UiNodeDiff[];
24
54
  readonly changedProps: ReadonlyMap<string, unknown>;
25
55
  readonly textUpdates: readonly TextDelta[];
@@ -68,7 +98,7 @@ export interface UiFullSnapshot extends UiSnapshotBase {
68
98
  }
69
99
  export interface UiDiffSnapshot extends UiSnapshotBase {
70
100
  readonly type: 'diff';
71
- readonly diff: UiNodeDiff;
101
+ readonly changes: readonly NodeChange[];
72
102
  }
73
103
  export type UiSnapshot = UiFullSnapshot | UiDiffSnapshot;
74
104
  export interface ParsedUiUpdate {