accessify-widget 0.3.14 → 0.3.16

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.
@@ -1,4 +1,4 @@
1
- import { d, i } from "./index-1tl4oBKN.js";
1
+ import { d, i } from "./index-DISuvl6x.js";
2
2
  export {
3
3
  d as destroy,
4
4
  i as init
@@ -5986,7 +5986,7 @@ const PROFILES = [
5986
5986
  nameKey: "profile.cognitive",
5987
5987
  descKey: "profile.cognitive.desc",
5988
5988
  iconId: "brain",
5989
- features: ["reading-guide", "text-size", "spacing", "dyslexia-font", "animation-stop"],
5989
+ features: ["reading-guide", "text-size", "animation-stop", "tts"],
5990
5990
  featureSettings: { "text-size": 130 }
5991
5991
  },
5992
5992
  {
@@ -5994,8 +5994,7 @@ const PROFILES = [
5994
5994
  nameKey: "profile.seizureSafe",
5995
5995
  descKey: "profile.seizureSafe.desc",
5996
5996
  iconId: "shield",
5997
- features: ["animation-stop", "saturation"],
5998
- featureSettings: { saturation: "low" }
5997
+ features: ["animation-stop", "hide-images"]
5999
5998
  },
6000
5999
  {
6001
6000
  id: "adhd-friendly",
@@ -6005,10 +6004,9 @@ const PROFILES = [
6005
6004
  features: ["animation-stop", "reading-mask", "hide-images"]
6006
6005
  }
6007
6006
  ];
6008
- var root_3$2 = /* @__PURE__ */ from_svg(`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"></path></svg>`);
6009
- var root_2$2 = /* @__PURE__ */ from_html(`<button class="accessify-accordion-option"><span class="accessify-accordion-option-left"><span class="accessify-accordion-option-icon" aria-hidden="true"></span> <span class="accessify-accordion-option-text"><span class="accessify-accordion-option-name"> </span> <span class="accessify-accordion-option-desc"> </span></span></span> <!></button>`);
6010
- var root_1$3 = /* @__PURE__ */ from_html(`<div class="accessify-accordion-list" role="group"></div>`);
6011
- var root$3 = /* @__PURE__ */ from_html(`<div class="accessify-accordion" role="region"><button class="accessify-accordion-toggle"><span class="accessify-accordion-toggle-left"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 8v4l2 2"></path></svg> <span> </span></span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <!></div>`);
6007
+ var root_2$2 = /* @__PURE__ */ from_svg(`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"></path></svg>`);
6008
+ var root_1$3 = /* @__PURE__ */ from_html(`<button class="accessify-accordion-option"><span class="accessify-accordion-option-left"><span class="accessify-accordion-option-icon" aria-hidden="true"></span> <span class="accessify-accordion-option-text"><span class="accessify-accordion-option-name"> </span> <span class="accessify-accordion-option-desc"> </span></span></span> <!></button>`);
6009
+ var root$3 = /* @__PURE__ */ from_html(`<div class="accessify-accordion" role="region"><button class="accessify-accordion-toggle"><span class="accessify-accordion-toggle-left"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 8v4l2 2"></path></svg> <span> </span></span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <div class="accessify-accordion-list" role="group"></div></div>`);
6012
6010
  function ProfileSection($$anchor, $$props) {
6013
6011
  push($$props, true);
6014
6012
  let lang = prop($$props, "lang", 3, "en"), activeProfileId = prop($$props, "activeProfileId", 3, null);
@@ -6025,62 +6023,55 @@ function ProfileSection($$anchor, $$props) {
6025
6023
  var text = child(span_1);
6026
6024
  var svg = sibling(span, 2);
6027
6025
  let classes;
6028
- var node = sibling(button, 2);
6029
- {
6030
- var consequent_1 = ($$anchor2) => {
6031
- var div_1 = root_1$3();
6032
- each(div_1, 21, () => PROFILES, (profile) => profile.id, ($$anchor3, profile) => {
6033
- var button_1 = root_2$2();
6034
- var span_2 = child(button_1);
6035
- var span_3 = child(span_2);
6036
- html(span_3, () => getIcon(get(profile).iconId), true);
6037
- var span_4 = sibling(span_3, 2);
6038
- var span_5 = child(span_4);
6039
- var text_1 = child(span_5);
6040
- var span_6 = sibling(span_5, 2);
6041
- var text_2 = child(span_6);
6042
- var node_1 = sibling(span_2, 2);
6043
- {
6044
- var consequent = ($$anchor4) => {
6045
- var svg_1 = root_3$2();
6046
- append($$anchor4, svg_1);
6047
- };
6048
- if_block(node_1, ($$render) => {
6049
- if (activeProfileId() === get(profile).id) $$render(consequent);
6050
- });
6051
- }
6052
- template_effect(
6053
- ($0, $1) => {
6054
- set_attribute(button_1, "aria-pressed", activeProfileId() === get(profile).id);
6055
- set_attribute(button_1, "data-active", activeProfileId() === get(profile).id);
6056
- set_text(text_1, $0);
6057
- set_text(text_2, $1);
6058
- },
6059
- [
6060
- () => t(get(profile).nameKey, lang()),
6061
- () => t(get(profile).descKey, lang())
6062
- ]
6063
- );
6064
- delegated("click", button_1, () => $$props.onactivate(get(profile)));
6065
- append($$anchor3, button_1);
6026
+ var div_1 = sibling(button, 2);
6027
+ each(div_1, 21, () => PROFILES, (profile) => profile.id, ($$anchor2, profile) => {
6028
+ var button_1 = root_1$3();
6029
+ var span_2 = child(button_1);
6030
+ var span_3 = child(span_2);
6031
+ html(span_3, () => getIcon(get(profile).iconId), true);
6032
+ var span_4 = sibling(span_3, 2);
6033
+ var span_5 = child(span_4);
6034
+ var text_1 = child(span_5);
6035
+ var span_6 = sibling(span_5, 2);
6036
+ var text_2 = child(span_6);
6037
+ var node = sibling(span_2, 2);
6038
+ {
6039
+ var consequent = ($$anchor3) => {
6040
+ var svg_1 = root_2$2();
6041
+ append($$anchor3, svg_1);
6042
+ };
6043
+ if_block(node, ($$render) => {
6044
+ if (activeProfileId() === get(profile).id) $$render(consequent);
6066
6045
  });
6067
- template_effect(($0) => set_attribute(div_1, "aria-label", $0), [() => t("section.profiles", lang())]);
6068
- append($$anchor2, div_1);
6069
- };
6070
- if_block(node, ($$render) => {
6071
- if (get(isOpen)) $$render(consequent_1);
6072
- });
6073
- }
6046
+ }
6047
+ template_effect(
6048
+ ($0, $1) => {
6049
+ set_attribute(button_1, "aria-pressed", activeProfileId() === get(profile).id);
6050
+ set_attribute(button_1, "data-active", activeProfileId() === get(profile).id);
6051
+ set_text(text_1, $0);
6052
+ set_text(text_2, $1);
6053
+ },
6054
+ [
6055
+ () => t(get(profile).nameKey, lang()),
6056
+ () => t(get(profile).descKey, lang())
6057
+ ]
6058
+ );
6059
+ delegated("click", button_1, () => $$props.onactivate(get(profile)));
6060
+ append($$anchor2, button_1);
6061
+ });
6074
6062
  template_effect(
6075
- ($0, $1) => {
6063
+ ($0, $1, $2) => {
6076
6064
  set_attribute(div, "aria-label", $0);
6077
6065
  set_attribute(button, "aria-expanded", get(isOpen));
6078
6066
  set_text(text, $1);
6079
6067
  classes = set_class(svg, 0, "accessify-accordion-chevron", null, classes, { "accessify-accordion-chevron--open": get(isOpen) });
6068
+ set_attribute(div_1, "aria-label", $2);
6069
+ set_style(div_1, get(isOpen) ? "" : "display:none");
6080
6070
  },
6081
6071
  [
6082
6072
  () => t("section.profiles", lang()),
6083
- () => get(activeProfile) ? t(get(activeProfile).nameKey, lang()) : t("section.profiles", lang())
6073
+ () => get(activeProfile) ? t(get(activeProfile).nameKey, lang()) : t("section.profiles", lang()),
6074
+ () => t("section.profiles", lang())
6084
6075
  ]
6085
6076
  );
6086
6077
  delegated("click", button, () => {
@@ -6448,14 +6439,14 @@ function FeatureGrid($$anchor, $$props) {
6448
6439
  const FEATURE_LOADERS = {
6449
6440
  contrast: () => import("./contrast-CqsICAkU.js"),
6450
6441
  "text-size": () => import("./text-size-m_mHNPWo.js"),
6451
- "keyboard-nav": () => import("./keyboard-nav-DriHR920.js"),
6442
+ "keyboard-nav": () => import("./keyboard-nav-CQ6IoNn_.js"),
6452
6443
  "link-highlight": () => import("./link-highlight-DBGm067Y.js"),
6453
6444
  "reading-guide": () => import("./reading-guide-VT8NciIL.js"),
6454
6445
  "reading-mask": () => import("./reading-mask-BABChuCz.js"),
6455
6446
  "animation-stop": () => import("./animation-stop-C0MwseK0.js"),
6456
6447
  "hide-images": () => import("./hide-images-B_LeCBcd.js"),
6457
6448
  "big-cursor": () => import("./big-cursor-B2UKu9dQ.js"),
6458
- "page-structure": () => import("./page-structure-CrtYM1Cb.js"),
6449
+ "page-structure": () => import("./page-structure-DOlGisQu.js"),
6459
6450
  tts: () => import("./tts-CjszLRnb.js"),
6460
6451
  "text-simplify": () => import("./text-simplify-Cvhpio7g.js"),
6461
6452
  "alt-text": () => Promise.resolve().then(() => altText)
@@ -6687,7 +6678,6 @@ function FeatureGrid($$anchor, $$props) {
6687
6678
  delegated("click", button_1, () => setTextSize(Math.max(TEXT_SIZE_MIN, get(textSize) - TEXT_SIZE_STEP)));
6688
6679
  delegated("input", input, (e) => {
6689
6680
  set(textSize, Number(e.target.value), true);
6690
- $$props.ontextsize?.(get(textSize));
6691
6681
  });
6692
6682
  delegated("change", input, (e) => setTextSize(Number(e.target.value)));
6693
6683
  delegated("click", button_2, () => setTextSize(Math.min(TEXT_SIZE_MAX, get(textSize) + TEXT_SIZE_STEP)));
@@ -7177,7 +7167,6 @@ function WidgetApp($$anchor, $$props) {
7177
7167
  let activeProfileId = /* @__PURE__ */ state(null);
7178
7168
  let langDropdownOpen = /* @__PURE__ */ state(false);
7179
7169
  let panelX = /* @__PURE__ */ state(null);
7180
- let widgetZoom = /* @__PURE__ */ state(1);
7181
7170
  const PANEL_X_KEY = "accessify-panel-x";
7182
7171
  const textTransformService = createTextTransformService();
7183
7172
  const STORAGE_KEY = "accessify-prefs";
@@ -7294,20 +7283,13 @@ function WidgetApp($$anchor, $$props) {
7294
7283
  const action = enabled ? t("status.activated", get(widgetLang)) : t("status.deactivated", get(widgetLang));
7295
7284
  announce(`${name} ${action}`);
7296
7285
  }
7297
- function handleTextSize(size) {
7298
- const factor = size / 100;
7299
- set(widgetZoom, Math.min(1.35, Math.max(0.85, factor)), true);
7300
- const mount2 = $$props.shadow.getElementById("accessify-mount");
7301
- if (mount2) {
7302
- mount2.style.zoom = get(widgetZoom) === 1 ? "" : String(get(widgetZoom));
7303
- }
7286
+ function handleTextSize(_size) {
7304
7287
  }
7305
7288
  function resetAll() {
7306
7289
  set(activeFeatures, /* @__PURE__ */ new Map(), true);
7307
7290
  set(activeProfileId, null);
7308
7291
  savePrefs();
7309
7292
  textTransformService.restore();
7310
- handleTextSize(100);
7311
7293
  window.dispatchEvent(new CustomEvent("accessify:reset"));
7312
7294
  announce(t("widget.resetConfirm", get(widgetLang)));
7313
7295
  }
@@ -7509,9 +7491,6 @@ function WidgetApp($$anchor, $$props) {
7509
7491
  return pop($$exports);
7510
7492
  }
7511
7493
  delegate(["click"]);
7512
- const CHECKMARK_SVG = encodeURIComponent(
7513
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>'
7514
- );
7515
7494
  function createWidgetStyles(config2) {
7516
7495
  const pos = config2.position || "bottom-right";
7517
7496
  const isRight = pos.includes("right");
@@ -7537,7 +7516,7 @@ function createWidgetStyles(config2) {
7537
7516
  :host {
7538
7517
  all: initial;
7539
7518
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
7540
- font-size: 15px;
7519
+ font-size: 16px;
7541
7520
  line-height: 1.5;
7542
7521
  color-scheme: dark;
7543
7522
  }
@@ -7854,14 +7833,6 @@ function createWidgetStyles(config2) {
7854
7833
  }
7855
7834
  .accessify-card:hover { transform: translateY(-2px); border-color: var(--border-hl); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
7856
7835
  .accessify-card[data-active="true"] { border-color: var(--accent); background: var(--accent-soft); }
7857
- .accessify-card[data-active="true"]::after {
7858
- content: ''; position: absolute; top: 8px; ${isRight ? "right: 8px" : "left: 8px"};
7859
- width: 18px; height: 18px; border-radius: 999px; background: var(--accent);
7860
- mask-image: url("data:image/svg+xml,${CHECKMARK_SVG}");
7861
- mask-size: 10px; mask-repeat: no-repeat; mask-position: center;
7862
- -webkit-mask-image: url("data:image/svg+xml,${CHECKMARK_SVG}");
7863
- -webkit-mask-size: 10px; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
7864
- }
7865
7836
  .accessify-card-icon {
7866
7837
  display: inline-flex; align-items: center; justify-content: center;
7867
7838
  width: 48px; height: 48px; border-radius: 14px;
@@ -8239,16 +8210,30 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
8239
8210
  const isImg = target.tagName === "IMG";
8240
8211
  let anchor;
8241
8212
  if (isImg) {
8242
- const wrapper = document.createElement("span");
8243
- wrapper.setAttribute(WRAPPER_ATTR, "1");
8244
- Object.assign(wrapper.style, {
8245
- position: "relative",
8246
- display: "inline-block",
8247
- lineHeight: "0"
8248
- });
8249
- target.parentElement.insertBefore(wrapper, target);
8250
- wrapper.appendChild(target);
8251
- anchor = wrapper;
8213
+ let container = target.parentElement;
8214
+ while (container && container !== document.body) {
8215
+ const cs = getComputedStyle(container);
8216
+ if (cs.overflow === "hidden" && cs.position !== "static") {
8217
+ break;
8218
+ }
8219
+ container = container.parentElement;
8220
+ }
8221
+ if (container && container !== document.body && container !== target.parentElement) {
8222
+ const pos = getComputedStyle(container).position;
8223
+ if (pos === "static") container.style.position = "relative";
8224
+ anchor = container;
8225
+ } else {
8226
+ const wrapper = document.createElement("span");
8227
+ wrapper.setAttribute(WRAPPER_ATTR, "1");
8228
+ Object.assign(wrapper.style, {
8229
+ position: "relative",
8230
+ display: "inline-block",
8231
+ lineHeight: "0"
8232
+ });
8233
+ target.parentElement.insertBefore(wrapper, target);
8234
+ wrapper.appendChild(target);
8235
+ anchor = wrapper;
8236
+ }
8252
8237
  } else {
8253
8238
  const pos = getComputedStyle(target).position;
8254
8239
  if (pos === "static") target.style.position = "relative";
@@ -8277,6 +8262,8 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
8277
8262
  });
8278
8263
  badge.textContent = "i";
8279
8264
  badge.setAttribute("aria-hidden", "true");
8265
+ badge.setAttribute("translate", "no");
8266
+ badge.classList.add("notranslate");
8280
8267
  badge.setAttribute(BADGE_ATTR, "badge");
8281
8268
  const tooltip = document.createElement("span");
8282
8269
  Object.assign(tooltip.style, {
@@ -8299,6 +8286,8 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
8299
8286
  boxShadow: "0 2px 8px rgba(0,0,0,0.3)"
8300
8287
  });
8301
8288
  tooltip.textContent = altText2;
8289
+ tooltip.setAttribute("translate", "no");
8290
+ tooltip.classList.add("notranslate");
8302
8291
  tooltip.setAttribute(BADGE_ATTR, "tooltip");
8303
8292
  badge.addEventListener("mouseenter", () => {
8304
8293
  badge.style.background = "rgba(0,0,0,0.85)";
@@ -8765,4 +8754,4 @@ export {
8765
8754
  init as i,
8766
8755
  t
8767
8756
  };
8768
- //# sourceMappingURL=index-1tl4oBKN.js.map
8757
+ //# sourceMappingURL=index-DISuvl6x.js.map