[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/js/dist/ -> format-library.js (source)

   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
  85  /******/     return __webpack_require__(__webpack_require__.s = 350);
  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  
 104  /***/ 10:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 109  function _defineProperty(obj, key, value) {
 110    if (key in obj) {
 111      Object.defineProperty(obj, key, {
 112        value: value,
 113        enumerable: true,
 114        configurable: true,
 115        writable: true
 116      });
 117    } else {
 118      obj[key] = value;
 119    }
 120  
 121    return obj;
 122  }
 123  
 124  /***/ }),
 125  
 126  /***/ 11:
 127  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 128  
 129  "use strict";
 130  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 131  function _defineProperties(target, props) {
 132    for (var i = 0; i < props.length; i++) {
 133      var descriptor = props[i];
 134      descriptor.enumerable = descriptor.enumerable || false;
 135      descriptor.configurable = true;
 136      if ("value" in descriptor) descriptor.writable = true;
 137      Object.defineProperty(target, descriptor.key, descriptor);
 138    }
 139  }
 140  
 141  function _createClass(Constructor, protoProps, staticProps) {
 142    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 143    if (staticProps) _defineProperties(Constructor, staticProps);
 144    return Constructor;
 145  }
 146  
 147  /***/ }),
 148  
 149  /***/ 12:
 150  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 151  
 152  "use strict";
 153  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 154  function _classCallCheck(instance, Constructor) {
 155    if (!(instance instanceof Constructor)) {
 156      throw new TypeError("Cannot call a class as a function");
 157    }
 158  }
 159  
 160  /***/ }),
 161  
 162  /***/ 13:
 163  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 164  
 165  "use strict";
 166  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 167  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
 168  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
 169  
 170  
 171  function _possibleConstructorReturn(self, call) {
 172    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 173      return call;
 174    }
 175  
 176    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 177  }
 178  
 179  /***/ }),
 180  
 181  /***/ 14:
 182  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 183  
 184  "use strict";
 185  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 186  function _getPrototypeOf(o) {
 187    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 188      return o.__proto__ || Object.getPrototypeOf(o);
 189    };
 190    return _getPrototypeOf(o);
 191  }
 192  
 193  /***/ }),
 194  
 195  /***/ 15:
 196  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 197  
 198  "use strict";
 199  
 200  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 201  function _setPrototypeOf(o, p) {
 202    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 203      o.__proto__ = p;
 204      return o;
 205    };
 206  
 207    return _setPrototypeOf(o, p);
 208  }
 209  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 210  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 211  
 212  function _inherits(subClass, superClass) {
 213    if (typeof superClass !== "function" && superClass !== null) {
 214      throw new TypeError("Super expression must either be null or a function");
 215    }
 216  
 217    subClass.prototype = Object.create(superClass && superClass.prototype, {
 218      constructor: {
 219        value: subClass,
 220        writable: true,
 221        configurable: true
 222      }
 223    });
 224    if (superClass) _setPrototypeOf(subClass, superClass);
 225  }
 226  
 227  /***/ }),
 228  
 229  /***/ 18:
 230  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 231  
 232  "use strict";
 233  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 234  function _extends() {
 235    _extends = Object.assign || function (target) {
 236      for (var i = 1; i < arguments.length; i++) {
 237        var source = arguments[i];
 238  
 239        for (var key in source) {
 240          if (Object.prototype.hasOwnProperty.call(source, key)) {
 241            target[key] = source[key];
 242          }
 243        }
 244      }
 245  
 246      return target;
 247    };
 248  
 249    return _extends.apply(this, arguments);
 250  }
 251  
 252  /***/ }),
 253  
 254  /***/ 19:
 255  /***/ (function(module, exports) {
 256  
 257  (function() { module.exports = this["wp"]["keycodes"]; }());
 258  
 259  /***/ }),
 260  
 261  /***/ 2:
 262  /***/ (function(module, exports) {
 263  
 264  (function() { module.exports = this["lodash"]; }());
 265  
 266  /***/ }),
 267  
 268  /***/ 21:
 269  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 270  
 271  "use strict";
 272  
 273  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
 274  function _objectWithoutPropertiesLoose(source, excluded) {
 275    if (source == null) return {};
 276    var target = {};
 277    var sourceKeys = Object.keys(source);
 278    var key, i;
 279  
 280    for (i = 0; i < sourceKeys.length; i++) {
 281      key = sourceKeys[i];
 282      if (excluded.indexOf(key) >= 0) continue;
 283      target[key] = source[key];
 284    }
 285  
 286    return target;
 287  }
 288  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 289  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 290  
 291  function _objectWithoutProperties(source, excluded) {
 292    if (source == null) return {};
 293    var target = _objectWithoutPropertiesLoose(source, excluded);
 294    var key, i;
 295  
 296    if (Object.getOwnPropertySymbols) {
 297      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 298  
 299      for (i = 0; i < sourceSymbolKeys.length; i++) {
 300        key = sourceSymbolKeys[i];
 301        if (excluded.indexOf(key) >= 0) continue;
 302        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 303        target[key] = source[key];
 304      }
 305    }
 306  
 307    return target;
 308  }
 309  
 310  /***/ }),
 311  
 312  /***/ 22:
 313  /***/ (function(module, exports) {
 314  
 315  (function() { module.exports = this["wp"]["richText"]; }());
 316  
 317  /***/ }),
 318  
 319  /***/ 25:
 320  /***/ (function(module, exports) {
 321  
 322  (function() { module.exports = this["wp"]["dom"]; }());
 323  
 324  /***/ }),
 325  
 326  /***/ 26:
 327  /***/ (function(module, exports) {
 328  
 329  (function() { module.exports = this["wp"]["url"]; }());
 330  
 331  /***/ }),
 332  
 333  /***/ 3:
 334  /***/ (function(module, exports) {
 335  
 336  (function() { module.exports = this["wp"]["components"]; }());
 337  
 338  /***/ }),
 339  
 340  /***/ 31:
 341  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 342  
 343  "use strict";
 344  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 345  function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
 346  
 347  function _typeof(obj) {
 348    if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
 349      _typeof = function _typeof(obj) {
 350        return _typeof2(obj);
 351      };
 352    } else {
 353      _typeof = function _typeof(obj) {
 354        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
 355      };
 356    }
 357  
 358    return _typeof(obj);
 359  }
 360  
 361  /***/ }),
 362  
 363  /***/ 350:
 364  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 365  
 366  "use strict";
 367  __webpack_require__.r(__webpack_exports__);
 368  
 369  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
 370  var objectWithoutProperties = __webpack_require__(21);
 371  
 372  // EXTERNAL MODULE: external {"this":["wp","richText"]}
 373  var external_this_wp_richText_ = __webpack_require__(22);
 374  
 375  // EXTERNAL MODULE: external {"this":["wp","element"]}
 376  var external_this_wp_element_ = __webpack_require__(0);
 377  
 378  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 379  var external_this_wp_i18n_ = __webpack_require__(1);
 380  
 381  // EXTERNAL MODULE: external {"this":["wp","blockEditor"]}
 382  var external_this_wp_blockEditor_ = __webpack_require__(6);
 383  
 384  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js
 385  
 386  
 387  /**
 388   * WordPress dependencies
 389   */
 390  
 391  
 392  
 393  var bold_name = 'core/bold';
 394  
 395  var title = Object(external_this_wp_i18n_["__"])('Bold');
 396  
 397  var bold = {
 398    name: bold_name,
 399    title: title,
 400    tagName: 'strong',
 401    className: null,
 402    edit: function edit(_ref) {
 403      var isActive = _ref.isActive,
 404          value = _ref.value,
 405          onChange = _ref.onChange;
 406  
 407      var onToggle = function onToggle() {
 408        return onChange(Object(external_this_wp_richText_["toggleFormat"])(value, {
 409          type: bold_name
 410        }));
 411      };
 412  
 413      return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], {
 414        type: "primary",
 415        character: "b",
 416        onUse: onToggle
 417      }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
 418        name: "bold",
 419        icon: "editor-bold",
 420        title: title,
 421        onClick: onToggle,
 422        isActive: isActive,
 423        shortcutType: "primary",
 424        shortcutCharacter: "b"
 425      }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], {
 426        inputType: "formatBold",
 427        onInput: onToggle
 428      }));
 429    }
 430  };
 431  
 432  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/code/index.js
 433  
 434  
 435  /**
 436   * WordPress dependencies
 437   */
 438  
 439  
 440  
 441  var code_name = 'core/code';
 442  
 443  var code_title = Object(external_this_wp_i18n_["__"])('Inline Code');
 444  
 445  var code = {
 446    name: code_name,
 447    title: code_title,
 448    tagName: 'code',
 449    className: null,
 450    __unstableInputRule: function __unstableInputRule(value) {
 451      var BACKTICK = '`';
 452      var _value = value,
 453          start = _value.start,
 454          text = _value.text;
 455      var characterBefore = text.slice(start - 1, start); // Quick check the text for the necessary character.
 456  
 457      if (characterBefore !== BACKTICK) {
 458        return value;
 459      }
 460  
 461      var textBefore = text.slice(0, start - 1);
 462      var indexBefore = textBefore.lastIndexOf(BACKTICK);
 463  
 464      if (indexBefore === -1) {
 465        return value;
 466      }
 467  
 468      var startIndex = indexBefore;
 469      var endIndex = start - 2;
 470  
 471      if (startIndex === endIndex) {
 472        return value;
 473      }
 474  
 475      value = Object(external_this_wp_richText_["remove"])(value, startIndex, startIndex + 1);
 476      value = Object(external_this_wp_richText_["remove"])(value, endIndex, endIndex + 1);
 477      value = Object(external_this_wp_richText_["applyFormat"])(value, {
 478        type: code_name
 479      }, startIndex, endIndex);
 480      return value;
 481    },
 482    edit: function edit(_ref) {
 483      var value = _ref.value,
 484          onChange = _ref.onChange,
 485          isActive = _ref.isActive;
 486  
 487      var onToggle = function onToggle() {
 488        return onChange(Object(external_this_wp_richText_["toggleFormat"])(value, {
 489          type: code_name
 490        }));
 491      };
 492  
 493      return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
 494        icon: "editor-code",
 495        title: code_title,
 496        onClick: onToggle,
 497        isActive: isActive
 498      });
 499    }
 500  };
 501  
 502  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
 503  var objectSpread = __webpack_require__(7);
 504  
 505  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
 506  var classCallCheck = __webpack_require__(12);
 507  
 508  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
 509  var createClass = __webpack_require__(11);
 510  
 511  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
 512  var possibleConstructorReturn = __webpack_require__(13);
 513  
 514  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
 515  var getPrototypeOf = __webpack_require__(14);
 516  
 517  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
 518  var assertThisInitialized = __webpack_require__(5);
 519  
 520  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
 521  var inherits = __webpack_require__(15);
 522  
 523  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
 524  var esm_extends = __webpack_require__(18);
 525  
 526  // EXTERNAL MODULE: external {"this":["wp","components"]}
 527  var external_this_wp_components_ = __webpack_require__(3);
 528  
 529  // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
 530  var external_this_wp_keycodes_ = __webpack_require__(19);
 531  
 532  // EXTERNAL MODULE: external {"this":["wp","dom"]}
 533  var external_this_wp_dom_ = __webpack_require__(25);
 534  
 535  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/image/index.js
 536  
 537  
 538  
 539  
 540  
 541  
 542  
 543  
 544  
 545  
 546  
 547  /**
 548   * WordPress dependencies
 549   */
 550  
 551  
 552  
 553  
 554  
 555  
 556  
 557  var ALLOWED_MEDIA_TYPES = ['image'];
 558  var image_name = 'core/image';
 559  
 560  var image_title = Object(external_this_wp_i18n_["__"])('Inline image');
 561  
 562  var stopKeyPropagation = function stopKeyPropagation(event) {
 563    return event.stopPropagation();
 564  };
 565  
 566  var image_PopoverAtImage = function PopoverAtImage(_ref) {
 567    var dependencies = _ref.dependencies,
 568        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["dependencies"]);
 569  
 570    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Popover"], Object(esm_extends["a" /* default */])({
 571      position: "bottom center",
 572      focusOnMount: false,
 573      anchorRect: Object(external_this_wp_element_["useMemo"])(function () {
 574        return Object(external_this_wp_dom_["computeCaretRect"])();
 575      }, dependencies)
 576    }, props));
 577  };
 578  
 579  var image_image = {
 580    name: image_name,
 581    title: image_title,
 582    keywords: [Object(external_this_wp_i18n_["__"])('photo'), Object(external_this_wp_i18n_["__"])('media')],
 583    object: true,
 584    tagName: 'img',
 585    className: null,
 586    attributes: {
 587      className: 'class',
 588      style: 'style',
 589      url: 'src',
 590      alt: 'alt'
 591    },
 592    edit:
 593    /*#__PURE__*/
 594    function (_Component) {
 595      Object(inherits["a" /* default */])(ImageEdit, _Component);
 596  
 597      function ImageEdit() {
 598        var _this;
 599  
 600        Object(classCallCheck["a" /* default */])(this, ImageEdit);
 601  
 602        _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ImageEdit).apply(this, arguments));
 603        _this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
 604        _this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
 605        _this.openModal = _this.openModal.bind(Object(assertThisInitialized["a" /* default */])(_this));
 606        _this.closeModal = _this.closeModal.bind(Object(assertThisInitialized["a" /* default */])(_this));
 607        _this.state = {
 608          modal: false
 609        };
 610        return _this;
 611      }
 612  
 613      Object(createClass["a" /* default */])(ImageEdit, [{
 614        key: "onChange",
 615        value: function onChange(width) {
 616          this.setState({
 617            width: width
 618          });
 619        }
 620      }, {
 621        key: "onKeyDown",
 622        value: function onKeyDown(event) {
 623          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) {
 624            // Stop the key event from propagating up to ObserveTyping.startTypingInTextField.
 625            event.stopPropagation();
 626          }
 627        }
 628      }, {
 629        key: "openModal",
 630        value: function openModal() {
 631          this.setState({
 632            modal: true
 633          });
 634        }
 635      }, {
 636        key: "closeModal",
 637        value: function closeModal() {
 638          this.setState({
 639            modal: false
 640          });
 641        }
 642      }, {
 643        key: "render",
 644        value: function render() {
 645          var _this2 = this;
 646  
 647          var _this$props = this.props,
 648              value = _this$props.value,
 649              onChange = _this$props.onChange,
 650              isObjectActive = _this$props.isObjectActive,
 651              activeObjectAttributes = _this$props.activeObjectAttributes;
 652          var style = activeObjectAttributes.style;
 653          return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUploadCheck"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
 654            icon: Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SVG"], {
 655              xmlns: "http://www.w3.org/2000/svg",
 656              viewBox: "0 0 24 24"
 657            }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Path"], {
 658              d: "M4 16h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2zM4 5h10v9H4V5zm14 9v2h4v-2h-4zM2 20h20v-2H2v2zm6.4-8.8L7 9.4 5 12h8l-2.6-3.4-2 2.6z"
 659            })),
 660            title: image_title,
 661            onClick: this.openModal,
 662            isActive: isObjectActive
 663          }), this.state.modal && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUpload"], {
 664            allowedTypes: ALLOWED_MEDIA_TYPES,
 665            onSelect: function onSelect(_ref2) {
 666              var id = _ref2.id,
 667                  url = _ref2.url,
 668                  alt = _ref2.alt,
 669                  width = _ref2.width;
 670  
 671              _this2.closeModal();
 672  
 673              onChange(Object(external_this_wp_richText_["insertObject"])(value, {
 674                type: image_name,
 675                attributes: {
 676                  className: "wp-image-".concat(id),
 677                  style: "width: ".concat(Math.min(width, 150), "px;"),
 678                  url: url,
 679                  alt: alt
 680                }
 681              }));
 682            },
 683            onClose: this.closeModal,
 684            render: function render(_ref3) {
 685              var open = _ref3.open;
 686              open();
 687              return null;
 688            }
 689          }), isObjectActive && Object(external_this_wp_element_["createElement"])(image_PopoverAtImage // Reposition Popover when the selection changes or
 690          // when the width changes.
 691          , {
 692            dependencies: [style, value.start]
 693          }, Object(external_this_wp_element_["createElement"])("form", {
 694            className: "editor-format-toolbar__image-container-content block-editor-format-toolbar__image-container-content",
 695            onKeyPress: stopKeyPropagation,
 696            onKeyDown: this.onKeyDown,
 697            onSubmit: function onSubmit(event) {
 698              var newReplacements = value.replacements.slice();
 699              newReplacements[value.start] = {
 700                type: image_name,
 701                attributes: Object(objectSpread["a" /* default */])({}, activeObjectAttributes, {
 702                  style: "width: ".concat(_this2.state.width, "px;")
 703                })
 704              };
 705              onChange(Object(objectSpread["a" /* default */])({}, value, {
 706                replacements: newReplacements
 707              }));
 708              event.preventDefault();
 709            }
 710          }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
 711            className: "editor-format-toolbar__image-container-value block-editor-format-toolbar__image-container-value",
 712            type: "number",
 713            label: Object(external_this_wp_i18n_["__"])('Width'),
 714            value: this.state.width,
 715            min: 1,
 716            onChange: this.onChange
 717          }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["IconButton"], {
 718            icon: "editor-break",
 719            label: Object(external_this_wp_i18n_["__"])('Apply'),
 720            type: "submit"
 721          }))));
 722        }
 723      }], [{
 724        key: "getDerivedStateFromProps",
 725        value: function getDerivedStateFromProps(props, state) {
 726          var style = props.activeObjectAttributes.style;
 727  
 728          if (style === state.previousStyle) {
 729            return null;
 730          }
 731  
 732          if (!style) {
 733            return {
 734              width: undefined,
 735              previousStyle: style
 736            };
 737          }
 738  
 739          return {
 740            width: style.replace(/\D/g, ''),
 741            previousStyle: style
 742          };
 743        }
 744      }]);
 745  
 746      return ImageEdit;
 747    }(external_this_wp_element_["Component"])
 748  };
 749  
 750  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/italic/index.js
 751  
 752  
 753  /**
 754   * WordPress dependencies
 755   */
 756  
 757  
 758  
 759  var italic_name = 'core/italic';
 760  
 761  var italic_title = Object(external_this_wp_i18n_["__"])('Italic');
 762  
 763  var italic = {
 764    name: italic_name,
 765    title: italic_title,
 766    tagName: 'em',
 767    className: null,
 768    edit: function edit(_ref) {
 769      var isActive = _ref.isActive,
 770          value = _ref.value,
 771          onChange = _ref.onChange;
 772  
 773      var onToggle = function onToggle() {
 774        return onChange(Object(external_this_wp_richText_["toggleFormat"])(value, {
 775          type: italic_name
 776        }));
 777      };
 778  
 779      return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], {
 780        type: "primary",
 781        character: "i",
 782        onUse: onToggle
 783      }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
 784        name: "italic",
 785        icon: "editor-italic",
 786        title: italic_title,
 787        onClick: onToggle,
 788        isActive: isActive,
 789        shortcutType: "primary",
 790        shortcutCharacter: "i"
 791      }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], {
 792        inputType: "formatItalic",
 793        onInput: onToggle
 794      }));
 795    }
 796  };
 797  
 798  // EXTERNAL MODULE: external {"this":["wp","url"]}
 799  var external_this_wp_url_ = __webpack_require__(26);
 800  
 801  // EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
 802  var external_this_wp_htmlEntities_ = __webpack_require__(52);
 803  
 804  // EXTERNAL MODULE: external "lodash"
 805  var external_lodash_ = __webpack_require__(2);
 806  
 807  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js
 808  /**
 809   * External dependencies
 810   */
 811  
 812  /**
 813   * WordPress dependencies
 814   */
 815  
 816  
 817  
 818  /**
 819   * Check for issues with the provided href.
 820   *
 821   * @param {string} href The href.
 822   *
 823   * @return {boolean} Is the href invalid?
 824   */
 825  
 826  function isValidHref(href) {
 827    if (!href) {
 828      return false;
 829    }
 830  
 831    var trimmedHref = href.trim();
 832  
 833    if (!trimmedHref) {
 834      return false;
 835    } // Does the href start with something that looks like a URL protocol?
 836  
 837  
 838    if (/^\S+:/.test(trimmedHref)) {
 839      var protocol = Object(external_this_wp_url_["getProtocol"])(trimmedHref);
 840  
 841      if (!Object(external_this_wp_url_["isValidProtocol"])(protocol)) {
 842        return false;
 843      } // Add some extra checks for http(s) URIs, since these are the most common use-case.
 844      // This ensures URIs with an http protocol have exactly two forward slashes following the protocol.
 845  
 846  
 847      if (Object(external_lodash_["startsWith"])(protocol, 'http') && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
 848        return false;
 849      }
 850  
 851      var authority = Object(external_this_wp_url_["getAuthority"])(trimmedHref);
 852  
 853      if (!Object(external_this_wp_url_["isValidAuthority"])(authority)) {
 854        return false;
 855      }
 856  
 857      var path = Object(external_this_wp_url_["getPath"])(trimmedHref);
 858  
 859      if (path && !Object(external_this_wp_url_["isValidPath"])(path)) {
 860        return false;
 861      }
 862  
 863      var queryString = Object(external_this_wp_url_["getQueryString"])(trimmedHref);
 864  
 865      if (queryString && !Object(external_this_wp_url_["isValidQueryString"])(queryString)) {
 866        return false;
 867      }
 868  
 869      var fragment = Object(external_this_wp_url_["getFragment"])(trimmedHref);
 870  
 871      if (fragment && !Object(external_this_wp_url_["isValidFragment"])(fragment)) {
 872        return false;
 873      }
 874    } // Validate anchor links.
 875  
 876  
 877    if (Object(external_lodash_["startsWith"])(trimmedHref, '#') && !Object(external_this_wp_url_["isValidFragment"])(trimmedHref)) {
 878      return false;
 879    }
 880  
 881    return true;
 882  }
 883  /**
 884   * Generates the format object that will be applied to the link text.
 885   *
 886   * @param {Object}  options
 887   * @param {string}  options.url              The href of the link.
 888   * @param {boolean} options.opensInNewWindow Whether this link will open in a new window.
 889   * @param {Object}  options.text             The text that is being hyperlinked.
 890   *
 891   * @return {Object} The final format object.
 892   */
 893  
 894  function createLinkFormat(_ref) {
 895    var url = _ref.url,
 896        opensInNewWindow = _ref.opensInNewWindow,
 897        text = _ref.text;
 898    var format = {
 899      type: 'core/link',
 900      attributes: {
 901        url: url
 902      }
 903    };
 904  
 905    if (opensInNewWindow) {
 906      // translators: accessibility label for external links, where the argument is the link text
 907      var label = Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('%s (opens in a new tab)'), text);
 908      format.attributes.target = '_blank';
 909      format.attributes.rel = 'noreferrer noopener';
 910      format.attributes['aria-label'] = label;
 911    }
 912  
 913    return format;
 914  }
 915  
 916  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js
 917  
 918  
 919  
 920  
 921  
 922  
 923  
 924  
 925  
 926  
 927  /**
 928   * WordPress dependencies
 929   */
 930  
 931  
 932  
 933  
 934  
 935  
 936  
 937  
 938  /**
 939   * Internal dependencies
 940   */
 941  
 942  
 943  
 944  var inline_stopKeyPropagation = function stopKeyPropagation(event) {
 945    return event.stopPropagation();
 946  };
 947  
 948  function isShowingInput(props, state) {
 949    return props.addingLink || state.editLink;
 950  }
 951  
 952  var inline_URLPopoverAtLink = function URLPopoverAtLink(_ref) {
 953    var isActive = _ref.isActive,
 954        addingLink = _ref.addingLink,
 955        value = _ref.value,
 956        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["isActive", "addingLink", "value"]);
 957  
 958    var anchorRect = Object(external_this_wp_element_["useMemo"])(function () {
 959      var selection = window.getSelection();
 960      var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
 961  
 962      if (!range) {
 963        return;
 964      }
 965  
 966      if (addingLink) {
 967        return Object(external_this_wp_dom_["getRectangleFromRange"])(range);
 968      }
 969  
 970      var element = range.startContainer; // If the caret is right before the element, select the next element.
 971  
 972      element = element.nextElementSibling || element;
 973  
 974      while (element.nodeType !== window.Node.ELEMENT_NODE) {
 975        element = element.parentNode;
 976      }
 977  
 978      var closest = element.closest('a');
 979  
 980      if (closest) {
 981        return closest.getBoundingClientRect();
 982      }
 983    }, [isActive, addingLink, value.start, value.end]);
 984  
 985    if (!anchorRect) {
 986      return null;
 987    }
 988  
 989    return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["URLPopover"], Object(esm_extends["a" /* default */])({
 990      anchorRect: anchorRect
 991    }, props));
 992  };
 993  
 994  var inline_InlineLinkUI =
 995  /*#__PURE__*/
 996  function (_Component) {
 997    Object(inherits["a" /* default */])(InlineLinkUI, _Component);
 998  
 999    function InlineLinkUI() {
1000      var _this;
1001  
1002      Object(classCallCheck["a" /* default */])(this, InlineLinkUI);
1003  
1004      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(InlineLinkUI).apply(this, arguments));
1005      _this.editLink = _this.editLink.bind(Object(assertThisInitialized["a" /* default */])(_this));
1006      _this.submitLink = _this.submitLink.bind(Object(assertThisInitialized["a" /* default */])(_this));
1007      _this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
1008      _this.onChangeInputValue = _this.onChangeInputValue.bind(Object(assertThisInitialized["a" /* default */])(_this));
1009      _this.setLinkTarget = _this.setLinkTarget.bind(Object(assertThisInitialized["a" /* default */])(_this));
1010      _this.onFocusOutside = _this.onFocusOutside.bind(Object(assertThisInitialized["a" /* default */])(_this));
1011      _this.resetState = _this.resetState.bind(Object(assertThisInitialized["a" /* default */])(_this));
1012      _this.autocompleteRef = Object(external_this_wp_element_["createRef"])();
1013      _this.state = {
1014        opensInNewWindow: false,
1015        inputValue: ''
1016      };
1017      return _this;
1018    }
1019  
1020    Object(createClass["a" /* default */])(InlineLinkUI, [{
1021      key: "onKeyDown",
1022      value: function onKeyDown(event) {
1023        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) {
1024          // Stop the key event from propagating up to ObserveTyping.startTypingInTextField.
1025          event.stopPropagation();
1026        }
1027      }
1028    }, {
1029      key: "onChangeInputValue",
1030      value: function onChangeInputValue(inputValue) {
1031        this.setState({
1032          inputValue: inputValue
1033        });
1034      }
1035    }, {
1036      key: "setLinkTarget",
1037      value: function setLinkTarget(opensInNewWindow) {
1038        var _this$props = this.props,
1039            _this$props$activeAtt = _this$props.activeAttributes.url,
1040            url = _this$props$activeAtt === void 0 ? '' : _this$props$activeAtt,
1041            value = _this$props.value,
1042            onChange = _this$props.onChange;
1043        this.setState({
1044          opensInNewWindow: opensInNewWindow
1045        }); // Apply now if URL is not being edited.
1046  
1047        if (!isShowingInput(this.props, this.state)) {
1048          var selectedText = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(value));
1049          onChange(Object(external_this_wp_richText_["applyFormat"])(value, createLinkFormat({
1050            url: url,
1051            opensInNewWindow: opensInNewWindow,
1052            text: selectedText
1053          })));
1054        }
1055      }
1056    }, {
1057      key: "editLink",
1058      value: function editLink(event) {
1059        this.setState({
1060          editLink: true
1061        });
1062        event.preventDefault();
1063      }
1064    }, {
1065      key: "submitLink",
1066      value: function submitLink(event) {
1067        var _this$props2 = this.props,
1068            isActive = _this$props2.isActive,
1069            value = _this$props2.value,
1070            onChange = _this$props2.onChange,
1071            speak = _this$props2.speak;
1072        var _this$state = this.state,
1073            inputValue = _this$state.inputValue,
1074            opensInNewWindow = _this$state.opensInNewWindow;
1075        var url = Object(external_this_wp_url_["prependHTTP"])(inputValue);
1076        var selectedText = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(value));
1077        var format = createLinkFormat({
1078          url: url,
1079          opensInNewWindow: opensInNewWindow,
1080          text: selectedText
1081        });
1082        event.preventDefault();
1083  
1084        if (Object(external_this_wp_richText_["isCollapsed"])(value) && !isActive) {
1085          var toInsert = Object(external_this_wp_richText_["applyFormat"])(Object(external_this_wp_richText_["create"])({
1086            text: url
1087          }), format, 0, url.length);
1088          onChange(Object(external_this_wp_richText_["insert"])(value, toInsert));
1089        } else {
1090          onChange(Object(external_this_wp_richText_["applyFormat"])(value, format));
1091        }
1092  
1093        this.resetState();
1094  
1095        if (!isValidHref(url)) {
1096          speak(Object(external_this_wp_i18n_["__"])('Warning: the link has been inserted but may have errors. Please test it.'), 'assertive');
1097        } else if (isActive) {
1098          speak(Object(external_this_wp_i18n_["__"])('Link edited.'), 'assertive');
1099        } else {
1100          speak(Object(external_this_wp_i18n_["__"])('Link inserted.'), 'assertive');
1101        }
1102      }
1103    }, {
1104      key: "onFocusOutside",
1105      value: function onFocusOutside() {
1106        // The autocomplete suggestions list renders in a separate popover (in a portal),
1107        // so onFocusOutside fails to detect that a click on a suggestion occurred in the
1108        // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and
1109        // return to avoid the popover being closed.
1110        var autocompleteElement = this.autocompleteRef.current;
1111  
1112        if (autocompleteElement && autocompleteElement.contains(document.activeElement)) {
1113          return;
1114        }
1115  
1116        this.resetState();
1117      }
1118    }, {
1119      key: "resetState",
1120      value: function resetState() {
1121        this.props.stopAddingLink();
1122        this.setState({
1123          editLink: false
1124        });
1125      }
1126    }, {
1127      key: "render",
1128      value: function render() {
1129        var _this2 = this;
1130  
1131        var _this$props3 = this.props,
1132            isActive = _this$props3.isActive,
1133            url = _this$props3.activeAttributes.url,
1134            addingLink = _this$props3.addingLink,
1135            value = _this$props3.value;
1136  
1137        if (!isActive && !addingLink) {
1138          return null;
1139        }
1140  
1141        var _this$state2 = this.state,
1142            inputValue = _this$state2.inputValue,
1143            opensInNewWindow = _this$state2.opensInNewWindow;
1144        var showInput = isShowingInput(this.props, this.state);
1145        return Object(external_this_wp_element_["createElement"])(inline_URLPopoverAtLink, {
1146          value: value,
1147          isActive: isActive,
1148          addingLink: addingLink,
1149          onFocusOutside: this.onFocusOutside,
1150          onClose: this.resetState,
1151          focusOnMount: showInput ? 'firstElement' : false,
1152          renderSettings: function renderSettings() {
1153            return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToggleControl"], {
1154              label: Object(external_this_wp_i18n_["__"])('Open in New Tab'),
1155              checked: opensInNewWindow,
1156              onChange: _this2.setLinkTarget
1157            });
1158          }
1159        }, showInput ? Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["URLPopover"].LinkEditor, {
1160          className: "editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",
1161          value: inputValue,
1162          onChangeInputValue: this.onChangeInputValue,
1163          onKeyDown: this.onKeyDown,
1164          onKeyPress: inline_stopKeyPropagation,
1165          onSubmit: this.submitLink,
1166          autocompleteRef: this.autocompleteRef
1167        }) : Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["URLPopover"].LinkViewer, {
1168          className: "editor-format-toolbar__link-container-content block-editor-format-toolbar__link-container-content",
1169          onKeyPress: inline_stopKeyPropagation,
1170          url: url,
1171          onEditLinkClick: this.editLink,
1172          linkClassName: isValidHref(Object(external_this_wp_url_["prependHTTP"])(url)) ? undefined : 'has-invalid-link'
1173        }));
1174      }
1175    }], [{
1176      key: "getDerivedStateFromProps",
1177      value: function getDerivedStateFromProps(props, state) {
1178        var _props$activeAttribut = props.activeAttributes,
1179            url = _props$activeAttribut.url,
1180            target = _props$activeAttribut.target;
1181        var opensInNewWindow = target === '_blank';
1182  
1183        if (!isShowingInput(props, state)) {
1184          var update = {};
1185  
1186          if (url !== state.inputValue) {
1187            update.inputValue = url;
1188          }
1189  
1190          if (opensInNewWindow !== state.opensInNewWindow) {
1191            update.opensInNewWindow = opensInNewWindow;
1192          }
1193  
1194          return Object.keys(update).length ? update : null;
1195        }
1196  
1197        return null;
1198      }
1199    }]);
1200  
1201    return InlineLinkUI;
1202  }(external_this_wp_element_["Component"]);
1203  
1204  /* harmony default export */ var inline = (Object(external_this_wp_components_["withSpokenMessages"])(inline_InlineLinkUI));
1205  
1206  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js
1207  
1208  
1209  
1210  
1211  
1212  
1213  
1214  
1215  /**
1216   * WordPress dependencies
1217   */
1218  
1219  
1220  
1221  
1222  
1223  
1224  
1225  /**
1226   * Internal dependencies
1227   */
1228  
1229  
1230  var link_name = 'core/link';
1231  
1232  var link_title = Object(external_this_wp_i18n_["__"])('Link');
1233  
1234  var link_link = {
1235    name: link_name,
1236    title: link_title,
1237    tagName: 'a',
1238    className: null,
1239    attributes: {
1240      url: 'href',
1241      target: 'target'
1242    },
1243    __unstablePasteRule: function __unstablePasteRule(value, _ref) {
1244      var html = _ref.html,
1245          plainText = _ref.plainText;
1246  
1247      if (Object(external_this_wp_richText_["isCollapsed"])(value)) {
1248        return value;
1249      }
1250  
1251      var pastedText = (html || plainText).replace(/<[^>]+>/g, '').trim(); // A URL was pasted, turn the selection into a link
1252  
1253      if (!Object(external_this_wp_url_["isURL"])(pastedText)) {
1254        return value;
1255      } // Allows us to ask for this information when we get a report.
1256  
1257  
1258      window.console.log('Created link:\n\n', pastedText);
1259      return Object(external_this_wp_richText_["applyFormat"])(value, {
1260        type: link_name,
1261        attributes: {
1262          url: Object(external_this_wp_htmlEntities_["decodeEntities"])(pastedText)
1263        }
1264      });
1265    },
1266    edit: Object(external_this_wp_components_["withSpokenMessages"])(
1267    /*#__PURE__*/
1268    function (_Component) {
1269      Object(inherits["a" /* default */])(LinkEdit, _Component);
1270  
1271      function LinkEdit() {
1272        var _this;
1273  
1274        Object(classCallCheck["a" /* default */])(this, LinkEdit);
1275  
1276        _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(LinkEdit).apply(this, arguments));
1277        _this.addLink = _this.addLink.bind(Object(assertThisInitialized["a" /* default */])(_this));
1278        _this.stopAddingLink = _this.stopAddingLink.bind(Object(assertThisInitialized["a" /* default */])(_this));
1279        _this.onRemoveFormat = _this.onRemoveFormat.bind(Object(assertThisInitialized["a" /* default */])(_this));
1280        _this.state = {
1281          addingLink: false
1282        };
1283        return _this;
1284      }
1285  
1286      Object(createClass["a" /* default */])(LinkEdit, [{
1287        key: "addLink",
1288        value: function addLink() {
1289          var _this$props = this.props,
1290              value = _this$props.value,
1291              onChange = _this$props.onChange;
1292          var text = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(value));
1293  
1294          if (text && Object(external_this_wp_url_["isURL"])(text)) {
1295            onChange(Object(external_this_wp_richText_["applyFormat"])(value, {
1296              type: link_name,
1297              attributes: {
1298                url: text
1299              }
1300            }));
1301          } else if (text && Object(external_this_wp_url_["isEmail"])(text)) {
1302            onChange(Object(external_this_wp_richText_["applyFormat"])(value, {
1303              type: link_name,
1304              attributes: {
1305                url: "mailto:".concat(text)
1306              }
1307            }));
1308          } else {
1309            this.setState({
1310              addingLink: true
1311            });
1312          }
1313        }
1314      }, {
1315        key: "stopAddingLink",
1316        value: function stopAddingLink() {
1317          this.setState({
1318            addingLink: false
1319          });
1320        }
1321      }, {
1322        key: "onRemoveFormat",
1323        value: function onRemoveFormat() {
1324          var _this$props2 = this.props,
1325              value = _this$props2.value,
1326              onChange = _this$props2.onChange,
1327              speak = _this$props2.speak;
1328          onChange(Object(external_this_wp_richText_["removeFormat"])(value, link_name));
1329          speak(Object(external_this_wp_i18n_["__"])('Link removed.'), 'assertive');
1330        }
1331      }, {
1332        key: "render",
1333        value: function render() {
1334          var _this$props3 = this.props,
1335              isActive = _this$props3.isActive,
1336              activeAttributes = _this$props3.activeAttributes,
1337              value = _this$props3.value,
1338              onChange = _this$props3.onChange;
1339          return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], {
1340            type: "primary",
1341            character: "k",
1342            onUse: this.addLink
1343          }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], {
1344            type: "primaryShift",
1345            character: "k",
1346            onUse: this.onRemoveFormat
1347          }), isActive && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
1348            name: "link",
1349            icon: "editor-unlink",
1350            title: Object(external_this_wp_i18n_["__"])('Unlink'),
1351            onClick: this.onRemoveFormat,
1352            isActive: isActive,
1353            shortcutType: "primaryShift",
1354            shortcutCharacter: "k"
1355          }), !isActive && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
1356            name: "link",
1357            icon: "admin-links",
1358            title: link_title,
1359            onClick: this.addLink,
1360            isActive: isActive,
1361            shortcutType: "primary",
1362            shortcutCharacter: "k"
1363          }), Object(external_this_wp_element_["createElement"])(inline, {
1364            addingLink: this.state.addingLink,
1365            stopAddingLink: this.stopAddingLink,
1366            isActive: isActive,
1367            activeAttributes: activeAttributes,
1368            value: value,
1369            onChange: onChange
1370          }));
1371        }
1372      }]);
1373  
1374      return LinkEdit;
1375    }(external_this_wp_element_["Component"]))
1376  };
1377  
1378  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js
1379  
1380  
1381  /**
1382   * WordPress dependencies
1383   */
1384  
1385  
1386  
1387  var strikethrough_name = 'core/strikethrough';
1388  
1389  var strikethrough_title = Object(external_this_wp_i18n_["__"])('Strikethrough');
1390  
1391  var strikethrough = {
1392    name: strikethrough_name,
1393    title: strikethrough_title,
1394    tagName: 's',
1395    className: null,
1396    edit: function edit(_ref) {
1397      var isActive = _ref.isActive,
1398          value = _ref.value,
1399          onChange = _ref.onChange;
1400  
1401      var onToggle = function onToggle() {
1402        return onChange(Object(external_this_wp_richText_["toggleFormat"])(value, {
1403          type: strikethrough_name
1404        }));
1405      };
1406  
1407      return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextToolbarButton"], {
1408        icon: "editor-strikethrough",
1409        title: strikethrough_title,
1410        onClick: onToggle,
1411        isActive: isActive
1412      });
1413    }
1414  };
1415  
1416  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js
1417  
1418  
1419  /**
1420   * WordPress dependencies
1421   */
1422  
1423  
1424  
1425  var underline_name = 'core/underline';
1426  var underline = {
1427    name: underline_name,
1428    title: Object(external_this_wp_i18n_["__"])('Underline'),
1429    tagName: 'span',
1430    className: null,
1431    attributes: {
1432      style: 'style'
1433    },
1434    edit: function edit(_ref) {
1435      var value = _ref.value,
1436          onChange = _ref.onChange;
1437  
1438      var onToggle = function onToggle() {
1439        onChange(Object(external_this_wp_richText_["toggleFormat"])(value, {
1440          type: underline_name,
1441          attributes: {
1442            style: 'text-decoration: underline;'
1443          }
1444        }));
1445      };
1446  
1447      return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichTextShortcut"], {
1448        type: "primary",
1449        character: "u",
1450        onUse: onToggle
1451      }), Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__unstableRichTextInputEvent"], {
1452        inputType: "formatUnderline",
1453        onInput: onToggle
1454      }));
1455    }
1456  };
1457  
1458  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/default-formats.js
1459  /**
1460   * Internal dependencies
1461   */
1462  
1463  
1464  
1465  
1466  
1467  
1468  
1469  /* harmony default export */ var default_formats = ([bold, code, image_image, italic, link_link, strikethrough, underline]);
1470  
1471  // CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/index.js
1472  
1473  
1474  /**
1475   * WordPress dependencies
1476   */
1477  
1478  /**
1479   * Internal dependencies
1480   */
1481  
1482  
1483  default_formats.forEach(function (_ref) {
1484    var name = _ref.name,
1485        settings = Object(objectWithoutProperties["a" /* default */])(_ref, ["name"]);
1486  
1487    return Object(external_this_wp_richText_["registerFormatType"])(name, settings);
1488  });
1489  
1490  
1491  /***/ }),
1492  
1493  /***/ 5:
1494  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1495  
1496  "use strict";
1497  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
1498  function _assertThisInitialized(self) {
1499    if (self === void 0) {
1500      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1501    }
1502  
1503    return self;
1504  }
1505  
1506  /***/ }),
1507  
1508  /***/ 52:
1509  /***/ (function(module, exports) {
1510  
1511  (function() { module.exports = this["wp"]["htmlEntities"]; }());
1512  
1513  /***/ }),
1514  
1515  /***/ 6:
1516  /***/ (function(module, exports) {
1517  
1518  (function() { module.exports = this["wp"]["blockEditor"]; }());
1519  
1520  /***/ }),
1521  
1522  /***/ 7:
1523  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1524  
1525  "use strict";
1526  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
1527  /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
1528  
1529  function _objectSpread(target) {
1530    for (var i = 1; i < arguments.length; i++) {
1531      var source = arguments[i] != null ? arguments[i] : {};
1532      var ownKeys = Object.keys(source);
1533  
1534      if (typeof Object.getOwnPropertySymbols === 'function') {
1535        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
1536          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1537        }));
1538      }
1539  
1540      ownKeys.forEach(function (key) {
1541        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
1542      });
1543    }
1544  
1545    return target;
1546  }
1547  
1548  /***/ })
1549  
1550  /******/ });


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7