@ohhwells/bridge 0.1.96 → 0.1.98
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 +348 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +348 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -491,6 +491,10 @@ function styleSheetCss() {
|
|
|
491
491
|
`[data-ohw-style-spacing="${spacing}"] { padding-top: ${px}px !important; padding-bottom: ${px}px !important; }`
|
|
492
492
|
);
|
|
493
493
|
}
|
|
494
|
+
rules.push(
|
|
495
|
+
`[data-ohw-style-corners="sharp"] :is(.card, [data-ohw-card], img, picture, figure, [data-ohw-editable="bg-image"]) { border-radius: 0 !important; }`,
|
|
496
|
+
`[data-ohw-style-corners="sharp"] :has(> img) { border-radius: 0 !important; }`
|
|
497
|
+
);
|
|
494
498
|
for (const align of ["left", "center", "right"]) {
|
|
495
499
|
rules.push(`[data-ohw-style-align="${align}"] { text-align: ${align} !important; }`);
|
|
496
500
|
}
|
|
@@ -521,6 +525,7 @@ var SECTION_ATTRS = {
|
|
|
521
525
|
headlineScale: "data-ohw-style-headline",
|
|
522
526
|
imageAspect: "data-ohw-style-aspect",
|
|
523
527
|
spacing: "data-ohw-style-spacing",
|
|
528
|
+
cornerStyle: "data-ohw-style-corners",
|
|
524
529
|
align: "data-ohw-style-align"
|
|
525
530
|
};
|
|
526
531
|
var NODE_WROTE_ATTR = "data-ohw-style-node";
|
|
@@ -594,9 +599,9 @@ function applyStylesToDom(store) {
|
|
|
594
599
|
);
|
|
595
600
|
if (!store) return;
|
|
596
601
|
for (const [sectionId, override] of Object.entries(store.sections)) {
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
);
|
|
602
|
+
const escaped = CSS.escape(sectionId);
|
|
603
|
+
const byInstance = document.querySelectorAll(`[data-ohw-instance="${escaped}"]`);
|
|
604
|
+
const sections = byInstance.length ? byInstance : document.querySelectorAll(`[data-ohw-section="${escaped}"]`);
|
|
600
605
|
for (const marker of Array.from(sections)) {
|
|
601
606
|
const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
|
|
602
607
|
for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
|
|
@@ -674,8 +679,9 @@ function parseSectionsFromRoot(root) {
|
|
|
674
679
|
const seen = /* @__PURE__ */ new Set();
|
|
675
680
|
const sections = [];
|
|
676
681
|
for (const el of root.querySelectorAll("[data-ohw-section]")) {
|
|
677
|
-
const id = el.getAttribute("data-ohw-section")
|
|
678
|
-
|
|
682
|
+
const id = el.getAttribute("data-ohw-instance") || el.getAttribute("data-ohw-section") || "";
|
|
683
|
+
const type = el.getAttribute("data-ohw-section") ?? "";
|
|
684
|
+
if (!id || seen.has(id) || LINK_PICKER_EXCLUDED_IDS.has(type)) continue;
|
|
679
685
|
if (el.parentElement?.closest("[data-ohw-section]")) continue;
|
|
680
686
|
if (el.hasAttribute("data-ohw-ai-template-hidden") || el.hasAttribute("data-ohw-ai-removed") || el.hasAttribute("data-ohw-ai-replaced-by"))
|
|
681
687
|
continue;
|
|
@@ -913,6 +919,284 @@ function initSectionInstancesFromContent(content, currentPath) {
|
|
|
913
919
|
// src/ui/ai-tree/AiTreeRenderer.tsx
|
|
914
920
|
var import_react = __toESM(require("react"), 1);
|
|
915
921
|
var import_lucide_react = require("lucide-react");
|
|
922
|
+
|
|
923
|
+
// src/lib/placeholder-imagery.ts
|
|
924
|
+
var U = (id) => `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=1600&q=80`;
|
|
925
|
+
var GENERIC = [
|
|
926
|
+
U("1441986300917-64674bd600d8"),
|
|
927
|
+
U("1486406146926-c627a92ad1ab"),
|
|
928
|
+
U("1497032628192-86f99bcd76bc"),
|
|
929
|
+
U("1521737604893-d14cc237f11d"),
|
|
930
|
+
U("1522071820081-009f0129c71c"),
|
|
931
|
+
U("1519389950473-47ba0277781c"),
|
|
932
|
+
U("1460925895917-afdab827c52f"),
|
|
933
|
+
U("1504384308090-c894fdcc538d")
|
|
934
|
+
];
|
|
935
|
+
var PEOPLE = [
|
|
936
|
+
U("1500648767791-00dcc994a43e"),
|
|
937
|
+
U("1494790108377-be9c29b29330"),
|
|
938
|
+
U("1507003211169-0a1dd7228f2d"),
|
|
939
|
+
U("1438761681033-6461ffad8d80"),
|
|
940
|
+
U("1544005313-94ddf0286df2"),
|
|
941
|
+
U("1472099645785-5658abf4ff4e"),
|
|
942
|
+
U("1519085360753-af0119f7cbe7"),
|
|
943
|
+
U("1534528741775-53994a69daeb")
|
|
944
|
+
];
|
|
945
|
+
var THEMED = [
|
|
946
|
+
{
|
|
947
|
+
keywords: ["portrait", "headshot", "person", "people", "team", "staff", "avatar", "founder", "face"],
|
|
948
|
+
pool: PEOPLE
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
keywords: ["pet", "dog", "cat", "puppy", "kitten", "vet", "animal"],
|
|
952
|
+
pool: [
|
|
953
|
+
U("1548199973-03cce0bbc87b"),
|
|
954
|
+
U("1450778869180-41d0601e046e"),
|
|
955
|
+
U("1583511655857-d19b40a7a54e"),
|
|
956
|
+
U("1587300003388-59208cc962cb"),
|
|
957
|
+
U("1517849845537-4d257902454a"),
|
|
958
|
+
U("1601758228041-f3b2795255f1")
|
|
959
|
+
]
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
keywords: [
|
|
963
|
+
"baker",
|
|
964
|
+
"bakery",
|
|
965
|
+
"cafe",
|
|
966
|
+
"coffee",
|
|
967
|
+
"latte",
|
|
968
|
+
"restaurant",
|
|
969
|
+
"pastr",
|
|
970
|
+
"bread",
|
|
971
|
+
"cake",
|
|
972
|
+
"cater",
|
|
973
|
+
"chef",
|
|
974
|
+
"kitchen",
|
|
975
|
+
"food",
|
|
976
|
+
"pizza",
|
|
977
|
+
"dessert",
|
|
978
|
+
"brunch",
|
|
979
|
+
"bistro",
|
|
980
|
+
"deli",
|
|
981
|
+
"dish",
|
|
982
|
+
"menu"
|
|
983
|
+
],
|
|
984
|
+
pool: [
|
|
985
|
+
U("1509440159596-0249088772ff"),
|
|
986
|
+
U("1555507036-ab1f4038808a"),
|
|
987
|
+
U("1517433670267-08bbd4be890f"),
|
|
988
|
+
U("1486427944299-d1955d23e34d"),
|
|
989
|
+
U("1504754524776-8f4f37790ca0"),
|
|
990
|
+
U("1495474472287-4d71bcdd2085"),
|
|
991
|
+
U("1521017432531-fbd92d768814"),
|
|
992
|
+
U("1556909114-f6e7ad7d3136")
|
|
993
|
+
]
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
keywords: [
|
|
997
|
+
"shop",
|
|
998
|
+
"store",
|
|
999
|
+
"boutique",
|
|
1000
|
+
"retail",
|
|
1001
|
+
"clothing",
|
|
1002
|
+
"fashion",
|
|
1003
|
+
"jewel",
|
|
1004
|
+
"gift",
|
|
1005
|
+
"florist",
|
|
1006
|
+
"market",
|
|
1007
|
+
"grocer",
|
|
1008
|
+
"product",
|
|
1009
|
+
"storefront"
|
|
1010
|
+
],
|
|
1011
|
+
pool: [
|
|
1012
|
+
U("1441984904996-e0b6ba687e04"),
|
|
1013
|
+
U("1472851294608-062f824d29cc"),
|
|
1014
|
+
U("1523381210434-271e8be1f52b"),
|
|
1015
|
+
U("1534452203293-494d7ddbf7e0"),
|
|
1016
|
+
U("1445205170230-053b83016050"),
|
|
1017
|
+
U("1560243563-062bfc001d68")
|
|
1018
|
+
]
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
keywords: [
|
|
1022
|
+
"yoga",
|
|
1023
|
+
"pilates",
|
|
1024
|
+
"fitness",
|
|
1025
|
+
"gym",
|
|
1026
|
+
"workout",
|
|
1027
|
+
"trainer",
|
|
1028
|
+
"wellness",
|
|
1029
|
+
"meditat",
|
|
1030
|
+
"massage",
|
|
1031
|
+
"therap",
|
|
1032
|
+
"physio",
|
|
1033
|
+
"chiro",
|
|
1034
|
+
"nutrition",
|
|
1035
|
+
"spa",
|
|
1036
|
+
"studio"
|
|
1037
|
+
],
|
|
1038
|
+
pool: [
|
|
1039
|
+
U("1544367567-0f2fcb009e0b"),
|
|
1040
|
+
U("1506126613408-eca07ce68773"),
|
|
1041
|
+
U("1545205597-3d9d02c29597"),
|
|
1042
|
+
U("1552196563-55cd4e45efb3"),
|
|
1043
|
+
U("1518611012118-696072aa579a"),
|
|
1044
|
+
U("1571019613454-1cb2f99b2d8b"),
|
|
1045
|
+
U("1540555700478-4be289fbecef"),
|
|
1046
|
+
U("1519824145371-296894a0daa9")
|
|
1047
|
+
]
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
keywords: [
|
|
1051
|
+
"salon",
|
|
1052
|
+
"hairdress",
|
|
1053
|
+
"haircut",
|
|
1054
|
+
"barber",
|
|
1055
|
+
"manicure",
|
|
1056
|
+
"pedicure",
|
|
1057
|
+
"nails",
|
|
1058
|
+
"beauty",
|
|
1059
|
+
"makeup",
|
|
1060
|
+
"cosmetic",
|
|
1061
|
+
"eyelash",
|
|
1062
|
+
"eyebrow",
|
|
1063
|
+
"skincare",
|
|
1064
|
+
"esthetic",
|
|
1065
|
+
"waxing",
|
|
1066
|
+
"hair"
|
|
1067
|
+
],
|
|
1068
|
+
pool: [
|
|
1069
|
+
U("1560066984-138dadb4c035"),
|
|
1070
|
+
U("1522337660859-02fbefca4702"),
|
|
1071
|
+
U("1562322140-8baeececf3df"),
|
|
1072
|
+
U("1521590832167-7bcbfaa6381f"),
|
|
1073
|
+
U("1487412947147-5cebf100ffc2"),
|
|
1074
|
+
U("1526045478516-99145907023c")
|
|
1075
|
+
]
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
keywords: [
|
|
1079
|
+
"cleaning",
|
|
1080
|
+
"plumb",
|
|
1081
|
+
"electric",
|
|
1082
|
+
"landscap",
|
|
1083
|
+
"contractor",
|
|
1084
|
+
"handyman",
|
|
1085
|
+
"renov",
|
|
1086
|
+
"hvac",
|
|
1087
|
+
"roofing",
|
|
1088
|
+
"painting",
|
|
1089
|
+
"carpentry",
|
|
1090
|
+
"flooring",
|
|
1091
|
+
"movers",
|
|
1092
|
+
"construction",
|
|
1093
|
+
"tools"
|
|
1094
|
+
],
|
|
1095
|
+
pool: [
|
|
1096
|
+
U("1581578731548-c64695cc6952"),
|
|
1097
|
+
U("1504307651254-35680f356dfd"),
|
|
1098
|
+
U("1581092160562-40aa08e78837"),
|
|
1099
|
+
U("1621905251189-08b45d6a269e"),
|
|
1100
|
+
U("1558618666-fcd25c85cd64"),
|
|
1101
|
+
U("1585128792020-803d29415281")
|
|
1102
|
+
]
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
keywords: [
|
|
1106
|
+
"legal",
|
|
1107
|
+
"attorney",
|
|
1108
|
+
"lawyer",
|
|
1109
|
+
"account",
|
|
1110
|
+
"bookkeep",
|
|
1111
|
+
"consult",
|
|
1112
|
+
"coaching",
|
|
1113
|
+
"financ",
|
|
1114
|
+
"insurance",
|
|
1115
|
+
"realtor",
|
|
1116
|
+
"estate",
|
|
1117
|
+
"marketing",
|
|
1118
|
+
"agency",
|
|
1119
|
+
"office",
|
|
1120
|
+
"business",
|
|
1121
|
+
"desk"
|
|
1122
|
+
],
|
|
1123
|
+
pool: [
|
|
1124
|
+
U("1497366216548-37526070297c"),
|
|
1125
|
+
U("1497366811353-6870744d04b2"),
|
|
1126
|
+
U("1454165804606-c3d57bc86b40"),
|
|
1127
|
+
U("1521791136064-7986c2920216"),
|
|
1128
|
+
U("1556761175-b413da4baf72"),
|
|
1129
|
+
U("1542744173-8e7e53415bb0")
|
|
1130
|
+
]
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
keywords: [
|
|
1134
|
+
"wedding",
|
|
1135
|
+
"event",
|
|
1136
|
+
"party",
|
|
1137
|
+
"celebrat",
|
|
1138
|
+
"venue",
|
|
1139
|
+
"community",
|
|
1140
|
+
"nonprofit",
|
|
1141
|
+
"charity",
|
|
1142
|
+
"workshop",
|
|
1143
|
+
"photograph",
|
|
1144
|
+
"concert"
|
|
1145
|
+
],
|
|
1146
|
+
pool: [
|
|
1147
|
+
U("1511578314322-379afb476865"),
|
|
1148
|
+
U("1501281668745-f7f57925c3b4"),
|
|
1149
|
+
U("1523580494863-6f3031224c94"),
|
|
1150
|
+
U("1540575467063-178a50c2df87"),
|
|
1151
|
+
U("1505236858219-8359eb29e329"),
|
|
1152
|
+
U("1528605248644-14dd04022da1")
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
];
|
|
1156
|
+
function poolForSubject(subject) {
|
|
1157
|
+
for (const theme of THEMED) {
|
|
1158
|
+
if (theme.keywords.some((k) => subject.includes(k))) {
|
|
1159
|
+
return theme.pool;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
return GENERIC;
|
|
1163
|
+
}
|
|
1164
|
+
function mixedHash(text) {
|
|
1165
|
+
let hash = 2166136261;
|
|
1166
|
+
for (let i = 0; i < text.length; i++) {
|
|
1167
|
+
hash ^= text.charCodeAt(i);
|
|
1168
|
+
hash = Math.imul(hash, 16777619);
|
|
1169
|
+
}
|
|
1170
|
+
return hash >>> 16 & 65535;
|
|
1171
|
+
}
|
|
1172
|
+
function resolvePlaceholderRef(ref) {
|
|
1173
|
+
const match = /^placeholder:([a-z0-9-]+)$/.exec(ref);
|
|
1174
|
+
if (!match) return null;
|
|
1175
|
+
const subject = match[1];
|
|
1176
|
+
const pool = poolForSubject(subject.replace(/-\d+$/, ""));
|
|
1177
|
+
return pool[mixedHash(ref) % pool.length];
|
|
1178
|
+
}
|
|
1179
|
+
function collectPlaceholderRefs(tree) {
|
|
1180
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1181
|
+
for (const match of JSON.stringify(tree ?? null).matchAll(/"(placeholder:[a-z0-9-]+)"/gu)) {
|
|
1182
|
+
seen.add(match[1]);
|
|
1183
|
+
}
|
|
1184
|
+
return [...seen];
|
|
1185
|
+
}
|
|
1186
|
+
function buildPlaceholderMap(tree) {
|
|
1187
|
+
const map = {};
|
|
1188
|
+
const cursor = /* @__PURE__ */ new Map();
|
|
1189
|
+
for (const ref of collectPlaceholderRefs(tree)) {
|
|
1190
|
+
const subject = ref.slice("placeholder:".length).replace(/-\d+$/, "");
|
|
1191
|
+
const pool = poolForSubject(subject);
|
|
1192
|
+
const start = cursor.get(pool) ?? mixedHash(ref) % pool.length;
|
|
1193
|
+
map[ref] = pool[start % pool.length];
|
|
1194
|
+
cursor.set(pool, start + 1);
|
|
1195
|
+
}
|
|
1196
|
+
return map;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
// src/ui/ai-tree/AiTreeRenderer.tsx
|
|
916
1200
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
917
1201
|
function lucideByName(name) {
|
|
918
1202
|
const pascal = name.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
@@ -926,6 +1210,7 @@ var typeStyle = (spec, font) => ({
|
|
|
926
1210
|
fontWeight: spec.weight
|
|
927
1211
|
});
|
|
928
1212
|
var str = (value) => typeof value === "string" ? value : "";
|
|
1213
|
+
var cardRadius = (slots) => slots.cornerStyle === "sharp" ? 0 : AI_TREE_TOKENS.radiusCard;
|
|
929
1214
|
var featureLines = (value) => value.split(/\n|<br\s*\/?>/i).map((line) => line.trim()).filter(Boolean);
|
|
930
1215
|
var CHECK_MASK = `data:image/svg+xml,${encodeURIComponent(
|
|
931
1216
|
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>'
|
|
@@ -1271,10 +1556,11 @@ function PricingCard({ node, ctx, path }) {
|
|
|
1271
1556
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1272
1557
|
"div",
|
|
1273
1558
|
{
|
|
1559
|
+
"data-ohw-card": "",
|
|
1274
1560
|
style: {
|
|
1275
1561
|
background: hasBg ? ctx.brand.palette.light : "transparent",
|
|
1276
1562
|
border: `1px solid ${dark}`,
|
|
1277
|
-
borderRadius:
|
|
1563
|
+
borderRadius: cardRadius(slots),
|
|
1278
1564
|
padding: AI_TREE_TOKENS.paddingBlock,
|
|
1279
1565
|
display: "flex",
|
|
1280
1566
|
flexDirection: "column",
|
|
@@ -1379,10 +1665,11 @@ function TestimonialCard({ node, ctx, path }) {
|
|
|
1379
1665
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1380
1666
|
"div",
|
|
1381
1667
|
{
|
|
1668
|
+
"data-ohw-card": "",
|
|
1382
1669
|
"data-ai-avatar-pos": avatarPos ?? void 0,
|
|
1383
1670
|
style: {
|
|
1384
1671
|
background: hasBg ? ctx.cardSurface : "transparent",
|
|
1385
|
-
borderRadius: hasBg ?
|
|
1672
|
+
borderRadius: hasBg ? cardRadius(slots) : 0,
|
|
1386
1673
|
overflow: "hidden",
|
|
1387
1674
|
outline: slots.featured === true ? `2px solid ${ctx.brand.palette.primary}` : void 0,
|
|
1388
1675
|
minWidth: 0
|
|
@@ -1417,10 +1704,11 @@ function TeamCard({ node, ctx, path }) {
|
|
|
1417
1704
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1418
1705
|
"div",
|
|
1419
1706
|
{
|
|
1707
|
+
"data-ohw-card": "",
|
|
1420
1708
|
"data-ai-avatar-pos": avatarPos ?? void 0,
|
|
1421
1709
|
style: {
|
|
1422
1710
|
background: hasBg ? ctx.cardSurface : "transparent",
|
|
1423
|
-
borderRadius: hasBg ?
|
|
1711
|
+
borderRadius: hasBg ? cardRadius(slots) : 0,
|
|
1424
1712
|
overflow: "hidden",
|
|
1425
1713
|
outline: slots.featured === true ? `2px solid ${ctx.brand.palette.primary}` : void 0,
|
|
1426
1714
|
minWidth: 0,
|
|
@@ -1591,9 +1879,10 @@ function CardBlock({ node, ctx, path }) {
|
|
|
1591
1879
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1592
1880
|
"div",
|
|
1593
1881
|
{
|
|
1882
|
+
"data-ohw-card": "",
|
|
1594
1883
|
style: {
|
|
1595
1884
|
background: hasBg ? ctx.cardSurface : "transparent",
|
|
1596
|
-
borderRadius: hasBg ?
|
|
1885
|
+
borderRadius: hasBg ? cardRadius(slots) : 0,
|
|
1597
1886
|
overflow: "hidden",
|
|
1598
1887
|
outline: slots.featured === true ? `2px solid ${ctx.brand.palette.primary}` : void 0,
|
|
1599
1888
|
display: horizontal ? "flex" : "block",
|
|
@@ -1621,7 +1910,7 @@ function CardBlock({ node, ctx, path }) {
|
|
|
1621
1910
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1622
1911
|
"div",
|
|
1623
1912
|
{
|
|
1624
|
-
style: /^(lucide|simple):/.test(mediaRef) ? { padding: `${AI_TREE_TOKENS.paddingBlock}px ${AI_TREE_TOKENS.paddingBlock}px 0` } : hasBg ? void 0 : { borderRadius:
|
|
1913
|
+
style: /^(lucide|simple):/.test(mediaRef) ? { padding: `${AI_TREE_TOKENS.paddingBlock}px ${AI_TREE_TOKENS.paddingBlock}px 0` } : hasBg ? void 0 : { borderRadius: cardRadius(slots), overflow: "hidden" },
|
|
1625
1914
|
children: media
|
|
1626
1915
|
}
|
|
1627
1916
|
)),
|
|
@@ -2032,6 +2321,32 @@ function renderNode(node, ctx, path) {
|
|
|
2032
2321
|
if (child) {
|
|
2033
2322
|
return renderNode(child, ctx, `${path}.c0`);
|
|
2034
2323
|
}
|
|
2324
|
+
if (str(slots.provider) === "map" && str(slots.query)) {
|
|
2325
|
+
const query = str(slots.query);
|
|
2326
|
+
const mapAttrs = ctx.keyFor ? {
|
|
2327
|
+
"data-ohw-key": ctx.keyFor(`${path}.query`),
|
|
2328
|
+
"data-ohw-editable": "map",
|
|
2329
|
+
"data-ohw-map-query": query
|
|
2330
|
+
} : {};
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2332
|
+
"iframe",
|
|
2333
|
+
{
|
|
2334
|
+
...mapAttrs,
|
|
2335
|
+
"data-ai-embed": "map",
|
|
2336
|
+
title: str(slots.title) || "Map",
|
|
2337
|
+
src: `https://www.google.com/maps?q=${encodeURIComponent(query)}&output=embed`,
|
|
2338
|
+
loading: "lazy",
|
|
2339
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
2340
|
+
style: {
|
|
2341
|
+
width: "100%",
|
|
2342
|
+
minHeight: 320,
|
|
2343
|
+
border: 0,
|
|
2344
|
+
borderRadius: AI_TREE_TOKENS.radiusCard,
|
|
2345
|
+
display: "block"
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2035
2350
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2036
2351
|
"div",
|
|
2037
2352
|
{
|
|
@@ -2185,9 +2500,14 @@ function AiTreeRenderer({
|
|
|
2185
2500
|
const resolvedBrand = brand ?? AI_DEFAULT_BRAND;
|
|
2186
2501
|
const band = (tree.settings ?? {}).sectionBackground === "accent" ? accentBandContext(resolvedBrand) : null;
|
|
2187
2502
|
const blockBrand = band?.brand ?? resolvedBrand;
|
|
2503
|
+
const placeholderMap = buildPlaceholderMap(tree);
|
|
2188
2504
|
const ctx = {
|
|
2189
2505
|
brand: blockBrand,
|
|
2190
|
-
|
|
2506
|
+
// An owner/library ref resolves through the host resolver; a `placeholder:<subject>` ref the
|
|
2507
|
+
// host cannot resolve falls back to real stock photography (the per-section map first, then a
|
|
2508
|
+
// standalone resolve), so generated galleries, image rows, and overlay backgrounds arrive with
|
|
2509
|
+
// photos instead of grey boxes.
|
|
2510
|
+
resolveMedia: (ref) => resolveMedia?.(ref) ?? placeholderMap[ref] ?? resolvePlaceholderRef(ref),
|
|
2191
2511
|
cardSurface: blockBrand.palette.light.toUpperCase() === AI_DEFAULT_BRAND.palette.light.toUpperCase() ? "#ECECEB" : `color-mix(in srgb, ${blockBrand.palette.light} 90%, ${blockBrand.palette.dark})`,
|
|
2192
2512
|
keyFor: editKeyPrefix ? (path) => `${editKeyPrefix}.${path}` : null,
|
|
2193
2513
|
sectionAlignment: (tree.settings ?? {}).alignment === "center" ? "center" : "left",
|
|
@@ -14665,6 +14985,9 @@ function collectEditableNodes(extraContent, root = document) {
|
|
|
14665
14985
|
if (el.dataset.ohwEditable === "link") {
|
|
14666
14986
|
return { key: el.dataset.ohwKey ?? "", type: "link", text: getLinkHref3(el) };
|
|
14667
14987
|
}
|
|
14988
|
+
if (el.dataset.ohwEditable === "map") {
|
|
14989
|
+
return { key: el.dataset.ohwKey ?? "", type: "map", text: el.dataset.ohwMapQuery ?? "" };
|
|
14990
|
+
}
|
|
14668
14991
|
return {
|
|
14669
14992
|
key: el.dataset.ohwKey ?? "",
|
|
14670
14993
|
type: el.dataset.ohwEditable ?? "text",
|
|
@@ -15448,7 +15771,7 @@ var EDITOR_CHROME_SELECTOR = '[data-ohw-toolbar], [data-ohw-form-toolbar], [data
|
|
|
15448
15771
|
function isOverEditorChrome(x, y) {
|
|
15449
15772
|
return document.elementsFromPoint(x, y).some((el) => el instanceof HTMLElement && el.matches(EDITOR_CHROME_SELECTOR));
|
|
15450
15773
|
}
|
|
15451
|
-
var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"]):not([data-ohw-editable="icon"]):not([data-ohw-editable="form"])';
|
|
15774
|
+
var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"]):not([data-ohw-editable="icon"]):not([data-ohw-editable="form"]):not([data-ohw-editable="map"])';
|
|
15452
15775
|
function getVideoEl2(el) {
|
|
15453
15776
|
return el instanceof HTMLVideoElement ? el : el.querySelector("video");
|
|
15454
15777
|
}
|
|
@@ -15504,6 +15827,12 @@ function applyVideoSettingNode(key, val) {
|
|
|
15504
15827
|
});
|
|
15505
15828
|
return true;
|
|
15506
15829
|
}
|
|
15830
|
+
function applyMapQuery(el, val) {
|
|
15831
|
+
if (!(el instanceof HTMLIFrameElement)) return;
|
|
15832
|
+
const nextSrc = `https://www.google.com/maps?q=${encodeURIComponent(val)}&output=embed`;
|
|
15833
|
+
if (el.src !== nextSrc) el.src = nextSrc;
|
|
15834
|
+
el.setAttribute("data-ohw-map-query", val);
|
|
15835
|
+
}
|
|
15507
15836
|
function applyLinkByKey(key, val) {
|
|
15508
15837
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
15509
15838
|
if (el.dataset.ohwEditable === "link") applyLinkHref(el, val);
|
|
@@ -18304,6 +18633,8 @@ function OhhwellsBridge() {
|
|
|
18304
18633
|
}
|
|
18305
18634
|
} else if (el.dataset.ohwEditable === "link") {
|
|
18306
18635
|
applyLinkHref(el, val);
|
|
18636
|
+
} else if (el.dataset.ohwEditable === "map") {
|
|
18637
|
+
applyMapQuery(el, val);
|
|
18307
18638
|
} else if (el.dataset.ohwEditable === "icon") {
|
|
18308
18639
|
applyIconMarkup(el, val);
|
|
18309
18640
|
} else if (el.dataset.ohwEditable === "form") {
|
|
@@ -18500,6 +18831,8 @@ function OhhwellsBridge() {
|
|
|
18500
18831
|
if (video && video.src !== val) applyVideoSrc(video, val);
|
|
18501
18832
|
} else if (el.dataset.ohwEditable === "link") {
|
|
18502
18833
|
applyLinkHref(el, val);
|
|
18834
|
+
} else if (el.dataset.ohwEditable === "map") {
|
|
18835
|
+
applyMapQuery(el, val);
|
|
18503
18836
|
} else if (el.dataset.ohwEditable === "form") {
|
|
18504
18837
|
} else if (isIconMarkupValue(val)) {
|
|
18505
18838
|
} else if (el.innerHTML !== val) {
|
|
@@ -20473,6 +20806,8 @@ function OhhwellsBridge() {
|
|
|
20473
20806
|
if (video && video.src !== val) applyVideoSrc(video, val);
|
|
20474
20807
|
} else if (el.dataset.ohwEditable === "link") {
|
|
20475
20808
|
applyLinkHref(el, val);
|
|
20809
|
+
} else if (el.dataset.ohwEditable === "map") {
|
|
20810
|
+
applyMapQuery(el, val);
|
|
20476
20811
|
} else if (el.dataset.ohwEditable === "icon") {
|
|
20477
20812
|
applyIconMarkup(el, val);
|
|
20478
20813
|
} else if (isIconMarkupValue(val)) {
|
|
@@ -21709,7 +22044,7 @@ function OhhwellsBridge() {
|
|
|
21709
22044
|
postToParent2({
|
|
21710
22045
|
type: "ow:ready",
|
|
21711
22046
|
version: "1",
|
|
21712
|
-
bridgeVersion: "0.1.
|
|
22047
|
+
bridgeVersion: "0.1.97",
|
|
21713
22048
|
path: pathname,
|
|
21714
22049
|
nodes: collectEditableNodes(editContentRef.current),
|
|
21715
22050
|
sections
|