@firecms/collection_editor 3.0.0-canary.242 → 3.0.0-canary.244

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
@@ -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, DragHandleIcon, 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";
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 { Draggable, Droppable, DragDropContext } from "@hello-pangea/dnd";
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(26);
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] !== namespace || $[4] !== onPropertyMove || $[5] !== propertiesOrder) {
2801
- t2 = (result) => {
2802
- if (!result.destination) {
2803
- return;
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] = namespace;
2815
- $[4] = onPropertyMove;
2816
- $[5] = propertiesOrder;
2817
- $[6] = t2;
2809
+ $[3] = t2;
2818
2810
  } else {
2819
- t2 = $[6];
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 onDragEnd = t2;
2822
- const t3 = `droppable_${namespace}`;
2822
+ const sensors = useSensors(useSensor(PointerSensor, t2), useSensor(KeyboardSensor, t3));
2823
2823
  let t4;
2824
- if ($[7] !== additionalFields || $[8] !== className || $[9] !== collectionEditable || $[10] !== errors || $[11] !== inferredPropertyKeys || $[12] !== namespace || $[13] !== onPropertyClick || $[14] !== onPropertyMove || $[15] !== onPropertyRemove || $[16] !== properties || $[17] !== propertiesOrder || $[18] !== selectedPropertyKey) {
2825
- t4 = (droppableProvided, droppableSnapshot) => /* @__PURE__ */ jsxs("div", { ...droppableProvided.droppableProps, ref: droppableProvided.innerRef, className, children: [
2826
- propertiesOrder && propertiesOrder.map((propertyKey, index) => {
2827
- const property = properties[propertyKey];
2828
- const additionalField = additionalFields?.find((field) => field.key === propertyKey);
2829
- if (!property && !additionalField) {
2830
- console.warn(`Property ${propertyKey} not found in properties or additionalFields`);
2831
- return null;
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
- return /* @__PURE__ */ jsx(Draggable, { draggableId: `array_field_${namespace}_${propertyKey}}`, index, children: (provided, snapshot) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyTreeEntry, { propertyKey, propertyOrBuilder: property, additionalField, provided, errors, namespace, inferredPropertyKeys, onPropertyMove, onPropertyRemove, onPropertyClick: snapshot.isDragging ? void 0 : onPropertyClick, selectedPropertyKey, collectionEditable }) }) }, `array_field_${namespace}_${propertyKey}}`);
2834
- }).filter(Boolean),
2835
- droppableProvided.placeholder
2836
- ] });
2837
- $[7] = additionalFields;
2838
- $[8] = className;
2839
- $[9] = collectionEditable;
2840
- $[10] = errors;
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 ($[20] !== t3 || $[21] !== t4) {
2855
- t5 = /* @__PURE__ */ jsx(Droppable, { droppableId: t3, children: t4 });
2856
- $[20] = t3;
2857
- $[21] = t4;
2858
- $[22] = t5;
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 = $[22];
2874
+ t5 = $[11];
2861
2875
  }
2876
+ const items = t5;
2862
2877
  let t6;
2863
- if ($[23] !== onDragEnd || $[24] !== t5) {
2864
- t6 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(DragDropContext, { onDragEnd, children: t5 }) });
2865
- $[23] = onDragEnd;
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 = $[25];
2882
+ t6 = $[14];
2870
2883
  }
