@contentful/field-editor-multiple-line 1.3.9 → 1.3.10

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 } = props;
57
+ const { field, locales, isInitiallyDisabled } = 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';
@@ -75,11 +75,8 @@ function MultipleLineEditor(props) {
75
75
  setValue(e.target.value);
76
76
  }
77
77
  }), _react.createElement("div", {
78
- className: _styles.validationRow(withCharValidation)
79
- }, _react.createElement(_fieldeditorshared.CharValidation, {
80
- constraints: constraints,
81
- enabled: withCharValidation
82
- }), _react.createElement(_fieldeditorshared.CharCounter, {
78
+ className: _styles.counterRow
79
+ }, _react.createElement(_fieldeditorshared.CharCounter, {
83
80
  value: value || '',
84
81
  checkConstraint: checkConstraint,
85
82
  constraints: constraints
@@ -87,6 +84,5 @@ function MultipleLineEditor(props) {
87
84
  });
88
85
  }
89
86
  MultipleLineEditor.defaultProps = {
90
- isInitiallyDisabled: true,
91
- withCharValidation: true
87
+ isInitiallyDisabled: true
92
88
  };
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ counterRow: function() {
13
+ return counterRow;
14
+ },
12
15
  rightToLeft: function() {
13
16
  return rightToLeft;
14
- },
15
- validationRow: function() {
16
- return validationRow;
17
17
  }
18
18
  });
19
19
  const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
@@ -23,13 +23,13 @@ function _interop_require_default(obj) {
23
23
  default: obj
24
24
  };
25
25
  }
26
- const validationRow = (withValidation)=>(0, _emotion.css)({
27
- display: 'flex',
28
- justifyContent: withValidation ? 'space-between' : 'flex-end',
29
- fontSize: _f36tokens.default.fontSizeM,
30
- marginTop: _f36tokens.default.spacingXs,
31
- color: _f36tokens.default.gray500
32
- });
26
+ const counterRow = (0, _emotion.css)({
27
+ float: 'right',
28
+ fontSize: _f36tokens.default.fontSizeM,
29
+ marginTop: _f36tokens.default.spacingXs,
30
+ marginLeft: _f36tokens.default.spacingS,
31
+ color: _f36tokens.default.gray500
32
+ });
33
33
  const rightToLeft = (0, _emotion.css)({
34
34
  direction: 'rtl'
35
35
  });
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { Textarea } from '@contentful/f36-components';
3
- import { FieldConnector, CharCounter, CharValidation, ConstraintsUtils } from '@contentful/field-editor-shared';
3
+ import { FieldConnector, CharCounter, 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 } = props;
6
+ const { field, locales, isInitiallyDisabled } = 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';
@@ -24,11 +24,8 @@ export function MultipleLineEditor(props) {
24
24
  setValue(e.target.value);
25
25
  }
26
26
  }), React.createElement("div", {
27
- className: styles.validationRow(withCharValidation)
28
- }, React.createElement(CharValidation, {
29
- constraints: constraints,
30
- enabled: withCharValidation
31
- }), React.createElement(CharCounter, {
27
+ className: styles.counterRow
28
+ }, React.createElement(CharCounter, {
32
29
  value: value || '',
33
30
  checkConstraint: checkConstraint,
34
31
  constraints: constraints
@@ -36,6 +33,5 @@ export function MultipleLineEditor(props) {
36
33
  });
37
34
  }
38
35
  MultipleLineEditor.defaultProps = {
39
- isInitiallyDisabled: true,
40
- withCharValidation: true
36
+ isInitiallyDisabled: true
41
37
  };
@@ -1,12 +1,12 @@
1
1
  import tokens from '@contentful/f36-tokens';
2
2
  import { css } from 'emotion';
3
- export const validationRow = (withValidation)=>css({
4
- display: 'flex',
5
- justifyContent: withValidation ? 'space-between' : 'flex-end',
6
- fontSize: tokens.fontSizeM,
7
- marginTop: tokens.spacingXs,
8
- color: tokens.gray500
9
- });
3
+ export const counterRow = css({
4
+ float: 'right',
5
+ fontSize: tokens.fontSizeM,
6
+ marginTop: tokens.spacingXs,
7
+ marginLeft: tokens.spacingS,
8
+ color: tokens.gray500
9
+ });
10
10
  export const rightToLeft = css({
11
11
  direction: 'rtl'
12
12
  });
@@ -5,10 +5,6 @@ export interface MultipleLineEditorProps {
5
5
  * is the field disabled initially
6
6
  */
7
7
  isInitiallyDisabled: boolean;
8
- /**
9
- * whether char validation should be shown or not
10
- */
11
- withCharValidation: boolean;
12
8
  /**
13
9
  * sdk.field
14
10
  */
@@ -22,6 +18,5 @@ export declare function MultipleLineEditor(props: MultipleLineEditorProps): JSX.
22
18
  export declare namespace MultipleLineEditor {
23
19
  var defaultProps: {
24
20
  isInitiallyDisabled: boolean;
25
- withCharValidation: boolean;
26
21
  };
27
22
  }
@@ -1,2 +1,2 @@
1
- export declare const validationRow: (withValidation: boolean) => string;
1
+ export declare const counterRow: string;
2
2
  export declare const rightToLeft: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-multiple-line",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@contentful/f36-components": "^4.0.27",
39
39
  "@contentful/f36-tokens": "^4.0.0",
40
- "@contentful/field-editor-shared": "^1.4.7",
40
+ "@contentful/field-editor-shared": "^1.4.8",
41
41
  "emotion": "^10.0.17",
42
42
  "lodash": "^4.17.15"
43
43
  },
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "registry": "https://npm.pkg.github.com/"
52
52
  },
53
- "gitHead": "129510a558258ae7eb0c53e7845868048a465ca7"
53
+ "gitHead": "1d7d630fe6f9576ee4cf35feed8badc8440acbf1"
54
54
  }