accessify-widget 0.3.10 → 0.3.11
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/accessify.min.js +1 -1
- package/dist/accessify.min.js.map +1 -1
- package/dist/accessify.mjs +1 -1
- package/dist/{index-DxYL6cyB.js → index-CK-JGSFG.js} +36 -16
- package/dist/{index-DxYL6cyB.js.map → index-CK-JGSFG.js.map} +1 -1
- package/dist/{keyboard-nav-DFuKOs8i.js → keyboard-nav-BK_UYLtc.js} +2 -2
- package/dist/{keyboard-nav-DFuKOs8i.js.map → keyboard-nav-BK_UYLtc.js.map} +1 -1
- package/dist/{page-structure-2bsTmvsF.js → page-structure-C7f5kvRE.js} +2 -2
- package/dist/{page-structure-2bsTmvsF.js.map → page-structure-C7f5kvRE.js.map} +1 -1
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/accessify.mjs
CHANGED
|
@@ -6433,14 +6433,14 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6433
6433
|
const FEATURE_LOADERS = {
|
|
6434
6434
|
contrast: () => import("./contrast-CqsICAkU.js"),
|
|
6435
6435
|
"text-size": () => import("./text-size-C6OFhCGi.js"),
|
|
6436
|
-
"keyboard-nav": () => import("./keyboard-nav-
|
|
6436
|
+
"keyboard-nav": () => import("./keyboard-nav-BK_UYLtc.js"),
|
|
6437
6437
|
"link-highlight": () => import("./link-highlight-DBGm067Y.js"),
|
|
6438
6438
|
"reading-guide": () => import("./reading-guide-VT8NciIL.js"),
|
|
6439
6439
|
"reading-mask": () => import("./reading-mask-BABChuCz.js"),
|
|
6440
6440
|
"animation-stop": () => import("./animation-stop-C0MwseK0.js"),
|
|
6441
6441
|
"hide-images": () => import("./hide-images-B_LeCBcd.js"),
|
|
6442
6442
|
"big-cursor": () => import("./big-cursor-B2UKu9dQ.js"),
|
|
6443
|
-
"page-structure": () => import("./page-structure-
|
|
6443
|
+
"page-structure": () => import("./page-structure-C7f5kvRE.js"),
|
|
6444
6444
|
tts: () => import("./tts-CjszLRnb.js"),
|
|
6445
6445
|
"text-simplify": () => import("./text-simplify-Cvhpio7g.js"),
|
|
6446
6446
|
"alt-text": () => Promise.resolve().then(() => altText)
|
|
@@ -8164,10 +8164,25 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
|
|
|
8164
8164
|
}
|
|
8165
8165
|
const BADGE_ATTR = "data-accessify-badge";
|
|
8166
8166
|
function addInfoBadge(target, altText2) {
|
|
8167
|
-
target.tagName === "IMG";
|
|
8168
|
-
const rect = target.getBoundingClientRect();
|
|
8169
|
-
if (rect.width < 40 || rect.height < 40) return;
|
|
8170
8167
|
if (target.getAttribute(BADGE_ATTR)) return;
|
|
8168
|
+
const rect = target.getBoundingClientRect();
|
|
8169
|
+
if (rect.width < 40 || rect.height < 40) {
|
|
8170
|
+
if (target.tagName === "IMG") {
|
|
8171
|
+
const obs = new IntersectionObserver((entries) => {
|
|
8172
|
+
for (const entry of entries) {
|
|
8173
|
+
if (entry.isIntersecting && entry.boundingClientRect.width >= 40) {
|
|
8174
|
+
obs.disconnect();
|
|
8175
|
+
if (enabled && !target.getAttribute(BADGE_ATTR)) {
|
|
8176
|
+
addInfoBadge(target, altText2);
|
|
8177
|
+
}
|
|
8178
|
+
}
|
|
8179
|
+
}
|
|
8180
|
+
});
|
|
8181
|
+
obs.observe(target);
|
|
8182
|
+
setTimeout(() => obs.disconnect(), 3e4);
|
|
8183
|
+
}
|
|
8184
|
+
return;
|
|
8185
|
+
}
|
|
8171
8186
|
target.setAttribute(BADGE_ATTR, "1");
|
|
8172
8187
|
const container = document.createElement("div");
|
|
8173
8188
|
Object.assign(container.style, {
|
|
@@ -8418,9 +8433,12 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
|
|
|
8418
8433
|
generateSingle(img);
|
|
8419
8434
|
} else {
|
|
8420
8435
|
const alt = img.getAttribute("alt");
|
|
8421
|
-
if (alt && alt.trim()
|
|
8422
|
-
img.
|
|
8423
|
-
|
|
8436
|
+
if (alt && alt.trim()) {
|
|
8437
|
+
if (!img.getAttribute("title")) {
|
|
8438
|
+
img.setAttribute("title", alt);
|
|
8439
|
+
img.setAttribute("data-accessify-title", "auto");
|
|
8440
|
+
}
|
|
8441
|
+
addInfoBadge(img, alt.trim());
|
|
8424
8442
|
}
|
|
8425
8443
|
}
|
|
8426
8444
|
}
|
|
@@ -8450,13 +8468,15 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
|
|
|
8450
8468
|
document.querySelectorAll("img").forEach((img) => {
|
|
8451
8469
|
if (!img.complete) tryRegisterImage(img);
|
|
8452
8470
|
});
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8471
|
+
for (const delay of [2e3, 5e3, 1e4]) {
|
|
8472
|
+
setTimeout(() => {
|
|
8473
|
+
if (enabled) {
|
|
8474
|
+
document.querySelectorAll("img").forEach(tryRegisterImage);
|
|
8475
|
+
applyTitlesToAllImages();
|
|
8476
|
+
addBadgesToAllImages();
|
|
8477
|
+
}
|
|
8478
|
+
}, delay);
|
|
8479
|
+
}
|
|
8460
8480
|
domObserver = new MutationObserver((mutations) => {
|
|
8461
8481
|
for (const m of mutations) {
|
|
8462
8482
|
for (const node of m.addedNodes) {
|
|
@@ -8688,4 +8708,4 @@ export {
|
|
|
8688
8708
|
init as i,
|
|
8689
8709
|
t
|
|
8690
8710
|
};
|
|
8691
|
-
//# sourceMappingURL=index-
|
|
8711
|
+
//# sourceMappingURL=index-CK-JGSFG.js.map
|