@contentful/field-editor-rating 1.4.37 → 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.
@@ -79,7 +79,7 @@ function RatingEditor(props) {
79
79
  'instance',
80
80
  'stars'
81
81
  ]));
82
- return _react.createElement(_fieldeditorshared.FieldConnector, {
82
+ return /*#__PURE__*/ _react.createElement(_fieldeditorshared.FieldConnector, {
83
83
  debounce: 0,
84
84
  field: field,
85
85
  isInitiallyDisabled: props.isInitiallyDisabled
@@ -87,20 +87,20 @@ function RatingEditor(props) {
87
87
  const clearOption = ()=>{
88
88
  setValue(null);
89
89
  };
90
- return _react.createElement(_f36components.Flex, {
90
+ return /*#__PURE__*/ _react.createElement(_f36components.Flex, {
91
91
  testId: "rating-editor",
92
92
  flexDirection: "row",
93
93
  marginTop: "spacingS"
94
- }, _react.createElement(_RatingRibbon.RatingRibbon, {
94
+ }, /*#__PURE__*/ _react.createElement(_RatingRibbon.RatingRibbon, {
95
95
  disabled: disabled,
96
96
  value: value,
97
97
  stars: starsCount,
98
98
  onSelect: (num)=>{
99
99
  setValue(num);
100
100
  }
101
- }), value !== undefined && !disabled && _react.createElement(_f36components.Flex, {
101
+ }), value !== undefined && !disabled && /*#__PURE__*/ _react.createElement(_f36components.Flex, {
102
102
  marginLeft: "spacingM"
103
- }, _react.createElement(_f36components.TextLink, {
103
+ }, /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
104
104
  as: "button",
105
105
  testId: "rating-editor-clear",
106
106
  onClick: clearOption
@@ -55,7 +55,7 @@ describe('RatingEditor', ()=>{
55
55
  afterEach(_react1.cleanup);
56
56
  it('renders 5 stars by default', ()=>{
57
57
  const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)();
58
- const { getAllByTestId } = (0, _react1.render)(_react.createElement(_RatingEditor.RatingEditor, {
58
+ const { getAllByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_RatingEditor.RatingEditor, {
59
59
  field: field,
60
60
  isInitiallyDisabled: false
61
61
  }));
@@ -63,7 +63,7 @@ describe('RatingEditor', ()=>{
63
63
  });
64
64
  it('renders custom number of stars', ()=>{
65
65
  const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)();
66
- const { getAllByTestId } = (0, _react1.render)(_react.createElement(_RatingEditor.RatingEditor, {
66
+ const { getAllByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_RatingEditor.RatingEditor, {
67
67
  field: field,
68
68
  isInitiallyDisabled: false,
69
69
  parameters: {
@@ -84,7 +84,7 @@ describe('RatingEditor', ()=>{
84
84
  ...field
85
85
  };
86
86
  });
87
- const { container, getAllByTestId, getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_RatingEditor.RatingEditor, {
87
+ const { container, getAllByTestId, getByTestId, queryByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_RatingEditor.RatingEditor, {
88
88
  field: field,
89
89
  isInitiallyDisabled: false
90
90
  }));
@@ -111,7 +111,7 @@ describe('RatingEditor', ()=>{
111
111
  ...field
112
112
  };
113
113
  });
114
- const { container, getAllByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_RatingEditor.RatingEditor, {
114
+ const { container, getAllByTestId, queryByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_RatingEditor.RatingEditor, {
115
115
  field: field,
116
116
  isInitiallyDisabled: false
117
117
  }));
@@ -72,10 +72,10 @@ class RatingRibbon extends _react.Component {
72
72
  for(let i = 1; i <= this.props.stars; i++){
73
73
  items.push(i);
74
74
  }
75
- return _react.createElement(_react.Fragment, null, items.map((num)=>_react.createElement(_f36components.IconButton, {
75
+ return /*#__PURE__*/ _react.createElement(_react.Fragment, null, items.map((num)=>/*#__PURE__*/ _react.createElement(_f36components.IconButton, {
76
76
  variant: "transparent",
77
77
  size: "small",
78
- icon: _react.createElement(_f36icons.StarIcon, {
78
+ icon: /*#__PURE__*/ _react.createElement(_f36icons.StarIcon, {
79
79
  variant: this.isSelected(num) ? 'primary' : 'muted',
80
80
  className: (0, _emotion.css)({
81
81
  width: '22px',
@@ -23,7 +23,7 @@ export function RatingEditor(props) {
23
23
  'instance',
24
24
  'stars'
25
25
  ]));
26
- return React.createElement(FieldConnector, {
26
+ return /*#__PURE__*/ React.createElement(FieldConnector, {
27
27
  debounce: 0,
28
28
  field: field,
29
29
  isInitiallyDisabled: props.isInitiallyDisabled
@@ -31,20 +31,20 @@ export function RatingEditor(props) {
31
31
  const clearOption = ()=>{
32
32
  setValue(null);
33
33
  };
34
- return React.createElement(Flex, {
34
+ return /*#__PURE__*/ React.createElement(Flex, {
35
35
  testId: "rating-editor",
36
36
  flexDirection: "row",
37
37
  marginTop: "spacingS"
38
- }, React.createElement(RatingRibbon, {
38
+ }, /*#__PURE__*/ React.createElement(RatingRibbon, {
39
39
  disabled: disabled,
40
40
  value: value,
41
41
  stars: starsCount,
42
42
  onSelect: (num)=>{
43
43
  setValue(num);
44
44
  }
45
- }), value !== undefined && !disabled && React.createElement(Flex, {
45
+ }), value !== undefined && !disabled && /*#__PURE__*/ React.createElement(Flex, {
46
46
  marginLeft: "spacingM"
47
- }, React.createElement(TextLink, {
47
+ }, /*#__PURE__*/ React.createElement(TextLink, {
48
48
  as: "button",
49
49
  testId: "rating-editor-clear",
50
50
  onClick: clearOption
@@ -10,7 +10,7 @@ describe('RatingEditor', ()=>{
10
10
  afterEach(cleanup);
11
11
  it('renders 5 stars by default', ()=>{
12
12
  const [field] = createFakeFieldAPI();
13
- const { getAllByTestId } = render(React.createElement(RatingEditor, {
13
+ const { getAllByTestId } = render(/*#__PURE__*/ React.createElement(RatingEditor, {
14
14
  field: field,
15
15
  isInitiallyDisabled: false
16
16
  }));
@@ -18,7 +18,7 @@ describe('RatingEditor', ()=>{
18
18
  });
19
19
  it('renders custom number of stars', ()=>{
20
20
  const [field] = createFakeFieldAPI();
21
- const { getAllByTestId } = render(React.createElement(RatingEditor, {
21
+ const { getAllByTestId } = render(/*#__PURE__*/ React.createElement(RatingEditor, {
22
22
  field: field,
23
23
  isInitiallyDisabled: false,
24
24
  parameters: {
@@ -39,7 +39,7 @@ describe('RatingEditor', ()=>{
39
39
  ...field
40
40
  };
41
41
  });
42
- const { container, getAllByTestId, getByTestId, queryByTestId } = render(React.createElement(RatingEditor, {
42
+ const { container, getAllByTestId, getByTestId, queryByTestId } = render(/*#__PURE__*/ React.createElement(RatingEditor, {
43
43
  field: field,
44
44
  isInitiallyDisabled: false
45
45
  }));
@@ -66,7 +66,7 @@ describe('RatingEditor', ()=>{
66
66
  ...field
67
67
  };
68
68
  });
69
- const { container, getAllByTestId, queryByTestId } = render(React.createElement(RatingEditor, {
69
+ const { container, getAllByTestId, queryByTestId } = render(/*#__PURE__*/ React.createElement(RatingEditor, {
70
70
  field: field,
71
71
  isInitiallyDisabled: false
72
72
  }));
@@ -21,10 +21,10 @@ export class RatingRibbon extends React.Component {
21
21
  for(let i = 1; i <= this.props.stars; i++){
22
22
  items.push(i);
23
23
  }
24
- return React.createElement(React.Fragment, null, items.map((num)=>React.createElement(IconButton, {
24
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, items.map((num)=>/*#__PURE__*/ React.createElement(IconButton, {
25
25
  variant: "transparent",
26
26
  size: "small",
27
- icon: React.createElement(StarIcon, {
27
+ icon: /*#__PURE__*/ React.createElement(StarIcon, {
28
28
  variant: this.isSelected(num) ? 'primary' : 'muted',
29
29
  className: css({
30
30
  width: '22px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rating",
3
- "version": "1.4.37",
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",
@@ -37,18 +37,20 @@
37
37
  "dependencies": {
38
38
  "@contentful/f36-components": "^4.70.0",
39
39
  "@contentful/f36-tokens": "^4.0.5",
40
- "@contentful/field-editor-shared": "^2.6.0",
40
+ "@contentful/field-editor-shared": "^2.8.0",
41
41
  "emotion": "^10.0.17",
42
42
  "lodash": "^4.17.15"
43
43
  },
44
44
  "devDependencies": {
45
- "@contentful/field-editor-test-utils": "^1.5.2"
45
+ "@contentful/field-editor-test-utils": "^1.5.2",
46
+ "@lingui/core": "5.3.0"
46
47
  },
47
48
  "peerDependencies": {
49
+ "@lingui/core": "^5.3.0",
48
50
  "react": ">=16.8.0"
49
51
  },
50
52
  "publishConfig": {
51
53
  "registry": "https://npm.pkg.github.com/"
52
54
  },
53
- "gitHead": "07bbbf610db4000897fa8e6f38e3ab6ace7e02cf"
55
+ "gitHead": "a86f67a6d507eb7c8c7a38b4312380361bdbebbb"
54
56
  }