@puckeditor/core 0.21.1-canary.ff9d0732 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  PuckRichText
3
- } from "./chunk-V5I7CVLT.mjs";
3
+ } from "./chunk-2CNEFIQP.mjs";
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-UZZ6SRV3.mjs";
7
+ } from "./chunk-RHVK562Z.mjs";
8
8
  import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-RYILZVCB.mjs";
10
- import "./chunk-UFXHMVJE.mjs";
11
- import "./chunk-MNNPATDB.mjs";
12
- import "./chunk-YBJ32VYI.mjs";
9
+ import "./chunk-5V242HXR.mjs";
10
+ import "./chunk-MSZPUXZP.mjs";
11
+ import "./chunk-KOUWDQ4Q.mjs";
12
+ import "./chunk-SKJTJUWU.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-HLB66X4S.mjs";
17
- import "./chunk-QIJR53IK.mjs";
18
- import "./chunk-AHX7X7NZ.mjs";
16
+ } from "./chunk-UMTU6EA7.mjs";
17
+ import "./chunk-37HTE4KO.mjs";
18
+ import "./chunk-MDUBGHWF.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-7TZD3NRP.mjs";
20
+ import "./chunk-PMXRXC2B.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PuckRichText
3
- } from "./chunk-V5I7CVLT.mjs";
3
+ } from "./chunk-2CNEFIQP.mjs";
4
4
  import {
5
5
  styles_module_default
6
6
  } from "./chunk-AOEDIUVK.mjs";
