@orion-studios/payload-studio 0.5.0-beta.78 → 0.5.0-beta.79

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.
@@ -32,7 +32,7 @@ __export(client_exports, {
32
32
  module.exports = __toCommonJS(client_exports);
33
33
 
34
34
  // src/studio-pages/builder/BuilderPageEditor.tsx
35
- var import_react6 = require("react");
35
+ var import_react5 = require("react");
36
36
 
37
37
  // src/blocks/blocks/sectionStyleFields.ts
38
38
  var sectionStyleDefaults = {
@@ -1564,57 +1564,6 @@ function usePersistentSidebarPanel(pageID) {
1564
1564
  };
1565
1565
  }
1566
1566
 
1567
- // src/studio-pages/builder/hooks/useSettingsPanelV2Flag.ts
1568
- var import_react3 = require("react");
1569
- function useSettingsPanelV2Flag({
1570
- featureFlag,
1571
- persistedFlagKey
1572
- }) {
1573
- const [settingsPanelV2Override, setSettingsPanelV2Override] = (0, import_react3.useState)(null);
1574
- (0, import_react3.useEffect)(() => {
1575
- const persistedValue = window.localStorage.getItem(persistedFlagKey);
1576
- if (persistedValue === "true") {
1577
- setSettingsPanelV2Override(true);
1578
- return;
1579
- }
1580
- if (persistedValue === "false") {
1581
- setSettingsPanelV2Override(false);
1582
- return;
1583
- }
1584
- setSettingsPanelV2Override(null);
1585
- }, [persistedFlagKey]);
1586
- (0, import_react3.useEffect)(() => {
1587
- if (typeof settingsPanelV2Override !== "boolean") {
1588
- window.localStorage.removeItem(persistedFlagKey);
1589
- return;
1590
- }
1591
- window.localStorage.setItem(persistedFlagKey, settingsPanelV2Override ? "true" : "false");
1592
- }, [persistedFlagKey, settingsPanelV2Override]);
1593
- const settingsPanelV2Enabled = (0, import_react3.useMemo)(() => {
1594
- if (typeof featureFlag === "boolean") {
1595
- return featureFlag;
1596
- }
1597
- if (typeof settingsPanelV2Override === "boolean") {
1598
- return settingsPanelV2Override;
1599
- }
1600
- if (typeof process !== "undefined") {
1601
- const envFlag = process.env.NEXT_PUBLIC_ORION_SETTINGS_PANEL_V2;
1602
- if (envFlag === "true") {
1603
- return true;
1604
- }
1605
- if (envFlag === "false") {
1606
- return false;
1607
- }
1608
- }
1609
- return true;
1610
- }, [featureFlag, settingsPanelV2Override]);
1611
- return {
1612
- settingsPanelV2Enabled,
1613
- settingsPanelV2Override,
1614
- setSettingsPanelV2Override
1615
- };
1616
- }
1617
-
1618
1567
  // src/studio-pages/builder/icons/FeatureLucideIcon.tsx
1619
1568
  var import_jsx_runtime4 = require("react/jsx-runtime");
1620
1569
  var iconBaseProps = {
@@ -1877,7 +1826,7 @@ function clonePresetBlocks(blocks) {
1877
1826
  }
1878
1827
 
1879
1828
  // src/studio-pages/builder/ui/InlineText.tsx
1880
- var import_react4 = require("react");
1829
+ var import_react3 = require("react");
1881
1830
  var import_jsx_runtime5 = require("react/jsx-runtime");
1882
1831
  function InlineText({
1883
1832
  as = "p",
@@ -1888,8 +1837,8 @@ function InlineText({
1888
1837
  style,
1889
1838
  value
1890
1839
  }) {
1891
- const [editing, setEditing] = (0, import_react4.useState)(false);
1892
- const editableRef = (0, import_react4.useRef)(null);
1840
+ const [editing, setEditing] = (0, import_react3.useState)(false);
1841
+ const editableRef = (0, import_react3.useRef)(null);
1893
1842
  const Tag = as;
1894
1843
  const normalizeValue = (raw) => {
1895
1844
  if (multiline) {
@@ -1897,7 +1846,7 @@ function InlineText({
1897
1846
  }
1898
1847
  return raw.replace(/\r?\n/g, " ").replace(/\s+/g, " ").trim();
1899
1848
  };
1900
- (0, import_react4.useEffect)(() => {
1849
+ (0, import_react3.useEffect)(() => {
1901
1850
  if (!editing || !editableRef.current) {
1902
1851
  return;
1903
1852
  }
@@ -1975,7 +1924,7 @@ function UploadOverlay({ label = "Uploading image..." }) {
1975
1924
  }
1976
1925
 
1977
1926
  // src/studio-pages/builder/ui/BlockFrame.tsx
1978
- var import_react5 = require("react");
1927
+ var import_react4 = require("react");
1979
1928
  var import_jsx_runtime7 = require("react/jsx-runtime");
1980
1929
  function BlockFrame({
1981
1930
  children,
@@ -1987,14 +1936,14 @@ function BlockFrame({
1987
1936
  selected,
1988
1937
  setDragIndex
1989
1938
  }) {
1990
- const [dropPosition, setDropPosition] = (0, import_react5.useState)(null);
1991
- const [dropHovered, setDropHovered] = (0, import_react5.useState)(false);
1939
+ const [dropPosition, setDropPosition] = (0, import_react4.useState)(null);
1940
+ const [dropHovered, setDropHovered] = (0, import_react4.useState)(false);
1992
1941
  const isDragging = dragIndex === index;
1993
1942
  const isAnyDragging = dragIndex !== null;
1994
1943
  const isDropTarget = dragIndex !== null && dragIndex !== index && dropPosition !== null;
1995
1944
  const showDropBefore = isDropTarget && dropPosition === "before";
1996
1945
  const showDropAfter = isDropTarget && dropPosition === "after";
1997
- (0, import_react5.useEffect)(() => {
1946
+ (0, import_react4.useEffect)(() => {
1998
1947
  if (dragIndex === null) {
1999
1948
  setDropPosition(null);
2000
1949
  setDropHovered(false);
@@ -2842,12 +2791,9 @@ function SidebarPanelIconButtons({ activeSidebarPanel, onOpenPanel }) {
2842
2791
  }
2843
2792
  function SidebarTabs({
2844
2793
  activeSidebarPanel,
2845
- disableSettingsPanelV2Toggle,
2846
- onOpenPanel,
2847
- onToggleSettingsPanelV2,
2848
- settingsPanelV2Enabled
2794
+ onOpenPanel
2849
2795
  }) {
2850
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2796
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2851
2797
  "div",
2852
2798
  {
2853
2799
  style: {
@@ -2858,31 +2804,7 @@ function SidebarTabs({
2858
2804
  gap: 8,
2859
2805
  padding: "10px 10px"
2860
2806
  },
2861
- children: [
2862
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidebarPanelIconButtons, { activeSidebarPanel, onOpenPanel }),
2863
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2864
- "button",
2865
- {
2866
- disabled: disableSettingsPanelV2Toggle,
2867
- onClick: onToggleSettingsPanelV2,
2868
- style: {
2869
- background: settingsPanelV2Enabled ? "#124a37" : "#ffffff",
2870
- border: "1px solid rgba(18, 74, 55, 0.2)",
2871
- borderRadius: 999,
2872
- color: settingsPanelV2Enabled ? "#ffffff" : "#124a37",
2873
- cursor: "pointer",
2874
- fontSize: 10,
2875
- fontWeight: 800,
2876
- marginLeft: "auto",
2877
- padding: "5px 8px",
2878
- textTransform: "uppercase"
2879
- },
2880
- title: "Toggle new settings panel",
2881
- type: "button",
2882
- children: settingsPanelV2Enabled ? "V2 On" : "V2 Off"
2883
- }
2884
- )
2885
- ]
2807
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidebarPanelIconButtons, { activeSidebarPanel, onOpenPanel })
2886
2808
  }
2887
2809
  );
2888
2810
  }
@@ -3951,9 +3873,6 @@ function toMediaLibraryItem2(value) {
3951
3873
  url
3952
3874
  };
3953
3875
  }
3954
- function mediaLabel2(item) {
3955
- return item.filename || item.alt || `Media #${item.id}`;
3956
- }
3957
3876
  function mediaFromLibraryItem(item) {
3958
3877
  return {
3959
3878
  alt: item.alt,
@@ -4012,8 +3931,8 @@ var cloneSnapshot = (value) => ({
4012
3931
  layout: cloneBlockLayout(value.layout),
4013
3932
  pageDefaults: clonePageDefaults(value.pageDefaults)
4014
3933
  });
4015
- function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }) {
4016
- const editorRootRef = (0, import_react6.useRef)(null);
3934
+ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, siteThemeTokens }) {
3935
+ const editorRootRef = (0, import_react5.useRef)(null);
4017
3936
  const doc = initialDoc ?? {};
4018
3937
  const sourceStudioDocument = doc.studioDocument && typeof doc.studioDocument === "object" ? doc.studioDocument : {};
4019
3938
  const sourceMetadata = sourceStudioDocument.metadata && typeof sourceStudioDocument.metadata === "object" ? sourceStudioDocument.metadata : {};
@@ -4025,45 +3944,39 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4025
3944
  pageWidthDefault: sourceMetadata.pageWidthDefault === "wide" || sourceMetadata.pageWidthDefault === "full" ? sourceMetadata.pageWidthDefault : defaultPageDefaults.pageWidthDefault,
4026
3945
  themePage: isRecord5(sourceThemePage.page) ? sourceThemePage.page : {}
4027
3946
  };
4028
- const [layout, setLayout] = (0, import_react6.useState)(
3947
+ const [layout, setLayout] = (0, import_react5.useState)(
4029
3948
  migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block)))
4030
3949
  );
4031
- const [pageDefaults, setPageDefaults] = (0, import_react6.useState)(clonePageDefaults(initialPageDefaults));
4032
- const [selectedIndex, setSelectedIndex] = (0, import_react6.useState)(null);
4033
- const [dragIndex, setDragIndex] = (0, import_react6.useState)(null);
4034
- const [sidebarOpen, setSidebarOpen] = (0, import_react6.useState)(true);
4035
- const [savingStatus, setSavingStatus] = (0, import_react6.useState)(null);
4036
- const [uploadingTarget, setUploadingTarget] = (0, import_react6.useState)(null);
4037
- const [topViewportHeight, setTopViewportHeight] = (0, import_react6.useState)(null);
4038
- const [uploadError, setUploadError] = (0, import_react6.useState)("");
4039
- const [uploadMessage, setUploadMessage] = (0, import_react6.useState)("");
4040
- const [uploadAltText, setUploadAltText] = (0, import_react6.useState)("");
4041
- const [mediaLibrary, setMediaLibrary] = (0, import_react6.useState)([]);
4042
- const [mediaLibraryError, setMediaLibraryError] = (0, import_react6.useState)("");
4043
- const [mediaLibraryLoading, setMediaLibraryLoading] = (0, import_react6.useState)(false);
4044
- const [selectedHeroMediaID, setSelectedHeroMediaID] = (0, import_react6.useState)("");
4045
- const [selectedItemIndex, setSelectedItemIndex] = (0, import_react6.useState)(null);
4046
- const [expandedItemIndex, setExpandedItemIndex] = (0, import_react6.useState)(null);
4047
- const [testimonialsOffsets, setTestimonialsOffsets] = (0, import_react6.useState)({});
4048
- const [presetQuery, setPresetQuery] = (0, import_react6.useState)("");
4049
- const [sessionExpired, setSessionExpired] = (0, import_react6.useState)(false);
4050
- const [pastSnapshots, setPastSnapshots] = (0, import_react6.useState)([]);
4051
- const [futureSnapshots, setFutureSnapshots] = (0, import_react6.useState)([]);
4052
- const [settingsPanelMode, setSettingsPanelMode] = (0, import_react6.useState)("basic");
4053
- const [settingsSearchQuery, setSettingsSearchQuery] = (0, import_react6.useState)("");
3950
+ const [pageDefaults, setPageDefaults] = (0, import_react5.useState)(clonePageDefaults(initialPageDefaults));
3951
+ const [selectedIndex, setSelectedIndex] = (0, import_react5.useState)(null);
3952
+ const [dragIndex, setDragIndex] = (0, import_react5.useState)(null);
3953
+ const [sidebarOpen, setSidebarOpen] = (0, import_react5.useState)(true);
3954
+ const [savingStatus, setSavingStatus] = (0, import_react5.useState)(null);
3955
+ const [uploadingTarget, setUploadingTarget] = (0, import_react5.useState)(null);
3956
+ const [topViewportHeight, setTopViewportHeight] = (0, import_react5.useState)(null);
3957
+ const [uploadError, setUploadError] = (0, import_react5.useState)("");
3958
+ const [uploadMessage, setUploadMessage] = (0, import_react5.useState)("");
3959
+ const [uploadAltText, setUploadAltText] = (0, import_react5.useState)("");
3960
+ const [mediaLibrary, setMediaLibrary] = (0, import_react5.useState)([]);
3961
+ const [mediaLibraryError, setMediaLibraryError] = (0, import_react5.useState)("");
3962
+ const [mediaLibraryLoading, setMediaLibraryLoading] = (0, import_react5.useState)(false);
3963
+ const [selectedItemIndex, setSelectedItemIndex] = (0, import_react5.useState)(null);
3964
+ const [expandedItemIndex, setExpandedItemIndex] = (0, import_react5.useState)(null);
3965
+ const [testimonialsOffsets, setTestimonialsOffsets] = (0, import_react5.useState)({});
3966
+ const [presetQuery, setPresetQuery] = (0, import_react5.useState)("");
3967
+ const [sessionExpired, setSessionExpired] = (0, import_react5.useState)(false);
3968
+ const [pastSnapshots, setPastSnapshots] = (0, import_react5.useState)([]);
3969
+ const [futureSnapshots, setFutureSnapshots] = (0, import_react5.useState)([]);
3970
+ const [settingsPanelMode, setSettingsPanelMode] = (0, import_react5.useState)("basic");
3971
+ const [settingsSearchQuery, setSettingsSearchQuery] = (0, import_react5.useState)("");
4054
3972
  const { activeSidebarPanel, setActiveSidebarPanel } = usePersistentSidebarPanel(pageID);
4055
- const historyBypassRef = (0, import_react6.useRef)(true);
4056
- const previousSnapshotRef = (0, import_react6.useRef)({
3973
+ const historyBypassRef = (0, import_react5.useRef)(true);
3974
+ const previousSnapshotRef = (0, import_react5.useRef)({
4057
3975
  layout: migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block))),
4058
3976
  pageDefaults: clonePageDefaults(initialPageDefaults)
4059
3977
  });
4060
- const lastSavedRef = (0, import_react6.useRef)(cloneSnapshot(previousSnapshotRef.current));
4061
- const persistedFlagKey = "orion-builder-settings-panel-v2";
4062
- const { settingsPanelV2Enabled, setSettingsPanelV2Override } = useSettingsPanelV2Flag({
4063
- featureFlag: featureFlags?.settingsPanelV2,
4064
- persistedFlagKey
4065
- });
4066
- const selectedBlock = (0, import_react6.useMemo)(
3978
+ const lastSavedRef = (0, import_react5.useRef)(cloneSnapshot(previousSnapshotRef.current));
3979
+ const selectedBlock = (0, import_react5.useMemo)(
4067
3980
  () => selectedIndex !== null ? layout[selectedIndex] : null,
4068
3981
  [layout, selectedIndex]
4069
3982
  );
@@ -4072,12 +3985,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4072
3985
  const selectedBlockSettings = isRecord5(selectedBlock?.settings) ? selectedBlock.settings : {};
4073
3986
  const selectedBlockAdvancedSettings = isRecord5(selectedBlockSettings.advanced) ? selectedBlockSettings.advanced : {};
4074
3987
  const isArrayItemBlockSelected = selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter" || selectedType === "stats" || selectedType === "faq" || selectedType === "testimonials";
4075
- const v2InspectorEnabledForSelected = settingsPanelV2Enabled;
4076
3988
  const editCopyInPanelEnabled = Boolean(selectedBlockAdvancedSettings.editCopyInPanel);
4077
- const selectedSectionStyle = {
4078
- ...defaultSectionStyle,
4079
- ...selectedBlock || {}
4080
- };
4081
3989
  const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
4082
3990
  const isFeatureGridItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "featureGridItem" && uploadingTarget.itemIndex === itemIndex;
4083
3991
  const isLogoWallItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "logoWallItem" && uploadingTarget.itemIndex === itemIndex;
@@ -4097,24 +4005,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4097
4005
  }
4098
4006
  return false;
4099
4007
  };
4100
- const resolveMediaLibraryItemFromValue = (value) => {
4101
- const direct = toMediaLibraryItem2(value);
4102
- if (direct) {
4103
- return direct;
4104
- }
4105
- const relationID = getRelationID2(value);
4106
- if (relationID === null) {
4107
- return null;
4108
- }
4109
- return mediaLibrary.find((item) => String(item.id) === String(relationID)) || null;
4110
- };
4111
- const selectedHeroMedia = (0, import_react6.useMemo)(() => {
4112
- if (selectedType !== "hero" || !selectedBlock) {
4113
- return null;
4114
- }
4115
- return resolveMediaLibraryItemFromValue(selectedBlock.media);
4116
- }, [mediaLibrary, selectedBlock, selectedType]);
4117
- const filteredSectionPresets = (0, import_react6.useMemo)(() => {
4008
+ const filteredSectionPresets = (0, import_react5.useMemo)(() => {
4118
4009
  const query = presetQuery.trim().toLowerCase();
4119
4010
  if (!query) {
4120
4011
  return sectionPresets;
@@ -4123,7 +4014,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4123
4014
  (preset) => `${preset.title} ${preset.description}`.toLowerCase().includes(query)
4124
4015
  );
4125
4016
  }, [presetQuery]);
4126
- const loadMediaLibrary = (0, import_react6.useCallback)(async () => {
4017
+ const loadMediaLibrary = (0, import_react5.useCallback)(async () => {
4127
4018
  setMediaLibraryLoading(true);
4128
4019
  setMediaLibraryError("");
4129
4020
  try {
@@ -4144,10 +4035,10 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4144
4035
  setMediaLibraryLoading(false);
4145
4036
  }
4146
4037
  }, []);
4147
- (0, import_react6.useEffect)(() => {
4038
+ (0, import_react5.useEffect)(() => {
4148
4039
  void loadMediaLibrary();
4149
4040
  }, [loadMediaLibrary]);
4150
- (0, import_react6.useEffect)(() => {
4041
+ (0, import_react5.useEffect)(() => {
4151
4042
  const refreshMediaLibrary = () => {
4152
4043
  void loadMediaLibrary();
4153
4044
  };
@@ -4172,7 +4063,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4172
4063
  document.removeEventListener("visibilitychange", onVisibilityChange);
4173
4064
  };
4174
4065
  }, [loadMediaLibrary]);
4175
- (0, import_react6.useEffect)(() => {
4066
+ (0, import_react5.useEffect)(() => {
4176
4067
  let active = true;
4177
4068
  const checkSession = async () => {
4178
4069
  try {
@@ -4200,14 +4091,6 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4200
4091
  window.clearInterval(intervalId);
4201
4092
  };
4202
4093
  }, []);
4203
- (0, import_react6.useEffect)(() => {
4204
- if (selectedType !== "hero") {
4205
- setSelectedHeroMediaID("");
4206
- return;
4207
- }
4208
- const relationID = getRelationID2(selectedBlock?.media);
4209
- setSelectedHeroMediaID(relationID !== null ? String(relationID) : "");
4210
- }, [selectedBlock, selectedType]);
4211
4094
  const applyTemplateStarter = () => {
4212
4095
  const templateBlocks = templateStarterPresets[pageTemplate] || templateStarterPresets.standard;
4213
4096
  const nextLayout = migrateLayoutToSettingsV2(
@@ -4364,25 +4247,6 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4364
4247
  });
4365
4248
  }
4366
4249
  };
4367
- const setSelectedMediaFieldFromLibrary = (fieldName, mediaID) => {
4368
- if (!mediaID) {
4369
- updateSelectedField(fieldName, null);
4370
- if (selectedType === "hero" && fieldName === "media") {
4371
- updateSelectedField("backgroundImageURL", "");
4372
- setSelectedHeroMediaID("");
4373
- }
4374
- return;
4375
- }
4376
- const selectedMedia = mediaLibrary.find((item) => String(item.id) === mediaID);
4377
- if (!selectedMedia) {
4378
- return;
4379
- }
4380
- updateSelectedField(fieldName, mediaFromLibraryItem(selectedMedia));
4381
- if (selectedType === "hero" && fieldName === "media") {
4382
- updateSelectedField("backgroundImageURL", selectedMedia.url);
4383
- setSelectedHeroMediaID(String(selectedMedia.id));
4384
- }
4385
- };
4386
4250
  const setSelectedItemMediaFieldFromLibrary = (itemIndex, fieldName, mediaID) => {
4387
4251
  if (selectedIndex === null) {
4388
4252
  return;
@@ -4410,22 +4274,6 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4410
4274
  void uploadMediaForSelected({ field, itemIndex, kind: "beforeAfterItem" }, file);
4411
4275
  }
4412
4276
  };
4413
- const setHeroMediaFromLibrary = (mediaID) => {
4414
- if (selectedIndex === null || selectedType !== "hero") {
4415
- return;
4416
- }
4417
- setSelectedMediaFieldFromLibrary("media", mediaID);
4418
- };
4419
- const clearHeroMedia = () => {
4420
- if (selectedType !== "hero") {
4421
- return;
4422
- }
4423
- updateSelectedField("media", null);
4424
- updateSelectedField("backgroundImageURL", "");
4425
- setSelectedHeroMediaID("");
4426
- setUploadMessage("Hero image removed.");
4427
- setUploadError("");
4428
- };
4429
4277
  const uploadMediaForSelected = async (target, file) => {
4430
4278
  if (selectedIndex === null) {
4431
4279
  setUploadError("Select a section first.");
@@ -4472,7 +4320,6 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4472
4320
  const deduped = current.filter((item) => String(item.id) !== String(uploadedItem.id));
4473
4321
  return [uploadedItem, ...deduped];
4474
4322
  });
4475
- setSelectedHeroMediaID(String(uploadedItem.id));
4476
4323
  }
4477
4324
  } else if (target.kind === "media") {
4478
4325
  nextLayout[selectedIndex] = {
@@ -4561,7 +4408,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4561
4408
  }
4562
4409
  return nextBlock;
4563
4410
  });
4564
- const resolvedThemeTokens = (0, import_react6.useMemo)(
4411
+ const resolvedThemeTokens = (0, import_react5.useMemo)(
4565
4412
  () => resolveBuilderThemeTokens({
4566
4413
  page: pageDefaults.themePage,
4567
4414
  site: siteThemeTokens
@@ -4698,14 +4545,14 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4698
4545
  return next;
4699
4546
  });
4700
4547
  };
4701
- const currentSnapshot = (0, import_react6.useMemo)(
4548
+ const currentSnapshot = (0, import_react5.useMemo)(
4702
4549
  () => ({
4703
4550
  layout: cloneBlockLayout(layout),
4704
4551
  pageDefaults: clonePageDefaults(pageDefaults)
4705
4552
  }),
4706
4553
  [layout, pageDefaults]
4707
4554
  );
4708
- (0, import_react6.useEffect)(() => {
4555
+ (0, import_react5.useEffect)(() => {
4709
4556
  const readTopViewportHeight = () => {
4710
4557
  if (typeof window === "undefined") {
4711
4558
  setTopViewportHeight(null);
@@ -4730,7 +4577,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4730
4577
  layout: toPersistedLayout(snapshot.layout),
4731
4578
  pageDefaults: snapshot.pageDefaults
4732
4579
  });
4733
- const isDirty = (0, import_react6.useMemo)(
4580
+ const isDirty = (0, import_react5.useMemo)(
4734
4581
  () => snapshotKey(currentSnapshot) !== snapshotKey(lastSavedRef.current),
4735
4582
  [currentSnapshot]
4736
4583
  );
@@ -4777,25 +4624,6 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4777
4624
  setExpandedItemIndex((current) => current === itemIndex ? null : itemIndex);
4778
4625
  openSidebarPanel("selected");
4779
4626
  };
4780
- const setSelectedStyleField = (fieldName, value) => {
4781
- updateSelectedField(fieldName, value);
4782
- };
4783
- const applyGradientPreset = (scope, preset) => {
4784
- const pair = gradientPresetPairs[preset];
4785
- if (scope === "section") {
4786
- setSelectedStyleField("sectionGradientPreset", preset);
4787
- if (pair) {
4788
- setSelectedStyleField("sectionGradientFrom", pair[0]);
4789
- setSelectedStyleField("sectionGradientTo", pair[1]);
4790
- }
4791
- return;
4792
- }
4793
- setSelectedStyleField("contentGradientPreset", preset);
4794
- if (pair) {
4795
- setSelectedStyleField("contentGradientFrom", pair[0]);
4796
- setSelectedStyleField("contentGradientTo", pair[1]);
4797
- }
4798
- };
4799
4627
  const saveLayout = async (status) => {
4800
4628
  if (savingStatus !== null) {
4801
4629
  return false;
@@ -4883,14 +4711,14 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4883
4711
  setSavingStatus(null);
4884
4712
  }
4885
4713
  };
4886
- (0, import_react6.useEffect)(() => {
4714
+ (0, import_react5.useEffect)(() => {
4887
4715
  if (selectedIndex === null) {
4888
4716
  return;
4889
4717
  }
4890
4718
  setSidebarOpen(true);
4891
4719
  setActiveSidebarPanel("selected");
4892
4720
  }, [selectedIndex]);
4893
- (0, import_react6.useEffect)(() => {
4721
+ (0, import_react5.useEffect)(() => {
4894
4722
  if (selectedIndex === null) {
4895
4723
  setSelectedItemIndex(null);
4896
4724
  setExpandedItemIndex(null);
@@ -4908,17 +4736,17 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4908
4736
  (current) => typeof current === "number" && current >= 0 && current < selectedItems.length ? current : 0
4909
4737
  );
4910
4738
  }, [selectedIndex, selectedItems.length]);
4911
- (0, import_react6.useEffect)(() => {
4739
+ (0, import_react5.useEffect)(() => {
4912
4740
  if (layout.length > 0) {
4913
4741
  return;
4914
4742
  }
4915
4743
  setSidebarOpen(true);
4916
4744
  setActiveSidebarPanel("addSections");
4917
4745
  }, [layout.length]);
4918
- (0, import_react6.useEffect)(() => {
4746
+ (0, import_react5.useEffect)(() => {
4919
4747
  return;
4920
4748
  }, [layout]);
4921
- (0, import_react6.useEffect)(() => {
4749
+ (0, import_react5.useEffect)(() => {
4922
4750
  if (historyBypassRef.current) {
4923
4751
  historyBypassRef.current = false;
4924
4752
  previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
@@ -4929,7 +4757,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4929
4757
  setFutureSnapshots([]);
4930
4758
  previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
4931
4759
  }, [currentSnapshot]);
4932
- (0, import_react6.useEffect)(() => {
4760
+ (0, import_react5.useEffect)(() => {
4933
4761
  const onKeyDown = (event) => {
4934
4762
  const key = event.key.toLowerCase();
4935
4763
  const isUndo = (event.metaKey || event.ctrlKey) && key === "z" && !event.shiftKey;
@@ -4947,7 +4775,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4947
4775
  window.addEventListener("keydown", onKeyDown);
4948
4776
  return () => window.removeEventListener("keydown", onKeyDown);
4949
4777
  }, [canRedo, canUndo, futureSnapshots, pastSnapshots, currentSnapshot]);
4950
- (0, import_react6.useEffect)(() => {
4778
+ (0, import_react5.useEffect)(() => {
4951
4779
  window.parent?.postMessage(
4952
4780
  {
4953
4781
  dirty: isDirty,
@@ -4957,7 +4785,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4957
4785
  "*"
4958
4786
  );
4959
4787
  }, [isDirty]);
4960
- (0, import_react6.useEffect)(() => {
4788
+ (0, import_react5.useEffect)(() => {
4961
4789
  window.parent?.postMessage(
4962
4790
  {
4963
4791
  canRedo,
@@ -4968,7 +4796,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
4968
4796
  "*"
4969
4797
  );
4970
4798
  }, [canRedo, canUndo]);
4971
- (0, import_react6.useEffect)(() => {
4799
+ (0, import_react5.useEffect)(() => {
4972
4800
  const onMessage = (event) => {
4973
4801
  const data = event.data;
4974
4802
  if (!data || data.source !== "payload-visual-builder-parent") {
@@ -5021,7 +4849,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
5021
4849
  window.addEventListener("message", onMessage);
5022
4850
  return () => window.removeEventListener("message", onMessage);
5023
4851
  }, [canRedo, canUndo, isDirty, layout, pageDefaults.pageWidthDefault, title]);
5024
- (0, import_react6.useEffect)(() => {
4852
+ (0, import_react5.useEffect)(() => {
5025
4853
  const preventNavigationWhileEditing = (event) => {
5026
4854
  const editorRoot = editorRootRef.current;
5027
4855
  if (!editorRoot) {
@@ -6140,10 +5968,7 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
6140
5968
  SidebarTabs,
6141
5969
  {
6142
5970
  activeSidebarPanel,
6143
- disableSettingsPanelV2Toggle: typeof featureFlags?.settingsPanelV2 === "boolean",
6144
- onOpenPanel: (panel) => openSidebarPanel(panel),
6145
- onToggleSettingsPanelV2: () => setSettingsPanelV2Override((current) => current === false ? true : false),
6146
- settingsPanelV2Enabled
5971
+ onOpenPanel: (panel) => openSidebarPanel(panel)
6147
5972
  }
6148
5973
  ),
6149
5974
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "grid", overflowY: "auto", padding: 12 }, children: [
@@ -6251,1073 +6076,42 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
6251
6076
  }
6252
6077
  )
6253
6078
  ] }),
6254
- v2InspectorEnabledForSelected ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6255
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6256
- BlockInspectorRenderer,
6257
- {
6258
- block: selectedBlock,
6259
- blockType: selectedType,
6260
- mode: settingsPanelMode,
6261
- onModeChange: setSettingsPanelMode,
6262
- onSearchQueryChange: setSettingsSearchQuery,
6263
- onUpdateField: updateSelectedField,
6264
- onUpdateSetting: updateSelectedSettingField,
6265
- searchQuery: settingsSearchQuery
6266
- }
6267
- ),
6268
- isArrayItemBlockSelected ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6269
- ArrayItemsEditor,
6270
- {
6271
- blockType: selectedType,
6272
- expandedItemIndex,
6273
- isUploadingItemMedia: isSelectedItemMediaUploading,
6274
- items: selectedItems,
6275
- mediaLibrary,
6276
- mediaLibraryError,
6277
- mediaLibraryLoading,
6278
- mode: settingsPanelMode,
6279
- onAddItem: appendDefaultItemToSelected,
6280
- onRemoveItem: (itemIndex) => removeItemFromSelected("items", itemIndex),
6281
- onSetItemMediaFromLibrary: setSelectedItemMediaFieldFromLibrary,
6282
- onToggleItem: toggleSelectedItem,
6283
- onUpdateItemField: (itemIndex, fieldName, value) => updateArrayItemField(selectedIndex ?? 0, "items", itemIndex, fieldName, value),
6284
- onUpdateItemSetting: (itemIndex, path, value) => updateArrayItemSettingField(selectedIndex ?? 0, "items", itemIndex, path, value),
6285
- onUploadItemMedia: uploadItemMediaFromV2,
6286
- searchQuery: settingsSearchQuery,
6287
- showInlineCopyFields: editCopyInPanelEnabled,
6288
- uploadDisabled: uploadingTarget !== null
6289
- }
6290
- ) : null
6291
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6292
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { color: "var(--ink-700)", fontSize: 11 }, children: [
6293
- "Section width follows ",
6294
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "Page Defaults" }),
6295
- " for a consistent page layout."
6296
- ] }),
6297
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6298
- "Content Width",
6299
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6300
- "select",
6301
- {
6302
- onChange: (event) => setSelectedStyleField("contentWidth", event.target.value),
6303
- style: sidebarInputStyle,
6304
- value: normalizeText2(selectedSectionStyle.contentWidth, "inherit"),
6305
- children: [
6306
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "inherit", children: "Inherit Page Default" }),
6307
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "narrow", children: "Narrow" }),
6308
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "content", children: "Content" }),
6309
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "wide", children: "Wide" }),
6310
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "full", children: "Full" })
6311
- ]
6312
- }
6313
- )
6314
- ] }),
6315
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6316
- "Section Vertical Spacing",
6317
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6318
- "select",
6319
- {
6320
- onChange: (event) => setSelectedStyleField("sectionPaddingY", event.target.value),
6321
- style: sidebarInputStyle,
6322
- value: normalizeText2(selectedSectionStyle.sectionPaddingY, "md"),
6323
- children: [
6324
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "none", children: "None" }),
6325
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "sm", children: "Small" }),
6326
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "md", children: "Medium" }),
6327
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "lg", children: "Large" })
6328
- ]
6329
- }
6330
- )
6331
- ] }),
6332
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6333
- "Section Horizontal Spacing",
6334
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6335
- "select",
6336
- {
6337
- onChange: (event) => setSelectedStyleField("sectionPaddingX", event.target.value),
6338
- style: sidebarInputStyle,
6339
- value: normalizeText2(selectedSectionStyle.sectionPaddingX, "inherit"),
6340
- children: [
6341
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "inherit", children: "Inherit (Edge-to-Edge on Full Width)" }),
6342
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "none", children: "None" }),
6343
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "sm", children: "Small" }),
6344
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "md", children: "Medium" }),
6345
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "lg", children: "Large" })
6346
- ]
6347
- }
6348
- )
6349
- ] }),
6350
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6351
- "Section Background",
6352
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6353
- "select",
6354
- {
6355
- onChange: (event) => setSelectedStyleField("sectionBackgroundMode", event.target.value),
6356
- style: sidebarInputStyle,
6357
- value: normalizeText2(selectedSectionStyle.sectionBackgroundMode, "none"),
6358
- children: [
6359
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "none", children: "None" }),
6360
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "color", children: "Color" }),
6361
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "gradient", children: "Gradient" })
6362
- ]
6363
- }
6364
- )
6365
- ] }),
6366
- normalizeText2(selectedSectionStyle.sectionBackgroundMode, "none") === "color" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6367
- "Section Background Color",
6368
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6369
- "input",
6370
- {
6371
- onChange: (event) => setSelectedStyleField("sectionBackgroundColor", event.target.value),
6372
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6373
- type: "color",
6374
- value: parseColor(selectedSectionStyle.sectionBackgroundColor, "#ffffff")
6375
- }
6376
- )
6377
- ] }) : null,
6378
- normalizeText2(selectedSectionStyle.sectionBackgroundMode, "none") === "gradient" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6379
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6380
- "Section Gradient Preset",
6381
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6382
- "select",
6383
- {
6384
- onChange: (event) => applyGradientPreset("section", event.target.value),
6385
- style: sidebarInputStyle,
6386
- value: normalizeText2(selectedSectionStyle.sectionGradientPreset, "forest"),
6387
- children: Object.keys(gradientPresetPairs).map((preset) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: preset, children: preset }, preset))
6388
- }
6389
- )
6390
- ] }),
6391
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "grid", gap: 6, gridTemplateColumns: "1fr 1fr" }, children: [
6392
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6393
- "From",
6394
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6395
- "input",
6396
- {
6397
- onChange: (event) => setSelectedStyleField("sectionGradientFrom", event.target.value),
6398
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6399
- type: "color",
6400
- value: parseColor(selectedSectionStyle.sectionGradientFrom, "#124a37")
6401
- }
6402
- )
6403
- ] }),
6404
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6405
- "To",
6406
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6407
- "input",
6408
- {
6409
- onChange: (event) => setSelectedStyleField("sectionGradientTo", event.target.value),
6410
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6411
- type: "color",
6412
- value: parseColor(selectedSectionStyle.sectionGradientTo, "#1f684f")
6413
- }
6414
- )
6415
- ] })
6416
- ] }),
6417
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6418
- "Angle",
6419
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6420
- "input",
6421
- {
6422
- max: 360,
6423
- min: 0,
6424
- onChange: (event) => setSelectedStyleField("sectionGradientAngle", event.target.value),
6425
- style: sidebarInputStyle,
6426
- type: "number",
6427
- value: parseAngle(selectedSectionStyle.sectionGradientAngle, "135")
6428
- }
6429
- )
6430
- ] })
6431
- ] }) : null,
6432
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6433
- "Content Background",
6434
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6435
- "select",
6436
- {
6437
- onChange: (event) => setSelectedStyleField("contentBackgroundMode", event.target.value),
6438
- style: sidebarInputStyle,
6439
- value: normalizeText2(selectedSectionStyle.contentBackgroundMode, "none"),
6440
- children: [
6441
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "none", children: "None" }),
6442
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "color", children: "Color" }),
6443
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "gradient", children: "Gradient" })
6444
- ]
6445
- }
6446
- )
6447
- ] }),
6448
- normalizeText2(selectedSectionStyle.contentBackgroundMode, "none") === "color" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6449
- "Content Background Color",
6450
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6451
- "input",
6452
- {
6453
- onChange: (event) => setSelectedStyleField("contentBackgroundColor", event.target.value),
6454
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6455
- type: "color",
6456
- value: parseColor(selectedSectionStyle.contentBackgroundColor, "#ffffff")
6457
- }
6458
- )
6459
- ] }) : null,
6460
- normalizeText2(selectedSectionStyle.contentBackgroundMode, "none") === "gradient" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6461
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6462
- "Content Gradient Preset",
6463
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6464
- "select",
6465
- {
6466
- onChange: (event) => applyGradientPreset("content", event.target.value),
6467
- style: sidebarInputStyle,
6468
- value: normalizeText2(selectedSectionStyle.contentGradientPreset, "none"),
6469
- children: Object.keys(gradientPresetPairs).map((preset) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: preset, children: preset }, preset))
6470
- }
6471
- )
6472
- ] }),
6473
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "grid", gap: 6, gridTemplateColumns: "1fr 1fr" }, children: [
6474
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6475
- "From",
6476
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6477
- "input",
6478
- {
6479
- onChange: (event) => setSelectedStyleField("contentGradientFrom", event.target.value),
6480
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6481
- type: "color",
6482
- value: parseColor(selectedSectionStyle.contentGradientFrom, "#ffffff")
6483
- }
6484
- )
6485
- ] }),
6486
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6487
- "To",
6488
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6489
- "input",
6490
- {
6491
- onChange: (event) => setSelectedStyleField("contentGradientTo", event.target.value),
6492
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6493
- type: "color",
6494
- value: parseColor(selectedSectionStyle.contentGradientTo, "#f4f6f2")
6495
- }
6496
- )
6497
- ] })
6498
- ] }),
6499
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6500
- "Angle",
6501
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6502
- "input",
6503
- {
6504
- max: 360,
6505
- min: 0,
6506
- onChange: (event) => setSelectedStyleField("contentGradientAngle", event.target.value),
6507
- style: sidebarInputStyle,
6508
- type: "number",
6509
- value: parseAngle(selectedSectionStyle.contentGradientAngle, "135")
6510
- }
6511
- )
6512
- ] })
6513
- ] }) : null,
6514
- selectedType === "hero" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6515
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6516
- "Variant",
6517
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6518
- "select",
6519
- {
6520
- onChange: (event) => updateSelectedField("variant", event.target.value),
6521
- style: sidebarInputStyle,
6522
- value: normalizeText2(selectedBlock.variant, "default"),
6523
- children: [
6524
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "default", children: "Default" }),
6525
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "centered", children: "Centered" })
6526
- ]
6527
- }
6528
- )
6529
- ] }),
6530
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6531
- "Hero Height",
6532
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6533
- "select",
6534
- {
6535
- onChange: (event) => updateSelectedField("heroHeight", event.target.value),
6536
- style: sidebarInputStyle,
6537
- value: normalizeHeroHeight(selectedBlock.heroHeight),
6538
- children: [
6539
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "sm", children: "Small" }),
6540
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "md", children: "Medium (Half Screen)" }),
6541
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "full", children: "Full Screen" })
6542
- ]
6543
- }
6544
- )
6545
- ] }),
6546
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { ...sidebarSectionStyle, display: "grid", gap: 8 }, children: [
6547
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 12, fontWeight: 600 }, children: "Hero Image" }),
6548
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 12 }, children: selectedHeroMedia ? `${selectedHeroMedia.filename || `Media #${selectedHeroMedia.id}`}${selectedHeroMedia.alt ? ` (${selectedHeroMedia.alt})` : ""}` : "No image selected." }),
6549
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6550
- "Choose from Media Library",
6551
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6552
- "select",
6553
- {
6554
- onChange: (event) => setHeroMediaFromLibrary(event.target.value),
6555
- style: sidebarInputStyle,
6556
- value: selectedHeroMediaID,
6557
- children: [
6558
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "No image" }),
6559
- mediaLibrary.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: String(item.id), children: mediaLabel2(item) }, String(item.id)))
6560
- ]
6561
- }
6562
- )
6563
- ] }),
6564
- mediaLibraryLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 11 }, children: "Loading media library..." }) : null,
6565
- mediaLibraryError ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "#8d1d1d", fontSize: 11 }, children: mediaLibraryError }) : null,
6566
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6567
- "button",
6568
- {
6569
- disabled: !selectedHeroMedia && !selectedHeroMediaID,
6570
- onClick: clearHeroMedia,
6571
- style: {
6572
- borderRadius: 999,
6573
- cursor: selectedHeroMedia || selectedHeroMediaID ? "pointer" : "not-allowed",
6574
- fontSize: 12,
6575
- padding: "7px 10px"
6576
- },
6577
- type: "button",
6578
- children: "Remove Hero Image"
6579
- }
6580
- ),
6581
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6582
- "Upload Hero Background Image",
6583
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6584
- "input",
6585
- {
6586
- accept: "image/*",
6587
- disabled: uploadingTarget !== null,
6588
- onChange: (event) => {
6589
- const file = event.currentTarget.files?.[0];
6590
- if (file) {
6591
- void uploadMediaForSelected({ kind: "hero" }, file);
6592
- }
6593
- event.currentTarget.value = "";
6594
- },
6595
- style: sidebarInputStyle,
6596
- type: "file"
6597
- }
6598
- )
6599
- ] }),
6600
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6601
- "Image Fit",
6602
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6603
- "select",
6604
- {
6605
- onChange: (event) => updateSelectedField("backgroundImageFit", event.target.value),
6606
- style: sidebarInputStyle,
6607
- value: normalizeHeroImageFit(selectedBlock.backgroundImageFit),
6608
- children: [
6609
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "cover", children: "Cover" }),
6610
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "contain", children: "Contain" })
6611
- ]
6612
- }
6613
- )
6614
- ] }),
6615
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6616
- "Image Corners",
6617
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6618
- "select",
6619
- {
6620
- onChange: (event) => updateSelectedField("backgroundImageCornerStyle", event.target.value),
6621
- style: sidebarInputStyle,
6622
- value: normalizeHeroImageCornerStyle(
6623
- selectedBlock.backgroundImageCornerStyle,
6624
- selectedBlock.backgroundImageFit
6625
- ),
6626
- children: [
6627
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "rounded", children: "Rounded" }),
6628
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "square", children: "Square" })
6629
- ]
6630
- }
6631
- )
6632
- ] }),
6633
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6634
- "Image Position",
6635
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6636
- "select",
6637
- {
6638
- onChange: (event) => updateSelectedField("backgroundImagePosition", event.target.value),
6639
- style: sidebarInputStyle,
6640
- value: normalizeHeroImagePosition(selectedBlock.backgroundImagePosition),
6641
- children: [
6642
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "center", children: "Center" }),
6643
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "top", children: "Top" }),
6644
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "bottom", children: "Bottom" }),
6645
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "left", children: "Left" }),
6646
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "right", children: "Right" })
6647
- ]
6648
- }
6649
- )
6650
- ] })
6651
- ] }),
6652
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { ...sidebarSectionStyle, display: "grid", gap: 8 }, children: [
6653
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 12, fontWeight: 600 }, children: "Hero Overlay" }),
6654
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6655
- "Overlay Type",
6656
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6657
- "select",
6658
- {
6659
- onChange: (event) => updateSelectedField("backgroundOverlayMode", event.target.value),
6660
- style: sidebarInputStyle,
6661
- value: normalizeText2(selectedBlock.backgroundOverlayMode, "none"),
6662
- children: [
6663
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "none", children: "None" }),
6664
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "solid", children: "Solid" }),
6665
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "gradient", children: "Gradient" })
6666
- ]
6667
- }
6668
- )
6669
- ] }),
6670
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6671
- "Opacity (%)",
6672
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { alignItems: "center", display: "grid", gap: 8, gridTemplateColumns: "1fr 90px" }, children: [
6673
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6674
- "input",
6675
- {
6676
- max: 100,
6677
- min: 0,
6678
- onChange: (event) => updateSelectedField("backgroundOverlayOpacity", Number(event.target.value)),
6679
- type: "range",
6680
- value: parsePercentNumber(selectedBlock.backgroundOverlayOpacity, 45)
6681
- }
6682
- ),
6683
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6684
- "input",
6685
- {
6686
- max: 100,
6687
- min: 0,
6688
- onChange: (event) => updateSelectedField(
6689
- "backgroundOverlayOpacity",
6690
- event.target.value === "" ? 45 : Number(event.target.value)
6691
- ),
6692
- style: sidebarInputStyle,
6693
- type: "number",
6694
- value: parsePercentNumber(selectedBlock.backgroundOverlayOpacity, 45)
6695
- }
6696
- )
6697
- ] })
6698
- ] }),
6699
- normalizeText2(selectedBlock.backgroundOverlayMode, "none") === "solid" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6700
- "Overlay Color",
6701
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6702
- "input",
6703
- {
6704
- onChange: (event) => updateSelectedField("backgroundOverlayColor", event.target.value),
6705
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6706
- type: "color",
6707
- value: parseColor(selectedBlock.backgroundOverlayColor, "#000000")
6708
- }
6709
- )
6710
- ] }) : null,
6711
- normalizeText2(selectedBlock.backgroundOverlayMode, "none") === "gradient" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6712
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "grid", gap: 6, gridTemplateColumns: "1fr 1fr" }, children: [
6713
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6714
- "From",
6715
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6716
- "input",
6717
- {
6718
- onChange: (event) => updateSelectedField("backgroundOverlayGradientFrom", event.target.value),
6719
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6720
- type: "color",
6721
- value: parseColor(selectedBlock.backgroundOverlayGradientFrom, "#0d4a37")
6722
- }
6723
- )
6724
- ] }),
6725
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6726
- "To",
6727
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6728
- "input",
6729
- {
6730
- onChange: (event) => updateSelectedField("backgroundOverlayGradientTo", event.target.value),
6731
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6732
- type: "color",
6733
- value: parseColor(selectedBlock.backgroundOverlayGradientTo, "#1f684f")
6734
- }
6735
- )
6736
- ] })
6737
- ] }),
6738
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "grid", gap: 6, gridTemplateColumns: "1fr 1fr" }, children: [
6739
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6740
- "From Strength (%)",
6741
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6742
- "div",
6743
- {
6744
- style: {
6745
- alignItems: "center",
6746
- display: "grid",
6747
- gap: 8,
6748
- gridTemplateColumns: "1fr 70px"
6749
- },
6750
- children: [
6751
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6752
- "input",
6753
- {
6754
- max: 100,
6755
- min: 0,
6756
- onChange: (event) => updateSelectedField(
6757
- "backgroundOverlayGradientFromStrength",
6758
- Number(event.target.value)
6759
- ),
6760
- type: "range",
6761
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientFromStrength, 100)
6762
- }
6763
- ),
6764
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6765
- "input",
6766
- {
6767
- max: 100,
6768
- min: 0,
6769
- onChange: (event) => updateSelectedField(
6770
- "backgroundOverlayGradientFromStrength",
6771
- event.target.value === "" ? 100 : Number(event.target.value)
6772
- ),
6773
- style: sidebarInputStyle,
6774
- type: "number",
6775
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientFromStrength, 100)
6776
- }
6777
- )
6778
- ]
6779
- }
6780
- )
6781
- ] }),
6782
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6783
- "To Strength (%)",
6784
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6785
- "div",
6786
- {
6787
- style: {
6788
- alignItems: "center",
6789
- display: "grid",
6790
- gap: 8,
6791
- gridTemplateColumns: "1fr 70px"
6792
- },
6793
- children: [
6794
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6795
- "input",
6796
- {
6797
- max: 100,
6798
- min: 0,
6799
- onChange: (event) => updateSelectedField(
6800
- "backgroundOverlayGradientToStrength",
6801
- Number(event.target.value)
6802
- ),
6803
- type: "range",
6804
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientToStrength, 100)
6805
- }
6806
- ),
6807
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6808
- "input",
6809
- {
6810
- max: 100,
6811
- min: 0,
6812
- onChange: (event) => updateSelectedField(
6813
- "backgroundOverlayGradientToStrength",
6814
- event.target.value === "" ? 100 : Number(event.target.value)
6815
- ),
6816
- style: sidebarInputStyle,
6817
- type: "number",
6818
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientToStrength, 100)
6819
- }
6820
- )
6821
- ]
6822
- }
6823
- )
6824
- ] })
6825
- ] }),
6826
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6827
- "Angle",
6828
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6829
- "input",
6830
- {
6831
- max: 360,
6832
- min: 0,
6833
- onChange: (event) => updateSelectedField("backgroundOverlayGradientAngle", event.target.value),
6834
- style: sidebarInputStyle,
6835
- type: "number",
6836
- value: parseAngle(selectedBlock.backgroundOverlayGradientAngle, "135")
6837
- }
6838
- )
6839
- ] }),
6840
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6841
- "Gradient Start (%)",
6842
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { alignItems: "center", display: "grid", gap: 8, gridTemplateColumns: "1fr 90px" }, children: [
6843
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6844
- "input",
6845
- {
6846
- max: 100,
6847
- min: 0,
6848
- onChange: (event) => {
6849
- const next = Number(event.target.value);
6850
- updateSelectedField("backgroundOverlayGradientStart", next);
6851
- const currentEnd = parsePercentNumber(selectedBlock.backgroundOverlayGradientEnd, 100);
6852
- if (next > currentEnd) {
6853
- updateSelectedField("backgroundOverlayGradientEnd", next);
6854
- }
6855
- },
6856
- type: "range",
6857
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientStart, 0)
6858
- }
6859
- ),
6860
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6861
- "input",
6862
- {
6863
- max: 100,
6864
- min: 0,
6865
- onChange: (event) => {
6866
- const next = event.target.value === "" ? 0 : Number(event.target.value);
6867
- updateSelectedField("backgroundOverlayGradientStart", next);
6868
- const currentEnd = parsePercentNumber(selectedBlock.backgroundOverlayGradientEnd, 100);
6869
- if (next > currentEnd) {
6870
- updateSelectedField("backgroundOverlayGradientEnd", next);
6871
- }
6872
- },
6873
- style: sidebarInputStyle,
6874
- type: "number",
6875
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientStart, 0)
6876
- }
6877
- )
6878
- ] })
6879
- ] }),
6880
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6881
- "Gradient End (%)",
6882
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { alignItems: "center", display: "grid", gap: 8, gridTemplateColumns: "1fr 90px" }, children: [
6883
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6884
- "input",
6885
- {
6886
- max: 100,
6887
- min: 0,
6888
- onChange: (event) => {
6889
- const next = Number(event.target.value);
6890
- updateSelectedField("backgroundOverlayGradientEnd", next);
6891
- const currentStart = parsePercentNumber(selectedBlock.backgroundOverlayGradientStart, 0);
6892
- if (next < currentStart) {
6893
- updateSelectedField("backgroundOverlayGradientStart", next);
6894
- }
6895
- },
6896
- type: "range",
6897
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientEnd, 100)
6898
- }
6899
- ),
6900
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6901
- "input",
6902
- {
6903
- max: 100,
6904
- min: 0,
6905
- onChange: (event) => {
6906
- const next = event.target.value === "" ? 100 : Number(event.target.value);
6907
- updateSelectedField("backgroundOverlayGradientEnd", next);
6908
- const currentStart = parsePercentNumber(selectedBlock.backgroundOverlayGradientStart, 0);
6909
- if (next < currentStart) {
6910
- updateSelectedField("backgroundOverlayGradientStart", next);
6911
- }
6912
- },
6913
- style: sidebarInputStyle,
6914
- type: "number",
6915
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientEnd, 100)
6916
- }
6917
- )
6918
- ] })
6919
- ] }),
6920
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6921
- "Feather (%)",
6922
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { alignItems: "center", display: "grid", gap: 8, gridTemplateColumns: "1fr 90px" }, children: [
6923
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6924
- "input",
6925
- {
6926
- max: 100,
6927
- min: 0,
6928
- onChange: (event) => updateSelectedField("backgroundOverlayGradientFeather", Number(event.target.value)),
6929
- type: "range",
6930
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientFeather, 100)
6931
- }
6932
- ),
6933
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6934
- "input",
6935
- {
6936
- max: 100,
6937
- min: 0,
6938
- onChange: (event) => updateSelectedField(
6939
- "backgroundOverlayGradientFeather",
6940
- event.target.value === "" ? 100 : Number(event.target.value)
6941
- ),
6942
- style: sidebarInputStyle,
6943
- type: "number",
6944
- value: parsePercentNumber(selectedBlock.backgroundOverlayGradientFeather, 100)
6945
- }
6946
- )
6947
- ] })
6948
- ] })
6949
- ] }) : null,
6950
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6951
- "button",
6952
- {
6953
- onClick: () => {
6954
- updateSelectedField("backgroundOverlayMode", "none");
6955
- updateSelectedField("backgroundOverlayOpacity", 45);
6956
- updateSelectedField("backgroundOverlayGradientStart", 0);
6957
- updateSelectedField("backgroundOverlayGradientEnd", 100);
6958
- updateSelectedField("backgroundOverlayGradientFeather", 100);
6959
- },
6960
- style: { borderRadius: 999, cursor: "pointer", fontSize: 12, padding: "7px 10px" },
6961
- type: "button",
6962
- children: "Clear Hero Overlay"
6963
- }
6964
- )
6965
- ] }),
6966
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6967
- "Background Color",
6968
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6969
- "input",
6970
- {
6971
- onChange: (event) => updateSelectedField("backgroundColor", event.target.value),
6972
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
6973
- type: "color",
6974
- value: parseColor(selectedBlock.backgroundColor, "#ffffff")
6975
- }
6976
- )
6977
- ] }),
6978
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6979
- "button",
6980
- {
6981
- onClick: () => updateSelectedField("backgroundColor", ""),
6982
- style: { borderRadius: 999, cursor: "pointer", fontSize: 12, padding: "7px 10px" },
6983
- type: "button",
6984
- children: "Clear Hero Background Color"
6985
- }
6986
- )
6987
- ] }) : null,
6988
- selectedType === "featureGrid" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6989
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
6990
- "Variant",
6991
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6992
- "select",
6993
- {
6994
- onChange: (event) => updateSelectedField("variant", event.target.value),
6995
- style: sidebarInputStyle,
6996
- value: normalizeText2(selectedBlock.variant, "cards"),
6997
- children: [
6998
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "cards", children: "Cards" }),
6999
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "highlight", children: "Highlight" })
7000
- ]
7001
- }
7002
- )
7003
- ] }),
7004
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7005
- "Items Per Row (Desktop)",
7006
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7007
- "select",
7008
- {
7009
- onChange: (event) => updateSelectedField("itemsPerRow", Number(event.target.value)),
7010
- style: sidebarInputStyle,
7011
- value: Math.max(1, Math.min(6, Math.floor(parsePixelNumber(selectedBlock.itemsPerRow, 3)))),
7012
- children: [
7013
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 1, children: "1" }),
7014
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 2, children: "2" }),
7015
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 3, children: "3" }),
7016
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 4, children: "4" }),
7017
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 5, children: "5" }),
7018
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 6, children: "6" })
7019
- ]
7020
- }
7021
- )
7022
- ] }),
7023
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7024
- "Highlight Background Color",
7025
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7026
- "input",
7027
- {
7028
- onChange: (event) => updateSelectedField("backgroundColor", event.target.value),
7029
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
7030
- type: "color",
7031
- value: parseColor(selectedBlock.backgroundColor, "#1f684f")
7032
- }
7033
- )
7034
- ] })
7035
- ] }) : null,
7036
- selectedType === "beforeAfter" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7037
- "Items Per Row (Desktop)",
7038
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7039
- "select",
7040
- {
7041
- onChange: (event) => updateSelectedField("itemsPerRow", Number(event.target.value)),
7042
- style: sidebarInputStyle,
7043
- value: Math.max(1, Math.min(4, Math.floor(parsePixelNumber(selectedBlock.itemsPerRow, 2)))),
7044
- children: [
7045
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 1, children: "1" }),
7046
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 2, children: "2" }),
7047
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 3, children: "3" }),
7048
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: 4, children: "4" })
7049
- ]
7050
- }
7051
- )
7052
- ] }) : null,
7053
- selectedType === "cta" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7054
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7055
- "Style",
7056
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7057
- "select",
7058
- {
7059
- onChange: (event) => updateSelectedField("style", event.target.value),
7060
- style: sidebarInputStyle,
7061
- value: normalizeText2(selectedBlock.style, "light"),
7062
- children: [
7063
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "light", children: "Light" }),
7064
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "dark", children: "Dark" })
7065
- ]
7066
- }
7067
- )
7068
- ] }),
7069
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7070
- "Background Color",
7071
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7072
- "input",
7073
- {
7074
- onChange: (event) => updateSelectedField("backgroundColor", event.target.value),
7075
- style: { ...sidebarInputStyle, height: 36, padding: 4 },
7076
- type: "color",
7077
- value: parseColor(selectedBlock.backgroundColor, "#1f684f")
7078
- }
7079
- )
7080
- ] })
7081
- ] }) : null,
7082
- selectedType === "media" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7083
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7084
- "Image Size",
7085
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7086
- "select",
7087
- {
7088
- onChange: (event) => updateSelectedField("size", event.target.value),
7089
- style: sidebarInputStyle,
7090
- value: normalizeText2(selectedBlock.size, "default"),
7091
- children: [
7092
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "default", children: "Default" }),
7093
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "wide", children: "Wide" })
7094
- ]
7095
- }
7096
- )
7097
- ] }),
7098
- (() => {
7099
- const selectedMedia = resolveMediaLibraryItemFromValue(selectedBlock.image);
7100
- const selectedMediaID = getRelationID2(selectedBlock.image);
7101
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7102
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 12 }, children: selectedMedia ? `Selected image: ${mediaLabel2(selectedMedia)}` : "No image selected." }),
7103
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7104
- "Choose from Media Library",
7105
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7106
- "select",
7107
- {
7108
- onChange: (event) => setSelectedMediaFieldFromLibrary("image", event.target.value),
7109
- style: sidebarInputStyle,
7110
- value: selectedMediaID !== null ? String(selectedMediaID) : "",
7111
- children: [
7112
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "No image" }),
7113
- mediaLibrary.map((libraryItem) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: String(libraryItem.id), children: mediaLabel2(libraryItem) }, String(libraryItem.id)))
7114
- ]
7115
- }
7116
- )
7117
- ] }),
7118
- mediaLibraryLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "var(--ink-700)", fontSize: 11 }, children: "Loading media library..." }) : null,
7119
- mediaLibraryError ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { color: "#8d1d1d", fontSize: 11 }, children: mediaLibraryError }) : null,
7120
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7121
- "button",
7122
- {
7123
- disabled: !selectedMedia && selectedMediaID === null,
7124
- onClick: () => setSelectedMediaFieldFromLibrary("image", ""),
7125
- style: {
7126
- borderRadius: 999,
7127
- cursor: selectedMedia || selectedMediaID !== null ? "pointer" : "not-allowed",
7128
- fontSize: 12,
7129
- padding: "7px 10px"
7130
- },
7131
- type: "button",
7132
- children: "Remove Section Image"
7133
- }
7134
- ),
7135
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7136
- "Image Fit",
7137
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7138
- "select",
7139
- {
7140
- onChange: (event) => updateSelectedField("imageFit", event.target.value),
7141
- style: sidebarInputStyle,
7142
- value: normalizeImageFit2(selectedBlock.imageFit),
7143
- children: [
7144
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "cover", children: "Cover" }),
7145
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "contain", children: "Contain" })
7146
- ]
7147
- }
7148
- )
7149
- ] }),
7150
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7151
- "Image Corners",
7152
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7153
- "select",
7154
- {
7155
- onChange: (event) => updateSelectedField("imageCornerStyle", event.target.value),
7156
- style: sidebarInputStyle,
7157
- value: normalizeImageCornerStyle2(selectedBlock.imageCornerStyle),
7158
- children: [
7159
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "rounded", children: "Rounded" }),
7160
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "square", children: "Square" })
7161
- ]
7162
- }
7163
- )
7164
- ] }),
7165
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7166
- "Image Position",
7167
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7168
- "select",
7169
- {
7170
- onChange: (event) => updateSelectedField("imagePosition", event.target.value),
7171
- style: sidebarInputStyle,
7172
- value: normalizeImagePosition2(selectedBlock.imagePosition),
7173
- children: [
7174
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "center", children: "Center" }),
7175
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "top", children: "Top" }),
7176
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "bottom", children: "Bottom" }),
7177
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "left", children: "Left" }),
7178
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "right", children: "Right" })
7179
- ]
7180
- }
7181
- )
7182
- ] })
7183
- ] });
7184
- })(),
7185
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7186
- "Upload Section Image",
7187
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7188
- "input",
7189
- {
7190
- accept: "image/*",
7191
- disabled: uploadingTarget !== null,
7192
- onChange: (event) => {
7193
- const file = event.currentTarget.files?.[0];
7194
- if (file) {
7195
- void uploadMediaForSelected({ kind: "media" }, file);
7196
- }
7197
- event.currentTarget.value = "";
7198
- },
7199
- style: sidebarInputStyle,
7200
- type: "file"
7201
- }
7202
- )
7203
- ] })
7204
- ] }) : null,
7205
- selectedType === "richText" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7206
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7207
- "Content",
7208
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7209
- "textarea",
7210
- {
7211
- onChange: (event) => updateSelectedField("content", createLexicalText(event.target.value || "")),
7212
- style: { ...sidebarInputStyle, minHeight: 140, resize: "vertical" },
7213
- value: extractLexicalText(selectedBlock.content)
7214
- }
7215
- )
7216
- ] }),
7217
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7218
- "Content Width",
7219
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7220
- "select",
7221
- {
7222
- onChange: (event) => updateSelectedField("width", event.target.value),
7223
- style: sidebarInputStyle,
7224
- value: normalizeText2(selectedBlock.width, "normal"),
7225
- children: [
7226
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "normal", children: "Normal" }),
7227
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "narrow", children: "Narrow" })
7228
- ]
7229
- }
7230
- )
7231
- ] })
7232
- ] }) : null,
7233
- selectedType === "formEmbed" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7234
- "Form Type",
7235
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7236
- "select",
7237
- {
7238
- onChange: (event) => updateSelectedField("formType", event.target.value),
7239
- style: sidebarInputStyle,
7240
- value: normalizeText2(selectedBlock.formType, "quote"),
7241
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "quote", children: "Quote" })
7242
- }
7243
- )
7244
- ] }) : null,
7245
- selectedType === "testimonials" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: (() => {
7246
- const visibleCountValue = Math.max(
7247
- 1,
7248
- Math.min(6, Math.floor(parsePixelNumber(selectedBlock.visibleCount, 3)))
7249
- );
7250
- const rotateIntervalValue = Math.max(
7251
- 2,
7252
- Math.min(30, Math.floor(parsePixelNumber(selectedBlock.rotateIntervalSeconds, 7)))
7253
- );
7254
- const autoRotateValue = typeof selectedBlock.autoRotate === "boolean" ? selectedBlock.autoRotate : true;
7255
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7256
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7257
- "Visible At Once",
7258
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7259
- "input",
7260
- {
7261
- max: 6,
7262
- min: 1,
7263
- onChange: (event) => updateSelectedField("visibleCount", Number(event.target.value)),
7264
- style: sidebarInputStyle,
7265
- type: "number",
7266
- value: visibleCountValue
7267
- }
7268
- )
7269
- ] }),
7270
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: { ...sidebarLabelStyle, alignItems: "center", gridTemplateColumns: "auto 1fr" }, children: [
7271
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7272
- "input",
7273
- {
7274
- checked: autoRotateValue,
7275
- onChange: (event) => updateSelectedField("autoRotate", event.target.checked),
7276
- type: "checkbox"
7277
- }
7278
- ),
7279
- "Auto Rotate"
7280
- ] }),
7281
- autoRotateValue ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7282
- "Rotate Interval (seconds)",
7283
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7284
- "input",
7285
- {
7286
- max: 30,
7287
- min: 2,
7288
- onChange: (event) => updateSelectedField("rotateIntervalSeconds", Number(event.target.value)),
7289
- style: sidebarInputStyle,
7290
- type: "number",
7291
- value: rotateIntervalValue
7292
- }
7293
- )
7294
- ] }) : null
7295
- ] });
7296
- })() }) : null,
7297
- isArrayItemBlockSelected ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7298
- ArrayItemsEditor,
7299
- {
7300
- blockType: selectedType,
7301
- expandedItemIndex,
7302
- isUploadingItemMedia: isSelectedItemMediaUploading,
7303
- items: selectedItems,
7304
- mediaLibrary,
7305
- mediaLibraryError,
7306
- mediaLibraryLoading,
7307
- mode: "advanced",
7308
- onAddItem: appendDefaultItemToSelected,
7309
- onRemoveItem: (itemIndex) => removeItemFromSelected("items", itemIndex),
7310
- onSetItemMediaFromLibrary: setSelectedItemMediaFieldFromLibrary,
7311
- onToggleItem: toggleSelectedItem,
7312
- onUpdateItemField: (itemIndex, fieldName, value) => updateArrayItemField(selectedIndex ?? 0, "items", itemIndex, fieldName, value),
7313
- onUpdateItemSetting: (itemIndex, path, value) => updateArrayItemSettingField(selectedIndex ?? 0, "items", itemIndex, path, value),
7314
- onUploadItemMedia: uploadItemMediaFromV2,
7315
- searchQuery: "",
7316
- showInlineCopyFields: true,
7317
- uploadDisabled: uploadingTarget !== null
7318
- }
7319
- ) : null
7320
- ] }),
6079
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6080
+ BlockInspectorRenderer,
6081
+ {
6082
+ block: selectedBlock,
6083
+ blockType: selectedType,
6084
+ mode: settingsPanelMode,
6085
+ onModeChange: setSettingsPanelMode,
6086
+ onSearchQueryChange: setSettingsSearchQuery,
6087
+ onUpdateField: updateSelectedField,
6088
+ onUpdateSetting: updateSelectedSettingField,
6089
+ searchQuery: settingsSearchQuery
6090
+ }
6091
+ ),
6092
+ isArrayItemBlockSelected ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6093
+ ArrayItemsEditor,
6094
+ {
6095
+ blockType: selectedType,
6096
+ expandedItemIndex,
6097
+ isUploadingItemMedia: isSelectedItemMediaUploading,
6098
+ items: selectedItems,
6099
+ mediaLibrary,
6100
+ mediaLibraryError,
6101
+ mediaLibraryLoading,
6102
+ mode: settingsPanelMode,
6103
+ onAddItem: appendDefaultItemToSelected,
6104
+ onRemoveItem: (itemIndex) => removeItemFromSelected("items", itemIndex),
6105
+ onSetItemMediaFromLibrary: setSelectedItemMediaFieldFromLibrary,
6106
+ onToggleItem: toggleSelectedItem,
6107
+ onUpdateItemField: (itemIndex, fieldName, value) => updateArrayItemField(selectedIndex ?? 0, "items", itemIndex, fieldName, value),
6108
+ onUpdateItemSetting: (itemIndex, path, value) => updateArrayItemSettingField(selectedIndex ?? 0, "items", itemIndex, path, value),
6109
+ onUploadItemMedia: uploadItemMediaFromV2,
6110
+ searchQuery: settingsSearchQuery,
6111
+ showInlineCopyFields: editCopyInPanelEnabled,
6112
+ uploadDisabled: uploadingTarget !== null
6113
+ }
6114
+ ) : null,
7321
6115
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: sidebarLabelStyle, children: [
7322
6116
  "Upload Alt Text",
7323
6117
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(