@firecms/collection_editor 3.0.0-alpha.27 → 3.0.0-alpha.28

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 (26) hide show
  1. package/dist/components/collection_editor/CollectionPropertiesEditorForm.d.ts +2 -2
  2. package/dist/components/collection_editor/PropertyEditView.d.ts +2 -2
  3. package/dist/components/collection_editor/PropertySelectItem.d.ts +3 -3
  4. package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +2 -2
  5. package/dist/components/collection_editor/properties/BlockPropertyField.d.ts +2 -2
  6. package/dist/components/collection_editor/properties/MapPropertyField.d.ts +2 -2
  7. package/dist/components/collection_editor/properties/RepeatPropertyField.d.ts +2 -2
  8. package/dist/components/collection_editor/utils/supported_fields.d.ts +1 -1
  9. package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +2 -2
  10. package/dist/index.es.js +475 -460
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/index.umd.js +1 -1
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/config_controller.d.ts +8 -0
  15. package/package.json +4 -4
  16. package/src/ConfigControllerProvider.tsx +19 -0
  17. package/src/components/collection_editor/CollectionPropertiesEditorForm.tsx +2 -2
  18. package/src/components/collection_editor/PropertyEditView.tsx +12 -12
  19. package/src/components/collection_editor/PropertyFieldPreview.tsx +8 -8
  20. package/src/components/collection_editor/PropertySelectItem.tsx +6 -6
  21. package/src/components/collection_editor/import/CollectionEditorImportMapping.tsx +5 -5
  22. package/src/components/collection_editor/properties/BlockPropertyField.tsx +2 -2
  23. package/src/components/collection_editor/properties/MapPropertyField.tsx +2 -2
  24. package/src/components/collection_editor/properties/RepeatPropertyField.tsx +2 -2
  25. package/src/components/collection_editor/utils/update_property_for_widget.ts +23 -23
  26. package/src/types/config_controller.tsx +9 -0
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsxs as n, Fragment as F, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as n, Fragment as I, jsx as e } from "react/jsx-runtime";
2
2
  import * as ve from "react";
3
3
  import U, { useState as Q, useCallback as J, useEffect as pe, useMemo as Ut, useRef as Le, useDeferredValue as ga, useContext as $t } from "react";
4
- import { iconKeys as Lt, debounce as fa, SearchBar as ba, Tooltip as ie, IconButton as me, Icon as rt, coolIconKeys as vt, Typography as O, getIconForView as ot, useAutoComplete as ya, Container as dt, Chip as nt, TextField as ze, cn as _e, DebouncedTextField as Z, Autocomplete as va, AutocompleteItem as wa, ExpandablePanel as kt, SettingsIcon as Ye, Select as Te, SelectItem as ye, BooleanSwitchWithLabel as Kt, Dialog as Me, toSnakeCase as Yt, singular as _a, ListIcon as ka, LoadingButton as wt, CircularProgress as He, AutoAwesomeIcon as pt, Paper as Pe, FormikArrayContainer as xa, DialogContent as Ge, DialogActions as Qe, Button as D, SwitchControl as he, serializeRegExp as Ca, isValidRegExp as Oa, RuleIcon as Pa, useSnackbarController as Ze, resolveEnumValues as Na, FileUploadIcon as Sa, MultiSelect as qa, MultiSelectItem as qt, Checkbox as At, isPropertyBuilder as de, useFireCMSContext as qe, getFieldConfig as Je, ErrorBoundary as Ce, FieldConfigBadge as We, cardMixin as Ht, cardClickableMixin as Gt, cardSelectedMixin as Qt, RemoveCircleIcon as Zt, FunctionsIcon as Aa, defaultBorderMixin as xt, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ne, useNavigationContext as De, SelectGroup as zt, mergeDeep as L, buildProperty as G, getFieldId as Jt, DEFAULT_FIELD_CONFIGS as _t, InfoLabel as Wt, DeleteIcon as st, DeleteConfirmationDialog as lt, useLargeLayout as Va, makePropertiesEditable as Xt, resolveEntityView as ja, Table as Tt, TableBody as Vt, TableRow as gt, TableCell as $e, buildCollection as Ct, unslugify as Ot, Card as ea, useSelectionController as Ea, EntityCollectionTable as Fa, slugify as Ia, useAuthController as Re, CircularProgressCenter as jt, Tabs as Ba, Tab as ft, removeUndefined as Ma, ErrorView as ta, ArrowBackIcon as tt, DoneIcon as Da, SaveIcon as Ra, Menu as Ua, MoreVertIcon as $a, MenuItem as La, Collapse as Ka, sortProperties as Ya, getDefaultPropertiesOrder as Ha } from "@firecms/core";
4
+ import { iconKeys as Lt, debounce as fa, SearchBar as ba, Tooltip as ie, IconButton as me, Icon as rt, coolIconKeys as vt, Typography as P, getIconForView as ot, useAutoComplete as ya, Container as dt, Chip as nt, TextField as ze, cn as _e, DebouncedTextField as Z, Autocomplete as va, AutocompleteItem as wa, ExpandablePanel as kt, SettingsIcon as Ye, Select as Te, SelectItem as ye, BooleanSwitchWithLabel as Kt, Dialog as Me, toSnakeCase as Yt, singular as _a, ListIcon as ka, LoadingButton as wt, CircularProgress as He, AutoAwesomeIcon as pt, Paper as Pe, FormikArrayContainer as xa, DialogContent as Ge, DialogActions as Qe, Button as R, SwitchControl as he, serializeRegExp as Ca, isValidRegExp as Oa, RuleIcon as Pa, useSnackbarController as Ze, resolveEnumValues as Na, FileUploadIcon as Sa, MultiSelect as qa, MultiSelectItem as qt, Checkbox as At, isPropertyBuilder as de, useFireCMSContext as qe, getFieldConfig as Je, ErrorBoundary as Ce, FieldConfigBadge as We, cardMixin as Ht, cardClickableMixin as Gt, cardSelectedMixin as Qt, RemoveCircleIcon as Zt, FunctionsIcon as Aa, defaultBorderMixin as xt, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ne, useNavigationContext as De, SelectGroup as zt, mergeDeep as L, buildProperty as G, getFieldId as Jt, DEFAULT_FIELD_CONFIGS as _t, InfoLabel as Wt, DeleteIcon as st, DeleteConfirmationDialog as lt, useLargeLayout as Va, makePropertiesEditable as Xt, resolveEntityView as ja, Table as Tt, TableBody as Vt, TableRow as gt, TableCell as $e, buildCollection as Ct, unslugify as Ot, Card as ea, useSelectionController as Ea, EntityCollectionTable as Fa, slugify as Ia, useAuthController as Re, CircularProgressCenter as jt, Tabs as Ba, Tab as ft, removeUndefined as Ma, ErrorView as ta, ArrowBackIcon as tt, DoneIcon as Da, SaveIcon as Ra, Menu as Ua, MoreVertIcon as $a, MenuItem as La, Collapse as Ka, sortProperties as Ya, getDefaultPropertiesOrder as Ha } from "@firecms/core";
5
5
  import ct from "react-fast-compare";
6
- import { useFormikContext as K, Field as ge, getIn as N, Formik as Pt, FastField as le, Form as Ga } from "formik";
6
+ import { useFormikContext as K, Field as ge, getIn as S, Formik as Pt, FastField as le, Form as Ga } from "formik";
7
7
  import * as bt from "yup";
8
8
  import * as Qa from "js-search";
9
9
  import { extractEnumFromValues as Za, buildPropertyFromData as Ja, buildEntityPropertiesFromData as Wa } from "@firecms/schema_inference";
@@ -1987,7 +1987,7 @@ function mi({ selectedIcon: t = "", onIconSelected: a }) {
1987
1987
  );
