@drawnagency/primitives 0.1.78 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BAQYZSFF.js → chunk-4TVODHD2.js} +5 -5
- package/dist/{chunk-NS3UTJ3E.js → chunk-7XWER6YR.js} +18 -11
- package/dist/{chunk-UA6OCJJK.js → chunk-KVQFMVXE.js} +79 -26
- package/dist/{chunk-MK4POMLZ.js → chunk-QB5Q23G2.js} +1 -1
- package/dist/{chunk-4SIWBWKZ.js → chunk-RSITF24B.js} +8 -0
- package/dist/{chunk-Z5IYWUW3.js → chunk-UNUJPLZV.js} +1 -1
- package/dist/{chunk-K4JD6FD3.js → chunk-VI26O4E3.js} +1 -1
- package/dist/components/brandguide/Colors.d.ts +2 -1
- package/dist/components/brandguide/Colors.d.ts.map +1 -1
- package/dist/components/editor/index.js +1 -1
- package/dist/components/primitives/EditableGrid.d.ts +11 -1
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
- package/dist/components/primitives/gridDrop.d.ts +18 -0
- package/dist/components/primitives/gridDrop.d.ts.map +1 -0
- package/dist/components/primitives/index.js +3 -3
- package/dist/components/primitives/useEditableCollection.d.ts +1 -0
- package/dist/components/primitives/useEditableCollection.d.ts.map +1 -1
- package/dist/components/sections/Colors/index.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +3 -3
- package/dist/components/sections/register-schemas.js +5 -5
- package/dist/components/sections/register.js +5 -5
- package/dist/components/shell/EditorContext.d.ts +2 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts +13 -0
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/HistoryToolbar.d.ts +8 -1
- package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/corner-radius.d.ts +6 -0
- package/dist/lib/corner-radius.d.ts.map +1 -0
- package/dist/lib/index.js +2 -2
- package/dist/lib/registry.d.ts +3 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/schemas/index.js +2 -2
- package/dist/schemas/site-config.d.ts +6 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/brandguide/Colors.tsx +15 -5
- package/src/components/chat/ChatPanel.tsx +8 -8
- package/src/components/primitives/EditableGrid.tsx +86 -24
- package/src/components/primitives/ResolvedMedia.tsx +1 -1
- package/src/components/primitives/gridDrop.ts +26 -0
- package/src/components/primitives/useEditableCollection.ts +16 -1
- package/src/components/sections/Button/CTAButton.tsx +1 -1
- package/src/components/sections/Colors/index.tsx +2 -1
- package/src/components/sections/Media/MediaBlock.tsx +1 -1
- package/src/components/shared/Navigation.tsx +5 -5
- package/src/components/shell/EditorContext.tsx +6 -1
- package/src/components/shell/EditorModal.tsx +7 -7
- package/src/components/shell/EditorShell.tsx +46 -5
- package/src/components/shell/HistoryToolbar.tsx +24 -2
- package/src/components/shell/SiteSettingsDisplay.tsx +19 -0
- package/src/lib/corner-radius.ts +22 -0
- package/src/lib/registry.ts +3 -0
- package/src/schemas/site-config.ts +4 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
pluralize,
|
|
4
4
|
stripHtmlToPlainText,
|
|
5
5
|
truncate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7XWER6YR.js";
|
|
7
7
|
import {
|
|
8
8
|
DeleteButton,
|
|
9
9
|
DragHandle,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
EditableRichText,
|
|
21
21
|
defineHeadingSection
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VI26O4E3.js";
|
|
23
23
|
import {
|
|
24
24
|
EditablePlainText,
|
|
25
25
|
ImageDropZone,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
colSpanClass,
|
|
29
29
|
containerGridClass,
|
|
30
30
|
spacerHiddenClass
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KVQFMVXE.js";
|
|
32
32
|
import {
|
|
33
33
|
useMediaLibrary,
|
|
34
34
|
useResolvedMedia
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "./chunk-TZQPOR5A.js";
|
|
52
52
|
import {
|
|
53
53
|
SingleMediaReferenceSchema
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-RSITF24B.js";
|
|
55
55
|
import {
|
|
56
56
|
defineSection,
|
|
57
57
|
getSection
|
|
@@ -397,7 +397,7 @@ import { RectangleHorizontal } from "lucide-react";
|
|
|
397
397
|
import { Download } from "lucide-react";
|
|
398
398
|
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
399
399
|
function Button({ text, link, download, onChange }) {
|
|
400
|
-
const base = "inline-block rounded-
|
|
400
|
+
const base = "inline-block rounded-outer px-6 py-3 font-bold transition-colors";
|
|
401
401
|
const variant = "border-2 border-primary text-primary hover:bg-primary hover:text-primary-contrast";
|
|
402
402
|
if (onChange) {
|
|
403
403
|
return /* @__PURE__ */ jsxs2("span", { className: cn(base, variant, "inline-flex items-center gap-2"), children: [
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
MediaBlock,
|
|
10
10
|
containerGridClass,
|
|
11
11
|
useEditableCollection
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KVQFMVXE.js";
|
|
13
13
|
import {
|
|
14
14
|
AddIcon,
|
|
15
15
|
DeleteIcon,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
HexColorSchema,
|
|
32
32
|
SingleMediaReferenceSchema
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-RSITF24B.js";
|
|
34
34
|
import {
|
|
35
35
|
defineSection
|
|
36
36
|
} from "./chunk-VKAGMEKE.js";
|
|
@@ -124,7 +124,7 @@ function buildContent(colors, options) {
|
|
|
124
124
|
...label || columns || collapsing !== void 0 || showLabel !== void 0 ? { options: { label, columns, collapsing, showLabel } } : {}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function Colors({ colors, columns = 3, label, collapsing, showLabel = true, onChange, openModal }) {
|
|
127
|
+
function Colors({ colors, columns = 3, label, collapsing, showLabel = true, onChange, openModal, onDelete }) {
|
|
128
128
|
if (onChange && openModal) {
|
|
129
129
|
return /* @__PURE__ */ jsx2(
|
|
130
130
|
ColorsEditable,
|
|
@@ -135,7 +135,8 @@ function Colors({ colors, columns = 3, label, collapsing, showLabel = true, onCh
|
|
|
135
135
|
collapsing,
|
|
136
136
|
showLabel,
|
|
137
137
|
onChange,
|
|
138
|
-
openModal
|
|
138
|
+
openModal,
|
|
139
|
+
onDelete
|
|
139
140
|
}
|
|
140
141
|
);
|
|
141
142
|
}
|
|
@@ -184,7 +185,7 @@ function ColorsView({
|
|
|
184
185
|
/* @__PURE__ */ jsx2("div", { className: "@container", children: /* @__PURE__ */ jsx2("div", { className: cn("grid gap-4", containerGridClass[columns] || containerGridClass[3]), children: colors.map((color, i) => {
|
|
185
186
|
const hex = color.spaces[0]?.hex;
|
|
186
187
|
const contrast = getContrastClass(hex);
|
|
187
|
-
return /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-
|
|
188
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex h-full flex-col overflow-hidden rounded-outer border border-base-200", children: [
|
|
188
189
|
/* @__PURE__ */ jsxs2("div", { className: cn("relative flex min-h-[80px] items-end p-3", contrast), style: { backgroundColor: hex || "#ccc" }, children: [
|
|
189
190
|
color.name && /* @__PURE__ */ jsx2("span", { className: "text-sm font-bold", children: color.name }),
|
|
190
191
|
copiedIndex === i && /* @__PURE__ */ jsx2("span", { className: cn(
|
|
@@ -192,7 +193,8 @@ function ColorsView({
|
|
|
192
193
|
getContrastClass(hex) === "text-black" ? "bg-black/15 text-black" : "bg-white/25 text-white"
|
|
193
194
|
), children: "Copied!" })
|
|
194
195
|
] }),
|
|
195
|
-
expanded &&
|
|
196
|
+
expanded && // flex-1 so every swatch's label block grows to the tallest in its row.
|
|
197
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1 space-y-1 bg-base-accent p-3 text-sm", children: color.spaces.map(
|
|
196
198
|
(space, j) => Object.entries(space).map(
|
|
197
199
|
([key, value]) => value ? /* @__PURE__ */ jsxs2("button", { onClick: () => handleCopy(value, i), className: "cursor-pointer flex w-full justify-between hover:text-primary", children: [
|
|
198
200
|
/* @__PURE__ */ jsx2("span", { className: "font-medium uppercase", children: key }),
|
|
@@ -211,7 +213,8 @@ function ColorsEditable({
|
|
|
211
213
|
collapsing,
|
|
212
214
|
showLabel,
|
|
213
215
|
onChange,
|
|
214
|
-
openModal
|
|
216
|
+
openModal,
|
|
217
|
+
onDelete
|
|
215
218
|
}) {
|
|
216
219
|
const [expanded, setExpanded] = useState2(!collapsing);
|
|
217
220
|
const options = { label, columns, collapsing, showLabel };
|
|
@@ -257,6 +260,8 @@ function ColorsEditable({
|
|
|
257
260
|
{
|
|
258
261
|
items: colors,
|
|
259
262
|
columns,
|
|
263
|
+
group: "colors",
|
|
264
|
+
onEmptied: onDelete,
|
|
260
265
|
onChange: (newColors) => onChange(buildContent(newColors, options)),
|
|
261
266
|
createItem: createColorItem,
|
|
262
267
|
isEditMode: true,
|
|
@@ -290,7 +295,7 @@ function ColorSwatchEditable({
|
|
|
290
295
|
const newColors = colors.map((c, i) => i === index ? updated : c);
|
|
291
296
|
onChange(buildContent(newColors, options));
|
|
292
297
|
};
|
|
293
|
-
return /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-
|
|
298
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex h-full flex-col overflow-hidden rounded-outer border border-base-200", children: [
|
|
294
299
|
/* @__PURE__ */ jsx2("div", { className: cn("flex min-h-[80px] items-end p-3", contrast), style: { backgroundColor: hex || "#ccc" }, children: /* @__PURE__ */ jsx2(
|
|
295
300
|
EditablePlainText,
|
|
296
301
|
{
|
|
@@ -302,7 +307,8 @@ function ColorSwatchEditable({
|
|
|
302
307
|
className: "text-sm font-bold"
|
|
303
308
|
}
|
|
304
309
|
) }),
|
|
305
|
-
expanded &&
|
|
310
|
+
expanded && // flex-1 so every swatch's label block grows to the tallest in its row.
|
|
311
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1 space-y-1 bg-base-accent p-3 text-sm", children: color.spaces.map(
|
|
306
312
|
(space, j) => Object.entries(space).map(
|
|
307
313
|
([key, value]) => value ? /* @__PURE__ */ jsxs2("div", { className: "flex w-full justify-between", children: [
|
|
308
314
|
/* @__PURE__ */ jsx2("span", { className: "font-medium uppercase", children: key }),
|
|
@@ -346,7 +352,7 @@ var Colors_default = defineSection({
|
|
|
346
352
|
icon: /* @__PURE__ */ jsx3(Palette, { size: 18 }),
|
|
347
353
|
schema,
|
|
348
354
|
authoringNote: "A brand color palette. Each color may carry hex/rgb/cmyk/pantone values. Use to document brand colors with swatches.",
|
|
349
|
-
component: ({ content, options, onChange, openModal }) => /* @__PURE__ */ jsx3(
|
|
355
|
+
component: ({ content, options, onChange, openModal, onDelete }) => /* @__PURE__ */ jsx3(
|
|
350
356
|
Colors,
|
|
351
357
|
{
|
|
352
358
|
colors: content.content.colors,
|
|
@@ -355,7 +361,8 @@ var Colors_default = defineSection({
|
|
|
355
361
|
collapsing: options?.collapsing,
|
|
356
362
|
showLabel: options?.showLabel,
|
|
357
363
|
onChange: onChange ? (c) => onChange(c) : void 0,
|
|
358
|
-
openModal
|
|
364
|
+
openModal,
|
|
365
|
+
onDelete
|
|
359
366
|
}
|
|
360
367
|
),
|
|
361
368
|
defaults: () => ({
|
|
@@ -195,7 +195,7 @@ function ResolvedMedia({
|
|
|
195
195
|
onError: () => setLoaded(true)
|
|
196
196
|
}
|
|
197
197
|
)
|
|
198
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "flex aspect-video h-full w-full flex-col items-center justify-center gap-1 rounded bg-base-accent text-base-contrast-light/50", children: [
|
|
198
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex aspect-video h-full w-full flex-col items-center justify-center gap-1 rounded-outer bg-base-accent text-base-contrast-light/50", children: [
|
|
199
199
|
/* @__PURE__ */ jsx(ImageIcon, { size: 24 }),
|
|
200
200
|
/* @__PURE__ */ jsx("span", { className: "text-sm", children: "No Image" })
|
|
201
201
|
] }) });
|
|
@@ -293,7 +293,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
293
293
|
{
|
|
294
294
|
"data-testid": "media-open-surface",
|
|
295
295
|
className: cn(
|
|
296
|
-
"overflow-hidden rounded-
|
|
296
|
+
"overflow-hidden rounded-outer",
|
|
297
297
|
showBorder && "border border-base-200",
|
|
298
298
|
options.square && "aspect-square",
|
|
299
299
|
onImageClick && "cursor-pointer"
|
|
@@ -319,7 +319,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
// src/components/primitives/EditableGrid.tsx
|
|
322
|
-
import { useRef as useRef4, useEffect as useEffect4, useState as useState5 } from "react";
|
|
322
|
+
import { useRef as useRef4, useEffect as useEffect4, useState as useState5, useId } from "react";
|
|
323
323
|
import { ImageIcon as ImageIcon2 } from "lucide-react";
|
|
324
324
|
|
|
325
325
|
// src/lib/container-grid.ts
|
|
@@ -411,6 +411,17 @@ function useEditableCollection({
|
|
|
411
411
|
},
|
|
412
412
|
[createItem, onChange]
|
|
413
413
|
);
|
|
414
|
+
const onInsertItem = useCallback3(
|
|
415
|
+
(index, data) => {
|
|
416
|
+
setWrappedItems((prev) => {
|
|
417
|
+
const next = [...prev];
|
|
418
|
+
next.splice(index, 0, { id: uid(), data });
|
|
419
|
+
onChange(next.map((w) => w.data));
|
|
420
|
+
return next;
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
[onChange]
|
|
424
|
+
);
|
|
414
425
|
const onRemove = useCallback3(
|
|
415
426
|
(id) => {
|
|
416
427
|
setWrappedItems((prev) => {
|
|
@@ -421,7 +432,19 @@ function useEditableCollection({
|
|
|
421
432
|
},
|
|
422
433
|
[onChange]
|
|
423
434
|
);
|
|
424
|
-
return { wrappedItems, onReorder, onAdd, onInsert, onRemove };
|
|
435
|
+
return { wrappedItems, onReorder, onAdd, onInsert, onInsertItem, onRemove };
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/components/primitives/gridDrop.ts
|
|
439
|
+
function resolveDropIndex({
|
|
440
|
+
fromIndex,
|
|
441
|
+
targetIndex,
|
|
442
|
+
edge,
|
|
443
|
+
sameCollection
|
|
444
|
+
}) {
|
|
445
|
+
let toIndex = targetIndex + (edge === "right" ? 1 : 0);
|
|
446
|
+
if (sameCollection && fromIndex < toIndex) toIndex--;
|
|
447
|
+
return toIndex;
|
|
425
448
|
}
|
|
426
449
|
|
|
427
450
|
// src/components/primitives/EditableGrid.tsx
|
|
@@ -436,26 +459,57 @@ function EditableGrid({
|
|
|
436
459
|
onItemSettings,
|
|
437
460
|
onItemImageClick,
|
|
438
461
|
chromeTopClass,
|
|
439
|
-
className
|
|
462
|
+
className,
|
|
463
|
+
group,
|
|
464
|
+
onEmptied
|
|
440
465
|
}) {
|
|
441
|
-
const
|
|
466
|
+
const gridId = useId();
|
|
467
|
+
const { wrappedItems, onReorder, onAdd, onInsert, onInsertItem, onRemove } = useEditableCollection({
|
|
442
468
|
items,
|
|
443
469
|
onChange,
|
|
444
470
|
createItem
|
|
445
471
|
});
|
|
446
472
|
const [dragState, setDragState] = useState5({ sourceId: null, closestEdge: null });
|
|
447
473
|
const [isDragging, setIsDragging] = useState5(false);
|
|
474
|
+
const cfgRef = useRef4({ gridId, group, itemCount: wrappedItems.length, onReorder, onRemove, onInsertItem, onEmptied });
|
|
475
|
+
cfgRef.current = { gridId, group, itemCount: wrappedItems.length, onReorder, onRemove, onInsertItem, onEmptied };
|
|
448
476
|
useEffect4(() => {
|
|
449
477
|
let cleanup;
|
|
450
478
|
let cancelled = false;
|
|
451
|
-
|
|
479
|
+
Promise.all([
|
|
480
|
+
import("./adapter-HH47ZPGM.js"),
|
|
481
|
+
import("./closest-edge-EBOXL3YW.js")
|
|
482
|
+
]).then(([{ monitorForElements }, { extractClosestEdge }]) => {
|
|
452
483
|
if (cancelled) return;
|
|
453
484
|
cleanup = monitorForElements({
|
|
454
485
|
onDragStart: ({ source }) => {
|
|
455
486
|
if (source.data.dragType === "grid-cell") setIsDragging(true);
|
|
456
487
|
},
|
|
457
|
-
onDrop: ({ source }) => {
|
|
458
|
-
if (source.data.dragType
|
|
488
|
+
onDrop: ({ source, location }) => {
|
|
489
|
+
if (source.data.dragType !== "grid-cell") return;
|
|
490
|
+
setIsDragging(false);
|
|
491
|
+
setDragState({ sourceId: null, closestEdge: null });
|
|
492
|
+
const { gridId: my, group: myGroup, itemCount, onReorder: onReorder2, onRemove: onRemove2, onInsertItem: onInsertItem2, onEmptied: onEmptied2 } = cfgRef.current;
|
|
493
|
+
const srcGridId = source.data.gridId;
|
|
494
|
+
const target = location.current.dropTargets[0];
|
|
495
|
+
const dstGridId = target?.data.gridId;
|
|
496
|
+
if (srcGridId === my && dstGridId === my && target) {
|
|
497
|
+
const fromIndex = source.data.index;
|
|
498
|
+
const edge = extractClosestEdge(target.data);
|
|
499
|
+
const toIndex = resolveDropIndex({ fromIndex, targetIndex: target.data.index, edge, sameCollection: true });
|
|
500
|
+
if (fromIndex !== toIndex) onReorder2(fromIndex, toIndex);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const crossAllowed = myGroup != null && source.data.group === myGroup;
|
|
504
|
+
if (!crossAllowed) return;
|
|
505
|
+
if (srcGridId === my && dstGridId && dstGridId !== my) {
|
|
506
|
+
if (itemCount <= 1 && onEmptied2) onEmptied2();
|
|
507
|
+
else onRemove2(source.data.id);
|
|
508
|
+
} else if (dstGridId === my && srcGridId !== my && target) {
|
|
509
|
+
const edge = extractClosestEdge(target.data);
|
|
510
|
+
const toIndex = resolveDropIndex({ fromIndex: source.data.index, targetIndex: target.data.index, edge, sameCollection: false });
|
|
511
|
+
onInsertItem2(toIndex, source.data.item);
|
|
512
|
+
}
|
|
459
513
|
}
|
|
460
514
|
});
|
|
461
515
|
});
|
|
@@ -473,9 +527,11 @@ function EditableGrid({
|
|
|
473
527
|
{
|
|
474
528
|
id: wrapped.id,
|
|
475
529
|
index,
|
|
530
|
+
gridId,
|
|
531
|
+
group,
|
|
532
|
+
item: wrapped.data,
|
|
476
533
|
isLast: index === wrappedItems.length - 1,
|
|
477
534
|
isDragging,
|
|
478
|
-
onReorder,
|
|
479
535
|
onRemove,
|
|
480
536
|
onInsert,
|
|
481
537
|
onSettings: onItemSettings ? () => onItemSettings(index) : void 0,
|
|
@@ -503,9 +559,11 @@ function EditableGrid({
|
|
|
503
559
|
function GridCell({
|
|
504
560
|
id,
|
|
505
561
|
index,
|
|
562
|
+
gridId,
|
|
563
|
+
group,
|
|
564
|
+
item,
|
|
506
565
|
isLast,
|
|
507
566
|
isDragging,
|
|
508
|
-
onReorder,
|
|
509
567
|
onRemove,
|
|
510
568
|
onInsert,
|
|
511
569
|
onSettings,
|
|
@@ -530,15 +588,18 @@ function GridCell({
|
|
|
530
588
|
if (cancelled) return;
|
|
531
589
|
const cleanupDraggable = draggable({
|
|
532
590
|
element: handle,
|
|
533
|
-
|
|
591
|
+
// `item` rides along so a cross-grid destination can insert it verbatim.
|
|
592
|
+
getInitialData: () => ({ dragType: "grid-cell", gridId, group, id, index, item }),
|
|
534
593
|
onDragStart: () => setDragState({ sourceId: id, closestEdge: null }),
|
|
535
594
|
onDrop: () => setDragState({ sourceId: null, closestEdge: null })
|
|
536
595
|
});
|
|
537
596
|
const cleanupDropTarget = dropTargetForElements({
|
|
538
597
|
element: cell,
|
|
539
|
-
|
|
598
|
+
// Accept a reorder within this grid, or a transfer from another grid in
|
|
599
|
+
// the same group. The actual move is performed by the grid-level monitor.
|
|
600
|
+
canDrop: ({ source }) => source.data.dragType === "grid-cell" && (source.data.gridId === gridId || group != null && source.data.group === group),
|
|
540
601
|
getData: ({ input, element }) => attachClosestEdge(
|
|
541
|
-
{ id, index },
|
|
602
|
+
{ gridId, id, index },
|
|
542
603
|
{ input, element, allowedEdges: ["left", "right"] }
|
|
543
604
|
),
|
|
544
605
|
onDragEnter: ({ self }) => {
|
|
@@ -551,16 +612,6 @@ function GridCell({
|
|
|
551
612
|
},
|
|
552
613
|
onDragLeave: () => {
|
|
553
614
|
setDragState((prev) => prev.closestEdge?.id === id ? { ...prev, closestEdge: null } : prev);
|
|
554
|
-
},
|
|
555
|
-
onDrop: ({ source, self }) => {
|
|
556
|
-
const fromIndex = source.data.index;
|
|
557
|
-
const edge = extractClosestEdge(self.data);
|
|
558
|
-
let toIndex = index;
|
|
559
|
-
if (edge === "right") toIndex = index + 1;
|
|
560
|
-
if (fromIndex < toIndex) toIndex--;
|
|
561
|
-
if (fromIndex !== toIndex) {
|
|
562
|
-
onReorder(fromIndex, toIndex);
|
|
563
|
-
}
|
|
564
615
|
}
|
|
565
616
|
});
|
|
566
617
|
cleanup = () => {
|
|
@@ -572,7 +623,7 @@ function GridCell({
|
|
|
572
623
|
cancelled = true;
|
|
573
624
|
cleanup?.();
|
|
574
625
|
};
|
|
575
|
-
}, [id, index,
|
|
626
|
+
}, [id, index, gridId, group, item, setDragState]);
|
|
576
627
|
const isCellDragging = dragState.sourceId === id;
|
|
577
628
|
const showLeftEdge = dragState.closestEdge?.id === id && dragState.closestEdge.edge === "left" && dragState.sourceId !== id;
|
|
578
629
|
const showRightEdge = dragState.closestEdge?.id === id && dragState.closestEdge.edge === "right" && dragState.sourceId !== id;
|
|
@@ -581,7 +632,9 @@ function GridCell({
|
|
|
581
632
|
{
|
|
582
633
|
ref: cellRef,
|
|
583
634
|
className: cn(
|
|
584
|
-
|
|
635
|
+
// h-full so a full-height renderItem (e.g. a colors swatch) fills the
|
|
636
|
+
// stretched grid track and can equalize height across the row.
|
|
637
|
+
"group/cell relative h-full",
|
|
585
638
|
isCellDragging && "opacity-50"
|
|
586
639
|
),
|
|
587
640
|
children: [
|
|
@@ -113,6 +113,11 @@ var MediaConfigSchema = z2.object({
|
|
|
113
113
|
|
|
114
114
|
// src/schemas/site-config.ts
|
|
115
115
|
import { z as z3 } from "zod";
|
|
116
|
+
|
|
117
|
+
// src/lib/corner-radius.ts
|
|
118
|
+
var CORNER_RADIUS_OPTIONS = ["none", "small", "medium", "large"];
|
|
119
|
+
|
|
120
|
+
// src/schemas/site-config.ts
|
|
116
121
|
var StatusSchema = z3.enum(["draft", "live", "archived", "published"]).transform(
|
|
117
122
|
(val) => val === "published" ? "live" : val
|
|
118
123
|
);
|
|
@@ -254,6 +259,9 @@ var SiteConfigSchema = z3.object({
|
|
|
254
259
|
primaryColor: HexColorSchema.default("#009ca6"),
|
|
255
260
|
primaryContrast: HexColorSchema.default("#f0f0f0"),
|
|
256
261
|
darkMode: z3.enum(["light", "dark", "optional"]).default("light"),
|
|
262
|
+
// Maps to the --radius-outer design token (see lib/corner-radius.ts);
|
|
263
|
+
// defaults so pre-existing site-config.json files keep parsing.
|
|
264
|
+
cornerRadius: z3.enum(CORNER_RADIUS_OPTIONS).default("medium"),
|
|
257
265
|
headingFont: FontNameSchema.default("system-ui"),
|
|
258
266
|
bodyFont: FontNameSchema.default("system-ui"),
|
|
259
267
|
uppercaseHeadings: z3.boolean().default(true),
|
|
@@ -9,7 +9,8 @@ interface Props {
|
|
|
9
9
|
showLabel?: boolean;
|
|
10
10
|
onChange?: (content: SectionContent) => void;
|
|
11
11
|
openModal?: (title: string, content: ReactNode) => void;
|
|
12
|
+
onDelete?: () => void;
|
|
12
13
|
}
|
|
13
|
-
export default function Colors({ colors, columns, label, collapsing, showLabel, onChange, openModal }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default function Colors({ colors, columns, label, collapsing, showLabel, onChange, openModal, onDelete }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=Colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/Colors.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,UAAU,KAAK;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/Colors.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,UAAU,KAAK;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAgCD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,OAAW,EAAE,KAAK,EAAE,UAAU,EAAE,SAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAiBhI"}
|
|
@@ -13,7 +13,17 @@ interface EditableGridProps<T> {
|
|
|
13
13
|
onItemImageClick?: (index: number) => void;
|
|
14
14
|
chromeTopClass?: string;
|
|
15
15
|
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Items can be dragged BETWEEN two EditableGrids that share the same non-null
|
|
18
|
+
* `group` (e.g. two colors sections). Without a group, a grid only reorders
|
|
19
|
+
* its own items. Only pass the same group to grids whose item shape matches —
|
|
20
|
+
* a cross-grid drop inserts the source item verbatim into the destination.
|
|
21
|
+
*/
|
|
22
|
+
group?: string;
|
|
23
|
+
/** Called instead of removing the last item when it is dragged out to another
|
|
24
|
+
* grid — lets the owner tear down a now-empty container (e.g. delete the section). */
|
|
25
|
+
onEmptied?: () => void;
|
|
16
26
|
}
|
|
17
|
-
export declare function EditableGrid<T>({ items, columns, onChange, createItem, isEditMode, renderItem, onItemSettings, onItemImageClick, chromeTopClass, className, }: EditableGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function EditableGrid<T>({ items, columns, onChange, createItem, isEditMode, renderItem, onItemSettings, onItemImageClick, chromeTopClass, className, group, onEmptied, }: EditableGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
18
28
|
export {};
|
|
19
29
|
//# sourceMappingURL=EditableGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableGrid.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/EditableGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EditableGrid.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/EditableGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS3E,UAAU,iBAAiB,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAClF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;2FACuF;IACvF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,KAAK,EACL,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAqItB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a drop target (the cell being dropped onto + the closest edge) into
|
|
3
|
+
* the destination index for the moved item.
|
|
4
|
+
*
|
|
5
|
+
* Same-collection reorder: the dragged item is spliced OUT of the array before
|
|
6
|
+
* being re-inserted, so a destination past its original position shifts down by
|
|
7
|
+
* one — hence the `fromIndex < toIndex` decrement.
|
|
8
|
+
*
|
|
9
|
+
* Cross-collection insert: nothing is removed from the destination array, so no
|
|
10
|
+
* shift adjustment applies.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveDropIndex({ fromIndex, targetIndex, edge, sameCollection, }: {
|
|
13
|
+
fromIndex: number;
|
|
14
|
+
targetIndex: number;
|
|
15
|
+
edge: "left" | "right" | null;
|
|
16
|
+
sameCollection: boolean;
|
|
17
|
+
}): number;
|
|
18
|
+
//# sourceMappingURL=gridDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridDrop.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/gridDrop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,WAAW,EACX,IAAI,EACJ,cAAc,GACf,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CAIT"}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
EditableRichText,
|
|
3
3
|
LinkPopover,
|
|
4
4
|
defineHeadingSection
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-VI26O4E3.js";
|
|
6
6
|
import {
|
|
7
7
|
EditableGrid,
|
|
8
8
|
EditablePlainText,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
MediaBlock,
|
|
11
11
|
ResolvedMedia,
|
|
12
12
|
useEditableCollection
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-KVQFMVXE.js";
|
|
14
14
|
import "../../chunk-ZSPCE6MZ.js";
|
|
15
15
|
import {
|
|
16
16
|
DeleteIcon,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
cn
|
|
24
24
|
} from "../../chunk-7EOSDFS3.js";
|
|
25
25
|
import "../../chunk-4YEOTFVU.js";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-RSITF24B.js";
|
|
27
27
|
import "../../chunk-VKAGMEKE.js";
|
|
28
28
|
import "../../chunk-JSBRDJBE.js";
|
|
29
29
|
|
|
@@ -12,6 +12,7 @@ interface UseEditableCollectionReturn<T> {
|
|
|
12
12
|
onReorder: (fromIndex: number, toIndex: number) => void;
|
|
13
13
|
onAdd: () => void;
|
|
14
14
|
onInsert: (index: number) => void;
|
|
15
|
+
onInsertItem: (index: number, data: T) => void;
|
|
15
16
|
onRemove: (id: string) => void;
|
|
16
17
|
}
|
|
17
18
|
export declare function useEditableCollection<T>({ items, onChange, createItem, }: UseEditableCollectionOptions<T>): UseEditableCollectionReturn<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditableCollection.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/useEditableCollection.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW,CAAC,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,4BAA4B,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;CACrB;AAED,UAAU,2BAA2B,CAAC,CAAC;IACrC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAaD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EACvC,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,4BAA4B,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useEditableCollection.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/useEditableCollection.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW,CAAC,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,4BAA4B,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;CACrB;AAED,UAAU,2BAA2B,CAAC,CAAC;IACrC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAaD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EACvC,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,4BAA4B,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAiFlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Colors/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Colors/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,wBAsCG"}
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
ColorItemSchema,
|
|
3
3
|
ColorSpaceSchema,
|
|
4
4
|
brandGuideSectionDefs
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-7XWER6YR.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-KVQFMVXE.js";
|
|
8
8
|
import "../../chunk-EMGLZQCM.js";
|
|
9
9
|
import "../../chunk-3LNKOLZP.js";
|
|
10
10
|
import "../../chunk-PZJL2S3Z.js";
|
|
11
11
|
import "../../chunk-WDSVHKAH.js";
|
|
12
12
|
import "../../chunk-7EOSDFS3.js";
|
|
13
13
|
import "../../chunk-4YEOTFVU.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RSITF24B.js";
|
|
15
15
|
import "../../chunk-VKAGMEKE.js";
|
|
16
16
|
import "../../chunk-JSBRDJBE.js";
|
|
17
17
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-4TVODHD2.js";
|
|
4
|
+
import "../../chunk-7XWER6YR.js";
|
|
5
5
|
import "../../chunk-2DDWWTRX.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-VI26O4E3.js";
|
|
8
|
+
import "../../chunk-KVQFMVXE.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
10
|
import "../../chunk-EMGLZQCM.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
@@ -16,7 +16,7 @@ import "../../chunk-53DKVAB6.js";
|
|
|
16
16
|
import "../../chunk-7EOSDFS3.js";
|
|
17
17
|
import "../../chunk-4YEOTFVU.js";
|
|
18
18
|
import "../../chunk-TZQPOR5A.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-RSITF24B.js";
|
|
20
20
|
import {
|
|
21
21
|
registerRichText,
|
|
22
22
|
registerSchema
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-4TVODHD2.js";
|
|
4
|
+
import "../../chunk-7XWER6YR.js";
|
|
5
5
|
import "../../chunk-2DDWWTRX.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-VI26O4E3.js";
|
|
8
|
+
import "../../chunk-KVQFMVXE.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
10
|
import "../../chunk-EMGLZQCM.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
@@ -16,7 +16,7 @@ import "../../chunk-53DKVAB6.js";
|
|
|
16
16
|
import "../../chunk-7EOSDFS3.js";
|
|
17
17
|
import "../../chunk-4YEOTFVU.js";
|
|
18
18
|
import "../../chunk-TZQPOR5A.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-RSITF24B.js";
|
|
20
20
|
import {
|
|
21
21
|
registerSection
|
|
22
22
|
} from "../../chunk-VKAGMEKE.js";
|
|
@@ -13,10 +13,12 @@ interface EditorContextValue {
|
|
|
13
13
|
showAllChrome: boolean;
|
|
14
14
|
viewBranch: "saved" | "live";
|
|
15
15
|
historyState: HistoryState;
|
|
16
|
+
historyPageId: string | null;
|
|
16
17
|
toggleEditMode: () => void;
|
|
17
18
|
toggleShowAllChrome: () => void;
|
|
18
19
|
setViewBranch: (branch: "saved" | "live") => void;
|
|
19
20
|
setHistoryState: (state: HistoryState) => void;
|
|
21
|
+
setHistoryPageId: (pageId: string | null) => void;
|
|
20
22
|
}
|
|
21
23
|
interface EditorProviderProps {
|
|
22
24
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorContext.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,IAAI,CAAC;AAET,UAAU,kBAAkB;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorContext.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,IAAI,CAAC;AAET,UAAU,kBAAkB;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAID,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA4B/D;AAED,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
|