@ohhwells/bridge 0.1.36-next.51 → 0.1.36-next.52
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 +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7876,6 +7876,7 @@ function OhhwellsBridge() {
|
|
|
7876
7876
|
});
|
|
7877
7877
|
applyLinkByKey(key, val);
|
|
7878
7878
|
}
|
|
7879
|
+
reconcileNavbarItemsFromContent(content);
|
|
7879
7880
|
enforceLinkHrefs();
|
|
7880
7881
|
initSectionsFromContent(content, true);
|
|
7881
7882
|
sectionsLoadedRef.current = true;
|
|
@@ -7935,6 +7936,7 @@ function OhhwellsBridge() {
|
|
|
7935
7936
|
});
|
|
7936
7937
|
applyLinkByKey(key, val);
|
|
7937
7938
|
}
|
|
7939
|
+
reconcileNavbarItemsFromContent(content);
|
|
7938
7940
|
} finally {
|
|
7939
7941
|
observer?.observe(document.body, { childList: true, subtree: true });
|
|
7940
7942
|
}
|
|
@@ -7970,8 +7972,12 @@ function OhhwellsBridge() {
|
|
|
7970
7972
|
deactivateRef.current();
|
|
7971
7973
|
}, [pathname, isEditMode]);
|
|
7972
7974
|
(0, import_react8.useEffect)(() => {
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
+
const contentForNav = () => {
|
|
7976
|
+
if (isEditMode) return editContentRef.current;
|
|
7977
|
+
if (!subdomain) return {};
|
|
7978
|
+
return contentCache.get(subdomain) ?? {};
|
|
7979
|
+
};
|
|
7980
|
+
const run = () => reconcileNavbarItemsFromContent(contentForNav());
|
|
7975
7981
|
run();
|
|
7976
7982
|
const nav = document.querySelector("nav");
|
|
7977
7983
|
if (!nav) return;
|
|
@@ -7980,7 +7986,7 @@ function OhhwellsBridge() {
|
|
|
7980
7986
|
});
|
|
7981
7987
|
observer.observe(nav, { childList: true, subtree: true });
|
|
7982
7988
|
return () => observer.disconnect();
|
|
7983
|
-
}, [isEditMode, pathname]);
|
|
7989
|
+
}, [isEditMode, pathname, subdomain, fetchState]);
|
|
7984
7990
|
(0, import_react8.useEffect)(() => {
|
|
7985
7991
|
if (!isEditMode) return;
|
|
7986
7992
|
const measure = () => {
|