@01.software/sdk 0.4.3-dev.260324.6dc30aa → 0.5.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 +13 -13
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.js +1 -1
- package/dist/realtime.js.map +1 -1
- package/dist/server-B80o7igg.d.cts +242 -0
- package/dist/server-B80o7igg.d.ts +242 -0
- package/dist/ui/flow/server.cjs +233 -0
- package/dist/ui/flow/server.cjs.map +1 -0
- package/dist/ui/flow/server.d.cts +3 -0
- package/dist/ui/flow/server.d.ts +3 -0
- package/dist/ui/flow/server.js +213 -0
- package/dist/ui/flow/server.js.map +1 -0
- package/dist/ui/flow.cjs +302 -139
- package/dist/ui/flow.cjs.map +1 -1
- package/dist/ui/flow.d.cts +20 -215
- package/dist/ui/flow.d.ts +20 -215
- package/dist/ui/flow.js +306 -147
- package/dist/ui/flow.js.map +1 -1
- package/package.json +12 -8
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface DynamicNodeData {
|
|
5
|
+
nodeTypeSlug: string;
|
|
6
|
+
label: string;
|
|
7
|
+
fields: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
type FlowNodeData = (DynamicNodeData | FrameNodeData) & Record<string, unknown>;
|
|
10
|
+
interface FlowNodePosition {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
interface FlowNode {
|
|
15
|
+
id: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
position: FlowNodePosition;
|
|
18
|
+
data: FlowNodeData;
|
|
19
|
+
parentId?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
measured?: {
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
};
|
|
27
|
+
draggable?: boolean;
|
|
28
|
+
selectable?: boolean;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
interface FlowEdge {
|
|
32
|
+
id: string;
|
|
33
|
+
source: string;
|
|
34
|
+
target: string;
|
|
35
|
+
sourceHandle?: string | null;
|
|
36
|
+
targetHandle?: string | null;
|
|
37
|
+
type?: string;
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
animated?: boolean;
|
|
40
|
+
markerStart?: unknown;
|
|
41
|
+
markerEnd?: unknown;
|
|
42
|
+
edgeTypeSlug?: string;
|
|
43
|
+
fields?: Record<string, unknown>;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
interface FlowViewport {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
zoom: number;
|
|
50
|
+
}
|
|
51
|
+
interface CanvasData {
|
|
52
|
+
nodes: FlowNode[];
|
|
53
|
+
edges: FlowEdge[];
|
|
54
|
+
viewport: FlowViewport;
|
|
55
|
+
}
|
|
56
|
+
interface NodeTypeFieldDef {
|
|
57
|
+
name: string;
|
|
58
|
+
label: string;
|
|
59
|
+
fieldType: 'text' | 'textarea' | 'number' | 'url' | 'color' | 'image' | 'select' | 'toggle';
|
|
60
|
+
options?: {
|
|
61
|
+
label: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}[];
|
|
64
|
+
defaultValue?: string;
|
|
65
|
+
required?: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface NodeTypeDef {
|
|
68
|
+
slug: string;
|
|
69
|
+
name: string;
|
|
70
|
+
color: string;
|
|
71
|
+
defaultSize: {
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
};
|
|
75
|
+
fields: NodeTypeFieldDef[];
|
|
76
|
+
transparentBackground?: boolean;
|
|
77
|
+
template?: string | null;
|
|
78
|
+
customCSS?: string | null;
|
|
79
|
+
}
|
|
80
|
+
interface EdgeTypeDef {
|
|
81
|
+
slug: string;
|
|
82
|
+
name: string;
|
|
83
|
+
color: string;
|
|
84
|
+
strokeWidth: number;
|
|
85
|
+
animated: boolean;
|
|
86
|
+
lineStyle: string;
|
|
87
|
+
markerStart: string;
|
|
88
|
+
markerEnd: string;
|
|
89
|
+
fields: NodeTypeFieldDef[];
|
|
90
|
+
}
|
|
91
|
+
declare function isDynamicNode(node: FlowNode): node is FlowNode & {
|
|
92
|
+
data: DynamicNodeData;
|
|
93
|
+
};
|
|
94
|
+
declare function isFrameNode(node: FlowNode): node is FlowNode & {
|
|
95
|
+
data: FrameNodeData;
|
|
96
|
+
};
|
|
97
|
+
interface DynamicNodeSlotProps {
|
|
98
|
+
id: string;
|
|
99
|
+
nodeTypeSlug: string;
|
|
100
|
+
label: string;
|
|
101
|
+
fields: Record<string, unknown>;
|
|
102
|
+
nodeTypeDef?: NodeTypeDef;
|
|
103
|
+
/** Whether this node is currently selected */
|
|
104
|
+
selected?: boolean;
|
|
105
|
+
/** Measured node width (undefined before first measurement) */
|
|
106
|
+
width?: number;
|
|
107
|
+
/** Measured node height (undefined before first measurement) */
|
|
108
|
+
height?: number;
|
|
109
|
+
/** The default rendering (template or field-based). Allows custom renderers to wrap/extend instead of replacing entirely. */
|
|
110
|
+
defaultRender?: React.ReactElement;
|
|
111
|
+
}
|
|
112
|
+
interface FrameNodeData {
|
|
113
|
+
label: string;
|
|
114
|
+
color?: string;
|
|
115
|
+
padding?: number;
|
|
116
|
+
borderStyle?: 'dashed' | 'solid' | 'none';
|
|
117
|
+
opacity?: number;
|
|
118
|
+
}
|
|
119
|
+
interface FrameNodeSlotProps {
|
|
120
|
+
id: string;
|
|
121
|
+
label: string;
|
|
122
|
+
color?: string;
|
|
123
|
+
padding?: number;
|
|
124
|
+
borderStyle?: 'dashed' | 'solid' | 'none';
|
|
125
|
+
opacity?: number;
|
|
126
|
+
width?: number;
|
|
127
|
+
height?: number;
|
|
128
|
+
children?: React.ReactNode;
|
|
129
|
+
}
|
|
130
|
+
interface EdgeSlotProps {
|
|
131
|
+
id: string;
|
|
132
|
+
edgeTypeSlug?: string;
|
|
133
|
+
source: string;
|
|
134
|
+
target: string;
|
|
135
|
+
label?: string;
|
|
136
|
+
fields?: Record<string, unknown>;
|
|
137
|
+
edgeTypeDef?: EdgeTypeDef;
|
|
138
|
+
style?: React.CSSProperties;
|
|
139
|
+
}
|
|
140
|
+
interface NodeWrapperSlotProps {
|
|
141
|
+
id: string;
|
|
142
|
+
nodeTypeSlug: string;
|
|
143
|
+
label: string;
|
|
144
|
+
selected?: boolean;
|
|
145
|
+
nodeTypeDef?: NodeTypeDef;
|
|
146
|
+
children: React.ReactNode;
|
|
147
|
+
}
|
|
148
|
+
interface FlowBounds {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type FlowCollection = 'flows' | 'flow-node-types' | 'flow-edge-types';
|
|
156
|
+
type AnyFn = (...args: any[]) => any;
|
|
157
|
+
interface SDKClient {
|
|
158
|
+
from(collection: FlowCollection): {
|
|
159
|
+
find: AnyFn;
|
|
160
|
+
findById: AnyFn;
|
|
161
|
+
};
|
|
162
|
+
queryClient: QueryClient;
|
|
163
|
+
}
|
|
164
|
+
interface UseFlowOptions {
|
|
165
|
+
/** SDK client instance (Client or ServerClient) */
|
|
166
|
+
client: SDKClient;
|
|
167
|
+
/** Flow slug (URL-friendly identifier) */
|
|
168
|
+
slug?: string;
|
|
169
|
+
/** Flow document ID (UUID) */
|
|
170
|
+
id?: string;
|
|
171
|
+
/** Enable/disable data fetching (default: true) */
|
|
172
|
+
enabled?: boolean;
|
|
173
|
+
}
|
|
174
|
+
interface UseFlowResult {
|
|
175
|
+
data: CanvasData | undefined;
|
|
176
|
+
nodeTypeDefs: NodeTypeDef[];
|
|
177
|
+
edgeTypeDefs: EdgeTypeDef[];
|
|
178
|
+
flow: Record<string, unknown> | undefined;
|
|
179
|
+
isLoading: boolean;
|
|
180
|
+
error: Error | null;
|
|
181
|
+
}
|
|
182
|
+
declare function useFlow(options: UseFlowOptions): UseFlowResult;
|
|
183
|
+
|
|
184
|
+
interface PrefetchFlowOptions {
|
|
185
|
+
/** SDK client instance (Client or ServerClient) */
|
|
186
|
+
client: SDKClient;
|
|
187
|
+
/** Flow slug (URL-friendly identifier) */
|
|
188
|
+
slug?: string;
|
|
189
|
+
/** Flow document ID (UUID) */
|
|
190
|
+
id?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Prefetch flow data into the query cache.
|
|
194
|
+
* Call in route loaders or server components to eliminate loading states on mount.
|
|
195
|
+
*
|
|
196
|
+
* ```ts
|
|
197
|
+
* // React Router loader / Server Component
|
|
198
|
+
* await prefetchFlow({ client, slug: 'Home' })
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare function prefetchFlow(options: PrefetchFlowOptions): Promise<void>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Calculate bounding box for given node IDs.
|
|
205
|
+
* Pure function — usable in SSR, server components, or outside React.
|
|
206
|
+
*/
|
|
207
|
+
declare function getNodeBounds(nodes: FlowNode[], nodeIds: string[]): FlowBounds | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Get all frame nodes with their bounds.
|
|
210
|
+
* Sorted by position (top-left to bottom-right).
|
|
211
|
+
*/
|
|
212
|
+
declare function getFrames(nodes: FlowNode[]): Array<{
|
|
213
|
+
id: string;
|
|
214
|
+
label: string;
|
|
215
|
+
bounds: FlowBounds;
|
|
216
|
+
}>;
|
|
217
|
+
/** Result of getFrameData — contains filtered canvas + dual bounds. */
|
|
218
|
+
interface FrameData {
|
|
219
|
+
/** Canvas data containing only the frame's descendants (nodes have draggable: false). */
|
|
220
|
+
data: CanvasData;
|
|
221
|
+
/** Bounding box of child content nodes — use for initial viewport fit (centering). */
|
|
222
|
+
fitBounds: FlowBounds;
|
|
223
|
+
/** Bounding box of the frame itself — use for panning/zoom restriction (clamp). */
|
|
224
|
+
clampBounds: FlowBounds;
|
|
225
|
+
/** @deprecated Use fitBounds instead. Alias for clampBounds for backward compatibility. */
|
|
226
|
+
bounds: FlowBounds;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Extract a frame's descendants and related edges from canvas data.
|
|
230
|
+
* Recursively collects all nested children (supports nested frames).
|
|
231
|
+
* Returns undefined if frameId is not found or is not a frame node.
|
|
232
|
+
*
|
|
233
|
+
* Child nodes are marked `draggable: false` to prevent interfering with canvas panning.
|
|
234
|
+
* The frame node itself is included (use `frameRenderer={() => null}` to hide it).
|
|
235
|
+
*
|
|
236
|
+
* Returns dual bounds:
|
|
237
|
+
* - `fitBounds`: child content bounding box (for centering the viewport)
|
|
238
|
+
* - `clampBounds`: frame area bounding box (for panning restriction)
|
|
239
|
+
*/
|
|
240
|
+
declare function getFrameData(data: CanvasData, frameId: string): FrameData | undefined;
|
|
241
|
+
|
|
242
|
+
export { type CanvasData as C, type DynamicNodeSlotProps as D, type EdgeTypeDef as E, type FlowNode as F, type NodeTypeDef as N, type PrefetchFlowOptions as P, type SDKClient as S, type UseFlowOptions as U, type FlowEdge as a, type FrameNodeSlotProps as b, type EdgeSlotProps as c, type NodeWrapperSlotProps as d, type FlowViewport as e, type FlowBounds as f, type FlowNodePosition as g, type FlowNodeData as h, type DynamicNodeData as i, type FrameNodeData as j, type NodeTypeFieldDef as k, isDynamicNode as l, isFrameNode as m, type UseFlowResult as n, getNodeBounds as o, prefetchFlow as p, getFrames as q, getFrameData as r, type FrameData as s, useFlow as u };
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
var __async = (__this, __arguments, generator) => {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
var fulfilled = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var rejected = (value) => {
|
|
46
|
+
try {
|
|
47
|
+
step(generator.throw(value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/ui/Flow/server.ts
|
|
58
|
+
var server_exports = {};
|
|
59
|
+
__export(server_exports, {
|
|
60
|
+
getFrameData: () => getFrameData,
|
|
61
|
+
getFrames: () => getFrames,
|
|
62
|
+
getNodeBounds: () => getNodeBounds,
|
|
63
|
+
isDynamicNode: () => isDynamicNode,
|
|
64
|
+
isFrameNode: () => isFrameNode,
|
|
65
|
+
prefetchFlow: () => prefetchFlow
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(server_exports);
|
|
68
|
+
|
|
69
|
+
// src/core/query/query-keys.ts
|
|
70
|
+
function collectionKeys(collection) {
|
|
71
|
+
return {
|
|
72
|
+
all: [collection],
|
|
73
|
+
lists: () => [collection, "list"],
|
|
74
|
+
list: (options) => [collection, "list", options],
|
|
75
|
+
details: () => [collection, "detail"],
|
|
76
|
+
detail: (id, options) => [collection, "detail", id, options],
|
|
77
|
+
infinites: () => [collection, "infinite"],
|
|
78
|
+
infinite: (options) => [collection, "infinite", options]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/ui/Flow/prefetchFlow.ts
|
|
83
|
+
function prefetchFlow(options) {
|
|
84
|
+
return __async(this, null, function* () {
|
|
85
|
+
var _a;
|
|
86
|
+
const { client, slug, id } = options;
|
|
87
|
+
const identifier = (_a = id != null ? id : slug) != null ? _a : "";
|
|
88
|
+
yield Promise.all([
|
|
89
|
+
client.queryClient.prefetchQuery({
|
|
90
|
+
queryKey: collectionKeys("flows").detail(identifier),
|
|
91
|
+
queryFn: () => __async(null, null, function* () {
|
|
92
|
+
if (id) return client.from("flows").findById(id);
|
|
93
|
+
const result = yield client.from("flows").find({
|
|
94
|
+
where: { slug: { equals: slug } },
|
|
95
|
+
limit: 1
|
|
96
|
+
});
|
|
97
|
+
const doc = result.docs[0];
|
|
98
|
+
if (!doc) throw new Error(`Flow not found: ${slug}`);
|
|
99
|
+
return doc;
|
|
100
|
+
})
|
|
101
|
+
}),
|
|
102
|
+
client.queryClient.prefetchQuery({
|
|
103
|
+
queryKey: collectionKeys("flow-node-types").lists(),
|
|
104
|
+
queryFn: () => __async(null, null, function* () {
|
|
105
|
+
const result = yield client.from("flow-node-types").find({ limit: 100 });
|
|
106
|
+
return result.docs;
|
|
107
|
+
})
|
|
108
|
+
}),
|
|
109
|
+
client.queryClient.prefetchQuery({
|
|
110
|
+
queryKey: collectionKeys("flow-edge-types").lists(),
|
|
111
|
+
queryFn: () => __async(null, null, function* () {
|
|
112
|
+
const result = yield client.from("flow-edge-types").find({ limit: 100 });
|
|
113
|
+
return result.docs;
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
]);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/ui/Flow/utils.ts
|
|
121
|
+
function getNodeSize(node) {
|
|
122
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
123
|
+
return {
|
|
124
|
+
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,
|
|
125
|
+
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
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function getAbsolutePosition(node, nodeMap) {
|
|
129
|
+
let x = node.position.x;
|
|
130
|
+
let y = node.position.y;
|
|
131
|
+
let current = node;
|
|
132
|
+
const visited = /* @__PURE__ */ new Set([node.id]);
|
|
133
|
+
while (current.parentId) {
|
|
134
|
+
const parentId = current.parentId;
|
|
135
|
+
if (visited.has(parentId)) break;
|
|
136
|
+
const parent = nodeMap.get(parentId);
|
|
137
|
+
if (!parent) break;
|
|
138
|
+
visited.add(parent.id);
|
|
139
|
+
x += parent.position.x;
|
|
140
|
+
y += parent.position.y;
|
|
141
|
+
current = parent;
|
|
142
|
+
}
|
|
143
|
+
return { x, y };
|
|
144
|
+
}
|
|
145
|
+
function collectDescendants(nodes, rootId) {
|
|
146
|
+
const result = /* @__PURE__ */ new Set([rootId]);
|
|
147
|
+
const queue = [rootId];
|
|
148
|
+
let i = 0;
|
|
149
|
+
while (i < queue.length) {
|
|
150
|
+
const current = queue[i++];
|
|
151
|
+
for (const n of nodes) {
|
|
152
|
+
if (n.parentId === current && !result.has(n.id)) {
|
|
153
|
+
result.add(n.id);
|
|
154
|
+
queue.push(n.id);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
function getNodeBounds(nodes, nodeIds) {
|
|
161
|
+
const idSet = new Set(nodeIds);
|
|
162
|
+
const targetNodes = nodes.filter((n) => idSet.has(n.id));
|
|
163
|
+
if (targetNodes.length === 0) return void 0;
|
|
164
|
+
const nodeMap = new Map(nodes.map((n) => [n.id, n]));
|
|
165
|
+
let minX = Infinity;
|
|
166
|
+
let minY = Infinity;
|
|
167
|
+
let maxX = -Infinity;
|
|
168
|
+
let maxY = -Infinity;
|
|
169
|
+
for (const node of targetNodes) {
|
|
170
|
+
const abs = getAbsolutePosition(node, nodeMap);
|
|
171
|
+
const { width: w, height: h } = getNodeSize(node);
|
|
172
|
+
minX = Math.min(minX, abs.x);
|
|
173
|
+
minY = Math.min(minY, abs.y);
|
|
174
|
+
maxX = Math.max(maxX, abs.x + w);
|
|
175
|
+
maxY = Math.max(maxY, abs.y + h);
|
|
176
|
+
}
|
|
177
|
+
return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
|
|
178
|
+
}
|
|
179
|
+
function getFrames(nodes) {
|
|
180
|
+
const frames = nodes.filter((n) => n.type === "frame");
|
|
181
|
+
if (frames.length === 0) return [];
|
|
182
|
+
const nodeMap = new Map(nodes.map((n) => [n.id, n]));
|
|
183
|
+
return frames.map((f) => {
|
|
184
|
+
var _a;
|
|
185
|
+
const data = f.data;
|
|
186
|
+
const abs = getAbsolutePosition(f, nodeMap);
|
|
187
|
+
const { width: w, height: h } = getNodeSize(f);
|
|
188
|
+
return {
|
|
189
|
+
id: f.id,
|
|
190
|
+
label: (_a = data.label) != null ? _a : "",
|
|
191
|
+
bounds: { x: abs.x, y: abs.y, width: w, height: h }
|
|
192
|
+
};
|
|
193
|
+
}).sort((a, b) => a.bounds.y - b.bounds.y || a.bounds.x - b.bounds.x);
|
|
194
|
+
}
|
|
195
|
+
function getFrameData(data, frameId) {
|
|
196
|
+
const frame = data.nodes.find((n) => n.id === frameId);
|
|
197
|
+
if (!frame || frame.type !== "frame") return void 0;
|
|
198
|
+
const descendantIds = collectDescendants(data.nodes, frameId);
|
|
199
|
+
const childNodes = data.nodes.filter((n) => descendantIds.has(n.id)).map((n) => __spreadProps(__spreadValues({}, n), { draggable: false }));
|
|
200
|
+
const childEdges = data.edges.filter(
|
|
201
|
+
(e) => descendantIds.has(e.source) && descendantIds.has(e.target)
|
|
202
|
+
);
|
|
203
|
+
const frameBounds = getNodeBounds(data.nodes, [frameId]);
|
|
204
|
+
const { width: w, height: h } = getNodeSize(frame);
|
|
205
|
+
const clampBounds = frameBounds != null ? frameBounds : {
|
|
206
|
+
x: frame.position.x,
|
|
207
|
+
y: frame.position.y,
|
|
208
|
+
width: w,
|
|
209
|
+
height: h
|
|
210
|
+
};
|
|
211
|
+
const contentNodeIds = childNodes.filter((n) => n.id !== frameId).map((n) => n.id);
|
|
212
|
+
const contentBounds = contentNodeIds.length > 0 ? getNodeBounds(data.nodes, contentNodeIds) : void 0;
|
|
213
|
+
const fitBounds = contentBounds != null ? contentBounds : clampBounds;
|
|
214
|
+
return {
|
|
215
|
+
data: {
|
|
216
|
+
nodes: childNodes,
|
|
217
|
+
edges: childEdges,
|
|
218
|
+
viewport: data.viewport
|
|
219
|
+
},
|
|
220
|
+
fitBounds,
|
|
221
|
+
clampBounds,
|
|
222
|
+
bounds: clampBounds
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/ui/Flow/types.ts
|
|
227
|
+
function isDynamicNode(node) {
|
|
228
|
+
return node.type === "dynamic";
|
|
229
|
+
}
|
|
230
|
+
function isFrameNode(node) {
|
|
231
|
+
return node.type === "frame";
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=server.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/Flow/server.ts","../../../src/core/query/query-keys.ts","../../../src/ui/Flow/prefetchFlow.ts","../../../src/ui/Flow/utils.ts","../../../src/ui/Flow/types.ts"],"sourcesContent":["// Server-safe exports (no 'use client' directive).\n// Use `@01.software/sdk/ui/flow/server` for server components and route loaders.\n\nexport { prefetchFlow } from './prefetchFlow'\nexport type { PrefetchFlowOptions } from './prefetchFlow'\nexport { getNodeBounds, getFrames, getFrameData } from './utils'\nexport type { FrameData } from './utils'\nexport type {\n CanvasData,\n FlowNode,\n FlowEdge,\n FlowViewport,\n FlowNodePosition,\n FlowNodeData,\n DynamicNodeData,\n FrameNodeData,\n FlowBounds,\n NodeTypeDef,\n NodeTypeFieldDef,\n EdgeTypeDef,\n} from './types'\nexport { isDynamicNode, isFrameNode } from './types'\n","import type { PublicCollection, ApiQueryOptions } from '../client/types'\n\nexport function collectionKeys<T extends PublicCollection>(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","import type { SDKClient } from './useFlow'\nimport { collectionKeys } from '../../core/query/query-keys'\n\nexport interface PrefetchFlowOptions {\n /** SDK client instance (Client or ServerClient) */\n client: SDKClient\n /** Flow slug (URL-friendly identifier) */\n slug?: string\n /** Flow document ID (UUID) */\n id?: string\n}\n\n/**\n * Prefetch flow 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 prefetchFlow({ client, slug: 'Home' })\n * ```\n */\nexport async function prefetchFlow(\n options: PrefetchFlowOptions,\n): Promise<void> {\n const { client, slug, id } = options\n const identifier = id ?? slug ?? ''\n\n await Promise.all([\n client.queryClient.prefetchQuery({\n queryKey: collectionKeys('flows').detail(identifier),\n queryFn: async () => {\n if (id) return client.from('flows').findById(id)\n const result = await client.from('flows').find({\n where: { slug: { equals: slug } },\n limit: 1,\n })\n const doc = result.docs[0]\n if (!doc) throw new Error(`Flow not found: ${slug}`)\n return doc\n },\n }),\n client.queryClient.prefetchQuery({\n queryKey: collectionKeys('flow-node-types').lists(),\n queryFn: async () => {\n const result = await client\n .from('flow-node-types')\n .find({ limit: 100 })\n return result.docs\n },\n }),\n client.queryClient.prefetchQuery({\n queryKey: collectionKeys('flow-edge-types').lists(),\n queryFn: async () => {\n const result = await client\n .from('flow-edge-types')\n .find({ limit: 100 })\n return result.docs\n },\n }),\n ])\n}\n","import type { FlowNode, FlowEdge, FlowBounds, CanvasData } from './types'\n\n// ── Shared helpers ──\n\nfunction getNodeSize(node: FlowNode): { width: number; height: number } {\n return {\n width:\n (node.style?.width as number) ??\n node.measured?.width ??\n node.width ??\n 200,\n height:\n (node.style?.height as number) ??\n node.measured?.height ??\n node.height ??\n 200,\n }\n}\n\nfunction getAbsolutePosition(\n node: FlowNode,\n nodeMap: Map<string, FlowNode>,\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 (BFS with index pointer to avoid O(Q²) shift). */\nfunction collectDescendants(\n nodes: FlowNode[],\n rootId: string,\n): Set<string> {\n const result = new Set<string>([rootId])\n const queue = [rootId]\n let i = 0\n while (i < queue.length) {\n const current = queue[i++]\n for (const n of nodes) {\n if (n.parentId === current && !result.has(n.id)) {\n result.add(n.id)\n queue.push(n.id)\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: FlowNode[],\n nodeIds: string[],\n): FlowBounds | 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: FlowNode[],\n): Array<{ id: string; label: string; bounds: FlowBounds }> {\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: FlowBounds\n /** Bounding box of the frame itself — use for panning/zoom restriction (clamp). */\n clampBounds: FlowBounds\n /** @deprecated Use fitBounds instead. Alias for clampBounds for backward compatibility. */\n bounds: FlowBounds\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: FlowEdge) => 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: FlowBounds = 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 bounds: clampBounds,\n }\n}\n","import type React from 'react'\n\n// ── Dynamic node data ──\n\nexport interface DynamicNodeData {\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n}\n\nexport type FlowNodeData = (DynamicNodeData | FrameNodeData) &\n Record<string, unknown>\n\n// ── Canvas types (mirrors @xyflow/react but standalone) ──\n\nexport interface FlowNodePosition {\n x: number\n y: number\n}\n\nexport interface FlowNode {\n id: string\n type?: string\n position: FlowNodePosition\n data: FlowNodeData\n parentId?: string\n style?: React.CSSProperties\n width?: number\n height?: number\n measured?: { width?: number; height?: number }\n draggable?: boolean\n selectable?: boolean\n [key: string]: unknown\n}\n\nexport interface FlowEdge {\n id: string\n source: string\n target: string\n sourceHandle?: string | null\n targetHandle?: string | null\n type?: string\n style?: React.CSSProperties\n animated?: boolean\n markerStart?: unknown\n markerEnd?: unknown\n edgeTypeSlug?: string\n fields?: Record<string, unknown>\n [key: string]: unknown\n}\n\nexport interface FlowViewport {\n x: number\n y: number\n zoom: number\n}\n\nexport interface CanvasData {\n nodes: FlowNode[]\n edges: FlowEdge[]\n viewport: FlowViewport\n}\n\n// ── Node type definitions (mirrors console's NodeTypeDef) ──\n\nexport interface NodeTypeFieldDef {\n name: string\n label: string\n fieldType:\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: FlowNode,\n): node is FlowNode & { data: DynamicNodeData } {\n return node.type === 'dynamic'\n}\n\nexport function isFrameNode(\n node: FlowNode,\n): node is FlowNode & { data: FrameNodeData } {\n return node.type === 'frame'\n}\n\n// ── Component slot props ──\n\nexport interface DynamicNodeSlotProps {\n id: string\n nodeTypeSlug: string\n label: string\n fields: Record<string, unknown>\n nodeTypeDef?: NodeTypeDef\n /** 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?: React.ReactElement\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?: React.ReactNode\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?: React.CSSProperties\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: React.ReactNode\n}\n\n// S8: Viewport focus\nexport interface FlowBounds {\n x: number\n y: number\n width: number\n height: number\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,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;;;ACOA,SAAsB,aACpB,SACe;AAAA;AAvBjB;AAwBE,UAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;AAC7B,UAAM,cAAa,uBAAM,SAAN,YAAc;AAEjC,UAAM,QAAQ,IAAI;AAAA,MAChB,OAAO,YAAY,cAAc;AAAA,QAC/B,UAAU,eAAe,OAAO,EAAE,OAAO,UAAU;AAAA,QACnD,SAAS,MAAY;AACnB,cAAI,GAAI,QAAO,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE;AAC/C,gBAAM,SAAS,MAAM,OAAO,KAAK,OAAO,EAAE,KAAK;AAAA,YAC7C,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAK,EAAE;AAAA,YAChC,OAAO;AAAA,UACT,CAAC;AACD,gBAAM,MAAM,OAAO,KAAK,CAAC;AACzB,cAAI,CAAC,IAAK,OAAM,IAAI,MAAM,mBAAmB,IAAI,EAAE;AACnD,iBAAO;AAAA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AAS;AAAA,IAClB,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAGA,QAAM,iBAAiB,WACpB,OAAO,CAAC,MAAM,EAAE,OAAO,OAAO,EAC9B,IAAI,CAAC,MAAM,EAAE,EAAE;AAClB,QAAM,gBAAgB,eAAe,SAAS,IAC1C,cAAc,KAAK,OAAO,cAAc,IACxC;AACJ,QAAM,YAAY,wCAAiB;AAEnC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,UAAU,KAAK;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AACF;;;ACjFO,SAAS,cACd,MAC8C;AAC9C,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,YACd,MAC4C;AAC5C,SAAO,KAAK,SAAS;AACvB;","names":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { C as CanvasData, i as DynamicNodeData, E as EdgeTypeDef, f as FlowBounds, a as FlowEdge, F as FlowNode, h as FlowNodeData, g as FlowNodePosition, e as FlowViewport, s as FrameData, j as FrameNodeData, N as NodeTypeDef, k as NodeTypeFieldDef, P as PrefetchFlowOptions, r as getFrameData, q as getFrames, o as getNodeBounds, l as isDynamicNode, m as isFrameNode, p as prefetchFlow } from '../../server-B80o7igg.cjs';
|
|
2
|
+
import '@tanstack/react-query';
|
|
3
|
+
import 'react';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { C as CanvasData, i as DynamicNodeData, E as EdgeTypeDef, f as FlowBounds, a as FlowEdge, F as FlowNode, h as FlowNodeData, g as FlowNodePosition, e as FlowViewport, s as FrameData, j as FrameNodeData, N as NodeTypeDef, k as NodeTypeFieldDef, P as PrefetchFlowOptions, r as getFrameData, q as getFrames, o as getNodeBounds, l as isDynamicNode, m as isFrameNode, p as prefetchFlow } from '../../server-B80o7igg.js';
|
|
2
|
+
import '@tanstack/react-query';
|
|
3
|
+
import 'react';
|