@wix/editor-react-components 1.2695.0 → 1.2697.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.
@@ -114,15 +114,7 @@ const noop = () => {
114
114
  function CollapsibleText(props) {
115
115
  var _a, _b, _c;
116
116
  const environmentService = useService(EnvironmentDefinition);
117
- const {
118
- id,
119
- className,
120
- text: text2,
121
- expandMode,
122
- link,
123
- linkText,
124
- tag: TagName = "p"
125
- } = props;
117
+ const { id, className, text: text2, expandMode, link, linkText } = props;
126
118
  const { readMoreText, readLessText } = props;
127
119
  const {
128
120
  onClick = noop,
@@ -130,7 +122,12 @@ function CollapsibleText(props) {
130
122
  onMouseIn = noop,
131
123
  onMouseOut = noop
132
124
  } = props;
133
- const { direction: textDirection, className: textClassNameProp } = ((_a = props.elementProps) == null ? void 0 : _a.text) ?? {};
125
+ const {
126
+ direction: textDirection,
127
+ className: textClassNameProp,
128
+ a11y: textA11y
129
+ } = ((_a = props.elementProps) == null ? void 0 : _a.text) ?? {};
130
+ const TagName = (textA11y == null ? void 0 : textA11y.tag) || "p";
134
131
  const { direction: buttonDirection } = ((_b = props.elementProps) == null ? void 0 : _b.button) ?? {};
135
132
  const textRef = useRef(null);
136
133
  const [isExpandRedundant, setIsExpandRedundant] = useState(false);
@@ -126,6 +126,13 @@ const manifest = {
126
126
  data: {
127
127
  direction: {
128
128
  dataType: DATA.DATA_TYPE.direction
129
+ },
130
+ a11y: {
131
+ dataType: DATA.DATA_TYPE.a11y,
132
+ [DATA.DATA_TYPE.a11y]: {
133
+ attributes: [DATA.A11Y_ATTRIBUTES.tag]
134
+ },
135
+ defaultValue: { tag: "p" }
129
136
  }
130
137
  },
131
138
  cssProperties: {
@@ -1,5 +1,5 @@
1
1
  import { LinkProps } from '../../../types/vendored/editor-elements-definitions';
2
- import { Direction } from '@wix/editor-react-types';
2
+ import { A11y, Direction } from '@wix/editor-react-types';
3
3
  import { ButtonProps } from '../Button/Button';
4
4
  import { SdkFunctionClickableProps, SdkFunctionMouseHoverProps } from '../../../utils/functions/sdkFunctionCallbackProps';
5
5
  export type ExpandMode = 'button' | 'link';
@@ -20,13 +20,12 @@ export type CollapsibleTextProps = SdkFunctionClickableProps & SdkFunctionMouseH
20
20
  readLessText: string;
21
21
  /** Label shown on the link control. Used only when `expandMode='link'`. */
22
22
  linkText: string;
23
- /** HTML tag used for the inner text element. Default `'p'`. */
24
- tag: string & keyof JSX.IntrinsicElements;
25
- /** Props forwarded to nested elements. `text.direction` sets writing direction on the text wrapper; `button` is the prop bag for the internal Button slot. */
23
+ /** Props forwarded to nested elements. `text.direction` sets writing direction on the text wrapper; `text.a11y.tag` sets the HTML tag of the text element (e.g. `h1`–`h6`, default `p`), independent of the font style; `button` is the prop bag for the internal Button slot. */
26
24
  elementProps: {
27
25
  text: {
28
26
  className?: string;
29
27
  direction: Direction;
28
+ a11y?: A11y;
30
29
  };
31
30
  button: Partial<ButtonProps> & {
32
31
  direction: Direction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2695.0",
3
+ "version": "1.2697.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": "f6e74ffc526bc8f49f8c46d19ba1d1e39d17b594ba4774c63f8628a3"
203
+ "falconPackageHash": "7d79912eb0df9ff1e056bf5eb61c973aec52d2340f03f42de7efa25a"
204
204
  }