@ikonai/sdk-react-ui 1.0.67 → 1.0.69

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.
@@ -77,11 +77,17 @@ export interface UseIkonAppOptions {
77
77
  */
78
78
  proxy?: boolean;
79
79
  /**
80
- * Persist the last rendered UI to `localStorage` and re-seed it on the next load so the cached
81
- * tree paints before the WebSocket connects (return-visit fast paint). Default: true. The cache
82
- * is keyed per app + user and pruned across users on a shared device.
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
83
  */
84
- uiCache?: boolean;
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;
85
91
  }
86
92
  /**
87
93
  * Result returned by the useIkonApp hook.
@@ -138,6 +144,13 @@ export interface UseIkonAppResult {
138
144
  * Whether the connection is ready to render UI.
139
145
  */
140
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;
141
154
  /**
142
155
  * True when the backend asked the client to display the platform branding banner (set for
143
156
  * low-tier app creators by the connect handshake). Defaults to false until connected.
package/ikon-ui.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { IkonClient } from '../../sdk/src/index.ts';
2
- import { IkonUiCore, IkonUiCoreConfig, 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
- /** Last-snapshot cache config, forwarded to the owned IkonUiCore. Ignored when `core` is supplied. */
8
- cache?: IkonUiCoreConfig['cache'];
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'];
9
11
  }
10
12
  type IkonUiListener = IkonUiStreamListener;
11
13
  export declare class IkonUi {
@@ -20,6 +22,7 @@ export declare class IkonUi {
20
22
  getStores(): ReadonlyMap<string, IkonUiStoreEntry>;
21
23
  getUiStyles(): readonly UiStylePayload[];
22
24
  subscribe(listener: IkonUiListener): () => void;
25
+ subscribeToUiUpdates(listener: IkonUiUpdateListener): () => void;
23
26
  subscribeToStyles(listener: UiStyleListener): () => void;
24
27
  subscribeToStyleDeletes(listener: UiStyleDeleteListener): () => void;
25
28
  private handleUiStreamCleared;