@firecms/collection_editor 3.0.0-canary.44 → 3.0.0-canary.45

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.
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
2
- import { FieldCaption as X, SearchIconsView as yr, toSnakeCase as xt, singular as br, IconForView as dt, ArrayContainer as Cr, serializeRegExp as Nr, useSnackbarController as Ie, resolveEnumValues as xr, isPropertyBuilder as ie, useCustomizationController as Ae, getFieldConfig as Le, ErrorBoundary as me, PropertyConfigBadge as $e, unslugify as wt, useNavigationController as Te, mergeDeep as K, DEFAULT_FIELD_CONFIGS as Kt, isValidRegExp as Pr, getFieldId as Wt, DeleteConfirmationDialog as ct, useLargeLayout as wr, makePropertiesEditable as He, resolveEntityView as Tr, useSelectionController as kr, CircularProgressCenter as ut, EntityCollectionTable as Or, slugify as Vr, useAuthController as _e, randomString as Ft, removeUndefined as Et, ErrorView as Zt, removeInitialAndTrailingSlashes as Ir, getDefaultPropertiesOrder as _r, joinCollectionLists as Fr } from "@firecms/core";
2
+ import { FieldCaption as X, SearchIconsView as yr, toSnakeCase as Pt, singular as br, IconForView as dt, ArrayContainer as Cr, serializeRegExp as Nr, useSnackbarController as Ie, resolveEnumValues as Pr, isPropertyBuilder as ie, useCustomizationController as Ae, getFieldConfig as Le, ErrorBoundary as me, PropertyConfigBadge as $e, unslugify as wt, useNavigationController as Te, mergeDeep as K, DEFAULT_FIELD_CONFIGS as Kt, isValidRegExp as xr, getFieldId as Wt, DeleteConfirmationDialog as ct, useLargeLayout as wr, makePropertiesEditable as He, resolveEntityView as Tr, useSelectionController as kr, CircularProgressCenter as ut, EntityCollectionTable as Or, slugify as Vr, useAuthController as _e, randomString as Ft, removeUndefined as Et, ErrorView as Zt, removeInitialAndTrailingSlashes as Ir, getDefaultPropertiesOrder as _r, joinCollectionLists as Fr } from "@firecms/core";
3
3
  import * as Ue from "react";
4
4
  import Y, { useState as j, useEffect as ue, useMemo as Jt, useCallback as J, useRef as je, useDeferredValue as Er, useContext as Qt } from "react";
5
5
  import be from "react-fast-compare";
6
- import { useAutoComplete as Sr, Container as ht, Typography as V, Tooltip as te, IconButton as ae, Chip as Pt, TextField as Oe, cn as fe, DebouncedTextField as W, Autocomplete as Ar, AutocompleteItem as Dr, ExpandablePanel as Tt, SettingsIcon as Ye, Select as Ne, SelectItem as ee, BooleanSwitchWithLabel as pt, Dialog as Fe, AutoAwesomeIcon as ft, Badge as Br, ListIcon as Mr, Button as z, CircularProgress as Ge, Paper as ge, DialogContent as De, DialogActions as Be, RuleIcon as zr, FileUploadIcon as Rr, MultiSelect as Ur, MultiSelectItem as St, Checkbox as At, cardMixin as Xt, cardClickableMixin as er, cardSelectedMixin as tr, FunctionsIcon as jr, RemoveCircleIcon as qr, defaultBorderMixin as kt, RemoveIcon as Lr, DragHandleIcon as $r, AddIcon as ce, SelectGroup as Dt, InfoLabel as Hr, DeleteIcon as mt, ContentCopyIcon as Yr, CodeIcon as Gr, Table as Bt, TableBody as Mt, TableRow as Ct, TableCell as Re, Alert as Kr, Icon as it, Card as rr, coolIconKeys as zt, Tabs as Wr, Tab as Nt, ArrowBackIcon as nt, LoadingButton as Rt, DoneIcon as Zr, Menu as Jr, MoreVertIcon as Qr, MenuItem as Xr, SaveIcon as ei, UndoIcon as ti } from "@firecms/ui";
6
+ import { useAutoComplete as Sr, Container as ht, Typography as V, Tooltip as te, IconButton as ae, Chip as xt, TextField as Oe, cn as fe, DebouncedTextField as W, Autocomplete as Ar, AutocompleteItem as Dr, ExpandablePanel as Tt, SettingsIcon as Ye, Select as Ne, SelectItem as ee, BooleanSwitchWithLabel as pt, Dialog as Fe, AutoAwesomeIcon as ft, Badge as Br, ListIcon as Mr, Button as z, CircularProgress as Ge, Paper as ge, DialogContent as De, DialogActions as Be, RuleIcon as zr, FileUploadIcon as Rr, MultiSelect as Ur, MultiSelectItem as St, Checkbox as At, cardMixin as Xt, cardClickableMixin as er, cardSelectedMixin as tr, FunctionsIcon as jr, RemoveCircleIcon as qr, defaultBorderMixin as kt, RemoveIcon as Lr, DragHandleIcon as $r, AddIcon as ce, SelectGroup as Dt, InfoLabel as Hr, DeleteIcon as mt, ContentCopyIcon as Yr, CodeIcon as Gr, Table as Bt, TableBody as Mt, TableRow as Ct, TableCell as Re, Alert as Kr, Icon as it, Card as rr, coolIconKeys as zt, Tabs as Wr, Tab as Nt, ArrowBackIcon as nt, LoadingButton as Rt, DoneIcon as Zr, Menu as Jr, MoreVertIcon as Qr, MenuItem as Xr, SaveIcon as ei, UndoIcon as ti } from "@firecms/ui";
7
7
  import * as at from "yup";
8
8
  import { useFormex as G, Field as $, getIn as I, useCreateFormex as Ot, Formex as Vt } from "@firecms/formex";
9
9
  import { extractEnumFromValues as ri, buildPropertyFromData as ii, buildEntityPropertiesFromData as ni } from "@firecms/schema_inference";
@@ -33,9 +33,9 @@ function bi({
33
33
  errors: s,
34
34
  setFieldTouched: f,
35
35
  isSubmitting: g,
36
- submitCount: P
37
- } = G(), [y, x] = j(!1), [v, b] = j(!1), T = (h) => {
38
- u("name", h), !I(p, "path") && t && h && u("path", xt(h)), !I(p, "id") && t && h && u("id", xt(h)), !I(p, "singularName") && t && h && u("singularName", br(h));
36
+ submitCount: x
37
+ } = G(), [y, P] = j(!1), [v, b] = j(!1), T = (h) => {
38
+ u("name", h), !I(p, "path") && t && h && u("path", Pt(h)), !I(p, "id") && t && h && u("id", Pt(h)), !I(p, "singularName") && t && h && u("singularName", br(h));
39
39
  };
40
40
  ue(() => {
41
41
  s.id && b(!0);
@@ -49,7 +49,7 @@ function bi({
49
49
  }), D = !!o;
50
50
  let _;
51
51
  typeof c.customId == "object" ? _ = "code_defined" : c.customId === !0 ? _ = "true" : c.customId === !1 ? _ = "false" : c.customId === "optional" && (_ = "optional");
52
- const S = P > 0;
52
+ const S = x > 0;
53
53
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
54
54
  /* @__PURE__ */ a("div", { children: [
55
55
  /* @__PURE__ */ a(
@@ -62,14 +62,14 @@ function bi({
62
62
  ae,
63
63
  {
64
64
  shape: "square",
65
- onClick: () => x(!0),
65
+ onClick: () => P(!0),
66
66
  children: w
67
67
  }
68
68
  ) })
69
69
  ]
70
70
  }
71
71
  ),
72
- o && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
72
+ o && /* @__PURE__ */ e(xt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
73
73
  "This is a subcollection of ",
74
74
  /* @__PURE__ */ e("b", { children: o.name })
75
75
  ] }) })
