@puckeditor/core 0.23.0-canary.9bf3e00a → 0.23.0-canary.e7fef140
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/{Editor-ZZW3KF2T.css → Editor-T7TKW6NT.css} +7 -7
- package/dist/{Editor-BJP5AFD5.mjs → Editor-Z6P5UAVB.mjs} +8 -8
- package/dist/{actions-Csn3gOP8.d.mts → actions-3w-1VzY_.d.mts} +7 -1
- package/dist/{actions-Csn3gOP8.d.ts → actions-3w-1VzY_.d.ts} +7 -1
- package/dist/{chunk-WQV7W7OC.mjs → chunk-3OLRWMRO.mjs} +7 -7
- package/dist/{chunk-JNJJ2M57.mjs → chunk-3TERNOIP.mjs} +1 -1
- package/dist/{chunk-JHNG6XYK.mjs → chunk-DIYX54ZO.mjs} +19 -5
- package/dist/{chunk-HB4CVO3I.mjs → chunk-L73ATZ55.mjs} +1 -1
- package/dist/{chunk-WUO7D6OQ.mjs → chunk-NPAYGEG5.mjs} +1 -0
- package/dist/{chunk-MU6IPW26.mjs → chunk-OCFR2FFG.mjs} +1 -1
- package/dist/{chunk-EYJW64M2.mjs → chunk-OSPG5CWL.mjs} +1 -1
- package/dist/{chunk-BMRBP3ET.mjs → chunk-PJYHZPJK.mjs} +3 -3
- package/dist/{chunk-Q6WCB6GM.mjs → chunk-S3CSGIQ3.mjs} +1844 -714
- package/dist/{chunk-25QAPMLH.mjs → chunk-UAWUZ45G.mjs} +41 -18
- package/dist/{full-7ONH7UPJ.mjs → full-67VCA5MX.mjs} +7 -7
- package/dist/{full-S3QQ2IBQ.css → full-AAZK6KLI.css} +7 -7
- package/dist/{index-De5Tn61v.d.mts → index-KWLAZybR.d.ts} +8 -3
- package/dist/{index-t7c1w81O.d.ts → index-l1l-a8tj.d.mts} +8 -3
- package/dist/index.css +308 -111
- package/dist/index.d.mts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +1948 -732
- package/dist/index.mjs +10 -10
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +40 -18
- package/dist/internal.mjs +1 -1
- package/dist/{loaded-PF5Y4VWH.mjs → loaded-4XVG2RKQ.mjs} +4 -4
- package/dist/{loaded-FVWRAJR3.css → loaded-CA3Q7UHH.css} +7 -7
- package/dist/{loaded-35D7XAOE.mjs → loaded-LM723CWI.mjs} +4 -4
- package/dist/{loaded-6YDNF4HS.mjs → loaded-VBJBTUSI.mjs} +4 -4
- package/dist/no-external.css +308 -111
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +1948 -732
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +1 -0
- package/dist/rsc.mjs +2 -2
- package/dist/{walk-tree-CWrsBHHe.d.ts → walk-tree-ConR82Y6.d.ts} +1 -1
- package/dist/{walk-tree-BrW9VQ_t.d.mts → walk-tree-DJMo6GTF.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PJYHZPJK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,15 +10,16 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3TERNOIP.mjs";
|
|
14
14
|
import {
|
|
15
15
|
LoadedRichTextMenuInner
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3OLRWMRO.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ActionBar,
|
|
19
19
|
ChevronDown,
|
|
20
20
|
ChevronRight,
|
|
21
21
|
ChevronUp,
|
|
22
|
+
ChevronsDownUp,
|
|
22
23
|
CircleCheckBig,
|
|
23
24
|
Copy,
|
|
24
25
|
CornerLeftUp,
|
|
@@ -69,7 +70,7 @@ import {
|
|
|
69
70
|
useRegisterHistorySlice,
|
|
70
71
|
useRegisterPermissionsSlice,
|
|
71
72
|
useResetAutoZoom
|
|
72
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-DIYX54ZO.mjs";
|
|
73
74
|
import {
|
|
74
75
|
generateId,
|
|
75
76
|
getItem,
|
|
@@ -77,11 +78,11 @@ import {
|
|
|
77
78
|
insertAction,
|
|
78
79
|
makeStatePublic,
|
|
79
80
|
populateIds
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-UAWUZ45G.mjs";
|
|
81
82
|
import {
|
|
82
83
|
defaultAppState,
|
|
83
84
|
defaultViewports
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-NPAYGEG5.mjs";
|
|
85
86
|
import {
|
|
86
87
|
get_class_name_factory_default
|
|
87
88
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -397,6 +398,8 @@ var DragIcon = ({ isDragDisabled }) => /* @__PURE__ */ jsx4("div", { className:
|
|
|
397
398
|
// components/Sortable/index.tsx
|
|
398
399
|
init_react_import();
|
|
399
400
|
import { DragDropProvider } from "@dnd-kit/react";
|
|
401
|
+
import { useSortable } from "@dnd-kit/react/sortable";
|
|
402
|
+
import { PointerActivationConstraints as PointerActivationConstraints2 } from "@dnd-kit/dom";
|
|
400
403
|
|
|
401
404
|
// lib/dnd/use-sensors.ts
|
|
402
405
|
init_react_import();
|
|
@@ -757,9 +760,26 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
757
760
|
return null;
|
|
758
761
|
});
|
|
759
762
|
|
|
763
|
+
// lib/dnd/get-insert-index.ts
|
|
764
|
+
init_react_import();
|
|
765
|
+
var getCollisionPosition = (direction, dir = "ltr") => direction === "up" || dir === "ltr" && direction === "left" || dir === "rtl" && direction === "right" ? "before" : "after";
|
|
766
|
+
var getInsertIndex = ({
|
|
767
|
+
position,
|
|
768
|
+
sourceIndex,
|
|
769
|
+
targetIndex,
|
|
770
|
+
isSameZone
|
|
771
|
+
}) => {
|
|
772
|
+
let index = targetIndex;
|
|
773
|
+
if (isSameZone && index >= sourceIndex) {
|
|
774
|
+
index = index - 1;
|
|
775
|
+
}
|
|
776
|
+
if (position === "after") {
|
|
777
|
+
index = index + 1;
|
|
778
|
+
}
|
|
779
|
+
return index;
|
|
780
|
+
};
|
|
781
|
+
|
|
760
782
|
// components/Sortable/index.tsx
|
|
761
|
-
import { useSortable } from "@dnd-kit/react/sortable";
|
|
762
|
-
import { PointerActivationConstraints as PointerActivationConstraints2 } from "@dnd-kit/dom";
|
|
763
783
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
764
784
|
var SortableProvider = ({
|
|
765
785
|
children,
|
|
@@ -784,20 +804,18 @@ var SortableProvider = ({
|
|
|
784
804
|
const { operation } = event;
|
|
785
805
|
const { source, target } = operation;
|
|
786
806
|
if (!source || !target) return;
|
|
787
|
-
|
|
788
|
-
|
|
807
|
+
const sourceIndex = source.data.index;
|
|
808
|
+
const targetIndex = target.data.index;
|
|
789
809
|
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
790
810
|
if (sourceIndex !== targetIndex && source.id !== target.id) {
|
|
791
|
-
const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" ? "before" : "after";
|
|
792
|
-
if (targetIndex >= sourceIndex) {
|
|
793
|
-
targetIndex = targetIndex - 1;
|
|
794
|
-
}
|
|
795
|
-
if (collisionPosition === "after") {
|
|
796
|
-
targetIndex = targetIndex + 1;
|
|
797
|
-
}
|
|
798
811
|
onMove({
|
|
799
812
|
source: sourceIndex,
|
|
800
|
-
target:
|
|
813
|
+
target: getInsertIndex({
|
|
814
|
+
position: getCollisionPosition(collisionData == null ? void 0 : collisionData.direction),
|
|
815
|
+
sourceIndex,
|
|
816
|
+
targetIndex,
|
|
817
|
+
isSameZone: true
|
|
818
|
+
})
|
|
801
819
|
});
|
|
802
820
|
}
|
|
803
821
|
},
|
|
@@ -2012,7 +2030,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
2012
2030
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2013
2031
|
import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
|
|
2014
2032
|
var Editor = lazy(
|
|
2015
|
-
() => import("./Editor-
|
|
2033
|
+
() => import("./Editor-Z6P5UAVB.mjs").then((m) => ({
|
|
2016
2034
|
default: m.Editor
|
|
2017
2035
|
}))
|
|
2018
2036
|
);
|
|
@@ -3084,6 +3102,25 @@ var styles_module_default9 = { "DropZone": "_DropZone_ybznu_1", "DropZone--hasCh
|
|
|
3084
3102
|
// components/DropZone/index.tsx
|
|
3085
3103
|
import { useDroppable as useDroppable2 } from "@dnd-kit/react";
|
|
3086
3104
|
|
|
3105
|
+
// lib/data/is-component-allowed.ts
|
|
3106
|
+
init_react_import();
|
|
3107
|
+
var isComponentAllowed = (componentType, { allow, disallow }) => {
|
|
3108
|
+
if (!componentType) {
|
|
3109
|
+
return true;
|
|
3110
|
+
}
|
|
3111
|
+
const allowed = new Set(allow);
|
|
3112
|
+
const disallowed = new Set(disallow);
|
|
3113
|
+
if (disallow) {
|
|
3114
|
+
if (disallowed.has(componentType) && allowed.has(componentType)) {
|
|
3115
|
+
disallowed.delete(componentType);
|
|
3116
|
+
}
|
|
3117
|
+
return !disallowed.has(componentType);
|
|
3118
|
+
} else if (allow) {
|
|
3119
|
+
return allowed.has(componentType);
|
|
3120
|
+
}
|
|
3121
|
+
return true;
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3087
3124
|
// components/Drawer/index.tsx
|
|
3088
3125
|
init_react_import();
|
|
3089
3126
|
|
|
@@ -3106,10 +3143,7 @@ import {
|
|
|
3106
3143
|
useRef as useRef3,
|
|
3107
3144
|
useState as useState10
|
|
3108
3145
|
} from "react";
|
|
3109
|
-
import {
|
|
3110
|
-
AutoScroller,
|
|
3111
|
-
defaultPreset
|
|
3112
|
-
} from "@dnd-kit/dom";
|
|
3146
|
+
import { AutoScroller, defaultPreset } from "@dnd-kit/dom";
|
|
3113
3147
|
|
|
3114
3148
|
// lib/dnd/NestedDroppablePlugin.ts
|
|
3115
3149
|
init_react_import();
|
|
@@ -3780,16 +3814,16 @@ var DragDropContextClient = ({
|
|
|
3780
3814
|
if (target.type === "component") {
|
|
3781
3815
|
const targetData = target.data;
|
|
3782
3816
|
targetZone = targetData.zone;
|
|
3783
|
-
targetIndex = targetData.index;
|
|
3784
3817
|
const collisionData = (_b = manager.collisionObserver.collisions[0]) == null ? void 0 : _b.data;
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
targetIndex
|
|
3792
|
-
|
|
3818
|
+
targetIndex = getInsertIndex({
|
|
3819
|
+
position: getCollisionPosition(
|
|
3820
|
+
collisionData == null ? void 0 : collisionData.direction,
|
|
3821
|
+
getDeepDir(target.element)
|
|
3822
|
+
),
|
|
3823
|
+
sourceIndex,
|
|
3824
|
+
targetIndex: targetData.index,
|
|
3825
|
+
isSameZone: sourceZone === targetZone
|
|
3826
|
+
});
|
|
3793
3827
|
} else {
|
|
3794
3828
|
targetZone = target.id.toString();
|
|
3795
3829
|
targetIndex = 0;
|
|
@@ -4538,7 +4572,7 @@ import {
|
|
|
4538
4572
|
} from "react";
|
|
4539
4573
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4540
4574
|
var Editor2 = lazy2(
|
|
4541
|
-
() => import("./Editor-
|
|
4575
|
+
() => import("./Editor-Z6P5UAVB.mjs").then((m) => ({
|
|
4542
4576
|
default: m.Editor
|
|
4543
4577
|
}))
|
|
4544
4578
|
);
|
|
@@ -5160,25 +5194,7 @@ var DropZoneEdit = forwardRef(
|
|
|
5160
5194
|
}, [zoneContentIds]);
|
|
5161
5195
|
const ref = useRef9(null);
|
|
5162
5196
|
const acceptsTarget = useCallback13(
|
|
5163
|
-
(componentType) => {
|
|
5164
|
-
if (!componentType) {
|
|
5165
|
-
return true;
|
|
5166
|
-
}
|
|
5167
|
-
if (disallow) {
|
|
5168
|
-
const defaultedAllow = allow || [];
|
|
5169
|
-
const filteredDisallow = (disallow || []).filter(
|
|
5170
|
-
(item) => defaultedAllow.indexOf(item) === -1
|
|
5171
|
-
);
|
|
5172
|
-
if (filteredDisallow.indexOf(componentType) !== -1) {
|
|
5173
|
-
return false;
|
|
5174
|
-
}
|
|
5175
|
-
} else if (allow) {
|
|
5176
|
-
if (allow.indexOf(componentType) === -1) {
|
|
5177
|
-
return false;
|
|
5178
|
-
}
|
|
5179
|
-
}
|
|
5180
|
-
return true;
|
|
5181
|
-
},
|
|
5197
|
+
(componentType) => isComponentAllowed(componentType, { allow, disallow }),
|
|
5182
5198
|
[allow, disallow]
|
|
5183
5199
|
);
|
|
5184
5200
|
const targetAccepted = useContextStore(ZoneStoreContext, (s) => {
|
|
@@ -5816,188 +5832,615 @@ init_react_import();
|
|
|
5816
5832
|
|
|
5817
5833
|
// components/Puck/components/Outline/index.tsx
|
|
5818
5834
|
init_react_import();
|
|
5835
|
+
import { useMemo as useMemo18 } from "react";
|
|
5836
|
+
import { useShallow as useShallow8 } from "zustand/react/shallow";
|
|
5837
|
+
|
|
5838
|
+
// lib/data/find-zones-for-area.ts
|
|
5839
|
+
init_react_import();
|
|
5840
|
+
var findZonesForArea = (state, area) => {
|
|
5841
|
+
return Object.keys(state.indexes.zones).filter(
|
|
5842
|
+
(zone) => zone.split(":")[0] === area
|
|
5843
|
+
);
|
|
5844
|
+
};
|
|
5819
5845
|
|
|
5820
5846
|
// components/LayerTree/index.tsx
|
|
5821
5847
|
init_react_import();
|
|
5822
5848
|
|
|
5823
|
-
//
|
|
5849
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
5824
5850
|
init_react_import();
|
|
5825
|
-
var styles_module_default14 = { "LayerTree": "_LayerTree_1vltj_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1vltj_11", "LayerTree-helper": "_LayerTree-helper_1vltj_17", "Layer": "_Layer_1vltj_1", "Layer-inner": "_Layer-inner_1vltj_30", "Layer--containsZone": "_Layer--containsZone_1vltj_37", "Layer-clickable": "_Layer-clickable_1vltj_41", "Layer--isSelected": "_Layer--isSelected_1vltj_63", "Layer-chevron": "_Layer-chevron_1vltj_91", "Layer--childIsSelected": "_Layer--childIsSelected_1vltj_92", "Layer-zones": "_Layer-zones_1vltj_96", "Layer-title": "_Layer-title_1vltj_110", "Layer-name": "_Layer-name_1vltj_119", "Layer-icon": "_Layer-icon_1vltj_125", "Layer-zoneIcon": "_Layer-zoneIcon_1vltj_130" };
|
|
5826
5851
|
|
|
5827
|
-
// components/LayerTree/
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
}
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5852
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
5853
|
+
init_react_import();
|
|
5854
|
+
import { useMemo as useMemo15 } from "react";
|
|
5855
|
+
import { useDroppable as useDroppable3 } from "@dnd-kit/react";
|
|
5856
|
+
|
|
5857
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
5858
|
+
init_react_import();
|
|
5859
|
+
|
|
5860
|
+
// lib/data/resolve-zone-constraints.ts
|
|
5861
|
+
init_react_import();
|
|
5862
|
+
|
|
5863
|
+
// lib/data/get-slot-field.ts
|
|
5864
|
+
init_react_import();
|
|
5865
|
+
|
|
5866
|
+
// lib/data/get-field-by-path.ts
|
|
5867
|
+
init_react_import();
|
|
5868
|
+
function getFieldByPath(path, fields) {
|
|
5869
|
+
if (typeof path !== "string") {
|
|
5870
|
+
throw new Error(
|
|
5871
|
+
`Can't get field definition for path (${path}): Path should be a string`
|
|
5872
|
+
);
|
|
5873
|
+
}
|
|
5874
|
+
if (!fields || typeof fields !== "object") {
|
|
5875
|
+
return void 0;
|
|
5876
|
+
}
|
|
5877
|
+
const segments = path.split(/\.|\[\d+\]/).filter(Boolean);
|
|
5878
|
+
let currFields = fields;
|
|
5879
|
+
let currField = void 0;
|
|
5880
|
+
for (let index = 0; index < segments.length; index++) {
|
|
5881
|
+
const currSegment = segments[index];
|
|
5882
|
+
currField = currFields[currSegment];
|
|
5883
|
+
if (index === segments.length - 1) {
|
|
5884
|
+
return currField;
|
|
5885
|
+
}
|
|
5886
|
+
if (!currField) {
|
|
5887
|
+
return;
|
|
5888
|
+
}
|
|
5889
|
+
if ((currField.type !== "object" || !currField.objectFields) && (currField.type !== "array" || !currField.arrayFields))
|
|
5890
|
+
return;
|
|
5891
|
+
if (currField.type === "object") {
|
|
5892
|
+
currFields = currField.objectFields;
|
|
5893
|
+
}
|
|
5894
|
+
if (currField.type === "array") {
|
|
5895
|
+
currFields = currField.arrayFields;
|
|
5896
|
+
}
|
|
5853
5897
|
}
|
|
5898
|
+
}
|
|
5899
|
+
|
|
5900
|
+
// lib/data/get-slot-field.ts
|
|
5901
|
+
var getSlotField = (zoneCompound, config, nodes) => {
|
|
5902
|
+
var _a;
|
|
5854
5903
|
const [componentId, slotId] = zoneCompound.split(":");
|
|
5855
5904
|
if (!slotId) {
|
|
5856
5905
|
return;
|
|
5857
5906
|
}
|
|
5858
5907
|
const componentType = (_a = nodes[componentId]) == null ? void 0 : _a.data.type;
|
|
5859
5908
|
const configForComponent = componentType && componentType !== rootAreaId ? config.components[componentType] : config.root;
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
var buildLayerNode = ({
|
|
5863
|
-
config,
|
|
5864
|
-
itemId,
|
|
5865
|
-
index,
|
|
5866
|
-
nodes,
|
|
5867
|
-
zoneCompound,
|
|
5868
|
-
zones,
|
|
5869
|
-
zonesByParent,
|
|
5870
|
-
componentFallbackLabel = "Component"
|
|
5871
|
-
}) => {
|
|
5872
|
-
var _a, _b, _c;
|
|
5873
|
-
const nodeData = nodes[itemId];
|
|
5874
|
-
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || componentFallbackLabel;
|
|
5875
|
-
const label = (_c = (_b = config.components[componentType]) == null ? void 0 : _b.label) != null ? _c : componentType;
|
|
5876
|
-
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
5877
|
-
return {
|
|
5878
|
-
childZones: childZoneCompounds.map(
|
|
5879
|
-
(childZoneCompound) => buildLayerTree({
|
|
5880
|
-
config,
|
|
5881
|
-
nodes,
|
|
5882
|
-
zoneCompound: childZoneCompound,
|
|
5883
|
-
zones,
|
|
5884
|
-
zonesByParent,
|
|
5885
|
-
componentFallbackLabel
|
|
5886
|
-
})
|
|
5887
|
-
),
|
|
5888
|
-
componentType,
|
|
5889
|
-
index,
|
|
5890
|
-
itemId,
|
|
5891
|
-
label,
|
|
5892
|
-
zoneCompound
|
|
5893
|
-
};
|
|
5894
|
-
};
|
|
5895
|
-
var buildLayerTree = ({
|
|
5896
|
-
config,
|
|
5897
|
-
label,
|
|
5898
|
-
nodes,
|
|
5899
|
-
zoneCompound,
|
|
5900
|
-
zones,
|
|
5901
|
-
zonesByParent = getZonesByParent(zones),
|
|
5902
|
-
componentFallbackLabel = "Component"
|
|
5903
|
-
}) => {
|
|
5904
|
-
var _a, _b;
|
|
5905
|
-
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
5906
|
-
return {
|
|
5907
|
-
items: contentIds.map(
|
|
5908
|
-
(itemId, index) => buildLayerNode({
|
|
5909
|
-
config,
|
|
5910
|
-
itemId,
|
|
5911
|
-
index,
|
|
5912
|
-
nodes,
|
|
5913
|
-
zoneCompound,
|
|
5914
|
-
zones,
|
|
5915
|
-
zonesByParent,
|
|
5916
|
-
componentFallbackLabel
|
|
5917
|
-
})
|
|
5918
|
-
),
|
|
5919
|
-
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
5920
|
-
zoneCompound
|
|
5921
|
-
};
|
|
5909
|
+
const slotField = getFieldByPath(slotId, configForComponent == null ? void 0 : configForComponent.fields);
|
|
5910
|
+
return slotField;
|
|
5922
5911
|
};
|
|
5923
|
-
|
|
5912
|
+
|
|
5913
|
+
// lib/data/resolve-zone-constraints.ts
|
|
5914
|
+
var NO_CONSTRAINTS = {};
|
|
5915
|
+
var getZoneConstraints = (zoneCompound, config, indexes) => {
|
|
5924
5916
|
var _a;
|
|
5925
|
-
|
|
5917
|
+
if (((_a = indexes.zones[zoneCompound]) == null ? void 0 : _a.type) !== "slot") {
|
|
5918
|
+
return NO_CONSTRAINTS;
|
|
5919
|
+
}
|
|
5920
|
+
const field = getSlotField(zoneCompound, config, indexes.nodes);
|
|
5921
|
+
if ((field == null ? void 0 : field.type) !== "slot") {
|
|
5922
|
+
return NO_CONSTRAINTS;
|
|
5923
|
+
}
|
|
5924
|
+
return { allow: field.allow, disallow: field.disallow };
|
|
5926
5925
|
};
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5926
|
+
|
|
5927
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
5928
|
+
var OUTLINE_ITEM_TYPE = "outline-item";
|
|
5929
|
+
var OUTLINE_ZONE_TYPE = "outline-zone";
|
|
5930
|
+
var cached = (cache, key, compute) => {
|
|
5931
|
+
const hit = cache.get(key);
|
|
5932
|
+
if (hit !== void 0) {
|
|
5933
|
+
return hit;
|
|
5930
5934
|
}
|
|
5931
|
-
|
|
5935
|
+
const result = compute();
|
|
5936
|
+
cache.set(key, result);
|
|
5937
|
+
return result;
|
|
5932
5938
|
};
|
|
5933
|
-
var
|
|
5939
|
+
var zoneAcceptsComponent = (cache, zoneCompound, componentType, config, indexes) => cached(cache, `zone:${zoneCompound}`, () => {
|
|
5940
|
+
const targetZoneConstraints = getZoneConstraints(
|
|
5941
|
+
zoneCompound,
|
|
5942
|
+
config,
|
|
5943
|
+
indexes
|
|
5944
|
+
);
|
|
5945
|
+
return isComponentAllowed(componentType, targetZoneConstraints);
|
|
5946
|
+
});
|
|
5947
|
+
var itemAcceptsComponent = (cache, itemId, componentType, config, indexes) => cached(cache, `childZones:${itemId}`, () => {
|
|
5948
|
+
return Object.keys(indexes.zones).some(
|
|
5949
|
+
(zoneCompound) => zoneCompound.startsWith(`${itemId}:`) && zoneAcceptsComponent(
|
|
5950
|
+
cache,
|
|
5951
|
+
zoneCompound,
|
|
5952
|
+
componentType,
|
|
5953
|
+
config,
|
|
5954
|
+
indexes
|
|
5955
|
+
)
|
|
5956
|
+
);
|
|
5957
|
+
});
|
|
5958
|
+
var isSourceOrDescendantOfSource = (cache, itemId, sourceItemId, nodes) => cached(cache, `subtree:${itemId}`, () => {
|
|
5934
5959
|
var _a;
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
const { overflow, overflowY } = getComputedStyle(current);
|
|
5938
|
-
if ([overflow, overflowY].some((value) => /auto|scroll/.test(value))) {
|
|
5939
|
-
return current;
|
|
5940
|
-
}
|
|
5941
|
-
current = current.parentElement;
|
|
5960
|
+
if (itemId === sourceItemId) {
|
|
5961
|
+
return true;
|
|
5942
5962
|
}
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
childIsSelected,
|
|
5947
|
-
dataIndex,
|
|
5948
|
-
depth,
|
|
5949
|
-
isSelected,
|
|
5950
|
-
node,
|
|
5951
|
-
selectedId,
|
|
5952
|
-
selectedPathIds
|
|
5953
|
-
}, ref) {
|
|
5954
|
-
const dispatch = useAppStore((s) => s.dispatch);
|
|
5955
|
-
const zoneStore = useContext11(ZoneStoreContext);
|
|
5956
|
-
const isHovering = useContextStore(
|
|
5957
|
-
ZoneStoreContext,
|
|
5958
|
-
(s) => s.hoveringComponent === node.itemId
|
|
5963
|
+
const path = ((_a = nodes[itemId]) == null ? void 0 : _a.path) || [];
|
|
5964
|
+
return path.some(
|
|
5965
|
+
(zoneCompound) => zoneCompound.split(":")[0] === sourceItemId
|
|
5959
5966
|
);
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
const
|
|
5964
|
-
|
|
5965
|
-
|
|
5967
|
+
});
|
|
5968
|
+
var createOutlineAccept = (stores, target) => (source) => {
|
|
5969
|
+
if (source.type !== OUTLINE_ITEM_TYPE) return false;
|
|
5970
|
+
const sourceData = source.data;
|
|
5971
|
+
const cache = stores.outlineStore.getState().acceptCache;
|
|
5972
|
+
const { config, state } = stores.appStore.getState();
|
|
5973
|
+
const indexes = state.indexes;
|
|
5974
|
+
const anchorId = target.kind === "row" ? target.itemId : target.zoneCompound.split(":")[0];
|
|
5975
|
+
if (isSourceOrDescendantOfSource(
|
|
5976
|
+
cache,
|
|
5977
|
+
anchorId,
|
|
5978
|
+
sourceData.itemId,
|
|
5979
|
+
indexes.nodes
|
|
5980
|
+
)) {
|
|
5981
|
+
return false;
|
|
5982
|
+
}
|
|
5983
|
+
if (target.kind === "zone") {
|
|
5984
|
+
return zoneAcceptsComponent(
|
|
5985
|
+
cache,
|
|
5986
|
+
target.zoneCompound,
|
|
5987
|
+
sourceData.componentType,
|
|
5988
|
+
config,
|
|
5989
|
+
indexes
|
|
5990
|
+
);
|
|
5991
|
+
}
|
|
5992
|
+
return zoneAcceptsComponent(
|
|
5993
|
+
cache,
|
|
5994
|
+
target.zoneCompound,
|
|
5995
|
+
sourceData.componentType,
|
|
5996
|
+
config,
|
|
5997
|
+
indexes
|
|
5998
|
+
) || itemAcceptsComponent(
|
|
5999
|
+
cache,
|
|
6000
|
+
target.itemId,
|
|
6001
|
+
sourceData.componentType,
|
|
6002
|
+
config,
|
|
6003
|
+
indexes
|
|
6004
|
+
);
|
|
6005
|
+
};
|
|
6006
|
+
|
|
6007
|
+
// components/LayerTree/lib/store.ts
|
|
6008
|
+
init_react_import();
|
|
6009
|
+
import { createContext as createContext6, useContext as useContext11 } from "react";
|
|
6010
|
+
import { createStore as createStore6 } from "zustand";
|
|
6011
|
+
var OUTLINE_EXPAND_DELAY_MS = 600;
|
|
6012
|
+
var createOutlineDndStore = () => {
|
|
6013
|
+
let expandTimer = null;
|
|
6014
|
+
let pendingRowId = null;
|
|
6015
|
+
const cancelTimer = () => {
|
|
6016
|
+
if (expandTimer !== null) {
|
|
6017
|
+
clearTimeout(expandTimer);
|
|
6018
|
+
expandTimer = null;
|
|
6019
|
+
}
|
|
6020
|
+
pendingRowId = null;
|
|
6021
|
+
};
|
|
6022
|
+
return createStore6((set, get) => ({
|
|
6023
|
+
status: "idle",
|
|
6024
|
+
draggedRow: null,
|
|
6025
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
6026
|
+
expandCandidateId: null,
|
|
6027
|
+
indicator: null,
|
|
6028
|
+
drop: null,
|
|
6029
|
+
acceptCache: /* @__PURE__ */ new Map(),
|
|
6030
|
+
startDrag: (draggedRow) => set({
|
|
6031
|
+
status: "dragging",
|
|
6032
|
+
draggedRow,
|
|
6033
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
6034
|
+
}),
|
|
6035
|
+
setTarget: (indicator, drop) => {
|
|
6036
|
+
var _a, _b, _c, _d;
|
|
6037
|
+
const current = get();
|
|
6038
|
+
if (((_a = current.indicator) == null ? void 0 : _a.targetId) === indicator.targetId && ((_b = current.indicator) == null ? void 0 : _b.position) === indicator.position && ((_c = current.drop) == null ? void 0 : _c.zone) === drop.zone && ((_d = current.drop) == null ? void 0 : _d.index) === drop.index) {
|
|
6039
|
+
return;
|
|
6040
|
+
}
|
|
6041
|
+
set({ indicator, drop });
|
|
5966
6042
|
},
|
|
5967
|
-
|
|
6043
|
+
clearTarget: () => {
|
|
6044
|
+
if (get().indicator === null && get().drop === null) {
|
|
6045
|
+
return;
|
|
6046
|
+
}
|
|
6047
|
+
set({ indicator: null, drop: null });
|
|
6048
|
+
},
|
|
6049
|
+
scheduleExpand: (rowId, onExpand) => {
|
|
6050
|
+
if (pendingRowId === rowId || get().tempExpandedIds.has(rowId)) {
|
|
6051
|
+
return;
|
|
6052
|
+
}
|
|
6053
|
+
cancelTimer();
|
|
6054
|
+
pendingRowId = rowId;
|
|
6055
|
+
set({ expandCandidateId: rowId });
|
|
6056
|
+
expandTimer = setTimeout(() => {
|
|
6057
|
+
expandTimer = null;
|
|
6058
|
+
pendingRowId = null;
|
|
6059
|
+
set((s) => ({
|
|
6060
|
+
tempExpandedIds: new Set(s.tempExpandedIds).add(rowId),
|
|
6061
|
+
expandCandidateId: null
|
|
6062
|
+
}));
|
|
6063
|
+
onExpand();
|
|
6064
|
+
}, OUTLINE_EXPAND_DELAY_MS);
|
|
6065
|
+
},
|
|
6066
|
+
cancelPendingExpand: () => {
|
|
6067
|
+
cancelTimer();
|
|
6068
|
+
if (get().expandCandidateId !== null) {
|
|
6069
|
+
set({ expandCandidateId: null });
|
|
6070
|
+
}
|
|
6071
|
+
},
|
|
6072
|
+
endDrag: () => {
|
|
6073
|
+
cancelTimer();
|
|
6074
|
+
set({
|
|
6075
|
+
status: "dropping",
|
|
6076
|
+
indicator: null,
|
|
6077
|
+
drop: null,
|
|
6078
|
+
expandCandidateId: null
|
|
6079
|
+
});
|
|
6080
|
+
},
|
|
6081
|
+
reset: () => {
|
|
6082
|
+
cancelTimer();
|
|
6083
|
+
set({
|
|
6084
|
+
status: "idle",
|
|
6085
|
+
draggedRow: null,
|
|
6086
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
6087
|
+
expandCandidateId: null,
|
|
6088
|
+
indicator: null,
|
|
6089
|
+
drop: null,
|
|
6090
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
6091
|
+
});
|
|
6092
|
+
}
|
|
6093
|
+
}));
|
|
6094
|
+
};
|
|
6095
|
+
var OutlineDndStoreContext = createContext6(
|
|
6096
|
+
createOutlineDndStore()
|
|
6097
|
+
);
|
|
6098
|
+
var useOutlineDndStoreApi = () => {
|
|
6099
|
+
return useContext11(OutlineDndStoreContext);
|
|
6100
|
+
};
|
|
6101
|
+
var useOutlineDndStore = (selector) => {
|
|
6102
|
+
return useContextStore(OutlineDndStoreContext, selector);
|
|
6103
|
+
};
|
|
6104
|
+
|
|
6105
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
6106
|
+
var useOutlineDropZone = ({
|
|
6107
|
+
kind,
|
|
6108
|
+
zoneCompound
|
|
6109
|
+
}) => {
|
|
6110
|
+
const appStore = useAppStoreApi();
|
|
6111
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6112
|
+
const dndId = `${kind}:${zoneCompound}`;
|
|
6113
|
+
const accept = useMemo15(
|
|
6114
|
+
() => createOutlineAccept(
|
|
6115
|
+
{ appStore, outlineStore },
|
|
6116
|
+
{
|
|
6117
|
+
kind: "zone",
|
|
6118
|
+
zoneCompound
|
|
6119
|
+
}
|
|
6120
|
+
),
|
|
6121
|
+
[appStore, outlineStore, zoneCompound]
|
|
6122
|
+
);
|
|
6123
|
+
const { ref } = useDroppable3({
|
|
6124
|
+
id: dndId,
|
|
6125
|
+
type: OUTLINE_ZONE_TYPE,
|
|
6126
|
+
accept,
|
|
6127
|
+
collisionDetector: pointerIntersection,
|
|
6128
|
+
data: { kind: "zone", zoneCompound }
|
|
6129
|
+
});
|
|
6130
|
+
const isDropTarget = useOutlineDndStore(
|
|
6131
|
+
(s) => {
|
|
6132
|
+
var _a;
|
|
6133
|
+
return ((_a = s.indicator) == null ? void 0 : _a.targetId) === dndId;
|
|
6134
|
+
}
|
|
6135
|
+
);
|
|
6136
|
+
const outlineDropZoneObject = useMemo15(
|
|
6137
|
+
() => ({ isDropTarget, ref }),
|
|
6138
|
+
[isDropTarget, ref]
|
|
5968
6139
|
);
|
|
5969
|
-
|
|
6140
|
+
return outlineDropZoneObject;
|
|
6141
|
+
};
|
|
6142
|
+
var use_outline_drop_zone_default = useOutlineDropZone;
|
|
6143
|
+
|
|
6144
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
6145
|
+
init_react_import();
|
|
6146
|
+
|
|
6147
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css#css-module
|
|
6148
|
+
init_react_import();
|
|
6149
|
+
var styles_module_default14 = { "DropLine": "_DropLine_eyz3q_2", "DropLine--top": "_DropLine--top_eyz3q_12", "DropLine--bottom": "_DropLine--bottom_eyz3q_16", "DropLine--outset": "_DropLine--outset_eyz3q_20" };
|
|
6150
|
+
|
|
6151
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
6152
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
6153
|
+
var getClassName20 = get_class_name_factory_default("DropLine", styles_module_default14);
|
|
6154
|
+
var DropLine = ({
|
|
6155
|
+
edge,
|
|
6156
|
+
outset
|
|
6157
|
+
}) => /* @__PURE__ */ jsx37(
|
|
6158
|
+
"div",
|
|
6159
|
+
{
|
|
6160
|
+
className: getClassName20({
|
|
6161
|
+
top: edge === "top",
|
|
6162
|
+
bottom: edge === "bottom",
|
|
6163
|
+
outset: Boolean(outset)
|
|
6164
|
+
})
|
|
6165
|
+
}
|
|
6166
|
+
);
|
|
6167
|
+
|
|
6168
|
+
// components/LayerTree/components/layer-tree-items/index.ts
|
|
6169
|
+
init_react_import();
|
|
6170
|
+
|
|
6171
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
6172
|
+
init_react_import();
|
|
6173
|
+
|
|
6174
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
6175
|
+
init_react_import();
|
|
6176
|
+
|
|
6177
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css#css-module
|
|
6178
|
+
init_react_import();
|
|
6179
|
+
var styles_module_default15 = { "LayerTree-helper": "_LayerTree-helper_1niov_2" };
|
|
6180
|
+
|
|
6181
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
6182
|
+
import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6183
|
+
var getClassName21 = get_class_name_factory_default("LayerTree", styles_module_default15);
|
|
6184
|
+
var EmptyZonePlaceholder = ({
|
|
6185
|
+
zoneCompound
|
|
6186
|
+
}) => {
|
|
6187
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
6188
|
+
kind: "empty",
|
|
6189
|
+
zoneCompound
|
|
6190
|
+
});
|
|
6191
|
+
const noItemsMsg = useMessage("outline-empty");
|
|
5970
6192
|
return /* @__PURE__ */ jsxs11(
|
|
5971
6193
|
"li",
|
|
5972
6194
|
{
|
|
6195
|
+
className: getClassName21("helper"),
|
|
6196
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
5973
6197
|
ref,
|
|
5974
|
-
className: getClassNameLayer({
|
|
5975
|
-
childIsSelected,
|
|
5976
|
-
containsZone,
|
|
5977
|
-
isHovering,
|
|
5978
|
-
isSelected
|
|
5979
|
-
}),
|
|
5980
|
-
"data-index": dataIndex,
|
|
5981
|
-
"data-puck-layer-tree-id": node.itemId,
|
|
5982
6198
|
children: [
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
6199
|
+
noItemsMsg,
|
|
6200
|
+
isDropTarget && /* @__PURE__ */ jsx38(DropLine, { edge: "top" })
|
|
6201
|
+
]
|
|
6202
|
+
}
|
|
6203
|
+
);
|
|
6204
|
+
};
|
|
6205
|
+
|
|
6206
|
+
// components/LayerTree/components/layer/index.tsx
|
|
6207
|
+
init_react_import();
|
|
6208
|
+
import { forwardRef as forwardRef2, useCallback as useCallback16, useContext as useContext13 } from "react";
|
|
6209
|
+
|
|
6210
|
+
// components/LayerTree/lib/dnd/use-outline-row-dnd.ts
|
|
6211
|
+
init_react_import();
|
|
6212
|
+
import { useCallback as useCallback14, useMemo as useMemo16 } from "react";
|
|
6213
|
+
import { Feedback as Feedback2 } from "@dnd-kit/dom";
|
|
6214
|
+
import { useSortable as useSortable3 } from "@dnd-kit/react/sortable";
|
|
6215
|
+
var useOutlineRowDnd = ({
|
|
6216
|
+
componentType,
|
|
6217
|
+
index,
|
|
6218
|
+
itemId,
|
|
6219
|
+
zoneCompound
|
|
6220
|
+
}) => {
|
|
6221
|
+
const appStore = useAppStoreApi();
|
|
6222
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6223
|
+
const accept = useMemo16(
|
|
6224
|
+
() => createOutlineAccept(
|
|
6225
|
+
{ appStore, outlineStore },
|
|
6226
|
+
{ kind: "row", itemId, zoneCompound }
|
|
6227
|
+
),
|
|
6228
|
+
[appStore, outlineStore, itemId, zoneCompound]
|
|
6229
|
+
);
|
|
6230
|
+
const collisionDetector = useMemo16(
|
|
6231
|
+
() => createDynamicCollisionDetector("y"),
|
|
6232
|
+
[]
|
|
6233
|
+
);
|
|
6234
|
+
const { handleRef, ref, isDragSource } = useSortable3({
|
|
6235
|
+
id: itemId,
|
|
6236
|
+
index,
|
|
6237
|
+
group: zoneCompound,
|
|
6238
|
+
type: OUTLINE_ITEM_TYPE,
|
|
6239
|
+
accept,
|
|
6240
|
+
data: {
|
|
6241
|
+
kind: "row",
|
|
6242
|
+
itemId,
|
|
6243
|
+
zoneCompound,
|
|
6244
|
+
index,
|
|
6245
|
+
componentType
|
|
6246
|
+
},
|
|
6247
|
+
collisionPriority: 1,
|
|
6248
|
+
collisionDetector,
|
|
6249
|
+
// Don't animate rows while dragging or dropping
|
|
6250
|
+
transition: { duration: 0 },
|
|
6251
|
+
plugins: (defaults) => [
|
|
6252
|
+
...defaults,
|
|
6253
|
+
// The source row stays rendered in place
|
|
6254
|
+
// The drop animation is disabled for a more snappy feel
|
|
6255
|
+
Feedback2.configure({ feedback: "clone", dropAnimation: null })
|
|
6256
|
+
]
|
|
6257
|
+
});
|
|
6258
|
+
const { indicatorPosition, isExpandCandidate, isTempExpanded } = useOutlineDndStore((s) => {
|
|
6259
|
+
var _a;
|
|
6260
|
+
return {
|
|
6261
|
+
indicatorPosition: ((_a = s.indicator) == null ? void 0 : _a.targetId) === itemId ? s.indicator.position : null,
|
|
6262
|
+
isExpandCandidate: s.expandCandidateId === itemId,
|
|
6263
|
+
isTempExpanded: s.tempExpandedIds.has(itemId)
|
|
6264
|
+
};
|
|
6265
|
+
});
|
|
6266
|
+
const rowRef = useCallback14(
|
|
6267
|
+
(element) => {
|
|
6268
|
+
ref(element);
|
|
6269
|
+
handleRef(element);
|
|
6270
|
+
},
|
|
6271
|
+
[ref, handleRef]
|
|
6272
|
+
);
|
|
6273
|
+
return {
|
|
6274
|
+
rowRef,
|
|
6275
|
+
isDragSource,
|
|
6276
|
+
indicatorPosition,
|
|
6277
|
+
isExpandCandidate,
|
|
6278
|
+
isTempExpanded
|
|
6279
|
+
};
|
|
6280
|
+
};
|
|
6281
|
+
|
|
6282
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css#css-module
|
|
6283
|
+
init_react_import();
|
|
6284
|
+
var styles_module_default16 = { "Layer": "_Layer_1o110_1", "Layer-inner": "_Layer-inner_1o110_8", "Layer--isSortable": "_Layer--isSortable_1o110_18", "Layer-content": "_Layer-content_1o110_22", "Layer-clickable": "_Layer-clickable_1o110_29", "Layer-caret": "_Layer-caret_1o110_57", "Layer--containsZone": "_Layer--containsZone_1o110_68", "Layer-title": "_Layer-title_1o110_76", "Layer-name": "_Layer-name_1o110_85", "Layer-icon": "_Layer-icon_1o110_91", "Layer-zones": "_Layer-zones_1o110_101", "Layer--isExpanded": "_Layer--isExpanded_1o110_106", "Layer--isSelected": "_Layer--isSelected_1o110_115", "Layer--isExpandCandidate": "_Layer--isExpandCandidate_1o110_138", "Layer--isDragSource": "_Layer--isDragSource_1o110_143" };
|
|
6285
|
+
|
|
6286
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
6287
|
+
init_react_import();
|
|
6288
|
+
import { useCallback as useCallback15 } from "react";
|
|
6289
|
+
import { useShallow as useShallow7 } from "zustand/react/shallow";
|
|
6290
|
+
|
|
6291
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css#css-module
|
|
6292
|
+
init_react_import();
|
|
6293
|
+
var styles_module_default17 = { "LayerActions": "_LayerActions_1m5z5_2", "LayerActions--visible": "_LayerActions--visible_1m5z5_17" };
|
|
6294
|
+
|
|
6295
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
6296
|
+
import { jsx as jsx39, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6297
|
+
var getClassName22 = get_class_name_factory_default("LayerActions", styles_module_default17);
|
|
6298
|
+
var LayerActions = ({
|
|
6299
|
+
node,
|
|
6300
|
+
visible
|
|
6301
|
+
}) => {
|
|
6302
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
6303
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6304
|
+
const permissions = useAppStore(
|
|
6305
|
+
useShallow7((s) => {
|
|
6306
|
+
const item = getItem(
|
|
6307
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
6308
|
+
s.state
|
|
6309
|
+
);
|
|
6310
|
+
const itemPermissions = s.permissions.getPermissions({ item });
|
|
6311
|
+
return {
|
|
6312
|
+
delete: itemPermissions.delete,
|
|
6313
|
+
duplicate: itemPermissions.duplicate
|
|
6314
|
+
};
|
|
6315
|
+
})
|
|
6316
|
+
);
|
|
6317
|
+
const duplicateMsg = useMessage("outline-item-duplicate");
|
|
6318
|
+
const deleteMsg = useMessage("outline-item-delete");
|
|
6319
|
+
const deleteItem = useCallback15(
|
|
6320
|
+
(e) => {
|
|
6321
|
+
e.stopPropagation();
|
|
6322
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6323
|
+
return;
|
|
6324
|
+
}
|
|
6325
|
+
dispatch({
|
|
6326
|
+
type: "remove",
|
|
6327
|
+
index: node.index,
|
|
6328
|
+
zone: node.zoneCompound
|
|
6329
|
+
});
|
|
6330
|
+
},
|
|
6331
|
+
[dispatch, outlineStore, node]
|
|
6332
|
+
);
|
|
6333
|
+
const duplicateItem = useCallback15(
|
|
6334
|
+
(e) => {
|
|
6335
|
+
e.stopPropagation();
|
|
6336
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6337
|
+
return;
|
|
6338
|
+
}
|
|
6339
|
+
dispatch({
|
|
6340
|
+
type: "duplicate",
|
|
6341
|
+
sourceIndex: node.index,
|
|
6342
|
+
sourceZone: node.zoneCompound
|
|
6343
|
+
});
|
|
6344
|
+
},
|
|
6345
|
+
[dispatch, outlineStore, node.index, node.zoneCompound]
|
|
6346
|
+
);
|
|
6347
|
+
if (!permissions.delete && !permissions.duplicate) {
|
|
6348
|
+
return null;
|
|
6349
|
+
}
|
|
6350
|
+
return /* @__PURE__ */ jsxs12("div", { className: getClassName22({ visible }), children: [
|
|
6351
|
+
permissions.duplicate && /* @__PURE__ */ jsx39(IconButton, { onClick: duplicateItem, title: duplicateMsg, type: "button", children: /* @__PURE__ */ jsx39(Copy, {}) }),
|
|
6352
|
+
permissions.delete && /* @__PURE__ */ jsx39(IconButton, { onClick: deleteItem, title: deleteMsg, type: "button", children: /* @__PURE__ */ jsx39(Trash, {}) })
|
|
6353
|
+
] });
|
|
6354
|
+
};
|
|
6355
|
+
|
|
6356
|
+
// components/LayerTree/components/layer/index.tsx
|
|
6357
|
+
import { jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6358
|
+
var getClassName23 = get_class_name_factory_default("Layer", styles_module_default16);
|
|
6359
|
+
var Layer = forwardRef2(function Layer2({
|
|
6360
|
+
dataIndex,
|
|
6361
|
+
depth,
|
|
6362
|
+
isSelected,
|
|
6363
|
+
node,
|
|
6364
|
+
selectedId
|
|
6365
|
+
}, ref) {
|
|
6366
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
6367
|
+
const isExpanded = useAppStore(
|
|
6368
|
+
(s) => {
|
|
6369
|
+
var _a, _b;
|
|
6370
|
+
return (_b = (_a = s.state.ui.itemExpanded) == null ? void 0 : _a[node.itemId]) != null ? _b : false;
|
|
6371
|
+
}
|
|
6372
|
+
);
|
|
6373
|
+
const isHovering = useContextStore(
|
|
6374
|
+
ZoneStoreContext,
|
|
6375
|
+
(s) => s.hoveringComponent === node.itemId
|
|
6376
|
+
);
|
|
6377
|
+
const isDraggable = useAppStore((s) => {
|
|
6378
|
+
var _a;
|
|
6379
|
+
const item = getItem(
|
|
6380
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
6381
|
+
s.state
|
|
6382
|
+
);
|
|
6383
|
+
return (_a = s.permissions.getPermissions({ item })) == null ? void 0 : _a.drag;
|
|
6384
|
+
});
|
|
6385
|
+
const {
|
|
6386
|
+
indicatorPosition,
|
|
6387
|
+
isDragSource,
|
|
6388
|
+
isExpandCandidate,
|
|
6389
|
+
isTempExpanded,
|
|
6390
|
+
rowRef
|
|
6391
|
+
} = useOutlineRowDnd({
|
|
6392
|
+
componentType: node.componentType,
|
|
6393
|
+
index: node.index,
|
|
6394
|
+
itemId: node.itemId,
|
|
6395
|
+
zoneCompound: node.zoneCompound
|
|
6396
|
+
});
|
|
6397
|
+
const zoneStore = useContext13(ZoneStoreContext);
|
|
6398
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6399
|
+
const collapseMsg = useMessage("outline-item-collapse");
|
|
6400
|
+
const expandMsg = useMessage("outline-item-expand");
|
|
6401
|
+
const containsZone = node.childZones.length > 0;
|
|
6402
|
+
const setItemSelector = useCallback16(
|
|
6403
|
+
(itemSelector) => {
|
|
6404
|
+
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
6405
|
+
},
|
|
6406
|
+
[dispatch]
|
|
6407
|
+
);
|
|
6408
|
+
const shouldBeExpanded = isExpanded || isTempExpanded;
|
|
6409
|
+
const shouldShowIndicator = indicatorPosition !== null;
|
|
6410
|
+
const shouldShowZoneTitles = node.childZones.length !== 1;
|
|
6411
|
+
return /* @__PURE__ */ jsxs13(
|
|
6412
|
+
"li",
|
|
6413
|
+
{
|
|
6414
|
+
ref,
|
|
6415
|
+
className: getClassName23({
|
|
6416
|
+
containsZone,
|
|
6417
|
+
isDragSource,
|
|
6418
|
+
isExpandCandidate,
|
|
6419
|
+
isExpanded: shouldBeExpanded,
|
|
6420
|
+
isHovering,
|
|
6421
|
+
isSelected,
|
|
6422
|
+
isSortable: isDraggable
|
|
6423
|
+
}),
|
|
6424
|
+
"data-index": dataIndex,
|
|
6425
|
+
"data-puck-layer-tree-id": node.itemId,
|
|
6426
|
+
children: [
|
|
6427
|
+
shouldShowIndicator && /* @__PURE__ */ jsx40(
|
|
6428
|
+
DropLine,
|
|
6429
|
+
{
|
|
6430
|
+
edge: indicatorPosition === "before" ? "top" : "bottom",
|
|
6431
|
+
outset: true
|
|
6432
|
+
}
|
|
6433
|
+
),
|
|
6434
|
+
/* @__PURE__ */ jsxs13(
|
|
6435
|
+
"div",
|
|
6436
|
+
{
|
|
6437
|
+
className: getClassName23("inner"),
|
|
6438
|
+
ref: rowRef,
|
|
5999
6439
|
onMouseEnter: (e) => {
|
|
6000
6440
|
e.stopPropagation();
|
|
6441
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6442
|
+
return;
|
|
6443
|
+
}
|
|
6001
6444
|
zoneStore.setState({ hoveringComponent: node.itemId });
|
|
6002
6445
|
},
|
|
6003
6446
|
onMouseLeave: (e) => {
|
|
@@ -6005,109 +6448,167 @@ var Layer = forwardRef2(function Layer2({
|
|
|
6005
6448
|
zoneStore.setState({ hoveringComponent: null });
|
|
6006
6449
|
},
|
|
6007
6450
|
children: [
|
|
6008
|
-
|
|
6009
|
-
|
|
6451
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("caret"), children: /* @__PURE__ */ jsx40(
|
|
6452
|
+
IconButton,
|
|
6010
6453
|
{
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6454
|
+
onClick: (e) => {
|
|
6455
|
+
e.stopPropagation();
|
|
6456
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6457
|
+
return;
|
|
6458
|
+
}
|
|
6459
|
+
dispatch({
|
|
6460
|
+
type: "setUi",
|
|
6461
|
+
ui: (previous) => {
|
|
6462
|
+
var _a;
|
|
6463
|
+
const newItemExpanded = __spreadValues({}, previous.itemExpanded);
|
|
6464
|
+
if ((_a = previous.itemExpanded) == null ? void 0 : _a[node.itemId]) {
|
|
6465
|
+
delete newItemExpanded[node.itemId];
|
|
6466
|
+
} else {
|
|
6467
|
+
newItemExpanded[node.itemId] = true;
|
|
6468
|
+
}
|
|
6469
|
+
return {
|
|
6470
|
+
itemExpanded: newItemExpanded
|
|
6471
|
+
};
|
|
6472
|
+
},
|
|
6473
|
+
recordHistory: false
|
|
6474
|
+
});
|
|
6475
|
+
},
|
|
6476
|
+
title: isExpanded ? collapseMsg : expandMsg,
|
|
6477
|
+
type: "button",
|
|
6478
|
+
children: /* @__PURE__ */ jsx40(ChevronRight, {})
|
|
6014
6479
|
}
|
|
6015
|
-
),
|
|
6016
|
-
/* @__PURE__ */
|
|
6017
|
-
/* @__PURE__ */
|
|
6018
|
-
|
|
6480
|
+
) }),
|
|
6481
|
+
/* @__PURE__ */ jsxs13("div", { className: getClassName23("content"), children: [
|
|
6482
|
+
/* @__PURE__ */ jsx40(
|
|
6483
|
+
"button",
|
|
6484
|
+
{
|
|
6485
|
+
type: "button",
|
|
6486
|
+
className: getClassName23("clickable"),
|
|
6487
|
+
onClick: () => {
|
|
6488
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6489
|
+
return;
|
|
6490
|
+
}
|
|
6491
|
+
setItemSelector({
|
|
6492
|
+
index: node.index,
|
|
6493
|
+
zone: node.zoneCompound
|
|
6494
|
+
});
|
|
6495
|
+
zoneStore.getState().scrollToComponent(node.itemId);
|
|
6496
|
+
},
|
|
6497
|
+
children: /* @__PURE__ */ jsxs13("div", { className: getClassName23("title"), children: [
|
|
6498
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("icon"), children: node.componentType === "Text" || node.componentType === "Heading" ? (
|
|
6499
|
+
// Sized in CSS via --puck-outline-icon-size
|
|
6500
|
+
/* @__PURE__ */ jsx40(Type, {})
|
|
6501
|
+
) : /* @__PURE__ */ jsx40(LayoutGrid, {}) }),
|
|
6502
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("name"), children: node.label })
|
|
6503
|
+
] })
|
|
6504
|
+
}
|
|
6505
|
+
),
|
|
6506
|
+
/* @__PURE__ */ jsx40(LayerActions, { node, visible: isHovering && !isDragSource })
|
|
6019
6507
|
] })
|
|
6020
6508
|
]
|
|
6021
6509
|
}
|
|
6022
|
-
)
|
|
6023
|
-
containsZone &&
|
|
6024
|
-
|
|
6510
|
+
),
|
|
6511
|
+
containsZone && shouldBeExpanded && node.childZones.map((childZone) => /* @__PURE__ */ jsx40("div", { className: getClassName23("zones"), children: /* @__PURE__ */ jsx40(
|
|
6512
|
+
LayerTreeZone,
|
|
6025
6513
|
{
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
selectedId,
|
|
6032
|
-
selectedPathIds,
|
|
6033
|
-
tree: childZone
|
|
6034
|
-
}
|
|
6035
|
-
)
|
|
6036
|
-
},
|
|
6037
|
-
childZone.zoneCompound
|
|
6038
|
-
))
|
|
6514
|
+
depth: shouldShowZoneTitles ? depth + 1 : depth,
|
|
6515
|
+
selectedId,
|
|
6516
|
+
tree: shouldShowZoneTitles ? childZone : __spreadProps(__spreadValues({}, childZone), { label: void 0 })
|
|
6517
|
+
}
|
|
6518
|
+
) }, childZone.zoneCompound))
|
|
6039
6519
|
]
|
|
6040
6520
|
}
|
|
6041
6521
|
);
|
|
6042
6522
|
});
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
tree.label && /* @__PURE__ */ jsxs11("div", { className: getClassName20("zoneTitle"), children: [
|
|
6052
|
-
/* @__PURE__ */ jsx37("div", { className: getClassName20("zoneIcon"), children: /* @__PURE__ */ jsx37(Layers, { size: "16" }) }),
|
|
6053
|
-
tree.label
|
|
6054
|
-
] }),
|
|
6055
|
-
shouldVirtualize ? /* @__PURE__ */ jsx37(
|
|
6056
|
-
VirtualizedLayerTreeItems,
|
|
6057
|
-
{
|
|
6058
|
-
depth,
|
|
6059
|
-
selectedId,
|
|
6060
|
-
selectedPathIds,
|
|
6061
|
-
tree
|
|
6062
|
-
}
|
|
6063
|
-
) : /* @__PURE__ */ jsx37(
|
|
6064
|
-
StaticLayerTreeItems,
|
|
6065
|
-
{
|
|
6066
|
-
depth,
|
|
6067
|
-
selectedId,
|
|
6068
|
-
selectedPathIds,
|
|
6069
|
-
tree
|
|
6070
|
-
}
|
|
6071
|
-
)
|
|
6072
|
-
] });
|
|
6073
|
-
};
|
|
6523
|
+
|
|
6524
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css#css-module
|
|
6525
|
+
init_react_import();
|
|
6526
|
+
var styles_module_default18 = { "LayerTree": "_LayerTree_o5tyt_1", "LayerTree--nested": "_LayerTree--nested_o5tyt_12" };
|
|
6527
|
+
|
|
6528
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
6529
|
+
import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6530
|
+
var getClassName24 = get_class_name_factory_default("LayerTree", styles_module_default18);
|
|
6074
6531
|
var StaticLayerTreeItems = ({
|
|
6075
6532
|
depth,
|
|
6076
6533
|
selectedId,
|
|
6077
|
-
selectedPathIds,
|
|
6078
6534
|
tree
|
|
6079
6535
|
}) => {
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
tree.items.
|
|
6083
|
-
tree.items.map((node) => /* @__PURE__ */ jsx37(
|
|
6536
|
+
return /* @__PURE__ */ jsxs14("ul", { className: getClassName24({ nested: depth > 0 }), children: [
|
|
6537
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx41(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
6538
|
+
tree.items.map((node) => /* @__PURE__ */ jsx41(
|
|
6084
6539
|
Layer,
|
|
6085
6540
|
{
|
|
6086
|
-
childIsSelected: selectedPathIds.has(node.itemId),
|
|
6087
6541
|
depth,
|
|
6088
6542
|
isSelected: selectedId === node.itemId,
|
|
6089
6543
|
node,
|
|
6090
|
-
selectedId
|
|
6091
|
-
selectedPathIds
|
|
6544
|
+
selectedId
|
|
6092
6545
|
},
|
|
6093
6546
|
node.itemId
|
|
6094
6547
|
))
|
|
6095
6548
|
] });
|
|
6096
6549
|
};
|
|
6550
|
+
|
|
6551
|
+
// components/LayerTree/components/layer-tree-items/virtualized-layer-tree-items.tsx
|
|
6552
|
+
init_react_import();
|
|
6553
|
+
import { defaultRangeExtractor as defaultRangeExtractor2, useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
6554
|
+
import { useCallback as useCallback17, useRef as useRef10 } from "react";
|
|
6555
|
+
import { jsx as jsx42, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6556
|
+
var getClassName25 = get_class_name_factory_default("LayerTree", styles_module_default18);
|
|
6557
|
+
var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
6558
|
+
var LAYER_TREE_VIRTUALIZATION_OVERSCAN = 8;
|
|
6559
|
+
var measuredRowHeights = /* @__PURE__ */ new Map();
|
|
6560
|
+
var getEstimatedRowHeight = (itemId) => {
|
|
6561
|
+
var _a;
|
|
6562
|
+
return (_a = measuredRowHeights.get(itemId)) != null ? _a : DEFAULT_LAYER_ROW_HEIGHT;
|
|
6563
|
+
};
|
|
6564
|
+
var cacheMeasuredRowHeight = (itemId, height) => {
|
|
6565
|
+
if (height <= 0) {
|
|
6566
|
+
return;
|
|
6567
|
+
}
|
|
6568
|
+
measuredRowHeights.set(itemId, height);
|
|
6569
|
+
};
|
|
6570
|
+
var getFirstScrollAncestor = (el) => {
|
|
6571
|
+
var _a;
|
|
6572
|
+
let current = (_a = el == null ? void 0 : el.parentElement) != null ? _a : null;
|
|
6573
|
+
while (current) {
|
|
6574
|
+
const { overflow, overflowY } = getComputedStyle(current);
|
|
6575
|
+
if ([overflow, overflowY].some((value) => /auto|scroll/.test(value))) {
|
|
6576
|
+
return current;
|
|
6577
|
+
}
|
|
6578
|
+
current = current.parentElement;
|
|
6579
|
+
}
|
|
6580
|
+
return null;
|
|
6581
|
+
};
|
|
6097
6582
|
var VirtualizedLayerTreeItems = ({
|
|
6098
6583
|
depth,
|
|
6099
6584
|
selectedId,
|
|
6100
|
-
selectedPathIds,
|
|
6101
6585
|
tree
|
|
6102
6586
|
}) => {
|
|
6103
6587
|
const listRef = useRef10(null);
|
|
6104
|
-
const
|
|
6588
|
+
const pinnedIndex = useOutlineDndStore(
|
|
6589
|
+
(s) => {
|
|
6590
|
+
var _a;
|
|
6591
|
+
return ((_a = s.draggedRow) == null ? void 0 : _a.zoneCompound) === tree.zoneCompound ? s.draggedRow.index : null;
|
|
6592
|
+
}
|
|
6593
|
+
);
|
|
6594
|
+
const rangeExtractor = useCallback17(
|
|
6595
|
+
(range) => {
|
|
6596
|
+
const indexes = defaultRangeExtractor2(range);
|
|
6597
|
+
if (pinnedIndex !== null && !indexes.includes(pinnedIndex)) {
|
|
6598
|
+
indexes.push(pinnedIndex);
|
|
6599
|
+
indexes.sort((a, b) => a - b);
|
|
6600
|
+
}
|
|
6601
|
+
return indexes;
|
|
6602
|
+
},
|
|
6603
|
+
[pinnedIndex]
|
|
6604
|
+
);
|
|
6105
6605
|
const virtualizer = useVirtualizer2({
|
|
6106
6606
|
count: tree.items.length,
|
|
6107
6607
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
6108
6608
|
getItemKey: (index) => tree.items[index].itemId,
|
|
6109
|
-
getScrollElement: () =>
|
|
6609
|
+
getScrollElement: () => getFirstScrollAncestor(listRef.current),
|
|
6110
6610
|
overscan: LAYER_TREE_VIRTUALIZATION_OVERSCAN,
|
|
6611
|
+
rangeExtractor,
|
|
6111
6612
|
measureElement: (element) => {
|
|
6112
6613
|
const height = Math.ceil(element.getBoundingClientRect().height);
|
|
6113
6614
|
const itemId = element.dataset.puckLayerTreeId;
|
|
@@ -6127,7 +6628,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6127
6628
|
const gapSize = Math.max(virtualItem.start - previousEnd, 0);
|
|
6128
6629
|
if (gapSize > 0) {
|
|
6129
6630
|
renderedItems.push(
|
|
6130
|
-
/* @__PURE__ */
|
|
6631
|
+
/* @__PURE__ */ jsx42(
|
|
6131
6632
|
"li",
|
|
6132
6633
|
{
|
|
6133
6634
|
"aria-hidden": "true",
|
|
@@ -6138,17 +6639,15 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6138
6639
|
);
|
|
6139
6640
|
}
|
|
6140
6641
|
renderedItems.push(
|
|
6141
|
-
/* @__PURE__ */
|
|
6642
|
+
/* @__PURE__ */ jsx42(
|
|
6142
6643
|
Layer,
|
|
6143
6644
|
{
|
|
6144
|
-
childIsSelected: selectedPathIds.has(node.itemId),
|
|
6145
6645
|
dataIndex: virtualItem.index,
|
|
6146
6646
|
depth,
|
|
6147
6647
|
isSelected: selectedId === node.itemId,
|
|
6148
6648
|
node,
|
|
6149
6649
|
ref: virtualizer.measureElement,
|
|
6150
|
-
selectedId
|
|
6151
|
-
selectedPathIds
|
|
6650
|
+
selectedId
|
|
6152
6651
|
},
|
|
6153
6652
|
node.itemId
|
|
6154
6653
|
)
|
|
@@ -6159,7 +6658,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6159
6658
|
const trailingGap = Math.max(totalSize - previousEnd, 0);
|
|
6160
6659
|
if (trailingGap > 0) {
|
|
6161
6660
|
renderedItems.push(
|
|
6162
|
-
/* @__PURE__ */
|
|
6661
|
+
/* @__PURE__ */ jsx42(
|
|
6163
6662
|
"li",
|
|
6164
6663
|
{
|
|
6165
6664
|
"aria-hidden": "true",
|
|
@@ -6169,42 +6668,480 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6169
6668
|
)
|
|
6170
6669
|
);
|
|
6171
6670
|
}
|
|
6172
|
-
return /* @__PURE__ */
|
|
6173
|
-
tree.items.length === 0 && /* @__PURE__ */
|
|
6671
|
+
return /* @__PURE__ */ jsxs15("ul", { className: getClassName25({ nested: depth > 0 }), ref: listRef, children: [
|
|
6672
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx42(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
6174
6673
|
renderedItems
|
|
6175
6674
|
] });
|
|
6176
6675
|
};
|
|
6676
|
+
|
|
6677
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css#css-module
|
|
6678
|
+
init_react_import();
|
|
6679
|
+
var styles_module_default19 = { "LayerTree-zoneTitle": "_LayerTree-zoneTitle_fvhlh_2", "LayerTree-zoneIcon": "_LayerTree-zoneIcon_fvhlh_19" };
|
|
6680
|
+
|
|
6681
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
6682
|
+
import { Fragment as Fragment10, jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6683
|
+
var getClassName26 = get_class_name_factory_default("LayerTree", styles_module_default19);
|
|
6684
|
+
var MIN_VIRTUALIZED_LAYER_COUNT = 25;
|
|
6685
|
+
var ZoneLabel = ({
|
|
6686
|
+
label,
|
|
6687
|
+
zoneCompound
|
|
6688
|
+
}) => {
|
|
6689
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
6690
|
+
kind: "label",
|
|
6691
|
+
zoneCompound
|
|
6692
|
+
});
|
|
6693
|
+
return /* @__PURE__ */ jsxs16(
|
|
6694
|
+
"div",
|
|
6695
|
+
{
|
|
6696
|
+
className: getClassName26("zoneTitle"),
|
|
6697
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
6698
|
+
ref,
|
|
6699
|
+
children: [
|
|
6700
|
+
/* @__PURE__ */ jsx43("div", { className: getClassName26("zoneIcon"), children: /* @__PURE__ */ jsx43(Layers, {}) }),
|
|
6701
|
+
label,
|
|
6702
|
+
isDropTarget && /* @__PURE__ */ jsx43(DropLine, { edge: "bottom" })
|
|
6703
|
+
]
|
|
6704
|
+
}
|
|
6705
|
+
);
|
|
6706
|
+
};
|
|
6707
|
+
var LayerTreeZone = ({
|
|
6708
|
+
depth,
|
|
6709
|
+
selectedId,
|
|
6710
|
+
tree
|
|
6711
|
+
}) => {
|
|
6712
|
+
const shouldVirtualize = depth === 0 && tree.items.length >= MIN_VIRTUALIZED_LAYER_COUNT;
|
|
6713
|
+
return /* @__PURE__ */ jsxs16(Fragment10, { children: [
|
|
6714
|
+
tree.label && /* @__PURE__ */ jsx43(ZoneLabel, { label: tree.label, zoneCompound: tree.zoneCompound }),
|
|
6715
|
+
shouldVirtualize ? /* @__PURE__ */ jsx43(
|
|
6716
|
+
VirtualizedLayerTreeItems,
|
|
6717
|
+
{
|
|
6718
|
+
depth,
|
|
6719
|
+
selectedId,
|
|
6720
|
+
tree
|
|
6721
|
+
}
|
|
6722
|
+
) : /* @__PURE__ */ jsx43(
|
|
6723
|
+
StaticLayerTreeItems,
|
|
6724
|
+
{
|
|
6725
|
+
depth,
|
|
6726
|
+
selectedId,
|
|
6727
|
+
tree
|
|
6728
|
+
}
|
|
6729
|
+
)
|
|
6730
|
+
] });
|
|
6731
|
+
};
|
|
6732
|
+
|
|
6733
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
6734
|
+
init_react_import();
|
|
6735
|
+
import { PointerActivationConstraints as PointerActivationConstraints3 } from "@dnd-kit/dom";
|
|
6736
|
+
import { DragDropProvider as DragDropProvider3 } from "@dnd-kit/react";
|
|
6737
|
+
import { useContext as useContext14, useMemo as useMemo17, useState as useState18 } from "react";
|
|
6738
|
+
|
|
6739
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
6740
|
+
init_react_import();
|
|
6741
|
+
import { effect as effect2 } from "@dnd-kit/state";
|
|
6742
|
+
|
|
6743
|
+
// lib/data/component-has-slots.ts
|
|
6744
|
+
init_react_import();
|
|
6745
|
+
function componentDataHasSlots(componentId, indexes) {
|
|
6746
|
+
return Object.keys(indexes).some(
|
|
6747
|
+
(zoneCompound) => zoneCompound.startsWith(`${componentId}:`)
|
|
6748
|
+
);
|
|
6749
|
+
}
|
|
6750
|
+
|
|
6751
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
6752
|
+
var SCROLL_SETTLE_FRAMES = 2;
|
|
6753
|
+
var SCROLL_SETTLE_MAX_FRAMES = 60;
|
|
6754
|
+
var scrollToComponentWhenSettled = (id, scrollToComponent) => {
|
|
6755
|
+
let lastTop;
|
|
6756
|
+
let stableFrames = 0;
|
|
6757
|
+
let totalFrames = 0;
|
|
6758
|
+
const check = () => {
|
|
6759
|
+
var _a;
|
|
6760
|
+
const el = (_a = getFrame()) == null ? void 0 : _a.querySelector(`[data-puck-component="${id}"]`);
|
|
6761
|
+
const top = el ? el.getBoundingClientRect().top : null;
|
|
6762
|
+
stableFrames = top === lastTop ? stableFrames + 1 : 0;
|
|
6763
|
+
lastTop = top;
|
|
6764
|
+
totalFrames += 1;
|
|
6765
|
+
if (stableFrames >= SCROLL_SETTLE_FRAMES || totalFrames >= SCROLL_SETTLE_MAX_FRAMES) {
|
|
6766
|
+
scrollToComponent(id);
|
|
6767
|
+
return;
|
|
6768
|
+
}
|
|
6769
|
+
requestAnimationFrame(check);
|
|
6770
|
+
};
|
|
6771
|
+
requestAnimationFrame(check);
|
|
6772
|
+
};
|
|
6773
|
+
var setPreviewFence = (enabled) => {
|
|
6774
|
+
if (typeof document === "undefined") return;
|
|
6775
|
+
const frameEl = document.getElementById("preview-frame");
|
|
6776
|
+
if (enabled) {
|
|
6777
|
+
frameEl == null ? void 0 : frameEl.setAttribute("data-puck-outline-dragging", "true");
|
|
6778
|
+
} else {
|
|
6779
|
+
frameEl == null ? void 0 : frameEl.removeAttribute("data-puck-outline-dragging");
|
|
6780
|
+
}
|
|
6781
|
+
};
|
|
6782
|
+
var onOutlineBeforeDragStart = (event, ctx) => {
|
|
6783
|
+
const source = event.operation.source;
|
|
6784
|
+
const data = source == null ? void 0 : source.data;
|
|
6785
|
+
if (!source || !data) return;
|
|
6786
|
+
const appState = ctx.appStore.getState();
|
|
6787
|
+
const item = getItem(
|
|
6788
|
+
{ zone: data.zoneCompound, index: data.index },
|
|
6789
|
+
appState.state
|
|
6790
|
+
);
|
|
6791
|
+
if (!item || !appState.permissions.getPermissions({ item }).drag) {
|
|
6792
|
+
event.preventDefault();
|
|
6793
|
+
return;
|
|
6794
|
+
}
|
|
6795
|
+
ctx.outlineDndStore.getState().startDrag({
|
|
6796
|
+
itemId: data.itemId,
|
|
6797
|
+
zoneCompound: data.zoneCompound,
|
|
6798
|
+
index: data.index,
|
|
6799
|
+
componentType: data.componentType
|
|
6800
|
+
});
|
|
6801
|
+
setPreviewFence(true);
|
|
6802
|
+
appState.dispatch({
|
|
6803
|
+
type: "setUi",
|
|
6804
|
+
ui: { isDragging: true },
|
|
6805
|
+
recordHistory: false
|
|
6806
|
+
});
|
|
6807
|
+
};
|
|
6808
|
+
var onOutlineDragMove = (event, manager, ctx) => {
|
|
6809
|
+
var _a, _b;
|
|
6810
|
+
const outlineStore = ctx.outlineDndStore.getState();
|
|
6811
|
+
const dragged = outlineStore.draggedRow;
|
|
6812
|
+
if (!dragged) return;
|
|
6813
|
+
const target = event.operation.target;
|
|
6814
|
+
if (!target) {
|
|
6815
|
+
outlineStore.cancelPendingExpand();
|
|
6816
|
+
outlineStore.clearTarget();
|
|
6817
|
+
return;
|
|
6818
|
+
}
|
|
6819
|
+
const targetData = target.data;
|
|
6820
|
+
if (targetData.kind === "zone") {
|
|
6821
|
+
outlineStore.cancelPendingExpand();
|
|
6822
|
+
outlineStore.setTarget(
|
|
6823
|
+
{ targetId: target.id.toString(), position: "inside" },
|
|
6824
|
+
{ zone: targetData.zoneCompound, index: 0 }
|
|
6825
|
+
);
|
|
6826
|
+
return;
|
|
6827
|
+
}
|
|
6828
|
+
const { config, state } = ctx.appStore.getState();
|
|
6829
|
+
const indexes = state.indexes;
|
|
6830
|
+
const cache = outlineStore.acceptCache;
|
|
6831
|
+
if (zoneAcceptsComponent(
|
|
6832
|
+
cache,
|
|
6833
|
+
targetData.zoneCompound,
|
|
6834
|
+
dragged.componentType,
|
|
6835
|
+
config,
|
|
6836
|
+
indexes
|
|
6837
|
+
)) {
|
|
6838
|
+
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
6839
|
+
const position = getCollisionPosition(collisionData == null ? void 0 : collisionData.direction);
|
|
6840
|
+
outlineStore.setTarget(
|
|
6841
|
+
{ targetId: target.id.toString(), position },
|
|
6842
|
+
{
|
|
6843
|
+
zone: targetData.zoneCompound,
|
|
6844
|
+
index: getInsertIndex({
|
|
6845
|
+
position,
|
|
6846
|
+
sourceIndex: dragged.index,
|
|
6847
|
+
targetIndex: targetData.index,
|
|
6848
|
+
isSameZone: targetData.zoneCompound === dragged.zoneCompound
|
|
6849
|
+
})
|
|
6850
|
+
}
|
|
6851
|
+
);
|
|
6852
|
+
} else {
|
|
6853
|
+
outlineStore.clearTarget();
|
|
6854
|
+
}
|
|
6855
|
+
const isCurrentlyExpanded = Boolean((_b = state.ui.itemExpanded) == null ? void 0 : _b[targetData.itemId]) || outlineStore.tempExpandedIds.has(targetData.itemId);
|
|
6856
|
+
const isExpandable = componentDataHasSlots(targetData.itemId, indexes.zones);
|
|
6857
|
+
if (!isCurrentlyExpanded && isExpandable) {
|
|
6858
|
+
outlineStore.scheduleExpand(targetData.itemId, () => {
|
|
6859
|
+
requestAnimationFrame(() => manager.collisionObserver.forceUpdate(true));
|
|
6860
|
+
});
|
|
6861
|
+
} else {
|
|
6862
|
+
outlineStore.cancelPendingExpand();
|
|
6863
|
+
}
|
|
6864
|
+
};
|
|
6865
|
+
var onOutlineDragEnd = (event, ctx) => {
|
|
6866
|
+
const { source } = event.operation;
|
|
6867
|
+
const outlineDnDState = ctx.outlineDndStore.getState();
|
|
6868
|
+
const dragged = outlineDnDState.draggedRow;
|
|
6869
|
+
const drop = event.canceled ? null : outlineDnDState.drop;
|
|
6870
|
+
const dispatch = ctx.appStore.getState().dispatch;
|
|
6871
|
+
setPreviewFence(false);
|
|
6872
|
+
if (dragged && drop) {
|
|
6873
|
+
moveComponent(
|
|
6874
|
+
dragged.itemId,
|
|
6875
|
+
{ zone: dragged.zoneCompound, index: dragged.index },
|
|
6876
|
+
{ zone: drop.zone, index: drop.index },
|
|
6877
|
+
ctx.appStore
|
|
6878
|
+
);
|
|
6879
|
+
const moved = drop.zone !== dragged.zoneCompound || drop.index !== dragged.index;
|
|
6880
|
+
dispatch({
|
|
6881
|
+
type: "setUi",
|
|
6882
|
+
ui: {
|
|
6883
|
+
itemSelector: { zone: drop.zone, index: drop.index },
|
|
6884
|
+
isDragging: false
|
|
6885
|
+
},
|
|
6886
|
+
recordHistory: moved
|
|
6887
|
+
});
|
|
6888
|
+
scrollToComponentWhenSettled(dragged.itemId, ctx.scrollToComponent);
|
|
6889
|
+
} else {
|
|
6890
|
+
dispatch({
|
|
6891
|
+
type: "setUi",
|
|
6892
|
+
ui: { isDragging: false },
|
|
6893
|
+
recordHistory: false
|
|
6894
|
+
});
|
|
6895
|
+
}
|
|
6896
|
+
outlineDnDState.endDrag();
|
|
6897
|
+
const reset = () => ctx.outlineDndStore.getState().reset();
|
|
6898
|
+
if (!source || source.status === "idle") {
|
|
6899
|
+
reset();
|
|
6900
|
+
} else {
|
|
6901
|
+
const dispose = effect2(() => {
|
|
6902
|
+
if (source.status === "idle") {
|
|
6903
|
+
reset();
|
|
6904
|
+
dispose == null ? void 0 : dispose();
|
|
6905
|
+
}
|
|
6906
|
+
});
|
|
6907
|
+
}
|
|
6908
|
+
};
|
|
6909
|
+
|
|
6910
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
6911
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
6912
|
+
var NO_SENSORS = [];
|
|
6913
|
+
var OutlineDndProvider = ({ children }) => {
|
|
6914
|
+
const appStore = useAppStoreApi();
|
|
6915
|
+
const zoneStore = useContext14(ZoneStoreContext);
|
|
6916
|
+
const [outlineDndStore] = useState18(() => createOutlineDndStore());
|
|
6917
|
+
const disableOutlineDrag = useAppStore(
|
|
6918
|
+
(s) => {
|
|
6919
|
+
var _a, _b;
|
|
6920
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
6921
|
+
}
|
|
6922
|
+
);
|
|
6923
|
+
const sensors = useSensors({
|
|
6924
|
+
mouse: [new PointerActivationConstraints3.Distance({ value: 5 })]
|
|
6925
|
+
});
|
|
6926
|
+
const dragContext = useMemo17(
|
|
6927
|
+
() => ({
|
|
6928
|
+
outlineDndStore,
|
|
6929
|
+
appStore,
|
|
6930
|
+
scrollToComponent: (id) => zoneStore.getState().scrollToComponent(id)
|
|
6931
|
+
}),
|
|
6932
|
+
[outlineDndStore, appStore, zoneStore]
|
|
6933
|
+
);
|
|
6934
|
+
return /* @__PURE__ */ jsx44(OutlineDndStoreContext.Provider, { value: outlineDndStore, children: /* @__PURE__ */ jsx44(
|
|
6935
|
+
DragDropProvider3,
|
|
6936
|
+
{
|
|
6937
|
+
sensors: disableOutlineDrag ? NO_SENSORS : sensors,
|
|
6938
|
+
onBeforeDragStart: (event) => {
|
|
6939
|
+
onOutlineBeforeDragStart(event, dragContext);
|
|
6940
|
+
},
|
|
6941
|
+
onDragOver: (event, manager) => {
|
|
6942
|
+
event.preventDefault();
|
|
6943
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
6944
|
+
},
|
|
6945
|
+
onDragMove: (event, manager) => {
|
|
6946
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
6947
|
+
},
|
|
6948
|
+
onDragEnd: (event) => {
|
|
6949
|
+
onOutlineDragEnd(event, dragContext);
|
|
6950
|
+
},
|
|
6951
|
+
children
|
|
6952
|
+
}
|
|
6953
|
+
) });
|
|
6954
|
+
};
|
|
6955
|
+
|
|
6956
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
|
6957
|
+
init_react_import();
|
|
6958
|
+
var styles_module_default20 = { "LayerTreeRoot": "_LayerTreeRoot_kxnd1_1" };
|
|
6959
|
+
|
|
6960
|
+
// components/LayerTree/lib/build-layer-tree.ts
|
|
6961
|
+
init_react_import();
|
|
6962
|
+
var getZonesByParent = (zones) => {
|
|
6963
|
+
const result = {};
|
|
6964
|
+
Object.keys(zones).forEach((zone) => {
|
|
6965
|
+
const [parentId] = zone.split(":");
|
|
6966
|
+
if (!parentId) return;
|
|
6967
|
+
if (!result[parentId]) result[parentId] = [];
|
|
6968
|
+
result[parentId].push(zone);
|
|
6969
|
+
});
|
|
6970
|
+
return result;
|
|
6971
|
+
};
|
|
6972
|
+
var getZoneLabel = (zoneCompound, nodes, config, label) => {
|
|
6973
|
+
var _a, _b;
|
|
6974
|
+
if (label !== void 0) {
|
|
6975
|
+
return label;
|
|
6976
|
+
}
|
|
6977
|
+
const [, slotId] = zoneCompound.split(":");
|
|
6978
|
+
if (!slotId) {
|
|
6979
|
+
return;
|
|
6980
|
+
}
|
|
6981
|
+
return (_b = (_a = getSlotField(zoneCompound, config, nodes)) == null ? void 0 : _a.label) != null ? _b : slotId;
|
|
6982
|
+
};
|
|
6983
|
+
var buildLayerNode = ({
|
|
6984
|
+
config,
|
|
6985
|
+
itemId,
|
|
6986
|
+
index,
|
|
6987
|
+
nodes,
|
|
6988
|
+
zoneCompound,
|
|
6989
|
+
zones,
|
|
6990
|
+
zonesByParent,
|
|
6991
|
+
componentFallbackLabel
|
|
6992
|
+
}) => {
|
|
6993
|
+
var _a, _b, _c, _d;
|
|
6994
|
+
const nodeData = nodes[itemId];
|
|
6995
|
+
const componentType = (_b = (_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) != null ? _b : componentFallbackLabel;
|
|
6996
|
+
const label = (_d = (_c = config.components[componentType]) == null ? void 0 : _c.label) != null ? _d : componentType;
|
|
6997
|
+
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
6998
|
+
return {
|
|
6999
|
+
childZones: childZoneCompounds.map(
|
|
7000
|
+
(childZoneCompound) => buildLayerTree({
|
|
7001
|
+
config,
|
|
7002
|
+
nodes,
|
|
7003
|
+
zoneCompound: childZoneCompound,
|
|
7004
|
+
zones,
|
|
7005
|
+
zonesByParent
|
|
7006
|
+
})
|
|
7007
|
+
),
|
|
7008
|
+
componentType,
|
|
7009
|
+
index,
|
|
7010
|
+
itemId,
|
|
7011
|
+
label,
|
|
7012
|
+
zoneCompound
|
|
7013
|
+
};
|
|
7014
|
+
};
|
|
7015
|
+
var buildLayerTree = ({
|
|
7016
|
+
config,
|
|
7017
|
+
label,
|
|
7018
|
+
nodes,
|
|
7019
|
+
zoneCompound,
|
|
7020
|
+
zones,
|
|
7021
|
+
zonesByParent = getZonesByParent(zones),
|
|
7022
|
+
componentFallbackLabel
|
|
7023
|
+
}) => {
|
|
7024
|
+
var _a, _b;
|
|
7025
|
+
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
7026
|
+
return {
|
|
7027
|
+
items: contentIds.map(
|
|
7028
|
+
(itemId, index) => buildLayerNode({
|
|
7029
|
+
config,
|
|
7030
|
+
itemId,
|
|
7031
|
+
index,
|
|
7032
|
+
nodes,
|
|
7033
|
+
zoneCompound,
|
|
7034
|
+
zones,
|
|
7035
|
+
zonesByParent
|
|
7036
|
+
})
|
|
7037
|
+
),
|
|
7038
|
+
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
7039
|
+
zoneCompound
|
|
7040
|
+
};
|
|
7041
|
+
};
|
|
7042
|
+
|
|
7043
|
+
// components/LayerTree/index.tsx
|
|
7044
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
7045
|
+
var getClassNameDragRoot = get_class_name_factory_default("LayerTreeRoot", styles_module_default20);
|
|
6177
7046
|
var LayerTree = ({
|
|
6178
7047
|
selectedId,
|
|
6179
|
-
selectedPathIds,
|
|
6180
7048
|
trees
|
|
6181
7049
|
}) => {
|
|
6182
|
-
|
|
6183
|
-
|
|
7050
|
+
const disableOutlineDrag = useAppStore(
|
|
7051
|
+
(s) => {
|
|
7052
|
+
var _a, _b;
|
|
7053
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
7054
|
+
}
|
|
7055
|
+
);
|
|
7056
|
+
const hasItems = trees.length > 0 && trees[0].items.length > 0;
|
|
7057
|
+
return /* @__PURE__ */ jsx45(OutlineDndProvider, { children: /* @__PURE__ */ jsx45(
|
|
7058
|
+
"div",
|
|
6184
7059
|
{
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
7060
|
+
className: getClassNameDragRoot(),
|
|
7061
|
+
"data-puck-dnd-disabled": disableOutlineDrag || void 0,
|
|
7062
|
+
children: hasItems && trees.map((tree) => /* @__PURE__ */ jsx45(
|
|
7063
|
+
LayerTreeZone,
|
|
7064
|
+
{
|
|
7065
|
+
depth: 0,
|
|
7066
|
+
selectedId,
|
|
7067
|
+
tree
|
|
7068
|
+
},
|
|
7069
|
+
tree.zoneCompound
|
|
7070
|
+
))
|
|
7071
|
+
}
|
|
7072
|
+
) });
|
|
6192
7073
|
};
|
|
6193
7074
|
|
|
6194
|
-
// components/Puck/components/Outline/index.tsx
|
|
6195
|
-
|
|
7075
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
7076
|
+
init_react_import();
|
|
6196
7077
|
|
|
6197
|
-
// lib/
|
|
7078
|
+
// lib/merge-class-names.ts
|
|
6198
7079
|
init_react_import();
|
|
6199
|
-
var
|
|
6200
|
-
|
|
6201
|
-
|
|
7080
|
+
var mergeClassNames = (...classNames) => [...classNames].filter(Boolean).join(" ");
|
|
7081
|
+
var merge_class_names_default = mergeClassNames;
|
|
7082
|
+
|
|
7083
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css#css-module
|
|
7084
|
+
init_react_import();
|
|
7085
|
+
var styles_module_default21 = { "CollapseAll": "_CollapseAll_1r4cy_1", "CollapseAll-icon": "_CollapseAll-icon_1r4cy_5", "CollapseAll--visible": "_CollapseAll--visible_1r4cy_10" };
|
|
7086
|
+
|
|
7087
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
7088
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
7089
|
+
var getClassName27 = get_class_name_factory_default("CollapseAll", styles_module_default21);
|
|
7090
|
+
function CollapseAll({ className }) {
|
|
7091
|
+
const hasExpandedItems = useAppStore(
|
|
7092
|
+
(s) => {
|
|
7093
|
+
var _a;
|
|
7094
|
+
return Object.keys((_a = s.state.ui.itemExpanded) != null ? _a : {}).length > 0;
|
|
7095
|
+
}
|
|
7096
|
+
);
|
|
7097
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
7098
|
+
const collapseAllMsg = useMessage("outline-header-collapseall");
|
|
7099
|
+
const collapseAll = () => {
|
|
7100
|
+
dispatch({ type: "setUi", ui: { itemExpanded: {} } });
|
|
7101
|
+
};
|
|
7102
|
+
return /* @__PURE__ */ jsx46(
|
|
7103
|
+
"div",
|
|
7104
|
+
{
|
|
7105
|
+
className: merge_class_names_default(
|
|
7106
|
+
getClassName27({ visible: hasExpandedItems }),
|
|
7107
|
+
className
|
|
7108
|
+
),
|
|
7109
|
+
children: /* @__PURE__ */ jsx46(IconButton, { title: collapseAllMsg, onClick: collapseAll, children: /* @__PURE__ */ jsx46(ChevronsDownUp, { className: getClassName27("icon") }) })
|
|
7110
|
+
}
|
|
6202
7111
|
);
|
|
7112
|
+
}
|
|
7113
|
+
var collapse_all_default = CollapseAll;
|
|
7114
|
+
|
|
7115
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
7116
|
+
init_react_import();
|
|
7117
|
+
|
|
7118
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css#css-module
|
|
7119
|
+
init_react_import();
|
|
7120
|
+
var styles_module_default22 = { "OutlineHeader": "_OutlineHeader_filq3_1", "OutlineHeader-title": "_OutlineHeader-title_filq3_12" };
|
|
7121
|
+
|
|
7122
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
7123
|
+
import { jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7124
|
+
var getClassName28 = get_class_name_factory_default("OutlineHeader", styles_module_default22);
|
|
7125
|
+
var OutlineHeader = ({
|
|
7126
|
+
children,
|
|
7127
|
+
title
|
|
7128
|
+
}) => {
|
|
7129
|
+
const outlineHeaderMsg = useMessage("outline-header-title");
|
|
7130
|
+
return /* @__PURE__ */ jsxs17("div", { className: getClassName28(), children: [
|
|
7131
|
+
/* @__PURE__ */ jsx47("div", { className: getClassName28("title"), children: outlineHeaderMsg != null ? outlineHeaderMsg : title }),
|
|
7132
|
+
children
|
|
7133
|
+
] });
|
|
6203
7134
|
};
|
|
7135
|
+
var outline_header_default = OutlineHeader;
|
|
7136
|
+
|
|
7137
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css#css-module
|
|
7138
|
+
init_react_import();
|
|
7139
|
+
var styles_module_default23 = { "OutlineWrapper": "_OutlineWrapper_b9ln0_1", "OutlineWrapper-collapseAll": "_OutlineWrapper-collapseAll_b9ln0_9", "OutlineWrapper-layers": "_OutlineWrapper-layers_b9ln0_15" };
|
|
6204
7140
|
|
|
6205
7141
|
// components/Puck/components/Outline/index.tsx
|
|
6206
|
-
import {
|
|
6207
|
-
|
|
7142
|
+
import { jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7143
|
+
var getClassName29 = get_class_name_factory_default("OutlineWrapper", styles_module_default23);
|
|
7144
|
+
var DefaultWrapper = ({ children }) => /* @__PURE__ */ jsx48("div", { className: getClassName29(), children });
|
|
6208
7145
|
var Outline = () => {
|
|
6209
7146
|
const outlineOverride = useAppStore((s) => s.overrides.outline);
|
|
6210
7147
|
const config = useAppStore((s) => s.config);
|
|
@@ -6216,16 +7153,9 @@ var Outline = () => {
|
|
|
6216
7153
|
});
|
|
6217
7154
|
const componentFallbackLabel = useMessage("label-component");
|
|
6218
7155
|
const rootZones = useAppStore(
|
|
6219
|
-
|
|
7156
|
+
useShallow8((s) => findZonesForArea(s.state, "root"))
|
|
6220
7157
|
);
|
|
6221
|
-
const
|
|
6222
|
-
var _a;
|
|
6223
|
-
const selectedPath = selectedId ? (_a = nodes[selectedId]) == null ? void 0 : _a.path : null;
|
|
6224
|
-
return new Set(
|
|
6225
|
-
(selectedPath == null ? void 0 : selectedPath.map((candidate) => candidate.split(":")[0]).filter(Boolean)) || []
|
|
6226
|
-
);
|
|
6227
|
-
}, [nodes, selectedId]);
|
|
6228
|
-
const trees = useMemo15(
|
|
7158
|
+
const trees = useMemo18(
|
|
6229
7159
|
() => rootZones.map(
|
|
6230
7160
|
(zoneCompound) => buildLayerTree({
|
|
6231
7161
|
config,
|
|
@@ -6238,31 +7168,30 @@ var Outline = () => {
|
|
|
6238
7168
|
),
|
|
6239
7169
|
[config, nodes, rootZones, zones, componentFallbackLabel]
|
|
6240
7170
|
);
|
|
6241
|
-
const Wrapper =
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
) });
|
|
7171
|
+
const Wrapper = useMemo18(
|
|
7172
|
+
() => outlineOverride || DefaultWrapper,
|
|
7173
|
+
[outlineOverride]
|
|
7174
|
+
);
|
|
7175
|
+
return /* @__PURE__ */ jsxs18(Wrapper, { children: [
|
|
7176
|
+
/* @__PURE__ */ jsx48(outline_header_default, { children: /* @__PURE__ */ jsx48(collapse_all_default, { className: getClassName29("collapseAll") }) }),
|
|
7177
|
+
/* @__PURE__ */ jsx48("div", { className: getClassName29("layers"), children: /* @__PURE__ */ jsx48(LayerTree, { selectedId, trees }) })
|
|
7178
|
+
] });
|
|
6250
7179
|
};
|
|
6251
7180
|
|
|
6252
7181
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css#css-module
|
|
6253
7182
|
init_react_import();
|
|
6254
|
-
var
|
|
7183
|
+
var styles_module_default24 = { "OutlinePlugin": "_OutlinePlugin_1ylsc_1" };
|
|
6255
7184
|
|
|
6256
7185
|
// plugins/outline/index.tsx
|
|
6257
|
-
import { jsx as
|
|
6258
|
-
var
|
|
7186
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
7187
|
+
var getClassName30 = get_class_name_factory_default("OutlinePlugin", styles_module_default24);
|
|
6259
7188
|
var outlinePlugin = (props = {}) => {
|
|
6260
7189
|
var _a, _b;
|
|
6261
7190
|
return {
|
|
6262
7191
|
name: "outline",
|
|
6263
7192
|
label: (_a = props.label) != null ? _a : "Outline",
|
|
6264
|
-
render: () => /* @__PURE__ */
|
|
6265
|
-
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */
|
|
7193
|
+
render: () => /* @__PURE__ */ jsx49("div", { className: getClassName30(), children: /* @__PURE__ */ jsx49(Outline, {}) }),
|
|
7194
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ jsx49(Layers, {})
|
|
6266
7195
|
};
|
|
6267
7196
|
};
|
|
6268
7197
|
|
|
@@ -6274,11 +7203,11 @@ init_react_import();
|
|
|
6274
7203
|
|
|
6275
7204
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
6276
7205
|
init_react_import();
|
|
6277
|
-
var
|
|
7206
|
+
var styles_module_default25 = { "Breadcrumbs": "_Breadcrumbs_8c6w5_1", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_8c6w5_7", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_8c6w5_7" };
|
|
6278
7207
|
|
|
6279
7208
|
// lib/use-breadcrumbs.ts
|
|
6280
7209
|
init_react_import();
|
|
6281
|
-
import { useMemo as
|
|
7210
|
+
import { useMemo as useMemo19 } from "react";
|
|
6282
7211
|
var useBreadcrumbs = (renderCount) => {
|
|
6283
7212
|
const selectedId = useAppStore((s) => {
|
|
6284
7213
|
var _a;
|
|
@@ -6292,7 +7221,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6292
7221
|
const appStore = useAppStoreApi();
|
|
6293
7222
|
const pageLabel = useMessage("label-page");
|
|
6294
7223
|
const componentLabel = useMessage("label-component");
|
|
6295
|
-
return
|
|
7224
|
+
return useMemo19(() => {
|
|
6296
7225
|
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
6297
7226
|
var _a, _b, _c, _d;
|
|
6298
7227
|
const [componentId] = zoneCompound.split(":");
|
|
@@ -6323,26 +7252,26 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6323
7252
|
};
|
|
6324
7253
|
|
|
6325
7254
|
// components/Breadcrumbs/index.tsx
|
|
6326
|
-
import { jsx as
|
|
6327
|
-
var
|
|
7255
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7256
|
+
var getClassName31 = get_class_name_factory_default("Breadcrumbs", styles_module_default25);
|
|
6328
7257
|
var Breadcrumbs = ({
|
|
6329
7258
|
children,
|
|
6330
7259
|
numParents = 1
|
|
6331
7260
|
}) => {
|
|
6332
7261
|
const setUi = useAppStore((s) => s.setUi);
|
|
6333
7262
|
const breadcrumbs = useBreadcrumbs(numParents);
|
|
6334
|
-
return /* @__PURE__ */
|
|
6335
|
-
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */
|
|
6336
|
-
/* @__PURE__ */
|
|
7263
|
+
return /* @__PURE__ */ jsxs19("div", { className: getClassName31(), children: [
|
|
7264
|
+
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs19("div", { className: getClassName31("breadcrumb"), children: [
|
|
7265
|
+
/* @__PURE__ */ jsx50(
|
|
6337
7266
|
"button",
|
|
6338
7267
|
{
|
|
6339
7268
|
type: "button",
|
|
6340
|
-
className:
|
|
7269
|
+
className: getClassName31("breadcrumbLabel"),
|
|
6341
7270
|
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
|
6342
7271
|
children: breadcrumb.label
|
|
6343
7272
|
}
|
|
6344
7273
|
),
|
|
6345
|
-
/* @__PURE__ */
|
|
7274
|
+
/* @__PURE__ */ jsx50(ChevronRight, { size: 16 })
|
|
6346
7275
|
] }, i)),
|
|
6347
7276
|
children
|
|
6348
7277
|
] });
|
|
@@ -6353,23 +7282,23 @@ init_react_import();
|
|
|
6353
7282
|
|
|
6354
7283
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Fields/styles.module.css#css-module
|
|
6355
7284
|
init_react_import();
|
|
6356
|
-
var
|
|
7285
|
+
var styles_module_default26 = { "PuckFields": "_PuckFields_wnj25_1", "PuckFields--isLoading": "_PuckFields--isLoading_wnj25_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_wnj25_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_wnj25_25", "PuckFields-field": "_PuckFields-field_wnj25_32", "PuckFields--wrapFields": "_PuckFields--wrapFields_wnj25_36" };
|
|
6357
7286
|
|
|
6358
7287
|
// components/Puck/components/Fields/index.tsx
|
|
6359
7288
|
import {
|
|
6360
7289
|
memo as memo8,
|
|
6361
|
-
useCallback as
|
|
6362
|
-
useContext as
|
|
7290
|
+
useCallback as useCallback18,
|
|
7291
|
+
useContext as useContext15,
|
|
6363
7292
|
useEffect as useEffect20,
|
|
6364
|
-
useMemo as
|
|
7293
|
+
useMemo as useMemo20
|
|
6365
7294
|
} from "react";
|
|
6366
|
-
import { useShallow as
|
|
6367
|
-
import { Fragment as Fragment11, jsx as
|
|
6368
|
-
var
|
|
7295
|
+
import { useShallow as useShallow9 } from "zustand/react/shallow";
|
|
7296
|
+
import { Fragment as Fragment11, jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7297
|
+
var getClassName32 = get_class_name_factory_default("PuckFields", styles_module_default26);
|
|
6369
7298
|
var DefaultFields = ({
|
|
6370
7299
|
children
|
|
6371
7300
|
}) => {
|
|
6372
|
-
return /* @__PURE__ */
|
|
7301
|
+
return /* @__PURE__ */ jsx51(Fragment11, { children });
|
|
6373
7302
|
};
|
|
6374
7303
|
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
6375
7304
|
const { dispatch, state, selectedItem, resolveComponentData } = appStore.getState();
|
|
@@ -6424,17 +7353,17 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6424
7353
|
return s.selectedItem ? `${s.selectedItem.props.id}_${field.type}_${fieldName}` : `root_${field.type}_${fieldName}`;
|
|
6425
7354
|
});
|
|
6426
7355
|
const permissions = useAppStore(
|
|
6427
|
-
|
|
7356
|
+
useShallow9((s) => {
|
|
6428
7357
|
const { selectedItem, permissions: permissions2 } = s;
|
|
6429
7358
|
return selectedItem ? permissions2.getPermissions({ item: selectedItem }) : permissions2.getPermissions({ root: true });
|
|
6430
7359
|
})
|
|
6431
7360
|
);
|
|
6432
7361
|
const appStore = useAppStoreApi();
|
|
6433
|
-
const onChange =
|
|
7362
|
+
const onChange = useCallback18(createOnChange(fieldName, appStore), [
|
|
6434
7363
|
fieldName
|
|
6435
7364
|
]);
|
|
6436
7365
|
const { visible = true } = field != null ? field : {};
|
|
6437
|
-
const fieldStore =
|
|
7366
|
+
const fieldStore = useContext15(fieldContextStore.ctx);
|
|
6438
7367
|
useEffect20(() => {
|
|
6439
7368
|
return appStore.subscribe(
|
|
6440
7369
|
(s) => {
|
|
@@ -6449,7 +7378,7 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6449
7378
|
}, [appStore, fieldStore]);
|
|
6450
7379
|
if (!field || !id || !visible) return null;
|
|
6451
7380
|
if (field.type === "slot") return null;
|
|
6452
|
-
return /* @__PURE__ */
|
|
7381
|
+
return /* @__PURE__ */ jsx51("div", { className: getClassName32("field"), children: /* @__PURE__ */ jsx51(
|
|
6453
7382
|
AutoFieldPrivate,
|
|
6454
7383
|
{
|
|
6455
7384
|
field,
|
|
@@ -6462,12 +7391,12 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6462
7391
|
};
|
|
6463
7392
|
var FieldsChild = ({ fieldName }) => {
|
|
6464
7393
|
const appStore = useAppStoreApi();
|
|
6465
|
-
const initialValue =
|
|
7394
|
+
const initialValue = useMemo20(() => {
|
|
6466
7395
|
var _a;
|
|
6467
7396
|
const value = (_a = appStore.getState().getCurrentData().props) == null ? void 0 : _a[fieldName];
|
|
6468
7397
|
return { [fieldName]: value };
|
|
6469
7398
|
}, []);
|
|
6470
|
-
return /* @__PURE__ */
|
|
7399
|
+
return /* @__PURE__ */ jsx51(fieldContextStore.Provider, { value: initialValue, children: /* @__PURE__ */ jsx51(FieldsChildInner, { fieldName }) });
|
|
6471
7400
|
};
|
|
6472
7401
|
var FieldsChildMemo = memo8(FieldsChild);
|
|
6473
7402
|
var FieldsInternal = ({ wrapFields = true }) => {
|
|
@@ -6477,7 +7406,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6477
7406
|
const loadingCount = s.selectedItem ? (_a = s.componentState[s.selectedItem.props.id]) == null ? void 0 : _a.loadingCount : (_b = s.componentState["root"]) == null ? void 0 : _b.loadingCount;
|
|
6478
7407
|
return (loadingCount != null ? loadingCount : 0) > 0;
|
|
6479
7408
|
});
|
|
6480
|
-
const itemSelector = useAppStore(
|
|
7409
|
+
const itemSelector = useAppStore(useShallow9((s) => s.state.ui.itemSelector));
|
|
6481
7410
|
const id = useAppStore((s) => {
|
|
6482
7411
|
var _a;
|
|
6483
7412
|
return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
|
|
@@ -6486,7 +7415,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6486
7415
|
useRegisterFieldsSlice(appStore, id);
|
|
6487
7416
|
const fieldsLoading = useAppStore((s) => s.fields.loading);
|
|
6488
7417
|
const fieldNames = useAppStore(
|
|
6489
|
-
|
|
7418
|
+
useShallow9((s) => {
|
|
6490
7419
|
if (s.fields.id === id) {
|
|
6491
7420
|
return Object.keys(s.fields.fields);
|
|
6492
7421
|
}
|
|
@@ -6494,17 +7423,17 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6494
7423
|
})
|
|
6495
7424
|
);
|
|
6496
7425
|
const isLoading = fieldsLoading || componentResolving;
|
|
6497
|
-
const Wrapper =
|
|
6498
|
-
return /* @__PURE__ */
|
|
7426
|
+
const Wrapper = useMemo20(() => overrides.fields || DefaultFields, [overrides]);
|
|
7427
|
+
return /* @__PURE__ */ jsxs20(
|
|
6499
7428
|
"form",
|
|
6500
7429
|
{
|
|
6501
|
-
className:
|
|
7430
|
+
className: getClassName32({ wrapFields }),
|
|
6502
7431
|
onSubmit: (e) => {
|
|
6503
7432
|
e.preventDefault();
|
|
6504
7433
|
},
|
|
6505
7434
|
children: [
|
|
6506
|
-
/* @__PURE__ */
|
|
6507
|
-
isLoading && /* @__PURE__ */
|
|
7435
|
+
/* @__PURE__ */ jsx51(Wrapper, { isLoading, itemSelector, children: fieldNames.map((fieldName) => /* @__PURE__ */ jsx51(FieldsChildMemo, { fieldName }, fieldName)) }),
|
|
7436
|
+
isLoading && /* @__PURE__ */ jsx51("div", { className: getClassName32("loadingOverlay"), children: /* @__PURE__ */ jsx51("div", { className: getClassName32("loadingOverlayInner"), children: /* @__PURE__ */ jsx51(Loader, { size: 16 }) }) })
|
|
6508
7437
|
]
|
|
6509
7438
|
}
|
|
6510
7439
|
);
|
|
@@ -6513,11 +7442,11 @@ var Fields = memo8(FieldsInternal);
|
|
|
6513
7442
|
|
|
6514
7443
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css#css-module
|
|
6515
7444
|
init_react_import();
|
|
6516
|
-
var
|
|
7445
|
+
var styles_module_default27 = { "FieldsPlugin": "_FieldsPlugin_18cj3_1", "FieldsPlugin-header": "_FieldsPlugin-header_18cj3_7" };
|
|
6517
7446
|
|
|
6518
7447
|
// plugins/fields/index.tsx
|
|
6519
|
-
import { jsx as
|
|
6520
|
-
var
|
|
7448
|
+
import { jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7449
|
+
var getClassName33 = get_class_name_factory_default("FieldsPlugin", styles_module_default27);
|
|
6521
7450
|
var CurrentTitle = () => {
|
|
6522
7451
|
const pageLabel = useMessage("label-page");
|
|
6523
7452
|
const label = useAppStore((s) => {
|
|
@@ -6530,37 +7459,37 @@ var CurrentTitle = () => {
|
|
|
6530
7459
|
var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
|
|
6531
7460
|
name: "fields",
|
|
6532
7461
|
label: label != null ? label : "Fields",
|
|
6533
|
-
render: () => /* @__PURE__ */
|
|
6534
|
-
/* @__PURE__ */
|
|
6535
|
-
/* @__PURE__ */
|
|
7462
|
+
render: () => /* @__PURE__ */ jsxs21("div", { className: getClassName33(), children: [
|
|
7463
|
+
/* @__PURE__ */ jsx52("div", { className: getClassName33("header"), children: /* @__PURE__ */ jsx52(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ jsx52(CurrentTitle, {}) }) }),
|
|
7464
|
+
/* @__PURE__ */ jsx52(Fields, {})
|
|
6536
7465
|
] }),
|
|
6537
|
-
icon: icon != null ? icon : /* @__PURE__ */
|
|
7466
|
+
icon: icon != null ? icon : /* @__PURE__ */ jsx52(RectangleEllipsis, {}),
|
|
6538
7467
|
mobileOnly: desktopSideBar === "right"
|
|
6539
7468
|
});
|
|
6540
7469
|
|
|
6541
7470
|
// components/Puck/index.tsx
|
|
6542
7471
|
init_react_import();
|
|
6543
7472
|
import {
|
|
6544
|
-
createContext as
|
|
6545
|
-
useCallback as
|
|
6546
|
-
useContext as
|
|
7473
|
+
createContext as createContext9,
|
|
7474
|
+
useCallback as useCallback25,
|
|
7475
|
+
useContext as useContext18,
|
|
6547
7476
|
useEffect as useEffect29,
|
|
6548
|
-
useMemo as
|
|
7477
|
+
useMemo as useMemo28,
|
|
6549
7478
|
useRef as useRef16,
|
|
6550
|
-
useState as
|
|
7479
|
+
useState as useState25
|
|
6551
7480
|
} from "react";
|
|
6552
7481
|
|
|
6553
7482
|
// components/Puck/components/Preview/index.tsx
|
|
6554
7483
|
init_react_import();
|
|
6555
|
-
import { useEffect as useEffect23, useRef as useRef11, useMemo as
|
|
7484
|
+
import { useEffect as useEffect23, useRef as useRef11, useMemo as useMemo21, memo as memo9 } from "react";
|
|
6556
7485
|
|
|
6557
7486
|
// components/AutoFrame/index.tsx
|
|
6558
7487
|
init_react_import();
|
|
6559
7488
|
import {
|
|
6560
|
-
createContext as
|
|
6561
|
-
useContext as
|
|
7489
|
+
createContext as createContext7,
|
|
7490
|
+
useContext as useContext16,
|
|
6562
7491
|
useEffect as useEffect22,
|
|
6563
|
-
useState as
|
|
7492
|
+
useState as useState19
|
|
6564
7493
|
} from "react";
|
|
6565
7494
|
import hash from "object-hash";
|
|
6566
7495
|
import { createPortal as createPortal3 } from "react-dom";
|
|
@@ -6682,6 +7611,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
6682
7611
|
--puck-color-focus-ring: var(--puck-color-azure-05);
|
|
6683
7612
|
--puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );
|
|
6684
7613
|
--puck-color-selection-border: var(--puck-color-azure-08);
|
|
7614
|
+
--puck-color-insertion-indicator: var(--puck-color-azure-06);
|
|
6685
7615
|
--puck-color-highlight: var(--puck-color-rose-07);
|
|
6686
7616
|
--puck-color-bg-disabled: var(--puck-color-grey-07);
|
|
6687
7617
|
--puck-color-text-disabled: var(--puck-color-grey-03);
|
|
@@ -6716,6 +7646,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
6716
7646
|
--puck-font-weight-heavy: 800;
|
|
6717
7647
|
--puck-letter-spacing-ui: 0.05ch;
|
|
6718
7648
|
--puck-letter-spacing-heading: 0.08ch;
|
|
7649
|
+
--puck-icon-size-xs: 14px;
|
|
6719
7650
|
--puck-icon-size-s: 16px;
|
|
6720
7651
|
--puck-icon-size-m: 18px;
|
|
6721
7652
|
--puck-icon-size-l: 24px;
|
|
@@ -7249,7 +8180,7 @@ textarea._Input-input_qyenz_29 {
|
|
|
7249
8180
|
}
|
|
7250
8181
|
|
|
7251
8182
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
7252
|
-
.
|
|
8183
|
+
._IconButton_1pxxt_1 {
|
|
7253
8184
|
align-items: center;
|
|
7254
8185
|
background: var(--puck-iconbutton-color-bg, transparent);
|
|
7255
8186
|
border: none;
|
|
@@ -7261,26 +8192,26 @@ textarea._Input-input_qyenz_29 {
|
|
|
7261
8192
|
padding: var(--puck-iconbutton-space, var(--puck-space-1));
|
|
7262
8193
|
transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
7263
8194
|
}
|
|
7264
|
-
._IconButton--
|
|
8195
|
+
._IconButton--active_1pxxt_15 {
|
|
7265
8196
|
color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
|
|
7266
8197
|
}
|
|
7267
|
-
.
|
|
8198
|
+
._IconButton_1pxxt_1:focus-visible {
|
|
7268
8199
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
7269
8200
|
outline-offset: calc(var(--puck-border-width-focus) * -1);
|
|
7270
8201
|
}
|
|
7271
8202
|
@media (hover: hover) and (pointer: fine) {
|
|
7272
|
-
.
|
|
7273
|
-
background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
|
|
8203
|
+
._IconButton_1pxxt_1:hover:not(._IconButton--disabled_1pxxt_28) {
|
|
8204
|
+
background: var( --_puck-iconbutton-color-bg-hover, var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) ) );
|
|
7274
8205
|
color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
|
|
7275
8206
|
cursor: pointer;
|
|
7276
8207
|
transition: none;
|
|
7277
8208
|
}
|
|
7278
8209
|
}
|
|
7279
|
-
.
|
|
8210
|
+
._IconButton_1pxxt_1:active {
|
|
7280
8211
|
background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
|
|
7281
8212
|
transition: none;
|
|
7282
8213
|
}
|
|
7283
|
-
._IconButton--
|
|
8214
|
+
._IconButton--disabled_1pxxt_28 {
|
|
7284
8215
|
color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
|
|
7285
8216
|
}
|
|
7286
8217
|
|
|
@@ -8389,138 +9320,327 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8389
9320
|
}
|
|
8390
9321
|
|
|
8391
9322
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css/#css-module-data */
|
|
8392
|
-
.
|
|
9323
|
+
._PuckPreview_zbic3_1 {
|
|
8393
9324
|
position: relative;
|
|
8394
9325
|
height: 100%;
|
|
8395
9326
|
}
|
|
8396
|
-
._PuckPreview-
|
|
9327
|
+
._PuckPreview-frame_zbic3_6 {
|
|
8397
9328
|
border: none;
|
|
8398
9329
|
height: 100%;
|
|
8399
9330
|
width: 100%;
|
|
8400
9331
|
}
|
|
9332
|
+
._PuckPreview-frame_zbic3_6[data-puck-outline-dragging] {
|
|
9333
|
+
pointer-events: none;
|
|
9334
|
+
}
|
|
8401
9335
|
|
|
8402
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
8403
|
-
.
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
9336
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css/#css-module-data */
|
|
9337
|
+
._DropLine_eyz3q_2 {
|
|
9338
|
+
background: var(--_puck-outline-color-drop-indicator);
|
|
9339
|
+
border-radius: calc(var(--_puck-outline-drop-indicator-size) / 2);
|
|
9340
|
+
height: var(--_puck-outline-drop-indicator-size);
|
|
9341
|
+
inset-inline: 0;
|
|
9342
|
+
pointer-events: none;
|
|
9343
|
+
position: absolute;
|
|
9344
|
+
z-index: 1;
|
|
8411
9345
|
}
|
|
8412
|
-
.
|
|
8413
|
-
|
|
8414
|
-
font-size: var(--puck-outline-zone-font-size, var(--puck-font-size-xxxs));
|
|
8415
|
-
text-transform: uppercase;
|
|
9346
|
+
._DropLine--top_eyz3q_12 {
|
|
9347
|
+
top: 0;
|
|
8416
9348
|
}
|
|
8417
|
-
.
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
9349
|
+
._DropLine--bottom_eyz3q_16 {
|
|
9350
|
+
bottom: 0;
|
|
9351
|
+
}
|
|
9352
|
+
._DropLine--top_eyz3q_12._DropLine--outset_eyz3q_20 {
|
|
9353
|
+
top: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
9354
|
+
}
|
|
9355
|
+
._DropLine--bottom_eyz3q_16._DropLine--outset_eyz3q_20 {
|
|
9356
|
+
bottom: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
9357
|
+
}
|
|
9358
|
+
|
|
9359
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css/#css-module-data */
|
|
9360
|
+
._LayerTree-helper_1niov_2 {
|
|
9361
|
+
color: var(--puck-outline-color-text-helper, var(--puck-color-text-subtle));
|
|
9362
|
+
padding-top: var(--puck-space-1);
|
|
9363
|
+
padding-bottom: var(--puck-space-1);
|
|
9364
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
9365
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9366
|
+
}
|
|
9367
|
+
._LayerTree-helper_1niov_2[data-puck-drop-target] {
|
|
9368
|
+
position: relative;
|
|
9369
|
+
overflow: visible;
|
|
8421
9370
|
}
|
|
8422
|
-
|
|
9371
|
+
|
|
9372
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css/#css-module-data */
|
|
9373
|
+
._Layer_1o110_1 {
|
|
8423
9374
|
position: relative;
|
|
8424
|
-
border: var(--
|
|
8425
|
-
border-radius: var(--
|
|
9375
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9376
|
+
border-radius: var(--_puck-outline-radius);
|
|
8426
9377
|
}
|
|
8427
|
-
._Layer-
|
|
8428
|
-
|
|
8429
|
-
border
|
|
9378
|
+
._Layer-inner_1o110_8 {
|
|
9379
|
+
align-items: center;
|
|
9380
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9381
|
+
border-radius: var(--_puck-outline-radius);
|
|
9382
|
+
cursor: pointer;
|
|
9383
|
+
display: flex;
|
|
9384
|
+
position: relative;
|
|
8430
9385
|
transition: color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
8431
9386
|
}
|
|
8432
|
-
._Layer--
|
|
8433
|
-
|
|
9387
|
+
._Layer--isSortable_1o110_18 > ._Layer-inner_1o110_8 {
|
|
9388
|
+
cursor: grab;
|
|
9389
|
+
}
|
|
9390
|
+
._Layer-content_1o110_22 {
|
|
9391
|
+
display: flex;
|
|
9392
|
+
gap: var(--puck-space-4);
|
|
9393
|
+
flex: 1 1 auto;
|
|
9394
|
+
min-width: 0;
|
|
8434
9395
|
}
|
|
8435
|
-
._Layer-
|
|
9396
|
+
._Layer-clickable_1o110_29 {
|
|
8436
9397
|
align-items: center;
|
|
8437
9398
|
background: none;
|
|
8438
9399
|
border: 0;
|
|
8439
|
-
border-radius: var(--
|
|
9400
|
+
border-radius: var(--_puck-outline-radius);
|
|
8440
9401
|
color: inherit;
|
|
8441
|
-
cursor:
|
|
9402
|
+
cursor: inherit;
|
|
8442
9403
|
display: flex;
|
|
9404
|
+
flex: 1 1 auto;
|
|
8443
9405
|
font: inherit;
|
|
8444
|
-
|
|
8445
|
-
padding
|
|
8446
|
-
width: 100%;
|
|
9406
|
+
min-width: 0;
|
|
9407
|
+
padding: 0;
|
|
8447
9408
|
}
|
|
8448
|
-
._Layer-
|
|
9409
|
+
[data-puck-dnd-disabled] ._Layer-inner_1o110_8,
|
|
9410
|
+
[data-puck-dnd-disabled] ._Layer-clickable_1o110_29 {
|
|
9411
|
+
cursor: pointer;
|
|
9412
|
+
}
|
|
9413
|
+
._Layer-clickable_1o110_29:focus-visible {
|
|
8449
9414
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
8450
9415
|
outline-offset: var(--puck-border-width-focus);
|
|
8451
9416
|
position: relative;
|
|
8452
9417
|
z-index: 1;
|
|
8453
9418
|
}
|
|
9419
|
+
._Layer-caret_1o110_57 {
|
|
9420
|
+
visibility: hidden;
|
|
9421
|
+
display: flex;
|
|
9422
|
+
flex-shrink: 0;
|
|
9423
|
+
}
|
|
9424
|
+
._Layer-caret_1o110_57 svg {
|
|
9425
|
+
height: var(--_puck-outline-caret-size);
|
|
9426
|
+
width: var(--_puck-outline-caret-size);
|
|
9427
|
+
}
|
|
9428
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-content_1o110_22 {
|
|
9429
|
+
font-weight: var(--puck-font-weight-bold);
|
|
9430
|
+
}
|
|
9431
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 {
|
|
9432
|
+
visibility: visible;
|
|
9433
|
+
}
|
|
9434
|
+
._Layer-title_1o110_76 {
|
|
9435
|
+
display: flex;
|
|
9436
|
+
gap: var(--puck-space-2);
|
|
9437
|
+
align-items: center;
|
|
9438
|
+
overflow-x: hidden;
|
|
9439
|
+
margin: var(--puck-space-1);
|
|
9440
|
+
cursor: pointer;
|
|
9441
|
+
}
|
|
9442
|
+
._Layer-name_1o110_85 {
|
|
9443
|
+
overflow-x: hidden;
|
|
9444
|
+
text-overflow: ellipsis;
|
|
9445
|
+
white-space: nowrap;
|
|
9446
|
+
}
|
|
9447
|
+
._Layer-icon_1o110_91 {
|
|
9448
|
+
color: var(--puck-outline-color-icon, var(--puck-color-text-subtle));
|
|
9449
|
+
margin-top: var(--puck-space-1);
|
|
9450
|
+
}
|
|
9451
|
+
._Layer-icon_1o110_91 svg {
|
|
9452
|
+
height: var(--_puck-outline-icon-size);
|
|
9453
|
+
width: var(--_puck-outline-icon-size);
|
|
9454
|
+
}
|
|
9455
|
+
._Layer-zones_1o110_101 {
|
|
9456
|
+
display: none;
|
|
9457
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-4));
|
|
9458
|
+
}
|
|
9459
|
+
._Layer--isExpanded_1o110_106 > ._Layer-zones_1o110_101 {
|
|
9460
|
+
display: block;
|
|
9461
|
+
}
|
|
9462
|
+
._Layer--isExpanded_1o110_106 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 svg {
|
|
9463
|
+
transform: rotate(90deg);
|
|
9464
|
+
}
|
|
8454
9465
|
@media (hover: hover) and (pointer: fine) {
|
|
8455
|
-
.
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
9466
|
+
._Layer_1o110_1:not(._Layer--isSelected_1o110_115) > ._Layer-inner_1o110_8:hover {
|
|
9467
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-hover);
|
|
9468
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
9469
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
8459
9470
|
transition: none;
|
|
8460
9471
|
}
|
|
8461
9472
|
}
|
|
8462
|
-
._Layer--
|
|
9473
|
+
._Layer--isSelected_1o110_115 {
|
|
8463
9474
|
border-color: var( --puck-outline-color-border-selected, var(--puck-color-selection-border) );
|
|
8464
9475
|
}
|
|
8465
|
-
._Layer--
|
|
8466
|
-
|
|
9476
|
+
._Layer--isSelected_1o110_115 > ._Layer-inner_1o110_8 {
|
|
9477
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-selected);
|
|
9478
|
+
background: var(--_puck-outline-color-bg-selected);
|
|
8467
9479
|
}
|
|
8468
|
-
._Layer--
|
|
8469
|
-
|
|
8470
|
-
|
|
9480
|
+
._Layer--isExpandCandidate_1o110_138 > ._Layer-inner_1o110_8 {
|
|
9481
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
9482
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
8471
9483
|
}
|
|
8472
|
-
._Layer-
|
|
8473
|
-
|
|
8474
|
-
|
|
9484
|
+
._Layer--isDragSource_1o110_143 > ._Layer-inner_1o110_8 {
|
|
9485
|
+
color: var(--puck-color-text-muted);
|
|
9486
|
+
background: transparent;
|
|
8475
9487
|
}
|
|
8476
|
-
._Layer--
|
|
8477
|
-
|
|
8478
|
-
|
|
9488
|
+
._Layer--isDragSource_1o110_143 > ._Layer-zones_1o110_101 {
|
|
9489
|
+
opacity: 0.5;
|
|
9490
|
+
}
|
|
9491
|
+
|
|
9492
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css/#css-module-data */
|
|
9493
|
+
._LayerActions_1m5z5_2 {
|
|
9494
|
+
position: sticky;
|
|
9495
|
+
inset-inline-end: calc(var(--puck-space-1) * -1);
|
|
9496
|
+
padding-inline: var(--puck-space-1);
|
|
9497
|
+
display: flex;
|
|
9498
|
+
visibility: hidden;
|
|
9499
|
+
flex-shrink: 0;
|
|
9500
|
+
gap: var(--puck-space-1);
|
|
9501
|
+
color: var(--_puck-outline-color-text);
|
|
9502
|
+
background: var(--_puck-outline-actions-color-bg);
|
|
9503
|
+
}
|
|
9504
|
+
._LayerActions--visible_1m5z5_17 {
|
|
9505
|
+
visibility: visible;
|
|
9506
|
+
}
|
|
9507
|
+
._LayerActions_1m5z5_2 svg {
|
|
9508
|
+
height: var(--_puck-outline-caret-size);
|
|
9509
|
+
width: var(--_puck-outline-caret-size);
|
|
9510
|
+
}
|
|
9511
|
+
|
|
9512
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css/#css-module-data */
|
|
9513
|
+
._LayerTree_o5tyt_1 {
|
|
9514
|
+
color: var(--_puck-outline-color-text);
|
|
9515
|
+
font-family: var(--puck-outline-font-family, var(--puck-font-family));
|
|
9516
|
+
font-size: var(--puck-outline-font-size, var(--puck-font-size-xxxs));
|
|
9517
|
+
margin: 0;
|
|
9518
|
+
position: relative;
|
|
9519
|
+
list-style: none;
|
|
9520
|
+
padding: 0;
|
|
8479
9521
|
}
|
|
8480
|
-
.
|
|
8481
|
-
margin-inline-start: var(--puck-space-3);
|
|
9522
|
+
._LayerTree--nested_o5tyt_12 {
|
|
9523
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-3));
|
|
8482
9524
|
}
|
|
8483
|
-
|
|
8484
|
-
.
|
|
9525
|
+
|
|
9526
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css/#css-module-data */
|
|
9527
|
+
._LayerTree-zoneTitle_fvhlh_2 {
|
|
9528
|
+
color: var(--_puck-outline-zone-color-text);
|
|
9529
|
+
font-size: var( --puck-outline-zone-font-size, calc(var(--puck-font-size-xxxs) * 0.9) );
|
|
8485
9530
|
display: flex;
|
|
8486
9531
|
gap: var(--puck-space-2);
|
|
8487
9532
|
align-items: center;
|
|
8488
|
-
margin: var(--puck-space-2) var(--puck-space-1);
|
|
8489
|
-
overflow-x: hidden;
|
|
8490
|
-
}
|
|
8491
|
-
._Layer-name_1vltj_119 {
|
|
8492
9533
|
overflow-x: hidden;
|
|
8493
|
-
|
|
8494
|
-
|
|
9534
|
+
padding-top: var(--puck-space-1);
|
|
9535
|
+
padding-bottom: var(--puck-space-1);
|
|
9536
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
9537
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
8495
9538
|
}
|
|
8496
|
-
.
|
|
8497
|
-
color: var(--puck-outline-color-icon, var(--puck-color-highlight));
|
|
9539
|
+
._LayerTree-zoneIcon_fvhlh_19 {
|
|
8498
9540
|
margin-top: var(--puck-space-1);
|
|
8499
9541
|
}
|
|
8500
|
-
.
|
|
8501
|
-
|
|
8502
|
-
|
|
9542
|
+
._LayerTree-zoneIcon_fvhlh_19 svg {
|
|
9543
|
+
height: var(--_puck-outline-icon-size);
|
|
9544
|
+
width: var(--_puck-outline-icon-size);
|
|
9545
|
+
}
|
|
9546
|
+
._LayerTree-zoneTitle_fvhlh_2[data-puck-drop-target] {
|
|
9547
|
+
color: var(--_puck-outline-color-text-hover);
|
|
9548
|
+
position: relative;
|
|
9549
|
+
overflow: visible;
|
|
9550
|
+
}
|
|
9551
|
+
|
|
9552
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
9553
|
+
._LayerTreeRoot_kxnd1_1 {
|
|
9554
|
+
min-width: max-content;
|
|
9555
|
+
--_puck-iconbutton-color-bg-hover: transparent;
|
|
9556
|
+
--_puck-outline-color-text: var( --puck-outline-color-text, var(--puck-color-text-secondary) );
|
|
9557
|
+
--_puck-outline-border-width: var( --puck-outline-border-width, var(--puck-border-width-regular) );
|
|
9558
|
+
--_puck-outline-radius: var(--puck-outline-radius, var(--puck-radius-m));
|
|
9559
|
+
--_puck-outline-caret-size: var( --puck-outline-action-size, var(--puck-icon-size-s) );
|
|
9560
|
+
--_puck-outline-icon-size: var( --puck-outline-icon-size, var(--puck-icon-size-xs) );
|
|
9561
|
+
--_puck-outline-color-bg-selected: var( --puck-outline-color-bg-selected, var(--puck-color-interactive-subtle) );
|
|
9562
|
+
--_puck-outline-color-bg-hover: var( --puck-outline-color-bg-hover, var(--puck-color-interactive-soft) );
|
|
9563
|
+
--_puck-outline-color-border-hover: var( --puck-outline-color-border-hover, var(--puck-color-interactive-subtle) );
|
|
9564
|
+
--_puck-outline-color-text-hover: var( --puck-outline-color-text-hover, var(--puck-color-interactive) );
|
|
9565
|
+
--_puck-outline-color-drop-indicator: var( --puck-outline-color-drop-indicator, var(--puck-color-insertion-indicator) );
|
|
9566
|
+
--_puck-outline-drop-indicator-size: var(--puck-border-width-focus);
|
|
9567
|
+
--_puck-outline-zone-color-text: var( --puck-outline-zone-color-text, var(--puck-color-text-muted) );
|
|
9568
|
+
--_puck-outline-actions-color-bg: transparent;
|
|
9569
|
+
--_puck-outline-caret-slot: calc( var(--_puck-outline-caret-size) + var(--puck-iconbutton-space, var(--puck-space-1)) * 2 );
|
|
9570
|
+
--_puck-outline-label-indent: calc( var(--_puck-outline-caret-slot) + var(--puck-space-1) + var(--_puck-outline-border-width) );
|
|
9571
|
+
}
|
|
9572
|
+
|
|
9573
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css/#css-module-data */
|
|
9574
|
+
._CollapseAll_1r4cy_1 {
|
|
9575
|
+
visibility: hidden;
|
|
9576
|
+
}
|
|
9577
|
+
._CollapseAll-icon_1r4cy_5 {
|
|
9578
|
+
height: var(--puck-icon-size-m);
|
|
9579
|
+
width: var(--puck-icon-size-m);
|
|
9580
|
+
}
|
|
9581
|
+
._CollapseAll--visible_1r4cy_10 {
|
|
9582
|
+
visibility: visible;
|
|
9583
|
+
}
|
|
9584
|
+
|
|
9585
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css/#css-module-data */
|
|
9586
|
+
._OutlineHeader_filq3_1 {
|
|
9587
|
+
display: flex;
|
|
9588
|
+
align-items: center;
|
|
9589
|
+
width: 100%;
|
|
9590
|
+
gap: var(--puck-space-2);
|
|
9591
|
+
padding-block: var(--puck-space-3);
|
|
9592
|
+
padding-inline: var(--puck-space-4);
|
|
9593
|
+
border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
9594
|
+
box-sizing: border-box;
|
|
9595
|
+
}
|
|
9596
|
+
._OutlineHeader-title_filq3_12 {
|
|
9597
|
+
color: var(--puck-color-text-secondary);
|
|
9598
|
+
font-size: var(--puck-font-size-xs);
|
|
9599
|
+
font-weight: var(--puck-font-weight-regular);
|
|
9600
|
+
line-height: var(--puck-line-height-m);
|
|
9601
|
+
margin: 0;
|
|
9602
|
+
}
|
|
9603
|
+
|
|
9604
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css/#css-module-data */
|
|
9605
|
+
._OutlineWrapper_b9ln0_1 {
|
|
9606
|
+
display: flex;
|
|
9607
|
+
flex-direction: column;
|
|
9608
|
+
flex-grow: 1;
|
|
9609
|
+
min-height: 0;
|
|
9610
|
+
min-width: 0;
|
|
9611
|
+
}
|
|
9612
|
+
._OutlineWrapper-collapseAll_b9ln0_9 {
|
|
9613
|
+
display: flex;
|
|
9614
|
+
align-items: center;
|
|
9615
|
+
margin-inline-start: auto;
|
|
9616
|
+
}
|
|
9617
|
+
._OutlineWrapper-layers_b9ln0_15 {
|
|
9618
|
+
flex-grow: 1;
|
|
9619
|
+
min-height: 0;
|
|
9620
|
+
overflow: auto;
|
|
9621
|
+
padding: var(--puck-space-1);
|
|
9622
|
+
box-sizing: border-box;
|
|
8503
9623
|
}
|
|
8504
9624
|
|
|
8505
9625
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css/#css-module-data */
|
|
8506
|
-
.
|
|
9626
|
+
._Puck_tzaxg_19 {
|
|
8507
9627
|
font-family: var(--puck-font-family);
|
|
8508
9628
|
overflow-x: hidden;
|
|
8509
9629
|
visibility: visible !important;
|
|
8510
9630
|
}
|
|
8511
9631
|
@media (min-width: 766px) {
|
|
8512
|
-
.
|
|
9632
|
+
._Puck_tzaxg_19 {
|
|
8513
9633
|
overflow-x: auto;
|
|
8514
9634
|
}
|
|
8515
9635
|
}
|
|
8516
|
-
._Puck-
|
|
9636
|
+
._Puck-portal_tzaxg_31 {
|
|
8517
9637
|
position: relative;
|
|
8518
9638
|
z-index: 2;
|
|
8519
9639
|
}
|
|
8520
|
-
.
|
|
9640
|
+
._PuckLayout_tzaxg_36 {
|
|
8521
9641
|
height: 100dvh;
|
|
8522
9642
|
}
|
|
8523
|
-
._PuckLayout-
|
|
9643
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
8524
9644
|
--puck-frame-width: auto;
|
|
8525
9645
|
--puck-pluginbar-width: min-content;
|
|
8526
9646
|
--puck-sidebar-width: 0px;
|
|
@@ -8538,92 +9658,92 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8538
9658
|
overflow: hidden;
|
|
8539
9659
|
}
|
|
8540
9660
|
@media (min-width: 638px) {
|
|
8541
|
-
._PuckLayout-
|
|
9661
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
8542
9662
|
--puck-pluginbar-width: 68px;
|
|
8543
9663
|
grid-template-areas: "header header header header" "sidenav left editor right";
|
|
8544
9664
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) 0;
|
|
8545
9665
|
grid-template-rows: min-content auto;
|
|
8546
9666
|
}
|
|
8547
|
-
._Puck--
|
|
9667
|
+
._Puck--hidePlugins_tzaxg_73 ._PuckLayout-inner_tzaxg_40 {
|
|
8548
9668
|
--puck-pluginbar-width: 0;
|
|
8549
9669
|
}
|
|
8550
9670
|
}
|
|
8551
|
-
._PuckLayout--
|
|
9671
|
+
._PuckLayout--mounted_tzaxg_78 ._PuckLayout-inner_tzaxg_40 {
|
|
8552
9672
|
--puck-sidebar-width: 186px;
|
|
8553
9673
|
}
|
|
8554
|
-
._PuckLayout--
|
|
9674
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
8555
9675
|
grid-template-rows: 0 auto 30% 0 var(--puck-pluginbar-width);
|
|
8556
9676
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
8557
9677
|
}
|
|
8558
|
-
._PuckLayout--
|
|
9678
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8559
9679
|
grid-template-rows: 0 auto 55% 0 var(--puck-pluginbar-width);
|
|
8560
9680
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
8561
9681
|
}
|
|
8562
9682
|
@media (min-width: 638px) {
|
|
8563
|
-
._PuckLayout--
|
|
9683
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
8564
9684
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
8565
9685
|
grid-template-rows: min-content auto;
|
|
8566
9686
|
}
|
|
8567
9687
|
}
|
|
8568
|
-
._PuckLayout--
|
|
8569
|
-
._PuckLayout--
|
|
9688
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9689
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8570
9690
|
grid-template-rows: 0 auto min-content 0 var(--puck-pluginbar-width);
|
|
8571
9691
|
}
|
|
8572
9692
|
@media (min-width: 638px) {
|
|
8573
|
-
._PuckLayout--
|
|
8574
|
-
._PuckLayout--
|
|
8575
|
-
._PuckLayout--
|
|
8576
|
-
._PuckLayout--
|
|
9693
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9694
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40,
|
|
9695
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9696
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8577
9697
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
8578
9698
|
grid-template-rows: min-content auto;
|
|
8579
9699
|
}
|
|
8580
9700
|
}
|
|
8581
9701
|
@media (min-width: 638px) {
|
|
8582
|
-
._PuckLayout--
|
|
9702
|
+
._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
8583
9703
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) var(--puck-sidebar-right-width);
|
|
8584
9704
|
}
|
|
8585
9705
|
}
|
|
8586
9706
|
@media (min-width: 638px) {
|
|
8587
|
-
._PuckLayout--
|
|
9707
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
8588
9708
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) var(--puck-sidebar-right-width);
|
|
8589
9709
|
}
|
|
8590
9710
|
}
|
|
8591
9711
|
@media (min-width: 458px) {
|
|
8592
|
-
._PuckLayout-
|
|
9712
|
+
._PuckLayout-mounted_tzaxg_156 ._PuckLayout-inner_tzaxg_40 {
|
|
8593
9713
|
--puck-frame-width: minmax(266px, auto);
|
|
8594
9714
|
}
|
|
8595
9715
|
}
|
|
8596
9716
|
@media (min-width: 638px) {
|
|
8597
|
-
.
|
|
9717
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8598
9718
|
--puck-sidebar-width: minmax(186px, 250px);
|
|
8599
9719
|
}
|
|
8600
9720
|
}
|
|
8601
9721
|
@media (min-width: 766px) {
|
|
8602
|
-
.
|
|
9722
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8603
9723
|
--puck-frame-width: auto;
|
|
8604
9724
|
}
|
|
8605
9725
|
}
|
|
8606
9726
|
@media (min-width: 990px) {
|
|
8607
|
-
.
|
|
9727
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8608
9728
|
--puck-sidebar-width: 256px;
|
|
8609
9729
|
}
|
|
8610
9730
|
}
|
|
8611
9731
|
@media (min-width: 1198px) {
|
|
8612
|
-
.
|
|
9732
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8613
9733
|
--puck-sidebar-width: 274px;
|
|
8614
9734
|
}
|
|
8615
9735
|
}
|
|
8616
9736
|
@media (min-width: 1398px) {
|
|
8617
|
-
.
|
|
9737
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8618
9738
|
--puck-sidebar-width: 290px;
|
|
8619
9739
|
}
|
|
8620
9740
|
}
|
|
8621
9741
|
@media (min-width: 1598px) {
|
|
8622
|
-
.
|
|
9742
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8623
9743
|
--puck-sidebar-width: 320px;
|
|
8624
9744
|
}
|
|
8625
9745
|
}
|
|
8626
|
-
._PuckLayout-
|
|
9746
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
8627
9747
|
border-top: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
8628
9748
|
background-color: var( --puck-pluginbar-color-bg, var(--puck-color-surface-subtle) );
|
|
8629
9749
|
grid-area: sidenav;
|
|
@@ -8631,35 +9751,39 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8631
9751
|
width: 100%;
|
|
8632
9752
|
}
|
|
8633
9753
|
@media (min-width: 638px) {
|
|
8634
|
-
._PuckLayout-
|
|
9754
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
8635
9755
|
border-top: 0;
|
|
8636
9756
|
border-right: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
8637
9757
|
box-sizing: border-box;
|
|
8638
9758
|
}
|
|
8639
9759
|
}
|
|
8640
|
-
._PuckLayout-
|
|
9760
|
+
._PuckLayout-header_tzaxg_217 {
|
|
8641
9761
|
grid-area: header;
|
|
8642
9762
|
}
|
|
8643
|
-
._PuckLayout--
|
|
9763
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
8644
9764
|
overflow: hidden;
|
|
8645
9765
|
}
|
|
8646
9766
|
@media (min-width: 638px) {
|
|
8647
|
-
._PuckLayout--
|
|
9767
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
8648
9768
|
overflow: auto;
|
|
8649
9769
|
}
|
|
8650
9770
|
}
|
|
8651
|
-
.
|
|
9771
|
+
._PuckPluginTab_tzaxg_231 {
|
|
8652
9772
|
display: none;
|
|
8653
9773
|
flex-grow: 1;
|
|
8654
9774
|
max-height: 100%;
|
|
8655
9775
|
}
|
|
8656
|
-
._PuckPluginTab--
|
|
9776
|
+
._PuckPluginTab--visible_tzaxg_237 {
|
|
8657
9777
|
display: flex;
|
|
8658
9778
|
flex-direction: column;
|
|
9779
|
+
min-height: 0;
|
|
8659
9780
|
}
|
|
8660
|
-
._PuckPluginTab-
|
|
9781
|
+
._PuckPluginTab-body_tzaxg_243 {
|
|
9782
|
+
display: flex;
|
|
9783
|
+
flex-direction: column;
|
|
8661
9784
|
flex-grow: 1;
|
|
8662
9785
|
max-height: 100%;
|
|
9786
|
+
min-height: 0;
|
|
8663
9787
|
}
|
|
8664
9788
|
|
|
8665
9789
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css/#css-module-data */
|
|
@@ -9300,11 +10424,13 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
9300
10424
|
}
|
|
9301
10425
|
|
|
9302
10426
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css/#css-module-data */
|
|
9303
|
-
.
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
10427
|
+
._OutlinePlugin_1ylsc_1 {
|
|
10428
|
+
display: flex;
|
|
10429
|
+
flex-direction: column;
|
|
10430
|
+
flex-grow: 1;
|
|
10431
|
+
min-height: 0;
|
|
10432
|
+
min-width: 0;
|
|
10433
|
+
position: relative;
|
|
9308
10434
|
}
|
|
9309
10435
|
|
|
9310
10436
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css/#css-module-data */
|
|
@@ -9326,7 +10452,7 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
9326
10452
|
padding: var(--puck-space-4);
|
|
9327
10453
|
}
|
|
9328
10454
|
}`;
|
|
9329
|
-
var iframeInteractionStyles = '/* styles/color.css */\n@layer puck-tokens {\n :root {\n --puck-color-rose-01: #4a001c;\n --puck-color-rose-02: #670833;\n --puck-color-rose-03: #87114c;\n --puck-color-rose-04: #a81a66;\n --puck-color-rose-05: #bc5089;\n --puck-color-rose-06: #cc7ca5;\n --puck-color-rose-07: #d89aba;\n --puck-color-rose-08: #e3b8cf;\n --puck-color-rose-09: #efd6e3;\n --puck-color-rose-10: #f6eaf1;\n --puck-color-rose-11: #faf4f8;\n --puck-color-rose-12: #fef8fc;\n --puck-color-azure-01: #00175d;\n --puck-color-azure-02: #002c77;\n --puck-color-azure-03: #014292;\n --puck-color-azure-04: #0158ad;\n --puck-color-azure-05: #3479be;\n --puck-color-azure-06: #6499cf;\n --puck-color-azure-07: #88b0da;\n --puck-color-azure-08: #abc7e5;\n --puck-color-azure-09: #cfdff0;\n --puck-color-azure-10: #e7eef7;\n --puck-color-azure-11: #f3f6fb;\n --puck-color-azure-12: #f7faff;\n --puck-color-green-01: #002000;\n --puck-color-green-02: #043604;\n --puck-color-green-03: #084e08;\n --puck-color-green-04: #0c680c;\n --puck-color-green-05: #1d882f;\n --puck-color-green-06: #2faa53;\n --puck-color-green-07: #56c16f;\n --puck-color-green-08: #7dd78b;\n --puck-color-green-09: #b8e8bf;\n --puck-color-green-10: #ddf3e0;\n --puck-color-green-11: #eff8f0;\n --puck-color-green-12: #f3fcf4;\n --puck-color-yellow-01: #211000;\n --puck-color-yellow-02: #362700;\n --puck-color-yellow-03: #4c4000;\n --puck-color-yellow-04: #645a00;\n --puck-color-yellow-05: #877614;\n --puck-color-yellow-06: #ab9429;\n --puck-color-yellow-07: #bfac4e;\n --puck-color-yellow-08: #d4c474;\n --puck-color-yellow-09: #e6deb1;\n --puck-color-yellow-10: #f3efd9;\n --puck-color-yellow-11: #f9f7ed;\n --puck-color-yellow-12: #fcfaf0;\n --puck-color-red-01: #4c0000;\n --puck-color-red-02: #6a0a10;\n --puck-color-red-03: #8a1422;\n --puck-color-red-04: #ac1f35;\n --puck-color-red-05: #bf5366;\n --puck-color-red-06: #ce7e8e;\n --puck-color-red-07: #d99ca8;\n --puck-color-red-08: #e4b9c2;\n --puck-color-red-09: #efd7db;\n --puck-color-red-10: #f6eaec;\n --puck-color-red-11: #faf4f5;\n --puck-color-red-12: #fff9fa;\n --puck-color-grey-01: #181818;\n --puck-color-grey-02: #292929;\n --puck-color-grey-03: #404040;\n --puck-color-grey-04: #5a5a5a;\n --puck-color-grey-05: #767676;\n --puck-color-grey-06: #949494;\n --puck-color-grey-07: #ababab;\n --puck-color-grey-08: #c3c3c3;\n --puck-color-grey-09: #dcdcdc;\n --puck-color-grey-10: #efefef;\n --puck-color-grey-11: #f5f5f5;\n --puck-color-grey-12: #fafafa;\n --puck-color-black: #000000;\n --puck-color-white: #ffffff;\n }\n}\n\n/* styles/tokens.css */\n@layer puck-tokens {\n :root {\n --puck-color-surface: var(--puck-color-white);\n --puck-color-surface-muted: var(--puck-color-grey-11);\n --puck-color-surface-subtle: var(--puck-color-grey-12);\n --puck-color-surface-inverse: var(--puck-color-grey-01);\n --puck-color-border: var(--puck-color-grey-09);\n --puck-color-border-hover: var(--puck-color-grey-05);\n --puck-color-border-muted: var(--puck-color-grey-10);\n --puck-color-border-inverse: var(--puck-color-grey-05);\n --puck-color-text: var(--puck-color-black);\n --puck-color-text-secondary: var(--puck-color-grey-04);\n --puck-color-text-muted: var(--puck-color-grey-05);\n --puck-color-text-subtle: var(--puck-color-grey-07);\n --puck-color-text-inverse: var(--puck-color-white);\n --puck-opacity-text-inverse: 0.75;\n --puck-color-interactive: var(--puck-color-azure-04);\n --puck-color-interactive-hover: var(--puck-color-azure-03);\n --puck-color-interactive-active: var(--puck-color-azure-02);\n --puck-color-interactive-subtle: var(--puck-color-azure-10);\n --puck-color-interactive-soft: var(--puck-color-azure-11);\n --puck-color-interactive-soft-hover: var(--puck-color-azure-12);\n --puck-color-interactive-neutral-hover: var(--puck-color-grey-10);\n --puck-color-interactive-inverse-hover: var(--puck-color-azure-06);\n --puck-color-interactive-inverse-active: var(--puck-color-azure-07);\n --puck-color-focus-ring: var(--puck-color-azure-05);\n --puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );\n --puck-color-selection-border: var(--puck-color-azure-08);\n --puck-color-highlight: var(--puck-color-rose-07);\n --puck-color-bg-disabled: var(--puck-color-grey-07);\n --puck-color-text-disabled: var(--puck-color-grey-03);\n --puck-color-overlay-backdrop: color-mix( in srgb, var(--puck-color-black) 75%, transparent );\n --puck-space-1: 4px;\n --puck-space-2: 8px;\n --puck-space-3: 12px;\n --puck-space-4: 16px;\n --puck-space-5: 24px;\n --puck-space-chrome-gutter: var(--puck-space-4);\n --puck-radius-none: 0;\n --puck-radius-xs: 2px;\n --puck-radius-s: 3px;\n --puck-radius-m: 4px;\n --puck-radius-l: 8px;\n --puck-radius-pill: 30px;\n --puck-radius-round: 100%;\n --puck-border-width-hairline: 0.5px;\n --puck-border-width-regular: 1px;\n --puck-border-width-focus: 2px;\n --puck-border-width-strong: 4px;\n --puck-duration-fast: 50ms;\n --puck-duration-medium: 150ms;\n --puck-duration-slow: 250ms;\n --puck-ease-exit: ease-in;\n --puck-ease-emphasized: ease-in-out;\n --puck-ease-entrance: ease-out;\n --puck-font-weight-regular: 400;\n --puck-font-weight-medium: 500;\n --puck-font-weight-semibold: 600;\n --puck-font-weight-bold: 700;\n --puck-font-weight-heavy: 800;\n --puck-letter-spacing-ui: 0.05ch;\n --puck-letter-spacing-heading: 0.08ch;\n --puck-icon-size-s: 16px;\n --puck-icon-size-m: 18px;\n --puck-icon-size-l: 24px;\n --puck-space-m-unitless: 24;\n --puck-user-sidebar-left-width: var(--puck-sidebar-width);\n --puck-user-sidebar-right-width: var(--puck-sidebar-width);\n --puck-slot-min-empty-height: 128px;\n }\n}\n\n/* styles/typography.css */\n@layer puck-tokens {\n :root {\n --puck-font-size-scale-base-unitless: 12;\n --puck-font-size-xxxs-unitless: 12;\n --puck-font-size-xxs-unitless: 14;\n --puck-font-size-xs-unitless: 16;\n --puck-font-size-s-unitless: 18;\n --puck-font-size-m-unitless: 21;\n --puck-font-size-l-unitless: 24;\n --puck-font-size-xl-unitless: 28;\n --puck-font-size-xxl-unitless: 36;\n --puck-font-size-xxxl-unitless: 48;\n --puck-font-size-xxxxl-unitless: 56;\n --puck-font-size-xxxs: calc( 1rem * var(--puck-font-size-xxxs-unitless) / 16 );\n --puck-font-size-xxs: calc(1rem * var(--puck-font-size-xxs-unitless) / 16);\n --puck-font-size-xs: calc(1rem * var(--puck-font-size-xs-unitless) / 16);\n --puck-font-size-s: calc(1rem * var(--puck-font-size-s-unitless) / 16);\n --puck-font-size-m: calc(1rem * var(--puck-font-size-m-unitless) / 16);\n --puck-font-size-l: calc(1rem * var(--puck-font-size-l-unitless) / 16);\n --puck-font-size-xl: calc(1rem * var(--puck-font-size-xl-unitless) / 16);\n --puck-font-size-xxl: calc(1rem * var(--puck-font-size-xxl-unitless) / 16);\n --puck-font-size-xxxl: calc( 1rem * var(--puck-font-size-xxxl-unitless) / 16 );\n --puck-font-size-xxxxl: calc( 1rem * var(--puck-font-size-xxxxl-unitless) / 16 );\n --puck-font-size-base: var(--puck-font-size-xs);\n --puck-line-height-reset: 1;\n --puck-line-height-xs: calc( var(--puck-space-m-unitless) / var(--puck-font-size-m-unitless) );\n --puck-line-height-s: calc( var(--puck-space-m-unitless) / var(--puck-font-size-s-unitless) );\n --puck-line-height-m: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xs-unitless) );\n --puck-line-height-l: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xxs-unitless) );\n --puck-line-height-xl: calc( var(--puck-space-m-unitless) / var(--puck-font-size-scale-base-unitless) );\n --puck-line-height-base: var(--puck-line-height-m);\n --puck-fallback-font-stack:\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Helvetica Neue,\n sans-serif,\n Apple Color Emoji,\n Segoe UI Emoji,\n Segoe UI Symbol;\n --puck-font-family: Inter, var(--puck-fallback-font-stack);\n --puck-font-family-monospaced:\n ui-monospace,\n "Cascadia Code",\n "Source Code Pro",\n Menlo,\n Consolas,\n "DejaVu Sans Mono",\n monospace;\n }\n @supports (font-variation-settings: normal) {\n :root {\n --puck-font-family: InterVariable, var(--puck-fallback-font-stack);\n }\n }\n}\n\n/* bundle/core.css */\n:root {\n --_puck-styles-loaded: "true";\n}\n#frame-root {\n height: 1px;\n min-height: 100vh;\n}\n[data-puck-entry] {\n position: relative;\n z-index: 0;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */\n._ActionBar_5vdfr_1 {\n align-items: center;\n cursor: default;\n display: flex;\n width: auto;\n padding-top: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-bottom: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-inline-start: var(--puck-actionbar-space-x, 0);\n padding-inline-end: var(--puck-actionbar-space-x, 0);\n border-radius: var(--puck-actionbar-radius, var(--puck-radius-l));\n background: var(--puck-actionbar-color-bg, var(--puck-color-surface-inverse));\n color: var(--puck-color-text-inverse);\n font-family: var(--puck-font-family);\n min-height: 26px;\n}\n._ActionBar-label_5vdfr_17 {\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n font-weight: var(--puck-font-weight-medium);\n padding-inline-start: var(--puck-space-2);\n padding-inline-end: var(--puck-space-2);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {\n padding-inline-start: 0;\n}\n._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {\n margin-inline-start: calc(var(--puck-space-1) * -1);\n}\n._ActionBar-group_5vdfr_38 {\n align-items: center;\n border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));\n display: flex;\n height: 100%;\n padding-inline-start: var(--puck-space-1);\n padding-inline-end: var(--puck-space-1);\n}\n._ActionBar-group_5vdfr_38:first-of-type {\n border-inline-start: 0;\n}\n._ActionBar-group_5vdfr_38:empty {\n display: none;\n}\n._ActionBarAction_5vdfr_30 {\n background: transparent;\n border: none;\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n cursor: pointer;\n padding: var(--puck-actionbar-action-space, 6px);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n border-radius: var(--puck-radius-m);\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._ActionBarAction--disabled_5vdfr_74 {\n cursor: auto;\n color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );\n opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);\n}\n._ActionBarAction_5vdfr_30 svg {\n max-width: none !important;\n}\n._ActionBarAction_5vdfr_30:focus-visible {\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: calc(var(--puck-border-width-focus) * -1);\n}\n@media (hover: hover) and (pointer: fine) {\n ._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {\n color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );\n opacity: 1;\n transition: none;\n }\n}\n._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),\n._ActionBarAction--active_5vdfr_104 {\n color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );\n opacity: 1;\n transition: none;\n}\n._ActionBar-group_5vdfr_38 * {\n margin: 0;\n}\n._ActionBar-separator_5vdfr_117 {\n background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );\n margin-inline: var(--puck-space-1);\n width: var( --puck-border-width-hairline );\n height: 100%;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */\n._DraggableComponent_1627v_1 {\n position: absolute;\n pointer-events: none;\n}\n._DraggableComponent-overlayWrapper_1627v_6 {\n height: 100%;\n width: 100%;\n top: 0;\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 1;\n}\n._DraggableComponent-overlay_1627v_6 {\n cursor: pointer;\n height: 100%;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DraggableComponent_1627v_1:focus-visible > ._DraggableComponent-overlayWrapper_1627v_6 {\n outline: var(--puck-border-width-regular) solid var(--puck-color-focus-ring);\n}\n._DraggableComponent-loadingOverlay_1627v_38 {\n background: var(--puck-color-surface);\n color: var(--puck-color-text);\n border-radius: var(--puck-radius-m);\n display: flex;\n padding: var(--puck-space-2);\n top: var(--puck-space-2);\n right: var(--puck-space-2);\n position: absolute;\n z-index: 1;\n pointer-events: all;\n box-sizing: border-box;\n opacity: 0.8;\n z-index: 1;\n}\n._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n background: var( --puck-slot-component-color-overlay, var(--puck-color-selection-bg) );\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n}\n._DraggableComponent--isSelected_1627v_72 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n outline-color: var( --puck-slot-component-color-border-selected, var(--puck-color-selection-border) );\n}\n._DraggableComponent_1627v_1:has(._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6) > ._DraggableComponent-overlayWrapper_1627v_6 {\n display: none;\n}\n._DraggableComponent-actionsOverlay_1627v_89 {\n position: sticky;\n opacity: 0;\n pointer-events: none;\n z-index: 2;\n}\n._DraggableComponent--isSelected_1627v_72 ._DraggableComponent-actionsOverlay_1627v_89 {\n opacity: 1;\n pointer-events: auto;\n}\n._DraggableComponent-actions_1627v_89 {\n position: absolute;\n width: auto;\n cursor: grab;\n display: flex;\n box-sizing: border-box;\n transform-origin: right top;\n min-height: 36px;\n}\n._DraggableComponent-actionsAction_1627v_111 {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */\n._Drawer_1n90m_1 {\n display: flex;\n flex-direction: column;\n font-family: var(--puck-font-family);\n gap: var(--puck-space-3);\n}\n._Drawer-draggable_1n90m_8 {\n position: relative;\n}\n._Drawer-draggableBg_1n90m_12 {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n z-index: -1;\n}\n._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-drawer-item-color-bg, var(--puck-color-surface));\n color: var(--puck-drawer-item-color-text, var(--puck-color-text));\n cursor: grab;\n padding: var(--puck-drawer-item-space, var(--puck-space-3));\n display: flex;\n border: var(--puck-drawer-item-border-width, var(--puck-border-width-regular)) var(--puck-drawer-item-color-border, var(--puck-color-border)) solid;\n border-radius: var(--puck-drawer-item-radius, var(--puck-radius-m));\n font-size: var(--puck-drawer-item-font-size, var(--puck-font-size-xxs));\n justify-content: space-between;\n align-items: center;\n transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._DrawerItem--disabled_1n90m_38 ._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-color-surface-muted);\n color: var(--puck-color-text-muted);\n cursor: not-allowed;\n}\n._DrawerItem_1n90m_22:focus-visible {\n outline: 0;\n}\n._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:focus-visible ._DrawerItem-draggable_1n90m_22 {\n border-radius: var(--puck-radius-m);\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: var(--puck-border-width-focus);\n}\n@media (hover: hover) and (pointer: fine) {\n ._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:not(._DrawerItem--disabled_1n90m_38) ._DrawerItem-draggable_1n90m_22:hover {\n background-color: var( --puck-drawer-item-color-bg-hover, var(--puck-color-interactive-soft-hover) );\n color: var( --puck-drawer-item-color-text-hover, var(--puck-color-interactive) );\n transition: none;\n }\n}\n._DrawerItem-name_1n90m_72 {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css/#css-module-data */\n._DropZone_ybznu_1 {\n position: relative;\n height: 100%;\n min-height: var(--puck-slot-min-empty-height);\n outline-offset: calc(var(--puck-slot-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DropZone--hasChildren_ybznu_11 {\n min-height: 0;\n}\n._DropZone_ybznu_1:empty {\n min-height: var(--puck-slot-min-empty-height);\n}\n[data-puck-entry]:not([data-puck-dragging]) ._DropZone_ybznu_1 {\n transition: min-height var(--puck-duration-medium) var(--puck-ease-exit);\n}\n._DropZone--isAreaSelected_ybznu_24,\n._DropZone--hoveringOverArea_ybznu_25:not(._DropZone--isRootZone_ybznu_25) {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1:empty {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone-item_ybznu_39 {\n position: relative;\n}\n._DropZone-hitbox_ybznu_43 {\n position: absolute;\n bottom: calc(var(--puck-space-3) * -1);\n height: var(--puck-space-5);\n width: 100%;\n z-index: 1;\n}\n[data-puck-dragging] ._DropZone--isEnabled_ybznu_51 {\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1 > *:not([data-puck-component]) {\n opacity: 0;\n}\nbody:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {\n opacity: 0 !important;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */\n._InlineTextField_104qp_1 {\n cursor: text;\n display: inline-block;\n white-space: pre-wrap;\n text-decoration: inherit;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1 {\n cursor: none;\n caret-color: transparent;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1::selection {\n display: none;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */\n@keyframes _loader-animation_1w5zn_1 {\n 0% {\n transform: rotate(0deg) scale(1);\n }\n 50% {\n transform: rotate(180deg) scale(0.8);\n }\n 100% {\n transform: rotate(360deg) scale(1);\n }\n}\n._Loader_1w5zn_13 {\n background: transparent;\n border-radius: var(--puck-radius-round);\n border: var(--puck-border-width-focus) solid currentColor;\n border-bottom-color: transparent;\n display: inline-block;\n animation: _loader-animation_1w5zn_1 1s 0s infinite linear;\n animation-fill-mode: both;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */\n._RichTextMenu_1ve2j_1 {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n}\n._RichTextMenu--form_1ve2j_7 {\n border-top-left-radius: var(--puck-field-radius, var(--puck-radius-m));\n border-top-right-radius: var(--puck-field-radius, var(--puck-radius-m));\n padding: var(--puck-field-richtext-menu-space-y, 6px) var(--puck-field-richtext-menu-space-x, 6px);\n background-color: var( --puck-field-richtext-menu-color-bg, var(--puck-color-surface-subtle) );\n position: relative;\n scrollbar-width: none;\n overflow-x: auto;\n}\n._RichTextMenu-group_1ve2j_21 {\n display: flex;\n align-items: space-between;\n flex-direction: row;\n flex-wrap: nowrap;\n padding-inline: 6px;\n gap: 2px;\n position: relative;\n}\n._RichTextMenu-group_1ve2j_21:first-of-type {\n padding-left: 0;\n}\n._RichTextMenu-group_1ve2j_21:last-of-type {\n padding-right: 0;\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 {\n color: var(--puck-color-text-inverse);\n gap: 0px;\n flex-wrap: nowrap;\n}\n._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-regular) solid var( --puck-field-richtext-menu-color-separator, var(--puck-color-border-muted) );\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-hairline) solid var(--puck-color-border-inverse);\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */\n._Control_id4pm_1 .lucide {\n height: var(--puck-icon-size-m);\n width: var(--puck-icon-size-m);\n}\n._Control--inline_id4pm_6 .lucide {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* components/DraggableComponent/styles.css */\n[data-puck-component] * {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-component] {\n cursor: grab;\n pointer-events: auto !important;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-dropzone] {\n pointer-events: auto !important;\n}\n[data-puck-disabled] {\n cursor: pointer;\n}\n[data-dnd-placeholder] {\n background: var( --puck-slot-component-color-placeholder, var(--puck-color-azure-06) ) !important;\n border: none !important;\n color: transparent !important;\n opacity: 0.3 !important;\n outline: none !important;\n transition: none !important;\n}\n[data-dnd-placeholder] *,\n[data-dnd-placeholder]::after,\n[data-dnd-placeholder]::before {\n opacity: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] {\n pointer-events: none !important;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var(--puck-slot-component-color-border-dragging, var(--puck-color-azure-09)) solid !important;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1) !important;\n}\n[data-dnd-dragging][data-puck-component] > :first-child {\n margin-top: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] > :last-child {\n margin-bottom: 0 !important;\n}\n\n/* lib/overlay-portal/styles.css */\n[data-puck-overlay-portal],\n[data-puck-overlay-portal] * {\n pointer-events: auto !important;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:hover {\n outline: 2px var(--puck-color-azure-09, #cfdff0) dashed;\n outline-offset: 2px;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:focus-within {\n outline: 2px var(--puck-color-azure-07, #88b0da) dashed;\n outline-offset: 2px;\n}';
|
|
10455
|
+
var iframeInteractionStyles = '/* styles/color.css */\n@layer puck-tokens {\n :root {\n --puck-color-rose-01: #4a001c;\n --puck-color-rose-02: #670833;\n --puck-color-rose-03: #87114c;\n --puck-color-rose-04: #a81a66;\n --puck-color-rose-05: #bc5089;\n --puck-color-rose-06: #cc7ca5;\n --puck-color-rose-07: #d89aba;\n --puck-color-rose-08: #e3b8cf;\n --puck-color-rose-09: #efd6e3;\n --puck-color-rose-10: #f6eaf1;\n --puck-color-rose-11: #faf4f8;\n --puck-color-rose-12: #fef8fc;\n --puck-color-azure-01: #00175d;\n --puck-color-azure-02: #002c77;\n --puck-color-azure-03: #014292;\n --puck-color-azure-04: #0158ad;\n --puck-color-azure-05: #3479be;\n --puck-color-azure-06: #6499cf;\n --puck-color-azure-07: #88b0da;\n --puck-color-azure-08: #abc7e5;\n --puck-color-azure-09: #cfdff0;\n --puck-color-azure-10: #e7eef7;\n --puck-color-azure-11: #f3f6fb;\n --puck-color-azure-12: #f7faff;\n --puck-color-green-01: #002000;\n --puck-color-green-02: #043604;\n --puck-color-green-03: #084e08;\n --puck-color-green-04: #0c680c;\n --puck-color-green-05: #1d882f;\n --puck-color-green-06: #2faa53;\n --puck-color-green-07: #56c16f;\n --puck-color-green-08: #7dd78b;\n --puck-color-green-09: #b8e8bf;\n --puck-color-green-10: #ddf3e0;\n --puck-color-green-11: #eff8f0;\n --puck-color-green-12: #f3fcf4;\n --puck-color-yellow-01: #211000;\n --puck-color-yellow-02: #362700;\n --puck-color-yellow-03: #4c4000;\n --puck-color-yellow-04: #645a00;\n --puck-color-yellow-05: #877614;\n --puck-color-yellow-06: #ab9429;\n --puck-color-yellow-07: #bfac4e;\n --puck-color-yellow-08: #d4c474;\n --puck-color-yellow-09: #e6deb1;\n --puck-color-yellow-10: #f3efd9;\n --puck-color-yellow-11: #f9f7ed;\n --puck-color-yellow-12: #fcfaf0;\n --puck-color-red-01: #4c0000;\n --puck-color-red-02: #6a0a10;\n --puck-color-red-03: #8a1422;\n --puck-color-red-04: #ac1f35;\n --puck-color-red-05: #bf5366;\n --puck-color-red-06: #ce7e8e;\n --puck-color-red-07: #d99ca8;\n --puck-color-red-08: #e4b9c2;\n --puck-color-red-09: #efd7db;\n --puck-color-red-10: #f6eaec;\n --puck-color-red-11: #faf4f5;\n --puck-color-red-12: #fff9fa;\n --puck-color-grey-01: #181818;\n --puck-color-grey-02: #292929;\n --puck-color-grey-03: #404040;\n --puck-color-grey-04: #5a5a5a;\n --puck-color-grey-05: #767676;\n --puck-color-grey-06: #949494;\n --puck-color-grey-07: #ababab;\n --puck-color-grey-08: #c3c3c3;\n --puck-color-grey-09: #dcdcdc;\n --puck-color-grey-10: #efefef;\n --puck-color-grey-11: #f5f5f5;\n --puck-color-grey-12: #fafafa;\n --puck-color-black: #000000;\n --puck-color-white: #ffffff;\n }\n}\n\n/* styles/tokens.css */\n@layer puck-tokens {\n :root {\n --puck-color-surface: var(--puck-color-white);\n --puck-color-surface-muted: var(--puck-color-grey-11);\n --puck-color-surface-subtle: var(--puck-color-grey-12);\n --puck-color-surface-inverse: var(--puck-color-grey-01);\n --puck-color-border: var(--puck-color-grey-09);\n --puck-color-border-hover: var(--puck-color-grey-05);\n --puck-color-border-muted: var(--puck-color-grey-10);\n --puck-color-border-inverse: var(--puck-color-grey-05);\n --puck-color-text: var(--puck-color-black);\n --puck-color-text-secondary: var(--puck-color-grey-04);\n --puck-color-text-muted: var(--puck-color-grey-05);\n --puck-color-text-subtle: var(--puck-color-grey-07);\n --puck-color-text-inverse: var(--puck-color-white);\n --puck-opacity-text-inverse: 0.75;\n --puck-color-interactive: var(--puck-color-azure-04);\n --puck-color-interactive-hover: var(--puck-color-azure-03);\n --puck-color-interactive-active: var(--puck-color-azure-02);\n --puck-color-interactive-subtle: var(--puck-color-azure-10);\n --puck-color-interactive-soft: var(--puck-color-azure-11);\n --puck-color-interactive-soft-hover: var(--puck-color-azure-12);\n --puck-color-interactive-neutral-hover: var(--puck-color-grey-10);\n --puck-color-interactive-inverse-hover: var(--puck-color-azure-06);\n --puck-color-interactive-inverse-active: var(--puck-color-azure-07);\n --puck-color-focus-ring: var(--puck-color-azure-05);\n --puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );\n --puck-color-selection-border: var(--puck-color-azure-08);\n --puck-color-insertion-indicator: var(--puck-color-azure-06);\n --puck-color-highlight: var(--puck-color-rose-07);\n --puck-color-bg-disabled: var(--puck-color-grey-07);\n --puck-color-text-disabled: var(--puck-color-grey-03);\n --puck-color-overlay-backdrop: color-mix( in srgb, var(--puck-color-black) 75%, transparent );\n --puck-space-1: 4px;\n --puck-space-2: 8px;\n --puck-space-3: 12px;\n --puck-space-4: 16px;\n --puck-space-5: 24px;\n --puck-space-chrome-gutter: var(--puck-space-4);\n --puck-radius-none: 0;\n --puck-radius-xs: 2px;\n --puck-radius-s: 3px;\n --puck-radius-m: 4px;\n --puck-radius-l: 8px;\n --puck-radius-pill: 30px;\n --puck-radius-round: 100%;\n --puck-border-width-hairline: 0.5px;\n --puck-border-width-regular: 1px;\n --puck-border-width-focus: 2px;\n --puck-border-width-strong: 4px;\n --puck-duration-fast: 50ms;\n --puck-duration-medium: 150ms;\n --puck-duration-slow: 250ms;\n --puck-ease-exit: ease-in;\n --puck-ease-emphasized: ease-in-out;\n --puck-ease-entrance: ease-out;\n --puck-font-weight-regular: 400;\n --puck-font-weight-medium: 500;\n --puck-font-weight-semibold: 600;\n --puck-font-weight-bold: 700;\n --puck-font-weight-heavy: 800;\n --puck-letter-spacing-ui: 0.05ch;\n --puck-letter-spacing-heading: 0.08ch;\n --puck-icon-size-xs: 14px;\n --puck-icon-size-s: 16px;\n --puck-icon-size-m: 18px;\n --puck-icon-size-l: 24px;\n --puck-space-m-unitless: 24;\n --puck-user-sidebar-left-width: var(--puck-sidebar-width);\n --puck-user-sidebar-right-width: var(--puck-sidebar-width);\n --puck-slot-min-empty-height: 128px;\n }\n}\n\n/* styles/typography.css */\n@layer puck-tokens {\n :root {\n --puck-font-size-scale-base-unitless: 12;\n --puck-font-size-xxxs-unitless: 12;\n --puck-font-size-xxs-unitless: 14;\n --puck-font-size-xs-unitless: 16;\n --puck-font-size-s-unitless: 18;\n --puck-font-size-m-unitless: 21;\n --puck-font-size-l-unitless: 24;\n --puck-font-size-xl-unitless: 28;\n --puck-font-size-xxl-unitless: 36;\n --puck-font-size-xxxl-unitless: 48;\n --puck-font-size-xxxxl-unitless: 56;\n --puck-font-size-xxxs: calc( 1rem * var(--puck-font-size-xxxs-unitless) / 16 );\n --puck-font-size-xxs: calc(1rem * var(--puck-font-size-xxs-unitless) / 16);\n --puck-font-size-xs: calc(1rem * var(--puck-font-size-xs-unitless) / 16);\n --puck-font-size-s: calc(1rem * var(--puck-font-size-s-unitless) / 16);\n --puck-font-size-m: calc(1rem * var(--puck-font-size-m-unitless) / 16);\n --puck-font-size-l: calc(1rem * var(--puck-font-size-l-unitless) / 16);\n --puck-font-size-xl: calc(1rem * var(--puck-font-size-xl-unitless) / 16);\n --puck-font-size-xxl: calc(1rem * var(--puck-font-size-xxl-unitless) / 16);\n --puck-font-size-xxxl: calc( 1rem * var(--puck-font-size-xxxl-unitless) / 16 );\n --puck-font-size-xxxxl: calc( 1rem * var(--puck-font-size-xxxxl-unitless) / 16 );\n --puck-font-size-base: var(--puck-font-size-xs);\n --puck-line-height-reset: 1;\n --puck-line-height-xs: calc( var(--puck-space-m-unitless) / var(--puck-font-size-m-unitless) );\n --puck-line-height-s: calc( var(--puck-space-m-unitless) / var(--puck-font-size-s-unitless) );\n --puck-line-height-m: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xs-unitless) );\n --puck-line-height-l: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xxs-unitless) );\n --puck-line-height-xl: calc( var(--puck-space-m-unitless) / var(--puck-font-size-scale-base-unitless) );\n --puck-line-height-base: var(--puck-line-height-m);\n --puck-fallback-font-stack:\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Helvetica Neue,\n sans-serif,\n Apple Color Emoji,\n Segoe UI Emoji,\n Segoe UI Symbol;\n --puck-font-family: Inter, var(--puck-fallback-font-stack);\n --puck-font-family-monospaced:\n ui-monospace,\n "Cascadia Code",\n "Source Code Pro",\n Menlo,\n Consolas,\n "DejaVu Sans Mono",\n monospace;\n }\n @supports (font-variation-settings: normal) {\n :root {\n --puck-font-family: InterVariable, var(--puck-fallback-font-stack);\n }\n }\n}\n\n/* bundle/core.css */\n:root {\n --_puck-styles-loaded: "true";\n}\n#frame-root {\n height: 1px;\n min-height: 100vh;\n}\n[data-puck-entry] {\n position: relative;\n z-index: 0;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */\n._ActionBar_5vdfr_1 {\n align-items: center;\n cursor: default;\n display: flex;\n width: auto;\n padding-top: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-bottom: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-inline-start: var(--puck-actionbar-space-x, 0);\n padding-inline-end: var(--puck-actionbar-space-x, 0);\n border-radius: var(--puck-actionbar-radius, var(--puck-radius-l));\n background: var(--puck-actionbar-color-bg, var(--puck-color-surface-inverse));\n color: var(--puck-color-text-inverse);\n font-family: var(--puck-font-family);\n min-height: 26px;\n}\n._ActionBar-label_5vdfr_17 {\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n font-weight: var(--puck-font-weight-medium);\n padding-inline-start: var(--puck-space-2);\n padding-inline-end: var(--puck-space-2);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {\n padding-inline-start: 0;\n}\n._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {\n margin-inline-start: calc(var(--puck-space-1) * -1);\n}\n._ActionBar-group_5vdfr_38 {\n align-items: center;\n border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));\n display: flex;\n height: 100%;\n padding-inline-start: var(--puck-space-1);\n padding-inline-end: var(--puck-space-1);\n}\n._ActionBar-group_5vdfr_38:first-of-type {\n border-inline-start: 0;\n}\n._ActionBar-group_5vdfr_38:empty {\n display: none;\n}\n._ActionBarAction_5vdfr_30 {\n background: transparent;\n border: none;\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n cursor: pointer;\n padding: var(--puck-actionbar-action-space, 6px);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n border-radius: var(--puck-radius-m);\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._ActionBarAction--disabled_5vdfr_74 {\n cursor: auto;\n color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );\n opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);\n}\n._ActionBarAction_5vdfr_30 svg {\n max-width: none !important;\n}\n._ActionBarAction_5vdfr_30:focus-visible {\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: calc(var(--puck-border-width-focus) * -1);\n}\n@media (hover: hover) and (pointer: fine) {\n ._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {\n color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );\n opacity: 1;\n transition: none;\n }\n}\n._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),\n._ActionBarAction--active_5vdfr_104 {\n color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );\n opacity: 1;\n transition: none;\n}\n._ActionBar-group_5vdfr_38 * {\n margin: 0;\n}\n._ActionBar-separator_5vdfr_117 {\n background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );\n margin-inline: var(--puck-space-1);\n width: var( --puck-border-width-hairline );\n height: 100%;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */\n._DraggableComponent_1627v_1 {\n position: absolute;\n pointer-events: none;\n}\n._DraggableComponent-overlayWrapper_1627v_6 {\n height: 100%;\n width: 100%;\n top: 0;\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 1;\n}\n._DraggableComponent-overlay_1627v_6 {\n cursor: pointer;\n height: 100%;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DraggableComponent_1627v_1:focus-visible > ._DraggableComponent-overlayWrapper_1627v_6 {\n outline: var(--puck-border-width-regular) solid var(--puck-color-focus-ring);\n}\n._DraggableComponent-loadingOverlay_1627v_38 {\n background: var(--puck-color-surface);\n color: var(--puck-color-text);\n border-radius: var(--puck-radius-m);\n display: flex;\n padding: var(--puck-space-2);\n top: var(--puck-space-2);\n right: var(--puck-space-2);\n position: absolute;\n z-index: 1;\n pointer-events: all;\n box-sizing: border-box;\n opacity: 0.8;\n z-index: 1;\n}\n._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n background: var( --puck-slot-component-color-overlay, var(--puck-color-selection-bg) );\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n}\n._DraggableComponent--isSelected_1627v_72 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n outline-color: var( --puck-slot-component-color-border-selected, var(--puck-color-selection-border) );\n}\n._DraggableComponent_1627v_1:has(._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6) > ._DraggableComponent-overlayWrapper_1627v_6 {\n display: none;\n}\n._DraggableComponent-actionsOverlay_1627v_89 {\n position: sticky;\n opacity: 0;\n pointer-events: none;\n z-index: 2;\n}\n._DraggableComponent--isSelected_1627v_72 ._DraggableComponent-actionsOverlay_1627v_89 {\n opacity: 1;\n pointer-events: auto;\n}\n._DraggableComponent-actions_1627v_89 {\n position: absolute;\n width: auto;\n cursor: grab;\n display: flex;\n box-sizing: border-box;\n transform-origin: right top;\n min-height: 36px;\n}\n._DraggableComponent-actionsAction_1627v_111 {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */\n._Drawer_1n90m_1 {\n display: flex;\n flex-direction: column;\n font-family: var(--puck-font-family);\n gap: var(--puck-space-3);\n}\n._Drawer-draggable_1n90m_8 {\n position: relative;\n}\n._Drawer-draggableBg_1n90m_12 {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n z-index: -1;\n}\n._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-drawer-item-color-bg, var(--puck-color-surface));\n color: var(--puck-drawer-item-color-text, var(--puck-color-text));\n cursor: grab;\n padding: var(--puck-drawer-item-space, var(--puck-space-3));\n display: flex;\n border: var(--puck-drawer-item-border-width, var(--puck-border-width-regular)) var(--puck-drawer-item-color-border, var(--puck-color-border)) solid;\n border-radius: var(--puck-drawer-item-radius, var(--puck-radius-m));\n font-size: var(--puck-drawer-item-font-size, var(--puck-font-size-xxs));\n justify-content: space-between;\n align-items: center;\n transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._DrawerItem--disabled_1n90m_38 ._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-color-surface-muted);\n color: var(--puck-color-text-muted);\n cursor: not-allowed;\n}\n._DrawerItem_1n90m_22:focus-visible {\n outline: 0;\n}\n._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:focus-visible ._DrawerItem-draggable_1n90m_22 {\n border-radius: var(--puck-radius-m);\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: var(--puck-border-width-focus);\n}\n@media (hover: hover) and (pointer: fine) {\n ._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:not(._DrawerItem--disabled_1n90m_38) ._DrawerItem-draggable_1n90m_22:hover {\n background-color: var( --puck-drawer-item-color-bg-hover, var(--puck-color-interactive-soft-hover) );\n color: var( --puck-drawer-item-color-text-hover, var(--puck-color-interactive) );\n transition: none;\n }\n}\n._DrawerItem-name_1n90m_72 {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css/#css-module-data */\n._DropZone_ybznu_1 {\n position: relative;\n height: 100%;\n min-height: var(--puck-slot-min-empty-height);\n outline-offset: calc(var(--puck-slot-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DropZone--hasChildren_ybznu_11 {\n min-height: 0;\n}\n._DropZone_ybznu_1:empty {\n min-height: var(--puck-slot-min-empty-height);\n}\n[data-puck-entry]:not([data-puck-dragging]) ._DropZone_ybznu_1 {\n transition: min-height var(--puck-duration-medium) var(--puck-ease-exit);\n}\n._DropZone--isAreaSelected_ybznu_24,\n._DropZone--hoveringOverArea_ybznu_25:not(._DropZone--isRootZone_ybznu_25) {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1:empty {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone-item_ybznu_39 {\n position: relative;\n}\n._DropZone-hitbox_ybznu_43 {\n position: absolute;\n bottom: calc(var(--puck-space-3) * -1);\n height: var(--puck-space-5);\n width: 100%;\n z-index: 1;\n}\n[data-puck-dragging] ._DropZone--isEnabled_ybznu_51 {\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1 > *:not([data-puck-component]) {\n opacity: 0;\n}\nbody:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {\n opacity: 0 !important;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */\n._InlineTextField_104qp_1 {\n cursor: text;\n display: inline-block;\n white-space: pre-wrap;\n text-decoration: inherit;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1 {\n cursor: none;\n caret-color: transparent;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1::selection {\n display: none;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */\n@keyframes _loader-animation_1w5zn_1 {\n 0% {\n transform: rotate(0deg) scale(1);\n }\n 50% {\n transform: rotate(180deg) scale(0.8);\n }\n 100% {\n transform: rotate(360deg) scale(1);\n }\n}\n._Loader_1w5zn_13 {\n background: transparent;\n border-radius: var(--puck-radius-round);\n border: var(--puck-border-width-focus) solid currentColor;\n border-bottom-color: transparent;\n display: inline-block;\n animation: _loader-animation_1w5zn_1 1s 0s infinite linear;\n animation-fill-mode: both;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */\n._RichTextMenu_1ve2j_1 {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n}\n._RichTextMenu--form_1ve2j_7 {\n border-top-left-radius: var(--puck-field-radius, var(--puck-radius-m));\n border-top-right-radius: var(--puck-field-radius, var(--puck-radius-m));\n padding: var(--puck-field-richtext-menu-space-y, 6px) var(--puck-field-richtext-menu-space-x, 6px);\n background-color: var( --puck-field-richtext-menu-color-bg, var(--puck-color-surface-subtle) );\n position: relative;\n scrollbar-width: none;\n overflow-x: auto;\n}\n._RichTextMenu-group_1ve2j_21 {\n display: flex;\n align-items: space-between;\n flex-direction: row;\n flex-wrap: nowrap;\n padding-inline: 6px;\n gap: 2px;\n position: relative;\n}\n._RichTextMenu-group_1ve2j_21:first-of-type {\n padding-left: 0;\n}\n._RichTextMenu-group_1ve2j_21:last-of-type {\n padding-right: 0;\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 {\n color: var(--puck-color-text-inverse);\n gap: 0px;\n flex-wrap: nowrap;\n}\n._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-regular) solid var( --puck-field-richtext-menu-color-separator, var(--puck-color-border-muted) );\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-hairline) solid var(--puck-color-border-inverse);\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */\n._Control_id4pm_1 .lucide {\n height: var(--puck-icon-size-m);\n width: var(--puck-icon-size-m);\n}\n._Control--inline_id4pm_6 .lucide {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* components/DraggableComponent/styles.css */\n[data-puck-component] * {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-component] {\n cursor: grab;\n pointer-events: auto !important;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-dropzone] {\n pointer-events: auto !important;\n}\n[data-puck-disabled] {\n cursor: pointer;\n}\n[data-dnd-placeholder] {\n background: var( --puck-slot-component-color-placeholder, var(--puck-color-azure-06) ) !important;\n border: none !important;\n color: transparent !important;\n opacity: 0.3 !important;\n outline: none !important;\n transition: none !important;\n}\n[data-dnd-placeholder] *,\n[data-dnd-placeholder]::after,\n[data-dnd-placeholder]::before {\n opacity: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] {\n pointer-events: none !important;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var(--puck-slot-component-color-border-dragging, var(--puck-color-azure-09)) solid !important;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1) !important;\n}\n[data-dnd-dragging][data-puck-component] > :first-child {\n margin-top: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] > :last-child {\n margin-bottom: 0 !important;\n}\n\n/* lib/overlay-portal/styles.css */\n[data-puck-overlay-portal],\n[data-puck-overlay-portal] * {\n pointer-events: auto !important;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:hover {\n outline: 2px var(--puck-color-azure-09, #cfdff0) dashed;\n outline-offset: 2px;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:focus-within {\n outline: 2px var(--puck-color-azure-07, #88b0da) dashed;\n outline-offset: 2px;\n}';
|
|
9330
10456
|
|
|
9331
10457
|
// lib/use-inject-css.ts
|
|
9332
10458
|
var PUCK_STYLE_SOURCE_ATTRIBUTE = "data-puck-style-source";
|
|
@@ -9464,7 +10590,7 @@ var useInjectIframeCss = (targetDocument) => {
|
|
|
9464
10590
|
};
|
|
9465
10591
|
|
|
9466
10592
|
// components/AutoFrame/index.tsx
|
|
9467
|
-
import { Fragment as Fragment12, jsx as
|
|
10593
|
+
import { Fragment as Fragment12, jsx as jsx53 } from "react/jsx-runtime";
|
|
9468
10594
|
var styleSelector = 'style, link[rel="stylesheet"]';
|
|
9469
10595
|
var mirroredStyleAttribute = "data-puck-style-mirror";
|
|
9470
10596
|
var shouldMirrorStyleElement = (style) => {
|
|
@@ -9714,10 +10840,10 @@ var CopyHostStyles = ({
|
|
|
9714
10840
|
removeAllMirrors();
|
|
9715
10841
|
};
|
|
9716
10842
|
}, [syncHostStyles]);
|
|
9717
|
-
return /* @__PURE__ */
|
|
10843
|
+
return /* @__PURE__ */ jsx53(Fragment12, { children });
|
|
9718
10844
|
};
|
|
9719
|
-
var autoFrameContext =
|
|
9720
|
-
var useFrame = () =>
|
|
10845
|
+
var autoFrameContext = createContext7({});
|
|
10846
|
+
var useFrame = () => useContext16(autoFrameContext);
|
|
9721
10847
|
function AutoFrame(_a) {
|
|
9722
10848
|
var _b = _a, {
|
|
9723
10849
|
children,
|
|
@@ -9740,10 +10866,10 @@ function AutoFrame(_a) {
|
|
|
9740
10866
|
"frameRef",
|
|
9741
10867
|
"syncHostStyles"
|
|
9742
10868
|
]);
|
|
9743
|
-
const [loaded, setLoaded] =
|
|
9744
|
-
const [ctx, setCtx] =
|
|
9745
|
-
const [mountTarget, setMountTarget] =
|
|
9746
|
-
const [stylesLoaded, setStylesLoaded] =
|
|
10869
|
+
const [loaded, setLoaded] = useState19(false);
|
|
10870
|
+
const [ctx, setCtx] = useState19({});
|
|
10871
|
+
const [mountTarget, setMountTarget] = useState19();
|
|
10872
|
+
const [stylesLoaded, setStylesLoaded] = useState19(false);
|
|
9747
10873
|
useEffect22(() => {
|
|
9748
10874
|
if (loaded) {
|
|
9749
10875
|
setStylesLoaded(!syncHostStyles);
|
|
@@ -9768,7 +10894,7 @@ function AutoFrame(_a) {
|
|
|
9768
10894
|
}
|
|
9769
10895
|
}
|
|
9770
10896
|
}, [frameRef, loaded, stylesLoaded]);
|
|
9771
|
-
return /* @__PURE__ */
|
|
10897
|
+
return /* @__PURE__ */ jsx53(
|
|
9772
10898
|
"iframe",
|
|
9773
10899
|
__spreadProps(__spreadValues({}, props), {
|
|
9774
10900
|
className,
|
|
@@ -9778,7 +10904,7 @@ function AutoFrame(_a) {
|
|
|
9778
10904
|
onLoad: () => {
|
|
9779
10905
|
setLoaded(true);
|
|
9780
10906
|
},
|
|
9781
|
-
children: /* @__PURE__ */
|
|
10907
|
+
children: /* @__PURE__ */ jsx53(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ jsx53(
|
|
9782
10908
|
CopyHostStyles,
|
|
9783
10909
|
{
|
|
9784
10910
|
debug,
|
|
@@ -9795,11 +10921,11 @@ var AutoFrame_default = AutoFrame;
|
|
|
9795
10921
|
|
|
9796
10922
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css#css-module
|
|
9797
10923
|
init_react_import();
|
|
9798
|
-
var
|
|
10924
|
+
var styles_module_default28 = { "PuckPreview": "_PuckPreview_zbic3_1", "PuckPreview-frame": "_PuckPreview-frame_zbic3_6" };
|
|
9799
10925
|
|
|
9800
10926
|
// components/Puck/components/Preview/index.tsx
|
|
9801
|
-
import { Fragment as Fragment13, jsx as
|
|
9802
|
-
var
|
|
10927
|
+
import { Fragment as Fragment13, jsx as jsx54 } from "react/jsx-runtime";
|
|
10928
|
+
var getClassName34 = get_class_name_factory_default("PuckPreview", styles_module_default28);
|
|
9803
10929
|
var useBubbleIframeEvents = (ref) => {
|
|
9804
10930
|
const status = useAppStore((s) => s.status);
|
|
9805
10931
|
useEffect23(() => {
|
|
@@ -9864,7 +10990,7 @@ var Page = memo9((_a) => {
|
|
|
9864
10990
|
const richtextProps = useRichtextProps((_b2 = (_a2 = config.root) == null ? void 0 : _a2.fields) != null ? _b2 : {}, pageProps);
|
|
9865
10991
|
return ((_c = config.root) == null ? void 0 : _c.render) ? (_d = config.root) == null ? void 0 : _d.render(__spreadValues(__spreadValues({
|
|
9866
10992
|
id: "puck-root"
|
|
9867
|
-
}, propsWithSlots), richtextProps)) : /* @__PURE__ */
|
|
10993
|
+
}, propsWithSlots), richtextProps)) : /* @__PURE__ */ jsx54(Fragment13, { children: propsWithSlots.children });
|
|
9868
10994
|
});
|
|
9869
10995
|
Page.displayName = "Page";
|
|
9870
10996
|
var Preview2 = ({ id = "puck-preview" }) => {
|
|
@@ -9878,12 +11004,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9878
11004
|
const renderData = useAppStore(
|
|
9879
11005
|
(s) => s.state.ui.previewMode === "edit" ? null : s.state.data
|
|
9880
11006
|
);
|
|
9881
|
-
const Frame =
|
|
11007
|
+
const Frame = useMemo21(() => overrides.iframe, [overrides]);
|
|
9882
11008
|
const rootProps = root.props || root;
|
|
9883
11009
|
const ref = useRef11(null);
|
|
9884
11010
|
useBubbleIframeEvents(ref);
|
|
9885
11011
|
usePreviewModeAttribute(ref);
|
|
9886
|
-
const inner = !renderData ? /* @__PURE__ */
|
|
11012
|
+
const inner = !renderData ? /* @__PURE__ */ jsx54(
|
|
9887
11013
|
Page,
|
|
9888
11014
|
__spreadProps(__spreadValues({}, rootProps), {
|
|
9889
11015
|
config,
|
|
@@ -9894,18 +11020,18 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9894
11020
|
metadata
|
|
9895
11021
|
},
|
|
9896
11022
|
editMode: true,
|
|
9897
|
-
children: /* @__PURE__ */
|
|
11023
|
+
children: /* @__PURE__ */ jsx54(DropZonePure, { zone: rootDroppableId })
|
|
9898
11024
|
})
|
|
9899
|
-
) : /* @__PURE__ */
|
|
11025
|
+
) : /* @__PURE__ */ jsx54(Render, { data: renderData, config, metadata });
|
|
9900
11026
|
useEffect23(() => {
|
|
9901
11027
|
if (!iframe.enabled) {
|
|
9902
11028
|
setStatus("READY");
|
|
9903
11029
|
}
|
|
9904
11030
|
}, [iframe.enabled]);
|
|
9905
|
-
return /* @__PURE__ */
|
|
11031
|
+
return /* @__PURE__ */ jsx54(
|
|
9906
11032
|
"div",
|
|
9907
11033
|
{
|
|
9908
|
-
className:
|
|
11034
|
+
className: getClassName34(),
|
|
9909
11035
|
id,
|
|
9910
11036
|
"data-puck-preview": true,
|
|
9911
11037
|
onClick: (e) => {
|
|
@@ -9914,11 +11040,11 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9914
11040
|
dispatch({ type: "setUi", ui: { itemSelector: null } });
|
|
9915
11041
|
}
|
|
9916
11042
|
},
|
|
9917
|
-
children: iframe.enabled ? /* @__PURE__ */
|
|
11043
|
+
children: iframe.enabled ? /* @__PURE__ */ jsx54(
|
|
9918
11044
|
AutoFrame_default,
|
|
9919
11045
|
{
|
|
9920
11046
|
id: "preview-frame",
|
|
9921
|
-
className:
|
|
11047
|
+
className: getClassName34("frame"),
|
|
9922
11048
|
"data-rfd-iframe": true,
|
|
9923
11049
|
syncHostStyles: iframe.syncHostStyles,
|
|
9924
11050
|
onReady: () => {
|
|
@@ -9928,18 +11054,18 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9928
11054
|
setStatus("MOUNTED");
|
|
9929
11055
|
},
|
|
9930
11056
|
frameRef: ref,
|
|
9931
|
-
children: /* @__PURE__ */
|
|
11057
|
+
children: /* @__PURE__ */ jsx54(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
|
|
9932
11058
|
if (Frame) {
|
|
9933
|
-
return /* @__PURE__ */
|
|
11059
|
+
return /* @__PURE__ */ jsx54(Frame, { document: document2, children: inner });
|
|
9934
11060
|
}
|
|
9935
11061
|
return inner;
|
|
9936
11062
|
} })
|
|
9937
11063
|
}
|
|
9938
|
-
) : /* @__PURE__ */
|
|
11064
|
+
) : /* @__PURE__ */ jsx54(
|
|
9939
11065
|
"div",
|
|
9940
11066
|
{
|
|
9941
11067
|
id: "preview-frame",
|
|
9942
|
-
className:
|
|
11068
|
+
className: getClassName34("frame"),
|
|
9943
11069
|
ref,
|
|
9944
11070
|
"data-puck-entry": true,
|
|
9945
11071
|
children: inner
|
|
@@ -9951,7 +11077,7 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9951
11077
|
|
|
9952
11078
|
// lib/use-loaded-overrides.ts
|
|
9953
11079
|
init_react_import();
|
|
9954
|
-
import { useMemo as
|
|
11080
|
+
import { useMemo as useMemo22 } from "react";
|
|
9955
11081
|
|
|
9956
11082
|
// lib/load-overrides.ts
|
|
9957
11083
|
init_react_import();
|
|
@@ -9993,7 +11119,7 @@ var useLoadedOverrides = ({
|
|
|
9993
11119
|
overrides,
|
|
9994
11120
|
plugins
|
|
9995
11121
|
}) => {
|
|
9996
|
-
return
|
|
11122
|
+
return useMemo22(() => {
|
|
9997
11123
|
return loadOverrides({ overrides, plugins });
|
|
9998
11124
|
}, [plugins, overrides]);
|
|
9999
11125
|
};
|
|
@@ -10006,25 +11132,25 @@ init_react_import();
|
|
|
10006
11132
|
import {
|
|
10007
11133
|
useEffect as useEffect28,
|
|
10008
11134
|
useLayoutEffect as useLayoutEffect2,
|
|
10009
|
-
useMemo as
|
|
10010
|
-
useState as
|
|
11135
|
+
useMemo as useMemo27,
|
|
11136
|
+
useState as useState24
|
|
10011
11137
|
} from "react";
|
|
10012
11138
|
|
|
10013
11139
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css#css-module
|
|
10014
11140
|
init_react_import();
|
|
10015
|
-
var
|
|
11141
|
+
var styles_module_default29 = { "Puck": "_Puck_tzaxg_19", "Puck-portal": "_Puck-portal_tzaxg_31", "PuckLayout": "_PuckLayout_tzaxg_36", "PuckLayout-inner": "_PuckLayout-inner_tzaxg_40", "Puck--hidePlugins": "_Puck--hidePlugins_tzaxg_73", "PuckLayout--mounted": "_PuckLayout--mounted_tzaxg_78", "PuckLayout--mobilePanelHeightToggle": "_PuckLayout--mobilePanelHeightToggle_tzaxg_82", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_tzaxg_82", "PuckLayout--isExpanded": "_PuckLayout--isExpanded_tzaxg_90", "PuckLayout--mobilePanelHeightMinContent": "_PuckLayout--mobilePanelHeightMinContent_tzaxg_110", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_tzaxg_137", "PuckLayout-mounted": "_PuckLayout-mounted_tzaxg_156", "PuckLayout-nav": "_PuckLayout-nav_tzaxg_197", "PuckLayout-header": "_PuckLayout-header_tzaxg_217", "PuckPluginTab": "_PuckPluginTab_tzaxg_231", "PuckPluginTab--visible": "_PuckPluginTab--visible_tzaxg_237", "PuckPluginTab-body": "_PuckPluginTab-body_tzaxg_243" };
|
|
10016
11142
|
|
|
10017
11143
|
// components/DefaultOverride/index.tsx
|
|
10018
11144
|
init_react_import();
|
|
10019
|
-
import { Fragment as Fragment14, jsx as
|
|
10020
|
-
var DefaultOverride = ({ children }) => /* @__PURE__ */
|
|
11145
|
+
import { Fragment as Fragment14, jsx as jsx55 } from "react/jsx-runtime";
|
|
11146
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ jsx55(Fragment14, { children });
|
|
10021
11147
|
|
|
10022
11148
|
// lib/use-preview-mode-hotkeys.ts
|
|
10023
11149
|
init_react_import();
|
|
10024
|
-
import { useCallback as
|
|
11150
|
+
import { useCallback as useCallback19 } from "react";
|
|
10025
11151
|
var usePreviewModeHotkeys = () => {
|
|
10026
11152
|
const appStore = useAppStoreApi();
|
|
10027
|
-
const toggleInteractive =
|
|
11153
|
+
const toggleInteractive = useCallback19(() => {
|
|
10028
11154
|
const dispatch = appStore.getState().dispatch;
|
|
10029
11155
|
dispatch({
|
|
10030
11156
|
type: "setUi",
|
|
@@ -10039,18 +11165,18 @@ var usePreviewModeHotkeys = () => {
|
|
|
10039
11165
|
|
|
10040
11166
|
// components/Puck/components/Header/index.tsx
|
|
10041
11167
|
init_react_import();
|
|
10042
|
-
import { memo as memo10, useCallback as
|
|
11168
|
+
import { memo as memo10, useCallback as useCallback20, useMemo as useMemo23, useState as useState20 } from "react";
|
|
10043
11169
|
|
|
10044
11170
|
// components/MenuBar/index.tsx
|
|
10045
11171
|
init_react_import();
|
|
10046
11172
|
|
|
10047
11173
|
// css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
|
|
10048
11174
|
init_react_import();
|
|
10049
|
-
var
|
|
11175
|
+
var styles_module_default30 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_1hxnj_14", "MenuBar-inner": "_MenuBar-inner_1hxnj_29", "MenuBar-history": "_MenuBar-history_1hxnj_45" };
|
|
10050
11176
|
|
|
10051
11177
|
// components/MenuBar/index.tsx
|
|
10052
|
-
import { Fragment as Fragment15, jsx as
|
|
10053
|
-
var
|
|
11178
|
+
import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11179
|
+
var getClassName35 = get_class_name_factory_default("MenuBar", styles_module_default30);
|
|
10054
11180
|
function MenuBar({
|
|
10055
11181
|
menuOpen = false,
|
|
10056
11182
|
renderHeaderActions,
|
|
@@ -10062,10 +11188,10 @@ function MenuBar({
|
|
|
10062
11188
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
10063
11189
|
const undoLabel = useMessage("header-undo");
|
|
10064
11190
|
const redoLabel = useMessage("header-redo");
|
|
10065
|
-
return /* @__PURE__ */
|
|
11191
|
+
return /* @__PURE__ */ jsx56(
|
|
10066
11192
|
"div",
|
|
10067
11193
|
{
|
|
10068
|
-
className:
|
|
11194
|
+
className: getClassName35({ menuOpen }),
|
|
10069
11195
|
onClick: (event) => {
|
|
10070
11196
|
var _a;
|
|
10071
11197
|
const element = event.target;
|
|
@@ -10076,30 +11202,30 @@ function MenuBar({
|
|
|
10076
11202
|
setMenuOpen(false);
|
|
10077
11203
|
}
|
|
10078
11204
|
},
|
|
10079
|
-
children: /* @__PURE__ */
|
|
10080
|
-
/* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
11205
|
+
children: /* @__PURE__ */ jsxs22("div", { className: getClassName35("inner"), children: [
|
|
11206
|
+
/* @__PURE__ */ jsxs22("div", { className: getClassName35("history"), children: [
|
|
11207
|
+
/* @__PURE__ */ jsx56(
|
|
10082
11208
|
IconButton,
|
|
10083
11209
|
{
|
|
10084
11210
|
type: "button",
|
|
10085
11211
|
title: undoLabel,
|
|
10086
11212
|
disabled: !hasPast,
|
|
10087
11213
|
onClick: back,
|
|
10088
|
-
children: /* @__PURE__ */
|
|
11214
|
+
children: /* @__PURE__ */ jsx56(Undo2, { size: 21 })
|
|
10089
11215
|
}
|
|
10090
11216
|
),
|
|
10091
|
-
/* @__PURE__ */
|
|
11217
|
+
/* @__PURE__ */ jsx56(
|
|
10092
11218
|
IconButton,
|
|
10093
11219
|
{
|
|
10094
11220
|
type: "button",
|
|
10095
11221
|
title: redoLabel,
|
|
10096
11222
|
disabled: !hasFuture,
|
|
10097
11223
|
onClick: forward,
|
|
10098
|
-
children: /* @__PURE__ */
|
|
11224
|
+
children: /* @__PURE__ */ jsx56(Redo2, { size: 21 })
|
|
10099
11225
|
}
|
|
10100
11226
|
)
|
|
10101
11227
|
] }),
|
|
10102
|
-
/* @__PURE__ */
|
|
11228
|
+
/* @__PURE__ */ jsx56(Fragment15, { children: renderHeaderActions && renderHeaderActions() })
|
|
10103
11229
|
] })
|
|
10104
11230
|
}
|
|
10105
11231
|
);
|
|
@@ -10107,11 +11233,11 @@ function MenuBar({
|
|
|
10107
11233
|
|
|
10108
11234
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Header/styles.module.css#css-module
|
|
10109
11235
|
init_react_import();
|
|
10110
|
-
var
|
|
11236
|
+
var styles_module_default31 = { "PuckHeader": "_PuckHeader_c2nei_1", "PuckHeader--hidePlugins": "_PuckHeader--hidePlugins_c2nei_21", "PuckHeader-inner": "_PuckHeader-inner_c2nei_26", "PuckHeader-toggle": "_PuckHeader-toggle_c2nei_46", "PuckHeader-rightSideBarToggle": "_PuckHeader-rightSideBarToggle_c2nei_52", "PuckHeader-leftSideBarToggle": "_PuckHeader-leftSideBarToggle_c2nei_53", "PuckHeader-title": "_PuckHeader-title_c2nei_64", "PuckHeader-path": "_PuckHeader-path_c2nei_68", "PuckHeader-tools": "_PuckHeader-tools_c2nei_75", "PuckHeader-menuButton": "_PuckHeader-menuButton_c2nei_81", "PuckHeader--menuOpen": "_PuckHeader--menuOpen_c2nei_86" };
|
|
10111
11237
|
|
|
10112
11238
|
// components/Puck/components/Header/index.tsx
|
|
10113
|
-
import { Fragment as Fragment16, jsx as
|
|
10114
|
-
var
|
|
11239
|
+
import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11240
|
+
var getClassName36 = get_class_name_factory_default("PuckHeader", styles_module_default31);
|
|
10115
11241
|
var HeaderInner = ({
|
|
10116
11242
|
hidePlugins
|
|
10117
11243
|
}) => {
|
|
@@ -10125,7 +11251,7 @@ var HeaderInner = ({
|
|
|
10125
11251
|
} = usePropsContext();
|
|
10126
11252
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
10127
11253
|
const appStore = useAppStoreApi();
|
|
10128
|
-
const defaultHeaderRender =
|
|
11254
|
+
const defaultHeaderRender = useMemo23(() => {
|
|
10129
11255
|
if (renderHeader) {
|
|
10130
11256
|
console.warn(
|
|
10131
11257
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
|
@@ -10134,13 +11260,13 @@ var HeaderInner = ({
|
|
|
10134
11260
|
var _b = _a, { actions } = _b, props = __objRest(_b, ["actions"]);
|
|
10135
11261
|
const Comp = renderHeader;
|
|
10136
11262
|
const appState = useAppStore((s) => s.state);
|
|
10137
|
-
return /* @__PURE__ */
|
|
11263
|
+
return /* @__PURE__ */ jsx57(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
|
|
10138
11264
|
};
|
|
10139
11265
|
return RenderHeader;
|
|
10140
11266
|
}
|
|
10141
11267
|
return DefaultOverride;
|
|
10142
11268
|
}, [renderHeader]);
|
|
10143
|
-
const defaultHeaderActionsRender =
|
|
11269
|
+
const defaultHeaderActionsRender = useMemo23(() => {
|
|
10144
11270
|
if (renderHeaderActions) {
|
|
10145
11271
|
console.warn(
|
|
10146
11272
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
|
@@ -10148,7 +11274,7 @@ var HeaderInner = ({
|
|
|
10148
11274
|
const RenderHeader = (props) => {
|
|
10149
11275
|
const Comp = renderHeaderActions;
|
|
10150
11276
|
const appState = useAppStore((s) => s.state);
|
|
10151
|
-
return /* @__PURE__ */
|
|
11277
|
+
return /* @__PURE__ */ jsx57(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
|
|
10152
11278
|
};
|
|
10153
11279
|
return RenderHeader;
|
|
10154
11280
|
}
|
|
@@ -10160,7 +11286,7 @@ var HeaderInner = ({
|
|
|
10160
11286
|
const CustomHeaderActions = useAppStore(
|
|
10161
11287
|
(s) => s.overrides.headerActions || defaultHeaderActionsRender
|
|
10162
11288
|
);
|
|
10163
|
-
const [menuOpen, setMenuOpen] =
|
|
11289
|
+
const [menuOpen, setMenuOpen] = useState20(false);
|
|
10164
11290
|
const rootTitle = useAppStore((s) => {
|
|
10165
11291
|
var _a, _b;
|
|
10166
11292
|
const rootData = (_a = s.state.indexes.nodes["root"]) == null ? void 0 : _a.data;
|
|
@@ -10170,7 +11296,7 @@ var HeaderInner = ({
|
|
|
10170
11296
|
const rightSideBarVisible = useAppStore(
|
|
10171
11297
|
(s) => s.state.ui.rightSideBarVisible
|
|
10172
11298
|
);
|
|
10173
|
-
const toggleSidebars =
|
|
11299
|
+
const toggleSidebars = useCallback20(
|
|
10174
11300
|
(sidebar) => {
|
|
10175
11301
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
|
10176
11302
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
|
@@ -10189,31 +11315,31 @@ var HeaderInner = ({
|
|
|
10189
11315
|
const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
|
|
10190
11316
|
const toggleRightLabel = useMessage("header-toggle-rightsidebar");
|
|
10191
11317
|
const toggleMenuLabel = useMessage("header-toggle-menubar");
|
|
10192
|
-
return /* @__PURE__ */
|
|
11318
|
+
return /* @__PURE__ */ jsx57(
|
|
10193
11319
|
CustomHeader,
|
|
10194
11320
|
{
|
|
10195
|
-
actions: /* @__PURE__ */
|
|
11321
|
+
actions: /* @__PURE__ */ jsx57(Fragment16, { children: /* @__PURE__ */ jsx57(CustomHeaderActions, { children: /* @__PURE__ */ jsx57(
|
|
10196
11322
|
Button,
|
|
10197
11323
|
{
|
|
10198
11324
|
onClick: () => {
|
|
10199
11325
|
const data = appStore.getState().state.data;
|
|
10200
11326
|
onPublish && onPublish(data);
|
|
10201
11327
|
},
|
|
10202
|
-
icon: /* @__PURE__ */
|
|
11328
|
+
icon: /* @__PURE__ */ jsx57(Globe, { size: "14px" }),
|
|
10203
11329
|
children: publishLabel
|
|
10204
11330
|
}
|
|
10205
11331
|
) }) }),
|
|
10206
|
-
children: /* @__PURE__ */
|
|
11332
|
+
children: /* @__PURE__ */ jsx57(
|
|
10207
11333
|
"header",
|
|
10208
11334
|
{
|
|
10209
|
-
className:
|
|
11335
|
+
className: getClassName36({
|
|
10210
11336
|
leftSideBarVisible,
|
|
10211
11337
|
rightSideBarVisible,
|
|
10212
11338
|
hidePlugins
|
|
10213
11339
|
}),
|
|
10214
|
-
children: /* @__PURE__ */
|
|
10215
|
-
/* @__PURE__ */
|
|
10216
|
-
/* @__PURE__ */
|
|
11340
|
+
children: /* @__PURE__ */ jsxs23("div", { className: getClassName36("inner"), children: [
|
|
11341
|
+
/* @__PURE__ */ jsxs23("div", { className: getClassName36("toggle"), children: [
|
|
11342
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("leftSideBarToggle"), children: /* @__PURE__ */ jsx57(
|
|
10217
11343
|
IconButton,
|
|
10218
11344
|
{
|
|
10219
11345
|
type: "button",
|
|
@@ -10221,10 +11347,10 @@ var HeaderInner = ({
|
|
|
10221
11347
|
toggleSidebars("left");
|
|
10222
11348
|
},
|
|
10223
11349
|
title: toggleLeftLabel,
|
|
10224
|
-
children: /* @__PURE__ */
|
|
11350
|
+
children: /* @__PURE__ */ jsx57(PanelLeft, { focusable: "false" })
|
|
10225
11351
|
}
|
|
10226
11352
|
) }),
|
|
10227
|
-
/* @__PURE__ */
|
|
11353
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("rightSideBarToggle"), children: /* @__PURE__ */ jsx57(
|
|
10228
11354
|
IconButton,
|
|
10229
11355
|
{
|
|
10230
11356
|
type: "button",
|
|
@@ -10232,19 +11358,19 @@ var HeaderInner = ({
|
|
|
10232
11358
|
toggleSidebars("right");
|
|
10233
11359
|
},
|
|
10234
11360
|
title: toggleRightLabel,
|
|
10235
|
-
children: /* @__PURE__ */
|
|
11361
|
+
children: /* @__PURE__ */ jsx57(PanelRight, { focusable: "false" })
|
|
10236
11362
|
}
|
|
10237
11363
|
) })
|
|
10238
11364
|
] }),
|
|
10239
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("title"), children: /* @__PURE__ */ jsxs23(Heading, { rank: "2", size: "xs", children: [
|
|
10240
11366
|
headerTitle || rootTitle || pageLabel,
|
|
10241
|
-
headerPath && /* @__PURE__ */
|
|
11367
|
+
headerPath && /* @__PURE__ */ jsxs23(Fragment16, { children: [
|
|
10242
11368
|
" ",
|
|
10243
|
-
/* @__PURE__ */
|
|
11369
|
+
/* @__PURE__ */ jsx57("code", { className: getClassName36("path"), children: headerPath })
|
|
10244
11370
|
] })
|
|
10245
11371
|
] }) }),
|
|
10246
|
-
/* @__PURE__ */
|
|
10247
|
-
/* @__PURE__ */
|
|
11372
|
+
/* @__PURE__ */ jsxs23("div", { className: getClassName36("tools"), children: [
|
|
11373
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("menuButton"), children: /* @__PURE__ */ jsx57(
|
|
10248
11374
|
IconButton,
|
|
10249
11375
|
{
|
|
10250
11376
|
type: "button",
|
|
@@ -10252,23 +11378,23 @@ var HeaderInner = ({
|
|
|
10252
11378
|
return setMenuOpen(!menuOpen);
|
|
10253
11379
|
},
|
|
10254
11380
|
title: toggleMenuLabel,
|
|
10255
|
-
children: menuOpen ? /* @__PURE__ */
|
|
11381
|
+
children: menuOpen ? /* @__PURE__ */ jsx57(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ jsx57(ChevronDown, { focusable: "false" })
|
|
10256
11382
|
}
|
|
10257
11383
|
) }),
|
|
10258
|
-
/* @__PURE__ */
|
|
11384
|
+
/* @__PURE__ */ jsx57(
|
|
10259
11385
|
MenuBar,
|
|
10260
11386
|
{
|
|
10261
11387
|
dispatch,
|
|
10262
11388
|
onPublish,
|
|
10263
11389
|
menuOpen,
|
|
10264
|
-
renderHeaderActions: () => /* @__PURE__ */
|
|
11390
|
+
renderHeaderActions: () => /* @__PURE__ */ jsx57(CustomHeaderActions, { children: /* @__PURE__ */ jsx57(
|
|
10265
11391
|
Button,
|
|
10266
11392
|
{
|
|
10267
11393
|
onClick: () => {
|
|
10268
11394
|
const data = appStore.getState().state.data;
|
|
10269
11395
|
onPublish && onPublish(data);
|
|
10270
11396
|
},
|
|
10271
|
-
icon: /* @__PURE__ */
|
|
11397
|
+
icon: /* @__PURE__ */ jsx57(Globe, { size: "14px" }),
|
|
10272
11398
|
children: publishLabel
|
|
10273
11399
|
}
|
|
10274
11400
|
) }),
|
|
@@ -10289,11 +11415,11 @@ init_react_import();
|
|
|
10289
11415
|
|
|
10290
11416
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
10291
11417
|
init_react_import();
|
|
10292
|
-
var
|
|
11418
|
+
var styles_module_default32 = { "SidebarSection": "_SidebarSection_1uv88_1", "SidebarSection-title": "_SidebarSection-title_1uv88_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_1uv88_20", "SidebarSection-content": "_SidebarSection-content_1uv88_24", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_1uv88_33", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_1uv88_62", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_1uv88_33", "SidebarSection-heading": "_SidebarSection-heading_1uv88_74", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_1uv88_78" };
|
|
10293
11419
|
|
|
10294
11420
|
// components/SidebarSection/index.tsx
|
|
10295
|
-
import { jsx as
|
|
10296
|
-
var
|
|
11421
|
+
import { jsx as jsx58, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11422
|
+
var getClassName37 = get_class_name_factory_default("SidebarSection", styles_module_default32);
|
|
10297
11423
|
var SidebarSection = ({
|
|
10298
11424
|
children,
|
|
10299
11425
|
title,
|
|
@@ -10302,44 +11428,44 @@ var SidebarSection = ({
|
|
|
10302
11428
|
noBorderTop,
|
|
10303
11429
|
isLoading
|
|
10304
11430
|
}) => {
|
|
10305
|
-
return /* @__PURE__ */
|
|
10306
|
-
/* @__PURE__ */
|
|
10307
|
-
showBreadcrumbs && /* @__PURE__ */
|
|
10308
|
-
/* @__PURE__ */
|
|
11431
|
+
return /* @__PURE__ */ jsxs24("div", { className: getClassName37({ noBorderTop }), style: { background }, children: [
|
|
11432
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("title"), children: /* @__PURE__ */ jsxs24("div", { className: getClassName37("breadcrumbs"), children: [
|
|
11433
|
+
showBreadcrumbs && /* @__PURE__ */ jsx58(Breadcrumbs, {}),
|
|
11434
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("heading"), children: /* @__PURE__ */ jsx58(Heading, { rank: "2", size: "xs", children: title }) })
|
|
10309
11435
|
] }) }),
|
|
10310
|
-
/* @__PURE__ */
|
|
10311
|
-
isLoading && /* @__PURE__ */
|
|
11436
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("content"), children }),
|
|
11437
|
+
isLoading && /* @__PURE__ */ jsx58("div", { className: getClassName37("loadingOverlay"), children: /* @__PURE__ */ jsx58(Loader, { size: 32 }) })
|
|
10312
11438
|
] });
|
|
10313
11439
|
};
|
|
10314
11440
|
|
|
10315
11441
|
// components/Puck/components/Canvas/index.tsx
|
|
10316
11442
|
init_react_import();
|
|
10317
11443
|
import {
|
|
10318
|
-
useCallback as
|
|
11444
|
+
useCallback as useCallback21,
|
|
10319
11445
|
useEffect as useEffect25,
|
|
10320
|
-
useMemo as
|
|
11446
|
+
useMemo as useMemo26,
|
|
10321
11447
|
useRef as useRef13,
|
|
10322
|
-
useState as
|
|
11448
|
+
useState as useState22
|
|
10323
11449
|
} from "react";
|
|
10324
11450
|
|
|
10325
11451
|
// components/ViewportControls/index.tsx
|
|
10326
11452
|
init_react_import();
|
|
10327
|
-
import { useEffect as useEffect24, useMemo as
|
|
11453
|
+
import { useEffect as useEffect24, useMemo as useMemo24, useState as useState21 } from "react";
|
|
10328
11454
|
|
|
10329
11455
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
|
10330
11456
|
init_react_import();
|
|
10331
|
-
var
|
|
11457
|
+
var styles_module_default33 = { "ViewportControls": "_ViewportControls_v26yb_1", "ViewportControls--fullScreen": "_ViewportControls--fullScreen_v26yb_5", "ViewportControls-toggleButton": "_ViewportControls-toggleButton_v26yb_14", "ViewportControls-actions": "_ViewportControls-actions_v26yb_39", "ViewportControls-actionsInner": "_ViewportControls-actionsInner_v26yb_43", "ViewportControls--isExpanded": "_ViewportControls--isExpanded_v26yb_67", "ViewportControls-divider": "_ViewportControls-divider_v26yb_72", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_v26yb_79", "ViewportControls-zoom": "_ViewportControls-zoom_v26yb_79", "ViewportButton-inner": "_ViewportButton-inner_v26yb_110", "ViewportButton--isActive": "_ViewportButton--isActive_v26yb_118" };
|
|
10332
11458
|
|
|
10333
11459
|
// components/ViewportControls/index.tsx
|
|
10334
|
-
import { jsx as
|
|
11460
|
+
import { jsx as jsx59, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10335
11461
|
var icons = {
|
|
10336
|
-
Smartphone: /* @__PURE__ */
|
|
10337
|
-
Tablet: /* @__PURE__ */
|
|
10338
|
-
Monitor: /* @__PURE__ */
|
|
10339
|
-
FullWidth: /* @__PURE__ */
|
|
11462
|
+
Smartphone: /* @__PURE__ */ jsx59(Smartphone, { size: 16 }),
|
|
11463
|
+
Tablet: /* @__PURE__ */ jsx59(Tablet, { size: 16 }),
|
|
11464
|
+
Monitor: /* @__PURE__ */ jsx59(Monitor, { size: 16 }),
|
|
11465
|
+
FullWidth: /* @__PURE__ */ jsx59(Expand, { size: 16 })
|
|
10340
11466
|
};
|
|
10341
|
-
var
|
|
10342
|
-
var getClassNameButton = get_class_name_factory_default("ViewportButton",
|
|
11467
|
+
var getClassName38 = get_class_name_factory_default("ViewportControls", styles_module_default33);
|
|
11468
|
+
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default33);
|
|
10343
11469
|
var ActionButton = ({
|
|
10344
11470
|
children,
|
|
10345
11471
|
title,
|
|
@@ -10347,7 +11473,7 @@ var ActionButton = ({
|
|
|
10347
11473
|
isActive,
|
|
10348
11474
|
disabled
|
|
10349
11475
|
}) => {
|
|
10350
|
-
return /* @__PURE__ */
|
|
11476
|
+
return /* @__PURE__ */ jsx59("span", { className: getClassNameButton({ isActive }), suppressHydrationWarning: true, children: /* @__PURE__ */ jsx59(
|
|
10351
11477
|
IconButton,
|
|
10352
11478
|
{
|
|
10353
11479
|
type: "button",
|
|
@@ -10355,7 +11481,7 @@ var ActionButton = ({
|
|
|
10355
11481
|
disabled: disabled || isActive,
|
|
10356
11482
|
onClick,
|
|
10357
11483
|
suppressHydrationWarning: true,
|
|
10358
|
-
children: /* @__PURE__ */
|
|
11484
|
+
children: /* @__PURE__ */ jsx59("span", { className: getClassNameButton("inner"), children })
|
|
10359
11485
|
}
|
|
10360
11486
|
) });
|
|
10361
11487
|
};
|
|
@@ -10378,7 +11504,7 @@ var ViewportButton = ({
|
|
|
10378
11504
|
label: (_a = viewport.label) != null ? _a : ""
|
|
10379
11505
|
});
|
|
10380
11506
|
const switchDefaultTitle = useMessage("viewport-switch-default");
|
|
10381
|
-
return /* @__PURE__ */
|
|
11507
|
+
return /* @__PURE__ */ jsx59(
|
|
10382
11508
|
ActionButton,
|
|
10383
11509
|
{
|
|
10384
11510
|
title: viewport.label ? switchTitle : switchDefaultTitle,
|
|
@@ -10404,7 +11530,7 @@ var ViewportControls = ({
|
|
|
10404
11530
|
const autoZoomLabel = useMessage("viewport-zoom-auto", {
|
|
10405
11531
|
zoom: (autoZoom * 100).toFixed(0)
|
|
10406
11532
|
});
|
|
10407
|
-
const zoomOptions =
|
|
11533
|
+
const zoomOptions = useMemo24(
|
|
10408
11534
|
() => [
|
|
10409
11535
|
...defaultZoomOptions,
|
|
10410
11536
|
...defaultsContainAutoZoom ? [] : [
|
|
@@ -10416,24 +11542,24 @@ var ViewportControls = ({
|
|
|
10416
11542
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
|
10417
11543
|
[autoZoom, autoZoomLabel]
|
|
10418
11544
|
);
|
|
10419
|
-
const [activeViewport, setActiveViewport] =
|
|
11545
|
+
const [activeViewport, setActiveViewport] = useState21(
|
|
10420
11546
|
uiViewports.current.width
|
|
10421
11547
|
);
|
|
10422
11548
|
useEffect24(() => {
|
|
10423
11549
|
setActiveViewport(uiViewports.current.width);
|
|
10424
11550
|
}, [uiViewports.current]);
|
|
10425
|
-
const [isExpanded, setIsExpanded] =
|
|
11551
|
+
const [isExpanded, setIsExpanded] = useState21(false);
|
|
10426
11552
|
const zoomOutLabel = useMessage("viewport-zoom-out");
|
|
10427
11553
|
const zoomInLabel = useMessage("viewport-zoom-in");
|
|
10428
11554
|
const toggleMenuLabel = useMessage("viewport-toggle-menu");
|
|
10429
|
-
return /* @__PURE__ */
|
|
11555
|
+
return /* @__PURE__ */ jsxs25(
|
|
10430
11556
|
"div",
|
|
10431
11557
|
{
|
|
10432
|
-
className:
|
|
11558
|
+
className: getClassName38({ isExpanded, fullScreen }),
|
|
10433
11559
|
suppressHydrationWarning: true,
|
|
10434
11560
|
children: [
|
|
10435
|
-
/* @__PURE__ */
|
|
10436
|
-
viewports.map((viewport, i) => /* @__PURE__ */
|
|
11561
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("actions"), children: /* @__PURE__ */ jsxs25("div", { className: getClassName38("actionsInner"), children: [
|
|
11562
|
+
viewports.map((viewport, i) => /* @__PURE__ */ jsx59(
|
|
10437
11563
|
ViewportButton,
|
|
10438
11564
|
{
|
|
10439
11565
|
viewport,
|
|
@@ -10445,8 +11571,8 @@ var ViewportControls = ({
|
|
|
10445
11571
|
},
|
|
10446
11572
|
i
|
|
10447
11573
|
)),
|
|
10448
|
-
/* @__PURE__ */
|
|
10449
|
-
/* @__PURE__ */
|
|
11574
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("divider") }),
|
|
11575
|
+
/* @__PURE__ */ jsx59(
|
|
10450
11576
|
ActionButton,
|
|
10451
11577
|
{
|
|
10452
11578
|
title: zoomOutLabel,
|
|
@@ -10460,10 +11586,10 @@ var ViewportControls = ({
|
|
|
10460
11586
|
)].value
|
|
10461
11587
|
);
|
|
10462
11588
|
},
|
|
10463
|
-
children: /* @__PURE__ */
|
|
11589
|
+
children: /* @__PURE__ */ jsx59(ZoomOut, { size: 16 })
|
|
10464
11590
|
}
|
|
10465
11591
|
),
|
|
10466
|
-
/* @__PURE__ */
|
|
11592
|
+
/* @__PURE__ */ jsx59(
|
|
10467
11593
|
ActionButton,
|
|
10468
11594
|
{
|
|
10469
11595
|
title: zoomInLabel,
|
|
@@ -10477,15 +11603,15 @@ var ViewportControls = ({
|
|
|
10477
11603
|
)].value
|
|
10478
11604
|
);
|
|
10479
11605
|
},
|
|
10480
|
-
children: /* @__PURE__ */
|
|
11606
|
+
children: /* @__PURE__ */ jsx59(ZoomIn, { size: 16 })
|
|
10481
11607
|
}
|
|
10482
11608
|
),
|
|
10483
|
-
/* @__PURE__ */
|
|
10484
|
-
/* @__PURE__ */
|
|
10485
|
-
/* @__PURE__ */
|
|
11609
|
+
/* @__PURE__ */ jsxs25("div", { className: getClassName38("zoom"), children: [
|
|
11610
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("divider") }),
|
|
11611
|
+
/* @__PURE__ */ jsx59(
|
|
10486
11612
|
"select",
|
|
10487
11613
|
{
|
|
10488
|
-
className:
|
|
11614
|
+
className: getClassName38("zoomSelect"),
|
|
10489
11615
|
value: zoom.toString(),
|
|
10490
11616
|
onClick: (e) => {
|
|
10491
11617
|
e.stopPropagation();
|
|
@@ -10493,7 +11619,7 @@ var ViewportControls = ({
|
|
|
10493
11619
|
onChange: (e) => {
|
|
10494
11620
|
onZoom(parseFloat(e.currentTarget.value));
|
|
10495
11621
|
},
|
|
10496
|
-
children: zoomOptions.map((option) => /* @__PURE__ */
|
|
11622
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ jsx59(
|
|
10497
11623
|
"option",
|
|
10498
11624
|
{
|
|
10499
11625
|
value: option.value,
|
|
@@ -10505,13 +11631,13 @@ var ViewportControls = ({
|
|
|
10505
11631
|
)
|
|
10506
11632
|
] })
|
|
10507
11633
|
] }) }),
|
|
10508
|
-
/* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ jsx59(
|
|
10509
11635
|
"button",
|
|
10510
11636
|
{
|
|
10511
|
-
className:
|
|
11637
|
+
className: getClassName38("toggleButton"),
|
|
10512
11638
|
title: toggleMenuLabel,
|
|
10513
11639
|
onClick: () => setIsExpanded((s) => !s),
|
|
10514
|
-
children: isExpanded ? /* @__PURE__ */
|
|
11640
|
+
children: isExpanded ? /* @__PURE__ */ jsx59(X, { size: 16 }) : /* @__PURE__ */ jsx59(Monitor, { size: 16 })
|
|
10515
11641
|
}
|
|
10516
11642
|
)
|
|
10517
11643
|
]
|
|
@@ -10521,35 +11647,35 @@ var ViewportControls = ({
|
|
|
10521
11647
|
|
|
10522
11648
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
|
10523
11649
|
init_react_import();
|
|
10524
|
-
var
|
|
11650
|
+
var styles_module_default34 = { "PuckCanvas": "_PuckCanvas_zw9iy_1", "PuckCanvas-controls": "_PuckCanvas-controls_zw9iy_18", "PuckCanvas--fullScreen": "_PuckCanvas--fullScreen_zw9iy_23", "PuckCanvas-inner": "_PuckCanvas-inner_zw9iy_34", "PuckCanvas-root": "_PuckCanvas-root_zw9iy_43", "PuckCanvas--ready": "_PuckCanvas--ready_zw9iy_68", "PuckCanvas-loader": "_PuckCanvas-loader_zw9iy_73", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_zw9iy_84" };
|
|
10525
11651
|
|
|
10526
11652
|
// components/Puck/components/Canvas/index.tsx
|
|
10527
|
-
import { useShallow as
|
|
11653
|
+
import { useShallow as useShallow10 } from "zustand/react/shallow";
|
|
10528
11654
|
|
|
10529
11655
|
// lib/frame-context.tsx
|
|
10530
11656
|
init_react_import();
|
|
10531
11657
|
import {
|
|
10532
|
-
createContext as
|
|
10533
|
-
useContext as
|
|
11658
|
+
createContext as createContext8,
|
|
11659
|
+
useContext as useContext17,
|
|
10534
11660
|
useRef as useRef12,
|
|
10535
|
-
useMemo as
|
|
11661
|
+
useMemo as useMemo25
|
|
10536
11662
|
} from "react";
|
|
10537
|
-
import { jsx as
|
|
10538
|
-
var FrameContext =
|
|
11663
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
11664
|
+
var FrameContext = createContext8(null);
|
|
10539
11665
|
var FrameProvider = ({
|
|
10540
11666
|
children
|
|
10541
11667
|
}) => {
|
|
10542
11668
|
const frameRef = useRef12(null);
|
|
10543
|
-
const value =
|
|
11669
|
+
const value = useMemo25(
|
|
10544
11670
|
() => ({
|
|
10545
11671
|
frameRef
|
|
10546
11672
|
}),
|
|
10547
11673
|
[]
|
|
10548
11674
|
);
|
|
10549
|
-
return /* @__PURE__ */
|
|
11675
|
+
return /* @__PURE__ */ jsx60(FrameContext.Provider, { value, children });
|
|
10550
11676
|
};
|
|
10551
11677
|
var useCanvasFrame = () => {
|
|
10552
|
-
const context =
|
|
11678
|
+
const context = useContext17(FrameContext);
|
|
10553
11679
|
if (context === null) {
|
|
10554
11680
|
throw new Error("useCanvasFrame must be used within a FrameProvider");
|
|
10555
11681
|
}
|
|
@@ -10557,8 +11683,8 @@ var useCanvasFrame = () => {
|
|
|
10557
11683
|
};
|
|
10558
11684
|
|
|
10559
11685
|
// components/Puck/components/Canvas/index.tsx
|
|
10560
|
-
import { Fragment as Fragment17, jsx as
|
|
10561
|
-
var
|
|
11686
|
+
import { Fragment as Fragment17, jsx as jsx61, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11687
|
+
var getClassName39 = get_class_name_factory_default("PuckCanvas", styles_module_default34);
|
|
10562
11688
|
var ZOOM_ON_CHANGE = true;
|
|
10563
11689
|
var TRANSITION_DURATION = 150;
|
|
10564
11690
|
var Canvas = () => {
|
|
@@ -10576,7 +11702,7 @@ var Canvas = () => {
|
|
|
10576
11702
|
iframe,
|
|
10577
11703
|
_experimentalFullScreenCanvas
|
|
10578
11704
|
} = useAppStore(
|
|
10579
|
-
|
|
11705
|
+
useShallow10((s) => ({
|
|
10580
11706
|
dispatch: s.dispatch,
|
|
10581
11707
|
overrides: s.overrides,
|
|
10582
11708
|
setUi: s.setUi,
|
|
@@ -10594,7 +11720,7 @@ var Canvas = () => {
|
|
|
10594
11720
|
rightSideBarWidth,
|
|
10595
11721
|
viewports
|
|
10596
11722
|
} = useAppStore(
|
|
10597
|
-
|
|
11723
|
+
useShallow10((s) => ({
|
|
10598
11724
|
leftSideBarVisible: s.state.ui.leftSideBarVisible,
|
|
10599
11725
|
rightSideBarVisible: s.state.ui.rightSideBarVisible,
|
|
10600
11726
|
leftSideBarWidth: s.state.ui.leftSideBarWidth,
|
|
@@ -10602,17 +11728,17 @@ var Canvas = () => {
|
|
|
10602
11728
|
viewports: s.state.ui.viewports
|
|
10603
11729
|
}))
|
|
10604
11730
|
);
|
|
10605
|
-
const [showTransition, setShowTransition] =
|
|
11731
|
+
const [showTransition, setShowTransition] = useState22(false);
|
|
10606
11732
|
const isResizingRef = useRef13(false);
|
|
10607
|
-
const defaultRender =
|
|
10608
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */
|
|
11733
|
+
const defaultRender = useMemo26(() => {
|
|
11734
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ jsx61(Fragment17, { children });
|
|
10609
11735
|
return PuckDefault;
|
|
10610
11736
|
}, []);
|
|
10611
|
-
const CustomPreview =
|
|
11737
|
+
const CustomPreview = useMemo26(
|
|
10612
11738
|
() => overrides.preview || defaultRender,
|
|
10613
11739
|
[overrides]
|
|
10614
11740
|
);
|
|
10615
|
-
const getFrameDimensions =
|
|
11741
|
+
const getFrameDimensions = useCallback21(() => {
|
|
10616
11742
|
if (frameRef.current) {
|
|
10617
11743
|
const frame = frameRef.current;
|
|
10618
11744
|
const box = getBox(frame);
|
|
@@ -10655,7 +11781,7 @@ var Canvas = () => {
|
|
|
10655
11781
|
resizeObserver.disconnect();
|
|
10656
11782
|
};
|
|
10657
11783
|
}, [frameRef.current]);
|
|
10658
|
-
const [showLoader, setShowLoader] =
|
|
11784
|
+
const [showLoader, setShowLoader] = useState22(false);
|
|
10659
11785
|
useEffect25(() => {
|
|
10660
11786
|
setTimeout(() => {
|
|
10661
11787
|
setShowLoader(true);
|
|
@@ -10713,10 +11839,10 @@ var Canvas = () => {
|
|
|
10713
11839
|
appStoreApi,
|
|
10714
11840
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
10715
11841
|
]);
|
|
10716
|
-
return /* @__PURE__ */
|
|
11842
|
+
return /* @__PURE__ */ jsxs26(
|
|
10717
11843
|
"div",
|
|
10718
11844
|
{
|
|
10719
|
-
className:
|
|
11845
|
+
className: getClassName39({
|
|
10720
11846
|
ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
|
|
10721
11847
|
showLoader,
|
|
10722
11848
|
fullScreen: _experimentalFullScreenCanvas
|
|
@@ -10732,7 +11858,7 @@ var Canvas = () => {
|
|
|
10732
11858
|
}
|
|
10733
11859
|
},
|
|
10734
11860
|
children: [
|
|
10735
|
-
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */
|
|
11861
|
+
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ jsx61("div", { className: getClassName39("controls"), children: /* @__PURE__ */ jsx61(
|
|
10736
11862
|
ViewportControls,
|
|
10737
11863
|
{
|
|
10738
11864
|
fullScreen: _experimentalFullScreenCanvas,
|
|
@@ -10762,11 +11888,11 @@ var Canvas = () => {
|
|
|
10762
11888
|
}
|
|
10763
11889
|
}
|
|
10764
11890
|
) }),
|
|
10765
|
-
/* @__PURE__ */
|
|
10766
|
-
/* @__PURE__ */
|
|
11891
|
+
/* @__PURE__ */ jsxs26("div", { className: getClassName39("inner"), ref: frameRef, children: [
|
|
11892
|
+
/* @__PURE__ */ jsx61(
|
|
10767
11893
|
"div",
|
|
10768
11894
|
{
|
|
10769
|
-
className:
|
|
11895
|
+
className: getClassName39("root"),
|
|
10770
11896
|
style: {
|
|
10771
11897
|
width: iframe.enabled ? viewports.current.width : "100%",
|
|
10772
11898
|
height: zoomConfig.rootHeight,
|
|
@@ -10780,10 +11906,10 @@ var Canvas = () => {
|
|
|
10780
11906
|
setShowTransition(false);
|
|
10781
11907
|
isResizingRef.current = false;
|
|
10782
11908
|
},
|
|
10783
|
-
children: /* @__PURE__ */
|
|
11909
|
+
children: /* @__PURE__ */ jsx61(CustomPreview, { children: /* @__PURE__ */ jsx61(Preview2, {}) })
|
|
10784
11910
|
}
|
|
10785
11911
|
),
|
|
10786
|
-
/* @__PURE__ */
|
|
11912
|
+
/* @__PURE__ */ jsx61("div", { className: getClassName39("loader"), children: /* @__PURE__ */ jsx61(Loader, { size: 24 }) })
|
|
10787
11913
|
] })
|
|
10788
11914
|
]
|
|
10789
11915
|
}
|
|
@@ -10792,9 +11918,9 @@ var Canvas = () => {
|
|
|
10792
11918
|
|
|
10793
11919
|
// lib/use-sidebar-resize.ts
|
|
10794
11920
|
init_react_import();
|
|
10795
|
-
import { useCallback as
|
|
11921
|
+
import { useCallback as useCallback22, useEffect as useEffect26, useRef as useRef14, useState as useState23 } from "react";
|
|
10796
11922
|
function useSidebarResize(position, dispatch) {
|
|
10797
|
-
const [width, setWidth] =
|
|
11923
|
+
const [width, setWidth] = useState23(null);
|
|
10798
11924
|
const sidebarRef = useRef14(null);
|
|
10799
11925
|
const storeWidth = useAppStore(
|
|
10800
11926
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
@@ -10829,7 +11955,7 @@ function useSidebarResize(position, dispatch) {
|
|
|
10829
11955
|
setWidth(storeWidth);
|
|
10830
11956
|
}
|
|
10831
11957
|
}, [storeWidth]);
|
|
10832
|
-
const handleResizeEnd =
|
|
11958
|
+
const handleResizeEnd = useCallback22(
|
|
10833
11959
|
(width2) => {
|
|
10834
11960
|
dispatch({
|
|
10835
11961
|
type: "setUi",
|
|
@@ -10876,15 +12002,15 @@ init_react_import();
|
|
|
10876
12002
|
|
|
10877
12003
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
10878
12004
|
init_react_import();
|
|
10879
|
-
import { useCallback as
|
|
12005
|
+
import { useCallback as useCallback23, useRef as useRef15 } from "react";
|
|
10880
12006
|
|
|
10881
12007
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
|
|
10882
12008
|
init_react_import();
|
|
10883
|
-
var
|
|
12009
|
+
var styles_module_default35 = { "ResizeHandle": "_ResizeHandle_144bf_2", "ResizeHandle--left": "_ResizeHandle--left_144bf_16", "ResizeHandle--right": "_ResizeHandle--right_144bf_20" };
|
|
10884
12010
|
|
|
10885
12011
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
10886
|
-
import { jsx as
|
|
10887
|
-
var
|
|
12012
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
12013
|
+
var getClassName40 = get_class_name_factory_default("ResizeHandle", styles_module_default35);
|
|
10888
12014
|
var ResizeHandle = ({
|
|
10889
12015
|
position,
|
|
10890
12016
|
sidebarRef,
|
|
@@ -10897,7 +12023,7 @@ var ResizeHandle = ({
|
|
|
10897
12023
|
const isDragging = useRef15(false);
|
|
10898
12024
|
const startX = useRef15(0);
|
|
10899
12025
|
const startWidth = useRef15(0);
|
|
10900
|
-
const handleMouseMove =
|
|
12026
|
+
const handleMouseMove = useCallback23(
|
|
10901
12027
|
(e) => {
|
|
10902
12028
|
if (!isDragging.current) return;
|
|
10903
12029
|
const delta = e.clientX - startX.current;
|
|
@@ -10908,7 +12034,7 @@ var ResizeHandle = ({
|
|
|
10908
12034
|
},
|
|
10909
12035
|
[onResize, position]
|
|
10910
12036
|
);
|
|
10911
|
-
const handleMouseUp =
|
|
12037
|
+
const handleMouseUp = useCallback23(() => {
|
|
10912
12038
|
var _a;
|
|
10913
12039
|
if (!isDragging.current) return;
|
|
10914
12040
|
isDragging.current = false;
|
|
@@ -10924,7 +12050,7 @@ var ResizeHandle = ({
|
|
|
10924
12050
|
onResizeEnd(finalWidth);
|
|
10925
12051
|
resetAutoZoom();
|
|
10926
12052
|
}, [onResizeEnd]);
|
|
10927
|
-
const handleMouseDown =
|
|
12053
|
+
const handleMouseDown = useCallback23(
|
|
10928
12054
|
(e) => {
|
|
10929
12055
|
var _a;
|
|
10930
12056
|
isDragging.current = true;
|
|
@@ -10942,11 +12068,11 @@ var ResizeHandle = ({
|
|
|
10942
12068
|
},
|
|
10943
12069
|
[position, handleMouseMove, handleMouseUp]
|
|
10944
12070
|
);
|
|
10945
|
-
return /* @__PURE__ */
|
|
12071
|
+
return /* @__PURE__ */ jsx62(
|
|
10946
12072
|
"div",
|
|
10947
12073
|
{
|
|
10948
12074
|
ref: handleRef,
|
|
10949
|
-
className:
|
|
12075
|
+
className: getClassName40({ [position]: true }),
|
|
10950
12076
|
onMouseDown: handleMouseDown
|
|
10951
12077
|
}
|
|
10952
12078
|
);
|
|
@@ -10954,11 +12080,11 @@ var ResizeHandle = ({
|
|
|
10954
12080
|
|
|
10955
12081
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Sidebar/styles.module.css#css-module
|
|
10956
12082
|
init_react_import();
|
|
10957
|
-
var
|
|
12083
|
+
var styles_module_default36 = { "Sidebar": "_Sidebar_16oed_1", "Sidebar--isVisible": "_Sidebar--isVisible_16oed_10", "Sidebar--left": "_Sidebar--left_16oed_14", "Sidebar--right": "_Sidebar--right_16oed_34", "Sidebar-resizeHandle": "_Sidebar-resizeHandle_16oed_51" };
|
|
10958
12084
|
|
|
10959
12085
|
// components/Puck/components/Sidebar/index.tsx
|
|
10960
|
-
import { Fragment as Fragment18, jsx as
|
|
10961
|
-
var
|
|
12086
|
+
import { Fragment as Fragment18, jsx as jsx63, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12087
|
+
var getClassName41 = get_class_name_factory_default("Sidebar", styles_module_default36);
|
|
10962
12088
|
var Sidebar = ({
|
|
10963
12089
|
position,
|
|
10964
12090
|
sidebarRef,
|
|
@@ -10967,16 +12093,16 @@ var Sidebar = ({
|
|
|
10967
12093
|
onResizeEnd,
|
|
10968
12094
|
children
|
|
10969
12095
|
}) => {
|
|
10970
|
-
return /* @__PURE__ */
|
|
10971
|
-
/* @__PURE__ */
|
|
12096
|
+
return /* @__PURE__ */ jsxs27(Fragment18, { children: [
|
|
12097
|
+
/* @__PURE__ */ jsx63(
|
|
10972
12098
|
"div",
|
|
10973
12099
|
{
|
|
10974
12100
|
ref: sidebarRef,
|
|
10975
|
-
className:
|
|
12101
|
+
className: getClassName41({ [position]: true, isVisible }),
|
|
10976
12102
|
children
|
|
10977
12103
|
}
|
|
10978
12104
|
),
|
|
10979
|
-
/* @__PURE__ */
|
|
12105
|
+
/* @__PURE__ */ jsx63("div", { className: `${getClassName41("resizeHandle")}`, children: /* @__PURE__ */ jsx63(
|
|
10980
12106
|
ResizeHandle,
|
|
10981
12107
|
{
|
|
10982
12108
|
position,
|
|
@@ -10990,7 +12116,7 @@ var Sidebar = ({
|
|
|
10990
12116
|
|
|
10991
12117
|
// lib/use-delete-hotkeys.ts
|
|
10992
12118
|
init_react_import();
|
|
10993
|
-
import { useCallback as
|
|
12119
|
+
import { useCallback as useCallback24 } from "react";
|
|
10994
12120
|
var isElementVisible = (element) => {
|
|
10995
12121
|
let current = element;
|
|
10996
12122
|
while (current && current !== document.body) {
|
|
@@ -11025,7 +12151,7 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
11025
12151
|
};
|
|
11026
12152
|
var useDeleteHotkeys = () => {
|
|
11027
12153
|
const appStore = useAppStoreApi();
|
|
11028
|
-
const deleteSelectedComponent =
|
|
12154
|
+
const deleteSelectedComponent = useCallback24(
|
|
11029
12155
|
(e) => {
|
|
11030
12156
|
var _a;
|
|
11031
12157
|
if (shouldBlockDeleteHotkey(e)) {
|
|
@@ -11054,12 +12180,12 @@ init_react_import();
|
|
|
11054
12180
|
|
|
11055
12181
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Nav/styles.module.css#css-module
|
|
11056
12182
|
init_react_import();
|
|
11057
|
-
var
|
|
12183
|
+
var styles_module_default37 = { "Nav": "_Nav_vll2r_1", "Nav-list": "_Nav-list_vll2r_5", "Nav-mobileActions": "_Nav-mobileActions_vll2r_23", "NavItem-link": "_NavItem-link_vll2r_39", "NavItem": "_NavItem_vll2r_39", "NavItem-linkIcon": "_NavItem-linkIcon_vll2r_90", "NavItem--active": "_NavItem--active_vll2r_100", "NavItem--mobileOnly": "_NavItem--mobileOnly_vll2r_136", "NavItem--desktopOnly": "_NavItem--desktopOnly_vll2r_141" };
|
|
11058
12184
|
|
|
11059
12185
|
// components/Puck/components/Nav/index.tsx
|
|
11060
|
-
import { jsx as
|
|
11061
|
-
var
|
|
11062
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem",
|
|
12186
|
+
import { jsx as jsx64, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12187
|
+
var getClassName42 = get_class_name_factory_default("Nav", styles_module_default37);
|
|
12188
|
+
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default37);
|
|
11063
12189
|
var MenuItem = ({
|
|
11064
12190
|
label,
|
|
11065
12191
|
icon,
|
|
@@ -11068,7 +12194,7 @@ var MenuItem = ({
|
|
|
11068
12194
|
mobileOnly,
|
|
11069
12195
|
desktopOnly
|
|
11070
12196
|
}) => {
|
|
11071
|
-
return /* @__PURE__ */
|
|
12197
|
+
return /* @__PURE__ */ jsx64(
|
|
11072
12198
|
"li",
|
|
11073
12199
|
{
|
|
11074
12200
|
className: getClassNameItem3({
|
|
@@ -11076,9 +12202,9 @@ var MenuItem = ({
|
|
|
11076
12202
|
mobileOnly,
|
|
11077
12203
|
desktopOnly
|
|
11078
12204
|
}),
|
|
11079
|
-
children: onClick && /* @__PURE__ */
|
|
11080
|
-
icon && /* @__PURE__ */
|
|
11081
|
-
/* @__PURE__ */
|
|
12205
|
+
children: onClick && /* @__PURE__ */ jsxs28("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
12206
|
+
icon && /* @__PURE__ */ jsx64("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
12207
|
+
/* @__PURE__ */ jsx64("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
11082
12208
|
] })
|
|
11083
12209
|
}
|
|
11084
12210
|
);
|
|
@@ -11087,9 +12213,9 @@ var Nav = ({
|
|
|
11087
12213
|
items,
|
|
11088
12214
|
mobileActions
|
|
11089
12215
|
}) => {
|
|
11090
|
-
return /* @__PURE__ */
|
|
11091
|
-
/* @__PURE__ */
|
|
11092
|
-
mobileActions && /* @__PURE__ */
|
|
12216
|
+
return /* @__PURE__ */ jsxs28("nav", { className: getClassName42(), children: [
|
|
12217
|
+
/* @__PURE__ */ jsx64("ul", { className: getClassName42("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ jsx64(MenuItem, __spreadValues({}, item), key)) }),
|
|
12218
|
+
mobileActions && /* @__PURE__ */ jsx64("div", { className: getClassName42("mobileActions"), children: mobileActions })
|
|
11093
12219
|
] });
|
|
11094
12220
|
};
|
|
11095
12221
|
|
|
@@ -11102,10 +12228,10 @@ var normalizeIframeConfig = (iframe) => __spreadValues({
|
|
|
11102
12228
|
}, iframe);
|
|
11103
12229
|
|
|
11104
12230
|
// components/Puck/components/Layout/index.tsx
|
|
11105
|
-
import { jsx as
|
|
11106
|
-
var
|
|
11107
|
-
var getLayoutClassName = get_class_name_factory_default("PuckLayout",
|
|
11108
|
-
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab",
|
|
12231
|
+
import { jsx as jsx65, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12232
|
+
var getClassName43 = get_class_name_factory_default("Puck", styles_module_default29);
|
|
12233
|
+
var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default29);
|
|
12234
|
+
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default29);
|
|
11109
12235
|
var useBrowserLayoutEffect = typeof window === "undefined" ? useEffect28 : useLayoutEffect2;
|
|
11110
12236
|
var FieldSideBar = () => {
|
|
11111
12237
|
const pageLabel = useMessage("label-page");
|
|
@@ -11115,16 +12241,17 @@ var FieldSideBar = () => {
|
|
|
11115
12241
|
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : (_c = s.config.root) == null ? void 0 : _c.label;
|
|
11116
12242
|
}
|
|
11117
12243
|
);
|
|
11118
|
-
return /* @__PURE__ */
|
|
12244
|
+
return /* @__PURE__ */ jsx65(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ jsx65(Fields, {}) });
|
|
11119
12245
|
};
|
|
11120
12246
|
var PluginTab = ({
|
|
11121
12247
|
children,
|
|
11122
12248
|
visible,
|
|
11123
12249
|
mobileOnly
|
|
11124
12250
|
}) => {
|
|
11125
|
-
return /* @__PURE__ */
|
|
12251
|
+
return /* @__PURE__ */ jsx65("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ jsx65("div", { className: getPluginTabClassName("body"), children }) });
|
|
11126
12252
|
};
|
|
11127
12253
|
var Layout = ({ children }) => {
|
|
12254
|
+
var _a, _b;
|
|
11128
12255
|
const {
|
|
11129
12256
|
iframe: _iframe,
|
|
11130
12257
|
dnd,
|
|
@@ -11132,7 +12259,7 @@ var Layout = ({ children }) => {
|
|
|
11132
12259
|
plugins,
|
|
11133
12260
|
height
|
|
11134
12261
|
} = usePropsContext();
|
|
11135
|
-
const iframe =
|
|
12262
|
+
const iframe = useMemo27(
|
|
11136
12263
|
() => normalizeIframeConfig(_iframe),
|
|
11137
12264
|
[_iframe]
|
|
11138
12265
|
);
|
|
@@ -11179,11 +12306,11 @@ var Layout = ({ children }) => {
|
|
|
11179
12306
|
};
|
|
11180
12307
|
}, []);
|
|
11181
12308
|
const overrides = useAppStore((s) => s.overrides);
|
|
11182
|
-
const CustomPuck =
|
|
12309
|
+
const CustomPuck = useMemo27(
|
|
11183
12310
|
() => overrides.puck || DefaultOverride,
|
|
11184
12311
|
[overrides]
|
|
11185
12312
|
);
|
|
11186
|
-
const [mounted, setMounted] =
|
|
12313
|
+
const [mounted, setMounted] = useState24(false);
|
|
11187
12314
|
useBrowserLayoutEffect(() => {
|
|
11188
12315
|
setMounted(true);
|
|
11189
12316
|
}, []);
|
|
@@ -11208,19 +12335,18 @@ var Layout = ({ children }) => {
|
|
|
11208
12335
|
}
|
|
11209
12336
|
const setUi = useAppStore((s) => s.setUi);
|
|
11210
12337
|
const currentPlugin = useAppStore((s) => {
|
|
11211
|
-
var
|
|
11212
|
-
return (
|
|
12338
|
+
var _a2;
|
|
12339
|
+
return (_a2 = s.state.ui.plugin) == null ? void 0 : _a2.current;
|
|
11213
12340
|
});
|
|
11214
12341
|
const appStoreApi = useAppStoreApi();
|
|
11215
|
-
const
|
|
11216
|
-
const hasLegacySideBarPlugin = useMemo24(
|
|
12342
|
+
const hasLegacySideBarPlugin = useMemo27(
|
|
11217
12343
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
11218
12344
|
[plugins]
|
|
11219
12345
|
);
|
|
11220
12346
|
const blocksLabel = useMessage("plugin-blocks");
|
|
11221
12347
|
const outlineLabel = useMessage("plugin-outline");
|
|
11222
12348
|
const fieldsLabel = useMessage("plugin-fields");
|
|
11223
|
-
const pluginItems =
|
|
12349
|
+
const pluginItems = useMemo27(() => {
|
|
11224
12350
|
const details = {};
|
|
11225
12351
|
const defaultPlugins = [
|
|
11226
12352
|
blocksPlugin({ label: blocksLabel }),
|
|
@@ -11235,17 +12361,15 @@ var Layout = ({ children }) => {
|
|
|
11235
12361
|
combinedPlugins.push(fieldsPlugin({ label: fieldsLabel }));
|
|
11236
12362
|
}
|
|
11237
12363
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
11238
|
-
var
|
|
12364
|
+
var _a2, _b2, _c;
|
|
11239
12365
|
if (plugin.name && plugin.render) {
|
|
11240
12366
|
if (details[plugin.name]) {
|
|
11241
12367
|
delete details[plugin.name];
|
|
11242
12368
|
}
|
|
11243
12369
|
details[plugin.name] = {
|
|
11244
|
-
label: (
|
|
11245
|
-
icon: (
|
|
12370
|
+
label: (_a2 = plugin.label) != null ? _a2 : plugin.name,
|
|
12371
|
+
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */ jsx65(ToyBrick, {}),
|
|
11246
12372
|
onClick: () => {
|
|
11247
|
-
var _a2;
|
|
11248
|
-
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
11249
12373
|
if (plugin.name === currentPlugin) {
|
|
11250
12374
|
if (leftSideBarVisible) {
|
|
11251
12375
|
setUi({ leftSideBarVisible: false });
|
|
@@ -11263,6 +12387,7 @@ var Layout = ({ children }) => {
|
|
|
11263
12387
|
},
|
|
11264
12388
|
isActive: leftSideBarVisible && currentPlugin === plugin.name,
|
|
11265
12389
|
render: plugin.render,
|
|
12390
|
+
mobilePanelHeight: (_c = plugin.mobilePanelHeight) != null ? _c : "toggle",
|
|
11266
12391
|
mobileOnly: hasLegacySideBarPlugin || plugin.mobileOnly,
|
|
11267
12392
|
desktopOnly: plugin.name === "legacy-side-bar" || plugin.desktopOnly
|
|
11268
12393
|
};
|
|
@@ -11278,6 +12403,8 @@ var Layout = ({ children }) => {
|
|
|
11278
12403
|
outlineLabel,
|
|
11279
12404
|
fieldsLabel
|
|
11280
12405
|
]);
|
|
12406
|
+
const activePlugin = currentPlugin != null ? currentPlugin : Object.keys(pluginItems)[0];
|
|
12407
|
+
const mobilePanelHeightMode = (_b = (_a = pluginItems[activePlugin]) == null ? void 0 : _a.mobilePanelHeight) != null ? _b : "toggle";
|
|
11281
12408
|
useEffect28(() => {
|
|
11282
12409
|
if (!currentPlugin) {
|
|
11283
12410
|
const names = Object.keys(pluginItems);
|
|
@@ -11287,22 +12414,22 @@ var Layout = ({ children }) => {
|
|
|
11287
12414
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
11288
12415
|
const mobilePanelExpanded = useAppStore(
|
|
11289
12416
|
(s) => {
|
|
11290
|
-
var
|
|
11291
|
-
return (
|
|
12417
|
+
var _a2;
|
|
12418
|
+
return (_a2 = s.state.ui.mobilePanelExpanded) != null ? _a2 : false;
|
|
11292
12419
|
}
|
|
11293
12420
|
);
|
|
11294
12421
|
const maximizeLabel = useMessage("layout-maximize");
|
|
11295
12422
|
const minimizeLabel = useMessage("layout-minimize");
|
|
11296
|
-
return /* @__PURE__ */
|
|
12423
|
+
return /* @__PURE__ */ jsxs29(
|
|
11297
12424
|
"div",
|
|
11298
12425
|
{
|
|
11299
|
-
className: `Puck ${
|
|
12426
|
+
className: `Puck ${getClassName43({
|
|
11300
12427
|
hidePlugins: hasLegacySideBarPlugin
|
|
11301
12428
|
})}`,
|
|
11302
12429
|
id: instanceId,
|
|
11303
12430
|
style: { height, visibility: "hidden" },
|
|
11304
12431
|
children: [
|
|
11305
|
-
/* @__PURE__ */
|
|
12432
|
+
/* @__PURE__ */ jsx65(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ jsx65(CustomPuck, { children: children || /* @__PURE__ */ jsx65(FrameProvider, { children: /* @__PURE__ */ jsx65(
|
|
11306
12433
|
"div",
|
|
11307
12434
|
{
|
|
11308
12435
|
className: getLayoutClassName({
|
|
@@ -11314,18 +12441,18 @@ var Layout = ({ children }) => {
|
|
|
11314
12441
|
mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
|
|
11315
12442
|
}),
|
|
11316
12443
|
style: { height },
|
|
11317
|
-
children: /* @__PURE__ */
|
|
12444
|
+
children: /* @__PURE__ */ jsxs29(
|
|
11318
12445
|
"div",
|
|
11319
12446
|
{
|
|
11320
12447
|
className: getLayoutClassName("inner"),
|
|
11321
12448
|
style: layoutOptions,
|
|
11322
12449
|
children: [
|
|
11323
|
-
/* @__PURE__ */
|
|
11324
|
-
/* @__PURE__ */
|
|
12450
|
+
/* @__PURE__ */ jsx65("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ jsx65(Header, { hidePlugins: hasLegacySideBarPlugin }) }),
|
|
12451
|
+
/* @__PURE__ */ jsx65("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ jsx65(
|
|
11325
12452
|
Nav,
|
|
11326
12453
|
{
|
|
11327
12454
|
items: pluginItems,
|
|
11328
|
-
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */
|
|
12455
|
+
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ jsx65(
|
|
11329
12456
|
IconButton,
|
|
11330
12457
|
{
|
|
11331
12458
|
type: "button",
|
|
@@ -11335,12 +12462,12 @@ var Layout = ({ children }) => {
|
|
|
11335
12462
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
11336
12463
|
});
|
|
11337
12464
|
},
|
|
11338
|
-
children: mobilePanelExpanded ? /* @__PURE__ */
|
|
12465
|
+
children: mobilePanelExpanded ? /* @__PURE__ */ jsx65(Minimize2, { size: 21 }) : /* @__PURE__ */ jsx65(Maximize2, { size: 21 })
|
|
11339
12466
|
}
|
|
11340
12467
|
)
|
|
11341
12468
|
}
|
|
11342
12469
|
) }),
|
|
11343
|
-
/* @__PURE__ */
|
|
12470
|
+
/* @__PURE__ */ jsx65(
|
|
11344
12471
|
Sidebar,
|
|
11345
12472
|
{
|
|
11346
12473
|
position: "left",
|
|
@@ -11349,20 +12476,20 @@ var Layout = ({ children }) => {
|
|
|
11349
12476
|
onResize: setLeftWidth,
|
|
11350
12477
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
11351
12478
|
children: Object.entries(pluginItems).map(
|
|
11352
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */
|
|
12479
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ jsx65(
|
|
11353
12480
|
PluginTab,
|
|
11354
12481
|
{
|
|
11355
12482
|
visible: currentPlugin === id,
|
|
11356
12483
|
mobileOnly,
|
|
11357
|
-
children: /* @__PURE__ */
|
|
12484
|
+
children: /* @__PURE__ */ jsx65(Render2, {})
|
|
11358
12485
|
},
|
|
11359
12486
|
id
|
|
11360
12487
|
)
|
|
11361
12488
|
)
|
|
11362
12489
|
}
|
|
11363
12490
|
),
|
|
11364
|
-
/* @__PURE__ */
|
|
11365
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */
|
|
12491
|
+
/* @__PURE__ */ jsx65(Canvas, {}),
|
|
12492
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ jsx65(
|
|
11366
12493
|
Sidebar,
|
|
11367
12494
|
{
|
|
11368
12495
|
position: "right",
|
|
@@ -11370,7 +12497,7 @@ var Layout = ({ children }) => {
|
|
|
11370
12497
|
isVisible: rightSideBarVisible,
|
|
11371
12498
|
onResize: setRightWidth,
|
|
11372
12499
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
11373
|
-
children: /* @__PURE__ */
|
|
12500
|
+
children: /* @__PURE__ */ jsx65(FieldSideBar, {})
|
|
11374
12501
|
}
|
|
11375
12502
|
)
|
|
11376
12503
|
]
|
|
@@ -11378,19 +12505,19 @@ var Layout = ({ children }) => {
|
|
|
11378
12505
|
)
|
|
11379
12506
|
}
|
|
11380
12507
|
) }) }) }),
|
|
11381
|
-
/* @__PURE__ */
|
|
12508
|
+
/* @__PURE__ */ jsx65("div", { id: "puck-portal-root", className: getClassName43("portal") })
|
|
11382
12509
|
]
|
|
11383
12510
|
}
|
|
11384
12511
|
);
|
|
11385
12512
|
};
|
|
11386
12513
|
|
|
11387
12514
|
// components/Puck/index.tsx
|
|
11388
|
-
import { jsx as
|
|
11389
|
-
var propsContext =
|
|
12515
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
12516
|
+
var propsContext = createContext9({});
|
|
11390
12517
|
function PropsProvider(props) {
|
|
11391
|
-
return /* @__PURE__ */
|
|
12518
|
+
return /* @__PURE__ */ jsx66(propsContext.Provider, { value: props, children: props.children });
|
|
11392
12519
|
}
|
|
11393
|
-
var usePropsContext = () =>
|
|
12520
|
+
var usePropsContext = () => useContext18(propsContext);
|
|
11394
12521
|
function PuckProvider({ children }) {
|
|
11395
12522
|
const {
|
|
11396
12523
|
config,
|
|
@@ -11402,6 +12529,7 @@ function PuckProvider({ children }) {
|
|
|
11402
12529
|
overrides,
|
|
11403
12530
|
viewports = defaultViewports,
|
|
11404
12531
|
iframe: _iframe,
|
|
12532
|
+
dnd,
|
|
11405
12533
|
initialHistory: _initialHistory,
|
|
11406
12534
|
metadata,
|
|
11407
12535
|
dictionary,
|
|
@@ -11410,11 +12538,11 @@ function PuckProvider({ children }) {
|
|
|
11410
12538
|
_experimentalFullScreenCanvas,
|
|
11411
12539
|
_experimentalVirtualization
|
|
11412
12540
|
} = usePropsContext();
|
|
11413
|
-
const iframe =
|
|
12541
|
+
const iframe = useMemo28(
|
|
11414
12542
|
() => normalizeIframeConfig(_iframe),
|
|
11415
12543
|
[_iframe]
|
|
11416
12544
|
);
|
|
11417
|
-
const [generatedAppState] =
|
|
12545
|
+
const [generatedAppState] = useState25(() => {
|
|
11418
12546
|
var _a, _b, _c;
|
|
11419
12547
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
11420
12548
|
let clientUiState = {};
|
|
@@ -11454,7 +12582,7 @@ function PuckProvider({ children }) {
|
|
|
11454
12582
|
return walkAppState(newAppState, config);
|
|
11455
12583
|
});
|
|
11456
12584
|
const { appendData = true } = _initialHistory || {};
|
|
11457
|
-
const [blendedHistories] =
|
|
12585
|
+
const [blendedHistories] = useState25(
|
|
11458
12586
|
[
|
|
11459
12587
|
...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
|
|
11460
12588
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -11468,7 +12596,7 @@ function PuckProvider({ children }) {
|
|
|
11468
12596
|
});
|
|
11469
12597
|
})
|
|
11470
12598
|
);
|
|
11471
|
-
const initialHistoryIndex =
|
|
12599
|
+
const initialHistoryIndex = useMemo28(() => {
|
|
11472
12600
|
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
11473
12601
|
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
11474
12602
|
}
|
|
@@ -11479,7 +12607,7 @@ function PuckProvider({ children }) {
|
|
|
11479
12607
|
overrides,
|
|
11480
12608
|
plugins
|
|
11481
12609
|
});
|
|
11482
|
-
const loadedFieldTransforms =
|
|
12610
|
+
const loadedFieldTransforms = useMemo28(() => {
|
|
11483
12611
|
const _plugins = plugins || [];
|
|
11484
12612
|
const pluginFieldTransforms = _plugins.reduce(
|
|
11485
12613
|
(acc, plugin) => __spreadValues(__spreadValues({}, acc), plugin.fieldTransforms),
|
|
@@ -11488,7 +12616,7 @@ function PuckProvider({ children }) {
|
|
|
11488
12616
|
return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
|
|
11489
12617
|
}, [fieldTransforms, plugins]);
|
|
11490
12618
|
const instanceId = useSafeId();
|
|
11491
|
-
const generateAppStore =
|
|
12619
|
+
const generateAppStore = useCallback25(
|
|
11492
12620
|
(state) => {
|
|
11493
12621
|
return {
|
|
11494
12622
|
instanceId,
|
|
@@ -11503,6 +12631,7 @@ function PuckProvider({ children }) {
|
|
|
11503
12631
|
onAction,
|
|
11504
12632
|
metadata,
|
|
11505
12633
|
dictionary: dictionary || {},
|
|
12634
|
+
dnd,
|
|
11506
12635
|
fieldTransforms: loadedFieldTransforms
|
|
11507
12636
|
};
|
|
11508
12637
|
},
|
|
@@ -11519,10 +12648,11 @@ function PuckProvider({ children }) {
|
|
|
11519
12648
|
onAction,
|
|
11520
12649
|
metadata,
|
|
11521
12650
|
dictionary,
|
|
12651
|
+
dnd,
|
|
11522
12652
|
loadedFieldTransforms
|
|
11523
12653
|
]
|
|
11524
12654
|
);
|
|
11525
|
-
const [appStore] =
|
|
12655
|
+
const [appStore] = useState25(
|
|
11526
12656
|
() => createAppStore(generateAppStore(initialAppState))
|
|
11527
12657
|
);
|
|
11528
12658
|
useEffect29(() => {
|
|
@@ -11560,10 +12690,10 @@ function PuckProvider({ children }) {
|
|
|
11560
12690
|
resolveAndCommitData();
|
|
11561
12691
|
}, 0);
|
|
11562
12692
|
}, []);
|
|
11563
|
-
return /* @__PURE__ */
|
|
12693
|
+
return /* @__PURE__ */ jsx66(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx66(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
|
|
11564
12694
|
}
|
|
11565
12695
|
function Puck(props) {
|
|
11566
|
-
return /* @__PURE__ */
|
|
12696
|
+
return /* @__PURE__ */ jsx66(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx66(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx66(Layout, { children: props.children }) })) }));
|
|
11567
12697
|
}
|
|
11568
12698
|
Puck.Components = Components;
|
|
11569
12699
|
Puck.Fields = Fields;
|
|
@@ -11573,7 +12703,7 @@ Puck.Preview = Preview2;
|
|
|
11573
12703
|
|
|
11574
12704
|
// plugins/legacy-side-bar/index.tsx
|
|
11575
12705
|
init_react_import();
|
|
11576
|
-
import { jsx as
|
|
12706
|
+
import { jsx as jsx67, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11577
12707
|
var LegacySideBar = ({
|
|
11578
12708
|
outlineLabel,
|
|
11579
12709
|
componentsLabel
|
|
@@ -11582,14 +12712,14 @@ var LegacySideBar = ({
|
|
|
11582
12712
|
const outlineLabelMessage = useMessage("plugin-outline");
|
|
11583
12713
|
const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
|
|
11584
12714
|
const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
|
|
11585
|
-
return /* @__PURE__ */
|
|
11586
|
-
/* @__PURE__ */
|
|
11587
|
-
/* @__PURE__ */
|
|
12715
|
+
return /* @__PURE__ */ jsxs30("div", { style: { overflowY: "auto" }, children: [
|
|
12716
|
+
/* @__PURE__ */ jsx67(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ jsx67(Components, {}) }),
|
|
12717
|
+
/* @__PURE__ */ jsx67(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ jsx67(Outline, {}) })
|
|
11588
12718
|
] });
|
|
11589
12719
|
};
|
|
11590
12720
|
var legacySideBarPlugin = (props = {}) => ({
|
|
11591
12721
|
name: "legacy-side-bar",
|
|
11592
|
-
render: () => /* @__PURE__ */
|
|
12722
|
+
render: () => /* @__PURE__ */ jsx67(
|
|
11593
12723
|
LegacySideBar,
|
|
11594
12724
|
{
|
|
11595
12725
|
outlineLabel: props.outlineLabel,
|