@ohhwells/bridge 0.1.163-next.436 → 0.1.164-next.438
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 +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2644,6 +2644,14 @@ function socialHrefKey(item) {
|
|
|
2644
2644
|
function socialIconKey(item) {
|
|
2645
2645
|
return item.querySelector(ICON_SELECTOR)?.dataset.ohwKey ?? null;
|
|
2646
2646
|
}
|
|
2647
|
+
function pendingIconKey(item) {
|
|
2648
|
+
const existing = socialIconKey(item);
|
|
2649
|
+
if (existing) return existing;
|
|
2650
|
+
const base = socialHrefKey(item)?.replace(/-href$/, "");
|
|
2651
|
+
if (!base) return null;
|
|
2652
|
+
const taken = item.ownerDocument.querySelector(`[data-ohw-key="${base}"]`);
|
|
2653
|
+
return taken && taken !== item ? `${base}-icon` : base;
|
|
2654
|
+
}
|
|
2647
2655
|
var SOCIAL_PLATFORM_LABELS = {
|
|
2648
2656
|
instagram: "Instagram",
|
|
2649
2657
|
facebook: "Facebook",
|
|
@@ -2841,9 +2849,9 @@ function reconcileSocialsFromContent(content, root = document) {
|
|
|
2841
2849
|
listSocialsRows(root).forEach((row) => {
|
|
2842
2850
|
const rowDisplay = socialsDisplayFor(row, content);
|
|
2843
2851
|
listSocialItems(row).forEach((item) => {
|
|
2844
|
-
const key =
|
|
2852
|
+
const key = pendingIconKey(item);
|
|
2845
2853
|
const stored2 = key ? content[key] : void 0;
|
|
2846
|
-
if (!stored2?.trim()) return;
|
|
2854
|
+
if (!stored2?.trim().startsWith("<")) return;
|
|
2847
2855
|
const existing = item.querySelector(ICON_SELECTOR);
|
|
2848
2856
|
if (existing && existing.innerHTML.trim() && !existing.hasAttribute(SOCIALS_ICON_PLACEHOLDER_ATTR)) return;
|
|
2849
2857
|
ensureIconSlot(item);
|
|
@@ -3103,8 +3111,7 @@ function ensureIconSlot(item) {
|
|
|
3103
3111
|
const adopted = adoptAsIconSlot(drawn, base);
|
|
3104
3112
|
if (adopted) return adopted;
|
|
3105
3113
|
}
|
|
3106
|
-
const
|
|
3107
|
-
const iconKey = taken && taken !== item ? `${base}-icon` : base;
|
|
3114
|
+
const iconKey = pendingIconKey(item) ?? base;
|
|
3108
3115
|
const slot = document.createElement("span");
|
|
3109
3116
|
slot.setAttribute("data-ohw-key", iconKey);
|
|
3110
3117
|
slot.setAttribute("data-ohw-editable", "icon");
|
|
@@ -17661,7 +17668,7 @@ function apiBase() {
|
|
|
17661
17668
|
function bridgeVersion() {
|
|
17662
17669
|
try {
|
|
17663
17670
|
if (true) {
|
|
17664
|
-
return "0.1.
|
|
17671
|
+
return "0.1.164-next.438";
|
|
17665
17672
|
}
|
|
17666
17673
|
} catch {
|
|
17667
17674
|
}
|
|
@@ -17675,7 +17682,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17675
17682
|
return;
|
|
17676
17683
|
}
|
|
17677
17684
|
try {
|
|
17678
|
-
const v = true ? "0.1.
|
|
17685
|
+
const v = true ? "0.1.164-next.438" : "";
|
|
17679
17686
|
if (v) {
|
|
17680
17687
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17681
17688
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -32849,7 +32856,7 @@ function OhhwellsBridge() {
|
|
|
32849
32856
|
postToParent2({
|
|
32850
32857
|
type: "ow:ready",
|
|
32851
32858
|
version: "1",
|
|
32852
|
-
bridgeVersion: "0.1.
|
|
32859
|
+
bridgeVersion: "0.1.164-next.438",
|
|
32853
32860
|
path: pathname,
|
|
32854
32861
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32855
32862
|
sections
|