PluginProbe
Gutenberg / 16.2.0
Gutenberg v16.2.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / build / primitives / index.js

index.js in Gutenberg 16.2.0, at build/primitives/index.js

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