@ankhorage/runtime 3.0.59 → 4.0.4
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 +87 -0
- package/README.md +1 -1
- package/dist/RuntimeRendererConfig.d.ts +6 -5
- package/dist/RuntimeRendererConfig.d.ts.map +1 -1
- package/dist/RuntimeRendererConfig.js.map +1 -1
- package/dist/capabilities/index.d.ts +38 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +43 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtimeActionRegistry.d.ts +2 -1
- package/dist/runtimeActionRegistry.d.ts.map +1 -1
- package/dist/runtimeActionRegistry.js +18 -4
- package/dist/runtimeActionRegistry.js.map +1 -1
- package/dist/runtimeManifest.d.ts +2 -4
- package/dist/runtimeManifest.d.ts.map +1 -1
- package/dist/runtimeManifest.js +0 -9
- package/dist/runtimeManifest.js.map +1 -1
- package/dist/runtimeNodeProps.d.ts.map +1 -1
- package/dist/runtimeNodeProps.js +4 -3
- package/dist/runtimeNodeProps.js.map +1 -1
- package/package.json +73 -8
- package/paradox/badges/npm.svg +4 -4
- package/paradox/components.md +1 -1
- package/paradox/diagrams/architecture-overview.mmd +4 -0
- package/paradox/diagrams/export-graph.mmd +1 -3
- package/paradox/diagrams/module-relationships.mmd +3 -0
- package/paradox/exports.json +47 -55
- package/paradox/exports.md +38 -37
- package/paradox/index.html +152 -125
- package/paradox/paradox.json +207 -141
package/dist/runtimeManifest.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export const RUNTIME_CAPABILITIES = [
|
|
2
|
-
'runtime.render',
|
|
3
|
-
'runtime.actions',
|
|
4
|
-
'runtime.bindings',
|
|
5
|
-
'runtime.adapters',
|
|
6
|
-
];
|
|
7
1
|
export const RUNTIME_MANIFEST_KIND = 'ankhorage-runtime-manifest';
|
|
8
2
|
export function defineRuntimeAction(action) {
|
|
9
3
|
return action;
|
|
@@ -25,7 +19,4 @@ export function createRuntimeManifest(input) {
|
|
|
25
19
|
version: 1,
|
|
26
20
|
};
|
|
27
21
|
}
|
|
28
|
-
export function listRuntimeCapabilities() {
|
|
29
|
-
return RUNTIME_CAPABILITIES;
|
|
30
|
-
}
|
|
31
22
|
//# sourceMappingURL=runtimeManifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeManifest.js","sourceRoot":"","sources":["../src/runtimeManifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtimeManifest.js","sourceRoot":"","sources":["../src/runtimeManifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAqDlE,MAAM,UAAU,mBAAmB,CACjC,MAAqC;IAErC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAA0C;IAE1C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAAwC;IAExC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA2B;IAC/D,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;QACpC,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,CAAC;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capabilities';\n\nexport const RUNTIME_MANIFEST_KIND = 'ankhorage-runtime-manifest';\n\nexport interface RuntimeDiagnostic {\n readonly code: string;\n readonly message: string;\n readonly severity: 'error' | 'info' | 'warning';\n}\n\nexport interface RuntimeManifestConfig {\n readonly appId: string;\n readonly environment?: string;\n readonly values?: Readonly<Record<string, unknown>>;\n}\n\nexport interface RuntimeActionDescriptor<Data = unknown> {\n readonly capability?: Capability['id'];\n readonly description?: string;\n readonly id: string;\n readonly data?: Data;\n}\n\nexport interface RuntimeBindingDescriptor<Value = unknown> {\n readonly actionId?: string;\n readonly id: string;\n readonly source: string;\n readonly target: string;\n readonly value?: Value;\n}\n\nexport interface RuntimeAdapterDescriptor<Options = unknown> {\n readonly id: string;\n readonly kind: string;\n readonly options?: Options;\n}\n\nexport interface RuntimeManifest {\n readonly actions: readonly RuntimeActionDescriptor[];\n readonly adapters: readonly RuntimeAdapterDescriptor[];\n readonly bindings: readonly RuntimeBindingDescriptor[];\n readonly config: RuntimeManifestConfig;\n readonly diagnostics: readonly RuntimeDiagnostic[];\n readonly kind: typeof RUNTIME_MANIFEST_KIND;\n readonly version: 1;\n}\n\nexport interface RuntimeManifestInput {\n readonly actions?: readonly RuntimeActionDescriptor[];\n readonly adapters?: readonly RuntimeAdapterDescriptor[];\n readonly bindings?: readonly RuntimeBindingDescriptor[];\n readonly config: RuntimeManifestConfig;\n readonly diagnostics?: readonly RuntimeDiagnostic[];\n}\n\nexport function defineRuntimeAction<Data = unknown>(\n action: RuntimeActionDescriptor<Data>,\n): RuntimeActionDescriptor<Data> {\n return action;\n}\n\nexport function defineRuntimeAdapter<Options = unknown>(\n adapter: RuntimeAdapterDescriptor<Options>,\n): RuntimeAdapterDescriptor<Options> {\n return adapter;\n}\n\nexport function defineRuntimeBinding<Value = unknown>(\n binding: RuntimeBindingDescriptor<Value>,\n): RuntimeBindingDescriptor<Value> {\n return binding;\n}\n\nexport function createRuntimeManifest(input: RuntimeManifestInput): RuntimeManifest {\n return {\n actions: input.actions ?? [],\n adapters: input.adapters ?? [],\n bindings: input.bindings ?? [],\n config: input.config,\n diagnostics: input.diagnostics ?? [],\n kind: RUNTIME_MANIFEST_KIND,\n version: 1,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeNodeProps.d.ts","sourceRoot":"","sources":["../src/runtimeNodeProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACP,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtimeNodeProps.d.ts","sourceRoot":"","sources":["../src/runtimeNodeProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACP,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAA0B,KAAK,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,UAAU,8BAA8B;IACtC,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CAChD;AAqED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAC7D,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,gBAAgB,CAAC,EAAE,kCAAkC,CAAC;CACvD,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+B1B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,OAAO,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;IACpE,oBAAoB,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;CACjG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsD1B"}
|
package/dist/runtimeNodeProps.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isMediaAssetReference } from '@ankhorage/contracts';
|
|
2
|
+
import { isCapabilityId } from '@ankhorage/contracts/capabilities';
|
|
2
3
|
import { resolveRuntimeBindings } from './runtimeBindings';
|
|
3
4
|
function isRecord(value) {
|
|
4
5
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -11,13 +12,13 @@ function isPlainObject(value) {
|
|
|
11
12
|
return prototype === Object.prototype || prototype === null;
|
|
12
13
|
}
|
|
13
14
|
function hasActionShape(value) {
|
|
14
|
-
return (
|
|
15
|
+
return isRecord(value) && isCapabilityId(value.type);
|
|
15
16
|
}
|
|
16
17
|
function isCallbackProp(value) {
|
|
17
18
|
return typeof value === 'function';
|
|
18
19
|
}
|
|
19
20
|
function isNonEmptyActionId(value) {
|
|
20
|
-
return
|
|
21
|
+
return isCapabilityId(value);
|
|
21
22
|
}
|
|
22
23
|
function createStringActionPayload(args) {
|
|
23
24
|
if (args.length === 0) {
|
|
@@ -108,7 +109,7 @@ export function wrapRuntimeActionProps(args) {
|
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
111
|
if (isNonEmptyActionId(value)) {
|
|
111
|
-
const actionId = value
|
|
112
|
+
const actionId = value;
|
|
112
113
|
wrappedProps[key] = (...handlerArgs) => {
|
|
113
114
|
handleAction({
|
|
114
115
|
type: actionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeNodeProps.js","sourceRoot":"","sources":["../src/runtimeNodeProps.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAA2C,MAAM,mBAAmB,CAAC;AAQpG,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC;AAC9D,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CACjG,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;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;QAED,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAC9B,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAsB,EAAE,EAAE;gBAChD,YAAY,CAAC;oBACX,IAAI,EAAE,QAAQ;oBACd,GAAG,yBAAyB,CAAC,WAAW,CAAC;iBAC1C,CAAC,CAAC;YACL,CAAC,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,KAAK,CAAC;YACtB,IAAI,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACvD,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,cAAc,GAAG,CAAC,GAAG,WAAsB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC;gBACxE,oBAAoB,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACpD,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import type {\n ApiDefinitionRegistry,\n ComponentDataBindingRegistry,\n DbAdapter,\n DbRealtimeAdapter,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport { isMediaAssetReference } from '@ankhorage/contracts';\n\nimport { resolveRuntimeBindings, type RuntimeBindingOperationResultCache } from './runtimeBindings';\nimport type { RuntimeAction, RuntimeRendererConfig } from './RuntimeRendererConfig';\n\ninterface RuntimeActionHandlerCacheEntry {\n readonly handleAction: (action: RuntimeAction) => void;\n readonly handler: (...args: unknown[]) => void;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (!isRecord(value)) {\n return false;\n }\n\n const prototype = Reflect.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction hasActionShape(value: unknown): value is RuntimeAction {\n return (\n typeof value === 'object' && value !== null && 'type' in value && typeof value.type === 'string'\n );\n}\n\nfunction isCallbackProp(value: unknown): value is (...args: unknown[]) => unknown {\n return typeof value === 'function';\n}\n\nfunction isNonEmptyActionId(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction createStringActionPayload(args: unknown[]): { payload?: object } {\n if (args.length === 0) {\n return {};\n }\n\n const [firstArg] = args;\n if (isPlainObject(firstArg)) {\n return { payload: firstArg };\n }\n\n return {\n payload: {\n args,\n },\n };\n}\n\nconst noopRuntimeActionHandler = () => undefined;\n\nfunction resolveImageAssetUrl(value: unknown): string | null {\n if (typeof value === 'string') {\n const url = value.trim();\n return url.length ? url : null;\n }\n\n if (!isRecord(value) || typeof value.kind !== 'string') {\n return null;\n }\n\n if (value.kind === 'url' && typeof value.url === 'string') {\n const url = value.url.trim();\n return url.length ? url : null;\n }\n\n if (value.kind === 'storage' && typeof value.publicUrl === 'string') {\n const publicUrl = value.publicUrl.trim();\n return publicUrl.length ? publicUrl : null;\n }\n\n return null;\n}\n\nexport function resolveRuntimeNodeProps(args: {\n node: UiNode;\n resolveNodeProps?: RuntimeRendererConfig['resolveNodeProps'];\n stateAdapter?: StateAdapter;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n bindingContext?: Record<string, unknown>;\n apis?: ApiDefinitionRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n operationResults?: RuntimeBindingOperationResultCache;\n}): Record<string, unknown> {\n const { node, resolveNodeProps } = args;\n\n const baseProps: Record<string, unknown> = {\n testID: node.id,\n ...(node.props ?? {}),\n };\n\n if (node.type === 'Image' && !isMediaAssetReference(baseProps.source)) {\n const resolvedSource = resolveImageAssetUrl(baseProps.source);\n if (resolvedSource !== null) baseProps.source = resolvedSource;\n else delete baseProps.source;\n }\n\n if (node.style) {\n baseProps.style = baseProps.style ? [baseProps.style, node.style] : node.style;\n }\n\n const bindingResult = resolveRuntimeBindings({\n apis: args.apis,\n context: args.bindingContext,\n dataBindings: args.dataBindings,\n node,\n operationResults: args.operationResults,\n props: baseProps,\n stateAdapter: args.stateAdapter,\n });\n\n return resolveNodeProps\n ? resolveNodeProps({ node, props: bindingResult.props })\n : bindingResult.props;\n}\n\nexport function wrapRuntimeActionProps(args: {\n props: Record<string, unknown>;\n disableActions: boolean;\n handleAction: (action: RuntimeAction) => void;\n actionHandlerCache: WeakMap<object, RuntimeActionHandlerCacheEntry>;\n functionHandlerCache: WeakMap<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;\n}): Record<string, unknown> {\n const { props, disableActions, handleAction, actionHandlerCache, functionHandlerCache } = args;\n const wrappedProps: Record<string, unknown> = { ...props };\n\n Object.keys(wrappedProps).forEach((key) => {\n if (!key.startsWith('on')) {\n return;\n }\n\n const value = wrappedProps[key];\n\n if (disableActions) {\n wrappedProps[key] =\n hasActionShape(value) || isNonEmptyActionId(value) ? noopRuntimeActionHandler : undefined;\n return;\n }\n\n if (hasActionShape(value)) {\n const actionObject = value;\n let cachedActionHandler = actionHandlerCache.get(actionObject);\n if (cachedActionHandler?.handleAction !== handleAction) {\n const actionHandler = () => {\n handleAction(actionObject);\n };\n cachedActionHandler = { handleAction, handler: actionHandler };\n actionHandlerCache.set(actionObject, cachedActionHandler);\n }\n wrappedProps[key] = cachedActionHandler.handler;\n return;\n }\n\n if (isNonEmptyActionId(value)) {\n const actionId = value.trim();\n wrappedProps[key] = (...handlerArgs: unknown[]) => {\n handleAction({\n type: actionId,\n ...createStringActionPayload(handlerArgs),\n });\n };\n return;\n }\n\n if (isCallbackProp(value)) {\n const handler = value;\n let wrappedHandler = functionHandlerCache.get(handler);\n if (!wrappedHandler) {\n wrappedHandler = (...handlerArgs: unknown[]) => handler(...handlerArgs);\n functionHandlerCache.set(handler, wrappedHandler);\n }\n wrappedProps[key] = wrappedHandler;\n }\n });\n\n return wrappedProps;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtimeNodeProps.js","sourceRoot":"","sources":["../src/runtimeNodeProps.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAmB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,sBAAsB,EAA2C,MAAM,mBAAmB,CAAC;AAQpG,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC;AAC9D,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAe;IAChD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC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IAAI,EAAE,QAAQ;oBACd,GAAG,yBAAyB,CAAC,WAAW,CAAC;iBAC1C,CAAC,CAAC;YACL,CAAC,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,KAAK,CAAC;YACtB,IAAI,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACvD,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,cAAc,GAAG,CAAC,GAAG,WAAsB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC;gBACxE,oBAAoB,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACpD,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import type {\n ApiDefinitionRegistry,\n ComponentDataBindingRegistry,\n DbAdapter,\n DbRealtimeAdapter,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport { isMediaAssetReference } from '@ankhorage/contracts';\nimport { type Capability, isCapabilityId } from '@ankhorage/contracts/capabilities';\n\nimport { resolveRuntimeBindings, type RuntimeBindingOperationResultCache } from './runtimeBindings';\nimport type { RuntimeAction, RuntimeRendererConfig } from './RuntimeRendererConfig';\n\ninterface RuntimeActionHandlerCacheEntry {\n readonly handleAction: (action: RuntimeAction) => void;\n readonly handler: (...args: unknown[]) => void;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (!isRecord(value)) {\n return false;\n }\n\n const prototype = Reflect.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction hasActionShape(value: unknown): value is RuntimeAction {\n return isRecord(value) && isCapabilityId(value.type);\n}\n\nfunction isCallbackProp(value: unknown): value is (...args: unknown[]) => unknown {\n return typeof value === 'function';\n}\n\nfunction isNonEmptyActionId(value: unknown): value is Capability['id'] {\n return isCapabilityId(value);\n}\n\nfunction createStringActionPayload(args: unknown[]): { payload?: object } {\n if (args.length === 0) {\n return {};\n }\n\n const [firstArg] = args;\n if (isPlainObject(firstArg)) {\n return { payload: firstArg };\n }\n\n return {\n payload: {\n args,\n },\n };\n}\n\nconst noopRuntimeActionHandler = () => undefined;\n\nfunction resolveImageAssetUrl(value: unknown): string | null {\n if (typeof value === 'string') {\n const url = value.trim();\n return url.length ? url : null;\n }\n\n if (!isRecord(value) || typeof value.kind !== 'string') {\n return null;\n }\n\n if (value.kind === 'url' && typeof value.url === 'string') {\n const url = value.url.trim();\n return url.length ? url : null;\n }\n\n if (value.kind === 'storage' && typeof value.publicUrl === 'string') {\n const publicUrl = value.publicUrl.trim();\n return publicUrl.length ? publicUrl : null;\n }\n\n return null;\n}\n\nexport function resolveRuntimeNodeProps(args: {\n node: UiNode;\n resolveNodeProps?: RuntimeRendererConfig['resolveNodeProps'];\n stateAdapter?: StateAdapter;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n bindingContext?: Record<string, unknown>;\n apis?: ApiDefinitionRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n operationResults?: RuntimeBindingOperationResultCache;\n}): Record<string, unknown> {\n const { node, resolveNodeProps } = args;\n\n const baseProps: Record<string, unknown> = {\n testID: node.id,\n ...(node.props ?? {}),\n };\n\n if (node.type === 'Image' && !isMediaAssetReference(baseProps.source)) {\n const resolvedSource = resolveImageAssetUrl(baseProps.source);\n if (resolvedSource !== null) baseProps.source = resolvedSource;\n else delete baseProps.source;\n }\n\n if (node.style) {\n baseProps.style = baseProps.style ? [baseProps.style, node.style] : node.style;\n }\n\n const bindingResult = resolveRuntimeBindings({\n apis: args.apis,\n context: args.bindingContext,\n dataBindings: args.dataBindings,\n node,\n operationResults: args.operationResults,\n props: baseProps,\n stateAdapter: args.stateAdapter,\n });\n\n return resolveNodeProps\n ? resolveNodeProps({ node, props: bindingResult.props })\n : bindingResult.props;\n}\n\nexport function wrapRuntimeActionProps(args: {\n props: Record<string, unknown>;\n disableActions: boolean;\n handleAction: (action: RuntimeAction) => void;\n actionHandlerCache: WeakMap<object, RuntimeActionHandlerCacheEntry>;\n functionHandlerCache: WeakMap<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;\n}): Record<string, unknown> {\n const { props, disableActions, handleAction, actionHandlerCache, functionHandlerCache } = args;\n const wrappedProps: Record<string, unknown> = { ...props };\n\n Object.keys(wrappedProps).forEach((key) => {\n if (!key.startsWith('on')) {\n return;\n }\n\n const value = wrappedProps[key];\n\n if (disableActions) {\n wrappedProps[key] =\n hasActionShape(value) || isNonEmptyActionId(value) ? noopRuntimeActionHandler : undefined;\n return;\n }\n\n if (hasActionShape(value)) {\n const actionObject = value;\n let cachedActionHandler = actionHandlerCache.get(actionObject);\n if (cachedActionHandler?.handleAction !== handleAction) {\n const actionHandler = () => {\n handleAction(actionObject);\n };\n cachedActionHandler = { handleAction, handler: actionHandler };\n actionHandlerCache.set(actionObject, cachedActionHandler);\n }\n wrappedProps[key] = cachedActionHandler.handler;\n return;\n }\n\n if (isNonEmptyActionId(value)) {\n const actionId = value;\n wrappedProps[key] = (...handlerArgs: unknown[]) => {\n handleAction({\n type: actionId,\n ...createStringActionPayload(handlerArgs),\n });\n };\n return;\n }\n\n if (isCallbackProp(value)) {\n const handler = value;\n let wrappedHandler = functionHandlerCache.get(handler);\n if (!wrappedHandler) {\n wrappedHandler = (...handlerArgs: unknown[]) => handler(...handlerArgs);\n functionHandlerCache.set(handler, wrappedHandler);\n }\n wrappedProps[key] = wrappedHandler;\n }\n });\n\n return wrappedProps;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/runtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Platform-neutral runtime renderer, contracts, and helpers for Ankhorage generated apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
+
"react-native": "./dist/index.js",
|
|
35
|
+
"browser": "./dist/index.js",
|
|
34
36
|
"types": "./dist/index.d.ts",
|
|
35
37
|
"import": "./dist/index.js"
|
|
36
38
|
},
|
|
@@ -38,7 +40,11 @@
|
|
|
38
40
|
"types": "./dist/bindings.d.ts",
|
|
39
41
|
"import": "./dist/bindings.js"
|
|
40
42
|
},
|
|
41
|
-
"./package.json": "./package.json"
|
|
43
|
+
"./package.json": "./package.json",
|
|
44
|
+
"./capabilities": {
|
|
45
|
+
"types": "./dist/capabilities/index.d.ts",
|
|
46
|
+
"import": "./dist/capabilities/index.js"
|
|
47
|
+
}
|
|
42
48
|
},
|
|
43
49
|
"files": [
|
|
44
50
|
"dist",
|
|
@@ -50,7 +56,66 @@
|
|
|
50
56
|
"ankh": {
|
|
51
57
|
"category": "runtime",
|
|
52
58
|
"provider": null,
|
|
53
|
-
"capabilities": [
|
|
59
|
+
"capabilities": [
|
|
60
|
+
{
|
|
61
|
+
"id": "runtime.render",
|
|
62
|
+
"owner": "@ankhorage/runtime",
|
|
63
|
+
"access": [
|
|
64
|
+
"invoke"
|
|
65
|
+
],
|
|
66
|
+
"binding": {
|
|
67
|
+
"kind": "action",
|
|
68
|
+
"bindableAs": [
|
|
69
|
+
"target"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"label": "Render runtime"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "runtime.actions",
|
|
76
|
+
"owner": "@ankhorage/runtime",
|
|
77
|
+
"access": [
|
|
78
|
+
"invoke"
|
|
79
|
+
],
|
|
80
|
+
"binding": {
|
|
81
|
+
"kind": "action",
|
|
82
|
+
"bindableAs": [
|
|
83
|
+
"target"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"label": "Execute runtime actions"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "runtime.bindings",
|
|
90
|
+
"owner": "@ankhorage/runtime",
|
|
91
|
+
"access": [
|
|
92
|
+
"read",
|
|
93
|
+
"write"
|
|
94
|
+
],
|
|
95
|
+
"binding": {
|
|
96
|
+
"kind": "state",
|
|
97
|
+
"bindableAs": [
|
|
98
|
+
"source",
|
|
99
|
+
"target"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"label": "Runtime bindings"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "runtime.adapters",
|
|
106
|
+
"owner": "@ankhorage/runtime",
|
|
107
|
+
"access": [
|
|
108
|
+
"read"
|
|
109
|
+
],
|
|
110
|
+
"binding": {
|
|
111
|
+
"kind": "context",
|
|
112
|
+
"bindableAs": [
|
|
113
|
+
"source"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"label": "Runtime adapters"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
54
119
|
},
|
|
55
120
|
"scripts": {
|
|
56
121
|
"build": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && bun x tsc -p tsconfig.build.json",
|
|
@@ -67,9 +132,9 @@
|
|
|
67
132
|
"knip:check": "ankhorage-knip"
|
|
68
133
|
},
|
|
69
134
|
"dependencies": {
|
|
70
|
-
"@ankhorage/contracts": "^
|
|
71
|
-
"@ankhorage/data-sources": "^2.0.
|
|
72
|
-
"@ankhorage/utility": "^1.9.
|
|
135
|
+
"@ankhorage/contracts": "^24.2.0",
|
|
136
|
+
"@ankhorage/data-sources": "^2.0.38",
|
|
137
|
+
"@ankhorage/utility": "^1.9.85"
|
|
73
138
|
},
|
|
74
139
|
"peerDependencies": {
|
|
75
140
|
"react": ">=19.2.0 <20",
|
|
@@ -82,8 +147,8 @@
|
|
|
82
147
|
}
|
|
83
148
|
},
|
|
84
149
|
"devDependencies": {
|
|
85
|
-
"@ankhorage/devtools": "^2.
|
|
86
|
-
"@ankhorage/paradox": "^0.
|
|
150
|
+
"@ankhorage/devtools": "^2.2.2",
|
|
151
|
+
"@ankhorage/paradox": "^0.3.1",
|
|
87
152
|
"@types/bun": "^1.4.2",
|
|
88
153
|
"@types/node": "^26.6.4",
|
|
89
154
|
"@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="
|
|
2
|
-
<title>npm:
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="20" role="img" aria-label="npm: v4.0.4">
|
|
2
|
+
<title>npm: v4.0.4</title>
|
|
3
3
|
<rect width="38" height="20" fill="#374151"/>
|
|
4
|
-
<rect x="38" width="
|
|
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="
|
|
6
|
+
<text x="64" y="14" fill="#ffffff" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle">v4.0.4</text>
|
|
7
7
|
</svg>
|
package/paradox/components.md
CHANGED
|
@@ -9,6 +9,8 @@ graph TD
|
|
|
9
9
|
module_src_bindings_test_ts --> module_src_bindings_ts
|
|
10
10
|
module_src_bindings_ts["src/bindings.ts"]
|
|
11
11
|
package__ankhorage_runtime -.-> module_src_bindings_ts
|
|
12
|
+
module_src_capabilities_index_ts["src/capabilities/index.ts"]
|
|
13
|
+
package__ankhorage_runtime -.-> module_src_capabilities_index_ts
|
|
12
14
|
module_src_componentRegistry_ts["src/componentRegistry.ts"]
|
|
13
15
|
package__ankhorage_runtime -.-> module_src_componentRegistry_ts
|
|
14
16
|
module_src_index_ts["src/index.ts"]
|
|
@@ -105,6 +107,7 @@ graph TD
|
|
|
105
107
|
module_src_runtimeNodeProps_test_ts["src/runtimeNodeProps.test.ts"]
|
|
106
108
|
package__ankhorage_runtime -.-> module_src_runtimeNodeProps_test_ts
|
|
107
109
|
module_src_runtimeNodeProps_test_ts --> module_src_runtimeNodeProps_ts
|
|
110
|
+
module_src_runtimeNodeProps_test_ts --> module_src_RuntimeRendererConfig_tsx
|
|
108
111
|
module_src_runtimeNodeProps_ts["src/runtimeNodeProps.ts"]
|
|
109
112
|
package__ankhorage_runtime -.-> module_src_runtimeNodeProps_ts
|
|
110
113
|
module_src_runtimeNodeProps_ts --> module_src_runtimeBindings_ts
|
|
@@ -193,4 +196,5 @@ graph TD
|
|
|
193
196
|
package__ankhorage_runtime -.-> module_tests_reactNativeWebCompatibility_test_ts
|
|
194
197
|
module_tests_runtime_test_ts["tests/runtime.test.ts"]
|
|
195
198
|
package__ankhorage_runtime -.-> module_tests_runtime_test_ts
|
|
199
|
+
module_tests_runtime_test_ts --> module_src_capabilities_index_ts
|
|
196
200
|
module_tests_runtime_test_ts --> module_src_runtimeManifest_ts
|
|
@@ -2,6 +2,7 @@ graph LR
|
|
|
2
2
|
module_paradox_config_ts["paradox.config.ts"]
|
|
3
3
|
module_src_bindings_test_ts["src/bindings.test.ts"]
|
|
4
4
|
module_src_bindings_ts["src/bindings.ts"]
|
|
5
|
+
module_src_capabilities_index_ts["src/capabilities/index.ts"]
|
|
5
6
|
module_src_componentRegistry_ts["src/componentRegistry.ts"]
|
|
6
7
|
module_src_index_ts["src/index.ts"]
|
|
7
8
|
module_src_ManifestContext_tsx["src/ManifestContext.tsx"]
|
|
@@ -211,8 +212,6 @@ graph LR
|
|
|
211
212
|
export_RuntimeBindingResolutionContext -.-> export_RuntimeBindingOperationExecutor
|
|
212
213
|
export_RuntimeBindingResolutionResult["RuntimeBindingResolutionResult"]
|
|
213
214
|
module_src_runtimeBindings_ts --> export_RuntimeBindingResolutionResult
|
|
214
|
-
export_RuntimeCapability["RuntimeCapability"]
|
|
215
|
-
module_src_runtimeManifest_ts --> export_RuntimeCapability
|
|
216
215
|
export_RuntimeComponentEventDispatchArgs["RuntimeComponentEventDispatchArgs"]
|
|
217
216
|
module_src_runtimeActionRegistry_ts --> export_RuntimeComponentEventDispatchArgs
|
|
218
217
|
export_RuntimeComponentEventDispatchArgs -.-> export_RuntimeActionHandler
|
|
@@ -272,7 +271,6 @@ graph LR
|
|
|
272
271
|
export_RuntimeRendererConfig["RuntimeRendererConfig"]
|
|
273
272
|
module_src_RuntimeRendererConfig_tsx --> export_RuntimeRendererConfig
|
|
274
273
|
export_RuntimeRendererConfig -.-> export_RuntimeActionHandler
|
|
275
|
-
export_RuntimeRendererConfig -.-> export_RuntimeActionHandlers
|
|
276
274
|
export_RuntimeRendererConfig -.-> export_RuntimeBindingOperationExecutor
|
|
277
275
|
export_RuntimeRendererConfig -.-> export_RuntimeBindingOperationResultWriter
|
|
278
276
|
export_RuntimeRendererConfig -.-> export_RuntimeEventOperationLifecycle
|
|
@@ -2,6 +2,7 @@ graph LR
|
|
|
2
2
|
module_paradox_config_ts["paradox.config.ts"]
|
|
3
3
|
module_src_bindings_test_ts["src/bindings.test.ts"]
|
|
4
4
|
module_src_bindings_ts["src/bindings.ts"]
|
|
5
|
+
module_src_capabilities_index_ts["src/capabilities/index.ts"]
|
|
5
6
|
module_src_componentRegistry_ts["src/componentRegistry.ts"]
|
|
6
7
|
module_src_index_ts["src/index.ts"]
|
|
7
8
|
module_src_ManifestContext_tsx["src/ManifestContext.tsx"]
|
|
@@ -90,6 +91,7 @@ graph LR
|
|
|
90
91
|
module_src_runtimeMediaCache_tsx --> module_src_runtimeMedia_ts
|
|
91
92
|
module_src_runtimeMediaConfig_test_ts --> module_src_RuntimeRendererConfig_tsx
|
|
92
93
|
module_src_runtimeNodeProps_test_ts --> module_src_runtimeNodeProps_ts
|
|
94
|
+
module_src_runtimeNodeProps_test_ts --> module_src_RuntimeRendererConfig_tsx
|
|
93
95
|
module_src_runtimeNodeProps_ts --> module_src_runtimeBindings_ts
|
|
94
96
|
module_src_runtimeNodeProps_ts --> module_src_RuntimeRendererConfig_tsx
|
|
95
97
|
module_src_RuntimeRenderer_test_ts --> module_src_runtimeRepeatEmptyState_ts
|
|
@@ -136,4 +138,5 @@ graph LR
|
|
|
136
138
|
module_src_runtimeStateAdapterConfig_test_ts --> module_src_RuntimeRendererConfig_tsx
|
|
137
139
|
module_src_useRuntimeMediaProps_ts --> module_src_runtimeMedia_ts
|
|
138
140
|
module_tests_reactNativeWebCompatibility_fixture_tsx --> module_src_RuntimeRenderer_tsx
|
|
141
|
+
module_tests_runtime_test_ts --> module_src_capabilities_index_ts
|
|
139
142
|
module_tests_runtime_test_ts --> module_src_runtimeManifest_ts
|