@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.cbc526d1

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 (50) hide show
  1. package/dist/{Editor-N46HUQEC.mjs → Editor-32UYWE6W.mjs} +13 -10
  2. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
  5. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-BkBoKAc5.d.mts} +26 -36
  6. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-BkBoKAc5.d.ts} +26 -36
  7. package/dist/{chunk-3QHWXJEI.mjs → chunk-3VQHXASI.mjs} +2 -2
  8. package/dist/{chunk-K3V4LVUL.mjs → chunk-6KNQXLQR.mjs} +14 -10
  9. package/dist/chunk-AOEDIUVK.mjs +11 -0
  10. package/dist/{chunk-GQKMOYLG.mjs → chunk-GVKHZNTR.mjs} +2 -2
  11. package/dist/{chunk-7KY6RHEY.mjs → chunk-K562SEXI.mjs} +109 -526
  12. package/dist/chunk-KN3XDS7U.mjs +528 -0
  13. package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
  14. package/dist/{chunk-DNF2EMM4.mjs → chunk-MEL7FUSF.mjs} +2 -2
  15. package/dist/{chunk-C2TVYIYC.mjs → chunk-NYGQH27S.mjs} +105 -75
  16. package/dist/{chunk-DJSH5REF.mjs → chunk-Q3TJ2VYO.mjs} +25 -126
  17. package/dist/chunk-REWRIUGR.mjs +156 -0
  18. package/dist/{chunk-FNWOH4R6.mjs → chunk-V2IQTPPK.mjs} +8 -6
  19. package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
  20. package/dist/{chunk-TB3SSIAY.mjs → chunk-WD3LNSAC.mjs} +5258 -4424
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/{full-NLUNPJWS.mjs → full-4OS3O57Y.mjs} +10 -7
  23. package/dist/index-bqD1SEOb.d.mts +118 -0
  24. package/dist/index-lt1zf5WR.d.ts +118 -0
  25. package/dist/index.css +732 -341
  26. package/dist/index.d.mts +31 -120
  27. package/dist/index.d.ts +31 -120
  28. package/dist/index.js +3494 -2436
  29. package/dist/index.mjs +22 -16
  30. package/dist/internal.d.mts +27 -0
  31. package/dist/internal.d.ts +27 -0
  32. package/dist/internal.js +927 -0
  33. package/dist/internal.mjs +13 -0
  34. package/dist/{loaded-ZXOU6S6R.mjs → loaded-DCQVLO7I.mjs} +7 -4
  35. package/dist/{loaded-HMSPJUZM.mjs → loaded-JGRO7BH7.mjs} +7 -4
  36. package/dist/{loaded-EV34KGYJ.mjs → loaded-KKVJE5KH.mjs} +7 -4
  37. package/dist/no-external.css +870 -475
  38. package/dist/no-external.d.mts +4 -2
  39. package/dist/no-external.d.ts +4 -2
  40. package/dist/no-external.js +3412 -2351
  41. package/dist/no-external.mjs +22 -11
  42. package/dist/rsc.css +28 -27
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +146 -83
  46. package/dist/rsc.mjs +6 -4
  47. package/dist/walk-tree-CRRDqx6_.d.mts +29 -0
  48. package/dist/walk-tree-CS7sEpfG.d.ts +29 -0
  49. package/package.json +9 -4
  50. package/dist/chunk-WUWXFMEM.mjs +0 -11
