@measured/puck 0.21.0-canary.73b98fb4 → 0.21.0-canary.79a26849
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/{chunk-47DMTRCY.mjs → chunk-UABEUL66.mjs} +13 -4
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +13 -4
- package/dist/index.mjs +1 -1
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +13 -4
- package/dist/no-external.mjs +1 -1
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/{walk-tree-bsPSSmt9.d.mts → walk-tree-CgWnYC1X.d.mts} +1 -1
- package/dist/{walk-tree-bsPSSmt9.d.ts → walk-tree-CgWnYC1X.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -5520,7 +5520,8 @@ var useMinEmptyHeight = ({
|
|
|
5520
5520
|
}
|
|
5521
5521
|
}
|
|
5522
5522
|
}, [ref.current, draggedItem, onDragFinished]);
|
|
5523
|
-
|
|
5523
|
+
const returnedMinHeight = isNaN(Number(userMinEmptyHeight)) ? userMinEmptyHeight : `${userMinEmptyHeight}px`;
|
|
5524
|
+
return [prevHeight ? `${prevHeight}px` : returnedMinHeight, isAnimating];
|
|
5524
5525
|
};
|
|
5525
5526
|
|
|
5526
5527
|
// lib/assign-refs.ts
|
|
@@ -6097,7 +6098,7 @@ var DropZoneEdit = forwardRef3(
|
|
|
6097
6098
|
disallow,
|
|
6098
6099
|
style,
|
|
6099
6100
|
className,
|
|
6100
|
-
minEmptyHeight: userMinEmptyHeight =
|
|
6101
|
+
minEmptyHeight: userMinEmptyHeight = "128px",
|
|
6101
6102
|
collisionAxis,
|
|
6102
6103
|
as
|
|
6103
6104
|
}, userRef) {
|
|
@@ -6260,7 +6261,7 @@ var DropZoneEdit = forwardRef3(
|
|
|
6260
6261
|
"data-testid": `dropzone:${zoneCompound}`,
|
|
6261
6262
|
"data-puck-dropzone": zoneCompound,
|
|
6262
6263
|
style: __spreadProps(__spreadValues({}, style), {
|
|
6263
|
-
"--min-empty-height":
|
|
6264
|
+
"--min-empty-height": minEmptyHeight,
|
|
6264
6265
|
backgroundColor: RENDER_DEBUG ? getRandomColor() : style == null ? void 0 : style.backgroundColor
|
|
6265
6266
|
}),
|
|
6266
6267
|
children: contentIdsWithPreview.map((componentId, i) => {
|
|
@@ -6429,7 +6430,15 @@ var generateUsePuck = (store) => {
|
|
|
6429
6430
|
selectedItem: store.selectedItem || null,
|
|
6430
6431
|
getItemBySelector: (selector) => getItem(selector, store.state),
|
|
6431
6432
|
getItemById: (id) => store.state.indexes.nodes[id].data,
|
|
6432
|
-
getSelectorForId: (id) => getSelectorForId(store.state, id)
|
|
6433
|
+
getSelectorForId: (id) => getSelectorForId(store.state, id),
|
|
6434
|
+
getParentById: (id) => {
|
|
6435
|
+
const node = store.state.indexes.nodes[id];
|
|
6436
|
+
const parentId = node.parentId;
|
|
6437
|
+
if (parentId === null) return;
|
|
6438
|
+
const parentNode = store.state.indexes.nodes[parentId];
|
|
6439
|
+
if (!parentNode) return;
|
|
6440
|
+
return parentNode.data;
|
|
6441
|
+
}
|
|
6433
6442
|
};
|
|
6434
6443
|
return storeData;
|
|
6435
6444
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-
|
|
2
|
-
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-CgWnYC1X.mjs';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.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';
|
|
@@ -272,6 +272,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
272
272
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
273
273
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
274
274
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
275
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
275
276
|
history: {
|
|
276
277
|
back: HistorySlice["back"];
|
|
277
278
|
forward: HistorySlice["forward"];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-
|
|
2
|
-
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-CgWnYC1X.js';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.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';
|
|
@@ -272,6 +272,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
272
272
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
273
273
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
274
274
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
275
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
275
276
|
history: {
|
|
276
277
|
back: HistorySlice["back"];
|
|
277
278
|
forward: HistorySlice["forward"];
|
package/dist/index.js
CHANGED
|
@@ -5242,7 +5242,8 @@ var useMinEmptyHeight = ({
|
|
|
5242
5242
|
}
|
|
5243
5243
|
}
|
|
5244
5244
|
}, [ref.current, draggedItem, onDragFinished]);
|
|
5245
|
-
|
|
5245
|
+
const returnedMinHeight = isNaN(Number(userMinEmptyHeight)) ? userMinEmptyHeight : `${userMinEmptyHeight}px`;
|
|
5246
|
+
return [prevHeight ? `${prevHeight}px` : returnedMinHeight, isAnimating];
|
|
5246
5247
|
};
|
|
5247
5248
|
|
|
5248
5249
|
// lib/assign-refs.ts
|
|
@@ -5992,7 +5993,7 @@ var DropZoneEdit = (0, import_react34.forwardRef)(
|
|
|
5992
5993
|
disallow,
|
|
5993
5994
|
style,
|
|
5994
5995
|
className,
|
|
5995
|
-
minEmptyHeight: userMinEmptyHeight =
|
|
5996
|
+
minEmptyHeight: userMinEmptyHeight = "128px",
|
|
5996
5997
|
collisionAxis,
|
|
5997
5998
|
as
|
|
5998
5999
|
}, userRef) {
|
|
@@ -6155,7 +6156,7 @@ var DropZoneEdit = (0, import_react34.forwardRef)(
|
|
|
6155
6156
|
"data-testid": `dropzone:${zoneCompound}`,
|
|
6156
6157
|
"data-puck-dropzone": zoneCompound,
|
|
6157
6158
|
style: __spreadProps(__spreadValues({}, style), {
|
|
6158
|
-
"--min-empty-height":
|
|
6159
|
+
"--min-empty-height": minEmptyHeight,
|
|
6159
6160
|
backgroundColor: RENDER_DEBUG ? getRandomColor() : style == null ? void 0 : style.backgroundColor
|
|
6160
6161
|
}),
|
|
6161
6162
|
children: contentIdsWithPreview.map((componentId, i) => {
|
|
@@ -8743,7 +8744,15 @@ var generateUsePuck = (store) => {
|
|
|
8743
8744
|
selectedItem: store.selectedItem || null,
|
|
8744
8745
|
getItemBySelector: (selector) => getItem(selector, store.state),
|
|
8745
8746
|
getItemById: (id) => store.state.indexes.nodes[id].data,
|
|
8746
|
-
getSelectorForId: (id) => getSelectorForId(store.state, id)
|
|
8747
|
+
getSelectorForId: (id) => getSelectorForId(store.state, id),
|
|
8748
|
+
getParentById: (id) => {
|
|
8749
|
+
const node = store.state.indexes.nodes[id];
|
|
8750
|
+
const parentId = node.parentId;
|
|
8751
|
+
if (parentId === null) return;
|
|
8752
|
+
const parentNode = store.state.indexes.nodes[parentId];
|
|
8753
|
+
if (!parentNode) return;
|
|
8754
|
+
return parentNode.data;
|
|
8755
|
+
}
|
|
8747
8756
|
};
|
|
8748
8757
|
return storeData;
|
|
8749
8758
|
};
|
package/dist/index.mjs
CHANGED
package/dist/no-external.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ad as Adaptor, A as AppState, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, f as ComponentConfig, J as ComponentConfigExtensions, T as ComponentConfigParams, a as ComponentData, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, C as Config, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, j as Data, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, h as Field, a4 as FieldMetadata, i as FieldProps, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, g as FieldTransforms, F as Fields, H as History, I as IframeConfig, l as InitialHistory, z as ItemWithId, $ as MappedItem, M as Metadata, a7 as NumberField, ac as ObjectField, k as OnAction, x as OverrideKey, O as Overrides, P as Permissions, d as Plugin, b as PuckAction, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, c as ResolveDataTrigger, K as RootConfig, Z as RootData, R as RootDataWithProps, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, e as UiState, U as UserGenerics, q as Viewport, V as Viewports, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
export { ad as Adaptor, A as AppState, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, f as ComponentConfig, J as ComponentConfigExtensions, T as ComponentConfigParams, a as ComponentData, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, C as Config, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, j as Data, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, h as Field, a4 as FieldMetadata, i as FieldProps, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, g as FieldTransforms, F as Fields, H as History, I as IframeConfig, l as InitialHistory, z as ItemWithId, $ as MappedItem, M as Metadata, a7 as NumberField, ac as ObjectField, k as OnAction, x as OverrideKey, O as Overrides, P as Permissions, d as Plugin, b as PuckAction, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, c as ResolveDataTrigger, K as RootConfig, Z as RootData, R as RootDataWithProps, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, e as UiState, U as UserGenerics, q as Viewport, V as Viewports, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.mjs';
|
|
2
2
|
export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, UsePuckData, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
package/dist/no-external.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ad as Adaptor, A as AppState, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, f as ComponentConfig, J as ComponentConfigExtensions, T as ComponentConfigParams, a as ComponentData, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, C as Config, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, j as Data, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, h as Field, a4 as FieldMetadata, i as FieldProps, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, g as FieldTransforms, F as Fields, H as History, I as IframeConfig, l as InitialHistory, z as ItemWithId, $ as MappedItem, M as Metadata, a7 as NumberField, ac as ObjectField, k as OnAction, x as OverrideKey, O as Overrides, P as Permissions, d as Plugin, b as PuckAction, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, c as ResolveDataTrigger, K as RootConfig, Z as RootData, R as RootDataWithProps, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, e as UiState, U as UserGenerics, q as Viewport, V as Viewports, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
export { ad as Adaptor, A as AppState, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, f as ComponentConfig, J as ComponentConfigExtensions, T as ComponentConfigParams, a as ComponentData, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, C as Config, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, j as Data, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, h as Field, a4 as FieldMetadata, i as FieldProps, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, g as FieldTransforms, F as Fields, H as History, I as IframeConfig, l as InitialHistory, z as ItemWithId, $ as MappedItem, M as Metadata, a7 as NumberField, ac as ObjectField, k as OnAction, x as OverrideKey, O as Overrides, P as Permissions, d as Plugin, b as PuckAction, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, c as ResolveDataTrigger, K as RootConfig, Z as RootData, R as RootDataWithProps, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, e as UiState, U as UserGenerics, q as Viewport, V as Viewports, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.js';
|
|
2
2
|
export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, UsePuckData, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
package/dist/no-external.js
CHANGED
|
@@ -5242,7 +5242,8 @@ var useMinEmptyHeight = ({
|
|
|
5242
5242
|
}
|
|
5243
5243
|
}
|
|
5244
5244
|
}, [ref.current, draggedItem, onDragFinished]);
|
|
5245
|
-
|
|
5245
|
+
const returnedMinHeight = isNaN(Number(userMinEmptyHeight)) ? userMinEmptyHeight : `${userMinEmptyHeight}px`;
|
|
5246
|
+
return [prevHeight ? `${prevHeight}px` : returnedMinHeight, isAnimating];
|
|
5246
5247
|
};
|
|
5247
5248
|
|
|
5248
5249
|
// lib/assign-refs.ts
|
|
@@ -5992,7 +5993,7 @@ var DropZoneEdit = (0, import_react34.forwardRef)(
|
|
|
5992
5993
|
disallow,
|
|
5993
5994
|
style,
|
|
5994
5995
|
className,
|
|
5995
|
-
minEmptyHeight: userMinEmptyHeight =
|
|
5996
|
+
minEmptyHeight: userMinEmptyHeight = "128px",
|
|
5996
5997
|
collisionAxis,
|
|
5997
5998
|
as
|
|
5998
5999
|
}, userRef) {
|
|
@@ -6155,7 +6156,7 @@ var DropZoneEdit = (0, import_react34.forwardRef)(
|
|
|
6155
6156
|
"data-testid": `dropzone:${zoneCompound}`,
|
|
6156
6157
|
"data-puck-dropzone": zoneCompound,
|
|
6157
6158
|
style: __spreadProps(__spreadValues({}, style), {
|
|
6158
|
-
"--min-empty-height":
|
|
6159
|
+
"--min-empty-height": minEmptyHeight,
|
|
6159
6160
|
backgroundColor: RENDER_DEBUG ? getRandomColor() : style == null ? void 0 : style.backgroundColor
|
|
6160
6161
|
}),
|
|
6161
6162
|
children: contentIdsWithPreview.map((componentId, i) => {
|
|
@@ -8743,7 +8744,15 @@ var generateUsePuck = (store) => {
|
|
|
8743
8744
|
selectedItem: store.selectedItem || null,
|
|
8744
8745
|
getItemBySelector: (selector) => getItem(selector, store.state),
|
|
8745
8746
|
getItemById: (id) => store.state.indexes.nodes[id].data,
|
|
8746
|
-
getSelectorForId: (id) => getSelectorForId(store.state, id)
|
|
8747
|
+
getSelectorForId: (id) => getSelectorForId(store.state, id),
|
|
8748
|
+
getParentById: (id) => {
|
|
8749
|
+
const node = store.state.indexes.nodes[id];
|
|
8750
|
+
const parentId = node.parentId;
|
|
8751
|
+
if (parentId === null) return;
|
|
8752
|
+
const parentNode = store.state.indexes.nodes[parentId];
|
|
8753
|
+
if (!parentNode) return;
|
|
8754
|
+
return parentNode.data;
|
|
8755
|
+
}
|
|
8747
8756
|
};
|
|
8748
8757
|
return storeData;
|
|
8749
8758
|
};
|
package/dist/no-external.mjs
CHANGED
package/dist/rsc.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CgWnYC1X.mjs';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
package/dist/rsc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CgWnYC1X.js';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
|
@@ -146,7 +146,7 @@ type DropZoneProps = {
|
|
|
146
146
|
allow?: string[];
|
|
147
147
|
disallow?: string[];
|
|
148
148
|
style?: CSSProperties;
|
|
149
|
-
minEmptyHeight?: number;
|
|
149
|
+
minEmptyHeight?: CSSProperties["minHeight"] | number;
|
|
150
150
|
className?: string;
|
|
151
151
|
collisionAxis?: DragAxis;
|
|
152
152
|
as?: ElementType;
|
|
@@ -146,7 +146,7 @@ type DropZoneProps = {
|
|
|
146
146
|
allow?: string[];
|
|
147
147
|
disallow?: string[];
|
|
148
148
|
style?: CSSProperties;
|
|
149
|
-
minEmptyHeight?: number;
|
|
149
|
+
minEmptyHeight?: CSSProperties["minHeight"] | number;
|
|
150
150
|
className?: string;
|
|
151
151
|
collisionAxis?: DragAxis;
|
|
152
152
|
as?: ElementType;
|
package/package.json
CHANGED