@plesk/ui-library 3.31.1 → 3.31.2

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.
Files changed (41) hide show
  1. package/cjs/components/CodeEditor/CodeEditor.js +2 -1
  2. package/cjs/components/ComboBox/ComboBoxOption.js +1 -2
  3. package/cjs/components/Dialog/Dialog.js +17 -9
  4. package/cjs/components/Form/Form.js +1 -1
  5. package/cjs/components/ItemList/ItemList.js +1 -1
  6. package/cjs/components/Link/Link.js +2 -1
  7. package/cjs/components/List/List.js +16 -9
  8. package/cjs/components/Markdown/Markdown.js +1 -3
  9. package/cjs/components/Select/SelectOption.js +1 -2
  10. package/cjs/components/Spot/SpotPopup.js +2 -0
  11. package/cjs/index.js +1 -1
  12. package/dist/plesk-ui-library-rtl.css.map +1 -1
  13. package/dist/plesk-ui-library.css.map +1 -1
  14. package/dist/plesk-ui-library.js +187 -151
  15. package/dist/plesk-ui-library.js.map +1 -1
  16. package/dist/plesk-ui-library.min.js +5 -5
  17. package/dist/plesk-ui-library.min.js.map +1 -1
  18. package/esm/components/ComboBox/ComboBoxOption.js +1 -2
  19. package/esm/components/Dialog/Dialog.js +18 -10
  20. package/esm/components/Form/Form.js +1 -1
  21. package/esm/components/Link/Link.js +3 -1
  22. package/esm/components/List/List.js +14 -8
  23. package/esm/components/Markdown/Markdown.js +1 -3
  24. package/esm/components/Select/SelectOption.js +1 -2
  25. package/esm/components/Spot/SpotPopup.js +3 -0
  26. package/esm/index.js +1 -1
  27. package/package.json +52 -51
  28. package/styleguide/build/bundle.26082873.js +2 -0
  29. package/styleguide/build/{bundle.a0fc0411.js.LICENSE.txt → bundle.26082873.js.LICENSE.txt} +3 -3
  30. package/styleguide/images/empty-list.png +0 -0
  31. package/styleguide/index.html +2 -2
  32. package/types/package.d.ts +12 -11
  33. package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
  34. package/types/src/components/Form/Form.d.ts +3 -3
  35. package/types/src/components/ItemList/ItemList.d.ts +1 -1
  36. package/types/src/components/ItemList/ItemList.stories.d.ts +24 -24
  37. package/types/src/components/Select/Select.stories.d.ts +1 -1
  38. package/types/src/components/Skeleton/SkeletonText.stories.d.ts +3 -3
  39. package/types/src/components/Status/Status.stories.d.ts +2 -2
  40. package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
  41. package/styleguide/build/bundle.a0fc0411.js +0 -2
@@ -4,8 +4,7 @@ import React from 'react';
4
4
  /**
5
5
  * `ComboBoxOption` is a part of [ComboBox](#!/ComboBox) component.
6
6
  * @since 2.6.0
7
- */
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
+ */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
8
  const ComboBoxOption = _props => {
10
9
  // styleguidist doesn't show Props & Methods if component renders nothing
11
10
  // eslint-disable-next-line no-constant-condition
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  // Copyright 1999-2021. Plesk International GmbH. All rights reserved.
3
3
 
4
4
  /* eslint-disable react/no-deprecated */
5
- import React, { isValidElement, useEffect, useState } from 'react';
5
+ import React, { isValidElement, cloneElement, useEffect, useState } from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import classNames from 'classnames';
8
8
  import { CLS_PREFIX } from '../../constants';
@@ -77,11 +77,12 @@ const Dialog = _ref => {
77
77
  className: `${classPrefix}-inner`
78
78
  }, image)));
79
79
  };
