@ankhorage/runtime 5.4.0 → 5.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/runtime
2
2
 
3
+ ## 5.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d0a8625: Update dependencies: `@ankhorage/contracts`.
8
+
9
+ ## 5.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - c78ddc8: Emit browser-consumable JavaScript without raw JSX in published artifacts.
14
+
3
15
  ## 5.4.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/runtime
5
5
 
6
- ![license: MIT](./paradox/badges/license.svg) ![npm: v5.4.0](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
6
+ ![license: MIT](./paradox/badges/license.svg) ![npm: v5.4.2](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
7
7
 
8
8
  Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.
9
9
 
@@ -24,28 +24,17 @@ createRuntimeManifest({
24
24
  });
25
25
  ```
26
26
 
27
- ## Generated documentation
28
-
29
- - [Interactive documentation app](./paradox/index.html)
30
- - [Public API reference](./paradox/exports.md)
31
- - [Component registry](./paradox/components.md)
32
- - [Architecture overview](./paradox/diagrams/architecture-overview.mmd)
33
- - [Module relationships](./paradox/diagrams/module-relationships.mmd)
34
- - [Export graph](./paradox/diagrams/export-graph.mmd)
35
- - [applyRuntimeBindingDataPath sequence](./paradox/diagrams/sequences/apply-runtime-binding-data-path.mmd)
36
- - [createComponentEventFromHandlerArgs sequence](./paradox/diagrams/sequences/create-component-event-from-handler-args.mmd)
37
- - [createRuntimeEventOperationBindingContext sequence](./paradox/diagrams/sequences/create-runtime-event-operation-binding-context.mmd)
38
- - [createRuntimeScreenLoaderRequestKey sequence](./paradox/diagrams/sequences/create-runtime-screen-loader-request-key.mmd)
39
- - [executeRuntimeBindingInvocation sequence](./paradox/diagrams/sequences/execute-runtime-binding-invocation.mmd)
40
- - [mergeRuntimeRendererConfig sequence](./paradox/diagrams/sequences/merge-runtime-renderer-config.mmd)
41
- - [resolveBindingInputMap sequence](./paradox/diagrams/sequences/resolve-binding-input-map.mmd)
42
- - [resolveBindingInputMapSync sequence](./paradox/diagrams/sequences/resolve-binding-input-map-sync.mmd)
43
- - [resolveRuntimeContextCapability sequence](./paradox/diagrams/sequences/resolve-runtime-context-capability.mmd)
44
- - [RuntimeRendererConfigProvider sequence](./paradox/diagrams/sequences/runtime-renderer-config-provider.mmd)
45
- - [RuntimeScreen sequence](./paradox/diagrams/sequences/runtime-screen.mmd)
46
- - [useManifest sequence](./paradox/diagrams/sequences/use-manifest.mmd)
47
- - [useManifestContext sequence](./paradox/diagrams/sequences/use-manifest-context.mmd)
48
- - [useOptionalManifestContext sequence](./paradox/diagrams/sequences/use-optional-manifest-context.mmd)
49
- - [useRuntimeRendererConfig sequence](./paradox/diagrams/sequences/use-runtime-renderer-config.mmd)
50
- - [useRuntimeScreenOperationLoaders sequence](./paradox/diagrams/sequences/use-runtime-screen-operation-loaders.mmd)
51
- - [wrapRuntimeEventProps sequence](./paradox/diagrams/sequences/wrap-runtime-event-props.mmd)
27
+ ## Documentation
28
+
29
+ Open `paradox/index.html` locally in your browser to browse the complete documentation.
30
+
31
+ ## Contributors
32
+
33
+ <!-- readme: contributors -start -->
34
+ <!-- readme: contributors -end -->
35
+
36
+ ## Donation
37
+
38
+ If this project is useful to you, you can support its continued development.
39
+
40
+ [Support @ankhorage](https://github.com/sponsors/ankhorage)
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import React, { createContext, use } from 'react';
2
3
  import { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter';
3
4
  export const ManifestContext = createContext(null);
@@ -6,9 +7,7 @@ export function ManifestProvider(props) {
6
7
  const { manifest, activeScreenId, onScreenChange, stateAdapter: injectedStateAdapter, children, } = props;
7
8
  const fallbackStateAdapter = React.useMemo(() => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined), [manifest.state?.provider]);
8
9
  const stateAdapter = injectedStateAdapter ?? fallbackStateAdapter;
9
- return (<ManifestContext value={{ manifest, activeScreenId, onScreenChange, stateAdapter }}>
10
- {children}
11
- </ManifestContext>);
10
+ return (_jsx(ManifestContext, { value: { manifest, activeScreenId, onScreenChange, stateAdapter }, children: children }));
12
11
  }
13
12
  /*** Returns the active application manifest from the owning Runtime provider. */
14
13
  export function useManifest() {
@@ -1 +1 @@
1
- {"version":3,"file":"ManifestContext.js","sourceRoot":"","sources":["../src/ManifestContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AASxE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA8B,IAAI,CAAC,CAAC;AAEhF,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,KAA2D;IAC1F,MAAM,EACJ,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EAAE,oBAAoB,EAClC,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CACxC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC7F,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC3B,CAAC;IACF,MAAM,YAAY,GAAG,oBAAoB,IAAI,oBAAoB,CAAC;IAElE,OAAO,CACL,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CACjF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,WAAW;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,0BAA0B;IACxC,OAAO,GAAG,CAAC,eAAe,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AppManifest, StateAdapter } from '@ankhorage/contracts';\nimport React, { createContext, use } from 'react';\n\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter';\n\nexport interface ManifestContextValue {\n manifest: AppManifest;\n activeScreenId?: string;\n onScreenChange?: (screenId: string) => void;\n stateAdapter?: StateAdapter;\n}\n\nexport const ManifestContext = createContext<ManifestContextValue | null>(null);\n\n/*** Owns one configured state adapter for every Runtime screen in an application tree. */\nexport function ManifestProvider(props: ManifestContextValue & { children: React.ReactNode }) {\n const {\n manifest,\n activeScreenId,\n onScreenChange,\n stateAdapter: injectedStateAdapter,\n children,\n } = props;\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter = injectedStateAdapter ?? fallbackStateAdapter;\n\n return (\n <ManifestContext value={{ manifest, activeScreenId, onScreenChange, stateAdapter }}>\n {children}\n </ManifestContext>\n );\n}\n\n/*** Returns the active application manifest from the owning Runtime provider. */\nexport function useManifest() {\n const context = use(ManifestContext);\n if (!context) {\n throw new Error('useManifest must be used within a ManifestProvider');\n }\n return context.manifest;\n}\n\n/*** Returns the active manifest scope, including its application-lifetime state adapter. */\nexport function useManifestContext() {\n const context = use(ManifestContext);\n if (!context) {\n throw new Error('useManifestContext must be used within a ManifestProvider');\n }\n return context;\n}\n\n/*** Reads an enclosing manifest scope without requiring hosts to provide one. */\nexport function useOptionalManifestContext() {\n return use(ManifestContext);\n}\n"]}
1
+ {"version":3,"file":"ManifestContext.js","sourceRoot":"","sources":["../src/ManifestContext.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AASxE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA8B,IAAI,CAAC,CAAC;AAEhF,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,KAA2D;IAC1F,MAAM,EACJ,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EAAE,oBAAoB,EAClC,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CACxC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC7F,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC3B,CAAC;IACF,MAAM,YAAY,GAAG,oBAAoB,IAAI,oBAAoB,CAAC;IAElE,OAAO,CACL,KAAC,eAAe,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAC/E,QAAQ,GACO,CACnB,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,WAAW;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,0BAA0B;IACxC,OAAO,GAAG,CAAC,eAAe,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AppManifest, StateAdapter } from '@ankhorage/contracts';\nimport React, { createContext, use } from 'react';\n\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter';\n\nexport interface ManifestContextValue {\n manifest: AppManifest;\n activeScreenId?: string;\n onScreenChange?: (screenId: string) => void;\n stateAdapter?: StateAdapter;\n}\n\nexport const ManifestContext = createContext<ManifestContextValue | null>(null);\n\n/*** Owns one configured state adapter for every Runtime screen in an application tree. */\nexport function ManifestProvider(props: ManifestContextValue & { children: React.ReactNode }) {\n const {\n manifest,\n activeScreenId,\n onScreenChange,\n stateAdapter: injectedStateAdapter,\n children,\n } = props;\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter = injectedStateAdapter ?? fallbackStateAdapter;\n\n return (\n <ManifestContext value={{ manifest, activeScreenId, onScreenChange, stateAdapter }}>\n {children}\n </ManifestContext>\n );\n}\n\n/*** Returns the active application manifest from the owning Runtime provider. */\nexport function useManifest() {\n const context = use(ManifestContext);\n if (!context) {\n throw new Error('useManifest must be used within a ManifestProvider');\n }\n return context.manifest;\n}\n\n/*** Returns the active manifest scope, including its application-lifetime state adapter. */\nexport function useManifestContext() {\n const context = use(ManifestContext);\n if (!context) {\n throw new Error('useManifestContext must be used within a ManifestProvider');\n }\n return context;\n}\n\n/*** Reads an enclosing manifest scope without requiring hosts to provide one. */\nexport function useOptionalManifestContext() {\n return use(ManifestContext);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import React from 'react';
2
3
  import { StyleSheet, Text, View } from 'react-native';
3
4
  import { getUnknownComponentDiagnostic, resolveRenderedChildren, resolveRuntimeRegistry, } from './rendering';
@@ -203,11 +204,7 @@ export function RuntimeRenderer(props) {
203
204
  : mediaResolvedProps;
204
205
  if (!Component) {
205
206
  const diagnostic = getUnknownComponentDiagnostic(node.type, effectiveRegistry);
206
- return (<View style={styles.errorBox}>
207
- <Text style={styles.errorTitle}>{diagnostic.title}</Text>
208
- <Text style={styles.errorText}>{diagnostic.suggestion}</Text>
209
- <Text style={styles.errorMeta}>{diagnostic.detail}</Text>
210
- </View>);
207
+ return (_jsxs(View, { style: styles.errorBox, children: [_jsx(Text, { style: styles.errorTitle, children: diagnostic.title }), _jsx(Text, { style: styles.errorText, children: diagnostic.suggestion }), _jsx(Text, { style: styles.errorMeta, children: diagnostic.detail })] }));
211
208
  }
212
209
  const repeatItems = repeatSyncResult?.status === 'ready' ? repeatSyncResult.items : currentAsyncRepeatResult?.items;
213
210
  const shouldRenderRepeatEmptyState = shouldRenderRuntimeRepeatEmptyState({
@@ -231,16 +228,16 @@ export function RuntimeRenderer(props) {
231
228
  index: itemIndex,
232
229
  keyPath: node.repeat?.keyPath,
233
230
  });
234
- return (<RuntimeRenderer key={`${child.id}:${String(repeatKey)}`} node={child} registry={effectiveRegistry} bindingContext={createRuntimeRepeatBindingContext({
231
+ return (_jsx(RuntimeRenderer, { node: child, registry: effectiveRegistry, bindingContext: createRuntimeRepeatBindingContext({
235
232
  baseContext: effectiveConfig.bindingContext,
236
233
  item,
237
234
  itemAlias,
238
- })}/>);
235
+ }) }, `${child.id}:${String(repeatKey)}`));
239
236
  }))
240
237
  : shouldRenderRepeatEmptyState
241
- ? node.repeat.empty?.map((child) => (<RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry}/>))
238
+ ? node.repeat.empty?.map((child) => (_jsx(RuntimeRenderer, { node: child, registry: effectiveRegistry }, child.id)))
242
239
  : undefined
243
- : node.children?.map((child) => (<RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry}/>));
240
+ : node.children?.map((child) => (_jsx(RuntimeRenderer, { node: child, registry: effectiveRegistry }, child.id)));
244
241
  const propsWithEvents = wrapRuntimeEventProps({
245
242
  context: effectiveConfig.bindingContext,
246
243
  dataBindings: effectiveConfig.dataBindings,
@@ -255,15 +252,11 @@ export function RuntimeRenderer(props) {
255
252
  propChildren: propsWithEvents.children,
256
253
  renderedChildren,
257
254
  });
258
- let content = <Component {...propsWithEvents}>{componentChildren}</Component>;
255
+ let content = _jsx(Component, { ...propsWithEvents, children: componentChildren });
259
256
  if (effectiveConfig.wrapNode) {
260
257
  content = effectiveConfig.wrapNode({ node, rendered: content, isRoot });
261
258
  }
262
- return (<RuntimeMediaResolutionCacheProvider value={mediaResolutionCache}>
263
- <RuntimeRendererConfigProvider value={explicitConfig}>
264
- {content}
265
- </RuntimeRendererConfigProvider>
266
- </RuntimeMediaResolutionCacheProvider>);
259
+ return (_jsx(RuntimeMediaResolutionCacheProvider, { value: mediaResolutionCache, children: _jsx(RuntimeRendererConfigProvider, { value: explicitConfig, children: content }) }));
267
260
  }
268
261
  const styles = StyleSheet.create({
269
262
  errorBox: {
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeRenderer.js","sourceRoot":"","sources":["../src/RuntimeRenderer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,yCAAyC,EACzC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAE7B,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,mCAAmC,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAqBpE,MAAM,UAAU,eAAe,CAAC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ACjC;IAAA,EAAE,mCAAmC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE;QACR,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX;IACD,UAAU,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,CAAC;KAChB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK;KAClB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAC","sourcesContent":["import type {\n BindingValue,\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { ComponentRegistry } from './registry';\nimport {\n getUnknownComponentDiagnostic,\n resolveRenderedChildren,\n resolveRuntimeRegistry,\n} from './rendering';\nimport {\n type RuntimeComponentEventDispatchArgs,\n type RuntimeEventCapabilityResolver,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry';\nimport type { RuntimeBindingResultCache, RuntimeCapabilityExecutor } from './runtimeBindings';\nimport { dispatchRuntimeComponentEventWithReporting } from './runtimeEventExecution';\nimport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n} from './runtimeEventOperationLifecycle';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia';\nimport {\n RuntimeMediaResolutionCacheProvider,\n useRuntimeMediaResolutionCache,\n} from './runtimeMediaCache';\nimport { resolveRuntimeNodeProps } from './runtimeNodeProps';\nimport {\n mergeRuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig';\nimport {\n createRuntimeRepeatBindingContext,\n resolveRuntimeRepeatItemKey,\n resolveRuntimeRepeatItemsAsync,\n resolveRuntimeRepeatItemsSync,\n} from './runtimeRepeat';\nimport { createRepeatDiagnosticsKey } from './runtimeRepeatDiagnostics';\nimport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState';\nimport { useRuntimeMediaProps } from './useRuntimeMediaProps';\nimport { useRuntimeStateBindings } from './useRuntimeStateBindings';\n\nexport interface RuntimeRendererProps {\n node: UiNode;\n isRoot?: boolean;\n registry?: ComponentRegistry;\n disableActions?: boolean;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n mediaAssets?: MediaAssetRegistry;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n resultSlots?: RuntimeBindingResultCache;\n executeCapability?: RuntimeCapabilityExecutor;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n}\n\nexport function RuntimeRenderer(props: RuntimeRendererProps) {\n const {\n node,\n isRoot = false,\n registry,\n disableActions = false,\n wrapNode,\n dbAdapter,\n dbRealtimeAdapter,\n stateAdapter,\n bindingContext,\n dataBindings,\n mediaAssets,\n resolveMediaAsset,\n resultSlots,\n executeCapability,\n resolveEventCapability,\n onDiagnostics,\n } = props;\n const inheritedConfig = useRuntimeRendererConfig();\n const [rootEventOperationState, setRootEventOperationState] = React.useState(\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n );\n const rootEventOperationLifecycle = React.useMemo(\n () => createRuntimeEventOperationLifecycle(setRootEventOperationState),\n [],\n );\n const eventOperationState = isRoot\n ? rootEventOperationState\n : inheritedConfig.eventOperationState;\n const rootBindingContext = React.useMemo(\n () =>\n mergeRuntimeRendererConfig(\n { bindingContext },\n { bindingContext: inheritedConfig.bindingContext },\n ).bindingContext,\n [bindingContext, inheritedConfig.bindingContext],\n );\n const effectiveBindingContext = React.useMemo(\n () =>\n isRoot && eventOperationState !== undefined\n ? createRuntimeEventOperationBindingContext(rootBindingContext, eventOperationState)\n : bindingContext,\n [bindingContext, eventOperationState, isRoot, rootBindingContext],\n );\n const mediaResolutionCache = useRuntimeMediaResolutionCache();\n const inheritedResultSlots = inheritedConfig.resultSlots;\n const [localResultSlots, setLocalResultSlots] = React.useState<RuntimeBindingResultCache>({});\n const writeLocalResultSlot = React.useCallback((key: string, value: BindingValue | undefined) => {\n setLocalResultSlots((currentResults) => ({\n ...currentResults,\n [key]: value,\n }));\n }, []);\n const effectiveResultSlots = React.useMemo(\n () => ({\n ...(inheritedResultSlots ?? {}),\n ...(resultSlots ?? {}),\n ...localResultSlots,\n }),\n [inheritedResultSlots, localResultSlots, resultSlots],\n );\n const explicitConfig = React.useMemo(\n () => ({\n bindingContext: effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeCapability,\n resolveEventCapability,\n mediaAssets,\n resultSlots: effectiveResultSlots,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeResultSlot: inheritedConfig.writeResultSlot ?? writeLocalResultSlot,\n eventOperationLifecycle: isRoot\n ? rootEventOperationLifecycle\n : inheritedConfig.eventOperationLifecycle,\n eventOperationState,\n }),\n [\n effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeCapability,\n resolveEventCapability,\n effectiveResultSlots,\n inheritedConfig.writeResultSlot,\n inheritedConfig.eventOperationLifecycle,\n isRoot,\n mediaAssets,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeLocalResultSlot,\n eventOperationState,\n rootEventOperationLifecycle,\n ],\n );\n const effectiveConfig = React.useMemo(\n () => mergeRuntimeRendererConfig(explicitConfig, inheritedConfig),\n [explicitConfig, inheritedConfig],\n );\n useRuntimeStateBindings({\n dataBindings: effectiveConfig.dataBindings,\n nodeId: node.id,\n repeatSource: node.repeat?.source,\n stateAdapter: effectiveConfig.stateAdapter,\n });\n const dispatchRuntimeEvent = React.useCallback(\n async (eventArgs: RuntimeComponentEventDispatchArgs) => {\n await dispatchRuntimeComponentEventWithReporting({\n ...eventArgs,\n dataBindings: eventArgs.dataBindings ?? effectiveConfig.dataBindings,\n executeCapability: eventArgs.executeCapability ?? effectiveConfig.executeCapability,\n onDiagnostics: effectiveConfig.onDiagnostics,\n resultSlots: eventArgs.resultSlots ?? effectiveConfig.resultSlots,\n writeResultSlot: eventArgs.writeResultSlot ?? effectiveConfig.writeResultSlot,\n eventOperationLifecycle:\n eventArgs.eventOperationLifecycle ?? effectiveConfig.eventOperationLifecycle,\n });\n },\n [effectiveConfig],\n );\n const effectiveRegistry = React.useMemo(\n () =>\n resolveRuntimeRegistry({\n propRegistry: registry,\n configRegistry: effectiveConfig.registry,\n }),\n [effectiveConfig.registry, registry],\n );\n const Component = effectiveRegistry[node.type];\n\n const repeatSyncResult = (() => {\n const { repeat } = node;\n if (!repeat) {\n return null;\n }\n\n return resolveRuntimeRepeatItemsSync(repeat, {\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeCapability: effectiveConfig.executeCapability,\n node,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n writeResultSlot: effectiveConfig.writeResultSlot,\n });\n })();\n const repeatRequest = React.useMemo(\n () =>\n node.repeat && repeatSyncResult?.status === 'pending'\n ? {\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeCapability: effectiveConfig.executeCapability,\n node,\n repeat: node.repeat,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n writeResultSlot: effectiveConfig.writeResultSlot,\n }\n : null,\n [\n node,\n repeatSyncResult?.status,\n effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeCapability,\n effectiveConfig.resultSlots,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeResultSlot,\n ],\n );\n const repeatRequestToken = React.useMemo(() => (repeatRequest ? {} : null), [repeatRequest]);\n const [asyncRepeatResult, setAsyncRepeatResult] = React.useState<{\n readonly requestToken: object;\n readonly items: readonly BindingValue[];\n readonly diagnostics: readonly DataSourceDiagnostic[];\n } | null>(null);\n const repeatRequestIdRef = React.useRef(0);\n const lastRepeatDiagnosticsKeyRef = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n repeatRequestIdRef.current += 1;\n const requestId = repeatRequestIdRef.current;\n if (repeatRequest === null || repeatRequestToken === null) {\n return undefined;\n }\n\n void (async () => {\n const result = await resolveRuntimeRepeatItemsAsync(repeatRequest.repeat, {\n context: repeatRequest.context,\n dataBindings: repeatRequest.dataBindings,\n executeCapability: repeatRequest.executeCapability,\n node: repeatRequest.node,\n resultSlots: repeatRequest.resultSlots,\n stateAdapter: repeatRequest.stateAdapter,\n writeResultSlot: repeatRequest.writeResultSlot,\n });\n\n if (repeatRequestIdRef.current !== requestId) {\n return;\n }\n\n setAsyncRepeatResult({ ...result, requestToken: repeatRequestToken });\n })();\n\n return () => {\n repeatRequestIdRef.current += 1;\n };\n }, [repeatRequest, repeatRequestToken]);\n const currentAsyncRepeatResult =\n asyncRepeatResult?.requestToken === repeatRequestToken ? asyncRepeatResult : null;\n const repeatDiagnostics =\n repeatSyncResult?.status === 'ready'\n ? repeatSyncResult.diagnostics\n : currentAsyncRepeatResult?.diagnostics;\n\n React.useEffect(() => {\n if (!node.repeat || repeatDiagnostics === undefined) {\n return;\n }\n\n const diagnosticsKey = createRepeatDiagnosticsKey(node.id, repeatDiagnostics);\n if (lastRepeatDiagnosticsKeyRef.current === diagnosticsKey) {\n return;\n }\n\n lastRepeatDiagnosticsKeyRef.current = diagnosticsKey;\n effectiveConfig.onDiagnostics?.(repeatDiagnostics);\n }, [effectiveConfig, node, repeatDiagnostics]);\n\n const bindingResolvedProps = resolveRuntimeNodeProps({\n bindingContext: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n dbAdapter: effectiveConfig.dbAdapter,\n dbRealtimeAdapter: effectiveConfig.dbRealtimeAdapter,\n node,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n });\n const mediaResolvedProps = useRuntimeMediaProps({\n cache: mediaResolutionCache,\n mediaAssets: effectiveConfig.mediaAssets,\n props: bindingResolvedProps,\n resolveMediaAsset: effectiveConfig.resolveMediaAsset,\n });\n const resolvedProps = effectiveConfig.resolveNodeProps\n ? effectiveConfig.resolveNodeProps({ node, props: mediaResolvedProps })\n : mediaResolvedProps;\n\n if (!Component) {\n const diagnostic = getUnknownComponentDiagnostic(node.type, effectiveRegistry);\n return (\n <View style={styles.errorBox}>\n <Text style={styles.errorTitle}>{diagnostic.title}</Text>\n <Text style={styles.errorText}>{diagnostic.suggestion}</Text>\n <Text style={styles.errorMeta}>{diagnostic.detail}</Text>\n </View>\n );\n }\n\n const repeatItems =\n repeatSyncResult?.status === 'ready' ? repeatSyncResult.items : currentAsyncRepeatResult?.items;\n const shouldRenderRepeatEmptyState = shouldRenderRuntimeRepeatEmptyState({\n diagnostics: repeatDiagnostics,\n items: repeatItems,\n status:\n repeatSyncResult?.status === 'ready'\n ? 'ready'\n : repeatSyncResult?.status === 'pending'\n ? 'pending'\n : currentAsyncRepeatResult\n ? 'ready'\n : undefined,\n });\n const renderedChildren = node.repeat\n ? repeatItems && repeatItems.length > 0\n ? repeatItems.flatMap((item, itemIndex) =>\n (node.children ?? []).map((child) => {\n const itemAlias = node.repeat?.itemAlias ?? 'item';\n const repeatKey = resolveRuntimeRepeatItemKey({\n item,\n itemAlias,\n index: itemIndex,\n keyPath: node.repeat?.keyPath,\n });\n\n return (\n <RuntimeRenderer\n key={`${child.id}:${String(repeatKey)}`}\n node={child}\n registry={effectiveRegistry}\n bindingContext={createRuntimeRepeatBindingContext({\n baseContext: effectiveConfig.bindingContext,\n item,\n itemAlias,\n })}\n />\n );\n }),\n )\n : shouldRenderRepeatEmptyState\n ? node.repeat.empty?.map((child) => (\n <RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry} />\n ))\n : undefined\n : node.children?.map((child) => (\n <RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry} />\n ));\n\n const propsWithEvents = wrapRuntimeEventProps({\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n props: resolvedProps,\n disableActions: effectiveConfig.disableActions === true,\n dispatchComponentEvent: dispatchRuntimeEvent,\n node,\n resultSlots: effectiveConfig.resultSlots,\n resolveEventCapability: effectiveConfig.resolveEventCapability,\n });\n\n const componentChildren = resolveRenderedChildren({\n propChildren: propsWithEvents.children as React.ReactNode,\n renderedChildren,\n });\n\n let content: React.ReactNode = <Component {...propsWithEvents}>{componentChildren}</Component>;\n if (effectiveConfig.wrapNode) {\n content = effectiveConfig.wrapNode({ node, rendered: content, isRoot });\n }\n\n return (\n <RuntimeMediaResolutionCacheProvider value={mediaResolutionCache}>\n <RuntimeRendererConfigProvider value={explicitConfig}>\n {content}\n </RuntimeRendererConfigProvider>\n </RuntimeMediaResolutionCacheProvider>\n );\n}\n\nconst styles = StyleSheet.create({\n errorBox: {\n borderColor: '#ef4444',\n borderRadius: 8,\n borderWidth: 1,\n margin: 8,\n padding: 8,\n },\n errorTitle: {\n color: '#991b1b',\n fontSize: 13,\n fontWeight: '700',\n marginBottom: 4,\n },\n errorText: {\n color: '#ef4444',\n fontWeight: '600',\n },\n errorMeta: {\n color: '#7f1d1d',\n fontSize: 12,\n marginTop: 4,\n },\n});\n"]}
1
+ {"version":3,"file":"RuntimeRenderer.js","s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oB;QAC5C,IAAI;QACJ,WAAW,EAAE,eAAe,CAAC,WAAW;QACxC,sBAAsB,EAAE,eAAe,CAAC,sBAAsB;KAC/D,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;QAChD,YAAY,EAAE,eAAe,CAAC,QAA2B;QACzD,gBAAgB;KACjB,CAAC,CAAC;IAEH,IAAI,OAAO,GAAoB,KAAC,SAAS,OAAK,eAAe,YAAG,iBAAiB,GAAa,CAAC;IAC/F,IAAI,eAAe,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,CACL,KAAC,mCAAmC,IAAC,KAAK,EAAE,oBAAoB,YAC9D,KAAC,6BAA6B,IAAC,KAAK,EAAE,cAAc,YACjD,OAAO,GACsB,GACI,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE;QACR,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX;IACD,UAAU,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,CAAC;KAChB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK;KAClB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAC","sourcesContent":["import type {\n BindingValue,\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { ComponentRegistry } from './registry';\nimport {\n getUnknownComponentDiagnostic,\n resolveRenderedChildren,\n resolveRuntimeRegistry,\n} from './rendering';\nimport {\n type RuntimeComponentEventDispatchArgs,\n type RuntimeEventCapabilityResolver,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry';\nimport type { RuntimeBindingResultCache, RuntimeCapabilityExecutor } from './runtimeBindings';\nimport { dispatchRuntimeComponentEventWithReporting } from './runtimeEventExecution';\nimport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n} from './runtimeEventOperationLifecycle';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia';\nimport {\n RuntimeMediaResolutionCacheProvider,\n useRuntimeMediaResolutionCache,\n} from './runtimeMediaCache';\nimport { resolveRuntimeNodeProps } from './runtimeNodeProps';\nimport {\n mergeRuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig';\nimport {\n createRuntimeRepeatBindingContext,\n resolveRuntimeRepeatItemKey,\n resolveRuntimeRepeatItemsAsync,\n resolveRuntimeRepeatItemsSync,\n} from './runtimeRepeat';\nimport { createRepeatDiagnosticsKey } from './runtimeRepeatDiagnostics';\nimport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState';\nimport { useRuntimeMediaProps } from './useRuntimeMediaProps';\nimport { useRuntimeStateBindings } from './useRuntimeStateBindings';\n\nexport interface RuntimeRendererProps {\n node: UiNode;\n isRoot?: boolean;\n registry?: ComponentRegistry;\n disableActions?: boolean;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n mediaAssets?: MediaAssetRegistry;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n resultSlots?: RuntimeBindingResultCache;\n executeCapability?: RuntimeCapabilityExecutor;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n}\n\nexport function RuntimeRenderer(props: RuntimeRendererProps) {\n const {\n node,\n isRoot = false,\n registry,\n disableActions = false,\n wrapNode,\n dbAdapter,\n dbRealtimeAdapter,\n stateAdapter,\n bindingContext,\n dataBindings,\n mediaAssets,\n resolveMediaAsset,\n resultSlots,\n executeCapability,\n resolveEventCapability,\n onDiagnostics,\n } = props;\n const inheritedConfig = useRuntimeRendererConfig();\n const [rootEventOperationState, setRootEventOperationState] = React.useState(\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n );\n const rootEventOperationLifecycle = React.useMemo(\n () => createRuntimeEventOperationLifecycle(setRootEventOperationState),\n [],\n );\n const eventOperationState = isRoot\n ? rootEventOperationState\n : inheritedConfig.eventOperationState;\n const rootBindingContext = React.useMemo(\n () =>\n mergeRuntimeRendererConfig(\n { bindingContext },\n { bindingContext: inheritedConfig.bindingContext },\n ).bindingContext,\n [bindingContext, inheritedConfig.bindingContext],\n );\n const effectiveBindingContext = React.useMemo(\n () =>\n isRoot && eventOperationState !== undefined\n ? createRuntimeEventOperationBindingContext(rootBindingContext, eventOperationState)\n : bindingContext,\n [bindingContext, eventOperationState, isRoot, rootBindingContext],\n );\n const mediaResolutionCache = useRuntimeMediaResolutionCache();\n const inheritedResultSlots = inheritedConfig.resultSlots;\n const [localResultSlots, setLocalResultSlots] = React.useState<RuntimeBindingResultCache>({});\n const writeLocalResultSlot = React.useCallback((key: string, value: BindingValue | undefined) => {\n setLocalResultSlots((currentResults) => ({\n ...currentResults,\n [key]: value,\n }));\n }, []);\n const effectiveResultSlots = React.useMemo(\n () => ({\n ...(inheritedResultSlots ?? {}),\n ...(resultSlots ?? {}),\n ...localResultSlots,\n }),\n [inheritedResultSlots, localResultSlots, resultSlots],\n );\n const explicitConfig = React.useMemo(\n () => ({\n bindingContext: effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeCapability,\n resolveEventCapability,\n mediaAssets,\n resultSlots: effectiveResultSlots,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeResultSlot: inheritedConfig.writeResultSlot ?? writeLocalResultSlot,\n eventOperationLifecycle: isRoot\n ? rootEventOperationLifecycle\n : inheritedConfig.eventOperationLifecycle,\n eventOperationState,\n }),\n [\n effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeCapability,\n resolveEventCapability,\n effectiveResultSlots,\n inheritedConfig.writeResultSlot,\n inheritedConfig.eventOperationLifecycle,\n isRoot,\n mediaAssets,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeLocalResultSlot,\n eventOperationState,\n rootEventOperationLifecycle,\n ],\n );\n const effectiveConfig = React.useMemo(\n () => mergeRuntimeRendererConfig(explicitConfig, inheritedConfig),\n [explicitConfig, inheritedConfig],\n );\n useRuntimeStateBindings({\n dataBindings: effectiveConfig.dataBindings,\n nodeId: node.id,\n repeatSource: node.repeat?.source,\n stateAdapter: effectiveConfig.stateAdapter,\n });\n const dispatchRuntimeEvent = React.useCallback(\n async (eventArgs: RuntimeComponentEventDispatchArgs) => {\n await dispatchRuntimeComponentEventWithReporting({\n ...eventArgs,\n dataBindings: eventArgs.dataBindings ?? effectiveConfig.dataBindings,\n executeCapability: eventArgs.executeCapability ?? effectiveConfig.executeCapability,\n onDiagnostics: effectiveConfig.onDiagnostics,\n resultSlots: eventArgs.resultSlots ?? effectiveConfig.resultSlots,\n writeResultSlot: eventArgs.writeResultSlot ?? effectiveConfig.writeResultSlot,\n eventOperationLifecycle:\n eventArgs.eventOperationLifecycle ?? effectiveConfig.eventOperationLifecycle,\n });\n },\n [effectiveConfig],\n );\n const effectiveRegistry = React.useMemo(\n () =>\n resolveRuntimeRegistry({\n propRegistry: registry,\n configRegistry: effectiveConfig.registry,\n }),\n [effectiveConfig.registry, registry],\n );\n const Component = effectiveRegistry[node.type];\n\n const repeatSyncResult = (() => {\n const { repeat } = node;\n if (!repeat) {\n return null;\n }\n\n return resolveRuntimeRepeatItemsSync(repeat, {\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeCapability: effectiveConfig.executeCapability,\n node,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n writeResultSlot: effectiveConfig.writeResultSlot,\n });\n })();\n const repeatRequest = React.useMemo(\n () =>\n node.repeat && repeatSyncResult?.status === 'pending'\n ? {\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeCapability: effectiveConfig.executeCapability,\n node,\n repeat: node.repeat,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n writeResultSlot: effectiveConfig.writeResultSlot,\n }\n : null,\n [\n node,\n repeatSyncResult?.status,\n effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeCapability,\n effectiveConfig.resultSlots,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeResultSlot,\n ],\n );\n const repeatRequestToken = React.useMemo(() => (repeatRequest ? {} : null), [repeatRequest]);\n const [asyncRepeatResult, setAsyncRepeatResult] = React.useState<{\n readonly requestToken: object;\n readonly items: readonly BindingValue[];\n readonly diagnostics: readonly DataSourceDiagnostic[];\n } | null>(null);\n const repeatRequestIdRef = React.useRef(0);\n const lastRepeatDiagnosticsKeyRef = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n repeatRequestIdRef.current += 1;\n const requestId = repeatRequestIdRef.current;\n if (repeatRequest === null || repeatRequestToken === null) {\n return undefined;\n }\n\n void (async () => {\n const result = await resolveRuntimeRepeatItemsAsync(repeatRequest.repeat, {\n context: repeatRequest.context,\n dataBindings: repeatRequest.dataBindings,\n executeCapability: repeatRequest.executeCapability,\n node: repeatRequest.node,\n resultSlots: repeatRequest.resultSlots,\n stateAdapter: repeatRequest.stateAdapter,\n writeResultSlot: repeatRequest.writeResultSlot,\n });\n\n if (repeatRequestIdRef.current !== requestId) {\n return;\n }\n\n setAsyncRepeatResult({ ...result, requestToken: repeatRequestToken });\n })();\n\n return () => {\n repeatRequestIdRef.current += 1;\n };\n }, [repeatRequest, repeatRequestToken]);\n const currentAsyncRepeatResult =\n asyncRepeatResult?.requestToken === repeatRequestToken ? asyncRepeatResult : null;\n const repeatDiagnostics =\n repeatSyncResult?.status === 'ready'\n ? repeatSyncResult.diagnostics\n : currentAsyncRepeatResult?.diagnostics;\n\n React.useEffect(() => {\n if (!node.repeat || repeatDiagnostics === undefined) {\n return;\n }\n\n const diagnosticsKey = createRepeatDiagnosticsKey(node.id, repeatDiagnostics);\n if (lastRepeatDiagnosticsKeyRef.current === diagnosticsKey) {\n return;\n }\n\n lastRepeatDiagnosticsKeyRef.current = diagnosticsKey;\n effectiveConfig.onDiagnostics?.(repeatDiagnostics);\n }, [effectiveConfig, node, repeatDiagnostics]);\n\n const bindingResolvedProps = resolveRuntimeNodeProps({\n bindingContext: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n dbAdapter: effectiveConfig.dbAdapter,\n dbRealtimeAdapter: effectiveConfig.dbRealtimeAdapter,\n node,\n resultSlots: effectiveConfig.resultSlots,\n stateAdapter: effectiveConfig.stateAdapter,\n });\n const mediaResolvedProps = useRuntimeMediaProps({\n cache: mediaResolutionCache,\n mediaAssets: effectiveConfig.mediaAssets,\n props: bindingResolvedProps,\n resolveMediaAsset: effectiveConfig.resolveMediaAsset,\n });\n const resolvedProps = effectiveConfig.resolveNodeProps\n ? effectiveConfig.resolveNodeProps({ node, props: mediaResolvedProps })\n : mediaResolvedProps;\n\n if (!Component) {\n const diagnostic = getUnknownComponentDiagnostic(node.type, effectiveRegistry);\n return (\n <View style={styles.errorBox}>\n <Text style={styles.errorTitle}>{diagnostic.title}</Text>\n <Text style={styles.errorText}>{diagnostic.suggestion}</Text>\n <Text style={styles.errorMeta}>{diagnostic.detail}</Text>\n </View>\n );\n }\n\n const repeatItems =\n repeatSyncResult?.status === 'ready' ? repeatSyncResult.items : currentAsyncRepeatResult?.items;\n const shouldRenderRepeatEmptyState = shouldRenderRuntimeRepeatEmptyState({\n diagnostics: repeatDiagnostics,\n items: repeatItems,\n status:\n repeatSyncResult?.status === 'ready'\n ? 'ready'\n : repeatSyncResult?.status === 'pending'\n ? 'pending'\n : currentAsyncRepeatResult\n ? 'ready'\n : undefined,\n });\n const renderedChildren = node.repeat\n ? repeatItems && repeatItems.length > 0\n ? repeatItems.flatMap((item, itemIndex) =>\n (node.children ?? []).map((child) => {\n const itemAlias = node.repeat?.itemAlias ?? 'item';\n const repeatKey = resolveRuntimeRepeatItemKey({\n item,\n itemAlias,\n index: itemIndex,\n keyPath: node.repeat?.keyPath,\n });\n\n return (\n <RuntimeRenderer\n key={`${child.id}:${String(repeatKey)}`}\n node={child}\n registry={effectiveRegistry}\n bindingContext={createRuntimeRepeatBindingContext({\n baseContext: effectiveConfig.bindingContext,\n item,\n itemAlias,\n })}\n />\n );\n }),\n )\n : shouldRenderRepeatEmptyState\n ? node.repeat.empty?.map((child) => (\n <RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry} />\n ))\n : undefined\n : node.children?.map((child) => (\n <RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry} />\n ));\n\n const propsWithEvents = wrapRuntimeEventProps({\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n props: resolvedProps,\n disableActions: effectiveConfig.disableActions === true,\n dispatchComponentEvent: dispatchRuntimeEvent,\n node,\n resultSlots: effectiveConfig.resultSlots,\n resolveEventCapability: effectiveConfig.resolveEventCapability,\n });\n\n const componentChildren = resolveRenderedChildren({\n propChildren: propsWithEvents.children as React.ReactNode,\n renderedChildren,\n });\n\n let content: React.ReactNode = <Component {...propsWithEvents}>{componentChildren}</Component>;\n if (effectiveConfig.wrapNode) {\n content = effectiveConfig.wrapNode({ node, rendered: content, isRoot });\n }\n\n return (\n <RuntimeMediaResolutionCacheProvider value={mediaResolutionCache}>\n <RuntimeRendererConfigProvider value={explicitConfig}>\n {content}\n </RuntimeRendererConfigProvider>\n </RuntimeMediaResolutionCacheProvider>\n );\n}\n\nconst styles = StyleSheet.create({\n errorBox: {\n borderColor: '#ef4444',\n borderRadius: 8,\n borderWidth: 1,\n margin: 8,\n padding: 8,\n },\n errorTitle: {\n color: '#991b1b',\n fontSize: 13,\n fontWeight: '700',\n marginBottom: 4,\n },\n errorText: {\n color: '#ef4444',\n fontWeight: '600',\n },\n errorMeta: {\n color: '#7f1d1d',\n fontSize: 12,\n marginTop: 4,\n },\n});\n"]}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import React, { createContext, use } from 'react';
2
3
  const EMPTY_RUNTIME_RENDERER_CONFIG = {};
3
4
  const RuntimeRendererConfigContext = createContext(EMPTY_RUNTIME_RENDERER_CONFIG);
@@ -53,7 +54,7 @@ export function RuntimeRendererConfigProvider(props) {
53
54
  const { value, children } = props;
54
55
  const inheritedConfig = use(RuntimeRendererConfigContext);
55
56
  const mergedConfig = mergeRuntimeRendererConfig(value, inheritedConfig);
56
- return (<RuntimeRendererConfigContext value={mergedConfig}>{children}</RuntimeRendererConfigContext>);
57
+ return (_jsx(RuntimeRendererConfigContext, { value: mergedConfig, children: children }));
57
58
  }
58
59
  export function useRuntimeRendererConfig() {
59
60
  return use(RuntimeRendererConfigContext);
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeRendererConfig.js","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA+ClD,MAAM,6BAA6B,GAA0B,EA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AC1D,MAAM,YAAY,GAAG,0BAA0B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAExE,OAAO,CACL,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,4BAA4B,CAAC,CAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CACxB,SAAuD,EACvD,KAAmD;IAEnD,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { RuntimeNodePropsResolver } from '@ankhorage/contracts/runtime';\nimport React, { createContext, use } from 'react';\n\nimport type { ComponentRegistry } from './registry';\nimport type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry';\nimport type {\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings';\nimport type {\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n} from './runtimeEventOperationLifecycle';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia';\n\nexport type {\n RuntimeNodePropsResolver,\n RuntimeResolveNodePropsArgs,\n} from '@ankhorage/contracts/runtime';\n\nexport interface RuntimeRendererWrapArgs {\n node: UiNode;\n rendered: React.ReactNode;\n isRoot: boolean;\n}\n\nexport interface RuntimeRendererConfig {\n disableActions?: boolean;\n registry?: ComponentRegistry;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n resolveNodeProps?: RuntimeNodePropsResolver;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n mediaAssets?: MediaAssetRegistry;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n resultSlots?: RuntimeBindingResultCache;\n writeResultSlot?: RuntimeBindingResultWriter;\n executeCapability?: RuntimeCapabilityExecutor;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n eventOperationState?: RuntimeEventOperationState;\n}\n\nconst EMPTY_RUNTIME_RENDERER_CONFIG: RuntimeRendererConfig = {};\n\nconst RuntimeRendererConfigContext = createContext<RuntimeRendererConfig>(\n EMPTY_RUNTIME_RENDERER_CONFIG,\n);\n\nexport function composeRuntimeRendererWrapNode(\n innerWrapNode?: RuntimeRendererConfig['wrapNode'],\n outerWrapNode?: RuntimeRendererConfig['wrapNode'],\n): RuntimeRendererConfig['wrapNode'] {\n if (!innerWrapNode) {\n return outerWrapNode;\n }\n\n if (!outerWrapNode) {\n return innerWrapNode;\n }\n\n return (args) => outerWrapNode({ ...args, rendered: innerWrapNode(args) });\n}\n\nexport function composeRuntimeNodePropsResolver(\n localResolver?: RuntimeRendererConfig['resolveNodeProps'],\n inheritedResolver?: RuntimeRendererConfig['resolveNodeProps'],\n): RuntimeRendererConfig['resolveNodeProps'] {\n if (!localResolver) {\n return inheritedResolver;\n }\n\n if (!inheritedResolver) {\n return localResolver;\n }\n\n return (args) => {\n const inheritedProps = inheritedResolver(args);\n return localResolver({ ...args, props: inheritedProps });\n };\n}\n\nexport function mergeRuntimeRendererConfig(\n localConfig: RuntimeRendererConfig | undefined,\n inheritedConfig: RuntimeRendererConfig | undefined,\n): RuntimeRendererConfig {\n if (!localConfig && !inheritedConfig) {\n return EMPTY_RUNTIME_RENDERER_CONFIG;\n }\n\n const bindingContext = mergeRecordConfig(\n inheritedConfig?.bindingContext,\n localConfig?.bindingContext,\n );\n const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);\n\n return {\n disableActions:\n localConfig?.disableActions === true || inheritedConfig?.disableActions === true,\n registry: localConfig?.registry ?? inheritedConfig?.registry,\n wrapNode: composeRuntimeRendererWrapNode(localConfig?.wrapNode, inheritedConfig?.wrapNode),\n resolveNodeProps: composeRuntimeNodePropsResolver(\n localConfig?.resolveNodeProps,\n inheritedConfig?.resolveNodeProps,\n ),\n resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,\n mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,\n dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,\n dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,\n stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,\n bindingContext,\n dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,\n resultSlots,\n writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,\n executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,\n resolveEventCapability:\n localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,\n onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,\n eventOperationLifecycle:\n localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,\n eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState,\n };\n}\n\nexport function RuntimeRendererConfigProvider(props: {\n value: RuntimeRendererConfig;\n children: React.ReactNode;\n}) {\n const { value, children } = props;\n const inheritedConfig = use(RuntimeRendererConfigContext);\n const mergedConfig = mergeRuntimeRendererConfig(value, inheritedConfig);\n\n return (\n <RuntimeRendererConfigContext value={mergedConfig}>{children}</RuntimeRendererConfigContext>\n );\n}\n\nexport function useRuntimeRendererConfig(): RuntimeRendererConfig {\n return use(RuntimeRendererConfigContext);\n}\n\nfunction mergeRecordConfig<TValue>(\n inherited: Readonly<Record<string, TValue>> | undefined,\n local: Readonly<Record<string, TValue>> | undefined,\n): Record<string, TValue> | undefined {\n if (!inherited && !local) return undefined;\n\n return {\n ...(inherited ?? {}),\n ...(local ?? {}),\n };\n}\n"]}
1
+ {"version":3,"file":"RuntimeRendererConfig.js","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA+ClD,MAAM,6BAA6B,GAA0B,EAAE,CAAC;AAEhE,MAAM,4BAA4B,GAAG,aAAa,CAChD,6BAA6B,CAC9B,CAAC;AAEF,MAAM,UAAU,8BAA8B,CAC5C,aAAiD,EACjD,aAAiD;IAEjD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,aAAyD,EACzD,iBAA6D;IAE7D,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,aAAa,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,c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EAAE,iBAAiB;QACvF,sBAAsB,EACpB,WAAW,EAAE,sBAAsB,IAAI,eAAe,EAAE,sBAAsB;QAChF,aAAa,EAAE,WAAW,EAAE,aAAa,IAAI,eAAe,EAAE,aAAa;QAC3E,uBAAuB,EACrB,WAAW,EAAE,uBAAuB,IAAI,eAAe,EAAE,uBAAuB;QAClF,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,IAAI,eAAe,EAAE,mBAAmB;KAC9F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,KAG7C;IACC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,eAAe,GAAG,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,0BAA0B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAExE,OAAO,CACL,KAAC,4BAA4B,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAgC,CAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CACxB,SAAuD,EACvD,KAAmD;IAEnD,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { RuntimeNodePropsResolver } from '@ankhorage/contracts/runtime';\nimport React, { createContext, use } from 'react';\n\nimport type { ComponentRegistry } from './registry';\nimport type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry';\nimport type {\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings';\nimport type {\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n} from './runtimeEventOperationLifecycle';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia';\n\nexport type {\n RuntimeNodePropsResolver,\n RuntimeResolveNodePropsArgs,\n} from '@ankhorage/contracts/runtime';\n\nexport interface RuntimeRendererWrapArgs {\n node: UiNode;\n rendered: React.ReactNode;\n isRoot: boolean;\n}\n\nexport interface RuntimeRendererConfig {\n disableActions?: boolean;\n registry?: ComponentRegistry;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n resolveNodeProps?: RuntimeNodePropsResolver;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n mediaAssets?: MediaAssetRegistry;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n resultSlots?: RuntimeBindingResultCache;\n writeResultSlot?: RuntimeBindingResultWriter;\n executeCapability?: RuntimeCapabilityExecutor;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n eventOperationState?: RuntimeEventOperationState;\n}\n\nconst EMPTY_RUNTIME_RENDERER_CONFIG: RuntimeRendererConfig = {};\n\nconst RuntimeRendererConfigContext = createContext<RuntimeRendererConfig>(\n EMPTY_RUNTIME_RENDERER_CONFIG,\n);\n\nexport function composeRuntimeRendererWrapNode(\n innerWrapNode?: RuntimeRendererConfig['wrapNode'],\n outerWrapNode?: RuntimeRendererConfig['wrapNode'],\n): RuntimeRendererConfig['wrapNode'] {\n if (!innerWrapNode) {\n return outerWrapNode;\n }\n\n if (!outerWrapNode) {\n return innerWrapNode;\n }\n\n return (args) => outerWrapNode({ ...args, rendered: innerWrapNode(args) });\n}\n\nexport function composeRuntimeNodePropsResolver(\n localResolver?: RuntimeRendererConfig['resolveNodeProps'],\n inheritedResolver?: RuntimeRendererConfig['resolveNodeProps'],\n): RuntimeRendererConfig['resolveNodeProps'] {\n if (!localResolver) {\n return inheritedResolver;\n }\n\n if (!inheritedResolver) {\n return localResolver;\n }\n\n return (args) => {\n const inheritedProps = inheritedResolver(args);\n return localResolver({ ...args, props: inheritedProps });\n };\n}\n\nexport function mergeRuntimeRendererConfig(\n localConfig: RuntimeRendererConfig | undefined,\n inheritedConfig: RuntimeRendererConfig | undefined,\n): RuntimeRendererConfig {\n if (!localConfig && !inheritedConfig) {\n return EMPTY_RUNTIME_RENDERER_CONFIG;\n }\n\n const bindingContext = mergeRecordConfig(\n inheritedConfig?.bindingContext,\n localConfig?.bindingContext,\n );\n const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);\n\n return {\n disableActions:\n localConfig?.disableActions === true || inheritedConfig?.disableActions === true,\n registry: localConfig?.registry ?? inheritedConfig?.registry,\n wrapNode: composeRuntimeRendererWrapNode(localConfig?.wrapNode, inheritedConfig?.wrapNode),\n resolveNodeProps: composeRuntimeNodePropsResolver(\n localConfig?.resolveNodeProps,\n inheritedConfig?.resolveNodeProps,\n ),\n resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,\n mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,\n dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,\n dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,\n stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,\n bindingContext,\n dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,\n resultSlots,\n writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,\n executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,\n resolveEventCapability:\n localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,\n onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,\n eventOperationLifecycle:\n localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,\n eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState,\n };\n}\n\nexport function RuntimeRendererConfigProvider(props: {\n value: RuntimeRendererConfig;\n children: React.ReactNode;\n}) {\n const { value, children } = props;\n const inheritedConfig = use(RuntimeRendererConfigContext);\n const mergedConfig = mergeRuntimeRendererConfig(value, inheritedConfig);\n\n return (\n <RuntimeRendererConfigContext value={mergedConfig}>{children}</RuntimeRendererConfigContext>\n );\n}\n\nexport function useRuntimeRendererConfig(): RuntimeRendererConfig {\n return use(RuntimeRendererConfigContext);\n}\n\nfunction mergeRecordConfig<TValue>(\n inherited: Readonly<Record<string, TValue>> | undefined,\n local: Readonly<Record<string, TValue>> | undefined,\n): Record<string, TValue> | undefined {\n if (!inherited && !local) return undefined;\n\n return {\n ...(inherited ?? {}),\n ...(local ?? {}),\n };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import React from 'react';
2
3
  import { useOptionalManifestContext } from './ManifestContext';
3
4
  import { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities';
@@ -25,6 +26,6 @@ export function RuntimeScreen(props) {
25
26
  onDiagnostics: runtimeConfig.onDiagnostics,
26
27
  screen,
27
28
  });
28
- return (<RuntimeRenderer key={`${screen.id}:${screenOperationLoaders.renderVersion}`} node={screen.root} isRoot registry={registry} stateAdapter={stateAdapter} dataBindings={manifest.dataBindings} mediaAssets={manifest.media?.assets} resultSlots={screenOperationLoaders.resultSlots} executeCapability={executeCapability}/>);
29
+ return (_jsx(RuntimeRenderer, { node: screen.root, isRoot: true, registry: registry, stateAdapter: stateAdapter, dataBindings: manifest.dataBindings, mediaAssets: manifest.media?.assets, resultSlots: screenOperationLoaders.resultSlots, executeCapability: executeCapability }, `${screen.id}:${screenOperationLoaders.renderVersion}`));
29
30
  }
30
31
  //# sourceMappingURL=RuntimeScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeScreen.js","sourceRoot":"","sources":["../src/RuntimeScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AASxE,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;IACjF,MAAM,aAAa,GAAG,wBAAwB,EAAE,CAAC;IACjD,MAAM,eAAe,GAAG,0BAA0B,EAAE,CAAC;IACrD,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CACxC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC7F,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC3B,CAAC;IACF,MAAM,YAAY,GAChB,oBAAoB,IAAI,eAAe,EAAE,YAAY,IAAI,oBAAoB,CAAC;IAChF,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,CACzC,GAAG,EAAE,CAAC,kCAAkC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,EAC7E,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAC;IACF,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CACrC,GAAG,EAAE,CACH,gCAAgC,CAAC;QAC/B,qBAAqB;QACrB,kBAAkB,EAAE,aAAa,CAAC,iBAAiB;QACnD,YAAY;KACb,CAAC,EACJ,CAAC,qBAAqB,EAAE,aAAa,CAAC,iBAAiB,EAAE,YAAY,CAAC,CACvE,CAAC;IACF,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;QAC9D,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,iBAAiB;QACjB,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,aAAa,EAAE,aAAa,CAAC,aAAa;QAC1C,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,eAAe,CACd,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,sBAAsB,CAAC,aAAa,EAAE,CAAC,CAC5D,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,MAAM,CACN,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,YAAY,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CACpC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CACpC,WAAW,CAAC,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAChD,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EACrC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { AppManifest, ScreenSpec, StateAdapter } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { useOptionalManifestContext } from './ManifestContext';\nimport type { ComponentRegistry } from './registry';\nimport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities';\nimport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor';\nimport { RuntimeRenderer } from './RuntimeRenderer';\nimport { useRuntimeRendererConfig } from './RuntimeRendererConfig';\nimport { useRuntimeScreenOperationLoaders } from './runtimeScreenLoaders';\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter';\n\nexport interface RuntimeScreenProps {\n readonly manifest: AppManifest;\n readonly screen: ScreenSpec;\n readonly registry?: ComponentRegistry;\n readonly stateAdapter?: StateAdapter;\n}\n\nexport function RuntimeScreen(props: RuntimeScreenProps) {\n const { manifest, screen, registry, stateAdapter: injectedStateAdapter } = props;\n const runtimeConfig = useRuntimeRendererConfig();\n const manifestContext = useOptionalManifestContext();\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter =\n injectedStateAdapter ?? manifestContext?.stateAdapter ?? fallbackStateAdapter;\n const apiCapabilityExecutor = React.useMemo(\n () => createRuntimeApiCapabilityExecutor({ apis: manifest.infra.apis ?? {} }),\n [manifest.infra.apis],\n );\n const executeCapability = React.useMemo(\n () =>\n composeRuntimeCapabilityExecutor({\n apiCapabilityExecutor,\n capabilityExecutor: runtimeConfig.executeCapability,\n stateAdapter,\n }),\n [apiCapabilityExecutor, runtimeConfig.executeCapability, stateAdapter],\n );\n const screenOperationLoaders = useRuntimeScreenOperationLoaders({\n bindingContext: runtimeConfig.bindingContext,\n executeCapability,\n resultSlots: runtimeConfig.resultSlots,\n onDiagnostics: runtimeConfig.onDiagnostics,\n screen,\n });\n\n return (\n <RuntimeRenderer\n key={`${screen.id}:${screenOperationLoaders.renderVersion}`}\n node={screen.root}\n isRoot\n registry={registry}\n stateAdapter={stateAdapter}\n dataBindings={manifest.dataBindings}\n mediaAssets={manifest.media?.assets}\n resultSlots={screenOperationLoaders.resultSlots}\n executeCapability={executeCapability}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"RuntimeScreen.js","sour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AAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CACrC,GAAG,EAAE,CACH,gCAAgC,CAAC;QAC/B,qBAAqB;QACrB,kBAAkB,EAAE,aAAa,CAAC,iBAAiB;QACnD,YAAY;KACb,CAAC,EACJ,CAAC,qBAAqB,EAAE,aAAa,CAAC,iBAAiB,EAAE,YAAY,CAAC,CACvE,CAAC;IACF,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;QAC9D,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,iBAAiB;QACjB,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,aAAa,EAAE,aAAa,CAAC,aAAa;QAC1C,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,eAAe,IAEd,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,MAAM,QACN,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,QAAQ,CAAC,YAAY,EACnC,WAAW,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EACnC,WAAW,EAAE,sBAAsB,CAAC,WAAW,EAC/C,iBAAiB,EAAE,iBAAiB,IAR/B,GAAG,MAAM,CAAC,EAAE,IAAI,sBAAsB,CAAC,aAAa,EAAE,CAS3D,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { AppManifest, ScreenSpec, StateAdapter } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { useOptionalManifestContext } from './ManifestContext';\nimport type { ComponentRegistry } from './registry';\nimport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities';\nimport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor';\nimport { RuntimeRenderer } from './RuntimeRenderer';\nimport { useRuntimeRendererConfig } from './RuntimeRendererConfig';\nimport { useRuntimeScreenOperationLoaders } from './runtimeScreenLoaders';\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter';\n\nexport interface RuntimeScreenProps {\n readonly manifest: AppManifest;\n readonly screen: ScreenSpec;\n readonly registry?: ComponentRegistry;\n readonly stateAdapter?: StateAdapter;\n}\n\nexport function RuntimeScreen(props: RuntimeScreenProps) {\n const { manifest, screen, registry, stateAdapter: injectedStateAdapter } = props;\n const runtimeConfig = useRuntimeRendererConfig();\n const manifestContext = useOptionalManifestContext();\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter =\n injectedStateAdapter ?? manifestContext?.stateAdapter ?? fallbackStateAdapter;\n const apiCapabilityExecutor = React.useMemo(\n () => createRuntimeApiCapabilityExecutor({ apis: manifest.infra.apis ?? {} }),\n [manifest.infra.apis],\n );\n const executeCapability = React.useMemo(\n () =>\n composeRuntimeCapabilityExecutor({\n apiCapabilityExecutor,\n capabilityExecutor: runtimeConfig.executeCapability,\n stateAdapter,\n }),\n [apiCapabilityExecutor, runtimeConfig.executeCapability, stateAdapter],\n );\n const screenOperationLoaders = useRuntimeScreenOperationLoaders({\n bindingContext: runtimeConfig.bindingContext,\n executeCapability,\n resultSlots: runtimeConfig.resultSlots,\n onDiagnostics: runtimeConfig.onDiagnostics,\n screen,\n });\n\n return (\n <RuntimeRenderer\n key={`${screen.id}:${screenOperationLoaders.renderVersion}`}\n node={screen.root}\n isRoot\n registry={registry}\n stateAdapter={stateAdapter}\n dataBindings={manifest.dataBindings}\n mediaAssets={manifest.media?.assets}\n resultSlots={screenOperationLoaders.resultSlots}\n executeCapability={executeCapability}\n />\n );\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import React, { createContext, use, useMemo } from 'react';
2
3
  import { createRuntimeMediaResolutionCache, } from './runtimeMedia';
3
4
  const RuntimeMediaCacheContext = createContext(null);
@@ -7,6 +8,6 @@ export function useRuntimeMediaResolutionCache() {
7
8
  return inherited ?? local;
8
9
  }
9
10
  export function RuntimeMediaResolutionCacheProvider(props) {
10
- return <RuntimeMediaCacheContext value={props.value}>{props.children}</RuntimeMediaCacheContext>;
11
+ return _jsx(RuntimeMediaCacheContext, { value: props.value, children: props.children });
11
12
  }
12
13
  //# sourceMappingURL=runtimeMediaCache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeMediaCache.js","sourceRoot":"","sources":["../src/runtimeMediaCache.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,iCAAiC,GAElC,MAAM,gBAAgB,CAAC;AAExB,MAAM,wBAAwB,GAAG,aAAa,CAAqC,IAAI,CAAC,CAAC;AAEzF,MAAM,UAAU,8BAA8B;IAC5C,MAAM,SAAS,GAAG,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,iCAAiC,EAAE,EAAE,EAAE,CAAC,CAAC;IACrE,OAAO,SAAS,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,mCAAmC,CAAC,KAGnD;IACC,OAAO,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,wBAAwB,CAAC,CAAC;AACnG,CAAC","sourcesContent":["import React, { createContext, use, useMemo } from 'react';\n\nimport {\n createRuntimeMediaResolutionCache,\n type RuntimeMediaResolutionCache,\n} from './runtimeMedia';\n\nconst RuntimeMediaCacheContext = createContext<RuntimeMediaResolutionCache | null>(null);\n\nexport function useRuntimeMediaResolutionCache(): RuntimeMediaResolutionCache {\n const inherited = use(RuntimeMediaCacheContext);\n const local = useMemo(() => createRuntimeMediaResolutionCache(), []);\n return inherited ?? local;\n}\n\nexport function RuntimeMediaResolutionCacheProvider(props: {\n readonly value: RuntimeMediaResolutionCache;\n readonly children: React.ReactNode;\n}) {\n return <RuntimeMediaCacheContext value={props.value}>{props.children}</RuntimeMediaCacheContext>;\n}\n"]}
1
+ {"version":3,"file":"runtimeMediaCache.js","sourceRoot":"","sources":["../src/runtimeMediaCache.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,iCAAiC,GAElC,MAAM,gBAAgB,CAAC;AAExB,MAAM,wBAAwB,GAAG,aAAa,CAAqC,IAAI,CAAC,CAAC;AAEzF,MAAM,UAAU,8BAA8B;IAC5C,MAAM,SAAS,GAAG,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,iCAAiC,EAAE,EAAE,EAAE,CAAC,CAAC;IACrE,OAAO,SAAS,IAAI,KAAK,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,mCAAmC,CAAC,KAGnD;IACC,OAAO,KAAC,wBAAwB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YAAG,KAAK,CAAC,QAAQ,GAA4B,CAAC;AACnG,CAAC","sourcesContent":["import React, { createContext, use, useMemo } from 'react';\n\nimport {\n createRuntimeMediaResolutionCache,\n type RuntimeMediaResolutionCache,\n} from './runtimeMedia';\n\nconst RuntimeMediaCacheContext = createContext<RuntimeMediaResolutionCache | null>(null);\n\nexport function useRuntimeMediaResolutionCache(): RuntimeMediaResolutionCache {\n const inherited = use(RuntimeMediaCacheContext);\n const local = useMemo(() => createRuntimeMediaResolutionCache(), []);\n return inherited ?? local;\n}\n\nexport function RuntimeMediaResolutionCacheProvider(props: {\n readonly value: RuntimeMediaResolutionCache;\n readonly children: React.ReactNode;\n}) {\n return <RuntimeMediaCacheContext value={props.value}>{props.children}</RuntimeMediaCacheContext>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/runtime",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -343,7 +343,7 @@
343
343
  },
344
344
  "dependencies": {
345
345
  "@ankhorage/capability": "^0.2.2",
346
- "@ankhorage/contracts": "^26.10.0",
346
+ "@ankhorage/contracts": "^26.11.0",
347
347
  "@ankhorage/data-sources": "^2.1.13",
348
348
  "@ankhorage/utility": "^1.10.0"
349
349
  },
@@ -359,7 +359,7 @@
359
359
  },
360
360
  "devDependencies": {
361
361
  "@ankhorage/devtools": "^2.3.47",
362
- "@ankhorage/paradox": "^0.3.7",
362
+ "@ankhorage/paradox": "^0.4.0",
363
363
  "@types/bun": "^1.4.2",
364
364
  "@types/node": "^26.6.4",
365
365
  "@types/react": "^19.3.0",
@@ -1,7 +1,7 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="npm: v5.4.0">
2
- <title>npm: v5.4.0</title>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="npm: v5.4.2">
2
+ <title>npm: v5.4.2</title>
3
3
  <rect width="38" height="20" fill="#374151"/>
4
4
  <rect x="38" width="52" height="20" fill="#cb3837"/>
5
5
  <text x="19" y="14" fill="#ffffff" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle">npm</text>
6
- <text x="64" y="14" fill="#ffffff" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle">v5.4.0</text>
6
+ <text x="64" y="14" fill="#ffffff" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle">v5.4.2</text>
7
7
  </svg>
@@ -184,3 +184,5 @@ graph TD
184
184
  package__ankhorage_runtime -.-> module_tests_runtime_test_ts
185
185
  module_tests_runtime_test_ts --> module_src_capabilities_index_ts
186
186
  module_tests_runtime_test_ts --> module_src_runtimeManifest_ts
187
+ module_tests_runtimeBrowserArtifact_test_ts["tests/runtimeBrowserArtifact.test.ts"]
188
+ package__ankhorage_runtime -.-> module_tests_runtimeBrowserArtifact_test_ts
@@ -50,6 +50,7 @@ graph LR
50
50
  module_tests_reactNativeWebCompatibility_fixture_tsx["tests/reactNativeWebCompatibility.fixture.tsx"]
51
51
  module_tests_reactNativeWebCompatibility_test_ts["tests/reactNativeWebCompatibility.test.ts"]
52
52
  module_tests_runtime_test_ts["tests/runtime.test.ts"]
53
+ module_tests_runtimeBrowserArtifact_test_ts["tests/runtimeBrowserArtifact.test.ts"]
53
54
  export_applyRuntimeBindingDataPath["applyRuntimeBindingDataPath"]
54
55
  module_src_runtimeBindings_ts --> export_applyRuntimeBindingDataPath
55
56
  export_ComponentRegistry["ComponentRegistry"]
@@ -50,6 +50,7 @@ graph LR
50
50
  module_tests_reactNativeWebCompatibility_fixture_tsx["tests/reactNativeWebCompatibility.fixture.tsx"]
51
51
  module_tests_reactNativeWebCompatibility_test_ts["tests/reactNativeWebCompatibility.test.ts"]
52
52
  module_tests_runtime_test_ts["tests/runtime.test.ts"]
53
+ module_tests_runtimeBrowserArtifact_test_ts["tests/runtimeBrowserArtifact.test.ts"]
53
54
  module_src_capabilities_resolveRuntimeContextCapability_test_ts --> module_src_capabilities_resolveRuntimeContextCapability_ts
54
55
  module_src_capabilities_resolveRuntimeContextCapability_ts --> module_src_capabilities_index_ts
55
56
  module_src_ManifestContext_tsx --> module_src_runtimeStateAdapter_ts
@@ -318,7 +318,7 @@
318
318
  <div class="summary">
319
319
  <div><strong>95</strong><span class="muted">public exports</span></div>
320
320
  <div><strong>5</strong><span class="muted">components</span></div>
321
- <div><strong>51</strong><span class="muted">modules</span></div>
321
+ <div><strong>52</strong><span class="muted">modules</span></div>
322
322
  <div><strong>1</strong><span class="muted">entrypoints</span></div>
323
323
  </div>
324
324
  <h3>Entrypoints</h3>
@@ -661,6 +661,11 @@ inject it at the runtime boundary.</p>
661
661
  <p class="muted">Referenced module</p>
662
662
  <p><strong>Dependencies:</strong> <code>src/capabilities/index.ts</code>, <code>src/runtimeManifest.ts</code></p>
663
663
  <p><strong>Exports:</strong> <span class="empty">None</span></p>
664
+ </article><article class="item" data-search="tests/runtimeBrowserArtifact.test.ts">
665
+ <h3>tests/runtimeBrowserArtifact.test.ts</h3>
666
+ <p class="muted">Referenced module</p>
667
+ <p><strong>Dependencies:</strong> <span class="empty">None</span></p>
668
+ <p><strong>Exports:</strong> <span class="empty">None</span></p>
664
669
  </article>
665
670
  </section>
666
671
  <section class="panel">
@@ -3997,6 +4002,8 @@ inject it at the runtime boundary.</p>
3997
4002
  package__ankhorage_runtime -.-&gt; module_tests_runtime_test_ts
3998
4003
  module_tests_runtime_test_ts --&gt; module_src_capabilities_index_ts
3999
4004
  module_tests_runtime_test_ts --&gt; module_src_runtimeManifest_ts
4005
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4006
+ package__ankhorage_runtime -.-&gt; module_tests_runtimeBrowserArtifact_test_ts
4000
4007
  </div>
4001
4008
  <details>
4002
4009
  <summary>View Mermaid source</summary>
@@ -4186,6 +4193,8 @@ inject it at the runtime boundary.</p>
4186
4193
  package__ankhorage_runtime -.-&gt; module_tests_runtime_test_ts
4187
4194
  module_tests_runtime_test_ts --&gt; module_src_capabilities_index_ts
4188
4195
  module_tests_runtime_test_ts --&gt; module_src_runtimeManifest_ts
4196
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4197
+ package__ankhorage_runtime -.-&gt; module_tests_runtimeBrowserArtifact_test_ts
4189
4198
  </pre>
4190
4199
  </details>
4191
4200
  </article><article class="item" data-search="Module relationships diagrams/module-relationships.mmd">
@@ -4243,6 +4252,7 @@ inject it at the runtime boundary.</p>
4243
4252
  module_tests_reactNativeWebCompatibility_fixture_tsx[&quot;tests/reactNativeWebCompatibility.fixture.tsx&quot;]
4244
4253
  module_tests_reactNativeWebCompatibility_test_ts[&quot;tests/reactNativeWebCompatibility.test.ts&quot;]
4245
4254
  module_tests_runtime_test_ts[&quot;tests/runtime.test.ts&quot;]
4255
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4246
4256
  module_src_capabilities_resolveRuntimeContextCapability_test_ts --&gt; module_src_capabilities_resolveRuntimeContextCapability_ts
4247
4257
  module_src_capabilities_resolveRuntimeContextCapability_ts --&gt; module_src_capabilities_index_ts
4248
4258
  module_src_ManifestContext_tsx --&gt; module_src_runtimeStateAdapter_ts
@@ -4379,6 +4389,7 @@ inject it at the runtime boundary.</p>
4379
4389
  module_tests_reactNativeWebCompatibility_fixture_tsx[&quot;tests/reactNativeWebCompatibility.fixture.tsx&quot;]
4380
4390
  module_tests_reactNativeWebCompatibility_test_ts[&quot;tests/reactNativeWebCompatibility.test.ts&quot;]
4381
4391
  module_tests_runtime_test_ts[&quot;tests/runtime.test.ts&quot;]
4392
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4382
4393
  module_src_capabilities_resolveRuntimeContextCapability_test_ts --&gt; module_src_capabilities_resolveRuntimeContextCapability_ts
4383
4394
  module_src_capabilities_resolveRuntimeContextCapability_ts --&gt; module_src_capabilities_index_ts
4384
4395
  module_src_ManifestContext_tsx --&gt; module_src_runtimeStateAdapter_ts
@@ -4517,6 +4528,7 @@ inject it at the runtime boundary.</p>
4517
4528
  module_tests_reactNativeWebCompatibility_fixture_tsx[&quot;tests/reactNativeWebCompatibility.fixture.tsx&quot;]
4518
4529
  module_tests_reactNativeWebCompatibility_test_ts[&quot;tests/reactNativeWebCompatibility.test.ts&quot;]
4519
4530
  module_tests_runtime_test_ts[&quot;tests/runtime.test.ts&quot;]
4531
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4520
4532
  export_applyRuntimeBindingDataPath[&quot;applyRuntimeBindingDataPath&quot;]
4521
4533
  module_src_runtimeBindings_ts --&gt; export_applyRuntimeBindingDataPath
4522
4534
  export_ComponentRegistry[&quot;ComponentRegistry&quot;]
@@ -4851,6 +4863,7 @@ inject it at the runtime boundary.</p>
4851
4863
  module_tests_reactNativeWebCompatibility_fixture_tsx[&quot;tests/reactNativeWebCompatibility.fixture.tsx&quot;]
4852
4864
  module_tests_reactNativeWebCompatibility_test_ts[&quot;tests/reactNativeWebCompatibility.test.ts&quot;]
4853
4865
  module_tests_runtime_test_ts[&quot;tests/runtime.test.ts&quot;]
4866
+ module_tests_runtimeBrowserArtifact_test_ts[&quot;tests/runtimeBrowserArtifact.test.ts&quot;]
4854
4867
  export_applyRuntimeBindingDataPath[&quot;applyRuntimeBindingDataPath&quot;]
4855
4868
  module_src_runtimeBindings_ts --&gt; export_applyRuntimeBindingDataPath
4856
4869
  export_ComponentRegistry[&quot;ComponentRegistry&quot;]
@@ -5592,6 +5605,11 @@ inject it at the runtime boundary.</p>
5592
5605
  </details>
5593
5606
  </article>
5594
5607
  </section>
5608
+ <section class="panel" data-search="donation sponsor support">
5609
+ <h2>Donation</h2>
5610
+ <p>If this project is useful to you, you can support its continued development.</p>
5611
+ <p><a href="https://github.com/sponsors/ankhorage">Support @ankhorage</a></p>
5612
+ </section>
5595
5613
  </section>
5596
5614
  <section id="view-src-capabilities-resolveruntimecontextcapability-ts" class="view" data-view="src/capabilities/resolveRuntimeContextCapability.ts" hidden>
5597
5615
  <section class="panel">
@@ -2,8 +2,10 @@
2
2
  "packageName": "@ankhorage/runtime",
3
3
  "packageId": "@ankhorage/runtime",
4
4
  "description": "Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.",
5
- "collaborators": null,
6
- "donation": null,
5
+ "collaborators": true,
6
+ "donation": {
7
+ "account": "ankhorage"
8
+ },
7
9
  "badges": [
8
10
  {
9
11
  "id": "license",
@@ -14,7 +16,7 @@
14
16
  {
15
17
  "id": "npm",
16
18
  "label": "npm",
17
- "value": "v5.4.0",
19
+ "value": "v5.4.2",
18
20
  "color": "cb3837"
19
21
  },
20
22
  {
@@ -878,6 +880,12 @@
878
880
  "src/runtimeManifest.ts"
879
881
  ],
880
882
  "exports": []
883
+ },
884
+ {
885
+ "path": "tests/runtimeBrowserArtifact.test.ts",
886
+ "isEntrypoint": false,
887
+ "dependencies": [],
888
+ "exports": []
881
889
  }
882
890
  ],
883
891
  "exports": [
@@ -10278,6 +10286,42 @@
10278
10286
  "callExpression": "createRuntimeManifest",
10279
10287
  "sourcePath": "tests/runtime.test.ts"
10280
10288
  },
10289
+ {
10290
+ "fromSymbol": "listJavaScriptArtifactPaths",
10291
+ "toSymbol": "readdirSync",
10292
+ "callExpression": "readdirSync",
10293
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10294
+ },
10295
+ {
10296
+ "fromSymbol": "tests/runtimeBrowserArtifact.test.ts",
10297
+ "toSymbol": "listJavaScriptArtifactPaths",
10298
+ "callExpression": "listJavaScriptArtifactPaths",
10299
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10300
+ },
10301
+ {
10302
+ "fromSymbol": "tests/runtimeBrowserArtifact.test.ts",
10303
+ "toSymbol": "describe",
10304
+ "callExpression": "describe",
10305
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10306
+ },
10307
+ {
10308
+ "fromSymbol": "tests/runtimeBrowserArtifact.test.ts",
10309
+ "toSymbol": "it",
10310
+ "callExpression": "it",
10311
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10312
+ },
10313
+ {
10314
+ "fromSymbol": "tests/runtimeBrowserArtifact.test.ts",
10315
+ "toSymbol": "expect",
10316
+ "callExpression": "expect",
10317
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10318
+ },
10319
+ {
10320
+ "fromSymbol": "tests/runtimeBrowserArtifact.test.ts",
10321
+ "toSymbol": "spawnSync",
10322
+ "callExpression": "spawnSync",
10323
+ "sourcePath": "tests/runtimeBrowserArtifact.test.ts"
10324
+ },
10281
10325
  {
10282
10326
  "fromSymbol": "src/capabilities/resolveRuntimeContextCapability.test.ts",
10283
10327
  "toSymbol": "describe",