@bison-lab/payload-blocks 3.20.0 → 3.22.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.mjs CHANGED
@@ -1,12 +1,114 @@
1
1
  "use client";
2
2
  import "./link-32261jXB.mjs";
3
- import { a as resolveAdminPreviewLink, i as linkTypeOf, t as headerItemsFromBlocks } from "./header-CznT9Uwv.mjs";
3
+ import { a as linkTypeOf, n as headerItemsFromBlocks, o as resolveAdminPreviewLink } from "./header-CTMSB4C0.mjs";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { FloatingNavBlock } from "@bison-lab/ui";
6
- import { ArrayField, FieldDescription, FieldError, FieldLabel, FieldPathContext, toast, useConfig, useField, useFieldPath, useForm, useTranslation } from "@payloadcms/ui";
5
+ import { ArrayField, DefaultEditView, FieldDescription, FieldError, FieldLabel, FieldPathContext, toast, useConfig, useField, useFieldPath, useForm, useTranslation } from "@payloadcms/ui";
7
6
  import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
8
- import { ConfirmDialog, LinkGlyph, MegaGlyph, TypeCard, TypeCards } from "@bison-lab/admin-ui";
9
- import { themeHeadFromDoc } from "@bison-lab/payload-core/theme";
7
+ import { Canvas, ConfirmDialog, ItemRail, LinkGlyph, MainHead, MegaGlyph, RailSlot, TypeCard, TypeCards } from "@bison-lab/admin-ui";
8
+ import { resolveThemeIdentity, themeHeadFromDoc } from "@bison-lab/payload-core/theme";
9
+ //#region src/admin/workspace-css.ts
10
+ /**
11
+ * Payload Edit View → mockup workspace. Scoped to the document that
12
+ * opted in (Header first). Theme, Pages, and other collections stay
13
+ * Payload's form. Hex is the approved mockup, not Payload elevation.
14
+ *
15
+ * A second kit editor reuses this file by opting into the same view;
16
+ * do not copy Header selectors into that editor.
17
+ */
18
+ const ADMIN_WORKSPACE_CSS = `
19
+ .global-edit--navigation{
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;
22
+ --theme-elevation-0:var(--panel);--theme-elevation-50:var(--panel2);--theme-elevation-100:var(--panel3);
23
+ --theme-elevation-150:var(--line);--theme-elevation-250:var(--line2);--theme-elevation-500:var(--muted);
24
+ --theme-elevation-800:var(--text);--theme-input-bg:#1d1f24;--theme-bg:var(--bg);--theme-text:var(--text);
25
+ --brand-primary:var(--pink);
26
+ --gutter-h:0;--main-gutter-h-left:0;--main-gutter-h-right:0;
27
+ --sidebar-gutter-h-left:0;--sidebar-gutter-h-right:0;
28
+ background:var(--bg);color:var(--text);
29
+ display:flex;flex-direction:column;flex:1;min-height:0;height:auto;
30
+ overflow:hidden;
31
+ }
32
+ /* Own the viewport with flex. The edit view already sits under
33
+ AppHeader inside the wrap; a viewport height here pushes the
34
+ Header button past the fold. */
35
+ .template-default:has(.global-edit--navigation){
36
+ height:100dvh;max-height:100dvh;min-height:0;overflow:hidden;
37
+ }
38
+ .template-default:has(.global-edit--navigation) .template-default__wrap{
39
+ display:flex;flex-direction:column;min-height:0;height:100%;overflow:hidden;
40
+ }
41
+ .template-default:has(.global-edit--navigation) .app-header{
42
+ flex:none;
43
+ }
44
+ .global-edit--navigation form,.global-edit--navigation .gutter--left,.global-edit--navigation .gutter--right{
45
+ padding:0;margin:0;
46
+ }
47
+ .global-edit--navigation form{
48
+ flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;height:100%;
49
+ }
50
+ /* Payload's main pane is content-sized. Stretch it — and only the kit
51
+ field — so the rail and canvas reach the bottom of the browser.
52
+ Do not flex every .field-type: hidden cta/bar siblings would steal
53
+ height, and height:100% beats a viewport min-height on .bl-nav-items. */
54
+ .global-edit--navigation .doc-controls + div,
55
+ .global-edit--navigation .doc-controls + div > div,
56
+ .global-edit--navigation .document-fields,
57
+ .global-edit--navigation .document-fields__main,
58
+ .global-edit--navigation .document-fields__edit,
59
+ .global-edit--navigation .document-fields__fields,
60
+ .global-edit--navigation .render-fields:has(.bl-nav-items),
61
+ .global-edit--navigation .group-field:has(.bl-nav-items),
62
+ .global-edit--navigation .group-field:has(.bl-nav-items) .group-field__wrap{
63
+ display:flex;flex-direction:column;flex:1;min-height:0;height:100%;
64
+ overflow:hidden;padding:0;margin:0;border:0;max-width:none;width:100%;
65
+ }
66
+ .global-edit--navigation .render-fields:has(.bl-nav-items){gap:0}
67
+ .global-edit--navigation .field-label,.global-edit--navigation .field-label__label,
68
+ .global-edit--navigation .field-description,.global-edit--navigation .field__description,
69
+ .global-edit--navigation .group-field__title,.global-edit--navigation .tabs-field{display:none}
70
+ .global-edit--navigation .bl-nav-items .field-label,.global-edit--navigation .bl-nav-items .field-label__label{display:block}
71
+ .global-edit--navigation .live-preview,.global-edit--navigation .live-preview-window,
72
+ .global-edit--navigation [class*="LivePreview"]{display:none !important}
73
+ .global-edit--navigation .doc-header{
74
+ background:var(--bg);border-bottom:1px solid var(--line);padding:10px 24px;min-height:0;flex:none;
75
+ }
76
+ .global-edit--navigation .doc-controls{
77
+ background:var(--bg);border-bottom:1px solid var(--line);padding:12px;min-height:0;
78
+ flex:none;position:sticky;top:0;z-index:6;
79
+ }
80
+ .global-edit--navigation .doc-controls:before,.global-edit--navigation .doc-controls:after{
81
+ display:none;content:none;backdrop-filter:none;
82
+ }
83
+ .global-edit--navigation .doc-controls__wrapper{height:auto;min-height:0}
84
+ .global-edit--navigation .doc-controls__content{padding:0}
85
+ .global-edit--navigation .doc-controls__controls-wrapper{background:var(--bg);border-top-color:var(--line)}
86
+ .global-edit--navigation .doc-header__title,.global-edit--navigation .doc-controls .doc-title{font-size:16px;font-weight:700;color:var(--text)}
87
+ .global-edit--navigation .btn--style-primary,.global-edit--navigation .btn.btn--style-primary{
88
+ background:var(--pink);border-color:var(--pink);color:#fff;
89
+ }
90
+ .global-edit--navigation .bl-nav-items{
91
+ display:grid;grid-template-columns:300px minmax(0,1fr);
92
+ grid-template-rows:minmax(0,1fr);
93
+ flex:1;min-height:0;height:100%;overflow:hidden;align-self:stretch;
94
+ }
95
+ @media(max-width:1280px){.global-edit--navigation .bl-nav-items{grid-template-columns:250px minmax(0,1fr)}}
96
+ @media(max-width:850px){.global-edit--navigation .bl-nav-items{grid-template-columns:1fr}}
97
+ `;
98
+ //#endregion
99
+ //#region src/admin/admin-workspace.tsx
100
+ /**
101
+ * Wraps Payload's DefaultEditView so Header (and later kit editors)
102
+ * become the mockup workspace. Does not mount a second Form.
103
+ */
104
+ function AdminWorkspace(props) {
105
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", {
106
+ href: "bl-admin-workspace",
107
+ precedence: "high",
108
+ children: ADMIN_WORKSPACE_CSS
109
+ }), /* @__PURE__ */ jsx(DefaultEditView, { ...props })] });
110
+ }
111
+ //#endregion
10
112
  //#region src/admin/link-field.tsx
11
113
  /**
12
114
  * The link picker: one box in place of a link's `type`, `page` and `href`.
@@ -536,7 +638,17 @@ const THEME_SEED = {
536
638
  };
537
639
  const THEME_SCOPE = ".bl-nav-items";
538
640
  function scopeThemeCss(css) {
539
- return css.replace(/:root/g, THEME_SCOPE).replace(/\[data-theme="dark"\]/g, `${THEME_SCOPE}[data-theme="dark"]`);
641
+ return css.replace(/:root/g, THEME_SCOPE).replace(/\[data-theme="dark"\]/g, `${THEME_SCOPE}[data-theme="dark"], ${THEME_SCOPE} [data-theme="dark"]`);
642
+ }
643
+ function identityFallbackFromConfig(config) {
644
+ return config.globals?.find((global) => global.slug === "theme")?.admin?.custom?.identityFallback;
645
+ }
646
+ function lockupSrc(asset, serverURL) {
647
+ if (!asset?.url) return null;
648
+ return {
649
+ url: /^https?:\/\//.test(asset.url) || asset.url.startsWith("/") ? asset.url : `${serverURL}/${asset.url}`,
650
+ alt: asset.alt
651
+ };
540
652
  }
541
653
  function pageIdOf(value) {
542
654
  if (value == null) return null;
@@ -546,12 +658,16 @@ function pageIdOf(value) {
546
658
  }
547
659
  return String(value);
548
660
  }
549
- function collectPageIds(items) {
661
+ function ctaPathFromItems(itemsPath) {
662
+ return itemsPath.endsWith(".items") ? `${itemsPath.slice(0, -6)}.cta` : "header.cta";
663
+ }
664
+ function collectPageIds(items, extra) {
550
665
  const ids = /* @__PURE__ */ new Set();
551
666
  const take = (link) => {
552
667
  const id = pageIdOf(link?.page);
553
668
  if (id) ids.add(id);
554
669
  };
670
+ take(extra);
555
671
  for (const row of items) {
556
672
  take(row);
557
673
  const panel = row.panel;
@@ -575,40 +691,30 @@ function ComposedLinkField({ path, parentPath, readOnly }) {
575
691
  });
