@plesk/ui-library 3.40.6 → 3.40.7
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/Badge/Badge.js +2 -2
- package/cjs/components/SegmentedControl/SegmentedControl.js +12 -10
- package/cjs/components/Subnav/Subnav.js +1 -1
- package/cjs/components/Toolbar/RegistryContext.js +90 -31
- package/cjs/components/Toolbar/Toolbar.js +5 -80
- package/cjs/components/Toolbar/ToolbarGroup.js +6 -159
- package/cjs/components/Toolbar/ToolbarItem.js +15 -59
- 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 +48 -379
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +6 -6
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Badge/Badge.js +2 -2
- package/esm/components/SegmentedControl/SegmentedControl.js +12 -10
- package/esm/components/Subnav/Subnav.js +1 -1
- package/esm/components/Toolbar/RegistryContext.js +87 -30
- package/esm/components/Toolbar/Toolbar.js +7 -82
- package/esm/components/Toolbar/ToolbarGroup.js +7 -160
- package/esm/components/Toolbar/ToolbarItem.js +15 -59
- package/esm/index.js +1 -1
- package/package.json +20 -22
- package/styleguide/build/bundle.52d1d9a1.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/Toolbar/RegistryContext.d.ts +22 -13
- package/types/src/components/Toolbar/Toolbar.d.ts +8 -8
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +6 -16
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/cjs/components/Toolbar/RegistryContextBeta.js +0 -112
- package/esm/components/Toolbar/RegistryContextBeta.js +0 -103
- package/styleguide/build/bundle.9eeb2c9d.js +0 -2
- package/types/src/components/Toolbar/RegistryContextBeta.d.ts +0 -25
- /package/styleguide/build/{bundle.9eeb2c9d.js.LICENSE.txt → bundle.52d1d9a1.js.LICENSE.txt} +0 -0
package/dist/plesk-ui-library.js
CHANGED
|
@@ -1150,7 +1150,7 @@ const Badge = _ref => {
|
|
|
1150
1150
|
hidden,
|
|
1151
1151
|
...props
|
|
1152
1152
|
} = _ref;
|
|
1153
|
-
const
|
|
1153
|
+
const isEmpty = !label && label !== 0;
|
|
1154
1154
|
if (_react.Children.toArray(children).length && !hidden) {
|
|
1155
1155
|
if (! /*#__PURE__*/(0, _react.isValidElement)(label)) {
|
|
1156
1156
|
label = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.default, {
|
|
@@ -1161,7 +1161,7 @@ const Badge = _ref => {
|
|
|
1161
1161
|
if ( /*#__PURE__*/(0, _react.isValidElement)(label)) {
|
|
1162
1162
|
const cloneProps = {
|
|
1163
1163
|
className: (0, _classnames.default)(`${baseClassName}__value`, {
|
|
1164
|
-
[`${baseClassName}__value--dot`]:
|
|
1164
|
+
[`${baseClassName}__value--dot`]: isEmpty
|
|
1165
1165
|
}, label.props.className)
|
|
1166
1166
|
};
|
|
1167
1167
|
if (intent && (label.type === _Label.default || label.type === _Icon.default)) {
|
|
@@ -17070,26 +17070,28 @@ class SegmentedControl extends _react.Component {
|
|
|
17070
17070
|
const {
|
|
17071
17071
|
selected
|
|
17072
17072
|
} = this.state;
|
|
17073
|
+
let prevSelected = selected;
|
|
17073
17074
|
let newSelected;
|
|
17074
17075
|
if (multiple) {
|
|
17075
|
-
|
|
17076
|
-
|
|
17076
|
+
const isSelectedArray = Array.isArray(selected);
|
|
17077
|
+
newSelected = isSelectedArray ? [...selected] : [];
|
|
17078
|
+
if (!isSelectedArray || selected.indexOf(value) === -1) {
|
|
17077
17079
|
newSelected.push(value);
|
|
17078
17080
|
} else {
|
|
17079
17081
|
newSelected.splice(selected.indexOf(value), 1);
|
|
17080
17082
|
}
|
|
17081
17083
|
newSelected.sort(alphaSort);
|
|
17082
|
-
|
|
17083
|
-
selected
|
|
17084
|
-
});
|
|
17085
|
-
if (JSON.stringify(newSelected) !== JSON.stringify(selected)) {
|
|
17086
|
-
onChange?.(newSelected);
|
|
17084
|
+
if (isSelectedArray) {
|
|
17085
|
+
prevSelected = [...selected].sort(alphaSort);
|
|
17087
17086
|
}
|
|
17088
17087
|
} else {
|
|
17089
17088
|
newSelected = value;
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17089
|
+
}
|
|
17090
|
+
if (JSON.stringify(prevSelected) !== JSON.stringify(newSelected)) {
|
|
17091
|
+
this.setState({
|
|
17092
|
+
selected: newSelected
|
|
17093
|
+
});
|
|
17094
|
+
onChange?.(newSelected);
|
|
17093
17095
|
}
|
|
17094
17096
|
});
|
|
17095
17097
|
_defineProperty(this, "compact", () => {
|
|
@@ -19237,7 +19239,7 @@ const SubnavItem = _ref2 => {
|
|
|
19237
19239
|
} = _ref2;
|
|
19238
19240
|
return /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
19239
19241
|
className: (0, _classnames.default)(baseClassName, active && `${baseClassName}--active`, className),
|
|
19240
|
-
tabIndex:
|
|
19242
|
+
tabIndex: 0,
|
|
19241
19243
|
...props
|
|
19242
19244
|
});
|
|
19243
19245
|
};
|
|
@@ -21379,69 +21381,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21379
21381
|
"use strict";
|
|
21380
21382
|
|
|
21381
21383
|
|
|
21382
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
21383
|
-
value: true
|
|
21384
|
-
}));
|
|
21385
|
-
exports["default"] = exports.createRegistry = void 0;
|
|
21386
|
-
var _react = __webpack_require__(/*! react */ "react");
|
|
21387
|
-
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21388
|
-
|
|
21389
|
-
const RegistryContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
21390
|
-
RegistryContext.displayName = 'RegistryContext';
|
|
21391
|
-
var _default = exports["default"] = RegistryContext;
|
|
21392
|
-
const createRegistry = () => ({
|
|
21393
|
-
stack: [],
|
|
21394
|
-
register(item) {
|
|
21395
|
-
this.stack.push(item);
|
|
21396
|
-
},
|
|
21397
|
-
unregister(item) {
|
|
21398
|
-
this.stack = this.stack.filter(i => i !== item);
|
|
21399
|
-
},
|
|
21400
|
-
uncompact() {
|
|
21401
|
-
let changed = false;
|
|
21402
|
-
this.stack.every(item => {
|
|
21403
|
-
if (item.isCompact(true)) {
|
|
21404
|
-
item.setCompact(false);
|
|
21405
|
-
changed = true;
|
|
21406
|
-
return false;
|
|
21407
|
-
}
|
|
21408
|
-
return true;
|
|
21409
|
-
});
|
|
21410
|
-
return changed;
|
|
21411
|
-
},
|
|
21412
|
-
compact() {
|
|
21413
|
-
let changed = false;
|
|
21414
|
-
[...this.stack].reverse().every(item => {
|
|
21415
|
-
if (!item.isCompact(false)) {
|
|
21416
|
-
item.setCompact(true);
|
|
21417
|
-
changed = true;
|
|
21418
|
-
return false;
|
|
21419
|
-
}
|
|
21420
|
-
return true;
|
|
21421
|
-
});
|
|
21422
|
-
return changed;
|
|
21423
|
-
},
|
|
21424
|
-
isCompact() {
|
|
21425
|
-
let one = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
21426
|
-
if (one) {
|
|
21427
|
-
return this.stack.some(item => item.isCompact(one));
|
|
21428
|
-
}
|
|
21429
|
-
return this.stack.every(item => item.isCompact(one));
|
|
21430
|
-
}
|
|
21431
|
-
});
|
|
21432
|
-
exports.createRegistry = createRegistry;
|
|
21433
|
-
|
|
21434
|
-
/***/ }),
|
|
21435
|
-
|
|
21436
|
-
/***/ "./components/Toolbar/RegistryContextBeta.tsx":
|
|
21437
|
-
/*!****************************************************!*\
|
|
21438
|
-
!*** ./components/Toolbar/RegistryContextBeta.tsx ***!
|
|
21439
|
-
\****************************************************/
|
|
21440
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21441
|
-
|
|
21442
|
-
"use strict";
|
|
21443
|
-
|
|
21444
|
-
|
|
21445
21384
|
Object.defineProperty(exports, "__esModule", ({
|
|
21446
21385
|
value: true
|
|
21447
21386
|
}));
|
|
@@ -21571,21 +21510,17 @@ var _react = __webpack_require__(/*! react */ "react");
|
|
|
21571
21510
|
var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
|
|
21572
21511
|
var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
|
|
21573
21512
|
var _RegistryContext = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
|
|
21574
|
-
var _RegistryContextBeta = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContextBeta */ "./components/Toolbar/RegistryContextBeta.tsx"));
|
|
21575
21513
|
var _DistractionFreeModeContext = _interopRequireDefault(__webpack_require__(/*! ../DistractionFreeModeContext */ "./components/DistractionFreeModeContext/index.tsx"));
|
|
21576
21514
|
var _ToolbarItem = __webpack_require__(/*! ./ToolbarItem */ "./components/Toolbar/ToolbarItem.tsx");
|
|
21577
|
-
var _Squeezer = _interopRequireDefault(__webpack_require__(/*! ../Squeezer */ "./components/Squeezer/index.tsx"));
|
|
21578
21515
|
var _hooks = __webpack_require__(/*! ../../hooks */ "./hooks/index.tsx");
|
|
21579
|
-
var _ToolbarBetaProvider = __webpack_require__(/*! ./ToolbarBetaProvider */ "./components/Toolbar/ToolbarBetaProvider.tsx");
|
|
21580
21516
|
__webpack_require__(/*! ../../helpers/base.less */ "./helpers/base.less");
|
|
21581
21517
|
__webpack_require__(/*! ./Toolbar.less */ "./components/Toolbar/Toolbar.less");
|
|
21582
21518
|
var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
|
|
21583
21519
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21584
21520
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21585
21521
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21586
|
-
|
|
21587
|
-
|
|
21588
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21522
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21523
|
+
|
|
21589
21524
|
/**
|
|
21590
21525
|
* `Toolbar` component is a panel containing various instruments used for managing the contents of a large content block.
|
|
21591
21526
|
* Toolbar is located on top of the managed content block.
|
|
@@ -21593,93 +21528,31 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
21593
21528
|
* and controls for changing the way the content block looks.
|
|
21594
21529
|
* @since 0.0.57
|
|
21595
21530
|
*/
|
|
21596
|
-
|
|
21597
|
-
constructor(props) {
|
|
21598
|
-
super(props);
|
|
21599
|
-
_defineProperty(this, "state", {
|
|
21600
|
-
distractionFreeMode: {
|
|
21601
|
-
enabled: false,
|
|
21602
|
-
toggle: () => {
|
|
21603
|
-
this.setState(prevState => ({
|
|
21604
|
-
distractionFreeMode: {
|
|
21605
|
-
...prevState.distractionFreeMode,
|
|
21606
|
-
enabled: !prevState.distractionFreeMode.enabled
|
|
21607
|
-
}
|
|
21608
|
-
}), () => {
|
|
21609
|
-
this.measure();
|
|
21610
|
-
});
|
|
21611
|
-
}
|
|
21612
|
-
}
|
|
21613
|
-
});
|
|
21614
|
-
_defineProperty(this, "registry", void 0);
|
|
21615
|
-
_defineProperty(this, "measure", void 0);
|
|
21616
|
-
this.registry = (0, _RegistryContext.createRegistry)();
|
|
21617
|
-
this.measure = () => {};
|
|
21618
|
-
}
|
|
21619
|
-
render() {
|
|
21620
|
-
const {
|
|
21621
|
-
baseClassName,
|
|
21622
|
-
className,
|
|
21623
|
-
children,
|
|
21624
|
-
...props
|
|
21625
|
-
} = this.props;
|
|
21626
|
-
const toolbarItems = (0, _ToolbarItem.toToolbarItems)(children);
|
|
21627
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Squeezer.default, {
|
|
21628
|
-
compact: () => this.registry.compact(),
|
|
21629
|
-
uncompact: () => this.registry.uncompact(),
|
|
21630
|
-
innerMeasure: measure => {
|
|
21631
|
-
this.measure = measure;
|
|
21632
|
-
},
|
|
21633
|
-
children: _ref => {
|
|
21634
|
-
let {
|
|
21635
|
-
ref
|
|
21636
|
-
} = _ref;
|
|
21637
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21638
|
-
ref: ref,
|
|
21639
|
-
className: (0, _classnames.default)(baseClassName, className),
|
|
21640
|
-
...props,
|
|
21641
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContext.default.Provider, {
|
|
21642
|
-
value: this.registry,
|
|
21643
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
|
|
21644
|
-
value: this.state.distractionFreeMode,
|
|
21645
|
-
children: toolbarItems
|
|
21646
|
-
})
|
|
21647
|
-
})
|
|
21648
|
-
});
|
|
21649
|
-
}
|
|
21650
|
-
});
|
|
21651
|
-
}
|
|
21652
|
-
}
|
|
21653
|
-
_defineProperty(ToolbarClassComponent, "defaultProps", {
|
|
21654
|
-
children: null,
|
|
21655
|
-
className: null,
|
|
21656
|
-
baseClassName: `${_constants.CLS_PREFIX}toolbar`
|
|
21657
|
-
});
|
|
21658
|
-
const ToolbarBeta = _ref2 => {
|
|
21531
|
+
const Toolbar = _ref => {
|
|
21659
21532
|
let {
|
|
21660
21533
|
children,
|
|
21661
21534
|
className,
|
|
21662
21535
|
baseClassName = `${_constants.CLS_PREFIX}toolbar`,
|
|
21663
21536
|
...props
|
|
21664
|
-
} =
|
|
21537
|
+
} = _ref;
|
|
21665
21538
|
const containerRef = (0, _react.useRef)(null);
|
|
21666
21539
|
const [isDistractionFreeModeEnabled, setIsDistractionFreeModeEnabled] = (0, _react.useState)(false);
|
|
21667
21540
|
const distractionFreeModeContextValue = (0, _react.useMemo)(() => ({
|
|
21668
21541
|
enabled: isDistractionFreeModeEnabled,
|
|
21669
21542
|
toggle: () => setIsDistractionFreeModeEnabled(current => !current)
|
|
21670
21543
|
}), [isDistractionFreeModeEnabled]);
|
|
21671
|
-
const registry = (0,
|
|
21544
|
+
const registry = (0, _RegistryContext.useRegistry)();
|
|
21672
21545
|
(0, _hooks.useSqueeze)({
|
|
21673
21546
|
ref: containerRef,
|
|
21674
21547
|
compact: () => registry.compact(),
|
|
21675
21548
|
expand: () => registry.expand()
|
|
21676
21549
|
});
|
|
21677
|
-
const toolbarItems = (0, _ToolbarItem.toToolbarItems)(children
|
|
21550
|
+
const toolbarItems = (0, _ToolbarItem.toToolbarItems)(children);
|
|
21678
21551
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21679
21552
|
ref: containerRef,
|
|
21680
21553
|
className: (0, _classnames.default)(baseClassName, className),
|
|
21681
21554
|
...props,
|
|
21682
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
21555
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContext.default.Provider, {
|
|
21683
21556
|
value: registry,
|
|
21684
21557
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
|
|
21685
21558
|
value: distractionFreeModeContextValue,
|
|
@@ -21688,14 +21561,6 @@ const ToolbarBeta = _ref2 => {
|
|
|
21688
21561
|
})
|
|
21689
21562
|
});
|
|
21690
21563
|
};
|
|
21691
|
-
const Toolbar = props => {
|
|
21692
|
-
const isToolbarBeta = (0, _ToolbarBetaProvider.useToolbarBetaContext)();
|
|
21693
|
-
return isToolbarBeta ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarBeta, {
|
|
21694
|
-
...props
|
|
21695
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarClassComponent, {
|
|
21696
|
-
...props
|
|
21697
|
-
});
|
|
21698
|
-
};
|
|
21699
21564
|
var _default = exports["default"] = Toolbar;
|
|
21700
21565
|
|
|
21701
21566
|
/***/ }),
|
|
@@ -21800,165 +21665,21 @@ var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
|
|
|
21800
21665
|
var _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../Dropdown */ "./components/Dropdown/index.tsx"));
|
|
21801
21666
|
var _ToolbarMenu = _interopRequireDefault(__webpack_require__(/*! ./ToolbarMenu */ "./components/Toolbar/ToolbarMenu.tsx"));
|
|
21802
21667
|
var _RegistryContext = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
|
|
21803
|
-
var _RegistryContextBeta = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContextBeta */ "./components/Toolbar/RegistryContextBeta.tsx"));
|
|
21804
21668
|
var _DistractionFreeModeContext = _interopRequireDefault(__webpack_require__(/*! ../DistractionFreeModeContext */ "./components/DistractionFreeModeContext/index.tsx"));
|
|
21805
21669
|
var _ToolbarItem = __webpack_require__(/*! ./ToolbarItem */ "./components/Toolbar/ToolbarItem.tsx");
|
|
21806
21670
|
var _ToolbarExpander = _interopRequireDefault(__webpack_require__(/*! ./ToolbarExpander */ "./components/Toolbar/ToolbarExpander.tsx"));
|
|
21807
|
-
var _ToolbarBetaProvider = __webpack_require__(/*! ./ToolbarBetaProvider */ "./components/Toolbar/ToolbarBetaProvider.tsx");
|
|
21808
21671
|
var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
|
|
21809
21672
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21810
21673
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21811
21674
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21675
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21676
|
+
|
|
21815
21677
|
/**
|
|
21816
21678
|
* `ToolbarGroup` is a part of [Toolbar](#!/Toolbar) component.
|
|
21817
21679
|
* It is used for grouping several toolbar controls together.
|
|
21818
21680
|
* @since 0.0.57
|
|
21819
21681
|
*/
|
|
21820
|
-
|
|
21821
|
-
constructor(props) {
|
|
21822
|
-
super(props);
|
|
21823
|
-
_defineProperty(this, "state", {
|
|
21824
|
-
compact: false,
|
|
21825
|
-
availableInDistractionFreeMode: false,
|
|
21826
|
-
distractionFreeMode: {
|
|
21827
|
-
enabled: false,
|
|
21828
|
-
toggle: () => {
|
|
21829
|
-
if (this.props.distractionFreeMode) {
|
|
21830
|
-
this.props.distractionFreeMode.toggle();
|
|
21831
|
-
this.setState({
|
|
21832
|
-
availableInDistractionFreeMode: !this.props.distractionFreeMode.enabled
|
|
21833
|
-
});
|
|
21834
|
-
}
|
|
21835
|
-
}
|
|
21836
|
-
}
|
|
21837
|
-
});
|
|
21838
|
-
_defineProperty(this, "registry", void 0);
|
|
21839
|
-
_defineProperty(this, "selfApi", void 0);
|
|
21840
|
-
_defineProperty(this, "childrenApi", void 0);
|
|
21841
|
-
this.registry = (0, _RegistryContext.createRegistry)();
|
|
21842
|
-
this.selfApi = {
|
|
21843
|
-
isCompact: () => this.state.compact,
|
|
21844
|
-
setCompact: compact => {
|
|
21845
|
-
this.setState({
|
|
21846
|
-
compact
|
|
21847
|
-
});
|
|
21848
|
-
}
|
|
21849
|
-
};
|
|
21850
|
-
this.childrenApi = {
|
|
21851
|
-
isCompact: one => this.registry.isCompact(one),
|
|
21852
|
-
setCompact: compact => {
|
|
21853
|
-
if (compact) {
|
|
21854
|
-
this.registry.compact();
|
|
21855
|
-
} else {
|
|
21856
|
-
this.registry.uncompact();
|
|
21857
|
-
}
|
|
21858
|
-
}
|
|
21859
|
-
};
|
|
21860
|
-
}
|
|
21861
|
-
static getDerivedStateFromProps(props, state) {
|
|
21862
|
-
if (props.distractionFreeMode) {
|
|
21863
|
-
return {
|
|
21864
|
-
distractionFreeMode: {
|
|
21865
|
-
...state.distractionFreeMode,
|
|
21866
|
-
enabled: props.distractionFreeMode.enabled
|
|
21867
|
-
}
|
|
21868
|
-
};
|
|
21869
|
-
}
|
|
21870
|
-
return null;
|
|
21871
|
-
}
|
|
21872
|
-
componentDidMount() {
|
|
21873
|
-
const {
|
|
21874
|
-
registry
|
|
21875
|
-
} = this.props;
|
|
21876
|
-
if (registry) {
|
|
21877
|
-
registry.register(this.selfApi);
|
|
21878
|
-
registry.register(this.childrenApi);
|
|
21879
|
-
}
|
|
21880
|
-
}
|
|
21881
|
-
componentWillUnmount() {
|
|
21882
|
-
const {
|
|
21883
|
-
registry
|
|
21884
|
-
} = this.props;
|
|
21885
|
-
if (registry) {
|
|
21886
|
-
registry.unregister(this.selfApi);
|
|
21887
|
-
registry.unregister(this.childrenApi);
|
|
21888
|
-
}
|
|
21889
|
-
}
|
|
21890
|
-
render() {
|
|
21891
|
-
const {
|
|
21892
|
-
baseClassName,
|
|
21893
|
-
className,
|
|
21894
|
-
title,
|
|
21895
|
-
children: childrenProp,
|
|
21896
|
-
distractionFreeMode: distractionFreeModeProp,
|
|
21897
|
-
registry,
|
|
21898
|
-
groupable,
|
|
21899
|
-
...props
|
|
21900
|
-
} = this.props;
|
|
21901
|
-
let {
|
|
21902
|
-
children
|
|
21903
|
-
} = this.props;
|
|
21904
|
-
const {
|
|
21905
|
-
compact,
|
|
21906
|
-
distractionFreeMode,
|
|
21907
|
-
availableInDistractionFreeMode
|
|
21908
|
-
} = this.state;
|
|
21909
|
-
let hasExpander = _react.Children.toArray(children).some(child => /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _ToolbarExpander.default);
|
|
21910
|
-
if (groupable && compact && _react.Children.count(children) > 1) {
|
|
21911
|
-
hasExpander = false;
|
|
21912
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
|
|
21913
|
-
menu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarMenu.default, {
|
|
21914
|
-
onItemClick: () => {},
|
|
21915
|
-
children: children
|
|
21916
|
-
}),
|
|
21917
|
-
children: title
|
|
21918
|
-
});
|
|
21919
|
-
} else {
|
|
21920
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContext.default.Provider, {
|
|
21921
|
-
value: this.registry,
|
|
21922
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
|
|
21923
|
-
value: distractionFreeMode,
|
|
21924
|
-
children: (0, _ToolbarItem.toToolbarItems)(children)
|
|
21925
|
-
})
|
|
21926
|
-
});
|
|
21927
|
-
}
|
|
21928
|
-
if (distractionFreeMode.enabled && !availableInDistractionFreeMode) {
|
|
21929
|
-
return null;
|
|
21930
|
-
}
|
|
21931
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21932
|
-
className: (0, _classnames.default)(baseClassName, className, {
|
|
21933
|
-
[`${baseClassName}--grow`]: hasExpander || distractionFreeMode.enabled && availableInDistractionFreeMode
|
|
21934
|
-
}),
|
|
21935
|
-
...props,
|
|
21936
|
-
children: children
|
|
21937
|
-
});
|
|
21938
|
-
}
|
|
21939
|
-
}
|
|
21940
|
-
_defineProperty(ToolbarGroupClassComponent, "defaultProps", {
|
|
21941
|
-
registry: undefined,
|
|
21942
|
-
distractionFreeMode: undefined
|
|
21943
|
-
});
|
|
21944
|
-
const ToolbarGroupWrapper = _ref => {
|
|
21945
|
-
let {
|
|
21946
|
-
groupable = true,
|
|
21947
|
-
baseClassName = `${_constants.CLS_PREFIX}toolbar__group`,
|
|
21948
|
-
...props
|
|
21949
|
-
} = _ref;
|
|
21950
|
-
const registry = (0, _react.useContext)(_RegistryContext.default);
|
|
21951
|
-
const distractionFreeMode = (0, _react.useContext)(_DistractionFreeModeContext.default);
|
|
21952
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupClassComponent, {
|
|
21953
|
-
groupable: groupable,
|
|
21954
|
-
baseClassName: baseClassName,
|
|
21955
|
-
...props,
|
|
21956
|
-
registry: registry,
|
|
21957
|
-
distractionFreeMode: distractionFreeMode
|
|
21958
|
-
});
|
|
21959
|
-
};
|
|
21960
|
-
ToolbarGroupWrapper.displayName = 'ToolbarGroup';
|
|
21961
|
-
const ToolbarGroupBeta = _ref2 => {
|
|
21682
|
+
const ToolbarGroup = _ref => {
|
|
21962
21683
|
let {
|
|
21963
21684
|
baseClassName = `${_constants.CLS_PREFIX}toolbar__group`,
|
|
21964
21685
|
className,
|
|
@@ -21966,9 +21687,9 @@ const ToolbarGroupBeta = _ref2 => {
|
|
|
21966
21687
|
children,
|
|
21967
21688
|
groupable = true,
|
|
21968
21689
|
...props
|
|
21969
|
-
} =
|
|
21970
|
-
const [compact] = (0,
|
|
21971
|
-
const registry = (0,
|
|
21690
|
+
} = _ref;
|
|
21691
|
+
const [compact] = (0, _RegistryContext.useRegistryItem)();
|
|
21692
|
+
const registry = (0, _RegistryContext.useRegistry)();
|
|
21972
21693
|
const [availableInDistractionFreeMode, setAvailableInDistractionFreeMode] = (0, _react.useState)(false);
|
|
21973
21694
|
const distractionFreeMode = (0, _react.useContext)(_DistractionFreeModeContext.default);
|
|
21974
21695
|
const distractionFreeModeContextValue = {
|
|
@@ -21991,11 +21712,11 @@ const ToolbarGroupBeta = _ref2 => {
|
|
|
21991
21712
|
children: title
|
|
21992
21713
|
});
|
|
21993
21714
|
} else {
|
|
21994
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
21715
|
+
children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContext.default.Provider, {
|
|
21995
21716
|
value: registry,
|
|
21996
21717
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
|
|
21997
21718
|
value: distractionFreeModeContextValue,
|
|
21998
|
-
children: (0, _ToolbarItem.toToolbarItems)(children
|
|
21719
|
+
children: (0, _ToolbarItem.toToolbarItems)(children)
|
|
21999
21720
|
})
|
|
22000
21721
|
});
|
|
22001
21722
|
}
|
|
@@ -22010,14 +21731,6 @@ const ToolbarGroupBeta = _ref2 => {
|
|
|
22010
21731
|
children: children
|
|
22011
21732
|
});
|
|
22012
21733
|
};
|
|
22013
|
-
const ToolbarGroup = props => {
|
|
22014
|
-
const isToolbarBeta = (0, _ToolbarBetaProvider.useToolbarBetaContext)();
|
|
22015
|
-
return isToolbarBeta ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupBeta, {
|
|
22016
|
-
...props
|
|
22017
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupWrapper, {
|
|
22018
|
-
...props
|
|
22019
|
-
});
|
|
22020
|
-
};
|
|
22021
21734
|
var _default = exports["default"] = ToolbarGroup;
|
|
22022
21735
|
|
|
22023
21736
|
/***/ }),
|
|
@@ -22039,80 +21752,36 @@ var _react = __webpack_require__(/*! react */ "react");
|
|
|
22039
21752
|
var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
|
|
22040
21753
|
var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
|
|
22041
21754
|
var _ResponsiveContext = _interopRequireDefault(__webpack_require__(/*! ../ResponsiveContext */ "./components/ResponsiveContext/index.tsx"));
|
|
22042
|
-
var _RegistryContext = _interopRequireDefault(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
|
|
22043
21755
|
var _ToolbarGroup = _interopRequireDefault(__webpack_require__(/*! ./ToolbarGroup */ "./components/Toolbar/ToolbarGroup.tsx"));
|
|
22044
21756
|
var _ToolbarExpander = _interopRequireDefault(__webpack_require__(/*! ./ToolbarExpander */ "./components/Toolbar/ToolbarExpander.tsx"));
|
|
22045
|
-
var
|
|
21757
|
+
var _RegistryContext = __webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx");
|
|
22046
21758
|
var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
|
|
22047
21759
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
class ToolbarItem extends _react.Component {
|
|
22052
|
-
constructor() {
|
|
22053
|
-
super(...arguments);
|
|
22054
|
-
_defineProperty(this, "state", {
|
|
22055
|
-
compact: false
|
|
22056
|
-
});
|
|
22057
|
-
_defineProperty(this, "context", void 0);
|
|
22058
|
-
}
|
|
22059
|
-
componentDidMount() {
|
|
22060
|
-
const registry = this.context;
|
|
22061
|
-
registry.register(this);
|
|
22062
|
-
}
|
|
22063
|
-
componentWillUnmount() {
|
|
22064
|
-
const registry = this.context;
|
|
22065
|
-
registry.unregister(this);
|
|
22066
|
-
}
|
|
22067
|
-
isCompact() {
|
|
22068
|
-
return this.state.compact;
|
|
22069
|
-
}
|
|
22070
|
-
setCompact(compact) {
|
|
22071
|
-
this.setState({
|
|
22072
|
-
compact
|
|
22073
|
-
});
|
|
22074
|
-
}
|
|
22075
|
-
render() {
|
|
22076
|
-
const {
|
|
22077
|
-
children
|
|
22078
|
-
} = this.props;
|
|
22079
|
-
const {
|
|
22080
|
-
compact
|
|
22081
|
-
} = this.state;
|
|
22082
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveContext.default.Provider, {
|
|
22083
|
-
value: compact,
|
|
22084
|
-
children: children
|
|
22085
|
-
});
|
|
22086
|
-
}
|
|
22087
|
-
}
|
|
22088
|
-
ToolbarItem.contextType = _RegistryContext.default;
|
|
22089
|
-
const ToolbarItemBeta = _ref => {
|
|
21760
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21761
|
+
|
|
21762
|
+
const ToolbarItem = _ref => {
|
|
22090
21763
|
let {
|
|
22091
21764
|
children
|
|
22092
21765
|
} = _ref;
|
|
22093
|
-
const [isCompact] = (0,
|
|
21766
|
+
const [isCompact] = (0, _RegistryContext.useRegistryItem)();
|
|
22094
21767
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveContext.default.Provider, {
|
|
22095
21768
|
value: isCompact,
|
|
22096
21769
|
children: children
|
|
22097
21770
|
});
|
|
22098
21771
|
};
|
|
22099
|
-
const toToolbarItems =
|
|
22100
|
-
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22110
|
-
children: /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
22111
|
-
className: (0, _classnames.default)(child.props.className, `${_constants.CLS_PREFIX}toolbar__group-item`)
|
|
22112
|
-
})
|
|
22113
|
-
});
|
|
21772
|
+
const toToolbarItems = children => _react.Children.map(children, child => {
|
|
21773
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
21774
|
+
return child;
|
|
21775
|
+
}
|
|
21776
|
+
if (child.type === _ToolbarGroup.default || child.type === _ToolbarExpander.default) {
|
|
21777
|
+
return child;
|
|
21778
|
+
}
|
|
21779
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarItem, {
|
|
21780
|
+
children: /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
21781
|
+
className: (0, _classnames.default)(child.props.className, `${_constants.CLS_PREFIX}toolbar__group-item`)
|
|
21782
|
+
})
|
|
22114
21783
|
});
|
|
22115
|
-
};
|
|
21784
|
+
});
|
|
22116
21785
|
exports.toToolbarItems = toToolbarItems;
|
|
22117
21786
|
|
|
22118
21787
|
/***/ }),
|
|
@@ -87973,7 +87642,7 @@ function _setPrototypeOf(t, e) {
|
|
|
87973
87642
|
/***/ ((module) => {
|
|
87974
87643
|
|
|
87975
87644
|
"use strict";
|
|
87976
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.40.
|
|
87645
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.40.7","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types/src","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.less\\"","format:check":"prettier --check src","format":"prettier --write src","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.0","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.58.2","marked":"4.2.12","memoize-one":"^5.2.1","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"0.6.8","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^2.2.31","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.24.9","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.24.7","@babel/preset-env":"^7.25.0","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.0","@csstools/postcss-logical-float-and-clear":"^2.0.1","@plesk/eslint-config":"^3.0.0","@plesk/stylelint-config":"^2.0.0","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.4.8","@testing-library/react":"^14.3.1","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.1","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.5","@types/jest":"^29.5.12","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^4.3.2","@types/node":"^22.1.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.9","@types/react-transition-group":"^4.4.10","@types/svg4everybody":"2.1.2","@types/webpack-env":"^1.18.5","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","autoprefixer":"^10.4.19","babel-loader":"^8.3.0","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^8.57.0","eslint-config-prettier":"^8.10.0","eslint-plugin-markdown":"^3.0.1","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^10.0.0","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.0","postcss":"^8.4.40","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^7.0.1","prettier":"^2.8.8","puppeteer-core":"22.8.2","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.2.0","style-loader":"^4.0.0","stylelint":"^15.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^6.1.0","stylelint-prettier":"^3.0.0","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.2.2","webpack":"^5.93.0","webpack-cli":"^5.1.4"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
|
|
87977
87646
|
|
|
87978
87647
|
/***/ }),
|
|
87979
87648
|
|