@@ -0,0 +1,528 @@
1
+ import {
2
+ rootDroppableId,
3
+ setupZone,
4
+ walkAppState,
5
+ walkTree
6
+ } from "./chunk-Q3TJ2VYO.mjs";
7
+ import {
8
+ __spreadProps,
9
+ __spreadValues,
10
+ init_react_import
11
+ } from "./chunk-M6W7YEVX.mjs";
12
+
13
+ // reducer/index.ts
14
+ init_react_import();
15
+
16
+ // reducer/actions/set.ts
17
+ init_react_import();
18
+ var setAction = (state, action, appStore) => {
19
+ if (typeof action.state === "object") {
20
+ const newState = __spreadValues(__spreadValues({}, state), action.state);
21
+ if (action.state.indexes) {
22
+ return newState;
23
+ }
24
+ console.warn(
25
+ "`set` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
26
+ );
27
+ return walkAppState(newState, appStore.config);
28
+ }
29
+ return __spreadValues(__spreadValues({}, state), action.state(state));
30
+ };
31
+
32
+ // reducer/actions/insert.ts
33
+ init_react_import();
34
+
35
+ // lib/data/insert.ts
36
+ init_react_import();
37
+ var insert = (list, index, item) => {
38
+ const result = Array.from(list || []);
39
+ result.splice(index, 0, item);
40
+ return result;
41
+ };
42
+
43
+ // lib/generate-id.ts
44
+ init_react_import();
45
+ import { v4 as uuidv4 } from "uuid";
46
+ var generateId = (type) => type ? `${type}-${uuidv4()}` : uuidv4();
47
+
48
+ // lib/data/get-ids-for-parent.ts
49
+ init_react_import();
50
+ var getIdsForParent = (zoneCompound, state) => {
51
+ const [parentId] = zoneCompound.split(":");
52
+ const node = state.indexes.nodes[parentId];
53
+ return ((node == null ? void 0 : node.path) || []).map((p) => p.split(":")[0]);
54
+ };
55
+
56
+ // lib/data/populate-ids.ts
57
+ init_react_import();
58
+ var populateIds = (data, config, override = false) => {
59
+ const id = generateId(data.type);
60
+ return walkTree(
61
+ __spreadProps(__spreadValues({}, data), {
62
+ props: override ? __spreadProps(__spreadValues({}, data.props), { id }) : __spreadValues({}, data.props)
63
+ }),
64
+ config,
65
+ (contents) => contents.map((item) => {
66
+ const id2 = generateId(item.type);
67
+ return __spreadProps(__spreadValues({}, item), {
68
+ props: override ? __spreadProps(__spreadValues({}, item.props), { id: id2 }) : __spreadValues({ id: id2 }, item.props)
69
+ });
70
+ })
71
+ );
72
+ };
73
+
74
+ // reducer/actions/insert.ts
75
+ function insertAction(state, action, appStore) {
76
+ const id = action.id || generateId(action.componentType);
77
+ const emptyComponentData = populateIds(
78
+ {
79
+ type: action.componentType,
80
+ props: __spreadProps(__spreadValues({}, appStore.config.components[action.componentType].defaultProps || {}), {
81
+ id
82
+ })
83
+ },
84
+ appStore.config
85
+ );
86
+ const [parentId] = action.destinationZone.split(":");
87
+ const idsInPath = getIdsForParent(action.destinationZone, state);
88
+ return walkAppState(
89
+ state,
90
+ appStore.config,
91
+ (content, zoneCompound) => {
92
+ if (zoneCompound === action.destinationZone) {
93
+ return insert(
94
+ content || [],
95
+ action.destinationIndex,
96
+ emptyComponentData
97
+ );
98
+ }
99
+ return content;
100
+ },
101
+ (childItem, path) => {
102
+ if (childItem.props.id === id || childItem.props.id === parentId) {
103
+ return childItem;
104
+ } else if (idsInPath.includes(childItem.props.id)) {
105
+ return childItem;
106
+ } else if (path.includes(action.destinationZone)) {
107
+ return childItem;
108
+ }
109
+ return null;
110
+ }
111
+ );
112
+ }
113
+
114
+ // reducer/actions/replace.ts
115
+ init_react_import();
116
+ var replaceAction = (state, action, appStore) => {
117
+ const [parentId] = action.destinationZone.split(":");
118
+ const idsInPath = getIdsForParent(action.destinationZone, state);
119
+ const originalId = state.indexes.zones[action.destinationZone].contentIds[action.destinationIndex];
120
+ const idChanged = originalId !== action.data.props.id;
121
+ if (idChanged) {
122
+ throw new Error(
123
+ `Can't change the id during a replace action. Please us "remove" and "insert" to define a new node.`
124
+ );
125
+ }
126
+ const newSlotIds = [];
127
+ const data = walkTree(action.data, appStore.config, (contents, opts) => {
128
+ newSlotIds.push(`${opts.parentId}:${opts.propName}`);
129
+ return contents.map((item) => {
130
+ const id = generateId(item.type);
131
+ return __spreadProps(__spreadValues({}, item), {
132
+ props: __spreadValues({ id }, item.props)
133
+ });
134
+ });
135
+ });
136
+ const stateWithDeepSlotsRemoved = __spreadProps(__spreadValues({}, state), {
137
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
138
+ });
139
+ Object.keys(state.indexes.zones).forEach((zoneCompound) => {
140
+ const id = zoneCompound.split(":")[0];
141
+ if (id === originalId) {
142
+ if (!newSlotIds.includes(zoneCompound)) {
143
+ delete stateWithDeepSlotsRemoved.indexes.zones[zoneCompound];
144
+ }
145
+ }
146
+ });
147
+ return walkAppState(
148
+ stateWithDeepSlotsRemoved,
149
+ appStore.config,
150
+ (content, zoneCompound) => {
151
+ const newContent = [...content];
152
+ if (zoneCompound === action.destinationZone) {
153
+ newContent[action.destinationIndex] = data;
154
+ }
155
+ return newContent;
156
+ },
157
+ (childItem, path) => {
158
+ const pathIds = path.map((p) => p.split(":")[0]);
159
+ if (childItem.props.id === data.props.id) {
160
+ return data;
161
+ } else if (childItem.props.id === parentId) {
162
+ return childItem;
163
+ } else if (idsInPath.indexOf(childItem.props.id) > -1) {
164
+ return childItem;
165
+ } else if (pathIds.indexOf(data.props.id) > -1) {
166
+ return childItem;
167
+ }
168
+ return null;
169
+ }
170
+ );
171
+ };
172
+
173
+ // reducer/actions/replace-root.ts
174
+ init_react_import();
175
+ var replaceRootAction = (state, action, appStore) => {
176
+ return walkAppState(
177
+ state,
178
+ appStore.config,
179
+ (content) => content,
180
+ (childItem) => {
181
+ if (childItem.props.id === "root") {
182
+ return __spreadProps(__spreadValues({}, childItem), {
183
+ props: __spreadValues(__spreadValues({}, childItem.props), action.root.props),
184
+ readOnly: action.root.readOnly
185
+ });
186
+ }
187
+ return childItem;
188
+ }
189
+ );
190
+ };
191
+
192
+ // reducer/actions/duplicate.ts
193
+ init_react_import();
194
+
195
+ // lib/data/get-item.ts
196
+ init_react_import();
197
+ function getItem(selector, state) {
198
+ var _a, _b;
199
+ const zone = (_a = state.indexes.zones) == null ? void 0 : _a[selector.zone || rootDroppableId];
200
+ return zone ? (_b = state.indexes.nodes[zone.contentIds[selector.index]]) == null ? void 0 : _b.data : void 0;
201
+ }
202
+
203
+ // reducer/actions/duplicate.ts
204
+ function duplicateAction(state, action, appStore) {
205
+ const item = getItem(
206
+ { index: action.sourceIndex, zone: action.sourceZone },
207
+ state
208
+ );
209
+ const idsInPath = getIdsForParent(action.sourceZone, state);
210
+ const newItem = __spreadProps(__spreadValues({}, item), {
211
+ props: __spreadProps(__spreadValues({}, item.props), {
212
+ id: generateId(item.type)
213
+ })
214
+ });
215
+ const modified = walkAppState(
216
+ state,
217
+ appStore.config,
218
+ (content, zoneCompound) => {
219
+ if (zoneCompound === action.sourceZone) {
220
+ return insert(content, action.sourceIndex + 1, item);
221
+ }
222
+ return content;
223
+ },
224
+ (childItem, path, index) => {
225
+ const zoneCompound = path[path.length - 1];
226
+ const parents = path.map((p) => p.split(":")[0]);
227
+ if (parents.indexOf(newItem.props.id) > -1) {
228
+ return __spreadProps(__spreadValues({}, childItem), {
229
+ props: __spreadProps(__spreadValues({}, childItem.props), {
230
+ id: generateId(childItem.type)
231
+ })
232
+ });
233
+ }
234
+ if (zoneCompound === action.sourceZone && index === action.sourceIndex + 1) {
235
+ return newItem;
236
+ }
237
+ const [sourceZoneParent] = action.sourceZone.split(":");
238
+ if (sourceZoneParent === childItem.props.id || idsInPath.indexOf(childItem.props.id) > -1) {
239
+ return childItem;
240
+ }
241
+ return null;
242
+ }
243
+ );
244
+ return __spreadProps(__spreadValues({}, modified), {
245
+ ui: __spreadProps(__spreadValues({}, modified.ui), {
246
+ itemSelector: {
247
+ index: action.sourceIndex + 1,
248
+ zone: action.sourceZone
249
+ }
250
+ })
251
+ });
252
+ }
253
+
254
+ // reducer/actions/reorder.ts
255
+ init_react_import();
256
+
257
+ // reducer/actions/move.ts
258
+ init_react_import();
259
+
260
+ // lib/data/remove.ts
261
+ init_react_import();
262
+ var remove = (list, index) => {
263
+ const result = Array.from(list);
264
+ result.splice(index, 1);
265
+ return result;
266
+ };
267
+
268
+ // reducer/actions/move.ts
269
+ var moveAction = (state, action, appStore) => {
270
+ if (action.sourceZone === action.destinationZone && action.sourceIndex === action.destinationIndex) {
271
+ return state;
272
+ }
273
+ const item = getItem(
274
+ { zone: action.sourceZone, index: action.sourceIndex },
275
+ state
276
+ );
277
+ if (!item) return state;
278
+ const idsInSourcePath = getIdsForParent(action.sourceZone, state);
279
+ const idsInDestinationPath = getIdsForParent(action.destinationZone, state);
280
+ return walkAppState(
281
+ state,
282
+ appStore.config,
283
+ (content, zoneCompound) => {
284
+ if (zoneCompound === action.sourceZone && zoneCompound === action.destinationZone) {
285
+ return insert(
286
+ remove(content, action.sourceIndex),
287
+ action.destinationIndex,
288
+ item
289
+ );
290
+ } else if (zoneCompound === action.sourceZone) {
291
+ return remove(content, action.sourceIndex);
292
+ } else if (zoneCompound === action.destinationZone) {
293
+ return insert(content, action.destinationIndex, item);
294
+ }
295
+ return content;
296
+ },
297
+ (childItem, path) => {
298
+ const [sourceZoneParent] = action.sourceZone.split(":");
299
+ const [destinationZoneParent] = action.destinationZone.split(":");
300
+ const childId = childItem.props.id;
301
+ if (sourceZoneParent === childId || destinationZoneParent === childId || item.props.id === childId || idsInSourcePath.indexOf(childId) > -1 || idsInDestinationPath.indexOf(childId) > -1 || path.includes(action.destinationZone)) {
302
+ return childItem;
303
+ }
304
+ return null;
305
+ }
306
+ );
307
+ };
308
+
309
+ // reducer/actions/reorder.ts
310
+ var reorderAction = (state, action, appStore) => {
311
+ return moveAction(
312
+ state,
313
+ {
314
+ type: "move",
315
+ sourceIndex: action.sourceIndex,
316
+ sourceZone: action.destinationZone,
317
+ destinationIndex: action.destinationIndex,
318
+ destinationZone: action.destinationZone
319
+ },
320
+ appStore
321
+ );
322
+ };
323
+
324
+ // reducer/actions/remove.ts
325
+ init_react_import();
326
+ var removeAction = (state, action, appStore) => {
327
+ const item = getItem({ index: action.index, zone: action.zone }, state);
328
+ const nodesToDelete = Object.entries(state.indexes.nodes).reduce(
329
+ (acc, [nodeId, nodeData]) => {
330
+ const pathIds = nodeData.path.map((p) => p.split(":")[0]);
331
+ if (pathIds.includes(item.props.id)) {
332
+ return [...acc, nodeId];
333
+ }
334
+ return acc;
335
+ },
336
+ [item.props.id]
337
+ );
338
+ const newState = walkAppState(
339
+ state,
340
+ appStore.config,
341
+ (content, zoneCompound) => {
342
+ if (zoneCompound === action.zone) {
343
+ return remove(content, action.index);
344
+ }
345
+ return content;
346
+ }
347
+ );
348
+ Object.keys(newState.data.zones || {}).forEach((zoneCompound) => {
349
+ const parentId = zoneCompound.split(":")[0];
350
+ if (nodesToDelete.includes(parentId) && newState.data.zones) {
351
+ delete newState.data.zones[zoneCompound];
352
+ }
353
+ });
354
+ Object.keys(newState.indexes.zones).forEach((zoneCompound) => {
355
+ const parentId = zoneCompound.split(":")[0];
356
+ if (nodesToDelete.includes(parentId)) {
357
+ delete newState.indexes.zones[zoneCompound];
358
+ }
359
+ });
360
+ nodesToDelete.forEach((id) => {
361
+ delete newState.indexes.nodes[id];
362
+ });
363
+ return newState;
364
+ };
365
+
366
+ // reducer/actions/register-zone.ts
367
+ init_react_import();
368
+ var zoneCache = {};
369
+ function registerZoneAction(state, action) {
370
+ if (zoneCache[action.zone]) {
371
+ return __spreadProps(__spreadValues({}, state), {
372
+ data: __spreadProps(__spreadValues({}, state.data), {
373
+ zones: __spreadProps(__spreadValues({}, state.data.zones), {
374
+ [action.zone]: zoneCache[action.zone]
375
+ })
376
+ }),
377
+ indexes: __spreadProps(__spreadValues({}, state.indexes), {
378
+ zones: __spreadProps(__spreadValues({}, state.indexes.zones), {
379
+ [action.zone]: __spreadProps(__spreadValues({}, state.indexes.zones[action.zone]), {
380
+ contentIds: zoneCache[action.zone].map((item) => item.props.id),
381
+ type: "dropzone"
382
+ })
383
+ })
384
+ })
385
+ });
386
+ }
387
+ return __spreadProps(__spreadValues({}, state), { data: setupZone(state.data, action.zone) });
388
+ }
389
+ function unregisterZoneAction(state, action) {
390
+ const _zones = __spreadValues({}, state.data.zones || {});
391
+ const zoneIndex = __spreadValues({}, state.indexes.zones || {});
392
+ if (_zones[action.zone]) {
393
+ zoneCache[action.zone] = _zones[action.zone];
394
+ delete _zones[action.zone];
395
+ }
396
+ delete zoneIndex[action.zone];
397
+ return __spreadProps(__spreadValues({}, state), {
398
+ data: __spreadProps(__spreadValues({}, state.data), {
399
+ zones: _zones
400
+ }),
401
+ indexes: __spreadProps(__spreadValues({}, state.indexes), {
402
+ zones: zoneIndex
403
+ })
404
+ });
405
+ }
406
+
407
+ // reducer/actions/set-data.ts
408
+ init_react_import();
409
+ var setDataAction = (state, action, appStore) => {
410
+ if (typeof action.data === "object") {
411
+ console.warn(
412
+ "`setData` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
413
+ );
414
+ return walkAppState(
415
+ __spreadProps(__spreadValues({}, state), {
416
+ data: __spreadValues(__spreadValues({}, state.data), action.data)
417
+ }),
418
+ appStore.config
419
+ );
420
+ }
421
+ return walkAppState(
422
+ __spreadProps(__spreadValues({}, state), {
423
+ data: __spreadValues(__spreadValues({}, state.data), action.data(state.data))
424
+ }),
425
+ appStore.config
426
+ );
427
+ };
428
+
429
+ // reducer/actions/set-ui.ts
430
+ init_react_import();
431
+ var setUiAction = (state, action) => {
432
+ if (typeof action.ui === "object") {
433
+ return __spreadProps(__spreadValues({}, state), {
434
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
435
+ });
436
+ }
437
+ return __spreadProps(__spreadValues({}, state), {
438
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui(state.ui))
439
+ });
440
+ };
441
+
442
+ // lib/data/make-state-public.ts
443
+ init_react_import();
444
+ var makeStatePublic = (state) => {
445
+ const { data, ui } = state;
446
+ return { data, ui };
447
+ };
448
+
449
+ // reducer/actions.tsx
450
+ init_react_import();
451
+
452
+ // reducer/index.ts
453
+ function storeInterceptor(reducer, record, onAction) {
454
+ return (state, action) => {
455
+ const newAppState = reducer(state, action);
456
+ const isValidType = ![
457
+ "registerZone",
458
+ "unregisterZone",
459
+ "setData",
460
+ "setUi",
461
+ "set"
462
+ ].includes(action.type);
463
+ if (typeof action.recordHistory !== "undefined" ? action.recordHistory : isValidType) {
464
+ if (record) record(newAppState);
465
+ }
466
+ onAction == null ? void 0 : onAction(action, makeStatePublic(newAppState), makeStatePublic(state));
467
+ return newAppState;
468
+ };
469
+ }
470
+ function createReducer({
471
+ record,
472
+ onAction,
473
+ appStore
474
+ }) {
475
+ return storeInterceptor(
476
+ (state, action) => {
477
+ if (action.type === "set") {
478
+ return setAction(state, action, appStore);
479
+ }
480
+ if (action.type === "insert") {
481
+ return insertAction(state, action, appStore);
482
+ }
483
+ if (action.type === "replace") {
484
+ return replaceAction(state, action, appStore);
485
+ }
486
+ if (action.type === "replaceRoot") {
487
+ return replaceRootAction(state, action, appStore);
488
+ }
489
+ if (action.type === "duplicate") {
490
+ return duplicateAction(state, action, appStore);
491
+ }
492
+ if (action.type === "reorder") {
493
+ return reorderAction(state, action, appStore);
494
+ }
495
+ if (action.type === "move") {
496
+ return moveAction(state, action, appStore);
497
+ }
498
+ if (action.type === "remove") {
499
+ return removeAction(state, action, appStore);
500
+ }
501
+ if (action.type === "registerZone") {
502
+ return registerZoneAction(state, action);
503
+ }
504
+ if (action.type === "unregisterZone") {
505
+ return unregisterZoneAction(state, action);
506
+ }
507
+ if (action.type === "setData") {
508
+ return setDataAction(state, action, appStore);
509
+ }
510
+ if (action.type === "setUi") {
511
+ return setUiAction(state, action);
512
+ }
513
+ return state;
514
+ },
515
+ record,
516
+ onAction
517
+ );
518
+ }
519
+
520
+ export {
521
+ insert,
522
+ generateId,
523
+ populateIds,
524
+ insertAction,
525
+ getItem,
526
+ makeStatePublic,
527
+ createReducer
528
+ };
@@ -84,95 +84,6 @@ var init_react_import = __esm({
84
84
  }
85
85
  });
