@particle-academy/fancy-flow 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/registry.js CHANGED
@@ -1,6 +1,5 @@
1
- export { BUILTIN_KINDS, RegistryNode, buildNodeTypes, registerBuiltinKinds } from './chunk-FGUJNX65.js';
2
- import './chunk-DDHKYIH2.js';
1
+ export { BUILTIN_KINDS, RegistryNode, buildNodeTypes, registerBuiltinKinds } from './chunk-4YBSEMF2.js';
2
+ import './chunk-GJSFZR6J.js';
3
3
  export { categoryAccent, defaultConfigFor, getNodeKind, listNodeKinds, onNodeKindsChanged, registerNodeKind, validateConfig } from './chunk-WNVBXXOL.js';
4
- import './chunk-7D4SUZUM.js';
5
4
  //# sourceMappingURL=registry.js.map
6
5
  //# sourceMappingURL=registry.js.map
package/dist/runtime.cjs CHANGED
@@ -8,309 +8,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var ReactExports__default = /*#__PURE__*/_interopDefault(ReactExports);
10
10
 
11
- var __create = Object.create;
12
- var __defProp = Object.defineProperty;
13
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
- var __getOwnPropNames = Object.getOwnPropertyNames;
15
- var __getProtoOf = Object.getPrototypeOf;
16
- var __hasOwnProp = Object.prototype.hasOwnProperty;
17
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
18
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
19
- }) : x)(function(x) {
20
- if (typeof require !== "undefined") return require.apply(this, arguments);
21
- throw Error('Dynamic require of "' + x + '" is not supported');
22
- });
23
- var __commonJS = (cb, mod) => function __require2() {
24
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
- };
26
- var __copyProps = (to, from, except, desc) => {
27
- if (from && typeof from === "object" || typeof from === "function") {
28
- for (let key of __getOwnPropNames(from))
29
- if (!__hasOwnProp.call(to, key) && key !== except)
30
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
- }
32
- return to;
33
- };
34
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
- // If the importer is in node compatibility mode or this is not an ESM
36
- // file that has been converted to a CommonJS file using a Babel-
37
- // compatible transform (i.e. "__esModule" has not been set), then set
38
- // "default" to the CommonJS "module.exports" for node compatibility.
39
- __defProp(target, "default", { value: mod, enumerable: true }) ,
40
- mod
41
- ));
42
-
43
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
44
- var require_use_sync_external_store_shim_production = __commonJS({
45
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
46
- var React = __require("react");
47
- function is(x, y) {
48
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
49
- }
50
- var objectIs = "function" === typeof Object.is ? Object.is : is;
51
- var useState4 = React.useState;
52
- var useEffect2 = React.useEffect;
53
- var useLayoutEffect2 = React.useLayoutEffect;
54
- var useDebugValue2 = React.useDebugValue;
55
- function useSyncExternalStore$2(subscribe, getSnapshot) {
56
- var value = getSnapshot(), _useState = useState4({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
57
- useLayoutEffect2(
58
- function() {
59
- inst.value = value;
60
- inst.getSnapshot = getSnapshot;
61
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
62
- },
63
- [subscribe, value, getSnapshot]
64
- );
65
- useEffect2(
66
- function() {
67
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
68
- return subscribe(function() {
69
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
70
- });
71
- },
72
- [subscribe]
73
- );
74
- useDebugValue2(value);
75
- return value;
76
- }
77
- function checkIfSnapshotChanged(inst) {
78
- var latestGetSnapshot = inst.getSnapshot;
79
- inst = inst.value;
80
- try {
81
- var nextValue = latestGetSnapshot();
82
- return !objectIs(inst, nextValue);
83
- } catch (error) {
84
- return true;
85
- }
86
- }
87
- function useSyncExternalStore$1(subscribe, getSnapshot) {
88
- return getSnapshot();
89
- }
90
- var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
91
- exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
92
- }
93
- });
94
-
95
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
96
- var require_use_sync_external_store_shim_development = __commonJS({
97
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
98
- "production" !== process.env.NODE_ENV && (function() {
99
- function is(x, y) {
100
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
101
- }
102
- function useSyncExternalStore$2(subscribe, getSnapshot) {
103
- didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
104
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
105
- ));
106
- var value = getSnapshot();
107
- if (!didWarnUncachedGetSnapshot) {
108
- var cachedValue = getSnapshot();
109
- objectIs(value, cachedValue) || (console.error(
110
- "The result of getSnapshot should be cached to avoid an infinite loop"
111
- ), didWarnUncachedGetSnapshot = true);
112
- }
113
- cachedValue = useState4({
114
- inst: { value, getSnapshot }
115
- });
116
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
117
- useLayoutEffect2(
118
- function() {
119
- inst.value = value;
120
- inst.getSnapshot = getSnapshot;
121
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
122
- },
123
- [subscribe, value, getSnapshot]
124
- );
125
- useEffect2(
126
- function() {
127
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
128
- return subscribe(function() {
129
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
130
- });
131
- },
132
- [subscribe]
133
- );
134
- useDebugValue2(value);
135
- return value;
136
- }
137
- function checkIfSnapshotChanged(inst) {
138
- var latestGetSnapshot = inst.getSnapshot;
139
- inst = inst.value;
140
- try {
141
- var nextValue = latestGetSnapshot();
142
- return !objectIs(inst, nextValue);
143
- } catch (error) {
144
- return true;
145
- }
146
- }
147
- function useSyncExternalStore$1(subscribe, getSnapshot) {
148
- return getSnapshot();
149
- }
150
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
151
- var React = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState4 = React.useState, useEffect2 = React.useEffect, useLayoutEffect2 = React.useLayoutEffect, useDebugValue2 = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
152
- exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
153
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
154
- })();
155
- }
156
- });
157
-
158
- // node_modules/use-sync-external-store/shim/index.js
159
- var require_shim = __commonJS({
160
- "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
161
- if (process.env.NODE_ENV === "production") {
162
- module.exports = require_use_sync_external_store_shim_production();
163
- } else {
164
- module.exports = require_use_sync_external_store_shim_development();
165
- }
166
- }
167
- });
168
-
169
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
170
- var require_with_selector_production = __commonJS({
171
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js"(exports) {
172
- var React = __require("react");
173
- var shim = require_shim();
174
- function is(x, y) {
175
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
176
- }
177
- var objectIs = "function" === typeof Object.is ? Object.is : is;
178
- var useSyncExternalStore = shim.useSyncExternalStore;
179
- var useRef3 = React.useRef;
180
- var useEffect2 = React.useEffect;
181
- var useMemo2 = React.useMemo;
182
- var useDebugValue2 = React.useDebugValue;
183
- exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
184
- var instRef = useRef3(null);
185
- if (null === instRef.current) {
186
- var inst = { hasValue: false, value: null };
187
- instRef.current = inst;
188
- } else inst = instRef.current;
189
- instRef = useMemo2(
190
- function() {
191
- function memoizedSelector(nextSnapshot) {
192
- if (!hasMemo) {
193
- hasMemo = true;
194
- memoizedSnapshot = nextSnapshot;
195
- nextSnapshot = selector(nextSnapshot);
196
- if (void 0 !== isEqual && inst.hasValue) {
197
- var currentSelection = inst.value;
198
- if (isEqual(currentSelection, nextSnapshot))
199
- return memoizedSelection = currentSelection;
200
- }
201
- return memoizedSelection = nextSnapshot;
202
- }
203
- currentSelection = memoizedSelection;
204
- if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
205
- var nextSelection = selector(nextSnapshot);
206
- if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
207
- return memoizedSnapshot = nextSnapshot, currentSelection;
208
- memoizedSnapshot = nextSnapshot;
209
- return memoizedSelection = nextSelection;
210
- }
211
- var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
212
- return [
213
- function() {
214
- return memoizedSelector(getSnapshot());
215
- },
216
- null === maybeGetServerSnapshot ? void 0 : function() {
217
- return memoizedSelector(maybeGetServerSnapshot());
218
- }
219
- ];
220
- },
221
- [getSnapshot, getServerSnapshot, selector, isEqual]
222
- );
223
- var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
224
- useEffect2(
225
- function() {
226
- inst.hasValue = true;
227
- inst.value = value;
228
- },
229
- [value]
230
- );
231
- useDebugValue2(value);
232
- return value;
233
- };
234
- }
235
- });
236
-
237
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
238
- var require_with_selector_development = __commonJS({
239
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
240
- "production" !== process.env.NODE_ENV && (function() {
241
- function is(x, y) {
242
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
243
- }
244
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
245
- var React = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef3 = React.useRef, useEffect2 = React.useEffect, useMemo2 = React.useMemo, useDebugValue2 = React.useDebugValue;
246
- exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
247
- var instRef = useRef3(null);
248
- if (null === instRef.current) {
249
- var inst = { hasValue: false, value: null };
250
- instRef.current = inst;
251
- } else inst = instRef.current;
252
- instRef = useMemo2(
253
- function() {
254
- function memoizedSelector(nextSnapshot) {
255
- if (!hasMemo) {
256
- hasMemo = true;
257
- memoizedSnapshot = nextSnapshot;
258
- nextSnapshot = selector(nextSnapshot);
259
- if (void 0 !== isEqual && inst.hasValue) {
260
- var currentSelection = inst.value;
261
- if (isEqual(currentSelection, nextSnapshot))
262
- return memoizedSelection = currentSelection;
263
- }
264
- return memoizedSelection = nextSnapshot;
265
- }
266
- currentSelection = memoizedSelection;
267
- if (objectIs(memoizedSnapshot, nextSnapshot))
268
- return currentSelection;
269
- var nextSelection = selector(nextSnapshot);
270
- if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
271
- return memoizedSnapshot = nextSnapshot, currentSelection;
272
- memoizedSnapshot = nextSnapshot;
273
- return memoizedSelection = nextSelection;
274
- }
275
- var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
276
- return [
277
- function() {
278
- return memoizedSelector(getSnapshot());
279
- },
280
- null === maybeGetServerSnapshot ? void 0 : function() {
281
- return memoizedSelector(maybeGetServerSnapshot());
282
- }
283
- ];
284
- },
285
- [getSnapshot, getServerSnapshot, selector, isEqual]
286
- );
287
- var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
288
- useEffect2(
289
- function() {
290
- inst.hasValue = true;
291
- inst.value = value;
292
- },
293
- [value]
294
- );
295
- useDebugValue2(value);
296
- return value;
297
- };
298
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
299
- })();
300
- }
301
- });
302
-
303
- // node_modules/use-sync-external-store/shim/with-selector.js
304
- var require_with_selector = __commonJS({
305
- "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
306
- if (process.env.NODE_ENV === "production") {
307
- module.exports = require_with_selector_production();
308
- } else {
309
- module.exports = require_with_selector_development();
310
- }
311
- }
312
- });
313
-
314
11
  // src/runtime/run-flow.ts
