@firecms/collection_editor 3.0.0-canary.242 → 3.0.0-canary.245
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 +292 -187
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +289 -187
- package/dist/index.umd.js.map +1 -1
- package/dist/ui/collection_editor/PropertyTree.d.ts +2 -3
- package/package.json +8 -8
- package/src/ui/collection_editor/PropertyTree.tsx +183 -139
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +1 -1
- package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +2 -0
package/dist/index.es.js
CHANGED
|
@@ -4,11 +4,14 @@ import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, Arra
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
|
|
6
6
|
import equal from "react-fast-compare";
|
|
7
|
-
import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, BooleanSwitchWithLabel, SettingsIcon, CloseIcon, Select, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, RemoveIcon,
|
|
7
|
+
import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, BooleanSwitchWithLabel, SettingsIcon, CloseIcon, Select, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, DragHandleIcon, defaultBorderMixin, RemoveIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
|
|
8
8
|
import * as Yup from "yup";
|
|
9
9
|
import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
|
|
10
10
|
import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
|
|
11
|
-
import {
|
|
11
|
+
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from "@dnd-kit/core";
|
|
12
|
+
import { useSortable, sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
13
|
+
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
14
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
12
15
|
import JSON5 from "json5";
|
|
13
16
|
import { Highlight, themes } from "prism-react-renderer";
|
|
14
17
|
import { ImportFileUpload, getInferenceType, ImportNewPropertyFieldPreview, DataNewPropertiesMapping, convertDataToEntity, useImportConfig, ImportSaveInProgress } from "@firecms/data_import_export";
|
|
@@ -2771,7 +2774,7 @@ function NonEditablePropertyPreview(t0) {
|
|
|
2771
2774
|
return t19;
|
|
2772
2775
|
}
|
|
2773
2776
|
const PropertyTree = React__default.memo(function PropertyTree2(t0) {
|
|
2774
|
-
const $ = c(
|
|
2777
|
+
const $ = c(37);
|
|
2775
2778
|
const {
|
|
2776
2779
|
namespace,
|
|
2777
2780
|
selectedPropertyKey,
|
|
@@ -2797,94 +2800,152 @@ const PropertyTree = React__default.memo(function PropertyTree2(t0) {
|
|
|
2797
2800
|
}
|
|
2798
2801
|
const propertiesOrder = t1;
|
|
2799
2802
|
let t2;
|
|
2800
|
-
if ($[3]
|
|
2801
|
-
t2 =
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
}
|
|
2805
|
-
const startIndex = result.source.index;
|
|
2806
|
-
const endIndex = result.destination.index;
|
|
2807
|
-
const newPropertiesOrder = Array.from(propertiesOrder);
|
|
2808
|
-
const [removed] = newPropertiesOrder.splice(startIndex, 1);
|
|
2809
|
-
newPropertiesOrder.splice(endIndex, 0, removed);
|
|
2810
|
-
if (onPropertyMove) {
|
|
2811
|
-
onPropertyMove(newPropertiesOrder, namespace);
|
|
2803
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2804
|
+
t2 = {
|
|
2805
|
+
activationConstraint: {
|
|
2806
|
+
distance: 5
|
|
2812
2807
|
}
|
|
2813
2808
|
};
|
|
2814
|
-
$[3] =
|
|
2815
|
-
$[4] = onPropertyMove;
|
|
2816
|
-
$[5] = propertiesOrder;
|
|
2817
|
-
$[6] = t2;
|
|
2809
|
+
$[3] = t2;
|
|
2818
2810
|
} else {
|
|
2819
|
-
t2 = $[
|
|
2811
|
+
t2 = $[3];
|
|
2812
|
+
}
|
|
2813
|
+
let t3;
|
|
2814
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2815
|
+
t3 = {
|
|
2816
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
2817
|
+
};
|
|
2818
|
+
$[4] = t3;
|
|
2819
|
+
} else {
|
|
2820
|
+
t3 = $[4];
|
|
2820
2821
|
}
|
|
2821
|
-
const
|
|
2822
|
-
const t3 = `droppable_${namespace}`;
|
|
2822
|
+
const sensors = useSensors(useSensor(PointerSensor, t2), useSensor(KeyboardSensor, t3));
|
|
2823
2823
|
let t4;
|
|
2824
|
-
if ($[
|
|
2825
|
-
t4 = (
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2824
|
+
if ($[5] !== namespace || $[6] !== onPropertyMove || $[7] !== propertiesOrder) {
|
|
2825
|
+
t4 = (event) => {
|
|
2826
|
+
const {
|
|
2827
|
+
active,
|
|
2828
|
+
over
|
|
2829
|
+
} = event;
|
|
2830
|
+
if (!over || active.id === over.id) {
|
|
2831
|
+
return;
|
|
2832
|
+
}
|
|
2833
|
+
const activeId = String(active.id);
|
|
2834
|
+
const overId = String(over.id);
|
|
2835
|
+
const activeKey = activeId.includes(".") ? activeId.split(".").pop() : activeId;
|
|
2836
|
+
const overKey = overId.includes(".") ? overId.split(".").pop() : overId;
|
|
2837
|
+
if (!activeKey || !overKey) {
|
|
2838
|
+
return;
|
|
2839
|
+
}
|
|
2840
|
+
const oldIndex = propertiesOrder.indexOf(activeKey);
|
|
2841
|
+
const newIndex = propertiesOrder.indexOf(overKey);
|
|
2842
|
+
if (oldIndex !== -1 && newIndex !== -1) {
|
|
2843
|
+
const newPropertiesOrder = [...propertiesOrder];
|
|
2844
|
+
const [removed] = newPropertiesOrder.splice(oldIndex, 1);
|
|
2845
|
+
newPropertiesOrder.splice(newIndex, 0, removed);
|
|
2846
|
+
if (onPropertyMove) {
|
|
2847
|
+
onPropertyMove(newPropertiesOrder, namespace);
|
|
2832
2848
|
}
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
]
|
|
2837
|
-
$[7] =
|
|
2838
|
-
$[8] =
|
|
2839
|
-
|
|
2840
|
-
$[
|
|
2841
|
-
$[11] = inferredPropertyKeys;
|
|
2842
|
-
$[12] = namespace;
|
|
2843
|
-
$[13] = onPropertyClick;
|
|
2844
|
-
$[14] = onPropertyMove;
|
|
2845
|
-
$[15] = onPropertyRemove;
|
|
2846
|
-
$[16] = properties;
|
|
2847
|
-
$[17] = propertiesOrder;
|
|
2848
|
-
$[18] = selectedPropertyKey;
|
|
2849
|
-
$[19] = t4;
|
|
2850
|
-
} else {
|
|
2851
|
-
t4 = $[19];
|
|
2849
|
+
}
|
|
2850
|
+
};
|
|
2851
|
+
$[5] = namespace;
|
|
2852
|
+
$[6] = onPropertyMove;
|
|
2853
|
+
$[7] = propertiesOrder;
|
|
2854
|
+
$[8] = t4;
|
|
2855
|
+
} else {
|
|
2856
|
+
t4 = $[8];
|
|
2852
2857
|
}
|
|
2858
|
+
const handleDragEnd = t4;
|
|
2853
2859
|
let t5;
|
|
2854
|
-
if ($[
|
|
2855
|
-
|
|
2856
|
-
$[
|
|
2857
|
-
|
|
2858
|
-
|
|
2860
|
+
if ($[9] !== namespace || $[10] !== propertiesOrder) {
|
|
2861
|
+
let t62;
|
|
2862
|
+
if ($[12] !== namespace) {
|
|
2863
|
+
t62 = (key) => getFullId(key, namespace);
|
|
2864
|
+
$[12] = namespace;
|
|
2865
|
+
$[13] = t62;
|
|
2866
|
+
} else {
|
|
2867
|
+
t62 = $[13];
|
|
2868
|
+
}
|
|
2869
|
+
t5 = propertiesOrder.map(t62);
|
|
2870
|
+
$[9] = namespace;
|
|
2871
|
+
$[10] = propertiesOrder;
|
|
2872
|
+
$[11] = t5;
|
|
2859
2873
|
} else {
|
|
2860
|
-
t5 = $[
|
|
2874
|
+
t5 = $[11];
|
|
2861
2875
|
}
|
|
2876
|
+
const items = t5;
|
|
2862
2877
|
let t6;
|
|
2863
|
-
if ($[
|
|
2864
|
-
t6 =
|
|
2865
|
-
$[
|
|
2866
|
-
$[24] = t5;
|
|
2867
|
-
$[25] = t6;
|
|
2878
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2879
|
+
t6 = [restrictToVerticalAxis];
|
|
2880
|
+
$[14] = t6;
|
|
2868
2881
|
} else {
|
|
2869
|
-
t6 = $[
|
|
2882
|
+
t6 = $[14];
|
|
2870
2883
|
}
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
}
|
|
2884
|
+
let t7;
|
|
2885
|
+
if ($[15] !== additionalFields || $[16] !== collectionEditable || $[17] !== errors || $[18] !== inferredPropertyKeys || $[19] !== namespace || $[20] !== onPropertyClick || $[21] !== onPropertyMove || $[22] !== onPropertyRemove || $[23] !== properties || $[24] !== propertiesOrder || $[25] !== selectedPropertyKey) {
|
|
2886
|
+
t7 = propertiesOrder && propertiesOrder.map((propertyKey, index) => {
|
|
2887
|
+
const property = properties[propertyKey];
|
|
2888
|
+
const additionalField = additionalFields?.find((field) => field.key === propertyKey);
|
|
2889
|
+
if (!property && !additionalField) {
|
|
2890
|
+
console.warn(`Property ${propertyKey} not found in properties or additionalFields`);
|
|
2891
|
+
return null;
|
|
2892
|
+
}
|
|
2893
|
+
const id = getFullId(propertyKey, namespace);
|
|
2894
|
+
return /* @__PURE__ */ jsx(PropertyTreeEntry, { id, propertyKey, propertyOrBuilder: property, additionalField, errors, namespace, inferredPropertyKeys, onPropertyMove, onPropertyRemove, onPropertyClick, selectedPropertyKey, collectionEditable }, id);
|
|
2895
|
+
}).filter(Boolean);
|
|
2896
|
+
$[15] = additionalFields;
|
|
2897
|
+
$[16] = collectionEditable;
|
|
2898
|
+
$[17] = errors;
|
|
2899
|
+
$[18] = inferredPropertyKeys;
|
|
2900
|
+
$[19] = namespace;
|
|
2901
|
+
$[20] = onPropertyClick;
|
|
2902
|
+
$[21] = onPropertyMove;
|
|
2903
|
+
$[22] = onPropertyRemove;
|
|
2904
|
+
$[23] = properties;
|
|
2905
|
+
$[24] = propertiesOrder;
|
|
2906
|
+
$[25] = selectedPropertyKey;
|
|
2907
|
+
$[26] = t7;
|
|
2908
|
+
} else {
|
|
2909
|
+
t7 = $[26];
|
|
2910
|
+
}
|
|
2911
|
+
let t8;
|
|
2912
|
+
if ($[27] !== className || $[28] !== t7) {
|
|
2913
|
+
t8 = /* @__PURE__ */ jsx("div", { className, children: t7 });
|
|
2914
|
+
$[27] = className;
|
|
2915
|
+
$[28] = t7;
|
|
2916
|
+
$[29] = t8;
|
|
2917
|
+
} else {
|
|
2918
|
+
t8 = $[29];
|
|
2919
|
+
}
|
|
2920
|
+
let t9;
|
|
2921
|
+
if ($[30] !== items || $[31] !== t8) {
|
|
2922
|
+
t9 = /* @__PURE__ */ jsx(SortableContext, { items, strategy: verticalListSortingStrategy, children: t8 });
|
|
2923
|
+
$[30] = items;
|
|
2924
|
+
$[31] = t8;
|
|
2925
|
+
$[32] = t9;
|
|
2926
|
+
} else {
|
|
2927
|
+
t9 = $[32];
|
|
2928
|
+
}
|
|
2929
|
+
let t10;
|
|
2930
|
+
if ($[33] !== handleDragEnd || $[34] !== sensors || $[35] !== t9) {
|
|
2931
|
+
t10 = /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: t6, children: t9 });
|
|
2932
|
+
$[33] = handleDragEnd;
|
|
2933
|
+
$[34] = sensors;
|
|
2934
|
+
$[35] = t9;
|
|
2935
|
+
$[36] = t10;
|
|
2936
|
+
} else {
|
|
2937
|
+
t10 = $[36];
|
|
2938
|
+
}
|
|
2939
|
+
return t10;
|
|
2940
|
+
}, equal);
|
|
2880
2941
|
function PropertyTreeEntry(t0) {
|
|
2881
|
-
const $ = c(
|
|
2942
|
+
const $ = c(62);
|
|
2882
2943
|
const {
|
|
2944
|
+
id,
|
|
2883
2945
|
propertyKey,
|
|
2884
2946
|
namespace,
|
|
2885
2947
|
propertyOrBuilder,
|
|
2886
2948
|
additionalField,
|
|
2887
|
-
provided,
|
|
2888
2949
|
selectedPropertyKey,
|
|
2889
2950
|
errors,
|
|
2890
2951
|
onPropertyClick,
|
|
@@ -2894,157 +2955,201 @@ function PropertyTreeEntry(t0) {
|
|
|
2894
2955
|
collectionEditable
|
|
2895
2956
|
} = t0;
|
|
2896
2957
|
let t1;
|
|
2897
|
-
if ($[0] !==
|
|
2898
|
-
t1 =
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
$[
|
|
2902
|
-
$[
|
|
2958
|
+
if ($[0] !== id) {
|
|
2959
|
+
t1 = {
|
|
2960
|
+
id
|
|
2961
|
+
};
|
|
2962
|
+
$[0] = id;
|
|
2963
|
+
$[1] = t1;
|
|
2903
2964
|
} else {
|
|
2904
|
-
t1 = $[
|
|
2965
|
+
t1 = $[1];
|
|
2905
2966
|
}
|
|
2906
|
-
const
|
|
2967
|
+
const {
|
|
2968
|
+
attributes,
|
|
2969
|
+
listeners,
|
|
2970
|
+
setNodeRef,
|
|
2971
|
+
transform,
|
|
2972
|
+
transition,
|
|
2973
|
+
isDragging
|
|
2974
|
+
} = useSortable(t1);
|
|
2907
2975
|
let t2;
|
|
2908
|
-
if ($[
|
|
2909
|
-
t2 =
|
|
2910
|
-
$[
|
|
2911
|
-
$[
|
|
2912
|
-
$[6] = t2;
|
|
2976
|
+
if ($[2] !== transform) {
|
|
2977
|
+
t2 = CSS.Translate.toString(transform);
|
|
2978
|
+
$[2] = transform;
|
|
2979
|
+
$[3] = t2;
|
|
2913
2980
|
} else {
|
|
2914
|
-
t2 = $[
|
|
2981
|
+
t2 = $[3];
|
|
2915
2982
|
}
|
|
2916
|
-
const
|
|
2983
|
+
const t3 = isDragging ? 10 : void 0;
|
|
2984
|
+
let t4;
|
|
2985
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== transition) {
|
|
2986
|
+
t4 = {
|
|
2987
|
+
transform: t2,
|
|
2988
|
+
transition,
|
|
2989
|
+
zIndex: t3,
|
|
2990
|
+
position: "relative"
|
|
2991
|
+
};
|
|
2992
|
+
$[4] = t2;
|
|
2993
|
+
$[5] = t3;
|
|
2994
|
+
$[6] = transition;
|
|
2995
|
+
$[7] = t4;
|
|
2996
|
+
} else {
|
|
2997
|
+
t4 = $[7];
|
|
2998
|
+
}
|
|
2999
|
+
const style = t4;
|
|
3000
|
+
let t5;
|
|
3001
|
+
if ($[8] !== inferredPropertyKeys || $[9] !== namespace || $[10] !== propertyKey) {
|
|
3002
|
+
t5 = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);
|
|
3003
|
+
$[8] = inferredPropertyKeys;
|
|
3004
|
+
$[9] = namespace;
|
|
3005
|
+
$[10] = propertyKey;
|
|
3006
|
+
$[11] = t5;
|
|
3007
|
+
} else {
|
|
3008
|
+
t5 = $[11];
|
|
3009
|
+
}
|
|
3010
|
+
const isPropertyInferred = t5;
|
|
3011
|
+
const fullId = id;
|
|
2917
3012
|
const fullIdPath = getFullIdPath(propertyKey, namespace);
|
|
2918
3013
|
const hasError = fullIdPath in errors;
|
|
2919
3014
|
let subtree;
|
|
2920
3015
|
if (typeof propertyOrBuilder === "object") {
|
|
2921
3016
|
const property = propertyOrBuilder;
|
|
2922
3017
|
if (property.dataType === "map" && property.properties) {
|
|
2923
|
-
let
|
|
2924
|
-
if ($[
|
|
2925
|
-
|
|
2926
|
-
$[
|
|
2927
|
-
$[
|
|
2928
|
-
$[
|
|
2929
|
-
$[
|
|
2930
|
-
$[
|
|
2931
|
-
$[
|
|
2932
|
-
$[
|
|
2933
|
-
$[
|
|
2934
|
-
$[
|
|
2935
|
-
$[
|
|
3018
|
+
let t62;
|
|
3019
|
+
if ($[12] !== collectionEditable || $[13] !== errors || $[14] !== fullId || $[15] !== onPropertyClick || $[16] !== onPropertyMove || $[17] !== onPropertyRemove || $[18] !== property.properties || $[19] !== property.propertiesOrder || $[20] !== selectedPropertyKey) {
|
|
3020
|
+
t62 = /* @__PURE__ */ jsx(PropertyTree, { selectedPropertyKey, namespace: fullId, properties: property.properties, propertiesOrder: property.propertiesOrder, errors, onPropertyClick, onPropertyMove, onPropertyRemove, collectionEditable });
|
|
3021
|
+
$[12] = collectionEditable;
|
|
3022
|
+
$[13] = errors;
|
|
3023
|
+
$[14] = fullId;
|
|
3024
|
+
$[15] = onPropertyClick;
|
|
3025
|
+
$[16] = onPropertyMove;
|
|
3026
|
+
$[17] = onPropertyRemove;
|
|
3027
|
+
$[18] = property.properties;
|
|
3028
|
+
$[19] = property.propertiesOrder;
|
|
3029
|
+
$[20] = selectedPropertyKey;
|
|
3030
|
+
$[21] = t62;
|
|
2936
3031
|
} else {
|
|
2937
|
-
|
|
3032
|
+
t62 = $[21];
|
|
2938
3033
|
}
|
|
2939
|
-
subtree =
|
|
3034
|
+
subtree = t62;
|
|
2940
3035
|
}
|
|
2941
3036
|
}
|
|
2942
3037
|
const selected = selectedPropertyKey === fullId;
|
|
2943
|
-
let
|
|
2944
|
-
if ($[
|
|
2945
|
-
|
|
2946
|
-
$[
|
|
2947
|
-
$[
|
|
2948
|
-
$[
|
|
3038
|
+
let t6;
|
|
3039
|
+
if ($[22] !== collectionEditable || $[23] !== propertyOrBuilder) {
|
|
3040
|
+
t6 = propertyOrBuilder && (collectionEditable && !isPropertyBuilder(propertyOrBuilder) || editableProperty(propertyOrBuilder));
|
|
3041
|
+
$[22] = collectionEditable;
|
|
3042
|
+
$[23] = propertyOrBuilder;
|
|
3043
|
+
$[24] = t6;
|
|
2949
3044
|
} else {
|
|
2950
|
-
|
|
3045
|
+
t6 = $[24];
|
|
2951
3046
|
}
|
|
2952
|
-
const editable =
|
|
2953
|
-
let
|
|
2954
|
-
if ($[
|
|
2955
|
-
|
|
3047
|
+
const editable = t6;
|
|
3048
|
+
let t7;
|
|
3049
|
+
if ($[25] !== subtree) {
|
|
3050
|
+
t7 = subtree && /* @__PURE__ */ jsx("div", { className: "absolute border-l " + defaultBorderMixin, style: {
|
|
2956
3051
|
left: "32px",
|
|
2957
3052
|
top: "64px",
|
|
2958
3053
|
bottom: "16px"
|
|
2959
3054
|
} });
|
|
2960
|
-
$[
|
|
2961
|
-
$[
|
|
3055
|
+
$[25] = subtree;
|
|
3056
|
+
$[26] = t7;
|
|
2962
3057
|
} else {
|
|
2963
|
-
|
|
3058
|
+
t7 = $[26];
|
|
2964
3059
|
}
|
|
2965
|
-
let
|
|
2966
|
-
if ($[
|
|
2967
|
-
|
|
2968
|
-
$[
|
|
2969
|
-
$[
|
|
2970
|
-
$[
|
|
2971
|
-
$[
|
|
2972
|
-
$[
|
|
2973
|
-
$[
|
|
2974
|
-
$[
|
|
2975
|
-
$[
|
|
2976
|
-
$[
|
|
2977
|
-
} else {
|
|
2978
|
-
|
|
3060
|
+
let t8;
|
|
3061
|
+
if ($[27] !== additionalField || $[28] !== editable || $[29] !== hasError || $[30] !== namespace || $[31] !== onPropertyClick || $[32] !== propertyKey || $[33] !== propertyOrBuilder || $[34] !== selected) {
|
|
3062
|
+
t8 = /* @__PURE__ */ jsx("div", { children: !isPropertyBuilder(propertyOrBuilder) && !additionalField && editable ? /* @__PURE__ */ jsx(PropertyFieldPreview, { property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, includeName: true, selected, hasError }) : /* @__PURE__ */ jsx(NonEditablePropertyPreview, { name: propertyKey, property: propertyOrBuilder, onClick: onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : void 0, selected }) });
|
|
3063
|
+
$[27] = additionalField;
|
|
3064
|
+
$[28] = editable;
|
|
3065
|
+
$[29] = hasError;
|
|
3066
|
+
$[30] = namespace;
|
|
3067
|
+
$[31] = onPropertyClick;
|
|
3068
|
+
$[32] = propertyKey;
|
|
3069
|
+
$[33] = propertyOrBuilder;
|
|
3070
|
+
$[34] = selected;
|
|
3071
|
+
$[35] = t8;
|
|
3072
|
+
} else {
|
|
3073
|
+
t8 = $[35];
|
|
2979
3074
|
}
|
|
2980
|
-
let
|
|
2981
|
-
if ($[
|
|
2982
|
-
|
|
2983
|
-
$[
|
|
2984
|
-
$[
|
|
3075
|
+
let t9;
|
|
3076
|
+
if ($[36] !== isPropertyInferred) {
|
|
3077
|
+
t9 = isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsx(AutorenewIcon, { size: "small", className: "p-2" }) });
|
|
3078
|
+
$[36] = isPropertyInferred;
|
|
3079
|
+
$[37] = t9;
|
|
2985
3080
|
} else {
|
|
2986
|
-
|
|
3081
|
+
t9 = $[37];
|
|
2987
3082
|
}
|
|
2988
|
-
let
|
|
2989
|
-
if ($[
|
|
2990
|
-
|
|
2991
|
-
$[
|
|
2992
|
-
$[
|
|
2993
|
-
$[
|
|
2994
|
-
$[
|
|
3083
|
+
let t10;
|
|
3084
|
+
if ($[38] !== isPropertyInferred || $[39] !== namespace || $[40] !== onPropertyRemove || $[41] !== propertyKey) {
|
|
3085
|
+
t10 = onPropertyRemove && !isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Remove", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: "small", color: "inherit", onClick: () => onPropertyRemove(propertyKey, namespace), children: /* @__PURE__ */ jsx(RemoveIcon, { size: "small" }) }) });
|
|
3086
|
+
$[38] = isPropertyInferred;
|
|
3087
|
+
$[39] = namespace;
|
|
3088
|
+
$[40] = onPropertyRemove;
|
|
3089
|
+
$[41] = propertyKey;
|
|
3090
|
+
$[42] = t10;
|
|
2995
3091
|
} else {
|
|
2996
|
-
|
|
3092
|
+
t10 = $[42];
|
|
2997
3093
|
}
|
|
2998
|
-
let
|
|
2999
|
-
if ($[
|
|
3000
|
-
|
|
3001
|
-
$[
|
|
3002
|
-
$[
|
|
3094
|
+
let t11;
|
|
3095
|
+
if ($[43] !== attributes || $[44] !== listeners || $[45] !== onPropertyMove) {
|
|
3096
|
+
t11 = onPropertyMove && /* @__PURE__ */ jsx(Tooltip, { title: "Move", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { component: "span", size: "small", ...attributes, ...listeners, children: /* @__PURE__ */ jsx(DragHandleIcon, { size: "small" }) }) });
|
|
3097
|
+
$[43] = attributes;
|
|
3098
|
+
$[44] = listeners;
|
|
3099
|
+
$[45] = onPropertyMove;
|
|
3100
|
+
$[46] = t11;
|
|
3003
3101
|
} else {
|
|
3004
|
-
|
|
3102
|
+
t11 = $[46];
|
|
3005
3103
|
}
|
|
3006
|
-
let
|
|
3007
|
-
if ($[
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3104
|
+
let t12;
|
|
3105
|
+
if ($[47] !== t10 || $[48] !== t11 || $[49] !== t9) {
|
|
3106
|
+
t12 = /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 flex flex-row", children: [
|
|
3107
|
+
t9,
|
|
3108
|
+
t10,
|
|
3109
|
+
t11
|
|
3012
3110
|
] });
|
|
3013
|
-
$[
|
|
3014
|
-
$[
|
|
3015
|
-
$[
|
|
3016
|
-
$[
|
|
3111
|
+
$[47] = t10;
|
|
3112
|
+
$[48] = t11;
|
|
3113
|
+
$[49] = t9;
|
|
3114
|
+
$[50] = t12;
|
|
3017
3115
|
} else {
|
|
3018
|
-
|
|
3116
|
+
t12 = $[50];
|
|
3019
3117
|
}
|
|
3020
|
-
let
|
|
3021
|
-
if ($[
|
|
3022
|
-
|
|
3023
|
-
$[
|
|
3024
|
-
$[
|
|
3118
|
+
let t13;
|
|
3119
|
+
if ($[51] !== subtree) {
|
|
3120
|
+
t13 = subtree && /* @__PURE__ */ jsx("div", { className: "ml-16", children: subtree });
|
|
3121
|
+
$[51] = subtree;
|
|
3122
|
+
$[52] = t13;
|
|
3025
3123
|
} else {
|
|
3026
|
-
|
|
3124
|
+
t13 = $[52];
|
|
3027
3125
|
}
|
|
3028
|
-
let
|
|
3029
|
-
if ($[
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3126
|
+
let t14;
|
|
3127
|
+
if ($[53] !== t12 || $[54] !== t13 || $[55] !== t7 || $[56] !== t8) {
|
|
3128
|
+
t14 = /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3129
|
+
t7,
|
|
3130
|
+
t8,
|
|
3131
|
+
t12,
|
|
3132
|
+
t13
|
|
3035
3133
|
] });
|
|
3036
|
-
$[
|
|
3037
|
-
$[
|
|
3038
|
-
$[
|
|
3039
|
-
$[
|
|
3040
|
-
$[
|
|
3041
|
-
$[50] = t5;
|
|
3042
|
-
$[51] = t9;
|
|
3043
|
-
$[52] = t11;
|
|
3134
|
+
$[53] = t12;
|
|
3135
|
+
$[54] = t13;
|
|
3136
|
+
$[55] = t7;
|
|
3137
|
+
$[56] = t8;
|
|
3138
|
+
$[57] = t14;
|
|
3044
3139
|
} else {
|
|
3045
|
-
|
|
3140
|
+
t14 = $[57];
|
|
3046
3141
|
}
|
|
3047
|
-
|
|
3142
|
+
let t15;
|
|
3143
|
+
if ($[58] !== setNodeRef || $[59] !== style || $[60] !== t14) {
|
|
3144
|
+
t15 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, className: "relative -ml-8", children: t14 });
|
|
3145
|
+
$[58] = setNodeRef;
|
|
3146
|
+
$[59] = style;
|
|
3147
|
+
$[60] = t14;
|
|
3148
|
+
$[61] = t15;
|
|
3149
|
+
} else {
|
|
3150
|
+
t15 = $[61];
|
|
3151
|
+
}
|
|
3152
|
+
return t15;
|
|
3048
3153
|
}
|
|
3049
3154
|
function MapPropertyField(t0) {
|
|
3050
3155
|
const $ = c(67);
|
|
@@ -3258,7 +3363,7 @@ function MapPropertyField(t0) {
|
|
|
3258
3363
|
const t19 = values.spreadChildren ?? false;
|
|
3259
3364
|
let t20;
|
|
3260
3365
|
if ($[40] !== t18 || $[41] !== t19) {
|
|
3261
|
-
t20 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "
|
|
3366
|
+
t20 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "medium", label: "Spread children as columns", onValueChange: t18, value: t19 });
|
|
3262
3367
|
$[40] = t18;
|
|
3263
3368
|
$[41] = t19;
|
|
3264
3369
|
$[42] = t20;
|
|
@@ -4730,7 +4835,7 @@ function AdvancedPropertyValidation(t0) {
|
|
|
4730
4835
|
field,
|
|
4731
4836
|
form
|
|
4732
4837
|
} = t22;
|
|
4733
|
-
return /* @__PURE__ */ jsx(SwitchControl, { label: "Hide from collection", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
|
|
4838
|
+
return /* @__PURE__ */ jsx(SwitchControl, { label: "Hide from collection", size: "medium", disabled, form, tooltip: "Hide this field from the collection view. It will still be visible in the form view", field });
|
|
4734
4839
|
} }) });
|
|
4735
4840
|
$[0] = disabled;
|
|
4736
4841
|
$[1] = t1;
|
|
@@ -4744,7 +4849,7 @@ function AdvancedPropertyValidation(t0) {
|
|
|
4744
4849
|
field: field_0,
|
|
4745
4850
|
form: form_0
|
|
4746
4851
|
} = t32;
|
|
4747
|
-
return /* @__PURE__ */ jsx(SwitchControl, { label: "Read only", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
|
|
4852
|
+
return /* @__PURE__ */ jsx(SwitchControl, { label: "Read only", size: "medium", disabled, tooltip: "Is this a read only field. Display only as a preview", form: form_0, field: field_0 });
|
|
4748
4853
|
} }) });
|
|
4749
4854
|
$[2] = disabled;
|
|
4750
4855
|
$[3] = t2;
|