@puckeditor/core 0.23.0-canary.9bf3e00a → 0.23.0-canary.db035ce5
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-Q6WCB6GM.mjs → chunk-OQD6Q7CY.mjs} +1835 -706
- package/dist/{chunk-EYJW64M2.mjs → chunk-OSPG5CWL.mjs} +1 -1
- package/dist/{chunk-BMRBP3ET.mjs → chunk-PJYHZPJK.mjs} +3 -3
- 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 +1940 -725
- 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 +1940 -725
- 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
package/dist/no-external.js
CHANGED
|
@@ -480,6 +480,20 @@ var init_chevron_up = __esm({
|
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
482
|
|
|
483
|
+
// ../../node_modules/lucide-react/dist/esm/icons/chevrons-down-up.js
|
|
484
|
+
var ChevronsDownUp;
|
|
485
|
+
var init_chevrons_down_up = __esm({
|
|
486
|
+
"../../node_modules/lucide-react/dist/esm/icons/chevrons-down-up.js"() {
|
|
487
|
+
"use strict";
|
|
488
|
+
init_react_import();
|
|
489
|
+
init_createLucideIcon();
|
|
490
|
+
ChevronsDownUp = createLucideIcon("ChevronsDownUp", [
|
|
491
|
+
["path", { d: "m7 20 5-5 5 5", key: "13a0gw" }],
|
|
492
|
+
["path", { d: "m7 4 5 5 5-5", key: "1kwcof" }]
|
|
493
|
+
]);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
|
|
483
497
|
// ../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js
|
|
484
498
|
var CircleCheckBig;
|
|
485
499
|
var init_circle_check_big = __esm({
|
|
@@ -1266,6 +1280,7 @@ var init_lucide_react = __esm({
|
|
|
1266
1280
|
init_chevron_down();
|
|
1267
1281
|
init_chevron_right();
|
|
1268
1282
|
init_chevron_up();
|
|
1283
|
+
init_chevrons_down_up();
|
|
1269
1284
|
init_code();
|
|
1270
1285
|
init_copy();
|
|
1271
1286
|
init_corner_left_up();
|
|
@@ -1323,7 +1338,7 @@ var init_IconButton_module = __esm({
|
|
|
1323
1338
|
"use strict";
|
|
1324
1339
|
init_react_import();
|
|
1325
1340
|
init_css_module_data2();
|
|
1326
|
-
IconButton_module_default = { "IconButton": "
|
|
1341
|
+
IconButton_module_default = { "IconButton": "_IconButton_1pxxt_1", "IconButton--active": "_IconButton--active_1pxxt_15", "IconButton--disabled": "_IconButton--disabled_1pxxt_28" };
|
|
1327
1342
|
}
|
|
1328
1343
|
});
|
|
1329
1344
|
|
|
@@ -2333,16 +2348,13 @@ var init_remove2 = __esm({
|
|
|
2333
2348
|
init_walk_app_state();
|
|
2334
2349
|
removeAction = (state, action, appStore) => {
|
|
2335
2350
|
const item = getItem({ index: action.index, zone: action.zone }, state);
|
|
2336
|
-
const nodesToDelete =
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
},
|
|
2344
|
-
[item.props.id]
|
|
2345
|
-
);
|
|
2351
|
+
const nodesToDelete = /* @__PURE__ */ new Set([item.props.id]);
|
|
2352
|
+
Object.entries(state.indexes.nodes).forEach(([nodeId, nodeData]) => {
|
|
2353
|
+
const pathIds = nodeData.path.map((p) => p.split(":")[0]);
|
|
2354
|
+
if (pathIds.includes(item.props.id)) {
|
|
2355
|
+
nodesToDelete.add(nodeId);
|
|
2356
|
+
}
|
|
2357
|
+
});
|
|
2346
2358
|
const newState = walkAppState(
|
|
2347
2359
|
state,
|
|
2348
2360
|
appStore.config,
|
|
@@ -2355,19 +2367,22 @@ var init_remove2 = __esm({
|
|
|
2355
2367
|
);
|
|
2356
2368
|
Object.keys(newState.data.zones || {}).forEach((zoneCompound) => {
|
|
2357
2369
|
const parentId = zoneCompound.split(":")[0];
|
|
2358
|
-
if (nodesToDelete.
|
|
2370
|
+
if (nodesToDelete.has(parentId) && newState.data.zones) {
|
|
2359
2371
|
delete newState.data.zones[zoneCompound];
|
|
2360
2372
|
}
|
|
2361
2373
|
});
|
|
2362
2374
|
Object.keys(newState.indexes.zones).forEach((zoneCompound) => {
|
|
2363
2375
|
const parentId = zoneCompound.split(":")[0];
|
|
2364
|
-
if (nodesToDelete.
|
|
2376
|
+
if (nodesToDelete.has(parentId)) {
|
|
2365
2377
|
delete newState.indexes.zones[zoneCompound];
|
|
2366
2378
|
}
|
|
2367
2379
|
});
|
|
2380
|
+
const newItemExpanded = __spreadValues({}, newState.ui.itemExpanded);
|
|
2368
2381
|
nodesToDelete.forEach((id) => {
|
|
2369
2382
|
delete newState.indexes.nodes[id];
|
|
2383
|
+
delete newItemExpanded[id];
|
|
2370
2384
|
});
|
|
2385
|
+
newState.ui = __spreadProps(__spreadValues({}, newState.ui), { itemExpanded: newItemExpanded });
|
|
2371
2386
|
return newState;
|
|
2372
2387
|
};
|
|
2373
2388
|
}
|
|
@@ -2471,19 +2486,43 @@ var init_set_data = __esm({
|
|
|
2471
2486
|
});
|
|
2472
2487
|
|
|
2473
2488
|
// reducer/actions/set-ui.ts
|
|
2474
|
-
var setUiAction;
|
|
2489
|
+
var revealSelectedItem, setUiAction;
|
|
2475
2490
|
var init_set_ui = __esm({
|
|
2476
2491
|
"reducer/actions/set-ui.ts"() {
|
|
2477
2492
|
"use strict";
|
|
2478
2493
|
init_react_import();
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2494
|
+
init_get_item();
|
|
2495
|
+
init_root_droppable_id();
|
|
2496
|
+
revealSelectedItem = (state, partialUi) => {
|
|
2497
|
+
var _a, _b;
|
|
2498
|
+
const itemSelector = partialUi.itemSelector;
|
|
2499
|
+
if (!itemSelector) {
|
|
2500
|
+
return partialUi;
|
|
2501
|
+
}
|
|
2502
|
+
const item = getItem(itemSelector, state);
|
|
2503
|
+
if (!item) {
|
|
2504
|
+
return partialUi;
|
|
2505
|
+
}
|
|
2506
|
+
const path = (_b = (_a = state.indexes.nodes[item.props.id]) == null ? void 0 : _a.path) != null ? _b : [];
|
|
2507
|
+
const collapsedAncestorIds = path.map((zoneCompound) => zoneCompound.split(":")[0]).filter(
|
|
2508
|
+
(ancestorId) => {
|
|
2509
|
+
var _a2, _b2;
|
|
2510
|
+
return ancestorId && ancestorId !== rootAreaId && !((_a2 = state.ui.itemExpanded) == null ? void 0 : _a2[ancestorId]) && !((_b2 = partialUi.itemExpanded) == null ? void 0 : _b2[ancestorId]);
|
|
2511
|
+
}
|
|
2512
|
+
);
|
|
2513
|
+
if (collapsedAncestorIds.length === 0) {
|
|
2514
|
+
return partialUi;
|
|
2484
2515
|
}
|
|
2516
|
+
const itemExpanded = __spreadValues(__spreadValues({}, state.ui.itemExpanded), partialUi.itemExpanded);
|
|
2517
|
+
collapsedAncestorIds.forEach((ancestorId) => {
|
|
2518
|
+
itemExpanded[ancestorId] = true;
|
|
2519
|
+
});
|
|
2520
|
+
return __spreadProps(__spreadValues({}, partialUi), { itemExpanded });
|
|
2521
|
+
};
|
|
2522
|
+
setUiAction = (state, action) => {
|
|
2523
|
+
const partialUi = typeof action.ui === "object" ? action.ui : action.ui(state.ui);
|
|
2485
2524
|
return __spreadProps(__spreadValues({}, state), {
|
|
2486
|
-
ui: __spreadValues(__spreadValues({}, state.ui),
|
|
2525
|
+
ui: __spreadValues(__spreadValues({}, state.ui), revealSelectedItem(state, partialUi))
|
|
2487
2526
|
});
|
|
2488
2527
|
};
|
|
2489
2528
|
}
|
|
@@ -3342,6 +3381,7 @@ var init_default_app_state = __esm({
|
|
|
3342
3381
|
itemSelector: null,
|
|
3343
3382
|
componentList: {},
|
|
3344
3383
|
isDragging: false,
|
|
3384
|
+
itemExpanded: {},
|
|
3345
3385
|
previewMode: "edit",
|
|
3346
3386
|
viewports: {
|
|
3347
3387
|
current: {
|
|
@@ -3416,6 +3456,7 @@ var init_store = __esm({
|
|
|
3416
3456
|
_experimentalVirtualization: false,
|
|
3417
3457
|
metadata: {},
|
|
3418
3458
|
dictionary: {},
|
|
3459
|
+
dnd: {},
|
|
3419
3460
|
fieldTransforms: {}
|
|
3420
3461
|
}, initialAppStore), {
|
|
3421
3462
|
fields: createFieldsSlice(set, get),
|
|
@@ -3833,8 +3874,12 @@ var init_dictionary = __esm({
|
|
|
3833
3874
|
"label-component": "Component",
|
|
3834
3875
|
// Outline
|
|
3835
3876
|
"outline-empty": "No items",
|
|
3836
|
-
"outline-collapse": "Collapse",
|
|
3837
|
-
"outline-expand": "Expand",
|
|
3877
|
+
"outline-item-collapse": "Collapse",
|
|
3878
|
+
"outline-item-expand": "Expand",
|
|
3879
|
+
"outline-header-title": "Outline",
|
|
3880
|
+
"outline-header-collapseall": "Collapse all",
|
|
3881
|
+
"outline-item-duplicate": "Duplicate",
|
|
3882
|
+
"outline-item-delete": "Delete",
|
|
3838
3883
|
// Drawer (component list)
|
|
3839
3884
|
"drawer-category-collapse": "Collapse {title}",
|
|
3840
3885
|
"drawer-category-expand": "Expand {title}",
|
|
@@ -6052,6 +6097,8 @@ init_store();
|
|
|
6052
6097
|
// components/Sortable/index.tsx
|
|
6053
6098
|
init_react_import();
|
|
6054
6099
|
var import_react15 = require("@dnd-kit/react");
|
|
6100
|
+
var import_sortable = require("@dnd-kit/react/sortable");
|
|
6101
|
+
var import_dom2 = require("@dnd-kit/dom");
|
|
6055
6102
|
|
|
6056
6103
|
// lib/dnd/use-sensors.ts
|
|
6057
6104
|
init_react_import();
|
|
@@ -6409,9 +6456,26 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
6409
6456
|
return null;
|
|
6410
6457
|
});
|
|
6411
6458
|
|
|
6459
|
+
// lib/dnd/get-insert-index.ts
|
|
6460
|
+
init_react_import();
|
|
6461
|
+
var getCollisionPosition = (direction, dir = "ltr") => direction === "up" || dir === "ltr" && direction === "left" || dir === "rtl" && direction === "right" ? "before" : "after";
|
|
6462
|
+
var getInsertIndex = ({
|
|
6463
|
+
position,
|
|
6464
|
+
sourceIndex,
|
|
6465
|
+
targetIndex,
|
|
6466
|
+
isSameZone
|
|
6467
|
+
}) => {
|
|
6468
|
+
let index = targetIndex;
|
|
6469
|
+
if (isSameZone && index >= sourceIndex) {
|
|
6470
|
+
index = index - 1;
|
|
6471
|
+
}
|
|
6472
|
+
if (position === "after") {
|
|
6473
|
+
index = index + 1;
|
|
6474
|
+
}
|
|
6475
|
+
return index;
|
|
6476
|
+
};
|
|
6477
|
+
|
|
6412
6478
|
// components/Sortable/index.tsx
|
|
6413
|
-
var import_sortable = require("@dnd-kit/react/sortable");
|
|
6414
|
-
var import_dom2 = require("@dnd-kit/dom");
|
|
6415
6479
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6416
6480
|
var SortableProvider = ({
|
|
6417
6481
|
children,
|
|
@@ -6436,20 +6500,18 @@ var SortableProvider = ({
|
|
|
6436
6500
|
const { operation } = event;
|
|
6437
6501
|
const { source, target } = operation;
|
|
6438
6502
|
if (!source || !target) return;
|
|
6439
|
-
|
|
6440
|
-
|
|
6503
|
+
const sourceIndex = source.data.index;
|
|
6504
|
+
const targetIndex = target.data.index;
|
|
6441
6505
|
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
6442
6506
|
if (sourceIndex !== targetIndex && source.id !== target.id) {
|
|
6443
|
-
const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" ? "before" : "after";
|
|
6444
|
-
if (targetIndex >= sourceIndex) {
|
|
6445
|
-
targetIndex = targetIndex - 1;
|
|
6446
|
-
}
|
|
6447
|
-
if (collisionPosition === "after") {
|
|
6448
|
-
targetIndex = targetIndex + 1;
|
|
6449
|
-
}
|
|
6450
6507
|
onMove({
|
|
6451
6508
|
source: sourceIndex,
|
|
6452
|
-
target:
|
|
6509
|
+
target: getInsertIndex({
|
|
6510
|
+
position: getCollisionPosition(collisionData == null ? void 0 : collisionData.direction),
|
|
6511
|
+
sourceIndex,
|
|
6512
|
+
targetIndex,
|
|
6513
|
+
isSameZone: true
|
|
6514
|
+
})
|
|
6453
6515
|
});
|
|
6454
6516
|
}
|
|
6455
6517
|
},
|
|
@@ -8967,6 +9029,25 @@ var styles_module_default16 = { "DropZone": "_DropZone_ybznu_1", "DropZone--hasC
|
|
|
8967
9029
|
init_store();
|
|
8968
9030
|
var import_react69 = require("@dnd-kit/react");
|
|
8969
9031
|
|
|
9032
|
+
// lib/data/is-component-allowed.ts
|
|
9033
|
+
init_react_import();
|
|
9034
|
+
var isComponentAllowed = (componentType, { allow, disallow }) => {
|
|
9035
|
+
if (!componentType) {
|
|
9036
|
+
return true;
|
|
9037
|
+
}
|
|
9038
|
+
const allowed = new Set(allow);
|
|
9039
|
+
const disallowed = new Set(disallow);
|
|
9040
|
+
if (disallow) {
|
|
9041
|
+
if (disallowed.has(componentType) && allowed.has(componentType)) {
|
|
9042
|
+
disallowed.delete(componentType);
|
|
9043
|
+
}
|
|
9044
|
+
return !disallowed.has(componentType);
|
|
9045
|
+
} else if (allow) {
|
|
9046
|
+
return allowed.has(componentType);
|
|
9047
|
+
}
|
|
9048
|
+
return true;
|
|
9049
|
+
};
|
|
9050
|
+
|
|
8970
9051
|
// components/DropZone/lib/use-min-empty-height.ts
|
|
8971
9052
|
init_react_import();
|
|
8972
9053
|
var import_react53 = require("react");
|
|
@@ -10362,25 +10443,7 @@ var DropZoneEdit = (0, import_react68.forwardRef)(
|
|
|
10362
10443
|
}, [zoneContentIds]);
|
|
10363
10444
|
const ref = (0, import_react68.useRef)(null);
|
|
10364
10445
|
const acceptsTarget = (0, import_react68.useCallback)(
|
|
10365
|
-
(componentType) => {
|
|
10366
|
-
if (!componentType) {
|
|
10367
|
-
return true;
|
|
10368
|
-
}
|
|
10369
|
-
if (disallow) {
|
|
10370
|
-
const defaultedAllow = allow || [];
|
|
10371
|
-
const filteredDisallow = (disallow || []).filter(
|
|
10372
|
-
(item) => defaultedAllow.indexOf(item) === -1
|
|
10373
|
-
);
|
|
10374
|
-
if (filteredDisallow.indexOf(componentType) !== -1) {
|
|
10375
|
-
return false;
|
|
10376
|
-
}
|
|
10377
|
-
} else if (allow) {
|
|
10378
|
-
if (allow.indexOf(componentType) === -1) {
|
|
10379
|
-
return false;
|
|
10380
|
-
}
|
|
10381
|
-
}
|
|
10382
|
-
return true;
|
|
10383
|
-
},
|
|
10446
|
+
(componentType) => isComponentAllowed(componentType, { allow, disallow }),
|
|
10384
10447
|
[allow, disallow]
|
|
10385
10448
|
);
|
|
10386
10449
|
const targetAccepted = useContextStore(ZoneStoreContext, (s) => {
|
|
@@ -11239,16 +11302,16 @@ var DragDropContextClient = ({
|
|
|
11239
11302
|
if (target.type === "component") {
|
|
11240
11303
|
const targetData = target.data;
|
|
11241
11304
|
targetZone = targetData.zone;
|
|
11242
|
-
targetIndex = targetData.index;
|
|
11243
11305
|
const collisionData = (_b = manager.collisionObserver.collisions[0]) == null ? void 0 : _b.data;
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
targetIndex
|
|
11251
|
-
|
|
11306
|
+
targetIndex = getInsertIndex({
|
|
11307
|
+
position: getCollisionPosition(
|
|
11308
|
+
collisionData == null ? void 0 : collisionData.direction,
|
|
11309
|
+
getDeepDir(target.element)
|
|
11310
|
+
),
|
|
11311
|
+
sourceIndex,
|
|
11312
|
+
targetIndex: targetData.index,
|
|
11313
|
+
isSameZone: sourceZone === targetZone
|
|
11314
|
+
});
|
|
11252
11315
|
} else {
|
|
11253
11316
|
targetZone = target.id.toString();
|
|
11254
11317
|
targetIndex = 0;
|
|
@@ -11512,7 +11575,7 @@ init_IconButton2();
|
|
|
11512
11575
|
|
|
11513
11576
|
// components/Puck/index.tsx
|
|
11514
11577
|
init_react_import();
|
|
11515
|
-
var
|
|
11578
|
+
var import_react103 = require("react");
|
|
11516
11579
|
init_store();
|
|
11517
11580
|
|
|
11518
11581
|
// components/Puck/components/Fields/index.tsx
|
|
@@ -12002,6 +12065,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
12002
12065
|
--puck-color-focus-ring: var(--puck-color-azure-05);
|
|
12003
12066
|
--puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );
|
|
12004
12067
|
--puck-color-selection-border: var(--puck-color-azure-08);
|
|
12068
|
+
--puck-color-insertion-indicator: var(--puck-color-azure-06);
|
|
12005
12069
|
--puck-color-highlight: var(--puck-color-rose-07);
|
|
12006
12070
|
--puck-color-bg-disabled: var(--puck-color-grey-07);
|
|
12007
12071
|
--puck-color-text-disabled: var(--puck-color-grey-03);
|
|
@@ -12036,6 +12100,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
12036
12100
|
--puck-font-weight-heavy: 800;
|
|
12037
12101
|
--puck-letter-spacing-ui: 0.05ch;
|
|
12038
12102
|
--puck-letter-spacing-heading: 0.08ch;
|
|
12103
|
+
--puck-icon-size-xs: 14px;
|
|
12039
12104
|
--puck-icon-size-s: 16px;
|
|
12040
12105
|
--puck-icon-size-m: 18px;
|
|
12041
12106
|
--puck-icon-size-l: 24px;
|
|
@@ -12569,7 +12634,7 @@ textarea._Input-input_qyenz_29 {
|
|
|
12569
12634
|
}
|
|
12570
12635
|
|
|
12571
12636
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
12572
|
-
.
|
|
12637
|
+
._IconButton_1pxxt_1 {
|
|
12573
12638
|
align-items: center;
|
|
12574
12639
|
background: var(--puck-iconbutton-color-bg, transparent);
|
|
12575
12640
|
border: none;
|
|
@@ -12581,26 +12646,26 @@ textarea._Input-input_qyenz_29 {
|
|
|
12581
12646
|
padding: var(--puck-iconbutton-space, var(--puck-space-1));
|
|
12582
12647
|
transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
12583
12648
|
}
|
|
12584
|
-
._IconButton--
|
|
12649
|
+
._IconButton--active_1pxxt_15 {
|
|
12585
12650
|
color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
|
|
12586
12651
|
}
|
|
12587
|
-
.
|
|
12652
|
+
._IconButton_1pxxt_1:focus-visible {
|
|
12588
12653
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
12589
12654
|
outline-offset: calc(var(--puck-border-width-focus) * -1);
|
|
12590
12655
|
}
|
|
12591
12656
|
@media (hover: hover) and (pointer: fine) {
|
|
12592
|
-
.
|
|
12593
|
-
background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
|
|
12657
|
+
._IconButton_1pxxt_1:hover:not(._IconButton--disabled_1pxxt_28) {
|
|
12658
|
+
background: var( --_puck-iconbutton-color-bg-hover, var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) ) );
|
|
12594
12659
|
color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
|
|
12595
12660
|
cursor: pointer;
|
|
12596
12661
|
transition: none;
|
|
12597
12662
|
}
|
|
12598
12663
|
}
|
|
12599
|
-
.
|
|
12664
|
+
._IconButton_1pxxt_1:active {
|
|
12600
12665
|
background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
|
|
12601
12666
|
transition: none;
|
|
12602
12667
|
}
|
|
12603
|
-
._IconButton--
|
|
12668
|
+
._IconButton--disabled_1pxxt_28 {
|
|
12604
12669
|
color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
|
|
12605
12670
|
}
|
|
12606
12671
|
|
|
@@ -13709,138 +13774,327 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
13709
13774
|
}
|
|
13710
13775
|
|
|
13711
13776
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css/#css-module-data */
|
|
13712
|
-
.
|
|
13777
|
+
._PuckPreview_zbic3_1 {
|
|
13713
13778
|
position: relative;
|
|
13714
13779
|
height: 100%;
|
|
13715
13780
|
}
|
|
13716
|
-
._PuckPreview-
|
|
13781
|
+
._PuckPreview-frame_zbic3_6 {
|
|
13717
13782
|
border: none;
|
|
13718
13783
|
height: 100%;
|
|
13719
13784
|
width: 100%;
|
|
13720
13785
|
}
|
|
13786
|
+
._PuckPreview-frame_zbic3_6[data-puck-outline-dragging] {
|
|
13787
|
+
pointer-events: none;
|
|
13788
|
+
}
|
|
13721
13789
|
|
|
13722
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
13723
|
-
.
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
|
|
13790
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css/#css-module-data */
|
|
13791
|
+
._DropLine_eyz3q_2 {
|
|
13792
|
+
background: var(--_puck-outline-color-drop-indicator);
|
|
13793
|
+
border-radius: calc(var(--_puck-outline-drop-indicator-size) / 2);
|
|
13794
|
+
height: var(--_puck-outline-drop-indicator-size);
|
|
13795
|
+
inset-inline: 0;
|
|
13796
|
+
pointer-events: none;
|
|
13797
|
+
position: absolute;
|
|
13798
|
+
z-index: 1;
|
|
13731
13799
|
}
|
|
13732
|
-
.
|
|
13733
|
-
|
|
13734
|
-
font-size: var(--puck-outline-zone-font-size, var(--puck-font-size-xxxs));
|
|
13735
|
-
text-transform: uppercase;
|
|
13800
|
+
._DropLine--top_eyz3q_12 {
|
|
13801
|
+
top: 0;
|
|
13736
13802
|
}
|
|
13737
|
-
.
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13803
|
+
._DropLine--bottom_eyz3q_16 {
|
|
13804
|
+
bottom: 0;
|
|
13805
|
+
}
|
|
13806
|
+
._DropLine--top_eyz3q_12._DropLine--outset_eyz3q_20 {
|
|
13807
|
+
top: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
13808
|
+
}
|
|
13809
|
+
._DropLine--bottom_eyz3q_16._DropLine--outset_eyz3q_20 {
|
|
13810
|
+
bottom: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
13811
|
+
}
|
|
13812
|
+
|
|
13813
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css/#css-module-data */
|
|
13814
|
+
._LayerTree-helper_1niov_2 {
|
|
13815
|
+
color: var(--puck-outline-color-text-helper, var(--puck-color-text-subtle));
|
|
13816
|
+
padding-top: var(--puck-space-1);
|
|
13817
|
+
padding-bottom: var(--puck-space-1);
|
|
13818
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
13819
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
13741
13820
|
}
|
|
13742
|
-
.
|
|
13821
|
+
._LayerTree-helper_1niov_2[data-puck-drop-target] {
|
|
13743
13822
|
position: relative;
|
|
13744
|
-
|
|
13745
|
-
border-radius: var(--puck-outline-radius, var(--puck-radius-m));
|
|
13823
|
+
overflow: visible;
|
|
13746
13824
|
}
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13825
|
+
|
|
13826
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css/#css-module-data */
|
|
13827
|
+
._Layer_1o110_1 {
|
|
13828
|
+
position: relative;
|
|
13829
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
13830
|
+
border-radius: var(--_puck-outline-radius);
|
|
13831
|
+
}
|
|
13832
|
+
._Layer-inner_1o110_8 {
|
|
13833
|
+
align-items: center;
|
|
13834
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
13835
|
+
border-radius: var(--_puck-outline-radius);
|
|
13836
|
+
cursor: pointer;
|
|
13837
|
+
display: flex;
|
|
13838
|
+
position: relative;
|
|
13750
13839
|
transition: color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
13751
13840
|
}
|
|
13752
|
-
._Layer--
|
|
13753
|
-
|
|
13841
|
+
._Layer--isSortable_1o110_18 > ._Layer-inner_1o110_8 {
|
|
13842
|
+
cursor: grab;
|
|
13843
|
+
}
|
|
13844
|
+
._Layer-content_1o110_22 {
|
|
13845
|
+
display: flex;
|
|
13846
|
+
gap: var(--puck-space-4);
|
|
13847
|
+
flex: 1 1 auto;
|
|
13848
|
+
min-width: 0;
|
|
13754
13849
|
}
|
|
13755
|
-
._Layer-
|
|
13850
|
+
._Layer-clickable_1o110_29 {
|
|
13756
13851
|
align-items: center;
|
|
13757
13852
|
background: none;
|
|
13758
13853
|
border: 0;
|
|
13759
|
-
border-radius: var(--
|
|
13854
|
+
border-radius: var(--_puck-outline-radius);
|
|
13760
13855
|
color: inherit;
|
|
13761
|
-
cursor:
|
|
13856
|
+
cursor: inherit;
|
|
13762
13857
|
display: flex;
|
|
13858
|
+
flex: 1 1 auto;
|
|
13763
13859
|
font: inherit;
|
|
13764
|
-
|
|
13765
|
-
padding
|
|
13766
|
-
|
|
13860
|
+
min-width: 0;
|
|
13861
|
+
padding: 0;
|
|
13862
|
+
}
|
|
13863
|
+
[data-puck-dnd-disabled] ._Layer-inner_1o110_8,
|
|
13864
|
+
[data-puck-dnd-disabled] ._Layer-clickable_1o110_29 {
|
|
13865
|
+
cursor: pointer;
|
|
13767
13866
|
}
|
|
13768
|
-
._Layer-
|
|
13867
|
+
._Layer-clickable_1o110_29:focus-visible {
|
|
13769
13868
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
13770
13869
|
outline-offset: var(--puck-border-width-focus);
|
|
13771
13870
|
position: relative;
|
|
13772
13871
|
z-index: 1;
|
|
13773
13872
|
}
|
|
13873
|
+
._Layer-caret_1o110_57 {
|
|
13874
|
+
visibility: hidden;
|
|
13875
|
+
display: flex;
|
|
13876
|
+
flex-shrink: 0;
|
|
13877
|
+
}
|
|
13878
|
+
._Layer-caret_1o110_57 svg {
|
|
13879
|
+
height: var(--_puck-outline-caret-size);
|
|
13880
|
+
width: var(--_puck-outline-caret-size);
|
|
13881
|
+
}
|
|
13882
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-content_1o110_22 {
|
|
13883
|
+
font-weight: var(--puck-font-weight-bold);
|
|
13884
|
+
}
|
|
13885
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 {
|
|
13886
|
+
visibility: visible;
|
|
13887
|
+
}
|
|
13888
|
+
._Layer-title_1o110_76 {
|
|
13889
|
+
display: flex;
|
|
13890
|
+
gap: var(--puck-space-2);
|
|
13891
|
+
align-items: center;
|
|
13892
|
+
overflow-x: hidden;
|
|
13893
|
+
margin: var(--puck-space-1);
|
|
13894
|
+
cursor: pointer;
|
|
13895
|
+
}
|
|
13896
|
+
._Layer-name_1o110_85 {
|
|
13897
|
+
overflow-x: hidden;
|
|
13898
|
+
text-overflow: ellipsis;
|
|
13899
|
+
white-space: nowrap;
|
|
13900
|
+
}
|
|
13901
|
+
._Layer-icon_1o110_91 {
|
|
13902
|
+
color: var(--puck-outline-color-icon, var(--puck-color-text-subtle));
|
|
13903
|
+
margin-top: var(--puck-space-1);
|
|
13904
|
+
}
|
|
13905
|
+
._Layer-icon_1o110_91 svg {
|
|
13906
|
+
height: var(--_puck-outline-icon-size);
|
|
13907
|
+
width: var(--_puck-outline-icon-size);
|
|
13908
|
+
}
|
|
13909
|
+
._Layer-zones_1o110_101 {
|
|
13910
|
+
display: none;
|
|
13911
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-4));
|
|
13912
|
+
}
|
|
13913
|
+
._Layer--isExpanded_1o110_106 > ._Layer-zones_1o110_101 {
|
|
13914
|
+
display: block;
|
|
13915
|
+
}
|
|
13916
|
+
._Layer--isExpanded_1o110_106 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 svg {
|
|
13917
|
+
transform: rotate(90deg);
|
|
13918
|
+
}
|
|
13774
13919
|
@media (hover: hover) and (pointer: fine) {
|
|
13775
|
-
.
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13920
|
+
._Layer_1o110_1:not(._Layer--isSelected_1o110_115) > ._Layer-inner_1o110_8:hover {
|
|
13921
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-hover);
|
|
13922
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
13923
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
13779
13924
|
transition: none;
|
|
13780
13925
|
}
|
|
13781
13926
|
}
|
|
13782
|
-
._Layer--
|
|
13927
|
+
._Layer--isSelected_1o110_115 {
|
|
13783
13928
|
border-color: var( --puck-outline-color-border-selected, var(--puck-color-selection-border) );
|
|
13784
13929
|
}
|
|
13785
|
-
._Layer--
|
|
13786
|
-
|
|
13930
|
+
._Layer--isSelected_1o110_115 > ._Layer-inner_1o110_8 {
|
|
13931
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-selected);
|
|
13932
|
+
background: var(--_puck-outline-color-bg-selected);
|
|
13787
13933
|
}
|
|
13788
|
-
._Layer--
|
|
13789
|
-
|
|
13790
|
-
|
|
13934
|
+
._Layer--isExpandCandidate_1o110_138 > ._Layer-inner_1o110_8 {
|
|
13935
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
13936
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
13791
13937
|
}
|
|
13792
|
-
._Layer-
|
|
13793
|
-
|
|
13794
|
-
|
|
13938
|
+
._Layer--isDragSource_1o110_143 > ._Layer-inner_1o110_8 {
|
|
13939
|
+
color: var(--puck-color-text-muted);
|
|
13940
|
+
background: transparent;
|
|
13795
13941
|
}
|
|
13796
|
-
._Layer--
|
|
13797
|
-
|
|
13798
|
-
|
|
13942
|
+
._Layer--isDragSource_1o110_143 > ._Layer-zones_1o110_101 {
|
|
13943
|
+
opacity: 0.5;
|
|
13944
|
+
}
|
|
13945
|
+
|
|
13946
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css/#css-module-data */
|
|
13947
|
+
._LayerActions_1m5z5_2 {
|
|
13948
|
+
position: sticky;
|
|
13949
|
+
inset-inline-end: calc(var(--puck-space-1) * -1);
|
|
13950
|
+
padding-inline: var(--puck-space-1);
|
|
13951
|
+
display: flex;
|
|
13952
|
+
visibility: hidden;
|
|
13953
|
+
flex-shrink: 0;
|
|
13954
|
+
gap: var(--puck-space-1);
|
|
13955
|
+
color: var(--_puck-outline-color-text);
|
|
13956
|
+
background: var(--_puck-outline-actions-color-bg);
|
|
13957
|
+
}
|
|
13958
|
+
._LayerActions--visible_1m5z5_17 {
|
|
13959
|
+
visibility: visible;
|
|
13799
13960
|
}
|
|
13800
|
-
.
|
|
13801
|
-
|
|
13961
|
+
._LayerActions_1m5z5_2 svg {
|
|
13962
|
+
height: var(--_puck-outline-caret-size);
|
|
13963
|
+
width: var(--_puck-outline-caret-size);
|
|
13802
13964
|
}
|
|
13803
|
-
|
|
13804
|
-
.
|
|
13965
|
+
|
|
13966
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css/#css-module-data */
|
|
13967
|
+
._LayerTree_o5tyt_1 {
|
|
13968
|
+
color: var(--_puck-outline-color-text);
|
|
13969
|
+
font-family: var(--puck-outline-font-family, var(--puck-font-family));
|
|
13970
|
+
font-size: var(--puck-outline-font-size, var(--puck-font-size-xxxs));
|
|
13971
|
+
margin: 0;
|
|
13972
|
+
position: relative;
|
|
13973
|
+
list-style: none;
|
|
13974
|
+
padding: 0;
|
|
13975
|
+
}
|
|
13976
|
+
._LayerTree--nested_o5tyt_12 {
|
|
13977
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-3));
|
|
13978
|
+
}
|
|
13979
|
+
|
|
13980
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css/#css-module-data */
|
|
13981
|
+
._LayerTree-zoneTitle_fvhlh_2 {
|
|
13982
|
+
color: var(--_puck-outline-zone-color-text);
|
|
13983
|
+
font-size: var( --puck-outline-zone-font-size, calc(var(--puck-font-size-xxxs) * 0.9) );
|
|
13805
13984
|
display: flex;
|
|
13806
13985
|
gap: var(--puck-space-2);
|
|
13807
13986
|
align-items: center;
|
|
13808
|
-
margin: var(--puck-space-2) var(--puck-space-1);
|
|
13809
13987
|
overflow-x: hidden;
|
|
13988
|
+
padding-top: var(--puck-space-1);
|
|
13989
|
+
padding-bottom: var(--puck-space-1);
|
|
13990
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
13991
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
13810
13992
|
}
|
|
13811
|
-
.
|
|
13812
|
-
overflow-x: hidden;
|
|
13813
|
-
text-overflow: ellipsis;
|
|
13814
|
-
white-space: nowrap;
|
|
13815
|
-
}
|
|
13816
|
-
._Layer-icon_1vltj_125 {
|
|
13817
|
-
color: var(--puck-outline-color-icon, var(--puck-color-highlight));
|
|
13993
|
+
._LayerTree-zoneIcon_fvhlh_19 {
|
|
13818
13994
|
margin-top: var(--puck-space-1);
|
|
13819
13995
|
}
|
|
13820
|
-
.
|
|
13821
|
-
|
|
13822
|
-
|
|
13996
|
+
._LayerTree-zoneIcon_fvhlh_19 svg {
|
|
13997
|
+
height: var(--_puck-outline-icon-size);
|
|
13998
|
+
width: var(--_puck-outline-icon-size);
|
|
13999
|
+
}
|
|
14000
|
+
._LayerTree-zoneTitle_fvhlh_2[data-puck-drop-target] {
|
|
14001
|
+
color: var(--_puck-outline-color-text-hover);
|
|
14002
|
+
position: relative;
|
|
14003
|
+
overflow: visible;
|
|
14004
|
+
}
|
|
14005
|
+
|
|
14006
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
14007
|
+
._LayerTreeRoot_kxnd1_1 {
|
|
14008
|
+
min-width: max-content;
|
|
14009
|
+
--_puck-iconbutton-color-bg-hover: transparent;
|
|
14010
|
+
--_puck-outline-color-text: var( --puck-outline-color-text, var(--puck-color-text-secondary) );
|
|
14011
|
+
--_puck-outline-border-width: var( --puck-outline-border-width, var(--puck-border-width-regular) );
|
|
14012
|
+
--_puck-outline-radius: var(--puck-outline-radius, var(--puck-radius-m));
|
|
14013
|
+
--_puck-outline-caret-size: var( --puck-outline-action-size, var(--puck-icon-size-s) );
|
|
14014
|
+
--_puck-outline-icon-size: var( --puck-outline-icon-size, var(--puck-icon-size-xs) );
|
|
14015
|
+
--_puck-outline-color-bg-selected: var( --puck-outline-color-bg-selected, var(--puck-color-interactive-subtle) );
|
|
14016
|
+
--_puck-outline-color-bg-hover: var( --puck-outline-color-bg-hover, var(--puck-color-interactive-soft) );
|
|
14017
|
+
--_puck-outline-color-border-hover: var( --puck-outline-color-border-hover, var(--puck-color-interactive-subtle) );
|
|
14018
|
+
--_puck-outline-color-text-hover: var( --puck-outline-color-text-hover, var(--puck-color-interactive) );
|
|
14019
|
+
--_puck-outline-color-drop-indicator: var( --puck-outline-color-drop-indicator, var(--puck-color-insertion-indicator) );
|
|
14020
|
+
--_puck-outline-drop-indicator-size: var(--puck-border-width-focus);
|
|
14021
|
+
--_puck-outline-zone-color-text: var( --puck-outline-zone-color-text, var(--puck-color-text-muted) );
|
|
14022
|
+
--_puck-outline-actions-color-bg: transparent;
|
|
14023
|
+
--_puck-outline-caret-slot: calc( var(--_puck-outline-caret-size) + var(--puck-iconbutton-space, var(--puck-space-1)) * 2 );
|
|
14024
|
+
--_puck-outline-label-indent: calc( var(--_puck-outline-caret-slot) + var(--puck-space-1) + var(--_puck-outline-border-width) );
|
|
14025
|
+
}
|
|
14026
|
+
|
|
14027
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css/#css-module-data */
|
|
14028
|
+
._CollapseAll_1r4cy_1 {
|
|
14029
|
+
visibility: hidden;
|
|
14030
|
+
}
|
|
14031
|
+
._CollapseAll-icon_1r4cy_5 {
|
|
14032
|
+
height: var(--puck-icon-size-m);
|
|
14033
|
+
width: var(--puck-icon-size-m);
|
|
14034
|
+
}
|
|
14035
|
+
._CollapseAll--visible_1r4cy_10 {
|
|
14036
|
+
visibility: visible;
|
|
14037
|
+
}
|
|
14038
|
+
|
|
14039
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css/#css-module-data */
|
|
14040
|
+
._OutlineHeader_filq3_1 {
|
|
14041
|
+
display: flex;
|
|
14042
|
+
align-items: center;
|
|
14043
|
+
width: 100%;
|
|
14044
|
+
gap: var(--puck-space-2);
|
|
14045
|
+
padding-block: var(--puck-space-3);
|
|
14046
|
+
padding-inline: var(--puck-space-4);
|
|
14047
|
+
border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
14048
|
+
box-sizing: border-box;
|
|
14049
|
+
}
|
|
14050
|
+
._OutlineHeader-title_filq3_12 {
|
|
14051
|
+
color: var(--puck-color-text-secondary);
|
|
14052
|
+
font-size: var(--puck-font-size-xs);
|
|
14053
|
+
font-weight: var(--puck-font-weight-regular);
|
|
14054
|
+
line-height: var(--puck-line-height-m);
|
|
14055
|
+
margin: 0;
|
|
14056
|
+
}
|
|
14057
|
+
|
|
14058
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css/#css-module-data */
|
|
14059
|
+
._OutlineWrapper_b9ln0_1 {
|
|
14060
|
+
display: flex;
|
|
14061
|
+
flex-direction: column;
|
|
14062
|
+
flex-grow: 1;
|
|
14063
|
+
min-height: 0;
|
|
14064
|
+
min-width: 0;
|
|
14065
|
+
}
|
|
14066
|
+
._OutlineWrapper-collapseAll_b9ln0_9 {
|
|
14067
|
+
display: flex;
|
|
14068
|
+
align-items: center;
|
|
14069
|
+
margin-inline-start: auto;
|
|
14070
|
+
}
|
|
14071
|
+
._OutlineWrapper-layers_b9ln0_15 {
|
|
14072
|
+
flex-grow: 1;
|
|
14073
|
+
min-height: 0;
|
|
14074
|
+
overflow: auto;
|
|
14075
|
+
padding: var(--puck-space-1);
|
|
14076
|
+
box-sizing: border-box;
|
|
13823
14077
|
}
|
|
13824
14078
|
|
|
13825
14079
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css/#css-module-data */
|
|
13826
|
-
.
|
|
14080
|
+
._Puck_tzaxg_19 {
|
|
13827
14081
|
font-family: var(--puck-font-family);
|
|
13828
14082
|
overflow-x: hidden;
|
|
13829
14083
|
visibility: visible !important;
|
|
13830
14084
|
}
|
|
13831
14085
|
@media (min-width: 766px) {
|
|
13832
|
-
.
|
|
14086
|
+
._Puck_tzaxg_19 {
|
|
13833
14087
|
overflow-x: auto;
|
|
13834
14088
|
}
|
|
13835
14089
|
}
|
|
13836
|
-
._Puck-
|
|
14090
|
+
._Puck-portal_tzaxg_31 {
|
|
13837
14091
|
position: relative;
|
|
13838
14092
|
z-index: 2;
|
|
13839
14093
|
}
|
|
13840
|
-
.
|
|
14094
|
+
._PuckLayout_tzaxg_36 {
|
|
13841
14095
|
height: 100dvh;
|
|
13842
14096
|
}
|
|
13843
|
-
._PuckLayout-
|
|
14097
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
13844
14098
|
--puck-frame-width: auto;
|
|
13845
14099
|
--puck-pluginbar-width: min-content;
|
|
13846
14100
|
--puck-sidebar-width: 0px;
|
|
@@ -13858,92 +14112,92 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
13858
14112
|
overflow: hidden;
|
|
13859
14113
|
}
|
|
13860
14114
|
@media (min-width: 638px) {
|
|
13861
|
-
._PuckLayout-
|
|
14115
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
13862
14116
|
--puck-pluginbar-width: 68px;
|
|
13863
14117
|
grid-template-areas: "header header header header" "sidenav left editor right";
|
|
13864
14118
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) 0;
|
|
13865
14119
|
grid-template-rows: min-content auto;
|
|
13866
14120
|
}
|
|
13867
|
-
._Puck--
|
|
14121
|
+
._Puck--hidePlugins_tzaxg_73 ._PuckLayout-inner_tzaxg_40 {
|
|
13868
14122
|
--puck-pluginbar-width: 0;
|
|
13869
14123
|
}
|
|
13870
14124
|
}
|
|
13871
|
-
._PuckLayout--
|
|
14125
|
+
._PuckLayout--mounted_tzaxg_78 ._PuckLayout-inner_tzaxg_40 {
|
|
13872
14126
|
--puck-sidebar-width: 186px;
|
|
13873
14127
|
}
|
|
13874
|
-
._PuckLayout--
|
|
14128
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
13875
14129
|
grid-template-rows: 0 auto 30% 0 var(--puck-pluginbar-width);
|
|
13876
14130
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
13877
14131
|
}
|
|
13878
|
-
._PuckLayout--
|
|
14132
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
13879
14133
|
grid-template-rows: 0 auto 55% 0 var(--puck-pluginbar-width);
|
|
13880
14134
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
13881
14135
|
}
|
|
13882
14136
|
@media (min-width: 638px) {
|
|
13883
|
-
._PuckLayout--
|
|
14137
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
13884
14138
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
13885
14139
|
grid-template-rows: min-content auto;
|
|
13886
14140
|
}
|
|
13887
14141
|
}
|
|
13888
|
-
._PuckLayout--
|
|
13889
|
-
._PuckLayout--
|
|
14142
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
14143
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
13890
14144
|
grid-template-rows: 0 auto min-content 0 var(--puck-pluginbar-width);
|
|
13891
14145
|
}
|
|
13892
14146
|
@media (min-width: 638px) {
|
|
13893
|
-
._PuckLayout--
|
|
13894
|
-
._PuckLayout--
|
|
13895
|
-
._PuckLayout--
|
|
13896
|
-
._PuckLayout--
|
|
14147
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
14148
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40,
|
|
14149
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
14150
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
13897
14151
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
13898
14152
|
grid-template-rows: min-content auto;
|
|
13899
14153
|
}
|
|
13900
14154
|
}
|
|
13901
14155
|
@media (min-width: 638px) {
|
|
13902
|
-
._PuckLayout--
|
|
14156
|
+
._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
13903
14157
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) var(--puck-sidebar-right-width);
|
|
13904
14158
|
}
|
|
13905
14159
|
}
|
|
13906
14160
|
@media (min-width: 638px) {
|
|
13907
|
-
._PuckLayout--
|
|
14161
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
13908
14162
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) var(--puck-sidebar-right-width);
|
|
13909
14163
|
}
|
|
13910
14164
|
}
|
|
13911
14165
|
@media (min-width: 458px) {
|
|
13912
|
-
._PuckLayout-
|
|
14166
|
+
._PuckLayout-mounted_tzaxg_156 ._PuckLayout-inner_tzaxg_40 {
|
|
13913
14167
|
--puck-frame-width: minmax(266px, auto);
|
|
13914
14168
|
}
|
|
13915
14169
|
}
|
|
13916
14170
|
@media (min-width: 638px) {
|
|
13917
|
-
.
|
|
14171
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13918
14172
|
--puck-sidebar-width: minmax(186px, 250px);
|
|
13919
14173
|
}
|
|
13920
14174
|
}
|
|
13921
14175
|
@media (min-width: 766px) {
|
|
13922
|
-
.
|
|
14176
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13923
14177
|
--puck-frame-width: auto;
|
|
13924
14178
|
}
|
|
13925
14179
|
}
|
|
13926
14180
|
@media (min-width: 990px) {
|
|
13927
|
-
.
|
|
14181
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13928
14182
|
--puck-sidebar-width: 256px;
|
|
13929
14183
|
}
|
|
13930
14184
|
}
|
|
13931
14185
|
@media (min-width: 1198px) {
|
|
13932
|
-
.
|
|
14186
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13933
14187
|
--puck-sidebar-width: 274px;
|
|
13934
14188
|
}
|
|
13935
14189
|
}
|
|
13936
14190
|
@media (min-width: 1398px) {
|
|
13937
|
-
.
|
|
14191
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13938
14192
|
--puck-sidebar-width: 290px;
|
|
13939
14193
|
}
|
|
13940
14194
|
}
|
|
13941
14195
|
@media (min-width: 1598px) {
|
|
13942
|
-
.
|
|
14196
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
13943
14197
|
--puck-sidebar-width: 320px;
|
|
13944
14198
|
}
|
|
13945
14199
|
}
|
|
13946
|
-
._PuckLayout-
|
|
14200
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
13947
14201
|
border-top: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
13948
14202
|
background-color: var( --puck-pluginbar-color-bg, var(--puck-color-surface-subtle) );
|
|
13949
14203
|
grid-area: sidenav;
|
|
@@ -13951,35 +14205,39 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
13951
14205
|
width: 100%;
|
|
13952
14206
|
}
|
|
13953
14207
|
@media (min-width: 638px) {
|
|
13954
|
-
._PuckLayout-
|
|
14208
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
13955
14209
|
border-top: 0;
|
|
13956
14210
|
border-right: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
13957
14211
|
box-sizing: border-box;
|
|
13958
14212
|
}
|
|
13959
14213
|
}
|
|
13960
|
-
._PuckLayout-
|
|
14214
|
+
._PuckLayout-header_tzaxg_217 {
|
|
13961
14215
|
grid-area: header;
|
|
13962
14216
|
}
|
|
13963
|
-
._PuckLayout--
|
|
14217
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
13964
14218
|
overflow: hidden;
|
|
13965
14219
|
}
|
|
13966
14220
|
@media (min-width: 638px) {
|
|
13967
|
-
._PuckLayout--
|
|
14221
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
13968
14222
|
overflow: auto;
|
|
13969
14223
|
}
|
|
13970
14224
|
}
|
|
13971
|
-
.
|
|
14225
|
+
._PuckPluginTab_tzaxg_231 {
|
|
13972
14226
|
display: none;
|
|
13973
14227
|
flex-grow: 1;
|
|
13974
14228
|
max-height: 100%;
|
|
13975
14229
|
}
|
|
13976
|
-
._PuckPluginTab--
|
|
14230
|
+
._PuckPluginTab--visible_tzaxg_237 {
|
|
13977
14231
|
display: flex;
|
|
13978
14232
|
flex-direction: column;
|
|
14233
|
+
min-height: 0;
|
|
13979
14234
|
}
|
|
13980
|
-
._PuckPluginTab-
|
|
14235
|
+
._PuckPluginTab-body_tzaxg_243 {
|
|
14236
|
+
display: flex;
|
|
14237
|
+
flex-direction: column;
|
|
13981
14238
|
flex-grow: 1;
|
|
13982
14239
|
max-height: 100%;
|
|
14240
|
+
min-height: 0;
|
|
13983
14241
|
}
|
|
13984
14242
|
|
|
13985
14243
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css/#css-module-data */
|
|
@@ -14620,11 +14878,13 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
14620
14878
|
}
|
|
14621
14879
|
|
|
14622
14880
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css/#css-module-data */
|
|
14623
|
-
.
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14881
|
+
._OutlinePlugin_1ylsc_1 {
|
|
14882
|
+
display: flex;
|
|
14883
|
+
flex-direction: column;
|
|
14884
|
+
flex-grow: 1;
|
|
14885
|
+
min-height: 0;
|
|
14886
|
+
min-width: 0;
|
|
14887
|
+
position: relative;
|
|
14628
14888
|
}
|
|
14629
14889
|
|
|
14630
14890
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css/#css-module-data */
|
|
@@ -14646,7 +14906,7 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
14646
14906
|
padding: var(--puck-space-4);
|
|
14647
14907
|
}
|
|
14648
14908
|
}`;
|
|
14649
|
-
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}';
|
|
14909
|
+
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}';
|
|
14650
14910
|
|
|
14651
14911
|
// lib/use-inject-css.ts
|
|
14652
14912
|
var PUCK_STYLE_SOURCE_ATTRIBUTE = "data-puck-style-source";
|
|
@@ -15115,7 +15375,7 @@ var AutoFrame_default = AutoFrame;
|
|
|
15115
15375
|
|
|
15116
15376
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css#css-module
|
|
15117
15377
|
init_react_import();
|
|
15118
|
-
var styles_module_default20 = { "PuckPreview": "
|
|
15378
|
+
var styles_module_default20 = { "PuckPreview": "_PuckPreview_zbic3_1", "PuckPreview-frame": "_PuckPreview-frame_zbic3_6" };
|
|
15119
15379
|
|
|
15120
15380
|
// components/Puck/components/Preview/index.tsx
|
|
15121
15381
|
init_lib();
|
|
@@ -15272,188 +15532,643 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
15272
15532
|
|
|
15273
15533
|
// components/Puck/components/Outline/index.tsx
|
|
15274
15534
|
init_react_import();
|
|
15535
|
+
var import_react90 = require("react");
|
|
15536
|
+
var import_shallow9 = require("zustand/react/shallow");
|
|
15537
|
+
init_store();
|
|
15538
|
+
init_lib();
|
|
15275
15539
|
|
|
15276
|
-
//
|
|
15540
|
+
// lib/data/find-zones-for-area.ts
|
|
15277
15541
|
init_react_import();
|
|
15542
|
+
var findZonesForArea = (state, area) => {
|
|
15543
|
+
return Object.keys(state.indexes.zones).filter(
|
|
15544
|
+
(zone) => zone.split(":")[0] === area
|
|
15545
|
+
);
|
|
15546
|
+
};
|
|
15278
15547
|
|
|
15279
|
-
//
|
|
15280
|
-
|
|
15281
|
-
var styles_module_default21 = { "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" };
|
|
15548
|
+
// components/Puck/components/Outline/index.tsx
|
|
15549
|
+
init_use_message();
|
|
15282
15550
|
|
|
15283
15551
|
// components/LayerTree/index.tsx
|
|
15552
|
+
init_react_import();
|
|
15284
15553
|
init_get_class_name_factory();
|
|
15554
|
+
init_store();
|
|
15555
|
+
|
|
15556
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
15557
|
+
init_react_import();
|
|
15285
15558
|
init_lucide_react();
|
|
15286
|
-
|
|
15287
|
-
|
|
15559
|
+
init_get_class_name_factory();
|
|
15560
|
+
|
|
15561
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
15562
|
+
init_react_import();
|
|
15563
|
+
var import_react82 = require("react");
|
|
15564
|
+
var import_react83 = require("@dnd-kit/react");
|
|
15288
15565
|
init_store();
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
if (label !== void 0) {
|
|
15308
|
-
return label;
|
|
15566
|
+
|
|
15567
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
15568
|
+
init_react_import();
|
|
15569
|
+
|
|
15570
|
+
// lib/data/resolve-zone-constraints.ts
|
|
15571
|
+
init_react_import();
|
|
15572
|
+
|
|
15573
|
+
// lib/data/get-slot-field.ts
|
|
15574
|
+
init_react_import();
|
|
15575
|
+
init_root_droppable_id();
|
|
15576
|
+
|
|
15577
|
+
// lib/data/get-field-by-path.ts
|
|
15578
|
+
init_react_import();
|
|
15579
|
+
function getFieldByPath(path, fields) {
|
|
15580
|
+
if (typeof path !== "string") {
|
|
15581
|
+
throw new Error(
|
|
15582
|
+
`Can't get field definition for path (${path}): Path should be a string`
|
|
15583
|
+
);
|
|
15309
15584
|
}
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
|
|
15585
|
+
if (!fields || typeof fields !== "object") {
|
|
15586
|
+
return void 0;
|
|
15587
|
+
}
|
|
15588
|
+
const segments = path.split(/\.|\[\d+\]/).filter(Boolean);
|
|
15589
|
+
let currFields = fields;
|
|
15590
|
+
let currField = void 0;
|
|
15591
|
+
for (let index = 0; index < segments.length; index++) {
|
|
15592
|
+
const currSegment = segments[index];
|
|
15593
|
+
currField = currFields[currSegment];
|
|
15594
|
+
if (index === segments.length - 1) {
|
|
15595
|
+
return currField;
|
|
15596
|
+
}
|
|
15597
|
+
if (!currField) {
|
|
15598
|
+
return;
|
|
15599
|
+
}
|
|
15600
|
+
if ((currField.type !== "object" || !currField.objectFields) && (currField.type !== "array" || !currField.arrayFields))
|
|
15601
|
+
return;
|
|
15602
|
+
if (currField.type === "object") {
|
|
15603
|
+
currFields = currField.objectFields;
|
|
15604
|
+
}
|
|
15605
|
+
if (currField.type === "array") {
|
|
15606
|
+
currFields = currField.arrayFields;
|
|
15607
|
+
}
|
|
15608
|
+
}
|
|
15609
|
+
}
|
|
15610
|
+
|
|
15611
|
+
// lib/data/get-slot-field.ts
|
|
15612
|
+
var getSlotField = (zoneCompound, config, nodes) => {
|
|
15613
|
+
var _a;
|
|
15614
|
+
const [componentId, slotId] = zoneCompound.split(":");
|
|
15615
|
+
if (!slotId) {
|
|
15616
|
+
return;
|
|
15313
15617
|
}
|
|
15314
15618
|
const componentType = (_a = nodes[componentId]) == null ? void 0 : _a.data.type;
|
|
15315
15619
|
const configForComponent = componentType && componentType !== rootAreaId ? config.components[componentType] : config.root;
|
|
15316
|
-
|
|
15620
|
+
const slotField = getFieldByPath(slotId, configForComponent == null ? void 0 : configForComponent.fields);
|
|
15621
|
+
return slotField;
|
|
15317
15622
|
};
|
|
15318
|
-
|
|
15319
|
-
|
|
15320
|
-
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
zoneCompound
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15623
|
+
|
|
15624
|
+
// lib/data/resolve-zone-constraints.ts
|
|
15625
|
+
var NO_CONSTRAINTS = {};
|
|
15626
|
+
var getZoneConstraints = (zoneCompound, config, indexes) => {
|
|
15627
|
+
var _a;
|
|
15628
|
+
if (((_a = indexes.zones[zoneCompound]) == null ? void 0 : _a.type) !== "slot") {
|
|
15629
|
+
return NO_CONSTRAINTS;
|
|
15630
|
+
}
|
|
15631
|
+
const field = getSlotField(zoneCompound, config, indexes.nodes);
|
|
15632
|
+
if ((field == null ? void 0 : field.type) !== "slot") {
|
|
15633
|
+
return NO_CONSTRAINTS;
|
|
15634
|
+
}
|
|
15635
|
+
return { allow: field.allow, disallow: field.disallow };
|
|
15636
|
+
};
|
|
15637
|
+
|
|
15638
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
15639
|
+
var OUTLINE_ITEM_TYPE = "outline-item";
|
|
15640
|
+
var OUTLINE_ZONE_TYPE = "outline-zone";
|
|
15641
|
+
var cached = (cache2, key, compute) => {
|
|
15642
|
+
const hit = cache2.get(key);
|
|
15643
|
+
if (hit !== void 0) {
|
|
15644
|
+
return hit;
|
|
15645
|
+
}
|
|
15646
|
+
const result = compute();
|
|
15647
|
+
cache2.set(key, result);
|
|
15648
|
+
return result;
|
|
15649
|
+
};
|
|
15650
|
+
var zoneAcceptsComponent = (cache2, zoneCompound, componentType, config, indexes) => cached(cache2, `zone:${zoneCompound}`, () => {
|
|
15651
|
+
const targetZoneConstraints = getZoneConstraints(
|
|
15652
|
+
zoneCompound,
|
|
15653
|
+
config,
|
|
15654
|
+
indexes
|
|
15655
|
+
);
|
|
15656
|
+
return isComponentAllowed(componentType, targetZoneConstraints);
|
|
15657
|
+
});
|
|
15658
|
+
var itemAcceptsComponent = (cache2, itemId, componentType, config, indexes) => cached(cache2, `childZones:${itemId}`, () => {
|
|
15659
|
+
return Object.keys(indexes.zones).some(
|
|
15660
|
+
(zoneCompound) => zoneCompound.startsWith(`${itemId}:`) && zoneAcceptsComponent(
|
|
15661
|
+
cache2,
|
|
15662
|
+
zoneCompound,
|
|
15663
|
+
componentType,
|
|
15664
|
+
config,
|
|
15665
|
+
indexes
|
|
15666
|
+
)
|
|
15667
|
+
);
|
|
15668
|
+
});
|
|
15669
|
+
var isSourceOrDescendantOfSource = (cache2, itemId, sourceItemId, nodes) => cached(cache2, `subtree:${itemId}`, () => {
|
|
15670
|
+
var _a;
|
|
15671
|
+
if (itemId === sourceItemId) {
|
|
15672
|
+
return true;
|
|
15673
|
+
}
|
|
15674
|
+
const path = ((_a = nodes[itemId]) == null ? void 0 : _a.path) || [];
|
|
15675
|
+
return path.some(
|
|
15676
|
+
(zoneCompound) => zoneCompound.split(":")[0] === sourceItemId
|
|
15677
|
+
);
|
|
15678
|
+
});
|
|
15679
|
+
var createOutlineAccept = (stores, target) => (source) => {
|
|
15680
|
+
if (source.type !== OUTLINE_ITEM_TYPE) return false;
|
|
15681
|
+
const sourceData = source.data;
|
|
15682
|
+
const cache2 = stores.outlineStore.getState().acceptCache;
|
|
15683
|
+
const { config, state } = stores.appStore.getState();
|
|
15684
|
+
const indexes = state.indexes;
|
|
15685
|
+
const anchorId = target.kind === "row" ? target.itemId : target.zoneCompound.split(":")[0];
|
|
15686
|
+
if (isSourceOrDescendantOfSource(
|
|
15687
|
+
cache2,
|
|
15688
|
+
anchorId,
|
|
15689
|
+
sourceData.itemId,
|
|
15690
|
+
indexes.nodes
|
|
15691
|
+
)) {
|
|
15692
|
+
return false;
|
|
15693
|
+
}
|
|
15694
|
+
if (target.kind === "zone") {
|
|
15695
|
+
return zoneAcceptsComponent(
|
|
15696
|
+
cache2,
|
|
15697
|
+
target.zoneCompound,
|
|
15698
|
+
sourceData.componentType,
|
|
15699
|
+
config,
|
|
15700
|
+
indexes
|
|
15701
|
+
);
|
|
15702
|
+
}
|
|
15703
|
+
return zoneAcceptsComponent(
|
|
15704
|
+
cache2,
|
|
15705
|
+
target.zoneCompound,
|
|
15706
|
+
sourceData.componentType,
|
|
15707
|
+
config,
|
|
15708
|
+
indexes
|
|
15709
|
+
) || itemAcceptsComponent(
|
|
15710
|
+
cache2,
|
|
15711
|
+
target.itemId,
|
|
15712
|
+
sourceData.componentType,
|
|
15713
|
+
config,
|
|
15714
|
+
indexes
|
|
15715
|
+
);
|
|
15716
|
+
};
|
|
15717
|
+
|
|
15718
|
+
// components/LayerTree/lib/store.ts
|
|
15719
|
+
init_react_import();
|
|
15720
|
+
var import_react81 = require("react");
|
|
15721
|
+
var import_zustand7 = require("zustand");
|
|
15722
|
+
var OUTLINE_EXPAND_DELAY_MS = 600;
|
|
15723
|
+
var createOutlineDndStore = () => {
|
|
15724
|
+
let expandTimer = null;
|
|
15725
|
+
let pendingRowId = null;
|
|
15726
|
+
const cancelTimer = () => {
|
|
15727
|
+
if (expandTimer !== null) {
|
|
15728
|
+
clearTimeout(expandTimer);
|
|
15729
|
+
expandTimer = null;
|
|
15730
|
+
}
|
|
15731
|
+
pendingRowId = null;
|
|
15732
|
+
};
|
|
15733
|
+
return (0, import_zustand7.createStore)((set, get) => ({
|
|
15734
|
+
status: "idle",
|
|
15735
|
+
draggedRow: null,
|
|
15736
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
15737
|
+
expandCandidateId: null,
|
|
15738
|
+
indicator: null,
|
|
15739
|
+
drop: null,
|
|
15740
|
+
acceptCache: /* @__PURE__ */ new Map(),
|
|
15741
|
+
startDrag: (draggedRow) => set({
|
|
15742
|
+
status: "dragging",
|
|
15743
|
+
draggedRow,
|
|
15744
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
15745
|
+
}),
|
|
15746
|
+
setTarget: (indicator, drop) => {
|
|
15747
|
+
var _a, _b, _c, _d;
|
|
15748
|
+
const current = get();
|
|
15749
|
+
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) {
|
|
15750
|
+
return;
|
|
15751
|
+
}
|
|
15752
|
+
set({ indicator, drop });
|
|
15753
|
+
},
|
|
15754
|
+
clearTarget: () => {
|
|
15755
|
+
if (get().indicator === null && get().drop === null) {
|
|
15756
|
+
return;
|
|
15757
|
+
}
|
|
15758
|
+
set({ indicator: null, drop: null });
|
|
15759
|
+
},
|
|
15760
|
+
scheduleExpand: (rowId, onExpand) => {
|
|
15761
|
+
if (pendingRowId === rowId || get().tempExpandedIds.has(rowId)) {
|
|
15762
|
+
return;
|
|
15763
|
+
}
|
|
15764
|
+
cancelTimer();
|
|
15765
|
+
pendingRowId = rowId;
|
|
15766
|
+
set({ expandCandidateId: rowId });
|
|
15767
|
+
expandTimer = setTimeout(() => {
|
|
15768
|
+
expandTimer = null;
|
|
15769
|
+
pendingRowId = null;
|
|
15770
|
+
set((s) => ({
|
|
15771
|
+
tempExpandedIds: new Set(s.tempExpandedIds).add(rowId),
|
|
15772
|
+
expandCandidateId: null
|
|
15773
|
+
}));
|
|
15774
|
+
onExpand();
|
|
15775
|
+
}, OUTLINE_EXPAND_DELAY_MS);
|
|
15776
|
+
},
|
|
15777
|
+
cancelPendingExpand: () => {
|
|
15778
|
+
cancelTimer();
|
|
15779
|
+
if (get().expandCandidateId !== null) {
|
|
15780
|
+
set({ expandCandidateId: null });
|
|
15781
|
+
}
|
|
15782
|
+
},
|
|
15783
|
+
endDrag: () => {
|
|
15784
|
+
cancelTimer();
|
|
15785
|
+
set({
|
|
15786
|
+
status: "dropping",
|
|
15787
|
+
indicator: null,
|
|
15788
|
+
drop: null,
|
|
15789
|
+
expandCandidateId: null
|
|
15790
|
+
});
|
|
15791
|
+
},
|
|
15792
|
+
reset: () => {
|
|
15793
|
+
cancelTimer();
|
|
15794
|
+
set({
|
|
15795
|
+
status: "idle",
|
|
15796
|
+
draggedRow: null,
|
|
15797
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
15798
|
+
expandCandidateId: null,
|
|
15799
|
+
indicator: null,
|
|
15800
|
+
drop: null,
|
|
15801
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
15802
|
+
});
|
|
15803
|
+
}
|
|
15804
|
+
}));
|
|
15805
|
+
};
|
|
15806
|
+
var OutlineDndStoreContext = (0, import_react81.createContext)(
|
|
15807
|
+
createOutlineDndStore()
|
|
15808
|
+
);
|
|
15809
|
+
var useOutlineDndStoreApi = () => {
|
|
15810
|
+
return (0, import_react81.useContext)(OutlineDndStoreContext);
|
|
15811
|
+
};
|
|
15812
|
+
var useOutlineDndStore = (selector) => {
|
|
15813
|
+
return useContextStore(OutlineDndStoreContext, selector);
|
|
15814
|
+
};
|
|
15815
|
+
|
|
15816
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
15817
|
+
var useOutlineDropZone = ({
|
|
15818
|
+
kind,
|
|
15819
|
+
zoneCompound
|
|
15327
15820
|
}) => {
|
|
15328
|
-
|
|
15329
|
-
const
|
|
15330
|
-
const
|
|
15331
|
-
const
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15338
|
-
zoneCompound: childZoneCompound,
|
|
15339
|
-
zones,
|
|
15340
|
-
zonesByParent,
|
|
15341
|
-
componentFallbackLabel
|
|
15342
|
-
})
|
|
15821
|
+
const appStore = useAppStoreApi();
|
|
15822
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
15823
|
+
const dndId = `${kind}:${zoneCompound}`;
|
|
15824
|
+
const accept = (0, import_react82.useMemo)(
|
|
15825
|
+
() => createOutlineAccept(
|
|
15826
|
+
{ appStore, outlineStore },
|
|
15827
|
+
{
|
|
15828
|
+
kind: "zone",
|
|
15829
|
+
zoneCompound
|
|
15830
|
+
}
|
|
15343
15831
|
),
|
|
15344
|
-
|
|
15345
|
-
|
|
15346
|
-
|
|
15347
|
-
|
|
15832
|
+
[appStore, outlineStore, zoneCompound]
|
|
15833
|
+
);
|
|
15834
|
+
const { ref } = (0, import_react83.useDroppable)({
|
|
15835
|
+
id: dndId,
|
|
15836
|
+
type: OUTLINE_ZONE_TYPE,
|
|
15837
|
+
accept,
|
|
15838
|
+
collisionDetector: pointerIntersection,
|
|
15839
|
+
data: { kind: "zone", zoneCompound }
|
|
15840
|
+
});
|
|
15841
|
+
const isDropTarget = useOutlineDndStore(
|
|
15842
|
+
(s) => {
|
|
15843
|
+
var _a;
|
|
15844
|
+
return ((_a = s.indicator) == null ? void 0 : _a.targetId) === dndId;
|
|
15845
|
+
}
|
|
15846
|
+
);
|
|
15847
|
+
const outlineDropZoneObject = (0, import_react82.useMemo)(
|
|
15848
|
+
() => ({ isDropTarget, ref }),
|
|
15849
|
+
[isDropTarget, ref]
|
|
15850
|
+
);
|
|
15851
|
+
return outlineDropZoneObject;
|
|
15852
|
+
};
|
|
15853
|
+
var use_outline_drop_zone_default = useOutlineDropZone;
|
|
15854
|
+
|
|
15855
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
15856
|
+
init_react_import();
|
|
15857
|
+
init_get_class_name_factory();
|
|
15858
|
+
|
|
15859
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css#css-module
|
|
15860
|
+
init_react_import();
|
|
15861
|
+
var styles_module_default21 = { "DropLine": "_DropLine_eyz3q_2", "DropLine--top": "_DropLine--top_eyz3q_12", "DropLine--bottom": "_DropLine--bottom_eyz3q_16", "DropLine--outset": "_DropLine--outset_eyz3q_20" };
|
|
15862
|
+
|
|
15863
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
15864
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15865
|
+
var getClassName30 = get_class_name_factory_default("DropLine", styles_module_default21);
|
|
15866
|
+
var DropLine = ({
|
|
15867
|
+
edge,
|
|
15868
|
+
outset
|
|
15869
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15870
|
+
"div",
|
|
15871
|
+
{
|
|
15872
|
+
className: getClassName30({
|
|
15873
|
+
top: edge === "top",
|
|
15874
|
+
bottom: edge === "bottom",
|
|
15875
|
+
outset: Boolean(outset)
|
|
15876
|
+
})
|
|
15877
|
+
}
|
|
15878
|
+
);
|
|
15879
|
+
|
|
15880
|
+
// components/LayerTree/components/layer-tree-items/index.ts
|
|
15881
|
+
init_react_import();
|
|
15882
|
+
|
|
15883
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
15884
|
+
init_react_import();
|
|
15885
|
+
init_get_class_name_factory();
|
|
15886
|
+
|
|
15887
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
15888
|
+
init_react_import();
|
|
15889
|
+
init_get_class_name_factory();
|
|
15890
|
+
init_use_message();
|
|
15891
|
+
|
|
15892
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css#css-module
|
|
15893
|
+
init_react_import();
|
|
15894
|
+
var styles_module_default22 = { "LayerTree-helper": "_LayerTree-helper_1niov_2" };
|
|
15895
|
+
|
|
15896
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
15897
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15898
|
+
var getClassName31 = get_class_name_factory_default("LayerTree", styles_module_default22);
|
|
15899
|
+
var EmptyZonePlaceholder = ({
|
|
15900
|
+
zoneCompound
|
|
15901
|
+
}) => {
|
|
15902
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
15903
|
+
kind: "empty",
|
|
15348
15904
|
zoneCompound
|
|
15349
|
-
};
|
|
15905
|
+
});
|
|
15906
|
+
const noItemsMsg = useMessage("outline-empty");
|
|
15907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
15908
|
+
"li",
|
|
15909
|
+
{
|
|
15910
|
+
className: getClassName31("helper"),
|
|
15911
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
15912
|
+
ref,
|
|
15913
|
+
children: [
|
|
15914
|
+
noItemsMsg,
|
|
15915
|
+
isDropTarget && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropLine, { edge: "top" })
|
|
15916
|
+
]
|
|
15917
|
+
}
|
|
15918
|
+
);
|
|
15350
15919
|
};
|
|
15351
|
-
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
|
|
15358
|
-
|
|
15920
|
+
|
|
15921
|
+
// components/LayerTree/components/layer/index.tsx
|
|
15922
|
+
init_react_import();
|
|
15923
|
+
init_lucide_react();
|
|
15924
|
+
var import_react86 = require("react");
|
|
15925
|
+
init_get_class_name_factory();
|
|
15926
|
+
init_get_item();
|
|
15927
|
+
init_store();
|
|
15928
|
+
init_IconButton2();
|
|
15929
|
+
|
|
15930
|
+
// components/LayerTree/lib/dnd/use-outline-row-dnd.ts
|
|
15931
|
+
init_react_import();
|
|
15932
|
+
var import_react84 = require("react");
|
|
15933
|
+
var import_dom5 = require("@dnd-kit/dom");
|
|
15934
|
+
var import_sortable3 = require("@dnd-kit/react/sortable");
|
|
15935
|
+
init_store();
|
|
15936
|
+
var useOutlineRowDnd = ({
|
|
15937
|
+
componentType,
|
|
15938
|
+
index,
|
|
15939
|
+
itemId,
|
|
15940
|
+
zoneCompound
|
|
15359
15941
|
}) => {
|
|
15360
|
-
|
|
15361
|
-
const
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
itemId,
|
|
15367
|
-
index,
|
|
15368
|
-
nodes,
|
|
15369
|
-
zoneCompound,
|
|
15370
|
-
zones,
|
|
15371
|
-
zonesByParent,
|
|
15372
|
-
componentFallbackLabel
|
|
15373
|
-
})
|
|
15942
|
+
const appStore = useAppStoreApi();
|
|
15943
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
15944
|
+
const accept = (0, import_react84.useMemo)(
|
|
15945
|
+
() => createOutlineAccept(
|
|
15946
|
+
{ appStore, outlineStore },
|
|
15947
|
+
{ kind: "row", itemId, zoneCompound }
|
|
15374
15948
|
),
|
|
15375
|
-
|
|
15376
|
-
|
|
15949
|
+
[appStore, outlineStore, itemId, zoneCompound]
|
|
15950
|
+
);
|
|
15951
|
+
const collisionDetector = (0, import_react84.useMemo)(
|
|
15952
|
+
() => createDynamicCollisionDetector("y"),
|
|
15953
|
+
[]
|
|
15954
|
+
);
|
|
15955
|
+
const { handleRef, ref, isDragSource } = (0, import_sortable3.useSortable)({
|
|
15956
|
+
id: itemId,
|
|
15957
|
+
index,
|
|
15958
|
+
group: zoneCompound,
|
|
15959
|
+
type: OUTLINE_ITEM_TYPE,
|
|
15960
|
+
accept,
|
|
15961
|
+
data: {
|
|
15962
|
+
kind: "row",
|
|
15963
|
+
itemId,
|
|
15964
|
+
zoneCompound,
|
|
15965
|
+
index,
|
|
15966
|
+
componentType
|
|
15967
|
+
},
|
|
15968
|
+
collisionPriority: 1,
|
|
15969
|
+
collisionDetector,
|
|
15970
|
+
// Don't animate rows while dragging or dropping
|
|
15971
|
+
transition: { duration: 0 },
|
|
15972
|
+
plugins: (defaults) => [
|
|
15973
|
+
...defaults,
|
|
15974
|
+
// The source row stays rendered in place
|
|
15975
|
+
// The drop animation is disabled for a more snappy feel
|
|
15976
|
+
import_dom5.Feedback.configure({ feedback: "clone", dropAnimation: null })
|
|
15977
|
+
]
|
|
15978
|
+
});
|
|
15979
|
+
const { indicatorPosition, isExpandCandidate, isTempExpanded } = useOutlineDndStore((s) => {
|
|
15980
|
+
var _a;
|
|
15981
|
+
return {
|
|
15982
|
+
indicatorPosition: ((_a = s.indicator) == null ? void 0 : _a.targetId) === itemId ? s.indicator.position : null,
|
|
15983
|
+
isExpandCandidate: s.expandCandidateId === itemId,
|
|
15984
|
+
isTempExpanded: s.tempExpandedIds.has(itemId)
|
|
15985
|
+
};
|
|
15986
|
+
});
|
|
15987
|
+
const rowRef = (0, import_react84.useCallback)(
|
|
15988
|
+
(element) => {
|
|
15989
|
+
ref(element);
|
|
15990
|
+
handleRef(element);
|
|
15991
|
+
},
|
|
15992
|
+
[ref, handleRef]
|
|
15993
|
+
);
|
|
15994
|
+
return {
|
|
15995
|
+
rowRef,
|
|
15996
|
+
isDragSource,
|
|
15997
|
+
indicatorPosition,
|
|
15998
|
+
isExpandCandidate,
|
|
15999
|
+
isTempExpanded
|
|
15377
16000
|
};
|
|
15378
16001
|
};
|
|
15379
|
-
|
|
15380
|
-
|
|
15381
|
-
|
|
15382
|
-
};
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
|
|
16002
|
+
|
|
16003
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css#css-module
|
|
16004
|
+
init_react_import();
|
|
16005
|
+
var styles_module_default23 = { "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" };
|
|
16006
|
+
|
|
16007
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
16008
|
+
init_react_import();
|
|
16009
|
+
init_lucide_react();
|
|
16010
|
+
var import_react85 = require("react");
|
|
16011
|
+
var import_shallow8 = require("zustand/react/shallow");
|
|
16012
|
+
init_get_class_name_factory();
|
|
16013
|
+
init_get_item();
|
|
16014
|
+
init_store();
|
|
16015
|
+
init_IconButton2();
|
|
16016
|
+
|
|
16017
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css#css-module
|
|
16018
|
+
init_react_import();
|
|
16019
|
+
var styles_module_default24 = { "LayerActions": "_LayerActions_1m5z5_2", "LayerActions--visible": "_LayerActions--visible_1m5z5_17" };
|
|
16020
|
+
|
|
16021
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
16022
|
+
init_use_message();
|
|
16023
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
16024
|
+
var getClassName32 = get_class_name_factory_default("LayerActions", styles_module_default24);
|
|
16025
|
+
var LayerActions = ({
|
|
16026
|
+
node,
|
|
16027
|
+
visible
|
|
16028
|
+
}) => {
|
|
16029
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
16030
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
16031
|
+
const permissions = useAppStore(
|
|
16032
|
+
(0, import_shallow8.useShallow)((s) => {
|
|
16033
|
+
const item = getItem(
|
|
16034
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
16035
|
+
s.state
|
|
16036
|
+
);
|
|
16037
|
+
const itemPermissions = s.permissions.getPermissions({ item });
|
|
16038
|
+
return {
|
|
16039
|
+
delete: itemPermissions.delete,
|
|
16040
|
+
duplicate: itemPermissions.duplicate
|
|
16041
|
+
};
|
|
16042
|
+
})
|
|
16043
|
+
);
|
|
16044
|
+
const duplicateMsg = useMessage("outline-item-duplicate");
|
|
16045
|
+
const deleteMsg = useMessage("outline-item-delete");
|
|
16046
|
+
const deleteItem = (0, import_react85.useCallback)(
|
|
16047
|
+
(e) => {
|
|
16048
|
+
e.stopPropagation();
|
|
16049
|
+
if (outlineStore.getState().status !== "idle") {
|
|
16050
|
+
return;
|
|
16051
|
+
}
|
|
16052
|
+
dispatch({
|
|
16053
|
+
type: "remove",
|
|
16054
|
+
index: node.index,
|
|
16055
|
+
zone: node.zoneCompound
|
|
16056
|
+
});
|
|
16057
|
+
},
|
|
16058
|
+
[dispatch, outlineStore, node]
|
|
16059
|
+
);
|
|
16060
|
+
const duplicateItem = (0, import_react85.useCallback)(
|
|
16061
|
+
(e) => {
|
|
16062
|
+
e.stopPropagation();
|
|
16063
|
+
if (outlineStore.getState().status !== "idle") {
|
|
16064
|
+
return;
|
|
16065
|
+
}
|
|
16066
|
+
dispatch({
|
|
16067
|
+
type: "duplicate",
|
|
16068
|
+
sourceIndex: node.index,
|
|
16069
|
+
sourceZone: node.zoneCompound
|
|
16070
|
+
});
|
|
16071
|
+
},
|
|
16072
|
+
[dispatch, outlineStore, node.index, node.zoneCompound]
|
|
16073
|
+
);
|
|
16074
|
+
if (!permissions.delete && !permissions.duplicate) {
|
|
16075
|
+
return null;
|
|
15398
16076
|
}
|
|
15399
|
-
return
|
|
16077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: getClassName32({ visible }), children: [
|
|
16078
|
+
permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(IconButton, { onClick: duplicateItem, title: duplicateMsg, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Copy, {}) }),
|
|
16079
|
+
permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(IconButton, { onClick: deleteItem, title: deleteMsg, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Trash, {}) })
|
|
16080
|
+
] });
|
|
15400
16081
|
};
|
|
15401
|
-
|
|
15402
|
-
|
|
16082
|
+
|
|
16083
|
+
// components/LayerTree/components/layer/index.tsx
|
|
16084
|
+
init_use_message();
|
|
16085
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
16086
|
+
var getClassName33 = get_class_name_factory_default("Layer", styles_module_default23);
|
|
16087
|
+
var Layer = (0, import_react86.forwardRef)(function Layer2({
|
|
15403
16088
|
dataIndex,
|
|
15404
16089
|
depth,
|
|
15405
16090
|
isSelected,
|
|
15406
16091
|
node,
|
|
15407
|
-
selectedId
|
|
15408
|
-
selectedPathIds
|
|
16092
|
+
selectedId
|
|
15409
16093
|
}, ref) {
|
|
15410
16094
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
15411
|
-
const
|
|
16095
|
+
const isExpanded = useAppStore(
|
|
16096
|
+
(s) => {
|
|
16097
|
+
var _a, _b;
|
|
16098
|
+
return (_b = (_a = s.state.ui.itemExpanded) == null ? void 0 : _a[node.itemId]) != null ? _b : false;
|
|
16099
|
+
}
|
|
16100
|
+
);
|
|
15412
16101
|
const isHovering = useContextStore(
|
|
15413
16102
|
ZoneStoreContext,
|
|
15414
16103
|
(s) => s.hoveringComponent === node.itemId
|
|
15415
16104
|
);
|
|
16105
|
+
const isDraggable = useAppStore((s) => {
|
|
16106
|
+
var _a;
|
|
16107
|
+
const item = getItem(
|
|
16108
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
16109
|
+
s.state
|
|
16110
|
+
);
|
|
16111
|
+
return (_a = s.permissions.getPermissions({ item })) == null ? void 0 : _a.drag;
|
|
16112
|
+
});
|
|
16113
|
+
const {
|
|
16114
|
+
indicatorPosition,
|
|
16115
|
+
isDragSource,
|
|
16116
|
+
isExpandCandidate,
|
|
16117
|
+
isTempExpanded,
|
|
16118
|
+
rowRef
|
|
16119
|
+
} = useOutlineRowDnd({
|
|
16120
|
+
componentType: node.componentType,
|
|
16121
|
+
index: node.index,
|
|
16122
|
+
itemId: node.itemId,
|
|
16123
|
+
zoneCompound: node.zoneCompound
|
|
16124
|
+
});
|
|
16125
|
+
const zoneStore = (0, import_react86.useContext)(ZoneStoreContext);
|
|
16126
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
16127
|
+
const collapseMsg = useMessage("outline-item-collapse");
|
|
16128
|
+
const expandMsg = useMessage("outline-item-expand");
|
|
15416
16129
|
const containsZone = node.childZones.length > 0;
|
|
15417
|
-
const
|
|
15418
|
-
const expandLabel = useMessage("outline-expand");
|
|
15419
|
-
const setItemSelector = (0, import_react81.useCallback)(
|
|
16130
|
+
const setItemSelector = (0, import_react86.useCallback)(
|
|
15420
16131
|
(itemSelector) => {
|
|
15421
16132
|
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
15422
16133
|
},
|
|
15423
16134
|
[dispatch]
|
|
15424
16135
|
);
|
|
15425
|
-
const
|
|
15426
|
-
|
|
16136
|
+
const shouldBeExpanded = isExpanded || isTempExpanded;
|
|
16137
|
+
const shouldShowIndicator = indicatorPosition !== null;
|
|
16138
|
+
const shouldShowZoneTitles = node.childZones.length !== 1;
|
|
16139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
15427
16140
|
"li",
|
|
15428
16141
|
{
|
|
15429
16142
|
ref,
|
|
15430
|
-
className:
|
|
15431
|
-
childIsSelected,
|
|
16143
|
+
className: getClassName33({
|
|
15432
16144
|
containsZone,
|
|
16145
|
+
isDragSource,
|
|
16146
|
+
isExpandCandidate,
|
|
16147
|
+
isExpanded: shouldBeExpanded,
|
|
15433
16148
|
isHovering,
|
|
15434
|
-
isSelected
|
|
16149
|
+
isSelected,
|
|
16150
|
+
isSortable: isDraggable
|
|
15435
16151
|
}),
|
|
15436
16152
|
"data-index": dataIndex,
|
|
15437
16153
|
"data-puck-layer-tree-id": node.itemId,
|
|
15438
16154
|
children: [
|
|
15439
|
-
|
|
15440
|
-
|
|
16155
|
+
shouldShowIndicator && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16156
|
+
DropLine,
|
|
15441
16157
|
{
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
zone: node.zoneCompound
|
|
15452
|
-
});
|
|
15453
|
-
zoneStore.getState().scrollToComponent(node.itemId);
|
|
15454
|
-
},
|
|
16158
|
+
edge: indicatorPosition === "before" ? "top" : "bottom",
|
|
16159
|
+
outset: true
|
|
16160
|
+
}
|
|
16161
|
+
),
|
|
16162
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
16163
|
+
"div",
|
|
16164
|
+
{
|
|
16165
|
+
className: getClassName33("inner"),
|
|
16166
|
+
ref: rowRef,
|
|
15455
16167
|
onMouseEnter: (e) => {
|
|
15456
16168
|
e.stopPropagation();
|
|
16169
|
+
if (outlineStore.getState().status !== "idle") {
|
|
16170
|
+
return;
|
|
16171
|
+
}
|
|
15457
16172
|
zoneStore.setState({ hoveringComponent: node.itemId });
|
|
15458
16173
|
},
|
|
15459
16174
|
onMouseLeave: (e) => {
|
|
@@ -15461,208 +16176,712 @@ var Layer = (0, import_react81.forwardRef)(function Layer2({
|
|
|
15461
16176
|
zoneStore.setState({ hoveringComponent: null });
|
|
15462
16177
|
},
|
|
15463
16178
|
children: [
|
|
15464
|
-
|
|
15465
|
-
|
|
16179
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName33("caret"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16180
|
+
IconButton,
|
|
15466
16181
|
{
|
|
15467
|
-
|
|
15468
|
-
|
|
15469
|
-
|
|
16182
|
+
onClick: (e) => {
|
|
16183
|
+
e.stopPropagation();
|
|
16184
|
+
if (outlineStore.getState().status !== "idle") {
|
|
16185
|
+
return;
|
|
16186
|
+
}
|
|
16187
|
+
dispatch({
|
|
16188
|
+
type: "setUi",
|
|
16189
|
+
ui: (previous) => {
|
|
16190
|
+
var _a;
|
|
16191
|
+
const newItemExpanded = __spreadValues({}, previous.itemExpanded);
|
|
16192
|
+
if ((_a = previous.itemExpanded) == null ? void 0 : _a[node.itemId]) {
|
|
16193
|
+
delete newItemExpanded[node.itemId];
|
|
16194
|
+
} else {
|
|
16195
|
+
newItemExpanded[node.itemId] = true;
|
|
16196
|
+
}
|
|
16197
|
+
return {
|
|
16198
|
+
itemExpanded: newItemExpanded
|
|
16199
|
+
};
|
|
16200
|
+
},
|
|
16201
|
+
recordHistory: false
|
|
16202
|
+
});
|
|
16203
|
+
},
|
|
16204
|
+
title: isExpanded ? collapseMsg : expandMsg,
|
|
16205
|
+
type: "button",
|
|
16206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ChevronRight, {})
|
|
15470
16207
|
}
|
|
15471
|
-
),
|
|
15472
|
-
/* @__PURE__ */ (0,
|
|
15473
|
-
/* @__PURE__ */ (0,
|
|
15474
|
-
|
|
16208
|
+
) }),
|
|
16209
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getClassName33("content"), children: [
|
|
16210
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16211
|
+
"button",
|
|
16212
|
+
{
|
|
16213
|
+
type: "button",
|
|
16214
|
+
className: getClassName33("clickable"),
|
|
16215
|
+
onClick: () => {
|
|
16216
|
+
if (outlineStore.getState().status !== "idle") {
|
|
16217
|
+
return;
|
|
16218
|
+
}
|
|
16219
|
+
setItemSelector({
|
|
16220
|
+
index: node.index,
|
|
16221
|
+
zone: node.zoneCompound
|
|
16222
|
+
});
|
|
16223
|
+
zoneStore.getState().scrollToComponent(node.itemId);
|
|
16224
|
+
},
|
|
16225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getClassName33("title"), children: [
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName33("icon"), children: node.componentType === "Text" || node.componentType === "Heading" ? (
|
|
16227
|
+
// Sized in CSS via --puck-outline-icon-size
|
|
16228
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Type, {})
|
|
16229
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(LayoutGrid, {}) }),
|
|
16230
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName33("name"), children: node.label })
|
|
16231
|
+
] })
|
|
16232
|
+
}
|
|
16233
|
+
),
|
|
16234
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(LayerActions, { node, visible: isHovering && !isDragSource })
|
|
15475
16235
|
] })
|
|
15476
16236
|
]
|
|
15477
16237
|
}
|
|
15478
|
-
)
|
|
15479
|
-
containsZone &&
|
|
15480
|
-
|
|
16238
|
+
),
|
|
16239
|
+
containsZone && shouldBeExpanded && node.childZones.map((childZone) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName33("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16240
|
+
LayerTreeZone,
|
|
15481
16241
|
{
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
selectedId,
|
|
15488
|
-
selectedPathIds,
|
|
15489
|
-
tree: childZone
|
|
15490
|
-
}
|
|
15491
|
-
)
|
|
15492
|
-
},
|
|
15493
|
-
childZone.zoneCompound
|
|
15494
|
-
))
|
|
16242
|
+
depth: shouldShowZoneTitles ? depth + 1 : depth,
|
|
16243
|
+
selectedId,
|
|
16244
|
+
tree: shouldShowZoneTitles ? childZone : __spreadProps(__spreadValues({}, childZone), { label: void 0 })
|
|
16245
|
+
}
|
|
16246
|
+
) }, childZone.zoneCompound))
|
|
15495
16247
|
]
|
|
15496
16248
|
}
|
|
15497
16249
|
);
|
|
15498
16250
|
});
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
tree.label && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: getClassName30("zoneTitle"), children: [
|
|
15508
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: getClassName30("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Layers, { size: "16" }) }),
|
|
15509
|
-
tree.label
|
|
15510
|
-
] }),
|
|
15511
|
-
shouldVirtualize ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15512
|
-
VirtualizedLayerTreeItems,
|
|
15513
|
-
{
|
|
15514
|
-
depth,
|
|
15515
|
-
selectedId,
|
|
15516
|
-
selectedPathIds,
|
|
15517
|
-
tree
|
|
15518
|
-
}
|
|
15519
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15520
|
-
StaticLayerTreeItems,
|
|
15521
|
-
{
|
|
15522
|
-
depth,
|
|
15523
|
-
selectedId,
|
|
15524
|
-
selectedPathIds,
|
|
15525
|
-
tree
|
|
15526
|
-
}
|
|
15527
|
-
)
|
|
15528
|
-
] });
|
|
15529
|
-
};
|
|
16251
|
+
|
|
16252
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css#css-module
|
|
16253
|
+
init_react_import();
|
|
16254
|
+
var styles_module_default25 = { "LayerTree": "_LayerTree_o5tyt_1", "LayerTree--nested": "_LayerTree--nested_o5tyt_12" };
|
|
16255
|
+
|
|
16256
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
16257
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
16258
|
+
var getClassName34 = get_class_name_factory_default("LayerTree", styles_module_default25);
|
|
15530
16259
|
var StaticLayerTreeItems = ({
|
|
15531
16260
|
depth,
|
|
15532
16261
|
selectedId,
|
|
15533
|
-
selectedPathIds,
|
|
15534
16262
|
tree
|
|
15535
16263
|
}) => {
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
tree.items.
|
|
15539
|
-
tree.items.map((node) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
16264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("ul", { className: getClassName34({ nested: depth > 0 }), children: [
|
|
16265
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
16266
|
+
tree.items.map((node) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15540
16267
|
Layer,
|
|
15541
16268
|
{
|
|
15542
|
-
childIsSelected: selectedPathIds.has(node.itemId),
|
|
15543
16269
|
depth,
|
|
15544
16270
|
isSelected: selectedId === node.itemId,
|
|
15545
16271
|
node,
|
|
15546
|
-
selectedId
|
|
15547
|
-
selectedPathIds
|
|
16272
|
+
selectedId
|
|
15548
16273
|
},
|
|
15549
16274
|
node.itemId
|
|
15550
16275
|
))
|
|
15551
16276
|
] });
|
|
15552
16277
|
};
|
|
16278
|
+
|
|
16279
|
+
// components/LayerTree/components/layer-tree-items/virtualized-layer-tree-items.tsx
|
|
16280
|
+
init_react_import();
|
|
16281
|
+
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
16282
|
+
var import_react87 = require("react");
|
|
16283
|
+
init_get_class_name_factory();
|
|
16284
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16285
|
+
var getClassName35 = get_class_name_factory_default("LayerTree", styles_module_default25);
|
|
16286
|
+
var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
16287
|
+
var LAYER_TREE_VIRTUALIZATION_OVERSCAN = 8;
|
|
16288
|
+
var measuredRowHeights = /* @__PURE__ */ new Map();
|
|
16289
|
+
var getEstimatedRowHeight = (itemId) => {
|
|
16290
|
+
var _a;
|
|
16291
|
+
return (_a = measuredRowHeights.get(itemId)) != null ? _a : DEFAULT_LAYER_ROW_HEIGHT;
|
|
16292
|
+
};
|
|
16293
|
+
var cacheMeasuredRowHeight = (itemId, height) => {
|
|
16294
|
+
if (height <= 0) {
|
|
16295
|
+
return;
|
|
16296
|
+
}
|
|
16297
|
+
measuredRowHeights.set(itemId, height);
|
|
16298
|
+
};
|
|
16299
|
+
var getFirstScrollAncestor = (el) => {
|
|
16300
|
+
var _a;
|
|
16301
|
+
let current = (_a = el == null ? void 0 : el.parentElement) != null ? _a : null;
|
|
16302
|
+
while (current) {
|
|
16303
|
+
const { overflow, overflowY } = getComputedStyle(current);
|
|
16304
|
+
if ([overflow, overflowY].some((value) => /auto|scroll/.test(value))) {
|
|
16305
|
+
return current;
|
|
16306
|
+
}
|
|
16307
|
+
current = current.parentElement;
|
|
16308
|
+
}
|
|
16309
|
+
return null;
|
|
16310
|
+
};
|
|
15553
16311
|
var VirtualizedLayerTreeItems = ({
|
|
15554
16312
|
depth,
|
|
15555
16313
|
selectedId,
|
|
15556
|
-
selectedPathIds,
|
|
15557
16314
|
tree
|
|
15558
16315
|
}) => {
|
|
15559
|
-
const listRef = (0,
|
|
15560
|
-
const
|
|
16316
|
+
const listRef = (0, import_react87.useRef)(null);
|
|
16317
|
+
const pinnedIndex = useOutlineDndStore(
|
|
16318
|
+
(s) => {
|
|
16319
|
+
var _a;
|
|
16320
|
+
return ((_a = s.draggedRow) == null ? void 0 : _a.zoneCompound) === tree.zoneCompound ? s.draggedRow.index : null;
|
|
16321
|
+
}
|
|
16322
|
+
);
|
|
16323
|
+
const rangeExtractor = (0, import_react87.useCallback)(
|
|
16324
|
+
(range) => {
|
|
16325
|
+
const indexes = (0, import_react_virtual2.defaultRangeExtractor)(range);
|
|
16326
|
+
if (pinnedIndex !== null && !indexes.includes(pinnedIndex)) {
|
|
16327
|
+
indexes.push(pinnedIndex);
|
|
16328
|
+
indexes.sort((a, b) => a - b);
|
|
16329
|
+
}
|
|
16330
|
+
return indexes;
|
|
16331
|
+
},
|
|
16332
|
+
[pinnedIndex]
|
|
16333
|
+
);
|
|
15561
16334
|
const virtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
15562
16335
|
count: tree.items.length,
|
|
15563
16336
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
15564
16337
|
getItemKey: (index) => tree.items[index].itemId,
|
|
15565
|
-
getScrollElement: () =>
|
|
16338
|
+
getScrollElement: () => getFirstScrollAncestor(listRef.current),
|
|
15566
16339
|
overscan: LAYER_TREE_VIRTUALIZATION_OVERSCAN,
|
|
16340
|
+
rangeExtractor,
|
|
15567
16341
|
measureElement: (element) => {
|
|
15568
16342
|
const height = Math.ceil(element.getBoundingClientRect().height);
|
|
15569
16343
|
const itemId = element.dataset.puckLayerTreeId;
|
|
15570
16344
|
if (itemId) {
|
|
15571
16345
|
cacheMeasuredRowHeight(itemId, height);
|
|
15572
16346
|
}
|
|
15573
|
-
return height || DEFAULT_LAYER_ROW_HEIGHT;
|
|
16347
|
+
return height || DEFAULT_LAYER_ROW_HEIGHT;
|
|
16348
|
+
}
|
|
16349
|
+
});
|
|
16350
|
+
const virtualItems = virtualizer.getVirtualItems();
|
|
16351
|
+
const totalSize = virtualizer.getTotalSize();
|
|
16352
|
+
const renderedItems = [];
|
|
16353
|
+
let previousEnd = 0;
|
|
16354
|
+
let previousIndex = -1;
|
|
16355
|
+
virtualItems.forEach((virtualItem) => {
|
|
16356
|
+
const node = tree.items[virtualItem.index];
|
|
16357
|
+
const gapSize = Math.max(virtualItem.start - previousEnd, 0);
|
|
16358
|
+
if (gapSize > 0) {
|
|
16359
|
+
renderedItems.push(
|
|
16360
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16361
|
+
"li",
|
|
16362
|
+
{
|
|
16363
|
+
"aria-hidden": "true",
|
|
16364
|
+
style: { height: `${gapSize}px` }
|
|
16365
|
+
},
|
|
16366
|
+
`gap:${tree.zoneCompound}:${previousIndex}:${virtualItem.index}`
|
|
16367
|
+
)
|
|
16368
|
+
);
|
|
16369
|
+
}
|
|
16370
|
+
renderedItems.push(
|
|
16371
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16372
|
+
Layer,
|
|
16373
|
+
{
|
|
16374
|
+
dataIndex: virtualItem.index,
|
|
16375
|
+
depth,
|
|
16376
|
+
isSelected: selectedId === node.itemId,
|
|
16377
|
+
node,
|
|
16378
|
+
ref: virtualizer.measureElement,
|
|
16379
|
+
selectedId
|
|
16380
|
+
},
|
|
16381
|
+
node.itemId
|
|
16382
|
+
)
|
|
16383
|
+
);
|
|
16384
|
+
previousEnd = virtualItem.end;
|
|
16385
|
+
previousIndex = virtualItem.index;
|
|
16386
|
+
});
|
|
16387
|
+
const trailingGap = Math.max(totalSize - previousEnd, 0);
|
|
16388
|
+
if (trailingGap > 0) {
|
|
16389
|
+
renderedItems.push(
|
|
16390
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16391
|
+
"li",
|
|
16392
|
+
{
|
|
16393
|
+
"aria-hidden": "true",
|
|
16394
|
+
style: { height: `${trailingGap}px` }
|
|
16395
|
+
},
|
|
16396
|
+
`gap:${tree.zoneCompound}:${previousIndex}:end`
|
|
16397
|
+
)
|
|
16398
|
+
);
|
|
16399
|
+
}
|
|
16400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("ul", { className: getClassName35({ nested: depth > 0 }), ref: listRef, children: [
|
|
16401
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
16402
|
+
renderedItems
|
|
16403
|
+
] });
|
|
16404
|
+
};
|
|
16405
|
+
|
|
16406
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css#css-module
|
|
16407
|
+
init_react_import();
|
|
16408
|
+
var styles_module_default26 = { "LayerTree-zoneTitle": "_LayerTree-zoneTitle_fvhlh_2", "LayerTree-zoneIcon": "_LayerTree-zoneIcon_fvhlh_19" };
|
|
16409
|
+
|
|
16410
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
16411
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16412
|
+
var getClassName36 = get_class_name_factory_default("LayerTree", styles_module_default26);
|
|
16413
|
+
var MIN_VIRTUALIZED_LAYER_COUNT = 25;
|
|
16414
|
+
var ZoneLabel = ({
|
|
16415
|
+
label,
|
|
16416
|
+
zoneCompound
|
|
16417
|
+
}) => {
|
|
16418
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
16419
|
+
kind: "label",
|
|
16420
|
+
zoneCompound
|
|
16421
|
+
});
|
|
16422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
16423
|
+
"div",
|
|
16424
|
+
{
|
|
16425
|
+
className: getClassName36("zoneTitle"),
|
|
16426
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
16427
|
+
ref,
|
|
16428
|
+
children: [
|
|
16429
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: getClassName36("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Layers, {}) }),
|
|
16430
|
+
label,
|
|
16431
|
+
isDropTarget && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(DropLine, { edge: "bottom" })
|
|
16432
|
+
]
|
|
16433
|
+
}
|
|
16434
|
+
);
|
|
16435
|
+
};
|
|
16436
|
+
var LayerTreeZone = ({
|
|
16437
|
+
depth,
|
|
16438
|
+
selectedId,
|
|
16439
|
+
tree
|
|
16440
|
+
}) => {
|
|
16441
|
+
const shouldVirtualize = depth === 0 && tree.items.length >= MIN_VIRTUALIZED_LAYER_COUNT;
|
|
16442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
16443
|
+
tree.label && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ZoneLabel, { label: tree.label, zoneCompound: tree.zoneCompound }),
|
|
16444
|
+
shouldVirtualize ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16445
|
+
VirtualizedLayerTreeItems,
|
|
16446
|
+
{
|
|
16447
|
+
depth,
|
|
16448
|
+
selectedId,
|
|
16449
|
+
tree
|
|
16450
|
+
}
|
|
16451
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16452
|
+
StaticLayerTreeItems,
|
|
16453
|
+
{
|
|
16454
|
+
depth,
|
|
16455
|
+
selectedId,
|
|
16456
|
+
tree
|
|
16457
|
+
}
|
|
16458
|
+
)
|
|
16459
|
+
] });
|
|
16460
|
+
};
|
|
16461
|
+
|
|
16462
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
16463
|
+
init_react_import();
|
|
16464
|
+
var import_dom6 = require("@dnd-kit/dom");
|
|
16465
|
+
var import_react88 = require("@dnd-kit/react");
|
|
16466
|
+
var import_react89 = require("react");
|
|
16467
|
+
init_store();
|
|
16468
|
+
|
|
16469
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
16470
|
+
init_react_import();
|
|
16471
|
+
var import_state2 = require("@dnd-kit/state");
|
|
16472
|
+
init_get_item();
|
|
16473
|
+
|
|
16474
|
+
// lib/data/component-has-slots.ts
|
|
16475
|
+
init_react_import();
|
|
16476
|
+
function componentDataHasSlots(componentId, indexes) {
|
|
16477
|
+
return Object.keys(indexes).some(
|
|
16478
|
+
(zoneCompound) => zoneCompound.startsWith(`${componentId}:`)
|
|
16479
|
+
);
|
|
16480
|
+
}
|
|
16481
|
+
|
|
16482
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
16483
|
+
var SCROLL_SETTLE_FRAMES = 2;
|
|
16484
|
+
var SCROLL_SETTLE_MAX_FRAMES = 60;
|
|
16485
|
+
var scrollToComponentWhenSettled = (id, scrollToComponent) => {
|
|
16486
|
+
let lastTop;
|
|
16487
|
+
let stableFrames = 0;
|
|
16488
|
+
let totalFrames = 0;
|
|
16489
|
+
const check = () => {
|
|
16490
|
+
var _a;
|
|
16491
|
+
const el = (_a = getFrame()) == null ? void 0 : _a.querySelector(`[data-puck-component="${id}"]`);
|
|
16492
|
+
const top = el ? el.getBoundingClientRect().top : null;
|
|
16493
|
+
stableFrames = top === lastTop ? stableFrames + 1 : 0;
|
|
16494
|
+
lastTop = top;
|
|
16495
|
+
totalFrames += 1;
|
|
16496
|
+
if (stableFrames >= SCROLL_SETTLE_FRAMES || totalFrames >= SCROLL_SETTLE_MAX_FRAMES) {
|
|
16497
|
+
scrollToComponent(id);
|
|
16498
|
+
return;
|
|
16499
|
+
}
|
|
16500
|
+
requestAnimationFrame(check);
|
|
16501
|
+
};
|
|
16502
|
+
requestAnimationFrame(check);
|
|
16503
|
+
};
|
|
16504
|
+
var setPreviewFence = (enabled) => {
|
|
16505
|
+
if (typeof document === "undefined") return;
|
|
16506
|
+
const frameEl = document.getElementById("preview-frame");
|
|
16507
|
+
if (enabled) {
|
|
16508
|
+
frameEl == null ? void 0 : frameEl.setAttribute("data-puck-outline-dragging", "true");
|
|
16509
|
+
} else {
|
|
16510
|
+
frameEl == null ? void 0 : frameEl.removeAttribute("data-puck-outline-dragging");
|
|
16511
|
+
}
|
|
16512
|
+
};
|
|
16513
|
+
var onOutlineBeforeDragStart = (event, ctx) => {
|
|
16514
|
+
const source = event.operation.source;
|
|
16515
|
+
const data = source == null ? void 0 : source.data;
|
|
16516
|
+
if (!source || !data) return;
|
|
16517
|
+
const appState = ctx.appStore.getState();
|
|
16518
|
+
const item = getItem(
|
|
16519
|
+
{ zone: data.zoneCompound, index: data.index },
|
|
16520
|
+
appState.state
|
|
16521
|
+
);
|
|
16522
|
+
if (!item || !appState.permissions.getPermissions({ item }).drag) {
|
|
16523
|
+
event.preventDefault();
|
|
16524
|
+
return;
|
|
16525
|
+
}
|
|
16526
|
+
ctx.outlineDndStore.getState().startDrag({
|
|
16527
|
+
itemId: data.itemId,
|
|
16528
|
+
zoneCompound: data.zoneCompound,
|
|
16529
|
+
index: data.index,
|
|
16530
|
+
componentType: data.componentType
|
|
16531
|
+
});
|
|
16532
|
+
setPreviewFence(true);
|
|
16533
|
+
appState.dispatch({
|
|
16534
|
+
type: "setUi",
|
|
16535
|
+
ui: { isDragging: true },
|
|
16536
|
+
recordHistory: false
|
|
16537
|
+
});
|
|
16538
|
+
};
|
|
16539
|
+
var onOutlineDragMove = (event, manager, ctx) => {
|
|
16540
|
+
var _a, _b;
|
|
16541
|
+
const outlineStore = ctx.outlineDndStore.getState();
|
|
16542
|
+
const dragged = outlineStore.draggedRow;
|
|
16543
|
+
if (!dragged) return;
|
|
16544
|
+
const target = event.operation.target;
|
|
16545
|
+
if (!target) {
|
|
16546
|
+
outlineStore.cancelPendingExpand();
|
|
16547
|
+
outlineStore.clearTarget();
|
|
16548
|
+
return;
|
|
16549
|
+
}
|
|
16550
|
+
const targetData = target.data;
|
|
16551
|
+
if (targetData.kind === "zone") {
|
|
16552
|
+
outlineStore.cancelPendingExpand();
|
|
16553
|
+
outlineStore.setTarget(
|
|
16554
|
+
{ targetId: target.id.toString(), position: "inside" },
|
|
16555
|
+
{ zone: targetData.zoneCompound, index: 0 }
|
|
16556
|
+
);
|
|
16557
|
+
return;
|
|
16558
|
+
}
|
|
16559
|
+
const { config, state } = ctx.appStore.getState();
|
|
16560
|
+
const indexes = state.indexes;
|
|
16561
|
+
const cache2 = outlineStore.acceptCache;
|
|
16562
|
+
if (zoneAcceptsComponent(
|
|
16563
|
+
cache2,
|
|
16564
|
+
targetData.zoneCompound,
|
|
16565
|
+
dragged.componentType,
|
|
16566
|
+
config,
|
|
16567
|
+
indexes
|
|
16568
|
+
)) {
|
|
16569
|
+
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
16570
|
+
const position = getCollisionPosition(collisionData == null ? void 0 : collisionData.direction);
|
|
16571
|
+
outlineStore.setTarget(
|
|
16572
|
+
{ targetId: target.id.toString(), position },
|
|
16573
|
+
{
|
|
16574
|
+
zone: targetData.zoneCompound,
|
|
16575
|
+
index: getInsertIndex({
|
|
16576
|
+
position,
|
|
16577
|
+
sourceIndex: dragged.index,
|
|
16578
|
+
targetIndex: targetData.index,
|
|
16579
|
+
isSameZone: targetData.zoneCompound === dragged.zoneCompound
|
|
16580
|
+
})
|
|
16581
|
+
}
|
|
16582
|
+
);
|
|
16583
|
+
} else {
|
|
16584
|
+
outlineStore.clearTarget();
|
|
16585
|
+
}
|
|
16586
|
+
const isCurrentlyExpanded = Boolean((_b = state.ui.itemExpanded) == null ? void 0 : _b[targetData.itemId]) || outlineStore.tempExpandedIds.has(targetData.itemId);
|
|
16587
|
+
const isExpandable = componentDataHasSlots(targetData.itemId, indexes.zones);
|
|
16588
|
+
if (!isCurrentlyExpanded && isExpandable) {
|
|
16589
|
+
outlineStore.scheduleExpand(targetData.itemId, () => {
|
|
16590
|
+
requestAnimationFrame(() => manager.collisionObserver.forceUpdate(true));
|
|
16591
|
+
});
|
|
16592
|
+
} else {
|
|
16593
|
+
outlineStore.cancelPendingExpand();
|
|
16594
|
+
}
|
|
16595
|
+
};
|
|
16596
|
+
var onOutlineDragEnd = (event, ctx) => {
|
|
16597
|
+
const { source } = event.operation;
|
|
16598
|
+
const outlineDnDState = ctx.outlineDndStore.getState();
|
|
16599
|
+
const dragged = outlineDnDState.draggedRow;
|
|
16600
|
+
const drop = event.canceled ? null : outlineDnDState.drop;
|
|
16601
|
+
const dispatch = ctx.appStore.getState().dispatch;
|
|
16602
|
+
setPreviewFence(false);
|
|
16603
|
+
if (dragged && drop) {
|
|
16604
|
+
moveComponent(
|
|
16605
|
+
dragged.itemId,
|
|
16606
|
+
{ zone: dragged.zoneCompound, index: dragged.index },
|
|
16607
|
+
{ zone: drop.zone, index: drop.index },
|
|
16608
|
+
ctx.appStore
|
|
16609
|
+
);
|
|
16610
|
+
const moved = drop.zone !== dragged.zoneCompound || drop.index !== dragged.index;
|
|
16611
|
+
dispatch({
|
|
16612
|
+
type: "setUi",
|
|
16613
|
+
ui: {
|
|
16614
|
+
itemSelector: { zone: drop.zone, index: drop.index },
|
|
16615
|
+
isDragging: false
|
|
16616
|
+
},
|
|
16617
|
+
recordHistory: moved
|
|
16618
|
+
});
|
|
16619
|
+
scrollToComponentWhenSettled(dragged.itemId, ctx.scrollToComponent);
|
|
16620
|
+
} else {
|
|
16621
|
+
dispatch({
|
|
16622
|
+
type: "setUi",
|
|
16623
|
+
ui: { isDragging: false },
|
|
16624
|
+
recordHistory: false
|
|
16625
|
+
});
|
|
16626
|
+
}
|
|
16627
|
+
outlineDnDState.endDrag();
|
|
16628
|
+
const reset = () => ctx.outlineDndStore.getState().reset();
|
|
16629
|
+
if (!source || source.status === "idle") {
|
|
16630
|
+
reset();
|
|
16631
|
+
} else {
|
|
16632
|
+
const dispose = (0, import_state2.effect)(() => {
|
|
16633
|
+
if (source.status === "idle") {
|
|
16634
|
+
reset();
|
|
16635
|
+
dispose == null ? void 0 : dispose();
|
|
16636
|
+
}
|
|
16637
|
+
});
|
|
16638
|
+
}
|
|
16639
|
+
};
|
|
16640
|
+
|
|
16641
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
16642
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
16643
|
+
var NO_SENSORS = [];
|
|
16644
|
+
var OutlineDndProvider = ({ children }) => {
|
|
16645
|
+
const appStore = useAppStoreApi();
|
|
16646
|
+
const zoneStore = (0, import_react89.useContext)(ZoneStoreContext);
|
|
16647
|
+
const [outlineDndStore] = (0, import_react89.useState)(() => createOutlineDndStore());
|
|
16648
|
+
const disableOutlineDrag = useAppStore(
|
|
16649
|
+
(s) => {
|
|
16650
|
+
var _a, _b;
|
|
16651
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
15574
16652
|
}
|
|
16653
|
+
);
|
|
16654
|
+
const sensors = useSensors({
|
|
16655
|
+
mouse: [new import_dom6.PointerActivationConstraints.Distance({ value: 5 })]
|
|
15575
16656
|
});
|
|
15576
|
-
const
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
|
|
15593
|
-
)
|
|
15594
|
-
|
|
16657
|
+
const dragContext = (0, import_react89.useMemo)(
|
|
16658
|
+
() => ({
|
|
16659
|
+
outlineDndStore,
|
|
16660
|
+
appStore,
|
|
16661
|
+
scrollToComponent: (id) => zoneStore.getState().scrollToComponent(id)
|
|
16662
|
+
}),
|
|
16663
|
+
[outlineDndStore, appStore, zoneStore]
|
|
16664
|
+
);
|
|
16665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(OutlineDndStoreContext.Provider, { value: outlineDndStore, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16666
|
+
import_react88.DragDropProvider,
|
|
16667
|
+
{
|
|
16668
|
+
sensors: disableOutlineDrag ? NO_SENSORS : sensors,
|
|
16669
|
+
onBeforeDragStart: (event) => {
|
|
16670
|
+
onOutlineBeforeDragStart(event, dragContext);
|
|
16671
|
+
},
|
|
16672
|
+
onDragOver: (event, manager) => {
|
|
16673
|
+
event.preventDefault();
|
|
16674
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
16675
|
+
},
|
|
16676
|
+
onDragMove: (event, manager) => {
|
|
16677
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
16678
|
+
},
|
|
16679
|
+
onDragEnd: (event) => {
|
|
16680
|
+
onOutlineDragEnd(event, dragContext);
|
|
16681
|
+
},
|
|
16682
|
+
children
|
|
15595
16683
|
}
|
|
15596
|
-
|
|
15597
|
-
|
|
15598
|
-
|
|
15599
|
-
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
);
|
|
15612
|
-
previousEnd = virtualItem.end;
|
|
15613
|
-
previousIndex = virtualItem.index;
|
|
16684
|
+
) });
|
|
16685
|
+
};
|
|
16686
|
+
|
|
16687
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
|
16688
|
+
init_react_import();
|
|
16689
|
+
var styles_module_default27 = { "LayerTreeRoot": "_LayerTreeRoot_kxnd1_1" };
|
|
16690
|
+
|
|
16691
|
+
// components/LayerTree/lib/build-layer-tree.ts
|
|
16692
|
+
init_react_import();
|
|
16693
|
+
var getZonesByParent = (zones) => {
|
|
16694
|
+
const result = {};
|
|
16695
|
+
Object.keys(zones).forEach((zone) => {
|
|
16696
|
+
const [parentId] = zone.split(":");
|
|
16697
|
+
if (!parentId) return;
|
|
16698
|
+
if (!result[parentId]) result[parentId] = [];
|
|
16699
|
+
result[parentId].push(zone);
|
|
15614
16700
|
});
|
|
15615
|
-
|
|
15616
|
-
|
|
15617
|
-
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
|
|
15621
|
-
"aria-hidden": "true",
|
|
15622
|
-
style: { height: `${trailingGap}px` }
|
|
15623
|
-
},
|
|
15624
|
-
`gap:${tree.zoneCompound}:${previousIndex}:end`
|
|
15625
|
-
)
|
|
15626
|
-
);
|
|
16701
|
+
return result;
|
|
16702
|
+
};
|
|
16703
|
+
var getZoneLabel = (zoneCompound, nodes, config, label) => {
|
|
16704
|
+
var _a, _b;
|
|
16705
|
+
if (label !== void 0) {
|
|
16706
|
+
return label;
|
|
15627
16707
|
}
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
16708
|
+
const [, slotId] = zoneCompound.split(":");
|
|
16709
|
+
if (!slotId) {
|
|
16710
|
+
return;
|
|
16711
|
+
}
|
|
16712
|
+
return (_b = (_a = getSlotField(zoneCompound, config, nodes)) == null ? void 0 : _a.label) != null ? _b : slotId;
|
|
16713
|
+
};
|
|
16714
|
+
var buildLayerNode = ({
|
|
16715
|
+
config,
|
|
16716
|
+
itemId,
|
|
16717
|
+
index,
|
|
16718
|
+
nodes,
|
|
16719
|
+
zoneCompound,
|
|
16720
|
+
zones,
|
|
16721
|
+
zonesByParent,
|
|
16722
|
+
componentFallbackLabel
|
|
16723
|
+
}) => {
|
|
16724
|
+
var _a, _b, _c, _d;
|
|
16725
|
+
const nodeData = nodes[itemId];
|
|
16726
|
+
const componentType = (_b = (_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) != null ? _b : componentFallbackLabel;
|
|
16727
|
+
const label = (_d = (_c = config.components[componentType]) == null ? void 0 : _c.label) != null ? _d : componentType;
|
|
16728
|
+
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
16729
|
+
return {
|
|
16730
|
+
childZones: childZoneCompounds.map(
|
|
16731
|
+
(childZoneCompound) => buildLayerTree({
|
|
16732
|
+
config,
|
|
16733
|
+
nodes,
|
|
16734
|
+
zoneCompound: childZoneCompound,
|
|
16735
|
+
zones,
|
|
16736
|
+
zonesByParent
|
|
16737
|
+
})
|
|
16738
|
+
),
|
|
16739
|
+
componentType,
|
|
16740
|
+
index,
|
|
16741
|
+
itemId,
|
|
16742
|
+
label,
|
|
16743
|
+
zoneCompound
|
|
16744
|
+
};
|
|
16745
|
+
};
|
|
16746
|
+
var buildLayerTree = ({
|
|
16747
|
+
config,
|
|
16748
|
+
label,
|
|
16749
|
+
nodes,
|
|
16750
|
+
zoneCompound,
|
|
16751
|
+
zones,
|
|
16752
|
+
zonesByParent = getZonesByParent(zones),
|
|
16753
|
+
componentFallbackLabel
|
|
16754
|
+
}) => {
|
|
16755
|
+
var _a, _b;
|
|
16756
|
+
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
16757
|
+
return {
|
|
16758
|
+
items: contentIds.map(
|
|
16759
|
+
(itemId, index) => buildLayerNode({
|
|
16760
|
+
config,
|
|
16761
|
+
itemId,
|
|
16762
|
+
index,
|
|
16763
|
+
nodes,
|
|
16764
|
+
zoneCompound,
|
|
16765
|
+
zones,
|
|
16766
|
+
zonesByParent
|
|
16767
|
+
})
|
|
16768
|
+
),
|
|
16769
|
+
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
16770
|
+
zoneCompound
|
|
16771
|
+
};
|
|
15632
16772
|
};
|
|
16773
|
+
|
|
16774
|
+
// components/LayerTree/index.tsx
|
|
16775
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16776
|
+
var getClassNameDragRoot = get_class_name_factory_default("LayerTreeRoot", styles_module_default27);
|
|
15633
16777
|
var LayerTree = ({
|
|
15634
16778
|
selectedId,
|
|
15635
|
-
selectedPathIds,
|
|
15636
16779
|
trees
|
|
15637
16780
|
}) => {
|
|
15638
|
-
|
|
15639
|
-
|
|
16781
|
+
const disableOutlineDrag = useAppStore(
|
|
16782
|
+
(s) => {
|
|
16783
|
+
var _a, _b;
|
|
16784
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
16785
|
+
}
|
|
16786
|
+
);
|
|
16787
|
+
const hasItems = trees.length > 0 && trees[0].items.length > 0;
|
|
16788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(OutlineDndProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16789
|
+
"div",
|
|
15640
16790
|
{
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
16791
|
+
className: getClassNameDragRoot(),
|
|
16792
|
+
"data-puck-dnd-disabled": disableOutlineDrag || void 0,
|
|
16793
|
+
children: hasItems && trees.map((tree) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16794
|
+
LayerTreeZone,
|
|
16795
|
+
{
|
|
16796
|
+
depth: 0,
|
|
16797
|
+
selectedId,
|
|
16798
|
+
tree
|
|
16799
|
+
},
|
|
16800
|
+
tree.zoneCompound
|
|
16801
|
+
))
|
|
16802
|
+
}
|
|
16803
|
+
) });
|
|
15648
16804
|
};
|
|
15649
16805
|
|
|
15650
|
-
// components/Puck/components/Outline/index.tsx
|
|
15651
|
-
|
|
16806
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
16807
|
+
init_react_import();
|
|
16808
|
+
init_lucide_react();
|
|
16809
|
+
init_get_class_name_factory();
|
|
16810
|
+
|
|
16811
|
+
// lib/merge-class-names.ts
|
|
16812
|
+
init_react_import();
|
|
16813
|
+
var mergeClassNames = (...classNames) => [...classNames].filter(Boolean).join(" ");
|
|
16814
|
+
var merge_class_names_default = mergeClassNames;
|
|
16815
|
+
|
|
16816
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
15652
16817
|
init_use_message();
|
|
15653
|
-
|
|
16818
|
+
init_store();
|
|
16819
|
+
init_IconButton2();
|
|
15654
16820
|
|
|
15655
|
-
//
|
|
16821
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css#css-module
|
|
15656
16822
|
init_react_import();
|
|
15657
|
-
var
|
|
15658
|
-
|
|
15659
|
-
|
|
16823
|
+
var styles_module_default28 = { "CollapseAll": "_CollapseAll_1r4cy_1", "CollapseAll-icon": "_CollapseAll-icon_1r4cy_5", "CollapseAll--visible": "_CollapseAll--visible_1r4cy_10" };
|
|
16824
|
+
|
|
16825
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
16826
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16827
|
+
var getClassName37 = get_class_name_factory_default("CollapseAll", styles_module_default28);
|
|
16828
|
+
function CollapseAll({ className }) {
|
|
16829
|
+
const hasExpandedItems = useAppStore(
|
|
16830
|
+
(s) => {
|
|
16831
|
+
var _a;
|
|
16832
|
+
return Object.keys((_a = s.state.ui.itemExpanded) != null ? _a : {}).length > 0;
|
|
16833
|
+
}
|
|
16834
|
+
);
|
|
16835
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
16836
|
+
const collapseAllMsg = useMessage("outline-header-collapseall");
|
|
16837
|
+
const collapseAll = () => {
|
|
16838
|
+
dispatch({ type: "setUi", ui: { itemExpanded: {} } });
|
|
16839
|
+
};
|
|
16840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16841
|
+
"div",
|
|
16842
|
+
{
|
|
16843
|
+
className: merge_class_names_default(
|
|
16844
|
+
getClassName37({ visible: hasExpandedItems }),
|
|
16845
|
+
className
|
|
16846
|
+
),
|
|
16847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(IconButton, { title: collapseAllMsg, onClick: collapseAll, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChevronsDownUp, { className: getClassName37("icon") }) })
|
|
16848
|
+
}
|
|
15660
16849
|
);
|
|
16850
|
+
}
|
|
16851
|
+
var collapse_all_default = CollapseAll;
|
|
16852
|
+
|
|
16853
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
16854
|
+
init_react_import();
|
|
16855
|
+
init_lib();
|
|
16856
|
+
init_use_message();
|
|
16857
|
+
|
|
16858
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css#css-module
|
|
16859
|
+
init_react_import();
|
|
16860
|
+
var styles_module_default29 = { "OutlineHeader": "_OutlineHeader_filq3_1", "OutlineHeader-title": "_OutlineHeader-title_filq3_12" };
|
|
16861
|
+
|
|
16862
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
16863
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16864
|
+
var getClassName38 = get_class_name_factory_default("OutlineHeader", styles_module_default29);
|
|
16865
|
+
var OutlineHeader = ({
|
|
16866
|
+
children,
|
|
16867
|
+
title
|
|
16868
|
+
}) => {
|
|
16869
|
+
const outlineHeaderMsg = useMessage("outline-header-title");
|
|
16870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: getClassName38(), children: [
|
|
16871
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: getClassName38("title"), children: outlineHeaderMsg != null ? outlineHeaderMsg : title }),
|
|
16872
|
+
children
|
|
16873
|
+
] });
|
|
15661
16874
|
};
|
|
16875
|
+
var outline_header_default = OutlineHeader;
|
|
16876
|
+
|
|
16877
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css#css-module
|
|
16878
|
+
init_react_import();
|
|
16879
|
+
var styles_module_default30 = { "OutlineWrapper": "_OutlineWrapper_b9ln0_1", "OutlineWrapper-collapseAll": "_OutlineWrapper-collapseAll_b9ln0_9", "OutlineWrapper-layers": "_OutlineWrapper-layers_b9ln0_15" };
|
|
15662
16880
|
|
|
15663
16881
|
// components/Puck/components/Outline/index.tsx
|
|
15664
|
-
var
|
|
15665
|
-
var
|
|
16882
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
16883
|
+
var getClassName39 = get_class_name_factory_default("OutlineWrapper", styles_module_default30);
|
|
16884
|
+
var DefaultWrapper = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName39(), children });
|
|
15666
16885
|
var Outline = () => {
|
|
15667
16886
|
const outlineOverride = useAppStore((s) => s.overrides.outline);
|
|
15668
16887
|
const config = useAppStore((s) => s.config);
|
|
@@ -15674,16 +16893,9 @@ var Outline = () => {
|
|
|
15674
16893
|
});
|
|
15675
16894
|
const componentFallbackLabel = useMessage("label-component");
|
|
15676
16895
|
const rootZones = useAppStore(
|
|
15677
|
-
(0,
|
|
16896
|
+
(0, import_shallow9.useShallow)((s) => findZonesForArea(s.state, "root"))
|
|
15678
16897
|
);
|
|
15679
|
-
const
|
|
15680
|
-
var _a;
|
|
15681
|
-
const selectedPath = selectedId ? (_a = nodes[selectedId]) == null ? void 0 : _a.path : null;
|
|
15682
|
-
return new Set(
|
|
15683
|
-
(selectedPath == null ? void 0 : selectedPath.map((candidate) => candidate.split(":")[0]).filter(Boolean)) || []
|
|
15684
|
-
);
|
|
15685
|
-
}, [nodes, selectedId]);
|
|
15686
|
-
const trees = (0, import_react82.useMemo)(
|
|
16898
|
+
const trees = (0, import_react90.useMemo)(
|
|
15687
16899
|
() => rootZones.map(
|
|
15688
16900
|
(zoneCompound) => buildLayerTree({
|
|
15689
16901
|
config,
|
|
@@ -15696,15 +16908,14 @@ var Outline = () => {
|
|
|
15696
16908
|
),
|
|
15697
16909
|
[config, nodes, rootZones, zones, componentFallbackLabel]
|
|
15698
16910
|
);
|
|
15699
|
-
const Wrapper = (0,
|
|
15700
|
-
|
|
15701
|
-
|
|
15702
|
-
|
|
15703
|
-
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
) });
|
|
16911
|
+
const Wrapper = (0, import_react90.useMemo)(
|
|
16912
|
+
() => outlineOverride || DefaultWrapper,
|
|
16913
|
+
[outlineOverride]
|
|
16914
|
+
);
|
|
16915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Wrapper, { children: [
|
|
16916
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(outline_header_default, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(collapse_all_default, { className: getClassName39("collapseAll") }) }),
|
|
16917
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName39("layers"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(LayerTree, { selectedId, trees }) })
|
|
16918
|
+
] });
|
|
15708
16919
|
};
|
|
15709
16920
|
|
|
15710
16921
|
// components/Puck/index.tsx
|
|
@@ -15712,7 +16923,7 @@ init_default_viewports();
|
|
|
15712
16923
|
|
|
15713
16924
|
// lib/use-loaded-overrides.ts
|
|
15714
16925
|
init_react_import();
|
|
15715
|
-
var
|
|
16926
|
+
var import_react91 = require("react");
|
|
15716
16927
|
|
|
15717
16928
|
// lib/load-overrides.ts
|
|
15718
16929
|
init_react_import();
|
|
@@ -15754,7 +16965,7 @@ var useLoadedOverrides = ({
|
|
|
15754
16965
|
overrides,
|
|
15755
16966
|
plugins
|
|
15756
16967
|
}) => {
|
|
15757
|
-
return (0,
|
|
16968
|
+
return (0, import_react91.useMemo)(() => {
|
|
15758
16969
|
return loadOverrides({ overrides, plugins });
|
|
15759
16970
|
}, [plugins, overrides]);
|
|
15760
16971
|
};
|
|
@@ -15765,8 +16976,8 @@ init_permissions();
|
|
|
15765
16976
|
|
|
15766
16977
|
// lib/use-puck.ts
|
|
15767
16978
|
init_react_import();
|
|
15768
|
-
var
|
|
15769
|
-
var
|
|
16979
|
+
var import_react92 = require("react");
|
|
16980
|
+
var import_zustand8 = require("zustand");
|
|
15770
16981
|
init_make_state_public();
|
|
15771
16982
|
init_get_item();
|
|
15772
16983
|
|
|
@@ -15876,7 +17087,7 @@ var generateUsePuck = (store, getState) => {
|
|
|
15876
17087
|
};
|
|
15877
17088
|
return storeData;
|
|
15878
17089
|
};
|
|
15879
|
-
var UsePuckStoreContext = (0,
|
|
17090
|
+
var UsePuckStoreContext = (0, import_react92.createContext)(
|
|
15880
17091
|
null
|
|
15881
17092
|
);
|
|
15882
17093
|
var convertToPickedStore = (store) => {
|
|
@@ -15891,15 +17102,15 @@ var convertToPickedStore = (store) => {
|
|
|
15891
17102
|
};
|
|
15892
17103
|
};
|
|
15893
17104
|
var useRegisterUsePuckStore = (appStore) => {
|
|
15894
|
-
const [usePuckStore] = (0,
|
|
15895
|
-
() => (0,
|
|
17105
|
+
const [usePuckStore] = (0, import_react92.useState)(
|
|
17106
|
+
() => (0, import_zustand8.createStore)(
|
|
15896
17107
|
() => generateUsePuck(
|
|
15897
17108
|
convertToPickedStore(appStore.getState()),
|
|
15898
17109
|
appStore.getState
|
|
15899
17110
|
)
|
|
15900
17111
|
)
|
|
15901
17112
|
);
|
|
15902
|
-
(0,
|
|
17113
|
+
(0, import_react92.useEffect)(() => {
|
|
15903
17114
|
return appStore.subscribe(
|
|
15904
17115
|
(store) => convertToPickedStore(store),
|
|
15905
17116
|
(pickedStore) => {
|
|
@@ -15911,11 +17122,11 @@ var useRegisterUsePuckStore = (appStore) => {
|
|
|
15911
17122
|
};
|
|
15912
17123
|
function createUsePuck() {
|
|
15913
17124
|
return function usePuck2(selector) {
|
|
15914
|
-
const usePuckApi = (0,
|
|
17125
|
+
const usePuckApi = (0, import_react92.useContext)(UsePuckStoreContext);
|
|
15915
17126
|
if (!usePuckApi) {
|
|
15916
17127
|
throw new Error("usePuck must be used inside <Puck>.");
|
|
15917
17128
|
}
|
|
15918
|
-
const result = (0,
|
|
17129
|
+
const result = (0, import_zustand8.useStore)(
|
|
15919
17130
|
usePuckApi,
|
|
15920
17131
|
selector != null ? selector : ((s) => s)
|
|
15921
17132
|
);
|
|
@@ -15923,7 +17134,7 @@ function createUsePuck() {
|
|
|
15923
17134
|
};
|
|
15924
17135
|
}
|
|
15925
17136
|
function usePuck() {
|
|
15926
|
-
(0,
|
|
17137
|
+
(0, import_react92.useEffect)(() => {
|
|
15927
17138
|
console.warn(
|
|
15928
17139
|
"You're using the `usePuck` method without a selector, which may cause unnecessary re-renders. Replace with `createUsePuck` and provide a selector for improved performance."
|
|
15929
17140
|
);
|
|
@@ -15931,7 +17142,7 @@ function usePuck() {
|
|
|
15931
17142
|
return createUsePuck()((s) => s);
|
|
15932
17143
|
}
|
|
15933
17144
|
function useGetPuck() {
|
|
15934
|
-
const usePuckApi = (0,
|
|
17145
|
+
const usePuckApi = (0, import_react92.useContext)(UsePuckStoreContext);
|
|
15935
17146
|
if (!usePuckApi) {
|
|
15936
17147
|
throw new Error("usePuckGet must be used inside <Puck>.");
|
|
15937
17148
|
}
|
|
@@ -15946,12 +17157,12 @@ init_to_component();
|
|
|
15946
17157
|
|
|
15947
17158
|
// components/Puck/components/Layout/index.tsx
|
|
15948
17159
|
init_react_import();
|
|
15949
|
-
var
|
|
17160
|
+
var import_react102 = require("react");
|
|
15950
17161
|
init_lib();
|
|
15951
17162
|
|
|
15952
17163
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css#css-module
|
|
15953
17164
|
init_react_import();
|
|
15954
|
-
var
|
|
17165
|
+
var styles_module_default31 = { "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" };
|
|
15955
17166
|
|
|
15956
17167
|
// components/Puck/components/Layout/index.tsx
|
|
15957
17168
|
init_store();
|
|
@@ -15959,20 +17170,20 @@ init_use_message();
|
|
|
15959
17170
|
|
|
15960
17171
|
// components/DefaultOverride/index.tsx
|
|
15961
17172
|
init_react_import();
|
|
15962
|
-
var
|
|
15963
|
-
var DefaultOverride = ({ children }) => /* @__PURE__ */ (0,
|
|
17173
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
17174
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_jsx_runtime89.Fragment, { children });
|
|
15964
17175
|
|
|
15965
17176
|
// components/Puck/components/Layout/index.tsx
|
|
15966
17177
|
init_use_hotkey();
|
|
15967
17178
|
|
|
15968
17179
|
// lib/use-preview-mode-hotkeys.ts
|
|
15969
17180
|
init_react_import();
|
|
15970
|
-
var
|
|
17181
|
+
var import_react93 = require("react");
|
|
15971
17182
|
init_use_hotkey();
|
|
15972
17183
|
init_store();
|
|
15973
17184
|
var usePreviewModeHotkeys = () => {
|
|
15974
17185
|
const appStore = useAppStoreApi();
|
|
15975
|
-
const toggleInteractive = (0,
|
|
17186
|
+
const toggleInteractive = (0, import_react93.useCallback)(() => {
|
|
15976
17187
|
const dispatch = appStore.getState().dispatch;
|
|
15977
17188
|
dispatch({
|
|
15978
17189
|
type: "setUi",
|
|
@@ -15987,7 +17198,7 @@ var usePreviewModeHotkeys = () => {
|
|
|
15987
17198
|
|
|
15988
17199
|
// components/Puck/components/Header/index.tsx
|
|
15989
17200
|
init_react_import();
|
|
15990
|
-
var
|
|
17201
|
+
var import_react94 = require("react");
|
|
15991
17202
|
init_store();
|
|
15992
17203
|
init_lucide_react();
|
|
15993
17204
|
init_IconButton();
|
|
@@ -16000,13 +17211,13 @@ init_get_class_name_factory();
|
|
|
16000
17211
|
|
|
16001
17212
|
// css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
|
|
16002
17213
|
init_react_import();
|
|
16003
|
-
var
|
|
17214
|
+
var styles_module_default32 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_1hxnj_14", "MenuBar-inner": "_MenuBar-inner_1hxnj_29", "MenuBar-history": "_MenuBar-history_1hxnj_45" };
|
|
16004
17215
|
|
|
16005
17216
|
// components/MenuBar/index.tsx
|
|
16006
17217
|
init_store();
|
|
16007
17218
|
init_use_message();
|
|
16008
|
-
var
|
|
16009
|
-
var
|
|
17219
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
17220
|
+
var getClassName40 = get_class_name_factory_default("MenuBar", styles_module_default32);
|
|
16010
17221
|
function MenuBar({
|
|
16011
17222
|
menuOpen = false,
|
|
16012
17223
|
renderHeaderActions,
|
|
@@ -16018,10 +17229,10 @@ function MenuBar({
|
|
|
16018
17229
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
16019
17230
|
const undoLabel = useMessage("header-undo");
|
|
16020
17231
|
const redoLabel = useMessage("header-redo");
|
|
16021
|
-
return /* @__PURE__ */ (0,
|
|
17232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16022
17233
|
"div",
|
|
16023
17234
|
{
|
|
16024
|
-
className:
|
|
17235
|
+
className: getClassName40({ menuOpen }),
|
|
16025
17236
|
onClick: (event) => {
|
|
16026
17237
|
var _a;
|
|
16027
17238
|
const element = event.target;
|
|
@@ -16032,30 +17243,30 @@ function MenuBar({
|
|
|
16032
17243
|
setMenuOpen(false);
|
|
16033
17244
|
}
|
|
16034
17245
|
},
|
|
16035
|
-
children: /* @__PURE__ */ (0,
|
|
16036
|
-
/* @__PURE__ */ (0,
|
|
16037
|
-
/* @__PURE__ */ (0,
|
|
17246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: getClassName40("inner"), children: [
|
|
17247
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: getClassName40("history"), children: [
|
|
17248
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16038
17249
|
IconButton,
|
|
16039
17250
|
{
|
|
16040
17251
|
type: "button",
|
|
16041
17252
|
title: undoLabel,
|
|
16042
17253
|
disabled: !hasPast,
|
|
16043
17254
|
onClick: back,
|
|
16044
|
-
children: /* @__PURE__ */ (0,
|
|
17255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Undo2, { size: 21 })
|
|
16045
17256
|
}
|
|
16046
17257
|
),
|
|
16047
|
-
/* @__PURE__ */ (0,
|
|
17258
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16048
17259
|
IconButton,
|
|
16049
17260
|
{
|
|
16050
17261
|
type: "button",
|
|
16051
17262
|
title: redoLabel,
|
|
16052
17263
|
disabled: !hasFuture,
|
|
16053
17264
|
onClick: forward,
|
|
16054
|
-
children: /* @__PURE__ */ (0,
|
|
17265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Redo2, { size: 21 })
|
|
16055
17266
|
}
|
|
16056
17267
|
)
|
|
16057
17268
|
] }),
|
|
16058
|
-
/* @__PURE__ */ (0,
|
|
17269
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_jsx_runtime90.Fragment, { children: renderHeaderActions && renderHeaderActions() })
|
|
16059
17270
|
] })
|
|
16060
17271
|
}
|
|
16061
17272
|
);
|
|
@@ -16067,11 +17278,11 @@ init_use_message();
|
|
|
16067
17278
|
|
|
16068
17279
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Header/styles.module.css#css-module
|
|
16069
17280
|
init_react_import();
|
|
16070
|
-
var
|
|
17281
|
+
var styles_module_default33 = { "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" };
|
|
16071
17282
|
|
|
16072
17283
|
// components/Puck/components/Header/index.tsx
|
|
16073
|
-
var
|
|
16074
|
-
var
|
|
17284
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
17285
|
+
var getClassName41 = get_class_name_factory_default("PuckHeader", styles_module_default33);
|
|
16075
17286
|
var HeaderInner = ({
|
|
16076
17287
|
hidePlugins
|
|
16077
17288
|
}) => {
|
|
@@ -16085,7 +17296,7 @@ var HeaderInner = ({
|
|
|
16085
17296
|
} = usePropsContext();
|
|
16086
17297
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
16087
17298
|
const appStore = useAppStoreApi();
|
|
16088
|
-
const defaultHeaderRender = (0,
|
|
17299
|
+
const defaultHeaderRender = (0, import_react94.useMemo)(() => {
|
|
16089
17300
|
if (renderHeader) {
|
|
16090
17301
|
console.warn(
|
|
16091
17302
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
|
@@ -16094,13 +17305,13 @@ var HeaderInner = ({
|
|
|
16094
17305
|
var _b = _a, { actions } = _b, props = __objRest(_b, ["actions"]);
|
|
16095
17306
|
const Comp = renderHeader;
|
|
16096
17307
|
const appState = useAppStore((s) => s.state);
|
|
16097
|
-
return /* @__PURE__ */ (0,
|
|
17308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
|
|
16098
17309
|
};
|
|
16099
17310
|
return RenderHeader;
|
|
16100
17311
|
}
|
|
16101
17312
|
return DefaultOverride;
|
|
16102
17313
|
}, [renderHeader]);
|
|
16103
|
-
const defaultHeaderActionsRender = (0,
|
|
17314
|
+
const defaultHeaderActionsRender = (0, import_react94.useMemo)(() => {
|
|
16104
17315
|
if (renderHeaderActions) {
|
|
16105
17316
|
console.warn(
|
|
16106
17317
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
|
@@ -16108,7 +17319,7 @@ var HeaderInner = ({
|
|
|
16108
17319
|
const RenderHeader = (props) => {
|
|
16109
17320
|
const Comp = renderHeaderActions;
|
|
16110
17321
|
const appState = useAppStore((s) => s.state);
|
|
16111
|
-
return /* @__PURE__ */ (0,
|
|
17322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
|
|
16112
17323
|
};
|
|
16113
17324
|
return RenderHeader;
|
|
16114
17325
|
}
|
|
@@ -16120,7 +17331,7 @@ var HeaderInner = ({
|
|
|
16120
17331
|
const CustomHeaderActions = useAppStore(
|
|
16121
17332
|
(s) => s.overrides.headerActions || defaultHeaderActionsRender
|
|
16122
17333
|
);
|
|
16123
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
17334
|
+
const [menuOpen, setMenuOpen] = (0, import_react94.useState)(false);
|
|
16124
17335
|
const rootTitle = useAppStore((s) => {
|
|
16125
17336
|
var _a, _b;
|
|
16126
17337
|
const rootData = (_a = s.state.indexes.nodes["root"]) == null ? void 0 : _a.data;
|
|
@@ -16130,7 +17341,7 @@ var HeaderInner = ({
|
|
|
16130
17341
|
const rightSideBarVisible = useAppStore(
|
|
16131
17342
|
(s) => s.state.ui.rightSideBarVisible
|
|
16132
17343
|
);
|
|
16133
|
-
const toggleSidebars = (0,
|
|
17344
|
+
const toggleSidebars = (0, import_react94.useCallback)(
|
|
16134
17345
|
(sidebar) => {
|
|
16135
17346
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
|
16136
17347
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
|
@@ -16149,31 +17360,31 @@ var HeaderInner = ({
|
|
|
16149
17360
|
const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
|
|
16150
17361
|
const toggleRightLabel = useMessage("header-toggle-rightsidebar");
|
|
16151
17362
|
const toggleMenuLabel = useMessage("header-toggle-menubar");
|
|
16152
|
-
return /* @__PURE__ */ (0,
|
|
17363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16153
17364
|
CustomHeader,
|
|
16154
17365
|
{
|
|
16155
|
-
actions: /* @__PURE__ */ (0,
|
|
17366
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16156
17367
|
Button,
|
|
16157
17368
|
{
|
|
16158
17369
|
onClick: () => {
|
|
16159
17370
|
const data = appStore.getState().state.data;
|
|
16160
17371
|
onPublish && onPublish(data);
|
|
16161
17372
|
},
|
|
16162
|
-
icon: /* @__PURE__ */ (0,
|
|
17373
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Globe, { size: "14px" }),
|
|
16163
17374
|
children: publishLabel
|
|
16164
17375
|
}
|
|
16165
17376
|
) }) }),
|
|
16166
|
-
children: /* @__PURE__ */ (0,
|
|
17377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16167
17378
|
"header",
|
|
16168
17379
|
{
|
|
16169
|
-
className:
|
|
17380
|
+
className: getClassName41({
|
|
16170
17381
|
leftSideBarVisible,
|
|
16171
17382
|
rightSideBarVisible,
|
|
16172
17383
|
hidePlugins
|
|
16173
17384
|
}),
|
|
16174
|
-
children: /* @__PURE__ */ (0,
|
|
16175
|
-
/* @__PURE__ */ (0,
|
|
16176
|
-
/* @__PURE__ */ (0,
|
|
17385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName41("inner"), children: [
|
|
17386
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName41("toggle"), children: [
|
|
17387
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16177
17388
|
IconButton,
|
|
16178
17389
|
{
|
|
16179
17390
|
type: "button",
|
|
@@ -16181,10 +17392,10 @@ var HeaderInner = ({
|
|
|
16181
17392
|
toggleSidebars("left");
|
|
16182
17393
|
},
|
|
16183
17394
|
title: toggleLeftLabel,
|
|
16184
|
-
children: /* @__PURE__ */ (0,
|
|
17395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PanelLeft, { focusable: "false" })
|
|
16185
17396
|
}
|
|
16186
17397
|
) }),
|
|
16187
|
-
/* @__PURE__ */ (0,
|
|
17398
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16188
17399
|
IconButton,
|
|
16189
17400
|
{
|
|
16190
17401
|
type: "button",
|
|
@@ -16192,19 +17403,19 @@ var HeaderInner = ({
|
|
|
16192
17403
|
toggleSidebars("right");
|
|
16193
17404
|
},
|
|
16194
17405
|
title: toggleRightLabel,
|
|
16195
|
-
children: /* @__PURE__ */ (0,
|
|
17406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PanelRight, { focusable: "false" })
|
|
16196
17407
|
}
|
|
16197
17408
|
) })
|
|
16198
17409
|
] }),
|
|
16199
|
-
/* @__PURE__ */ (0,
|
|
17410
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41("title"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Heading7, { rank: "2", size: "xs", children: [
|
|
16200
17411
|
headerTitle || rootTitle || pageLabel,
|
|
16201
|
-
headerPath && /* @__PURE__ */ (0,
|
|
17412
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
16202
17413
|
" ",
|
|
16203
|
-
/* @__PURE__ */ (0,
|
|
17414
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("code", { className: getClassName41("path"), children: headerPath })
|
|
16204
17415
|
] })
|
|
16205
17416
|
] }) }),
|
|
16206
|
-
/* @__PURE__ */ (0,
|
|
16207
|
-
/* @__PURE__ */ (0,
|
|
17417
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName41("tools"), children: [
|
|
17418
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName41("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16208
17419
|
IconButton,
|
|
16209
17420
|
{
|
|
16210
17421
|
type: "button",
|
|
@@ -16212,23 +17423,23 @@ var HeaderInner = ({
|
|
|
16212
17423
|
return setMenuOpen(!menuOpen);
|
|
16213
17424
|
},
|
|
16214
17425
|
title: toggleMenuLabel,
|
|
16215
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
|
17426
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ChevronDown, { focusable: "false" })
|
|
16216
17427
|
}
|
|
16217
17428
|
) }),
|
|
16218
|
-
/* @__PURE__ */ (0,
|
|
17429
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16219
17430
|
MenuBar,
|
|
16220
17431
|
{
|
|
16221
17432
|
dispatch,
|
|
16222
17433
|
onPublish,
|
|
16223
17434
|
menuOpen,
|
|
16224
|
-
renderHeaderActions: () => /* @__PURE__ */ (0,
|
|
17435
|
+
renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16225
17436
|
Button,
|
|
16226
17437
|
{
|
|
16227
17438
|
onClick: () => {
|
|
16228
17439
|
const data = appStore.getState().state.data;
|
|
16229
17440
|
onPublish && onPublish(data);
|
|
16230
17441
|
},
|
|
16231
|
-
icon: /* @__PURE__ */ (0,
|
|
17442
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Globe, { size: "14px" }),
|
|
16232
17443
|
children: publishLabel
|
|
16233
17444
|
}
|
|
16234
17445
|
) }),
|
|
@@ -16242,14 +17453,14 @@ var HeaderInner = ({
|
|
|
16242
17453
|
}
|
|
16243
17454
|
);
|
|
16244
17455
|
};
|
|
16245
|
-
var Header = (0,
|
|
17456
|
+
var Header = (0, import_react94.memo)(HeaderInner);
|
|
16246
17457
|
|
|
16247
17458
|
// components/SidebarSection/index.tsx
|
|
16248
17459
|
init_react_import();
|
|
16249
17460
|
|
|
16250
17461
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
16251
17462
|
init_react_import();
|
|
16252
|
-
var
|
|
17463
|
+
var styles_module_default34 = { "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" };
|
|
16253
17464
|
|
|
16254
17465
|
// components/SidebarSection/index.tsx
|
|
16255
17466
|
init_get_class_name_factory();
|
|
@@ -16260,7 +17471,7 @@ init_react_import();
|
|
|
16260
17471
|
|
|
16261
17472
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
16262
17473
|
init_react_import();
|
|
16263
|
-
var
|
|
17474
|
+
var styles_module_default35 = { "Breadcrumbs": "_Breadcrumbs_8c6w5_1", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_8c6w5_7", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_8c6w5_7" };
|
|
16264
17475
|
|
|
16265
17476
|
// components/Breadcrumbs/index.tsx
|
|
16266
17477
|
init_get_class_name_factory();
|
|
@@ -16268,7 +17479,7 @@ init_lucide_react();
|
|
|
16268
17479
|
|
|
16269
17480
|
// lib/use-breadcrumbs.ts
|
|
16270
17481
|
init_react_import();
|
|
16271
|
-
var
|
|
17482
|
+
var import_react95 = require("react");
|
|
16272
17483
|
init_store();
|
|
16273
17484
|
init_use_message();
|
|
16274
17485
|
var useBreadcrumbs = (renderCount) => {
|
|
@@ -16284,7 +17495,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
16284
17495
|
const appStore = useAppStoreApi();
|
|
16285
17496
|
const pageLabel = useMessage("label-page");
|
|
16286
17497
|
const componentLabel = useMessage("label-component");
|
|
16287
|
-
return (0,
|
|
17498
|
+
return (0, import_react95.useMemo)(() => {
|
|
16288
17499
|
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
16289
17500
|
var _a, _b, _c, _d;
|
|
16290
17501
|
const [componentId] = zoneCompound.split(":");
|
|
@@ -16316,34 +17527,34 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
16316
17527
|
|
|
16317
17528
|
// components/Breadcrumbs/index.tsx
|
|
16318
17529
|
init_store();
|
|
16319
|
-
var
|
|
16320
|
-
var
|
|
17530
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
17531
|
+
var getClassName42 = get_class_name_factory_default("Breadcrumbs", styles_module_default35);
|
|
16321
17532
|
var Breadcrumbs = ({
|
|
16322
17533
|
children,
|
|
16323
17534
|
numParents = 1
|
|
16324
17535
|
}) => {
|
|
16325
17536
|
const setUi = useAppStore((s) => s.setUi);
|
|
16326
17537
|
const breadcrumbs = useBreadcrumbs(numParents);
|
|
16327
|
-
return /* @__PURE__ */ (0,
|
|
16328
|
-
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0,
|
|
16329
|
-
/* @__PURE__ */ (0,
|
|
17538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName42(), children: [
|
|
17539
|
+
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName42("breadcrumb"), children: [
|
|
17540
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
16330
17541
|
"button",
|
|
16331
17542
|
{
|
|
16332
17543
|
type: "button",
|
|
16333
|
-
className:
|
|
17544
|
+
className: getClassName42("breadcrumbLabel"),
|
|
16334
17545
|
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
|
16335
17546
|
children: breadcrumb.label
|
|
16336
17547
|
}
|
|
16337
17548
|
),
|
|
16338
|
-
/* @__PURE__ */ (0,
|
|
17549
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ChevronRight, { size: 16 })
|
|
16339
17550
|
] }, i)),
|
|
16340
17551
|
children
|
|
16341
17552
|
] });
|
|
16342
17553
|
};
|
|
16343
17554
|
|
|
16344
17555
|
// components/SidebarSection/index.tsx
|
|
16345
|
-
var
|
|
16346
|
-
var
|
|
17556
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
17557
|
+
var getClassName43 = get_class_name_factory_default("SidebarSection", styles_module_default34);
|
|
16347
17558
|
var SidebarSection = ({
|
|
16348
17559
|
children,
|
|
16349
17560
|
title,
|
|
@@ -16352,20 +17563,20 @@ var SidebarSection = ({
|
|
|
16352
17563
|
noBorderTop,
|
|
16353
17564
|
isLoading
|
|
16354
17565
|
}) => {
|
|
16355
|
-
return /* @__PURE__ */ (0,
|
|
16356
|
-
/* @__PURE__ */ (0,
|
|
16357
|
-
showBreadcrumbs && /* @__PURE__ */ (0,
|
|
16358
|
-
/* @__PURE__ */ (0,
|
|
17566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: getClassName43({ noBorderTop }), style: { background }, children: [
|
|
17567
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getClassName43("title"), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: getClassName43("breadcrumbs"), children: [
|
|
17568
|
+
showBreadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Breadcrumbs, {}),
|
|
17569
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getClassName43("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Heading7, { rank: "2", size: "xs", children: title }) })
|
|
16359
17570
|
] }) }),
|
|
16360
|
-
/* @__PURE__ */ (0,
|
|
16361
|
-
isLoading && /* @__PURE__ */ (0,
|
|
17571
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getClassName43("content"), children }),
|
|
17572
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getClassName43("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Loader, { size: 32 }) })
|
|
16362
17573
|
] });
|
|
16363
17574
|
};
|
|
16364
17575
|
|
|
16365
17576
|
// components/Puck/components/Canvas/index.tsx
|
|
16366
17577
|
init_react_import();
|
|
16367
17578
|
init_css_box_model_esm();
|
|
16368
|
-
var
|
|
17579
|
+
var import_react98 = require("react");
|
|
16369
17580
|
init_store();
|
|
16370
17581
|
|
|
16371
17582
|
// components/ViewportControls/index.tsx
|
|
@@ -16374,23 +17585,23 @@ init_lucide_react();
|
|
|
16374
17585
|
init_IconButton2();
|
|
16375
17586
|
init_store();
|
|
16376
17587
|
init_use_message();
|
|
16377
|
-
var
|
|
17588
|
+
var import_react96 = require("react");
|
|
16378
17589
|
init_lib();
|
|
16379
17590
|
|
|
16380
17591
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
|
16381
17592
|
init_react_import();
|
|
16382
|
-
var
|
|
17593
|
+
var styles_module_default36 = { "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" };
|
|
16383
17594
|
|
|
16384
17595
|
// components/ViewportControls/index.tsx
|
|
16385
|
-
var
|
|
17596
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
16386
17597
|
var icons = {
|
|
16387
|
-
Smartphone: /* @__PURE__ */ (0,
|
|
16388
|
-
Tablet: /* @__PURE__ */ (0,
|
|
16389
|
-
Monitor: /* @__PURE__ */ (0,
|
|
16390
|
-
FullWidth: /* @__PURE__ */ (0,
|
|
17598
|
+
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Smartphone, { size: 16 }),
|
|
17599
|
+
Tablet: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Tablet, { size: 16 }),
|
|
17600
|
+
Monitor: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Monitor, { size: 16 }),
|
|
17601
|
+
FullWidth: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Expand, { size: 16 })
|
|
16391
17602
|
};
|
|
16392
|
-
var
|
|
16393
|
-
var getClassNameButton = get_class_name_factory_default("ViewportButton",
|
|
17603
|
+
var getClassName44 = get_class_name_factory_default("ViewportControls", styles_module_default36);
|
|
17604
|
+
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default36);
|
|
16394
17605
|
var ActionButton = ({
|
|
16395
17606
|
children,
|
|
16396
17607
|
title,
|
|
@@ -16398,7 +17609,7 @@ var ActionButton = ({
|
|
|
16398
17609
|
isActive,
|
|
16399
17610
|
disabled
|
|
16400
17611
|
}) => {
|
|
16401
|
-
return /* @__PURE__ */ (0,
|
|
17612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: getClassNameButton({ isActive }), suppressHydrationWarning: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16402
17613
|
IconButton,
|
|
16403
17614
|
{
|
|
16404
17615
|
type: "button",
|
|
@@ -16406,7 +17617,7 @@ var ActionButton = ({
|
|
|
16406
17617
|
disabled: disabled || isActive,
|
|
16407
17618
|
onClick,
|
|
16408
17619
|
suppressHydrationWarning: true,
|
|
16409
|
-
children: /* @__PURE__ */ (0,
|
|
17620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: getClassNameButton("inner"), children })
|
|
16410
17621
|
}
|
|
16411
17622
|
) });
|
|
16412
17623
|
};
|
|
@@ -16429,7 +17640,7 @@ var ViewportButton = ({
|
|
|
16429
17640
|
label: (_a = viewport.label) != null ? _a : ""
|
|
16430
17641
|
});
|
|
16431
17642
|
const switchDefaultTitle = useMessage("viewport-switch-default");
|
|
16432
|
-
return /* @__PURE__ */ (0,
|
|
17643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16433
17644
|
ActionButton,
|
|
16434
17645
|
{
|
|
16435
17646
|
title: viewport.label ? switchTitle : switchDefaultTitle,
|
|
@@ -16455,7 +17666,7 @@ var ViewportControls = ({
|
|
|
16455
17666
|
const autoZoomLabel = useMessage("viewport-zoom-auto", {
|
|
16456
17667
|
zoom: (autoZoom * 100).toFixed(0)
|
|
16457
17668
|
});
|
|
16458
|
-
const zoomOptions = (0,
|
|
17669
|
+
const zoomOptions = (0, import_react96.useMemo)(
|
|
16459
17670
|
() => [
|
|
16460
17671
|
...defaultZoomOptions,
|
|
16461
17672
|
...defaultsContainAutoZoom ? [] : [
|
|
@@ -16467,24 +17678,24 @@ var ViewportControls = ({
|
|
|
16467
17678
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
|
16468
17679
|
[autoZoom, autoZoomLabel]
|
|
16469
17680
|
);
|
|
16470
|
-
const [activeViewport, setActiveViewport] = (0,
|
|
17681
|
+
const [activeViewport, setActiveViewport] = (0, import_react96.useState)(
|
|
16471
17682
|
uiViewports.current.width
|
|
16472
17683
|
);
|
|
16473
|
-
(0,
|
|
17684
|
+
(0, import_react96.useEffect)(() => {
|
|
16474
17685
|
setActiveViewport(uiViewports.current.width);
|
|
16475
17686
|
}, [uiViewports.current]);
|
|
16476
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
17687
|
+
const [isExpanded, setIsExpanded] = (0, import_react96.useState)(false);
|
|
16477
17688
|
const zoomOutLabel = useMessage("viewport-zoom-out");
|
|
16478
17689
|
const zoomInLabel = useMessage("viewport-zoom-in");
|
|
16479
17690
|
const toggleMenuLabel = useMessage("viewport-toggle-menu");
|
|
16480
|
-
return /* @__PURE__ */ (0,
|
|
17691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
16481
17692
|
"div",
|
|
16482
17693
|
{
|
|
16483
|
-
className:
|
|
17694
|
+
className: getClassName44({ isExpanded, fullScreen }),
|
|
16484
17695
|
suppressHydrationWarning: true,
|
|
16485
17696
|
children: [
|
|
16486
|
-
/* @__PURE__ */ (0,
|
|
16487
|
-
viewports.map((viewport, i) => /* @__PURE__ */ (0,
|
|
17697
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: getClassName44("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: getClassName44("actionsInner"), children: [
|
|
17698
|
+
viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16488
17699
|
ViewportButton,
|
|
16489
17700
|
{
|
|
16490
17701
|
viewport,
|
|
@@ -16496,8 +17707,8 @@ var ViewportControls = ({
|
|
|
16496
17707
|
},
|
|
16497
17708
|
i
|
|
16498
17709
|
)),
|
|
16499
|
-
/* @__PURE__ */ (0,
|
|
16500
|
-
/* @__PURE__ */ (0,
|
|
17710
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: getClassName44("divider") }),
|
|
17711
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16501
17712
|
ActionButton,
|
|
16502
17713
|
{
|
|
16503
17714
|
title: zoomOutLabel,
|
|
@@ -16511,10 +17722,10 @@ var ViewportControls = ({
|
|
|
16511
17722
|
)].value
|
|
16512
17723
|
);
|
|
16513
17724
|
},
|
|
16514
|
-
children: /* @__PURE__ */ (0,
|
|
17725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ZoomOut, { size: 16 })
|
|
16515
17726
|
}
|
|
16516
17727
|
),
|
|
16517
|
-
/* @__PURE__ */ (0,
|
|
17728
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16518
17729
|
ActionButton,
|
|
16519
17730
|
{
|
|
16520
17731
|
title: zoomInLabel,
|
|
@@ -16528,15 +17739,15 @@ var ViewportControls = ({
|
|
|
16528
17739
|
)].value
|
|
16529
17740
|
);
|
|
16530
17741
|
},
|
|
16531
|
-
children: /* @__PURE__ */ (0,
|
|
17742
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ZoomIn, { size: 16 })
|
|
16532
17743
|
}
|
|
16533
17744
|
),
|
|
16534
|
-
/* @__PURE__ */ (0,
|
|
16535
|
-
/* @__PURE__ */ (0,
|
|
16536
|
-
/* @__PURE__ */ (0,
|
|
17745
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: getClassName44("zoom"), children: [
|
|
17746
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: getClassName44("divider") }),
|
|
17747
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16537
17748
|
"select",
|
|
16538
17749
|
{
|
|
16539
|
-
className:
|
|
17750
|
+
className: getClassName44("zoomSelect"),
|
|
16540
17751
|
value: zoom.toString(),
|
|
16541
17752
|
onClick: (e) => {
|
|
16542
17753
|
e.stopPropagation();
|
|
@@ -16544,7 +17755,7 @@ var ViewportControls = ({
|
|
|
16544
17755
|
onChange: (e) => {
|
|
16545
17756
|
onZoom(parseFloat(e.currentTarget.value));
|
|
16546
17757
|
},
|
|
16547
|
-
children: zoomOptions.map((option) => /* @__PURE__ */ (0,
|
|
17758
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16548
17759
|
"option",
|
|
16549
17760
|
{
|
|
16550
17761
|
value: option.value,
|
|
@@ -16556,13 +17767,13 @@ var ViewportControls = ({
|
|
|
16556
17767
|
)
|
|
16557
17768
|
] })
|
|
16558
17769
|
] }) }),
|
|
16559
|
-
/* @__PURE__ */ (0,
|
|
17770
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16560
17771
|
"button",
|
|
16561
17772
|
{
|
|
16562
|
-
className:
|
|
17773
|
+
className: getClassName44("toggleButton"),
|
|
16563
17774
|
title: toggleMenuLabel,
|
|
16564
17775
|
onClick: () => setIsExpanded((s) => !s),
|
|
16565
|
-
children: isExpanded ? /* @__PURE__ */ (0,
|
|
17776
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(X, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Monitor, { size: 16 })
|
|
16566
17777
|
}
|
|
16567
17778
|
)
|
|
16568
17779
|
]
|
|
@@ -16572,32 +17783,32 @@ var ViewportControls = ({
|
|
|
16572
17783
|
|
|
16573
17784
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
|
16574
17785
|
init_react_import();
|
|
16575
|
-
var
|
|
17786
|
+
var styles_module_default37 = { "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" };
|
|
16576
17787
|
|
|
16577
17788
|
// components/Puck/components/Canvas/index.tsx
|
|
16578
17789
|
init_lib();
|
|
16579
17790
|
init_Loader();
|
|
16580
|
-
var
|
|
17791
|
+
var import_shallow10 = require("zustand/react/shallow");
|
|
16581
17792
|
|
|
16582
17793
|
// lib/frame-context.tsx
|
|
16583
17794
|
init_react_import();
|
|
16584
|
-
var
|
|
16585
|
-
var
|
|
16586
|
-
var FrameContext = (0,
|
|
17795
|
+
var import_react97 = require("react");
|
|
17796
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
17797
|
+
var FrameContext = (0, import_react97.createContext)(null);
|
|
16587
17798
|
var FrameProvider = ({
|
|
16588
17799
|
children
|
|
16589
17800
|
}) => {
|
|
16590
|
-
const frameRef = (0,
|
|
16591
|
-
const value = (0,
|
|
17801
|
+
const frameRef = (0, import_react97.useRef)(null);
|
|
17802
|
+
const value = (0, import_react97.useMemo)(
|
|
16592
17803
|
() => ({
|
|
16593
17804
|
frameRef
|
|
16594
17805
|
}),
|
|
16595
17806
|
[]
|
|
16596
17807
|
);
|
|
16597
|
-
return /* @__PURE__ */ (0,
|
|
17808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(FrameContext.Provider, { value, children });
|
|
16598
17809
|
};
|
|
16599
17810
|
var useCanvasFrame = () => {
|
|
16600
|
-
const context = (0,
|
|
17811
|
+
const context = (0, import_react97.useContext)(FrameContext);
|
|
16601
17812
|
if (context === null) {
|
|
16602
17813
|
throw new Error("useCanvasFrame must be used within a FrameProvider");
|
|
16603
17814
|
}
|
|
@@ -16606,8 +17817,8 @@ var useCanvasFrame = () => {
|
|
|
16606
17817
|
|
|
16607
17818
|
// components/Puck/components/Canvas/index.tsx
|
|
16608
17819
|
init_default_viewports();
|
|
16609
|
-
var
|
|
16610
|
-
var
|
|
17820
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
17821
|
+
var getClassName45 = get_class_name_factory_default("PuckCanvas", styles_module_default37);
|
|
16611
17822
|
var ZOOM_ON_CHANGE = true;
|
|
16612
17823
|
var TRANSITION_DURATION = 150;
|
|
16613
17824
|
var Canvas = () => {
|
|
@@ -16625,7 +17836,7 @@ var Canvas = () => {
|
|
|
16625
17836
|
iframe,
|
|
16626
17837
|
_experimentalFullScreenCanvas
|
|
16627
17838
|
} = useAppStore(
|
|
16628
|
-
(0,
|
|
17839
|
+
(0, import_shallow10.useShallow)((s) => ({
|
|
16629
17840
|
dispatch: s.dispatch,
|
|
16630
17841
|
overrides: s.overrides,
|
|
16631
17842
|
setUi: s.setUi,
|
|
@@ -16643,7 +17854,7 @@ var Canvas = () => {
|
|
|
16643
17854
|
rightSideBarWidth,
|
|
16644
17855
|
viewports
|
|
16645
17856
|
} = useAppStore(
|
|
16646
|
-
(0,
|
|
17857
|
+
(0, import_shallow10.useShallow)((s) => ({
|
|
16647
17858
|
leftSideBarVisible: s.state.ui.leftSideBarVisible,
|
|
16648
17859
|
rightSideBarVisible: s.state.ui.rightSideBarVisible,
|
|
16649
17860
|
leftSideBarWidth: s.state.ui.leftSideBarWidth,
|
|
@@ -16651,17 +17862,17 @@ var Canvas = () => {
|
|
|
16651
17862
|
viewports: s.state.ui.viewports
|
|
16652
17863
|
}))
|
|
16653
17864
|
);
|
|
16654
|
-
const [showTransition, setShowTransition] = (0,
|
|
16655
|
-
const isResizingRef = (0,
|
|
16656
|
-
const defaultRender = (0,
|
|
16657
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */ (0,
|
|
17865
|
+
const [showTransition, setShowTransition] = (0, import_react98.useState)(false);
|
|
17866
|
+
const isResizingRef = (0, import_react98.useRef)(false);
|
|
17867
|
+
const defaultRender = (0, import_react98.useMemo)(() => {
|
|
17868
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_jsx_runtime96.Fragment, { children });
|
|
16658
17869
|
return PuckDefault;
|
|
16659
17870
|
}, []);
|
|
16660
|
-
const CustomPreview = (0,
|
|
17871
|
+
const CustomPreview = (0, import_react98.useMemo)(
|
|
16661
17872
|
() => overrides.preview || defaultRender,
|
|
16662
17873
|
[overrides]
|
|
16663
17874
|
);
|
|
16664
|
-
const getFrameDimensions = (0,
|
|
17875
|
+
const getFrameDimensions = (0, import_react98.useCallback)(() => {
|
|
16665
17876
|
if (frameRef.current) {
|
|
16666
17877
|
const frame = frameRef.current;
|
|
16667
17878
|
const box = getBox(frame);
|
|
@@ -16669,7 +17880,7 @@ var Canvas = () => {
|
|
|
16669
17880
|
}
|
|
16670
17881
|
return { width: 0, height: 0 };
|
|
16671
17882
|
}, [frameRef]);
|
|
16672
|
-
(0,
|
|
17883
|
+
(0, import_react98.useEffect)(() => {
|
|
16673
17884
|
resetAutoZoom();
|
|
16674
17885
|
}, [
|
|
16675
17886
|
frameRef,
|
|
@@ -16679,7 +17890,7 @@ var Canvas = () => {
|
|
|
16679
17890
|
rightSideBarWidth,
|
|
16680
17891
|
viewports
|
|
16681
17892
|
]);
|
|
16682
|
-
(0,
|
|
17893
|
+
(0, import_react98.useEffect)(() => {
|
|
16683
17894
|
const { height: frameHeight } = getFrameDimensions();
|
|
16684
17895
|
if (viewports.current.height === "auto") {
|
|
16685
17896
|
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), {
|
|
@@ -16687,12 +17898,12 @@ var Canvas = () => {
|
|
|
16687
17898
|
}));
|
|
16688
17899
|
}
|
|
16689
17900
|
}, [zoomConfig.zoom, getFrameDimensions, setZoomConfig]);
|
|
16690
|
-
(0,
|
|
17901
|
+
(0, import_react98.useEffect)(() => {
|
|
16691
17902
|
if (ZOOM_ON_CHANGE) {
|
|
16692
17903
|
resetAutoZoom();
|
|
16693
17904
|
}
|
|
16694
17905
|
}, [viewports.current.width, viewports]);
|
|
16695
|
-
(0,
|
|
17906
|
+
(0, import_react98.useEffect)(() => {
|
|
16696
17907
|
if (!frameRef.current) return;
|
|
16697
17908
|
const resizeObserver = new ResizeObserver(() => {
|
|
16698
17909
|
if (!isResizingRef.current) {
|
|
@@ -16704,14 +17915,14 @@ var Canvas = () => {
|
|
|
16704
17915
|
resizeObserver.disconnect();
|
|
16705
17916
|
};
|
|
16706
17917
|
}, [frameRef.current]);
|
|
16707
|
-
const [showLoader, setShowLoader] = (0,
|
|
16708
|
-
(0,
|
|
17918
|
+
const [showLoader, setShowLoader] = (0, import_react98.useState)(false);
|
|
17919
|
+
(0, import_react98.useEffect)(() => {
|
|
16709
17920
|
setTimeout(() => {
|
|
16710
17921
|
setShowLoader(true);
|
|
16711
17922
|
}, 500);
|
|
16712
17923
|
}, []);
|
|
16713
17924
|
const appStoreApi = useAppStoreApi();
|
|
16714
|
-
(0,
|
|
17925
|
+
(0, import_react98.useEffect)(() => {
|
|
16715
17926
|
var _a2, _b;
|
|
16716
17927
|
if (typeof window === "undefined") return;
|
|
16717
17928
|
if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
|
|
@@ -16762,10 +17973,10 @@ var Canvas = () => {
|
|
|
16762
17973
|
appStoreApi,
|
|
16763
17974
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
16764
17975
|
]);
|
|
16765
|
-
return /* @__PURE__ */ (0,
|
|
17976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
16766
17977
|
"div",
|
|
16767
17978
|
{
|
|
16768
|
-
className:
|
|
17979
|
+
className: getClassName45({
|
|
16769
17980
|
ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
|
|
16770
17981
|
showLoader,
|
|
16771
17982
|
fullScreen: _experimentalFullScreenCanvas
|
|
@@ -16781,7 +17992,7 @@ var Canvas = () => {
|
|
|
16781
17992
|
}
|
|
16782
17993
|
},
|
|
16783
17994
|
children: [
|
|
16784
|
-
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0,
|
|
17995
|
+
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: getClassName45("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
16785
17996
|
ViewportControls,
|
|
16786
17997
|
{
|
|
16787
17998
|
fullScreen: _experimentalFullScreenCanvas,
|
|
@@ -16811,11 +18022,11 @@ var Canvas = () => {
|
|
|
16811
18022
|
}
|
|
16812
18023
|
}
|
|
16813
18024
|
) }),
|
|
16814
|
-
/* @__PURE__ */ (0,
|
|
16815
|
-
/* @__PURE__ */ (0,
|
|
18025
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: getClassName45("inner"), ref: frameRef, children: [
|
|
18026
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
16816
18027
|
"div",
|
|
16817
18028
|
{
|
|
16818
|
-
className:
|
|
18029
|
+
className: getClassName45("root"),
|
|
16819
18030
|
style: {
|
|
16820
18031
|
width: iframe.enabled ? viewports.current.width : "100%",
|
|
16821
18032
|
height: zoomConfig.rootHeight,
|
|
@@ -16829,10 +18040,10 @@ var Canvas = () => {
|
|
|
16829
18040
|
setShowTransition(false);
|
|
16830
18041
|
isResizingRef.current = false;
|
|
16831
18042
|
},
|
|
16832
|
-
children: /* @__PURE__ */ (0,
|
|
18043
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Preview2, {}) })
|
|
16833
18044
|
}
|
|
16834
18045
|
),
|
|
16835
|
-
/* @__PURE__ */ (0,
|
|
18046
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: getClassName45("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Loader, { size: 24 }) })
|
|
16836
18047
|
] })
|
|
16837
18048
|
]
|
|
16838
18049
|
}
|
|
@@ -16841,15 +18052,15 @@ var Canvas = () => {
|
|
|
16841
18052
|
|
|
16842
18053
|
// lib/use-sidebar-resize.ts
|
|
16843
18054
|
init_react_import();
|
|
16844
|
-
var
|
|
18055
|
+
var import_react99 = require("react");
|
|
16845
18056
|
init_store();
|
|
16846
18057
|
function useSidebarResize(position, dispatch) {
|
|
16847
|
-
const [width, setWidth] = (0,
|
|
16848
|
-
const sidebarRef = (0,
|
|
18058
|
+
const [width, setWidth] = (0, import_react99.useState)(null);
|
|
18059
|
+
const sidebarRef = (0, import_react99.useRef)(null);
|
|
16849
18060
|
const storeWidth = useAppStore(
|
|
16850
18061
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
16851
18062
|
);
|
|
16852
|
-
(0,
|
|
18063
|
+
(0, import_react99.useEffect)(() => {
|
|
16853
18064
|
if (typeof window !== "undefined" && !storeWidth) {
|
|
16854
18065
|
try {
|
|
16855
18066
|
const savedWidths = localStorage.getItem("puck-sidebar-widths");
|
|
@@ -16874,12 +18085,12 @@ function useSidebarResize(position, dispatch) {
|
|
|
16874
18085
|
}
|
|
16875
18086
|
}
|
|
16876
18087
|
}, [dispatch, position, storeWidth]);
|
|
16877
|
-
(0,
|
|
18088
|
+
(0, import_react99.useEffect)(() => {
|
|
16878
18089
|
if (storeWidth !== void 0) {
|
|
16879
18090
|
setWidth(storeWidth);
|
|
16880
18091
|
}
|
|
16881
18092
|
}, [storeWidth]);
|
|
16882
|
-
const handleResizeEnd = (0,
|
|
18093
|
+
const handleResizeEnd = (0, import_react99.useCallback)(
|
|
16883
18094
|
(width2) => {
|
|
16884
18095
|
dispatch({
|
|
16885
18096
|
type: "setUi",
|
|
@@ -16926,17 +18137,17 @@ init_react_import();
|
|
|
16926
18137
|
|
|
16927
18138
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
16928
18139
|
init_react_import();
|
|
16929
|
-
var
|
|
18140
|
+
var import_react100 = require("react");
|
|
16930
18141
|
init_get_class_name_factory();
|
|
16931
18142
|
|
|
16932
18143
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
|
|
16933
18144
|
init_react_import();
|
|
16934
|
-
var
|
|
18145
|
+
var styles_module_default38 = { "ResizeHandle": "_ResizeHandle_144bf_2", "ResizeHandle--left": "_ResizeHandle--left_144bf_16", "ResizeHandle--right": "_ResizeHandle--right_144bf_20" };
|
|
16935
18146
|
|
|
16936
18147
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
16937
18148
|
init_lib();
|
|
16938
|
-
var
|
|
16939
|
-
var
|
|
18149
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
18150
|
+
var getClassName46 = get_class_name_factory_default("ResizeHandle", styles_module_default38);
|
|
16940
18151
|
var ResizeHandle = ({
|
|
16941
18152
|
position,
|
|
16942
18153
|
sidebarRef,
|
|
@@ -16945,11 +18156,11 @@ var ResizeHandle = ({
|
|
|
16945
18156
|
}) => {
|
|
16946
18157
|
const { frameRef } = useCanvasFrame();
|
|
16947
18158
|
const resetAutoZoom = useResetAutoZoom(frameRef);
|
|
16948
|
-
const handleRef = (0,
|
|
16949
|
-
const isDragging = (0,
|
|
16950
|
-
const startX = (0,
|
|
16951
|
-
const startWidth = (0,
|
|
16952
|
-
const handleMouseMove = (0,
|
|
18159
|
+
const handleRef = (0, import_react100.useRef)(null);
|
|
18160
|
+
const isDragging = (0, import_react100.useRef)(false);
|
|
18161
|
+
const startX = (0, import_react100.useRef)(0);
|
|
18162
|
+
const startWidth = (0, import_react100.useRef)(0);
|
|
18163
|
+
const handleMouseMove = (0, import_react100.useCallback)(
|
|
16953
18164
|
(e) => {
|
|
16954
18165
|
if (!isDragging.current) return;
|
|
16955
18166
|
const delta = e.clientX - startX.current;
|
|
@@ -16960,7 +18171,7 @@ var ResizeHandle = ({
|
|
|
16960
18171
|
},
|
|
16961
18172
|
[onResize, position]
|
|
16962
18173
|
);
|
|
16963
|
-
const handleMouseUp = (0,
|
|
18174
|
+
const handleMouseUp = (0, import_react100.useCallback)(() => {
|
|
16964
18175
|
var _a;
|
|
16965
18176
|
if (!isDragging.current) return;
|
|
16966
18177
|
isDragging.current = false;
|
|
@@ -16976,7 +18187,7 @@ var ResizeHandle = ({
|
|
|
16976
18187
|
onResizeEnd(finalWidth);
|
|
16977
18188
|
resetAutoZoom();
|
|
16978
18189
|
}, [onResizeEnd]);
|
|
16979
|
-
const handleMouseDown = (0,
|
|
18190
|
+
const handleMouseDown = (0, import_react100.useCallback)(
|
|
16980
18191
|
(e) => {
|
|
16981
18192
|
var _a;
|
|
16982
18193
|
isDragging.current = true;
|
|
@@ -16994,11 +18205,11 @@ var ResizeHandle = ({
|
|
|
16994
18205
|
},
|
|
16995
18206
|
[position, handleMouseMove, handleMouseUp]
|
|
16996
18207
|
);
|
|
16997
|
-
return /* @__PURE__ */ (0,
|
|
18208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
16998
18209
|
"div",
|
|
16999
18210
|
{
|
|
17000
18211
|
ref: handleRef,
|
|
17001
|
-
className:
|
|
18212
|
+
className: getClassName46({ [position]: true }),
|
|
17002
18213
|
onMouseDown: handleMouseDown
|
|
17003
18214
|
}
|
|
17004
18215
|
);
|
|
@@ -17009,11 +18220,11 @@ init_get_class_name_factory();
|
|
|
17009
18220
|
|
|
17010
18221
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Sidebar/styles.module.css#css-module
|
|
17011
18222
|
init_react_import();
|
|
17012
|
-
var
|
|
18223
|
+
var styles_module_default39 = { "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" };
|
|
17013
18224
|
|
|
17014
18225
|
// components/Puck/components/Sidebar/index.tsx
|
|
17015
|
-
var
|
|
17016
|
-
var
|
|
18226
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
18227
|
+
var getClassName47 = get_class_name_factory_default("Sidebar", styles_module_default39);
|
|
17017
18228
|
var Sidebar = ({
|
|
17018
18229
|
position,
|
|
17019
18230
|
sidebarRef,
|
|
@@ -17022,16 +18233,16 @@ var Sidebar = ({
|
|
|
17022
18233
|
onResizeEnd,
|
|
17023
18234
|
children
|
|
17024
18235
|
}) => {
|
|
17025
|
-
return /* @__PURE__ */ (0,
|
|
17026
|
-
/* @__PURE__ */ (0,
|
|
18236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
18237
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
17027
18238
|
"div",
|
|
17028
18239
|
{
|
|
17029
18240
|
ref: sidebarRef,
|
|
17030
|
-
className:
|
|
18241
|
+
className: getClassName47({ [position]: true, isVisible }),
|
|
17031
18242
|
children
|
|
17032
18243
|
}
|
|
17033
18244
|
),
|
|
17034
|
-
/* @__PURE__ */ (0,
|
|
18245
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `${getClassName47("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
17035
18246
|
ResizeHandle,
|
|
17036
18247
|
{
|
|
17037
18248
|
position,
|
|
@@ -17045,7 +18256,7 @@ var Sidebar = ({
|
|
|
17045
18256
|
|
|
17046
18257
|
// lib/use-delete-hotkeys.ts
|
|
17047
18258
|
init_react_import();
|
|
17048
|
-
var
|
|
18259
|
+
var import_react101 = require("react");
|
|
17049
18260
|
init_use_hotkey();
|
|
17050
18261
|
init_store();
|
|
17051
18262
|
var isElementVisible = (element) => {
|
|
@@ -17082,7 +18293,7 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
17082
18293
|
};
|
|
17083
18294
|
var useDeleteHotkeys = () => {
|
|
17084
18295
|
const appStore = useAppStoreApi();
|
|
17085
|
-
const deleteSelectedComponent = (0,
|
|
18296
|
+
const deleteSelectedComponent = (0, import_react101.useCallback)(
|
|
17086
18297
|
(e) => {
|
|
17087
18298
|
var _a;
|
|
17088
18299
|
if (shouldBlockDeleteHotkey(e)) {
|
|
@@ -17111,13 +18322,13 @@ init_react_import();
|
|
|
17111
18322
|
|
|
17112
18323
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Nav/styles.module.css#css-module
|
|
17113
18324
|
init_react_import();
|
|
17114
|
-
var
|
|
18325
|
+
var styles_module_default40 = { "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" };
|
|
17115
18326
|
|
|
17116
18327
|
// components/Puck/components/Nav/index.tsx
|
|
17117
18328
|
init_lib();
|
|
17118
|
-
var
|
|
17119
|
-
var
|
|
17120
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem",
|
|
18329
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
18330
|
+
var getClassName48 = get_class_name_factory_default("Nav", styles_module_default40);
|
|
18331
|
+
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default40);
|
|
17121
18332
|
var MenuItem = ({
|
|
17122
18333
|
label,
|
|
17123
18334
|
icon,
|
|
@@ -17126,7 +18337,7 @@ var MenuItem = ({
|
|
|
17126
18337
|
mobileOnly,
|
|
17127
18338
|
desktopOnly
|
|
17128
18339
|
}) => {
|
|
17129
|
-
return /* @__PURE__ */ (0,
|
|
18340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
17130
18341
|
"li",
|
|
17131
18342
|
{
|
|
17132
18343
|
className: getClassNameItem3({
|
|
@@ -17134,9 +18345,9 @@ var MenuItem = ({
|
|
|
17134
18345
|
mobileOnly,
|
|
17135
18346
|
desktopOnly
|
|
17136
18347
|
}),
|
|
17137
|
-
children: onClick && /* @__PURE__ */ (0,
|
|
17138
|
-
icon && /* @__PURE__ */ (0,
|
|
17139
|
-
/* @__PURE__ */ (0,
|
|
18348
|
+
children: onClick && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
18349
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
18350
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
17140
18351
|
] })
|
|
17141
18352
|
}
|
|
17142
18353
|
);
|
|
@@ -17145,9 +18356,9 @@ var Nav = ({
|
|
|
17145
18356
|
items,
|
|
17146
18357
|
mobileActions
|
|
17147
18358
|
}) => {
|
|
17148
|
-
return /* @__PURE__ */ (0,
|
|
17149
|
-
/* @__PURE__ */ (0,
|
|
17150
|
-
mobileActions && /* @__PURE__ */ (0,
|
|
18359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("nav", { className: getClassName48(), children: [
|
|
18360
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("ul", { className: getClassName48("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(MenuItem, __spreadValues({}, item), key)) }),
|
|
18361
|
+
mobileActions && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: getClassName48("mobileActions"), children: mobileActions })
|
|
17151
18362
|
] });
|
|
17152
18363
|
};
|
|
17153
18364
|
|
|
@@ -17161,19 +18372,19 @@ init_lucide_react();
|
|
|
17161
18372
|
|
|
17162
18373
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/blocks/styles.module.css#css-module
|
|
17163
18374
|
init_react_import();
|
|
17164
|
-
var
|
|
18375
|
+
var styles_module_default41 = { "BlocksPlugin": "_BlocksPlugin_9af19_1" };
|
|
17165
18376
|
|
|
17166
18377
|
// plugins/blocks/index.tsx
|
|
17167
18378
|
init_lib();
|
|
17168
|
-
var
|
|
17169
|
-
var
|
|
18379
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
18380
|
+
var getClassName49 = get_class_name_factory_default("BlocksPlugin", styles_module_default41);
|
|
17170
18381
|
var blocksPlugin = (props = {}) => {
|
|
17171
18382
|
var _a, _b;
|
|
17172
18383
|
return {
|
|
17173
18384
|
name: "blocks",
|
|
17174
18385
|
label: (_a = props.label) != null ? _a : "Blocks",
|
|
17175
|
-
render: () => /* @__PURE__ */ (0,
|
|
17176
|
-
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0,
|
|
18386
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: getClassName49(), children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Components, {}) }),
|
|
18387
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Hammer, {})
|
|
17177
18388
|
};
|
|
17178
18389
|
};
|
|
17179
18390
|
|
|
@@ -17183,19 +18394,19 @@ init_lucide_react();
|
|
|
17183
18394
|
|
|
17184
18395
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css#css-module
|
|
17185
18396
|
init_react_import();
|
|
17186
|
-
var
|
|
18397
|
+
var styles_module_default42 = { "OutlinePlugin": "_OutlinePlugin_1ylsc_1" };
|
|
17187
18398
|
|
|
17188
18399
|
// plugins/outline/index.tsx
|
|
17189
18400
|
init_lib();
|
|
17190
|
-
var
|
|
17191
|
-
var
|
|
18401
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
18402
|
+
var getClassName50 = get_class_name_factory_default("OutlinePlugin", styles_module_default42);
|
|
17192
18403
|
var outlinePlugin = (props = {}) => {
|
|
17193
18404
|
var _a, _b;
|
|
17194
18405
|
return {
|
|
17195
18406
|
name: "outline",
|
|
17196
18407
|
label: (_a = props.label) != null ? _a : "Outline",
|
|
17197
|
-
render: () => /* @__PURE__ */ (0,
|
|
17198
|
-
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0,
|
|
18408
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: getClassName50(), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Outline, {}) }),
|
|
18409
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Layers, {})
|
|
17199
18410
|
};
|
|
17200
18411
|
};
|
|
17201
18412
|
|
|
@@ -17207,12 +18418,12 @@ init_use_message();
|
|
|
17207
18418
|
|
|
17208
18419
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css#css-module
|
|
17209
18420
|
init_react_import();
|
|
17210
|
-
var
|
|
18421
|
+
var styles_module_default43 = { "FieldsPlugin": "_FieldsPlugin_18cj3_1", "FieldsPlugin-header": "_FieldsPlugin-header_18cj3_7" };
|
|
17211
18422
|
|
|
17212
18423
|
// plugins/fields/index.tsx
|
|
17213
18424
|
init_lib();
|
|
17214
|
-
var
|
|
17215
|
-
var
|
|
18425
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
18426
|
+
var getClassName51 = get_class_name_factory_default("FieldsPlugin", styles_module_default43);
|
|
17216
18427
|
var CurrentTitle = () => {
|
|
17217
18428
|
const pageLabel = useMessage("label-page");
|
|
17218
18429
|
const label = useAppStore((s) => {
|
|
@@ -17225,11 +18436,11 @@ var CurrentTitle = () => {
|
|
|
17225
18436
|
var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
|
|
17226
18437
|
name: "fields",
|
|
17227
18438
|
label: label != null ? label : "Fields",
|
|
17228
|
-
render: () => /* @__PURE__ */ (0,
|
|
17229
|
-
/* @__PURE__ */ (0,
|
|
17230
|
-
/* @__PURE__ */ (0,
|
|
18439
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: getClassName51(), children: [
|
|
18440
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: getClassName51("header"), children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(CurrentTitle, {}) }) }),
|
|
18441
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Fields, {})
|
|
17231
18442
|
] }),
|
|
17232
|
-
icon: icon != null ? icon : /* @__PURE__ */ (0,
|
|
18443
|
+
icon: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(RectangleEllipsis, {}),
|
|
17233
18444
|
mobileOnly: desktopSideBar === "right"
|
|
17234
18445
|
});
|
|
17235
18446
|
|
|
@@ -17242,11 +18453,11 @@ var normalizeIframeConfig = (iframe) => __spreadValues({
|
|
|
17242
18453
|
}, iframe);
|
|
17243
18454
|
|
|
17244
18455
|
// components/Puck/components/Layout/index.tsx
|
|
17245
|
-
var
|
|
17246
|
-
var
|
|
17247
|
-
var getLayoutClassName = get_class_name_factory_default("PuckLayout",
|
|
17248
|
-
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab",
|
|
17249
|
-
var useBrowserLayoutEffect = typeof window === "undefined" ?
|
|
18456
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
18457
|
+
var getClassName52 = get_class_name_factory_default("Puck", styles_module_default31);
|
|
18458
|
+
var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default31);
|
|
18459
|
+
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default31);
|
|
18460
|
+
var useBrowserLayoutEffect = typeof window === "undefined" ? import_react102.useEffect : import_react102.useLayoutEffect;
|
|
17250
18461
|
var FieldSideBar = () => {
|
|
17251
18462
|
const pageLabel = useMessage("label-page");
|
|
17252
18463
|
const title = useAppStore(
|
|
@@ -17255,14 +18466,14 @@ var FieldSideBar = () => {
|
|
|
17255
18466
|
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;
|
|
17256
18467
|
}
|
|
17257
18468
|
);
|
|
17258
|
-
return /* @__PURE__ */ (0,
|
|
18469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Fields, {}) });
|
|
17259
18470
|
};
|
|
17260
18471
|
var PluginTab = ({
|
|
17261
18472
|
children,
|
|
17262
18473
|
visible,
|
|
17263
18474
|
mobileOnly
|
|
17264
18475
|
}) => {
|
|
17265
|
-
return /* @__PURE__ */ (0,
|
|
18476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
17266
18477
|
};
|
|
17267
18478
|
var Layout = ({ children }) => {
|
|
17268
18479
|
const {
|
|
@@ -17272,7 +18483,7 @@ var Layout = ({ children }) => {
|
|
|
17272
18483
|
plugins,
|
|
17273
18484
|
height
|
|
17274
18485
|
} = usePropsContext();
|
|
17275
|
-
const iframe = (0,
|
|
18486
|
+
const iframe = (0, import_react102.useMemo)(
|
|
17276
18487
|
() => normalizeIframeConfig(_iframe),
|
|
17277
18488
|
[_iframe]
|
|
17278
18489
|
);
|
|
@@ -17295,7 +18506,7 @@ var Layout = ({ children }) => {
|
|
|
17295
18506
|
sidebarRef: rightSidebarRef,
|
|
17296
18507
|
handleResizeEnd: handleRightSidebarResizeEnd
|
|
17297
18508
|
} = useSidebarResize("right", dispatch);
|
|
17298
|
-
(0,
|
|
18509
|
+
(0, import_react102.useEffect)(() => {
|
|
17299
18510
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
|
17300
18511
|
dispatch({
|
|
17301
18512
|
type: "setUi",
|
|
@@ -17319,17 +18530,17 @@ var Layout = ({ children }) => {
|
|
|
17319
18530
|
};
|
|
17320
18531
|
}, []);
|
|
17321
18532
|
const overrides = useAppStore((s) => s.overrides);
|
|
17322
|
-
const CustomPuck = (0,
|
|
18533
|
+
const CustomPuck = (0, import_react102.useMemo)(
|
|
17323
18534
|
() => overrides.puck || DefaultOverride,
|
|
17324
18535
|
[overrides]
|
|
17325
18536
|
);
|
|
17326
|
-
const [mounted, setMounted] = (0,
|
|
18537
|
+
const [mounted, setMounted] = (0, import_react102.useState)(false);
|
|
17327
18538
|
useBrowserLayoutEffect(() => {
|
|
17328
18539
|
setMounted(true);
|
|
17329
18540
|
}, []);
|
|
17330
18541
|
const ready = useAppStore((s) => s.status === "READY");
|
|
17331
18542
|
useMonitorHotkeys();
|
|
17332
|
-
(0,
|
|
18543
|
+
(0, import_react102.useEffect)(() => {
|
|
17333
18544
|
if (ready && iframe.enabled) {
|
|
17334
18545
|
const frameDoc = getFrame();
|
|
17335
18546
|
if (frameDoc) {
|
|
@@ -17352,15 +18563,15 @@ var Layout = ({ children }) => {
|
|
|
17352
18563
|
return (_a = s.state.ui.plugin) == null ? void 0 : _a.current;
|
|
17353
18564
|
});
|
|
17354
18565
|
const appStoreApi = useAppStoreApi();
|
|
17355
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0,
|
|
17356
|
-
const hasLegacySideBarPlugin = (0,
|
|
18566
|
+
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0, import_react102.useState)("toggle");
|
|
18567
|
+
const hasLegacySideBarPlugin = (0, import_react102.useMemo)(
|
|
17357
18568
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
17358
18569
|
[plugins]
|
|
17359
18570
|
);
|
|
17360
18571
|
const blocksLabel = useMessage("plugin-blocks");
|
|
17361
18572
|
const outlineLabel = useMessage("plugin-outline");
|
|
17362
18573
|
const fieldsLabel = useMessage("plugin-fields");
|
|
17363
|
-
const pluginItems = (0,
|
|
18574
|
+
const pluginItems = (0, import_react102.useMemo)(() => {
|
|
17364
18575
|
const details = {};
|
|
17365
18576
|
const defaultPlugins = [
|
|
17366
18577
|
blocksPlugin({ label: blocksLabel }),
|
|
@@ -17382,7 +18593,7 @@ var Layout = ({ children }) => {
|
|
|
17382
18593
|
}
|
|
17383
18594
|
details[plugin.name] = {
|
|
17384
18595
|
label: (_a = plugin.label) != null ? _a : plugin.name,
|
|
17385
|
-
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0,
|
|
18596
|
+
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ToyBrick, {}),
|
|
17386
18597
|
onClick: () => {
|
|
17387
18598
|
var _a2;
|
|
17388
18599
|
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
@@ -17418,7 +18629,7 @@ var Layout = ({ children }) => {
|
|
|
17418
18629
|
outlineLabel,
|
|
17419
18630
|
fieldsLabel
|
|
17420
18631
|
]);
|
|
17421
|
-
(0,
|
|
18632
|
+
(0, import_react102.useEffect)(() => {
|
|
17422
18633
|
if (!currentPlugin) {
|
|
17423
18634
|
const names = Object.keys(pluginItems);
|
|
17424
18635
|
setUi({ plugin: { current: names[0] } });
|
|
@@ -17433,16 +18644,16 @@ var Layout = ({ children }) => {
|
|
|
17433
18644
|
);
|
|
17434
18645
|
const maximizeLabel = useMessage("layout-maximize");
|
|
17435
18646
|
const minimizeLabel = useMessage("layout-minimize");
|
|
17436
|
-
return /* @__PURE__ */ (0,
|
|
18647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
17437
18648
|
"div",
|
|
17438
18649
|
{
|
|
17439
|
-
className: `Puck ${
|
|
18650
|
+
className: `Puck ${getClassName52({
|
|
17440
18651
|
hidePlugins: hasLegacySideBarPlugin
|
|
17441
18652
|
})}`,
|
|
17442
18653
|
id: instanceId,
|
|
17443
18654
|
style: { height, visibility: "hidden" },
|
|
17444
18655
|
children: [
|
|
17445
|
-
/* @__PURE__ */ (0,
|
|
18656
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17446
18657
|
"div",
|
|
17447
18658
|
{
|
|
17448
18659
|
className: getLayoutClassName({
|
|
@@ -17454,18 +18665,18 @@ var Layout = ({ children }) => {
|
|
|
17454
18665
|
mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
|
|
17455
18666
|
}),
|
|
17456
18667
|
style: { height },
|
|
17457
|
-
children: /* @__PURE__ */ (0,
|
|
18668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
17458
18669
|
"div",
|
|
17459
18670
|
{
|
|
17460
18671
|
className: getLayoutClassName("inner"),
|
|
17461
18672
|
style: layoutOptions,
|
|
17462
18673
|
children: [
|
|
17463
|
-
/* @__PURE__ */ (0,
|
|
17464
|
-
/* @__PURE__ */ (0,
|
|
18674
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Header, { hidePlugins: hasLegacySideBarPlugin }) }),
|
|
18675
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17465
18676
|
Nav,
|
|
17466
18677
|
{
|
|
17467
18678
|
items: pluginItems,
|
|
17468
|
-
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0,
|
|
18679
|
+
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17469
18680
|
IconButton,
|
|
17470
18681
|
{
|
|
17471
18682
|
type: "button",
|
|
@@ -17475,12 +18686,12 @@ var Layout = ({ children }) => {
|
|
|
17475
18686
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
17476
18687
|
});
|
|
17477
18688
|
},
|
|
17478
|
-
children: mobilePanelExpanded ? /* @__PURE__ */ (0,
|
|
18689
|
+
children: mobilePanelExpanded ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Minimize2, { size: 21 }) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Maximize2, { size: 21 })
|
|
17479
18690
|
}
|
|
17480
18691
|
)
|
|
17481
18692
|
}
|
|
17482
18693
|
) }),
|
|
17483
|
-
/* @__PURE__ */ (0,
|
|
18694
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17484
18695
|
Sidebar,
|
|
17485
18696
|
{
|
|
17486
18697
|
position: "left",
|
|
@@ -17489,20 +18700,20 @@ var Layout = ({ children }) => {
|
|
|
17489
18700
|
onResize: setLeftWidth,
|
|
17490
18701
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
17491
18702
|
children: Object.entries(pluginItems).map(
|
|
17492
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0,
|
|
18703
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17493
18704
|
PluginTab,
|
|
17494
18705
|
{
|
|
17495
18706
|
visible: currentPlugin === id,
|
|
17496
18707
|
mobileOnly,
|
|
17497
|
-
children: /* @__PURE__ */ (0,
|
|
18708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Render2, {})
|
|
17498
18709
|
},
|
|
17499
18710
|
id
|
|
17500
18711
|
)
|
|
17501
18712
|
)
|
|
17502
18713
|
}
|
|
17503
18714
|
),
|
|
17504
|
-
/* @__PURE__ */ (0,
|
|
17505
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0,
|
|
18715
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Canvas, {}),
|
|
18716
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17506
18717
|
Sidebar,
|
|
17507
18718
|
{
|
|
17508
18719
|
position: "right",
|
|
@@ -17510,7 +18721,7 @@ var Layout = ({ children }) => {
|
|
|
17510
18721
|
isVisible: rightSideBarVisible,
|
|
17511
18722
|
onResize: setRightWidth,
|
|
17512
18723
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
17513
|
-
children: /* @__PURE__ */ (0,
|
|
18724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(FieldSideBar, {})
|
|
17514
18725
|
}
|
|
17515
18726
|
)
|
|
17516
18727
|
]
|
|
@@ -17518,19 +18729,19 @@ var Layout = ({ children }) => {
|
|
|
17518
18729
|
)
|
|
17519
18730
|
}
|
|
17520
18731
|
) }) }) }),
|
|
17521
|
-
/* @__PURE__ */ (0,
|
|
18732
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { id: "puck-portal-root", className: getClassName52("portal") })
|
|
17522
18733
|
]
|
|
17523
18734
|
}
|
|
17524
18735
|
);
|
|
17525
18736
|
};
|
|
17526
18737
|
|
|
17527
18738
|
// components/Puck/index.tsx
|
|
17528
|
-
var
|
|
17529
|
-
var propsContext = (0,
|
|
18739
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
18740
|
+
var propsContext = (0, import_react103.createContext)({});
|
|
17530
18741
|
function PropsProvider(props) {
|
|
17531
|
-
return /* @__PURE__ */ (0,
|
|
18742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(propsContext.Provider, { value: props, children: props.children });
|
|
17532
18743
|
}
|
|
17533
|
-
var usePropsContext = () => (0,
|
|
18744
|
+
var usePropsContext = () => (0, import_react103.useContext)(propsContext);
|
|
17534
18745
|
function PuckProvider({ children }) {
|
|
17535
18746
|
const {
|
|
17536
18747
|
config,
|
|
@@ -17542,6 +18753,7 @@ function PuckProvider({ children }) {
|
|
|
17542
18753
|
overrides,
|
|
17543
18754
|
viewports = defaultViewports,
|
|
17544
18755
|
iframe: _iframe,
|
|
18756
|
+
dnd,
|
|
17545
18757
|
initialHistory: _initialHistory,
|
|
17546
18758
|
metadata,
|
|
17547
18759
|
dictionary,
|
|
@@ -17550,11 +18762,11 @@ function PuckProvider({ children }) {
|
|
|
17550
18762
|
_experimentalFullScreenCanvas,
|
|
17551
18763
|
_experimentalVirtualization
|
|
17552
18764
|
} = usePropsContext();
|
|
17553
|
-
const iframe = (0,
|
|
18765
|
+
const iframe = (0, import_react103.useMemo)(
|
|
17554
18766
|
() => normalizeIframeConfig(_iframe),
|
|
17555
18767
|
[_iframe]
|
|
17556
18768
|
);
|
|
17557
|
-
const [generatedAppState] = (0,
|
|
18769
|
+
const [generatedAppState] = (0, import_react103.useState)(() => {
|
|
17558
18770
|
var _a, _b, _c;
|
|
17559
18771
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
17560
18772
|
let clientUiState = {};
|
|
@@ -17594,7 +18806,7 @@ function PuckProvider({ children }) {
|
|
|
17594
18806
|
return walkAppState(newAppState, config);
|
|
17595
18807
|
});
|
|
17596
18808
|
const { appendData = true } = _initialHistory || {};
|
|
17597
|
-
const [blendedHistories] = (0,
|
|
18809
|
+
const [blendedHistories] = (0, import_react103.useState)(
|
|
17598
18810
|
[
|
|
17599
18811
|
...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
|
|
17600
18812
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -17608,7 +18820,7 @@ function PuckProvider({ children }) {
|
|
|
17608
18820
|
});
|
|
17609
18821
|
})
|
|
17610
18822
|
);
|
|
17611
|
-
const initialHistoryIndex = (0,
|
|
18823
|
+
const initialHistoryIndex = (0, import_react103.useMemo)(() => {
|
|
17612
18824
|
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
17613
18825
|
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
17614
18826
|
}
|
|
@@ -17619,7 +18831,7 @@ function PuckProvider({ children }) {
|
|
|
17619
18831
|
overrides,
|
|
17620
18832
|
plugins
|
|
17621
18833
|
});
|
|
17622
|
-
const loadedFieldTransforms = (0,
|
|
18834
|
+
const loadedFieldTransforms = (0, import_react103.useMemo)(() => {
|
|
17623
18835
|
const _plugins = plugins || [];
|
|
17624
18836
|
const pluginFieldTransforms = _plugins.reduce(
|
|
17625
18837
|
(acc, plugin) => __spreadValues(__spreadValues({}, acc), plugin.fieldTransforms),
|
|
@@ -17628,7 +18840,7 @@ function PuckProvider({ children }) {
|
|
|
17628
18840
|
return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
|
|
17629
18841
|
}, [fieldTransforms, plugins]);
|
|
17630
18842
|
const instanceId = useSafeId();
|
|
17631
|
-
const generateAppStore = (0,
|
|
18843
|
+
const generateAppStore = (0, import_react103.useCallback)(
|
|
17632
18844
|
(state) => {
|
|
17633
18845
|
return {
|
|
17634
18846
|
instanceId,
|
|
@@ -17643,6 +18855,7 @@ function PuckProvider({ children }) {
|
|
|
17643
18855
|
onAction,
|
|
17644
18856
|
metadata,
|
|
17645
18857
|
dictionary: dictionary || {},
|
|
18858
|
+
dnd,
|
|
17646
18859
|
fieldTransforms: loadedFieldTransforms
|
|
17647
18860
|
};
|
|
17648
18861
|
},
|
|
@@ -17659,18 +18872,19 @@ function PuckProvider({ children }) {
|
|
|
17659
18872
|
onAction,
|
|
17660
18873
|
metadata,
|
|
17661
18874
|
dictionary,
|
|
18875
|
+
dnd,
|
|
17662
18876
|
loadedFieldTransforms
|
|
17663
18877
|
]
|
|
17664
18878
|
);
|
|
17665
|
-
const [appStore] = (0,
|
|
18879
|
+
const [appStore] = (0, import_react103.useState)(
|
|
17666
18880
|
() => createAppStore(generateAppStore(initialAppState))
|
|
17667
18881
|
);
|
|
17668
|
-
(0,
|
|
18882
|
+
(0, import_react103.useEffect)(() => {
|
|
17669
18883
|
if (process.env.NODE_ENV !== "production") {
|
|
17670
18884
|
window.__PUCK_INTERNAL_DO_NOT_USE = { appStore };
|
|
17671
18885
|
}
|
|
17672
18886
|
}, [appStore]);
|
|
17673
|
-
(0,
|
|
18887
|
+
(0, import_react103.useEffect)(() => {
|
|
17674
18888
|
const state = appStore.getState().state;
|
|
17675
18889
|
appStore.setState(__spreadValues({}, generateAppStore(state)));
|
|
17676
18890
|
}, [generateAppStore]);
|
|
@@ -17679,8 +18893,8 @@ function PuckProvider({ children }) {
|
|
|
17679
18893
|
index: initialHistoryIndex,
|
|
17680
18894
|
initialAppState
|
|
17681
18895
|
});
|
|
17682
|
-
const previousData = (0,
|
|
17683
|
-
(0,
|
|
18896
|
+
const previousData = (0, import_react103.useRef)(null);
|
|
18897
|
+
(0, import_react103.useEffect)(() => {
|
|
17684
18898
|
return appStore.subscribe(
|
|
17685
18899
|
(s) => s.state.data,
|
|
17686
18900
|
(data) => {
|
|
@@ -17694,16 +18908,16 @@ function PuckProvider({ children }) {
|
|
|
17694
18908
|
}, [onChange]);
|
|
17695
18909
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
17696
18910
|
const uPuckStore = useRegisterUsePuckStore(appStore);
|
|
17697
|
-
(0,
|
|
18911
|
+
(0, import_react103.useEffect)(() => {
|
|
17698
18912
|
const { resolveAndCommitData } = appStore.getState();
|
|
17699
18913
|
setTimeout(() => {
|
|
17700
18914
|
resolveAndCommitData();
|
|
17701
18915
|
}, 0);
|
|
17702
18916
|
}, []);
|
|
17703
|
-
return /* @__PURE__ */ (0,
|
|
18917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
|
|
17704
18918
|
}
|
|
17705
18919
|
function Puck(props) {
|
|
17706
|
-
return /* @__PURE__ */ (0,
|
|
18920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Layout, { children: props.children }) })) }));
|
|
17707
18921
|
}
|
|
17708
18922
|
Puck.Components = Components;
|
|
17709
18923
|
Puck.Fields = Fields;
|
|
@@ -17972,7 +19186,7 @@ init_walk_tree();
|
|
|
17972
19186
|
// plugins/legacy-side-bar/index.tsx
|
|
17973
19187
|
init_react_import();
|
|
17974
19188
|
init_use_message();
|
|
17975
|
-
var
|
|
19189
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
17976
19190
|
var LegacySideBar = ({
|
|
17977
19191
|
outlineLabel,
|
|
17978
19192
|
componentsLabel
|
|
@@ -17981,14 +19195,14 @@ var LegacySideBar = ({
|
|
|
17981
19195
|
const outlineLabelMessage = useMessage("plugin-outline");
|
|
17982
19196
|
const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
|
|
17983
19197
|
const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
|
|
17984
|
-
return /* @__PURE__ */ (0,
|
|
17985
|
-
/* @__PURE__ */ (0,
|
|
17986
|
-
/* @__PURE__ */ (0,
|
|
19198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { style: { overflowY: "auto" }, children: [
|
|
19199
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Components, {}) }),
|
|
19200
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Outline, {}) })
|
|
17987
19201
|
] });
|
|
17988
19202
|
};
|
|
17989
19203
|
var legacySideBarPlugin = (props = {}) => ({
|
|
17990
19204
|
name: "legacy-side-bar",
|
|
17991
|
-
render: () => /* @__PURE__ */ (0,
|
|
19205
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
17992
19206
|
LegacySideBar,
|
|
17993
19207
|
{
|
|
17994
19208
|
outlineLabel: props.outlineLabel,
|
|
@@ -18049,6 +19263,7 @@ lucide-react/dist/esm/icons/bold.js:
|
|
|
18049
19263
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
18050
19264
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
18051
19265
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
19266
|
+
lucide-react/dist/esm/icons/chevrons-down-up.js:
|
|
18052
19267
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
18053
19268
|
lucide-react/dist/esm/icons/code.js:
|
|
18054
19269
|
lucide-react/dist/esm/icons/copy.js:
|