@reacteditor/core 0.0.1-alpha.0

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