| @@ -1,4 +1,5 @@ | ||
| 1 | +/*! elementor - v3.32.0 - 08-09-2025 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 4 | 5 | /***/ "../modules/element-manager/assets/js/api.js": |
| @@ -191,12 +192,12 @@ | ||
| 191 | 192 | }(); |
| 192 | 193 | |
| 193 | 194 | /***/ }), |
| 194 | 195 | |
| 195 | -/***/ "../modules/element-manager/assets/js/app-editor-one/App.js": | |
| 196 | -/*!******************************************************************!*\ | |
| 197 | - !*** ../modules/element-manager/assets/js/app-editor-one/App.js ***! | |
| 198 | - \******************************************************************/ | |
| 196 | +/***/ "../modules/element-manager/assets/js/app.js": | |
| 197 | +/*!***************************************************!*\ | |
| 198 | + !*** ../modules/element-manager/assets/js/app.js ***! | |
| 199 | + \***************************************************/ | |
| 199 | 200 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 200 | 201 | |
| 201 | 202 | "use strict"; |
| 202 | 203 | |
| @@ -201,1282 +202,200 @@ | ||
| 201 | 202 | "use strict"; |
| 202 | 203 | |
| 203 | 204 | |
| 204 | 205 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 205 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 206 | 206 | Object.defineProperty(exports, "__esModule", ({ |
| 207 | 207 | value: true |
| 208 | 208 | })); |
| 209 | 209 | exports.App = void 0; |
| 210 | -var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 211 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 212 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 213 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 214 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 215 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 216 | -var _hooks = __webpack_require__(/*! ./hooks */ "../modules/element-manager/assets/js/app-editor-one/hooks/index.js"); | |
| 217 | -var _components = __webpack_require__(/*! ./components */ "../modules/element-manager/assets/js/app-editor-one/components/index.js"); | |
| 218 | -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 219 | -var App = exports.App = function App() { | |
| 220 | - var _useState = (0, _react.useState)(false), | |
| 221 | - _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 222 | - isConfirmDialogOpen = _useState2[0], | |
| 223 | - setIsConfirmDialogOpen = _useState2[1]; | |
| 224 | - var _useElementManager = (0, _hooks.useElementManager)(), | |
| 225 | - isLoading = _useElementManager.isLoading, | |
| 226 | - widgets = _useElementManager.widgets, | |
| 227 | - promotionWidgets = _useElementManager.promotionWidgets, | |
| 228 | - plugins = _useElementManager.plugins, | |
| 229 | - roles = _useElementManager.roles, | |
| 230 | - widgetsDisabled = _useElementManager.widgetsDisabled, | |
| 231 | - widgetsRoleRestrictions = _useElementManager.widgetsRoleRestrictions, | |
| 232 | - setWidgetsRoleRestrictions = _useElementManager.setWidgetsRoleRestrictions, | |
| 233 | - promotionData = _useElementManager.promotionData, | |
| 234 | - noticeData = _useElementManager.noticeData, | |
| 235 | - usageWidgets = _useElementManager.usageWidgets, | |
| 236 | - changeProgress = _useElementManager.changeProgress, | |
| 237 | - isSnackbarOpen = _useElementManager.isSnackbarOpen, | |
| 238 | - setIsSnackbarOpen = _useElementManager.setIsSnackbarOpen, | |
| 239 | - getWidgetUsage = _useElementManager.getWidgetUsage, | |
| 240 | - scanUsageElements = _useElementManager.scanUsageElements, | |
| 241 | - saveChanges = _useElementManager.saveChanges, | |
| 242 | - deactivateAllUnusedWidgets = _useElementManager.deactivateAllUnusedWidgets, | |
| 243 | - enableAllWidgets = _useElementManager.enableAllWidgets, | |
| 244 | - toggleWidget = _useElementManager.toggleWidget, | |
| 245 | - dismissNotice = _useElementManager.dismissNotice; | |
| 246 | - var _useWidgetFilters = (0, _hooks.useWidgetFilters)(widgets, widgetsDisabled, getWidgetUsage), | |
| 247 | - searchKeyword = _useWidgetFilters.searchKeyword, | |
| 248 | - setSearchKeyword = _useWidgetFilters.setSearchKeyword, | |
| 249 | - filterByPlugin = _useWidgetFilters.filterByPlugin, | |
| 250 | - setFilterByPlugin = _useWidgetFilters.setFilterByPlugin, | |
| 251 | - filterByStatus = _useWidgetFilters.filterByStatus, | |
| 252 | - setFilterByStatus = _useWidgetFilters.setFilterByStatus, | |
| 253 | - sortedAndFilteredWidgets = _useWidgetFilters.sortedAndFilteredWidgets, | |
| 254 | - getSortingIndicatorClasses = _useWidgetFilters.getSortingIndicatorClasses, | |
| 255 | - onSortingClicked = _useWidgetFilters.onSortingClicked, | |
| 256 | - setSortByUsage = _useWidgetFilters.setSortByUsage; | |
| 257 | - var handleScanUsage = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 258 | - return _regenerator.default.wrap(function (_context) { | |
| 259 | - while (1) switch (_context.prev = _context.next) { | |
| 260 | - case 0: | |
| 261 | - _context.next = 1; | |
| 262 | - return scanUsageElements(); | |
| 263 | - case 1: | |
| 264 | - setSortByUsage(); | |
| 265 | - case 2: | |
| 266 | - case "end": | |
| 267 | - return _context.stop(); | |
| 268 | - } | |
| 269 | - }, _callee); | |
| 270 | - })), [scanUsageElements, setSortByUsage]); | |
| 271 | - var handleSaveClick = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() { | |
| 272 | - return _regenerator.default.wrap(function (_context2) { | |
| 273 | - while (1) switch (_context2.prev = _context2.next) { | |
| 274 | - case 0: | |
| 275 | - setIsConfirmDialogOpen(false); | |
| 276 | - _context2.next = 1; | |
| 277 | - return saveChanges(); | |
| 278 | - case 1: | |
| 279 | - case "end": | |
| 280 | - return _context2.stop(); | |
| 281 | - } | |
| 282 | - }, _callee2); | |
| 283 | - })), [saveChanges]); | |
| 284 | - if (isLoading) { | |
| 285 | - return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 286 | - justifyContent: "center", | |
| 287 | - sx: { | |
| 288 | - margin: 12 | |
| 289 | - } | |
| 290 | - }, /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { | |
| 291 | - size: 80 | |
| 292 | - })); | |
| 293 | - } | |
| 294 | - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 295 | - variant: "body2", | |
| 296 | - color: "text.secondary", | |
| 297 | - sx: { | |
| 298 | - marginBlockEnd: 2.5, | |
| 299 | - maxWidth: 800 | |
| 300 | - } | |
| 301 | - }, (0, _i18n.__)('Here\'s where you can fine-tune Elementor to your workflow. Disable elements you don\'t use for a cleaner interface, more focused creative experience, and improved performance.', 'elementor'), ' ', /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 302 | - href: "https://go.elementor.com/wp-dash-element-manager/", | |
| 303 | - rel: "noreferrer", | |
| 304 | - target: "_blank", | |
| 305 | - color: "info.light" | |
| 306 | - }, (0, _i18n.__)('Learn More', 'elementor'))), noticeData && !noticeData.is_viewed && /*#__PURE__*/_react.default.createElement(_components.NoticeAlert, { | |
| 307 | - onDismiss: dismissNotice | |
| 308 | - }), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_components.SearchFilters, { | |
| 309 | - searchKeyword: searchKeyword, | |
| 310 | - onSearchChange: setSearchKeyword, | |
| 311 | - filterByPlugin: filterByPlugin, | |
| 312 | - onPluginFilterChange: setFilterByPlugin, | |
| 313 | - filterByStatus: filterByStatus, | |
| 314 | - onStatusFilterChange: setFilterByStatus, | |
| 315 | - plugins: plugins, | |
| 316 | - usageIsLoading: usageWidgets.isLoading, | |
| 317 | - usageData: usageWidgets.data, | |
| 318 | - widgetsDisabledCount: widgetsDisabled.length, | |
| 319 | - onScanUsage: handleScanUsage, | |
| 320 | - onDeactivateUnused: deactivateAllUnusedWidgets, | |
| 321 | - onEnableAll: enableAllWidgets, | |
| 322 | - onSaveChanges: function onSaveChanges() { | |
| 323 | - return setIsConfirmDialogOpen(true); | |
| 324 | - }, | |
| 325 | - isSaving: changeProgress.isSaving, | |
| 326 | - hasUnsavedChanges: changeProgress.isUnsavedChanges | |
| 327 | - }), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_components.WidgetsTable, { | |
| 328 | - widgets: sortedAndFilteredWidgets, | |
| 329 | - widgetsDisabled: widgetsDisabled, | |
| 330 | - widgetsRoleRestrictions: widgetsRoleRestrictions, | |
| 331 | - setWidgetsRoleRestrictions: setWidgetsRoleRestrictions, | |
| 332 | - roles: roles, | |
| 333 | - promotionWidgets: promotionWidgets, | |
| 334 | - promotionData: promotionData, | |
| 335 | - usageWidgets: usageWidgets, | |
| 336 | - getWidgetUsage: getWidgetUsage, | |
| 337 | - onScanUsage: handleScanUsage, | |
| 338 | - onToggleWidget: toggleWidget, | |
| 339 | - getSortingIndicatorClasses: getSortingIndicatorClasses, | |
| 340 | - onSortingClicked: onSortingClicked | |
| 341 | - })), /*#__PURE__*/_react.default.createElement(_components.PromotionWidgetsTable, { | |
| 342 | - widgets: promotionWidgets, | |
| 343 | - promotionData: promotionData | |
| 344 | - })), /*#__PURE__*/_react.default.createElement(_components.ConfirmDialog, { | |
| 345 | - isOpen: isConfirmDialogOpen, | |
| 346 | - onClose: function onClose() { | |
| 347 | - return setIsConfirmDialogOpen(false); | |
| 348 | - }, | |
| 349 | - onConfirm: handleSaveClick | |
| 350 | - }), /*#__PURE__*/_react.default.createElement(_ui.Snackbar, { | |
| 351 | - open: isSnackbarOpen, | |
| 352 | - autoHideDuration: 6000, | |
| 353 | - onClose: function onClose() { | |
| 354 | - return setIsSnackbarOpen(false); | |
| 355 | - }, | |
| 356 | - message: (0, _i18n.__)('We saved your changes.', 'elementor'), | |
| 357 | - anchorOrigin: { | |
| 358 | - vertical: 'bottom', | |
| 359 | - horizontal: 'center' | |
| 360 | - } | |
| 361 | - })); | |
| 362 | -}; | |
| 363 | - | |
| 364 | -/***/ }), | |
| 365 | - | |
| 366 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/ConfirmDialog.js": | |
| 367 | -/*!***************************************************************************************!*\ | |
| 368 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/ConfirmDialog.js ***! | |
| 369 | - \***************************************************************************************/ | |
| 370 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 371 | - | |
| 372 | -"use strict"; | |
| 373 | - | |
| 374 | - | |
| 375 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 376 | -Object.defineProperty(exports, "__esModule", ({ | |
| 377 | - value: true | |
| 378 | -})); | |
| 379 | -exports.ConfirmDialog = void 0; | |
| 380 | 210 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 381 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 382 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 383 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 384 | -var ConfirmDialog = exports.ConfirmDialog = function ConfirmDialog(_ref) { | |
| 385 | - var isOpen = _ref.isOpen, | |
| 386 | - onClose = _ref.onClose, | |
| 387 | - onConfirm = _ref.onConfirm; | |
| 388 | - return /*#__PURE__*/_react.default.createElement(_ui.Dialog, { | |
| 389 | - open: isOpen, | |
| 390 | - onClose: onClose, | |
| 391 | - maxWidth: "sm" | |
| 392 | - }, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, null, (0, _i18n.__)('Sure you want to save these changes?', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, null, /*#__PURE__*/_react.default.createElement(_ui.DialogContentText, null, (0, _i18n.__)('Turning widgets off will hide them from the editor panel, and can potentially affect your layout or front-end.', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 393 | - component: "span", | |
| 394 | - sx: { | |
| 395 | - display: 'block', | |
| 396 | - mt: 2.5 | |
| 397 | - } | |
| 398 | - }, (0, _i18n.__)('If you\'re adding widgets back in, enjoy them!', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 399 | - direction: "row", | |
| 400 | - gap: 2, | |
| 401 | - justifyContent: "flex-end" | |
| 402 | - }, /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 403 | - variant: "outlined", | |
| 404 | - color: "secondary", | |
| 405 | - onClick: onClose, | |
| 406 | - className: "e-id-elementor-element-manager-modal-button-cancel" | |
| 407 | - }, (0, _i18n.__)('Cancel', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 408 | - variant: "contained", | |
| 409 | - onClick: onConfirm, | |
| 410 | - className: "e-id-elementor-element-manager-modal-button-save" | |
| 411 | - }, (0, _i18n.__)('Save', 'elementor'))))); | |
| 412 | -}; | |
| 413 | -ConfirmDialog.propTypes = { | |
| 414 | - isOpen: _propTypes.default.bool.isRequired, | |
| 415 | - onClose: _propTypes.default.func.isRequired, | |
| 416 | - onConfirm: _propTypes.default.func.isRequired | |
| 417 | -}; | |
| 418 | - | |
| 419 | -/***/ }), | |
| 420 | - | |
| 421 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/NoticeAlert.js": | |
| 422 | -/*!*************************************************************************************!*\ | |
| 423 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/NoticeAlert.js ***! | |
| 424 | - \*************************************************************************************/ | |
| 425 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 426 | - | |
| 427 | -"use strict"; | |
| 428 | - | |
| 429 | - | |
| 430 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 431 | -Object.defineProperty(exports, "__esModule", ({ | |
| 432 | - value: true | |
| 433 | -})); | |
| 434 | -exports.NoticeAlert = void 0; | |
| 435 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 436 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 437 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 438 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 439 | -var NoticeAlert = exports.NoticeAlert = function NoticeAlert(_ref) { | |
| 440 | - var onDismiss = _ref.onDismiss; | |
| 441 | - return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 442 | - sx: { | |
| 443 | - mb: 2 | |
| 444 | - } | |
| 445 | - }, /*#__PURE__*/_react.default.createElement(_ui.Alert, { | |
| 446 | - severity: "warning", | |
| 447 | - onClose: onDismiss | |
| 448 | - }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 449 | - component: "strong", | |
| 450 | - variant: "body2", | |
| 451 | - sx: { | |
| 452 | - fontWeight: 700 | |
| 453 | - } | |
| 454 | - }, (0, _i18n.__)('Before you continue:', 'elementor')), ' ', (0, _i18n.__)('Deactivating widgets here will remove them from both the Elementor Editor and your website, which can cause changes to your overall layout, design and what visitors see.', 'elementor'))); | |
| 455 | -}; | |
| 456 | -NoticeAlert.propTypes = { | |
| 457 | - onDismiss: _propTypes.default.func.isRequired | |
| 458 | -}; | |
| 459 | - | |
| 460 | -/***/ }), | |
| 461 | - | |
| 462 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/PromotionWidgetsTable.js": | |
| 463 | -/*!***********************************************************************************************!*\ | |
| 464 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/PromotionWidgetsTable.js ***! | |
| 465 | - \***********************************************************************************************/ | |
| 466 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 467 | - | |
| 468 | -"use strict"; | |
| 469 | - | |
| 470 | - | |
| 471 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 472 | -Object.defineProperty(exports, "__esModule", ({ | |
| 473 | - value: true | |
| 474 | -})); | |
| 475 | -exports.PromotionWidgetsTable = void 0; | |
| 476 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 477 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 478 | -var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 479 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 480 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 481 | -var _upgradeButton = __webpack_require__(/*! ../../upgrade-button */ "../modules/element-manager/assets/js/upgrade-button.js"); | |
| 482 | -var _RolePermissions = __webpack_require__(/*! ./RolePermissions */ "../modules/element-manager/assets/js/app-editor-one/components/RolePermissions.js"); | |
| 483 | -var PromotionWidgetsTable = exports.PromotionWidgetsTable = function PromotionWidgetsTable(_ref) { | |
| 484 | - var widgets = _ref.widgets, | |
| 485 | - promotionData = _ref.promotionData; | |
| 486 | - var elementManager = promotionData.element_manager; | |
| 487 | - if (!widgets.length) { | |
| 488 | - return null; | |
| 489 | - } | |
| 490 | - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 491 | - sx: { | |
| 492 | - mt: 5, | |
| 493 | - mb: 2.5 | |
| 494 | - } | |
| 495 | - }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 496 | - direction: "row", | |
| 497 | - justifyContent: "space-between", | |
| 498 | - alignItems: "center" | |
| 499 | - }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 500 | - variant: "h6", | |
| 501 | - component: "h3" | |
| 502 | - }, (0, _i18n.__)('Elementor Pro Elements', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 503 | - variant: "body2", | |
| 504 | - component: "p" | |
| 505 | - }, (0, _i18n.__)('Unleash the full power of Elementor\'s features and web creation tools.', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_upgradeButton.UpgradeButton, { | |
| 506 | - href: elementManager.url, | |
| 507 | - text: elementManager.text, | |
| 508 | - className: "e-id-elementor-element-manager-button-upgrade-pro-elements" | |
| 509 | - })))), /*#__PURE__*/_react.default.createElement(_ui.TableContainer, { | |
| 510 | - component: _ui.Paper, | |
| 511 | - variant: "outlined" | |
| 512 | - }, /*#__PURE__*/_react.default.createElement(_ui.Table, { | |
| 513 | - size: "small" | |
| 514 | - }, /*#__PURE__*/_react.default.createElement(_ui.TableHead, null, /*#__PURE__*/_react.default.createElement(_ui.TableRow, null, /*#__PURE__*/_react.default.createElement(_ui.TableCell, { | |
| 515 | - sx: function sx(theme) { | |
| 516 | - return { | |
| 517 | - width: theme.spacing(25) | |
| 518 | - }; | |
| 519 | - } | |
| 520 | - }, (0, _i18n.__)('Element', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, { | |
| 521 | - sx: function sx(theme) { | |
| 522 | - return { | |
| 523 | - width: theme.spacing(10) | |
| 524 | - }; | |
| 525 | - } | |
| 526 | - }, (0, _i18n.__)('Status', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, (0, _i18n.__)('Usage', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, (0, _i18n.__)('Plugin', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 527 | - direction: "row", | |
| 528 | - justifyContent: "flex-start", | |
| 529 | - alignItems: "center", | |
| 530 | - gap: 1 | |
| 531 | - }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, (0, _i18n.__)('Permission', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { | |
| 532 | - placement: "top", | |
| 533 | - title: (0, _i18n.__)('Choose which role will have access to a specific widget.', 'elementor') | |
| 534 | - }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 535 | - size: "small" | |
| 536 | - }, /*#__PURE__*/_react.default.createElement(_icons.HelpIcon, { | |
| 537 | - fontSize: "small" | |
| 538 | - })))))))), /*#__PURE__*/_react.default.createElement(_ui.TableBody, null, widgets.map(function (widget) { | |
| 539 | - return /*#__PURE__*/_react.default.createElement(_ui.TableRow, { | |
| 540 | - key: widget.name, | |
| 541 | - hover: true | |
| 542 | - }, /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 543 | - sx: { | |
| 544 | - display: 'flex', | |
| 545 | - alignItems: 'center' | |
| 546 | - } | |
| 547 | - }, /*#__PURE__*/_react.default.createElement("i", { | |
| 548 | - style: { | |
| 549 | - marginInlineEnd: 8 | |
| 550 | - }, | |
| 551 | - className: widget.icon | |
| 552 | - }), widget.title)), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.Switch, { | |
| 553 | - checked: false, | |
| 554 | - disabled: true, | |
| 555 | - size: "small", | |
| 556 | - "data-id": "e-id-elementor-element-manager-toggle-".concat(widget.name) | |
| 557 | - })), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, (0, _i18n.__)('Elementor Pro', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_RolePermissions.EditButtonDisabled, { | |
| 558 | - widgetName: widget.name | |
| 559 | - }))); | |
| 560 | - }))))); | |
| 561 | -}; | |
| 562 | -PromotionWidgetsTable.propTypes = { | |
| 563 | - widgets: _propTypes.default.arrayOf(_propTypes.default.shape({ | |
| 564 | - name: _propTypes.default.string.isRequired, | |
| 565 | - title: _propTypes.default.string.isRequired, | |
| 566 | - icon: _propTypes.default.string | |
| 567 | - })).isRequired, | |
| 568 | - promotionData: _propTypes.default.shape({ | |
| 569 | - element_manager: _propTypes.default.shape({ | |
| 570 | - url: _propTypes.default.string, | |
| 571 | - text: _propTypes.default.string | |
| 572 | - }) | |
| 573 | - }).isRequired | |
| 574 | -}; | |
| 575 | - | |
| 576 | -/***/ }), | |
| 577 | - | |
| 578 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/RolePermissions.js": | |
| 579 | -/*!*****************************************************************************************!*\ | |
| 580 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/RolePermissions.js ***! | |
| 581 | - \*****************************************************************************************/ | |
| 582 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 583 | - | |
| 584 | -"use strict"; | |
| 585 | - | |
| 586 | - | |
| 587 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 588 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 589 | -Object.defineProperty(exports, "__esModule", ({ | |
| 590 | - value: true | |
| 591 | -})); | |
| 592 | -exports.RolePermissions = exports.EditButtonDisabled = void 0; | |
| 593 | -var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 594 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 595 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 596 | -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 597 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 598 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 599 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 600 | -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 601 | -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 602 | -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 603 | -var toggleRoleRestrictions = function toggleRoleRestrictions(widgetName, roleId, widgetsRoleRestrictions, setWidgetsRoleRestrictions) { | |
| 604 | - var widgetRoleRestrictions = (0, _toConsumableArray2.default)(widgetsRoleRestrictions[widgetName] || []); | |
| 605 | - if (widgetRoleRestrictions.includes(roleId)) { | |
| 606 | - widgetRoleRestrictions.splice(widgetRoleRestrictions.indexOf(roleId), 1); | |
| 607 | - } else { | |
| 608 | - widgetRoleRestrictions.push(roleId); | |
| 609 | - } | |
| 610 | - setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, widgetRoleRestrictions))); | |
| 611 | -}; | |
| 612 | -var RolesList = function RolesList(_ref) { | |
| 613 | - var roles = _ref.roles, | |
| 614 | - widgetRoleRestrictions = _ref.widgetRoleRestrictions; | |
| 615 | - var rolesEnabled = roles.filter(function (role) { | |
| 616 | - return !widgetRoleRestrictions.includes(role.id); | |
| 617 | - }); | |
| 618 | - if (!rolesEnabled.length) { | |
| 619 | - return /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 620 | - component: "span", | |
| 621 | - variant: "body2", | |
| 622 | - color: "text.primary" | |
| 623 | - }, "(", (0, _i18n.__)('Admin', 'elementor'), ")"); | |
| 624 | - } | |
| 625 | - if (rolesEnabled.length === roles.length) { | |
| 626 | - return /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 627 | - component: "span", | |
| 628 | - variant: "body2", | |
| 629 | - color: "text.primary" | |
| 630 | - }, "(", (0, _i18n.__)('All Roles', 'elementor'), ")"); | |
| 631 | - } | |
| 632 | - return /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 633 | - component: "span", | |
| 634 | - variant: "body2", | |
| 635 | - color: "text.primary" | |
| 636 | - }, "(", rolesEnabled.map(function (role) { | |
| 637 | - return role.name; | |
| 638 | - }).join(', '), ")"); | |
| 639 | -}; | |
| 640 | -RolesList.propTypes = { | |
| 641 | - roles: _propTypes.default.arrayOf(_propTypes.default.shape({ | |
| 642 | - id: _propTypes.default.string.isRequired, | |
| 643 | - name: _propTypes.default.string.isRequired | |
| 644 | - })).isRequired, | |
| 645 | - widgetRoleRestrictions: _propTypes.default.arrayOf(_propTypes.default.string).isRequired | |
| 646 | -}; | |
| 647 | -var RolePermissions = exports.RolePermissions = function RolePermissions(_ref2) { | |
| 648 | - var roles = _ref2.roles, | |
| 649 | - widgetName = _ref2.widgetName, | |
| 650 | - widgetsRoleRestrictions = _ref2.widgetsRoleRestrictions, | |
| 651 | - setWidgetsRoleRestrictions = _ref2.setWidgetsRoleRestrictions; | |
| 652 | - var _useState = (0, _react.useState)(null), | |
| 653 | - _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 654 | - anchorEl = _useState2[0], | |
| 655 | - setAnchorEl = _useState2[1]; | |
| 656 | - var isOpen = Boolean(anchorEl); | |
| 657 | - var widgetRoleRestrictions = widgetsRoleRestrictions[widgetName] || []; | |
| 658 | - var handleClick = (0, _react.useCallback)(function (event) { | |
| 659 | - setAnchorEl(event.currentTarget); | |
| 660 | - }, []); | |
| 661 | - var handleClose = (0, _react.useCallback)(function () { | |
| 662 | - setAnchorEl(null); | |
| 663 | - }, []); | |
| 664 | - var isAllChecked = roles.every(function (role) { | |
| 665 | - return !widgetRoleRestrictions.includes(role.id); | |
| 666 | - }); | |
| 667 | - var isIndeterminate = !isAllChecked && roles.some(function (role) { | |
| 668 | - return !widgetRoleRestrictions.includes(role.id); | |
| 669 | - }); | |
| 670 | - var handleAllChange = (0, _react.useCallback)(function (event) { | |
| 671 | - if (event.target.checked) { | |
| 672 | - setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, []))); | |
| 673 | - } else { | |
| 674 | - setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, roles.map(function (role) { | |
| 675 | - return role.id; | |
| 676 | - })))); | |
| 677 | - } | |
| 678 | - }, [widgetName, widgetsRoleRestrictions, setWidgetsRoleRestrictions, roles]); | |
| 679 | - return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 680 | - sx: { | |
| 681 | - display: 'inline-flex', | |
| 682 | - alignItems: 'center', | |
| 683 | - gap: 0.5 | |
| 684 | - } | |
| 685 | - }, /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 686 | - variant: "text", | |
| 687 | - color: "secondary", | |
| 688 | - size: "small", | |
| 689 | - onClick: handleClick, | |
| 690 | - "aria-expanded": isOpen, | |
| 691 | - "aria-haspopup": "true", | |
| 692 | - className: "e-id-elementor-element-manager-button-edit-permissions-".concat(widgetName) | |
| 693 | - }, (0, _i18n.__)('Edit', 'elementor')), /*#__PURE__*/_react.default.createElement(RolesList, { | |
| 694 | - roles: roles, | |
| 695 | - widgetRoleRestrictions: widgetRoleRestrictions | |
| 696 | - }), /*#__PURE__*/_react.default.createElement(_ui.Menu, { | |
| 697 | - anchorEl: anchorEl, | |
| 698 | - open: isOpen, | |
| 699 | - onClose: handleClose, | |
| 700 | - anchorOrigin: { | |
| 701 | - vertical: 'bottom', | |
| 702 | - horizontal: 'left' | |
| 703 | - }, | |
| 704 | - transformOrigin: { | |
| 705 | - vertical: 'top', | |
| 706 | - horizontal: 'left' | |
| 707 | - } | |
| 708 | - }, /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 709 | - sx: { | |
| 710 | - py: 0.5 | |
| 711 | - } | |
| 712 | - }, /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, { | |
| 713 | - control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { | |
| 714 | - checked: isAllChecked, | |
| 715 | - indeterminate: isIndeterminate, | |
| 716 | - onChange: handleAllChange, | |
| 717 | - size: "small", | |
| 718 | - color: "secondary" | |
| 719 | - }), | |
| 720 | - label: (0, _i18n.__)('All', 'elementor') | |
| 721 | - })), roles.map(function (role) { | |
| 722 | - return /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 723 | - key: role.id, | |
| 724 | - sx: { | |
| 725 | - py: 0.5 | |
| 726 | - } | |
| 727 | - }, /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, { | |
| 728 | - control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { | |
| 729 | - color: "secondary", | |
| 730 | - checked: !widgetRoleRestrictions.includes(role.id), | |
| 731 | - onChange: function onChange() { | |
| 732 | - toggleRoleRestrictions(widgetName, role.id, widgetsRoleRestrictions, setWidgetsRoleRestrictions); | |
| 733 | - }, | |
| 734 | - size: "small" | |
| 735 | - }), | |
| 736 | - label: role.name | |
| 737 | - })); | |
| 738 | - }))); | |
| 739 | -}; | |
| 740 | -RolePermissions.propTypes = { | |
| 741 | - roles: _propTypes.default.arrayOf(_propTypes.default.shape({ | |
| 742 | - id: _propTypes.default.string.isRequired, | |
| 743 | - name: _propTypes.default.string.isRequired | |
| 744 | - })).isRequired, | |
| 745 | - widgetName: _propTypes.default.string.isRequired, | |
| 746 | - widgetsRoleRestrictions: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]).isRequired, | |
| 747 | - setWidgetsRoleRestrictions: _propTypes.default.func.isRequired | |
| 748 | -}; | |
| 749 | -var EditButtonDisabled = exports.EditButtonDisabled = function EditButtonDisabled(_ref3) { | |
| 750 | - var _ref3$widgetName = _ref3.widgetName, | |
| 751 | - widgetName = _ref3$widgetName === void 0 ? 'unknown' : _ref3$widgetName; | |
| 752 | - return /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 753 | - variant: "text", | |
| 754 | - color: "secondary", | |
| 755 | - size: "small", | |
| 756 | - disabled: true, | |
| 757 | - className: "e-id-elementor-element-manager-button-edit-permissions-".concat(widgetName) | |
| 758 | - }, (0, _i18n.__)('Edit', 'elementor')); | |
| 759 | -}; | |
| 760 | -EditButtonDisabled.propTypes = { | |
| 761 | - widgetName: _propTypes.default.string | |
| 762 | -}; | |
| 763 | - | |
| 764 | -/***/ }), | |
| 765 | - | |
| 766 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/SearchFilters.js": | |
| 767 | -/*!***************************************************************************************!*\ | |
| 768 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/SearchFilters.js ***! | |
| 769 | - \***************************************************************************************/ | |
| 770 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 771 | - | |
| 772 | -"use strict"; | |
| 773 | - | |
| 774 | - | |
| 775 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 776 | -Object.defineProperty(exports, "__esModule", ({ | |
| 777 | - value: true | |
| 778 | -})); | |
| 779 | -exports.SearchFilters = void 0; | |
| 780 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 781 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 782 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 783 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 784 | -var FIELD_HEIGHT = 28; | |
| 785 | -var FONT_SIZE = 12; | |
| 786 | -var ICON_SIZE = 16; | |
| 787 | -var StyledTextField = (0, _ui.styled)(_ui.TextField)({ | |
| 788 | - '& .MuiInputBase-root': { | |
| 789 | - height: FIELD_HEIGHT, | |
| 790 | - fontSize: FONT_SIZE | |
| 791 | - } | |
| 792 | -}); | |
| 793 | -var StyledFormControl = (0, _ui.styled)(_ui.FormControl)({ | |
| 794 | - '& .MuiInputBase-root': { | |
| 795 | - height: FIELD_HEIGHT, | |
| 796 | - fontSize: FONT_SIZE | |
| 797 | - }, | |
| 798 | - '& .MuiSelect-icon': { | |
| 799 | - width: ICON_SIZE, | |
| 800 | - height: ICON_SIZE, | |
| 801 | - top: 'calc(50% - 8px)' | |
| 802 | - } | |
| 803 | -}); | |
| 804 | -var StyledButton = (0, _ui.styled)(_ui.Button)({ | |
| 805 | - height: FIELD_HEIGHT, | |
| 806 | - fontSize: FONT_SIZE, | |
| 807 | - minWidth: 'auto', | |
| 808 | - whiteSpace: 'nowrap' | |
| 809 | -}); | |
| 810 | -var SearchFilters = exports.SearchFilters = function SearchFilters(_ref) { | |
| 811 | - var searchKeyword = _ref.searchKeyword, | |
| 812 | - onSearchChange = _ref.onSearchChange, | |
| 813 | - filterByPlugin = _ref.filterByPlugin, | |
| 814 | - onPluginFilterChange = _ref.onPluginFilterChange, | |
| 815 | - filterByStatus = _ref.filterByStatus, | |
| 816 | - onStatusFilterChange = _ref.onStatusFilterChange, | |
| 817 | - plugins = _ref.plugins, | |
| 818 | - usageIsLoading = _ref.usageIsLoading, | |
| 819 | - usageData = _ref.usageData, | |
| 820 | - widgetsDisabledCount = _ref.widgetsDisabledCount, | |
| 821 | - onScanUsage = _ref.onScanUsage, | |
| 822 | - onDeactivateUnused = _ref.onDeactivateUnused, | |
| 823 | - onEnableAll = _ref.onEnableAll, | |
| 824 | - onSaveChanges = _ref.onSaveChanges, | |
| 825 | - isSaving = _ref.isSaving, | |
| 826 | - hasUnsavedChanges = _ref.hasUnsavedChanges; | |
| 827 | - return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 828 | - direction: { | |
| 829 | - xs: 'column', | |
| 830 | - sm: 'row' | |
| 831 | - }, | |
| 832 | - alignItems: { | |
| 833 | - xs: 'stretch', | |
| 834 | - sm: 'flex-start' | |
| 835 | - }, | |
| 836 | - gap: 1.5, | |
| 837 | - sx: function sx(theme) { | |
| 838 | - return { | |
| 839 | - position: 'sticky', | |
| 840 | - top: theme.spacing(10), | |
| 841 | - backgroundColor: 'var(--e-one-palette-background-default)', | |
| 842 | - zIndex: 10, | |
| 843 | - paddingBlock: 2, | |
| 844 | - paddingInline: 2, | |
| 845 | - boxShadow: 'rgba(0, 0, 0, 0.15) 0 5px 10px 0', | |
| 846 | - marginBottom: theme.spacing(1) | |
| 847 | - }; | |
| 848 | - } | |
| 849 | - }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 850 | - direction: "row", | |
| 851 | - alignItems: "center", | |
| 852 | - flexWrap: "wrap", | |
| 853 | - gap: 1.5, | |
| 854 | - sx: { | |
| 855 | - flex: 1 | |
| 856 | - } | |
| 857 | - }, /*#__PURE__*/_react.default.createElement(StyledTextField, { | |
| 858 | - color: "secondary", | |
| 859 | - value: searchKeyword, | |
| 860 | - size: "small", | |
| 861 | - placeholder: (0, _i18n.__)('Search', 'elementor'), | |
| 862 | - onChange: function onChange(e) { | |
| 863 | - return onSearchChange(e.target.value); | |
| 864 | - }, | |
| 865 | - sx: function sx(theme) { | |
| 866 | - return { | |
| 867 | - minWidth: theme.spacing(14) | |
| 868 | - }; | |
| 869 | - } | |
| 870 | - }), /*#__PURE__*/_react.default.createElement(StyledFormControl, { | |
| 871 | - size: "small", | |
| 872 | - sx: function sx(theme) { | |
| 873 | - return { | |
| 874 | - width: theme.spacing(20) | |
| 875 | - }; | |
| 876 | - }, | |
| 877 | - color: "secondary" | |
| 878 | - }, /*#__PURE__*/_react.default.createElement(_ui.Select, { | |
| 879 | - placeholder: (0, _i18n.__)('Plugin', 'elementor'), | |
| 880 | - value: filterByPlugin, | |
| 881 | - onChange: function onChange(event) { | |
| 882 | - return onPluginFilterChange(event.target.value); | |
| 883 | - }, | |
| 884 | - "data-id": "elementor-element-manager-select-filter-by-plugin", | |
| 885 | - displayEmpty: true, | |
| 886 | - renderValue: function renderValue(value) { | |
| 887 | - if ('' === value) { | |
| 888 | - return (0, _i18n.__)('All Plugins', 'elementor'); | |
| 889 | - } | |
| 890 | - var selectedPlugin = plugins.find(function (p) { | |
| 891 | - return p.value === value; | |
| 892 | - }); | |
| 893 | - return selectedPlugin ? selectedPlugin.label : value; | |
| 894 | - } | |
| 895 | - }, /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 896 | - value: "" | |
| 897 | - }, (0, _i18n.__)('All Plugins', 'elementor')), plugins.map(function (plugin) { | |
| 898 | - return /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 899 | - key: plugin.value, | |
| 900 | - value: plugin.value | |
| 901 | - }, plugin.label); | |
| 902 | - }))), /*#__PURE__*/_react.default.createElement(StyledFormControl, { | |
| 903 | - size: "small", | |
| 904 | - sx: function sx(theme) { | |
| 905 | - return { | |
| 906 | - width: theme.spacing(20) | |
| 907 | - }; | |
| 908 | - }, | |
| 909 | - color: "secondary" | |
| 910 | - }, /*#__PURE__*/_react.default.createElement(_ui.Select, { | |
| 911 | - value: filterByStatus, | |
| 912 | - onChange: function onChange(event) { | |
| 913 | - return onStatusFilterChange(event.target.value); | |
| 914 | - }, | |
| 915 | - "data-id": "elementor-element-manager-select-filter-by-status", | |
| 916 | - placeholder: (0, _i18n.__)('Status', 'elementor') | |
| 917 | - }, /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 918 | - value: "all" | |
| 919 | - }, (0, _i18n.__)('All Statuses', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 920 | - value: "active" | |
| 921 | - }, (0, _i18n.__)('Active', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { | |
| 922 | - value: "inactive" | |
| 923 | - }, (0, _i18n.__)('Inactive', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Divider, { | |
| 924 | - orientation: "vertical", | |
| 925 | - flexItem: true, | |
| 926 | - sx: { | |
| 927 | - height: FIELD_HEIGHT, | |
| 928 | - marginBlock: 0, | |
| 929 | - marginInline: 0.5, | |
| 930 | - alignSelf: 'center', | |
| 931 | - display: { | |
| 932 | - xs: 'none', | |
| 933 | - md: 'block' | |
| 934 | - } | |
| 935 | - } | |
| 936 | - }), /*#__PURE__*/_react.default.createElement(StyledButton, { | |
| 937 | - variant: "outlined", | |
| 938 | - color: "secondary", | |
| 939 | - size: "small", | |
| 940 | - disabled: usageIsLoading, | |
| 941 | - onClick: onScanUsage, | |
| 942 | - "data-id": "e-id-elementor-element-manager-button-scan-element-usage", | |
| 943 | - loading: usageIsLoading | |
| 944 | - }, (0, _i18n.__)('Scan Element Usage', 'elementor')), /*#__PURE__*/_react.default.createElement(StyledButton, { | |
| 945 | - variant: "outlined", | |
| 946 | - color: "secondary", | |
| 947 | - size: "small", | |
| 948 | - onClick: onDeactivateUnused, | |
| 949 | - disabled: null === usageData, | |
| 950 | - "data-id": "e-id-elementor-element-manager-button-deactivate-unused-elements" | |
| 951 | - }, (0, _i18n.__)('Deactivate Unused Elements', 'elementor')), /*#__PURE__*/_react.default.createElement(StyledButton, { | |
| 952 | - variant: "outlined", | |
| 953 | - color: "secondary", | |
| 954 | - size: "small", | |
| 955 | - disabled: !widgetsDisabledCount, | |
| 956 | - onClick: onEnableAll, | |
| 957 | - "data-id": "e-id-elementor-element-manager-button-enable-all" | |
| 958 | - }, (0, _i18n.__)('Enable All', 'elementor'))), /*#__PURE__*/_react.default.createElement(StyledButton, { | |
| 959 | - variant: "contained", | |
| 960 | - size: "small", | |
| 961 | - disabled: isSaving || !hasUnsavedChanges, | |
| 962 | - onClick: onSaveChanges, | |
| 963 | - "data-id": "e-id-elementor-element-manager-button-save-changes", | |
| 964 | - loading: isSaving, | |
| 965 | - sx: { | |
| 966 | - alignSelf: 'flex-start' | |
| 967 | - } | |
| 968 | - }, (0, _i18n.__)('Save Changes', 'elementor'))); | |
| 969 | -}; | |
| 970 | -SearchFilters.propTypes = { | |
| 971 | - searchKeyword: _propTypes.default.string.isRequired, | |
| 972 | - onSearchChange: _propTypes.default.func.isRequired, | |
| 973 | - filterByPlugin: _propTypes.default.string.isRequired, | |
| 974 | - onPluginFilterChange: _propTypes.default.func.isRequired, | |
| 975 | - filterByStatus: _propTypes.default.string.isRequired, | |
| 976 | - onStatusFilterChange: _propTypes.default.func.isRequired, | |
| 977 | - plugins: _propTypes.default.arrayOf(_propTypes.default.shape({ | |
| 978 | - label: _propTypes.default.string.isRequired, | |
| 979 | - value: _propTypes.default.string.isRequired | |
| 980 | - })).isRequired, | |
| 981 | - usageIsLoading: _propTypes.default.bool, | |
| 982 | - usageData: _propTypes.default.object, | |
| 983 | - widgetsDisabledCount: _propTypes.default.number.isRequired, | |
| 984 | - onScanUsage: _propTypes.default.func.isRequired, | |
| 985 | - onDeactivateUnused: _propTypes.default.func.isRequired, | |
| 986 | - onEnableAll: _propTypes.default.func.isRequired, | |
| 987 | - onSaveChanges: _propTypes.default.func.isRequired, | |
| 988 | - isSaving: _propTypes.default.bool, | |
| 989 | - hasUnsavedChanges: _propTypes.default.bool | |
| 990 | -}; | |
| 991 | - | |
| 992 | -/***/ }), | |
| 993 | - | |
| 994 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/UsageTimesColumn.js": | |
| 995 | -/*!******************************************************************************************!*\ | |
| 996 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/UsageTimesColumn.js ***! | |
| 997 | - \******************************************************************************************/ | |
| 998 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 999 | - | |
| 1000 | -"use strict"; | |
| 1001 | - | |
| 1002 | - | |
| 1003 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1004 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1005 | - value: true | |
| 1006 | -})); | |
| 1007 | -exports.UsageTimesColumn = void 0; | |
| 1008 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1009 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1010 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1011 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 1012 | -var UsageTimesColumn = exports.UsageTimesColumn = function UsageTimesColumn(_ref) { | |
| 1013 | - var widgetName = _ref.widgetName, | |
| 1014 | - usageData = _ref.usageData, | |
| 1015 | - isLoading = _ref.isLoading, | |
| 1016 | - getWidgetUsage = _ref.getWidgetUsage, | |
| 1017 | - onScanClick = _ref.onScanClick; | |
| 1018 | - if (null !== usageData) { | |
| 1019 | - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, getWidgetUsage(widgetName), " ", (0, _i18n.__)('times', 'elementor')); | |
| 1020 | - } | |
| 1021 | - if (isLoading) { | |
| 1022 | - return /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { | |
| 1023 | - color: "secondary", | |
| 1024 | - size: 20 | |
| 1025 | - }); | |
| 1026 | - } | |
| 1027 | - return /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 1028 | - onClick: onScanClick, | |
| 1029 | - size: "small", | |
| 1030 | - variant: "outlined", | |
| 1031 | - color: "secondary", | |
| 1032 | - className: "e-id-elementor-element-manager-button-show-usage", | |
| 1033 | - sx: { | |
| 1034 | - minWidth: function minWidth(theme) { | |
| 1035 | - return theme.spacing(6); | |
| 1036 | - }, | |
| 1037 | - height: 26 | |
| 1038 | - } | |
| 1039 | - }, (0, _i18n.__)('Show', 'elementor')); | |
| 1040 | -}; | |
| 1041 | -UsageTimesColumn.propTypes = { | |
| 1042 | - widgetName: _propTypes.default.string.isRequired, | |
| 1043 | - usageData: _propTypes.default.object, | |
| 1044 | - isLoading: _propTypes.default.bool, | |
| 1045 | - getWidgetUsage: _propTypes.default.func.isRequired, | |
| 1046 | - onScanClick: _propTypes.default.func.isRequired | |
| 1047 | -}; | |
| 1048 | - | |
| 1049 | -/***/ }), | |
| 1050 | - | |
| 1051 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/WidgetsTable.js": | |
| 1052 | -/*!**************************************************************************************!*\ | |
| 1053 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/WidgetsTable.js ***! | |
| 1054 | - \**************************************************************************************/ | |
| 1055 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1056 | - | |
| 1057 | -"use strict"; | |
| 1058 | - | |
| 1059 | - | |
| 1060 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1061 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1062 | - value: true | |
| 1063 | -})); | |
| 1064 | -exports.WidgetsTable = void 0; | |
| 1065 | -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1066 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1067 | -var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1068 | -var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 1069 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 1070 | -var _upgradeButton = __webpack_require__(/*! ../../upgrade-button */ "../modules/element-manager/assets/js/upgrade-button.js"); | |
| 1071 | -var _RolePermissions = __webpack_require__(/*! ./RolePermissions */ "../modules/element-manager/assets/js/app-editor-one/components/RolePermissions.js"); | |
| 1072 | -var _UsageTimesColumn = __webpack_require__(/*! ./UsageTimesColumn */ "../modules/element-manager/assets/js/app-editor-one/components/UsageTimesColumn.js"); | |
| 1073 | -var StyledSwitch = (0, _ui.styled)(_ui.Switch)({ | |
| 1074 | - '& .MuiSwitch-track': { | |
| 1075 | - backgroundColor: 'rgba(0, 0, 0, 0.12);' | |
| 1076 | - }, | |
| 1077 | - '& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': { | |
| 1078 | - backgroundColor: '#000' | |
| 1079 | - }, | |
| 1080 | - '& .MuiSwitch-switchBase:not(.Mui-checked) .MuiSwitch-thumb': { | |
| 1081 | - backgroundColor: '#D5D8DC' | |
| 1082 | - }, | |
| 1083 | - '& .MuiSwitch-switchBase.Mui-checked .MuiSwitch-thumb': { | |
| 1084 | - backgroundColor: '#fff' | |
| 1085 | - } | |
| 1086 | -}); | |
| 1087 | -var WidgetsTable = exports.WidgetsTable = function WidgetsTable(_ref) { | |
| 1088 | - var widgets = _ref.widgets, | |
| 1089 | - widgetsDisabled = _ref.widgetsDisabled, | |
| 1090 | - widgetsRoleRestrictions = _ref.widgetsRoleRestrictions, | |
| 1091 | - setWidgetsRoleRestrictions = _ref.setWidgetsRoleRestrictions, | |
| 1092 | - roles = _ref.roles, | |
| 1093 | - promotionWidgets = _ref.promotionWidgets, | |
| 1094 | - promotionData = _ref.promotionData, | |
| 1095 | - usageWidgets = _ref.usageWidgets, | |
| 1096 | - getWidgetUsage = _ref.getWidgetUsage, | |
| 1097 | - onScanUsage = _ref.onScanUsage, | |
| 1098 | - onToggleWidget = _ref.onToggleWidget, | |
| 1099 | - getSortingIndicatorClasses = _ref.getSortingIndicatorClasses, | |
| 1100 | - onSortingClicked = _ref.onSortingClicked; | |
| 1101 | - var managerPermissions = promotionData.manager_permissions; | |
| 1102 | - var sortingClasses = getSortingIndicatorClasses('widget'); | |
| 1103 | - var isWidgetSorted = sortingClasses.includes('sorted'); | |
| 1104 | - var widgetSortDirection = sortingClasses.includes('asc') ? 'asc' : 'desc'; | |
| 1105 | - var usageSortingClasses = getSortingIndicatorClasses('usage'); | |
| 1106 | - var isUsageSorted = usageSortingClasses.includes('sorted'); | |
| 1107 | - var usageSortDirection = usageSortingClasses.includes('asc') ? 'asc' : 'desc'; | |
| 1108 | - if (!widgets.length) { | |
| 1109 | - return /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 1110 | - color: "text.secondary" | |
| 1111 | - }, (0, _i18n.__)('No elements found.', 'elementor')); | |
| 1112 | - } | |
| 1113 | - return /*#__PURE__*/_react.default.createElement(_ui.TableContainer, { | |
| 1114 | - component: _ui.Paper, | |
| 1115 | - variant: "outlined" | |
| 1116 | - }, /*#__PURE__*/_react.default.createElement(_ui.Table, { | |
| 1117 | - size: "small" | |
| 1118 | - }, /*#__PURE__*/_react.default.createElement(_ui.TableHead, null, /*#__PURE__*/_react.default.createElement(_ui.TableRow, null, /*#__PURE__*/_react.default.createElement(_ui.TableCell, { | |
| 1119 | - sx: function sx(theme) { | |
| 1120 | - return { | |
| 1121 | - width: theme.spacing(25) | |
| 1122 | - }; | |
| 1123 | - } | |
| 1124 | - }, /*#__PURE__*/_react.default.createElement(_ui.TableSortLabel, { | |
| 1125 | - active: isWidgetSorted, | |
| 1126 | - direction: isWidgetSorted ? widgetSortDirection : 'asc', | |
| 1127 | - onClick: function onClick() { | |
| 1128 | - return onSortingClicked('widget'); | |
| 1129 | - }, | |
| 1130 | - "data-id": "e-id-elementor-element-manager-button-sort-by-element" | |
| 1131 | - }, (0, _i18n.__)('Element', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.TableCell, { | |
| 1132 | - sx: function sx(theme) { | |
| 1133 | - return { | |
| 1134 | - width: theme.spacing(10) | |
| 1135 | - }; | |
| 1136 | - } | |
| 1137 | - }, (0, _i18n.__)('Status', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.TableSortLabel, { | |
| 1138 | - active: isUsageSorted, | |
| 1139 | - direction: isUsageSorted ? usageSortDirection : 'asc', | |
| 1140 | - onClick: function onClick() { | |
| 1141 | - return onSortingClicked('usage'); | |
| 1142 | - }, | |
| 1143 | - "data-id": "e-id-elementor-element-manager-button-sort-by-usage" | |
| 1144 | - }, (0, _i18n.__)('Usage', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, (0, _i18n.__)('Plugin', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 1145 | - direction: "row", | |
| 1146 | - justifyContent: "flex-start", | |
| 1147 | - alignItems: "center", | |
| 1148 | - gap: 1 | |
| 1149 | - }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, (0, _i18n.__)('Permission', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { | |
| 1150 | - placement: "top", | |
| 1151 | - title: (0, _i18n.__)('Choose which users will have access to each widget.', 'elementor') | |
| 1152 | - }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 1153 | - size: "small" | |
| 1154 | - }, /*#__PURE__*/_react.default.createElement(_icons.HelpIcon, { | |
| 1155 | - fontSize: "small" | |
| 1156 | - })))), null === widgetsRoleRestrictions && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 1157 | - sx: { | |
| 1158 | - marginInlineStart: 1 | |
| 1159 | - } | |
| 1160 | - }, /*#__PURE__*/_react.default.createElement(_upgradeButton.UpgradeButton, { | |
| 1161 | - href: promotionWidgets.length ? managerPermissions.pro.url : managerPermissions.advanced.url, | |
| 1162 | - size: "small", | |
| 1163 | - text: promotionWidgets.length ? managerPermissions.pro.text : managerPermissions.advanced.text, | |
| 1164 | - className: "go-pro", | |
| 1165 | - "data-id": "e-id-elementor-element-manager-button-upgrade-permissions" | |
| 1166 | - })))))), /*#__PURE__*/_react.default.createElement(_ui.TableBody, null, widgets.map(function (widget) { | |
| 1167 | - return /*#__PURE__*/_react.default.createElement(_ui.TableRow, { | |
| 1168 | - key: widget.name, | |
| 1169 | - "data-key-id": widget.name, | |
| 1170 | - hover: true | |
| 1171 | - }, /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 1172 | - sx: { | |
| 1173 | - display: 'flex', | |
| 1174 | - alignItems: 'center' | |
| 1175 | - } | |
| 1176 | - }, /*#__PURE__*/_react.default.createElement("i", { | |
| 1177 | - style: { | |
| 1178 | - marginInlineEnd: 8, | |
| 1179 | - marginInlineStart: 0, | |
| 1180 | - display: 'inline-block' | |
| 1181 | - }, | |
| 1182 | - className: widget.icon | |
| 1183 | - }), widget.title)), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(StyledSwitch, { | |
| 1184 | - color: "secondary", | |
| 1185 | - checked: !widgetsDisabled.includes(widget.name), | |
| 1186 | - onChange: function onChange(event, checked) { | |
| 1187 | - return onToggleWidget(widget.name, checked); | |
| 1188 | - }, | |
| 1189 | - size: "small", | |
| 1190 | - "data-id": "e-id-elementor-element-manager-toggle-".concat(widget.name) | |
| 1191 | - })), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, /*#__PURE__*/_react.default.createElement(_UsageTimesColumn.UsageTimesColumn, { | |
| 1192 | - widgetName: widget.name, | |
| 1193 | - usageData: usageWidgets.data, | |
| 1194 | - isLoading: usageWidgets.isLoading, | |
| 1195 | - getWidgetUsage: getWidgetUsage, | |
| 1196 | - onScanClick: onScanUsage | |
| 1197 | - })), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, widget.plugin), /*#__PURE__*/_react.default.createElement(_ui.TableCell, null, null !== widgetsRoleRestrictions && !widgetsDisabled.includes(widget.name) ? /*#__PURE__*/_react.default.createElement(_RolePermissions.RolePermissions, { | |
| 1198 | - widgetName: widget.name, | |
| 1199 | - roles: roles, | |
| 1200 | - widgetsRoleRestrictions: widgetsRoleRestrictions, | |
| 1201 | - setWidgetsRoleRestrictions: setWidgetsRoleRestrictions | |
| 1202 | - }) : /*#__PURE__*/_react.default.createElement(_RolePermissions.EditButtonDisabled, null))); | |
| 1203 | - })))); | |
| 1204 | -}; | |
| 1205 | -var widgetShape = _propTypes.default.shape({ | |
| 1206 | - name: _propTypes.default.string.isRequired, | |
| 1207 | - title: _propTypes.default.string.isRequired, | |
| 1208 | - icon: _propTypes.default.string, | |
| 1209 | - plugin: _propTypes.default.string | |
| 1210 | -}); | |
| 1211 | -WidgetsTable.propTypes = { | |
| 1212 | - widgets: _propTypes.default.arrayOf(widgetShape).isRequired, | |
| 1213 | - widgetsDisabled: _propTypes.default.arrayOf(_propTypes.default.string).isRequired, | |
| 1214 | - widgetsRoleRestrictions: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), | |
| 1215 | - setWidgetsRoleRestrictions: _propTypes.default.func.isRequired, | |
| 1216 | - roles: _propTypes.default.array.isRequired, | |
| 1217 | - promotionWidgets: _propTypes.default.arrayOf(widgetShape).isRequired, | |
| 1218 | - promotionData: _propTypes.default.shape({ | |
| 1219 | - manager_permissions: _propTypes.default.shape({ | |
| 1220 | - pro: _propTypes.default.shape({ | |
| 1221 | - url: _propTypes.default.string, | |
| 1222 | - text: _propTypes.default.string | |
| 1223 | - }), | |
| 1224 | - advanced: _propTypes.default.shape({ | |
| 1225 | - url: _propTypes.default.string, | |
| 1226 | - text: _propTypes.default.string | |
| 1227 | - }) | |
| 1228 | - }) | |
| 1229 | - }).isRequired, | |
| 1230 | - usageWidgets: _propTypes.default.shape({ | |
| 1231 | - isLoading: _propTypes.default.bool, | |
| 1232 | - data: _propTypes.default.object | |
| 1233 | - }).isRequired, | |
| 1234 | - getWidgetUsage: _propTypes.default.func.isRequired, | |
| 1235 | - onScanUsage: _propTypes.default.func.isRequired, | |
| 1236 | - onToggleWidget: _propTypes.default.func.isRequired, | |
| 1237 | - getSortingIndicatorClasses: _propTypes.default.func.isRequired, | |
| 1238 | - onSortingClicked: _propTypes.default.func.isRequired | |
| 1239 | -}; | |
| 1240 | - | |
| 1241 | -/***/ }), | |
| 1242 | - | |
| 1243 | -/***/ "../modules/element-manager/assets/js/app-editor-one/components/index.js": | |
| 1244 | -/*!*******************************************************************************!*\ | |
| 1245 | - !*** ../modules/element-manager/assets/js/app-editor-one/components/index.js ***! | |
| 1246 | - \*******************************************************************************/ | |
| 1247 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1248 | - | |
| 1249 | -"use strict"; | |
| 1250 | - | |
| 1251 | - | |
| 1252 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1253 | - value: true | |
| 1254 | -})); | |
| 1255 | -Object.defineProperty(exports, "ConfirmDialog", ({ | |
| 1256 | - enumerable: true, | |
| 1257 | - get: function get() { | |
| 1258 | - return _ConfirmDialog.ConfirmDialog; | |
| 1259 | - } | |
| 1260 | -})); | |
| 1261 | -Object.defineProperty(exports, "EditButtonDisabled", ({ | |
| 1262 | - enumerable: true, | |
| 1263 | - get: function get() { | |
| 1264 | - return _RolePermissions.EditButtonDisabled; | |
| 1265 | - } | |
| 1266 | -})); | |
| 1267 | -Object.defineProperty(exports, "NoticeAlert", ({ | |
| 1268 | - enumerable: true, | |
| 1269 | - get: function get() { | |
| 1270 | - return _NoticeAlert.NoticeAlert; | |
| 1271 | - } | |
| 1272 | -})); | |
| 1273 | -Object.defineProperty(exports, "PromotionWidgetsTable", ({ | |
| 1274 | - enumerable: true, | |
| 1275 | - get: function get() { | |
| 1276 | - return _PromotionWidgetsTable.PromotionWidgetsTable; | |
| 1277 | - } | |
| 1278 | -})); | |
| 1279 | -Object.defineProperty(exports, "RolePermissions", ({ | |
| 1280 | - enumerable: true, | |
| 1281 | - get: function get() { | |
| 1282 | - return _RolePermissions.RolePermissions; | |
| 1283 | - } | |
| 1284 | -})); | |
| 1285 | -Object.defineProperty(exports, "SearchFilters", ({ | |
| 1286 | - enumerable: true, | |
| 1287 | - get: function get() { | |
| 1288 | - return _SearchFilters.SearchFilters; | |
| 1289 | - } | |
| 1290 | -})); | |
| 1291 | -Object.defineProperty(exports, "UsageTimesColumn", ({ | |
| 1292 | - enumerable: true, | |
| 1293 | - get: function get() { | |
| 1294 | - return _UsageTimesColumn.UsageTimesColumn; | |
| 1295 | - } | |
| 1296 | -})); | |
| 1297 | -Object.defineProperty(exports, "WidgetsTable", ({ | |
| 1298 | - enumerable: true, | |
| 1299 | - get: function get() { | |
| 1300 | - return _WidgetsTable.WidgetsTable; | |
| 1301 | - } | |
| 1302 | -})); | |
| 1303 | -var _UsageTimesColumn = __webpack_require__(/*! ./UsageTimesColumn */ "../modules/element-manager/assets/js/app-editor-one/components/UsageTimesColumn.js"); | |
| 1304 | -var _NoticeAlert = __webpack_require__(/*! ./NoticeAlert */ "../modules/element-manager/assets/js/app-editor-one/components/NoticeAlert.js"); | |
| 1305 | -var _ConfirmDialog = __webpack_require__(/*! ./ConfirmDialog */ "../modules/element-manager/assets/js/app-editor-one/components/ConfirmDialog.js"); | |
| 1306 | -var _SearchFilters = __webpack_require__(/*! ./SearchFilters */ "../modules/element-manager/assets/js/app-editor-one/components/SearchFilters.js"); | |
| 1307 | -var _WidgetsTable = __webpack_require__(/*! ./WidgetsTable */ "../modules/element-manager/assets/js/app-editor-one/components/WidgetsTable.js"); | |
| 1308 | -var _PromotionWidgetsTable = __webpack_require__(/*! ./PromotionWidgetsTable */ "../modules/element-manager/assets/js/app-editor-one/components/PromotionWidgetsTable.js"); | |
| 1309 | -var _RolePermissions = __webpack_require__(/*! ./RolePermissions */ "../modules/element-manager/assets/js/app-editor-one/components/RolePermissions.js"); | |
| 1310 | - | |
| 1311 | -/***/ }), | |
| 1312 | - | |
| 1313 | -/***/ "../modules/element-manager/assets/js/app-editor-one/hooks/index.js": | |
| 1314 | -/*!**************************************************************************!*\ | |
| 1315 | - !*** ../modules/element-manager/assets/js/app-editor-one/hooks/index.js ***! | |
| 1316 | - \**************************************************************************/ | |
| 1317 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1318 | - | |
| 1319 | -"use strict"; | |
| 1320 | - | |
| 1321 | - | |
| 1322 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1323 | - value: true | |
| 1324 | -})); | |
| 1325 | -Object.defineProperty(exports, "useElementManager", ({ | |
| 1326 | - enumerable: true, | |
| 1327 | - get: function get() { | |
| 1328 | - return _useElementManager.useElementManager; | |
| 1329 | - } | |
| 1330 | -})); | |
| 1331 | -Object.defineProperty(exports, "useWidgetFilters", ({ | |
| 1332 | - enumerable: true, | |
| 1333 | - get: function get() { | |
| 1334 | - return _useWidgetFilters.useWidgetFilters; | |
| 1335 | - } | |
| 1336 | -})); | |
| 1337 | -var _useElementManager = __webpack_require__(/*! ./useElementManager */ "../modules/element-manager/assets/js/app-editor-one/hooks/useElementManager.js"); | |
| 1338 | -var _useWidgetFilters = __webpack_require__(/*! ./useWidgetFilters */ "../modules/element-manager/assets/js/app-editor-one/hooks/useWidgetFilters.js"); | |
| 1339 | - | |
| 1340 | -/***/ }), | |
| 1341 | - | |
| 1342 | -/***/ "../modules/element-manager/assets/js/app-editor-one/hooks/useElementManager.js": | |
| 1343 | -/*!**************************************************************************************!*\ | |
| 1344 | - !*** ../modules/element-manager/assets/js/app-editor-one/hooks/useElementManager.js ***! | |
| 1345 | - \**************************************************************************************/ | |
| 1346 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1347 | - | |
| 1348 | -"use strict"; | |
| 1349 | - | |
| 1350 | - | |
| 1351 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1352 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1353 | - value: true | |
| 1354 | -})); | |
| 1355 | -exports.useElementManager = void 0; | |
| 1356 | 211 | var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); |
| 1357 | 212 | var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); |
| 1358 | 213 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 1359 | 214 | var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); |
| 1360 | 215 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 1361 | -var _react = __webpack_require__(/*! react */ "react"); | |
| 1362 | -var _api = __webpack_require__(/*! ../../api */ "../modules/element-manager/assets/js/api.js"); | |
| 216 | +var _element = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js"); | |
| 217 | +var _components = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); | |
| 218 | +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 219 | +var _upgradeButton = __webpack_require__(/*! ./upgrade-button */ "../modules/element-manager/assets/js/upgrade-button.js"); | |
| 220 | +var _api = __webpack_require__(/*! ./api */ "../modules/element-manager/assets/js/api.js"); | |
| 221 | +var _rolePermissions = __webpack_require__(/*! ./role-permissions */ "../modules/element-manager/assets/js/role-permissions.js"); | |
| 1363 | 222 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| 1364 | -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 1365 | -var useElementManager = exports.useElementManager = function useElementManager() { | |
| 1366 | - var isInitialMount = (0, _react.useRef)(true); | |
| 1367 | - var _useState = (0, _react.useState)(true), | |
| 223 | +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable react/prop-types */ | |
| 224 | +var App = exports.App = function App() { | |
| 225 | + var _useState = (0, _element.useState)(true), | |
| 1368 | 226 | _useState2 = (0, _slicedToArray2.default)(_useState, 2), |
| 1369 | 227 | isLoading = _useState2[0], |
| 1370 | 228 | setIsLoading = _useState2[1]; |
| 1371 | - var _useState3 = (0, _react.useState)([]), | |
| 229 | + var _useState3 = (0, _element.useState)(''), | |
| 1372 | 230 | _useState4 = (0, _slicedToArray2.default)(_useState3, 2), |
| 1373 | - widgets = _useState4[0], | |
| 1374 | - setWidgets = _useState4[1]; | |
| 1375 | - var _useState5 = (0, _react.useState)([]), | |
| 231 | + searchKeyword = _useState4[0], | |
| 232 | + setSearchKeyword = _useState4[1]; | |
| 233 | + var _useState5 = (0, _element.useState)([]), | |
| 1376 | 234 | _useState6 = (0, _slicedToArray2.default)(_useState5, 2), |
| 1377 | - promotionWidgets = _useState6[0], | |
| 1378 | - setPromotionWidgets = _useState6[1]; | |
| 1379 | - var _useState7 = (0, _react.useState)([]), | |
| 235 | + widgets = _useState6[0], | |
| 236 | + setWidgets = _useState6[1]; | |
| 237 | + var _useState7 = (0, _element.useState)([]), | |
| 1380 | 238 | _useState8 = (0, _slicedToArray2.default)(_useState7, 2), |
| 1381 | - plugins = _useState8[0], | |
| 1382 | - setPlugins = _useState8[1]; | |
| 1383 | - var _useState9 = (0, _react.useState)([]), | |
| 239 | + promotionWidgets = _useState8[0], | |
| 240 | + setPromotionWidgets = _useState8[1]; | |
| 241 | + var _useState9 = (0, _element.useState)([]), | |
| 1384 | 242 | _useState0 = (0, _slicedToArray2.default)(_useState9, 2), |
| 1385 | - roles = _useState0[0], | |
| 1386 | - setRoles = _useState0[1]; | |
| 1387 | - var _useState1 = (0, _react.useState)([]), | |
| 243 | + plugins = _useState0[0], | |
| 244 | + setPlugins = _useState0[1]; | |
| 245 | + var _useState1 = (0, _element.useState)([]), | |
| 1388 | 246 | _useState10 = (0, _slicedToArray2.default)(_useState1, 2), |
| 1389 | - widgetsDisabled = _useState10[0], | |
| 1390 | - setWidgetsDisabled = _useState10[1]; | |
| 1391 | - var _useState11 = (0, _react.useState)(null), | |
| 247 | + roles = _useState10[0], | |
| 248 | + setRoles = _useState10[1]; | |
| 249 | + var _useState11 = (0, _element.useState)({ | |
| 250 | + isLoading: false, | |
| 251 | + data: null | |
| 252 | + }), | |
| 1392 | 253 | _useState12 = (0, _slicedToArray2.default)(_useState11, 2), |
| 1393 | - widgetsRoleRestrictions = _useState12[0], | |
| 1394 | - setWidgetsRoleRestrictions = _useState12[1]; | |
| 1395 | - var _useState13 = (0, _react.useState)([]), | |
| 254 | + usageWidgets = _useState12[0], | |
| 255 | + setUsageWidgets = _useState12[1]; | |
| 256 | + var _useState13 = (0, _element.useState)([]), | |
| 1396 | 257 | _useState14 = (0, _slicedToArray2.default)(_useState13, 2), |
| 1397 | - promotionData = _useState14[0], | |
| 1398 | - setPromotionData = _useState14[1]; | |
| 1399 | - var _useState15 = (0, _react.useState)(null), | |
| 258 | + widgetsDisabled = _useState14[0], | |
| 259 | + setWidgetsDisabled = _useState14[1]; | |
| 260 | + var _useState15 = (0, _element.useState)('widget'), | |
| 1400 | 261 | _useState16 = (0, _slicedToArray2.default)(_useState15, 2), |
| 1401 | - noticeData = _useState16[0], | |
| 1402 | - setNoticeData = _useState16[1]; | |
| 1403 | - var _useState17 = (0, _react.useState)({ | |
| 1404 | - isLoading: false, | |
| 1405 | - data: null | |
| 1406 | - }), | |
| 262 | + sortingColumn = _useState16[0], | |
| 263 | + setSortingColumn = _useState16[1]; | |
| 264 | + var _useState17 = (0, _element.useState)('asc'), | |
| 1407 | 265 | _useState18 = (0, _slicedToArray2.default)(_useState17, 2), |
| 1408 | - usageWidgets = _useState18[0], | |
| 1409 | - setUsageWidgets = _useState18[1]; | |
| 1410 | - var _useState19 = (0, _react.useState)({ | |
| 266 | + sortingDirection = _useState18[0], | |
| 267 | + setSortingDirection = _useState18[1]; | |
| 268 | + var _useState19 = (0, _element.useState)(''), | |
| 269 | + _useState20 = (0, _slicedToArray2.default)(_useState19, 2), | |
| 270 | + filterByPlugin = _useState20[0], | |
| 271 | + setFilterByPlugin = _useState20[1]; | |
| 272 | + var _useState21 = (0, _element.useState)('all'), | |
| 273 | + _useState22 = (0, _slicedToArray2.default)(_useState21, 2), | |
| 274 | + filterByStatus = _useState22[0], | |
| 275 | + setFilterByStatus = _useState22[1]; | |
| 276 | + var _useState23 = (0, _element.useState)({ | |
| 1411 | 277 | isSaving: false, |
| 1412 | 278 | isUnsavedChanges: false |
| 1413 | 279 | }), |
| 1414 | - _useState20 = (0, _slicedToArray2.default)(_useState19, 2), | |
| 1415 | - changeProgress = _useState20[0], | |
| 1416 | - setChangeProgress = _useState20[1]; | |
| 1417 | - var _useState21 = (0, _react.useState)(false), | |
| 1418 | - _useState22 = (0, _slicedToArray2.default)(_useState21, 2), | |
| 1419 | - isSnackbarOpen = _useState22[0], | |
| 1420 | - setIsSnackbarOpen = _useState22[1]; | |
| 1421 | - var getWidgetUsage = (0, _react.useCallback)(function (widgetName) { | |
| 280 | + _useState24 = (0, _slicedToArray2.default)(_useState23, 2), | |
| 281 | + changeProgress = _useState24[0], | |
| 282 | + setChangeProgress = _useState24[1]; | |
| 283 | + var _useState25 = (0, _element.useState)(false), | |
| 284 | + _useState26 = (0, _slicedToArray2.default)(_useState25, 2), | |
| 285 | + isConfirmDialogOpen = _useState26[0], | |
| 286 | + setIsConfirmDialogOpen = _useState26[1]; | |
| 287 | + var _useState27 = (0, _element.useState)(false), | |
| 288 | + _useState28 = (0, _slicedToArray2.default)(_useState27, 2), | |
| 289 | + isSnackbarOpen = _useState28[0], | |
| 290 | + setIsSnackbarOpen = _useState28[1]; | |
| 291 | + var _useState29 = (0, _element.useState)(null), | |
| 292 | + _useState30 = (0, _slicedToArray2.default)(_useState29, 2), | |
| 293 | + noticeData = _useState30[0], | |
| 294 | + setNoticeData = _useState30[1]; | |
| 295 | + var _useState31 = (0, _element.useState)(null), | |
| 296 | + _useState32 = (0, _slicedToArray2.default)(_useState31, 2), | |
| 297 | + widgetsRoleRestrictions = _useState32[0], | |
| 298 | + setWidgetsRoleRestrictions = _useState32[1]; | |
| 299 | + var _useState33 = (0, _element.useState)([]), | |
| 300 | + _useState34 = (0, _slicedToArray2.default)(_useState33, 2), | |
| 301 | + promotionData = _useState34[0], | |
| 302 | + setPromotionData = _useState34[1]; | |
| 303 | + var managerPermissions = promotionData.manager_permissions, | |
| 304 | + elementManager = promotionData.element_manager; | |
| 305 | + var getWidgetUsage = function getWidgetUsage(widgetName) { | |
| 1422 | 306 | if (!usageWidgets.data || !usageWidgets.data.hasOwnProperty(widgetName)) { |
| 1423 | 307 | return 0; |
| 1424 | 308 | } |
| 1425 | 309 | return usageWidgets.data[widgetName]; |
| 1426 | - }, [usageWidgets.data]); | |
| 1427 | - var scanUsageElements = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 1428 | - var data; | |
| 1429 | - return _regenerator.default.wrap(function (_context) { | |
| 1430 | - while (1) switch (_context.prev = _context.next) { | |
| 1431 | - case 0: | |
| 1432 | - setUsageWidgets(function (prev) { | |
| 1433 | - return _objectSpread(_objectSpread({}, prev), {}, { | |
| 1434 | - isLoading: true | |
| 1435 | - }); | |
| 1436 | - }); | |
| 1437 | - _context.next = 1; | |
| 1438 | - return (0, _api.getUsageWidgets)(); | |
| 1439 | - case 1: | |
| 1440 | - data = _context.sent; | |
| 1441 | - setUsageWidgets({ | |
| 1442 | - data: data, | |
| 1443 | - isLoading: false | |
| 1444 | - }); | |
| 1445 | - return _context.abrupt("return", data); | |
| 1446 | - case 2: | |
| 1447 | - case "end": | |
| 1448 | - return _context.stop(); | |
| 310 | + }; | |
| 311 | + var sortedAndFilteredWidgets = (0, _element.useMemo)(function () { | |
| 312 | + var filteredWidgets = widgets.filter(function (widget) { | |
| 313 | + return widget.title.toLowerCase().includes(searchKeyword.toLowerCase()); | |
| 314 | + }); | |
| 315 | + if ('' !== filterByPlugin) { | |
| 316 | + filteredWidgets = filteredWidgets.filter(function (widget) { | |
| 317 | + return widget.plugin.toLowerCase() === filterByPlugin.toLowerCase(); | |
| 318 | + }); | |
| 319 | + } | |
| 320 | + if ('all' !== filterByStatus) { | |
| 321 | + filteredWidgets = filteredWidgets.filter(function (widget) { | |
| 322 | + if ('active' === filterByStatus) { | |
| 323 | + return !widgetsDisabled.includes(widget.name); | |
| 324 | + } | |
| 325 | + return widgetsDisabled.includes(widget.name); | |
| 326 | + }); | |
| 327 | + } | |
| 328 | + filteredWidgets.sort(function (a, b) { | |
| 329 | + var aValue; | |
| 330 | + var bValue; | |
| 331 | + if ('widget' === sortingColumn) { | |
| 332 | + aValue = a.title; | |
| 333 | + bValue = b.title; | |
| 1449 | 334 | } |
| 1450 | - }, _callee); | |
| 1451 | - })), []); | |
| 1452 | - var saveChanges = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() { | |
| 1453 | - return _regenerator.default.wrap(function (_context2) { | |
| 1454 | - while (1) switch (_context2.prev = _context2.next) { | |
| 1455 | - case 0: | |
| 1456 | - setChangeProgress(function (prev) { | |
| 1457 | - return _objectSpread(_objectSpread({}, prev), {}, { | |
| 1458 | - isSaving: true | |
| 1459 | - }); | |
| 1460 | - }); | |
| 1461 | - _context2.next = 1; | |
| 1462 | - return (0, _api.saveDisabledWidgets)(widgetsDisabled, widgetsRoleRestrictions); | |
| 1463 | - case 1: | |
| 1464 | - setChangeProgress({ | |
| 1465 | - isSaving: false, | |
| 1466 | - isUnsavedChanges: false | |
| 1467 | - }); | |
| 1468 | - setIsSnackbarOpen(true); | |
| 1469 | - case 2: | |
| 1470 | - case "end": | |
| 1471 | - return _context2.stop(); | |
| 335 | + if ('usage' === sortingColumn) { | |
| 336 | + aValue = getWidgetUsage(a.name); | |
| 337 | + bValue = getWidgetUsage(b.name); | |
| 1472 | 338 | } |
| 1473 | - }, _callee2); | |
| 1474 | - })), [widgetsDisabled, widgetsRoleRestrictions]); | |
| 1475 | - var deactivateAllUnusedWidgets = (0, _react.useCallback)(function () { | |
| 1476 | - if (!usageWidgets.data) { | |
| 1477 | - return; | |
| 339 | + if (aValue === bValue) { | |
| 340 | + return 0; | |
| 341 | + } | |
| 342 | + if ('asc' === sortingDirection) { | |
| 343 | + return aValue < bValue ? -1 : 1; | |
| 344 | + } | |
| 345 | + return aValue > bValue ? -1 : 1; | |
| 346 | + }); | |
| 347 | + return filteredWidgets; | |
| 348 | + }, [widgets, searchKeyword, sortingColumn, sortingDirection, filterByPlugin, usageWidgets, filterByStatus, widgetsDisabled]); | |
| 349 | + var getSortingIndicatorClasses = function getSortingIndicatorClasses(column) { | |
| 350 | + if (sortingColumn !== column) { | |
| 351 | + return ''; | |
| 1478 | 352 | } |
| 353 | + if ('asc' === sortingDirection) { | |
| 354 | + return 'sorted asc'; | |
| 355 | + } | |
| 356 | + return 'sorted desc'; | |
| 357 | + }; | |
| 358 | + var onSortingClicked = function onSortingClicked(column) { | |
| 359 | + if (sortingColumn === column) { | |
| 360 | + if ('asc' === sortingDirection) { | |
| 361 | + setSortingDirection('desc'); | |
| 362 | + } else { | |
| 363 | + setSortingDirection('asc'); | |
| 364 | + } | |
| 365 | + } else { | |
| 366 | + setSortingColumn(column); | |
| 367 | + setSortingDirection('asc'); | |
| 368 | + } | |
| 369 | + }; | |
| 370 | + var onSaveClicked = /*#__PURE__*/function () { | |
| 371 | + var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 372 | + return _regenerator.default.wrap(function (_context) { | |
| 373 | + while (1) switch (_context.prev = _context.next) { | |
| 374 | + case 0: | |
| 375 | + setIsConfirmDialogOpen(false); | |
| 376 | + setChangeProgress(_objectSpread(_objectSpread({}, changeProgress), {}, { | |
| 377 | + isSaving: true | |
| 378 | + })); | |
| 379 | + _context.next = 1; | |
| 380 | + return (0, _api.saveDisabledWidgets)(widgetsDisabled, widgetsRoleRestrictions); | |
| 381 | + case 1: | |
| 382 | + setChangeProgress(_objectSpread(_objectSpread({}, changeProgress), {}, { | |
| 383 | + isSaving: false, | |
| 384 | + isUnsavedChanges: false | |
| 385 | + })); | |
| 386 | + setIsSnackbarOpen(true); | |
| 387 | + case 2: | |
| 388 | + case "end": | |
| 389 | + return _context.stop(); | |
| 390 | + } | |
| 391 | + }, _callee); | |
| 392 | + })); | |
| 393 | + return function onSaveClicked() { | |
| 394 | + return _ref.apply(this, arguments); | |
| 395 | + }; | |
| 396 | + }(); | |
| 397 | + var deactivateAllUnusedWidgets = function deactivateAllUnusedWidgets() { | |
| 1479 | 398 | var widgetsToDeactivate = widgets.filter(function (widget) { |
| 1480 | 399 | return !usageWidgets.data.hasOwnProperty(widget.name) || widgetsDisabled.includes(widget.name); |
| 1481 | 400 | }); |
| 1482 | 401 | setWidgetsDisabled(widgetsToDeactivate.map(function (widget) { |
| @@ -1481,38 +400,58 @@ | ||
| 1481 | 400 | }); |
| 1482 | 401 | setWidgetsDisabled(widgetsToDeactivate.map(function (widget) { |
| 1483 | 402 | return widget.name; |
| 1484 | 403 | })); |
| 1485 | - }, [widgets, usageWidgets.data, widgetsDisabled]); | |
| 1486 | - var enableAllWidgets = (0, _react.useCallback)(function () { | |
| 404 | + }; | |
| 405 | + var enableAllWidgets = function enableAllWidgets() { | |
| 1487 | 406 | setWidgetsDisabled([]); |
| 1488 | - }, []); | |
| 1489 | - var toggleWidget = (0, _react.useCallback)(function (widgetName, isEnabled) { | |
| 1490 | - if (isEnabled) { | |
| 1491 | - setWidgetsDisabled(function (prev) { | |
| 1492 | - return prev.filter(function (item) { | |
| 1493 | - return item !== widgetName; | |
| 1494 | - }); | |
| 1495 | - }); | |
| 1496 | - } else { | |
| 1497 | - setWidgetsDisabled(function (prev) { | |
| 1498 | - return [].concat((0, _toConsumableArray2.default)(prev), [widgetName]); | |
| 1499 | - }); | |
| 407 | + }; | |
| 408 | + var onScanUsageElementsClicked = /*#__PURE__*/function () { | |
| 409 | + var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() { | |
| 410 | + var data; | |
| 411 | + return _regenerator.default.wrap(function (_context2) { | |
| 412 | + while (1) switch (_context2.prev = _context2.next) { | |
| 413 | + case 0: | |
| 414 | + setUsageWidgets(_objectSpread(_objectSpread({}, usageWidgets), {}, { | |
| 415 | + isLoading: true | |
| 416 | + })); | |
| 417 | + _context2.next = 1; | |
| 418 | + return (0, _api.getUsageWidgets)(); | |
| 419 | + case 1: | |
| 420 | + data = _context2.sent; | |
| 421 | + setUsageWidgets({ | |
| 422 | + data: data, | |
| 423 | + isLoading: false | |
| 424 | + }); | |
| 425 | + setSortingColumn('usage'); | |
| 426 | + setSortingDirection('desc'); | |
| 427 | + case 2: | |
| 428 | + case "end": | |
| 429 | + return _context2.stop(); | |
| 430 | + } | |
| 431 | + }, _callee2); | |
| 432 | + })); | |
| 433 | + return function onScanUsageElementsClicked() { | |
| 434 | + return _ref2.apply(this, arguments); | |
| 435 | + }; | |
| 436 | + }(); | |
| 437 | + var UsageTimesColumn = function UsageTimesColumn(_ref3) { | |
| 438 | + var widgetName = _ref3.widgetName; | |
| 439 | + if (null !== usageWidgets.data) { | |
| 440 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, getWidgetUsage(widgetName), " ", (0, _i18n.__)('times', 'elementor')); | |
| 1500 | 441 | } |
| 1501 | - }, []); | |
| 1502 | - var dismissNotice = (0, _react.useCallback)(function () { | |
| 1503 | - if (noticeData) { | |
| 1504 | - (0, _api.markNoticeViewed)(noticeData.notice_id, noticeData.nonce); | |
| 1505 | - setNoticeData(function (prev) { | |
| 1506 | - return _objectSpread(_objectSpread({}, prev), {}, { | |
| 1507 | - is_viewed: true | |
| 1508 | - }); | |
| 1509 | - }); | |
| 442 | + if (usageWidgets.isLoading) { | |
| 443 | + return /*#__PURE__*/_react.default.createElement(_components.Spinner, null); | |
| 1510 | 444 | } |
| 1511 | - }, [noticeData]); | |
| 1512 | - (0, _react.useEffect)(function () { | |
| 1513 | - var loadData = /*#__PURE__*/function () { | |
| 1514 | - var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() { | |
| 445 | + return /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 446 | + onClick: onScanUsageElementsClicked, | |
| 447 | + size: 'small', | |
| 448 | + variant: 'secondary' | |
| 449 | + }, (0, _i18n.__)('Show', 'elementor')); | |
| 450 | + }; | |
| 451 | + (0, _element.useEffect)(function () { | |
| 452 | + var onLoading = /*#__PURE__*/function () { | |
| 453 | + var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() { | |
| 1515 | 454 | var _appData$additional_d, _appData$additional_d2; |
| 1516 | 455 | var appData, pluginsData; |
| 1517 | 456 | return _regenerator.default.wrap(function (_context3) { |
| 1518 | 457 | while (1) switch (_context3.prev = _context3.next) { |
| @@ -1538,18 +477,13 @@ | ||
| 1538 | 477 | value: plugin |
| 1539 | 478 | }; |
| 1540 | 479 | }); |
| 1541 | 480 | pluginsData.unshift({ |
| 1542 | - label: 'All Plugins', | |
| 481 | + label: (0, _i18n.__)('All Plugins', 'elementor'), | |
| 1543 | 482 | value: '' |
| 1544 | 483 | }); |
| 1545 | 484 | setPlugins(pluginsData); |
| 1546 | 485 | setIsLoading(false); |
| 1547 | - setChangeProgress(function (prev) { | |
| 1548 | - return _objectSpread(_objectSpread({}, prev), {}, { | |
| 1549 | - isUnsavedChanges: false | |
| 1550 | - }); | |
| 1551 | - }); | |
| 1552 | 486 | case 2: |
| 1553 | 487 | case "end": |
| 1554 | 488 | return _context3.stop(); |
| 1555 | 489 | } |
| @@ -1554,29 +488,23 @@ | ||
| 1554 | 488 | return _context3.stop(); |
| 1555 | 489 | } |
| 1556 | 490 | }, _callee3); |
| 1557 | 491 | })); |
| 1558 | - return function loadData() { | |
| 1559 | - return _ref3.apply(this, arguments); | |
| 492 | + return function onLoading() { | |
| 493 | + return _ref4.apply(this, arguments); | |
| 1560 | 494 | }; |
| 1561 | 495 | }(); |
| 1562 | - loadData(); | |
| 496 | + onLoading(); | |
| 1563 | 497 | }, []); |
| 1564 | - (0, _react.useEffect)(function () { | |
| 498 | + (0, _element.useEffect)(function () { | |
| 1565 | 499 | if (isLoading) { |
| 1566 | 500 | return; |
| 1567 | 501 | } |
| 1568 | - if (isInitialMount.current) { | |
| 1569 | - isInitialMount.current = false; | |
| 1570 | - return; | |
| 1571 | - } | |
| 1572 | - setChangeProgress(function (prev) { | |
| 1573 | - return _objectSpread(_objectSpread({}, prev), {}, { | |
| 1574 | - isUnsavedChanges: true | |
| 1575 | - }); | |
| 1576 | - }); | |
| 1577 | - }, [widgetsDisabled, widgetsRoleRestrictions, isLoading]); | |
| 1578 | - (0, _react.useEffect)(function () { | |
| 502 | + setChangeProgress(_objectSpread(_objectSpread({}, changeProgress), {}, { | |
| 503 | + isUnsavedChanges: true | |
| 504 | + })); | |
| 505 | + }, [widgetsDisabled, widgetsRoleRestrictions]); | |
| 506 | + (0, _element.useEffect)(function () { | |
| 1579 | 507 | var handleBeforeUnload = function handleBeforeUnload(event) { |
| 1580 | 508 | event.preventDefault(); |
| 1581 | 509 | event.returnValue = ''; |
| 1582 | 510 | }; |
| @@ -1588,150 +516,296 @@ | ||
| 1588 | 516 | return function () { |
| 1589 | 517 | window.removeEventListener('beforeunload', handleBeforeUnload); |
| 1590 | 518 | }; |
| 1591 | 519 | }, [changeProgress.isUnsavedChanges]); |
| 1592 | - return { | |
| 1593 | - isLoading: isLoading, | |
| 1594 | - widgets: widgets, | |
| 1595 | - promotionWidgets: promotionWidgets, | |
| 1596 | - plugins: plugins, | |
| 1597 | - roles: roles, | |
| 1598 | - widgetsDisabled: widgetsDisabled, | |
| 1599 | - widgetsRoleRestrictions: widgetsRoleRestrictions, | |
| 1600 | - setWidgetsRoleRestrictions: setWidgetsRoleRestrictions, | |
| 1601 | - promotionData: promotionData, | |
| 1602 | - noticeData: noticeData, | |
| 1603 | - usageWidgets: usageWidgets, | |
| 1604 | - changeProgress: changeProgress, | |
| 1605 | - isSnackbarOpen: isSnackbarOpen, | |
| 1606 | - setIsSnackbarOpen: setIsSnackbarOpen, | |
| 1607 | - getWidgetUsage: getWidgetUsage, | |
| 1608 | - scanUsageElements: scanUsageElements, | |
| 1609 | - saveChanges: saveChanges, | |
| 1610 | - deactivateAllUnusedWidgets: deactivateAllUnusedWidgets, | |
| 1611 | - enableAllWidgets: enableAllWidgets, | |
| 1612 | - toggleWidget: toggleWidget, | |
| 1613 | - dismissNotice: dismissNotice | |
| 1614 | - }; | |
| 1615 | -}; | |
| 1616 | - | |
| 1617 | -/***/ }), | |
| 1618 | - | |
| 1619 | -/***/ "../modules/element-manager/assets/js/app-editor-one/hooks/useWidgetFilters.js": | |
| 1620 | -/*!*************************************************************************************!*\ | |
| 1621 | - !*** ../modules/element-manager/assets/js/app-editor-one/hooks/useWidgetFilters.js ***! | |
| 1622 | - \*************************************************************************************/ | |
| 1623 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1624 | - | |
| 1625 | -"use strict"; | |
| 1626 | - | |
| 1627 | - | |
| 1628 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1629 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1630 | - value: true | |
| 1631 | -})); | |
| 1632 | -exports.useWidgetFilters = void 0; | |
| 1633 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1634 | -var _react = __webpack_require__(/*! react */ "react"); | |
| 1635 | -var useWidgetFilters = exports.useWidgetFilters = function useWidgetFilters(widgets, widgetsDisabled, getWidgetUsage) { | |
| 1636 | - var _useState = (0, _react.useState)(''), | |
| 1637 | - _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 1638 | - searchKeyword = _useState2[0], | |
| 1639 | - setSearchKeyword = _useState2[1]; | |
| 1640 | - var _useState3 = (0, _react.useState)('widget'), | |
| 1641 | - _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 1642 | - sortingColumn = _useState4[0], | |
| 1643 | - setSortingColumn = _useState4[1]; | |
| 1644 | - var _useState5 = (0, _react.useState)('asc'), | |
| 1645 | - _useState6 = (0, _slicedToArray2.default)(_useState5, 2), | |
| 1646 | - sortingDirection = _useState6[0], | |
| 1647 | - setSortingDirection = _useState6[1]; | |
| 1648 | - var _useState7 = (0, _react.useState)(''), | |
| 1649 | - _useState8 = (0, _slicedToArray2.default)(_useState7, 2), | |
| 1650 | - filterByPlugin = _useState8[0], | |
| 1651 | - setFilterByPlugin = _useState8[1]; | |
| 1652 | - var _useState9 = (0, _react.useState)('all'), | |
| 1653 | - _useState0 = (0, _slicedToArray2.default)(_useState9, 2), | |
| 1654 | - filterByStatus = _useState0[0], | |
| 1655 | - setFilterByStatus = _useState0[1]; | |
| 1656 | - var sortedAndFilteredWidgets = (0, _react.useMemo)(function () { | |
| 1657 | - var filteredWidgets = widgets.filter(function (widget) { | |
| 1658 | - return widget.title.toLowerCase().includes(searchKeyword.toLowerCase()); | |
| 1659 | - }); | |
| 1660 | - if ('' !== filterByPlugin) { | |
| 1661 | - filteredWidgets = filteredWidgets.filter(function (widget) { | |
| 1662 | - return widget.plugin.toLowerCase() === filterByPlugin.toLowerCase(); | |
| 1663 | - }); | |
| 520 | + if (isLoading) { | |
| 521 | + return /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 522 | + justify: 'center', | |
| 523 | + style: { | |
| 524 | + margin: '100px' | |
| 525 | + } | |
| 526 | + }, /*#__PURE__*/_react.default.createElement(_components.Spinner, { | |
| 527 | + style: { | |
| 528 | + height: 'calc(4px * 20)', | |
| 529 | + width: 'calc(4px * 20)' | |
| 530 | + } | |
| 531 | + })); | |
| 532 | + } | |
| 533 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", { | |
| 534 | + style: { | |
| 535 | + marginBottom: '20px', | |
| 536 | + maxWidth: '800px' | |
| 1664 | 537 | } |
| 1665 | - if ('all' !== filterByStatus) { | |
| 1666 | - filteredWidgets = filteredWidgets.filter(function (widget) { | |
| 1667 | - if ('active' === filterByStatus) { | |
| 1668 | - return !widgetsDisabled.includes(widget.name); | |
| 538 | + }, (0, _i18n.__)('Here\'s where you can fine-tune Elementor to your workflow. Disable elements you don\'t use for a cleaner interface, more focused creative experience, and improved performance.', 'elementor'), ' ', /*#__PURE__*/_react.default.createElement("a", { | |
| 539 | + href: "https://go.elementor.com/wp-dash-element-manager/", | |
| 540 | + rel: 'noreferrer', | |
| 541 | + target: '_blank' | |
| 542 | + }, (0, _i18n.__)('Learn More', 'elementor'))), !noticeData.is_viewed && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_components.Notice, { | |
| 543 | + onRemove: function onRemove() { | |
| 544 | + (0, _api.markNoticeViewed)(noticeData.notice_id, noticeData.nonce); | |
| 545 | + setNoticeData(_objectSpread(_objectSpread({}, noticeData), {}, { | |
| 546 | + is_viewed: true | |
| 547 | + })); | |
| 548 | + }, | |
| 549 | + status: "warning" | |
| 550 | + }, /*#__PURE__*/_react.default.createElement("strong", null, (0, _i18n.__)('Before you continue:', 'elementor')), " ", (0, _i18n.__)('Deactivating widgets here will remove them from both the Elementor Editor and your website, which can cause changes to your overall layout, design and what visitors see.', 'elementor'))), /*#__PURE__*/_react.default.createElement(_components.Panel, null, /*#__PURE__*/_react.default.createElement(_components.PanelBody, null, /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 551 | + style: { | |
| 552 | + position: 'sticky', | |
| 553 | + top: '32px', | |
| 554 | + background: 'rgb(255, 255, 255)', | |
| 555 | + zIndex: 10, | |
| 556 | + padding: '20px 16px', | |
| 557 | + boxShadow: 'rgba(0, 0, 0, 0.15) 0 5px 10px 0', | |
| 558 | + margin: '-16px -16px 24px' | |
| 559 | + } | |
| 560 | + }, /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 561 | + align: 'center' | |
| 562 | + }, /*#__PURE__*/_react.default.createElement(_components.SearchControl, { | |
| 563 | + label: (0, _i18n.__)('Search widgets', 'elementor'), | |
| 564 | + value: searchKeyword, | |
| 565 | + size: 'compact', | |
| 566 | + style: { | |
| 567 | + height: '40px', | |
| 568 | + border: '1px solid rgba(30, 30, 30, 0.5)', | |
| 569 | + background: 'transparent' | |
| 570 | + }, | |
| 571 | + __nextHasNoMarginBottom: true, | |
| 572 | + onChange: setSearchKeyword | |
| 573 | + }), /*#__PURE__*/_react.default.createElement(_components.FlexItem, { | |
| 574 | + style: { | |
| 575 | + maxWidth: '130px' | |
| 576 | + } | |
| 577 | + }, /*#__PURE__*/_react.default.createElement(_components.SelectControl, { | |
| 578 | + onChange: setFilterByPlugin, | |
| 579 | + size: '__unstable-large', | |
| 580 | + __nextHasNoMarginBottom: true, | |
| 581 | + options: plugins | |
| 582 | + })), /*#__PURE__*/_react.default.createElement(_components.FlexItem, { | |
| 583 | + style: { | |
| 584 | + maxWidth: '130px' | |
| 585 | + } | |
| 586 | + }, /*#__PURE__*/_react.default.createElement(_components.SelectControl, { | |
| 587 | + onChange: setFilterByStatus, | |
| 588 | + size: '__unstable-large', | |
| 589 | + __nextHasNoMarginBottom: true, | |
| 590 | + options: [{ | |
| 591 | + label: (0, _i18n.__)('All Statuses', 'elementor'), | |
| 592 | + value: 'all' | |
| 593 | + }, { | |
| 594 | + label: (0, _i18n.__)('Active', 'elementor'), | |
| 595 | + value: 'active' | |
| 596 | + }, { | |
| 597 | + label: (0, _i18n.__)('Inactive', 'elementor'), | |
| 598 | + value: 'inactive' | |
| 599 | + }] | |
| 600 | + })), /*#__PURE__*/_react.default.createElement("hr", { | |
| 601 | + style: { | |
| 602 | + height: '30px', | |
| 603 | + margin: '0 5px', | |
| 604 | + borderWidth: '0 1px 0 0', | |
| 605 | + borderStyle: 'solid', | |
| 606 | + borderColor: 'rgba(30, 30, 30, 0.5)' | |
| 607 | + } | |
| 608 | + }), /*#__PURE__*/_react.default.createElement(_components.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 609 | + variant: 'secondary', | |
| 610 | + style: { | |
| 611 | + marginInlineEnd: '10px' | |
| 612 | + }, | |
| 613 | + disabled: usageWidgets.isLoading, | |
| 614 | + isBusy: usageWidgets.isLoading, | |
| 615 | + onClick: onScanUsageElementsClicked | |
| 616 | + }, (0, _i18n.__)('Scan Element Usage', 'elementor')), /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 617 | + variant: 'secondary', | |
| 618 | + style: { | |
| 619 | + marginInlineEnd: '10px' | |
| 620 | + }, | |
| 621 | + onClick: deactivateAllUnusedWidgets, | |
| 622 | + disabled: null === usageWidgets.data | |
| 623 | + }, (0, _i18n.__)('Deactivate Unused Elements', 'elementor')), /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 624 | + variant: 'secondary', | |
| 625 | + disabled: !widgetsDisabled.length, | |
| 626 | + style: { | |
| 627 | + marginInlineEnd: '10px' | |
| 628 | + }, | |
| 629 | + onClick: enableAllWidgets | |
| 630 | + }, (0, _i18n.__)('Enable All', 'elementor'))))), /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 631 | + variant: "primary", | |
| 632 | + disabled: changeProgress.isSaving || !changeProgress.isUnsavedChanges, | |
| 633 | + isBusy: changeProgress.isSaving, | |
| 634 | + onClick: function onClick() { | |
| 635 | + setIsConfirmDialogOpen(true); | |
| 636 | + } | |
| 637 | + }, (0, _i18n.__)('Save Changes', 'elementor')))), /*#__PURE__*/_react.default.createElement(_components.PanelRow, null, !sortedAndFilteredWidgets.length ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _i18n.__)('No elements found.', 'elementor')) : /*#__PURE__*/_react.default.createElement("table", { | |
| 638 | + className: 'wp-list-table widefat fixed striped table-view-list' | |
| 639 | + }, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", { | |
| 640 | + className: "manage-column sortable ".concat(getSortingIndicatorClasses('widget')) | |
| 641 | + }, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 642 | + href: '#', | |
| 643 | + onClick: function onClick(event) { | |
| 644 | + event.preventDefault(); | |
| 645 | + onSortingClicked('widget'); | |
| 646 | + } | |
| 647 | + }, /*#__PURE__*/_react.default.createElement("span", null, (0, _i18n.__)('Element', 'elementor')), /*#__PURE__*/_react.default.createElement("span", { | |
| 648 | + className: "sorting-indicators" | |
| 649 | + }, /*#__PURE__*/_react.default.createElement("span", { | |
| 650 | + className: "sorting-indicator asc", | |
| 651 | + "aria-hidden": "true" | |
| 652 | + }), /*#__PURE__*/_react.default.createElement("span", { | |
| 653 | + className: "sorting-indicator desc", | |
| 654 | + "aria-hidden": "true" | |
| 655 | + })))), /*#__PURE__*/_react.default.createElement("th", null, (0, _i18n.__)('Status', 'elementor')), /*#__PURE__*/_react.default.createElement("th", { | |
| 656 | + className: "manage-column sortable ".concat(getSortingIndicatorClasses('usage')) | |
| 657 | + }, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 658 | + href: '#', | |
| 659 | + onClick: function onClick(event) { | |
| 660 | + event.preventDefault(); | |
| 661 | + onSortingClicked('usage'); | |
| 662 | + } | |
| 663 | + }, /*#__PURE__*/_react.default.createElement("span", null, (0, _i18n.__)('Usage', 'elementor')), /*#__PURE__*/_react.default.createElement("span", { | |
| 664 | + className: "sorting-indicators" | |
| 665 | + }, /*#__PURE__*/_react.default.createElement("span", { | |
| 666 | + className: "sorting-indicator asc", | |
| 667 | + "aria-hidden": "true" | |
| 668 | + }), /*#__PURE__*/_react.default.createElement("span", { | |
| 669 | + className: "sorting-indicator desc", | |
| 670 | + "aria-hidden": "true" | |
| 671 | + })))), /*#__PURE__*/_react.default.createElement("th", null, (0, _i18n.__)('Plugin', 'elementor')), /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 672 | + justify: 'flex-start', | |
| 673 | + gap: 0 | |
| 674 | + }, /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, (0, _i18n.__)('Permission', 'elementor')), /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement(_components.Tooltip, { | |
| 675 | + placement: 'top', | |
| 676 | + delay: 100, | |
| 677 | + text: (0, _i18n.__)('Choose which users will have access to each widget.', 'elementor') | |
| 678 | + }, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 679 | + icon: 'info-outline', | |
| 680 | + iconSize: 16 | |
| 681 | + }))), null === widgetsRoleRestrictions && /*#__PURE__*/_react.default.createElement(_components.FlexItem, { | |
| 682 | + style: { | |
| 683 | + marginInlineStart: '10px' | |
| 684 | + } | |
| 685 | + }, /*#__PURE__*/_react.default.createElement(_upgradeButton.UpgradeButton, { | |
| 686 | + href: promotionWidgets.length ? managerPermissions.pro.url : managerPermissions.advanced.url, | |
| 687 | + size: 'small', | |
| 688 | + text: promotionWidgets.length ? managerPermissions.pro.text : managerPermissions.advanced.text | |
| 689 | + })))))), /*#__PURE__*/_react.default.createElement("tbody", null, sortedAndFilteredWidgets.map(function (widget) { | |
| 690 | + return /*#__PURE__*/_react.default.createElement("tr", { | |
| 691 | + key: widget.name, | |
| 692 | + "data-key-id": widget.name | |
| 693 | + }, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("i", { | |
| 694 | + style: { | |
| 695 | + marginInlineEnd: '5px', | |
| 696 | + marginInlineStart: '0', | |
| 697 | + display: 'inline-block' | |
| 698 | + }, | |
| 699 | + className: "".concat(widget.icon) | |
| 700 | + }), " ", widget.title), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_components.ToggleControl, { | |
| 701 | + checked: !widgetsDisabled.includes(widget.name), | |
| 702 | + __nextHasNoMarginBottom: true, | |
| 703 | + onChange: function onChange() { | |
| 704 | + if (widgetsDisabled.includes(widget.name)) { | |
| 705 | + setWidgetsDisabled(widgetsDisabled.filter(function (item) { | |
| 706 | + return item !== widget.name; | |
| 707 | + })); | |
| 708 | + } else { | |
| 709 | + setWidgetsDisabled([].concat((0, _toConsumableArray2.default)(widgetsDisabled), [widget.name])); | |
| 1669 | 710 | } |
| 1670 | - return widgetsDisabled.includes(widget.name); | |
| 1671 | - }); | |
| 711 | + } | |
| 712 | + })), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(UsageTimesColumn, { | |
| 713 | + widgetName: widget.name | |
| 714 | + })), /*#__PURE__*/_react.default.createElement("td", null, widget.plugin), /*#__PURE__*/_react.default.createElement("td", null, null !== widgetsRoleRestrictions && !widgetsDisabled.includes(widget.name) ? /*#__PURE__*/_react.default.createElement(_rolePermissions.RolePermissions, { | |
| 715 | + widgetName: widget.name, | |
| 716 | + roles: roles, | |
| 717 | + widgetsRoleRestrictions: widgetsRoleRestrictions, | |
| 718 | + setWidgetsRoleRestrictions: setWidgetsRoleRestrictions | |
| 719 | + }) : /*#__PURE__*/_react.default.createElement(_rolePermissions.EditButtonDisabled, null))); | |
| 720 | + })))), promotionWidgets.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.PanelRow, null, /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 721 | + style: { | |
| 722 | + marginTop: '40px', | |
| 723 | + marginBottom: '20px' | |
| 1672 | 724 | } |
| 1673 | - filteredWidgets.sort(function (a, b) { | |
| 1674 | - var aValue; | |
| 1675 | - var bValue; | |
| 1676 | - if ('widget' === sortingColumn) { | |
| 1677 | - aValue = a.title; | |
| 1678 | - bValue = b.title; | |
| 1679 | - } | |
| 1680 | - if ('usage' === sortingColumn) { | |
| 1681 | - aValue = getWidgetUsage(a.name); | |
| 1682 | - bValue = getWidgetUsage(b.name); | |
| 1683 | - } | |
| 1684 | - if (aValue === bValue) { | |
| 1685 | - return 0; | |
| 1686 | - } | |
| 1687 | - if ('asc' === sortingDirection) { | |
| 1688 | - return aValue < bValue ? -1 : 1; | |
| 1689 | - } | |
| 1690 | - return aValue > bValue ? -1 : 1; | |
| 1691 | - }); | |
| 1692 | - return filteredWidgets; | |
| 1693 | - }, [widgets, searchKeyword, sortingColumn, sortingDirection, filterByPlugin, filterByStatus, widgetsDisabled, getWidgetUsage]); | |
| 1694 | - var getSortingIndicatorClasses = (0, _react.useCallback)(function (column) { | |
| 1695 | - if (sortingColumn !== column) { | |
| 1696 | - return ''; | |
| 725 | + }, /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement("h3", null, (0, _i18n.__)('Elementor Pro Elements', 'elementor')), /*#__PURE__*/_react.default.createElement("p", null, (0, _i18n.__)('Unleash the full power of Elementor\'s features and web creation tools.', 'elementor'))), /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement(_upgradeButton.UpgradeButton, { | |
| 726 | + href: elementManager.url, | |
| 727 | + text: elementManager.text | |
| 728 | + })))), /*#__PURE__*/_react.default.createElement(_components.PanelRow, null, /*#__PURE__*/_react.default.createElement("table", { | |
| 729 | + className: 'wp-list-table widefat fixed striped table-view-list' | |
| 730 | + }, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", { | |
| 731 | + className: "manage-column" | |
| 732 | + }, /*#__PURE__*/_react.default.createElement("span", null, (0, _i18n.__)('Element', 'elementor'))), /*#__PURE__*/_react.default.createElement("th", null, (0, _i18n.__)('Status', 'elementor')), /*#__PURE__*/_react.default.createElement("th", null, (0, _i18n.__)('Usage', 'elementor')), /*#__PURE__*/_react.default.createElement("th", null, (0, _i18n.__)('Plugin', 'elementor')), /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_components.Flex, { | |
| 733 | + justify: 'flex-start' | |
| 734 | + }, /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, (0, _i18n.__)('Permission', 'elementor')), /*#__PURE__*/_react.default.createElement(_components.FlexItem, null, /*#__PURE__*/_react.default.createElement(_components.Tooltip, { | |
| 735 | + placement: 'top', | |
| 736 | + delay: 100, | |
| 737 | + text: (0, _i18n.__)('Choose which role will have access to a specific widget.', 'elementor') | |
| 738 | + }, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 739 | + icon: 'info-outline' | |
| 740 | + }))))))), /*#__PURE__*/_react.default.createElement("tbody", null, promotionWidgets.map(function (widget) { | |
| 741 | + return /*#__PURE__*/_react.default.createElement("tr", { | |
| 742 | + key: widget.name | |
| 743 | + }, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("i", { | |
| 744 | + style: { | |
| 745 | + marginInlineEnd: '5px' | |
| 746 | + }, | |
| 747 | + className: "".concat(widget.icon) | |
| 748 | + }), " ", widget.title), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_components.ToggleControl, { | |
| 749 | + __nextHasNoMarginBottom: true, | |
| 750 | + checked: false, | |
| 751 | + disabled: true | |
| 752 | + })), /*#__PURE__*/_react.default.createElement("td", null), /*#__PURE__*/_react.default.createElement("td", null, (0, _i18n.__)('Elementor Pro', 'elementor')), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_rolePermissions.EditButtonDisabled, null))); | |
| 753 | + }))))))), isConfirmDialogOpen && /*#__PURE__*/_react.default.createElement(_components.Modal, { | |
| 754 | + title: (0, _i18n.__)('Sure you want to save these changes?', 'elementor'), | |
| 755 | + size: 'small', | |
| 756 | + isDismissible: false, | |
| 757 | + onRequestClose: function onRequestClose() { | |
| 758 | + setIsConfirmDialogOpen(false); | |
| 1697 | 759 | } |
| 1698 | - return 'asc' === sortingDirection ? 'sorted asc' : 'sorted desc'; | |
| 1699 | - }, [sortingColumn, sortingDirection]); | |
| 1700 | - var onSortingClicked = (0, _react.useCallback)(function (column) { | |
| 1701 | - if (sortingColumn === column) { | |
| 1702 | - setSortingDirection(function (prev) { | |
| 1703 | - return 'asc' === prev ? 'desc' : 'asc'; | |
| 1704 | - }); | |
| 1705 | - } else { | |
| 1706 | - setSortingColumn(column); | |
| 1707 | - setSortingDirection('asc'); | |
| 760 | + }, /*#__PURE__*/_react.default.createElement("p", { | |
| 761 | + style: { | |
| 762 | + maxWidth: '400px', | |
| 763 | + marginBlockEnd: '30px', | |
| 764 | + marginBlockStart: '0' | |
| 1708 | 765 | } |
| 1709 | - }, [sortingColumn]); | |
| 1710 | - var setSortByUsage = (0, _react.useCallback)(function () { | |
| 1711 | - setSortingColumn('usage'); | |
| 1712 | - setSortingDirection('desc'); | |
| 1713 | - }, []); | |
| 1714 | - return { | |
| 1715 | - searchKeyword: searchKeyword, | |
| 1716 | - setSearchKeyword: setSearchKeyword, | |
| 1717 | - filterByPlugin: filterByPlugin, | |
| 1718 | - setFilterByPlugin: setFilterByPlugin, | |
| 1719 | - filterByStatus: filterByStatus, | |
| 1720 | - setFilterByStatus: setFilterByStatus, | |
| 1721 | - sortedAndFilteredWidgets: sortedAndFilteredWidgets, | |
| 1722 | - getSortingIndicatorClasses: getSortingIndicatorClasses, | |
| 1723 | - onSortingClicked: onSortingClicked, | |
| 1724 | - setSortByUsage: setSortByUsage | |
| 1725 | - }; | |
| 766 | + }, (0, _i18n.__)('Turning widgets off will hide them from the editor panel, and can potentially affect your layout or front-end.', 'elementor'), /*#__PURE__*/_react.default.createElement("span", { | |
| 767 | + style: { | |
| 768 | + display: 'block', | |
| 769 | + marginTop: '20px' | |
| 770 | + } | |
| 771 | + }, (0, _i18n.__)('If you’re adding widgets back in, enjoy them!', 'elementor'))), /*#__PURE__*/_react.default.createElement(_components.ButtonGroup, { | |
| 772 | + style: { | |
| 773 | + display: 'flex', | |
| 774 | + justifyContent: 'flex-end', | |
| 775 | + gap: '30px' | |
| 776 | + } | |
| 777 | + }, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 778 | + variant: 'link', | |
| 779 | + onClick: function onClick() { | |
| 780 | + setIsConfirmDialogOpen(false); | |
| 781 | + } | |
| 782 | + }, (0, _i18n.__)('Cancel', 'elementor')), /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 783 | + variant: 'primary', | |
| 784 | + onClick: onSaveClicked | |
| 785 | + }, (0, _i18n.__)('Save', 'elementor')))), /*#__PURE__*/_react.default.createElement("div", { | |
| 786 | + style: { | |
| 787 | + position: 'fixed', | |
| 788 | + bottom: '40px', | |
| 789 | + left: '50%', | |
| 790 | + transform: 'translateX(-50%)', | |
| 791 | + display: isSnackbarOpen ? 'block' : 'none' | |
| 792 | + } | |
| 793 | + }, /*#__PURE__*/_react.default.createElement(_components.Snackbar, { | |
| 794 | + isDismissible: true, | |
| 795 | + status: 'success', | |
| 796 | + onRemove: function onRemove() { | |
| 797 | + return setIsSnackbarOpen(false); | |
| 798 | + } | |
| 799 | + }, (0, _i18n.__)('We saved your changes.', 'elementor')))); | |
| 1726 | 800 | }; |
| 1727 | 801 | |
| 1728 | 802 | /***/ }), |
| 1729 | 803 | |
| 1730 | -/***/ "../modules/element-manager/assets/js/app-editor-one/index.js": | |
| 1731 | -/*!********************************************************************!*\ | |
| 1732 | - !*** ../modules/element-manager/assets/js/app-editor-one/index.js ***! | |
| 1733 | - \********************************************************************/ | |
| 804 | +/***/ "../modules/element-manager/assets/js/role-permissions.js": | |
| 805 | +/*!****************************************************************!*\ | |
| 806 | + !*** ../modules/element-manager/assets/js/role-permissions.js ***! | |
| 807 | + \****************************************************************/ | |
| 1734 | 808 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 1735 | 809 | |
| 1736 | 810 | "use strict"; |
| 1737 | 811 | |
| @@ -1739,21 +813,122 @@ | ||
| 1739 | 813 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 1740 | 814 | Object.defineProperty(exports, "__esModule", ({ |
| 1741 | 815 | value: true |
| 1742 | 816 | })); |
| 1743 | -exports.AppModern = void 0; | |
| 817 | +exports.RolePermissions = exports.EditButtonDisabled = void 0; | |
| 1744 | 818 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 1745 | -var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1746 | -var _App = __webpack_require__(/*! ./App */ "../modules/element-manager/assets/js/app-editor-one/App.js"); | |
| 1747 | -var AppModern = exports.AppModern = function AppModern() { | |
| 1748 | - var _elementorCommon$conf; | |
| 1749 | - var isRTL = typeof elementorCommon !== 'undefined' && (_elementorCommon$conf = elementorCommon.config) !== null && _elementorCommon$conf !== void 0 && _elementorCommon$conf.isRTL ? elementorCommon.config.isRTL : 'rtl' === document.documentElement.dir || document.body.classList.contains('rtl'); | |
| 1750 | - return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, { | |
| 1751 | - rtl: isRTL | |
| 1752 | - }, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, { | |
| 1753 | - colorScheme: "light" | |
| 1754 | - }, /*#__PURE__*/_react.default.createElement(_App.App, null))); | |
| 819 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 820 | +var _components = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); | |
| 821 | +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | |
| 822 | +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 823 | +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable react/prop-types */ | |
| 824 | +var toggleRoleRestrictions = function toggleRoleRestrictions(widgetName, roleId, widgetsRoleRestrictions, setWidgetsRoleRestrictions) { | |
| 825 | + var widgetRoleRestrictions = widgetsRoleRestrictions[widgetName] || []; | |
| 826 | + if (widgetRoleRestrictions.includes(roleId)) { | |
| 827 | + widgetRoleRestrictions.splice(widgetRoleRestrictions.indexOf(roleId), 1); | |
| 828 | + } else { | |
| 829 | + widgetRoleRestrictions.push(roleId); | |
| 830 | + } | |
| 831 | + | |
| 832 | + // TODO: Remove the object from the state if it's empty | |
| 833 | + setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, widgetRoleRestrictions))); | |
| 1755 | 834 | }; |
| 835 | +var RolesList = function RolesList(props) { | |
| 836 | + var roles = props.roles, | |
| 837 | + widgetRoleRestrictions = props.widgetRoleRestrictions; | |
| 838 | + var rolesEnables = roles.filter(function (role) { | |
| 839 | + return !widgetRoleRestrictions.includes(role.id); | |
| 840 | + }); | |
| 841 | + if (!rolesEnables.length) { | |
| 842 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "(", (0, _i18n.__)('Admin', 'elementor'), ")"); | |
| 843 | + } | |
| 844 | + if (rolesEnables.length === roles.length) { | |
| 845 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "(", (0, _i18n.__)('All Roles', 'elementor'), ")"); | |
| 846 | + } | |
| 847 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "(", rolesEnables.map(function (role) { | |
| 848 | + return role.name; | |
| 849 | + }).join(', '), ")"); | |
| 850 | +}; | |
| 851 | +var RolePermissions = exports.RolePermissions = function RolePermissions(props) { | |
| 852 | + var roles = props.roles, | |
| 853 | + widgetName = props.widgetName, | |
| 854 | + widgetsRoleRestrictions = props.widgetsRoleRestrictions, | |
| 855 | + setWidgetsRoleRestrictions = props.setWidgetsRoleRestrictions; | |
| 856 | + var widgetRoleRestrictions = widgetsRoleRestrictions[widgetName] || []; | |
| 857 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.Dropdown, { | |
| 858 | + className: 'my-container-class-name', | |
| 859 | + contentClassName: 'my-dropdown-content-classname', | |
| 860 | + popoverProps: { | |
| 861 | + placement: 'bottom-start' | |
| 862 | + }, | |
| 863 | + renderToggle: function renderToggle(_ref) { | |
| 864 | + var isOpen = _ref.isOpen, | |
| 865 | + onToggle = _ref.onToggle; | |
| 866 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 867 | + variant: 'link', | |
| 868 | + onClick: onToggle, | |
| 869 | + "aria-expanded": isOpen, | |
| 870 | + style: { | |
| 871 | + textDecoration: 'none' | |
| 872 | + } | |
| 873 | + }, (0, _i18n.__)('Edit', 'elementor')), ' ', /*#__PURE__*/_react.default.createElement("span", { | |
| 874 | + style: { | |
| 875 | + color: 'var(--e-a-color-txt-muted)' | |
| 876 | + } | |
| 877 | + }, /*#__PURE__*/_react.default.createElement(RolesList, { | |
| 878 | + roles: roles, | |
| 879 | + widgetRoleRestrictions: widgetRoleRestrictions | |
| 880 | + }))); | |
| 881 | + }, | |
| 882 | + renderContent: function renderContent() { | |
| 883 | + var isAllChecked = roles.every(function (role) { | |
| 884 | + return !widgetRoleRestrictions.includes(role.id); | |
| 885 | + }); | |
| 886 | + var isIndeterminate = !isAllChecked && roles.some(function (role) { | |
| 887 | + return !widgetRoleRestrictions.includes(role.id); | |
| 888 | + }); | |
| 889 | + return /*#__PURE__*/_react.default.createElement("div", { | |
| 890 | + style: { | |
| 891 | + minWidth: '150px', | |
| 892 | + paddingInline: '10px', | |
| 893 | + paddingBlockStart: '10px' | |
| 894 | + } | |
| 895 | + }, /*#__PURE__*/_react.default.createElement(_components.CheckboxControl, { | |
| 896 | + checked: isAllChecked, | |
| 897 | + indeterminate: isIndeterminate, | |
| 898 | + label: 'All', | |
| 899 | + onChange: function onChange(value) { | |
| 900 | + if (value) { | |
| 901 | + setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, []))); | |
| 902 | + } else { | |
| 903 | + setWidgetsRoleRestrictions(_objectSpread(_objectSpread({}, widgetsRoleRestrictions), {}, (0, _defineProperty2.default)({}, widgetName, roles.map(function (role) { | |
| 904 | + return role.id; | |
| 905 | + })))); | |
| 906 | + } | |
| 907 | + } | |
| 908 | + }), roles.map(function (role) { | |
| 909 | + return /*#__PURE__*/_react.default.createElement("div", { | |
| 910 | + key: role.id | |
| 911 | + }, /*#__PURE__*/_react.default.createElement(_components.CheckboxControl, { | |
| 912 | + checked: !widgetRoleRestrictions.includes(role.id), | |
| 913 | + label: role.name, | |
| 914 | + onChange: function onChange() { | |
| 915 | + toggleRoleRestrictions(widgetName, role.id, widgetsRoleRestrictions, setWidgetsRoleRestrictions); | |
| 916 | + } | |
| 917 | + })); | |
| 918 | + })); | |
| 919 | + } | |
| 920 | + })); | |
| 921 | +}; | |
| 922 | +var EditButtonDisabled = exports.EditButtonDisabled = function EditButtonDisabled() { | |
| 923 | + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.Button, { | |
| 924 | + variant: "link", | |
| 925 | + disabled: true, | |
| 926 | + style: { | |
| 927 | + textDecoration: 'none' | |
| 928 | + } | |
| 929 | + }, (0, _i18n.__)('Edit', 'elementor'))); | |
| 930 | +}; | |
| 1756 | 931 | |
| 1757 | 932 | /***/ }), |
| 1758 | 933 | |
| 1759 | 934 | /***/ "../modules/element-manager/assets/js/upgrade-button.js": |
| @@ -1772,11 +947,9 @@ | ||
| 1772 | 947 | exports.UpgradeButton = void 0; |
| 1773 | 948 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 1774 | 949 | var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); |
| 1775 | 950 | var _components = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 1776 | -var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 1777 | 951 | var UpgradeButton = exports.UpgradeButton = function UpgradeButton(props) { |
| 1778 | - var trackingClass = props.className || 'e-id-elementor-element-manager-button-upgrade'; | |
| 1779 | 952 | return /*#__PURE__*/_react.default.createElement(_components.Button, (0, _extends2.default)({}, props, { |
| 1780 | 953 | variant: "primary", |
| 1781 | 954 | target: "_blank", |
| 1782 | 955 | rel: 'noreferrer', |
| @@ -1781,15 +954,11 @@ | ||
| 1781 | 954 | target: "_blank", |
| 1782 | 955 | rel: 'noreferrer', |
| 1783 | 956 | style: { |
| 1784 | 957 | background: 'var(--e-a-btn-bg-accent, #93003f)' |
| 1785 | - }, | |
| 1786 | - className: trackingClass | |
| 958 | + } | |
| 1787 | 959 | })); |
| 1788 | 960 | }; |
| 1789 | -UpgradeButton.propTypes = { | |
| 1790 | - className: _propTypes.default.string | |
| 1791 | -}; | |
| 1792 | 961 | |
| 1793 | 962 | /***/ }), |
| 1794 | 963 | |
| 1795 | 964 | /***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": |
| @@ -2196,19 +1365,21 @@ | ||
| 2196 | 1365 | } catch (e) { |
| 2197 | 1366 | i = 0; |
| 2198 | 1367 | } |
| 2199 | 1368 | module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { |
| 2200 | - function o(r, n) { | |
| 2201 | - _regeneratorDefine(e, r, function (e) { | |
| 2202 | - return this._invoke(r, n, e); | |
| 2203 | - }); | |
| 2204 | - } | |
| 2205 | - r ? i ? i(e, r, { | |
| 1369 | + if (r) i ? i(e, r, { | |
| 2206 | 1370 | value: n, |
| 2207 | 1371 | enumerable: !t, |
| 2208 | 1372 | configurable: !t, |
| 2209 | 1373 | writable: !t |
| 2210 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 1374 | + }) : e[r] = n;else { | |
| 1375 | + var o = function o(r, n) { | |
| 1376 | + _regeneratorDefine(e, r, function (e) { | |
| 1377 | + return this._invoke(r, n, e); | |
| 1378 | + }); | |
| 1379 | + }; | |
| 1380 | + o("next", 0), o("throw", 1), o("return", 2); | |
| 1381 | + } | |
| 2211 | 1382 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); |
| 2212 | 1383 | } |
| 2213 | 1384 | module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2214 | 1385 | |
| @@ -3405,12 +2576,12 @@ | ||
| 3405 | 2576 | /* harmony export */ renderNativeComponent: () => (/* binding */ renderNativeComponent), |
| 3406 | 2577 | /* harmony export */ renderStyle: () => (/* binding */ renderStyle) |
| 3407 | 2578 | /* harmony export */ }); |
| 3408 | 2579 | /* harmony import */ var is_plain_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-plain-object */ "../node_modules/is-plain-object/dist/is-plain-object.mjs"); |
| 3409 | -/* harmony import */ var change_case__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! change-case */ "../node_modules/param-case/dist.es2015/index.js"); | |
| 3410 | -/* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/escape-html */ "../node_modules/@wordpress/escape-html/build-module/index.js"); | |
| 3411 | -/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./react */ "react"); | |
| 3412 | -/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_react__WEBPACK_IMPORTED_MODULE_3__); | |
| 2580 | +/* harmony import */ var change_case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! change-case */ "../node_modules/param-case/dist.es2015/index.js"); | |
| 2581 | +/* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/escape-html */ "../node_modules/@wordpress/escape-html/build-module/index.js"); | |
| 2582 | +/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./react */ "react"); | |
| 2583 | +/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_react__WEBPACK_IMPORTED_MODULE_1__); | |
| 3413 | 2584 | /* harmony import */ var _raw_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./raw-html */ "../node_modules/@wordpress/element/build-module/raw-html.js"); |
| 3414 | 2585 | /** |
| 3415 | 2586 | * Parts of this source were derived and modified from fast-react-render, |
| 3416 | 2587 | * released under the MIT license. |
| @@ -3459,10 +2630,10 @@ | ||
| 3459 | 2630 | |
| 3460 | 2631 | const { |
| 3461 | 2632 | Provider, |
| 3462 | 2633 | Consumer |
| 3463 | -} = (0,_react__WEBPACK_IMPORTED_MODULE_3__.createContext)(undefined); | |
| 3464 | -const ForwardRef = (0,_react__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(() => { | |
| 2634 | +} = (0,_react__WEBPACK_IMPORTED_MODULE_1__.createContext)(undefined); | |
| 2635 | +const ForwardRef = (0,_react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(() => { | |
| 3465 | 2636 | return null; |
| 3466 | 2637 | }); |
| 3467 | 2638 | |
| 3468 | 2639 | /** |
| @@ -3628,9 +2799,9 @@ | ||
| 3628 | 2799 | const attributeLowerCase = attribute.toLowerCase(); |
| 3629 | 2800 | if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { |
| 3630 | 2801 | return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; |
| 3631 | 2802 | } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { |
| 3632 | - return (0,change_case__WEBPACK_IMPORTED_MODULE_1__.paramCase)(SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]); | |
| 2803 | + return (0,change_case__WEBPACK_IMPORTED_MODULE_2__.paramCase)(SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]); | |
| 3633 | 2804 | } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { |
| 3634 | 2805 | return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; |
| 3635 | 2806 | } |
| 3636 | 2807 | return attributeLowerCase; |
| @@ -3651,11 +2822,11 @@ | ||
| 3651 | 2822 | if (property.startsWith('--')) { |
| 3652 | 2823 | return property; |
| 3653 | 2824 | } |
| 3654 | 2825 | if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) { |
| 3655 | - return '-' + (0,change_case__WEBPACK_IMPORTED_MODULE_1__.paramCase)(property); | |
| 2826 | + return '-' + (0,change_case__WEBPACK_IMPORTED_MODULE_2__.paramCase)(property); | |
| 3656 | 2827 | } |
| 3657 | - return (0,change_case__WEBPACK_IMPORTED_MODULE_1__.paramCase)(property); | |
| 2828 | + return (0,change_case__WEBPACK_IMPORTED_MODULE_2__.paramCase)(property); | |
| 3658 | 2829 | } |
| 3659 | 2830 | |
| 3660 | 2831 | /** |
| 3661 | 2832 | * Returns the normal form of the style property value for HTML. Appends a |
| @@ -3690,9 +2861,9 @@ | ||
| 3690 | 2861 | return renderChildren(element, context, legacyContext); |
| 3691 | 2862 | } |
| 3692 | 2863 | switch (typeof element) { |
| 3693 | 2864 | case 'string': |
| 3694 | - return (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__.escapeHTML)(element); | |
| 2865 | + return (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(element); | |
| 3695 | 2866 | case 'number': |
| 3696 | 2867 | return element.toString(); |
| 3697 | 2868 | } |
| 3698 | 2869 | const { |
| @@ -3700,10 +2871,10 @@ | ||
| 3700 | 2871 | props |
| 3701 | 2872 | } = /** @type {{type?: any, props?: any}} */ |
| 3702 | 2873 | element; |
| 3703 | 2874 | switch (type) { |
| 3704 | - case _react__WEBPACK_IMPORTED_MODULE_3__.StrictMode: | |
| 3705 | - case _react__WEBPACK_IMPORTED_MODULE_3__.Fragment: | |
| 2875 | + case _react__WEBPACK_IMPORTED_MODULE_1__.StrictMode: | |
| 2876 | + case _react__WEBPACK_IMPORTED_MODULE_1__.Fragment: | |
| 3706 | 2877 | return renderChildren(props.children, context, legacyContext); |
| 3707 | 2878 | case _raw_html__WEBPACK_IMPORTED_MODULE_4__["default"]: |
| 3708 | 2879 | const { |
| 3709 | 2880 | children, |
| @@ -3830,9 +3001,9 @@ | ||
| 3830 | 3001 | function renderAttributes(props) { |
| 3831 | 3002 | let result = ''; |
| 3832 | 3003 | for (const key in props) { |
| 3833 | 3004 | const attribute = getNormalAttributeName(key); |
| 3834 | - if (!(0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__.isValidAttributeName)(attribute)) { | |
| 3005 | + if (!(0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.isValidAttributeName)(attribute)) { | |
| 3835 | 3006 | continue; |
| 3836 | 3007 | } |
| 3837 | 3008 | let value = getNormalAttributeValue(key, props[key]); |
| 3838 | 3009 | |
| @@ -3864,9 +3035,9 @@ | ||
| 3864 | 3035 | if (isBooleanAttribute) { |
| 3865 | 3036 | continue; |
| 3866 | 3037 | } |
| 3867 | 3038 | if (typeof value === 'string') { |
| 3868 | - value = (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__.escapeAttribute)(value); | |
| 3039 | + value = (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(value); | |
| 3869 | 3040 | } |
| 3870 | 3041 | result += '="' + value + '"'; |
| 3871 | 3042 | } |
| 3872 | 3043 | return result; |
| @@ -4119,15 +3290,15 @@ | ||
| 4119 | 3290 | __webpack_require__.r(__webpack_exports__); |
| 4120 | 3291 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 4121 | 3292 | /* harmony export */ dotCase: () => (/* binding */ dotCase) |
| 4122 | 3293 | /* harmony export */ }); |
| 4123 | -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.mjs"); | |
| 4124 | -/* harmony import */ var no_case__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! no-case */ "../node_modules/no-case/dist.es2015/index.js"); | |
| 3294 | +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.mjs"); | |
| 3295 | +/* harmony import */ var no_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! no-case */ "../node_modules/no-case/dist.es2015/index.js"); | |
| 4125 | 3296 | |
| 4126 | 3297 | |
| 4127 | 3298 | function dotCase(input, options) { |
| 4128 | 3299 | if (options === void 0) { options = {}; } |
| 4129 | - return (0,no_case__WEBPACK_IMPORTED_MODULE_1__.noCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ delimiter: "." }, options)); | |
| 3300 | + return (0,no_case__WEBPACK_IMPORTED_MODULE_0__.noCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({ delimiter: "." }, options)); | |
| 4130 | 3301 | } |
| 4131 | 3302 | //# sourceMappingURL=index.js.map |
| 4132 | 3303 | |
| 4133 | 3304 | /***/ }), |
| @@ -4289,109 +3460,8 @@ | ||
| 4289 | 3460 | //# sourceMappingURL=index.js.map |
| 4290 | 3461 | |
| 4291 | 3462 | /***/ }), |
| 4292 | 3463 | |
| 4293 | -/***/ "../node_modules/object-assign/index.js": | |
| 4294 | -/*!**********************************************!*\ | |
| 4295 | - !*** ../node_modules/object-assign/index.js ***! | |
| 4296 | - \**********************************************/ | |
| 4297 | -/***/ ((module) => { | |
| 4298 | - | |
| 4299 | -"use strict"; | |
| 4300 | -/* | |
| 4301 | -object-assign | |
| 4302 | -(c) Sindre Sorhus | |
| 4303 | -@license MIT | |
| 4304 | -*/ | |
| 4305 | - | |
| 4306 | - | |
| 4307 | -/* eslint-disable no-unused-vars */ | |
| 4308 | -var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 4309 | -var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 4310 | -var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 4311 | - | |
| 4312 | -function toObject(val) { | |
| 4313 | - if (val === null || val === undefined) { | |
| 4314 | - throw new TypeError('Object.assign cannot be called with null or undefined'); | |
| 4315 | - } | |
| 4316 | - | |
| 4317 | - return Object(val); | |
| 4318 | -} | |
| 4319 | - | |
| 4320 | -function shouldUseNative() { | |
| 4321 | - try { | |
| 4322 | - if (!Object.assign) { | |
| 4323 | - return false; | |
| 4324 | - } | |
| 4325 | - | |
| 4326 | - // Detect buggy property enumeration order in older V8 versions. | |
| 4327 | - | |
| 4328 | - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 | |
| 4329 | - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | |
| 4330 | - test1[5] = 'de'; | |
| 4331 | - if (Object.getOwnPropertyNames(test1)[0] === '5') { | |
| 4332 | - return false; | |
| 4333 | - } | |
| 4334 | - | |
| 4335 | - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 4336 | - var test2 = {}; | |
| 4337 | - for (var i = 0; i < 10; i++) { | |
| 4338 | - test2['_' + String.fromCharCode(i)] = i; | |
| 4339 | - } | |
| 4340 | - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | |
| 4341 | - return test2[n]; | |
| 4342 | - }); | |
| 4343 | - if (order2.join('') !== '0123456789') { | |
| 4344 | - return false; | |
| 4345 | - } | |
| 4346 | - | |
| 4347 | - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 4348 | - var test3 = {}; | |
| 4349 | - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | |
| 4350 | - test3[letter] = letter; | |
| 4351 | - }); | |
| 4352 | - if (Object.keys(Object.assign({}, test3)).join('') !== | |
| 4353 | - 'abcdefghijklmnopqrst') { | |
| 4354 | - return false; | |
| 4355 | - } | |
| 4356 | - | |
| 4357 | - return true; | |
| 4358 | - } catch (err) { | |
| 4359 | - // We don't expect any of the above to throw, but better to be safe. | |
| 4360 | - return false; | |
| 4361 | - } | |
| 4362 | -} | |
| 4363 | - | |
| 4364 | -module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
| 4365 | - var from; | |
| 4366 | - var to = toObject(target); | |
| 4367 | - var symbols; | |
| 4368 | - | |
| 4369 | - for (var s = 1; s < arguments.length; s++) { | |
| 4370 | - from = Object(arguments[s]); | |
| 4371 | - | |
| 4372 | - for (var key in from) { | |
| 4373 | - if (hasOwnProperty.call(from, key)) { | |
| 4374 | - to[key] = from[key]; | |
| 4375 | - } | |
| 4376 | - } | |
| 4377 | - | |
| 4378 | - if (getOwnPropertySymbols) { | |
| 4379 | - symbols = getOwnPropertySymbols(from); | |
| 4380 | - for (var i = 0; i < symbols.length; i++) { | |
| 4381 | - if (propIsEnumerable.call(from, symbols[i])) { | |
| 4382 | - to[symbols[i]] = from[symbols[i]]; | |
| 4383 | - } | |
| 4384 | - } | |
| 4385 | - } | |
| 4386 | - } | |
| 4387 | - | |
| 4388 | - return to; | |
| 4389 | -}; | |
| 4390 | - | |
| 4391 | - | |
| 4392 | -/***/ }), | |
| 4393 | - | |
| 4394 | 3464 | /***/ "../node_modules/param-case/dist.es2015/index.js": |
| 4395 | 3465 | /*!*******************************************************!*\ |
| 4396 | 3466 | !*** ../node_modules/param-case/dist.es2015/index.js ***! |
| 4397 | 3467 | \*******************************************************/ |
| @@ -4401,1024 +3471,20 @@ | ||
| 4401 | 3471 | __webpack_require__.r(__webpack_exports__); |
| 4402 | 3472 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 4403 | 3473 | /* harmony export */ paramCase: () => (/* binding */ paramCase) |
| 4404 | 3474 | /* harmony export */ }); |
| 4405 | -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.mjs"); | |
| 4406 | -/* harmony import */ var dot_case__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dot-case */ "../node_modules/dot-case/dist.es2015/index.js"); | |
| 3475 | +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.mjs"); | |
| 3476 | +/* harmony import */ var dot_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dot-case */ "../node_modules/dot-case/dist.es2015/index.js"); | |
| 4407 | 3477 | |
| 4408 | 3478 | |
| 4409 | 3479 | function paramCase(input, options) { |
| 4410 | 3480 | if (options === void 0) { options = {}; } |
| 4411 | - return (0,dot_case__WEBPACK_IMPORTED_MODULE_1__.dotCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ delimiter: "-" }, options)); | |
| 3481 | + return (0,dot_case__WEBPACK_IMPORTED_MODULE_0__.dotCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({ delimiter: "-" }, options)); | |
| 4412 | 3482 | } |
| 4413 | 3483 | //# sourceMappingURL=index.js.map |
| 4414 | 3484 | |
| 4415 | 3485 | /***/ }), |
| 4416 | 3486 | |
| 4417 | -/***/ "../node_modules/prop-types/checkPropTypes.js": | |
| 4418 | -/*!****************************************************!*\ | |
| 4419 | - !*** ../node_modules/prop-types/checkPropTypes.js ***! | |
| 4420 | - \****************************************************/ | |
| 4421 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4422 | - | |
| 4423 | -"use strict"; | |
| 4424 | -/** | |
| 4425 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 4426 | - * | |
| 4427 | - * This source code is licensed under the MIT license found in the | |
| 4428 | - * LICENSE file in the root directory of this source tree. | |
| 4429 | - */ | |
| 4430 | - | |
| 4431 | - | |
| 4432 | - | |
| 4433 | -var printWarning = function() {}; | |
| 4434 | - | |
| 4435 | -if (true) { | |
| 4436 | - var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 4437 | - var loggedTypeFailures = {}; | |
| 4438 | - var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 4439 | - | |
| 4440 | - printWarning = function(text) { | |
| 4441 | - var message = 'Warning: ' + text; | |
| 4442 | - if (typeof console !== 'undefined') { | |
| 4443 | - console.error(message); | |
| 4444 | - } | |
| 4445 | - try { | |
| 4446 | - // --- Welcome to debugging React --- | |
| 4447 | - // This error was thrown as a convenience so that you can use this stack | |
| 4448 | - // to find the callsite that caused this warning to fire. | |
| 4449 | - throw new Error(message); | |
| 4450 | - } catch (x) { /**/ } | |
| 4451 | - }; | |
| 4452 | -} | |
| 4453 | - | |
| 4454 | -/** | |
| 4455 | - * Assert that the values match with the type specs. | |
| 4456 | - * Error messages are memorized and will only be shown once. | |
| 4457 | - * | |
| 4458 | - * @param {object} typeSpecs Map of name to a ReactPropType | |
| 4459 | - * @param {object} values Runtime values that need to be type-checked | |
| 4460 | - * @param {string} location e.g. "prop", "context", "child context" | |
| 4461 | - * @param {string} componentName Name of the component for error messages. | |
| 4462 | - * @param {?Function} getStack Returns the component stack. | |
| 4463 | - * @private | |
| 4464 | - */ | |
| 4465 | -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 4466 | - if (true) { | |
| 4467 | - for (var typeSpecName in typeSpecs) { | |
| 4468 | - if (has(typeSpecs, typeSpecName)) { | |
| 4469 | - var error; | |
| 4470 | - // Prop type validation may throw. In case they do, we don't want to | |
| 4471 | - // fail the render phase where it didn't fail before. So we log it. | |
| 4472 | - // After these have been cleaned up, we'll let them throw. | |
| 4473 | - try { | |
| 4474 | - // This is intentionally an invariant that gets caught. It's the same | |
| 4475 | - // behavior as without this statement except with a better message. | |
| 4476 | - if (typeof typeSpecs[typeSpecName] !== 'function') { | |
| 4477 | - var err = Error( | |
| 4478 | - (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + | |
| 4479 | - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + | |
| 4480 | - 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' | |
| 4481 | - ); | |
| 4482 | - err.name = 'Invariant Violation'; | |
| 4483 | - throw err; | |
| 4484 | - } | |
| 4485 | - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 4486 | - } catch (ex) { | |
| 4487 | - error = ex; | |
| 4488 | - } | |
| 4489 | - if (error && !(error instanceof Error)) { | |
| 4490 | - printWarning( | |
| 4491 | - (componentName || 'React class') + ': type specification of ' + | |
| 4492 | - location + ' `' + typeSpecName + '` is invalid; the type checker ' + | |
| 4493 | - 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + | |
| 4494 | - 'You may have forgotten to pass an argument to the type checker ' + | |
| 4495 | - 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + | |
| 4496 | - 'shape all require an argument).' | |
| 4497 | - ); | |
| 4498 | - } | |
| 4499 | - if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 4500 | - // Only monitor this failure once because there tends to be a lot of the | |
| 4501 | - // same error. | |
| 4502 | - loggedTypeFailures[error.message] = true; | |
| 4503 | - | |
| 4504 | - var stack = getStack ? getStack() : ''; | |
| 4505 | - | |
| 4506 | - printWarning( | |
| 4507 | - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | |
| 4508 | - ); | |
| 4509 | - } | |
| 4510 | - } | |
| 4511 | - } | |
| 4512 | - } | |
| 4513 | -} | |
| 4514 | - | |
| 4515 | -/** | |
| 4516 | - * Resets warning cache when testing. | |
| 4517 | - * | |
| 4518 | - * @private | |
| 4519 | - */ | |
| 4520 | -checkPropTypes.resetWarningCache = function() { | |
| 4521 | - if (true) { | |
| 4522 | - loggedTypeFailures = {}; | |
| 4523 | - } | |
| 4524 | -} | |
| 4525 | - | |
| 4526 | -module.exports = checkPropTypes; | |
| 4527 | - | |
| 4528 | - | |
| 4529 | -/***/ }), | |
| 4530 | - | |
| 4531 | -/***/ "../node_modules/prop-types/factoryWithTypeCheckers.js": | |
| 4532 | -/*!*************************************************************!*\ | |
| 4533 | - !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***! | |
| 4534 | - \*************************************************************/ | |
| 4535 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4536 | - | |
| 4537 | -"use strict"; | |
| 4538 | -/** | |
| 4539 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 4540 | - * | |
| 4541 | - * This source code is licensed under the MIT license found in the | |
| 4542 | - * LICENSE file in the root directory of this source tree. | |
| 4543 | - */ | |
| 4544 | - | |
| 4545 | - | |
| 4546 | - | |
| 4547 | -var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 4548 | -var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js"); | |
| 4549 | - | |
| 4550 | -var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 4551 | -var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 4552 | -var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js"); | |
| 4553 | - | |
| 4554 | -var printWarning = function() {}; | |
| 4555 | - | |
| 4556 | -if (true) { | |
| 4557 | - printWarning = function(text) { | |
| 4558 | - var message = 'Warning: ' + text; | |
| 4559 | - if (typeof console !== 'undefined') { | |
| 4560 | - console.error(message); | |
| 4561 | - } | |
| 4562 | - try { | |
| 4563 | - // --- Welcome to debugging React --- | |
| 4564 | - // This error was thrown as a convenience so that you can use this stack | |
| 4565 | - // to find the callsite that caused this warning to fire. | |
| 4566 | - throw new Error(message); | |
| 4567 | - } catch (x) {} | |
| 4568 | - }; | |
| 4569 | -} | |
| 4570 | - | |
| 4571 | -function emptyFunctionThatReturnsNull() { | |
| 4572 | - return null; | |
| 4573 | -} | |
| 4574 | - | |
| 4575 | -module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 4576 | - /* global Symbol */ | |
| 4577 | - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | |
| 4578 | - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | |
| 4579 | - | |
| 4580 | - /** | |
| 4581 | - * Returns the iterator method function contained on the iterable object. | |
| 4582 | - * | |
| 4583 | - * Be sure to invoke the function with the iterable as context: | |
| 4584 | - * | |
| 4585 | - * var iteratorFn = getIteratorFn(myIterable); | |
| 4586 | - * if (iteratorFn) { | |
| 4587 | - * var iterator = iteratorFn.call(myIterable); | |
| 4588 | - * ... | |
| 4589 | - * } | |
| 4590 | - * | |
| 4591 | - * @param {?object} maybeIterable | |
| 4592 | - * @return {?function} | |
| 4593 | - */ | |
| 4594 | - function getIteratorFn(maybeIterable) { | |
| 4595 | - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 4596 | - if (typeof iteratorFn === 'function') { | |
| 4597 | - return iteratorFn; | |
| 4598 | - } | |
| 4599 | - } | |
| 4600 | - | |
| 4601 | - /** | |
| 4602 | - * Collection of methods that allow declaration and validation of props that are | |
| 4603 | - * supplied to React components. Example usage: | |
| 4604 | - * | |
| 4605 | - * var Props = require('ReactPropTypes'); | |
| 4606 | - * var MyArticle = React.createClass({ | |
| 4607 | - * propTypes: { | |
| 4608 | - * // An optional string prop named "description". | |
| 4609 | - * description: Props.string, | |
| 4610 | - * | |
| 4611 | - * // A required enum prop named "category". | |
| 4612 | - * category: Props.oneOf(['News','Photos']).isRequired, | |
| 4613 | - * | |
| 4614 | - * // A prop named "dialog" that requires an instance of Dialog. | |
| 4615 | - * dialog: Props.instanceOf(Dialog).isRequired | |
| 4616 | - * }, | |
| 4617 | - * render: function() { ... } | |
| 4618 | - * }); | |
| 4619 | - * | |
| 4620 | - * A more formal specification of how these methods are used: | |
| 4621 | - * | |
| 4622 | - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 4623 | - * decl := ReactPropTypes.{type}(.isRequired)? | |
| 4624 | - * | |
| 4625 | - * Each and every declaration produces a function with the same signature. This | |
| 4626 | - * allows the creation of custom validation functions. For example: | |
| 4627 | - * | |
| 4628 | - * var MyLink = React.createClass({ | |
| 4629 | - * propTypes: { | |
| 4630 | - * // An optional string or URI prop named "href". | |
| 4631 | - * href: function(props, propName, componentName) { | |
| 4632 | - * var propValue = props[propName]; | |
| 4633 | - * if (propValue != null && typeof propValue !== 'string' && | |
| 4634 | - * !(propValue instanceof URI)) { | |
| 4635 | - * return new Error( | |
| 4636 | - * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 4637 | - * componentName | |
| 4638 | - * ); | |
| 4639 | - * } | |
| 4640 | - * } | |
| 4641 | - * }, | |
| 4642 | - * render: function() {...} | |
| 4643 | - * }); | |
| 4644 | - * | |
| 4645 | - * @internal | |
| 4646 | - */ | |
| 4647 | - | |
| 4648 | - var ANONYMOUS = '<<anonymous>>'; | |
| 4649 | - | |
| 4650 | - // Important! | |
| 4651 | - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | |
| 4652 | - var ReactPropTypes = { | |
| 4653 | - array: createPrimitiveTypeChecker('array'), | |
| 4654 | - bigint: createPrimitiveTypeChecker('bigint'), | |
| 4655 | - bool: createPrimitiveTypeChecker('boolean'), | |
| 4656 | - func: createPrimitiveTypeChecker('function'), | |
| 4657 | - number: createPrimitiveTypeChecker('number'), | |
| 4658 | - object: createPrimitiveTypeChecker('object'), | |
| 4659 | - string: createPrimitiveTypeChecker('string'), | |
| 4660 | - symbol: createPrimitiveTypeChecker('symbol'), | |
| 4661 | - | |
| 4662 | - any: createAnyTypeChecker(), | |
| 4663 | - arrayOf: createArrayOfTypeChecker, | |
| 4664 | - element: createElementTypeChecker(), | |
| 4665 | - elementType: createElementTypeTypeChecker(), | |
| 4666 | - instanceOf: createInstanceTypeChecker, | |
| 4667 | - node: createNodeChecker(), | |
| 4668 | - objectOf: createObjectOfTypeChecker, | |
| 4669 | - oneOf: createEnumTypeChecker, | |
| 4670 | - oneOfType: createUnionTypeChecker, | |
| 4671 | - shape: createShapeTypeChecker, | |
| 4672 | - exact: createStrictShapeTypeChecker, | |
| 4673 | - }; | |
| 4674 | - | |
| 4675 | - /** | |
| 4676 | - * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 4677 | - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 4678 | - */ | |
| 4679 | - /*eslint-disable no-self-compare*/ | |
| 4680 | - function is(x, y) { | |
| 4681 | - // SameValue algorithm | |
| 4682 | - if (x === y) { | |
| 4683 | - // Steps 1-5, 7-10 | |
| 4684 | - // Steps 6.b-6.e: +0 != -0 | |
| 4685 | - return x !== 0 || 1 / x === 1 / y; | |
| 4686 | - } else { | |
| 4687 | - // Step 6.a: NaN == NaN | |
| 4688 | - return x !== x && y !== y; | |
| 4689 | - } | |
| 4690 | - } | |
| 4691 | - /*eslint-enable no-self-compare*/ | |
| 4692 | - | |
| 4693 | - /** | |
| 4694 | - * We use an Error-like object for backward compatibility as people may call | |
| 4695 | - * PropTypes directly and inspect their output. However, we don't use real | |
| 4696 | - * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 4697 | - * is prohibitively expensive if they are created too often, such as what | |
| 4698 | - * happens in oneOfType() for any type before the one that matched. | |
| 4699 | - */ | |
| 4700 | - function PropTypeError(message, data) { | |
| 4701 | - this.message = message; | |
| 4702 | - this.data = data && typeof data === 'object' ? data: {}; | |
| 4703 | - this.stack = ''; | |
| 4704 | - } | |
| 4705 | - // Make `instanceof Error` still work for returned errors. | |
| 4706 | - PropTypeError.prototype = Error.prototype; | |
| 4707 | - | |
| 4708 | - function createChainableTypeChecker(validate) { | |
| 4709 | - if (true) { | |
| 4710 | - var manualPropTypeCallCache = {}; | |
| 4711 | - var manualPropTypeWarningCount = 0; | |
| 4712 | - } | |
| 4713 | - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 4714 | - componentName = componentName || ANONYMOUS; | |
| 4715 | - propFullName = propFullName || propName; | |
| 4716 | - | |
| 4717 | - if (secret !== ReactPropTypesSecret) { | |
| 4718 | - if (throwOnDirectAccess) { | |
| 4719 | - // New behavior only for users of `prop-types` package | |
| 4720 | - var err = new Error( | |
| 4721 | - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | |
| 4722 | - 'Use `PropTypes.checkPropTypes()` to call them. ' + | |
| 4723 | - 'Read more at http://fb.me/use-check-prop-types' | |
| 4724 | - ); | |
| 4725 | - err.name = 'Invariant Violation'; | |
| 4726 | - throw err; | |
| 4727 | - } else if ( true && typeof console !== 'undefined') { | |
| 4728 | - // Old behavior for people using React.PropTypes | |
| 4729 | - var cacheKey = componentName + ':' + propName; | |
| 4730 | - if ( | |
| 4731 | - !manualPropTypeCallCache[cacheKey] && | |
| 4732 | - // Avoid spamming the console because they are often not actionable except for lib authors | |
| 4733 | - manualPropTypeWarningCount < 3 | |
| 4734 | - ) { | |
| 4735 | - printWarning( | |
| 4736 | - 'You are manually calling a React.PropTypes validation ' + | |
| 4737 | - 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + | |
| 4738 | - 'and will throw in the standalone `prop-types` package. ' + | |
| 4739 | - 'You may be seeing this warning due to a third-party PropTypes ' + | |
| 4740 | - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' | |
| 4741 | - ); | |
| 4742 | - manualPropTypeCallCache[cacheKey] = true; | |
| 4743 | - manualPropTypeWarningCount++; | |
| 4744 | - } | |
| 4745 | - } | |
| 4746 | - } | |
| 4747 | - if (props[propName] == null) { | |
| 4748 | - if (isRequired) { | |
| 4749 | - if (props[propName] === null) { | |
| 4750 | - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); | |
| 4751 | - } | |
| 4752 | - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | |
| 4753 | - } | |
| 4754 | - return null; | |
| 4755 | - } else { | |
| 4756 | - return validate(props, propName, componentName, location, propFullName); | |
| 4757 | - } | |
| 4758 | - } | |
| 4759 | - | |
| 4760 | - var chainedCheckType = checkType.bind(null, false); | |
| 4761 | - chainedCheckType.isRequired = checkType.bind(null, true); | |
| 4762 | - | |
| 4763 | - return chainedCheckType; | |
| 4764 | - } | |
| 4765 | - | |
| 4766 | - function createPrimitiveTypeChecker(expectedType) { | |
| 4767 | - function validate(props, propName, componentName, location, propFullName, secret) { | |
| 4768 | - var propValue = props[propName]; | |
| 4769 | - var propType = getPropType(propValue); | |
| 4770 | - if (propType !== expectedType) { | |
| 4771 | - // `propValue` being instance of, say, date/regexp, pass the 'object' | |
| 4772 | - // check, but we can offer a more precise error message here rather than | |
| 4773 | - // 'of type `object`'. | |
| 4774 | - var preciseType = getPreciseType(propValue); | |
| 4775 | - | |
| 4776 | - return new PropTypeError( | |
| 4777 | - 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), | |
| 4778 | - {expectedType: expectedType} | |
| 4779 | - ); | |
| 4780 | - } | |
| 4781 | - return null; | |
| 4782 | - } | |
| 4783 | - return createChainableTypeChecker(validate); | |
| 4784 | - } | |
| 4785 | - | |
| 4786 | - function createAnyTypeChecker() { | |
| 4787 | - return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 4788 | - } | |
| 4789 | - | |
| 4790 | - function createArrayOfTypeChecker(typeChecker) { | |
| 4791 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4792 | - if (typeof typeChecker !== 'function') { | |
| 4793 | - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); | |
| 4794 | - } | |
| 4795 | - var propValue = props[propName]; | |
| 4796 | - if (!Array.isArray(propValue)) { | |
| 4797 | - var propType = getPropType(propValue); | |
| 4798 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); | |
| 4799 | - } | |
| 4800 | - for (var i = 0; i < propValue.length; i++) { | |
| 4801 | - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); | |
| 4802 | - if (error instanceof Error) { | |
| 4803 | - return error; | |
| 4804 | - } | |
| 4805 | - } | |
| 4806 | - return null; | |
| 4807 | - } | |
| 4808 | - return createChainableTypeChecker(validate); | |
| 4809 | - } | |
| 4810 | - | |
| 4811 | - function createElementTypeChecker() { | |
| 4812 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4813 | - var propValue = props[propName]; | |
| 4814 | - if (!isValidElement(propValue)) { | |
| 4815 | - var propType = getPropType(propValue); | |
| 4816 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); | |
| 4817 | - } | |
| 4818 | - return null; | |
| 4819 | - } | |
| 4820 | - return createChainableTypeChecker(validate); | |
| 4821 | - } | |
| 4822 | - | |
| 4823 | - function createElementTypeTypeChecker() { | |
| 4824 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4825 | - var propValue = props[propName]; | |
| 4826 | - if (!ReactIs.isValidElementType(propValue)) { | |
| 4827 | - var propType = getPropType(propValue); | |
| 4828 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | |
| 4829 | - } | |
| 4830 | - return null; | |
| 4831 | - } | |
| 4832 | - return createChainableTypeChecker(validate); | |
| 4833 | - } | |
| 4834 | - | |
| 4835 | - function createInstanceTypeChecker(expectedClass) { | |
| 4836 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4837 | - if (!(props[propName] instanceof expectedClass)) { | |
| 4838 | - var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 4839 | - var actualClassName = getClassName(props[propName]); | |
| 4840 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); | |
| 4841 | - } | |
| 4842 | - return null; | |
| 4843 | - } | |
| 4844 | - return createChainableTypeChecker(validate); | |
| 4845 | - } | |
| 4846 | - | |
| 4847 | - function createEnumTypeChecker(expectedValues) { | |
| 4848 | - if (!Array.isArray(expectedValues)) { | |
| 4849 | - if (true) { | |
| 4850 | - if (arguments.length > 1) { | |
| 4851 | - printWarning( | |
| 4852 | - 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + | |
| 4853 | - 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' | |
| 4854 | - ); | |
| 4855 | - } else { | |
| 4856 | - printWarning('Invalid argument supplied to oneOf, expected an array.'); | |
| 4857 | - } | |
| 4858 | - } | |
| 4859 | - return emptyFunctionThatReturnsNull; | |
| 4860 | - } | |
| 4861 | - | |
| 4862 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4863 | - var propValue = props[propName]; | |
| 4864 | - for (var i = 0; i < expectedValues.length; i++) { | |
| 4865 | - if (is(propValue, expectedValues[i])) { | |
| 4866 | - return null; | |
| 4867 | - } | |
| 4868 | - } | |
| 4869 | - | |
| 4870 | - var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 4871 | - var type = getPreciseType(value); | |
| 4872 | - if (type === 'symbol') { | |
| 4873 | - return String(value); | |
| 4874 | - } | |
| 4875 | - return value; | |
| 4876 | - }); | |
| 4877 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | |
| 4878 | - } | |
| 4879 | - return createChainableTypeChecker(validate); | |
| 4880 | - } | |
| 4881 | - | |
| 4882 | - function createObjectOfTypeChecker(typeChecker) { | |
| 4883 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4884 | - if (typeof typeChecker !== 'function') { | |
| 4885 | - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); | |
| 4886 | - } | |
| 4887 | - var propValue = props[propName]; | |
| 4888 | - var propType = getPropType(propValue); | |
| 4889 | - if (propType !== 'object') { | |
| 4890 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); | |
| 4891 | - } | |
| 4892 | - for (var key in propValue) { | |
| 4893 | - if (has(propValue, key)) { | |
| 4894 | - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 4895 | - if (error instanceof Error) { | |
| 4896 | - return error; | |
| 4897 | - } | |
| 4898 | - } | |
| 4899 | - } | |
| 4900 | - return null; | |
| 4901 | - } | |
| 4902 | - return createChainableTypeChecker(validate); | |
| 4903 | - } | |
| 4904 | - | |
| 4905 | - function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 4906 | - if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 4907 | - true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; | |
| 4908 | - return emptyFunctionThatReturnsNull; | |
| 4909 | - } | |
| 4910 | - | |
| 4911 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 4912 | - var checker = arrayOfTypeCheckers[i]; | |
| 4913 | - if (typeof checker !== 'function') { | |
| 4914 | - printWarning( | |
| 4915 | - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | |
| 4916 | - 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | |
| 4917 | - ); | |
| 4918 | - return emptyFunctionThatReturnsNull; | |
| 4919 | - } | |
| 4920 | - } | |
| 4921 | - | |
| 4922 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4923 | - var expectedTypes = []; | |
| 4924 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 4925 | - var checker = arrayOfTypeCheckers[i]; | |
| 4926 | - var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 4927 | - if (checkerResult == null) { | |
| 4928 | - return null; | |
| 4929 | - } | |
| 4930 | - if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | |
| 4931 | - expectedTypes.push(checkerResult.data.expectedType); | |
| 4932 | - } | |
| 4933 | - } | |
| 4934 | - var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; | |
| 4935 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | |
| 4936 | - } | |
| 4937 | - return createChainableTypeChecker(validate); | |
| 4938 | - } | |
| 4939 | - | |
| 4940 | - function createNodeChecker() { | |
| 4941 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4942 | - if (!isNode(props[propName])) { | |
| 4943 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); | |
| 4944 | - } | |
| 4945 | - return null; | |
| 4946 | - } | |
| 4947 | - return createChainableTypeChecker(validate); | |
| 4948 | - } | |
| 4949 | - | |
| 4950 | - function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 4951 | - return new PropTypeError( | |
| 4952 | - (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + | |
| 4953 | - 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' | |
| 4954 | - ); | |
| 4955 | - } | |
| 4956 | - | |
| 4957 | - function createShapeTypeChecker(shapeTypes) { | |
| 4958 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4959 | - var propValue = props[propName]; | |
| 4960 | - var propType = getPropType(propValue); | |
| 4961 | - if (propType !== 'object') { | |
| 4962 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 4963 | - } | |
| 4964 | - for (var key in shapeTypes) { | |
| 4965 | - var checker = shapeTypes[key]; | |
| 4966 | - if (typeof checker !== 'function') { | |
| 4967 | - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 4968 | - } | |
| 4969 | - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 4970 | - if (error) { | |
| 4971 | - return error; | |
| 4972 | - } | |
| 4973 | - } | |
| 4974 | - return null; | |
| 4975 | - } | |
| 4976 | - return createChainableTypeChecker(validate); | |
| 4977 | - } | |
| 4978 | - | |
| 4979 | - function createStrictShapeTypeChecker(shapeTypes) { | |
| 4980 | - function validate(props, propName, componentName, location, propFullName) { | |
| 4981 | - var propValue = props[propName]; | |
| 4982 | - var propType = getPropType(propValue); | |
| 4983 | - if (propType !== 'object') { | |
| 4984 | - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 4985 | - } | |
| 4986 | - // We need to check all keys in case some are required but missing from props. | |
| 4987 | - var allKeys = assign({}, props[propName], shapeTypes); | |
| 4988 | - for (var key in allKeys) { | |
| 4989 | - var checker = shapeTypes[key]; | |
| 4990 | - if (has(shapeTypes, key) && typeof checker !== 'function') { | |
| 4991 | - return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 4992 | - } | |
| 4993 | - if (!checker) { | |
| 4994 | - return new PropTypeError( | |
| 4995 | - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | |
| 4996 | - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | |
| 4997 | - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | |
| 4998 | - ); | |
| 4999 | - } | |
| 5000 | - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 5001 | - if (error) { | |
| 5002 | - return error; | |
| 5003 | - } | |
| 5004 | - } | |
| 5005 | - return null; | |
| 5006 | - } | |
| 5007 | - | |
| 5008 | - return createChainableTypeChecker(validate); | |
| 5009 | - } | |
| 5010 | - | |
| 5011 | - function isNode(propValue) { | |
| 5012 | - switch (typeof propValue) { | |
| 5013 | - case 'number': | |
| 5014 | - case 'string': | |
| 5015 | - case 'undefined': | |
| 5016 | - return true; | |
| 5017 | - case 'boolean': | |
| 5018 | - return !propValue; | |
| 5019 | - case 'object': | |
| 5020 | - if (Array.isArray(propValue)) { | |
| 5021 | - return propValue.every(isNode); | |
| 5022 | - } | |
| 5023 | - if (propValue === null || isValidElement(propValue)) { | |
| 5024 | - return true; | |
| 5025 | - } | |
| 5026 | - | |
| 5027 | - var iteratorFn = getIteratorFn(propValue); | |
| 5028 | - if (iteratorFn) { | |
| 5029 | - var iterator = iteratorFn.call(propValue); | |
| 5030 | - var step; | |
| 5031 | - if (iteratorFn !== propValue.entries) { | |
| 5032 | - while (!(step = iterator.next()).done) { | |
| 5033 | - if (!isNode(step.value)) { | |
| 5034 | - return false; | |
| 5035 | - } | |
| 5036 | - } | |
| 5037 | - } else { | |
| 5038 | - // Iterator will provide entry [k,v] tuples rather than values. | |
| 5039 | - while (!(step = iterator.next()).done) { | |
| 5040 | - var entry = step.value; | |
| 5041 | - if (entry) { | |
| 5042 | - if (!isNode(entry[1])) { | |
| 5043 | - return false; | |
| 5044 | - } | |
| 5045 | - } | |
| 5046 | - } | |
| 5047 | - } | |
| 5048 | - } else { | |
| 5049 | - return false; | |
| 5050 | - } | |
| 5051 | - | |
| 5052 | - return true; | |
| 5053 | - default: | |
| 5054 | - return false; | |
| 5055 | - } | |
| 5056 | - } | |
| 5057 | - | |
| 5058 | - function isSymbol(propType, propValue) { | |
| 5059 | - // Native Symbol. | |
| 5060 | - if (propType === 'symbol') { | |
| 5061 | - return true; | |
| 5062 | - } | |
| 5063 | - | |
| 5064 | - // falsy value can't be a Symbol | |
| 5065 | - if (!propValue) { | |
| 5066 | - return false; | |
| 5067 | - } | |
| 5068 | - | |
| 5069 | - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | |
| 5070 | - if (propValue['@@toStringTag'] === 'Symbol') { | |
| 5071 | - return true; | |
| 5072 | - } | |
| 5073 | - | |
| 5074 | - // Fallback for non-spec compliant Symbols which are polyfilled. | |
| 5075 | - if (typeof Symbol === 'function' && propValue instanceof Symbol) { | |
| 5076 | - return true; | |
| 5077 | - } | |
| 5078 | - | |
| 5079 | - return false; | |
| 5080 | - } | |
| 5081 | - | |
| 5082 | - // Equivalent of `typeof` but with special handling for array and regexp. | |
| 5083 | - function getPropType(propValue) { | |
| 5084 | - var propType = typeof propValue; | |
| 5085 | - if (Array.isArray(propValue)) { | |
| 5086 | - return 'array'; | |
| 5087 | - } | |
| 5088 | - if (propValue instanceof RegExp) { | |
| 5089 | - // Old webkits (at least until Android 4.0) return 'function' rather than | |
| 5090 | - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ | |
| 5091 | - // passes PropTypes.object. | |
| 5092 | - return 'object'; | |
| 5093 | - } | |
| 5094 | - if (isSymbol(propType, propValue)) { | |
| 5095 | - return 'symbol'; | |
| 5096 | - } | |
| 5097 | - return propType; | |
| 5098 | - } | |
| 5099 | - | |
| 5100 | - // This handles more types than `getPropType`. Only used for error messages. | |
| 5101 | - // See `createPrimitiveTypeChecker`. | |
| 5102 | - function getPreciseType(propValue) { | |
| 5103 | - if (typeof propValue === 'undefined' || propValue === null) { | |
| 5104 | - return '' + propValue; | |
| 5105 | - } | |
| 5106 | - var propType = getPropType(propValue); | |
| 5107 | - if (propType === 'object') { | |
| 5108 | - if (propValue instanceof Date) { | |
| 5109 | - return 'date'; | |
| 5110 | - } else if (propValue instanceof RegExp) { | |
| 5111 | - return 'regexp'; | |
| 5112 | - } | |
| 5113 | - } | |
| 5114 | - return propType; | |
| 5115 | - } | |
| 5116 | - | |
| 5117 | - // Returns a string that is postfixed to a warning about an invalid type. | |
| 5118 | - // For example, "undefined" or "of type array" | |
| 5119 | - function getPostfixForTypeWarning(value) { | |
| 5120 | - var type = getPreciseType(value); | |
| 5121 | - switch (type) { | |
| 5122 | - case 'array': | |
| 5123 | - case 'object': | |
| 5124 | - return 'an ' + type; | |
| 5125 | - case 'boolean': | |
| 5126 | - case 'date': | |
| 5127 | - case 'regexp': | |
| 5128 | - return 'a ' + type; | |
| 5129 | - default: | |
| 5130 | - return type; | |
| 5131 | - } | |
| 5132 | - } | |
| 5133 | - | |
| 5134 | - // Returns class name of the object, if any. | |
| 5135 | - function getClassName(propValue) { | |
| 5136 | - if (!propValue.constructor || !propValue.constructor.name) { | |
| 5137 | - return ANONYMOUS; | |
| 5138 | - } | |
| 5139 | - return propValue.constructor.name; | |
| 5140 | - } | |
| 5141 | - | |
| 5142 | - ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 5143 | - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 5144 | - ReactPropTypes.PropTypes = ReactPropTypes; | |
| 5145 | - | |
| 5146 | - return ReactPropTypes; | |
| 5147 | -}; | |
| 5148 | - | |
| 5149 | - | |
| 5150 | -/***/ }), | |
| 5151 | - | |
| 5152 | -/***/ "../node_modules/prop-types/index.js": | |
| 5153 | -/*!*******************************************!*\ | |
| 5154 | - !*** ../node_modules/prop-types/index.js ***! | |
| 5155 | - \*******************************************/ | |
| 5156 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5157 | - | |
| 5158 | -/** | |
| 5159 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 5160 | - * | |
| 5161 | - * This source code is licensed under the MIT license found in the | |
| 5162 | - * LICENSE file in the root directory of this source tree. | |
| 5163 | - */ | |
| 5164 | - | |
| 5165 | -if (true) { | |
| 5166 | - var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 5167 | - | |
| 5168 | - // By explicitly using `prop-types` you are opting into new development behavior. | |
| 5169 | - // http://fb.me/prop-types-in-prod | |
| 5170 | - var throwOnDirectAccess = true; | |
| 5171 | - module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); | |
| 5172 | -} else // removed by dead control flow | |
| 5173 | -{} | |
| 5174 | - | |
| 5175 | - | |
| 5176 | -/***/ }), | |
| 5177 | - | |
| 5178 | -/***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js": | |
| 5179 | -/*!**************************************************************!*\ | |
| 5180 | - !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! | |
| 5181 | - \**************************************************************/ | |
| 5182 | -/***/ ((module) => { | |
| 5183 | - | |
| 5184 | -"use strict"; | |
| 5185 | -/** | |
| 5186 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 5187 | - * | |
| 5188 | - * This source code is licensed under the MIT license found in the | |
| 5189 | - * LICENSE file in the root directory of this source tree. | |
| 5190 | - */ | |
| 5191 | - | |
| 5192 | - | |
| 5193 | - | |
| 5194 | -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
| 5195 | - | |
| 5196 | -module.exports = ReactPropTypesSecret; | |
| 5197 | - | |
| 5198 | - | |
| 5199 | -/***/ }), | |
| 5200 | - | |
| 5201 | -/***/ "../node_modules/prop-types/lib/has.js": | |
| 5202 | -/*!*********************************************!*\ | |
| 5203 | - !*** ../node_modules/prop-types/lib/has.js ***! | |
| 5204 | - \*********************************************/ | |
| 5205 | -/***/ ((module) => { | |
| 5206 | - | |
| 5207 | -module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 5208 | - | |
| 5209 | - | |
| 5210 | -/***/ }), | |
| 5211 | - | |
| 5212 | -/***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": | |
| 5213 | -/*!************************************************************************************!*\ | |
| 5214 | - !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! | |
| 5215 | - \************************************************************************************/ | |
| 5216 | -/***/ ((__unused_webpack_module, exports) => { | |
| 5217 | - | |
| 5218 | -"use strict"; | |
| 5219 | -/** @license React v16.13.1 | |
| 5220 | - * react-is.development.js | |
| 5221 | - * | |
| 5222 | - * Copyright (c) Facebook, Inc. and its affiliates. | |
| 5223 | - * | |
| 5224 | - * This source code is licensed under the MIT license found in the | |
| 5225 | - * LICENSE file in the root directory of this source tree. | |
| 5226 | - */ | |
| 5227 | - | |
| 5228 | - | |
| 5229 | - | |
| 5230 | - | |
| 5231 | - | |
| 5232 | -if (true) { | |
| 5233 | - (function() { | |
| 5234 | -'use strict'; | |
| 5235 | - | |
| 5236 | -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | |
| 5237 | -// nor polyfill, then a plain number is used for performance. | |
| 5238 | -var hasSymbol = typeof Symbol === 'function' && Symbol.for; | |
| 5239 | -var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | |
| 5240 | -var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; | |
| 5241 | -var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; | |
| 5242 | -var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; | |
| 5243 | -var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; | |
| 5244 | -var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; | |
| 5245 | -var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | |
| 5246 | -// (unstable) APIs that have been removed. Can we remove the symbols? | |
| 5247 | - | |
| 5248 | -var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; | |
| 5249 | -var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; | |
| 5250 | -var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; | |
| 5251 | -var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; | |
| 5252 | -var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; | |
| 5253 | -var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; | |
| 5254 | -var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | |
| 5255 | -var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; | |
| 5256 | -var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | |
| 5257 | -var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | |
| 5258 | -var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | |
| 5259 | - | |
| 5260 | -function isValidElementType(type) { | |
| 5261 | - return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | |
| 5262 | - type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 5263 | -} | |
| 5264 | - | |
| 5265 | -function typeOf(object) { | |
| 5266 | - if (typeof object === 'object' && object !== null) { | |
| 5267 | - var $$typeof = object.$$typeof; | |
| 5268 | - | |
| 5269 | - switch ($$typeof) { | |
| 5270 | - case REACT_ELEMENT_TYPE: | |
| 5271 | - var type = object.type; | |
| 5272 | - | |
| 5273 | - switch (type) { | |
| 5274 | - case REACT_ASYNC_MODE_TYPE: | |
| 5275 | - case REACT_CONCURRENT_MODE_TYPE: | |
| 5276 | - case REACT_FRAGMENT_TYPE: | |
| 5277 | - case REACT_PROFILER_TYPE: | |
| 5278 | - case REACT_STRICT_MODE_TYPE: | |
| 5279 | - case REACT_SUSPENSE_TYPE: | |
| 5280 | - return type; | |
| 5281 | - | |
| 5282 | - default: | |
| 5283 | - var $$typeofType = type && type.$$typeof; | |
| 5284 | - | |
| 5285 | - switch ($$typeofType) { | |
| 5286 | - case REACT_CONTEXT_TYPE: | |
| 5287 | - case REACT_FORWARD_REF_TYPE: | |
| 5288 | - case REACT_LAZY_TYPE: | |
| 5289 | - case REACT_MEMO_TYPE: | |
| 5290 | - case REACT_PROVIDER_TYPE: | |
| 5291 | - return $$typeofType; | |
| 5292 | - | |
| 5293 | - default: | |
| 5294 | - return $$typeof; | |
| 5295 | - } | |
| 5296 | - | |
| 5297 | - } | |
| 5298 | - | |
| 5299 | - case REACT_PORTAL_TYPE: | |
| 5300 | - return $$typeof; | |
| 5301 | - } | |
| 5302 | - } | |
| 5303 | - | |
| 5304 | - return undefined; | |
| 5305 | -} // AsyncMode is deprecated along with isAsyncMode | |
| 5306 | - | |
| 5307 | -var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 5308 | -var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 5309 | -var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 5310 | -var ContextProvider = REACT_PROVIDER_TYPE; | |
| 5311 | -var Element = REACT_ELEMENT_TYPE; | |
| 5312 | -var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 5313 | -var Fragment = REACT_FRAGMENT_TYPE; | |
| 5314 | -var Lazy = REACT_LAZY_TYPE; | |
| 5315 | -var Memo = REACT_MEMO_TYPE; | |
| 5316 | -var Portal = REACT_PORTAL_TYPE; | |
| 5317 | -var Profiler = REACT_PROFILER_TYPE; | |
| 5318 | -var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 5319 | -var Suspense = REACT_SUSPENSE_TYPE; | |
| 5320 | -var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | |
| 5321 | - | |
| 5322 | -function isAsyncMode(object) { | |
| 5323 | - { | |
| 5324 | - if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 5325 | - hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | |
| 5326 | - | |
| 5327 | - console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | |
| 5328 | - } | |
| 5329 | - } | |
| 5330 | - | |
| 5331 | - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 5332 | -} | |
| 5333 | -function isConcurrentMode(object) { | |
| 5334 | - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 5335 | -} | |
| 5336 | -function isContextConsumer(object) { | |
| 5337 | - return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 5338 | -} | |
| 5339 | -function isContextProvider(object) { | |
| 5340 | - return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 5341 | -} | |
| 5342 | -function isElement(object) { | |
| 5343 | - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 5344 | -} | |
| 5345 | -function isForwardRef(object) { | |
| 5346 | - return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 5347 | -} | |
| 5348 | -function isFragment(object) { | |
| 5349 | - return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 5350 | -} | |
| 5351 | -function isLazy(object) { | |
| 5352 | - return typeOf(object) === REACT_LAZY_TYPE; | |
| 5353 | -} | |
| 5354 | -function isMemo(object) { | |
| 5355 | - return typeOf(object) === REACT_MEMO_TYPE; | |
| 5356 | -} | |
| 5357 | -function isPortal(object) { | |
| 5358 | - return typeOf(object) === REACT_PORTAL_TYPE; | |
| 5359 | -} | |
| 5360 | -function isProfiler(object) { | |
| 5361 | - return typeOf(object) === REACT_PROFILER_TYPE; | |
| 5362 | -} | |
| 5363 | -function isStrictMode(object) { | |
| 5364 | - return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 5365 | -} | |
| 5366 | -function isSuspense(object) { | |
| 5367 | - return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 5368 | -} | |
| 5369 | - | |
| 5370 | -exports.AsyncMode = AsyncMode; | |
| 5371 | -exports.ConcurrentMode = ConcurrentMode; | |
| 5372 | -exports.ContextConsumer = ContextConsumer; | |
| 5373 | -exports.ContextProvider = ContextProvider; | |
| 5374 | -exports.Element = Element; | |
| 5375 | -exports.ForwardRef = ForwardRef; | |
| 5376 | -exports.Fragment = Fragment; | |
| 5377 | -exports.Lazy = Lazy; | |
| 5378 | -exports.Memo = Memo; | |
| 5379 | -exports.Portal = Portal; | |
| 5380 | -exports.Profiler = Profiler; | |
| 5381 | -exports.StrictMode = StrictMode; | |
| 5382 | -exports.Suspense = Suspense; | |
| 5383 | -exports.isAsyncMode = isAsyncMode; | |
| 5384 | -exports.isConcurrentMode = isConcurrentMode; | |
| 5385 | -exports.isContextConsumer = isContextConsumer; | |
| 5386 | -exports.isContextProvider = isContextProvider; | |
| 5387 | -exports.isElement = isElement; | |
| 5388 | -exports.isForwardRef = isForwardRef; | |
| 5389 | -exports.isFragment = isFragment; | |
| 5390 | -exports.isLazy = isLazy; | |
| 5391 | -exports.isMemo = isMemo; | |
| 5392 | -exports.isPortal = isPortal; | |
| 5393 | -exports.isProfiler = isProfiler; | |
| 5394 | -exports.isStrictMode = isStrictMode; | |
| 5395 | -exports.isSuspense = isSuspense; | |
| 5396 | -exports.isValidElementType = isValidElementType; | |
| 5397 | -exports.typeOf = typeOf; | |
| 5398 | - })(); | |
| 5399 | -} | |
| 5400 | - | |
| 5401 | - | |
| 5402 | -/***/ }), | |
| 5403 | - | |
| 5404 | -/***/ "../node_modules/prop-types/node_modules/react-is/index.js": | |
| 5405 | -/*!*****************************************************************!*\ | |
| 5406 | - !*** ../node_modules/prop-types/node_modules/react-is/index.js ***! | |
| 5407 | - \*****************************************************************/ | |
| 5408 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 5409 | - | |
| 5410 | -"use strict"; | |
| 5411 | - | |
| 5412 | - | |
| 5413 | -if (false) // removed by dead control flow | |
| 5414 | -{} else { | |
| 5415 | - module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); | |
| 5416 | -} | |
| 5417 | - | |
| 5418 | - | |
| 5419 | -/***/ }), | |
| 5420 | - | |
| 5421 | 3487 | /***/ "../node_modules/react-dom/client.js": |
| 5422 | 3488 | /*!*******************************************!*\ |
| 5423 | 3489 | !*** ../node_modules/react-dom/client.js ***! |
| 5424 | 3490 | \*******************************************/ |
| @@ -5899,30 +3965,8 @@ | ||
| 5899 | 3965 | |
| 5900 | 3966 | |
| 5901 | 3967 | /***/ }), |
| 5902 | 3968 | |
| 5903 | -/***/ "@elementor/icons": | |
| 5904 | -/*!************************************!*\ | |
| 5905 | - !*** external "elementorV2.icons" ***! | |
| 5906 | - \************************************/ | |
| 5907 | -/***/ ((module) => { | |
| 5908 | - | |
| 5909 | -"use strict"; | |
| 5910 | -module.exports = elementorV2.icons; | |
| 5911 | - | |
| 5912 | -/***/ }), | |
| 5913 | - | |
| 5914 | -/***/ "@elementor/ui": | |
| 5915 | -/*!*********************************!*\ | |
| 5916 | - !*** external "elementorV2.ui" ***! | |
| 5917 | - \*********************************/ | |
| 5918 | -/***/ ((module) => { | |
| 5919 | - | |
| 5920 | -"use strict"; | |
| 5921 | -module.exports = elementorV2.ui; | |
| 5922 | - | |
| 5923 | -/***/ }), | |
| 5924 | - | |
| 5925 | 3969 | /***/ "@wordpress/components": |
| 5926 | 3970 | /*!********************************!*\ |
| 5927 | 3971 | !*** external "wp.components" ***! |
| 5928 | 3972 | \********************************/ |
| @@ -6057,16 +4101,14 @@ | ||
| 6057 | 4101 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 6058 | 4102 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 6059 | 4103 | var _element = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js"); |
| 6060 | 4104 | var _domReady = _interopRequireDefault(__webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready")); |
| 6061 | -var _appEditorOne = __webpack_require__(/*! ./app-editor-one */ "../modules/element-manager/assets/js/app-editor-one/index.js"); | |
| 4105 | +var _app = __webpack_require__(/*! ./app */ "../modules/element-manager/assets/js/app.js"); | |
| 6062 | 4106 | (0, _domReady.default)(function () { |
| 6063 | 4107 | var htmlOutput = document.getElementById('elementor-element-manager-wrap'); |
| 6064 | - if (!htmlOutput) { | |
| 6065 | - return; | |
| 4108 | + if (htmlOutput) { | |
| 4109 | + (0, _element.render)(/*#__PURE__*/_react.default.createElement(_app.App, null), htmlOutput); | |
| 6066 | 4110 | } |
| 6067 | - var root = (0, _element.createRoot)(htmlOutput); | |
| 6068 | - root.render(/*#__PURE__*/_react.default.createElement(_appEditorOne.AppModern, null)); | |
| 6069 | 4111 | }); |
| 6070 | 4112 | })(); |
| 6071 | 4113 | |
| 6072 | 4114 | /******/ })() |