-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1f13fe
commit 3e2e8b5
Showing
6 changed files
with
7,598 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-i18n', 'wp-plugins'), 'version' => 'e8c6101578cbc0285708'); | ||
<?php return array('dependencies' => array('react', 'wp-i18n', 'wp-plugins'), 'version' => 'c30059576042eea38880'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,178 @@ | ||
(()=>{"use strict";const e=window.React,t=window.wp.i18n;(0,window.wp.plugins.registerPlugin)("dlx-pattern-wrangler-preview-button",{render:function(){return(0,e.useEffect)((function(){var e=document.querySelector(".edit-post-header");if(null!==e){var r=e.querySelector(".edit-post-header__settings");if(null!==r){var n=document.createElement("a");n.className="dlx-button-preview components-button has-icon",n.ariaLabel=(0,t.__)("Preview","dlx-pattern-wrangler"),n.href=dlxPatternWranglerPreview.previewUrl,n.target="_blank",n.rel="noopener noreferrer";var a=document.createElement("svg");a.className="dlx-pattern-wrangler-preview-icon",a.innerHTML='<svg width="16" height="16" style="display: inline-block; margin-right: 8px;"><use xlink:href="#dlx-pattern-wrangler-preview-icon" /></svg>',n.prepend(a),r.prepend(n)}}}),[]),React.createElement(React.Fragment,null,React.createElement("svg",{height:"0",width:"0",xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},"aria-hidden":"true"},React.createElement("symbol",{id:"dlx-pattern-wrangler-preview-icon",width:"16",height:"16",viewBox:"0 0 512 512"},React.createElement("path",{fill:"currentColor",d:"M304 24c0 13.3 10.7 24 24 24h102.1L207 271c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l223-223V184c0 13.3 10.7 24 24 24s24-10.7 24-24V24c0-13.3-10.7-24-24-24H328c-13.3 0-24 10.7-24 24zM72 32C32.2 32 0 64.2 0 104v336c0 39.8 32.2 72 72 72h336c39.8 0 72-32.2 72-72V312c0-13.3-10.7-24-24-24s-24 10.7-24 24v128c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24h128c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z"}))))}})})(); | ||
//# sourceMappingURL=dlx-pw-preview.js.map | ||
/******/ (() => { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ var __webpack_modules__ = ({ | ||
|
||
/***/ "react": | ||
/*!************************!*\ | ||
!*** external "React" ***! | ||
\************************/ | ||
/***/ ((module) => { | ||
|
||
module.exports = window["React"]; | ||
|
||
/***/ }), | ||
|
||
/***/ "@wordpress/i18n": | ||
/*!******************************!*\ | ||
!*** external ["wp","i18n"] ***! | ||
\******************************/ | ||
/***/ ((module) => { | ||
|
||
module.exports = window["wp"]["i18n"]; | ||
|
||
/***/ }), | ||
|
||
/***/ "@wordpress/plugins": | ||
/*!*********************************!*\ | ||
!*** external ["wp","plugins"] ***! | ||
\*********************************/ | ||
/***/ ((module) => { | ||
|
||
module.exports = window["wp"]["plugins"]; | ||
|
||
/***/ }) | ||
|
||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ var cachedModule = __webpack_module_cache__[moduleId]; | ||
/******/ if (cachedModule !== undefined) { | ||
/******/ return cachedModule.exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/compat get default export */ | ||
/******/ (() => { | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = (module) => { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ () => (module['default']) : | ||
/******/ () => (module); | ||
/******/ __webpack_require__.d(getter, { a: getter }); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ (() => { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = (exports) => { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. | ||
(() => { | ||
/*!**************************************************!*\ | ||
!*** ./src/js/blocks/plugins/pattern-preview.js ***! | ||
\**************************************************/ | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); | ||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins"); | ||
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__); | ||
|
||
|
||
|
||
|
||
/** | ||
* Render a Preview Button. | ||
* | ||
* @return {Object} The rendered component. | ||
*/ | ||
var PatternPreviewButton = function PatternPreviewButton() { | ||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { | ||
var headerToolbar = document.querySelector('.edit-post-header'); | ||
if (null === headerToolbar) { | ||
return; | ||
} | ||
|
||
// Get the left toolbar and add to it. | ||
var settingsToolbar = headerToolbar.querySelector('.edit-post-header__settings'); | ||
if (null === settingsToolbar) { | ||
return; | ||
} | ||
|
||
// Create the button. | ||
var button = document.createElement('a'); | ||
button.className = 'dlx-button-preview components-button has-icon'; | ||
button.ariaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Preview', 'dlx-pattern-wrangler'); | ||
button.href = dlxPatternWranglerPreview.previewUrl; | ||
button.target = '_blank'; | ||
button.rel = 'noopener noreferrer'; | ||
|
||
// Add icon. | ||
var icon = document.createElement('svg'); | ||
icon.className = 'dlx-pattern-wrangler-preview-icon'; | ||
icon.innerHTML = '<svg width="16" height="16" style="display: inline-block; margin-right: 8px;"><use xlink:href="#dlx-pattern-wrangler-preview-icon" /></svg>'; | ||
button.prepend(icon); | ||
// Add the button to the toolbar as the first child. | ||
settingsToolbar.prepend(button); | ||
}, []); | ||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("svg", { | ||
height: "0", | ||
width: "0", | ||
xmlns: "http://www.w3.org/2000/svg", | ||
style: { | ||
display: 'none' | ||
}, | ||
"aria-hidden": "true" | ||
}, /*#__PURE__*/React.createElement("symbol", { | ||
id: "dlx-pattern-wrangler-preview-icon", | ||
width: "16", | ||
height: "16", | ||
viewBox: "0 0 512 512" | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "currentColor", | ||
d: "M304 24c0 13.3 10.7 24 24 24h102.1L207 271c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l223-223V184c0 13.3 10.7 24 24 24s24-10.7 24-24V24c0-13.3-10.7-24-24-24H328c-13.3 0-24 10.7-24 24zM72 32C32.2 32 0 64.2 0 104v336c0 39.8 32.2 72 72 72h336c39.8 0 72-32.2 72-72V312c0-13.3-10.7-24-24-24s-24 10.7-24 24v128c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24h128c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z" | ||
})))); | ||
}; | ||
(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('dlx-pattern-wrangler-preview-button', { | ||
render: PatternPreviewButton | ||
}); | ||
})(); | ||
|
||
/******/ })() | ||
; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => 'b5ded88be68f47013485'); | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => '97feab35bf36d9fe3aa4'); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.