Changeset 2892776
- Timestamp:
- 04/03/2023 01:31:42 PM (3 years ago)
- Location:
- full-site-editing/trunk
- Files:
-
- 3 added
- 13 edited
-
build_meta.txt (modified) (1 diff)
-
full-site-editing-plugin.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.asset.php (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.css (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.js (modified) (8 diffs)
-
wpcom-global-styles/dist/wpcom-global-styles.min.js (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.rtl.css (modified) (1 diff)
-
wpcom-global-styles/global-style-sidebar-notice.tsx (added)
-
wpcom-global-styles/index.js (modified) (2 diffs)
-
wpcom-global-styles/index.php (modified) (2 diffs)
-
wpcom-global-styles/notice.js (modified) (3 diffs)
-
wpcom-global-styles/notice.scss (modified) (1 diff)
-
wpcom-global-styles/test/class-wpcom-global-styles-test.php (modified) (1 diff)
-
wpcom-global-styles/tracks-events.ts (added)
-
wpcom-global-styles/use-global-styles-config.js (added)
Legend:
- Unmodified
- Added
- Removed
-
full-site-editing/trunk/build_meta.txt
r2890140 r2892776 1 commit_hash= 07da4c4beac1aa92f9efa94a2c9801aff3a8cef62 commit_url=https://github.com/Automattic/wp-calypso/commit/ 07da4c4beac1aa92f9efa94a2c9801aff3a8cef63 build_number=3.6 08121 commit_hash=529f46e30bfcaf5f243e7ed8843520efae260d1e 2 commit_url=https://github.com/Automattic/wp-calypso/commit/529f46e30bfcaf5f243e7ed8843520efae260d1e 3 build_number=3.61113 -
full-site-editing/trunk/full-site-editing-plugin.php
r2890140 r2892776 3 3 * Plugin Name: WordPress.com Editing Toolkit 4 4 * Description: Enhances your page creation workflow within the Block Editor. 5 * Version: 3.6 08125 * Version: 3.61113 6 6 * Author: Automattic 7 7 * Author URI: https://automattic.com/wordpress-plugins/ … … 43 43 * @var string 44 44 */ 45 define( 'A8C_ETK_PLUGIN_VERSION', '3.6 0812' );45 define( 'A8C_ETK_PLUGIN_VERSION', '3.61113' ); 46 46 47 47 // Always include these helper files for dotcom FSE. -
full-site-editing/trunk/readme.txt
r2890140 r2892776 4 4 Requires at least: 5.5 5 5 Tested up to: 6.0 6 Stable tag: 3.6 08126 Stable tag: 3.61113 7 7 Requires PHP: 5.6.20 8 8 License: GPLv2 or later -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.asset.php
r2881681 r2892776 1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' ee987c3c2dcbd14a2e6e');1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '30e81ef86914265f5a8d'); -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.css
r2803410 r2892776 1 1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,"Times New Roman",Times,serif;font-weight:400}[lang*=af] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ca] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=cs] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=da] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=de] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=en] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=es] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=eu] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=fi] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=fr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=gl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=hr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=hu] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=id] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=is] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=it] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=lv] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=mt] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=nb] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=nl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=pl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=pt] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ro] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ru] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sk] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sq] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sv] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sw] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=tr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=uz] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}.wpcom-global-styles-modal .components-modal__content{padding:0;margin-top:0;display:flex;flex-direction:column-reverse;justify-content:flex-end}@media(min-width: 600px){.wpcom-global-styles-modal .components-modal__content{flex-direction:row;justify-content:flex-start}}.wpcom-global-styles-modal .components-modal__header{height:auto;position:absolute}.wpcom-global-styles-modal .components-modal__header .components-button{top:16px}.wpcom-global-styles-modal .wpcom-global-styles-modal__text,.wpcom-global-styles-modal .wpcom-global-styles-modal__image{width:100%}@media(min-width: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__text,.wpcom-global-styles-modal .wpcom-global-styles-modal__image{width:auto;max-width:380px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{padding:64px 48px;display:flex;flex-direction:column}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{margin-top:0;font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif;font-weight:400;font-size:2rem;line-height:40px;margin-bottom:16px}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-top:0;margin-bottom:32px}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;padding:64px 0 64px 64px;display:flex;justify-content:flex-end}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%} 2 .wpcom-global-styles-notice{margin: 16px 0 0}.wpcom-global-styles-notice .components-notice__content{margin-right:0}.wpcom-global-styles-notice a{display:inline}.wpcom-global-styles-notice .components-button.is-link{color:var(--color-link)}.wpcom-global-styles-notice .components-button.is-link:hover{color:var(--color-link-light)}2 .wpcom-global-styles-notice{margin:0 0 0 0}.wpcom-global-styles-notice .notice-margin{margin:16px 0 0}.wpcom-global-styles-notice .components-notice__content{margin-right:0}.wpcom-global-styles-notice a{display:inline}.wpcom-global-styles-notice .components-button.is-link{color:var(--color-link)}.wpcom-global-styles-notice .components-button.is-link:hover{color:var(--color-link-light)} -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.js
r2888794 r2892776 1513 1513 /***/ }), 1514 1514 1515 /***/ 312: 1516 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1517 1518 "use strict"; 1519 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1520 /* harmony export */ "Z": () => (/* binding */ GlobalStylesSidebarNotice) 1521 /* harmony export */ }); 1522 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307); 1523 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1524 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609); 1525 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 1526 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(818); 1527 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 1528 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(736); 1529 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 1530 /* harmony import */ var _tracks_events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(369); 1531 /* harmony import */ var _use_global_styles_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(210); 1532 1533 1534 1535 1536 1537 const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__; 1538 1539 1540 const GLOBAL_STYLES_SIDEBAR = 'edit-site/global-styles'; 1541 function GlobalStylesSidebarNotice() { 1542 const area = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select('core/interface').getActiveComplementaryArea('core/edit-site'), []); 1543 const isGlobalStylesSidebar = GLOBAL_STYLES_SIDEBAR === area; 1544 const globalStylesInUse = (0,_use_global_styles_config__WEBPACK_IMPORTED_MODULE_5__/* .useGlobalStylesConfig */ .Y)().globalStylesInUse; 1545 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1546 if (globalStylesInUse && isGlobalStylesSidebar) { 1547 (0,_tracks_events__WEBPACK_IMPORTED_MODULE_4__/* .recordUpgradeNoticeSidebarShow */ .ap)(); 1548 } 1549 }, [globalStylesInUse, isGlobalStylesSidebar]); 1550 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Fill, { 1551 name: "ComplementaryArea/core/edit-site" 1552 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, globalStylesInUse && isGlobalStylesSidebar && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { 1553 className: "interface-complementary-area" 1554 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Notice, { 1555 status: "warning", 1556 isDismissible: false, 1557 className: "wpcom-global-styles-notice" 1558 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createInterpolateElement)(__('Your changes include customized styles that will only be visible once you <a>upgrade to a Premium plan</a>.', 'full-site-editing'), { 1559 a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ExternalLink, { 1560 href: wpcomGlobalStyles.upgradeUrl, 1561 target: "_blank", 1562 onClick: _tracks_events__WEBPACK_IMPORTED_MODULE_4__/* .recordUpgradeSidebarNoticeClick */ .vv 1563 }) 1564 }))))); 1565 } 1566 1567 /***/ }), 1568 1515 1569 /***/ 93: 1516 1570 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { … … 1621 1675 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307); 1622 1676 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 1623 /* harmony import */ var _automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(115); 1624 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(609); 1625 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); 1626 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(818); 1627 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); 1628 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(736); 1629 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 1630 /* harmony import */ var _notice_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(131); 1677 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(609); 1678 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); 1679 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(818); 1680 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); 1681 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(736); 1682 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 1683 /* harmony import */ var _notice_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(131); 1684 /* harmony import */ var _tracks_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(369); 1685 /* harmony import */ var _use_global_styles_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(210); 1631 1686 1632 1687 … … 1636 1691 1637 1692 1638 1639 const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__; 1693 const __ = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__; 1694 1695 1640 1696 1641 1697 1642 1698 function GlobalStylesNoticeComponent() { 1643 1699 const { 1644 globalStylesConfig, 1645 siteChanges 1646 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { 1647 const { 1648 getEditedEntityRecord, 1649 __experimentalGetCurrentGlobalStylesId, 1650 __experimentalGetDirtyEntityRecords 1651 } = select('core'); 1652 1653 const _globalStylesId = __experimentalGetCurrentGlobalStylesId ? __experimentalGetCurrentGlobalStylesId() : null; 1654 1655 const globalStylesRecord = getEditedEntityRecord('root', 'globalStyles', _globalStylesId); 1656 return { 1657 globalStylesConfig: { 1658 styles: (globalStylesRecord === null || globalStylesRecord === void 0 ? void 0 : globalStylesRecord.styles) ?? {}, 1659 settings: (globalStylesRecord === null || globalStylesRecord === void 0 ? void 0 : globalStylesRecord.settings) ?? {} 1660 }, 1661 siteChanges: __experimentalGetDirtyEntityRecords ? __experimentalGetDirtyEntityRecords() : [] 1662 }; 1663 }, []); // Do not show the notice if the use is trying to save the default styles. 1664 1665 const isVisible = Object.keys(globalStylesConfig.styles).length || Object.keys(globalStylesConfig.settings).length; // Closes the sidebar if there are no more changes to be saved. 1700 siteChanges, 1701 globalStylesInUse 1702 } = (0,_use_global_styles_config__WEBPACK_IMPORTED_MODULE_6__/* .useGlobalStylesConfig */ .Y)(); // Closes the sidebar if there are no more changes to be saved. 1666 1703 1667 1704 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { … … 1681 1718 }, [siteChanges]); 1682 1719 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1683 if (isVisible) { 1684 (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_1__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_notice_show', { 1685 context: 'site-editor' 1686 }); 1687 } 1688 }, [isVisible]); 1689 1690 if (!isVisible) { 1720 if (globalStylesInUse) { 1721 (0,_tracks_events__WEBPACK_IMPORTED_MODULE_5__/* .recordUpgradeNoticePreSaveShow */ .Tf)(); 1722 } 1723 }, [globalStylesInUse]); 1724 1725 if (!globalStylesInUse) { 1691 1726 return null; 1692 1727 } 1693 1728 1694 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_ 2__.Notice, {1729 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Notice, { 1695 1730 status: "warning", 1696 1731 isDismissible: false, 1697 className: "wpcom-global-styles-notice "1732 className: "wpcom-global-styles-notice notice-margin" 1698 1733 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createInterpolateElement)(__('Your changes include customized styles that will only be visible once you <a>upgrade to a Premium plan</a>.', 'full-site-editing'), { 1699 a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_ 2__.ExternalLink, {1734 a: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ExternalLink, { 1700 1735 href: wpcomGlobalStyles.upgradeUrl, 1701 1736 target: "_blank", 1702 onClick: () => (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_1__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_notice_upgrade_click', { 1703 context: 'site-editor' 1704 }) 1737 onClick: _tracks_events__WEBPACK_IMPORTED_MODULE_5__/* .recordUpgradePreSaveNoticeClick */ .LS 1705 1738 }) 1706 1739 })); … … 1711 1744 globalStylesConfig, 1712 1745 isSaveViewOpened 1713 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_ 3__.useSelect)(select => ({1746 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => ({ 1714 1747 globalStylesConfig: select('core').getEntityConfig('root', 'globalStyles'), 1715 1748 isSaveViewOpened: select('core/edit-site').isSaveViewOpened() … … 1803 1836 persist: true 1804 1837 }); 1838 1839 /***/ }), 1840 1841 /***/ 369: 1842 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1843 1844 "use strict"; 1845 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1846 /* harmony export */ "LS": () => (/* binding */ recordUpgradePreSaveNoticeClick), 1847 /* harmony export */ "vv": () => (/* binding */ recordUpgradeSidebarNoticeClick), 1848 /* harmony export */ "Tf": () => (/* binding */ recordUpgradeNoticePreSaveShow), 1849 /* harmony export */ "ap": () => (/* binding */ recordUpgradeNoticeSidebarShow) 1850 /* harmony export */ }); 1851 /* harmony import */ var _automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(115); 1852 1853 1854 /** 1855 * Record an event when a user clicks on the notice from the pre-save panel. 1856 */ 1857 function recordUpgradePreSaveNoticeClick() { 1858 (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_0__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_notice_upgrade_click', { 1859 context: 'site-editor', 1860 blog_id: wpcomGlobalStyles.wpcomBlogId 1861 }); 1862 } 1863 /** 1864 * Record an event when a user clicks on the notice from the Global Styles sidebar. 1865 */ 1866 1867 function recordUpgradeSidebarNoticeClick() { 1868 (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_0__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_notice_sidebar_upgrade_click', { 1869 context: 'site-editor', 1870 blog_id: wpcomGlobalStyles.wpcomBlogId 1871 }); 1872 } 1873 /** 1874 * Record an event when the GS upgrade notice is shown in the pre-save screen. 1875 */ 1876 1877 function recordUpgradeNoticePreSaveShow() { 1878 (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_0__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_notice_show', { 1879 context: 'site-editor', 1880 blog_id: wpcomGlobalStyles.wpcomBlogId 1881 }); 1882 } 1883 /** 1884 * Record an event when the GS upgrade notice is shown in the Global Styles sidebar. 1885 */ 1886 1887 function recordUpgradeNoticeSidebarShow() { 1888 (0,_automattic_calypso_analytics__WEBPACK_IMPORTED_MODULE_0__/* .recordTracksEvent */ .jN)('calypso_global_styles_gating_sidebar_notice_show', { 1889 context: 'site-editor', 1890 blog_id: wpcomGlobalStyles.wpcomBlogId 1891 }); 1892 } 1893 1894 /***/ }), 1895 1896 /***/ 210: 1897 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1898 1899 "use strict"; 1900 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 1901 /* harmony export */ "Y": () => (/* binding */ useGlobalStylesConfig) 1902 /* harmony export */ }); 1903 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(818); 1904 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); 1905 1906 function useGlobalStylesConfig() { 1907 return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { 1908 const { 1909 getEditedEntityRecord, 1910 __experimentalGetCurrentGlobalStylesId, 1911 __experimentalGetDirtyEntityRecords 1912 } = select('core'); 1913 1914 const _globalStylesId = __experimentalGetCurrentGlobalStylesId ? __experimentalGetCurrentGlobalStylesId() : null; 1915 1916 const globalStylesRecord = getEditedEntityRecord('root', 'globalStyles', _globalStylesId); 1917 const globalStylesConfig = { 1918 styles: (globalStylesRecord === null || globalStylesRecord === void 0 ? void 0 : globalStylesRecord.styles) ?? {}, 1919 settings: (globalStylesRecord === null || globalStylesRecord === void 0 ? void 0 : globalStylesRecord.settings) ?? {} 1920 }; // Determine if the global Styles are in use on the current site. 1921 1922 const globalStylesInUse = !!(Object.keys(globalStylesConfig.styles).length || Object.keys(globalStylesConfig.settings).length); 1923 return { 1924 globalStylesInUse, 1925 siteChanges: __experimentalGetDirtyEntityRecords ? __experimentalGetDirtyEntityRecords() : [] 1926 }; 1927 }, []); 1928 } 1805 1929 1806 1930 /***/ }), … … 3133 3257 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(817); 3134 3258 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__); 3135 /* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93); 3136 /* harmony import */ var _notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(624); 3137 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(366); 3259 /* harmony import */ var _global_style_sidebar_notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(312); 3260 /* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93); 3261 /* harmony import */ var _notice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(624); 3262 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(366); 3138 3263 3139 3264 3140 3265 /*** THIS MUST BE THE FIRST THING EVALUATED IN THIS SCRIPT *****/ 3266 3141 3267 3142 3268 … … 3148 3274 const showGlobalStylesComponents = () => { 3149 3275 (0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__.registerPlugin)('wpcom-global-styles', { 3150 render: () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_modal__WEBPACK_IMPORTED_MODULE_ 4__/* ["default"] */ .Z, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_notice__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, null))3276 render: () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_modal__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_notice__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_global_style_sidebar_notice__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, null)) 3151 3277 }); 3152 3278 }; -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.min.js
r2881681 r2892776 1 (()=>{var e={421:(e,t)=>{"use strict";var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(n){return e}}},881:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,i=7*o,s=365.25*o;function c(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===l&&isFinite(e))return a.long?function(e){var i=Math.abs(e);if(i>=o)return c(e,i,o,"day");if(i>=r)return c(e,i,r,"hour");if(i>=n)return c(e,i,n,"minute");if(i>=t)return c(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=o)return Math.round(e/o)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=n)return Math.round(e/n)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},699:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,s,l;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=a(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var c=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw c.context=s,c}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)r(a,this,t);else{var l=a.length,u=p(a,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return c(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,s;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},495:(e,t,n)=>{"use strict";var r=n(212),o=n(561);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=e>>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},32:(e,t,n)=>{"use strict";var r=n(212),o=n(495),i=n(713),s=n(561),c=r.sum32,a=r.sum32_4,l=r.sum32_5,u=i.ch32,f=i.maj32,d=i.s0_256,h=i.s1_256,p=i.g0_256,g=i.g1_256,m=o.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}r.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=a(g(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],m=this.h[2],y=this.h[3],v=this.h[4],_=this.h[5],w=this.h[6],C=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var b=l(C,h(v),u(v,_,w),this.k[r],n[r]),F=c(d(o),f(o,i,m));C=w,w=_,_=v,v=c(y,b),y=m,m=i,i=o,o=c(b,F)}this.h[0]=c(this.h[0],o),this.h[1]=c(this.h[1],i),this.h[2]=c(this.h[2],m),this.h[3]=c(this.h[3],y),this.h[4]=c(this.h[4],v),this.h[5]=c(this.h[5],_),this.h[6]=c(this.h[6],w),this.h[7]=c(this.h[7],C)},v.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},713:(e,t,n)=>{"use strict";var r=n(212).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function s(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?s(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=s,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},212:(e,t,n)=>{"use strict";var r=n(561),o=n(285);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function c(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=c(e[n].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=s(o)),n+=a(o.toString(16))}return n},t.zero2=c,t.zero8=a,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var s=new Array(i/4),c=0,a=t;c<s.length;c++,a+=4){var l;l="big"===o?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],s[c]=l>>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+o;e[t]=s>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,s,c){var a=0,l=t;return a+=(l=l+r>>>0)<t?1:0,a+=(l=l+i>>>0)<i?1:0,e+n+o+s+(a+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,s,c){return t+r+i+c>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,s,c,a,l){var u=0,f=t;return u+=(f=f+r>>>0)<t?1:0,u+=(f=f+i>>>0)<i?1:0,u+=(f=f+c>>>0)<c?1:0,e+n+o+s+a+(u+=(f=f+l>>>0)<l?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,s,c,a,l){return t+r+i+c+l>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},285:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},612:()=>{},131:()=>{},561:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},93:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(307),o=n(115),i=n(609),s=n(818),c=n(736),a=(n(196),n(731));n(612);const __=c.__,l=()=>{const e=(0,s.useSelect)((e=>e("automattic/wpcom-global-styles").isModalVisible()),[]),{dismissModal:t}=(0,s.useDispatch)("automattic/wpcom-global-styles"),{set:n}=(0,s.useDispatch)("core/preferences");(0,r.useEffect)((()=>{n("core/edit-site","welcomeGuideStyles",!1)}),[n]),(0,r.useEffect)((()=>{e&&(0,o.jN)("calypso_global_styles_gating_modal_show",{context:"site-editor"})}),[e]);const c=()=>{t(),(0,o.jN)("calypso_global_styles_gating_modal_dismiss",{context:"site-editor"})};return e?(0,r.createElement)(i.Modal,{className:"wpcom-global-styles-modal",onRequestClose:c,shouldCloseOnClickOutside:!1},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__text"},(0,r.createElement)("h1",{className:"wpcom-global-styles-modal__heading"},__("A powerful new way to style your site","full-site-editing")),(0,r.createElement)("p",{className:"wpcom-global-styles-modal__description"},__("Change all of your site's fonts, colors and more. Available on the Premium plan.","full-site-editing")),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__actions"},(0,r.createElement)(i.Button,{variant:"secondary",onClick:c},__("Try it out","full-site-editing")),(0,r.createElement)(i.Button,{variant:"primary",href:wpcomGlobalStyles.upgradeUrl,target:"_top",onClick:()=>(0,o.jN)("calypso_global_styles_gating_modal_upgrade_click",{context:"site-editor"})},__("Upgrade plan","full-site-editing")))),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__image"},(0,r.createElement)("img",{src:a,alt:""}))):null}},624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(307),o=n(115),i=n(609),s=n(818),c=n(736);n(131);const __=c.__;function a(){const{globalStylesConfig:e,siteChanges:t}=(0,s.useSelect)((e=>{const{getEditedEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n,__experimentalGetDirtyEntityRecords:r}=e("core"),o=t("root","globalStyles",n?n():null);return{globalStylesConfig:{styles:(null==o?void 0:o.styles)??{},settings:(null==o?void 0:o.settings)??{}},siteChanges:r?r():[]}}),[]),n=Object.keys(e.styles).length||Object.keys(e.settings).length;return(0,r.useEffect)((()=>{var e;t.length||(null===(e=document.querySelector(".entities-saved-states__panel-header button:last-child"))||void 0===e||e.click())}),[t]),(0,r.useEffect)((()=>{n&&(0,o.jN)("calypso_global_styles_gating_notice_show",{context:"site-editor"})}),[n]),n?(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"wpcom-global-styles-notice"},(0,r.createInterpolateElement)(__("Your changes include customized styles that will only be visible once you <a>upgrade to a Premium plan</a>.","full-site-editing"),{a:(0,r.createElement)(i.ExternalLink,{href:wpcomGlobalStyles.upgradeUrl,target:"_blank",onClick:()=>(0,o.jN)("calypso_global_styles_gating_notice_upgrade_click",{context:"site-editor"})})})):null}function l(){const{globalStylesConfig:e,isSaveViewOpened:t}=(0,s.useSelect)((e=>({globalStylesConfig:e("core").getEntityConfig("root","globalStyles"),isSaveViewOpened:e("core/edit-site").isSaveViewOpened()}))),[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!e||!t)return void o(!1);if(n)return;const i=document.querySelectorAll(".entities-saved-states__panel .components-panel__body.is-opened .components-panel__body-title");for(const t of i){if(t.textContent!==e.label)continue;const n=document.createElement("div");t.parentElement.append(n),(0,r.render)((0,r.createElement)(a,null),n),o(!0);break}}),[e,n,t]),null}},915:(e,t,n)=>{var r;"object"==typeof window&&null!==(r=window.wpcomGlobalStyles)&&void 0!==r&&r.assetsUrl&&(n.p=window.wpcomGlobalStyles.assetsUrl)},366:(e,t,n)=>{"use strict";var r=n(818);const o={isModalVisible:!0};(0,r.registerStore)("automattic/wpcom-global-styles",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return"DISMISS_MODAL"===t.type?{...e,isModalVisible:!1}:e},actions:{dismissModal:()=>({type:"DISMISS_MODAL"})},selectors:{isModalVisible:(0,r.createRegistrySelector)((e=>t=>"edit-site/global-styles"===e("core/interface").getActiveComplementaryArea("core/edit-site")&&t.isModalVisible))},persist:!0})},115:(e,t,n)=>{"use strict";n.d(t,{jN:()=>r.jN});n(694),n(209),n(377);var r=n(792);n(722)},377:(e,t,n)=>{"use strict";let r=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){r=null}))},792:(e,t,n)=>{"use strict";n.d(t,{jN:()=>f});var r=n(699),o=n(898),i=(n(421),n(377),n(209),n(358));n(694);const s=["a8c_cookie_banner_ok","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click"];let c,a=Promise.resolve();function l(e){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(e))}"undefined"!=typeof document&&(a=(0,o.ve)("//stats.wp.com/w.js?63"));const u=new r.EventEmitter;function f(e,t){if(t=t||{},(0,i.Z)('Record event "%s" called with props %o',e,t),e.startsWith("calypso_")||s.includes(e)){if(c){const e=c(t);t={...t,...e}}t=Object.fromEntries(Object.entries(t).filter((e=>{let[,t]=e;return void 0!==t}))),(0,i.Z)('Recording event "%s" with actual props %o',e,t),l(["recordEvent",e,t]),u.emit("record-event",e,t)}else(0,i.Z)('- Event name must be prefixed by "calypso_" or added to `EVENT_NAME_EXCEPTIONS`')}},722:(e,t,n)=>{"use strict";n(792)},209:(e,t,n)=>{"use strict";n(4)},358:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(49);const o=n.n(r)()("calypso:analytics")},694:(e,t,n)=>{"use strict";n(358)},4:(e,t,n)=>{"use strict";n(32)},340:(e,t,n)=>{"use strict";n.d(t,{hg:()=>c,lZ:()=>a,_W:()=>u,Yt:()=>f});var r=n(49);const o=n.n(r)()("lib/load-script/callback-handler"),i=new Map;function s(){return i}function c(e){return s().has(e)}function a(e,t){const n=s();c(e)?(o(`Adding a callback for an existing script from "${e}"`),n.get(e).add(t)):(o(`Adding a callback for a new script from "${e}"`),n.set(e,new Set([t])))}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=s(),r=n.get(e);if(r){o(`Executing callbacks for "${e}"`+(null===t?" with success":` with error "${t}"`)),r.forEach((e=>{"function"==typeof e&&e(t)})),n.delete(e)}}function u(){const e=this.getAttribute("src");o(`Handling successful request for "${e}"`),l(e),this.onload=null}function f(){const e=this.getAttribute("src");o(`Handling failed request for "${e}"`),l(e,new Error(`Failed to load script "${e}"`)),this.onerror=null}},606:(e,t,n)=>{"use strict";n.d(t,{C:()=>c,k:()=>a});var r=n(49),o=n.n(r),i=n(340);const s=o()("lib/load-script/dom-operations");function c(e,t){s(`Creating script element for "${e}"`);const n=document.createElement("script");return n.src=e,n.type="text/javascript",n.onload=i._W,n.onerror=i.Yt,n.async=!0,t&&Object.entries(t).forEach((e=>{let[t,r]=e;return n[t]=r})),n}function a(e){s("Attaching element to head"),document.head.appendChild(e)}},898:(e,t,n)=>{"use strict";n.d(t,{ve:()=>c});var r=n(49),o=n.n(r),i=n(340),s=n(606);o()("package/load-script");function c(e,t,n){if(!(0,i.hg)(e)&&(0,s.k)((0,s.C)(e,n)),"function"!=typeof t)return new Promise(((t,n)=>{(0,i.lZ)(e,(e=>{null===e?t():n(e)}))}));(0,i.lZ)(e,t)}},49:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(632)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},632:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function c(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];if(!c.enabled)return;const i=c,s=Number(new Date),a=s-(n||s);i.diff=a,i.prev=n,i.curr=s,n=s,r[0]=t.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");let l=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,((e,n)=>{if("%%"===e)return"%";l++;const o=t.formatters[n];if("function"==typeof o){const t=r[l];e=o.call(i,t),r.splice(l,1),l--}return e})),t.formatArgs.call(i,r);const u=i.log||t.log;u.apply(i,r)}return c.namespace=e,c.useColors=t.useColors(),c.color=t.selectColor(e),c.extend=r,c.destroy=t.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(c),c}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(881),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},731:(e,t,n)=>{"use strict";e.exports=n.p+"images/image-f40c6b2b12b942b650ea.svg"},196:e=>{"use strict";e.exports=window.React},609:e=>{"use strict";e.exports=window.wp.components},818:e=>{"use strict";e.exports=window.wp.data},701:e=>{"use strict";e.exports=window.wp.domReady},307:e=>{"use strict";e.exports=window.wp.element},736:e=>{"use strict";e.exports=window.wp.i18n},817:e=>{"use strict";e.exports=window.wp.plugins}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r);var e=n(307),t=(n(915),n(701)),o=n.n(t),i=n(817),s=n(93),c=n(624);n(366);o()((()=>{(0,i.registerPlugin)("wpcom-global-styles",{render:()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(s.Z,null),(0,e.createElement)(c.Z,null))})}))})(),window.EditingToolkit=r})();1 (()=>{var e={421:(e,t)=>{"use strict";var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(n){return e}}},881:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,i=7*o,s=365.25*o;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=o)return a(e,i,o,"day");if(i>=r)return a(e,i,r,"hour");if(i>=n)return a(e,i,n,"minute");if(i>=t)return a(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=o)return Math.round(e/o)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=n)return Math.round(e/n)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},699:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,s,l;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):h(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,u=h(c,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},495:(e,t,n)=>{"use strict";var r=n(212),o=n(561);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=e>>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},32:(e,t,n)=>{"use strict";var r=n(212),o=n(495),i=n(713),s=n(561),a=r.sum32,c=r.sum32_4,l=r.sum32_5,u=i.ch32,f=i.maj32,d=i.s0_256,p=i.s1_256,h=i.g0_256,g=i.g1_256,m=o.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}r.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=c(g(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],m=this.h[2],y=this.h[3],v=this.h[4],_=this.h[5],w=this.h[6],b=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var C=l(b,p(v),u(v,_,w),this.k[r],n[r]),E=a(d(o),f(o,i,m));b=w,w=_,_=v,v=a(y,C),y=m,m=i,i=o,o=a(C,E)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],_),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],b)},v.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},713:(e,t,n)=>{"use strict";var r=n(212).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function s(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?s(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=s,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},212:(e,t,n)=>{"use strict";var r=n(561),o=n(285);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=a(e[n].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=s(o)),n+=c(o.toString(16))}return n},t.zero2=a,t.zero8=c,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var s=new Array(i/4),a=0,c=t;a<s.length;a++,c+=4){var l;l="big"===o?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=l>>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+o;e[t]=s>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,s,a){var c=0,l=t;return c+=(l=l+r>>>0)<t?1:0,c+=(l=l+i>>>0)<i?1:0,e+n+o+s+(c+=(l=l+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,s,a){return t+r+i+a>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,s,a,c,l){var u=0,f=t;return u+=(f=f+r>>>0)<t?1:0,u+=(f=f+i>>>0)<i?1:0,u+=(f=f+a>>>0)<a?1:0,e+n+o+s+c+(u+=(f=f+l>>>0)<l?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,s,a,c,l){return t+r+i+a+l>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},285:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},612:()=>{},131:()=>{},561:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},312:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(307),o=n(609),i=n(818),s=n(736),a=n(369),c=n(210);const __=s.__;function l(){const e="edit-site/global-styles"===(0,i.useSelect)((e=>e("core/interface").getActiveComplementaryArea("core/edit-site")),[]),t=(0,c.Y)().globalStylesInUse;return(0,r.useEffect)((()=>{t&&e&&(0,a.ap)()}),[t,e]),(0,r.createElement)(o.Fill,{name:"ComplementaryArea/core/edit-site"},(0,r.createElement)(r.Fragment,null,t&&e&&(0,r.createElement)("div",{className:"interface-complementary-area"},(0,r.createElement)(o.Notice,{status:"warning",isDismissible:!1,className:"wpcom-global-styles-notice"},(0,r.createInterpolateElement)(__("Your changes include customized styles that will only be visible once you <a>upgrade to a Premium plan</a>.","full-site-editing"),{a:(0,r.createElement)(o.ExternalLink,{href:wpcomGlobalStyles.upgradeUrl,target:"_blank",onClick:a.vv})})))))}},93:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(307),o=n(115),i=n(609),s=n(818),a=n(736),c=(n(196),n(731));n(612);const __=a.__,l=()=>{const e=(0,s.useSelect)((e=>e("automattic/wpcom-global-styles").isModalVisible()),[]),{dismissModal:t}=(0,s.useDispatch)("automattic/wpcom-global-styles"),{set:n}=(0,s.useDispatch)("core/preferences");(0,r.useEffect)((()=>{n("core/edit-site","welcomeGuideStyles",!1)}),[n]),(0,r.useEffect)((()=>{e&&(0,o.jN)("calypso_global_styles_gating_modal_show",{context:"site-editor"})}),[e]);const a=()=>{t(),(0,o.jN)("calypso_global_styles_gating_modal_dismiss",{context:"site-editor"})};return e?(0,r.createElement)(i.Modal,{className:"wpcom-global-styles-modal",onRequestClose:a,shouldCloseOnClickOutside:!1},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__text"},(0,r.createElement)("h1",{className:"wpcom-global-styles-modal__heading"},__("A powerful new way to style your site","full-site-editing")),(0,r.createElement)("p",{className:"wpcom-global-styles-modal__description"},__("Change all of your site's fonts, colors and more. Available on the Premium plan.","full-site-editing")),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__actions"},(0,r.createElement)(i.Button,{variant:"secondary",onClick:a},__("Try it out","full-site-editing")),(0,r.createElement)(i.Button,{variant:"primary",href:wpcomGlobalStyles.upgradeUrl,target:"_top",onClick:()=>(0,o.jN)("calypso_global_styles_gating_modal_upgrade_click",{context:"site-editor"})},__("Upgrade plan","full-site-editing")))),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__image"},(0,r.createElement)("img",{src:c,alt:""}))):null}},624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(307),o=n(609),i=n(818),s=n(736),a=(n(131),n(369)),c=n(210);const __=s.__;function l(){const{siteChanges:e,globalStylesInUse:t}=(0,c.Y)();return(0,r.useEffect)((()=>{var t;e.length||(null===(t=document.querySelector(".entities-saved-states__panel-header button:last-child"))||void 0===t||t.click())}),[e]),(0,r.useEffect)((()=>{t&&(0,a.Tf)()}),[t]),t?(0,r.createElement)(o.Notice,{status:"warning",isDismissible:!1,className:"wpcom-global-styles-notice notice-margin"},(0,r.createInterpolateElement)(__("Your changes include customized styles that will only be visible once you <a>upgrade to a Premium plan</a>.","full-site-editing"),{a:(0,r.createElement)(o.ExternalLink,{href:wpcomGlobalStyles.upgradeUrl,target:"_blank",onClick:a.LS})})):null}function u(){const{globalStylesConfig:e,isSaveViewOpened:t}=(0,i.useSelect)((e=>({globalStylesConfig:e("core").getEntityConfig("root","globalStyles"),isSaveViewOpened:e("core/edit-site").isSaveViewOpened()}))),[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!e||!t)return void o(!1);if(n)return;const i=document.querySelectorAll(".entities-saved-states__panel .components-panel__body.is-opened .components-panel__body-title");for(const t of i){if(t.textContent!==e.label)continue;const n=document.createElement("div");t.parentElement.append(n),(0,r.render)((0,r.createElement)(l,null),n),o(!0);break}}),[e,n,t]),null}},915:(e,t,n)=>{var r;"object"==typeof window&&null!==(r=window.wpcomGlobalStyles)&&void 0!==r&&r.assetsUrl&&(n.p=window.wpcomGlobalStyles.assetsUrl)},366:(e,t,n)=>{"use strict";var r=n(818);const o={isModalVisible:!0};(0,r.registerStore)("automattic/wpcom-global-styles",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return"DISMISS_MODAL"===t.type?{...e,isModalVisible:!1}:e},actions:{dismissModal:()=>({type:"DISMISS_MODAL"})},selectors:{isModalVisible:(0,r.createRegistrySelector)((e=>t=>"edit-site/global-styles"===e("core/interface").getActiveComplementaryArea("core/edit-site")&&t.isModalVisible))},persist:!0})},369:(e,t,n)=>{"use strict";n.d(t,{LS:()=>o,vv:()=>i,Tf:()=>s,ap:()=>a});var r=n(115);function o(){(0,r.jN)("calypso_global_styles_gating_notice_upgrade_click",{context:"site-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})}function i(){(0,r.jN)("calypso_global_styles_gating_notice_sidebar_upgrade_click",{context:"site-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})}function s(){(0,r.jN)("calypso_global_styles_gating_notice_show",{context:"site-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})}function a(){(0,r.jN)("calypso_global_styles_gating_sidebar_notice_show",{context:"site-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})}},210:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(818);function o(){return(0,r.useSelect)((e=>{const{getEditedEntityRecord:t,__experimentalGetCurrentGlobalStylesId:n,__experimentalGetDirtyEntityRecords:r}=e("core"),o=t("root","globalStyles",n?n():null),i={styles:(null==o?void 0:o.styles)??{},settings:(null==o?void 0:o.settings)??{}};return{globalStylesInUse:!(!Object.keys(i.styles).length&&!Object.keys(i.settings).length),siteChanges:r?r():[]}}),[])}},115:(e,t,n)=>{"use strict";n.d(t,{jN:()=>r.jN});n(694),n(209),n(377);var r=n(792);n(722)},377:(e,t,n)=>{"use strict";let r=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){r=null}))},792:(e,t,n)=>{"use strict";n.d(t,{jN:()=>f});var r=n(699),o=n(898),i=(n(421),n(377),n(209),n(358));n(694);const s=["a8c_cookie_banner_ok","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click"];let a,c=Promise.resolve();function l(e){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(e))}"undefined"!=typeof document&&(c=(0,o.ve)("//stats.wp.com/w.js?63"));const u=new r.EventEmitter;function f(e,t){if(t=t||{},(0,i.Z)('Record event "%s" called with props %o',e,t),e.startsWith("calypso_")||s.includes(e)){if(a){const e=a(t);t={...t,...e}}t=Object.fromEntries(Object.entries(t).filter((e=>{let[,t]=e;return void 0!==t}))),(0,i.Z)('Recording event "%s" with actual props %o',e,t),l(["recordEvent",e,t]),u.emit("record-event",e,t)}else(0,i.Z)('- Event name must be prefixed by "calypso_" or added to `EVENT_NAME_EXCEPTIONS`')}},722:(e,t,n)=>{"use strict";n(792)},209:(e,t,n)=>{"use strict";n(4)},358:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(49);const o=n.n(r)()("calypso:analytics")},694:(e,t,n)=>{"use strict";n(358)},4:(e,t,n)=>{"use strict";n(32)},340:(e,t,n)=>{"use strict";n.d(t,{hg:()=>a,lZ:()=>c,_W:()=>u,Yt:()=>f});var r=n(49);const o=n.n(r)()("lib/load-script/callback-handler"),i=new Map;function s(){return i}function a(e){return s().has(e)}function c(e,t){const n=s();a(e)?(o(`Adding a callback for an existing script from "${e}"`),n.get(e).add(t)):(o(`Adding a callback for a new script from "${e}"`),n.set(e,new Set([t])))}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=s(),r=n.get(e);if(r){o(`Executing callbacks for "${e}"`+(null===t?" with success":` with error "${t}"`)),r.forEach((e=>{"function"==typeof e&&e(t)})),n.delete(e)}}function u(){const e=this.getAttribute("src");o(`Handling successful request for "${e}"`),l(e),this.onload=null}function f(){const e=this.getAttribute("src");o(`Handling failed request for "${e}"`),l(e,new Error(`Failed to load script "${e}"`)),this.onerror=null}},606:(e,t,n)=>{"use strict";n.d(t,{C:()=>a,k:()=>c});var r=n(49),o=n.n(r),i=n(340);const s=o()("lib/load-script/dom-operations");function a(e,t){s(`Creating script element for "${e}"`);const n=document.createElement("script");return n.src=e,n.type="text/javascript",n.onload=i._W,n.onerror=i.Yt,n.async=!0,t&&Object.entries(t).forEach((e=>{let[t,r]=e;return n[t]=r})),n}function c(e){s("Attaching element to head"),document.head.appendChild(e)}},898:(e,t,n)=>{"use strict";n.d(t,{ve:()=>a});var r=n(49),o=n.n(r),i=n(340),s=n(606);o()("package/load-script");function a(e,t,n){if(!(0,i.hg)(e)&&(0,s.k)((0,s.C)(e,n)),"function"!=typeof t)return new Promise(((t,n)=>{(0,i.lZ)(e,(e=>{null===e?t():n(e)}))}));(0,i.lZ)(e,t)}},49:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(632)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},632:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];if(!a.enabled)return;const i=a,s=Number(new Date),c=s-(n||s);i.diff=c,i.prev=n,i.curr=s,n=s,r[0]=t.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");let l=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,((e,n)=>{if("%%"===e)return"%";l++;const o=t.formatters[n];if("function"==typeof o){const t=r[l];e=o.call(i,t),r.splice(l,1),l--}return e})),t.formatArgs.call(i,r);const u=i.log||t.log;u.apply(i,r)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(881),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},731:(e,t,n)=>{"use strict";e.exports=n.p+"images/image-f40c6b2b12b942b650ea.svg"},196:e=>{"use strict";e.exports=window.React},609:e=>{"use strict";e.exports=window.wp.components},818:e=>{"use strict";e.exports=window.wp.data},701:e=>{"use strict";e.exports=window.wp.domReady},307:e=>{"use strict";e.exports=window.wp.element},736:e=>{"use strict";e.exports=window.wp.i18n},817:e=>{"use strict";e.exports=window.wp.plugins}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r);var e=n(307),t=(n(915),n(701)),o=n.n(t),i=n(817),s=n(312),a=n(93),c=n(624);n(366);o()((()=>{(0,i.registerPlugin)("wpcom-global-styles",{render:()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Z,null),(0,e.createElement)(c.Z,null),(0,e.createElement)(s.Z,null))})}))})(),window.EditingToolkit=r})(); 2 2 //# sourceMappingURL=wpcom-global-styles.min.js.map -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.rtl.css
r2803410 r2892776 1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,Times New Roman,Times,serif;font-weight:400}[lang*=af] .wp-brand-font,[lang*=ca] .wp-brand-font,[lang*=cs] .wp-brand-font,[lang*=da] .wp-brand-font,[lang*=de] .wp-brand-font,[lang*=en] .wp-brand-font,[lang*=es] .wp-brand-font,[lang*=eu] .wp-brand-font,[lang*=fi] .wp-brand-font,[lang*=fr] .wp-brand-font,[lang*=gl] .wp-brand-font,[lang*=hr] .wp-brand-font,[lang*=hu] .wp-brand-font,[lang*=id] .wp-brand-font,[lang*=is] .wp-brand-font,[lang*=it] .wp-brand-font,[lang*=lv] .wp-brand-font,[lang*=mt] .wp-brand-font,[lang*=nb] .wp-brand-font,[lang*=nl] .wp-brand-font,[lang*=pl] .wp-brand-font,[lang*=pt] .wp-brand-font,[lang*=ro] .wp-brand-font,[lang*=ru] .wp-brand-font,[lang*=sk] .wp-brand-font,[lang*=sl] .wp-brand-font,[lang*=sq] .wp-brand-font,[lang*=sr] .wp-brand-font,[lang*=sv] .wp-brand-font,[lang*=sw] .wp-brand-font,[lang*=tr] .wp-brand-font,[lang*=uz] .wp-brand-font{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif}.wpcom-global-styles-modal .components-modal__content{display:flex;flex-direction:column-reverse;justify-content:flex-end;margin-top:0;padding:0}@media(min-width:600px){.wpcom-global-styles-modal .components-modal__content{flex-direction:row;justify-content:flex-start}}.wpcom-global-styles-modal .components-modal__header{height:auto;position:absolute}.wpcom-global-styles-modal .components-modal__header .components-button{top:16px}.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{width:100%}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{max-width:380px;width:auto}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{display:flex;flex-direction:column;padding:64px 48px}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif;font-size:2rem;font-weight:400;line-height:40px;margin-bottom:16px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-bottom:32px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;gap:16px;justify-content:center;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;display:flex;justify-content:flex-end;padding:64px 64px 64px 0}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%}.wpcom-global-styles-notice{margin: 16px 0 0}.wpcom-global-styles-notice .components-notice__content{margin-left:0}.wpcom-global-styles-notice a{display:inline}.wpcom-global-styles-notice .components-button.is-link{color:var(--color-link)}.wpcom-global-styles-notice .components-button.is-link:hover{color:var(--color-link-light)}1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,Times New Roman,Times,serif;font-weight:400}[lang*=af] .wp-brand-font,[lang*=ca] .wp-brand-font,[lang*=cs] .wp-brand-font,[lang*=da] .wp-brand-font,[lang*=de] .wp-brand-font,[lang*=en] .wp-brand-font,[lang*=es] .wp-brand-font,[lang*=eu] .wp-brand-font,[lang*=fi] .wp-brand-font,[lang*=fr] .wp-brand-font,[lang*=gl] .wp-brand-font,[lang*=hr] .wp-brand-font,[lang*=hu] .wp-brand-font,[lang*=id] .wp-brand-font,[lang*=is] .wp-brand-font,[lang*=it] .wp-brand-font,[lang*=lv] .wp-brand-font,[lang*=mt] .wp-brand-font,[lang*=nb] .wp-brand-font,[lang*=nl] .wp-brand-font,[lang*=pl] .wp-brand-font,[lang*=pt] .wp-brand-font,[lang*=ro] .wp-brand-font,[lang*=ru] .wp-brand-font,[lang*=sk] .wp-brand-font,[lang*=sl] .wp-brand-font,[lang*=sq] .wp-brand-font,[lang*=sr] .wp-brand-font,[lang*=sv] .wp-brand-font,[lang*=sw] .wp-brand-font,[lang*=tr] .wp-brand-font,[lang*=uz] .wp-brand-font{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif}.wpcom-global-styles-modal .components-modal__content{display:flex;flex-direction:column-reverse;justify-content:flex-end;margin-top:0;padding:0}@media(min-width:600px){.wpcom-global-styles-modal .components-modal__content{flex-direction:row;justify-content:flex-start}}.wpcom-global-styles-modal .components-modal__header{height:auto;position:absolute}.wpcom-global-styles-modal .components-modal__header .components-button{top:16px}.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{width:100%}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{max-width:380px;width:auto}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{display:flex;flex-direction:column;padding:64px 48px}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif;font-size:2rem;font-weight:400;line-height:40px;margin-bottom:16px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-bottom:32px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;gap:16px;justify-content:center;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;display:flex;justify-content:flex-end;padding:64px 64px 64px 0}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%}.wpcom-global-styles-notice{margin:0}.wpcom-global-styles-notice .notice-margin{margin:16px 0 0}.wpcom-global-styles-notice .components-notice__content{margin-left:0}.wpcom-global-styles-notice a{display:inline}.wpcom-global-styles-notice .components-button.is-link{color:var(--color-link)}.wpcom-global-styles-notice .components-button.is-link:hover{color:var(--color-link-light)} -
full-site-editing/trunk/wpcom-global-styles/index.js
r2827102 r2892776 4 4 import domReady from '@wordpress/dom-ready'; 5 5 import { registerPlugin } from '@wordpress/plugins'; 6 import GlobalStylesSidebarNotice from './global-style-sidebar-notice'; 6 7 import GlobalStylesModal from './modal'; 7 8 import GlobalStylesNotice from './notice'; … … 14 15 <GlobalStylesModal /> 15 16 <GlobalStylesNotice /> 17 <GlobalStylesSidebarNotice /> 16 18 </> 17 19 ), -
full-site-editing/trunk/wpcom-global-styles/index.php
r2890140 r2892776 62 62 63 63 /** 64 * Get the WPCOM blog id of the current site for tracking purposes. 65 */ 66 function wpcom_global_styles_get_wpcom_current_blog_id() { 67 if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { 68 return get_current_blog_id(); 69 } elseif ( defined( 'IS_ATOMIC' ) && IS_ATOMIC ) { 70 /* 71 * Atomic sites have the WP.com blog ID stored as a Jetpack option. This code deliberately 72 * doesn't use `Jetpack_Options::get_option` so it works even when Jetpack has not been loaded. 73 */ 74 $jetpack_options = get_option( 'jetpack_options' ); 75 if ( is_array( $jetpack_options ) && isset( $jetpack_options['id'] ) ) { 76 return (int) $jetpack_options['id']; 77 } 78 } 79 80 return null; 81 } 82 83 /** 64 84 * Wrapper to test a blog sticker on both Simple and Atomic sites at once. 65 85 * … … 132 152 'wpcomGlobalStyles', 133 153 array( 134 'assetsUrl' => plugins_url( 'dist/', __FILE__ ), 135 'upgradeUrl' => "$calypso_domain/plans/$site_slug?plan=value_bundle&feature=advanced-design-customization", 154 'assetsUrl' => plugins_url( 'dist/', __FILE__ ), 155 'upgradeUrl' => "$calypso_domain/plans/$site_slug?plan=value_bundle&feature=advanced-design-customization", 156 'wpcomBlogId' => wpcom_global_styles_get_wpcom_current_blog_id(), 136 157 ) 137 158 ); -
full-site-editing/trunk/wpcom-global-styles/notice.js
r2830170 r2892776 1 1 /* global wpcomGlobalStyles */ 2 import { recordTracksEvent } from '@automattic/calypso-analytics';3 2 import { ExternalLink, Notice } from '@wordpress/components'; 4 3 import { useSelect } from '@wordpress/data'; 5 4 import { createInterpolateElement, render, useEffect, useState } from '@wordpress/element'; 6 5 import { __ } from '@wordpress/i18n'; 7 8 6 import './notice.scss'; 7 import { recordUpgradePreSaveNoticeClick, recordUpgradeNoticePreSaveShow } from './tracks-events'; 8 import { useGlobalStylesConfig } from './use-global-styles-config'; 9 9 10 10 function GlobalStylesNoticeComponent() { 11 const { globalStylesConfig, siteChanges } = useSelect( ( select ) => { 12 const { 13 getEditedEntityRecord, 14 __experimentalGetCurrentGlobalStylesId, 15 __experimentalGetDirtyEntityRecords, 16 } = select( 'core' ); 17 18 const _globalStylesId = __experimentalGetCurrentGlobalStylesId 19 ? __experimentalGetCurrentGlobalStylesId() 20 : null; 21 const globalStylesRecord = getEditedEntityRecord( 'root', 'globalStyles', _globalStylesId ); 22 23 return { 24 globalStylesConfig: { 25 styles: globalStylesRecord?.styles ?? {}, 26 settings: globalStylesRecord?.settings ?? {}, 27 }, 28 siteChanges: __experimentalGetDirtyEntityRecords ? __experimentalGetDirtyEntityRecords() : [], 29 }; 30 }, [] ); 31 32 // Do not show the notice if the use is trying to save the default styles. 33 const isVisible = 34 Object.keys( globalStylesConfig.styles ).length || 35 Object.keys( globalStylesConfig.settings ).length; 11 const { siteChanges, globalStylesInUse } = useGlobalStylesConfig(); 36 12 37 13 // Closes the sidebar if there are no more changes to be saved. … … 51 27 52 28 useEffect( () => { 53 if ( isVisible ) { 54 recordTracksEvent( 'calypso_global_styles_gating_notice_show', { 55 context: 'site-editor', 56 } ); 29 if ( globalStylesInUse ) { 30 recordUpgradeNoticePreSaveShow(); 57 31 } 58 }, [ isVisible ] );32 }, [ globalStylesInUse ] ); 59 33 60 if ( ! isVisible ) {34 if ( ! globalStylesInUse ) { 61 35 return null; 62 36 } 63 37 64 38 return ( 65 <Notice status="warning" isDismissible={ false } className="wpcom-global-styles-notice"> 39 <Notice 40 status="warning" 41 isDismissible={ false } 42 className="wpcom-global-styles-notice notice-margin" 43 > 66 44 { createInterpolateElement( 67 45 __( … … 74 52 href={ wpcomGlobalStyles.upgradeUrl } 75 53 target="_blank" 76 onClick={ () => 77 recordTracksEvent( 'calypso_global_styles_gating_notice_upgrade_click', { 78 context: 'site-editor', 79 } ) 80 } 54 onClick={ recordUpgradePreSaveNoticeClick } 81 55 /> 82 56 ), -
full-site-editing/trunk/wpcom-global-styles/notice.scss
r2803410 r2892776 1 1 .wpcom-global-styles-notice { 2 margin: 16px 0 0; 2 margin: 0 0 0 0; 3 4 .notice-margin { 5 margin: 16px 0 0; 6 } 3 7 4 8 .components-notice__content { -
full-site-editing/trunk/wpcom-global-styles/test/class-wpcom-global-styles-test.php
r2837305 r2892776 18 18 */ 19 19 public function test_wpcom_block_global_styles_frontend() { 20 switch_theme( 'twentytwentythree' ); 21 $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( wp_get_theme(), true ); 22 $decoded_data = json_decode( $user_cpt['post_content'], true ); 23 unset( $decoded_data['isGlobalStylesUserThemeJSON'] ); 24 $config = $decoded_data; 20 $theme_json_resolver = new WP_Theme_JSON_Resolver(); 21 $user_data = $theme_json_resolver->get_user_data()->get_data(); 22 $user_data['styles']['color']['background'] = 'hotpink'; 25 23 26 $config['styles']['color']['background'] = 'hotpink'; 27 28 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 29 24 // Check that the custom color is kept when Global Styles are available. 25 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $user_data, 'custom' ) ); 30 26 $this->assertEquals( 'hotpink', $theme_json->get_data()['styles']['color']['background'] ); 31 27 28 // Check that the custom color is blocked when Global Styles are limited. 32 29 add_filter( 'wpcom_force_limit_global_styles', '__return_true' ); 33 34 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 35 30 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $user_data, 'custom' ) ); 36 31 $this->assertEmpty( $theme_json->get_data()['styles']['color']['background'] ); 37 38 32 remove_filter( 'wpcom_force_limit_global_styles', '__return_true' ); 39 33 }
Note: See TracChangeset
for help on using the changeset viewer.