@commercetools-uikit/rich-text-input 19.11.0 → 19.12.1
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.
|
@@ -86,8 +86,7 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
86
86
|
renderToggleButton = _useState2[0],
|
|
87
87
|
setRenderToggleButton = _useState2[1];
|
|
88
88
|
const updateRenderToggleButton = react.useCallback(() => {
|
|
89
|
-
|
|
90
|
-
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
89
|
+
const doesExceedCollapsedHeightLimit = Number(ref.current?.clientHeight) > COLLAPSED_HEIGHT;
|
|
91
90
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
92
91
|
setRenderToggleButton(true);
|
|
93
92
|
}
|
|
@@ -159,8 +158,7 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
159
158
|
disabled: props.isDisabled,
|
|
160
159
|
onBlur: props.onBlur,
|
|
161
160
|
onFocus: event => {
|
|
162
|
-
|
|
163
|
-
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
161
|
+
props.onFocus?.(event);
|
|
164
162
|
// opens the input if it regains focus and it's closed
|
|
165
163
|
if (!isOpen) {
|
|
166
164
|
toggle();
|
|
@@ -214,7 +212,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
214
212
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
215
213
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
216
214
|
let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
217
|
-
_inherits(RichTextInput, _PureComponent);
|
|
218
215
|
function RichTextInput() {
|
|
219
216
|
var _this;
|
|
220
217
|
_classCallCheck(this, RichTextInput);
|
|
@@ -238,8 +235,7 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
238
235
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
239
236
|
// onChange unless this value changes.
|
|
240
237
|
if (hasSerializedValueChanged) {
|
|
241
|
-
|
|
242
|
-
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
238
|
+
_this.props.onChange?.({
|
|
243
239
|
target: {
|
|
244
240
|
value: richTextUtils.html.serialize(state)
|
|
245
241
|
}
|
|
@@ -252,7 +248,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
252
248
|
};
|
|
253
249
|
return _this;
|
|
254
250
|
}
|
|
255
|
-
|
|
251
|
+
_inherits(RichTextInput, _PureComponent);
|
|
252
|
+
return _createClass(RichTextInput, [{
|
|
256
253
|
key: "componentDidUpdate",
|
|
257
254
|
value: function componentDidUpdate() {
|
|
258
255
|
// everytime we call `onChange`, we update `this.serializedValue`
|
|
@@ -300,7 +297,6 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
300
297
|
}));
|
|
301
298
|
}
|
|
302
299
|
}]);
|
|
303
|
-
return RichTextInput;
|
|
304
300
|
}(react.PureComponent); // When component is using `forwardRef` only `defaultProps` and `displayName` are recognized by default as static props
|
|
305
301
|
RichTextInput.defaultProps = {
|
|
306
302
|
defaultExpandMultilineText: false,
|
|
@@ -337,7 +333,7 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
337
333
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
338
334
|
|
|
339
335
|
// NOTE: This string will be replaced on build time with the package version.
|
|
340
|
-
var version = "19.
|
|
336
|
+
var version = "19.12.1";
|
|
341
337
|
|
|
342
338
|
exports["default"] = RichTextInputWithRef$1;
|
|
343
339
|
exports.version = version;
|
|
@@ -82,8 +82,7 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
82
82
|
renderToggleButton = _useState2[0],
|
|
83
83
|
setRenderToggleButton = _useState2[1];
|
|
84
84
|
const updateRenderToggleButton = react.useCallback(() => {
|
|
85
|
-
|
|
86
|
-
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
85
|
+
const doesExceedCollapsedHeightLimit = Number(ref.current?.clientHeight) > COLLAPSED_HEIGHT;
|
|
87
86
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
88
87
|
setRenderToggleButton(true);
|
|
89
88
|
}
|
|
@@ -155,8 +154,7 @@ const Editor = /*#__PURE__*/react.forwardRef((props, forwardedRef) => {
|
|
|
155
154
|
disabled: props.isDisabled,
|
|
156
155
|
onBlur: props.onBlur,
|
|
157
156
|
onFocus: event => {
|
|
158
|
-
|
|
159
|
-
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
157
|
+
props.onFocus?.(event);
|
|
160
158
|
// opens the input if it regains focus and it's closed
|
|
161
159
|
if (!isOpen) {
|
|
162
160
|
toggle();
|
|
@@ -210,7 +208,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
210
208
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
211
209
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
212
210
|
let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
213
|
-
_inherits(RichTextInput, _PureComponent);
|
|
214
211
|
function RichTextInput() {
|
|
215
212
|
var _this;
|
|
216
213
|
_classCallCheck(this, RichTextInput);
|
|
@@ -234,8 +231,7 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
234
231
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
235
232
|
// onChange unless this value changes.
|
|
236
233
|
if (hasSerializedValueChanged) {
|
|
237
|
-
|
|
238
|
-
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
234
|
+
_this.props.onChange?.({
|
|
239
235
|
target: {
|
|
240
236
|
value: richTextUtils.html.serialize(state)
|
|
241
237
|
}
|
|
@@ -248,7 +244,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
248
244
|
};
|
|
249
245
|
return _this;
|
|
250
246
|
}
|
|
251
|
-
|
|
247
|
+
_inherits(RichTextInput, _PureComponent);
|
|
248
|
+
return _createClass(RichTextInput, [{
|
|
252
249
|
key: "componentDidUpdate",
|
|
253
250
|
value: function componentDidUpdate() {
|
|
254
251
|
// everytime we call `onChange`, we update `this.serializedValue`
|
|
@@ -292,7 +289,6 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
292
289
|
}));
|
|
293
290
|
}
|
|
294
291
|
}]);
|
|
295
|
-
return RichTextInput;
|
|
296
292
|
}(react.PureComponent); // When component is using `forwardRef` only `defaultProps` and `displayName` are recognized by default as static props
|
|
297
293
|
RichTextInput.defaultProps = {
|
|
298
294
|
defaultExpandMultilineText: false,
|
|
@@ -312,7 +308,7 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
312
308
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
313
309
|
|
|
314
310
|
// NOTE: This string will be replaced on build time with the package version.
|
|
315
|
-
var version = "19.
|
|
311
|
+
var version = "19.12.1";
|
|
316
312
|
|
|
317
313
|
exports["default"] = RichTextInputWithRef$1;
|
|
318
314
|
exports.version = version;
|
|
@@ -62,8 +62,7 @@ const Editor = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
62
62
|
renderToggleButton = _useState2[0],
|
|
63
63
|
setRenderToggleButton = _useState2[1];
|
|
64
64
|
const updateRenderToggleButton = useCallback(() => {
|
|
65
|
-
|
|
66
|
-
const doesExceedCollapsedHeightLimit = Number((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) > COLLAPSED_HEIGHT;
|
|
65
|
+
const doesExceedCollapsedHeightLimit = Number(ref.current?.clientHeight) > COLLAPSED_HEIGHT;
|
|
67
66
|
if (doesExceedCollapsedHeightLimit && !renderToggleButton) {
|
|
68
67
|
setRenderToggleButton(true);
|
|
69
68
|
}
|
|
@@ -135,8 +134,7 @@ const Editor = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
135
134
|
disabled: props.isDisabled,
|
|
136
135
|
onBlur: props.onBlur,
|
|
137
136
|
onFocus: event => {
|
|
138
|
-
|
|
139
|
-
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
|
|
137
|
+
props.onFocus?.(event);
|
|
140
138
|
// opens the input if it regains focus and it's closed
|
|
141
139
|
if (!isOpen) {
|
|
142
140
|
toggle();
|
|
@@ -190,7 +188,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
190
188
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
191
189
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
192
190
|
let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
193
|
-
_inherits(RichTextInput, _PureComponent);
|
|
194
191
|
function RichTextInput() {
|
|
195
192
|
var _this;
|
|
196
193
|
_classCallCheck(this, RichTextInput);
|
|
@@ -214,8 +211,7 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
214
211
|
// the consumer only cares about the serializedValue, so it doesn't make sense to call
|
|
215
212
|
// onChange unless this value changes.
|
|
216
213
|
if (hasSerializedValueChanged) {
|
|
217
|
-
|
|
218
|
-
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
|
|
214
|
+
_this.props.onChange?.({
|
|
219
215
|
target: {
|
|
220
216
|
value: html.serialize(state)
|
|
221
217
|
}
|
|
@@ -228,7 +224,8 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
228
224
|
};
|
|
229
225
|
return _this;
|
|
230
226
|
}
|
|
231
|
-
|
|
227
|
+
_inherits(RichTextInput, _PureComponent);
|
|
228
|
+
return _createClass(RichTextInput, [{
|
|
232
229
|
key: "componentDidUpdate",
|
|
233
230
|
value: function componentDidUpdate() {
|
|
234
231
|
// everytime we call `onChange`, we update `this.serializedValue`
|
|
@@ -276,7 +273,6 @@ let RichTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
276
273
|
}));
|
|
277
274
|
}
|
|
278
275
|
}]);
|
|
279
|
-
return RichTextInput;
|
|
280
276
|
}(PureComponent); // When component is using `forwardRef` only `defaultProps` and `displayName` are recognized by default as static props
|
|
281
277
|
RichTextInput.defaultProps = {
|
|
282
278
|
defaultExpandMultilineText: false,
|
|
@@ -313,6 +309,6 @@ RichTextInputWithRef.isTouched = isTouched;
|
|
|
313
309
|
var RichTextInputWithRef$1 = RichTextInputWithRef;
|
|
314
310
|
|
|
315
311
|
// NOTE: This string will be replaced on build time with the package version.
|
|
316
|
-
var version = "19.
|
|
312
|
+
var version = "19.12.1";
|
|
317
313
|
|
|
318
314
|
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": "19.
|
|
4
|
+
"version": "19.12.1",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,27 +21,27 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/collapsible-motion": "19.
|
|
25
|
-
"@commercetools-uikit/constraints": "19.
|
|
26
|
-
"@commercetools-uikit/design-system": "19.
|
|
27
|
-
"@commercetools-uikit/flat-button": "19.
|
|
28
|
-
"@commercetools-uikit/hooks": "19.
|
|
29
|
-
"@commercetools-uikit/icons": "19.
|
|
30
|
-
"@commercetools-uikit/input-utils": "19.
|
|
31
|
-
"@commercetools-uikit/rich-text-utils": "19.
|
|
32
|
-
"@commercetools-uikit/spacings-inline": "19.
|
|
33
|
-
"@commercetools-uikit/spacings-stack": "19.
|
|
34
|
-
"@commercetools-uikit/tooltip": "19.
|
|
35
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/collapsible-motion": "19.12.1",
|
|
25
|
+
"@commercetools-uikit/constraints": "19.12.1",
|
|
26
|
+
"@commercetools-uikit/design-system": "19.12.1",
|
|
27
|
+
"@commercetools-uikit/flat-button": "19.12.1",
|
|
28
|
+
"@commercetools-uikit/hooks": "19.12.1",
|
|
29
|
+
"@commercetools-uikit/icons": "19.12.1",
|
|
30
|
+
"@commercetools-uikit/input-utils": "19.12.1",
|
|
31
|
+
"@commercetools-uikit/rich-text-utils": "19.12.1",
|
|
32
|
+
"@commercetools-uikit/spacings-inline": "19.12.1",
|
|
33
|
+
"@commercetools-uikit/spacings-stack": "19.12.1",
|
|
34
|
+
"@commercetools-uikit/tooltip": "19.12.1",
|
|
35
|
+
"@commercetools-uikit/utils": "19.12.1",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
37
37
|
"@emotion/styled": "^11.10.5",
|
|
38
38
|
"downshift": "6.1.12",
|
|
39
|
-
"immutable": "4.3.
|
|
39
|
+
"immutable": "4.3.7",
|
|
40
40
|
"is-hotkey": "0.2.0",
|
|
41
41
|
"lodash": "4.17.21",
|
|
42
42
|
"prop-types": "15.8.1",
|
|
43
43
|
"slate": "0.75.0",
|
|
44
|
-
"slate-history": "0.
|
|
44
|
+
"slate-history": "0.109.0",
|
|
45
45
|
"slate-react": "0.75.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|