315
12
  async function runFlow(graph, executors, onEvent = () => {
316
13
  }, options = {}) {
@@ -6083,9 +5780,62 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
6083
5780
  destroy
6084
5781
  };
6085
5782
  }
6086
-
6087
- // node_modules/zustand/esm/traditional.mjs
6088
- var import_with_selector = __toESM(require_with_selector());
5783
+ function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
5784
+ const instRef = ReactExports.useRef(null);
5785
+ let inst;
5786
+ if (instRef.current === null) {
5787
+ inst = { hasValue: false, value: null };
5788
+ instRef.current = inst;
5789
+ } else {
5790
+ inst = instRef.current;
5791
+ }
5792
+ const [getSelection, getServerSelection] = ReactExports.useMemo(() => {
5793
+ let hasMemo = false;
5794
+ let memoizedSnapshot;
5795
+ let memoizedSelection;
5796
+ const memoizedSelector = (nextSnapshot) => {
5797
+ if (!hasMemo) {
5798
+ hasMemo = true;
5799
+ memoizedSnapshot = nextSnapshot;
5800
+ const nextSelection2 = selector(nextSnapshot);
5801
+ if (isEqual !== void 0 && inst.hasValue) {
5802
+ const currentSelection = inst.value;
5803
+ if (isEqual(currentSelection, nextSelection2)) {
5804
+ memoizedSelection = currentSelection;
5805
+ return currentSelection;
5806
+ }
5807
+ }
5808
+ memoizedSelection = nextSelection2;
5809
+ return nextSelection2;
5810
+ }
5811
+ const prevSnapshot = memoizedSnapshot;
5812
+ const prevSelection = memoizedSelection;
5813
+ if (Object.is(prevSnapshot, nextSnapshot)) {
5814
+ return prevSelection;
5815
+ }
5816
+ const nextSelection = selector(nextSnapshot);
5817
+ if (isEqual !== void 0 && isEqual(prevSelection, nextSelection)) {
5818
+ memoizedSnapshot = nextSnapshot;
5819
+ return prevSelection;
5820
+ }
5821
+ memoizedSnapshot = nextSnapshot;
5822
+ memoizedSelection = nextSelection;
5823
+ return nextSelection;
5824
+ };
5825
+ const maybeGetServerSnapshot = getServerSnapshot === void 0 || getServerSnapshot === null ? null : getServerSnapshot;
5826
+ const getSnapshotWithSelector = () => memoizedSelector(getSnapshot());
5827
+ const getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : () => memoizedSelector(maybeGetServerSnapshot());
5828
+ return [getSnapshotWithSelector, getServerSnapshotWithSelector];
5829
+ }, [getSnapshot, getServerSnapshot, selector, isEqual]);
5830
+ const value = ReactExports.useSyncExternalStore(subscribe, getSelection, getServerSelection);
5831
+ ReactExports.useEffect(() => {
5832
+ inst.hasValue = true;
5833
+ inst.value = value;
5834
+ }, [value]);
5835
+ ReactExports.useDebugValue(value);
5836
+ return value;
5837
+ }
5838
+ var use_sync_external_store_with_selector_default = { useSyncExternalStoreWithSelector };
6089
5839
 
