camox 0.22.0 → 0.23.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.
@@ -24,9 +24,9 @@ import { Accordion } from "@base-ui/react/accordion";
24
24
  //#region src/features/preview/components/PageTree.tsx
25
25
  function useEmbedTitle(url) {
26
26
  const $ = c(4);
27
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
27
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
28
28
  for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
29
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
29
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
30
30
  }
31
31
  const [title, setTitle] = React.useState(null);
32
32
  let t0;
@@ -58,12 +58,12 @@ function _temp(res) {
58
58
  return res.text();
59
59
  }
60
60
  const FieldItem = (t0) => {
61
- const $ = c(30);
62
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
63
- for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
64
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
61
+ const $ = c(29);
62
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
63
+ for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
64
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
65
65
  }
66
- const { fieldName, value, fieldType, schemaTitle, arrayItemType, isSelected, onFieldClick, onFieldDoubleClick, onMouseEnter, onMouseLeave } = t0;
66
+ const { fieldName, value, fieldType, schemaTitle, isSelected, onFieldClick, onFieldDoubleClick, onMouseEnter, onMouseLeave } = t0;
67
67
  const fetchedEmbedTitle = useEmbedTitle(fieldType === "Embed" ? value : null);
68
68
  const fieldDef = fieldType != null ? fieldTypesDictionary[fieldType] : null;
69
69
  let t1;
@@ -82,51 +82,50 @@ const FieldItem = (t0) => {
82
82
  } else t1 = $[6];
83
83
  const displayValue = t1;
84
84
  let t2;
85
- if ($[7] !== arrayItemType || $[8] !== fieldDef) {
86
- t2 = fieldDef?.getIcon({ arrayItemType }) ?? Type;
87
- $[7] = arrayItemType;
88
- $[8] = fieldDef;
89
- $[9] = t2;
90
- } else t2 = $[9];
85
+ if ($[7] !== fieldDef) {
86
+ t2 = fieldDef?.getIcon() ?? Type;
87
+ $[7] = fieldDef;
88
+ $[8] = t2;
89
+ } else t2 = $[8];
91
90
  const FieldIcon = t2;
92
91
  const t3 = isSelected ? "bg-accent" : "hover:bg-accent/75";
93
92
  let t4;
94
- if ($[10] !== t3) {
93
+ if ($[9] !== t3) {
95
94
  t4 = cn("flex items-center gap-1.5 rounded-lg pl-2 pr-1 py-2 cursor-default group/field", t3);
96
- $[10] = t3;
97
- $[11] = t4;
98
- } else t4 = $[11];
95
+ $[9] = t3;
96
+ $[10] = t4;
97
+ } else t4 = $[10];
99
98
  let t5;
100
- if ($[12] !== fieldType || $[13] !== onFieldClick) {
99
+ if ($[11] !== fieldType || $[12] !== onFieldClick) {
101
100
  t5 = () => fieldType && onFieldClick();
102
- $[12] = fieldType;
103
- $[13] = onFieldClick;
104
- $[14] = t5;
105
- } else t5 = $[14];
101
+ $[11] = fieldType;
102
+ $[12] = onFieldClick;
103
+ $[13] = t5;
104
+ } else t5 = $[13];
106
105
  let t6;
107
- if ($[15] !== fieldType || $[16] !== onFieldDoubleClick) {
106
+ if ($[14] !== fieldType || $[15] !== onFieldDoubleClick) {
108
107
  t6 = () => fieldType && onFieldDoubleClick();
109
- $[15] = fieldType;
110
- $[16] = onFieldDoubleClick;
111
- $[17] = t6;
112
- } else t6 = $[17];
108
+ $[14] = fieldType;
109
+ $[15] = onFieldDoubleClick;
110
+ $[16] = t6;
111
+ } else t6 = $[16];
113
112
  let t7;
114
- if ($[18] !== FieldIcon) {
113
+ if ($[17] !== FieldIcon) {
115
114
  t7 = /* @__PURE__ */ jsx(FieldIcon, { className: "size-4 shrink-0" });
116
- $[18] = FieldIcon;
117
- $[19] = t7;
118
- } else t7 = $[19];
115
+ $[17] = FieldIcon;
116
+ $[18] = t7;
117
+ } else t7 = $[18];
119
118
  let t8;
120
- if ($[20] !== displayValue) {
119
+ if ($[19] !== displayValue) {
121
120
  t8 = /* @__PURE__ */ jsx("span", {
122
121
  className: "text-accent-foreground truncate select-none",
123
122
  children: displayValue
124
123
  });
125
- $[20] = displayValue;
126
- $[21] = t8;
127
- } else t8 = $[21];
124
+ $[19] = displayValue;
125
+ $[20] = t8;
126
+ } else t8 = $[20];
128
127
  let t9;
