@firecms/collection_editor 3.0.0-alpha.54 → 3.0.0-alpha.56
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 +136 -132
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/ConfigControllerProvider.tsx +1 -0
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +5 -0
- package/src/useCollectionEditorPlugin.tsx +10 -12
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as U, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { iconKeys as Kt, 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 xe, DebouncedTextField as W, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as Ot, SettingsIcon as Je, Select as Se, SelectItem as X, BooleanSwitchWithLabel as Yt, Dialog as Ee, toSnakeCase as Ct, singular as ka, ListIcon as xa, Button as R, CircularProgress as Qe, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Ca, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Oa, isValidRegExp as Na, RuleIcon as Pa, useSnackbarController as De, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Ne, FieldConfigBadge as Xe, cardMixin as Gt, cardClickableMixin as Ht, cardSelectedMixin as Wt, FunctionsIcon as za, RemoveCircleIcon as Ta, defaultBorderMixin as Nt, RemoveIcon as Va, DragHandleIcon as Ia, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as G, DEFAULT_FIELD_CONFIGS as Jt, getFieldId as Qt, InfoLabel as Zt, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Fa, useLargeLayout as ja, CodeIcon as Ea, makePropertiesEditable as et, resolveEntityView as Da, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Pt, Card as Xt, useSelectionController as Ba, EntityCollectionTable as Ma, slugify as Ra, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as Ua, Tab as _t, removeUndefined as $a, ErrorView as ea, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as La, SaveIcon as Ka, Menu as Ya, MoreVertIcon as Ga, MenuItem as Ha, Collapse as Wa, getDefaultPropertiesOrder as Ja, joinCollectionLists as Qa } from "@firecms/core";
|
|
2
3
|
import * as _e from "react";
|
|
3
|
-
import K, { useState as L, useEffect as pe, useMemo as
|
|
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 xe, DebouncedTextField as W, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Je, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as R, CircularProgress as Qe, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Na, isValidRegExp as Pa, 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 Ne, FieldConfigBadge as Xe, cardMixin as Wt, cardClickableMixin as Jt, cardSelectedMixin as Qt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Nt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as G, 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 Pt, 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 Wa, Collapse as Ja, getDefaultPropertiesOrder as Qa, joinCollectionLists as Za } from "@firecms/core";
|
|
4
|
+
import K, { useState as L, useEffect as pe, useMemo as ta, useCallback as ee, useRef as He, useDeferredValue as Za, useContext as aa } from "react";
|
|
5
5
|
import ut from "react-fast-compare";
|
|
6
6
|
import { useFormikContext as Y, Field as be, getIn as N, Formik as St, FastField as de, Form as Xa } from "formik";
|
|
7
7
|
import * as ot from "yup";
|
|
@@ -1967,18 +1967,18 @@ const yi = ot.object().shape({
|
|
|
1967
1967
|
zoom_out_map: "arrows destination location maps move place stop"
|
|
1968
1968
|
}, qt = new ei.Search("key");
|
|
1969
1969
|
qt.addIndex("synonyms");
|
|
1970
|
-
qt.addDocuments(
|
|
1970
|
+
qt.addDocuments(Kt.map((t) => ({
|
|
1971
1971
|
key: t,
|
|
1972
1972
|
// @ts-ignore
|
|
1973
1973
|
synonyms: ra[t] ?? []
|
|
1974
1974
|
})));
|
|
1975
1975
|
const vi = 220;
|
|
1976
1976
|
process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
|
|
1977
|
-
|
|
1977
|
+
Kt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
|
|
1978
1978
|
});
|
|
1979
1979
|
function wi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1980
1980
|
const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
|
|
1981
|
-
() =>
|
|
1981
|
+
() => ba((m) => {
|
|
1982
1982
|
if (!m || m === "")
|
|
1983
1983
|
r(null);
|
|
1984
1984
|
else {
|
|
@@ -1992,7 +1992,7 @@ function wi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
|
1992
1992
|
l.clear();
|
|
1993
1993
|
}), [s, l]), /* @__PURE__ */ n(U, { children: [
|
|
1994
1994
|
/* @__PURE__ */ e(
|
|
1995
|
-
|
|
1995
|
+
ya,
|
|
1996
1996
|
{
|
|
1997
1997
|
autoFocus: !0,
|
|
1998
1998
|
className: "w-full sticky top-0 z-10",
|
|
@@ -2036,7 +2036,7 @@ function _i({
|
|
|
2036
2036
|
isSubmitting: f,
|
|
2037
2037
|
submitCount: b
|
|
2038
2038
|
} = Y(), [P, w] = L(!1), [k, g] = L(!1), v = (S) => {
|
|
2039
|
-
m("name", S), !N(d, "path") && t && S && m("path", Ct(S)), !N(d, "id") && t && S && m("id", Ct(S)), !N(d, "singularName") && t && S && m("singularName",
|
|
2039
|
+
m("name", S), !N(d, "path") && t && S && m("path", Ct(S)), !N(d, "id") && t && S && m("id", Ct(S)), !N(d, "singularName") && t && S && m("singularName", ka(S));
|
|
2040
2040
|
};
|
|
2041
2041
|
pe(() => {
|
|
2042
2042
|
c.id && g(!0);
|
|
@@ -2045,7 +2045,7 @@ function _i({
|
|
|
2045
2045
|
inputFocused: A,
|
|
2046
2046
|
autoCompleteOpen: E,
|
|
2047
2047
|
setAutoCompleteOpen: z
|
|
2048
|
-
} =
|
|
2048
|
+
} = va({
|
|
2049
2049
|
ref: l
|
|
2050
2050
|
}), q = !!o;
|
|
2051
2051
|
let B;
|
|
@@ -2116,12 +2116,12 @@ function _i({
|
|
|
2116
2116
|
}
|
|
2117
2117
|
),
|
|
2118
2118
|
/* @__PURE__ */ e(
|
|
2119
|
-
|
|
2119
|
+
wa,
|
|
2120
2120
|
{
|
|
2121
2121
|
open: E && (h ?? []).length > 0,
|
|
2122
2122
|
setOpen: z,
|
|
2123
2123
|
children: h?.map((S, O) => /* @__PURE__ */ e(
|
|
2124
|
-
|
|
2124
|
+
_a,
|
|
2125
2125
|
{
|
|
2126
2126
|
onClick: () => {
|
|
2127
2127
|
z(!1), m("group", S ?? null);
|
|
@@ -2205,7 +2205,7 @@ function _i({
|
|
|
2205
2205
|
value: p.defaultSize ?? "",
|
|
2206
2206
|
renderValue: (S) => S.toUpperCase(),
|
|
2207
2207
|
children: ["xs", "s", "m", "l", "xl"].map((S) => /* @__PURE__ */ e(
|
|
2208
|
-
|
|
2208
|
+
X,
|
|
2209
2209
|
{
|
|
2210
2210
|
value: S,
|
|
2211
2211
|
children: S.toUpperCase()
|
|
@@ -2229,15 +2229,15 @@ function _i({
|
|
|
2229
2229
|
value: "",
|
|
2230
2230
|
renderValue: (S) => S === "code_defined" ? "Code defined" : S === "true" ? "Users must define an ID" : S === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
2231
2231
|
children: [
|
|
2232
|
-
/* @__PURE__ */ e(
|
|
2233
|
-
/* @__PURE__ */ e(
|
|
2234
|
-
/* @__PURE__ */ e(
|
|
2232
|
+
/* @__PURE__ */ e(X, { value: "false", children: "Document ID is generated automatically" }),
|
|
2233
|
+
/* @__PURE__ */ e(X, { value: "true", children: "Users must define an ID" }),
|
|
2234
|
+
/* @__PURE__ */ e(X, { value: "optional", children: "Users can define an ID, but it is not required" })
|
|
2235
2235
|
]
|
|
2236
2236
|
}
|
|
2237
2237
|
) }),
|
|
2238
2238
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2239
2239
|
/* @__PURE__ */ e(
|
|
2240
|
-
|
|
2240
|
+
Yt,
|
|
2241
2241
|
{
|
|
2242
2242
|
position: "start",
|
|
2243
2243
|
label: "Collection group",
|
|
@@ -2356,7 +2356,7 @@ function Ci({
|
|
|
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(
|
|
2359
|
+
/* @__PURE__ */ e(xa, {}),
|
|
2360
2360
|
/* @__PURE__ */ e(
|
|
2361
2361
|
C,
|
|
2362
2362
|
{
|
|
@@ -2393,7 +2393,7 @@ function Ci({
|
|
|
2393
2393
|
] }),
|
|
2394
2394
|
/* @__PURE__ */ n(qe, { className: "p-4 m-1", children: [
|
|
2395
2395
|
/* @__PURE__ */ e(
|
|
2396
|
-
|
|
2396
|
+
Ca,
|
|
2397
2397
|
{
|
|
2398
2398
|
value: t.enumValues,
|
|
2399
2399
|
addLabel: "Add enum value",
|
|
@@ -2582,7 +2582,7 @@ function Ue({
|
|
|
2582
2582
|
values: u,
|
|
2583
2583
|
handleChange: d,
|
|
2584
2584
|
errors: c
|
|
2585
|
-
} = Y(), y = "validation.length", f = "validation.min", b = "validation.max", P = "validation.trim", w = "validation.matches", k = "validation.lowercase", g = "validation.uppercase", v = N(c, w), _ = N(u, w), h = typeof _ == "string" ? _ :
|
|
2585
|
+
} = Y(), y = "validation.length", f = "validation.min", b = "validation.max", P = "validation.trim", w = "validation.matches", k = "validation.lowercase", g = "validation.uppercase", v = N(c, w), _ = N(u, w), h = typeof _ == "string" ? _ : Oa(_);
|
|
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: w,
|
|
2663
2663
|
as: W,
|
|
2664
|
-
validate: (A) => A && !
|
|
2664
|
+
validate: (A) => A && !Na(A),
|
|
2665
2665
|
label: "Matches regex",
|
|
2666
2666
|
size: "small",
|
|
2667
2667
|
disabled: p,
|
|
@@ -2720,7 +2720,7 @@ function ze({
|
|
|
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(
|
|
2723
|
+
/* @__PURE__ */ e(Pa, {}),
|
|
2724
2724
|
/* @__PURE__ */ e(
|
|
2725
2725
|
C,
|
|
2726
2726
|
{
|
|
@@ -2749,7 +2749,7 @@ function Bt({
|
|
|
2749
2749
|
touched: u,
|
|
2750
2750
|
setFieldError: d,
|
|
2751
2751
|
setFieldValue: c
|
|
2752
|
-
} = Y(), y = De(), f = t ? "of.enumValues" : "enumValues", b = N(l, "defaultValue"), P = N(l, f), w =
|
|
2752
|
+
} = Y(), y = De(), f = t ? "of.enumValues" : "enumValues", b = N(l, "defaultValue"), P = N(l, f), w = ta(() => !P || typeof P == "boolean" ? [] : Sa(P) ?? [], [P]);
|
|
2753
2753
|
return /* @__PURE__ */ n(U, { children: [
|
|
2754
2754
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2755
2755
|
xi,
|
|
@@ -2794,7 +2794,7 @@ function Bt({
|
|
|
2794
2794
|
label: "Default value",
|
|
2795
2795
|
value: b ?? "",
|
|
2796
2796
|
children: w.filter((g) => !!g?.id).map((g) => /* @__PURE__ */ e(
|
|
2797
|
-
|
|
2797
|
+
X,
|
|
2798
2798
|
{
|
|
2799
2799
|
value: g.id?.toString(),
|
|
2800
2800
|
children: g.label
|
|
@@ -2828,7 +2828,7 @@ function Mt({
|
|
|
2828
2828
|
Ot,
|
|
2829
2829
|
{
|
|
2830
2830
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2831
|
-
/* @__PURE__ */ e(
|
|
2831
|
+
/* @__PURE__ */ e(qa, {}),
|
|
2832
2832
|
/* @__PURE__ */ e(
|
|
2833
2833
|
C,
|
|
2834
2834
|
{
|
|
@@ -2840,7 +2840,7 @@ function Mt({
|
|
|
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
|
-
|
|
2843
|
+
Aa,
|
|
2844
2844
|
{
|
|
2845
2845
|
disabled: i,
|
|
2846
2846
|
name: l,
|
|
@@ -2977,9 +2977,9 @@ function oa({
|
|
|
2977
2977
|
{
|
|
2978
2978
|
className: xe(
|
|
2979
2979
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
2980
|
-
|
|
2981
|
-
a ?
|
|
2982
|
-
o ?
|
|
2980
|
+
Gt,
|
|
2981
|
+
a ? Ht : "",
|
|
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
|
),
|
|
@@ -3043,19 +3043,19 @@ function Ai({
|
|
|
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(
|
|
3046
|
+
children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
|
|
3047
3047
|
}
|
|
3048
3048
|
),
|
|
3049
|
-
/* @__PURE__ */ e(
|
|
3049
|
+
/* @__PURE__ */ e(Ta, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
3050
3050
|
] }),
|
|
3051
3051
|
/* @__PURE__ */ e(
|
|
3052
3052
|
qe,
|
|
3053
3053
|
{
|
|
3054
3054
|
className: xe(
|
|
3055
3055
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
3056
|
-
|
|
3057
|
-
i ?
|
|
3058
|
-
a ?
|
|
3056
|
+
Gt,
|
|
3057
|
+
i ? Ht : "",
|
|
3058
|
+
a ? Wt : "",
|
|
3059
3059
|
"flex-grow p-4 border transition-colors duration-200",
|
|
3060
3060
|
a ? "border-blue-500" : "border-transparent"
|
|
3061
3061
|
),
|
|
@@ -3129,7 +3129,7 @@ function ft({
|
|
|
3129
3129
|
inferredPropertyKeys: d,
|
|
3130
3130
|
collectionEditable: c
|
|
3131
3131
|
}) {
|
|
3132
|
-
const y = s ?? Object.keys(r), f =
|
|
3132
|
+
const y = s ?? Object.keys(r), f = ee((b) => {
|
|
3133
3133
|
if (!b.destination)
|
|
3134
3134
|
return;
|
|
3135
3135
|
const P = b.source.index, w = b.destination.index, k = Array.from(y), [g] = k.splice(P, 1);
|
|
@@ -3254,7 +3254,7 @@ function zi({
|
|
|
3254
3254
|
size: "small",
|
|
3255
3255
|
color: "inherit",
|
|
3256
3256
|
onClick: () => u(t, a),
|
|
3257
|
-
children: /* @__PURE__ */ e(
|
|
3257
|
+
children: /* @__PURE__ */ e(Va, { size: "small" })
|
|
3258
3258
|
}
|
|
3259
3259
|
) }),
|
|
3260
3260
|
m && /* @__PURE__ */ e(re, { title: "Move", children: /* @__PURE__ */ e(
|
|
@@ -3262,7 +3262,7 @@ function zi({
|
|
|
3262
3262
|
{
|
|
3263
3263
|
component: "span",
|
|
3264
3264
|
size: "small",
|
|
3265
|
-
children: /* @__PURE__ */ e(
|
|
3265
|
+
children: /* @__PURE__ */ e(Ia, { size: "small" })
|
|
3266
3266
|
}
|
|
3267
3267
|
) })
|
|
3268
3268
|
] }),
|
|
@@ -3275,7 +3275,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3275
3275
|
const {
|
|
3276
3276
|
values: o,
|
|
3277
3277
|
setFieldValue: l
|
|
3278
|
-
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b =
|
|
3278
|
+
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = ee(({
|
|
3279
3279
|
id: h,
|
|
3280
3280
|
property: A
|
|
3281
3281
|
}) => {
|
|
@@ -3285,7 +3285,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3285
3285
|
...o.properties ?? {},
|
|
3286
3286
|
[h]: A
|
|
3287
3287
|
}, !1), l("propertiesOrder", [...f, h], !1), m(!1);
|
|
3288
|
-
}, [o.properties, f]), P =
|
|
3288
|
+
}, [o.properties, f]), P = ee((h, A) => {
|
|
3289
3289
|
const E = h ? ce(h, A) : void 0;
|
|
3290
3290
|
if (!E)
|
|
3291
3291
|
throw Error("collection editor miss config");
|
|
@@ -3303,7 +3303,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3303
3303
|
o.name ?? "this group"
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
|
-
), v = !f || f.length < 1, _ =
|
|
3306
|
+
), v = !f || f.length < 1, _ = ee((h, A) => {
|
|
3307
3307
|
l(Pe(A), h, !1);
|
|
3308
3308
|
}, []);
|
|
3309
3309
|
return /* @__PURE__ */ n(U, { children: [
|
|
@@ -3338,7 +3338,7 @@ function Ti({ 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
|
-
|
|
3341
|
+
Yt,
|
|
3342
3342
|
{
|
|
3343
3343
|
position: "start",
|
|
3344
3344
|
size: "small",
|
|
@@ -3393,7 +3393,7 @@ function Vi({
|
|
|
3393
3393
|
errors: u,
|
|
3394
3394
|
setFieldValue: d,
|
|
3395
3395
|
touched: c
|
|
3396
|
-
} = Y(), [y, f] = L(!1), b = N(p, "of"), P = N(c, "of") && N(u, "of"), w =
|
|
3396
|
+
} = Y(), [y, f] = L(!1), b = N(p, "of"), P = N(c, "of") && N(u, "of"), w = ee(({ id: g, property: v, namespace: _ }) => {
|
|
3397
3397
|
d("of", v);
|
|
3398
3398
|
}, []), k = b && Ze(b, o);
|
|
3399
3399
|
return /* @__PURE__ */ n(U, { children: [
|
|
@@ -3619,7 +3619,7 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3619
3619
|
const {
|
|
3620
3620
|
values: o,
|
|
3621
3621
|
setFieldValue: l
|
|
3622
|
-
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), f =
|
|
3622
|
+
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), f = ee(({
|
|
3623
3623
|
id: v,
|
|
3624
3624
|
property: _
|
|
3625
3625
|
}) => {
|
|
@@ -3629,7 +3629,7 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3629
3629
|
...o.oneOf?.properties ?? {},
|
|
3630
3630
|
[v]: _
|
|
3631
3631
|
}, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), v], !1), m(!1);
|
|
3632
|
-
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, c) : void 0, P = b ? N(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, w =
|
|
3632
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, c) : void 0, P = b ? N(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, w = ee((v, _) => {
|
|
3633
3633
|
const h = v ? ce(v, _) : void 0;
|
|
3634
3634
|
if (!h)
|
|
3635
3635
|
throw Error("collection editor miss config");
|
|
@@ -3648,7 +3648,7 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3648
3648
|
o.name ?? "this block"
|
|
3649
3649
|
]
|
|
3650
3650
|
}
|
|
3651
|
-
), g =
|
|
3651
|
+
), g = ee((v, _) => {
|
|
3652
3652
|
l(`oneOf.${Pe(_)}`, v, !1);
|
|
3653
3653
|
}, []);
|
|
3654
3654
|
return /* @__PURE__ */ n(U, { children: [
|
|
@@ -3898,7 +3898,7 @@ function Li({
|
|
|
3898
3898
|
children: p.filter((c) => c.group === d).map((c) => {
|
|
3899
3899
|
const y = ct(c);
|
|
3900
3900
|
return /* @__PURE__ */ e(
|
|
3901
|
-
|
|
3901
|
+
X,
|
|
3902
3902
|
{
|
|
3903
3903
|
value: c.id ?? c.path,
|
|
3904
3904
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3922,7 +3922,7 @@ function Li({
|
|
|
3922
3922
|
u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((d) => {
|
|
3923
3923
|
const c = ct(d);
|
|
3924
3924
|
return /* @__PURE__ */ e(
|
|
3925
|
-
|
|
3925
|
+
X,
|
|
3926
3926
|
{
|
|
3927
3927
|
value: d.id ?? d.path,
|
|
3928
3928
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3975,8 +3975,8 @@ function Ki({ disabled: t }) {
|
|
|
3975
3975
|
},
|
|
3976
3976
|
disabled: t,
|
|
3977
3977
|
children: [
|
|
3978
|
-
/* @__PURE__ */ e(
|
|
3979
|
-
/* @__PURE__ */ e(
|
|
3978
|
+
/* @__PURE__ */ e(X, { value: "date_time", children: " Date/Time " }),
|
|
3979
|
+
/* @__PURE__ */ e(X, { value: "date", children: " Date " })
|
|
3980
3980
|
]
|
|
3981
3981
|
}
|
|
3982
3982
|
),
|
|
@@ -4001,9 +4001,9 @@ function Ki({ disabled: t }) {
|
|
|
4001
4001
|
error: !!d,
|
|
4002
4002
|
label: "Automatic value",
|
|
4003
4003
|
children: [
|
|
4004
|
-
/* @__PURE__ */ e(
|
|
4005
|
-
/* @__PURE__ */ e(
|
|
4006
|
-
/* @__PURE__ */ e(
|
|
4004
|
+
/* @__PURE__ */ e(X, { value: "", children: " None " }),
|
|
4005
|
+
/* @__PURE__ */ e(X, { value: "on_create", children: " On create " }),
|
|
4006
|
+
/* @__PURE__ */ e(X, { value: "on_update", children: " On any update " })
|
|
4007
4007
|
]
|
|
4008
4008
|
}
|
|
4009
4009
|
),
|
|
@@ -4255,7 +4255,7 @@ function na(t, a, i) {
|
|
|
4255
4255
|
}
|
|
4256
4256
|
function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
|
|
4257
4257
|
return /* @__PURE__ */ e(
|
|
4258
|
-
|
|
4258
|
+
X,
|
|
4259
4259
|
{
|
|
4260
4260
|
value: t,
|
|
4261
4261
|
disabled: a,
|
|
@@ -4316,10 +4316,10 @@ function Hi({
|
|
|
4316
4316
|
},
|
|
4317
4317
|
value: s ?? "[NONE]",
|
|
4318
4318
|
children: [
|
|
4319
|
-
/* @__PURE__ */ e(
|
|
4320
|
-
/* @__PURE__ */ e(
|
|
4321
|
-
/* @__PURE__ */ e(
|
|
4322
|
-
/* @__PURE__ */ e(
|
|
4319
|
+
/* @__PURE__ */ e(X, { value: "[NONE]", children: "Display URL" }),
|
|
4320
|
+
/* @__PURE__ */ e(X, { value: "image", children: "Image" }),
|
|
4321
|
+
/* @__PURE__ */ e(X, { value: "video", children: "Video" }),
|
|
4322
|
+
/* @__PURE__ */ e(X, { value: "audio", children: "Audio" })
|
|
4323
4323
|
]
|
|
4324
4324
|
}
|
|
4325
4325
|
) }),
|
|
@@ -4368,7 +4368,7 @@ const Wi = [
|
|
|
4368
4368
|
"key_value",
|
|
4369
4369
|
"repeat",
|
|
4370
4370
|
"block"
|
|
4371
|
-
], la = Object.entries(
|
|
4371
|
+
], la = Object.entries(Jt).filter(([t]) => Wi.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = K.memo(
|
|
4372
4372
|
function({
|
|
4373
4373
|
includeIdAndName: a = !0,
|
|
4374
4374
|
autoOpenTypeSelect: i,
|
|
@@ -4535,7 +4535,7 @@ function Ji({
|
|
|
4535
4535
|
propertyConfigs: v,
|
|
4536
4536
|
collectionEditable: _
|
|
4537
4537
|
}) {
|
|
4538
|
-
const [h, A] = L(p), [E, z] = L(!1), [q, B] = L(t?.dataType ?
|
|
4538
|
+
const [h, A] = L(p), [E, z] = L(!1), [q, B] = L(t?.dataType ? Qt(t) : void 0), S = Object.entries(la).concat(Object.entries(v)), O = P ? S.filter(([J, te]) => !oe(te.property) && te.property?.dataType !== "array") : S, j = Za(t), x = He(null), I = He(t), ge = "id", ye = f && N(a, "selectedWidget");
|
|
4539
4539
|
pe(() => {
|
|
4540
4540
|
!N(i, ge) && l && t?.name && s(ge, Ct(t.name));
|
|
4541
4541
|
}, [l, i, t?.name]), pe(() => {
|
|
@@ -4553,7 +4553,7 @@ function Ji({
|
|
|
4553
4553
|
}, [j, m, u, c]), pe(() => {
|
|
4554
4554
|
t?.id && y && Object.keys(a).length > 0 && y(t?.id, c, a);
|
|
4555
4555
|
}, [a, y, c, t?.id]);
|
|
4556
|
-
const
|
|
4556
|
+
const Q = (J) => {
|
|
4557
4557
|
B(J), r(na(t, J, v)), setTimeout(() => {
|
|
4558
4558
|
x.current?.focus();
|
|
4559
4559
|
}, 0);
|
|
@@ -4652,7 +4652,7 @@ function Ji({
|
|
|
4652
4652
|
propertyConfigs: v
|
|
4653
4653
|
}
|
|
4654
4654
|
) : q === "key_value" ? $ = /* @__PURE__ */ e(Gi, { disabled: b }) : $ = null, /* @__PURE__ */ n(U, { children: [
|
|
4655
|
-
b && /* @__PURE__ */ n(
|
|
4655
|
+
b && /* @__PURE__ */ n(Zt, { mode: "warn", children: [
|
|
4656
4656
|
/* @__PURE__ */ e(C, { children: "This property can't be edited" }),
|
|
4657
4657
|
/* @__PURE__ */ n(C, { variant: "caption", children: [
|
|
4658
4658
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -4675,7 +4675,7 @@ function Ji({
|
|
|
4675
4675
|
renderValue: (J) => {
|
|
4676
4676
|
if (!J)
|
|
4677
4677
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4678
|
-
const te = J, me =
|
|
4678
|
+
const te = J, me = Jt[te] ?? v[te], ue = me.property, fe = ue && !oe(ue) ? Ze(ue, v) : void 0, ve = oe(ue) || o && ue.dataType !== t?.dataType, Ce = fe ? G(fe, me) : me;
|
|
4679
4679
|
return /* @__PURE__ */ n(
|
|
4680
4680
|
"div",
|
|
4681
4681
|
{
|
|
@@ -4704,7 +4704,7 @@ function Ji({
|
|
|
4704
4704
|
);
|
|
4705
4705
|
},
|
|
4706
4706
|
onValueChange: (J) => {
|
|
4707
|
-
|
|
4707
|
+
Q(J);
|
|
4708
4708
|
},
|
|
4709
4709
|
children: O.map(([J, te]) => {
|
|
4710
4710
|
const me = te.property, ue = o && !oe(me) && me.dataType !== t?.dataType;
|
|
@@ -4825,7 +4825,7 @@ const ` + Qi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), nu
|
|
|
4825
4825
|
message: "Copied"
|
|
4826
4826
|
}), navigator.clipboard.writeText(s)),
|
|
4827
4827
|
children: [
|
|
4828
|
-
/* @__PURE__ */ e(
|
|
4828
|
+
/* @__PURE__ */ e(Fa, { size: "small" }),
|
|
4829
4829
|
"Copy to clipboard"
|
|
4830
4830
|
]
|
|
4831
4831
|
}
|
|
@@ -4886,7 +4886,7 @@ function Xi({
|
|
|
4886
4886
|
setFieldTouched: P,
|
|
4887
4887
|
errors: w,
|
|
4888
4888
|
dirty: k
|
|
4889
|
-
} = Y(), g = De(), v =
|
|
4889
|
+
} = Y(), g = De(), v = ja("lg"), _ = !v, [h, A] = L(), [E, z] = L(), [q, B] = L(), S = E ? ce(E, q) : void 0, O = S ? N(y.properties, S.replaceAll(".", ".properties.")) : void 0, [j, x] = L(!1), [I, ge] = L(!1), [ye, Q] = L(!1), [$, J] = L([]), te = K.useRef(y.propertiesOrder ? { "": y.propertiesOrder } : {});
|
|
4890
4890
|
pe(() => {
|
|
4891
4891
|
s && s(k);
|
|
4892
4892
|
}, [k]);
|
|
@@ -4927,7 +4927,7 @@ function Xi({
|
|
|
4927
4927
|
throw Error("collection editor miss config");
|
|
4928
4928
|
f(ke(H), void 0, !1);
|
|
4929
4929
|
const le = ue(D).filter((we) => we !== V);
|
|
4930
|
-
fe(le, D),
|
|
4930
|
+
fe(le, D), Q(!1), A(void 0), z(void 0), B(void 0);
|
|
4931
4931
|
}, Ce = (V, D) => {
|
|
4932
4932
|
f(Pe(D), V, !1);
|
|
4933
4933
|
}, ae = ({
|
|
@@ -4941,7 +4941,7 @@ function Xi({
|
|
|
4941
4941
|
[V]: D
|
|
4942
4942
|
}, !1);
|
|
4943
4943
|
const H = [...y.propertiesOrder ?? Object.keys(y.properties), V];
|
|
4944
|
-
fe(H),
|
|
4944
|
+
fe(H), Q(!1), v && (A(H.indexOf(V)), z(V)), B(void 0);
|
|
4945
4945
|
}, Ve = ({
|
|
4946
4946
|
id: V,
|
|
4947
4947
|
property: D,
|
|
@@ -4950,8 +4950,8 @@ function Xi({
|
|
|
4950
4950
|
}) => {
|
|
4951
4951
|
const le = V ? ce(V, se) : void 0, we = le ? ke(le) : void 0;
|
|
4952
4952
|
if (H && H !== V) {
|
|
4953
|
-
const yt = ce(H, se), it = ke(yt),
|
|
4954
|
-
fe(
|
|
4953
|
+
const yt = ce(H, se), it = ke(yt), Z = ue(se).map((Ie) => Ie === H ? V : Ie).filter((Ie) => Ie !== void 0);
|
|
4954
|
+
fe(Z, se), V && (A(Z.indexOf(V)), z(V)), f(it, void 0, !1), P(it, !1, !1);
|
|
4955
4955
|
}
|
|
4956
4956
|
we && (f(we, D, !1), P(we, !0, !1));
|
|
4957
4957
|
}, tt = (V, D, H) => {
|
|
@@ -4967,7 +4967,7 @@ function Xi({
|
|
|
4967
4967
|
}
|
|
4968
4968
|
}, bt = () => {
|
|
4969
4969
|
A(void 0), z(void 0);
|
|
4970
|
-
}, T = E && i?.current?.properties ? i.current.properties[E] : void 0, F = y?.propertiesOrder === void 0 || y.propertiesOrder.length === 0, M = y.propertiesOrder ? y.propertiesOrder : Object.keys(y.properties), Oe =
|
|
4970
|
+
}, T = E && i?.current?.properties ? i.current.properties[E] : void 0, F = y?.propertiesOrder === void 0 || y.propertiesOrder.length === 0, M = y.propertiesOrder ? y.propertiesOrder : Object.keys(y.properties), Oe = ta(() => p(y.ownerId), [p, y.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4971
4971
|
/* @__PURE__ */ n("div", { className: xe(
|
|
4972
4972
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4973
4973
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
@@ -5010,7 +5010,7 @@ function Xi({
|
|
|
5010
5010
|
variant: "filled",
|
|
5011
5011
|
disabled: I,
|
|
5012
5012
|
onClick: () => x(!0),
|
|
5013
|
-
children: /* @__PURE__ */ e(
|
|
5013
|
+
children: /* @__PURE__ */ e(Ea, {})
|
|
5014
5014
|
}
|
|
5015
5015
|
) }),
|
|
5016
5016
|
me && /* @__PURE__ */ e(re, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
@@ -5026,7 +5026,7 @@ function Xi({
|
|
|
5026
5026
|
R,
|
|
5027
5027
|
{
|
|
5028
5028
|
variant: "outlined",
|
|
5029
|
-
onClick: () =>
|
|
5029
|
+
onClick: () => Q(!0),
|
|
5030
5030
|
children: /* @__PURE__ */ e(Ae, {})
|
|
5031
5031
|
}
|
|
5032
5032
|
) })
|
|
@@ -5057,7 +5057,7 @@ function Xi({
|
|
|
5057
5057
|
color: "primary",
|
|
5058
5058
|
variant: "outlined",
|
|
5059
5059
|
size: "large",
|
|
5060
|
-
onClick: () =>
|
|
5060
|
+
onClick: () => Q(!0),
|
|
5061
5061
|
startIcon: /* @__PURE__ */ e(Ae, {}),
|
|
5062
5062
|
children: "Add new property"
|
|
5063
5063
|
}
|
|
@@ -5131,7 +5131,7 @@ function Xi({
|
|
|
5131
5131
|
autoUpdateId: !0,
|
|
5132
5132
|
forceShowErrors: t,
|
|
5133
5133
|
open: ye,
|
|
5134
|
-
onCancel: () =>
|
|
5134
|
+
onCancel: () => Q(!1),
|
|
5135
5135
|
onPropertyChanged: ae,
|
|
5136
5136
|
getData: m,
|
|
5137
5137
|
allowDataInference: !a,
|
|
@@ -5223,7 +5223,7 @@ function ar({
|
|
|
5223
5223
|
const { entityViews: l } = Ke(), [p, m] = K.useState(), [u, d] = K.useState(!1), [c, y] = K.useState(), [f, b] = K.useState(), {
|
|
5224
5224
|
values: P,
|
|
5225
5225
|
setFieldValue: w
|
|
5226
|
-
} = Y(), k = t.subcollections ?? [], g = P.entityViews?.filter((h) => typeof h == "string").map((h) =>
|
|
5226
|
+
} = Y(), k = t.subcollections ?? [], g = P.entityViews?.filter((h) => typeof h == "string").map((h) => Da(h, l)).filter(Boolean) ?? [], v = t.entityViews?.filter((h) => typeof h != "string") ?? [], _ = g.length + v.length;
|
|
5227
5227
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
5228
5228
|
/* @__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: [
|
|
5229
5229
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
@@ -5324,7 +5324,7 @@ function ar({
|
|
|
5324
5324
|
}
|
|
5325
5325
|
) }, h.key))
|
|
5326
5326
|
] }) }) }) }),
|
|
5327
|
-
_ === 0 && /* @__PURE__ */ n(
|
|
5327
|
+
_ === 0 && /* @__PURE__ */ n(Zt, { children: [
|
|
5328
5328
|
/* @__PURE__ */ e("b", { children: "COMING SOON" }),
|
|
5329
5329
|
" Define your own custom views by uploading it with the CLI"
|
|
5330
5330
|
] }),
|
|
@@ -5763,7 +5763,7 @@ function kt({
|
|
|
5763
5763
|
onClick: r
|
|
5764
5764
|
}) {
|
|
5765
5765
|
return /* @__PURE__ */ e(re, { title: a, children: /* @__PURE__ */ n(
|
|
5766
|
-
|
|
5766
|
+
Xt,
|
|
5767
5767
|
{
|
|
5768
5768
|
onClick: r,
|
|
5769
5769
|
className: xe(
|
|
@@ -5905,7 +5905,7 @@ function or({
|
|
|
5905
5905
|
propertyConfigs: r,
|
|
5906
5906
|
disabled: s
|
|
5907
5907
|
}) {
|
|
5908
|
-
const o = t ?
|
|
5908
|
+
const o = t ? Qt(t) : null, l = t ? Ze(t, r) : null, [p, m] = L(!1);
|
|
5909
5909
|
return /* @__PURE__ */ e(
|
|
5910
5910
|
re,
|
|
5911
5911
|
{
|
|
@@ -5953,9 +5953,9 @@ function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
|
5953
5953
|
const s = ui(t.originProperties, a), o = t.importData.map((l) => hi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
|
|
5954
5954
|
t.setEntities(o);
|
|
5955
5955
|
}, []);
|
|
5956
|
-
const r =
|
|
5956
|
+
const r = Ba();
|
|
5957
5957
|
return /* @__PURE__ */ e(
|
|
5958
|
-
|
|
5958
|
+
Ma,
|
|
5959
5959
|
{
|
|
5960
5960
|
title: /* @__PURE__ */ n("div", { children: [
|
|
5961
5961
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -5977,7 +5977,7 @@ function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
|
5977
5977
|
}
|
|
5978
5978
|
function pa(t, a = "") {
|
|
5979
5979
|
const i = Object.keys(t).reduce((o, l) => {
|
|
5980
|
-
const p = t[l], m =
|
|
5980
|
+
const p = t[l], m = Ra(l), u = a ? `${a}.${m}` : m;
|
|
5981
5981
|
if (p.dataType === "map" && p.properties) {
|
|
5982
5982
|
const y = pa(p.properties, u);
|
|
5983
5983
|
return {
|
|
@@ -6008,7 +6008,7 @@ function pa(t, a = "") {
|
|
|
6008
6008
|
};
|
|
6009
6009
|
}
|
|
6010
6010
|
function ma(t) {
|
|
6011
|
-
const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l =
|
|
6011
|
+
const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l = ee(() => {
|
|
6012
6012
|
i ? o(!0) : t.handleClose(void 0);
|
|
6013
6013
|
}, [i, t.handleClose]);
|
|
6014
6014
|
return pe(() => {
|
|
@@ -6070,7 +6070,7 @@ function sr({
|
|
|
6070
6070
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
6071
6071
|
const {
|
|
6072
6072
|
groups: q
|
|
6073
|
-
} = g, B = De(), S = Ye(), O = He({}), j = t ? _ ? "welcome" : "details" : "properties", [x, I] = L(j), [ge, ye] = _e.useState(), [
|
|
6073
|
+
} = g, B = De(), S = Ye(), O = He({}), j = t ? _ ? "welcome" : "details" : "properties", [x, I] = L(j), [ge, ye] = _e.useState(), [Q, $] = _e.useState(), [J, te] = _e.useState(!1), [me, ue] = _e.useState();
|
|
6074
6074
|
pe(() => {
|
|
6075
6075
|
try {
|
|
6076
6076
|
k.initialised && ($(r ? k.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
|
|
@@ -6089,9 +6089,9 @@ function sr({
|
|
|
6089
6089
|
type: "error",
|
|
6090
6090
|
message: "Error persisting collection: " + (M.message ?? "Details in the console")
|
|
6091
6091
|
}), !1));
|
|
6092
|
-
}, ve =
|
|
6093
|
-
...
|
|
6094
|
-
id:
|
|
6092
|
+
}, ve = Q ? {
|
|
6093
|
+
...Q,
|
|
6094
|
+
id: Q.id ?? Q.path ?? jt(16)
|
|
6095
6095
|
} : void 0, Ce = ve ? lr(ve, w) : {
|
|
6096
6096
|
id: a?.path ?? jt(16),
|
|
6097
6097
|
path: a?.path ?? "",
|
|
@@ -6101,12 +6101,12 @@ function sr({
|
|
|
6101
6101
|
propertiesOrder: [],
|
|
6102
6102
|
icon: xt[Math.floor(Math.random() * xt.length)],
|
|
6103
6103
|
ownerId: S.user?.uid ?? ""
|
|
6104
|
-
}, ae =
|
|
6104
|
+
}, ae = ee(() => {
|
|
6105
6105
|
x === "details" ? z.inUse ? I("import_data_saving") : I(u ? "extra_view" : "properties") : I(x === "welcome" ? "details" : x === "import_data_mapping" ? "import_data_preview" : x === "import_data_preview" ? "details" : x === "extra_view" ? "properties" : "details");
|
|
6106
|
-
}, [x, z.inUse, u]), Ve =
|
|
6106
|
+
}, [x, z.inUse, u]), Ve = ee((T) => {
|
|
6107
6107
|
if (l)
|
|
6108
6108
|
return l?.(T.path, T.collectionGroup ?? !1, s ?? []);
|
|
6109
|
-
}, [l, s]), tt =
|
|
6109
|
+
}, [l, s]), tt = ee(async (T) => {
|
|
6110
6110
|
try {
|
|
6111
6111
|
if (!Ve)
|
|
6112
6112
|
return $(T), Promise.resolve(T);
|
|
@@ -6180,27 +6180,33 @@ function sr({
|
|
|
6180
6180
|
isSubmitting: Oe,
|
|
6181
6181
|
dirty: at,
|
|
6182
6182
|
submitCount: V
|
|
6183
|
-
} = T, D = F.path ?? r, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + D : D
|
|
6183
|
+
} = T, D = F.path ?? r, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + D : D;
|
|
6184
|
+
console.log("CollectionEditorDialog", {
|
|
6185
|
+
fullPath: o,
|
|
6186
|
+
path: D,
|
|
6187
|
+
updatedFullPath: H
|
|
6188
|
+
});
|
|
6189
|
+
const se = k.resolveAliasesFrom(H), le = se && P ? () => P(se) : void 0;
|
|
6184
6190
|
pe(() => {
|
|
6185
6191
|
c(at);
|
|
6186
6192
|
}, [at]);
|
|
6187
|
-
function we(
|
|
6188
|
-
z.setInUse(!0), ii(
|
|
6193
|
+
function we(Z) {
|
|
6194
|
+
z.setInUse(!0), ii(Z, ia).then((Ie) => {
|
|
6189
6195
|
const Fe = pa(Ie);
|
|
6190
|
-
M("properties", Fe.properties), M("propertiesOrder", Object.keys(Fe.properties)), z.setIdColumn(Fe.idColumn), z.setImportData(
|
|
6196
|
+
M("properties", Fe.properties), M("propertiesOrder", Object.keys(Fe.properties)), z.setIdColumn(Fe.idColumn), z.setImportData(Z), z.setHeadersMapping(Fe.headersMapping), z.setOriginProperties(Fe.properties);
|
|
6191
6197
|
});
|
|
6192
6198
|
}
|
|
6193
6199
|
const yt = !!F.name && !!F.id, it = () => {
|
|
6194
|
-
const
|
|
6195
|
-
z.idColumn && delete
|
|
6196
|
-
}, vt =
|
|
6200
|
+
const Z = { ...F.properties };
|
|
6201
|
+
z.idColumn && delete Z[z.idColumn], M("properties", Z), ae();
|
|
6202
|
+
}, vt = Q?.editable || t;
|
|
6197
6203
|
return /* @__PURE__ */ n(U, { children: [
|
|
6198
6204
|
!t && /* @__PURE__ */ n(
|
|
6199
|
-
|
|
6205
|
+
Ua,
|
|
6200
6206
|
{
|
|
6201
6207
|
value: x,
|
|
6202
6208
|
className: xe(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
6203
|
-
onValueChange: (
|
|
6209
|
+
onValueChange: (Z) => I(Z),
|
|
6204
6210
|
children: [
|
|
6205
6211
|
/* @__PURE__ */ e(_t, { value: "details", children: "Details" }),
|
|
6206
6212
|
/* @__PURE__ */ e(_t, { value: "properties", children: "Properties" }),
|
|
@@ -6223,8 +6229,8 @@ function sr({
|
|
|
6223
6229
|
ir,
|
|
6224
6230
|
{
|
|
6225
6231
|
path: D,
|
|
6226
|
-
onContinue: (
|
|
6227
|
-
|
|
6232
|
+
onContinue: (Z) => {
|
|
6233
|
+
Z ? (we(Z), I("import_data_mapping")) : I("details");
|
|
6228
6234
|
},
|
|
6229
6235
|
collections: v,
|
|
6230
6236
|
parentCollection: b,
|
|
@@ -6252,8 +6258,8 @@ function sr({
|
|
|
6252
6258
|
{
|
|
6253
6259
|
importConfig: z,
|
|
6254
6260
|
collection: F,
|
|
6255
|
-
onImportSuccess: (
|
|
6256
|
-
p(
|
|
6261
|
+
onImportSuccess: (Z) => {
|
|
6262
|
+
p(Z), B.open({
|
|
6257
6263
|
type: "info",
|
|
6258
6264
|
message: "Data imported successfully"
|
|
6259
6265
|
});
|
|
@@ -6270,7 +6276,7 @@ function sr({
|
|
|
6270
6276
|
isNewCollection: t
|
|
6271
6277
|
}
|
|
6272
6278
|
),
|
|
6273
|
-
x === "subcollections" &&
|
|
6279
|
+
x === "subcollections" && Q && /* @__PURE__ */ e(
|
|
6274
6280
|
ar,
|
|
6275
6281
|
{
|
|
6276
6282
|
parentCollection: b,
|
|
@@ -6278,7 +6284,7 @@ function sr({
|
|
|
6278
6284
|
getUser: f,
|
|
6279
6285
|
collectionInference: l,
|
|
6280
6286
|
parentCollectionIds: s,
|
|
6281
|
-
collection:
|
|
6287
|
+
collection: Q
|
|
6282
6288
|
}
|
|
6283
6289
|
),
|
|
6284
6290
|
x === "properties" && /* @__PURE__ */ e(
|
|
@@ -6287,10 +6293,10 @@ function sr({
|
|
|
6287
6293
|
showErrors: V > 0,
|
|
6288
6294
|
isNewCollection: t,
|
|
6289
6295
|
reservedGroups: m,
|
|
6290
|
-
onPropertyError: (
|
|
6291
|
-
O.current =
|
|
6296
|
+
onPropertyError: (Z, Ie, Fe) => {
|
|
6297
|
+
O.current = $a({
|
|
6292
6298
|
...O.current,
|
|
6293
|
-
[
|
|
6299
|
+
[Z]: Fe
|
|
6294
6300
|
}, !0);
|
|
6295
6301
|
},
|
|
6296
6302
|
getUser: f,
|
|
@@ -6313,7 +6319,7 @@ function sr({
|
|
|
6313
6319
|
{
|
|
6314
6320
|
position: "absolute",
|
|
6315
6321
|
children: [
|
|
6316
|
-
ge && /* @__PURE__ */ e(
|
|
6322
|
+
ge && /* @__PURE__ */ e(ea, { error: ge }),
|
|
6317
6323
|
t && _ && x === "import_data_mapping" && /* @__PURE__ */ n(
|
|
6318
6324
|
R,
|
|
6319
6325
|
{
|
|
@@ -6402,7 +6408,7 @@ function sr({
|
|
|
6402
6408
|
type: "submit",
|
|
6403
6409
|
loading: Oe,
|
|
6404
6410
|
disabled: Oe || x === "details" && !yt,
|
|
6405
|
-
startIcon: x === "properties" ? /* @__PURE__ */ e(
|
|
6411
|
+
startIcon: x === "properties" ? /* @__PURE__ */ e(La, {}) : void 0,
|
|
6406
6412
|
children: [
|
|
6407
6413
|
x === "details" && "Next",
|
|
6408
6414
|
x === "properties" && "Create collection"
|
|
@@ -6480,11 +6486,11 @@ const cr = (t, a, i, r) => {
|
|
|
6480
6486
|
g(O.filter((j) => !w.includes(j.trim().toLowerCase())));
|
|
6481
6487
|
});
|
|
6482
6488
|
}, [p]);
|
|
6483
|
-
const [v, _] = K.useState(), [h, A] = K.useState(), E =
|
|
6489
|
+
const [v, _] = K.useState(), [h, A] = K.useState(), E = ee(() => ({
|
|
6484
6490
|
createCollections: !0,
|
|
6485
6491
|
editCollections: !0,
|
|
6486
6492
|
deleteCollections: !0
|
|
6487
|
-
}), []), z =
|
|
6493
|
+
}), []), z = ee(({
|
|
6488
6494
|
path: O,
|
|
6489
6495
|
fullPath: j,
|
|
6490
6496
|
parentCollectionIds: x,
|
|
@@ -6498,7 +6504,7 @@ const cr = (t, a, i, r) => {
|
|
|
6498
6504
|
parentCollection: I,
|
|
6499
6505
|
redirect: !1
|
|
6500
6506
|
});
|
|
6501
|
-
}, []), q =
|
|
6507
|
+
}, []), q = ee(({
|
|
6502
6508
|
propertyKey: O,
|
|
6503
6509
|
property: j,
|
|
6504
6510
|
editedCollectionPath: x,
|
|
@@ -6507,11 +6513,11 @@ const cr = (t, a, i, r) => {
|
|
|
6507
6513
|
collection: ye
|
|
6508
6514
|
}) => {
|
|
6509
6515
|
console.debug("edit property", O, j, x, I, ge, ye), d?.("edit_property", { propertyKey: O, editedCollectionPath: x });
|
|
6510
|
-
const
|
|
6516
|
+
const Q = O && O.includes(".") ? O.substring(0, O.lastIndexOf(".")) : void 0, $ = O && O.includes(".") ? O.substring(O.lastIndexOf(".") + 1) : O;
|
|
6511
6517
|
A({
|
|
6512
6518
|
propertyKey: $,
|
|
6513
6519
|
property: j,
|
|
6514
|
-
namespace:
|
|
6520
|
+
namespace: Q,
|
|
6515
6521
|
currentPropertiesOrder: I,
|
|
6516
6522
|
editedCollectionPath: x,
|
|
6517
6523
|
parentCollectionIds: ge,
|
|
@@ -6576,6 +6582,7 @@ const cr = (t, a, i, r) => {
|
|
|
6576
6582
|
inArray: !1,
|
|
6577
6583
|
collectionEditable: h?.collectionEditable ?? !1,
|
|
6578
6584
|
getData: u && h?.editedCollectionPath ? () => {
|
|
6585
|
+
console.debug("get data for property", h?.editedCollectionPath);
|
|
6579
6586
|
const O = c.resolveAliasesFrom(h.editedCollectionPath);
|
|
6580
6587
|
return u(O);
|
|
6581
6588
|
} : void 0,
|
|
@@ -6638,7 +6645,7 @@ const cr = (t, a, i, r) => {
|
|
|
6638
6645
|
) });
|
|
6639
6646
|
},
|
|
6640
6647
|
ut
|
|
6641
|
-
), Re = () =>
|
|
6648
|
+
), Re = () => aa(ga), fa = () => aa(ha);
|
|
6642
6649
|
function mr({
|
|
6643
6650
|
path: t,
|
|
6644
6651
|
parentCollectionIds: a,
|
|
@@ -6676,7 +6683,7 @@ function mr({
|
|
|
6676
6683
|
message: "Default config saved"
|
|
6677
6684
|
});
|
|
6678
6685
|
}),
|
|
6679
|
-
children: /* @__PURE__ */ e(
|
|
6686
|
+
children: /* @__PURE__ */ e(Ka, {})
|
|
6680
6687
|
}
|
|
6681
6688
|
)
|
|
6682
6689
|
}
|
|
@@ -6709,9 +6716,9 @@ function ur({
|
|
|
6709
6716
|
const i = De(), r = Ye(), s = fa(), o = Re(), l = o.configPermissions({
|
|
6710
6717
|
user: r.user,
|
|
6711
6718
|
collection: a
|
|
6712
|
-
}), p =
|
|
6719
|
+
}), p = ee(() => {
|
|
6713
6720
|
o?.editCollection({ path: t, parentCollectionIds: [] });
|
|
6714
|
-
}, [o, t]), [m, u] = L(!1), d =
|
|
6721
|
+
}, [o, t]), [m, u] = L(!1), d = ee(() => {
|
|
6715
6722
|
s?.deleteCollection({ path: t }).then(() => {
|
|
6716
6723
|
u(!1), i.open({
|
|
6717
6724
|
message: "Collection deleted",
|
|
@@ -6722,10 +6729,10 @@ function ur({
|
|
|
6722
6729
|
return /* @__PURE__ */ n(U, { children: [
|
|
6723
6730
|
/* @__PURE__ */ n("div", { children: [
|
|
6724
6731
|
l.deleteCollections && /* @__PURE__ */ e(
|
|
6725
|
-
|
|
6732
|
+
Ya,
|
|
6726
6733
|
{
|
|
6727
|
-
trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
6728
|
-
children: /* @__PURE__ */ n(
|
|
6734
|
+
trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ga, { size: "small" }) }),
|
|
6735
|
+
children: /* @__PURE__ */ n(Ha, { onClick: (c) => {
|
|
6729
6736
|
c.preventDefault(), c.stopPropagation(), u(!0);
|
|
6730
6737
|
}, children: [
|
|
6731
6738
|
/* @__PURE__ */ e(pt, {}),
|
|
@@ -6769,7 +6776,7 @@ function hr({
|
|
|
6769
6776
|
user: i.user
|
|
6770
6777
|
}).createCollections : !0;
|
|
6771
6778
|
return /* @__PURE__ */ e(
|
|
6772
|
-
|
|
6779
|
+
Xt,
|
|
6773
6780
|
{
|
|
6774
6781
|
className: xe("h-full p-4 min-h-[124px]"),
|
|
6775
6782
|
onClick: r && s ? () => r.createCollection({
|
|
@@ -6804,7 +6811,7 @@ function gr() {
|
|
|
6804
6811
|
user: t.user
|
|
6805
6812
|
}).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
|
|
6806
6813
|
return /* @__PURE__ */ e(
|
|
6807
|
-
|
|
6814
|
+
Wa,
|
|
6808
6815
|
{
|
|
6809
6816
|
in: o,
|
|
6810
6817
|
children: /* @__PURE__ */ n(
|
|
@@ -6883,7 +6890,7 @@ function br({
|
|
|
6883
6890
|
s.editProperty({
|
|
6884
6891
|
editedCollectionPath: t,
|
|
6885
6892
|
parentCollectionIds: a,
|
|
6886
|
-
currentPropertiesOrder:
|
|
6893
|
+
currentPropertiesOrder: Ja(i),
|
|
6887
6894
|
collection: i
|
|
6888
6895
|
});
|
|
6889
6896
|
},
|
|
@@ -6903,15 +6910,12 @@ function Ar({
|
|
|
6903
6910
|
getData: m,
|
|
6904
6911
|
onAnalyticsEvent: u
|
|
6905
6912
|
}) {
|
|
6906
|
-
const d =
|
|
6907
|
-
(
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
},
|
|
6913
|
-
[t.collections, a]
|
|
6914
|
-
);
|
|
6913
|
+
const d = (c) => {
|
|
6914
|
+
const y = (b) => {
|
|
6915
|
+
et(b.properties), b.subcollections?.forEach(y);
|
|
6916
|
+
}, f = t.collections ?? [];
|
|
6917
|
+
return f.forEach(y), Qa(c, f, [], a);
|
|
6918
|
+
};
|
|
6915
6919
|
return {
|
|
6916
6920
|
name: "Collection Editor",
|
|
6917
6921
|
loading: t.loading,
|
|
@@ -6947,7 +6951,7 @@ function Ar({
|
|
|
6947
6951
|
function zr({ path: t }) {
|
|
6948
6952
|
const a = Be(), i = yr(t), r = a.getParentCollectionIds(t), s = Re();
|
|
6949
6953
|
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6950
|
-
/* @__PURE__ */ e(
|
|
6954
|
+
/* @__PURE__ */ e(ea, { error: "No collection for path: " + i }),
|
|
6951
6955
|
/* @__PURE__ */ e(
|
|
6952
6956
|
R,
|
|
6953
6957
|
{
|