576
692
  }
577
693
  const NavItemsField = ({ field, path, readOnly }) => {
578
- const itemsField = useField({ path });
579
- const items = Array.isArray(itemsField.value) ? itemsField.value : [];
580
- const { addFieldRow, replaceFieldRow, removeFieldRow, moveFieldRow } = useForm();
694
+ const itemsField = useField({
695
+ path,
696
+ hasRows: true
697
+ });
698
+ const { addFieldRow, replaceFieldRow, getDataByPath } = useForm();
699
+ Array.isArray(itemsField.rows) ? itemsField.rows.length : itemsField.value;
700
+ const fromPath = getDataByPath?.(path);
701
+ const items = Array.isArray(fromPath) ? fromPath : Array.isArray(itemsField.value) ? itemsField.value : [];
702
+ const ctaPath = ctaPathFromItems(path);
703
+ const cta = useField({ path: ctaPath }).value ?? {};
704
+ const ctaOn = cta.enabled !== false && Boolean(cta.label || cta.page || cta.href || cta.enabled);
581
705
  const { config } = useConfig();
582
706
  const endpoint = `${config.serverURL}${config.routes.api}`;
583
707
  const [selected, setSelected] = useState(0);
584
708
  const [adding, setAdding] = useState(false);
585
709
  const [confirmSwitch, setConfirmSwitch] = useState(false);
586
- const [menu, setMenu] = useState(null);
587
- const [atTop, setAtTop] = useState(true);
588
- const sentinel = useRef(null);
710
+ const [previewDark, setPreviewDark] = useState(true);
711
+ const identityFallback = identityFallbackFromConfig(config);
589
712
  useEffect(() => {
590
713
  if (selected >= items.length) setSelected(Math.max(0, items.length - 1));
591
714
  }, [items.length, selected]);
592
- useEffect(() => {
593
- const el = sentinel.current;
594
- if (!el) return;
595
- const leave = () => setAtTop(false);
596
- const enter = () => setAtTop(true);
597
- el.addEventListener("nav-items-preview-leave", leave);
598
- el.addEventListener("nav-items-preview-enter", enter);
599
- const io = new IntersectionObserver(([entry]) => {
600
- if (entry) setAtTop(entry.isIntersecting);
601
- });
602
- io.observe(el);
603
- return () => {
604
- el.removeEventListener("nav-items-preview-leave", leave);
605
- el.removeEventListener("nav-items-preview-enter", enter);
606
- io.disconnect();
607
- };
608
- }, []);
609
715
  const current = items[selected];
610
716
  const [pages, setPages] = useState(() => /* @__PURE__ */ new Map());
611
- const pageIds = useMemo(() => collectPageIds(items).sort().join(","), [items]);
717
+ const pageIds = useMemo(() => collectPageIds(items, cta).sort().join(","), [items, cta]);
612
718
  useEffect(() => {
613
719
  const ids = pageIds ? pageIds.split(",") : [];
614
720
  if (ids.length === 0) return;
@@ -626,7 +732,9 @@ const NavItemsField = ({ field, path, readOnly }) => {
626
732
  };
627
733
  }, [pageIds, endpoint]);
628
734
  const previewItems = useMemo(() => headerItemsFromBlocks(items, { resolveLink: (link) => resolveAdminPreviewLink(link, pages) }), [items, pages]);
629
- const openItem = atTop && current?.blockType === "megaMenu" && current.label ? current.label : void 0;
735
+ const [hoverItem, setHoverItem] = useState(null);
736
+ const openItem = hoverItem && items.some((row) => row.label === hoverItem && row.blockType === "megaMenu") ? hoverItem : void 0;
737
+ const openRow = items.find((row) => row.label === openItem && row.blockType === "megaMenu");
630
738
  function add(blockType) {
631
739
  const seed = blockType === "navLink" ? emptyLink() : emptyMega();
632
740
  addFieldRow({
@@ -701,43 +809,34 @@ const NavItemsField = ({ field, path, readOnly }) => {
701
809
  }
702
810
  switchToMega();
703
811
  }
704
- function setRow(name, value) {
705
- itemsField.setValue(items.map((row, i) => i === selected ? {
706
- ...row,
707
- [name]: value
708
- } : row));
709
- }
710
- function setPanel(patch) {
711
- if (current?.blockType !== "megaMenu") return;
712
- setRow("panel", {
713
- ...current.panel ?? emptyPanel(),
714
- ...patch
715
- });
716
- }
717
- function setColumns(columns) {
718
- setPanel({ columns: columns.map((column, i) => i === 0 ? {
719
- ...column,
720
- divider: false
721
- } : column) });
722
- }
723
812
  function onPreviewClick(event) {
724
813
  const target = event.target;
725
814
  const label = target.closest("[data-preview-item]")?.getAttribute("data-preview-item") ?? items.find((row) => row.label && target.textContent?.includes(row.label))?.label;
726
815
  if (!label) return;
727
816
  const index = items.findIndex((row) => row.label === label);
728
- if (index >= 0) setSelected(index);
817
+ if (index >= 0) {
818
+ setSelected(index);
819
+ setHoverItem(label);
820
+ }
729
821
  }
730
822
  const [themeCss, setThemeCss] = useState("");
823
+ const [lockup, setLockup] = useState(() => lockupSrc(identityFallback?.lockup, config.serverURL));
731
824
  useEffect(() => {
732
825
  let cancelled = false;
733
826
  fetch(`${endpoint}/globals/theme?depth=1`, { credentials: "include" }).then((response) => response.ok ? response.json() : null).then((doc) => {
734
- if (cancelled || !doc) return;
735
- setThemeCss(scopeThemeCss(themeHeadFromDoc(doc, THEME_SEED).css));
827
+ if (cancelled) return;
828
+ if (doc) setThemeCss(scopeThemeCss(themeHeadFromDoc(doc, THEME_SEED).css));
829
+ setLockup(lockupSrc(resolveThemeIdentity(doc, identityFallback).lockup, config.serverURL));
736
830
  }).catch(() => void 0);
737
831
  return () => {
738
832
  cancelled = true;
739
833
  };
740
- }, [endpoint]);
834
+ }, [
835
+ config.serverURL,
836
+ endpoint,
837
+ identityFallback
838
+ ]);
839
+ const ctaHref = resolveAdminPreviewLink(cta, pages);
741
840
  return /* @__PURE__ */ jsxs("div", {
742
841
  className: "bl-nav-items field-type",
743
842
  children: [
@@ -751,157 +850,134 @@ const NavItemsField = ({ field, path, readOnly }) => {
751
850
  precedence: "default",
752
851
  children: themeCss
753
852
  }) : null,
754
- /* @__PURE__ */ jsxs("aside", {
755
- className: "bl-nav-items__rail",
756
- children: [
757
- /* @__PURE__ */ jsxs("div", {
758
- className: "bl-nav-items__rail-head",
759
- children: [/* @__PURE__ */ jsx("p", {
760
- className: "bl-nav-items__kicker",
761
- children: "Header navigation"
762
- }), /* @__PURE__ */ jsx("h2", { children: "Menu items" })]
763
- }),
764
- /* @__PURE__ */ jsx("ul", {
765
- className: "bl-nav-items__list",
766
- "aria-label": "Menu items",
767
- children: items.map((row, index) => /* @__PURE__ */ jsxs("li", {
768
- "data-selected": index === selected ? "true" : "false",
769
- children: [/* @__PURE__ */ jsxs("div", {
770
- className: "bl-nav-items__rail-row",
771
- children: [
772
- /* @__PURE__ */ jsx("span", {
773
- className: "bl-nav-items__badge",
774
- "data-kind": row.blockType,
775
- "aria-hidden": true,
776
- children: row.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MegaGlyph, {}) : /* @__PURE__ */ jsx(LinkGlyph, {})
777
- }),
778
- /* @__PURE__ */ jsx("button", {
779
- type: "button",
780
- className: "bl-nav-items__rail-label",
781
- onClick: () => setSelected(index),
782
- children: row.label || "Untitled"
783
- }),
784
- readOnly ? null : /* @__PURE__ */ jsxs("div", {
785
- className: "bl-nav-items__menu",
786
- children: [/* @__PURE__ */ jsx("button", {
787
- type: "button",
788
- "aria-label": `${row.label || "Item"} actions`,
789
- onClick: () => setMenu(menu === index ? null : index),
790
- children: "⋯"
791
- }), menu === index ? /* @__PURE__ */ jsxs("div", {
792
- className: "bl-nav-items__menu-pop",
793
- children: [
794
- /* @__PURE__ */ jsx("button", {
795
- type: "button",
796
- disabled: index === 0,
797
- onClick: () => {
798
- moveFieldRow({
799
- path,
800
- moveFromIndex: index,
801
- moveToIndex: index - 1
802
- });
803
- setSelected(index - 1);
804
- setMenu(null);
805
- },
806
- children: "Move up"
807
- }),
808
- /* @__PURE__ */ jsx("button", {
809
- type: "button",
810
- disabled: index === items.length - 1,
811
- onClick: () => {
812
- moveFieldRow({
813
- path,
814
- moveFromIndex: index,
815
- moveToIndex: index + 1
816
- });
817
- setSelected(index + 1);
818
- setMenu(null);
819
- },
820
- children: "Move down"
821
- }),
822
- /* @__PURE__ */ jsx("button", {
823
- type: "button",
824
- className: "bl-nav-kit__danger",
825
- onClick: () => {
826
- removeFieldRow({
827
- path,
828
- rowIndex: index
829
- });
830
- setMenu(null);
831
- },
832
- children: "Delete"
833
- })
834
- ]
835
- }) : null]
836
- })
837
- ]
838
- }), index === selected ? /* @__PURE__ */ jsxs("div", {
839
- className: "bl-nav-items__rail-edit",
840
- children: [/* @__PURE__ */ jsxs(TypeCards, {
841
- compact: true,
842
- children: [/* @__PURE__ */ jsx(TypeCard, {
843
- icon: /* @__PURE__ */ jsx(LinkGlyph, {}),
844
- label: "Link",
845
- onClick: () => requestType("navLink")
846
- }), /* @__PURE__ */ jsx(TypeCard, {
847
- icon: /* @__PURE__ */ jsx(MegaGlyph, {}),
848
- label: "Mega",
849
- onClick: () => requestType("megaMenu")
850
- })]
851
- }), /* @__PURE__ */ jsx(ItemBasics, {
852
- path,
853
+ /* @__PURE__ */ jsxs(ItemRail, { children: [/* @__PURE__ */ jsxs("div", {
854
+ className: "bl-nav-items__rail-body",
855
+ children: [/* @__PURE__ */ jsx("ul", {
856
+ className: "bl-nav-items__list",
857
+ "aria-label": "Menu items",
858
+ children: items.map((row, index) => /* @__PURE__ */ jsxs("li", {
859
+ "data-selected": index === selected ? "true" : "false",
860
+ children: [/* @__PURE__ */ jsxs("div", {
861
+ className: "bl-nav-items__rail-row",
862
+ children: [
863
+ /* @__PURE__ */ jsx("span", {
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
+ }),
869
+ /* @__PURE__ */ jsx("button", {
870
+ type: "button",
871
+ className: "bl-nav-items__rail-label",
872
+ onClick: () => setSelected(index),
873
+ children: row.label || "Untitled"
874
+ }),
875
+ readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
876
+ label: row.label || "Item",
853
877
  index,
854
- readOnly
878
+ count: items.length,
879
+ path,
880
+ onMoved: (to) => setSelected(to)
881
+ })
882
+ ]
883
+ }), index === selected ? /* @__PURE__ */ jsxs("div", {
884
+ className: "bl-nav-items__rail-edit",
885
+ children: [/* @__PURE__ */ jsxs(TypeCards, {
886
+ compact: true,
887
+ children: [/* @__PURE__ */ jsx(TypeCard, {
888
+ icon: /* @__PURE__ */ jsx(LinkGlyph, {}),
889
+ label: "Link",
890
+ active: row.blockType === "navLink",
891
+ onClick: () => requestType("navLink")
892
+ }), /* @__PURE__ */ jsx(TypeCard, {
893
+ icon: /* @__PURE__ */ jsx(MegaGlyph, {}),
894
+ label: "Mega",
895
+ active: row.blockType === "megaMenu",
896
+ onClick: () => requestType("megaMenu")
855
897
  })]
856
- }) : null]
857
- }, String(row.id ?? index)))
858
- }),
859
- readOnly ? null : /* @__PURE__ */ jsx("button", {
860
- type: "button",
861
- className: "bl-nav-items__add",
862
- onClick: () => setAdding(true),
863
- children: "Add item"
864
- })
865
- ]
866
- }),
867
- /* @__PURE__ */ jsxs("div", {
868
- className: "bl-nav-items__main",
869
- children: [
870
- /* @__PURE__ */ jsx("div", {
871
- className: "bl-nav-items__sentinel",
872
- "data-testid": "nav-items-preview-sentinel",
873
- ref: sentinel,
874
- "aria-hidden": true
875
- }),
876
- /* @__PURE__ */ jsx("div", {
877
- "data-preview-chrome": true,
878
- "data-sticky": "true",
898
+ }), /* @__PURE__ */ jsx(ItemBasics, {
899
+ path,
900
+ index,
901
+ readOnly
902
+ })]
903
+ }) : null]
904
+ }, String(row.id ?? index)))
905
+ }), readOnly ? null : /* @__PURE__ */ jsx("button", {
906
+ type: "button",
907
+ className: "bl-nav-items__add",
908
+ onClick: () => setAdding(true),
909
+ children: "Add item"
910
+ })]
911
+ }), /* @__PURE__ */ jsx(RailSlot, { children: /* @__PURE__ */ jsx(HeaderCta, {
912
+ path: ctaPath,
913
+ readOnly
914
+ }) })] }),
915
+ /* @__PURE__ */ jsxs(Canvas, { children: [
916
+ current?.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MainHead, {
917
+ kicker: "Editing mega menu",
918
+ title: current.label || "Menu items",
919
+ description: "Configure the dropdown layout, sections, links, and footer."
920
+ }) : items.length === 0 ? /* @__PURE__ */ jsx(MainHead, {
921
+ kicker: "Header",
922
+ title: "Menu items",
923
+ description: "Add a link or a mega menu to start the header."
924
+ }) : null,
925
+ /* @__PURE__ */ jsxs("div", {
926
+ className: "bl-nav-items__preview-block",
927
+ "data-preview-chrome": true,
928
+ "data-sticky": "true",
929
+ "data-theme": previewDark ? "dark" : "light",
930
+ onClick: onPreviewClick,
931
+ onMouseLeave: (event) => {
932
+ const next = event.relatedTarget;
933
+ if (next instanceof Node && event.currentTarget.contains(next)) return;
934
+ setHoverItem(null);
935
+ },
936
+ children: [/* @__PURE__ */ jsx("div", {
879
937
  className: "bl-nav-items__preview",
880
- onClick: onPreviewClick,
881
- children: /* @__PURE__ */ jsx(FloatingNavBlock, {
882
- items: previewItems,
883
- hideOnScroll: false,
884
- breakpoint: "lg",
938
+ children: /* @__PURE__ */ jsx(PreviewNav, {
939
+ items: items.filter((row) => row.label).map((row) => {
940
+ const mapped = previewItems.find((item) => item.label === row.label);
941
+ return {
942
+ label: row.label,
943
+ href: mapped?.href ?? resolveAdminPreviewLink(row, pages) ?? void 0,
944
+ content: row.blockType === "megaMenu" ? true : mapped?.content,
945
+ items: mapped?.items
946
+ };
947
+ }),
948
+ lockup,
949
+ onLockupError: () => setLockup(null),
950
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PreviewThemeToggle, {
951
+ dark: previewDark,
952
+ onToggle: () => setPreviewDark((next) => !next)
953
+ }), ctaOn && ctaHref && cta.label ? /* @__PURE__ */ jsx("a", {
954
+ href: ctaHref,
955
+ className: "bl-nav-items__preview-cta",
956
+ children: cta.label
957
+ }) : null] }),
885
958
  openItem,
886
- className: "bl-nav-items__bar"
959
+ onItemEnter: (label) => setHoverItem(label)
887
960
  })
888
- }),
889
- current?.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MegaEditor, {
890
- path,
891
- index: selected,
892
- panel: current.panel ?? emptyPanel(),
893
- readOnly: Boolean(readOnly),
894
- onColumns: setColumns,
895
- onPanel: setPanel
896
- }) : current ? /* @__PURE__ */ jsx("p", {
897
- className: "bl-nav-items__empty",
898
- children: "A plain link is edited in the rail: label, destination, and new tab."
899
- }) : /* @__PURE__ */ jsx("p", {
900
- className: "bl-nav-items__empty",
901
- children: "Add a link or a mega menu to start the header."
902
- })
903
- ]
904
- }),
961
+ }), openRow ? /* @__PURE__ */ jsx("div", {
962
+ className: "bl-nav-items__preview-stage",
963
+ "data-testid": "nav-items-preview-mega",
964
+ onMouseEnter: () => openItem && setHoverItem(openItem),
965
+ children: /* @__PURE__ */ jsx(PreviewMega, {
966
+ row: openRow,
967
+ pages
968
+ })
969
+ }) : null]
970
+ }),
971
+ current?.blockType === "megaMenu" ? /* @__PURE__ */ jsx(MegaEditor, {
972
+ path,
973
+ index: selected,
974
+ panel: current.panel ?? emptyPanel(),
975
+ readOnly: Boolean(readOnly)
976
+ }) : items.length === 0 ? /* @__PURE__ */ jsx("p", {
977
+ className: "bl-nav-items__empty",
978
+ children: "Add a link or a mega menu to start the header."
979
+ }) : null
980
+ ] }),
905
981
  adding ? /* @__PURE__ */ jsx("div", {
906
982
  className: "bl-nav-kit__modal",
907
983
  role: "dialog",
@@ -945,6 +1021,224 @@ const NavItemsField = ({ field, path, readOnly }) => {
945
1021
  ]
946
1022
  });
