@ohhwells/bridge 0.1.70-next.210 → 0.1.70-next.211
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 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11126,7 +11126,7 @@ function insertSocialItem(row, after, content = {}, { placeholder = true } = {})
|
|
|
11126
11126
|
markSocialsRows(row.ownerDocument);
|
|
11127
11127
|
if (placeholder) {
|
|
11128
11128
|
const label = socialLabelElement(item);
|
|
11129
|
-
if (label
|
|
11129
|
+
if (label) label.textContent = PLACEHOLDER_SOCIAL_LABEL;
|
|
11130
11130
|
}
|
|
11131
11131
|
applySocialsDisplayToRow(row, socialsDisplayFor(row, content));
|
|
11132
11132
|
return { item, hrefKey, iconKey, order: getSocialsOrderFromDom(row.ownerDocument) };
|
|
@@ -14793,6 +14793,10 @@ function getNavigationItemAnchor(el) {
|
|
|
14793
14793
|
function isNavigationItem2(el) {
|
|
14794
14794
|
return getNavigationItemAnchor(el) !== null;
|
|
14795
14795
|
}
|
|
14796
|
+
function socialWordsClicked(target, item) {
|
|
14797
|
+
const text = target.closest('[data-ohw-editable="text"], [data-ohw-editable="plain"]');
|
|
14798
|
+
return Boolean(text && item.contains(text));
|
|
14799
|
+
}
|
|
14796
14800
|
function requestSocialDialog(anchor, post, content) {
|
|
14797
14801
|
const item = getSocialItem(anchor);
|
|
14798
14802
|
if (!item) return false;
|
|
@@ -17228,7 +17232,7 @@ function OhhwellsBridge() {
|
|
|
17228
17232
|
const activate = (0, import_react17.useCallback)((el, options) => {
|
|
17229
17233
|
if (activeElRef.current === el) return;
|
|
17230
17234
|
if (isIconEditable(el)) return;
|
|
17231
|
-
if (el.hasAttribute("data-ohw-social-label")) return;
|
|
17235
|
+
if (el.hasAttribute("data-ohw-social-label") && el.offsetParent === null) return;
|
|
17232
17236
|
clearSelectedAttr();
|
|
17233
17237
|
selectedElRef.current = null;
|
|
17234
17238
|
selectedHrefKeyRef.current = null;
|
|
@@ -18095,7 +18099,9 @@ function OhhwellsBridge() {
|
|
|
18095
18099
|
e.stopPropagation();
|
|
18096
18100
|
if (selectedElRef.current === navAnchor) {
|
|
18097
18101
|
if (e.detail >= 2) return;
|
|
18098
|
-
if (requestSocialDialog(navAnchor, postToParentRef.current, editContentRef.current))
|
|
18102
|
+
if (!socialWordsClicked(target, navAnchor) && requestSocialDialog(navAnchor, postToParentRef.current, editContentRef.current)) {
|
|
18103
|
+
return;
|
|
18104
|
+
}
|
|
18099
18105
|
const activateTarget = isButtonLikeElement(hrefLookupTarget) ? navAnchor.querySelector('[data-ohw-editable="text"]') ?? hrefLookupTarget : hrefLookupTarget;
|
|
18100
18106
|
activateRef.current(activateTarget, { caretX: e.clientX, caretY: e.clientY });
|
|
18101
18107
|
return;
|
|
@@ -18113,7 +18119,9 @@ function OhhwellsBridge() {
|
|
|
18113
18119
|
e.preventDefault();
|
|
18114
18120
|
e.stopPropagation();
|
|
18115
18121
|
if (selectedElRef.current === hrefAnchor) {
|
|
18116
|
-
if (requestSocialDialog(hrefAnchor, postToParentRef.current, editContentRef.current))
|
|
18122
|
+
if (!socialWordsClicked(target, hrefAnchor) && requestSocialDialog(hrefAnchor, postToParentRef.current, editContentRef.current)) {
|
|
18123
|
+
return;
|
|
18124
|
+
}
|
|
18117
18125
|
const textEditable = hrefAnchor.querySelector('[data-ohw-editable="text"]') ?? hrefAnchor.querySelector("[data-ohw-editable]");
|
|
18118
18126
|
if (textEditable) {
|
|
18119
18127
|
activateRef.current(textEditable, {
|
|
@@ -18212,7 +18220,8 @@ function OhhwellsBridge() {
|
|
|
18212
18220
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
18213
18221
|
return;
|
|
18214
18222
|
}
|
|
18215
|
-
|
|
18223
|
+
const socialWords = getSocialItem(target) ? target.closest('[data-ohw-editable="text"], [data-ohw-editable="plain"]') : null;
|
|
18224
|
+
if (getSocialItem(target) && (!socialWords || socialWords.offsetParent === null)) return;
|
|
18216
18225
|
const navLabel = getNavigationLabelEditable(target);
|
|
18217
18226
|
const editable = navLabel?.editable ?? target.closest('[data-ohw-editable="text"], [data-ohw-editable="plain"]');
|
|
18218
18227
|
if (!editable || isMediaEditable(editable) || editable.dataset.ohwEditable === "link") return;
|