Changeset 10930
- Timestamp:
- 04/27/2021 02:19:13 PM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/build/index.asset.php
r10924 r10930 1 <?php return array('dependencies' => array('react', 'wp- block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => '47d0699f3951f1009351fbc4a9fef0da');1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport'), 'version' => '51d417961bbb5e88ef5cc17bcdd3e65e'); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/build/index.js
r10924 r10930 11338 11338 head = _ref.head, 11339 11339 headHTML = _ref.headHTML, 11340 props = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_ref, ["contentRef", "children", "head", "headHTML"]); 11340 themeSlug = _ref.themeSlug, 11341 props = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_ref, ["contentRef", "children", "head", "headHTML", "themeSlug"]); 11341 11342 11342 11343 var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])(), … … 11344 11345 iframeDocument = _useState2[0], 11345 11346 setIframeDocument = _useState2[1]; 11347 11348 headHTML += '<style>body{pointer-events:none;display: flex;align-items: center;justify-content: center;min-height: 100vh;} body > div {width: 100%}</style>'; 11349 11350 if (themeSlug) { 11351 headHTML += "<link rel=\"stylesheet\" href=\"https://wp-themes.com/wp-content/themes/".concat(themeSlug, "/style.css\" media=\"all\" />"); 11352 } else { 11353 headHTML += '<link rel="stylesheet" href="https://wp-themes.com/wp-content/themes/twentytwentyone/style.css" media="all" />'; 11354 } 11346 11355 11347 11356 var setRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (node) { … … 11596 11605 } 11597 11606 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { 11598 src: " /wp-content/themes/pattern-directory/images/copy-paste-demo.gif",11607 src: "".concat(wporgAssetUrl, "/images/copy-paste-demo.gif"), 11599 11608 alt: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('GIF of copy and pasting.', 'wporg-patterns') 11600 11609 })) … … 11748 11757 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 11749 11758 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 11750 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 11751 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 11752 11753 11754 /** 11755 * WordPress dependencies 11759 /* harmony import */ var _iframe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../iframe */ "./src/components/iframe/index.js"); 11760 11761 11762 /** 11763 * Internal dependencies 11756 11764 */ 11757 11765 … … 11765 11773 overflowY: 'auto' 11766 11774 }; 11767 var extraIframeStyles = // @todo - Should we keep the TT1 style? Load css from a local file? 11768 '<link rel="stylesheet" id="twenty-twenty-one-style-css" href="https://wp-themes.com/wp-content/themes/twentytwentyone/style.css?ver=1.2" media="all" />' + '<style>body{pointer-events:none;display: flex;align-items: center;justify-content: center;min-height: 100vh;} body > div {width: 100%}</style>'; 11769 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__["__unstableIframe"], { 11775 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_iframe__WEBPACK_IMPORTED_MODULE_1__["default"], { 11770 11776 className: "pattern-preview__viewport-iframe", 11771 11777 style: style, 11772 headHTML: window.__editorStyles.html + extraIframeStyles11778 headHTML: window.__editorStyles.html 11773 11779 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { 11774 11780 dangerouslySetInnerHTML: { … … 13138 13144 /***/ }), 13139 13145 13140 /***/ "@wordpress/block-editor":13141 /*!*************************************!*\13142 !*** external ["wp","blockEditor"] ***!13143 \*************************************/13144 /*! no static exports found */13145 /***/ (function(module, exports) {13146 13147 (function() { module.exports = window["wp"]["blockEditor"]; }());13148 13149 /***/ }),13150 13151 13146 /***/ "@wordpress/components": 13152 13147 /*!************************************!*\ -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/functions.php
r10882 r10930 59 59 60 60 wp_set_script_translations( 'wporg-pattern-script', 'wporg-patterns' ); 61 62 wp_add_inline_script( 63 'wporg-pattern-script', 64 sprintf( 'var wporgAssetUrl = "%s";', esc_url( get_stylesheet_directory_uri() ) ), 65 'before' 66 ); 61 67 } 62 68 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/package.json
r10882 r10930 55 55 "extends": "../../../../.eslintrc.js", 56 56 "globals": { 57 "wporg BlockPattern": "readonly"57 "wporgAssetUrl": "readonly" 58 58 } 59 59 }, -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/src/components/iframe/index.js
r10882 r10930 91 91 } 92 92 93 function Iframe( { contentRef, children, head, headHTML, ...props }, ref ) {93 function Iframe( { contentRef, children, head, headHTML, themeSlug, ...props }, ref ) { 94 94 const [ iframeDocument, setIframeDocument ] = useState(); 95 96 headHTML += 97 '<style>body{pointer-events:none;display: flex;align-items: center;justify-content: center;min-height: 100vh;} body > div {width: 100%}</style>'; 98 99 if ( themeSlug ) { 100 headHTML += `<link rel="stylesheet" href="https://wp-themes.com/wp-content/themes/${ themeSlug }/style.css" media="all" />`; 101 } else { 102 headHTML += '<link rel="stylesheet" href="https://wp-themes.com/wp-content/themes/twentytwentyone/style.css" media="all" />'; 103 } 95 104 96 105 const setRef = useCallback( ( node ) => { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/src/components/pattern-preview-actions/copy-guide.js
r10924 r10930 10 10 <div style={ { height: '220px' } }> 11 11 <img 12 src= "/wp-content/themes/pattern-directory/images/copy-paste-demo.gif"12 src={ `${ wporgAssetUrl }/images/copy-paste-demo.gif` } 13 13 alt={ __( 'GIF of copy and pasting.', 'wporg-patterns' ) } 14 14 /> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/src/components/pattern-preview/canvas.js
r10841 r10930 1 1 /** 2 * WordPressdependencies2 * Internal dependencies 3 3 */ 4 import { 5 /* eslint-disable-next-line @wordpress/no-unsafe-wp-apis -- Experimental is OK. */ 6 __unstableIframe as Iframe, 7 } from '@wordpress/block-editor'; 4 import Iframe from '../iframe'; 8 5 9 6 function Canvas( { html } ) { … … 14 11 overflowY: 'auto', 15 12 }; 16 const extraIframeStyles =17 // @todo - Should we keep the TT1 style? Load css from a local file?18 '<link rel="stylesheet" id="twenty-twenty-one-style-css" href="https://wp-themes.com/wp-content/themes/twentytwentyone/style.css?ver=1.2" media="all" />' +19 '<style>body{pointer-events:none;display: flex;align-items: center;justify-content: center;min-height: 100vh;} body > div {width: 100%}</style>';20 13 21 14 return ( … … 24 17 className="pattern-preview__viewport-iframe" 25 18 style={ style } 26 headHTML={ window.__editorStyles.html + extraIframeStyles}19 headHTML={ window.__editorStyles.html } 27 20 > 28 21 <div
Note: See TracChangeset
for help on using the changeset viewer.