@firecms/collection_editor 3.0.0-alpha.50 → 3.0.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { jsxs as n, Fragment as M, jsx as e } from "react/jsx-runtime";
2
2
  import * as we from "react";
3
- import L, { useState as $, useEffect as pe, useMemo as Yt, useCallback as X, useRef as He, useDeferredValue as fa, useContext as Gt } from "react";
4
- import { iconKeys as Ht, debounce as ba, SearchBar as ya, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as va, Container as ht, Chip as dt, TextField as Te, cn as ke, DebouncedTextField as H, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as Pt, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Jt, Dialog as Ee, toSnakeCase as Ct, singular as ka, ListIcon as xa, Button as B, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Ca, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Oa, isValidRegExp as Pa, RuleIcon as Na, useSnackbarController as De, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as Tt, Checkbox as Vt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Pe, FieldConfigBadge as Xe, cardMixin as Qt, cardClickableMixin as Wt, cardSelectedMixin as Zt, FunctionsIcon as za, RemoveCircleIcon as Ta, defaultBorderMixin as Nt, RemoveIcon as Va, DragHandleIcon as Ia, AddIcon as Ae, useNavigationController as Be, SelectGroup as It, mergeDeep as Y, getFieldId as Xt, DEFAULT_FIELD_CONFIGS as Ot, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Fa, useLargeLayout as ja, CodeIcon as Ea, makePropertiesEditable as et, resolveEntityView as Da, Table as Ft, TableBody as jt, TableRow as wt, TableCell as Ge, unslugify as St, Card as ta, useSelectionController as Ba, EntityCollectionTable as Ma, slugify as Ra, useAuthController as Ye, randomString as Et, CircularProgressCenter as Dt, Tabs as Ua, Tab as _t, removeUndefined as $a, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Bt, DoneIcon as La, SaveIcon as Ka, Menu as Ya, MoreVertIcon as Ga, MenuItem as Ha, Collapse as Ja, getDefaultPropertiesOrder as Qa, joinCollectionLists as Wa } from "@firecms/core";
3
+ import L, { useState as $, useEffect as pe, useMemo as Kt, useCallback as X, useRef as He, useDeferredValue as ba, useContext as Yt } from "react";
4
+ import { iconKeys as Gt, debounce as ya, SearchBar as va, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as wa, Container as ht, Chip as dt, TextField as Te, cn as ke, DebouncedTextField as H, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as B, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Pa, isValidRegExp as Na, RuleIcon as Sa, useSnackbarController as De, resolveEnumValues as qa, FileUploadIcon as Aa, MultiSelect as za, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Pe, FieldConfigBadge as Xe, cardMixin as Jt, cardClickableMixin as Qt, cardSelectedMixin as Wt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Pt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as Y, DEFAULT_FIELD_CONFIGS as Zt, getFieldId as Xt, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as ja, useLargeLayout as Ea, CodeIcon as Da, makePropertiesEditable as et, resolveEntityView as Ba, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Nt, Card as ta, useSelectionController as Ma, EntityCollectionTable as Ra, slugify as Ua, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as $a, Tab as _t, removeUndefined as La, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as Ka, SaveIcon as Ya, Menu as Ga, MoreVertIcon as Ha, MenuItem as Ja, Collapse as Qa, getDefaultPropertiesOrder as Wa, joinCollectionLists as Za } from "@firecms/core";
5
5
  import ut from "react-fast-compare";
6
- import { useFormikContext as K, Field as be, getIn as P, Formik as qt, FastField as de, Form as Za } from "formik";
6
+ import { useFormikContext as K, Field as be, getIn as P, Formik as St, FastField as de, Form as Xa } from "formik";
7
7
  import * as ot from "yup";
