@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
|
@@ -5,7 +5,6 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { LineHeightControl, __experimentalFontFamilyControl as FontFamilyControl, __experimentalFontAppearanceControl as FontAppearanceControl, __experimentalLetterSpacingControl as LetterSpacingControl } from '@wordpress/block-editor';
|
|
7
7
|
import { PanelBody, FontSizePicker } from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
@@ -79,7 +78,7 @@ export default function TypographyPanel({
|
|
|
79
78
|
name
|
|
80
79
|
});
|
|
81
80
|
return createElement(PanelBody, {
|
|
82
|
-
|
|
81
|
+
className: "edit-site-typography-panel",
|
|
83
82
|
initialOpen: true
|
|
84
83
|
}, supports.includes('fontFamily') && createElement(FontFamilyControl, {
|
|
85
84
|
fontFamilies: fontFamilies,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["LineHeightControl","__experimentalFontFamilyControl","FontFamilyControl","__experimentalFontAppearanceControl","FontAppearanceControl","__experimentalLetterSpacingControl","LetterSpacingControl","PanelBody","FontSizePicker","useSetting","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":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,+BAA+B,IAAIC,iBAFpC,EAGCC,mCAAmC,IAAIC,qBAHxC,EAICC,kCAAkC,IAAIC,oBAJvC,QAKO,yBALP;AAMA,SAASC,SAAT,EAAoBC,cAApB,QAA0C,uBAA1C;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA,OAAO,SAASC,qBAAT,CAAgC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAhC,EAAqD;AAC3D,QAAMC,aAAa,GAAGC,uBAAuB,CAAE;AAAEH,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF,CAA7C;AACA,QAAMG,iBAAiB,GAAGC,uBAAuB,CAAE;AAAEL,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF,CAAjD;AACA,QAAMK,gBAAgB,GAAGC,0BAA0B,CAAE;AAAEP,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF,CAAnD;AACA,SACCC,aAAa,IACbE,iBADA,IAEAE,gBAFA,IAGAN,QAAQ,CAACQ,QAAT,CAAmB,UAAnB,CAJD;AAMA;;AAED,SAASL,uBAAT,CAAkC;AAAEH,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAlC,EAAuD;AACtD,SACCH,UAAU,CAAE,6BAAF,EAAiCG,IAAjC,CAAV,IACAD,QAAQ,CAACQ,QAAT,CAAmB,YAAnB,CAFD;AAIA;;AAED,SAASH,uBAAT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,KADT;AAKC,IAAA,QAAQ,EAAG,CAAE;AAAEqB,MAAAA,SAAF;AAAaC,MAAAA;AAAb,KAAF,KAAiC;AAC3CT,MAAAA,QAAQ,CAAEb,IAAF,EAAQ,WAAR,EAAqBqB,SAArB,CAAR;AACAR,MAAAA,QAAQ,CAAEb,IAAF,EAAQ,YAAR,EAAsBsB,UAAtB,CAAR;AACA,KARF;AASC,IAAA,aAAa,EAAGd,aATjB;AAUC,IAAA,cAAc,EAAGC;AAVlB,IA7BF,EA0CGU,uBAAuB,IACxB,cAAC,oBAAD;AACC,IAAA,KAAK,EAAGP,QAAQ,CAAEZ,IAAF,EAAQ,eAAR,CADjB;AAEC,IAAA,QAAQ,EAAKoB,KAAF,IACVP,QAAQ,CAAEb,IAAF,EAAQ,eAAR,EAAyBoB,KAAzB;AAHV,IA3CF,CADD;AAqDA","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,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { ActionItem } from '@wordpress/interface';
|
|
5
|
+
import { compose } from '@wordpress/compose';
|
|
6
|
+
import { withPluginContext } from '@wordpress/plugins';
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
* The text within the component appears as the menu item label.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props Component properties.
|
|
12
|
+
* @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.
|
|
13
|
+
* @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.
|
|
14
|
+
* @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
|
|
15
|
+
* @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* // Using ES5 syntax
|
|
20
|
+
* var __ = wp.i18n.__;
|
|
21
|
+
* var PluginMoreMenuItem = wp.editSite.PluginMoreMenuItem;
|
|
22
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
23
|
+
*
|
|
24
|
+
* function onButtonClick() {
|
|
25
|
+
* alert( 'Button clicked.' );
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* function MyButtonMoreMenuItem() {
|
|
29
|
+
* return wp.element.createElement(
|
|
30
|
+
* PluginMoreMenuItem,
|
|
31
|
+
* {
|
|
32
|
+
* icon: moreIcon,
|
|
33
|
+
* onClick: onButtonClick,
|
|
34
|
+
* },
|
|
35
|
+
* __( 'My button title' )
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* // Using ESNext syntax
|
|
43
|
+
* import { __ } from '@wordpress/i18n';
|
|
44
|
+
* import { PluginMoreMenuItem } from '@wordpress/edit-site';
|
|
45
|
+
* import { more } from '@wordpress/icons';
|
|
46
|
+
*
|
|
47
|
+
* function onButtonClick() {
|
|
48
|
+
* alert( 'Button clicked.' );
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* const MyButtonMoreMenuItem = () => (
|
|
52
|
+
* <PluginMoreMenuItem
|
|
53
|
+
* icon={ more }
|
|
54
|
+
* onClick={ onButtonClick }
|
|
55
|
+
* >
|
|
56
|
+
* { __( 'My button title' ) }
|
|
57
|
+
* </PluginMoreMenuItem>
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @return {WPComponent} The component to be rendered.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export default compose(withPluginContext((context, ownProps) => {
|
|
65
|
+
return {
|
|
66
|
+
icon: ownProps.icon || context.icon,
|
|
67
|
+
name: 'core/edit-site/plugin-more-menu'
|
|
68
|
+
};
|
|
69
|
+
}))(ActionItem);
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-more-menu-item/index.js"],"names":["ActionItem","compose","withPluginContext","context","ownProps","icon","name"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,sBAA3B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AAEA;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;;AACA,eAAeD,OAAO,CACrBC,iBAAiB,CAAE,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNC,IAAAA,IAAI,EAAED,QAAQ,CAACC,IAAT,IAAiBF,OAAO,CAACE,IADzB;AAENC,IAAAA,IAAI,EAAE;AAFA,GAAP;AAIA,CALgB,CADI,CAAP,CAOZN,UAPY,CAAf","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"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
|
|
8
|
+
/**
|
|
9
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down,
|
|
10
|
+
* and can be used to activate the corresponding `PluginSidebar` component.
|
|
11
|
+
* The text within the component appears as the menu item label.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} props Component props.
|
|
14
|
+
* @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
15
|
+
* @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.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* // Using ES5 syntax
|
|
20
|
+
* var __ = wp.i18n.__;
|
|
21
|
+
* var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;
|
|
22
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
23
|
+
*
|
|
24
|
+
* function MySidebarMoreMenuItem() {
|
|
25
|
+
* return wp.element.createElement(
|
|
26
|
+
* PluginSidebarMoreMenuItem,
|
|
27
|
+
* {
|
|
28
|
+
* target: 'my-sidebar',
|
|
29
|
+
* icon: moreIcon,
|
|
30
|
+
* },
|
|
31
|
+
* __( 'My sidebar title' )
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```jsx
|
|
38
|
+
* // Using ESNext syntax
|
|
39
|
+
* import { __ } from '@wordpress/i18n';
|
|
40
|
+
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';
|
|
41
|
+
* import { more } from '@wordpress/icons';
|
|
42
|
+
*
|
|
43
|
+
* const MySidebarMoreMenuItem = () => (
|
|
44
|
+
* <PluginSidebarMoreMenuItem
|
|
45
|
+
* target="my-sidebar"
|
|
46
|
+
* icon={ more }
|
|
47
|
+
* >
|
|
48
|
+
* { __( 'My sidebar title' ) }
|
|
49
|
+
* </PluginSidebarMoreMenuItem>
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @return {WPComponent} The component to be rendered.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export default function PluginSidebarMoreMenuItem(props) {
|
|
57
|
+
return createElement(ComplementaryAreaMoreMenuItem // Menu item is marked with unstable prop for backward compatibility.
|
|
58
|
+
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
59
|
+
, _extends({
|
|
60
|
+
__unstableExplicitMenuItem: true,
|
|
61
|
+
scope: "core/edit-site"
|
|
62
|
+
}, props));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-sidebar-more-menu-item/index.js"],"names":["ComplementaryAreaMoreMenuItem","PluginSidebarMoreMenuItem","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,6BAAT,QAA8C,sBAA9C;AAEA;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;;AAEA,eAAe,SAASC,yBAAT,CAAoCC,KAApC,EAA4C;AAC1D,SACC,cAAC,6BAAD,CACC;AACA;AAFD;AAGC,IAAA,0BAA0B,MAH3B;AAIC,IAAA,KAAK,EAAC;AAJP,KAKMA,KALN,EADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down,\n * and can be used to activate the corresponding `PluginSidebar` component.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component props.\n * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.\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 *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MySidebarMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginSidebarMoreMenuItem,\n * \t\t{\n * \t\t\ttarget: 'my-sidebar',\n * \t\t\ticon: moreIcon,\n * \t\t},\n * \t\t__( 'My sidebar title' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MySidebarMoreMenuItem = () => (\n * \t<PluginSidebarMoreMenuItem\n * \t\ttarget=\"my-sidebar\"\n * \t\ticon={ more }\n * \t>\n * \t\t{ __( 'My sidebar title' ) }\n * \t</PluginSidebarMoreMenuItem>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\n\nexport default function PluginSidebarMoreMenuItem( props ) {\n\treturn (\n\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t// Menu item is marked with unstable prop for backward compatibility.\n\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t__unstableExplicitMenuItem\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';
|
|
|
10
10
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
export default function RedoButton() {
|
|
13
|
-
const hasRedo = useSelect(select => select(coreStore).hasRedo());
|
|
13
|
+
const hasRedo = useSelect(select => select(coreStore).hasRedo(), []);
|
|
14
14
|
const {
|
|
15
15
|
redo
|
|
16
16
|
} = useDispatch(coreStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","redo","redoIcon","undo","undoIcon","displayShortcut","store","coreStore","RedoButton","hasRedo","select","primaryShift","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","redo","redoIcon","undo","undoIcon","displayShortcut","store","coreStore","RedoButton","hasRedo","select","primaryShift","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,CACtBW,MAAF,IAAcA,MAAM,CAAEH,SAAF,CAAN,CAAoBE,OAApB,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAM;AAAER,IAAAA;AAAF,MAAWD,WAAW,CAAEO,SAAF,CAA5B;AACA,SACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,CAAEV,KAAK,EAAP,GAAYK,QAAZ,GAAuBE,QAD/B;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,QAAQ,EAAGS,eAAe,CAACM,YAAhB,CAA8B,GAA9B,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEF,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGR,IAAH,GAAUW;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function RedoButton() {\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( coreStore ).hasRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ displayShortcut.primaryShift( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';
|
|
|
10
10
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
export default function UndoButton() {
|
|
13
|
-
const hasUndo = useSelect(select => select(coreStore).hasUndo());
|
|
13
|
+
const hasUndo = useSelect(select => select(coreStore).hasUndo(), []);
|
|
14
14
|
const {
|
|
15
15
|
undo
|
|
16
16
|
} = useDispatch(coreStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","undo","undoIcon","redo","redoIcon","displayShortcut","store","coreStore","UndoButton","hasUndo","select","primary","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["__","isRTL","Button","useSelect","useDispatch","undo","undoIcon","redo","redoIcon","displayShortcut","store","coreStore","UndoButton","hasUndo","select","primary","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,IAAI,IAAIC,QAAnC,QAAmD,kBAAnD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGV,SAAS,CACtBW,MAAF,IAAcA,MAAM,CAAEH,SAAF,CAAN,CAAoBE,OAApB,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAM;AAAER,IAAAA;AAAF,MAAWD,WAAW,CAAEO,SAAF,CAA5B;AACA,SACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,CAAEV,KAAK,EAAP,GAAYK,QAAZ,GAAuBE,QAD/B;AAEC,IAAA,KAAK,EAAGR,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,QAAQ,EAAGS,eAAe,CAACM,OAAhB,CAAyB,GAAzB,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEF,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGR,IAAH,GAAUW;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function UndoButton() {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( coreStore ).hasUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect } from '@wordpress/element';
|
|
5
5
|
import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
6
6
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
@@ -16,7 +16,7 @@ import { SIDEBAR_BLOCK } from '../sidebar/constants';
|
|
|
16
16
|
import { STORE_NAME } from '../../store/constants';
|
|
17
17
|
|
|
18
18
|
function KeyboardShortcuts() {
|
|
19
|
-
const isListViewOpen = useSelect(select => select(editSiteStore).isListViewOpened());
|
|
19
|
+
const isListViewOpen = useSelect(select => select(editSiteStore).isListViewOpened(), []);
|
|
20
20
|
const isBlockInspectorOpen = useSelect(select => select(interfaceStore).getActiveComplementaryArea(editSiteStore.name) === SIDEBAR_BLOCK, []);
|
|
21
21
|
const {
|
|
22
22
|
redo,
|
|
@@ -32,19 +32,13 @@ function KeyboardShortcuts() {
|
|
|
32
32
|
useShortcut('core/edit-site/undo', event => {
|
|
33
33
|
undo();
|
|
34
34
|
event.preventDefault();
|
|
35
|
-
}, {
|
|
36
|
-
bindGlobal: true
|
|
37
35
|
});
|
|
38
36
|
useShortcut('core/edit-site/redo', event => {
|
|
39
37
|
redo();
|
|
40
38
|
event.preventDefault();
|
|
41
|
-
}, {
|
|
42
|
-
bindGlobal: true
|
|
43
39
|
});
|
|
44
|
-
useShortcut('core/edit-site/toggle-list-view',
|
|
40
|
+
useShortcut('core/edit-site/toggle-list-view', () => {
|
|
45
41
|
setIsListViewOpened(!isListViewOpen);
|
|
46
|
-
}, [isListViewOpen, setIsListViewOpened]), {
|
|
47
|
-
bindGlobal: true
|
|
48
42
|
});
|
|
49
43
|
useShortcut('core/edit-site/toggle-block-settings-sidebar', event => {
|
|
50
44
|
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
@@ -56,8 +50,6 @@ function KeyboardShortcuts() {
|
|
|
56
50
|
} else {
|
|
57
51
|
enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
|
|
58
52
|
}
|
|
59
|
-
}, {
|
|
60
|
-
bindGlobal: true
|
|
61
53
|
});
|
|
62
54
|
return null;
|
|
63
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["useEffect","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","__","coreStore","interfaceStore","editSiteStore","SIDEBAR_BLOCK","STORE_NAME","KeyboardShortcuts","isListViewOpen","select","isListViewOpened","isBlockInspectorOpen","getActiveComplementaryArea","name","redo","undo","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","KeyboardShortcutsRegister","registerShortcut","category","description","keyCombination","modifier","character","Register"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASJ,KAAK,IAAIK,SAAlB,QAAmC,sBAAnC;AACA,SAASL,KAAK,IAAIM,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AAC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AAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AASA,GAxCQ,EAwCN,CAAEL,gBAAF,CAxCM,CAAT;AA0CA,SAAO,IAAP;AACA;;AAEDf,iBAAiB,CAACqB,QAAlB,GAA6BP,yBAA7B;AACA,eAAed,iBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts() {\n\tconst isListViewOpen = useSelect(\n\t\t( select ) => select( editSiteStore ).isListViewOpened(),\n\t\t[]\n\t);\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\treturn null;\n}\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
@@ -19,7 +19,7 @@ export const {
|
|
|
19
19
|
export default function NavigationSidebar() {
|
|
20
20
|
const isNavigationOpen = useSelect(select => {
|
|
21
21
|
return select(editSiteStore).isNavigationOpened();
|
|
22
|
-
});
|
|
22
|
+
}, []);
|
|
23
23
|
return createElement(Fragment, null, createElement(NavigationToggle, {
|
|
24
24
|
isOpen: isNavigationOpen
|
|
25
25
|
}), createElement(NavigationPanel, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/index.js"],"names":["createSlotFill","useSelect","NavigationPanel","NavigationToggle","store","editSiteStore","Fill","NavigationPanelPreviewFill","Slot","NavigationPanelPreviewSlot","NavigationSidebar","isNavigationOpen","select","isNavigationOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,OAAO,MAAM;AACZC,EAAAA,IAAI,EAAEC,0BADM;AAEZC,EAAAA,IAAI,EAAEC;AAFM,IAGTT,cAAc,CAAE,gCAAF,CAHX;AAKP,eAAe,SAASU,iBAAT,GAA6B;AAC3C,QAAMC,gBAAgB,GAAGV,SAAS,CAAIW,MAAF,IAAc;AACjD,WAAOA,MAAM,CAAEP,aAAF,CAAN,CAAwBQ,kBAAxB,EAAP;AACA,GAFiC,CAAlC;AAIA,SACC,8BACC,cAAC,gBAAD;AAAkB,IAAA,MAAM,EAAGF;AAA3B,IADD,EAEC,cAAC,eAAD;AAAiB,IAAA,MAAM,EAAGA;AAA1B,IAFD,EAGC,cAAC,0BAAD,OAHD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport NavigationPanel from './navigation-panel';\nimport NavigationToggle from './navigation-toggle';\nimport { store as editSiteStore } from '../../store';\n\nexport const {\n\tFill: NavigationPanelPreviewFill,\n\tSlot: NavigationPanelPreviewSlot,\n} = createSlotFill( 'EditSiteNavigationPanelPreview' );\n\nexport default function NavigationSidebar() {\n\tconst isNavigationOpen = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isNavigationOpened();\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigationToggle isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanel isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanelPreviewSlot />\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/index.js"],"names":["createSlotFill","useSelect","NavigationPanel","NavigationToggle","store","editSiteStore","Fill","NavigationPanelPreviewFill","Slot","NavigationPanelPreviewSlot","NavigationSidebar","isNavigationOpen","select","isNavigationOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,OAAO,MAAM;AACZC,EAAAA,IAAI,EAAEC,0BADM;AAEZC,EAAAA,IAAI,EAAEC;AAFM,IAGTT,cAAc,CAAE,gCAAF,CAHX;AAKP,eAAe,SAASU,iBAAT,GAA6B;AAC3C,QAAMC,gBAAgB,GAAGV,SAAS,CAAIW,MAAF,IAAc;AACjD,WAAOA,MAAM,CAAEP,aAAF,CAAN,CAAwBQ,kBAAxB,EAAP;AACA,GAFiC,EAE/B,EAF+B,CAAlC;AAIA,SACC,8BACC,cAAC,gBAAD;AAAkB,IAAA,MAAM,EAAGF;AAA3B,IADD,EAEC,cAAC,eAAD;AAAiB,IAAA,MAAM,EAAGA;AAA1B,IAFD,EAGC,cAAC,0BAAD,OAHD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport NavigationPanel from './navigation-panel';\nimport NavigationToggle from './navigation-toggle';\nimport { store as editSiteStore } from '../../store';\n\nexport const {\n\tFill: NavigationPanelPreviewFill,\n\tSlot: NavigationPanelPreviewSlot,\n} = createSlotFill( 'EditSiteNavigationPanelPreview' );\n\nexport default function NavigationSidebar() {\n\tconst isNavigationOpen = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isNavigationOpened();\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigationToggle isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanel isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanelPreviewSlot />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { TEMPLATE_PART_AREA_HEADER, TEMPLATE_PART_AREA_FOOTER, TEMPLATE_PART_AREA_SIDEBAR } from '../../../store/constants';
|
|
5
10
|
export const TEMPLATES_PRIMARY = ['index', 'singular', 'archive', 'single', 'page', 'home', '404', 'search'];
|
|
6
11
|
export const TEMPLATES_SECONDARY = ['author', 'category', 'taxonomy', 'date', 'tag', 'attachment', 'single-post', 'front-page'];
|
|
7
12
|
export const TEMPLATES_TOP_LEVEL = [...TEMPLATES_PRIMARY, ...TEMPLATES_SECONDARY];
|
|
@@ -29,9 +34,6 @@ export const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';
|
|
|
29
34
|
export const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';
|
|
30
35
|
export const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';
|
|
31
36
|
export const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';
|
|
32
|
-
export const TEMPLATE_PART_AREA_HEADER = 'header';
|
|
33
|
-
export const TEMPLATE_PART_AREA_FOOTER = 'footer';
|
|
34
|
-
export const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
|
|
35
37
|
export const TEMPLATE_PARTS_SUB_MENUS = [{
|
|
36
38
|
area: TEMPLATE_PART_AREA_HEADER,
|
|
37
39
|
menu: MENU_TEMPLATE_PARTS_HEADERS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["__","TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["__","TEMPLATE_PART_AREA_HEADER","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR","TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","TEMPLATE_PARTS_SUB_MENUS","area","menu","title"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SACCC,yBADD,EAECC,yBAFD,EAGCC,0BAHD,QAIO,0BAJP;AAMA,OAAO,MAAMC,iBAAiB,GAAG,CAChC,OADgC,EAEhC,UAFgC,EAGhC,SAHgC,EAIhC,QAJgC,EAKhC,MALgC,EAMhC,MANgC,EAOhC,KAPgC,EAQhC,QARgC,CAA1B;AAWP,OAAO,MAAMC,mBAAmB,GAAG,CAClC,QADkC,EAElC,UAFkC,EAGlC,UAHkC,EAIlC,MAJkC,EAKlC,KALkC,EAMlC,YANkC,EAOlC,aAPkC,EAQlC,YARkC,CAA5B;AAWP,OAAO,MAAMC,mBAAmB,GAAG,CAClC,GAAGF,iBAD+B,EAElC,GAAGC,mBAF+B,CAA5B;AAKP,OAAO,MAAME,iBAAiB,GAAG,CAAE,WAAF,CAA1B;AAEP,OAAO,MAAMC,wBAAwB,GAAG,CACvC,OADuC,EAEvC,SAFuC,EAGvC,cAHuC,EAIvC,MAJuC,CAAjC;AAOP,OAAO,MAAMC,wBAAwB,GAAG,CAAE,OAAF,CAAjC;AAEP,OAAO,MAAMC,qBAAqB,GAAG,CACpC,YADoC,EAEpC,aAFoC,EAGpC,MAHoC,EAIpC,SAJoC,EAKpC,QALoC,EAMpC,KANoC,EAOpC,OAPoC,CAA9B;AAUP,OAAO,MA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A,KAAK,EAAEjC,EAAE,CAAE,UAAF;AAHV,CAXuC,EAgBvC;AACC+B,EAAAA,IAAI,EAAE,eADP;AAECC,EAAAA,IAAI,EAAEH,2BAFP;AAGCI,EAAAA,KAAK,EAAEjC,EAAE,CAAE,SAAF;AAHV,CAhBuC,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_HEADER,\n\tTEMPLATE_PART_AREA_FOOTER,\n\tTEMPLATE_PART_AREA_SIDEBAR,\n} from '../../../store/constants';\n\nexport const TEMPLATES_PRIMARY = [\n\t'index',\n\t'singular',\n\t'archive',\n\t'single',\n\t'page',\n\t'home',\n\t'404',\n\t'search',\n];\n\nexport const TEMPLATES_SECONDARY = [\n\t'author',\n\t'category',\n\t'taxonomy',\n\t'date',\n\t'tag',\n\t'attachment',\n\t'single-post',\n\t'front-page',\n];\n\nexport const TEMPLATES_TOP_LEVEL = [\n\t...TEMPLATES_PRIMARY,\n\t...TEMPLATES_SECONDARY,\n];\n\nexport const TEMPLATES_GENERAL = [ 'page-home' ];\n\nexport const TEMPLATES_POSTS_PREFIXES = [\n\t'post-',\n\t'author-',\n\t'single-post-',\n\t'tag-',\n];\n\nexport const TEMPLATES_PAGES_PREFIXES = [ 'page-' ];\n\nexport const TEMPLATES_NEW_OPTIONS = [\n\t'front-page',\n\t'single-post',\n\t'page',\n\t'archive',\n\t'search',\n\t'404',\n\t'index',\n];\n\nexport const TEMPLATE_OVERRIDES = {\n\tsingular: [ 'single', 'page' ],\n\tindex: [ 'archive', '404', 'search', 'singular', 'home' ],\n\thome: [ 'front-page' ],\n};\n\nexport const MENU_ROOT = 'root';\nexport const MENU_CONTENT_CATEGORIES = 'content-categories';\nexport const MENU_CONTENT_PAGES = 'content-pages';\nexport const MENU_CONTENT_POSTS = 'content-posts';\nexport const MENU_TEMPLATE_PARTS = 'template-parts';\nexport const MENU_TEMPLATES = 'templates';\nexport const MENU_TEMPLATES_GENERAL = 'templates-general';\nexport const MENU_TEMPLATES_PAGES = 'templates-pages';\nexport const MENU_TEMPLATES_POSTS = 'templates-posts';\nexport const MENU_TEMPLATES_UNUSED = 'templates-unused';\n\nexport const SEARCH_DEBOUNCE_IN_MS = 75;\n\nexport const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';\nexport const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';\nexport const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';\nexport const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';\n\nexport const TEMPLATE_PARTS_SUB_MENUS = [\n\t{\n\t\tarea: TEMPLATE_PART_AREA_HEADER,\n\t\tmenu: MENU_TEMPLATE_PARTS_HEADERS,\n\t\ttitle: __( 'Headers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_FOOTER,\n\t\tmenu: MENU_TEMPLATE_PARTS_FOOTERS,\n\t\ttitle: __( 'Footers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_SIDEBAR,\n\t\tmenu: MENU_TEMPLATE_PARTS_SIDEBARS,\n\t\ttitle: __( 'Sidebars' ),\n\t},\n\t{\n\t\tarea: 'uncategorized',\n\t\tmenu: MENU_TEMPLATE_PARTS_GENERAL,\n\t\ttitle: __( 'General' ),\n\t},\n];\n"]}
|
|
@@ -31,7 +31,7 @@ export default function SaveButton({
|
|
|
31
31
|
isDirty: dirtyEntityRecords.length > 0,
|
|
32
32
|
isSaving: some(dirtyEntityRecords, record => isSavingEntityRecord(record.kind, record.name, record.key))
|
|
33
33
|
};
|
|
34
|
-
});
|
|
34
|
+
}, []);
|
|
35
35
|
const disabled = !isDirty || isSaving;
|
|
36
36
|
return createElement(Fragment, null, createElement(Button, {
|
|
37
37
|
variant: "primary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["some","useSelect","Button","__","store","coreStore","SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwBT,SAAS,CAAIU,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEN,SAAF,CAHV;;AAIA,UAAMS,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEK,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENL,MAAAA,QAAQ,EAAEV,IAAI,CAAEc,kBAAF,EAAwBE,MAAF,IACnCH,oBAAoB,CAAEG,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADP;AAFR,KAAP;AAMA,GAZsC,CAAvC;AAcA,QAAMC,QAAQ,GAAG,CAAEX,OAAF,IAAaC,QAA9B;AAEA,SACC,8BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBU,QAHjB;AAIC,qBAAgBZ,yBAJjB;AAKC,IAAA,QAAQ,EAAGY,QALZ;AAMC,IAAA,MAAM,EAAGV,QANV;AAOC,IAAA,OAAO,EAAGU,QAAQ,GAAGC,SAAH,GAAed;AAPlC,KASGJ,EAAE,CAAE,MAAF,CATL,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["some","useSelect","Button","__","store","coreStore","SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwBT,SAAS,CAAIU,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEN,SAAF,CAHV;;AAIA,UAAMS,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEK,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENL,MAAAA,QAAQ,EAAEV,IAAI,CAAEc,kBAAF,EAAwBE,MAAF,IACnCH,oBAAoB,CAAEG,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADP;AAFR,KAAP;AAMA,GAZsC,EAYpC,EAZoC,CAAvC;AAcA,QAAMC,QAAQ,GAAG,CAAEX,OAAF,IAAaC,QAA9B;AAEA,SACC,8BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBU,QAHjB;AAIC,qBAAgBZ,yBAJjB;AAKC,IAAA,QAAQ,EAAGY,QALZ;AAMC,IAAA,MAAM,EAAGV,QANV;AAOC,IAAA,OAAO,EAAGU,QAAQ,GAAGC,SAAH,GAAed;AAPlC,KASGJ,EAAE,CAAE,MAAF,CATL,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -38,7 +38,8 @@ export default function InserterSidebar() {
|
|
|
38
38
|
showInserterHelpPanel: true,
|
|
39
39
|
shouldFocusBlock: isMobile,
|
|
40
40
|
rootClientId: insertionPoint.rootClientId,
|
|
41
|
-
__experimentalInsertionIndex: insertionPoint.insertionIndex
|
|
41
|
+
__experimentalInsertionIndex: insertionPoint.insertionIndex,
|
|
42
|
+
__experimentalFilterValue: insertionPoint.filterValue
|
|
42
43
|
})));
|
|
43
44
|
}
|
|
44
45
|
//# sourceMappingURL=inserter-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useSelect","useDispatch","Button","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","store","editSiteStore","InserterSidebar","setIsInserterOpened","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","rootClientId","insertionIndex"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,qBAAqB,IAAIC,OAAlC,QAAiD,yBAAjD;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SACCC,gBADD,EAECC,uBAAuB,IAAIC,SAF5B,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BX,WAAW,CAAES,aAAF,CAA3C;AACA,QAAMG,cAAc,GAAGb,SAAS,CAC7Bc,MAAF,IAAcA,MAAM,CAAEJ,aAAF,CAAN,CAAwBK,+BAAxB,EADiB,EAE/B,EAF+B,CAAhC;AAKA,QAAMC,QAAQ,GAAGV,gBAAgB,CAAE,QAAF,EAAY,GAAZ,CAAjC;AACA,QAAM,CAAEW,iBAAF,EAAqBC,mBAArB,IAA6CV,SAAS,CAAE;AAC7DW,IAAAA,OAAO,EAAE,MAAMP,mBAAmB,CAAE,KAAF;AAD2B,GAAF,CAA5D;AAIA,SACC;AACC,IAAA,GAAG,EAAGK;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGb,KADR;AAEC,IAAA,OAAO,EAAG,MAAMO,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGI,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACO,YAH/B;AAIC,IAAA,4BAA4B,EAC3BP,cAAc,CAACQ;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useSelect","useDispatch","Button","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","store","editSiteStore","InserterSidebar","setIsInserterOpened","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","rootClientId","insertionIndex","filterValue"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,qBAAqB,IAAIC,OAAlC,QAAiD,yBAAjD;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SACCC,gBADD,EAECC,uBAAuB,IAAIC,SAF5B,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BX,WAAW,CAAES,aAAF,CAA3C;AACA,QAAMG,cAAc,GAAGb,SAAS,CAC7Bc,MAAF,IAAcA,MAAM,CAAEJ,aAAF,CAAN,CAAwBK,+BAAxB,EADiB,EAE/B,EAF+B,CAAhC;AAKA,QAAMC,QAAQ,GAAGV,gBAAgB,CAAE,QAAF,EAAY,GAAZ,CAAjC;AACA,QAAM,CAAEW,iBAAF,EAAqBC,mBAArB,IAA6CV,SAAS,CAAE;AAC7DW,IAAAA,OAAO,EAAE,MAAMP,mBAAmB,CAAE,KAAF;AAD2B,GAAF,CAA5D;AAIA,SACC;AACC,IAAA,GAAG,EAAGK;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGb,KADR;AAEC,IAAA,OAAO,EAAG,MAAMO,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGI,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACO,YAH/B;AAIC,IAAA,4BAA4B,EAC3BP,cAAc,CAACQ,cALjB;AAOC,IAAA,yBAAyB,EAAGR,cAAc,CAACS;AAP5C,IADD,CAXD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst insertionPoint = useSelect(\n\t\t( select ) => select( editSiteStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-site-editor__inserter-panel\"\n\t\t>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobile }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|