1 this["wp"] = this["wp"] || {}; this["wp"]["formatLibrary"] = |
1 /******/ (function() { // webpackBootstrap |
2 /******/ (function(modules) { // webpackBootstrap |
2 /******/ "use strict"; |
3 /******/ // The module cache |
3 /******/ // The require scope |
4 /******/ var installedModules = {}; |
4 /******/ var __webpack_require__ = {}; |
5 /******/ |
5 /******/ |
6 /******/ // The require function |
6 /************************************************************************/ |
7 /******/ function __webpack_require__(moduleId) { |
7 /******/ /* webpack/runtime/make namespace object */ |
8 /******/ |
8 /******/ !function() { |
9 /******/ // Check if module is in cache |
9 /******/ // define __esModule on exports |
10 /******/ if(installedModules[moduleId]) { |
10 /******/ __webpack_require__.r = function(exports) { |
11 /******/ return installedModules[moduleId].exports; |
11 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
12 /******/ } |
12 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
13 /******/ // Create a new module (and put it into the cache) |
13 /******/ } |
14 /******/ var module = installedModules[moduleId] = { |
14 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
15 /******/ i: moduleId, |
|
16 /******/ l: false, |
|
17 /******/ exports: {} |
|
18 /******/ }; |
15 /******/ }; |
19 /******/ |
16 /******/ }(); |
20 /******/ // Execute the module function |
17 /******/ |
21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|
22 /******/ |
|
23 /******/ // Flag the module as loaded |
|
24 /******/ module.l = true; |
|
25 /******/ |
|
26 /******/ // Return the exports of the module |
|
27 /******/ return module.exports; |
|
28 /******/ } |
|
29 /******/ |
|
30 /******/ |
|
31 /******/ // expose the modules object (__webpack_modules__) |
|
32 /******/ __webpack_require__.m = modules; |
|
33 /******/ |
|
34 /******/ // expose the module cache |
|
35 /******/ __webpack_require__.c = installedModules; |
|
36 /******/ |
|
37 /******/ // define getter function for harmony exports |
|
38 /******/ __webpack_require__.d = function(exports, name, getter) { |
|
39 /******/ if(!__webpack_require__.o(exports, name)) { |
|
40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
41 /******/ } |
|
42 /******/ }; |
|
43 /******/ |
|
44 /******/ // define __esModule on exports |
|
45 /******/ __webpack_require__.r = function(exports) { |
|
46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
48 /******/ } |
|
49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
50 /******/ }; |
|
51 /******/ |
|
52 /******/ // create a fake namespace object |
|
53 /******/ // mode & 1: value is a module id, require it |
|
54 /******/ // mode & 2: merge all properties of value into the ns |
|
55 /******/ // mode & 4: return value when already ns object |
|
56 /******/ // mode & 8|1: behave like require |
|
57 /******/ __webpack_require__.t = function(value, mode) { |
|
58 /******/ if(mode & 1) value = __webpack_require__(value); |
|
59 /******/ if(mode & 8) return value; |
|
60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
61 /******/ var ns = Object.create(null); |
|
62 /******/ __webpack_require__.r(ns); |
|
63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
65 /******/ return ns; |
|
66 /******/ }; |
|
67 /******/ |
|
68 /******/ // getDefaultExport function for compatibility with non-harmony modules |
|
69 /******/ __webpack_require__.n = function(module) { |
|
70 /******/ var getter = module && module.__esModule ? |
|
71 /******/ function getDefault() { return module['default']; } : |
|
72 /******/ function getModuleExports() { return module; }; |
|
73 /******/ __webpack_require__.d(getter, 'a', getter); |
|
74 /******/ return getter; |
|
75 /******/ }; |
|
76 /******/ |
|
77 /******/ // Object.prototype.hasOwnProperty.call |
|
78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
79 /******/ |
|
80 /******/ // __webpack_public_path__ |
|
81 /******/ __webpack_require__.p = ""; |
|
82 /******/ |
|
83 /******/ |
|
84 /******/ // Load entry module and return exports |
|
85 /******/ return __webpack_require__(__webpack_require__.s = "t1DA"); |
|
86 /******/ }) |
|
87 /************************************************************************/ |
18 /************************************************************************/ |
88 /******/ ({ |
19 var __webpack_exports__ = {}; |
89 |
20 // ESM COMPAT FLAG |
90 /***/ "1Yn1": |
21 __webpack_require__.r(__webpack_exports__); |
91 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
22 |
92 |
23 ;// CONCATENATED MODULE: external ["wp","richText"] |
93 "use strict"; |
24 var external_wp_richText_namespaceObject = window["wp"]["richText"]; |
94 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
25 ;// CONCATENATED MODULE: external ["wp","element"] |
95 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
26 var external_wp_element_namespaceObject = window["wp"]["element"]; |
96 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
27 ;// CONCATENATED MODULE: external ["wp","i18n"] |
97 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
28 var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
98 |
29 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
99 |
30 var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
100 /** |
31 ;// CONCATENATED MODULE: external ["wp","primitives"] |
101 * WordPress dependencies |
32 var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
102 */ |
33 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js |
103 |
34 |
104 const code = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
35 |
105 viewBox: "0 0 24 24", |
36 /** |
106 xmlns: "http://www.w3.org/2000/svg" |
37 * WordPress dependencies |
107 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
38 */ |
108 d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" |
39 |
109 })); |
40 const formatBold = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
110 /* harmony default export */ __webpack_exports__["a"] = (code); |
|
111 |
|
112 |
|
113 /***/ }), |
|
114 |
|
115 /***/ "1ZqX": |
|
116 /***/ (function(module, exports) { |
|
117 |
|
118 (function() { module.exports = window["wp"]["data"]; }()); |
|
119 |
|
120 /***/ }), |
|
121 |
|
122 /***/ "Bpkj": |
|
123 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
124 |
|
125 "use strict"; |
|
126 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
127 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
128 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
|
129 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
130 |
|
131 |
|
132 /** |
|
133 * WordPress dependencies |
|
134 */ |
|
135 |
|
136 const link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
137 xmlns: "http://www.w3.org/2000/svg", |
41 xmlns: "http://www.w3.org/2000/svg", |
138 viewBox: "0 0 24 24" |
42 viewBox: "0 0 24 24" |
139 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
43 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
140 d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" |
|
141 })); |
|
142 /* harmony default export */ __webpack_exports__["a"] = (link); |
|
143 |
|
144 |
|
145 /***/ }), |
|
146 |
|
147 /***/ "Crq9": |
|
148 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
149 |
|
150 "use strict"; |
|
151 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
152 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
153 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
|
154 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
155 |
|
156 |
|
157 /** |
|
158 * WordPress dependencies |
|
159 */ |
|
160 |
|
161 const formatStrikethrough = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
162 xmlns: "http://www.w3.org/2000/svg", |
|
163 viewBox: "0 0 24 24" |
|
164 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
165 d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" |
|
166 })); |
|
167 /* harmony default export */ __webpack_exports__["a"] = (formatStrikethrough); |
|
168 |
|
169 |
|
170 /***/ }), |
|
171 |
|
172 /***/ "GRId": |
|
173 /***/ (function(module, exports) { |
|
174 |
|
175 (function() { module.exports = window["wp"]["element"]; }()); |
|
176 |
|
177 /***/ }), |
|
178 |
|
179 /***/ "Mmq9": |
|
180 /***/ (function(module, exports) { |
|
181 |
|
182 (function() { module.exports = window["wp"]["url"]; }()); |
|
183 |
|
184 /***/ }), |
|
185 |
|
186 /***/ "Mp0b": |
|
187 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
188 |
|
189 "use strict"; |
|
190 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
191 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
192 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
|
193 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
194 |
|
195 |
|
196 /** |
|
197 * WordPress dependencies |
|
198 */ |
|
199 |
|
200 const linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
201 xmlns: "http://www.w3.org/2000/svg", |
|
202 viewBox: "0 0 24 24" |
|
203 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
204 d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" |
|
205 })); |
|
206 /* harmony default export */ __webpack_exports__["a"] = (linkOff); |
|
207 |
|
208 |
|
209 /***/ }), |
|
210 |
|
211 /***/ "Tqx9": |
|
212 /***/ (function(module, exports) { |
|
213 |
|
214 (function() { module.exports = window["wp"]["primitives"]; }()); |
|
215 |
|
216 /***/ }), |
|
217 |
|
218 /***/ "YLtl": |
|
219 /***/ (function(module, exports) { |
|
220 |
|
221 (function() { module.exports = window["lodash"]; }()); |
|
222 |
|
223 /***/ }), |
|
224 |
|
225 /***/ "axFQ": |
|
226 /***/ (function(module, exports) { |
|
227 |
|
228 (function() { module.exports = window["wp"]["blockEditor"]; }()); |
|
229 |
|
230 /***/ }), |
|
231 |
|
232 /***/ "btIw": |
|
233 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
234 |
|
235 "use strict"; |
|
236 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
237 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
238 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
|
239 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
240 |
|
241 |
|
242 /** |
|
243 * WordPress dependencies |
|
244 */ |
|
245 |
|
246 const keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
247 xmlns: "http://www.w3.org/2000/svg", |
|
248 viewBox: "-2 -2 24 24" |
|
249 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
250 d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z" |
|
251 })); |
|
252 /* harmony default export */ __webpack_exports__["a"] = (keyboardReturn); |
|
253 |
|
254 |
|
255 /***/ }), |
|
256 |
|
257 /***/ "gdqT": |
|
258 /***/ (function(module, exports) { |
|
259 |
|
260 (function() { module.exports = window["wp"]["a11y"]; }()); |
|
261 |
|
262 /***/ }), |
|
263 |
|
264 /***/ "iClF": |
|
265 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
266 |
|
267 "use strict"; |
|
268 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
269 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
270 /** |
|
271 * WordPress dependencies |
|
272 */ |
|
273 |
|
274 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ |
|
275 |
|
276 /** |
|
277 * Return an SVG icon. |
|
278 * |
|
279 * @param {IconProps} props icon is the SVG component to render |
|
280 * size is a number specifiying the icon size in pixels |
|
281 * Other props will be passed to wrapped SVG component |
|
282 * |
|
283 * @return {JSX.Element} Icon component |
|
284 */ |
|
285 |
|
286 function Icon({ |
|
287 icon, |
|
288 size = 24, |
|
289 ...props |
|
290 }) { |
|
291 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, { |
|
292 width: size, |
|
293 height: size, |
|
294 ...props |
|
295 }); |
|
296 } |
|
297 |
|
298 /* harmony default export */ __webpack_exports__["a"] = (Icon); |
|
299 |
|
300 |
|
301 /***/ }), |
|
302 |
|
303 /***/ "l3Sj": |
|
304 /***/ (function(module, exports) { |
|
305 |
|
306 (function() { module.exports = window["wp"]["i18n"]; }()); |
|
307 |
|
308 /***/ }), |
|
309 |
|
310 /***/ "oMoS": |
|
311 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
312 |
|
313 "use strict"; |
|
314 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); |
|
315 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
316 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); |
|
317 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
318 |
|
319 |
|
320 /** |
|
321 * WordPress dependencies |
|
322 */ |
|
323 |
|
324 const button = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
325 viewBox: "0 0 24 24", |
|
326 xmlns: "http://www.w3.org/2000/svg" |
|
327 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
328 d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z" |
|
329 })); |
|
330 /* harmony default export */ __webpack_exports__["a"] = (button); |
|
331 |
|
332 |
|
333 /***/ }), |
|
334 |
|
335 /***/ "qRz9": |
|
336 /***/ (function(module, exports) { |
|
337 |
|
338 (function() { module.exports = window["wp"]["richText"]; }()); |
|
339 |
|
340 /***/ }), |
|
341 |
|
342 /***/ "rmEH": |
|
343 /***/ (function(module, exports) { |
|
344 |
|
345 (function() { module.exports = window["wp"]["htmlEntities"]; }()); |
|
346 |
|
347 /***/ }), |
|
348 |
|
349 /***/ "t1DA": |
|
350 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
351 |
|
352 "use strict"; |
|
353 // ESM COMPAT FLAG |
|
354 __webpack_require__.r(__webpack_exports__); |
|
355 |
|
356 // EXTERNAL MODULE: external ["wp","richText"] |
|
357 var external_wp_richText_ = __webpack_require__("qRz9"); |
|
358 |
|
359 // EXTERNAL MODULE: external ["wp","element"] |
|
360 var external_wp_element_ = __webpack_require__("GRId"); |
|
361 |
|
362 // EXTERNAL MODULE: external ["wp","i18n"] |
|
363 var external_wp_i18n_ = __webpack_require__("l3Sj"); |
|
364 |
|
365 // EXTERNAL MODULE: external ["wp","blockEditor"] |
|
366 var external_wp_blockEditor_ = __webpack_require__("axFQ"); |
|
367 |
|
368 // EXTERNAL MODULE: external ["wp","primitives"] |
|
369 var external_wp_primitives_ = __webpack_require__("Tqx9"); |
|
370 |
|
371 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js |
|
372 |
|
373 |
|
374 /** |
|
375 * WordPress dependencies |
|
376 */ |
|
377 |
|
378 const formatBold = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { |
|
379 xmlns: "http://www.w3.org/2000/svg", |
|
380 viewBox: "0 0 24 24" |
|
381 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { |
|
382 d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" |
44 d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" |
383 })); |
45 })); |
384 /* harmony default export */ var format_bold = (formatBold); |
46 /* harmony default export */ var format_bold = (formatBold); |
385 |
47 |
386 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js |
48 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js |
387 |
49 |
388 |
50 |
389 /** |
51 /** |
390 * WordPress dependencies |
52 * WordPress dependencies |
391 */ |
53 */ |
557 alt: 'alt' |
251 alt: 'alt' |
558 }, |
252 }, |
559 edit: Edit |
253 edit: Edit |
560 }; |
254 }; |
561 |
255 |
562 function InlineUI({ |
256 function InlineUI(_ref) { |
563 value, |
257 let { |
564 onChange, |
258 value, |
565 activeObjectAttributes, |
259 onChange, |
566 contentRef |
260 activeObjectAttributes, |
567 }) { |
261 contentRef |
|
262 } = _ref; |
568 const { |
263 const { |
569 style |
264 style |
570 } = activeObjectAttributes; |
265 } = activeObjectAttributes; |
571 const [width, setWidth] = Object(external_wp_element_["useState"])(style === null || style === void 0 ? void 0 : style.replace(/\D/g, '')); |
266 const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(style === null || style === void 0 ? void 0 : style.replace(/\D/g, '')); |
572 const anchorRef = Object(external_wp_richText_["useAnchorRef"])({ |
267 const anchorRef = (0,external_wp_richText_namespaceObject.useAnchorRef)({ |
573 ref: contentRef, |
268 ref: contentRef, |
574 value, |
269 value, |
575 settings: image_image |
270 settings: image_image |
576 }); |
271 }); |
577 return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { |
272 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { |
578 position: "bottom center", |
273 position: "bottom center", |
579 focusOnMount: false, |
274 focusOnMount: false, |
580 anchorRef: anchorRef, |
275 anchorRef: anchorRef, |
581 className: "block-editor-format-toolbar__image-popover" |
276 className: "block-editor-format-toolbar__image-popover" |
582 }, Object(external_wp_element_["createElement"])("form", { |
277 }, (0,external_wp_element_namespaceObject.createElement)("form", { |
583 className: "block-editor-format-toolbar__image-container-content", |
278 className: "block-editor-format-toolbar__image-container-content", |
584 onSubmit: event => { |
279 onSubmit: event => { |
585 const newReplacements = value.replacements.slice(); |
280 const newReplacements = value.replacements.slice(); |
586 newReplacements[value.start] = { |
281 newReplacements[value.start] = { |
587 type: image_name, |
282 type: image_name, |
588 attributes: { ...activeObjectAttributes, |
283 attributes: { ...activeObjectAttributes, |
589 style: `width: ${width}px;` |
284 style: width ? `width: ${width}px;` : '' |
590 } |
285 } |
591 }; |
286 }; |
592 onChange({ ...value, |
287 onChange({ ...value, |
593 replacements: newReplacements |
288 replacements: newReplacements |
594 }); |
289 }); |
595 event.preventDefault(); |
290 event.preventDefault(); |
596 } |
291 } |
597 }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { |
292 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, { |
598 className: "block-editor-format-toolbar__image-container-value", |
293 className: "block-editor-format-toolbar__image-container-value", |
599 type: "number", |
294 type: "number", |
600 label: Object(external_wp_i18n_["__"])('Width'), |
295 label: (0,external_wp_i18n_namespaceObject.__)('Width'), |
601 value: width, |
296 value: width, |
602 min: 1, |
297 min: 1, |
603 onChange: newWidth => setWidth(newWidth) |
298 onChange: newWidth => setWidth(newWidth) |
604 }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { |
299 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
605 icon: keyboard_return["a" /* default */], |
300 icon: keyboard_return, |
606 label: Object(external_wp_i18n_["__"])('Apply'), |
301 label: (0,external_wp_i18n_namespaceObject.__)('Apply'), |
607 type: "submit" |
302 type: "submit" |
608 }))); |
303 }))); |
609 } |
304 } |
610 |
305 |
611 function Edit({ |
306 function Edit(_ref2) { |
612 value, |
307 let { |
613 onChange, |
308 value, |
614 onFocus, |
309 onChange, |
615 isObjectActive, |
310 onFocus, |
616 activeObjectAttributes, |
311 isObjectActive, |
617 contentRef |
312 activeObjectAttributes, |
618 }) { |
313 contentRef |
619 const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false); |
314 } = _ref2; |
|
315 const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); |
620 |
316 |
621 function openModal() { |
317 function openModal() { |
622 setIsModalOpen(true); |
318 setIsModalOpen(true); |
623 } |
319 } |
624 |
320 |
625 function closeModal() { |
321 function closeModal() { |
626 setIsModalOpen(false); |
322 setIsModalOpen(false); |
627 } |
323 } |
628 |
324 |
629 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
325 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
630 icon: Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], { |
326 icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, { |
631 xmlns: "http://www.w3.org/2000/svg", |
327 xmlns: "http://www.w3.org/2000/svg", |
632 viewBox: "0 0 24 24" |
328 viewBox: "0 0 24 24" |
633 }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], { |
329 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, { |
634 d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" |
330 d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" |
635 })), |
331 })), |
636 title: image_title, |
332 title: image_title, |
637 onClick: openModal, |
333 onClick: openModal, |
638 isActive: isObjectActive |
334 isActive: isObjectActive |
639 }), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], { |
335 }), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, { |
640 allowedTypes: ALLOWED_MEDIA_TYPES, |
336 allowedTypes: ALLOWED_MEDIA_TYPES, |
641 onSelect: ({ |
337 onSelect: _ref3 => { |
642 id, |
338 let { |
643 url, |
339 id, |
644 alt, |
340 url, |
645 width: imgWidth |
341 alt, |
646 }) => { |
342 width: imgWidth |
|
343 } = _ref3; |
647 closeModal(); |
344 closeModal(); |
648 onChange(Object(external_wp_richText_["insertObject"])(value, { |
345 onChange((0,external_wp_richText_namespaceObject.insertObject)(value, { |
649 type: image_name, |
346 type: image_name, |
650 attributes: { |
347 attributes: { |
651 className: `wp-image-${id}`, |
348 className: `wp-image-${id}`, |
652 style: `width: ${Math.min(imgWidth, 150)}px;`, |
349 style: `width: ${Math.min(imgWidth, 150)}px;`, |
653 url, |
350 url, |
696 |
394 |
697 |
395 |
698 |
396 |
699 const italic_name = 'core/italic'; |
397 const italic_name = 'core/italic'; |
700 |
398 |
701 const italic_title = Object(external_wp_i18n_["__"])('Italic'); |
399 const italic_title = (0,external_wp_i18n_namespaceObject.__)('Italic'); |
702 |
400 |
703 const italic = { |
401 const italic = { |
704 name: italic_name, |
402 name: italic_name, |
705 title: italic_title, |
403 title: italic_title, |
706 tagName: 'em', |
404 tagName: 'em', |
707 className: null, |
405 className: null, |
708 |
406 |
709 edit({ |
407 edit(_ref) { |
710 isActive, |
408 let { |
711 value, |
409 isActive, |
712 onChange, |
410 value, |
713 onFocus |
411 onChange, |
714 }) { |
412 onFocus |
|
413 } = _ref; |
|
414 |
715 function onToggle() { |
415 function onToggle() { |
716 onChange(Object(external_wp_richText_["toggleFormat"])(value, { |
416 onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { |
|
417 type: italic_name, |
|
418 title: italic_title |
|
419 })); |
|
420 } |
|
421 |
|
422 function onClick() { |
|
423 onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { |
717 type: italic_name |
424 type: italic_name |
718 })); |
425 })); |
719 } |
|
720 |
|
721 function onClick() { |
|
722 onToggle(); |
|
723 onFocus(); |
426 onFocus(); |
724 } |
427 } |
725 |
428 |
726 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], { |
429 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
727 type: "primary", |
430 type: "primary", |
728 character: "i", |
431 character: "i", |
729 onUse: onToggle |
432 onUse: onToggle |
730 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
433 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
731 name: "italic", |
434 name: "italic", |
732 icon: format_italic, |
435 icon: format_italic, |
733 title: italic_title, |
436 title: italic_title, |
734 onClick: onClick, |
437 onClick: onClick, |
735 isActive: isActive, |
438 isActive: isActive, |
736 shortcutType: "primary", |
439 shortcutType: "primary", |
737 shortcutCharacter: "i" |
440 shortcutCharacter: "i" |
738 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableRichTextInputEvent"], { |
441 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, { |
739 inputType: "formatItalic", |
442 inputType: "formatItalic", |
740 onInput: onToggle |
443 onInput: onToggle |
741 })); |
444 })); |
742 } |
445 } |
743 |
446 |
744 }; |
447 }; |
745 |
448 |
746 // EXTERNAL MODULE: external ["wp","url"] |
449 ;// CONCATENATED MODULE: external ["wp","url"] |
747 var external_wp_url_ = __webpack_require__("Mmq9"); |
450 var external_wp_url_namespaceObject = window["wp"]["url"]; |
748 |
451 ;// CONCATENATED MODULE: external ["wp","htmlEntities"] |
749 // EXTERNAL MODULE: external ["wp","htmlEntities"] |
452 var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; |
750 var external_wp_htmlEntities_ = __webpack_require__("rmEH"); |
453 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js |
751 |
454 |
752 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js |
455 |
753 var link_off = __webpack_require__("Mp0b"); |
456 /** |
754 |
457 * WordPress dependencies |
755 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js |
458 */ |
756 var library_link = __webpack_require__("Bpkj"); |
459 |
757 |
460 const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
758 // EXTERNAL MODULE: external ["wp","a11y"] |
461 xmlns: "http://www.w3.org/2000/svg", |
759 var external_wp_a11y_ = __webpack_require__("gdqT"); |
462 viewBox: "0 0 24 24" |
760 |
463 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
761 // EXTERNAL MODULE: external "lodash" |
464 d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" |
762 var external_lodash_ = __webpack_require__("YLtl"); |
465 })); |
763 |
466 /* harmony default export */ var link_off = (linkOff); |
764 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js |
467 |
|
468 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js |
|
469 |
|
470 |
|
471 /** |
|
472 * WordPress dependencies |
|
473 */ |
|
474 |
|
475 const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
476 xmlns: "http://www.w3.org/2000/svg", |
|
477 viewBox: "0 0 24 24" |
|
478 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
|
479 d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" |
|
480 })); |
|
481 /* harmony default export */ var library_link = (link_link); |
|
482 |
|
483 ;// CONCATENATED MODULE: external ["wp","a11y"] |
|
484 var external_wp_a11y_namespaceObject = window["wp"]["a11y"]; |
|
485 ;// CONCATENATED MODULE: external ["wp","data"] |
|
486 var external_wp_data_namespaceObject = window["wp"]["data"]; |
|
487 ;// CONCATENATED MODULE: external "lodash" |
|
488 var external_lodash_namespaceObject = window["lodash"]; |
|
489 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js |
765 /** |
490 /** |
766 * External dependencies |
491 * External dependencies |
767 */ |
492 */ |
768 |
493 |
769 /** |
494 /** |
868 format.attributes.rel = 'noreferrer noopener'; |
594 format.attributes.rel = 'noreferrer noopener'; |
869 } |
595 } |
870 |
596 |
871 return format; |
597 return format; |
872 } |
598 } |
873 |
599 /* eslint-disable jsdoc/no-undefined-types */ |
874 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js |
600 |
875 |
601 /** |
876 |
602 * Get the start and end boundaries of a given format from a rich text value. |
877 /** |
603 * |
878 * WordPress dependencies |
604 * |
879 */ |
605 * @param {RichTextValue} value the rich text value to interrogate. |
|
606 * @param {string} format the identifier for the target format (e.g. `core/link`, `core/bold`). |
|
607 * @param {number?} startIndex optional startIndex to seek from. |
|
608 * @param {number?} endIndex optional endIndex to seek from. |
|
609 * @return {Object} object containing start and end values for the given format. |
|
610 */ |
|
611 |
|
612 /* eslint-enable jsdoc/no-undefined-types */ |
|
613 |
|
614 function getFormatBoundary(value, format) { |
|
615 let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start; |
|
616 let endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end; |
|
617 const EMPTY_BOUNDARIES = { |
|
618 start: null, |
|
619 end: null |
|
620 }; |
|
621 const { |
|
622 formats |
|
623 } = value; |
|
624 let targetFormat; |
|
625 let initialIndex; |
|
626 |
|
627 if (!(formats !== null && formats !== void 0 && formats.length)) { |
|
628 return EMPTY_BOUNDARIES; |
|
629 } // Clone formats to avoid modifying source formats. |
|
630 |
|
631 |
|
632 const newFormats = formats.slice(); |
|
633 const formatAtStart = (0,external_lodash_namespaceObject.find)(newFormats[startIndex], { |
|
634 type: format.type |
|
635 }); |
|
636 const formatAtEnd = (0,external_lodash_namespaceObject.find)(newFormats[endIndex], { |
|
637 type: format.type |
|
638 }); |
|
639 const formatAtEndMinusOne = (0,external_lodash_namespaceObject.find)(newFormats[endIndex - 1], { |
|
640 type: format.type |
|
641 }); |
|
642 |
|
643 if (!!formatAtStart) { |
|
644 // Set values to conform to "start" |
|
645 targetFormat = formatAtStart; |
|
646 initialIndex = startIndex; |
|
647 } else if (!!formatAtEnd) { |
|
648 // Set values to conform to "end" |
|
649 targetFormat = formatAtEnd; |
|
650 initialIndex = endIndex; |
|
651 } else if (!!formatAtEndMinusOne) { |
|
652 // This is an edge case which will occur if you create a format, then place |
|
653 // the caret just before the format and hit the back ARROW key. The resulting |
|
654 // value object will have start and end +1 beyond the edge of the format boundary. |
|
655 targetFormat = formatAtEndMinusOne; |
|
656 initialIndex = endIndex - 1; |
|
657 } else { |
|
658 return EMPTY_BOUNDARIES; |
|
659 } |
|
660 |
|
661 const index = newFormats[initialIndex].indexOf(targetFormat); |
|
662 const walkingArgs = [newFormats, initialIndex, targetFormat, index]; // Walk the startIndex "backwards" to the leading "edge" of the matching format. |
|
663 |
|
664 startIndex = walkToStart(...walkingArgs); // Walk the endIndex "forwards" until the trailing "edge" of the matching format. |
|
665 |
|
666 endIndex = walkToEnd(...walkingArgs); // Safe guard: start index cannot be less than 0. |
|
667 |
|
668 startIndex = startIndex < 0 ? 0 : startIndex; // // Return the indicies of the "edges" as the boundaries. |
|
669 |
|
670 return { |
|
671 start: startIndex, |
|
672 end: endIndex |
|
673 }; |
|
674 } |
|
675 /** |
|
676 * Walks forwards/backwards towards the boundary of a given format within an |
|
677 * array of format objects. Returns the index of the boundary. |
|
678 * |
|
679 * @param {Array} formats the formats to search for the given format type. |
|
680 * @param {number} initialIndex the starting index from which to walk. |
|
681 * @param {Object} targetFormatRef a reference to the format type object being sought. |
|
682 * @param {number} formatIndex the index at which we expect the target format object to be. |
|
683 * @param {string} direction either 'forwards' or 'backwards' to indicate the direction. |
|
684 * @return {number} the index of the boundary of the given format. |
|
685 */ |
|
686 |
|
687 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) { |
|
688 let index = initialIndex; |
|
689 const directions = { |
|
690 forwards: 1, |
|
691 backwards: -1 |
|
692 }; |
|
693 const directionIncrement = directions[direction] || 1; // invalid direction arg default to forwards |
|
694 |
|
695 const inverseDirectionIncrement = directionIncrement * -1; |
|
696 |
|
697 while (formats[index] && formats[index][formatIndex] === targetFormatRef) { |
|
698 // Increment/decrement in the direction of operation. |
|
699 index = index + directionIncrement; |
|
700 } // Restore by one in inverse direction of operation |
|
701 // to avoid out of bounds. |
|
702 |
|
703 |
|
704 index = index + inverseDirectionIncrement; |
|
705 return index; |
|
706 } |
|
707 |
|
708 const walkToStart = (0,external_lodash_namespaceObject.partialRight)(walkToBoundary, 'backwards'); |
|
709 const walkToEnd = (0,external_lodash_namespaceObject.partialRight)(walkToBoundary, 'forwards'); |
|
710 |
|
711 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/use-link-instance-key.js |
|
712 // Weakly referenced map allows unused ids to be garbage collected. |
|
713 const weakMap = new WeakMap(); // Incrementing zero-based ID value. |
|
714 |
|
715 let id = -1; |
|
716 const prefix = 'link-control-instance'; |
|
717 |
|
718 function getKey(_id) { |
|
719 return `${prefix}-${_id}`; |
|
720 } |
|
721 /** |
|
722 * Builds a unique link control key for the given object reference. |
|
723 * |
|
724 * @param {Object} instance an unique object reference specific to this link control instance. |
|
725 * @return {string} the unique key to use for this link control. |
|
726 */ |
|
727 |
|
728 |
|
729 function useLinkInstanceKey(instance) { |
|
730 if (!instance) { |
|
731 return; |
|
732 } |
|
733 |
|
734 if (weakMap.has(instance)) { |
|
735 return getKey(weakMap.get(instance)); |
|
736 } |
|
737 |
|
738 id += 1; |
|
739 weakMap.set(instance, id); |
|
740 return getKey(id); |
|
741 } |
|
742 |
|
743 /* harmony default export */ var use_link_instance_key = (useLinkInstanceKey); |
|
744 |
|
745 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js |
|
746 |
|
747 |
|
748 /** |
|
749 * WordPress dependencies |
|
750 */ |
|
751 |
880 |
752 |
881 |
753 |
882 |
754 |
883 |
755 |
884 |
756 |
936 |
837 |
937 if (didToggleSettingForNewLink) { |
838 if (didToggleSettingForNewLink) { |
938 return; |
839 return; |
939 } |
840 } |
940 |
841 |
941 const newUrl = Object(external_wp_url_["prependHTTP"])(nextValue.url); |
842 const newUrl = (0,external_wp_url_namespaceObject.prependHTTP)(nextValue.url); |
942 const format = createLinkFormat({ |
843 const linkFormat = createLinkFormat({ |
943 url: newUrl, |
844 url: newUrl, |
944 type: nextValue.type, |
845 type: nextValue.type, |
945 id: nextValue.id !== undefined && nextValue.id !== null ? String(nextValue.id) : undefined, |
846 id: nextValue.id !== undefined && nextValue.id !== null ? String(nextValue.id) : undefined, |
946 opensInNewWindow: nextValue.opensInNewTab |
847 opensInNewWindow: nextValue.opensInNewTab |
947 }); |
848 }); |
948 |
849 const newText = nextValue.title || newUrl; |
949 if (Object(external_wp_richText_["isCollapsed"])(value) && !isActive) { |
850 |
950 const newText = nextValue.title || newUrl; |
851 if ((0,external_wp_richText_namespaceObject.isCollapsed)(value) && !isActive) { |
951 const toInsert = Object(external_wp_richText_["applyFormat"])(Object(external_wp_richText_["create"])({ |
852 // Scenario: we don't have any actively selected text or formats. |
|
853 const toInsert = (0,external_wp_richText_namespaceObject.applyFormat)((0,external_wp_richText_namespaceObject.create)({ |
952 text: newText |
854 text: newText |
953 }), format, 0, newText.length); |
855 }), linkFormat, 0, newText.length); |
954 onChange(Object(external_wp_richText_["insert"])(value, toInsert)); |
856 onChange((0,external_wp_richText_namespaceObject.insert)(value, toInsert)); |
955 } else { |
857 } else { |
956 const newValue = Object(external_wp_richText_["applyFormat"])(value, format); |
858 // Scenario: we have any active text selection or an active format. |
|
859 let newValue; |
|
860 |
|
861 if (newText === richTextText) { |
|
862 // If we're not updating the text then ignore. |
|
863 newValue = (0,external_wp_richText_namespaceObject.applyFormat)(value, linkFormat); |
|
864 } else { |
|
865 // Create new RichText value for the new text in order that we |
|
866 // can apply formats to it. |
|
867 newValue = (0,external_wp_richText_namespaceObject.create)({ |
|
868 text: newText |
|
869 }); // Apply the new Link format to this new text value. |
|
870 |
|
871 newValue = (0,external_wp_richText_namespaceObject.applyFormat)(newValue, linkFormat, 0, newText.length); // Update the original (full) RichTextValue replacing the |
|
872 // target text with the *new* RichTextValue containing: |
|
873 // 1. The new text content. |
|
874 // 2. The new link format. |
|
875 // Note original formats will be lost when applying this change. |
|
876 // That is expected behaviour. |
|
877 // See: https://github.com/WordPress/gutenberg/pull/33849#issuecomment-936134179. |
|
878 |
|
879 newValue = (0,external_wp_richText_namespaceObject.replace)(value, richTextText, newValue); |
|
880 } |
|
881 |
957 newValue.start = newValue.end; |
882 newValue.start = newValue.end; |
958 newValue.activeFormats = []; |
883 newValue.activeFormats = []; |
959 onChange(newValue); |
884 onChange(newValue); |
960 } // Focus should only be shifted back to the formatted segment when the |
885 } // Focus should only be shifted back to the formatted segment when the |
961 // URL is submitted. |
886 // URL is submitted. |
964 if (!didToggleSetting) { |
889 if (!didToggleSetting) { |
965 stopAddingLink(); |
890 stopAddingLink(); |
966 } |
891 } |
967 |
892 |
968 if (!isValidHref(newUrl)) { |
893 if (!isValidHref(newUrl)) { |
969 speak(Object(external_wp_i18n_["__"])('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive'); |
894 speak((0,external_wp_i18n_namespaceObject.__)('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive'); |
970 } else if (isActive) { |
895 } else if (isActive) { |
971 speak(Object(external_wp_i18n_["__"])('Link edited.'), 'assertive'); |
896 speak((0,external_wp_i18n_namespaceObject.__)('Link edited.'), 'assertive'); |
972 } else { |
897 } else { |
973 speak(Object(external_wp_i18n_["__"])('Link inserted.'), 'assertive'); |
898 speak((0,external_wp_i18n_namespaceObject.__)('Link inserted.'), 'assertive'); |
974 } |
899 } |
975 } |
900 } |
976 |
901 |
977 const anchorRef = Object(external_wp_richText_["useAnchorRef"])({ |
902 const anchorRef = (0,external_wp_richText_namespaceObject.useAnchorRef)({ |
978 ref: contentRef, |
903 ref: contentRef, |
979 value, |
904 value, |
980 settings: link_link |
905 settings: build_module_link_link |
981 }); // The focusOnMount prop shouldn't evolve during render of a Popover |
906 }); // Generate a string based key that is unique to this anchor reference. |
|
907 // This is used to force re-mount the LinkControl component to avoid |
|
908 // potential stale state bugs caused by the component not being remounted |
|
909 // See https://github.com/WordPress/gutenberg/pull/34742. |
|
910 |
|
911 const forceRemountKey = use_link_instance_key(anchorRef); // The focusOnMount prop shouldn't evolve during render of a Popover |
982 // otherwise it causes a render of the content. |
912 // otherwise it causes a render of the content. |
983 |
913 |
984 const focusOnMount = Object(external_wp_element_["useRef"])(addingLink ? 'firstElement' : false); |
914 const focusOnMount = (0,external_wp_element_namespaceObject.useRef)(addingLink ? 'firstElement' : false); |
985 return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], { |
915 |
|
916 async function handleCreate(pageTitle) { |
|
917 const page = await createPageEntity({ |
|
918 title: pageTitle, |
|
919 status: 'draft' |
|
920 }); |
|
921 return { |
|
922 id: page.id, |
|
923 type: page.type, |
|
924 title: page.title.rendered, |
|
925 url: page.link, |
|
926 kind: 'post-type' |
|
927 }; |
|
928 } |
|
929 |
|
930 function createButtonText(searchTerm) { |
|
931 return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( |
|
932 /* translators: %s: search term. */ |
|
933 (0,external_wp_i18n_namespaceObject.__)('Create Page: <mark>%s</mark>'), searchTerm), { |
|
934 mark: (0,external_wp_element_namespaceObject.createElement)("mark", null) |
|
935 }); |
|
936 } |
|
937 |
|
938 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { |
986 anchorRef: anchorRef, |
939 anchorRef: anchorRef, |
987 focusOnMount: focusOnMount.current, |
940 focusOnMount: focusOnMount.current, |
988 onClose: stopAddingLink, |
941 onClose: stopAddingLink, |
989 position: "bottom center" |
942 position: "bottom center" |
990 }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLinkControl"], { |
943 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { |
|
944 key: forceRemountKey, |
991 value: linkValue, |
945 value: linkValue, |
992 onChange: onChangeLink, |
946 onChange: onChangeLink, |
993 forceIsEditingLink: addingLink |
947 onRemove: removeLink, |
|
948 forceIsEditingLink: addingLink, |
|
949 hasRichPreviews: true, |
|
950 createSuggestion: createPageEntity && handleCreate, |
|
951 withCreateSuggestion: userCanCreatePages, |
|
952 createSuggestionButtonText: createButtonText, |
|
953 hasTextControl: true |
994 })); |
954 })); |
995 } |
955 } |
996 |
956 |
997 /* harmony default export */ var inline = (Object(external_wp_components_["withSpokenMessages"])(InlineLinkUI)); |
957 function getRichTextValueFromSelection(value, isActive) { |
998 |
958 // Default to the selection ranges on the RichTextValue object. |
999 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js |
959 let textStart = value.start; |
|
960 let textEnd = value.end; // If the format is currently active then the rich text value |
|
961 // should always be taken from the bounds of the active format |
|
962 // and not the selected text. |
|
963 |
|
964 if (isActive) { |
|
965 const boundary = getFormatBoundary(value, { |
|
966 type: 'core/link' |
|
967 }); |
|
968 textStart = boundary.start; // Text *selection* always extends +1 beyond the edge of the format. |
|
969 // We account for that here. |
|
970 |
|
971 textEnd = boundary.end + 1; |
|
972 } // Get a RichTextValue containing the selected text content. |
|
973 |
|
974 |
|
975 return (0,external_wp_richText_namespaceObject.slice)(value, textStart, textEnd); |
|
976 } |
|
977 |
|
978 /* harmony default export */ var inline = ((0,external_wp_components_namespaceObject.withSpokenMessages)(InlineLinkUI)); |
|
979 |
|
980 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js |
1000 |
981 |
1001 |
982 |
1002 /** |
983 /** |
1003 * WordPress dependencies |
984 * WordPress dependencies |
1004 */ |
985 */ |
1055 setAddingLink(false); |
1038 setAddingLink(false); |
1056 onFocus(); |
1039 onFocus(); |
1057 } |
1040 } |
1058 |
1041 |
1059 function onRemoveFormat() { |
1042 function onRemoveFormat() { |
1060 onChange(Object(external_wp_richText_["removeFormat"])(value, link_name)); |
1043 onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, link_name)); |
1061 Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Link removed.'), 'assertive'); |
1044 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); |
1062 } |
1045 } |
1063 |
1046 |
1064 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], { |
1047 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1065 type: "primary", |
1048 type: "primary", |
1066 character: "k", |
1049 character: "k", |
1067 onUse: addLink |
1050 onUse: addLink |
1068 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], { |
1051 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1069 type: "primaryShift", |
1052 type: "primaryShift", |
1070 character: "k", |
1053 character: "k", |
1071 onUse: onRemoveFormat |
1054 onUse: onRemoveFormat |
1072 }), isActive && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
1055 }), isActive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1073 name: "link", |
1056 name: "link", |
1074 icon: link_off["a" /* default */], |
1057 icon: link_off, |
1075 title: Object(external_wp_i18n_["__"])('Unlink'), |
1058 title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), |
1076 onClick: onRemoveFormat, |
1059 onClick: onRemoveFormat, |
1077 isActive: isActive, |
1060 isActive: isActive, |
1078 shortcutType: "primaryShift", |
1061 shortcutType: "primaryShift", |
1079 shortcutCharacter: "k" |
1062 shortcutCharacter: "k" |
1080 }), !isActive && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
1063 }), !isActive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1081 name: "link", |
1064 name: "link", |
1082 icon: library_link["a" /* default */], |
1065 icon: library_link, |
1083 title: link_title, |
1066 title: link_title, |
1084 onClick: addLink, |
1067 onClick: addLink, |
1085 isActive: isActive, |
1068 isActive: isActive, |
1086 shortcutType: "primary", |
1069 shortcutType: "primary", |
1087 shortcutCharacter: "k" |
1070 shortcutCharacter: "k" |
1088 }), (addingLink || isActive) && Object(external_wp_element_["createElement"])(inline, { |
1071 }), (addingLink || isActive) && (0,external_wp_element_namespaceObject.createElement)(inline, { |
1089 addingLink: addingLink, |
1072 addingLink: addingLink, |
1090 stopAddingLink: stopAddingLink, |
1073 stopAddingLink: stopAddingLink, |
1091 isActive: isActive, |
1074 isActive: isActive, |
1092 activeAttributes: activeAttributes, |
1075 activeAttributes: activeAttributes, |
1093 value: value, |
1076 value: value, |
1094 onChange: onChange, |
1077 onChange: onChange, |
1095 contentRef: contentRef |
1078 contentRef: contentRef |
1096 })); |
1079 })); |
1097 } |
1080 } |
1098 |
1081 |
1099 const link_link = { |
1082 const build_module_link_link = { |
1100 name: link_name, |
1083 name: link_name, |
1101 title: link_title, |
1084 title: link_title, |
1102 tagName: 'a', |
1085 tagName: 'a', |
1103 className: null, |
1086 className: null, |
1104 attributes: { |
1087 attributes: { |
1148 |
1145 |
1149 |
1146 |
1150 |
1147 |
1151 const strikethrough_name = 'core/strikethrough'; |
1148 const strikethrough_name = 'core/strikethrough'; |
1152 |
1149 |
1153 const strikethrough_title = Object(external_wp_i18n_["__"])('Strikethrough'); |
1150 const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)('Strikethrough'); |
1154 |
1151 |
1155 const strikethrough = { |
1152 const strikethrough = { |
1156 name: strikethrough_name, |
1153 name: strikethrough_name, |
1157 title: strikethrough_title, |
1154 title: strikethrough_title, |
1158 tagName: 's', |
1155 tagName: 's', |
1159 className: null, |
1156 className: null, |
1160 |
1157 |
1161 edit({ |
1158 edit(_ref) { |
1162 isActive, |
1159 let { |
1163 value, |
1160 isActive, |
1164 onChange, |
1161 value, |
1165 onFocus |
1162 onChange, |
1166 }) { |
1163 onFocus |
|
1164 } = _ref; |
|
1165 |
1167 function onClick() { |
1166 function onClick() { |
1168 onChange(Object(external_wp_richText_["toggleFormat"])(value, { |
1167 onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { |
1169 type: strikethrough_name |
1168 type: strikethrough_name, |
|
1169 title: strikethrough_title |
1170 })); |
1170 })); |
1171 onFocus(); |
1171 onFocus(); |
1172 } |
1172 } |
1173 |
1173 |
1174 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
1174 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1175 icon: format_strikethrough["a" /* default */], |
1175 icon: format_strikethrough, |
1176 title: strikethrough_title, |
1176 title: strikethrough_title, |
1177 onClick: onClick, |
1177 onClick: onClick, |
1178 isActive: isActive |
1178 isActive: isActive, |
|
1179 role: "menuitemcheckbox" |
1179 }); |
1180 }); |
1180 } |
1181 } |
1181 |
1182 |
1182 }; |
1183 }; |
1183 |
1184 |
1184 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js |
1185 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js |
1185 |
1186 |
1186 |
1187 |
1187 /** |
1188 /** |
1188 * WordPress dependencies |
1189 * WordPress dependencies |
1189 */ |
1190 */ |
1190 |
1191 |
1191 |
1192 |
1192 |
1193 |
1193 const underline_name = 'core/underline'; |
1194 const underline_name = 'core/underline'; |
|
1195 |
|
1196 const underline_title = (0,external_wp_i18n_namespaceObject.__)('Underline'); |
|
1197 |
1194 const underline = { |
1198 const underline = { |
1195 name: underline_name, |
1199 name: underline_name, |
1196 title: Object(external_wp_i18n_["__"])('Underline'), |
1200 title: underline_title, |
1197 tagName: 'span', |
1201 tagName: 'span', |
1198 className: null, |
1202 className: null, |
1199 attributes: { |
1203 attributes: { |
1200 style: 'style' |
1204 style: 'style' |
1201 }, |
1205 }, |
1202 |
1206 |
1203 edit({ |
1207 edit(_ref) { |
1204 value, |
1208 let { |
1205 onChange |
1209 value, |
1206 }) { |
1210 onChange |
|
1211 } = _ref; |
|
1212 |
1207 const onToggle = () => { |
1213 const onToggle = () => { |
1208 onChange(Object(external_wp_richText_["toggleFormat"])(value, { |
1214 onChange((0,external_wp_richText_namespaceObject.toggleFormat)(value, { |
1209 type: underline_name, |
1215 type: underline_name, |
1210 attributes: { |
1216 attributes: { |
1211 style: 'text-decoration: underline;' |
1217 style: 'text-decoration: underline;' |
1212 } |
1218 }, |
|
1219 title: underline_title |
1213 })); |
1220 })); |
1214 }; |
1221 }; |
1215 |
1222 |
1216 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], { |
1223 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1217 type: "primary", |
1224 type: "primary", |
1218 character: "u", |
1225 character: "u", |
1219 onUse: onToggle |
1226 onUse: onToggle |
1220 }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableRichTextInputEvent"], { |
1227 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, { |
1221 inputType: "formatUnderline", |
1228 inputType: "formatUnderline", |
1222 onInput: onToggle |
1229 onInput: onToggle |
1223 })); |
1230 })); |
1224 } |
1231 } |
1225 |
1232 |
1226 }; |
1233 }; |
1227 |
1234 |
1228 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js |
1235 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js |
1229 var icon = __webpack_require__("iClF"); |
1236 /** |
1230 |
1237 * WordPress dependencies |
1231 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js |
1238 */ |
1232 var text_color = __webpack_require__("uGfJ"); |
1239 |
1233 |
1240 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ |
1234 // EXTERNAL MODULE: external ["wp","data"] |
1241 |
1235 var external_wp_data_ = __webpack_require__("1ZqX"); |
1242 /** |
1236 |
1243 * Return an SVG icon. |
1237 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js |
1244 * |
|
1245 * @param {IconProps} props icon is the SVG component to render |
|
1246 * size is a number specifiying the icon size in pixels |
|
1247 * Other props will be passed to wrapped SVG component |
|
1248 * |
|
1249 * @return {JSX.Element} Icon component |
|
1250 */ |
|
1251 |
|
1252 function Icon(_ref) { |
|
1253 let { |
|
1254 icon, |
|
1255 size = 24, |
|
1256 ...props |
|
1257 } = _ref; |
|
1258 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { |
|
1259 width: size, |
|
1260 height: size, |
|
1261 ...props |
|
1262 }); |
|
1263 } |
|
1264 |
|
1265 /* harmony default export */ var icon = (Icon); |
|
1266 |
|
1267 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js |
|
1268 |
|
1269 |
|
1270 /** |
|
1271 * WordPress dependencies |
|
1272 */ |
|
1273 |
|
1274 const textColor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
1275 xmlns: "http://www.w3.org/2000/svg", |
|
1276 viewBox: "0 0 24 24" |
|
1277 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
|
1278 d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" |
|
1279 })); |
|
1280 /* harmony default export */ var text_color = (textColor); |
|
1281 |
|
1282 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js |
1238 |
1283 |
1239 |
1284 |
1240 /** |
1285 /** |
1241 * External dependencies |
1286 * External dependencies |
1242 */ |
1287 */ |
1247 |
1292 |
1248 |
1293 |
1249 |
1294 |
1250 |
1295 |
1251 |
1296 |
|
1297 |
|
1298 |
1252 /** |
1299 /** |
1253 * Internal dependencies |
1300 * Internal dependencies |
1254 */ |
1301 */ |
1255 |
1302 |
1256 |
1303 |
1257 function getActiveColor(formatName, formatValue, colors) { |
1304 |
1258 const activeColorFormat = Object(external_wp_richText_["getActiveFormat"])(formatValue, formatName); |
1305 function parseCSS() { |
|
1306 let css = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; |
|
1307 return css.split(';').reduce((accumulator, rule) => { |
|
1308 if (rule) { |
|
1309 const [property, value] = rule.split(':'); |
|
1310 if (property === 'color') accumulator.color = value; |
|
1311 if (property === 'background-color' && value !== transparentValue) accumulator.backgroundColor = value; |
|
1312 } |
|
1313 |
|
1314 return accumulator; |
|
1315 }, {}); |
|
1316 } |
|
1317 |
|
1318 function parseClassName() { |
|
1319 let className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; |
|
1320 let colorSettings = arguments.length > 1 ? arguments[1] : undefined; |
|
1321 return className.split(' ').reduce((accumulator, name) => { |
|
1322 // `colorSlug` could contain dashes, so simply match the start and end. |
|
1323 if (name.startsWith('has-') && name.endsWith('-color')) { |
|
1324 const colorSlug = name.replace(/^has-/, '').replace(/-color$/, ''); |
|
1325 const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colorSettings, colorSlug); |
|
1326 accumulator.color = colorObject.color; |
|
1327 } |
|
1328 |
|
1329 return accumulator; |
|
1330 }, {}); |
|
1331 } |
|
1332 function getActiveColors(value, name, colorSettings) { |
|
1333 const activeColorFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name); |
1259 |
1334 |
1260 if (!activeColorFormat) { |
1335 if (!activeColorFormat) { |
1261 return; |
1336 return {}; |
1262 } |
1337 } |
1263 |
1338 |
1264 const styleColor = activeColorFormat.attributes.style; |
1339 return { ...parseCSS(activeColorFormat.attributes.style), |
1265 |
1340 ...parseClassName(activeColorFormat.attributes.class, colorSettings) |
1266 if (styleColor) { |
1341 }; |
1267 return styleColor.replace(new RegExp(`^color:\\s*`), ''); |
1342 } |
1268 } |
1343 |
1269 |
1344 function setColors(value, name, colorSettings, colors) { |
1270 const currentClass = activeColorFormat.attributes.class; |
1345 const { |
1271 |
1346 color, |
1272 if (currentClass) { |
1347 backgroundColor |
1273 const colorSlug = currentClass.replace(/.*has-([^\s]*)-color.*/, '$1'); |
1348 } = { ...getActiveColors(value, name, colorSettings), |
1274 return Object(external_wp_blockEditor_["getColorObjectByAttributeValues"])(colors, colorSlug).color; |
1349 ...colors |
1275 } |
1350 }; |
1276 } |
1351 |
1277 |
1352 if (!color && !backgroundColor) { |
1278 const ColorPicker = ({ |
1353 return (0,external_wp_richText_namespaceObject.removeFormat)(value, name); |
1279 name, |
1354 } |
1280 value, |
1355 |
1281 onChange |
1356 const styles = []; |
1282 }) => { |
1357 const classNames = []; |
1283 const colors = Object(external_wp_data_["useSelect"])(select => { |
1358 const attributes = {}; |
|
1359 |
|
1360 if (backgroundColor) { |
|
1361 styles.push(['background-color', backgroundColor].join(':')); |
|
1362 } else { |
|
1363 // Override default browser color for mark element. |
|
1364 styles.push(['background-color', transparentValue].join(':')); |
|
1365 } |
|
1366 |
|
1367 if (color) { |
|
1368 const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByColorValue)(colorSettings, color); |
|
1369 |
|
1370 if (colorObject) { |
|
1371 classNames.push((0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', colorObject.slug)); |
|
1372 } else { |
|
1373 styles.push(['color', color].join(':')); |
|
1374 } |
|
1375 } |
|
1376 |
|
1377 if (styles.length) attributes.style = styles.join(';'); |
|
1378 if (classNames.length) attributes.class = classNames.join(' '); |
|
1379 return (0,external_wp_richText_namespaceObject.applyFormat)(value, { |
|
1380 type: name, |
|
1381 attributes |
|
1382 }); |
|
1383 } |
|
1384 |
|
1385 function ColorPicker(_ref) { |
|
1386 let { |
|
1387 name, |
|
1388 property, |
|
1389 value, |
|
1390 onChange |
|
1391 } = _ref; |
|
1392 const colors = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1284 const { |
1393 const { |
1285 getSettings |
1394 getSettings |
1286 } = select(external_wp_blockEditor_["store"]); |
1395 } = select(external_wp_blockEditor_namespaceObject.store); |
1287 return Object(external_lodash_["get"])(getSettings(), ['colors'], []); |
1396 return (0,external_lodash_namespaceObject.get)(getSettings(), ['colors'], []); |
1288 }); |
1397 }, []); |
1289 const onColorChange = Object(external_wp_element_["useCallback"])(color => { |
1398 const onColorChange = (0,external_wp_element_namespaceObject.useCallback)(color => { |
1290 if (color) { |
1399 onChange(setColors(value, name, colors, { |
1291 const colorObject = Object(external_wp_blockEditor_["getColorObjectByColorValue"])(colors, color); |
1400 [property]: color |
1292 onChange(Object(external_wp_richText_["applyFormat"])(value, { |
1401 })); |
1293 type: name, |
1402 }, [colors, onChange, property]); |
1294 attributes: colorObject ? { |
1403 const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]); |
1295 class: Object(external_wp_blockEditor_["getColorClassName"])('color', colorObject.slug) |
1404 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, { |
1296 } : { |
1405 value: activeColors[property], |
1297 style: `color:${color}` |
|
1298 } |
|
1299 })); |
|
1300 } else { |
|
1301 onChange(Object(external_wp_richText_["removeFormat"])(value, name)); |
|
1302 } |
|
1303 }, [colors, onChange]); |
|
1304 const activeColor = Object(external_wp_element_["useMemo"])(() => getActiveColor(name, value, colors), [name, value, colors]); |
|
1305 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ColorPalette"], { |
|
1306 value: activeColor, |
|
1307 onChange: onColorChange |
1406 onChange: onColorChange |
1308 }); |
1407 }); |
1309 }; |
1408 } |
1310 |
1409 |
1311 function InlineColorUI({ |
1410 function InlineColorUI(_ref2) { |
1312 name, |
1411 let { |
1313 value, |
1412 name, |
1314 onChange, |
1413 value, |
1315 onClose, |
1414 onChange, |
1316 contentRef |
1415 onClose, |
1317 }) { |
1416 contentRef |
1318 const anchorRef = Object(external_wp_richText_["useAnchorRef"])({ |
1417 } = _ref2; |
|
1418 |
|
1419 /* |
|
1420 As you change the text color by typing a HEX value into a field, |
|
1421 the return value of document.getSelection jumps to the field you're editing, |
|
1422 not the highlighted text. Given that useAnchorRef uses document.getSelection, |
|
1423 it will return null, since it can't find the <mark> element within the HEX input. |
|
1424 This caches the last truthy value of the selection anchor reference. |
|
1425 */ |
|
1426 const anchorRef = (0,external_wp_blockEditor_namespaceObject.useCachedTruthy)((0,external_wp_richText_namespaceObject.useAnchorRef)({ |
1319 ref: contentRef, |
1427 ref: contentRef, |
1320 value, |
1428 value, |
1321 settings: textColor |
1429 settings: text_color_textColor |
1322 }); |
1430 })); |
1323 return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["URLPopover"], { |
1431 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, { |
1324 value: value, |
|
1325 onClose: onClose, |
1432 onClose: onClose, |
1326 className: "components-inline-color-popover", |
1433 className: "components-inline-color-popover", |
1327 anchorRef: anchorRef |
1434 anchorRef: anchorRef |
1328 }, Object(external_wp_element_["createElement"])(ColorPicker, { |
1435 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, { |
|
1436 tabs: [{ |
|
1437 name: 'color', |
|
1438 title: (0,external_wp_i18n_namespaceObject.__)('Text') |
|
1439 }, { |
|
1440 name: 'backgroundColor', |
|
1441 title: (0,external_wp_i18n_namespaceObject.__)('Background') |
|
1442 }] |
|
1443 }, tab => (0,external_wp_element_namespaceObject.createElement)(ColorPicker, { |
1329 name: name, |
1444 name: name, |
|
1445 property: tab.name, |
1330 value: value, |
1446 value: value, |
1331 onChange: onChange |
1447 onChange: onChange |
1332 })); |
1448 }))); |
1333 } |
1449 } |
1334 |
1450 |
1335 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js |
1451 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js |
1336 |
1452 |
1337 |
1453 |
1338 /** |
1454 /** |
1339 * External dependencies |
1455 * External dependencies |
1340 */ |
1456 */ |
1351 /** |
1467 /** |
1352 * Internal dependencies |
1468 * Internal dependencies |
1353 */ |
1469 */ |
1354 |
1470 |
1355 |
1471 |
|
1472 const transparentValue = 'rgba(0, 0, 0, 0)'; |
1356 const text_color_name = 'core/text-color'; |
1473 const text_color_name = 'core/text-color'; |
1357 |
1474 |
1358 const text_color_title = Object(external_wp_i18n_["__"])('Text color'); |
1475 const text_color_title = (0,external_wp_i18n_namespaceObject.__)('Highlight'); |
1359 |
1476 |
1360 const EMPTY_ARRAY = []; |
1477 const EMPTY_ARRAY = []; |
1361 |
1478 |
1362 function TextColorEdit({ |
1479 function getComputedStyleProperty(element, property) { |
1363 value, |
1480 const { |
1364 onChange, |
1481 ownerDocument |
1365 isActive, |
1482 } = element; |
1366 activeAttributes, |
1483 const { |
1367 contentRef |
1484 defaultView |
1368 }) { |
1485 } = ownerDocument; |
1369 const allowCustomControl = Object(external_wp_blockEditor_["useSetting"])('color.custom'); |
1486 const style = defaultView.getComputedStyle(element); |
1370 const colors = Object(external_wp_blockEditor_["useSetting"])('color.palette') || EMPTY_ARRAY; |
1487 const value = style.getPropertyValue(property); |
1371 const [isAddingColor, setIsAddingColor] = Object(external_wp_element_["useState"])(false); |
1488 |
1372 const enableIsAddingColor = Object(external_wp_element_["useCallback"])(() => setIsAddingColor(true), [setIsAddingColor]); |
1489 if (property === 'background-color' && value === transparentValue && element.parentElement) { |
1373 const disableIsAddingColor = Object(external_wp_element_["useCallback"])(() => setIsAddingColor(false), [setIsAddingColor]); |
1490 return getComputedStyleProperty(element.parentElement, property); |
1374 const colorIndicatorStyle = Object(external_wp_element_["useMemo"])(() => { |
1491 } |
1375 const activeColor = getActiveColor(text_color_name, value, colors); |
1492 |
1376 |
1493 return value; |
1377 if (!activeColor) { |
1494 } |
1378 return undefined; |
1495 |
1379 } |
1496 function fillComputedColors(element, _ref) { |
1380 |
1497 let { |
1381 return { |
1498 color, |
1382 backgroundColor: activeColor |
1499 backgroundColor |
1383 }; |
1500 } = _ref; |
1384 }, [value, colors]); |
1501 |
1385 const hasColorsToChoose = !Object(external_lodash_["isEmpty"])(colors) || !allowCustomControl; |
1502 if (!color && !backgroundColor) { |
|
1503 return; |
|
1504 } |
|
1505 |
|
1506 return { |
|
1507 color: color || getComputedStyleProperty(element, 'color'), |
|
1508 backgroundColor: backgroundColor === transparentValue ? getComputedStyleProperty(element, 'background-color') : backgroundColor |
|
1509 }; |
|
1510 } |
|
1511 |
|
1512 function TextColorEdit(_ref2) { |
|
1513 let { |
|
1514 value, |
|
1515 onChange, |
|
1516 isActive, |
|
1517 activeAttributes, |
|
1518 contentRef |
|
1519 } = _ref2; |
|
1520 const allowCustomControl = (0,external_wp_blockEditor_namespaceObject.useSetting)('color.custom'); |
|
1521 const colors = (0,external_wp_blockEditor_namespaceObject.useSetting)('color.palette') || EMPTY_ARRAY; |
|
1522 const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false); |
|
1523 const enableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(true), [setIsAddingColor]); |
|
1524 const disableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(false), [setIsAddingColor]); |
|
1525 const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(() => fillComputedColors(contentRef.current, getActiveColors(value, text_color_name, colors)), [value, colors]); |
|
1526 const hasColorsToChoose = !(0,external_lodash_namespaceObject.isEmpty)(colors) || !allowCustomControl; |
1386 |
1527 |
1387 if (!hasColorsToChoose && !isActive) { |
1528 if (!hasColorsToChoose && !isActive) { |
1388 return null; |
1529 return null; |
1389 } |
1530 } |
1390 |
1531 |
1391 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextToolbarButton"], { |
1532 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1392 key: isActive ? 'text-color' : 'text-color-not-active', |
|
1393 className: "format-library-text-color-button", |
1533 className: "format-library-text-color-button", |
1394 name: isActive ? 'text-color' : undefined, |
1534 isActive: isActive, |
1395 icon: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(icon["a" /* default */], { |
1535 icon: (0,external_wp_element_namespaceObject.createElement)(icon, { |
1396 icon: text_color["a" /* default */] |
1536 icon: text_color, |
1397 }), isActive && Object(external_wp_element_["createElement"])("span", { |
|
1398 className: "format-library-text-color-button__indicator", |
|
1399 style: colorIndicatorStyle |
1537 style: colorIndicatorStyle |
1400 })), |
1538 }), |
1401 title: text_color_title // If has no colors to choose but a color is active remove the color onClick |
1539 title: text_color_title // If has no colors to choose but a color is active remove the color onClick. |
1402 , |
1540 , |
1403 onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange(Object(external_wp_richText_["removeFormat"])(value, text_color_name)) |
1541 onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)), |
1404 }), isAddingColor && Object(external_wp_element_["createElement"])(InlineColorUI, { |
1542 role: "menuitemcheckbox" |
|
1543 }), isAddingColor && (0,external_wp_element_namespaceObject.createElement)(InlineColorUI, { |
1405 name: text_color_name, |
1544 name: text_color_name, |
1406 onClose: disableIsAddingColor, |
1545 onClose: disableIsAddingColor, |
1407 activeAttributes: activeAttributes, |
1546 activeAttributes: activeAttributes, |
1408 value: value, |
1547 value: value, |
1409 onChange: onChange, |
1548 onChange: onChange, |
1410 contentRef: contentRef |
1549 contentRef: contentRef |
1411 })); |
1550 })); |
1412 } |
1551 } |
1413 |
1552 |
1414 const textColor = { |
1553 const text_color_textColor = { |
1415 name: text_color_name, |
1554 name: text_color_name, |
1416 title: text_color_title, |
1555 title: text_color_title, |
1417 tagName: 'span', |
1556 tagName: 'mark', |
1418 className: 'has-inline-color', |
1557 className: 'has-inline-color', |
1419 attributes: { |
1558 attributes: { |
1420 style: 'style', |
1559 style: 'style', |
1421 class: 'class' |
1560 class: 'class' |
1422 }, |
1561 }, |
|
1562 |
|
1563 /* |
|
1564 * Since this format relies on the <mark> tag, it's important to |
|
1565 * prevent the default yellow background color applied by most |
|
1566 * browsers. The solution is to detect when this format is used with a |
|
1567 * text color but no background color, and in such cases to override |
|
1568 * the default styling with a transparent background. |
|
1569 * |
|
1570 * @see https://github.com/WordPress/gutenberg/pull/35516 |
|
1571 */ |
|
1572 __unstableFilterAttributeValue(key, value) { |
|
1573 if (key !== 'style') return value; // We should not add a background-color if it's already set. |
|
1574 |
|
1575 if (value && value.includes('background-color')) return value; |
|
1576 const addedCSS = ['background-color', transparentValue].join(':'); // Prepend `addedCSS` to avoid a double `;;` as any the existing CSS |
|
1577 // rules will already include a `;`. |
|
1578 |
|
1579 return value ? [addedCSS, value].join(';') : addedCSS; |
|
1580 }, |
|
1581 |
1423 edit: TextColorEdit |
1582 edit: TextColorEdit |
1424 }; |
1583 }; |
1425 |
1584 |
1426 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/subscript.js |
1585 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/subscript.js |
1427 |
1586 |
1428 |
1587 |
1429 /** |
1588 /** |
1430 * WordPress dependencies |
1589 * WordPress dependencies |
1431 */ |
1590 */ |
1432 |
1591 |
1433 const subscript = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { |
1592 const subscript = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
1434 xmlns: "http://www.w3.org/2000/svg", |
1593 xmlns: "http://www.w3.org/2000/svg", |
1435 viewBox: "0 0 24 24" |
1594 viewBox: "0 0 24 24" |
1436 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { |
1595 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
1437 d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" |
1596 d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" |
1438 })); |
1597 })); |
1439 /* harmony default export */ var library_subscript = (subscript); |
1598 /* harmony default export */ var library_subscript = (subscript); |
1440 |
1599 |
1441 // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/subscript/index.js |
1600 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/subscript/index.js |
1442 |
1601 |
1443 |
1602 |
1444 /** |
1603 /** |
1445 * WordPress dependencies |
1604 * WordPress dependencies |
1446 */ |
1605 */ |