@measured/puck 0.19.0-canary.53b0813 → 0.19.0-canary.56f23e8
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +219 -170
- package/dist/index.mjs +234 -186
- package/dist/{resolve-all-data-wwgDuTnC.d.mts → resolve-all-data-DleIzc4N.d.mts} +1 -0
- package/dist/{resolve-all-data-wwgDuTnC.d.ts → resolve-all-data-DleIzc4N.d.ts} +1 -0
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-
|
2
|
-
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-DleIzc4N.mjs';
|
2
|
+
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DleIzc4N.mjs';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-
|
2
|
-
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-DleIzc4N.js';
|
2
|
+
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DleIzc4N.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.js
CHANGED
@@ -2121,7 +2121,8 @@ function useDraggableSafe(input) {
|
|
2121
2121
|
function useSortableSafe(input) {
|
2122
2122
|
if (typeof window === "undefined") {
|
2123
2123
|
return { ref: () => {
|
2124
|
-
}, status: "idle"
|
2124
|
+
}, status: "idle", handleRef: () => {
|
2125
|
+
} };
|
2125
2126
|
}
|
2126
2127
|
return (0, import_sortable.useSortable)(input);
|
2127
2128
|
}
|
@@ -2396,23 +2397,26 @@ function patchWindow(window2) {
|
|
2396
2397
|
|
2397
2398
|
// lib/dnd/use-sensors.ts
|
2398
2399
|
var import_utilities2 = require("@dnd-kit/dom/utilities");
|
2399
|
-
var useSensors = (
|
2400
|
+
var useSensors = ({
|
2401
|
+
other,
|
2402
|
+
mouse,
|
2403
|
+
touch
|
2404
|
+
} = {
|
2405
|
+
touch: { delay: { value: 200, tolerance: 10 } },
|
2406
|
+
other: { delay: { value: 200, tolerance: 10 }, distance: { value: 5 } }
|
2407
|
+
}) => {
|
2400
2408
|
const [sensors] = (0, import_react12.useState)(() => [
|
2401
2409
|
PointerSensor.configure({
|
2402
2410
|
activationConstraints(event, source) {
|
2403
2411
|
var _a;
|
2404
2412
|
const { pointerType, target } = event;
|
2405
2413
|
if (pointerType === "mouse" && (0, import_utilities2.isElement)(target) && (source.handle === target || ((_a = source.handle) == null ? void 0 : _a.contains(target)))) {
|
2406
|
-
return
|
2414
|
+
return mouse;
|
2407
2415
|
}
|
2408
|
-
const delay = { value: 200, tolerance: 10 };
|
2409
2416
|
if (pointerType === "touch") {
|
2410
|
-
return
|
2417
|
+
return touch;
|
2411
2418
|
}
|
2412
|
-
return
|
2413
|
-
delay,
|
2414
|
-
distance: { value: 5 }
|
2415
|
-
};
|
2419
|
+
return other;
|
2416
2420
|
}
|
2417
2421
|
})
|
2418
2422
|
]);
|
@@ -2758,13 +2762,16 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
|
|
2758
2762
|
var import_modifiers = require("@dnd-kit/dom/modifiers");
|
2759
2763
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
2760
2764
|
var SortableProvider = ({
|
2765
|
+
container,
|
2761
2766
|
children,
|
2762
2767
|
onDragStart,
|
2763
2768
|
onDragEnd,
|
2764
2769
|
onMove
|
2765
2770
|
}) => {
|
2766
2771
|
const [move, setMove] = (0, import_react14.useState)({ source: -1, target: -1 });
|
2767
|
-
const sensors = useSensors(
|
2772
|
+
const sensors = useSensors({
|
2773
|
+
mouse: { distance: { value: 5 } }
|
2774
|
+
});
|
2768
2775
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
2769
2776
|
import_react13.DragDropProvider,
|
2770
2777
|
{
|
@@ -2772,7 +2779,7 @@ var SortableProvider = ({
|
|
2772
2779
|
modifiers: [
|
2773
2780
|
import_modifiers.RestrictToElement.configure({
|
2774
2781
|
element() {
|
2775
|
-
return
|
2782
|
+
return container.current;
|
2776
2783
|
}
|
2777
2784
|
})
|
2778
2785
|
],
|
@@ -2819,7 +2826,11 @@ var Sortable = ({
|
|
2819
2826
|
children,
|
2820
2827
|
type = "item"
|
2821
2828
|
}) => {
|
2822
|
-
const {
|
2829
|
+
const {
|
2830
|
+
ref: sortableRef,
|
2831
|
+
status,
|
2832
|
+
handleRef
|
2833
|
+
} = useSortableSafe({
|
2823
2834
|
id,
|
2824
2835
|
type,
|
2825
2836
|
index,
|
@@ -2827,7 +2838,7 @@ var Sortable = ({
|
|
2827
2838
|
data: { index },
|
2828
2839
|
collisionDetector: createDynamicCollisionDetector("y")
|
2829
2840
|
});
|
2830
|
-
return children({ status, ref: sortableRef });
|
2841
|
+
return children({ status, ref: sortableRef, handleRef });
|
2831
2842
|
};
|
2832
2843
|
|
2833
2844
|
// components/AutoField/context.tsx
|
@@ -2885,6 +2896,7 @@ var ArrayField = ({
|
|
2885
2896
|
value: _value,
|
2886
2897
|
name,
|
2887
2898
|
label,
|
2899
|
+
labelIcon,
|
2888
2900
|
readOnly,
|
2889
2901
|
id,
|
2890
2902
|
Label: Label2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", __spreadValues({}, props))
|
@@ -2949,6 +2961,7 @@ var ArrayField = ({
|
|
2949
2961
|
}
|
2950
2962
|
}, []);
|
2951
2963
|
const [isDragging, setIsDragging] = (0, import_react16.useState)(false);
|
2964
|
+
const dndContainerRef = (0, import_react16.useRef)(null);
|
2952
2965
|
const canEdit = useAppStore(
|
2953
2966
|
(s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
|
2954
2967
|
);
|
@@ -2961,12 +2974,13 @@ var ArrayField = ({
|
|
2961
2974
|
Label2,
|
2962
2975
|
{
|
2963
2976
|
label: label || name,
|
2964
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(List, { size: 16 }),
|
2977
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(List, { size: 16 }),
|
2965
2978
|
el: "div",
|
2966
2979
|
readOnly,
|
2967
2980
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
2968
2981
|
SortableProvider,
|
2969
2982
|
{
|
2983
|
+
container: dndContainerRef,
|
2970
2984
|
onDragStart: () => setIsDragging(true),
|
2971
2985
|
onDragEnd: () => setIsDragging(false),
|
2972
2986
|
onMove: (move) => {
|
@@ -2997,113 +3011,113 @@ var ArrayField = ({
|
|
2997
3011
|
addDisabled
|
2998
3012
|
}),
|
2999
3013
|
children: [
|
3000
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3014
|
+
localState.arrayState.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3015
|
+
"div",
|
3016
|
+
{
|
3017
|
+
ref: dndContainerRef,
|
3018
|
+
className: getClassName5("inner"),
|
3019
|
+
"data-dnd-container": true,
|
3020
|
+
children: localState.arrayState.items.map((item, i) => {
|
3021
|
+
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
3022
|
+
const data = Array.from(localState.value || [])[i] || {};
|
3023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3024
|
+
Sortable,
|
3011
3025
|
{
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3026
|
+
id: _arrayId,
|
3027
|
+
index: i,
|
3028
|
+
disabled: readOnly,
|
3029
|
+
children: ({ status, ref, handleRef }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
3030
|
+
"div",
|
3031
|
+
{
|
3032
|
+
ref,
|
3033
|
+
className: getClassNameItem({
|
3034
|
+
isExpanded: arrayState.openId === _arrayId,
|
3035
|
+
isDragging: status === "dragging",
|
3036
|
+
readOnly
|
3037
|
+
}),
|
3038
|
+
children: [
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
3040
|
+
"div",
|
3041
|
+
{
|
3042
|
+
ref: handleRef,
|
3043
|
+
onClick: (e) => {
|
3044
|
+
if (isDragging) return;
|
3045
|
+
e.preventDefault();
|
3046
|
+
e.stopPropagation();
|
3047
|
+
if (arrayState.openId === _arrayId) {
|
3048
|
+
setUi(
|
3049
|
+
mapArrayStateToUi({
|
3050
|
+
openId: ""
|
3051
|
+
})
|
3052
|
+
);
|
3053
|
+
} else {
|
3054
|
+
setUi(
|
3055
|
+
mapArrayStateToUi({
|
3056
|
+
openId: _arrayId
|
3057
|
+
})
|
3058
|
+
);
|
3059
|
+
}
|
3060
|
+
},
|
3061
|
+
className: getClassNameItem("summary"),
|
3062
|
+
children: [
|
3063
|
+
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("rhs"), children: [
|
3065
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("actions"), children: [
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3067
|
+
IconButton,
|
3068
|
+
{
|
3069
|
+
type: "button",
|
3070
|
+
disabled: !!addDisabled,
|
3071
|
+
onClick: (e) => {
|
3072
|
+
e.stopPropagation();
|
3073
|
+
const existingValue = [...value || []];
|
3074
|
+
existingValue.splice(
|
3075
|
+
i,
|
3076
|
+
0,
|
3077
|
+
existingValue[i]
|
3078
|
+
);
|
3079
|
+
onChange(
|
3080
|
+
existingValue,
|
3081
|
+
mapArrayStateToUi(
|
3082
|
+
regenerateArrayState(existingValue)
|
3083
|
+
)
|
3084
|
+
);
|
3085
|
+
},
|
3086
|
+
title: "Duplicate",
|
3087
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copy, { size: 16 })
|
3088
|
+
}
|
3089
|
+
) }),
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3091
|
+
IconButton,
|
3092
|
+
{
|
3093
|
+
type: "button",
|
3094
|
+
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
3095
|
+
onClick: (e) => {
|
3096
|
+
e.stopPropagation();
|
3097
|
+
const existingValue = [...value || []];
|
3098
|
+
const existingItems = [
|
3099
|
+
...arrayState.items || []
|
3100
|
+
];
|
3101
|
+
existingValue.splice(i, 1);
|
3102
|
+
existingItems.splice(i, 1);
|
3103
|
+
onChange(
|
3104
|
+
existingValue,
|
3105
|
+
mapArrayStateToUi({
|
3106
|
+
items: existingItems
|
3107
|
+
})
|
3108
|
+
);
|
3109
|
+
},
|
3110
|
+
title: "Delete",
|
3111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Trash, { size: 16 })
|
3112
|
+
}
|
3113
|
+
) })
|
3114
|
+
] }),
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DragIcon, {}) })
|
3116
|
+
] })
|
3117
|
+
]
|
3038
3118
|
}
|
3039
|
-
|
3040
|
-
className: getClassNameItem("
|
3041
|
-
children: [
|
3042
|
-
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
3043
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("rhs"), children: [
|
3044
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("actions"), children: [
|
3045
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3046
|
-
IconButton,
|
3047
|
-
{
|
3048
|
-
type: "button",
|
3049
|
-
disabled: !!addDisabled,
|
3050
|
-
onClick: (e) => {
|
3051
|
-
e.stopPropagation();
|
3052
|
-
const existingValue = [...value || []];
|
3053
|
-
existingValue.splice(
|
3054
|
-
i,
|
3055
|
-
0,
|
3056
|
-
existingValue[i]
|
3057
|
-
);
|
3058
|
-
onChange(
|
3059
|
-
existingValue,
|
3060
|
-
mapArrayStateToUi(
|
3061
|
-
regenerateArrayState(existingValue)
|
3062
|
-
)
|
3063
|
-
);
|
3064
|
-
},
|
3065
|
-
title: "Duplicate",
|
3066
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copy, { size: 16 })
|
3067
|
-
}
|
3068
|
-
) }),
|
3069
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3070
|
-
IconButton,
|
3071
|
-
{
|
3072
|
-
type: "button",
|
3073
|
-
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
3074
|
-
onClick: (e) => {
|
3075
|
-
e.stopPropagation();
|
3076
|
-
const existingValue = [...value || []];
|
3077
|
-
const existingItems = [
|
3078
|
-
...arrayState.items || []
|
3079
|
-
];
|
3080
|
-
existingValue.splice(i, 1);
|
3081
|
-
existingItems.splice(i, 1);
|
3082
|
-
onChange(
|
3083
|
-
existingValue,
|
3084
|
-
mapArrayStateToUi({
|
3085
|
-
items: existingItems
|
3086
|
-
})
|
3087
|
-
);
|
3088
|
-
},
|
3089
|
-
title: "Delete",
|
3090
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Trash, { size: 16 })
|
3091
|
-
}
|
3092
|
-
) })
|
3093
|
-
] }),
|
3094
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DragIcon, {}) })
|
3095
|
-
] })
|
3096
|
-
]
|
3097
|
-
}
|
3098
|
-
),
|
3099
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3100
|
-
"fieldset",
|
3101
|
-
{
|
3102
|
-
className: getClassNameItem("fieldset"),
|
3103
|
-
onPointerDownCapture: (e) => {
|
3104
|
-
e.stopPropagation();
|
3105
|
-
},
|
3106
|
-
children: Object.keys(field.arrayFields).map((subName) => {
|
3119
|
+
),
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
|
3107
3121
|
const subField = field.arrayFields[subName];
|
3108
3122
|
const indexName = `${name}[${i}]`;
|
3109
3123
|
const subPath = `${indexName}.${subName}`;
|
@@ -3145,16 +3159,16 @@ var ArrayField = ({
|
|
3145
3159
|
},
|
3146
3160
|
subPath
|
3147
3161
|
);
|
3148
|
-
})
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3152
|
-
}
|
3153
|
-
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3157
|
-
|
3162
|
+
}) }) })
|
3163
|
+
]
|
3164
|
+
}
|
3165
|
+
)
|
3166
|
+
},
|
3167
|
+
_arrayId
|
3168
|
+
);
|
3169
|
+
})
|
3170
|
+
}
|
3171
|
+
),
|
3158
3172
|
!addDisabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3159
3173
|
"button",
|
3160
3174
|
{
|
@@ -3193,6 +3207,7 @@ var DefaultField = ({
|
|
3193
3207
|
value: _value,
|
3194
3208
|
name,
|
3195
3209
|
label,
|
3210
|
+
labelIcon,
|
3196
3211
|
Label: Label2,
|
3197
3212
|
id
|
3198
3213
|
}) => {
|
@@ -3201,7 +3216,7 @@ var DefaultField = ({
|
|
3201
3216
|
Label2,
|
3202
3217
|
{
|
3203
3218
|
label: label || name,
|
3204
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
3219
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
3205
3220
|
field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Type, { size: 16 }),
|
3206
3221
|
field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Hash, { size: 16 })
|
3207
3222
|
] }),
|
@@ -3631,6 +3646,7 @@ var ExternalField = ({
|
|
3631
3646
|
value,
|
3632
3647
|
name,
|
3633
3648
|
label,
|
3649
|
+
labelIcon,
|
3634
3650
|
Label: Label2,
|
3635
3651
|
id,
|
3636
3652
|
readOnly
|
@@ -3648,27 +3664,35 @@ var ExternalField = ({
|
|
3648
3664
|
if (field.type !== "external") {
|
3649
3665
|
return null;
|
3650
3666
|
}
|
3651
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3652
|
-
|
3667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3668
|
+
Label2,
|
3653
3669
|
{
|
3654
|
-
name,
|
3655
|
-
|
3656
|
-
|
3657
|
-
|
3658
|
-
|
3659
|
-
|
3660
|
-
|
3661
|
-
|
3662
|
-
|
3663
|
-
|
3664
|
-
|
3665
|
-
|
3666
|
-
|
3667
|
-
|
3668
|
-
|
3669
|
-
|
3670
|
+
label: label || name,
|
3671
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Link, { size: 16 }),
|
3672
|
+
el: "div",
|
3673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3674
|
+
ExternalInput,
|
3675
|
+
{
|
3676
|
+
name,
|
3677
|
+
field: __spreadProps(__spreadValues({}, validField), {
|
3678
|
+
// DEPRECATED
|
3679
|
+
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
3680
|
+
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
3681
|
+
mapRow: validField.mapRow,
|
3682
|
+
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
|
3683
|
+
return yield deprecatedField.adaptor.fetchList(
|
3684
|
+
deprecatedField.adaptorParams
|
3685
|
+
);
|
3686
|
+
}) : validField.fetchList
|
3687
|
+
}),
|
3688
|
+
onChange,
|
3689
|
+
value,
|
3690
|
+
id,
|
3691
|
+
readOnly
|
3692
|
+
}
|
3693
|
+
)
|
3670
3694
|
}
|
3671
|
-
)
|
3695
|
+
);
|
3672
3696
|
};
|
3673
3697
|
|
3674
3698
|
// components/AutoField/fields/RadioField/index.tsx
|
@@ -3697,6 +3721,7 @@ var RadioField = ({
|
|
3697
3721
|
name,
|
3698
3722
|
id,
|
3699
3723
|
label,
|
3724
|
+
labelIcon,
|
3700
3725
|
Label: Label2
|
3701
3726
|
}) => {
|
3702
3727
|
const flatOptions = (0, import_react21.useMemo)(
|
@@ -3709,7 +3734,7 @@ var RadioField = ({
|
|
3709
3734
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
3710
3735
|
Label2,
|
3711
3736
|
{
|
3712
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CircleCheckBig, { size: 16 }),
|
3737
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CircleCheckBig, { size: 16 }),
|
3713
3738
|
label: label || name,
|
3714
3739
|
readOnly,
|
3715
3740
|
el: "div",
|
@@ -3756,6 +3781,7 @@ var SelectField = ({
|
|
3756
3781
|
field,
|
3757
3782
|
onChange,
|
3758
3783
|
label,
|
3784
|
+
labelIcon,
|
3759
3785
|
Label: Label2,
|
3760
3786
|
value,
|
3761
3787
|
name,
|
@@ -3773,7 +3799,7 @@ var SelectField = ({
|
|
3773
3799
|
Label2,
|
3774
3800
|
{
|
3775
3801
|
label: label || name,
|
3776
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDown, { size: 16 }),
|
3802
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDown, { size: 16 }),
|
3777
3803
|
readOnly,
|
3778
3804
|
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
3779
3805
|
"select",
|
@@ -3817,24 +3843,33 @@ var TextareaField = ({
|
|
3817
3843
|
value,
|
3818
3844
|
name,
|
3819
3845
|
label,
|
3846
|
+
labelIcon,
|
3820
3847
|
Label: Label2,
|
3821
3848
|
id
|
3822
3849
|
}) => {
|
3823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3824
|
-
|
3850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3851
|
+
Label2,
|
3825
3852
|
{
|
3826
|
-
|
3827
|
-
|
3828
|
-
autoComplete: "off",
|
3829
|
-
name,
|
3830
|
-
value: typeof value === "undefined" ? "" : value,
|
3831
|
-
onChange: (e) => onChange(e.currentTarget.value),
|
3853
|
+
label: label || name,
|
3854
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Type, { size: 16 }),
|
3832
3855
|
readOnly,
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3857
|
+
"textarea",
|
3858
|
+
{
|
3859
|
+
id,
|
3860
|
+
className: getClassName13("input"),
|
3861
|
+
autoComplete: "off",
|
3862
|
+
name,
|
3863
|
+
value: typeof value === "undefined" ? "" : value,
|
3864
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
3865
|
+
readOnly,
|
3866
|
+
tabIndex: readOnly ? -1 : void 0,
|
3867
|
+
rows: 5,
|
3868
|
+
placeholder: field.type === "textarea" ? field.placeholder : void 0
|
3869
|
+
}
|
3870
|
+
)
|
3836
3871
|
}
|
3837
|
-
)
|
3872
|
+
);
|
3838
3873
|
};
|
3839
3874
|
|
3840
3875
|
// components/AutoField/fields/ObjectField/index.tsx
|
@@ -3853,6 +3888,7 @@ var ObjectField = ({
|
|
3853
3888
|
value,
|
3854
3889
|
name,
|
3855
3890
|
label,
|
3891
|
+
labelIcon,
|
3856
3892
|
Label: Label2,
|
3857
3893
|
readOnly,
|
3858
3894
|
id
|
@@ -3866,7 +3902,7 @@ var ObjectField = ({
|
|
3866
3902
|
Label2,
|
3867
3903
|
{
|
3868
3904
|
label: label || name,
|
3869
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EllipsisVertical, { size: 16 }),
|
3905
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EllipsisVertical, { size: 16 }),
|
3870
3906
|
el: "div",
|
3871
3907
|
readOnly,
|
3872
3908
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
|
@@ -3983,6 +4019,7 @@ function AutoFieldInternal(props) {
|
|
3983
4019
|
const { id, Label: Label2 = FieldLabelInternal } = props;
|
3984
4020
|
const field = props.field;
|
3985
4021
|
const label = field.label;
|
4022
|
+
const labelIcon = field.labelIcon;
|
3986
4023
|
const defaultId = useSafeId();
|
3987
4024
|
const resolvedId = id || defaultId;
|
3988
4025
|
const defaultFields = {
|
@@ -4008,6 +4045,7 @@ function AutoFieldInternal(props) {
|
|
4008
4045
|
const mergedProps = __spreadProps(__spreadValues({}, props), {
|
4009
4046
|
field,
|
4010
4047
|
label,
|
4048
|
+
labelIcon,
|
4011
4049
|
Label: Label2,
|
4012
4050
|
id: resolvedId
|
4013
4051
|
});
|
@@ -4070,10 +4108,13 @@ function AutoFieldPrivate(props) {
|
|
4070
4108
|
const isFocused = useAppStore((s) => s.state.ui.field.focus === props.name);
|
4071
4109
|
const { value, onChange } = props;
|
4072
4110
|
const [localValue, setLocalValue] = (0, import_react24.useState)(value);
|
4073
|
-
const onChangeLocal = (0, import_react24.useCallback)(
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4111
|
+
const onChangeLocal = (0, import_react24.useCallback)(
|
4112
|
+
(val, ui) => {
|
4113
|
+
setLocalValue(val);
|
4114
|
+
onChange(val, ui);
|
4115
|
+
},
|
4116
|
+
[onChange]
|
4117
|
+
);
|
4077
4118
|
(0, import_react24.useEffect)(() => {
|
4078
4119
|
if (!isFocused) {
|
4079
4120
|
setLocalValue(value);
|
@@ -4534,10 +4575,18 @@ var DraggableComponent = ({
|
|
4534
4575
|
const rect = el.getBoundingClientRect();
|
4535
4576
|
const diffLeft = rect.x;
|
4536
4577
|
const exceedsBoundsLeft = diffLeft < 0;
|
4578
|
+
const diffTop = rect.y;
|
4579
|
+
const exceedsBoundsTop = diffTop < 0;
|
4537
4580
|
if (exceedsBoundsLeft) {
|
4538
4581
|
el.style.transformOrigin = "left top";
|
4539
4582
|
el.style.left = "0px";
|
4540
4583
|
}
|
4584
|
+
if (exceedsBoundsTop) {
|
4585
|
+
el.style.top = "12px";
|
4586
|
+
if (!exceedsBoundsLeft) {
|
4587
|
+
el.style.transformOrigin = "right top";
|
4588
|
+
}
|
4589
|
+
}
|
4541
4590
|
}
|
4542
4591
|
}
|
4543
4592
|
},
|
@@ -5551,7 +5600,7 @@ var DragDropContextClient = ({
|
|
5551
5600
|
const resolveData2 = useAppStore((s) => s.resolveData);
|
5552
5601
|
const metadata = useAppStore((s) => s.metadata);
|
5553
5602
|
const appStore = useAppStoreApi();
|
5554
|
-
const id = (
|
5603
|
+
const id = useSafeId();
|
5555
5604
|
const debouncedParamsRef = (0, import_react36.useRef)(null);
|
5556
5605
|
const tempDisableFallback = useTempDisableFallback(100);
|
5557
5606
|
const [zoneStore] = (0, import_react36.useState)(
|
@@ -6005,7 +6054,7 @@ var Drawer = ({
|
|
6005
6054
|
"Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
|
6006
6055
|
);
|
6007
6056
|
}
|
6008
|
-
const id = (
|
6057
|
+
const id = useSafeId();
|
6009
6058
|
const { ref } = useDroppableSafe({
|
6010
6059
|
id,
|
6011
6060
|
type: "void",
|