primitives.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. /******/ (function() { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 4403:
  4. /***/ (function(module, exports) {
  5. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  6. Copyright (c) 2018 Jed Watson.
  7. Licensed under the MIT License (MIT), see
  8. http://jedwatson.github.io/classnames
  9. */
  10. /* global define */
  11. (function () {
  12. 'use strict';
  13. var hasOwn = {}.hasOwnProperty;
  14. var nativeCodeString = '[native code]';
  15. function classNames() {
  16. var classes = [];
  17. for (var i = 0; i < arguments.length; i++) {
  18. var arg = arguments[i];
  19. if (!arg) continue;
  20. var argType = typeof arg;
  21. if (argType === 'string' || argType === 'number') {
  22. classes.push(arg);
  23. } else if (Array.isArray(arg)) {
  24. if (arg.length) {
  25. var inner = classNames.apply(null, arg);
  26. if (inner) {
  27. classes.push(inner);
  28. }
  29. }
  30. } else if (argType === 'object') {
  31. if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
  32. classes.push(arg.toString());
  33. continue;
  34. }
  35. for (var key in arg) {
  36. if (hasOwn.call(arg, key) && arg[key]) {
  37. classes.push(key);
  38. }
  39. }
  40. }
  41. }
  42. return classes.join(' ');
  43. }
  44. if ( true && module.exports) {
  45. classNames.default = classNames;
  46. module.exports = classNames;
  47. } else if (true) {
  48. // register as 'classnames', consistent with npm package name
  49. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  50. return classNames;
  51. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  52. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  53. } else {}
  54. }());
  55. /***/ })
  56. /******/ });
  57. /************************************************************************/
  58. /******/ // The module cache
  59. /******/ var __webpack_module_cache__ = {};
  60. /******/
  61. /******/ // The require function
  62. /******/ function __webpack_require__(moduleId) {
  63. /******/ // Check if module is in cache
  64. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  65. /******/ if (cachedModule !== undefined) {
  66. /******/ return cachedModule.exports;
  67. /******/ }
  68. /******/ // Create a new module (and put it into the cache)
  69. /******/ var module = __webpack_module_cache__[moduleId] = {
  70. /******/ // no module.id needed
  71. /******/ // no module.loaded needed
  72. /******/ exports: {}
  73. /******/ };
  74. /******/
  75. /******/ // Execute the module function
  76. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  77. /******/
  78. /******/ // Return the exports of the module
  79. /******/ return module.exports;
  80. /******/ }
  81. /******/
  82. /************************************************************************/
  83. /******/ /* webpack/runtime/compat get default export */
  84. /******/ !function() {
  85. /******/ // getDefaultExport function for compatibility with non-harmony modules
  86. /******/ __webpack_require__.n = function(module) {
  87. /******/ var getter = module && module.__esModule ?
  88. /******/ function() { return module['default']; } :
  89. /******/ function() { return module; };
  90. /******/ __webpack_require__.d(getter, { a: getter });
  91. /******/ return getter;
  92. /******/ };
  93. /******/ }();
  94. /******/
  95. /******/ /* webpack/runtime/define property getters */
  96. /******/ !function() {
  97. /******/ // define getter functions for harmony exports
  98. /******/ __webpack_require__.d = function(exports, definition) {
  99. /******/ for(var key in definition) {
  100. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  101. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  102. /******/ }
  103. /******/ }
  104. /******/ };
  105. /******/ }();
  106. /******/
  107. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  108. /******/ !function() {
  109. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  110. /******/ }();
  111. /******/
  112. /******/ /* webpack/runtime/make namespace object */
  113. /******/ !function() {
  114. /******/ // define __esModule on exports
  115. /******/ __webpack_require__.r = function(exports) {
  116. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  117. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  118. /******/ }
  119. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  120. /******/ };
  121. /******/ }();
  122. /******/
  123. /************************************************************************/
  124. var __webpack_exports__ = {};
  125. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  126. !function() {
  127. "use strict";
  128. // ESM COMPAT FLAG
  129. __webpack_require__.r(__webpack_exports__);
  130. // EXPORTS
  131. __webpack_require__.d(__webpack_exports__, {
  132. "BlockQuotation": function() { return /* reexport */ BlockQuotation; },
  133. "Circle": function() { return /* reexport */ Circle; },
  134. "Defs": function() { return /* reexport */ Defs; },
  135. "G": function() { return /* reexport */ G; },
  136. "HorizontalRule": function() { return /* reexport */ HorizontalRule; },
  137. "LinearGradient": function() { return /* reexport */ LinearGradient; },
  138. "Path": function() { return /* reexport */ Path; },
  139. "Polygon": function() { return /* reexport */ Polygon; },
  140. "RadialGradient": function() { return /* reexport */ RadialGradient; },
  141. "Rect": function() { return /* reexport */ Rect; },
  142. "SVG": function() { return /* reexport */ SVG; },
  143. "Stop": function() { return /* reexport */ Stop; },
  144. "View": function() { return /* reexport */ View; }
  145. });
  146. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  147. var classnames = __webpack_require__(4403);
  148. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  149. ;// CONCATENATED MODULE: external ["wp","element"]
  150. var external_wp_element_namespaceObject = window["wp"]["element"];
  151. ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/svg/index.js
  152. /**
  153. * External dependencies
  154. */
  155. /**
  156. * WordPress dependencies
  157. */
  158. /** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */
  159. /**
  160. * @param {import('react').ComponentPropsWithoutRef<'circle'>} props
  161. *
  162. * @return {JSX.Element} Circle component
  163. */
  164. const Circle = props => (0,external_wp_element_namespaceObject.createElement)('circle', props);
  165. /**
  166. * @param {import('react').ComponentPropsWithoutRef<'g'>} props
  167. *
  168. * @return {JSX.Element} G component
  169. */
  170. const G = props => (0,external_wp_element_namespaceObject.createElement)('g', props);
  171. /**
  172. * @param {import('react').ComponentPropsWithoutRef<'path'>} props
  173. *
  174. * @return {JSX.Element} Path component
  175. */
  176. const Path = props => (0,external_wp_element_namespaceObject.createElement)('path', props);
  177. /**
  178. * @param {import('react').ComponentPropsWithoutRef<'polygon'>} props
  179. *
  180. * @return {JSX.Element} Polygon component
  181. */
  182. const Polygon = props => (0,external_wp_element_namespaceObject.createElement)('polygon', props);
  183. /**
  184. * @param {import('react').ComponentPropsWithoutRef<'rect'>} props
  185. *
  186. * @return {JSX.Element} Rect component
  187. */
  188. const Rect = props => (0,external_wp_element_namespaceObject.createElement)('rect', props);
  189. /**
  190. * @param {import('react').ComponentPropsWithoutRef<'defs'>} props
  191. *
  192. * @return {JSX.Element} Defs component
  193. */
  194. const Defs = props => (0,external_wp_element_namespaceObject.createElement)('defs', props);
  195. /**
  196. * @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props
  197. *
  198. * @return {JSX.Element} RadialGradient component
  199. */
  200. const RadialGradient = props => (0,external_wp_element_namespaceObject.createElement)('radialGradient', props);
  201. /**
  202. * @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props
  203. *
  204. * @return {JSX.Element} LinearGradient component
  205. */
  206. const LinearGradient = props => (0,external_wp_element_namespaceObject.createElement)('linearGradient', props);
  207. /**
  208. * @param {import('react').ComponentPropsWithoutRef<'stop'>} props
  209. *
  210. * @return {JSX.Element} Stop component
  211. */
  212. const Stop = props => (0,external_wp_element_namespaceObject.createElement)('stop', props);
  213. /**
  214. *
  215. * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
  216. * Other props will be passed through to svg component.
  217. *
  218. * @return {JSX.Element} Stop component
  219. */
  220. const SVG = _ref => {
  221. let {
  222. className,
  223. isPressed,
  224. ...props
  225. } = _ref;
  226. const appliedProps = { ...props,
  227. className: classnames_default()(className, {
  228. 'is-pressed': isPressed
  229. }) || undefined,
  230. 'aria-hidden': true,
  231. focusable: false
  232. }; // Disable reason: We need to have a way to render HTML tag for web.
  233. // eslint-disable-next-line react/forbid-elements
  234. return (0,external_wp_element_namespaceObject.createElement)("svg", appliedProps);
  235. };
  236. ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/horizontal-rule/index.js
  237. const HorizontalRule = 'hr';
  238. ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/block-quotation/index.js
  239. const BlockQuotation = 'blockquote';
  240. ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/view/index.js
  241. const View = 'div';
  242. ;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/index.js
  243. }();
  244. (window.wp = window.wp || {}).primitives = __webpack_exports__;
  245. /******/ })()
  246. ;