sanity-plugin-all-in-one-accessibility 1.1.2 → 1.1.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 +58 -51
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,12 +34,12 @@ Businesses, developers, agencies, content teams, ecommerce brands, educational i
|
|
|
34
34
|
|
|
35
35
|
- Aligns with global accessibility standards.
|
|
36
36
|
- Improves usability for people with visual, cognitive, and motor impairments.
|
|
37
|
-
-
|
|
37
|
+
- Integrates smoothly with most Sanity themes and templates.
|
|
38
38
|
- Supports multisite setups for global reach.
|
|
39
39
|
- Free support from our team for installation and queries.
|
|
40
40
|
- Core features at no cost.
|
|
41
41
|
|
|
42
|
-
## Free vs
|
|
42
|
+
## Free vs Paid
|
|
43
43
|
|
|
44
44
|
See the full [free widget vs paid app comparison](https://www.skynettechnologies.com/installation-guide/free-vs-paid-accessibility-widget-comparison-video).
|
|
45
45
|
|
|
@@ -65,7 +65,7 @@ Yes. It supports 190+ languages.
|
|
|
65
65
|
|
|
66
66
|
**Which languages do the screen reader, virtual keyboard, and other advanced features support?**
|
|
67
67
|
|
|
68
|
-
In the paid app, Screen Reader
|
|
68
|
+
The widget interface supports 190+ languages. In the paid app, Screen Reader supports 100+, Voice Navigation 50+, Talk & Type 50+, Virtual Keyboard 40+, Dictionary Search 20+, and Live Site Translation 160+. [See language support details](https://www.skynettechnologies.com/all-in-one-accessibility/languages).
|
|
69
69
|
|
|
70
70
|
**How can I upgrade from the free widget to the paid app?**
|
|
71
71
|
|
|
@@ -73,11 +73,15 @@ Upgrade to a paid subscription with 100+ advanced features. Check out the [upgra
|
|
|
73
73
|
|
|
74
74
|
**What additional features are available in the paid version?**
|
|
75
75
|
|
|
76
|
-
The paid app includes a screen reader, voice navigation, talk & type, virtual keyboard, dictionary search, 12 accessibility profiles tailored for different disability groups, Libras (Brazilian Sign Language), automated compliance accessibility reports, AI-based remediation guidelines, and more. Explore the [paid accessibility app](https://www.skynettechnologies.com/all-in-one-accessibility) and buy now.
|
|
76
|
+
The paid app includes a screen reader, voice navigation, talk & type, virtual keyboard, dictionary search, 12 accessibility profiles tailored for different disability groups, Libras (Brazilian Sign Language), American Sign Language, automated compliance accessibility reports, AI-based remediation guidelines, and more. Explore the [paid accessibility app](https://www.skynettechnologies.com/all-in-one-accessibility) and buy now.
|
|
77
77
|
|
|
78
|
-
**Can I try
|
|
78
|
+
**Can I try the paid app before buying?**
|
|
79
79
|
|
|
80
|
-
Yes.
|
|
80
|
+
Yes. The paid app comes with a [10-day free trial](https://ada.skynettechnologies.us/trial-subscription) that includes all features.
|
|
81
|
+
|
|
82
|
+
**Which themes are supported?**
|
|
83
|
+
|
|
84
|
+
Any website frontend that renders your Sanity content, such as plain HTML and React / Next.js sites, and many more.
|
|
81
85
|
|
|
82
86
|
## Supported Languages (190+)
|
|
83
87
|
|
|
@@ -85,37 +89,41 @@ English (USA), English (UK), English (Australian), English (Canadian), English (
|
|
|
85
89
|
|
|
86
90
|
## Prerequisites
|
|
87
91
|
|
|
88
|
-
- Sanity Studio v4 or
|
|
92
|
+
- Sanity Studio v4, v5 or v6 (React 18 or 19)
|
|
89
93
|
- Node.js 20.19+ or 22.12+
|
|
90
94
|
|
|
91
|
-
- Tested and verified on Sanity Studio 6.
|
|
95
|
+
- Tested and verified on Sanity Studio 6.24
|
|
92
96
|
|
|
93
97
|
## Installation
|
|
94
98
|
|
|
95
99
|
1. Install the plugin in your Sanity Studio project:
|
|
96
100
|
|
|
97
|
-
```sh
|
|
98
|
-
npm install sanity-plugin-all-in-one-accessibility
|
|
99
|
-
```
|
|
101
|
+
```sh
|
|
102
|
+
npm install sanity-plugin-all-in-one-accessibility
|
|
103
|
+
```
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
import {defineConfig} from 'sanity'
|
|
105
|
-
import {AllinOneAccessibilityPlugin} from 'sanity-plugin-all-in-one-accessibility'
|
|
106
|
-
|
|
107
|
-
export default defineConfig({
|
|
108
|
-
//...
|
|
109
|
-
plugins: [
|
|
110
|
-
AllinOneAccessibilityPlugin({
|
|
111
|
-
// Optional: the website the widget runs on (default: the Studio's hostname)
|
|
112
|
-
websiteUrl: 'www.your-website.com',
|
|
113
|
-
}),
|
|
114
|
-
],
|
|
115
|
-
})
|
|
116
|
-
```
|
|
105
|
+
2. Add it as a plugin in `sanity.config.ts` (or `.js`). The options are described under [Plugin options](#plugin-options).
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import {defineConfig} from 'sanity'
|
|
109
|
+
import {AllinOneAccessibilityPlugin} from 'sanity-plugin-all-in-one-accessibility'
|
|
117
110
|
|
|
118
|
-
|
|
111
|
+
export default defineConfig({
|
|
112
|
+
//...
|
|
113
|
+
plugins: [
|
|
114
|
+
AllinOneAccessibilityPlugin({
|
|
115
|
+
// Optional: the website the widget runs on (default: the Studio's hostname)
|
|
116
|
+
websiteUrl: 'www.your-website.com',
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
3. Add the widget script to the **header** or **footer** of your website frontend, as shown in [Add the Script](#add-the-script).
|
|
123
|
+
|
|
124
|
+
### Plugin options
|
|
125
|
+
|
|
126
|
+
All options are optional.
|
|
119
127
|
|
|
120
128
|
| Option | Default | Description |
|
|
121
129
|
| --- | --- | --- |
|
|
@@ -123,13 +131,11 @@ export default defineConfig({
|
|
|
123
131
|
| `username` | The signed-in Sanity user's name | Admin name sent once, when a new website is registered for the free widget. |
|
|
124
132
|
| `email` | The signed-in Sanity user's email | Admin email sent once, when a new website is registered (falls back to `no-reply@<website>`). |
|
|
125
133
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
## Add the Script
|
|
134
|
+
### Add the Script
|
|
129
135
|
|
|
130
136
|
Place the following script in the **header** or **footer** section of your website or frontend:
|
|
131
137
|
|
|
132
|
-
|
|
138
|
+
#### Option A: Plain HTML
|
|
133
139
|
|
|
134
140
|
Place this script before the closing `</body>` tag (or in the footer template).
|
|
135
141
|
|
|
@@ -137,7 +143,7 @@ Place this script before the closing `</body>` tag (or in the footer template).
|
|
|
137
143
|
<script id="aioa-adawidget" src="https://www.skynettechnologies.com/accessibility/js/all-in-one-accessibility-js-widget-minify.js?colorcode=#420083&token=&position=bottom_right"></script>
|
|
138
144
|
```
|
|
139
145
|
|
|
140
|
-
|
|
146
|
+
#### Option B: React/Next.js
|
|
141
147
|
|
|
142
148
|
Add this to a client component (e.g., your layout or a top-level page). The script loads the widget after a short delay to avoid blocking page rendering.
|
|
143
149
|
|
|
@@ -155,17 +161,17 @@ setTimeout(() => {
|
|
|
155
161
|
}, 5000);
|
|
156
162
|
```
|
|
157
163
|
|
|
158
|
-
|
|
164
|
+
### EU Region Support (Recommended for EU-Based Websites)
|
|
159
165
|
|
|
160
166
|
If your website or business operates in the **European Union (EU)**, use the **EU region–hosted script** to improve performance for EU users and better align with GDPR and EU data residency requirements.
|
|
161
167
|
|
|
162
|
-
|
|
168
|
+
#### EU Script Base URL
|
|
163
169
|
|
|
164
170
|
```text
|
|
165
171
|
https://eu.skynettechnologies.com/accessibility/js/all-in-one-accessibility-js-widget-minify.js
|
|
166
172
|
```
|
|
167
173
|
|
|
168
|
-
|
|
174
|
+
#### Option A: Plain HTML (EU Region)
|
|
169
175
|
|
|
170
176
|
```html
|
|
171
177
|
<script
|
|
@@ -174,7 +180,7 @@ https://eu.skynettechnologies.com/accessibility/js/all-in-one-accessibility-js-w
|
|
|
174
180
|
</script>
|
|
175
181
|
```
|
|
176
182
|
|
|
177
|
-
|
|
183
|
+
#### Option B: React / Next.js (EU Region)
|
|
178
184
|
|
|
179
185
|
```typescript
|
|
180
186
|
function load_aioa_script() {
|
|
@@ -196,19 +202,20 @@ Check out our [**Sanity WCAG accessibility widget installation steps**](https://
|
|
|
196
202
|
|
|
197
203
|
## Configuration
|
|
198
204
|
|
|
199
|
-
Configure the widget from Sanity
|
|
205
|
+
Configure the widget from the Sanity admin panel.
|
|
200
206
|
|
|
201
207
|
**Path:** Sanity Studio → **All in One Accessibility** (top navigation)
|
|
202
208
|
|
|
203
209
|
**Steps:**
|
|
204
210
|
|
|
205
|
-
1. Log in to
|
|
206
|
-
2.
|
|
207
|
-
3.
|
|
208
|
-
4.
|
|
209
|
-
|
|
211
|
+
1. Log in to the Sanity admin panel.
|
|
212
|
+
2. Navigate to Sanity Studio → **All in One Accessibility** (top navigation).
|
|
213
|
+
3. Configure options (color, icon type, position, size).
|
|
214
|
+
4. Save your changes.
|
|
215
|
+
|
|
216
|
+
An exact position can be set from 0 to 500 px and an exact icon size from 24 to 150 px. On a paid plan, the **Paid Features** tab (widget position for mobile, custom links, widget switches), the **Accessibility Score** tab and the **Dashboard** button are also available.
|
|
210
217
|
|
|
211
|
-
|
|
218
|
+
A website that is not registered yet is registered for the free widget the first time the tool opens. The website domain and the admin's name and email (the signed-in Sanity user, or the `username` / `email` plugin options) are then sent to Skynet Technologies, and your browser's location is checked once with ipapi.co to tell whether you are in the EU. If your Studio has a Content Security Policy, allow the domains in the CORS table below in `connect-src`.
|
|
212
219
|
|
|
213
220
|
## Demo
|
|
214
221
|
|
|
@@ -224,13 +231,13 @@ To avoid CORS policy issues, ensure the following URLs are allowed on your websi
|
|
|
224
231
|
| --- | --- | --- |
|
|
225
232
|
| https://\*.skynettechnologies.com | Skynet Technologies (Global Domain) | API access and resources |
|
|
226
233
|
| https://\*.skynettechnologies.us | Skynet Technologies (US Domain) | API access and resources |
|
|
227
|
-
|
|
|
234
|
+
| https://skynetaccessibilityscan.com | SkynetAccessibility Scanner | Accessibility scan results and score |
|
|
228
235
|
| https://\*.googleapis.com | Google APIs | Services like Fonts, Translation |
|
|
229
236
|
| https://\*.gstatic.com | Fonts APIs | Custom Fonts |
|
|
230
|
-
|
|
|
231
|
-
|
|
|
237
|
+
| https://vlibras.gov.br | VLibras – Brazilian Sign Language Service | Sign Language |
|
|
238
|
+
| https://ipapi.co | ipapi – IP Geolocation API | Called once during installation to detect an EU location and add the EU-based widget script (endpoint: `/json/`) |
|
|
232
239
|
|
|
233
|
-
|
|
240
|
+
**Instructions**
|
|
234
241
|
|
|
235
242
|
1. Update your server's CORS configuration to include these URLs.
|
|
236
243
|
2. Ensure wildcard subdomains (\*) are supported where necessary.
|
|
@@ -246,11 +253,11 @@ To avoid CORS policy issues, ensure the following URLs are allowed on your websi
|
|
|
246
253
|
|
|
247
254
|
## Support
|
|
248
255
|
|
|
249
|
-
|
|
256
|
+
**Submit a Support Request**
|
|
250
257
|
|
|
251
258
|
Visit our [**support page**](https://www.skynettechnologies.com/report-accessibility-problem) and fill out the form. Our team will get back to you as soon as possible.
|
|
252
259
|
|
|
253
|
-
|
|
260
|
+
**Send Us an Email**
|
|
254
261
|
|
|
255
262
|
Email our support team: [**hello@skynettechnologies.com**](mailto:hello@skynettechnologies.com)
|
|
256
263
|
|
|
@@ -298,7 +305,7 @@ Remove the Skynet Technologies logo and all footer links, popups, the "report a
|
|
|
298
305
|
|
|
299
306
|
[**Instant Live Site Translations**](https://www.skynettechnologies.com/all-in-one-accessibility/addons#accessibility-widget-add-ons)
|
|
300
307
|
|
|
301
|
-
Translate your website into
|
|
308
|
+
Translate your website into 160+ languages instantly to enhance accessibility for non-native speakers, individuals with language acquisition difficulties, and those with learning disabilities.
|
|
302
309
|
|
|
303
310
|
[**Modify Accessibility Menu**](https://www.skynettechnologies.com/all-in-one-accessibility/addons#accessibility-widget-add-ons)
|
|
304
311
|
|
package/dist/index.js
CHANGED
|
@@ -338,12 +338,15 @@ function base64(value) {
|
|
|
338
338
|
binary += String.fromCharCode(byte);
|
|
339
339
|
return window.btoa(binary);
|
|
340
340
|
}
|
|
341
|
-
const LINKS = ["statement_link", "report_problem_link"], POSITION_MESSAGE =
|
|
341
|
+
const LINKS = ["statement_link", "report_problem_link"], OFFSET_MAX = 500, POSITION_MESSAGE = `Enter a horizontal and a vertical position from 0 to ${OFFSET_MAX} px.`, POSITION_HINT = `0 - ${OFFSET_MAX}px are permitted values`, SIZE_MIN = 24, SIZE_MAX = 150, SIZE_MESSAGE = `Enter an exact icon size from ${SIZE_MIN} to ${SIZE_MAX} px.`, SIZE_HINT = `${SIZE_MIN} - ${SIZE_MAX}px are permitted values`;
|
|
342
342
|
function isValidIconSize(value) {
|
|
343
343
|
const size = wholeNumber(value, null);
|
|
344
344
|
return size !== null && size >= SIZE_MIN && size <= SIZE_MAX;
|
|
345
345
|
}
|
|
346
|
-
const POSITION_VALUES = AIOA_POSITIONS.flatMap((pos) => pos ? [pos[0]] : []), ICON_SIZE_VALUES = AIOA_ICON_SIZES.map((size) => size[0]), isSet = (value) => value != null && value !== "", isOn = (value) => Number(value) === 1, num$1 = (value) => wholeNumber(value, 0),
|
|
346
|
+
const POSITION_VALUES = AIOA_POSITIONS.flatMap((pos) => pos ? [pos[0]] : []), ICON_SIZE_VALUES = AIOA_ICON_SIZES.map((size) => size[0]), isSet = (value) => value != null && value !== "", isOn = (value) => Number(value) === 1, num$1 = (value) => wholeNumber(value, 0), clampOffset = (value) => String(Math.min(Math.max(num$1(value), 0), OFFSET_MAX));
|
|
347
|
+
function savedSide(first, second) {
|
|
348
|
+
return num$1(first) > 0 ? "first" : num$1(second) > 0 || isSet(second) && !isSet(first) ? "second" : "first";
|
|
349
|
+
}
|
|
347
350
|
function gridPosition(value) {
|
|
348
351
|
const position = positionValue(value);
|
|
349
352
|
return POSITION_VALUES.includes(position) ? position : "bottom_right";
|
|
@@ -352,7 +355,7 @@ function emptyAppearance() {
|
|
|
352
355
|
return appearanceFrom({});
|
|
353
356
|
}
|
|
354
357
|
function appearanceFrom(result) {
|
|
355
|
-
const hex = parseHex(result.widget_color_code || AIOA_DEFAULTS.widget_color_code) || AIOA_DEFAULT_COLOR, iconType = String(result.widget_icon_type || AIOA_DEFAULTS.widget_icon_type), iconSize = String(result.widget_icon_size || AIOA_DEFAULTS.widget_icon_size),
|
|
358
|
+
const hex = parseHex(result.widget_color_code || AIOA_DEFAULTS.widget_color_code) || AIOA_DEFAULT_COLOR, iconType = String(result.widget_icon_type || AIOA_DEFAULTS.widget_icon_type), iconSize = String(result.widget_icon_size || AIOA_DEFAULTS.widget_icon_size), useLeft = savedSide(result.widget_position_right, result.widget_position_left) === "second", useTop = savedSide(result.widget_position_bottom, result.widget_position_top) === "second";
|
|
356
359
|
return {
|
|
357
360
|
colorText: hex,
|
|
358
361
|
color: hex,
|
|
@@ -360,11 +363,10 @@ function appearanceFrom(result) {
|
|
|
360
363
|
widgetSize: String(result.widget_size) === "1" ? "1" : "0",
|
|
361
364
|
customPosition: Number(result.is_widget_custom_position) === 1,
|
|
362
365
|
position: gridPosition(result.widget_position || AIOA_DEFAULTS.widget_position),
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
yDir: bottom > 0 || !(top > 0) ? "cust-pos-to-the-lower" : "cust-pos-to-the-upper",
|
|
366
|
+
x: clampOffset(useLeft ? result.widget_position_left : result.widget_position_right),
|
|
367
|
+
xDir: useLeft ? "cust-pos-to-the-left" : "cust-pos-to-the-right",
|
|
368
|
+
y: clampOffset(useTop ? result.widget_position_top : result.widget_position_bottom),
|
|
369
|
+
yDir: useTop ? "cust-pos-to-the-upper" : "cust-pos-to-the-lower",
|
|
368
370
|
positionCheck: !1,
|
|
369
371
|
iconType: /^aioa-icon-type-([1-9]|1\d|2\d)$/.test(iconType) ? iconType : "aioa-icon-type-1",
|
|
370
372
|
customSize: Number(result.is_widget_custom_size) === 1,
|
|
@@ -376,9 +378,9 @@ function appearanceFrom(result) {
|
|
|
376
378
|
function paidFrom(result) {
|
|
377
379
|
const r = result || {};
|
|
378
380
|
let mxDir = "right", mx = clampOffset(r.widget_position_right_mobile);
|
|
379
|
-
isSet(r.widget_position_horizontal_center_offset_mobile) ? (mxDir = "center", mx = clampOffset(r.widget_position_horizontal_center_offset_mobile)) :
|
|
381
|
+
isSet(r.widget_position_horizontal_center_offset_mobile) ? (mxDir = "center", mx = clampOffset(r.widget_position_horizontal_center_offset_mobile)) : savedSide(r.widget_position_right_mobile, r.widget_position_left_mobile) === "second" && (mxDir = "left", mx = clampOffset(r.widget_position_left_mobile));
|
|
380
382
|
let myDir = "bottom", my = clampOffset(r.widget_position_bottom_mobile);
|
|
381
|
-
return
|
|
383
|
+
return savedSide(r.widget_position_bottom_mobile, r.widget_position_top_mobile) === "second" && (myDir = "top", my = clampOffset(r.widget_position_top_mobile)), {
|
|
382
384
|
statement_link: typeof r.statement_link == "string" ? r.statement_link : "",
|
|
383
385
|
report_problem_link: typeof r.report_problem_link == "string" ? r.report_problem_link : "",
|
|
384
386
|
linkErrors: { statement_link: "", report_problem_link: "" },
|
|
@@ -436,7 +438,7 @@ function collect(appearanceIn, paidIn, domain, isPaid) {
|
|
|
436
438
|
focus: appearance.x.trim() === "" ? "x" : "y",
|
|
437
439
|
name: "Widget position",
|
|
438
440
|
title: "Position missing",
|
|
439
|
-
message:
|
|
441
|
+
message: `Enter the exact position (0 - ${OFFSET_MAX} px), or turn off "Set an exact position in pixels".`
|
|
440
442
|
})), appearance.customSize && !isValidIconSize(appearance.iconSizeCustom) && (appearance = { ...appearance, sizeCheck: !0 }, problems.push({
|
|
441
443
|
tab: "appearance",
|
|
442
444
|
focus: "iconSizeCustom",
|
|
@@ -449,7 +451,7 @@ function collect(appearanceIn, paidIn, domain, isPaid) {
|
|
|
449
451
|
focus: paid.mx.trim() === "" ? "mx" : "my",
|
|
450
452
|
name: "Widget position for mobile (Paid Features)",
|
|
451
453
|
title: "Mobile position missing",
|
|
452
|
-
message:
|
|
454
|
+
message: `Enter the exact mobile position (0 - ${OFFSET_MAX} px) on the Paid Features tab.`
|
|
453
455
|
}));
|
|
454
456
|
const linkErrors = { ...paid.linkErrors }, links = {
|
|
455
457
|
statement_link: paid.statement_link,
|
|
@@ -862,7 +864,7 @@ function PositionSection({ state, update, refs }) {
|
|
|
862
864
|
}
|
|
863
865
|
)
|
|
864
866
|
] }),
|
|
865
|
-
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-pos-range-hint", children:
|
|
867
|
+
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-pos-range-hint", children: POSITION_HINT }),
|
|
866
868
|
/* @__PURE__ */ jsx("p", { className: "aioa-error", id: "aioa-pos-error", hidden: !state.positionCheck, children: state.positionCheck ? POSITION_MESSAGE : "" })
|
|
867
869
|
] })
|
|
868
870
|
] });
|
|
@@ -971,7 +973,7 @@ function IconSizeSection({ state, update, refs }) {
|
|
|
971
973
|
),
|
|
972
974
|
/* @__PURE__ */ jsx("span", { className: "aioa-affix-text", "aria-hidden": "true", children: "px" })
|
|
973
975
|
] }),
|
|
974
|
-
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-size-range-hint", children:
|
|
976
|
+
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-size-range-hint", children: SIZE_HINT }),
|
|
975
977
|
/* @__PURE__ */ jsx("p", { className: "aioa-error", id: "aioa-size-error", hidden: !state.sizeCheck, children: state.sizeCheck ? SIZE_MESSAGE : "" })
|
|
976
978
|
] })
|
|
977
979
|
] });
|
|
@@ -1422,7 +1424,7 @@ function MobilePosition({
|
|
|
1422
1424
|
}
|
|
1423
1425
|
)
|
|
1424
1426
|
] }),
|
|
1425
|
-
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-mobile-range-hint", children:
|
|
1427
|
+
/* @__PURE__ */ jsx("p", { className: "aioa-hint", id: "aioa-mobile-range-hint", children: POSITION_HINT }),
|
|
1426
1428
|
/* @__PURE__ */ jsx("p", { className: "aioa-error", id: "aioa-mobile-pos-error", hidden: !state.mobileCheck, children: state.mobileCheck ? POSITION_MESSAGE : "" })
|
|
1427
1429
|
] })
|
|
1428
1430
|
]
|