947
1023
  };
1024
+ function PreviewThemeToggle({ dark, onToggle }) {
1025
+ return /* @__PURE__ */ jsx("button", {
1026
+ type: "button",
1027
+ className: "bl-nav-items__preview-theme",
1028
+ "aria-label": dark ? "Switch to light mode" : "Switch to dark mode",
1029
+ onClick: (event) => {
1030
+ event.stopPropagation();
1031
+ onToggle();
1032
+ },
1033
+ children: dark ? /* @__PURE__ */ jsx("svg", {
1034
+ viewBox: "0 0 24 24",
1035
+ width: "18",
1036
+ height: "18",
1037
+ fill: "none",
1038
+ stroke: "currentColor",
1039
+ strokeWidth: "2",
1040
+ "aria-hidden": true,
1041
+ children: /* @__PURE__ */ jsx("path", { d: "M21 14.5A8.5 8.5 0 1 1 9.5 3 7 7 0 0 0 21 14.5z" })
1042
+ }) : /* @__PURE__ */ jsxs("svg", {
1043
+ viewBox: "0 0 24 24",
1044
+ width: "18",
1045
+ height: "18",
1046
+ fill: "none",
1047
+ stroke: "currentColor",
1048
+ strokeWidth: "2",
1049
+ "aria-hidden": true,
1050
+ children: [/* @__PURE__ */ jsx("circle", {
1051
+ cx: "12",
1052
+ cy: "12",
1053
+ r: "4"
1054
+ }), /* @__PURE__ */ jsx("path", { d: "M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M18.4 5.6 17 7M7 17l-1.4 1.4" })]
1055
+ })
1056
+ });
1057
+ }
1058
+ /**
1059
+ * Kit island, not `FloatingNavBlock`. Payload admin does not load the
1060
+ * site Tailwind preset or `BisonProvider`; the live block (and
1061
+ * `ThemeToggle`) throw or render unstyled there. Theme Identity still
1062
+ * comes from `/api/globals/theme`. The public header stays
1063
+ * `headerFromNavigation` → `FloatingNavBlock` (SPI-99).
1064
+ */
1065
+ function PreviewNav({ items, lockup, onLockupError, actions, openItem, onItemEnter }) {
1066
+ return /* @__PURE__ */ jsxs("nav", {
1067
+ "aria-label": "Main",
1068
+ className: "bl-nav-items__preview-nav",
1069
+ "data-open-item": openItem ?? "",
1070
+ "data-has-logo": lockup ? "yes" : "no",
1071
+ "data-has-actions": actions ? "yes" : "no",
1072
+ children: [
1073
+ /* @__PURE__ */ jsx("div", {
1074
+ className: "bl-nav-items__preview-logo",
1075
+ children: lockup ? /* @__PURE__ */ jsx("img", {
1076
+ src: lockup.url,
1077
+ alt: lockup.alt,
1078
+ height: 20,
1079
+ onError: onLockupError
1080
+ }) : null
1081
+ }),
1082
+ /* @__PURE__ */ jsx("div", {
1083
+ className: "bl-nav-items__preview-links",
1084
+ children: items.map((item) => /* @__PURE__ */ jsxs("button", {
1085
+ type: "button",
1086
+ className: openItem === item.label ? "bl-nav-items__preview-link is-open" : "bl-nav-items__preview-link",
1087
+ "data-preview-item": item.label,
1088
+ "data-href": item.href ?? "",
1089
+ "aria-label": `Preview ${item.label}`,
1090
+ onMouseEnter: () => onItemEnter?.(item.label),
1091
+ children: [item.label, item.content || item.items?.length ? /* @__PURE__ */ jsx("span", {
1092
+ "aria-hidden": true,
1093
+ children: openItem === item.label ? " ⌃" : " ▾"
1094
+ }) : null]
1095
+ }, item.label))
1096
+ }),
1097
+ /* @__PURE__ */ jsx("div", {
1098
+ className: "bl-nav-items__preview-actions",
1099
+ children: actions
1100
+ })
1101
+ ]
1102
+ });
1103
+ }
1104
+ const PREVIEW_MAX_WIDTH = {
1105
+ narrow: "22rem",
1106
+ standard: "42rem",
1107
+ wide: "48rem"
1108
+ };
1109
+ function PreviewMega({ row, pages }) {
1110
+ const panel = row.panel;
1111
+ const columns = panel?.columns ?? [];
1112
+ const maxWidth = PREVIEW_MAX_WIDTH[panel?.maxWidth ?? "standard"] ?? PREVIEW_MAX_WIDTH.standard;
1113
+ const complete = columns.some((column) => (column.sections ?? []).some((section) => (section.links ?? []).some((link) => {
1114
+ const item = link;
1115
+ return Boolean(item.label && resolveAdminPreviewLink(item, pages));
1116
+ })));
1117
+ const overview = panel?.footer?.overview;
1118
+ const cta = panel?.footer?.cta;
1119
+ const overviewHref = overview ? resolveAdminPreviewLink(overview, pages) : null;
1120
+ const ctaHref = cta ? resolveAdminPreviewLink(cta, pages) : null;
1121
+ const showFooter = Boolean(overview?.label && overviewHref || cta?.label && ctaHref);
1122
+ return /* @__PURE__ */ jsxs("div", {
1123
+ className: "bl-nav-items__mega-preview",
1124
+ style: { maxWidth },
1125
+ children: [complete ? /* @__PURE__ */ jsx("div", {
1126
+ className: "bl-nav-items__preview-columns",
1127
+ style: { gridTemplateColumns: columns.map((column) => `${Math.max(1, Number(column.width) || 1)}fr`).join(" ") },
1128
+ 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",
1130
+ children: (column.sections ?? []).map((section, sectionIndex) => {
1131
+ const links = (section.links ?? []).flatMap((link, linkIndex) => {
1132
+ const item = link;
1133
+ const href = resolveAdminPreviewLink(item, pages);
1134
+ if (!item.label || !href) return [];
1135
+ const featured = section.display === "featured";
1136
+ return [/* @__PURE__ */ jsx("div", {
1137
+ className: featured ? "bl-nav-items__preview-featured" : "bl-nav-items__preview-list-row",
1138
+ children: featured ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
1139
+ className: "title",
1140
+ children: item.label
1141
+ }), item.description ? /* @__PURE__ */ jsx("small", { children: item.description }) : null] }) : /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: item.label }), item.description ? /* @__PURE__ */ jsx("small", { children: item.description }) : null] })
1142
+ }, `${sectionIndex}-${linkIndex}`)];
1143
+ });
1144
+ return /* @__PURE__ */ jsxs("div", { children: [section.eyebrow ? /* @__PURE__ */ jsx("div", {
1145
+ className: "bl-nav-items__preview-eyebrow",
1146
+ children: section.eyebrow
1147
+ }) : null, links.length ? links : /* @__PURE__ */ jsx("div", {
1148
+ className: "bl-nav-items__preview-empty",
1149
+ children: "Empty section"
1150
+ })] }, sectionIndex);
1151
+ })
1152
+ }, columnIndex))
1153
+ }) : /* @__PURE__ */ jsx("div", {
1154
+ className: "bl-nav-items__preview-empty",
1155
+ children: "No complete links in this menu yet."
1156
+ }), showFooter ? /* @__PURE__ */ jsxs("div", {
1157
+ className: "bl-nav-items__preview-footer",
1158
+ children: [overview?.label && overviewHref ? /* @__PURE__ */ jsx("a", {
1159
+ href: overviewHref,
1160
+ children: overview.label
1161
+ }) : /* @__PURE__ */ jsx("span", {}), cta?.label && ctaHref ? /* @__PURE__ */ jsx("span", {
1162
+ className: "cta",
1163
+ children: cta.label
1164
+ }) : null]
1165
+ }) : null]
1166
+ });
1167
+ }
1168
+ function HeaderCta({ path, readOnly }) {
1169
+ const group = useField({ path });
1170
+ const enabled = useField({ path: `${path}.enabled` });
1171
+ const label = useField({ path: `${path}.label` });
1172
+ const page = useField({ path: `${path}.page` });
1173
+ const href = useField({ path: `${path}.href` });
1174
+ const newTab = useField({ path: `${path}.newTab` });
1175
+ const on = enabled.value === true || enabled.value !== false && Boolean(label.value || page.value || href.value);
1176
+ function setEnabled(next) {
1177
+ enabled.setValue(next);
1178
+ if (!next) {
1179
+ label.setValue("");
1180
+ page.setValue(null);
1181
+ href.setValue(null);
1182
+ newTab.setValue(false);
1183
+ }
1184
+ }
1185
+ return /* @__PURE__ */ jsxs("fieldset", {
1186
+ className: "bl-nav-items__header-cta",
1187
+ "aria-label": "Header button",
1188
+ children: [
1189
+ /* @__PURE__ */ jsx("div", {
1190
+ className: "bl-nav-items__header-cta-head",
1191
+ children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: "Header button" }), /* @__PURE__ */ jsx("p", { children: "The pill on the right of the bar." })] })
1192
+ }),
1193
+ /* @__PURE__ */ jsxs("label", {
1194
+ className: "bl-nav-items__check bl-nav-items__header-cta-toggle",
1195
+ children: [/* @__PURE__ */ jsx("input", {
1196
+ type: "checkbox",
1197
+ checked: on,
1198
+ disabled: readOnly,
1199
+ onChange: (event) => setEnabled(event.target.checked)
1200
+ }), "Show Header button"]
1201
+ }),
1202
+ on ? /* @__PURE__ */ jsxs(Fragment, { children: [
1203
+ /* @__PURE__ */ jsxs("label", {
1204
+ className: "bl-nav-items__field",
1205
+ children: [/* @__PURE__ */ jsxs("span", { children: [
1206
+ "Label",
1207
+ " ",
1208
+ /* @__PURE__ */ jsx("span", {
1209
+ className: "bl-nav-items__req",
1210
+ "aria-hidden": true,
1211
+ children: "*"
1212
+ })
1213
+ ] }), /* @__PURE__ */ jsx("input", {
1214
+ value: label.value ?? "",
1215
+ disabled: readOnly,
1216
+ onChange: (event) => label.setValue(event.target.value)
1217
+ })]
1218
+ }),
1219
+ /* @__PURE__ */ jsx(ComposedLinkField, {
1220
+ path: `${path}._index-0`,
1221
+ parentPath: path,
1222
+ readOnly
1223
+ }),
1224
+ /* @__PURE__ */ jsxs("label", {
1225
+ className: "bl-nav-items__check",
1226
+ children: [/* @__PURE__ */ jsx("input", {
1227
+ type: "checkbox",
1228
+ checked: Boolean(newTab.value),
1229
+ disabled: readOnly,
1230
+ onChange: (event) => newTab.setValue(event.target.checked)
1231
+ }), "Open in a new tab"]
1232
+ })
1233
+ ] }) : null,
1234
+ /* @__PURE__ */ jsx(FieldError, {
1235
+ path: group.path,
1236
+ showError: group.showError,
1237
+ message: group.errorMessage
1238
+ })
1239
+ ]
1240
+ });
1241
+ }
948
1242
  function ItemBasics({ path, index, readOnly }) {
949
1243
  const label = useField({ path: `${path}.${index}.label` });
950
1244
  const newTab = useField({ path: `${path}.${index}.newTab` });
@@ -976,278 +1270,562 @@ function ItemBasics({ path, index, readOnly }) {
976
1270
  ]
977
1271
  });