@@ -219,7 +219,7 @@ function bi({
219
219
  Ne,
220
220
  {
221
221
  name: "customId",
222
- label: "Document IDs generation",
222
+ label: "Data IDs generation",
223
223
  position: "item-aligned",
224
224
  disabled: _ === "code_defined",
225
225
  onValueChange: (h) => {
@@ -269,7 +269,7 @@ function bi({
269
269
  Fe,
270
270
  {
271
271
  open: y,
272
- onOpenChange: x,
272
+ onOpenChange: P,
273
273
  maxWidth: "xl",
274
274
  fullWidth: !0,
275
275
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
@@ -277,7 +277,7 @@ function bi({
277
277
  {
278
278
  selectedIcon: c.icon,
279
279
  onIconSelected: (h) => {
280
- x(!1), u("icon", h);
280
+ P(!1), u("icon", h);
281
281
  }
282
282
  }
283
283
  ) })
@@ -315,8 +315,8 @@ function Ci({
315
315
  validateOnChange: !0,
316
316
  validation: (p) => {
317
317
  const s = {};
318
- p.enumValues && p.enumValues.forEach((g, P) => {
319
- g?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[P] = s.enumValues[P] ?? {}, s.enumValues[P].label = "You must specify a label for this enum value entry"), g?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[P] = s.enumValues[P] ?? {}, s.enumValues[P].id = "You must specify an ID for this enum value entry");
318
+ p.enumValues && p.enumValues.forEach((g, x) => {
319
+ g?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].label = "You must specify a label for this enum value entry"), g?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].id = "You must specify an ID for this enum value entry");
320
320
  });
321
321
  const f = !!(s?.enumValues && Object.keys(s?.enumValues).length > 0);
322
322
  return n?.(f), s;
@@ -348,10 +348,10 @@ function Ni({
348
348
  }) {
349
349
  const {
350
350
  setFieldValue: c
351
- } = G(), [u, m] = Y.useState(), [p, s] = Y.useState(), [f, g] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, x = (b, T) => {
351
+ } = G(), [u, m] = Y.useState(), [p, s] = Y.useState(), [f, g] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, T) => {
352
352
  const w = u === T, C = r?.enumValues && r?.enumValues[b];
353
353
  return /* @__PURE__ */ e(
354
- xi,
354
+ Pi,
355
355
  {
356
356
  index: b,
357
357
  disabled: n,
@@ -411,7 +411,7 @@ function Ni({
411
411
  value: t.enumValues,
412
412
  disabled: n,
413
413
  size: "small",
414
- buildEntry: x,
414
+ buildEntry: P,
415
415
  onInternalIdAdded: m,
416
416
  includeAddButton: !0,
417
417
  onValueChange: (b) => c(i, b),
@@ -419,7 +419,7 @@ function Ni({
419
419
  }
420
420
  ),
421
421
  /* @__PURE__ */ e(
422
- Pi,
422
+ xi,
423
423
  {
424
424
  index: p,
425
425
  open: p !== void 0,
@@ -430,7 +430,7 @@ function Ni({
430
430
  ] })
431
431
  ] });
432
432
  }
433
- const xi = Y.memo(
433
+ const Pi = Y.memo(
434
434
  function({
435
435
  index: r,
436
436
  shouldUpdateId: n,
@@ -447,9 +447,9 @@ const xi = Y.memo(
447
447
  errors: s,
448
448
  setFieldValue: f,
449
449
  touched: g
450
- } = G(), P = Y.useRef(!I(m, `${i}[${r}].id`)), y = n || P.current, x = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = Y.useRef(v);
450
+ } = G(), x = Y.useRef(!I(m, `${i}[${r}].id`)), y = n || x.current, P = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = Y.useRef(v);
451
451
  return Y.useEffect(() => {
452
- (b.current === x || !x) && y && f(`${i}[${r}].id`, v), b.current = v;
452
+ (b.current === P || !P) && y && f(`${i}[${r}].id`, v), b.current = v;
453
453
  }, [v]), /* @__PURE__ */ a(R, { children: [
454
454
  /* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
455
455
  /* @__PURE__ */ e(
@@ -500,7 +500,7 @@ const xi = Y.memo(
500
500
  return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && be(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
501
501
  }
502
502
  );
503
- function Pi({
503
+ function xi({
504
504
  index: t,
505
505
  open: r,
506
506
  onClose: n,
@@ -640,7 +640,7 @@ function Se({
640
640
  values: m,
641
641
  handleChange: p,
642
642
  errors: s
643
- } = G(), f = "validation.length", g = "validation.min", P = "validation.max", y = "validation.trim", x = "validation.matches", v = "validation.lowercase", b = "validation.uppercase", T = I(s, x), w = I(m, x), C = typeof w == "string" ? w : Nr(w);
643
+ } = G(), f = "validation.length", g = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", v = "validation.lowercase", b = "validation.uppercase", T = I(s, P), w = I(m, P), C = typeof w == "string" ? w : Nr(w);
644
644
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
645
645
  /* @__PURE__ */ e(Ee, { disabled: c }),
646
646
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -721,9 +721,9 @@ function Se({
721
721
  i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
722
722
  W,
723
723
  {
724
- value: I(m, P),
724
+ value: I(m, x),
725
725
  label: "Max length",
726
- name: P,
726
+ name: x,
727
727
  type: "number",
728
728
  size: "small",
729
729
  disabled: c,
@@ -735,7 +735,7 @@ function Se({
735
735
  /* @__PURE__ */ e(
736
736
  $,
737
737
  {
738
- name: x,
738
+ name: P,
739
739
  as: W,
740
740
  label: "Matches regex",
741
741
  size: "small",
@@ -785,7 +785,7 @@ function It({
785
785
  ) })
786
786
  ] });
787
787
  }
788
- function xe({
788
+ function Pe({
789
789
  children: t
790
790
  }) {
791
791
  return /* @__PURE__ */ e(
@@ -821,7 +821,7 @@ function Ut({
821
821
  values: d,
822
822
  setFieldError: c,
823
823
  setFieldValue: u
824
- } = G(), m = Ie(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Jt(() => !f || typeof f == "boolean" ? [] : xr(f) ?? [], [f]);
824
+ } = G(), m = Ie(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Jt(() => !f || typeof f == "boolean" ? [] : Pr(f) ?? [], [f]);
825
825
  return /* @__PURE__ */ a(R, { children: [
826
826
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
827
827
  Ci,
@@ -833,11 +833,11 @@ function Ut({
833
833
  onError: (y) => {
834
834
  c(p, y ? "This enum property is missing some values" : void 0);
835
835
  },
836
- getData: o ? () => o().then((y) => y.map((x) => d.id && I(x, d.id)).filter(Boolean)) : void 0,
836
+ getData: o ? () => o().then((y) => y.map((P) => d.id && I(P, d.id)).filter(Boolean)) : void 0,
837
837
  onValuesChanged: (y) => {
838
838
  if (d && (u(p, y), !t)) {
839
- const x = y.filter((v) => !!v?.id).map((v) => v.id);
840
- s && !x.includes(s) && (u("defaultValue", void 0), m.open({
839
+ const P = y.filter((v) => !!v?.id).map((v) => v.id);
840
+ s && !P.includes(s) && (u("defaultValue", void 0), m.open({
841
841
  type: "warning",
842
842
  message: "Default value was cleared"
843
843
  }));
@@ -845,7 +845,7 @@ function Ut({
845
845
  }
846
846
  }
847
847
  ) }),
848
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
848
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
849
849
  !t && /* @__PURE__ */ e(
850
850
  Se,
851
851
  {
@@ -892,9 +892,9 @@ function jt({
892
892
  const {
893
893
  values: i,
894
894
  setFieldValue: l
895
- } = G(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, c = `${o}.fileName`, u = `${o}.storagePath`, m = `${o}.storeUrl`, p = I(i, c) ?? "{rand}_{file}", s = I(i, u) ?? "/", f = I(i, d), g = Array.isArray(f) ? f : void 0, P = !g || g.length === 0, y = (b) => {
896
- b ? b.includes("all") || b.length >= Object.keys(ot).length ? l(d, void 0) : P ? l(d, Object.keys(ot).filter((T) => !b.includes(T))) : l(d, b) : l(d, void 0);
897
- }, x = typeof p == "function", v = typeof s == "function";
895
+ } = G(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, c = `${o}.fileName`, u = `${o}.storagePath`, m = `${o}.storeUrl`, p = I(i, c) ?? "{rand}_{file}", s = I(i, u) ?? "/", f = I(i, d), g = Array.isArray(f) ? f : void 0, x = !g || g.length === 0, y = (b) => {
896
+ b ? b.includes("all") || b.length >= Object.keys(ot).length ? l(d, void 0) : x ? l(d, Object.keys(ot).filter((T) => !b.includes(T))) : l(d, b) : l(d, void 0);
897
+ }, P = typeof p == "function", v = typeof s == "function";
898
898
  return /* @__PURE__ */ a(R, { children: [
899
899
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
900
900
  Tt,
@@ -918,7 +918,7 @@ function jt({
918
918
  name: d,
919
919
  value: g ?? [],
920
920
  onMultiValueChange: y,
921
- label: P ? void 0 : "Allowed file types",
921
+ label: x ? void 0 : "Allowed file types",
922
922
  renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((T) => ot[T]).filter((T) => !!T).join(", "),
923
923
  children: [
924
924
  /* @__PURE__ */ a(St, { value: "all", className: "flex items-center gap-2", children: [
@@ -934,7 +934,7 @@ function jt({
934
934
  /* @__PURE__ */ e(
935
935
  At,
936
936
  {
937
- checked: P || g.indexOf(b) > -1
937
+ checked: x || g.indexOf(b) > -1
938
938
  }
939
939
  ),
940
940
  /* @__PURE__ */ e("div", { className: "flex-grow", children: T }),
@@ -958,8 +958,8 @@ function jt({
958
958
  as: W,
959
959
  label: "File name",
960
960
  size: "small",
961
- disabled: x || n,
962
- value: x ? "-" : p
961
+ disabled: P || n,
962
+ value: P ? "-" : p
963
963
  }
964
964
  ) }),
965
965
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
@@ -1007,7 +1007,7 @@ function jt({
1007
1007
  ] })
1008
1008
  }
1009
1009
  ) }),
1010
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1010
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
1011
1011
  !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ee, { disabled: n }) }),
1012
1012
  t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(It, { disabled: n }) })
1013
1013
  ] }) })
@@ -1210,13 +1210,13 @@ const gt = Y.memo(
1210
1210
  inferredPropertyKeys: s,
1211
1211
  collectionEditable: f
1212
1212
  }) {
1213
- const g = o ?? Object.keys(l), P = J((y) => {
1213
+ const g = o ?? Object.keys(l), x = J((y) => {
1214
1214
  if (!y.destination)
1215
1215
  return;
1216
- const x = y.source.index, v = y.destination.index, b = Array.from(g), [T] = b.splice(x, 1);
1216
+ const P = y.source.index, v = y.destination.index, b = Array.from(g), [T] = b.splice(P, 1);
1217
1217
  b.splice(v, 0, T), u && u(b, r);
1218
1218
  }, [r, u, g]);
1219
- return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ai, { onDragEnd: P, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${r}`, children: (y, x) => /* @__PURE__ */ a(
1219
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ai, { onDragEnd: x, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
1220
1220
  "div",
1221
1221
  {
1222
1222
  ...y.droppableProps,
@@ -1278,10 +1278,10 @@ function ki({
1278
1278
  collectionEditable: s
1279
1279
  }) {
1280
1280
  const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = ar(t, r) in d;
1281
- let x;
1281
+ let P;
1282
1282
  if (typeof n == "object") {
1283
1283
  const T = n;
1284
- T.dataType === "map" && T.properties && (x = /* @__PURE__ */ e(
1284
+ T.dataType === "map" && T.properties && (P = /* @__PURE__ */ e(
1285
1285
  gt,
1286
1286
  {
1287
1287
  selectedPropertyKey: o,
@@ -1305,7 +1305,7 @@ function ki({
1305
1305
  ...l.dragHandleProps,
1306
1306
  className: "relative -ml-8",
1307
1307
  children: [
1308
- x && /* @__PURE__ */ e(
1308
+ P && /* @__PURE__ */ e(
1309
1309
  "div",
1310
1310
  {
1311
1311
  className: "absolute border-l " + kt,
@@ -1354,7 +1354,7 @@ function ki({
1354
1354
  }
1355
1355
  ) })
1356
1356
  ] }),
1357
- x && /* @__PURE__ */ e("div", { className: "ml-16", children: x })
1357
+ P && /* @__PURE__ */ e("div", { className: "ml-16", children: P })
1358
1358
  ]
1359
1359
  }
1360
1360
  );
@@ -1363,7 +1363,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1363
1363
  const {
1364
1364
  values: o,
1365
1365
  setFieldValue: d
1366
- } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), P = ({
1366
+ } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
1367
1367
  id: w,
1368
1368
  property: C
1369
1369
  }) => {
@@ -1381,7 +1381,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1381
1381
  throw Error("collection editor miss config");
1382
1382
  const N = he(O), F = Ce(C), D = I(o, F) ?? Object.keys(I(o, nr(C)));
1383
1383
  d(N, void 0, !1), d(F, D.filter((_) => _ !== w), !1), u(!1), p(void 0), f(void 0);
1384
- }, [d, o]), x = m ? ne(m, s) : void 0, v = x ? I(o.properties, x.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, T = J((w, C) => {
1384
+ }, [d, o]), P = m ? ne(m, s) : void 0, v = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, T = J((w, C) => {
1385
1385
  d(Ce(C), w, !1);
1386
1386
  }, []);
1387
1387
  return /* @__PURE__ */ a(R, { children: [
@@ -1461,7 +1461,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1461
1461
  existingProperty: !!m,
1462
1462
  autoUpdateId: !m,
1463
1463
  autoOpenTypeSelect: !m,
1464
- onPropertyChanged: P,
1464
+ onPropertyChanged: x,
1465
1465
  existingPropertyKeys: m ? void 0 : g,
1466
1466
  propertyConfigs: i
1467
1467
  }
@@ -1483,9 +1483,9 @@ function Vi({
1483
1483
  errors: m,
1484
1484
  setFieldValue: p,
1485
1485
  touched: s
1486
- } = G(), [f, g] = j(!1), P = I(c, "of"), y = I(s, "of") && I(m, "of"), x = ({ id: b, property: T, namespace: w }) => {
1486
+ } = G(), [f, g] = j(!1), x = I(c, "of"), y = I(s, "of") && I(m, "of"), P = ({ id: b, property: T, namespace: w }) => {
1487
1487
  console.log("onPropertyChanged", b, T, w), p("of", T);
1488
- }, v = P && Le(P, o);
1488
+ }, v = x && Le(x, o);
1489
1489
  return /* @__PURE__ */ a(R, { children: [
1490
1490
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1491
1491
  /* @__PURE__ */ e(V, { variant: "subtitle2", children: "Repeat component" }),
@@ -1493,12 +1493,12 @@ function Vi({
1493
1493
  $,
1494
1494
  {
1495
1495
  name: "of",
1496
- value: P,
1496
+ value: x,
1497
1497
  children: ({}) => /* @__PURE__ */ a(ge, { className: "p-2 mt-4", children: [
1498
- P && /* @__PURE__ */ e(
1498
+ x && /* @__PURE__ */ e(
1499
1499
  or,
1500
1500
  {
1501
- property: P,
1501
+ property: x,
1502
1502
  onClick: n ? void 0 : () => g(!0),
1503
1503
  includeName: !1,
1504
1504
  includeEditButton: !0,
@@ -1506,7 +1506,7 @@ function Vi({
1506
1506
  hasError: !1
1507
1507
  }
1508
1508
  ),
1509
- !n && !P && /* @__PURE__ */ a(
1509
+ !n && !x && /* @__PURE__ */ a(
1510
1510
  z,
1511
1511
  {
1512
1512
  variant: "text",
@@ -1530,9 +1530,9 @@ function Vi({
1530
1530
  autoOpenTypeSelect: !r,
1531
1531
  onOkClicked: () => g(!1),
1532
1532
  allowDataInference: l,
1533
- property: P,
1533
+ property: x,
1534
1534
  includeIdAndName: !1,
1535
- onPropertyChanged: x,
1535
+ onPropertyChanged: P,
1536
1536
  forceShowErrors: t,
1537
1537
  propertyConfigs: o,
1538
1538
  collectionEditable: d
@@ -1542,7 +1542,7 @@ function Vi({
1542
1542
  }
1543
1543
  )
1544
1544
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(It, { disabled: n }) }) })
1545
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(It, { disabled: n }) }) })
1546
1546
  ] });
1547
1547
  }
1548
1548
  const Ii = Y.forwardRef(
@@ -1560,7 +1560,7 @@ const Ii = Y.forwardRef(
1560
1560
  setFieldTouched: p,
1561
1561
  touched: s,
1562
1562
  validate: f
1563
- } = G(), g = "name", P = r && I(c, g), y = "id", x = r && I(c, y), v = "description", b = r && I(c, v);
1563
+ } = G(), g = "name", x = r && I(c, g), y = "id", P = r && I(c, y), v = "description", b = r && I(c, v);
1564
1564
  return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
1565
1565
  /* @__PURE__ */ a("div", { children: [
1566
1566
  /* @__PURE__ */ e(
@@ -1572,16 +1572,16 @@ const Ii = Y.forwardRef(
1572
1572
  value: u[g],
1573
1573
  onChange: (T) => {
1574
1574
  const w = T.target.value;
1575
- !I(s, y) && l && m(y, w ? xt(w) : "", !1), m(g, w, !0), p(g, !0);
1575
+ !I(s, y) && l && m(y, w ? Pt(w) : "", !1), m(g, w, !0), p(g, !0);
1576
1576
  },
1577
1577
  style: { fontSize: 20 },
1578
1578
  placeholder: "Field name",
1579
1579
  required: !0,
1580
1580
  disabled: i,
1581
- error: !!P
1581
+ error: !!x
1582
1582
  }
1583
1583
  ),
1584
- /* @__PURE__ */ e(X, { error: !!P, children: P })
1584
+ /* @__PURE__ */ e(X, { error: !!x, children: x })
1585
1585
  ] }),
1586
1586
  /* @__PURE__ */ a("div", { children: [
1587
1587
  /* @__PURE__ */ e(
@@ -1598,10 +1598,10 @@ const Ii = Y.forwardRef(
1598
1598
  disabled: n || i,
1599
1599
  required: !0,
1600
1600
  size: "small",
1601
- error: !!x
1601
+ error: !!P
1602
1602
  }
1603
1603
  ),
1604
- /* @__PURE__ */ e(X, { error: !!x, children: x })
1604
+ /* @__PURE__ */ e(X, { error: !!P, children: P })
1605
1605
  ] }),
1606
1606
  /* @__PURE__ */ a("div", { children: [
1607
1607
  /* @__PURE__ */ e(
@@ -1626,7 +1626,7 @@ function _i({
1626
1626
  }) {
1627
1627
  const { values: i, setFieldValue: l } = G();
1628
1628
  return /* @__PURE__ */ a(R, { children: [
1629
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1629
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
1630
1630
  t === "text_field" && /* @__PURE__ */ e(
1631
1631
  Se,
1632
1632
  {
@@ -1695,7 +1695,7 @@ function _i({
1695
1695
  function Fi({ disabled: t }) {
1696
1696
  const { values: r } = G(), n = I(r, "defaultValue");
1697
1697
  return /* @__PURE__ */ a(R, { children: [
1698
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
1698
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
1699
1699
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1700
1700
  $,
1701
1701
  {
@@ -1736,7 +1736,7 @@ function Ei({
1736
1736
  }, !1);
1737
1737
  const C = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), O = C.includes(T) ? C : [...C, T];
1738
1738
  d("oneOf.propertiesOrder", O, !1), u(!1);
1739
- }, P = m ? ne(m, s) : void 0, y = P ? I(o.oneOf?.properties, P.replaceAll(".", ".properties.")) : void 0, x = J((T, w) => {
1739
+ }, x = m ? ne(m, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = J((T, w) => {
1740
1740
  const C = T ? ne(T, w) : void 0;
1741
1741
  if (!C)
1742
1742
  throw Error("collection editor miss config");
@@ -1796,7 +1796,7 @@ function Ei({
1796
1796
  u(!1), p(void 0), f(void 0);
1797
1797
  },
1798
1798
  collectionEditable: l,
1799
- onDelete: x,
1799
+ onDelete: P,
1800
1800
  propertyKey: m,
1801
1801
  propertyNamespace: s,
1802
1802
  property: y,
@@ -1918,7 +1918,7 @@ function Si({ disabled: t }) {
1918
1918
  function Ai({ disabled: t }) {
1919
1919
  const { values: r, setFieldValue: n } = G();
1920
1920
  return /* @__PURE__ */ a(R, { children: [
1921
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Si, { disabled: t }) }) }),
1921
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Si, { disabled: t }) }) }),
1922
1922
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1923
1923
  Oe,
1924
1924
  {
@@ -2115,7 +2115,7 @@ function Bi({ disabled: t }) {
2115
2115
  ),
2116
2116
  /* @__PURE__ */ e(X, { error: !!p, children: p ?? "Update this field automatically when creating or updating the entity" })
2117
2117
  ] }),
2118
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
2118
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
2119
2119
  ] });
2120
2120
  }
2121
2121
  function Mi({ disabled: t }) {
@@ -2150,7 +2150,7 @@ function Mi({ disabled: t }) {
2150
2150
  ] });
2151
2151
  }
2152
2152
  function zi({ disabled: t }) {
2153
- return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
2153
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
2154
2154
  }
2155
2155
  function lr(t, r, n) {
2156
2156
  let i;
@@ -2434,7 +2434,7 @@ function Ri({
2434
2434
  ]
2435
2435
  }
2436
2436
  ) }),
2437
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
2437
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2438
2438
  Se,
2439
2439
  {
2440
2440
  disabled: t,
@@ -2494,9 +2494,9 @@ const Ui = [
2494
2494
  onPropertyChanged: s,
2495
2495
  onPropertyChangedImmediate: f = !0,
2496
2496
  onDelete: g,
2497
- onError: P,
2497
+ onError: x,
2498
2498
  initialErrors: y,
2499
- forceShowErrors: x,
2499
+ forceShowErrors: P,
2500
2500
  allowDataInference: v,
2501
2501
  getController: b,
2502
2502
  getData: T,
@@ -2552,7 +2552,7 @@ const Ui = [
2552
2552
  B && (h.id = B);
2553
2553
  }
2554
2554
  }
2555
- return S.dataType === "string" && S.validation?.matches && !Pr(S.validation?.matches.toString()) && (h.validation = {
2555
+ return S.dataType === "string" && S.validation?.matches && !xr(S.validation?.matches.toString()) && (h.validation = {
2556
2556
  matches: "Invalid regular expression"
2557
2557
  }), S.dataType === "reference" && !S.path && (h.path = "You must specify a target collection for the field"), S.propertyConfig === "repeat" && (S.of || (h.of = "You need to specify a repeat field")), S.propertyConfig === "block" && (S.oneOf || (h.oneOf = "You need to specify the properties of this block")), h;
2558
2558
  }
@@ -2566,8 +2566,8 @@ const Ui = [
2566
2566
  onDelete: g,
2567
2567
  includeIdAndTitle: n,
2568
2568
  propertyNamespace: m,
2569
- onError: P,
2570
- showErrors: x || _.submitCount > 0,
2569
+ onError: x,
2570
+ showErrors: P || _.submitCount > 0,
2571
2571
  existing: l,
2572
2572
  autoUpdateId: o,
2573
2573
  inArray: d,
@@ -2665,12 +2665,12 @@ function ji({
2665
2665
  showErrors: s,
2666
2666
  disabled: f,
2667
2667
  inArray: g,
2668
- getData: P,
2668
+ getData: x,
2669
2669
  allowDataInference: y,
2670
- propertyConfigs: x,
2670
+ propertyConfigs: P,
2671
2671
  collectionEditable: v
2672
2672
  }) {
2673
- const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ? Wt(t) : void 0), F = Object.entries(dr).concat(Object.entries(x)), D = g ? F.filter(([Z, H]) => !ie(H.property) && H.property?.dataType !== "array") : F, _ = Er(t), S = je(null), h = je(t), B = s && I(r, "selectedWidget");
2673
+ const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ? Wt(t) : void 0), F = Object.entries(dr).concat(Object.entries(P)), D = g ? F.filter(([Z, H]) => !ie(H.property) && H.property?.dataType !== "array") : F, _ = Er(t), S = je(null), h = je(t), B = s && I(r, "selectedWidget");
2674
2674
  ue(() => {
2675
2675
  if (c && (!d || _.id)) {
2676
2676
  const {
@@ -2687,7 +2687,7 @@ function ji({
2687
2687
  t?.id && p && p(t?.id, m, r);
2688
2688
  }, [r, p, m, t?.id]);
2689
2689
  const oe = (Z) => {
2690
- N(Z), n(lr(t, Z, x)), setTimeout(() => {
2690
+ N(Z), n(lr(t, Z, P)), setTimeout(() => {
2691
2691
  S.current?.focus();
2692
2692
  }, 0);
2693
2693
  };
@@ -2712,7 +2712,7 @@ function ji({
2712
2712
  allowDataInference: y,
2713
2713
  updateIds: !i,
2714
2714
  disabled: f,
2715
- getData: P,
2715
+ getData: x,
2716
2716
  showErrors: s
2717
2717
  }
2718
2718
  ) : O === "multi_select" || O === "multi_number_select" ? q = /* @__PURE__ */ e(
@@ -2722,7 +2722,7 @@ function ji({
2722
2722
  updateIds: !i,
2723
2723
  disabled: f,
2724
2724
  allowDataInference: y,
2725
- getData: P,
2725
+ getData: x,
2726
2726
  showErrors: s
2727
2727
  }
2728
2728
  ) : O === "file_upload" ? q = /* @__PURE__ */ e(
@@ -2743,19 +2743,19 @@ function ji({
2743
2743
  Oi,
2744
2744
  {
2745
2745
  disabled: f,
2746
- getData: P,
2746
+ getData: x,
2747
2747
  allowDataInference: y,
2748
2748
  collectionEditable: v,
2749
- propertyConfigs: x
2749
+ propertyConfigs: P
2750
2750
  }
2751
2751
  ) : O === "block" ? q = /* @__PURE__ */ e(
2752
2752
  Ei,
2753
2753
  {
2754
2754
  disabled: f,
2755
- getData: P,
2755
+ getData: x,
2756
2756
  allowDataInference: y,
2757
2757
  collectionEditable: v,
2758
- propertyConfigs: x
2758
+ propertyConfigs: P
2759
2759
  }
2760
2760
  ) : O === "reference" ? q = /* @__PURE__ */ e(
2761
2761
  qt,
@@ -2778,11 +2778,11 @@ function ji({
2778
2778
  {
2779
2779
  showErrors: s,
2780
2780
  existing: i,
2781
- getData: P,
2781
+ getData: x,
2782
2782
  allowDataInference: y,
2783
2783
  disabled: f,
2784
2784
  collectionEditable: v,
2785
- propertyConfigs: x
2785
+ propertyConfigs: P
2786
2786
  }
2787
2787
  ) : O === "key_value" ? q = /* @__PURE__ */ e(zi, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
2788
2788
  f && /* @__PURE__ */ a(Hr, { mode: "warn", children: [
@@ -2808,7 +2808,7 @@ function ji({
2808
2808
  renderValue: (Z) => {
2809
2809
  if (!Z)
2810
2810
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
2811
- const H = Z, Q = Kt[H] ?? x[H], se = Q.property, Me = se && !ie(se) ? Le(se, x) : void 0, we = ie(se) || i && se.dataType !== t?.dataType, de = Me ? K(Me, Q) : Q;
2811
+ const H = Z, Q = Kt[H] ?? P[H], se = Q.property, Me = se && !ie(se) ? Le(se, P) : void 0, we = ie(se) || i && se.dataType !== t?.dataType, de = Me ? K(Me, Q) : Q;
2812
2812
  return /* @__PURE__ */ a(
2813
2813
  "div",
2814
2814
  {
@@ -3034,9 +3034,9 @@ function Gi({
3034
3034
  const {
3035
3035
  values: f,
3036
3036
  setFieldValue: g,
3037
- setFieldError: P,
3037
+ setFieldError: x,
3038
3038
  setFieldTouched: y,
3039
- errors: x,
3039
+ errors: P,
3040
3040
  dirty: v
3041
3041
  } = G(), b = Ie(), T = wr(), w = !T, [C, O] = j(), [N, F] = j(), [D, _] = j(), S = N ? ne(N, D) : void 0, h = S ? I(f.properties, S.replaceAll(".", ".properties.")) : void 0, [B, oe] = j(!1), [q, Z] = j(!1), [H, Q] = j(!1), [se, Me] = j([]), we = Y.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
3042
3042
  ue(() => {
@@ -3127,7 +3127,7 @@ function Gi({
3127
3127
  propertyPath: E
3128
3128
  }), E) {
3129
3129
  const M = k && Object.keys(k).length > 0;
3130
- i(A, U, M ? k : void 0), P(he(E), M ? "Property error" : void 0);
3130
+ i(A, U, M ? k : void 0), x(he(E), M ? "Property error" : void 0);
3131
3131
  }
3132
3132
  }, []), Ze = () => {
3133
3133
  O(void 0), F(void 0);
@@ -3155,7 +3155,7 @@ function Gi({
3155
3155
  placeholder: "Collection name",
3156
3156
  size: "small",
3157
3157
  required: !0,
3158
- error: !!x?.name
3158
+ error: !!P?.name
3159
3159
  }
3160
3160
  ),
3161
3161
  Xe && /* @__PURE__ */ a(
@@ -3214,7 +3214,7 @@ function Gi({
3214
3214
  onPropertyMove: Ke,
3215
3215
  onPropertyRemove: r ? ke : void 0,
3216
3216
  collectionEditable: s,
3217
- errors: x
3217
+ errors: P
3218
3218
  }
3219
3219
  ) }),
3220
3220
  /* @__PURE__ */ e(
@@ -3400,9 +3400,9 @@ function Zi({
3400
3400
  getUser: l,
3401
3401
  parentCollectionIds: o
3402
3402
  }) {
3403
- const { entityViews: d } = Ae(), [c, u] = Y.useState(), [m, p] = Y.useState(!1), [s, f] = Y.useState(), [g, P] = Y.useState(), {
3403
+ const { entityViews: d } = Ae(), [c, u] = Y.useState(), [m, p] = Y.useState(!1), [s, f] = Y.useState(), [g, x] = Y.useState(), {
3404
3404
  values: y,
3405
- setFieldValue: x
3405
+ setFieldValue: P
3406
3406
  } = G(), v = t.subcollections ?? [], b = y.entityViews?.filter((C) => typeof C == "string").map((C) => Tr(C, d)).filter(Boolean) ?? [], T = t.entityViews?.filter((C) => typeof C != "string") ?? [], w = b.length + T.length;
3407
3407
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
3408
3408
  /* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-16", children: [
@@ -3415,7 +3415,7 @@ function Zi({
3415
3415
  v && v.length > 0 && /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ e(Mt, { children: v.map((C) => /* @__PURE__ */ a(
3416
3416
  Ct,
3417
3417
  {
3418
- onClick: () => P({
3418
+ onClick: () => x({
3419
3419
  isNewCollection: !1,
3420
3420
  editedCollectionId: C.id
3421
3421
  }),
@@ -3452,7 +3452,7 @@ function Zi({
3452
3452
  z,
3453
3453
  {
3454
3454
  onClick: () => {
3455
- P({
3455
+ x({
3456
3456
  isNewCollection: !0
3457
3457
  });
3458
3458
  },
@@ -3559,7 +3559,7 @@ function Zi({
3559
3559
  {
3560
3560
  open: !!s,
3561
3561
  onAccept: () => {
3562
- x("entityViews", y.entityViews?.filter((C) => C !== s)), f(void 0);
3562
+ P("entityViews", y.entityViews?.filter((C) => C !== s)), f(void 0);
3563
3563
  },
3564
3564
  onCancel: () => f(void 0),
3565
3565
  title: /* @__PURE__ */ e(R, { children: "Remove this view?" }),
@@ -3582,7 +3582,7 @@ function Zi({
3582
3582
  ...g,
3583
3583
  getUser: l,
3584
3584
  handleClose: () => {
3585
- P(void 0);
3585
+ x(void 0);
3586
3586
  }
3587
3587
  }
3588
3588
  ),
@@ -3591,7 +3591,7 @@ function Zi({
3591
3591
  {
3592
3592
  open: m,
3593
3593
  onClose: (C) => {
3594
- C && x("entityViews", [...y.entityViews ?? [], C]), p(!1);
3594
+ C && P("entityViews", [...y.entityViews ?? [], C]), p(!1);
3595
3595
  }
3596
3596
  }
3597
3597
  )
@@ -4029,8 +4029,8 @@ function Ji({
4029
4029
  const [o, d] = j(!1), [c, u] = j();
4030
4030
  ue(() => {
4031
4031
  r && l && (d(!0), r(t).then((g) => {
4032
- const P = g.filter((y) => !(l ?? []).find((x) => x.trim().toLowerCase() === y.trim().toLowerCase()));
4033
- u(P);
4032
+ const x = g.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
4033
+ u(x);
4034
4034
  }).finally(() => d(!1)));
4035
4035
  }, [l, t, r]);
4036
4036
  const {
@@ -4047,7 +4047,7 @@ function Ji({
4047
4047
  children: /* @__PURE__ */ e(V, { variant: "h4", className: "flex-grow", children: "New collection" })
4048
4048
  }
4049
4049
  ),
4050
- n && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4050
+ n && /* @__PURE__ */ e(xt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4051
4051
  "This is a subcollection of ",
4052
4052
  /* @__PURE__ */ e("b", { children: n.name })
4053
4053
  ] }) }),
@@ -4062,8 +4062,8 @@ function Ji({
4062
4062
  ),
4063
4063
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
4064
4064
  o && !c && /* @__PURE__ */ e(Ge, { size: "small" }),
4065
- c?.map((g, P) => /* @__PURE__ */ e(
4066
- Pt,
4065
+ c?.map((g, x) => /* @__PURE__ */ e(
4066
+ xt,
4067
4067
  {
4068
4068
  colorScheme: "cyanLighter",
4069
4069
  onClick: () => {
@@ -4143,7 +4143,7 @@ function Ji({
4143
4143
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
4144
4144
  }
4145
4145
  ),
4146
- /* @__PURE__ */ e(ui, { onDataAdded: (g, P) => i(g, P) })
4146
+ /* @__PURE__ */ e(ui, { onDataAdded: (g, x) => i(g, x) })
4147
4147
  ] }),
4148
4148
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(z, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
4149
4149
  ] }) });
@@ -4182,30 +4182,30 @@ function Qi({
4182
4182
  values: o
4183
4183
  } = G(), [d, c] = j(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = d ? d.id : void 0, p = d || void 0, s = ({
4184
4184
  id: g,
4185
- property: P,
4185
+ property: x,
4186
4186
  previousId: y,
4187
- namespace: x
4187
+ namespace: P
4188
4188
  }) => {
4189
- const v = g ? ne(g, x) : void 0, b = v ? he(v) : void 0, T = (C) => C ? u.current[C] ?? I(o, Ce(C)) : u.current[""], w = (C, O) => {
4189
+ const v = g ? ne(g, P) : void 0, b = v ? he(v) : void 0, T = (C) => C ? u.current[C] ?? I(o, Ce(C)) : u.current[""], w = (C, O) => {
4190
4190
  const N = Ce(O);
4191
4191
  i(N, C, !1), u.current[O ?? ""] = C;
4192
4192
  };
4193
4193
  if (y && y !== g) {
4194
- const C = ne(y, x), O = he(C), F = T(x).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4195
- w(F, x);
4194
+ const C = ne(y, P), O = he(C), F = T(P).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4195
+ w(F, P);
4196
4196
  const D = { ...t.headersMapping };
4197
4197
  Object.keys(D).forEach((_) => {
4198
4198
  D[_] === y && (D[_] = g ?? "");
4199
4199
  }), t.setHeadersMapping(D), i(O, void 0, !1), l(O, !1, !1);
4200
4200
  }
4201
- b && (i(b, P, !1), l(b, !0, !1));
4201
+ b && (i(b, x, !1), l(b, !0, !1));
4202
4202
  }, f = async ({
4203
4203
  id: g,
4204
- importKey: P,
4204
+ importKey: x,
4205
4205
  property: y,
4206
- namespace: x
4206
+ namespace: P
4207
4207
  }) => {
4208
- const v = g ? ne(g, x) : void 0, b = v ? he(v) : void 0, T = t.importData.map((C) => I(C, P)), w = {
4208
+ const v = g ? ne(g, P) : void 0, b = v ? he(v) : void 0, T = t.importData.map((C) => I(C, x)), w = {
4209
4209
  ...ii(T, y, ir),
4210
4210
  editable: !0
4211
4211
  };
@@ -4221,19 +4221,19 @@ function Qi({
4221
4221
  destinationProperties: o.properties,
4222
4222
  buildPropertyView: ({
4223
4223
  property: g,
4224
- propertyKey: P,
4224
+ propertyKey: x,
4225
4225
  importKey: y,
4226
- isIdColumn: x
4227
- }) => x ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
4226
+ isIdColumn: P
4227
+ }) => P ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
4228
4228
  mi,
4229
4229
  {
4230
4230
  property: g,
4231
- propertyKey: P,
4231
+ propertyKey: x,
4232
4232
  onPropertyNameChanged: (v, b) => i(`properties.${v}.name`, b, !1),
4233
4233
  onEditClick: () => {
4234
- !P || !g || c({
4234
+ !x || !g || c({
4235
4235
  ...g,
4236
- id: P,
4236
+ id: x,
4237
4237
  editable: !0
4238
4238
  });
4239
4239
  },
@@ -4246,7 +4246,7 @@ function Qi({
4246
4246
  ...v,
4247
4247
  importKey: y
4248
4248
  }),
4249
- propertyKey: P,
4249
+ propertyKey: x,
4250
4250
  propertyConfigs: r
4251
4251
  }
4252
4252
  )
@@ -4364,7 +4364,8 @@ function en({
4364
4364
  key: c,
4365
4365
  disabled: !1
4366
4366
  })),
4367
- properties: r
4367
+ properties: r,
4368
+ enablePopupIcon: !1
4368
4369
  }
4369
4370
  );
4370
4371
  }
@@ -4441,10 +4442,10 @@ function tn(t) {
4441
4442
  const { propertyConfigs: r } = Ae(), n = Te(), i = _e(), {
4442
4443
  topLevelNavigation: l,
4443
4444
  collections: o
4444
- } = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = Ue.useState(), [g, P] = Ue.useState(!1);
4445
+ } = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = Ue.useState(), [g, x] = Ue.useState(!1);
4445
4446
  if (ue(() => {
4446
4447
  try {
4447
- n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), P(!0));
4448
+ n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), x(!0));
4448
4449
  } catch (b) {
4449
4450
  console.error(b);
4450
4451
  }
@@ -4452,10 +4453,10 @@ function tn(t) {
4452
4453
  throw Error("Internal: Navigation not ready in collection editor");
4453
4454
  const {
4454
4455
  groups: y
4455
- } = l, x = s ? {
4456
+ } = l, P = s ? {
4456
4457
  ...s,
4457
4458
  id: s.id ?? s.path ?? Ft(16)
4458
- } : void 0, v = x ? nn(x, r) : {
4459
+ } : void 0, v = P ? nn(P, r) : {
4459
4460
  id: d?.path ?? Ft(16),
4460
4461
  path: d?.path ?? "",
4461
4462
  name: d?.name ?? "",
@@ -4495,9 +4496,9 @@ function rn({
4495
4496
  pathSuggestions: s,
4496
4497
  getUser: f,
4497
4498
  parentCollection: g,
4498
- getData: P,
4499
+ getData: x,
4499
4500
  existingPaths: y,
4500
- existingIds: x,
4501
+ existingIds: P,
4501
4502
  includeTemplates: v,
4502
4503
  collection: b,
4503
4504
  setCollection: T,
@@ -4587,7 +4588,7 @@ function rn({
4587
4588
  if (h === "properties" && (E = { ...E, ..._.current }), h === "details") {
4588
4589
  const L = Gt(k.path, t, y, k.id);
4589
4590
  L && (E.path = L);
4590
- const ye = an(k.id, t, y, x);
4591
+ const ye = an(k.id, t, y, P);
4591
4592
  ye && (E.id = ye);
4592
4593
  }
4593
4594
  return E;
@@ -4598,7 +4599,7 @@ function rn({
4598
4599
  isSubmitting: ke,
4599
4600
  dirty: Ke,
4600
4601
  submitCount: vt
4601
- } = de, pe = re.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, Ze = Gt(pe, t, y, re.id), Je = !Ze && i ? F.convertIdsToPaths(i) : void 0, Qe = Ze ? void 0 : F.resolveAliasesFrom(We), ze = Qe && P ? () => P(Qe, Je ?? []) : void 0;
4602
+ } = de, pe = re.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, Ze = Gt(pe, t, y, re.id), Je = !Ze && i ? F.convertIdsToPaths(i) : void 0, Qe = Ze ? void 0 : F.resolveAliasesFrom(We), ze = Qe && x ? () => x(Qe, Je ?? []) : void 0;
4602
4603
  ue(() => {
4603
4604
  p(Ke);
4604
4605
  }, [Ke]);
@@ -4688,7 +4689,7 @@ function rn({
4688
4689
  bi,
4689
4690
  {
4690
4691
  existingPaths: y,
4691
- existingIds: x,
4692
+ existingIds: P,
4692
4693
  groups: O,
4693
4694
  parentCollectionIds: i,
4694
4695
  parentCollection: g,
@@ -4904,7 +4905,7 @@ const Gt = (t, r, n, i) => {
4904
4905
  getData: m,
4905
4906
  onAnalyticsEvent: p
4906
4907
  }) {
4907
- const s = Te(), f = vi(), g = Ie(), { propertyConfigs: P } = Ae(), [y, x] = Y.useState(), [v, b] = Y.useState(), T = J(() => ({
4908
+ const s = Te(), f = vi(), g = Ie(), { propertyConfigs: x } = Ae(), [y, P] = Y.useState(), [v, b] = Y.useState(), T = J(() => ({
4908
4909
  createCollections: !0,
4909
4910
  editCollections: !0,
4910
4911
  deleteCollections: !0
@@ -4917,7 +4918,7 @@ const Gt = (t, r, n, i) => {
4917
4918
  console.debug("Edit collection", N, F, D, _), p?.("edit_collection", {
4918
4919
  id: N,
4919
4920
  fullPath: F
4920
- }), x({
4921
+ }), P({
4921
4922
  editedCollectionId: N,
4922
4923
  fullPath: F,
4923
4924
  parentCollectionIds: D,
@@ -4966,7 +4967,7 @@ const Gt = (t, r, n, i) => {
4966
4967
  initialValues: D,
4967
4968
  redirect: _,
4968
4969
  sourceClick: S
4969
- }), x({
4970
+ }), P({
4970
4971
  isNewCollection: !0,
4971
4972
  parentCollectionIds: N,
4972
4973
  parentCollection: F,
@@ -5004,7 +5005,7 @@ const Gt = (t, r, n, i) => {
5004
5005
  const F = s.buildUrlCollectionPath(N.id ?? N.path);
5005
5006
  f(F);
5006
5007
  }
5007
- x(void 0);
5008
+ P(void 0);
5008
5009
  }
5009
5010
  }
5010
5011
  ),
@@ -5072,7 +5073,7 @@ const Gt = (t, r, n, i) => {
5072
5073
  forceShowErrors: !1,
5073
5074
  existingPropertyKeys: [],
5074
5075
  allowDataInference: !0,
5075
- propertyConfigs: P,
5076
+ propertyConfigs: x,
5076
5077
  property: v?.property,
5077
5078
  propertyKey: v?.propertyKey
5078
5079
  }
@@ -5082,14 +5083,14 @@ const Gt = (t, r, n, i) => {
5082
5083
  ) });
5083
5084
  },
5084
5085
  be
5085
- ), Pe = () => Qt(gr);
5086
+ ), xe = () => Qt(gr);
5086
5087
  function ln({
5087
5088
  path: t,
5088
5089
  parentCollectionIds: r,
5089
5090
  collection: n,
5090
5091
  tableController: i
5091
5092
  }) {
5092
- const l = _e(), o = Te(), d = Pe(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5093
+ const l = _e(), o = Te(), d = xe(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5093
5094
  user: l.user,
5094
5095
  collection: n
5095
5096
  }).editCollections : !0;
@@ -5114,7 +5115,7 @@ function sn({
5114
5115
  path: t,
5115
5116
  collection: r
5116
5117
  }) {
5117
- const n = Ie(), i = _e(), l = vr(), o = Pe(), d = o.configPermissions({
5118
+ const n = Ie(), i = _e(), l = vr(), o = xe(), d = o.configPermissions({
5118
5119
  user: i.user,
5119
5120
  collection: r
5120
5121
  }), c = J(() => {
@@ -5175,7 +5176,7 @@ function dn({
5175
5176
  parentCollectionIds: l,
5176
5177
  collection: o
5177
5178
  }) {
5178
- const d = Pe();
5179
+ const d = xe();
5179
5180
  return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
5180
5181
  ae,
5181
5182
  {
@@ -5199,7 +5200,7 @@ function cn({
5199
5200
  parentCollectionIds: r,
5200
5201
  collection: n
5201
5202
  }) {
5202
- const i = _e(), l = Pe(), o = l.configPermissions ? l.configPermissions({
5203
+ const i = _e(), l = xe(), o = l.configPermissions ? l.configPermissions({
5203
5204
  user: i.user,
5204
5205
  collection: n
5205
5206
  }).editCollections : !0;
@@ -5220,7 +5221,7 @@ function cn({
5220
5221
  ) });
5221
5222
  }
5222
5223
  function un() {
5223
- const t = Pe();
5224
+ const t = xe();
5224
5225
  return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
5225
5226
  z,
5226
5227
  {
@@ -5244,7 +5245,7 @@ function pn({
5244
5245
  collection: n,
5245
5246
  tableController: i
5246
5247
  }) {
5247
- const l = _e(), o = Pe(), d = vr(), c = Ie(), u = o.configPermissions ? o.configPermissions({
5248
+ const l = _e(), o = xe(), d = vr(), c = Ie(), u = o.configPermissions ? o.configPermissions({
5248
5249
  user: l.user,
5249
5250
  collection: n
5250
5251
  }).editCollections : !0;
@@ -5310,7 +5311,7 @@ function mn({
5310
5311
  }) {
5311
5312
  if (!r.navigation.topLevelNavigation)
5312
5313
  throw Error("Navigation not ready in FireCMSHomePage");
5313
- const n = _e(), i = Pe(), l = i.configPermissions ? i.configPermissions({
5314
+ const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
5314
5315
  user: n.user
5315
5316
  }).createCollections : !0;
5316
5317
  return /* @__PURE__ */ e(
@@ -5392,7 +5393,7 @@ function hn({}) {
5392
5393
  const t = Te();
5393
5394
  if (!t.topLevelNavigation)
5394
5395
  throw Error("Navigation not ready in FireCMSHomePage");
5395
- const r = _e(), n = Pe(), i = n.configPermissions ? n.configPermissions({
5396
+ const r = _e(), n = xe(), i = n.configPermissions ? n.configPermissions({
5396
5397
  user: r.user
5397
5398
  }).createCollections : !0;
5398
5399
  return !t.initialised || t.collections === void 0 || (t.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
@@ -5430,7 +5431,7 @@ const In = (t, r, n) => {
5430
5431
  return console.debug("Collections after joining:", o), o;
5431
5432
  };
5432
5433
  function _n({ path: t }) {
5433
- const r = Te(), n = fn(t), i = r.getParentCollectionIds(t), l = Pe();
5434
+ const r = Te(), n = fn(t), i = r.getParentCollectionIds(t), l = xe();
5434
5435
  return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
5435
5436
  /* @__PURE__ */ e(Zt, { error: "No collection for path: " + n }),
5436
5437
  /* @__PURE__ */ e(
@@ -5466,7 +5467,7 @@ export {
5466
5467
  Ce as namespaceToPropertiesOrderPath,
5467
5468
  nr as namespaceToPropertiesPath,
5468
5469
  wi as removeNonEditableProperties,
5469
- Pe as useCollectionEditorController,
5470
+ xe as useCollectionEditorController,
5470
5471
  Vn as useCollectionEditorPlugin,
5471
5472
  vr as useCollectionsConfigController
5472
5473
  };