@01.software/sdk 0.5.4 → 0.5.5

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.
Files changed (45) hide show
  1. package/dist/auth.cjs +22 -46
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.js +22 -47
  4. package/dist/auth.js.map +1 -1
  5. package/dist/index.cjs +922 -1069
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +922 -1072
  8. package/dist/index.js.map +1 -1
  9. package/dist/realtime.cjs +75 -101
  10. package/dist/realtime.cjs.map +1 -1
  11. package/dist/realtime.js +75 -102
  12. package/dist/realtime.js.map +1 -1
  13. package/dist/ui/code-block.cjs +13 -35
  14. package/dist/ui/code-block.cjs.map +1 -1
  15. package/dist/ui/code-block.js +13 -35
  16. package/dist/ui/code-block.js.map +1 -1
  17. package/dist/ui/flow/server.cjs +26 -68
  18. package/dist/ui/flow/server.cjs.map +1 -1
  19. package/dist/ui/flow/server.js +26 -71
  20. package/dist/ui/flow/server.js.map +1 -1
  21. package/dist/ui/flow.cjs +176 -232
  22. package/dist/ui/flow.cjs.map +1 -1
  23. package/dist/ui/flow.js +176 -234
  24. package/dist/ui/flow.js.map +1 -1
  25. package/dist/ui/form.cjs +40 -84
  26. package/dist/ui/form.cjs.map +1 -1
  27. package/dist/ui/form.js +40 -86
  28. package/dist/ui/form.js.map +1 -1
  29. package/dist/ui/image.cjs +27 -40
  30. package/dist/ui/image.cjs.map +1 -1
  31. package/dist/ui/image.js +27 -42
  32. package/dist/ui/image.js.map +1 -1
  33. package/dist/ui/rich-text.cjs +33 -67
  34. package/dist/ui/rich-text.cjs.map +1 -1
  35. package/dist/ui/rich-text.js +33 -69
  36. package/dist/ui/rich-text.js.map +1 -1
  37. package/dist/ui/video.cjs +32 -50
  38. package/dist/ui/video.cjs.map +1 -1
  39. package/dist/ui/video.js +32 -52
  40. package/dist/ui/video.js.map +1 -1
  41. package/dist/webhook.cjs +48 -73
  42. package/dist/webhook.cjs.map +1 -1
  43. package/dist/webhook.js +48 -74
  44. package/dist/webhook.js.map +1 -1
  45. package/package.json +3 -3
package/dist/ui/flow.cjs CHANGED
@@ -2,39 +2,10 @@
2
2
  "use client";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
- var __defProps = Object.defineProperties;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
7
  var __getProtoOf = Object.getPrototypeOf;
11
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
9
  var __export = (target, all) => {
39
10
  for (var name in all)
40
11
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -56,26 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
56
27
  mod
57
28
  ));
58
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
59
- var __async = (__this, __arguments, generator) => {
60
- return new Promise((resolve, reject) => {
61
- var fulfilled = (value) => {
62
- try {
63
- step(generator.next(value));
64
- } catch (e) {
65
- reject(e);
66
- }
67
- };
68
- var rejected = (value) => {
69
- try {
70
- step(generator.throw(value));
71
- } catch (e) {
72
- reject(e);
73
- }
74
- };
75
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
76
- step((generator = generator.apply(__this, __arguments)).next());
77
- });
78
- };
79
30
 
80
31
  // src/ui/Flow/index.tsx
81
32
  var Flow_exports = {};
