@wordpress/element 4.0.3 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,12 +2,17 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.1.0 (2022-01-27)
6
+
7
+ ### Bug Fix
8
+
9
+ - Ensure that the package uses the latest version of React types ([#37365](https://github.com/WordPress/gutenberg/pull/37365)).
10
+
5
11
  ## 4.0.3 (2021-10-22)
6
12
 
7
13
  ### Bug Fix
8
14
 
9
- - Update `rawHtml` to correctly concatenate multiple strings passed as children
10
- (see [35532](https://github.com/WordPress/gutenberg/pull/35532))
15
+ - Update `rawHtml` to correctly concatenate multiple strings passed as children (see [35532](https://github.com/WordPress/gutenberg/pull/35532))
11
16
 
12
17
  ## 4.0.0 (2021-07-29)
13
18
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2021 by the contributors
3
+ Copyright 2016-2022 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
package/README.md CHANGED
@@ -49,9 +49,9 @@ Refer to the [official React Quick Start guide](https://reactjs.org/docs/hello-w
49
49
 
50
50
  ## Why React?
51
51
 
52
- At the risk of igniting debate surrounding any single "best" front-end framework, the choice to use any tool should be motivated specifically to serve the requirements of the system. In modeling the concept of a [block](/packages/blocks/README.md), we observe the following technical requirements:
52
+ At the risk of igniting debate surrounding any single "best" front-end framework, the choice to use any tool should be motivated specifically to serve the requirements of the system. In modeling the concept of a [block](https://github.com/WordPress/gutenberg/tree/HEAD/packages/blocks/README.md), we observe the following technical requirements:
53
53
 
54
- - An understanding of a block in terms of its underlying values (in the [random image example](/packages/blocks/README.md#example), a category)
54
+ - An understanding of a block in terms of its underlying values (in the [random image example](https://github.com/WordPress/gutenberg/tree/HEAD/packages/blocks/README.md#example), a category)
55
55
  - A means to describe the UI of a block given these values
56
56
 
57
57
  At its most basic, React provides a simple input / output mechanism. **Given a set of inputs ("props"), a developer describes the output to be shown on the page.** This is most elegantly observed in its [function components](https://reactjs.org/docs/components-and-props.html#functional-and-class-components). React serves the role of reconciling the desired output with the current state of the page.
@@ -416,4 +416,10 @@ _Related_
416
416
 
417
417
  <!-- END TOKEN(Autogenerated API docs) -->
418
418
 
419
- <br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
419
+ ## Contributing to this package
420
+
421
+ This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
422
+
423
+ To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
424
+
425
+ <br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
package/build/index.js CHANGED
@@ -11,28 +11,28 @@ var _exportNames = {
11
11
  renderToString: true,
12
12
  RawHTML: true
13
13
  };
14
- Object.defineProperty(exports, "createInterpolateElement", {
14
+ Object.defineProperty(exports, "Platform", {
15
15
  enumerable: true,
16
16
  get: function () {
17
- return _createInterpolateElement.default;
17
+ return _platform.default;
18
18
  }
19
19
  });
20
- Object.defineProperty(exports, "Platform", {
20
+ Object.defineProperty(exports, "RawHTML", {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _platform.default;
23
+ return _rawHtml.default;
24
24
  }
25
25
  });
26
- Object.defineProperty(exports, "renderToString", {
26
+ Object.defineProperty(exports, "createInterpolateElement", {
27
27
  enumerable: true,
28
28
  get: function () {
29
- return _serialize.default;
29
+ return _createInterpolateElement.default;
30
30
  }
31
31
  });
32
- Object.defineProperty(exports, "RawHTML", {
32
+ Object.defineProperty(exports, "renderToString", {
33
33
  enumerable: true,
34
34
  get: function () {
35
- return _rawHtml.default;
35
+ return _serialize.default;
36
36
  }
37
37
  });
38
38
 
package/build/raw-html.js CHANGED
@@ -26,10 +26,11 @@ var _react = require("./react");
26
26
  *
27
27
  * @return {JSX.Element} Dangerously-rendering component.
28
28
  */
29
- function RawHTML({
30
- children,
31
- ...props
32
- }) {
29
+ function RawHTML(_ref) {
30
+ let {
31
+ children,
32
+ ...props
33
+ } = _ref;
33
34
  let rawHtml = ''; // Cast children as an array, and concatenate each element if it is a string.
34
35
 
35
36
  _react.Children.toArray(children).forEach(child => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["RawHTML","children","props","rawHtml","Children","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAT,CAAkB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAlB,EAA2C;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAC,kBAASC,OAAT,CAAkBJ,QAAlB,EAA6BK,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDL,MAAAA,OAAO,IAAII,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;;AACA,SAAO,0BAAe,KAAf,EAAsB;AAC5BE,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEP;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAtB,CAAP;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["RawHTML","children","props","rawHtml","Children","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAT,OAA2C;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAAyB;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAC,kBAASC,OAAT,CAAkBJ,QAAlB,EAA6BK,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDL,MAAAA,OAAO,IAAII,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;;AACA,SAAO,0BAAe,KAAf,EAAsB;AAC5BE,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEP;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAtB,CAAP;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
@@ -3,55 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.render = void 0;
6
+ exports.registerComponent = void 0;
7
7
 
8
8
  var _reactNative = require("react-native");
9
9
 
10
- var _lodash = require("lodash");
11
-
12
- var _hooks = require("@wordpress/hooks");
13
-
14
- var _react = require("./react");
15
-
16
10
  /**
17
11
  * External dependencies
18
12
  */
19
13
 
20
14
  /**
21
- * WordPress dependencies
22
- */
23
-
24
- /**
25
- * Internal dependencies
26
- */
27
- const render = (element, id) => {
28
- class App extends _react.Component {
29
- constructor() {
30
- super(...arguments);
31
- const parentProps = (0, _lodash.omit)(this.props || {}, ['rootTag']);
32
- (0, _hooks.doAction)('native.pre-render', parentProps);
33
- this.filteredProps = (0, _hooks.applyFilters)('native.block_editor_props', parentProps);
34
- }
35
-
36
- componentDidMount() {
37
- (0, _hooks.doAction)('native.render', this.filteredProps);
38
- }
39
-
40
- render() {
41
- return (0, _react.cloneElement)(element, this.filteredProps);
42
- }
43
-
44
- }
45
-
46
- _reactNative.AppRegistry.registerComponent(id, () => App);
47
- };
48
- /**
49
- * Render a given element on Native.
50
- * This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent`
15
+ * Registers an app root component allowing the native system to run the app.
51
16
  *
52
- * @param {WPElement} element Element to render.
17
+ * @param {string} appKey Unique app name identifier.
18
+ * @param {Function} componentProvider Function returning the app root React component.
53
19
  */
20
+ const registerComponent = (appKey, componentProvider) => {
21
+ _reactNative.AppRegistry.registerComponent(appKey, componentProvider);
22
+ };
54
23
 
55
-
56
- exports.render = render;
24
+ exports.registerComponent = registerComponent;
57
25
  //# sourceMappingURL=react-platform.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/react-platform.native.js"],"names":["render","element","id","App","Component","constructor","arguments","parentProps","props","filteredProps","componentDidMount","AppRegistry","registerComponent"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,MAAM,GAAG,CAAEC,OAAF,EAAWC,EAAX,KAAmB;AACjC,QAAMC,GAAN,SAAkBC,gBAAlB,CAA4B;AAC3BC,IAAAA,WAAW,GAAG;AACb,YAAO,GAAGC,SAAV;AAEA,YAAMC,WAAW,GAAG,kBAAM,KAAKC,KAAL,IAAc,EAApB,EAAwB,CAAE,SAAF,CAAxB,CAApB;AAEA,2BAAU,mBAAV,EAA+BD,WAA/B;AAEA,WAAKE,aAAL,GAAqB,yBACpB,2BADoB,EAEpBF,WAFoB,CAArB;AAIA;;AAEDG,IAAAA,iBAAiB,GAAG;AACnB,2BAAU,eAAV,EAA2B,KAAKD,aAAhC;AACA;;AAEDT,IAAAA,MAAM,GAAG;AACR,aAAO,yBAAcC,OAAd,EAAuB,KAAKQ,aAA5B,CAAP;AACA;;AApB0B;;AAuB5BE,2BAAYC,iBAAZ,CAA+BV,EAA/B,EAAmC,MAAMC,GAAzC;AACA,CAzBD;AA2BA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { AppRegistry } from 'react-native';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { Component, cloneElement } from './react';\n\nconst render = ( element, id ) => {\n\tclass App extends Component {\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tconst parentProps = omit( this.props || {}, [ 'rootTag' ] );\n\n\t\t\tdoAction( 'native.pre-render', parentProps );\n\n\t\t\tthis.filteredProps = applyFilters(\n\t\t\t\t'native.block_editor_props',\n\t\t\t\tparentProps\n\t\t\t);\n\t\t}\n\n\t\tcomponentDidMount() {\n\t\t\tdoAction( 'native.render', this.filteredProps );\n\t\t}\n\n\t\trender() {\n\t\t\treturn cloneElement( element, this.filteredProps );\n\t\t}\n\t}\n\n\tAppRegistry.registerComponent( id, () => App );\n};\n\n/**\n * Render a given element on Native.\n * This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent`\n *\n * @param {WPElement} element Element to render.\n */\nexport { render };\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/react-platform.native.js"],"names":["registerComponent","appKey","componentProvider","AppRegistry"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAG,CAAEC,MAAF,EAAUC,iBAAV,KAAiC;AACjEC,2BAAYH,iBAAZ,CAA+BC,MAA/B,EAAuCC,iBAAvC;AACA,CAFM","sourcesContent":["/**\n * External dependencies\n */\nimport { AppRegistry } from 'react-native';\n\n/**\n * Registers an app root component allowing the native system to run the app.\n *\n * @param {string} appKey Unique app name identifier.\n * @param {Function} componentProvider Function returning the app root React component.\n */\nexport const registerComponent = ( appKey, componentProvider ) => {\n\tAppRegistry.registerComponent( appKey, componentProvider );\n};\n"]}
package/build/react.js CHANGED
@@ -3,114 +3,108 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.concatChildren = concatChildren;
7
- exports.switchChildrenNodeName = switchChildrenNodeName;
8
6
  Object.defineProperty(exports, "Children", {
9
7
  enumerable: true,
10
8
  get: function () {
11
9
  return _react.Children;
12
10
  }
13
11
  });
14
- Object.defineProperty(exports, "cloneElement", {
15
- enumerable: true,
16
- get: function () {
17
- return _react.cloneElement;
18
- }
19
- });
20
12
  Object.defineProperty(exports, "Component", {
21
13
  enumerable: true,
22
14
  get: function () {
23
15
  return _react.Component;
24
16
  }
25
17
  });
26
- Object.defineProperty(exports, "createContext", {
18
+ Object.defineProperty(exports, "Fragment", {
27
19
  enumerable: true,
28
20
  get: function () {
29
- return _react.createContext;
21
+ return _react.Fragment;
30
22
  }
31
23
  });
32
- Object.defineProperty(exports, "createElement", {
24
+ Object.defineProperty(exports, "StrictMode", {
33
25
  enumerable: true,
34
26
  get: function () {
35
- return _react.createElement;
27
+ return _react.StrictMode;
36
28
  }
37
29
  });
38
- Object.defineProperty(exports, "createRef", {
30
+ Object.defineProperty(exports, "Suspense", {
39
31
  enumerable: true,
40
32
  get: function () {
41
- return _react.createRef;
33
+ return _react.Suspense;
42
34
  }
43
35
  });
44
- Object.defineProperty(exports, "forwardRef", {
36
+ Object.defineProperty(exports, "cloneElement", {
45
37
  enumerable: true,
46
38
  get: function () {
47
- return _react.forwardRef;
39
+ return _react.cloneElement;
48
40
  }
49
41
  });
50
- Object.defineProperty(exports, "Fragment", {
42
+ exports.concatChildren = concatChildren;
43
+ Object.defineProperty(exports, "createContext", {
51
44
  enumerable: true,
52
45
  get: function () {
53
- return _react.Fragment;
46
+ return _react.createContext;
54
47
  }
55
48
  });
56
- Object.defineProperty(exports, "isValidElement", {
49
+ Object.defineProperty(exports, "createElement", {
57
50
  enumerable: true,
58
51
  get: function () {
59
- return _react.isValidElement;
52
+ return _react.createElement;
60
53
  }
61
54
  });
62
- Object.defineProperty(exports, "memo", {
55
+ Object.defineProperty(exports, "createRef", {
63
56
  enumerable: true,
64
57
  get: function () {
65
- return _react.memo;
58
+ return _react.createRef;
66
59
  }
67
60
  });
68
- Object.defineProperty(exports, "StrictMode", {
61
+ Object.defineProperty(exports, "forwardRef", {
69
62
  enumerable: true,
70
63
  get: function () {
71
- return _react.StrictMode;
64
+ return _react.forwardRef;
72
65
  }
73
66
  });
74
- Object.defineProperty(exports, "useState", {
67
+ Object.defineProperty(exports, "isValidElement", {
75
68
  enumerable: true,
76
69
  get: function () {
77
- return _react.useState;
70
+ return _react.isValidElement;
78
71
  }
79
72
  });
80
- Object.defineProperty(exports, "useEffect", {
73
+ Object.defineProperty(exports, "lazy", {
81
74
  enumerable: true,
82
75
  get: function () {
83
- return _react.useEffect;
76
+ return _react.lazy;
84
77
  }
85
78
  });
86
- Object.defineProperty(exports, "useContext", {
79
+ Object.defineProperty(exports, "memo", {
87
80
  enumerable: true,
88
81
  get: function () {
89
- return _react.useContext;
82
+ return _react.memo;
90
83
  }
91
84
  });
92
- Object.defineProperty(exports, "useReducer", {
85
+ exports.switchChildrenNodeName = switchChildrenNodeName;
86
+ Object.defineProperty(exports, "useCallback", {
93
87
  enumerable: true,
94
88
  get: function () {
95
- return _react.useReducer;
89
+ return _react.useCallback;
96
90
  }
97
91
  });
98
- Object.defineProperty(exports, "useCallback", {
92
+ Object.defineProperty(exports, "useContext", {
99
93
  enumerable: true,
100
94
  get: function () {
101
- return _react.useCallback;
95
+ return _react.useContext;
102
96
  }
103
97
  });
104
- Object.defineProperty(exports, "useMemo", {
98
+ Object.defineProperty(exports, "useDebugValue", {
105
99
  enumerable: true,
106
100
  get: function () {
107
- return _react.useMemo;
101
+ return _react.useDebugValue;
108
102
  }
109
103
  });
110
- Object.defineProperty(exports, "useRef", {
104
+ Object.defineProperty(exports, "useEffect", {
111
105
  enumerable: true,
112
106
  get: function () {
113
- return _react.useRef;
107
+ return _react.useEffect;
114
108
  }
115
109
  });
116
110
  Object.defineProperty(exports, "useImperativeHandle", {
@@ -125,22 +119,28 @@ Object.defineProperty(exports, "useLayoutEffect", {
125
119
  return _react.useLayoutEffect;
126
120
  }
127
121
  });
128
- Object.defineProperty(exports, "useDebugValue", {
122
+ Object.defineProperty(exports, "useMemo", {
129
123
  enumerable: true,
130
124
  get: function () {
131
- return _react.useDebugValue;
125
+ return _react.useMemo;
132
126
  }
133
127
  });
134
- Object.defineProperty(exports, "lazy", {
128
+ Object.defineProperty(exports, "useReducer", {
135
129
  enumerable: true,
136
130
  get: function () {
137
- return _react.lazy;
131
+ return _react.useReducer;
138
132
  }
139
133
  });
140
- Object.defineProperty(exports, "Suspense", {
134
+ Object.defineProperty(exports, "useRef", {
141
135
  enumerable: true,
142
136
  get: function () {
143
- return _react.Suspense;
137
+ return _react.useRef;
138
+ }
139
+ });
140
+ Object.defineProperty(exports, "useState", {
141
+ enumerable: true,
142
+ get: function () {
143
+ return _react.useState;
144
144
  }
145
145
  });
146
146
 
@@ -151,7 +151,7 @@ var _lodash = require("lodash");
151
151
  /**
152
152
  * External dependencies
153
153
  */
154
- // eslint-disable-next-line no-restricted-imports
154
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
155
155
 
156
156
  /**
157
157
  * Object containing a React element.
@@ -304,7 +304,11 @@ var _lodash = require("lodash");
304
304
  *
305
305
  * @return {Array} The concatenated value.
306
306
  */
307
- function concatChildren(...childrenArguments) {
307
+ function concatChildren() {
308
+ for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
309
+ childrenArguments[_key] = arguments[_key];
310
+ }
311
+
308
312
  return childrenArguments.reduce((accumulator, children, i) => {
309
313
  _react.Children.forEach(children, (child, j) => {
310
314
  if (child && 'string' !== typeof child) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/react.js"],"names":["concatChildren","childrenArguments","reduce","accumulator","children","i","Children","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","childrenProp","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAyBA;;AA7BA;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyB,GAAGC,iBAA5B,EAAgD;AACtD,SAAOA,iBAAiB,CAACC,MAAlB,CAA0B,CAAEC,WAAF,EAAeC,QAAf,EAAyBC,CAAzB,KAAgC;AAChEC,oBAASC,OAAT,CAAkBH,QAAlB,EAA4B,CAAEI,KAAF,EAASC,CAAT,KAAgB;AAC3C,UAAKD,KAAK,IAAI,aAAa,OAAOA,KAAlC,EAA0C;AACzCA,QAAAA,KAAK,GAAG,yBAAcA,KAAd,EAAqB;AAC5BE,UAAAA,GAAG,EAAE,CAAEL,CAAF,EAAKI,CAAL,EAASE,IAAT;AADuB,SAArB,CAAR;AAGA;;AAEDR,MAAAA,WAAW,CAACS,IAAZ,CAAkBJ,KAAlB;AACA,KARD;;AAUA,WAAOL,WAAP;AACA,GAZM,EAYJ,EAZI,CAAP;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASU,sBAAT,CAAiCT,QAAjC,EAA2CU,QAA3C,EAAsD;AAC5D,SACCV,QAAQ,IACRE,gBAASS,GAAT,CAAcX,QAAd,EAAwB,CAAEY,GAAF,EAAOC,KAAP,KAAkB;AACzC,QAAK,sBAAUD,GAAV,CAAL,EAAuB;AACtB,aAAO,0BAAeF,QAAf,EAAyB;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAzB,EAAyCD,GAAzC,CAAP;AACA;;AACD,UAAM;AAAEZ,MAAAA,QAAQ,EAAEc,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCH,GAAG,CAACG,KAAjD;AACA,WAAO,0BACNL,QADM,EAEN;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGE;AAAjB,KAFM,EAGND,YAHM,CAAP;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseReducer,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseDebugValue,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport { isString } from 'lodash';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( isString( elt ) ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/react.js"],"names":["concatChildren","childrenArguments","reduce","accumulator","children","i","Children","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","childrenProp","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAyBA;;AA7BA;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,GAAgD;AAAA,oCAApBC,iBAAoB;AAApBA,IAAAA,iBAAoB;AAAA;;AACtD,SAAOA,iBAAiB,CAACC,MAAlB,CAA0B,CAAEC,WAAF,EAAeC,QAAf,EAAyBC,CAAzB,KAAgC;AAChEC,oBAASC,OAAT,CAAkBH,QAAlB,EAA4B,CAAEI,KAAF,EAASC,CAAT,KAAgB;AAC3C,UAAKD,KAAK,IAAI,aAAa,OAAOA,KAAlC,EAA0C;AACzCA,QAAAA,KAAK,GAAG,yBAAcA,KAAd,EAAqB;AAC5BE,UAAAA,GAAG,EAAE,CAAEL,CAAF,EAAKI,CAAL,EAASE,IAAT;AADuB,SAArB,CAAR;AAGA;;AAEDR,MAAAA,WAAW,CAACS,IAAZ,CAAkBJ,KAAlB;AACA,KARD;;AAUA,WAAOL,WAAP;AACA,GAZM,EAYJ,EAZI,CAAP;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASU,sBAAT,CAAiCT,QAAjC,EAA2CU,QAA3C,EAAsD;AAC5D,SACCV,QAAQ,IACRE,gBAASS,GAAT,CAAcX,QAAd,EAAwB,CAAEY,GAAF,EAAOC,KAAP,KAAkB;AACzC,QAAK,sBAAUD,GAAV,CAAL,EAAuB;AACtB,aAAO,0BAAeF,QAAf,EAAyB;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAzB,EAAyCD,GAAzC,CAAP;AACA;;AACD,UAAM;AAAEZ,MAAAA,QAAQ,EAAEc,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCH,GAAG,CAACG,KAAjD;AACA,WAAO,0BACNL,QADM,EAEN;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGE;AAAjB,KAFM,EAGND,YAHM,CAAP;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseReducer,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseDebugValue,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport { isString } from 'lodash';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( isString( elt ) ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
@@ -5,13 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.default = void 0;
8
9
  exports.hasPrefix = hasPrefix;
10
+ exports.renderAttributes = renderAttributes;
11
+ exports.renderComponent = renderComponent;
9
12
  exports.renderElement = renderElement;
10
13
  exports.renderNativeComponent = renderNativeComponent;
11
- exports.renderComponent = renderComponent;
12
- exports.renderAttributes = renderAttributes;
13
14
  exports.renderStyle = renderStyle;
14
- exports.default = void 0;
15
15
 
16
16
  var _lodash = require("lodash");
17
17
 
@@ -258,7 +258,9 @@ function getNormalStylePropertyValue(property, value) {
258
258
  */
259
259
 
260
260
 
261
- function renderElement(element, context, legacyContext = {}) {
261
+ function renderElement(element, context) {
262
+ let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
263
+
262
264
  if (null === element || undefined === element || false === element) {
263
265
  return '';
264
266
  }
@@ -337,7 +339,8 @@ function renderElement(element, context, legacyContext = {}) {
337
339
  */
338
340
 
339
341
 
340
- function renderNativeComponent(type, props, context, legacyContext = {}) {
342
+ function renderNativeComponent(type, props, context) {
343
+ let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
341
344
  let content = '';
342
345
 
343
346
  if (type === 'textarea' && props.hasOwnProperty('value')) {
@@ -379,7 +382,8 @@ function renderNativeComponent(type, props, context, legacyContext = {}) {
379
382
  */
380
383
 
381
384
 
382
- function renderComponent(Component, props, context, legacyContext = {}) {
385
+ function renderComponent(Component, props, context) {
386
+ let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
383
387
  const instance = new
384
388
  /** @type {import('react').ComponentClass} */
385
389
  Component(props, legacyContext);
@@ -408,7 +412,8 @@ function renderComponent(Component, props, context, legacyContext = {}) {
408
412
  */
409
413
 
410
414
 
411
- function renderChildren(children, context, legacyContext = {}) {
415
+ function renderChildren(children, context) {
416
+ let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
412
417
  let result = '';
413
418
  children = (0, _lodash.castArray)(children);
414
419
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["Provider","Consumer","undefined","ForwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","getNormalAttributeName","toLowerCase","getNormalStylePropertyName","property","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","StrictMode","Fragment","children","RawHTML","wrapperProps","renderNativeComponent","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","attributes","renderAttributes","Component","instance","getChildContext","Object","assign","html","result","i","length","child","key","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normal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AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMQ,UAAU,GAAG7C,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAM6C,WAAW,GAAG5C,2BAA2B,CAAED,QAAF,EAAYL,KAAZ,CAA/C;AACAyC,IAAAA,MAAM,IAAIQ,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOT,MAAP;AACA;;eAEcjC,a","sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport {\n\tisEmpty,\n\tcastArray,\n\tomit,\n\tstartsWith,\n\tkebabCase,\n\tisPlainObject,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('./react').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n *\n * @type {Set<string>}\n */\nconst ATTRIBUTES_TYPES = new Set( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n *\n * @type {Set<string>}\n */\nconst SELF_CLOSING_TAGS = new Set( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * @type {Set<string>}\n */\nconst BOOLEAN_ATTRIBUTES = new Set( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n *\n * @type {Set<string>}\n */\nconst ENUMERATED_ATTRIBUTES = new Set( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n *\n * @type {Set<string>}\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n *\n * @param {string} string String to check.\n * @param {string[]} prefixes Possible prefixes.\n *\n * @return {boolean} Whether string has prefix.\n */\nexport function hasPrefix( string, prefixes ) {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n *\n * @param {string} attribute Attribute to check.\n *\n * @return {boolean} Whether attribute should be ignored.\n */\nfunction isInternalAttribute( attribute ) {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n *\n * @param {string} attribute Attribute name.\n * @param {*} value Non-normalized attribute value.\n *\n * @return {*} Normalized attribute value.\n */\nfunction getNormalAttributeValue( attribute, value ) {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n *\n * @param {string} attribute Non-normalized attribute name.\n *\n * @return {string} Normalized attribute name.\n */\nfunction getNormalAttributeName( attribute ) {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\n\treturn attribute.toLowerCase();\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n *\n * @param {string} property Property name.\n *\n * @return {string} Normalized property name.\n */\nfunction getNormalStylePropertyName( property ) {\n\tif ( startsWith( property, '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n *\n * @param {string} property Property name.\n * @param {*} value Non-normalized property value.\n *\n * @return {*} Normalized property value.\n */\nfunction getNormalStylePropertyValue( property, value ) {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n *\n * @param {import('react').ReactNode} element Element to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderElement( element, context, legacyContext = {} ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst {\n\t\ttype,\n\t\tprops,\n\t} = /** @type {{type?: any, props?: any}} */ ( element );\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\tisEmpty( wrapperProps ) ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n *\n * @param {?string} type Native component type to serialize, or null if\n * rendering as fragment of children content.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderNativeComponent(\n\ttype,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tprops = omit( props, 'value' );\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/** @typedef {import('./react').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} Component Component type to serialize.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element\n */\nexport function renderComponent(\n\tComponent,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tconst instance = new /** @type {import('react').ComponentClass} */ ( Component )(\n\t\tprops,\n\t\tlegacyContext\n\t);\n\n\tif (\n\t\ttypeof (\n\t\t\t// Ignore reason: Current prettier reformats parens and mangles type assertion\n\t\t\t// prettier-ignore\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext\n\t\t) === 'function'\n\t) {\n\t\tObject.assign(\n\t\t\tlegacyContext,\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext()\n\t\t);\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n *\n * @param {import('react').ReactNodeArray} children Children to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized children.\n */\nfunction renderChildren( children, context, legacyContext = {} ) {\n\tlet result = '';\n\n\tchildren = castArray( children );\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\tconst child = children[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n *\n * @param {Object} props Props object.\n *\n * @return {string} Attributes string.\n */\nexport function renderAttributes( props ) {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializeable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n *\n * @param {Object} style Style object.\n *\n * @return {string} Style attribute value.\n */\nexport function renderStyle( style ) {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style;\n\t}\n\n\tlet result;\n\n\tfor ( const property in style ) {\n\t\tconst value = style[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["Provider","Consumer","undefined","ForwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","getNormalAttributeName","toLowerCase","getNormalStylePropertyName","property","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","StrictMode","Fragment","children","RawHTML","wrapperProps","renderNativeComponent","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","attributes","renderAttributes","Component","instance","getChildContext","Object","assign","html","result","i","length","child","key","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":";;;;;;;;;;;;;;;AA8BA;;AAYA;;AASA;;AACA;;AApDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAIA;AAEA,MAAM;AAAEA,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAAyB,0BAAeC,SAAf,CAA/B;AACA,MAAMC,UAAU,GAAG,uB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EAAO,CAAE,OAAF,EAAW,OAAX,CAAP,CADT,IAEAxD,qBAAqB,CAACkB,GAAtB,CAA2BT,SAA3B,CAHD,CAzB0B,CA8B1B;;AACA,QAAK,OAAOE,KAAP,KAAiB,SAAjB,IAA8B,CAAE+C,qBAArC,EAA6D;AAC5D;AACA;;AAEDN,IAAAA,MAAM,IAAI,MAAM3C,SAAhB,CAnC0B,CAqC1B;AACA;;AACA,QAAKgD,kBAAL,EAA0B;AACzB;AACA;;AAED,QAAK,OAAO9C,KAAP,KAAiB,QAAtB,EAAiC;AAChCA,MAAAA,KAAK,GAAG,iCAAiBA,KAAjB,CAAR;AACA;;AAEDyC,IAAAA,MAAM,IAAI,OAAOzC,KAAP,GAAe,GAAzB;AACA;;AAED,SAAOyC,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASxC,WAAT,CAAsB+C,KAAtB,EAA8B;AACpC;AACA,MAAK,CAAE,2BAAeA,KAAf,CAAP,EAAgC;AAC/B,WAAOA,KAAP;AACA;;AAED,MAAIP,MAAJ;;AAEA,OAAM,MAAMpC,QAAZ,IAAwB2C,KAAxB,EAAgC;AAC/B,UAAMhD,KAAK,GAAGgD,KAAK,CAAE3C,QAAF,CAAnB;;AACA,QAAK,SAASL,KAAT,IAAkBjB,SAAS,KAAKiB,KAArC,EAA6C;AAC5C;AACA;;AAED,QAAKyC,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMQ,UAAU,GAAG7C,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAM6C,WAAW,GAAG5C,2BAA2B,CAAED,QAAF,EAAYL,KAAZ,CAA/C;AACAyC,IAAAA,MAAM,IAAIQ,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOT,MAAP;AACA;;eAEcjC,a","sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport {\n\tisEmpty,\n\tcastArray,\n\tomit,\n\tstartsWith,\n\tkebabCase,\n\tisPlainObject,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('./react').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n *\n * @type {Set<string>}\n */\nconst ATTRIBUTES_TYPES = new Set( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n *\n * @type {Set<string>}\n */\nconst SELF_CLOSING_TAGS = new Set( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * @type {Set<string>}\n */\nconst BOOLEAN_ATTRIBUTES = new Set( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n *\n * @type {Set<string>}\n */\nconst ENUMERATED_ATTRIBUTES = new Set( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n *\n * @type {Set<string>}\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n *\n * @param {string} string String to check.\n * @param {string[]} prefixes Possible prefixes.\n *\n * @return {boolean} Whether string has prefix.\n */\nexport function hasPrefix( string, prefixes ) {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n *\n * @param {string} attribute Attribute to check.\n *\n * @return {boolean} Whether attribute should be ignored.\n */\nfunction isInternalAttribute( attribute ) {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n *\n * @param {string} attribute Attribute name.\n * @param {*} value Non-normalized attribute value.\n *\n * @return {*} Normalized attribute value.\n */\nfunction getNormalAttributeValue( attribute, value ) {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n *\n * @param {string} attribute Non-normalized attribute name.\n *\n * @return {string} Normalized attribute name.\n */\nfunction getNormalAttributeName( attribute ) {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\n\treturn attribute.toLowerCase();\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n *\n * @param {string} property Property name.\n *\n * @return {string} Normalized property name.\n */\nfunction getNormalStylePropertyName( property ) {\n\tif ( startsWith( property, '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n *\n * @param {string} property Property name.\n * @param {*} value Non-normalized property value.\n *\n * @return {*} Normalized property value.\n */\nfunction getNormalStylePropertyValue( property, value ) {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n *\n * @param {import('react').ReactNode} element Element to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderElement( element, context, legacyContext = {} ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst {\n\t\ttype,\n\t\tprops,\n\t} = /** @type {{type?: any, props?: any}} */ ( element );\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\tisEmpty( wrapperProps ) ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n *\n * @param {?string} type Native component type to serialize, or null if\n * rendering as fragment of children content.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderNativeComponent(\n\ttype,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tprops = omit( props, 'value' );\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/** @typedef {import('./react').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} Component Component type to serialize.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element\n */\nexport function renderComponent(\n\tComponent,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tconst instance = new /** @type {import('react').ComponentClass} */ ( Component )(\n\t\tprops,\n\t\tlegacyContext\n\t);\n\n\tif (\n\t\ttypeof (\n\t\t\t// Ignore reason: Current prettier reformats parens and mangles type assertion\n\t\t\t// prettier-ignore\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext\n\t\t) === 'function'\n\t) {\n\t\tObject.assign(\n\t\t\tlegacyContext,\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext()\n\t\t);\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n *\n * @param {import('react').ReactNodeArray} children Children to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized children.\n */\nfunction renderChildren( children, context, legacyContext = {} ) {\n\tlet result = '';\n\n\tchildren = castArray( children );\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\tconst child = children[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n *\n * @param {Object} props Props object.\n *\n * @return {string} Attributes string.\n */\nexport function renderAttributes( props ) {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializeable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n *\n * @param {Object} style Style object.\n *\n * @return {string} Style attribute value.\n */\nexport function renderStyle( style ) {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style;\n\t}\n\n\tlet result;\n\n\tfor ( const property in style ) {\n\t\tconst value = style[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"]}
@@ -18,10 +18,11 @@ import { Children, createElement } from './react'; // Disable reason: JSDoc lint
18
18
  * @return {JSX.Element} Dangerously-rendering component.
19
19
  */
20
20
 
21
- export default function RawHTML({
22
- children,
23
- ...props
24
- }) {
21
+ export default function RawHTML(_ref) {
22
+ let {
23
+ children,
24
+ ...props
25
+ } = _ref;
25
26
  let rawHtml = ''; // Cast children as an array, and concatenate each element if it is a string.
26
27
 
27
28
  Children.toArray(children).forEach(child => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["Children","createElement","RawHTML","children","props","rawHtml","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,SAAxC,C,CAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,OAAT,CAAkB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAlB,EAA2C;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAL,EAAAA,QAAQ,CAACM,OAAT,CAAkBH,QAAlB,EAA6BI,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDJ,MAAAA,OAAO,IAAIG,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;AACA,SAAOP,aAAa,CAAE,KAAF,EAAS;AAC5BS,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEN;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAT,CAApB;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["Children","createElement","RawHTML","children","props","rawHtml","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,SAAxC,C,CAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,OAAT,OAA2C;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAAyB;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAL,EAAAA,QAAQ,CAACM,OAAT,CAAkBH,QAAlB,EAA6BI,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDJ,MAAAA,OAAO,IAAIG,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;AACA,SAAOP,aAAa,CAAE,KAAF,EAAS;AAC5BS,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEN;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAT,CAApB;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
@@ -2,46 +2,14 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { AppRegistry } from 'react-native';
5
- import { omit } from 'lodash';
6
5
  /**
7
- * WordPress dependencies
8
- */
9
-
10
- import { applyFilters, doAction } from '@wordpress/hooks';
11
- /**
12
- * Internal dependencies
13
- */
14
-
15
- import { Component, cloneElement } from './react';
16
-
17
- const render = (element, id) => {
18
- class App extends Component {
19
- constructor() {
20
- super(...arguments);
21
- const parentProps = omit(this.props || {}, ['rootTag']);
22
- doAction('native.pre-render', parentProps);
23
- this.filteredProps = applyFilters('native.block_editor_props', parentProps);
24
- }
25
-
26
- componentDidMount() {
27
- doAction('native.render', this.filteredProps);
28
- }
29
-
30
- render() {
31
- return cloneElement(element, this.filteredProps);
32
- }
33
-
34
- }
35
-
36
- AppRegistry.registerComponent(id, () => App);
37
- };
38
- /**
39
- * Render a given element on Native.
40
- * This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent`
6
+ * Registers an app root component allowing the native system to run the app.
41
7
  *
42
- * @param {WPElement} element Element to render.
8
+ * @param {string} appKey Unique app name identifier.
9
+ * @param {Function} componentProvider Function returning the app root React component.
43
10
  */
44
11
 
45
-
46
- export { render };
12
+ export const registerComponent = (appKey, componentProvider) => {
13
+ AppRegistry.registerComponent(appKey, componentProvider);
14
+ };
47
15
  //# sourceMappingURL=react-platform.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/react-platform.native.js"],"names":["AppRegistry","omit","applyFilters","doAction","Component","cloneElement","render","element","id","App","constructor","arguments","parentProps","props","filteredProps","componentDidMount","registerComponent"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,cAA5B;AACA,SAASC,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,QAAvB,QAAuC,kBAAvC;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,YAApB,QAAwC,SAAxC;;AAEA,MAAMC,MAAM,GAAG,CAAEC,OAAF,EAAWC,EAAX,KAAmB;AACjC,QAAMC,GAAN,SAAkBL,SAAlB,CAA4B;AAC3BM,IAAAA,WAAW,GAAG;AACb,YAAO,GAAGC,SAAV;AAEA,YAAMC,WAAW,GAAGX,IAAI,CAAE,KAAKY,KAAL,IAAc,EAAhB,EAAoB,CAAE,SAAF,CAApB,CAAxB;AAEAV,MAAAA,QAAQ,CAAE,mBAAF,EAAuBS,WAAvB,CAAR;AAEA,WAAKE,aAAL,GAAqBZ,YAAY,CAChC,2BADgC,EAEhCU,WAFgC,CAAjC;AAIA;;AAEDG,IAAAA,iBAAiB,GAAG;AACnBZ,MAAAA,QAAQ,CAAE,eAAF,EAAmB,KAAKW,aAAxB,CAAR;AACA;;AAEDR,IAAAA,MAAM,GAAG;AACR,aAAOD,YAAY,CAAEE,OAAF,EAAW,KAAKO,aAAhB,CAAnB;AACA;;AApB0B;;AAuB5Bd,EAAAA,WAAW,CAACgB,iBAAZ,CAA+BR,EAA/B,EAAmC,MAAMC,GAAzC;AACA,CAzBD;AA2BA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASH,MAAT","sourcesContent":["/**\n * External dependencies\n */\nimport { AppRegistry } from 'react-native';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { Component, cloneElement } from './react';\n\nconst render = ( element, id ) => {\n\tclass App extends Component {\n\t\tconstructor() {\n\t\t\tsuper( ...arguments );\n\n\t\t\tconst parentProps = omit( this.props || {}, [ 'rootTag' ] );\n\n\t\t\tdoAction( 'native.pre-render', parentProps );\n\n\t\t\tthis.filteredProps = applyFilters(\n\t\t\t\t'native.block_editor_props',\n\t\t\t\tparentProps\n\t\t\t);\n\t\t}\n\n\t\tcomponentDidMount() {\n\t\t\tdoAction( 'native.render', this.filteredProps );\n\t\t}\n\n\t\trender() {\n\t\t\treturn cloneElement( element, this.filteredProps );\n\t\t}\n\t}\n\n\tAppRegistry.registerComponent( id, () => App );\n};\n\n/**\n * Render a given element on Native.\n * This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent`\n *\n * @param {WPElement} element Element to render.\n */\nexport { render };\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/react-platform.native.js"],"names":["AppRegistry","registerComponent","appKey","componentProvider"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,cAA5B;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,iBAAiB,GAAG,CAAEC,MAAF,EAAUC,iBAAV,KAAiC;AACjEH,EAAAA,WAAW,CAACC,iBAAZ,CAA+BC,MAA/B,EAAuCC,iBAAvC;AACA,CAFM","sourcesContent":["/**\n * External dependencies\n */\nimport { AppRegistry } from 'react-native';\n\n/**\n * Registers an app root component allowing the native system to run the app.\n *\n * @param {string} appKey Unique app name identifier.\n * @param {Function} componentProvider Function returning the app root React component.\n */\nexport const registerComponent = ( appKey, componentProvider ) => {\n\tAppRegistry.registerComponent( appKey, componentProvider );\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
4
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
5
5
  import { Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, memo, StrictMode, useState, useEffect, useContext, useReducer, useCallback, useMemo, useRef, useImperativeHandle, useLayoutEffect, useDebugValue, lazy, Suspense } from 'react';
6
6
  import { isString } from 'lodash';
7
7
  /**
@@ -179,7 +179,11 @@ export { Suspense };
179
179
  * @return {Array} The concatenated value.
180
180
  */
181
181
 
182
- export function concatChildren(...childrenArguments) {
182
+ export function concatChildren() {
183
+ for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
184
+ childrenArguments[_key] = arguments[_key];
185
+ }
186
+
183
187
  return childrenArguments.reduce((accumulator, children, i) => {
184
188
  Children.forEach(children, (child, j) => {
185
189
  if (child && 'string' !== typeof child) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/react.js"],"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue","lazy","Suspense","isString","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","childrenProp","props"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,aALD,EAMCC,SAND,EAOCC,UAPD,EAQCC,QARD,EASCC,cATD,EAUCC,IAVD,EAWCC,UAXD,EAYCC,QAZD,EAaCC,SAbD,EAcCC,UAdD,EAeCC,UAfD,EAgBCC,WAhBD,EAiBCC,OAjBD,EAkBCC,MAlBD,EAmBCC,mBAnBD,EAoBCC,eApBD,EAqBCC,aArBD,EAsBCC,IAtBD,EAuBCC,QAvBD,QAwBO,OAxBP;AAyBA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AACA,SAASvB,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,cAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASK,WAAT;AAEA;AACA;AACA;;AACA,SAASF,UAAT;AAEA;AACA;AACA;;AACA,SAASO,aAAT;AAEA;AACA;AACA;;AACA,SAASR,SAAT;AAEA;AACA;AACA;;AACA,SAASM,mBAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASH,OAAT;AAEA;AACA;AACA;;AACA,SAASF,UAAT;AAEA;AACA;AACA;;AACA,SAASG,MAAT;AAEA;AACA;AACA;;AACA,SAASN,QAAT;AAE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HmB,CAApB;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseReducer,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseDebugValue,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport { isString } from 'lodash';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( isString( elt ) ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/react.js"],"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue","lazy","Suspense","isString","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","childrenProp","props"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,aALD,EAMCC,SAND,EAOCC,UAPD,EAQCC,QARD,EASCC,cATD,EAUCC,IAVD,EAWCC,UAXD,EAYCC,QAZD,EAaCC,SAbD,EAcCC,UAdD,EAeCC,UAfD,EAgBCC,WAhBD,EAiBCC,OAjBD,EAkBCC,MAlBD,EAmBCC,mBAnBD,EAoBCC,eApBD,EAqBCC,aArBD,EAsBCC,IAtBD,EAuBCC,QAvBD,QAwBO,OAxBP;AAyBA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AACA,SAASvB,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,cAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASK,WAAT;AAEA;AACA;AACA;;AACA,SAASF,UAAT;AAEA;AACA;AACA;;AACA,SAASO,aAAT;AAEA;AACA;AACA;;AACA,SAASR,SAAT;AAEA;AACA;AACA;;AACA,SAASM,mBAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASH,OAAT;AAEA;AACA;AACA;;AACA,SAASF,UAAT;AAEA;AACA;AACA;;AACA,SAASG,MAAT;AAEA;AACA;AACA;;AACA,SAASN,QAAT;AAEA;AACA;AACA;;AACA,SAASU,IAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,cAAT,GAAgD;AAAA,oCAApBC,iBAAoB;AAApBA,IAAAA,iBAAoB;AAAA;;AACtD,SAAOA,iBAAiB,CAACC,MAAlB,CAA0B,CAAEC,WAAF,EAAeC,QAAf,EAAyBC,CAAzB,KAAgC;AAChE7B,IAAAA,QAAQ,CAAC8B,OAAT,CAAkBF,QAAlB,EAA4B,CAAEG,KAAF,EAASC,CAAT,KAAgB;AAC3C,UAAKD,KAAK,IAAI,aAAa,OAAOA,KAAlC,EAA0C;AACzCA,QAAAA,KAAK,GAAG9B,YAAY,CAAE8B,KAAF,EAAS;AAC5BE,UAAAA,GAAG,EAAE,CAAEJ,CAAF,EAAKG,CAAL,EAASE,IAAT;AADuB,SAAT,CAApB;AAGA;;AAEDP,MAAAA,WAAW,CAACQ,IAAZ,CAAkBJ,KAAlB;AACA,KARD;AAUA,WAAOJ,WAAP;AACA,GAZM,EAYJ,EAZI,CAAP;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASS,sBAAT,CAAiCR,QAAjC,EAA2CS,QAA3C,EAAsD;AAC5D,SACCT,QAAQ,IACR5B,QAAQ,CAACsC,GAAT,CAAcV,QAAd,EAAwB,CAAEW,GAAF,EAAOC,KAAP,KAAkB;AACzC,QAAKjB,QAAQ,CAAEgB,GAAF,CAAb,EAAuB;AACtB,aAAOnC,aAAa,CAAEiC,QAAF,EAAY;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAZ,EAA4BD,GAA5B,CAApB;AACA;;AACD,UAAM;AAAEX,MAAAA,QAAQ,EAAEa,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCH,GAAG,CAACG,KAAjD;AACA,WAAOtC,aAAa,CACnBiC,QADmB,EAEnB;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGE;AAAjB,KAFmB,EAGnBD,YAHmB,CAApB;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseReducer,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseDebugValue,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport { isString } from 'lodash';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( isString( elt ) ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
@@ -238,7 +238,9 @@ function getNormalStylePropertyValue(property, value) {
238
238
  */
239
239
 
240
240
 
241
- export function renderElement(element, context, legacyContext = {}) {
241
+ export function renderElement(element, context) {
242
+ let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
243
+
242
244
  if (null === element || undefined === element || false === element) {
243
245
  return '';
244
246
  }
@@ -316,7 +318,8 @@ export function renderElement(element, context, legacyContext = {}) {
316
318
  * @return {string} Serialized element.
317
319
  */
318
320
 
319
- export function renderNativeComponent(type, props, context, legacyContext = {}) {
321
+ export function renderNativeComponent(type, props, context) {
322
+ let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
320
323
  let content = '';
321
324
 
322
325
  if (type === 'textarea' && props.hasOwnProperty('value')) {
@@ -357,7 +360,8 @@ export function renderNativeComponent(type, props, context, legacyContext = {})
357
360
  * @return {string} Serialized element
358
361
  */
359
362
 
360
- export function renderComponent(Component, props, context, legacyContext = {}) {
363
+ export function renderComponent(Component, props, context) {
364
+ let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
361
365
  const instance = new
362
366
  /** @type {import('react').ComponentClass} */
363
367
  Component(props, legacyContext);
@@ -385,7 +389,8 @@ export function renderComponent(Component, props, context, legacyContext = {}) {
385
389
  * @return {string} Serialized children.
386
390
  */
387
391
 
388
- function renderChildren(children, context, legacyContext = {}) {
392
+ function renderChildren(children, context) {
393
+ let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
389
394
  let result = '';
390
395
  children = castArray(children);
391
396
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["isEmpty","castArray","omit","startsWith","kebabCase","isPlainObject","escapeHTML","escapeAttribute","isValidAttributeName","createContext","Fragment","StrictMode","forwardRef","RawHTML","Provider","Consumer","undefined","ForwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","getNormalAttributeName","toLowerCase","getNormalStylePropertyName","property","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","children","wrapperProps","renderNativeComponent","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","attributes","renderAttributes","Component","instance","getChildContext","Object","assign","html","result","i","length","child","key","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SACCA,OADD,EAECC,SAFD,EAGCC,IAHD,EAICC,UAJD,EAKCC,SALD,EAMCC,aAND,QAOO,QAPP;AASA;AACA;AACA;;AACA,SACCC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AC5C;AACA;;AAED,QAAKsC,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMQ,UAAU,GAAG1C,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAM0C,WAAW,GAAGzC,2BAA2B,CAAED,QAAF,EAAYL,KAAZ,CAA/C;AACAsC,IAAAA,MAAM,IAAIQ,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOT,MAAP;AACA;AAED,eAAe9B,aAAf","sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport {\n\tisEmpty,\n\tcastArray,\n\tomit,\n\tstartsWith,\n\tkebabCase,\n\tisPlainObject,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('./react').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n *\n * @type {Set<string>}\n */\nconst ATTRIBUTES_TYPES = new Set( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n *\n * @type {Set<string>}\n */\nconst SELF_CLOSING_TAGS = new Set( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * @type {Set<string>}\n */\nconst BOOLEAN_ATTRIBUTES = new Set( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n *\n * @type {Set<string>}\n */\nconst ENUMERATED_ATTRIBUTES = new Set( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n *\n * @type {Set<string>}\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n *\n * @param {string} string String to check.\n * @param {string[]} prefixes Possible prefixes.\n *\n * @return {boolean} Whether string has prefix.\n */\nexport function hasPrefix( string, prefixes ) {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n *\n * @param {string} attribute Attribute to check.\n *\n * @return {boolean} Whether attribute should be ignored.\n */\nfunction isInternalAttribute( attribute ) {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n *\n * @param {string} attribute Attribute name.\n * @param {*} value Non-normalized attribute value.\n *\n * @return {*} Normalized attribute value.\n */\nfunction getNormalAttributeValue( attribute, value ) {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n *\n * @param {string} attribute Non-normalized attribute name.\n *\n * @return {string} Normalized attribute name.\n */\nfunction getNormalAttributeName( attribute ) {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\n\treturn attribute.toLowerCase();\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n *\n * @param {string} property Property name.\n *\n * @return {string} Normalized property name.\n */\nfunction getNormalStylePropertyName( property ) {\n\tif ( startsWith( property, '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n *\n * @param {string} property Property name.\n * @param {*} value Non-normalized property value.\n *\n * @return {*} Normalized property value.\n */\nfunction getNormalStylePropertyValue( property, value ) {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n *\n * @param {import('react').ReactNode} element Element to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderElement( element, context, legacyContext = {} ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst {\n\t\ttype,\n\t\tprops,\n\t} = /** @type {{type?: any, props?: any}} */ ( element );\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\tisEmpty( wrapperProps ) ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n *\n * @param {?string} type Native component type to serialize, or null if\n * rendering as fragment of children content.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderNativeComponent(\n\ttype,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tprops = omit( props, 'value' );\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/** @typedef {import('./react').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} Component Component type to serialize.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element\n */\nexport function renderComponent(\n\tComponent,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tconst instance = new /** @type {import('react').ComponentClass} */ ( Component )(\n\t\tprops,\n\t\tlegacyContext\n\t);\n\n\tif (\n\t\ttypeof (\n\t\t\t// Ignore reason: Current prettier reformats parens and mangles type assertion\n\t\t\t// prettier-ignore\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext\n\t\t) === 'function'\n\t) {\n\t\tObject.assign(\n\t\t\tlegacyContext,\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext()\n\t\t);\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n *\n * @param {import('react').ReactNodeArray} children Children to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized children.\n */\nfunction renderChildren( children, context, legacyContext = {} ) {\n\tlet result = '';\n\n\tchildren = castArray( children );\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\tconst child = children[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n *\n * @param {Object} props Props object.\n *\n * @return {string} Attributes string.\n */\nexport function renderAttributes( props ) {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializeable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n *\n * @param {Object} style Style object.\n *\n * @return {string} Style attribute value.\n */\nexport function renderStyle( style ) {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style;\n\t}\n\n\tlet result;\n\n\tfor ( const property in style ) {\n\t\tconst value = style[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["isEmpty","castArray","omit","startsWith","kebabCase","isPlainObject","escapeHTML","escapeAttribute","isValidAttributeName","createContext","Fragment","StrictMode","forwardRef","RawHTML","Provider","Consumer","undefined","ForwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","getNormalAttributeName","toLowerCase","getNormalStylePropertyName","property","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","children","wrapperProps","renderNativeComponent","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","attributes","renderAttributes","Component","instance","getChildContext","Object","assign","html","result","i","length","child","key","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SACCA,OADD,EAECC,SAFD,EAGCC,IAHD,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G6C,KAAK,CAAExC,QAAF,CAAnB;;AACA,QAAK,SAASL,KAAT,IAAkBjB,SAAS,KAAKiB,KAArC,EAA6C;AAC5C;AACA;;AAED,QAAKsC,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMQ,UAAU,GAAG1C,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAM0C,WAAW,GAAGzC,2BAA2B,CAAED,QAAF,EAAYL,KAAZ,CAA/C;AACAsC,IAAAA,MAAM,IAAIQ,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOT,MAAP;AACA;AAED,eAAe9B,aAAf","sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport {\n\tisEmpty,\n\tcastArray,\n\tomit,\n\tstartsWith,\n\tkebabCase,\n\tisPlainObject,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('./react').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n *\n * @type {Set<string>}\n */\nconst ATTRIBUTES_TYPES = new Set( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n *\n * @type {Set<string>}\n */\nconst SELF_CLOSING_TAGS = new Set( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * @type {Set<string>}\n */\nconst BOOLEAN_ATTRIBUTES = new Set( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n *\n * @type {Set<string>}\n */\nconst ENUMERATED_ATTRIBUTES = new Set( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n *\n * @type {Set<string>}\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n *\n * @param {string} string String to check.\n * @param {string[]} prefixes Possible prefixes.\n *\n * @return {boolean} Whether string has prefix.\n */\nexport function hasPrefix( string, prefixes ) {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n *\n * @param {string} attribute Attribute to check.\n *\n * @return {boolean} Whether attribute should be ignored.\n */\nfunction isInternalAttribute( attribute ) {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n *\n * @param {string} attribute Attribute name.\n * @param {*} value Non-normalized attribute value.\n *\n * @return {*} Normalized attribute value.\n */\nfunction getNormalAttributeValue( attribute, value ) {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n *\n * @param {string} attribute Non-normalized attribute name.\n *\n * @return {string} Normalized attribute name.\n */\nfunction getNormalAttributeName( attribute ) {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\n\treturn attribute.toLowerCase();\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n *\n * @param {string} property Property name.\n *\n * @return {string} Normalized property name.\n */\nfunction getNormalStylePropertyName( property ) {\n\tif ( startsWith( property, '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n *\n * @param {string} property Property name.\n * @param {*} value Non-normalized property value.\n *\n * @return {*} Normalized property value.\n */\nfunction getNormalStylePropertyValue( property, value ) {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n *\n * @param {import('react').ReactNode} element Element to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderElement( element, context, legacyContext = {} ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst {\n\t\ttype,\n\t\tprops,\n\t} = /** @type {{type?: any, props?: any}} */ ( element );\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\tisEmpty( wrapperProps ) ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n *\n * @param {?string} type Native component type to serialize, or null if\n * rendering as fragment of children content.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderNativeComponent(\n\ttype,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tprops = omit( props, 'value' );\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/** @typedef {import('./react').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} Component Component type to serialize.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element\n */\nexport function renderComponent(\n\tComponent,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tconst instance = new /** @type {import('react').ComponentClass} */ ( Component )(\n\t\tprops,\n\t\tlegacyContext\n\t);\n\n\tif (\n\t\ttypeof (\n\t\t\t// Ignore reason: Current prettier reformats parens and mangles type assertion\n\t\t\t// prettier-ignore\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext\n\t\t) === 'function'\n\t) {\n\t\tObject.assign(\n\t\t\tlegacyContext,\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext()\n\t\t);\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n *\n * @param {import('react').ReactNodeArray} children Children to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized children.\n */\nfunction renderChildren( children, context, legacyContext = {} ) {\n\tlet result = '';\n\n\tchildren = castArray( children );\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\tconst child = children[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n *\n * @param {Object} props Props object.\n *\n * @return {string} Attributes string.\n */\nexport function renderAttributes( props ) {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializeable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n *\n * @param {Object} style Style object.\n *\n * @return {string} Style attribute value.\n */\nexport function renderStyle( style ) {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style;\n\t}\n\n\tlet result;\n\n\tfor ( const property in style ) {\n\t\tconst value = style[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/element",
3
- "version": "4.0.3",
3
+ "version": "4.1.1",
4
4
  "description": "Element React module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -28,16 +28,16 @@
28
28
  "types": "build-types",
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@babel/runtime": "^7.13.10",
32
- "@types/react": "^16.9.0",
33
- "@types/react-dom": "^16.9.0",
34
- "@wordpress/escape-html": "^2.2.2",
31
+ "@babel/runtime": "^7.16.0",
32
+ "@types/react": "^17.0.37",
33
+ "@types/react-dom": "^17.0.11",
34
+ "@wordpress/escape-html": "^2.3.1",
35
35
  "lodash": "^4.17.21",
36
- "react": "^17.0.1",
37
- "react-dom": "^17.0.1"
36
+ "react": "^17.0.2",
37
+ "react-dom": "^17.0.2"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "157f4ae53ab98e574af01f72213ae5a9613159ff"
42
+ "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
43
43
  }
@@ -2,49 +2,13 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { AppRegistry } from 'react-native';
5
- import { omit } from 'lodash';
6
5
 
7
6
  /**
8
- * WordPress dependencies
9
- */
10
- import { applyFilters, doAction } from '@wordpress/hooks';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import { Component, cloneElement } from './react';
16
-
17
- const render = ( element, id ) => {
18
- class App extends Component {
19
- constructor() {
20
- super( ...arguments );
21
-
22
- const parentProps = omit( this.props || {}, [ 'rootTag' ] );
23
-
24
- doAction( 'native.pre-render', parentProps );
25
-
26
- this.filteredProps = applyFilters(
27
- 'native.block_editor_props',
28
- parentProps
29
- );
30
- }
31
-
32
- componentDidMount() {
33
- doAction( 'native.render', this.filteredProps );
34
- }
35
-
36
- render() {
37
- return cloneElement( element, this.filteredProps );
38
- }
39
- }
40
-
41
- AppRegistry.registerComponent( id, () => App );
42
- };
43
-
44
- /**
45
- * Render a given element on Native.
46
- * This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent`
7
+ * Registers an app root component allowing the native system to run the app.
47
8
  *
48
- * @param {WPElement} element Element to render.
9
+ * @param {string} appKey Unique app name identifier.
10
+ * @param {Function} componentProvider Function returning the app root React component.
49
11
  */
50
- export { render };
12
+ export const registerComponent = ( appKey, componentProvider ) => {
13
+ AppRegistry.registerComponent( appKey, componentProvider );
14
+ };
package/src/react.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
4
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
5
5
  import {
6
6
  Children,
7
7
  cloneElement,
@@ -1,7 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { shallow } from 'enzyme';
5
1
  /**
6
2
  * Internal dependencies
7
3
  */
@@ -9,11 +5,11 @@ import Platform from '../platform';
9
5
 
10
6
  describe( 'Platform', () => {
11
7
  it( 'is chooses the right thing', () => {
12
- const element = Platform.select( {
13
- web: shallow( <div></div> ),
14
- native: shallow( <button></button> ),
8
+ const selection = Platform.select( {
9
+ web: 'web',
10
+ native: 'native',
15
11
  } );
16
12
 
17
- expect( element.type() ).toBe( 'button' );
13
+ expect( selection ).toBe( 'native' );
18
14
  } );
19
15
  } );
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","./src/react.js","./src/create-interpolate-element.js","../../node_modules/@types/react-dom/index.d.ts","./src/react-platform.js","./src/utils.js","./src/platform.js","../escape-html/build-types/index.d.ts","./src/raw-html.js","./src/serialize.js","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"b3a4ee9791cdd4f5029b3ffe60b9cae1ac308a4238b0444f40a5222e4ecc5cc1","a7e32dcb90bf0c1b7a1e4ac89b0f7747cbcba25e7beddc1ebf17be1e161842ad",{"version":"0290ce481d9430774f1d41e757d087e9324b497e1ee0a9e908cf57a9f8bc6e0d","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"63f51ac4c4b477396419f9ef04971ff2c3d32787467433c29a2db72dd0d55c67","85033f9a470234f884ee03fbb16e38c14198c1d3793c4f2fe42a001ee0cfc89f","c45d6f4d3a20be54e46237608f537a8d85397f87b9c3318d68ed925c2f1d0b51","5f64b816787e27a185108a1cb5a3b2843975b2924cf4f364609f5a21d46f7c0e","70f5fb0dd6739831c8fb7ca0c972fcf523fef17230dd2f54aa9dd9c065141979","36af408a1aedb7ef10cb8d8c8a1474883330805d09c17f080887143602cf9f77","a2619dc7f465db880771e5b7a505b668319ae3e72a05f3d2dc00f7303decc6ec","f3053e00b1c9034866070bfc7af4030ab60947997ce959bb20cd8f3b99ad556e","b0242dc6c8c1f5c953d1c0475440af6b9c0be2b6b64dacf2d35cec3ec52fccdb","e2877cc0e5f7bb33c7751b0e66c102d26cb2423e65908fde2ed3093d571ee264"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":false,"target":99},"fileIdsList":[[49,51,52,53,54,55,56,57,58,59,60,61],[49,50,52,53,54,55,56,57,58,59,60,61],[50,51,52,53,54,55,56,57,58,59,60,61],[49,50,51,53,54,55,56,57,58,59,60,61],[49,50,51,52,54,55,56,57,58,59,60,61],[49,50,51,52,53,55,56,57,58,59,60,61],[49,50,51,52,53,54,56,57,58,59,60,61],[49,50,51,52,53,54,55,57,58,59,60,61],[49,50,51,52,53,54,55,56,58,59,60,61],[49,50,51,52,53,54,55,56,57,59,60,61],[49,50,51,52,53,54,55,56,57,58,60,61],[49,50,51,52,53,54,55,56,57,58,59,61],[49,50,51,52,53,54,55,56,57,58,59,60],[48],[45,46,47],[62],[62,63,65,66,67,69,70],[48,62],[62,64],[48,61],[48,61,62,68,69],[61]],"referencedMap":[[50,1],[51,2],[49,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[64,14],[48,15],[63,16],[71,17],[69,18],[65,19],[62,20],[70,21],[66,22]],"exportedModulesMap":[[50,1],[51,2],[49,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[64,14],[48,15],[63,16],[71,17],[69,18],[65,19],[62,20],[70,21],[66,22]],"semanticDiagnosticsPerFile":[50,51,49,52,53,54,55,56,57,58,59,60,61,47,64,45,48,46,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,63,71,67,69,65,62,70,66,68]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","./src/react.js","./src/create-interpolate-element.js","../../node_modules/@types/react-dom/index.d.ts","./src/react-platform.js","./src/utils.js","./src/platform.js","../escape-html/build-types/index.d.ts","./src/raw-html.js","./src/serialize.js","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"4fa69ebb7af909f4f767f487cba9cb09623fb626a470562f419128145ada49f2","85033f9a470234f884ee03fbb16e38c14198c1d3793c4f2fe42a001ee0cfc89f","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","5f64b816787e27a185108a1cb5a3b2843975b2924cf4f364609f5a21d46f7c0e","70f5fb0dd6739831c8fb7ca0c972fcf523fef17230dd2f54aa9dd9c065141979","36af408a1aedb7ef10cb8d8c8a1474883330805d09c17f080887143602cf9f77","a2619dc7f465db880771e5b7a505b668319ae3e72a05f3d2dc00f7303decc6ec","f3053e00b1c9034866070bfc7af4030ab60947997ce959bb20cd8f3b99ad556e","b0242dc6c8c1f5c953d1c0475440af6b9c0be2b6b64dacf2d35cec3ec52fccdb","e2877cc0e5f7bb33c7751b0e66c102d26cb2423e65908fde2ed3093d571ee264"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":false,"target":99},"fileIdsList":[[50,52,53,54,55,56,57,58,59,60,61,62],[50,51,53,54,55,56,57,58,59,60,61,62],[51,52,53,54,55,56,57,58,59,60,61,62],[50,51,52,54,55,56,57,58,59,60,61,62],[50,51,52,53,55,56,57,58,59,60,61,62],[50,51,52,53,54,56,57,58,59,60,61,62],[50,51,52,53,54,55,57,58,59,60,61,62],[50,51,52,53,54,55,56,58,59,60,61,62],[50,51,52,53,54,55,56,57,59,60,61,62],[50,51,52,53,54,55,56,57,58,60,61,62],[50,51,52,53,54,55,56,57,58,59,61,62],[50,51,52,53,54,55,56,57,58,59,60,62],[50,51,52,53,54,55,56,57,58,59,60,61],[49],[45,46,47,48],[63],[63,64,66,67,68,70,71],[49,63],[63,65],[49,62],[49,62,63,69,70],[62]],"referencedMap":[[51,1],[52,2],[50,3],[53,4],[54,5],[55,6],[56,7],[57,8],[58,9],[59,10],[60,11],[61,12],[62,13],[65,14],[49,15],[64,16],[72,17],[70,18],[66,19],[63,20],[71,21],[67,22]],"exportedModulesMap":[[51,1],[52,2],[50,3],[53,4],[54,5],[55,6],[56,7],[57,8],[58,9],[59,10],[60,11],[61,12],[62,13],[65,14],[49,15],[64,16],[72,17],[70,18],[66,19],[63,20],[71,21],[67,22]],"semanticDiagnosticsPerFile":[51,52,50,53,54,55,56,57,58,59,60,61,62,47,65,45,49,46,48,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,64,72,68,70,66,63,71,67,69]},"version":"4.4.2"}