@measured/puck 0.21.0-canary.ec77dd9f → 0.21.0-canary.ece26d91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-O447AVCX.mjs +204 -0
  3. package/dist/Render-OFE6QLI2.mjs +55 -0
  4. package/dist/Render-QEMDIDQC.css +101 -0
  5. package/dist/{walk-tree-CkSoNBF7.d.mts → actions-ONhOkrvf.d.mts} +208 -33
  6. package/dist/{walk-tree-CkSoNBF7.d.ts → actions-ONhOkrvf.d.ts} +208 -33
  7. package/dist/chunk-2Q4PACDA.mjs +111 -0
  8. package/dist/chunk-62AAYNXG.mjs +63 -0
  9. package/dist/chunk-BSDEIOEK.mjs +706 -0
  10. package/dist/chunk-CSSRLPHM.mjs +11 -0
  11. package/dist/chunk-DAQLMM2T.mjs +1722 -0
  12. package/dist/chunk-M6W7YEVX.mjs +95 -0
  13. package/dist/chunk-NLUHDYVR.mjs +416 -0
  14. package/dist/chunk-PLXSMBAA.mjs +53 -0
  15. package/dist/chunk-QAWJTCV5.mjs +33 -0
  16. package/dist/chunk-QBGM4ELA.mjs +528 -0
  17. package/dist/{chunk-NW2GGRCZ.mjs → chunk-QBJ2LDJB.mjs} +1048 -2778
  18. package/dist/chunk-T3WX7XJ6.mjs +132 -0
  19. package/dist/chunk-V5I7CVLT.mjs +103 -0
  20. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  21. package/dist/chunk-Y656T6AQ.mjs +419 -0
  22. package/dist/full-2GJTAAZE.css +301 -0
  23. package/dist/full-BEMDJKDS.mjs +93 -0
  24. package/dist/index-BEoNHRI1.d.ts +116 -0
  25. package/dist/index-DfxZ7tZF.d.mts +116 -0
  26. package/dist/index.css +278 -22
  27. package/dist/index.d.mts +94 -111
  28. package/dist/index.d.ts +94 -111
  29. package/dist/index.js +5812 -2550
  30. package/dist/index.mjs +28 -9
  31. package/dist/internal.d.mts +27 -0
  32. package/dist/internal.d.ts +27 -0
  33. package/dist/internal.js +908 -0
  34. package/dist/internal.mjs +13 -0
  35. package/dist/loaded-JU3A7Y4L.mjs +57 -0
  36. package/dist/loaded-N3FYGF2Y.mjs +57 -0
  37. package/dist/loaded-OBY7OMS6.mjs +60 -0
  38. package/dist/loaded-RVWBFK7L.css +87 -0
  39. package/dist/no-external.css +278 -22
  40. package/dist/no-external.d.mts +19 -2
  41. package/dist/no-external.d.ts +19 -2
  42. package/dist/no-external.js +5812 -2550
  43. package/dist/no-external.mjs +28 -9
  44. package/dist/rsc.css +101 -0
  45. package/dist/rsc.d.mts +17 -2
  46. package/dist/rsc.d.ts +17 -2
  47. package/dist/rsc.js +409 -22
  48. package/dist/rsc.mjs +18 -9
  49. package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
  50. package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
  51. package/package.json +29 -2
  52. package/dist/chunk-TC25DCTQ.mjs +0 -965
