@01.software/sdk 0.33.0 → 0.34.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/README.md +214 -22
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +341 -26
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -6
- package/dist/client.d.ts +7 -6
- package/dist/client.js +341 -26
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-De6eKW1J.d.cts → collection-client-CR2B8c1v.d.cts} +7 -3
- package/dist/{collection-client-B6SlhzIP.d.ts → collection-client-DkREjhQ9.d.ts} +7 -3
- package/dist/{const-sPR2IkCe.d.cts → const-BTvdrXtY.d.cts} +4 -4
- package/dist/{const-DwmSDeWq.d.ts → const-CdqCauHQ.d.ts} +4 -4
- package/dist/index-CjA3U6X3.d.cts +186 -0
- package/dist/index-DK8_NXkh.d.ts +186 -0
- package/dist/index.cjs +1401 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -9
- package/dist/index.d.ts +74 -9
- package/dist/index.js +1401 -176
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-dkeQyrDC.d.cts → payload-types-C7tb7Xbs.d.cts} +208 -52
- package/dist/{payload-types-dkeQyrDC.d.ts → payload-types-C7tb7Xbs.d.ts} +208 -52
- package/dist/query.cjs +194 -35
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +44 -17
- package/dist/query.d.ts +44 -17
- package/dist/query.js +194 -35
- package/dist/query.js.map +1 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js.map +1 -1
- package/dist/{server-CrsPyqEc.d.cts → server-nXOezi4b.d.cts} +22 -6
- package/dist/{server-CrsPyqEc.d.ts → server-nXOezi4b.d.ts} +22 -6
- package/dist/server.cjs +439 -32
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +11 -179
- package/dist/server.d.ts +11 -179
- package/dist/server.js +439 -32
- package/dist/server.js.map +1 -1
- package/dist/{types-Cel_4L9t.d.ts → types-1ylMrCuW.d.ts} +1 -1
- package/dist/{types-B3YT092I.d.cts → types-Bx558PU6.d.cts} +1 -1
- package/dist/{types-BHh0YLmq.d.ts → types-Byo_Rty4.d.ts} +705 -69
- package/dist/{types-BZKxss8Y.d.cts → types-DDhtZI6E.d.cts} +705 -69
- package/dist/ui/canvas/server.cjs +231 -38
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +1 -1
- package/dist/ui/canvas/server.d.ts +1 -1
- package/dist/ui/canvas/server.js +221 -38
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +320 -257
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +5 -19
- package/dist/ui/canvas.d.ts +5 -19
- package/dist/ui/canvas.js +323 -260
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +2 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +20 -179
- package/dist/webhook.d.ts +20 -179
- package/dist/webhook.js +2 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +4 -5
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,19 +17,29 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/ui/Canvas/server.ts
|
|
21
31
|
var server_exports = {};
|
|
22
32
|
__export(server_exports, {
|
|
23
|
-
BUILT_IN_EDGE_TYPES: () => BUILT_IN_EDGE_TYPES,
|
|
24
|
-
BUILT_IN_NODE_TYPES: () => BUILT_IN_NODE_TYPES,
|
|
25
33
|
getFrameData: () => getFrameData,
|
|
26
34
|
getFrames: () => getFrames,
|
|
27
35
|
getNodeBounds: () => getNodeBounds,
|
|
28
36
|
isDynamicNode: () => isDynamicNode,
|
|
29
37
|
isFrameNode: () => isFrameNode,
|
|
30
|
-
prefetchCanvas: () => prefetchCanvas
|
|
38
|
+
prefetchCanvas: () => prefetchCanvas,
|
|
39
|
+
sanitizeCSS: () => sanitizeCSS,
|
|
40
|
+
toEdgeTypeDef: () => toEdgeTypeDef,
|
|
41
|
+
toNodeTypeDef: () => toNodeTypeDef,
|
|
42
|
+
validateTenantCSS: () => validateTenantCSS
|
|
31
43
|
});
|
|
32
44
|
module.exports = __toCommonJS(server_exports);
|
|
33
45
|
|
|
@@ -218,41 +230,222 @@ function isFrameNode(node) {
|
|
|
218
230
|
return node.type === "frame";
|
|
219
231
|
}
|
|
220
232
|
|
|
221
|
-
// src/ui/Canvas/
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
defaultSize: { width: 200, height: 200 },
|
|
236
|
-
fields: [
|
|
237
|
-
{ name: "image", label: "Image", fieldType: "image" },
|
|
238
|
-
{ name: "alt", label: "Alt Text", fieldType: "text" },
|
|
239
|
-
{ name: "caption", label: "Caption", fieldType: "text" }
|
|
240
|
-
]
|
|
241
|
-
}
|
|
233
|
+
// src/ui/Canvas/css-sanitizer.ts
|
|
234
|
+
var import_postcss = __toESM(require("postcss"), 1);
|
|
235
|
+
var ALLOWED_AT_RULES = /* @__PURE__ */ new Set([
|
|
236
|
+
"keyframes",
|
|
237
|
+
"media",
|
|
238
|
+
"supports",
|
|
239
|
+
"container",
|
|
240
|
+
"layer"
|
|
241
|
+
]);
|
|
242
|
+
var BLOCKED_VALUE_PATTERNS = [
|
|
243
|
+
/url\s*\(/i,
|
|
244
|
+
/expression\s*\(/i,
|
|
245
|
+
/paint\s*\(/i,
|
|
246
|
+
/-moz-binding/i
|
|
242
247
|
];
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
markerStart: "none",
|
|
254
|
-
markerEnd: "arrow",
|
|
255
|
-
fields: []
|
|
256
|
-
}
|
|
248
|
+
var DANGEROUS_SELECTOR = /(?:^|[\s,])(?::root|html|body)\b/;
|
|
249
|
+
var BLOCKED_PROPERTY_VALUES = {
|
|
250
|
+
// absolute is allowed — contained by nearest positioned ancestor (node wrapper)
|
|
251
|
+
position: /fixed|sticky/i
|
|
252
|
+
};
|
|
253
|
+
var TENANT_CSS_BLOCKED_PATTERNS = [
|
|
254
|
+
{ pattern: /<\/style/i, label: "</style" },
|
|
255
|
+
{ pattern: /<script/i, label: "<script" },
|
|
256
|
+
{ pattern: /@import/i, label: "@import" },
|
|
257
|
+
{ pattern: /url\s*\(/i, label: "url(" }
|
|
257
258
|
];
|
|
259
|
+
var Z_INDEX_MAX = 9998;
|
|
260
|
+
function normalizeCSSEscapes(value) {
|
|
261
|
+
return value.replace(
|
|
262
|
+
/\\(?:([0-9a-fA-F]{1,6})(?:\r\n|[ \t\r\n\f])?|([^\r\n\f]))/g,
|
|
263
|
+
(match, hex, escaped) => {
|
|
264
|
+
if (hex) {
|
|
265
|
+
const cp = parseInt(hex, 16);
|
|
266
|
+
if (Number.isNaN(cp) || cp > 1114111) return match;
|
|
267
|
+
try {
|
|
268
|
+
return String.fromCodePoint(cp);
|
|
269
|
+
} catch {
|
|
270
|
+
return match;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return escaped ?? match;
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
function sanitizeCSS(css, scopeClass) {
|
|
278
|
+
return sanitizeCSSWithStats(css, scopeClass).css;
|
|
279
|
+
}
|
|
280
|
+
function sanitizeCSSWithStats(css, scopeClass) {
|
|
281
|
+
let root;
|
|
282
|
+
try {
|
|
283
|
+
root = import_postcss.default.parse(css);
|
|
284
|
+
} catch {
|
|
285
|
+
return { css: "", removedRules: 0, removedDecls: 0, removedAtRules: 0 };
|
|
286
|
+
}
|
|
287
|
+
const stats = {
|
|
288
|
+
css: "",
|
|
289
|
+
removedRules: 0,
|
|
290
|
+
removedDecls: 0,
|
|
291
|
+
removedAtRules: 0
|
|
292
|
+
};
|
|
293
|
+
const safeScopeClass = scopeClass ? scopeClass.replace(/[{}()[\];,'"\\<>\s]/g, "") : "";
|
|
294
|
+
const keyframeNameMap = /* @__PURE__ */ new Map();
|
|
295
|
+
if (safeScopeClass) {
|
|
296
|
+
root.walkAtRules(/^keyframes$/i, (node) => {
|
|
297
|
+
const rawName = node.params.trim().replace(/^['"]|['"]$/g, "");
|
|
298
|
+
const originalName = rawName;
|
|
299
|
+
const scopedName = `${safeScopeClass}__${rawName.replace(/\s+/g, "_")}`;
|
|
300
|
+
keyframeNameMap.set(originalName, scopedName);
|
|
301
|
+
node.params = scopedName;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (safeScopeClass && keyframeNameMap.size > 0) {
|
|
305
|
+
const ANIM_KEYWORDS = /* @__PURE__ */ new Set([
|
|
306
|
+
"none",
|
|
307
|
+
"initial",
|
|
308
|
+
"inherit",
|
|
309
|
+
"unset",
|
|
310
|
+
"revert"
|
|
311
|
+
]);
|
|
312
|
+
const replaceAnimName = (token) => {
|
|
313
|
+
const t = token.trim().replace(/^['"]|['"]$/g, "");
|
|
314
|
+
return ANIM_KEYWORDS.has(t) ? token : keyframeNameMap.get(t) ?? token;
|
|
315
|
+
};
|
|
316
|
+
root.walkDecls(/^animation-name$/i, (node) => {
|
|
317
|
+
node.value = node.value.split(",").map(replaceAnimName).join(", ");
|
|
318
|
+
});
|
|
319
|
+
root.walkDecls(/^animation$/i, (node) => {
|
|
320
|
+
node.value = node.value.split(",").map(
|
|
321
|
+
(anim) => anim.split(/(\s+)/).map((token) => /\s/.test(token) ? token : replaceAnimName(token)).join("")
|
|
322
|
+
).join(",");
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
root.walkAtRules((node) => {
|
|
326
|
+
if (!ALLOWED_AT_RULES.has(node.name.toLowerCase())) {
|
|
327
|
+
stats.removedAtRules++;
|
|
328
|
+
node.remove();
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
root.walkDecls((node) => {
|
|
332
|
+
const normalizedValue = normalizeCSSEscapes(
|
|
333
|
+
node.value.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
334
|
+
);
|
|
335
|
+
if (BLOCKED_VALUE_PATTERNS.some((p) => p.test(normalizedValue))) {
|
|
336
|
+
stats.removedDecls++;
|
|
337
|
+
node.remove();
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const propLower = node.prop.toLowerCase();
|
|
341
|
+
const blockedValuePattern = BLOCKED_PROPERTY_VALUES[propLower];
|
|
342
|
+
if (blockedValuePattern) {
|
|
343
|
+
if (blockedValuePattern.test(normalizedValue)) {
|
|
344
|
+
stats.removedDecls++;
|
|
345
|
+
node.remove();
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (propLower === "z-index") {
|
|
350
|
+
const zv = node.value.trim();
|
|
351
|
+
if (zv === "auto" || zv === "initial" || zv === "inherit" || zv === "unset" || zv === "revert") {
|
|
352
|
+
} else {
|
|
353
|
+
const val = parseInt(zv, 10);
|
|
354
|
+
if (isNaN(val) || String(val) !== zv || val > Z_INDEX_MAX) {
|
|
355
|
+
stats.removedDecls++;
|
|
356
|
+
node.remove();
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
root.walkRules((rule) => {
|
|
363
|
+
const safeSelectors = rule.selectors.filter(
|
|
364
|
+
(s) => s.trim() && !DANGEROUS_SELECTOR.test(s)
|
|
365
|
+
);
|
|
366
|
+
if (!safeSelectors.length) {
|
|
367
|
+
stats.removedRules++;
|
|
368
|
+
rule.remove();
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (safeSelectors.length !== rule.selectors.length) {
|
|
372
|
+
stats.removedRules++;
|
|
373
|
+
}
|
|
374
|
+
rule.selectors = safeSelectors;
|
|
375
|
+
if (scopeClass) {
|
|
376
|
+
if (!safeScopeClass) {
|
|
377
|
+
stats.removedRules++;
|
|
378
|
+
rule.remove();
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const parent = rule.parent;
|
|
382
|
+
if (parent?.type === "atrule" && parent.name.toLowerCase() === "keyframes") {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
rule.selectors = rule.selectors.map((sel) => `.${safeScopeClass} ${sel}`);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
stats.css = root.toString().replace(/<\/style/gi, "<\\/style");
|
|
389
|
+
return stats;
|
|
390
|
+
}
|
|
391
|
+
function validateTenantCSS(css) {
|
|
392
|
+
const trimmed = css.trim();
|
|
393
|
+
if (!trimmed) return null;
|
|
394
|
+
const deescapedCSS = normalizeCSSEscapes(css);
|
|
395
|
+
for (const { pattern, label } of TENANT_CSS_BLOCKED_PATTERNS) {
|
|
396
|
+
if (pattern.test(deescapedCSS)) {
|
|
397
|
+
return `CSS contains blocked pattern: ${label}`;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
try {
|
|
401
|
+
import_postcss.default.parse(css);
|
|
402
|
+
} catch {
|
|
403
|
+
return "CSS parse error";
|
|
404
|
+
}
|
|
405
|
+
const sanitized = sanitizeCSSWithStats(
|
|
406
|
+
css,
|
|
407
|
+
"flow-node--tenant-css-validation"
|
|
408
|
+
);
|
|
409
|
+
if (!sanitized.css.trim()) {
|
|
410
|
+
return "CSS must contain safe rules";
|
|
411
|
+
}
|
|
412
|
+
if (sanitized.removedRules > 0 || sanitized.removedDecls > 0 || sanitized.removedAtRules > 0) {
|
|
413
|
+
return "CSS contains unsafe rules or selectors";
|
|
414
|
+
}
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// src/ui/Canvas/catalog-mappers.ts
|
|
419
|
+
function toNodeTypeDef(doc) {
|
|
420
|
+
return {
|
|
421
|
+
slug: String(doc.slug ?? ""),
|
|
422
|
+
name: String(doc.title ?? ""),
|
|
423
|
+
color: String(doc.color ?? "#e5e7eb"),
|
|
424
|
+
defaultSize: doc.defaultSize ?? {
|
|
425
|
+
width: 200,
|
|
426
|
+
height: 200
|
|
427
|
+
},
|
|
428
|
+
fields: Array.isArray(doc.fields) ? doc.fields : [],
|
|
429
|
+
editorIntent: doc.editorIntent === "text" || doc.editorIntent === "image" ? doc.editorIntent : void 0,
|
|
430
|
+
transparentBackground: Boolean(
|
|
431
|
+
doc.hasTransparentBackground ?? doc.transparentBackground
|
|
432
|
+
),
|
|
433
|
+
template: doc.template ?? null,
|
|
434
|
+
customCSS: doc.customCSS ?? null
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function toEdgeTypeDef(doc) {
|
|
438
|
+
return {
|
|
439
|
+
slug: String(doc.slug ?? ""),
|
|
440
|
+
name: String(doc.title ?? ""),
|
|
441
|
+
color: String(doc.color ?? ""),
|
|
442
|
+
strokeWidth: doc.strokeWidth ?? 2,
|
|
443
|
+
animated: doc.isAnimated ?? doc.animated ?? false,
|
|
444
|
+
lineStyle: String(doc.lineStyle ?? "default"),
|
|
445
|
+
markerStart: String(doc.markerStart ?? "none"),
|
|
446
|
+
markerEnd: String(doc.markerEnd ?? "arrow"),
|
|
447
|
+
fields: Array.isArray(doc.fields) ? doc.fields : [],
|
|
448
|
+
isDefaultEdge: Boolean(doc.isDefaultEdge)
|
|
449
|
+
};
|
|
450
|
+
}
|
|
258
451
|
//# sourceMappingURL=server.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/Canvas/server.ts","../../../src/core/query/query-keys.ts","../../../src/ui/Canvas/query-options.ts","../../../src/ui/Canvas/prefetchCanvas.ts","../../../src/ui/Canvas/utils.ts","../../../src/ui/Canvas/types.ts","../../../src/ui/Canvas/built-in-node-types.ts","../../../src/ui/Canvas/built-in-edge-types.ts"],"sourcesContent":["// Server-safe exports (no 'use client' directive).\n// Use `@01.software/sdk/ui/canvas/server` for server components and route loaders.\n\nexport { prefetchCanvas } from './prefetchCanvas'\nexport type { PrefetchCanvasOptions } from './prefetchCanvas'\nexport { getNodeBounds, getFrames, getFrameData } from './utils'\nexport type { FrameData } from './utils'\nexport type {\n CanvasData,\n CanvasNode,\n CanvasEdge,\n CanvasViewport,\n CanvasNodePosition,\n CanvasNodeData,\n DynamicNodeData,\n FrameNodeData,\n CanvasBounds,\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'\n","import type { ServerCollection, ApiQueryOptions } from '../client/types'\nimport type { ProductListingGroupsQueryOptions } from './query-hooks'\n\nexport function collectionKeys<T extends ServerCollection>(collection: T) {\n return {\n all: [collection] as const,\n lists: () => [collection, 'list'] as const,\n list: (options?: ApiQueryOptions) => [collection, 'list', options] as const,\n details: () => [collection, 'detail'] as const,\n detail: (id: string, options?: ApiQueryOptions) =>\n [collection, 'detail', id, options] as const,\n infinites: () => [collection, 'infinite'] as const,\n infinite: (options?: Omit<ApiQueryOptions, 'page'>) =>\n [collection, 'infinite', options] as const,\n }\n}\n\nexport const customerKeys = {\n all: ['customer'] as const,\n me: () => ['customer', 'me'] as const,\n}\n\nexport const productKeys = {\n listingGroups: (options?: ProductListingGroupsQueryOptions) =>\n ['products', 'listing-groups', 'list', options] as const,\n listingGroupsInfinite: (\n options?: Omit<ProductListingGroupsQueryOptions, 'page' | 'limit'>,\n ) =>\n ['products', 'listing-groups', 'infinite', options] as const,\n detail: (params: { slug: string } | { id: string }) =>\n ['products', 'detail', params] as const,\n detailAll: () => ['products', 'detail'] as const,\n}\n","import { collectionKeys } from '../../core/query/query-keys'\nimport type { SDKClient } from './client-types'\n\nexport function canvasQueryOptions(\n client: SDKClient,\n slug?: string,\n id?: string,\n) {\n const identifier = id ?? slug ?? ''\n return {\n queryKey: collectionKeys('canvases').detail(identifier),\n queryFn: async () => {\n if (id) return client.collections.from('canvases').findById(id)\n const result = await client.collections.from('canvases').find({\n where: { slug: { equals: slug } },\n limit: 1,\n })\n const doc = result.docs[0]\n if (!doc) throw new Error(`Canvas not found: ${slug}`)\n return doc\n },\n }\n}\n\nexport function nodeTypesQueryOptions(client: SDKClient) {\n return {\n queryKey: collectionKeys('canvas-node-types').lists(),\n queryFn: async () => {\n // limit: 0 = fetch all documents (Payload CMS convention, disables pagination)\n const result = await client.collections.from('canvas-node-types').find({ limit: 0 })\n return result.docs\n },\n }\n}\n\nexport function edgeTypesQueryOptions(client: SDKClient) {\n return {\n queryKey: collectionKeys('canvas-edge-types').lists(),\n queryFn: async () => {\n const result = await client.collections.from('canvas-edge-types').find({ limit: 0 })\n return result.docs\n },\n }\n}\n","import type { SDKClient } from './client-types'\nimport {\n canvasQueryOptions,\n nodeTypesQueryOptions,\n edgeTypesQueryOptions,\n} from './query-options'\n\ninterface CanvasPrefetchQueryClient {\n prefetchQuery(options: unknown): Promise<unknown>\n}\n\nexport interface PrefetchCanvasOptions {\n /** SDK client instance (Client or ServerClient) */\n client: SDKClient\n /** React Query client to prefetch into. */\n queryClient: CanvasPrefetchQueryClient\n /** Canvas slug (URL-friendly identifier) */\n slug?: string\n /** Canvas document ID (UUID) */\n id?: string\n}\n\n/**\n * Prefetch canvas data into the query cache.\n * Call in route loaders or server components to eliminate loading states on mount.\n *\n * ```ts\n * // React Router loader / Server Component\n * await prefetchCanvas({ client, queryClient, slug: 'Home' })\n * ```\n */\nexport async function prefetchCanvas(\n options: PrefetchCanvasOptions,\n): Promise<void> {\n const { client, queryClient, slug, id } = options\n\n if (!slug && !id) {\n throw new Error('prefetchCanvas requires either slug or id')\n }\n\n await Promise.all([\n queryClient.prefetchQuery(canvasQueryOptions(client, slug, id)),\n queryClient.prefetchQuery(nodeTypesQueryOptions(client)),\n queryClient.prefetchQuery(edgeTypesQueryOptions(client)),\n ])\n}\n","import type { CanvasNode, CanvasEdge, CanvasBounds, CanvasData } from './types'\n\n// ── Shared helpers ──\n\nfunction getNodeSize(node: CanvasNode): { width: number; height: number } {\n const style = node.style as { width?: number; height?: number } | undefined\n\n return {\n width:\n style?.width ??\n node.measured?.width ??\n node.width ??\n 200,\n height:\n style?.height ??\n node.measured?.height ??\n node.height ??\n 200,\n }\n}\n\nfunction getAbsolutePosition(\n node: CanvasNode,\n nodeMap: Map<string, CanvasNode>,\n): { x: number; y: number } {\n let x = node.position.x\n let y = node.position.y\n let current = node\n const visited = new Set<string>([node.id])\n while (current.parentId) {\n const parentId = current.parentId\n if (visited.has(parentId)) break\n const parent = nodeMap.get(parentId)\n if (!parent) break\n visited.add(parent.id)\n x += parent.position.x\n y += parent.position.y\n current = parent\n }\n return { x, y }\n}\n\n/** Collect a node and all its descendants using a pre-built parent→children map (O(N)). */\nfunction collectDescendants(\n nodes: CanvasNode[],\n rootId: string,\n): Set<string> {\n // Build parent → children lookup in O(N)\n const childrenMap = new Map<string, string[]>()\n for (const n of nodes) {\n if (n.parentId) {\n let siblings = childrenMap.get(n.parentId)\n if (!siblings) {\n siblings = []\n childrenMap.set(n.parentId, siblings)\n }\n siblings.push(n.id)\n }\n }\n\n // BFS over children map in O(descendants)\n const result = new Set<string>([rootId])\n const queue = [rootId]\n let i = 0\n while (i < queue.length) {\n const children = childrenMap.get(queue[i++]!)\n if (children) {\n for (const childId of children) {\n if (!result.has(childId)) {\n result.add(childId)\n queue.push(childId)\n }\n }\n }\n }\n return result\n}\n\n// ── Public utilities ──\n\n/**\n * Calculate bounding box for given node IDs.\n * Pure function — usable in SSR, server components, or outside React.\n */\nexport function getNodeBounds(\n nodes: CanvasNode[],\n nodeIds: string[],\n): CanvasBounds | undefined {\n const idSet = new Set(nodeIds)\n const targetNodes = nodes.filter((n) => idSet.has(n.id))\n if (targetNodes.length === 0) return undefined\n\n const nodeMap = new Map(nodes.map((n) => [n.id, n]))\n\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n\n for (const node of targetNodes) {\n const abs = getAbsolutePosition(node, nodeMap)\n const { width: w, height: h } = getNodeSize(node)\n minX = Math.min(minX, abs.x)\n minY = Math.min(minY, abs.y)\n maxX = Math.max(maxX, abs.x + w)\n maxY = Math.max(maxY, abs.y + h)\n }\n\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\n}\n\n/**\n * Get all frame nodes with their bounds.\n * Sorted by position (top-left to bottom-right).\n */\nexport function getFrames(\n nodes: CanvasNode[],\n): Array<{ id: string; label: string; bounds: CanvasBounds }> {\n const frames = nodes.filter((n) => n.type === 'frame')\n if (frames.length === 0) return []\n\n const nodeMap = new Map(nodes.map((n) => [n.id, n]))\n\n return frames\n .map((f) => {\n const data = f.data as { label?: string }\n const abs = getAbsolutePosition(f, nodeMap)\n const { width: w, height: h } = getNodeSize(f)\n return {\n id: f.id,\n label: data.label ?? '',\n bounds: { x: abs.x, y: abs.y, width: w, height: h },\n }\n })\n .sort((a, b) => a.bounds.y - b.bounds.y || a.bounds.x - b.bounds.x)\n}\n\n/** Result of getFrameData — contains filtered canvas + dual bounds. */\nexport interface FrameData {\n /** Canvas data containing only the frame's descendants (nodes have draggable: false). */\n data: CanvasData\n /** Bounding box of child content nodes — use for initial viewport fit (centering). */\n fitBounds: CanvasBounds\n /** Bounding box of the frame itself — use for panning/zoom restriction (clamp). */\n clampBounds: CanvasBounds\n}\n\n/**\n * Extract a frame's descendants and related edges from canvas data.\n * Recursively collects all nested children (supports nested frames).\n * Returns undefined if frameId is not found or is not a frame node.\n *\n * Child nodes are marked `draggable: false` to prevent interfering with canvas panning.\n * The frame node itself is included (use `frameRenderer={() => null}` to hide it).\n *\n * Returns dual bounds:\n * - `fitBounds`: child content bounding box (for centering the viewport)\n * - `clampBounds`: frame area bounding box (for panning restriction)\n */\nexport function getFrameData(\n data: CanvasData,\n frameId: string,\n): FrameData | undefined {\n const frame = data.nodes.find((n) => n.id === frameId)\n if (!frame || frame.type !== 'frame') return undefined\n\n // Recursively collect frame + all descendants\n const descendantIds = collectDescendants(data.nodes, frameId)\n const childNodes = data.nodes\n .filter((n) => descendantIds.has(n.id))\n .map((n) => ({ ...n, draggable: false }))\n\n // Keep only edges where both source and target are within the frame\n const childEdges = data.edges.filter(\n (e: CanvasEdge) => descendantIds.has(e.source) && descendantIds.has(e.target),\n )\n\n // clampBounds: frame's own bounding box (for panning restriction)\n const frameBounds = getNodeBounds(data.nodes, [frameId])\n const { width: w, height: h } = getNodeSize(frame)\n const clampBounds: CanvasBounds = frameBounds ?? {\n x: frame.position.x,\n y: frame.position.y,\n width: w,\n height: h,\n }\n\n // fitBounds: child content bounding box (for centering)\n const contentNodeIds = childNodes\n .filter((n) => n.id !== frameId)\n .map((n) => n.id)\n const contentBounds = contentNodeIds.length > 0\n ? getNodeBounds(data.nodes, contentNodeIds)\n : undefined\n const fitBounds = contentBounds ?? clampBounds\n\n return {\n data: {\n nodes: childNodes,\n edges: childEdges,\n viewport: data.viewport,\n },\n fitBounds,\n clampBounds,\n }\n}\n","export type CanvasStyle = object\n\n// ── Dynamic node data ──\n\nexport interface DynamicNodeData {\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n}\n\nexport type CanvasNodeData = (DynamicNodeData | FrameNodeData) &\n Record<string, unknown>\n\n// ── Canvas types (mirrors @xyflow/react but standalone) ──\n\nexport interface CanvasNodePosition {\n x: number\n y: number\n}\n\nexport interface CanvasNode {\n id: string\n type?: string\n position: CanvasNodePosition\n data: CanvasNodeData\n parentId?: string\n style?: CanvasStyle\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 CanvasEdge {\n id: string\n source: string\n target: string\n sourceHandle?: string | null\n targetHandle?: string | null\n type?: string\n style?: CanvasStyle\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 CanvasViewport {\n x: number\n y: number\n zoom: number\n}\n\nexport interface CanvasData {\n nodes: CanvasNode[]\n edges: CanvasEdge[]\n viewport: CanvasViewport\n}\n\n// ── Node type definitions (mirrors console's NodeTypeDef) ──\n\nexport interface NodeTypeFieldDef {\n name: string\n label: string\n fieldType:\n | 'text'\n | 'textarea'\n | 'number'\n | 'url'\n | 'color'\n | 'image'\n | 'select'\n | '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 template?: string | null\n customCSS?: string | null\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(\n node: CanvasNode,\n): node is CanvasNode & { data: DynamicNodeData } {\n return node.type === 'dynamic'\n}\n\nexport function isFrameNode(\n node: CanvasNode,\n): node is CanvasNode & { 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 /** Whether this node is currently selected */\n selected?: boolean\n /** Measured node width (undefined before first measurement) */\n width?: number\n /** Measured node height (undefined before first measurement) */\n height?: number\n /** The default rendering (template or field-based). Allows custom renderers to wrap/extend instead of replacing entirely. */\n defaultRender?: unknown\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\n// S1: Frame renderer slot\nexport interface FrameNodeSlotProps {\n id: string\n label: string\n color?: string\n padding?: number\n borderStyle?: 'dashed' | 'solid' | 'none'\n opacity?: number\n width?: number\n height?: number\n children?: unknown\n}\n\n// S2: Edge renderer slot\nexport interface EdgeSlotProps {\n id: string\n edgeTypeSlug?: string\n source: string\n target: string\n label?: string\n fields?: Record<string, unknown>\n edgeTypeDef?: EdgeTypeDef\n style?: CanvasStyle\n}\n\n// S3: Node wrapper slot\nexport interface NodeWrapperSlotProps {\n id: string\n nodeTypeSlug: string\n label: string\n selected?: boolean\n nodeTypeDef?: NodeTypeDef\n children: unknown\n}\n\n// S8: Viewport focus\nexport interface CanvasBounds {\n x: number\n y: number\n width: number\n height: 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,SAAS,eAA2C,YAAe;AACxE,SAAO;AAAA,IACL,KAAK,CAAC,UAAU;AAAA,IAChB,OAAO,MAAM,CAAC,YAAY,MAAM;AAAA,IAChC,MAAM,CAAC,YAA8B,CAAC,YAAY,QAAQ,OAAO;AAAA,IACjE,SAAS,MAAM,CAAC,YAAY,QAAQ;AAAA,IACpC,QAAQ,CAAC,IAAY,YACnB,CAAC,YAAY,UAAU,IAAI,OAAO;AAAA,IACpC,WAAW,MAAM,CAAC,YAAY,UAAU;AAAA,IACxC,UAAU,CAAC,YACT,CAAC,YAAY,YAAY,OAAO;AAAA,EACpC;AACF;;;ACZO,SAAS,mBACd,QACA,MACA,IACA;AACA,QAAM,aAAa,MAAM,QAAQ;AACjC,SAAO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AA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,UAAU,KAAK;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AChGO,SAAS,cACd,MACgD;AAChD,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,YACd,MAC8C;AAC9C,SAAO,KAAK,SAAS;AACvB;;;ACrHO,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,IACX,aAAa;AAAA,IACb,WAAW;AAAA,IACX,QAAQ,CAAC;AAAA,EACX;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/Canvas/server.ts","../../../src/core/query/query-keys.ts","../../../src/ui/Canvas/query-options.ts","../../../src/ui/Canvas/prefetchCanvas.ts","../../../src/ui/Canvas/utils.ts","../../../src/ui/Canvas/types.ts","../../../src/ui/Canvas/css-sanitizer.ts","../../../src/ui/Canvas/catalog-mappers.ts"],"sourcesContent":["// Server-safe exports (no 'use client' directive).\n// Use `@01.software/sdk/ui/canvas/server` for server components and route loaders.\n\nexport { prefetchCanvas } from './prefetchCanvas'\nexport type { PrefetchCanvasOptions } from './prefetchCanvas'\nexport { getNodeBounds, getFrames, getFrameData } from './utils'\nexport type { FrameData } from './utils'\nexport type {\n CanvasData,\n CanvasNode,\n CanvasEdge,\n CanvasViewport,\n CanvasNodePosition,\n CanvasNodeData,\n DynamicNodeData,\n FrameNodeData,\n CanvasBounds,\n NodeTypeDef,\n NodeTypeFieldDef,\n EdgeTypeDef,\n} from './types'\nexport { isDynamicNode, isFrameNode } from './types'\nexport { sanitizeCSS, validateTenantCSS } from './css-sanitizer'\nexport { toEdgeTypeDef, toNodeTypeDef } from './catalog-mappers'\n","import type { ServerCollection, ApiQueryOptions } from '../client/types'\nimport type { ProductListingGroupsQueryOptions } from './query-hooks'\n\nexport function collectionKeys<T extends ServerCollection>(collection: T) {\n return {\n all: [collection] as const,\n lists: () => [collection, 'list'] as const,\n list: (options?: ApiQueryOptions) => [collection, 'list', options] as const,\n details: () => [collection, 'detail'] as const,\n detail: (id: string, options?: ApiQueryOptions) =>\n [collection, 'detail', id, options] as const,\n infinites: () => [collection, 'infinite'] as const,\n infinite: (options?: Omit<ApiQueryOptions, 'page'>) =>\n [collection, 'infinite', options] as const,\n }\n}\n\nexport const customerKeys = {\n all: ['customer'] as const,\n me: () => ['customer', 'me'] as const,\n}\n\nexport const productKeys = {\n listingGroups: (options?: ProductListingGroupsQueryOptions) =>\n ['products', 'listing-groups', 'list', options] as const,\n listingGroupsCatalog: (options?: ProductListingGroupsQueryOptions) =>\n ['products', 'listing-groups', 'catalog', options] as const,\n listingGroupsInfinite: (\n options?: Omit<ProductListingGroupsQueryOptions, 'page' | 'limit'>,\n ) =>\n ['products', 'listing-groups', 'infinite', options] as const,\n listingGroupsCatalogInfinite: (\n options?: Omit<ProductListingGroupsQueryOptions, 'page' | 'limit'>,\n ) =>\n ['products', 'listing-groups', 'catalog', 'infinite', options] as const,\n detail: (params: { slug: string } | { id: string }) =>\n ['products', 'detail', params] as const,\n detailAll: () => ['products', 'detail'] as const,\n}\n","import { collectionKeys } from '../../core/query/query-keys'\nimport type { SDKClient } from './client-types'\n\nexport function canvasQueryOptions(\n client: SDKClient,\n slug?: string,\n id?: string,\n) {\n const identifier = id ?? slug ?? ''\n return {\n queryKey: collectionKeys('canvases').detail(identifier),\n queryFn: async () => {\n if (id) return client.collections.from('canvases').findById(id)\n const result = await client.collections.from('canvases').find({\n where: { slug: { equals: slug } },\n limit: 1,\n })\n const doc = result.docs[0]\n if (!doc) throw new Error(`Canvas not found: ${slug}`)\n return doc\n },\n }\n}\n\nexport function nodeTypesQueryOptions(client: SDKClient) {\n return {\n queryKey: collectionKeys('canvas-node-types').lists(),\n queryFn: async () => {\n // limit: 0 = fetch all documents (Payload CMS convention, disables pagination)\n const result = await client.collections.from('canvas-node-types').find({ limit: 0 })\n return result.docs\n },\n }\n}\n\nexport function edgeTypesQueryOptions(client: SDKClient) {\n return {\n queryKey: collectionKeys('canvas-edge-types').lists(),\n queryFn: async () => {\n const result = await client.collections.from('canvas-edge-types').find({ limit: 0 })\n return result.docs\n },\n }\n}\n","import type { SDKClient } from './client-types'\nimport {\n canvasQueryOptions,\n nodeTypesQueryOptions,\n edgeTypesQueryOptions,\n} from './query-options'\n\ninterface CanvasPrefetchQueryClient {\n prefetchQuery(options: unknown): Promise<unknown>\n}\n\nexport interface PrefetchCanvasOptions {\n /** SDK client instance (Client or ServerClient) */\n client: SDKClient\n /** React Query client to prefetch into. */\n queryClient: CanvasPrefetchQueryClient\n /** Canvas slug (URL-friendly identifier) */\n slug?: string\n /** Canvas document ID (UUID) */\n id?: string\n}\n\n/**\n * Prefetch canvas data into the query cache.\n * Call in route loaders or server components to eliminate loading states on mount.\n *\n * ```ts\n * // React Router loader / Server Component\n * await prefetchCanvas({ client, queryClient, slug: 'Home' })\n * ```\n */\nexport async function prefetchCanvas(\n options: PrefetchCanvasOptions,\n): Promise<void> {\n const { client, queryClient, slug, id } = options\n\n if (!slug && !id) {\n throw new Error('prefetchCanvas requires either slug or id')\n }\n\n await Promise.all([\n queryClient.prefetchQuery(canvasQueryOptions(client, slug, id)),\n queryClient.prefetchQuery(nodeTypesQueryOptions(client)),\n queryClient.prefetchQuery(edgeTypesQueryOptions(client)),\n ])\n}\n","import type { CanvasNode, CanvasEdge, CanvasBounds, CanvasData } from './types'\n\n// ── Shared helpers ──\n\nfunction getNodeSize(node: CanvasNode): { width: number; height: number } {\n const style = node.style as { width?: number; height?: number } | undefined\n\n return {\n width:\n style?.width ??\n node.measured?.width ??\n node.width ??\n 200,\n height:\n style?.height ??\n node.measured?.height ??\n node.height ??\n 200,\n }\n}\n\nfunction getAbsolutePosition(\n node: CanvasNode,\n nodeMap: Map<string, CanvasNode>,\n): { x: number; y: number } {\n let x = node.position.x\n let y = node.position.y\n let current = node\n const visited = new Set<string>([node.id])\n while (current.parentId) {\n const parentId = current.parentId\n if (visited.has(parentId)) break\n const parent = nodeMap.get(parentId)\n if (!parent) break\n visited.add(parent.id)\n x += parent.position.x\n y += parent.position.y\n current = parent\n }\n return { x, y }\n}\n\n/** Collect a node and all its descendants using a pre-built parent→children map (O(N)). */\nfunction collectDescendants(\n nodes: CanvasNode[],\n rootId: string,\n): Set<string> {\n // Build parent → children lookup in O(N)\n const childrenMap = new Map<string, string[]>()\n for (const n of nodes) {\n if (n.parentId) {\n let siblings = childrenMap.get(n.parentId)\n if (!siblings) {\n siblings = []\n childrenMap.set(n.parentId, siblings)\n }\n siblings.push(n.id)\n }\n }\n\n // BFS over children map in O(descendants)\n const result = new Set<string>([rootId])\n const queue = [rootId]\n let i = 0\n while (i < queue.length) {\n const children = childrenMap.get(queue[i++]!)\n if (children) {\n for (const childId of children) {\n if (!result.has(childId)) {\n result.add(childId)\n queue.push(childId)\n }\n }\n }\n }\n return result\n}\n\n// ── Public utilities ──\n\n/**\n * Calculate bounding box for given node IDs.\n * Pure function — usable in SSR, server components, or outside React.\n */\nexport function getNodeBounds(\n nodes: CanvasNode[],\n nodeIds: string[],\n): CanvasBounds | undefined {\n const idSet = new Set(nodeIds)\n const targetNodes = nodes.filter((n) => idSet.has(n.id))\n if (targetNodes.length === 0) return undefined\n\n const nodeMap = new Map(nodes.map((n) => [n.id, n]))\n\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n\n for (const node of targetNodes) {\n const abs = getAbsolutePosition(node, nodeMap)\n const { width: w, height: h } = getNodeSize(node)\n minX = Math.min(minX, abs.x)\n minY = Math.min(minY, abs.y)\n maxX = Math.max(maxX, abs.x + w)\n maxY = Math.max(maxY, abs.y + h)\n }\n\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\n}\n\n/**\n * Get all frame nodes with their bounds.\n * Sorted by position (top-left to bottom-right).\n */\nexport function getFrames(\n nodes: CanvasNode[],\n): Array<{ id: string; label: string; bounds: CanvasBounds }> {\n const frames = nodes.filter((n) => n.type === 'frame')\n if (frames.length === 0) return []\n\n const nodeMap = new Map(nodes.map((n) => [n.id, n]))\n\n return frames\n .map((f) => {\n const data = f.data as { label?: string }\n const abs = getAbsolutePosition(f, nodeMap)\n const { width: w, height: h } = getNodeSize(f)\n return {\n id: f.id,\n label: data.label ?? '',\n bounds: { x: abs.x, y: abs.y, width: w, height: h },\n }\n })\n .sort((a, b) => a.bounds.y - b.bounds.y || a.bounds.x - b.bounds.x)\n}\n\n/** Result of getFrameData — contains filtered canvas + dual bounds. */\nexport interface FrameData {\n /** Canvas data containing only the frame's descendants (nodes have draggable: false). */\n data: CanvasData\n /** Bounding box of child content nodes — use for initial viewport fit (centering). */\n fitBounds: CanvasBounds\n /** Bounding box of the frame itself — use for panning/zoom restriction (clamp). */\n clampBounds: CanvasBounds\n}\n\n/**\n * Extract a frame's descendants and related edges from canvas data.\n * Recursively collects all nested children (supports nested frames).\n * Returns undefined if frameId is not found or is not a frame node.\n *\n * Child nodes are marked `draggable: false` to prevent interfering with canvas panning.\n * The frame node itself is included (use `frameRenderer={() => null}` to hide it).\n *\n * Returns dual bounds:\n * - `fitBounds`: child content bounding box (for centering the viewport)\n * - `clampBounds`: frame area bounding box (for panning restriction)\n */\nexport function getFrameData(\n data: CanvasData,\n frameId: string,\n): FrameData | undefined {\n const frame = data.nodes.find((n) => n.id === frameId)\n if (!frame || frame.type !== 'frame') return undefined\n\n // Recursively collect frame + all descendants\n const descendantIds = collectDescendants(data.nodes, frameId)\n const childNodes = data.nodes\n .filter((n) => descendantIds.has(n.id))\n .map((n) => ({ ...n, draggable: false }))\n\n // Keep only edges where both source and target are within the frame\n const childEdges = data.edges.filter(\n (e: CanvasEdge) => descendantIds.has(e.source) && descendantIds.has(e.target),\n )\n\n // clampBounds: frame's own bounding box (for panning restriction)\n const frameBounds = getNodeBounds(data.nodes, [frameId])\n const { width: w, height: h } = getNodeSize(frame)\n const clampBounds: CanvasBounds = frameBounds ?? {\n x: frame.position.x,\n y: frame.position.y,\n width: w,\n height: h,\n }\n\n // fitBounds: child content bounding box (for centering)\n const contentNodeIds = childNodes\n .filter((n) => n.id !== frameId)\n .map((n) => n.id)\n const contentBounds = contentNodeIds.length > 0\n ? getNodeBounds(data.nodes, contentNodeIds)\n : undefined\n const fitBounds = contentBounds ?? clampBounds\n\n return {\n data: {\n nodes: childNodes,\n edges: childEdges,\n viewport: data.viewport,\n },\n fitBounds,\n clampBounds,\n }\n}\n","export type CanvasStyle = object\n\n// ── Dynamic node data ──\n\nexport interface DynamicNodeData {\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n}\n\nexport type CanvasNodeData = (DynamicNodeData | FrameNodeData) &\n Record<string, unknown>\n\n// ── Canvas types (mirrors @xyflow/react but standalone) ──\n\nexport interface CanvasNodePosition {\n x: number\n y: number\n}\n\nexport interface CanvasNode {\n id: string\n type?: string\n position: CanvasNodePosition\n data: CanvasNodeData\n parentId?: string\n style?: CanvasStyle\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 CanvasEdge {\n id: string\n source: string\n target: string\n sourceHandle?: string | null\n targetHandle?: string | null\n type?: string\n style?: CanvasStyle\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 CanvasViewport {\n x: number\n y: number\n zoom: number\n}\n\nexport interface CanvasData {\n nodes: CanvasNode[]\n edges: CanvasEdge[]\n viewport: CanvasViewport\n}\n\n// ── Node type definitions (mirrors console's NodeTypeDef) ──\n\nexport interface NodeTypeFieldDef {\n name: string\n label: string\n fieldType:\n | 'text'\n | 'textarea'\n | 'number'\n | 'url'\n | 'color'\n | 'image'\n | 'date'\n | 'select'\n | '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 editorIntent?: 'text' | 'image'\n transparentBackground?: boolean\n template?: string | null\n customCSS?: string | null\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 isDefaultEdge?: boolean\n}\n\n// ── Type guards ──\n\nexport function isDynamicNode(\n node: CanvasNode,\n): node is CanvasNode & { data: DynamicNodeData } {\n return node.type === 'dynamic'\n}\n\nexport function isFrameNode(\n node: CanvasNode,\n): node is CanvasNode & { 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 /** Whether this node is currently selected */\n selected?: boolean\n /** Measured node width (undefined before first measurement) */\n width?: number\n /** Measured node height (undefined before first measurement) */\n height?: number\n /** The default rendering (template or field-based). Allows custom renderers to wrap/extend instead of replacing entirely. */\n defaultRender?: unknown\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\n// S1: Frame renderer slot\nexport interface FrameNodeSlotProps {\n id: string\n label: string\n color?: string\n padding?: number\n borderStyle?: 'dashed' | 'solid' | 'none'\n opacity?: number\n width?: number\n height?: number\n children?: unknown\n}\n\n// S2: Edge renderer slot\nexport interface EdgeSlotProps {\n id: string\n edgeTypeSlug?: string\n source: string\n target: string\n label?: string\n fields?: Record<string, unknown>\n edgeTypeDef?: EdgeTypeDef\n style?: CanvasStyle\n}\n\n// S3: Node wrapper slot\nexport interface NodeWrapperSlotProps {\n id: string\n nodeTypeSlug: string\n label: string\n selected?: boolean\n nodeTypeDef?: NodeTypeDef\n children: unknown\n}\n\n// S8: Viewport focus\nexport interface CanvasBounds {\n x: number\n y: number\n width: number\n height: number\n}\n","import postcss from 'postcss'\n\nconst ALLOWED_AT_RULES = new Set([\n 'keyframes',\n 'media',\n 'supports',\n 'container',\n 'layer',\n])\nconst BLOCKED_VALUE_PATTERNS = [\n /url\\s*\\(/i,\n /expression\\s*\\(/i,\n /paint\\s*\\(/i,\n /-moz-binding/i,\n]\nconst DANGEROUS_SELECTOR = /(?:^|[\\s,])(?::root|html|body)\\b/\nconst BLOCKED_PROPERTY_VALUES: Record<string, RegExp> = {\n // absolute is allowed — contained by nearest positioned ancestor (node wrapper)\n position: /fixed|sticky/i,\n}\nconst TENANT_CSS_BLOCKED_PATTERNS = [\n { pattern: /<\\/style/i, label: '</style' },\n { pattern: /<script/i, label: '<script' },\n { pattern: /@import/i, label: '@import' },\n { pattern: /url\\s*\\(/i, label: 'url(' },\n] as const\nconst Z_INDEX_MAX = 9998\n\ntype SanitizeCSSStats = {\n css: string\n removedRules: number\n removedDecls: number\n removedAtRules: number\n}\n\nfunction normalizeCSSEscapes(value: string): string {\n return value.replace(\n /\\\\(?:([0-9a-fA-F]{1,6})(?:\\r\\n|[ \\t\\r\\n\\f])?|([^\\r\\n\\f]))/g,\n (match, hex: string | undefined, escaped: string | undefined) => {\n if (hex) {\n const cp = parseInt(hex, 16)\n if (Number.isNaN(cp) || cp > 0x10ffff) return match\n try {\n return String.fromCodePoint(cp)\n } catch {\n return match\n }\n }\n return escaped ?? match\n },\n )\n}\n\n/**\n * Sanitize tenant-authored CSS using PostCSS AST parsing.\n *\n * - At-rules: allowlist only (@keyframes, @media, @supports, @container, @layer)\n * - Declarations: blocks url(), expression(), paint(), -moz-binding\n * - Selectors: removes :root/html/body targets; scopes remainder under scopeClass\n *\n * Returns empty string on parse failure (fail-closed).\n *\n * @param css - Raw CSS string from tenant\n * @param scopeClass - Container class to scope selectors (e.g. 'flow-node--my-type')\n */\nexport function sanitizeCSS(css: string, scopeClass?: string): string {\n return sanitizeCSSWithStats(css, scopeClass).css\n}\n\nfunction sanitizeCSSWithStats(\n css: string,\n scopeClass?: string,\n): SanitizeCSSStats {\n let root: postcss.Root\n try {\n root = postcss.parse(css)\n } catch {\n return { css: '', removedRules: 0, removedDecls: 0, removedAtRules: 0 }\n }\n const stats: SanitizeCSSStats = {\n css: '',\n removedRules: 0,\n removedDecls: 0,\n removedAtRules: 0,\n }\n\n // Compute safe scope class once (strip CSS metacharacters and whitespace)\n const safeScopeClass = scopeClass\n ? scopeClass.replace(/[{}()[\\];,'\"\\\\<>\\s]/g, '')\n : ''\n\n // @keyframes name scoping (skip when no scope)\n const keyframeNameMap = new Map<string, string>()\n if (safeScopeClass) {\n root.walkAtRules(/^keyframes$/i, (node) => {\n // Strip surrounding quotes; replace spaces with underscores for valid identifier output\n // e.g. @keyframes \"fade in\" → flow-node--slug__fade_in\n const rawName = node.params.trim().replace(/^['\"]|['\"]$/g, '')\n const originalName = rawName // keep spaces for map key lookup\n const scopedName = `${safeScopeClass}__${rawName.replace(/\\s+/g, '_')}`\n keyframeNameMap.set(originalName, scopedName)\n node.params = scopedName\n })\n }\n\n // Rewrite animation-name / animation shorthand to use scoped keyframe names\n if (safeScopeClass && keyframeNameMap.size > 0) {\n const ANIM_KEYWORDS = new Set([\n 'none',\n 'initial',\n 'inherit',\n 'unset',\n 'revert',\n ])\n // Strip quotes from token before map lookup (animation-name: 'fade' → look up 'fade')\n const replaceAnimName = (token: string) => {\n const t = token.trim().replace(/^['\"]|['\"]$/g, '')\n return ANIM_KEYWORDS.has(t) ? token : (keyframeNameMap.get(t) ?? token)\n }\n // Use regex filter for case-insensitive match (Animation:, ANIMATION-NAME:)\n root.walkDecls(/^animation-name$/i, (node) => {\n node.value = node.value.split(',').map(replaceAnimName).join(', ')\n })\n root.walkDecls(/^animation$/i, (node) => {\n node.value = node.value\n .split(',')\n .map((anim) =>\n anim\n .split(/(\\s+)/)\n .map((token) => (/\\s/.test(token) ? token : replaceAnimName(token)))\n .join(''),\n )\n .join(',')\n })\n }\n\n // At-rules: remove anything not in the allowlist\n root.walkAtRules((node) => {\n if (!ALLOWED_AT_RULES.has(node.name.toLowerCase())) {\n stats.removedAtRules++\n node.remove()\n }\n })\n\n // Declarations: remove dangerous values\n root.walkDecls((node) => {\n // Normalize value: strip CSS block comments so fi/**/xed → fixed (browser behaviour)\n const normalizedValue = normalizeCSSEscapes(\n node.value.replace(/\\/\\*[\\s\\S]*?\\*\\//g, ''),\n )\n if (BLOCKED_VALUE_PATTERNS.some((p) => p.test(normalizedValue))) {\n stats.removedDecls++\n node.remove()\n return\n }\n // Block dangerous property+value combinations (position: fixed/sticky, oversized z-index)\n const propLower = node.prop.toLowerCase()\n const blockedValuePattern = BLOCKED_PROPERTY_VALUES[propLower]\n if (blockedValuePattern) {\n if (blockedValuePattern.test(normalizedValue)) {\n stats.removedDecls++\n node.remove()\n return\n }\n }\n if (propLower === 'z-index') {\n const zv = node.value.trim()\n // Allow CSS-wide keywords and 'auto'\n if (\n zv === 'auto' ||\n zv === 'initial' ||\n zv === 'inherit' ||\n zv === 'unset' ||\n zv === 'revert'\n ) {\n // pass through\n } else {\n // Only allow plain integers ≤ Z_INDEX_MAX. calc(), var(), and non-integers are removed.\n const val = parseInt(zv, 10)\n if (isNaN(val) || String(val) !== zv || val > Z_INDEX_MAX) {\n stats.removedDecls++\n node.remove()\n return\n }\n }\n }\n })\n\n // Rules: strip dangerous selectors, then scope the rest\n root.walkRules((rule) => {\n const safeSelectors = rule.selectors.filter(\n (s) => s.trim() && !DANGEROUS_SELECTOR.test(s),\n )\n if (!safeSelectors.length) {\n stats.removedRules++\n rule.remove()\n return\n }\n if (safeSelectors.length !== rule.selectors.length) {\n stats.removedRules++\n }\n rule.selectors = safeSelectors\n if (scopeClass) {\n if (!safeScopeClass) {\n stats.removedRules++\n rule.remove()\n return\n }\n // Skip scoping inside @keyframes — from/to/0% are not element selectors\n const parent = rule.parent\n if (\n parent?.type === 'atrule' &&\n (parent as postcss.AtRule).name.toLowerCase() === 'keyframes'\n ) {\n return\n }\n rule.selectors = rule.selectors.map((sel) => `.${safeScopeClass} ${sel}`)\n }\n })\n\n // Post-process: escape </style to prevent HTML parser closing the style tag in SSR contexts.\n // postcss parses this as valid CSS string content and reproduces it verbatim.\n stats.css = root.toString().replace(/<\\/style/gi, '<\\\\/style')\n return stats\n}\n\nexport function validateTenantCSS(css: string): string | null {\n const trimmed = css.trim()\n if (!trimmed) return null\n\n const deescapedCSS = normalizeCSSEscapes(css)\n for (const { pattern, label } of TENANT_CSS_BLOCKED_PATTERNS) {\n if (pattern.test(deescapedCSS)) {\n return `CSS contains blocked pattern: ${label}`\n }\n }\n\n try {\n postcss.parse(css)\n } catch {\n return 'CSS parse error'\n }\n\n const sanitized = sanitizeCSSWithStats(\n css,\n 'flow-node--tenant-css-validation',\n )\n if (!sanitized.css.trim()) {\n return 'CSS must contain safe rules'\n }\n if (\n sanitized.removedRules > 0 ||\n sanitized.removedDecls > 0 ||\n sanitized.removedAtRules > 0\n ) {\n return 'CSS contains unsafe rules or selectors'\n }\n\n return null\n}\n","import type { EdgeTypeDef, NodeTypeDef } from './types'\n\nexport function 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']) ?? {\n width: 200,\n height: 200,\n },\n fields: Array.isArray(doc.fields)\n ? (doc.fields as NodeTypeDef['fields'])\n : [],\n editorIntent:\n doc.editorIntent === 'text' || doc.editorIntent === 'image'\n ? doc.editorIntent\n : undefined,\n transparentBackground: Boolean(\n doc.hasTransparentBackground ?? doc.transparentBackground,\n ),\n template: (doc.template as string) ?? null,\n customCSS: (doc.customCSS as string) ?? null,\n }\n}\n\nexport function 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:\n (doc.isAnimated as boolean | undefined) ??\n (doc.animated as boolean | undefined) ??\n 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 isDefaultEdge: Boolean(doc.isDefaultEdge),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,SAAS,eAA2C,YAAe;AACxE,SAAO;AAAA,IACL,KAAK,CAAC,UAAU;AAAA,IAChB,OAAO,MAAM,CAAC,YAAY,MAAM;AAAA,IAChC,MAAM,CAAC,YAA8B,CAAC,YAAY,QAAQ,OAAO;AAAA,IACjE,SAAS,MAAM,CAAC,YAAY,QAAQ;AAAA,IACpC,QAAQ,CAAC,IAAY,YACnB,CAA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M,OAAO,IAAI,QAAQ,EAAE;AAAA,IAC3B,MAAM,OAAO,IAAI,SAAS,EAAE;AAAA,IAC5B,OAAO,OAAO,IAAI,SAAS,SAAS;AAAA,IACpC,aAAc,IAAI,eAA8C;AAAA,MAC9D,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IACA,QAAQ,MAAM,QAAQ,IAAI,MAAM,IAC3B,IAAI,SACL,CAAC;AAAA,IACL,cACE,IAAI,iBAAiB,UAAU,IAAI,iBAAiB,UAChD,IAAI,eACJ;AAAA,IACN,uBAAuB;AAAA,MACrB,IAAI,4BAA4B,IAAI;AAAA,IACtC;AAAA,IACA,UAAW,IAAI,YAAuB;AAAA,IACtC,WAAY,IAAI,aAAwB;AAAA,EAC1C;AACF;AAEO,SAAS,cAAc,KAA2C;AACvE,SAAO;AAAA,IACL,MAAM,OAAO,IAAI,QAAQ,EAAE;AAAA,IAC3B,MAAM,OAAO,IAAI,SAAS,EAAE;AAAA,IAC5B,OAAO,OAAO,IAAI,SAAS,EAAE;AAAA,IAC7B,aAAc,IAAI,eAA0B;AAAA,IAC5C,UACG,IAAI,cACJ,IAAI,YACL;AAAA,IACF,WAAW,OAAO,IAAI,aAAa,SAAS;AAAA,IAC5C,aAAa,OAAO,IAAI,eAAe,MAAM;AAAA,IAC7C,WAAW,OAAO,IAAI,aAAa,OAAO;AAAA,IAC1C,QAAQ,MAAM,QAAQ,IAAI,MAAM,IAC3B,IAAI,SACL,CAAC;AAAA,IACL,eAAe,QAAQ,IAAI,aAAa;AAAA,EAC1C;AACF;","names":["postcss"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { g as CanvasBounds, C as CanvasData, c as CanvasEdge, a as CanvasNode, i as CanvasNodeData, j as CanvasNodePosition, f as CanvasViewport, k as DynamicNodeData, E as EdgeTypeDef, h as FrameData, l as FrameNodeData, N as NodeTypeDef, b as NodeTypeFieldDef, P as PrefetchCanvasOptions, m as getFrameData, n as getFrames, o as getNodeBounds, p as isDynamicNode, q as isFrameNode, r as prefetchCanvas, s as sanitizeCSS, t as toEdgeTypeDef, u as toNodeTypeDef, v as validateTenantCSS } from '../../server-nXOezi4b.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { g as CanvasBounds, C as CanvasData, c as CanvasEdge, a as CanvasNode, i as CanvasNodeData, j as CanvasNodePosition, f as CanvasViewport, k as DynamicNodeData, E as EdgeTypeDef, h as FrameData, l as FrameNodeData, N as NodeTypeDef, b as NodeTypeFieldDef, P as PrefetchCanvasOptions, m as getFrameData, n as getFrames, o as getNodeBounds, p as isDynamicNode, q as isFrameNode, r as prefetchCanvas, s as sanitizeCSS, t as toEdgeTypeDef, u as toNodeTypeDef, v as validateTenantCSS } from '../../server-nXOezi4b.js';
|