@commercetools-uikit/rich-text-input 19.25.1 → 20.0.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.
package/README.md CHANGED
@@ -30,18 +30,18 @@ npm --save install react react-dom react-intl
30
30
  ## Usage
31
31
 
32
32
  ```jsx
33
- import React from 'react';
33
+ import { useState, useCallback, useRef } from 'react';
34
34
  import RichTextInput from '@commercetools-uikit/rich-text-input';
35
35
 
36
36
  const html = '<p>hello world</p>';
37
37
 
38
38
  const Example = (props) => {
39
- const [value, setValue] = React.useState(html);
40
- const handleChange = React.useCallback((event) => {
39
+ const [value, setValue] = useState(html);
40
+ const handleChange = useCallback((event) => {
41
41
  setValue(event.target.value);
42
42
  }, []);
43
- const ref = React.useRef(null);
44
- const handleReset = React.useCallback(() => {
43
+ const ref = useRef(null);
44
+ const handleReset = useCallback(() => {
45
45
  ref.current?.resetValue('<p>after reset</p>');
46
46
  }, []);
47
47
 
@@ -17,7 +17,6 @@ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
17
17
  var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
18
18
  var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
19
19
  var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
20
- var _pt = require('prop-types');
21
20
  var react = require('react');
22
21
  var utils = require('@commercetools-uikit/utils');
23
22
  var richTextUtils = require('@commercetools-uikit/rich-text-utils');
@@ -48,7 +47,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
48
47
  var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
49
48
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
50
49
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
51
- var _pt__default = /*#__PURE__*/_interopDefault(_pt);
52
50
  var CollapsibleMotion__default = /*#__PURE__*/_interopDefault(CollapsibleMotion);
53
51
  var Stack__default = /*#__PURE__*/_interopDefault(Stack);
54
52
  var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
@@ -305,24 +303,6 @@ RichTextInput.defaultProps = {
305
303
  showExpandIcon: false
306
304
  };
307
305
  RichTextInput.displayName = 'RichTextInput';
308
- RichTextInput.propTypes = process.env.NODE_ENV !== "production" ? {
309
- isAutofocussed: _pt__default["default"].bool,
310
- defaultExpandMultilineText: _pt__default["default"].bool,
311
- hasError: _pt__default["default"].bool,
312
- hasWarning: _pt__default["default"].bool,
313
- id: _pt__default["default"].string,
314
- name: _pt__default["default"].string,
315
- placeholder: _pt__default["default"].string,
316
- isDisabled: _pt__default["default"].bool,
317
- isReadOnly: _pt__default["default"].bool,
318
- horizontalConstraint: _pt__default["default"].oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
319
- onChange: _pt__default["default"].func,
320
- onFocus: _pt__default["default"].func,
321
- onBlur: _pt__default["default"].func,
322
- value: _pt__default["default"].string,
323
- showExpandIcon: _pt__default["default"].bool,
324
- onClickExpand: _pt__default["default"].func
325
- } : {};
326
306
  const isTouched = touched => Boolean(touched);
327
307
  const RichTextInputWithRef = /*#__PURE__*/react.forwardRef((props, ref) => jsxRuntime.jsx(RichTextInput, _objectSpread({
328
308
  parentRef: ref
@@ -333,7 +313,7 @@ RichTextInputWithRef.isTouched = isTouched;
333
313
  var RichTextInputWithRef$1 = RichTextInputWithRef;
334
314
 
335
315
  // NOTE: This string will be replaced on build time with the package version.
336
- var version = "19.25.1";
316
+ var version = "20.0.0";
337
317
 
338
318
  exports["default"] = RichTextInputWithRef$1;
339
319
  exports.version = version;
@@ -17,7 +17,6 @@ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
17
17
  var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
18
18
  var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
19
19
  var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
20
- require('prop-types');
21
20
  var react = require('react');
22
21
  var utils = require('@commercetools-uikit/utils');
23
22
  var richTextUtils = require('@commercetools-uikit/rich-text-utils');
@@ -297,7 +296,6 @@ RichTextInput.defaultProps = {
297
296
  showExpandIcon: false
298
297
  };
299
298
  RichTextInput.displayName = 'RichTextInput';
300
- RichTextInput.propTypes = {};
301
299
  const isTouched = touched => Boolean(touched);
302
300
  const RichTextInputWithRef = /*#__PURE__*/react.forwardRef((props, ref) => jsxRuntime.jsx(RichTextInput, _objectSpread({
303
301
  parentRef: ref
@@ -308,7 +306,7 @@ RichTextInputWithRef.isTouched = isTouched;
308
306
  var RichTextInputWithRef$1 = RichTextInputWithRef;
309
307
 
310
308
  // NOTE: This string will be replaced on build time with the package version.
311
- var version = "19.25.1";
309
+ var version = "20.0.0";
312
310
 
313
311
  exports["default"] = RichTextInputWithRef$1;
314
312
  exports.version = version;
@@ -13,7 +13,6 @@ import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
13
13
  import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possibleConstructorReturn';
14
14
  import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
15
15
  import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
16
- import _pt from 'prop-types';
17
16
  import { forwardRef, useRef, useMemo, useState, useCallback, useEffect, useImperativeHandle, PureComponent } from 'react';
18
17
  import { filterDataAttributes, warning } from '@commercetools-uikit/utils';
19
18
  import { resetEditor, withLinks, RichTextBody, focusEditor, toggleMark, Softbreaker, HiddenInput, Element, Leaf, isEmpty, validSlateStateAdapter, html } from '@commercetools-uikit/rich-text-utils';
@@ -281,24 +280,6 @@ RichTextInput.defaultProps = {
281
280
  showExpandIcon: false
282
281
  };
283
282
  RichTextInput.displayName = 'RichTextInput';
284
- RichTextInput.propTypes = process.env.NODE_ENV !== "production" ? {
285
- isAutofocussed: _pt.bool,
286
- defaultExpandMultilineText: _pt.bool,
287
- hasError: _pt.bool,
288
- hasWarning: _pt.bool,
289
- id: _pt.string,
290
- name: _pt.string,
291
- placeholder: _pt.string,
292
- isDisabled: _pt.bool,
293
- isReadOnly: _pt.bool,
294
- horizontalConstraint: _pt.oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
295
- onChange: _pt.func,
296
- onFocus: _pt.func,
297
- onBlur: _pt.func,
298
- value: _pt.string,
299
- showExpandIcon: _pt.bool,
300
- onClickExpand: _pt.func
301
- } : {};
302
283
  const isTouched = touched => Boolean(touched);
303
284
  const RichTextInputWithRef = /*#__PURE__*/forwardRef((props, ref) => jsx(RichTextInput, _objectSpread({
304
285
  parentRef: ref
@@ -309,6 +290,6 @@ RichTextInputWithRef.isTouched = isTouched;
309
290
  var RichTextInputWithRef$1 = RichTextInputWithRef;
310
291
 
311
292
  // NOTE: This string will be replaced on build time with the package version.
312
- var version = "19.25.1";
293
+ var version = "20.0.0";
313
294
 
314
295
  export { RichTextInputWithRef$1 as default, version };
@@ -6,7 +6,7 @@ type TBaseEvent = {
6
6
  name?: string;
7
7
  };
8
8
  };
9
- type TChangeEvent = {
9
+ export type TChangeEvent = {
10
10
  target: TBaseEvent['target'] & {
11
11
  value: string;
12
12
  };
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.25.1",
4
+ "version": "20.0.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,37 +21,36 @@
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.1",
25
- "@commercetools-uikit/constraints": "19.25.1",
26
- "@commercetools-uikit/design-system": "19.25.1",
27
- "@commercetools-uikit/flat-button": "19.25.1",
28
- "@commercetools-uikit/hooks": "19.25.1",
29
- "@commercetools-uikit/icons": "19.25.1",
30
- "@commercetools-uikit/input-utils": "19.25.1",
31
- "@commercetools-uikit/rich-text-utils": "19.25.1",
32
- "@commercetools-uikit/spacings-inline": "19.25.1",
33
- "@commercetools-uikit/spacings-stack": "19.25.1",
34
- "@commercetools-uikit/tooltip": "19.25.1",
35
- "@commercetools-uikit/utils": "19.25.1",
24
+ "@commercetools-uikit/collapsible-motion": "20.0.0",
25
+ "@commercetools-uikit/constraints": "20.0.0",
26
+ "@commercetools-uikit/design-system": "20.0.0",
27
+ "@commercetools-uikit/flat-button": "20.0.0",
28
+ "@commercetools-uikit/hooks": "20.0.0",
29
+ "@commercetools-uikit/icons": "20.0.0",
30
+ "@commercetools-uikit/input-utils": "20.0.0",
31
+ "@commercetools-uikit/rich-text-utils": "20.0.0",
32
+ "@commercetools-uikit/spacings-inline": "20.0.0",
33
+ "@commercetools-uikit/spacings-stack": "20.0.0",
34
+ "@commercetools-uikit/tooltip": "20.0.0",
35
+ "@commercetools-uikit/utils": "20.0.0",
36
36
  "@emotion/react": "^11.10.5",
37
37
  "@emotion/styled": "^11.10.5",
38
- "downshift": "6.1.12",
38
+ "downshift": "9.0.8",
39
39
  "immutable": "4.3.7",
40
40
  "is-hotkey": "0.2.0",
41
41
  "lodash": "4.17.21",
42
- "prop-types": "15.8.1",
43
42
  "slate": "0.75.0",
44
43
  "slate-history": "0.113.1",
45
44
  "slate-react": "0.75.0"
46
45
  },
47
46
  "devDependencies": {
48
- "react": "17.0.2",
49
- "react-dom": "17.0.2",
50
- "react-intl": "^6.3.2"
47
+ "react": "19.0.0",
48
+ "react-dom": "19.0.0",
49
+ "react-intl": "^7.1.4"
51
50
  },
52
51
  "peerDependencies": {
53
- "react": "17.x",
54
- "react-dom": "17.x",
55
- "react-intl": "6.x"
52
+ "react": "19.x",
53
+ "react-dom": "19.x",
54
+ "react-intl": "7.x"
56
55
  }
57
56
  }