@@ -0,0 +1,1722 @@
1
+ import {
2
+ createReducer,
3
+ generateId,
4
+ getItem,
5
+ makeStatePublic
6
+ } from "./chunk-QBGM4ELA.mjs";
7
+ import {
8
+ defaultAppState,
9
+ defaultViewports,
10
+ getChanged,
11
+ resolveComponentData
12
+ } from "./chunk-T3WX7XJ6.mjs";
13
+ import {
14
+ get_class_name_factory_default
15
+ } from "./chunk-Y2EFNT5P.mjs";
16
+ import {
17
+ walkAppState
18
+ } from "./chunk-NLUHDYVR.mjs";
19
+ import {
20
+ __async,
21
+ __objRest,
22
+ __spreadProps,
23
+ __spreadValues,
24
+ init_react_import
25
+ } from "./chunk-M6W7YEVX.mjs";
26
+
27
+ // ../../node_modules/lucide-react/dist/esm/icons/align-left.js
28
+ init_react_import();
29
+
30
+ // ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
31
+ init_react_import();
32
+ import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
33
+
34
+ // ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
35
+ init_react_import();
36
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
37
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
38
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
39
+ }).join(" ").trim();
40
+
41
+ // ../../node_modules/lucide-react/dist/esm/Icon.js
42
+ init_react_import();
43
+ import { forwardRef, createElement } from "react";
44
+
45
+ // ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
46
+ init_react_import();
47
+ var defaultAttributes = {
48
+ xmlns: "http://www.w3.org/2000/svg",
49
+ width: 24,
50
+ height: 24,
51
+ viewBox: "0 0 24 24",
52
+ fill: "none",
53
+ stroke: "currentColor",
54
+ strokeWidth: 2,
55
+ strokeLinecap: "round",
56
+ strokeLinejoin: "round"
57
+ };
58
+
59
+ // ../../node_modules/lucide-react/dist/esm/Icon.js
60
+ var Icon = forwardRef(
61
+ (_a, ref) => {
62
+ var _b = _a, {
63
+ color = "currentColor",
64
+ size = 24,
65
+ strokeWidth = 2,
66
+ absoluteStrokeWidth,
67
+ className = "",
68
+ children,
69
+ iconNode
70
+ } = _b, rest = __objRest(_b, [
71
+ "color",
72
+ "size",
73
+ "strokeWidth",
74
+ "absoluteStrokeWidth",
75
+ "className",
76
+ "children",
77
+ "iconNode"
78
+ ]);
79
+ return createElement(
80
+ "svg",
81
+ __spreadValues(__spreadProps(__spreadValues({
82
+ ref
83
+ }, defaultAttributes), {
84
+ width: size,
85
+ height: size,
86
+ stroke: color,
87
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
88
+ className: mergeClasses("lucide", className)
89
+ }), rest),
90
+ [
91
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
92
+ ...Array.isArray(children) ? children : [children]
93
+ ]
94
+ );
95
+ }
96
+ );
97
+
98
+ // ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
99
+ var createLucideIcon = (iconName, iconNode) => {
100
+ const Component = forwardRef2(
101
+ (_a, ref) => {
102
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
103
+ return createElement2(Icon, __spreadValues({
104
+ ref,
105
+ iconNode,
106
+ className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className)
107
+ }, props));
108
+ }
109
+ );
110
+ Component.displayName = `${iconName}`;
111
+ return Component;
112
+ };
113
+
114
+ // ../../node_modules/lucide-react/dist/esm/icons/align-left.js
115
+ var AlignLeft = createLucideIcon("AlignLeft", [
116
+ ["path", { d: "M15 12H3", key: "6jk70r" }],
117
+ ["path", { d: "M17 18H3", key: "1amg6g" }],
118
+ ["path", { d: "M21 6H3", key: "1jwq7v" }]
119
+ ]);
120
+
121
+ // ../../node_modules/lucide-react/dist/esm/icons/heading.js
122
+ init_react_import();
123
+ var Heading = createLucideIcon("Heading", [
124
+ ["path", { d: "M6 12h12", key: "8npq4p" }],
125
+ ["path", { d: "M6 20V4", key: "1w1bmo" }],
126
+ ["path", { d: "M18 20V4", key: "o2hl4u" }]
127
+ ]);
128
+
129
+ // ../../node_modules/lucide-react/dist/esm/icons/list.js
130
+ init_react_import();
131
+ var List = createLucideIcon("List", [
132
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
133
+ ["path", { d: "M3 18h.01", key: "1tta3j" }],
134
+ ["path", { d: "M3 6h.01", key: "1rqtza" }],
135
+ ["path", { d: "M8 12h13", key: "1za7za" }],
136
+ ["path", { d: "M8 18h13", key: "1lx6n3" }],
137
+ ["path", { d: "M8 6h13", key: "ik3vkj" }]
138
+ ]);
139
+
140
+ // ../../node_modules/lucide-react/dist/esm/lucide-react.js
141
+ init_react_import();
142
+
143
+ // ../../node_modules/lucide-react/dist/esm/icons/align-center.js
144
+ init_react_import();
145
+ var AlignCenter = createLucideIcon("AlignCenter", [
146
+ ["path", { d: "M17 12H7", key: "16if0g" }],
147
+ ["path", { d: "M19 18H5", key: "18s9l3" }],
148
+ ["path", { d: "M21 6H3", key: "1jwq7v" }]
149
+ ]);
150
+
151
+ // ../../node_modules/lucide-react/dist/esm/icons/align-justify.js
152
+ init_react_import();
153
+ var AlignJustify = createLucideIcon("AlignJustify", [
154
+ ["path", { d: "M3 12h18", key: "1i2n21" }],
155
+ ["path", { d: "M3 18h18", key: "1h113x" }],
156
+ ["path", { d: "M3 6h18", key: "d0wm0j" }]
157
+ ]);
158
+
159
+ // ../../node_modules/lucide-react/dist/esm/icons/align-right.js
160
+ init_react_import();
161
+ var AlignRight = createLucideIcon("AlignRight", [
162
+ ["path", { d: "M21 12H9", key: "dn1m92" }],
163
+ ["path", { d: "M21 18H7", key: "1ygte8" }],
164
+ ["path", { d: "M21 6H3", key: "1jwq7v" }]
165
+ ]);
166
+
167
+ // ../../node_modules/lucide-react/dist/esm/icons/bold.js
168
+ init_react_import();
169
+ var Bold = createLucideIcon("Bold", [
170
+ [
171
+ "path",
172
+ { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
173
+ ]
174
+ ]);
175
+
176
+ // ../../node_modules/lucide-react/dist/esm/icons/chevron-down.js
177
+ init_react_import();
178
+ var ChevronDown = createLucideIcon("ChevronDown", [
179
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
180
+ ]);
181
+
182
+ // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
183
+ init_react_import();
184
+ var ChevronRight = createLucideIcon("ChevronRight", [
185
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
186
+ ]);
187
+
188
+ // ../../node_modules/lucide-react/dist/esm/icons/chevron-up.js
189
+ init_react_import();
190
+ var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
191
+
192
+ // ../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js
193
+ init_react_import();
194
+ var CircleCheckBig = createLucideIcon("CircleCheckBig", [
195
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
196
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
197
+ ]);
198
+
199
+ // ../../node_modules/lucide-react/dist/esm/icons/code.js
200
+ init_react_import();
201
+ var Code = createLucideIcon("Code", [
202
+ ["polyline", { points: "16 18 22 12 16 6", key: "z7tu5w" }],
203
+ ["polyline", { points: "8 6 2 12 8 18", key: "1eg1df" }]
204
+ ]);
205
+
206
+ // ../../node_modules/lucide-react/dist/esm/icons/copy.js
207
+ init_react_import();
208
+ var Copy = createLucideIcon("Copy", [
209
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
210
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
211
+ ]);
212
+
213
+ // ../../node_modules/lucide-react/dist/esm/icons/corner-left-up.js
214
+ init_react_import();
215
+ var CornerLeftUp = createLucideIcon("CornerLeftUp", [
216
+ ["polyline", { points: "14 9 9 4 4 9", key: "m9oyvo" }],
217
+ ["path", { d: "M20 20h-7a4 4 0 0 1-4-4V4", key: "1blwi3" }]
218
+ ]);
219
+
220
+ // ../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js
221
+ init_react_import();
222
+ var EllipsisVertical = createLucideIcon("EllipsisVertical", [
223
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
224
+ ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
225
+ ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
226
+ ]);
227
+
228
+ // ../../node_modules/lucide-react/dist/esm/icons/globe.js
229
+ init_react_import();
230
+ var Globe = createLucideIcon("Globe", [
231
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
232
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
233
+ ["path", { d: "M2 12h20", key: "9i4pu4" }]
234
+ ]);
235
+
236
+ // ../../node_modules/lucide-react/dist/esm/icons/hash.js
237
+ init_react_import();
238
+ var Hash = createLucideIcon("Hash", [
239
+ ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
240
+ ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
241
+ ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
242
+ ["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
243
+ ]);
244
+
245
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
246
+ init_react_import();
247
+ var Heading1 = createLucideIcon("Heading1", [
248
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
249
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
250
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
251
+ ["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
252
+ ]);
253
+
254
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-2.js
255
+ init_react_import();
256
+ var Heading2 = createLucideIcon("Heading2", [
257
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
258
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
259
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
260
+ ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
261
+ ]);
262
+
263
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-3.js
264
+ init_react_import();
265
+ var Heading3 = createLucideIcon("Heading3", [
266
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
267
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
268
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
269
+ ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
270
+ ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
271
+ ]);
272
+
273
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-4.js
274
+ init_react_import();
275
+ var Heading4 = createLucideIcon("Heading4", [
276
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
277
+ ["path", { d: "M17 10v3a1 1 0 0 0 1 1h3", key: "tj5zdr" }],
278
+ ["path", { d: "M21 10v8", key: "1kdml4" }],
279
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
280
+ ["path", { d: "M4 18V6", key: "1rz3zl" }]
281
+ ]);
282
+
283
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-5.js
284
+ init_react_import();
285
+ var Heading5 = createLucideIcon("Heading5", [
286
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
287
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
288
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
289
+ ["path", { d: "M17 13v-3h4", key: "1nvgqp" }],
290
+ [
291
+ "path",
292
+ { d: "M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17", key: "2nebdn" }
293
+ ]
294
+ ]);
295
+
296
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-6.js
297
+ init_react_import();
298
+ var Heading6 = createLucideIcon("Heading6", [
299
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
300
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
301
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
302
+ ["circle", { cx: "19", cy: "16", r: "2", key: "15mx69" }],
303
+ ["path", { d: "M20 10c-2 2-3 3.5-3 6", key: "f35dl0" }]
304
+ ]);
305
+
306
+ // ../../node_modules/lucide-react/dist/esm/icons/italic.js
307
+ init_react_import();
308
+ var Italic = createLucideIcon("Italic", [
309
+ ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
310
+ ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
311
+ ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
312
+ ]);
313
+
314
+ // ../../node_modules/lucide-react/dist/esm/icons/layers.js
315
+ init_react_import();
316
+ var Layers = createLucideIcon("Layers", [
317
+ [
318
+ "path",
319
+ {
320
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
321
+ key: "zw3jo"
322
+ }
323
+ ],
324
+ [
325
+ "path",
326
+ {
327
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
328
+ key: "1wduqc"
329
+ }
330
+ ],
331
+ [
332
+ "path",
333
+ {
334
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
335
+ key: "kqbvx6"
336
+ }
337
+ ]
338
+ ]);
339
+
340
+ // ../../node_modules/lucide-react/dist/esm/icons/layout-grid.js
341
+ init_react_import();
342
+ var LayoutGrid = createLucideIcon("LayoutGrid", [
343
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
344
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
345
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
346
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
347
+ ]);
348
+
349
+ // ../../node_modules/lucide-react/dist/esm/icons/link.js
350
+ init_react_import();
351
+ var Link = createLucideIcon("Link", [
352
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
353
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
354
+ ]);
355
+
356
+ // ../../node_modules/lucide-react/dist/esm/icons/list-ordered.js
357
+ init_react_import();
358
+ var ListOrdered = createLucideIcon("ListOrdered", [
359
+ ["path", { d: "M10 12h11", key: "6m4ad9" }],
360
+ ["path", { d: "M10 18h11", key: "11hvi2" }],
361
+ ["path", { d: "M10 6h11", key: "c7qv1k" }],
362
+ ["path", { d: "M4 10h2", key: "16xx2s" }],
363
+ ["path", { d: "M4 6h1v4", key: "cnovpq" }],
364
+ ["path", { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1", key: "m9a95d" }]
365
+ ]);
366
+
367
+ // ../../node_modules/lucide-react/dist/esm/icons/lock-open.js
368
+ init_react_import();
369
+ var LockOpen = createLucideIcon("LockOpen", [
370
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
371
+ ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
372
+ ]);
373
+
374
+ // ../../node_modules/lucide-react/dist/esm/icons/lock.js
375
+ init_react_import();
376
+ var Lock = createLucideIcon("Lock", [
377
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
378
+ ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
379
+ ]);
380
+
381
+ // ../../node_modules/lucide-react/dist/esm/icons/minus.js
382
+ init_react_import();
383
+ var Minus = createLucideIcon("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
384
+
385
+ // ../../node_modules/lucide-react/dist/esm/icons/monitor.js
386
+ init_react_import();
387
+ var Monitor = createLucideIcon("Monitor", [
388
+ ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
389
+ ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
390
+ ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
391
+ ]);
392
+
393
+ // ../../node_modules/lucide-react/dist/esm/icons/panel-left.js
394
+ init_react_import();
395
+ var PanelLeft = createLucideIcon("PanelLeft", [
396
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
397
+ ["path", { d: "M9 3v18", key: "fh3hqa" }]
398
+ ]);
399
+
400
+ // ../../node_modules/lucide-react/dist/esm/icons/panel-right.js
401
+ init_react_import();
402
+ var PanelRight = createLucideIcon("PanelRight", [
403
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
404
+ ["path", { d: "M15 3v18", key: "14nvp0" }]
405
+ ]);
406
+
407
+ // ../../node_modules/lucide-react/dist/esm/icons/plus.js
408
+ init_react_import();
409
+ var Plus = createLucideIcon("Plus", [
410
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
411
+ ["path", { d: "M12 5v14", key: "s699le" }]
412
+ ]);
413
+
414
+ // ../../node_modules/lucide-react/dist/esm/icons/quote.js
415
+ init_react_import();
416
+ var Quote = createLucideIcon("Quote", [
417
+ [
418
+ "path",
419
+ {
420
+ d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
421
+ key: "rib7q0"
422
+ }
423
+ ],
424
+ [
425
+ "path",
426
+ {
427
+ d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
428
+ key: "1ymkrd"
429
+ }
430
+ ]
431
+ ]);
432
+
433
+ // ../../node_modules/lucide-react/dist/esm/icons/redo-2.js
434
+ init_react_import();
435
+ var Redo2 = createLucideIcon("Redo2", [
436
+ ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
437
+ ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
438
+ ]);
439
+
440
+ // ../../node_modules/lucide-react/dist/esm/icons/search.js
441
+ init_react_import();
442
+ var Search = createLucideIcon("Search", [
443
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
444
+ ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
445
+ ]);
446
+
447
+ // ../../node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js
448
+ init_react_import();
449
+ var SlidersHorizontal = createLucideIcon("SlidersHorizontal", [
450
+ ["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
451
+ ["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
452
+ ["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
453
+ ["line", { x1: "8", x2: "3", y1: "12", y2: "12", key: "ntss68" }],
454
+ ["line", { x1: "21", x2: "16", y1: "20", y2: "20", key: "14d8ph" }],
455
+ ["line", { x1: "12", x2: "3", y1: "20", y2: "20", key: "m0wm8r" }],
456
+ ["line", { x1: "14", x2: "14", y1: "2", y2: "6", key: "14e1ph" }],
457
+ ["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
458
+ ["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }]
459
+ ]);
460
+
461
+ // ../../node_modules/lucide-react/dist/esm/icons/smartphone.js
462
+ init_react_import();
463
+ var Smartphone = createLucideIcon("Smartphone", [
464
+ ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
465
+ ["path", { d: "M12 18h.01", key: "mhygvu" }]
466
+ ]);
467
+
468
+ // ../../node_modules/lucide-react/dist/esm/icons/square-code.js
469
+ init_react_import();
470
+ var SquareCode = createLucideIcon("SquareCode", [
471
+ ["path", { d: "M10 9.5 8 12l2 2.5", key: "3mjy60" }],
472
+ ["path", { d: "m14 9.5 2 2.5-2 2.5", key: "1bir2l" }],
473
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
474
+ ]);
475
+
476
+ // ../../node_modules/lucide-react/dist/esm/icons/strikethrough.js
477
+ init_react_import();
478
+ var Strikethrough = createLucideIcon("Strikethrough", [
479
+ ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
480
+ ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
481
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
482
+ ]);
483
+
484
+ // ../../node_modules/lucide-react/dist/esm/icons/tablet.js
485
+ init_react_import();
486
+ var Tablet = createLucideIcon("Tablet", [
487
+ ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
488
+ ["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
489
+ ]);
490
+
491
+ // ../../node_modules/lucide-react/dist/esm/icons/trash.js
492
+ init_react_import();
493
+ var Trash = createLucideIcon("Trash", [
494
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
495
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
496
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
497
+ ]);
498
+
499
+ // ../../node_modules/lucide-react/dist/esm/icons/type.js
500
+ init_react_import();
501
+ var Type = createLucideIcon("Type", [
502
+ ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
503
+ ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
504
+ ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
505
+ ]);
506
+
507
+ // ../../node_modules/lucide-react/dist/esm/icons/underline.js
508
+ init_react_import();
509
+ var Underline = createLucideIcon("Underline", [
510
+ ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
511
+ ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
512
+ ]);
513
+
514
+ // ../../node_modules/lucide-react/dist/esm/icons/undo-2.js
515
+ init_react_import();
516
+ var Undo2 = createLucideIcon("Undo2", [
517
+ ["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
518
+ ["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
519
+ ]);
520
+
521
+ // ../../node_modules/lucide-react/dist/esm/icons/zoom-in.js
522
+ init_react_import();
523
+ var ZoomIn = createLucideIcon("ZoomIn", [
524
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
525
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
526
+ ["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
527
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
528
+ ]);
529
+
530
+ // ../../node_modules/lucide-react/dist/esm/icons/zoom-out.js
531
+ init_react_import();
532
+ var ZoomOut = createLucideIcon("ZoomOut", [
533
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
534
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
535
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
536
+ ]);
537
+
538
+ // store/index.ts
539
+ init_react_import();
540
+ import { create as create2, useStore } from "zustand";
541
+ import { subscribeWithSelector as subscribeWithSelector2 } from "zustand/middleware";
542
+ import { createContext, useContext } from "react";
543
+
544
+ // store/slices/history.ts
545
+ init_react_import();
546
+ import { useEffect as useEffect2 } from "react";
547
+
548
+ // lib/use-hotkey.ts
549
+ init_react_import();
550
+ import { useEffect } from "react";
551
+ import { create } from "zustand";
552
+ import { subscribeWithSelector } from "zustand/middleware";
553
+ var keyCodeMap = {
554
+ ControlLeft: "ctrl",
555
+ ControlRight: "ctrl",
556
+ MetaLeft: "meta",
557
+ MetaRight: "meta",
558
+ ShiftLeft: "shift",
559
+ ShiftRight: "shift",
560
+ KeyA: "a",
561
+ KeyB: "b",
562
+ KeyC: "c",
563
+ KeyD: "d",
564
+ KeyE: "e",
565
+ KeyF: "f",
566
+ KeyG: "g",
567
+ KeyH: "h",
568
+ KeyI: "i",
569
+ KeyJ: "j",
570
+ KeyK: "k",
571
+ KeyL: "l",
572
+ KeyM: "m",
573
+ KeyN: "n",
574
+ KeyO: "o",
575
+ KeyP: "p",
576
+ KeyQ: "q",
577
+ KeyR: "r",
578
+ KeyS: "s",
579
+ KeyT: "t",
580
+ KeyU: "u",
581
+ KeyV: "v",
582
+ KeyW: "w",
583
+ KeyX: "x",
584
+ KeyY: "y",
585
+ KeyZ: "z",
586
+ Delete: "delete",
587
+ Backspace: "backspace"
588
+ };
589
+ var useHotkeyStore = create()(
590
+ subscribeWithSelector((set) => ({
591
+ held: {},
592
+ hold: (key) => set((s) => s.held[key] ? s : { held: __spreadProps(__spreadValues({}, s.held), { [key]: true }) }),
593
+ release: (key) => set((s) => s.held[key] ? { held: __spreadProps(__spreadValues({}, s.held), { [key]: false }) } : s),
594
+ reset: (held = {}) => set(() => ({ held })),
595
+ triggers: {}
596
+ }))
597
+ );
598
+ var monitorHotkeys = (doc) => {
599
+ const onKeyDown = (e) => {
600
+ const key = keyCodeMap[e.code];
601
+ if (key) {
602
+ useHotkeyStore.getState().hold(key);
603
+ const { held, triggers } = useHotkeyStore.getState();
604
+ Object.values(triggers).forEach(({ combo, cb }) => {
605
+ const conditionMet = Object.entries(combo).every(
606
+ ([key2, value]) => value === !!held[key2]
607
+ ) && Object.entries(held).every(
608
+ ([key2, value]) => value === !!combo[key2]
609
+ );
610
+ if (conditionMet) {
611
+ const handled = cb(e);
612
+ if (handled !== false) {
613
+ e.preventDefault();
614
+ }
615
+ }
616
+ });
617
+ if (key !== "meta" && key !== "ctrl" && key !== "shift") {
618
+ useHotkeyStore.getState().release(key);
619
+ }
620
+ }
621
+ };
622
+ const onKeyUp = (e) => {
623
+ const key = keyCodeMap[e.code];
624
+ if (key) {
625
+ if (key === "meta") {
626
+ useHotkeyStore.getState().reset();
627
+ } else {
628
+ useHotkeyStore.getState().release(key);
629
+ }
630
+ }
631
+ };
632
+ const onVisibilityChanged = (e) => {
633
+ if (document.visibilityState === "hidden") {
634
+ useHotkeyStore.getState().reset();
635
+ }
636
+ };
637
+ const onBlur = () => {
638
+ useHotkeyStore.getState().reset();
639
+ };
640
+ window.addEventListener("blur", onBlur);
641
+ doc.addEventListener("keydown", onKeyDown);
642
+ doc.addEventListener("keyup", onKeyUp);
643
+ doc.addEventListener("visibilitychange", onVisibilityChanged);
644
+ return () => {
645
+ doc.removeEventListener("keydown", onKeyDown);
646
+ doc.removeEventListener("keyup", onKeyUp);
647
+ doc.removeEventListener("visibilitychange", onVisibilityChanged);
648
+ window.removeEventListener("blur", onBlur);
649
+ };
650
+ };
651
+ var useMonitorHotkeys = () => {
652
+ useEffect(() => monitorHotkeys(document), []);
653
+ };
654
+ var useHotkey = (combo, cb) => {
655
+ useEffect(
656
+ () => useHotkeyStore.setState((s) => ({
657
+ triggers: __spreadProps(__spreadValues({}, s.triggers), {
658
+ [`${Object.keys(combo).join("+")}`]: { combo, cb }
659
+ })
660
+ })),
661
+ []
662
+ );
663
+ };
664
+
665
+ // store/slices/history.ts
666
+ var EMPTY_HISTORY_INDEX = 0;
667
+ function debounce(func, timeout = 300) {
668
+ let timer;
669
+ return (...args) => {
670
+ clearTimeout(timer);
671
+ timer = setTimeout(() => {
672
+ func(...args);
673
+ }, timeout);
674
+ };
675
+ }
676
+ var tidyState = (state) => {
677
+ return __spreadProps(__spreadValues({}, state), {
678
+ ui: __spreadProps(__spreadValues({}, state.ui), {
679
+ field: __spreadProps(__spreadValues({}, state.ui.field), {
680
+ focus: null
681
+ })
682
+ })
683
+ });
684
+ };
685
+ var createHistorySlice = (set, get) => {
686
+ const record = debounce((state) => {
687
+ const { histories, index } = get().history;
688
+ const history = {
689
+ state,
690
+ id: generateId("history")
691
+ };
692
+ const newHistories = [...histories.slice(0, index + 1), history];
693
+ set({
694
+ history: __spreadProps(__spreadValues({}, get().history), {
695
+ histories: newHistories,
696
+ index: newHistories.length - 1
697
+ })
698
+ });
699
+ }, 250);
700
+ return {
701
+ initialAppState: {},
702
+ index: EMPTY_HISTORY_INDEX,
703
+ histories: [],
704
+ hasPast: () => get().history.index > EMPTY_HISTORY_INDEX,
705
+ hasFuture: () => get().history.index < get().history.histories.length - 1,
706
+ prevHistory: () => {
707
+ const { history } = get();
708
+ return history.hasPast() ? history.histories[history.index - 1] : null;
709
+ },
710
+ nextHistory: () => {
711
+ const s = get().history;
712
+ return s.hasFuture() ? s.histories[s.index + 1] : null;
713
+ },
714
+ currentHistory: () => get().history.histories[get().history.index],
715
+ back: () => {
716
+ var _a;
717
+ const { history, dispatch } = get();
718
+ if (history.hasPast()) {
719
+ const state = tidyState(
720
+ ((_a = history.prevHistory()) == null ? void 0 : _a.state) || history.initialAppState
721
+ );
722
+ dispatch({
723
+ type: "set",
724
+ state
725
+ });
726
+ set({ history: __spreadProps(__spreadValues({}, history), { index: history.index - 1 }) });
727
+ }
728
+ },
729
+ forward: () => {
730
+ var _a;
731
+ const { history, dispatch } = get();
732
+ if (history.hasFuture()) {
733
+ const state = (_a = history.nextHistory()) == null ? void 0 : _a.state;
734
+ dispatch({ type: "set", state: state ? tidyState(state) : {} });
735
+ set({ history: __spreadProps(__spreadValues({}, history), { index: history.index + 1 }) });
736
+ }
737
+ },
738
+ setHistories: (histories) => {
739
+ var _a;
740
+ const { dispatch, history } = get();
741
+ dispatch({
742
+ type: "set",
743
+ state: ((_a = histories[histories.length - 1]) == null ? void 0 : _a.state) || history.initialAppState
744
+ });
745
+ set({ history: __spreadProps(__spreadValues({}, history), { histories, index: histories.length - 1 }) });
746
+ },
747
+ setHistoryIndex: (index) => {
748
+ var _a;
749
+ const { dispatch, history } = get();
750
+ dispatch({
751
+ type: "set",
752
+ state: ((_a = history.histories[index]) == null ? void 0 : _a.state) || history.initialAppState
753
+ });
754
+ set({ history: __spreadProps(__spreadValues({}, history), { index }) });
755
+ },
756
+ record
757
+ };
758
+ };
759
+ function useRegisterHistorySlice(appStore, {
760
+ histories,
761
+ index,
762
+ initialAppState
763
+ }) {
764
+ useEffect2(
765
+ () => appStore.setState({
766
+ history: __spreadProps(__spreadValues({}, appStore.getState().history), {
767
+ histories,
768
+ index,
769
+ initialAppState
770
+ })
771
+ }),
772
+ [histories, index, initialAppState]
773
+ );
774
+ const back = () => {
775
+ appStore.getState().history.back();
776
+ };
777
+ const forward = () => {
778
+ appStore.getState().history.forward();
779
+ };
780
+ useHotkey({ meta: true, z: true }, back);
781
+ useHotkey({ meta: true, shift: true, z: true }, forward);
782
+ useHotkey({ meta: true, y: true }, forward);
783
+ useHotkey({ ctrl: true, z: true }, back);
784
+ useHotkey({ ctrl: true, shift: true, z: true }, forward);
785
+ useHotkey({ ctrl: true, y: true }, forward);
786
+ }
787
+
788
+ // store/slices/nodes.ts
789
+ init_react_import();
790
+ var createNodesSlice = (set, get) => ({
791
+ nodes: {},
792
+ registerNode: (id, node) => {
793
+ const s = get().nodes;
794
+ const emptyNode = {
795
+ id,
796
+ methods: {
797
+ sync: () => null,
798
+ hideOverlay: () => null,
799
+ showOverlay: () => null
800
+ },
801
+ element: null
802
+ };
803
+ const existingNode = s.nodes[id];
804
+ set({
805
+ nodes: __spreadProps(__spreadValues({}, s), {
806
+ nodes: __spreadProps(__spreadValues({}, s.nodes), {
807
+ [id]: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, emptyNode), existingNode), node), {
808
+ id
809
+ })
810
+ })
811
+ })
812
+ });
813
+ },
814
+ unregisterNode: (id) => {
815
+ const s = get().nodes;
816
+ const existingNode = s.nodes[id];
817
+ if (existingNode) {
818
+ const newNodes = __spreadValues({}, s.nodes);
819
+ delete newNodes[id];
820
+ set({
821
+ nodes: __spreadProps(__spreadValues({}, s), {
822
+ nodes: newNodes
823
+ })
824
+ });
825
+ }
826
+ }
827
+ });
828
+
829
+ // store/slices/permissions.ts
830
+ init_react_import();
831
+ import { useEffect as useEffect3 } from "react";
832
+
833
+ // lib/data/flatten-data.ts
834
+ init_react_import();
835
+ var flattenData = (state, config) => {
836
+ const data = [];
837
+ walkAppState(
838
+ state,
839
+ config,
840
+ (content) => content,
841
+ (item) => {
842
+ data.push(item);
843
+ return item;
844
+ }
845
+ );
846
+ return data;
847
+ };
848
+
849
+ // store/slices/permissions.ts
850
+ var createPermissionsSlice = (set, get) => {
851
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
852
+ const { state, permissions, config } = get();
853
+ const { cache, globalPermissions } = permissions;
854
+ const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
855
+ var _a, _b;
856
+ const { config: config2, state: appState, setComponentLoading } = get();
857
+ const itemCache = cache[item2.props.id];
858
+ const nodes = appState.indexes.nodes;
859
+ const parentId = (_a = nodes[item2.props.id]) == null ? void 0 : _a.parentId;
860
+ const parentNode = parentId ? nodes[parentId] : null;
861
+ const parentData = (_b = parentNode == null ? void 0 : parentNode.data) != null ? _b : null;
862
+ const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
863
+ if (!componentConfig) {
864
+ return;
865
+ }
866
+ const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
867
+ if (componentConfig.resolvePermissions) {
868
+ const changed = getChanged(item2, itemCache == null ? void 0 : itemCache.lastData);
869
+ const propsChanged = Object.values(changed).some((el) => el === true);
870
+ const parentChanged = (itemCache == null ? void 0 : itemCache.lastParentId) !== parentId;
871
+ if (propsChanged || parentChanged || force2) {
872
+ const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
873
+ const resolvedPermissions = yield componentConfig.resolvePermissions(
874
+ item2,
875
+ {
876
+ changed,
877
+ lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
878
+ permissions: initialPermissions,
879
+ appState: makeStatePublic(appState),
880
+ lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
881
+ parent: parentData
882
+ }
883
+ );
884
+ const latest = get().permissions;
885
+ set({
886
+ permissions: __spreadProps(__spreadValues({}, latest), {
887
+ cache: __spreadProps(__spreadValues({}, latest.cache), {
888
+ [item2.props.id]: {
889
+ lastParentId: parentId,
890
+ lastData: item2,
891
+ lastPermissions: resolvedPermissions
892
+ }
893
+ }),
894
+ resolvedPermissions: __spreadProps(__spreadValues({}, latest.resolvedPermissions), {
895
+ [item2.props.id]: resolvedPermissions
896
+ })
897
+ })
898
+ });
899
+ clearTimeout2();
900
+ }
901
+ }
902
+ });
903
+ const resolvePermissionsForRoot = (force2 = false) => {
904
+ const { state: appState } = get();
905
+ resolvePermissionsForItem(
906
+ // Shim the root data in by conforming to component data shape
907
+ {
908
+ type: "root",
909
+ props: __spreadProps(__spreadValues({}, appState.data.root.props), { id: "root" })
910
+ },
911
+ force2
912
+ );
913
+ };
914
+ const { item, type, root } = params;
915
+ if (item) {
916
+ yield resolvePermissionsForItem(item, force);
917
+ } else if (type) {
918
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
919
+ yield resolvePermissionsForItem(item2, force);
920
+ }));
921
+ } else if (root) {
922
+ resolvePermissionsForRoot(force);
923
+ } else {
924
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
925
+ yield resolvePermissionsForItem(item2, force);
926
+ }));
927
+ }
928
+ });
929
+ const refreshPermissions = (params) => resolvePermissions(params, true);
930
+ return {
931
+ cache: {},
932
+ globalPermissions: {
933
+ drag: true,
934
+ edit: true,
935
+ delete: true,
936
+ duplicate: true,
937
+ insert: true
938
+ },
939
+ resolvedPermissions: {},
940
+ getPermissions: ({ item, type, root } = {}) => {
941
+ const { config, permissions } = get();
942
+ const { globalPermissions, resolvedPermissions } = permissions;
943
+ if (item) {
944
+ const componentConfig = config.components[item.type];
945
+ const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig == null ? void 0 : componentConfig.permissions);
946
+ const resolvedForItem = resolvedPermissions[item.props.id];
947
+ return resolvedForItem ? __spreadValues(__spreadValues({}, globalPermissions), resolvedForItem) : initialPermissions;
948
+ } else if (type) {
949
+ const componentConfig = config.components[type];
950
+ return __spreadValues(__spreadValues({}, globalPermissions), componentConfig == null ? void 0 : componentConfig.permissions);
951
+ } else if (root) {
952
+ const rootConfig = config.root;
953
+ const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), rootConfig == null ? void 0 : rootConfig.permissions);
954
+ const resolvedForItem = resolvedPermissions["root"];
955
+ return resolvedForItem ? __spreadValues(__spreadValues({}, globalPermissions), resolvedForItem) : initialPermissions;
956
+ }
957
+ return globalPermissions;
958
+ },
959
+ resolvePermissions,
960
+ refreshPermissions
961
+ };
962
+ };
963
+ var useRegisterPermissionsSlice = (appStore, globalPermissions) => {
964
+ useEffect3(() => {
965
+ const { permissions } = appStore.getState();
966
+ const { globalPermissions: existingGlobalPermissions } = permissions;
967
+ appStore.setState({
968
+ permissions: __spreadProps(__spreadValues({}, permissions), {
969
+ globalPermissions: __spreadValues(__spreadValues({}, existingGlobalPermissions), globalPermissions)
970
+ })
971
+ });
972
+ permissions.resolvePermissions();
973
+ }, [globalPermissions]);
974
+ useEffect3(() => {
975
+ return appStore.subscribe(
976
+ (s) => s.state.data,
977
+ () => {
978
+ appStore.getState().permissions.resolvePermissions();
979
+ }
980
+ );
981
+ }, []);
982
+ useEffect3(() => {
983
+ return appStore.subscribe(
984
+ (s) => s.config,
985
+ () => {
986
+ appStore.getState().permissions.resolvePermissions();
987
+ }
988
+ );
989
+ }, []);
990
+ };
991
+
992
+ // store/slices/fields.ts
993
+ init_react_import();
994
+ import { useCallback, useEffect as useEffect4 } from "react";
995
+ var createFieldsSlice = (_set, _get) => {
996
+ return {
997
+ fields: {},
998
+ loading: false,
999
+ lastResolvedData: {},
1000
+ id: void 0
1001
+ };
1002
+ };
1003
+ var useRegisterFieldsSlice = (appStore, id) => {
1004
+ const resolveFields = useCallback(
1005
+ (reset) => __async(null, null, function* () {
1006
+ var _a, _b;
1007
+ const { fields, lastResolvedData } = appStore.getState().fields;
1008
+ const metadata = appStore.getState().metadata;
1009
+ const nodes = appStore.getState().state.indexes.nodes;
1010
+ const node = nodes[id || "root"];
1011
+ const componentData = node == null ? void 0 : node.data;
1012
+ const parentNode = (node == null ? void 0 : node.parentId) ? nodes[node.parentId] : null;
1013
+ const parent = (parentNode == null ? void 0 : parentNode.data) || null;
1014
+ const { getComponentConfig, state } = appStore.getState();
1015
+ const componentConfig = getComponentConfig(componentData == null ? void 0 : componentData.type);
1016
+ if (!componentData || !componentConfig) return;
1017
+ const defaultFields = componentConfig.fields || {};
1018
+ const resolver = componentConfig.resolveFields;
1019
+ let lastFields = fields;
1020
+ if (reset) {
1021
+ appStore.setState((s) => ({
1022
+ fields: __spreadProps(__spreadValues({}, s.fields), { fields: defaultFields, id })
1023
+ }));
1024
+ lastFields = defaultFields;
1025
+ }
1026
+ if (resolver) {
1027
+ const timeout = setTimeout(() => {
1028
+ appStore.setState((s) => ({
1029
+ fields: __spreadProps(__spreadValues({}, s.fields), { loading: true })
1030
+ }));
1031
+ }, 50);
1032
+ const lastData = ((_a = lastResolvedData.props) == null ? void 0 : _a.id) === id ? lastResolvedData : null;
1033
+ const changed = getChanged(componentData, lastData);
1034
+ const newFields = yield resolver(componentData, {
1035
+ changed,
1036
+ fields: defaultFields,
1037
+ lastFields,
1038
+ metadata: __spreadValues(__spreadValues({}, metadata), componentConfig.metadata),
1039
+ lastData,
1040
+ appState: makeStatePublic(state),
1041
+ parent
1042
+ });
1043
+ clearTimeout(timeout);
1044
+ if (((_b = appStore.getState().selectedItem) == null ? void 0 : _b.props.id) !== id) {
1045
+ return;
1046
+ }
1047
+ appStore.setState({
1048
+ fields: {
1049
+ fields: newFields,
1050
+ loading: false,
1051
+ lastResolvedData: componentData,
1052
+ id
1053
+ }
1054
+ });
1055
+ } else {
1056
+ appStore.setState((s) => ({
1057
+ fields: __spreadProps(__spreadValues({}, s.fields), { fields: defaultFields, id })
1058
+ }));
1059
+ }
1060
+ }),
1061
+ [id]
1062
+ );
1063
+ useEffect4(() => {
1064
+ resolveFields(true);
1065
+ return appStore.subscribe(
1066
+ (s) => s.state.indexes.nodes[id || "root"],
1067
+ () => resolveFields()
1068
+ );
1069
+ }, [id]);
1070
+ };
1071
+
1072
+ // lib/data/to-root.ts
1073
+ init_react_import();
1074
+ var toRoot = (item) => {
1075
+ if ("type" in item && item.type !== "root") {
1076
+ throw new Error("Converting non-root item to root.");
1077
+ }
1078
+ const { readOnly } = item;
1079
+ if (item.props) {
1080
+ if ("id" in item.props) {
1081
+ const _a = item.props, { id } = _a, props = __objRest(_a, ["id"]);
1082
+ return { props, readOnly };
1083
+ }
1084
+ return { props: item.props, readOnly };
1085
+ }
1086
+ return { props: {}, readOnly };
1087
+ };
1088
+
1089
+ // store/index.ts
1090
+ var defaultPageFields = {
1091
+ title: { type: "text" }
1092
+ };
1093
+ var createAppStore = (initialAppStore) => create2()(
1094
+ subscribeWithSelector2((set, get) => {
1095
+ var _a, _b;
1096
+ return __spreadProps(__spreadValues({
1097
+ state: defaultAppState,
1098
+ config: { components: {} },
1099
+ componentState: {},
1100
+ plugins: [],
1101
+ overrides: {},
1102
+ viewports: defaultViewports,
1103
+ zoomConfig: {
1104
+ autoZoom: 1,
1105
+ rootHeight: 0,
1106
+ zoom: 1
1107
+ },
1108
+ status: "LOADING",
1109
+ iframe: {},
1110
+ metadata: {},
1111
+ fieldTransforms: {}
1112
+ }, initialAppStore), {
1113
+ fields: createFieldsSlice(set, get),
1114
+ history: createHistorySlice(set, get),
1115
+ nodes: createNodesSlice(set, get),
1116
+ permissions: createPermissionsSlice(set, get),
1117
+ getComponentConfig: (type) => {
1118
+ var _a2;
1119
+ const { config, selectedItem } = get();
1120
+ const rootFields = ((_a2 = config.root) == null ? void 0 : _a2.fields) || defaultPageFields;
1121
+ return type && type !== "root" ? config.components[type] : selectedItem ? config.components[selectedItem.type] : __spreadProps(__spreadValues({}, config.root), { fields: rootFields });
1122
+ },
1123
+ selectedItem: ((_a = initialAppStore == null ? void 0 : initialAppStore.state) == null ? void 0 : _a.ui.itemSelector) ? getItem(
1124
+ (_b = initialAppStore == null ? void 0 : initialAppStore.state) == null ? void 0 : _b.ui.itemSelector,
1125
+ initialAppStore.state
1126
+ ) : null,
1127
+ dispatch: (action) => set((s) => {
1128
+ var _a2, _b2;
1129
+ const { record } = get().history;
1130
+ const dispatch = createReducer({
1131
+ record,
1132
+ appStore: s
1133
+ });
1134
+ const state = dispatch(s.state, action);
1135
+ const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
1136
+ (_b2 = (_a2 = get()).onAction) == null ? void 0 : _b2.call(_a2, action, state, get().state);
1137
+ return __spreadProps(__spreadValues({}, s), { state, selectedItem });
1138
+ }),
1139
+ setZoomConfig: (zoomConfig) => set({ zoomConfig }),
1140
+ setStatus: (status) => set({ status }),
1141
+ setComponentState: (componentState) => set({ componentState }),
1142
+ pendingLoadTimeouts: {},
1143
+ setComponentLoading: (id, loading = true, defer = 0) => {
1144
+ const { setComponentState, pendingLoadTimeouts } = get();
1145
+ const loadId = generateId();
1146
+ const setLoading = () => {
1147
+ var _a2;
1148
+ const { componentState } = get();
1149
+ setComponentState(__spreadProps(__spreadValues({}, componentState), {
1150
+ [id]: __spreadProps(__spreadValues({}, componentState[id]), {
1151
+ loadingCount: (((_a2 = componentState[id]) == null ? void 0 : _a2.loadingCount) || 0) + 1
1152
+ })
1153
+ }));
1154
+ };
1155
+ const unsetLoading = () => {
1156
+ var _a2;
1157
+ const { componentState } = get();
1158
+ clearTimeout(timeout);
1159
+ delete pendingLoadTimeouts[loadId];
1160
+ set({ pendingLoadTimeouts });
1161
+ setComponentState(__spreadProps(__spreadValues({}, componentState), {
1162
+ [id]: __spreadProps(__spreadValues({}, componentState[id]), {
1163
+ loadingCount: Math.max(
1164
+ (((_a2 = componentState[id]) == null ? void 0 : _a2.loadingCount) || 0) - 1,
1165
+ 0
1166
+ )
1167
+ })
1168
+ }));
1169
+ };
1170
+ const timeout = setTimeout(() => {
1171
+ if (loading) {
1172
+ setLoading();
1173
+ } else {
1174
+ unsetLoading();
1175
+ }
1176
+ delete pendingLoadTimeouts[loadId];
1177
+ set({ pendingLoadTimeouts });
1178
+ }, defer);
1179
+ set({
1180
+ pendingLoadTimeouts: __spreadProps(__spreadValues({}, pendingLoadTimeouts), {
1181
+ [id]: timeout
1182
+ })
1183
+ });
1184
+ return unsetLoading;
1185
+ },
1186
+ unsetComponentLoading: (id) => {
1187
+ const { setComponentLoading } = get();
1188
+ setComponentLoading(id, false);
1189
+ },
1190
+ // Helper
1191
+ setUi: (ui, recordHistory) => set((s) => {
1192
+ const dispatch = createReducer({
1193
+ record: () => {
1194
+ },
1195
+ appStore: s
1196
+ });
1197
+ const state = dispatch(s.state, {
1198
+ type: "setUi",
1199
+ ui,
1200
+ recordHistory
1201
+ });
1202
+ const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
1203
+ return __spreadProps(__spreadValues({}, s), { state, selectedItem });
1204
+ }),
1205
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
1206
+ const { config, metadata, setComponentLoading, permissions } = get();
1207
+ const timeouts = {};
1208
+ return yield resolveComponentData(
1209
+ componentData,
1210
+ config,
1211
+ metadata,
1212
+ (item) => {
1213
+ const id = "id" in item.props ? item.props.id : "root";
1214
+ timeouts[id] = setComponentLoading(id, true, 50);
1215
+ },
1216
+ (item) => __async(null, null, function* () {
1217
+ const id = "id" in item.props ? item.props.id : "root";
1218
+ if ("type" in item) {
1219
+ yield permissions.refreshPermissions({ item });
1220
+ } else {
1221
+ yield permissions.refreshPermissions({ root: true });
1222
+ }
1223
+ timeouts[id]();
1224
+ }),
1225
+ trigger
1226
+ );
1227
+ }),
1228
+ resolveAndCommitData: () => __async(null, null, function* () {
1229
+ const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
1230
+ walkAppState(
1231
+ state,
1232
+ config,
1233
+ (content) => content,
1234
+ (childItem) => {
1235
+ resolveComponentData2(childItem, "load").then((resolved) => {
1236
+ const { state: state2 } = get();
1237
+ const node = state2.indexes.nodes[resolved.node.props.id];
1238
+ if (node && resolved.didChange) {
1239
+ if (resolved.node.props.id === "root") {
1240
+ dispatch({
1241
+ type: "replaceRoot",
1242
+ root: toRoot(resolved.node)
1243
+ });
1244
+ } else {
1245
+ const zoneCompound = `${node.parentId}:${node.zone}`;
1246
+ const parentZone = state2.indexes.zones[zoneCompound];
1247
+ const index = parentZone.contentIds.indexOf(
1248
+ resolved.node.props.id
1249
+ );
1250
+ dispatch({
1251
+ type: "replace",
1252
+ data: resolved.node,
1253
+ destinationIndex: index,
1254
+ destinationZone: zoneCompound
1255
+ });
1256
+ }
1257
+ }
1258
+ });
1259
+ return childItem;
1260
+ }
1261
+ );
1262
+ })
1263
+ });
1264
+ })
1265
+ );
1266
+ var appStoreContext = createContext(createAppStore());
1267
+ function useAppStore(selector) {
1268
+ const context = useContext(appStoreContext);
1269
+ return useStore(context, selector);
1270
+ }
1271
+ function useAppStoreApi() {
1272
+ return useContext(appStoreContext);
1273
+ }
1274
+
1275
+ // components/RichTextMenu/lib/use-control-context.ts
1276
+ init_react_import();
1277
+ import { createContext as createContext2, useContext as useContext2 } from "react";
1278
+ var ControlContext = createContext2({});
1279
+ var useControlContext = () => {
1280
+ return useContext2(ControlContext);
1281
+ };
1282
+
1283
+ // components/RichTextMenu/components/SelectControl/index.tsx
1284
+ init_react_import();
1285
+ import { useMemo } from "react";
1286
+
1287
+ // components/Select/index.tsx
1288
+ init_react_import();
1289
+
1290
+ // css-module:/home/runner/work/puck/puck/packages/core/components/Select/styles.module.css#css-module
1291
+ init_react_import();
1292
+ var styles_module_default = { "Select": "_Select_xjbef_1", "Select-button": "_Select-button_xjbef_6", "Select--hasOptions": "_Select--hasOptions_xjbef_19", "Select--disabled": "_Select--disabled_xjbef_23", "Select-buttonIcon": "_Select-buttonIcon_xjbef_27", "Select--standalone": "_Select--standalone_xjbef_33", "Select--actionBar": "_Select--actionBar_xjbef_38", "Select--hasValue": "_Select--hasValue_xjbef_44", "Select-items": "_Select-items_xjbef_61", "SelectItem": "_SelectItem_xjbef_72", "SelectItem--isSelected": "_SelectItem--isSelected_xjbef_87", "SelectItem-icon": "_SelectItem-icon_xjbef_93" };
1293
+
1294
+ // components/Select/index.tsx
1295
+ import { useState } from "react";
1296
+ import {
1297
+ Popover,
1298
+ PopoverContent,
1299
+ PopoverPortal,
1300
+ PopoverTrigger
1301
+ } from "@radix-ui/react-popover";
1302
+
1303
+ // lib/index.ts
1304
+ init_react_import();
1305
+
1306
+ // lib/filter.ts
1307
+ init_react_import();
1308
+
1309
+ // lib/data/reorder.ts
1310
+ init_react_import();
1311
+ var reorder = (list, startIndex, endIndex) => {
1312
+ const result = Array.from(list);
1313
+ const [removed] = result.splice(startIndex, 1);
1314
+ result.splice(endIndex, 0, removed);
1315
+ return result;
1316
+ };
1317
+
1318
+ // lib/data/replace.ts
1319
+ init_react_import();
1320
+ var replace = (list, index, newItem) => {
1321
+ const result = Array.from(list);
1322
+ result.splice(index, 1);
1323
+ result.splice(index, 0, newItem);
1324
+ return result;
1325
+ };
1326
+
1327
+ // lib/use-reset-auto-zoom.ts
1328
+ init_react_import();
1329
+
1330
+ // lib/get-zoom-config.ts
1331
+ init_react_import();
1332
+
1333
+ // ../../node_modules/css-box-model/dist/css-box-model.esm.js
1334
+ init_react_import();
1335
+
1336
+ // ../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
1337
+ init_react_import();
1338
+ var isProduction = process.env.NODE_ENV === "production";
1339
+ var prefix = "Invariant failed";
1340
+ function invariant(condition, message) {
1341
+ if (condition) {
1342
+ return;
1343
+ }
1344
+ if (isProduction) {
1345
+ throw new Error(prefix);
1346
+ }
1347
+ var provided = typeof message === "function" ? message() : message;
1348
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
1349
+ throw new Error(value);
1350
+ }
1351
+
1352
+ // ../../node_modules/css-box-model/dist/css-box-model.esm.js
1353
+ var getRect = function getRect2(_ref) {
1354
+ var top = _ref.top, right = _ref.right, bottom = _ref.bottom, left = _ref.left;
1355
+ var width = right - left;
1356
+ var height = bottom - top;
1357
+ var rect = {
1358
+ top,
1359
+ right,
1360
+ bottom,
1361
+ left,
1362
+ width,
1363
+ height,
1364
+ x: left,
1365
+ y: top,
1366
+ center: {
1367
+ x: (right + left) / 2,
1368
+ y: (bottom + top) / 2
1369
+ }
1370
+ };
1371
+ return rect;
1372
+ };
1373
+ var expand = function expand2(target, expandBy) {
1374
+ return {
1375
+ top: target.top - expandBy.top,
1376
+ left: target.left - expandBy.left,
1377
+ bottom: target.bottom + expandBy.bottom,
1378
+ right: target.right + expandBy.right
1379
+ };
1380
+ };
1381
+ var shrink = function shrink2(target, shrinkBy) {
1382
+ return {
1383
+ top: target.top + shrinkBy.top,
1384
+ left: target.left + shrinkBy.left,
1385
+ bottom: target.bottom - shrinkBy.bottom,
1386
+ right: target.right - shrinkBy.right
1387
+ };
1388
+ };
1389
+ var noSpacing = {
1390
+ top: 0,
1391
+ right: 0,
1392
+ bottom: 0,
1393
+ left: 0
1394
+ };
1395
+ var createBox = function createBox2(_ref2) {
1396
+ var borderBox = _ref2.borderBox, _ref2$margin = _ref2.margin, margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin, _ref2$border = _ref2.border, border = _ref2$border === void 0 ? noSpacing : _ref2$border, _ref2$padding = _ref2.padding, padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
1397
+ var marginBox = getRect(expand(borderBox, margin));
1398
+ var paddingBox = getRect(shrink(borderBox, border));
1399
+ var contentBox = getRect(shrink(paddingBox, padding));
1400
+ return {
1401
+ marginBox,
1402
+ borderBox: getRect(borderBox),
1403
+ paddingBox,
1404
+ contentBox,
1405
+ margin,
1406
+ border,
1407
+ padding
1408
+ };
1409
+ };
1410
+ var parse = function parse2(raw) {
1411
+ var value = raw.slice(0, -2);
1412
+ var suffix = raw.slice(-2);
1413
+ if (suffix !== "px") {
1414
+ return 0;
1415
+ }
1416
+ var result = Number(value);
1417
+ !!isNaN(result) ? process.env.NODE_ENV !== "production" ? invariant(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : invariant(false) : void 0;
1418
+ return result;
1419
+ };
1420
+ var calculateBox = function calculateBox2(borderBox, styles) {
1421
+ var margin = {
1422
+ top: parse(styles.marginTop),
1423
+ right: parse(styles.marginRight),
1424
+ bottom: parse(styles.marginBottom),
1425
+ left: parse(styles.marginLeft)
1426
+ };
1427
+ var padding = {
1428
+ top: parse(styles.paddingTop),
1429
+ right: parse(styles.paddingRight),
1430
+ bottom: parse(styles.paddingBottom),
1431
+ left: parse(styles.paddingLeft)
1432
+ };
1433
+ var border = {
1434
+ top: parse(styles.borderTopWidth),
1435
+ right: parse(styles.borderRightWidth),
1436
+ bottom: parse(styles.borderBottomWidth),
1437
+ left: parse(styles.borderLeftWidth)
1438
+ };
1439
+ return createBox({
1440
+ borderBox,
1441
+ margin,
1442
+ padding,
1443
+ border
1444
+ });
1445
+ };
1446
+ var getBox = function getBox2(el) {
1447
+ var borderBox = el.getBoundingClientRect();
1448
+ var styles = window.getComputedStyle(el);
1449
+ return calculateBox(borderBox, styles);
1450
+ };
1451
+
1452
+ // lib/get-zoom-config.ts
1453
+ var RESET_ZOOM_SMALLER_THAN_FRAME = true;
1454
+ var getZoomConfig = (uiViewport, frame, zoom) => {
1455
+ const box = getBox(frame);
1456
+ const { width: frameWidth, height: frameHeight } = box.contentBox;
1457
+ const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
1458
+ let rootHeight = 0;
1459
+ let autoZoom = 1;
1460
+ if (uiViewport.width > frameWidth || viewportHeight > frameHeight) {
1461
+ const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
1462
+ const heightZoom = Math.min(frameHeight / viewportHeight, 1);
1463
+ zoom = widthZoom;
1464
+ if (widthZoom < heightZoom) {
1465
+ rootHeight = viewportHeight / zoom;
1466
+ } else {
1467
+ rootHeight = viewportHeight;
1468
+ zoom = heightZoom;
1469
+ }
1470
+ autoZoom = zoom;
1471
+ } else {
1472
+ if (RESET_ZOOM_SMALLER_THAN_FRAME) {
1473
+ autoZoom = 1;
1474
+ zoom = 1;
1475
+ rootHeight = viewportHeight;
1476
+ }
1477
+ }
1478
+ return { autoZoom, rootHeight, zoom };
1479
+ };
1480
+
1481
+ // lib/use-reset-auto-zoom.ts
1482
+ var useResetAutoZoom = (frameRef) => {
1483
+ const appStoreApi = useAppStoreApi();
1484
+ const resetAutoZoom = (options) => {
1485
+ const { state, zoomConfig, setZoomConfig } = appStoreApi.getState();
1486
+ const { viewports } = state.ui;
1487
+ const newViewports = (options == null ? void 0 : options.viewports) || viewports;
1488
+ if (frameRef.current) {
1489
+ setZoomConfig(
1490
+ getZoomConfig(newViewports == null ? void 0 : newViewports.current, frameRef.current, zoomConfig.zoom)
1491
+ );
1492
+ }
1493
+ };
1494
+ return resetAutoZoom;
1495
+ };
1496
+
1497
+ // components/Select/index.tsx
1498
+ import { jsx, jsxs } from "react/jsx-runtime";
1499
+ var getClassName = get_class_name_factory_default("Select", styles_module_default);
1500
+ var getItemClassName = get_class_name_factory_default("SelectItem", styles_module_default);
1501
+ var Item = ({
1502
+ children,
1503
+ isSelected,
1504
+ onClick
1505
+ }) => {
1506
+ return /* @__PURE__ */ jsx("button", { className: getItemClassName({ isSelected }), onClick, children });
1507
+ };
1508
+ var Select = ({
1509
+ children,
1510
+ options,
1511
+ onChange,
1512
+ value,
1513
+ defaultValue,
1514
+ mode,
1515
+ disabled = false
1516
+ }) => {
1517
+ const [open, setOpen] = useState(false);
1518
+ const hasOptions = options.length > 0;
1519
+ return /* @__PURE__ */ jsx(
1520
+ "div",
1521
+ {
1522
+ className: getClassName({
1523
+ hasValue: value !== defaultValue,
1524
+ hasOptions,
1525
+ actionBar: mode === "actionBar",
1526
+ standalone: mode === "standalone",
1527
+ disabled
1528
+ }),
1529
+ children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1530
+ hasOptions ? /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { className: getClassName("button"), children: [
1531
+ /* @__PURE__ */ jsx("span", { className: getClassName("buttonIcon"), children }),
1532
+ /* @__PURE__ */ jsx(ChevronDown, { size: 12 })
1533
+ ] }) }) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: getClassName("button"), children: [
1534
+ /* @__PURE__ */ jsx("span", { className: getClassName("buttonIcon"), children }),
1535
+ /* @__PURE__ */ jsx(ChevronDown, { size: 12 })
1536
+ ] }) }),
1537
+ options.length > 0 && /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsx(PopoverContent, { align: "start", children: /* @__PURE__ */ jsx("ul", { className: getClassName("items"), "data-puck-rte-menu": true, children: options.map((option) => {
1538
+ const Icon2 = option.icon;
1539
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
1540
+ Item,
1541
+ {
1542
+ isSelected: value === option.value,
1543
+ onClick: () => {
1544
+ onChange(option.value);
1545
+ setOpen(false);
1546
+ },
1547
+ children: [
1548
+ Icon2 && /* @__PURE__ */ jsx("div", { className: getItemClassName("icon"), children: /* @__PURE__ */ jsx(Icon2, { size: 16 }) }),
1549
+ option.label
1550
+ ]
1551
+ }
1552
+ ) }, option.value);
1553
+ }) }) }) })
1554
+ ] })
1555
+ }
1556
+ );
1557
+ };
1558
+
1559
+ // components/RichTextMenu/components/SelectControl/index.tsx
1560
+ import { jsx as jsx2 } from "react/jsx-runtime";
1561
+ function SelectControl({
1562
+ renderDefaultIcon,
1563
+ onChange,
1564
+ options,
1565
+ value,
1566
+ defaultValue
1567
+ }) {
1568
+ var _a, _b;
1569
+ const { inline, readOnly } = useControlContext();
1570
+ const optionsByValue = useMemo(
1571
+ () => options.reduce(
1572
+ (acc, option) => __spreadProps(__spreadValues({}, acc), { [option.value]: option }),
1573
+ {}
1574
+ ),
1575
+ [options]
1576
+ );
1577
+ const Node = (_b = value && ((_a = optionsByValue[value]) == null ? void 0 : _a.icon)) != null ? _b : renderDefaultIcon;
1578
+ return /* @__PURE__ */ jsx2(
1579
+ Select,
1580
+ {
1581
+ options,
1582
+ onChange,
1583
+ value,
1584
+ defaultValue,
1585
+ mode: inline ? "actionBar" : "standalone",
1586
+ disabled: readOnly,
1587
+ children: /* @__PURE__ */ jsx2(Node, {})
1588
+ }
1589
+ );
1590
+ }
1591
+
1592
+ export {
1593
+ AlignCenter,
1594
+ AlignJustify,
1595
+ AlignLeft,
1596
+ AlignRight,
1597
+ Bold,
1598
+ ChevronDown,
1599
+ ChevronRight,
1600
+ ChevronUp,
1601
+ CircleCheckBig,
1602
+ Code,
1603
+ Copy,
1604
+ CornerLeftUp,
1605
+ EllipsisVertical,
1606
+ Globe,
1607
+ Hash,
1608
+ Heading1,
1609
+ Heading2,
1610
+ Heading3,
1611
+ Heading4,
1612
+ Heading5,
1613
+ Heading6,
1614
+ Heading,
1615
+ Italic,
1616
+ Layers,
1617
+ LayoutGrid,
1618
+ Link,
1619
+ ListOrdered,
1620
+ List,
1621
+ LockOpen,
1622
+ Lock,
1623
+ Minus,
1624
+ Monitor,
1625
+ PanelLeft,
1626
+ PanelRight,
1627
+ Plus,
1628
+ Quote,
1629
+ Redo2,
1630
+ Search,
1631
+ SlidersHorizontal,
1632
+ Smartphone,
1633
+ SquareCode,
1634
+ Strikethrough,
1635
+ Tablet,
1636
+ Trash,
1637
+ Type,
1638
+ Underline,
1639
+ Undo2,
1640
+ ZoomIn,
1641
+ ZoomOut,
1642
+ reorder,
1643
+ replace,
1644
+ monitorHotkeys,
1645
+ useMonitorHotkeys,
1646
+ useHotkey,
1647
+ useRegisterHistorySlice,
1648
+ useRegisterPermissionsSlice,
1649
+ useRegisterFieldsSlice,
1650
+ createAppStore,
1651
+ appStoreContext,
1652
+ useAppStore,
1653
+ useAppStoreApi,
1654
+ getBox,
1655
+ useResetAutoZoom,
1656
+ ControlContext,
1657
+ useControlContext,
1658
+ SelectControl
1659
+ };
1660
+ /*! Bundled license information:
1661
+
1662
+ lucide-react/dist/esm/shared/src/utils.js:
1663
+ lucide-react/dist/esm/defaultAttributes.js:
1664
+ lucide-react/dist/esm/Icon.js:
1665
+ lucide-react/dist/esm/createLucideIcon.js:
1666
+ lucide-react/dist/esm/icons/align-left.js:
1667
+ lucide-react/dist/esm/icons/heading.js:
1668
+ lucide-react/dist/esm/icons/list.js:
1669
+ lucide-react/dist/esm/icons/align-center.js:
1670
+ lucide-react/dist/esm/icons/align-justify.js:
1671
+ lucide-react/dist/esm/icons/align-right.js:
1672
+ lucide-react/dist/esm/icons/bold.js:
1673
+ lucide-react/dist/esm/icons/chevron-down.js:
1674
+ lucide-react/dist/esm/icons/chevron-right.js:
1675
+ lucide-react/dist/esm/icons/chevron-up.js:
1676
+ lucide-react/dist/esm/icons/circle-check-big.js:
1677
+ lucide-react/dist/esm/icons/code.js:
1678
+ lucide-react/dist/esm/icons/copy.js:
1679
+ lucide-react/dist/esm/icons/corner-left-up.js:
1680
+ lucide-react/dist/esm/icons/ellipsis-vertical.js:
1681
+ lucide-react/dist/esm/icons/globe.js:
1682
+ lucide-react/dist/esm/icons/hash.js:
1683
+ lucide-react/dist/esm/icons/heading-1.js:
1684
+ lucide-react/dist/esm/icons/heading-2.js:
1685
+ lucide-react/dist/esm/icons/heading-3.js:
1686
+ lucide-react/dist/esm/icons/heading-4.js:
1687
+ lucide-react/dist/esm/icons/heading-5.js:
1688
+ lucide-react/dist/esm/icons/heading-6.js:
1689
+ lucide-react/dist/esm/icons/italic.js:
1690
+ lucide-react/dist/esm/icons/layers.js:
1691
+ lucide-react/dist/esm/icons/layout-grid.js:
1692
+ lucide-react/dist/esm/icons/link.js:
1693
+ lucide-react/dist/esm/icons/list-ordered.js:
1694
+ lucide-react/dist/esm/icons/lock-open.js:
1695
+ lucide-react/dist/esm/icons/lock.js:
1696
+ lucide-react/dist/esm/icons/minus.js:
1697
+ lucide-react/dist/esm/icons/monitor.js:
1698
+ lucide-react/dist/esm/icons/panel-left.js:
1699
+ lucide-react/dist/esm/icons/panel-right.js:
1700
+ lucide-react/dist/esm/icons/plus.js:
1701
+ lucide-react/dist/esm/icons/quote.js:
1702
+ lucide-react/dist/esm/icons/redo-2.js:
1703
+ lucide-react/dist/esm/icons/search.js:
1704
+ lucide-react/dist/esm/icons/sliders-horizontal.js:
1705
+ lucide-react/dist/esm/icons/smartphone.js:
1706
+ lucide-react/dist/esm/icons/square-code.js:
1707
+ lucide-react/dist/esm/icons/strikethrough.js:
1708
+ lucide-react/dist/esm/icons/tablet.js:
1709
+ lucide-react/dist/esm/icons/trash.js:
1710
+ lucide-react/dist/esm/icons/type.js:
1711
+ lucide-react/dist/esm/icons/underline.js:
1712
+ lucide-react/dist/esm/icons/undo-2.js:
1713
+ lucide-react/dist/esm/icons/zoom-in.js:
1714
+ lucide-react/dist/esm/icons/zoom-out.js:
1715
+ lucide-react/dist/esm/lucide-react.js:
1716
+ (**
1717
+ * @license lucide-react v0.468.0 - ISC
1718
+ *
1719
+ * This source code is licensed under the ISC license.
1720
+ * See the LICENSE file in the root directory of this source tree.
1721
+ *)
1722
+ */