@bison-lab/payload-blocks 3.22.0 → 3.23.0
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/admin.d.mts.map +1 -1
- package/dist/admin.mjs +369 -344
- package/dist/admin.mjs.map +1 -1
- package/package.json +3 -2
package/dist/admin.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { a as linkTypeOf, n as headerItemsFromBlocks, o as resolveAdminPreviewLi
|
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ArrayField, DefaultEditView, FieldDescription, FieldError, FieldLabel, FieldPathContext, toast, useConfig, useField, useFieldPath, useForm, useTranslation } from "@payloadcms/ui";
|
|
6
6
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
7
|
-
import { Canvas, ConfirmDialog, ItemRail,
|
|
7
|
+
import { Button, Canvas, Checkbox, ConfirmDialog, Dialog, Field, Fold, Input, ItemRail, Kicker, KindGlyph, KitProvider, Label, MainHead, RailSlot, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Stack, Textarea, TypeCard, TypeCards } from "@bison-lab/admin-ui";
|
|
8
8
|
import { resolveThemeIdentity, themeHeadFromDoc } from "@bison-lab/payload-core/theme";
|
|
9
9
|
//#region src/admin/workspace-css.ts
|
|
10
10
|
/**
|
|
@@ -18,7 +18,7 @@ import { resolveThemeIdentity, themeHeadFromDoc } from "@bison-lab/payload-core/
|
|
|
18
18
|
const ADMIN_WORKSPACE_CSS = `
|
|
19
19
|
.global-edit--navigation{
|
|
20
20
|
--bg:#0f1012;--panel:#141518;--panel2:#1b1d22;--panel3:#22252b;--line:#30333b;--line2:#444854;
|
|
21
|
-
--text:#f6f7f9;--muted:#989daa;--muted2:#727887;--pink:#e60088;--pink2:#ff2da5;--danger:#ff8aa9;
|
|
21
|
+
--text:#f6f7f9;--muted:#989daa;--muted2:#727887;--pink:#e60088;--pink2:#ff2da5;--bl-kit-accent:var(--pink);--danger:#ff8aa9;
|
|
22
22
|
--theme-elevation-0:var(--panel);--theme-elevation-50:var(--panel2);--theme-elevation-100:var(--panel3);
|
|
23
23
|
--theme-elevation-150:var(--line);--theme-elevation-250:var(--line2);--theme-elevation-500:var(--muted);
|
|
24
24
|
--theme-elevation-800:var(--text);--theme-input-bg:#1d1f24;--theme-bg:var(--bg);--theme-text:var(--text);
|
|
@@ -700,7 +700,21 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
700
700
|
const fromPath = getDataByPath?.(path);
|
|
701
701
|
const items = Array.isArray(fromPath) ? fromPath : Array.isArray(itemsField.value) ? itemsField.value : [];
|
|
702
702
|
const ctaPath = ctaPathFromItems(path);
|
|
703
|
-
const
|
|
703
|
+
const ctaField = useField({ path: ctaPath });
|
|
704
|
+
const ctaEnabled = useField({ path: `${ctaPath}.enabled` });
|
|
705
|
+
const ctaLabel = useField({ path: `${ctaPath}.label` });
|
|
706
|
+
const ctaPage = useField({ path: `${ctaPath}.page` });
|
|
707
|
+
const ctaHrefField = useField({ path: `${ctaPath}.href` });
|
|
708
|
+
const ctaType = useField({ path: `${ctaPath}.type` });
|
|
709
|
+
const ctaSnapshot = ctaField.value ?? {};
|
|
710
|
+
const cta = {
|
|
711
|
+
...ctaSnapshot,
|
|
712
|
+
enabled: ctaEnabled.value ?? ctaSnapshot.enabled,
|
|
713
|
+
label: ctaLabel.value ?? ctaSnapshot.label,
|
|
714
|
+
page: ctaPage.value ?? ctaSnapshot.page,
|
|
715
|
+
href: ctaHrefField.value ?? ctaSnapshot.href,
|
|
716
|
+
type: ctaType.value ?? ctaSnapshot.type
|
|
717
|
+
};
|
|
704
718
|
const ctaOn = cta.enabled !== false && Boolean(cta.label || cta.page || cta.href || cta.enabled);
|
|
705
719
|
const { config } = useConfig();
|
|
706
720
|
const endpoint = `${config.serverURL}${config.routes.api}`;
|
|
@@ -735,6 +749,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
735
749
|
const [hoverItem, setHoverItem] = useState(null);
|
|
736
750
|
const openItem = hoverItem && items.some((row) => row.label === hoverItem && row.blockType === "megaMenu") ? hoverItem : void 0;
|
|
737
751
|
const openRow = items.find((row) => row.label === openItem && row.blockType === "megaMenu");
|
|
752
|
+
const openIndex = openRow ? items.indexOf(openRow) : -1;
|
|
738
753
|
function add(blockType) {
|
|
739
754
|
const seed = blockType === "navLink" ? emptyLink() : emptyMega();
|
|
740
755
|
addFieldRow({
|
|
@@ -811,7 +826,8 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
811
826
|
}
|
|
812
827
|
function onPreviewClick(event) {
|
|
813
828
|
const target = event.target;
|
|
814
|
-
|
|
829
|
+
if (target.closest("a[href]")) event.preventDefault();
|
|
830
|
+
const label = target.closest("[data-preview-item]")?.getAttribute("data-preview-item");
|
|
815
831
|
if (!label) return;
|
|
816
832
|
const index = items.findIndex((row) => row.label === label);
|
|
817
833
|
if (index >= 0) {
|
|
@@ -837,7 +853,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
837
853
|
identityFallback
|
|
838
854
|
]);
|
|
839
855
|
const ctaHref = resolveAdminPreviewLink(cta, pages);
|
|
840
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
856
|
+
return /* @__PURE__ */ jsx(KitProvider, { children: /* @__PURE__ */ jsxs("div", {
|
|
841
857
|
className: "bl-nav-items field-type",
|
|
842
858
|
children: [
|
|
843
859
|
/* @__PURE__ */ jsx("style", {
|
|
@@ -860,12 +876,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
860
876
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
861
877
|
className: "bl-nav-items__rail-row",
|
|
862
878
|
children: [
|
|
863
|
-
/* @__PURE__ */ jsx("
|
|
864
|
-
className: "bl-nav-items__badge",
|
|
865
|
-
"data-kind": row.blockType,
|
|
866
|
-
"aria-hidden": true,
|
|
867
|
-
children: row.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MegaGlyph, {}) : /* @__PURE__ */ jsx(LinkGlyph, {})
|
|
868
|
-
}),
|
|
879
|
+
/* @__PURE__ */ jsx(KindGlyph, { kind: row.blockType === "megaMenu" ? "megaMenu" : "navLink" }),
|
|
869
880
|
/* @__PURE__ */ jsx("button", {
|
|
870
881
|
type: "button",
|
|
871
882
|
className: "bl-nav-items__rail-label",
|
|
@@ -885,12 +896,12 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
885
896
|
children: [/* @__PURE__ */ jsxs(TypeCards, {
|
|
886
897
|
compact: true,
|
|
887
898
|
children: [/* @__PURE__ */ jsx(TypeCard, {
|
|
888
|
-
icon: /* @__PURE__ */ jsx(
|
|
899
|
+
icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "navLink" }),
|
|
889
900
|
label: "Link",
|
|
890
901
|
active: row.blockType === "navLink",
|
|
891
902
|
onClick: () => requestType("navLink")
|
|
892
903
|
}), /* @__PURE__ */ jsx(TypeCard, {
|
|
893
|
-
icon: /* @__PURE__ */ jsx(
|
|
904
|
+
icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "megaMenu" }),
|
|
894
905
|
label: "Mega",
|
|
895
906
|
active: row.blockType === "megaMenu",
|
|
896
907
|
onClick: () => requestType("megaMenu")
|
|
@@ -902,8 +913,8 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
902
913
|
})]
|
|
903
914
|
}) : null]
|
|
904
915
|
}, String(row.id ?? index)))
|
|
905
|
-
}), readOnly ? null : /* @__PURE__ */ jsx(
|
|
906
|
-
|
|
916
|
+
}), readOnly ? null : /* @__PURE__ */ jsx(Button, {
|
|
917
|
+
variant: "outline",
|
|
907
918
|
className: "bl-nav-items__add",
|
|
908
919
|
onClick: () => setAdding(true),
|
|
909
920
|
children: "Add item"
|
|
@@ -933,9 +944,9 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
933
944
|
if (next instanceof Node && event.currentTarget.contains(next)) return;
|
|
934
945
|
setHoverItem(null);
|
|
935
946
|
},
|
|
936
|
-
children: [/* @__PURE__ */
|
|
947
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
937
948
|
className: "bl-nav-items__preview",
|
|
938
|
-
children: /* @__PURE__ */ jsx(PreviewNav, {
|
|
949
|
+
children: [/* @__PURE__ */ jsx(Kicker, { children: "This is just a preview" }), /* @__PURE__ */ jsx(PreviewNav, {
|
|
939
950
|
items: items.filter((row) => row.label).map((row) => {
|
|
940
951
|
const mapped = previewItems.find((item) => item.label === row.label);
|
|
941
952
|
return {
|
|
@@ -946,7 +957,10 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
946
957
|
};
|
|
947
958
|
}),
|
|
948
959
|
lockup,
|
|
949
|
-
onLockupError: () =>
|
|
960
|
+
onLockupError: () => {
|
|
961
|
+
const next = lockupSrc(identityFallback?.lockup, config.serverURL);
|
|
962
|
+
setLockup((current) => current?.url === next?.url ? null : next);
|
|
963
|
+
},
|
|
950
964
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PreviewThemeToggle, {
|
|
951
965
|
dark: previewDark,
|
|
952
966
|
onToggle: () => setPreviewDark((next) => !next)
|
|
@@ -957,12 +971,14 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
957
971
|
}) : null] }),
|
|
958
972
|
openItem,
|
|
959
973
|
onItemEnter: (label) => setHoverItem(label)
|
|
960
|
-
})
|
|
974
|
+
})]
|
|
961
975
|
}), openRow ? /* @__PURE__ */ jsx("div", {
|
|
962
976
|
className: "bl-nav-items__preview-stage",
|
|
963
977
|
"data-testid": "nav-items-preview-mega",
|
|
964
978
|
onMouseEnter: () => openItem && setHoverItem(openItem),
|
|
965
979
|
children: /* @__PURE__ */ jsx(PreviewMega, {
|
|
980
|
+
path,
|
|
981
|
+
index: openIndex,
|
|
966
982
|
row: openRow,
|
|
967
983
|
pages
|
|
968
984
|
})
|
|
@@ -978,37 +994,22 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
978
994
|
children: "Add a link or a mega menu to start the header."
|
|
979
995
|
}) : null
|
|
980
996
|
] }),
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
children: /* @__PURE__ */ jsxs(
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
}), /* @__PURE__ */ jsx(TypeCard, {
|
|
998
|
-
icon: /* @__PURE__ */ jsx(MegaGlyph, {}),
|
|
999
|
-
label: "Mega menu",
|
|
1000
|
-
description: "A dropdown of columns, sections, and an optional footer.",
|
|
1001
|
-
onClick: () => add("megaMenu")
|
|
1002
|
-
})] }),
|
|
1003
|
-
/* @__PURE__ */ jsx("button", {
|
|
1004
|
-
type: "button",
|
|
1005
|
-
className: "bl-nav-items__add",
|
|
1006
|
-
onClick: () => setAdding(false),
|
|
1007
|
-
children: "Cancel"
|
|
1008
|
-
})
|
|
1009
|
-
]
|
|
1010
|
-
})
|
|
1011
|
-
}) : null,
|
|
997
|
+
/* @__PURE__ */ jsx(Dialog, {
|
|
998
|
+
open: adding,
|
|
999
|
+
title: "Add menu item",
|
|
1000
|
+
onCancel: () => setAdding(false),
|
|
1001
|
+
children: /* @__PURE__ */ jsxs(TypeCards, { children: [/* @__PURE__ */ jsx(TypeCard, {
|
|
1002
|
+
icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "navLink" }),
|
|
1003
|
+
label: "Plain link",
|
|
1004
|
+
description: "A bar item that goes to a page or URL.",
|
|
1005
|
+
onClick: () => add("navLink")
|
|
1006
|
+
}), /* @__PURE__ */ jsx(TypeCard, {
|
|
1007
|
+
icon: /* @__PURE__ */ jsx(KindGlyph, { kind: "megaMenu" }),
|
|
1008
|
+
label: "Mega menu",
|
|
1009
|
+
description: "A dropdown of columns, sections, and an optional footer.",
|
|
1010
|
+
onClick: () => add("megaMenu")
|
|
1011
|
+
})] })
|
|
1012
|
+
}),
|
|
1012
1013
|
/* @__PURE__ */ jsx(ConfirmDialog, {
|
|
1013
1014
|
open: confirmSwitch,
|
|
1014
1015
|
title: "Switch to a plain link?",
|
|
@@ -1019,7 +1020,7 @@ const NavItemsField = ({ field, path, readOnly }) => {
|
|
|
1019
1020
|
children: "This drops the columns, sections, and footer. The label and destination stay."
|
|
1020
1021
|
})
|
|
1021
1022
|
]
|
|
1022
|
-
});
|
|
1023
|
+
}) });
|
|
1023
1024
|
};
|
|
1024
1025
|
function PreviewThemeToggle({ dark, onToggle }) {
|
|
1025
1026
|
return /* @__PURE__ */ jsx("button", {
|
|
@@ -1088,10 +1089,7 @@ function PreviewNav({ items, lockup, onLockupError, actions, openItem, onItemEnt
|
|
|
1088
1089
|
"data-href": item.href ?? "",
|
|
1089
1090
|
"aria-label": `Preview ${item.label}`,
|
|
1090
1091
|
onMouseEnter: () => onItemEnter?.(item.label),
|
|
1091
|
-
children: [item.label, item.content || item.items?.length ? /* @__PURE__ */ jsx(
|
|
1092
|
-
"aria-hidden": true,
|
|
1093
|
-
children: openItem === item.label ? " ⌃" : " ▾"
|
|
1094
|
-
}) : null]
|
|
1092
|
+
children: [item.label, item.content || item.items?.length ? /* @__PURE__ */ jsx(PreviewChevron, {}) : null]
|
|
1095
1093
|
}, item.label))
|
|
1096
1094
|
}),
|
|
1097
1095
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -1106,10 +1104,42 @@ const PREVIEW_MAX_WIDTH = {
|
|
|
1106
1104
|
standard: "42rem",
|
|
1107
1105
|
wide: "48rem"
|
|
1108
1106
|
};
|
|
1109
|
-
|
|
1107
|
+
const PREVIEW_TRACKS = {
|
|
1108
|
+
"25": 3,
|
|
1109
|
+
"33": 4,
|
|
1110
|
+
"50": 6,
|
|
1111
|
+
"66": 8,
|
|
1112
|
+
"75": 9,
|
|
1113
|
+
"100": 12
|
|
1114
|
+
};
|
|
1115
|
+
function previewColumnTrack(width) {
|
|
1116
|
+
const key = String(width ?? "100");
|
|
1117
|
+
return `minmax(0, ${PREVIEW_TRACKS[key] ?? Math.max(1, Number(key) || 1)}fr)`;
|
|
1118
|
+
}
|
|
1119
|
+
function PreviewMega({ path, index, row, pages }) {
|
|
1110
1120
|
const panel = row.panel;
|
|
1111
1121
|
const columns = panel?.columns ?? [];
|
|
1112
|
-
const
|
|
1122
|
+
const maxWidthField = useField({ path: `${path}.${index}.panel.maxWidth` });
|
|
1123
|
+
const width0 = useField({ path: `${path}.${index}.panel.columns.0.width` });
|
|
1124
|
+
const width1 = useField({ path: `${path}.${index}.panel.columns.1.width` });
|
|
1125
|
+
const width2 = useField({ path: `${path}.${index}.panel.columns.2.width` });
|
|
1126
|
+
const width3 = useField({ path: `${path}.${index}.panel.columns.3.width` });
|
|
1127
|
+
const divider1 = useField({ path: `${path}.${index}.panel.columns.1.divider` });
|
|
1128
|
+
const divider2 = useField({ path: `${path}.${index}.panel.columns.2.divider` });
|
|
1129
|
+
const divider3 = useField({ path: `${path}.${index}.panel.columns.3.divider` });
|
|
1130
|
+
const liveWidths = [
|
|
1131
|
+
width0.value,
|
|
1132
|
+
width1.value,
|
|
1133
|
+
width2.value,
|
|
1134
|
+
width3.value
|
|
1135
|
+
];
|
|
1136
|
+
const liveDividers = [
|
|
1137
|
+
void 0,
|
|
1138
|
+
divider1.value,
|
|
1139
|
+
divider2.value,
|
|
1140
|
+
divider3.value
|
|
1141
|
+
];
|
|
1142
|
+
const maxWidth = PREVIEW_MAX_WIDTH[maxWidthField.value ?? panel?.maxWidth ?? "standard"] ?? PREVIEW_MAX_WIDTH.standard;
|
|
1113
1143
|
const complete = columns.some((column) => (column.sections ?? []).some((section) => (section.links ?? []).some((link) => {
|
|
1114
1144
|
const item = link;
|
|
1115
1145
|
return Boolean(item.label && resolveAdminPreviewLink(item, pages));
|
|
@@ -1124,9 +1154,9 @@ function PreviewMega({ row, pages }) {
|
|
|
1124
1154
|
style: { maxWidth },
|
|
1125
1155
|
children: [complete ? /* @__PURE__ */ jsx("div", {
|
|
1126
1156
|
className: "bl-nav-items__preview-columns",
|
|
1127
|
-
style: { gridTemplateColumns: columns.map((column) =>
|
|
1157
|
+
style: { gridTemplateColumns: columns.map((column, columnIndex) => previewColumnTrack(liveWidths[columnIndex] ?? column.width)).join(" ") },
|
|
1128
1158
|
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx("div", {
|
|
1129
|
-
className: columnIndex > 0 && column.divider ? "bl-nav-items__preview-col has-border" : "bl-nav-items__preview-col",
|
|
1159
|
+
className: columnIndex > 0 && Boolean(liveDividers[columnIndex] ?? column.divider) ? "bl-nav-items__preview-col has-border" : "bl-nav-items__preview-col",
|
|
1130
1160
|
children: (column.sections ?? []).map((section, sectionIndex) => {
|
|
1131
1161
|
const links = (section.links ?? []).flatMap((link, linkIndex) => {
|
|
1132
1162
|
const item = link;
|
|
@@ -1190,45 +1220,37 @@ function HeaderCta({ path, readOnly }) {
|
|
|
1190
1220
|
className: "bl-nav-items__header-cta-head",
|
|
1191
1221
|
children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: "Header button" }), /* @__PURE__ */ jsx("p", { children: "The pill on the right of the bar." })] })
|
|
1192
1222
|
}),
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
className: "bl-nav-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
onChange: (event) => setEnabled(event.target.checked)
|
|
1200
|
-
}), "Show Header button"]
|
|
1223
|
+
/* @__PURE__ */ jsx(CheckLabel, {
|
|
1224
|
+
className: "bl-nav-items__header-cta-toggle",
|
|
1225
|
+
checked: on,
|
|
1226
|
+
disabled: readOnly,
|
|
1227
|
+
onCheckedChange: setEnabled,
|
|
1228
|
+
children: "Show Header button"
|
|
1201
1229
|
}),
|
|
1202
1230
|
on ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1203
|
-
/* @__PURE__ */ jsxs(
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
onChange: (event) => label.setValue(event.target.value)
|
|
1217
|
-
})]
|
|
1218
|
-
}),
|
|
1231
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsxs(Label, { children: [
|
|
1232
|
+
"Label",
|
|
1233
|
+
" ",
|
|
1234
|
+
/* @__PURE__ */ jsx("span", {
|
|
1235
|
+
className: "bl-nav-items__req",
|
|
1236
|
+
"aria-hidden": true,
|
|
1237
|
+
children: "*"
|
|
1238
|
+
})
|
|
1239
|
+
] }), /* @__PURE__ */ jsx(Input, {
|
|
1240
|
+
value: label.value ?? "",
|
|
1241
|
+
disabled: readOnly,
|
|
1242
|
+
onChange: (event) => label.setValue(event.target.value)
|
|
1243
|
+
})] }),
|
|
1219
1244
|
/* @__PURE__ */ jsx(ComposedLinkField, {
|
|
1220
1245
|
path: `${path}._index-0`,
|
|
1221
1246
|
parentPath: path,
|
|
1222
1247
|
readOnly
|
|
1223
1248
|
}),
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
disabled: readOnly,
|
|
1230
|
-
onChange: (event) => newTab.setValue(event.target.checked)
|
|
1231
|
-
}), "Open in a new tab"]
|
|
1249
|
+
/* @__PURE__ */ jsx(CheckLabel, {
|
|
1250
|
+
checked: Boolean(newTab.value),
|
|
1251
|
+
disabled: readOnly,
|
|
1252
|
+
onCheckedChange: (checked) => newTab.setValue(checked),
|
|
1253
|
+
children: "Open in a new tab"
|
|
1232
1254
|
})
|
|
1233
1255
|
] }) : null,
|
|
1234
1256
|
/* @__PURE__ */ jsx(FieldError, {
|
|
@@ -1245,27 +1267,21 @@ function ItemBasics({ path, index, readOnly }) {
|
|
|
1245
1267
|
return /* @__PURE__ */ jsxs("div", {
|
|
1246
1268
|
className: "bl-nav-items__basics",
|
|
1247
1269
|
children: [
|
|
1248
|
-
/* @__PURE__ */ jsxs("
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
onChange: (event) => label.setValue(event.target.value)
|
|
1254
|
-
})]
|
|
1255
|
-
}),
|
|
1270
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(Input, {
|
|
1271
|
+
value: label.value ?? "",
|
|
1272
|
+
disabled: readOnly,
|
|
1273
|
+
onChange: (event) => label.setValue(event.target.value)
|
|
1274
|
+
})] }),
|
|
1256
1275
|
/* @__PURE__ */ jsx(ComposedLinkField, {
|
|
1257
1276
|
path: `${path}.${index}._index-0`,
|
|
1258
1277
|
parentPath: `${path}.${index}`,
|
|
1259
1278
|
readOnly
|
|
1260
1279
|
}),
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
disabled: readOnly,
|
|
1267
|
-
onChange: (event) => newTab.setValue(event.target.checked)
|
|
1268
|
-
}), "Open in a new tab"]
|
|
1280
|
+
/* @__PURE__ */ jsx(CheckLabel, {
|
|
1281
|
+
checked: Boolean(newTab.value),
|
|
1282
|
+
disabled: readOnly,
|
|
1283
|
+
onCheckedChange: (checked) => newTab.setValue(checked),
|
|
1284
|
+
children: "Open in a new tab"
|
|
1269
1285
|
})
|
|
1270
1286
|
]
|
|
1271
1287
|
});
|
|
@@ -1283,25 +1299,27 @@ function MegaEditor({ path, index, panel, readOnly }) {
|
|
|
1283
1299
|
className: "bl-nav-items__builder-head",
|
|
1284
1300
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", { children: "Menu content" }), /* @__PURE__ */ jsx("p", { children: "Set each column’s width here. The header preview is what shows the live layout." })] }), /* @__PURE__ */ jsxs("label", {
|
|
1285
1301
|
className: "bl-nav-items__tool",
|
|
1286
|
-
children: ["Panel width", /* @__PURE__ */ jsxs(
|
|
1287
|
-
"aria-label": "Panel width",
|
|
1302
|
+
children: ["Panel width", /* @__PURE__ */ jsxs(Select, {
|
|
1288
1303
|
value: maxWidth.value ?? panel.maxWidth ?? "standard",
|
|
1289
1304
|
disabled: readOnly,
|
|
1290
|
-
|
|
1291
|
-
children: [
|
|
1292
|
-
|
|
1305
|
+
onValueChange: (value) => maxWidth.setValue(value),
|
|
1306
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
1307
|
+
"aria-label": "Panel width",
|
|
1308
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
1309
|
+
}), /* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
1310
|
+
/* @__PURE__ */ jsx(SelectItem, {
|
|
1293
1311
|
value: "narrow",
|
|
1294
1312
|
children: "Narrow"
|
|
1295
1313
|
}),
|
|
1296
|
-
/* @__PURE__ */ jsx(
|
|
1314
|
+
/* @__PURE__ */ jsx(SelectItem, {
|
|
1297
1315
|
value: "standard",
|
|
1298
1316
|
children: "Standard"
|
|
1299
1317
|
}),
|
|
1300
|
-
/* @__PURE__ */ jsx(
|
|
1318
|
+
/* @__PURE__ */ jsx(SelectItem, {
|
|
1301
1319
|
value: "wide",
|
|
1302
1320
|
children: "Wide"
|
|
1303
1321
|
})
|
|
1304
|
-
]
|
|
1322
|
+
] })]
|
|
1305
1323
|
})]
|
|
1306
1324
|
})]
|
|
1307
1325
|
}),
|
|
@@ -1318,8 +1336,8 @@ function MegaEditor({ path, index, panel, readOnly }) {
|
|
|
1318
1336
|
columnCount: columns.length
|
|
1319
1337
|
}, columnIndex))
|
|
1320
1338
|
}),
|
|
1321
|
-
readOnly || columns.length >= 4 ? null : /* @__PURE__ */ jsx(
|
|
1322
|
-
|
|
1339
|
+
readOnly || columns.length >= 4 ? null : /* @__PURE__ */ jsx(Button, {
|
|
1340
|
+
variant: "outline",
|
|
1323
1341
|
className: "bl-nav-items__add-column",
|
|
1324
1342
|
onClick: () => {
|
|
1325
1343
|
addFieldRow({
|
|
@@ -1374,13 +1392,10 @@ function MegaEditor({ path, index, panel, readOnly }) {
|
|
|
1374
1392
|
parentPath: `${path}.${index}.panel.footer.overview`,
|
|
1375
1393
|
readOnly
|
|
1376
1394
|
}),
|
|
1377
|
-
/* @__PURE__ */ jsxs("
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
readOnly
|
|
1382
|
-
})]
|
|
1383
|
-
})
|
|
1395
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
|
|
1396
|
+
path: `${path}.${index}.panel.footer.overview.label`,
|
|
1397
|
+
readOnly
|
|
1398
|
+
})] })
|
|
1384
1399
|
]
|
|
1385
1400
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1386
1401
|
className: "bl-nav-items__footer-card",
|
|
@@ -1391,13 +1406,10 @@ function MegaEditor({ path, index, panel, readOnly }) {
|
|
|
1391
1406
|
parentPath: `${path}.${index}.panel.footer.cta`,
|
|
1392
1407
|
readOnly
|
|
1393
1408
|
}),
|
|
1394
|
-
/* @__PURE__ */ jsxs("
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
readOnly
|
|
1399
|
-
})]
|
|
1400
|
-
})
|
|
1409
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
|
|
1410
|
+
path: `${path}.${index}.panel.footer.cta.label`,
|
|
1411
|
+
readOnly
|
|
1412
|
+
})] })
|
|
1401
1413
|
]
|
|
1402
1414
|
})]
|
|
1403
1415
|
})]
|
|
@@ -1462,63 +1474,112 @@ function RowMenu({ label, index, count, path, allowRemove = true, onMoved }) {
|
|
|
1462
1474
|
}) : null]
|
|
1463
1475
|
});
|
|
1464
1476
|
}
|
|
1477
|
+
function useRowActions({ index, count, path, allowRemove = true, onMoved, readOnly }) {
|
|
1478
|
+
const { moveFieldRow, removeFieldRow } = useForm();
|
|
1479
|
+
if (readOnly) return void 0;
|
|
1480
|
+
const actions = [{
|
|
1481
|
+
label: "Move up",
|
|
1482
|
+
disabled: index === 0,
|
|
1483
|
+
onClick: () => {
|
|
1484
|
+
moveFieldRow({
|
|
1485
|
+
path,
|
|
1486
|
+
moveFromIndex: index,
|
|
1487
|
+
moveToIndex: index - 1
|
|
1488
|
+
});
|
|
1489
|
+
onMoved?.(index - 1);
|
|
1490
|
+
}
|
|
1491
|
+
}, {
|
|
1492
|
+
label: "Move down",
|
|
1493
|
+
disabled: index === count - 1,
|
|
1494
|
+
onClick: () => {
|
|
1495
|
+
moveFieldRow({
|
|
1496
|
+
path,
|
|
1497
|
+
moveFromIndex: index,
|
|
1498
|
+
moveToIndex: index + 1
|
|
1499
|
+
});
|
|
1500
|
+
onMoved?.(index + 1);
|
|
1501
|
+
}
|
|
1502
|
+
}];
|
|
1503
|
+
if (allowRemove) actions.push({
|
|
1504
|
+
label: "Delete",
|
|
1505
|
+
danger: true,
|
|
1506
|
+
onClick: () => removeFieldRow({
|
|
1507
|
+
path,
|
|
1508
|
+
rowIndex: index
|
|
1509
|
+
})
|
|
1510
|
+
});
|
|
1511
|
+
return actions;
|
|
1512
|
+
}
|
|
1465
1513
|
function MegaLinkEditor({ path, arrayPath, index, count, label, readOnly }) {
|
|
1466
1514
|
const description = useField({ path: `${path}.description` });
|
|
1467
1515
|
const newTab = useField({ path: `${path}.newTab` });
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1516
|
+
return /* @__PURE__ */ jsxs(Fold, {
|
|
1517
|
+
title: label?.trim() || "Untitled",
|
|
1518
|
+
tone: "dark",
|
|
1519
|
+
actions: useRowActions({
|
|
1520
|
+
index,
|
|
1521
|
+
count,
|
|
1522
|
+
path: arrayPath,
|
|
1523
|
+
readOnly
|
|
1524
|
+
}),
|
|
1471
1525
|
children: [
|
|
1472
|
-
/* @__PURE__ */ jsxs("
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
index,
|
|
1477
|
-
count,
|
|
1478
|
-
path: arrayPath
|
|
1479
|
-
})]
|
|
1480
|
-
}),
|
|
1481
|
-
/* @__PURE__ */ jsxs("label", {
|
|
1482
|
-
className: "bl-nav-items__field",
|
|
1483
|
-
children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
|
|
1484
|
-
path: `${path}.label`,
|
|
1485
|
-
readOnly
|
|
1486
|
-
})]
|
|
1487
|
-
}),
|
|
1526
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
|
|
1527
|
+
path: `${path}.label`,
|
|
1528
|
+
readOnly
|
|
1529
|
+
})] }),
|
|
1488
1530
|
/* @__PURE__ */ jsx(ComposedLinkField, {
|
|
1489
1531
|
path: `${path}._index-0`,
|
|
1490
1532
|
parentPath: path,
|
|
1491
1533
|
readOnly
|
|
1492
1534
|
}),
|
|
1493
|
-
/* @__PURE__ */ jsxs("
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
1505
|
-
type: "checkbox",
|
|
1506
|
-
checked: Boolean(newTab.value),
|
|
1507
|
-
disabled: readOnly,
|
|
1508
|
-
onChange: (event) => newTab.setValue(event.target.checked)
|
|
1509
|
-
}), "Open in a new tab"]
|
|
1535
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Description" }), /* @__PURE__ */ jsx(Textarea, {
|
|
1536
|
+
value: description.value ?? "",
|
|
1537
|
+
disabled: readOnly,
|
|
1538
|
+
rows: 2,
|
|
1539
|
+
onChange: (event) => description.setValue(event.target.value)
|
|
1540
|
+
})] }),
|
|
1541
|
+
/* @__PURE__ */ jsx(CheckLabel, {
|
|
1542
|
+
checked: Boolean(newTab.value),
|
|
1543
|
+
disabled: readOnly,
|
|
1544
|
+
onCheckedChange: (checked) => newTab.setValue(checked),
|
|
1545
|
+
children: "Open in a new tab"
|
|
1510
1546
|
})
|
|
1511
1547
|
]
|
|
1512
1548
|
});
|
|
1513
1549
|
}
|
|
1514
1550
|
function FooterText({ path, readOnly }) {
|
|
1515
1551
|
const field = useField({ path });
|
|
1516
|
-
return /* @__PURE__ */ jsx(
|
|
1552
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
1517
1553
|
value: field.value ?? "",
|
|
1518
1554
|
disabled: readOnly,
|
|
1519
1555
|
onChange: (event) => field.setValue(event.target.value)
|
|
1520
1556
|
});
|
|
1521
1557
|
}
|
|
1558
|
+
function PreviewChevron() {
|
|
1559
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1560
|
+
className: "bl-nav-items__preview-chevron",
|
|
1561
|
+
viewBox: "0 0 24 24",
|
|
1562
|
+
width: "12",
|
|
1563
|
+
height: "12",
|
|
1564
|
+
fill: "none",
|
|
1565
|
+
stroke: "currentColor",
|
|
1566
|
+
strokeWidth: "2",
|
|
1567
|
+
strokeLinecap: "round",
|
|
1568
|
+
strokeLinejoin: "round",
|
|
1569
|
+
"aria-hidden": true,
|
|
1570
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
function CheckLabel({ checked, disabled, onCheckedChange, children, className }) {
|
|
1574
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
1575
|
+
className: ["bl-nav-items__check", className].filter(Boolean).join(" "),
|
|
1576
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
1577
|
+
checked,
|
|
1578
|
+
disabled,
|
|
1579
|
+
onCheckedChange: (value) => onCheckedChange(value === true)
|
|
1580
|
+
}), children]
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1522
1583
|
function ColumnEditor({ path, itemIndex, columnIndex, column, readOnly, columnCount }) {
|
|
1523
1584
|
const { addFieldRow } = useForm();
|
|
1524
1585
|
const width = useField({ path: `${path}.${itemIndex}.panel.columns.${columnIndex}.width` });
|
|
@@ -1527,82 +1588,73 @@ function ColumnEditor({ path, itemIndex, columnIndex, column, readOnly, columnCo
|
|
|
1527
1588
|
const sectionsPath = `${path}.${itemIndex}.panel.columns.${columnIndex}.sections`;
|
|
1528
1589
|
const sections = column.sections ?? [];
|
|
1529
1590
|
const columnName = `Column ${columnIndex + 1}`;
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
subFieldState: {
|
|
1592
|
-
display: {
|
|
1593
|
-
value: "list",
|
|
1594
|
-
valid: true
|
|
1595
|
-
},
|
|
1596
|
-
hideDescriptionsOnMobile: {
|
|
1597
|
-
value: true,
|
|
1598
|
-
valid: true
|
|
1599
|
-
}
|
|
1591
|
+
const actions = useRowActions({
|
|
1592
|
+
index: columnIndex,
|
|
1593
|
+
count: columnCount,
|
|
1594
|
+
path: columnsPath,
|
|
1595
|
+
allowRemove: columnCount > 1,
|
|
1596
|
+
readOnly
|
|
1597
|
+
});
|
|
1598
|
+
return /* @__PURE__ */ jsx(Fold, {
|
|
1599
|
+
title: columnName,
|
|
1600
|
+
tone: "light",
|
|
1601
|
+
badge: `${width.value ?? column.width ?? "100"}%`,
|
|
1602
|
+
meta: (open) => open ? null : /* @__PURE__ */ jsxs("small", { children: [
|
|
1603
|
+
sections.length,
|
|
1604
|
+
" ",
|
|
1605
|
+
sections.length === 1 ? "section" : "sections"
|
|
1606
|
+
] }),
|
|
1607
|
+
actions,
|
|
1608
|
+
children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1609
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1610
|
+
className: "bl-nav-items__column-settings",
|
|
1611
|
+
children: [/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Width" }), /* @__PURE__ */ jsxs(Select, {
|
|
1612
|
+
value: width.value ?? column.width ?? "100",
|
|
1613
|
+
disabled: readOnly,
|
|
1614
|
+
onValueChange: (value) => width.setValue(value),
|
|
1615
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
1616
|
+
"aria-label": "Width",
|
|
1617
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
1618
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: WIDTHS.map((option) => /* @__PURE__ */ jsxs(SelectItem, {
|
|
1619
|
+
value: option,
|
|
1620
|
+
children: [option, "%"]
|
|
1621
|
+
}, option)) })]
|
|
1622
|
+
})] }), columnIndex > 0 ? /* @__PURE__ */ jsx(CheckLabel, {
|
|
1623
|
+
checked: Boolean(divider.value ?? column.divider),
|
|
1624
|
+
disabled: readOnly,
|
|
1625
|
+
onCheckedChange: (checked) => divider.setValue(checked),
|
|
1626
|
+
children: "Draw a line on the left"
|
|
1627
|
+
}) : null]
|
|
1628
|
+
}),
|
|
1629
|
+
sections.map((section, sectionIndex) => /* @__PURE__ */ jsx(SectionEditor, {
|
|
1630
|
+
path,
|
|
1631
|
+
itemIndex,
|
|
1632
|
+
columnIndex,
|
|
1633
|
+
sectionIndex,
|
|
1634
|
+
section,
|
|
1635
|
+
readOnly,
|
|
1636
|
+
sectionCount: sections.length
|
|
1637
|
+
}, sectionIndex)),
|
|
1638
|
+
readOnly || sections.length >= 8 ? null : /* @__PURE__ */ jsx(Button, {
|
|
1639
|
+
variant: "outline",
|
|
1640
|
+
className: "bl-nav-items__add-section",
|
|
1641
|
+
onClick: () => addFieldRow({
|
|
1642
|
+
path: sectionsPath,
|
|
1643
|
+
schemaPath: sectionsPath,
|
|
1644
|
+
subFieldState: {
|
|
1645
|
+
display: {
|
|
1646
|
+
value: "list",
|
|
1647
|
+
valid: true
|
|
1648
|
+
},
|
|
1649
|
+
hideDescriptionsOnMobile: {
|
|
1650
|
+
value: true,
|
|
1651
|
+
valid: true
|
|
1600
1652
|
}
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
})
|
|
1653
|
+
}
|
|
1654
|
+
}),
|
|
1655
|
+
children: "+ Add section to this column"
|
|
1656
|
+
})
|
|
1657
|
+
] })
|
|
1606
1658
|
});
|
|
1607
1659
|
}
|
|
1608
1660
|
function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, readOnly, sectionCount }) {
|
|
@@ -1614,34 +1666,33 @@ function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, re
|
|
|
1614
1666
|
const hideMobile = useField({ path: `${base}.hideDescriptionsOnMobile` });
|
|
1615
1667
|
const links = section.links ?? [];
|
|
1616
1668
|
const featured = (display.value ?? section.display) === "featured";
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
children: [
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1669
|
+
return /* @__PURE__ */ jsx(Fold, {
|
|
1670
|
+
title: eyebrow.value || section.eyebrow || "Untitled section",
|
|
1671
|
+
tone: "dark",
|
|
1672
|
+
meta: (open) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("small", { children: featured ? "featured" : "list" }), open ? null : /* @__PURE__ */ jsxs("small", { children: [
|
|
1673
|
+
links.length,
|
|
1674
|
+
" ",
|
|
1675
|
+
links.length === 1 ? "link" : "links"
|
|
1676
|
+
] })] }),
|
|
1677
|
+
actions: useRowActions({
|
|
1678
|
+
index: sectionIndex,
|
|
1679
|
+
count: sectionCount,
|
|
1680
|
+
path: sectionsPath,
|
|
1681
|
+
readOnly
|
|
1682
|
+
}),
|
|
1683
|
+
children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1630
1684
|
/* @__PURE__ */ jsxs("div", {
|
|
1631
1685
|
className: "bl-nav-items__section-settings",
|
|
1632
1686
|
children: [
|
|
1633
|
-
/* @__PURE__ */ jsxs("
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1643
|
-
className: "bl-nav-items__field",
|
|
1644
|
-
children: [/* @__PURE__ */ jsx("span", { children: "Display" }), /* @__PURE__ */ jsxs("div", {
|
|
1687
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(Label, { children: "Eyebrow" }), /* @__PURE__ */ jsx(Input, {
|
|
1688
|
+
value: eyebrow.value ?? section.eyebrow ?? "",
|
|
1689
|
+
disabled: readOnly,
|
|
1690
|
+
placeholder: "Optional heading",
|
|
1691
|
+
onChange: (event) => eyebrow.setValue(event.target.value)
|
|
1692
|
+
})] }),
|
|
1693
|
+
/* @__PURE__ */ jsxs(Field, {
|
|
1694
|
+
as: "div",
|
|
1695
|
+
children: [/* @__PURE__ */ jsx(Label, { children: "Display" }), /* @__PURE__ */ jsxs("div", {
|
|
1645
1696
|
className: "bl-nav-items__seg",
|
|
1646
1697
|
children: [/* @__PURE__ */ jsx("button", {
|
|
1647
1698
|
type: "button",
|
|
@@ -1658,54 +1709,48 @@ function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, re
|
|
|
1658
1709
|
})]
|
|
1659
1710
|
})]
|
|
1660
1711
|
}),
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
disabled: readOnly,
|
|
1667
|
-
onChange: (event) => hideMobile.setValue(event.target.checked)
|
|
1668
|
-
}), "Hide descriptions on mobile"]
|
|
1712
|
+
/* @__PURE__ */ jsx(CheckLabel, {
|
|
1713
|
+
checked: (hideMobile.value ?? section.hideDescriptionsOnMobile) !== false,
|
|
1714
|
+
disabled: readOnly,
|
|
1715
|
+
onCheckedChange: (checked) => hideMobile.setValue(checked),
|
|
1716
|
+
children: "Hide descriptions on mobile"
|
|
1669
1717
|
})
|
|
1670
1718
|
]
|
|
1671
1719
|
}),
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
valid: true
|
|
1695
|
-
}
|
|
1720
|
+
links.map((link, linkIndex) => /* @__PURE__ */ jsx(MegaLinkEditor, {
|
|
1721
|
+
path: `${base}.links.${linkIndex}`,
|
|
1722
|
+
arrayPath: `${base}.links`,
|
|
1723
|
+
index: linkIndex,
|
|
1724
|
+
count: links.length,
|
|
1725
|
+
label: link.label,
|
|
1726
|
+
readOnly
|
|
1727
|
+
}, linkIndex)),
|
|
1728
|
+
readOnly ? null : /* @__PURE__ */ jsx(Button, {
|
|
1729
|
+
variant: "outline",
|
|
1730
|
+
className: "bl-nav-items__inline-add",
|
|
1731
|
+
onClick: () => addFieldRow({
|
|
1732
|
+
path: `${base}.links`,
|
|
1733
|
+
schemaPath: `${base}.links`,
|
|
1734
|
+
subFieldState: {
|
|
1735
|
+
label: {
|
|
1736
|
+
value: "New link",
|
|
1737
|
+
valid: true
|
|
1738
|
+
},
|
|
1739
|
+
type: {
|
|
1740
|
+
value: "page",
|
|
1741
|
+
valid: true
|
|
1696
1742
|
}
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1743
|
+
}
|
|
1744
|
+
}),
|
|
1745
|
+
children: "+ Add link"
|
|
1700
1746
|
})
|
|
1701
|
-
]
|
|
1747
|
+
] })
|
|
1702
1748
|
});
|
|
1703
1749
|
}
|
|
1704
1750
|
const CSS = `
|
|
1705
|
-
.bl-nav-items{--bg:#0f1012;--panel:#141518;--panel2:#1b1d22;--line:#30333b;--line2:#444854;--text:#f6f7f9;--muted:#989daa;--pink:#e60088;display:grid;grid-template-columns:300px minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}
|
|
1706
|
-
.bl-nav-items button,.bl-nav-items input,.bl-nav-items select,.bl-nav-items textarea{font:inherit;color:inherit}
|
|
1751
|
+
.bl-nav-items{--bg:#0f1012;--panel:#141518;--panel2:#1b1d22;--line:#30333b;--line2:#444854;--text:#f6f7f9;--muted:#989daa;--pink:#e60088;--bl-kit-accent:var(--pink);display:grid;grid-template-columns:300px minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-height:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}
|
|
1752
|
+
.bl-nav-items button:not([class*="bl-nav-kit"]),.bl-nav-items input:not([class*="bl-nav-kit"]),.bl-nav-items select:not([class*="bl-nav-kit"]),.bl-nav-items textarea:not([class*="bl-nav-kit"]){font:inherit;color:inherit}
|
|
1707
1753
|
.bl-workspace__rail{border-right:1px solid var(--line);background:#121316;min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}
|
|
1708
|
-
.bl-nav-items__kicker,.bl-workspace__kicker{margin:0;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:800}
|
|
1709
1754
|
.bl-nav-items__rail-body{padding:12px;flex:1;min-height:0;overflow:auto}
|
|
1710
1755
|
.bl-workspace__rail-slot{flex:none;min-height:0;max-height:100%;overflow:auto;border-top:1px solid var(--line);background:#101115;padding:14px 12px 16px}
|
|
1711
1756
|
.bl-nav-items__header-cta{margin:0;padding:0;border:0;min-width:0}
|
|
@@ -1721,16 +1766,14 @@ const CSS = `
|
|
|
1721
1766
|
.bl-nav-items__badge{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;background:#292c33;color:#c9ccd4}
|
|
1722
1767
|
.bl-nav-items__badge[data-kind="megaMenu"]{background:#32142a;color:#ff91ce}
|
|
1723
1768
|
.bl-nav-items__rail-edit{display:block;border-top:1px solid var(--line);padding:10px}
|
|
1724
|
-
.bl-nav-items__add,.bl-nav-items__add-section,.bl-nav-items__add-column,.bl-nav-items__inline-add{width:100
|
|
1725
|
-
.bl-nav-items__add:hover,.bl-nav-items__add-section:hover,.bl-nav-items__add-column:hover,.bl-nav-items__inline-add:hover{border-color:var(--pink);color:#fff}
|
|
1769
|
+
.bl-nav-items__add,.bl-nav-items__add-section,.bl-nav-items__add-column,.bl-nav-items__inline-add{width:100%}
|
|
1726
1770
|
.bl-nav-items__add-column{margin-top:12px}
|
|
1727
|
-
.bl-nav-items__inline-add{border-width:1px 0 0;border-radius:0;text-align:left}
|
|
1728
1771
|
.bl-workspace__canvas{min-width:0;min-height:0;height:100%;overflow:auto;padding:0 28px 44px;max-width:1250px;margin:0 auto;width:100%}
|
|
1729
|
-
.bl-workspace__main-head{padding:18px 0 14px;
|
|
1772
|
+
.bl-workspace__main-head{padding:18px 0 14px;display:flex;justify-content:space-between;align-items:flex-start}
|
|
1730
1773
|
.bl-workspace__main-head h1{font-size:20px;margin:2px 0 4px}
|
|
1731
1774
|
.bl-workspace__main-head p{margin:0;color:var(--muted)}
|
|
1732
1775
|
.bl-nav-items__preview-block{position:sticky;top:0;z-index:20;background:transparent;padding:0;overflow:visible}
|
|
1733
|
-
.bl-nav-items__preview{padding:
|
|
1776
|
+
.bl-nav-items__preview{padding:16px;display:flex;flex-direction:column;gap:16px;background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:visible}
|
|
1734
1777
|
.bl-nav-items__preview-theme{border:0;background:transparent;color:inherit;width:36px;height:36px;display:grid;place-items:center;border-radius:8px;cursor:pointer;flex:none}
|
|
1735
1778
|
.bl-nav-items__preview-theme:hover{background:#24242b}
|
|
1736
1779
|
.bl-nav-items__preview-block[data-theme="dark"] .bl-nav-items__preview-logo img{filter:invert(1) hue-rotate(180deg)}
|
|
@@ -1756,50 +1799,34 @@ const CSS = `
|
|
|
1756
1799
|
.bl-nav-items__preview-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#1f2126;border-top:1px solid var(--line)}
|
|
1757
1800
|
.bl-nav-items__preview-footer a{color:var(--pink2,#ff2da5);text-decoration:underline;text-underline-offset:2px;font-weight:650;font-size:13px}
|
|
1758
1801
|
.bl-nav-items__preview-footer .cta{background:var(--pink);padding:8px 12px;border-radius:8px;color:#fff;font-weight:650;font-size:13px}
|
|
1759
|
-
.bl-nav-items__preview-nav{display:
|
|
1760
|
-
.bl-nav-items__preview-logo{
|
|
1802
|
+
.bl-nav-items__preview-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:24px;padding:12px 16px 12px 20px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:rgba(20,21,24,.85);box-shadow:0 10px 28px rgba(0,0,0,.28)}
|
|
1803
|
+
.bl-nav-items__preview-logo{justify-self:start;min-width:0;display:flex;align-items:center}
|
|
1761
1804
|
.bl-nav-items__preview-logo img{height:20px;width:auto;display:block}
|
|
1762
|
-
.bl-nav-items__preview-links{display:flex;align-items:center;gap:4px;
|
|
1763
|
-
.bl-nav-items__preview-link{color:#d7dae0;background:none;border:0;padding:8px 12px;border-radius:8px;font-weight:550;cursor:pointer;white-space:nowrap}
|
|
1805
|
+
.bl-nav-items__preview-links{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0}
|
|
1806
|
+
.bl-nav-items__preview-link{display:inline-flex;align-items:center;gap:4px;color:#d7dae0;background:none;border:0;padding:8px 12px;border-radius:8px;font-weight:550;cursor:pointer;white-space:nowrap}
|
|
1764
1807
|
.bl-nav-items__preview-link.is-open{background:#24242b}
|
|
1765
|
-
.bl-nav-items__preview-
|
|
1808
|
+
.bl-nav-items__preview-chevron{flex:none;width:12px;height:12px;transition:transform .2s}
|
|
1809
|
+
.bl-nav-items__preview-link.is-open .bl-nav-items__preview-chevron{transform:rotate(180deg)}
|
|
1810
|
+
.bl-nav-items__preview-actions{justify-self:end;display:flex;align-items:center;justify-content:flex-end;gap:8px}
|
|
1766
1811
|
.bl-nav-items__preview-cta{flex:none;background:var(--pink);border:0;border-radius:8px;color:#fff;font-weight:650;font-size:13px;padding:8px 12px;white-space:nowrap;text-decoration:none}
|
|
1767
1812
|
.bl-nav-items__builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:26px 0 10px}
|
|
1768
1813
|
.bl-nav-items__builder-head h2{font-size:18px;margin:0}
|
|
1769
1814
|
.bl-nav-items__builder-head p{margin:3px 0 0;color:var(--muted);font-size:13px}
|
|
1770
1815
|
.bl-nav-items__builder-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
|
|
1771
1816
|
.bl-nav-items__tool{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
|
|
1772
|
-
.bl-nav-items__tool
|
|
1817
|
+
.bl-nav-items__tool .bl-nav-kit__select-trigger{width:auto;min-width:160px}
|
|
1773
1818
|
.bl-nav-items__columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
|
|
1774
1819
|
.bl-nav-items__columns:has(> :only-child){grid-template-columns:minmax(0,1fr)}
|
|
1775
|
-
.bl-nav-items__column{border:1px solid var(--
|
|
1776
|
-
.bl-nav-items__column-
|
|
1777
|
-
.bl-nav-items__column-
|
|
1778
|
-
.bl-nav-items__width-pill{font-size:11px;color:#c2c5cc;background:#292c33;border-radius:999px;padding:3px 8px}
|
|
1779
|
-
.bl-nav-items__column-body{padding:12px}
|
|
1780
|
-
.bl-nav-items__column-settings{display:grid;grid-template-columns:1fr 1fr;column-gap:10px;row-gap:7px;margin-bottom:12px;padding:10px;background:#101115;border:1px solid var(--line);border-radius:9px;align-items:center}
|
|
1781
|
-
.bl-nav-items__column-settings.is-first{grid-template-columns:1fr}
|
|
1782
|
-
.bl-nav-items__column-settings > label:not(.bl-nav-items__check){display:block;font-size:12px;font-weight:700}
|
|
1783
|
-
.bl-nav-items__column-settings select{width:100%;background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;color:#fff;padding:10px 11px;margin-top:7px}
|
|
1784
|
-
.bl-nav-items__field{display:block;font-size:12px;font-weight:700;margin:0 0 13px}
|
|
1785
|
-
.bl-nav-items__field > span{display:block;margin-bottom:7px}
|
|
1786
|
-
.bl-nav-items__field input,.bl-nav-items__field select,.bl-nav-items__field textarea{width:100%;font:inherit;font-weight:400;padding:10px 11px;border:1px solid #3a3d46;border-radius:8px;background:#1d1f24;color:#fff;outline:none}
|
|
1820
|
+
.bl-nav-items__column-settings{display:grid;grid-template-columns:1fr;gap:10px;padding:10px;background:#101115;border:1px solid var(--line);border-radius:9px;align-items:center}
|
|
1821
|
+
.bl-nav-items__column-settings .bl-nav-kit__field{margin:0}
|
|
1822
|
+
.bl-nav-items__column-settings .bl-nav-kit__select-trigger{width:100%}
|
|
1787
1823
|
.bl-nav-items__check{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:500;color:#d8dbe1}
|
|
1788
1824
|
.bl-nav-items__header-cta .bl-nav-items__check{gap:16px}
|
|
1789
1825
|
.bl-nav-items__header-cta-toggle{margin-bottom:20px}
|
|
1790
|
-
.bl-nav-items__check input{accent-color:var(--pink);margin:0;flex:none}
|
|
1791
1826
|
.bl-nav-items__seg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
|
|
1792
1827
|
.bl-nav-items__seg button{border:1px solid var(--line2);background:#15171b;border-radius:7px;padding:8px 6px;font-size:12px;color:inherit;cursor:pointer}
|
|
1793
1828
|
.bl-nav-items__seg button.is-active{border-color:var(--pink);background:#261722}
|
|
1794
|
-
.bl-nav-items__section{border:1px solid var(--line);background:#
|
|
1795
|
-
.bl-nav-items__section-head{padding:11px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
|
|
1796
|
-
.bl-nav-items__section-head strong{font-size:13px}
|
|
1797
|
-
.bl-nav-items__section-head small{color:var(--muted);margin-left:6px}
|
|
1798
|
-
.bl-nav-items__section-settings{padding:10px 12px;border-bottom:1px solid var(--line);background:#0e0f13}
|
|
1799
|
-
.bl-nav-items__links{padding:8px}
|
|
1800
|
-
.bl-nav-items__link{border:1px solid var(--line);background:#111216;border-radius:7px;padding:0 10px 12px;margin:.5rem 0}
|
|
1801
|
-
.bl-nav-items__link-head{margin:0 -10px 8px;padding:11px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
|
|
1802
|
-
.bl-nav-items__link-head strong{font-size:13px}
|
|
1829
|
+
.bl-nav-items__section-settings{padding:10px 12px;border:1px solid var(--line);background:#0e0f13;border-radius:9px}
|
|
1803
1830
|
.bl-nav-items__footer,.bl-nav-items__panel{margin-top:18px;border:1px solid var(--line2);background:#141518;border-radius:12px;overflow:hidden}
|
|
1804
1831
|
.bl-nav-items__footer-head,.bl-nav-items__panel-head{display:flex;align-items:flex-start;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line);gap:12px}
|
|
1805
1832
|
.bl-nav-items__footer-head h3,.bl-nav-items__panel-head h3{margin:0;font-size:16px}
|
|
@@ -1814,14 +1841,12 @@ const CSS = `
|
|
|
1814
1841
|
.bl-nav-items__menu > button{border:0;background:transparent;color:inherit;cursor:pointer}
|
|
1815
1842
|
.bl-nav-items__menu-pop{position:absolute;right:0;top:34px;z-index:12;min-width:140px;padding:4px;border:1px solid var(--line2);border-radius:8px;background:#1b1d22}
|
|
1816
1843
|
.bl-nav-items__menu-pop button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:7px 8px;border-radius:6px;color:#d8dbe1;cursor:pointer}
|
|
1817
|
-
.bl-nav-items .field-label,.bl-nav-items .field-label__label{display:block !important;font
|
|
1844
|
+
.bl-nav-items .field-label,.bl-nav-items .field-label__label{display:block !important;margin:0;padding:0;font:12px/1.2 Inter,ui-sans-serif,system-ui,sans-serif;font-weight:700;color:inherit}
|
|
1818
1845
|
.bl-nav-items .field-description,.bl-nav-items .field__description{display:none !important}
|
|
1819
|
-
.bl-nav-items .bl-link-field{margin:0 0
|
|
1846
|
+
.bl-nav-items .bl-link-field{display:flex;flex-direction:column;gap:8px;margin:0 0 16px}
|
|
1820
1847
|
.bl-nav-items .bl-link-field__control{background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;min-height:auto;padding:8px 10px;color:#fff;box-shadow:none}
|
|
1821
1848
|
.bl-nav-items .bl-link-field__kind{background:#292c33;color:#c9ccd4;border-radius:999px;padding:3px 7px}
|
|
1822
1849
|
.bl-nav-items .bl-link-field__kind:first-letter{text-transform:uppercase}
|
|
1823
|
-
.bl-nav-kit__modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:rgba(0,0,0,.62)}
|
|
1824
|
-
.bl-nav-kit__modal-card{width:min(36rem,calc(100vw - 2rem));background:#15161a;border:1px solid #343741;border-radius:14px;padding:1.25rem;color:var(--text)}
|
|
1825
1850
|
@media(max-width:1280px){.bl-nav-items{grid-template-columns:250px minmax(0,1fr)}}
|
|
1826
1851
|
@media(max-width:850px){.bl-nav-items{grid-template-columns:1fr}.bl-nav-items__footer-body,.bl-nav-items__columns,.bl-nav-items__columns:has(> :only-child){grid-template-columns:minmax(0,1fr) !important}}
|
|
1827
1852
|
`;
|