@contentful/field-editor-rich-text 3.19.1 → 3.19.3

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.
@@ -96,11 +96,12 @@ const ConnectedRichTextEditor = (props)=>{
96
96
  props.value,
97
97
  plugins
98
98
  ]);
99
+ const direction = sdk.locales.direction[sdk.field.locale] ?? 'ltr';
99
100
  const classNames = (0, _emotion.cx)(_RichTextEditorstyles.styles.editor, props.minHeight !== undefined ? (0, _emotion.css)({
100
101
  minHeight: props.minHeight
101
102
  }) : undefined, props.maxHeight !== undefined ? (0, _emotion.css)({
102
103
  maxHeight: props.maxHeight
103
- }) : undefined, props.isDisabled ? _RichTextEditorstyles.styles.disabled : _RichTextEditorstyles.styles.enabled, props.isToolbarHidden && _RichTextEditorstyles.styles.hiddenToolbar);
104
+ }) : undefined, props.isDisabled ? _RichTextEditorstyles.styles.disabled : _RichTextEditorstyles.styles.enabled, props.isToolbarHidden && _RichTextEditorstyles.styles.hiddenToolbar, direction === 'rtl' ? _RichTextEditorstyles.styles.rtl : _RichTextEditorstyles.styles.ltr);
104
105
  return _react.createElement(_SdkProvider.SdkProvider, {
105
106
  sdk: sdk
106
107
  }, _react.createElement(_ContentfulEditorProvider.ContentfulEditorIdProvider, {
@@ -63,5 +63,11 @@ const styles = {
63
63
  disabled: (0, _emotion.css)({
64
64
  background: _f36tokens.default.gray100,
65
65
  cursor: 'not-allowed'
66
+ }),
67
+ rtl: (0, _emotion.css)({
68
+ direction: 'rtl'
69
+ }),
70
+ ltr: (0, _emotion.css)({
71
+ direction: 'ltr'
66
72
  })
67
73
  };
@@ -90,6 +90,7 @@ const styles = {
90
90
  font-weight: ${_f36tokens.default.fontWeightMedium};
91
91
  line-height: 1.3;
92
92
  margin: 0 0 ${_f36tokens.default.spacingS};
93
+ direction: inherit;
93
94
  `,
94
95
  [_richtexttypes.BLOCKS.HEADING_1]: (0, _emotion.css)`
95
96
  font-size: 1.875rem;
@@ -41,6 +41,7 @@ const styles = {
41
41
  hyperlink: (0, _emotion.css)({
42
42
  fontSize: 'inherit !important',
43
43
  display: 'inline !important',
44
+ direction: 'inherit',
44
45
  '&:hover': {
45
46
  fill: _f36tokens.default.gray900,
46
47
  textDecoration: 'none'
@@ -69,6 +69,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
69
69
  const baseStyle = (0, _emotion.css)`
70
70
  padding: 0;
71
71
  margin: 0 0 1.25rem 1.25rem;
72
+ direction: inherit;
72
73
 
73
74
  div:first-child {
74
75
  margin: 0;
@@ -61,6 +61,7 @@ const style = (0, _emotion.css)`
61
61
  margin: 0;
62
62
  list-style: inherit;
63
63
  margin-top: ${_f36tokens.default.spacingXs};
64
+ direction: inherit;
64
65
 
65
66
  ol,
66
67
  ul {
@@ -62,6 +62,7 @@ const styles = {
62
62
  [_richtexttypes.BLOCKS.PARAGRAPH]: (0, _emotion.css)`
63
63
  line-height: ${_f36tokens.default.lineHeightDefault};
64
64
  margin-bottom: 1.5em;
65
+ direction: inherit;
65
66
  `
66
67
  };
67
68
  function Paragraph(props) {
@@ -32,11 +32,12 @@ export const ConnectedRichTextEditor = (props)=>{
32
32
  props.value,
33
33
  plugins
34
34
  ]);
35
+ const direction = sdk.locales.direction[sdk.field.locale] ?? 'ltr';
35
36
  const classNames = cx(styles.editor, props.minHeight !== undefined ? css({
36
37
  minHeight: props.minHeight
37
38
  }) : undefined, props.maxHeight !== undefined ? css({
38
39
  maxHeight: props.maxHeight
39
- }) : undefined, props.isDisabled ? styles.disabled : styles.enabled, props.isToolbarHidden && styles.hiddenToolbar);
40
+ }) : undefined, props.isDisabled ? styles.disabled : styles.enabled, props.isToolbarHidden && styles.hiddenToolbar, direction === 'rtl' ? styles.rtl : styles.ltr);
40
41
  return React.createElement(SdkProvider, {
41
42
  sdk: sdk
42
43
  }, React.createElement(ContentfulEditorIdProvider, {
@@ -48,5 +48,11 @@ export const styles = {
48
48
  disabled: css({
49
49
  background: tokens.gray100,
50
50
  cursor: 'not-allowed'
51
+ }),
52
+ rtl: css({
53
+ direction: 'rtl'
54
+ }),
55
+ ltr: css({
56
+ direction: 'ltr'
51
57
  })
52
58
  };
@@ -34,6 +34,7 @@ const styles = {
34
34
  font-weight: ${tokens.fontWeightMedium};
35
35
  line-height: 1.3;
36
36
  margin: 0 0 ${tokens.spacingS};
37
+ direction: inherit;
37
38
  `,
38
39
  [BLOCKS.HEADING_1]: css`
39
40
  font-size: 1.875rem;
@@ -26,6 +26,7 @@ export const styles = {
26
26
  hyperlink: css({
27
27
  fontSize: 'inherit !important',
28
28
  display: 'inline !important',
29
+ direction: 'inherit',
29
30
  '&:hover': {
30
31
  fill: tokens.gray900,
31
32
  textDecoration: 'none'
@@ -5,6 +5,7 @@ import { css, cx } from 'emotion';
5
5
  const baseStyle = css`
6
6
  padding: 0;
7
7
  margin: 0 0 1.25rem 1.25rem;
8
+ direction: inherit;
8
9
 
9
10
  div:first-child {
10
11
  margin: 0;
@@ -5,6 +5,7 @@ const style = css`
5
5
  margin: 0;
6
6
  list-style: inherit;
7
7
  margin-top: ${tokens.spacingXs};
8
+ direction: inherit;
8
9
 
9
10
  ol,
10
11
  ul {
@@ -6,6 +6,7 @@ const styles = {
6
6
  [BLOCKS.PARAGRAPH]: css`
7
7
  line-height: ${tokens.lineHeightDefault};
8
8
  margin-bottom: 1.5em;
9
+ direction: inherit;
9
10
  `
10
11
  };
11
12
  export function Paragraph(props) {
@@ -4,4 +4,6 @@ export declare const styles: {
4
4
  hiddenToolbar: string;
5
5
  enabled: string;
6
6
  disabled: string;
7
+ rtl: string;
8
+ ltr: string;
7
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "3.19.1",
3
+ "version": "3.19.3",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,7 +44,7 @@
44
44
  "@contentful/f36-icons": "^4.1.1",
45
45
  "@contentful/f36-tokens": "^4.0.0",
46
46
  "@contentful/f36-utils": "^4.19.0",
47
- "@contentful/field-editor-reference": "^5.24.0",
47
+ "@contentful/field-editor-reference": "^5.25.0",
48
48
  "@contentful/field-editor-shared": "^1.4.6",
49
49
  "@contentful/rich-text-plain-text-renderer": "^16.0.4",
50
50
  "@contentful/rich-text-types": "16.3.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "registry": "https://npm.pkg.github.com/"
88
88
  },
89
- "gitHead": "49604b4ca3f3eefb173d40e365352686e65eeaef"
89
+ "gitHead": "1df39db2c93daecf0236570e3656a965eabc5ae0"
90
90
  }