8
- import * as Xa from "js-search";
9
- import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ai } from "@firecms/schema_inference";
10
- import { DragDropContext as ii, Droppable as ri, Draggable as oi } from "@hello-pangea/dnd";
11
- import ni from "json5";
12
- import { Highlight as si, themes as li } from "prism-react-renderer";
13
- import { ImportFileUpload as ci, DataNewPropertiesMapping as di, ImportNewPropertyFieldPreview as pi, getInferenceType as ia, getPropertiesMapping as mi, convertDataToEntity as ui, useImportConfig as hi, ImportSaveInProgress as gi } from "@firecms/data_import_export";
14
- import { useNavigate as fi } from "react-router";
15
- const bi = ot.object().shape({
8
+ import * as ei from "js-search";
9
+ import { extractEnumFromValues as ti, buildPropertyFromData as ai, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
10
+ import { DragDropContext as ri, Droppable as oi, Draggable as ni } from "@hello-pangea/dnd";
11
+ import si from "json5";
12
+ import { Highlight as li, themes as ci } from "prism-react-renderer";
13
+ import { ImportFileUpload as di, DataNewPropertiesMapping as pi, ImportNewPropertyFieldPreview as mi, getInferenceType as ia, getPropertiesMapping as ui, convertDataToEntity as hi, useImportConfig as gi, ImportSaveInProgress as fi } from "@firecms/data_import_export";
14
+ import { useNavigate as bi } from "react-router";
15
+ const yi = ot.object().shape({
16
16
  id: ot.string().required("Required"),
17
17
  name: ot.string().required("Required"),
18
18
  path: ot.string().required("Required")
@@ -1965,34 +1965,34 @@ const bi = ot.object().shape({
1965
1965
  zoom_in_map: "arrows destination location maps move place stop",
1966
1966
  zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
1967
1967
  zoom_out_map: "arrows destination location maps move place stop"
1968
- }, At = new Xa.Search("key");
1969
- At.addIndex("synonyms");
1970
- At.addDocuments(Ht.map((t) => ({
1968
+ }, qt = new ei.Search("key");
1969
+ qt.addIndex("synonyms");
1970
+ qt.addDocuments(Gt.map((t) => ({
1971
1971
  key: t,
1972
1972
  // @ts-ignore
1973
1973
  synonyms: ra[t] ?? []
1974
1974
  })));
1975
- const yi = 220;
1975
+ const vi = 220;
1976
1976
  process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
1977
- Ht.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1977
+ Gt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1978
1978
  });
1979
- function vi({ selectedIcon: t = "", onIconSelected: a }) {
1979
+ function wi({ selectedIcon: t = "", onIconSelected: a }) {
1980
1980
  const [i, r] = we.useState(null), [s, o] = we.useState(""), l = we.useMemo(
1981
- () => ba((m) => {
1981
+ () => ya((m) => {
1982
1982
  if (!m || m === "")
1983
1983
  r(null);
1984
1984
  else {
1985
- const u = At.search(m);
1985
+ const u = qt.search(m);
1986
1986
  r(u.map((c) => c.key));
1987
1987
  }
1988
- }, yi),
1988
+ }, vi),
1989
1989
  []
1990
1990
  );
1991
1991
  return we.useEffect(() => (l(s), () => {
1992
1992
  l.clear();
1993
1993
  }), [s, l]), /* @__PURE__ */ n(M, { children: [
1994
1994
  /* @__PURE__ */ e(
1995
- ya,
1995
+ va,
1996
1996
  {
1997
1997
  autoFocus: !0,
1998
1998
  className: "w-full sticky top-0 z-10",
@@ -2018,7 +2018,7 @@ function ie({
2018
2018
  }) {
2019
2019
  return a ? /* @__PURE__ */ e(C, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2020
2020
  }
2021
- function wi({
2021
+ function _i({
2022
2022
  isNewCollection: t,
2023
2023
  reservedGroups: a,
2024
2024
  existingPaths: i,
@@ -2036,7 +2036,7 @@ function wi({
2036
2036
  isSubmitting: g,
2037
2037
  submitCount: b
2038
2038
  } = K(), [O, k] = $(!1), [x, h] = $(!1), _ = (v) => {
2039
- m("name", v), !P(c, "path") && t && v && m("path", Ct(v)), !P(c, "id") && t && v && m("id", Ct(v)), !P(c, "singularName") && t && v && m("singularName", ka(v));
2039
+ m("name", v), !P(c, "path") && t && v && m("path", Ct(v)), !P(c, "id") && t && v && m("id", Ct(v)), !P(c, "singularName") && t && v && m("singularName", xa(v));
2040
2040
  };
2041
2041
  pe(() => {
2042
2042
  d.id && h(!0);
@@ -2045,7 +2045,7 @@ function wi({
2045
2045
  inputFocused: q,
2046
2046
  autoCompleteOpen: F,
2047
2047
  setAutoCompleteOpen: A
2048
- } = va({
2048
+ } = wa({
2049
2049
  ref: l
2050
2050
  }), S = !!o;
2051
2051
  let E;
@@ -2116,12 +2116,12 @@ function wi({
2116
2116
  }
2117
2117
  ),
2118
2118
  /* @__PURE__ */ e(
2119
- wa,
2119
+ _a,
2120
2120
  {
2121
2121
  open: F && (w ?? []).length > 0,
2122
2122
  setOpen: A,
2123
2123
  children: w?.map((v, V) => /* @__PURE__ */ e(
2124
- _a,
2124
+ ka,
2125
2125
  {
2126
2126
  onClick: () => {
2127
2127
  A(!1), m("group", v ?? null);
@@ -2135,7 +2135,7 @@ function wi({
2135
2135
  /* @__PURE__ */ e(ie, { children: c.group && d.group ? d.group : "Group of the collection" })
2136
2136
  ] }),
2137
2137
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2138
- Pt,
2138
+ Ot,
2139
2139
  {
2140
2140
  expanded: x,
2141
2141
  onExpandedChange: h,
@@ -2237,7 +2237,7 @@ function wi({
2237
2237
  ) }),
2238
2238
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2239
2239
  /* @__PURE__ */ e(
2240
- Jt,
2240
+ Ht,
2241
2241
  {
2242
2242
  position: "start",
2243
2243
  label: "Collection group",
@@ -2260,7 +2260,7 @@ function wi({
2260
2260
  maxWidth: "xl",
2261
2261
  fullWidth: !0,
2262
2262
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
2263
- vi,
2263
+ wi,
2264
2264
  {
2265
2265
  selectedIcon: p.icon,
2266
2266
  onIconSelected: (v) => {
@@ -2275,7 +2275,7 @@ function wi({
2275
2275
  function _e(t) {
2276
2276
  return "properties." + t.replaceAll(".", ".properties.");
2277
2277
  }
2278
- function _i(t) {
2278
+ function ki(t) {
2279
2279
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
2280
2280
  }
2281
2281
  function Ne(t) {
@@ -2284,7 +2284,7 @@ function Ne(t) {
2284
2284
  function ce(t, a) {
2285
2285
  return a ? `${a}.${t}` : t;
2286
2286
  }
2287
- const ki = L.memo(
2287
+ const xi = L.memo(
2288
2288
  function({
2289
2289
  enumValues: a,
2290
2290
  onValuesChanged: i,
@@ -2295,7 +2295,7 @@ const ki = L.memo(
2295
2295
  getData: p
2296
2296
  }) {
2297
2297
  return /* @__PURE__ */ e(
2298
- qt,
2298
+ St,
2299
2299
  {
2300
2300
  initialValues: { enumValues: a },
2301
2301
  validateOnMount: !0,
@@ -2309,7 +2309,7 @@ const ki = L.memo(
2309
2309
  }, [m.enumValues]), pe(() => {
2310
2310
  r && r(!!(u?.enumValues ?? !1));
2311
2311
  }, [u]), /* @__PURE__ */ e(
2312
- xi,
2312
+ Ci,
2313
2313
  {
2314
2314
  enumValuesPath: "enumValues",
2315
2315
  values: m,
@@ -2327,7 +2327,7 @@ const ki = L.memo(
2327
2327
  return a.enumValues.length === i.enumValues.length && a.onValuesChanged === i.onValuesChanged && a.getData === i.getData;
2328
2328
  }
2329
2329
  );
2330
- function xi({
2330
+ function Ci({
2331
2331
  values: t,
2332
2332
  errors: a,
2333
2333
  disabled: i,
@@ -2341,7 +2341,7 @@ function xi({
2341
2341
  } = K(), [m, u] = L.useState(), [c, d] = L.useState(), [f, g] = L.useState(!1), O = L.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
2342
2342
  const y = m === _;
2343
2343
  return /* @__PURE__ */ e(
2344
- Ci,
2344
+ Oi,
2345
2345
  {
2346
2346
  index: h,
2347
2347
  disabled: i,
@@ -2356,7 +2356,7 @@ function xi({
2356
2356
  };
2357
2357
  return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2358
2358
  /* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
2359
- /* @__PURE__ */ e(xa, {}),
2359
+ /* @__PURE__ */ e(Ca, {}),
2360
2360
  /* @__PURE__ */ e(
2361
2361
  C,
2362
2362
  {
@@ -2376,7 +2376,7 @@ function xi({
2376
2376
  l && (g(!0), l?.().then((h) => {
2377
2377
  if (!h)
2378
2378
  return;
2379
- const _ = h.flat(), y = Array.from(new Set(_)), w = t.enumValues, F = ei(y).filter((A) => !w?.some((S) => S.id === A.id));
2379
+ const _ = h.flat(), y = Array.from(new Set(_)), w = t.enumValues, F = ti(y).filter((A) => !w?.some((S) => S.id === A.id));
2380
2380
  F.forEach((A) => {
2381
2381
  O.add(A.id);
2382
2382
  }), p(r, [...F, ...w]);
@@ -2393,7 +2393,7 @@ function xi({
2393
2393
  ] }),
2394
2394
  /* @__PURE__ */ n(qe, { className: "p-4 m-1", children: [
2395
2395
  /* @__PURE__ */ e(
2396
- Ca,
2396
+ Oa,
2397
2397
  {
2398
2398
  value: t.enumValues,
2399
2399
  addLabel: "Add enum value",
@@ -2407,7 +2407,7 @@ function xi({
2407
2407
  }
2408
2408
  ),
2409
2409
  /* @__PURE__ */ e(
2410
- Oi,
2410
+ Pi,
2411
2411
  {
2412
2412
  index: c,
2413
2413
  open: c !== void 0,
@@ -2418,7 +2418,7 @@ function xi({
2418
2418
  ] })
2419
2419
  ] });
2420
2420
  }
2421
- const Ci = L.memo(
2421
+ const Oi = L.memo(
2422
2422
  function({
2423
2423
  index: a,
2424
2424
  shouldUpdateId: i,
@@ -2447,7 +2447,7 @@ const Ci = L.memo(
2447
2447
  required: !0,
2448
2448
  disabled: l,
2449
2449
  size: "small",
2450
- validate: Pi,
2450
+ validate: Ni,
2451
2451
  autoFocus: s,
2452
2452
  autoComplete: "off",
2453
2453
  endAdornment: p && /* @__PURE__ */ e(gt, { size: "small" }),
@@ -2470,7 +2470,7 @@ const Ci = L.memo(
2470
2470
  return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
2471
2471
  }
2472
2472
  );
2473
- function Oi({
2473
+ function Pi({
2474
2474
  index: t,
2475
2475
  open: a,
2476
2476
  onClose: i,
@@ -2498,7 +2498,7 @@ function Oi({
2498
2498
  name: `${r}[${t}]id`,
2499
2499
  as: H,
2500
2500
  required: !0,
2501
- validate: Ni,
2501
+ validate: Si,
2502
2502
  label: "ID",
2503
2503
  size: "small",
2504
2504
  autoComplete: "off",
@@ -2521,11 +2521,11 @@ function Oi({
2521
2521
  }
2522
2522
  );
2523
2523
  }
2524
- function Pi(t) {
2524
+ function Ni(t) {
2525
2525
  let a;
2526
2526
  return t || (a = "You must specify a label"), a;
2527
2527
  }
2528
- function Ni(t) {
2528
+ function Si(t) {
2529
2529
  let a;
2530
2530
  return t || (a = "You must specify an ID"), a;
2531
2531
  }
@@ -2582,7 +2582,7 @@ function Ue({
2582
2582
  values: u,
2583
2583
  handleChange: c,
2584
2584
  errors: d
2585
- } = K(), f = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(d, k), y = P(u, k), w = typeof y == "string" ? y : Oa(y);
2585
+ } = K(), f = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(d, k), y = P(u, k), w = typeof y == "string" ? y : Pa(y);
2586
2586
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2587
2587
  /* @__PURE__ */ e(Me, { disabled: p }),
2588
2588
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -2661,7 +2661,7 @@ function Ue({
2661
2661
  {
2662
2662
  name: k,
2663
2663
  as: H,
2664
- validate: (q) => q && !Pa(q),
2664
+ validate: (q) => q && !Na(q),
2665
2665
  label: "Matches regex",
2666
2666
  size: "small",
2667
2667
  disabled: p,
@@ -2673,7 +2673,7 @@ function Ue({
2673
2673
  ] })
2674
2674
  ] });
2675
2675
  }
2676
- function zt({
2676
+ function At({
2677
2677
  max: t = !0,
2678
2678
  min: a = !0,
2679
2679
  disabled: i
@@ -2714,13 +2714,13 @@ function ze({
2714
2714
  children: t
2715
2715
  }) {
2716
2716
  return /* @__PURE__ */ e(
2717
- Pt,
2717
+ Ot,
2718
2718
  {
2719
2719
  initiallyExpanded: !1,
2720
2720
  asField: !0,
2721
2721
  className: "p-4",
2722
2722
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2723
- /* @__PURE__ */ e(Na, {}),
2723
+ /* @__PURE__ */ e(Sa, {}),
2724
2724
  /* @__PURE__ */ e(
2725
2725
  C,
2726
2726
  {
@@ -2734,7 +2734,7 @@ function ze({
2734
2734
  }
2735
2735
  );
2736
2736
  }
2737
- function Mt({
2737
+ function Bt({
2738
2738
  multiselect: t,
2739
2739
  updateIds: a,
2740
2740
  disabled: i,
@@ -2749,10 +2749,10 @@ function Mt({
2749
2749
  touched: u,
2750
2750
  setFieldError: c,
2751
2751
  setFieldValue: d
2752
- } = K(), f = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), k = Yt(() => !O || typeof O == "boolean" ? [] : Sa(O) ?? [], [O]);
2752
+ } = K(), f = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), k = Kt(() => !O || typeof O == "boolean" ? [] : qa(O) ?? [], [O]);
2753
2753
  return /* @__PURE__ */ n(M, { children: [
2754
2754
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2755
- ki,
2755
+ xi,
2756
2756
  {
2757
2757
  enumValues: k,
2758
2758
  updateIds: a,
@@ -2781,7 +2781,7 @@ function Mt({
2781
2781
  showErrors: r
2782
2782
  }
2783
2783
  ),
2784
- t && /* @__PURE__ */ e(zt, { disabled: i })
2784
+ t && /* @__PURE__ */ e(At, { disabled: i })
2785
2785
  ] }) }),
2786
2786
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2787
2787
  Se,
@@ -2812,7 +2812,7 @@ const nt = {
2812
2812
  "application/*": "Files (pdf, zip, csv, excel...)",
2813
2813
  "text/*": "Text files"
2814
2814
  };
2815
- function Rt({
2815
+ function Mt({
2816
2816
  multiple: t,
2817
2817
  existing: a,
2818
2818
  disabled: i
@@ -2825,10 +2825,10 @@ function Rt({
2825
2825
  }, k = typeof c == "function", x = typeof d == "function";
2826
2826
  return /* @__PURE__ */ n(M, { children: [
2827
2827
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2828
- Pt,
2828
+ Ot,
2829
2829
  {
2830
2830
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2831
- /* @__PURE__ */ e(qa, {}),
2831
+ /* @__PURE__ */ e(Aa, {}),
2832
2832
  /* @__PURE__ */ e(
2833
2833
  C,
2834
2834
  {
@@ -2840,7 +2840,7 @@ function Rt({
2840
2840
  ] }),
2841
2841
  children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
2842
2842
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
2843
- Aa,
2843
+ za,
2844
2844
  {
2845
2845
  disabled: i,
2846
2846
  name: l,
@@ -2849,18 +2849,18 @@ function Rt({
2849
2849
  label: b ? void 0 : "Allowed file types",
2850
2850
  renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((_) => nt[_]).filter((_) => !!_).join(", "),
2851
2851
  children: [
2852
- /* @__PURE__ */ n(Tt, { value: "all", className: "flex items-center gap-2", children: [
2852
+ /* @__PURE__ */ n(zt, { value: "all", className: "flex items-center gap-2", children: [
2853
2853
  /* @__PURE__ */ e(
2854
- Vt,
2854
+ Tt,
2855
2855
  {
2856
2856
  checked: !g
2857
2857
  }
2858
2858
  ),
2859
2859
  "All"
2860
2860
  ] }, "all"),
2861
- Object.entries(nt).map(([h, _]) => /* @__PURE__ */ n(Tt, { value: h, className: "flex items-center gap-2", children: [
2861
+ Object.entries(nt).map(([h, _]) => /* @__PURE__ */ n(zt, { value: h, className: "flex items-center gap-2", children: [
2862
2862
  /* @__PURE__ */ e(
2863
- Vt,
2863
+ Tt,
2864
2864
  {
2865
2865
  checked: b || g.indexOf(h) > -1
2866
2866
  }
@@ -2932,7 +2932,7 @@ function Rt({
2932
2932
  ) }),
2933
2933
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
2934
2934
  !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Me, { disabled: i }) }),
2935
- t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zt, { disabled: i }) })
2935
+ t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(At, { disabled: i }) })
2936
2936
  ] }) })
2937
2937
  ] });
2938
2938
  }
@@ -2944,14 +2944,14 @@ function Je(t) {
2944
2944
  return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
2945
2945
  }
2946
2946
  }
2947
- function Si(t) {
2947
+ function qi(t) {
2948
2948
  return Object.entries(t).filter(([a, i]) => Je(i)).map(([a, i]) => {
2949
2949
  const r = i;
2950
2950
  if (Je(r))
2951
2951
  return r.dataType === "map" && r.properties ? {
2952
2952
  [a]: {
2953
2953
  ...r,
2954
- properties: Si(r.properties)
2954
+ properties: qi(r.properties)
2955
2955
  }
2956
2956
  } : { [a]: r };
2957
2957
  }).filter((a) => !!a).reduce((a, i) => ({ ...a, ...i }), {});
@@ -2977,9 +2977,9 @@ function oa({
2977
2977
  {
2978
2978
  className: ke(
2979
2979
  "pl-2 w-full flex flex-row gap-4 items-center",
2980
- Qt,
2981
- a ? Wt : "",
2982
- o ? Zt : "",
2980
+ Jt,
2981
+ a ? Qt : "",
2982
+ o ? Wt : "",
2983
2983
  "flex-grow p-4 border transition-colors duration-200",
2984
2984
  i ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
2985
2985
  ),
@@ -3024,7 +3024,7 @@ function oa({
3024
3024
  }
3025
3025
  ) });
3026
3026
  }
3027
- function qi({
3027
+ function Ai({
3028
3028
  name: t,
3029
3029
  selected: a,
3030
3030
  onClick: i,
@@ -3043,19 +3043,19 @@ function qi({
3043
3043
  "div",
3044
3044
  {
3045
3045
  className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
3046
- children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
3046
+ children: /* @__PURE__ */ e(Ta, { color: "inherit", size: "medium" })
3047
3047
  }
3048
3048
  ),
3049
- /* @__PURE__ */ e(Ta, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3049
+ /* @__PURE__ */ e(Va, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3050
3050
  ] }),
3051
3051
  /* @__PURE__ */ e(
3052
3052
  qe,
3053
3053
  {
3054
3054
  className: ke(
3055
3055
  "pl-2 w-full flex flex-row gap-4 items-center",
3056
- Qt,
3057
- i ? Wt : "",
3058
- a ? Zt : "",
3056
+ Jt,
3057
+ i ? Qt : "",
3058
+ a ? Wt : "",
3059
3059
  "flex-grow p-4 border transition-colors duration-200",
3060
3060
  a ? "border-blue-500" : "border-transparent"
3061
3061
  ),
@@ -3135,7 +3135,7 @@ function ft({
3135
3135
  const O = b.source.index, k = b.destination.index, x = Array.from(f), [h] = x.splice(O, 1);
3136
3136
  x.splice(k, 0, h), p && p(x, t);
3137
3137
  }, [t, p, f]);
3138
- return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ii, { onDragEnd: g, children: /* @__PURE__ */ e(ri, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3138
+ return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ri, { onDragEnd: g, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3139
3139
  "div",
3140
3140
  {
3141
3141
  ...b.droppableProps,
@@ -3145,12 +3145,12 @@ function ft({
3145
3145
  f && f.map((k, x) => {
3146
3146
  const h = r[k], _ = o?.find((y) => y.key === k);
3147
3147
  return !h && !_ ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3148
- oi,
3148
+ ni,
3149
3149
  {
3150
3150
  draggableId: `array_field_${t}_${k}}`,
3151
3151
  index: x,
3152
3152
  children: (y, w) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3153
- Ai,
3153
+ zi,
3154
3154
  {
3155
3155
  propertyKey: k,
3156
3156
  propertyOrBuilder: h,
@@ -3175,7 +3175,7 @@ function ft({
3175
3175
  }
3176
3176
  ) }) }) });
3177
3177
  }
3178
- function Ai({
3178
+ function zi({
3179
3179
  propertyKey: t,
3180
3180
  namespace: a,
3181
3181
  propertyOrBuilder: i,
@@ -3220,7 +3220,7 @@ function Ai({
3220
3220
  b && /* @__PURE__ */ e(
3221
3221
  "div",
3222
3222
  {
3223
- className: "absolute border-l " + Nt,
3223
+ className: "absolute border-l " + Pt,
3224
3224
  style: {
3225
3225
  left: "32px",
3226
3226
  top: "64px",
@@ -3238,7 +3238,7 @@ function Ai({
3238
3238
  hasError: O
3239
3239
  }
3240
3240
  ) : /* @__PURE__ */ e(
3241
- qi,
3241
+ Ai,
3242
3242
  {
3243
3243
  name: t,
3244
3244
  property: i,
@@ -3254,7 +3254,7 @@ function Ai({
3254
3254
  size: "small",
3255
3255
  color: "inherit",
3256
3256
  onClick: () => u(t, a),
3257
- children: /* @__PURE__ */ e(Va, { size: "small" })
3257
+ children: /* @__PURE__ */ e(Ia, { size: "small" })
3258
3258
  }
3259
3259
  ) }),
3260
3260
  m && /* @__PURE__ */ e(re, { title: "Move", children: /* @__PURE__ */ e(
@@ -3262,7 +3262,7 @@ function Ai({
3262
3262
  {
3263
3263
  component: "span",
3264
3264
  size: "small",
3265
- children: /* @__PURE__ */ e(Ia, { size: "small" })
3265
+ children: /* @__PURE__ */ e(Fa, { size: "small" })
3266
3266
  }
3267
3267
  ) })
3268
3268
  ] }),
@@ -3271,7 +3271,7 @@ function Ai({
3271
3271
  }
3272
3272
  );
3273
3273
  }
3274
- function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3274
+ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3275
3275
  const {
3276
3276
  values: o,
3277
3277
  setFieldValue: l
@@ -3289,7 +3289,7 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3289
3289
  const F = w ? ce(w, q) : void 0;
3290
3290
  if (!F)
3291
3291
  throw Error("collection editor miss config");
3292
- const A = _e(F), S = Ne(q), E = P(o, S) ?? Object.keys(P(o, _i(q)));
3292
+ const A = _e(F), S = Ne(q), E = P(o, S) ?? Object.keys(P(o, ki(q)));
3293
3293
  l(A, void 0, !1), l(S, E.filter((v) => v !== w), !1), m(!1), c(void 0), f(void 0);
3294
3294
  }, [l, o]), k = u ? ce(u, d) : void 0, x = k ? P(o.properties, k.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
3295
3295
  B,
@@ -3338,7 +3338,7 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3338
3338
  ] }),
3339
3339
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3340
3340
  /* @__PURE__ */ e(
3341
- Jt,
3341
+ Ht,
3342
3342
  {
3343
3343
  position: "start",
3344
3344
  size: "small",
@@ -3378,7 +3378,7 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3378
3378
  )
3379
3379
  ] });
3380
3380
  }
3381
- function Ti({
3381
+ function Vi({
3382
3382
  showErrors: t,
3383
3383
  existing: a,
3384
3384
  disabled: i,
@@ -3453,10 +3453,10 @@ function Ti({
3453
3453
  }
3454
3454
  )
3455
3455
  ] }),
3456
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(zt, { disabled: i }) }) })
3456
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(At, { disabled: i }) }) })
3457
3457
  ] });
3458
3458
  }
3459
- const Vi = L.forwardRef(
3459
+ const Ii = L.forwardRef(
3460
3460
  function({
3461
3461
  showErrors: a,
3462
3462
  disabledId: i,
@@ -3476,7 +3476,7 @@ const Vi = L.forwardRef(
3476
3476
  name: m,
3477
3477
  as: H,
3478
3478
  style: { fontSize: 20 },
3479
- validate: ji,
3479
+ validate: Ei,
3480
3480
  placeholder: "Field name",
3481
3481
  required: !0,
3482
3482
  disabled: s,
@@ -3492,7 +3492,7 @@ const Vi = L.forwardRef(
3492
3492
  name: c,
3493
3493
  as: Te,
3494
3494
  label: "ID",
3495
- validate: (b) => Fi(b, r),
3495
+ validate: (b) => ji(b, r),
3496
3496
  disabled: i || s,
3497
3497
  required: !0,
3498
3498
  size: "small",
@@ -3516,16 +3516,16 @@ const Vi = L.forwardRef(
3516
3516
  ] })
3517
3517
  ] });
3518
3518
  }
3519
- ), Ii = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3520
- function Fi(t, a) {
3519
+ ), Fi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3520
+ function ji(t, a) {
3521
3521
  let i;
3522
- return t || (i = "You must specify an id for the field"), t && !t.match(Ii) && (i = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (i = "There is another field with this ID already"), i;
3522
+ return t || (i = "You must specify an id for the field"), t && !t.match(Fi) && (i = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (i = "There is another field with this ID already"), i;
3523
3523
  }
3524
- function ji(t) {
3524
+ function Ei(t) {
3525
3525
  let a;
3526
3526
  return t || (a = "You must specify a title for the field"), a;
3527
3527
  }
3528
- function Ei({
3528
+ function Di({
3529
3529
  widgetId: t,
3530
3530
  disabled: a,
3531
3531
  showErrors: i
@@ -3598,7 +3598,7 @@ function Ei({
3598
3598
  ) })
3599
3599
  ] });
3600
3600
  }
3601
- function Di({ disabled: t }) {
3601
+ function Bi({ disabled: t }) {
3602
3602
  const { values: a } = K(), i = P(a, "defaultValue");
3603
3603
  return /* @__PURE__ */ n(M, { children: [
3604
3604
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }),
@@ -3615,7 +3615,7 @@ function Di({ disabled: t }) {
3615
3615
  ) })
3616
3616
  ] });
3617
3617
  }
3618
- function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3618
+ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
3619
3619
  const {
3620
3620
  values: o,
3621
3621
  setFieldValue: l
@@ -3703,7 +3703,7 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3703
3703
  )
3704
3704
  ] });
3705
3705
  }
3706
- function Mi({ disabled: t }) {
3706
+ function Ri({ disabled: t }) {
3707
3707
  const {
3708
3708
  values: a,
3709
3709
  handleChange: i
@@ -3790,10 +3790,10 @@ function Mi({ disabled: t }) {
3790
3790
  ) })
3791
3791
  ] });
3792
3792
  }
3793
- function Ri({ disabled: t }) {
3793
+ function Ui({ disabled: t }) {
3794
3794
  const { values: a, setFieldValue: i } = K();
3795
3795
  return /* @__PURE__ */ n(M, { children: [
3796
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Mi, { disabled: t }) }) }),
3796
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ri, { disabled: t }) }) }),
3797
3797
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3798
3798
  Te,
3799
3799
  {
@@ -3809,7 +3809,7 @@ function Ri({ disabled: t }) {
3809
3809
  ) })
3810
3810
  ] });
3811
3811
  }
3812
- function Ut({
3812
+ function Rt({
3813
3813
  existing: t,
3814
3814
  multiple: a,
3815
3815
  disabled: i,
@@ -3833,20 +3833,20 @@ function Ut({
3833
3833
  name: d,
3834
3834
  pathPath: d,
3835
3835
  type: "select",
3836
- validate: Ui,
3836
+ validate: $i,
3837
3837
  disabled: t || i,
3838
3838
  value: f,
3839
3839
  error: g,
3840
3840
  handleChange: o,
3841
- component: $i
3841
+ component: Li
3842
3842
  }
3843
3843
  ) }) });
3844
3844
  }
3845
- function Ui(t) {
3845
+ function $i(t) {
3846
3846
  let a;
3847
3847
  return t || (a = "You must specify a target collection for the field"), a;
3848
3848
  }
3849
- function $i({
3849
+ function Li({
3850
3850
  disabled: t,
3851
3851
  pathPath: a,
3852
3852
  value: i,
@@ -3892,7 +3892,7 @@ function $i({
3892
3892
  ...o,
3893
3893
  children: [
3894
3894
  m.flatMap((c) => /* @__PURE__ */ e(
3895
- It,
3895
+ Vt,
3896
3896
  {
3897
3897
  label: c || "Views",
3898
3898
  children: p.filter((d) => d.group === c).map((d) => {
@@ -3919,7 +3919,7 @@ function $i({
3919
3919
  },
3920
3920
  `group_${c}`
3921
3921
  )),
3922
- u && /* @__PURE__ */ e(It, { label: "Views", children: u.map((c) => {
3922
+ u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((c) => {
3923
3923
  const d = ct(c);
3924
3924
  return /* @__PURE__ */ e(
3925
3925
  ee,
@@ -3946,7 +3946,7 @@ function $i({
3946
3946
  /* @__PURE__ */ e(ie, { children: "You can only edit the reference collection upon field creation." })
3947
3947
  ] });
3948
3948
  }
3949
- function Li({ disabled: t }) {
3949
+ function Ki({ disabled: t }) {
3950
3950
  const {
3951
3951
  values: a,
3952
3952
  errors: i,
@@ -4012,7 +4012,7 @@ function Li({ disabled: t }) {
4012
4012
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) })
4013
4013
  ] });
4014
4014
  }
4015
- function Ki({ disabled: t }) {
4015
+ function Yi({ disabled: t }) {
4016
4016
  return K(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4017
4017
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
4018
4018
  de,
@@ -4038,7 +4038,7 @@ function Ki({ disabled: t }) {
4038
4038
  ) })
4039
4039
  ] });
4040
4040
  }
4041
- function Yi({ disabled: t }) {
4041
+ function Gi({ disabled: t }) {
4042
4042
  return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
4043
4043
  }
4044
4044
  function na(t, a, i) {
@@ -4287,7 +4287,7 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4287
4287
  }
4288
4288
  );
4289
4289
  }
4290
- function Gi({
4290
+ function Hi({
4291
4291
  disabled: t,
4292
4292
  showErrors: a
4293
4293
  }) {
@@ -4347,7 +4347,28 @@ function Gi({
4347
4347
  ) })
4348
4348
  ] });
4349
4349
  }
4350
- const la = L.memo(
4350
+ const Ji = [
4351
+ "text_field",
4352
+ "multiline",
4353
+ "markdown",
4354
+ "url",
4355
+ "email",
4356
+ "select",
4357
+ "multi_select",
4358
+ "number_input",
4359
+ "number_select",
4360
+ "multi_number_select",
4361
+ "file_upload",
4362
+ "multi_file_upload",
4363
+ "reference",
4364
+ "multi_references",
4365
+ "switch",
4366
+ "date_time",
4367
+ "group",
4368
+ "key_value",
4369
+ "repeat",
4370
+ "block"
4371
+ ], la = Object.entries(Zt).filter(([t]) => Ji.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = L.memo(
4351
4372
  function({
4352
4373
  includeIdAndName: a = !0,
4353
4374
  autoOpenTypeSelect: i,
@@ -4390,7 +4411,7 @@ const la = L.memo(
4390
4411
  F.current = v, u?.(v);
4391
4412
  };
4392
4413
  return /* @__PURE__ */ e(
4393
- qt,
4414
+ St,
4394
4415
  {
4395
4416
  initialErrors: g,
4396
4417
  initialValues: m ? { id: l, ...m } : w,
@@ -4408,7 +4429,7 @@ const la = L.memo(
4408
4429
  children: (S) => (pe(() => {
4409
4430
  x?.(S);
4410
4431
  }, [S]), /* @__PURE__ */ e(
4411
- Hi,
4432
+ Qi,
4412
4433
  {
4413
4434
  onPropertyChanged: c ? A : void 0,
4414
4435
  onDelete: d,
@@ -4453,7 +4474,7 @@ function je({
4453
4474
  fullWidth: !0,
4454
4475
  children: [
4455
4476
  /* @__PURE__ */ e($e, { children: /* @__PURE__ */ e(
4456
- la,
4477
+ ca,
4457
4478
  {
4458
4479
  ...l,
4459
4480
  onPropertyChanged: (u) => {
@@ -4492,7 +4513,7 @@ function je({
4492
4513
  }
4493
4514
  );
4494
4515
  }
4495
- function Hi({
4516
+ function Qi({
4496
4517
  values: t,
4497
4518
  errors: a,
4498
4519
  touched: i,
@@ -4515,7 +4536,7 @@ function Hi({
4515
4536
  propertyConfigs: _,
4516
4537
  collectionEditable: y
4517
4538
  }) {
4518
- const [w, q] = $(p), [F, A] = $(!1), [S, E] = $(t?.dataType ? Xt(t) : void 0), v = Object.entries(Ot).concat(Object.entries(_)), V = O ? v.filter(([W, te]) => !oe(te.property) && te.property?.dataType !== "array") : v, J = fa(t), N = He(null), R = He(t), ge = "id", xe = g && P(a, "selectedWidget");
4539
+ const [w, q] = $(p), [F, A] = $(!1), [S, E] = $(t?.dataType ? Xt(t) : void 0), v = Object.entries(la).concat(Object.entries(_)), V = O ? v.filter(([W, te]) => !oe(te.property) && te.property?.dataType !== "array") : v, J = ba(t), N = He(null), R = He(t), ge = "id", xe = g && P(a, "selectedWidget");
4519
4540
  pe(() => {
4520
4541
  !P(i, ge) && l && t?.name && s(ge, Ct(t.name));
4521
4542
  }, [l, i, t?.name]), pe(() => {
@@ -4540,20 +4561,20 @@ function Hi({
4540
4561
  };
4541
4562
  let U;
4542
4563
  return S === "text_field" || S === "multiline" || S === "markdown" || S === "email" ? U = /* @__PURE__ */ e(
4543
- Ei,
4564
+ Di,
4544
4565
  {
4545
4566
  widgetId: S,
4546
4567
  disabled: b,
4547
4568
  showErrors: g
4548
4569
  }
4549
4570
  ) : S === "url" ? U = /* @__PURE__ */ e(
4550
- Gi,
4571
+ Hi,
4551
4572
  {
4552
4573
  disabled: b,
4553
4574
  showErrors: g
4554
4575
  }
4555
4576
  ) : S === "select" || S === "number_select" ? U = /* @__PURE__ */ e(
4556
- Mt,
4577
+ Bt,
4557
4578
  {
4558
4579
  multiselect: !1,
4559
4580
  allowDataInference: h,
@@ -4563,7 +4584,7 @@ function Hi({
4563
4584
  showErrors: g
4564
4585
  }
4565
4586
  ) : S === "multi_select" || S === "multi_number_select" ? U = /* @__PURE__ */ e(
4566
- Mt,
4587
+ Bt,
4567
4588
  {
4568
4589
  multiselect: !0,
4569
4590
  updateIds: !o,
@@ -4573,21 +4594,21 @@ function Hi({
4573
4594
  showErrors: g
4574
4595
  }
4575
4596
  ) : S === "file_upload" ? U = /* @__PURE__ */ e(
4576
- Rt,
4597
+ Mt,
4577
4598
  {
4578
4599
  existing: o,
4579
4600
  multiple: !1,
4580
4601
  disabled: b
4581
4602
  }
4582
4603
  ) : S === "multi_file_upload" ? U = /* @__PURE__ */ e(
4583
- Rt,
4604
+ Mt,
4584
4605
  {
4585
4606
  existing: o,
4586
4607
  multiple: !0,
4587
4608
  disabled: b
4588
4609
  }
4589
- ) : S === "switch" ? U = /* @__PURE__ */ e(Di, { disabled: b }) : S === "number_input" ? U = /* @__PURE__ */ e(Ri, { disabled: b }) : S === "group" ? U = /* @__PURE__ */ e(
4590
- zi,
4610
+ ) : S === "switch" ? U = /* @__PURE__ */ e(Bi, { disabled: b }) : S === "number_input" ? U = /* @__PURE__ */ e(Ui, { disabled: b }) : S === "group" ? U = /* @__PURE__ */ e(
4611
+ Ti,
4591
4612
  {
4592
4613
  disabled: b,
4593
4614
  getData: x,
@@ -4596,7 +4617,7 @@ function Hi({
4596
4617
  propertyConfigs: _
4597
4618
  }
4598
4619
  ) : S === "block" ? U = /* @__PURE__ */ e(
4599
- Bi,
4620
+ Mi,
4600
4621
  {
4601
4622
  disabled: b,
4602
4623
  getData: x,
@@ -4605,15 +4626,15 @@ function Hi({
4605
4626
  propertyConfigs: _
4606
4627
  }
4607
4628
  ) : S === "reference" ? U = /* @__PURE__ */ e(
4608
- Ut,
4629
+ Rt,
4609
4630
  {
4610
4631
  showErrors: g,
4611
4632
  existing: o,
4612
4633
  multiple: !1,
4613
4634
  disabled: b
4614
4635
  }
4615
- ) : S === "date_time" ? U = /* @__PURE__ */ e(Li, { disabled: b }) : S === "multi_references" ? U = /* @__PURE__ */ e(
4616
- Ut,
4636
+ ) : S === "date_time" ? U = /* @__PURE__ */ e(Ki, { disabled: b }) : S === "multi_references" ? U = /* @__PURE__ */ e(
4637
+ Rt,
4617
4638
  {
4618
4639
  showErrors: g,
4619
4640
  existing: o,
@@ -4621,7 +4642,7 @@ function Hi({
4621
4642
  disabled: b
4622
4643
  }
4623
4644
  ) : S === "repeat" ? U = /* @__PURE__ */ e(
4624
- Ti,
4645
+ Vi,
4625
4646
  {
4626
4647
  showErrors: g,
4627
4648
  existing: o,
@@ -4631,7 +4652,7 @@ function Hi({
4631
4652
  collectionEditable: y,
4632
4653
  propertyConfigs: _
4633
4654
  }
4634
- ) : S === "key_value" ? U = /* @__PURE__ */ e(Yi, { disabled: b }) : U = null, /* @__PURE__ */ n(M, { children: [
4655
+ ) : S === "key_value" ? U = /* @__PURE__ */ e(Gi, { disabled: b }) : U = null, /* @__PURE__ */ n(M, { children: [
4635
4656
  b && /* @__PURE__ */ n(ea, { mode: "warn", children: [
4636
4657
  /* @__PURE__ */ e(C, { children: "This property can't be edited" }),
4637
4658
  /* @__PURE__ */ n(C, { variant: "caption", children: [
@@ -4655,7 +4676,7 @@ function Hi({
4655
4676
  renderValue: (W) => {
4656
4677
  if (!W)
4657
4678
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
4658
- const te = W, me = Ot[te] ?? _[te], ue = me.property, fe = ue && !oe(ue) ? Ze(ue, _) : void 0, ye = oe(ue) || o && ue.dataType !== t?.dataType, Ce = fe ? Y(fe, me) : me;
4679
+ const te = W, me = Zt[te] ?? _[te], ue = me.property, fe = ue && !oe(ue) ? Ze(ue, _) : void 0, ye = oe(ue) || o && ue.dataType !== t?.dataType, Ce = fe ? Y(fe, me) : me;
4659
4680
  return /* @__PURE__ */ n(
4660
4681
  "div",
4661
4682
  {
@@ -4724,7 +4745,7 @@ function Hi({
4724
4745
  ] }),
4725
4746
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
4726
4747
  m && /* @__PURE__ */ e(
4727
- Vi,
4748
+ Ii,
4728
4749
  {
4729
4750
  showErrors: g,
4730
4751
  disabledId: o,
@@ -4735,7 +4756,7 @@ function Hi({
4735
4756
  }
4736
4757
  ),
4737
4758
  U,
4738
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ki, { disabled: b }) })
4759
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Yi, { disabled: b }) })
4739
4760
  ] }),
4740
4761
  c && /* @__PURE__ */ e(
4741
4762
  mt,
@@ -4753,13 +4774,13 @@ function Hi({
4753
4774
  )
4754
4775
  ] });
4755
4776
  }
4756
- function Ji(t) {
4777
+ function Wi(t) {
4757
4778
  return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, i) => a + i[0].toUpperCase() + i.substring(1));
4758
4779
  }
4759
- function Qi({ collection: t, onOpenChange: a, open: i }) {
4780
+ function Zi({ collection: t, onOpenChange: a, open: i }) {
4760
4781
  const r = De(), s = `import { EntityCollection } from "firecms";
4761
4782
 
4762
- const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), null, " ");
4783
+ const ` + Wi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), null, " ");
4763
4784
  return /* @__PURE__ */ n(
4764
4785
  Ee,
4765
4786
  {
@@ -4785,9 +4806,9 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
4785
4806
  "."
4786
4807
  ] }),
4787
4808
  /* @__PURE__ */ e(
4788
- si,
4809
+ li,
4789
4810
  {
4790
- theme: li.vsDark,
4811
+ theme: ci.vsDark,
4791
4812
  code: s,
4792
4813
  language: "typescript",
4793
4814
  children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((c, d) => /* @__PURE__ */ e("div", { ...m({ line: c }), children: c.map((f, g) => /* @__PURE__ */ e("span", { ...u({ token: f }) }, g)) }, d)) })
@@ -4805,7 +4826,7 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
4805
4826
  message: "Copied"
4806
4827
  }), navigator.clipboard.writeText(s)),
4807
4828
  children: [
4808
- /* @__PURE__ */ e(Fa, { size: "small" }),
4829
+ /* @__PURE__ */ e(ja, { size: "small" }),
4809
4830
  "Copy to clipboard"
4810
4831
  ]
4811
4832
  }
@@ -4816,7 +4837,7 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
4816
4837
  }
4817
4838
  );
4818
4839
  }
4819
- function ca(t) {
4840
+ function da(t) {
4820
4841
  const a = (i) => {
4821
4842
  const r = {
4822
4843
  ...i
@@ -4842,10 +4863,10 @@ function ca(t) {
4842
4863
  properties: Object.entries(t.properties).map(([i, r]) => ({
4843
4864
  [i]: a(r)
4844
4865
  })).reduce((i, r) => ({ ...i, ...r }), {}),
4845
- subcollections: (t.subcollections ?? []).map(ca)
4866
+ subcollections: (t.subcollections ?? []).map(da)
4846
4867
  };
4847
4868
  }
4848
- function Wi({
4869
+ function Xi({
4849
4870
  showErrors: t,
4850
4871
  isNewCollection: a,
4851
4872
  propertyErrorsRef: i,
@@ -4866,7 +4887,7 @@ function Wi({
4866
4887
  setFieldTouched: O,
4867
4888
  errors: k,
4868
4889
  dirty: x
4869
- } = K(), h = De(), _ = ja("lg"), y = !_, [w, q] = $(), [F, A] = $(), [S, E] = $(), v = F ? ce(F, S) : void 0, V = v ? P(f.properties, v.replaceAll(".", ".properties.")) : void 0, [J, N] = $(!1), [R, ge] = $(!1), [xe, Q] = $(!1), [U, W] = $([]), te = L.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
4890
+ } = K(), h = De(), _ = Ea("lg"), y = !_, [w, q] = $(), [F, A] = $(), [S, E] = $(), v = F ? ce(F, S) : void 0, V = v ? P(f.properties, v.replaceAll(".", ".properties.")) : void 0, [J, N] = $(!1), [R, ge] = $(!1), [xe, Q] = $(!1), [U, W] = $([]), te = L.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
4870
4891
  pe(() => {
4871
4892
  s && s(x);
4872
4893
  }, [x]);
@@ -4954,11 +4975,11 @@ function Wi({
4954
4975
  }
4955
4976
  }, bt = () => {
4956
4977
  q(void 0), A(void 0);
4957
- }, T = F && i?.current?.properties ? i.current.properties[F] : void 0, I = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, D = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Oe = Yt(() => p(f.ownerId), [p, f.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4978
+ }, T = F && i?.current?.properties ? i.current.properties[F] : void 0, I = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, D = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Oe = Kt(() => p(f.ownerId), [p, f.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4958
4979
  /* @__PURE__ */ n("div", { className: ke(
4959
4980
  "p-4 md:p-8 pb-20 md:pb-20",
4960
4981
  "col-span-12 lg:col-span-5 h-full overflow-auto",
4961
- !y && "border-r " + Nt
4982
+ !y && "border-r " + Pt
4962
4983
  ), children: [
4963
4984
  /* @__PURE__ */ n("div", { className: "flex my-2", children: [
4964
4985
  /* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
@@ -4997,7 +5018,7 @@ function Wi({
4997
5018
  variant: "filled",
4998
5019
  disabled: R,
4999
5020
  onClick: () => N(!0),
5000
- children: /* @__PURE__ */ e(Ea, {})
5021
+ children: /* @__PURE__ */ e(Da, {})
5001
5022
  }
5002
5023
  ) }),
5003
5024
  me && /* @__PURE__ */ e(re, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
@@ -5056,7 +5077,7 @@ function Wi({
5056
5077
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
5057
5078
  children: [
5058
5079
  v && V && !oe(V) && /* @__PURE__ */ e(
5059
- la,
5080
+ ca,
5060
5081
  {
5061
5082
  inArray: !1,
5062
5083
  existingProperty: !a,
@@ -5128,7 +5149,7 @@ function Wi({
5128
5149
  }
5129
5150
  ),
5130
5151
  /* @__PURE__ */ e(
5131
- Qi,
5152
+ Zi,
5132
5153
  {
5133
5154
  collection: f,
5134
5155
  open: J,
@@ -5137,7 +5158,7 @@ function Wi({
5137
5158
  )
5138
5159
  ] });
5139
5160
  }
5140
- function Zi({
5161
+ function er({
5141
5162
  open: t,
5142
5163
  handleOk: a,
5143
5164
  handleCancel: i,
@@ -5165,7 +5186,7 @@ function Zi({
5165
5186
  }
5166
5187
  );
5167
5188
  }
5168
- function Xi({ open: t, onClose: a }) {
5189
+ function tr({ open: t, onClose: a }) {
5169
5190
  const {
5170
5191
  entityViews: i
5171
5192
  } = Ke();
@@ -5199,7 +5220,7 @@ function Xi({ open: t, onClose: a }) {
5199
5220
  }
5200
5221
  );
5201
5222
  }
5202
- function er({
5223
+ function ar({
5203
5224
  collection: t,
5204
5225
  parentCollection: a,
5205
5226
  configController: i,
@@ -5210,7 +5231,7 @@ function er({
5210
5231
  const { entityViews: l } = Ke(), [p, m] = L.useState(), [u, c] = L.useState(!1), [d, f] = L.useState(), [g, b] = L.useState(), {
5211
5232
  values: O,
5212
5233
  setFieldValue: k
5213
- } = K(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => Da(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], y = h.length + _.length;
5234
+ } = K(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => Ba(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], y = h.length + _.length;
5214
5235
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5215
5236
  /* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5216
5237
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
@@ -5218,7 +5239,7 @@ function er({
5218
5239
  "Subcollections of ",
5219
5240
  O.name
5220
5241
  ] }),
5221
- x && x.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ e(jt, { children: x.map((w) => /* @__PURE__ */ n(
5242
+ x && x.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Ft, { children: x.map((w) => /* @__PURE__ */ n(
5222
5243
  wt,
5223
5244
  {
5224
5245
  onClick: () => b({
@@ -5270,7 +5291,7 @@ function er({
5270
5291
  ] }),
5271
5292
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5272
5293
  /* @__PURE__ */ e(C, { variant: "h5", children: "Custom views" }),
5273
- y > 0 && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ n(jt, { children: [
5294
+ y > 0 && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n(Ft, { children: [
5274
5295
  h.map((w) => /* @__PURE__ */ n(wt, { children: [
5275
5296
  /* @__PURE__ */ e(
5276
5297
  Ge,
@@ -5365,7 +5386,7 @@ function er({
5365
5386
  }
5366
5387
  ),
5367
5388
  /* @__PURE__ */ e(
5368
- pa,
5389
+ ma,
5369
5390
  {
5370
5391
  open: !!g,
5371
5392
  configController: i,
@@ -5381,7 +5402,7 @@ function er({
5381
5402
  }
5382
5403
  ),
5383
5404
  /* @__PURE__ */ e(
5384
- Xi,
5405
+ tr,
5385
5406
  {
5386
5407
  open: u,
5387
5408
  onClose: (w) => {
@@ -5391,7 +5412,7 @@ function er({
5391
5412
  )
5392
5413
  ] });
5393
5414
  }
5394
- const $t = {
5415
+ const Ut = {
5395
5416
  id: "products",
5396
5417
  path: "products",
5397
5418
  name: "Products",
@@ -5476,7 +5497,7 @@ const $t = {
5476
5497
  autoValue: "on_create"
5477
5498
  }
5478
5499
  })
5479
- }, Lt = {
5500
+ }, $t = {
5480
5501
  id: "blog",
5481
5502
  path: "blog",
5482
5503
  name: "Blog",
@@ -5588,7 +5609,7 @@ const $t = {
5588
5609
  initialFilter: {
5589
5610
  status: ["==", "published"]
5590
5611
  }
5591
- }, Kt = {
5612
+ }, Lt = {
5592
5613
  id: "users",
5593
5614
  path: "users",
5594
5615
  name: "Users",
@@ -5620,7 +5641,7 @@ const $t = {
5620
5641
  }
5621
5642
  })
5622
5643
  };
5623
- function tr({
5644
+ function ir({
5624
5645
  path: t,
5625
5646
  pathSuggestions: a,
5626
5647
  parentCollection: i,
@@ -5673,7 +5694,7 @@ function tr({
5673
5694
  {
5674
5695
  colorScheme: "cyanLighter",
5675
5696
  onClick: () => {
5676
- c("name", St(h)), c("path", h), c("properties", void 0), r();
5697
+ c("name", Nt(h)), c("path", h), c("properties", void 0), r();
5677
5698
  },
5678
5699
  size: "small",
5679
5700
  children: h
@@ -5698,9 +5719,9 @@ function tr({
5698
5719
  {
5699
5720
  title: "Products",
5700
5721
  subtitle: "A collection of products with images, prices and stock",
5701
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
5722
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Ut.icon }),
5702
5723
  onClick: () => {
5703
- d($t), r();
5724
+ d(Ut), r();
5704
5725
  }
5705
5726
  }
5706
5727
  ),
@@ -5709,9 +5730,9 @@ function tr({
5709
5730
  {
5710
5731
  title: "Blog posts",
5711
5732
  subtitle: "A collection of blog posts with images, authors and complex content",
5712
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
5733
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
5713
5734
  onClick: () => {
5714
- d(Lt), r();
5735
+ d($t), r();
5715
5736
  }
5716
5737
  }
5717
5738
  ),
@@ -5720,9 +5741,9 @@ function tr({
5720
5741
  {
5721
5742
  title: "Users",
5722
5743
  subtitle: "A collection of users with emails, names and roles",
5723
- icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Kt.icon }),
5744
+ icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
5724
5745
  onClick: () => {
5725
- d(Kt), r();
5746
+ d(Lt), r();
5726
5747
  }
5727
5748
  }
5728
5749
  )
@@ -5738,7 +5759,7 @@ function tr({
5738
5759
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
5739
5760
  }
5740
5761
  ),
5741
- /* @__PURE__ */ e(ci, { onDataAdded: (h) => r(h) })
5762
+ /* @__PURE__ */ e(di, { onDataAdded: (h) => r(h) })
5742
5763
  ] }),
5743
5764
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(B, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5744
5765
  ] }) });
@@ -5774,30 +5795,6 @@ function kt({
5774
5795
  }
5775
5796
  ) });
5776
5797
  }
5777
- const ar = [
5778
- "text_field",
5779
- "multiline",
5780
- "markdown",
5781
- "url",
5782
- "email",
5783
- "select",
5784
- "multi_select",
5785
- "number_input",
5786
- "number_select",
5787
- "multi_number_select",
5788
- "file_upload",
5789
- "multi_file_upload",
5790
- "group",
5791
- "key_value",
5792
- "reference",
5793
- "multi_references",
5794
- "switch",
5795
- "date_time",
5796
- "repeat",
5797
- "block"
5798
- ], ir = Object.entries(Ot).filter(
5799
- ([t]) => ar.includes(t)
5800
- );
5801
5798
  function rr({
5802
5799
  importConfig: t,
5803
5800
  propertyConfigs: a,
@@ -5833,7 +5830,7 @@ function rr({
5833
5830
  namespace: k
5834
5831
  }) => {
5835
5832
  const x = g ? ce(g, k) : void 0, h = x ? _e(x) : void 0, _ = t.importData.map((w) => P(w, b)), y = {
5836
- ...ti(_, O, ia),
5833
+ ...ai(_, O, ia),
5837
5834
  editable: !0
5838
5835
  };
5839
5836
  h && (y ? (console.log("updating inferredNewProperty", {
@@ -5845,7 +5842,7 @@ function rr({
5845
5842
  /* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5846
5843
  /* @__PURE__ */ e(C, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5847
5844
  /* @__PURE__ */ e(
5848
- di,
5845
+ pi,
5849
5846
  {
5850
5847
  headersMapping: t.headersMapping,
5851
5848
  idColumn: t.idColumn,
@@ -5857,7 +5854,7 @@ function rr({
5857
5854
  propertyKey: b,
5858
5855
  importKey: O
5859
5856
  }) => /* @__PURE__ */ e(
5860
- pi,
5857
+ mi,
5861
5858
  {
5862
5859
  property: g,
5863
5860
  propertyKey: b,
@@ -5947,7 +5944,7 @@ function or({
5947
5944
  namespace: void 0
5948
5945
  }), console.log("newSelectedWidgetId", u));
5949
5946
  },
5950
- children: ir.map(([u, c]) => /* @__PURE__ */ e(
5947
+ children: Object.entries(la).map(([u, c]) => /* @__PURE__ */ e(
5951
5948
  sa,
5952
5949
  {
5953
5950
  value: u,
@@ -5964,12 +5961,12 @@ function or({
5964
5961
  }
5965
5962
  function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
5966
5963
  pe(() => {
5967
- const s = mi(t.originProperties, a), o = t.importData.map((l) => ui(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5964
+ const s = ui(t.originProperties, a), o = t.importData.map((l) => hi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5968
5965
  t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
5969
5966
  }, []);
5970
- const r = Ba();
5967
+ const r = Ma();
5971
5968
  return /* @__PURE__ */ e(
5972
- Ma,
5969
+ Ra,
5973
5970
  {
5974
5971
  title: /* @__PURE__ */ n("div", { children: [
5975
5972
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
@@ -5989,11 +5986,11 @@ function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
5989
5986
  }
5990
5987
  );
5991
5988
  }
5992
- function da(t, a = "") {
5989
+ function pa(t, a = "") {
5993
5990
  const i = Object.keys(t).reduce((o, l) => {
5994
- const p = t[l], m = Ra(l), u = a ? `${a}.${m}` : m;
5991
+ const p = t[l], m = Ua(l), u = a ? `${a}.${m}` : m;
5995
5992
  if (p.dataType === "map" && p.properties) {
5996
- const f = da(p.properties, u);
5993
+ const f = pa(p.properties, u);
5997
5994
  return {
5998
5995
  headersMapping: { ...o.headersMapping, [l]: u },
5999
5996
  properties: {
@@ -6021,7 +6018,7 @@ function da(t, a = "") {
6021
6018
  idColumn: s
6022
6019
  };
6023
6020
  }
6024
- function pa(t) {
6021
+ function ma(t) {
6025
6022
  const a = t.open, [i, r] = we.useState(!1), [s, o] = we.useState(!1), l = X(() => {
6026
6023
  i ? o(!0) : t.handleClose(void 0);
6027
6024
  }, [i, t.handleClose]);
@@ -6046,7 +6043,7 @@ function pa(t) {
6046
6043
  }
6047
6044
  ),
6048
6045
  /* @__PURE__ */ e(
6049
- Zi,
6046
+ er,
6050
6047
  {
6051
6048
  open: s,
6052
6049
  handleOk: () => t.handleClose(void 0),
@@ -6079,7 +6076,7 @@ function sr({
6079
6076
  const { propertyConfigs: k } = Ke(), x = Be(), {
6080
6077
  topLevelNavigation: h,
6081
6078
  collections: _
6082
- } = x, y = !a?.path && (s ?? []).length === 0, w = (b ? b.subcollections : _) ?? [], q = w.map((T) => T.path.trim().toLowerCase()), F = w.map((T) => T.id?.trim().toLowerCase()).filter(Boolean), A = hi();
6079
+ } = x, y = !a?.path && (s ?? []).length === 0, w = (b ? b.subcollections : _) ?? [], q = w.map((T) => T.path.trim().toLowerCase()), F = w.map((T) => T.id?.trim().toLowerCase()).filter(Boolean), A = gi();
6083
6080
  if (!h)
6084
6081
  throw Error("Internal: Navigation not ready in collection editor");
6085
6082
  const {
@@ -6105,9 +6102,9 @@ function sr({
6105
6102
  }), !1));
6106
6103
  }, ye = Q ? {
6107
6104
  ...Q,
6108
- id: Q.id ?? Q.path ?? Et(16)
6105
+ id: Q.id ?? Q.path ?? jt(16)
6109
6106
  } : void 0, Ce = ye ? lr(ye, k) : {
6110
- id: a?.path ?? Et(16),
6107
+ id: a?.path ?? jt(16),
6111
6108
  path: a?.path ?? "",
6112
6109
  name: a?.name ?? "",
6113
6110
  group: a?.group ?? "",
@@ -6169,11 +6166,11 @@ function sr({
6169
6166
  }), console.error(D), I.resetForm({ values: T });
6170
6167
  }
6171
6168
  };
6172
- return !t && (!x.initialised || !W) ? /* @__PURE__ */ e(Dt, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6173
- qt,
6169
+ return !t && (!x.initialised || !W) ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6170
+ St,
6174
6171
  {
6175
6172
  initialValues: Ce,
6176
- validationSchema: (N === "properties" || N === "subcollections" || N === "details") && bi,
6173
+ validationSchema: (N === "properties" || N === "subcollections" || N === "details") && yi,
6177
6174
  validate: (T) => {
6178
6175
  if (N === "properties")
6179
6176
  return V.current;
@@ -6199,8 +6196,8 @@ function sr({
6199
6196
  d(at);
6200
6197
  }, [at]);
6201
6198
  function ve(Z) {
6202
- A.setInUse(!0), ai(Z, ia).then((Ie) => {
6203
- const Fe = da(Ie);
6199
+ A.setInUse(!0), ii(Z, ia).then((Ie) => {
6200
+ const Fe = pa(Ie);
6204
6201
  D("properties", Fe.properties), D("propertiesOrder", Object.keys(Fe.properties)), A.setIdColumn(Fe.idColumn), A.setImportData(Z), A.setHeadersMapping(Fe.headersMapping), A.setOriginProperties(Fe.properties);
6205
6202
  });
6206
6203
  }
@@ -6213,10 +6210,10 @@ function sr({
6213
6210
  }, vt = Q?.editable || t;
6214
6211
  return /* @__PURE__ */ n(M, { children: [
6215
6212
  !t && /* @__PURE__ */ n(
6216
- Ua,
6213
+ $a,
6217
6214
  {
6218
6215
  value: N,
6219
- className: ke(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6216
+ className: ke(Pt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6220
6217
  onValueChange: (Z) => R(Z),
6221
6218
  children: [
6222
6219
  /* @__PURE__ */ e(_t, { value: "details", children: "Details" }),
@@ -6226,7 +6223,7 @@ function sr({
6226
6223
  }
6227
6224
  ),
6228
6225
  /* @__PURE__ */ n(
6229
- Za,
6226
+ Xa,
6230
6227
  {
6231
6228
  noValidate: !0,
6232
6229
  className: ke(
@@ -6234,10 +6231,10 @@ function sr({
6234
6231
  "flex-grow flex flex-col relative"
6235
6232
  ),
6236
6233
  children: [
6237
- N === "loading" && /* @__PURE__ */ e(Dt, {}),
6234
+ N === "loading" && /* @__PURE__ */ e(Et, {}),
6238
6235
  N === "extra_view" && j && u?.View && /* @__PURE__ */ e(u.View, { path: j }),
6239
6236
  N === "welcome" && /* @__PURE__ */ e(
6240
- tr,
6237
+ ir,
6241
6238
  {
6242
6239
  path: j,
6243
6240
  onContinue: (Z) => {
@@ -6265,7 +6262,7 @@ function sr({
6265
6262
  }
6266
6263
  ),
6267
6264
  N === "import_data_saving" && A && /* @__PURE__ */ e(
6268
- gi,
6265
+ fi,
6269
6266
  {
6270
6267
  importConfig: A,
6271
6268
  collection: I,
@@ -6278,7 +6275,7 @@ function sr({
6278
6275
  }
6279
6276
  ),
6280
6277
  N === "details" && /* @__PURE__ */ e(
6281
- wi,
6278
+ _i,
6282
6279
  {
6283
6280
  existingPaths: q,
6284
6281
  existingIds: F,
@@ -6288,7 +6285,7 @@ function sr({
6288
6285
  }
6289
6286
  ),
6290
6287
  N === "subcollections" && Q && /* @__PURE__ */ e(
6291
- er,
6288
+ ar,
6292
6289
  {
6293
6290
  parentCollection: b,
6294
6291
  configController: i,
@@ -6299,13 +6296,13 @@ function sr({
6299
6296
  }
6300
6297
  ),
6301
6298
  N === "properties" && /* @__PURE__ */ e(
6302
- Wi,
6299
+ Xi,
6303
6300
  {
6304
6301
  showErrors: z > 0,
6305
6302
  isNewCollection: t,
6306
6303
  reservedGroups: m,
6307
6304
  onPropertyError: (Z, Ie, Fe) => {
6308
- V.current = $a({
6305
+ V.current = La({
6309
6306
  ...V.current,
6310
6307
  [Z]: Fe
6311
6308
  }, !0);
@@ -6412,14 +6409,14 @@ function sr({
6412
6409
  }
6413
6410
  ),
6414
6411
  t && (N === "details" || N === "properties") && /* @__PURE__ */ n(
6415
- Bt,
6412
+ Dt,
6416
6413
  {
6417
6414
  variant: "filled",
6418
6415
  color: "primary",
6419
6416
  type: "submit",
6420
6417
  loading: Oe,
6421
6418
  disabled: Oe || N === "details" && !yt,
6422
- startIcon: N === "properties" ? /* @__PURE__ */ e(La, {}) : void 0,
6419
+ startIcon: N === "properties" ? /* @__PURE__ */ e(Ka, {}) : void 0,
6423
6420
  children: [
6424
6421
  N === "details" && "Next",
6425
6422
  N === "properties" && "Create collection"
@@ -6427,7 +6424,7 @@ function sr({
6427
6424
  }
6428
6425
  ),
6429
6426
  !t && /* @__PURE__ */ e(
6430
- Bt,
6427
+ Dt,
6431
6428
  {
6432
6429
  variant: "filled",
6433
6430
  color: "primary",
@@ -6450,10 +6447,10 @@ function sr({
6450
6447
  function lr(t, a) {
6451
6448
  const { properties: i, ...r } = t, s = {};
6452
6449
  return Object.keys(i).forEach((o) => {
6453
- s[o] = ma(i[o], a);
6450
+ s[o] = ua(i[o], a);
6454
6451
  }), { ...r, properties: s };
6455
6452
  }
6456
- function ma(t, a) {
6453
+ function ua(t, a) {
6457
6454
  let i = t;
6458
6455
  if (a && typeof i == "object" && i.propertyConfig) {
6459
6456
  const r = a[i.propertyConfig];
@@ -6462,7 +6459,7 @@ function ma(t, a) {
6462
6459
  else if (r && (i = Y(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
6463
6460
  const s = {};
6464
6461
  Object.keys(i.properties).forEach((o) => {
6465
- s[o] = ma(i.properties[o], a);
6462
+ s[o] = ua(i.properties[o], a);
6466
6463
  }), i = { ...i, properties: s };
6467
6464
  }
6468
6465
  }
@@ -6476,7 +6473,7 @@ const cr = (t, a, i, r) => {
6476
6473
  return;
6477
6474
  let s;
6478
6475
  return a && i?.includes(t.trim().toLowerCase()) && (s = "There is already a collection that uses this value as a path"), a && r?.includes(t.trim().toLowerCase()) && (s = "There is already a collection which uses this id"), s;
6479
- }, ua = L.createContext({}), ha = L.createContext({}), pr = L.memo(
6476
+ }, ha = L.createContext({}), ga = L.createContext({}), pr = L.memo(
6480
6477
  function({
6481
6478
  children: a,
6482
6479
  collectionConfigController: i,
@@ -6488,7 +6485,7 @@ const cr = (t, a, i, r) => {
6488
6485
  getUser: m,
6489
6486
  getData: u
6490
6487
  }) {
6491
- const c = Be(), d = fi(), f = De(), { propertyConfigs: g } = Ke(), {
6488
+ const c = Be(), d = bi(), f = De(), { propertyConfigs: g } = Ke(), {
6492
6489
  collections: b
6493
6490
  } = c, O = b.map((v) => v.path.trim().toLowerCase()), [k, x] = L.useState();
6494
6491
  pe(() => {
@@ -6546,8 +6543,8 @@ const cr = (t, a, i, r) => {
6546
6543
  redirect: N
6547
6544
  });
6548
6545
  }, []), E = p ? (v) => !v && k ? Promise.resolve(k) : p?.(v) : void 0;
6549
- return /* @__PURE__ */ e(ua.Provider, { value: i, children: /* @__PURE__ */ n(
6550
- ha.Provider,
6546
+ return /* @__PURE__ */ e(ha.Provider, { value: i, children: /* @__PURE__ */ n(
6547
+ ga.Provider,
6551
6548
  {
6552
6549
  value: {
6553
6550
  editCollection: F,
@@ -6559,7 +6556,7 @@ const cr = (t, a, i, r) => {
6559
6556
  children: [
6560
6557
  a,
6561
6558
  /* @__PURE__ */ e(
6562
- pa,
6559
+ ma,
6563
6560
  {
6564
6561
  open: !!h,
6565
6562
  configController: i,
@@ -6653,14 +6650,14 @@ const cr = (t, a, i, r) => {
6653
6650
  ) });
6654
6651
  },
6655
6652
  ut
6656
- ), Re = () => Gt(ha), ga = () => Gt(ua);
6653
+ ), Re = () => Yt(ga), fa = () => Yt(ha);
6657
6654
  function mr({
6658
6655
  path: t,
6659
6656
  parentCollectionIds: a,
6660
6657
  collection: i,
6661
6658
  tableController: r
6662
6659
  }) {
6663
- const s = Ye(), o = Be(), l = Re(), p = ga(), m = De(), u = o.getCollectionFromIds(a), c = l.configPermissions ? l.configPermissions({
6660
+ const s = Ye(), o = Be(), l = Re(), p = fa(), m = De(), u = o.getCollectionFromIds(a), c = l.configPermissions ? l.configPermissions({
6664
6661
  user: s.user,
6665
6662
  collection: i
6666
6663
  }).editCollections : !0;
@@ -6691,7 +6688,7 @@ function mr({
6691
6688
  message: "Default config saved"
6692
6689
  });
6693
6690
  }),
6694
- children: /* @__PURE__ */ e(Ka, {})
6691
+ children: /* @__PURE__ */ e(Ya, {})
6695
6692
  }
6696
6693
  )
6697
6694
  }
@@ -6721,7 +6718,7 @@ function ur({
6721
6718
  path: t,
6722
6719
  collection: a
6723
6720
  }) {
6724
- const i = De(), r = Ye(), s = ga(), o = Re(), l = o.configPermissions({
6721
+ const i = De(), r = Ye(), s = fa(), o = Re(), l = o.configPermissions({
6725
6722
  user: r.user,
6726
6723
  collection: a
6727
6724
  }), p = X(() => {
@@ -6737,10 +6734,10 @@ function ur({
6737
6734
  return /* @__PURE__ */ n(M, { children: [
6738
6735
  /* @__PURE__ */ n("div", { children: [
6739
6736
  l.deleteCollections && /* @__PURE__ */ e(
6740
- Ya,
6737
+ Ga,
6741
6738
  {
6742
- trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ga, { size: "small" }) }),
6743
- children: /* @__PURE__ */ n(Ha, { onClick: (d) => {
6739
+ trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ha, { size: "small" }) }),
6740
+ children: /* @__PURE__ */ n(Ja, { onClick: (d) => {
6744
6741
  d.preventDefault(), d.stopPropagation(), u(!0);
6745
6742
  }, children: [
6746
6743
  /* @__PURE__ */ e(pt, {}),
@@ -6819,7 +6816,7 @@ function gr() {
6819
6816
  user: t.user
6820
6817
  }).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
6821
6818
  return /* @__PURE__ */ e(
6822
- Ja,
6819
+ Qa,
6823
6820
  {
6824
6821
  in: o,
6825
6822
  children: /* @__PURE__ */ n(
@@ -6838,7 +6835,7 @@ function gr() {
6838
6835
  icon: /* @__PURE__ */ e(Ae, { size: "small" }),
6839
6836
  colorScheme: "cyanLighter",
6840
6837
  onClick: i && r ? () => i.createCollection({
6841
- initialValues: { path: l, name: St(l) },
6838
+ initialValues: { path: l, name: Nt(l) },
6842
6839
  parentCollectionIds: [],
6843
6840
  redirect: !0
6844
6841
  }) : void 0,
@@ -6898,7 +6895,7 @@ function br({
6898
6895
  s.editProperty({
6899
6896
  editedCollectionPath: t,
6900
6897
  parentCollectionIds: a,
6901
- currentPropertiesOrder: Qa(i),
6898
+ currentPropertiesOrder: Wa(i),
6902
6899
  collection: i
6903
6900
  });
6904
6901
  },
@@ -6922,7 +6919,7 @@ function Ar({
6922
6919
  const d = (g) => {
6923
6920
  et(g.properties), g.subcollections?.forEach(d);
6924
6921
  }, f = t.collections ?? [];
6925
- return f.forEach(d), Wa(c, f, [], a);
6922
+ return f.forEach(d), Za(c, f, [], a);
6926
6923
  },
6927
6924
  [t.collections, a]
6928
6925
  );
@@ -6969,7 +6966,7 @@ function zr({ path: t }) {
6969
6966
  size: "small",
6970
6967
  onClick: () => {
6971
6968
  s.createCollection({
6972
- initialValues: { path: i, name: St(i) },
6969
+ initialValues: { path: i, name: Nt(i) },
6973
6970
  parentCollectionIds: r,
6974
6971
  redirect: !1
6975
6972
  });
@@ -6989,10 +6986,10 @@ export {
6989
6986
  ce as getFullId,
6990
6987
  _e as idToPropertiesPath,
6991
6988
  Ne as namespaceToPropertiesOrderPath,
6992
- _i as namespaceToPropertiesPath,
6993
- Si as removeNonEditableProperties,
6989
+ ki as namespaceToPropertiesPath,
6990
+ qi as removeNonEditableProperties,
6994
6991
  Re as useCollectionEditorController,
6995
6992
  Ar as useCollectionEditorPlugin,
6996
- ga as useCollectionsConfigController
6993
+ fa as useCollectionsConfigController
6997
6994
  };
6998
6995
  //# sourceMappingURL=index.es.js.map