@wix/editor-react-components 1.2377.0 → 1.2379.0
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.
|
@@ -3,9 +3,8 @@ import { AriaProps } from '../../../../types/vendored/editor-elements-types-a11y
|
|
|
3
3
|
type UseButtonA11yParams = {
|
|
4
4
|
propsA11y?: A11y;
|
|
5
5
|
ariaAttributes?: AriaProps;
|
|
6
|
-
label: string;
|
|
7
6
|
};
|
|
8
|
-
export declare function useButtonA11y({ propsA11y, ariaAttributes,
|
|
7
|
+
export declare function useButtonA11y({ propsA11y, ariaAttributes, }: UseButtonA11yParams): {
|
|
9
8
|
tabIndex: 0 | -1 | undefined;
|
|
10
9
|
screenReader: {
|
|
11
10
|
prefix?: string | null;
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as clsx } from "../chunks/clsx.js";
|
|
3
3
|
import { f as formatClassNames } from "../chunks/classNames.js";
|
|
4
4
|
import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { e as getTabIndexAttribute, f as convertA11yKeysToHtmlFormat } from "../chunks/a11y.js";
|
|
6
6
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
7
7
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
8
8
|
import { E as EnvironmentDefinition } from "../chunks/index2.js";
|
|
@@ -32,8 +32,16 @@ const Line = (props) => {
|
|
|
32
32
|
);
|
|
33
33
|
const environmentDirection = getLanguageDirection();
|
|
34
34
|
const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
|
|
35
|
-
const { tabIndex, ...
|
|
36
|
-
const
|
|
35
|
+
const { tabIndex, ariaLabel, ...restA11y } = a11y || {};
|
|
36
|
+
const accessibleName = ariaLabel == null ? void 0 : ariaLabel.trim();
|
|
37
|
+
const a11yAttributes = {
|
|
38
|
+
...convertA11yKeysToHtmlFormat(restA11y),
|
|
39
|
+
...getTabIndexAttribute(a11y),
|
|
40
|
+
...accessibleName && {
|
|
41
|
+
role: "img",
|
|
42
|
+
"aria-label": accessibleName
|
|
43
|
+
}
|
|
44
|
+
};
|
|
37
45
|
return /* @__PURE__ */ jsx("div", { className: presetWrapperStyles.presetWrapper, ...presetsWrapperProps, children: /* @__PURE__ */ jsx(
|
|
38
46
|
"div",
|
|
39
47
|
{
|
|
@@ -47,7 +55,6 @@ const Line = (props) => {
|
|
|
47
55
|
"line-wrapper"
|
|
48
56
|
),
|
|
49
57
|
...getDataAttributes(props),
|
|
50
|
-
...getTabIndexAttribute(a11y),
|
|
51
58
|
...a11yAttributes,
|
|
52
59
|
onMouseEnter,
|
|
53
60
|
onMouseLeave,
|
|
@@ -177,8 +177,7 @@ function useButtonEventHandlers({
|
|
|
177
177
|
}
|
|
178
178
|
function useButtonA11y({
|
|
179
179
|
propsA11y,
|
|
180
|
-
ariaAttributes
|
|
181
|
-
label: label2
|
|
180
|
+
ariaAttributes
|
|
182
181
|
}) {
|
|
183
182
|
const normalizedA11y = useMemo(
|
|
184
183
|
() => removeAriaPrefix(propsA11y ?? {}),
|
|
@@ -189,11 +188,11 @@ function useButtonA11y({
|
|
|
189
188
|
ariaAttributes: {
|
|
190
189
|
...ariaAttributes,
|
|
191
190
|
...normalizedA11y,
|
|
192
|
-
label: (ariaAttributes == null ? void 0 : ariaAttributes.label) ??
|
|
191
|
+
label: (ariaAttributes == null ? void 0 : ariaAttributes.label) ?? normalizedA11y.label
|
|
193
192
|
},
|
|
194
193
|
tabindex: normalizedA11y == null ? void 0 : normalizedA11y.tabindex
|
|
195
194
|
}),
|
|
196
|
-
[normalizedA11y,
|
|
195
|
+
[normalizedA11y, ariaAttributes]
|
|
197
196
|
);
|
|
198
197
|
return a11yAttr;
|
|
199
198
|
}
|
|
@@ -271,7 +270,7 @@ const Button = (props) => {
|
|
|
271
270
|
onFocus,
|
|
272
271
|
onBlur
|
|
273
272
|
});
|
|
274
|
-
const a11yAttr = useButtonA11y({ propsA11y, ariaAttributes
|
|
273
|
+
const a11yAttr = useButtonA11y({ propsA11y, ariaAttributes });
|
|
275
274
|
const renderedLabel = labelContent ?? label2;
|
|
276
275
|
const wrapperAttributes = {
|
|
277
276
|
id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2379.0",
|
|
4
4
|
"description": "React components for the Wix Editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"test:a11y": "a11y-audit-tool-plugin audit"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@wix/editor-react-types": "^1.0.
|
|
71
|
+
"@wix/editor-react-types": "^1.0.73",
|
|
72
72
|
"react": "^18.2.0",
|
|
73
73
|
"react-dom": "^18.2.0"
|
|
74
74
|
},
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@wix/design-system-illustrations": "^2.19.0",
|
|
82
82
|
"@wix/sdk": "^1.21.13",
|
|
83
83
|
"@wix/services-manager-react": "^0.1.27",
|
|
84
|
-
"@wix/site-ui": "1.
|
|
84
|
+
"@wix/site-ui": "1.167.0",
|
|
85
85
|
"@wix/video": "^1.85.0",
|
|
86
86
|
"@wix/viewer-service-consent-policy": "^1.0.100",
|
|
87
87
|
"@wix/web-bi-logger": "^2.1.26",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@wix/editor": "^1.586.0",
|
|
123
123
|
"@wix/editor-elements-scripts": "^1.0.0",
|
|
124
124
|
"@wix/editor-elements-test-utils": "^1.0.0",
|
|
125
|
-
"@wix/editor-react-types": "^1.0.
|
|
125
|
+
"@wix/editor-react-types": "^1.0.73",
|
|
126
126
|
"@wix/essentials": "^0.1.28",
|
|
127
127
|
"@wix/fed-cli-sled": "^1.0.28",
|
|
128
128
|
"@wix/image": "^1.437.0",
|
|
@@ -195,5 +195,5 @@
|
|
|
195
195
|
"registry": "https://registry.npmjs.org/",
|
|
196
196
|
"access": "public"
|
|
197
197
|
},
|
|
198
|
-
"falconPackageHash": "
|
|
198
|
+
"falconPackageHash": "e1c9f7054e50ffe0584863c2124abbb8a425baa404dbc6e1724d7601"
|
|
199
199
|
}
|