@bauer-group/accessibility-widget 1.0.3
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/LICENSE +21 -0
- package/README.md +259 -0
- package/dist/accessibility-widget-core.min.js +6 -0
- package/dist/accessibility-widget-core.min.js.map +7 -0
- package/dist/accessibility-widget-loader.min.js +14 -0
- package/dist/accessibility-widget-loader.min.js.map +7 -0
- package/dist/accessibility-widget.min.css +7 -0
- package/dist/accessibility-widget.min.css.map +7 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/core.d.ts +31 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/features/apply.d.ts +3 -0
- package/dist/features/apply.d.ts.map +1 -0
- package/dist/features/profile.d.ts +3 -0
- package/dist/features/profile.d.ts.map +1 -0
- package/dist/features/reading-guide.d.ts +2 -0
- package/dist/features/reading-guide.d.ts.map +1 -0
- package/dist/features/reading-mask.d.ts +2 -0
- package/dist/features/reading-mask.d.ts.map +1 -0
- package/dist/features/structure-nav.d.ts +2 -0
- package/dist/features/structure-nav.d.ts.map +1 -0
- package/dist/features/tts.d.ts +7 -0
- package/dist/features/tts.d.ts.map +1 -0
- package/dist/focus-trap.d.ts +6 -0
- package/dist/focus-trap.d.ts.map +1 -0
- package/dist/i18n/ar.d.ts +3 -0
- package/dist/i18n/ar.d.ts.map +1 -0
- package/dist/i18n/bn.d.ts +3 -0
- package/dist/i18n/bn.d.ts.map +1 -0
- package/dist/i18n/cs.d.ts +3 -0
- package/dist/i18n/cs.d.ts.map +1 -0
- package/dist/i18n/de.d.ts +3 -0
- package/dist/i18n/de.d.ts.map +1 -0
- package/dist/i18n/el.d.ts +3 -0
- package/dist/i18n/el.d.ts.map +1 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/es.d.ts +3 -0
- package/dist/i18n/es.d.ts.map +1 -0
- package/dist/i18n/fa.d.ts +3 -0
- package/dist/i18n/fa.d.ts.map +1 -0
- package/dist/i18n/fr.d.ts +3 -0
- package/dist/i18n/fr.d.ts.map +1 -0
- package/dist/i18n/he.d.ts +3 -0
- package/dist/i18n/he.d.ts.map +1 -0
- package/dist/i18n/hi.d.ts +3 -0
- package/dist/i18n/hi.d.ts.map +1 -0
- package/dist/i18n/hu.d.ts +3 -0
- package/dist/i18n/hu.d.ts.map +1 -0
- package/dist/i18n/id.d.ts +3 -0
- package/dist/i18n/id.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/it.d.ts +3 -0
- package/dist/i18n/it.d.ts.map +1 -0
- package/dist/i18n/ja.d.ts +3 -0
- package/dist/i18n/ja.d.ts.map +1 -0
- package/dist/i18n/ko.d.ts +3 -0
- package/dist/i18n/ko.d.ts.map +1 -0
- package/dist/i18n/nl.d.ts +3 -0
- package/dist/i18n/nl.d.ts.map +1 -0
- package/dist/i18n/pl.d.ts +3 -0
- package/dist/i18n/pl.d.ts.map +1 -0
- package/dist/i18n/pt.d.ts +3 -0
- package/dist/i18n/pt.d.ts.map +1 -0
- package/dist/i18n/ro.d.ts +3 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ru.d.ts +3 -0
- package/dist/i18n/ru.d.ts.map +1 -0
- package/dist/i18n/sv.d.ts +3 -0
- package/dist/i18n/sv.d.ts.map +1 -0
- package/dist/i18n/th.d.ts +3 -0
- package/dist/i18n/th.d.ts.map +1 -0
- package/dist/i18n/tr.d.ts +3 -0
- package/dist/i18n/tr.d.ts.map +1 -0
- package/dist/i18n/types.d.ts +44 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/uk.d.ts +3 -0
- package/dist/i18n/uk.d.ts.map +1 -0
- package/dist/i18n/ur.d.ts +3 -0
- package/dist/i18n/ur.d.ts.map +1 -0
- package/dist/i18n/vi.d.ts +3 -0
- package/dist/i18n/vi.d.ts.map +1 -0
- package/dist/i18n/zh.d.ts +3 -0
- package/dist/i18n/zh.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +9 -0
- package/dist/integrity.txt +12 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/panel/drag.d.ts +34 -0
- package/dist/panel/drag.d.ts.map +1 -0
- package/dist/panel/panel.d.ts +23 -0
- package/dist/panel/panel.d.ts.map +1 -0
- package/dist/state.d.ts +18 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/styles/critical.d.ts +16 -0
- package/dist/styles/critical.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/locale.d.ts +11 -0
- package/dist/types/locale.d.ts.map +1 -0
- package/dist/types/widget.d.ts +207 -0
- package/dist/types/widget.d.ts.map +1 -0
- package/dist/util/debug.d.ts +8 -0
- package/dist/util/debug.d.ts.map +1 -0
- package/dist/util/dom.d.ts +19 -0
- package/dist/util/dom.d.ts.map +1 -0
- package/dist/util/events.d.ts +38 -0
- package/dist/util/events.d.ts.map +1 -0
- package/dist/util/feature-icons.d.ts +33 -0
- package/dist/util/feature-icons.d.ts.map +1 -0
- package/dist/util/language-names.d.ts +12 -0
- package/dist/util/language-names.d.ts.map +1 -0
- package/dist/util/svg.d.ts +38 -0
- package/dist/util/svg.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/config.ts +213 -0
- package/src/core.ts +173 -0
- package/src/features/apply.ts +37 -0
- package/src/features/profile.ts +18 -0
- package/src/features/reading-guide.ts +25 -0
- package/src/features/reading-mask.ts +25 -0
- package/src/features/structure-nav.ts +43 -0
- package/src/features/tts.ts +73 -0
- package/src/focus-trap.ts +35 -0
- package/src/globals.d.ts +63 -0
- package/src/i18n/ar.ts +48 -0
- package/src/i18n/bn.ts +48 -0
- package/src/i18n/cs.ts +48 -0
- package/src/i18n/de.ts +65 -0
- package/src/i18n/el.ts +48 -0
- package/src/i18n/en.ts +65 -0
- package/src/i18n/es.ts +48 -0
- package/src/i18n/fa.ts +48 -0
- package/src/i18n/fr.ts +48 -0
- package/src/i18n/he.ts +48 -0
- package/src/i18n/hi.ts +48 -0
- package/src/i18n/hu.ts +48 -0
- package/src/i18n/id.ts +48 -0
- package/src/i18n/index.ts +70 -0
- package/src/i18n/it.ts +48 -0
- package/src/i18n/ja.ts +48 -0
- package/src/i18n/ko.ts +48 -0
- package/src/i18n/nl.ts +48 -0
- package/src/i18n/pl.ts +48 -0
- package/src/i18n/pt.ts +48 -0
- package/src/i18n/ro.ts +48 -0
- package/src/i18n/ru.ts +48 -0
- package/src/i18n/sv.ts +48 -0
- package/src/i18n/th.ts +48 -0
- package/src/i18n/tr.ts +48 -0
- package/src/i18n/types.ts +36 -0
- package/src/i18n/uk.ts +48 -0
- package/src/i18n/ur.ts +48 -0
- package/src/i18n/vi.ts +48 -0
- package/src/i18n/zh.ts +48 -0
- package/src/index.ts +9 -0
- package/src/loader.ts +533 -0
- package/src/panel/drag.ts +210 -0
- package/src/panel/panel.ts +617 -0
- package/src/state.ts +91 -0
- package/src/styles/critical.ts +56 -0
- package/src/styles/widget.css +739 -0
- package/src/types/index.ts +2 -0
- package/src/types/locale.ts +55 -0
- package/src/types/widget.ts +300 -0
- package/src/util/debug.ts +12 -0
- package/src/util/dom.ts +68 -0
- package/src/util/events.ts +54 -0
- package/src/util/feature-icons.ts +163 -0
- package/src/util/language-names.ts +41 -0
- package/src/util/svg.ts +93 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sv.d.ts","sourceRoot":"","sources":["../../src/i18n/sv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"th.d.ts","sourceRoot":"","sources":["../../src/i18n/th.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../src/i18n/tr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FeatureId, ProfileId, ContrastMode } from '../types/index.js';
|
|
2
|
+
export interface Translation {
|
|
3
|
+
title: string;
|
|
4
|
+
close: string;
|
|
5
|
+
reset: string;
|
|
6
|
+
resetDone: string;
|
|
7
|
+
profiles: {
|
|
8
|
+
h: string;
|
|
9
|
+
} & Record<ProfileId, string>;
|
|
10
|
+
features: {
|
|
11
|
+
h: string;
|
|
12
|
+
} & Record<FeatureId, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Optional per-feature descriptions shown as tooltip / aria-describedby.
|
|
15
|
+
* Not all locales must fully translate these; consumers fall back to
|
|
16
|
+
* English when a key is missing. Keeping this decoupled from `features`
|
|
17
|
+
* avoids forcing 17×28 brand-new translations on every locale.
|
|
18
|
+
*/
|
|
19
|
+
featureDescriptions?: Partial<Record<FeatureId, string>>;
|
|
20
|
+
values: {
|
|
21
|
+
off: string;
|
|
22
|
+
on: string;
|
|
23
|
+
step: string;
|
|
24
|
+
};
|
|
25
|
+
contrastLabels: Record<ContrastMode, string>;
|
|
26
|
+
aria: {
|
|
27
|
+
dialog: string;
|
|
28
|
+
switch: string;
|
|
29
|
+
triggerLabel: string;
|
|
30
|
+
dragHandle: string;
|
|
31
|
+
oversized: string;
|
|
32
|
+
language: string;
|
|
33
|
+
info: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Connector phrase for the "Powered by BAUER GROUP Accessibility-Widget"
|
|
37
|
+
* footer line. Localised per language; the brand name is never translated.
|
|
38
|
+
* The panel concatenates this with the untranslated brand + link, e.g.
|
|
39
|
+
* `"Bereitgestellt von BAUER GROUP Accessibility-Widget"`.
|
|
40
|
+
*/
|
|
41
|
+
poweredBy: string;
|
|
42
|
+
statementLink: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpD,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uk.d.ts","sourceRoot":"","sources":["../../src/i18n/uk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ur.d.ts","sourceRoot":"","sources":["../../src/i18n/ur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi.d.ts","sourceRoot":"","sources":["../../src/i18n/vi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../src/i18n/zh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,EAAE,EAAE,WA6ChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public TypeScript surface for @bauer-group/accessibility-widget.
|
|
3
|
+
*
|
|
4
|
+
* Browser users load the IIFE bundles from /dist (loader + core).
|
|
5
|
+
* Framework integrations (React, Vue, Angular, etc.) import the
|
|
6
|
+
* type-level API from here.
|
|
7
|
+
*/
|
|
8
|
+
export type * from './types/index.js';
|
|
9
|
+
export type { WidgetEventMap, WidgetEventName } from './util/events.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,mBAAmB,kBAAkB,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.3",
|
|
3
|
+
"algorithm": "sha384",
|
|
4
|
+
"files": {
|
|
5
|
+
"accessibility-widget-loader.min.js": "sha384-x3nEE41Bno38CoMS40iDxlrM27sK98xRawnpO0na7I56gsAFU6K+1jboiGcejA8A",
|
|
6
|
+
"accessibility-widget-core.min.js": "sha384-Ca3T0SndPI8TgNXqf/fa217+kLYIX9VYpeKXW7HEf1hvel4zvUmVQCnqY29w4Ejk",
|
|
7
|
+
"accessibility-widget.min.css": "sha384-WQbT26ugDB/VHq7jOuVyBEtxr7YXvlXg15O1QS3GEMRZ4YmRJLXHjE94TZh/06Os"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
BAUER GROUP Accessibility Widget — SRI Hashes (sha384, base64)
|
|
2
|
+
Version: 1.0.3
|
|
3
|
+
Built: 2026-06-20T02:58:34.438Z
|
|
4
|
+
|
|
5
|
+
accessibility-widget-loader.min.js (raw 14713 B, gzip 5703 B)
|
|
6
|
+
sha384-x3nEE41Bno38CoMS40iDxlrM27sK98xRawnpO0na7I56gsAFU6K+1jboiGcejA8A
|
|
7
|
+
|
|
8
|
+
accessibility-widget-core.min.js (raw 91512 B, gzip 26842 B)
|
|
9
|
+
sha384-Ca3T0SndPI8TgNXqf/fa217+kLYIX9VYpeKXW7HEf1hvel4zvUmVQCnqY29w4Ejk
|
|
10
|
+
|
|
11
|
+
accessibility-widget.min.css (raw 10586 B, gzip 2996 B)
|
|
12
|
+
sha384-WQbT26ugDB/VHq7jOuVyBEtxr7YXvlXg15O1QS3GEMRZ4YmRJLXHjE94TZh/06Os
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel drag-to-move — pointer-events based, with pointer capture so the drag
|
|
3
|
+
* survives the cursor leaving the panel. Position is persisted per device via
|
|
4
|
+
* a dedicated localStorage key, intentionally separate from WidgetState so the
|
|
5
|
+
* loader does not touch it before first paint.
|
|
6
|
+
*
|
|
7
|
+
* Keyboard users get an equivalent shortcut (Ctrl+Shift+Arrow) — a draggable
|
|
8
|
+
* accessibility widget with no keyboard path would be self-defeating.
|
|
9
|
+
*/
|
|
10
|
+
export interface PanelPosition {
|
|
11
|
+
/** Left offset in pixels from the viewport edge. */
|
|
12
|
+
x: number;
|
|
13
|
+
/** Top offset in pixels from the viewport edge. */
|
|
14
|
+
y: number;
|
|
15
|
+
}
|
|
16
|
+
export interface DraggableOptions {
|
|
17
|
+
root: HTMLElement;
|
|
18
|
+
handle: HTMLElement;
|
|
19
|
+
storageKey: string;
|
|
20
|
+
/** Called with null when the user resets, otherwise with the new position. */
|
|
21
|
+
onChange?: (pos: PanelPosition | null) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface DraggableHandle {
|
|
24
|
+
/** Re-apply the saved position (call after rerender). */
|
|
25
|
+
restore(): void;
|
|
26
|
+
/** Remove listeners. */
|
|
27
|
+
destroy(): void;
|
|
28
|
+
/** Clear saved position. */
|
|
29
|
+
reset(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function loadPanelPosition(storageKey: string): PanelPosition | null;
|
|
32
|
+
export declare function savePanelPosition(storageKey: string, pos: PanelPosition | null): void;
|
|
33
|
+
export declare function makeDraggable(opts: DraggableOptions): DraggableHandle;
|
|
34
|
+
//# sourceMappingURL=drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/panel/drag.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,CAAC,EAAE,MAAM,CAAC;IACV,mDAAmD;IACnD,CAAC,EAAE,MAAM,CAAC;CACX;AAKD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,OAAO,IAAI,IAAI,CAAC;IAChB,wBAAwB;IACxB,OAAO,IAAI,IAAI,CAAC;IAChB,4BAA4B;IAC5B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAW1E;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAOrF;AAMD,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CAkHrE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Locale, type WidgetState } from '../types/index.js';
|
|
2
|
+
import type { ResolvedConfig } from '../config.js';
|
|
3
|
+
interface PanelContext {
|
|
4
|
+
config: ResolvedConfig;
|
|
5
|
+
locale: Locale;
|
|
6
|
+
state: WidgetState;
|
|
7
|
+
statementUrl?: string;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onStateChange: (s: WidgetState) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface PanelHandle {
|
|
12
|
+
root: HTMLDivElement;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
rerender(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Swap the active locale while the panel stays open. Silently no-ops
|
|
17
|
+
* when the locale is already active or not supported.
|
|
18
|
+
*/
|
|
19
|
+
setLocale(next: Locale): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function openPanel(ctx: PanelContext): PanelHandle;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/panel/panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,MAAM,EACX,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AA6F3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,UAAU,YAAY;IACpB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,IAAI,IAAI,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,WAAW,CA2exD"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type WidgetState, type FeatureId } from './types/index.js';
|
|
2
|
+
export declare const STEPS: {
|
|
3
|
+
fontSize: readonly [1, 1.2, 1.4, 1.6];
|
|
4
|
+
lineHeight: readonly [1.5, 1.8, 2];
|
|
5
|
+
letterSpacing: readonly [0, 0.05, 0.1];
|
|
6
|
+
contrast: readonly ["off", "high", "dark", "invert"];
|
|
7
|
+
};
|
|
8
|
+
export declare function createDefaultState(): WidgetState;
|
|
9
|
+
export declare function loadState(storageKey: string): WidgetState;
|
|
10
|
+
export declare function saveState(storageKey: string, state: WidgetState): void;
|
|
11
|
+
export declare function clearState(storageKey: string): void;
|
|
12
|
+
export declare function hasAnyFeatureOn(state: WidgetState): boolean;
|
|
13
|
+
export declare function cycleStep<T extends number | string>(current: T, steps: readonly T[]): {
|
|
14
|
+
next: T;
|
|
15
|
+
wrapped: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function setFeature(state: WidgetState, id: FeatureId, on: boolean): WidgetState;
|
|
18
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,KAAK;;;;;CAKjB,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,WAAW,CAKhD;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAgCzD;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAOtE;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAMnD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE3D;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACjD,OAAO,EAAE,CAAC,EACV,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAK/B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,GAAG,WAAW,CAEtF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Critical CSS inlined by the loader. Kept minimal so the loader stays ~4 KB gzip.
|
|
3
|
+
* Uses only `data-aw-*` attributes on <html>, never touches host DOM.
|
|
4
|
+
*
|
|
5
|
+
* The primaryColor + offset + zIndex are interpolated at runtime so brands
|
|
6
|
+
* can theme and layout without a build step.
|
|
7
|
+
*/
|
|
8
|
+
export interface CriticalCssOptions {
|
|
9
|
+
primaryColor: string;
|
|
10
|
+
hideOnPrint: boolean;
|
|
11
|
+
offsetX: number;
|
|
12
|
+
offsetY: number;
|
|
13
|
+
zIndex: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildCriticalCss(opts: CriticalCssOptions): string;
|
|
16
|
+
//# sourceMappingURL=critical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critical.d.ts","sourceRoot":"","sources":["../../src/styles/critical.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAwCjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SUPPORTED_LOCALES: readonly ["de", "en", "fr", "es", "it", "pl", "tr", "ar", "zh", "hi", "pt", "bn", "ru", "ja", "ko", "vi", "fa", "ur", "th", "id", "he", "nl", "sv", "cs", "el", "hu", "ro", "uk"];
|
|
2
|
+
export type Locale = (typeof SUPPORTED_LOCALES)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Right-to-left locales. Used by the panel renderer to set `dir="rtl"`.
|
|
5
|
+
* Keep in sync with the list of locales we ship translations for.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RTL_LOCALES: readonly Locale[];
|
|
8
|
+
export declare function isRtl(locale: Locale): boolean;
|
|
9
|
+
export declare function isLocale(value: unknown): value is Locale;
|
|
10
|
+
export declare function normalizeLocale(input: string | undefined | null, fallback?: Locale): Locale;
|
|
11
|
+
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/types/locale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,mLAgCpB,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAA6B,CAAC;AAEvE,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,QAAQ,GAAE,MAAa,GAAG,MAAM,CAIjG"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { Locale } from './locale.js';
|
|
2
|
+
export declare const FEATURE_IDS: readonly ["fontSize", "lineHeight", "letterSpacing", "contrast", "grayscale", "invertColors", "dyslexiaFont", "highlightLinks", "pauseAnimations", "bigCursor", "focusOutline", "readingMask", "readingGuide", "tts", "structureNav"];
|
|
3
|
+
export type FeatureId = (typeof FEATURE_IDS)[number];
|
|
4
|
+
export declare const CONTRAST_MODES: readonly ["off", "high", "dark", "invert"];
|
|
5
|
+
export type ContrastMode = (typeof CONTRAST_MODES)[number];
|
|
6
|
+
export declare const PROFILE_IDS: readonly ["visionImpaired", "motor", "cognitive", "seizureSafe", "adhd", "blind"];
|
|
7
|
+
export type ProfileId = (typeof PROFILE_IDS)[number];
|
|
8
|
+
export declare const POSITIONS: readonly ["bottom-right", "bottom-left", "top-right", "top-left"];
|
|
9
|
+
export type Position = (typeof POSITIONS)[number];
|
|
10
|
+
export interface WidgetState {
|
|
11
|
+
features: Record<FeatureId, boolean>;
|
|
12
|
+
fontSizeLevel: number;
|
|
13
|
+
lineHeightLevel: number;
|
|
14
|
+
letterSpacingLevel: number;
|
|
15
|
+
contrastMode: ContrastMode;
|
|
16
|
+
/** Enlarges panel controls & tap targets — independent from font-size feature. */
|
|
17
|
+
oversized?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Custom FAB position set by user drag (only populated when `draggableFab`
|
|
20
|
+
* is enabled and the user actually moved the button). Coordinates are
|
|
21
|
+
* viewport-pixel distances from the **top-left** corner. When absent, the
|
|
22
|
+
* FAB uses the configured `position` + `offset` anchor.
|
|
23
|
+
*/
|
|
24
|
+
fabPosition?: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* User-chosen locale override. When set, wins over `config.locale`
|
|
30
|
+
* on the next panel open and gets applied on reload by the loader.
|
|
31
|
+
* Populated by the in-panel language dropdown and the public
|
|
32
|
+
* `setLocale()` runtime API.
|
|
33
|
+
*/
|
|
34
|
+
locale?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Host-supplied configuration for the widget loader.
|
|
38
|
+
*
|
|
39
|
+
* Set via `window.AccessibilityWidgetConfig = { … }` **before** the loader
|
|
40
|
+
* script executes. All fields are optional — the widget ships with sensible
|
|
41
|
+
* defaults. Invalid values are coerced to defaults; with `debug: true` they
|
|
42
|
+
* emit console warnings so mis-configurations are discoverable.
|
|
43
|
+
*
|
|
44
|
+
* @example Minimal override
|
|
45
|
+
* ```ts
|
|
46
|
+
* window.AccessibilityWidgetConfig = { locale: 'de', primaryColor: '#0058a3' };
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Enterprise deployment
|
|
50
|
+
* ```ts
|
|
51
|
+
* window.AccessibilityWidgetConfig = {
|
|
52
|
+
* corePath: '/assets/accessibility-widget-core.min.js',
|
|
53
|
+
* cssPath: '/assets/accessibility-widget.min.css',
|
|
54
|
+
* coreIntegrity: 'sha384-…',
|
|
55
|
+
* cssIntegrity: 'sha384-…',
|
|
56
|
+
* position: 'bottom-left',
|
|
57
|
+
* offset: { x: 24, y: 96 }, // clear the chat widget
|
|
58
|
+
* zIndex: 9999,
|
|
59
|
+
* primaryColor: '#0058a3',
|
|
60
|
+
* storageKey: 'mycorp-a11y',
|
|
61
|
+
* statementUrl: '/accessibility-statement',
|
|
62
|
+
* disabledFeatures: ['tts'],
|
|
63
|
+
* initialFeatures: { focusOutline: true },
|
|
64
|
+
* debug: false,
|
|
65
|
+
* };
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export interface WidgetConfig {
|
|
69
|
+
/** URL to the on-demand core bundle. Default: `/accessibility-widget/accessibility-widget-core.min.js`. */
|
|
70
|
+
corePath?: string;
|
|
71
|
+
/** URL to the widget stylesheet. Default: `/accessibility-widget/accessibility-widget.min.css`. */
|
|
72
|
+
cssPath?: string;
|
|
73
|
+
/** SRI hash for the core bundle (`sha384-…`). Matches the value printed in `dist/integrity.txt`. */
|
|
74
|
+
coreIntegrity?: string | null;
|
|
75
|
+
/** SRI hash for the stylesheet. Matches the value printed in `dist/integrity.txt`. */
|
|
76
|
+
cssIntegrity?: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Widget locale. `'auto'` (default) picks from `document.documentElement.lang`
|
|
79
|
+
* or `navigator.language`, falling back to `de`. Set explicitly to override.
|
|
80
|
+
*/
|
|
81
|
+
locale?: Locale | 'auto';
|
|
82
|
+
/** FAB anchor corner. Default: `bottom-right`. */
|
|
83
|
+
position?: Position;
|
|
84
|
+
/**
|
|
85
|
+
* Pixel offset of the FAB from its anchor corner.
|
|
86
|
+
* Useful when other fixed elements (chat widgets, cookie banners) would collide.
|
|
87
|
+
* Default: `{ x: 20, y: 20 }`.
|
|
88
|
+
*/
|
|
89
|
+
offset?: {
|
|
90
|
+
x?: number;
|
|
91
|
+
y?: number;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Override the FAB z-index. Default: `2147483646` (one below max int32).
|
|
95
|
+
* Lower values allow in-page dialogs to stack on top of the FAB.
|
|
96
|
+
*/
|
|
97
|
+
zIndex?: number;
|
|
98
|
+
/** FAB background color. Default: `#0058a3` (BAUER GROUP blue). Must be a valid CSS color. */
|
|
99
|
+
primaryColor?: string;
|
|
100
|
+
/** Override the FAB `aria-label`. `null` → use the localized default for the active locale. */
|
|
101
|
+
buttonLabel?: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* localStorage key for user preferences. Default: `accessibility-widget`.
|
|
104
|
+
* Change this to namespace the widget on multi-tenant platforms where
|
|
105
|
+
* different sub-brands need isolated preferences.
|
|
106
|
+
*/
|
|
107
|
+
storageKey?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Features turned ON for a first-time visitor (no persisted state yet).
|
|
110
|
+
* Only applies once — once the user has modified anything in the panel,
|
|
111
|
+
* the persisted state wins.
|
|
112
|
+
*
|
|
113
|
+
* @example Public-sector site that wants a visible focus ring by default
|
|
114
|
+
* ```ts
|
|
115
|
+
* { initialFeatures: { focusOutline: true, highlightLinks: true } }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
initialFeatures?: Partial<Record<FeatureId, boolean>>;
|
|
119
|
+
/**
|
|
120
|
+
* Features hidden from the panel UI. Useful when certain features don't
|
|
121
|
+
* make sense in context (e.g. `tts` on a site with no text content).
|
|
122
|
+
* Hidden features are neither toggle-able nor activated by profile presets.
|
|
123
|
+
*/
|
|
124
|
+
disabledFeatures?: readonly FeatureId[];
|
|
125
|
+
/**
|
|
126
|
+
* URL of the site's accessibility statement. When set, a link is rendered
|
|
127
|
+
* in the panel footer (label is localized — see `Translation.statementLink`).
|
|
128
|
+
* Recommended for BFSG § 14 / EN 301 549 § 12.1.1 compliance.
|
|
129
|
+
*
|
|
130
|
+
* Absolute URLs (`http://`, `https://`, protocol-relative `//…`) open in a
|
|
131
|
+
* new tab with `rel="noopener noreferrer"`; relative paths stay same-tab.
|
|
132
|
+
*/
|
|
133
|
+
statementUrl?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Optional free-form disclaimer text rendered in the panel footer above
|
|
136
|
+
* the "Powered by" line. No default — if you want the footer to carry
|
|
137
|
+
* guidance ("Feedback zur Barrierefreiheit bitte an die Hotline …"), set
|
|
138
|
+
* it per host. Kept as plain text, not HTML; line breaks render as
|
|
139
|
+
* whitespace.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* { disclaimer: 'Feedback an barrierefreiheit@example.com' }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
disclaimer?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Suppress the "Powered by BAUER GROUP Accessibility-Widget" footer line.
|
|
149
|
+
* Intended for white-label deployments — the default (`false`) shows a
|
|
150
|
+
* small localised attribution with a link back to the product page.
|
|
151
|
+
*/
|
|
152
|
+
hidePoweredBy?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* When true, end users can drag the FAB to a custom position (pointer or
|
|
155
|
+
* keyboard). The chosen position persists under `storageKey` as part of
|
|
156
|
+
* the widget state and is restored on the next visit. Default: `false`.
|
|
157
|
+
*
|
|
158
|
+
* Keyboard: focus the FAB, hold Shift + Arrow keys to move in 10 px steps.
|
|
159
|
+
*/
|
|
160
|
+
draggableFab?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Keyboard shortcut that opens the widget from anywhere on the page.
|
|
163
|
+
*
|
|
164
|
+
* - `string` — a combo like `'ctrl+alt+a'`, `'alt+shift+a'`, `'f2'`. Tokens
|
|
165
|
+
* are case-insensitive and joined with `+`. Supported modifiers:
|
|
166
|
+
* `alt`, `ctrl`, `shift`, `meta`. Exactly one non-modifier key is required.
|
|
167
|
+
* - `false` — disable the shortcut entirely. Useful when the default clashes
|
|
168
|
+
* with a host's own A11y hotkey or a browser / extension binding.
|
|
169
|
+
*
|
|
170
|
+
* Invalid strings emit a `console.warn` when `debug: true` and the shortcut
|
|
171
|
+
* is disabled (no fallback to another combo — the host's choice is respected).
|
|
172
|
+
*
|
|
173
|
+
* Default: `'ctrl+alt+a'` — aligned with the prevailing convention among
|
|
174
|
+
* A11y widgets (Userway and others), rarely clashes with browser chrome.
|
|
175
|
+
*
|
|
176
|
+
* @example Function-key style
|
|
177
|
+
* ```ts
|
|
178
|
+
* { keyboardShortcut: 'f2' }
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* @example Disable completely
|
|
182
|
+
* ```ts
|
|
183
|
+
* { keyboardShortcut: false }
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
keyboardShortcut?: string | false;
|
|
187
|
+
/** When true, features that add motion respect `prefers-reduced-motion`. Default: `true`. */
|
|
188
|
+
respectReducedMotion?: boolean;
|
|
189
|
+
/** When true, the FAB is hidden in print media (`@media print`). Default: `true`. */
|
|
190
|
+
hideOnPrint?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* When true, normally-silent failures (localStorage quota, malformed
|
|
193
|
+
* persisted state, failed core fetch) emit `console.warn`. Production
|
|
194
|
+
* bundles should keep this `false` (default) to avoid noise.
|
|
195
|
+
*/
|
|
196
|
+
debug?: boolean;
|
|
197
|
+
}
|
|
198
|
+
export interface ProfilePreset {
|
|
199
|
+
features?: Partial<Record<FeatureId, boolean>>;
|
|
200
|
+
fontSizeLevel?: number;
|
|
201
|
+
lineHeightLevel?: number;
|
|
202
|
+
letterSpacingLevel?: number;
|
|
203
|
+
contrastMode?: ContrastMode;
|
|
204
|
+
}
|
|
205
|
+
export declare const DEFAULT_STATE: WidgetState;
|
|
206
|
+
export declare const PROFILES: Record<ProfileId, ProfilePreset>;
|
|
207
|
+
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/types/widget.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emits a console warning only when debug mode is enabled on
|
|
3
|
+
* `window.AccessibilityWidgetConfig.debug`. Silent by default so production
|
|
4
|
+
* bundles don't leak noise, but makes genuine failures discoverable when the
|
|
5
|
+
* developer opts in.
|
|
6
|
+
*/
|
|
7
|
+
export declare function warnIfDebug(message: string, error?: unknown): void;
|
|
8
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/util/debug.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAKlE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type AttrMap = Record<string, string | number | boolean | null | undefined>;
|
|
2
|
+
export type EventMap = Record<string, EventListener>;
|
|
3
|
+
export interface MakeOptions {
|
|
4
|
+
class?: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
attrs?: AttrMap;
|
|
7
|
+
on?: EventMap;
|
|
8
|
+
children?: (Node | null | undefined)[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Type-safe DOM builder. Intentionally does NOT accept raw HTML strings —
|
|
12
|
+
* all content is set via textContent or pre-built child nodes. This keeps
|
|
13
|
+
* the widget XSS-safe even if a future config field leaks untrusted input.
|
|
14
|
+
*/
|
|
15
|
+
export declare function make<K extends keyof HTMLElementTagNameMap>(tag: K, opts?: MakeOptions): HTMLElementTagNameMap[K];
|
|
16
|
+
export declare function toggleAttr(el: Element, name: string, value: string | number | null | undefined | false): void;
|
|
17
|
+
export declare function prefersReducedMotion(): boolean;
|
|
18
|
+
export declare function onceIdle(cb: () => void, timeout?: number): void;
|
|
19
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/util/dom.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AACnF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACxD,GAAG,EAAE,CAAC,EACN,IAAI,GAAE,WAAgB,GACrB,qBAAqB,CAAC,CAAC,CAAC,CAqB1B;AAED,wBAAgB,UAAU,CACxB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,GAChD,IAAI,CAMN;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,OAAO,SAAO,GAAG,IAAI,CAS7D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Locale, ProfileId, WidgetState } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Public event map. Events are dispatched as `CustomEvent` on `document`
|
|
4
|
+
* under the prefixed type name (`accessibility-widget:<name>`). Using
|
|
5
|
+
* the DOM event system keeps loader and core decoupled — neither needs
|
|
6
|
+
* to share a listener registry.
|
|
7
|
+
*/
|
|
8
|
+
export interface WidgetEventMap {
|
|
9
|
+
stateChange: {
|
|
10
|
+
state: WidgetState;
|
|
11
|
+
};
|
|
12
|
+
open: {
|
|
13
|
+
trigger?: HTMLElement | null;
|
|
14
|
+
};
|
|
15
|
+
close: Record<string, never>;
|
|
16
|
+
profileApplied: {
|
|
17
|
+
profile: ProfileId;
|
|
18
|
+
state: WidgetState;
|
|
19
|
+
};
|
|
20
|
+
localeChanged: {
|
|
21
|
+
locale: Locale;
|
|
22
|
+
};
|
|
23
|
+
reset: Record<string, never>;
|
|
24
|
+
}
|
|
25
|
+
export type WidgetEventName = keyof WidgetEventMap;
|
|
26
|
+
export declare function dispatchWidgetEvent<K extends WidgetEventName>(name: K, detail: WidgetEventMap[K]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Subscribe to a widget event. Returns an unsubscribe function.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const off = onWidgetEvent('stateChange', (e) => analytics.track('a11y', e.state));
|
|
33
|
+
* // later
|
|
34
|
+
* off();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function onWidgetEvent<K extends WidgetEventName>(name: K, handler: (detail: WidgetEventMap[K]) => void): () => void;
|
|
38
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/util/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,CAAC;IACpC,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,cAAc,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE,CAAC;IAC3D,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC;AAInD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,eAAe,EAC3D,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GACxB,IAAI,CAON;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EACrD,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,MAAM,IAAI,CAOZ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lucide-based pictograms for widget features and UI controls.
|
|
3
|
+
*
|
|
4
|
+
* All paths are taken from Lucide (https://lucide.dev, MIT license) and
|
|
5
|
+
* rendered via our programmatic buildIcon() — never innerHTML — so there is
|
|
6
|
+
* no XSS surface. Only the raw `d` data is shipped, no runtime dependency.
|
|
7
|
+
*
|
|
8
|
+
* Convention: every icon uses the shared 24x24 Lucide viewBox and
|
|
9
|
+
* `stroke: true`, which lets <svg> itself carry the stroke defaults
|
|
10
|
+
* (fill:none, stroke:currentColor, stroke-width:2, round caps) — path
|
|
11
|
+
* definitions therefore stay minimal and compress well under gzip.
|
|
12
|
+
*
|
|
13
|
+
* This module is imported ONLY from the panel (core bundle).
|
|
14
|
+
* The loader bundle never pulls it in, keeping the initial FAB payload tiny.
|
|
15
|
+
*/
|
|
16
|
+
import type { FeatureId } from '../types/index.js';
|
|
17
|
+
import type { SvgIconOptions } from './svg.js';
|
|
18
|
+
export declare const FEATURE_ICONS: Record<FeatureId, SvgIconOptions>;
|
|
19
|
+
/** Reset / undo (Lucide: rotate-ccw). */
|
|
20
|
+
export declare const ICON_RESET: SvgIconOptions;
|
|
21
|
+
/** Info / tooltip trigger (Lucide: info). */
|
|
22
|
+
export declare const ICON_INFO: SvgIconOptions;
|
|
23
|
+
/** Globe / language switcher (Lucide: globe). */
|
|
24
|
+
export declare const ICON_GLOBE: SvgIconOptions;
|
|
25
|
+
/** Oversized mode (Lucide: maximize-2). */
|
|
26
|
+
export declare const ICON_MAXIMIZE: SvgIconOptions;
|
|
27
|
+
/** Collapsible section chevron (Lucide: chevron-down). */
|
|
28
|
+
export declare const ICON_CHEVRON: SvgIconOptions;
|
|
29
|
+
/** Drag handle (Lucide: grip-horizontal) — filled dots. */
|
|
30
|
+
export declare const ICON_GRIP: SvgIconOptions;
|
|
31
|
+
/** Active state check mark (Lucide: check). */
|
|
32
|
+
export declare const ICON_CHECK: SvgIconOptions;
|
|
33
|
+
//# sourceMappingURL=feature-icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-icons.d.ts","sourceRoot":"","sources":["../../src/util/feature-icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,cAAc,CAyF3D,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,UAAU,EAAE,cAGxB,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,SAAS,EAAE,cAOvB,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,UAAU,EAAE,cAMxB,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,aAAa,EAAE,cAG3B,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,YAAY,EAAE,cAG1B,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,SAAS,EAAE,cASvB,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,UAAU,EAAE,cAGxB,CAAC"}
|