6090
5840
  // node_modules/zustand/esm/vanilla.mjs
6091
5841
  var createStoreImpl = (createState) => {
@@ -6120,18 +5870,18 @@ var createStoreImpl = (createState) => {
6120
5870
  var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
6121
5871
 
6122
5872
  // node_modules/zustand/esm/traditional.mjs
6123
- var { useDebugValue } = ReactExports__default.default;
6124
- var { useSyncExternalStoreWithSelector } = import_with_selector.default;
5873
+ var { useDebugValue: useDebugValue2 } = ReactExports__default.default;
5874
+ var { useSyncExternalStoreWithSelector: useSyncExternalStoreWithSelector2 } = use_sync_external_store_with_selector_default;
6125
5875
  var identity3 = (arg) => arg;
6126
5876
  function useStoreWithEqualityFn(api, selector = identity3, equalityFn) {
6127
- const slice = useSyncExternalStoreWithSelector(
5877
+ const slice = useSyncExternalStoreWithSelector2(
6128
5878
  api.subscribe,
6129
5879
  api.getState,
6130
5880
  api.getServerState || api.getInitialState,
6131
5881
  selector,
6132
5882
  equalityFn
6133
5883
  );
6134
- useDebugValue(slice);
5884
+ useDebugValue2(slice);
6135
5885
  return slice;
6136
5886
  }
6137
5887
  var createWithEqualityFnImpl = (createState, defaultEqualityFn) => {
@@ -9310,52 +9060,6 @@ function useFlowState(initial) {
9310
9060
  const toGraph = ReactExports.useCallback(() => ({ nodes, edges }), [nodes, edges]);
9311
9061
  return { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange, onConnect, toGraph };
9312
9062
  }
9313
- /*! Bundled license information:
9314
-
9315
- use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
9316
- (**
9317
- * @license React
9318
- * use-sync-external-store-shim.production.js
9319
- *
9320
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9321
- *
9322
- * This source code is licensed under the MIT license found in the
9323
- * LICENSE file in the root directory of this source tree.
9324
- *)
9325
-
9326
- use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
9327
- (**
9328
- * @license React
9329
- * use-sync-external-store-shim.development.js
9330
- *
9331
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9332
- *
9333
- * This source code is licensed under the MIT license found in the
9334
- * LICENSE file in the root directory of this source tree.
9335
- *)
9336
-
9337
- use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
9338
- (**
9339
- * @license React
9340
- * use-sync-external-store-shim/with-selector.production.js
9341
- *
9342
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9343
- *
9344
- * This source code is licensed under the MIT license found in the
9345
- * LICENSE file in the root directory of this source tree.
9346
- *)
9347
-
9348
- use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
9349
- (**
9350
- * @license React
9351
- * use-sync-external-store-shim/with-selector.development.js
9352
- *
9353
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9354
- *
9355
- * This source code is licensed under the MIT license found in the
9356
- * LICENSE file in the root directory of this source tree.
9357
- *)
9358
- */
9359
9063
 
9360
9064
  exports.applyStatusesToNodes = applyStatusesToNodes;
9361
9065
  exports.runFlow = runFlow;