@ai-matrx/content-ir-react 0.24.1 → 0.24.2

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/dist/index.d.cts CHANGED
@@ -511,8 +511,9 @@ declare function useRecordValues(read: RecordReader | undefined, ref: DirectiveR
511
511
  *
512
512
  * Contract (the db-row component contract, SHAPE_SYSTEM.md):
513
513
  * - `component_source` compiles to a React component receiving
514
- * `{ data, kind, config, runAction, onResolve?, uiOptions? }` where `data`
515
- * is the kind instance value.
514
+ * `{ data, kind, config, runAction, itemState?, onResolve?, uiOptions? }`
515
+ * where `data` is the kind instance value and `itemState` what actions
516
+ * saved onto this item.
516
517
  * - `props_transform` (optional) compiles to a `(data) => data` function
517
518
  * applied to the value BEFORE it reaches the component. A throwing or
518
519
  * non-compiling transform screams and the untransformed value is used
@@ -579,6 +580,13 @@ interface DbKindComponentRenderProps {
579
580
  onResolve?: ResolveKindValue;
580
581
  /** Settings the mounting surface dictates (e.g. `{ selectionMode: "single" }`). */
581
582
  uiOptions?: KindComponentUiOptions;
583
+ /**
584
+ * This item's durable state: what `save_item_state` / `run_shortcut` with
585
+ * `saveAs` wrote onto it (`{}` when nothing yet; survives reload). The host
586
+ * adds `src` to every saved image ref (`{ file_id, mime_type, width, height }`)
587
+ * so the component renders `<img src={itemState.key.src}>`.
588
+ */
589
+ itemState?: Record<string, unknown>;
582
590
  }
583
591
  interface CompiledDbKindComponent {
584
592
  Component: react.ComponentType<DbKindComponentRenderProps>;
package/dist/index.d.ts CHANGED
@@ -511,8 +511,9 @@ declare function useRecordValues(read: RecordReader | undefined, ref: DirectiveR
511
511
  *
512
512
  * Contract (the db-row component contract, SHAPE_SYSTEM.md):
513
513
  * - `component_source` compiles to a React component receiving
514
- * `{ data, kind, config, runAction, onResolve?, uiOptions? }` where `data`
515
- * is the kind instance value.
514
+ * `{ data, kind, config, runAction, itemState?, onResolve?, uiOptions? }`
515
+ * where `data` is the kind instance value and `itemState` what actions
516
+ * saved onto this item.
516
517
  * - `props_transform` (optional) compiles to a `(data) => data` function
517
518
  * applied to the value BEFORE it reaches the component. A throwing or
518
519
  * non-compiling transform screams and the untransformed value is used
@@ -579,6 +580,13 @@ interface DbKindComponentRenderProps {
579
580
  onResolve?: ResolveKindValue;
580
581
  /** Settings the mounting surface dictates (e.g. `{ selectionMode: "single" }`). */
581
582
  uiOptions?: KindComponentUiOptions;
583
+ /**
584
+ * This item's durable state: what `save_item_state` / `run_shortcut` with
585
+ * `saveAs` wrote onto it (`{}` when nothing yet; survives reload). The host
586
+ * adds `src` to every saved image ref (`{ file_id, mime_type, width, height }`)
587
+ * so the component renders `<img src={itemState.key.src}>`.
588
+ */
589
+ itemState?: Record<string, unknown>;
582
590
  }
583
591
  interface CompiledDbKindComponent {
584
592
  Component: react.ComponentType<DbKindComponentRenderProps>;