@@ -43,9 +43,6 @@ var PuckRichText = Extension.create({
43
43
  if (options.blockquote !== false) {
44
44
  extensions.push(Blockquote.configure(options.blockquote));
45
45
  }
46
- if (options.bulletList !== false) {
47
- extensions.push(BulletList.configure(options.bulletList));
48
- }
49
46
  if (options.code !== false) {
50
47
  extensions.push(Code.configure(options.code));
51
48
  }
@@ -69,6 +66,12 @@ var PuckRichText = Extension.create({
69
66
  }
70
67
  if (options.listItem !== false) {
71
68
  extensions.push(ListItem.configure(options.listItem));
69
+ if (options.bulletList !== false) {
70
+ extensions.push(BulletList.configure(options.bulletList));
71
+ }
72
+ if (options.orderedList !== false) {
73
+ extensions.push(OrderedList.configure(options.orderedList));
74
+ }
72
75
  }
73
76
  if (options.listKeymap !== false) {
74
77
  extensions.push(ListKeymap.configure(options == null ? void 0 : options.listKeymap));
@@ -76,9 +79,6 @@ var PuckRichText = Extension.create({
76
79
  if (options.link !== false) {
77
80
  extensions.push(Link.configure(options == null ? void 0 : options.link));
78
81
  }
79
- if (options.orderedList !== false) {
80
- extensions.push(OrderedList.configure(options.orderedList));
81
- }
82
82
  if (options.paragraph !== false) {
83
83
  extensions.push(Paragraph.configure(options.paragraph));
84
84
  }
@@ -1,9 +1,10 @@
1
1
  import {
2
+ generateId,
2
3
  rootDroppableId,
3
4
  setupZone,
4
5
  walkAppState,
5
6
  walkTree
6
- } from "./chunk-7TZD3NRP.mjs";
7
+ } from "./chunk-PMXRXC2B.mjs";
7
8
  import {
8
9
  __spreadProps,
9
10
  __spreadValues,
@@ -40,11 +41,6 @@ var insert = (list, index, item) => {
40
41
  return result;
41
42
  };
42
43
 
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
44
  // lib/data/get-ids-for-parent.ts
49
45
  init_react_import();
50
46
  var getIdsForParent = (zoneCompound, state) => {
@@ -519,7 +515,6 @@ function createReducer({
519
515
 
520
516
  export {
521
517
  insert,
522
- generateId,
523
518
  populateIds,
524
519
  insertAction,
525
520
  getItem,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-UFXHMVJE.mjs";
3
+ } from "./chunk-MSZPUXZP.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-MNNPATDB.mjs";
6
+ } from "./chunk-KOUWDQ4Q.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-YBJ32VYI.mjs";
9
+ } from "./chunk-SKJTJUWU.mjs";
10
10
  import {
11
11
  AlignCenter,
12
12
  AlignJustify,
@@ -26,7 +26,7 @@ import {
26
26
  Strikethrough,
27
27
  Underline,
28
28
  useControlContext
29
- } from "./chunk-HLB66X4S.mjs";
29
+ } from "./chunk-UMTU6EA7.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-Y2EFNT5P.mjs";
@@ -349,7 +349,7 @@ function AlignSelectFallback() {
349
349
  // components/RichTextMenu/controls/AlignSelect/index.tsx
350
350
  import { jsx as jsx10 } from "react/jsx-runtime";
351
351
  var AlignSelectLoaded = lazy(
352
- () => import("./loaded-G2WSQZO7.mjs").then((m) => ({
352
+ () => import("./loaded-362ACKSQ.mjs").then((m) => ({
353
353
  default: m.AlignSelectLoaded
354
354
  }))
355
355
  );
@@ -580,7 +580,7 @@ function HeadingSelectFallback() {
580
580
  // components/RichTextMenu/controls/HeadingSelect/index.tsx
581
581
  import { jsx as jsx22 } from "react/jsx-runtime";
582
582
  var HeadingSelectLoaded = lazy2(
583
- () => import("./loaded-MYALJBRK.mjs").then((m) => ({
583
+ () => import("./loaded-DIHUQBWF.mjs").then((m) => ({
584
584
  default: m.HeadingSelectLoaded
585
585
  }))
586
586
  );
@@ -612,7 +612,7 @@ function ListSelectFallback() {
612
612
  // components/RichTextMenu/controls/ListSelect/index.tsx
613
613
  import { jsx as jsx24 } from "react/jsx-runtime";
614
614
  var ListSelectLoaded = lazy3(
615
- () => import("./loaded-5AM4V5PV.mjs").then((m) => ({
615
+ () => import("./loaded-SJJ63OY2.mjs").then((m) => ({
616
616
  default: m.ListSelectLoaded
617
617
  }))
618
618
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EditorInner,
3
3
  LoadedRichTextMenu
4
- } from "./chunk-UZZ6SRV3.mjs";
4
+ } from "./chunk-RHVK562Z.mjs";
5
5
  import {
6
6
  RichTextRenderFallback,
7
7
  SlotRender,
@@ -10,13 +10,13 @@ import {
10
10
  getSlotTransform,
11
11
  useRichtextProps,
12
12
  useSlots
13
- } from "./chunk-WB2EIKOA.mjs";
13
+ } from "./chunk-TNORMHZU.mjs";
14
14
  import {
15
15
  ActionBar,
16
16
  IconButton,
17
17
  LoadedRichTextMenuInner,
18
18
  Loader
19
- } from "./chunk-RYILZVCB.mjs";
19
+ } from "./chunk-5V242HXR.mjs";
20
20
  import {
21
21
  ChevronDown,
22
22
  ChevronRight,
@@ -68,26 +68,26 @@ import {
68
68
  useRegisterHistorySlice,
69
69
  useRegisterPermissionsSlice,
70
70
  useResetAutoZoom
71
- } from "./chunk-HLB66X4S.mjs";
71
+ } from "./chunk-UMTU6EA7.mjs";
72
72
  import {
73
- generateId,
74
73
  getItem,
75
74
  insert,
76
75
  insertAction,
77
76
  makeStatePublic,
78
77
  populateIds
79
- } from "./chunk-QIJR53IK.mjs";
78
+ } from "./chunk-37HTE4KO.mjs";
80
79
  import {
81
80
  defaultAppState,
82
81
  defaultViewports,
83
82
  toComponent
84
- } from "./chunk-AHX7X7NZ.mjs";
83
+ } from "./chunk-MDUBGHWF.mjs";
85
84
  import {
86
85
  get_class_name_factory_default
87
86
  } from "./chunk-Y2EFNT5P.mjs";
88
87
  import {
89
88
  defaultSlots,
90
89
  expandNode,
90
+ generateId,
91
91
  mapFields,
92
92
  rootAreaId,
93
93
  rootDroppableId,
@@ -95,53 +95,15 @@ import {
95
95
  setupZone,
96
96
  walkAppState,
97
97
  walkField
98
- } from "./chunk-7TZD3NRP.mjs";
98
+ } from "./chunk-PMXRXC2B.mjs";
99
99
  import {
100
100
  __async,
101
- __commonJS,
102
101
  __objRest,
103
102
  __spreadProps,
104
103
  __spreadValues,
105
- __toESM,
106
104
  init_react_import
107
105
  } from "./chunk-M6W7YEVX.mjs";
108
106
 
109
- // ../../node_modules/fast-deep-equal/index.js
110
- var require_fast_deep_equal = __commonJS({
111
- "../../node_modules/fast-deep-equal/index.js"(exports, module) {
112
- "use strict";
113
- init_react_import();
114
- module.exports = function equal(a, b) {
115
- if (a === b) return true;
116
- if (a && b && typeof a == "object" && typeof b == "object") {
117
- if (a.constructor !== b.constructor) return false;
118
- var length, i, keys;
119
- if (Array.isArray(a)) {
120
- length = a.length;
121
- if (length != b.length) return false;
122
- for (i = length; i-- !== 0; )
123
- if (!equal(a[i], b[i])) return false;
124
- return true;
125
- }
126
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
127
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
128
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
129
- keys = Object.keys(a);
130
- length = keys.length;
131
- if (length !== Object.keys(b).length) return false;
132
- for (i = length; i-- !== 0; )
133
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
134
- for (i = length; i-- !== 0; ) {
135
- var key = keys[i];
136
- if (!equal(a[key], b[key])) return false;
137
- }
138
- return true;
139
- }
140
- return a !== a && b !== b;
141
- };
142
- }
143
- });
144
-
145
107
  // bundle/index.ts
146
108
  init_react_import();
147
109
 
@@ -219,7 +181,7 @@ init_react_import();
219
181
 
220
182
  // css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/fields/ArrayField/styles.module.css#css-module
221
183
  init_react_import();
222
- var styles_module_default2 = { "ArrayField": "_ArrayField_14u8o_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_14u8o_13", "ArrayField-addButton": "_ArrayField-addButton_14u8o_18", "ArrayField--hasItems": "_ArrayField--hasItems_14u8o_33", "ArrayField-inner": "_ArrayField-inner_14u8o_59", "ArrayFieldItem": "_ArrayFieldItem_14u8o_67", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_14u8o_78", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_14u8o_82", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_14u8o_97", "ArrayField--addDisabled": "_ArrayField--addDisabled_14u8o_127", "ArrayFieldItem-body": "_ArrayFieldItem-body_14u8o_166", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_14u8o_175", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_14u8o_183", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_14u8o_189" };
184
+ var styles_module_default2 = { "ArrayField": "_ArrayField_1vaho_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1vaho_13", "ArrayField-addButton": "_ArrayField-addButton_1vaho_18", "ArrayField--hasItems": "_ArrayField--hasItems_1vaho_33", "ArrayField-inner": "_ArrayField-inner_1vaho_59", "ArrayFieldItem": "_ArrayFieldItem_1vaho_67", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1vaho_78", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1vaho_82", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1vaho_97", "ArrayFieldItem--noFields": "_ArrayFieldItem--noFields_1vaho_122", "ArrayField--addDisabled": "_ArrayField--addDisabled_1vaho_131", "ArrayFieldItem-body": "_ArrayFieldItem-body_1vaho_170", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1vaho_179", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1vaho_187", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1vaho_193" };
223
185
 
224
186
  // components/AutoField/store.ts
225
187
  init_react_import();
@@ -883,14 +845,22 @@ var ArrayFieldItemInternal = ({
883
845
  const canEdit = useAppStore(
884
846
  (s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
885
847
  );
848
+ const hasVisibleFields = useMemo2(() => {
849
+ if (!field.arrayFields) {
850
+ return false;
851
+ }
852
+ return Object.values(field.arrayFields).some(
853
+ (subField) => subField.type !== "slot" && subField.visible !== false
854
+ );
855
+ }, [field.arrayFields]);
886
856
  return /* @__PURE__ */ jsx6(Sortable, { id, index: dragIndex, disabled: readOnly, children: ({ isDragging, ref, handleRef }) => /* @__PURE__ */ jsxs(
887
857
  "div",
888
858
  {
889
859
  ref,
890
860
  className: getClassNameItem({
891
- isExpanded,
861
+ isExpanded: isExpanded && hasVisibleFields,
892
862
  isDragging,
893
- readOnly
863
+ noFields: !hasVisibleFields
894
864
  }),
895
865
  children: [
896
866
  /* @__PURE__ */ jsxs(
@@ -898,7 +868,7 @@ var ArrayFieldItemInternal = ({
898
868
  {
899
869
  ref: handleRef,
900
870
  onClick: (e) => {
901
- if (isDragging) return;
871
+ if (isDragging || !hasVisibleFields) return;
902
872
  e.preventDefault();
903
873
  e.stopPropagation();
904
874
  onToggleExpand(id, isExpanded);
@@ -921,7 +891,7 @@ var ArrayFieldItemInternal = ({
921
891
  ]
922
892
  }
923
893
  ),
924
- /* @__PURE__ */ jsx6("div", { className: getClassNameItem("body"), children: isExpanded && /* @__PURE__ */ jsx6("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
894
+ /* @__PURE__ */ jsx6("div", { className: getClassNameItem("body"), children: isExpanded && hasVisibleFields && /* @__PURE__ */ jsx6("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
925
895
  const subField = field.arrayFields[subName];
926
896
  return /* @__PURE__ */ jsx6(
927
897
  SubField,
@@ -1971,7 +1941,7 @@ EditorFallback.displayName = "EditorFallback";
1971
1941
  // components/AutoField/fields/RichtextField/index.tsx
1972
1942
  import { Fragment as Fragment4, jsx as jsx17 } from "react/jsx-runtime";
1973
1943
  var Editor = lazy(
1974
- () => import("./Editor-T7APPU5O.mjs").then((m) => ({
1944
+ () => import("./Editor-NK3TZSR6.mjs").then((m) => ({
1975
1945
  default: m.Editor
1976
1946
  }))
1977
1947
  );
@@ -3604,12 +3574,12 @@ import {
3604
3574
  } from "react";
3605
3575
  import { jsx as jsx27 } from "react/jsx-runtime";
3606
3576
  var Editor2 = lazy2(
3607
- () => import("./Editor-T7APPU5O.mjs").then((m) => ({
3577
+ () => import("./Editor-NK3TZSR6.mjs").then((m) => ({
3608
3578
  default: m.Editor
3609
3579
  }))
3610
3580
  );
3611
3581
  var RichTextRender = lazy2(
3612
- () => import("./Render-FXZX6NFH.mjs").then((m) => ({
3582
+ () => import("./Render-CU35UAWV.mjs").then((m) => ({
3613
3583
  default: m.RichTextRender
3614
3584
  }))
3615
3585
  );
@@ -6378,7 +6348,7 @@ function useGetPuck() {
6378
6348
  }
6379
6349
 
6380
6350
  // components/Puck/index.tsx
6381
- var import_fast_deep_equal = __toESM(require_fast_deep_equal());
6351
+ import { deepEqual as deepEqual2 } from "fast-equals";
6382
6352
 
6383
6353
  // components/Puck/components/Layout/index.tsx
6384
6354
  init_react_import();
@@ -7715,10 +7685,11 @@ var Layout = ({ children }) => {
7715
7685
  const pluginItems = useMemo23(() => {
7716
7686
  const details = {};
7717
7687
  const defaultPlugins = [blocksPlugin(), outlinePlugin()];
7688
+ const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
7718
7689
  const combinedPlugins = [
7719
7690
  ...defaultPlugins,
7720
7691
  ...plugins != null ? plugins : []
7721
- ].sort((a) => a.name === "legacy-side-bar" ? -1 : 1);
7692
+ ].sort((a, b) => isLegacy(a) - isLegacy(b));
7722
7693
  if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
7723
7694
  combinedPlugins.push(fieldsPlugin());
7724
7695
  }
@@ -8017,7 +7988,7 @@ function PuckProvider({ children }) {
8017
7988
  (s) => s.state.data,
8018
7989
  (data) => {
8019
7990
  if (onChange) {
8020
- if ((0, import_fast_deep_equal.default)(data, previousData.current)) return;
7991
+ if (deepEqual2(data, previousData.current)) return;
8021
7992
  onChange(data);
8022
7993
  previousData.current = data;
8023
7994
  }
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-HLB66X4S.mjs";
8
+ } from "./chunk-UMTU6EA7.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mapFields
3
- } from "./chunk-7TZD3NRP.mjs";
3
+ } from "./chunk-PMXRXC2B.mjs";
4
4
  import {
5
5
  __async,
6
6
  __spreadProps,
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-HLB66X4S.mjs";
6
+ } from "./chunk-UMTU6EA7.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -422,6 +422,11 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
422
422
  });
423
423
  }
424
424
 
425
+ // lib/generate-id.ts
426
+ init_react_import();
427
+ import { v4 as uuidv4 } from "uuid";
428
+ var generateId = (type) => type ? `${type}-${uuidv4()}` : uuidv4();
429
+
425
430
  // lib/data/setup-zone.ts
426
431
  init_react_import();
427
432
  var setupZone = (data, zoneKey) => {
@@ -445,6 +450,7 @@ export {
445
450
  mapFields,
446
451
  expandNode,
447
452
  walkAppState,
453
+ generateId,
448
454
  walkTree,
449
455
  setupZone
450
456
  };
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-RYILZVCB.mjs";
6
+ } from "./chunk-5V242HXR.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-HLB66X4S.mjs";
10
+ } from "./chunk-UMTU6EA7.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -100,7 +100,7 @@ init_react_import();
100
100
  import { lazy, Suspense } from "react";
101
101
  import { jsx as jsx2 } from "react/jsx-runtime";
102
102
  var LoadedRichTextMenuFull = lazy(
103
- () => import("./full-4UGAOTTB.mjs").then((m) => ({
103
+ () => import("./full-KLPRWVS4.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-HLB66X4S.mjs";
4
+ } from "./chunk-UMTU6EA7.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -5,16 +5,17 @@ import {
5
5
  defaultAppState,
6
6
  resolveComponentData,
7
7
  toComponent
8
- } from "./chunk-AHX7X7NZ.mjs";
8
+ } from "./chunk-MDUBGHWF.mjs";
9
9
  import {
10
10
  get_class_name_factory_default
11
11
  } from "./chunk-Y2EFNT5P.mjs";
12
12
  import {
13
+ generateId,
13
14
  getZoneId,
14
15
  mapFields,
15
16
  walkAppState,
16
17
  walkTree
17
- } from "./chunk-7TZD3NRP.mjs";
18
+ } from "./chunk-PMXRXC2B.mjs";
18
19
  import {
19
20
  __async,
20
21
  __objRest,
@@ -354,15 +355,43 @@ function RichTextRenderFallback({ content }) {
354
355
  ) });
355
356
  }
356
357
 
358
+ // components/RichTextEditor/lib/mapDeep.ts
359
+ init_react_import();
360
+ var mapDeep = (source, path, render) => {
361
+ if (!source) {
362
+ return null;
363
+ }
364
+ if (path.length === 0) {
365
+ return render(source);
366
+ }
367
+ const [key, ...rest] = path;
368
+ if (Array.isArray(source)) {
369
+ return source.map((item) => mapDeep(item, path, render));
370
+ }
371
+ return __spreadProps(__spreadValues({}, source), {
372
+ [key]: mapDeep(source[key], rest, render)
373
+ });
374
+ };
375
+
357
376
  // components/RichTextEditor/lib/use-richtext-props.tsx
358
377
  import { jsx as jsx2 } from "react/jsx-runtime";
359
378
  function useRichtextProps(fields, props) {
360
- const findAllRichtextKeys = (fields2) => {
379
+ const findAllRichtextKeys = (fields2, path = []) => {
361
380
  if (!fields2) return [];
362
381
  const result = [];
363
382
  for (const [key, field] of Object.entries(fields2)) {
383
+ const currentPath = [...path, key];
364
384
  if (field.type === "richtext") {
365
- result.push(key);
385
+ result.push({
386
+ path: currentPath,
387
+ field
388
+ });
389
+ }
390
+ if (field.type === "array" && "arrayFields" in field) {
391
+ result.push(...findAllRichtextKeys(field.arrayFields, currentPath));
392
+ }
393
+ if (field.type === "object" && "objectFields" in field) {
394
+ result.push(...findAllRichtextKeys(field.objectFields, currentPath));
366
395
  }
367
396
  }
368
397
  return result;
@@ -371,20 +400,22 @@ function useRichtextProps(fields, props) {
371
400
  const richtextProps = useMemo2(() => {
372
401
  if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
373
402
  const RichTextRender = lazy(
374
- () => import("./Render-FXZX6NFH.mjs").then((m) => ({
403
+ () => import("./Render-CU35UAWV.mjs").then((m) => ({
375
404
  default: m.RichTextRender
376
405
  }))
377
406
  );
378
- return richtextKeys.reduce((acc, key) => {
379
- acc[key] = /* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(RichTextRenderFallback, { content: props[key] }), children: /* @__PURE__ */ jsx2(
380
- RichTextRender,
407
+ let result = __spreadValues({}, props);
408
+ for (const { path, field } of richtextKeys) {
409
+ result = mapDeep(result, path, (content) => /* @__PURE__ */ jsx2(
410
+ Suspense,
381
411
  {
382
- content: props[key],
383
- field: fields[key]
384
- }
385
- ) });
386
- return acc;
387
- }, {});
412
+ fallback: /* @__PURE__ */ jsx2(RichTextRenderFallback, { content }),
413
+ children: /* @__PURE__ */ jsx2(RichTextRender, { content, field })
414
+ },
415
+ generateId()
416
+ ));
417
+ }
418
+ return result;
388
419
  }, [richtextKeys, props, fields]);
389
420
  return richtextProps;
390
421
  }
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  createReducer,
3
- generateId,
4
3
  getItem,
5
4
  makeStatePublic
6
- } from "./chunk-QIJR53IK.mjs";
5
+ } from "./chunk-37HTE4KO.mjs";
7
6
  import {
8
7
  defaultAppState,
9
8
  defaultViewports,
10
9
  getChanged,
11
10
  resolveComponentData
12
- } from "./chunk-AHX7X7NZ.mjs";
11
+ } from "./chunk-MDUBGHWF.mjs";
13
12
  import {
14
13
  get_class_name_factory_default
15
14
  } from "./chunk-Y2EFNT5P.mjs";
16
15
  import {
16
+ generateId,
17
17
  walkAppState
18
- } from "./chunk-7TZD3NRP.mjs";
18
+ } from "./chunk-PMXRXC2B.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -1593,6 +1593,7 @@ var Select = ({
1593
1593
  }) => {
1594
1594
  const [open, setOpen] = useState(false);
1595
1595
  const hasOptions = options.length > 0;
1596
+ const isDisabled = disabled || !hasOptions;
1596
1597
  return /* @__PURE__ */ jsx(
1597
1598
  "div",
1598
1599
  {
@@ -1601,7 +1602,7 @@ var Select = ({
1601
1602
  hasOptions,
1602
1603
  actionBar: mode === "actionBar",
1603
1604
  standalone: mode === "standalone",
1604
- disabled
1605
+ disabled: isDisabled
1605
1606
  }),
1606
1607
  children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1607
1608
  hasOptions ? /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { className: getClassName("button"), children: [
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-RYILZVCB.mjs";
4
- import "./chunk-UFXHMVJE.mjs";
5
- import "./chunk-MNNPATDB.mjs";
6
- import "./chunk-YBJ32VYI.mjs";
7
- import "./chunk-HLB66X4S.mjs";
8
- import "./chunk-QIJR53IK.mjs";
9
- import "./chunk-AHX7X7NZ.mjs";
3
+ } from "./chunk-5V242HXR.mjs";
4
+ import "./chunk-MSZPUXZP.mjs";
5
+ import "./chunk-KOUWDQ4Q.mjs";
6
+ import "./chunk-SKJTJUWU.mjs";
7
+ import "./chunk-UMTU6EA7.mjs";
8
+ import "./chunk-37HTE4KO.mjs";
9
+ import "./chunk-MDUBGHWF.mjs";
10
10
  import "./chunk-Y2EFNT5P.mjs";
11
- import "./chunk-7TZD3NRP.mjs";
11
+ import "./chunk-PMXRXC2B.mjs";
12
12
  import {
13
13
  __spreadValues,
14
14
  init_react_import