@wix/editor-react-components 1.2701.0 → 1.2702.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,8 +3,9 @@ import { AriaProps } from '../../../../types/vendored/editor-elements-types-a11y
|
|
|
3
3
|
type UseButtonA11yParams = {
|
|
4
4
|
propsA11y?: A11y;
|
|
5
5
|
ariaAttributes?: AriaProps;
|
|
6
|
+
lang?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare function useButtonA11y({ propsA11y, ariaAttributes, }: UseButtonA11yParams): {
|
|
8
|
+
export declare function useButtonA11y({ propsA11y, ariaAttributes, lang, }: UseButtonA11yParams): {
|
|
8
9
|
tabIndex: 0 | -1 | undefined;
|
|
9
10
|
screenReader: {
|
|
10
11
|
prefix?: string | null;
|
|
@@ -228,7 +228,8 @@ const manifest = {
|
|
|
228
228
|
DATA.A11Y_ATTRIBUTES.ariaExpanded,
|
|
229
229
|
DATA.A11Y_ATTRIBUTES.ariaDisabled,
|
|
230
230
|
DATA.A11Y_ATTRIBUTES.ariaHaspopup,
|
|
231
|
-
DATA.A11Y_ATTRIBUTES.ariaLabel
|
|
231
|
+
DATA.A11Y_ATTRIBUTES.ariaLabel,
|
|
232
|
+
DATA.A11Y_ATTRIBUTES.lang
|
|
232
233
|
]
|
|
233
234
|
}
|
|
234
235
|
}
|
|
@@ -183,22 +183,35 @@ function useButtonEventHandlers({
|
|
|
183
183
|
}
|
|
184
184
|
function useButtonA11y({
|
|
185
185
|
propsA11y,
|
|
186
|
-
ariaAttributes
|
|
186
|
+
ariaAttributes,
|
|
187
|
+
lang
|
|
187
188
|
}) {
|
|
188
|
-
const normalizedA11y = useMemo(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
const normalizedA11y = useMemo(() => {
|
|
190
|
+
const {
|
|
191
|
+
lang: manifestLang,
|
|
192
|
+
tabIndex: manifestTabindex,
|
|
193
|
+
...manifestAriaAttributes
|
|
194
|
+
} = propsA11y ?? {};
|
|
195
|
+
return {
|
|
196
|
+
lang: manifestLang,
|
|
197
|
+
tabIndex: manifestTabindex,
|
|
198
|
+
ariaAttributes: removeAriaPrefix(manifestAriaAttributes)
|
|
199
|
+
};
|
|
200
|
+
}, [propsA11y]);
|
|
192
201
|
const a11yAttr = useMemo(
|
|
193
|
-
() =>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
() => {
|
|
203
|
+
var _a;
|
|
204
|
+
return getAccessibilityAttributesSpread({
|
|
205
|
+
ariaAttributes: {
|
|
206
|
+
...ariaAttributes,
|
|
207
|
+
...normalizedA11y.ariaAttributes,
|
|
208
|
+
label: (ariaAttributes == null ? void 0 : ariaAttributes.label) ?? normalizedA11y.ariaAttributes.label
|
|
209
|
+
},
|
|
210
|
+
tabIndex: normalizedA11y.tabIndex,
|
|
211
|
+
lang: ((lang == null ? void 0 : lang.trim()) ?? ((_a = normalizedA11y.lang) == null ? void 0 : _a.trim())) || void 0
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
[normalizedA11y, ariaAttributes, lang]
|
|
202
215
|
);
|
|
203
216
|
return a11yAttr;
|
|
204
217
|
}
|
|
@@ -377,14 +390,13 @@ const Button = (props) => {
|
|
|
377
390
|
onFocus,
|
|
378
391
|
onBlur
|
|
379
392
|
});
|
|
380
|
-
const a11yAttr = useButtonA11y({ propsA11y, ariaAttributes });
|
|
393
|
+
const a11yAttr = useButtonA11y({ propsA11y, ariaAttributes, lang });
|
|
381
394
|
const renderedLabel = labelContent ?? label2;
|
|
382
395
|
const wrapperAttributes = {
|
|
383
396
|
id,
|
|
384
397
|
...getDataAttributes(props),
|
|
385
398
|
...getQaDataAttributes(isQaMode, fullNameCompType),
|
|
386
399
|
"data-semantic-classname": semanticClassNames.root,
|
|
387
|
-
lang,
|
|
388
400
|
...direction && { dir: direction }
|
|
389
401
|
};
|
|
390
402
|
const renderButtonContent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2702.0",
|
|
4
4
|
"description": "React components for the Wix Editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -200,5 +200,5 @@
|
|
|
200
200
|
"registry": "https://registry.npmjs.org/",
|
|
201
201
|
"access": "public"
|
|
202
202
|
},
|
|
203
|
-
"falconPackageHash": "
|
|
203
|
+
"falconPackageHash": "fadc31f97beeeb5fe29aa725f343f53e9a61b8077278b74539011c80"
|
|
204
204
|
}
|