@@ -168,133 +119,128 @@ function collectionKeys(collection) {
168
119
 
169
120
  // src/ui/Flow/query-options.ts
170
121
  function flowQueryOptions(client, slug, id) {
171
- var _a;
172
- const identifier = (_a = id != null ? id : slug) != null ? _a : "";
122
+ const identifier = id ?? slug ?? "";
173
123
  return {
174
124
  queryKey: collectionKeys("flows").detail(identifier),
175
- queryFn: () => __async(null, null, function* () {
125
+ queryFn: async () => {
176
126
  if (id) return client.from("flows").findById(id);
177
- const result = yield client.from("flows").find({
127
+ const result = await client.from("flows").find({
178
128
  where: { slug: { equals: slug } },
179
129
  limit: 1
180
130
  });
181
131
  const doc = result.docs[0];
182
132
  if (!doc) throw new Error(`Flow not found: ${slug}`);
183
133
  return doc;
184
- })
134
+ }
185
135
  };
186
136
  }
187
137
  function nodeTypesQueryOptions(client) {
188
138
  return {
189
139
  queryKey: collectionKeys("flow-node-types").lists(),
190
- queryFn: () => __async(null, null, function* () {
191
- const result = yield client.from("flow-node-types").find({ limit: 0 });
140
+ queryFn: async () => {
141
+ const result = await client.from("flow-node-types").find({ limit: 0 });
192
142
  return result.docs;
193
- })
143
+ }
194
144
  };
195
145
  }
196
146
  function edgeTypesQueryOptions(client) {
197
147
  return {
198
148
  queryKey: collectionKeys("flow-edge-types").lists(),
199
- queryFn: () => __async(null, null, function* () {
200
- const result = yield client.from("flow-edge-types").find({ limit: 0 });
149
+ queryFn: async () => {
150
+ const result = await client.from("flow-edge-types").find({ limit: 0 });
201
151
  return result.docs;
202
- })
152
+ }
203
153
  };
204
154
  }
205
155
 
206
156
  // src/ui/Flow/useFlow.ts
207
157
  function toNodeTypeDef(doc) {
208
- var _a, _b, _c, _d, _e, _f;
209
158
  return {
210
- slug: String((_a = doc.slug) != null ? _a : ""),
211
- name: String((_b = doc.title) != null ? _b : ""),
212
- color: String((_c = doc.color) != null ? _c : "#e5e7eb"),
213
- defaultSize: (_d = doc.defaultSize) != null ? _d : {
159
+ slug: String(doc.slug ?? ""),
160
+ name: String(doc.title ?? ""),
161
+ color: String(doc.color ?? "#e5e7eb"),
162
+ defaultSize: doc.defaultSize ?? {
214
163
  width: 200,
215
164
  height: 200
216
165
  },
217
166
  fields: Array.isArray(doc.fields) ? doc.fields : [],
218
167
  transparentBackground: Boolean(doc.transparentBackground),
219
- template: (_e = doc.template) != null ? _e : null,
220
- customCSS: (_f = doc.customCSS) != null ? _f : null
168
+ template: doc.template ?? null,
169
+ customCSS: doc.customCSS ?? null
221
170
  };
222
171
  }
223
172
  function toEdgeTypeDef(doc) {
224
- var _a, _b, _c, _d, _e, _f, _g, _h;
225
173
  return {
226
- slug: String((_a = doc.slug) != null ? _a : ""),
227
- name: String((_b = doc.title) != null ? _b : ""),
228
- color: String((_c = doc.color) != null ? _c : ""),
229
- strokeWidth: (_d = doc.strokeWidth) != null ? _d : 2,
230
- animated: (_e = doc.animated) != null ? _e : false,
231
- lineStyle: String((_f = doc.lineStyle) != null ? _f : "default"),
232
- markerStart: String((_g = doc.markerStart) != null ? _g : "none"),
233
- markerEnd: String((_h = doc.markerEnd) != null ? _h : "arrow"),
174
+ slug: String(doc.slug ?? ""),
175
+ name: String(doc.title ?? ""),
176
+ color: String(doc.color ?? ""),
177
+ strokeWidth: doc.strokeWidth ?? 2,
178
+ animated: doc.animated ?? false,
179
+ lineStyle: String(doc.lineStyle ?? "default"),
180
+ markerStart: String(doc.markerStart ?? "none"),
181
+ markerEnd: String(doc.markerEnd ?? "arrow"),
234
182
  fields: Array.isArray(doc.fields) ? doc.fields : []
235
183
  };
236
184
  }
237
185
  function useFlow(options) {
238
- var _a, _b;
239
186
  const { client, slug, id, enabled = true } = options;
240
187
  const hasIdentifier = !!(slug || id);
241
188
  const flowQuery = (0, import_react_query.useQuery)(
242
- __spreadProps(__spreadValues({}, flowQueryOptions(client, slug, id)), {
189
+ {
190
+ ...flowQueryOptions(client, slug, id),
243
191
  enabled: enabled && hasIdentifier
244
- }),
192
+ },
245
193
  client.queryClient
246
194
  );
247
195
  const nodeTypesQuery = (0, import_react_query.useQuery)(
248
- __spreadProps(__spreadValues({}, nodeTypesQueryOptions(client)), {
196
+ {
197
+ ...nodeTypesQueryOptions(client),
249
198
  enabled
250
- }),
199
+ },
251
200
  client.queryClient
252
201
  );
253
202
  const edgeTypesQuery = (0, import_react_query.useQuery)(
254
- __spreadProps(__spreadValues({}, edgeTypesQueryOptions(client)), {
203
+ {
204
+ ...edgeTypesQueryOptions(client),
255
205
  enabled
256
- }),
206
+ },
257
207
  client.queryClient
258
208
  );
259
209
  const nodeTypeDefs = (0, import_react.useMemo)(() => {
260
- var _a2;
261
- const apiDefs = ((_a2 = nodeTypesQuery.data) != null ? _a2 : []).map(toNodeTypeDef);
210
+ const apiDefs = (nodeTypesQuery.data ?? []).map(toNodeTypeDef);
262
211
  const builtInSlugs = new Set(BUILT_IN_NODE_TYPES.map((t) => t.slug));
263
212
  const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug));
264
213
  return [...BUILT_IN_NODE_TYPES, ...customDefs];
265
214
  }, [nodeTypesQuery.data]);
266
215
  const edgeTypeDefs = (0, import_react.useMemo)(() => {
267
- var _a2;
268
- const apiDefs = ((_a2 = edgeTypesQuery.data) != null ? _a2 : []).map(toEdgeTypeDef);
216
+ const apiDefs = (edgeTypesQuery.data ?? []).map(toEdgeTypeDef);
269
217
  const builtInSlugs = new Set(BUILT_IN_EDGE_TYPES.map((t) => t.slug));
270
218
  const customDefs = apiDefs.filter((d) => !builtInSlugs.has(d.slug));
271
219
  return [...BUILT_IN_EDGE_TYPES, ...customDefs];
272
220
  }, [edgeTypesQuery.data]);
273
221
  const flow = flowQuery.data;
274
- const canvas = flow == null ? void 0 : flow.canvas;
222
+ const canvas = flow?.canvas;
275
223
  return {
276
224
  data: canvas,
277
225
  nodeTypeDefs,
278
226
  edgeTypeDefs,
279
227
  flow,
280
228
  isLoading: flowQuery.isLoading || nodeTypesQuery.isLoading || edgeTypesQuery.isLoading,
281
- error: (_b = (_a = flowQuery.error) != null ? _a : nodeTypesQuery.error) != null ? _b : edgeTypesQuery.error
229
+ error: flowQuery.error ?? nodeTypesQuery.error ?? edgeTypesQuery.error
282
230
  };
283
231
  }
284
232
 
285
233
  // src/ui/Flow/prefetchFlow.ts
286
- function prefetchFlow(options) {
287
- return __async(this, null, function* () {
288
- const { client, slug, id } = options;
289
- if (!slug && !id) {
290
- throw new Error("prefetchFlow requires either slug or id");
291
- }
292
- yield Promise.all([
293
- client.queryClient.prefetchQuery(flowQueryOptions(client, slug, id)),
294
- client.queryClient.prefetchQuery(nodeTypesQueryOptions(client)),
295
- client.queryClient.prefetchQuery(edgeTypesQueryOptions(client))
296
- ]);
297
- });
234
+ async function prefetchFlow(options) {
235
+ const { client, slug, id } = options;
236
+ if (!slug && !id) {
237
+ throw new Error("prefetchFlow requires either slug or id");
238
+ }
239
+ await Promise.all([
240
+ client.queryClient.prefetchQuery(flowQueryOptions(client, slug, id)),
241
+ client.queryClient.prefetchQuery(nodeTypesQueryOptions(client)),
242
+ client.queryClient.prefetchQuery(edgeTypesQueryOptions(client))
243
+ ]);
298
244
  }
299
245
 
300
246
  // src/ui/Flow/useFlowData.ts
@@ -302,21 +248,15 @@ var import_react2 = require("react");
302
248
  function useFlowData(options) {
303
249
  const { data, nodeTypeDefs: inputNodeDefs, edgeTypeDefs: inputEdgeDefs } = options;
304
250
  const nodeTypeDefsMap = (0, import_react2.useMemo)(() => {
305
- const allDefs = inputNodeDefs != null ? inputNodeDefs : BUILT_IN_NODE_TYPES;
251
+ const allDefs = inputNodeDefs ?? BUILT_IN_NODE_TYPES;
306
252
  return new Map(allDefs.map((d) => [d.slug, d]));
307
253
  }, [inputNodeDefs]);
308
254
  const edgeTypeDefsMap = (0, import_react2.useMemo)(() => {
309
- const allDefs = inputEdgeDefs != null ? inputEdgeDefs : BUILT_IN_EDGE_TYPES;
255
+ const allDefs = inputEdgeDefs ?? BUILT_IN_EDGE_TYPES;
310
256
  return new Map(allDefs.map((d) => [d.slug, d]));
311
257
  }, [inputEdgeDefs]);
312
- const nodes = (0, import_react2.useMemo)(() => {
313
- var _a;
314
- return (_a = data == null ? void 0 : data.nodes) != null ? _a : [];
315
- }, [data == null ? void 0 : data.nodes]);
316
- const edges = (0, import_react2.useMemo)(() => {
317
- var _a;
318
- return (_a = data == null ? void 0 : data.edges) != null ? _a : [];
319
- }, [data == null ? void 0 : data.edges]);
258
+ const nodes = (0, import_react2.useMemo)(() => data?.nodes ?? [], [data?.nodes]);
259
+ const edges = (0, import_react2.useMemo)(() => data?.edges ?? [], [data?.edges]);
320
260
  return {
321
261
  nodes,
322
262
  edges,
@@ -327,10 +267,9 @@ function useFlowData(options) {
327
267
 
328
268
  // src/ui/Flow/utils.ts
329
269
  function getNodeSize(node) {
330
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
331
270
  return {
332
- width: (_e = (_d = (_c = (_a = node.style) == null ? void 0 : _a.width) != null ? _c : (_b = node.measured) == null ? void 0 : _b.width) != null ? _d : node.width) != null ? _e : 200,
333
- height: (_j = (_i = (_h = (_f = node.style) == null ? void 0 : _f.height) != null ? _h : (_g = node.measured) == null ? void 0 : _g.height) != null ? _i : node.height) != null ? _j : 200
271
+ width: node.style?.width ?? node.measured?.width ?? node.width ?? 200,
272
+ height: node.style?.height ?? node.measured?.height ?? node.height ?? 200
334
273
  };
335
274
  }
336
275
  function getAbsolutePosition(node, nodeMap) {
@@ -402,13 +341,12 @@ function getFrames(nodes) {
402
341
  if (frames.length === 0) return [];
403
342
  const nodeMap = new Map(nodes.map((n) => [n.id, n]));
404
343
  return frames.map((f) => {
405
- var _a;
406
344
  const data = f.data;
407
345
  const abs = getAbsolutePosition(f, nodeMap);
408
346
  const { width: w, height: h } = getNodeSize(f);
409
347
  return {
410
348
  id: f.id,
411
- label: (_a = data.label) != null ? _a : "",
349
+ label: data.label ?? "",
412
350
  bounds: { x: abs.x, y: abs.y, width: w, height: h }
413
351
  };
414
352
  }).sort((a, b) => a.bounds.y - b.bounds.y || a.bounds.x - b.bounds.x);
@@ -417,13 +355,13 @@ function getFrameData(data, frameId) {
417
355
  const frame = data.nodes.find((n) => n.id === frameId);
418
356
  if (!frame || frame.type !== "frame") return void 0;
419
357
  const descendantIds = collectDescendants(data.nodes, frameId);
420
- const childNodes = data.nodes.filter((n) => descendantIds.has(n.id)).map((n) => __spreadProps(__spreadValues({}, n), { draggable: false }));
358
+ const childNodes = data.nodes.filter((n) => descendantIds.has(n.id)).map((n) => ({ ...n, draggable: false }));
421
359
  const childEdges = data.edges.filter(
422
360
  (e) => descendantIds.has(e.source) && descendantIds.has(e.target)
423
361
  );
424
362
  const frameBounds = getNodeBounds(data.nodes, [frameId]);
425
363
  const { width: w, height: h } = getNodeSize(frame);
426
- const clampBounds = frameBounds != null ? frameBounds : {
364
+ const clampBounds = frameBounds ?? {
427
365
  x: frame.position.x,
428
366
  y: frame.position.y,
429
367
  width: w,
@@ -431,7 +369,7 @@ function getFrameData(data, frameId) {
431
369
  };
432
370
  const contentNodeIds = childNodes.filter((n) => n.id !== frameId).map((n) => n.id);
433
371
  const contentBounds = contentNodeIds.length > 0 ? getNodeBounds(data.nodes, contentNodeIds) : void 0;
434
- const fitBounds = contentBounds != null ? contentBounds : clampBounds;
372
+ const fitBounds = contentBounds ?? clampBounds;
435
373
  return {
436
374
  data: {
437
375
  nodes: childNodes,
@@ -482,6 +420,13 @@ function useQuickJS() {
482
420
  // src/ui/Flow/template-compiler.ts
483
421
  var MAX_CACHE_SIZE = 100;
484
422
  var MAX_MATERIALIZE_DEPTH = 20;
423
+ var IFRAME_BLOCKED_PROPS = /* @__PURE__ */ new Set([
424
+ "srcdoc",
425
+ "allow",
426
+ "allowpaymentrequest",
427
+ "name",
428
+ "sandbox"
429
+ ]);
485
430
  var ALLOWED_ELEMENTS = /* @__PURE__ */ new Set([
486
431
  "div",
487
432
  "span",
@@ -515,7 +460,8 @@ var ALLOWED_ELEMENTS = /* @__PURE__ */ new Set([
515
460
  "path",
516
461
  "g",
517
462
  "circle",
518
- "rect"
463
+ "rect",
464
+ "iframe"
519
465
  ]);
520
466
  var BLOCKED_PATTERNS = [
521
467
  /\bdocument\s*\./,
@@ -595,7 +541,7 @@ function isSafeUrl(value) {
595
541
  try {
596
542
  const url = new URL(value);
597
543
  return url.protocol === "http:" || url.protocol === "https:";
598
- } catch (e) {
544
+ } catch {
599
545
  return false;
600
546
  }
601
547
  }
@@ -627,7 +573,6 @@ function sanitizeStyle(style) {
627
573
  return safe;
628
574
  }
629
575
  function materialize(node, depth = 0) {
630
- var _a;
631
576
  if (depth > MAX_MATERIALIZE_DEPTH) return null;
632
577
  if (node == null) return null;
633
578
  if (typeof node === "string" || typeof node === "number") return node;
@@ -649,7 +594,7 @@ function materialize(node, depth = 0) {
649
594
  );
650
595
  }
651
596
  if (d.$$t === "el") {
652
- const type = String((_a = d.type) != null ? _a : "");
597
+ const type = String(d.type ?? "");
653
598
  const props = d.props && typeof d.props === "object" ? d.props : {};
654
599
  const ch = Array.isArray(d.ch) ? d.ch : [];
655
600
  if (!ALLOWED_ELEMENTS.has(type.toLowerCase())) return null;
@@ -657,6 +602,7 @@ function materialize(node, depth = 0) {
657
602
  for (const [k, v] of Object.entries(props)) {
658
603
  if (k.startsWith("on")) continue;
659
604
  if (k === "dangerouslySetInnerHTML" || k === "ref") continue;
605
+ if (type === "iframe" && IFRAME_BLOCKED_PROPS.has(k)) continue;
660
606
  if ((k === "src" || k === "href") && !isSafeUrl(v)) continue;
661
607
  if (k === "style") {
662
608
  safeProps[k] = sanitizeStyle(v);
@@ -664,6 +610,9 @@ function materialize(node, depth = 0) {
664
610
  }
665
611
  safeProps[k] = v;
666
612
  }
613
+ if (type === "iframe") {
614
+ safeProps["sandbox"] = "allow-scripts allow-same-origin";
615
+ }
667
616
  const children = ch.map((c) => materialize(c, depth + 1));
668
617
  return import_react4.default.createElement(type, safeProps, ...children);
669
618
  }
@@ -697,7 +646,7 @@ function makeRenderer(jsCode) {
697
646
  const raw = vm.dump(callResult.handle);
698
647
  callResult.handle.dispose();
699
648
  return materialize(JSON.parse(String(raw)));
700
- } catch (e) {
649
+ } catch {
701
650
  return null;
702
651
  } finally {
703
652
  vm.dispose();
@@ -706,8 +655,7 @@ function makeRenderer(jsCode) {
706
655
  }
707
656
  function makeReactFC(renderer, qjs) {
708
657
  return function QuickJSTemplateComponent(props) {
709
- var _a;
710
- return (_a = renderer(qjs, props)) != null ? _a : null;
658
+ return renderer(qjs, props) ?? null;
711
659
  };
712
660
  }
713
661
  function compileTemplate(code, slug) {
@@ -731,7 +679,7 @@ function compileTemplate(code, slug) {
731
679
  jsxFragmentPragma: "React.Fragment"
732
680
  });
733
681
  jsCode = result.code;
734
- } catch (e) {
682
+ } catch {
735
683
  return null;
736
684
  }
737
685
  const renderer = makeRenderer(jsCode);
@@ -755,15 +703,15 @@ function sanitizeUrl(url) {
755
703
  const parsed = new URL(url);
756
704
  if (parsed.protocol === "http:" || parsed.protocol === "https:") return url;
757
705
  return void 0;
758
- } catch (e) {
706
+ } catch {
759
707
  return void 0;
760
708
  }
761
709
  }
762
710
  function renderFieldValue(key, val, fieldDef) {
763
711
  if (val == null || val === "") return null;
764
- const fieldType = fieldDef == null ? void 0 : fieldDef.fieldType;
712
+ const fieldType = fieldDef?.fieldType;
765
713
  if (fieldType === "image" || typeof val === "object" && val !== null && "url" in val) {
766
- const imgUrl = typeof val === "string" ? val : val == null ? void 0 : val.url;
714
+ const imgUrl = typeof val === "string" ? val : val?.url;
767
715
  const safeUrl = sanitizeUrl(imgUrl);
768
716
  if (!safeUrl) return null;
769
717
  return /* @__PURE__ */ import_react5.default.createElement(
@@ -876,12 +824,11 @@ function EnhancedDynamicNode({
876
824
  );
877
825
  }
878
826
  function DefaultFrameNode({ data }) {
879
- var _a, _b, _c, _d;
880
827
  const d = data;
881
- const baseColor = (_a = d.color) != null ? _a : "rgb(128,128,128)";
882
- const padding = (_b = d.padding) != null ? _b : 20;
883
- const borderStyle = (_c = d.borderStyle) != null ? _c : "dashed";
884
- const opacity = (_d = d.opacity) != null ? _d : 0.15;
828
+ const baseColor = d.color ?? "rgb(128,128,128)";
829
+ const padding = d.padding ?? 20;
830
+ const borderStyle = d.borderStyle ?? "dashed";
831
+ const opacity = d.opacity ?? 0.15;
885
832
  const bgColor = (() => {
886
833
  const m = baseColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
887
834
  if (m) return `rgba(${m[1]},${m[2]},${m[3]},${opacity})`;
@@ -915,21 +862,21 @@ function DefaultFrameNode({ data }) {
915
862
 
916
863
  // src/ui/Flow/field-helpers.ts
917
864
  function getImageField(fields, name) {
918
- const val = fields == null ? void 0 : fields[name];
865
+ const val = fields?.[name];
919
866
  if (val && typeof val === "object" && val !== null && "url" in val)
920
867
  return val;
921
868
  return void 0;
922
869
  }
923
870
  function getTextField(fields, name) {
924
- const val = fields == null ? void 0 : fields[name];
871
+ const val = fields?.[name];
925
872
  return typeof val === "string" ? val : void 0;
926
873
  }
927
874
  function getNumberField(fields, name) {
928
- const val = fields == null ? void 0 : fields[name];
875
+ const val = fields?.[name];
929
876
  return typeof val === "number" ? val : void 0;
930
877
  }
931
878
  function getBooleanField(fields, name) {
932
- const val = fields == null ? void 0 : fields[name];
879
+ const val = fields?.[name];
933
880
  return typeof val === "boolean" ? val : void 0;
934
881
  }
935
882
 
@@ -947,7 +894,7 @@ function sanitizeCSS(css, scopeClass) {
947
894
  let root;
948
895
  try {
949
896
  root = import_postcss.default.parse(css);
950
- } catch (e) {
897
+ } catch {
951
898
  return "";
952
899
  }
953
900
  const safeScopeClass = scopeClass ? scopeClass.replace(/[{}()[\];,'"\\<>\s]/g, "") : "";
@@ -964,9 +911,8 @@ function sanitizeCSS(css, scopeClass) {
964
911
  if (safeScopeClass && keyframeNameMap.size > 0) {
965
912
  const ANIM_KEYWORDS = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert"]);
966
913
  const replaceAnimName = (token) => {
967
- var _a;
968
914
  const t = token.trim().replace(/^['"]|['"]$/g, "");
969
- return ANIM_KEYWORDS.has(t) ? token : (_a = keyframeNameMap.get(t)) != null ? _a : token;
915
+ return ANIM_KEYWORDS.has(t) ? token : keyframeNameMap.get(t) ?? token;
970
916
  };
971
917
  root.walkDecls(/^animation-name$/i, (node) => {
972
918
  node.value = node.value.split(",").map(replaceAnimName).join(", ");
@@ -1024,7 +970,7 @@ function sanitizeCSS(css, scopeClass) {
1024
970
  return;
1025
971
  }
1026
972
  const parent = rule.parent;
1027
- if ((parent == null ? void 0 : parent.type) === "atrule" && parent.name.toLowerCase() === "keyframes") {
973
+ if (parent?.type === "atrule" && parent.name.toLowerCase() === "keyframes") {
1028
974
  return;
1029
975
  }
1030
976
  rule.selectors = rule.selectors.map((sel) => `.${safeScopeClass} ${sel}`);
@@ -1051,7 +997,7 @@ function getImageSrcSet(image) {
1051
997
  if (sizes) {
1052
998
  for (const size of IMAGE_SIZES) {
1053
999
  const entry = sizes[String(size)];
1054
- if ((entry == null ? void 0 : entry.url) && entry.width) {
1000
+ if (entry?.url && entry.width) {
1055
1001
  parts.push(`${entry.url} ${entry.width}w`);
1056
1002
  }
1057
1003
  }
@@ -1062,11 +1008,10 @@ function getImageSrcSet(image) {
1062
1008
  return parts.join(", ");
1063
1009
  }
1064
1010
  function getImagePlaceholderStyle(image, options) {
1065
- var _a, _b, _c;
1066
- const type = (_a = options == null ? void 0 : options.type) != null ? _a : "blur";
1067
- const paletteColor = (_b = options == null ? void 0 : options.paletteColor) != null ? _b : "muted";
1011
+ const type = options?.type ?? "blur";
1012
+ const paletteColor = options?.paletteColor ?? "muted";
1068
1013
  if (type === "none") return {};
1069
- const color = (_c = image.palette) == null ? void 0 : _c[paletteColor];
1014
+ const color = image.palette?.[paletteColor];
1070
1015
  if (type === "blur") {
1071
1016
  const lqip = image.lqip;
1072
1017
  if (lqip) {
@@ -1105,15 +1050,14 @@ function Image({
1105
1050
  fill = false,
1106
1051
  imageRendering
1107
1052
  }) {
1108
- var _a, _b;
1109
1053
  const [loaded, setLoaded] = (0, import_react6.useState)(false);
1110
1054
  const firedRef = (0, import_react6.useRef)(false);
1111
1055
  const isPixelRendering = imageRendering === "pixelated" || imageRendering === "crisp-edges";
1112
- const placeholder = placeholderProp != null ? placeholderProp : isPixelRendering ? "none" : "blur";
1113
- const loading = priority ? "eager" : loadingProp != null ? loadingProp : "lazy";
1056
+ const placeholder = placeholderProp ?? (isPixelRendering ? "none" : "blur");
1057
+ const loading = priority ? "eager" : loadingProp ?? "lazy";
1114
1058
  const aspectRatio = !fill && image.width && image.height ? `${image.width} / ${image.height}` : void 0;
1115
1059
  const srcSet = getImageSrcSet(image);
1116
- const src = (_a = image.url) != null ? _a : void 0;
1060
+ const src = image.url ?? void 0;
1117
1061
  const hasLqip = placeholder === "blur" && !!image.lqip;
1118
1062
  const placeholderStyle = getImagePlaceholderStyle(image, {
1119
1063
  type: placeholder
@@ -1123,7 +1067,7 @@ function Image({
1123
1067
  if (firedRef.current) return;
1124
1068
  firedRef.current = true;
1125
1069
  setLoaded(true);
1126
- onLoad == null ? void 0 : onLoad();
1070
+ onLoad?.();
1127
1071
  }, [onLoad]);
1128
1072
  const imgRef = (0, import_react6.useCallback)(
1129
1073
  (node) => {
@@ -1133,10 +1077,13 @@ function Image({
1133
1077
  },
1134
1078
  [fireLoad]
1135
1079
  );
1136
- const containerStyle = __spreadValues(__spreadValues(__spreadValues({
1080
+ const containerStyle = {
1137
1081
  position: "relative",
1138
- overflow: "hidden"
1139
- }, fill ? { width: "100%", height: "100%" } : {}), aspectRatio ? { aspectRatio } : {}), style);
1082
+ overflow: "hidden",
1083
+ ...fill ? { width: "100%", height: "100%" } : {},
1084
+ ...aspectRatio ? { aspectRatio } : {},
1085
+ ...style
1086
+ };
1140
1087
  const overlayBase = {
1141
1088
  position: "absolute",
1142
1089
  top: 0,
@@ -1147,41 +1094,44 @@ function Image({
1147
1094
  transition: "opacity 0.3s ease",
1148
1095
  pointerEvents: "none"
1149
1096
  };
1150
- const mainImgStyle = __spreadValues(__spreadProps(__spreadValues({
1097
+ const mainImgStyle = {
1151
1098
  display: "block",
1152
1099
  width: "100%",
1153
1100
  height: "100%",
1154
- objectFit
1155
- }, imageRendering ? { imageRendering } : {}), {
1101
+ objectFit,
1102
+ ...imageRendering ? { imageRendering } : {},
1156
1103
  opacity: loaded ? 1 : 0,
1157
- transition: "opacity 0.3s ease"
1158
- }), imgStyle);
1104
+ transition: "opacity 0.3s ease",
1105
+ ...imgStyle
1106
+ };
1159
1107
  return /* @__PURE__ */ import_react6.default.createElement("div", { className, style: containerStyle }, hasLqip && /* @__PURE__ */ import_react6.default.createElement(
1160
1108
  "img",
1161
1109
  {
1162
1110
  "aria-hidden": true,
1163
1111
  alt: "",
1164
1112
  src: image.lqip,
1165
- style: __spreadProps(__spreadValues({}, overlayBase), {
1113
+ style: {
1114
+ ...overlayBase,
1166
1115
  display: "block",
1167
1116
  objectFit,
1168
1117
  filter: "blur(20px)",
1169
1118
  transform: "scale(1.1)"
1170
- })
1119
+ }
1171
1120
  }
1172
1121
  ), placeholderColor && /* @__PURE__ */ import_react6.default.createElement(
1173
1122
  "div",
1174
1123
  {
1175
1124
  "aria-hidden": true,
1176
- style: __spreadProps(__spreadValues({}, overlayBase), {
1125
+ style: {
1126
+ ...overlayBase,
1177
1127
  backgroundColor: placeholderColor
1178
- })
1128
+ }
1179
1129
  }
1180
1130
  ), /* @__PURE__ */ import_react6.default.createElement(
1181
1131
  "img",
1182
1132
  {
1183
1133
  ref: imgRef,
1184
- alt: (_b = image.alt) != null ? _b : "",
1134
+ alt: image.alt ?? "",
1185
1135
  src,
1186
1136
  srcSet: srcSet || void 0,
1187
1137
  sizes,
@@ -1200,10 +1150,9 @@ function Image({
1200
1150
  function createNodeTypes(nodeRenderers, nodeTypeDefsMap, frameRenderer, nodeWrapper, renderNode) {
1201
1151
  const types = {};
1202
1152
  types.dynamic = ((props) => {
1203
- var _a;
1204
1153
  const d = props.data;
1205
- const typeDef = nodeTypeDefsMap == null ? void 0 : nodeTypeDefsMap.get(d.nodeTypeSlug);
1206
- const CustomRenderer = nodeRenderers == null ? void 0 : nodeRenderers[d.nodeTypeSlug];
1154
+ const typeDef = nodeTypeDefsMap?.get(d.nodeTypeSlug);
1155
+ const CustomRenderer = nodeRenderers?.[d.nodeTypeSlug];
1207
1156
  const defaultRender = typeDef ? /* @__PURE__ */ import_react7.default.createElement(
1208
1157
  EnhancedDynamicNode,
1209
1158
  {
@@ -1212,7 +1161,7 @@ function createNodeTypes(nodeRenderers, nodeTypeDefsMap, frameRenderer, nodeWrap
1212
1161
  width: props.width,
1213
1162
  height: props.height
1214
1163
  }
1215
- ) : /* @__PURE__ */ import_react7.default.createElement(DefaultDynamicNode, __spreadValues({}, props));
1164
+ ) : /* @__PURE__ */ import_react7.default.createElement(DefaultDynamicNode, { ...props });
1216
1165
  const slotProps = {
1217
1166
  id: props.id,
1218
1167
  nodeTypeSlug: d.nodeTypeSlug,
@@ -1226,9 +1175,9 @@ function createNodeTypes(nodeRenderers, nodeTypeDefsMap, frameRenderer, nodeWrap
1226
1175
  };
1227
1176
  let content;
1228
1177
  if (CustomRenderer) {
1229
- content = /* @__PURE__ */ import_react7.default.createElement(CustomRenderer, __spreadValues({}, slotProps));
1178
+ content = /* @__PURE__ */ import_react7.default.createElement(CustomRenderer, { ...slotProps });
1230
1179
  } else if (d.nodeTypeSlug === "image") {
1231
- const imageVal = (_a = d.fields) == null ? void 0 : _a.image;
1180
+ const imageVal = d.fields?.image;
1232
1181
  if (imageVal && typeof imageVal === "object" && "url" in imageVal) {
1233
1182
  content = /* @__PURE__ */ import_react7.default.createElement(
1234
1183
  Image,
@@ -1291,8 +1240,7 @@ function createEdgeTypes(edgeRenderers, edgeTypeDefsMap) {
1291
1240
  const types = {};
1292
1241
  for (const [slug, Renderer] of Object.entries(edgeRenderers)) {
1293
1242
  types[slug] = ((props) => {
1294
- var _a;
1295
- const def = edgeTypeDefsMap == null ? void 0 : edgeTypeDefsMap.get(slug);
1243
+ const def = edgeTypeDefsMap?.get(slug);
1296
1244
  return /* @__PURE__ */ import_react7.default.createElement(
1297
1245
  Renderer,
1298
1246
  {
@@ -1301,7 +1249,7 @@ function createEdgeTypes(edgeRenderers, edgeTypeDefsMap) {
1301
1249
  source: props.source,
1302
1250
  target: props.target,
1303
1251
  label: props.label,
1304
- fields: (_a = props.data) == null ? void 0 : _a.fields,
1252
+ fields: props.data?.fields,
1305
1253
  edgeTypeDef: def,
1306
1254
  style: props.style
1307
1255
  }
@@ -1325,33 +1273,38 @@ var EDGE_TYPE_MAP = {
1325
1273
  default: "default"
1326
1274
  };
1327
1275
  function applyEdgeStyles(edges, edgeTypeDefsMap) {
1328
- if (!(edgeTypeDefsMap == null ? void 0 : edgeTypeDefsMap.size)) return edges;
1276
+ if (!edgeTypeDefsMap?.size) return edges;
1329
1277
  return edges.map((edge) => {
1330
- var _a;
1331
1278
  const slug = edge.edgeTypeSlug;
1332
1279
  if (!slug) return edge;
1333
1280
  const def = edgeTypeDefsMap.get(slug);
1334
1281
  if (!def) return edge;
1335
- const styled = __spreadValues({}, edge);
1282
+ const styled = { ...edge };
1336
1283
  if (!styled.type && def.lineStyle) {
1337
- styled.type = (_a = EDGE_TYPE_MAP[def.lineStyle]) != null ? _a : "default";
1284
+ styled.type = EDGE_TYPE_MAP[def.lineStyle] ?? "default";
1338
1285
  }
1339
- styled.style = __spreadValues(__spreadValues(__spreadValues({}, def.color ? { stroke: def.color } : void 0), def.strokeWidth ? { strokeWidth: def.strokeWidth } : void 0), edge.style);
1286
+ styled.style = {
1287
+ ...def.color ? { stroke: def.color } : void 0,
1288
+ ...def.strokeWidth ? { strokeWidth: def.strokeWidth } : void 0,
1289
+ ...edge.style
1290
+ };
1340
1291
  if (styled.animated == null && def.animated) styled.animated = true;
1341
1292
  if (!styled.markerStart) {
1342
1293
  const startType = toMarkerType(def.markerStart);
1343
1294
  if (startType) {
1344
- styled.markerStart = __spreadValues({
1345
- type: startType
1346
- }, def.color ? { color: def.color } : void 0);
1295
+ styled.markerStart = {
1296
+ type: startType,
1297
+ ...def.color ? { color: def.color } : void 0
1298
+ };
1347
1299
  }
1348
1300
  }
1349
1301
  if (!styled.markerEnd) {
1350
1302
  const endType = toMarkerType(def.markerEnd);
1351
1303
  if (endType) {
1352
- styled.markerEnd = __spreadValues({
1353
- type: endType
1354
- }, def.color ? { color: def.color } : void 0);
1304
+ styled.markerEnd = {
1305
+ type: endType,
1306
+ ...def.color ? { color: def.color } : void 0
1307
+ };
1355
1308
  }
1356
1309
  }
1357
1310
  return styled;
@@ -1426,7 +1379,7 @@ function FocusHandler({
1426
1379
  if (bw === 0 || bh === 0) return;
1427
1380
  const zoomFn = mode === "cover" ? Math.max : Math.min;
1428
1381
  const zoom = zoomFn(containerSize.w / bw, containerSize.h / bh);
1429
- const centerTarget = clampBounds != null ? clampBounds : b;
1382
+ const centerTarget = clampBounds ?? b;
1430
1383
  const cx = centerTarget.x + centerTarget.width / 2;
1431
1384
  const cy = centerTarget.y + centerTarget.height / 2;
1432
1385
  const x = containerSize.w / 2 - cx * zoom;
@@ -1436,9 +1389,9 @@ function FocusHandler({
1436
1389
  containerSize.w / clampBounds.width,
1437
1390
  containerSize.h / clampBounds.height
1438
1391
  );
1439
- store.getState().setMinZoom(Math.max(Math.min(coverZoom, zoom), minZoomProp != null ? minZoomProp : 0));
1392
+ store.getState().setMinZoom(Math.max(Math.min(coverZoom, zoom), minZoomProp ?? 0));
1440
1393
  } else {
1441
- store.getState().setMinZoom(minZoomProp != null ? minZoomProp : 0.5);
1394
+ store.getState().setMinZoom(minZoomProp ?? 0.5);
1442
1395
  }
1443
1396
  let vp = { x, y, zoom };
1444
1397
  if (isInitial || isBoundsChange) {
@@ -1446,12 +1399,12 @@ function FocusHandler({
1446
1399
  if (extent) {
1447
1400
  const visW = containerSize.w / zoom;
1448
1401
  const visH = containerSize.h / zoom;
1449
- onInitialFit == null ? void 0 : onInitialFit([
1402
+ onInitialFit?.([
1450
1403
  [Math.min(extent[0][0], cx - visW / 2), Math.min(extent[0][1], cy - visH / 2)],
1451
1404
  [Math.max(extent[1][0], cx + visW / 2), Math.max(extent[1][1], cy + visH / 2)]
1452
1405
  ]);
1453
1406
  } else {
1454
- onInitialFit == null ? void 0 : onInitialFit();
1407
+ onInitialFit?.();
1455
1408
  }
1456
1409
  } else {
1457
1410
  if (extent) {
@@ -1527,14 +1480,13 @@ function FlowRenderer({
1527
1480
  minZoom: minZoomProp,
1528
1481
  maxZoom: maxZoomProp
1529
1482
  }) {
1530
- var _a, _b;
1531
1483
  const resolvedFrameRenderer = hideFrames ? NullFrameRenderer : frameRenderer;
1532
1484
  const nodeTypeDefsMap = import_react11.default.useMemo(() => {
1533
- if (!(nodeTypeDefs == null ? void 0 : nodeTypeDefs.length)) return void 0;
1485
+ if (!nodeTypeDefs?.length) return void 0;
1534
1486
  return new Map(nodeTypeDefs.map((d) => [d.slug, d]));
1535
1487
  }, [nodeTypeDefs]);
1536
1488
  const edgeTypeDefsMap = import_react11.default.useMemo(() => {
1537
- if (!(edgeTypeDefs == null ? void 0 : edgeTypeDefs.length)) return void 0;
1489
+ if (!edgeTypeDefs?.length) return void 0;
1538
1490
  return new Map(edgeTypeDefs.map((d) => [d.slug, d]));
1539
1491
  }, [edgeTypeDefs]);
1540
1492
  const nodeTypes = import_react11.default.useMemo(
@@ -1552,28 +1504,27 @@ function FlowRenderer({
1552
1504
  [edgeRenderers, edgeTypeDefsMap]
1553
1505
  );
1554
1506
  const mergedCSS = import_react11.default.useMemo(() => {
1555
- if (!(nodeTypeDefs == null ? void 0 : nodeTypeDefs.length)) return "";
1507
+ if (!nodeTypeDefs?.length) return "";
1556
1508
  return nodeTypeDefs.filter((d) => d.customCSS).map((d) => sanitizeCSS(d.customCSS, `flow-node--${d.slug}`)).join("\n");
1557
1509
  }, [nodeTypeDefs]);
1558
1510
  const styledEdges = import_react11.default.useMemo(() => {
1559
- var _a2;
1560
- let edges = applyEdgeStyles((_a2 = data == null ? void 0 : data.edges) != null ? _a2 : [], edgeTypeDefsMap);
1511
+ let edges = applyEdgeStyles(data?.edges ?? [], edgeTypeDefsMap);
1561
1512
  if (edgeRenderers) {
1562
1513
  edges = edges.map((edge) => {
1563
1514
  const slug = edge.edgeTypeSlug;
1564
1515
  if (slug && edgeRenderers[slug]) {
1565
- return __spreadProps(__spreadValues({}, edge), { type: slug });
1516
+ return { ...edge, type: slug };
1566
1517
  }
1567
1518
  return edge;
1568
1519
  });
1569
1520
  }
1570
1521
  return edges;
1571
- }, [data == null ? void 0 : data.edges, edgeTypeDefsMap, edgeRenderers]);
1522
+ }, [data?.edges, edgeTypeDefsMap, edgeRenderers]);
1572
1523
  const translateExtent = import_react11.default.useMemo(() => {
1573
1524
  if (translateExtentProp) return translateExtentProp;
1574
- const es = clampBounds != null ? clampBounds : bounds;
1525
+ const es = clampBounds ?? bounds;
1575
1526
  if (!es) return void 0;
1576
- const ep = clampBounds ? 0 : focusPadding != null ? focusPadding : 0.1;
1527
+ const ep = clampBounds ? 0 : focusPadding ?? 0.1;
1577
1528
  return [
1578
1529
  [es.x - ep * es.width, es.y - ep * es.height],
1579
1530
  [es.x + es.width * (1 + ep), es.y + es.height * (1 + ep)]
@@ -1597,23 +1548,24 @@ function FlowRenderer({
1597
1548
  },
1598
1549
  []
1599
1550
  );
1600
- const activeExtent = !bounds || extentReadyRef.current ? (_a = expandedExtentRef.current) != null ? _a : translateExtent : void 0;
1551
+ const activeExtent = !bounds || extentReadyRef.current ? expandedExtentRef.current ?? translateExtent : void 0;
1601
1552
  if (!data) return null;
1602
- const resolvedDefaultViewport = defaultViewportProp != null ? defaultViewportProp : !fitView && data.viewport ? data.viewport : void 0;
1553
+ const resolvedDefaultViewport = defaultViewportProp ?? (!fitView && data.viewport ? data.viewport : void 0);
1603
1554
  return /* @__PURE__ */ import_react11.default.createElement(import_react12.ReactFlowProvider, null, /* @__PURE__ */ import_react11.default.createElement(
1604
1555
  "div",
1605
1556
  {
1606
1557
  className,
1607
- style: __spreadValues({
1558
+ style: {
1608
1559
  width: "100%",
1609
1560
  height: "100%",
1610
- background: "transparent"
1611
- }, style)
1561
+ background: "transparent",
1562
+ ...style
1563
+ }
1612
1564
  },
1613
1565
  /* @__PURE__ */ import_react11.default.createElement(
1614
1566
  import_react12.ReactFlow,
1615
1567
  {
1616
- nodes: (_b = data.nodes) != null ? _b : [],
1568
+ nodes: data.nodes ?? [],
1617
1569
  edges: styledEdges,
1618
1570
  nodeTypes,
1619
1571
  edgeTypes: customEdgeTypes,
@@ -1653,10 +1605,10 @@ function FlowRenderer({
1653
1605
  FocusHandler,
1654
1606
  {
1655
1607
  bounds,
1656
- padding: focusPadding != null ? focusPadding : 0.1,
1657
- animation: focusAnimation != null ? focusAnimation : true,
1608
+ padding: focusPadding ?? 0.1,
1609
+ animation: focusAnimation ?? true,
1658
1610
  mode: focusMode,
1659
- responsive: responsiveFit != null ? responsiveFit : true,
1611
+ responsive: responsiveFit ?? true,
1660
1612
  extent: translateExtent,
1661
1613
  clampBounds,
1662
1614
  minZoomProp,
@@ -1670,24 +1622,16 @@ function FlowRenderer({
1670
1622
 
1671
1623
  // src/ui/Flow/FlowFrame.tsx
1672
1624
  var import_react13 = __toESM(require("react"), 1);
1673
- function FlowFrame(_a) {
1674
- var _b = _a, {
1675
- client,
1676
- slug,
1677
- id,
1678
- frameId,
1679
- loading = null,
1680
- error: renderError,
1681
- onDataReady
1682
- } = _b, rendererProps = __objRest(_b, [
1683
- "client",
1684
- "slug",
1685
- "id",
1686
- "frameId",
1687
- "loading",
1688
- "error",
1689
- "onDataReady"
1690
- ]);
1625
+ function FlowFrame({
1626
+ client,
1627
+ slug,
1628
+ id,
1629
+ frameId,
1630
+ loading = null,
1631
+ error: renderError,
1632
+ onDataReady,
1633
+ ...rendererProps
1634
+ }) {
1691
1635
  const { data, nodeTypeDefs, edgeTypeDefs, flow, isLoading, error } = useFlow({
1692
1636
  client,
1693
1637
  slug,
@@ -1700,9 +1644,8 @@ function FlowFrame(_a) {
1700
1644
  const onDataReadyRef = (0, import_react13.useRef)(onDataReady);
1701
1645
  onDataReadyRef.current = onDataReady;
1702
1646
  (0, import_react13.useEffect)(() => {
1703
- var _a2;
1704
1647
  if (frameData && flow) {
1705
- (_a2 = onDataReadyRef.current) == null ? void 0 : _a2.call(onDataReadyRef, frameData, flow);
1648
+ onDataReadyRef.current?.(frameData, flow);
1706
1649
  }
1707
1650
  }, [frameData, flow]);
1708
1651
  if (process.env.NODE_ENV !== "production" && !slug && !id) {
@@ -1721,14 +1664,15 @@ function FlowFrame(_a) {
1721
1664
  }
1722
1665
  return /* @__PURE__ */ import_react13.default.createElement(
1723
1666
  FlowRenderer,
1724
- __spreadProps(__spreadValues({}, rendererProps), {
1667
+ {
1668
+ ...rendererProps,
1725
1669
  data: frameData.data,
1726
1670
  nodeTypeDefs,
1727
1671
  edgeTypeDefs,
1728
1672
  bounds: frameData.fitBounds,
1729
1673
  clampBounds: frameData.clampBounds,
1730
1674
  hideFrames: true
1731
- })
1675
+ }
1732
1676
  );
1733
1677
  }
1734
1678
  //# sourceMappingURL=flow.cjs.map