@contentful/field-editor-multiple-line 1.4.4 → 1.5.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.
@@ -54,7 +54,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
54
54
  return newObj;
55
55
  }
56
56
  function MultipleLineEditor(props) {
57
- const { field, locales, isInitiallyDisabled, withCharValidation, isDisabled } = props;
57
+ const { field, locales, isInitiallyDisabled, withCharValidation, isDisabled, id } = props;
58
58
  const constraints = _fieldeditorshared.ConstraintsUtils.fromFieldValidations(field.validations, field.type);
59
59
  const checkConstraint = _fieldeditorshared.ConstraintsUtils.makeChecker(constraints);
60
60
  const direction = locales.direction[field.locale] || 'ltr';
@@ -66,6 +66,7 @@ function MultipleLineEditor(props) {
66
66
  return _react.createElement("div", {
67
67
  "data-test-id": "multiple-line-editor"
68
68
  }, _react.createElement(_f36components.Textarea, {
69
+ id: id,
69
70
  className: direction === 'rtl' ? _styles.rightToLeft : '',
70
71
  rows: 3,
71
72
  isRequired: field.required,
@@ -3,7 +3,7 @@ import { Textarea } from '@contentful/f36-components';
3
3
  import { FieldConnector, CharCounter, CharValidation, ConstraintsUtils } from '@contentful/field-editor-shared';
4
4
  import * as styles from './styles';
5
5
  export function MultipleLineEditor(props) {
6
- const { field, locales, isInitiallyDisabled, withCharValidation, isDisabled } = props;
6
+ const { field, locales, isInitiallyDisabled, withCharValidation, isDisabled, id } = props;
7
7
  const constraints = ConstraintsUtils.fromFieldValidations(field.validations, field.type);
8
8
  const checkConstraint = ConstraintsUtils.makeChecker(constraints);
9
9
  const direction = locales.direction[field.locale] || 'ltr';
@@ -15,6 +15,7 @@ export function MultipleLineEditor(props) {
15
15
  return React.createElement("div", {
16
16
  "data-test-id": "multiple-line-editor"
17
17
  }, React.createElement(Textarea, {
18
+ id: id,
18
19
  className: direction === 'rtl' ? styles.rightToLeft : '',
19
20
  rows: 3,
20
21
  isRequired: field.required,
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FieldAPI, LocalesAPI } from '@contentful/field-editor-shared';
2
+ import { type FieldAPI, type LocalesAPI } from '@contentful/field-editor-shared';
3
3
  export interface MultipleLineEditorProps {
4
4
  /**
5
5
  * is the field disabled initially
@@ -17,7 +17,14 @@ export interface MultipleLineEditorProps {
17
17
  * sdk.locales
18
18
  */
19
19
  locales: LocalesAPI;
20
+ /**
21
+ * alias for disabled native property
22
+ */
20
23
  isDisabled?: boolean;
24
+ /**
25
+ * id used for associating the input field with its label
26
+ */
27
+ id?: string;
21
28
  }
22
29
  export declare function MultipleLineEditor(props: MultipleLineEditorProps): React.JSX.Element;
23
30
  export declare namespace MultipleLineEditor {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-multiple-line",
3
- "version": "1.4.4",
3
+ "version": "1.5.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "registry": "https://npm.pkg.github.com/"
52
52
  },
53
- "gitHead": "1d0dc6dc10cf4ad43aa48b04fa67d29ab7edaee8"
53
+ "gitHead": "7ec565308c8d4da384b8fec6f5d840bdf6d4927d"
54
54
  }