@ixo/editor 6.21.0 → 6.23.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/dist/action-manifest.json +613 -11
- package/dist/{chunk-EO2K4IDP.js → chunk-LBFFAKSN.js} +135 -22
- package/dist/chunk-LBFFAKSN.js.map +1 -0
- package/dist/{chunk-I4NSQ7X4.js → chunk-UIZV4YAW.js} +4264 -4043
- package/dist/chunk-UIZV4YAW.js.map +1 -0
- package/dist/{chunk-2WSXLAX5.js → chunk-VFYF2B5E.js} +5581 -2637
- package/dist/chunk-VFYF2B5E.js.map +1 -0
- package/dist/core/index.d.ts +479 -46
- package/dist/core/index.js +241 -3
- package/dist/core/index.js.map +1 -1
- package/dist/{graphql-client-j-P2Llxg.d.ts → graphql-client-DQD1v9Yw.d.ts} +10 -3
- package/dist/{index-BC4ycOwH.d.ts → index-x1R0c9P_.d.ts} +2616 -127
- package/dist/index.d.ts +3 -3
- package/dist/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/dist/mantine/index.d.ts +116 -10
- package/dist/mantine/index.js +158 -37
- package/dist/mantine/index.js.map +1 -1
- package/dist/store-B60v3oba.d.ts +1026 -0
- package/package.json +2 -2
- package/dist/chunk-2WSXLAX5.js.map +0 -1
- package/dist/chunk-EO2K4IDP.js.map +0 -1
- package/dist/chunk-I4NSQ7X4.js.map +0 -1
- package/dist/store-Ba-HGtSG.d.ts +0 -2144
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/lib/flowCompiler/authoring.ts"],"sourcesContent":["import * as Y from 'yjs';\nimport type { Doc as YDoc } from 'yjs';\nimport type { ActorConstraint, CompiledBlock, CompiledEdge, CompiledFlow, CompiledFlowNode, FlowCapability } from '../../types/baseUcan';\nimport type { FlowNodeRuntimeState } from '../../types/authorization';\nimport { getAction } from '../actionRegistry/registry';\nimport { readCompiledFlowFromYDoc } from './readFlow';\nimport { compileBlockProps, COMPILED_BLOCK_TYPE } from './blockMapping';\nimport { createYMapFromNode } from './hydrate';\nimport {\n readBlocksFromFragment,\n replaceBlockInFragment,\n removeBlockFromFragment,\n removeAllFlowBlocks,\n writeCompiledBlocksToFragment,\n swapBlocksInFragment,\n} from './documentFragment';\n\n/**\n * A single flow node as read from a live Y.Doc, assembled from all three sources:\n * structure (`qi.flow.*`), per-block `props` (the `document` fragment), and per-block\n * `runtime` (the `runtime` map). `props` and `runtime` are what the graph map cannot provide.\n */\nexport interface FlowDocumentNode {\n nodeId: string;\n blockId: string;\n can: string;\n with: string;\n title: string;\n description: string;\n /** Authoritative per-block props, recovered from the document fragment. */\n props: Record<string, string>;\n /** Per-block runtime; `{}` for a fresh/never-run node (e.g. a template). */\n runtime: FlowNodeRuntimeState;\n}\n\nexport interface FlowDocumentRead {\n meta: CompiledFlow['meta'];\n order: string[];\n edges: CompiledEdge[];\n blockIndex: Record<string, string>;\n nodes: FlowDocumentNode[];\n}\n\n// ─── Read ─────────────────────────────────────────────────────────────────────\n\n/**\n * Read a flow document **losslessly** from a headless Y.Doc, in one call.\n *\n * Why this exists: `readCompiledFlowFromYDoc` returns nodes with **empty `props`** (the\n * `qi.flow.nodes` map omits props — they live only in the `document` fragment), and\n * `decompileToBaseUcanFlow` is lossy for the same reason. `readFlowDocument` merges the three\n * sources so a consumer (e.g. an authoring agent) sees the *true* current flow:\n *\n * - structure ← `readCompiledFlowFromYDoc` (nodes, order, edges, `can`/`with`)\n * - per-block props ← `readBlocksFromFragment` (inputs/conditions/trigger/ttl/icon/…)\n * - per-block runtime ← the `runtime` Y.Map (state/output/error/…)\n *\n * Fragment props are authoritative for the denormalized fields (`title`/`description`); the\n * node-map copy is used only as a fallback when the fragment didn't persist them.\n *\n * Returns `null` when the doc has no flow at all (mirrors `readCompiledFlowFromYDoc`).\n */\nexport function readFlowDocument(yDoc: YDoc): FlowDocumentRead | null {\n const compiled = readCompiledFlowFromYDoc(yDoc);\n if (!compiled) return null;\n\n const propsByBlockId = new Map<string, Record<string, string>>();\n for (const block of readBlocksFromFragment(yDoc.getXmlFragment('document'))) {\n propsByBlockId.set(block.id, block.props);\n }\n\n const runtimeMap = yDoc.getMap('runtime');\n\n const nodes: FlowDocumentNode[] = compiled.order\n .filter((nodeId) => compiled.nodes[nodeId])\n .map((nodeId) => {\n const node = compiled.nodes[nodeId];\n const props = propsByBlockId.get(node.blockId) ?? {};\n const rawRuntime = runtimeMap.get(node.blockId);\n const runtime: FlowNodeRuntimeState = rawRuntime && typeof rawRuntime === 'object' ? (rawRuntime as FlowNodeRuntimeState) : {};\n\n return {\n nodeId,\n blockId: node.blockId,\n can: node.can,\n with: node.with,\n title: props.title ?? node.title,\n description: props.description ?? node.description,\n props,\n runtime,\n };\n });\n\n return {\n meta: compiled.meta,\n order: compiled.order,\n edges: compiled.edges,\n blockIndex: compiled.blockIndex,\n nodes,\n };\n}\n\n// ─── Add (template authoring — the inverse of removeFlowNode) ─────────────────\n\nexport interface AddFlowNodeOptions {\n /** Registry action type, e.g. `'qi/form.submit'`. Must exist in the registry. */\n type: string;\n /** Insert into the logical order right after this node id; appended to the end if omitted. */\n afterNodeId?: string;\n /** Optional starting title (defaults to the action's `can` / type). */\n title?: string;\n /** Optional extra block props merged over the compiled defaults. */\n props?: Record<string, string>;\n}\n\n/**\n * Add a step to the flow document — the inverse of `removeFlowNode`. Inserts an\n * attr-only `action` block into the `document` fragment and registers the\n * matching `qi.flow.*` structure (`nodes`, `blockIndex`, `order`) in one\n * transaction, mirroring exactly what the compiler's `hydrate` writes for a\n * single node. No recompile, no runtime entry (a template node is never-run).\n *\n * Returns the new ids, or `null` if `type` is not a known registry action.\n */\nexport function addFlowNode(yDoc: YDoc, opts: AddFlowNodeOptions): { nodeId: string; blockId: string } | null {\n const action = getAction(opts.type);\n if (!action) return null;\n\n const nodeId = `node_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;\n const blockId = `flow_block_${nodeId}`;\n\n const flowId = (yDoc.getMap('qi.flow.meta').get('flowId') as string | undefined) || '';\n const withUri = flowId ? `ixo:flow:${flowId}:${nodeId}` : `ixo:flow:${nodeId}`;\n const can = action.can ?? '';\n const title = opts.title || can || action.type;\n\n const cap: FlowCapability = { id: nodeId, can, with: withUri, title, nb: {} };\n const props: Record<string, string> = { ...compileBlockProps(cap, action.type), triggerMode: 'manual', ...(opts.props ?? {}) };\n\n const node: CompiledFlowNode = {\n id: nodeId,\n blockId,\n can,\n with: withUri,\n registryType: action.type,\n title,\n description: '',\n props,\n };\n\n yDoc.transact(() => {\n writeCompiledBlocksToFragment(yDoc.getXmlFragment('document'), [{ id: blockId, type: COMPILED_BLOCK_TYPE, props }]);\n yDoc.getMap('qi.flow.nodes').set(nodeId, createYMapFromNode(node));\n yDoc.getMap('qi.flow.blockIndex').set(nodeId, blockId);\n\n const order = yDoc.getArray<string>('qi.flow.order');\n if (opts.afterNodeId) {\n const idx = order.toArray().indexOf(opts.afterNodeId);\n if (idx >= 0) order.insert(idx + 1, [nodeId]);\n else order.push([nodeId]);\n } else {\n order.push([nodeId]);\n }\n });\n\n return { nodeId, blockId };\n}\n\n// ─── Per-block config writes (template authoring — surgical, no recompile) ─────\n\n/**\n * Edit one block's config props in place, in the `document` fragment. Surgical: it touches\n * only the target block (siblings untouched), does **not** recompile, and does **not** touch\n * the `runtime` map. Pass `''` for a prop to clear it (the writer drops empty values).\n *\n * Keeps the denormalized node-map fields in sync — `title`/`description` and the `actor`\n * object (derived from `authorisedActors`/`parentCapability`) live in BOTH the fragment and\n * `qi.flow.nodes`, so a fragment-only write would desync structural readers.\n *\n * Returns `false` when no block with `blockId` exists.\n */\nexport function setBlockProps(yDoc: YDoc, blockId: string, partial: Record<string, string>): boolean {\n const fragment = yDoc.getXmlFragment('document');\n const existing = readBlocksFromFragment(fragment).find((b) => b.id === blockId);\n if (!existing) return false;\n\n const merged: Record<string, string> = { ...existing.props, ...partial };\n\n let ok = false;\n yDoc.transact(() => {\n ok = replaceBlockInFragment(fragment, { id: blockId, type: existing.type, props: merged });\n\n const nodeId = findNodeIdForBlock(yDoc, blockId);\n if (nodeId) {\n const node = yDoc.getMap('qi.flow.nodes').get(nodeId);\n if (node instanceof Y.Map) {\n if ('title' in partial) node.set('title', merged.title ?? '');\n if ('description' in partial) node.set('description', merged.description ?? '');\n if ('authorisedActors' in partial || 'parentCapability' in partial) {\n const actor = actorFromProps(merged);\n if (actor) node.set('actor', actor);\n else node.delete('actor');\n }\n }\n }\n });\n\n return ok;\n}\n\n/**\n * Remove one step from the flow document — fragment block + `qi.flow.*` entries + its\n * `runtime` entry + any edges touching it — in one transaction. Siblings untouched.\n *\n * Guards against orphaning references: if another node's trigger, condition, or a\n * `{{nodeId.output.*}}` input ref points at this node, removal is refused and the referring\n * node ids are returned so the caller can surface them.\n */\nexport function removeFlowNode(yDoc: YDoc, nodeId: string): { ok: true } | { ok: false; referencedBy: string[] } {\n const doc = readFlowDocument(yDoc);\n if (!doc) return { ok: false, referencedBy: [] };\n\n const target = doc.nodes.find((n) => n.nodeId === nodeId);\n if (!target) return { ok: false, referencedBy: [] };\n\n const referencedBy = doc.nodes.filter((n) => n.nodeId !== nodeId && nodeReferences(n, nodeId, target.blockId)).map((n) => n.nodeId);\n if (referencedBy.length > 0) return { ok: false, referencedBy };\n\n const blockId = target.blockId;\n yDoc.transact(() => {\n removeBlockFromFragment(yDoc.getXmlFragment('document'), blockId);\n yDoc.getMap('qi.flow.nodes').delete(nodeId);\n yDoc.getMap('qi.flow.blockIndex').delete(nodeId);\n\n const order = yDoc.getArray<string>('qi.flow.order');\n const idx = order.toArray().indexOf(nodeId);\n if (idx >= 0) order.delete(idx, 1);\n\n const edges = yDoc.getMap('qi.flow.edges');\n for (const key of [...edges.keys()]) {\n const e = edges.get(key);\n if (e instanceof Y.Map && (e.get('source') === nodeId || e.get('target') === nodeId)) edges.delete(key);\n }\n\n yDoc.getMap('runtime').delete(blockId);\n });\n\n return { ok: true };\n}\n\n/**\n * Reorder the flow's steps. Always rewrites the logical order (`qi.flow.order`). Also\n * reorders the visual `document` fragment to match — but only when every block is an\n * attr-only compiled block; if the doc contains inline prose, the fragment is left untouched\n * (recreating it would lose content) and only the logical order changes.\n *\n * `order` must be a permutation of the current `qi.flow.order` (same ids, no dups); returns\n * `false` otherwise.\n */\nexport function reorderFlowNodes(yDoc: YDoc, order: string[]): boolean {\n const orderArr = yDoc.getArray<string>('qi.flow.order');\n const current = orderArr.toArray();\n if (order.length !== current.length) return false;\n if (new Set(order).size !== order.length) return false;\n const currentSet = new Set(current);\n if (!order.every((id) => currentSet.has(id))) return false;\n\n const blockIndex = yDoc.getMap('qi.flow.blockIndex');\n const fragment = yDoc.getXmlFragment('document');\n\n yDoc.transact(() => {\n orderArr.delete(0, orderArr.length);\n orderArr.push(order);\n\n if (!fragmentHasContentBlocks(fragment)) {\n const blocks = readBlocksFromFragment(fragment);\n const byId = new Map(blocks.map((b) => [b.id, b] as const));\n const orderedIds = order.map((nid) => blockIndex.get(nid) as string | undefined).filter((id): id is string => !!id);\n const ordered = orderedIds.map((id) => byId.get(id)).filter((b): b is CompiledBlock => !!b);\n const extras = blocks.filter((b) => !orderedIds.includes(b.id));\n removeAllFlowBlocks(fragment);\n writeCompiledBlocksToFragment(fragment, [...ordered, ...extras]);\n }\n });\n\n return true;\n}\n\n/**\n * Swap two step blocks by document position — the move-up/move-down primitive\n * for template authoring. Reorders the visual `document` fragment (so the change\n * is what the author sees), and keeps `qi.flow.order` consistent when BOTH\n * blocks are graph-registered nodes. Works for slash-menu (\"legacy\") blocks too,\n * since it operates on document position rather than the graph.\n *\n * Returns `false` if either block id is missing.\n */\nexport function swapFlowBlocks(yDoc: YDoc, blockIdA: string, blockIdB: string): boolean {\n const fragment = yDoc.getXmlFragment('document');\n let ok = false;\n yDoc.transact(() => {\n ok = swapBlocksInFragment(fragment, blockIdA, blockIdB);\n if (!ok) return;\n\n // Mirror the swap in the logical order for graph-registered nodes.\n const blockIndex = yDoc.getMap<string>('qi.flow.blockIndex');\n let nodeA: string | undefined;\n let nodeB: string | undefined;\n for (const [nodeId, bId] of blockIndex.entries()) {\n if (bId === blockIdA) nodeA = nodeId;\n else if (bId === blockIdB) nodeB = nodeId;\n }\n if (nodeA && nodeB) {\n const order = yDoc.getArray<string>('qi.flow.order');\n const arr = order.toArray();\n const ia = arr.indexOf(nodeA);\n const ib = arr.indexOf(nodeB);\n if (ia >= 0 && ib >= 0) {\n [arr[ia], arr[ib]] = [arr[ib], arr[ia]];\n order.delete(0, order.length);\n order.push(arr);\n }\n }\n });\n return ok;\n}\n\n// ─── Runtime writes (copilot on a running flow — benign, non-executing) ────────\n\n/** Merge a partial into a node's runtime entry — the headless twin of the React `updateRuntime`. */\nexport function updateNodeRuntime(yDoc: YDoc, blockId: string, partial: Partial<FlowNodeRuntimeState>): void {\n const runtimeMap = yDoc.getMap('runtime');\n const prev = runtimeMap.get(blockId);\n const base: FlowNodeRuntimeState = prev && typeof prev === 'object' ? (prev as FlowNodeRuntimeState) : {};\n runtimeMap.set(blockId, { ...base, ...partial });\n}\n\n/**\n * Clear a failed step back to idle so the user can cleanly re-run it. The headless twin of\n * the editor's \"Reset\" recovery affordance — benign and non-executing.\n */\nexport function resetStepRuntime(yDoc: YDoc, blockId: string): void {\n updateNodeRuntime(yDoc, blockId, { state: 'idle', error: undefined, output: {} });\n}\n\n/**\n * Pre-fill a (live) form step's answers at `runtime.output.form.answers` (a JSON string,\n * matching `FormPanel`). Merges into existing `output`; **never** sets `state:'completed'` —\n * submission stays the user's action.\n */\nexport function setFormAnswers(yDoc: YDoc, blockId: string, answers: Record<string, unknown>): void {\n const runtimeMap = yDoc.getMap('runtime');\n const prev = runtimeMap.get(blockId);\n const base: FlowNodeRuntimeState = prev && typeof prev === 'object' ? (prev as FlowNodeRuntimeState) : {};\n const output: Record<string, any> = base.output && typeof base.output === 'object' ? base.output : {};\n const form: Record<string, any> = output.form && typeof output.form === 'object' ? output.form : {};\n runtimeMap.set(blockId, { ...base, output: { ...output, form: { ...form, answers: JSON.stringify(answers) } } });\n}\n\n// ─── Internal helpers ──────────────────────────────────────────────────────────\n\nfunction safeParseJson<T>(value: unknown, fallback: T): T {\n if (typeof value !== 'string' || value.length === 0) return fallback;\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n\nfunction findNodeIdForBlock(yDoc: YDoc, blockId: string): string | undefined {\n const blockIndex = yDoc.getMap('qi.flow.blockIndex');\n for (const [nodeId, bId] of blockIndex.entries()) {\n if (bId === blockId) return nodeId;\n }\n return undefined;\n}\n\nfunction actorFromProps(props: Record<string, string>): ActorConstraint | undefined {\n const authorisedActors = safeParseJson<string[] | undefined>(props.authorisedActors, undefined);\n const parentCapability = props.parentCapability && props.parentCapability.length > 0 ? props.parentCapability : undefined;\n const hasActors = Array.isArray(authorisedActors) && authorisedActors.length > 0;\n if (!hasActors && !parentCapability) return undefined;\n const actor: ActorConstraint = {};\n if (hasActors) actor.authorisedActors = authorisedActors as string[];\n if (parentCapability) actor.parentCapability = parentCapability;\n return actor;\n}\n\nfunction nodeReferences(node: FlowDocumentNode, nodeId: string, blockId: string): boolean {\n // The compiler serializes trigger source references as block ids; docs\n // compiled before that remap carry node ids. Guard against both.\n const trigger = safeParseJson<{ sourceBlockId?: string; sources?: Array<{ sourceBlockId?: string }> } | undefined>(node.props.trigger, undefined);\n if (trigger?.sourceBlockId === nodeId || trigger?.sourceBlockId === blockId) return true;\n if (Array.isArray(trigger?.sources) && trigger.sources.some((s) => s?.sourceBlockId === nodeId || s?.sourceBlockId === blockId)) return true;\n\n const cond = safeParseJson<{ conditions?: Array<{ sourceBlockId?: string }> } | undefined>(node.props.conditions, undefined);\n if (Array.isArray(cond?.conditions) && cond.conditions.some((c) => c?.sourceBlockId === blockId)) return true;\n\n const inputs = typeof node.props.inputs === 'string' ? node.props.inputs : '';\n if (inputs.includes(`${nodeId}.output`)) return true;\n\n return false;\n}\n\nfunction fragmentHasContentBlocks(fragment: Y.XmlFragment): boolean {\n if (fragment.length === 0) return false;\n const root = fragment.get(0);\n if (!(root instanceof Y.XmlElement) || root.nodeName !== 'blockGroup') return false;\n for (let i = 0; i < root.length; i++) {\n const container = root.get(i);\n if (!(container instanceof Y.XmlElement)) continue;\n const content = container.get(0);\n if (content instanceof Y.XmlElement && content.length > 0) return true; // inline children = prose\n }\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,YAAY,OAAO;AA8DZ,SAAS,iBAAiB,MAAqC;AACpE,QAAM,WAAW,yBAAyB,IAAI;AAC9C,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,iBAAiB,oBAAI,IAAoC;AAC/D,aAAW,SAAS,uBAAuB,KAAK,eAAe,UAAU,CAAC,GAAG;AAC3E,mBAAe,IAAI,MAAM,IAAI,MAAM,KAAK;AAAA,EAC1C;AAEA,QAAM,aAAa,KAAK,OAAO,SAAS;AAExC,QAAM,QAA4B,SAAS,MACxC,OAAO,CAAC,WAAW,SAAS,MAAM,MAAM,CAAC,EACzC,IAAI,CAAC,WAAW;AACf,UAAM,OAAO,SAAS,MAAM,MAAM;AAClC,UAAM,QAAQ,eAAe,IAAI,KAAK,OAAO,KAAK,CAAC;AACnD,UAAM,aAAa,WAAW,IAAI,KAAK,OAAO;AAC9C,UAAM,UAAgC,cAAc,OAAO,eAAe,WAAY,aAAsC,CAAC;AAE7H,WAAO;AAAA,MACL;AAAA,MACA,SAAS,KAAK;AAAA,MACd,KAAK,KAAK;AAAA,MACV,MAAM,KAAK;AAAA,MACX,OAAO,MAAM,SAAS,KAAK;AAAA,MAC3B,aAAa,MAAM,eAAe,KAAK;AAAA,MACvC;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,SAAO;AAAA,IACL,MAAM,SAAS;AAAA,IACf,OAAO,SAAS;AAAA,IAChB,OAAO,SAAS;AAAA,IAChB,YAAY,SAAS;AAAA,IACrB;AAAA,EACF;AACF;AAwBO,SAAS,YAAY,MAAY,MAAsE;AAC5G,QAAM,SAAS,UAAU,KAAK,IAAI;AAClC,MAAI,CAAC,O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