9
|
1 |
this["wp"] = this["wp"] || {}; this["wp"]["formatLibrary"] = |
|
2 |
/******/ (function(modules) { // webpackBootstrap |
|
3 |
/******/ // The module cache |
|
4 |
/******/ var installedModules = {}; |
|
5 |
/******/ |
|
6 |
/******/ // The require function |
|
7 |
/******/ function __webpack_require__(moduleId) { |
|
8 |
/******/ |
|
9 |
/******/ // Check if module is in cache |
|
10 |
/******/ if(installedModules[moduleId]) { |
|
11 |
/******/ return installedModules[moduleId].exports; |
|
12 |
/******/ } |
|
13 |
/******/ // Create a new module (and put it into the cache) |
|
14 |
/******/ var module = installedModules[moduleId] = { |
|
15 |
/******/ i: moduleId, |
|
16 |
/******/ l: false, |
|
17 |
/******/ exports: {} |
|
18 |
/******/ }; |
|
19 |
/******/ |
|
20 |
/******/ // Execute the module function |
|
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 |
16
|
85 |
/******/ return __webpack_require__(__webpack_require__.s = 446); |
9
|
86 |
/******/ }) |
|
87 |
/************************************************************************/ |
|
88 |
/******/ ({ |
|
89 |
|
|
90 |
/***/ 0: |
|
91 |
/***/ (function(module, exports) { |
|
92 |
|
|
93 |
(function() { module.exports = this["wp"]["element"]; }()); |
|
94 |
|
|
95 |
/***/ }), |
|
96 |
|
|
97 |
/***/ 1: |
|
98 |
/***/ (function(module, exports) { |
|
99 |
|
|
100 |
(function() { module.exports = this["wp"]["i18n"]; }()); |
|
101 |
|
|
102 |
/***/ }), |
|
103 |
|
16
|
104 |
/***/ 12: |
|
105 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
106 |
|
|
107 |
"use strict"; |
|
108 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); |
|
109 |
function _assertThisInitialized(self) { |
|
110 |
if (self === void 0) { |
|
111 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
|
112 |
} |
|
113 |
|
|
114 |
return self; |
|
115 |
} |
|
116 |
|
|
117 |
/***/ }), |
|
118 |
|
|
119 |
/***/ 137: |
9
|
120 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
121 |
|
|
122 |
"use strict"; |
16
|
123 |
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); |
|
124 |
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); |
|
125 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); |
|
126 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
131 |
|
|
132 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
133 |
|
|
134 |
/** |
|
135 |
* WordPress dependencies |
|
136 |
*/ |
|
137 |
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly. |
|
138 |
|
|
139 |
/* eslint-disable jsdoc/valid-types */ |
|
140 |
|
|
141 |
/** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */ |
|
142 |
|
|
143 |
/* eslint-enable jsdoc/valid-types */ |
|
144 |
|
|
145 |
/** |
|
146 |
* Return an SVG icon. |
|
147 |
* |
|
148 |
* @param {IconProps} props icon is the SVG component to render |
|
149 |
* size is a number specifiying the icon size in pixels |
|
150 |
* Other props will be passed to wrapped SVG component |
|
151 |
* |
|
152 |
* @return {JSX.Element} Icon component |
|
153 |
*/ |
|
154 |
|
|
155 |
function Icon(_ref) { |
|
156 |
var icon = _ref.icon, |
|
157 |
_ref$size = _ref.size, |
|
158 |
size = _ref$size === void 0 ? 24 : _ref$size, |
|
159 |
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]); |
|
160 |
|
|
161 |
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({ |
|
162 |
width: size, |
|
163 |
height: size |
|
164 |
}, props)); |
9
|
165 |
} |
|
166 |
|
16
|
167 |
/* harmony default export */ __webpack_exports__["a"] = (Icon); |
|
168 |
|
|
169 |
|
9
|
170 |
/***/ }), |
|
171 |
|
16
|
172 |
/***/ 14: |
9
|
173 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
174 |
|
|
175 |
"use strict"; |
16
|
176 |
|
|
177 |
// EXPORTS |
|
178 |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); |
|
179 |
|
|
180 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
|
181 |
var arrayWithHoles = __webpack_require__(38); |
|
182 |
|
|
183 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
|
184 |
function _iterableToArrayLimit(arr, i) { |
|
185 |
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; |
|
186 |
var _arr = []; |
|
187 |
var _n = true; |
|
188 |
var _d = false; |
|
189 |
var _e = undefined; |
|
190 |
|
|
191 |
try { |
|
192 |
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { |
|
193 |
_arr.push(_s.value); |
|
194 |
|
|
195 |
if (i && _arr.length === i) break; |
|
196 |
} |
|
197 |
} catch (err) { |
|
198 |
_d = true; |
|
199 |
_e = err; |
|
200 |
} finally { |
|
201 |
try { |
|
202 |
if (!_n && _i["return"] != null) _i["return"](); |
|
203 |
} finally { |
|
204 |
if (_d) throw _e; |
|
205 |
} |
9
|
206 |
} |
|
207 |
|
16
|
208 |
return _arr; |
|
209 |
} |
|
210 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
211 |
var unsupportedIterableToArray = __webpack_require__(29); |
|
212 |
|
|
213 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
|
214 |
var nonIterableRest = __webpack_require__(39); |
|
215 |
|
|
216 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
|
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
|
221 |
function _slicedToArray(arr, i) { |
|
222 |
return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); |
9
|
223 |
} |
|
224 |
|
|
225 |
/***/ }), |
|
226 |
|
16
|
227 |
/***/ 15: |
|
228 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
229 |
|
|
230 |
"use strict"; |
|
231 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); |
|
232 |
/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41); |
|
233 |
|
|
234 |
function _objectWithoutProperties(source, excluded) { |
|
235 |
if (source == null) return {}; |
|
236 |
var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); |
|
237 |
var key, i; |
|
238 |
|
|
239 |
if (Object.getOwnPropertySymbols) { |
|
240 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); |
|
241 |
|
|
242 |
for (i = 0; i < sourceSymbolKeys.length; i++) { |
|
243 |
key = sourceSymbolKeys[i]; |
|
244 |
if (excluded.indexOf(key) >= 0) continue; |
|
245 |
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; |
|
246 |
target[key] = source[key]; |
|
247 |
} |
|
248 |
} |
|
249 |
|
|
250 |
return target; |
|
251 |
} |
|
252 |
|
|
253 |
/***/ }), |
|
254 |
|
|
255 |
/***/ 16: |
9
|
256 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
257 |
|
|
258 |
"use strict"; |
|
259 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); |
|
260 |
function _getPrototypeOf(o) { |
|
261 |
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { |
|
262 |
return o.__proto__ || Object.getPrototypeOf(o); |
|
263 |
}; |
|
264 |
return _getPrototypeOf(o); |
|
265 |
} |
|
266 |
|
|
267 |
/***/ }), |
|
268 |
|
16
|
269 |
/***/ 180: |
|
270 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
271 |
|
|
272 |
"use strict"; |
|
273 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
274 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
275 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
276 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
277 |
|
|
278 |
|
|
279 |
/** |
|
280 |
* WordPress dependencies |
|
281 |
*/ |
|
282 |
|
|
283 |
var link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
284 |
xmlns: "http://www.w3.org/2000/svg", |
|
285 |
viewBox: "0 0 24 24" |
|
286 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
287 |
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" |
|
288 |
})); |
|
289 |
/* harmony default export */ __webpack_exports__["a"] = (link); |
|
290 |
|
|
291 |
|
|
292 |
/***/ }), |
|
293 |
|
|
294 |
/***/ 19: |
|
295 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
296 |
|
|
297 |
"use strict"; |
|
298 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); |
|
299 |
function _defineProperties(target, props) { |
|
300 |
for (var i = 0; i < props.length; i++) { |
|
301 |
var descriptor = props[i]; |
|
302 |
descriptor.enumerable = descriptor.enumerable || false; |
|
303 |
descriptor.configurable = true; |
|
304 |
if ("value" in descriptor) descriptor.writable = true; |
|
305 |
Object.defineProperty(target, descriptor.key, descriptor); |
|
306 |
} |
|
307 |
} |
|
308 |
|
|
309 |
function _createClass(Constructor, protoProps, staticProps) { |
|
310 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
|
311 |
if (staticProps) _defineProperties(Constructor, staticProps); |
|
312 |
return Constructor; |
|
313 |
} |
|
314 |
|
|
315 |
/***/ }), |
|
316 |
|
|
317 |
/***/ 2: |
|
318 |
/***/ (function(module, exports) { |
|
319 |
|
|
320 |
(function() { module.exports = this["lodash"]; }()); |
|
321 |
|
|
322 |
/***/ }), |
|
323 |
|
|
324 |
/***/ 20: |
9
|
325 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
326 |
|
|
327 |
"use strict"; |
16
|
328 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); |
|
329 |
function _classCallCheck(instance, Constructor) { |
|
330 |
if (!(instance instanceof Constructor)) { |
|
331 |
throw new TypeError("Cannot call a class as a function"); |
|
332 |
} |
|
333 |
} |
|
334 |
|
|
335 |
/***/ }), |
|
336 |
|
|
337 |
/***/ 203: |
|
338 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
339 |
|
|
340 |
"use strict"; |
|
341 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
342 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
343 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
344 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
345 |
|
|
346 |
|
|
347 |
/** |
|
348 |
* WordPress dependencies |
|
349 |
*/ |
|
350 |
|
|
351 |
var keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
352 |
xmlns: "http://www.w3.org/2000/svg", |
|
353 |
viewBox: "-2 -2 24 24" |
|
354 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
355 |
d: "M16 4h2v9H7v3l-5-4 5-4v3h9V4z" |
|
356 |
})); |
|
357 |
/* harmony default export */ __webpack_exports__["a"] = (keyboardReturn); |
|
358 |
|
|
359 |
|
|
360 |
/***/ }), |
|
361 |
|
|
362 |
/***/ 205: |
|
363 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
364 |
|
|
365 |
"use strict"; |
|
366 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
367 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
368 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
369 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
370 |
|
|
371 |
|
|
372 |
/** |
|
373 |
* WordPress dependencies |
|
374 |
*/ |
|
375 |
|
|
376 |
var linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
377 |
xmlns: "http://www.w3.org/2000/svg", |
|
378 |
viewBox: "0 0 24 24" |
|
379 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
380 |
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" |
|
381 |
})); |
|
382 |
/* harmony default export */ __webpack_exports__["a"] = (linkOff); |
|
383 |
|
|
384 |
|
|
385 |
/***/ }), |
|
386 |
|
|
387 |
/***/ 21: |
|
388 |
/***/ (function(module, exports) { |
|
389 |
|
|
390 |
(function() { module.exports = this["wp"]["keycodes"]; }()); |
|
391 |
|
|
392 |
/***/ }), |
|
393 |
|
|
394 |
/***/ 22: |
|
395 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
396 |
|
|
397 |
"use strict"; |
|
398 |
|
|
399 |
// EXPORTS |
|
400 |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; }); |
9
|
401 |
|
|
402 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
|
403 |
function _setPrototypeOf(o, p) { |
|
404 |
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { |
|
405 |
o.__proto__ = p; |
|
406 |
return o; |
|
407 |
}; |
|
408 |
|
|
409 |
return _setPrototypeOf(o, p); |
|
410 |
} |
|
411 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js |
|
412 |
|
|
413 |
function _inherits(subClass, superClass) { |
|
414 |
if (typeof superClass !== "function" && superClass !== null) { |
|
415 |
throw new TypeError("Super expression must either be null or a function"); |
|
416 |
} |
|
417 |
|
|
418 |
subClass.prototype = Object.create(superClass && superClass.prototype, { |
|
419 |
constructor: { |
|
420 |
value: subClass, |
|
421 |
writable: true, |
|
422 |
configurable: true |
|
423 |
} |
|
424 |
}); |
|
425 |
if (superClass) _setPrototypeOf(subClass, superClass); |
|
426 |
} |
|
427 |
|
|
428 |
/***/ }), |
|
429 |
|
16
|
430 |
/***/ 23: |
9
|
431 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
432 |
|
|
433 |
"use strict"; |
16
|
434 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); |
|
435 |
/* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); |
|
436 |
/* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); |
|
437 |
|
|
438 |
|
|
439 |
function _possibleConstructorReturn(self, call) { |
|
440 |
if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { |
|
441 |
return call; |
9
|
442 |
} |
|
443 |
|
16
|
444 |
return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); |
9
|
445 |
} |
|
446 |
|
|
447 |
/***/ }), |
|
448 |
|
16
|
449 |
/***/ 25: |
9
|
450 |
/***/ (function(module, exports) { |
|
451 |
|
|
452 |
(function() { module.exports = this["wp"]["richText"]; }()); |
|
453 |
|
|
454 |
/***/ }), |
|
455 |
|
16
|
456 |
/***/ 26: |
|
457 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
458 |
|
|
459 |
"use strict"; |
|
460 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); |
|
461 |
function _arrayLikeToArray(arr, len) { |
|
462 |
if (len == null || len > arr.length) len = arr.length; |
|
463 |
|
|
464 |
for (var i = 0, arr2 = new Array(len); i < len; i++) { |
|
465 |
arr2[i] = arr[i]; |
|
466 |
} |
|
467 |
|
|
468 |
return arr2; |
|
469 |
} |
|
470 |
|
|
471 |
/***/ }), |
|
472 |
|
|
473 |
/***/ 29: |
|
474 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
475 |
|
|
476 |
"use strict"; |
|
477 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); |
|
478 |
/* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26); |
|
479 |
|
|
480 |
function _unsupportedIterableToArray(o, minLen) { |
|
481 |
if (!o) return; |
|
482 |
if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
483 |
var n = Object.prototype.toString.call(o).slice(8, -1); |
|
484 |
if (n === "Object" && o.constructor) n = o.constructor.name; |
|
485 |
if (n === "Map" || n === "Set") return Array.from(o); |
|
486 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
487 |
} |
|
488 |
|
|
489 |
/***/ }), |
|
490 |
|
|
491 |
/***/ 3: |
|
492 |
/***/ (function(module, exports) { |
|
493 |
|
|
494 |
(function() { module.exports = this["wp"]["components"]; }()); |
|
495 |
|
|
496 |
/***/ }), |
|
497 |
|
|
498 |
/***/ 30: |
|
499 |
/***/ (function(module, exports) { |
|
500 |
|
|
501 |
(function() { module.exports = this["wp"]["dom"]; }()); |
|
502 |
|
|
503 |
/***/ }), |
|
504 |
|
|
505 |
/***/ 301: |
9
|
506 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
507 |
|
|
508 |
"use strict"; |
16
|
509 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
510 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
511 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
512 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
513 |
|
|
514 |
|
|
515 |
/** |
|
516 |
* WordPress dependencies |
|
517 |
*/ |
|
518 |
|
|
519 |
var code = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
520 |
viewBox: "0 0 24 24", |
|
521 |
xmlns: "http://www.w3.org/2000/svg" |
|
522 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
523 |
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" |
|
524 |
})); |
|
525 |
/* harmony default export */ __webpack_exports__["a"] = (code); |
|
526 |
|
|
527 |
|
|
528 |
/***/ }), |
|
529 |
|
|
530 |
/***/ 31: |
|
531 |
/***/ (function(module, exports) { |
|
532 |
|
|
533 |
(function() { module.exports = this["wp"]["url"]; }()); |
|
534 |
|
|
535 |
/***/ }), |
|
536 |
|
|
537 |
/***/ 38: |
|
538 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
539 |
|
|
540 |
"use strict"; |
|
541 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); |
|
542 |
function _arrayWithHoles(arr) { |
|
543 |
if (Array.isArray(arr)) return arr; |
|
544 |
} |
|
545 |
|
|
546 |
/***/ }), |
|
547 |
|
|
548 |
/***/ 39: |
|
549 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
550 |
|
|
551 |
"use strict"; |
|
552 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); |
|
553 |
function _nonIterableRest() { |
|
554 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
555 |
} |
|
556 |
|
|
557 |
/***/ }), |
|
558 |
|
|
559 |
/***/ 4: |
|
560 |
/***/ (function(module, exports) { |
|
561 |
|
|
562 |
(function() { module.exports = this["wp"]["data"]; }()); |
|
563 |
|
|
564 |
/***/ }), |
|
565 |
|
|
566 |
/***/ 40: |
|
567 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
568 |
|
|
569 |
"use strict"; |
|
570 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); |
|
571 |
function _typeof(obj) { |
|
572 |
"@babel/helpers - typeof"; |
|
573 |
|
|
574 |
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
|
575 |
_typeof = function _typeof(obj) { |
|
576 |
return typeof obj; |
|
577 |
}; |
|
578 |
} else { |
|
579 |
_typeof = function _typeof(obj) { |
|
580 |
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
|
581 |
}; |
|
582 |
} |
|
583 |
|
|
584 |
return _typeof(obj); |
|
585 |
} |
|
586 |
|
|
587 |
/***/ }), |
|
588 |
|
|
589 |
/***/ 41: |
|
590 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
591 |
|
|
592 |
"use strict"; |
|
593 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); |
9
|
594 |
function _objectWithoutPropertiesLoose(source, excluded) { |
|
595 |
if (source == null) return {}; |
|
596 |
var target = {}; |
|
597 |
var sourceKeys = Object.keys(source); |
|
598 |
var key, i; |
|
599 |
|
|
600 |
for (i = 0; i < sourceKeys.length; i++) { |
|
601 |
key = sourceKeys[i]; |
|
602 |
if (excluded.indexOf(key) >= 0) continue; |
|
603 |
target[key] = source[key]; |
|
604 |
} |
|
605 |
|
|
606 |
return target; |
|
607 |
} |
|
608 |
|
|
609 |
/***/ }), |
|
610 |
|
16
|
611 |
/***/ 410: |
9
|
612 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
613 |
|
|
614 |
"use strict"; |
16
|
615 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
616 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
617 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
618 |
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
619 |
|
|
620 |
|
|
621 |
/** |
|
622 |
* WordPress dependencies |
|
623 |
*/ |
|
624 |
|
|
625 |
var textColor = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
626 |
xmlns: "http://www.w3.org/2000/svg", |
|
627 |
viewBox: "-2 -2 24 24" |
|
628 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
629 |
d: "M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z" |
|
630 |
})); |
|
631 |
/* harmony default export */ __webpack_exports__["a"] = (textColor); |
|
632 |
|
9
|
633 |
|
|
634 |
/***/ }), |
|
635 |
|
16
|
636 |
/***/ 446: |
9
|
637 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
638 |
|
|
639 |
"use strict"; |
16
|
640 |
// ESM COMPAT FLAG |
9
|
641 |
__webpack_require__.r(__webpack_exports__); |
|
642 |
|
16
|
643 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js |
|
644 |
var objectWithoutProperties = __webpack_require__(15); |
9
|
645 |
|
|
646 |
// EXTERNAL MODULE: external {"this":["wp","richText"]} |
16
|
647 |
var external_this_wp_richText_ = __webpack_require__(25); |
9
|
648 |
|
|
649 |
// EXTERNAL MODULE: external {"this":["wp","element"]} |
|
650 |
var external_this_wp_element_ = __webpack_require__(0); |
|
651 |
|
|
652 |
// EXTERNAL MODULE: external {"this":["wp","i18n"]} |
|
653 |
var external_this_wp_i18n_ = __webpack_require__(1); |
|
654 |
|
|
655 |
// EXTERNAL MODULE: external {"this":["wp","blockEditor"]} |
16
|
656 |
var external_this_wp_blockEditor_ = __webpack_require__(7); |
|
657 |
|
|
658 |
// EXTERNAL MODULE: external {"this":["wp","primitives"]} |
|
659 |
var external_this_wp_primitives_ = __webpack_require__(6); |
|
660 |
|
|
661 |
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js |
|
662 |
|
|
663 |
|
|
664 |
/** |
|
665 |
* WordPress dependencies |
|
666 |
*/ |
|
667 |
|
|
668 |
var formatBold = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
669 |
xmlns: "http://www.w3.org/2000/svg", |
|
670 |
viewBox: "0 0 24 24" |
|
671 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
672 |
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" |
|
673 |
})); |
|
674 |
/* harmony default export */ var format_bold = (formatBold); |
9
|
675 |
|
|
676 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js |
|
677 |
|
|
678 |
|
|
679 |
/** |
|
680 |
* WordPress dependencies |
|
681 |
*/ |
|
682 |
|
|
683 |
|
|
684 |
|
|
685 |
|
|
686 |
var bold_name = 'core/bold'; |
16
|
687 |
|
|
688 |
var title = Object(external_this_wp_i18n_["__"])('Bold'); |
|
689 |
|
9
|
690 |
var bold = { |
|
691 |
name: bold_name, |
16
|
692 |
title: title, |
9
|
693 |
tagName: 'strong', |
|
694 |
className: null, |
|
695 |
edit: function edit(_ref) { |
|
696 |
var isActive = _ref.isActive, |
|
697 |
value = _ref.value, |
16
|
698 |
onChange = _ref.onChange, |
|
699 |
onFocus = _ref.onFocus; |
|
700 |
|
|
701 |
function onToggle() { |
|
702 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
9
|
703 |
type: bold_name |
|
704 |
})); |
16
|
705 |
} |
|
706 |
|
|
707 |
function onClick() { |
|
708 |
onToggle(); |
|
709 |
onFocus(); |
|
710 |
} |
9
|
711 |
|
|
712 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], { |
|
713 |
type: "primary", |
|
714 |
character: "b", |
|
715 |
onUse: onToggle |
|
716 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
717 |
name: "bold", |
16
|
718 |
icon: format_bold, |
|
719 |
title: title, |
|
720 |
onClick: onClick, |
9
|
721 |
isActive: isActive, |
|
722 |
shortcutType: "primary", |
|
723 |
shortcutCharacter: "b" |
16
|
724 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], { |
9
|
725 |
inputType: "formatBold", |
|
726 |
onInput: onToggle |
|
727 |
})); |
|
728 |
} |
|
729 |
}; |
|
730 |
|
16
|
731 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js |
|
732 |
var code = __webpack_require__(301); |
|
733 |
|
9
|
734 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/code/index.js |
|
735 |
|
|
736 |
|
|
737 |
/** |
|
738 |
* WordPress dependencies |
|
739 |
*/ |
|
740 |
|
|
741 |
|
|
742 |
|
|
743 |
|
|
744 |
var code_name = 'core/code'; |
16
|
745 |
|
|
746 |
var code_title = Object(external_this_wp_i18n_["__"])('Inline Code'); |
|
747 |
|
|
748 |
var code_code = { |
9
|
749 |
name: code_name, |
16
|
750 |
title: code_title, |
9
|
751 |
tagName: 'code', |
|
752 |
className: null, |
16
|
753 |
__unstableInputRule: function __unstableInputRule(value) { |
|
754 |
var BACKTICK = '`'; |
|
755 |
var _value = value, |
|
756 |
start = _value.start, |
|
757 |
text = _value.text; |
|
758 |
var characterBefore = text.slice(start - 1, start); // Quick check the text for the necessary character. |
|
759 |
|
|
760 |
if (characterBefore !== BACKTICK) { |
|
761 |
return value; |
|
762 |
} |
|
763 |
|
|
764 |
var textBefore = text.slice(0, start - 1); |
|
765 |
var indexBefore = textBefore.lastIndexOf(BACKTICK); |
|
766 |
|
|
767 |
if (indexBefore === -1) { |
|
768 |
return value; |
|
769 |
} |
|
770 |
|
|
771 |
var startIndex = indexBefore; |
|
772 |
var endIndex = start - 2; |
|
773 |
|
|
774 |
if (startIndex === endIndex) { |
|
775 |
return value; |
|
776 |
} |
|
777 |
|
|
778 |
value = Object(external_this_wp_richText_["remove"])(value, startIndex, startIndex + 1); |
|
779 |
value = Object(external_this_wp_richText_["remove"])(value, endIndex, endIndex + 1); |
|
780 |
value = Object(external_this_wp_richText_["applyFormat"])(value, { |
|
781 |
type: code_name |
|
782 |
}, startIndex, endIndex); |
|
783 |
return value; |
|
784 |
}, |
9
|
785 |
edit: function edit(_ref) { |
|
786 |
var value = _ref.value, |
|
787 |
onChange = _ref.onChange, |
16
|
788 |
onFocus = _ref.onFocus, |
9
|
789 |
isActive = _ref.isActive; |
|
790 |
|
16
|
791 |
function onClick() { |
|
792 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
9
|
793 |
type: code_name |
|
794 |
})); |
16
|
795 |
onFocus(); |
|
796 |
} |
|
797 |
|
|
798 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
799 |
icon: code["a" /* default */], |
|
800 |
title: code_title, |
|
801 |
onClick: onClick, |
|
802 |
isActive: isActive |
|
803 |
}); |
9
|
804 |
} |
|
805 |
}; |
|
806 |
|
16
|
807 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
808 |
var defineProperty = __webpack_require__(5); |
9
|
809 |
|
|
810 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
16
|
811 |
var classCallCheck = __webpack_require__(20); |
9
|
812 |
|
|
813 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js |
16
|
814 |
var createClass = __webpack_require__(19); |
|
815 |
|
|
816 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
|
817 |
var assertThisInitialized = __webpack_require__(12); |
9
|
818 |
|
|
819 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
16
|
820 |
var possibleConstructorReturn = __webpack_require__(23); |
9
|
821 |
|
|
822 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
16
|
823 |
var getPrototypeOf = __webpack_require__(16); |
9
|
824 |
|
|
825 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules |
16
|
826 |
var inherits = __webpack_require__(22); |
9
|
827 |
|
|
828 |
// EXTERNAL MODULE: external {"this":["wp","components"]} |
16
|
829 |
var external_this_wp_components_ = __webpack_require__(3); |
9
|
830 |
|
|
831 |
// EXTERNAL MODULE: external {"this":["wp","keycodes"]} |
16
|
832 |
var external_this_wp_keycodes_ = __webpack_require__(21); |
|
833 |
|
|
834 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js |
|
835 |
var keyboard_return = __webpack_require__(203); |
9
|
836 |
|
|
837 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/image/index.js |
|
838 |
|
|
839 |
|
|
840 |
|
|
841 |
|
|
842 |
|
|
843 |
|
|
844 |
|
|
845 |
|
|
846 |
|
16
|
847 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
848 |
|
|
849 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
850 |
|
|
851 |
function _createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } |
|
852 |
|
|
853 |
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } |
|
854 |
|
9
|
855 |
/** |
|
856 |
* WordPress dependencies |
|
857 |
*/ |
|
858 |
|
|
859 |
|
|
860 |
|
|
861 |
|
|
862 |
|
|
863 |
|
16
|
864 |
|
9
|
865 |
var ALLOWED_MEDIA_TYPES = ['image']; |
|
866 |
var image_name = 'core/image'; |
|
867 |
|
16
|
868 |
var image_title = Object(external_this_wp_i18n_["__"])('Inline image'); |
|
869 |
|
9
|
870 |
var stopKeyPropagation = function stopKeyPropagation(event) { |
|
871 |
return event.stopPropagation(); |
|
872 |
}; |
|
873 |
|
16
|
874 |
function getRange() { |
|
875 |
var selection = window.getSelection(); |
|
876 |
return selection.rangeCount ? selection.getRangeAt(0) : null; |
|
877 |
} |
|
878 |
|
9
|
879 |
var image_image = { |
|
880 |
name: image_name, |
16
|
881 |
title: image_title, |
9
|
882 |
keywords: [Object(external_this_wp_i18n_["__"])('photo'), Object(external_this_wp_i18n_["__"])('media')], |
|
883 |
object: true, |
|
884 |
tagName: 'img', |
|
885 |
className: null, |
|
886 |
attributes: { |
|
887 |
className: 'class', |
|
888 |
style: 'style', |
|
889 |
url: 'src', |
|
890 |
alt: 'alt' |
|
891 |
}, |
16
|
892 |
edit: /*#__PURE__*/function (_Component) { |
9
|
893 |
Object(inherits["a" /* default */])(ImageEdit, _Component); |
|
894 |
|
16
|
895 |
var _super = _createSuper(ImageEdit); |
|
896 |
|
9
|
897 |
function ImageEdit() { |
|
898 |
var _this; |
|
899 |
|
|
900 |
Object(classCallCheck["a" /* default */])(this, ImageEdit); |
|
901 |
|
16
|
902 |
_this = _super.apply(this, arguments); |
|
903 |
_this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
904 |
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
905 |
_this.openModal = _this.openModal.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
906 |
_this.closeModal = _this.closeModal.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
907 |
_this.anchorRef = null; |
9
|
908 |
_this.state = { |
|
909 |
modal: false |
|
910 |
}; |
|
911 |
return _this; |
|
912 |
} |
|
913 |
|
|
914 |
Object(createClass["a" /* default */])(ImageEdit, [{ |
|
915 |
key: "onChange", |
|
916 |
value: function onChange(width) { |
|
917 |
this.setState({ |
|
918 |
width: width |
|
919 |
}); |
|
920 |
} |
|
921 |
}, { |
|
922 |
key: "onKeyDown", |
|
923 |
value: function onKeyDown(event) { |
|
924 |
if ([external_this_wp_keycodes_["LEFT"], external_this_wp_keycodes_["DOWN"], external_this_wp_keycodes_["RIGHT"], external_this_wp_keycodes_["UP"], external_this_wp_keycodes_["BACKSPACE"], external_this_wp_keycodes_["ENTER"]].indexOf(event.keyCode) > -1) { |
|
925 |
// Stop the key event from propagating up to ObserveTyping.startTypingInTextField. |
|
926 |
event.stopPropagation(); |
|
927 |
} |
|
928 |
} |
|
929 |
}, { |
|
930 |
key: "openModal", |
|
931 |
value: function openModal() { |
|
932 |
this.setState({ |
|
933 |
modal: true |
|
934 |
}); |
|
935 |
} |
|
936 |
}, { |
|
937 |
key: "closeModal", |
|
938 |
value: function closeModal() { |
|
939 |
this.setState({ |
|
940 |
modal: false |
|
941 |
}); |
|
942 |
} |
|
943 |
}, { |
16
|
944 |
key: "componentDidMount", |
|
945 |
value: function componentDidMount() { |
|
946 |
this.anchorRef = getRange(); |
|
947 |
} |
|
948 |
}, { |
|
949 |
key: "componentDidUpdate", |
|
950 |
value: function componentDidUpdate(prevProps) { |
|
951 |
// When the popover is open or when the selected image changes, |
|
952 |
// update the anchorRef. |
|
953 |
if (!prevProps.isObjectActive && this.props.isObjectActive || prevProps.activeObjectAttributes.url !== this.props.activeObjectAttributes.url) { |
|
954 |
this.anchorRef = getRange(); |
|
955 |
} |
|
956 |
} |
|
957 |
}, { |
9
|
958 |
key: "render", |
|
959 |
value: function render() { |
|
960 |
var _this2 = this; |
|
961 |
|
|
962 |
var _this$props = this.props, |
|
963 |
value = _this$props.value, |
|
964 |
onChange = _this$props.onChange, |
16
|
965 |
onFocus = _this$props.onFocus, |
9
|
966 |
isObjectActive = _this$props.isObjectActive, |
|
967 |
activeObjectAttributes = _this$props.activeObjectAttributes; |
|
968 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUploadCheck"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
969 |
icon: Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SVG"], { |
|
970 |
xmlns: "http://www.w3.org/2000/svg", |
|
971 |
viewBox: "0 0 24 24" |
|
972 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Path"], { |
16
|
973 |
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" |
9
|
974 |
})), |
16
|
975 |
title: image_title, |
9
|
976 |
onClick: this.openModal, |
|
977 |
isActive: isObjectActive |
|
978 |
}), this.state.modal && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUpload"], { |
|
979 |
allowedTypes: ALLOWED_MEDIA_TYPES, |
|
980 |
onSelect: function onSelect(_ref) { |
|
981 |
var id = _ref.id, |
|
982 |
url = _ref.url, |
|
983 |
alt = _ref.alt, |
|
984 |
width = _ref.width; |
|
985 |
|
|
986 |
_this2.closeModal(); |
|
987 |
|
|
988 |
onChange(Object(external_this_wp_richText_["insertObject"])(value, { |
|
989 |
type: image_name, |
|
990 |
attributes: { |
|
991 |
className: "wp-image-".concat(id), |
|
992 |
style: "width: ".concat(Math.min(width, 150), "px;"), |
|
993 |
url: url, |
|
994 |
alt: alt |
|
995 |
} |
|
996 |
})); |
16
|
997 |
onFocus(); |
9
|
998 |
}, |
|
999 |
onClose: this.closeModal, |
|
1000 |
render: function render(_ref2) { |
|
1001 |
var open = _ref2.open; |
|
1002 |
open(); |
|
1003 |
return null; |
|
1004 |
} |
16
|
1005 |
}), isObjectActive && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Popover"], { |
9
|
1006 |
position: "bottom center", |
16
|
1007 |
focusOnMount: false, |
|
1008 |
anchorRef: this.anchorRef |
9
|
1009 |
}, Object(external_this_wp_element_["createElement"])("form", { |
16
|
1010 |
className: "block-editor-format-toolbar__image-container-content", |
9
|
1011 |
onKeyPress: stopKeyPropagation, |
|
1012 |
onKeyDown: this.onKeyDown, |
|
1013 |
onSubmit: function onSubmit(event) { |
|
1014 |
var newReplacements = value.replacements.slice(); |
|
1015 |
newReplacements[value.start] = { |
|
1016 |
type: image_name, |
16
|
1017 |
attributes: _objectSpread({}, activeObjectAttributes, { |
9
|
1018 |
style: "width: ".concat(_this2.state.width, "px;") |
|
1019 |
}) |
|
1020 |
}; |
16
|
1021 |
onChange(_objectSpread({}, value, { |
9
|
1022 |
replacements: newReplacements |
|
1023 |
})); |
|
1024 |
event.preventDefault(); |
|
1025 |
} |
|
1026 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], { |
16
|
1027 |
className: "block-editor-format-toolbar__image-container-value", |
9
|
1028 |
type: "number", |
|
1029 |
label: Object(external_this_wp_i18n_["__"])('Width'), |
|
1030 |
value: this.state.width, |
|
1031 |
min: 1, |
|
1032 |
onChange: this.onChange |
16
|
1033 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], { |
|
1034 |
icon: keyboard_return["a" /* default */], |
9
|
1035 |
label: Object(external_this_wp_i18n_["__"])('Apply'), |
|
1036 |
type: "submit" |
16
|
1037 |
})))); |
9
|
1038 |
} |
|
1039 |
}], [{ |
|
1040 |
key: "getDerivedStateFromProps", |
|
1041 |
value: function getDerivedStateFromProps(props, state) { |
|
1042 |
var style = props.activeObjectAttributes.style; |
|
1043 |
|
|
1044 |
if (style === state.previousStyle) { |
|
1045 |
return null; |
|
1046 |
} |
|
1047 |
|
|
1048 |
if (!style) { |
|
1049 |
return { |
|
1050 |
width: undefined, |
|
1051 |
previousStyle: style |
|
1052 |
}; |
|
1053 |
} |
|
1054 |
|
|
1055 |
return { |
|
1056 |
width: style.replace(/\D/g, ''), |
|
1057 |
previousStyle: style |
|
1058 |
}; |
|
1059 |
} |
|
1060 |
}]); |
|
1061 |
|
|
1062 |
return ImageEdit; |
|
1063 |
}(external_this_wp_element_["Component"]) |
|
1064 |
}; |
|
1065 |
|
16
|
1066 |
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-italic.js |
|
1067 |
|
|
1068 |
|
|
1069 |
/** |
|
1070 |
* WordPress dependencies |
|
1071 |
*/ |
|
1072 |
|
|
1073 |
var formatItalic = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1074 |
xmlns: "http://www.w3.org/2000/svg", |
|
1075 |
viewBox: "0 0 24 24" |
|
1076 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1077 |
d: "M12.5 5L10 19h1.9l2.5-14z" |
|
1078 |
})); |
|
1079 |
/* harmony default export */ var format_italic = (formatItalic); |
|
1080 |
|
9
|
1081 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/italic/index.js |
|
1082 |
|
|
1083 |
|
|
1084 |
/** |
|
1085 |
* WordPress dependencies |
|
1086 |
*/ |
|
1087 |
|
|
1088 |
|
|
1089 |
|
|
1090 |
|
|
1091 |
var italic_name = 'core/italic'; |
16
|
1092 |
|
|
1093 |
var italic_title = Object(external_this_wp_i18n_["__"])('Italic'); |
|
1094 |
|
9
|
1095 |
var italic = { |
|
1096 |
name: italic_name, |
16
|
1097 |
title: italic_title, |
9
|
1098 |
tagName: 'em', |
|
1099 |
className: null, |
|
1100 |
edit: function edit(_ref) { |
|
1101 |
var isActive = _ref.isActive, |
|
1102 |
value = _ref.value, |
16
|
1103 |
onChange = _ref.onChange, |
|
1104 |
onFocus = _ref.onFocus; |
|
1105 |
|
|
1106 |
function onToggle() { |
|
1107 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
9
|
1108 |
type: italic_name |
|
1109 |
})); |
16
|
1110 |
} |
|
1111 |
|
|
1112 |
function onClick() { |
|
1113 |
onToggle(); |
|
1114 |
onFocus(); |
|
1115 |
} |
9
|
1116 |
|
|
1117 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], { |
|
1118 |
type: "primary", |
|
1119 |
character: "i", |
|
1120 |
onUse: onToggle |
|
1121 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
1122 |
name: "italic", |
16
|
1123 |
icon: format_italic, |
|
1124 |
title: italic_title, |
|
1125 |
onClick: onClick, |
9
|
1126 |
isActive: isActive, |
|
1127 |
shortcutType: "primary", |
|
1128 |
shortcutCharacter: "i" |
16
|
1129 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], { |
9
|
1130 |
inputType: "formatItalic", |
|
1131 |
onInput: onToggle |
|
1132 |
})); |
|
1133 |
} |
|
1134 |
}; |
|
1135 |
|
|
1136 |
// EXTERNAL MODULE: external {"this":["wp","url"]} |
16
|
1137 |
var external_this_wp_url_ = __webpack_require__(31); |
|
1138 |
|
|
1139 |
// EXTERNAL MODULE: external {"this":["wp","htmlEntities"]} |
|
1140 |
var external_this_wp_htmlEntities_ = __webpack_require__(75); |
|
1141 |
|
|
1142 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js |
|
1143 |
var link_off = __webpack_require__(205); |
|
1144 |
|
|
1145 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js |
|
1146 |
var library_link = __webpack_require__(180); |
|
1147 |
|
|
1148 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules |
|
1149 |
var slicedToArray = __webpack_require__(14); |
|
1150 |
|
|
1151 |
// EXTERNAL MODULE: external {"this":"lodash"} |
|
1152 |
var external_this_lodash_ = __webpack_require__(2); |
9
|
1153 |
|
|
1154 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js |
|
1155 |
/** |
|
1156 |
* External dependencies |
|
1157 |
*/ |
|
1158 |
|
|
1159 |
/** |
|
1160 |
* WordPress dependencies |
|
1161 |
*/ |
|
1162 |
|
|
1163 |
|
|
1164 |
/** |
|
1165 |
* Check for issues with the provided href. |
|
1166 |
* |
|
1167 |
* @param {string} href The href. |
|
1168 |
* |
|
1169 |
* @return {boolean} Is the href invalid? |
|
1170 |
*/ |
|
1171 |
|
|
1172 |
function isValidHref(href) { |
|
1173 |
if (!href) { |
|
1174 |
return false; |
|
1175 |
} |
|
1176 |
|
|
1177 |
var trimmedHref = href.trim(); |
|
1178 |
|
|
1179 |
if (!trimmedHref) { |
|
1180 |
return false; |
|
1181 |
} // Does the href start with something that looks like a URL protocol? |
|
1182 |
|
|
1183 |
|
|
1184 |
if (/^\S+:/.test(trimmedHref)) { |
|
1185 |
var protocol = Object(external_this_wp_url_["getProtocol"])(trimmedHref); |
|
1186 |
|
|
1187 |
if (!Object(external_this_wp_url_["isValidProtocol"])(protocol)) { |
|
1188 |
return false; |
|
1189 |
} // Add some extra checks for http(s) URIs, since these are the most common use-case. |
|
1190 |
// This ensures URIs with an http protocol have exactly two forward slashes following the protocol. |
|
1191 |
|
|
1192 |
|
16
|
1193 |
if (Object(external_this_lodash_["startsWith"])(protocol, 'http') && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) { |
9
|
1194 |
return false; |
|
1195 |
} |
|
1196 |
|
|
1197 |
var authority = Object(external_this_wp_url_["getAuthority"])(trimmedHref); |
|
1198 |
|
|
1199 |
if (!Object(external_this_wp_url_["isValidAuthority"])(authority)) { |
|
1200 |
return false; |
|
1201 |
} |
|
1202 |
|
|
1203 |
var path = Object(external_this_wp_url_["getPath"])(trimmedHref); |
|
1204 |
|
|
1205 |
if (path && !Object(external_this_wp_url_["isValidPath"])(path)) { |
|
1206 |
return false; |
|
1207 |
} |
|
1208 |
|
|
1209 |
var queryString = Object(external_this_wp_url_["getQueryString"])(trimmedHref); |
|
1210 |
|
|
1211 |
if (queryString && !Object(external_this_wp_url_["isValidQueryString"])(queryString)) { |
|
1212 |
return false; |
|
1213 |
} |
|
1214 |
|
|
1215 |
var fragment = Object(external_this_wp_url_["getFragment"])(trimmedHref); |
|
1216 |
|
|
1217 |
if (fragment && !Object(external_this_wp_url_["isValidFragment"])(fragment)) { |
|
1218 |
return false; |
|
1219 |
} |
|
1220 |
} // Validate anchor links. |
|
1221 |
|
|
1222 |
|
16
|
1223 |
if (Object(external_this_lodash_["startsWith"])(trimmedHref, '#') && !Object(external_this_wp_url_["isValidFragment"])(trimmedHref)) { |
9
|
1224 |
return false; |
|
1225 |
} |
|
1226 |
|
|
1227 |
return true; |
|
1228 |
} |
|
1229 |
/** |
|
1230 |
* Generates the format object that will be applied to the link text. |
|
1231 |
* |
16
|
1232 |
* @param {Object} options |
|
1233 |
* @param {string} options.url The href of the link. |
|
1234 |
* @param {string} options.type The type of the link. |
|
1235 |
* @param {string} options.id The ID of the link. |
|
1236 |
* @param {boolean} options.opensInNewWindow Whether this link will open in a new window. |
9
|
1237 |
* |
|
1238 |
* @return {Object} The final format object. |
|
1239 |
*/ |
|
1240 |
|
|
1241 |
function createLinkFormat(_ref) { |
|
1242 |
var url = _ref.url, |
16
|
1243 |
type = _ref.type, |
|
1244 |
id = _ref.id, |
|
1245 |
opensInNewWindow = _ref.opensInNewWindow; |
9
|
1246 |
var format = { |
|
1247 |
type: 'core/link', |
|
1248 |
attributes: { |
|
1249 |
url: url |
|
1250 |
} |
|
1251 |
}; |
16
|
1252 |
if (type) format.attributes.type = type; |
|
1253 |
if (id) format.attributes.id = id; |
9
|
1254 |
|
|
1255 |
if (opensInNewWindow) { |
|
1256 |
format.attributes.target = '_blank'; |
|
1257 |
format.attributes.rel = 'noreferrer noopener'; |
|
1258 |
} |
|
1259 |
|
|
1260 |
return format; |
|
1261 |
} |
|
1262 |
|
|
1263 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js |
|
1264 |
|
|
1265 |
|
|
1266 |
|
|
1267 |
|
16
|
1268 |
function inline_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } |
|
1269 |
|
|
1270 |
function inline_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { inline_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { inline_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
9
|
1271 |
|
|
1272 |
/** |
|
1273 |
* External dependencies |
|
1274 |
*/ |
|
1275 |
|
|
1276 |
/** |
|
1277 |
* WordPress dependencies |
|
1278 |
*/ |
|
1279 |
|
|
1280 |
|
|
1281 |
|
|
1282 |
|
|
1283 |
|
|
1284 |
|
|
1285 |
|
|
1286 |
/** |
|
1287 |
* Internal dependencies |
|
1288 |
*/ |
|
1289 |
|
|
1290 |
|
|
1291 |
|
16
|
1292 |
function InlineLinkUI(_ref) { |
|
1293 |
var isActive = _ref.isActive, |
|
1294 |
activeAttributes = _ref.activeAttributes, |
|
1295 |
addingLink = _ref.addingLink, |
|
1296 |
value = _ref.value, |
|
1297 |
onChange = _ref.onChange, |
|
1298 |
speak = _ref.speak, |
|
1299 |
stopAddingLink = _ref.stopAddingLink; |
|
1300 |
|
|
1301 |
/** |
|
1302 |
* A unique key is generated when switching between editing and not editing |
|
1303 |
* a link, based on: |
|
1304 |
* |
|
1305 |
* - This component may be rendered _either_ when a link is active _or_ |
|
1306 |
* when adding or editing a link. |
|
1307 |
* - It's only desirable to shift focus into the Popover when explicitly |
|
1308 |
* adding or editing a link, not when in the inline boundary of a link. |
|
1309 |
* - Focus behavior can only be controlled on a Popover at the time it |
|
1310 |
* mounts, so a new instance of the component must be mounted to |
|
1311 |
* programmatically enact the focusOnMount behavior. |
|
1312 |
* |
|
1313 |
* @type {string} |
|
1314 |
*/ |
|
1315 |
var mountingKey = Object(external_this_wp_element_["useMemo"])(external_this_lodash_["uniqueId"], [addingLink]); |
|
1316 |
/** |
|
1317 |
* Pending settings to be applied to the next link. When inserting a new |
|
1318 |
* link, toggle values cannot be applied immediately, because there is not |
|
1319 |
* yet a link for them to apply to. Thus, they are maintained in a state |
|
1320 |
* value until the time that the link can be inserted or edited. |
|
1321 |
* |
|
1322 |
* @type {[Object|undefined,Function]} |
|
1323 |
*/ |
|
1324 |
|
|
1325 |
var _useState = Object(external_this_wp_element_["useState"])(), |
|
1326 |
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), |
|
1327 |
nextLinkValue = _useState2[0], |
|
1328 |
setNextLinkValue = _useState2[1]; |
|
1329 |
|
|
1330 |
var anchorRef = Object(external_this_wp_element_["useMemo"])(function () { |
9
|
1331 |
var selection = window.getSelection(); |
16
|
1332 |
|
|
1333 |
if (!selection.rangeCount) { |
9
|
1334 |
return; |
|
1335 |
} |
|
1336 |
|
16
|
1337 |
var range = selection.getRangeAt(0); |
|
1338 |
|
|
1339 |
if (addingLink && !isActive) { |
|
1340 |
return range; |
9
|
1341 |
} |
|
1342 |
|
|
1343 |
var element = range.startContainer; // If the caret is right before the element, select the next element. |
|
1344 |
|
|
1345 |
element = element.nextElementSibling || element; |
|
1346 |
|
|
1347 |
while (element.nodeType !== window.Node.ELEMENT_NODE) { |
|
1348 |
element = element.parentNode; |
|
1349 |
} |
|
1350 |
|
16
|
1351 |
return element.closest('a'); |
|
1352 |
}, [addingLink, value.start, value.end]); |
|
1353 |
|
|
1354 |
var linkValue = inline_objectSpread({ |
|
1355 |
url: activeAttributes.url, |
|
1356 |
type: activeAttributes.type, |
|
1357 |
id: activeAttributes.id, |
|
1358 |
opensInNewTab: activeAttributes.target === '_blank' |
|
1359 |
}, nextLinkValue); |
|
1360 |
|
|
1361 |
function onChangeLink(nextValue) { |
|
1362 |
// Merge with values from state, both for the purpose of assigning the |
|
1363 |
// next state value, and for use in constructing the new link format if |
|
1364 |
// the link is ready to be applied. |
|
1365 |
nextValue = inline_objectSpread({}, nextLinkValue, {}, nextValue); // LinkControl calls `onChange` immediately upon the toggling a setting. |
|
1366 |
|
|
1367 |
var didToggleSetting = linkValue.opensInNewTab !== nextValue.opensInNewTab && linkValue.url === nextValue.url; // If change handler was called as a result of a settings change during |
|
1368 |
// link insertion, it must be held in state until the link is ready to |
|
1369 |
// be applied. |
|
1370 |
|
|
1371 |
var didToggleSettingForNewLink = didToggleSetting && nextValue.url === undefined; // If link will be assigned, the state value can be considered flushed. |
|
1372 |
// Otherwise, persist the pending changes. |
|
1373 |
|
|
1374 |
setNextLinkValue(didToggleSettingForNewLink ? nextValue : undefined); |
|
1375 |
|
|
1376 |
if (didToggleSettingForNewLink) { |
|
1377 |
return; |
9
|
1378 |
} |
16
|
1379 |
|
|
1380 |
var newUrl = Object(external_this_wp_url_["prependHTTP"])(nextValue.url); |
|
1381 |
var format = createLinkFormat({ |
|
1382 |
url: newUrl, |
|
1383 |
type: nextValue.type, |
|
1384 |
id: nextValue.id !== undefined && nextValue.id !== null ? String(nextValue.id) : undefined, |
|
1385 |
opensInNewWindow: nextValue.opensInNewTab |
|
1386 |
}); |
|
1387 |
|
|
1388 |
if (Object(external_this_wp_richText_["isCollapsed"])(value) && !isActive) { |
|
1389 |
var newText = nextValue.title || newUrl; |
|
1390 |
var toInsert = Object(external_this_wp_richText_["applyFormat"])(Object(external_this_wp_richText_["create"])({ |
|
1391 |
text: newText |
|
1392 |
}), format, 0, newText.length); |
|
1393 |
onChange(Object(external_this_wp_richText_["insert"])(value, toInsert)); |
|
1394 |
} else { |
|
1395 |
var newValue = Object(external_this_wp_richText_["applyFormat"])(value, format); |
|
1396 |
newValue.start = newValue.end; |
|
1397 |
newValue.activeFormats = []; |
|
1398 |
onChange(newValue); |
|
1399 |
} // Focus should only be shifted back to the formatted segment when the |
|
1400 |
// URL is submitted. |
|
1401 |
|
|
1402 |
|
|
1403 |
if (!didToggleSetting) { |
|
1404 |
stopAddingLink(); |
9
|
1405 |
} |
16
|
1406 |
|
|
1407 |
if (!isValidHref(newUrl)) { |
|
1408 |
speak(Object(external_this_wp_i18n_["__"])('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive'); |
|
1409 |
} else if (isActive) { |
|
1410 |
speak(Object(external_this_wp_i18n_["__"])('Link edited.'), 'assertive'); |
|
1411 |
} else { |
|
1412 |
speak(Object(external_this_wp_i18n_["__"])('Link inserted.'), 'assertive'); |
9
|
1413 |
} |
16
|
1414 |
} |
|
1415 |
|
|
1416 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Popover"], { |
|
1417 |
key: mountingKey, |
|
1418 |
anchorRef: anchorRef, |
|
1419 |
focusOnMount: addingLink ? 'firstElement' : false, |
|
1420 |
onClose: stopAddingLink, |
|
1421 |
position: "bottom center" |
|
1422 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalLinkControl"], { |
|
1423 |
value: linkValue, |
|
1424 |
onChange: onChangeLink, |
|
1425 |
forceIsEditingLink: addingLink |
|
1426 |
})); |
|
1427 |
} |
|
1428 |
|
|
1429 |
/* harmony default export */ var inline = (Object(external_this_wp_components_["withSpokenMessages"])(InlineLinkUI)); |
9
|
1430 |
|
|
1431 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js |
|
1432 |
|
|
1433 |
|
|
1434 |
|
|
1435 |
|
|
1436 |
|
|
1437 |
|
|
1438 |
|
|
1439 |
|
16
|
1440 |
function link_createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (link_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } |
|
1441 |
|
|
1442 |
function link_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } |
|
1443 |
|
9
|
1444 |
/** |
|
1445 |
* WordPress dependencies |
|
1446 |
*/ |
|
1447 |
|
|
1448 |
|
|
1449 |
|
|
1450 |
|
|
1451 |
|
|
1452 |
|
16
|
1453 |
|
|
1454 |
|
9
|
1455 |
/** |
|
1456 |
* Internal dependencies |
|
1457 |
*/ |
|
1458 |
|
|
1459 |
|
|
1460 |
var link_name = 'core/link'; |
16
|
1461 |
|
|
1462 |
var link_title = Object(external_this_wp_i18n_["__"])('Link'); |
|
1463 |
|
9
|
1464 |
var link_link = { |
|
1465 |
name: link_name, |
16
|
1466 |
title: link_title, |
9
|
1467 |
tagName: 'a', |
|
1468 |
className: null, |
|
1469 |
attributes: { |
|
1470 |
url: 'href', |
16
|
1471 |
type: 'data-type', |
|
1472 |
id: 'data-id', |
9
|
1473 |
target: 'target' |
|
1474 |
}, |
16
|
1475 |
__unstablePasteRule: function __unstablePasteRule(value, _ref) { |
|
1476 |
var html = _ref.html, |
|
1477 |
plainText = _ref.plainText; |
|
1478 |
|
|
1479 |
if (Object(external_this_wp_richText_["isCollapsed"])(value)) { |
|
1480 |
return value; |
|
1481 |
} |
|
1482 |
|
|
1483 |
var pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim(); // A URL was pasted, turn the selection into a link |
|
1484 |
|
|
1485 |
if (!Object(external_this_wp_url_["isURL"])(pastedText)) { |
|
1486 |
return value; |
|
1487 |
} // Allows us to ask for this information when we get a report. |
|
1488 |
|
|
1489 |
|
|
1490 |
window.console.log('Created link:\n\n', pastedText); |
|
1491 |
return Object(external_this_wp_richText_["applyFormat"])(value, { |
|
1492 |
type: link_name, |
|
1493 |
attributes: { |
|
1494 |
url: Object(external_this_wp_htmlEntities_["decodeEntities"])(pastedText) |
|
1495 |
} |
|
1496 |
}); |
|
1497 |
}, |
|
1498 |
edit: Object(external_this_wp_components_["withSpokenMessages"])( /*#__PURE__*/function (_Component) { |
9
|
1499 |
Object(inherits["a" /* default */])(LinkEdit, _Component); |
|
1500 |
|
16
|
1501 |
var _super = link_createSuper(LinkEdit); |
|
1502 |
|
9
|
1503 |
function LinkEdit() { |
|
1504 |
var _this; |
|
1505 |
|
|
1506 |
Object(classCallCheck["a" /* default */])(this, LinkEdit); |
|
1507 |
|
16
|
1508 |
_this = _super.apply(this, arguments); |
|
1509 |
_this.addLink = _this.addLink.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
1510 |
_this.stopAddingLink = _this.stopAddingLink.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
1511 |
_this.onRemoveFormat = _this.onRemoveFormat.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
9
|
1512 |
_this.state = { |
|
1513 |
addingLink: false |
|
1514 |
}; |
|
1515 |
return _this; |
|
1516 |
} |
|
1517 |
|
|
1518 |
Object(createClass["a" /* default */])(LinkEdit, [{ |
|
1519 |
key: "addLink", |
|
1520 |
value: function addLink() { |
|
1521 |
var _this$props = this.props, |
|
1522 |
value = _this$props.value, |
|
1523 |
onChange = _this$props.onChange; |
|
1524 |
var text = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(value)); |
|
1525 |
|
|
1526 |
if (text && Object(external_this_wp_url_["isURL"])(text)) { |
|
1527 |
onChange(Object(external_this_wp_richText_["applyFormat"])(value, { |
|
1528 |
type: link_name, |
|
1529 |
attributes: { |
|
1530 |
url: text |
|
1531 |
} |
|
1532 |
})); |
16
|
1533 |
} else if (text && Object(external_this_wp_url_["isEmail"])(text)) { |
|
1534 |
onChange(Object(external_this_wp_richText_["applyFormat"])(value, { |
|
1535 |
type: link_name, |
|
1536 |
attributes: { |
|
1537 |
url: "mailto:".concat(text) |
|
1538 |
} |
|
1539 |
})); |
9
|
1540 |
} else { |
|
1541 |
this.setState({ |
|
1542 |
addingLink: true |
|
1543 |
}); |
|
1544 |
} |
|
1545 |
} |
|
1546 |
}, { |
|
1547 |
key: "stopAddingLink", |
|
1548 |
value: function stopAddingLink() { |
|
1549 |
this.setState({ |
|
1550 |
addingLink: false |
|
1551 |
}); |
16
|
1552 |
this.props.onFocus(); |
9
|
1553 |
} |
|
1554 |
}, { |
|
1555 |
key: "onRemoveFormat", |
|
1556 |
value: function onRemoveFormat() { |
|
1557 |
var _this$props2 = this.props, |
|
1558 |
value = _this$props2.value, |
|
1559 |
onChange = _this$props2.onChange, |
|
1560 |
speak = _this$props2.speak; |
|
1561 |
onChange(Object(external_this_wp_richText_["removeFormat"])(value, link_name)); |
|
1562 |
speak(Object(external_this_wp_i18n_["__"])('Link removed.'), 'assertive'); |
|
1563 |
} |
|
1564 |
}, { |
|
1565 |
key: "render", |
|
1566 |
value: function render() { |
|
1567 |
var _this$props3 = this.props, |
|
1568 |
isActive = _this$props3.isActive, |
|
1569 |
activeAttributes = _this$props3.activeAttributes, |
|
1570 |
value = _this$props3.value, |
|
1571 |
onChange = _this$props3.onChange; |
|
1572 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], { |
|
1573 |
type: "primary", |
|
1574 |
character: "k", |
|
1575 |
onUse: this.addLink |
|
1576 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], { |
|
1577 |
type: "primaryShift", |
|
1578 |
character: "k", |
|
1579 |
onUse: this.onRemoveFormat |
|
1580 |
}), isActive && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
1581 |
name: "link", |
16
|
1582 |
icon: link_off["a" /* default */], |
9
|
1583 |
title: Object(external_this_wp_i18n_["__"])('Unlink'), |
|
1584 |
onClick: this.onRemoveFormat, |
|
1585 |
isActive: isActive, |
|
1586 |
shortcutType: "primaryShift", |
|
1587 |
shortcutCharacter: "k" |
|
1588 |
}), !isActive && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
1589 |
name: "link", |
16
|
1590 |
icon: library_link["a" /* default */], |
|
1591 |
title: link_title, |
9
|
1592 |
onClick: this.addLink, |
|
1593 |
isActive: isActive, |
|
1594 |
shortcutType: "primary", |
|
1595 |
shortcutCharacter: "k" |
16
|
1596 |
}), (this.state.addingLink || isActive) && Object(external_this_wp_element_["createElement"])(inline, { |
9
|
1597 |
addingLink: this.state.addingLink, |
|
1598 |
stopAddingLink: this.stopAddingLink, |
|
1599 |
isActive: isActive, |
|
1600 |
activeAttributes: activeAttributes, |
|
1601 |
value: value, |
|
1602 |
onChange: onChange |
|
1603 |
})); |
|
1604 |
} |
|
1605 |
}]); |
|
1606 |
|
|
1607 |
return LinkEdit; |
|
1608 |
}(external_this_wp_element_["Component"])) |
|
1609 |
}; |
|
1610 |
|
16
|
1611 |
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js |
|
1612 |
|
|
1613 |
|
|
1614 |
/** |
|
1615 |
* WordPress dependencies |
|
1616 |
*/ |
|
1617 |
|
|
1618 |
var formatStrikethrough = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1619 |
xmlns: "http://www.w3.org/2000/svg", |
|
1620 |
viewBox: "0 0 24 24" |
|
1621 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1622 |
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" |
|
1623 |
})); |
|
1624 |
/* harmony default export */ var format_strikethrough = (formatStrikethrough); |
|
1625 |
|
9
|
1626 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js |
|
1627 |
|
|
1628 |
|
|
1629 |
/** |
|
1630 |
* WordPress dependencies |
|
1631 |
*/ |
|
1632 |
|
|
1633 |
|
|
1634 |
|
|
1635 |
|
|
1636 |
var strikethrough_name = 'core/strikethrough'; |
16
|
1637 |
|
|
1638 |
var strikethrough_title = Object(external_this_wp_i18n_["__"])('Strikethrough'); |
|
1639 |
|
9
|
1640 |
var strikethrough = { |
|
1641 |
name: strikethrough_name, |
16
|
1642 |
title: strikethrough_title, |
9
|
1643 |
tagName: 's', |
|
1644 |
className: null, |
|
1645 |
edit: function edit(_ref) { |
|
1646 |
var isActive = _ref.isActive, |
|
1647 |
value = _ref.value, |
16
|
1648 |
onChange = _ref.onChange, |
|
1649 |
onFocus = _ref.onFocus; |
|
1650 |
|
|
1651 |
function onClick() { |
|
1652 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
9
|
1653 |
type: strikethrough_name |
|
1654 |
})); |
16
|
1655 |
onFocus(); |
|
1656 |
} |
|
1657 |
|
|
1658 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
1659 |
icon: format_strikethrough, |
|
1660 |
title: strikethrough_title, |
|
1661 |
onClick: onClick, |
|
1662 |
isActive: isActive |
|
1663 |
}); |
9
|
1664 |
} |
|
1665 |
}; |
|
1666 |
|
|
1667 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js |
|
1668 |
|
|
1669 |
|
|
1670 |
/** |
|
1671 |
* WordPress dependencies |
|
1672 |
*/ |
|
1673 |
|
|
1674 |
|
|
1675 |
|
|
1676 |
var underline_name = 'core/underline'; |
|
1677 |
var underline = { |
|
1678 |
name: underline_name, |
|
1679 |
title: Object(external_this_wp_i18n_["__"])('Underline'), |
|
1680 |
tagName: 'span', |
|
1681 |
className: null, |
|
1682 |
attributes: { |
|
1683 |
style: 'style' |
|
1684 |
}, |
|
1685 |
edit: function edit(_ref) { |
|
1686 |
var value = _ref.value, |
|
1687 |
onChange = _ref.onChange; |
|
1688 |
|
|
1689 |
var onToggle = function onToggle() { |
|
1690 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
|
1691 |
type: underline_name, |
|
1692 |
attributes: { |
|
1693 |
style: 'text-decoration: underline;' |
|
1694 |
} |
|
1695 |
})); |
|
1696 |
}; |
|
1697 |
|
|
1698 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], { |
|
1699 |
type: "primary", |
|
1700 |
character: "u", |
|
1701 |
onUse: onToggle |
16
|
1702 |
}), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], { |
9
|
1703 |
inputType: "formatUnderline", |
|
1704 |
onInput: onToggle |
|
1705 |
})); |
|
1706 |
} |
|
1707 |
}; |
|
1708 |
|
16
|
1709 |
// EXTERNAL MODULE: external {"this":["wp","data"]} |
|
1710 |
var external_this_wp_data_ = __webpack_require__(4); |
|
1711 |
|
|
1712 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js |
|
1713 |
var icon = __webpack_require__(137); |
|
1714 |
|
|
1715 |
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js |
|
1716 |
var text_color = __webpack_require__(410); |
|
1717 |
|
|
1718 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
|
1719 |
var esm_extends = __webpack_require__(8); |
|
1720 |
|
|
1721 |
// EXTERNAL MODULE: external {"this":["wp","dom"]} |
|
1722 |
var external_this_wp_dom_ = __webpack_require__(30); |
|
1723 |
|
|
1724 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js |
|
1725 |
|
|
1726 |
|
|
1727 |
|
|
1728 |
|
|
1729 |
/** |
|
1730 |
* External dependencies |
|
1731 |
*/ |
|
1732 |
|
|
1733 |
/** |
|
1734 |
* WordPress dependencies |
|
1735 |
*/ |
|
1736 |
|
|
1737 |
|
|
1738 |
|
|
1739 |
|
|
1740 |
|
|
1741 |
|
|
1742 |
|
|
1743 |
function getActiveColor(formatName, formatValue, colors) { |
|
1744 |
var activeColorFormat = Object(external_this_wp_richText_["getActiveFormat"])(formatValue, formatName); |
|
1745 |
|
|
1746 |
if (!activeColorFormat) { |
|
1747 |
return; |
|
1748 |
} |
|
1749 |
|
|
1750 |
var styleColor = activeColorFormat.attributes.style; |
|
1751 |
|
|
1752 |
if (styleColor) { |
|
1753 |
return styleColor.replace(new RegExp("^color:\\s*"), ''); |
|
1754 |
} |
|
1755 |
|
|
1756 |
var currentClass = activeColorFormat.attributes.class; |
|
1757 |
|
|
1758 |
if (currentClass) { |
|
1759 |
var colorSlug = currentClass.replace(/.*has-(.*?)-color.*/, '$1'); |
|
1760 |
return Object(external_this_wp_blockEditor_["getColorObjectByAttributeValues"])(colors, colorSlug).color; |
|
1761 |
} |
|
1762 |
} |
|
1763 |
|
|
1764 |
var inline_ColorPopoverAtLink = function ColorPopoverAtLink(_ref) { |
|
1765 |
var addingColor = _ref.addingColor, |
|
1766 |
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["addingColor"]); |
|
1767 |
|
|
1768 |
// There is no way to open a text formatter popover when another one is mounted. |
|
1769 |
// The first popover will always be dismounted when a click outside happens, so we can store the |
|
1770 |
// anchor Rect during the lifetime of the component. |
|
1771 |
var anchorRect = Object(external_this_wp_element_["useMemo"])(function () { |
|
1772 |
var selection = window.getSelection(); |
|
1773 |
var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null; |
|
1774 |
|
|
1775 |
if (!range) { |
|
1776 |
return; |
|
1777 |
} |
|
1778 |
|
|
1779 |
if (addingColor) { |
|
1780 |
return Object(external_this_wp_dom_["getRectangleFromRange"])(range); |
|
1781 |
} |
|
1782 |
|
|
1783 |
var element = range.startContainer; // If the caret is right before the element, select the next element. |
|
1784 |
|
|
1785 |
element = element.nextElementSibling || element; |
|
1786 |
|
|
1787 |
while (element.nodeType !== window.Node.ELEMENT_NODE) { |
|
1788 |
element = element.parentNode; |
|
1789 |
} |
|
1790 |
|
|
1791 |
var closest = element.closest('span'); |
|
1792 |
|
|
1793 |
if (closest) { |
|
1794 |
return closest.getBoundingClientRect(); |
|
1795 |
} |
|
1796 |
}, []); |
|
1797 |
|
|
1798 |
if (!anchorRect) { |
|
1799 |
return null; |
|
1800 |
} |
|
1801 |
|
|
1802 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["URLPopover"], Object(esm_extends["a" /* default */])({ |
|
1803 |
anchorRect: anchorRect |
|
1804 |
}, props)); |
|
1805 |
}; |
|
1806 |
|
|
1807 |
var inline_ColorPicker = function ColorPicker(_ref2) { |
|
1808 |
var name = _ref2.name, |
|
1809 |
value = _ref2.value, |
|
1810 |
onChange = _ref2.onChange; |
|
1811 |
var colors = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1812 |
var _select = select('core/block-editor'), |
|
1813 |
getSettings = _select.getSettings; |
|
1814 |
|
|
1815 |
return Object(external_this_lodash_["get"])(getSettings(), ['colors'], []); |
|
1816 |
}); |
|
1817 |
var onColorChange = Object(external_this_wp_element_["useCallback"])(function (color) { |
|
1818 |
if (color) { |
|
1819 |
var colorObject = Object(external_this_wp_blockEditor_["getColorObjectByColorValue"])(colors, color); |
|
1820 |
onChange(Object(external_this_wp_richText_["applyFormat"])(value, { |
|
1821 |
type: name, |
|
1822 |
attributes: colorObject ? { |
|
1823 |
class: Object(external_this_wp_blockEditor_["getColorClassName"])('color', colorObject.slug) |
|
1824 |
} : { |
|
1825 |
style: "color:".concat(color) |
|
1826 |
} |
|
1827 |
})); |
|
1828 |
} else { |
|
1829 |
onChange(Object(external_this_wp_richText_["removeFormat"])(value, name)); |
|
1830 |
} |
|
1831 |
}, [colors, onChange]); |
|
1832 |
var activeColor = Object(external_this_wp_element_["useMemo"])(function () { |
|
1833 |
return getActiveColor(name, value, colors); |
|
1834 |
}, [name, value, colors]); |
|
1835 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["ColorPalette"], { |
|
1836 |
value: activeColor, |
|
1837 |
onChange: onColorChange |
|
1838 |
}); |
|
1839 |
}; |
|
1840 |
|
|
1841 |
var inline_InlineColorUI = function InlineColorUI(_ref3) { |
|
1842 |
var name = _ref3.name, |
|
1843 |
value = _ref3.value, |
|
1844 |
onChange = _ref3.onChange, |
|
1845 |
onClose = _ref3.onClose, |
|
1846 |
isActive = _ref3.isActive, |
|
1847 |
addingColor = _ref3.addingColor; |
|
1848 |
return Object(external_this_wp_element_["createElement"])(inline_ColorPopoverAtLink, { |
|
1849 |
value: value, |
|
1850 |
isActive: isActive, |
|
1851 |
addingColor: addingColor, |
|
1852 |
onClose: onClose, |
|
1853 |
className: "components-inline-color-popover" |
|
1854 |
}, Object(external_this_wp_element_["createElement"])(inline_ColorPicker, { |
|
1855 |
name: name, |
|
1856 |
value: value, |
|
1857 |
onChange: onChange |
|
1858 |
})); |
|
1859 |
}; |
|
1860 |
|
|
1861 |
/* harmony default export */ var text_color_inline = (Object(external_this_wp_components_["withSpokenMessages"])(inline_InlineColorUI)); |
|
1862 |
|
|
1863 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js |
|
1864 |
|
|
1865 |
|
|
1866 |
|
|
1867 |
/** |
|
1868 |
* External dependencies |
|
1869 |
*/ |
|
1870 |
|
|
1871 |
/** |
|
1872 |
* WordPress dependencies |
|
1873 |
*/ |
|
1874 |
|
|
1875 |
|
|
1876 |
|
|
1877 |
|
|
1878 |
|
|
1879 |
|
|
1880 |
|
|
1881 |
/** |
|
1882 |
* Internal dependencies |
|
1883 |
*/ |
|
1884 |
|
|
1885 |
|
|
1886 |
var text_color_name = 'core/text-color'; |
|
1887 |
|
|
1888 |
var text_color_title = Object(external_this_wp_i18n_["__"])('Text Color'); |
|
1889 |
|
|
1890 |
var EMPTY_ARRAY = []; |
|
1891 |
|
|
1892 |
function TextColorEdit(_ref) { |
|
1893 |
var value = _ref.value, |
|
1894 |
onChange = _ref.onChange, |
|
1895 |
isActive = _ref.isActive, |
|
1896 |
activeAttributes = _ref.activeAttributes; |
|
1897 |
|
|
1898 |
var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1899 |
var blockEditorSelect = select('core/block-editor'); |
|
1900 |
var settings; |
|
1901 |
|
|
1902 |
if (blockEditorSelect && blockEditorSelect.getSettings) { |
|
1903 |
settings = blockEditorSelect.getSettings(); |
|
1904 |
} else { |
|
1905 |
settings = {}; |
|
1906 |
} |
|
1907 |
|
|
1908 |
return { |
|
1909 |
colors: Object(external_this_lodash_["get"])(settings, ['colors'], EMPTY_ARRAY), |
|
1910 |
disableCustomColors: settings.disableCustomColors |
|
1911 |
}; |
|
1912 |
}), |
|
1913 |
colors = _useSelect.colors, |
|
1914 |
disableCustomColors = _useSelect.disableCustomColors; |
|
1915 |
|
|
1916 |
var _useState = Object(external_this_wp_element_["useState"])(false), |
|
1917 |
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), |
|
1918 |
isAddingColor = _useState2[0], |
|
1919 |
setIsAddingColor = _useState2[1]; |
|
1920 |
|
|
1921 |
var enableIsAddingColor = Object(external_this_wp_element_["useCallback"])(function () { |
|
1922 |
return setIsAddingColor(true); |
|
1923 |
}, [setIsAddingColor]); |
|
1924 |
var disableIsAddingColor = Object(external_this_wp_element_["useCallback"])(function () { |
|
1925 |
return setIsAddingColor(false); |
|
1926 |
}, [setIsAddingColor]); |
|
1927 |
var colorIndicatorStyle = Object(external_this_wp_element_["useMemo"])(function () { |
|
1928 |
var activeColor = getActiveColor(text_color_name, value, colors); |
|
1929 |
|
|
1930 |
if (!activeColor) { |
|
1931 |
return undefined; |
|
1932 |
} |
|
1933 |
|
|
1934 |
return { |
|
1935 |
backgroundColor: activeColor |
|
1936 |
}; |
|
1937 |
}, [value, colors]); |
|
1938 |
var hasColorsToChoose = !Object(external_this_lodash_["isEmpty"])(colors) || disableCustomColors !== true; |
|
1939 |
|
|
1940 |
if (!hasColorsToChoose && !isActive) { |
|
1941 |
return null; |
|
1942 |
} |
|
1943 |
|
|
1944 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
1945 |
key: isActive ? 'text-color' : 'text-color-not-active', |
|
1946 |
className: "format-library-text-color-button", |
|
1947 |
name: isActive ? 'text-color' : undefined, |
|
1948 |
icon: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(icon["a" /* default */], { |
|
1949 |
icon: text_color["a" /* default */] |
|
1950 |
}), isActive && Object(external_this_wp_element_["createElement"])("span", { |
|
1951 |
className: "format-library-text-color-button__indicator", |
|
1952 |
style: colorIndicatorStyle |
|
1953 |
})), |
|
1954 |
title: text_color_title // If has no colors to choose but a color is active remove the color onClick |
|
1955 |
, |
|
1956 |
onClick: hasColorsToChoose ? enableIsAddingColor : function () { |
|
1957 |
return onChange(Object(external_this_wp_richText_["removeFormat"])(value, text_color_name)); |
|
1958 |
} |
|
1959 |
}), isAddingColor && Object(external_this_wp_element_["createElement"])(text_color_inline, { |
|
1960 |
name: text_color_name, |
|
1961 |
addingColor: isAddingColor, |
|
1962 |
onClose: disableIsAddingColor, |
|
1963 |
isActive: isActive, |
|
1964 |
activeAttributes: activeAttributes, |
|
1965 |
value: value, |
|
1966 |
onChange: onChange |
|
1967 |
})); |
|
1968 |
} |
|
1969 |
|
|
1970 |
var textColor = { |
|
1971 |
name: text_color_name, |
|
1972 |
title: text_color_title, |
|
1973 |
tagName: 'span', |
|
1974 |
className: 'has-inline-color', |
|
1975 |
attributes: { |
|
1976 |
style: 'style', |
|
1977 |
class: 'class' |
|
1978 |
}, |
|
1979 |
edit: TextColorEdit |
|
1980 |
}; |
|
1981 |
|
|
1982 |
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/subscript.js |
|
1983 |
|
|
1984 |
|
|
1985 |
/** |
|
1986 |
* WordPress dependencies |
|
1987 |
*/ |
|
1988 |
|
|
1989 |
var subscript = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1990 |
xmlns: "http://www.w3.org/2000/svg", |
|
1991 |
viewBox: "0 0 24 24" |
|
1992 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1993 |
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" |
|
1994 |
})); |
|
1995 |
/* harmony default export */ var library_subscript = (subscript); |
|
1996 |
|
|
1997 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/subscript/index.js |
|
1998 |
|
|
1999 |
|
|
2000 |
/** |
|
2001 |
* WordPress dependencies |
|
2002 |
*/ |
|
2003 |
|
|
2004 |
|
|
2005 |
|
|
2006 |
|
|
2007 |
var subscript_name = 'core/subscript'; |
|
2008 |
|
|
2009 |
var subscript_title = Object(external_this_wp_i18n_["__"])('Subscript'); |
|
2010 |
|
|
2011 |
var subscript_subscript = { |
|
2012 |
name: subscript_name, |
|
2013 |
title: subscript_title, |
|
2014 |
tagName: 'sub', |
|
2015 |
className: null, |
|
2016 |
edit: function edit(_ref) { |
|
2017 |
var isActive = _ref.isActive, |
|
2018 |
value = _ref.value, |
|
2019 |
onChange = _ref.onChange, |
|
2020 |
onFocus = _ref.onFocus; |
|
2021 |
|
|
2022 |
function onToggle() { |
|
2023 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
|
2024 |
type: subscript_name |
|
2025 |
})); |
|
2026 |
} |
|
2027 |
|
|
2028 |
function onClick() { |
|
2029 |
onToggle(); |
|
2030 |
onFocus(); |
|
2031 |
} |
|
2032 |
|
|
2033 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
2034 |
icon: library_subscript, |
|
2035 |
title: subscript_title, |
|
2036 |
onClick: onClick, |
|
2037 |
isActive: isActive |
|
2038 |
}); |
|
2039 |
} |
|
2040 |
}; |
|
2041 |
|
|
2042 |
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/superscript.js |
|
2043 |
|
|
2044 |
|
|
2045 |
/** |
|
2046 |
* WordPress dependencies |
|
2047 |
*/ |
|
2048 |
|
|
2049 |
var superscript = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
2050 |
xmlns: "http://www.w3.org/2000/svg", |
|
2051 |
viewBox: "0 0 24 24" |
|
2052 |
}, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
2053 |
d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 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.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-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" |
|
2054 |
})); |
|
2055 |
/* harmony default export */ var library_superscript = (superscript); |
|
2056 |
|
|
2057 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/superscript/index.js |
|
2058 |
|
|
2059 |
|
|
2060 |
/** |
|
2061 |
* WordPress dependencies |
|
2062 |
*/ |
|
2063 |
|
|
2064 |
|
|
2065 |
|
|
2066 |
|
|
2067 |
var superscript_name = 'core/superscript'; |
|
2068 |
|
|
2069 |
var superscript_title = Object(external_this_wp_i18n_["__"])('Superscript'); |
|
2070 |
|
|
2071 |
var superscript_superscript = { |
|
2072 |
name: superscript_name, |
|
2073 |
title: superscript_title, |
|
2074 |
tagName: 'sup', |
|
2075 |
className: null, |
|
2076 |
edit: function edit(_ref) { |
|
2077 |
var isActive = _ref.isActive, |
|
2078 |
value = _ref.value, |
|
2079 |
onChange = _ref.onChange, |
|
2080 |
onFocus = _ref.onFocus; |
|
2081 |
|
|
2082 |
function onToggle() { |
|
2083 |
onChange(Object(external_this_wp_richText_["toggleFormat"])(value, { |
|
2084 |
type: superscript_name |
|
2085 |
})); |
|
2086 |
} |
|
2087 |
|
|
2088 |
function onClick() { |
|
2089 |
onToggle(); |
|
2090 |
onFocus(); |
|
2091 |
} |
|
2092 |
|
|
2093 |
return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], { |
|
2094 |
icon: library_superscript, |
|
2095 |
title: superscript_title, |
|
2096 |
onClick: onClick, |
|
2097 |
isActive: isActive |
|
2098 |
}); |
|
2099 |
} |
|
2100 |
}; |
|
2101 |
|
9
|
2102 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/default-formats.js |
|
2103 |
/** |
|
2104 |
* Internal dependencies |
|
2105 |
*/ |
|
2106 |
|
|
2107 |
|
|
2108 |
|
|
2109 |
|
|
2110 |
|
|
2111 |
|
|
2112 |
|
16
|
2113 |
|
|
2114 |
|
|
2115 |
|
|
2116 |
/* harmony default export */ var default_formats = ([bold, code_code, image_image, italic, link_link, strikethrough, underline, textColor, subscript_subscript, superscript_superscript]); |
9
|
2117 |
|
|
2118 |
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/index.js |
|
2119 |
|
|
2120 |
|
|
2121 |
/** |
|
2122 |
* WordPress dependencies |
|
2123 |
*/ |
|
2124 |
|
|
2125 |
/** |
|
2126 |
* Internal dependencies |
|
2127 |
*/ |
|
2128 |
|
|
2129 |
|
|
2130 |
default_formats.forEach(function (_ref) { |
|
2131 |
var name = _ref.name, |
|
2132 |
settings = Object(objectWithoutProperties["a" /* default */])(_ref, ["name"]); |
|
2133 |
|
|
2134 |
return Object(external_this_wp_richText_["registerFormatType"])(name, settings); |
|
2135 |
}); |
|
2136 |
|
|
2137 |
|
|
2138 |
/***/ }), |
|
2139 |
|
16
|
2140 |
/***/ 5: |
|
2141 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2142 |
|
|
2143 |
"use strict"; |
|
2144 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
|
2145 |
function _defineProperty(obj, key, value) { |
|
2146 |
if (key in obj) { |
|
2147 |
Object.defineProperty(obj, key, { |
|
2148 |
value: value, |
|
2149 |
enumerable: true, |
|
2150 |
configurable: true, |
|
2151 |
writable: true |
|
2152 |
}); |
|
2153 |
} else { |
|
2154 |
obj[key] = value; |
|
2155 |
} |
|
2156 |
|
|
2157 |
return obj; |
|
2158 |
} |
|
2159 |
|
|
2160 |
/***/ }), |
|
2161 |
|
|
2162 |
/***/ 6: |
9
|
2163 |
/***/ (function(module, exports) { |
|
2164 |
|
16
|
2165 |
(function() { module.exports = this["wp"]["primitives"]; }()); |
9
|
2166 |
|
|
2167 |
/***/ }), |
|
2168 |
|
|
2169 |
/***/ 7: |
|
2170 |
/***/ (function(module, exports) { |
|
2171 |
|
|
2172 |
(function() { module.exports = this["wp"]["blockEditor"]; }()); |
|
2173 |
|
|
2174 |
/***/ }), |
|
2175 |
|
16
|
2176 |
/***/ 75: |
|
2177 |
/***/ (function(module, exports) { |
|
2178 |
|
|
2179 |
(function() { module.exports = this["wp"]["htmlEntities"]; }()); |
|
2180 |
|
|
2181 |
/***/ }), |
|
2182 |
|
|
2183 |
/***/ 8: |
9
|
2184 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2185 |
|
|
2186 |
"use strict"; |
16
|
2187 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); |
|
2188 |
function _extends() { |
|
2189 |
_extends = Object.assign || function (target) { |
|
2190 |
for (var i = 1; i < arguments.length; i++) { |
|
2191 |
var source = arguments[i]; |
|
2192 |
|
|
2193 |
for (var key in source) { |
|
2194 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
|
2195 |
target[key] = source[key]; |
|
2196 |
} |
|
2197 |
} |
|
2198 |
} |
|
2199 |
|
|
2200 |
return target; |
|
2201 |
}; |
|
2202 |
|
|
2203 |
return _extends.apply(this, arguments); |
9
|
2204 |
} |
|
2205 |
|
|
2206 |
/***/ }) |
|
2207 |
|
|
2208 |
/******/ }); |