@ikonai/sdk-react-ui 1.0.66 → 1.0.68

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.
@@ -76,6 +76,18 @@ export interface UseIkonAppOptions {
76
76
  * When false, proxy types are excluded.
77
77
  */
78
78
  proxy?: boolean;
79
+ /**
80
+ * Live snapshot: persist the last rendered UI to `localStorage` and re-seed it on the next load so
81
+ * the cached tree paints before the WebSocket connects (return-visit fast paint). Default: true.
82
+ * Keyed per app + user and pruned across users on a shared device.
83
+ */
84
+ liveSnapshot?: boolean;
85
+ /**
86
+ * Boot snapshot: seed the build-time `boot-snapshot.json` (present when the app was bundled with
87
+ * `--snapshot`) before the WebSocket connects, for instant first paint on a first visit. Default:
88
+ * true. Set false to skip both the prefetch and the seed.
89
+ */
90
+ bootSnapshot?: boolean;
79
91
  }
80
92
  /**
81
93
  * Result returned by the useIkonApp hook.
@@ -132,6 +144,13 @@ export interface UseIkonAppResult {
132
144
  * Whether the connection is ready to render UI.
133
145
  */
134
146
  isReady: boolean;
147
+ /**
148
+ * True once the live server UI is displayed — i.e. the first live UI update has replaced the
149
+ * seeded pre-render (boot snapshot or live snapshot) and the connection is not
150
+ * offline. Stays false while only the instant pre-render is on screen. Also exposed on the
151
+ * document element as `data-ikon-live`.
152
+ */
153
+ isLive: boolean;
135
154
  /**
136
155
  * True when the backend asked the client to display the platform branding banner (set for
137
156
  * low-tier app creators by the connect handshake). Defaults to false until connected.
package/ikon-ui.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import { IkonClient } from '../../sdk/src/index.ts';
2
- import { IkonUiCore, IkonUiStreamListener, UiStyleListener, UiStyleDeleteListener, UiStylePayload } from '../../sdk-ui/src/index.ts';
2
+ import { IkonUiCore, IkonUiCoreConfig, IkonUiStreamListener, IkonUiUpdateListener, UiStyleListener, UiStyleDeleteListener, UiStylePayload } from '../../sdk-ui/src/index.ts';
3
3
  import { IkonUiStoreEntry } from './surface';
4
4
  export interface IkonUiConfig {
5
5
  client?: IkonClient | null;
6
6
  core?: IkonUiCore;
7
+ /** Live snapshot config, forwarded to the owned IkonUiCore. Ignored when `core` is supplied. */
8
+ liveSnapshot?: IkonUiCoreConfig['liveSnapshot'];
9
+ /** Boot snapshot toggle, forwarded to the owned IkonUiCore. Ignored when `core` is supplied. */
10
+ bootSnapshot?: IkonUiCoreConfig['bootSnapshot'];
7
11
  }
8
12
  type IkonUiListener = IkonUiStreamListener;
9
13
  export declare class IkonUi {
@@ -18,6 +22,7 @@ export declare class IkonUi {
18
22
  getStores(): ReadonlyMap<string, IkonUiStoreEntry>;
19
23
  getUiStyles(): readonly UiStylePayload[];
20
24
  subscribe(listener: IkonUiListener): () => void;
25
+ subscribeToUiUpdates(listener: IkonUiUpdateListener): () => void;
21
26
  subscribeToStyles(listener: UiStyleListener): () => void;
22
27
  subscribeToStyleDeletes(listener: UiStyleDeleteListener): () => void;
23
28
  private handleUiStreamCleared;