@almadar/ui 5.135.0 → 5.137.0

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,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { ResolvedEntity, EventPayload, EntityRow, OrbitalSchema, BusEventSource, SExpr, ResolvedTrait, ResolvedTraitBinding } from '@almadar/core';
3
+ import { ResolvedEntity, EventPayload, EntityRow, OrbitalSchema, BusEventSource, SExpr, ResolvedTrait, ResolvedTraitBinding, TraitConfig } from '@almadar/core';
4
4
  import { AnyPatternConfig } from '@almadar/core/patterns';
5
5
 
6
6
  /**
@@ -238,4 +238,32 @@ declare function useTraitContext(): TraitContextValue;
238
238
  */
239
239
  declare function useTrait(traitName: string): TraitInstance | undefined;
240
240
 
241
- export { type EntitySchemaContextValue as E, type SendEventResult as S, TraitContext as T, EntitySchemaProvider as a, type EntitySchemaProviderProps as b, type ServerBridgeContextValue as c, ServerBridgeProvider as d, type ServerBridgeProviderProps as e, type ServerBridgeTransport as f, type ServerClientEffect as g, type ServerResponseMeta as h, type TraitContextValue as i, type TraitInstance as j, TraitProvider as k, type TraitProviderProps as l, useEntitySchemaOptional as m, useServerBridge as n, useTrait as o, useTraitContext as p, useEntitySchema as u };
241
+ /**
242
+ * Read + subscribe surface over the live trait binding stores. Snapshots
243
+ * are cached objects — a new reference only when the trait's entity
244
+ * actually changed (the `useSyncExternalStore` contract).
245
+ */
246
+ interface EntityBindingSource {
247
+ /** Current entity snapshot for a trait (shared-entity traits read the shared store). */
248
+ getEntitySnapshot: (traitName: string) => EntityRow;
249
+ /** Merged render-time config (declared defaults < resolved < call-site). */
250
+ getConfig: (traitName: string) => TraitConfig | undefined;
251
+ /** Current state-machine state — evaluation context for `@state` in marked expressions. */
252
+ getState: (traitName: string) => string;
253
+ /** Subscribe to entity commits for a trait. Returns unsubscribe. */
254
+ subscribe: (traitName: string, callback: () => void) => () => void;
255
+ }
256
+ declare const EntityBindingContext: React.Context<EntityBindingSource | null>;
257
+ /**
258
+ * Bridge one trait's live bindings into React. With no provider (compiled
259
+ * shell, static renders) or no owning trait, returns empty bindings and
260
+ * never re-renders — markers resolve to the same `undefined` they would
261
+ * have resolved to at flush time against an empty entity.
262
+ */
263
+ declare function useEntityBindingSnapshot(traitName: string | undefined): {
264
+ entity: EntityRow;
265
+ config: TraitConfig | undefined;
266
+ state: string;
267
+ };
268
+
269
+ export { EntityBindingContext as E, type SendEventResult as S, TraitContext as T, type EntityBindingSource as a, type EntitySchemaContextValue as b, EntitySchemaProvider as c, type EntitySchemaProviderProps as d, type ServerBridgeContextValue as e, ServerBridgeProvider as f, type ServerBridgeProviderProps as g, type ServerBridgeTransport as h, type ServerClientEffect as i, type ServerResponseMeta as j, type TraitContextValue as k, type TraitInstance as l, TraitProvider as m, type TraitProviderProps as n, useEntitySchema as o, useEntitySchemaOptional as p, useServerBridge as q, useTrait as r, useTraitContext as s, useEntityBindingSnapshot as u };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { ResolvedEntity, EventPayload, EntityRow, OrbitalSchema, BusEventSource, SExpr, ResolvedTrait, ResolvedTraitBinding } from '@almadar/core';
3
+ import { ResolvedEntity, EventPayload, EntityRow, OrbitalSchema, BusEventSource, SExpr, ResolvedTrait, ResolvedTraitBinding, TraitConfig } from '@almadar/core';
4
4
  import { AnyPatternConfig } from '@almadar/core/patterns';
5
5
 
6
6
  /**
@@ -238,4 +238,32 @@ declare function useTraitContext(): TraitContextValue;
238
238
  */
239
239
  declare function useTrait(traitName: string): TraitInstance | undefined;
240
240
 
241
- export { type EntitySchemaContextValue as E, type SendEventResult as S, TraitContext as T, EntitySchemaProvider as a, type EntitySchemaProviderProps as b, type ServerBridgeContextValue as c, ServerBridgeProvider as d, type ServerBridgeProviderProps as e, type ServerBridgeTransport as f, type ServerClientEffect as g, type ServerResponseMeta as h, type TraitContextValue as i, type TraitInstance as j, TraitProvider as k, type TraitProviderProps as l, useEntitySchemaOptional as m, useServerBridge as n, useTrait as o, useTraitContext as p, useEntitySchema as u };
241
+ /**
242
+ * Read + subscribe surface over the live trait binding stores. Snapshots
243
+ * are cached objects — a new reference only when the trait's entity
244
+ * actually changed (the `useSyncExternalStore` contract).
245
+ */
246
+ interface EntityBindingSource {
247
+ /** Current entity snapshot for a trait (shared-entity traits read the shared store). */
248
+ getEntitySnapshot: (traitName: string) => EntityRow;
249
+ /** Merged render-time config (declared defaults < resolved < call-site). */
250
+ getConfig: (traitName: string) => TraitConfig | undefined;
251
+ /** Current state-machine state — evaluation context for `@state` in marked expressions. */
252
+ getState: (traitName: string) => string;
253
+ /** Subscribe to entity commits for a trait. Returns unsubscribe. */
254
+ subscribe: (traitName: string, callback: () => void) => () => void;
255
+ }
256
+ declare const EntityBindingContext: React.Context<EntityBindingSource | null>;
257
+ /**
258
+ * Bridge one trait's live bindings into React. With no provider (compiled
259
+ * shell, static renders) or no owning trait, returns empty bindings and
260
+ * never re-renders — markers resolve to the same `undefined` they would
261
+ * have resolved to at flush time against an empty entity.
262
+ */
263
+ declare function useEntityBindingSnapshot(traitName: string | undefined): {
264
+ entity: EntityRow;
265
+ config: TraitConfig | undefined;
266
+ state: string;
267
+ };
268
+
269
+ export { EntityBindingContext as E, type SendEventResult as S, TraitContext as T, type EntityBindingSource as a, type EntitySchemaContextValue as b, EntitySchemaProvider as c, type EntitySchemaProviderProps as d, type ServerBridgeContextValue as e, ServerBridgeProvider as f, type ServerBridgeProviderProps as g, type ServerBridgeTransport as h, type ServerClientEffect as i, type ServerResponseMeta as j, type TraitContextValue as k, type TraitInstance as l, TraitProvider as m, type TraitProviderProps as n, useEntitySchema as o, useEntitySchemaOptional as p, useServerBridge as q, useTrait as r, useTraitContext as s, useEntityBindingSnapshot as u };