@ankhorage/runtime 5.7.5 → 5.7.7
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 +12 -0
- package/README.md +4 -1
- package/dist/RuntimeRenderer.d.ts.map +1 -1
- package/dist/RuntimeRenderer.js +1 -0
- package/dist/RuntimeRenderer.js.map +1 -1
- package/dist/runtimeActionRegistry.d.ts +3 -2
- package/dist/runtimeActionRegistry.d.ts.map +1 -1
- package/dist/runtimeActionRegistry.js +2 -1
- package/dist/runtimeActionRegistry.js.map +1 -1
- package/package.json +3 -3
- package/paradox/badges/npm.svg +3 -3
- package/paradox/contributors.json +24 -0
- package/paradox/diagrams/architecture-overview.mmd +2 -0
- package/paradox/diagrams/module-relationships.mmd +2 -0
- package/paradox/exports.json +20 -13
- package/paradox/exports.md +14 -13
- package/paradox/index.html +57 -29
- package/paradox/paradox.json +103 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/runtime
|
|
2
2
|
|
|
3
|
+
## 5.7.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d732ea5: Preserve the renderer's state adapter during event invocation and condition resolution so state-backed event inputs resolve at dispatch time.
|
|
8
|
+
|
|
9
|
+
## 5.7.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1fabfc4: Normalize searchable Select query events for authored component bindings.
|
|
14
|
+
|
|
3
15
|
## 5.7.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# Ankhorage Runtime
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Renders Ankhorage application manifests and resolves their runtime bindings, capabilities, events, media, screens, and state.
|
|
9
9
|
|
|
@@ -32,7 +32,10 @@ Open `paradox/index.html` locally in your browser to browse the complete documen
|
|
|
32
32
|
|
|
33
33
|
## Contributors
|
|
34
34
|
|
|
35
|
+
<a href="https://github.com/ankhorage-renovate-sync%5Bbot%5D"><img src="https://avatars.githubusercontent.com/u/323340348?s=64" width="40" height="40" alt="ankhorage-renovate-sync%5Bbot%5D" /></a>
|
|
35
36
|
<a href="https://github.com/artiphishle"><img src="https://avatars.githubusercontent.com/u/137318798?s=64" width="40" height="40" alt="artiphishle" /></a>
|
|
37
|
+
<a href="https://github.com/github-actions%5Bbot%5D"><img src="https://avatars.githubusercontent.com/u/41898282?s=64" width="40" height="40" alt="github-actions%5Bbot%5D" /></a>
|
|
38
|
+
<a href="https://github.com/renovate%5Bbot%5D"><img src="https://avatars.githubusercontent.com/u/29139614?s=64" width="40" height="40" alt="renovate%5Bbot%5D" /></a>
|
|
36
39
|
<a href="https://github.com/faeb187"><img src="https://avatars.githubusercontent.com/u/389333?s=64" width="40" height="40" alt="faeb187" /></a>
|
|
37
40
|
|
|
38
41
|
## Donation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeRenderer.d.ts","sourceRoot":"","sources":["../src/RuntimeRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMvD,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAOjG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,4BAA4B,CAA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+97,7 @@ export function RuntimeRenderer(props) {
|
|
|
97
97
|
executeCapability: eventArgs.executeCapability ?? effectiveConfig.executeCapability,
|
|
98
98
|
onDiagnostics: effectiveConfig.onDiagnostics,
|
|
99
99
|
resultSlots: eventArgs.resultSlots ?? effectiveConfig.resultSlots,
|
|
100
|
+
stateAdapter: eventArgs.stateAdapter ?? effectiveConfig.stateAdapter,
|
|
100
101
|
writeResultSlot: eventArgs.writeResultSlot ?? effectiveConfig.writeResultSlot,
|
|
101
102
|
eventOperationLifecycle: eventArgs.eventOperationLifecycle ?? effectiveConfig.eventOperationLifecycle,
|
|
102
103
|
});
|
|
@@ -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,gBAAgB,CAAC;AACxB,OAAO,EAGL,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,0CAA0C,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EACL,yCAAyC,EACzC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAE7B,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CA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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.js';\nimport {\n getUnknownComponentDiagnostic,\n resolveRenderedChildren,\n resolveRuntimeRegistry,\n} from './rendering.js';\nimport {\n type RuntimeComponentEventDispatchArgs,\n type RuntimeEventCapabilityResolver,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry.js';\nimport type { RuntimeBindingResultCache, RuntimeCapabilityExecutor } from './runtimeBindings.js';\nimport { dispatchRuntimeComponentEventWithReporting } from './runtimeEventExecution.js';\nimport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n} from './runtimeEventOperationLifecycle.js';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia.js';\nimport {\n RuntimeMediaResolutionCacheProvider,\n useRuntimeMediaResolutionCache,\n} from './runtimeMediaCache.js';\nimport { resolveRuntimeNodeProps } from './runtimeNodeProps.js';\nimport {\n mergeRuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig.js';\nimport {\n createRuntimeRepeatBindingContext,\n resolveRuntimeRepeatItemKey,\n resolveRuntimeRepeatItemsAsync,\n resolveRuntimeRepeatItemsSync,\n} from './runtimeRepeat.js';\nimport { createRepeatDiagnosticsKey } from './runtimeRepeatDiagnostics.js';\nimport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState.js';\nimport { useRuntimeMediaProps } from './useRuntimeMediaProps.js';\nimport { useRuntimeStateBindings } from './useRuntimeStateBindings.js';\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 capabilityValues?: Readonly<Record<string, BindingValue | undefined>>;\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 capabilityValues,\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 capabilityValues,\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 capabilityValues,\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 capabilityValues: effectiveConfig.capabilityValues,\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 capabilityValues: effectiveConfig.capabilityValues,\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.capabilityValues,\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 capabilityValues: repeatRequest.capabilityValues,\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 capabilityValues: effectiveConfig.capabilityValues,\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","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,gBAAgB,CAAC;AACxB,OAAO,EAGL,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,0CAA0C,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EACL,yCAAyC,EACzC,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAE7B,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAsBvE,MAAM,UAAU,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,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.js';\nimport {\n getUnknownComponentDiagnostic,\n resolveRenderedChildren,\n resolveRuntimeRegistry,\n} from './rendering.js';\nimport {\n type RuntimeComponentEventDispatchArgs,\n type RuntimeEventCapabilityResolver,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry.js';\nimport type { RuntimeBindingResultCache, RuntimeCapabilityExecutor } from './runtimeBindings.js';\nimport { dispatchRuntimeComponentEventWithReporting } from './runtimeEventExecution.js';\nimport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n} from './runtimeEventOperationLifecycle.js';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia.js';\nimport {\n RuntimeMediaResolutionCacheProvider,\n useRuntimeMediaResolutionCache,\n} from './runtimeMediaCache.js';\nimport { resolveRuntimeNodeProps } from './runtimeNodeProps.js';\nimport {\n mergeRuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig.js';\nimport {\n createRuntimeRepeatBindingContext,\n resolveRuntimeRepeatItemKey,\n resolveRuntimeRepeatItemsAsync,\n resolveRuntimeRepeatItemsSync,\n} from './runtimeRepeat.js';\nimport { createRepeatDiagnosticsKey } from './runtimeRepeatDiagnostics.js';\nimport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState.js';\nimport { useRuntimeMediaProps } from './useRuntimeMediaProps.js';\nimport { useRuntimeStateBindings } from './useRuntimeStateBindings.js';\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 capabilityValues?: Readonly<Record<string, BindingValue | undefined>>;\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 capabilityValues,\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 capabilityValues,\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 capabilityValues,\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 stateAdapter: eventArgs.stateAdapter ?? effectiveConfig.stateAdapter,\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 capabilityValues: effectiveConfig.capabilityValues,\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 capabilityValues: effectiveConfig.capabilityValues,\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.capabilityValues,\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 capabilityValues: repeatRequest.capabilityValues,\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 capabilityValues: effectiveConfig.capabilityValues,\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,6 +1,6 @@
|
|
|
1
1
|
import type { BindingExpression, BindingValue, ComponentDataBindingRegistry, ComponentEventDto, DataSourceDiagnostic, UiNode } from '@ankhorage/contracts';
|
|
2
2
|
import type { Capability } from '@ankhorage/contracts/capability';
|
|
3
|
-
import { type RuntimeBindingResultCache, type RuntimeBindingResultWriter, type RuntimeCapabilityExecutor } from './runtimeBindings.js';
|
|
3
|
+
import { type RuntimeBindingResolutionContext, type RuntimeBindingResultCache, type RuntimeBindingResultWriter, type RuntimeCapabilityExecutor } from './runtimeBindings.js';
|
|
4
4
|
import { type RuntimeEventOperationLifecycle } from './runtimeEventOperationLifecycle.js';
|
|
5
5
|
type RuntimeEventPayload = Record<string, unknown>;
|
|
6
6
|
export type RuntimeEventCapabilityResolver = (args: {
|
|
@@ -24,6 +24,7 @@ export interface RuntimeComponentEventDispatchArgs extends RuntimeActionResoluti
|
|
|
24
24
|
readonly eventName?: string;
|
|
25
25
|
readonly dataBindings?: ComponentDataBindingRegistry;
|
|
26
26
|
readonly executeCapability?: RuntimeCapabilityExecutor;
|
|
27
|
+
readonly stateAdapter?: RuntimeBindingResolutionContext['stateAdapter'];
|
|
27
28
|
readonly writeResultSlot?: RuntimeBindingResultWriter;
|
|
28
29
|
readonly eventOperationLifecycle?: RuntimeEventOperationLifecycle;
|
|
29
30
|
}
|
|
@@ -36,7 +37,7 @@ export interface RuntimeEventPropWrapArgs extends RuntimeActionResolutionScope {
|
|
|
36
37
|
readonly resolveEventCapability?: RuntimeEventCapabilityResolver;
|
|
37
38
|
}
|
|
38
39
|
/*** Creates a registry that dispatches every authored event through one capability executor. */
|
|
39
|
-
export declare function createRuntimeActionRegistry(options?: Pick<RuntimeComponentEventDispatchArgs, 'dataBindings' | 'eventOperationLifecycle' | 'executeCapability' | 'resultSlots' | 'writeResultSlot'>): RuntimeActionRegistry;
|
|
40
|
+
export declare function createRuntimeActionRegistry(options?: Pick<RuntimeComponentEventDispatchArgs, 'dataBindings' | 'eventOperationLifecycle' | 'executeCapability' | 'resultSlots' | 'stateAdapter' | 'writeResultSlot'>): RuntimeActionRegistry;
|
|
40
41
|
/*** Executes every matching event invocation through the canonical capability path. */
|
|
41
42
|
export declare function dispatchRuntimeComponentEvent(args: RuntimeComponentEventDispatchArgs): Promise<readonly DataSourceDiagnostic[]>;
|
|
42
43
|
/*** Wraps component callbacks so manifest event bindings retain the original callback behavior. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeActionRegistry.d.ts","sourceRoot":"","sources":["../src/runtimeActionRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAE7C,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGnD,MAAM,MAAM,8BAA8B,GAAG,CAAC,IAAI,EAAE;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,KAAK,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,sBAAsB,CAAC,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;C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CAAiC,EAC/B,cAAc,GACd,yBAAyB,GACzB,mBAAmB,GACnB,aAAa,GACb,cAAc,GACd,iBAAiB,CACf,GACL,qBAAqB,CAMvB;AAED,uFAAuF;AACvF,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,iCAAiC,GACtC,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CA8D1C;AAED,mGAAmG;AACnG,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2B7F;AAED,2FAA2F;AAC3F,wBAAgB,mCAAmC,CAAC,IAAI,EAAE;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC;CAC1C,GAAG,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAMjD;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,2BAA2B,GAChC,YAAY,GAAG,SAAS,CAE1B"}
|
|
@@ -23,6 +23,7 @@ export async function dispatchRuntimeComponentEvent(args) {
|
|
|
23
23
|
event: args.event,
|
|
24
24
|
executeCapability: args.executeCapability,
|
|
25
25
|
resultSlots,
|
|
26
|
+
stateAdapter: args.stateAdapter,
|
|
26
27
|
writeResultSlot: (slot, value) => {
|
|
27
28
|
resultSlots[slot] = value;
|
|
28
29
|
args.writeResultSlot?.(slot, value);
|
|
@@ -118,7 +119,7 @@ function matchesBindingCondition(condition, context) {
|
|
|
118
119
|
function createPayloadForEvent(eventName, args) {
|
|
119
120
|
if (eventName === 'submit')
|
|
120
121
|
return { values: asRecord(args[0]) ?? {} };
|
|
121
|
-
if (eventName === 'changeText' || eventName === 'valueChange')
|
|
122
|
+
if (eventName === 'changeText' || eventName === 'valueChange' || eventName === 'searchChange')
|
|
122
123
|
return { value: args[0] };
|
|
123
124
|
if (eventName === 'checkedChange')
|
|
124
125
|
return { checked: args[0] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeActionRegistry.js","sourceRoot":"","sources":["../src/runtimeActionRegistry.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,GAIpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wCAAwC,GAEzC,MAAM,qCAAqC,CAAC;AA6C7C,gGAAgG;AAChG,MAAM,UAAU,2BAA2B,CACzC,UAOI,EAAE;IAEN,OAAO;QACL,KAAK,CAAC,sBAAsB,CAAC,IAAI;YAC/B,MAAM,6BAA6B,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,IAAuC;IAEvC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzE,MAAM,QAAQ,GACZ,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC;QACtD,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,EAAE,CAAC;IACL,MAAM,WAAW,GAA2B,EAAE,CAAC;IAC/C,MAAM,WAAW,GAA6C,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC;IAE9F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,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;AAClD,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAiB;IAChD,OAAO,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7C,CAAC","sourcesContent":["import type {\n BindingCondition,\n BindingExpression,\n BindingValue,\n ComponentDataBindingRegistry,\n ComponentEventDto,\n DataSourceDiagnostic,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { Capability } from '@ankhorage/contracts/capability';\nimport { isRecord } from '@ankhorage/utility/object';\n\nimport {\n executeRuntimeBindingInvocation,\n resolveRuntimeBindingExpressionSync,\n type RuntimeBindingResultCache,\n type RuntimeBindingResultWriter,\n type RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nimport {\n resolveRuntimeEventOperationErrorMessage,\n type RuntimeEventOperationLifecycle,\n} from './runtimeEventOperationLifecycle.js';\n\ntype RuntimeEventPayload = Record<string, unknown>;\ntype RuntimeEventHandler = (...args: unknown[]) => unknown;\n\nexport type RuntimeEventCapabilityResolver = (args: {\n readonly eventName: string;\n readonly node: UiNode;\n}) => Capability['id'] | undefined;\n\nexport interface RuntimeActionRegistry {\n dispatchComponentEvent(args: RuntimeComponentEventDispatchArgs): Promise<void>;\n}\n\nexport interface RuntimeActionResolutionScope {\n readonly context?: Record<string, unknown>;\n readonly resultSlots?: RuntimeBindingResultCache;\n readonly state?: Record<string, unknown>;\n}\n\nexport interface RuntimeActionResolutionArgs extends RuntimeActionResolutionScope {\n readonly event: ComponentEventDto<string, object>;\n}\n\nexport interface RuntimeComponentEventDispatchArgs extends RuntimeActionResolutionScope {\n readonly node: UiNode;\n readonly event: ComponentEventDto<string, object>;\n readonly eventName?: string;\n readonly dataBindings?: ComponentDataBindingRegistry;\n readonly executeCapability?: RuntimeCapabilityExecutor;\n readonly writeResultSlot?: RuntimeBindingResultWriter;\n readonly eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n}\n\nexport interface RuntimeEventPropWrapArgs extends RuntimeActionResolutionScope {\n readonly node: UiNode;\n readonly props: Record<string, unknown>;\n readonly disableActions: boolean;\n readonly dataBindings?: ComponentDataBindingRegistry;\n readonly dispatchComponentEvent: (\n args: RuntimeComponentEventDispatchArgs,\n ) => Promise<void> | void;\n readonly resolveEventCapability?: RuntimeEventCapabilityResolver;\n}\n\n/*** Creates a registry that dispatches every authored event through one capability executor. */\nexport function createRuntimeActionRegistry(\n options: Pick<\n RuntimeComponentEventDispatchArgs,\n | 'dataBindings'\n | 'eventOperationLifecycle'\n | 'executeCapability'\n | 'resultSlots'\n | 'writeResultSlot'\n > = {},\n): RuntimeActionRegistry {\n return {\n async dispatchComponentEvent(args) {\n await dispatchRuntimeComponentEvent({ ...options, ...args });\n },\n };\n}\n\n/*** Executes every matching event invocation through the canonical capability path. */\nexport async function dispatchRuntimeComponentEvent(\n args: RuntimeComponentEventDispatchArgs,\n): Promise<readonly DataSourceDiagnostic[]> {\n const eventName = args.eventName ?? inferLocalEventName(args.event.type);\n const bindings =\n args.dataBindings?.[args.node.id]?.events?.[eventName] ??\n args.dataBindings?.[args.node.id]?.events?.[args.event.type] ??\n [];\n const diagnostics: DataSourceDiagnostic[] = [];\n const resultSlots: Record<string, BindingValue | undefined> = { ...(args.resultSlots ?? {}) };\n\n for (const binding of bindings) {\n const context = {\n context: args.context,\n event: args.event,\n executeCapability: args.executeCapability,\n resultSlots,\n writeResultSlot: (slot: string, value: BindingValue | undefined) => {\n resultSlots[slot] = value;\n args.writeResultSlot?.(slot, value);\n },\n };\n if (!matchesBindingCondition(binding.when, context)) continue;\n\n if (binding.target.result !== undefined) {\n context.writeResultSlot(binding.target.result, undefined);\n }\n\n const lifecycle = args.eventOperationLifecycle?.start({\n capability: binding.target.capability,\n nodeId: args.node.id,\n });\n if (args.eventOperationLifecycle !== undefined && lifecycle === undefined) break;\n\n try {\n const result = await executeRuntimeBindingInvocation(\n binding.target,\n context,\n { event: args.event, node: args.node },\n diagnostics,\n );\n if (lifecycle !== undefined && result?.ok) args.eventOperationLifecycle?.succeed(lifecycle);\n else if (lifecycle !== undefined)\n args.eventOperationLifecycle?.fail(\n lifecycle,\n resolveRuntimeEventOperationErrorMessage(diagnostics),\n );\n } catch {\n diagnostics.push({\n code: 'adapter-error',\n message: `Capability '${binding.target.capability}' could not be completed. Please try again.`,\n severity: 'error',\n });\n if (lifecycle !== undefined)\n args.eventOperationLifecycle?.fail(\n lifecycle,\n resolveRuntimeEventOperationErrorMessage(diagnostics),\n );\n break;\n }\n }\n\n return diagnostics;\n}\n\n/*** Wraps component callbacks so manifest event bindings retain the original callback behavior. */\nexport function wrapRuntimeEventProps(args: RuntimeEventPropWrapArgs): Record<string, unknown> {\n const props = { ...args.props };\n if (args.disableActions || args.dataBindings?.[args.node.id]?.events === undefined) return props;\n\n for (const eventName of Object.keys(args.dataBindings[args.node.id]?.events ?? {})) {\n const propName = eventNameToCallbackProp(eventName);\n const existing = props[propName];\n props[propName] = (...handlerArgs: unknown[]) => {\n const result = isRuntimeEventHandler(existing) ? existing(...handlerArgs) : undefined;\n void args.dispatchComponentEvent({\n context: args.context,\n dataBindings: args.dataBindings,\n event: createComponentEventFromHandlerArgs({\n capability: args.resolveEventCapability?.({ eventName, node: args.node }),\n eventName,\n handlerArgs,\n node: args.node,\n }),\n eventName,\n node: args.node,\n resultSlots: args.resultSlots,\n state: args.state,\n });\n return result;\n };\n }\n return props;\n}\n\n/*** Maps a platform callback invocation to the portable component event representation. */\nexport function createComponentEventFromHandlerArgs(args: {\n readonly capability?: Capability['id'];\n readonly node: UiNode;\n readonly eventName: string;\n readonly handlerArgs: readonly unknown[];\n}): ComponentEventDto<string, RuntimeEventPayload> {\n return {\n payload: createPayloadForEvent(args.eventName, args.handlerArgs),\n sourceNodeId: args.node.id,\n type: args.capability ?? args.eventName,\n };\n}\n\n/*** Resolves an authored expression-shaped payload for imperative consumers. */\nexport function resolveRuntimeActionValue(\n value: BindingExpression,\n args: RuntimeActionResolutionArgs,\n): BindingValue | undefined {\n return resolveRuntimeBindingExpressionSync(value, args);\n}\n\nfunction matchesBindingCondition(\n condition: BindingCondition | undefined,\n context: Parameters<typeof resolveRuntimeBindingExpressionSync>[1],\n): boolean {\n if (condition === undefined) return true;\n const source = resolveRuntimeBindingExpressionSync(condition.source, context);\n const value =\n condition.value === undefined\n ? undefined\n : resolveRuntimeBindingExpressionSync(condition.value, context);\n if (condition.operator === 'exists') return source !== undefined;\n if (condition.operator === 'notExists') return source === undefined;\n if (condition.operator === 'eq') return source === value;\n return source !== value;\n}\n\nfunction createPayloadForEvent(eventName: string, args: readonly unknown[]): RuntimeEventPayload {\n if (eventName === 'submit') return { values: asRecord(args[0]) ?? {} };\n if (eventName === 'changeText' || eventName === 'valueChange') return { value: args[0] };\n if (eventName === 'checkedChange') return { checked: args[0] };\n if (eventName === 'itemPress') {\n const item = asRecord(args[0]) ?? {};\n return typeof item.id === 'string' || typeof item.id === 'number'\n ? { item, itemId: item.id }\n : { item };\n }\n return asRecord(args[0]) ?? {};\n}\n\nfunction inferLocalEventName(eventType: string): string {\n return eventType.split('.').at(-1) ?? eventType;\n}\n\nfunction eventNameToCallbackProp(eventName: string): string {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n}\n\nfunction isRuntimeEventHandler(value: unknown): value is RuntimeEventHandler {\n return typeof value === 'function';\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return isRecord(value) ? value : undefined;\n}\n"]}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C;AAClD,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAiB;IAChD,OAAO,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7C,CAAC","sourcesContent":["import type {\n BindingCondition,\n BindingExpression,\n BindingValue,\n ComponentDataBindingRegistry,\n ComponentEventDto,\n DataSourceDiagnostic,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { Capability } from '@ankhorage/contracts/capability';\nimport { isRecord } from '@ankhorage/utility/object';\n\nimport {\n executeRuntimeBindingInvocation,\n resolveRuntimeBindingExpressionSync,\n type RuntimeBindingResolutionContext,\n type RuntimeBindingResultCache,\n type RuntimeBindingResultWriter,\n type RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nimport {\n resolveRuntimeEventOperationErrorMessage,\n type RuntimeEventOperationLifecycle,\n} from './runtimeEventOperationLifecycle.js';\n\ntype RuntimeEventPayload = Record<string, unknown>;\ntype RuntimeEventHandler = (...args: unknown[]) => unknown;\n\nexport type RuntimeEventCapabilityResolver = (args: {\n readonly eventName: string;\n readonly node: UiNode;\n}) => Capability['id'] | undefined;\n\nexport interface RuntimeActionRegistry {\n dispatchComponentEvent(args: RuntimeComponentEventDispatchArgs): Promise<void>;\n}\n\nexport interface RuntimeActionResolutionScope {\n readonly context?: Record<string, unknown>;\n readonly resultSlots?: RuntimeBindingResultCache;\n readonly state?: Record<string, unknown>;\n}\n\nexport interface RuntimeActionResolutionArgs extends RuntimeActionResolutionScope {\n readonly event: ComponentEventDto<string, object>;\n}\n\nexport interface RuntimeComponentEventDispatchArgs extends RuntimeActionResolutionScope {\n readonly node: UiNode;\n readonly event: ComponentEventDto<string, object>;\n readonly eventName?: string;\n readonly dataBindings?: ComponentDataBindingRegistry;\n readonly executeCapability?: RuntimeCapabilityExecutor;\n readonly stateAdapter?: RuntimeBindingResolutionContext['stateAdapter'];\n readonly writeResultSlot?: RuntimeBindingResultWriter;\n readonly eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n}\n\nexport interface RuntimeEventPropWrapArgs extends RuntimeActionResolutionScope {\n readonly node: UiNode;\n readonly props: Record<string, unknown>;\n readonly disableActions: boolean;\n readonly dataBindings?: ComponentDataBindingRegistry;\n readonly dispatchComponentEvent: (\n args: RuntimeComponentEventDispatchArgs,\n ) => Promise<void> | void;\n readonly resolveEventCapability?: RuntimeEventCapabilityResolver;\n}\n\n/*** Creates a registry that dispatches every authored event through one capability executor. */\nexport function createRuntimeActionRegistry(\n options: Pick<\n RuntimeComponentEventDispatchArgs,\n | 'dataBindings'\n | 'eventOperationLifecycle'\n | 'executeCapability'\n | 'resultSlots'\n | 'stateAdapter'\n | 'writeResultSlot'\n > = {},\n): RuntimeActionRegistry {\n return {\n async dispatchComponentEvent(args) {\n await dispatchRuntimeComponentEvent({ ...options, ...args });\n },\n };\n}\n\n/*** Executes every matching event invocation through the canonical capability path. */\nexport async function dispatchRuntimeComponentEvent(\n args: RuntimeComponentEventDispatchArgs,\n): Promise<readonly DataSourceDiagnostic[]> {\n const eventName = args.eventName ?? inferLocalEventName(args.event.type);\n const bindings =\n args.dataBindings?.[args.node.id]?.events?.[eventName] ??\n args.dataBindings?.[args.node.id]?.events?.[args.event.type] ??\n [];\n const diagnostics: DataSourceDiagnostic[] = [];\n const resultSlots: Record<string, BindingValue | undefined> = { ...(args.resultSlots ?? {}) };\n\n for (const binding of bindings) {\n const context = {\n context: args.context,\n event: args.event,\n executeCapability: args.executeCapability,\n resultSlots,\n stateAdapter: args.stateAdapter,\n writeResultSlot: (slot: string, value: BindingValue | undefined) => {\n resultSlots[slot] = value;\n args.writeResultSlot?.(slot, value);\n },\n };\n if (!matchesBindingCondition(binding.when, context)) continue;\n\n if (binding.target.result !== undefined) {\n context.writeResultSlot(binding.target.result, undefined);\n }\n\n const lifecycle = args.eventOperationLifecycle?.start({\n capability: binding.target.capability,\n nodeId: args.node.id,\n });\n if (args.eventOperationLifecycle !== undefined && lifecycle === undefined) break;\n\n try {\n const result = await executeRuntimeBindingInvocation(\n binding.target,\n context,\n { event: args.event, node: args.node },\n diagnostics,\n );\n if (lifecycle !== undefined && result?.ok) args.eventOperationLifecycle?.succeed(lifecycle);\n else if (lifecycle !== undefined)\n args.eventOperationLifecycle?.fail(\n lifecycle,\n resolveRuntimeEventOperationErrorMessage(diagnostics),\n );\n } catch {\n diagnostics.push({\n code: 'adapter-error',\n message: `Capability '${binding.target.capability}' could not be completed. Please try again.`,\n severity: 'error',\n });\n if (lifecycle !== undefined)\n args.eventOperationLifecycle?.fail(\n lifecycle,\n resolveRuntimeEventOperationErrorMessage(diagnostics),\n );\n break;\n }\n }\n\n return diagnostics;\n}\n\n/*** Wraps component callbacks so manifest event bindings retain the original callback behavior. */\nexport function wrapRuntimeEventProps(args: RuntimeEventPropWrapArgs): Record<string, unknown> {\n const props = { ...args.props };\n if (args.disableActions || args.dataBindings?.[args.node.id]?.events === undefined) return props;\n\n for (const eventName of Object.keys(args.dataBindings[args.node.id]?.events ?? {})) {\n const propName = eventNameToCallbackProp(eventName);\n const existing = props[propName];\n props[propName] = (...handlerArgs: unknown[]) => {\n const result = isRuntimeEventHandler(existing) ? existing(...handlerArgs) : undefined;\n void args.dispatchComponentEvent({\n context: args.context,\n dataBindings: args.dataBindings,\n event: createComponentEventFromHandlerArgs({\n capability: args.resolveEventCapability?.({ eventName, node: args.node }),\n eventName,\n handlerArgs,\n node: args.node,\n }),\n eventName,\n node: args.node,\n resultSlots: args.resultSlots,\n state: args.state,\n });\n return result;\n };\n }\n return props;\n}\n\n/*** Maps a platform callback invocation to the portable component event representation. */\nexport function createComponentEventFromHandlerArgs(args: {\n readonly capability?: Capability['id'];\n readonly node: UiNode;\n readonly eventName: string;\n readonly handlerArgs: readonly unknown[];\n}): ComponentEventDto<string, RuntimeEventPayload> {\n return {\n payload: createPayloadForEvent(args.eventName, args.handlerArgs),\n sourceNodeId: args.node.id,\n type: args.capability ?? args.eventName,\n };\n}\n\n/*** Resolves an authored expression-shaped payload for imperative consumers. */\nexport function resolveRuntimeActionValue(\n value: BindingExpression,\n args: RuntimeActionResolutionArgs,\n): BindingValue | undefined {\n return resolveRuntimeBindingExpressionSync(value, args);\n}\n\nfunction matchesBindingCondition(\n condition: BindingCondition | undefined,\n context: Parameters<typeof resolveRuntimeBindingExpressionSync>[1],\n): boolean {\n if (condition === undefined) return true;\n const source = resolveRuntimeBindingExpressionSync(condition.source, context);\n const value =\n condition.value === undefined\n ? undefined\n : resolveRuntimeBindingExpressionSync(condition.value, context);\n if (condition.operator === 'exists') return source !== undefined;\n if (condition.operator === 'notExists') return source === undefined;\n if (condition.operator === 'eq') return source === value;\n return source !== value;\n}\n\nfunction createPayloadForEvent(eventName: string, args: readonly unknown[]): RuntimeEventPayload {\n if (eventName === 'submit') return { values: asRecord(args[0]) ?? {} };\n if (eventName === 'changeText' || eventName === 'valueChange' || eventName === 'searchChange')\n return { value: args[0] };\n if (eventName === 'checkedChange') return { checked: args[0] };\n if (eventName === 'itemPress') {\n const item = asRecord(args[0]) ?? {};\n return typeof item.id === 'string' || typeof item.id === 'number'\n ? { item, itemId: item.id }\n : { item };\n }\n return asRecord(args[0]) ?? {};\n}\n\nfunction inferLocalEventName(eventType: string): string {\n return eventType.split('.').at(-1) ?? eventType;\n}\n\nfunction eventNameToCallbackProp(eventName: string): string {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n}\n\nfunction isRuntimeEventHandler(value: unknown): value is RuntimeEventHandler {\n return typeof value === 'function';\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return isRecord(value) ? value : undefined;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/runtime",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.7",
|
|
4
4
|
"description": "Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -348,8 +348,8 @@
|
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
"devDependencies": {
|
|
351
|
-
"@ankhorage/devtools": "^2.12.
|
|
352
|
-
"@ankhorage/paradox": "^0.6.
|
|
351
|
+
"@ankhorage/devtools": "^2.12.17",
|
|
352
|
+
"@ankhorage/paradox": "^0.6.2",
|
|
353
353
|
"@types/bun": "^1.4.5",
|
|
354
354
|
"@types/node": "^26.6.4",
|
|
355
355
|
"@types/react": "^19.3.0",
|
package/paradox/badges/npm.svg
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="npm: v5.7.
|
|
2
|
-
<title>npm: v5.7.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="npm: v5.7.7">
|
|
2
|
+
<title>npm: v5.7.7</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.7.
|
|
6
|
+
<text x="64" y="14" fill="#ffffff" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle">v5.7.7</text>
|
|
7
7
|
</svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contributors": [
|
|
3
|
+
{
|
|
4
|
+
"login": "ankhorage-renovate-sync[bot]",
|
|
5
|
+
"id": 323340348
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"login": "artiphishle",
|
|
9
|
+
"id": 137318798
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"login": "github-actions[bot]",
|
|
13
|
+
"id": 41898282
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"login": "renovate[bot]",
|
|
17
|
+
"id": 29139614
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"login": "faeb187",
|
|
21
|
+
"id": 389333
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -59,6 +59,7 @@ graph TD
|
|
|
59
59
|
module_src_runtimeActionRegistry_test_ts["src/runtimeActionRegistry.test.ts"]
|
|
60
60
|
package__ankhorage_runtime -.-> module_src_runtimeActionRegistry_test_ts
|
|
61
61
|
module_src_runtimeActionRegistry_test_ts --> module_src_runtimeActionRegistry_ts
|
|
62
|
+
module_src_runtimeActionRegistry_test_ts --> module_src_runtimeStateAdapter_ts
|
|
62
63
|
module_src_runtimeActionRegistry_ts["src/runtimeActionRegistry.ts"]
|
|
63
64
|
package__ankhorage_runtime -.-> module_src_runtimeActionRegistry_ts
|
|
64
65
|
module_src_runtimeActionRegistry_ts --> module_src_runtimeBindings_ts
|
|
@@ -141,6 +142,7 @@ graph TD
|
|
|
141
142
|
package__ankhorage_runtime -.-> module_src_runtimeNumberBindings_test_ts
|
|
142
143
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeActionRegistry_ts
|
|
143
144
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeCapabilityExecutor_ts
|
|
145
|
+
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeNodeProps_ts
|
|
144
146
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeStateAdapter_ts
|
|
145
147
|
module_src_runtimePackageIsolation_test_ts["src/runtimePackageIsolation.test.ts"]
|
|
146
148
|
package__ankhorage_runtime -.-> module_src_runtimePackageIsolation_test_ts
|
|
@@ -86,6 +86,7 @@ graph LR
|
|
|
86
86
|
module_src_rendering_test_ts --> module_src_rendering_ts
|
|
87
87
|
module_src_rendering_ts --> module_src_registry_tsx
|
|
88
88
|
module_src_runtimeActionRegistry_test_ts --> module_src_runtimeActionRegistry_ts
|
|
89
|
+
module_src_runtimeActionRegistry_test_ts --> module_src_runtimeStateAdapter_ts
|
|
89
90
|
module_src_runtimeActionRegistry_ts --> module_src_runtimeBindings_ts
|
|
90
91
|
module_src_runtimeActionRegistry_ts --> module_src_runtimeEventOperationLifecycle_ts
|
|
91
92
|
module_src_runtimeApiCapabilities_test_ts --> module_src_runtimeApiCapabilities_ts
|
|
@@ -124,6 +125,7 @@ graph LR
|
|
|
124
125
|
module_src_runtimeNodeProps_ts --> module_src_RuntimeRendererConfig_tsx
|
|
125
126
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeActionRegistry_ts
|
|
126
127
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeCapabilityExecutor_ts
|
|
128
|
+
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeNodeProps_ts
|
|
127
129
|
module_src_runtimeNumberBindings_test_ts --> module_src_runtimeStateAdapter_ts
|
|
128
130
|
module_src_RuntimeRenderer_test_ts --> module_src_runtimeRepeatEmptyState_ts
|
|
129
131
|
module_src_RuntimeRenderer_tsx --> module_src_registry_tsx
|
package/paradox/exports.json
CHANGED
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
294
294
|
"sourceLocation": {
|
|
295
295
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
296
|
-
"line":
|
|
296
|
+
"line": 187,
|
|
297
297
|
"column": 1
|
|
298
298
|
},
|
|
299
299
|
"exportPaths": [
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
404
404
|
"sourceLocation": {
|
|
405
405
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
406
|
-
"line":
|
|
406
|
+
"line": 71,
|
|
407
407
|
"column": 1
|
|
408
408
|
},
|
|
409
409
|
"exportPaths": [
|
|
@@ -415,11 +415,11 @@
|
|
|
415
415
|
],
|
|
416
416
|
"signatures": [
|
|
417
417
|
{
|
|
418
|
-
"label": "(options?: Pick<RuntimeComponentEventDispatchArgs, \"dataBindings\" | \"eventOperationLifecycle\" | \"executeCapability\" | \"resultSlots\" | \"writeResultSlot\">) => RuntimeActionRegistry",
|
|
418
|
+
"label": "(options?: Pick<RuntimeComponentEventDispatchArgs, \"stateAdapter\" | \"dataBindings\" | \"eventOperationLifecycle\" | \"executeCapability\" | \"resultSlots\" | \"writeResultSlot\">) => RuntimeActionRegistry",
|
|
419
419
|
"parameters": [
|
|
420
420
|
{
|
|
421
421
|
"name": "options",
|
|
422
|
-
"type": "Pick<RuntimeComponentEventDispatchArgs, \"dataBindings\" | \"eventOperationLifecycle\" | \"executeCapability\" | \"resultSlots\" | \"writeResultSlot\">",
|
|
422
|
+
"type": "Pick<RuntimeComponentEventDispatchArgs, \"stateAdapter\" | \"dataBindings\" | \"eventOperationLifecycle\" | \"executeCapability\" | \"resultSlots\" | \"writeResultSlot\">",
|
|
423
423
|
"required": false,
|
|
424
424
|
"description": null
|
|
425
425
|
}
|
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
709
709
|
"sourceLocation": {
|
|
710
710
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
711
|
-
"line":
|
|
711
|
+
"line": 90,
|
|
712
712
|
"column": 1
|
|
713
713
|
},
|
|
714
714
|
"exportPaths": [
|
|
@@ -1143,7 +1143,7 @@
|
|
|
1143
1143
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
1144
1144
|
"sourceLocation": {
|
|
1145
1145
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
1146
|
-
"line":
|
|
1146
|
+
"line": 201,
|
|
1147
1147
|
"column": 1
|
|
1148
1148
|
},
|
|
1149
1149
|
"exportPaths": [
|
|
@@ -1626,7 +1626,7 @@
|
|
|
1626
1626
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
1627
1627
|
"sourceLocation": {
|
|
1628
1628
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
1629
|
-
"line":
|
|
1629
|
+
"line": 34,
|
|
1630
1630
|
"column": 1
|
|
1631
1631
|
},
|
|
1632
1632
|
"exportPaths": [
|
|
@@ -1658,7 +1658,7 @@
|
|
|
1658
1658
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
1659
1659
|
"sourceLocation": {
|
|
1660
1660
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
1661
|
-
"line":
|
|
1661
|
+
"line": 44,
|
|
1662
1662
|
"column": 1
|
|
1663
1663
|
},
|
|
1664
1664
|
"exportPaths": [
|
|
@@ -1709,7 +1709,7 @@
|
|
|
1709
1709
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
1710
1710
|
"sourceLocation": {
|
|
1711
1711
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
1712
|
-
"line":
|
|
1712
|
+
"line": 38,
|
|
1713
1713
|
"column": 1
|
|
1714
1714
|
},
|
|
1715
1715
|
"exportPaths": [
|
|
@@ -2668,7 +2668,7 @@
|
|
|
2668
2668
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
2669
2669
|
"sourceLocation": {
|
|
2670
2670
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
2671
|
-
"line":
|
|
2671
|
+
"line": 48,
|
|
2672
2672
|
"column": 1
|
|
2673
2673
|
},
|
|
2674
2674
|
"exportPaths": [
|
|
@@ -2744,6 +2744,13 @@
|
|
|
2744
2744
|
"required": false,
|
|
2745
2745
|
"description": null
|
|
2746
2746
|
},
|
|
2747
|
+
{
|
|
2748
|
+
"name": "stateAdapter",
|
|
2749
|
+
"kind": "property",
|
|
2750
|
+
"type": "import(\"@ankhorage/contracts\").StateAdapter | undefined",
|
|
2751
|
+
"required": false,
|
|
2752
|
+
"description": null
|
|
2753
|
+
},
|
|
2747
2754
|
{
|
|
2748
2755
|
"name": "writeResultSlot",
|
|
2749
2756
|
"kind": "property",
|
|
@@ -2853,7 +2860,7 @@
|
|
|
2853
2860
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
2854
2861
|
"sourceLocation": {
|
|
2855
2862
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
2856
|
-
"line":
|
|
2863
|
+
"line": 29,
|
|
2857
2864
|
"column": 1
|
|
2858
2865
|
},
|
|
2859
2866
|
"exportPaths": [
|
|
@@ -3070,7 +3077,7 @@
|
|
|
3070
3077
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
3071
3078
|
"sourceLocation": {
|
|
3072
3079
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
3073
|
-
"line":
|
|
3080
|
+
"line": 59,
|
|
3074
3081
|
"column": 1
|
|
3075
3082
|
},
|
|
3076
3083
|
"exportPaths": [
|
|
@@ -4439,7 +4446,7 @@
|
|
|
4439
4446
|
"modulePath": "src/runtimeActionRegistry.ts",
|
|
4440
4447
|
"sourceLocation": {
|
|
4441
4448
|
"filePath": "src/runtimeActionRegistry.ts",
|
|
4442
|
-
"line":
|
|
4449
|
+
"line": 157,
|
|
4443
4450
|
"column": 1
|
|
4444
4451
|
},
|
|
4445
4452
|
"exportPaths": [
|