ally-widget 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -93,6 +93,7 @@ widget.startAccessibleWebWidget();
93
93
  | `lang` | `string` | browser lang | `'en'` or `'ne'` |
94
94
  | `storageKey` | `string` | `'ally-wgt'` | localStorage key — change to avoid collisions when multiple instances share a domain |
95
95
  | `keyboardShortcut` | `boolean` | `true` | `Alt+A` toggles the panel. Set `false` to disable |
96
+ | `showViolationBubble` | `boolean` | `true` | Red badge on the toggle button showing the axe-core violation count. Set `false` to hide it |
96
97
  | `icon` | `string` | `'default'` | Built-in variant name or a raw SVG string for the toggle button icon |
97
98
  | `icons` | `object` | — | Override any icon in the full icon set (see [Icon Keys](#icon-keys)) |
98
99
  | `poweredByText` | `string` | `'Ally Widget'` | Footer link label |
@@ -855,6 +856,18 @@ Append `?ally-dev=true` to any URL to enable the Annotations and Accessibility R
855
856
  https://yoursite.com/page?ally-dev=true
856
857
  ```
857
858
 
859
+ The axe-core library is loaded on demand in dev mode only — zero weight in production.
860
+
861
+ ### Hiding the violation badge
862
+
863
+ When violations are found, a red number badge appears on the toggle button. To hide it:
864
+
865
+ ```js
866
+ AllyWidget.init({
867
+ showViolationBubble: false
868
+ });
869
+ ```
870
+
858
871
  ---
859
872
 
860
873
  ## Keyboard Shortcut
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Ally Widget v1.0.2
2
+ * Ally Widget v1.0.3
3
3
  * Released under the MIT License
4
4
  */
5
5
  'use strict';
@@ -1398,7 +1398,7 @@ const featureMethods = {
1398
1398
  severity = 'moderate';
1399
1399
  }
1400
1400
 
1401
- if (displayCount <= 0) {
1401
+ if (displayCount <= 0 || this.options?.showViolationBubble === false) {
1402
1402
  bubble.textContent = '';
1403
1403
  bubble.hidden = true;
1404
1404
  bubble.removeAttribute('data-severity');
@@ -4019,6 +4019,7 @@ const uiMethods = {
4019
4019
  * offset: [20, 20] // [horizontal, vertical] px from edge
4020
4020
  * size: '52px' // toggle button size (px / em / rem / %)
4021
4021
  * keyboardShortcut: true // Alt+A to toggle (set false to disable)
4022
+ * showViolationBubble: true // red badge on toggle button (set false to hide)
4022
4023
  *
4023
4024
  * // ── Language ─────────────────────────────────────────────────────────────
4024
4025
  * lang: 'en' | 'ne'
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Ally Widget v1.0.2
2
+ * Ally Widget v1.0.3
3
3
  * Released under the MIT License
4
4
  */
5
5
  const WIDGET_THEME = {
@@ -1396,7 +1396,7 @@ const featureMethods = {
1396
1396
  severity = 'moderate';
1397
1397
  }
1398
1398
 
1399
- if (displayCount <= 0) {
1399
+ if (displayCount <= 0 || this.options?.showViolationBubble === false) {
1400
1400
  bubble.textContent = '';
1401
1401
  bubble.hidden = true;
1402
1402
  bubble.removeAttribute('data-severity');
@@ -4017,6 +4017,7 @@ const uiMethods = {
4017
4017
  * offset: [20, 20] // [horizontal, vertical] px from edge
4018
4018
  * size: '52px' // toggle button size (px / em / rem / %)
4019
4019
  * keyboardShortcut: true // Alt+A to toggle (set false to disable)
4020
+ * showViolationBubble: true // red badge on toggle button (set false to hide)
4020
4021
  *
4021
4022
  * // ── Language ─────────────────────────────────────────────────────────────
4022
4023
  * lang: 'en' | 'ne'
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Ally Widget v1.0.2
2
+ * Ally Widget v1.0.3
3
3
  * Released under the MIT License
4
4
  */
5
5
  var AllyWidget = (function () {
@@ -1399,7 +1399,7 @@ var AllyWidget = (function () {
1399
1399
  severity = 'moderate';
1400
1400
  }
1401
1401
 
1402
- if (displayCount <= 0) {
1402
+ if (displayCount <= 0 || this.options?.showViolationBubble === false) {
1403
1403
  bubble.textContent = '';
1404
1404
  bubble.hidden = true;
1405
1405
  bubble.removeAttribute('data-severity');
@@ -4020,6 +4020,7 @@ var AllyWidget = (function () {
4020
4020
  * offset: [20, 20] // [horizontal, vertical] px from edge
4021
4021
  * size: '52px' // toggle button size (px / em / rem / %)
4022
4022
  * keyboardShortcut: true // Alt+A to toggle (set false to disable)
4023
+ * showViolationBubble: true // red badge on toggle button (set false to hide)
4023
4024
  *
4024
4025
  * // ── Language ─────────────────────────────────────────────────────────────
4025
4026
  * lang: 'en' | 'ne'