@plesk/ui-library 3.40.5 → 3.40.6
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/cjs/components/Carousel/Carousel.js +0 -14
- package/cjs/components/LocaleProvider/LocaleProvider.js +17 -1
- package/cjs/components/StatusMessage/StatusMessage.js +1 -0
- package/cjs/components/Tabs/SearchBar.js +12 -13
- package/cjs/components/index.js +21 -11
- package/cjs/hooks/useSqueeze.js +3 -1
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +56 -42
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Carousel/Carousel.js +0 -14
- package/esm/components/LocaleProvider/LocaleProvider.js +16 -1
- package/esm/components/StatusMessage/StatusMessage.js +1 -0
- package/esm/components/Tabs/SearchBar.js +12 -13
- package/esm/components/index.js +1 -2
- package/esm/hooks/useSqueeze.js +3 -1
- package/esm/index.js +1 -1
- package/package.json +10 -10
- package/styleguide/build/bundle.9eeb2c9d.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +1 -0
- package/types/src/components/index.d.ts +2 -2
- package/styleguide/build/bundle.f0d21187.js +0 -2
- /package/styleguide/build/{bundle.f0d21187.js.LICENSE.txt → bundle.9eeb2c9d.js.LICENSE.txt} +0 -0
|
@@ -190,20 +190,6 @@ class Carousel extends Component {
|
|
|
190
190
|
if (prevProps.autoplay !== this.props.autoplay) {
|
|
191
191
|
this.props.autoplay ? this.play() : this.stop();
|
|
192
192
|
}
|
|
193
|
-
const {
|
|
194
|
-
width
|
|
195
|
-
} = this.rootRef.current.getBoundingClientRect();
|
|
196
|
-
const {
|
|
197
|
-
slideWidths,
|
|
198
|
-
totalWidth
|
|
199
|
-
} = calcWidths(this.genuineRef.current);
|
|
200
|
-
if (this.state.totalWidth !== totalWidth) {
|
|
201
|
-
this.setState({
|
|
202
|
-
slideWidths,
|
|
203
|
-
totalWidth,
|
|
204
|
-
showControls: width < totalWidth
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
193
|
}
|
|
208
194
|
componentWillUnmount() {
|
|
209
195
|
this.stop();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import { PureComponent, isValidElement, cloneElement, createContext, useContext, useCallback } from 'react';
|
|
4
|
+
import { PureComponent, isValidElement, cloneElement, createContext, useContext, useCallback, useMemo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const applyParams = function (message) {
|
|
@@ -71,6 +71,21 @@ export const useTranslate = namespace => {
|
|
|
71
71
|
return typeof fallback === 'string' ? applyParams(fallback, params) : `[${key}]`;
|
|
72
72
|
}, [context, namespace]);
|
|
73
73
|
};
|
|
74
|
+
export const LocaleBetaProvider = _ref => {
|
|
75
|
+
let {
|
|
76
|
+
messages,
|
|
77
|
+
children
|
|
78
|
+
} = _ref;
|
|
79
|
+
const value = useMemo(() => ({
|
|
80
|
+
locale: {
|
|
81
|
+
lmsg: createTranslate(messages)
|
|
82
|
+
}
|
|
83
|
+
}), [messages]);
|
|
84
|
+
return /*#__PURE__*/_jsx(LocaleContext.Provider, {
|
|
85
|
+
value: value,
|
|
86
|
+
children: children
|
|
87
|
+
});
|
|
88
|
+
};
|
|
74
89
|
/**
|
|
75
90
|
* LocaleProvider provides a uniform localization support for built-in text of components.
|
|
76
91
|
* @since 0.0.42
|
|
@@ -7,7 +7,6 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
7
7
|
import { isRtl } from '../../utils';
|
|
8
8
|
import Badge from '../Badge';
|
|
9
9
|
import Button from '../Button';
|
|
10
|
-
import ButtonGroup from '../ButtonGroup';
|
|
11
10
|
import DistractionFreeModeContext from '../DistractionFreeModeContext';
|
|
12
11
|
import Input from '../Input';
|
|
13
12
|
import Menu, { MenuItem, MenuSelectableItem } from '../Menu';
|
|
@@ -339,7 +338,7 @@ class SearchBar extends Component {
|
|
|
339
338
|
} = this.state;
|
|
340
339
|
const isCollapsed = this.isResponsive();
|
|
341
340
|
const distractionFreeModeEnabled = Boolean(distractionFreeMode && distractionFreeMode.enabled);
|
|
342
|
-
return /*#__PURE__*/
|
|
341
|
+
return /*#__PURE__*/_jsx("div", {
|
|
343
342
|
className: classNames(baseClassName, {
|
|
344
343
|
[`${baseClassName}--focused`]: focused
|
|
345
344
|
}, className),
|
|
@@ -348,16 +347,16 @@ class SearchBar extends Component {
|
|
|
348
347
|
minWidth
|
|
349
348
|
},
|
|
350
349
|
...props,
|
|
351
|
-
children:
|
|
350
|
+
children: isCollapsed && (collapsable || !distractionFreeModeEnabled) ? /*#__PURE__*/_jsx(Badge, {
|
|
351
|
+
intent: "info",
|
|
352
|
+
hidden: !value,
|
|
353
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
354
|
+
icon: "search",
|
|
355
|
+
onClick: this.handleExpand
|
|
356
|
+
})
|
|
357
|
+
}) : /*#__PURE__*/_jsxs("div", {
|
|
352
358
|
className: `${baseClassName}__group`,
|
|
353
|
-
children:
|
|
354
|
-
intent: "info",
|
|
355
|
-
hidden: !value,
|
|
356
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
357
|
-
icon: "search",
|
|
358
|
-
onClick: this.handleExpand
|
|
359
|
-
})
|
|
360
|
-
}) : /*#__PURE__*/_jsx(Input, {
|
|
359
|
+
children: [/*#__PURE__*/_jsx(Input, {
|
|
361
360
|
innerRef: ref => this.search = ref,
|
|
362
361
|
className: `${baseClassName}__input`,
|
|
363
362
|
size: "fill",
|
|
@@ -387,8 +386,8 @@ class SearchBar extends Component {
|
|
|
387
386
|
ghost: true
|
|
388
387
|
})]
|
|
389
388
|
})
|
|
390
|
-
})
|
|
391
|
-
})
|
|
389
|
+
}), Array.isArray(results) && this.renderResults(results), results && !Array.isArray(results) && results.type === Menu && this.renderResultsMenu(results)]
|
|
390
|
+
})
|
|
392
391
|
});
|
|
393
392
|
}
|
|
394
393
|
}
|
package/esm/components/index.js
CHANGED
|
@@ -53,8 +53,7 @@ export { default as ItemList } from './ItemList';
|
|
|
53
53
|
export { default as Label } from './Label';
|
|
54
54
|
export { default as Layout } from './Layout';
|
|
55
55
|
export { default as List, ListActions, ListAction, ListOperation, ListEmptyView, ListActionsDivider } from './List';
|
|
56
|
-
export { default as LocaleProvider } from './LocaleProvider';
|
|
57
|
-
export * from './LocaleProvider';
|
|
56
|
+
export { default as LocaleProvider, useTranslate, LocaleContext, LocaleBetaProvider } from './LocaleProvider';
|
|
58
57
|
export { default as Markdown } from './Markdown';
|
|
59
58
|
export { default as Media, MediaSection } from './Media';
|
|
60
59
|
export { default as Menu, MenuDivider, MenuHeader, MenuItem, MenuSelectableItem, MenuBaseItem } from './Menu';
|
package/esm/hooks/useSqueeze.js
CHANGED
|
@@ -21,7 +21,9 @@ export const useSqueeze = _ref => {
|
|
|
21
21
|
if (!ref.current) return;
|
|
22
22
|
const root = ref.current;
|
|
23
23
|
const width = Math.ceil(root.getBoundingClientRect().width);
|
|
24
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
scrollWidth
|
|
26
|
+
} = root;
|
|
25
27
|
let isCompactChanged = false;
|
|
26
28
|
if (scrollWidth > width) {
|
|
27
29
|
isCompactChanged = compact();
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.6",
|
|
4
4
|
"description": "Plesk UI Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"/index.js"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/runtime": "^7.24.
|
|
46
|
+
"@babel/runtime": "^7.24.8",
|
|
47
47
|
"@plesk/react-movable": "^2.7.1",
|
|
48
48
|
"classnames": "^2.5.1",
|
|
49
49
|
"codemirror": "5.58.2",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"use-focus-visible": "^1.0.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@babel/core": "^7.24.
|
|
62
|
+
"@babel/core": "^7.24.9",
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
64
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
65
65
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
66
|
-
"@babel/preset-env": "^7.24.
|
|
66
|
+
"@babel/preset-env": "^7.24.8",
|
|
67
67
|
"@babel/preset-react": "^7.24.7",
|
|
68
68
|
"@babel/preset-typescript": "^7.24.7",
|
|
69
|
-
"@babel/types": "^7.24.
|
|
69
|
+
"@babel/types": "^7.24.9",
|
|
70
70
|
"@csstools/postcss-logical-float-and-clear": "^1.0.1",
|
|
71
71
|
"@plesk/eslint-config": "^3.0.0",
|
|
72
72
|
"@plesk/stylelint-config": "^2.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/jest": "^29.5.12",
|
|
82
82
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
83
83
|
"@types/marked": "^4.3.2",
|
|
84
|
-
"@types/node": "^16.18.
|
|
84
|
+
"@types/node": "^16.18.101",
|
|
85
85
|
"@types/react": "^18.3.3",
|
|
86
86
|
"@types/react-dom": "^18.3.0",
|
|
87
87
|
"@types/react-measure": "2.0.9",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"less": "^4.2.0",
|
|
109
109
|
"less-loader": "^11.1.4",
|
|
110
110
|
"mini-css-extract-plugin": "^2.9.0",
|
|
111
|
-
"postcss": "^8.4.
|
|
111
|
+
"postcss": "^8.4.39",
|
|
112
112
|
"postcss-less": "^6.0.0",
|
|
113
113
|
"postcss-loader": "^7.3.4",
|
|
114
114
|
"postcss-logical": "^6.2.0",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"react": "^18.3.1",
|
|
118
118
|
"react-docgen-typescript": "^2.2.2",
|
|
119
119
|
"react-dom": "^18.3.1",
|
|
120
|
-
"react-styleguidist": "^13.1.
|
|
121
|
-
"rimraf": "^5.0.
|
|
120
|
+
"react-styleguidist": "^13.1.3",
|
|
121
|
+
"rimraf": "^5.0.9",
|
|
122
122
|
"rtlcss": "^4.1.1",
|
|
123
123
|
"style-loader": "^3.3.4",
|
|
124
124
|
"stylelint": "^15.11.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"svg-mixer": "^2.3.14",
|
|
130
130
|
"terser-webpack-plugin": "^5.3.10",
|
|
131
131
|
"typescript": "5.2.2",
|
|
132
|
-
"webpack": "^5.
|
|
132
|
+
"webpack": "^5.93.0",
|
|
133
133
|
"webpack-cli": "^5.1.4"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|