accessify-widget 0.3.41 → 0.3.43

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-Bpz3Pgxd.js";
1
+ import { d, i } from "./index-B_5fu0ZB.js";
2
2
  export {
3
3
  d as destroy,
4
4
  i as init
@@ -6597,15 +6597,7 @@ function FeatureGrid($$anchor, $$props) {
6597
6597
  iconId: "alt-text"
6598
6598
  }
6599
6599
  };
6600
- const VISUAL_IDS = [
6601
- "keyboard-nav",
6602
- "link-highlight",
6603
- "animation-stop",
6604
- "hide-images",
6605
- "big-cursor"
6606
- ];
6607
- const READING_IDS = ["reading-guide", "reading-mask", "tts"];
6608
- const AI_IDS = ["text-simplify", "alt-text"];
6600
+ const INLINE_CONTROLS = /* @__PURE__ */ new Set(["contrast", "text-size"]);
6609
6601
  const CONTRAST_MODES = [
6610
6602
  {
6611
6603
  id: "light",
@@ -6628,14 +6620,14 @@ function FeatureGrid($$anchor, $$props) {
6628
6620
  const FEATURE_LOADERS = {
6629
6621
  contrast: () => import("./contrast-BcTWODsK.js"),
6630
6622
  "text-size": () => import("./text-size-m_mHNPWo.js"),
6631
- "keyboard-nav": () => import("./keyboard-nav-BY-Xbs7a.js"),
6623
+ "keyboard-nav": () => import("./keyboard-nav-BABYKgnj.js"),
6632
6624
  "link-highlight": () => import("./link-highlight-DBGm067Y.js"),
6633
6625
  "reading-guide": () => import("./reading-guide-VT8NciIL.js"),
6634
6626
  "reading-mask": () => import("./reading-mask-BABChuCz.js"),
6635
6627
  "animation-stop": () => import("./animation-stop-_chC8bg1.js"),
6636
6628
  "hide-images": () => import("./hide-images-B_LeCBcd.js"),
6637
6629
  "big-cursor": () => import("./big-cursor-B2UKu9dQ.js"),
6638
- "page-structure": () => import("./page-structure-B4O7IdeA.js"),
6630
+ "page-structure": () => import("./page-structure-BiKOV23k.js"),
6639
6631
  tts: () => import("./tts-CjszLRnb.js"),
6640
6632
  "text-simplify": () => import("./text-simplify-CK2GFhq2.js"),
6641
6633
  "alt-text": () => Promise.resolve().then(() => altText)
@@ -6669,9 +6661,6 @@ function FeatureGrid($$anchor, $$props) {
6669
6661
  const iconFn = icons[iconId];
6670
6662
  return iconFn ? iconFn() : "";
6671
6663
  }
6672
- function getVisibleFeatures(ids) {
6673
- return ids.filter((id) => get(visibleFeatureIds).has(id)).map((id) => FEATURE_REGISTRY[id]).filter(Boolean);
6674
- }
6675
6664
  function updateControlState(id, module) {
6676
6665
  if (!module) return;
6677
6666
  const state2 = module.getState();
@@ -6774,9 +6763,7 @@ function FeatureGrid($$anchor, $$props) {
6774
6763
  $$props.ontoggle("text-size", true);
6775
6764
  $$props.ontextsize?.(value);
6776
6765
  }
6777
- let visualFeatures = /* @__PURE__ */ user_derived(() => getVisibleFeatures(VISUAL_IDS));
6778
- let readingFeatures = /* @__PURE__ */ user_derived(() => getVisibleFeatures(READING_IDS));
6779
- let aiFeatures = /* @__PURE__ */ user_derived(() => getVisibleFeatures(AI_IDS));
6766
+ let cardFeatures = /* @__PURE__ */ user_derived(() => $$props.config.features.filter((id) => !INLINE_CONTROLS.has(id) && FEATURE_REGISTRY[id]).map((id) => FEATURE_REGISTRY[id]));
6780
6767
  user_effect(() => {
6781
6768
  `${$$props.config.features.join("|")}|${get(activeSignature)}`;
6782
6769
  void syncActiveModules();
@@ -6921,48 +6908,38 @@ function FeatureGrid($$anchor, $$props) {
6921
6908
  {
6922
6909
  var consequent_4 = ($$anchor2) => {
6923
6910
  var div_6 = root_9();
6924
- each(
6925
- div_6,
6926
- 21,
6927
- () => [
6928
- ...get(visualFeatures),
6929
- ...get(readingFeatures),
6930
- ...get(aiFeatures)
6931
- ],
6932
- (feature) => feature.id,
6933
- ($$anchor3, feature) => {
6934
- const isActive = /* @__PURE__ */ user_derived(() => $$props.activeFeatures.get(get(feature).id) ?? false);
6935
- var div_7 = root_10();
6936
- var button_2 = child(div_7);
6937
- var span_10 = child(button_2);
6938
- html(span_10, () => getIcon(get(feature).iconId), true);
6939
- var span_11 = sibling(span_10, 2);
6940
- var text_4 = child(span_11);
6941
- var span_12 = sibling(button_2, 2);
6942
- template_effect(
6943
- ($0, $1, $2, $3) => {
6944
- set_attribute(button_2, "data-active", get(isActive));
6945
- set_attribute(button_2, "aria-checked", get(isActive));
6946
- set_attribute(button_2, "aria-label", $0);
6947
- set_text(text_4, $1);
6948
- set_attribute(span_12, "aria-label", $2);
6949
- set_attribute(span_12, "title", $3);
6950
- },
6951
- [
6952
- () => t(get(feature).nameKey, $$props.config.lang),
6953
- () => t(get(feature).nameKey, $$props.config.lang),
6954
- () => t(get(feature).descKey, $$props.config.lang),
6955
- () => t(get(feature).descKey, $$props.config.lang)
6956
- ]
6957
- );
6958
- delegated("click", button_2, () => handleToggle(get(feature).id));
6959
- append($$anchor3, div_7);
6960
- }
6961
- );
6911
+ each(div_6, 21, () => get(cardFeatures), (feature) => feature.id, ($$anchor3, feature) => {
6912
+ const isActive = /* @__PURE__ */ user_derived(() => $$props.activeFeatures.get(get(feature).id) ?? false);
6913
+ var div_7 = root_10();
6914
+ var button_2 = child(div_7);
6915
+ var span_10 = child(button_2);
6916
+ html(span_10, () => getIcon(get(feature).iconId), true);
6917
+ var span_11 = sibling(span_10, 2);
6918
+ var text_4 = child(span_11);
6919
+ var span_12 = sibling(button_2, 2);
6920
+ template_effect(
6921
+ ($0, $1, $2, $3) => {
6922
+ set_attribute(button_2, "data-active", get(isActive));
6923
+ set_attribute(button_2, "aria-checked", get(isActive));
6924
+ set_attribute(button_2, "aria-label", $0);
6925
+ set_text(text_4, $1);
6926
+ set_attribute(span_12, "aria-label", $2);
6927
+ set_attribute(span_12, "title", $3);
6928
+ },
6929
+ [
6930
+ () => t(get(feature).nameKey, $$props.config.lang),
6931
+ () => t(get(feature).nameKey, $$props.config.lang),
6932
+ () => t(get(feature).descKey, $$props.config.lang),
6933
+ () => t(get(feature).descKey, $$props.config.lang)
6934
+ ]
6935
+ );
6936
+ delegated("click", button_2, () => handleToggle(get(feature).id));
6937
+ append($$anchor3, div_7);
6938
+ });
6962
6939
  append($$anchor2, div_6);
6963
6940
  };
6964
6941
  if_block(node_4, ($$render) => {
6965
- if (get(visualFeatures).length > 0 || get(readingFeatures).length > 0 || get(aiFeatures).length > 0) $$render(consequent_4);
6942
+ if (get(cardFeatures).length > 0) $$render(consequent_4);
6966
6943
  });
6967
6944
  }
6968
6945
  append($$anchor, fragment);
@@ -7742,6 +7719,14 @@ function createWidgetStyles(config2) {
7742
7719
  return `
7743
7720
  :host {
7744
7721
  all: initial;
7722
+ display: block !important;
7723
+ position: fixed !important;
7724
+ top: 0 !important; left: 0 !important;
7725
+ width: 0 !important; height: 0 !important;
7726
+ overflow: visible !important;
7727
+ pointer-events: none !important;
7728
+ z-index: ${z} !important;
7729
+ contain: none !important;
7745
7730
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
7746
7731
  font-size: 16px;
7747
7732
  line-height: 1.5;
@@ -7782,6 +7767,7 @@ function createWidgetStyles(config2) {
7782
7767
  ${isBottom ? "bottom: 20px" : "top: 20px"};
7783
7768
  ${isRight ? "right: 20px" : "left: 20px"};
7784
7769
  z-index: ${z};
7770
+ pointer-events: auto;
7785
7771
  width: 56px; height: 56px;
7786
7772
  border: none; border-radius: 16px;
7787
7773
  background: ${triggerBg || "linear-gradient(135deg, #545d8f, #3d4775)"};
@@ -7812,6 +7798,7 @@ function createWidgetStyles(config2) {
7812
7798
  position: fixed; top: 0; bottom: 0;
7813
7799
  ${isRight ? "right: 0" : "left: 0"};
7814
7800
  z-index: ${z - 1};
7801
+ pointer-events: auto;
7815
7802
  width: min(${panelW}, 100vw); height: 100vh; height: 100dvh;
7816
7803
  display: flex; flex-direction: column;
7817
7804
  border-radius: ${panelRadius};
@@ -8889,6 +8876,7 @@ async function init(userConfig = {}) {
8889
8876
  containerEl.id = "accessify-root";
8890
8877
  containerEl.setAttribute("role", "complementary");
8891
8878
  containerEl.setAttribute("aria-label", t("widget.title", config.lang));
8879
+ containerEl.style.cssText = "position:fixed!important;top:0!important;left:0!important;width:0!important;height:0!important;overflow:visible!important;pointer-events:none!important;z-index:" + (config.zIndex || 999999) + "!important;display:block!important;contain:none!important;";
8892
8880
  const shadow = containerEl.attachShadow({ mode: "open", delegatesFocus: true });
8893
8881
  const sheet = new CSSStyleSheet();
8894
8882
  sheet.replaceSync(createWidgetStyles(config));
@@ -8988,4 +8976,4 @@ export {
8988
8976
  init as i,
8989
8977
  t
8990
8978
  };
8991
- //# sourceMappingURL=index-Bpz3Pgxd.js.map
8979
+ //# sourceMappingURL=index-B_5fu0ZB.js.map