80
- const getCancelButtonProps = () => {
80
+ const getCancelButtonProps = function () {
81
+ let formProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : form;
81
82
  if (!closable) {
82
83
  return false;
83
84
  }
84
- if (cancelButton === false || form && form.cancelButton === false) {
85
+ if (cancelButton === false || formProps && formProps.cancelButton === false) {
85
86
  return false;
86
87
  }
87
88
  let props = {
@@ -91,10 +92,10 @@ const Dialog = _ref => {
91
92
  fallback: "Cancel"
92
93
  })
93
94
  };
94
- if (form && isProps(form.cancelButton)) {
95
+ if (formProps && isProps(formProps.cancelButton)) {
95
96
  props = {
96
97
  ...props,
97
- ...form.cancelButton
98
+ ...formProps.cancelButton
98
99
  };
99
100
  }
100
101
  if (isProps(cancelButton)) {
@@ -123,10 +124,17 @@ const Dialog = _ref => {
123
124
  };
124
125
  let childrenElement;
125
126
  if (form) {
126
- form.cancelButton = getCancelButtonProps();
127
- form.footerClassName = classNames(form.footerClassName, `${baseClassName}__form-footer`);
128
- form.applyButton = form.applyButton || false;
129
- childrenElement = /*#__PURE__*/React.createElement(Form, form, children);
127
+ if ( /*#__PURE__*/isValidElement(form)) {
128
+ childrenElement = /*#__PURE__*/cloneElement(form, {
129
+ cancelButton: getCancelButtonProps(form.props),
130
+ footerClassName: classNames(form.props.footerClassName, `${baseClassName}__form-footer`)
131
+ });
132
+ } else if (typeof form === 'object') {
133
+ form.cancelButton = getCancelButtonProps();
134
+ form.footerClassName = classNames(form.footerClassName, `${baseClassName}__form-footer`);
135
+ form.applyButton = form.applyButton || false;
136
+ childrenElement = /*#__PURE__*/React.createElement(Form, form, children);
137
+ }
130
138
  } else {
131
139
  childrenElement = children;
132
140
  }
@@ -237,7 +245,7 @@ Dialog.propTypes = {
237
245
  * Wraps children into [Form](#!/Form) if not empty.
238
246
  * @since 0.0.68
239
247
  */
240
- form: PropTypes.object,
248
+ form: PropTypes.oneOfType([PropTypes.object, PropTypes.element]),
241
249
  /**
242
250
  * Dialog width
243
251
  * @since 0.0.68
@@ -271,7 +271,7 @@ class Form extends Component {
271
271
  ,
272
272
  children: /*#__PURE__*/React.createElement(Translate, {
273
273
  content: "Form.submitButton",
274
- fallback: "OK"
274
+ fallback: "Save"
275
275
  })
276
276
  }, submitButton));
277
277
  }
@@ -7,11 +7,13 @@ import { CLS_PREFIX } from '../../constants';
7
7
  import OnDarkContext from '../OnDarkContext';
8
8
  import { wrapFunction } from '../utils';
9
9
  import Icon from '../Icon';
10
+
11
+ // eslint-disable-next-line space-infix-ops
12
+
10
13
  /**
11
14
  * FIXME: With the following code all @ts-ignore comments can be removed, but react-docgen cannot parse it.
12
15
  * const Link = <P extends any>({ ... }: LinkProps<P>) => {
13
16
  */
14
-
15
17
  /**
16
18
  * `Link` is used for navigation purposes.
17
19
  * @since 1.9.0
@@ -365,14 +365,7 @@ class List extends Component {
365
365
  }
366
366
  componentDidMount() {
367
367
  if (this.props.reorderable) {
368
- import( /* webpackChunkName: "react-movable" */'@plesk/react-movable').then(_ref7 => {
369
- let {
370
- List: ReorderableList
371
- } = _ref7;
372
- this.setState({
373
- ReorderableList
374
- });
375
- });
368
+ this.applyReorderableList();
376
369
  }
377
370
  }
378
371
  componentDidUpdate(prevProps) {
@@ -388,6 +381,19 @@ class List extends Component {
388
381
  });
389
382
  this.needScroll = false;
390
383
  }
384
+ if (prevProps.reorderable !== this.props.reorderable && this.props.reorderable) {
385
+ this.applyReorderableList();
386
+ }
387
+ }
388
+ applyReorderableList() {
389
+ import( /* webpackChunkName: "react-movable" */'@plesk/react-movable').then(_ref7 => {
390
+ let {
391
+ List: ReorderableList
392
+ } = _ref7;
393
+ this.setState({
394
+ ReorderableList
395
+ });
396
+ });
391
397
  }
392
398
  getData() {
393
399
  const {
@@ -25,9 +25,7 @@ const Markdown = _ref => {
25
25
  [`${baseClassName}--compact`]: compact
26
26
  }, className),
27
27
  dangerouslySetInnerHTML: {
28
- __html: marked(children, {
29
- sanitize: true
30
- })
28
+ __html: marked(children)
31
29
  }
32
30
  }, props));
33
31
  };
