@ohhwells/bridge 0.1.83 → 0.1.85
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 +151 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +151 -8
- package/dist/index.js.map +1 -1
- package/dist/social-glyphs.cjs +1 -1
- package/dist/social-glyphs.cjs.map +1 -1
- package/dist/social-glyphs.js +1 -1
- package/dist/social-glyphs.js.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -183,6 +183,17 @@ var BRAND_VAR_PREFIX = "--ohw-brand-";
|
|
|
183
183
|
var BRAND_VAR_NAMES = ["primary", "accent", "light", "dark", "surface", "border", "muted"].map(
|
|
184
184
|
(role) => `${BRAND_VAR_PREFIX}${role}`
|
|
185
185
|
);
|
|
186
|
+
var LEGACY_BRAND_VAR_NAMES = [
|
|
187
|
+
"primary",
|
|
188
|
+
"accent",
|
|
189
|
+
"background",
|
|
190
|
+
"text",
|
|
191
|
+
"text-muted",
|
|
192
|
+
"surface",
|
|
193
|
+
"border",
|
|
194
|
+
"on-primary",
|
|
195
|
+
"navbar-background"
|
|
196
|
+
].map((role) => `--brand-${role}`);
|
|
186
197
|
var FONT_VARS = {
|
|
187
198
|
heading: ["--font-heading", "--font-display", "--brand-font-heading"],
|
|
188
199
|
body: ["--font-body", "--brand-font-body"]
|
|
@@ -191,14 +202,29 @@ var BRAND_FONT_LINK_ID = "ohw-brand-fonts";
|
|
|
191
202
|
function brandColorVars(kit) {
|
|
192
203
|
const { dark, primary, accent, light } = kit.palette;
|
|
193
204
|
const mix = (a, aPct, b) => `color-mix(in srgb, ${a} ${aPct}%, ${b})`;
|
|
205
|
+
const surface = mix(light, 95, dark);
|
|
206
|
+
const border = mix(light, 85, dark);
|
|
207
|
+
const muted = mix(dark, 62, light);
|
|
194
208
|
return {
|
|
195
209
|
[`${BRAND_VAR_PREFIX}primary`]: primary,
|
|
196
210
|
[`${BRAND_VAR_PREFIX}accent`]: accent,
|
|
197
211
|
[`${BRAND_VAR_PREFIX}light`]: light,
|
|
198
212
|
[`${BRAND_VAR_PREFIX}dark`]: dark,
|
|
199
|
-
[`${BRAND_VAR_PREFIX}surface`]:
|
|
200
|
-
[`${BRAND_VAR_PREFIX}border`]:
|
|
201
|
-
[`${BRAND_VAR_PREFIX}muted`]:
|
|
213
|
+
[`${BRAND_VAR_PREFIX}surface`]: surface,
|
|
214
|
+
[`${BRAND_VAR_PREFIX}border`]: border,
|
|
215
|
+
[`${BRAND_VAR_PREFIX}muted`]: muted,
|
|
216
|
+
// The BrandProvider contract every template actually renders from (see LEGACY_BRAND_VAR_NAMES).
|
|
217
|
+
"--brand-primary": primary,
|
|
218
|
+
"--brand-accent": accent,
|
|
219
|
+
"--brand-background": light,
|
|
220
|
+
"--brand-text": dark,
|
|
221
|
+
"--brand-text-muted": muted,
|
|
222
|
+
"--brand-surface": surface,
|
|
223
|
+
"--brand-border": border,
|
|
224
|
+
// Buttons/bands painted in the primary colour assume it's dark/saturated enough to need
|
|
225
|
+
// light text on top — the same assumption LOGO_IMAGE's light-on-dark navbar mark makes.
|
|
226
|
+
"--brand-on-primary": light,
|
|
227
|
+
"--brand-navbar-background": dark
|
|
202
228
|
};
|
|
203
229
|
}
|
|
204
230
|
function parseBrandKit(raw) {
|
|
@@ -239,7 +265,7 @@ function loadBrandFonts(families) {
|
|
|
239
265
|
function applyBrandToDom(kit) {
|
|
240
266
|
const root = document.documentElement;
|
|
241
267
|
if (!kit) {
|
|
242
|
-
for (const name of BRAND_VAR_NAMES) root.style.removeProperty(name);
|
|
268
|
+
for (const name of [...BRAND_VAR_NAMES, ...LEGACY_BRAND_VAR_NAMES]) root.style.removeProperty(name);
|
|
243
269
|
for (const name of [...FONT_VARS.heading, ...FONT_VARS.body]) root.style.removeProperty(name);
|
|
244
270
|
document.getElementById(BRAND_FONT_LINK_ID)?.remove();
|
|
245
271
|
return;
|
|
@@ -7359,6 +7385,9 @@ function applyFieldType(wrapper, type) {
|
|
|
7359
7385
|
el.style.removeProperty("min-height");
|
|
7360
7386
|
el.style.removeProperty("resize");
|
|
7361
7387
|
el.removeAttribute("rows");
|
|
7388
|
+
if (el.className) {
|
|
7389
|
+
el.className = el.className.split(/\s+/).filter((token) => !/textarea/i.test(token)).join(" ");
|
|
7390
|
+
}
|
|
7362
7391
|
};
|
|
7363
7392
|
const applyDefaults = (el) => {
|
|
7364
7393
|
el.setAttribute("placeholder", defaults.placeholder);
|
|
@@ -11609,7 +11638,7 @@ function applySocialsDisplayToRow(row, display) {
|
|
|
11609
11638
|
const icon = item.querySelector(ICON_SELECTOR);
|
|
11610
11639
|
if (label) label.style.display = display.text ? "" : "none";
|
|
11611
11640
|
if (icon) icon.style.display = display.icon ? "" : "none";
|
|
11612
|
-
layOutIconAndLabel(item, Boolean(display.text
|
|
11641
|
+
layOutIconAndLabel(item, Boolean(display.text));
|
|
11613
11642
|
});
|
|
11614
11643
|
allowRowToWrap(row);
|
|
11615
11644
|
}
|
|
@@ -11621,6 +11650,9 @@ function layOutIconAndLabel(item, on) {
|
|
|
11621
11650
|
item.style.gap = "";
|
|
11622
11651
|
item.style.whiteSpace = "";
|
|
11623
11652
|
item.style.flex = "";
|
|
11653
|
+
item.style.width = "";
|
|
11654
|
+
item.style.height = "";
|
|
11655
|
+
item.style.padding = "";
|
|
11624
11656
|
return;
|
|
11625
11657
|
}
|
|
11626
11658
|
item.style.display = on ? "inline-flex" : "";
|
|
@@ -11628,6 +11660,9 @@ function layOutIconAndLabel(item, on) {
|
|
|
11628
11660
|
item.style.gap = on ? "8px" : "";
|
|
11629
11661
|
item.style.whiteSpace = on ? "nowrap" : "";
|
|
11630
11662
|
item.style.flex = on ? "0 0 auto" : "";
|
|
11663
|
+
item.style.width = on ? "auto" : "";
|
|
11664
|
+
item.style.height = on ? "auto" : "";
|
|
11665
|
+
item.style.padding = on ? "0 12px" : "";
|
|
11631
11666
|
}
|
|
11632
11667
|
function allowRowToWrap(row) {
|
|
11633
11668
|
const display = row.ownerDocument.defaultView?.getComputedStyle(row).display ?? "";
|
|
@@ -12583,6 +12618,15 @@ function resolveLogoDisplayText(text) {
|
|
|
12583
12618
|
function isFooterLogoRoot(root) {
|
|
12584
12619
|
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
12585
12620
|
}
|
|
12621
|
+
var NAV_IMAGE_KEYS = ["nav-logo-image", "logo-image"];
|
|
12622
|
+
var FOOTER_IMAGE_KEYS = ["footer-logo", "footer-logo-image", "footer-logo-img"];
|
|
12623
|
+
function firstNonEmptyContentValue(content, keys) {
|
|
12624
|
+
for (const key of keys) {
|
|
12625
|
+
const value = content[key];
|
|
12626
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
12627
|
+
}
|
|
12628
|
+
return null;
|
|
12629
|
+
}
|
|
12586
12630
|
function imageKeyForRoot(root) {
|
|
12587
12631
|
return isFooterLogoRoot(root) ? "footer-logo" : "nav-logo-image";
|
|
12588
12632
|
}
|
|
@@ -12632,9 +12676,10 @@ function applyLogoIdentity(text, isPlaceholder) {
|
|
|
12632
12676
|
});
|
|
12633
12677
|
return display;
|
|
12634
12678
|
}
|
|
12635
|
-
function applyLogoImage(url, alt) {
|
|
12679
|
+
function applyLogoImage(url, alt, placement) {
|
|
12636
12680
|
const displayAlt = resolveLogoDisplayText(alt);
|
|
12637
12681
|
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
12682
|
+
if (placement && (isFooterLogoRoot(root) ? "footer" : "navbar") !== placement) return;
|
|
12638
12683
|
ensureLogoHrefKey(root);
|
|
12639
12684
|
const imageKey = imageKeyForRoot(root);
|
|
12640
12685
|
const textKey = textKeyForRoot(root);
|
|
@@ -12755,7 +12800,12 @@ function applyLogoFromContent(content) {
|
|
|
12755
12800
|
const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
|
|
12756
12801
|
const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
|
|
12757
12802
|
const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
|
|
12758
|
-
|
|
12803
|
+
const navImageUrl = firstNonEmptyContentValue(content, NAV_IMAGE_KEYS);
|
|
12804
|
+
const footerImageUrl = firstNonEmptyContentValue(content, FOOTER_IMAGE_KEYS);
|
|
12805
|
+
if (navImageUrl && footerImageUrl && navImageUrl !== footerImageUrl) {
|
|
12806
|
+
applyLogoImage(navImageUrl, logoAlt, "navbar");
|
|
12807
|
+
applyLogoImage(footerImageUrl, logoAlt, "footer");
|
|
12808
|
+
} else if (logoImageUrl) {
|
|
12759
12809
|
applyLogoImage(logoImageUrl, logoAlt);
|
|
12760
12810
|
} else {
|
|
12761
12811
|
if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
|
|
@@ -15962,6 +16012,7 @@ function StateToggle({
|
|
|
15962
16012
|
);
|
|
15963
16013
|
}
|
|
15964
16014
|
var contentCache = /* @__PURE__ */ new Map();
|
|
16015
|
+
var brandingCache = /* @__PURE__ */ new Map();
|
|
15965
16016
|
var OHW_LOADER_STYLE = {
|
|
15966
16017
|
position: "fixed",
|
|
15967
16018
|
inset: 0,
|
|
@@ -15999,6 +16050,89 @@ function OhwLoaderSpinner() {
|
|
|
15999
16050
|
)
|
|
16000
16051
|
] });
|
|
16001
16052
|
}
|
|
16053
|
+
function OhwBrandMark() {
|
|
16054
|
+
return /* @__PURE__ */ jsxs20(
|
|
16055
|
+
"svg",
|
|
16056
|
+
{
|
|
16057
|
+
width: "16",
|
|
16058
|
+
height: "16",
|
|
16059
|
+
viewBox: "0 0 48 48",
|
|
16060
|
+
fill: "none",
|
|
16061
|
+
"aria-hidden": true,
|
|
16062
|
+
style: { display: "block", flexShrink: 0 },
|
|
16063
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16064
|
+
children: [
|
|
16065
|
+
/* @__PURE__ */ jsx33(
|
|
16066
|
+
"mask",
|
|
16067
|
+
{
|
|
16068
|
+
id: "ohw-badge-mark",
|
|
16069
|
+
style: { maskType: "luminance" },
|
|
16070
|
+
maskUnits: "userSpaceOnUse",
|
|
16071
|
+
x: "0",
|
|
16072
|
+
y: "0",
|
|
16073
|
+
width: "48",
|
|
16074
|
+
height: "48",
|
|
16075
|
+
children: /* @__PURE__ */ jsx33("path", { d: "M23.8741 48C37.0594 48 47.7481 37.2548 47.7481 24C47.7481 10.7452 37.0594 0 23.8741 0C10.6888 0 0 10.7452 0 24C0 37.2548 10.6888 48 23.8741 48Z", fill: "white" })
|
|
16076
|
+
}
|
|
16077
|
+
),
|
|
16078
|
+
/* @__PURE__ */ jsxs20("g", { mask: "url(#ohw-badge-mark)", children: [
|
|
16079
|
+
/* @__PURE__ */ jsx33("path", { d: "M23.8731 48.0497C37.0584 48.0497 47.7472 37.3046 47.7472 24.0497C47.7472 10.7949 37.0584 0.0497208 23.8731 0.0497208C10.6878 0.0497208 -0.000976562 10.7949 -0.000976562 24.0497C-0.000976562 37.3046 10.6878 48.0497 23.8731 48.0497Z", fill: "#0078E5" }),
|
|
16080
|
+
/* @__PURE__ */ jsx33("path", { d: "M17.1307 14.7172C13.1687 14.7172 9.38102 18.1154 8.65114 22.34C8.38885 23.8488 8.5598 25.2581 9.06929 26.4451C6.20005 29.1677 1.77216 27.8721 -1.40212 26.1536C-2.73618 25.4317 -3.92695 27.4745 -2.59037 28.1981C1.33389 30.3226 6.86037 31.6621 10.4402 28.4188C11.4718 29.3859 12.867 29.9621 14.4894 29.9621C18.4161 29.9621 22.2038 26.5318 22.9337 22.34C23.6636 18.1162 21.0566 14.7172 17.1298 14.7172H17.1307ZM19.9798 22.34C19.5281 25.0399 17.2689 27.231 14.9754 27.231C12.6466 27.231 11.1877 25.0399 11.6394 22.34C12.1262 19.6401 14.3151 17.4482 16.6438 17.4482C18.9374 17.4482 20.4667 19.6401 19.9798 22.34Z", fill: "white" }),
|
|
16081
|
+
/* @__PURE__ */ jsx33("path", { d: "M40.0017 27.0262C39.1797 27.081 38.2721 26.995 37.4668 26.7415C37.3344 26.6993 37.28 26.5401 37.3529 26.4205C37.5959 26.0212 37.8255 25.6152 38.009 25.1889C38.1071 24.9918 38.2018 24.793 38.2897 24.5908C38.3274 24.5041 38.4163 24.451 38.5101 24.4619C38.63 24.4754 38.7054 24.4821 38.8881 24.4821L39.1529 24.4796L39.8283 24.4543C45.9229 24.0492 50.4765 20.4319 54.8466 16.9014C56.0172 15.9554 57.6932 17.6208 56.5116 18.5752C51.7687 22.4065 47.1966 26.5081 40.9319 26.9689", fill: "white" }),
|
|
16082
|
+
/* @__PURE__ */ jsx33("path", { d: "M37.9687 24.27C38.4472 23.1319 38.7656 21.9045 38.9609 20.6991C39.5927 16.76 38.5058 14.2193 36.1553 14.2193C34.1835 14.2193 33.1469 17.2427 32.9199 18.8694C32.743 19.9872 32.5914 22.1219 33.6028 23.9524C33.7553 24.259 34.15 24.7712 34.471 25.1259C34.5447 25.2067 34.6746 25.2 34.7349 25.1082C34.9528 24.7788 35.1615 24.4039 35.3584 24.0257C35.5444 23.6677 35.5888 23.6138 35.8587 23.0207C35.8838 22.966 35.8813 22.9002 35.8478 22.8505C35.5888 22.4597 35.2168 21.9787 35.1204 21.4614C34.9184 20.4455 34.9436 19.2257 35.2218 18.1078C35.4413 17.3118 35.7195 16.7844 35.9039 16.5106C35.9466 16.4466 36.0279 16.4129 36.0975 16.4449C36.369 16.5671 36.5827 16.8838 36.7385 17.396C37.0167 18.2089 37.0167 19.3782 36.814 20.6999C36.6991 21.5271 36.4771 22.3729 36.1746 23.1673C36.1293 23.308 36.0757 23.4461 36.0187 23.5826C36.0187 23.5868 36.0187 23.591 36.0187 23.5961C35.9911 23.6946 35.9207 23.8067 35.8846 23.901C35.5536 24.5497 35.2344 25.1697 34.8439 25.7838C34.8388 25.7863 34.8346 25.7914 34.8296 25.7931C34.6528 26.0525 34.4718 26.2901 34.2866 26.4965C34.2774 26.5099 34.2682 26.5234 34.2589 26.5369C34.2405 26.5638 34.2179 26.5815 34.1944 26.595C33.5064 27.3212 32.7665 27.6893 32.0123 27.6893C31.8606 27.6893 31.6838 27.664 31.507 27.4349C31.3042 27.1299 30.85 26.0879 31.2539 22.9112C31.4785 21.3949 31.8011 20.0268 31.931 19.5408C31.9579 19.4413 31.8908 19.3419 31.7886 19.3293L30.0062 19.1162C29.9241 19.1061 29.8478 19.1566 29.8252 19.2366C29.2704 21.1615 27.0305 27.6885 24.9599 27.6885C24.328 27.6885 24.1512 26.6211 24.1001 26.2909C23.775 23.6264 25.528 18.5492 29.5302 16.2267C29.6048 16.1838 29.635 16.0928 29.5998 16.0136L28.9042 14.467C28.8632 14.3752 28.7501 14.3389 28.6638 14.3886C25.8079 16.0414 24.1847 18.5231 23.2915 20.3436C22.2046 22.5793 21.6993 25.0189 21.9515 26.8738C22.1795 28.7794 23.1398 29.872 24.6054 29.872C26.0543 29.872 27.4369 28.9066 28.7098 27.0187C28.7953 26.8915 28.9889 26.9311 29.0149 27.0819C29.2646 28.5283 29.9811 29.872 31.6579 29.872C33.5282 29.872 35.3232 28.7288 36.7134 26.6447C36.7712 26.5874 36.7972 26.5411 36.8181 26.4906C36.8232 26.4931 36.8282 26.4948 36.8332 26.4973C37.01 26.2025 37.181 25.9051 37.3444 25.6027C37.4508 25.4005 37.5572 25.1992 37.6586 24.9945C37.7181 24.874 37.7743 24.7527 37.8262 24.6289C37.838 24.6002 37.8547 24.5665 37.8706 24.5337", fill: "white" }),
|
|
16083
|
+
/* @__PURE__ */ jsx33("path", { d: "M30.5839 31.6397C25.7546 34.8577 19.4773 34.7853 14.6907 31.5243C13.5368 30.7384 12.5044 32.6498 13.6474 33.4281C19.034 37.0985 26.3077 37.096 31.7218 33.488C32.8791 32.7172 31.7478 30.8639 30.5839 31.6397Z", fill: "white" })
|
|
16084
|
+
] })
|
|
16085
|
+
]
|
|
16086
|
+
}
|
|
16087
|
+
);
|
|
16088
|
+
}
|
|
16089
|
+
var OHW_BADGE_STYLE = {
|
|
16090
|
+
position: "fixed",
|
|
16091
|
+
left: 20,
|
|
16092
|
+
bottom: 20,
|
|
16093
|
+
zIndex: 2147483e3,
|
|
16094
|
+
boxSizing: "border-box",
|
|
16095
|
+
display: "inline-flex",
|
|
16096
|
+
alignItems: "center",
|
|
16097
|
+
gap: 0,
|
|
16098
|
+
padding: "6px 8px",
|
|
16099
|
+
margin: 0,
|
|
16100
|
+
background: "#ffffff",
|
|
16101
|
+
border: "1px solid #e7e5e4",
|
|
16102
|
+
borderRadius: 9999,
|
|
16103
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
16104
|
+
color: "#0c0a09",
|
|
16105
|
+
textDecoration: "none",
|
|
16106
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"
|
|
16107
|
+
};
|
|
16108
|
+
var OHW_BADGE_LABEL_STYLE = {
|
|
16109
|
+
padding: "0 4px",
|
|
16110
|
+
fontSize: 14,
|
|
16111
|
+
lineHeight: "24px",
|
|
16112
|
+
fontWeight: 500,
|
|
16113
|
+
fontStyle: "normal",
|
|
16114
|
+
letterSpacing: "normal",
|
|
16115
|
+
textTransform: "none",
|
|
16116
|
+
color: "#0c0a09",
|
|
16117
|
+
whiteSpace: "nowrap"
|
|
16118
|
+
};
|
|
16119
|
+
function MadeWithOhhWells() {
|
|
16120
|
+
return /* @__PURE__ */ jsxs20(
|
|
16121
|
+
"a",
|
|
16122
|
+
{
|
|
16123
|
+
href: "https://ohhwells.com",
|
|
16124
|
+
target: "_blank",
|
|
16125
|
+
rel: "noopener noreferrer",
|
|
16126
|
+
"aria-label": "Made with OhhWells",
|
|
16127
|
+
"data-ohw-badge": "",
|
|
16128
|
+
style: OHW_BADGE_STYLE,
|
|
16129
|
+
children: [
|
|
16130
|
+
/* @__PURE__ */ jsx33(OhwBrandMark, {}),
|
|
16131
|
+
/* @__PURE__ */ jsx33("span", { style: OHW_BADGE_LABEL_STYLE, children: "Made with OhhWells" })
|
|
16132
|
+
]
|
|
16133
|
+
}
|
|
16134
|
+
);
|
|
16135
|
+
}
|
|
16002
16136
|
var OHW_LOADER_PREHYDRATE_SCRIPT = `(function(){try{var p=location.hostname.split(".");var fromHost=p.length>=3&&p[0]!=="www"?p[0]:"";var fromQuery=new URLSearchParams(location.search).get("subdomain")||"";if(!fromHost&&!fromQuery)return;var e=document.getElementById("ohw-loader");if(e)e.style.display="flex"}catch(e){}})();`;
|
|
16003
16137
|
function resolveSubdomain(subdomainFromQuery) {
|
|
16004
16138
|
if (subdomainFromQuery) return subdomainFromQuery;
|
|
@@ -16058,6 +16192,7 @@ function OhhwellsBridge() {
|
|
|
16058
16192
|
}
|
|
16059
16193
|
}, []);
|
|
16060
16194
|
const [fetchState, setFetchState] = useState13("idle");
|
|
16195
|
+
const [showBranding, setShowBranding] = useState13(false);
|
|
16061
16196
|
const autoSaveTimers = useRef10(/* @__PURE__ */ new Map());
|
|
16062
16197
|
const activeElRef = useRef10(null);
|
|
16063
16198
|
const pointerHeldRef = useRef10(false);
|
|
@@ -17833,6 +17968,7 @@ function OhhwellsBridge() {
|
|
|
17833
17968
|
};
|
|
17834
17969
|
const cached = contentCache.get(subdomain);
|
|
17835
17970
|
if (cached) {
|
|
17971
|
+
setShowBranding(brandingCache.get(subdomain) ?? false);
|
|
17836
17972
|
applyContent(cached).finally(() => setFetchState("done"));
|
|
17837
17973
|
return;
|
|
17838
17974
|
}
|
|
@@ -17842,7 +17978,10 @@ function OhhwellsBridge() {
|
|
|
17842
17978
|
fetch(`${apiUrl}/api/public/sites/${subdomain}/content`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
17843
17979
|
if (cancelled) return;
|
|
17844
17980
|
const content = data?.content ?? {};
|
|
17981
|
+
const branding = Boolean(data?.showBranding);
|
|
17845
17982
|
contentCache.set(subdomain, content);
|
|
17983
|
+
brandingCache.set(subdomain, branding);
|
|
17984
|
+
setShowBranding(branding);
|
|
17846
17985
|
return applyContent(content);
|
|
17847
17986
|
}).catch(() => {
|
|
17848
17987
|
}).finally(() => {
|
|
@@ -18138,6 +18277,8 @@ function OhhwellsBridge() {
|
|
|
18138
18277
|
};
|
|
18139
18278
|
const t1 = setTimeout(measure, 50);
|
|
18140
18279
|
const t2 = setTimeout(measure, 500);
|
|
18280
|
+
const ro = new ResizeObserver(schedule);
|
|
18281
|
+
ro.observe(document.body);
|
|
18141
18282
|
let lastWidth = window.innerWidth;
|
|
18142
18283
|
let resizeTimers = [];
|
|
18143
18284
|
const clearResizeTimers = () => {
|
|
@@ -18155,6 +18296,7 @@ function OhhwellsBridge() {
|
|
|
18155
18296
|
clearTimeout(t1);
|
|
18156
18297
|
clearTimeout(t2);
|
|
18157
18298
|
if (raf != null) cancelAnimationFrame(raf);
|
|
18299
|
+
ro.disconnect();
|
|
18158
18300
|
clearResizeTimers();
|
|
18159
18301
|
window.removeEventListener("resize", handleResize);
|
|
18160
18302
|
};
|
|
@@ -21027,7 +21169,7 @@ function OhhwellsBridge() {
|
|
|
21027
21169
|
postToParent2({
|
|
21028
21170
|
type: "ow:ready",
|
|
21029
21171
|
version: "1",
|
|
21030
|
-
bridgeVersion: "0.1.
|
|
21172
|
+
bridgeVersion: "0.1.84",
|
|
21031
21173
|
path: pathname,
|
|
21032
21174
|
nodes: collectEditableNodes(editContentRef.current),
|
|
21033
21175
|
sections
|
|
@@ -21490,6 +21632,7 @@ function OhhwellsBridge() {
|
|
|
21490
21632
|
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
21491
21633
|
/* @__PURE__ */ jsx33("div", { id: "ohw-loader", suppressHydrationWarning: true, style: { ...OHW_LOADER_STYLE, display: "none" }, children: /* @__PURE__ */ jsx33(OhwLoaderSpinner, {}) }),
|
|
21492
21634
|
/* @__PURE__ */ jsx33("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: OHW_LOADER_PREHYDRATE_SCRIPT } }),
|
|
21635
|
+
subdomain && !isEditMode && showBranding && /* @__PURE__ */ jsx33(MadeWithOhhWells, {}),
|
|
21493
21636
|
bridgeRoot ? createPortal2(
|
|
21494
21637
|
/* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
21495
21638
|
/* @__PURE__ */ jsx33("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|