@01.software/sdk 0.2.9-dev.260310.cf511cb → 0.2.9-dev.260311.926a6d4
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/README.md +21 -8
- package/dist/auth.cjs +3 -1
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +36 -3
- package/dist/auth.d.ts +36 -3
- package/dist/auth.js +3 -1
- package/dist/auth.js.map +1 -1
- package/dist/components/code-block.cjs +182 -0
- package/dist/components/code-block.cjs.map +1 -0
- package/dist/components/code-block.d.cts +62 -0
- package/dist/components/code-block.d.ts +62 -0
- package/dist/components/code-block.js +152 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/{flow.cjs → components/flow.cjs} +111 -87
- package/dist/components/flow.cjs.map +1 -0
- package/dist/{flow.d.cts → components/flow.d.cts} +27 -11
- package/dist/{flow.d.ts → components/flow.d.ts} +27 -11
- package/dist/{flow.js → components/flow.js} +113 -88
- package/dist/components/flow.js.map +1 -0
- package/dist/{components.cjs → components/form.cjs} +25 -518
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +37 -0
- package/dist/components/form.d.ts +37 -0
- package/dist/{components.js → components/form.js} +17 -513
- package/dist/components/form.js.map +1 -0
- package/dist/components/image.cjs +208 -0
- package/dist/components/image.cjs.map +1 -0
- package/dist/components/image.d.cts +44 -0
- package/dist/components/image.d.ts +44 -0
- package/dist/components/image.js +180 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/rich-text.cjs +258 -0
- package/dist/components/rich-text.cjs.map +1 -0
- package/dist/components/rich-text.d.cts +110 -0
- package/dist/components/rich-text.d.ts +110 -0
- package/dist/components/rich-text.js +235 -0
- package/dist/components/rich-text.js.map +1 -0
- package/dist/index.cjs +214 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +321 -155
- package/dist/index.d.ts +321 -155
- package/dist/index.js +217 -231
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-Cq93wqIe.d.cts → payload-types-BjvBwB8Z.d.cts} +1601 -1373
- package/dist/{payload-types-Cq93wqIe.d.ts → payload-types-BjvBwB8Z.d.ts} +1601 -1373
- package/dist/{webhook-NRdVwXN7.d.cts → webhook-CszIpUKn.d.cts} +2 -2
- package/dist/{webhook-C_7s0K66.d.ts → webhook-_LdLdjGa.d.ts} +2 -2
- package/dist/webhook.d.cts +2 -2
- package/dist/webhook.d.ts +2 -2
- package/package.json +47 -12
- package/dist/auth-CVVo5UT5.d.ts +0 -298
- package/dist/auth-CqgrT1qd.d.cts +0 -298
- package/dist/components.cjs.map +0 -1
- package/dist/components.d.cts +0 -240
- package/dist/components.d.ts +0 -240
- package/dist/components.js.map +0 -1
- package/dist/flow.cjs.map +0 -1
- package/dist/flow.js.map +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __async = (__this, __arguments, generator) => {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
var fulfilled = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
step(generator.next(value));
|
|
7
|
+
} catch (e) {
|
|
8
|
+
reject(e);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var rejected = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
step(generator.throw(value));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
reject(e);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/components/CodeBlock/index.tsx
|
|
24
|
+
import React, { useEffect, useState } from "react";
|
|
25
|
+
|
|
26
|
+
// src/components/CodeBlock/highlight.ts
|
|
27
|
+
import { Fragment } from "react";
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
30
|
+
import { codeToHast } from "shiki";
|
|
31
|
+
var LANGUAGE_ALIASES = {
|
|
32
|
+
js: "javascript",
|
|
33
|
+
ts: "typescript",
|
|
34
|
+
sh: "bash",
|
|
35
|
+
shell: "bash",
|
|
36
|
+
yml: "yaml",
|
|
37
|
+
py: "python",
|
|
38
|
+
rb: "ruby",
|
|
39
|
+
plaintext: "text"
|
|
40
|
+
};
|
|
41
|
+
function normalizeLanguage(lang) {
|
|
42
|
+
return LANGUAGE_ALIASES[lang] || lang;
|
|
43
|
+
}
|
|
44
|
+
function highlight(code, lang, theme = "github-dark") {
|
|
45
|
+
return __async(this, null, function* () {
|
|
46
|
+
const normalized = normalizeLanguage(lang);
|
|
47
|
+
try {
|
|
48
|
+
const hast = yield codeToHast(code, {
|
|
49
|
+
lang: normalized,
|
|
50
|
+
theme
|
|
51
|
+
});
|
|
52
|
+
return toJsxRuntime(hast, { Fragment, jsx, jsxs });
|
|
53
|
+
} catch (e) {
|
|
54
|
+
const hast = yield codeToHast(code, { lang: "text", theme });
|
|
55
|
+
return toJsxRuntime(hast, { Fragment, jsx, jsxs });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/components/CodeBlock/index.tsx
|
|
61
|
+
function CodeBlock({
|
|
62
|
+
code,
|
|
63
|
+
language = "typescript",
|
|
64
|
+
theme = "github-dark",
|
|
65
|
+
className,
|
|
66
|
+
initial,
|
|
67
|
+
showLineNumbers = false,
|
|
68
|
+
showCopyButton = true
|
|
69
|
+
}) {
|
|
70
|
+
const [nodes, setNodes] = useState(initial);
|
|
71
|
+
const [copied, setCopied] = useState(false);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
let cancelled = false;
|
|
74
|
+
void highlight(code, language, theme).then((el) => {
|
|
75
|
+
if (!cancelled) setNodes(el);
|
|
76
|
+
});
|
|
77
|
+
return () => {
|
|
78
|
+
cancelled = true;
|
|
79
|
+
};
|
|
80
|
+
}, [code, language, theme]);
|
|
81
|
+
const handleCopy = () => {
|
|
82
|
+
void navigator.clipboard.writeText(code).then(() => {
|
|
83
|
+
setCopied(true);
|
|
84
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
85
|
+
}, () => {
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ React.createElement("div", { className, style: { position: "relative" } }, showCopyButton && /* @__PURE__ */ React.createElement(
|
|
89
|
+
"button",
|
|
90
|
+
{
|
|
91
|
+
type: "button",
|
|
92
|
+
onClick: handleCopy,
|
|
93
|
+
"aria-label": "Copy code",
|
|
94
|
+
style: {
|
|
95
|
+
position: "absolute",
|
|
96
|
+
top: 8,
|
|
97
|
+
right: 8,
|
|
98
|
+
zIndex: 1,
|
|
99
|
+
padding: "4px 8px",
|
|
100
|
+
fontSize: 12,
|
|
101
|
+
lineHeight: 1,
|
|
102
|
+
border: "1px solid rgba(255,255,255,0.2)",
|
|
103
|
+
borderRadius: 4,
|
|
104
|
+
background: "rgba(0,0,0,0.3)",
|
|
105
|
+
color: "#ccc",
|
|
106
|
+
cursor: "pointer",
|
|
107
|
+
opacity: 0.7,
|
|
108
|
+
transition: "opacity 0.15s"
|
|
109
|
+
},
|
|
110
|
+
onMouseEnter: (e) => {
|
|
111
|
+
e.currentTarget.style.opacity = "1";
|
|
112
|
+
},
|
|
113
|
+
onMouseLeave: (e) => {
|
|
114
|
+
e.currentTarget.style.opacity = "0.7";
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
copied ? "Copied!" : "Copy"
|
|
118
|
+
), showLineNumbers && nodes ? /* @__PURE__ */ React.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React.createElement(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
"aria-hidden": true,
|
|
122
|
+
style: {
|
|
123
|
+
padding: "1em 0.5em 1em 1em",
|
|
124
|
+
textAlign: "right",
|
|
125
|
+
userSelect: "none",
|
|
126
|
+
color: "rgba(255,255,255,0.3)",
|
|
127
|
+
fontFamily: "monospace",
|
|
128
|
+
fontSize: 13,
|
|
129
|
+
lineHeight: 1.5
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
code.split("\n").map((_, i) => /* @__PURE__ */ React.createElement("div", { key: i }, i + 1))
|
|
133
|
+
), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, overflow: "auto" } }, nodes)) : nodes != null ? nodes : /* @__PURE__ */ React.createElement(
|
|
134
|
+
"pre",
|
|
135
|
+
{
|
|
136
|
+
style: {
|
|
137
|
+
margin: 0,
|
|
138
|
+
padding: "1em",
|
|
139
|
+
overflow: "auto",
|
|
140
|
+
fontFamily: "monospace",
|
|
141
|
+
fontSize: 13,
|
|
142
|
+
lineHeight: 1.5
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
/* @__PURE__ */ React.createElement("code", null, code)
|
|
146
|
+
));
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
CodeBlock,
|
|
150
|
+
highlight
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=code-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/CodeBlock/index.tsx","../../src/components/CodeBlock/highlight.ts"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useState, type JSX } from 'react'\nimport { highlight, type BundledTheme } from './highlight'\n\nexport type { BundledTheme }\nexport { highlight }\n\nexport interface CodeBlockProps {\n /** Code string to highlight */\n code: string\n /** Language identifier (e.g. 'typescript', 'js', 'python') */\n language?: string\n /** Shiki theme name. Default: 'github-dark' */\n theme?: BundledTheme\n /** CSS class for the wrapper */\n className?: string\n /** Pre-rendered JSX from server component via `highlight()` */\n initial?: JSX.Element\n /** Show line numbers. Default: false */\n showLineNumbers?: boolean\n /** Show copy button. Default: true */\n showCopyButton?: boolean\n}\n\n/**\n * Syntax-highlighted code block using shiki.\n *\n * @example Basic usage\n * ```tsx\n * <CodeBlock code=\"const x = 1\" language=\"typescript\" />\n * ```\n *\n * @example With server pre-rendering (Next.js)\n * ```tsx\n * // Server Component\n * const initial = await highlight(code, 'typescript')\n * return <CodeBlock code={code} language=\"typescript\" initial={initial} />\n * ```\n *\n * @example As RichTextContent block renderer\n * ```tsx\n * <RichTextContent\n * data={data}\n * blocks={{\n * Code: ({ node }) => (\n * <CodeBlock code={node.fields.code} language={node.fields.language} />\n * ),\n * }}\n * />\n * ```\n */\nexport function CodeBlock({\n code,\n language = 'typescript',\n theme = 'github-dark',\n className,\n initial,\n showLineNumbers = false,\n showCopyButton = true,\n}: CodeBlockProps) {\n const [nodes, setNodes] = useState<JSX.Element | undefined>(initial)\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n let cancelled = false\n void highlight(code, language, theme).then((el) => {\n if (!cancelled) setNodes(el)\n })\n return () => {\n cancelled = true\n }\n }, [code, language, theme])\n\n const handleCopy = () => {\n void navigator.clipboard.writeText(code).then(() => {\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n }, () => {})\n }\n\n return (\n <div className={className} style={{ position: 'relative' }}>\n {showCopyButton && (\n <button\n type=\"button\"\n onClick={handleCopy}\n aria-label=\"Copy code\"\n style={{\n position: 'absolute',\n top: 8,\n right: 8,\n zIndex: 1,\n padding: '4px 8px',\n fontSize: 12,\n lineHeight: 1,\n border: '1px solid rgba(255,255,255,0.2)',\n borderRadius: 4,\n background: 'rgba(0,0,0,0.3)',\n color: '#ccc',\n cursor: 'pointer',\n opacity: 0.7,\n transition: 'opacity 0.15s',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.opacity = '1'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '0.7'\n }}\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )}\n {showLineNumbers && nodes ? (\n <div style={{ display: 'flex' }}>\n <div\n aria-hidden\n style={{\n padding: '1em 0.5em 1em 1em',\n textAlign: 'right',\n userSelect: 'none',\n color: 'rgba(255,255,255,0.3)',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n {code.split('\\n').map((_, i) => (\n <div key={i}>{i + 1}</div>\n ))}\n </div>\n <div style={{ flex: 1, overflow: 'auto' }}>{nodes}</div>\n </div>\n ) : (\n nodes ?? (\n <pre\n style={{\n margin: 0,\n padding: '1em',\n overflow: 'auto',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n <code>{code}</code>\n </pre>\n )\n )}\n </div>\n )\n}\n","import type { JSX } from 'react'\nimport { Fragment } from 'react'\nimport { jsx, jsxs } from 'react/jsx-runtime'\nimport { toJsxRuntime } from 'hast-util-to-jsx-runtime'\nimport { codeToHast, type BundledLanguage, type BundledTheme } from 'shiki'\n\nexport type { BundledLanguage, BundledTheme }\n\n/** Normalize language aliases to shiki-compatible language IDs */\nconst LANGUAGE_ALIASES: Record<string, string> = {\n js: 'javascript',\n ts: 'typescript',\n sh: 'bash',\n shell: 'bash',\n yml: 'yaml',\n py: 'python',\n rb: 'ruby',\n plaintext: 'text',\n}\n\nfunction normalizeLanguage(lang: string): string {\n return LANGUAGE_ALIASES[lang] || lang\n}\n\n/**\n * Highlight code to JSX using shiki.\n * Works in both Server and Client components.\n *\n * @example Server Component\n * ```tsx\n * const highlighted = await highlight('const x = 1', 'typescript')\n * return <div>{highlighted}</div>\n * ```\n */\nexport async function highlight(\n code: string,\n lang: string,\n theme: BundledTheme = 'github-dark',\n): Promise<JSX.Element> {\n const normalized = normalizeLanguage(lang)\n try {\n const hast = await codeToHast(code, {\n lang: normalized as BundledLanguage,\n theme,\n })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n } catch {\n // Fallback to plain text if language is not supported\n const hast = await codeToHast(code, { lang: 'text', theme })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,SAAS,WAAW,gBAA0B;;;ACDrD,SAAS,gBAAgB;AACzB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AAA,QACR,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,YAAY;AAAA,MACd;AAAA;AAAA,IAEA,oCAAC,cAAM,IAAK;AAAA,EACd,CAGN;AAEJ;","names":[]}
|
|
@@ -114,8 +114,10 @@ var BUILT_IN_EDGE_TYPES = [
|
|
|
114
114
|
name: "Default",
|
|
115
115
|
color: "",
|
|
116
116
|
strokeWidth: 2,
|
|
117
|
-
animated:
|
|
117
|
+
animated: false,
|
|
118
118
|
lineStyle: "default",
|
|
119
|
+
markerStart: "none",
|
|
120
|
+
markerEnd: "arrow",
|
|
119
121
|
fields: []
|
|
120
122
|
}
|
|
121
123
|
];
|
|
@@ -123,52 +125,51 @@ var BUILT_IN_EDGE_TYPES = [
|
|
|
123
125
|
// src/components/FlowRenderer/useFlow.ts
|
|
124
126
|
var import_react_query = require("@tanstack/react-query");
|
|
125
127
|
var import_react = require("react");
|
|
126
|
-
|
|
127
|
-
function isId(value) {
|
|
128
|
-
return UUID_RE.test(value);
|
|
129
|
-
}
|
|
130
|
-
function apiNodeTypeToNodeTypeDef(doc) {
|
|
128
|
+
function toNodeTypeDef(doc) {
|
|
131
129
|
var _a, _b, _c, _d;
|
|
132
130
|
return {
|
|
133
131
|
slug: String((_a = doc.slug) != null ? _a : ""),
|
|
134
|
-
name: String((_b = doc.
|
|
132
|
+
name: String((_b = doc.title) != null ? _b : ""),
|
|
135
133
|
color: String((_c = doc.color) != null ? _c : "#e5e7eb"),
|
|
136
134
|
defaultSize: (_d = doc.defaultSize) != null ? _d : { width: 200, height: 200 },
|
|
137
135
|
fields: Array.isArray(doc.fields) ? doc.fields : [],
|
|
138
136
|
transparentBackground: Boolean(doc.transparentBackground)
|
|
139
137
|
};
|
|
140
138
|
}
|
|
141
|
-
function
|
|
142
|
-
var _a, _b, _c, _d, _e, _f;
|
|
139
|
+
function toEdgeTypeDef(doc) {
|
|
140
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
143
141
|
return {
|
|
144
142
|
slug: String((_a = doc.slug) != null ? _a : ""),
|
|
145
143
|
name: String((_b = doc.title) != null ? _b : ""),
|
|
146
144
|
color: String((_c = doc.color) != null ? _c : ""),
|
|
147
145
|
strokeWidth: (_d = doc.strokeWidth) != null ? _d : 2,
|
|
148
|
-
animated: (_e = doc.animated) != null ? _e :
|
|
146
|
+
animated: (_e = doc.animated) != null ? _e : false,
|
|
149
147
|
lineStyle: String((_f = doc.lineStyle) != null ? _f : "default"),
|
|
148
|
+
markerStart: String((_g = doc.markerStart) != null ? _g : "none"),
|
|
149
|
+
markerEnd: String((_h = doc.markerEnd) != null ? _h : "arrow"),
|
|
150
150
|
fields: Array.isArray(doc.fields) ? doc.fields : []
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function useFlow(
|
|
154
|
-
var _a, _b;
|
|
155
|
-
const { client, enabled = true } = options;
|
|
156
|
-
const
|
|
153
|
+
function useFlow(options) {
|
|
154
|
+
var _a, _b, _c;
|
|
155
|
+
const { client, slug, id, enabled = true } = options;
|
|
156
|
+
const hasIdentifier = !!(slug || id);
|
|
157
|
+
const identifier = (_a = id != null ? id : slug) != null ? _a : "";
|
|
157
158
|
const flowQuery = (0, import_react_query.useQuery)({
|
|
158
|
-
queryKey: ["flows",
|
|
159
|
+
queryKey: ["flows", identifier],
|
|
159
160
|
queryFn: () => __async(null, null, function* () {
|
|
160
|
-
if (
|
|
161
|
-
return client.from("flows").findById(
|
|
161
|
+
if (id) {
|
|
162
|
+
return client.from("flows").findById(id);
|
|
162
163
|
}
|
|
163
164
|
const result = yield client.from("flows").find({
|
|
164
|
-
where: { slug: { equals:
|
|
165
|
+
where: { slug: { equals: slug } },
|
|
165
166
|
limit: 1
|
|
166
167
|
});
|
|
167
168
|
const doc = result.docs[0];
|
|
168
|
-
if (!doc) throw new Error(`Flow not found: ${
|
|
169
|
+
if (!doc) throw new Error(`Flow not found: ${slug}`);
|
|
169
170
|
return doc;
|
|
170
171
|
}),
|
|
171
|
-
enabled
|
|
172
|
+
enabled: enabled && hasIdentifier
|
|
172
173
|
}, client.queryClient);
|
|
173
174
|
const nodeTypesQuery = (0, import_react_query.useQuery)({
|
|
174
175
|
queryKey: ["flow-node-types"],
|
|
@@ -188,14 +189,14 @@ function useFlow(slugOrId, options) {
|
|
|
188
189
|
}, client.queryClient);
|
|
189
190
|
const nodeTypeDefs = (0, import_react.useMemo)(() => {
|
|
190
191
|
var _a2;
|
|
191
|
-
const apiDefs = ((_a2 = nodeTypesQuery.data) != null ? _a2 : []).map(
|
|
192
|
+
const apiDefs = ((_a2 = nodeTypesQuery.data) != null ? _a2 : []).map(toNodeTypeDef);
|
|
192
193
|
const builtInSlugs = new Set(BUILT_IN_NODE_TYPES.map((t) => t.slug));
|
|
193
194
|
const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug));
|
|
194
195
|
return [...BUILT_IN_NODE_TYPES, ...customDefs];
|
|
195
196
|
}, [nodeTypesQuery.data]);
|
|
196
197
|
const edgeTypeDefs = (0, import_react.useMemo)(() => {
|
|
197
198
|
var _a2;
|
|
198
|
-
const apiDefs = ((_a2 = edgeTypesQuery.data) != null ? _a2 : []).map(
|
|
199
|
+
const apiDefs = ((_a2 = edgeTypesQuery.data) != null ? _a2 : []).map(toEdgeTypeDef);
|
|
199
200
|
const builtInSlugs = new Set(BUILT_IN_EDGE_TYPES.map((t) => t.slug));
|
|
200
201
|
const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug));
|
|
201
202
|
return [...BUILT_IN_EDGE_TYPES, ...customDefs];
|
|
@@ -208,7 +209,7 @@ function useFlow(slugOrId, options) {
|
|
|
208
209
|
edgeTypeDefs,
|
|
209
210
|
flow,
|
|
210
211
|
isLoading: flowQuery.isLoading || nodeTypesQuery.isLoading || edgeTypesQuery.isLoading,
|
|
211
|
-
error: (
|
|
212
|
+
error: (_c = (_b = flowQuery.error) != null ? _b : nodeTypesQuery.error) != null ? _c : edgeTypesQuery.error
|
|
212
213
|
};
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -223,6 +224,11 @@ function sanitizeUrl(url) {
|
|
|
223
224
|
return void 0;
|
|
224
225
|
}
|
|
225
226
|
}
|
|
227
|
+
function toMarkerType(value) {
|
|
228
|
+
if (value === "arrow") return import_react3.MarkerType.Arrow;
|
|
229
|
+
if (value === "arrowclosed") return import_react3.MarkerType.ArrowClosed;
|
|
230
|
+
return void 0;
|
|
231
|
+
}
|
|
226
232
|
function renderFieldValue(key, val, fieldDef) {
|
|
227
233
|
if (val == null || val === "") return null;
|
|
228
234
|
const fieldType = fieldDef == null ? void 0 : fieldDef.fieldType;
|
|
@@ -236,87 +242,58 @@ function renderFieldValue(key, val, fieldDef) {
|
|
|
236
242
|
key,
|
|
237
243
|
src: safeUrl,
|
|
238
244
|
alt: "",
|
|
239
|
-
|
|
245
|
+
draggable: false,
|
|
246
|
+
style: { flex: 1, minHeight: 0, width: "100%", objectFit: "contain" }
|
|
240
247
|
}
|
|
241
248
|
);
|
|
242
249
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
style: { display: "block", marginTop: 4, fontSize: "0.85em", color: "#3b82f6", wordBreak: "break-all" }
|
|
254
|
-
},
|
|
255
|
-
String(val)
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
if (fieldType === "color") {
|
|
259
|
-
return /* @__PURE__ */ import_react2.default.createElement("div", { key, style: { display: "flex", alignItems: "center", gap: 6, marginTop: 4 } }, /* @__PURE__ */ import_react2.default.createElement(
|
|
260
|
-
"span",
|
|
261
|
-
{
|
|
262
|
-
style: {
|
|
263
|
-
display: "inline-block",
|
|
264
|
-
width: 14,
|
|
265
|
-
height: 14,
|
|
266
|
-
borderRadius: 3,
|
|
267
|
-
backgroundColor: String(val),
|
|
268
|
-
border: "1px solid rgba(0,0,0,0.1)",
|
|
269
|
-
flexShrink: 0
|
|
270
|
-
}
|
|
250
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
key,
|
|
254
|
+
style: {
|
|
255
|
+
fontSize: 11,
|
|
256
|
+
whiteSpace: "pre-wrap",
|
|
257
|
+
wordBreak: "break-word",
|
|
258
|
+
overflow: "hidden",
|
|
259
|
+
flexShrink: 0
|
|
271
260
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const isOn = val === true || val === "true";
|
|
276
|
-
return /* @__PURE__ */ import_react2.default.createElement("p", { key, style: { margin: "4px 0 0", fontSize: "0.85em" } }, isOn ? "On" : "Off");
|
|
277
|
-
}
|
|
278
|
-
return /* @__PURE__ */ import_react2.default.createElement("p", { key, style: { margin: "4px 0 0", fontSize: "0.85em", whiteSpace: "pre-wrap" } }, String(val));
|
|
261
|
+
},
|
|
262
|
+
String(val)
|
|
263
|
+
);
|
|
279
264
|
}
|
|
280
265
|
function DefaultDynamicNode({ data }) {
|
|
281
266
|
const d = data;
|
|
282
|
-
return /* @__PURE__ */ import_react2.default.createElement("div", { style: {
|
|
267
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "column" } }, d.fields && Object.entries(d.fields).filter(([, v]) => v != null && v !== "").map(([key, val]) => renderFieldValue(key, val)));
|
|
283
268
|
}
|
|
284
269
|
function EnhancedDynamicNode({ data, typeDef }) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
style: {
|
|
291
|
-
backgroundColor: typeDef.color,
|
|
292
|
-
padding: "4px 12px",
|
|
293
|
-
borderRadius: "6px 6px 0 0",
|
|
294
|
-
fontSize: "0.75em",
|
|
295
|
-
fontWeight: 600,
|
|
296
|
-
color: "rgba(0,0,0,0.6)"
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
typeDef.name
|
|
300
|
-
), /* @__PURE__ */ import_react2.default.createElement("div", { style: { padding: transparent ? 0 : 12 } }, /* @__PURE__ */ import_react2.default.createElement("strong", { style: { display: "block", marginBottom: 4 } }, data.label), data.fields && Object.entries(data.fields).map(([key, val]) => {
|
|
301
|
-
const fieldDef = fieldMap.get(key);
|
|
302
|
-
return renderFieldValue(key, val, fieldDef);
|
|
303
|
-
})));
|
|
270
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "column" } }, typeDef.fields.map((f) => {
|
|
271
|
+
const val = data.fields[f.name];
|
|
272
|
+
if (val == null || val === "") return null;
|
|
273
|
+
return renderFieldValue(f.name, val, f);
|
|
274
|
+
}));
|
|
304
275
|
}
|
|
305
276
|
function DefaultFrameNode({ data }) {
|
|
306
|
-
var _a, _b;
|
|
277
|
+
var _a, _b, _c, _d;
|
|
307
278
|
const d = data;
|
|
308
|
-
const
|
|
279
|
+
const baseColor = (_a = d.color) != null ? _a : "rgba(128,128,128,0.15)";
|
|
309
280
|
const padding = (_b = d.padding) != null ? _b : 20;
|
|
281
|
+
const borderStyle = (_c = d.borderStyle) != null ? _c : "dashed";
|
|
282
|
+
const opacity = (_d = d.opacity) != null ? _d : 0.15;
|
|
283
|
+
const bgColor = (() => {
|
|
284
|
+
const m = baseColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
285
|
+
if (m) return `rgba(${m[1]},${m[2]},${m[3]},${opacity})`;
|
|
286
|
+
return baseColor;
|
|
287
|
+
})();
|
|
310
288
|
return /* @__PURE__ */ import_react2.default.createElement(
|
|
311
289
|
"div",
|
|
312
290
|
{
|
|
313
291
|
style: {
|
|
314
|
-
backgroundColor:
|
|
292
|
+
backgroundColor: bgColor,
|
|
315
293
|
padding,
|
|
316
294
|
width: "100%",
|
|
317
295
|
height: "100%",
|
|
318
|
-
|
|
319
|
-
border: "2px dashed rgba(128,128,128,0.3)"
|
|
296
|
+
border: borderStyle === "none" ? "none" : `2px ${borderStyle} rgba(128,128,128,0.3)`
|
|
320
297
|
}
|
|
321
298
|
},
|
|
322
299
|
/* @__PURE__ */ import_react2.default.createElement(
|
|
@@ -359,40 +336,87 @@ function createNodeTypes(nodeRenderers, nodeTypeDefsMap) {
|
|
|
359
336
|
types.frame = DefaultFrameNode;
|
|
360
337
|
return types;
|
|
361
338
|
}
|
|
339
|
+
var EDGE_TYPE_MAP = {
|
|
340
|
+
step: "step",
|
|
341
|
+
smoothstep: "smoothstep",
|
|
342
|
+
bezier: "default",
|
|
343
|
+
default: "default"
|
|
344
|
+
};
|
|
345
|
+
function applyEdgeStyles(edges, edgeTypeDefsMap) {
|
|
346
|
+
if (!(edgeTypeDefsMap == null ? void 0 : edgeTypeDefsMap.size)) return edges;
|
|
347
|
+
return edges.map((edge) => {
|
|
348
|
+
var _a;
|
|
349
|
+
const slug = edge.edgeTypeSlug;
|
|
350
|
+
if (!slug) return edge;
|
|
351
|
+
const def = edgeTypeDefsMap.get(slug);
|
|
352
|
+
if (!def) return edge;
|
|
353
|
+
const styled = __spreadValues({}, edge);
|
|
354
|
+
if (!styled.type && def.lineStyle) {
|
|
355
|
+
styled.type = (_a = EDGE_TYPE_MAP[def.lineStyle]) != null ? _a : "default";
|
|
356
|
+
}
|
|
357
|
+
styled.style = __spreadValues(__spreadValues(__spreadValues({}, def.color ? { stroke: def.color } : void 0), def.strokeWidth ? { strokeWidth: def.strokeWidth } : void 0), edge.style);
|
|
358
|
+
if (styled.animated == null && def.animated) styled.animated = true;
|
|
359
|
+
if (!styled.markerStart) {
|
|
360
|
+
const startType = toMarkerType(def.markerStart);
|
|
361
|
+
if (startType) {
|
|
362
|
+
styled.markerStart = __spreadValues({ type: startType }, def.color ? { color: def.color } : void 0);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (!styled.markerEnd) {
|
|
366
|
+
const endType = toMarkerType(def.markerEnd);
|
|
367
|
+
if (endType) {
|
|
368
|
+
styled.markerEnd = __spreadValues({ type: endType }, def.color ? { color: def.color } : void 0);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return styled;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
362
374
|
function FlowRenderer({
|
|
363
375
|
data,
|
|
364
376
|
className,
|
|
365
377
|
style,
|
|
366
378
|
nodeRenderers,
|
|
367
379
|
nodeTypeDefs,
|
|
380
|
+
edgeTypeDefs,
|
|
368
381
|
background = true,
|
|
369
382
|
interactive = false,
|
|
370
383
|
fitView = true,
|
|
371
384
|
onNodeClick,
|
|
372
385
|
onEdgeClick
|
|
373
386
|
}) {
|
|
374
|
-
var _a
|
|
387
|
+
var _a;
|
|
375
388
|
const nodeTypeDefsMap = import_react2.default.useMemo(() => {
|
|
376
389
|
if (!(nodeTypeDefs == null ? void 0 : nodeTypeDefs.length)) return void 0;
|
|
377
390
|
return new Map(nodeTypeDefs.map((d) => [d.slug, d]));
|
|
378
391
|
}, [nodeTypeDefs]);
|
|
392
|
+
const edgeTypeDefsMap = import_react2.default.useMemo(() => {
|
|
393
|
+
if (!(edgeTypeDefs == null ? void 0 : edgeTypeDefs.length)) return void 0;
|
|
394
|
+
return new Map(edgeTypeDefs.map((d) => [d.slug, d]));
|
|
395
|
+
}, [edgeTypeDefs]);
|
|
379
396
|
const nodeTypes = import_react2.default.useMemo(
|
|
380
397
|
() => createNodeTypes(nodeRenderers, nodeTypeDefsMap),
|
|
381
398
|
[nodeRenderers, nodeTypeDefsMap]
|
|
382
399
|
);
|
|
400
|
+
const styledEdges = import_react2.default.useMemo(
|
|
401
|
+
() => {
|
|
402
|
+
var _a2;
|
|
403
|
+
return applyEdgeStyles((_a2 = data == null ? void 0 : data.edges) != null ? _a2 : [], edgeTypeDefsMap);
|
|
404
|
+
},
|
|
405
|
+
[data == null ? void 0 : data.edges, edgeTypeDefsMap]
|
|
406
|
+
);
|
|
383
407
|
if (!data) return null;
|
|
384
408
|
const defaultViewport = !fitView && data.viewport ? data.viewport : void 0;
|
|
385
409
|
return /* @__PURE__ */ import_react2.default.createElement(import_react3.ReactFlowProvider, null, /* @__PURE__ */ import_react2.default.createElement("div", { className, style: __spreadValues({ width: "100%", height: "100%" }, style) }, /* @__PURE__ */ import_react2.default.createElement(
|
|
386
410
|
import_react3.ReactFlow,
|
|
387
411
|
{
|
|
388
412
|
nodes: (_a = data.nodes) != null ? _a : [],
|
|
389
|
-
edges:
|
|
413
|
+
edges: styledEdges,
|
|
390
414
|
nodeTypes,
|
|
391
415
|
defaultViewport,
|
|
392
416
|
fitView,
|
|
393
417
|
onNodeClick,
|
|
394
418
|
onEdgeClick,
|
|
395
|
-
nodesDraggable: interactive,
|
|
419
|
+
nodesDraggable: interactive ? void 0 : false,
|
|
396
420
|
nodesConnectable: false,
|
|
397
421
|
elementsSelectable: interactive || !!onNodeClick || !!onEdgeClick,
|
|
398
422
|
panOnDrag: interactive,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/FlowRenderer/index.tsx","../../src/components/FlowRenderer/types.ts","../../src/components/FlowRenderer/built-in-node-types.ts","../../src/components/FlowRenderer/built-in-edge-types.ts","../../src/components/FlowRenderer/useFlow.ts"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport {\n ReactFlow,\n ReactFlowProvider,\n Background,\n MarkerType,\n type NodeTypes,\n type NodeProps,\n type Edge,\n} from '@xyflow/react'\nimport type {\n CanvasData,\n DynamicNodeData,\n DynamicNodeSlotProps,\n EdgeTypeDef,\n FlowEdge,\n FlowNode,\n FrameNodeData,\n NodeTypeDef,\n NodeTypeFieldDef,\n} from './types'\n\nexport type {\n CanvasData,\n DynamicNodeSlotProps,\n FlowNode,\n FlowEdge,\n FlowViewport,\n FlowNodePosition,\n FlowNodeData,\n DynamicNodeData,\n FrameNodeData,\n NodeTypeDef,\n NodeTypeFieldDef,\n EdgeTypeDef,\n} from './types'\nexport { isDynamicNode, isFrameNode } from './types'\nexport { BUILT_IN_NODE_TYPES } from './built-in-node-types'\nexport { BUILT_IN_EDGE_TYPES } from './built-in-edge-types'\nexport { useFlow } from './useFlow'\nexport type { SDKClient, UseFlowOptions, UseFlowResult } from './useFlow'\n\n// ── Helpers ──\n\nfunction sanitizeUrl(url: string | undefined): string | undefined {\n if (!url) return url\n try {\n const parsed = new URL(url)\n if (parsed.protocol === 'http:' || parsed.protocol === 'https:') return url\n return undefined\n } catch {\n return undefined\n }\n}\n\nfunction toMarkerType(value: string): MarkerType | undefined {\n if (value === 'arrow') return MarkerType.Arrow\n if (value === 'arrowclosed') return MarkerType.ArrowClosed\n return undefined\n}\n\n// ── Field renderer (type-aware, matching console style) ──\n\nfunction renderFieldValue(\n key: string,\n val: unknown,\n fieldDef?: NodeTypeFieldDef,\n): React.ReactNode {\n if (val == null || val === '') return null\n\n const fieldType = fieldDef?.fieldType\n\n // Image field — image only, no decoration\n if (fieldType === 'image' || (typeof val === 'object' && val !== null && 'url' in val)) {\n const imgUrl = typeof val === 'string' ? val : (val as { url?: string })?.url\n const safeUrl = sanitizeUrl(imgUrl)\n if (!safeUrl) return null\n return (\n <img\n key={key}\n src={safeUrl}\n alt=\"\"\n draggable={false}\n style={{ flex: 1, minHeight: 0, width: '100%', objectFit: 'contain' }}\n />\n )\n }\n\n // All other fields — text only\n return (\n <div\n key={key}\n style={{\n fontSize: 11,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n overflow: 'hidden',\n flexShrink: 0,\n }}\n >\n {String(val)}\n </div>\n )\n}\n\n// ── Default dynamic node renderer (no typeDef) ──\n\nfunction DefaultDynamicNode({ data }: NodeProps) {\n const d = data as unknown as DynamicNodeData\n return (\n <div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'column' }}>\n {d.fields &&\n Object.entries(d.fields)\n .filter(([, v]) => v != null && v !== '')\n .map(([key, val]) => renderFieldValue(key, val))}\n </div>\n )\n}\n\n// ── Enhanced dynamic node renderer (with NodeTypeDef) ──\n\nfunction EnhancedDynamicNode({ data, typeDef }: { data: DynamicNodeData; typeDef: NodeTypeDef }) {\n return (\n <div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'column' }}>\n {typeDef.fields.map((f) => {\n const val = data.fields[f.name]\n if (val == null || val === '') return null\n return renderFieldValue(f.name, val, f)\n })}\n </div>\n )\n}\n\n// ── Default frame node renderer ──\n\nfunction DefaultFrameNode({ data }: NodeProps) {\n const d = data as unknown as FrameNodeData\n const baseColor = d.color ?? 'rgba(128,128,128,0.15)'\n const padding = d.padding ?? 20\n const borderStyle = d.borderStyle ?? 'dashed'\n const opacity = d.opacity ?? 0.15\n\n // Apply opacity to rgba colors\n const bgColor = (() => {\n const m = baseColor.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/)\n if (m) return `rgba(${m[1]},${m[2]},${m[3]},${opacity})`\n return baseColor\n })()\n\n return (\n <div\n style={{\n backgroundColor: bgColor,\n padding,\n width: '100%',\n height: '100%',\n border: borderStyle === 'none' ? 'none' : `2px ${borderStyle} rgba(128,128,128,0.3)`,\n }}\n >\n <div\n style={{\n fontSize: 11,\n fontWeight: 600,\n color: 'rgba(128,128,128,0.6)',\n userSelect: 'none',\n }}\n >\n {d.label}\n </div>\n </div>\n )\n}\n\n// ── Node types builder ──\n\nfunction createNodeTypes(\n nodeRenderers?: Record<string, React.ComponentType<DynamicNodeSlotProps>>,\n nodeTypeDefsMap?: Map<string, NodeTypeDef>,\n): NodeTypes {\n const types: NodeTypes = {} as NodeTypes\n\n // Dynamic node type\n types.dynamic = ((props: NodeProps) => {\n const d = props.data as unknown as DynamicNodeData\n const typeDef = nodeTypeDefsMap?.get(d.nodeTypeSlug)\n const CustomRenderer = nodeRenderers?.[d.nodeTypeSlug]\n if (CustomRenderer) {\n return (\n <CustomRenderer\n id={props.id}\n nodeTypeSlug={d.nodeTypeSlug}\n label={d.label}\n fields={d.fields}\n nodeTypeDef={typeDef}\n />\n )\n }\n if (typeDef) {\n return <EnhancedDynamicNode data={d} typeDef={typeDef} />\n }\n return <DefaultDynamicNode {...props} />\n }) as NodeTypes[string]\n\n // Frame node type\n types.frame = DefaultFrameNode as NodeTypes[string]\n\n return types\n}\n\n// ── Edge style resolver ──\n\nconst EDGE_TYPE_MAP: Record<string, string> = {\n step: 'step',\n smoothstep: 'smoothstep',\n bezier: 'default',\n default: 'default',\n}\n\nfunction applyEdgeStyles(\n edges: FlowEdge[],\n edgeTypeDefsMap?: Map<string, EdgeTypeDef>,\n): Edge[] {\n if (!edgeTypeDefsMap?.size) return edges as unknown as Edge[]\n\n return edges.map((edge) => {\n const slug = edge.edgeTypeSlug\n if (!slug) return edge as unknown as Edge\n\n const def = edgeTypeDefsMap.get(slug)\n if (!def) return edge as unknown as Edge\n\n const styled: Edge = { ...(edge as unknown as Edge) }\n\n // Edge type (line style) — canvas value takes precedence\n if (!styled.type && def.lineStyle) {\n styled.type = EDGE_TYPE_MAP[def.lineStyle] ?? 'default'\n }\n\n // Visual style — canvas style merged with def as fallback\n styled.style = {\n ...(def.color ? { stroke: def.color } : undefined),\n ...(def.strokeWidth ? { strokeWidth: def.strokeWidth } : undefined),\n ...edge.style,\n }\n\n // Animation — canvas value takes precedence\n if (styled.animated == null && def.animated) styled.animated = true\n\n // Markers — canvas value takes precedence over def\n if (!styled.markerStart) {\n const startType = toMarkerType(def.markerStart)\n if (startType) {\n styled.markerStart = { type: startType, ...(def.color ? { color: def.color } : undefined) }\n }\n }\n if (!styled.markerEnd) {\n const endType = toMarkerType(def.markerEnd)\n if (endType) {\n styled.markerEnd = { type: endType, ...(def.color ? { color: def.color } : undefined) }\n }\n }\n\n return styled\n })\n}\n\n// ── FlowRenderer ──\n\n/**\n * Renders a Flow canvas in read-only mode.\n *\n * Requires `@xyflow/react` peer dependency and its CSS:\n * ```ts\n * import '@xyflow/react/dist/style.css'\n * ```\n */\nexport interface FlowRendererProps {\n /** Canvas data from Flow document's `canvas` field */\n data: CanvasData\n /** Container className */\n className?: string\n /** Container style */\n style?: React.CSSProperties\n /** Custom renderers by node type slug (e.g., `{ 'product-card': MyProductCard }`) */\n nodeRenderers?: Record<string, React.ComponentType<DynamicNodeSlotProps>>\n /** Node type definitions for enhanced rendering (field-type-aware display) */\n nodeTypeDefs?: NodeTypeDef[]\n /** Edge type definitions for styled edges (color, stroke, markers, animation) */\n edgeTypeDefs?: EdgeTypeDef[]\n /** Show background pattern (default: true) */\n background?: boolean\n /** Allow user interaction - pan, zoom (default: false for read-only display) */\n interactive?: boolean\n /** Fit view on mount (default: true) */\n fitView?: boolean\n /** Called when a node is clicked */\n onNodeClick?: (event: React.MouseEvent, node: FlowNode) => void\n /** Called when an edge is clicked */\n onEdgeClick?: (event: React.MouseEvent, edge: FlowEdge) => void\n}\n\nexport function FlowRenderer({\n data,\n className,\n style,\n nodeRenderers,\n nodeTypeDefs,\n edgeTypeDefs,\n background = true,\n interactive = false,\n fitView = true,\n onNodeClick,\n onEdgeClick,\n}: FlowRendererProps) {\n const nodeTypeDefsMap = React.useMemo(() => {\n if (!nodeTypeDefs?.length) return undefined\n return new Map(nodeTypeDefs.map((d) => [d.slug, d]))\n }, [nodeTypeDefs])\n\n const edgeTypeDefsMap = React.useMemo(() => {\n if (!edgeTypeDefs?.length) return undefined\n return new Map(edgeTypeDefs.map((d) => [d.slug, d]))\n }, [edgeTypeDefs])\n\n const nodeTypes = React.useMemo(\n () => createNodeTypes(nodeRenderers, nodeTypeDefsMap),\n [nodeRenderers, nodeTypeDefsMap],\n )\n\n const styledEdges = React.useMemo(\n () => applyEdgeStyles(data?.edges ?? [], edgeTypeDefsMap),\n [data?.edges, edgeTypeDefsMap],\n )\n\n if (!data) return null\n\n const defaultViewport = !fitView && data.viewport ? data.viewport : undefined\n\n return (\n <ReactFlowProvider>\n <div className={className} style={{ width: '100%', height: '100%', ...style }}>\n <ReactFlow\n nodes={(data.nodes ?? []) as unknown as Parameters<typeof ReactFlow>[0]['nodes']}\n edges={styledEdges}\n nodeTypes={nodeTypes}\n defaultViewport={defaultViewport}\n fitView={fitView}\n onNodeClick={onNodeClick as Parameters<typeof ReactFlow>[0]['onNodeClick']}\n onEdgeClick={onEdgeClick as Parameters<typeof ReactFlow>[0]['onEdgeClick']}\n nodesDraggable={interactive ? undefined : false}\n nodesConnectable={false}\n elementsSelectable={interactive || !!onNodeClick || !!onEdgeClick}\n panOnDrag={interactive}\n zoomOnScroll={interactive}\n zoomOnPinch={interactive}\n zoomOnDoubleClick={false}\n >\n {background && <Background />}\n </ReactFlow>\n </div>\n </ReactFlowProvider>\n )\n}\n","import type React from 'react'\n\n// ── Dynamic node data ──\n\nexport interface DynamicNodeData {\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n}\n\nexport type FlowNodeData = DynamicNodeData & Record<string, unknown>\n\n// ── Canvas types (mirrors @xyflow/react but standalone) ──\n\nexport interface FlowNodePosition {\n x: number\n y: number\n}\n\nexport interface FlowNode {\n id: string\n type?: string\n position: FlowNodePosition\n data: FlowNodeData\n style?: React.CSSProperties\n width?: number\n height?: number\n measured?: { width?: number; height?: number }\n draggable?: boolean\n selectable?: boolean\n [key: string]: unknown\n}\n\nexport interface FlowEdge {\n id: string\n source: string\n target: string\n sourceHandle?: string | null\n targetHandle?: string | null\n type?: string\n style?: React.CSSProperties\n animated?: boolean\n markerStart?: unknown\n markerEnd?: unknown\n edgeTypeSlug?: string\n fields?: Record<string, unknown>\n [key: string]: unknown\n}\n\nexport interface FlowViewport {\n x: number\n y: number\n zoom: number\n}\n\nexport interface CanvasData {\n nodes: FlowNode[]\n edges: FlowEdge[]\n viewport: FlowViewport\n}\n\n// ── Node type definitions (mirrors console's NodeTypeDef) ──\n\nexport interface NodeTypeFieldDef {\n name: string\n label: string\n fieldType: 'text' | 'textarea' | 'number' | 'url' | 'color' | 'image' | 'select' | 'toggle'\n options?: { label: string; value: string }[]\n defaultValue?: string\n required?: boolean\n}\n\nexport interface NodeTypeDef {\n slug: string\n name: string\n color: string\n defaultSize: { width: number; height: number }\n fields: NodeTypeFieldDef[]\n transparentBackground?: boolean\n}\n\n// ── Edge type definitions (mirrors console's EdgeTypeDef) ──\n\nexport interface EdgeTypeDef {\n slug: string\n name: string\n color: string\n strokeWidth: number\n animated: boolean\n lineStyle: string\n markerStart: string\n markerEnd: string\n fields: NodeTypeFieldDef[]\n}\n\n// ── Type guards ──\n\nexport function isDynamicNode(node: FlowNode): node is FlowNode & { data: DynamicNodeData } {\n return node.type === 'dynamic'\n}\n\nexport function isFrameNode(node: FlowNode): node is FlowNode & { data: FrameNodeData } {\n return node.type === 'frame'\n}\n\n// ── Component slot props ──\n\nexport interface DynamicNodeSlotProps {\n id: string\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n nodeTypeDef?: NodeTypeDef\n}\n\n// ── Frame node data ──\n\nexport interface FrameNodeData {\n label: string\n color?: string\n padding?: number\n borderStyle?: 'dashed' | 'solid' | 'none'\n opacity?: number\n}\n","import type { NodeTypeDef } from './types'\n\nexport const BUILT_IN_NODE_TYPES: NodeTypeDef[] = [\n {\n slug: 'text',\n name: 'Text',\n color: '#e5e7eb',\n defaultSize: { width: 200, height: 200 },\n fields: [{ name: 'body', label: 'Body', fieldType: 'textarea' }],\n },\n {\n slug: 'image',\n name: 'Image',\n color: '#e5e7eb',\n transparentBackground: true,\n defaultSize: { width: 200, height: 200 },\n fields: [\n { name: 'image', label: 'Image', fieldType: 'image' },\n { name: 'alt', label: 'Alt Text', fieldType: 'text' },\n { name: 'caption', label: 'Caption', fieldType: 'text' },\n ],\n },\n]\n","import type { EdgeTypeDef } from './types'\n\nexport const BUILT_IN_EDGE_TYPES: EdgeTypeDef[] = [\n {\n slug: 'default',\n name: 'Default',\n color: '',\n strokeWidth: 2,\n animated: false,\n lineStyle: 'default',\n markerStart: 'none',\n markerEnd: 'arrow',\n fields: [],\n },\n]\n","'use client'\n\nimport { useQuery, type QueryClient } from '@tanstack/react-query'\nimport { useMemo } from 'react'\nimport type { CanvasData, NodeTypeDef, EdgeTypeDef } from './types'\nimport { BUILT_IN_NODE_TYPES } from './built-in-node-types'\nimport { BUILT_IN_EDGE_TYPES } from './built-in-edge-types'\n\n// ── Client interface ──\n// Structurally compatible with both BrowserClient and ServerClient.\n// Lists only the collections useFlow actually queries so the generic\n// `from<T extends PublicCollection>` on the real clients satisfies this.\n\ntype FlowCollection = 'flows' | 'flow-node-types' | 'flow-edge-types'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFn = (...args: any[]) => any\n\nexport interface SDKClient {\n from(collection: FlowCollection): {\n find: AnyFn\n findById: AnyFn\n }\n queryClient: QueryClient\n}\n\n// ── Options & Result ──\n\nexport interface UseFlowOptions {\n /** SDK client instance (BrowserClient or ServerClient) */\n client: SDKClient\n /** Flow slug (URL-friendly identifier) */\n slug?: string\n /** Flow document ID (UUID) */\n id?: string\n /** Enable/disable data fetching (default: true) */\n enabled?: boolean\n}\n\nexport interface UseFlowResult {\n data: CanvasData | undefined\n nodeTypeDefs: NodeTypeDef[]\n edgeTypeDefs: EdgeTypeDef[]\n flow: Record<string, unknown> | undefined\n isLoading: boolean\n error: Error | null\n}\n\n// ── Helpers ──\n\nfunction toNodeTypeDef(doc: Record<string, unknown>): NodeTypeDef {\n return {\n slug: String(doc.slug ?? ''),\n name: String(doc.title ?? ''),\n color: String(doc.color ?? '#e5e7eb'),\n defaultSize: (doc.defaultSize as NodeTypeDef['defaultSize']) ?? { width: 200, height: 200 },\n fields: Array.isArray(doc.fields)\n ? (doc.fields as NodeTypeDef['fields'])\n : [],\n transparentBackground: Boolean(doc.transparentBackground),\n }\n}\n\nfunction toEdgeTypeDef(doc: Record<string, unknown>): EdgeTypeDef {\n return {\n slug: String(doc.slug ?? ''),\n name: String(doc.title ?? ''),\n color: String(doc.color ?? ''),\n strokeWidth: (doc.strokeWidth as number) ?? 2,\n animated: (doc.animated as boolean) ?? false,\n lineStyle: String(doc.lineStyle ?? 'default'),\n markerStart: String(doc.markerStart ?? 'none'),\n markerEnd: String(doc.markerEnd ?? 'arrow'),\n fields: Array.isArray(doc.fields)\n ? (doc.fields as EdgeTypeDef['fields'])\n : [],\n }\n}\n\n// ── Hook ──\n\nexport function useFlow(options: UseFlowOptions): UseFlowResult {\n const { client, slug, id, enabled = true } = options\n const hasIdentifier = !!(slug || id)\n const identifier = (id ?? slug) ?? ''\n\n // Fetch flow document\n const flowQuery = useQuery<Record<string, unknown>>({\n queryKey: ['flows', identifier],\n queryFn: async () => {\n if (id) {\n return client.from('flows').findById(id)\n }\n const result = await client.from('flows').find({\n where: { slug: { equals: slug } },\n limit: 1,\n })\n const doc = result.docs[0]\n if (!doc) throw new Error(`Flow not found: ${slug}`)\n return doc\n },\n enabled: enabled && hasIdentifier,\n }, client.queryClient)\n\n // Fetch tenant's custom node types\n const nodeTypesQuery = useQuery<Record<string, unknown>[]>({\n queryKey: ['flow-node-types'],\n queryFn: async () => {\n const result = await client.from('flow-node-types').find({ limit: 100 })\n return result.docs\n },\n enabled,\n }, client.queryClient)\n\n // Fetch tenant's custom edge types\n const edgeTypesQuery = useQuery<Record<string, unknown>[]>({\n queryKey: ['flow-edge-types'],\n queryFn: async () => {\n const result = await client.from('flow-edge-types').find({ limit: 100 })\n return result.docs\n },\n enabled,\n }, client.queryClient)\n\n // Merge built-in + API node types\n const nodeTypeDefs = useMemo<NodeTypeDef[]>(() => {\n const apiDefs = (nodeTypesQuery.data ?? []).map(toNodeTypeDef)\n const builtInSlugs = new Set(BUILT_IN_NODE_TYPES.map((t) => t.slug))\n const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug))\n return [...BUILT_IN_NODE_TYPES, ...customDefs]\n }, [nodeTypesQuery.data])\n\n // Merge built-in + API edge types\n const edgeTypeDefs = useMemo<EdgeTypeDef[]>(() => {\n const apiDefs = (edgeTypesQuery.data ?? []).map(toEdgeTypeDef)\n const builtInSlugs = new Set(BUILT_IN_EDGE_TYPES.map((t) => t.slug))\n const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug))\n return [...BUILT_IN_EDGE_TYPES, ...customDefs]\n }, [edgeTypesQuery.data])\n\n const flow = flowQuery.data\n const canvas = flow?.canvas as CanvasData | undefined\n\n return {\n data: canvas,\n nodeTypeDefs,\n edgeTypeDefs,\n flow,\n isLoading: flowQuery.isLoading || nodeTypesQuery.isLoading || edgeTypesQuery.isLoading,\n error: (flowQuery.error as Error | null) ?? (nodeTypesQuery.error as Error | null) ?? (edgeTypesQuery.error as Error | null),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAkB;AAClB,IAAAA,gBAQO;;;ACsFA,SAAS,cAAc,MAA8D;AAC1F,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,YAAY,MAA4D;AACtF,SAAO,KAAK,SAAS;AACvB;;;ACrGO,IAAM,sBAAqC;AAAA,EAChD;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,IACvC,QAAQ,CAAC,EAAE,MAAM,QAAQ,OAAO,QAAQ,WAAW,WAAW,CAAC;AAAA,EACjE;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,uBAAuB;AAAA,IACvB,aAAa,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,IACvC,QAAQ;AAAA,MACN,EAAE,MAAM,SAAS,OAAO,SAAS,WAAW,QAAQ;AAAA,MACpD,EAAE,MAAM,OAAO,OAAO,YAAY,WAAW,OAAO;AAAA,MACpD,EAAE,MAAM,WAAW,OAAO,WAAW,WAAW,OAAO;AAAA,IACzD;AAAA,EACF;AACF;;;ACpBO,IAAM,sBAAqC;AAAA,EAChD;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA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