@@ -4,8 +4,7 @@ import React from 'react';
4
4
  /**
5
5
  * `SelectOption` is a part of [SelectOptionGroup](#!/SelectOptionGroup) component.
6
6
  * @since 2.3.0
7
- */
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
+ */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
8
  const SelectOption = _props => {
10
9
  // styleguidist doesn't show Props & Methods if component renders nothing
11
10
  // eslint-disable-next-line no-constant-condition
@@ -9,6 +9,9 @@ import Text from '../Text';
9
9
  import Translate from '../Translate';
10
10
  import Focuser from '../Overlay/Focuser';
11
11
  import { safeInvoke } from '../utils';
12
+
13
+ // TODO: Use SpotSpotProps['popup'] instead of copypaste
14
+
12
15
  const SpotPopup = _ref => {
13
16
  let {
14
17
  baseClassName = `${CLS_PREFIX}spot-popup`,
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Copyright 1999-2018. Plesk International GmbH. All rights reserved.
2
2
  import svg4everybody from 'svg4everybody';
3
- const version = "3.31.1";
3
+ const version = "3.31.2";
4
4
  export * from './publicPath';
5
5
  export { version };
6
6
  export * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plesk/ui-library",
3
- "version": "3.31.1",
3
+ "version": "3.31.2",
4
4
  "description": "Plesk UI Library",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",
@@ -42,84 +42,84 @@
42
42
  "/index.js"
43
43
  ],
44
44
  "dependencies": {
45
- "@babel/runtime": "^7.15.4",
46
- "@babel/types": "^7.15.6",
47
- "@plesk/react-movable": "^2.6.0",
48
- "@types/classnames": "2.2.7",
49
- "@types/jest": "^23.3.12",
50
- "@types/marked": "^4.0.8",
51
- "@types/node": "^12.12.8",
52
- "@types/react": "16.8.13",
53
- "@types/react-dom": "16.8.4",
54
- "@types/react-measure": "2.0.8",
55
- "@types/react-transition-group": "^4.4.4",
56
- "@types/svg4everybody": "2.1.0",
57
- "classnames": "^2.3.1",
58
- "codemirror": "5.58.2 ",
59
- "jest": "^24.9.0",
45
+ "@babel/runtime": "^7.21.0",
46
+ "@plesk/react-movable": "^2.7.1",
47
+ "classnames": "^2.3.2",
48
+ "codemirror": "5.58.2",
60
49
  "marked": "4.2.12",
61
- "memoize-one": "^5.1.1",
50
+ "memoize-one": "^5.2.1",
62
51
  "popper.js": "1.14.3",
63
- "prop-types": "^15.7.2",
52
+ "prop-types": "^15.8.1",
64
53
  "react-measure": "2.3.0",
65
54
  "react-sortable-hoc": "0.6.8",
66
- "react-transition-group": "^4.4.2",
67
- "scroll-into-view-if-needed": "^2.2.20",
55
+ "react-transition-group": "^4.4.5",
56
+ "scroll-into-view-if-needed": "^2.2.31",
68
57
  "svg4everybody": "2.1.9",
69
- "use-focus-visible": "^1.0.0"
58
+ "use-focus-visible": "^1.0.2"
70
59
  },
71
60
  "devDependencies": {
72
- "@babel/core": "^7.15.8",
73
- "@babel/plugin-proposal-class-properties": "^7.14.5",
61
+ "@babel/core": "^7.21.4",
62
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
74
63
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
75
- "@babel/plugin-transform-runtime": "^7.15.8",
76
- "@babel/preset-env": "^7.15.8",
77
- "@babel/preset-react": "^7.14.5",
78
- "@babel/preset-typescript": "^7.15.0",
64
+ "@babel/plugin-transform-runtime": "^7.21.4",
65
+ "@babel/preset-env": "^7.21.4",
66
+ "@babel/preset-react": "^7.18.6",
67
+ "@babel/preset-typescript": "^7.21.4",
68
+ "@babel/types": "^7.21.4",
79
69
  "@csstools/postcss-logical-float-and-clear": "^1.0.1",
80
70
  "@plesk/eslint-config": "^1.1.0",
81
71
  "@plesk/stylelint-config": "^1.0.0",
82
72
  "@types/buble": "^0.19.2",
83
- "@types/cheerio": "^0.22.30",
73
+ "@types/cheerio": "^0.22.31",
74
+ "@types/classnames": "2.2.7",
84
75
  "@types/doctrine": "^0.0.3",
85
- "@types/enzyme": "^3.10.9",
86
- "@typescript-eslint/eslint-plugin": "^2.7.0",
87
- "@typescript-eslint/parser": "^2.7.0",
88
- "autoprefixer": "^10.4.13",
89
- "babel-loader": "^8.2.3",
76
+ "@types/enzyme": "^3.10.12",
77
+ "@types/jest": "^23.3.14",
78
+ "@types/marked": "^4.0.8",
79
+ "@types/node": "^12.20.55",
80
+ "@types/react": "^16.14.38",
81
+ "@types/react-dom": "^16.9.18",
82
+ "@types/react-measure": "2.0.8",
83
+ "@types/react-transition-group": "^4.4.5",
84
+ "@types/svg4everybody": "2.1.0",
85
+ "@typescript-eslint/eslint-plugin": "^2.34.0",
86
+ "@typescript-eslint/parser": "^2.34.0",
87
+ "autoprefixer": "^10.4.14",
88
+ "babel-loader": "^8.3.0",
90
89
  "babel-plugin-dynamic-import-node": "^2.3.3",
91
90
  "babel-plugin-transform-require-ignore": "^0.1.1",
92
91
  "clean-webpack-plugin": "^4.0.0",
93
- "cross-env": "^5.2.0",
94
- "css-loader": "^6.7.1",
92
+ "cross-env": "^5.2.1",
93
+ "css-loader": "^6.7.3",
95
94
  "css-minimizer-webpack-plugin": "^4.2.2",
96
95
  "enzyme": "^3.11.0",
97
- "enzyme-adapter-react-16": "^1.15.6",
96
+ "enzyme-adapter-react-16": "^1.15.7",
98
97
  "enzyme-to-json": "^3.6.2",
99
- "eslint-config-prettier": "^6.11.0",
98
+ "eslint-config-prettier": "^6.15.0",
100
99
  "eslint-plugin-markdown": "^1.0.2",
101
- "eslint-plugin-prettier": "^3.1.3",
102
- "fs-extra": "^7.0.0",
100
+ "eslint-plugin-prettier": "^3.4.1",
101
+ "fs-extra": "^7.0.1",
103
102
  "html-webpack-plugin": "^5.5.0",
104
- "inquirer": "^3.2.1",
103
+ "inquirer": "^3.3.0",
104
+ "jest": "^24.9.0",
105
105
  "jest-dev-server": "^4.4.0",
106
- "jest-image-snapshot": "^4.0.2",
106
+ "jest-image-snapshot": "^4.5.1",
107
107
  "less": "^4.1.3",
108
108
  "less-loader": "^11.1.0",
109
- "mini-css-extract-plugin": "^2.6.1",
109
+ "mini-css-extract-plugin": "^2.7.5",
110
110
  "postcss": "^8.4.21",
111
111
  "postcss-less": "^6.0.0",
112
- "postcss-loader": "^7.0.2",
112
+ "postcss-loader": "^7.2.4",
113
113
  "postcss-logical": "^6.1.0",
114
- "prettier": "^2.8.4",
114
+ "prettier": "^2.8.7",
115
115
  "puppeteer-core": "13.1.3",
116
- "react": "^16.8.6",
117
- "react-dom": "^16.8.6",
116
+ "react": "^16.14.0",
117
+ "react-dom": "^16.14.0",
118
118
  "react-styleguidist": "^12.0.1",
119
- "react-test-renderer": "^16.8.6",
120
- "rimraf": "^3.0.1",
119
+ "react-test-renderer": "^16.14.0",
120
+ "rimraf": "^3.0.2",
121
121
  "rtlcss": "^4.0.0",
122
- "style-loader": "^3.3.1",
122
+ "style-loader": "^3.3.2",
123
123
  "stylelint": "^14.16.1",
124
124
  "stylelint-config-prettier": "^9.0.5",
125
125
  "stylelint-declaration-block-no-ignored-properties": "^2.7.0",
@@ -127,9 +127,9 @@
127
127
  "stylelint-prettier": "^2.0.0",
128
128
  "stylelint-use-logical-spec": "^5.0.0",
129
129
  "svg-mixer": "^2.3.14",
130
- "terser-webpack-plugin": "^5.2.4",
130
+ "terser-webpack-plugin": "^5.3.7",
131
131
  "typescript": "3.7.2",
132
- "webpack": "^5.75.0",
132
+ "webpack": "^5.78.0",
133
133
  "webpack-cli": "^5.0.1"
134
134
  },
135
135
  "peerDependencies": {
@@ -139,6 +139,7 @@
139
139
  "resolutions": {
140
140
  "@babel/types": "^7.15.6",
141
141
  "@types/node": "^12.12.8",
142
+ "@types/react": "^16.14.35",
142
143
  "**/caniuse-lite": "1.0.30001430",
143
144
  "trim": "0.0.3",
144
145
  "postcss": "8.4.21"