decap-cms-widget-object 3.5.0 → 3.7.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.
@@ -5,7 +5,7 @@ import { ClassNames } from '@emotion/react';
5
5
  import { List, Map } from 'immutable';
6
6
  import { colors, lengths, ObjectWidgetTopBar } from 'decap-cms-ui-default';
7
7
  import { stringTemplate } from 'decap-cms-lib-widgets';
8
- import { jsx as ___EmotionJSX } from "@emotion/react";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
9
9
  const styleStrings = {
10
10
  nestedObjectControl: `
11
11
  padding: 6px 14px 14px;
@@ -109,8 +109,7 @@ export default class ObjectControl extends React.Component {
109
109
  const fieldValue = value && Map.isMap(value) ? value.get(fieldName) : value;
110
110
  const isDuplicate = isFieldDuplicate && isFieldDuplicate(field);
111
111
  const isHidden = isFieldHidden && isFieldHidden(field);
112
- return ___EmotionJSX(EditorControl, {
113
- key: key,
112
+ return _jsx(EditorControl, {
114
113
  field: field,
115
114
  value: fieldValue,
116
115
  onChange: onChangeObject,
@@ -126,7 +125,7 @@ export default class ObjectControl extends React.Component {
126
125
  isFieldHidden: isFieldHidden,
127
126
  locale: locale,
128
127
  isParentListCollapsed: collapsed
129
- });
128
+ }, key);
130
129
  }
131
130
  handleCollapseToggle = () => {
132
131
  this.setState({
@@ -182,35 +181,41 @@ export default class ObjectControl extends React.Component {
182
181
  const multiFields = field.get('fields');
183
182
  const singleField = field.get('field');
184
183
  if (multiFields || singleField) {
185
- return ___EmotionJSX(ClassNames, null, ({
186
- css,
187
- cx
188
- }) => ___EmotionJSX("div", {
189
- id: forID,
190
- className: cx(classNameWrapper, css`
184
+ return _jsx(ClassNames, {
185
+ children: ({
186
+ css,
187
+ cx
188
+ }) => _jsxs("div", {
189
+ id: forID,
190
+ className: cx(classNameWrapper, css`
191
191
  ${styleStrings.objectWidgetTopBarContainer}
192
192
  `, {
193
- [css`
193
+ [css`
194
194
  ${styleStrings.nestedObjectControl}
195
195
  `]: forList
196
- }, {
197
- [css`
196
+ }, {
197
+ [css`
198
198
  border-color: ${colors.textFieldBorder};
199
199
  `]: forList ? !hasError : false
200
- })
201
- }, forList ? null : ___EmotionJSX(ObjectWidgetTopBar, {
202
- collapsed: collapsed,
203
- onCollapseToggle: this.handleCollapseToggle,
204
- heading: collapsed && this.objectLabel(),
205
- t: t
206
- }), ___EmotionJSX("div", {
207
- className: cx({
208
- [css`
200
+ }),
201
+ children: [forList ? null : _jsx(ObjectWidgetTopBar, {
202
+ collapsed: collapsed,
203
+ onCollapseToggle: this.handleCollapseToggle,
204
+ heading: collapsed && this.objectLabel(),
205
+ t: t
206
+ }), _jsx("div", {
207
+ className: cx({
208
+ [css`
209
209
  ${styleStrings.collapsedObjectControl}
210
210
  `]: collapsed
211
+ }),
212
+ children: this.renderFields(multiFields, singleField)
213
+ })]
211
214
  })
212
- }, this.renderFields(multiFields, singleField))));
215
+ });
213
216
  }
214
- return ___EmotionJSX("h3", null, "No field(s) defined for this widget");
217
+ return _jsx("h3", {
218
+ children: "No field(s) defined for this widget"
219
+ });
215
220
  }
216
221
  }
@@ -1,17 +1,18 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import ImmutablePropTypes from 'react-immutable-proptypes';
3
2
  import { WidgetPreviewContainer } from 'decap-cms-ui-default';
4
3
  import { fromJS } from 'immutable';
5
- import { jsx as ___EmotionJSX } from "@emotion/react";
4
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
6
5
  function ObjectPreview({
7
6
  field
8
7
  }) {
9
8
  if (field && !field.get) {
10
9
  field = fromJS(field);
11
10
  }
12
- return ___EmotionJSX(WidgetPreviewContainer, null, field && field.get('fields') || field.get('field') || null);
11
+ return _jsx(WidgetPreviewContainer, {
12
+ children: field && field.get('fields') || field.get('field') || null
13
+ });
13
14
  }
14
15
  ObjectPreview.propTypes = {
15
- field: PropTypes.node
16
+ field: ImmutablePropTypes.map
16
17
  };
17
18
  export default ObjectPreview;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "decap-cms-widget-object",
3
3
  "description": "Widget for displaying an object of fields for Decap CMS.",
4
- "version": "3.5.0",
4
+ "version": "3.7.0",
5
5
  "homepage": "https://www.decapcms.org/docs/widgets/#object",
6
6
  "repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-object",
7
7
  "bugs": "https://github.com/decaporg/decap-cms/issues",
@@ -31,5 +31,5 @@
31
31
  "react": "^19.1.0",
32
32
  "react-immutable-proptypes": "^2.1.0"
33
33
  },
34
- "gitHead": "45c9f5b9a1a12f74321ce4658b71ec88d6365ec1"
34
+ "gitHead": "ffe5ab7e61f4e7cb374a413bf9fe55f088d20ba2"
35
35
  }
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import ImmutablePropTypes from 'react-immutable-proptypes';
3
2
  import { WidgetPreviewContainer } from 'decap-cms-ui-default';
4
3
  import { fromJS } from 'immutable';
5
4
 
@@ -15,7 +14,7 @@ function ObjectPreview({ field }) {
15
14
  }
16
15
 
17
16
  ObjectPreview.propTypes = {
18
- field: PropTypes.node,
17
+ field: ImmutablePropTypes.map,
19
18
  };
20
19
 
21
20
  export default ObjectPreview;