978
1272
  }
979
- function MegaEditor({ path, index, panel, readOnly, onColumns, onPanel }) {
1273
+ function MegaEditor({ path, index, panel, readOnly }) {
1274
+ const { addFieldRow } = useForm();
980
1275
  const columns = panel.columns ?? [];
981
1276
  const columnsError = useField({ path: `${path}.${index}.panel.columns` });
1277
+ const columnsPath = `${path}.${index}.panel.columns`;
1278
+ const maxWidth = useField({ path: `${path}.${index}.panel.maxWidth` });
982
1279
  return /* @__PURE__ */ jsxs("div", {
983
1280
  className: "bl-nav-items__mega",
984
1281
  children: [
985
- /* @__PURE__ */ jsxs("label", {
986
- className: "bl-nav-items__field",
987
- children: [/* @__PURE__ */ jsx("span", { children: "Dropdown width" }), /* @__PURE__ */ jsxs("select", {
988
- value: panel.maxWidth ?? "standard",
989
- disabled: readOnly,
990
- onChange: (event) => onPanel({ maxWidth: event.target.value }),
991
- children: [
992
- /* @__PURE__ */ jsx("option", {
993
- value: "narrow",
994
- children: "Narrow"
995
- }),
996
- /* @__PURE__ */ jsx("option", {
997
- value: "standard",
998
- children: "Standard"
999
- }),
1000
- /* @__PURE__ */ jsx("option", {
1001
- value: "wide",
1002
- children: "Wide"
1003
- })
1004
- ]
1282
+ /* @__PURE__ */ jsxs("div", {
1283
+ className: "bl-nav-items__builder-head",
1284
+ 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
+ className: "bl-nav-items__tool",
1286
+ children: ["Panel width", /* @__PURE__ */ jsxs("select", {
1287
+ "aria-label": "Panel width",
1288
+ value: maxWidth.value ?? panel.maxWidth ?? "standard",
1289
+ disabled: readOnly,
1290
+ onChange: (event) => maxWidth.setValue(event.target.value),
1291
+ children: [
1292
+ /* @__PURE__ */ jsx("option", {
1293
+ value: "narrow",
1294
+ children: "Narrow"
1295
+ }),
1296
+ /* @__PURE__ */ jsx("option", {
1297
+ value: "standard",
1298
+ children: "Standard"
1299
+ }),
1300
+ /* @__PURE__ */ jsx("option", {
1301
+ value: "wide",
1302
+ children: "Wide"
1303
+ })
1304
+ ]
1305
+ })]
1005
1306
  })]
1006
1307
  }),
1007
1308
  /* @__PURE__ */ jsx("div", {
1008
1309
  className: "bl-nav-items__columns",
1009
1310
  "data-testid": "nav-items-columns",
1010
1311
  style: { gridTemplateColumns: "repeat(2, minmax(0, 1fr))" },
1011
- children: columns.map((column, columnIndex) => /* @__PURE__ */ jsxs("fieldset", {
1012
- className: "bl-nav-items__column",
1013
- "aria-label": `Column ${columnIndex + 1}`,
1014
- children: [
1015
- /* @__PURE__ */ jsxs("legend", { children: ["Column ", columnIndex + 1] }),
1016
- /* @__PURE__ */ jsxs("div", {
1017
- className: "bl-nav-items__column-settings",
1018
- children: [/* @__PURE__ */ jsxs("label", {
1019
- className: "bl-nav-items__field",
1020
- children: [/* @__PURE__ */ jsx("span", { children: "Width" }), /* @__PURE__ */ jsx("select", {
1021
- value: column.width ?? "100",
1022
- disabled: readOnly,
1023
- onChange: (event) => onColumns(columns.map((row, i) => i === columnIndex ? {
1024
- ...row,
1025
- width: event.target.value
1026
- } : row)),
1027
- children: WIDTHS.map((width) => /* @__PURE__ */ jsxs("option", {
1028
- value: width,
1029
- children: [width, "%"]
1030
- }, width))
1031
- })]
1032
- }), columnIndex > 0 ? /* @__PURE__ */ jsxs("label", {
1033
- className: "bl-nav-items__check",
1034
- children: [/* @__PURE__ */ jsx("input", {
1035
- type: "checkbox",
1036
- checked: Boolean(column.divider),
1037
- disabled: readOnly,
1038
- onChange: (event) => onColumns(columns.map((row, i) => i === columnIndex ? {
1039
- ...row,
1040
- divider: event.target.checked
1041
- } : row))
1042
- }), "Draw a line on the left of this column"]
1043
- }) : null]
1044
- }),
1045
- (column.sections ?? []).map((section, sectionIndex) => /* @__PURE__ */ jsx(SectionEditor, {
1046
- path,
1047
- itemIndex: index,
1048
- columnIndex,
1049
- sectionIndex,
1050
- section,
1051
- readOnly,
1052
- onChange: (next) => onColumns(columns.map((row, i) => i === columnIndex ? {
1053
- ...row,
1054
- sections: (row.sections ?? []).map((entry, j) => j === sectionIndex ? next : entry)
1055
- } : row))
1056
- }, sectionIndex)),
1057
- readOnly || (column.sections?.length ?? 0) >= 8 ? null : /* @__PURE__ */ jsx("button", {
1058
- type: "button",
1059
- className: "bl-nav-items__add",
1060
- onClick: () => onColumns(columns.map((row, i) => i === columnIndex ? {
1061
- ...row,
1062
- sections: [...row.sections ?? [], emptySection()]
1063
- } : row)),
1064
- children: "Add section"
1065
- })
1066
- ]
1312
+ children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx(ColumnEditor, {
1313
+ path,
1314
+ itemIndex: index,
1315
+ columnIndex,
1316
+ column,
1317
+ readOnly,
1318
+ columnCount: columns.length
1067
1319
  }, columnIndex))
1068
1320
  }),
1069
1321
  readOnly || columns.length >= 4 ? null : /* @__PURE__ */ jsx("button", {
1070
1322
  type: "button",
1071
- className: "bl-nav-items__add",
1072
- onClick: () => onColumns([...columns, {
1073
- ...emptyColumn(),
1074
- width: "25"
1075
- }]),
1076
- children: "Add column"
1323
+ className: "bl-nav-items__add-column",
1324
+ onClick: () => {
1325
+ addFieldRow({
1326
+ path: columnsPath,
1327
+ schemaPath: columnsPath,
1328
+ subFieldState: {
1329
+ width: {
1330
+ value: "25",
1331
+ valid: true
1332
+ },
1333
+ divider: {
1334
+ value: true,
1335
+ valid: true
1336
+ }
1337
+ }
1338
+ });
1339
+ addFieldRow({
1340
+ path: `${columnsPath}.${columns.length}.sections`,
1341
+ schemaPath: `${columnsPath}.${columns.length}.sections`,
1342
+ subFieldState: {
1343
+ display: {
1344
+ value: "list",
1345
+ valid: true
1346
+ },
1347
+ hideDescriptionsOnMobile: {
1348
+ value: true,
1349
+ valid: true
1350
+ }
1351
+ }
1352
+ });
1353
+ },
1354
+ children: "+ Add column"
1077
1355
  }),
1078
1356
  /* @__PURE__ */ jsx(FieldError, {
1079
1357
  path: columnsError.path,
1080
1358
  showError: columnsError.showError,
1081
1359
  message: columnsError.errorMessage
1082
1360
  }),
1083
- /* @__PURE__ */ jsxs("div", {
1361
+ /* @__PURE__ */ jsxs("section", {
1084
1362
  className: "bl-nav-items__footer",
1085
- children: [/* @__PURE__ */ jsx("h3", { children: "Footer" }), /* @__PURE__ */ jsxs("div", {
1086
- className: "bl-nav-items__footer-grid",
1087
- children: [/* @__PURE__ */ jsxs("div", { children: [
1088
- /* @__PURE__ */ jsx("h4", { children: "Overview link" }),
1089
- /* @__PURE__ */ jsx(ComposedLinkField, {
1090
- path: `${path}.${index}.panel.footer.overview._index-0`,
1091
- parentPath: `${path}.${index}.panel.footer.overview`,
1092
- readOnly
1093
- }),
1094
- /* @__PURE__ */ jsxs("label", {
1095
- className: "bl-nav-items__field",
1096
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1097
- path: `${path}.${index}.panel.footer.overview.label`,
1363
+ children: [/* @__PURE__ */ jsx("div", {
1364
+ className: "bl-nav-items__footer-head",
1365
+ children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: "Footer" }), /* @__PURE__ */ jsx("p", { children: "Optional links displayed below the menu columns. The overview is the section’s own landing page so it stays reachable from the bar." })] })
1366
+ }), /* @__PURE__ */ jsxs("div", {
1367
+ className: "bl-nav-items__footer-body",
1368
+ children: [/* @__PURE__ */ jsxs("div", {
1369
+ className: "bl-nav-items__footer-card",
1370
+ children: [
1371
+ /* @__PURE__ */ jsx("h4", { children: "Overview link" }),
1372
+ /* @__PURE__ */ jsx(ComposedLinkField, {
1373
+ path: `${path}.${index}.panel.footer.overview._index-0`,
1374
+ parentPath: `${path}.${index}.panel.footer.overview`,
1098
1375
  readOnly
1099
- })]
1100
- })
1101
- ] }), /* @__PURE__ */ jsxs("div", { children: [
1102
- /* @__PURE__ */ jsx("h4", { children: "Call to action" }),
1103
- /* @__PURE__ */ jsx(ComposedLinkField, {
1104
- path: `${path}.${index}.panel.footer.cta._index-0`,
1105
- parentPath: `${path}.${index}.panel.footer.cta`,
1106
- readOnly
1107
- }),
1108
- /* @__PURE__ */ jsxs("label", {
1109
- className: "bl-nav-items__field",
1110
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1111
- path: `${path}.${index}.panel.footer.cta.label`,
1376
+ }),
1377
+ /* @__PURE__ */ jsxs("label", {
1378
+ className: "bl-nav-items__field",
1379
+ children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1380
+ path: `${path}.${index}.panel.footer.overview.label`,
1381
+ readOnly
1382
+ })]
1383
+ })
1384
+ ]
1385
+ }), /* @__PURE__ */ jsxs("div", {
1386
+ className: "bl-nav-items__footer-card",
1387
+ children: [
1388
+ /* @__PURE__ */ jsx("h4", { children: "Call to action" }),
1389
+ /* @__PURE__ */ jsx(ComposedLinkField, {
1390
+ path: `${path}.${index}.panel.footer.cta._index-0`,
1391
+ parentPath: `${path}.${index}.panel.footer.cta`,
1112
1392
  readOnly
1113
- })]
1114
- })
1115
- ] })]
1393
+ }),
1394
+ /* @__PURE__ */ jsxs("label", {
1395
+ className: "bl-nav-items__field",
1396
+ children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1397
+ path: `${path}.${index}.panel.footer.cta.label`,
1398
+ readOnly
1399
+ })]
1400
+ })
1401
+ ]
1402
+ })]
1116
1403
  })]
