@wordpress/element 4.0.0 → 4.0.2

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/README.md CHANGED
@@ -21,7 +21,7 @@ Install the module
21
21
  npm install @wordpress/element --save
22
22
  ```
23
23
 
24
- _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._
24
+ _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._
25
25
 
26
26
  ## Usage
27
27
 
@@ -20,7 +20,9 @@ const Platform = { ..._reactNative.Platform,
20
20
  }
21
21
 
22
22
  return spec.default;
23
- }
23
+ },
24
+ isNative: true,
25
+ isAndroid: true
24
26
  };
25
27
  var _default = Platform;
26
28
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.android.js"],"names":["Platform","OriginalPlatform","OS","select","spec","android","native","default"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,EAChB,GAAGC,qBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,aAAaA,IAAlB,EAAyB;AACxB,aAAOA,IAAI,CAACC,OAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA;AAVe,CAAjB;eAaeP,Q","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'android' in spec ) {\n\t\t\treturn spec.android;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n};\n\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.android.js"],"names":["Platform","OriginalPlatform","OS","select","spec","android","native","default","isNative","isAndroid"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,EAChB,GAAGC,qBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,aAAaA,IAAlB,EAAyB;AACxB,aAAOA,IAAI,CAACC,OAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA,GAVe;AAWhBC,EAAAA,QAAQ,EAAE,IAXM;AAYhBC,EAAAA,SAAS,EAAE;AAZK,CAAjB;eAeeT,Q","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'android' in spec ) {\n\t\t\treturn spec.android;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n\tisNative: true,\n\tisAndroid: true,\n};\n\nexport default Platform;\n"]}
@@ -20,7 +20,9 @@ const Platform = { ..._reactNative.Platform,
20
20
  }
21
21
 
22
22
  return spec.default;
23
- }
23
+ },
24
+ isNative: true,
25
+ isIOS: true
24
26
  };
25
27
  var _default = Platform;
26
28
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.ios.js"],"names":["Platform","OriginalPlatform","OS","select","spec","ios","native","default"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,EAChB,GAAGC,qBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,SAASA,IAAd,EAAqB;AACpB,aAAOA,IAAI,CAACC,GAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA;AAVe,CAAjB;eAaeP,Q","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'ios' in spec ) {\n\t\t\treturn spec.ios;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n};\n\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.ios.js"],"names":["Platform","OriginalPlatform","OS","select","spec","ios","native","default","isNative","isIOS"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,QAAQ,GAAG,EAChB,GAAGC,qBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,SAASA,IAAd,EAAqB;AACpB,aAAOA,IAAI,CAACC,GAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA,GAVe;AAWhBC,EAAAA,QAAQ,EAAE,IAXM;AAYhBC,EAAAA,KAAK,EAAE;AAZS,CAAjB;eAeeT,Q","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'ios' in spec ) {\n\t\t\treturn spec.ios;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n\tisNative: true,\n\tisIOS: true,\n};\n\nexport default Platform;\n"]}
package/build/platform.js CHANGED
@@ -15,7 +15,8 @@ exports.default = void 0;
15
15
  */
16
16
  const Platform = {
17
17
  OS: 'web',
18
- select: spec => 'web' in spec ? spec.web : spec.default
18
+ select: spec => 'web' in spec ? spec.web : spec.default,
19
+ isWeb: true
19
20
  };
20
21
  /**
21
22
  * Component used to detect the current Platform being used.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.js"],"names":["Platform","OS","select","spec","web","default"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,EAAE,EAAE,KADY;AAEhBC,EAAAA,MAAM,EAAIC,IAAF,IAAc,SAASA,IAAT,GAAgBA,IAAI,CAACC,GAArB,GAA2BD,IAAI,CAACE;AAFtC,CAAjB;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;eACeL,Q","sourcesContent":["/**\n * Parts of this source were derived and modified from react-native-web,\n * released under the MIT license.\n *\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n */\nconst Platform = {\n\tOS: 'web',\n\tselect: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),\n};\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web enviroment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module\n *\n * Here is an example of how to use the select method:\n * @example\n * ```js\n * import { Platform } from '@wordpress/element';\n *\n * const placeholderLabel = Platform.select( {\n * native: __( 'Add media' ),\n * web: __( 'Drag images, upload new ones or select files from your library.' ),\n * } );\n * ```\n */\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.js"],"names":["Platform","OS","select","spec","web","default","isWeb"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,EAAE,EAAE,KADY;AAEhBC,EAAAA,MAAM,EAAIC,IAAF,IAAc,SAASA,IAAT,GAAgBA,IAAI,CAACC,GAArB,GAA2BD,IAAI,CAACE,OAFtC;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAjB;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;eACeN,Q","sourcesContent":["/**\n * Parts of this source were derived and modified from react-native-web,\n * released under the MIT license.\n *\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n */\nconst Platform = {\n\tOS: 'web',\n\tselect: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),\n\tisWeb: true,\n};\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web enviroment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module\n *\n * Here is an example of how to use the select method:\n * @example\n * ```js\n * import { Platform } from '@wordpress/element';\n *\n * const placeholderLabel = Platform.select( {\n * native: __( 'Add media' ),\n * web: __( 'Drag images, upload new ones or select files from your library.' ),\n * } );\n * ```\n */\nexport default Platform;\n"]}
@@ -12,7 +12,9 @@ const Platform = { ...OriginalPlatform,
12
12
  }
13
13
 
14
14
  return spec.default;
15
- }
15
+ },
16
+ isNative: true,
17
+ isAndroid: true
16
18
  };
17
19
  export default Platform;
18
20
  //# sourceMappingURL=platform.android.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.android.js"],"names":["Platform","OriginalPlatform","OS","select","spec","android","native","default"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,gBAArB,QAA6C,cAA7C;AAEA,MAAMD,QAAQ,GAAG,EAChB,GAAGC,gBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,aAAaA,IAAlB,EAAyB;AACxB,aAAOA,IAAI,CAACC,OAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA;AAVe,CAAjB;AAaA,eAAeP,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'android' in spec ) {\n\t\t\treturn spec.android;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n};\n\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.android.js"],"names":["Platform","OriginalPlatform","OS","select","spec","android","native","default","isNative","isAndroid"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,gBAArB,QAA6C,cAA7C;AAEA,MAAMD,QAAQ,GAAG,EAChB,GAAGC,gBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,aAAaA,IAAlB,EAAyB;AACxB,aAAOA,IAAI,CAACC,OAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA,GAVe;AAWhBC,EAAAA,QAAQ,EAAE,IAXM;AAYhBC,EAAAA,SAAS,EAAE;AAZK,CAAjB;AAeA,eAAeT,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'android' in spec ) {\n\t\t\treturn spec.android;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n\tisNative: true,\n\tisAndroid: true,\n};\n\nexport default Platform;\n"]}
@@ -12,7 +12,9 @@ const Platform = { ...OriginalPlatform,
12
12
  }
13
13
 
14
14
  return spec.default;
15
- }
15
+ },
16
+ isNative: true,
17
+ isIOS: true
16
18
  };
17
19
  export default Platform;
18
20
  //# sourceMappingURL=platform.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.ios.js"],"names":["Platform","OriginalPlatform","OS","select","spec","ios","native","default"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,gBAArB,QAA6C,cAA7C;AAEA,MAAMD,QAAQ,GAAG,EAChB,GAAGC,gBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,SAASA,IAAd,EAAqB;AACpB,aAAOA,IAAI,CAACC,GAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA;AAVe,CAAjB;AAaA,eAAeP,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'ios' in spec ) {\n\t\t\treturn spec.ios;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n};\n\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.ios.js"],"names":["Platform","OriginalPlatform","OS","select","spec","ios","native","default","isNative","isIOS"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,gBAArB,QAA6C,cAA7C;AAEA,MAAMD,QAAQ,GAAG,EAChB,GAAGC,gBADa;AAEhBC,EAAAA,EAAE,EAAE,QAFY;AAGhBC,EAAAA,MAAM,EAAIC,IAAF,IAAY;AACnB,QAAK,SAASA,IAAd,EAAqB;AACpB,aAAOA,IAAI,CAACC,GAAZ;AACA,KAFD,MAEO,IAAK,YAAYD,IAAjB,EAAwB;AAC9B,aAAOA,IAAI,CAACE,MAAZ;AACA;;AACD,WAAOF,IAAI,CAACG,OAAZ;AACA,GAVe;AAWhBC,EAAAA,QAAQ,EAAE,IAXM;AAYhBC,EAAAA,KAAK,EAAE;AAZS,CAAjB;AAeA,eAAeT,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'ios' in spec ) {\n\t\t\treturn spec.ios;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n\tisNative: true,\n\tisIOS: true,\n};\n\nexport default Platform;\n"]}
@@ -8,7 +8,8 @@
8
8
  */
9
9
  const Platform = {
10
10
  OS: 'web',
11
- select: spec => 'web' in spec ? spec.web : spec.default
11
+ select: spec => 'web' in spec ? spec.web : spec.default,
12
+ isWeb: true
12
13
  };
13
14
  /**
14
15
  * Component used to detect the current Platform being used.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/element/src/platform.js"],"names":["Platform","OS","select","spec","web","default"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,EAAE,EAAE,KADY;AAEhBC,EAAAA,MAAM,EAAIC,IAAF,IAAc,SAASA,IAAT,GAAgBA,IAAI,CAACC,GAArB,GAA2BD,IAAI,CAACE;AAFtC,CAAjB;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeL,QAAf","sourcesContent":["/**\n * Parts of this source were derived and modified from react-native-web,\n * released under the MIT license.\n *\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n */\nconst Platform = {\n\tOS: 'web',\n\tselect: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),\n};\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web enviroment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module\n *\n * Here is an example of how to use the select method:\n * @example\n * ```js\n * import { Platform } from '@wordpress/element';\n *\n * const placeholderLabel = Platform.select( {\n * native: __( 'Add media' ),\n * web: __( 'Drag images, upload new ones or select files from your library.' ),\n * } );\n * ```\n */\nexport default Platform;\n"]}
1
+ {"version":3,"sources":["@wordpress/element/src/platform.js"],"names":["Platform","OS","select","spec","web","default","isWeb"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,EAAE,EAAE,KADY;AAEhBC,EAAAA,MAAM,EAAIC,IAAF,IAAc,SAASA,IAAT,GAAgBA,IAAI,CAACC,GAArB,GAA2BD,IAAI,CAACE,OAFtC;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAjB;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeN,QAAf","sourcesContent":["/**\n * Parts of this source were derived and modified from react-native-web,\n * released under the MIT license.\n *\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n */\nconst Platform = {\n\tOS: 'web',\n\tselect: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),\n\tisWeb: true,\n};\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web enviroment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module\n *\n * Here is an example of how to use the select method:\n * @example\n * ```js\n * import { Platform } from '@wordpress/element';\n *\n * const placeholderLabel = Platform.select( {\n * native: __( 'Add media' ),\n * web: __( 'Drag images, upload new ones or select files from your library.' ),\n * } );\n * ```\n */\nexport default Platform;\n"]}
@@ -33,7 +33,7 @@ export type Frame = {
33
33
  */
34
34
  children: WPElement[];
35
35
  };
36
- export type WPElement = import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)>) | (new (props: any) => import("react").Component<any, any, any>)>;
36
+ export type WPElement = import('./react').WPElement;
37
37
  /**
38
38
  * This function creates an interpolated element from a passed in string with
39
39
  * specific tags matching how the string should be converted to an element via
@@ -1 +1 @@
1
- {"version":3,"file":"create-interpolate-element.d.ts","sourceRoot":"","sources":["../src/create-interpolate-element.js"],"names":[],"mappings":";;;;;;;;aA+Bc,SAAS;;;;;gBACT,MAAM;;;;;iBAEN,MAAM;;;;;iBAEN,MAAM;;;;;;uBAEN,MAAM;;;;cAGN,SAAS,EAAE;;;AAyCzB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,8DANW,MAAM,uBAIL,SAAS,CAmBpB"}
1
+ {"version":3,"file":"create-interpolate-element.d.ts","sourceRoot":"","sources":["../src/create-interpolate-element.js"],"names":[],"mappings":";;;;;;;;aA+Bc,SAAS;;;;;gBACT,MAAM;;;;;iBAEN,MAAM;;;;;iBAEN,MAAM;;;;;;uBAEN,MAAM;;;;cAGN,SAAS,EAAE;;wBApCX,OAAO,SAAS,EAAE,SAAS;AA6EzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,8DANW,MAAM,uBAIL,SAAS,CAmBpB"}
@@ -2,5 +2,6 @@ export default Platform;
2
2
  declare namespace Platform {
3
3
  const OS: string;
4
4
  function select(spec: any): any;
5
+ const isWeb: boolean;
5
6
  }
6
7
  //# sourceMappingURL=platform.d.ts.map
@@ -13,5 +13,5 @@
13
13
  export default function RawHTML({ children, ...props }: RawHTMLProps): JSX.Element;
14
14
  export type RawHTMLProps = {
15
15
  children: string;
16
- } & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "color" | "style" | "translate" | "prefix" | "slot" | "title" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">;
16
+ } & import('react').ComponentPropsWithoutRef<'div'>;
17
17
  //# sourceMappingURL=raw-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"raw-html.d.ts","sourceRoot":"","sources":["../src/raw-html.js"],"names":[],"mappings":"AAMA,mGAAmG;AAEnG;;;;;;;;;;GAUG;AACH,wDALW,YAAY,GAGX,WAAW,CAStB;;cApBwB,MAAM"}
1
+ {"version":3,"file":"raw-html.d.ts","sourceRoot":"","sources":["../src/raw-html.js"],"names":[],"mappings":"AAMA,mGAAmG;AAEnG;;;;;;;;;;GAUG;AACH,wDALW,YAAY,GAGX,WAAW,CAStB;2BApBa;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,GAAG,OAAO,OAAO,EAAE,wBAAwB,CAAC,KAAK,CAAC"}
@@ -18,15 +18,15 @@ export function switchChildrenNodeName(children: any | null, nodeName: string):
18
18
  /**
19
19
  * Object containing a React element.
20
20
  */
21
- export type WPElement = import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)>;
21
+ export type WPElement = import('react').ReactElement;
22
22
  /**
23
23
  * Object containing a React component.
24
24
  */
25
- export type WPComponent = import("react").ComponentClass<{}, any> | import("react").FunctionComponent<{}>;
25
+ export type WPComponent = import('react').ComponentType;
26
26
  /**
27
27
  * Object containing a React synthetic event.
28
28
  */
29
- export type WPSyntheticEvent = import("react").SyntheticEvent<Element, Event>;
29
+ export type WPSyntheticEvent = import('react').SyntheticEvent;
30
30
  import { Children } from "react";
31
31
  import { cloneElement } from "react";
32
32
  import { Component } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.js"],"names":[],"mappings":"AAsMA;;;;;;GAMG;AACH,4EAcC;AAED;;;;;;;GAOG;AACH,uEAJW,MAAM,cAmBhB"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.js"],"names":[],"mappings":"AAsMA;;;;;;GAMG;AACH,4EAcC;AAED;;;;;;;GAOG;AACH,uEAJW,MAAM,cAmBhB;;;;wBAlNY,OAAO,OAAO,EAAE,YAAY;;;;0BAM5B,OAAO,OAAO,EAAE,aAAa;;;;+BAM7B,OAAO,OAAO,EAAE,cAAc"}
@@ -59,6 +59,6 @@ export function renderAttributes(props: any): string;
59
59
  */
60
60
  export function renderStyle(style: any): string;
61
61
  export default renderElement;
62
- export type WPComponent = import("react").ComponentClass<{}, any> | import("react").FunctionComponent<{}>;
63
- export type WPElement = import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)>) | (new (props: any) => import("react").Component<any, any, any>)>;
62
+ export type WPComponent = import('./react').WPComponent;
63
+ export type WPElement = import('./react').WPElement;
64
64
  //# sourceMappingURL=serialize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.js"],"names":[],"mappings":"AAkPA;;;;;;;;GAQG;AACH,kCALW,MAAM,YACN,MAAM,EAAE,GAEP,OAAO,CAIlB;AA8FD;;;;;;;;GAQG;AACH,uCANW,OAAO,OAAO,EAAE,SAAS,uCAIxB,MAAM,CAkFjB;AAED;;;;;;;;;;GAUG;AACH,4CARY,MAAM,0DAMN,MAAM,CAoCjB;AAED,2DAA2D;AAE3D;;;;;;;;;GASG;AACH,2CAPW,WAAW,mDAKV,MAAM,CA6BjB;AAyBD;;;;;;GAMG;AACH,8CAFY,MAAM,CAwDjB;AAED;;;;;;GAMG;AACH,yCAFY,MAAM,CA4BjB"}
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.js"],"names":[],"mappings":"AAkPA;;;;;;;;GAQG;AACH,kCALW,MAAM,YACN,MAAM,EAAE,GAEP,OAAO,CAIlB;AA8FD;;;;;;;;GAQG;AACH,uCANW,OAAO,OAAO,EAAE,SAAS,uCAIxB,MAAM,CAkFjB;AAED;;;;;;;;;;GAUG;AACH,4CARY,MAAM,0DAMN,MAAM,CAoCjB;AAED,2DAA2D;AAE3D;;;;;;;;;GASG;AACH,2CAPW,WAAW,mDAKV,MAAM,CA6BjB;AAyBD;;;;;;GAMG;AACH,8CAFY,MAAM,CAwDjB;AAED;;;;;;GAMG;AACH,yCAFY,MAAM,CA4BjB;;0BAhKa,OAAO,SAAS,EAAE,WAAW;wBA/a7B,OAAO,SAAS,EAAE,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/element",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Element React module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,7 +31,7 @@
31
31
  "@babel/runtime": "^7.13.10",
32
32
  "@types/react": "^16.9.0",
33
33
  "@types/react-dom": "^16.9.0",
34
- "@wordpress/escape-html": "^2.2.1",
34
+ "@wordpress/escape-html": "^2.2.2",
35
35
  "lodash": "^4.17.21",
36
36
  "react": "^17.0.1",
37
37
  "react-dom": "^17.0.1"
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "4e106dd6283fd742aeb521ebc0ae29f35d4274b4"
42
+ "gitHead": "8f7f052bc04e3f4eb50f479ced14be1489b9fa79"
43
43
  }
@@ -14,6 +14,8 @@ const Platform = {
14
14
  }
15
15
  return spec.default;
16
16
  },
17
+ isNative: true,
18
+ isAndroid: true,
17
19
  };
18
20
 
19
21
  export default Platform;
@@ -14,6 +14,8 @@ const Platform = {
14
14
  }
15
15
  return spec.default;
16
16
  },
17
+ isNative: true,
18
+ isIOS: true,
17
19
  };
18
20
 
19
21
  export default Platform;
package/src/platform.js CHANGED
@@ -9,6 +9,7 @@
9
9
  const Platform = {
10
10
  OS: 'web',
11
11
  select: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),
12
+ isWeb: true,
12
13
  };
13
14
  /**
14
15
  * Component used to detect the current Platform being used.