@elaraai/east-ui 0.0.1-beta.21 → 0.0.1-beta.23

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.
@@ -1,172 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Elara AI Pty Ltd
3
- * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
- */
5
- import type { PlatformFunction, EastIR } from "@elaraai/east/internal";
6
- /**
7
- * Store interface for UI state management.
8
- *
9
- * @remarks
10
- * State is stored as Beast2-encoded Uint8Array values, allowing any East type to be stored.
11
- * Provides reactive subscriptions, batching, and garbage collection.
12
- */
13
- export interface UIStoreInterface {
14
- /** Read a Beast2-encoded value from the store */
15
- read(key: string): Uint8Array | undefined;
16
- /** Write a Beast2-encoded value to the store */
17
- write(key: string, value: Uint8Array | undefined): void;
18
- /** Check if a key exists in the store */
19
- has(key: string): boolean;
20
- /** Subscribe to all state changes, returns unsubscribe function */
21
- subscribe(callback: () => void): () => void;
22
- /** Subscribe to a specific key, returns unsubscribe function */
23
- subscribe(key: string, callback: () => void): () => void;
24
- /** Batch multiple writes together for single notification */
25
- batch<T>(fn: () => T): T;
26
- /** Mark a key as active during render (for garbage collection) */
27
- markActive(key: string): void;
28
- /** Called at start of render cycle */
29
- beginRender(): void;
30
- /** Called at end of render cycle - removes orphaned keys */
31
- endRender(): void;
32
- /** Get snapshot version for React's useSyncExternalStore */
33
- getSnapshot(): number;
34
- /** Get current state for debugging */
35
- getState(): Map<string, Uint8Array>;
36
- /** Set the notification scheduler (for deferred notifications in React) */
37
- setScheduler(scheduler: ((notify: () => void) => void) | undefined): void;
38
- /** Get version number for a specific key (for reactive component subscriptions) */
39
- getKeyVersion(key: string): number;
40
- }
41
- /**
42
- * Options for creating a UIStore.
43
- */
44
- export interface UIStoreOptions {
45
- /** Initial state as a Map of string keys to Beast2-encoded blobs */
46
- initialState?: Map<string, Uint8Array> | undefined;
47
- /**
48
- * Optional scheduler for deferred notifications.
49
- * If provided, flush notifications will be deferred using this function.
50
- * If not provided, notifications happen synchronously.
51
- *
52
- * For React, use queueMicrotask to avoid "setState during render" errors:
53
- * @example
54
- * ```ts
55
- * const store = new UIStore({
56
- * scheduleNotify: (fn) => queueMicrotask(fn)
57
- * });
58
- * ```
59
- */
60
- scheduleNotify?: (notify: () => void) => void;
61
- }
62
- /**
63
- * Reactive state store for East UI applications.
64
- *
65
- * @remarks
66
- * Combines state management, function registration, and React integration:
67
- * - State stored as Beast2-encoded blobs
68
- * - Batched writes for performance
69
- * - Key-specific and global subscriptions
70
- * - Garbage collection for orphaned keys
71
- * - Function registration with automatic re-execution
72
- *
73
- * @example
74
- * ```ts
75
- * import { UIStore, State } from "@elaraai/east-ui";
76
- *
77
- * // Use the singleton store via State.Implementation
78
- * const compiled = counterFn.toIR().compile(State.Implementation);
79
- *
80
- * // Or create a custom store for isolation
81
- * const store = new UIStore();
82
- * ```
83
- */
84
- export declare class UIStore implements UIStoreInterface {
85
- private state;
86
- private registrations;
87
- private keySubscribers;
88
- private globalSubscribers;
89
- private activeKeys;
90
- private previousActiveKeys;
91
- private version;
92
- private batchDepth;
93
- private changedKeys;
94
- private scheduleNotify?;
95
- private keyVersions;
96
- constructor(options?: UIStoreOptions);
97
- read(key: string): Uint8Array | undefined;
98
- write(key: string, value: Uint8Array | undefined): void;
99
- has(key: string): boolean;
100
- subscribe(callback: () => void): () => void;
101
- subscribe(key: string, callback: () => void): () => void;
102
- batch<T>(fn: () => T): T;
103
- markActive(key: string): void;
104
- beginRender(): void;
105
- endRender(): void;
106
- getSnapshot(): number;
107
- getState(): Map<string, Uint8Array>;
108
- /**
109
- * Register an East function for reactive execution.
110
- *
111
- * @remarks
112
- * The function will be compiled and executed immediately with current state.
113
- * When state changes, it will be re-executed automatically.
114
- *
115
- * @param id - Unique identifier for this registration
116
- * @param ir - The East IR to compile and register
117
- * @param platform - Platform functions to use for compilation
118
- */
119
- register(id: string, ir: EastIR<[Map<string, Uint8Array>], unknown>, platform: PlatformFunction[]): void;
120
- /**
121
- * Get the last result of a registered function.
122
- *
123
- * @param id - The registration identifier
124
- * @returns The last computed result, or undefined if not registered
125
- */
126
- getResult(id: string): unknown;
127
- /**
128
- * Get all active keys (for debugging).
129
- */
130
- getActiveKeys(): Set<string>;
131
- /**
132
- * Set the notification scheduler.
133
- * Call this to enable deferred notifications (e.g., for React integration).
134
- *
135
- * @param scheduler - Function to schedule deferred notifications, or undefined for synchronous
136
- */
137
- setScheduler(scheduler: ((notify: () => void) => void) | undefined): void;
138
- /**
139
- * Get version number for a specific key.
140
- *
141
- * @remarks
142
- * Used by reactive components to create a snapshot that only changes
143
- * when their specific dependencies change, enabling selective re-rendering.
144
- *
145
- * @param key - The state key to get the version for
146
- * @returns The version number (increments on each write), or 0 if never written
147
- */
148
- getKeyVersion(key: string): number;
149
- private flushScheduled;
150
- private flush;
151
- private doFlush;
152
- }
153
- /**
154
- * Create a new UIStore with optional initial state.
155
- *
156
- * @param initialState - Optional initial state as a plain object
157
- * @returns A new UIStore instance
158
- *
159
- * @example
160
- * ```ts
161
- * import { createUIStore } from "@elaraai/east-ui";
162
- * import { encodeBeast2For } from "@elaraai/east/internal";
163
- * import { IntegerType, StringType } from "@elaraai/east";
164
- *
165
- * const store = createUIStore({
166
- * count: encodeBeast2For(IntegerType)(0n),
167
- * name: encodeBeast2For(StringType)("Alice"),
168
- * });
169
- * ```
170
- */
171
- export declare function createUIStore(initialState?: Record<string, Uint8Array>): UIStore;
172
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/platform/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC7B,iDAAiD;IACjD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAA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AAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,aAAa,IAAI,GAAG,CAAC,MAAM,CAAC;IAI5B;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI;IAIzE;;;;;;;;;OASG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,OAAO;CAyBlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,OAAO,CAIhF"}
@@ -1,246 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Elara AI Pty Ltd
3
- * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
- */
5
- import { BlobType, equalFor } from "@elaraai/east";
6
- const blobEqual = equalFor(BlobType);
7
- /**
8
- * Reactive state store for East UI applications.
9
- *
10
- * @remarks
11
- * Combines state management, function registration, and React integration:
12
- * - State stored as Beast2-encoded blobs
13
- * - Batched writes for performance
14
- * - Key-specific and global subscriptions
15
- * - Garbage collection for orphaned keys
16
- * - Function registration with automatic re-execution
17
- *
18
- * @example
19
- * ```ts
20
- * import { UIStore, State } from "@elaraai/east-ui";
21
- *
22
- * // Use the singleton store via State.Implementation
23
- * const compiled = counterFn.toIR().compile(State.Implementation);
24
- *
25
- * // Or create a custom store for isolation
26
- * const store = new UIStore();
27
- * ```
28
- */
29
- export class UIStore {
30
- state;
31
- registrations = new Map();
32
- keySubscribers = new Map();
33
- globalSubscribers = new Set();
34
- activeKeys = new Set();
35
- previousActiveKeys = new Set();
36
- version = 0;
37
- batchDepth = 0;
38
- changedKeys = new Set();
39
- scheduleNotify;
40
- keyVersions = new Map();
41
- constructor(options) {
42
- this.state = options?.initialState ?? new Map();
43
- this.scheduleNotify = options?.scheduleNotify;
44
- }
45
- read(key) {
46
- this.markActive(key);
47
- return this.state.get(key);
48
- }
49
- write(key, value) {
50
- // Check if value actually changed to avoid infinite loops
51
- const existing = this.state.get(key);
52
- const isEqual = value === undefined
53
- ? existing === undefined
54
- : existing !== undefined && blobEqual(existing, value);
55
- if (isEqual)
56
- return; // No change, skip update
57
- if (value === undefined) {
58
- this.state.delete(key);
59
- }
60
- else {
61
- this.state.set(key, value);
62
- }
63
- this.changedKeys.add(key);
64
- // Increment key version for reactive subscriptions
65
- const currentVersion = this.keyVersions.get(key) ?? 0;
66
- this.keyVersions.set(key, currentVersion + 1);
67
- if (this.batchDepth === 0) {
68
- this.flush();
69
- }
70
- }
71
- has(key) {
72
- return this.state.has(key);
73
- }
74
- subscribe(keyOrCallback, callback) {
75
- if (typeof keyOrCallback === "function") {
76
- // Global subscription
77
- this.globalSubscribers.add(keyOrCallback);
78
- return () => this.globalSubscribers.delete(keyOrCallback);
79
- }
80
- else {
81
- // Key-specific subscription
82
- const key = keyOrCallback;
83
- const cb = callback;
84
- let subs = this.keySubscribers.get(key);
85
- if (!subs) {
86
- subs = new Set();
87
- this.keySubscribers.set(key, subs);
88
- }
89
- subs.add(cb);
90
- return () => {
91
- subs.delete(cb);
92
- if (subs.size === 0) {
93
- this.keySubscribers.delete(key);
94
- }
95
- };
96
- }
97
- }
98
- batch(fn) {
99
- this.batchDepth++;
100
- try {
101
- return fn();
102
- }
103
- finally {
104
- this.batchDepth--;
105
- if (this.batchDepth === 0) {
106
- this.flush();
107
- }
108
- }
109
- }
110
- markActive(key) {
111
- this.activeKeys.add(key);
112
- }
113
- beginRender() {
114
- this.previousActiveKeys = this.activeKeys;
115
- this.activeKeys = new Set();
116
- }
117
- endRender() {
118
- for (const key of this.previousActiveKeys) {
119
- if (!this.activeKeys.has(key)) {
120
- this.state.delete(key);
121
- }
122
- }
123
- }
124
- getSnapshot() {
125
- return this.version;
126
- }
127
- getState() {
128
- return new Map(this.state);
129
- }
130
- /**
131
- * Register an East function for reactive execution.
132
- *
133
- * @remarks
134
- * The function will be compiled and executed immediately with current state.
135
- * When state changes, it will be re-executed automatically.
136
- *
137
- * @param id - Unique identifier for this registration
138
- * @param ir - The East IR to compile and register
139
- * @param platform - Platform functions to use for compilation
140
- */
141
- register(id, ir, platform) {
142
- const compiled = ir.compile(platform);
143
- const result = compiled(this.state);
144
- this.registrations.set(id, { compiled, lastResult: result });
145
- }
146
- /**
147
- * Get the last result of a registered function.
148
- *
149
- * @param id - The registration identifier
150
- * @returns The last computed result, or undefined if not registered
151
- */
152
- getResult(id) {
153
- return this.registrations.get(id)?.lastResult;
154
- }
155
- /**
156
- * Get all active keys (for debugging).
157
- */
158
- getActiveKeys() {
159
- return new Set(this.activeKeys);
160
- }
161
- /**
162
- * Set the notification scheduler.
163
- * Call this to enable deferred notifications (e.g., for React integration).
164
- *
165
- * @param scheduler - Function to schedule deferred notifications, or undefined for synchronous
166
- */
167
- setScheduler(scheduler) {
168
- this.scheduleNotify = scheduler;
169
- }
170
- /**
171
- * Get version number for a specific key.
172
- *
173
- * @remarks
174
- * Used by reactive components to create a snapshot that only changes
175
- * when their specific dependencies change, enabling selective re-rendering.
176
- *
177
- * @param key - The state key to get the version for
178
- * @returns The version number (increments on each write), or 0 if never written
179
- */
180
- getKeyVersion(key) {
181
- return this.keyVersions.get(key) ?? 0;
182
- }
183
- flushScheduled = false;
184
- flush() {
185
- if (this.changedKeys.size === 0)
186
- return;
187
- if (this.scheduleNotify) {
188
- // Defer notifications to avoid "setState during render" errors
189
- if (!this.flushScheduled) {
190
- this.flushScheduled = true;
191
- this.scheduleNotify(() => this.doFlush());
192
- }
193
- }
194
- else {
195
- // Synchronous flush (no scheduler provided)
196
- this.doFlush();
197
- }
198
- }
199
- doFlush() {
200
- this.flushScheduled = false;
201
- if (this.changedKeys.size === 0)
202
- return;
203
- // Increment version so useSyncExternalStore triggers re-render
204
- this.version++;
205
- // Re-execute all registered functions
206
- for (const [, reg] of this.registrations) {
207
- reg.lastResult = reg.compiled(this.state);
208
- }
209
- // Notify key-specific subscribers
210
- for (const key of this.changedKeys) {
211
- const subs = this.keySubscribers.get(key);
212
- if (subs) {
213
- for (const cb of subs)
214
- cb();
215
- }
216
- }
217
- // Notify global subscribers
218
- for (const cb of this.globalSubscribers)
219
- cb();
220
- this.changedKeys.clear();
221
- }
222
- }
223
- /**
224
- * Create a new UIStore with optional initial state.
225
- *
226
- * @param initialState - Optional initial state as a plain object
227
- * @returns A new UIStore instance
228
- *
229
- * @example
230
- * ```ts
231
- * import { createUIStore } from "@elaraai/east-ui";
232
- * import { encodeBeast2For } from "@elaraai/east/internal";
233
- * import { IntegerType, StringType } from "@elaraai/east";
234
- *
235
- * const store = createUIStore({
236
- * count: encodeBeast2For(IntegerType)(0n),
237
- * name: encodeBeast2For(StringType)("Alice"),
238
- * });
239
- * ```
240
- */
241
- export function createUIStore(initialState) {
242
- return new UIStore({
243
- initialState: initialState ? new Map(Object.entries(initialState)) : undefined,
244
- });
245
- }
246
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/platform/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEnD,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,OAAO;IACR,KAAK,CAA0B;IAC/B,aAAa,GAA8B,IAAI,GAAG,EAAE,CAAC;IACrD,cAAc,GAAiC,IAAI,GAAG,EAAE,CAAC;IACzD,iBAAiB,GAAoB,IAAI,GAAG,EAAE,CAAC;IAC/C,UAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;IACpC,kBAAkB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC5C,OAAO,GAAW,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