86
86
 
87
- // ../../node_modules/classnames/index.js
88
- var require_classnames = __commonJS({
89
- "../../node_modules/classnames/index.js"(exports, module) {
90
- "use strict";
91
- init_react_import();
92
- (function() {
93
- "use strict";
94
- var hasOwn = {}.hasOwnProperty;
95
- function classNames() {
96
- var classes = "";
97
- for (var i = 0; i < arguments.length; i++) {
98
- var arg = arguments[i];
99
- if (arg) {
100
- classes = appendClass(classes, parseValue(arg));
101
- }
102
- }
103
- return classes;
104
- }
105
- function parseValue(arg) {
106
- if (typeof arg === "string" || typeof arg === "number") {
107
- return arg;
108
- }
109
- if (typeof arg !== "object") {
110
- return "";
111
- }
112
- if (Array.isArray(arg)) {
113
- return classNames.apply(null, arg);
114
- }
115
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
116
- return arg.toString();
117
- }
118
- var classes = "";
119
- for (var key in arg) {
120
- if (hasOwn.call(arg, key) && arg[key]) {
121
- classes = appendClass(classes, key);
122
- }
123
- }
124
- return classes;
125
- }
126
- function appendClass(value, newClass) {
127
- if (!newClass) {
128
- return value;
129
- }
130
- if (value) {
131
- return value + " " + newClass;
132
- }
133
- return value + newClass;
134
- }
135
- if (typeof module !== "undefined" && module.exports) {
136
- classNames.default = classNames;
137
- module.exports = classNames;
138
- } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
139
- define("classnames", [], function() {
140
- return classNames;
141
- });
142
- } else {
143
- window.classNames = classNames;
144
- }
145
- })();
146
- }
147
- });
148
-
149
- // lib/get-class-name-factory.ts
150
- init_react_import();
151
- var import_classnames = __toESM(require_classnames());
152
- var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
153
- if (typeof options === "string") {
154
- const descendant = options;
155
- const style = styles[`${rootClass}-${descendant}`];
156
- if (style) {
157
- return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
158
- }
159
- return "";
160
- } else if (typeof options === "object") {
161
- const modifiers = options;
162
- const prefixedModifiers = {};
163
- for (let modifier in modifiers) {
164
- prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
165
- }
166
- const c = styles[rootClass];
167
- return config.baseClass + (0, import_classnames.default)(__spreadValues({
168
- [c]: !!c
169
- }, prefixedModifiers));
170
- } else {
171
- return config.baseClass + styles[rootClass] || "";
172
- }
173
- };
174
- var get_class_name_factory_default = getClassNameFactory;
175
-
176
87
  export {
177
88
  __spreadValues,
178
89
  __spreadProps,
@@ -180,15 +91,5 @@ export {
180
91
  __commonJS,
181
92
  __toESM,
182
93
  __async,
183
- init_react_import,
184
- get_class_name_factory_default
94
+ init_react_import
185
95
  };
186
- /*! Bundled license information:
187
-
188
- classnames/index.js:
189
- (*!
190
- Copyright (c) 2018 Jed Watson.
191
- Licensed under the MIT License (MIT), see
192
- http://jedwatson.github.io/classnames
193
- *)
194
- */
@@ -5,10 +5,10 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-7KY6RHEY.mjs";
8
+ } from "./chunk-K562SEXI.mjs";
9
9
  import {
10
10
  init_react_import
11
- } from "./chunk-DCSQEDMK.mjs";
11
+ } from "./chunk-M6W7YEVX.mjs";
12
12
 
13
13
  // components/RichTextMenu/controls/HeadingSelect/use-options.ts
14
14
  init_react_import();