@ohhwells/bridge 0.1.55-next.158 → 0.1.56
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/index.cjs +154 -1279
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -12
- package/dist/index.d.ts +2 -12
- package/dist/index.js +152 -1276
- package/dist/index.js.map +1 -1
- package/dist/styles.css +0 -58
- package/package.json +1 -6
- package/dist/pages.cjs +0 -141
- package/dist/pages.cjs.map +0 -1
- package/dist/pages.d.cts +0 -45
- package/dist/pages.d.ts +0 -45
- package/dist/pages.js +0 -107
- package/dist/pages.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -118,129 +118,6 @@ function deleteSectionFromState(state, sectionId) {
|
|
|
118
118
|
return { ...state, v: 1, sections: state.sections, removed: [...removed, sectionId] };
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// src/lib/brand-chrome.ts
|
|
122
|
-
var BRAND_NAME_KEY = "__ohw_brand_name";
|
|
123
|
-
var BRAND_TITLE_KEY = "__ohw_site_title";
|
|
124
|
-
var BRAND_FAVICON_LETTER_KEY = "__ohw_favicon_letter";
|
|
125
|
-
var BRAND_CHROME_KEYS = /* @__PURE__ */ new Set([
|
|
126
|
-
BRAND_NAME_KEY,
|
|
127
|
-
BRAND_TITLE_KEY,
|
|
128
|
-
BRAND_FAVICON_LETTER_KEY
|
|
129
|
-
]);
|
|
130
|
-
function upsertMeta(selector, attr, token, value) {
|
|
131
|
-
let el = document.head.querySelector(selector);
|
|
132
|
-
if (!el) {
|
|
133
|
-
el = document.createElement("meta");
|
|
134
|
-
el.setAttribute(attr, token);
|
|
135
|
-
document.head.appendChild(el);
|
|
136
|
-
}
|
|
137
|
-
if (el.getAttribute("content") !== value) el.setAttribute("content", value);
|
|
138
|
-
}
|
|
139
|
-
function escapeXml(value) {
|
|
140
|
-
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
141
|
-
}
|
|
142
|
-
function applyLetterFavicon(letter) {
|
|
143
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#111827"/><text x="32" y="46" font-family="system-ui,-apple-system,Segoe UI,sans-serif" font-size="40" font-weight="700" text-anchor="middle" fill="#ffffff">${escapeXml(letter)}</text></svg>`;
|
|
144
|
-
const href = `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
145
|
-
let link = document.head.querySelector('link[rel="icon"]');
|
|
146
|
-
if (!link) {
|
|
147
|
-
link = document.createElement("link");
|
|
148
|
-
link.rel = "icon";
|
|
149
|
-
document.head.appendChild(link);
|
|
150
|
-
}
|
|
151
|
-
link.type = "image/svg+xml";
|
|
152
|
-
if (link.href !== href) link.href = href;
|
|
153
|
-
}
|
|
154
|
-
function applyBrandChrome(content) {
|
|
155
|
-
const name = content[BRAND_NAME_KEY];
|
|
156
|
-
if (typeof name === "string" && name.length > 0) {
|
|
157
|
-
document.querySelectorAll("[data-ohw-wordmark]").forEach((el) => {
|
|
158
|
-
if (el.textContent !== name) el.textContent = name;
|
|
159
|
-
if (el.getAttribute("title") !== name) el.setAttribute("title", name);
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
const title = content[BRAND_TITLE_KEY];
|
|
163
|
-
if (typeof title === "string" && title.length > 0) {
|
|
164
|
-
if (document.title !== title) document.title = title;
|
|
165
|
-
upsertMeta('meta[property="og:title"]', "property", "og:title", title);
|
|
166
|
-
upsertMeta('meta[name="twitter:title"]', "name", "twitter:title", title);
|
|
167
|
-
}
|
|
168
|
-
const letter = content[BRAND_FAVICON_LETTER_KEY];
|
|
169
|
-
if (typeof letter === "string" && letter.length > 0) {
|
|
170
|
-
applyLetterFavicon(letter);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// src/lib/brand-kit.ts
|
|
175
|
-
var BRAND_KIT_KEY = "__ohw_brand";
|
|
176
|
-
var BRAND_VAR_PREFIX = "--ohw-brand-";
|
|
177
|
-
var BRAND_VAR_NAMES = ["primary", "accent", "light", "dark", "surface", "border", "muted"].map(
|
|
178
|
-
(role) => `${BRAND_VAR_PREFIX}${role}`
|
|
179
|
-
);
|
|
180
|
-
var FONT_VARS = { heading: ["--font-heading", "--font-display"], body: ["--font-body"] };
|
|
181
|
-
var BRAND_FONT_LINK_ID = "ohw-brand-fonts";
|
|
182
|
-
function brandColorVars(kit) {
|
|
183
|
-
const { dark, primary, accent, light } = kit.palette;
|
|
184
|
-
const mix = (a, aPct, b) => `color-mix(in srgb, ${a} ${aPct}%, ${b})`;
|
|
185
|
-
return {
|
|
186
|
-
[`${BRAND_VAR_PREFIX}primary`]: primary,
|
|
187
|
-
[`${BRAND_VAR_PREFIX}accent`]: accent,
|
|
188
|
-
[`${BRAND_VAR_PREFIX}light`]: light,
|
|
189
|
-
[`${BRAND_VAR_PREFIX}dark`]: dark,
|
|
190
|
-
[`${BRAND_VAR_PREFIX}surface`]: mix(light, 95, dark),
|
|
191
|
-
[`${BRAND_VAR_PREFIX}border`]: mix(light, 85, dark),
|
|
192
|
-
[`${BRAND_VAR_PREFIX}muted`]: mix(dark, 62, light)
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
function parseBrandKit(raw) {
|
|
196
|
-
if (!raw) return null;
|
|
197
|
-
try {
|
|
198
|
-
const parsed = JSON.parse(raw);
|
|
199
|
-
const p = parsed?.palette;
|
|
200
|
-
const f = parsed?.fonts;
|
|
201
|
-
if (!p || !f || typeof p.dark !== "string" || typeof p.primary !== "string" || typeof p.accent !== "string" || typeof p.light !== "string" || typeof f.heading !== "string" || typeof f.body !== "string") {
|
|
202
|
-
return null;
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
palette: { dark: p.dark, primary: p.primary, accent: p.accent, light: p.light },
|
|
206
|
-
fonts: { heading: f.heading, body: f.body }
|
|
207
|
-
};
|
|
208
|
-
} catch {
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function familyOf(stack) {
|
|
213
|
-
const first = stack.split(",")[0]?.trim() ?? "";
|
|
214
|
-
return first.replace(/^['"]|['"]$/g, "");
|
|
215
|
-
}
|
|
216
|
-
function loadBrandFonts(families) {
|
|
217
|
-
const unique = [...new Set(families.map((f) => f.trim()).filter(Boolean))];
|
|
218
|
-
if (unique.length === 0) return;
|
|
219
|
-
const spec = unique.map((f) => `${f.replace(/ /g, "+")}:400,500,600,700`).join("|");
|
|
220
|
-
const href = `https://fonts.googleapis.com/css?family=${spec}&display=swap`;
|
|
221
|
-
let link = document.getElementById(BRAND_FONT_LINK_ID);
|
|
222
|
-
if (!link) {
|
|
223
|
-
link = document.createElement("link");
|
|
224
|
-
link.id = BRAND_FONT_LINK_ID;
|
|
225
|
-
link.rel = "stylesheet";
|
|
226
|
-
document.head.appendChild(link);
|
|
227
|
-
}
|
|
228
|
-
if (link.href !== href) link.href = href;
|
|
229
|
-
}
|
|
230
|
-
function applyBrandToDom(kit) {
|
|
231
|
-
const root = document.documentElement;
|
|
232
|
-
if (!kit) {
|
|
233
|
-
for (const name of BRAND_VAR_NAMES) root.style.removeProperty(name);
|
|
234
|
-
for (const name of [...FONT_VARS.heading, ...FONT_VARS.body]) root.style.removeProperty(name);
|
|
235
|
-
document.getElementById(BRAND_FONT_LINK_ID)?.remove();
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
for (const [name, value] of Object.entries(brandColorVars(kit))) root.style.setProperty(name, value);
|
|
239
|
-
for (const name of FONT_VARS.heading) root.style.setProperty(name, kit.fonts.heading);
|
|
240
|
-
for (const name of FONT_VARS.body) root.style.setProperty(name, kit.fonts.body);
|
|
241
|
-
loadBrandFonts([familyOf(kit.fonts.heading), familyOf(kit.fonts.body)]);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
121
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
245
122
|
import { flushSync } from "react-dom";
|
|
246
123
|
import { createRoot } from "react-dom/client";
|
|
@@ -1327,34 +1204,17 @@ import { jsx as jsx2 } from "react/jsx-runtime";
|
|
|
1327
1204
|
var CONTAINER_ATTR = "data-ohw-ai-generated";
|
|
1328
1205
|
var REPLACED_ATTR = "data-ohw-ai-replaced-by";
|
|
1329
1206
|
var REMOVED_ATTR = "data-ohw-ai-removed";
|
|
1330
|
-
function readRootVar(name) {
|
|
1331
|
-
if (typeof document === "undefined") return "";
|
|
1332
|
-
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
1333
|
-
}
|
|
1334
|
-
function deriveBrandOverride() {
|
|
1335
|
-
const dark = readRootVar("--ohw-brand-dark");
|
|
1336
|
-
const primary = readRootVar("--ohw-brand-primary");
|
|
1337
|
-
const light = readRootVar("--ohw-brand-light");
|
|
1338
|
-
if (!dark || !primary || !light) return null;
|
|
1339
|
-
const accent = readRootVar("--ohw-brand-accent");
|
|
1340
|
-
const heading = readRootVar("--font-heading") || readRootVar("--font-display");
|
|
1341
|
-
const body = readRootVar("--font-body");
|
|
1342
|
-
return {
|
|
1343
|
-
palette: { dark, primary, accent: accent || dark, light },
|
|
1344
|
-
fonts: {
|
|
1345
|
-
heading: heading || AI_DEFAULT_BRAND.fonts.heading,
|
|
1346
|
-
body: body || AI_DEFAULT_BRAND.fonts.body
|
|
1347
|
-
}
|
|
1348
|
-
};
|
|
1349
|
-
}
|
|
1350
1207
|
function deriveTemplateBrand() {
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
const
|
|
1208
|
+
if (typeof document === "undefined") return null;
|
|
1209
|
+
const cs = getComputedStyle(document.documentElement);
|
|
1210
|
+
const read = (name) => cs.getPropertyValue(name).trim();
|
|
1211
|
+
const dark = read("--color-dark");
|
|
1212
|
+
const primary = read("--color-primary");
|
|
1213
|
+
const light = read("--color-light");
|
|
1354
1214
|
if (!dark || !primary || !light) return null;
|
|
1355
|
-
const accent =
|
|
1356
|
-
const heading =
|
|
1357
|
-
const body =
|
|
1215
|
+
const accent = read("--color-accent");
|
|
1216
|
+
const heading = read("--font-heading") || read("--font-display");
|
|
1217
|
+
const body = read("--font-body");
|
|
1358
1218
|
return {
|
|
1359
1219
|
palette: { dark, primary, accent: accent || dark, light },
|
|
1360
1220
|
fonts: {
|
|
@@ -1446,9 +1306,7 @@ function syncReplacedOriginals(state) {
|
|
|
1446
1306
|
}
|
|
1447
1307
|
function applyAiSectionsToDom(state, options) {
|
|
1448
1308
|
if (typeof document === "undefined") return;
|
|
1449
|
-
const brandOverride = deriveBrandOverride();
|
|
1450
1309
|
const templateBrand = deriveTemplateBrand();
|
|
1451
|
-
const brandKey = brandOverride ? JSON.stringify(brandOverride) : "";
|
|
1452
1310
|
const activeIds = new Set(state.sections.map((entry) => entry.id));
|
|
1453
1311
|
for (const [id, section] of mounted) {
|
|
1454
1312
|
if (!activeIds.has(id)) {
|
|
@@ -1458,7 +1316,7 @@ function applyAiSectionsToDom(state, options) {
|
|
|
1458
1316
|
}
|
|
1459
1317
|
}
|
|
1460
1318
|
for (const entry of state.sections) {
|
|
1461
|
-
const serialized = JSON.stringify(entry)
|
|
1319
|
+
const serialized = JSON.stringify(entry);
|
|
1462
1320
|
const existing = mounted.get(entry.id);
|
|
1463
1321
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
1464
1322
|
continue;
|
|
@@ -1482,7 +1340,7 @@ function applyAiSectionsToDom(state, options) {
|
|
|
1482
1340
|
AiTreeRenderer,
|
|
1483
1341
|
{
|
|
1484
1342
|
tree: entry.tree,
|
|
1485
|
-
brand:
|
|
1343
|
+
brand: entry.brand ?? options?.brand ?? templateBrand ?? void 0,
|
|
1486
1344
|
resolveMedia,
|
|
1487
1345
|
editKeyPrefix: `ai.${entry.id}`
|
|
1488
1346
|
}
|
|
@@ -2099,7 +1957,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
2099
1957
|
const autoId = useId();
|
|
2100
1958
|
const insertAfter = insertAfterProp ?? autoId;
|
|
2101
1959
|
const [schedule, setSchedule] = useState2(null);
|
|
2102
|
-
const [loading, setLoading] = useState2(
|
|
1960
|
+
const [loading, setLoading] = useState2(true);
|
|
2103
1961
|
const [inEditor, setInEditor] = useState2(false);
|
|
2104
1962
|
const [isHovered, setIsHovered] = useState2(false);
|
|
2105
1963
|
const [modalState, setModalState] = useState2(null);
|
|
@@ -2273,10 +2131,8 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
2273
2131
|
"*"
|
|
2274
2132
|
);
|
|
2275
2133
|
};
|
|
2134
|
+
if (!inEditor && !loading && !schedule) return null;
|
|
2276
2135
|
const sectionId = `scheduling-${insertAfter}`;
|
|
2277
|
-
if (!inEditor && !loading && !schedule) {
|
|
2278
|
-
return /* @__PURE__ */ jsx4("section", { "data-ohw-section": sectionId, "data-ohw-scheduling-anchor": insertAfter, style: { display: "none" } });
|
|
2279
|
-
}
|
|
2280
2136
|
return /* @__PURE__ */ jsxs3(
|
|
2281
2137
|
"section",
|
|
2282
2138
|
{
|
|
@@ -10906,329 +10762,6 @@ function deleteFooterColumn(column) {
|
|
|
10906
10762
|
};
|
|
10907
10763
|
}
|
|
10908
10764
|
|
|
10909
|
-
// src/lib/logo-identity.ts
|
|
10910
|
-
var LOGO_TEXT_KEYS = ["nav-logo-text", "footer-logo-text", "logo-text"];
|
|
10911
|
-
var LOGO_IMAGE_KEYS = ["nav-logo-image", "footer-logo", "footer-logo-image"];
|
|
10912
|
-
var LOGO_HREF_KEYS = ["nav-logo-href", "footer-logo-href", "logo-href"];
|
|
10913
|
-
var LOGO_PLACEHOLDER_KEY = "logo-is-placeholder";
|
|
10914
|
-
var LOGO_ALT_KEY = "logo-alt";
|
|
10915
|
-
var LOGO_IMAGE_URL_KEY = "nav-logo-image";
|
|
10916
|
-
var PLACEHOLDER_BUSINESS_NAME = "Business name";
|
|
10917
|
-
function resolveLogoDisplayText(text) {
|
|
10918
|
-
const trimmed = (text ?? "").trim();
|
|
10919
|
-
return trimmed || PLACEHOLDER_BUSINESS_NAME;
|
|
10920
|
-
}
|
|
10921
|
-
function isFooterLogoRoot(root) {
|
|
10922
|
-
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
10923
|
-
}
|
|
10924
|
-
function imageKeyForRoot(root) {
|
|
10925
|
-
return isFooterLogoRoot(root) ? "footer-logo" : "nav-logo-image";
|
|
10926
|
-
}
|
|
10927
|
-
function textKeyForRoot(root) {
|
|
10928
|
-
return isFooterLogoRoot(root) ? "footer-logo-text" : "nav-logo-text";
|
|
10929
|
-
}
|
|
10930
|
-
function ensureLogoHrefKey(root) {
|
|
10931
|
-
if (!(root instanceof HTMLAnchorElement)) return;
|
|
10932
|
-
if (root.hasAttribute("data-ohw-href-key")) return;
|
|
10933
|
-
root.setAttribute("data-ohw-href-key", isFooterLogoRoot(root) ? "footer-logo-href" : "nav-logo-href");
|
|
10934
|
-
}
|
|
10935
|
-
function applyLogoIdentity(text, isPlaceholder) {
|
|
10936
|
-
const display = resolveLogoDisplayText(text);
|
|
10937
|
-
const placeholder = isPlaceholder || !text.trim() || display === PLACEHOLDER_BUSINESS_NAME;
|
|
10938
|
-
for (const key of LOGO_TEXT_KEYS) {
|
|
10939
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
10940
|
-
if (el.textContent !== display) el.textContent = display;
|
|
10941
|
-
});
|
|
10942
|
-
}
|
|
10943
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
10944
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
10945
|
-
const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
10946
|
-
if (img) img.alt = display;
|
|
10947
|
-
});
|
|
10948
|
-
}
|
|
10949
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((el) => {
|
|
10950
|
-
if (placeholder) el.setAttribute("data-ohw-placeholder", "");
|
|
10951
|
-
else el.removeAttribute("data-ohw-placeholder");
|
|
10952
|
-
});
|
|
10953
|
-
return display;
|
|
10954
|
-
}
|
|
10955
|
-
function applyLogoImage(url, alt) {
|
|
10956
|
-
const displayAlt = resolveLogoDisplayText(alt);
|
|
10957
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
10958
|
-
ensureLogoHrefKey(root);
|
|
10959
|
-
const imageKey = imageKeyForRoot(root);
|
|
10960
|
-
const textKey = textKeyForRoot(root);
|
|
10961
|
-
let img = root.querySelector(`img[data-ohw-key="${imageKey}"]`) ?? (root.querySelector(`[data-ohw-key="${imageKey}"]`) instanceof HTMLImageElement ? root.querySelector(`[data-ohw-key="${imageKey}"]`) : null) ?? root.querySelector("img");
|
|
10962
|
-
let textEl = root.querySelector(`[data-ohw-key="${textKey}"]`) ?? root.querySelector('[data-ohw-key="logo-text"]');
|
|
10963
|
-
if (url) {
|
|
10964
|
-
if (!img) {
|
|
10965
|
-
img = document.createElement("img");
|
|
10966
|
-
img.setAttribute("data-ohw-editable", "image");
|
|
10967
|
-
img.setAttribute("data-ohw-key", imageKey);
|
|
10968
|
-
img.alt = displayAlt;
|
|
10969
|
-
img.style.height = "";
|
|
10970
|
-
img.style.maxHeight = "none";
|
|
10971
|
-
img.style.width = "auto";
|
|
10972
|
-
img.style.display = "block";
|
|
10973
|
-
img.style.objectFit = "contain";
|
|
10974
|
-
root.insertBefore(img, root.firstChild);
|
|
10975
|
-
} else {
|
|
10976
|
-
img.setAttribute("data-ohw-editable", "image");
|
|
10977
|
-
img.setAttribute("data-ohw-key", imageKey);
|
|
10978
|
-
}
|
|
10979
|
-
img.removeAttribute("srcset");
|
|
10980
|
-
img.removeAttribute("sizes");
|
|
10981
|
-
img.src = url;
|
|
10982
|
-
img.alt = displayAlt;
|
|
10983
|
-
img.style.display = "block";
|
|
10984
|
-
if (textEl) textEl.style.display = "none";
|
|
10985
|
-
root.removeAttribute("data-ohw-placeholder");
|
|
10986
|
-
return;
|
|
10987
|
-
}
|
|
10988
|
-
if (img) {
|
|
10989
|
-
img.removeAttribute("src");
|
|
10990
|
-
img.removeAttribute("srcset");
|
|
10991
|
-
img.removeAttribute("sizes");
|
|
10992
|
-
img.alt = displayAlt;
|
|
10993
|
-
img.style.display = "none";
|
|
10994
|
-
}
|
|
10995
|
-
if (!textEl) {
|
|
10996
|
-
textEl = document.createElement("span");
|
|
10997
|
-
textEl.setAttribute("data-ohw-editable", "plain");
|
|
10998
|
-
textEl.setAttribute("data-ohw-key", textKey);
|
|
10999
|
-
root.appendChild(textEl);
|
|
11000
|
-
}
|
|
11001
|
-
textEl.style.display = "";
|
|
11002
|
-
if (textEl.textContent !== displayAlt) textEl.textContent = displayAlt;
|
|
11003
|
-
if (!displayAlt.trim() || displayAlt === PLACEHOLDER_BUSINESS_NAME) {
|
|
11004
|
-
root.setAttribute("data-ohw-placeholder", "");
|
|
11005
|
-
} else {
|
|
11006
|
-
root.removeAttribute("data-ohw-placeholder");
|
|
11007
|
-
}
|
|
11008
|
-
});
|
|
11009
|
-
}
|
|
11010
|
-
function applyLogoHref(href) {
|
|
11011
|
-
const target = href.trim() || "/";
|
|
11012
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
11013
|
-
ensureLogoHrefKey(root);
|
|
11014
|
-
if (root instanceof HTMLAnchorElement) {
|
|
11015
|
-
root.setAttribute("href", target);
|
|
11016
|
-
}
|
|
11017
|
-
});
|
|
11018
|
-
for (const key of LOGO_HREF_KEYS) setStoredLinkHref(key, target);
|
|
11019
|
-
}
|
|
11020
|
-
function readLogoIdentityFromDom() {
|
|
11021
|
-
let imageUrl = null;
|
|
11022
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
11023
|
-
const el = document.querySelector(`[data-ohw-key="${key}"]`);
|
|
11024
|
-
const img = el instanceof HTMLImageElement ? el : el?.querySelector("img");
|
|
11025
|
-
const attrSrc = img?.getAttribute("src")?.trim() ?? "";
|
|
11026
|
-
if (attrSrc && !attrSrc.startsWith("data:") && img && img.style.display !== "none") {
|
|
11027
|
-
imageUrl = img.currentSrc || img.src;
|
|
11028
|
-
break;
|
|
11029
|
-
}
|
|
11030
|
-
}
|
|
11031
|
-
let text = PLACEHOLDER_BUSINESS_NAME;
|
|
11032
|
-
let isPlaceholder = true;
|
|
11033
|
-
for (const key of LOGO_TEXT_KEYS) {
|
|
11034
|
-
const el = document.querySelector(`[data-ohw-key="${key}"]`);
|
|
11035
|
-
if (el?.textContent?.trim()) {
|
|
11036
|
-
text = el.textContent.trim();
|
|
11037
|
-
const logoRoot2 = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
11038
|
-
isPlaceholder = logoRoot2?.hasAttribute("data-ohw-placeholder") === true || text === PLACEHOLDER_BUSINESS_NAME;
|
|
11039
|
-
break;
|
|
11040
|
-
}
|
|
11041
|
-
}
|
|
11042
|
-
if (imageUrl) {
|
|
11043
|
-
const logoImg = document.querySelector(
|
|
11044
|
-
'[data-ohw-key="nav-logo-image"], [data-ohw-key="footer-logo"]'
|
|
11045
|
-
);
|
|
11046
|
-
const alt = logoImg?.alt?.trim() || text;
|
|
11047
|
-
isPlaceholder = false;
|
|
11048
|
-
const hrefEl = document.querySelector(
|
|
11049
|
-
'a[data-ohw-role="logo"], a[data-ohw-logo], [data-ohw-role="logo"]'
|
|
11050
|
-
);
|
|
11051
|
-
const href2 = (hrefEl instanceof HTMLAnchorElement ? hrefEl.getAttribute("href") : null) || hrefEl?.closest("a")?.getAttribute("href") || "/";
|
|
11052
|
-
return { text, isPlaceholder, imageUrl, href: href2, alt };
|
|
11053
|
-
}
|
|
11054
|
-
const logoRoot = document.querySelector('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
11055
|
-
const href = (logoRoot instanceof HTMLAnchorElement ? logoRoot.getAttribute("href") : null) || logoRoot?.closest("a")?.getAttribute("href") || "/";
|
|
11056
|
-
return { text, isPlaceholder, imageUrl: null, href, alt: text };
|
|
11057
|
-
}
|
|
11058
|
-
function applyLogoFromContent(content) {
|
|
11059
|
-
const hasLogoIdentity = LOGO_PLACEHOLDER_KEY in content || LOGO_TEXT_KEYS.some((key) => key in content) || LOGO_IMAGE_KEYS.some((key) => key in content) || LOGO_ALT_KEY in content || LOGO_HREF_KEYS.some((key) => key in content);
|
|
11060
|
-
if (!hasLogoIdentity) return false;
|
|
11061
|
-
const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
|
|
11062
|
-
const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
|
|
11063
|
-
const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
|
|
11064
|
-
const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
|
|
11065
|
-
const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
|
|
11066
|
-
const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
|
|
11067
|
-
if (logoImageUrl) {
|
|
11068
|
-
applyLogoImage(logoImageUrl, logoAlt);
|
|
11069
|
-
} else {
|
|
11070
|
-
if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
|
|
11071
|
-
applyLogoIdentity(logoText, logoIsPlaceholder);
|
|
11072
|
-
}
|
|
11073
|
-
const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
|
|
11074
|
-
if (typeof logoHref === "string" && logoHref.trim()) {
|
|
11075
|
-
applyLogoHref(logoHref);
|
|
11076
|
-
}
|
|
11077
|
-
return true;
|
|
11078
|
-
}
|
|
11079
|
-
|
|
11080
|
-
// src/lib/logo-size.ts
|
|
11081
|
-
var LOGO_SIZE_DEFAULTS = {
|
|
11082
|
-
navbar: 28,
|
|
11083
|
-
footer: 32
|
|
11084
|
-
};
|
|
11085
|
-
var LOGO_SIZE_MIN = 16;
|
|
11086
|
-
var LOGO_SIZE_MAX = 80;
|
|
11087
|
-
var LOGO_SIZE_DESKTOP_KEYS = {
|
|
11088
|
-
navbar: "nav-logo-size",
|
|
11089
|
-
footer: "footer-logo-size"
|
|
11090
|
-
};
|
|
11091
|
-
var LOGO_SIZE_MOBILE_KEYS = {
|
|
11092
|
-
navbar: "nav-logo-size-mobile",
|
|
11093
|
-
footer: "footer-logo-size-mobile"
|
|
11094
|
-
};
|
|
11095
|
-
var LOGO_SIZE_KEYS = [
|
|
11096
|
-
LOGO_SIZE_DESKTOP_KEYS.navbar,
|
|
11097
|
-
LOGO_SIZE_DESKTOP_KEYS.footer,
|
|
11098
|
-
LOGO_SIZE_MOBILE_KEYS.navbar,
|
|
11099
|
-
LOGO_SIZE_MOBILE_KEYS.footer
|
|
11100
|
-
];
|
|
11101
|
-
function isFooterLogoRoot2(root) {
|
|
11102
|
-
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
11103
|
-
}
|
|
11104
|
-
function getLogoPlacement(root) {
|
|
11105
|
-
return isFooterLogoRoot2(root) ? "footer" : "navbar";
|
|
11106
|
-
}
|
|
11107
|
-
function parseLogoSizePx(raw, fallback) {
|
|
11108
|
-
if (raw == null || raw === "") return fallback;
|
|
11109
|
-
const n = Number.parseFloat(raw);
|
|
11110
|
-
if (!Number.isFinite(n)) return fallback;
|
|
11111
|
-
return Math.min(LOGO_SIZE_MAX, Math.max(LOGO_SIZE_MIN, Math.round(n)));
|
|
11112
|
-
}
|
|
11113
|
-
function isMobileLogoSizeFollowing(content, placement) {
|
|
11114
|
-
const raw = content[LOGO_SIZE_MOBILE_KEYS[placement]];
|
|
11115
|
-
return raw == null || raw.trim() === "";
|
|
11116
|
-
}
|
|
11117
|
-
function resolveDesktopLogoSize(content, placement) {
|
|
11118
|
-
return parseLogoSizePx(content[LOGO_SIZE_DESKTOP_KEYS[placement]], LOGO_SIZE_DEFAULTS[placement]);
|
|
11119
|
-
}
|
|
11120
|
-
function resolveMobileLogoSize(content, placement) {
|
|
11121
|
-
if (isMobileLogoSizeFollowing(content, placement)) {
|
|
11122
|
-
return resolveDesktopLogoSize(content, placement);
|
|
11123
|
-
}
|
|
11124
|
-
return parseLogoSizePx(
|
|
11125
|
-
content[LOGO_SIZE_MOBILE_KEYS[placement]],
|
|
11126
|
-
resolveDesktopLogoSize(content, placement)
|
|
11127
|
-
);
|
|
11128
|
-
}
|
|
11129
|
-
function setRootSizeVars(root, desktopPx, mobilePx, following) {
|
|
11130
|
-
root.style.setProperty("--ohw-logo-size", `${desktopPx}px`);
|
|
11131
|
-
if (following) {
|
|
11132
|
-
root.style.removeProperty("--ohw-logo-size-mobile");
|
|
11133
|
-
} else {
|
|
11134
|
-
root.style.setProperty("--ohw-logo-size-mobile", `${mobilePx}px`);
|
|
11135
|
-
}
|
|
11136
|
-
root.querySelectorAll("img").forEach((img) => {
|
|
11137
|
-
img.style.height = "";
|
|
11138
|
-
img.style.maxHeight = "none";
|
|
11139
|
-
img.style.width = "auto";
|
|
11140
|
-
img.style.objectFit = "contain";
|
|
11141
|
-
});
|
|
11142
|
-
}
|
|
11143
|
-
function applyLogoSizes(content) {
|
|
11144
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
11145
|
-
const placement = getLogoPlacement(root);
|
|
11146
|
-
const desktop = resolveDesktopLogoSize(content, placement);
|
|
11147
|
-
const following = isMobileLogoSizeFollowing(content, placement);
|
|
11148
|
-
const mobile = following ? desktop : resolveMobileLogoSize(content, placement);
|
|
11149
|
-
setRootSizeVars(root, desktop, mobile, following);
|
|
11150
|
-
});
|
|
11151
|
-
}
|
|
11152
|
-
function applyLogoSizeToPlacement(placement, desktopPx, mobilePx, following) {
|
|
11153
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
11154
|
-
if (getLogoPlacement(root) !== placement) return;
|
|
11155
|
-
setRootSizeVars(root, desktopPx, mobilePx, following);
|
|
11156
|
-
});
|
|
11157
|
-
}
|
|
11158
|
-
function logoHasUploadedImage(logoEl) {
|
|
11159
|
-
if (logoEl.hasAttribute("data-ohw-placeholder")) return false;
|
|
11160
|
-
const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
|
|
11161
|
-
if (!img) return false;
|
|
11162
|
-
const src = img.getAttribute("src")?.trim() ?? "";
|
|
11163
|
-
if (!src || src.startsWith("data:")) return false;
|
|
11164
|
-
if (img.style.display === "none") return false;
|
|
11165
|
-
return true;
|
|
11166
|
-
}
|
|
11167
|
-
function getLogoInteractionRect(logoEl) {
|
|
11168
|
-
if (logoHasUploadedImage(logoEl)) {
|
|
11169
|
-
const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
|
|
11170
|
-
if (img) {
|
|
11171
|
-
const r2 = img.getBoundingClientRect();
|
|
11172
|
-
if (r2.width > 0 && r2.height > 0) return r2;
|
|
11173
|
-
}
|
|
11174
|
-
}
|
|
11175
|
-
const text = logoEl.querySelector(
|
|
11176
|
-
'[data-ohw-key="nav-logo-text"], [data-ohw-key="footer-logo-text"]'
|
|
11177
|
-
);
|
|
11178
|
-
if (text) {
|
|
11179
|
-
const style = window.getComputedStyle(text);
|
|
11180
|
-
if (style.display !== "none" && style.visibility !== "hidden") {
|
|
11181
|
-
const r2 = text.getBoundingClientRect();
|
|
11182
|
-
if (r2.width > 0 && r2.height > 0) return r2;
|
|
11183
|
-
}
|
|
11184
|
-
}
|
|
11185
|
-
return logoEl.getBoundingClientRect();
|
|
11186
|
-
}
|
|
11187
|
-
function readLogoSizeState(content, placement) {
|
|
11188
|
-
const desktopPx = resolveDesktopLogoSize(content, placement);
|
|
11189
|
-
const mobileFollowing = isMobileLogoSizeFollowing(content, placement);
|
|
11190
|
-
const mobilePx = mobileFollowing ? desktopPx : resolveMobileLogoSize(content, placement);
|
|
11191
|
-
return { desktopPx, mobilePx, mobileFollowing };
|
|
11192
|
-
}
|
|
11193
|
-
|
|
11194
|
-
// src/lib/site-wide-scope.ts
|
|
11195
|
-
function getLogoElement(el) {
|
|
11196
|
-
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
11197
|
-
if (marked) return marked;
|
|
11198
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
11199
|
-
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
11200
|
-
if (!root) return null;
|
|
11201
|
-
const anchor = el.closest("a");
|
|
11202
|
-
if (anchor && root.contains(anchor) && !anchor.hasAttribute("data-ohw-href-key") && !anchor.closest("[data-ohw-nav-container]") && Boolean(anchor.querySelector("img") || anchor.matches("img"))) {
|
|
11203
|
-
return anchor;
|
|
11204
|
-
}
|
|
11205
|
-
const img = el.matches("img") ? el : null;
|
|
11206
|
-
if (img && !img.closest("[data-ohw-href-key]") && !img.closest("[data-ohw-nav-container]") && (img.closest("footer") || img.closest("nav, [data-ohw-nav-root]"))) {
|
|
11207
|
-
return img;
|
|
11208
|
-
}
|
|
11209
|
-
return null;
|
|
11210
|
-
}
|
|
11211
|
-
function isInFooter(el) {
|
|
11212
|
-
if (!el) return false;
|
|
11213
|
-
return Boolean(el.closest("footer") || el.closest('[data-ohw-section="footer"]'));
|
|
11214
|
-
}
|
|
11215
|
-
function isSiteWideElement(el) {
|
|
11216
|
-
if (!el) return false;
|
|
11217
|
-
if (getLogoElement(el)) return true;
|
|
11218
|
-
if (isInFooter(el)) return true;
|
|
11219
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-root")) {
|
|
11220
|
-
return true;
|
|
11221
|
-
}
|
|
11222
|
-
if (el.hasAttribute("data-ohw-href-key") && el.closest("nav, [data-ohw-nav-root], [data-ohw-nav-drawer], aside")) {
|
|
11223
|
-
return true;
|
|
11224
|
-
}
|
|
11225
|
-
if (el.closest('[data-ohw-role="navbar-button"]')) return true;
|
|
11226
|
-
return false;
|
|
11227
|
-
}
|
|
11228
|
-
function isSiteWideScopeActive(args) {
|
|
11229
|
-
return isSiteWideElement(args.selected) || isSiteWideElement(args.hoveredItem) || isSiteWideElement(args.hoveredNavContainer) || isSiteWideElement(args.active);
|
|
11230
|
-
}
|
|
11231
|
-
|
|
11232
10765
|
// src/lib/add-footer-column.ts
|
|
11233
10766
|
function buildFooterColumnEditContentPatch(result) {
|
|
11234
10767
|
return {
|
|
@@ -11443,127 +10976,16 @@ function FloatingPanel({
|
|
|
11443
10976
|
);
|
|
11444
10977
|
}
|
|
11445
10978
|
|
|
11446
|
-
// src/ui/logo-size-panel.tsx
|
|
11447
|
-
import { ArrowUpRight, Link as Link2 } from "lucide-react";
|
|
11448
|
-
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11449
|
-
function SizeSlider({
|
|
11450
|
-
value,
|
|
11451
|
-
onChange
|
|
11452
|
-
}) {
|
|
11453
|
-
const pct = (value - LOGO_SIZE_MIN) / (LOGO_SIZE_MAX - LOGO_SIZE_MIN) * 100;
|
|
11454
|
-
return /* @__PURE__ */ jsxs17("div", { className: "flex w-full flex-col gap-3", children: [
|
|
11455
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center gap-2 text-sm font-medium leading-5", children: [
|
|
11456
|
-
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1 text-foreground", children: "Size" }),
|
|
11457
|
-
/* @__PURE__ */ jsxs17("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: [
|
|
11458
|
-
value,
|
|
11459
|
-
" px"
|
|
11460
|
-
] })
|
|
11461
|
-
] }),
|
|
11462
|
-
/* @__PURE__ */ jsxs17("div", { className: "relative h-2 w-full rounded-full bg-primary-50", children: [
|
|
11463
|
-
/* @__PURE__ */ jsx27(
|
|
11464
|
-
"div",
|
|
11465
|
-
{
|
|
11466
|
-
className: "absolute inset-y-0 left-0 rounded-full bg-primary",
|
|
11467
|
-
style: { width: `${pct}%` }
|
|
11468
|
-
}
|
|
11469
|
-
),
|
|
11470
|
-
/* @__PURE__ */ jsx27(
|
|
11471
|
-
"input",
|
|
11472
|
-
{
|
|
11473
|
-
type: "range",
|
|
11474
|
-
min: LOGO_SIZE_MIN,
|
|
11475
|
-
max: LOGO_SIZE_MAX,
|
|
11476
|
-
step: 1,
|
|
11477
|
-
value,
|
|
11478
|
-
"aria-label": "Logo size",
|
|
11479
|
-
className: cn(
|
|
11480
|
-
"absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent",
|
|
11481
|
-
"[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-5",
|
|
11482
|
-
"[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2",
|
|
11483
|
-
"[&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
|
|
11484
|
-
"[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full",
|
|
11485
|
-
"[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary",
|
|
11486
|
-
"[&::-moz-range-thumb]:bg-background"
|
|
11487
|
-
),
|
|
11488
|
-
onChange: (e) => onChange(Number(e.target.value))
|
|
11489
|
-
}
|
|
11490
|
-
)
|
|
11491
|
-
] })
|
|
11492
|
-
] });
|
|
11493
|
-
}
|
|
11494
|
-
function LogoSizePanel({
|
|
11495
|
-
viewport,
|
|
11496
|
-
sizePx,
|
|
11497
|
-
mobileFollowing = true,
|
|
11498
|
-
onSizeChange,
|
|
11499
|
-
onCustomizeMobile,
|
|
11500
|
-
onResetMobile,
|
|
11501
|
-
onUpdateEverywhere,
|
|
11502
|
-
className
|
|
11503
|
-
}) {
|
|
11504
|
-
const showFollowing = viewport === "mobile" && mobileFollowing;
|
|
11505
|
-
const showMobileSlider = viewport === "mobile" && !mobileFollowing;
|
|
11506
|
-
const showDesktopSlider = viewport === "desktop";
|
|
11507
|
-
return /* @__PURE__ */ jsxs17("div", { className: cn("flex w-full flex-col gap-4", className), children: [
|
|
11508
|
-
showFollowing ? /* @__PURE__ */ jsxs17("div", { className: "flex w-full flex-col gap-2", children: [
|
|
11509
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-1", children: [
|
|
11510
|
-
/* @__PURE__ */ jsx27(Link2, { size: 16, className: "mt-0.5 shrink-0 text-foreground", "aria-hidden": true }),
|
|
11511
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm font-semibold leading-5 text-foreground", children: "Following desktop size" })
|
|
11512
|
-
] }),
|
|
11513
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm leading-5 text-muted-foreground", children: "Mobile uses the desktop size until you customize it. Change the desktop size and it follows automatically." }),
|
|
11514
|
-
/* @__PURE__ */ jsx27(
|
|
11515
|
-
Button,
|
|
11516
|
-
{
|
|
11517
|
-
type: "button",
|
|
11518
|
-
variant: "outline",
|
|
11519
|
-
size: "sm",
|
|
11520
|
-
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
11521
|
-
onClick: onCustomizeMobile,
|
|
11522
|
-
children: "Customize for mobile"
|
|
11523
|
-
}
|
|
11524
|
-
)
|
|
11525
|
-
] }) : null,
|
|
11526
|
-
showDesktopSlider || showMobileSlider ? /* @__PURE__ */ jsx27(SizeSlider, { value: sizePx, onChange: onSizeChange }) : null,
|
|
11527
|
-
showMobileSlider ? /* @__PURE__ */ jsx27(
|
|
11528
|
-
Button,
|
|
11529
|
-
{
|
|
11530
|
-
type: "button",
|
|
11531
|
-
variant: "outline",
|
|
11532
|
-
size: "sm",
|
|
11533
|
-
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
11534
|
-
onClick: onResetMobile,
|
|
11535
|
-
children: "Reset to desktop size"
|
|
11536
|
-
}
|
|
11537
|
-
) : null,
|
|
11538
|
-
/* @__PURE__ */ jsx27("div", { className: "h-px w-full bg-border", role: "separator" }),
|
|
11539
|
-
/* @__PURE__ */ jsxs17(
|
|
11540
|
-
Button,
|
|
11541
|
-
{
|
|
11542
|
-
type: "button",
|
|
11543
|
-
variant: "outline",
|
|
11544
|
-
size: "sm",
|
|
11545
|
-
className: "h-9 w-full min-w-0 cursor-pointer gap-1",
|
|
11546
|
-
onClick: onUpdateEverywhere,
|
|
11547
|
-
children: [
|
|
11548
|
-
"Update logo everywhere",
|
|
11549
|
-
/* @__PURE__ */ jsx27(ArrowUpRight, { size: 16, "aria-hidden": true })
|
|
11550
|
-
]
|
|
11551
|
-
}
|
|
11552
|
-
),
|
|
11553
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm leading-5 text-muted-foreground", children: "Matches the right version to your background." })
|
|
11554
|
-
] });
|
|
11555
|
-
}
|
|
11556
|
-
|
|
11557
10979
|
// src/ui/socials-display-panel.tsx
|
|
11558
|
-
import { jsx as
|
|
10980
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11559
10981
|
function DisplaySwitch({
|
|
11560
10982
|
label,
|
|
11561
10983
|
checked,
|
|
11562
10984
|
disabled,
|
|
11563
10985
|
onChange
|
|
11564
10986
|
}) {
|
|
11565
|
-
return /* @__PURE__ */
|
|
11566
|
-
/* @__PURE__ */
|
|
10987
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center gap-2", children: [
|
|
10988
|
+
/* @__PURE__ */ jsx27(
|
|
11567
10989
|
"span",
|
|
11568
10990
|
{
|
|
11569
10991
|
className: cn(
|
|
@@ -11573,7 +10995,7 @@ function DisplaySwitch({
|
|
|
11573
10995
|
children: label
|
|
11574
10996
|
}
|
|
11575
10997
|
),
|
|
11576
|
-
/* @__PURE__ */
|
|
10998
|
+
/* @__PURE__ */ jsx27(
|
|
11577
10999
|
"button",
|
|
11578
11000
|
{
|
|
11579
11001
|
type: "button",
|
|
@@ -11587,7 +11009,7 @@ function DisplaySwitch({
|
|
|
11587
11009
|
checked ? "bg-primary" : "bg-primary-50",
|
|
11588
11010
|
disabled ? "cursor-default opacity-50" : "cursor-pointer"
|
|
11589
11011
|
),
|
|
11590
|
-
children: /* @__PURE__ */
|
|
11012
|
+
children: /* @__PURE__ */ jsx27(
|
|
11591
11013
|
"span",
|
|
11592
11014
|
{
|
|
11593
11015
|
className: cn(
|
|
@@ -11601,8 +11023,8 @@ function DisplaySwitch({
|
|
|
11601
11023
|
] });
|
|
11602
11024
|
}
|
|
11603
11025
|
function SocialsDisplayPanel({ display, onChange, className }) {
|
|
11604
|
-
return /* @__PURE__ */
|
|
11605
|
-
/* @__PURE__ */
|
|
11026
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("flex w-full flex-col gap-3", className), children: [
|
|
11027
|
+
/* @__PURE__ */ jsx27(
|
|
11606
11028
|
DisplaySwitch,
|
|
11607
11029
|
{
|
|
11608
11030
|
label: "Text",
|
|
@@ -11611,7 +11033,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
11611
11033
|
onChange: (text) => onChange({ ...display, text })
|
|
11612
11034
|
}
|
|
11613
11035
|
),
|
|
11614
|
-
/* @__PURE__ */
|
|
11036
|
+
/* @__PURE__ */ jsx27(
|
|
11615
11037
|
DisplaySwitch,
|
|
11616
11038
|
{
|
|
11617
11039
|
label: "Icon",
|
|
@@ -12172,7 +11594,7 @@ function useNavItemDrag({
|
|
|
12172
11594
|
|
|
12173
11595
|
// src/ui/footer-container-chrome.tsx
|
|
12174
11596
|
import { Plus as Plus2 } from "lucide-react";
|
|
12175
|
-
import { jsx as
|
|
11597
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
12176
11598
|
function FooterContainerChrome({
|
|
12177
11599
|
rect,
|
|
12178
11600
|
onAdd,
|
|
@@ -12180,7 +11602,7 @@ function FooterContainerChrome({
|
|
|
12180
11602
|
}) {
|
|
12181
11603
|
const chromeGap = 6;
|
|
12182
11604
|
const buttonMargin = 7;
|
|
12183
|
-
return /* @__PURE__ */
|
|
11605
|
+
return /* @__PURE__ */ jsx28(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx28(
|
|
12184
11606
|
"div",
|
|
12185
11607
|
{
|
|
12186
11608
|
"data-ohw-footer-container-chrome": "",
|
|
@@ -12192,8 +11614,8 @@ function FooterContainerChrome({
|
|
|
12192
11614
|
width: rect.width + chromeGap * 2,
|
|
12193
11615
|
height: rect.height + chromeGap * 2
|
|
12194
11616
|
},
|
|
12195
|
-
children: /* @__PURE__ */
|
|
12196
|
-
/* @__PURE__ */
|
|
11617
|
+
children: /* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
11618
|
+
/* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
12197
11619
|
"button",
|
|
12198
11620
|
{
|
|
12199
11621
|
type: "button",
|
|
@@ -12212,10 +11634,10 @@ function FooterContainerChrome({
|
|
|
12212
11634
|
if (addDisabled) return;
|
|
12213
11635
|
onAdd();
|
|
12214
11636
|
},
|
|
12215
|
-
children: /* @__PURE__ */
|
|
11637
|
+
children: /* @__PURE__ */ jsx28(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
12216
11638
|
}
|
|
12217
11639
|
) }),
|
|
12218
|
-
/* @__PURE__ */
|
|
11640
|
+
/* @__PURE__ */ jsx28(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
12219
11641
|
] })
|
|
12220
11642
|
}
|
|
12221
11643
|
) });
|
|
@@ -12398,18 +11820,6 @@ function collectEditableNodes(extraContent, root = document) {
|
|
|
12398
11820
|
}
|
|
12399
11821
|
if (extraContent && !isScoped) {
|
|
12400
11822
|
applyNavFooterDeleteOverrides(byKey, extraContent);
|
|
12401
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
12402
|
-
if (!(key in extraContent)) continue;
|
|
12403
|
-
byKey.set(key, { key, type: "image", text: extraContent[key] ?? "" });
|
|
12404
|
-
}
|
|
12405
|
-
for (const key of [LOGO_PLACEHOLDER_KEY, LOGO_ALT_KEY]) {
|
|
12406
|
-
if (!(key in extraContent)) continue;
|
|
12407
|
-
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
12408
|
-
}
|
|
12409
|
-
for (const key of LOGO_SIZE_KEYS) {
|
|
12410
|
-
if (!(key in extraContent)) continue;
|
|
12411
|
-
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
12412
|
-
}
|
|
12413
11823
|
}
|
|
12414
11824
|
return Array.from(byKey.values());
|
|
12415
11825
|
}
|
|
@@ -12676,13 +12086,13 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
12676
12086
|
|
|
12677
12087
|
// src/ui/navbar-container-chrome.tsx
|
|
12678
12088
|
import { Plus as Plus3 } from "lucide-react";
|
|
12679
|
-
import { jsx as
|
|
12089
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
12680
12090
|
function NavbarContainerChrome({
|
|
12681
12091
|
rect,
|
|
12682
12092
|
onAdd
|
|
12683
12093
|
}) {
|
|
12684
12094
|
const chromeGap = 6;
|
|
12685
|
-
return /* @__PURE__ */
|
|
12095
|
+
return /* @__PURE__ */ jsx29(
|
|
12686
12096
|
"div",
|
|
12687
12097
|
{
|
|
12688
12098
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -12694,7 +12104,7 @@ function NavbarContainerChrome({
|
|
|
12694
12104
|
width: rect.width + chromeGap * 2,
|
|
12695
12105
|
height: rect.height + chromeGap * 2
|
|
12696
12106
|
},
|
|
12697
|
-
children: /* @__PURE__ */
|
|
12107
|
+
children: /* @__PURE__ */ jsx29(
|
|
12698
12108
|
"button",
|
|
12699
12109
|
{
|
|
12700
12110
|
type: "button",
|
|
@@ -12711,7 +12121,7 @@ function NavbarContainerChrome({
|
|
|
12711
12121
|
e.stopPropagation();
|
|
12712
12122
|
onAdd();
|
|
12713
12123
|
},
|
|
12714
|
-
children: /* @__PURE__ */
|
|
12124
|
+
children: /* @__PURE__ */ jsx29(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
12715
12125
|
}
|
|
12716
12126
|
)
|
|
12717
12127
|
}
|
|
@@ -12720,7 +12130,7 @@ function NavbarContainerChrome({
|
|
|
12720
12130
|
|
|
12721
12131
|
// src/ui/drop-indicator.tsx
|
|
12722
12132
|
import * as React10 from "react";
|
|
12723
|
-
import { jsx as
|
|
12133
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
12724
12134
|
var dropIndicatorVariants = cva(
|
|
12725
12135
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
12726
12136
|
{
|
|
@@ -12744,7 +12154,7 @@ var dropIndicatorVariants = cva(
|
|
|
12744
12154
|
);
|
|
12745
12155
|
var DropIndicator = React10.forwardRef(
|
|
12746
12156
|
({ className, direction, state, ...props }, ref) => {
|
|
12747
|
-
return /* @__PURE__ */
|
|
12157
|
+
return /* @__PURE__ */ jsx30(
|
|
12748
12158
|
"div",
|
|
12749
12159
|
{
|
|
12750
12160
|
ref,
|
|
@@ -12761,7 +12171,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
12761
12171
|
DropIndicator.displayName = "DropIndicator";
|
|
12762
12172
|
|
|
12763
12173
|
// src/ui/badge.tsx
|
|
12764
|
-
import { jsx as
|
|
12174
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
12765
12175
|
var badgeVariants = cva(
|
|
12766
12176
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
12767
12177
|
{
|
|
@@ -12779,12 +12189,12 @@ var badgeVariants = cva(
|
|
|
12779
12189
|
}
|
|
12780
12190
|
);
|
|
12781
12191
|
function Badge({ className, variant, ...props }) {
|
|
12782
|
-
return /* @__PURE__ */
|
|
12192
|
+
return /* @__PURE__ */ jsx31("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
12783
12193
|
}
|
|
12784
12194
|
|
|
12785
12195
|
// src/OhhwellsBridge.tsx
|
|
12786
|
-
import { Link as
|
|
12787
|
-
import { Fragment as Fragment8, jsx as
|
|
12196
|
+
import { Link as Link2 } from "lucide-react";
|
|
12197
|
+
import { Fragment as Fragment8, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
12788
12198
|
var PRIMARY3 = "#0885FE";
|
|
12789
12199
|
var IMAGE_FADE_MS = 300;
|
|
12790
12200
|
function runOpacityFade(el, onDone) {
|
|
@@ -12878,10 +12288,21 @@ function parseSchedulingInsertAfter(insertAfter) {
|
|
|
12878
12288
|
insertBefore: insertAfter.slice(idx + INSERT_BEFORE_MARKER.length)
|
|
12879
12289
|
};
|
|
12880
12290
|
}
|
|
12881
|
-
function
|
|
12882
|
-
|
|
12883
|
-
const
|
|
12884
|
-
|
|
12291
|
+
function resolveSchedulingInsert(insertAfter, explicitInsertBefore) {
|
|
12292
|
+
const parsed = parseSchedulingInsertAfter(insertAfter);
|
|
12293
|
+
const insertBefore = explicitInsertBefore ?? parsed.insertBefore;
|
|
12294
|
+
const effectiveInsertAfter = insertBefore && parsed.insertBefore === null ? `${insertAfter}${INSERT_BEFORE_MARKER}${insertBefore}` : insertAfter;
|
|
12295
|
+
return { effectiveInsertAfter, insertBefore };
|
|
12296
|
+
}
|
|
12297
|
+
function getSchedulingMountPoint(insertAfter) {
|
|
12298
|
+
const { anchor } = parseSchedulingInsertAfter(insertAfter);
|
|
12299
|
+
let anchorEl = document.querySelector(`[data-ohw-section="${anchor}"]`);
|
|
12300
|
+
if (!anchorEl && anchor === "scheduling") {
|
|
12301
|
+
const widgets = Array.from(document.querySelectorAll('[data-ohw-section^="scheduling-"]'));
|
|
12302
|
+
anchorEl = widgets.at(-1) ?? null;
|
|
12303
|
+
}
|
|
12304
|
+
if (!anchorEl) return null;
|
|
12305
|
+
return anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
12885
12306
|
}
|
|
12886
12307
|
function schedulingMountDepth(insertAfter) {
|
|
12887
12308
|
if (!insertAfter.includes(INSERT_BEFORE_MARKER)) return 0;
|
|
@@ -12898,7 +12319,8 @@ function getPageSchedulingEntries(raw) {
|
|
|
12898
12319
|
}
|
|
12899
12320
|
}
|
|
12900
12321
|
function isSchedulingWidgetMissing(entry) {
|
|
12901
|
-
|
|
12322
|
+
const { effectiveInsertAfter } = resolveSchedulingInsert(entry.insertAfter);
|
|
12323
|
+
return !document.querySelector(`[data-ohw-section="${schedulingSectionId(effectiveInsertAfter)}"]`);
|
|
12902
12324
|
}
|
|
12903
12325
|
function hasMissingSchedulingWidgets(entries) {
|
|
12904
12326
|
return entries.some(isSchedulingWidgetMissing);
|
|
@@ -12928,17 +12350,16 @@ function initSectionsFromContent(content, removeExisting = false) {
|
|
|
12928
12350
|
} catch {
|
|
12929
12351
|
}
|
|
12930
12352
|
}
|
|
12931
|
-
function mountSchedulingWidget(
|
|
12932
|
-
const
|
|
12933
|
-
const sectionId = schedulingSectionId(
|
|
12353
|
+
function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId, explicitInsertBefore) {
|
|
12354
|
+
const { effectiveInsertAfter, insertBefore } = resolveSchedulingInsert(insertAfter, explicitInsertBefore);
|
|
12355
|
+
const sectionId = schedulingSectionId(effectiveInsertAfter);
|
|
12934
12356
|
if (document.querySelector(`[data-ohw-section="${sectionId}"]`)) return false;
|
|
12935
|
-
const
|
|
12936
|
-
if (!
|
|
12937
|
-
const mountPoint = anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
12357
|
+
const mountPoint = getSchedulingMountPoint(effectiveInsertAfter);
|
|
12358
|
+
if (!mountPoint) return false;
|
|
12938
12359
|
const container = document.createElement("div");
|
|
12939
12360
|
container.dataset.ohwSectionContainer = "scheduling";
|
|
12940
|
-
if (
|
|
12941
|
-
const beforeAnchor = document.querySelector(`[data-ohw-section="${
|
|
12361
|
+
if (insertBefore) {
|
|
12362
|
+
const beforeAnchor = document.querySelector(`[data-ohw-section="${insertBefore}"]`);
|
|
12942
12363
|
const beforePoint = beforeAnchor?.closest('[data-ohw-section-container="scheduling"]') ?? beforeAnchor;
|
|
12943
12364
|
if (!beforePoint) return false;
|
|
12944
12365
|
beforePoint.insertAdjacentElement("beforebegin", container);
|
|
@@ -12949,25 +12370,19 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
|
|
|
12949
12370
|
}
|
|
12950
12371
|
tail.insertAdjacentElement("afterend", container);
|
|
12951
12372
|
}
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
});
|
|
12966
|
-
} catch (err) {
|
|
12967
|
-
console.error("[ow:scheduling] render threw", err);
|
|
12968
|
-
container.remove();
|
|
12969
|
-
return false;
|
|
12970
|
-
}
|
|
12373
|
+
const root = createRoot2(container);
|
|
12374
|
+
flushSync2(() => {
|
|
12375
|
+
root.render(
|
|
12376
|
+
/* @__PURE__ */ jsx32(
|
|
12377
|
+
SchedulingWidget,
|
|
12378
|
+
{
|
|
12379
|
+
notifyOnConnect,
|
|
12380
|
+
initialScheduleId: scheduleId,
|
|
12381
|
+
insertAfter: effectiveInsertAfter
|
|
12382
|
+
}
|
|
12383
|
+
)
|
|
12384
|
+
);
|
|
12385
|
+
});
|
|
12971
12386
|
const tracker = getSectionsTracker();
|
|
12972
12387
|
let sections = [];
|
|
12973
12388
|
try {
|
|
@@ -12975,12 +12390,10 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
|
|
|
12975
12390
|
} catch {
|
|
12976
12391
|
}
|
|
12977
12392
|
const inEditor = typeof window !== "undefined" && window.self !== window.top;
|
|
12978
|
-
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter ===
|
|
12393
|
+
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === effectiveInsertAfter)) {
|
|
12979
12394
|
sections.push({
|
|
12980
12395
|
type: "scheduling",
|
|
12981
|
-
insertAfter:
|
|
12982
|
-
anchorId,
|
|
12983
|
-
beforeId: beforeId ?? null,
|
|
12396
|
+
insertAfter: effectiveInsertAfter,
|
|
12984
12397
|
pagePath: window.location.pathname,
|
|
12985
12398
|
...scheduleId ? { scheduleId } : {}
|
|
12986
12399
|
});
|
|
@@ -12994,8 +12407,7 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
|
|
|
12994
12407
|
for (let i = pending.length - 1; i >= 0; i--) {
|
|
12995
12408
|
const entry = pending[i];
|
|
12996
12409
|
const shouldNotify = typeof notifyOnConnect === "function" ? notifyOnConnect(entry) : notifyOnConnect;
|
|
12997
|
-
|
|
12998
|
-
if (mountSchedulingWidget(anchorId, shouldNotify, entry.scheduleId ?? null, beforeId, entry.insertAfter)) {
|
|
12410
|
+
if (mountSchedulingWidget(entry.insertAfter, shouldNotify, entry.scheduleId)) {
|
|
12999
12411
|
pending.splice(i, 1);
|
|
13000
12412
|
}
|
|
13001
12413
|
}
|
|
@@ -13139,13 +12551,6 @@ function isInsideLinkEditor(target) {
|
|
|
13139
12551
|
target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest("[data-ohw-more-menu]") || target.closest('[data-slot="dropdown-menu-content"]') || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
|
|
13140
12552
|
);
|
|
13141
12553
|
}
|
|
13142
|
-
function isInsideFloatingPanel(target) {
|
|
13143
|
-
return Boolean(target.closest("[data-ohw-floating-panel]"));
|
|
13144
|
-
}
|
|
13145
|
-
function isPointOverFloatingPanel(clientX, clientY) {
|
|
13146
|
-
const el = document.elementFromPoint(clientX, clientY);
|
|
13147
|
-
return Boolean(el instanceof Element && el.closest("[data-ohw-floating-panel]"));
|
|
13148
|
-
}
|
|
13149
12554
|
function getHrefKeyFromElement(el) {
|
|
13150
12555
|
if (!el) return null;
|
|
13151
12556
|
const anchor = el.closest("[data-ohw-href-key]");
|
|
@@ -13378,7 +12783,7 @@ function getNavigationSelectionParent(el) {
|
|
|
13378
12783
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
13379
12784
|
return getFooterLinksContainer();
|
|
13380
12785
|
}
|
|
13381
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
12786
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
13382
12787
|
return getNavigationRoot(el);
|
|
13383
12788
|
}
|
|
13384
12789
|
return null;
|
|
@@ -13621,7 +13026,7 @@ function EditGlowChrome({
|
|
|
13621
13026
|
hideHandle = false
|
|
13622
13027
|
}) {
|
|
13623
13028
|
const GAP = SELECTION_CHROME_GAP2;
|
|
13624
|
-
return /* @__PURE__ */
|
|
13029
|
+
return /* @__PURE__ */ jsxs19(
|
|
13625
13030
|
"div",
|
|
13626
13031
|
{
|
|
13627
13032
|
ref: elRef,
|
|
@@ -13636,7 +13041,7 @@ function EditGlowChrome({
|
|
|
13636
13041
|
zIndex: 2147483646
|
|
13637
13042
|
},
|
|
13638
13043
|
children: [
|
|
13639
|
-
/* @__PURE__ */
|
|
13044
|
+
/* @__PURE__ */ jsx32(
|
|
13640
13045
|
"div",
|
|
13641
13046
|
{
|
|
13642
13047
|
style: {
|
|
@@ -13649,7 +13054,7 @@ function EditGlowChrome({
|
|
|
13649
13054
|
}
|
|
13650
13055
|
}
|
|
13651
13056
|
),
|
|
13652
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */
|
|
13057
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx32(
|
|
13653
13058
|
"div",
|
|
13654
13059
|
{
|
|
13655
13060
|
"data-ohw-drag-handle-container": "",
|
|
@@ -13661,7 +13066,7 @@ function EditGlowChrome({
|
|
|
13661
13066
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
13662
13067
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
13663
13068
|
},
|
|
13664
|
-
children: /* @__PURE__ */
|
|
13069
|
+
children: /* @__PURE__ */ jsx32(
|
|
13665
13070
|
DragHandle,
|
|
13666
13071
|
{
|
|
13667
13072
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -13871,7 +13276,7 @@ function FloatingToolbar({
|
|
|
13871
13276
|
return () => ro.disconnect();
|
|
13872
13277
|
}, [showEditLink, activeCommands]);
|
|
13873
13278
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
13874
|
-
return /* @__PURE__ */
|
|
13279
|
+
return /* @__PURE__ */ jsx32(
|
|
13875
13280
|
"div",
|
|
13876
13281
|
{
|
|
13877
13282
|
ref: setRefs,
|
|
@@ -13883,12 +13288,12 @@ function FloatingToolbar({
|
|
|
13883
13288
|
zIndex: 2147483647,
|
|
13884
13289
|
pointerEvents: "auto"
|
|
13885
13290
|
},
|
|
13886
|
-
children: /* @__PURE__ */
|
|
13887
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */
|
|
13888
|
-
gi > 0 && /* @__PURE__ */
|
|
13291
|
+
children: /* @__PURE__ */ jsxs19(CustomToolbar, { children: [
|
|
13292
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs19(React11.Fragment, { children: [
|
|
13293
|
+
gi > 0 && /* @__PURE__ */ jsx32(CustomToolbarDivider, {}),
|
|
13889
13294
|
btns.map((btn) => {
|
|
13890
13295
|
const isActive = activeCommands.has(btn.cmd);
|
|
13891
|
-
return /* @__PURE__ */
|
|
13296
|
+
return /* @__PURE__ */ jsx32(
|
|
13892
13297
|
CustomToolbarButton,
|
|
13893
13298
|
{
|
|
13894
13299
|
title: btn.title,
|
|
@@ -13897,7 +13302,7 @@ function FloatingToolbar({
|
|
|
13897
13302
|
e.preventDefault();
|
|
13898
13303
|
onCommand(btn.cmd);
|
|
13899
13304
|
},
|
|
13900
|
-
children: /* @__PURE__ */
|
|
13305
|
+
children: /* @__PURE__ */ jsx32(
|
|
13901
13306
|
"svg",
|
|
13902
13307
|
{
|
|
13903
13308
|
width: "16",
|
|
@@ -13918,7 +13323,7 @@ function FloatingToolbar({
|
|
|
13918
13323
|
);
|
|
13919
13324
|
})
|
|
13920
13325
|
] }, gi)),
|
|
13921
|
-
showEditLink ? /* @__PURE__ */
|
|
13326
|
+
showEditLink ? /* @__PURE__ */ jsx32(
|
|
13922
13327
|
CustomToolbarButton,
|
|
13923
13328
|
{
|
|
13924
13329
|
type: "button",
|
|
@@ -13932,7 +13337,7 @@ function FloatingToolbar({
|
|
|
13932
13337
|
e.preventDefault();
|
|
13933
13338
|
e.stopPropagation();
|
|
13934
13339
|
},
|
|
13935
|
-
children: /* @__PURE__ */
|
|
13340
|
+
children: /* @__PURE__ */ jsx32(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
13936
13341
|
}
|
|
13937
13342
|
) : null
|
|
13938
13343
|
] })
|
|
@@ -13949,7 +13354,7 @@ function StateToggle({
|
|
|
13949
13354
|
states,
|
|
13950
13355
|
onStateChange
|
|
13951
13356
|
}) {
|
|
13952
|
-
return /* @__PURE__ */
|
|
13357
|
+
return /* @__PURE__ */ jsx32(
|
|
13953
13358
|
ToggleGroup,
|
|
13954
13359
|
{
|
|
13955
13360
|
"data-ohw-state-toggle": "",
|
|
@@ -13963,12 +13368,11 @@ function StateToggle({
|
|
|
13963
13368
|
left: rect.right - 8,
|
|
13964
13369
|
transform: "translateX(-100%)"
|
|
13965
13370
|
},
|
|
13966
|
-
children: states.map((state) => /* @__PURE__ */
|
|
13371
|
+
children: states.map((state) => /* @__PURE__ */ jsx32(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
13967
13372
|
}
|
|
13968
13373
|
);
|
|
13969
13374
|
}
|
|
13970
13375
|
var contentCache = /* @__PURE__ */ new Map();
|
|
13971
|
-
var fetchedContentPaths = /* @__PURE__ */ new Set();
|
|
13972
13376
|
function resolveSubdomain(subdomainFromQuery) {
|
|
13973
13377
|
if (subdomainFromQuery) return subdomainFromQuery;
|
|
13974
13378
|
if (typeof window !== "undefined") {
|
|
@@ -14063,14 +13467,8 @@ function OhhwellsBridge() {
|
|
|
14063
13467
|
});
|
|
14064
13468
|
const selectFrameRef = useRef9(() => {
|
|
14065
13469
|
});
|
|
14066
|
-
const selectLogoRef = useRef9(() => {
|
|
14067
|
-
});
|
|
14068
|
-
const openLogoSizePanelRef = useRef9(() => {
|
|
14069
|
-
});
|
|
14070
13470
|
const deselectRef = useRef9(() => {
|
|
14071
13471
|
});
|
|
14072
|
-
const closeFloatingPanelOnlyRef = useRef9(() => {
|
|
14073
|
-
});
|
|
14074
13472
|
const reselectNavigationItemRef = useRef9(() => {
|
|
14075
13473
|
});
|
|
14076
13474
|
const commitNavigationTextEditRef = useRef9(() => {
|
|
@@ -14109,6 +13507,9 @@ function OhhwellsBridge() {
|
|
|
14109
13507
|
const [isItemDragging, setIsItemDragging] = useState11(false);
|
|
14110
13508
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState11(false);
|
|
14111
13509
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
13510
|
+
const [floatingPanel, setFloatingPanel] = useState11(null);
|
|
13511
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState11(null);
|
|
13512
|
+
const [parentScrollSnap, setParentScrollSnap] = useState11(null);
|
|
14112
13513
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState11(null);
|
|
14113
13514
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState11(null);
|
|
14114
13515
|
const footerDragRef = useRef9(null);
|
|
@@ -14123,15 +13524,7 @@ function OhhwellsBridge() {
|
|
|
14123
13524
|
const addNavAfterAnchorRef = useRef9(null);
|
|
14124
13525
|
const editContentRef = useRef9({});
|
|
14125
13526
|
const aiSectionsRef = useRef9("");
|
|
14126
|
-
const brandKitRef = useRef9("");
|
|
14127
13527
|
const pendingDeleteUndoRef = useRef9(null);
|
|
14128
|
-
const [floatingPanel, setFloatingPanel] = useState11(null);
|
|
14129
|
-
const floatingPanelOpenRef = useRef9(false);
|
|
14130
|
-
const setFloatingPanelRef = useRef9(setFloatingPanel);
|
|
14131
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState11(null);
|
|
14132
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState11(null);
|
|
14133
|
-
const [editorViewport, setEditorViewport] = useState11("desktop");
|
|
14134
|
-
const [parentScrollSnap, setParentScrollSnap] = useState11(null);
|
|
14135
13528
|
const [sitePages, setSitePages] = useState11([]);
|
|
14136
13529
|
const [sectionsByPath, setSectionsByPath] = useState11({});
|
|
14137
13530
|
const sectionsPrefetchGenRef = useRef9(0);
|
|
@@ -14140,18 +13533,7 @@ function OhhwellsBridge() {
|
|
|
14140
13533
|
const linkPopoverOpenRef = useRef9(false);
|
|
14141
13534
|
const linkPopoverGraceUntilRef = useRef9(0);
|
|
14142
13535
|
setLinkPopoverRef.current = setLinkPopover;
|
|
14143
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
14144
13536
|
linkPopoverSessionRef.current = linkPopover;
|
|
14145
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
14146
|
-
useEffect12(() => {
|
|
14147
|
-
const syncViewport = () => {
|
|
14148
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
14149
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
14150
|
-
};
|
|
14151
|
-
syncViewport();
|
|
14152
|
-
window.addEventListener("resize", syncViewport);
|
|
14153
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
14154
|
-
}, []);
|
|
14155
13537
|
const {
|
|
14156
13538
|
navDragRef,
|
|
14157
13539
|
navDropSlots,
|
|
@@ -14374,10 +13756,6 @@ function OhhwellsBridge() {
|
|
|
14374
13756
|
setIsItemDragging(false);
|
|
14375
13757
|
hoveredNavContainerRef.current = null;
|
|
14376
13758
|
setHoveredNavContainerRect(null);
|
|
14377
|
-
hoveredItemElRef.current = null;
|
|
14378
|
-
setHoveredItemRect(null);
|
|
14379
|
-
setFloatingPanel(null);
|
|
14380
|
-
setLogoSizeDraft(null);
|
|
14381
13759
|
if (!activeElRef.current) {
|
|
14382
13760
|
setNavGroupForceOpen(null, false);
|
|
14383
13761
|
setToolbarRect(null);
|
|
@@ -15069,8 +14447,6 @@ function OhhwellsBridge() {
|
|
|
15069
14447
|
setToolbarRect(anchor.getBoundingClientRect());
|
|
15070
14448
|
setToolbarShowEditLink(false);
|
|
15071
14449
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
15072
|
-
setFloatingPanel(null);
|
|
15073
|
-
setLogoSizeDraft(null);
|
|
15074
14450
|
}, [deactivate, markSelected]);
|
|
15075
14451
|
const selectFrame = useCallback7((el) => {
|
|
15076
14452
|
if (!isNavigationContainer(el)) return;
|
|
@@ -15120,52 +14496,7 @@ function OhhwellsBridge() {
|
|
|
15120
14496
|
setToolbarRect(el.getBoundingClientRect());
|
|
15121
14497
|
setToolbarShowEditLink(false);
|
|
15122
14498
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
15123
|
-
setFloatingPanel(null);
|
|
15124
|
-
setLogoSizeDraft(null);
|
|
15125
14499
|
}, [deactivate, markSelected, postToParent2]);
|
|
15126
|
-
const selectLogo = useCallback7(
|
|
15127
|
-
(logoEl) => {
|
|
15128
|
-
if (activeElRef.current) deactivate();
|
|
15129
|
-
selectedElRef.current = logoEl;
|
|
15130
|
-
selectedHrefKeyRef.current = null;
|
|
15131
|
-
selectedFooterColAttrRef.current = null;
|
|
15132
|
-
markSelected(logoEl);
|
|
15133
|
-
setSelectedIsCta(false);
|
|
15134
|
-
setSelectedIsSocial(false);
|
|
15135
|
-
setSelectedIsSocialsRow(false);
|
|
15136
|
-
setSelectedIsSocialsRow(false);
|
|
15137
|
-
clearHrefKeyHover(logoEl);
|
|
15138
|
-
hoveredNavContainerRef.current = null;
|
|
15139
|
-
setHoveredNavContainerRect(null);
|
|
15140
|
-
setHoveredItemRect(null);
|
|
15141
|
-
hoveredItemElRef.current = null;
|
|
15142
|
-
siblingHintElRef.current = null;
|
|
15143
|
-
setSiblingHintRect(null);
|
|
15144
|
-
setSiblingHintRects([]);
|
|
15145
|
-
setIsItemDragging(false);
|
|
15146
|
-
setReorderHrefKey(null);
|
|
15147
|
-
setReorderDragDisabled(false);
|
|
15148
|
-
setIsFooterFrameSelection(false);
|
|
15149
|
-
setToolbarVariant("logo");
|
|
15150
|
-
setToolbarRect(getLogoInteractionRect(logoEl));
|
|
15151
|
-
setToolbarShowEditLink(false);
|
|
15152
|
-
setActiveCommands(/* @__PURE__ */ new Set());
|
|
15153
|
-
},
|
|
15154
|
-
[deactivate, markSelected]
|
|
15155
|
-
);
|
|
15156
|
-
const openLogoSizePanel = useCallback7((logoEl) => {
|
|
15157
|
-
const placement = getLogoPlacement(logoEl);
|
|
15158
|
-
const draft = readLogoSizeState(editContentRef.current, placement);
|
|
15159
|
-
setLogoSizeDraft(draft);
|
|
15160
|
-
setParentScrollSnap(parentScrollRef.current);
|
|
15161
|
-
setFloatingPanel({
|
|
15162
|
-
key: `logo-size:${placement}`,
|
|
15163
|
-
title: "Logo",
|
|
15164
|
-
context: placement === "navbar" ? "Navbar" : "Footer",
|
|
15165
|
-
kind: "logo-size",
|
|
15166
|
-
placement
|
|
15167
|
-
});
|
|
15168
|
-
}, []);
|
|
15169
14500
|
const openSocialsDisplayPanel = useCallback7((row) => {
|
|
15170
14501
|
setParentScrollSnap(parentScrollRef.current);
|
|
15171
14502
|
setFloatingPanel({
|
|
@@ -15201,53 +14532,11 @@ function OhhwellsBridge() {
|
|
|
15201
14532
|
);
|
|
15202
14533
|
const closeFloatingPanelOnly = useCallback7(() => {
|
|
15203
14534
|
setFloatingPanel(null);
|
|
15204
|
-
setLogoSizeDraft(null);
|
|
15205
14535
|
}, []);
|
|
15206
14536
|
const closeFloatingPanelAndDeselect = useCallback7(() => {
|
|
15207
14537
|
setFloatingPanel(null);
|
|
15208
|
-
setLogoSizeDraft(null);
|
|
15209
14538
|
deselectRef.current();
|
|
15210
14539
|
}, []);
|
|
15211
|
-
const persistLogoSizeDraft = useCallback7(
|
|
15212
|
-
(placement, draft) => {
|
|
15213
|
-
const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
|
|
15214
|
-
const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
|
|
15215
|
-
const nodes = [
|
|
15216
|
-
{ key: desktopKey, text: String(draft.desktopPx) }
|
|
15217
|
-
];
|
|
15218
|
-
if (draft.mobileFollowing) {
|
|
15219
|
-
nodes.push({ key: mobileKey, text: "" });
|
|
15220
|
-
} else {
|
|
15221
|
-
nodes.push({ key: mobileKey, text: String(draft.mobilePx) });
|
|
15222
|
-
}
|
|
15223
|
-
editContentRef.current = {
|
|
15224
|
-
...editContentRef.current,
|
|
15225
|
-
[desktopKey]: String(draft.desktopPx),
|
|
15226
|
-
[mobileKey]: draft.mobileFollowing ? "" : String(draft.mobilePx)
|
|
15227
|
-
};
|
|
15228
|
-
applyLogoSizeToPlacement(
|
|
15229
|
-
placement,
|
|
15230
|
-
draft.desktopPx,
|
|
15231
|
-
draft.mobileFollowing ? draft.desktopPx : draft.mobilePx,
|
|
15232
|
-
draft.mobileFollowing
|
|
15233
|
-
);
|
|
15234
|
-
postToParent2({ type: "ow:change", nodes });
|
|
15235
|
-
requestAnimationFrame(() => {
|
|
15236
|
-
const selected = selectedElRef.current;
|
|
15237
|
-
if (!selected || toolbarVariantRef.current !== "logo") return;
|
|
15238
|
-
const rect = getLogoInteractionRect(selected);
|
|
15239
|
-
setToolbarRect(rect);
|
|
15240
|
-
if (glowElRef.current) {
|
|
15241
|
-
const GAP = SELECTION_CHROME_GAP2;
|
|
15242
|
-
glowElRef.current.style.top = `${rect.top - GAP}px`;
|
|
15243
|
-
glowElRef.current.style.left = `${rect.left - GAP}px`;
|
|
15244
|
-
glowElRef.current.style.width = `${rect.width + GAP * 2}px`;
|
|
15245
|
-
glowElRef.current.style.height = `${rect.height + GAP * 2}px`;
|
|
15246
|
-
}
|
|
15247
|
-
});
|
|
15248
|
-
},
|
|
15249
|
-
[postToParent2]
|
|
15250
|
-
);
|
|
15251
14540
|
const activate = useCallback7((el, options) => {
|
|
15252
14541
|
if (activeElRef.current === el) return;
|
|
15253
14542
|
if (isIconEditable(el)) return;
|
|
@@ -15328,37 +14617,7 @@ function OhhwellsBridge() {
|
|
|
15328
14617
|
deactivateRef.current = deactivate;
|
|
15329
14618
|
selectRef.current = select;
|
|
15330
14619
|
selectFrameRef.current = selectFrame;
|
|
15331
|
-
selectLogoRef.current = selectLogo;
|
|
15332
|
-
openLogoSizePanelRef.current = openLogoSizePanel;
|
|
15333
14620
|
deselectRef.current = deselect;
|
|
15334
|
-
closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
|
|
15335
|
-
const lastSiteWideScopeRef = useRef9(null);
|
|
15336
|
-
useEffect12(() => {
|
|
15337
|
-
if (!isEditMode) {
|
|
15338
|
-
if (lastSiteWideScopeRef.current !== false) {
|
|
15339
|
-
lastSiteWideScopeRef.current = false;
|
|
15340
|
-
postToParent2({ type: "ow:site-wide-scope", active: false });
|
|
15341
|
-
}
|
|
15342
|
-
return;
|
|
15343
|
-
}
|
|
15344
|
-
const active = isSiteWideScopeActive({
|
|
15345
|
-
selected: selectedElRef.current,
|
|
15346
|
-
hoveredItem: hoveredItemElRef.current,
|
|
15347
|
-
hoveredNavContainer: hoveredNavContainerRef.current,
|
|
15348
|
-
active: activeElRef.current
|
|
15349
|
-
});
|
|
15350
|
-
if (lastSiteWideScopeRef.current === active) return;
|
|
15351
|
-
lastSiteWideScopeRef.current = active;
|
|
15352
|
-
postToParent2({ type: "ow:site-wide-scope", active });
|
|
15353
|
-
}, [
|
|
15354
|
-
isEditMode,
|
|
15355
|
-
hoveredItemRect,
|
|
15356
|
-
hoveredNavContainerRect,
|
|
15357
|
-
toolbarVariant,
|
|
15358
|
-
toolbarRect,
|
|
15359
|
-
isFooterFrameSelection,
|
|
15360
|
-
postToParent2
|
|
15361
|
-
]);
|
|
15362
14621
|
useLayoutEffect4(() => {
|
|
15363
14622
|
if (!subdomain || isEditMode) {
|
|
15364
14623
|
setFetchState("done");
|
|
@@ -15370,18 +14629,9 @@ function OhhwellsBridge() {
|
|
|
15370
14629
|
aiSectionsRef.current = content[AI_SECTIONS_KEY];
|
|
15371
14630
|
applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
|
|
15372
14631
|
}
|
|
15373
|
-
if (typeof content[BRAND_KIT_KEY] === "string") {
|
|
15374
|
-
brandKitRef.current = content[BRAND_KIT_KEY];
|
|
15375
|
-
applyBrandToDom(parseBrandKit(content[BRAND_KIT_KEY]));
|
|
15376
|
-
}
|
|
15377
|
-
applyBrandChrome(content);
|
|
15378
14632
|
for (const [key, val] of Object.entries(content)) {
|
|
15379
14633
|
if (key === "__ohw_sections") continue;
|
|
15380
14634
|
if (key === AI_SECTIONS_KEY) continue;
|
|
15381
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
15382
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
15383
|
-
if (key === BRAND_KIT_KEY) continue;
|
|
15384
|
-
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
15385
14635
|
if (applyVideoSettingNode(key, val)) continue;
|
|
15386
14636
|
if (applyCarouselNode(key, val)) continue;
|
|
15387
14637
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -15416,8 +14666,6 @@ function OhhwellsBridge() {
|
|
|
15416
14666
|
});
|
|
15417
14667
|
applyLinkByKey(key, val);
|
|
15418
14668
|
}
|
|
15419
|
-
applyLogoFromContent(content);
|
|
15420
|
-
applyLogoSizes(content);
|
|
15421
14669
|
reconcileNavbarItemsFromContent(content);
|
|
15422
14670
|
reconcileFooterOrderFromContent(content);
|
|
15423
14671
|
reconcileSocialsFromContent(content);
|
|
@@ -15437,9 +14685,7 @@ function OhhwellsBridge() {
|
|
|
15437
14685
|
let cancelled = false;
|
|
15438
14686
|
setFetchState("loading");
|
|
15439
14687
|
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
15440
|
-
|
|
15441
|
-
fetchedContentPaths.add(`${subdomain}::${initialPath}`);
|
|
15442
|
-
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(initialPath)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
14688
|
+
fetch(`${apiUrl}/api/public/sites/${subdomain}/content`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
15443
14689
|
if (cancelled) return;
|
|
15444
14690
|
const content = data?.content ?? {};
|
|
15445
14691
|
contentCache.set(subdomain, content);
|
|
@@ -15462,16 +14708,8 @@ function OhhwellsBridge() {
|
|
|
15462
14708
|
retryMissingSchedulingMounts(getPageSchedulingEntries(content["__ohw_sections"]), false);
|
|
15463
14709
|
observer?.disconnect();
|
|
15464
14710
|
try {
|
|
15465
|
-
applyBrandChrome(content);
|
|
15466
|
-
if (typeof content[BRAND_KIT_KEY] === "string") {
|
|
15467
|
-
applyBrandToDom(parseBrandKit(content[BRAND_KIT_KEY]));
|
|
15468
|
-
}
|
|
15469
14711
|
for (const [key, val] of Object.entries(content)) {
|
|
15470
14712
|
if (key === "__ohw_sections") continue;
|
|
15471
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
15472
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
15473
|
-
if (key === BRAND_KIT_KEY) continue;
|
|
15474
|
-
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
15475
14713
|
if (applyVideoSettingNode(key, val)) continue;
|
|
15476
14714
|
if (applyCarouselNode(key, val)) continue;
|
|
15477
14715
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -15492,7 +14730,6 @@ function OhhwellsBridge() {
|
|
|
15492
14730
|
});
|
|
15493
14731
|
applyLinkByKey(key, val);
|
|
15494
14732
|
}
|
|
15495
|
-
applyLogoFromContent(content);
|
|
15496
14733
|
reconcileNavbarItemsFromContent(content);
|
|
15497
14734
|
reconcileFooterOrderFromContent(content);
|
|
15498
14735
|
reconcileSocialsFromContent(content);
|
|
@@ -15507,17 +14744,6 @@ function OhhwellsBridge() {
|
|
|
15507
14744
|
debounceTimer = setTimeout(applyFromCache, 150);
|
|
15508
14745
|
};
|
|
15509
14746
|
applyFromCache();
|
|
15510
|
-
const pathCacheKey = `${subdomain}::${pathname}`;
|
|
15511
|
-
if (!fetchedContentPaths.has(pathCacheKey)) {
|
|
15512
|
-
fetchedContentPaths.add(pathCacheKey);
|
|
15513
|
-
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
15514
|
-
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(pathname)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
15515
|
-
if (!data?.content) return;
|
|
15516
|
-
contentCache.set(subdomain, data.content);
|
|
15517
|
-
applyFromCache();
|
|
15518
|
-
}).catch(() => {
|
|
15519
|
-
});
|
|
15520
|
-
}
|
|
15521
14747
|
observer = new MutationObserver(scheduleApply);
|
|
15522
14748
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
15523
14749
|
return () => {
|
|
@@ -15577,7 +14803,7 @@ function OhhwellsBridge() {
|
|
|
15577
14803
|
reconcileSocialsFromContent(content);
|
|
15578
14804
|
applySocialsDisplayFromContent(content);
|
|
15579
14805
|
document.querySelectorAll("footer [data-ohw-href-key]").forEach((el) => {
|
|
15580
|
-
if (isFooterHrefKey(el.getAttribute("data-ohw-href-key"))) {
|
|
14806
|
+
if (isFooterHrefKey(el.getAttribute("data-ohw-href-key")) || getSocialItem(el)) {
|
|
15581
14807
|
disableNativeHrefDrag(el);
|
|
15582
14808
|
}
|
|
15583
14809
|
});
|
|
@@ -15611,31 +14837,26 @@ function OhhwellsBridge() {
|
|
|
15611
14837
|
}, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
|
|
15612
14838
|
useEffect12(() => {
|
|
15613
14839
|
if (!isEditMode) return;
|
|
15614
|
-
let lastPosted = 0;
|
|
15615
14840
|
const measure = () => {
|
|
15616
14841
|
const h = document.body.scrollHeight;
|
|
15617
|
-
if (h > 50
|
|
15618
|
-
lastPosted = h;
|
|
15619
|
-
postToParent2({ type: "ow:height", height: h });
|
|
15620
|
-
}
|
|
15621
|
-
};
|
|
15622
|
-
let raf = null;
|
|
15623
|
-
const schedule = () => {
|
|
15624
|
-
if (raf != null) return;
|
|
15625
|
-
raf = requestAnimationFrame(() => {
|
|
15626
|
-
raf = null;
|
|
15627
|
-
measure();
|
|
15628
|
-
});
|
|
14842
|
+
if (h > 50) postToParent2({ type: "ow:height", height: h });
|
|
15629
14843
|
};
|
|
15630
14844
|
const t1 = setTimeout(measure, 50);
|
|
15631
14845
|
const t2 = setTimeout(measure, 500);
|
|
15632
|
-
|
|
15633
|
-
|
|
14846
|
+
let lastWidth = window.innerWidth;
|
|
14847
|
+
let resizeTimer = null;
|
|
14848
|
+
const handleResize = () => {
|
|
14849
|
+
if (window.innerWidth === lastWidth) return;
|
|
14850
|
+
lastWidth = window.innerWidth;
|
|
14851
|
+
if (resizeTimer) clearTimeout(resizeTimer);
|
|
14852
|
+
resizeTimer = setTimeout(measure, 150);
|
|
14853
|
+
};
|
|
14854
|
+
window.addEventListener("resize", handleResize);
|
|
15634
14855
|
return () => {
|
|
15635
14856
|
clearTimeout(t1);
|
|
15636
14857
|
clearTimeout(t2);
|
|
15637
|
-
if (
|
|
15638
|
-
|
|
14858
|
+
if (resizeTimer) clearTimeout(resizeTimer);
|
|
14859
|
+
window.removeEventListener("resize", handleResize);
|
|
15639
14860
|
};
|
|
15640
14861
|
}, [pathname, isEditMode, postToParent2]);
|
|
15641
14862
|
useEffect12(() => {
|
|
@@ -15783,7 +15004,6 @@ function OhhwellsBridge() {
|
|
|
15783
15004
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
15784
15005
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
15785
15006
|
if (isInsideLinkEditor(target)) return;
|
|
15786
|
-
if (isInsideFloatingPanel(target)) return;
|
|
15787
15007
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
15788
15008
|
const beneath = document.elementsFromPoint(e.clientX, e.clientY).find(
|
|
15789
15009
|
(el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
|
|
@@ -15847,21 +15067,6 @@ function OhhwellsBridge() {
|
|
|
15847
15067
|
return;
|
|
15848
15068
|
}
|
|
15849
15069
|
}
|
|
15850
|
-
const logoEl = getLogoElement(target);
|
|
15851
|
-
if (logoEl) {
|
|
15852
|
-
e.preventDefault();
|
|
15853
|
-
e.stopPropagation();
|
|
15854
|
-
if (!logoHasUploadedImage(logoEl)) {
|
|
15855
|
-
deselectRef.current();
|
|
15856
|
-
deactivateRef.current();
|
|
15857
|
-
const identity = readLogoIdentityFromDom();
|
|
15858
|
-
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
15859
|
-
return;
|
|
15860
|
-
}
|
|
15861
|
-
selectLogoRef.current(logoEl);
|
|
15862
|
-
openLogoSizePanelRef.current(logoEl);
|
|
15863
|
-
return;
|
|
15864
|
-
}
|
|
15865
15070
|
const editable = target.closest("[data-ohw-editable]");
|
|
15866
15071
|
if (editable) {
|
|
15867
15072
|
if (editable.dataset.ohwEditable === "link") {
|
|
@@ -16014,7 +15219,6 @@ function OhhwellsBridge() {
|
|
|
16014
15219
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
16015
15220
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
16016
15221
|
if (isInsideLinkEditor(target)) return;
|
|
16017
|
-
if (isInsideFloatingPanel(target)) return;
|
|
16018
15222
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
16019
15223
|
return;
|
|
16020
15224
|
}
|
|
@@ -16042,16 +15246,6 @@ function OhhwellsBridge() {
|
|
|
16042
15246
|
setHoveredNavContainerRect(null);
|
|
16043
15247
|
return;
|
|
16044
15248
|
}
|
|
16045
|
-
if (isInsideFloatingPanel(target) || isPointOverFloatingPanel(e.clientX, e.clientY)) {
|
|
16046
|
-
hoveredItemElRef.current = null;
|
|
16047
|
-
setHoveredItemRect(null);
|
|
16048
|
-
hoveredNavContainerRef.current = null;
|
|
16049
|
-
setHoveredNavContainerRect(null);
|
|
16050
|
-
siblingHintElRef.current = null;
|
|
16051
|
-
setSiblingHintRect(null);
|
|
16052
|
-
setSiblingHintRects([]);
|
|
16053
|
-
return;
|
|
16054
|
-
}
|
|
16055
15249
|
{
|
|
16056
15250
|
const selected2 = selectedElRef.current;
|
|
16057
15251
|
const selectedIsFooterColumn = Boolean(selected2) && !isFooterLinksContainer(selected2) && (selected2.hasAttribute("data-ohw-footer-col") || selected2.hasAttribute("data-ohw-footer-column") || Boolean(selected2.closest("footer") && isInferredFooterGroup2(selected2)));
|
|
@@ -16059,7 +15253,7 @@ function OhhwellsBridge() {
|
|
|
16059
15253
|
const allowFooterLinksHover = toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn;
|
|
16060
15254
|
if (allowNavContainerHover) {
|
|
16061
15255
|
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
16062
|
-
if (navContainer && !getNavigationItemAnchor(target)
|
|
15256
|
+
if (navContainer && !getNavigationItemAnchor(target)) {
|
|
16063
15257
|
hoveredNavContainerRef.current = navContainer;
|
|
16064
15258
|
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
16065
15259
|
hoveredItemElRef.current = null;
|
|
@@ -16088,15 +15282,6 @@ function OhhwellsBridge() {
|
|
|
16088
15282
|
setHoveredNavContainerRect(null);
|
|
16089
15283
|
}
|
|
16090
15284
|
}
|
|
16091
|
-
const logoEl = getLogoElement(target);
|
|
16092
|
-
if (logoEl) {
|
|
16093
|
-
hoveredNavContainerRef.current = null;
|
|
16094
|
-
setHoveredNavContainerRect(null);
|
|
16095
|
-
if (selectedElRef.current === logoEl) return;
|
|
16096
|
-
hoveredItemElRef.current = logoEl;
|
|
16097
|
-
setHoveredItemRect(getLogoInteractionRect(logoEl));
|
|
16098
|
-
return;
|
|
16099
|
-
}
|
|
16100
15285
|
const navAnchor = getNavigationItemAnchor(target);
|
|
16101
15286
|
if (navAnchor) {
|
|
16102
15287
|
hoveredNavContainerRef.current = null;
|
|
@@ -16134,12 +15319,6 @@ function OhhwellsBridge() {
|
|
|
16134
15319
|
setHoveredItemRect(hoverTarget.getBoundingClientRect());
|
|
16135
15320
|
} else if (!isInsideNavigationItem(editable)) {
|
|
16136
15321
|
hoverTarget.setAttribute("data-ohw-hovered", "");
|
|
16137
|
-
if (editable.closest("footer") || editable.closest('[data-ohw-section="footer"]')) {
|
|
16138
|
-
hoveredNavContainerRef.current = null;
|
|
16139
|
-
setHoveredNavContainerRect(null);
|
|
16140
|
-
hoveredItemElRef.current = editable;
|
|
16141
|
-
setHoveredItemRect(editable.getBoundingClientRect());
|
|
16142
|
-
}
|
|
16143
15322
|
}
|
|
16144
15323
|
}
|
|
16145
15324
|
};
|
|
@@ -16175,18 +15354,6 @@ function OhhwellsBridge() {
|
|
|
16175
15354
|
}
|
|
16176
15355
|
return;
|
|
16177
15356
|
}
|
|
16178
|
-
const logoEl = getLogoElement(target);
|
|
16179
|
-
if (logoEl) {
|
|
16180
|
-
const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
16181
|
-
if (related2 && (logoEl === related2 || logoEl.contains(related2) || related2.closest?.('[data-ohw-role="logo"], [data-ohw-logo]'))) {
|
|
16182
|
-
return;
|
|
16183
|
-
}
|
|
16184
|
-
if (hoveredItemElRef.current === logoEl) {
|
|
16185
|
-
hoveredItemElRef.current = null;
|
|
16186
|
-
setHoveredItemRect(null);
|
|
16187
|
-
}
|
|
16188
|
-
return;
|
|
16189
|
-
}
|
|
16190
15357
|
const editable = target.closest("[data-ohw-editable]");
|
|
16191
15358
|
if (!editable) return;
|
|
16192
15359
|
const related = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
@@ -16207,13 +15374,6 @@ function OhhwellsBridge() {
|
|
|
16207
15374
|
}
|
|
16208
15375
|
} else {
|
|
16209
15376
|
hoverTarget.removeAttribute("data-ohw-hovered");
|
|
16210
|
-
if (hoveredItemElRef.current === editable) {
|
|
16211
|
-
const stillOnEditable = related instanceof Element && related.closest("[data-ohw-editable]") === editable;
|
|
16212
|
-
if (!stillOnEditable) {
|
|
16213
|
-
hoveredItemElRef.current = null;
|
|
16214
|
-
setHoveredItemRect(null);
|
|
16215
|
-
}
|
|
16216
|
-
}
|
|
16217
15377
|
}
|
|
16218
15378
|
}
|
|
16219
15379
|
};
|
|
@@ -16330,26 +15490,6 @@ function OhhwellsBridge() {
|
|
|
16330
15490
|
hoveredNavContainerRef.current = null;
|
|
16331
15491
|
setHoveredNavContainerRect(null);
|
|
16332
15492
|
}
|
|
16333
|
-
const logoCandidates = [
|
|
16334
|
-
...document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]'),
|
|
16335
|
-
...document.querySelectorAll("nav a:not([data-ohw-href-key]), [data-ohw-nav-root] a:not([data-ohw-href-key])"),
|
|
16336
|
-
...document.querySelectorAll("footer img")
|
|
16337
|
-
];
|
|
16338
|
-
const seenLogos = /* @__PURE__ */ new Set();
|
|
16339
|
-
for (const candidate of logoCandidates) {
|
|
16340
|
-
const logo = getLogoElement(candidate);
|
|
16341
|
-
if (!logo || seenLogos.has(logo)) continue;
|
|
16342
|
-
seenLogos.add(logo);
|
|
16343
|
-
const r2 = logo.getBoundingClientRect();
|
|
16344
|
-
if (x < r2.left || x > r2.right || y < r2.top || y > r2.bottom) continue;
|
|
16345
|
-
hoveredNavContainerRef.current = null;
|
|
16346
|
-
setHoveredNavContainerRect(null);
|
|
16347
|
-
if (selectedElRef.current !== logo) {
|
|
16348
|
-
hoveredItemElRef.current = logo;
|
|
16349
|
-
setHoveredItemRect(getLogoInteractionRect(logo));
|
|
16350
|
-
}
|
|
16351
|
-
return;
|
|
16352
|
-
}
|
|
16353
15493
|
const navContainers = Array.from(
|
|
16354
15494
|
document.querySelectorAll("[data-ohw-nav-container]")
|
|
16355
15495
|
);
|
|
@@ -16435,7 +15575,7 @@ function OhhwellsBridge() {
|
|
|
16435
15575
|
}
|
|
16436
15576
|
};
|
|
16437
15577
|
const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
|
|
16438
|
-
if (linkPopoverOpenRef.current
|
|
15578
|
+
if (linkPopoverOpenRef.current) {
|
|
16439
15579
|
if (hoveredImageRef.current) {
|
|
16440
15580
|
hoveredImageRef.current = null;
|
|
16441
15581
|
hoveredImageHasTextOverlapRef.current = false;
|
|
@@ -16689,7 +15829,7 @@ function OhhwellsBridge() {
|
|
|
16689
15829
|
}
|
|
16690
15830
|
};
|
|
16691
15831
|
const probeHoverCardsAt = (clientX, clientY, fromParentViewport = false) => {
|
|
16692
|
-
if (linkPopoverOpenRef.current ||
|
|
15832
|
+
if (linkPopoverOpenRef.current || document.documentElement.hasAttribute("data-ohw-section-picking")) {
|
|
16693
15833
|
if (activeStateElRef.current) {
|
|
16694
15834
|
activeStateElRef.current.removeAttribute("data-ohw-state-hovered");
|
|
16695
15835
|
activeStateElRef.current = null;
|
|
@@ -16757,19 +15897,6 @@ function OhhwellsBridge() {
|
|
|
16757
15897
|
};
|
|
16758
15898
|
const handleMouseMove = (e) => {
|
|
16759
15899
|
const { clientX, clientY } = e;
|
|
16760
|
-
if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
16761
|
-
hoveredItemElRef.current = null;
|
|
16762
|
-
setHoveredItemRect(null);
|
|
16763
|
-
hoveredNavContainerRef.current = null;
|
|
16764
|
-
setHoveredNavContainerRect(null);
|
|
16765
|
-
siblingHintElRef.current = null;
|
|
16766
|
-
setSiblingHintRect(null);
|
|
16767
|
-
setSiblingHintRects([]);
|
|
16768
|
-
dismissImageHover();
|
|
16769
|
-
clearImageHover();
|
|
16770
|
-
setSectionGap(null);
|
|
16771
|
-
return;
|
|
16772
|
-
}
|
|
16773
15900
|
probeSectionGapAt(clientX, clientY);
|
|
16774
15901
|
probeImageAt(clientX, clientY);
|
|
16775
15902
|
probeHoverCardsAt(clientX, clientY);
|
|
@@ -16778,11 +15905,6 @@ function OhhwellsBridge() {
|
|
|
16778
15905
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
16779
15906
|
const { clientX, clientY } = e.data;
|
|
16780
15907
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
16781
|
-
if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
16782
|
-
dismissImageHover();
|
|
16783
|
-
clearImageHover();
|
|
16784
|
-
return;
|
|
16785
|
-
}
|
|
16786
15908
|
probeSectionGapAt(clientX, clientY);
|
|
16787
15909
|
probeImageAt(clientX, clientY);
|
|
16788
15910
|
probeHoverCardsAt(clientX, clientY);
|
|
@@ -17032,11 +16154,6 @@ function OhhwellsBridge() {
|
|
|
17032
16154
|
aiSectionsRef.current = content[AI_SECTIONS_KEY];
|
|
17033
16155
|
applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
|
|
17034
16156
|
}
|
|
17035
|
-
if (typeof content[BRAND_KIT_KEY] === "string") {
|
|
17036
|
-
brandKitRef.current = content[BRAND_KIT_KEY];
|
|
17037
|
-
applyBrandToDom(parseBrandKit(content[BRAND_KIT_KEY]));
|
|
17038
|
-
}
|
|
17039
|
-
applyBrandChrome(content);
|
|
17040
16157
|
let sectionsJson = null;
|
|
17041
16158
|
for (const [key, val] of Object.entries(content)) {
|
|
17042
16159
|
if (key === "__ohw_sections") {
|
|
@@ -17044,10 +16161,6 @@ function OhhwellsBridge() {
|
|
|
17044
16161
|
continue;
|
|
17045
16162
|
}
|
|
17046
16163
|
if (key === AI_SECTIONS_KEY) continue;
|
|
17047
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
17048
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
17049
|
-
if (key === BRAND_KIT_KEY) continue;
|
|
17050
|
-
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
17051
16164
|
if (applyVideoSettingNode(key, val)) continue;
|
|
17052
16165
|
if (applyCarouselNode(key, val)) continue;
|
|
17053
16166
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -17067,8 +16180,6 @@ function OhhwellsBridge() {
|
|
|
17067
16180
|
});
|
|
17068
16181
|
applyLinkByKey(key, val);
|
|
17069
16182
|
}
|
|
17070
|
-
applyLogoFromContent(content);
|
|
17071
|
-
applyLogoSizes(content);
|
|
17072
16183
|
if (sectionsJson) {
|
|
17073
16184
|
initSectionsFromContent({ __ohw_sections: sectionsJson }, true);
|
|
17074
16185
|
sectionsLoadedRef.current = true;
|
|
@@ -17083,58 +16194,6 @@ function OhhwellsBridge() {
|
|
|
17083
16194
|
if (hydratedHeight > 50) postToParentRef.current({ type: "ow:height", height: hydratedHeight });
|
|
17084
16195
|
postToParentRef.current({ type: "ow:hydrate-done" });
|
|
17085
16196
|
};
|
|
17086
|
-
const handleUpdateLogoIdentity = (e) => {
|
|
17087
|
-
if (e.data?.type !== "ow:update-logo-identity") return;
|
|
17088
|
-
const rawText = typeof e.data.text === "string" ? e.data.text : "";
|
|
17089
|
-
const alt = typeof e.data.alt === "string" ? e.data.alt : rawText;
|
|
17090
|
-
const href = typeof e.data.href === "string" ? e.data.href : void 0;
|
|
17091
|
-
const imageProvided = "image" in e.data;
|
|
17092
|
-
const imageUrl = imageProvided && typeof e.data.image === "string" && e.data.image.trim() ? e.data.image.trim() : imageProvided ? null : void 0;
|
|
17093
|
-
let isPlaceholder = e.data.isPlaceholder !== false;
|
|
17094
|
-
if (imageUrl) isPlaceholder = false;
|
|
17095
|
-
else if (imageProvided && imageUrl === null) {
|
|
17096
|
-
isPlaceholder = e.data.isPlaceholder === true || !rawText.trim() || resolveLogoDisplayText(rawText) === PLACEHOLDER_BUSINESS_NAME;
|
|
17097
|
-
}
|
|
17098
|
-
const display = applyLogoIdentity(rawText, isPlaceholder);
|
|
17099
|
-
const displayAlt = resolveLogoDisplayText(alt || display);
|
|
17100
|
-
if (imageUrl !== void 0) {
|
|
17101
|
-
applyLogoImage(imageUrl, displayAlt);
|
|
17102
|
-
} else {
|
|
17103
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
17104
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
17105
|
-
const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
17106
|
-
if (img) img.alt = displayAlt;
|
|
17107
|
-
});
|
|
17108
|
-
}
|
|
17109
|
-
}
|
|
17110
|
-
if (href !== void 0) {
|
|
17111
|
-
applyLogoHref(href);
|
|
17112
|
-
applyLinkByKey("nav-logo-href", href);
|
|
17113
|
-
applyLinkByKey("footer-logo-href", href);
|
|
17114
|
-
applyLinkByKey("logo-href", href);
|
|
17115
|
-
}
|
|
17116
|
-
const nodes = [
|
|
17117
|
-
...LOGO_TEXT_KEYS.map((key) => ({ key, text: display })),
|
|
17118
|
-
{ key: LOGO_PLACEHOLDER_KEY, text: isPlaceholder ? "true" : "false" },
|
|
17119
|
-
{ key: LOGO_ALT_KEY, text: displayAlt }
|
|
17120
|
-
];
|
|
17121
|
-
if (imageUrl !== void 0) {
|
|
17122
|
-
if (imageUrl) {
|
|
17123
|
-
for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: imageUrl });
|
|
17124
|
-
} else {
|
|
17125
|
-
for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: "" });
|
|
17126
|
-
}
|
|
17127
|
-
}
|
|
17128
|
-
if (href !== void 0) {
|
|
17129
|
-
for (const key of LOGO_HREF_KEYS) nodes.push({ key, text: href.trim() || "/" });
|
|
17130
|
-
}
|
|
17131
|
-
editContentRef.current = {
|
|
17132
|
-
...editContentRef.current,
|
|
17133
|
-
...Object.fromEntries(nodes.map(({ key, text }) => [key, text]))
|
|
17134
|
-
};
|
|
17135
|
-
applyLogoSizes(editContentRef.current);
|
|
17136
|
-
postToParentRef.current({ type: "ow:change", nodes });
|
|
17137
|
-
};
|
|
17138
16197
|
window.addEventListener("message", handleHydrate);
|
|
17139
16198
|
const postAiSectionsChanged = () => {
|
|
17140
16199
|
postToParentRef.current({
|
|
@@ -17191,17 +16250,6 @@ function OhhwellsBridge() {
|
|
|
17191
16250
|
postAiSectionsChanged();
|
|
17192
16251
|
};
|
|
17193
16252
|
window.addEventListener("message", handleAiSetSections);
|
|
17194
|
-
const handleAiSetBrand = (e) => {
|
|
17195
|
-
if (e.data?.type !== "ow:ai-set-brand") return;
|
|
17196
|
-
const value = typeof e.data.value === "string" ? e.data.value : "";
|
|
17197
|
-
const previous = brandKitRef.current;
|
|
17198
|
-
brandKitRef.current = value;
|
|
17199
|
-
applyBrandToDom(parseBrandKit(value));
|
|
17200
|
-
if (aiSectionsRef.current) applyAiSectionsToDom(parseAiSectionsState(aiSectionsRef.current));
|
|
17201
|
-
postToParentRef.current({ type: "ow:change", nodes: [{ key: BRAND_KIT_KEY, text: value }] });
|
|
17202
|
-
postToParentRef.current({ type: "ow:ai-brand-applied", previous, value });
|
|
17203
|
-
};
|
|
17204
|
-
window.addEventListener("message", handleAiSetBrand);
|
|
17205
16253
|
const handleDeactivate = (e) => {
|
|
17206
16254
|
if (e.data?.type !== "ow:deactivate") return;
|
|
17207
16255
|
if (Date.now() < linkPopoverGraceUntilRef.current) return;
|
|
@@ -17210,12 +16258,6 @@ function OhhwellsBridge() {
|
|
|
17210
16258
|
closeLinkPopoverRef.current();
|
|
17211
16259
|
return;
|
|
17212
16260
|
}
|
|
17213
|
-
if (floatingPanelOpenRef.current) {
|
|
17214
|
-
setFloatingPanelRef.current(null);
|
|
17215
|
-
deselectRef.current();
|
|
17216
|
-
deactivateRef.current();
|
|
17217
|
-
return;
|
|
17218
|
-
}
|
|
17219
16261
|
deselectRef.current();
|
|
17220
16262
|
deactivateRef.current();
|
|
17221
16263
|
};
|
|
@@ -17235,10 +16277,6 @@ function OhhwellsBridge() {
|
|
|
17235
16277
|
closeLinkPopoverRef.current();
|
|
17236
16278
|
return;
|
|
17237
16279
|
}
|
|
17238
|
-
if (floatingPanelOpenRef.current) {
|
|
17239
|
-
closeFloatingPanelOnlyRef.current();
|
|
17240
|
-
return;
|
|
17241
|
-
}
|
|
17242
16280
|
if (activeElRef.current) {
|
|
17243
16281
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
17244
16282
|
const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
|
|
@@ -17269,10 +16307,6 @@ function OhhwellsBridge() {
|
|
|
17269
16307
|
return;
|
|
17270
16308
|
}
|
|
17271
16309
|
if (selectedElRef.current) {
|
|
17272
|
-
if (toolbarVariantRef.current === "logo") {
|
|
17273
|
-
deselectRef.current();
|
|
17274
|
-
return;
|
|
17275
|
-
}
|
|
17276
16310
|
if (toolbarVariantRef.current === "select-frame") {
|
|
17277
16311
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
17278
16312
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -17306,16 +16340,7 @@ function OhhwellsBridge() {
|
|
|
17306
16340
|
closeLinkPopoverRef.current();
|
|
17307
16341
|
return;
|
|
17308
16342
|
}
|
|
17309
|
-
if (e.key === "Escape" && floatingPanelOpenRef.current) {
|
|
17310
|
-
e.preventDefault();
|
|
17311
|
-
closeFloatingPanelOnlyRef.current();
|
|
17312
|
-
return;
|
|
17313
|
-
}
|
|
17314
16343
|
if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
|
|
17315
|
-
if (toolbarVariantRef.current === "logo") {
|
|
17316
|
-
deselectRef.current();
|
|
17317
|
-
return;
|
|
17318
|
-
}
|
|
17319
16344
|
if (toolbarVariantRef.current === "select-frame") {
|
|
17320
16345
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
17321
16346
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -17393,8 +16418,7 @@ function OhhwellsBridge() {
|
|
|
17393
16418
|
const handleScroll = () => {
|
|
17394
16419
|
const focusEl = activeElRef.current ?? selectedElRef.current;
|
|
17395
16420
|
if (focusEl) {
|
|
17396
|
-
const
|
|
17397
|
-
const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
|
|
16421
|
+
const r2 = activeElRef.current ? getEditMeasureEl(activeElRef.current).getBoundingClientRect() : focusEl.getBoundingClientRect();
|
|
17398
16422
|
applyToolbarPos(r2);
|
|
17399
16423
|
setToolbarRect(r2);
|
|
17400
16424
|
setMaxBadge((prev) => prev && activeElRef.current ? { ...prev, rect: r2 } : prev);
|
|
@@ -17404,9 +16428,7 @@ function OhhwellsBridge() {
|
|
|
17404
16428
|
setToggleState((prev) => prev ? { ...prev, rect } : null);
|
|
17405
16429
|
}
|
|
17406
16430
|
if (hoveredItemElRef.current) {
|
|
17407
|
-
|
|
17408
|
-
const logo = getLogoElement(hoverEl);
|
|
17409
|
-
setHoveredItemRect(logo ? getLogoInteractionRect(logo) : hoverEl.getBoundingClientRect());
|
|
16431
|
+
setHoveredItemRect(hoveredItemElRef.current.getBoundingClientRect());
|
|
17410
16432
|
}
|
|
17411
16433
|
if (hoveredNavContainerRef.current) {
|
|
17412
16434
|
setHoveredNavContainerRect(hoveredNavContainerRef.current.getBoundingClientRect());
|
|
@@ -17450,9 +16472,6 @@ function OhhwellsBridge() {
|
|
|
17450
16472
|
if (aiSectionsRef.current) {
|
|
17451
16473
|
nodes.push({ key: AI_SECTIONS_KEY, type: "sections", text: aiSectionsRef.current });
|
|
17452
16474
|
}
|
|
17453
|
-
if (brandKitRef.current) {
|
|
17454
|
-
nodes.push({ key: BRAND_KIT_KEY, type: "brand", text: brandKitRef.current });
|
|
17455
|
-
}
|
|
17456
16475
|
postToParentRef.current({ type: "ow:save-result", nodes });
|
|
17457
16476
|
};
|
|
17458
16477
|
const handleInsertSection = (e) => {
|
|
@@ -17463,12 +16482,8 @@ function OhhwellsBridge() {
|
|
|
17463
16482
|
if (inserted) {
|
|
17464
16483
|
const tracker = getSectionsTracker();
|
|
17465
16484
|
postToParentRef.current({ type: "ow:change", nodes: [{ key: "__ohw_sections", text: tracker.textContent ?? "[]" }] });
|
|
17466
|
-
const
|
|
17467
|
-
|
|
17468
|
-
if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
|
|
17469
|
-
};
|
|
17470
|
-
reportHeight();
|
|
17471
|
-
setTimeout(reportHeight, 500);
|
|
16485
|
+
const h = document.documentElement.scrollHeight;
|
|
16486
|
+
if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
|
|
17472
16487
|
}
|
|
17473
16488
|
};
|
|
17474
16489
|
const handleSwitchSchedule = (e) => {
|
|
@@ -17661,17 +16676,13 @@ function OhhwellsBridge() {
|
|
|
17661
16676
|
if (e.data?.type !== "ow:parent-scroll") return;
|
|
17662
16677
|
const { iframeOffsetTop, headerH, canvasH } = e.data;
|
|
17663
16678
|
parentScrollRef.current = { iframeOffsetTop, headerH, canvasH };
|
|
17664
|
-
if (floatingPanelOpenRef.current) {
|
|
17665
|
-
setParentScrollSnap({ iframeOffsetTop, headerH, canvasH });
|
|
17666
|
-
}
|
|
17667
16679
|
if (visibleViewportRef.current) {
|
|
17668
16680
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
17669
16681
|
}
|
|
17670
16682
|
const focusEl = activeElRef.current ?? selectedElRef.current;
|
|
17671
16683
|
if (focusEl) {
|
|
17672
|
-
const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) :
|
|
17673
|
-
|
|
17674
|
-
applyToolbarPos(r2);
|
|
16684
|
+
const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : focusEl;
|
|
16685
|
+
applyToolbarPos(measureEl.getBoundingClientRect());
|
|
17675
16686
|
}
|
|
17676
16687
|
};
|
|
17677
16688
|
const handleClickAt = (e) => {
|
|
@@ -17696,25 +16707,6 @@ function OhhwellsBridge() {
|
|
|
17696
16707
|
postToParentRef.current({ type: "ow:image-pick", key: stateCardImage.dataset.ohwKey ?? "", elementType: stateCardImage.dataset.ohwEditable ?? "image" });
|
|
17697
16708
|
return;
|
|
17698
16709
|
}
|
|
17699
|
-
const logoAtPoint = Array.from(
|
|
17700
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]')
|
|
17701
|
-
).map((el) => getLogoElement(el)).find((logo) => {
|
|
17702
|
-
if (!logo) return false;
|
|
17703
|
-
const r2 = logo.getBoundingClientRect();
|
|
17704
|
-
return clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
|
|
17705
|
-
});
|
|
17706
|
-
if (logoAtPoint) {
|
|
17707
|
-
if (!logoHasUploadedImage(logoAtPoint)) {
|
|
17708
|
-
deselectRef.current();
|
|
17709
|
-
deactivateRef.current();
|
|
17710
|
-
const identity = readLogoIdentityFromDom();
|
|
17711
|
-
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
17712
|
-
return;
|
|
17713
|
-
}
|
|
17714
|
-
selectLogoRef.current(logoAtPoint);
|
|
17715
|
-
openLogoSizePanelRef.current(logoAtPoint);
|
|
17716
|
-
return;
|
|
17717
|
-
}
|
|
17718
16710
|
const textEditable = Array.from(
|
|
17719
16711
|
document.querySelectorAll(NON_MEDIA_SELECTOR)
|
|
17720
16712
|
).find((el) => {
|
|
@@ -17786,14 +16778,6 @@ function OhhwellsBridge() {
|
|
|
17786
16778
|
window.addEventListener("message", handleParentScroll);
|
|
17787
16779
|
window.addEventListener("message", handlePointerSync);
|
|
17788
16780
|
window.addEventListener("message", handleClickAt);
|
|
17789
|
-
window.addEventListener("message", handleUpdateLogoIdentity);
|
|
17790
|
-
const handleViewMode = (e) => {
|
|
17791
|
-
if (e.data?.type !== "ow:view-mode") return;
|
|
17792
|
-
const mode = e.data.mode === "Mobile" || e.data.mode === "mobile" ? "mobile" : "desktop";
|
|
17793
|
-
setEditorViewport(mode);
|
|
17794
|
-
applyLogoSizes(editContentRef.current);
|
|
17795
|
-
};
|
|
17796
|
-
window.addEventListener("message", handleViewMode);
|
|
17797
16781
|
const handleViewportResize = () => {
|
|
17798
16782
|
if (visibleViewportRef.current) {
|
|
17799
16783
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
@@ -17849,13 +16833,10 @@ function OhhwellsBridge() {
|
|
|
17849
16833
|
window.removeEventListener("resize", handleViewportResize);
|
|
17850
16834
|
window.removeEventListener("message", handlePointerSync);
|
|
17851
16835
|
window.removeEventListener("message", handleClickAt);
|
|
17852
|
-
window.removeEventListener("message", handleUpdateLogoIdentity);
|
|
17853
|
-
window.removeEventListener("message", handleViewMode);
|
|
17854
16836
|
window.removeEventListener("message", handleHydrate);
|
|
17855
16837
|
window.removeEventListener("message", handleAiApplyTree);
|
|
17856
16838
|
window.removeEventListener("message", handleAiDeleteSection);
|
|
17857
16839
|
window.removeEventListener("message", handleAiSetSections);
|
|
17858
|
-
window.removeEventListener("message", handleAiSetBrand);
|
|
17859
16840
|
window.removeEventListener("message", handleDeactivate);
|
|
17860
16841
|
window.removeEventListener("message", handleToastAction);
|
|
17861
16842
|
window.removeEventListener("message", handleUiEscape);
|
|
@@ -18454,10 +17435,10 @@ function OhhwellsBridge() {
|
|
|
18454
17435
|
[postToParent2]
|
|
18455
17436
|
);
|
|
18456
17437
|
return bridgeRoot ? createPortal2(
|
|
18457
|
-
/* @__PURE__ */
|
|
18458
|
-
/* @__PURE__ */
|
|
18459
|
-
isEditMode && /* @__PURE__ */
|
|
18460
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */
|
|
17438
|
+
/* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
17439
|
+
/* @__PURE__ */ jsx32("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
17440
|
+
isEditMode && /* @__PURE__ */ jsx32(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
|
|
17441
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx32(
|
|
18461
17442
|
MediaOverlay,
|
|
18462
17443
|
{
|
|
18463
17444
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -18468,7 +17449,7 @@ function OhhwellsBridge() {
|
|
|
18468
17449
|
},
|
|
18469
17450
|
`uploading-${key}`
|
|
18470
17451
|
)),
|
|
18471
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */
|
|
17452
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx32(
|
|
18472
17453
|
MediaOverlay,
|
|
18473
17454
|
{
|
|
18474
17455
|
hover: mediaHover,
|
|
@@ -18477,11 +17458,11 @@ function OhhwellsBridge() {
|
|
|
18477
17458
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
18478
17459
|
}
|
|
18479
17460
|
),
|
|
18480
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
18481
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */
|
|
18482
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */
|
|
18483
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */
|
|
18484
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */
|
|
17461
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx32(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
17462
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx32(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
17463
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx32(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
17464
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx32(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
17465
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx32(
|
|
18485
17466
|
"div",
|
|
18486
17467
|
{
|
|
18487
17468
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -18491,7 +17472,7 @@ function OhhwellsBridge() {
|
|
|
18491
17472
|
width: slot.width,
|
|
18492
17473
|
height: slot.height
|
|
18493
17474
|
},
|
|
18494
|
-
children: /* @__PURE__ */
|
|
17475
|
+
children: /* @__PURE__ */ jsx32(
|
|
18495
17476
|
DropIndicator,
|
|
18496
17477
|
{
|
|
18497
17478
|
direction: slot.direction,
|
|
@@ -18502,7 +17483,7 @@ function OhhwellsBridge() {
|
|
|
18502
17483
|
},
|
|
18503
17484
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
18504
17485
|
)),
|
|
18505
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */
|
|
17486
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx32(
|
|
18506
17487
|
"div",
|
|
18507
17488
|
{
|
|
18508
17489
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -18512,7 +17493,7 @@ function OhhwellsBridge() {
|
|
|
18512
17493
|
width: slot.width,
|
|
18513
17494
|
height: slot.height
|
|
18514
17495
|
},
|
|
18515
|
-
children: /* @__PURE__ */
|
|
17496
|
+
children: /* @__PURE__ */ jsx32(
|
|
18516
17497
|
DropIndicator,
|
|
18517
17498
|
{
|
|
18518
17499
|
direction: slot.direction,
|
|
@@ -18523,10 +17504,10 @@ function OhhwellsBridge() {
|
|
|
18523
17504
|
},
|
|
18524
17505
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
18525
17506
|
)),
|
|
18526
|
-
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
18527
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */
|
|
18528
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */
|
|
18529
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */
|
|
17507
|
+
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx32(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
17508
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx32(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
17509
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ jsx32(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
17510
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx32(
|
|
18530
17511
|
FooterContainerChrome,
|
|
18531
17512
|
{
|
|
18532
17513
|
rect: toolbarRect,
|
|
@@ -18534,7 +17515,7 @@ function OhhwellsBridge() {
|
|
|
18534
17515
|
addDisabled: !canAddFooterColumn()
|
|
18535
17516
|
}
|
|
18536
17517
|
),
|
|
18537
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame"
|
|
17518
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx32(
|
|
18538
17519
|
ItemInteractionLayer,
|
|
18539
17520
|
{
|
|
18540
17521
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -18546,10 +17527,10 @@ function OhhwellsBridge() {
|
|
|
18546
17527
|
dragHandleLabel: reorderHrefKey ? `Reorder ${reorderHrefKey}` : "Reorder item",
|
|
18547
17528
|
onDragHandleDragStart: handleItemDragStart,
|
|
18548
17529
|
onDragHandleDragEnd: handleItemDragEnd,
|
|
18549
|
-
onItemPointerDown:
|
|
18550
|
-
onItemClick:
|
|
18551
|
-
itemDragSurface:
|
|
18552
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */
|
|
17530
|
+
onItemPointerDown: handleItemChromePointerDown,
|
|
17531
|
+
onItemClick: handleItemChromeClick,
|
|
17532
|
+
itemDragSurface: !isFooterFrameSelection,
|
|
17533
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ jsx32(
|
|
18553
17534
|
ItemActionToolbar,
|
|
18554
17535
|
{
|
|
18555
17536
|
onEditLink: openLinkPopoverForSelected,
|
|
@@ -18582,8 +17563,8 @@ function OhhwellsBridge() {
|
|
|
18582
17563
|
) : void 0
|
|
18583
17564
|
}
|
|
18584
17565
|
),
|
|
18585
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */
|
|
18586
|
-
/* @__PURE__ */
|
|
17566
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
17567
|
+
/* @__PURE__ */ jsx32(
|
|
18587
17568
|
EditGlowChrome,
|
|
18588
17569
|
{
|
|
18589
17570
|
rect: toolbarRect,
|
|
@@ -18593,7 +17574,7 @@ function OhhwellsBridge() {
|
|
|
18593
17574
|
hideHandle: isItemDragging
|
|
18594
17575
|
}
|
|
18595
17576
|
),
|
|
18596
|
-
/* @__PURE__ */
|
|
17577
|
+
/* @__PURE__ */ jsx32(
|
|
18597
17578
|
FloatingToolbar,
|
|
18598
17579
|
{
|
|
18599
17580
|
rect: toolbarRect,
|
|
@@ -18606,7 +17587,7 @@ function OhhwellsBridge() {
|
|
|
18606
17587
|
}
|
|
18607
17588
|
)
|
|
18608
17589
|
] }),
|
|
18609
|
-
maxBadge && /* @__PURE__ */
|
|
17590
|
+
maxBadge && /* @__PURE__ */ jsxs19(
|
|
18610
17591
|
"div",
|
|
18611
17592
|
{
|
|
18612
17593
|
"data-ohw-max-badge": "",
|
|
@@ -18632,7 +17613,7 @@ function OhhwellsBridge() {
|
|
|
18632
17613
|
]
|
|
18633
17614
|
}
|
|
18634
17615
|
),
|
|
18635
|
-
toggleState && !linkPopover && /* @__PURE__ */
|
|
17616
|
+
toggleState && !linkPopover && /* @__PURE__ */ jsx32(
|
|
18636
17617
|
StateToggle,
|
|
18637
17618
|
{
|
|
18638
17619
|
rect: toggleState.rect,
|
|
@@ -18641,15 +17622,15 @@ function OhhwellsBridge() {
|
|
|
18641
17622
|
onStateChange: handleStateChange
|
|
18642
17623
|
}
|
|
18643
17624
|
),
|
|
18644
|
-
sectionGap && !linkPopover && /* @__PURE__ */
|
|
17625
|
+
sectionGap && !linkPopover && /* @__PURE__ */ jsxs19(
|
|
18645
17626
|
"div",
|
|
18646
17627
|
{
|
|
18647
17628
|
"data-ohw-section-insert-line": "",
|
|
18648
17629
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
18649
17630
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
18650
17631
|
children: [
|
|
18651
|
-
/* @__PURE__ */
|
|
18652
|
-
/* @__PURE__ */
|
|
17632
|
+
/* @__PURE__ */ jsx32("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
17633
|
+
/* @__PURE__ */ jsx32(
|
|
18653
17634
|
Badge,
|
|
18654
17635
|
{
|
|
18655
17636
|
className: "px-8 py-1 bg-primary hover:bg-primary text-primary-foreground text-xs font-medium shrink-0 rounded-full cursor-pointer pointer-events-auto",
|
|
@@ -18666,11 +17647,11 @@ function OhhwellsBridge() {
|
|
|
18666
17647
|
children: "Add Section"
|
|
18667
17648
|
}
|
|
18668
17649
|
),
|
|
18669
|
-
/* @__PURE__ */
|
|
17650
|
+
/* @__PURE__ */ jsx32("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
18670
17651
|
]
|
|
18671
17652
|
}
|
|
18672
17653
|
),
|
|
18673
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */
|
|
17654
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx32(
|
|
18674
17655
|
LinkPopover,
|
|
18675
17656
|
{
|
|
18676
17657
|
panelRef: linkPopoverPanelRef,
|
|
@@ -18687,7 +17668,7 @@ function OhhwellsBridge() {
|
|
|
18687
17668
|
},
|
|
18688
17669
|
linkPopover.key
|
|
18689
17670
|
) : null,
|
|
18690
|
-
floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */
|
|
17671
|
+
floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */ jsx32(
|
|
18691
17672
|
FloatingPanel,
|
|
18692
17673
|
{
|
|
18693
17674
|
open: true,
|
|
@@ -18697,7 +17678,7 @@ function OhhwellsBridge() {
|
|
|
18697
17678
|
onPositionChange: setFloatingPanelPos,
|
|
18698
17679
|
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
18699
17680
|
onClose: closeFloatingPanelOnly,
|
|
18700
|
-
children: /* @__PURE__ */
|
|
17681
|
+
children: /* @__PURE__ */ jsx32(
|
|
18701
17682
|
SocialsDisplayPanel,
|
|
18702
17683
|
{
|
|
18703
17684
|
display: socialsDisplayFor(floatingPanel.row, editContentRef.current),
|
|
@@ -18708,115 +17689,11 @@ function OhhwellsBridge() {
|
|
|
18708
17689
|
}
|
|
18709
17690
|
)
|
|
18710
17691
|
}
|
|
18711
|
-
) : null,
|
|
18712
|
-
floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ jsx33(
|
|
18713
|
-
FloatingPanel,
|
|
18714
|
-
{
|
|
18715
|
-
open: true,
|
|
18716
|
-
title: floatingPanel.title,
|
|
18717
|
-
context: floatingPanel.context,
|
|
18718
|
-
position: floatingPanelPos,
|
|
18719
|
-
onPositionChange: setFloatingPanelPos,
|
|
18720
|
-
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
18721
|
-
onClose: closeFloatingPanelAndDeselect,
|
|
18722
|
-
children: /* @__PURE__ */ jsx33(
|
|
18723
|
-
LogoSizePanel,
|
|
18724
|
-
{
|
|
18725
|
-
viewport: editorViewport,
|
|
18726
|
-
sizePx: editorViewport === "mobile" && !logoSizeDraft.mobileFollowing ? logoSizeDraft.mobilePx : logoSizeDraft.desktopPx,
|
|
18727
|
-
mobileFollowing: logoSizeDraft.mobileFollowing,
|
|
18728
|
-
onSizeChange: (px) => {
|
|
18729
|
-
const next = editorViewport === "mobile" ? { ...logoSizeDraft, mobilePx: px, mobileFollowing: false } : {
|
|
18730
|
-
...logoSizeDraft,
|
|
18731
|
-
desktopPx: px,
|
|
18732
|
-
mobilePx: logoSizeDraft.mobileFollowing ? px : logoSizeDraft.mobilePx
|
|
18733
|
-
};
|
|
18734
|
-
setLogoSizeDraft(next);
|
|
18735
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
18736
|
-
},
|
|
18737
|
-
onCustomizeMobile: () => {
|
|
18738
|
-
const next = {
|
|
18739
|
-
...logoSizeDraft,
|
|
18740
|
-
mobileFollowing: false,
|
|
18741
|
-
mobilePx: logoSizeDraft.desktopPx
|
|
18742
|
-
};
|
|
18743
|
-
setLogoSizeDraft(next);
|
|
18744
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
18745
|
-
},
|
|
18746
|
-
onResetMobile: () => {
|
|
18747
|
-
const next = {
|
|
18748
|
-
...logoSizeDraft,
|
|
18749
|
-
mobileFollowing: true,
|
|
18750
|
-
mobilePx: logoSizeDraft.desktopPx
|
|
18751
|
-
};
|
|
18752
|
-
setLogoSizeDraft(next);
|
|
18753
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
18754
|
-
},
|
|
18755
|
-
onUpdateEverywhere: () => {
|
|
18756
|
-
const identity = readLogoIdentityFromDom();
|
|
18757
|
-
postToParent2({ type: "ow:open-logo-settings", ...identity });
|
|
18758
|
-
}
|
|
18759
|
-
}
|
|
18760
|
-
)
|
|
18761
|
-
}
|
|
18762
17692
|
) : null
|
|
18763
17693
|
] }),
|
|
18764
17694
|
bridgeRoot
|
|
18765
17695
|
) : null;
|
|
18766
17696
|
}
|
|
18767
|
-
|
|
18768
|
-
// src/ui/EmptySection.tsx
|
|
18769
|
-
import Link4 from "next/link";
|
|
18770
|
-
import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
18771
|
-
function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
|
|
18772
|
-
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
18773
|
-
/* @__PURE__ */ jsx34(
|
|
18774
|
-
"p",
|
|
18775
|
-
{
|
|
18776
|
-
style: {
|
|
18777
|
-
fontFamily: "var(--brand-font-body)",
|
|
18778
|
-
fontSize: "0.75rem",
|
|
18779
|
-
fontWeight: 500,
|
|
18780
|
-
letterSpacing: "0.15em",
|
|
18781
|
-
textTransform: "uppercase",
|
|
18782
|
-
color: "var(--brand-accent)",
|
|
18783
|
-
marginBottom: "1.5rem"
|
|
18784
|
-
},
|
|
18785
|
-
children: /* @__PURE__ */ jsx34(Link4, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ jsx34("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
|
|
18786
|
-
}
|
|
18787
|
-
),
|
|
18788
|
-
/* @__PURE__ */ jsx34(
|
|
18789
|
-
"h1",
|
|
18790
|
-
{
|
|
18791
|
-
style: {
|
|
18792
|
-
fontFamily: "var(--brand-font-heading)",
|
|
18793
|
-
fontSize: "clamp(2rem, 3.5vw, 2.75rem)",
|
|
18794
|
-
lineHeight: 1.1,
|
|
18795
|
-
letterSpacing: "-0.025em",
|
|
18796
|
-
color: "var(--brand-text)",
|
|
18797
|
-
marginBottom: "1rem"
|
|
18798
|
-
},
|
|
18799
|
-
...titleKey ? { "data-ohw-editable": "text", "data-ohw-key": titleKey, "data-ohw-max-length": 80 } : {},
|
|
18800
|
-
children: title
|
|
18801
|
-
}
|
|
18802
|
-
),
|
|
18803
|
-
/* @__PURE__ */ jsx34(
|
|
18804
|
-
"p",
|
|
18805
|
-
{
|
|
18806
|
-
style: {
|
|
18807
|
-
fontFamily: "var(--brand-font-body)",
|
|
18808
|
-
fontSize: "1rem",
|
|
18809
|
-
lineHeight: 1.7,
|
|
18810
|
-
fontWeight: 300,
|
|
18811
|
-
color: "var(--brand-text-muted)",
|
|
18812
|
-
maxWidth: "340px"
|
|
18813
|
-
},
|
|
18814
|
-
...subtitleKey ? { "data-ohw-editable": "text", "data-ohw-key": subtitleKey, "data-ohw-max-length": 160 } : {},
|
|
18815
|
-
children: "This page doesn't have any content yet."
|
|
18816
|
-
}
|
|
18817
|
-
)
|
|
18818
|
-
] });
|
|
18819
|
-
}
|
|
18820
17697
|
export {
|
|
18821
17698
|
AI_DEFAULT_BRAND,
|
|
18822
17699
|
AI_TREE_SCHEMA_VERSIONS,
|
|
@@ -18833,7 +17710,6 @@ export {
|
|
|
18833
17710
|
DropdownMenuItem,
|
|
18834
17711
|
DropdownMenuSeparator,
|
|
18835
17712
|
DropdownMenuTrigger,
|
|
18836
|
-
EmptySection,
|
|
18837
17713
|
ItemActionToolbar,
|
|
18838
17714
|
ItemInteractionLayer,
|
|
18839
17715
|
LinkEditorPanel,
|