1117
1404
  })
1118
1405
  ]
1119
1406
  });
1120
1407
  }
1121
- function FooterText({ path, readOnly }) {
1122
- const field = useField({ path });
1123
- return /* @__PURE__ */ jsx("input", {
1124
- value: field.value ?? "",
1125
- disabled: readOnly,
1126
- onChange: (event) => field.setValue(event.target.value)
1408
+ function RowMenu({ label, index, count, path, allowRemove = true, onMoved }) {
1409
+ const [open, setOpen] = useState(false);
1410
+ const { moveFieldRow, removeFieldRow } = useForm();
1411
+ return /* @__PURE__ */ jsxs("div", {
1412
+ className: "bl-nav-items__menu",
1413
+ children: [/* @__PURE__ */ jsx("button", {
1414
+ type: "button",
1415
+ "aria-label": `${label} actions`,
1416
+ onClick: () => setOpen((next) => !next),
1417
+ children: "⋯"
1418
+ }), open ? /* @__PURE__ */ jsxs("div", {
1419
+ className: "bl-nav-items__menu-pop",
1420
+ children: [
1421
+ /* @__PURE__ */ jsx("button", {
1422
+ type: "button",
1423
+ disabled: index === 0,
1424
+ onClick: () => {
1425
+ moveFieldRow({
1426
+ path,
1427
+ moveFromIndex: index,
1428
+ moveToIndex: index - 1
1429
+ });
1430
+ onMoved?.(index - 1);
1431
+ setOpen(false);
1432
+ },
1433
+ children: "Move up"
1434
+ }),
1435
+ /* @__PURE__ */ jsx("button", {
1436
+ type: "button",
1437
+ disabled: index === count - 1,
1438
+ onClick: () => {
1439
+ moveFieldRow({
1440
+ path,
1441
+ moveFromIndex: index,
1442
+ moveToIndex: index + 1
1443
+ });
1444
+ onMoved?.(index + 1);
1445
+ setOpen(false);
1446
+ },
1447
+ children: "Move down"
1448
+ }),
1449
+ allowRemove ? /* @__PURE__ */ jsx("button", {
1450
+ type: "button",
1451
+ className: "bl-nav-kit__danger",
1452
+ onClick: () => {
1453
+ removeFieldRow({
1454
+ path,
1455
+ rowIndex: index
1456
+ });
1457
+ setOpen(false);
1458
+ },
1459
+ children: "Delete"
1460
+ }) : null
1461
+ ]
1462
+ }) : null]
1127
1463
  });
1128
1464
  }
1129
- function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, readOnly, onChange }) {
1130
- const links = section.links ?? [];
1465
+ function MegaLinkEditor({ path, arrayPath, index, count, label, readOnly }) {
1466
+ const description = useField({ path: `${path}.description` });
1467
+ const newTab = useField({ path: `${path}.newTab` });
1468
+ const name = label?.trim() || "Untitled";
1131
1469
  return /* @__PURE__ */ jsxs("div", {
1132
- className: "bl-nav-items__section",
1470
+ className: "bl-nav-items__link",
1133
1471
  children: [
1472
+ /* @__PURE__ */ jsxs("div", {
1473
+ className: "bl-nav-items__link-head",
1474
+ children: [/* @__PURE__ */ jsx("strong", { children: name }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1475
+ label: name,
1476
+ index,
1477
+ count,
1478
+ path: arrayPath
1479
+ })]
1480
+ }),
1134
1481
  /* @__PURE__ */ jsxs("label", {
1135
1482
  className: "bl-nav-items__field",
1136
- children: [/* @__PURE__ */ jsx("span", { children: "Eyebrow" }), /* @__PURE__ */ jsx("input", {
1137
- value: section.eyebrow ?? "",
1138
- disabled: readOnly,
1139
- onChange: (event) => onChange({
1140
- ...section,
1141
- eyebrow: event.target.value
1142
- })
1483
+ children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx(FooterText, {
1484
+ path: `${path}.label`,
1485
+ readOnly
1143
1486
  })]
1144
1487
  }),
1145
- /* @__PURE__ */ jsxs(TypeCards, {
1146
- compact: true,
1147
- children: [/* @__PURE__ */ jsx(TypeCard, {
1148
- label: "Featured",
1149
- active: section.display === "featured",
1150
- disabled: readOnly,
1151
- onClick: () => onChange({
1152
- ...section,
1153
- display: "featured"
1154
- })
1155
- }), /* @__PURE__ */ jsx(TypeCard, {
1156
- label: "List",
1157
- active: section.display !== "featured",
1488
+ /* @__PURE__ */ jsx(ComposedLinkField, {
1489
+ path: `${path}._index-0`,
1490
+ parentPath: path,
1491
+ readOnly
1492
+ }),
1493
+ /* @__PURE__ */ jsxs("label", {
1494
+ className: "bl-nav-items__field",
1495
+ children: [/* @__PURE__ */ jsx("span", { children: "Description" }), /* @__PURE__ */ jsx("textarea", {
1496
+ value: description.value ?? "",
1158
1497
  disabled: readOnly,
1159
- onClick: () => onChange({
1160
- ...section,
1161
- display: "list"
1162
- })
1498
+ rows: 2,
1499
+ onChange: (event) => description.setValue(event.target.value)
1163
1500
  })]
1164
1501
  }),
1165
1502
  /* @__PURE__ */ jsxs("label", {
1166
1503
  className: "bl-nav-items__check",
1167
1504
  children: [/* @__PURE__ */ jsx("input", {
1168
1505
  type: "checkbox",
1169
- checked: section.hideDescriptionsOnMobile !== false,
1506
+ checked: Boolean(newTab.value),
1170
1507
  disabled: readOnly,
1171
- onChange: (event) => onChange({
1172
- ...section,
1173
- hideDescriptionsOnMobile: event.target.checked
1508
+ onChange: (event) => newTab.setValue(event.target.checked)
1509
+ }), "Open in a new tab"]
1510
+ })
1511
+ ]
1512
+ });
1513
+ }
1514
+ function FooterText({ path, readOnly }) {
1515
+ const field = useField({ path });
1516
+ return /* @__PURE__ */ jsx("input", {
1517
+ value: field.value ?? "",
1518
+ disabled: readOnly,
1519
+ onChange: (event) => field.setValue(event.target.value)
1520
+ });
1521
+ }
1522
+ function ColumnEditor({ path, itemIndex, columnIndex, column, readOnly, columnCount }) {
1523
+ const { addFieldRow } = useForm();
1524
+ const width = useField({ path: `${path}.${itemIndex}.panel.columns.${columnIndex}.width` });
1525
+ const divider = useField({ path: `${path}.${itemIndex}.panel.columns.${columnIndex}.divider` });
1526
+ const columnsPath = `${path}.${itemIndex}.panel.columns`;
1527
+ const sectionsPath = `${path}.${itemIndex}.panel.columns.${columnIndex}.sections`;
1528
+ const sections = column.sections ?? [];
1529
+ const columnName = `Column ${columnIndex + 1}`;
1530
+ return /* @__PURE__ */ jsxs("section", {
1531
+ className: "bl-nav-items__column",
1532
+ role: "group",
1533
+ "aria-label": columnName,
1534
+ children: [/* @__PURE__ */ jsxs("div", {
1535
+ className: "bl-nav-items__column-head",
1536
+ children: [/* @__PURE__ */ jsxs("div", {
1537
+ className: "bl-nav-items__column-title",
1538
+ children: [
1539
+ columnName,
1540
+ " ",
1541
+ /* @__PURE__ */ jsxs("span", {
1542
+ className: "bl-nav-items__width-pill",
1543
+ children: [width.value ?? column.width ?? "100", "%"]
1174
1544
  })
1175
- }), "Hide descriptions on mobile"]
1176
- }),
1177
- links.map((link, linkIndex) => /* @__PURE__ */ jsxs("div", {
1178
- className: "bl-nav-items__link",
1179
- children: [/* @__PURE__ */ jsxs("label", {
1180
- className: "bl-nav-items__field",
1181
- children: [/* @__PURE__ */ jsx("span", { children: "Label" }), /* @__PURE__ */ jsx("input", {
1182
- value: String(link.label ?? ""),
1545
+ ]
1546
+ }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1547
+ label: columnName,
1548
+ index: columnIndex,
1549
+ count: columnCount,
1550
+ path: columnsPath,
1551
+ allowRemove: columnCount > 1
1552
+ })]
1553
+ }), /* @__PURE__ */ jsxs("div", {
1554
+ className: "bl-nav-items__column-body",
1555
+ children: [
1556
+ /* @__PURE__ */ jsxs("div", {
1557
+ className: columnIndex === 0 ? "bl-nav-items__column-settings is-first" : "bl-nav-items__column-settings",
1558
+ children: [/* @__PURE__ */ jsxs("label", { children: ["Width", /* @__PURE__ */ jsx("select", {
1559
+ value: width.value ?? column.width ?? "100",
1183
1560
  disabled: readOnly,
1184
- onChange: (event) => onChange({
1185
- ...section,
1186
- links: links.map((row, i) => i === linkIndex ? {
1187
- ...row,
1188
- label: event.target.value
1189
- } : row)
1190
- })
1191
- })]
1192
- }), /* @__PURE__ */ jsx(ComposedLinkField, {
1193
- path: `${path}.${itemIndex}.panel.columns.${columnIndex}.sections.${sectionIndex}.links.${linkIndex}._index-0`,
1194
- parentPath: `${path}.${itemIndex}.panel.columns.${columnIndex}.sections.${sectionIndex}.links.${linkIndex}`,
1561
+ onChange: (event) => width.setValue(event.target.value),
1562
+ children: WIDTHS.map((option) => /* @__PURE__ */ jsxs("option", {
1563
+ value: option,
1564
+ children: [option, "%"]
1565
+ }, option))
1566
+ })] }), columnIndex > 0 ? /* @__PURE__ */ jsxs("label", {
1567
+ className: "bl-nav-items__check",
1568
+ children: [/* @__PURE__ */ jsx("input", {
1569
+ type: "checkbox",
1570
+ checked: Boolean(divider.value ?? column.divider),
1571
+ disabled: readOnly,
1572
+ onChange: (event) => divider.setValue(event.target.checked)
1573
+ }), "Draw a line on the left"]
1574
+ }) : null]
1575
+ }),
1576
+ sections.map((section, sectionIndex) => /* @__PURE__ */ jsx(SectionEditor, {
1577
+ path,
1578
+ itemIndex,
1579
+ columnIndex,
1580
+ sectionIndex,
1581
+ section,
1582
+ readOnly,
1583
+ sectionCount: sections.length
1584
+ }, sectionIndex)),
1585
+ readOnly || sections.length >= 8 ? null : /* @__PURE__ */ jsx("button", {
1586
+ type: "button",
1587
+ className: "bl-nav-items__add-section",
1588
+ onClick: () => addFieldRow({
1589
+ path: sectionsPath,
1590
+ schemaPath: sectionsPath,
1591
+ subFieldState: {
1592
+ display: {
1593
+ value: "list",
1594
+ valid: true
1595
+ },
1596
+ hideDescriptionsOnMobile: {
1597
+ value: true,
1598
+ valid: true
1599
+ }
1600
+ }
1601
+ }),
1602
+ children: "+ Add section to this column"
1603
+ })
1604
+ ]
1605
+ })]
1606
+ });
1607
+ }
1608
+ function SectionEditor({ path, itemIndex, columnIndex, sectionIndex, section, readOnly, sectionCount }) {
1609
+ const { addFieldRow } = useForm();
1610
+ const base = `${path}.${itemIndex}.panel.columns.${columnIndex}.sections.${sectionIndex}`;
1611
+ const sectionsPath = `${path}.${itemIndex}.panel.columns.${columnIndex}.sections`;
1612
+ const display = useField({ path: `${base}.display` });
1613
+ const eyebrow = useField({ path: `${base}.eyebrow` });
1614
+ const hideMobile = useField({ path: `${base}.hideDescriptionsOnMobile` });
1615
+ const links = section.links ?? [];
1616
+ const featured = (display.value ?? section.display) === "featured";
1617
+ const sectionName = eyebrow.value || section.eyebrow || "Untitled section";
1618
+ return /* @__PURE__ */ jsxs("div", {
1619
+ className: "bl-nav-items__section",
1620
+ children: [
1621
+ /* @__PURE__ */ jsxs("div", {
1622
+ className: "bl-nav-items__section-head",
1623
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: sectionName }), /* @__PURE__ */ jsx("small", { children: featured ? "featured" : "list" })] }), readOnly ? null : /* @__PURE__ */ jsx(RowMenu, {
1624
+ label: sectionName,
1625
+ index: sectionIndex,
1626
+ count: sectionCount,
1627
+ path: sectionsPath
1628
+ })]
1629
+ }),
1630
+ /* @__PURE__ */ jsxs("div", {
1631
+ className: "bl-nav-items__section-settings",
1632
+ children: [
1633
+ /* @__PURE__ */ jsxs("label", {
1634
+ className: "bl-nav-items__field",
1635
+ children: [/* @__PURE__ */ jsx("span", { children: "Eyebrow" }), /* @__PURE__ */ jsx("input", {
1636
+ value: eyebrow.value ?? section.eyebrow ?? "",
1637
+ disabled: readOnly,
1638
+ placeholder: "Optional heading",
1639
+ onChange: (event) => eyebrow.setValue(event.target.value)
1640
+ })]
1641
+ }),
1642
+ /* @__PURE__ */ jsxs("div", {
1643
+ className: "bl-nav-items__field",
1644
+ children: [/* @__PURE__ */ jsx("span", { children: "Display" }), /* @__PURE__ */ jsxs("div", {
1645
+ className: "bl-nav-items__seg",
1646
+ children: [/* @__PURE__ */ jsx("button", {
1647
+ type: "button",
1648
+ className: featured ? "is-active" : void 0,
1649
+ disabled: readOnly,
1650
+ onClick: () => display.setValue("featured"),
1651
+ children: "Featured"
1652
+ }), /* @__PURE__ */ jsx("button", {
1653
+ type: "button",
1654
+ className: !featured ? "is-active" : void 0,
1655
+ disabled: readOnly,
1656
+ onClick: () => display.setValue("list"),
1657
+ children: "List"
1658
+ })]
1659
+ })]
1660
+ }),
1661
+ /* @__PURE__ */ jsxs("label", {
1662
+ className: "bl-nav-items__check",
1663
+ children: [/* @__PURE__ */ jsx("input", {
1664
+ type: "checkbox",
1665
+ checked: (hideMobile.value ?? section.hideDescriptionsOnMobile) !== false,
1666
+ disabled: readOnly,
1667
+ onChange: (event) => hideMobile.setValue(event.target.checked)
1668
+ }), "Hide descriptions on mobile"]
1669
+ })
1670
+ ]
1671
+ }),
1672
+ /* @__PURE__ */ jsxs("div", {
1673
+ className: "bl-nav-items__links",
1674
+ children: [links.map((link, linkIndex) => /* @__PURE__ */ jsx(MegaLinkEditor, {
1675
+ path: `${base}.links.${linkIndex}`,
1676
+ arrayPath: `${base}.links`,
1677
+ index: linkIndex,
1678
+ count: links.length,
1679
+ label: link.label,
1195
1680
  readOnly
1681
+ }, linkIndex)), readOnly ? null : /* @__PURE__ */ jsx("button", {
1682
+ type: "button",
1683
+ className: "bl-nav-items__inline-add",
1684
+ onClick: () => addFieldRow({
1685
+ path: `${base}.links`,
1686
+ schemaPath: `${base}.links`,
1687
+ subFieldState: {
1688
+ label: {
1689
+ value: "New link",
1690
+ valid: true
1691
+ },
1692
+ type: {
1693
+ value: "page",
1694
+ valid: true
1695
+ }
1696
+ }
1697
+ }),
1698
+ children: "+ Add link"
1196
1699
  })]
1197
- }, linkIndex)),
1198
- readOnly ? null : /* @__PURE__ */ jsx("button", {
1199
- type: "button",
1200
- className: "bl-nav-items__add",
1201
- onClick: () => onChange({
1202
- ...section,
1203
- links: [...links, {
1204
- label: "New link",
1205
- type: "page",
1206
- page: null,
1207
- href: null
1208
- }]
1209
- }),
1210
- children: "Add link"
1211
1700
  })
1212
1701
  ]
1213
1702
  });
1214
1703
  }
1215
1704
  const CSS = `
1216
- .bl-nav-items{display:grid;grid-template-columns:minmax(16rem,20rem) minmax(0,1fr);gap:0;border:1px solid var(--theme-elevation-150);border-radius:var(--style-radius-s);background:var(--theme-elevation-0);color:var(--theme-elevation-800);font-family:var(--font-body)}
1217
- .bl-nav-items__rail{border-right:1px solid var(--theme-elevation-150);padding:1rem;min-width:0}
1218
- .bl-nav-items__rail-head h2{margin:.15rem 0 0;font-size:14px}
1219
- .bl-nav-items__kicker{margin:0;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--theme-elevation-500)}
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}
1707
+ .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
+ .bl-nav-items__rail-body{padding:12px;flex:1;min-height:0;overflow:auto}
1710
+ .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
+ .bl-nav-items__header-cta{margin:0;padding:0;border:0;min-width:0}
1712
+ .bl-nav-items__header-cta-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:10px}
1713
+ .bl-nav-items__header-cta-head h3{margin:0;font-size:14px}
1714
+ .bl-nav-items__header-cta-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
1715
+ .bl-nav-items__req{color:var(--pink)}
1220
1716
  .bl-nav-items__list{list-style:none;margin:0;padding:0}
1221
- .bl-nav-items__list li{border:1px solid transparent;border-radius:8px;margin:.4rem 0}
1222
- .bl-nav-items__list li[data-selected="true"]{border-color:var(--theme-elevation-250);background:var(--theme-elevation-50)}
1223
- .bl-nav-items__rail-row{display:grid;grid-template-columns:28px 1fr auto;gap:.5rem;align-items:center;padding:.5rem}
1717
+ .bl-nav-items__list li{border:1px solid transparent;border-radius:9px;margin-bottom:7px}
1718
+ .bl-nav-items__list li[data-selected="true"]{border-color:#414550;background:#1b1d22}
1719
+ .bl-nav-items__rail-row{display:grid;grid-template-columns:20px 1fr auto;gap:8px;align-items:center;padding:6px 8px}
1224
1720
  .bl-nav-items__rail-label{border:0;background:transparent;text-align:left;font:inherit;font-weight:650;color:inherit;cursor:pointer;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1225
- .bl-nav-items__badge{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;background:var(--theme-elevation-100);color:var(--theme-elevation-600)}
1226
- .bl-nav-items__badge[data-kind="megaMenu"]{background:color-mix(in srgb,var(--brand-primary,var(--theme-success-500)) 16%,var(--theme-elevation-50));color:var(--brand-primary,var(--theme-success-500))}
1227
- .bl-nav-items__rail-edit{padding:0 .6rem .75rem}
1228
- .bl-nav-items__add{width:100%;margin-top:.6rem;border:1px dashed var(--theme-elevation-250);background:transparent;border-radius:8px;padding:.65rem;color:var(--theme-elevation-700);cursor:pointer}
1229
- .bl-nav-items__main{min-width:0;padding:1rem 1.25rem 2rem}
1230
- .bl-nav-items__sentinel{height:1px}
1231
- .bl-nav-items__preview{position:sticky;top:0;z-index:5;background:var(--theme-elevation-0);padding:.75rem 0 1rem}
1232
- .bl-nav-items__bar{position:relative !important;inset:auto !important;pointer-events:auto !important;transform:none !important}
1233
- .bl-nav-items__columns{display:grid;gap:.75rem;align-items:start}
1234
- .bl-nav-items__column{border:1px solid var(--theme-elevation-150);border-radius:10px;padding:.75rem;margin:0;min-width:0}
1235
- .bl-nav-items__column legend{font-weight:700;padding:0 .25rem}
1236
- .bl-nav-items__column-settings{display:grid;grid-template-columns:1fr auto;gap:.6rem;align-items:end;margin-bottom:.75rem}
1237
- .bl-nav-items__field{display:flex;flex-direction:column;gap:.35rem;font-size:12px;font-weight:700;margin:.5rem 0}
1238
- .bl-nav-items__field input,.bl-nav-items__field select{font:inherit;font-weight:400;padding:.5rem .6rem;border:1px solid var(--theme-elevation-150);border-radius:var(--style-radius-s);background:var(--theme-input-bg);color:inherit}
1239
- .bl-nav-items__check{display:flex;align-items:center;gap:.5rem;font-size:13px;font-weight:500}
1240
- .bl-nav-items__section,.bl-nav-items__link{border:1px solid var(--theme-elevation-100);border-radius:8px;padding:.6rem;margin:.5rem 0}
1241
- .bl-nav-items__footer{margin-top:1.25rem;border:1px solid var(--theme-elevation-150);border-radius:10px;padding:1rem}
1242
- .bl-nav-items__footer-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
1243
- .bl-nav-items__empty{color:var(--theme-elevation-500)}
1721
+ .bl-nav-items__badge{width:28px;height:28px;display:grid;place-items:center;border-radius:7px;background:#292c33;color:#c9ccd4}
1722
+ .bl-nav-items__badge[data-kind="megaMenu"]{background:#32142a;color:#ff91ce}
1723
+ .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%;border:1px dashed #3a3e47;background:transparent;border-radius:9px;padding:10px;color:#c6cad2;cursor:pointer}
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}
1726
+ .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
+ .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;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:flex-start}
1730
+ .bl-workspace__main-head h1{font-size:20px;margin:2px 0 4px}
1731
+ .bl-workspace__main-head p{margin:0;color:var(--muted)}
1732
+ .bl-nav-items__preview-block{position:sticky;top:0;z-index:20;background:transparent;padding:0;overflow:visible}
1733
+ .bl-nav-items__preview{padding:12px 0 0}
1734
+ .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
+ .bl-nav-items__preview-theme:hover{background:#24242b}
1736
+ .bl-nav-items__preview-block[data-theme="dark"] .bl-nav-items__preview-logo img{filter:invert(1) hue-rotate(180deg)}
1737
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-nav{background:rgba(255,255,255,.92);border-color:#d8dbe2}
1738
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-link{color:#1b1d22}
1739
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-link.is-open{background:#eceef2}
1740
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-theme{color:#1b1d22}
1741
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-theme:hover{background:#eceef2}
1742
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__mega-preview{background:#fff;color:#1b1d22}
1743
+ .bl-nav-items__preview-block[data-theme="light"] .bl-nav-items__preview-footer{background:#f4f5f7}
1744
+ .bl-nav-items__preview-stage{position:absolute;left:0;right:0;top:100%;z-index:21;padding:8px 0 0;pointer-events:auto}
1745
+ .bl-nav-items__mega-preview{margin:0 auto;background:#18191d;border:1px solid var(--line);border-radius:8px;box-shadow:0 12px 32px rgba(0,0,0,.4);overflow:hidden}
1746
+ .bl-nav-items__preview-columns{display:grid;gap:24px;padding:16px}
1747
+ .bl-nav-items__preview-col{padding:0;min-width:0}
1748
+ .bl-nav-items__preview-col.has-border{border-left:1px solid var(--line);padding-left:24px}
1749
+ .bl-nav-items__preview-eyebrow{font-size:12px;font-weight:650;color:#afb3bd;text-transform:uppercase;letter-spacing:.04em;margin:0 8px 8px}
1750
+ .bl-nav-items__preview-list-row{display:flex;gap:12px;align-items:flex-start;padding:8px}
1751
+ .bl-nav-items__preview-list-row strong{display:block}
1752
+ .bl-nav-items__preview-list-row small,.bl-nav-items__preview-featured small{display:block;color:#aeb2bc;margin-top:2px}
1753
+ .bl-nav-items__preview-featured{padding:12px}
1754
+ .bl-nav-items__preview-featured .title{font-size:16px;font-weight:650}
1755
+ .bl-nav-items__preview-empty{color:var(--muted);font-size:13px;padding:28px;text-align:center}
1756
+ .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
+ .bl-nav-items__preview-footer a{color:var(--pink2,#ff2da5);text-decoration:underline;text-underline-offset:2px;font-weight:650;font-size:13px}
1758
+ .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:flex;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)}
1760
+ .bl-nav-items__preview-logo{flex:1;min-width:0;display:flex;align-items:center}
1761
+ .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;flex:none}
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}
1764
+ .bl-nav-items__preview-link.is-open{background:#24242b}
1765
+ .bl-nav-items__preview-actions{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
1766
+ .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
+ .bl-nav-items__builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:26px 0 10px}
1768
+ .bl-nav-items__builder-head h2{font-size:18px;margin:0}
1769
+ .bl-nav-items__builder-head p{margin:3px 0 0;color:var(--muted);font-size:13px}
1770
+ .bl-nav-items__builder-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
1771
+ .bl-nav-items__tool{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
1772
+ .bl-nav-items__tool select{width:auto;min-width:160px;padding:8px 30px 8px 10px;background:#1d1f24;border:1px solid #3a3d46;border-radius:8px;color:#fff}
1773
+ .bl-nav-items__columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
1774
+ .bl-nav-items__columns:has(> :only-child){grid-template-columns:minmax(0,1fr)}
1775
+ .bl-nav-items__column{border:1px solid var(--line2);background:var(--panel);border-radius:12px;overflow:visible;margin:0;min-width:0;padding:0}
1776
+ .bl-nav-items__column-head{padding:12px 14px;background:#1b1d22;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
1777
+ .bl-nav-items__column-title{display:flex;align-items:center;gap:8px;font-weight:700}
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}
1787
+ .bl-nav-items__check{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:500;color:#d8dbe1}
1788
+ .bl-nav-items__header-cta .bl-nav-items__check{gap:16px}
1789
+ .bl-nav-items__header-cta-toggle{margin-bottom:20px}
1790
+ .bl-nav-items__check input{accent-color:var(--pink);margin:0;flex:none}
1791
+ .bl-nav-items__seg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
1792
+ .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
+ .bl-nav-items__seg button.is-active{border-color:var(--pink);background:#261722}
1794
+ .bl-nav-items__section{border:1px solid var(--line);background:#111216;border-radius:10px;margin-bottom:10px}
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}
1803
+ .bl-nav-items__footer,.bl-nav-items__panel{margin-top:18px;border:1px solid var(--line2);background:#141518;border-radius:12px;overflow:hidden}
1804
+ .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
+ .bl-nav-items__footer-head h3,.bl-nav-items__panel-head h3{margin:0;font-size:16px}
1806
+ .bl-nav-items__footer-head p,.bl-nav-items__panel-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
1807
+ .bl-nav-items__footer-body,.bl-nav-items__panel-body{padding:14px 16px}
1808
+ .bl-nav-items__footer-body{display:grid;grid-template-columns:1fr 1fr;gap:14px}
1809
+ .bl-nav-items__footer-card{background:#101115;border:1px solid var(--line);border-radius:10px;padding:14px}
1810
+ .bl-nav-items__footer-card h4{margin:0 0 12px;font-size:14px}
1811
+ .bl-nav-items__panel-body{max-width:480px}
1812
+ .bl-nav-items__empty{color:var(--muted);font-size:13px;padding:28px;text-align:center}
1244
1813
  .bl-nav-items__menu{position:relative}
1245
1814
  .bl-nav-items__menu > button{border:0;background:transparent;color:inherit;cursor:pointer}
1246
- .bl-nav-items__menu-pop{position:absolute;right:0;top:1.4rem;z-index:6;min-width:8rem;padding:.2rem;border:1px solid var(--theme-elevation-150);border-radius:8px;background:var(--theme-elevation-0);box-shadow:0 8px 24px var(--theme-overlay)}
1247
- .bl-nav-items__menu-pop button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.4rem .5rem;border-radius:6px;color:inherit;cursor:pointer}
1248
- @media(max-width:800px){.bl-nav-items{grid-template-columns:1fr}.bl-nav-items__footer-grid,.bl-nav-items__columns{grid-template-columns:minmax(0,1fr) !important}}
1815
+ .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
+ .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-size:12px;font-weight:700;margin:0 0 7px;color:var(--text)}
1818
+ .bl-nav-items .field-description,.bl-nav-items .field__description{display:none !important}
1819
+ .bl-nav-items .bl-link-field{margin:0 0 13px}
1820
+ .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
+ .bl-nav-items .bl-link-field__kind{background:#292c33;color:#c9ccd4;border-radius:999px;padding:3px 7px}
1822
+ .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
+ @media(max-width:1280px){.bl-nav-items{grid-template-columns:250px minmax(0,1fr)}}
1826
+ @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}}
1249
1827
  `;
1250
1828
  //#endregion
1251
- export { LinkField, MinRowsArrayField, NavItemsField };
1829
+ export { AdminWorkspace, LinkField, MinRowsArrayField, NavItemsField };
1252
1830
 
1253
1831
  //# sourceMappingURL=admin.mjs.map