129
- if ($[22] !== onMouseEnter || $[23] !== onMouseLeave || $[24] !== t4 || $[25] !== t5 || $[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
128
+ if ($[21] !== onMouseEnter || $[22] !== onMouseLeave || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t7 || $[27] !== t8) {
130
129
  t9 = /* @__PURE__ */ jsxs("li", {
131
130
  className: t4,
132
131
  onClick: t5,
@@ -135,22 +134,22 @@ const FieldItem = (t0) => {
135
134
  onMouseLeave,
136
135
  children: [t7, t8]
137
136
  });
138
- $[22] = onMouseEnter;
139
- $[23] = onMouseLeave;
140
- $[24] = t4;
141
- $[25] = t5;
142
- $[26] = t6;
143
- $[27] = t7;
144
- $[28] = t8;
145
- $[29] = t9;
146
- } else t9 = $[29];
137
+ $[21] = onMouseEnter;
138
+ $[22] = onMouseLeave;
139
+ $[23] = t4;
140
+ $[24] = t5;
141
+ $[25] = t6;
142
+ $[26] = t7;
143
+ $[27] = t8;
144
+ $[28] = t9;
145
+ } else t9 = $[28];
147
146
  return t9;
148
147
  };
149
148
  const BlockFields = (t0) => {
150
149
  const $ = c(5);
151
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
150
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
152
151
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
153
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
152
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
154
153
  }
155
154
  const { block } = t0;
156
155
  const schemaProperties = useCamoxApp().getBlockById(block.type)?._internal.contentSchema.properties;
@@ -179,11 +178,11 @@ const BlockFields = (t0) => {
179
178
  fieldType
180
179
  });
181
180
  };
182
- const handleFieldDoubleClick = (fieldName_0, fieldType_0, arrayItemType) => {
181
+ const handleFieldDoubleClick = (fieldName_0, fieldType_0) => {
183
182
  fieldTypesDictionary[fieldType_0].onTreeDoubleClick({
184
183
  blockId: block.id,
185
184
  fieldName: fieldName_0
186
- }, { arrayItemType });
185
+ });
187
186
  };
