@wordpress/edit-site 3.0.2 → 3.0.3
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/README.md +1 -1
- package/build/components/block-editor/back-button.js +60 -0
- package/build/components/block-editor/back-button.js.map +1 -0
- package/build/components/block-editor/index.js +18 -4
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +63 -0
- package/build/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build/components/editor/global-styles-provider.js +1 -1
- package/build/components/editor/global-styles-provider.js.map +1 -1
- package/build/components/editor/index.js +7 -7
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/utils.js +1 -1
- package/build/components/editor/utils.js.map +1 -1
- package/build/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/build/components/global-styles/border-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-panel.js +7 -11
- package/build/components/global-styles/color-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +58 -0
- package/build/components/global-styles/context-menu.js.map +1 -0
- package/build/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
- package/build/components/global-styles/dimensions-panel.js.map +1 -0
- package/build/components/global-styles/header.js +54 -0
- package/build/components/global-styles/header.js.map +1 -0
- package/build/components/global-styles/index.js +89 -0
- package/build/components/global-styles/index.js.map +1 -0
- package/build/components/global-styles/navigation-button.js +43 -0
- package/build/components/global-styles/navigation-button.js.map +1 -0
- package/build/components/global-styles/palette.js +57 -0
- package/build/components/global-styles/palette.js.map +1 -0
- package/build/components/global-styles/preview.js +59 -0
- package/build/components/global-styles/preview.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +76 -0
- package/build/components/global-styles/screen-block-list.js.map +1 -0
- package/build/components/global-styles/screen-block.js +45 -0
- package/build/components/global-styles/screen-block.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +48 -0
- package/build/components/global-styles/screen-color-palette.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +51 -0
- package/build/components/global-styles/screen-colors.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +60 -0
- package/build/components/global-styles/screen-layout.js.map +1 -0
- package/build/components/global-styles/screen-root.js +44 -0
- package/build/components/global-styles/screen-root.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +50 -0
- package/build/components/global-styles/screen-typography.js.map +1 -0
- package/build/components/global-styles/subtitle.js +25 -0
- package/build/components/global-styles/subtitle.js.map +1 -0
- package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/header/plugin-more-menu-item/index.js +82 -0
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/header/undo-redo/redo.js +1 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +1 -1
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -10
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build/components/save-button/index.js +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +11 -161
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +95 -0
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build/components/template-details/index.js +12 -6
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +73 -0
- package/build/components/template-details/template-areas.js.map +1 -0
- package/build/components/template-part-converter/index.js +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +24 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +54 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +19 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +16 -7
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +91 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +48 -0
- package/build-module/components/block-editor/back-button.js.map +1 -0
- package/build-module/components/block-editor/index.js +15 -4
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +49 -0
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build-module/components/editor/global-styles-provider.js +1 -1
- package/build-module/components/editor/global-styles-provider.js.map +1 -1
- package/build-module/components/editor/index.js +4 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/utils.js +1 -1
- package/build-module/components/editor/utils.js.map +1 -1
- package/build-module/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/build-module/components/global-styles/border-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-panel.js +8 -12
- package/build-module/components/global-styles/color-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +41 -0
- package/build-module/components/global-styles/context-menu.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
- package/build-module/components/global-styles/header.js +41 -0
- package/build-module/components/global-styles/header.js.map +1 -0
- package/build-module/components/global-styles/index.js +70 -0
- package/build-module/components/global-styles/index.js.map +1 -0
- package/build-module/components/global-styles/navigation-button.js +31 -0
- package/build-module/components/global-styles/navigation-button.js.map +1 -0
- package/build-module/components/global-styles/palette.js +43 -0
- package/build-module/components/global-styles/palette.js.map +1 -0
- package/build-module/components/global-styles/preview.js +50 -0
- package/build-module/components/global-styles/preview.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +58 -0
- package/build-module/components/global-styles/screen-block-list.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +32 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +35 -0
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +38 -0
- package/build-module/components/global-styles/screen-colors.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +44 -0
- package/build-module/components/global-styles/screen-layout.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +29 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +37 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -0
- package/build-module/components/global-styles/subtitle.js +17 -0
- package/build-module/components/global-styles/subtitle.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/undo-redo/redo.js +1 -1
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +1 -1
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +3 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +2 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/template-details/index.js +13 -8
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +60 -0
- package/build-module/components/template-details/template-areas.js.map +1 -0
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +3 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +45 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +13 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +16 -7
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +85 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +122 -17
- package/build-style/style.css +122 -17
- package/package.json +26 -26
- package/src/components/block-editor/back-button.js +44 -0
- package/src/components/block-editor/index.js +16 -1
- package/src/components/block-editor/style.scss +26 -0
- package/src/components/edit-template-part-menu-button/index.js +57 -0
- package/src/components/editor/global-styles-provider.js +1 -1
- package/src/components/editor/index.js +5 -8
- package/src/components/editor/utils.js +1 -0
- package/src/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
- package/src/components/{sidebar → global-styles}/color-panel.js +12 -17
- package/src/components/global-styles/context-menu.js +54 -0
- package/src/components/{sidebar → global-styles}/dimensions-panel.js +6 -10
- package/src/components/global-styles/header.js +50 -0
- package/src/components/global-styles/index.js +81 -0
- package/src/components/global-styles/navigation-button.js +35 -0
- package/src/components/global-styles/palette.js +67 -0
- package/src/components/global-styles/preview.js +41 -0
- package/src/components/global-styles/screen-block-list.js +59 -0
- package/src/components/global-styles/screen-block.js +28 -0
- package/src/components/global-styles/screen-color-palette.js +33 -0
- package/src/components/global-styles/screen-colors.js +36 -0
- package/src/components/global-styles/screen-layout.js +45 -0
- package/src/components/global-styles/screen-root.js +43 -0
- package/src/components/global-styles/screen-typography.js +33 -0
- package/src/components/global-styles/style.scss +35 -0
- package/src/components/global-styles/subtitle.js +10 -0
- package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/src/components/header/plugin-more-menu-item/index.js +71 -0
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/header/undo-redo/redo.js +4 -1
- package/src/components/header/undo-redo/undo.js +4 -1
- package/src/components/keyboard-shortcuts/index.js +25 -40
- package/src/components/navigation-sidebar/index.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
- package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
- package/src/components/save-button/index.js +1 -1
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
- package/src/components/sidebar/global-styles-sidebar.js +14 -187
- package/src/components/sidebar/index.js +2 -7
- package/src/components/sidebar/plugin-sidebar/index.js +80 -0
- package/src/components/sidebar/style.scss +40 -0
- package/src/components/template-details/index.js +17 -7
- package/src/components/template-details/style.scss +36 -27
- package/src/components/template-details/template-areas.js +66 -0
- package/src/components/template-part-converter/index.js +1 -1
- package/src/components/url-query-controller/index.js +1 -1
- package/src/index.js +3 -0
- package/src/store/actions.js +53 -1
- package/src/store/constants.js +15 -0
- package/src/store/reducer.js +26 -12
- package/src/store/selectors.js +96 -9
- package/src/store/test/reducer.js +40 -23
- package/src/store/test/selectors.js +34 -3
- package/src/style.scss +1 -0
- package/build/components/sidebar/border-panel.js.map +0 -1
- package/build/components/sidebar/color-palette-panel.js.map +0 -1
- package/build/components/sidebar/color-panel.js.map +0 -1
- package/build/components/sidebar/dimensions-panel.js.map +0 -1
- package/build/components/sidebar/typography-panel.js.map +0 -1
- package/build-module/components/sidebar/border-panel.js.map +0 -1
- package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
- package/build-module/components/sidebar/color-panel.js.map +0 -1
- package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
- package/build-module/components/sidebar/typography-panel.js.map +0 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _blocks = require("@wordpress/blocks");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
17
|
+
|
|
18
|
+
var _borderPanel = require("./border-panel");
|
|
19
|
+
|
|
20
|
+
var _colorPanel = require("./color-panel");
|
|
21
|
+
|
|
22
|
+
var _dimensionsPanel = require("./dimensions-panel");
|
|
23
|
+
|
|
24
|
+
var _typographyPanel = require("./typography-panel");
|
|
25
|
+
|
|
26
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
27
|
+
|
|
28
|
+
var _navigationButton = _interopRequireDefault(require("./navigation-button"));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* WordPress dependencies
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Internal dependencies
|
|
36
|
+
*/
|
|
37
|
+
function BlockMenuItem({
|
|
38
|
+
block
|
|
39
|
+
}) {
|
|
40
|
+
const {
|
|
41
|
+
blocks
|
|
42
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
43
|
+
const context = blocks[block.name];
|
|
44
|
+
const hasTypographyPanel = (0, _typographyPanel.useHasTypographyPanel)(context);
|
|
45
|
+
const hasColorPanel = (0, _colorPanel.useHasColorPanel)(context);
|
|
46
|
+
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(context);
|
|
47
|
+
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(context);
|
|
48
|
+
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
|
|
49
|
+
const hasBlockMenuItem = hasTypographyPanel || hasColorPanel || hasLayoutPanel;
|
|
50
|
+
|
|
51
|
+
if (!hasBlockMenuItem) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (0, _element.createElement)(_navigationButton.default, {
|
|
56
|
+
path: '/blocks/' + block.name
|
|
57
|
+
}, block.title);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ScreenBlockList() {
|
|
61
|
+
const {
|
|
62
|
+
blocks
|
|
63
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
64
|
+
const visibleBlocks = Object.keys(blocks).map(name => (0, _blocks.getBlockType)(name)).filter(blockType => !!blockType);
|
|
65
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
66
|
+
back: "/",
|
|
67
|
+
title: (0, _i18n.__)('Blocks')
|
|
68
|
+
}), visibleBlocks.map(block => (0, _element.createElement)(BlockMenuItem, {
|
|
69
|
+
block: block,
|
|
70
|
+
key: 'menu-itemblock-' + block.name
|
|
71
|
+
})));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var _default = ScreenBlockList;
|
|
75
|
+
exports.default = _default;
|
|
76
|
+
//# sourceMappingURL=screen-block-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"names":["BlockMenuItem","block","blocks","context","name","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasBlockMenuItem","title","ScreenBlockList","visibleBlocks","Object","keys","map","filter","blockType"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;AASA,SAASA,aAAT,CAAwB;AAAEC,EAAAA;AAAF,CAAxB,EAAoC;AACnC,QAAM;AAAEC,IAAAA;AAAF,MAAa,mDAAnB;AACA,QAAMC,OAAO,GAAGD,MAAM,CAAED,KAAK,CAACG,IAAR,CAAtB;AACA,QAAMC,kBAAkB,GAAG,4CAAuBF,OAAvB,CAA3B;AACA,QAAMG,aAAa,GAAG,kCAAkBH,OAAlB,CAAtB;AACA,QAAMI,cAAc,GAAG,oCAAmBJ,OAAnB,CAAvB;AACA,QAAMK,kBAAkB,GAAG,4CAAuBL,OAAvB,CAA3B;AACA,QAAMM,cAAc,GAAGF,cAAc,IAAIC,kBAAzC;AACA,QAAME,gBAAgB,GACrBL,kBAAkB,IAAIC,aAAtB,IAAuCG,cADxC;;AAGA,MAAK,CAAEC,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,yBAAD;AAAkB,IAAA,IAAI,EAAG,aAAaT,KAAK,CAACG;AAA5C,KACGH,KAAK,CAACU,KADT,CADD;AAKA;;AAED,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEV,IAAAA;AAAF,MAAa,mDAAnB;AACA,QAAMW,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAab,MAAb,EACpBc,GADoB,CACbZ,IAAF,IAAY,0BAAcA,IAAd,CADG,EAEpBa,MAFoB,CAEVC,SAAF,IAAiB,CAAC,CAAEA,SAFR,CAAtB;AAIA,SACC,qDACC,4BAAC,eAAD;AAAc,IAAA,IAAI,EAAC,GAAnB;AAAuB,IAAA,KAAK,EAAG,cAAI,QAAJ;AAA/B,IADD,EAEGL,aAAa,CAACG,GAAd,CAAqBf,KAAF,IACpB,4BAAC,aAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,GAAG,EAAG,oBAAoBA,KAAK,CAACG;AAFjC,IADC,CAFH,CADD;AAWA;;eAEcQ,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-panel';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport ScreenHeader from './header';\nimport NavigationButton from './navigation-button';\n\nfunction BlockMenuItem( { block } ) {\n\tconst { blocks } = useGlobalStylesContext();\n\tconst context = blocks[ block.name ];\n\tconst hasTypographyPanel = useHasTypographyPanel( context );\n\tconst hasColorPanel = useHasColorPanel( context );\n\tconst hasBorderPanel = useHasBorderPanel( context );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( context );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasBlockMenuItem =\n\t\thasTypographyPanel || hasColorPanel || hasLayoutPanel;\n\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButton path={ '/blocks/' + block.name }>\n\t\t\t{ block.title }\n\t\t</NavigationButton>\n\t);\n}\n\nfunction ScreenBlockList() {\n\tconst { blocks } = useGlobalStylesContext();\n\tconst visibleBlocks = Object.keys( blocks )\n\t\t.map( ( name ) => getBlockType( name ) )\n\t\t.filter( ( blockType ) => !! blockType );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader back=\"/\" title={ __( 'Blocks' ) } />\n\t\t\t{ visibleBlocks.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _blocks = require("@wordpress/blocks");
|
|
13
|
+
|
|
14
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
15
|
+
|
|
16
|
+
var _contextMenu = _interopRequireDefault(require("./context-menu"));
|
|
17
|
+
|
|
18
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
function ScreenBlock({
|
|
28
|
+
name
|
|
29
|
+
}) {
|
|
30
|
+
const blockType = (0, _blocks.getBlockType)(name);
|
|
31
|
+
const {
|
|
32
|
+
blocks
|
|
33
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
34
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
35
|
+
back: "/blocks",
|
|
36
|
+
title: blockType.title
|
|
37
|
+
}), (0, _element.createElement)(_contextMenu.default, {
|
|
38
|
+
parentMenu: '/blocks/' + name,
|
|
39
|
+
context: blocks[name]
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var _default = ScreenBlock;
|
|
44
|
+
exports.default = _default;
|
|
45
|
+
//# sourceMappingURL=screen-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"names":["ScreenBlock","name","blockType","blocks","title"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,WAAT,CAAsB;AAAEC,EAAAA;AAAF,CAAtB,EAAiC;AAChC,QAAMC,SAAS,GAAG,0BAAcD,IAAd,CAAlB;AACA,QAAM;AAAEE,IAAAA;AAAF,MAAa,mDAAnB;AAEA,SACC,qDACC,4BAAC,eAAD;AAAc,IAAA,IAAI,EAAC,SAAnB;AAA6B,IAAA,KAAK,EAAGD,SAAS,CAACE;AAA/C,IADD,EAEC,4BAAC,oBAAD;AACC,IAAA,UAAU,EAAG,aAAaH,IAD3B;AAEC,IAAA,OAAO,EAAGE,MAAM,CAAEF,IAAF;AAFjB,IAFD,CADD;AASA;;eAEcD,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ContextMenu from './context-menu';\nimport ScreenHeader from './header';\n\nfunction ScreenBlock( { name } ) {\n\tconst blockType = getBlockType( name );\n\tconst { blocks } = useGlobalStylesContext();\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader back=\"/blocks\" title={ blockType.title } />\n\t\t\t<ContextMenu\n\t\t\t\tparentMenu={ '/blocks/' + name }\n\t\t\t\tcontext={ blocks[ name ] }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
15
|
+
|
|
16
|
+
var _colorPalettePanel = _interopRequireDefault(require("./color-palette-panel"));
|
|
17
|
+
|
|
18
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
function ScreenColorPalette({
|
|
28
|
+
name
|
|
29
|
+
}) {
|
|
30
|
+
const {
|
|
31
|
+
getSetting,
|
|
32
|
+
setSetting
|
|
33
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
34
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
35
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
36
|
+
back: parentMenu + '/colors',
|
|
37
|
+
title: (0, _i18n.__)('Color Palette'),
|
|
38
|
+
description: (0, _i18n.__)('Edit the color palette.')
|
|
39
|
+
}), (0, _element.createElement)(_colorPalettePanel.default, {
|
|
40
|
+
contextName: name,
|
|
41
|
+
getSetting: getSetting,
|
|
42
|
+
setSetting: setSetting
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var _default = ScreenColorPalette;
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
//# sourceMappingURL=screen-color-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-color-palette.js"],"names":["ScreenColorPalette","name","getSetting","setSetting","parentMenu","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,kBAAT,CAA6B;AAAEC,EAAAA;AAAF,CAA7B,EAAwC;AACvC,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,mDAAnC;AACA,QAAMC,UAAU,GAAGH,IAAI,KAAKI,SAAT,GAAqB,EAArB,GAA0B,aAAaJ,IAA1D;AAEA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAGG,UAAU,GAAG,SADrB;AAEC,IAAA,KAAK,EAAG,cAAI,eAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cAAI,yBAAJ;AAHf,IADD,EAMC,4BAAC,0BAAD;AACC,IAAA,WAAW,EAAGH,IADf;AAEC,IAAA,UAAU,EAAGC,UAFd;AAGC,IAAA,UAAU,EAAGC;AAHd,IAND,CADD;AAcA;;eAEcH,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ColorPalettePanel from './color-palette-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColorPalette( { name } ) {\n\tconst { getSetting, setSetting } = useGlobalStylesContext();\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Color Palette' ) }\n\t\t\t\tdescription={ __( 'Edit the color palette.' ) }\n\t\t\t/>\n\t\t\t<ColorPalettePanel\n\t\t\t\tcontextName={ name }\n\t\t\t\tgetSetting={ getSetting }\n\t\t\t\tsetSetting={ setSetting }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenColorPalette;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
15
|
+
|
|
16
|
+
var _colorPanel = _interopRequireDefault(require("./color-panel"));
|
|
17
|
+
|
|
18
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
function ScreenColors({
|
|
28
|
+
name
|
|
29
|
+
}) {
|
|
30
|
+
const {
|
|
31
|
+
root,
|
|
32
|
+
blocks,
|
|
33
|
+
getStyle,
|
|
34
|
+
setStyle
|
|
35
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
36
|
+
const context = name === undefined ? root : blocks[name];
|
|
37
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
38
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
39
|
+
back: parentMenu ? parentMenu : '/',
|
|
40
|
+
title: (0, _i18n.__)('Colors'),
|
|
41
|
+
description: (0, _i18n.__)('Manage color palettes and how they affect the different elements of the site.')
|
|
42
|
+
}), (0, _element.createElement)(_colorPanel.default, {
|
|
43
|
+
context: context,
|
|
44
|
+
getStyle: getStyle,
|
|
45
|
+
setStyle: setStyle
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var _default = ScreenColors;
|
|
50
|
+
exports.default = _default;
|
|
51
|
+
//# sourceMappingURL=screen-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-colors.js"],"names":["ScreenColors","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAAkC;AACjC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuC,mDAA7C;AACA,QAAMC,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AAEA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAGO,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,+EADa;AAHf,IADD,EAQC,4BAAC,mBAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IARD,CADD;AAgBA;;eAEcL,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ColorPanel from './color-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenColors( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Colors' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage color palettes and how they affect the different elements of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorPanel\n\t\t\t\tcontext={ context }\n\t\t\t\tgetStyle={ getStyle }\n\t\t\t\tsetStyle={ setStyle }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenColors;\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _element = require("@wordpress/element");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
17
|
+
|
|
18
|
+
var _borderPanel = _interopRequireWildcard(require("./border-panel"));
|
|
19
|
+
|
|
20
|
+
var _dimensionsPanel = _interopRequireWildcard(require("./dimensions-panel"));
|
|
21
|
+
|
|
22
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* WordPress dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
function ScreenLayout({
|
|
32
|
+
name
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
root,
|
|
36
|
+
blocks,
|
|
37
|
+
getStyle,
|
|
38
|
+
setStyle
|
|
39
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
40
|
+
const context = name === undefined ? root : blocks[name];
|
|
41
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
42
|
+
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(context);
|
|
43
|
+
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(context);
|
|
44
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
45
|
+
back: parentMenu ? parentMenu : '/',
|
|
46
|
+
title: (0, _i18n.__)('Layout')
|
|
47
|
+
}), hasDimensionsPanel && (0, _element.createElement)(_dimensionsPanel.default, {
|
|
48
|
+
context: context,
|
|
49
|
+
getStyle: getStyle,
|
|
50
|
+
setStyle: setStyle
|
|
51
|
+
}), hasBorderPanel && (0, _element.createElement)(_borderPanel.default, {
|
|
52
|
+
context: context,
|
|
53
|
+
getStyle: getStyle,
|
|
54
|
+
setStyle: setStyle
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var _default = ScreenLayout;
|
|
59
|
+
exports.default = _default;
|
|
60
|
+
//# sourceMappingURL=screen-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-layout.js"],"names":["ScreenLayout","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu","hasBorderPanel","hasDimensionsPanel"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAAkC;AACjC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuC,mDAA7C;AACA,QAAMC,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AACA,QAAMQ,cAAc,GAAG,oCAAmBH,OAAnB,CAAvB;AACA,QAAMI,kBAAkB,GAAG,4CAAuBJ,OAAvB,CAA3B;AAEA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAGE,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ;AAFT,IADD,EAKGE,kBAAkB,IACnB,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGJ,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IANF,EAYGI,cAAc,IACf,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGH,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAbF,CADD;AAsBA;;eAEcL,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenLayout( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst hasBorderPanel = useHasBorderPanel( context );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( context );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Layout' ) }\n\t\t\t/>\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<DimensionsPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenLayout;\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _preview = _interopRequireDefault(require("./preview"));
|
|
17
|
+
|
|
18
|
+
var _navigationButton = _interopRequireDefault(require("./navigation-button"));
|
|
19
|
+
|
|
20
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
21
|
+
|
|
22
|
+
var _contextMenu = _interopRequireDefault(require("./context-menu"));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* WordPress dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
function ScreenRoot() {
|
|
32
|
+
const {
|
|
33
|
+
root
|
|
34
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
35
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_preview.default, null), (0, _element.createElement)(_contextMenu.default, {
|
|
36
|
+
context: root
|
|
37
|
+
}), (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_components.__experimentalItem, null, (0, _element.createElement)("p", null, (0, _i18n.__)('Customize the appearance of specific blocks for the whole site.'))), (0, _element.createElement)(_navigationButton.default, {
|
|
38
|
+
path: "/blocks"
|
|
39
|
+
}, (0, _i18n.__)('Blocks'))));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var _default = ScreenRoot;
|
|
43
|
+
exports.default = _default;
|
|
44
|
+
//# sourceMappingURL=screen-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","root"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;AAMA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAW,mDAAjB;AAEA,SACC,qDACC,4BAAC,gBAAD,OADD,EAGC,4BAAC,oBAAD;AAAa,IAAA,OAAO,EAAGA;AAAvB,IAHD,EAKC,4BAAC,mCAAD,QACC,4BAAC,8BAAD,QACC,uCACG,cACD,iEADC,CADH,CADD,CADD,EAQC,4BAAC,yBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,KACG,cAAI,QAAJ,CADH,CARD,CALD,CADD;AAoBA;;eAEcD,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport StylesPreview from './preview';\nimport NavigationButton from './navigation-button';\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport ContextMenu from './context-menu';\n\nfunction ScreenRoot() {\n\tconst { root } = useGlobalStylesContext();\n\n\treturn (\n\t\t<>\n\t\t\t<StylesPreview />\n\n\t\t\t<ContextMenu context={ root } />\n\n\t\t\t<ItemGroup>\n\t\t\t\t<Item>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Item>\n\t\t\t\t<NavigationButton path=\"/blocks\">\n\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t</NavigationButton>\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
15
|
+
|
|
16
|
+
var _typographyPanel = _interopRequireDefault(require("./typography-panel"));
|
|
17
|
+
|
|
18
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
function ScreenTypography({
|
|
28
|
+
name
|
|
29
|
+
}) {
|
|
30
|
+
const {
|
|
31
|
+
root,
|
|
32
|
+
blocks,
|
|
33
|
+
getStyle,
|
|
34
|
+
setStyle
|
|
35
|
+
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
36
|
+
const context = name === undefined ? root : blocks[name];
|
|
37
|
+
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
38
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
39
|
+
back: parentMenu ? parentMenu : '/',
|
|
40
|
+
title: (0, _i18n.__)('Typography')
|
|
41
|
+
}), (0, _element.createElement)(_typographyPanel.default, {
|
|
42
|
+
context: context,
|
|
43
|
+
getStyle: getStyle,
|
|
44
|
+
setStyle: setStyle
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var _default = ScreenTypography;
|
|
49
|
+
exports.default = _default;
|
|
50
|
+
//# sourceMappingURL=screen-typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["ScreenTypography","name","root","blocks","getStyle","setStyle","context","undefined","parentMenu"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,gBAAT,CAA2B;AAAEC,EAAAA;AAAF,CAA3B,EAAsC;AACrC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA;AAA1B,MAAuC,mDAA7C;AACA,QAAMC,OAAO,GAAGL,IAAI,KAAKM,SAAT,GAAqBL,IAArB,GAA4BC,MAAM,CAAEF,IAAF,CAAlD;AACA,QAAMO,UAAU,GAAGP,IAAI,KAAKM,SAAT,GAAqB,EAArB,GAA0B,aAAaN,IAA1D;AAEA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAGO,UAAU,GAAGA,UAAH,GAAgB,GADlC;AAEC,IAAA,KAAK,EAAG,cAAI,YAAJ;AAFT,IADD,EAKC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,QAAQ,EAAGF,QAFZ;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IALD,CADD;AAaA;;eAEcL,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesContext } from '../editor/global-styles-provider';\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\n\nfunction ScreenTypography( { name } ) {\n\tconst { root, blocks, getStyle, setStyle } = useGlobalStylesContext();\n\tconst context = name === undefined ? root : blocks[ name ];\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu ? parentMenu : '/' }\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<TypographyPanel\n\t\t\t\tcontext={ context }\n\t\t\t\tgetStyle={ getStyle }\n\t\t\t\tsetStyle={ setStyle }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 _components = require("@wordpress/components");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
function Subtitle({
|
|
16
|
+
children
|
|
17
|
+
}) {
|
|
18
|
+
return (0, _element.createElement)(_components.__experimentalHeading, {
|
|
19
|
+
level: 2
|
|
20
|
+
}, children);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _default = Subtitle;
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
//# sourceMappingURL=subtitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"names":["Subtitle","children"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,QAAT,CAAmB;AAAEC,EAAAA;AAAF,CAAnB,EAAkC;AACjC,SAAO,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBA,QAAvB,CAAP;AACA;;eAEcD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children } ) {\n\treturn <Heading level={ 2 }>{ children }</Heading>;\n}\n\nexport default Subtitle;\n"]}
|
|
@@ -12,8 +12,6 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
12
12
|
|
|
13
13
|
var _components = require("@wordpress/components");
|
|
14
14
|
|
|
15
|
-
var _i18n = require("@wordpress/i18n");
|
|
16
|
-
|
|
17
15
|
var _utils = require("../editor/utils");
|
|
18
16
|
|
|
19
17
|
/**
|
|
@@ -91,7 +89,7 @@ function TypographyPanel({
|
|
|
91
89
|
name
|
|
92
90
|
});
|
|
93
91
|
return (0, _element.createElement)(_components.PanelBody, {
|
|
94
|
-
|
|
92
|
+
className: "edit-site-typography-panel",
|
|
95
93
|
initialOpen: true
|
|
96
94
|
}, supports.includes('fontFamily') && (0, _element.createElement)(_blockEditor.__experimentalFontFamilyControl, {
|
|
97
95
|
fontFamilies: fontFamilies,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useHasTypographyPanel","supports","name","hasLineHeight","useHasLineHeightControl","hasFontAppearance","useHasAppearanceControl","hasLetterSpacing","useHasLetterSpacingControl","includes","hasFontStyles","hasFontWeights","TypographyPanel","context","getStyle","setStyle","fontSizes","disableCustomFontSizes","fontFamilies","hasLineHeightEnabled","hasAppearanceControl","hasLetterSpacingControl","value","fontStyle","fontWeight"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tLineHeightControl,\n\t__experimentalFontFamilyControl as FontFamilyControl,\n\t__experimentalFontAppearanceControl as FontAppearanceControl,\n\t__experimentalLetterSpacingControl as LetterSpacingControl,\n} from '@wordpress/block-editor';\nimport { PanelBody, FontSizePicker } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useSetting } from '../editor/utils';\n\nexport function useHasTypographyPanel( { supports, name } ) {\n\tconst hasLineHeight = useHasLineHeightControl( { supports, name } );\n\tconst hasFontAppearance = useHasAppearanceControl( { supports, name } );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( { supports, name } );\n\treturn (\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\tsupports.includes( 'fontSize' )\n\t);\n}\n\nfunction useHasLineHeightControl( { supports, name } ) {\n\treturn (\n\t\tuseSetting( 'typography.customLineHeight', name ) &&\n\t\tsupports.includes( 'lineHeight' )\n\t);\n}\n\nfunction useHasAppearanceControl( { supports, name } ) {\n\tconst hasFontStyles =\n\t\tuseSetting( 'typography.customFontStyle', name ) &&\n\t\tsupports.includes( 'fontStyle' );\n\tconst hasFontWeights =\n\t\tuseSetting( 'typography.customFontWeight', name ) &&\n\t\tsupports.includes( 'fontWeight' );\n\treturn hasFontStyles || hasFontWeights;\n}\n\nfunction useHasLetterSpacingControl( { supports, name } ) {\n\treturn (\n\t\tuseSetting( 'typography.customLetterSpacing', name ) &&\n\t\tsupports.includes( 'letterSpacing' )\n\t);\n}\n\nexport default function TypographyPanel( {\n\tcontext: { supports, name },\n\tgetStyle,\n\tsetStyle,\n} ) {\n\tconst fontSizes = useSetting( 'typography.fontSizes', name );\n\tconst disableCustomFontSizes = ! useSetting(\n\t\t'typography.customFontSize',\n\t\tname\n\t);\n\tconst fontFamilies = useSetting( 'typography.fontFamilies', name );\n\tconst hasFontStyles =\n\t\tuseSetting( 'typography.customFontStyle', name ) &&\n\t\tsupports.includes( 'fontStyle' );\n\tconst hasFontWeights =\n\t\tuseSetting( 'typography.customFontWeight', name ) &&\n\t\tsupports.includes( 'fontWeight' );\n\tconst hasLineHeightEnabled = useHasLineHeightControl( { supports, name } );\n\tconst hasAppearanceControl = useHasAppearanceControl( { supports, name } );\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( {\n\t\tsupports,\n\t\tname,\n\t} );\n\n\treturn (\n\t\t<PanelBody className=\"edit-site-typography-panel\" initialOpen={ true }>\n\t\t\t{ supports.includes( 'fontFamily' ) && (\n\t\t\t\t<FontFamilyControl\n\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\tvalue={ getStyle( name, 'fontFamily' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'fontFamily', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ supports.includes( 'fontSize' ) && (\n\t\t\t\t<FontSizePicker\n\t\t\t\t\tvalue={ getStyle( name, 'fontSize' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'fontSize', value )\n\t\t\t\t\t}\n\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<LineHeightControl\n\t\t\t\t\tvalue={ getStyle( name, 'lineHeight' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'lineHeight', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<FontAppearanceControl\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\tfontStyle: getStyle( name, 'fontStyle' ),\n\t\t\t\t\t\tfontWeight: getStyle( name, 'fontWeight' ),\n\t\t\t\t\t} }\n\t\t\t\t\tonChange={ ( { fontStyle, fontWeight } ) => {\n\t\t\t\t\t\tsetStyle( name, 'fontStyle', fontStyle );\n\t\t\t\t\t\tsetStyle( name, 'fontWeight', fontWeight );\n\t\t\t\t\t} }\n\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<LetterSpacingControl\n\t\t\t\t\tvalue={ getStyle( name, 'letterSpacing' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetStyle( name, 'letterSpacing', value )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PanelBody>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _interface = require("@wordpress/interface");
|
|
9
|
+
|
|
10
|
+
var _compose = require("@wordpress/compose");
|
|
11
|
+
|
|
12
|
+
var _plugins = require("@wordpress/plugins");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
|
|
20
|
+
* The text within the component appears as the menu item label.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} props Component properties.
|
|
23
|
+
* @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
24
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
25
|
+
* @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
|
|
26
|
+
* @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```js
|
|
30
|
+
* // Using ES5 syntax
|
|
31
|
+
* var __ = wp.i18n.__;
|
|
32
|
+
* var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;
|
|
33
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
34
|
+
*
|
|
35
|
+
* function onButtonClick() {
|
|
36
|
+
* alert( 'Button clicked.' );
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* function MyButtonMoreMenuItem() {
|
|
40
|
+
* return wp.element.createElement(
|
|
41
|
+
* PluginMoreMenuItem,
|
|
42
|
+
* {
|
|
43
|
+
* icon: moreIcon,
|
|
44
|
+
* onClick: onButtonClick,
|
|
45
|
+
* },
|
|
46
|
+
* __( 'My button title' )
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```jsx
|
|
53
|
+
* // Using ESNext syntax
|
|
54
|
+
* import { __ } from '@wordpress/i18n';
|
|
55
|
+
* import { PluginMoreMenuItem } from '@wordpress/edit-site';
|
|
56
|
+
* import { more } from '@wordpress/icons';
|
|
57
|
+
*
|
|
58
|
+
* function onButtonClick() {
|
|
59
|
+
* alert( 'Button clicked.' );
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* const MyButtonMoreMenuItem = () => (
|
|
63
|
+
* <PluginMoreMenuItem
|
|
64
|
+
* icon={ more }
|
|
65
|
+
* onClick={ onButtonClick }
|
|
66
|
+
* >
|
|
67
|
+
* { __( 'My button title' ) }
|
|
68
|
+
* </PluginMoreMenuItem>
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @return {WPComponent} The component to be rendered.
|
|
73
|
+
*/
|
|
74
|
+
var _default = (0, _compose.compose)((0, _plugins.withPluginContext)((context, ownProps) => {
|
|
75
|
+
return {
|
|
76
|
+
icon: ownProps.icon || context.icon,
|
|
77
|
+
name: 'core/edit-site/plugin-more-menu'
|
|
78
|
+
};
|
|
79
|
+
}))(_interface.ActionItem);
|
|
80
|
+
|
|
81
|
+
exports.default = _default;
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-more-menu-item/index.js"],"names":["context","ownProps","icon","name","ActionItem"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;eACe,sBACd,gCAAmB,CAAEA,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNC,IAAAA,IAAI,EAAED,QAAQ,CAACC,IAAT,IAAiBF,OAAO,CAACE,IADzB;AAENC,IAAAA,IAAI,EAAE;AAFA,GAAP;AAIA,CALD,CADc,EAOZC,qBAPY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ActionItem } from '@wordpress/interface';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * function MyButtonMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginMoreMenuItem,\n * \t\t{\n * \t\t\ticon: moreIcon,\n * \t\t\tonClick: onButtonClick,\n * \t\t},\n * \t\t__( 'My button title' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginMoreMenuItem } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * const MyButtonMoreMenuItem = () => (\n * \t<PluginMoreMenuItem\n * \t\ticon={ more }\n * \t\tonClick={ onButtonClick }\n * \t>\n * \t\t{ __( 'My button title' ) }\n * \t</PluginMoreMenuItem>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/edit-site/plugin-more-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"]}
|