1988
1988
  return ve.useEffect(() => (p(o), () => {
1989
1989
  p.clear();
1990
- }), [o, p]), /* @__PURE__ */ n(F, { children: [
1990
+ }), [o, p]), /* @__PURE__ */ n(I, { children: [
1991
1991
  /* @__PURE__ */ e(
1992
1992
  ba,
1993
1993
  {
@@ -2013,7 +2013,7 @@ function ee({
2013
2013
  error: t,
2014
2014
  children: a
2015
2015
  }) {
2016
- return a ? /* @__PURE__ */ e(O, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2016
+ return a ? /* @__PURE__ */ e(P, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2017
2017
  }
2018
2018
  function ui({
2019
2019
  isNewCollection: t,
@@ -2031,24 +2031,24 @@ function ui({
2031
2031
  errors: l,
2032
2032
  setFieldTouched: g,
2033
2033
  isSubmitting: y,
2034
- submitCount: f
2035
- } = K(), [k, C] = Q(!1), x = (P) => {
2036
- m("name", P), !N(d, "path") && t && P && m("path", Yt(P)), !N(d, "singularName") && t && P && m("singularName", _a(P));
2037
- }, h = ot(c), v = J((P) => {
2038
- let S;
2039
- return P || (S = "You must specify a path in the database for this collection"), t && r?.includes(P.trim().toLowerCase()) && (S = "There is already a collection which uses this path as an alias"), t && i?.includes(P.trim().toLowerCase()) && !c.alias && (S = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), S;
2040
- }, [t, r, i, c.alias]), b = J((P) => {
2041
- if (!P)
2034
+ submitCount: b
2035
+ } = K(), [k, C] = Q(!1), x = (N) => {
2036
+ m("name", N), !S(d, "path") && t && N && m("path", Yt(N)), !S(d, "singularName") && t && N && m("singularName", _a(N));
2037
+ }, h = ot(c), v = J((N) => {
2038
+ let O;
2039
+ return N || (O = "You must specify a path in the database for this collection"), t && r?.includes(N.trim().toLowerCase()) && (O = "There is already a collection which uses this path as an alias"), t && i?.includes(N.trim().toLowerCase()) && !c.alias && (O = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), O;
2040
+ }, [t, r, i, c.alias]), f = J((N) => {
2041
+ if (!N)
2042
2042
  return;
2043
- let S;
2044
- return t && i?.includes(P.trim().toLowerCase()) && (S = "There is already a collection that uses this value as a path"), t && r?.includes(P.trim().toLowerCase()) && (S = "There is already a collection which uses this alias"), S;
2045
- }, [t, i, r]), _ = o?.filter((P) => !a?.includes(P)), {
2043
+ let O;
2044
+ return t && i?.includes(N.trim().toLowerCase()) && (O = "There is already a collection that uses this value as a path"), t && r?.includes(N.trim().toLowerCase()) && (O = "There is already a collection which uses this alias"), O;
2045
+ }, [t, i, r]), _ = o?.filter((N) => !a?.includes(N)), {
2046
2046
  inputFocused: T,
2047
- autoCompleteOpen: I,
2047
+ autoCompleteOpen: B,
2048
2048
  setAutoCompleteOpen: w
2049
2049
  } = ya({
2050
2050
  ref: p
2051
- }), V = !!s;
2051
+ }), j = !!s;
2052
2052
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(dt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
2053
2053
  /* @__PURE__ */ n("div", { children: [
2054
2054
  /* @__PURE__ */ n(
@@ -2056,7 +2056,7 @@ function ui({
2056
2056
  {
2057
2057
  className: "flex flex-row py-2 pt-3 items-center",
2058
2058
  children: [
2059
- /* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${c.name} collection` }),
2059
+ /* @__PURE__ */ e(P, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${c.name} collection` }),
2060
2060
  /* @__PURE__ */ e(ie, { title: "Change icon", children: /* @__PURE__ */ e(
2061
2061
  me,
2062
2062
  {
@@ -2068,7 +2068,7 @@ function ui({
2068
2068
  ]
2069
2069
  }
2070
2070
  ),
2071
- s && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(O, { variant: "caption", children: [
2071
+ s && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
2072
2072
  "This is a subcollection of ",
2073
2073
  /* @__PURE__ */ e("b", { children: s.name })
2074
2074
  ] }) })
@@ -2079,7 +2079,7 @@ function ui({
2079
2079
  ze,
2080
2080
  {
2081
2081
  value: c.name ?? "",
2082
- onChange: (P) => x(P.target.value),
2082
+ onChange: (N) => x(N.target.value),
2083
2083
  label: "Name",
2084
2084
  required: !0,
2085
2085
  error: d.name && !!l.name
@@ -2087,7 +2087,7 @@ function ui({
2087
2087
  ),
2088
2088
  /* @__PURE__ */ e(ee, { error: d.name && !!l.name, children: d.name && l.name ? l.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2089
2089
  ] }),
2090
- /* @__PURE__ */ n("div", { className: _e("col-span-12 ", V ? "" : "sm:col-span-8"), children: [
2090
+ /* @__PURE__ */ n("div", { className: _e("col-span-12 ", j ? "" : "sm:col-span-8"), children: [
2091
2091
  /* @__PURE__ */ e(
2092
2092
  ge,
2093
2093
  {
@@ -2102,7 +2102,7 @@ function ui({
2102
2102
  ),
2103
2103
  /* @__PURE__ */ e(ee, { error: d.path && !!l.path, children: d.path && l.path ? l.path : "Path that this collection is stored in" })
2104
2104
  ] }),
2105
- !V && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2105
+ !j && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2106
2106
  /* @__PURE__ */ e(
2107
2107
  ze,
2108
2108
  {
@@ -2110,7 +2110,7 @@ function ui({
2110
2110
  disabled: y,
2111
2111
  value: c.group ?? "",
2112
2112
  autoComplete: "off",
2113
- onChange: (P) => m("group", P.target.value),
2113
+ onChange: (N) => m("group", N.target.value),
2114
2114
  name: "group",
2115
2115
  inputRef: p,
2116
2116
  label: "Group"
@@ -2119,17 +2119,17 @@ function ui({
2119
2119
  /* @__PURE__ */ e(
2120
2120
  va,
2121
2121
  {
2122
- open: I && (_ ?? []).length > 0,
2122
+ open: B && (_ ?? []).length > 0,
2123
2123
  setOpen: w,
2124
- children: _?.map((P, S) => /* @__PURE__ */ e(
2124
+ children: _?.map((N, O) => /* @__PURE__ */ e(
2125
2125
  wa,
2126
2126
  {
2127
2127
  onClick: () => {
2128
- w(!1), m("group", P ?? null);
2128
+ w(!1), m("group", N ?? null);
2129
2129
  },
2130
- children: /* @__PURE__ */ e("div", { className: "flex-grow", children: P })
2130
+ children: /* @__PURE__ */ e("div", { className: "flex-grow", children: N })
2131
2131
  },
2132
- S + "_" + P
2132
+ O + "_" + N
2133
2133
  ))
2134
2134
  }
2135
2135
  ),
@@ -2141,7 +2141,7 @@ function ui({
2141
2141
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2142
2142
  /* @__PURE__ */ e(Ye, {}),
2143
2143
  /* @__PURE__ */ e(
2144
- O,
2144
+ P,
2145
2145
  {
2146
2146
  variant: "subtitle2",
2147
2147
  className: "ml-2",
@@ -2158,7 +2158,7 @@ function ui({
2158
2158
  error: d.singularName && !!l.singularName,
2159
2159
  id: "singularName",
2160
2160
  "aria-describedby": "singularName-helper",
2161
- onChange: (P) => (g("singularName", !0), u(P)),
2161
+ onChange: (N) => (g("singularName", !0), u(N)),
2162
2162
  value: c.singularName ?? "",
2163
2163
  label: "Singular name"
2164
2164
  }
@@ -2189,7 +2189,7 @@ function ui({
2189
2189
  as: Z,
2190
2190
  disabled: !t,
2191
2191
  label: "Alias",
2192
- validate: b,
2192
+ validate: f,
2193
2193
  error: d.alias && !!l.alias
2194
2194
  }
2195
2195
  ),
@@ -2203,14 +2203,14 @@ function ui({
2203
2203
  position: "item-aligned",
2204
2204
  onChange: u,
2205
2205
  value: c.defaultSize ?? "",
2206
- renderValue: (P) => P.toUpperCase(),
2207
- children: ["xs", "s", "m", "l", "xl"].map((P) => /* @__PURE__ */ e(
2206
+ renderValue: (N) => N.toUpperCase(),
2207
+ children: ["xs", "s", "m", "l", "xl"].map((N) => /* @__PURE__ */ e(
2208
2208
  ye,
2209
2209
  {
2210
- value: P,
2211
- children: P.toUpperCase()
2210
+ value: N,
2211
+ children: N.toUpperCase()
2212
2212
  },
2213
- `size-select-${P}`
2213
+ `size-select-${N}`
2214
2214
  ))
2215
2215
  }
2216
2216
  ) }),
@@ -2220,7 +2220,7 @@ function ui({
2220
2220
  {
2221
2221
  position: "start",
2222
2222
  label: "Collection group",
2223
- onValueChange: (P) => m("collectionGroup", P),
2223
+ onValueChange: (N) => m("collectionGroup", N),
2224
2224
  value: c.collectionGroup ?? !1
2225
2225
  }
2226
2226
  ),
@@ -2242,8 +2242,8 @@ function ui({
2242
2242
  mi,
2243
2243
  {
2244
2244
  selectedIcon: c.icon,
2245
- onIconSelected: (P) => {
2246
- C(!1), m("icon", P);
2245
+ onIconSelected: (N) => {
2246
+ C(!1), m("icon", N);
2247
2247
  }
2248
2248
  }
2249
2249
  ) })
@@ -2318,15 +2318,15 @@ function fi({
2318
2318
  const {
2319
2319
  setFieldValue: c
2320
2320
  } = K(), [m, u] = U.useState(), [d, l] = U.useState(), [g, y] = U.useState(!1), k = U.useRef(/* @__PURE__ */ new Set()).current, C = (h, v) => {
2321
- const b = m === v;
2321
+ const f = m === v;
2322
2322
  return /* @__PURE__ */ e(
2323
2323
  bi,
2324
2324
  {
2325
2325
  index: h,
2326
2326
  disabled: i,
2327
2327
  enumValuesPath: r,
2328
- autoFocus: b,
2329
- shouldUpdateId: o || b,
2328
+ autoFocus: f,
2329
+ shouldUpdateId: o || f,
2330
2330
  onDialogOpen: () => l(h),
2331
2331
  inferredEntry: k.has(t.enumValues[h]?.id)
2332
2332
  },
@@ -2337,7 +2337,7 @@ function fi({
2337
2337
  /* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
2338
2338
  /* @__PURE__ */ e(ka, {}),
2339
2339
  /* @__PURE__ */ e(
2340
- O,
2340
+ P,
2341
2341
  {
2342
2342
  variant: "subtitle2",
2343
2343
  className: "ml-2 grow",
@@ -2355,10 +2355,10 @@ function fi({
2355
2355
  y(!0), p?.().then((h) => {
2356
2356
  if (!h)
2357
2357
  return;
2358
- const v = h.flat(), b = Array.from(new Set(v)), _ = t.enumValues, I = Za(b).filter((w) => !_?.some((V) => V.id === w.id));
2359
- I.forEach((w) => {
2358
+ const v = h.flat(), f = Array.from(new Set(v)), _ = t.enumValues, B = Za(f).filter((w) => !_?.some((j) => j.id === w.id));
2359
+ B.forEach((w) => {
2360
2360
  k.add(w.id);
2361
- }), c(r, [...I, ..._]);
2361
+ }), c(r, [...B, ..._]);
2362
2362
  }).catch((h) => {
2363
2363
  console.error(h);
2364
2364
  }).finally(() => y(!1));
@@ -2413,9 +2413,9 @@ const bi = U.memo(
2413
2413
  errors: d,
2414
2414
  setFieldValue: l,
2415
2415
  touched: g
2416
- } = K(), y = U.useRef(!N(m, `${r}[${a}].id`)), f = i || y.current, k = N(m, `${r}[${a}].id`), C = N(m, `${r}[${a}].label`), x = N(d, `${r}[${a}].label`), h = U.useRef(C);
2416
+ } = K(), y = U.useRef(!S(m, `${r}[${a}].id`)), b = i || y.current, k = S(m, `${r}[${a}].id`), C = S(m, `${r}[${a}].label`), x = S(d, `${r}[${a}].label`), h = U.useRef(C);
2417
2417
  return U.useEffect(() => {
2418
- (h.current === k || !k) && f && l(`${r}[${a}].id`, C), h.current = C;
2418
+ (h.current === k || !k) && b && l(`${r}[${a}].id`, C), h.current = C;
2419
2419
  }, [C]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2420
2420
  /* @__PURE__ */ e(
2421
2421
  le,
@@ -2461,7 +2461,7 @@ function yi({
2461
2461
  errors: p,
2462
2462
  setFieldValue: c,
2463
2463
  touched: m
2464
- } = K(), u = t !== void 0 ? N(p, `${r}[${t}].id`) : void 0;
2464
+ } = K(), u = t !== void 0 ? S(p, `${r}[${t}].id`) : void 0;
2465
2465
  return /* @__PURE__ */ n(
2466
2466
  Me,
2467
2467
  {
@@ -2487,7 +2487,7 @@ function yi({
2487
2487
  /* @__PURE__ */ e(ee, { error: !!u, children: u ?? "Value saved in the data source" })
2488
2488
  ] }) }),
2489
2489
  /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(
2490
- D,
2490
+ R,
2491
2491
  {
2492
2492
  autoFocus: !0,
2493
2493
  variant: "outlined",
@@ -2510,7 +2510,7 @@ function wi(t) {
2510
2510
  }
2511
2511
  function je({ disabled: t }) {
2512
2512
  const { values: a, handleChange: i } = K(), r = "validation.required", o = "validation.requiredMessage";
2513
- return /* @__PURE__ */ n(F, { children: [
2513
+ return /* @__PURE__ */ n(I, { children: [
2514
2514
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2515
2515
  le,
2516
2516
  {
@@ -2533,11 +2533,11 @@ function je({ disabled: t }) {
2533
2533
  component: he
2534
2534
  }
2535
2535
  ) }),
2536
- N(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2536
+ S(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2537
2537
  Z,
2538
2538
  {
2539
2539
  disabled: t,
2540
- value: N(a, o),
2540
+ value: S(a, o),
2541
2541
  label: "Required message",
2542
2542
  name: o,
2543
2543
  size: "small",
@@ -2561,7 +2561,7 @@ function Be({
2561
2561
  values: u,
2562
2562
  handleChange: d,
2563
2563
  errors: l
2564
- } = K(), g = "validation.length", y = "validation.min", f = "validation.max", k = "validation.trim", C = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", v = N(l, C), b = N(u, C), _ = typeof b == "string" ? b : Ca(b);
2564
+ } = K(), g = "validation.length", y = "validation.min", b = "validation.max", k = "validation.trim", C = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", v = S(l, C), f = S(u, C), _ = typeof f == "string" ? f : Ca(f);
2565
2565
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2566
2566
  /* @__PURE__ */ e(je, { disabled: c }),
2567
2567
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -2600,7 +2600,7 @@ function Be({
2600
2600
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2601
2601
  Z,
2602
2602
  {
2603
- value: N(u, g),
2603
+ value: S(u, g),
2604
2604
  label: "Exact length",
2605
2605
  name: g,
2606
2606
  type: "number",
@@ -2612,7 +2612,7 @@ function Be({
2612
2612
  o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2613
2613
  Z,
2614
2614
  {
2615
- value: N(u, y),
2615
+ value: S(u, y),
2616
2616
  label: "Min length",
2617
2617
  name: y,
2618
2618
  type: "number",
@@ -2624,9 +2624,9 @@ function Be({
2624
2624
  r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2625
2625
  Z,
2626
2626
  {
2627
- value: N(u, f),
2627
+ value: S(u, b),
2628
2628
  label: "Max length",
2629
- name: f,
2629
+ name: b,
2630
2630
  type: "number",
2631
2631
  size: "small",
2632
2632
  disabled: c,
@@ -2666,7 +2666,7 @@ function St({
2666
2666
  a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2667
2667
  Z,
2668
2668
  {
2669
- value: N(r, s),
2669
+ value: S(r, s),
2670
2670
  disabled: i,
2671
2671
  label: "Min length",
2672
2672
  name: s,
@@ -2678,7 +2678,7 @@ function St({
2678
2678
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2679
2679
  Z,
2680
2680
  {
2681
- value: N(r, p),
2681
+ value: S(r, p),
2682
2682
  disabled: i,
2683
2683
  label: "Max length",
2684
2684
  name: p,
@@ -2701,7 +2701,7 @@ function Ae({
2701
2701
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2702
2702
  /* @__PURE__ */ e(Pa, {}),
2703
2703
  /* @__PURE__ */ e(
2704
- O,
2704
+ P,
2705
2705
  {
2706
2706
  variant: "subtitle2",
2707
2707
  className: "ml-2",
@@ -2728,8 +2728,8 @@ function Et({
2728
2728
  touched: u,
2729
2729
  setFieldError: d,
2730
2730
  setFieldValue: l
2731
- } = K(), g = Ze(), y = t ? "of.enumValues" : "enumValues", f = N(p, "defaultValue"), k = N(p, y), C = Ut(() => !k || typeof k == "boolean" ? [] : Na(k) ?? [], [k]);
2732
- return /* @__PURE__ */ n(F, { children: [
2731
+ } = K(), g = Ze(), y = t ? "of.enumValues" : "enumValues", b = S(p, "defaultValue"), k = S(p, y), C = Ut(() => !k || typeof k == "boolean" ? [] : Na(k) ?? [], [k]);
2732
+ return /* @__PURE__ */ n(I, { children: [
2733
2733
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2734
2734
  gi,
2735
2735
  {
@@ -2740,11 +2740,11 @@ function Et({
2740
2740
  onError: (h) => {
2741
2741
  d(y, h ? "" : void 0);
2742
2742
  },
2743
- getData: s ? () => s().then((h) => h.map((v) => p.id && N(v, p.id)).filter(Boolean)) : void 0,
2743
+ getData: s ? () => s().then((h) => h.map((v) => p.id && S(v, p.id)).filter(Boolean)) : void 0,
2744
2744
  onValuesChanged: (h) => {
2745
2745
  if (p && (l(y, h), !t)) {
2746
- const v = h.filter((b) => !!b?.id).map((b) => b.id);
2747
- f && !v.includes(f) && (l("defaultValue", void 0), g.open({
2746
+ const v = h.filter((f) => !!f?.id).map((f) => f.id);
2747
+ b && !v.includes(b) && (l("defaultValue", void 0), g.open({
2748
2748
  type: "warning",
2749
2749
  message: "Default value was cleared"
2750
2750
  }));
@@ -2771,7 +2771,7 @@ function Et({
2771
2771
  l("defaultValue", h);
2772
2772
  },
2773
2773
  label: "Default value",
2774
- value: f ?? "",
2774
+ value: b ?? "",
2775
2775
  children: C.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
2776
2776
  ye,
2777
2777
  {
@@ -2799,17 +2799,17 @@ function Ft({
2799
2799
  const {
2800
2800
  values: r,
2801
2801
  setFieldValue: o
2802
- } = K(), s = t ? "of.storage" : "storage", p = `${s}.acceptedFiles`, c = `${s}.fileName`, m = `${s}.storagePath`, u = `${s}.storeUrl`, d = N(r, c) ?? "{rand}_{file}", l = N(r, m) ?? "/", g = N(r, p), y = Array.isArray(g) ? g : void 0, f = !y || y.length === 0, k = (h) => {
2803
- h ? h.includes("all") || h.length >= Object.keys(at).length ? o(p, void 0) : f ? o(p, Object.keys(at).filter((v) => !h.includes(v))) : o(p, h) : o(p, void 0);
2802
+ } = K(), s = t ? "of.storage" : "storage", p = `${s}.acceptedFiles`, c = `${s}.fileName`, m = `${s}.storagePath`, u = `${s}.storeUrl`, d = S(r, c) ?? "{rand}_{file}", l = S(r, m) ?? "/", g = S(r, p), y = Array.isArray(g) ? g : void 0, b = !y || y.length === 0, k = (h) => {
2803
+ h ? h.includes("all") || h.length >= Object.keys(at).length ? o(p, void 0) : b ? o(p, Object.keys(at).filter((v) => !h.includes(v))) : o(p, h) : o(p, void 0);
2804
2804
  }, C = typeof d == "function", x = typeof l == "function";
2805
- return /* @__PURE__ */ n(F, { children: [
2805
+ return /* @__PURE__ */ n(I, { children: [
2806
2806
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2807
2807
  kt,
2808
2808
  {
2809
2809
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2810
2810
  /* @__PURE__ */ e(Sa, {}),
2811
2811
  /* @__PURE__ */ e(
2812
- O,
2812
+ P,
2813
2813
  {
2814
2814
  variant: "subtitle2",
2815
2815
  className: "ml-2",
@@ -2825,7 +2825,7 @@ function Ft({
2825
2825
  name: p,
2826
2826
  value: y ?? [],
2827
2827
  onMultiValueChange: k,
2828
- label: f ? void 0 : "Allowed file types",
2828
+ label: b ? void 0 : "Allowed file types",
2829
2829
  renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((v) => at[v]).filter((v) => !!v).join(", "),
2830
2830
  children: [
2831
2831
  /* @__PURE__ */ n(qt, { value: "all", className: "flex items-center gap-2", children: [
@@ -2841,16 +2841,16 @@ function Ft({
2841
2841
  /* @__PURE__ */ e(
2842
2842
  At,
2843
2843
  {
2844
- checked: f || y.indexOf(h) > -1
2844
+ checked: b || y.indexOf(h) > -1
2845
2845
  }
2846
2846
  ),
2847
2847
  /* @__PURE__ */ e("div", { className: "flex-grow", children: v }),
2848
2848
  /* @__PURE__ */ e(
2849
- D,
2849
+ R,
2850
2850
  {
2851
2851
  size: "small",
2852
2852
  variant: "outlined",
2853
- onClick: (b) => (b.preventDefault(), b.stopPropagation(), o(p, [h])),
2853
+ onClick: (f) => (f.preventDefault(), f.stopPropagation(), o(p, [h])),
2854
2854
  children: "Only"
2855
2855
  }
2856
2856
  )
@@ -2881,7 +2881,7 @@ function Ft({
2881
2881
  value: x ? "-" : l
2882
2882
  }
2883
2883
  ),
2884
- /* @__PURE__ */ n(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2884
+ /* @__PURE__ */ n(P, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
2885
2885
  /* @__PURE__ */ e("p", { children: "You can use the following placeholders in the file name and storage path values:" }),
2886
2886
  /* @__PURE__ */ n("ul", { children: [
2887
2887
  /* @__PURE__ */ e("li", { children: "{file} - Full name of the uploaded file" }),
@@ -2904,7 +2904,7 @@ function Ft({
2904
2904
  }
2905
2905
  ),
2906
2906
  /* @__PURE__ */ e("br", {}),
2907
- /* @__PURE__ */ e(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." })
2907
+ /* @__PURE__ */ e(P, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." })
2908
2908
  ] })
2909
2909
  ] })
2910
2910
  }
@@ -2950,7 +2950,7 @@ function ra({
2950
2950
  onClick: a,
2951
2951
  className: "flex flex-row w-full cursor-pointer",
2952
2952
  children: [
2953
- /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(We, { fieldConfig: c }) }),
2953
+ /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(We, { propertyConfig: c }) }),
2954
2954
  /* @__PURE__ */ n(
2955
2955
  Pe,
2956
2956
  {
@@ -2965,7 +2965,7 @@ function ra({
2965
2965
  children: [
2966
2966
  /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
2967
2967
  r && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2968
- O,
2968
+ P,
2969
2969
  {
2970
2970
  variant: "body1",
2971
2971
  component: "span",
@@ -2975,7 +2975,7 @@ function ra({
2975
2975
  ) }),
2976
2976
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
2977
2977
  /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2978
- O,
2978
+ P,
2979
2979
  {
2980
2980
  className: "flex-grow pr-2",
2981
2981
  variant: r ? "body2" : "subtitle1",
@@ -2985,7 +2985,7 @@ function ra({
2985
2985
  }
2986
2986
  ) }),
2987
2987
  /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2988
- O,
2988
+ P,
2989
2989
  {
2990
2990
  variant: "body2",
2991
2991
  component: "span",
@@ -3002,7 +3002,7 @@ function ra({
3002
3002
  )
3003
3003
  ] })
3004
3004
  ] }),
3005
- o && /* @__PURE__ */ e(O, { variant: "button", children: "EDIT" })
3005
+ o && /* @__PURE__ */ e(P, { variant: "button", children: "EDIT" })
3006
3006
  ]
3007
3007
  }
3008
3008
  )
@@ -3024,7 +3024,7 @@ function ki({
3024
3024
  className: "flex flex-row w-full cursor-pointer",
3025
3025
  children: [
3026
3026
  /* @__PURE__ */ n("div", { className: "relative m-4", children: [
3027
- s && /* @__PURE__ */ e(We, { fieldConfig: s }),
3027
+ s && /* @__PURE__ */ e(We, { propertyConfig: s }),
3028
3028
  !s && /* @__PURE__ */ e(
3029
3029
  "div",
3030
3030
  {
@@ -3047,7 +3047,7 @@ function ki({
3047
3047
  ),
3048
3048
  children: /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
3049
3049
  /* @__PURE__ */ e(
3050
- O,
3050
+ P,
3051
3051
  {
3052
3052
  variant: "body1",
3053
3053
  component: "span",
@@ -3057,7 +3057,7 @@ function ki({
3057
3057
  ),
3058
3058
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
3059
3059
  s && /* @__PURE__ */ e(
3060
- O,
3060
+ P,
3061
3061
  {
3062
3062
  className: "flex-grow pr-2",
3063
3063
  variant: "body2",
@@ -3067,7 +3067,7 @@ function ki({
3067
3067
  }
3068
3068
  ),
3069
3069
  r && !de(r) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3070
- O,
3070
+ P,
3071
3071
  {
3072
3072
  variant: "body2",
3073
3073
  component: "span",
@@ -3076,7 +3076,7 @@ function ki({
3076
3076
  }
3077
3077
  ) }),
3078
3078
  r && de(r) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3079
- O,
3079
+ P,
3080
3080
  {
3081
3081
  variant: "body2",
3082
3082
  component: "span",
@@ -3085,7 +3085,7 @@ function ki({
3085
3085
  }
3086
3086
  ) }),
3087
3087
  !r && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3088
- O,
3088
+ P,
3089
3089
  {
3090
3090
  variant: "body2",
3091
3091
  component: "span",
@@ -3117,10 +3117,10 @@ function mt({
3117
3117
  const l = o ?? Object.keys(r), g = J((y) => {
3118
3118
  if (!y.destination)
3119
3119
  return;
3120
- const f = y.source.index, k = y.destination.index, C = Array.from(l), [x] = C.splice(f, 1);
3120
+ const b = y.source.index, k = y.destination.index, C = Array.from(l), [x] = C.splice(b, 1);
3121
3121
  C.splice(k, 0, x), c && c(C, t);
3122
3122
  }, [t, c, l]);
3123
- return /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Xa, { onDragEnd: g, children: /* @__PURE__ */ e(ei, { droppableId: `droppable_${t}`, children: (y, f) => /* @__PURE__ */ n(
3123
+ return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(Xa, { onDragEnd: g, children: /* @__PURE__ */ e(ei, { droppableId: `droppable_${t}`, children: (y, b) => /* @__PURE__ */ n(
3124
3124
  "div",
3125
3125
  {
3126
3126
  ...y.droppableProps,
@@ -3134,7 +3134,7 @@ function mt({
3134
3134
  {
3135
3135
  draggableId: `array_field_${t}_${k}}`,
3136
3136
  index: C,
3137
- children: (v, b) => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3137
+ children: (v, f) => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3138
3138
  xi,
3139
3139
  {
3140
3140
  propertyKey: k,
@@ -3146,7 +3146,7 @@ function mt({
3146
3146
  inferredPropertyKeys: d,
3147
3147
  onPropertyMove: c,
3148
3148
  onPropertyRemove: m,
3149
- onPropertyClick: b.isDragging ? void 0 : i,
3149
+ onPropertyClick: f.isDragging ? void 0 : i,
3150
3150
  selectedPropertyKey: a
3151
3151
  }
3152
3152
  ) })
@@ -3190,7 +3190,7 @@ function xi({
3190
3190
  }
3191
3191
  ));
3192
3192
  }
3193
- const f = g ? N(p, we(g)) : !1, k = s === g, C = i && Ke(i);
3193
+ const b = g ? S(p, we(g)) : !1, k = s === g, C = i && Ke(i);
3194
3194
  return /* @__PURE__ */ n(
3195
3195
  "div",
3196
3196
  {
@@ -3217,7 +3217,7 @@ function xi({
3217
3217
  onClick: c ? () => c(t, a) : void 0,
3218
3218
  includeName: !0,
3219
3219
  selected: k,
3220
- hasError: f
3220
+ hasError: b
3221
3221
  }
3222
3222
  ) : /* @__PURE__ */ e(
3223
3223
  ki,
@@ -3258,23 +3258,23 @@ function Ci({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3258
3258
  values: o,
3259
3259
  setFieldValue: s
3260
3260
  } = K(), [p, c] = Q(!1), [m, u] = Q(), [d, l] = Q(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), y = J(({
3261
- id: b,
3261
+ id: f,
3262
3262
  property: _
3263
3263
  }) => {
3264
- if (!b)
3264
+ if (!f)
3265
3265
  throw Error();
3266
3266
  s("properties", {
3267
3267
  ...o.properties ?? {},
3268
- [b]: _
3269
- }, !1), s("propertiesOrder", [...g, b], !1), c(!1);
3270
- }, [o.properties, g]), f = J((b, _) => {
3271
- const T = b ? se(b, _) : void 0;
3268
+ [f]: _
3269
+ }, !1), s("propertiesOrder", [...g, f], !1), c(!1);
3270
+ }, [o.properties, g]), b = J((f, _) => {
3271
+ const T = f ? se(f, _) : void 0;
3272
3272
  if (!T)
3273
3273
  throw Error("collection editor miss config");
3274
- const I = we(T), w = Oe(_), V = N(o, w) ?? Object.keys(N(o, hi(_)));
3275
- s(I, void 0, !1), s(w, V.filter((P) => P !== b), !1), c(!1), u(void 0), l(void 0);
3276
- }, [s, o]), k = m ? se(m, d) : void 0, C = k ? N(o.properties, k.replaceAll(".", ".properties.")) : void 0, x = /* @__PURE__ */ n(
3277
- D,
3274
+ const B = we(T), w = Oe(_), j = S(o, w) ?? Object.keys(S(o, hi(_)));
3275
+ s(B, void 0, !1), s(w, j.filter((N) => N !== f), !1), c(!1), u(void 0), l(void 0);
3276
+ }, [s, o]), k = m ? se(m, d) : void 0, C = k ? S(o.properties, k.replaceAll(".", ".properties.")) : void 0, x = /* @__PURE__ */ n(
3277
+ R,
3278
3278
  {
3279
3279
  color: "primary",
3280
3280
  variant: "outlined",
@@ -3285,13 +3285,13 @@ function Ci({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3285
3285
  o.name ?? "this group"
3286
3286
  ]
3287
3287
  }
3288
- ), h = !g || g.length < 1, v = J((b, _) => {
3289
- s(Oe(_), b, !1);
3288
+ ), h = !g || g.length < 1, v = J((f, _) => {
3289
+ s(Oe(_), f, !1);
3290
3290
  }, []);
3291
- return /* @__PURE__ */ n(F, { children: [
3291
+ return /* @__PURE__ */ n(I, { children: [
3292
3292
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3293
3293
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
3294
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this group" }),
3294
+ /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this group" }),
3295
3295
  x
3296
3296
  ] }),
3297
3297
  /* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
@@ -3301,14 +3301,14 @@ function Ci({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3301
3301
  properties: o.properties ?? {},
3302
3302
  propertiesOrder: g,
3303
3303
  errors: {},
3304
- onPropertyClick: (b, _) => {
3305
- u(b), l(_), c(!0);
3304
+ onPropertyClick: (f, _) => {
3305
+ u(f), l(_), c(!0);
3306
3306
  },
3307
3307
  onPropertyMove: v
3308
3308
  }
3309
3309
  ),
3310
3310
  h && /* @__PURE__ */ e(
3311
- O,
3311
+ P,
3312
3312
  {
3313
3313
  variant: "label",
3314
3314
  className: "h-full flex items-center justify-center p-2",
@@ -3324,7 +3324,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3324
3324
  position: "start",
3325
3325
  size: "small",
3326
3326
  label: "Spread children as columns",
3327
- onValueChange: (b) => s("spreadChildren", b),
3327
+ onValueChange: (f) => s("spreadChildren", f),
3328
3328
  value: o.spreadChildren ?? !1
3329
3329
  }
3330
3330
  ),
@@ -3344,7 +3344,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3344
3344
  c(!1), u(void 0), l(void 0);
3345
3345
  },
3346
3346
  getData: a,
3347
- onDelete: f,
3347
+ onDelete: b,
3348
3348
  propertyKey: m,
3349
3349
  propertyNamespace: d,
3350
3350
  property: C,
@@ -3372,23 +3372,23 @@ function Oi({
3372
3372
  errors: u,
3373
3373
  setFieldValue: d,
3374
3374
  touched: l
3375
- } = K(), [g, y] = Q(!1), f = N(c, "of"), k = N(l, "of") && N(u, "of"), C = J(({ id: h, property: v, namespace: b }) => {
3375
+ } = K(), [g, y] = Q(!1), b = S(c, "of"), k = S(l, "of") && S(u, "of"), C = J(({ id: h, property: v, namespace: f }) => {
3376
3376
  d("of", v);
3377
- }, []), x = f && Je(f, p);
3378
- return /* @__PURE__ */ n(F, { children: [
3377
+ }, []), x = b && Je(b, p);
3378
+ return /* @__PURE__ */ n(I, { children: [
3379
3379
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3380
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Repeat component" }),
3380
+ /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Repeat component" }),
3381
3381
  /* @__PURE__ */ e(
3382
3382
  ge,
3383
3383
  {
3384
3384
  name: "of",
3385
- value: f,
3385
+ value: b,
3386
3386
  validate: (h) => h?.dataType ? void 0 : "You need to specify a repeat field",
3387
3387
  children: () => /* @__PURE__ */ n(Pe, { className: "p-2 mt-4", children: [
3388
- f && /* @__PURE__ */ e(
3388
+ b && /* @__PURE__ */ e(
3389
3389
  ra,
3390
3390
  {
3391
- property: f,
3391
+ property: b,
3392
3392
  onClick: i ? void 0 : () => y(!0),
3393
3393
  includeName: !1,
3394
3394
  includeEditButton: !0,
@@ -3396,8 +3396,8 @@ function Oi({
3396
3396
  hasError: !1
3397
3397
  }
3398
3398
  ),
3399
- !i && !f && /* @__PURE__ */ n(
3400
- D,
3399
+ !i && !b && /* @__PURE__ */ n(
3400
+ R,
3401
3401
  {
3402
3402
  variant: "text",
3403
3403
  size: "large",
@@ -3420,7 +3420,7 @@ function Oi({
3420
3420
  autoOpenTypeSelect: !a,
3421
3421
  onOkClicked: () => y(!1),
3422
3422
  allowDataInference: o,
3423
- property: f,
3423
+ property: b,
3424
3424
  includeIdAndName: !1,
3425
3425
  onPropertyChanged: C,
3426
3426
  forceShowErrors: t,
@@ -3444,7 +3444,7 @@ const Pi = U.forwardRef(
3444
3444
  }, p) {
3445
3445
  const {
3446
3446
  errors: c
3447
- } = K(), m = "name", u = a && N(c, m), d = "id", l = a && N(c, d), g = "description", y = a && N(c, g);
3447
+ } = K(), m = "name", u = a && S(c, m), d = "id", l = a && S(c, d), g = "description", y = a && S(c, g);
3448
3448
  return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
3449
3449
  /* @__PURE__ */ n("div", { children: [
3450
3450
  /* @__PURE__ */ e(
@@ -3470,7 +3470,7 @@ const Pi = U.forwardRef(
3470
3470
  name: d,
3471
3471
  as: ze,
3472
3472
  label: "ID",
3473
- validate: (f) => Si(f, r),
3473
+ validate: (b) => Si(b, r),
3474
3474
  disabled: i || o,
3475
3475
  required: !0,
3476
3476
  size: "small",
@@ -3509,7 +3509,7 @@ function Ai({
3509
3509
  showErrors: i
3510
3510
  }) {
3511
3511
  const { values: r, setFieldValue: o } = K();
3512
- return /* @__PURE__ */ n(F, { children: [
3512
+ return /* @__PURE__ */ n(I, { children: [
3513
3513
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
3514
3514
  t === "text_field" && /* @__PURE__ */ e(
3515
3515
  Be,
@@ -3581,14 +3581,14 @@ function Ai({
3581
3581
  o("defaultValue", s.target.value === "" ? void 0 : s.target.value);
3582
3582
  },
3583
3583
  label: "Default value",
3584
- value: N(r, "defaultValue") ?? ""
3584
+ value: S(r, "defaultValue") ?? ""
3585
3585
  }
3586
3586
  ) })
3587
3587
  ] });
3588
3588
  }
3589
3589
  function zi({ disabled: t }) {
3590
- const { values: a } = K(), i = N(a, "defaultValue");
3591
- return /* @__PURE__ */ n(F, { children: [
3590
+ const { values: a } = K(), i = S(a, "defaultValue");
3591
+ return /* @__PURE__ */ n(I, { children: [
3592
3592
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }),
3593
3593
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3594
3594
  le,
@@ -3617,15 +3617,15 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3617
3617
  ...o.oneOf?.properties ?? {},
3618
3618
  [h]: v
3619
3619
  }, !1), s("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), h], !1), c(!1);
3620
- }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = m ? se(m, d) : void 0, f = y ? N(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, k = J((h, v) => {
3621
- const b = h ? se(h, v) : void 0;
3622
- if (!b)
3620
+ }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = m ? se(m, d) : void 0, b = y ? S(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, k = J((h, v) => {
3621
+ const f = h ? se(h, v) : void 0;
3622
+ if (!f)
3623
3623
  throw Error("collection editor miss config");
3624
- s(`oneOf.${we(b)}`, void 0, !1);
3625
- const _ = `oneOf.${Oe(v)}`, T = N(o, _);
3626
- s(_, T.filter((I) => I !== h), !1), c(!1), u(void 0), l(void 0);
3624
+ s(`oneOf.${we(f)}`, void 0, !1);
3625
+ const _ = `oneOf.${Oe(v)}`, T = S(o, _);
3626
+ s(_, T.filter((B) => B !== h), !1), c(!1), u(void 0), l(void 0);
3627
3627
  }, [s, o]), C = /* @__PURE__ */ n(
3628
- D,
3628
+ R,
3629
3629
  {
3630
3630
  autoFocus: !0,
3631
3631
  color: "primary",
@@ -3639,10 +3639,10 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3639
3639
  ), x = J((h, v) => {
3640
3640
  s(`oneOf.${Oe(v)}`, h, !1);
3641
3641
  }, []);
3642
- return /* @__PURE__ */ n(F, { children: [
3642
+ return /* @__PURE__ */ n(I, { children: [
3643
3643
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3644
3644
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
3645
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this block" }),
3645
+ /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this block" }),
3646
3646
  C
3647
3647
  ] }),
3648
3648
  /* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
@@ -3678,7 +3678,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, customFields: r })
3678
3678
  onDelete: k,
3679
3679
  propertyKey: m,
3680
3680
  propertyNamespace: d,
3681
- property: f,
3681
+ property: b,
3682
3682
  existingProperty: !!m,
3683
3683
  autoUpdateId: !m,
3684
3684
  autoOpenTypeSelect: !m,
@@ -3699,7 +3699,7 @@ function Vi({ disabled: t }) {
3699
3699
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3700
3700
  Z,
3701
3701
  {
3702
- value: N(a, r),
3702
+ value: S(a, r),
3703
3703
  label: "Min value",
3704
3704
  name: r,
3705
3705
  type: "number",
@@ -3711,7 +3711,7 @@ function Vi({ disabled: t }) {
3711
3711
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3712
3712
  Z,
3713
3713
  {
3714
- value: N(a, o),
3714
+ value: S(a, o),
3715
3715
  label: "Max value",
3716
3716
  name: o,
3717
3717
  type: "number",
@@ -3723,7 +3723,7 @@ function Vi({ disabled: t }) {
3723
3723
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3724
3724
  Z,
3725
3725
  {
3726
- value: N(a, s),
3726
+ value: S(a, s),
3727
3727
  label: "Less than",
3728
3728
  name: s,
3729
3729
  type: "number",
@@ -3735,7 +3735,7 @@ function Vi({ disabled: t }) {
3735
3735
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3736
3736
  Z,
3737
3737
  {
3738
- value: N(a, p),
3738
+ value: S(a, p),
3739
3739
  label: "More than",
3740
3740
  name: p,
3741
3741
  type: "number",
@@ -3778,7 +3778,7 @@ function Vi({ disabled: t }) {
3778
3778
  }
3779
3779
  function ji({ disabled: t }) {
3780
3780
  const { values: a, setFieldValue: i } = K();
3781
- return /* @__PURE__ */ n(F, { children: [
3781
+ return /* @__PURE__ */ n(I, { children: [
3782
3782
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Vi, { disabled: t }) }) }),
3783
3783
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3784
3784
  ze,
@@ -3790,7 +3790,7 @@ function ji({ disabled: t }) {
3790
3790
  i("defaultValue", r.target.value === "" ? void 0 : parseFloat(r.target.value));
3791
3791
  },
3792
3792
  label: "Default value",
3793
- value: N(a, "defaultValue") ?? ""
3793
+ value: S(a, "defaultValue") ?? ""
3794
3794
  }
3795
3795
  ) })
3796
3796
  ] });
@@ -3811,8 +3811,8 @@ function It({
3811
3811
  } = K();
3812
3812
  if (!De())
3813
3813
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(He, {}) });
3814
- const l = a ? "of.path" : "path", g = N(o, l), y = r && N(p, l);
3815
- return console.log("pathError", p, y), /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3814
+ const l = a ? "of.path" : "path", g = S(o, l), y = r && S(p, l);
3815
+ return console.log("pathError", p, y), /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3816
3816
  ge,
3817
3817
  {
3818
3818
  required: !0,
@@ -3847,7 +3847,7 @@ function Fi({
3847
3847
  const c = p?.collections ?? [], m = Array.from(new Set(
3848
3848
  Object.values(c).map((d) => d.group).filter(Boolean)
3849
3849
  ).values()), u = c.filter((d) => !d.group);
3850
- return /* @__PURE__ */ n(F, { children: [
3850
+ return /* @__PURE__ */ n(I, { children: [
3851
3851
  /* @__PURE__ */ n(
3852
3852
  Te,
3853
3853
  {
@@ -3866,7 +3866,7 @@ function Fi({
3866
3866
  return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3867
3867
  g,
3868
3868
  /* @__PURE__ */ e(
3869
- O,
3869
+ P,
3870
3870
  {
3871
3871
  variant: "subtitle2",
3872
3872
  className: "font-medium ml-4",
@@ -3890,7 +3890,7 @@ function Fi({
3890
3890
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3891
3891
  g,
3892
3892
  /* @__PURE__ */ e(
3893
- O,
3893
+ P,
3894
3894
  {
3895
3895
  variant: "subtitle2",
3896
3896
  className: "font-medium ml-4",
@@ -3914,7 +3914,7 @@ function Fi({
3914
3914
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3915
3915
  l,
3916
3916
  /* @__PURE__ */ e(
3917
- O,
3917
+ P,
3918
3918
  {
3919
3919
  variant: "subtitle2",
3920
3920
  className: "font-medium ml-4",
@@ -3938,8 +3938,8 @@ function Ii({ disabled: t }) {
3938
3938
  errors: i,
3939
3939
  touched: r,
3940
3940
  setFieldValue: o
3941
- } = K(), s = "mode", p = N(a, s), c = N(r, s) && N(i, s), m = "autoValue", u = N(a, m), d = N(r, m) && N(i, m);
3942
- return /* @__PURE__ */ n(F, { children: [
3941
+ } = K(), s = "mode", p = S(a, s), c = S(r, s) && S(i, s), m = "autoValue", u = S(a, m), d = S(r, m) && S(i, m);
3942
+ return /* @__PURE__ */ n(I, { children: [
3943
3943
  /* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
3944
3944
  /* @__PURE__ */ n(
3945
3945
  Te,
@@ -4025,7 +4025,7 @@ function Bi({ disabled: t }) {
4025
4025
  ] });
4026
4026
  }
4027
4027
  function Mi({ disabled: t }) {
4028
- return /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }) });
4028
+ return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }) });
4029
4029
  }
4030
4030
  function oa(t, a, i) {
4031
4031
  let r;
@@ -4033,7 +4033,7 @@ function oa(t, a, i) {
4033
4033
  t,
4034
4034
  G({
4035
4035
  dataType: "string",
4036
- fieldConfig: "text_field",
4036
+ propertyConfig: "text_field",
4037
4037
  editable: t.editable !== void 0 ? t.editable : !0,
4038
4038
  storage: void 0,
4039
4039
  multiline: void 0,
@@ -4046,7 +4046,7 @@ function oa(t, a, i) {
4046
4046
  t,
4047
4047
  G({
4048
4048
  dataType: "string",
4049
- fieldConfig: "multiline",
4049
+ propertyConfig: "multiline",
4050
4050
  editable: t.editable !== void 0 ? t.editable : !0,
4051
4051
  multiline: !0,
4052
4052
  storage: void 0,
@@ -4059,7 +4059,7 @@ function oa(t, a, i) {
4059
4059
  t,
4060
4060
  G({
4061
4061
  dataType: "string",
4062
- fieldConfig: "markdown",
4062
+ propertyConfig: "markdown",
4063
4063
  editable: t.editable !== void 0 ? t.editable : !0,
4064
4064
  storage: void 0,
4065
4065
  multiline: void 0,
@@ -4071,7 +4071,7 @@ function oa(t, a, i) {
4071
4071
  t,
4072
4072
  G({
4073
4073
  dataType: "string",
4074
- fieldConfig: "url",
4074
+ propertyConfig: "url",
4075
4075
  editable: t.editable !== void 0 ? t.editable : !0,
4076
4076
  storage: void 0,
4077
4077
  multiline: void 0,
@@ -4084,7 +4084,7 @@ function oa(t, a, i) {
4084
4084
  t,
4085
4085
  G({
4086
4086
  dataType: "string",
4087
- fieldConfig: "email",
4087
+ propertyConfig: "email",
4088
4088
  editable: t.editable !== void 0 ? t.editable : !0,
4089
4089
  storage: void 0,
4090
4090
  multiline: void 0,
@@ -4097,7 +4097,7 @@ function oa(t, a, i) {
4097
4097
  t,
4098
4098
  G({
4099
4099
  dataType: "string",
4100
- fieldConfig: "select",
4100
+ propertyConfig: "select",
4101
4101
  editable: t.editable !== void 0 ? t.editable : !0,
4102
4102
  storage: void 0,
4103
4103
  multiline: void 0,
@@ -4110,7 +4110,7 @@ function oa(t, a, i) {
4110
4110
  t,
4111
4111
  G({
4112
4112
  dataType: "array",
4113
- fieldConfig: "multi_select",
4113
+ propertyConfig: "multi_select",
4114
4114
  editable: t.editable !== void 0 ? t.editable : !0,
4115
4115
  of: {
4116
4116
  dataType: "string",
@@ -4121,7 +4121,7 @@ function oa(t, a, i) {
4121
4121
  t,
4122
4122
  G({
4123
4123
  dataType: "number",
4124
- fieldConfig: "number_input",
4124
+ propertyConfig: "number_input",
4125
4125
  editable: t.editable !== void 0 ? t.editable : !0,
4126
4126
  enumValues: void 0
4127
4127
  })
@@ -4129,7 +4129,7 @@ function oa(t, a, i) {
4129
4129
  t,
4130
4130
  G({
4131
4131
  dataType: "number",
4132
- fieldConfig: "number_select",
4132
+ propertyConfig: "number_select",
4133
4133
  editable: t.editable !== void 0 ? t.editable : !0,
4134
4134
  enumValues: t.enumValues ?? []
4135
4135
  })
@@ -4137,7 +4137,7 @@ function oa(t, a, i) {
4137
4137
  t,
4138
4138
  G({
4139
4139
  dataType: "array",
4140
- fieldConfig: "multi_number_select",
4140
+ propertyConfig: "multi_number_select",
4141
4141
  editable: t.editable !== void 0 ? t.editable : !0,
4142
4142
  of: {
4143
4143
  dataType: "number",
@@ -4148,7 +4148,7 @@ function oa(t, a, i) {
4148
4148
  t,
4149
4149
  G({
4150
4150
  dataType: "string",
4151
- fieldConfig: "file_upload",
4151
+ propertyConfig: "file_upload",
4152
4152
  editable: t.editable !== void 0 ? t.editable : !0,
4153
4153
  storage: {
4154
4154
  storagePath: "/"
@@ -4158,7 +4158,7 @@ function oa(t, a, i) {
4158
4158
  t,
4159
4159
  G({
4160
4160
  dataType: "array",
4161
- fieldConfig: "multi_file_upload",
4161
+ propertyConfig: "multi_file_upload",
4162
4162
  editable: t.editable !== void 0 ? t.editable : !0,
4163
4163
  of: {
4164
4164
  dataType: "string",
@@ -4171,7 +4171,7 @@ function oa(t, a, i) {
4171
4171
  t,
4172
4172
  G({
4173
4173
  dataType: "map",
4174
- fieldConfig: "group",
4174
+ propertyConfig: "group",
4175
4175
  editable: t.editable !== void 0 ? t.editable : !0,
4176
4176
  keyValue: !1,
4177
4177
  properties: t.properties ?? {}
@@ -4180,7 +4180,7 @@ function oa(t, a, i) {
4180
4180
  t,
4181
4181
  G({
4182
4182
  dataType: "map",
4183
- fieldConfig: "key_value",
4183
+ propertyConfig: "key_value",
4184
4184
  editable: t.editable !== void 0 ? t.editable : !0,
4185
4185
  keyValue: !0,
4186
4186
  properties: void 0
@@ -4189,14 +4189,14 @@ function oa(t, a, i) {
4189
4189
  t,
4190
4190
  G({
4191
4191
  dataType: "reference",
4192
- fieldConfig: "reference",
4192
+ propertyConfig: "reference",
4193
4193
  editable: t.editable !== void 0 ? t.editable : !0
4194
4194
  })
4195
4195
  ) : a === "multi_references" ? r = L(
4196
4196
  t,
4197
4197
  G({
4198
4198
  dataType: "array",
4199
- fieldConfig: "multi_references",
4199
+ propertyConfig: "multi_references",
4200
4200
  editable: t.editable !== void 0 ? t.editable : !0,
4201
4201
  of: {
4202
4202
  dataType: "reference"
@@ -4206,14 +4206,14 @@ function oa(t, a, i) {
4206
4206
  t,
4207
4207
  G({
4208
4208
  dataType: "boolean",
4209
- fieldConfig: "switch",
4209
+ propertyConfig: "switch",
4210
4210
  editable: t.editable !== void 0 ? t.editable : !0
4211
4211
  })
4212
4212
  ) : a === "date_time" ? r = L(
4213
4213
  t,
4214
4214
  G({
4215
4215
  dataType: "date",
4216
- fieldConfig: "date_time",
4216
+ propertyConfig: "date_time",
4217
4217
  editable: t.editable !== void 0 ? t.editable : !0,
4218
4218
  mode: "date_time"
4219
4219
  })
@@ -4221,22 +4221,22 @@ function oa(t, a, i) {
4221
4221
  t,
4222
4222
  G({
4223
4223
  dataType: "array",
4224
- fieldConfig: "repeat",
4224
+ propertyConfig: "repeat",
4225
4225
  editable: t.editable !== void 0 ? t.editable : !0
4226
4226
  })
4227
4227
  ) : a === "block" ? r = L(
4228
4228
  t,
4229
4229
  G({
4230
4230
  dataType: "array",
4231
- fieldConfig: "block",
4231
+ propertyConfig: "block",
4232
4232
  editable: t.editable !== void 0 ? t.editable : !0,
4233
4233
  oneOf: {
4234
4234
  properties: {}
4235
4235
  }
4236
4236
  })
4237
- ) : a && i[a] && (r = { ...i[a].property, fieldConfig: a }), r;
4237
+ ) : a && i[a] && (r = { ...i[a].property, propertyConfig: a }), r;
4238
4238
  }
4239
- function na({ value: t, optionDisabled: a, fieldConfig: i, existing: r }) {
4239
+ function na({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4240
4240
  return /* @__PURE__ */ e(
4241
4241
  ye,
4242
4242
  {
@@ -4251,11 +4251,11 @@ function na({ value: t, optionDisabled: a, fieldConfig: i, existing: r }) {
4251
4251
  a ? "w-full" : ""
4252
4252
  ),
4253
4253
  children: [
4254
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(We, { fieldConfig: i }) }),
4254
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(We, { propertyConfig: i }) }),
4255
4255
  /* @__PURE__ */ n("div", { children: [
4256
4256
  /* @__PURE__ */ e("div", { children: i.name }),
4257
4257
  /* @__PURE__ */ e(
4258
- O,
4258
+ P,
4259
4259
  {
4260
4260
  variant: "caption",
4261
4261
  color: "disabled",
@@ -4285,59 +4285,59 @@ const sa = U.memo(
4285
4285
  onDelete: l,
4286
4286
  onError: g,
4287
4287
  initialErrors: y,
4288
- forceShowErrors: f,
4288
+ forceShowErrors: b,
4289
4289
  existingPropertyKeys: k,
4290
4290
  allowDataInference: C,
4291
4291
  getHelpers: x,
4292
4292
  getData: h,
4293
4293
  customFields: v
4294
4294
  }) {
4295
- const b = {
4295
+ const f = {
4296
4296
  id: "",
4297
4297
  name: ""
4298
4298
  }, _ = (m && !Ke(m)) ?? !1, T = Le(m ? {
4299
4299
  id: p,
4300
4300
  previousId: p,
4301
4301
  property: m
4302
- } : void 0), I = ({
4302
+ } : void 0), B = ({
4303
4303
  id: w,
4304
- property: V
4304
+ property: j
4305
4305
  }) => {
4306
- const P = {
4306
+ const N = {
4307
4307
  id: w,
4308
4308
  previousId: T.current?.id,
4309
- property: V,
4309
+ property: j,
4310
4310
  namespace: c
4311
4311
  };
4312
- T.current = P, u?.(P);
4312
+ T.current = N, u?.(N);
4313
4313
  };
4314
4314
  return /* @__PURE__ */ e(
4315
4315
  Pt,
4316
4316
  {
4317
4317
  initialErrors: y,
4318
- initialValues: m ? { id: p, ...m } : b,
4319
- onSubmit: (w, V) => {
4318
+ initialValues: m ? { id: p, ...m } : f,
4319
+ onSubmit: (w, j) => {
4320
4320
  console.log("Submitting property", w);
4321
4321
  const {
4322
- id: P,
4323
- ...S
4322
+ id: N,
4323
+ ...O
4324
4324
  } = w;
4325
- I({
4326
- id: P,
4327
- property: S
4328
- }), r || V.resetForm({ values: b });
4325
+ B({
4326
+ id: N,
4327
+ property: { ...O, editable: O.editable ?? !0 }
4328
+ }), r || j.resetForm({ values: f });
4329
4329
  },
4330
4330
  children: (w) => (pe(() => {
4331
4331
  x?.(w);
4332
4332
  }, [w]), /* @__PURE__ */ e(
4333
4333
  Di,
4334
4334
  {
4335
- onPropertyChanged: d ? I : void 0,
4335
+ onPropertyChanged: d ? B : void 0,
4336
4336
  onDelete: l,
4337
4337
  includeIdAndTitle: a,
4338
4338
  propertyNamespace: c,
4339
4339
  onError: g,
4340
- showErrors: f || w.submitCount > 0,
4340
+ showErrors: b || w.submitCount > 0,
4341
4341
  existing: r,
4342
4342
  autoUpdateId: o,
4343
4343
  inArray: s,
@@ -4388,7 +4388,7 @@ function Ve({
4388
4388
  ) }),
4389
4389
  /* @__PURE__ */ n(Qe, { children: [
4390
4390
  a && /* @__PURE__ */ e(
4391
- D,
4391
+ R,
4392
4392
  {
4393
4393
  variant: "text",
4394
4394
  onClick: () => {
@@ -4398,7 +4398,7 @@ function Ve({
4398
4398
  }
4399
4399
  ),
4400
4400
  /* @__PURE__ */ e(
4401
- D,
4401
+ R,
4402
4402
  {
4403
4403
  variant: "outlined",
4404
4404
  color: "primary",
@@ -4426,124 +4426,124 @@ function Di({
4426
4426
  propertyNamespace: l,
4427
4427
  onError: g,
4428
4428
  showErrors: y,
4429
- disabled: f,
4429
+ disabled: b,
4430
4430
  inArray: k,
4431
4431
  existingPropertyKeys: C,
4432
4432
  getData: x,
4433
4433
  allowDataInference: h,
4434
4434
  customFields: v
4435
4435
  }) {
4436
- const [b, _] = Q(c), [T, I] = Q(!1), [w, V] = Q(t?.dataType ? Jt(t) : void 0), P = Object.entries(_t).concat(Object.entries(v)), S = k ? P.filter(([Y, ae]) => !de(ae.property) && ae.property?.dataType !== "array") : P, R = ga(t), te = Le(null), q = Le(t), j = "id", ke = y && N(a, "selectedWidget");
4436
+ const [f, _] = Q(c), [T, B] = Q(!1), [w, j] = Q(t?.dataType ? Jt(t) : void 0), N = Object.entries(_t).concat(Object.entries(v)), O = k ? N.filter(([Y, ae]) => !de(ae.property) && ae.property?.dataType !== "array") : N, V = ga(t), te = Le(null), q = Le(t), E = "id", ke = y && S(a, "selectedWidget");
4437
4437
  pe(() => {
4438
- !N(i, j) && p && t?.name && o(j, Yt(t.name));
4438
+ !S(i, E) && p && t?.name && o(E, Yt(t.name));
4439
4439
  }, [p, i, t?.name]), pe(() => {
4440
- if (u && (!m || R.id)) {
4440
+ if (u && (!m || V.id)) {
4441
4441
  const {
4442
4442
  id: Y,
4443
4443
  ...ae
4444
- } = R;
4445
- ct(R, q.current) || (u({
4444
+ } = V;
4445
+ ct(V, q.current) || (u({
4446
4446
  id: Y,
4447
4447
  property: ae,
4448
4448
  namespace: l
4449
- }), q.current = R);
4449
+ }), q.current = V);
4450
4450
  }
4451
- }, [R, m, u, l]), pe(() => {
4451
+ }, [V, m, u, l]), pe(() => {
4452
4452
  t?.id && g && Object.keys(a).length > 0 && g(t?.id, l, a);
4453
4453
  }, [a, g, l, t?.id]);
4454
4454
  const Se = (Y) => {
4455
- V(Y), r(oa(t, Y, v)), setTimeout(() => {
4455
+ j(Y), r(oa(t, Y, v)), setTimeout(() => {
4456
4456
  te.current?.focus();
4457
4457
  }, 0);
4458
4458
  };
4459
- let B;
4460
- return w === "text_field" || w === "multiline" || w === "markdown" || w === "url" || w === "email" ? B = /* @__PURE__ */ e(
4459
+ let M;
4460
+ return w === "text_field" || w === "multiline" || w === "markdown" || w === "url" || w === "email" ? M = /* @__PURE__ */ e(
4461
4461
  Ai,
4462
4462
  {
4463
4463
  widgetId: w,
4464
- disabled: f,
4464
+ disabled: b,
4465
4465
  showErrors: y
4466
4466
  }
4467
- ) : w === "select" || w === "number_select" ? B = /* @__PURE__ */ e(
4467
+ ) : w === "select" || w === "number_select" ? M = /* @__PURE__ */ e(
4468
4468
  Et,
4469
4469
  {
4470
4470
  multiselect: !1,
4471
4471
  allowDataInference: h,
4472
4472
  updateIds: !s,
4473
- disabled: f,
4473
+ disabled: b,
4474
4474
  getData: x,
4475
4475
  showErrors: y
4476
4476
  }
4477
- ) : w === "multi_select" || w === "multi_number_select" ? B = /* @__PURE__ */ e(
4477
+ ) : w === "multi_select" || w === "multi_number_select" ? M = /* @__PURE__ */ e(
4478
4478
  Et,
4479
4479
  {
4480
4480
  multiselect: !0,
4481
4481
  updateIds: !s,
4482
- disabled: f,
4482
+ disabled: b,
4483
4483
  allowDataInference: h,
4484
4484
  getData: x,
4485
4485
  showErrors: y
4486
4486
  }
4487
- ) : w === "file_upload" ? B = /* @__PURE__ */ e(
4487
+ ) : w === "file_upload" ? M = /* @__PURE__ */ e(
4488
4488
  Ft,
4489
4489
  {
4490
4490
  existing: s,
4491
4491
  multiple: !1,
4492
- disabled: f
4492
+ disabled: b
4493
4493
  }
4494
- ) : w === "multi_file_upload" ? B = /* @__PURE__ */ e(
4494
+ ) : w === "multi_file_upload" ? M = /* @__PURE__ */ e(
4495
4495
  Ft,
4496
4496
  {
4497
4497
  existing: s,
4498
4498
  multiple: !0,
4499
- disabled: f
4499
+ disabled: b
4500
4500
  }
4501
- ) : w === "switch" ? B = /* @__PURE__ */ e(zi, { disabled: f }) : w === "number_input" ? B = /* @__PURE__ */ e(ji, { disabled: f }) : w === "group" ? B = /* @__PURE__ */ e(
4501
+ ) : w === "switch" ? M = /* @__PURE__ */ e(zi, { disabled: b }) : w === "number_input" ? M = /* @__PURE__ */ e(ji, { disabled: b }) : w === "group" ? M = /* @__PURE__ */ e(
4502
4502
  Ci,
4503
4503
  {
4504
- disabled: f,
4504
+ disabled: b,
4505
4505
  getData: x,
4506
4506
  allowDataInference: h,
4507
4507
  customFields: v
4508
4508
  }
4509
- ) : w === "block" ? B = /* @__PURE__ */ e(
4509
+ ) : w === "block" ? M = /* @__PURE__ */ e(
4510
4510
  Ti,
4511
4511
  {
4512
- disabled: f,
4512
+ disabled: b,
4513
4513
  getData: x,
4514
4514
  allowDataInference: h,
4515
4515
  customFields: v
4516
4516
  }
4517
- ) : w === "reference" ? B = /* @__PURE__ */ e(
4517
+ ) : w === "reference" ? M = /* @__PURE__ */ e(
4518
4518
  It,
4519
4519
  {
4520
4520
  showErrors: y,
4521
4521
  existing: s,
4522
4522
  multiple: !1,
4523
- disabled: f
4523
+ disabled: b
4524
4524
  }
4525
- ) : w === "date_time" ? B = /* @__PURE__ */ e(Ii, { disabled: f }) : w === "multi_references" ? B = /* @__PURE__ */ e(
4525
+ ) : w === "date_time" ? M = /* @__PURE__ */ e(Ii, { disabled: b }) : w === "multi_references" ? M = /* @__PURE__ */ e(
4526
4526
  It,
4527
4527
  {
4528
4528
  showErrors: y,
4529
4529
  existing: s,
4530
4530
  multiple: !0,
4531
- disabled: f
4531
+ disabled: b
4532
4532
  }
4533
- ) : w === "repeat" ? B = /* @__PURE__ */ e(
4533
+ ) : w === "repeat" ? M = /* @__PURE__ */ e(
4534
4534
  Oi,
4535
4535
  {
4536
4536
  showErrors: y,
4537
4537
  existing: s,
4538
4538
  getData: x,
4539
4539
  allowDataInference: h,
4540
- disabled: f,
4540
+ disabled: b,
4541
4541
  customFields: v
4542
4542
  }
4543
- ) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: f }) : B = null, /* @__PURE__ */ n(F, { children: [
4544
- f && /* @__PURE__ */ n(Wt, { mode: "warn", children: [
4545
- /* @__PURE__ */ e(O, { children: "This property can't be edited" }),
4546
- /* @__PURE__ */ n(O, { variant: "caption", children: [
4543
+ ) : w === "key_value" ? M = /* @__PURE__ */ e(Mi, { disabled: b }) : M = null, /* @__PURE__ */ n(I, { children: [
4544
+ b && /* @__PURE__ */ n(Wt, { mode: "warn", children: [
4545
+ /* @__PURE__ */ e(P, { children: "This property can't be edited" }),
4546
+ /* @__PURE__ */ n(P, { variant: "caption", children: [
4547
4547
  "You may not have permission to edit it or it is defined in code with no ",
4548
4548
  /* @__PURE__ */ e("code", { children: "editable" }),
4549
4549
  " flag"
@@ -4558,10 +4558,10 @@ function Di({
4558
4558
  error: !!ke,
4559
4559
  value: w ?? "",
4560
4560
  placeholder: "Select a property widget",
4561
- open: b,
4561
+ open: f,
4562
4562
  onOpenChange: _,
4563
4563
  position: "item-aligned",
4564
- disabled: f,
4564
+ disabled: b,
4565
4565
  renderValue: (Y) => {
4566
4566
  if (!Y)
4567
4567
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
@@ -4577,11 +4577,11 @@ function Di({
4577
4577
  xe ? "w-full pointer-events-none opacity-50" : ""
4578
4578
  ),
4579
4579
  children: [
4580
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(We, { fieldConfig: fe }) }),
4580
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(We, { propertyConfig: fe }) }),
4581
4581
  /* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
4582
4582
  /* @__PURE__ */ e("div", { children: fe.name }),
4583
4583
  /* @__PURE__ */ e(
4584
- O,
4584
+ P,
4585
4585
  {
4586
4586
  variant: "caption",
4587
4587
  color: "disabled",
@@ -4596,14 +4596,14 @@ function Di({
4596
4596
  onValueChange: (Y) => {
4597
4597
  Se(Y);
4598
4598
  },
4599
- children: S.map(([Y, ae]) => {
4599
+ children: O.map(([Y, ae]) => {
4600
4600
  const ce = ae.property, re = s && !de(ce) && ce.dataType !== t?.dataType;
4601
4601
  return /* @__PURE__ */ e(
4602
4602
  na,
4603
4603
  {
4604
4604
  value: Y,
4605
4605
  optionDisabled: re,
4606
- fieldConfig: ae,
4606
+ propertyConfig: ae,
4607
4607
  existing: s
4608
4608
  },
4609
4609
  Y
@@ -4612,7 +4612,7 @@ function Di({
4612
4612
  }
4613
4613
  ),
4614
4614
  ke && /* @__PURE__ */ e(
4615
- O,
4615
+ P,
4616
4616
  {
4617
4617
  variant: "caption",
4618
4618
  className: "ml-3.5",
@@ -4626,8 +4626,8 @@ function Di({
4626
4626
  {
4627
4627
  variant: "ghost",
4628
4628
  className: "m-4",
4629
- disabled: f,
4630
- onClick: () => I(!0),
4629
+ disabled: b,
4630
+ onClick: () => B(!0),
4631
4631
  children: /* @__PURE__ */ e(st, {})
4632
4632
  }
4633
4633
  )
@@ -4640,19 +4640,19 @@ function Di({
4640
4640
  disabledId: s,
4641
4641
  isNewProperty: !s,
4642
4642
  existingPropertyKeys: C,
4643
- disabled: f,
4643
+ disabled: b,
4644
4644
  ref: te
4645
4645
  }
4646
4646
  ),
4647
- B,
4648
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Bi, { disabled: f }) })
4647
+ M,
4648
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Bi, { disabled: b }) })
4649
4649
  ] }),
4650
4650
  d && /* @__PURE__ */ e(
4651
4651
  lt,
4652
4652
  {
4653
4653
  open: T,
4654
4654
  onAccept: () => d(t?.id, l),
4655
- onCancel: () => I(!1),
4655
+ onCancel: () => B(!1),
4656
4656
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
4657
4657
  body: /* @__PURE__ */ n("div", { children: [
4658
4658
  " This will ",
@@ -4680,10 +4680,10 @@ function Ri({
4680
4680
  values: l,
4681
4681
  setFieldValue: g,
4682
4682
  setFieldError: y,
4683
- setFieldTouched: f,
4683
+ setFieldTouched: b,
4684
4684
  errors: k,
4685
4685
  dirty: C
4686
- } = K(), x = Ze(), h = Va("lg"), v = !h, [b, _] = Q(), [T, I] = Q(), [w, V] = Q(), P = T ? se(T, w) : void 0, S = P ? N(l.properties, P.replaceAll(".", ".properties.")) : void 0, [R, te] = Q(!1), [q, j] = Q(!1), [ke, Se] = Q([]), B = U.useRef(l.propertiesOrder ? { "": l.propertiesOrder } : {});
4686
+ } = K(), x = Ze(), h = Va("lg"), v = !h, [f, _] = Q(), [T, B] = Q(), [w, j] = Q(), N = T ? se(T, w) : void 0, O = N ? S(l.properties, N.replaceAll(".", ".properties.")) : void 0, [V, te] = Q(!1), [q, E] = Q(!1), [ke, Se] = Q([]), M = U.useRef(l.propertiesOrder ? { "": l.propertiesOrder } : {});
4687
4687
  pe(() => {
4688
4688
  o && o(C);
4689
4689
  }, [C]);
@@ -4696,81 +4696,81 @@ function Ri({
4696
4696
  });
4697
4697
  return;
4698
4698
  }
4699
- const E = Object.keys(z.properties).filter((ne) => !l.properties[ne]);
4700
- if (E.length === 0) {
4699
+ const F = Object.keys(z.properties).filter((ne) => !l.properties[ne]);
4700
+ if (F.length === 0) {
4701
4701
  x.open({
4702
4702
  type: "info",
4703
4703
  message: "No new properties found"
4704
4704
  });
4705
4705
  return;
4706
4706
  }
4707
- const M = {
4708
- ...E.reduce((ne, be) => (ne[be] = z.properties[be], ne), {}),
4707
+ const D = {
4708
+ ...F.reduce((ne, be) => (ne[be] = z.properties[be], ne), {}),
4709
4709
  ...l.properties
4710
4710
  }, oe = [
4711
- ...E,
4711
+ ...F,
4712
4712
  ...l.propertiesOrder ?? []
4713
4713
  ];
4714
- g("properties", M, !1), ce(oe), Se(E);
4714
+ g("properties", D, !1), ce(oe), Se(F);
4715
4715
  }).finally(() => {
4716
4716
  te(!1);
4717
4717
  }));
4718
- } : void 0, ae = (z) => z ? B.current[z] ?? N(l, Oe(z)) : B.current[""], ce = (z, E) => {
4719
- const M = Oe(E);
4720
- g(M, z, !1), B.current[E ?? ""] = z;
4721
- }, re = (z, E) => {
4722
- const M = z ? se(z, E) : void 0;
4723
- if (!M)
4718
+ } : void 0, ae = (z) => z ? M.current[z] ?? S(l, Oe(z)) : M.current[""], ce = (z, F) => {
4719
+ const D = Oe(F);
4720
+ g(D, z, !1), M.current[F ?? ""] = z;
4721
+ }, re = (z, F) => {
4722
+ const D = z ? se(z, F) : void 0;
4723
+ if (!D)
4724
4724
  throw Error("collection editor miss config");
4725
- g(we(M), void 0, !1);
4726
- const ne = ae(E).filter((be) => be !== z);
4727
- ce(ne, E), j(!1), _(void 0), I(void 0), V(void 0);
4728
- }, Fe = (z, E) => {
4729
- g(Oe(E), z, !1);
4725
+ g(we(D), void 0, !1);
4726
+ const ne = ae(F).filter((be) => be !== z);
4727
+ ce(ne, F), E(!1), _(void 0), B(void 0), j(void 0);
4728
+ }, Fe = (z, F) => {
4729
+ g(Oe(F), z, !1);
4730
4730
  }, xe = ({
4731
4731
  id: z,
4732
- property: E
4732
+ property: F
4733
4733
  }) => {
4734
4734
  if (console.log("onPropertyCreated", {
4735
4735
  id: z,
4736
- property: E
4736
+ property: F
4737
4737
  }), !z)
4738
4738
  throw Error("Need to include an ID when creating a new property");
4739
4739
  g("properties", {
4740
4740
  ...l.properties ?? {},
4741
- [z]: E
4741
+ [z]: F
4742
4742
  }, !1);
4743
- const M = [...l.propertiesOrder ?? Object.keys(l.properties), z];
4743
+ const D = [...l.propertiesOrder ?? Object.keys(l.properties), z];
4744
4744
  console.log("onPropertyCreated", {
4745
4745
  id: z,
4746
- property: E,
4747
- newPropertiesOrder: M
4748
- }), ce(M), j(!1), h && (_(M.indexOf(z)), I(z)), V(void 0);
4746
+ property: F,
4747
+ newPropertiesOrder: D
4748
+ }), ce(D), E(!1), h && (_(D.indexOf(z)), B(z)), j(void 0);
4749
4749
  }, fe = ({
4750
4750
  id: z,
4751
- property: E,
4752
- previousId: M,
4751
+ property: F,
4752
+ previousId: D,
4753
4753
  namespace: oe
4754
4754
  }) => {
4755
4755
  const ne = z ? se(z, oe) : void 0, be = ne ? we(ne) : void 0;
4756
- if (M && M !== z) {
4757
- const ht = se(M, oe), et = we(ht), Ue = ae(oe).map((ue) => ue === M ? z : ue).filter((ue) => ue !== void 0);
4758
- ce(Ue, oe), z && (_(Ue.indexOf(z)), I(z)), g(et, void 0, !1), f(et, !1, !1);
4756
+ if (D && D !== z) {
4757
+ const ht = se(D, oe), et = we(ht), Ue = ae(oe).map((ue) => ue === D ? z : ue).filter((ue) => ue !== void 0);
4758
+ ce(Ue, oe), z && (_(Ue.indexOf(z)), B(z)), g(et, void 0, !1), b(et, !1, !1);
4759
4759
  }
4760
- be && (g(be, E, !1), f(be, !0, !1));
4761
- }, W = (z, E, M) => {
4762
- const oe = z ? se(z, E) : void 0;
4760
+ be && (g(be, F, !1), b(be, !0, !1));
4761
+ }, W = (z, F, D) => {
4762
+ const oe = z ? se(z, F) : void 0;
4763
4763
  if (console.warn("onPropertyErrorInternal", {
4764
4764
  id: z,
4765
- namespace: E,
4766
- error: M,
4765
+ namespace: F,
4766
+ error: D,
4767
4767
  propertyPath: oe
4768
4768
  }), oe) {
4769
- const ne = M && Object.keys(M).length > 0;
4770
- r(z, E, ne ? M : void 0), y(we(oe), ne ? "Property error" : void 0);
4769
+ const ne = D && Object.keys(D).length > 0;
4770
+ r(z, F, ne ? D : void 0), y(we(oe), ne ? "Property error" : void 0);
4771
4771
  }
4772
4772
  }, Ie = () => {
4773
- _(void 0), I(void 0);
4773
+ _(void 0), B(void 0);
4774
4774
  }, Xe = T && i?.current?.properties ? i.current.properties[T] : void 0, ut = l?.propertiesOrder === void 0 || l.propertiesOrder.length === 0, A = l.propertiesOrder ? l.propertiesOrder : Object.keys(l.properties), H = Ut(() => c(l.ownerId), [c, l.ownerId]), $ = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4775
4775
  /* @__PURE__ */ n("div", { className: _e(
4776
4776
  "p-4 md:p-8 pb-20 md:pb-20",
@@ -4794,7 +4794,7 @@ function Ri({
4794
4794
  }
4795
4795
  ),
4796
4796
  H && /* @__PURE__ */ n(
4797
- O,
4797
+ P,
4798
4798
  {
4799
4799
  variant: "body2",
4800
4800
  className: "ml-2",
@@ -4809,19 +4809,19 @@ function Ri({
4809
4809
  p && /* @__PURE__ */ e("div", { className: "ml-4", children: p }),
4810
4810
  /* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
4811
4811
  Y && /* @__PURE__ */ e(ie, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
4812
- D,
4812
+ R,
4813
4813
  {
4814
4814
  variant: "text",
4815
- disabled: R,
4815
+ disabled: V,
4816
4816
  onClick: Y,
4817
- children: R ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(pt, {})
4817
+ children: V ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(pt, {})
4818
4818
  }
4819
4819
  ) }),
4820
4820
  /* @__PURE__ */ e(ie, { title: "Add new property", children: /* @__PURE__ */ e(
4821
- D,
4821
+ R,
4822
4822
  {
4823
4823
  variant: "outlined",
4824
- onClick: () => j(!0),
4824
+ onClick: () => E(!0),
4825
4825
  children: /* @__PURE__ */ e(Ne, {})
4826
4826
  }
4827
4827
  ) })
@@ -4831,8 +4831,8 @@ function Ri({
4831
4831
  mt,
4832
4832
  {
4833
4833
  className: "pl-8",
4834
- onPropertyClick: (z, E) => {
4835
- _(A.indexOf(z)), I(z), V(E);
4834
+ onPropertyClick: (z, F) => {
4835
+ _(A.indexOf(z)), B(z), j(F);
4836
4836
  },
4837
4837
  inferredPropertyKeys: ke,
4838
4838
  selectedPropertyKey: T ? se(T, w) : void 0,
@@ -4845,13 +4845,13 @@ function Ri({
4845
4845
  }
4846
4846
  ) }),
4847
4847
  /* @__PURE__ */ e(
4848
- D,
4848
+ R,
4849
4849
  {
4850
4850
  className: "mt-8 w-full",
4851
4851
  color: "primary",
4852
4852
  variant: "outlined",
4853
4853
  size: "large",
4854
- onClick: () => j(!0),
4854
+ onClick: () => E(!0),
4855
4855
  startIcon: /* @__PURE__ */ e(Ne, {}),
4856
4856
  children: "Add new property"
4857
4857
  }
@@ -4862,7 +4862,7 @@ function Ri({
4862
4862
  {
4863
4863
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
4864
4864
  children: [
4865
- P && S && !de(S) && /* @__PURE__ */ e(
4865
+ N && O && !de(O) && /* @__PURE__ */ e(
4866
4866
  sa,
4867
4867
  {
4868
4868
  inArray: !1,
@@ -4872,7 +4872,7 @@ function Ri({
4872
4872
  autoOpenTypeSelect: !1,
4873
4873
  propertyKey: T,
4874
4874
  propertyNamespace: w,
4875
- property: S,
4875
+ property: O,
4876
4876
  onPropertyChanged: fe,
4877
4877
  onDelete: re,
4878
4878
  onError: W,
@@ -4881,10 +4881,10 @@ function Ri({
4881
4881
  getData: m,
4882
4882
  customFields: d
4883
4883
  },
4884
- `edit_view_${b}`
4884
+ `edit_view_${f}`
4885
4885
  ),
4886
- !S && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center h-full", children: ut ? "Now you can add your first property" : "Select a property to edit it" }),
4887
- S && de(S) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
4886
+ !O && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children: ut ? "Now you can add your first property" : "Select a property to edit it" }),
4887
+ O && de(O) && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
4888
4888
  ]
4889
4889
  }
4890
4890
  ) }),
@@ -4892,14 +4892,14 @@ function Ri({
4892
4892
  Ve,
4893
4893
  {
4894
4894
  inArray: !1,
4895
- open: b !== void 0,
4895
+ open: f !== void 0,
4896
4896
  autoUpdateId: a,
4897
4897
  allowDataInference: !a,
4898
4898
  existingProperty: !0,
4899
4899
  autoOpenTypeSelect: !1,
4900
4900
  propertyKey: T,
4901
4901
  propertyNamespace: w,
4902
- property: S,
4902
+ property: O,
4903
4903
  onPropertyChanged: fe,
4904
4904
  onDelete: re,
4905
4905
  onError: W,
@@ -4909,10 +4909,10 @@ function Ri({
4909
4909
  customFields: d,
4910
4910
  onOkClicked: v ? Ie : void 0
4911
4911
  },
4912
- `edit_view_${b}`
4912
+ `edit_view_${f}`
4913
4913
  )
4914
4914
  ] });
4915
- return /* @__PURE__ */ n(F, { children: [
4915
+ return /* @__PURE__ */ n(I, { children: [
4916
4916
  $,
4917
4917
  /* @__PURE__ */ e(
4918
4918
  Ve,
@@ -4923,7 +4923,7 @@ function Ri({
4923
4923
  autoUpdateId: !0,
4924
4924
  forceShowErrors: t,
4925
4925
  open: q,
4926
- onCancel: () => j(!1),
4926
+ onCancel: () => E(!1),
4927
4927
  onPropertyChanged: xe,
4928
4928
  getData: m,
4929
4929
  allowDataInference: !a,
@@ -4949,13 +4949,13 @@ function Ui({
4949
4949
  "aria-describedby": "alert-dialog-description",
4950
4950
  children: [
4951
4951
  /* @__PURE__ */ n(Ge, { children: [
4952
- /* @__PURE__ */ e(O, { variant: "h6", children: o ?? "Unsaved changes" }),
4953
- r && /* @__PURE__ */ e(O, { children: r }),
4954
- /* @__PURE__ */ e(O, { children: "Are you sure?" })
4952
+ /* @__PURE__ */ e(P, { variant: "h6", children: o ?? "Unsaved changes" }),
4953
+ r && /* @__PURE__ */ e(P, { children: r }),
4954
+ /* @__PURE__ */ e(P, { children: "Are you sure?" })
4955
4955
  ] }),
4956
4956
  /* @__PURE__ */ n(Qe, { children: [
4957
- /* @__PURE__ */ e(D, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
4958
- /* @__PURE__ */ e(D, { onClick: a, children: " Ok " })
4957
+ /* @__PURE__ */ e(R, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
4958
+ /* @__PURE__ */ e(R, { onClick: a, children: " Ok " })
4959
4959
  ] })
4960
4960
  ]
4961
4961
  }
@@ -4970,9 +4970,9 @@ function $i({ open: t, onClose: a }) {
4970
4970
  open: t,
4971
4971
  children: [
4972
4972
  /* @__PURE__ */ n(Ge, { children: [
4973
- /* @__PURE__ */ e(O, { variant: "h6", children: "Select view" }),
4973
+ /* @__PURE__ */ e(P, { variant: "h6", children: "Select view" }),
4974
4974
  i?.map((r) => /* @__PURE__ */ n(
4975
- D,
4975
+ R,
4976
4976
  {
4977
4977
  onClick: () => a(r.key),
4978
4978
  fullWidth: !0,
@@ -4987,7 +4987,7 @@ function $i({ open: t, onClose: a }) {
4987
4987
  r.key
4988
4988
  ))
4989
4989
  ] }),
4990
- /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(D, { onClick: () => a(), children: "Cancel" }) })
4990
+ /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(R, { onClick: () => a(), children: "Cancel" }) })
4991
4991
  ]
4992
4992
  }
4993
4993
  );
@@ -5000,21 +5000,21 @@ function Li({
5000
5000
  getUser: o,
5001
5001
  parentPathSegments: s
5002
5002
  }) {
5003
- const { entityViews: p } = qe(), [c, m] = U.useState(), [u, d] = U.useState(!1), [l, g] = U.useState(), [y, f] = U.useState(), {
5003
+ const { entityViews: p } = qe(), [c, m] = U.useState(), [u, d] = U.useState(!1), [l, g] = U.useState(), [y, b] = U.useState(), {
5004
5004
  values: k,
5005
5005
  setFieldValue: C
5006
- } = K(), x = t.subcollections ?? [], h = k.entityViews?.filter((_) => typeof _ == "string").map((_) => ja(_, p)).filter(Boolean) ?? [], v = t.entityViews?.filter((_) => typeof _ != "string") ?? [], b = h.length + v.length;
5006
+ } = K(), x = t.subcollections ?? [], h = k.entityViews?.filter((_) => typeof _ == "string").map((_) => ja(_, p)).filter(Boolean) ?? [], v = t.entityViews?.filter((_) => typeof _ != "string") ?? [], f = h.length + v.length;
5007
5007
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5008
5008
  /* @__PURE__ */ e(dt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5009
5009
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5010
- /* @__PURE__ */ n(O, { variant: "h5", children: [
5010
+ /* @__PURE__ */ n(P, { variant: "h5", children: [
5011
5011
  "Subcollections of ",
5012
5012
  k.name
5013
5013
  ] }),
5014
5014
  x && x.length > 0 && /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(Vt, { children: x.map((_) => /* @__PURE__ */ n(
5015
5015
  gt,
5016
5016
  {
5017
- onClick: () => f({
5017
+ onClick: () => b({
5018
5018
  isNewCollection: !1,
5019
5019
  editedCollectionPath: _.path
5020
5020
  }),
@@ -5023,7 +5023,7 @@ function Li({
5023
5023
  $e,
5024
5024
  {
5025
5025
  align: "left",
5026
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: _.name })
5026
+ children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: _.name })
5027
5027
  }
5028
5028
  ),
5029
5029
  /* @__PURE__ */ e(
@@ -5048,10 +5048,10 @@ function Li({
5048
5048
  _.path
5049
5049
  )) }) }) }),
5050
5050
  /* @__PURE__ */ e(
5051
- D,
5051
+ R,
5052
5052
  {
5053
5053
  onClick: () => {
5054
- f({
5054
+ b({
5055
5055
  isNewCollection: !0
5056
5056
  });
5057
5057
  },
@@ -5062,14 +5062,14 @@ function Li({
5062
5062
  )
5063
5063
  ] }),
5064
5064
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5065
- /* @__PURE__ */ e(O, { variant: "h5", children: "Custom views" }),
5066
- b > 0 && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ n(Vt, { children: [
5065
+ /* @__PURE__ */ e(P, { variant: "h5", children: "Custom views" }),
5066
+ f > 0 && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ n(Vt, { children: [
5067
5067
  h.map((_) => /* @__PURE__ */ n(gt, { children: [
5068
5068
  /* @__PURE__ */ e(
5069
5069
  $e,
5070
5070
  {
5071
5071
  align: "left",
5072
- children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: _.name })
5072
+ children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: _.name })
5073
5073
  }
5074
5074
  ),
5075
5075
  /* @__PURE__ */ e(
@@ -5095,8 +5095,8 @@ function Li({
5095
5095
  {
5096
5096
  align: "left",
5097
5097
  children: [
5098
- /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: _.name }),
5099
- /* @__PURE__ */ n(O, { variant: "caption", className: "flex-grow", children: [
5098
+ /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: _.name }),
5099
+ /* @__PURE__ */ n(P, { variant: "caption", className: "flex-grow", children: [
5100
5100
  "This view is defined in code with key ",
5101
5101
  /* @__PURE__ */ e("code", { children: _.key })
5102
5102
  ] })
@@ -5104,9 +5104,9 @@ function Li({
5104
5104
  }
5105
5105
  ) }, _.key))
5106
5106
  ] }) }) }) }),
5107
- b === 0 && /* @__PURE__ */ e(Wt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
5107
+ f === 0 && /* @__PURE__ */ e(Wt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
5108
5108
  /* @__PURE__ */ e(
5109
- D,
5109
+ R,
5110
5110
  {
5111
5111
  onClick: () => {
5112
5112
  d(!0);
@@ -5129,8 +5129,8 @@ function Li({
5129
5129
  }), m(void 0);
5130
5130
  },
5131
5131
  onCancel: () => m(void 0),
5132
- title: /* @__PURE__ */ e(F, { children: "Delete this subcollection?" }),
5133
- body: /* @__PURE__ */ n(F, { children: [
5132
+ title: /* @__PURE__ */ e(I, { children: "Delete this subcollection?" }),
5133
+ body: /* @__PURE__ */ n(I, { children: [
5134
5134
  " This will ",
5135
5135
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5136
5136
  ", only the collection in the CMS"
@@ -5145,8 +5145,8 @@ function Li({
5145
5145
  C("entityViews", k.entityViews?.filter((_) => _ !== l)), g(void 0);
5146
5146
  },
5147
5147
  onCancel: () => g(void 0),
5148
- title: /* @__PURE__ */ e(F, { children: "Remove this view?" }),
5149
- body: /* @__PURE__ */ n(F, { children: [
5148
+ title: /* @__PURE__ */ e(I, { children: "Remove this view?" }),
5149
+ body: /* @__PURE__ */ n(I, { children: [
5150
5150
  "This will ",
5151
5151
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5152
5152
  ", only the view in the CMS"
@@ -5165,7 +5165,7 @@ function Li({
5165
5165
  ...y,
5166
5166
  getUser: o,
5167
5167
  handleClose: () => {
5168
- f(void 0);
5168
+ b(void 0);
5169
5169
  }
5170
5170
  }
5171
5171
  ),
@@ -5419,7 +5419,7 @@ function Ki({
5419
5419
  const [s, p] = Q(!1), [c, m] = Q();
5420
5420
  pe(() => {
5421
5421
  a && o && (p(!0), a(t).then((h) => {
5422
- const v = h.filter((b) => !o.find((_) => _.path.trim().toLowerCase() === b.trim().toLowerCase()));
5422
+ const v = h.filter((f) => !o.find((_) => _.path.trim().toLowerCase() === f.trim().toLowerCase()));
5423
5423
  m(v);
5424
5424
  }).finally(() => p(!1)));
5425
5425
  }, [o, t, a]);
@@ -5429,7 +5429,7 @@ function Ki({
5429
5429
  setValues: l,
5430
5430
  handleChange: g,
5431
5431
  touched: y,
5432
- errors: f,
5432
+ errors: b,
5433
5433
  setFieldTouched: k,
5434
5434
  isSubmitting: C,
5435
5435
  submitCount: x
@@ -5439,16 +5439,16 @@ function Ki({
5439
5439
  "div",
5440
5440
  {
5441
5441
  className: "flex flex-row py-2 pt-3 items-center",
5442
- children: /* @__PURE__ */ e(O, { variant: "h4", className: "flex-grow", children: "New collection" })
5442
+ children: /* @__PURE__ */ e(P, { variant: "h4", className: "flex-grow", children: "New collection" })
5443
5443
  }
5444
5444
  ),
5445
- i && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(O, { variant: "caption", children: [
5445
+ i && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
5446
5446
  "This is a subcollection of ",
5447
5447
  /* @__PURE__ */ e("b", { children: i.name })
5448
5448
  ] }) }),
5449
5449
  /* @__PURE__ */ n("div", { className: "my-2", children: [
5450
5450
  /* @__PURE__ */ e(
5451
- O,
5451
+ P,
5452
5452
  {
5453
5453
  variant: "caption",
5454
5454
  color: "secondary",
@@ -5469,12 +5469,12 @@ function Ki({
5469
5469
  },
5470
5470
  h
5471
5471
  )),
5472
- !s && c?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
5472
+ !s && c?.length === 0 && /* @__PURE__ */ e(P, { variant: "caption", children: "No suggestions" })
5473
5473
  ] })
5474
5474
  ] }),
5475
5475
  /* @__PURE__ */ n("div", { className: "my-2", children: [
5476
5476
  /* @__PURE__ */ e(
5477
- O,
5477
+ P,
5478
5478
  {
5479
5479
  variant: "caption",
5480
5480
  color: "secondary",
@@ -5519,7 +5519,7 @@ function Ki({
5519
5519
  ] }),
5520
5520
  !i && /* @__PURE__ */ n("div", { children: [
5521
5521
  /* @__PURE__ */ e(
5522
- O,
5522
+ P,
5523
5523
  {
5524
5524
  variant: "caption",
5525
5525
  color: "secondary",
@@ -5529,7 +5529,7 @@ function Ki({
5529
5529
  ),
5530
5530
  /* @__PURE__ */ e(ai, { onDataAdded: (h) => r(h) })
5531
5531
  ] }),
5532
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(D, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5532
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(R, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5533
5533
  ] }) });
5534
5534
  }
5535
5535
  function yt({
@@ -5556,7 +5556,7 @@ function yt({
5556
5556
  "div",
5557
5557
  {
5558
5558
  className: "flex flex-col items-start",
5559
- children: /* @__PURE__ */ e(O, { variant: "subtitle1", children: t })
5559
+ children: /* @__PURE__ */ e(P, { variant: "subtitle1", children: t })
5560
5560
  }
5561
5561
  )
5562
5562
  ]
@@ -5598,40 +5598,40 @@ function Gi({
5598
5598
  } = K(), [s, p] = Q(void 0), c = U.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = s ? s.id : void 0, u = s || void 0, d = ({
5599
5599
  id: g,
5600
5600
  property: y,
5601
- previousId: f,
5601
+ previousId: b,
5602
5602
  namespace: k
5603
5603
  }) => {
5604
- const C = g ? se(g, k) : void 0, x = C ? we(C) : void 0, h = (b) => b ? c.current[b] ?? N(o, Oe(b)) : c.current[""], v = (b, _) => {
5604
+ const C = g ? se(g, k) : void 0, x = C ? we(C) : void 0, h = (f) => f ? c.current[f] ?? S(o, Oe(f)) : c.current[""], v = (f, _) => {
5605
5605
  const T = Oe(_);
5606
- i(T, b, !1), c.current[_ ?? ""] = b;
5606
+ i(T, f, !1), c.current[_ ?? ""] = f;
5607
5607
  };
5608
- if (f && f !== g) {
5609
- const b = se(f, k), _ = we(b), I = h(k).map((V) => V === f ? g : V).filter((V) => V !== void 0);
5610
- v(I, k);
5608
+ if (b && b !== g) {
5609
+ const f = se(b, k), _ = we(f), B = h(k).map((j) => j === b ? g : j).filter((j) => j !== void 0);
5610
+ v(B, k);
5611
5611
  const w = { ...t.headersMapping };
5612
- Object.keys(w).forEach((V) => {
5613
- w[V] === f && (w[V] = g ?? "");
5612
+ Object.keys(w).forEach((j) => {
5613
+ w[j] === b && (w[j] = g ?? "");
5614
5614
  }), t.setHeadersMapping(w), i(_, void 0, !1), r(_, !1, !1);
5615
5615
  }
5616
5616
  x && (i(x, y, !1), r(x, !0, !1));
5617
5617
  }, l = async ({
5618
5618
  id: g,
5619
5619
  importKey: y,
5620
- property: f,
5620
+ property: b,
5621
5621
  namespace: k
5622
5622
  }) => {
5623
- const C = g ? se(g, k) : void 0, x = C ? we(C) : void 0, h = t.importData.map((b) => N(b, y)), v = {
5624
- ...Ja(h, f, aa),
5623
+ const C = g ? se(g, k) : void 0, x = C ? we(C) : void 0, h = t.importData.map((f) => S(f, y)), v = {
5624
+ ...Ja(h, b, aa),
5625
5625
  editable: !0
5626
5626
  };
5627
5627
  x && (v ? (console.log("updating inferredNewProperty", {
5628
- property: f,
5628
+ property: b,
5629
5629
  inferredNewProperty: v
5630
- }), i(x, v, !1)) : i(x, f, !1), r(x, !0, !1));
5630
+ }), i(x, v, !1)) : i(x, b, !1), r(x, !0, !1));
5631
5631
  };
5632
5632
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
5633
5633
  /* @__PURE__ */ n(dt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5634
- /* @__PURE__ */ e(O, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5634
+ /* @__PURE__ */ e(P, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5635
5635
  /* @__PURE__ */ e(
5636
5636
  ii,
5637
5637
  {
@@ -5643,7 +5643,7 @@ function Gi({
5643
5643
  buildPropertyView: ({
5644
5644
  property: g,
5645
5645
  propertyKey: y,
5646
- importKey: f
5646
+ importKey: b
5647
5647
  }) => /* @__PURE__ */ e(
5648
5648
  ri,
5649
5649
  {
@@ -5664,7 +5664,7 @@ function Gi({
5664
5664
  disabled: !1,
5665
5665
  onPropertyChanged: (k) => l({
5666
5666
  ...k,
5667
- importKey: f
5667
+ importKey: b
5668
5668
  }),
5669
5669
  propertyKey: y,
5670
5670
  customFields: a
@@ -5724,7 +5724,7 @@ function Qi({
5724
5724
  value: p ?? "",
5725
5725
  placeholder: "Select a property widget",
5726
5726
  position: "item-aligned",
5727
- renderValue: (d) => c ? /* @__PURE__ */ e(We, { fieldConfig: c }) : null,
5727
+ renderValue: (d) => c ? /* @__PURE__ */ e(We, { propertyConfig: c }) : null,
5728
5728
  onValueChange: (d) => {
5729
5729
  const l = oa(t, d, r);
5730
5730
  i && (a({
@@ -5739,7 +5739,7 @@ function Qi({
5739
5739
  {
5740
5740
  value: d,
5741
5741
  optionDisabled: !1,
5742
- fieldConfig: l,
5742
+ propertyConfig: l,
5743
5743
  existing: !1
5744
5744
  },
5745
5745
  d
@@ -5759,8 +5759,8 @@ function Zi({ importConfig: t, properties: a, propertiesOrder: i }) {
5759
5759
  Fa,
5760
5760
  {
5761
5761
  title: /* @__PURE__ */ n("div", { children: [
5762
- /* @__PURE__ */ e(O, { variant: "subtitle2", children: "Imported data preview" }),
5763
- /* @__PURE__ */ e(O, { variant: "caption", children: "Entities with the same id will be overwritten" })
5762
+ /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Imported data preview" }),
5763
+ /* @__PURE__ */ e(P, { variant: "caption", children: "Entities with the same id will be overwritten" })
5764
5764
  ] }),
5765
5765
  tableController: {
5766
5766
  data: t.entities,
@@ -5860,18 +5860,18 @@ function Ji({
5860
5860
  setFormDirty: l,
5861
5861
  pathSuggestions: g,
5862
5862
  getUser: y,
5863
- parentCollection: f,
5863
+ parentCollection: b,
5864
5864
  getData: k
5865
5865
  }) {
5866
5866
  const { fields: C } = qe(), x = De(), {
5867
5867
  topLevelNavigation: h,
5868
5868
  collections: v
5869
- } = x, b = !a?.path && (o ?? []).length === 0, _ = (f ? f.subcollections : v) ?? [], T = _.map((A) => A.path.trim().toLowerCase()), I = _.map((A) => A.alias?.trim().toLowerCase()).filter(Boolean), w = si();
5869
+ } = x, f = !a?.path && (o ?? []).length === 0, _ = (b ? b.subcollections : v) ?? [], T = _.map((A) => A.path.trim().toLowerCase()), B = _.map((A) => A.alias?.trim().toLowerCase()).filter(Boolean), w = si();
5870
5870
  if (!h)
5871
5871
  throw Error("Internal: Navigation not ready in collection editor");
5872
5872
  const {
5873
- groups: V
5874
- } = h, P = Ze(), S = Re(), R = Le({}), te = t ? b ? "welcome" : "details" : "properties", [q, j] = Q(te), [ke, Se] = ve.useState(), [B, Y] = ve.useState(), [ae, ce] = ve.useState(!1), [re, Fe] = ve.useState();
5873
+ groups: j
5874
+ } = h, N = Ze(), O = Re(), V = Le({}), te = t ? f ? "welcome" : "details" : "properties", [q, E] = Q(te), [ke, Se] = ve.useState(), [M, Y] = ve.useState(), [ae, ce] = ve.useState(!1), [re, Fe] = ve.useState();
5875
5875
  pe(() => {
5876
5876
  try {
5877
5877
  x.initialised && (Y(r ? x.getCollectionFromPaths([...o ?? [], r]) : void 0), ce(!0));
@@ -5886,27 +5886,27 @@ function Ji({
5886
5886
  collectionData: A,
5887
5887
  previousPath: r,
5888
5888
  parentPathSegments: o
5889
- }).then(() => (Se(void 0), !0)).catch(($) => (Se($), console.error($), P.open({
5889
+ }).then(() => (Se(void 0), !0)).catch(($) => (Se($), console.error($), N.open({
5890
5890
  type: "error",
5891
5891
  message: "Error persisting collection: " + ($.message ?? "Details in the console")
5892
5892
  }), !1));
5893
- }, fe = B ?? {
5893
+ }, fe = M ?? {
5894
5894
  path: a?.path ?? "",
5895
5895
  name: a?.name ?? "",
5896
5896
  group: a?.group ?? "",
5897
5897
  properties: {},
5898
5898
  propertiesOrder: [],
5899
5899
  icon: vt[Math.floor(Math.random() * vt.length)],
5900
- ownerId: S.user?.uid ?? ""
5900
+ ownerId: O.user?.uid ?? ""
5901
5901
  }, W = J(() => {
5902
- q === "details" ? w.inUse ? j("import_data_saving") : j(u ? "extra_view" : "properties") : j(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
5902
+ q === "details" ? w.inUse ? E("import_data_saving") : E(u ? "extra_view" : "properties") : E(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
5903
5903
  }, [q, w.inUse, u]), Ie = J((A) => {
5904
5904
  if (p)
5905
5905
  return p?.(A.path, A.collectionGroup ?? !1, o ?? []);
5906
5906
  }, [p, o]), Xe = J(async (A) => {
5907
5907
  if (!Ie)
5908
5908
  return Y(A), Promise.resolve(A);
5909
- j("loading");
5909
+ E("loading");
5910
5910
  const H = await Ie?.(A);
5911
5911
  if (!H)
5912
5912
  return Y(A), Promise.resolve(A);
@@ -5939,7 +5939,7 @@ function Ji({
5939
5939
  H.resetForm({ values: fe }), W(), c(A);
5940
5940
  }) : (W(), H.resetForm({ values: A }));
5941
5941
  } catch ($) {
5942
- P.open({
5942
+ N.open({
5943
5943
  type: "error",
5944
5944
  message: "Error persisting collection: " + ($.message ?? "Details in the console")
5945
5945
  }), console.error($), H.resetForm({ values: A });
@@ -5952,7 +5952,7 @@ function Ji({
5952
5952
  validationSchema: (q === "properties" || q === "subcollections" || q === "details") && di,
5953
5953
  validate: () => {
5954
5954
  if (q === "properties")
5955
- return R.current;
5955
+ return V.current;
5956
5956
  },
5957
5957
  onSubmit: ut,
5958
5958
  children: ({
@@ -5960,9 +5960,9 @@ function Ji({
5960
5960
  setFieldValue: H,
5961
5961
  isSubmitting: $,
5962
5962
  dirty: z,
5963
- submitCount: E
5963
+ submitCount: F
5964
5964
  }) => {
5965
- const M = A.path ?? r, oe = s?.includes("/") ? s?.split("/").slice(0, -1).join("/") + "/" + M : M, ne = oe && k ? () => k(oe) : void 0;
5965
+ const D = A.path ?? r, oe = s?.includes("/") ? s?.split("/").slice(0, -1).join("/") + "/" + D : D, ne = oe && k ? () => k(oe) : void 0;
5966
5966
  pe(() => {
5967
5967
  l(z);
5968
5968
  }, [z]);
@@ -5979,13 +5979,13 @@ function Ji({
5979
5979
  properties: X
5980
5980
  });
5981
5981
  };
5982
- return /* @__PURE__ */ n(F, { children: [
5982
+ return /* @__PURE__ */ n(I, { children: [
5983
5983
  !t && /* @__PURE__ */ n(
5984
5984
  Ba,
5985
5985
  {
5986
5986
  value: q,
5987
5987
  className: _e(xt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
5988
- onValueChange: (X) => j(X),
5988
+ onValueChange: (X) => E(X),
5989
5989
  children: [
5990
5990
  /* @__PURE__ */ e(ft, { value: "details", children: "Details" }),
5991
5991
  /* @__PURE__ */ e(ft, { value: "properties", children: "Properties" }),
@@ -6003,16 +6003,16 @@ function Ji({
6003
6003
  ),
6004
6004
  children: [
6005
6005
  q === "loading" && /* @__PURE__ */ e(jt, {}),
6006
- q === "extra_view" && M && u?.View && /* @__PURE__ */ e(u.View, { path: M }),
6006
+ q === "extra_view" && D && u?.View && /* @__PURE__ */ e(u.View, { path: D }),
6007
6007
  q === "welcome" && /* @__PURE__ */ e(
6008
6008
  Ki,
6009
6009
  {
6010
- path: M,
6010
+ path: D,
6011
6011
  onContinue: (X) => {
6012
- X ? (be(X), j("import_data_mapping")) : j("details");
6012
+ X ? (be(X), E("import_data_mapping")) : E("details");
6013
6013
  },
6014
6014
  collections: v,
6015
- parentCollection: f,
6015
+ parentCollection: b,
6016
6016
  pathSuggestions: g
6017
6017
  }
6018
6018
  ),
@@ -6037,7 +6037,7 @@ function Ji({
6037
6037
  importConfig: w,
6038
6038
  collection: A,
6039
6039
  onImportSuccess: (X) => {
6040
- c(X), P.open({
6040
+ c(X), N.open({
6041
6041
  type: "info",
6042
6042
  message: "Data imported successfully"
6043
6043
  });
@@ -6048,32 +6048,32 @@ function Ji({
6048
6048
  ui,
6049
6049
  {
6050
6050
  existingPaths: T,
6051
- existingAliases: I,
6052
- groups: V,
6053
- parentCollection: f,
6051
+ existingAliases: B,
6052
+ groups: j,
6053
+ parentCollection: b,
6054
6054
  isNewCollection: t
6055
6055
  }
6056
6056
  ),
6057
- q === "subcollections" && B && /* @__PURE__ */ e(
6057
+ q === "subcollections" && M && /* @__PURE__ */ e(
6058
6058
  Li,
6059
6059
  {
6060
- parentCollection: f,
6060
+ parentCollection: b,
6061
6061
  configController: i,
6062
6062
  getUser: y,
6063
6063
  collectionInference: p,
6064
6064
  parentPathSegments: o,
6065
- collection: B
6065
+ collection: M
6066
6066
  }
6067
6067
  ),
6068
6068
  q === "properties" && /* @__PURE__ */ e(
6069
6069
  Ri,
6070
6070
  {
6071
- showErrors: E > 0,
6071
+ showErrors: F > 0,
6072
6072
  isNewCollection: t,
6073
6073
  reservedGroups: m,
6074
6074
  onPropertyError: (X, Ue, ue) => {
6075
- R.current = Ma({
6076
- ...R.current,
6075
+ V.current = Ma({
6076
+ ...V.current,
6077
6077
  [X]: ue
6078
6078
  }, !0);
6079
6079
  },
@@ -6085,7 +6085,7 @@ function Ji({
6085
6085
  me,
6086
6086
  {
6087
6087
  color: "primary",
6088
- onClick: () => j("extra_view"),
6088
+ onClick: () => E("extra_view"),
6089
6089
  children: u.icon
6090
6090
  }
6091
6091
  )
@@ -6097,25 +6097,25 @@ function Ji({
6097
6097
  position: "absolute",
6098
6098
  children: [
6099
6099
  ke && /* @__PURE__ */ e(ta, { error: ke }),
6100
- t && b && q === "import_data_mapping" && /* @__PURE__ */ n(
6101
- D,
6100
+ t && f && q === "import_data_mapping" && /* @__PURE__ */ n(
6101
+ R,
6102
6102
  {
6103
6103
  variant: "text",
6104
6104
  type: "button",
6105
- onClick: () => (w.setInUse(!1), j("welcome")),
6105
+ onClick: () => (w.setInUse(!1), E("welcome")),
6106
6106
  children: [
6107
6107
  /* @__PURE__ */ e(tt, {}),
6108
6108
  "Back"
6109
6109
  ]
6110
6110
  }
6111
6111
  ),
6112
- t && b && q === "import_data_preview" && /* @__PURE__ */ n(
6113
- D,
6112
+ t && f && q === "import_data_preview" && /* @__PURE__ */ n(
6113
+ R,
6114
6114
  {
6115
6115
  variant: "text",
6116
6116
  type: "button",
6117
6117
  onClick: () => {
6118
- xe(A), j("import_data_mapping");
6118
+ xe(A), E("import_data_mapping");
6119
6119
  },
6120
6120
  children: [
6121
6121
  /* @__PURE__ */ e(tt, {}),
@@ -6123,12 +6123,12 @@ function Ji({
6123
6123
  ]
6124
6124
  }
6125
6125
  ),
6126
- t && b && q === "details" && /* @__PURE__ */ n(
6127
- D,
6126
+ t && f && q === "details" && /* @__PURE__ */ n(
6127
+ R,
6128
6128
  {
6129
6129
  variant: "text",
6130
6130
  type: "button",
6131
- onClick: () => j("welcome"),
6131
+ onClick: () => E("welcome"),
6132
6132
  children: [
6133
6133
  /* @__PURE__ */ e(tt, {}),
6134
6134
  "Back"
@@ -6136,11 +6136,11 @@ function Ji({
6136
6136
  }
6137
6137
  ),
6138
6138
  t && q === "properties" && /* @__PURE__ */ n(
6139
- D,
6139
+ R,
6140
6140
  {
6141
6141
  variant: "text",
6142
6142
  type: "button",
6143
- onClick: () => j("details"),
6143
+ onClick: () => E("details"),
6144
6144
  children: [
6145
6145
  /* @__PURE__ */ e(tt, {}),
6146
6146
  "Back"
@@ -6148,7 +6148,7 @@ function Ji({
6148
6148
  }
6149
6149
  ),
6150
6150
  /* @__PURE__ */ e(
6151
- D,
6151
+ R,
6152
6152
  {
6153
6153
  variant: "text",
6154
6154
  onClick: () => {
@@ -6158,7 +6158,7 @@ function Ji({
6158
6158
  }
6159
6159
  ),
6160
6160
  t && q === "import_data_mapping" && /* @__PURE__ */ e(
6161
- D,
6161
+ R,
6162
6162
  {
6163
6163
  variant: "filled",
6164
6164
  color: "primary",
@@ -6167,7 +6167,7 @@ function Ji({
6167
6167
  }
6168
6168
  ),
6169
6169
  t && q === "import_data_preview" && /* @__PURE__ */ e(
6170
- D,
6170
+ R,
6171
6171
  {
6172
6172
  variant: "filled",
6173
6173
  color: "primary",
@@ -6226,69 +6226,69 @@ const da = U.createContext({}), pa = U.createContext({}), Wi = U.memo(
6226
6226
  getData: u
6227
6227
  }) {
6228
6228
  const d = De(), l = ci(), g = Ze(), { fields: y } = qe(), {
6229
- collections: f
6230
- } = d, k = f.map((S) => S.path.trim().toLowerCase()), [C, x] = U.useState();
6229
+ collections: b
6230
+ } = d, k = b.map((O) => O.path.trim().toLowerCase()), [C, x] = U.useState();
6231
6231
  pe(() => {
6232
- c && c().then((S) => {
6233
- x(S.filter((R) => !k.includes(R.trim().toLowerCase())));
6232
+ c && c().then((O) => {
6233
+ x(O.filter((V) => !k.includes(V.trim().toLowerCase())));
6234
6234
  });
6235
6235
  }, [c]);
6236
- const [h, v] = U.useState(), [b, _] = U.useState(), T = J(() => ({
6236
+ const [h, v] = U.useState(), [f, _] = U.useState(), T = J(() => ({
6237
6237
  createCollections: !0,
6238
6238
  editCollections: !0,
6239
6239
  deleteCollections: !0
6240
- }), []), I = J(({
6241
- path: S,
6242
- fullPath: R,
6240
+ }), []), B = J(({
6241
+ path: O,
6242
+ fullPath: V,
6243
6243
  parentPathSegments: te,
6244
6244
  parentCollection: q
6245
6245
  }) => {
6246
6246
  v({
6247
- editedCollectionPath: S,
6248
- fullPath: R,
6247
+ editedCollectionPath: O,
6248
+ fullPath: V,
6249
6249
  parentPathSegments: te,
6250
6250
  isNewCollection: !1,
6251
6251
  parentCollection: q,
6252
6252
  redirect: !1
6253
6253
  });
6254
6254
  }, []), w = J(({
6255
- propertyKey: S,
6256
- property: R,
6255
+ propertyKey: O,
6256
+ property: V,
6257
6257
  editedCollectionPath: te,
6258
6258
  currentPropertiesOrder: q,
6259
- parentPathSegments: j,
6259
+ parentPathSegments: E,
6260
6260
  parentCollection: ke
6261
6261
  }) => {
6262
- const Se = S && S.includes(".") ? S.substring(0, S.lastIndexOf(".")) : void 0, B = S && S.includes(".") ? S.substring(S.lastIndexOf(".") + 1) : S;
6262
+ const Se = O && O.includes(".") ? O.substring(0, O.lastIndexOf(".")) : void 0, M = O && O.includes(".") ? O.substring(O.lastIndexOf(".") + 1) : O;
6263
6263
  _({
6264
- propertyKey: B,
6265
- property: R,
6264
+ propertyKey: M,
6265
+ property: V,
6266
6266
  namespace: Se,
6267
6267
  currentPropertiesOrder: q,
6268
6268
  editedCollectionPath: te,
6269
- parentPathSegments: j,
6269
+ parentPathSegments: E,
6270
6270
  parentCollection: ke
6271
6271
  });
6272
- }, []), V = U.useCallback(({
6273
- parentPathSegments: S,
6274
- parentCollection: R,
6272
+ }, []), j = U.useCallback(({
6273
+ parentPathSegments: O,
6274
+ parentCollection: V,
6275
6275
  initialValues: te,
6276
6276
  redirect: q
6277
6277
  }) => {
6278
6278
  v({
6279
6279
  isNewCollection: !0,
6280
- parentPathSegments: S,
6281
- parentCollection: R,
6280
+ parentPathSegments: O,
6281
+ parentCollection: V,
6282
6282
  initialValues: te,
6283
6283
  redirect: q
6284
6284
  });
6285
- }, []), P = c ? (S) => !S && C ? Promise.resolve(C) : c?.(S) : void 0;
6285
+ }, []), N = c ? (O) => !O && C ? Promise.resolve(C) : c?.(O) : void 0;
6286
6286
  return /* @__PURE__ */ e(da.Provider, { value: i, children: /* @__PURE__ */ n(
6287
6287
  pa.Provider,
6288
6288
  {
6289
6289
  value: {
6290
- editCollection: I,
6291
- createCollection: V,
6290
+ editCollection: B,
6291
+ createCollection: j,
6292
6292
  editProperty: w,
6293
6293
  configPermissions: r ?? T,
6294
6294
  rootPathSuggestions: C
@@ -6306,12 +6306,12 @@ const da = U.createContext({}), pa = U.createContext({}), Wi = U.memo(
6306
6306
  getData: u,
6307
6307
  reservedGroups: o,
6308
6308
  extraView: p,
6309
- pathSuggestions: P,
6309
+ pathSuggestions: N,
6310
6310
  getUser: m,
6311
- handleClose: (S) => {
6312
- if (h?.redirect && S && h?.isNewCollection && !h.parentPathSegments.length) {
6313
- const R = d.buildUrlCollectionPath(S.alias ?? S.path);
6314
- l(R);
6311
+ handleClose: (O) => {
6312
+ if (h?.redirect && O && h?.isNewCollection && !h.parentPathSegments.length) {
6313
+ const V = d.buildUrlCollectionPath(O.alias ?? O.path);
6314
+ l(V);
6315
6315
  }
6316
6316
  v(void 0);
6317
6317
  }
@@ -6320,27 +6320,27 @@ const da = U.createContext({}), pa = U.createContext({}), Wi = U.memo(
6320
6320
  /* @__PURE__ */ e(
6321
6321
  Ve,
6322
6322
  {
6323
- open: !!b,
6323
+ open: !!f,
6324
6324
  includeIdAndName: !0,
6325
- existingProperty: !!b?.propertyKey,
6326
- autoUpdateId: b ? !b?.propertyKey : !1,
6327
- autoOpenTypeSelect: b ? !b?.propertyKey : !1,
6325
+ existingProperty: !!f?.propertyKey,
6326
+ autoUpdateId: f ? !f?.propertyKey : !1,
6327
+ autoOpenTypeSelect: f ? !f?.propertyKey : !1,
6328
6328
  inArray: !1,
6329
6329
  getData: u && h?.fullPath ? () => u(h.fullPath) : void 0,
6330
6330
  onPropertyChanged: ({
6331
- id: S,
6332
- property: R
6331
+ id: O,
6332
+ property: V
6333
6333
  }) => {
6334
- if (!b || !S)
6334
+ if (!f || !O)
6335
6335
  return;
6336
- const te = !b.propertyKey;
6336
+ const te = !f.propertyKey;
6337
6337
  return i.saveProperty({
6338
- path: b?.editedCollectionPath,
6339
- property: R,
6340
- propertyKey: S,
6341
- newPropertiesOrder: te && b.currentPropertiesOrder ? [...b.currentPropertiesOrder, S] : void 0,
6342
- namespace: b.namespace,
6343
- parentPathSegments: b.parentPathSegments
6338
+ path: f?.editedCollectionPath,
6339
+ property: V,
6340
+ propertyKey: O,
6341
+ newPropertiesOrder: te && f.currentPropertiesOrder ? [...f.currentPropertiesOrder, O] : void 0,
6342
+ namespace: f.namespace,
6343
+ parentPathSegments: f.parentPathSegments
6344
6344
  }).catch((q) => (console.error(q), g.open({
6345
6345
  type: "error",
6346
6346
  message: "Error persisting property: " + (q.message ?? "Details in the console")
@@ -6348,6 +6348,21 @@ const da = U.createContext({}), pa = U.createContext({}), Wi = U.memo(
6348
6348
  },
6349
6349
  onPropertyChangedImmediate: !1,
6350
6350
  onDelete: () => {
6351
+ if (!f?.propertyKey)
6352
+ return;
6353
+ const O = f?.currentPropertiesOrder?.filter((V) => V !== f?.propertyKey);
6354
+ return i.deleteProperty({
6355
+ path: f?.editedCollectionPath,
6356
+ propertyKey: f?.propertyKey,
6357
+ namespace: f?.namespace,
6358
+ newPropertiesOrder: O,
6359
+ parentPathSegments: f?.parentPathSegments
6360
+ }).then(() => {
6361
+ _(void 0);
6362
+ }).catch((V) => (console.error(V), g.open({
6363
+ type: "error",
6364
+ message: "Error deleting property: " + (V.message ?? "Details in the console")
6365
+ }), !1));
6351
6366
  },
6352
6367
  onError: () => {
6353
6368
  },
@@ -6362,8 +6377,8 @@ const da = U.createContext({}), pa = U.createContext({}), Wi = U.memo(
6362
6377
  existingPropertyKeys: [],
6363
6378
  allowDataInference: !0,
6364
6379
  customFields: y,
6365
- property: b?.property,
6366
- propertyKey: b?.propertyKey
6380
+ property: f?.property,
6381
+ propertyKey: f?.propertyKey
6367
6382
  }
6368
6383
  )
6369
6384
  ]
@@ -6388,7 +6403,7 @@ function Xi({
6388
6403
  {
6389
6404
  title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
6390
6405
  children: /* @__PURE__ */ e(
6391
- D,
6406
+ R,
6392
6407
  {
6393
6408
  color: "primary",
6394
6409
  size: "small",
@@ -6413,7 +6428,7 @@ function Xi({
6413
6428
  }
6414
6429
  )
6415
6430
  }
6416
- )), /* @__PURE__ */ n(F, { children: [
6431
+ )), /* @__PURE__ */ n(I, { children: [
6417
6432
  d && l,
6418
6433
  /* @__PURE__ */ e(
6419
6434
  ie,
@@ -6447,7 +6462,7 @@ function er({
6447
6462
  }, [o, t]), [c, m] = Q(!1), u = J(() => {
6448
6463
  r?.deleteCollection({ path: t });
6449
6464
  }, [t, r]);
6450
- return /* @__PURE__ */ n(F, { children: [
6465
+ return /* @__PURE__ */ n(I, { children: [
6451
6466
  /* @__PURE__ */ n("div", { children: [
6452
6467
  s.deleteCollections && /* @__PURE__ */ e(
6453
6468
  Ua,
@@ -6477,8 +6492,8 @@ function er({
6477
6492
  open: c,
6478
6493
  onAccept: u,
6479
6494
  onCancel: () => m(!1),
6480
- title: /* @__PURE__ */ e(F, { children: "Delete this collection?" }),
6481
- body: /* @__PURE__ */ n(F, { children: [
6495
+ title: /* @__PURE__ */ e(I, { children: "Delete this collection?" }),
6496
+ body: /* @__PURE__ */ n(I, { children: [
6482
6497
  " This will ",
6483
6498
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
6484
6499
  ", only the collection in the CMS"
@@ -6512,7 +6527,7 @@ function tr({
6512
6527
  children: [
6513
6528
  /* @__PURE__ */ e(Ne, { color: "primary" }),
6514
6529
  /* @__PURE__ */ e(
6515
- O,
6530
+ P,
6516
6531
  {
6517
6532
  color: "primary",
6518
6533
  variant: "caption",
@@ -6520,7 +6535,7 @@ function tr({
6520
6535
  children: "Add new collection".toUpperCase()
6521
6536
  }
6522
6537
  ),
6523
- !o && /* @__PURE__ */ e(O, { variant: "caption", children: "You don't have permissions to create collections" })
6538
+ !o && /* @__PURE__ */ e(P, { variant: "caption", children: "You don't have permissions to create collections" })
6524
6539
  ]
6525
6540
  }
6526
6541
  )
@@ -6540,7 +6555,7 @@ function ar() {
6540
6555
  {
6541
6556
  className: "flex flex-col gap-1 p-2",
6542
6557
  children: [
6543
- /* @__PURE__ */ e(O, { variant: "body2", color: "secondary", children: "Create a collection from your data:" }),
6558
+ /* @__PURE__ */ e(P, { variant: "body2", color: "secondary", children: "Create a collection from your data:" }),
6544
6559
  /* @__PURE__ */ e(
6545
6560
  "div",
6546
6561
  {
@@ -6714,7 +6729,7 @@ function yr({ path: t }) {
6714
6729
  return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
6715
6730
  /* @__PURE__ */ e(ta, { error: "No collection for path: " + a }),
6716
6731
  /* @__PURE__ */ e(
6717
- D,
6732
+ R,
6718
6733
  {
6719
6734
  className: "mx-2",
6720
6735
  variant: "outlined",