@ankhorage/runtime 4.1.1 → 5.0.1
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 +18 -0
- package/README.md +6 -6
- package/dist/RuntimeRenderer.d.ts +7 -7
- package/dist/RuntimeRenderer.d.ts.map +1 -1
- package/dist/RuntimeRenderer.js +40 -80
- package/dist/RuntimeRenderer.js.map +1 -1
- package/dist/RuntimeRendererConfig.d.ts +7 -22
- package/dist/RuntimeRendererConfig.d.ts.map +1 -1
- package/dist/RuntimeRendererConfig.js +5 -8
- package/dist/RuntimeRendererConfig.js.map +1 -1
- package/dist/RuntimeScreen.d.ts.map +1 -1
- package/dist/RuntimeScreen.js +10 -5
- package/dist/RuntimeScreen.js.map +1 -1
- package/dist/bindings.d.ts +4 -8
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js +2 -4
- package/dist/bindings.js.map +1 -1
- package/dist/index.d.ts +10 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/runtimeActionRegistry.d.ts +19 -24
- package/dist/runtimeActionRegistry.d.ts.map +1 -1
- package/dist/runtimeActionRegistry.js +90 -306
- package/dist/runtimeActionRegistry.js.map +1 -1
- package/dist/runtimeApiCapabilities.d.ts +11 -0
- package/dist/runtimeApiCapabilities.d.ts.map +1 -0
- package/dist/runtimeApiCapabilities.js +67 -0
- package/dist/runtimeApiCapabilities.js.map +1 -0
- package/dist/runtimeBindings.d.ts +28 -17
- package/dist/runtimeBindings.d.ts.map +1 -1
- package/dist/runtimeBindings.js +157 -197
- package/dist/runtimeBindings.js.map +1 -1
- package/dist/runtimeCapabilityExecutor.d.ts +8 -0
- package/dist/runtimeCapabilityExecutor.d.ts.map +1 -0
- package/dist/runtimeCapabilityExecutor.js +21 -0
- package/dist/runtimeCapabilityExecutor.js.map +1 -0
- package/dist/runtimeEventExecution.d.ts +1 -4
- package/dist/runtimeEventExecution.d.ts.map +1 -1
- package/dist/runtimeEventExecution.js.map +1 -1
- package/dist/runtimeEventOperationLifecycle.d.ts +4 -3
- package/dist/runtimeEventOperationLifecycle.d.ts.map +1 -1
- package/dist/runtimeEventOperationLifecycle.js +5 -5
- package/dist/runtimeEventOperationLifecycle.js.map +1 -1
- package/dist/runtimeNodeProps.d.ts +12 -24
- package/dist/runtimeNodeProps.d.ts.map +1 -1
- package/dist/runtimeNodeProps.js +27 -121
- package/dist/runtimeNodeProps.js.map +1 -1
- package/dist/runtimeRepeat.d.ts +6 -2
- package/dist/runtimeRepeat.d.ts.map +1 -1
- package/dist/runtimeRepeat.js +29 -108
- package/dist/runtimeRepeat.js.map +1 -1
- package/dist/runtimeScreenLoaders.d.ts +27 -42
- package/dist/runtimeScreenLoaders.d.ts.map +1 -1
- package/dist/runtimeScreenLoaders.js +113 -273
- package/dist/runtimeScreenLoaders.js.map +1 -1
- package/package.json +10 -4
- package/paradox/badges/npm.svg +3 -3
- package/paradox/components.md +6 -7
- package/paradox/diagrams/architecture-overview.mmd +25 -79
- package/paradox/diagrams/export-graph.mmd +67 -105
- package/paradox/diagrams/module-relationships.mmd +19 -59
- package/paradox/diagrams/sequences/apply-runtime-binding-data-path.mmd +14 -0
- package/paradox/diagrams/sequences/create-component-event-from-handler-args.mmd +0 -13
- package/paradox/diagrams/sequences/create-runtime-screen-loader-request-key.mmd +5 -0
- package/paradox/diagrams/sequences/execute-runtime-binding-invocation.mmd +19 -0
- package/paradox/diagrams/sequences/resolve-binding-input-map-sync.mmd +5 -0
- package/paradox/diagrams/sequences/resolve-binding-input-map.mmd +5 -0
- package/paradox/diagrams/sequences/runtime-screen.mmd +6 -3
- package/paradox/diagrams/sequences/use-runtime-screen-operation-loaders.mmd +6 -3
- package/paradox/exports.json +610 -848
- package/paradox/exports.md +280 -308
- package/paradox/index.html +1120 -2266
- package/paradox/paradox.json +2724 -5528
- package/dist/runtimeApiOperations.d.ts +0 -8
- package/dist/runtimeApiOperations.d.ts.map +0 -1
- package/dist/runtimeApiOperations.js +0 -38
- package/dist/runtimeApiOperations.js.map +0 -1
- package/dist/runtimeApiSelection.d.ts +0 -8
- package/dist/runtimeApiSelection.d.ts.map +0 -1
- package/dist/runtimeApiSelection.js +0 -52
- package/dist/runtimeApiSelection.js.map +0 -1
- package/dist/runtimeDbPersist.d.ts +0 -34
- package/dist/runtimeDbPersist.d.ts.map +0 -1
- package/dist/runtimeDbPersist.js +0 -73
- package/dist/runtimeDbPersist.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ankhorage/runtime
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d1d95d1: Declare `@ankhorage/capability` as a runtime dependency so packed catalog verification resolves from the installed package boundary.
|
|
8
|
+
|
|
9
|
+
## 5.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- cadf2f1: Migrate runtime bindings to Contracts 26 capability expressions, invocations, and result slots.
|
|
14
|
+
|
|
15
|
+
## 4.1.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- e51bcd5: Update dependencies: `@ankhorage/contracts`.
|
|
20
|
+
|
|
3
21
|
## 4.1.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/runtime
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.
|
|
9
9
|
|
|
@@ -44,13 +44,14 @@ createRuntimeManifest({
|
|
|
44
44
|
- [Architecture overview](./paradox/diagrams/architecture-overview.mmd)
|
|
45
45
|
- [Module relationships](./paradox/diagrams/module-relationships.mmd)
|
|
46
46
|
- [Export graph](./paradox/diagrams/export-graph.mmd)
|
|
47
|
+
- [applyRuntimeBindingDataPath sequence](./paradox/diagrams/sequences/apply-runtime-binding-data-path.mmd)
|
|
47
48
|
- [createComponentEventFromHandlerArgs sequence](./paradox/diagrams/sequences/create-component-event-from-handler-args.mmd)
|
|
48
49
|
- [createRuntimeEventOperationBindingContext sequence](./paradox/diagrams/sequences/create-runtime-event-operation-binding-context.mmd)
|
|
49
|
-
- [
|
|
50
|
+
- [createRuntimeScreenLoaderRequestKey sequence](./paradox/diagrams/sequences/create-runtime-screen-loader-request-key.mmd)
|
|
51
|
+
- [executeRuntimeBindingInvocation sequence](./paradox/diagrams/sequences/execute-runtime-binding-invocation.mmd)
|
|
50
52
|
- [mergeRuntimeRendererConfig sequence](./paradox/diagrams/sequences/merge-runtime-renderer-config.mmd)
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [resolveRuntimeActionValue sequence](./paradox/diagrams/sequences/resolve-runtime-action-value.mmd)
|
|
53
|
+
- [resolveBindingInputMap sequence](./paradox/diagrams/sequences/resolve-binding-input-map.mmd)
|
|
54
|
+
- [resolveBindingInputMapSync sequence](./paradox/diagrams/sequences/resolve-binding-input-map-sync.mmd)
|
|
54
55
|
- [resolveRuntimeContextCapability sequence](./paradox/diagrams/sequences/resolve-runtime-context-capability.mmd)
|
|
55
56
|
- [RuntimeRendererConfigProvider sequence](./paradox/diagrams/sequences/runtime-renderer-config-provider.mmd)
|
|
56
57
|
- [RuntimeScreen sequence](./paradox/diagrams/sequences/runtime-screen.mmd)
|
|
@@ -59,5 +60,4 @@ createRuntimeManifest({
|
|
|
59
60
|
- [useOptionalManifestContext sequence](./paradox/diagrams/sequences/use-optional-manifest-context.mmd)
|
|
60
61
|
- [useRuntimeRendererConfig sequence](./paradox/diagrams/sequences/use-runtime-renderer-config.mmd)
|
|
61
62
|
- [useRuntimeScreenOperationLoaders sequence](./paradox/diagrams/sequences/use-runtime-screen-operation-loaders.mmd)
|
|
62
|
-
- [validateRuntimeBindingOperationRef sequence](./paradox/diagrams/sequences/validate-runtime-binding-operation-ref.mmd)
|
|
63
63
|
- [wrapRuntimeEventProps sequence](./paradox/diagrams/sequences/wrap-runtime-event-props.mmd)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentDataBindingRegistry, DataSourceDiagnostic, DbAdapter, DbRealtimeAdapter, MediaAssetRegistry, StateAdapter, UiNode } from '@ankhorage/contracts';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ComponentRegistry } from './registry';
|
|
4
|
-
import
|
|
4
|
+
import { type RuntimeEventCapabilityResolver } from './runtimeActionRegistry';
|
|
5
|
+
import type { RuntimeBindingResultCache, RuntimeCapabilityExecutor } from './runtimeBindings';
|
|
5
6
|
import type { RuntimeMediaAssetResolver } from './runtimeMedia';
|
|
6
|
-
import { type
|
|
7
|
+
import { type RuntimeRendererWrapArgs } from './RuntimeRendererConfig';
|
|
7
8
|
export interface RuntimeRendererProps {
|
|
8
9
|
node: UiNode;
|
|
9
10
|
isRoot?: boolean;
|
|
@@ -14,13 +15,12 @@ export interface RuntimeRendererProps {
|
|
|
14
15
|
dbRealtimeAdapter?: DbRealtimeAdapter;
|
|
15
16
|
stateAdapter?: StateAdapter;
|
|
16
17
|
bindingContext?: Record<string, unknown>;
|
|
17
|
-
apis?: ApiDefinitionRegistry;
|
|
18
18
|
dataBindings?: ComponentDataBindingRegistry;
|
|
19
19
|
mediaAssets?: MediaAssetRegistry;
|
|
20
20
|
resolveMediaAsset?: RuntimeMediaAssetResolver;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
resultSlots?: RuntimeBindingResultCache;
|
|
22
|
+
executeCapability?: RuntimeCapabilityExecutor;
|
|
23
|
+
resolveEventCapability?: RuntimeEventCapabilityResolver;
|
|
24
24
|
onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;
|
|
25
25
|
}
|
|
26
26
|
export declare function RuntimeRenderer(props: RuntimeRendererProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeRenderer.d.ts","sourceRoot":"","sources":["../src/RuntimeRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RuntimeRenderer.d.ts","sourceRoot":"","sources":["../src/RuntimeRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,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,YAAY,CAAC;AAMpD,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAO9F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAWjC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;IACxD,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAiV1D"}
|
package/dist/RuntimeRenderer.js
CHANGED
|
@@ -2,18 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { getUnknownComponentDiagnostic, resolveRenderedChildren, resolveRuntimeRegistry, } from './rendering';
|
|
4
4
|
import { wrapRuntimeEventProps, } from './runtimeActionRegistry';
|
|
5
|
-
import { createDbPersistActionHandler } from './runtimeDbPersist';
|
|
6
5
|
import { dispatchRuntimeComponentEventWithReporting } from './runtimeEventExecution';
|
|
7
6
|
import { createRuntimeEventOperationBindingContext, createRuntimeEventOperationLifecycle, IDLE_RUNTIME_EVENT_OPERATION_STATE, } from './runtimeEventOperationLifecycle';
|
|
8
7
|
import { RuntimeMediaResolutionCacheProvider, useRuntimeMediaResolutionCache, } from './runtimeMediaCache';
|
|
9
|
-
import { resolveRuntimeNodeProps
|
|
8
|
+
import { resolveRuntimeNodeProps } from './runtimeNodeProps';
|
|
10
9
|
import { mergeRuntimeRendererConfig, RuntimeRendererConfigProvider, useRuntimeRendererConfig, } from './RuntimeRendererConfig';
|
|
11
10
|
import { createRuntimeRepeatBindingContext, resolveRuntimeRepeatItemKey, resolveRuntimeRepeatItemsAsync, resolveRuntimeRepeatItemsSync, } from './runtimeRepeat';
|
|
12
11
|
import { createRepeatDiagnosticsKey } from './runtimeRepeatDiagnostics';
|
|
13
12
|
import { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState';
|
|
14
13
|
import { useRuntimeMediaProps } from './useRuntimeMediaProps';
|
|
15
14
|
export function RuntimeRenderer(props) {
|
|
16
|
-
const { node, isRoot = false, registry, disableActions = false, wrapNode, dbAdapter, dbRealtimeAdapter, stateAdapter, bindingContext,
|
|
15
|
+
const { node, isRoot = false, registry, disableActions = false, wrapNode, dbAdapter, dbRealtimeAdapter, stateAdapter, bindingContext, dataBindings, mediaAssets, resolveMediaAsset, resultSlots, executeCapability, resolveEventCapability, onDiagnostics, } = props;
|
|
17
16
|
const inheritedConfig = useRuntimeRendererConfig();
|
|
18
17
|
const [rootEventOperationState, setRootEventOperationState] = React.useState(IDLE_RUNTIME_EVENT_OPERATION_STATE);
|
|
19
18
|
const rootEventOperationLifecycle = React.useMemo(() => createRuntimeEventOperationLifecycle(setRootEventOperationState), []);
|
|
@@ -25,51 +24,49 @@ export function RuntimeRenderer(props) {
|
|
|
25
24
|
? createRuntimeEventOperationBindingContext(rootBindingContext, eventOperationState)
|
|
26
25
|
: bindingContext;
|
|
27
26
|
const mediaResolutionCache = useRuntimeMediaResolutionCache();
|
|
28
|
-
const
|
|
29
|
-
const [
|
|
30
|
-
const
|
|
31
|
-
|
|
27
|
+
const inheritedResultSlots = inheritedConfig.resultSlots;
|
|
28
|
+
const [localResultSlots, setLocalResultSlots] = React.useState({});
|
|
29
|
+
const writeLocalResultSlot = React.useCallback((key, value) => {
|
|
30
|
+
setLocalResultSlots((currentResults) => ({
|
|
32
31
|
...currentResults,
|
|
33
32
|
[key]: value,
|
|
34
33
|
}));
|
|
35
34
|
}, []);
|
|
36
|
-
const
|
|
37
|
-
...(
|
|
38
|
-
...(
|
|
39
|
-
...
|
|
40
|
-
}), [
|
|
35
|
+
const effectiveResultSlots = React.useMemo(() => ({
|
|
36
|
+
...(inheritedResultSlots ?? {}),
|
|
37
|
+
...(resultSlots ?? {}),
|
|
38
|
+
...localResultSlots,
|
|
39
|
+
}), [inheritedResultSlots, localResultSlots, resultSlots]);
|
|
41
40
|
const explicitConfig = React.useMemo(() => ({
|
|
42
|
-
apis,
|
|
43
41
|
bindingContext: effectiveBindingContext,
|
|
44
42
|
dataBindings,
|
|
45
43
|
dbAdapter,
|
|
46
44
|
dbRealtimeAdapter,
|
|
47
45
|
disableActions,
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
executeCapability,
|
|
47
|
+
resolveEventCapability,
|
|
50
48
|
mediaAssets,
|
|
51
|
-
|
|
49
|
+
resultSlots: effectiveResultSlots,
|
|
52
50
|
onDiagnostics,
|
|
53
51
|
registry,
|
|
54
52
|
resolveMediaAsset,
|
|
55
53
|
stateAdapter,
|
|
56
54
|
wrapNode,
|
|
57
|
-
|
|
55
|
+
writeResultSlot: inheritedConfig.writeResultSlot ?? writeLocalResultSlot,
|
|
58
56
|
eventOperationLifecycle: isRoot
|
|
59
57
|
? rootEventOperationLifecycle
|
|
60
58
|
: inheritedConfig.eventOperationLifecycle,
|
|
61
59
|
eventOperationState,
|
|
62
60
|
}), [
|
|
63
|
-
apis,
|
|
64
61
|
effectiveBindingContext,
|
|
65
62
|
dataBindings,
|
|
66
63
|
dbAdapter,
|
|
67
64
|
dbRealtimeAdapter,
|
|
68
65
|
disableActions,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
inheritedConfig.
|
|
66
|
+
executeCapability,
|
|
67
|
+
resolveEventCapability,
|
|
68
|
+
effectiveResultSlots,
|
|
69
|
+
inheritedConfig.writeResultSlot,
|
|
73
70
|
inheritedConfig.eventOperationLifecycle,
|
|
74
71
|
isRoot,
|
|
75
72
|
mediaAssets,
|
|
@@ -78,49 +75,22 @@ export function RuntimeRenderer(props) {
|
|
|
78
75
|
resolveMediaAsset,
|
|
79
76
|
stateAdapter,
|
|
80
77
|
wrapNode,
|
|
81
|
-
|
|
78
|
+
writeLocalResultSlot,
|
|
82
79
|
eventOperationState,
|
|
83
80
|
rootEventOperationLifecycle,
|
|
84
81
|
]);
|
|
85
82
|
const effectiveConfig = React.useMemo(() => mergeRuntimeRendererConfig(explicitConfig, inheritedConfig), [explicitConfig, inheritedConfig]);
|
|
86
|
-
const effectiveActionHandlers = React.useMemo(() => {
|
|
87
|
-
if (!effectiveConfig.dbAdapter) {
|
|
88
|
-
return effectiveConfig.actionHandlers;
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
'db.persist': createDbPersistActionHandler({ dbAdapter: effectiveConfig.dbAdapter }),
|
|
92
|
-
...(effectiveConfig.actionHandlers ?? {}),
|
|
93
|
-
};
|
|
94
|
-
}, [effectiveConfig.actionHandlers, effectiveConfig.dbAdapter]);
|
|
95
|
-
const executeRuntimeAction = React.useCallback(async (actionArgs) => {
|
|
96
|
-
if (effectiveConfig.executeAction) {
|
|
97
|
-
await effectiveConfig.executeAction(actionArgs);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const handler = effectiveActionHandlers?.[actionArgs.action.type];
|
|
101
|
-
if (handler) {
|
|
102
|
-
await handler(actionArgs);
|
|
103
|
-
}
|
|
104
|
-
}, [effectiveActionHandlers, effectiveConfig]);
|
|
105
83
|
const dispatchRuntimeEvent = React.useCallback(async (eventArgs) => {
|
|
106
84
|
await dispatchRuntimeComponentEventWithReporting({
|
|
107
85
|
...eventArgs,
|
|
108
|
-
actionHandlers: effectiveActionHandlers,
|
|
109
|
-
apis: eventArgs.apis ?? effectiveConfig.apis,
|
|
110
86
|
dataBindings: eventArgs.dataBindings ?? effectiveConfig.dataBindings,
|
|
111
|
-
|
|
112
|
-
executeOperation: eventArgs.executeOperation ?? effectiveConfig.executeOperation,
|
|
87
|
+
executeCapability: eventArgs.executeCapability ?? effectiveConfig.executeCapability,
|
|
113
88
|
onDiagnostics: effectiveConfig.onDiagnostics,
|
|
114
|
-
|
|
115
|
-
|
|
89
|
+
resultSlots: eventArgs.resultSlots ?? effectiveConfig.resultSlots,
|
|
90
|
+
writeResultSlot: eventArgs.writeResultSlot ?? effectiveConfig.writeResultSlot,
|
|
116
91
|
eventOperationLifecycle: eventArgs.eventOperationLifecycle ?? effectiveConfig.eventOperationLifecycle,
|
|
117
92
|
});
|
|
118
|
-
}, [
|
|
119
|
-
const actionHandlerCache = React.useMemo(() => new WeakMap(), []);
|
|
120
|
-
const functionHandlerCache = React.useMemo(() => new WeakMap(), []);
|
|
121
|
-
const handleAction = React.useCallback((action) => {
|
|
122
|
-
void executeRuntimeAction({ action });
|
|
123
|
-
}, [executeRuntimeAction]);
|
|
93
|
+
}, [effectiveConfig]);
|
|
124
94
|
const effectiveRegistry = React.useMemo(() => resolveRuntimeRegistry({
|
|
125
95
|
propRegistry: registry,
|
|
126
96
|
configRegistry: effectiveConfig.registry,
|
|
@@ -132,23 +102,21 @@ export function RuntimeRenderer(props) {
|
|
|
132
102
|
return null;
|
|
133
103
|
}
|
|
134
104
|
return resolveRuntimeRepeatItemsSync(repeat, {
|
|
135
|
-
apis: effectiveConfig.apis,
|
|
136
105
|
context: effectiveConfig.bindingContext,
|
|
137
106
|
dataBindings: effectiveConfig.dataBindings,
|
|
138
|
-
|
|
107
|
+
executeCapability: effectiveConfig.executeCapability,
|
|
139
108
|
node,
|
|
140
|
-
|
|
109
|
+
resultSlots: effectiveConfig.resultSlots,
|
|
141
110
|
stateAdapter: effectiveConfig.stateAdapter,
|
|
142
|
-
|
|
111
|
+
writeResultSlot: effectiveConfig.writeResultSlot,
|
|
143
112
|
});
|
|
144
113
|
}, [
|
|
145
|
-
effectiveConfig.apis,
|
|
146
114
|
effectiveConfig.bindingContext,
|
|
147
115
|
effectiveConfig.dataBindings,
|
|
148
|
-
effectiveConfig.
|
|
149
|
-
effectiveConfig.
|
|
116
|
+
effectiveConfig.executeCapability,
|
|
117
|
+
effectiveConfig.resultSlots,
|
|
150
118
|
effectiveConfig.stateAdapter,
|
|
151
|
-
effectiveConfig.
|
|
119
|
+
effectiveConfig.writeResultSlot,
|
|
152
120
|
node,
|
|
153
121
|
]);
|
|
154
122
|
const repeatRequestToken = React.useMemo(() => (node.repeat && repeatSyncResult?.status === 'pending' ? {} : null), [node.repeat, repeatSyncResult]);
|
|
@@ -164,14 +132,13 @@ export function RuntimeRenderer(props) {
|
|
|
164
132
|
}
|
|
165
133
|
void (async () => {
|
|
166
134
|
const result = await resolveRuntimeRepeatItemsAsync(repeat, {
|
|
167
|
-
apis: effectiveConfig.apis,
|
|
168
135
|
context: effectiveConfig.bindingContext,
|
|
169
136
|
dataBindings: effectiveConfig.dataBindings,
|
|
170
|
-
|
|
137
|
+
executeCapability: effectiveConfig.executeCapability,
|
|
171
138
|
node,
|
|
172
|
-
|
|
139
|
+
resultSlots: effectiveConfig.resultSlots,
|
|
173
140
|
stateAdapter: effectiveConfig.stateAdapter,
|
|
174
|
-
|
|
141
|
+
writeResultSlot: effectiveConfig.writeResultSlot,
|
|
175
142
|
});
|
|
176
143
|
if (repeatRequestIdRef.current !== requestId) {
|
|
177
144
|
return;
|
|
@@ -182,13 +149,12 @@ export function RuntimeRenderer(props) {
|
|
|
182
149
|
repeatRequestIdRef.current += 1;
|
|
183
150
|
};
|
|
184
151
|
}, [
|
|
185
|
-
effectiveConfig.apis,
|
|
186
152
|
effectiveConfig.bindingContext,
|
|
187
153
|
effectiveConfig.dataBindings,
|
|
188
|
-
effectiveConfig.
|
|
189
|
-
effectiveConfig.
|
|
154
|
+
effectiveConfig.executeCapability,
|
|
155
|
+
effectiveConfig.resultSlots,
|
|
190
156
|
effectiveConfig.stateAdapter,
|
|
191
|
-
effectiveConfig.
|
|
157
|
+
effectiveConfig.writeResultSlot,
|
|
192
158
|
node,
|
|
193
159
|
repeatRequestToken,
|
|
194
160
|
]);
|
|
@@ -208,13 +174,12 @@ export function RuntimeRenderer(props) {
|
|
|
208
174
|
effectiveConfig.onDiagnostics?.(repeatDiagnostics);
|
|
209
175
|
}, [effectiveConfig, node, repeatDiagnostics]);
|
|
210
176
|
const bindingResolvedProps = resolveRuntimeNodeProps({
|
|
211
|
-
apis: effectiveConfig.apis,
|
|
212
177
|
bindingContext: effectiveConfig.bindingContext,
|
|
213
178
|
dataBindings: effectiveConfig.dataBindings,
|
|
214
179
|
dbAdapter: effectiveConfig.dbAdapter,
|
|
215
180
|
dbRealtimeAdapter: effectiveConfig.dbRealtimeAdapter,
|
|
216
181
|
node,
|
|
217
|
-
|
|
182
|
+
resultSlots: effectiveConfig.resultSlots,
|
|
218
183
|
stateAdapter: effectiveConfig.stateAdapter,
|
|
219
184
|
});
|
|
220
185
|
const mediaResolvedProps = useRuntimeMediaProps({
|
|
@@ -266,20 +231,15 @@ export function RuntimeRenderer(props) {
|
|
|
266
231
|
? node.repeat.empty?.map((child) => (<RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry}/>))
|
|
267
232
|
: undefined
|
|
268
233
|
: node.children?.map((child) => (<RuntimeRenderer key={child.id} node={child} registry={effectiveRegistry}/>));
|
|
269
|
-
const propsWithActions = wrapRuntimeActionProps({
|
|
270
|
-
props: resolvedProps,
|
|
271
|
-
disableActions: effectiveConfig.disableActions === true,
|
|
272
|
-
handleAction,
|
|
273
|
-
actionHandlerCache,
|
|
274
|
-
functionHandlerCache,
|
|
275
|
-
});
|
|
276
234
|
const propsWithEvents = wrapRuntimeEventProps({
|
|
277
235
|
context: effectiveConfig.bindingContext,
|
|
278
236
|
dataBindings: effectiveConfig.dataBindings,
|
|
279
|
-
props:
|
|
237
|
+
props: resolvedProps,
|
|
280
238
|
disableActions: effectiveConfig.disableActions === true,
|
|
281
239
|
dispatchComponentEvent: dispatchRuntimeEvent,
|
|
282
240
|
node,
|
|
241
|
+
resultSlots: effectiveConfig.resultSlots,
|
|
242
|
+
resolveEventCapability: effectiveConfig.resolveEventCapability,
|
|
283
243
|
});
|
|
284
244
|
const componentChildren = resolveRenderedChildren({
|
|
285
245
|
propChildren: propsWithEvents.children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeRenderer.js","sourceRoot":"","sources":["../src/RuntimeRenderer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAA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T,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 ApiDefinitionRegistry,\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 wrapRuntimeEventProps,\n} from './runtimeActionRegistry';\nimport type {\n RuntimeBindingOperationExecutor,\n RuntimeBindingOperationKey,\n RuntimeBindingOperationResultCache,\n} from './runtimeBindings';\nimport { createDbPersistActionHandler } from './runtimeDbPersist';\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, wrapRuntimeActionProps } from './runtimeNodeProps';\nimport type { RuntimeActionHandlerArgs } from './RuntimeRendererConfig';\nimport {\n mergeRuntimeRendererConfig,\n type RuntimeActionExecutor,\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';\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 apis?: ApiDefinitionRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n mediaAssets?: MediaAssetRegistry;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n operationResults?: RuntimeBindingOperationResultCache;\n executeAction?: RuntimeActionExecutor;\n executeOperation?: RuntimeBindingOperationExecutor;\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 apis,\n dataBindings,\n mediaAssets,\n resolveMediaAsset,\n operationResults,\n executeAction,\n executeOperation,\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 =\n isRoot && eventOperationState !== undefined\n ? createRuntimeEventOperationBindingContext(rootBindingContext, eventOperationState)\n : bindingContext;\n const mediaResolutionCache = useRuntimeMediaResolutionCache();\n const inheritedOperationResults = inheritedConfig.operationResults;\n const [localOperationResults, setLocalOperationResults] =\n React.useState<RuntimeBindingOperationResultCache>({});\n const writeLocalOperationResult = React.useCallback(\n (key: RuntimeBindingOperationKey, value: BindingValue) => {\n setLocalOperationResults((currentResults) => ({\n ...currentResults,\n [key]: value,\n }));\n },\n [],\n );\n const effectiveOperationResults = React.useMemo(\n () => ({\n ...(inheritedOperationResults ?? {}),\n ...(operationResults ?? {}),\n ...localOperationResults,\n }),\n [inheritedOperationResults, localOperationResults, operationResults],\n );\n const explicitConfig = React.useMemo(\n () => ({\n apis,\n bindingContext: effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeAction,\n executeOperation,\n mediaAssets,\n operationResults: effectiveOperationResults,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeOperationResult: inheritedConfig.writeOperationResult ?? writeLocalOperationResult,\n eventOperationLifecycle: isRoot\n ? rootEventOperationLifecycle\n : inheritedConfig.eventOperationLifecycle,\n eventOperationState,\n }),\n [\n apis,\n effectiveBindingContext,\n dataBindings,\n dbAdapter,\n dbRealtimeAdapter,\n disableActions,\n executeAction,\n effectiveOperationResults,\n executeOperation,\n inheritedConfig.writeOperationResult,\n inheritedConfig.eventOperationLifecycle,\n isRoot,\n mediaAssets,\n onDiagnostics,\n registry,\n resolveMediaAsset,\n stateAdapter,\n wrapNode,\n writeLocalOperationResult,\n eventOperationState,\n rootEventOperationLifecycle,\n ],\n );\n const effectiveConfig = React.useMemo(\n () => mergeRuntimeRendererConfig(explicitConfig, inheritedConfig),\n [explicitConfig, inheritedConfig],\n );\n const effectiveActionHandlers = React.useMemo(() => {\n if (!effectiveConfig.dbAdapter) {\n return effectiveConfig.actionHandlers;\n }\n\n return {\n 'db.persist': createDbPersistActionHandler({ dbAdapter: effectiveConfig.dbAdapter }),\n ...(effectiveConfig.actionHandlers ?? {}),\n };\n }, [effectiveConfig.actionHandlers, effectiveConfig.dbAdapter]);\n const executeRuntimeAction = React.useCallback(\n async (actionArgs: RuntimeActionHandlerArgs) => {\n if (effectiveConfig.executeAction) {\n await effectiveConfig.executeAction(actionArgs);\n return;\n }\n\n const handler = effectiveActionHandlers?.[actionArgs.action.type];\n if (handler) {\n await handler(actionArgs);\n }\n },\n [effectiveActionHandlers, effectiveConfig],\n );\n const dispatchRuntimeEvent = React.useCallback(\n async (eventArgs: RuntimeComponentEventDispatchArgs) => {\n await dispatchRuntimeComponentEventWithReporting({\n ...eventArgs,\n actionHandlers: effectiveActionHandlers,\n apis: eventArgs.apis ?? effectiveConfig.apis,\n dataBindings: eventArgs.dataBindings ?? effectiveConfig.dataBindings,\n executeAction: effectiveConfig.executeAction ?? executeRuntimeAction,\n executeOperation: eventArgs.executeOperation ?? effectiveConfig.executeOperation,\n onDiagnostics: effectiveConfig.onDiagnostics,\n operationResults: eventArgs.operationResults ?? effectiveConfig.operationResults,\n writeOperationResult:\n eventArgs.writeOperationResult ?? effectiveConfig.writeOperationResult,\n eventOperationLifecycle:\n eventArgs.eventOperationLifecycle ?? effectiveConfig.eventOperationLifecycle,\n });\n },\n [effectiveActionHandlers, effectiveConfig, executeRuntimeAction],\n );\n const actionHandlerCache = React.useMemo(\n () =>\n new WeakMap<\n object,\n {\n readonly handleAction: (action: RuntimeActionHandlerArgs['action']) => void;\n readonly handler: (...args: unknown[]) => void;\n }\n >(),\n [],\n );\n const functionHandlerCache = React.useMemo(\n () => new WeakMap<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>(),\n [],\n );\n const handleAction = React.useCallback(\n (action: RuntimeActionHandlerArgs['action']) => {\n void executeRuntimeAction({ action });\n },\n [executeRuntimeAction],\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 = React.useMemo(() => {\n const { repeat } = node;\n if (!repeat) {\n return null;\n }\n\n return resolveRuntimeRepeatItemsSync(repeat, {\n apis: effectiveConfig.apis,\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeOperation: effectiveConfig.executeOperation,\n node,\n operationResults: effectiveConfig.operationResults,\n stateAdapter: effectiveConfig.stateAdapter,\n writeOperationResult: effectiveConfig.writeOperationResult,\n });\n }, [\n effectiveConfig.apis,\n effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeOperation,\n effectiveConfig.operationResults,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeOperationResult,\n node,\n ]);\n const repeatRequestToken = React.useMemo(\n () => (node.repeat && repeatSyncResult?.status === 'pending' ? {} : null),\n [node.repeat, repeatSyncResult],\n );\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 const { repeat } = node;\n\n if (!repeat || repeatRequestToken === null) {\n return undefined;\n }\n\n void (async () => {\n const result = await resolveRuntimeRepeatItemsAsync(repeat, {\n apis: effectiveConfig.apis,\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n executeOperation: effectiveConfig.executeOperation,\n node,\n operationResults: effectiveConfig.operationResults,\n stateAdapter: effectiveConfig.stateAdapter,\n writeOperationResult: effectiveConfig.writeOperationResult,\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 }, [\n effectiveConfig.apis,\n effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeOperation,\n effectiveConfig.operationResults,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeOperationResult,\n node,\n repeatRequestToken,\n ]);\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 apis: effectiveConfig.apis,\n bindingContext: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n dbAdapter: effectiveConfig.dbAdapter,\n dbRealtimeAdapter: effectiveConfig.dbRealtimeAdapter,\n node,\n operationResults: effectiveConfig.operationResults,\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 propsWithActions = wrapRuntimeActionProps({\n props: resolvedProps,\n disableActions: effectiveConfig.disableActions === true,\n handleAction,\n actionHandlerCache,\n functionHandlerCache,\n });\n const propsWithEvents = wrapRuntimeEventProps({\n context: effectiveConfig.bindingContext,\n dataBindings: effectiveConfig.dataBindings,\n props: propsWithActions,\n disableActions: effectiveConfig.disableActions === true,\n dispatchComponentEvent: dispatchRuntimeEvent,\n node,\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,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,0B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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';\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 =\n isRoot && eventOperationState !== undefined\n ? createRuntimeEventOperationBindingContext(rootBindingContext, eventOperationState)\n : bindingContext;\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) => {\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 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 = React.useMemo(() => {\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 effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeCapability,\n effectiveConfig.resultSlots,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeResultSlot,\n node,\n ]);\n const repeatRequestToken = React.useMemo(\n () => (node.repeat && repeatSyncResult?.status === 'pending' ? {} : null),\n [node.repeat, repeatSyncResult],\n );\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 const { repeat } = node;\n\n if (!repeat || repeatRequestToken === null) {\n return undefined;\n }\n\n void (async () => {\n const result = await resolveRuntimeRepeatItemsAsync(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 if (repeatRequestIdRef.current !== requestId) {\n return;\n }\n\n setAsyncRepeatResult({ ...result, requestToken: repeatRequestToken });\n })();\n\n return () => {\n repeatRequestIdRef.current += 1;\n };\n }, [\n effectiveConfig.bindingContext,\n effectiveConfig.dataBindings,\n effectiveConfig.executeCapability,\n effectiveConfig.resultSlots,\n effectiveConfig.stateAdapter,\n effectiveConfig.writeResultSlot,\n node,\n repeatRequestToken,\n ]);\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,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Capability } from '@ankhorage/contracts/capability';
|
|
1
|
+
import type { ComponentDataBindingRegistry, DataSourceDiagnostic, DbAdapter, DbRealtimeAdapter, MediaAssetRegistry, StateAdapter, UiNode } from '@ankhorage/contracts';
|
|
3
2
|
import type { RuntimeNodePropsResolver } from '@ankhorage/contracts/runtime';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import type { ComponentRegistry } from './registry';
|
|
6
|
-
import type {
|
|
5
|
+
import type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry';
|
|
6
|
+
import type { RuntimeBindingResultCache, RuntimeBindingResultWriter, RuntimeCapabilityExecutor } from './runtimeBindings';
|
|
7
7
|
import type { RuntimeEventOperationLifecycle, RuntimeEventOperationState } from './runtimeEventOperationLifecycle';
|
|
8
8
|
import type { RuntimeMediaAssetResolver } from './runtimeMedia';
|
|
9
9
|
export type { RuntimeNodePropsResolver, RuntimeResolveNodePropsArgs, } from '@ankhorage/contracts/runtime';
|
|
@@ -12,19 +12,6 @@ export interface RuntimeRendererWrapArgs {
|
|
|
12
12
|
rendered: React.ReactNode;
|
|
13
13
|
isRoot: boolean;
|
|
14
14
|
}
|
|
15
|
-
export interface RuntimeActionHandlerArgs {
|
|
16
|
-
action: RuntimeAction;
|
|
17
|
-
event?: ComponentEventDto<string, object>;
|
|
18
|
-
node?: UiNode;
|
|
19
|
-
resolvedPayload?: object;
|
|
20
|
-
}
|
|
21
|
-
export interface RuntimeAction {
|
|
22
|
-
readonly type: Capability['id'];
|
|
23
|
-
readonly payload?: object;
|
|
24
|
-
}
|
|
25
|
-
export type RuntimeActionHandler = (args: RuntimeActionHandlerArgs) => Promise<void> | void;
|
|
26
|
-
export type RuntimeActionHandlers = Partial<Record<Capability['id'], RuntimeActionHandler>>;
|
|
27
|
-
export type RuntimeActionExecutor = RuntimeActionHandler;
|
|
28
15
|
export interface RuntimeRendererConfig {
|
|
29
16
|
disableActions?: boolean;
|
|
30
17
|
registry?: ComponentRegistry;
|
|
@@ -32,17 +19,15 @@ export interface RuntimeRendererConfig {
|
|
|
32
19
|
resolveNodeProps?: RuntimeNodePropsResolver;
|
|
33
20
|
resolveMediaAsset?: RuntimeMediaAssetResolver;
|
|
34
21
|
mediaAssets?: MediaAssetRegistry;
|
|
35
|
-
actionHandlers?: RuntimeActionHandlers;
|
|
36
22
|
dbAdapter?: DbAdapter;
|
|
37
23
|
dbRealtimeAdapter?: DbRealtimeAdapter;
|
|
38
24
|
stateAdapter?: StateAdapter;
|
|
39
25
|
bindingContext?: Record<string, unknown>;
|
|
40
|
-
apis?: ApiDefinitionRegistry;
|
|
41
26
|
dataBindings?: ComponentDataBindingRegistry;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
resultSlots?: RuntimeBindingResultCache;
|
|
28
|
+
writeResultSlot?: RuntimeBindingResultWriter;
|
|
29
|
+
executeCapability?: RuntimeCapabilityExecutor;
|
|
30
|
+
resolveEventCapability?: RuntimeEventCapabilityResolver;
|
|
46
31
|
onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;
|
|
47
32
|
eventOperationLifecycle?: RuntimeEventOperationLifecycle;
|
|
48
33
|
eventOperationState?: RuntimeEventOperationState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeRendererConfig.d.ts","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"RuntimeRendererConfig.d.ts","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,8BAA8B,EAC9B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,YAAY,EACV,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QA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AAC,KAAK,EAAE;IACnD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAQA;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,CAEhE"}
|
|
@@ -26,9 +26,8 @@ export function mergeRuntimeRendererConfig(localConfig, inheritedConfig) {
|
|
|
26
26
|
if (!localConfig && !inheritedConfig) {
|
|
27
27
|
return EMPTY_RUNTIME_RENDERER_CONFIG;
|
|
28
28
|
}
|
|
29
|
-
const actionHandlers = mergeRecordConfig(inheritedConfig?.actionHandlers, localConfig?.actionHandlers);
|
|
30
29
|
const bindingContext = mergeRecordConfig(inheritedConfig?.bindingContext, localConfig?.bindingContext);
|
|
31
|
-
const
|
|
30
|
+
const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);
|
|
32
31
|
return {
|
|
33
32
|
disableActions: localConfig?.disableActions === true || inheritedConfig?.disableActions === true,
|
|
34
33
|
registry: localConfig?.registry ?? inheritedConfig?.registry,
|
|
@@ -36,17 +35,15 @@ export function mergeRuntimeRendererConfig(localConfig, inheritedConfig) {
|
|
|
36
35
|
resolveNodeProps: composeRuntimeNodePropsResolver(localConfig?.resolveNodeProps, inheritedConfig?.resolveNodeProps),
|
|
37
36
|
resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,
|
|
38
37
|
mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,
|
|
39
|
-
actionHandlers,
|
|
40
38
|
dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,
|
|
41
39
|
dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,
|
|
42
40
|
stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,
|
|
43
41
|
bindingContext,
|
|
44
|
-
apis: localConfig?.apis ?? inheritedConfig?.apis,
|
|
45
42
|
dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
resultSlots,
|
|
44
|
+
writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,
|
|
45
|
+
executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,
|
|
46
|
+
resolveEventCapability: localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,
|
|
50
47
|
onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,
|
|
51
48
|
eventOperationLifecycle: localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,
|
|
52
49
|
eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState,
|