Ei kuvausta

primitives.js 9.0KB

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