@wordpress/edit-site 3.0.8 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/add-new-template/index.js +49 -0
- package/build/components/add-new-template/index.js.map +1 -0
- package/build/components/add-new-template/new-template-part.js +95 -0
- package/build/components/add-new-template/new-template-part.js.map +1 -0
- package/build/components/add-new-template/new-template.js +133 -0
- package/build/components/add-new-template/new-template.js.map +1 -0
- package/build/components/block-editor/index.js +3 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +115 -0
- package/build/components/create-template-part-modal/index.js.map +1 -0
- package/build/components/editor/index.js +20 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +29 -6
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +9 -47
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +56 -0
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -0
- package/build/components/global-styles/hooks.js +29 -27
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -5
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +2 -1
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +9 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +23 -3
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +2 -1
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +2 -1
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +54 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +74 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +28 -8
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +12 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/index.js +1 -5
- package/build/components/header/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +26 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js +104 -0
- package/build/components/list/actions/index.js.map +1 -0
- package/build/components/list/actions/rename-menu-item.js +112 -0
- package/build/components/list/actions/rename-menu-item.js.map +1 -0
- package/build/components/list/added-by.js +180 -0
- package/build/components/list/added-by.js.map +1 -0
- package/build/components/list/header.js +50 -0
- package/build/components/list/header.js.map +1 -0
- package/build/components/list/index.js +102 -0
- package/build/components/list/index.js.map +1 -0
- package/build/components/list/table.js +114 -0
- package/build/components/list/table.js.map +1 -0
- package/build/components/list/use-register-shortcuts.js +52 -0
- package/build/components/list/use-register-shortcuts.js.map +1 -0
- package/build/components/navigation-sidebar/index.js +26 -10
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +42 -44
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +5 -17
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/template-details/index.js +3 -2
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +20 -84
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/welcome-guide/editor.js +58 -0
- package/build/components/welcome-guide/editor.js.map +1 -0
- package/build/components/welcome-guide/image.js +27 -0
- package/build/components/welcome-guide/image.js.map +1 -0
- package/build/components/welcome-guide/index.js +49 -0
- package/build/components/welcome-guide/index.js.map +1 -0
- package/build/components/welcome-guide/styles.js +83 -0
- package/build/components/welcome-guide/styles.js.map +1 -0
- package/build/index.js +36 -6
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +4 -2
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item.js +39 -0
- package/build/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build/store/actions.js +50 -24
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +4 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/selectors.js +25 -5
- package/build/store/selectors.js.map +1 -1
- package/build/utils/is-template-removable.js +21 -0
- package/build/utils/is-template-removable.js.map +1 -0
- package/build-module/components/add-new-template/index.js +36 -0
- package/build-module/components/add-new-template/index.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +79 -0
- package/build-module/components/add-new-template/new-template-part.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +114 -0
- package/build-module/components/add-new-template/new-template.js.map +1 -0
- package/build-module/components/block-editor/index.js +2 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +102 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -0
- package/build-module/components/editor/index.js +19 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +29 -7
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +10 -43
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +46 -0
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +30 -28
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +12 -5
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +2 -1
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +7 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +22 -3
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +2 -1
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +2 -1
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +41 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +70 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +28 -8
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +11 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/index.js +1 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +26 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +85 -0
- package/build-module/components/list/actions/index.js.map +1 -0
- package/build-module/components/list/actions/rename-menu-item.js +101 -0
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -0
- package/build-module/components/list/added-by.js +166 -0
- package/build-module/components/list/added-by.js.map +1 -0
- package/build-module/components/list/header.js +37 -0
- package/build-module/components/list/header.js.map +1 -0
- package/build-module/components/list/index.js +81 -0
- package/build-module/components/list/index.js.map +1 -0
- package/build-module/components/list/table.js +98 -0
- package/build-module/components/list/table.js.map +1 -0
- package/build-module/components/list/use-register-shortcuts.js +41 -0
- package/build-module/components/list/use-register-shortcuts.js.map +1 -0
- package/build-module/components/navigation-sidebar/index.js +26 -10
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +41 -44
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +6 -18
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/template-details/index.js +3 -2
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +20 -84
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +45 -0
- package/build-module/components/welcome-guide/editor.js.map +1 -0
- package/build-module/components/welcome-guide/image.js +19 -0
- package/build-module/components/welcome-guide/image.js.map +1 -0
- package/build-module/components/welcome-guide/index.js +35 -0
- package/build-module/components/welcome-guide/index.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +69 -0
- package/build-module/components/welcome-guide/styles.js.map +1 -0
- package/build-module/index.js +28 -3
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +3 -2
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item.js +27 -0
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build-module/store/actions.js +51 -25
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +4 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/selectors.js +21 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/is-template-removable.js +14 -0
- package/build-module/utils/is-template-removable.js.map +1 -0
- package/build-style/style-rtl.css +468 -33
- package/build-style/style.css +468 -33
- package/package.json +10 -8
- package/src/components/add-new-template/index.js +30 -0
- package/src/components/add-new-template/new-template-part.js +81 -0
- package/src/components/add-new-template/new-template.js +136 -0
- package/src/components/add-new-template/style.scss +11 -0
- package/src/components/block-editor/index.js +2 -0
- package/src/components/create-template-part-modal/index.js +132 -0
- package/src/components/{template-part-converter → create-template-part-modal}/style.scss +9 -9
- package/src/components/editor/index.js +22 -15
- package/src/components/editor/style.scss +8 -0
- package/src/components/global-styles/color-palette-panel.js +64 -7
- package/src/components/global-styles/global-styles-provider.js +7 -36
- package/src/components/global-styles/gradients-palette-panel.js +79 -0
- package/src/components/global-styles/hooks.js +59 -27
- package/src/components/global-styles/palette.js +30 -10
- package/src/components/global-styles/screen-background-color.js +1 -0
- package/src/components/global-styles/screen-block-list.js +11 -1
- package/src/components/global-styles/screen-color-palette.js +30 -3
- package/src/components/global-styles/screen-link-color.js +1 -0
- package/src/components/global-styles/screen-text-color.js +1 -0
- package/src/components/global-styles/screen-typography-element.js +39 -0
- package/src/components/global-styles/screen-typography.js +84 -3
- package/src/components/global-styles/style.scss +33 -0
- package/src/components/global-styles/test/use-global-styles-output.js +3 -3
- package/src/components/global-styles/test/utils.js +1 -1
- package/src/components/global-styles/typography-panel.js +37 -7
- package/src/components/global-styles/ui.js +9 -0
- package/src/components/global-styles/use-global-styles-output.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/header/index.js +0 -6
- package/src/components/keyboard-shortcuts/index.js +32 -0
- package/src/components/list/actions/index.js +95 -0
- package/src/components/list/actions/rename-menu-item.js +134 -0
- package/src/components/list/added-by.js +179 -0
- package/src/components/list/header.js +34 -0
- package/src/components/list/index.js +96 -0
- package/src/components/list/style.scss +208 -0
- package/src/components/list/table.js +121 -0
- package/src/components/list/use-register-shortcuts.js +45 -0
- package/src/components/navigation-sidebar/index.js +24 -8
- package/src/components/navigation-sidebar/navigation-panel/index.js +57 -51
- package/src/components/navigation-sidebar/navigation-panel/style.scss +4 -2
- package/src/components/navigation-sidebar/navigation-toggle/index.js +24 -36
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +2 -0
- package/src/components/sidebar/style.scss +2 -1
- package/src/components/template-details/index.js +3 -2
- package/src/components/template-part-converter/convert-to-template-part.js +20 -140
- package/src/components/welcome-guide/editor.js +63 -0
- package/src/components/welcome-guide/image.js +11 -0
- package/src/components/welcome-guide/index.js +33 -0
- package/src/components/welcome-guide/style.scss +37 -0
- package/src/components/welcome-guide/styles.js +116 -0
- package/src/index.js +31 -3
- package/src/plugins/index.js +3 -1
- package/src/plugins/welcome-guide-menu-item.js +35 -0
- package/src/store/actions.js +85 -35
- package/src/store/defaults.js +4 -1
- package/src/store/selectors.js +22 -4
- package/src/store/test/actions.js +0 -30
- package/src/store/test/selectors.js +24 -0
- package/src/style.scss +9 -6
- package/src/utils/is-template-removable.js +13 -0
- package/build/components/header/navigation-link/index.js +0 -87
- package/build/components/header/navigation-link/index.js.map +0 -1
- package/build-module/components/header/navigation-link/index.js +0 -74
- package/build-module/components/header/navigation-link/index.js.map +0 -1
- package/src/components/header/navigation-link/index.js +0 -71
- package/src/components/header/navigation-link/style.scss +0 -69
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
|
-
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
|
|
16
|
-
var _icons = require("@wordpress/icons");
|
|
17
|
-
|
|
18
|
-
var _coreData = require("@wordpress/core-data");
|
|
19
|
-
|
|
20
|
-
var _compose = require("@wordpress/compose");
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* WordPress dependencies
|
|
24
|
-
*/
|
|
25
|
-
function NavigationLink(_ref) {
|
|
26
|
-
let {
|
|
27
|
-
icon
|
|
28
|
-
} = _ref;
|
|
29
|
-
const {
|
|
30
|
-
isRequestingSiteIcon,
|
|
31
|
-
siteIconUrl
|
|
32
|
-
} = (0, _data.useSelect)(select => {
|
|
33
|
-
const {
|
|
34
|
-
getEntityRecord,
|
|
35
|
-
isResolving
|
|
36
|
-
} = select(_coreData.store);
|
|
37
|
-
const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
|
|
38
|
-
return {
|
|
39
|
-
isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
|
|
40
|
-
siteIconUrl: siteData.site_icon_url
|
|
41
|
-
};
|
|
42
|
-
}, []);
|
|
43
|
-
const disableMotion = (0, _compose.useReducedMotion)();
|
|
44
|
-
let buttonIcon = (0, _element.createElement)(_components.Icon, {
|
|
45
|
-
size: "36px",
|
|
46
|
-
icon: _icons.wordpress
|
|
47
|
-
});
|
|
48
|
-
const effect = {
|
|
49
|
-
expand: {
|
|
50
|
-
scale: 1.7,
|
|
51
|
-
borderRadius: 0,
|
|
52
|
-
transition: {
|
|
53
|
-
type: 'tween',
|
|
54
|
-
duration: '0.2'
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
if (siteIconUrl) {
|
|
60
|
-
buttonIcon = (0, _element.createElement)(_components.__unstableMotion.img, {
|
|
61
|
-
variants: !disableMotion && effect,
|
|
62
|
-
alt: (0, _i18n.__)('Site Icon'),
|
|
63
|
-
className: "edit-site-navigation-link__site-icon",
|
|
64
|
-
src: siteIconUrl
|
|
65
|
-
});
|
|
66
|
-
} else if (isRequestingSiteIcon) {
|
|
67
|
-
buttonIcon = null;
|
|
68
|
-
} else if (icon) {
|
|
69
|
-
buttonIcon = (0, _element.createElement)(_components.Icon, {
|
|
70
|
-
size: "36px",
|
|
71
|
-
icon: icon
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
76
|
-
className: "edit-site-navigation-link",
|
|
77
|
-
whileHover: "expand"
|
|
78
|
-
}, (0, _element.createElement)(_components.Button, {
|
|
79
|
-
className: "edit-site-navigation-link__button has-icon",
|
|
80
|
-
label: (0, _i18n.__)('Dashboard'),
|
|
81
|
-
href: "index.php"
|
|
82
|
-
}, buttonIcon));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
var _default = NavigationLink;
|
|
86
|
-
exports.default = _default;
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/navigation-link/index.js"],"names":["NavigationLink","icon","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","coreDataStore","siteData","undefined","site_icon_url","disableMotion","buttonIcon","wordpress","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,cAAT,OAAoC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACnC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAwC,qBAAaC,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEG,eAAF,CAA/C;AACA,UAAMC,QAAQ,GACbH,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BI,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNP,MAAAA,oBAAoB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CAC7D,MAD6D,EAE7D,gBAF6D,EAG7DG,SAH6D,CAA7B,CAD3B;AAMNN,MAAAA,WAAW,EAAEK,QAAQ,CAACE;AANhB,KAAP;AAQA,GAb6C,EAa3C,EAb2C,CAA9C;AAeA,QAAMC,aAAa,GAAG,gCAAtB;AAEA,MAAIC,UAAU,GAAG,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,IAAI,EAAGC;AAAzB,IAAjB;AAEA,QAAMC,MAAM,GAAG;AACdC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,GADA;AAEPC,MAAAA,YAAY,EAAE,CAFP;AAGPC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,IAAI,EAAE,OAAR;AAAiBC,QAAAA,QAAQ,EAAE;AAA3B;AAHL;AADM,GAAf;;AAQA,MAAKjB,WAAL,EAAmB;AAClBS,IAAAA,UAAU,GACT,4BAAC,4BAAD,CAAQ,GAAR;AACC,MAAA,QAAQ,EAAG,CAAED,aAAF,IAAmBG,MAD/B;AAEC,MAAA,GAAG,EAAG,cAAI,WAAJ,CAFP;AAGC,MAAA,SAAS,EAAC,sCAHX;AAIC,MAAA,GAAG,EAAGX;AAJP,MADD;AAQA,GATD,MASO,IAAKD,oBAAL,EAA4B;AAClCU,IAAAA,UAAU,GAAG,IAAb;AACA,GAFM,MAEA,IAAKX,IAAL,EAAY;AAClBW,IAAAA,UAAU,GAAG,4BAAC,gBAAD;AAAM,MAAA,IAAI,EAAC,MAAX;AAAkB,MAAA,IAAI,EAAGX;AAAzB,MAAb;AACA;;AAED,SACC,4BAAC,4BAAD,CAAQ,GAAR;AAAY,IAAA,SAAS,EAAC,2BAAtB;AAAkD,IAAA,UAAU,EAAC;AAA7D,KACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,cAAI,WAAJ,CAFT;AAGC,IAAA,IAAI,EAAC;AAHN,KAKGW,UALH,CADD,CADD;AAWA;;eAEcZ,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction NavigationLink( { icon } ) {\n\tconst { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tconst disableMotion = useReducedMotion();\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-link__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div className=\"edit-site-navigation-link\" whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-link__button has-icon\"\n\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\thref=\"index.php\"\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationLink;\n"]}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import { Button, Icon, __unstableMotion as motion } from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { wordpress } from '@wordpress/icons';
|
|
10
|
-
import { store as coreDataStore } from '@wordpress/core-data';
|
|
11
|
-
import { useReducedMotion } from '@wordpress/compose';
|
|
12
|
-
|
|
13
|
-
function NavigationLink(_ref) {
|
|
14
|
-
let {
|
|
15
|
-
icon
|
|
16
|
-
} = _ref;
|
|
17
|
-
const {
|
|
18
|
-
isRequestingSiteIcon,
|
|
19
|
-
siteIconUrl
|
|
20
|
-
} = useSelect(select => {
|
|
21
|
-
const {
|
|
22
|
-
getEntityRecord,
|
|
23
|
-
isResolving
|
|
24
|
-
} = select(coreDataStore);
|
|
25
|
-
const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
|
|
26
|
-
return {
|
|
27
|
-
isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
|
|
28
|
-
siteIconUrl: siteData.site_icon_url
|
|
29
|
-
};
|
|
30
|
-
}, []);
|
|
31
|
-
const disableMotion = useReducedMotion();
|
|
32
|
-
let buttonIcon = createElement(Icon, {
|
|
33
|
-
size: "36px",
|
|
34
|
-
icon: wordpress
|
|
35
|
-
});
|
|
36
|
-
const effect = {
|
|
37
|
-
expand: {
|
|
38
|
-
scale: 1.7,
|
|
39
|
-
borderRadius: 0,
|
|
40
|
-
transition: {
|
|
41
|
-
type: 'tween',
|
|
42
|
-
duration: '0.2'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
if (siteIconUrl) {
|
|
48
|
-
buttonIcon = createElement(motion.img, {
|
|
49
|
-
variants: !disableMotion && effect,
|
|
50
|
-
alt: __('Site Icon'),
|
|
51
|
-
className: "edit-site-navigation-link__site-icon",
|
|
52
|
-
src: siteIconUrl
|
|
53
|
-
});
|
|
54
|
-
} else if (isRequestingSiteIcon) {
|
|
55
|
-
buttonIcon = null;
|
|
56
|
-
} else if (icon) {
|
|
57
|
-
buttonIcon = createElement(Icon, {
|
|
58
|
-
size: "36px",
|
|
59
|
-
icon: icon
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return createElement(motion.div, {
|
|
64
|
-
className: "edit-site-navigation-link",
|
|
65
|
-
whileHover: "expand"
|
|
66
|
-
}, createElement(Button, {
|
|
67
|
-
className: "edit-site-navigation-link__button has-icon",
|
|
68
|
-
label: __('Dashboard'),
|
|
69
|
-
href: "index.php"
|
|
70
|
-
}, buttonIcon));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default NavigationLink;
|
|
74
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/navigation-link/index.js"],"names":["useSelect","Button","Icon","__unstableMotion","motion","__","wordpress","store","coreDataStore","useReducedMotion","NavigationLink","icon","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","siteData","undefined","site_icon_url","disableMotion","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;;AAEA,SAASC,cAAT,OAAoC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACnC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAwCb,SAAS,CAAIc,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEN,aAAF,CAA/C;AACA,UAAMS,QAAQ,GACbF,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BG,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNN,MAAAA,oBAAoB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CAC7D,MAD6D,EAE7D,gBAF6D,EAG7DE,SAH6D,CAA7B,CAD3B;AAMNL,MAAAA,WAAW,EAAEI,QAAQ,CAACE;AANhB,KAAP;AAQA,GAbsD,EAapD,EAboD,CAAvD;AAeA,QAAMC,aAAa,GAAGX,gBAAgB,EAAtC;AAEA,MAAIY,UAAU,GAAG,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,IAAI,EAAGf;AAAzB,IAAjB;AAEA,QAAMgB,MAAM,GAAG;AACdC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,GADA;AAEPC,MAAAA,YAAY,EAAE,CAFP;AAGPC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,IAAI,EAAE,OAAR;AAAiBC,QAAAA,QAAQ,EAAE;AAA3B;AAHL;AADM,GAAf;;AAQA,MAAKf,WAAL,EAAmB;AAClBQ,IAAAA,UAAU,GACT,cAAC,MAAD,CAAQ,GAAR;AACC,MAAA,QAAQ,EAAG,CAAED,aAAF,IAAmBE,MAD/B;AAEC,MAAA,GAAG,EAAGjB,EAAE,CAAE,WAAF,CAFT;AAGC,MAAA,SAAS,EAAC,sCAHX;AAIC,MAAA,GAAG,EAAGQ;AAJP,MADD;AAQA,GATD,MASO,IAAKD,oBAAL,EAA4B;AAClCS,IAAAA,UAAU,GAAG,IAAb;AACA,GAFM,MAEA,IAAKV,IAAL,EAAY;AAClBU,IAAAA,UAAU,GAAG,cAAC,IAAD;AAAM,MAAA,IAAI,EAAC,MAAX;AAAkB,MAAA,IAAI,EAAGV;AAAzB,MAAb;AACA;;AAED,SACC,cAAC,MAAD,CAAQ,GAAR;AAAY,IAAA,SAAS,EAAC,2BAAtB;AAAkD,IAAA,UAAU,EAAC;AAA7D,KACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAGN,EAAE,CAAE,WAAF,CAFX;AAGC,IAAA,IAAI,EAAC;AAHN,KAKGgB,UALH,CADD,CADD;AAWA;;AAED,eAAeX,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction NavigationLink( { icon } ) {\n\tconst { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tconst disableMotion = useReducedMotion();\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-link__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div className=\"edit-site-navigation-link\" whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-link__button has-icon\"\n\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\thref=\"index.php\"\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationLink;\n"]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import {
|
|
6
|
-
Button,
|
|
7
|
-
Icon,
|
|
8
|
-
__unstableMotion as motion,
|
|
9
|
-
} from '@wordpress/components';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { wordpress } from '@wordpress/icons';
|
|
12
|
-
import { store as coreDataStore } from '@wordpress/core-data';
|
|
13
|
-
import { useReducedMotion } from '@wordpress/compose';
|
|
14
|
-
|
|
15
|
-
function NavigationLink( { icon } ) {
|
|
16
|
-
const { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => {
|
|
17
|
-
const { getEntityRecord, isResolving } = select( coreDataStore );
|
|
18
|
-
const siteData =
|
|
19
|
-
getEntityRecord( 'root', '__unstableBase', undefined ) || {};
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
isRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [
|
|
23
|
-
'root',
|
|
24
|
-
'__unstableBase',
|
|
25
|
-
undefined,
|
|
26
|
-
] ),
|
|
27
|
-
siteIconUrl: siteData.site_icon_url,
|
|
28
|
-
};
|
|
29
|
-
}, [] );
|
|
30
|
-
|
|
31
|
-
const disableMotion = useReducedMotion();
|
|
32
|
-
|
|
33
|
-
let buttonIcon = <Icon size="36px" icon={ wordpress } />;
|
|
34
|
-
|
|
35
|
-
const effect = {
|
|
36
|
-
expand: {
|
|
37
|
-
scale: 1.7,
|
|
38
|
-
borderRadius: 0,
|
|
39
|
-
transition: { type: 'tween', duration: '0.2' },
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
if ( siteIconUrl ) {
|
|
44
|
-
buttonIcon = (
|
|
45
|
-
<motion.img
|
|
46
|
-
variants={ ! disableMotion && effect }
|
|
47
|
-
alt={ __( 'Site Icon' ) }
|
|
48
|
-
className="edit-site-navigation-link__site-icon"
|
|
49
|
-
src={ siteIconUrl }
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
} else if ( isRequestingSiteIcon ) {
|
|
53
|
-
buttonIcon = null;
|
|
54
|
-
} else if ( icon ) {
|
|
55
|
-
buttonIcon = <Icon size="36px" icon={ icon } />;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<motion.div className="edit-site-navigation-link" whileHover="expand">
|
|
60
|
-
<Button
|
|
61
|
-
className="edit-site-navigation-link__button has-icon"
|
|
62
|
-
label={ __( 'Dashboard' ) }
|
|
63
|
-
href="index.php"
|
|
64
|
-
>
|
|
65
|
-
{ buttonIcon }
|
|
66
|
-
</Button>
|
|
67
|
-
</motion.div>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default NavigationLink;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// Developer notes: these rules are duplicated for the post editor.
|
|
2
|
-
// They need to be updated in both places.
|
|
3
|
-
|
|
4
|
-
.edit-site-navigation-link {
|
|
5
|
-
align-items: center;
|
|
6
|
-
background: $gray-900;
|
|
7
|
-
border-radius: 0;
|
|
8
|
-
display: flex;
|
|
9
|
-
position: absolute;
|
|
10
|
-
top: 0;
|
|
11
|
-
left: 0;
|
|
12
|
-
z-index: z-index(".edit-site-navigation-link");
|
|
13
|
-
height: $header-height;
|
|
14
|
-
width: $header-height;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.edit-site-navigation-link__button {
|
|
18
|
-
align-items: center;
|
|
19
|
-
background: $gray-900;
|
|
20
|
-
border-radius: 0;
|
|
21
|
-
color: $white;
|
|
22
|
-
height: $header-height + $border-width;
|
|
23
|
-
width: $header-height;
|
|
24
|
-
z-index: 1;
|
|
25
|
-
margin-bottom: - $border-width;
|
|
26
|
-
|
|
27
|
-
&.has-icon {
|
|
28
|
-
min-width: $header-height;
|
|
29
|
-
|
|
30
|
-
&:hover,
|
|
31
|
-
&:active,
|
|
32
|
-
&:focus {
|
|
33
|
-
color: $white;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:focus {
|
|
37
|
-
box-shadow: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&::before {
|
|
41
|
-
transition: box-shadow 0.1s ease;
|
|
42
|
-
@include reduce-motion("transition");
|
|
43
|
-
content: "";
|
|
44
|
-
display: block;
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 9px;
|
|
47
|
-
right: 9px;
|
|
48
|
-
bottom: 9px;
|
|
49
|
-
left: 9px;
|
|
50
|
-
border-radius: $radius-block-ui + $border-width + $border-width;
|
|
51
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-900;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Hover color.
|
|
55
|
-
&:hover::before {
|
|
56
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-700;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Lightened spot color focus.
|
|
60
|
-
&:focus::before {
|
|
61
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba($white, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.edit-site-navigation-link__site-icon {
|
|
67
|
-
width: $button-size;
|
|
68
|
-
border-radius: $radius-block-ui;
|
|
69
|
-
}
|