| @@ -123,8 +123,9 @@ | ||
| 123 | 123 | var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); |
| 124 | 124 | var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); |
| 125 | 125 | var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); |
| 126 | 126 | var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); |
| 127 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 127 | 128 | var _excluded = ["children"], |
| 128 | 129 | _excluded2 = ["children"], |
| 129 | 130 | _excluded3 = ["children"], |
| 130 | 131 | _excluded4 = ["children"], |
| @@ -144,9 +145,9 @@ | ||
| 144 | 145 | props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2); |
| 145 | 146 | return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({ |
| 146 | 147 | component: "ul", |
| 147 | 148 | sx: { |
| 148 | - listStyle: 'disc' | |
| 149 | + my: 0 | |
| 149 | 150 | } |
| 150 | 151 | }, props), children); |
| 151 | 152 | }; |
| 152 | 153 | ContentList.propTypes = { |
| @@ -155,9 +156,13 @@ | ||
| 155 | 156 | var ContentListItem = exports.ContentListItem = function ContentListItem(_ref3) { |
| 156 | 157 | var children = _ref3.children, |
| 157 | 158 | props = (0, _objectWithoutProperties2.default)(_ref3, _excluded3); |
| 158 | 159 | return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({ |
| 159 | - component: "li" | |
| 160 | + component: "li", | |
| 161 | + sx: { | |
| 162 | + listStyle: 'disc', | |
| 163 | + marginInlineStart: 3 | |
| 164 | + } | |
| 160 | 165 | }, props), children); |
| 161 | 166 | }; |
| 162 | 167 | ContentListItem.propTypes = { |
| 163 | 168 | children: PropTypes.node |
| @@ -167,9 +172,12 @@ | ||
| 167 | 172 | props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4); |
| 168 | 173 | return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({ |
| 169 | 174 | component: "ul", |
| 170 | 175 | sx: { |
| 171 | - marginInlineStart: 2 | |
| 176 | + display: 'flex', | |
| 177 | + flexDirection: 'column', | |
| 178 | + gap: 0.5, | |
| 179 | + my: 0 | |
| 172 | 180 | } |
| 173 | 181 | }, props), children); |
| 174 | 182 | }; |
| 175 | 183 | AdvantagesList.propTypes = { |
| @@ -180,12 +188,18 @@ | ||
| 180 | 188 | props = (0, _objectWithoutProperties2.default)(_ref5, _excluded5); |
| 181 | 189 | return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({ |
| 182 | 190 | component: "li", |
| 183 | 191 | sx: { |
| 192 | + listStyle: 'none', | |
| 193 | + marginInlineStart: 0, | |
| 184 | 194 | lineHeight: '150%', |
| 185 | - listStyle: 'disc' | |
| 195 | + display: 'flex', | |
| 196 | + alignItems: 'flex-start', | |
| 197 | + gap: 0.5 | |
| 186 | 198 | } |
| 187 | - }, props), children); | |
| 199 | + }, props), /*#__PURE__*/_react.default.createElement(_icons.CheckIcon, { | |
| 200 | + fontSize: "small" | |
| 201 | + }), children); | |
| 188 | 202 | }; |
| 189 | 203 | AdvantagesListItem.propTypes = { |
| 190 | 204 | children: PropTypes.node |
| 191 | 205 | }; |
| @@ -262,9 +276,9 @@ | ||
| 262 | 276 | open: true, |
| 263 | 277 | autoHideDuration: 4000, |
| 264 | 278 | anchorOrigin: { |
| 265 | 279 | vertical: 'bottom', |
| 266 | - horizontal: 'center' | |
| 280 | + horizontal: 'right' | |
| 267 | 281 | }, |
| 268 | 282 | onClose: onClose |
| 269 | 283 | }, 'message' !== severity ? /*#__PURE__*/_react.default.createElement(_ui.Alert, { |
| 270 | 284 | variant: "filled", |
| @@ -325,22 +339,30 @@ | ||
| 325 | 339 | var _DialogHeader = _interopRequireDefault(__webpack_require__(/*! @elementor/ui/DialogHeader */ "@elementor/ui/DialogHeader")); |
| 326 | 340 | var _excluded = ["onClose", "onSubmit", "isEnrolled"]; |
| 327 | 341 | 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); } |
| 328 | 342 | var i18n = { |
| 329 | - header: (0, _i18n.__)('Atomic Editor', 'elementor'), | |
| 343 | + header: (0, _i18n.__)('Editor V4', 'elementor'), | |
| 344 | + chip: (0, _i18n.__)('Alpha', 'elementor'), | |
| 330 | 345 | checkboxText: (0, _i18n.__)('I’ve read and understood.', 'elementor'), |
| 331 | 346 | optIn: { |
| 332 | - titleText: (0, _i18n.__)('You are about to enable Atomic Editor features!', 'elementor'), | |
| 333 | - // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace | |
| 334 | - introText: (0, _i18n.__)('By activating, you’ll get access to the next generation of Elementor’s Editor. This is your chance to explore new capabilities and help shape the future of Elementor! ', 'elementor'), | |
| 335 | - details: [(0, _i18n.__)('When you activate, you’ll also be activating Containers and Nested Elements. You can turn them back off by going to: WP Admin > Elementor > Settings > Features.', 'elementor')], | |
| 347 | + titleText: (0, _i18n.__)('You are about to enable Editor V4 features!', 'elementor'), | |
| 348 | + introText: (0, _i18n.__)('By activating, you’ll get early access to the next generation of Elementor’s Editor. This is your chance to explore new capabilities and help shape the future of Elementor! ', 'elementor'), | |
| 349 | + notesHeader: (0, _i18n.__)(' Important notes:', 'elementor'), | |
| 350 | + notes: { | |
| 351 | + alphaPrefix: (0, _i18n.__)('Editor V4 is currently in alpha, ', 'elementor'), | |
| 352 | + details: [(0, _i18n.__)('and development is still in progress. Do not use it on live sites - use a staging or development environment instead.', 'elementor'), (0, _i18n.__)('When you activate Editor V4, you’ll also be activating Containers, the Top Bar, and Nested Elements. You can turn them back off by going to WP Admin > Elementor > Settings > Features.', 'elementor')] | |
| 353 | + }, | |
| 336 | 354 | activateButton: (0, _i18n.__)('Activate', 'elementor'), |
| 337 | 355 | cancelButton: (0, _i18n.__)('Cancel', 'elementor') |
| 338 | 356 | }, |
| 339 | 357 | optOut: { |
| 340 | - titleText: (0, _i18n.__)('You\'re about to lose all content created with Atomic features', 'elementor'), | |
| 341 | - details: [(0, _i18n.__)('By deactivating, you’ll lose all Atomic Elements, Classes and Variables. Any content you created with these features will no longer be available or appear on your site.', 'elementor'), (0, _i18n.__)('Containers and Nested Elements will stay in their current status.', 'elementor')], | |
| 342 | - activateButton: (0, _i18n.__)('Deactivate', 'elementor'), | |
| 358 | + titleText: (0, _i18n.__)('You’re deactivating Editor V4', 'elementor'), | |
| 359 | + introText: (0, _i18n.__)('We hope you enjoyed testing and building with these new features.', 'elementor'), | |
| 360 | + notesHeader: (0, _i18n.__)('Keep in mind:', 'elementor'), | |
| 361 | + notes: { | |
| 362 | + details: [(0, _i18n.__)('By deactivating, you’ll lose all Editor V4 features, and any content you created with V4-specific features will no longer be available or appear on your site.', 'elementor'), (0, _i18n.__)('Containers, the Top Bar, and Nested Elements will stay in their current status.', 'elementor')] | |
| 363 | + }, | |
| 364 | + activateButton: (0, _i18n.__)('Deactivate V4', 'elementor'), | |
| 343 | 365 | cancelButton: (0, _i18n.__)('Cancel', 'elementor') |
| 344 | 366 | } |
| 345 | 367 | }; |
| 346 | 368 | var Terms = exports.Terms = function Terms(_ref) { |
| @@ -364,35 +386,39 @@ | ||
| 364 | 386 | }; |
| 365 | 387 | var currentState = isEnrolled ? 'optOut' : 'optIn'; |
| 366 | 388 | return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({}, props, { |
| 367 | 389 | open: true, |
| 368 | - onClose: onClose, | |
| 369 | - maxWidth: "md" | |
| 370 | - }), /*#__PURE__*/_react.default.createElement(_DialogHeader.default, null, /*#__PURE__*/_react.default.createElement(_DialogHeaderGroup.default, null, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, null, i18n.header))), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, { | |
| 390 | + onClose: onClose | |
| 391 | + }), /*#__PURE__*/_react.default.createElement(_DialogHeader.default, null, /*#__PURE__*/_react.default.createElement(_DialogHeaderGroup.default, null, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, null, i18n.header), /*#__PURE__*/_react.default.createElement(_ui.Chip, { | |
| 392 | + label: i18n.chip, | |
| 393 | + color: "secondary", | |
| 394 | + variant: "filled", | |
| 395 | + size: "small" | |
| 396 | + }))), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, { | |
| 371 | 397 | dividers: true |
| 372 | 398 | }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { |
| 373 | 399 | gap: 2.5 |
| 374 | 400 | }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { |
| 375 | - gap: 1.5, | |
| 376 | - sx: { | |
| 377 | - mx: 2, | |
| 378 | - maxWidth: '550px' | |
| 379 | - } | |
| 401 | + gap: 1 | |
| 380 | 402 | }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { |
| 381 | 403 | align: "center", |
| 382 | 404 | variant: "h6" |
| 383 | - }, i18n[currentState].titleText), i18n[currentState].introText && /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 405 | + }, i18n[currentState].titleText), /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 384 | 406 | align: "center", |
| 385 | - variant: "body3" | |
| 386 | - }, i18n[currentState].introText)), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_optInContent.ContentList, { | |
| 387 | - sx: { | |
| 388 | - mx: 3, | |
| 389 | - maxWidth: '550px' | |
| 390 | - } | |
| 391 | - }, i18n[currentState].details.map(function (entry, index) { | |
| 407 | + variant: "body2" | |
| 408 | + }, i18n[currentState].introText)), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 409 | + gap: 1 | |
| 410 | + }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 411 | + variant: "body2" | |
| 412 | + }, i18n[currentState].notesHeader), /*#__PURE__*/_react.default.createElement(_optInContent.ContentList, null, /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, { | |
| 413 | + variant: "body2" | |
| 414 | + }, !isEnrolled && /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 415 | + variant: "subtitle2", | |
| 416 | + component: "span" | |
| 417 | + }, i18n.optIn.notes.alphaPrefix), i18n[currentState].notes.details[0]), i18n[currentState].notes.details.slice(1).map(function (entry, index) { | |
| 392 | 418 | return /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, { |
| 393 | 419 | key: index, |
| 394 | - variant: "body3" | |
| 420 | + variant: "body2" | |
| 395 | 421 | }, entry); |
| 396 | 422 | }))), /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, { |
| 397 | 423 | control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { |
| 398 | 424 | checked: !!checked, |
| @@ -440,8 +466,9 @@ | ||
| 440 | 466 | var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); |
| 441 | 467 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 442 | 468 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); |
| 443 | 469 | var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); |
| 470 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 444 | 471 | var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 445 | 472 | var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js"); |
| 446 | 473 | var _optInImgPlaceholders = __webpack_require__(/*! ./opt-in-img-placeholders */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js"); |
| 447 | 474 | var _optInMessage = __webpack_require__(/*! ./opt-in-message */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js"); |
| @@ -459,13 +486,16 @@ | ||
| 459 | 486 | }; |
| 460 | 487 | var OPT_IN_MSG = 'e-editor-v4-opt-in-message'; |
| 461 | 488 | var OPT_OUT_MSG = 'e-editor-v4-opt-out-message'; |
| 462 | 489 | var i18n = { |
| 463 | - title: (0, _i18n.__)('Activate Atomic Editor features', 'elementor'), | |
| 464 | - welcomeText: (0, _i18n.__)('The Atomic Editor presents a new generation of high-performance, flexible building blocks designed for less bloat and precise styling with a unified interface.', 'elementor'), | |
| 465 | - advantages: [[(0, _i18n.__)('Combine legacy widgets & new elements', 'elementor'), (0, _i18n.__)('Your current and new workflows work together on the same page.', 'elementor')], [(0, _i18n.__)('Build reusable design systems', 'elementor'), (0, _i18n.__)('Classes, Variables and Components give you a clear path for scale.', 'elementor')], [(0, _i18n.__)('Consistent styling experience', 'elementor'), (0, _i18n.__)('A unified Style tab for all Atomic Elements with full control over responsive design.', 'elementor')], [(0, _i18n.__)('Unparalleled performance', 'elementor'), (0, _i18n.__)('Cleaner code and a lighter CSS footprint with single-div wrappers.', 'elementor')]], | |
| 490 | + title: (0, _i18n.__)('The road to Editor V4', 'elementor'), | |
| 491 | + chip: (0, _i18n.__)('Alpha', 'elementor'), | |
| 492 | + welcomeText: (0, _i18n.__)('Welcome to a new era of web creation with Editor V4. It’s faster, more flexible, and built with a fresh approach to structure & styling.', 'elementor'), | |
| 493 | + advantagesHeader: (0, _i18n.__)('Here’s what’s inside the alpha version:', 'elementor'), | |
| 494 | + advantages: [(0, _i18n.__)('Unparalleled performance - Cleaner code & a lighter CSS footprint.', 'elementor'), (0, _i18n.__)('Professional tools at your fingertips - classes and states.', 'elementor'), (0, _i18n.__)('Consistent styling experience - A unified Style tab for all elements.', 'elementor'), (0, _i18n.__)('Fully responsive design - Customize any style property per screen.', 'elementor')], | |
| 466 | 495 | andMore: (0, _i18n.__)('And much more!', 'elementor'), |
| 467 | 496 | readMore: (0, _i18n.__)('Learn more', 'elementor'), |
| 497 | + warning: (0, _i18n.__)('Editor V4 is still in alpha and should not be used on live sites yet.', 'elementor'), | |
| 468 | 498 | feedback: (0, _i18n.__)('We’d love your feedback!', 'elementor'), |
| 469 | 499 | overToGithub: (0, _i18n.__)('Head over to Github', 'elementor'), |
| 470 | 500 | tellUsWhy: (0, _i18n.__)('Tell us why', 'elementor'), |
| 471 | 501 | image: (0, _i18n.__)('Editor V4', 'elementor'), |
| @@ -471,14 +501,14 @@ | ||
| 471 | 501 | image: (0, _i18n.__)('Editor V4', 'elementor'), |
| 472 | 502 | buttons: { |
| 473 | 503 | tryOut: (0, _i18n.__)('Try out the new experience', 'elementor'), |
| 474 | 504 | optIn: (0, _i18n.__)('Activate the new experience', 'elementor'), |
| 475 | - optOut: (0, _i18n.__)('Deactivate', 'elementor') | |
| 505 | + optOut: (0, _i18n.__)('Deactivate V4', 'elementor') | |
| 476 | 506 | }, |
| 477 | 507 | messages: { |
| 478 | 508 | optInSuccess: (0, _i18n.__)('Welcome! You’ve got the newest version of the editor.', 'elementor'), |
| 479 | 509 | optOut: (0, _i18n.__)('You’ve deactivated the new Editor. Have feedback?', 'elementor'), |
| 480 | - error: (0, _i18n.__)('Ouch, there was a glitch. Try activating again soon.', 'elementor') | |
| 510 | + error: (0, _i18n.__)('Ouch, there was a glitch. Try activating V4 again soon.', 'elementor') | |
| 481 | 511 | } |
| 482 | 512 | }; |
| 483 | 513 | var optInLinks = { |
| 484 | 514 | feedbackUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-feedback/', |
| @@ -579,28 +609,38 @@ | ||
| 579 | 609 | }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { |
| 580 | 610 | sx: { |
| 581 | 611 | flex: 1, |
| 582 | 612 | maxWidth: { |
| 583 | - md: '580px', | |
| 613 | + md: '507px', | |
| 584 | 614 | sm: '600px' |
| 585 | 615 | }, |
| 586 | 616 | gap: 2.5, |
| 587 | 617 | mx: 'auto' |
| 588 | 618 | } |
| 619 | + }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 620 | + direction: "row", | |
| 621 | + alignItems: "center", | |
| 622 | + gap: 1 | |
| 589 | 623 | }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { |
| 590 | 624 | variant: "h4", |
| 591 | 625 | width: "fit-content" |
| 592 | - }, /*#__PURE__*/_react.default.createElement("span", null, i18n.title)), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 626 | + }, i18n.title), /*#__PURE__*/_react.default.createElement(_ui.Chip, { | |
| 627 | + size: "small", | |
| 628 | + color: "secondary", | |
| 629 | + variant: "filled", | |
| 630 | + label: i18n.chip | |
| 631 | + })), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 593 | 632 | direction: "column", |
| 594 | - gap: 1 | |
| 595 | - }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.welcomeText)), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesList, { | |
| 633 | + gap: 3 | |
| 634 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.welcomeText)), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, { | |
| 635 | + variant: "subtitle1", | |
| 596 | 636 | sx: { |
| 597 | - gap: 0.5 | |
| 637 | + mb: 1.5 | |
| 598 | 638 | } |
| 599 | - }, i18n.advantages.map(function (entry, i) { | |
| 639 | + }, i18n.advantagesHeader), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesList, null, i18n.advantages.map(function (entry, i) { | |
| 600 | 640 | return /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, { |
| 601 | 641 | key: i |
| 602 | - }, /*#__PURE__*/_react.default.createElement("b", null, entry[0]), " - ", entry[1]); | |
| 642 | + }, entry); | |
| 603 | 643 | }), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, { |
| 604 | 644 | key: i18n.advantages.length |
| 605 | 645 | }, i18n.andMore, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, { |
| 606 | 646 | color: "text.primary", |
| @@ -606,8 +646,17 @@ | ||
| 606 | 646 | color: "text.primary", |
| 607 | 647 | href: optInLinks.readMoreUrl, |
| 608 | 648 | target: "_blank" |
| 609 | 649 | }, i18n.readMore))))), /*#__PURE__*/_react.default.createElement(_ui.Stack, { |
| 650 | + direction: "row", | |
| 651 | + alignItems: "self-start", | |
| 652 | + gap: 0.5, | |
| 653 | + sx: { | |
| 654 | + mb: 2.5 | |
| 655 | + } | |
| 656 | + }, /*#__PURE__*/_react.default.createElement(_icons.AlertTriangleIcon, { | |
| 657 | + color: "action" | |
| 658 | + }), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.warning))), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 610 | 659 | direction: "column", |
| 611 | 660 | width: "clamp(240px, max(340px, 75%), 340px)", |
| 612 | 661 | maxWidth: "100%", |
| 613 | 662 | gap: 2 |
| @@ -694,18 +743,9 @@ | ||
| 694 | 743 | isEnrolled: isEnrolled |
| 695 | 744 | }), optInMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, { |
| 696 | 745 | onClose: function onClose() { |
| 697 | 746 | return setOptInMessage(''); |
| 698 | - }, | |
| 699 | - action: /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 700 | - href: optInLinks.tryOutUrl, | |
| 701 | - color: "#FFFFFF", | |
| 702 | - sx: { | |
| 703 | - cursor: 'pointer', | |
| 704 | - textDecoration: 'none', | |
| 705 | - pl: 3 | |
| 706 | - } | |
| 707 | - }, i18n.buttons.tryOut) | |
| 747 | + } | |
| 708 | 748 | }, optInMessage), optOutMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, { |
| 709 | 749 | onClose: function onClose() { |
| 710 | 750 | return setOptOutMessage(''); |
| 711 | 751 | }, |
| @@ -711,9 +751,9 @@ | ||
| 711 | 751 | }, |
| 712 | 752 | action: /*#__PURE__*/_react.default.createElement(_ui.Link, { |
| 713 | 753 | href: optInLinks.feedbackUrl, |
| 714 | 754 | target: "_blank", |
| 715 | - color: "#FFFFFF", | |
| 755 | + color: "inherit", | |
| 716 | 756 | sx: { |
| 717 | 757 | cursor: 'pointer', |
| 718 | 758 | textDecoration: 'none', |
| 719 | 759 | pl: 3 |
| @@ -1141,19 +1181,21 @@ | ||
| 1141 | 1181 | } catch (e) { |
| 1142 | 1182 | i = 0; |
| 1143 | 1183 | } |
| 1144 | 1184 | module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { |
| 1145 | - function o(r, n) { | |
| 1146 | - _regeneratorDefine(e, r, function (e) { | |
| 1147 | - return this._invoke(r, n, e); | |
| 1148 | - }); | |
| 1149 | - } | |
| 1150 | - r ? i ? i(e, r, { | |
| 1185 | + if (r) i ? i(e, r, { | |
| 1151 | 1186 | value: n, |
| 1152 | 1187 | enumerable: !t, |
| 1153 | 1188 | configurable: !t, |
| 1154 | 1189 | writable: !t |
| 1155 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 1190 | + }) : e[r] = n;else { | |
| 1191 | + var o = function o(r, n) { | |
| 1192 | + _regeneratorDefine(e, r, function (e) { | |
| 1193 | + return this._invoke(r, n, e); | |
| 1194 | + }); | |
| 1195 | + }; | |
| 1196 | + o("next", 0), o("throw", 1), o("return", 2); | |
| 1197 | + } | |
| 1156 | 1198 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); |
| 1157 | 1199 | } |
| 1158 | 1200 | module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 1159 | 1201 | |
| @@ -1414,9 +1456,9 @@ | ||
| 1414 | 1456 | \****************************************************/ |
| 1415 | 1457 | /***/ ((module) => { |
| 1416 | 1458 | |
| 1417 | 1459 | "use strict"; |
| 1418 | -/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */ | |
| 1460 | +/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */ | |
| 1419 | 1461 | |
| 1420 | 1462 | |
| 1421 | 1463 | |
| 1422 | 1464 | const { |
| @@ -1445,20 +1487,14 @@ | ||
| 1445 | 1487 | return x; |
| 1446 | 1488 | }; |
| 1447 | 1489 | } |
| 1448 | 1490 | if (!apply) { |
| 1449 | - apply = function apply(func, thisArg) { | |
| 1450 | - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | |
| 1451 | - args[_key - 2] = arguments[_key]; | |
| 1452 | - } | |
| 1453 | - return func.apply(thisArg, args); | |
| 1491 | + apply = function apply(fun, thisValue, args) { | |
| 1492 | + return fun.apply(thisValue, args); | |
| 1454 | 1493 | }; |
| 1455 | 1494 | } |
| 1456 | 1495 | if (!construct) { |
| 1457 | - construct = function construct(Func) { | |
| 1458 | - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | |
| 1459 | - args[_key2 - 1] = arguments[_key2]; | |
| 1460 | - } | |
| 1496 | + construct = function construct(Func, args) { | |
| 1461 | 1497 | return new Func(...args); |
| 1462 | 1498 | }; |
| 1463 | 1499 | } |
| 1464 | 1500 | const arrayForEach = unapply(Array.prototype.forEach); |
| @@ -1485,10 +1521,10 @@ | ||
| 1485 | 1521 | return function (thisArg) { |
| 1486 | 1522 | if (thisArg instanceof RegExp) { |
| 1487 | 1523 | thisArg.lastIndex = 0; |
| 1488 | 1524 | } |
| 1489 | - for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | |
| 1490 | - args[_key3 - 1] = arguments[_key3]; | |
| 1525 | + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
| 1526 | + args[_key - 1] = arguments[_key]; | |
| 1491 | 1527 | } |
| 1492 | 1528 | return apply(func, thisArg, args); |
| 1493 | 1529 | }; |
| 1494 | 1530 | } |
| @@ -1497,14 +1533,14 @@ | ||
| 1497 | 1533 | * |
| 1498 | 1534 | * @param func - The constructor function to be wrapped and called. |
| 1499 | 1535 | * @returns A new function that constructs an instance of the given constructor function with the provided arguments. |
| 1500 | 1536 | */ |
| 1501 | -function unconstruct(Func) { | |
| 1537 | +function unconstruct(func) { | |
| 1502 | 1538 | return function () { |
| 1503 | - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | |
| 1504 | - args[_key4] = arguments[_key4]; | |
| 1539 | + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 1540 | + args[_key2] = arguments[_key2]; | |
| 1505 | 1541 | } |
| 1506 | - return construct(Func, args); | |
| 1542 | + return construct(func, args); | |
| 1507 | 1543 | }; |
| 1508 | 1544 | } |
| 1509 | 1545 | /** |
| 1510 | 1546 | * Add properties to a lookup table |
| @@ -1601,10 +1637,10 @@ | ||
| 1601 | 1637 | } |
| 1602 | 1638 | return fallbackValue; |
| 1603 | 1639 | } |
| 1604 | 1640 | |
| 1605 | -const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); | |
| 1606 | -const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); | |
| 1641 | +const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); | |
| 1642 | +const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); | |
| 1607 | 1643 | const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); |
| 1608 | 1644 | // List of SVG elements that are disallowed by default. |
| 1609 | 1645 | // We still need to know them so that we can do namespace |
| 1610 | 1646 | // checks properly in case one wants to add them to |
| @@ -1615,10 +1651,10 @@ | ||
| 1615 | 1651 | // even those that we disallow by default. |
| 1616 | 1652 | const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); |
| 1617 | 1653 | const text = freeze(['#text']); |
| 1618 | 1654 | |
| 1619 | -const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); | |
| 1620 | -const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); | |
| 1655 | +const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); | |
| 1656 | +const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); | |
| 1621 | 1657 | const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); |
| 1622 | 1658 | const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); |
| 1623 | 1659 | |
| 1624 | 1660 | // eslint-disable-next-line unicorn/better-regex |
| @@ -1723,9 +1759,9 @@ | ||
| 1723 | 1759 | }; |
| 1724 | 1760 | function createDOMPurify() { |
| 1725 | 1761 | let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); |
| 1726 | 1762 | const DOMPurify = root => createDOMPurify(root); |
| 1727 | - DOMPurify.version = '3.3.0'; | |
| 1763 | + DOMPurify.version = '3.2.6'; | |
| 1728 | 1764 | DOMPurify.removed = []; |
| 1729 | 1765 | if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) { |
| 1730 | 1766 | // Not running in a browser, provide a factory function |
| 1731 | 1767 | // so that you can pass your own Window |
| @@ -1834,23 +1870,8 @@ | ||
| 1834 | 1870 | /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ |
| 1835 | 1871 | let FORBID_TAGS = null; |
| 1836 | 1872 | /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ |
| 1837 | 1873 | let FORBID_ATTR = null; |
| 1838 | - /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */ | |
| 1839 | - const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, { | |
| 1840 | - tagCheck: { | |
| 1841 | - writable: true, | |
| 1842 | - configurable: false, | |
| 1843 | - enumerable: true, | |
| 1844 | - value: null | |
| 1845 | - }, | |
| 1846 | - attributeCheck: { | |
| 1847 | - writable: true, | |
| 1848 | - configurable: false, | |
| 1849 | - enumerable: true, | |
| 1850 | - value: null | |
| 1851 | - } | |
| 1852 | - })); | |
| 1853 | 1874 | /* Decide if ARIA attributes are okay */ |
| 1854 | 1875 | let ALLOW_ARIA_ATTR = true; |
| 1855 | 1876 | /* Decide if custom data attributes are okay */ |
| 1856 | 1877 | let ALLOW_DATA_ATTR = true; |
| @@ -2041,26 +2062,18 @@ | ||
| 2041 | 2062 | } |
| 2042 | 2063 | } |
| 2043 | 2064 | /* Merge configuration parameters */ |
| 2044 | 2065 | if (cfg.ADD_TAGS) { |
| 2045 | - if (typeof cfg.ADD_TAGS === 'function') { | |
| 2046 | - EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; | |
| 2047 | - } else { | |
| 2048 | - if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { | |
| 2049 | - ALLOWED_TAGS = clone(ALLOWED_TAGS); | |
| 2050 | - } | |
| 2051 | - addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); | |
| 2066 | + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { | |
| 2067 | + ALLOWED_TAGS = clone(ALLOWED_TAGS); | |
| 2052 | 2068 | } |
| 2069 | + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); | |
| 2053 | 2070 | } |
| 2054 | 2071 | if (cfg.ADD_ATTR) { |
| 2055 | - if (typeof cfg.ADD_ATTR === 'function') { | |
| 2056 | - EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; | |
| 2057 | - } else { | |
| 2058 | - if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { | |
| 2059 | - ALLOWED_ATTR = clone(ALLOWED_ATTR); | |
| 2060 | - } | |
| 2061 | - addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); | |
| 2072 | + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { | |
| 2073 | + ALLOWED_ATTR = clone(ALLOWED_ATTR); | |
| 2062 | 2074 | } |
| 2075 | + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); | |
| 2063 | 2076 | } |
| 2064 | 2077 | if (cfg.ADD_URI_SAFE_ATTR) { |
| 2065 | 2078 | addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); |
| 2066 | 2079 | } |
| @@ -2366,9 +2379,9 @@ | ||
| 2366 | 2379 | _forceRemove(currentNode); |
| 2367 | 2380 | return true; |
| 2368 | 2381 | } |
| 2369 | 2382 | /* Remove element if anything forbids its presence */ |
| 2370 | - if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) { | |
| 2383 | + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { | |
| 2371 | 2384 | /* Check if we have a custom element to handle */ |
| 2372 | 2385 | if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { |
| 2373 | 2386 | if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { |
| 2374 | 2387 | return false; |
| @@ -2438,14 +2451,14 @@ | ||
| 2438 | 2451 | /* Allow valid data-* attributes: At least one character after "-" |
| 2439 | 2452 | (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) |
| 2440 | 2453 | XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) |
| 2441 | 2454 | We don't need to check the value; it's always URI safe. */ |
| 2442 | - if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { | |
| 2455 | + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { | |
| 2443 | 2456 | if ( |
| 2444 | 2457 | // First condition does a very basic check if a) it's basically a valid custom element tagname AND |
| 2445 | 2458 | // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck |
| 2446 | 2459 | // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck |
| 2447 | - _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || | |
| 2460 | + _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || | |
| 2448 | 2461 | // Alternative, second condition checks if it's an `is`-attribute, AND |
| 2449 | 2462 | // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck |
| 2450 | 2463 | lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else { |
| 2451 | 2464 | return false; |
| @@ -2522,14 +2535,9 @@ | ||
| 2522 | 2535 | // Prefix the value and later re-create the attribute with the sanitized value |
| 2523 | 2536 | value = SANITIZE_NAMED_PROPS_PREFIX + value; |
| 2524 | 2537 | } |
| 2525 | 2538 | /* Work around a security issue with comments inside attributes */ |
| 2526 | - if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) { | |
| 2527 | - _removeAttribute(name, currentNode); | |
| 2528 | - continue; | |
| 2529 | - } | |
| 2530 | - /* Make sure we cannot easily use animated hrefs, even if animations are allowed */ | |
| 2531 | - if (lcName === 'attributename' && stringMatch(value, 'href')) { | |
| 2539 | + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) { | |
| 2532 | 2540 | _removeAttribute(name, currentNode); |
| 2533 | 2541 | continue; |
| 2534 | 2542 | } |
| 2535 | 2543 | /* Did the hooks approve of the attribute? */ |