@process.co/ui 0.0.10 → 0.0.11

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.
@@ -0,0 +1,486 @@
1
+ 'use strict';
2
+ function _array_like_to_array(arr, len) {
3
+ if (len == null || len > arr.length) len = arr.length;
4
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
+ return arr2;
6
+ }
7
+ function _array_with_holes(arr) {
8
+ if (Array.isArray(arr)) return arr;
9
+ }
10
+ function _define_property(obj, key, value) {
11
+ if (key in obj) {
12
+ Object.defineProperty(obj, key, {
13
+ value: value,
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true
17
+ });
18
+ } else {
19
+ obj[key] = value;
20
+ }
21
+ return obj;
22
+ }
23
+ function _iterable_to_array_limit(arr, i) {
24
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
25
+ if (_i == null) return;
26
+ var _arr = [];
27
+ var _n = true;
28
+ var _d = false;
29
+ var _s, _e;
30
+ try {
31
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
32
+ _arr.push(_s.value);
33
+ if (i && _arr.length === i) break;
34
+ }
35
+ } catch (err) {
36
+ _d = true;
37
+ _e = err;
38
+ } finally{
39
+ try {
40
+ if (!_n && _i["return"] != null) _i["return"]();
41
+ } finally{
42
+ if (_d) throw _e;
43
+ }
44
+ }
45
+ return _arr;
46
+ }
47
+ function _non_iterable_rest() {
48
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
+ }
50
+ function _object_spread(target) {
51
+ for(var i = 1; i < arguments.length; i++){
52
+ var source = arguments[i] != null ? arguments[i] : {};
53
+ var ownKeys = Object.keys(source);
54
+ if (typeof Object.getOwnPropertySymbols === "function") {
55
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
56
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
57
+ }));
58
+ }
59
+ ownKeys.forEach(function(key) {
60
+ _define_property(target, key, source[key]);
61
+ });
62
+ }
63
+ return target;
64
+ }
65
+ function ownKeys(object, enumerableOnly) {
66
+ var keys = Object.keys(object);
67
+ if (Object.getOwnPropertySymbols) {
68
+ var symbols = Object.getOwnPropertySymbols(object);
69
+ if (enumerableOnly) {
70
+ symbols = symbols.filter(function(sym) {
71
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
72
+ });
73
+ }
74
+ keys.push.apply(keys, symbols);
75
+ }
76
+ return keys;
77
+ }
78
+ function _object_spread_props(target, source) {
79
+ source = source != null ? source : {};
80
+ if (Object.getOwnPropertyDescriptors) {
81
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
82
+ } else {
83
+ ownKeys(Object(source)).forEach(function(key) {
84
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
85
+ });
86
+ }
87
+ return target;
88
+ }
89
+ function _object_without_properties(source, excluded) {
90
+ if (source == null) return {};
91
+ var target = _object_without_properties_loose(source, excluded);
92
+ var key, i;
93
+ if (Object.getOwnPropertySymbols) {
94
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
95
+ for(i = 0; i < sourceSymbolKeys.length; i++){
96
+ key = sourceSymbolKeys[i];
97
+ if (excluded.indexOf(key) >= 0) continue;
98
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
99
+ target[key] = source[key];
100
+ }
101
+ }
102
+ return target;
103
+ }
104
+ function _object_without_properties_loose(source, excluded) {
105
+ if (source == null) return {};
106
+ var target = {};
107
+ var sourceKeys = Object.keys(source);
108
+ var key, i;
109
+ for(i = 0; i < sourceKeys.length; i++){
110
+ key = sourceKeys[i];
111
+ if (excluded.indexOf(key) >= 0) continue;
112
+ target[key] = source[key];
113
+ }
114
+ return target;
115
+ }
116
+ function _sliced_to_array(arr, i) {
117
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
118
+ }
119
+ function _to_primitive(input, hint) {
120
+ if (_type_of(input) !== "object" || input === null) return input;
121
+ var prim = input[Symbol.toPrimitive];
122
+ if (prim !== undefined) {
123
+ var res = prim.call(input, hint || "default");
124
+ if (_type_of(res) !== "object") return res;
125
+ throw new TypeError("@@toPrimitive must return a primitive value.");
126
+ }
127
+ return (hint === "string" ? String : Number)(input);
128
+ }
129
+ function _to_property_key(arg) {
130
+ var key = _to_primitive(arg, "string");
131
+ return _type_of(key) === "symbol" ? key : String(key);
132
+ }
133
+ function _type_of(obj) {
134
+ "@swc/helpers - typeof";
135
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
136
+ }
137
+ function _unsupported_iterable_to_array(o, minLen) {
138
+ if (!o) return;
139
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
140
+ var n = Object.prototype.toString.call(o).slice(8, -1);
141
+ if (n === "Object" && o.constructor) n = o.constructor.name;
142
+ if (n === "Map" || n === "Set") return Array.from(n);
143
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
144
+ }
145
+ var React2 = require('react');
146
+ function _interopDefault(e) {
147
+ return e && e.__esModule ? e : {
148
+ default: e
149
+ };
150
+ }
151
+ var React2__default = /*#__PURE__*/ _interopDefault(React2);
152
+ // src/components/dev/DevProvider.tsx
153
+ var DevContext = React2.createContext(null);
154
+ function useDevContext() {
155
+ return React2.useContext(DevContext);
156
+ }
157
+ function useNodeProperty(fieldName) {
158
+ var devCtx = useDevContext();
159
+ if (devCtx) {
160
+ var value = devCtx.getProperty(fieldName);
161
+ var setValue = React2.useCallback(function(newValue) {
162
+ devCtx.setProperty(fieldName, newValue);
163
+ }, [
164
+ devCtx,
165
+ fieldName
166
+ ]);
167
+ return [
168
+ value,
169
+ setValue
170
+ ];
171
+ }
172
+ console.warn("useNodeProperty('".concat(fieldName, "') called outside of DevProvider - returning undefined"));
173
+ var _React2_useState = _sliced_to_array(React2.useState(void 0), 2), localValue = _React2_useState[0], setLocalValue = _React2_useState[1];
174
+ return [
175
+ localValue,
176
+ setLocalValue
177
+ ];
178
+ }
179
+ function useInferredTypes() {
180
+ var devCtx = useDevContext();
181
+ if (devCtx) {
182
+ return {
183
+ inferredTypes: devCtx.inferredTypes,
184
+ setInferredType: devCtx.setInferredType,
185
+ getInferredType: devCtx.getInferredType
186
+ };
187
+ }
188
+ return null;
189
+ }
190
+ function DevProvider(param) {
191
+ var children = param.children, _param_storageKey = param.storageKey, storageKey = _param_storageKey === void 0 ? "process-dev" : _param_storageKey, _param_initialData = param.initialData, initialData = _param_initialData === void 0 ? {} : _param_initialData, _param_persist = param.persist, persist = _param_persist === void 0 ? true : _param_persist, _param_nodeId = param.nodeId, nodeId = _param_nodeId === void 0 ? "dev-node-1" : _param_nodeId;
192
+ var _React2_useState = _sliced_to_array(React2.useState(function() {
193
+ if (persist && typeof window !== "undefined") {
194
+ try {
195
+ var stored = localStorage.getItem("".concat(storageKey, ":data"));
196
+ if (stored) {
197
+ return _object_spread({}, initialData, JSON.parse(stored));
198
+ }
199
+ } catch (e) {
200
+ console.warn("DevProvider: Failed to load from localStorage", e);
201
+ }
202
+ }
203
+ return initialData;
204
+ }), 2), data = _React2_useState[0], setData = _React2_useState[1];
205
+ var _React2_useState1 = _sliced_to_array(React2.useState(function() {
206
+ if (persist && typeof window !== "undefined") {
207
+ try {
208
+ var stored = localStorage.getItem("".concat(storageKey, ":inferredTypes"));
209
+ if (stored) {
210
+ return JSON.parse(stored);
211
+ }
212
+ } catch (e) {
213
+ console.warn("DevProvider: Failed to load inferredTypes from localStorage", e);
214
+ }
215
+ }
216
+ return {};
217
+ }), 2), inferredTypes = _React2_useState1[0], setInferredTypesState = _React2_useState1[1];
218
+ React2.useEffect(function() {
219
+ if (persist && typeof window !== "undefined") {
220
+ try {
221
+ localStorage.setItem("".concat(storageKey, ":data"), JSON.stringify(data));
222
+ } catch (e) {
223
+ console.warn("DevProvider: Failed to save data to localStorage", e);
224
+ }
225
+ }
226
+ }, [
227
+ data,
228
+ storageKey,
229
+ persist
230
+ ]);
231
+ React2.useEffect(function() {
232
+ if (persist && typeof window !== "undefined") {
233
+ try {
234
+ localStorage.setItem("".concat(storageKey, ":inferredTypes"), JSON.stringify(inferredTypes));
235
+ } catch (e) {
236
+ console.warn("DevProvider: Failed to save inferredTypes to localStorage", e);
237
+ }
238
+ }
239
+ }, [
240
+ inferredTypes,
241
+ storageKey,
242
+ persist
243
+ ]);
244
+ var setProperty = React2.useCallback(function(key, value2) {
245
+ setData(function(prev) {
246
+ return _object_spread_props(_object_spread({}, prev), _define_property({}, key, value2));
247
+ });
248
+ }, []);
249
+ var getProperty = React2.useCallback(function(key) {
250
+ return data[key];
251
+ }, [
252
+ data
253
+ ]);
254
+ var setInferredType = React2.useCallback(function(fieldName, type) {
255
+ setInferredTypesState(function(prev) {
256
+ return _object_spread_props(_object_spread({}, prev), _define_property({}, fieldName, type));
257
+ });
258
+ }, []);
259
+ var getInferredType = React2.useCallback(function(fieldName) {
260
+ return inferredTypes[fieldName];
261
+ }, [
262
+ inferredTypes
263
+ ]);
264
+ var clearInferredType = React2.useCallback(function(fieldName) {
265
+ setInferredTypesState(function(prev) {
266
+ var _ = prev[fieldName], rest = _object_without_properties(prev, [
267
+ fieldName
268
+ ].map(_to_property_key));
269
+ return rest;
270
+ });
271
+ }, []);
272
+ var clearAllInferredTypes = React2.useCallback(function() {
273
+ setInferredTypesState({});
274
+ }, []);
275
+ var clearAll = React2.useCallback(function() {
276
+ setData({});
277
+ setInferredTypesState({});
278
+ if (persist && typeof window !== "undefined") {
279
+ localStorage.removeItem("".concat(storageKey, ":data"));
280
+ localStorage.removeItem("".concat(storageKey, ":inferredTypes"));
281
+ }
282
+ }, [
283
+ storageKey,
284
+ persist
285
+ ]);
286
+ var exportData = React2.useCallback(function() {
287
+ return JSON.stringify({
288
+ data: data,
289
+ inferredTypes: inferredTypes
290
+ }, null, 2);
291
+ }, [
292
+ data,
293
+ inferredTypes
294
+ ]);
295
+ var importData = React2.useCallback(function(json) {
296
+ try {
297
+ var parsed = JSON.parse(json);
298
+ if (parsed.data) setData(parsed.data);
299
+ if (parsed.inferredTypes) setInferredTypesState(parsed.inferredTypes);
300
+ } catch (e) {
301
+ console.error("DevProvider: Failed to import data", e);
302
+ }
303
+ }, []);
304
+ var value = React2.useMemo(function() {
305
+ return {
306
+ data: data,
307
+ setProperty: setProperty,
308
+ getProperty: getProperty,
309
+ inferredTypes: inferredTypes,
310
+ setInferredType: setInferredType,
311
+ getInferredType: getInferredType,
312
+ clearInferredType: clearInferredType,
313
+ clearAllInferredTypes: clearAllInferredTypes,
314
+ nodeId: nodeId,
315
+ clearAll: clearAll,
316
+ exportData: exportData,
317
+ importData: importData
318
+ };
319
+ }, [
320
+ data,
321
+ setProperty,
322
+ getProperty,
323
+ inferredTypes,
324
+ setInferredType,
325
+ getInferredType,
326
+ clearInferredType,
327
+ clearAllInferredTypes,
328
+ nodeId,
329
+ clearAll,
330
+ exportData,
331
+ importData
332
+ ]);
333
+ return /* @__PURE__ */ React2__default.default.createElement(DevContext.Provider, {
334
+ value: value
335
+ }, children);
336
+ }
337
+ function DevToolbar(param) {
338
+ var className = param.className;
339
+ var devCtx = useDevContext();
340
+ var _React2_useState = _sliced_to_array(React2.useState(false), 2), showData = _React2_useState[0], setShowData = _React2_useState[1];
341
+ var _React2_useState1 = _sliced_to_array(React2.useState(false), 2), showTypeEditor = _React2_useState1[0], setShowTypeEditor = _React2_useState1[1];
342
+ var _React2_useState2 = _sliced_to_array(React2.useState(""), 2), newTypeKey = _React2_useState2[0], setNewTypeKey = _React2_useState2[1];
343
+ var _React2_useState3 = _sliced_to_array(React2.useState(""), 2), newTypeValue = _React2_useState3[0], setNewTypeValue = _React2_useState3[1];
344
+ if (!devCtx) {
345
+ return /* @__PURE__ */ React2__default.default.createElement("div", {
346
+ className: className
347
+ }, "DevToolbar: Not inside DevProvider");
348
+ }
349
+ var handleAddType = function() {
350
+ if (newTypeKey.trim() && newTypeValue.trim()) {
351
+ devCtx.setInferredType(newTypeKey.trim(), newTypeValue.trim());
352
+ setNewTypeKey("");
353
+ setNewTypeValue("");
354
+ }
355
+ };
356
+ var handleRemoveType = function(key) {
357
+ devCtx.clearInferredType(key);
358
+ };
359
+ var handleClearAllTypes = function() {
360
+ if (confirm("Clear all inferred types?")) {
361
+ devCtx.clearAllInferredTypes();
362
+ }
363
+ };
364
+ return /* @__PURE__ */ React2__default.default.createElement("div", {
365
+ className: "".concat(className || "", " uii:border uii:rounded-lg uii:p-4 uii:bg-gray-50 dark:uii:bg-gray-900")
366
+ }, /* @__PURE__ */ React2__default.default.createElement("div", {
367
+ className: "uii:flex uii:items-center uii:gap-4 uii:mb-2 uii:flex-wrap"
368
+ }, /* @__PURE__ */ React2__default.default.createElement("span", {
369
+ className: "uii:font-semibold uii:text-sm"
370
+ }, "\uD83D\uDEE0️ Dev Mode"), /* @__PURE__ */ React2__default.default.createElement("span", {
371
+ className: "uii:text-xs uii:text-gray-500"
372
+ }, "Node: ", devCtx.nodeId), /* @__PURE__ */ React2__default.default.createElement("button", {
373
+ onClick: function() {
374
+ return setShowData(!showData);
375
+ },
376
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:bg-blue-100 dark:uii:bg-blue-900 uii:rounded hover:uii:bg-blue-200"
377
+ }, showData ? "Hide" : "Show", " Data"), /* @__PURE__ */ React2__default.default.createElement("button", {
378
+ onClick: function() {
379
+ return setShowTypeEditor(!showTypeEditor);
380
+ },
381
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:bg-purple-100 dark:uii:bg-purple-900 uii:rounded hover:uii:bg-purple-200"
382
+ }, showTypeEditor ? "Hide" : "Spoof", " Types"), /* @__PURE__ */ React2__default.default.createElement("button", {
383
+ onClick: function() {
384
+ var json = devCtx.exportData();
385
+ navigator.clipboard.writeText(json);
386
+ alert("Data copied to clipboard!");
387
+ },
388
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:bg-green-100 dark:uii:bg-green-900 uii:rounded hover:uii:bg-green-200"
389
+ }, "Export"), /* @__PURE__ */ React2__default.default.createElement("button", {
390
+ onClick: function() {
391
+ var json = prompt("Paste JSON data:");
392
+ if (json) devCtx.importData(json);
393
+ },
394
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:bg-yellow-100 dark:uii:bg-yellow-900 uii:rounded hover:uii:bg-yellow-200"
395
+ }, "Import"), /* @__PURE__ */ React2__default.default.createElement("button", {
396
+ onClick: function() {
397
+ if (confirm("Clear all data?")) devCtx.clearAll();
398
+ },
399
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:bg-red-100 dark:uii:bg-red-900 uii:rounded hover:uii:bg-red-200"
400
+ }, "Clear")), showTypeEditor && /* @__PURE__ */ React2__default.default.createElement("div", {
401
+ className: "uii:mt-3 uii:p-3 uii:bg-purple-50 dark:uii:bg-purple-950 uii:rounded-lg uii:border uii:border-purple-200 dark:uii:border-purple-800"
402
+ }, /* @__PURE__ */ React2__default.default.createElement("div", {
403
+ className: "uii:text-xs uii:font-medium uii:mb-2 uii:text-purple-700 dark:uii:text-purple-300"
404
+ }, "Spoof Inferred Types (simulate external field types)"), /* @__PURE__ */ React2__default.default.createElement("div", {
405
+ className: "uii:flex uii:gap-2 uii:mb-2 uii:flex-wrap"
406
+ }, /* @__PURE__ */ React2__default.default.createElement("input", {
407
+ type: "text",
408
+ placeholder: "Field name (e.g., switchExpression)",
409
+ value: newTypeKey,
410
+ onChange: function(e) {
411
+ return setNewTypeKey(e.target.value);
412
+ },
413
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[150px] uii:bg-white dark:uii:bg-gray-800"
414
+ }), /* @__PURE__ */ React2__default.default.createElement("input", {
415
+ type: "text",
416
+ placeholder: "Type (e.g., string | number)",
417
+ value: newTypeValue,
418
+ onChange: function(e) {
419
+ return setNewTypeValue(e.target.value);
420
+ },
421
+ onKeyDown: function(e) {
422
+ return e.key === "Enter" && handleAddType();
423
+ },
424
+ className: "uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[200px] uii:bg-white dark:uii:bg-gray-800"
425
+ }), /* @__PURE__ */ React2__default.default.createElement("button", {
426
+ onClick: handleAddType,
427
+ disabled: !newTypeKey.trim() || !newTypeValue.trim(),
428
+ className: "uii:text-xs uii:px-3 uii:py-1 uii:bg-purple-500 uii:text-white uii:rounded hover:uii:bg-purple-600 disabled:uii:opacity-50 disabled:uii:cursor-not-allowed"
429
+ }, "Add")), Object.keys(devCtx.inferredTypes).length > 0 && /* @__PURE__ */ React2__default.default.createElement("div", {
430
+ className: "uii:mt-2"
431
+ }, /* @__PURE__ */ React2__default.default.createElement("div", {
432
+ className: "uii:flex uii:items-center uii:justify-between uii:mb-1"
433
+ }, /* @__PURE__ */ React2__default.default.createElement("span", {
434
+ className: "uii:text-xs uii:text-gray-500"
435
+ }, "Current inferred types:"), /* @__PURE__ */ React2__default.default.createElement("button", {
436
+ onClick: handleClearAllTypes,
437
+ className: "uii:text-xs uii:px-2 uii:py-0.5 uii:bg-red-100 dark:uii:bg-red-900 uii:text-red-700 dark:uii:text-red-300 uii:rounded hover:uii:bg-red-200"
438
+ }, "Clear All")), /* @__PURE__ */ React2__default.default.createElement("div", {
439
+ className: "uii:space-y-1"
440
+ }, Object.entries(devCtx.inferredTypes).map(function(param) {
441
+ var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
442
+ return value && /* @__PURE__ */ React2__default.default.createElement("div", {
443
+ key: key,
444
+ className: "uii:flex uii:items-center uii:gap-2 uii:text-xs uii:bg-white dark:uii:bg-gray-800 uii:px-2 uii:py-1 uii:rounded"
445
+ }, /* @__PURE__ */ React2__default.default.createElement("button", {
446
+ onClick: function() {
447
+ navigator.clipboard.writeText(key);
448
+ },
449
+ className: "uii:text-gray-400 hover:uii:text-purple-600 uii:text-xs",
450
+ title: "Copy field name"
451
+ }, "\uD83D\uDCCB"), /* @__PURE__ */ React2__default.default.createElement("span", {
452
+ className: "uii:font-mono uii:text-purple-600 dark:uii:text-purple-400 uii:cursor-pointer uii:truncate uii:max-w-[300px]",
453
+ onClick: function() {
454
+ navigator.clipboard.writeText(key);
455
+ },
456
+ title: key
457
+ }, key), /* @__PURE__ */ React2__default.default.createElement("span", {
458
+ className: "uii:text-gray-400"
459
+ }, "\u2192"), /* @__PURE__ */ React2__default.default.createElement("span", {
460
+ className: "uii:font-mono uii:text-gray-600 dark:uii:text-gray-300 uii:flex-1 uii:truncate"
461
+ }, value), /* @__PURE__ */ React2__default.default.createElement("button", {
462
+ onClick: function() {
463
+ return handleRemoveType(key);
464
+ },
465
+ className: "uii:text-red-500 hover:uii:text-red-700 uii:text-xs",
466
+ title: "Remove"
467
+ }, "\u2715"));
468
+ })))), showData && /* @__PURE__ */ React2__default.default.createElement("div", {
469
+ className: "uii:mt-2"
470
+ }, /* @__PURE__ */ React2__default.default.createElement("div", {
471
+ className: "uii:text-xs uii:mb-1 uii:font-medium"
472
+ }, "Data:"), /* @__PURE__ */ React2__default.default.createElement("pre", {
473
+ className: "uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-48"
474
+ }, JSON.stringify(devCtx.data, null, 2)), /* @__PURE__ */ React2__default.default.createElement("div", {
475
+ className: "uii:text-xs uii:mb-1 uii:mt-2 uii:font-medium"
476
+ }, "Inferred Types:"), /* @__PURE__ */ React2__default.default.createElement("pre", {
477
+ className: "uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-24"
478
+ }, JSON.stringify(devCtx.inferredTypes, null, 2))));
479
+ }
480
+ exports.DevContext = DevContext;
481
+ exports.DevProvider = DevProvider;
482
+ exports.DevToolbar = DevToolbar;
483
+ exports.useDevContext = useDevContext;
484
+ exports.useInferredTypes = useInferredTypes;
485
+ exports.useNodeProperty = useNodeProperty; //# sourceMappingURL=index.cjs.map
486
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/proc-app/proc-app/out/process-co/ui/dist/components/dev/index.cjs","../../../src/components/dev/DevProvider.tsx","../../../src/components/dev/DevToolbar.tsx"],"names":["React2","require","_interopDefault","e","__esModule","default","React2__default","DevContext","createContext","useDevContext","useContext","useNodeProperty","fieldName","devCtx","value","getProperty","setValue","useCallback","newValue","setProperty","console","warn","useState","localValue","setLocalValue","useInferredTypes","inferredTypes","setInferredType","getInferredType","DevProvider","children","storageKey","initialData","persist","nodeId","window","stored","localStorage","getItem","JSON","parse","data","setData","setInferredTypesState","useEffect","setItem","stringify","key","prev","type","clearInferredType","_","rest","clearAllInferredTypes","clearAll","removeItem","exportData","importData","json","parsed","error","useMemo","React","createElement","Provider","DevToolbar","className","showData","setShowData","showTypeEditor","setShowTypeEditor","newTypeKey","setNewTypeKey","newTypeValue","setNewTypeValue","handleAddType","trim","handleRemoveType","handleClearAllTypes","confirm","onClick","navigator","clipboard","writeText","alert","prompt","placeholder","onChange","target","onKeyDown","disabled","Object","keys","length","entries","map","title","exports"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAIA,SAASC,QAAQ;AAErB,SAASC,gBAAiBC,CAAC;IAAI,OAAOA,KAAKA,EAAEC,UAAU,GAAGD,IAAI;QAAEE,SAASF;IAAE;AAAG;AAE9E,IAAIG,kBAAkB,WAAW,GAAEJ,gBAAgBF;AAEnD,qCAAqC;AC6C9B,IAAMO,aAAaC,OAAAA,aAAAA,CAAsC;AAKzD,SAASC;IACd,OAAOC,OAAAA,UAAAA,CAAWH;AACpB;AAMO,SAASI,gBAAyBC,SAAA;IAC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CAAC,OAAA;QAAIG,WAAU;IAAA,GACZ3B,KAAKO,SAAA,CAAUjC,OAAOa,aAAA,EAAe,MAAM;AAMxD;AFuGAuE,QAAQ1F,UAAU,GAAGA;AACrB0F,QAAQpE,WAAW,GAAGA;AACtBoE,QAAQhC,UAAU,GAAGA;AACrBgC,QAAQxF,aAAa,GAAGA;AACxBwF,QAAQxE,gBAAgB,GAAGA;AAC3BwE,QAAQtF,eAAe,GAAGA,iBAC1B,kCAAkC","sourcesContent":["'use strict';\n\nvar React2 = require('react');\n\nfunction _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }\n\nvar React2__default = /*#__PURE__*/_interopDefault(React2);\n\n// src/components/dev/DevProvider.tsx\nvar DevContext = React2.createContext(null);\nfunction useDevContext() {\n return React2.useContext(DevContext);\n}\nfunction useNodeProperty(fieldName) {\n const devCtx = useDevContext();\n if (devCtx) {\n const value = devCtx.getProperty(fieldName);\n const setValue = React2.useCallback((newValue) => {\n devCtx.setProperty(fieldName, newValue);\n }, [devCtx, fieldName]);\n return [value, setValue];\n }\n console.warn(`useNodeProperty('${fieldName}') called outside of DevProvider - returning undefined`);\n const [localValue, setLocalValue] = React2.useState(void 0);\n return [localValue, setLocalValue];\n}\nfunction useInferredTypes() {\n const devCtx = useDevContext();\n if (devCtx) {\n return {\n inferredTypes: devCtx.inferredTypes,\n setInferredType: devCtx.setInferredType,\n getInferredType: devCtx.getInferredType\n };\n }\n return null;\n}\nfunction DevProvider({\n children,\n storageKey = \"process-dev\",\n initialData = {},\n persist = true,\n nodeId = \"dev-node-1\"\n}) {\n const [data, setData] = React2.useState(() => {\n if (persist && typeof window !== \"undefined\") {\n try {\n const stored = localStorage.getItem(`${storageKey}:data`);\n if (stored) {\n return { ...initialData, ...JSON.parse(stored) };\n }\n } catch (e) {\n console.warn(\"DevProvider: Failed to load from localStorage\", e);\n }\n }\n return initialData;\n });\n const [inferredTypes, setInferredTypesState] = React2.useState(() => {\n if (persist && typeof window !== \"undefined\") {\n try {\n const stored = localStorage.getItem(`${storageKey}:inferredTypes`);\n if (stored) {\n return JSON.parse(stored);\n }\n } catch (e) {\n console.warn(\"DevProvider: Failed to load inferredTypes from localStorage\", e);\n }\n }\n return {};\n });\n React2.useEffect(() => {\n if (persist && typeof window !== \"undefined\") {\n try {\n localStorage.setItem(`${storageKey}:data`, JSON.stringify(data));\n } catch (e) {\n console.warn(\"DevProvider: Failed to save data to localStorage\", e);\n }\n }\n }, [data, storageKey, persist]);\n React2.useEffect(() => {\n if (persist && typeof window !== \"undefined\") {\n try {\n localStorage.setItem(`${storageKey}:inferredTypes`, JSON.stringify(inferredTypes));\n } catch (e) {\n console.warn(\"DevProvider: Failed to save inferredTypes to localStorage\", e);\n }\n }\n }, [inferredTypes, storageKey, persist]);\n const setProperty = React2.useCallback((key, value2) => {\n setData((prev) => ({ ...prev, [key]: value2 }));\n }, []);\n const getProperty = React2.useCallback((key) => {\n return data[key];\n }, [data]);\n const setInferredType = React2.useCallback((fieldName, type) => {\n setInferredTypesState((prev) => ({ ...prev, [fieldName]: type }));\n }, []);\n const getInferredType = React2.useCallback((fieldName) => {\n return inferredTypes[fieldName];\n }, [inferredTypes]);\n const clearInferredType = React2.useCallback((fieldName) => {\n setInferredTypesState((prev) => {\n const { [fieldName]: _, ...rest } = prev;\n return rest;\n });\n }, []);\n const clearAllInferredTypes = React2.useCallback(() => {\n setInferredTypesState({});\n }, []);\n const clearAll = React2.useCallback(() => {\n setData({});\n setInferredTypesState({});\n if (persist && typeof window !== \"undefined\") {\n localStorage.removeItem(`${storageKey}:data`);\n localStorage.removeItem(`${storageKey}:inferredTypes`);\n }\n }, [storageKey, persist]);\n const exportData = React2.useCallback(() => {\n return JSON.stringify({ data, inferredTypes }, null, 2);\n }, [data, inferredTypes]);\n const importData = React2.useCallback((json) => {\n try {\n const parsed = JSON.parse(json);\n if (parsed.data) setData(parsed.data);\n if (parsed.inferredTypes) setInferredTypesState(parsed.inferredTypes);\n } catch (e) {\n console.error(\"DevProvider: Failed to import data\", e);\n }\n }, []);\n const value = React2.useMemo(() => ({\n data,\n setProperty,\n getProperty,\n inferredTypes,\n setInferredType,\n getInferredType,\n clearInferredType,\n clearAllInferredTypes,\n nodeId,\n clearAll,\n exportData,\n importData\n }), [data, setProperty, getProperty, inferredTypes, setInferredType, getInferredType, clearInferredType, clearAllInferredTypes, nodeId, clearAll, exportData, importData]);\n return /* @__PURE__ */ React2__default.default.createElement(DevContext.Provider, { value }, children);\n}\nfunction DevToolbar({ className }) {\n const devCtx = useDevContext();\n const [showData, setShowData] = React2.useState(false);\n const [showTypeEditor, setShowTypeEditor] = React2.useState(false);\n const [newTypeKey, setNewTypeKey] = React2.useState(\"\");\n const [newTypeValue, setNewTypeValue] = React2.useState(\"\");\n if (!devCtx) {\n return /* @__PURE__ */ React2__default.default.createElement(\"div\", { className }, \"DevToolbar: Not inside DevProvider\");\n }\n const handleAddType = () => {\n if (newTypeKey.trim() && newTypeValue.trim()) {\n devCtx.setInferredType(newTypeKey.trim(), newTypeValue.trim());\n setNewTypeKey(\"\");\n setNewTypeValue(\"\");\n }\n };\n const handleRemoveType = (key) => {\n devCtx.clearInferredType(key);\n };\n const handleClearAllTypes = () => {\n if (confirm(\"Clear all inferred types?\")) {\n devCtx.clearAllInferredTypes();\n }\n };\n return /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: `${className || \"\"} uii:border uii:rounded-lg uii:p-4 uii:bg-gray-50 dark:uii:bg-gray-900` }, /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:flex uii:items-center uii:gap-4 uii:mb-2 uii:flex-wrap\" }, /* @__PURE__ */ React2__default.default.createElement(\"span\", { className: \"uii:font-semibold uii:text-sm\" }, \"\\u{1F6E0}\\uFE0F Dev Mode\"), /* @__PURE__ */ React2__default.default.createElement(\"span\", { className: \"uii:text-xs uii:text-gray-500\" }, \"Node: \", devCtx.nodeId), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => setShowData(!showData),\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:bg-blue-100 dark:uii:bg-blue-900 uii:rounded hover:uii:bg-blue-200\"\n },\n showData ? \"Hide\" : \"Show\",\n \" Data\"\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => setShowTypeEditor(!showTypeEditor),\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:bg-purple-100 dark:uii:bg-purple-900 uii:rounded hover:uii:bg-purple-200\"\n },\n showTypeEditor ? \"Hide\" : \"Spoof\",\n \" Types\"\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => {\n const json = devCtx.exportData();\n navigator.clipboard.writeText(json);\n alert(\"Data copied to clipboard!\");\n },\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:bg-green-100 dark:uii:bg-green-900 uii:rounded hover:uii:bg-green-200\"\n },\n \"Export\"\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => {\n const json = prompt(\"Paste JSON data:\");\n if (json) devCtx.importData(json);\n },\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:bg-yellow-100 dark:uii:bg-yellow-900 uii:rounded hover:uii:bg-yellow-200\"\n },\n \"Import\"\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => {\n if (confirm(\"Clear all data?\")) devCtx.clearAll();\n },\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:bg-red-100 dark:uii:bg-red-900 uii:rounded hover:uii:bg-red-200\"\n },\n \"Clear\"\n )), showTypeEditor && /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:mt-3 uii:p-3 uii:bg-purple-50 dark:uii:bg-purple-950 uii:rounded-lg uii:border uii:border-purple-200 dark:uii:border-purple-800\" }, /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:text-xs uii:font-medium uii:mb-2 uii:text-purple-700 dark:uii:text-purple-300\" }, \"Spoof Inferred Types (simulate external field types)\"), /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:flex uii:gap-2 uii:mb-2 uii:flex-wrap\" }, /* @__PURE__ */ React2__default.default.createElement(\n \"input\",\n {\n type: \"text\",\n placeholder: \"Field name (e.g., switchExpression)\",\n value: newTypeKey,\n onChange: (e) => setNewTypeKey(e.target.value),\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[150px] uii:bg-white dark:uii:bg-gray-800\"\n }\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"input\",\n {\n type: \"text\",\n placeholder: \"Type (e.g., string | number)\",\n value: newTypeValue,\n onChange: (e) => setNewTypeValue(e.target.value),\n onKeyDown: (e) => e.key === \"Enter\" && handleAddType(),\n className: \"uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[200px] uii:bg-white dark:uii:bg-gray-800\"\n }\n ), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: handleAddType,\n disabled: !newTypeKey.trim() || !newTypeValue.trim(),\n className: \"uii:text-xs uii:px-3 uii:py-1 uii:bg-purple-500 uii:text-white uii:rounded hover:uii:bg-purple-600 disabled:uii:opacity-50 disabled:uii:cursor-not-allowed\"\n },\n \"Add\"\n )), Object.keys(devCtx.inferredTypes).length > 0 && /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:mt-2\" }, /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:flex uii:items-center uii:justify-between uii:mb-1\" }, /* @__PURE__ */ React2__default.default.createElement(\"span\", { className: \"uii:text-xs uii:text-gray-500\" }, \"Current inferred types:\"), /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: handleClearAllTypes,\n className: \"uii:text-xs uii:px-2 uii:py-0.5 uii:bg-red-100 dark:uii:bg-red-900 uii:text-red-700 dark:uii:text-red-300 uii:rounded hover:uii:bg-red-200\"\n },\n \"Clear All\"\n )), /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:space-y-1\" }, Object.entries(devCtx.inferredTypes).map(([key, value]) => value && /* @__PURE__ */ React2__default.default.createElement(\n \"div\",\n {\n key,\n className: \"uii:flex uii:items-center uii:gap-2 uii:text-xs uii:bg-white dark:uii:bg-gray-800 uii:px-2 uii:py-1 uii:rounded\"\n },\n /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => {\n navigator.clipboard.writeText(key);\n },\n className: \"uii:text-gray-400 hover:uii:text-purple-600 uii:text-xs\",\n title: \"Copy field name\"\n },\n \"\\u{1F4CB}\"\n ),\n /* @__PURE__ */ React2__default.default.createElement(\n \"span\",\n {\n className: \"uii:font-mono uii:text-purple-600 dark:uii:text-purple-400 uii:cursor-pointer uii:truncate uii:max-w-[300px]\",\n onClick: () => {\n navigator.clipboard.writeText(key);\n },\n title: key\n },\n key\n ),\n /* @__PURE__ */ React2__default.default.createElement(\"span\", { className: \"uii:text-gray-400\" }, \"\\u2192\"),\n /* @__PURE__ */ React2__default.default.createElement(\"span\", { className: \"uii:font-mono uii:text-gray-600 dark:uii:text-gray-300 uii:flex-1 uii:truncate\" }, value),\n /* @__PURE__ */ React2__default.default.createElement(\n \"button\",\n {\n onClick: () => handleRemoveType(key),\n className: \"uii:text-red-500 hover:uii:text-red-700 uii:text-xs\",\n title: \"Remove\"\n },\n \"\\u2715\"\n )\n ))))), showData && /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:mt-2\" }, /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:text-xs uii:mb-1 uii:font-medium\" }, \"Data:\"), /* @__PURE__ */ React2__default.default.createElement(\"pre\", { className: \"uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-48\" }, JSON.stringify(devCtx.data, null, 2)), /* @__PURE__ */ React2__default.default.createElement(\"div\", { className: \"uii:text-xs uii:mb-1 uii:mt-2 uii:font-medium\" }, \"Inferred Types:\"), /* @__PURE__ */ React2__default.default.createElement(\"pre\", { className: \"uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-24\" }, JSON.stringify(devCtx.inferredTypes, null, 2))));\n}\n\nexports.DevContext = DevContext;\nexports.DevProvider = DevProvider;\nexports.DevToolbar = DevToolbar;\nexports.useDevContext = useDevContext;\nexports.useInferredTypes = useInferredTypes;\nexports.useNodeProperty = useNodeProperty;\n//# sourceMappingURL=index.cjs.map\n","'use client';\n\nimport React, { createContext, useContext, useState, useCallback, useEffect, useMemo, type PropsWithChildren } from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Configuration for the DevProvider\n */\nexport interface DevProviderConfig {\n /** Unique key for localStorage persistence (defaults to 'process-dev') */\n storageKey?: string;\n /** Initial data to populate the store */\n initialData?: Record<string, any>;\n /** Whether to persist to localStorage (default: true) */\n persist?: boolean;\n /** Mock node ID (default: 'dev-node-1') */\n nodeId?: string;\n}\n\n/**\n * Context value for development/testing\n */\nexport interface DevContextValue {\n // Node property store\n data: Record<string, any>;\n setProperty: (key: string, value: any) => void;\n getProperty: <T = any>(key: string) => T | undefined;\n \n // Inferred types\n inferredTypes: Record<string, string>;\n setInferredType: (fieldName: string, type: string) => void;\n getInferredType: (fieldName: string) => string | undefined;\n /** Remove an inferred type by field name */\n clearInferredType: (fieldName: string) => void;\n /** Remove all inferred types */\n clearAllInferredTypes: () => void;\n \n // Metadata\n nodeId: string;\n \n // Utilities\n clearAll: () => void;\n exportData: () => string;\n importData: (json: string) => void;\n}\n\n// ============================================================================\n// Context\n// ============================================================================\n\nexport const DevContext = createContext<DevContextValue | null>(null);\n\n/**\n * Hook to access the dev context for property management\n */\nexport function useDevContext(): DevContextValue | null {\n return useContext(DevContext);\n}\n\n/**\n * Hook that mimics useNodeProperty from the real system\n * Works in both dev mode (with DevProvider) and production (with NodePropertyProvider)\n */\nexport function useNodeProperty<T = any>(fieldName: string): [T | undefined, (value: T) => void] {\n const devCtx = useDevContext();\n \n if (devCtx) {\n // Dev mode - use local state with persistence\n const value = devCtx.getProperty<T>(fieldName);\n const setValue = useCallback((newValue: T) => {\n devCtx.setProperty(fieldName, newValue);\n }, [devCtx, fieldName]);\n \n return [value, setValue];\n }\n \n // Not in dev mode - this is a fallback, real implementation should be provided by host\n console.warn(`useNodeProperty('${fieldName}') called outside of DevProvider - returning undefined`);\n const [localValue, setLocalValue] = useState<T | undefined>(undefined);\n return [localValue, setLocalValue];\n}\n\n/**\n * Hook that mimics useInferredTypes from the real system\n */\nexport function useInferredTypes() {\n const devCtx = useDevContext();\n \n if (devCtx) {\n return {\n inferredTypes: devCtx.inferredTypes,\n setInferredType: devCtx.setInferredType,\n getInferredType: devCtx.getInferredType,\n };\n }\n \n // Not in dev mode - return null (components should handle this gracefully)\n return null;\n}\n\n// ============================================================================\n// Provider\n// ============================================================================\n\n/**\n * DevProvider - Development environment for testing custom UI components\n * \n * Features:\n * - Persists data to localStorage\n * - Provides mock implementations of useNodeProperty and useInferredTypes\n * - Supports import/export of data for testing scenarios\n * \n * Usage:\n * ```tsx\n * import { DevProvider } from '@process.co/ui/dev';\n * \n * function App() {\n * return (\n * <DevProvider \n * storageKey=\"my-component-dev\"\n * initialData={{ switchValue: { cases: [] } }}\n * >\n * <MyCustomComponent fieldName=\"switchValue\" />\n * </DevProvider>\n * );\n * }\n * ```\n */\nexport function DevProvider({\n children, \n storageKey = 'process-dev',\n initialData = {},\n persist = true,\n nodeId = 'dev-node-1',\n}: PropsWithChildren<DevProviderConfig>) {\n \n // ========== Property Store ==========\n const [data, setData] = useState<Record<string, any>>(() => {\n // Try to load from localStorage first\n if (persist && typeof window !== 'undefined') {\n try {\n const stored = localStorage.getItem(`${storageKey}:data`);\n if (stored) {\n return { ...initialData, ...JSON.parse(stored) };\n }\n } catch (e) {\n console.warn('DevProvider: Failed to load from localStorage', e);\n }\n }\n return initialData;\n });\n \n // ========== Inferred Types ==========\n const [inferredTypes, setInferredTypesState] = useState<Record<string, string>>(() => {\n if (persist && typeof window !== 'undefined') {\n try {\n const stored = localStorage.getItem(`${storageKey}:inferredTypes`);\n if (stored) {\n return JSON.parse(stored);\n }\n } catch (e) {\n console.warn('DevProvider: Failed to load inferredTypes from localStorage', e);\n }\n }\n return {};\n });\n \n // ========== Persist to localStorage ==========\n useEffect(() => {\n if (persist && typeof window !== 'undefined') {\n try {\n localStorage.setItem(`${storageKey}:data`, JSON.stringify(data));\n } catch (e) {\n console.warn('DevProvider: Failed to save data to localStorage', e);\n }\n }\n }, [data, storageKey, persist]);\n \n useEffect(() => {\n if (persist && typeof window !== 'undefined') {\n try {\n localStorage.setItem(`${storageKey}:inferredTypes`, JSON.stringify(inferredTypes));\n } catch (e) {\n console.warn('DevProvider: Failed to save inferredTypes to localStorage', e);\n }\n }\n }, [inferredTypes, storageKey, persist]);\n \n // ========== Property Methods ==========\n const setProperty = useCallback((key: string, value: any) => {\n setData(prev => ({ ...prev, [key]: value }));\n }, []);\n \n const getProperty = useCallback(<T = any>(key: string): T | undefined => {\n return data[key] as T | undefined;\n }, [data]);\n \n // ========== Inferred Types Methods ==========\n const setInferredType = useCallback((fieldName: string, type: string) => {\n setInferredTypesState(prev => ({ ...prev, [fieldName]: type }));\n }, []);\n \n const getInferredType = useCallback((fieldName: string): string | undefined => {\n return inferredTypes[fieldName];\n }, [inferredTypes]);\n \n const clearInferredType = useCallback((fieldName: string) => {\n setInferredTypesState(prev => {\n const { [fieldName]: _, ...rest } = prev;\n return rest;\n });\n }, []);\n \n const clearAllInferredTypes = useCallback(() => {\n setInferredTypesState({});\n }, []);\n \n // ========== Utility Methods ==========\n const clearAll = useCallback(() => {\n setData({});\n setInferredTypesState({});\n if (persist && typeof window !== 'undefined') {\n localStorage.removeItem(`${storageKey}:data`);\n localStorage.removeItem(`${storageKey}:inferredTypes`);\n }\n }, [storageKey, persist]);\n \n const exportData = useCallback(() => {\n return JSON.stringify({ data, inferredTypes }, null, 2);\n }, [data, inferredTypes]);\n \n const importData = useCallback((json: string) => {\n try {\n const parsed = JSON.parse(json);\n if (parsed.data) setData(parsed.data);\n if (parsed.inferredTypes) setInferredTypesState(parsed.inferredTypes);\n } catch (e) {\n console.error('DevProvider: Failed to import data', e);\n }\n }, []);\n \n // ========== Context Value ==========\n const value = useMemo<DevContextValue>(() => ({\n data,\n setProperty,\n getProperty,\n inferredTypes,\n setInferredType,\n getInferredType,\n clearInferredType,\n clearAllInferredTypes,\n nodeId,\n clearAll,\n exportData,\n importData,\n }), [data, setProperty, getProperty, inferredTypes, setInferredType, getInferredType, clearInferredType, clearAllInferredTypes, nodeId, clearAll, exportData, importData]);\n \n return (\n <DevContext.Provider value={value}>\n {children}\n </DevContext.Provider>\n );\n}\n\nexport default DevProvider;\n","'use client';\n\nimport React, { useState } from 'react';\nimport { useDevContext } from './DevProvider';\n// Note: CSS is provided by consumer via `import '@process.co/ui/styles'`\n\n/**\n * DevToolbar - Optional toolbar for development\n * Shows current data state and provides controls for import/export/clear\n * Also allows spoofing inferred types for testing components that depend on external field types\n */\nexport function DevToolbar({ className }: { className?: string }) {\n const devCtx = useDevContext();\n const [showData, setShowData] = useState(false);\n const [showTypeEditor, setShowTypeEditor] = useState(false);\n const [newTypeKey, setNewTypeKey] = useState('');\n const [newTypeValue, setNewTypeValue] = useState('');\n \n if (!devCtx) {\n return <div className={className}>DevToolbar: Not inside DevProvider</div>;\n }\n\n const handleAddType = () => {\n if (newTypeKey.trim() && newTypeValue.trim()) {\n devCtx.setInferredType(newTypeKey.trim(), newTypeValue.trim());\n setNewTypeKey('');\n setNewTypeValue('');\n }\n };\n\n const handleRemoveType = (key: string) => {\n devCtx.clearInferredType(key);\n };\n\n const handleClearAllTypes = () => {\n if (confirm('Clear all inferred types?')) {\n devCtx.clearAllInferredTypes();\n }\n };\n \n return (\n <div className={`${className || ''} uii:border uii:rounded-lg uii:p-4 uii:bg-gray-50 dark:uii:bg-gray-900`}>\n <div className=\"uii:flex uii:items-center uii:gap-4 uii:mb-2 uii:flex-wrap\">\n <span className=\"uii:font-semibold uii:text-sm\">🛠️ Dev Mode</span>\n <span className=\"uii:text-xs uii:text-gray-500\">Node: {devCtx.nodeId}</span>\n <button \n onClick={() => setShowData(!showData)}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:bg-blue-100 dark:uii:bg-blue-900 uii:rounded hover:uii:bg-blue-200\"\n >\n {showData ? 'Hide' : 'Show'} Data\n </button>\n <button \n onClick={() => setShowTypeEditor(!showTypeEditor)}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:bg-purple-100 dark:uii:bg-purple-900 uii:rounded hover:uii:bg-purple-200\"\n >\n {showTypeEditor ? 'Hide' : 'Spoof'} Types\n </button>\n <button \n onClick={() => {\n const json = devCtx.exportData();\n navigator.clipboard.writeText(json);\n alert('Data copied to clipboard!');\n }}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:bg-green-100 dark:uii:bg-green-900 uii:rounded hover:uii:bg-green-200\"\n >\n Export\n </button>\n <button \n onClick={() => {\n const json = prompt('Paste JSON data:');\n if (json) devCtx.importData(json);\n }}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:bg-yellow-100 dark:uii:bg-yellow-900 uii:rounded hover:uii:bg-yellow-200\"\n >\n Import\n </button>\n <button \n onClick={() => {\n if (confirm('Clear all data?')) devCtx.clearAll();\n }}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:bg-red-100 dark:uii:bg-red-900 uii:rounded hover:uii:bg-red-200\"\n >\n Clear\n </button>\n </div>\n\n {/* Inferred Types Spoofing Section */}\n {showTypeEditor && (\n <div className=\"uii:mt-3 uii:p-3 uii:bg-purple-50 dark:uii:bg-purple-950 uii:rounded-lg uii:border uii:border-purple-200 dark:uii:border-purple-800\">\n <div className=\"uii:text-xs uii:font-medium uii:mb-2 uii:text-purple-700 dark:uii:text-purple-300\">\n Spoof Inferred Types (simulate external field types)\n </div>\n \n {/* Add new type */}\n <div className=\"uii:flex uii:gap-2 uii:mb-2 uii:flex-wrap\">\n <input\n type=\"text\"\n placeholder=\"Field name (e.g., switchExpression)\"\n value={newTypeKey}\n onChange={(e) => setNewTypeKey(e.target.value)}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[150px] uii:bg-white dark:uii:bg-gray-800\"\n />\n <input\n type=\"text\"\n placeholder=\"Type (e.g., string | number)\"\n value={newTypeValue}\n onChange={(e) => setNewTypeValue(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && handleAddType()}\n className=\"uii:text-xs uii:px-2 uii:py-1 uii:border uii:rounded uii:flex-1 uii:min-w-[200px] uii:bg-white dark:uii:bg-gray-800\"\n />\n <button\n onClick={handleAddType}\n disabled={!newTypeKey.trim() || !newTypeValue.trim()}\n className=\"uii:text-xs uii:px-3 uii:py-1 uii:bg-purple-500 uii:text-white uii:rounded hover:uii:bg-purple-600 disabled:uii:opacity-50 disabled:uii:cursor-not-allowed\"\n >\n Add\n </button>\n </div>\n\n {/* Current inferred types */}\n {Object.keys(devCtx.inferredTypes).length > 0 && (\n <div className=\"uii:mt-2\">\n <div className=\"uii:flex uii:items-center uii:justify-between uii:mb-1\">\n <span className=\"uii:text-xs uii:text-gray-500\">Current inferred types:</span>\n <button\n onClick={handleClearAllTypes}\n className=\"uii:text-xs uii:px-2 uii:py-0.5 uii:bg-red-100 dark:uii:bg-red-900 uii:text-red-700 dark:uii:text-red-300 uii:rounded hover:uii:bg-red-200\"\n >\n Clear All\n </button>\n </div>\n <div className=\"uii:space-y-1\">\n {Object.entries(devCtx.inferredTypes).map(([key, value]) => (\n value && (\n <div \n key={key}\n className=\"uii:flex uii:items-center uii:gap-2 uii:text-xs uii:bg-white dark:uii:bg-gray-800 uii:px-2 uii:py-1 uii:rounded\"\n >\n <button\n onClick={() => {\n navigator.clipboard.writeText(key);\n }}\n className=\"uii:text-gray-400 hover:uii:text-purple-600 uii:text-xs\"\n title=\"Copy field name\"\n >\n 📋\n </button>\n <span \n className=\"uii:font-mono uii:text-purple-600 dark:uii:text-purple-400 uii:cursor-pointer uii:truncate uii:max-w-[300px]\"\n onClick={() => {\n navigator.clipboard.writeText(key);\n }}\n title={key}\n >\n {key}\n </span>\n <span className=\"uii:text-gray-400\">→</span>\n <span className=\"uii:font-mono uii:text-gray-600 dark:uii:text-gray-300 uii:flex-1 uii:truncate\">{value}</span>\n <button\n onClick={() => handleRemoveType(key)}\n className=\"uii:text-red-500 hover:uii:text-red-700 uii:text-xs\"\n title=\"Remove\"\n >\n ✕\n </button>\n </div>\n )\n ))}\n </div>\n </div>\n )}\n </div>\n )}\n \n {showData && (\n <div className=\"uii:mt-2\">\n <div className=\"uii:text-xs uii:mb-1 uii:font-medium\">Data:</div>\n <pre className=\"uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-48\">\n {JSON.stringify(devCtx.data, null, 2)}\n </pre>\n <div className=\"uii:text-xs uii:mb-1 uii:mt-2 uii:font-medium\">Inferred Types:</div>\n <pre className=\"uii:text-xs uii:bg-gray-100 dark:uii:bg-gray-800 uii:p-2 uii:rounded uii:overflow-auto uii:max-h-24\">\n {JSON.stringify(devCtx.inferredTypes, null, 2)}\n </pre>\n </div>\n )}\n </div>\n );\n}\n\nexport default DevToolbar;\n"]}