PluginProbe
Gutenberg / 14.5.2
Gutenberg v14.5.2
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | build/element/index.js +507 -84 12.6.0 → 14.5.2 View file →
@@ -1,5 +1,5 @@
1 -/******/ (function() { // webpackBootstrap
1 +/******/ (() => { // webpackBootstrap
2 2 /******/ "use strict";
3 3 /******/ // The require scope
4 4 /******/ var __webpack_require__ = {};
5 5 /******/
@@ -4,11 +4,11 @@
4 4 /******/ var __webpack_require__ = {};
5 5 /******/
6 6 /************************************************************************/
7 7 /******/ /* webpack/runtime/define property getters */
8 -/******/ !function() {
8 +/******/ (() => {
9 9 /******/ // define getter functions for harmony exports
10 -/******/ __webpack_require__.d = function(exports, definition) {
10 +/******/ __webpack_require__.d = (exports, definition) => {
11 11 /******/ for(var key in definition) {
12 12 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13 13 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14 14 /******/ }
@@ -13,25 +13,25 @@
13 13 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14 14 /******/ }
15 15 /******/ }
16 16 /******/ };
17 -/******/ }();
17 +/******/ })();
18 18 /******/
19 19 /******/ /* webpack/runtime/hasOwnProperty shorthand */
20 -/******/ !function() {
21 -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
22 -/******/ }();
20 +/******/ (() => {
21 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22 +/******/ })();
23 23 /******/
24 24 /******/ /* webpack/runtime/make namespace object */
25 -/******/ !function() {
25 +/******/ (() => {
26 26 /******/ // define __esModule on exports
27 -/******/ __webpack_require__.r = function(exports) {
27 +/******/ __webpack_require__.r = (exports) => {
28 28 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29 29 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30 30 /******/ }
31 31 /******/ Object.defineProperty(exports, '__esModule', { value: true });
32 32 /******/ };
33 -/******/ }();
33 +/******/ })();
34 34 /******/
35 35 /************************************************************************/
36 36 var __webpack_exports__ = {};
37 37 // ESM COMPAT FLAG
@@ -38,46 +38,47 @@
38 38 __webpack_require__.r(__webpack_exports__);
39 39
40 40 // EXPORTS
41 41 __webpack_require__.d(__webpack_exports__, {
42 - "Children": function() { return /* reexport */ external_React_namespaceObject.Children; },
43 - "Component": function() { return /* reexport */ external_React_namespaceObject.Component; },
44 - "Fragment": function() { return /* reexport */ external_React_namespaceObject.Fragment; },
45 - "Platform": function() { return /* reexport */ platform; },
46 - "RawHTML": function() { return /* reexport */ RawHTML; },
47 - "StrictMode": function() { return /* reexport */ external_React_namespaceObject.StrictMode; },
48 - "Suspense": function() { return /* reexport */ external_React_namespaceObject.Suspense; },
49 - "cloneElement": function() { return /* reexport */ external_React_namespaceObject.cloneElement; },
50 - "concatChildren": function() { return /* reexport */ concatChildren; },
51 - "createContext": function() { return /* reexport */ external_React_namespaceObject.createContext; },
52 - "createElement": function() { return /* reexport */ external_React_namespaceObject.createElement; },
53 - "createInterpolateElement": function() { return /* reexport */ create_interpolate_element; },
54 - "createPortal": function() { return /* reexport */ external_ReactDOM_namespaceObject.createPortal; },
55 - "createRef": function() { return /* reexport */ external_React_namespaceObject.createRef; },
56 - "findDOMNode": function() { return /* reexport */ external_ReactDOM_namespaceObject.findDOMNode; },
57 - "forwardRef": function() { return /* reexport */ external_React_namespaceObject.forwardRef; },
58 - "isEmptyElement": function() { return /* reexport */ isEmptyElement; },
59 - "isValidElement": function() { return /* reexport */ external_React_namespaceObject.isValidElement; },
60 - "lazy": function() { return /* reexport */ external_React_namespaceObject.lazy; },
61 - "memo": function() { return /* reexport */ external_React_namespaceObject.memo; },
62 - "render": function() { return /* reexport */ external_ReactDOM_namespaceObject.render; },
63 - "renderToString": function() { return /* reexport */ serialize; },
64 - "switchChildrenNodeName": function() { return /* reexport */ switchChildrenNodeName; },
65 - "unmountComponentAtNode": function() { return /* reexport */ external_ReactDOM_namespaceObject.unmountComponentAtNode; },
66 - "useCallback": function() { return /* reexport */ external_React_namespaceObject.useCallback; },
67 - "useContext": function() { return /* reexport */ external_React_namespaceObject.useContext; },
68 - "useDebugValue": function() { return /* reexport */ external_React_namespaceObject.useDebugValue; },
69 - "useEffect": function() { return /* reexport */ external_React_namespaceObject.useEffect; },
70 - "useImperativeHandle": function() { return /* reexport */ external_React_namespaceObject.useImperativeHandle; },
71 - "useLayoutEffect": function() { return /* reexport */ external_React_namespaceObject.useLayoutEffect; },
72 - "useMemo": function() { return /* reexport */ external_React_namespaceObject.useMemo; },
73 - "useReducer": function() { return /* reexport */ external_React_namespaceObject.useReducer; },
74 - "useRef": function() { return /* reexport */ external_React_namespaceObject.useRef; },
75 - "useState": function() { return /* reexport */ external_React_namespaceObject.useState; }
42 + "Children": () => (/* reexport */ external_React_namespaceObject.Children),
43 + "Component": () => (/* reexport */ external_React_namespaceObject.Component),
44 + "Fragment": () => (/* reexport */ external_React_namespaceObject.Fragment),
45 + "Platform": () => (/* reexport */ platform),
46 + "RawHTML": () => (/* reexport */ RawHTML),
47 + "StrictMode": () => (/* reexport */ external_React_namespaceObject.StrictMode),
48 + "Suspense": () => (/* reexport */ external_React_namespaceObject.Suspense),
49 + "cloneElement": () => (/* reexport */ external_React_namespaceObject.cloneElement),
50 + "concatChildren": () => (/* reexport */ concatChildren),
51 + "createContext": () => (/* reexport */ external_React_namespaceObject.createContext),
52 + "createElement": () => (/* reexport */ external_React_namespaceObject.createElement),
53 + "createInterpolateElement": () => (/* reexport */ create_interpolate_element),
54 + "createPortal": () => (/* reexport */ external_ReactDOM_namespaceObject.createPortal),
55 + "createRef": () => (/* reexport */ external_React_namespaceObject.createRef),
56 + "findDOMNode": () => (/* reexport */ external_ReactDOM_namespaceObject.findDOMNode),
57 + "forwardRef": () => (/* reexport */ external_React_namespaceObject.forwardRef),
58 + "hydrate": () => (/* reexport */ external_ReactDOM_namespaceObject.hydrate),
59 + "isEmptyElement": () => (/* reexport */ isEmptyElement),
60 + "isValidElement": () => (/* reexport */ external_React_namespaceObject.isValidElement),
61 + "lazy": () => (/* reexport */ external_React_namespaceObject.lazy),
62 + "memo": () => (/* reexport */ external_React_namespaceObject.memo),
63 + "render": () => (/* reexport */ external_ReactDOM_namespaceObject.render),
64 + "renderToString": () => (/* reexport */ serialize),
65 + "switchChildrenNodeName": () => (/* reexport */ switchChildrenNodeName),
66 + "unmountComponentAtNode": () => (/* reexport */ external_ReactDOM_namespaceObject.unmountComponentAtNode),
67 + "useCallback": () => (/* reexport */ external_React_namespaceObject.useCallback),
68 + "useContext": () => (/* reexport */ external_React_namespaceObject.useContext),
69 + "useDebugValue": () => (/* reexport */ external_React_namespaceObject.useDebugValue),
70 + "useEffect": () => (/* reexport */ external_React_namespaceObject.useEffect),
71 + "useImperativeHandle": () => (/* reexport */ external_React_namespaceObject.useImperativeHandle),
72 + "useLayoutEffect": () => (/* reexport */ external_React_namespaceObject.useLayoutEffect),
73 + "useMemo": () => (/* reexport */ external_React_namespaceObject.useMemo),
74 + "useReducer": () => (/* reexport */ external_React_namespaceObject.useReducer),
75 + "useRef": () => (/* reexport */ external_React_namespaceObject.useRef),
76 + "useState": () => (/* reexport */ external_React_namespaceObject.useState)
76 77 });
77 78
78 79 ;// CONCATENATED MODULE: external "React"
79 -var external_React_namespaceObject = window["React"];
80 +const external_React_namespaceObject = window["React"];
80 81 ;// CONCATENATED MODULE: ./packages/element/build-module/create-interpolate-element.js
81 82 /**
82 83 * Internal dependencies
83 84 */
@@ -93,9 +94,9 @@
93 94 *
94 95 * There are four references extracted using this tokenizer:
95 96 *
96 97 * match: Full match of the tag (i.e. <strong>, </strong>, <br/>)
97 - * isClosing: The closing slash, it it exists.
98 + * isClosing: The closing slash, if it exists.
98 99 * name: The name portion of the tag (strong, br) (if )
99 100 * isSelfClosed: The slash on a self closing tag, if it exists.
100 101 *
101 102 * @type {RegExp}
@@ -259,9 +260,9 @@
259 260
260 261 output.push(conversionMap[name]);
261 262 offset = startOffset + tokenLength;
262 263 return true;
263 - } // otherwise we found an inner element
264 + } // Otherwise we found an inner element.
264 265
265 266
266 267 addChild(createFrame(conversionMap[name], startOffset, tokenLength));
267 268 offset = startOffset + tokenLength;
@@ -272,15 +273,15 @@
272 273 offset = startOffset + tokenLength;
273 274 return true;
274 275
275 276 case 'closer':
276 - // if we're not nesting then this is easy - close the block
277 + // If we're not nesting then this is easy - close the block.
277 278 if (1 === stackDepth) {
278 279 closeOuterElement(startOffset);
279 280 offset = startOffset + tokenLength;
280 281 return true;
281 - } // otherwise we're nested and we have to close out the current
282 - // block and add it as a innerBlock to the parent
282 + } // Otherwise we're nested and we have to close out the current
283 + // block and add it as a innerBlock to the parent.
283 284
284 285
285 286 const stackTop = stack.pop();
286 287 const text = indoc.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset);
@@ -306,9 +307,9 @@
306 307 */
307 308
308 309
309 310 function nextToken() {
310 - const matches = tokenizer.exec(indoc); // we have no more tokens
311 + const matches = tokenizer.exec(indoc); // We have no more tokens.
311 312
312 313 if (null === matches) {
313 314 return ['no-more-tokens'];
314 315 }
@@ -408,12 +409,10 @@
408 409
409 410 output.push((0,external_React_namespaceObject.cloneElement)(element, null, ...children));
410 411 }
411 412
412 -/* harmony default export */ var create_interpolate_element = (createInterpolateElement);
413 -//# sourceMappingURL=create-interpolate-element.js.map
414 -;// CONCATENATED MODULE: external "lodash"
415 -var external_lodash_namespaceObject = window["lodash"];
413 +/* harmony default export */ const create_interpolate_element = (createInterpolateElement);
414 +
416 415 ;// CONCATENATED MODULE: ./packages/element/build-module/react.js
417 416 /**
418 417 * External dependencies
419 418 */
@@ -418,9 +417,8 @@
418 417 * External dependencies
419 418 */
420 419 // eslint-disable-next-line @typescript-eslint/no-restricted-imports
421 420
422 -
423 421 /**
424 422 * Object containing a React element.
425 423 *
426 424 * @typedef {import('react').ReactElement} WPElement
@@ -623,9 +621,9 @@
623 621 */
624 622
625 623 function switchChildrenNodeName(children, nodeName) {
626 624 return children && external_React_namespaceObject.Children.map(children, (elt, index) => {
627 - if ((0,external_lodash_namespaceObject.isString)(elt)) {
625 + if (typeof (elt === null || elt === void 0 ? void 0 : elt.valueOf()) === 'string') {
628 626 return (0,external_React_namespaceObject.createElement)(nodeName, {
629 627 key: index
630 628 }, elt);
631 629 }
@@ -639,11 +637,11 @@
639 637 ...props
640 638 }, childrenProp);
641 639 });
642 640 }
643 -//# sourceMappingURL=react.js.map
641 +
644 642 ;// CONCATENATED MODULE: external "ReactDOM"
645 -var external_ReactDOM_namespaceObject = window["ReactDOM"];
643 +const external_ReactDOM_namespaceObject = window["ReactDOM"];
646 644 ;// CONCATENATED MODULE: ./packages/element/build-module/react-platform.js
647 645 /**
648 646 * External dependencies
649 647 */
@@ -674,8 +672,16 @@
674 672 */
675 673
676 674
677 675 /**
676 + * Hydrates a given element into the target DOM node.
677 + *
678 + * @param {import('./react').WPElement} element Element to hydrate.
679 + * @param {HTMLElement} target DOM node into which element should be hydrated.
680 + */
681 +
682 +
683 +/**
678 684 * Removes any mounted element from the target DOM node.
679 685 *
680 686 * @param {Element} target DOM node in which element is to be removed
681 687 */
@@ -680,33 +686,28 @@
680 686 * @param {Element} target DOM node in which element is to be removed
681 687 */
682 688
683 689
684 -//# sourceMappingURL=react-platform.js.map
690 +
685 691 ;// CONCATENATED MODULE: ./packages/element/build-module/utils.js
686 692 /**
687 - * External dependencies
688 - */
689 -
690 -/**
691 693 * Checks if the provided WP element is empty.
692 694 *
693 695 * @param {*} element WP element to check.
694 696 * @return {boolean} True when an element is considered empty.
695 697 */
696 -
697 698 const isEmptyElement = element => {
698 - if ((0,external_lodash_namespaceObject.isNumber)(element)) {
699 + if (typeof element === 'number') {
699 700 return false;
700 701 }
701 702
702 - if ((0,external_lodash_namespaceObject.isString)(element) || (0,external_lodash_namespaceObject.isArray)(element)) {
703 + if (typeof (element === null || element === void 0 ? void 0 : element.valueOf()) === 'string' || Array.isArray(element)) {
703 704 return !element.length;
704 705 }
705 706
706 707 return !element;
707 708 };
708 -//# sourceMappingURL=utils.js.map
709 +
709 710 ;// CONCATENATED MODULE: ./packages/element/build-module/platform.js
710 711 /**
711 712 * Parts of this source were derived and modified from react-native-web,
712 713 * released under the MIT license.
@@ -739,12 +740,386 @@
739 740 * } );
740 741 * ```
741 742 */
742 743
743 -/* harmony default export */ var platform = (Platform);
744 -//# sourceMappingURL=platform.js.map
744 +/* harmony default export */ const platform = (Platform);
745 +
746 +;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs
747 +/*!
748 + * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
749 + *
750 + * Copyright (c) 2014-2017, Jon Schlinkert.
751 + * Released under the MIT License.
752 + */
753 +
754 +function isObject(o) {
755 + return Object.prototype.toString.call(o) === '[object Object]';
756 +}
757 +
758 +function isPlainObject(o) {
759 + var ctor,prot;
760 +
761 + if (isObject(o) === false) return false;
762 +
763 + // If has modified constructor
764 + ctor = o.constructor;
765 + if (ctor === undefined) return true;
766 +
767 + // If has modified prototype
768 + prot = ctor.prototype;
769 + if (isObject(prot) === false) return false;
770 +
771 + // If constructor does not have an Object-specific method
772 + if (prot.hasOwnProperty('isPrototypeOf') === false) {
773 + return false;
774 + }
775 +
776 + // Most likely a plain Object
777 + return true;
778 +}
779 +
780 +
781 +
782 +;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js
783 +/*! *****************************************************************************
784 +Copyright (c) Microsoft Corporation.
785 +
786 +Permission to use, copy, modify, and/or distribute this software for any
787 +purpose with or without fee is hereby granted.
788 +
789 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
790 +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
791 +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
792 +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
793 +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
794 +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
795 +PERFORMANCE OF THIS SOFTWARE.
796 +***************************************************************************** */
797 +/* global Reflect, Promise */
798 +
799 +var extendStatics = function(d, b) {
800 + extendStatics = Object.setPrototypeOf ||
801 + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
802 + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
803 + return extendStatics(d, b);
804 +};
805 +
806 +function __extends(d, b) {
807 + if (typeof b !== "function" && b !== null)
808 + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
809 + extendStatics(d, b);
810 + function __() { this.constructor = d; }
811 + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
812 +}
813 +
814 +var __assign = function() {
815 + __assign = Object.assign || function __assign(t) {
816 + for (var s, i = 1, n = arguments.length; i < n; i++) {
817 + s = arguments[i];
818 + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
819 + }
820 + return t;
821 + }
822 + return __assign.apply(this, arguments);
823 +}
824 +
825 +function __rest(s, e) {
826 + var t = {};
827 + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
828 + t[p] = s[p];
829 + if (s != null && typeof Object.getOwnPropertySymbols === "function")
830 + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
831 + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
832 + t[p[i]] = s[p[i]];
833 + }
834 + return t;
835 +}
836 +
837 +function __decorate(decorators, target, key, desc) {
838 + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
839 + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
840 + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
841 + return c > 3 && r && Object.defineProperty(target, key, r), r;
842 +}
843 +
844 +function __param(paramIndex, decorator) {
845 + return function (target, key) { decorator(target, key, paramIndex); }
846 +}
847 +
848 +function __metadata(metadataKey, metadataValue) {
849 + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
850 +}
851 +
852 +function __awaiter(thisArg, _arguments, P, generator) {
853 + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
854 + return new (P || (P = Promise))(function (resolve, reject) {
855 + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
856 + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
857 + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
858 + step((generator = generator.apply(thisArg, _arguments || [])).next());
859 + });
860 +}
861 +
862 +function __generator(thisArg, body) {
863 + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
864 + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
865 + function verb(n) { return function (v) { return step([n, v]); }; }
866 + function step(op) {
867 + if (f) throw new TypeError("Generator is already executing.");
868 + while (_) try {
869 + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
870 + if (y = 0, t) op = [op[0] & 2, t.value];
871 + switch (op[0]) {
872 + case 0: case 1: t = op; break;
873 + case 4: _.label++; return { value: op[1], done: false };
874 + case 5: _.label++; y = op[1]; op = [0]; continue;
875 + case 7: op = _.ops.pop(); _.trys.pop(); continue;
876 + default:
877 + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
878 + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
879 + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
880 + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
881 + if (t[2]) _.ops.pop();
882 + _.trys.pop(); continue;
883 + }
884 + op = body.call(thisArg, _);
885 + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
886 + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
887 + }
888 +}
889 +
890 +var __createBinding = Object.create ? (function(o, m, k, k2) {
891 + if (k2 === undefined) k2 = k;
892 + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
893 +}) : (function(o, m, k, k2) {
894 + if (k2 === undefined) k2 = k;
895 + o[k2] = m[k];
896 +});
897 +
898 +function __exportStar(m, o) {
899 + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
900 +}
901 +
902 +function __values(o) {
903 + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
904 + if (m) return m.call(o);
905 + if (o && typeof o.length === "number") return {
906 + next: function () {
907 + if (o && i >= o.length) o = void 0;
908 + return { value: o && o[i++], done: !o };
909 + }
910 + };
911 + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
912 +}
913 +
914 +function __read(o, n) {
915 + var m = typeof Symbol === "function" && o[Symbol.iterator];
916 + if (!m) return o;
917 + var i = m.call(o), r, ar = [], e;
918 + try {
919 + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
920 + }
921 + catch (error) { e = { error: error }; }
922 + finally {
923 + try {
924 + if (r && !r.done && (m = i["return"])) m.call(i);
925 + }
926 + finally { if (e) throw e.error; }
927 + }
928 + return ar;
929 +}
930 +
931 +/** @deprecated */
932 +function __spread() {
933 + for (var ar = [], i = 0; i < arguments.length; i++)
934 + ar = ar.concat(__read(arguments[i]));
935 + return ar;
936 +}
937 +
938 +/** @deprecated */
939 +function __spreadArrays() {
940 + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
941 + for (var r = Array(s), k = 0, i = 0; i < il; i++)
942 + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
943 + r[k] = a[j];
944 + return r;
945 +}
946 +
947 +function __spreadArray(to, from, pack) {
948 + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
949 + if (ar || !(i in from)) {
950 + if (!ar) ar = Array.prototype.slice.call(from, 0, i);
951 + ar[i] = from[i];
952 + }
953 + }
954 + return to.concat(ar || from);
955 +}
956 +
957 +function __await(v) {
958 + return this instanceof __await ? (this.v = v, this) : new __await(v);
959 +}
960 +
961 +function __asyncGenerator(thisArg, _arguments, generator) {
962 + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
963 + var g = generator.apply(thisArg, _arguments || []), i, q = [];
964 + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
965 + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
966 + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
967 + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
968 + function fulfill(value) { resume("next", value); }
969 + function reject(value) { resume("throw", value); }
970 + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
971 +}
972 +
973 +function __asyncDelegator(o) {
974 + var i, p;
975 + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
976 + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
977 +}
978 +
979 +function __asyncValues(o) {
980 + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
981 + var m = o[Symbol.asyncIterator], i;
982 + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
983 + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
984 + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
985 +}
986 +
987 +function __makeTemplateObject(cooked, raw) {
988 + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
989 + return cooked;
990 +};
991 +
992 +var __setModuleDefault = Object.create ? (function(o, v) {
993 + Object.defineProperty(o, "default", { enumerable: true, value: v });
994 +}) : function(o, v) {
995 + o["default"] = v;
996 +};
997 +
998 +function __importStar(mod) {
999 + if (mod && mod.__esModule) return mod;
1000 + var result = {};
1001 + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1002 + __setModuleDefault(result, mod);
1003 + return result;
1004 +}
1005 +
1006 +function __importDefault(mod) {
1007 + return (mod && mod.__esModule) ? mod : { default: mod };
1008 +}
1009 +
1010 +function __classPrivateFieldGet(receiver, state, kind, f) {
1011 + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1012 + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1013 + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1014 +}
1015 +
1016 +function __classPrivateFieldSet(receiver, state, value, kind, f) {
1017 + if (kind === "m") throw new TypeError("Private method is not writable");
1018 + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1019 + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1020 + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1021 +}
1022 +
1023 +;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
1024 +/**
1025 + * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
1026 + */
1027 +var SUPPORTED_LOCALE = {
1028 + tr: {
1029 + regexp: /\u0130|\u0049|\u0049\u0307/g,
1030 + map: {
1031 + İ: "\u0069",
1032 + I: "\u0131",
1033 + İ: "\u0069",
1034 + },
1035 + },
1036 + az: {
1037 + regexp: /\u0130/g,
1038 + map: {
1039 + İ: "\u0069",
1040 + I: "\u0131",
1041 + İ: "\u0069",
1042 + },
1043 + },
1044 + lt: {
1045 + regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
1046 + map: {
1047 + I: "\u0069\u0307",
1048 + J: "\u006A\u0307",
1049 + Į: "\u012F\u0307",
1050 + Ì: "\u0069\u0307\u0300",
1051 + Í: "\u0069\u0307\u0301",
1052 + Ĩ: "\u0069\u0307\u0303",
1053 + },
1054 + },
1055 +};
1056 +/**
1057 + * Localized lower case.
1058 + */
1059 +function localeLowerCase(str, locale) {
1060 + var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
1061 + if (lang)
1062 + return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
1063 + return lowerCase(str);
1064 +}
1065 +/**
1066 + * Lower case as a function.
1067 + */
1068 +function lowerCase(str) {
1069 + return str.toLowerCase();
1070 +}
1071 +
1072 +;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
1073 +
1074 +// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
1075 +var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
1076 +// Remove all non-word characters.
1077 +var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
1078 +/**
1079 + * Normalize the string into something other libraries can manipulate easier.
1080 + */
1081 +function noCase(input, options) {
1082 + if (options === void 0) { options = {}; }
1083 + var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
1084 + var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
1085 + var start = 0;
1086 + var end = result.length;
1087 + // Trim the delimiter from around the output string.
1088 + while (result.charAt(start) === "\0")
1089 + start++;
1090 + while (result.charAt(end - 1) === "\0")
1091 + end--;
1092 + // Transform each token independently.
1093 + return result.slice(start, end).split("\0").map(transform).join(delimiter);
1094 +}
1095 +/**
1096 + * Replace `re` in the input string with the replacement value.
1097 + */
1098 +function replace(input, re, value) {
1099 + if (re instanceof RegExp)
1100 + return input.replace(re, value);
1101 + return re.reduce(function (input, re) { return input.replace(re, value); }, input);
1102 +}
1103 +
1104 +;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js
1105 +
1106 +
1107 +function dotCase(input, options) {
1108 + if (options === void 0) { options = {}; }
1109 + return noCase(input, __assign({ delimiter: "." }, options));
1110 +}
1111 +
1112 +;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js
1113 +
1114 +
1115 +function paramCase(input, options) {
1116 + if (options === void 0) { options = {}; }
1117 + return dotCase(input, __assign({ delimiter: "-" }, options));
1118 +}
1119 +
745 1120 ;// CONCATENATED MODULE: external ["wp","escapeHtml"]
746 -var external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"];
1121 +const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"];
747 1122 ;// CONCATENATED MODULE: ./packages/element/build-module/raw-html.js
748 1123 /**
749 1124 * Internal dependencies
750 1125 */
@@ -785,9 +1160,9 @@
785 1160 },
786 1161 ...props
787 1162 });
788 1163 }
789 -//# sourceMappingURL=raw-html.js.map
1164 +
790 1165 ;// CONCATENATED MODULE: ./packages/element/build-module/serialize.js
791 1166 /**
792 1167 * Parts of this source were derived and modified from fast-react-render,
793 1168 * released under the MIT license.
@@ -818,8 +1193,9 @@
818 1193 /**
819 1194 * External dependencies
820 1195 */
821 1196
1197 +
822 1198 /**
823 1199 * WordPress dependencies
824 1200 */
825 1201
@@ -955,8 +1331,42 @@
955 1331
956 1332 return value;
957 1333 }
958 1334 /**
1335 + * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).
1336 + * We need this to render e.g strokeWidth as stroke-width.
1337 + *
1338 + * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.
1339 + */
1340 +
1341 +
1342 +const SVG_ATTRIBUTE_WITH_DASHES_LIST = ['accentHeight', 'alignmentBaseline', 'arabicForm', 'baselineShift', 'capHeight', 'clipPath', 'clipRule', 'colorInterpolation', 'colorInterpolationFilters', 'colorProfile', 'colorRendering', 'dominantBaseline', 'enableBackground', 'fillOpacity', 'fillRule', 'floodColor', 'floodOpacity', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'glyphName', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'horizAdvX', 'horizOriginX', 'imageRendering', 'letterSpacing', 'lightingColor', 'markerEnd', 'markerMid', 'markerStart', 'overlinePosition', 'overlineThickness', 'paintOrder', 'panose1', 'pointerEvents', 'renderingIntent', 'shapeRendering', 'stopColor', 'stopOpacity', 'strikethroughPosition', 'strikethroughThickness', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'textAnchor', 'textDecoration', 'textRendering', 'underlinePosition', 'underlineThickness', 'unicodeBidi', 'unicodeRange', 'unitsPerEm', 'vAlphabetic', 'vHanging', 'vIdeographic', 'vMathematical', 'vectorEffect', 'vertAdvY', 'vertOriginX', 'vertOriginY', 'wordSpacing', 'writingMode', 'xmlnsXlink', 'xHeight'].reduce((map, attribute) => {
1343 + // The keys are lower-cased for more robust lookup.
1344 + map[attribute.toLowerCase()] = attribute;
1345 + return map;
1346 +}, {});
1347 +/**
1348 + * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).
1349 + * The keys are lower-cased for more robust lookup.
1350 + * Note that this list only contains attributes that contain at least one capital letter.
1351 + * Lowercase attributes don't need mapping, since we lowercase all attributes by default.
1352 + */
1353 +
1354 +const CASE_SENSITIVE_SVG_ATTRIBUTES = ['allowReorder', 'attributeName', 'attributeType', 'autoReverse', 'baseFrequency', 'baseProfile', 'calcMode', 'clipPathUnits', 'contentScriptType', 'contentStyleType', 'diffuseConstant', 'edgeMode', 'externalResourcesRequired', 'filterRes', 'filterUnits', 'glyphRef', 'gradientTransform', 'gradientUnits', 'kernelMatrix', 'kernelUnitLength', 'keyPoints', 'keySplines', 'keyTimes', 'lengthAdjust', 'limitingConeAngle', 'markerHeight', 'markerUnits', 'markerWidth', 'maskContentUnits', 'maskUnits', 'numOctaves', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits', 'refX', 'refY', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'specularConstant', 'specularExponent', 'spreadMethod', 'startOffset', 'stdDeviation', 'stitchTiles', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'surfaceScale', 'systemLanguage', 'tableValues', 'targetX', 'targetY', 'textLength', 'viewBox', 'viewTarget', 'xChannelSelector', 'yChannelSelector'].reduce((map, attribute) => {
1355 + // The keys are lower-cased for more robust lookup.
1356 + map[attribute.toLowerCase()] = attribute;
1357 + return map;
1358 +}, {});
1359 +/**
1360 + * This is a map of all SVG attributes that have colons.
1361 + * Keys are lower-cased and stripped of their colons for more robust lookup.
1362 + */
1363 +
1364 +const SVG_ATTRIBUTES_WITH_COLONS = ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'xmlns:xlink'].reduce((map, attribute) => {
1365 + map[attribute.replace(':', '').toLowerCase()] = attribute;
1366 + return map;
1367 +}, {});
1368 +/**
959 1369 * Returns the normal form of the element's attribute name for HTML.
960 1370 *
961 1371 * @param {string} attribute Non-normalized attribute name.
962 1372 *
@@ -962,9 +1372,8 @@
962 1372 *
963 1373 * @return {string} Normalized attribute name.
964 1374 */
965 1375
966 -
967 1376 function getNormalAttributeName(attribute) {
968 1377 switch (attribute) {
969 1378 case 'htmlFor':
970 1379 return 'for';
@@ -972,9 +1381,19 @@
972 1381 case 'className':
973 1382 return 'class';
974 1383 }
975 1384
976 - return attribute.toLowerCase();
1385 + const attributeLowerCase = attribute.toLowerCase();
1386 +
1387 + if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) {
1388 + return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase];
1389 + } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) {
1390 + return paramCase(SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]);
1391 + } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) {
1392 + return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase];
1393 + }
1394 +
1395 + return attributeLowerCase;
977 1396 }
978 1397 /**
979 1398 * Returns the normal form of the style property name for HTML.
980 1399 *
@@ -988,17 +1407,17 @@
988 1407 */
989 1408
990 1409
991 1410 function getNormalStylePropertyName(property) {
992 - if ((0,external_lodash_namespaceObject.startsWith)(property, '--')) {
1411 + if (property.startsWith('--')) {
993 1412 return property;
994 1413 }
995 1414
996 1415 if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) {
997 - return '-' + (0,external_lodash_namespaceObject.kebabCase)(property);
1416 + return '-' + paramCase(property);
998 1417 }
999 1418
1000 - return (0,external_lodash_namespaceObject.kebabCase)(property);
1419 + return paramCase(property);
1001 1420 }
1002 1421 /**
1003 1422 * Returns the normal form of the style property value for HTML. Appends a
1004 1423 * default pixel unit if numeric, not a unitless property, and not zero.
@@ -1063,9 +1482,9 @@
1063 1482 const {
1064 1483 children,
1065 1484 ...wrapperProps
1066 1485 } = props;
1067 - return renderNativeComponent((0,external_lodash_namespaceObject.isEmpty)(wrapperProps) ? null : 'div', { ...wrapperProps,
1486 + return renderNativeComponent(!Object.keys(wrapperProps).length ? null : 'div', { ...wrapperProps,
1068 1487 dangerouslySetInnerHTML: {
1069 1488 __html: children
1070 1489 }
1071 1490 }, context, legacyContext);
@@ -1116,9 +1535,13 @@
1116 1535 // Textarea children can be assigned as value prop. If it is, render in
1117 1536 // place of children. Ensure to omit so it is not assigned as attribute
1118 1537 // as well.
1119 1538 content = renderChildren(props.value, context, legacyContext);
1120 - props = (0,external_lodash_namespaceObject.omit)(props, 'value');
1539 + const {
1540 + value,
1541 + ...restProps
1542 + } = props;
1543 + props = restProps;
1121 1544 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') {
1122 1545 // Dangerous content is left unescaped.
1123 1546 content = props.dangerouslySetInnerHTML.__html;
1124 1547 } else if (typeof props.children !== 'undefined') {
@@ -1181,9 +1604,9 @@
1181 1604
1182 1605 function renderChildren(children, context) {
1183 1606 let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1184 1607 let result = '';
1185 - children = (0,external_lodash_namespaceObject.castArray)(children);
1608 + children = Array.isArray(children) ? children : [children];
1186 1609
1187 1610 for (let i = 0; i < children.length; i++) {
1188 1611 const child = children[i];
1189 1612 result += renderElement(child, context, legacyContext);
@@ -1258,9 +1681,9 @@
1258 1681 */
1259 1682
1260 1683 function renderStyle(style) {
1261 1684 // Only generate from object, e.g. tolerate string value.
1262 - if (!(0,external_lodash_namespaceObject.isPlainObject)(style)) {
1685 + if (!isPlainObject(style)) {
1263 1686 return style;
1264 1687 }
1265 1688
1266 1689 let result;
@@ -1284,10 +1707,10 @@
1284 1707 }
1285 1708
1286 1709 return result;
1287 1710 }
1288 -/* harmony default export */ var serialize = (renderElement);
1289 -//# sourceMappingURL=serialize.js.map
1711 +/* harmony default export */ const serialize = (renderElement);
1712 +
1290 1713 ;// CONCATENATED MODULE: ./packages/element/build-module/index.js
1291 1714
1292 1715
1293 1716
@@ -1294,8 +1717,8 @@
1294 1717
1295 1718
1296 1719
1297 1720
1298 -//# sourceMappingURL=index.js.map
1721 +
1299 1722 (window.wp = window.wp || {}).element = __webpack_exports__;
1300 1723 /******/ })()
1301 1724 ;