2871
- return t6;
2872
- }, (prevProps, nextProps) => {
2873
- const isSelected = nextProps.selectedPropertyKey?.startsWith(nextProps.namespace ?? "");
2874
- const wasSelected = prevProps.selectedPropertyKey?.startsWith(prevProps.namespace ?? "");
2875
- if (isSelected || wasSelected) return false;
2876
- return equal(prevProps.properties, nextProps.properties) && prevProps.propertiesOrder === nextProps.propertiesOrder && equal(prevProps.additionalFields, nextProps.additionalFields) && equal(prevProps.errors, nextProps.errors) && equal(prevProps.onPropertyClick, nextProps.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
2877
- // equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
2878
- prevProps.namespace === nextProps.namespace && prevProps.collectionEditable === nextProps.collectionEditable;
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(53);
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] !== inferredPropertyKeys || $[1] !== namespace || $[2] !== propertyKey) {
2898
- t1 = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);
2899
- $[0] = inferredPropertyKeys;
2900
- $[1] = namespace;
2901
- $[2] = propertyKey;
2902
- $[3] = t1;
2958
+ if ($[0] !== id) {
2959
+ t1 = {
2960
+ id
2961
+ };
2962
+ $[0] = id;
2963
+ $[1] = t1;
2903
2964
  } else {
2904
- t1 = $[3];
2965
+ t1 = $[1];
2905
2966
  }
2906
- const isPropertyInferred = t1;
2967
+ const {
2968
+ attributes,
2969
+ listeners,
2970
+ setNodeRef,
2971
+ transform,
2972
+ transition,
2973
+ isDragging
2974
+ } = useSortable(t1);
2907
2975
  let t2;
2908
- if ($[4] !== namespace || $[5] !== propertyKey) {
2909
- t2 = getFullId(propertyKey, namespace);
2910
- $[4] = namespace;
2911
- $[5] = propertyKey;
2912
- $[6] = t2;
2976
+ if ($[2] !== transform) {
2977
+ t2 = CSS.Translate.toString(transform);
2978
+ $[2] = transform;
2979
+ $[3] = t2;
2913
2980
  } else {
2914
- t2 = $[6];
2981
+ t2 = $[3];
2915
2982
  }
2916
- const fullId = t2;
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 t32;
2924
- if ($[7] !== collectionEditable || $[8] !== errors || $[9] !== fullId || $[10] !== onPropertyClick || $[11] !== onPropertyMove || $[12] !== onPropertyRemove || $[13] !== property.properties || $[14] !== property.propertiesOrder || $[15] !== selectedPropertyKey) {
2925
- t32 = /* @__PURE__ */ jsx(PropertyTree, { selectedPropertyKey, namespace: fullId, properties: property.properties, propertiesOrder: property.propertiesOrder, errors, onPropertyClick, onPropertyMove, onPropertyRemove, collectionEditable });
2926
- $[7] = collectionEditable;
2927
- $[8] = errors;
2928
- $[9] = fullId;
2929
- $[10] = onPropertyClick;
2930
- $[11] = onPropertyMove;
2931
- $[12] = onPropertyRemove;
2932
- $[13] = property.properties;
2933
- $[14] = property.propertiesOrder;
2934
- $[15] = selectedPropertyKey;
2935
- $[16] = t32;
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
- t32 = $[16];
3032
+ t62 = $[21];
2938
3033
  }
2939
- subtree = t32;
3034
+ subtree = t62;
2940
3035
  }
2941
3036
  }
2942
3037
  const selected = selectedPropertyKey === fullId;
2943
- let t3;
2944
- if ($[17] !== collectionEditable || $[18] !== propertyOrBuilder) {
2945
- t3 = propertyOrBuilder && (collectionEditable && !isPropertyBuilder(propertyOrBuilder) || editableProperty(propertyOrBuilder));
2946
- $[17] = collectionEditable;
2947
- $[18] = propertyOrBuilder;
2948
- $[19] = t3;
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
- t3 = $[19];
3045
+ t6 = $[24];
2951
3046
  }
