@ohhwells/bridge 0.1.73 → 0.1.74
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
|
@@ -13613,6 +13613,7 @@ var import_lucide_react17 = require("lucide-react");
|
|
|
13613
13613
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
13614
13614
|
var PRIMARY3 = "#0885FE";
|
|
13615
13615
|
var IMAGE_FADE_MS = 300;
|
|
13616
|
+
var MEDIA_SETTLE_TIMEOUT_MS = 2500;
|
|
13616
13617
|
function runOpacityFade(el, onDone) {
|
|
13617
13618
|
const anim = el.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
13618
13619
|
duration: IMAGE_FADE_MS,
|
|
@@ -16535,6 +16536,7 @@ function OhhwellsBridge() {
|
|
|
16535
16536
|
const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
16536
16537
|
if (img && img.src !== val) {
|
|
16537
16538
|
applyEditableImageSrc(img, val);
|
|
16539
|
+
img.loading = "eager";
|
|
16538
16540
|
imageLoads.push(new Promise((resolve) => {
|
|
16539
16541
|
img.onload = () => resolve();
|
|
16540
16542
|
img.onerror = () => resolve();
|
|
@@ -16577,8 +16579,12 @@ function OhhwellsBridge() {
|
|
|
16577
16579
|
initSectionInstancesFromContent(content, window.location.pathname);
|
|
16578
16580
|
sectionsLoadedRef.current = true;
|
|
16579
16581
|
pendingScheduleConfigRequests.current.splice(0).forEach(processConfigRequest);
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
+
if (imageLoads.length === 0) return Promise.resolve();
|
|
16583
|
+
return Promise.race([
|
|
16584
|
+
Promise.all(imageLoads).then(() => {
|
|
16585
|
+
}),
|
|
16586
|
+
new Promise((resolve) => setTimeout(resolve, MEDIA_SETTLE_TIMEOUT_MS))
|
|
16587
|
+
]);
|
|
16582
16588
|
};
|
|
16583
16589
|
const cached = contentCache.get(subdomain);
|
|
16584
16590
|
if (cached) {
|
|
@@ -19592,7 +19598,7 @@ function OhhwellsBridge() {
|
|
|
19592
19598
|
postToParent2({
|
|
19593
19599
|
type: "ow:ready",
|
|
19594
19600
|
version: "1",
|
|
19595
|
-
bridgeVersion: "0.1.
|
|
19601
|
+
bridgeVersion: "0.1.74",
|
|
19596
19602
|
path: pathname,
|
|
19597
19603
|
nodes: collectEditableNodes(editContentRef.current),
|
|
19598
19604
|
sections
|