@commercetools-uikit/rich-text-input 20.2.2 → 20.3.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.
|
@@ -84,7 +84,8 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
84
84
|
renderToggleButton = _useState2[0],
|
|
85
85
|
setRenderToggleButton = _useState2[1];
|
|
86
86
|
const updateRenderToggleButton = react.useCallback(() => {
|
|
87
|
-
|
|
87
|
+
var _ref$current;
|
|
88
|
+
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
88
89
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
89
90
|
setRenderToggleButton(true);
|
|
90
91
|
}
|
|
@@ -156,7 +157,8 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
156
157
|
disabled: props.isDisabled,
|
|
157
158
|
onBlur: props.onBlur,
|
|
158
159
|
onFocus: event => {
|
|
159
|
-
|
|
160
|
+
var _props$onFocus;
|
|
161
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
160
162
|
// opens the input if it regains focus and it's closed
|
|
161
163
|
if (!isOpen) {
|
|
162
164
|
toggle();
|
|
@@ -233,7 +235,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
233
235
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
234
236
|
// onChange unless this value changes.
|
|
235
237
|
if (hasSerializedValueChanged) {
|
|
236
|
-
_this
|
|
238
|
+
var _this$props$onChange, _this$props;
|
|
239
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
237
240
|
target: {
|
|
238
241
|
value: richTextUtils.html.serialize(state)
|
|
239
242
|
}
|
|
@@ -313,7 +316,7 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
313
316
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
314
317
|
|
|
315
318
|
// NOTE: This string will be replaced on build time with the package version.
|
|
316
|
-
var version = "20.
|
|
319
|
+
var version = "20.3.0";
|
|
317
320
|
|
|
318
321
|
exports["default"] = RichTextInputWithRef$1;
|
|
319
322
|
exports.version = version;
|
|
@@ -81,7 +81,8 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
81
81
|
renderToggleButton = _useState2[0],
|
|
82
82
|
setRenderToggleButton = _useState2[1];
|
|
83
83
|
const updateRenderToggleButton = react.useCallback(() => {
|
|
84
|
-
|
|
84
|
+
var _ref$current;
|
|
85
|
+
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
85
86
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
86
87
|
setRenderToggleButton(true);
|
|
87
88
|
}
|
|
@@ -153,7 +154,8 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
153
154
|
disabled: props.isDisabled,
|
|
154
155
|
onBlur: props.onBlur,
|
|
155
156
|
onFocus: event => {
|
|
156
|
-
|
|
157
|
+
var _props$onFocus;
|
|
158
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
157
159
|
// opens the input if it regains focus and it's closed
|
|
158
160
|
if (!isOpen) {
|
|
159
161
|
toggle();
|
|
@@ -230,7 +232,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
230
232
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
231
233
|
// onChange unless this value changes.
|
|
232
234
|
if (hasSerializedValueChanged) {
|
|
233
|
-
_this
|
|
235
|
+
var _this$props$onChange, _this$props;
|
|
236
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
234
237
|
target: {
|
|
235
238
|
value: richTextUtils.html.serialize(state)
|
|
236
239
|
}
|
|
@@ -306,7 +309,7 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
306
309
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
307
310
|
|
|
308
311
|
// NOTE: This string will be replaced on build time with the package version.
|
|
309
|
-
var version = "20.
|
|
312
|
+
var version = "20.3.0";
|
|
310
313
|
|
|
311
314
|
exports["default"] = RichTextInputWithRef$1;
|
|
312
315
|
exports.version = version;
|
|
@@ -61,7 +61,8 @@ const Editor = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
61
61
|
renderToggleButton = _useState2[0],
|
|
62
62
|
setRenderToggleButton = _useState2[1];
|
|
63
63
|
const updateRenderToggleButton = useCallback(() => {
|
|
64
|
-
|
|
64
|
+
var _ref$current;
|
|
65
|
+
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
65
66
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
66
67
|
setRenderToggleButton(true);
|
|
67
68
|
}
|
|
@@ -133,7 +134,8 @@ const Editor = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
133
134
|
disabled: props.isDisabled,
|
|
134
135
|
onBlur: props.onBlur,
|
|
135
136
|
onFocus: event => {
|
|
136
|
-
|
|
137
|
+
var _props$onFocus;
|
|
138
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
137
139
|
// opens the input if it regains focus and it's closed
|
|
138
140
|
if (!isOpen) {
|
|
139
141
|
toggle();
|
|
@@ -210,7 +212,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
210
212
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
211
213
|
// onChange unless this value changes.
|
|
212
214
|
if (hasSerializedValueChanged) {
|
|
213
|
-
_this
|
|
215
|
+
var _this$props$onChange, _this$props;
|
|
216
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
214
217
|
target: {
|
|
215
218
|
value: html.serialize(state)
|
|
216
219
|
}
|
|
@@ -290,6 +293,6 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
290
293
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
291
294
|
|
|
292
295
|
// NOTE: This string will be replaced on build time with the package version.
|
|
293
|
-
var version = "20.
|
|
296
|
+
var version = "20.3.0";
|
|
294
297
|
|
|
295
298
|
export { RichTextInputWithRef$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/rich-text-input",
|
|
3
3
|
"description": "A controlled rich text input component for rich text with validation states.",
|
|
4
|
-
"version": "20.
|
|
4
|
+
"version": "20.3.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/collapsible-motion": "20.
|
|
25
|
-
"@commercetools-uikit/constraints": "20.
|
|
26
|
-
"@commercetools-uikit/design-system": "20.
|
|
27
|
-
"@commercetools-uikit/flat-button": "20.
|
|
28
|
-
"@commercetools-uikit/hooks": "20.
|
|
29
|
-
"@commercetools-uikit/icons": "20.
|
|
30
|
-
"@commercetools-uikit/input-utils": "20.
|
|
31
|
-
"@commercetools-uikit/rich-text-utils": "20.
|
|
32
|
-
"@commercetools-uikit/spacings-inline": "20.
|
|
33
|
-
"@commercetools-uikit/spacings-stack": "20.
|
|
34
|
-
"@commercetools-uikit/tooltip": "20.
|
|
35
|
-
"@commercetools-uikit/utils": "20.
|
|
24
|
+
"@commercetools-uikit/collapsible-motion": "20.3.0",
|
|
25
|
+
"@commercetools-uikit/constraints": "20.3.0",
|
|
26
|
+
"@commercetools-uikit/design-system": "20.3.0",
|
|
27
|
+
"@commercetools-uikit/flat-button": "20.3.0",
|
|
28
|
+
"@commercetools-uikit/hooks": "20.3.0",
|
|
29
|
+
"@commercetools-uikit/icons": "20.3.0",
|
|
30
|
+
"@commercetools-uikit/input-utils": "20.3.0",
|
|
31
|
+
"@commercetools-uikit/rich-text-utils": "20.3.0",
|
|
32
|
+
"@commercetools-uikit/spacings-inline": "20.3.0",
|
|
33
|
+
"@commercetools-uikit/spacings-stack": "20.3.0",
|
|
34
|
+
"@commercetools-uikit/tooltip": "20.3.0",
|
|
35
|
+
"@commercetools-uikit/utils": "20.3.0",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
37
37
|
"@emotion/styled": "^11.10.5",
|
|
38
|
-
"downshift": "9.0.
|
|
38
|
+
"downshift": "9.0.10",
|
|
39
39
|
"immutable": "4.3.7",
|
|
40
40
|
"is-hotkey": "0.2.0",
|
|
41
41
|
"lodash": "4.17.21",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"slate-react": "0.75.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"react": "19.
|
|
48
|
-
"react-dom": "19.
|
|
47
|
+
"react": "19.2.0",
|
|
48
|
+
"react-dom": "19.2.0",
|
|
49
49
|
"react-intl": "^7.1.4"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|