@niscorp/nova 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/adapters/dom/components/index.cjs +4 -51
- package/dist/adapters/dom/components/index.cjs.map +1 -1
- package/dist/adapters/dom/index.cjs +22 -686
- package/dist/adapters/dom/index.cjs.map +1 -1
- package/dist/adapters/dom/index.js +3 -3
- package/dist/adapters/dom/server.cjs +14 -411
- package/dist/adapters/dom/server.cjs.map +1 -1
- package/dist/adapters/dom/server.js +3 -3
- package/dist/adapters/react/components/index.cjs +87 -562
- package/dist/adapters/react/components/index.cjs.map +1 -1
- package/dist/adapters/react/components/index.js +4 -4
- package/dist/adapters/react/index.cjs +97 -1815
- package/dist/adapters/react/index.cjs.map +1 -1
- package/dist/adapters/react/index.js +4 -4
- package/dist/adapters/tty/components/index.cjs +3 -44
- package/dist/adapters/tty/components/index.cjs.map +1 -1
- package/dist/adapters/tty/index.cjs +13 -5
- package/dist/adapters/tty/index.cjs.map +1 -1
- package/dist/adapters/tty/index.js +2 -2
- package/dist/adapters/vue/components/index.cjs +88 -639
- package/dist/adapters/vue/components/index.cjs.map +1 -1
- package/dist/adapters/vue/components/index.js +4 -4
- package/dist/adapters/vue/index.cjs +96 -962
- package/dist/adapters/vue/index.cjs.map +1 -1
- package/dist/adapters/vue/index.js +5 -5
- package/dist/agent/index.cjs +13 -151
- package/dist/agent/index.cjs.map +1 -1
- package/dist/chunk-5YQIAS4V.cjs +184 -0
- package/dist/chunk-5YQIAS4V.cjs.map +1 -0
- package/dist/{chunk-F2H7WP6R.js → chunk-7MATRNZZ.js} +5 -5
- package/dist/{chunk-F2H7WP6R.js.map → chunk-7MATRNZZ.js.map} +1 -1
- package/dist/chunk-AGEAMUQR.cjs +436 -0
- package/dist/chunk-AGEAMUQR.cjs.map +1 -0
- package/dist/chunk-D4PUWBN6.cjs +72 -0
- package/dist/chunk-D4PUWBN6.cjs.map +1 -0
- package/dist/chunk-ECFWPZGL.cjs +2117 -0
- package/dist/chunk-ECFWPZGL.cjs.map +1 -0
- package/dist/{chunk-VOD5JA4D.js → chunk-EG45GQOE.js} +3 -3
- package/dist/{chunk-VOD5JA4D.js.map → chunk-EG45GQOE.js.map} +1 -1
- package/dist/chunk-FSUMCJAR.cjs +646 -0
- package/dist/chunk-FSUMCJAR.cjs.map +1 -0
- package/dist/chunk-GV7UC3SS.cjs +33 -0
- package/dist/chunk-GV7UC3SS.cjs.map +1 -0
- package/dist/chunk-HYFNOF7Y.cjs +97 -0
- package/dist/chunk-HYFNOF7Y.cjs.map +1 -0
- package/dist/chunk-KOYRJXTI.cjs +123 -0
- package/dist/chunk-KOYRJXTI.cjs.map +1 -0
- package/dist/chunk-KW34ZKF5.cjs +12 -0
- package/dist/chunk-KW34ZKF5.cjs.map +1 -0
- package/dist/chunk-M3UFIUXK.cjs +318 -0
- package/dist/chunk-M3UFIUXK.cjs.map +1 -0
- package/dist/chunk-OE527MXF.cjs +49 -0
- package/dist/chunk-OE527MXF.cjs.map +1 -0
- package/dist/{chunk-DU2VIJAF.js → chunk-P5SJ3QXJ.js} +3 -3
- package/dist/{chunk-DU2VIJAF.js.map → chunk-P5SJ3QXJ.js.map} +1 -1
- package/dist/chunk-PBPUSZIQ.cjs +808 -0
- package/dist/chunk-PBPUSZIQ.cjs.map +1 -0
- package/dist/chunk-PMKWYOOX.cjs +64 -0
- package/dist/chunk-PMKWYOOX.cjs.map +1 -0
- package/dist/chunk-PNQY6OFB.cjs +132 -0
- package/dist/chunk-PNQY6OFB.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-SVNK5NIK.js → chunk-QLFHYHJ2.js} +4 -4
- package/dist/{chunk-SVNK5NIK.js.map → chunk-QLFHYHJ2.js.map} +1 -1
- package/dist/{chunk-G4LSLLGI.js → chunk-RB4OMSPA.js} +5 -5
- package/dist/{chunk-G4LSLLGI.js.map → chunk-RB4OMSPA.js.map} +1 -1
- package/dist/chunk-UGG7MCX4.cjs +34 -0
- package/dist/chunk-UGG7MCX4.cjs.map +1 -0
- package/dist/chunk-WGZZKCJQ.cjs +157 -0
- package/dist/chunk-WGZZKCJQ.cjs.map +1 -0
- package/dist/{chunk-3JRTELLC.js → chunk-X5JTZ5LW.js} +3 -3
- package/dist/{chunk-3JRTELLC.js.map → chunk-X5JTZ5LW.js.map} +1 -1
- package/dist/{chunk-Y6XVPRYH.js → chunk-XUSKGJRI.js} +2 -2
- package/dist/chunk-XUSKGJRI.js.map +1 -0
- package/dist/chunk-Z7CS43ZT.cjs +808 -0
- package/dist/chunk-Z7CS43ZT.cjs.map +1 -0
- package/dist/chunk-ZYTWQZZC.cjs +623 -0
- package/dist/chunk-ZYTWQZZC.cjs.map +1 -0
- package/dist/devtools/index.cjs +13 -697
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.js +2 -2
- package/dist/document/index.cjs +56 -301
- package/dist/document/index.cjs.map +1 -1
- package/dist/examples/index.cjs +6 -31
- package/dist/examples/index.cjs.map +1 -1
- package/dist/i18n/index.cjs +44 -292
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/index.cjs +335 -3954
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/migrations/index.cjs +7 -590
- package/dist/migrations/index.cjs.map +1 -1
- package/dist/reflect/index.cjs +85 -994
- package/dist/reflect/index.cjs.map +1 -1
- package/dist/reflect/index.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-Y6XVPRYH.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/errors.ts","../src/shared/bindings/paths.ts","../src/action/mutations/ops/set.ts","../src/action/mutations/ops/toggle.ts","../src/action/mutations/ops/increment.ts","../src/action/mutations/ops/decrement.ts","../src/action/mutations/ops/push.ts","../src/action/mutations/ops/pop.ts","../src/action/mutations/ops/remove-at.ts","../src/action/mutations/ops/move.ts","../src/action/mutations/ops/clear.ts","../src/action/mutations/ops/reset.ts","../src/action/mutations/ops/index.ts","../src/action/mutations/registry.ts","../src/action/schemas/endpoints.ts","../src/action/schemas/effects.ts","../src/action/schemas/lifecycle.ts","../src/action/schemas/triggers.ts","../src/action/schemas/index.ts"],"names":["isArray","isObject","z","hasKey","next","LayoutNodeSchema"],"mappings":";;;;;;;AAMO,IAAM,UAAA,GAAa;AAAA,EACxB,MAAA,EAAQ,cAAA;AAAA,EACR,iBAAA,EAAmB,qBAAA;AAAA,EACnB,iBAAA,EAAmB,sBAAA;AAAA,EACnB,oBAAA,EAAsB,6BAAA;AAAA,EACtB,aAAA,EAAe,gBAAA;AAAA,EACf,eAAA,EAAiB,kBAAA;AAAA,EACjB,eAAA,EAAiB,kBAAA;AAAA,EACjB,aAAA,EAAe,gBAAA;AAAA,EACf,SAAA,EAAW,iBAAA;AAAA,EACX,QAAA,EAAU,gBAAA;AAAA,EACV,OAAA,EAAS;AACX;AAcO,IAAM,SAAA,GAAN,cAAwB,KAAA,CAAM;AAAA,EAC1B,IAAA;AAAA,EACA,OAAA;AAAA,EAET,WAAA,CACE,IAAA,EACA,OAAA,EACA,OAAA,EACA,OAAA,EACA;AACA,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AACtB,IAAA,IAAA,CAAK,IAAA,GAAO,WAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF;AAEO,IAAM,WAAA,GAAN,cAA0B,SAAA,CAAU;AAAA,EACzC,WAAA,CAAY,OAAA,EAAiB,OAAA,EAA4B,OAAA,EAA+B;AACtF,IAAA,KAAA,CAAM,UAAA,CAAW,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAS,OAAO,CAAA;AAClD,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAIO,IAAM,sBAAA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,CAAA;AAAA,EAC3F,MAAMA,KAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,sBAAsB,CAAA;AAAA,EAC3D,aAAaA,KAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,wBAAwB,CAAA;AAAA,EACpE,MAAA,EAAQA,KAAAA,CACL,KAAA,CAAM,CAACA,KAAAA,CAAE,MAAA,EAAO,EAAGG,kCAAgB,CAAC,CAAA,CACpC,QAAA,EAAS,CACT,SAAS,qIAAqI,CAAA;AAAA,EACjJ,IAAA,EAAMH,KAAAA,CAAE,MAAA,CAAOA,KAAAA,CAAE,MAAA,EAAO,EAAGA,KAAAA,CAAE,OAAA,EAAS,CAAA,CAAE,QAAA,EAAS,CAAE,SAAS,mFAAmF,CAAA;AAAA,EAC/I,QAAA,EAAUA,MAAE,KAAA,CAAM,mBAAmB,EAAE,QAAA,EAAS,CAAE,SAAS,8FAAgG,CAAA;AAAA,EAC3J,SAAA,EAAWA,KAAAA,CACR,MAAA,CAAOA,KAAAA,CAAE,MAAA,EAAO,EAAG,oBAAoB,CAAA,CACvC,QAAA,EAAS,CACT,QAAA,CAAS,6EAA6E,CAAA;AAAA,EACzF,SAAA,EAAW,qBAAA,CAAsB,QAAA,EAAS,CAAE,SAAS,0DAA2D;AAClH,CAAC,CAAA,CACA,MAAA,EAAO,CACP,QAAA,CAAS,yKAA+J","file":"chunk-FSUMCJAR.cjs","sourcesContent":["import type { z } from 'zod';\n\n// ═══════════════════════════════════════════════════════════\n// Error codes\n// ═══════════════════════════════════════════════════════════\n\nexport const ErrorCodes = {\n render: 'RENDER_ERROR',\n componentNotFound: 'COMPONENT_NOT_FOUND',\n layoutRefNotFound: 'LAYOUT_REF_NOT_FOUND',\n definitionValidation: 'DEFINITION_VALIDATION_ERROR',\n unknownAction: 'UNKNOWN_ACTION',\n unknownFragment: 'UNKNOWN_FRAGMENT',\n unknownFunction: 'UNKNOWN_FUNCTION',\n shellDisposed: 'SHELL_DISPOSED',\n lifecycle: 'LIFECYCLE_ERROR',\n mutation: 'MUTATION_ERROR',\n runaway: 'RUNAWAY_CHAIN',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\nexport type NovaErrorContext = Record<string, unknown>;\n\n// ═══════════════════════════════════════════════════════════\n// Base error — classes are permitted here because these are\n// the only thrown error types; identity + instanceof are needed.\n//\n// Subclasses are added when there is a real throw site. Do not\n// add dead exports.\n// ═══════════════════════════════════════════════════════════\n\nexport class NovaError extends Error {\n readonly code: ErrorCode;\n readonly context: NovaErrorContext | undefined;\n\n constructor(\n code: ErrorCode,\n message: string,\n context?: NovaErrorContext,\n options?: { cause?: unknown },\n ) {\n super(message, options);\n this.name = 'NovaError';\n this.code = code;\n this.context = context;\n }\n}\n\nexport class RenderError extends NovaError {\n constructor(message: string, context?: NovaErrorContext, options?: { cause?: unknown }) {\n super(ErrorCodes.render, message, context, options);\n this.name = 'RenderError';\n }\n}\n\nexport type ComponentNotFoundContext = NovaErrorContext & { name: string };\n\nexport class ComponentNotFoundError extends NovaError {\n constructor(\n message: string,\n context: ComponentNotFoundContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.componentNotFound, message, context, options);\n this.name = 'ComponentNotFoundError';\n }\n}\n\nexport type LayoutRefNotFoundContext = NovaErrorContext & { ref: string };\n\nexport class LayoutRefNotFoundError extends NovaError {\n constructor(\n message: string,\n context: LayoutRefNotFoundContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.layoutRefNotFound, message, context, options);\n this.name = 'LayoutRefNotFoundError';\n }\n}\n\nexport type DefinitionValidationFailure = {\n id: string;\n issues: z.core.$ZodIssue[];\n};\n\nexport type DefinitionValidationContext = NovaErrorContext & {\n failures: DefinitionValidationFailure[];\n};\n\nexport class DefinitionValidationError extends NovaError {\n constructor(\n message: string,\n context: DefinitionValidationContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.definitionValidation, message, context, options);\n this.name = 'DefinitionValidationError';\n }\n}\n\nexport type UnknownActionContext = NovaErrorContext & { actionId: string };\n\nexport class UnknownActionError extends NovaError {\n constructor(\n message: string,\n context: UnknownActionContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.unknownAction, message, context, options);\n this.name = 'UnknownActionError';\n }\n}\n\nexport type UnknownFragmentContext = NovaErrorContext & { fragmentId: string };\n\nexport class UnknownFragmentError extends NovaError {\n constructor(\n message: string,\n context: UnknownFragmentContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.unknownFragment, message, context, options);\n this.name = 'UnknownFragmentError';\n }\n}\n\nexport class ShellDisposedError extends NovaError {\n constructor(message: string, context?: NovaErrorContext, options?: { cause?: unknown }) {\n super(ErrorCodes.shellDisposed, message, context, options);\n this.name = 'ShellDisposedError';\n }\n}\n\nexport type UnknownFunctionContext = NovaErrorContext & { name: string };\n\nexport class UnknownFunctionError extends NovaError {\n constructor(name: string, options?: { cause?: unknown }) {\n super(\n ErrorCodes.unknownFunction,\n `Unknown function: \"${name}\". Is it registered in shell config's \\`functions\\` map?`,\n { name },\n options,\n );\n this.name = 'UnknownFunctionError';\n }\n}\n\nexport type LifecycleHook = 'mount' | 'unmount' | 'suspend' | 'resume';\n\nexport type LifecycleErrorContext = NovaErrorContext & {\n hook?: LifecycleHook;\n instanceId?: string;\n};\n\nexport class LifecycleError extends NovaError {\n constructor(\n message: string,\n context?: LifecycleErrorContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.lifecycle, message, context, options);\n this.name = 'LifecycleError';\n }\n}\n\nexport type MutationErrorContext = NovaErrorContext & {\n op: string;\n path: string;\n reason: 'missing' | 'wrong-type';\n};\n\nexport class MutationError extends NovaError {\n constructor(\n message: string,\n context: MutationErrorContext,\n options?: { cause?: unknown },\n ) {\n super(ErrorCodes.mutation, message, context, options);\n this.name = 'MutationError';\n }\n}\n","import { isArray, isObject } from '../common';\n\n// ═══════════════════════════════════════════════════════════\n// Path helpers — get/set/delete on nested data structures.\n// Dot paths: \"a.b.0.c\". Numeric segments are array indices\n// when the parent is an array.\n// ═══════════════════════════════════════════════════════════\n\nconst splitPath = (path: string): string[] => {\n if (path.length === 0) return [];\n return path.split('.');\n};\n\nconst isIndex = (segment: string): boolean => /^\\d+$/.test(segment);\n\ntype Container = Record<string, unknown> | unknown[];\n\nconst cloneContainer = (value: unknown, nextSegment: string | undefined): Container => {\n if (isArray(value)) return value.slice();\n if (isObject(value)) return { ...value };\n if (nextSegment !== undefined && isIndex(nextSegment)) return [];\n return {};\n};\n\nconst writeSegment = (container: Container, segment: string, value: unknown): void => {\n if (isArray(container)) {\n if (isIndex(segment)) {\n const index = Number.parseInt(segment, 10);\n container[index] = value;\n }\n return;\n }\n container[segment] = value;\n};\n\nconst readSegment = (container: Container, segment: string): unknown => {\n if (isArray(container)) {\n if (!isIndex(segment)) return undefined;\n const index = Number.parseInt(segment, 10);\n return container[index];\n }\n return container[segment];\n};\n\nexport const getPath = (data: unknown, path: string): unknown => {\n const segments = splitPath(path);\n let current: unknown = data;\n for (const segment of segments) {\n if (current === undefined || current === null) return undefined;\n if (isArray(current)) {\n if (isIndex(segment)) {\n const index = Number.parseInt(segment, 10);\n current = current[index];\n continue;\n }\n if (segment === 'length') {\n current = current.length;\n continue;\n }\n return undefined;\n }\n if (isObject(current)) {\n if (segment in current) {\n current = current[segment];\n continue;\n }\n return undefined;\n }\n return undefined;\n }\n return current;\n};\n\nexport const setPath = (data: unknown, path: string, value: unknown): unknown => {\n const segments = splitPath(path);\n if (segments.length === 0) return value;\n\n const root = cloneContainer(data, segments[0]);\n let parent: Container = root;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const segment = segments[i];\n const nextSegment = segments[i + 1];\n if (segment === undefined) continue;\n const existing = readSegment(parent, segment);\n const cloned = cloneContainer(existing, nextSegment);\n writeSegment(parent, segment, cloned);\n parent = cloned;\n }\n\n const last = segments[segments.length - 1];\n if (last !== undefined) writeSegment(parent, last, value);\n return root;\n};\n\nexport const deletePath = (data: unknown, path: string): unknown => {\n const segments = splitPath(path);\n if (segments.length === 0) return undefined;\n\n const root = cloneContainer(data, segments[0]);\n let parent: Container = root;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const segment = segments[i];\n const nextSegment = segments[i + 1];\n if (segment === undefined) continue;\n const existing = readSegment(parent, segment);\n if (existing === undefined || existing === null) return root;\n const cloned = cloneContainer(existing, nextSegment);\n writeSegment(parent, segment, cloned);\n parent = cloned;\n }\n\n const last = segments[segments.length - 1];\n if (last === undefined) return root;\n if (isArray(parent)) {\n if (isIndex(last)) {\n const index = Number.parseInt(last, 10);\n parent.splice(index, 1);\n }\n } else {\n delete parent[last];\n }\n return root;\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { hasKey, isObject } from '@shared/common';\nimport type { MutationOp } from '../types';\n\nexport const SetByValueSchema = z\n .object({\n set: z.string().describe('Data path to write to, e.g. \"user.name\" or \"items.0.title\".'),\n value: z.unknown().describe('Literal value to write at the path.'),\n })\n .strict()\n .describe('Set a field at a path to a literal value.');\n\nexport type SetByValueMutation = z.infer<typeof SetByValueSchema>;\n\nexport const SetByFromSchema = z\n .object({\n set: z.string().describe('Data path to write to.'),\n from: z.string().describe('Data path (or template path) to read the value from.'),\n })\n .strict()\n .describe('Set a field at a path by copying from another path.');\n\nexport type SetByFromMutation = z.infer<typeof SetByFromSchema>;\n\nexport const setValueOp: MutationOp<SetByValueMutation> = {\n key: 'set',\n schema: SetByValueSchema,\n match: (mutation) => hasKey(mutation, 'set') && hasKey(mutation, 'value'),\n apply: (data, mutation) => {\n const next = setPath(data, mutation.set, mutation.value);\n return isObject(next) ? next : data;\n },\n};\n\nexport const setFromOp: MutationOp<SetByFromMutation> = {\n key: 'set',\n schema: SetByFromSchema,\n match: (mutation) => hasKey(mutation, 'set') && hasKey(mutation, 'from'),\n apply: (data, mutation) => {\n const value = getPath(data, mutation.from);\n const next = setPath(data, mutation.set, value);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isObject } from '@shared/common';\nimport type { MutationOp } from '../types';\n\nexport const ToggleSchema = z\n .object({\n toggle: z.string().describe('Boolean data path to flip.'),\n })\n .strict()\n .describe('Flip a boolean at the given path.');\n\nexport type ToggleMutation = z.infer<typeof ToggleSchema>;\n\nexport const toggleOp: MutationOp<ToggleMutation> = {\n key: 'toggle',\n schema: ToggleSchema,\n apply: (data, mutation) => {\n const current = getPath(data, mutation.toggle);\n const flipped = !(current === true);\n const next = setPath(data, mutation.toggle, flipped);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isObject } from '@shared/common';\nimport type { MutationOp } from '../types';\n\nexport const IncrementSchema = z\n .object({\n increment: z.string().describe('Numeric data path to increment.'),\n by: z.number().optional().describe('Amount to increment by; defaults to 1.'),\n })\n .strict()\n .describe('Increment a numeric field.');\n\nexport type IncrementMutation = z.infer<typeof IncrementSchema>;\n\nexport const incrementOp: MutationOp<IncrementMutation> = {\n key: 'increment',\n schema: IncrementSchema,\n apply: (data, mutation) => {\n const current = getPath(data, mutation.increment);\n const base = typeof current === 'number' ? current : 0;\n const by = mutation.by ?? 1;\n const next = setPath(data, mutation.increment, base + by);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isObject } from '@shared/common';\nimport type { MutationOp } from '../types';\n\nexport const DecrementSchema = z\n .object({\n decrement: z.string().describe('Numeric data path to decrement.'),\n by: z.number().optional().describe('Amount to decrement by; defaults to 1.'),\n })\n .strict()\n .describe('Decrement a numeric field.');\n\nexport type DecrementMutation = z.infer<typeof DecrementSchema>;\n\nexport const decrementOp: MutationOp<DecrementMutation> = {\n key: 'decrement',\n schema: DecrementSchema,\n apply: (data, mutation) => {\n const current = getPath(data, mutation.decrement);\n const base = typeof current === 'number' ? current : 0;\n const by = mutation.by ?? 1;\n const next = setPath(data, mutation.decrement, base - by);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isArray, isObject } from '@shared/common';\nimport { MutationError } from '@shared/errors';\nimport type { MutationOp } from '../types';\n\nexport const PushSchema = z\n .object({\n push: z.string().describe('Array data path to append to.'),\n value: z.unknown().optional().describe('Value to append.'),\n })\n .strict()\n .describe('Append a value to an array field.');\n\nexport type PushMutation = z.infer<typeof PushSchema>;\n\nexport const pushOp: MutationOp<PushMutation> = {\n key: 'push',\n schema: PushSchema,\n // Guard against the PushEffect navigation effect whose `push` is an object.\n match: (mutation) => typeof mutation.push === 'string',\n apply: (data, mutation, ctx) => {\n const current = getPath(data, mutation.push);\n // push tolerates missing paths by creating a new array (lax mode only).\n if (current !== undefined && !isArray(current)) {\n if (ctx.strict) {\n throw new MutationError(\n `push: path \"${mutation.push}\" is not an array`,\n { op: 'push', path: mutation.push, reason: 'wrong-type' },\n );\n }\n return data;\n }\n if (current === undefined && ctx.strict) {\n throw new MutationError(\n `push: path \"${mutation.push}\" does not exist`,\n { op: 'push', path: mutation.push, reason: 'missing' },\n );\n }\n const arr = isArray(current) ? current.slice() : [];\n arr.push(mutation.value);\n const next = setPath(data, mutation.push, arr);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isArray, isObject } from '@shared/common';\nimport { MutationError } from '@shared/errors';\nimport type { MutationOp } from '../types';\n\nexport const PopSchema = z\n .object({\n pop: z.string().describe('Array data path to remove the last element from.'),\n })\n .strict()\n .describe('Remove the last element from an array field.');\n\nexport type PopMutation = z.infer<typeof PopSchema>;\n\nexport const popOp: MutationOp<PopMutation> = {\n key: 'pop',\n schema: PopSchema,\n // Guard against the PopEffect whose `pop` is the literal `true`.\n match: (mutation) => typeof mutation.pop === 'string',\n apply: (data, mutation, ctx) => {\n const current = getPath(data, mutation.pop);\n if (!isArray(current)) {\n if (ctx.strict) {\n throw new MutationError(\n `pop: path \"${mutation.pop}\" ${current === undefined ? 'does not exist' : 'is not an array'}`,\n { op: 'pop', path: mutation.pop, reason: current === undefined ? 'missing' : 'wrong-type' },\n );\n }\n return data;\n }\n const arr = current.slice();\n arr.pop();\n const next = setPath(data, mutation.pop, arr);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isArray, isObject } from '@shared/common';\nimport { MutationError } from '@shared/errors';\nimport type { MutationOp } from '../types';\n\nexport const RemoveAtSchema = z\n .object({\n removeAt: z.string().describe('Array data path to remove an element from.'),\n index: z\n .union([z.number().int(), z.string()])\n .describe('Index to remove. A string is a template (e.g. \"{{@event.payload}}\") resolved before applying.'),\n })\n .strict()\n .describe('Remove an element at a specific index of an array field.');\n\nexport type RemoveAtMutation = z.infer<typeof RemoveAtSchema>;\n\nexport const removeAtOp: MutationOp<RemoveAtMutation> = {\n key: 'removeAt',\n schema: RemoveAtSchema,\n apply: (data, mutation, ctx) => {\n const current = getPath(data, mutation.removeAt);\n if (!isArray(current)) {\n if (ctx.strict) {\n throw new MutationError(\n `removeAt: path \"${mutation.removeAt}\" ${current === undefined ? 'does not exist' : 'is not an array'}`,\n {\n op: 'removeAt',\n path: mutation.removeAt,\n reason: current === undefined ? 'missing' : 'wrong-type',\n },\n );\n }\n return data;\n }\n // Index may be a literal number or a resolved template; coerce and guard.\n const index = Number(mutation.index);\n if (!Number.isInteger(index)) return data;\n const arr = current.slice();\n arr.splice(index, 1);\n const next = setPath(data, mutation.removeAt, arr);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isArray, isObject } from '@shared/common';\nimport { MutationError } from '@shared/errors';\nimport type { MutationOp } from '../types';\n\nexport const MoveSchema = z\n .object({\n move: z.string().describe('Array data path to reorder within.'),\n from: z\n .union([z.number().int(), z.string()])\n .describe('Index to move. A string is a template (e.g. \"{{@event.payload}}\") resolved before applying.'),\n to: z\n .union([z.number().int(), z.string()])\n .describe('Destination index. A string is a template resolved before applying.'),\n })\n .strict()\n .describe('Move an array element from one index to another.');\n\nexport type MoveMutation = z.infer<typeof MoveSchema>;\n\nexport const moveOp: MutationOp<MoveMutation> = {\n key: 'move',\n schema: MoveSchema,\n apply: (data, mutation, ctx) => {\n const current = getPath(data, mutation.move);\n if (!isArray(current)) {\n if (ctx.strict) {\n throw new MutationError(\n `move: path \"${mutation.move}\" ${current === undefined ? 'does not exist' : 'is not an array'}`,\n {\n op: 'move',\n path: mutation.move,\n reason: current === undefined ? 'missing' : 'wrong-type',\n },\n );\n }\n return data;\n }\n // from/to may be literal numbers or resolved templates; coerce and guard.\n const from = Number(mutation.from);\n const to = Number(mutation.to);\n if (!Number.isInteger(from) || !Number.isInteger(to)) return data;\n if (from < 0 || from >= current.length) return data;\n const arr = current.slice();\n const [item] = arr.splice(from, 1);\n arr.splice(Math.max(0, Math.min(to, arr.length)), 0, item);\n const next = setPath(data, mutation.move, arr);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { deletePath, getPath, setPath } from '@shared/bindings/paths';\nimport { isArray, isObject } from '@shared/common';\nimport { MutationError } from '@shared/errors';\nimport type { MutationOp } from '../types';\n\nexport const ClearSchema = z\n .object({\n clear: z.string().describe('Array or object data path to clear.'),\n })\n .strict()\n .describe('Clear an array or object field.');\n\nexport type ClearMutation = z.infer<typeof ClearSchema>;\n\nexport const clearOp: MutationOp<ClearMutation> = {\n key: 'clear',\n schema: ClearSchema,\n apply: (data, mutation, ctx) => {\n const current = getPath(data, mutation.clear);\n if (isArray(current)) {\n const next = setPath(data, mutation.clear, []);\n return isObject(next) ? next : data;\n }\n if (isObject(current)) {\n const next = setPath(data, mutation.clear, {});\n return isObject(next) ? next : data;\n }\n if (ctx.strict) {\n throw new MutationError(\n `clear: path \"${mutation.clear}\" ${current === undefined ? 'does not exist' : 'is not an array or object'}`,\n {\n op: 'clear',\n path: mutation.clear,\n reason: current === undefined ? 'missing' : 'wrong-type',\n },\n );\n }\n const next = deletePath(data, mutation.clear);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { getPath, setPath } from '@shared/bindings/paths';\nimport { isObject } from '@shared/common';\nimport type { MutationOp } from '../types';\n\nexport const ResetSchema = z\n .object({\n reset: z.string().describe('Data path to reset to its initial (definition.data) value.'),\n })\n .strict()\n .describe('Reset a field to its initial value from the action definition.');\n\nexport type ResetMutation = z.infer<typeof ResetSchema>;\n\nexport const resetOp: MutationOp<ResetMutation> = {\n key: 'reset',\n schema: ResetSchema,\n apply: (data, mutation, ctx) => {\n const initialValue = getPath(ctx.initial, mutation.reset);\n const next = setPath(data, mutation.reset, initialValue);\n return isObject(next) ? next : data;\n },\n};\n","import { z } from 'zod';\nimport { setValueOp, setFromOp } from './set';\nimport { toggleOp } from './toggle';\nimport { incrementOp } from './increment';\nimport { decrementOp } from './decrement';\nimport { pushOp } from './push';\nimport { popOp } from './pop';\nimport { removeAtOp } from './remove-at';\nimport { moveOp } from './move';\nimport { clearOp } from './clear';\nimport { resetOp } from './reset';\nimport type { MutationOp } from '../types';\n\n// The single source of truth for mutation operations. The validation schema,\n// the `Mutation` type, and the runtime dispatch table (see registry.ts) are\n// all derived from this one list — adding an op is a one-line change here.\nexport const OPS = [\n setValueOp,\n setFromOp,\n toggleOp,\n incrementOp,\n decrementOp,\n pushOp,\n popOp,\n removeAtOp,\n moveOp,\n clearOp,\n resetOp,\n] as const;\n\n// Precise mutation type, distributed from each op's own mutation shape.\ntype MutationOf<O> = O extends MutationOp<infer T> ? T : never;\nexport type Mutation = MutationOf<(typeof OPS)[number]>;\n\n// Runtime validator, derived from the ops: a mutation is any one of their\n// schemas. The cast widens each op's schema to `z.ZodType<Mutation>` (sound —\n// every op's mutation is a Mutation) so the union's output type is `Mutation`.\nexport const MutationSchema = z\n .union(\n OPS.map((op) => op.schema) as [z.ZodType<Mutation>, z.ZodType<Mutation>, ...z.ZodType<Mutation>[]],\n )\n .describe('A single immutable mutation applied to the action data.');\n","import { hasKey, isObject } from '@shared/common';\nimport { OPS, type Mutation } from './ops';\nimport type { MutationContext, MutationData, MutationOp } from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Pure dispatch over the op list. Each op is generic over its own\n// mutation shape; `toDispatchOp` collapses that into a uniform handler\n// that runs the op's own schema parse before apply. The single `any` is\n// the deliberate type-erasure boundary where the heterogeneous ops meet\n// one dispatch table — each op's schema/apply stay type-checked at their\n// definition. The table is derived from OPS, so it can't drift from it.\n// ═══════════════════════════════════════════════════════════\n\ntype DispatchOp = {\n key: string;\n match: (mutation: Record<string, unknown>) => boolean;\n run: (data: MutationData, mutation: Record<string, unknown>, ctx: MutationContext) => MutationData;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- erasure boundary\nconst toDispatchOp = (op: MutationOp<any>): DispatchOp => ({\n key: op.key,\n match: op.match ?? ((mutation) => hasKey(mutation, op.key)),\n run: (data, mutation, ctx) => op.apply(data, op.schema.parse(mutation), ctx),\n});\n\nconst DISPATCH: readonly DispatchOp[] = OPS.map(toDispatchOp);\n\nconst findOp = (mutation: Record<string, unknown>): DispatchOp | undefined => {\n for (const op of DISPATCH) {\n if (op.match(mutation)) return op;\n }\n return undefined;\n};\n\nexport type ApplyMutationOptions = {\n /** Snapshot used by `reset`. Must be deep-cloned by the caller. */\n initial?: MutationData;\n /** Strict mode — array ops throw MutationError on missing/wrong-type paths. */\n strict?: boolean;\n};\n\nconst buildCtx = (opts: ApplyMutationOptions): MutationContext => ({\n initial: opts.initial ?? {},\n strict: opts.strict ?? false,\n});\n\nexport const applyMutation = (\n data: MutationData,\n mutation: Mutation,\n opts: ApplyMutationOptions = {},\n): MutationData => {\n if (!isObject(mutation)) return data;\n const op = findOp(mutation);\n if (op === undefined) return data;\n return op.run(data, mutation, buildCtx(opts));\n};\n\nexport const applyMutations = (\n data: MutationData,\n mutations: readonly Mutation[],\n opts: ApplyMutationOptions = {},\n): MutationData => {\n if (mutations.length === 0) return data;\n const ctx = buildCtx(opts);\n let current = data;\n for (const mutation of mutations) {\n if (!isObject(mutation)) continue;\n const op = findOp(mutation);\n if (op === undefined) continue;\n current = op.run(current, mutation, ctx);\n }\n return current;\n};\n","import { z } from 'zod';\n\nconst HttpEndpointSchema = z\n .object({\n url: z.string().describe('Template URL, e.g. \"/api/users/{{$.userId}}\".'),\n method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).describe('HTTP method.'),\n headers: z.record(z.string(), z.string()).optional().describe('Static request headers.'),\n request: z\n .unknown()\n .optional()\n .describe(\n 'Transform config run by the injected evaluator over the ACTION DATA to build the ' +\n 'request body — EVALUATED ON EVERY CALL, so body values can follow screen state. ' +\n 'Static parts are literal JSON; a dynamic part is an evaluator op over the data root, ' +\n 'e.g. { \"q\": { \"$ref\": \"$.search\" } } makes body field q carry the current $.search each call. ' +\n 'Requires an injected transform.',\n ),\n response: z\n .unknown()\n .optional()\n .describe(\n 'Transform config run by the injected evaluator over the reply as received ' +\n '(`$` is the reply — object, array, or scalar) to produce the value stored at `target`. ' +\n 'Requires an injected transform.',\n ),\n target: z.string().optional().describe('Data path to store the result at on success.'),\n errorTarget: z.string().optional().describe('Data path to store the error at on failure.'),\n timeoutMs: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('How long to wait for the reply, in ms, before the call fails to onError. Defaults to the shell default (30000). Set it on an endpoint that is slow by nature — a model call that may take minutes.'),\n })\n .strict()\n .describe('A named HTTP call. `request`/`response` shape the body/reply via the injected transform.');\n\nconst FunctionEndpointSchema = z\n .object({\n fn: z\n .string()\n .describe(\n 'Key of a function registered in `ShellConfig.functions`. The host must ' +\n 'register the name before the action runs.',\n ),\n target: z.string().optional().describe('Data path to store the return value at on success.'),\n errorTarget: z.string().optional().describe('Data path to store the error at on failure.'),\n timeoutMs: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('How long to wait for the reply, in ms, before the call fails to onError. Defaults to the shell default (30000). Set it on an endpoint that is slow by nature — a model call that may take minutes.'),\n })\n .strict()\n .describe('A named local function call. Handler is provided via `ShellConfig.functions`.');\n\nexport const EndpointConfigSchema = z\n .union([HttpEndpointSchema, FunctionEndpointSchema])\n .describe('An endpoint — either an HTTP call or a local function.');\n\nexport type EndpointConfig = z.infer<typeof EndpointConfigSchema>;\nexport type HttpEndpointConfig = z.infer<typeof HttpEndpointSchema>;\nexport type FunctionEndpointConfig = z.infer<typeof FunctionEndpointSchema>;\n","import { z } from 'zod';\nimport { MutationSchema } from '../mutations';\nimport type { Mutation } from '../mutations';\n\n// ═══════════════════════════════════════════════════════════\n// Effects + Steps (recursive union of Mutation | Effect)\n// ═══════════════════════════════════════════════════════════\n\nexport type Step = Mutation | Effect;\n\nexport type CallEffect = {\n call: string;\n onSuccess?: Step[];\n onError?: Step[];\n};\n\nexport type EmitEffect = {\n emit: { channel: string; payload?: unknown };\n};\n\nexport type PushEffect = {\n push: { action: string; canvas?: string; input?: Record<string, unknown>; with?: string[] };\n};\n\nexport type PopEffect = { pop: true };\n\nexport type ReplaceEffect = {\n replace: { action: string; canvas?: string; input?: Record<string, unknown>; with?: string[] };\n};\n\n// Pop a canvas down to a given instance (everything above it is popped). The\n// stack-nav breadcrumb fires this with the target crumb's instance id.\nexport type PopToEffect = { popTo: { canvas?: string; instance: string } };\n\n// Reset a canvas to a single root action (clear the whole stack, then push). The\n// screen-level nav (sidebar) fires this so drilling into a record doesn't leave\n// a stale stack beneath the new screen.\nexport type ResetToEffect = {\n resetTo: { action: string; canvas?: string; input?: Record<string, unknown>; with?: string[] };\n};\n\n// Remove ONE instance anywhere in a canvas's stack (not just the top). On a\n// list-mode canvas — where every card is live and visible at once — this is how\n// a card's own close button dismisses itself. `pop` removes the top; this\n// removes a named one.\nexport type RemoveInstanceEffect = { removeInstance: { canvas?: string; instance: string } };\n\n// Sugar for `removeInstance` aimed at the firing instance itself: a card's X\n// says \"close me\" without knowing its own id. The runtime desugars it to\n// `removeInstance` with the instance's real id before it escapes.\nexport type RemoveSelfEffect = { removeSelf: true };\n\n// Make a canvas EQUAL a list read from the action's data — the declarative\n// verb (shell/reconcile.ts) as a step. Every other navigation step moves ONE\n// action; a surface whose actions come from rows (a set of tools, a set of\n// cards) has as many as the rows say, and a fixed list of steps cannot.\n// Missing actions are pushed, ones no longer listed are removed, ones already\n// there stay mounted. A row naming an action this shell does not have (not\n// granted) is skipped, as an ungranted `initial` candidate is.\nexport type ReconcileEffect = {\n reconcile: { to: string; action: string; input?: string; canvas?: string; own?: 'pushed' | 'canvas'; with?: string[] };\n};\nexport type ReloadEffect = { reload: true };\n\nexport type Effect =\n | CallEffect\n | EmitEffect\n | PushEffect\n | PopEffect\n | ReplaceEffect\n | PopToEffect\n | ResetToEffect\n | RemoveInstanceEffect\n | RemoveSelfEffect\n | ReconcileEffect\n | ReloadEffect;\n\nexport const StepSchema: z.ZodType<Step> = z.lazy(() =>\n z.union([MutationSchema, EffectSchema]).describe('A step is either a mutation or an effect.'),\n);\n\nconst CallEffectSchema: z.ZodType<CallEffect> = z.lazy(() =>\n z\n .object({\n call: z.string().describe('Name of the endpoint to invoke.'),\n onSuccess: z.array(StepSchema).optional().describe('Steps to run after a successful response.'),\n onError: z\n .array(StepSchema)\n .optional()\n .describe('Steps to run after an error response (with @error scope available).'),\n })\n .strict()\n .describe('Invoke a named endpoint with optional success/error step branches.'),\n);\n\nconst EmitEffectSchema = z\n .object({\n emit: z\n .object({\n channel: z.string().describe('Channel name to publish on.'),\n payload: z\n .unknown()\n .optional()\n .describe('Payload to publish; templates are resolved against the current data.'),\n })\n .strict()\n .describe('Channel + payload to publish.'),\n })\n .strict()\n .describe('Publish a payload to a message channel.');\n\nconst PushEffectSchema = z\n .object({\n push: z\n .object({\n action: z\n .string()\n .describe('Definition id of the action to push onto a canvas — MUST be an id that actually exists (an unknown id fails at click time, invisible to a mount check).'),\n canvas: z.string().optional().describe('Canvas id to push onto; defaults to the current canvas.'),\n input: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial input merged into the new action data. Keys must belong to the target action\\'s declared input contract — invented keys are silently useless.'),\n with: z\n .array(z.string())\n .optional()\n .describe('Fragment ids to compose the action with before it is instantiated. Each wraps the action (the action fills its `{ slot }`) and contributes its triggers/data; the action wins on conflict. See ActionFragment.'),\n })\n .strict()\n .describe('Push parameters.'),\n })\n .strict()\n .describe('Push a new action onto a canvas (escapes via onNavigate callback).');\n\nconst PopEffectSchema = z\n .object({\n pop: z.literal(true).describe('Sentinel literal — must be true.'),\n })\n .strict()\n .describe('Pop the current action (escapes via onNavigate callback).');\n\nconst ReplaceEffectSchema = z\n .object({\n replace: z\n .object({\n action: z.string().describe('Definition id of the replacement action.'),\n canvas: z\n .string()\n .optional()\n .describe('Canvas id to replace on; defaults to the current canvas.'),\n input: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial input merged into the new action data.'),\n with: z\n .array(z.string())\n .optional()\n .describe('Fragment ids to compose the action with before it is instantiated. Each wraps the action (the action fills its `{ slot }`) and contributes its triggers/data; the action wins on conflict. See ActionFragment.'),\n })\n .strict()\n .describe('Replace parameters.'),\n })\n .strict()\n .describe('Replace the current action (escapes via onNavigate callback).');\n\nconst PopToEffectSchema = z\n .object({\n popTo: z\n .object({\n canvas: z.string().optional().describe('Canvas id to pop on; defaults to the current canvas.'),\n instance: z.string().describe('Pop the canvas until this instance id is on top (no-op if absent).'),\n })\n .strict()\n .describe('Pop-to-instance parameters.'),\n })\n .strict()\n .describe('Pop a canvas down to a given instance (escapes via onNavigate callback).');\n\nconst ResetToEffectSchema = z\n .object({\n resetTo: z\n .object({\n action: z.string().describe('Definition id of the new root action.'),\n canvas: z.string().optional().describe('Canvas id to reset; defaults to the current canvas.'),\n input: z.record(z.string(), z.unknown()).optional().describe('Initial input merged into the new root action.'),\n with: z.array(z.string()).optional().describe('Fragment ids to compose the action with. See ActionFragment.'),\n })\n .strict()\n .describe('Reset parameters.'),\n })\n .strict()\n .describe('Clear a canvas and push a single new root action (escapes via onNavigate callback).');\n\nconst RemoveInstanceEffectSchema = z\n .object({\n removeInstance: z\n .object({\n canvas: z.string().optional().describe('Canvas id to remove from; defaults to the current canvas.'),\n instance: z.string().describe('Instance id to unmount and drop from the stack (no-op if absent).'),\n })\n .strict()\n .describe('Remove-instance parameters.'),\n })\n .strict()\n .describe('Remove one instance anywhere in a canvas stack (escapes via onNavigate callback).');\n\nconst RemoveSelfEffectSchema = z\n .object({\n removeSelf: z.literal(true).describe('Sentinel literal — must be true. Removes the firing instance (desugars to removeInstance).'),\n })\n .strict()\n .describe('Close the firing instance — the list-card X (escapes via onNavigate callback).');\n\nconst ReconcileEffectSchema = z\n .object({\n reconcile: z\n .object({\n to: z.string().describe('Binding to the desired list, e.g. \"$.tools\" — an array of rows; anything else is an empty list.'),\n action: z.string().describe('The row field naming the action to place, e.g. \"tool_id\". Rows without it are skipped.'),\n input: z.string().optional().describe('The row field holding that action\\'s input (an object), if any.'),\n canvas: z.string().optional().describe('Canvas id to reconcile; defaults to the current canvas.'),\n own: z\n .enum(['pushed', 'canvas'])\n .optional()\n .describe('What this step may remove: \"pushed\" (default) only what this action placed there; \"canvas\" everything on it — for an action that owns the canvas outright.'),\n with: z.array(z.string()).optional().describe('Fragment ids to compose each placed action with. See ActionFragment.'),\n })\n .strict()\n .describe('Reconcile parameters.'),\n })\n .strict()\n .describe('Make a canvas hold exactly the actions a list names: push the missing, remove the unlisted, keep the rest mounted (escapes via onNavigate callback).');\n\n// Re-run the firing instance's `mount` hook — the action re-reads whatever it\n// reads, in place, keeping its identity and its data.\n//\n// The gap this fills: a stacked canvas suspends what it covers and `resume`\n// already re-runs mount, so a revealed action is never stale. A LIST canvas\n// suspends nothing — every card stays active — so a card that loaded at seed\n// time and is opened an hour later would show the hour-old answer. `reload` is\n// what \"opening it\" means there.\nconst ReloadEffectSchema = z\n .object({\n reload: z.literal(true).describe('Sentinel literal — must be true. Re-runs this instance\\'s mount hook.'),\n })\n .strict()\n .describe('Re-read the firing instance in place — the list-card open.');\n\nexport const EffectSchema: z.ZodType<Effect> = z.lazy(() =>\n z\n .union([CallEffectSchema, EmitEffectSchema, PushEffectSchema, PopEffectSchema, ReplaceEffectSchema, PopToEffectSchema, ResetToEffectSchema, RemoveInstanceEffectSchema, RemoveSelfEffectSchema, ReconcileEffectSchema, ReloadEffectSchema])\n .describe('An effect that touches the outside world.'),\n);\n","import { z } from 'zod';\nimport { StepSchema } from './effects';\n\nexport const LifecycleConfigSchema = z\n .object({\n mount: z.array(StepSchema).optional().describe('Steps to run when the action mounts.'),\n unmount: z.array(StepSchema).optional().describe('Steps to run when the action unmounts.'),\n suspend: z.array(StepSchema).optional().describe('Steps to run when the action is suspended.'),\n resume: z.array(StepSchema).optional().describe('Steps to run when the action resumes.'),\n })\n .strict()\n .describe('Lifecycle hooks for the action runtime state machine.');\n\nexport type LifecycleConfig = z.infer<typeof LifecycleConfigSchema>;\n","import { z } from 'zod';\nimport { StepSchema } from './effects';\n\nexport const TriggerConfigSchema = z\n .object({\n event: z\n .string()\n .optional()\n .describe('UI event type to listen for: \"ui:click\" (activations, incl. table rows), \"ui:model\" (an input\\'s value changed), \"ui:key\".'),\n message: z.string().optional().describe('Message bus channel name to listen on (fired by an `emit` step, possibly from another action).'),\n ref: z\n .string()\n .optional()\n .describe('Component ref to filter events by — MUST match a `ref` carried by a node in this action\\'s layout; a trigger on a ref no layout node carries never fires.'),\n key: z.string().optional().describe('Key to filter \"ui:key\" events by, e.g. \"ArrowDown\".'),\n do: z\n .array(StepSchema)\n .describe('Ordered steps to execute when the trigger fires. Steps may reference the firing event as \"@event\" — \"@event.payload\" is the fired value (a table row click: the row\\'s clickKey/rowKey field; an input\\'s ui:model: the typed text).'),\n })\n .strict()\n .refine((trigger) => trigger.event !== undefined || trigger.message !== undefined, {\n message: 'A trigger must specify either \"event\" or \"message\".',\n })\n .describe('Binds an event or message source to an ordered sequence of steps.');\n\nexport type TriggerConfig = z.infer<typeof TriggerConfigSchema>;\n","import { z } from 'zod';\nimport { LayoutNodeSchema } from '@layout/schemas';\nimport { MutationSchema } from '../mutations';\nimport { EndpointConfigSchema } from './endpoints';\nimport { LifecycleConfigSchema } from './lifecycle';\nimport { TriggerConfigSchema } from './triggers';\n\n// ═══════════════════════════════════════════════════════════\n// Action Definition — composes all sibling schemas.\n// ═══════════════════════════════════════════════════════════\n\nexport const ActionDefinitionSchema = z\n .object({\n id: z.string().describe('Stable definition id.'),\n name: z.string().optional().describe('Human-readable name.'),\n description: z.string().optional().describe('Free-form description.'),\n title: z\n .string()\n .optional()\n .describe(\n \"A resolvable label for this instance, evaluated against its own data (e.g. '{{$.view.record.name}}'). Exposed as `instance.title` on a canvas's actionLayout scope so stack-nav chrome can label crumbs/tabs; falls back to `name` then the action id.\",\n ),\n layout: z\n .union([z.string(), LayoutNodeSchema])\n .optional()\n .describe('Either a layout id stored in the layout store, or an inline LayoutNode.'),\n data: z.record(z.string(), z.unknown()).optional().describe('Static default data merged with input on mount.'),\n input: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n 'JSON Schema of the data keys an opener may seed when loading this action — its public, openable-input contract (author in Zod, convert with z.toJSONSchema). Fields must be a subset of `data`. Descriptive only: the runtime does not validate loads against it.',\n ),\n triggers: z.array(TriggerConfigSchema).optional().describe('Event/message triggers.'),\n endpoints: z\n .record(z.string(), EndpointConfigSchema)\n .optional()\n .describe('Named endpoints — HTTP calls or local functions.'),\n lifecycle: LifecycleConfigSchema.optional().describe('Lifecycle hooks.'),\n })\n .strict()\n .describe('Definition of an action: layout + data + behavior.');\n\nexport type ActionDefinition = z.infer<typeof ActionDefinitionSchema>;\n\n// ═══════════════════════════════════════════════════════════\n// Action Fragment — a reusable PARTIAL action (every field optional) that is\n// MERGED into a concrete action at a push/replace `with`, producing the\n// effective ActionDefinition that gets instantiated. This is composition, not\n// inheritance: `Action + ActionFragment ⇒ Action`. A fragment is abstract — it\n// only exists merged, lives in its own registry, and cannot be pushed as an\n// action on its own. Its `layout` is the chrome that WRAPS the action; a\n// `{ slot: 'body' }` node in it is filled with the composing action's layout.\n// On merge: the action's layout fills the slot; data/endpoints deep-merge with\n// the action winning; triggers and per-hook lifecycle steps concatenate\n// (fragment first). See `composeAction`.\n// ═══════════════════════════════════════════════════════════\n\nexport const ActionFragmentSchema = z\n .object({\n kind: z.literal('fragment').describe('Discriminator — marks this as an abstract, merge-only fragment.'),\n id: z.string().describe('Stable fragment id, referenced from a push/replace `with: [...]`.'),\n name: z.string().optional().describe('Human-readable name.'),\n description: z.string().optional().describe('Free-form description.'),\n layout: z\n .union([z.string(), LayoutNodeSchema])\n .optional()\n .describe('The wrapping (chrome) layout, or a layout id. Put a `{ slot: \"body\" }` node where the composing action\\'s own layout is dropped in.'),\n data: z.record(z.string(), z.unknown()).optional().describe('Partial default data; deep-merged under the action (the action wins on conflict).'),\n triggers: z.array(TriggerConfigSchema).optional().describe('Pre-wired triggers (e.g. a modal\\'s close/cancel). Concatenated before the action\\'s triggers.'),\n endpoints: z\n .record(z.string(), EndpointConfigSchema)\n .optional()\n .describe('Named endpoints, merged under the action (the action wins on a name clash).'),\n lifecycle: LifecycleConfigSchema.optional().describe('Lifecycle hooks; per-hook steps run before the action\\'s.'),\n })\n .strict()\n .describe('A reusable partial action — layout + wired behavior — merged into a concrete action at a push `with`. Abstract: only exists merged, never instantiated alone.');\n\nexport type ActionFragment = z.infer<typeof ActionFragmentSchema>;\n\n// Re-export mutations schema (for backwards-compatible imports within action/)\nexport { MutationSchema };\nexport type { Mutation } from '../mutations';\n\n// Re-export sibling schemas + inferred types\nexport { EffectSchema, StepSchema } from './effects';\nexport type { Effect, Step, CallEffect, EmitEffect, PushEffect, PopEffect, ReplaceEffect, PopToEffect, ResetToEffect, RemoveInstanceEffect, RemoveSelfEffect, ReconcileEffect, ReloadEffect } from './effects';\nexport { TriggerConfigSchema } from './triggers';\nexport type { TriggerConfig } from './triggers';\nexport { EndpointConfigSchema } from './endpoints';\nexport type { EndpointConfig, HttpEndpointConfig, FunctionEndpointConfig } from './endpoints';\nexport { LifecycleConfigSchema } from './lifecycle';\nexport type { LifecycleConfig } from './lifecycle';\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/layout/head.ts
|
|
4
|
+
var HEAD_NAME = "nova:head";
|
|
5
|
+
var HEAD_TITLE_NAME = "nova:title";
|
|
6
|
+
var HEAD_META_NAME = "nova:meta";
|
|
7
|
+
var HEAD_LINK_NAME = "nova:link";
|
|
8
|
+
var HEAD_SCRIPT_NAME = "nova:script";
|
|
9
|
+
var HEAD_NAMES = [HEAD_NAME, HEAD_TITLE_NAME, HEAD_META_NAME, HEAD_LINK_NAME, HEAD_SCRIPT_NAME];
|
|
10
|
+
var headKeyOf = (element) => {
|
|
11
|
+
const said = (name) => {
|
|
12
|
+
const found = Object.entries(element.attributes).find(([key]) => key.toLowerCase() === name)?.[1].trim().toLowerCase();
|
|
13
|
+
return found === void 0 || found === "" ? void 0 : found;
|
|
14
|
+
};
|
|
15
|
+
if (element.tag === "title") return "title";
|
|
16
|
+
if (element.tag === "meta") {
|
|
17
|
+
const [name, property] = [said("name"), said("property")];
|
|
18
|
+
if (name !== void 0) return `meta name ${name}`;
|
|
19
|
+
return property === void 0 ? void 0 : `meta property ${property}`;
|
|
20
|
+
}
|
|
21
|
+
if (element.tag === "link") return (said("rel") ?? "").split(/\s+/).includes("canonical") ? "link canonical" : void 0;
|
|
22
|
+
return void 0;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.HEAD_LINK_NAME = HEAD_LINK_NAME;
|
|
26
|
+
exports.HEAD_META_NAME = HEAD_META_NAME;
|
|
27
|
+
exports.HEAD_NAME = HEAD_NAME;
|
|
28
|
+
exports.HEAD_NAMES = HEAD_NAMES;
|
|
29
|
+
exports.HEAD_SCRIPT_NAME = HEAD_SCRIPT_NAME;
|
|
30
|
+
exports.HEAD_TITLE_NAME = HEAD_TITLE_NAME;
|
|
31
|
+
exports.headKeyOf = headKeyOf;
|
|
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,GAAA,KAAQ,MAAA,EAAQ,OAAA,CAAQ,KAAK,KAAK,CAAA,IAAK,EAAA,EAAI,KAAA,CAAM,KAAK,CAAA,CAAE,QAAA,CAAS,WAAW,IAAI,gBAAA,GAAmB,MAAA;AAC/G,EAAA,OAAO,MAAA;AACT","file":"chunk-GV7UC3SS.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════\n// THE HEAD — `nova:head` is the document's <head>, as a node in a layout.\n//\n// A document has a part nobody sees on the screen: its title, the sentence\n// that describes it, the card shown where a link to it is pasted. That part\n// is written the way the rest of the screen is — a layout node, its children\n// bound to the action's data — and travels the way the rest does, in the\n// render tree.\n//\n// Its children are the elements a head holds, named as HTML names them:\n// `nova:title`, `nova:meta`, `nova:link`, `nova:script`. A child's props are\n// that element's ATTRIBUTES, written as given. Nova keeps no list of them, so\n// any `name`, `property` or `rel` there is — or will be — can be said without\n// nova learning it.\n//\n// Nothing here is drawn on the screen. No adapter builds an element for a head\n// or for anything in it, and no registry has to hold the names. Whoever writes\n// the document reads the elements off the tree (`headOf`) and writes them into\n// its <head>.\n//\n// WHAT A HEAD DOES NOT HOLD is what runs or styles: a script that executes, a\n// stylesheet, a <base>, an instruction to the browser (`http-equiv`), a handler\n// attribute. A layout is data, and data that reaches every page must not be\n// able to run. Those stay in the app's own index.html, which holds anything.\n//\n// This file holds no schema on purpose: a terminal that only reads a head off\n// the wire needs the names and the shape, and nothing to validate with.\n// ═══════════════════════════════════════════════════════════\n\n// Namespaced as a package's own in-layout components are (`loom:field`), so\n// none can be a name an app's kit already uses for something else.\nexport const HEAD_NAME = 'nova:head';\nexport const HEAD_TITLE_NAME = 'nova:title';\nexport const HEAD_META_NAME = 'nova:meta';\nexport const HEAD_LINK_NAME = 'nova:link';\nexport const HEAD_SCRIPT_NAME = 'nova:script';\n\n// The head and what it holds: the names a layout may use with no registry\n// entry behind them.\nexport const HEAD_NAMES: readonly string[] = [HEAD_NAME, HEAD_TITLE_NAME, HEAD_META_NAME, HEAD_LINK_NAME, HEAD_SCRIPT_NAME];\n\n// One element of a head, as data: what to write, wherever a head is written.\nexport type HeadElement = {\n tag: 'title' | 'meta' | 'link' | 'script';\n // as the layout gave them, in the order it gave them\n attributes: Record<string, string>;\n // a title's words; a script's data, as JSON\n text?: string;\n};\n\n// What two elements both say, when they say the same thing — the later one\n// then takes the earlier one's place. A document has one title, one <meta> of\n// a given name or property, one canonical address. Anything else stands beside\n// its like: two alternates, two data blocks.\nexport const headKeyOf = (element: Pick<HeadElement, 'tag' | 'attributes'>): string | undefined => {\n const said = (name: string): string | undefined => {\n const found = Object.entries(element.attributes).find(([key]) => key.toLowerCase() === name)?.[1].trim().toLowerCase();\n return found === undefined || found === '' ? undefined : found;\n };\n if (element.tag === 'title') return 'title';\n if (element.tag === 'meta') {\n const [name, property] = [said('name'), said('property')];\n if (name !== undefined) return `meta name ${name}`;\n return property === undefined ? undefined : `meta property ${property}`;\n }\n if (element.tag === 'link') return (said('rel') ?? '').split(/\\s+/).includes('canonical') ? 'link canonical' : undefined;\n return undefined;\n};\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkWGZZKCJQ_cjs = require('./chunk-WGZZKCJQ.cjs');
|
|
4
|
+
var chunkECFWPZGL_cjs = require('./chunk-ECFWPZGL.cjs');
|
|
5
|
+
var chunkPNQY6OFB_cjs = require('./chunk-PNQY6OFB.cjs');
|
|
6
|
+
var zod = require('zod');
|
|
7
|
+
|
|
8
|
+
var StackPropsSchema = zod.z.object({
|
|
9
|
+
direction: zod.z.enum(["row", "column"]).optional().describe("Flex direction. Default: column."),
|
|
10
|
+
gap: zod.z.number().int().min(0).optional().describe("Gap between children in pixels. Default: 0."),
|
|
11
|
+
align: zod.z.enum(["start", "center", "end", "stretch"]).optional().describe("Cross-axis alignment. Default: stretch."),
|
|
12
|
+
justify: zod.z.enum(["start", "center", "end", "between", "around"]).optional().describe("Main-axis justification. Default: start."),
|
|
13
|
+
padding: zod.z.number().int().min(0).optional().describe("Inner padding in pixels. Default: 0."),
|
|
14
|
+
wrap: zod.z.boolean().optional().describe("Whether children wrap to a new line. Default: false.")
|
|
15
|
+
}).strict().describe("Flex container that arranges children in a row or column.");
|
|
16
|
+
var TextPropsSchema = zod.z.object({
|
|
17
|
+
as: zod.z.enum(["span", "p", "h1", "h2", "h3", "h4"]).optional().describe("HTML element to render. Default: span."),
|
|
18
|
+
size: zod.z.enum(["sm", "md", "lg", "xl", "2xl"]).optional().describe("Font size token. Default: md."),
|
|
19
|
+
weight: zod.z.enum(["normal", "medium", "bold"]).optional().describe("Font weight token. Default: normal."),
|
|
20
|
+
color: zod.z.string().optional().describe("CSS color string (open set). Default: inherit.")
|
|
21
|
+
}).strict().describe("Text element with semantic typography props.");
|
|
22
|
+
var InputPropsSchema = zod.z.object({
|
|
23
|
+
type: zod.z.enum(["text", "number", "email", "password"]).optional().describe("Input type. Default: text."),
|
|
24
|
+
placeholder: zod.z.string().optional().describe("Placeholder text shown when empty."),
|
|
25
|
+
disabled: zod.z.boolean().optional().describe("Whether the input is disabled. Default: false."),
|
|
26
|
+
value: zod.z.string().optional().describe("Current value. Typically supplied via model binding."),
|
|
27
|
+
debounce: zod.z.number().optional().describe("Milliseconds to coalesce keystrokes before dispatching ui:model. Default: 0 (every keystroke). Set it when the shell is remote to cut round-trips.")
|
|
28
|
+
}).strict().describe("Text input bound to data via the `model` field on the layout node.");
|
|
29
|
+
var ButtonPropsSchema = zod.z.object({
|
|
30
|
+
label: zod.z.string().optional().describe("Button label. If absent, children are used."),
|
|
31
|
+
variant: zod.z.enum(["primary", "secondary", "ghost"]).optional().describe("Visual variant. Default: primary."),
|
|
32
|
+
disabled: zod.z.boolean().optional().describe("Whether the button is disabled. Default: false.")
|
|
33
|
+
}).strict().describe("Clickable button. Click events fire as `ui:click` with the layout node's ref.");
|
|
34
|
+
var BoxPropsSchema = zod.z.object({
|
|
35
|
+
padding: zod.z.number().int().min(0).optional().describe("Inner padding in pixels. Default: 0."),
|
|
36
|
+
background: zod.z.string().optional().describe("CSS background color or value."),
|
|
37
|
+
border: zod.z.boolean().optional().describe("Whether to show a 1px border. Default: false."),
|
|
38
|
+
radius: zod.z.number().int().min(0).optional().describe("Border radius in pixels. Default: 0.")
|
|
39
|
+
}).strict().describe("Generic container with basic styling props. Use Stack for layout, Box for visual wrapping.");
|
|
40
|
+
var PanelPropsSchema = zod.z.object({
|
|
41
|
+
title: zod.z.string().optional().describe("Optional header title."),
|
|
42
|
+
backRef: zod.z.string().optional().describe("When set, the header grows a \u2190 (before the title) that fires ui:click with this ref."),
|
|
43
|
+
closeRef: zod.z.string().optional().describe("When set, the header grows a \u2715 that fires ui:click with this ref.")
|
|
44
|
+
}).strict().describe("A framed, elevated surface with an optional title.");
|
|
45
|
+
var JsonTreePropsSchema = zod.z.object({
|
|
46
|
+
value: zod.z.unknown().optional().describe("The value to render."),
|
|
47
|
+
label: zod.z.string().optional().describe("A name for the root node.")
|
|
48
|
+
}).strict().describe("A collapsible view of any JSON value.");
|
|
49
|
+
var CanvasSlotPropsSchema = zod.z.object({
|
|
50
|
+
canvasId: zod.z.string().optional().describe('Id of the canvas to render. Usually bound from a loop, e.g. "$.c.id".')
|
|
51
|
+
}).strict().describe("Renders a canvas by id, recursing into its actionLayout. Resolves to nothing when canvasId is missing.");
|
|
52
|
+
var ActionSlotPropsSchema = zod.z.object({
|
|
53
|
+
instanceId: zod.z.string().optional().describe('Id of the action instance to render. Usually bound from canvas scope, e.g. "$.active.id" or "$.i.id".')
|
|
54
|
+
}).strict().describe("Renders an action instance by id. Resolves to nothing when instanceId is missing.");
|
|
55
|
+
|
|
56
|
+
// src/document/shell-head.ts
|
|
57
|
+
var createShellHead = (shell) => {
|
|
58
|
+
const view = chunkECFWPZGL_cjs.shellView(shell);
|
|
59
|
+
let present = 0;
|
|
60
|
+
let keep;
|
|
61
|
+
let queued = false;
|
|
62
|
+
const read = () => {
|
|
63
|
+
if (queued || typeof document === "undefined") return;
|
|
64
|
+
queued = true;
|
|
65
|
+
queueMicrotask(() => {
|
|
66
|
+
queued = false;
|
|
67
|
+
keep ??= chunkWGZZKCJQ_cjs.createHeadKeeper(document);
|
|
68
|
+
keep(present > 0 ? chunkPNQY6OFB_cjs.headOf(view.api)?.elements : void 0);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
enter: () => {
|
|
73
|
+
present += 1;
|
|
74
|
+
read();
|
|
75
|
+
},
|
|
76
|
+
leave: () => {
|
|
77
|
+
present -= 1;
|
|
78
|
+
read();
|
|
79
|
+
},
|
|
80
|
+
watch: () => view.subscribe(() => {
|
|
81
|
+
if (present > 0) read();
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.ActionSlotPropsSchema = ActionSlotPropsSchema;
|
|
87
|
+
exports.BoxPropsSchema = BoxPropsSchema;
|
|
88
|
+
exports.ButtonPropsSchema = ButtonPropsSchema;
|
|
89
|
+
exports.CanvasSlotPropsSchema = CanvasSlotPropsSchema;
|
|
90
|
+
exports.InputPropsSchema = InputPropsSchema;
|
|
91
|
+
exports.JsonTreePropsSchema = JsonTreePropsSchema;
|
|
92
|
+
exports.PanelPropsSchema = PanelPropsSchema;
|
|
93
|
+
exports.StackPropsSchema = StackPropsSchema;
|
|
94
|
+
exports.TextPropsSchema = TextPropsSchema;
|
|
95
|
+
exports.createShellHead = createShellHead;
|
|
96
|
+
//# sourceMappingURL=chunk-HYFNOF7Y.cjs.map
|
|
97
|
+
//# sourceMappingURL=chunk-HYFNOF7Y.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/primitive-props.ts","../src/document/shell-head.ts"],"names":["z","shellView","createHeadKeeper","headOf"],"mappings":";;;;;;;AAWO,IAAM,gBAAA,GAAmBA,MAC7B,MAAA,CAAO;AAAA,EACN,SAAA,EAAWA,KAAA,CACR,IAAA,CAAK,CAAC,KAAA,EAA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SAAS,uEAAuE;AACrF,CAAC,CAAA,CACA,MAAA,EAAO,CACP,QAAA,CAAS,wGAAwG;AAS7G,IAAM,qBAAA,GAAwBA,MAClC,MAAA,CAAO;AAAA,EACN,YAAYA,KAAA,CACT,MAAA,GACA,QAAA,EAAS,CACT,SAAS,uGAAuG;AACrH,CAAC,CAAA,CACA,MAAA,EAAO,CACP,QAAA,CAAS,mFAAmF;;;ACjLxF,IAAM,eAAA,GAAkB,CAAC,KAAA,KAA4B;AAC1D,EAAA,MAAM,IAAA,GAAOC,4BAAU,KAAK,CAAA;AAC5B,EAAA,IAAI,OAAA,GAAU,CAAA;AACd,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,EAAA,MAAM,OAAO,MAAY;AAEvB,IAAA,IAAI,MAAA,IAAU,OAAO,QAAA,KAAa,WAAA,EAAa;AAC/C,IAAA,MAAA,GAAS,IAAA;AACT,IAAA,cAAA,CAAe,MAAM;AACnB,MAAA,MAAA,GAAS,KAAA;AACT,MAAA,IAAA,KAASC,mCAAiB,QAAQ,CAAA;AAClC,MAAA,IAAA,CAAK,UAAU,CAAA,GAAIC,wBAAA,CAAO,KAAK,GAAG,CAAA,EAAG,WAAW,MAAS,CAAA;AAAA,IAC3D,CAAC,CAAA;AAAA,EACH,CAAA;AACA,EAAA,OAAO;AAAA,IACL,OAAO,MAAM;AACX,MAAA,OAAA,IAAW,CAAA;AACX,MAAA,IAAA,EAAK;AAAA,IACP,CAAA;AAAA,IACA,OAAO,MAAM;AACX,MAAA,OAAA,IAAW,CAAA;AACX,MAAA,IAAA,EAAK;AAAA,IACP,CAAA;AAAA,IACA,KAAA,EAAO,MACL,IAAA,CAAK,SAAA,CAAU,MAAM;AACnB,MAAA,IAAI,OAAA,GAAU,GAAG,IAAA,EAAK;AAAA,IACxB,CAAC;AAAA,GACL;AACF","file":"chunk-HYFNOF7Y.cjs","sourcesContent":["import { z } from 'zod';\n\n// ═══════════════════════════════════════════════════════════\n// The headless primitive vocabulary's AUTHORING contracts — one Zod props\n// schema per primitive, framework-free, shared by every adapter kit that ships\n// the vocabulary (react, vue). A schema is what a layout node may set; the\n// kits differ in how they paint, never in what they accept, so the schema\n// lives once, here, and each kit's component carries it as its static `meta`.\n// ═══════════════════════════════════════════════════════════\n\n// ─── Stack ───\nexport const StackPropsSchema = z\n .object({\n direction: z\n .enum(['row', 'column'])\n .optional()\n .describe('Flex direction. Default: column.'),\n gap: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Gap between children in pixels. Default: 0.'),\n align: z\n .enum(['start', 'center', 'end', 'stretch'])\n .optional()\n .describe('Cross-axis alignment. Default: stretch.'),\n justify: z\n .enum(['start', 'center', 'end', 'between', 'around'])\n .optional()\n .describe('Main-axis justification. Default: start.'),\n padding: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Inner padding in pixels. Default: 0.'),\n wrap: z\n .boolean()\n .optional()\n .describe('Whether children wrap to a new line. Default: false.'),\n })\n .strict()\n .describe('Flex container that arranges children in a row or column.');\n\nexport type StackProps = z.infer<typeof StackPropsSchema>;\n\n// ─── Text ───\nexport const TextPropsSchema = z\n .object({\n as: z\n .enum(['span', 'p', 'h1', 'h2', 'h3', 'h4'])\n .optional()\n .describe('HTML element to render. Default: span.'),\n size: z\n .enum(['sm', 'md', 'lg', 'xl', '2xl'])\n .optional()\n .describe('Font size token. Default: md.'),\n weight: z\n .enum(['normal', 'medium', 'bold'])\n .optional()\n .describe('Font weight token. Default: normal.'),\n color: z\n .string()\n .optional()\n .describe('CSS color string (open set). Default: inherit.'),\n })\n .strict()\n .describe('Text element with semantic typography props.');\n\nexport type TextProps = z.infer<typeof TextPropsSchema>;\n\n// ─── Input ───\nexport const InputPropsSchema = z\n .object({\n type: z\n .enum(['text', 'number', 'email', 'password'])\n .optional()\n .describe('Input type. Default: text.'),\n placeholder: z\n .string()\n .optional()\n .describe('Placeholder text shown when empty.'),\n disabled: z\n .boolean()\n .optional()\n .describe('Whether the input is disabled. Default: false.'),\n value: z\n .string()\n .optional()\n .describe('Current value. Typically supplied via model binding.'),\n debounce: z\n .number()\n .optional()\n .describe('Milliseconds to coalesce keystrokes before dispatching ui:model. Default: 0 (every keystroke). Set it when the shell is remote to cut round-trips.'),\n })\n .strict()\n .describe('Text input bound to data via the `model` field on the layout node.');\n\nexport type InputProps = z.infer<typeof InputPropsSchema>;\n\n// ─── Button ───\nexport const ButtonPropsSchema = z\n .object({\n label: z\n .string()\n .optional()\n .describe('Button label. If absent, children are used.'),\n variant: z\n .enum(['primary', 'secondary', 'ghost'])\n .optional()\n .describe('Visual variant. Default: primary.'),\n disabled: z\n .boolean()\n .optional()\n .describe('Whether the button is disabled. Default: false.'),\n })\n .strict()\n .describe(\"Clickable button. Click events fire as `ui:click` with the layout node's ref.\");\n\nexport type ButtonProps = z.infer<typeof ButtonPropsSchema>;\n\n// ─── Box ───\nexport const BoxPropsSchema = z\n .object({\n padding: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Inner padding in pixels. Default: 0.'),\n background: z\n .string()\n .optional()\n .describe('CSS background color or value.'),\n border: z\n .boolean()\n .optional()\n .describe('Whether to show a 1px border. Default: false.'),\n radius: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Border radius in pixels. Default: 0.'),\n })\n .strict()\n .describe('Generic container with basic styling props. Use Stack for layout, Box for visual wrapping.');\n\nexport type BoxProps = z.infer<typeof BoxPropsSchema>;\n\n// ─── Panel ───\nexport const PanelPropsSchema = z\n .object({\n title: z.string().optional().describe('Optional header title.'),\n backRef: z.string().optional().describe('When set, the header grows a ← (before the title) that fires ui:click with this ref.'),\n closeRef: z.string().optional().describe('When set, the header grows a ✕ that fires ui:click with this ref.'),\n })\n .strict()\n .describe('A framed, elevated surface with an optional title.');\n\nexport type PanelProps = z.infer<typeof PanelPropsSchema>;\n\n// ─── JsonTree ───\nexport const JsonTreePropsSchema = z\n .object({\n value: z.unknown().optional().describe('The value to render.'),\n label: z.string().optional().describe('A name for the root node.'),\n })\n .strict()\n .describe('A collapsible view of any JSON value.');\n\nexport type JsonTreeProps = z.infer<typeof JsonTreePropsSchema>;\n\n// ─── CanvasSlot ───\nexport const CanvasSlotPropsSchema = z\n .object({\n canvasId: z\n .string()\n .optional()\n .describe('Id of the canvas to render. Usually bound from a loop, e.g. \"$.c.id\".'),\n })\n .strict()\n .describe('Renders a canvas by id, recursing into its actionLayout. Resolves to nothing when canvasId is missing.');\n\nexport type CanvasSlotProps = z.infer<typeof CanvasSlotPropsSchema>;\n\n// ─── ActionSlot ───\n// The AUTHORING contract: what a layout node may set on an ActionSlot —\n// instanceId only, strict. The identity props flattenRenderTree stamps on a\n// served marker (canvasId / definitionId) are runtime OUTPUT, never authored;\n// widening this schema would advertise them to the layout agent's palette.\nexport const ActionSlotPropsSchema = z\n .object({\n instanceId: z\n .string()\n .optional()\n .describe('Id of the action instance to render. Usually bound from canvas scope, e.g. \"$.active.id\" or \"$.i.id\".'),\n })\n .strict()\n .describe('Renders an action instance by id. Resolves to nothing when instanceId is missing.');\n\nexport type ActionSlotProps = z.infer<typeof ActionSlotPropsSchema>;\n\n","import { headOf, shellView } from '../shell';\nimport type { Shell } from '../shell';\nimport { createHeadKeeper } from './head-keeper';\nimport type { HeadKeeper } from './head-keeper';\n\n// ═══════════════════════════════════════════════════════════\n// The page's head, for an adapter that draws a shell living in its own page\n// through a framework (react, vue).\n//\n// Such an adapter reads the shell's trees through its own subscriptions, so\n// there is no one render to read the head off: reading it means rendering the\n// shell's trees once more. That is worth doing only while a head is on the\n// screen. So a head node says when it arrives and when it goes (`enter`,\n// `leave`), and the shell is only read between the two.\n// ═══════════════════════════════════════════════════════════\n\nexport type ShellHead = {\n enter: () => void;\n leave: () => void;\n // follow the shell's changes; returns the stop\n watch: () => () => void;\n};\n\nexport const createShellHead = (shell: Shell): ShellHead => {\n const view = shellView(shell);\n let present = 0;\n let keep: HeadKeeper | undefined;\n let queued = false;\n // once a turn, however many heads came and went in it\n const read = (): void => {\n // nothing to keep where a screen is drawn to a string\n if (queued || typeof document === 'undefined') return;\n queued = true;\n queueMicrotask(() => {\n queued = false;\n keep ??= createHeadKeeper(document);\n keep(present > 0 ? headOf(view.api)?.elements : undefined);\n });\n };\n return {\n enter: () => {\n present += 1;\n read();\n },\n leave: () => {\n present -= 1;\n read();\n },\n watch: () =>\n view.subscribe(() => {\n if (present > 0) read();\n }),\n };\n};\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKW34ZKF5_cjs = require('./chunk-KW34ZKF5.cjs');
|
|
4
|
+
|
|
5
|
+
// src/i18n/phrases.ts
|
|
6
|
+
var DEFAULT_PHRASE_KEYS = {
|
|
7
|
+
// A starting set, not a standard — an app with its own vocabulary passes its
|
|
8
|
+
// own. Deliberately absent: `name`, `value`, `id`, `icon`, `tone`, `variant`,
|
|
9
|
+
// `key`. Those carry data or design tokens, and translating them is how a
|
|
10
|
+
// person called "Active" gets renamed.
|
|
11
|
+
props: [
|
|
12
|
+
"label",
|
|
13
|
+
"title",
|
|
14
|
+
"subtitle",
|
|
15
|
+
"heading",
|
|
16
|
+
"eyebrow",
|
|
17
|
+
"lead",
|
|
18
|
+
"blurb",
|
|
19
|
+
"placeholder",
|
|
20
|
+
"hint",
|
|
21
|
+
"help",
|
|
22
|
+
"message",
|
|
23
|
+
"empty",
|
|
24
|
+
"emptyHint",
|
|
25
|
+
"emptyLabel",
|
|
26
|
+
"noMatch",
|
|
27
|
+
"caption",
|
|
28
|
+
"description",
|
|
29
|
+
"confirmLabel",
|
|
30
|
+
"cancelLabel",
|
|
31
|
+
"alt",
|
|
32
|
+
"tooltip"
|
|
33
|
+
],
|
|
34
|
+
text: true
|
|
35
|
+
};
|
|
36
|
+
var matcherFor = (keys) => {
|
|
37
|
+
const props = new Set(keys?.props ?? DEFAULT_PHRASE_KEYS.props);
|
|
38
|
+
const suffixes = keys?.suffixes ?? [];
|
|
39
|
+
return {
|
|
40
|
+
isProse: (key) => props.has(key) || suffixes.some((suffix) => key.endsWith(suffix)),
|
|
41
|
+
text: keys?.text ?? DEFAULT_PHRASE_KEYS.text
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var BARE_PATH = /^\$(\.|[A-Za-z_]|$)/;
|
|
45
|
+
var EXTRA_SCOPE = /^@[A-Za-z_]/;
|
|
46
|
+
var isBinding = (value) => BARE_PATH.test(value) || EXTRA_SCOPE.test(value) || value.includes("{{");
|
|
47
|
+
var isPhrase = (value) => {
|
|
48
|
+
const trimmed = value.trim();
|
|
49
|
+
if (trimmed === "" || isBinding(trimmed)) return false;
|
|
50
|
+
return /\p{L}/u.test(trimmed);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/i18n/swap.ts
|
|
54
|
+
var EMPTY = {};
|
|
55
|
+
var passFor = (options) => {
|
|
56
|
+
if (options === void 0) return void 0;
|
|
57
|
+
if (options.phrases === void 0 && options.keys === void 0) return void 0;
|
|
58
|
+
const matcher = matcherFor(options.keys);
|
|
59
|
+
return {
|
|
60
|
+
phrases: options.phrases ?? EMPTY,
|
|
61
|
+
isProse: matcher.isProse,
|
|
62
|
+
text: matcher.text,
|
|
63
|
+
onMiss: options.onMiss
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
var swap = (value, where, pass) => {
|
|
67
|
+
if (!isPhrase(value)) return value;
|
|
68
|
+
const hit = pass.phrases[value];
|
|
69
|
+
if (hit !== void 0) return hit;
|
|
70
|
+
const trimmed = value.trim();
|
|
71
|
+
if (trimmed !== value) {
|
|
72
|
+
const onTrimmed = pass.phrases[trimmed];
|
|
73
|
+
if (onTrimmed !== void 0) return value.replace(trimmed, onTrimmed);
|
|
74
|
+
}
|
|
75
|
+
pass.onMiss?.(trimmed, where);
|
|
76
|
+
return value;
|
|
77
|
+
};
|
|
78
|
+
var isPattern = (value) => typeof value["phrase"] === "string" && chunkKW34ZKF5_cjs.isObject(value["slots"]);
|
|
79
|
+
var fillPattern = (pattern, where, pass) => swap(pattern.phrase, where, pass).replace(/\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (hole, name) => {
|
|
80
|
+
const slot = pattern.slots[name];
|
|
81
|
+
if (slot === void 0 || slot === null) return hole;
|
|
82
|
+
return typeof slot === "string" && isPhrase(slot) ? swap(slot, `${where}.${name}`, pass) : String(slot);
|
|
83
|
+
});
|
|
84
|
+
var SOURCE = { phrases: EMPTY, isProse: () => true, text: true, onMiss: void 0 };
|
|
85
|
+
var fillPhrase = (value) => {
|
|
86
|
+
if (!chunkKW34ZKF5_cjs.isObject(value) || !isPattern(value)) return value;
|
|
87
|
+
return fillPattern(value, "", SOURCE);
|
|
88
|
+
};
|
|
89
|
+
var walkValue = (value, prose, where, pass) => {
|
|
90
|
+
if (typeof value === "string") return prose ? swap(value, where, pass) : value;
|
|
91
|
+
if (chunkKW34ZKF5_cjs.isArray(value)) {
|
|
92
|
+
let changed = false;
|
|
93
|
+
const out = value.map((entry, index) => {
|
|
94
|
+
const next = walkValue(entry, prose, `${where}[${String(index)}]`, pass);
|
|
95
|
+
if (next !== entry) changed = true;
|
|
96
|
+
return next;
|
|
97
|
+
});
|
|
98
|
+
return changed ? out : value;
|
|
99
|
+
}
|
|
100
|
+
if (chunkKW34ZKF5_cjs.isObject(value)) {
|
|
101
|
+
if (prose && isPattern(value)) return fillPattern(value, where, pass);
|
|
102
|
+
let changed = false;
|
|
103
|
+
const out = {};
|
|
104
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
105
|
+
const next = walkValue(entry, pass.isProse(key), `${where}.${key}`, pass);
|
|
106
|
+
if (next !== entry) changed = true;
|
|
107
|
+
out[key] = next;
|
|
108
|
+
}
|
|
109
|
+
return changed ? out : value;
|
|
110
|
+
}
|
|
111
|
+
return value;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports.DEFAULT_PHRASE_KEYS = DEFAULT_PHRASE_KEYS;
|
|
115
|
+
exports.fillPhrase = fillPhrase;
|
|
116
|
+
exports.isBinding = isBinding;
|
|
117
|
+
exports.isPhrase = isPhrase;
|
|
118
|
+
exports.matcherFor = matcherFor;
|
|
119
|
+
exports.passFor = passFor;
|
|
120
|
+
exports.swap = swap;
|
|
121
|
+
exports.walkValue = walkValue;
|
|
122
|
+
//# sourceMappingURL=chunk-KOYRJXTI.cjs.map
|
|
123
|
+
//# sourceMappingURL=chunk-KOYRJXTI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/phrases.ts","../src/i18n/swap.ts"],"names":["isObject","isArray"],"mappings":";;;;;AA0DO,IAAM,mBAAA,GAAoE;AAAA;AAAA;AAAA;AAAA;AAAA,EAK/E,KAAA,EAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,aAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,IAAA,EAAM;AACR;AAOO,IAAM,UAAA,GAAa,CAAC,IAAA,KAAmD;AAC5E,EAAA,MAAM,QAAQ,IAAI,GAAA,CAAI,IAAA,EAAM,KAAA,IAAS,oBAAoB,KAAK,CAAA;AAC9D,EAAA,MAAM,QAAA,GAAW,IAAA,EAAM,QAAA,IAAY,EAAC;AACpC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAC,GAAA,KAAyB,KAAA,CAAM,IAAI,GAAG,CAAA,IAAK,QAAA,CAAS,IAAA,CAAK,CAAC,MAAA,KAAW,GAAA,CAAI,QAAA,CAAS,MAAM,CAAC,CAAA;AAAA,IACnG,IAAA,EAAM,IAAA,EAAM,IAA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,CAAA;AACxE,MAAA,IAAI,IAAA,KAAS,OAAO,OAAA,GAAU,IAAA;AAC9B,MAAA,GAAA,CAAI,GAAG,CAAA,GAAI,IAAA;AAAA,IACb;AACA,IAAA,OAAO,UAAU,GAAA,GAAM,KAAA;AAAA,EACzB;AACA,EAAA,OAAO,KAAA;AACT","file":"chunk-KOYRJXTI.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════\n// NOVA IS LANGUAGE-BLIND, the same way it is surface-blind.\n//\n// The core renders a layout into a `RenderNode` tree and knows nothing about\n// what language the words in it are. This area adds one late pass over that\n// tree — swap the words, leave the structure — plus the harvester that tells\n// you which words there are to swap.\n//\n// WHY A LATE PASS AND NOT A `$t` IN THE LAYOUT. Both work; they cost\n// differently. A key-per-string layout (`label: '@t.people.add'`) is precise\n// and makes every layout in the application unreadable — the file stops saying\n// what it draws. A late pass leaves the layouts as the readable English they\n// already are and moves the whole problem to one walk, at the price of keying\n// the dictionary on the source string rather than on an invented id.\n//\n// The price is real and worth naming: English-as-key cannot distinguish two\n// senses of one word. \"Book\" the verb and \"Book\" the noun are one key here and\n// two words in German. When that bites, the answer is not to abandon the pass\n// — it is to disambiguate that one string at its author site, and a `$t`\n// directive is the natural place for it. The two compose; this is the layer\n// that makes the other one optional rather than mandatory.\n//\n// WHAT THIS PASS CANNOT DO, and where the rest of the work goes:\n// - Open-ended formatted values — dates, money, counts. \"Fri 14 Mar\" has\n// unbounded cardinality and no dictionary will ever hold it. Those are\n// formatted at their source with a locale (prism's `$localeDate`,\n// `$localeMoney`, `$localeNumber`).\n// - Anything not in the tree: a server error message, a notification body.\n// ═══════════════════════════════════════════════════════════\n\n/** Source phrase → the words a reader of this locale should see. */\nexport type Phrasebook = Readonly<Record<string, string>>;\n\n// WHICH STRINGS IN A TREE ARE PROSE, declared by the host rather than guessed.\n//\n// A render tree is mostly not prose. It carries person names, ids, css values,\n// tone words, icon names and row data, and a pass that translated every string\n// it found would rename a member called \"Pass\" the first time somebody bought\n// one. So the host names the carriers, and everything else is left alone.\nexport type PhraseKeys = {\n // Prop names whose string values are prose: `label`, `title`, `placeholder`.\n // Matched at ANY depth inside a prop value, which is what makes a spec prop\n // work — a `Table`'s `columns: [{ label }]` and a `Select`'s\n // `options: [{ label }]` are the same rule as a bare `label`.\n props?: readonly string[];\n // Suffixes marking a DATA field as a display string. An app that spells its\n // read-time display fields `status_display`, `term_display` declares\n // `['_display']` once here, and every closed-set word a query manufactures\n // becomes translatable without the app naming them one by one.\n //\n // Only for CLOSED sets. A `_display` field holding a formatted date or an\n // amount will simply miss, every time, and should be formatted with a locale\n // at its source instead.\n suffixes?: readonly string[];\n // Translate bare text nodes (a layout's literal children). Default: true.\n text?: boolean;\n};\n\nexport const DEFAULT_PHRASE_KEYS: Required<Pick<PhraseKeys, 'props' | 'text'>> = {\n // A starting set, not a standard — an app with its own vocabulary passes its\n // own. Deliberately absent: `name`, `value`, `id`, `icon`, `tone`, `variant`,\n // `key`. Those carry data or design tokens, and translating them is how a\n // person called \"Active\" gets renamed.\n props: [\n 'label',\n 'title',\n 'subtitle',\n 'heading',\n 'eyebrow',\n 'lead',\n 'blurb',\n 'placeholder',\n 'hint',\n 'help',\n 'message',\n 'empty',\n 'emptyHint',\n 'emptyLabel',\n 'noMatch',\n 'caption',\n 'description',\n 'confirmLabel',\n 'cancelLabel',\n 'alt',\n 'tooltip',\n ],\n text: true,\n};\n\nexport type PhraseKeyMatcher = {\n isProse: (key: string) => boolean;\n text: boolean;\n};\n\nexport const matcherFor = (keys: PhraseKeys | undefined): PhraseKeyMatcher => {\n const props = new Set(keys?.props ?? DEFAULT_PHRASE_KEYS.props);\n const suffixes = keys?.suffixes ?? [];\n return {\n isProse: (key: string): boolean => props.has(key) || suffixes.some((suffix) => key.endsWith(suffix)),\n text: keys?.text ?? DEFAULT_PHRASE_KEYS.text,\n };\n};\n\n// A string that is a BINDING resolves to data at render time, so it is never a\n// phrase: harvesting `'$.member.person_name'` would put a path in the\n// dictionary and translating it would do nothing.\n//\n// Three forms, matching what the resolver recognises\n// (`shared/bindings/resolve.ts`): a bare `$` path, a `{{ }}` template, and an\n// `@`-prefixed EXTRA scope. The last one is easy to forget and shows up\n// immediately — a trigger's `{ set: 'x', value: '@event.payload.theme_id' }`\n// is a step's plumbing, and a harvester without this rule fills a language\n// file with several dozen of them.\nconst BARE_PATH = /^\\$(\\.|[A-Za-z_]|$)/;\nconst EXTRA_SCOPE = /^@[A-Za-z_]/;\n\nexport const isBinding = (value: string): boolean =>\n BARE_PATH.test(value) || EXTRA_SCOPE.test(value) || value.includes('{{');\n\n// Worth translating at all: a non-empty string that is not a binding and is not\n// obviously machine vocabulary. The last clause is a cheap guard against\n// harvesting css values and tokens that happen to sit at an allowlisted key.\nexport const isPhrase = (value: string): boolean => {\n const trimmed = value.trim();\n if (trimmed === '' || isBinding(trimmed)) return false;\n // A phrase has a letter in it. '—', '18:30', '#fff', '100%' do not.\n return /\\p{L}/u.test(trimmed);\n};\n","import { isArray, isObject } from '../shared/common';\nimport { matcherFor } from './phrases';\nimport { isPhrase } from './phrases';\nimport type { PhraseKeys, Phrasebook } from './phrases';\n\n// ═══════════════════════════════════════════════════════════\n// The swap itself — over VALUES, knowing nothing about trees.\n//\n// Deliberately free of any layout import, because the renderer needs it and\n// the renderer is what layout IS. `translate.ts` (the tree walk) and\n// `layout/renderer.ts` (the mint) are two callers of this one engine, and the\n// whole point of the file is that they can never disagree about what a swap\n// means.\n// ═══════════════════════════════════════════════════════════\n\nexport type Pass = {\n phrases: Phrasebook;\n isProse: (key: string) => boolean;\n text: boolean;\n onMiss: ((phrase: string, where: string) => void) | undefined;\n};\n\nexport type PassOptions = {\n phrases?: Phrasebook;\n keys?: PhraseKeys;\n onMiss?: (phrase: string, where: string) => void;\n};\n\nconst EMPTY: Phrasebook = {};\n\n// ACTIVE OR ABSENT, decided once. A host that named neither a book nor a key\n// set is not doing i18n, and pays nothing: `undefined` here means the renderer\n// skips every branch below, and a `{ phrase, slots }` object passes through as\n// the object it is.\n//\n// A key set WITHOUT a book is the source language, and is NOT nothing: patterns\n// still have to be filled, because a counted phrase reaches the glass as a\n// structure and nobody downstream knows how to read it. That is the one job\n// this pass keeps doing when there is nothing to translate.\nexport const passFor = (options: PassOptions | undefined): Pass | undefined => {\n if (options === undefined) return undefined;\n if (options.phrases === undefined && options.keys === undefined) return undefined;\n const matcher = matcherFor(options.keys);\n return {\n phrases: options.phrases ?? EMPTY,\n isProse: matcher.isProse,\n text: matcher.text,\n onMiss: options.onMiss,\n };\n};\n\nexport const swap = (value: string, where: string, pass: Pass): string => {\n if (!isPhrase(value)) return value;\n const hit = pass.phrases[value];\n if (hit !== undefined) return hit;\n // Trailing/leading whitespace is a layout accident, not part of the phrase.\n // Trying the trimmed form keeps `'Save '` from being a second dictionary\n // entry nobody remembers to fill in.\n const trimmed = value.trim();\n if (trimmed !== value) {\n const onTrimmed = pass.phrases[trimmed];\n if (onTrimmed !== undefined) return value.replace(trimmed, onTrimmed);\n }\n pass.onMiss?.(trimmed, where);\n return value;\n};\n\n// A PATTERN: a counted phrase, translated WHOLE and filled here — the one\n// point that has the book. `{ phrase: '{n} of {total}', slots: { n: 1,\n// total: 12 } }` becomes `'1 von 12'`: the pattern is a dictionary row like\n// any other, so cardinality stays out of the book. A string slot is offered\n// to the book too — a composed sentence's fragments (\"somebody enquires\")\n// are vocabulary in their own right — and everything else interpolates as\n// itself. An empty book fills the holes and translates nothing, which is\n// exactly what a source-language session needs.\nconst isPattern = (value: Record<string, unknown>): value is { phrase: string; slots: Record<string, unknown> } =>\n typeof value['phrase'] === 'string' && isObject(value['slots']);\n\nconst fillPattern = (pattern: { phrase: string; slots: Record<string, unknown> }, where: string, pass: Pass): string =>\n swap(pattern.phrase, where, pass).replace(/\\{([A-Za-z_][A-Za-z0-9_]*)\\}/g, (hole, name: string) => {\n const slot = pattern.slots[name];\n if (slot === undefined || slot === null) return hole;\n return typeof slot === 'string' && isPhrase(slot) ? swap(slot, `${where}.${name}`, pass) : String(slot);\n });\n\n// A book that translates nothing — for filling a pattern outside a render,\n// which is the only thing left to do with one when there are no words to swap.\nconst SOURCE: Pass = { phrases: EMPTY, isProse: () => true, text: true, onMiss: undefined };\n\n// FILL A COUNTED PHRASE THAT NEVER WENT THROUGH A RENDER.\n//\n// The renderer fills patterns on the way to a screen, so nothing downstream of\n// it needs this. What does need it is everything UPSTREAM: a check that reads\n// an entry straight from the engine, a fixture, an exporter — anywhere a\n// `{ phrase, slots }` is held as data rather than shown as words. Nova defines\n// the shape, so nova reads it; a host writing its own copy of this loop is how\n// two spellings of one rule start drifting.\n//\n// Anything that is not a pattern comes back untouched, so it is safe to call\n// on a whole column of mixed values.\nexport const fillPhrase = (value: unknown): unknown => {\n if (!isObject(value) || !isPattern(value)) return value;\n return fillPattern(value, '', SOURCE);\n};\n\n// Walk a prop VALUE. Depth matters: a spec prop is where the repeated structure\n// of a screen lives (`columns: [{ label }]`, `options: [{ label }]`), so the\n// rule cannot be \"top-level props only\" without missing most of a table.\n//\n// Returns the value it was given when nothing under it changed. Identity is\n// load-bearing rather than tidy: a source-language render must produce the\n// props object it produced before this existed, or every untranslated session\n// pays a rebuild for a walk that did nothing.\nexport const walkValue = (value: unknown, prose: boolean, where: string, pass: Pass): unknown => {\n if (typeof value === 'string') return prose ? swap(value, where, pass) : value;\n if (isArray(value)) {\n let changed = false;\n const out = value.map((entry, index) => {\n // An array inherits its key's proseness — `options: ['Yes', 'No']` is as\n // much prose as `options: [{ label: 'Yes' }]`.\n const next = walkValue(entry, prose, `${where}[${String(index)}]`, pass);\n if (next !== entry) changed = true;\n return next;\n });\n return changed ? out : value;\n }\n if (isObject(value)) {\n if (prose && isPattern(value)) return fillPattern(value, where, pass);\n let changed = false;\n const out: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const next = walkValue(entry, pass.isProse(key), `${where}.${key}`, pass);\n if (next !== entry) changed = true;\n out[key] = next;\n }\n return changed ? out : value;\n }\n return value;\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/shared/common.ts
|
|
4
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5
|
+
var isArray = (value) => Array.isArray(value);
|
|
6
|
+
var hasKey = (obj, key) => isObject(obj) && key in obj;
|
|
7
|
+
|
|
8
|
+
exports.hasKey = hasKey;
|
|
9
|
+
exports.isArray = isArray;
|
|
10
|
+
exports.isObject = isObject;
|
|
11
|
+
//# sourceMappingURL=chunk-KW34ZKF5.cjs.map
|
|
12
|
+
//# sourceMappingURL=chunk-KW34ZKF5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/common.ts"],"names":[],"mappings":";;;AAOO,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,IAAQ,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK;AAQ9D,IAAM,OAAA,GAAU,CAAC,KAAA,KAAuC,KAAA,CAAM,QAAQ,KAAK;AAK3E,IAAM,SAAS,CACpB,GAAA,EACA,QAC8B,QAAA,CAAS,GAAG,KAAK,GAAA,IAAO","file":"chunk-KW34ZKF5.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════\n// Shared primitives — common types + generic guards used to\n// narrow `unknown` across the package.\n// ═══════════════════════════════════════════════════════════\n\nexport type Unsubscribe = () => void;\n\nexport const isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\n\nexport const isNumber = (value: unknown): value is number => typeof value === 'number';\n\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\n\nexport const isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n\nexport const isNonNull = <T>(value: T | null | undefined): value is T =>\n value !== null && value !== undefined;\n\nexport const hasKey = <K extends string>(\n obj: unknown,\n key: K,\n): obj is Record<K, unknown> => isObject(obj) && key in obj;\n"]}
|