2952
- const editable = t3;
2953
- let t4;
2954
- if ($[20] !== subtree) {
2955
- t4 = subtree && /* @__PURE__ */ jsx("div", { className: "absolute border-l " + defaultBorderMixin, style: {
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
- $[20] = subtree;
2961
- $[21] = t4;
3055
+ $[25] = subtree;
3056
+ $[26] = t7;
2962
3057
  } else {
2963
- t4 = $[21];
3058
+ t7 = $[26];
2964
3059
  }
2965
- let t5;
2966
- if ($[22] !== additionalField || $[23] !== editable || $[24] !== hasError || $[25] !== namespace || $[26] !== onPropertyClick || $[27] !== propertyKey || $[28] !== propertyOrBuilder || $[29] !== selected) {
2967
- t5 = !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 });
2968
- $[22] = additionalField;
2969
- $[23] = editable;
2970
- $[24] = hasError;
2971
- $[25] = namespace;
2972
- $[26] = onPropertyClick;
2973
- $[27] = propertyKey;
2974
- $[28] = propertyOrBuilder;
2975
- $[29] = selected;
2976
- $[30] = t5;
2977
- } else {
2978
- t5 = $[30];
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 t6;
2981
- if ($[31] !== isPropertyInferred) {
2982
- t6 = isPropertyInferred && /* @__PURE__ */ jsx(Tooltip, { title: "Inferred property", children: /* @__PURE__ */ jsx(AutorenewIcon, { size: "small", className: "p-2" }) });
2983
- $[31] = isPropertyInferred;
2984
- $[32] = t6;
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
- t6 = $[32];
3081
+ t9 = $[37];
2987
3082
  }
2988
- let t7;
2989
- if ($[33] !== namespace || $[34] !== onPropertyRemove || $[35] !== propertyKey) {
2990
- t7 = onPropertyRemove && /* @__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" }) }) });
2991
- $[33] = namespace;
2992
- $[34] = onPropertyRemove;
2993
- $[35] = propertyKey;
2994
- $[36] = t7;
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
- t7 = $[36];
3092
+ t10 = $[42];
2997
3093
  }
2998
- let t8;
2999
- if ($[37] !== onPropertyMove) {
3000
- t8 = onPropertyMove && /* @__PURE__ */ jsx(Tooltip, { title: "Move", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { component: "span", size: "small", children: /* @__PURE__ */ jsx(DragHandleIcon, { size: "small" }) }) });
3001
- $[37] = onPropertyMove;
3002
- $[38] = t8;
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
- t8 = $[38];
3102
+ t11 = $[46];
3005
3103
  }
3006
- let t9;
3007
- if ($[39] !== t6 || $[40] !== t7 || $[41] !== t8) {
3008
- t9 = /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
3009
- t6,
3010
- t7,
3011
- t8
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
- $[39] = t6;
3014
- $[40] = t7;
3015
- $[41] = t8;
3016
- $[42] = t9;
3111
+ $[47] = t10;
3112
+ $[48] = t11;
3113
+ $[49] = t9;
3114
+ $[50] = t12;
3017
3115
  } else {
3018
- t9 = $[42];
3116
+ t12 = $[50];
3019
3117
  }
3020
- let t10;
3021
- if ($[43] !== subtree) {
3022
- t10 = subtree && /* @__PURE__ */ jsx("div", { className: "ml-16", children: subtree });
3023
- $[43] = subtree;
3024
- $[44] = t10;
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
- t10 = $[44];
3124
+ t13 = $[52];
3027
3125
  }
3028
- let t11;
3029
- if ($[45] !== provided.dragHandleProps || $[46] !== provided.draggableProps || $[47] !== provided.innerRef || $[48] !== t10 || $[49] !== t4 || $[50] !== t5 || $[51] !== t9) {
3030
- t11 = /* @__PURE__ */ jsxs("div", { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, className: "relative -ml-8", children: [
3031
- t4,
3032
- t5,
3033
- t9,
3034
- t10
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
- $[45] = provided.dragHandleProps;
3037
- $[46] = provided.draggableProps;
3038
- $[47] = provided.innerRef;
3039
- $[48] = t10;
3040
- $[49] = t4;
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
- t11 = $[52];
3140
+ t14 = $[57];
3046
3141
  }
3047
- return t11;
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: "small", label: "Spread children as columns", onValueChange: t18, value: t19 });
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;