188
187
  const handleFieldMouseEnter = (fieldName_1, isRepeatable) => {
189
188
  if (!iframeElement?.contentWindow) return;
@@ -225,16 +224,15 @@ const BlockFields = (t0) => {
225
224
  const fieldSchema = schemaProperties?.[fieldName_3];
226
225
  if (!fieldSchema) return null;
227
226
  const fieldType_1 = fieldSchema.fieldType;
228
- const isRepeatable_1 = fieldType_1 === "RepeatableItem";
227
+ const isRepeatable_1 = fieldType_1 === "Repeater";
229
228
  return /* @__PURE__ */ jsx(FieldItem, {
230
229
  fieldName: fieldName_3,
231
230
  value,
232
231
  fieldType: fieldType_1,
233
232
  schemaTitle: fieldSchema?.title,
234
- arrayItemType: fieldSchema?.arrayItemType,
235
233
  isSelected: selectedFieldName === fieldName_3,
236
234
  onFieldClick: () => handleFieldClick(fieldName_3, fieldType_1),
237
- onFieldDoubleClick: () => handleFieldDoubleClick(fieldName_3, fieldType_1, fieldSchema?.arrayItemType),
235
+ onFieldDoubleClick: () => handleFieldDoubleClick(fieldName_3, fieldType_1),
238
236
  onMouseEnter: () => handleFieldMouseEnter(fieldName_3, isRepeatable_1),
239
237
  onMouseLeave: () => handleFieldMouseLeave(fieldName_3, isRepeatable_1)
240
238
  }, fieldName_3);
@@ -252,9 +250,9 @@ const BlockFields = (t0) => {
252
250
  };
253
251
  function useBlockTreeItem(block, t0) {
254
252
  const $ = c(17);
255
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
253
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
256
254
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
257
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
255
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
258
256
  }
259
257
  const isDragging = t0 === void 0 ? false : t0;
260
258
  const [ellipsisPopoverOpen, setEllipsisPopoverOpen] = React.useState(false);
@@ -336,9 +334,9 @@ function _temp6(state) {
336
334
  }
337
335
  const BlockTreeItemHeader = (t0) => {
338
336
  const $ = c(17);
339
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
337
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
340
338
  for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
341
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
339
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
342
340
  }
343
341
  let children;
344
342
  let className;
@@ -391,9 +389,9 @@ const BlockTreeItemHeader = (t0) => {
391
389
  };
392
390
  const BlockTreeItemTrigger = (t0) => {
393
391
  const $ = c(5);
394
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
392
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
395
393
  for (let $i = 0; $i < 5; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
396
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
394
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
397
395
  }
398
396
  const { displayText, onClick } = t0;
399
397
  let t1;
@@ -420,9 +418,9 @@ const BlockTreeItemTrigger = (t0) => {
420
418
  };
421
419
  const BlockTreeItemEllipsis = (t0) => {
422
420
  const $ = c(12);
423
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
421
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
424
422
  for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
425
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
423
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
426
424
  }
427
425
  let className;
428
426
  let open;
@@ -468,9 +466,9 @@ const BlockTreeItemEllipsis = (t0) => {
468
466
  };
469
467
  const BlockTreeItemContent = (t0) => {
470
468
  const $ = c(3);
471
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
469
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
472
470
  for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
473
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
471
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
474
472
  }
475
473
  const { block } = t0;
476
474
  let t1;
@@ -491,9 +489,9 @@ const animateLayoutChanges = (args) => {
491
489
  };
492
490
  const SortableBlock = (t0) => {
493
491
  const $ = c(53);
494
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
492
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
495
493
  for (let $i = 0; $i < 53; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
496
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
494
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
497
495
  }
498
496
  const { block } = t0;
499
497
  const [gripPopoverOpen, setGripPopoverOpen] = React.useState(false);
@@ -682,9 +680,9 @@ const SortableBlock = (t0) => {
682
680
  };
683
681
  const LayoutBlockItem = (t0) => {
684
682
  const $ = c(44);
685
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
683
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
686
684
  for (let $i = 0; $i < 44; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
687
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
685
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
688
686
  }
689
687
  const { block, layoutName } = t0;
690
688
  const camoxApp = useCamoxApp();
@@ -843,9 +841,9 @@ const LayoutBlockItem = (t0) => {
843
841
  };
844
842
  const PageTree = () => {
845
843
  const $ = c(47);
846
- if ($[0] !== "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6") {
844
+ if ($[0] !== "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87") {
847
845
  for (let $i = 0; $i < 47; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
848
- $[0] = "9c417d229324e2003d4d0288e38650d49145eccc65c3aa255e298a642db8daa6";
846
+ $[0] = "93644338051da8a2fc7d6bcaeba79afa786571ac097e7be02bb6bea0e96d3c87";
849
847
  }
850
848
  const page = usePreviewedPage();
851
849
  const { pageBlocks, beforeBlocks: layoutBeforeBlocks, afterBlocks: layoutAfterBlocks } = usePageBlocks(page);
@@ -23,7 +23,7 @@ const buildNestedItemSeeds = (itemProperties) => {
23
23
  const recurse = (properties, parentTempId) => {
24
24
  for (const [fieldName, fieldSchema] of Object.entries(properties)) {
25
25
  if (fieldSchema.type !== "array" || !fieldSchema.items?.properties) continue;
26
- if (fieldSchema.fieldType === "MultipleAssets") continue;
26
+ if (fieldSchema.fieldType === "ImageList" || fieldSchema.fieldType === "FileList") continue;
27
27
  const defaultCount = fieldSchema.defaultItems ?? fieldSchema.minItems ?? 0;
28
28
  if (defaultCount <= 0) continue;
29
29
  const nestedItemProps = fieldSchema.items.properties;
@@ -51,9 +51,9 @@ const buildNestedItemSeeds = (itemProperties) => {
51
51
  };
52
52
  const useRepeatableItemActions = (t0) => {
53
53
  const $ = c(16);
54
- if ($[0] !== "a0380cb6259b3f97fda7ea3d02bab3cd01067002da6d4b339fdd4dcc593e03c2") {
54
+ if ($[0] !== "d693f3f98b78f44d12370cd285b6b90b102d5a7113c502e626ffcfe13f24976a") {
55
55
  for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
56
- $[0] = "a0380cb6259b3f97fda7ea3d02bab3cd01067002da6d4b339fdd4dcc593e03c2";
56
+ $[0] = "d693f3f98b78f44d12370cd285b6b90b102d5a7113c502e626ffcfe13f24976a";
57
57
  }
58
58
  const { blockId, fieldName, parentItemId, arraySchema, siblingCount } = t0;
59
59
  let t1;
@@ -151,9 +151,9 @@ const getArraySchemaForItem = (contentSchema, itemId, itemsMap) => {
151
151
  */
152
152
  const useCurrentItemActions = (blockId, itemId) => {
153
153
  const $ = c(27);
154
- if ($[0] !== "a0380cb6259b3f97fda7ea3d02bab3cd01067002da6d4b339fdd4dcc593e03c2") {
154
+ if ($[0] !== "d693f3f98b78f44d12370cd285b6b90b102d5a7113c502e626ffcfe13f24976a") {
155
155
  for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
156
- $[0] = "a0380cb6259b3f97fda7ea3d02bab3cd01067002da6d4b339fdd4dcc593e03c2";
156
+ $[0] = "d693f3f98b78f44d12370cd285b6b90b102d5a7113c502e626ffcfe13f24976a";
157
157
  }
158
158
  const camoxApp = useCamoxApp();
159
159
  let t0;