@wordpress/interface 4.1.3 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/action-item/index.js +30 -25
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +30 -27
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +7 -6
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +7 -6
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +9 -8
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js +4 -3
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/index.js +8 -8
- package/build/components/interface-skeleton/index.js +14 -13
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/more-menu-dropdown/index.js +11 -10
- package/build/components/more-menu-dropdown/index.js.map +1 -1
- package/build/components/more-menu-feature-toggle/index.js +10 -9
- package/build/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build/components/pinned-items/index.js +11 -9
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/store/actions.js +9 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +30 -17
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build-module/components/action-item/index.js +30 -25
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +30 -27
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +7 -6
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +7 -6
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +9 -8
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js +4 -3
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +14 -13
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/more-menu-dropdown/index.js +10 -9
- package/build-module/components/more-menu-dropdown/index.js.map +1 -1
- package/build-module/components/more-menu-feature-toggle/index.js +10 -9
- package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +11 -9
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/store/actions.js +5 -4
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +27 -15
- package/build-module/store/reducer.js.map +1 -1
- package/package.json +13 -13
|
@@ -22,13 +22,14 @@ var _components = require("@wordpress/components");
|
|
|
22
22
|
/**
|
|
23
23
|
* WordPress dependencies
|
|
24
24
|
*/
|
|
25
|
-
function ActionItemSlot({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
function ActionItemSlot(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
name,
|
|
28
|
+
as: Component = _components.ButtonGroup,
|
|
29
|
+
fillProps = {},
|
|
30
|
+
bubblesVirtually,
|
|
31
|
+
...props
|
|
32
|
+
} = _ref;
|
|
32
33
|
return (0, _element.createElement)(_components.Slot, {
|
|
33
34
|
name: name,
|
|
34
35
|
bubblesVirtually: bubblesVirtually,
|
|
@@ -45,12 +46,14 @@ function ActionItemSlot({
|
|
|
45
46
|
|
|
46
47
|
const initializedByPlugins = [];
|
|
47
48
|
|
|
48
|
-
_element.Children.forEach(fills,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
_element.Children.forEach(fills, _ref2 => {
|
|
50
|
+
let {
|
|
51
|
+
props: {
|
|
52
|
+
__unstableExplicitMenuItem,
|
|
53
|
+
__unstableTarget
|
|
54
|
+
}
|
|
55
|
+
} = _ref2;
|
|
56
|
+
|
|
54
57
|
if (__unstableTarget && __unstableExplicitMenuItem) {
|
|
55
58
|
initializedByPlugins.push(__unstableTarget);
|
|
56
59
|
}
|
|
@@ -68,22 +71,24 @@ function ActionItemSlot({
|
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
function ActionItem({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
function ActionItem(_ref3) {
|
|
75
|
+
let {
|
|
76
|
+
name,
|
|
77
|
+
as: Component = _components.Button,
|
|
78
|
+
onClick,
|
|
79
|
+
...props
|
|
80
|
+
} = _ref3;
|
|
77
81
|
return (0, _element.createElement)(_components.Fill, {
|
|
78
82
|
name: name
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
}, _ref4 => {
|
|
84
|
+
let {
|
|
85
|
+
onClick: fpOnClick
|
|
86
|
+
} = _ref4;
|
|
82
87
|
return (0, _element.createElement)(Component, (0, _extends2.default)({
|
|
83
|
-
onClick: onClick || fpOnClick ? (
|
|
84
|
-
(onClick || _lodash.noop)(...
|
|
88
|
+
onClick: onClick || fpOnClick ? function () {
|
|
89
|
+
(onClick || _lodash.noop)(...arguments);
|
|
85
90
|
|
|
86
|
-
(fpOnClick || _lodash.noop)(...
|
|
91
|
+
(fpOnClick || _lodash.noop)(...arguments);
|
|
87
92
|
} : undefined
|
|
88
93
|
}, props));
|
|
89
94
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","noop","undefined","Slot"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EAAE,EAAEC,SAAS,GAAGC,uBAFQ;AAGxBC,IAAAA,SAAS,GAAG,EAHY;AAIxBC,IAAAA,gBAJwB;AAKxB,OAAGC;AALqB,GAMrB;AACH,SACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGN,IADR;AAEC,IAAA,gBAAgB,EAAGK,gBAFpB;AAGC,IAAA,SAAS,EAAGD;AAHb,KAKKG,KAAF,IAAa;AACd,QAAK,qBAASC,kBAASC,OAAT,CAAkBF,KAAlB,CAAT,CAAL,EAA4C;AAC3C,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAMG,oBAAoB,GAAG,EAA7B;;AACAF,sBAASG,OAAT,CACCJ,KADD,EAEC,SAEO;AAAA,UAFL;AACDD,QAAAA,KAAK,EAAE;AAAEM,UAAAA,0BAAF;AAA8BC,UAAAA;AAA9B;AADN,OAEK;;AACN,UAAKA,gBAAgB,IAAID,0BAAzB,EAAsD;AACrDF,QAAAA,oBAAoB,CAACI,IAArB,CAA2BD,gBAA3B;AACA;AACD,KARF;;AAUA,UAAME,QAAQ,GAAGP,kBAASQ,GAAT,CAAcT,KAAd,EAAuBU,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACX,KAAN,CAAYM,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACX,KAAN,CAAYO,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;;AAYA,WAAO,4BAAC,SAAD,EAAgBX,KAAhB,EAA0BS,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,QAA2E;AAAA,MAAtD;AAAEnB,IAAAA,IAAF;AAAQC,IAAAA,EAAE,EAAEC,SAAS,GAAGkB,kBAAxB;AAAgCC,IAAAA,OAAhC;AAAyC,OAAGf;AAA5C,GAAsD;AAC1E,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGN;AAAb,KACG,SAA8B;AAAA,QAA5B;AAAEqB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,4BAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIE,YAAb,EAAqB,YAArB;;AACA,SAAED,SAAS,IAAIC,YAAf,EAAuB,YAAvB;AACC,OAJJ,GAKGC;AAPL,OASMlB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDa,UAAU,CAACM,IAAX,GAAkB1B,cAAlB;eAEeoB,U","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( isEmpty( Children.toArray( fills ) ) ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"]}
|
|
@@ -46,20 +46,22 @@ var _store = require("../../store");
|
|
|
46
46
|
/**
|
|
47
47
|
* Internal dependencies
|
|
48
48
|
*/
|
|
49
|
-
function ComplementaryAreaSlot({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
function ComplementaryAreaSlot(_ref) {
|
|
50
|
+
let {
|
|
51
|
+
scope,
|
|
52
|
+
...props
|
|
53
|
+
} = _ref;
|
|
53
54
|
return (0, _element.createElement)(_components.Slot, (0, _extends2.default)({
|
|
54
55
|
name: `ComplementaryArea/${scope}`
|
|
55
56
|
}, props));
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
function ComplementaryAreaFill({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
function ComplementaryAreaFill(_ref2) {
|
|
60
|
+
let {
|
|
61
|
+
scope,
|
|
62
|
+
children,
|
|
63
|
+
className
|
|
64
|
+
} = _ref2;
|
|
63
65
|
return (0, _element.createElement)(_components.Fill, {
|
|
64
66
|
name: `ComplementaryArea/${scope}`
|
|
65
67
|
}, (0, _element.createElement)("div", {
|
|
@@ -100,24 +102,25 @@ function useAdjustComplementaryListener(scope, identifier, activeArea, isActive,
|
|
|
100
102
|
}, [isActive, isSmall, scope, identifier, activeArea]);
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
function ComplementaryArea({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
function ComplementaryArea(_ref3) {
|
|
106
|
+
let {
|
|
107
|
+
children,
|
|
108
|
+
className,
|
|
109
|
+
closeLabel = (0, _i18n.__)('Close plugin'),
|
|
110
|
+
identifier,
|
|
111
|
+
header,
|
|
112
|
+
headerClassName,
|
|
113
|
+
icon,
|
|
114
|
+
isPinnable = true,
|
|
115
|
+
panelClassName,
|
|
116
|
+
scope,
|
|
117
|
+
name,
|
|
118
|
+
smallScreenTitle,
|
|
119
|
+
title,
|
|
120
|
+
toggleShortcut,
|
|
121
|
+
isActiveByDefault,
|
|
122
|
+
showIconLabels = false
|
|
123
|
+
} = _ref3;
|
|
121
124
|
const {
|
|
122
125
|
isActive,
|
|
123
126
|
isPinned,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","starFilled","starEmpty","ComplementaryAreaWrapped","Slot"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,qBAAT,CAAgC;AAAEC,EAAAA,KAAF;AAAS,KAAGC;AAAZ,CAAhC,EAAsD;AACrD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBD,KAAO;AAA1C,KAAmDC,KAAnD,EAAP;AACA;;AAED,SAASC,qBAAT,CAAgC;AAAEF,EAAAA,KAAF;AAASG,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAAhC,EAAiE;AAChE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBJ,KAAO;AAA1C,KACC;AAAK,IAAA,SAAS,EAAGI;AAAjB,KAA+BD,QAA/B,CADD,CADD;AAKA;;AAED,SAASE,8BAAT,CACCL,KADD,EAECM,UAFD,E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UADY;AAEnByB,MAAAA,QAAQ,EAAEhB,cAFS;AAGnB1B,MAAAA,KAHmB;AAInBM,MAAAA;AAJmB;AALrB,KAYGY,MAAM,IACP,qDACC,4CAAUO,KAAV,CADD,EAEGJ,UAAU,IACX,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EACHQ,QAAQ,GAAGc,iBAAH,GAAgBC,gBAH1B;AAKC,IAAA,KAAK,EACJf,QAAQ,GACL,cAAI,oBAAJ,CADK,GAEL,cAAI,gBAAJ,CARL;AAUC,IAAA,OAAO,EAAG,MACT,CAAEA,QAAQ,GAAGS,SAAH,GAAeD,OAAzB,EACCrC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGuB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,4BAAC,iBAAD;AAAO,IAAA,SAAS,EAAGP;AAAnB,KAAsCnB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAM0C,wBAAwB,GAAG,uCAChC7B,iBADgC,CAAjC;AAIA6B,wBAAwB,CAACC,IAAzB,GAAgC/C,qBAAhC;eAEe8C,wB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be enabled when we go from small to big window size\n\t\t\t// and we are going from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be reopened but another complementary area becomes active,\n\t\t\t// remove the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [ isActive, isSmall, scope, identifier, activeArea ] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } = select(\n\t\t\t\tinterfaceStore\n\t\t\t);\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header || (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<strong>{ title }</strong>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped = withComplementaryAreaContext(\n\tComplementaryArea\n);\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","starFilled","starEmpty","ComplementaryAreaWrapped","Slot"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,qBAAT,OAAsD;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAAsB;AACrD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBD,KAAO;AAA1C,KAAmDC,KAAnD,EAAP;AACA;;AAED,SAASC,qBAAT,QAAiE;AAAA,MAAjC;AAAEF,IAAAA,KAAF;AAASG,IAAAA,QAAT;AAAmBC,IAAAA;AAAnB,GAAiC;AAChE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBJ,KAAO;AAA1C,KACC;AAAK,IAAA,SAAS,EAAGI;AAAjB,KAA+BD,QAA/B,CADD,CADD;AAKA;;AAED,SAASE,8BAAT,CACCL,KADD,EAECM,UAFD,EAGCC,UAHD,EAICC,QAJD,EAKCC,OALD,EAME;AACD,QAAMC,eAAe,GAAG,qBAAQ,KAAR,CAAxB;AACA,QAAMC,sBAAsB,GAAG,qBAAQ,KAAR,CAA/B;AACA,QAAM;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DC,YAD6D,CAA9D;AAGA,0BAAW,MAAM;AAChB;AACA,QAAKN,QAAQ,IAAIC,OAAZ,IAAuB,CAAEC,eAAe,CAACK,OAA9C,EAAwD;AACvD;AACAF,MAAAA,wBAAwB,CAAEb,KAAF,CAAxB,CAFuD,CAGvD;;AACAW,MAAAA,sBAAsB,CAACI,OAAvB,GAAiC,IAAjC;AACA,KALD,MAKO,KACN;AACA;AACAJ,IAAAA,sBAAsB,CAACI,OAAvB,IACA,CAAEN,OADF,IAEAC,eAAe,CAACK,O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A8CC,4BAAC,iBAAD;AAAO,IAAA,SAAS,EAAGP;AAAnB,KAAsCnB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAM0C,wBAAwB,GAAG,uCAChC7B,iBADgC,CAAjC;AAIA6B,wBAAwB,CAACC,IAAzB,GAAgC/C,qBAAhC;eAEe8C,wB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be enabled when we go from small to big window size\n\t\t\t// and we are going from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be reopened but another complementary area becomes active,\n\t\t\t// remove the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [ isActive, isSmall, scope, identifier, activeArea ] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } = select(\n\t\t\t\tinterfaceStore\n\t\t\t);\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header || (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<strong>{ title }</strong>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped = withComplementaryAreaContext(\n\tComplementaryArea\n);\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
|
|
@@ -28,12 +28,13 @@ var _complementaryAreaToggle = _interopRequireDefault(require("../complementary-
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
const ComplementaryAreaHeader =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const ComplementaryAreaHeader = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
smallScreenTitle,
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
toggleButtonProps
|
|
37
|
+
} = _ref;
|
|
37
38
|
const toggleButton = (0, _element.createElement)(_complementaryAreaToggle.default, (0, _extends2.default)({
|
|
38
39
|
icon: _icons.closeSmall
|
|
39
40
|
}, toggleButtonProps));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","closeSmall"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","closeSmall"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAAG,QAKzB;AAAA,MAL2B;AACjCC,IAAAA,gBADiC;AAEjCC,IAAAA,QAFiC;AAGjCC,IAAAA,SAHiC;AAIjCC,IAAAA;AAJiC,GAK3B;AACN,QAAMC,YAAY,GACjB,4BAAC,gCAAD;AAAyB,IAAA,IAAI,EAAGC;AAAhC,KAAkDF,iBAAlD,EADD;AAGA,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGH,gBAAgB,IACjB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,gBADH,CAFF,EAMGI,YANH,CADD,EASC;AACC,IAAA,SAAS,EAAG,yBACX,0BADW,EAEX,qCAFW,EAGXF,SAHW,CADb;AAMC,IAAA,QAAQ,EAAG,CAAC;AANb,KAQGD,QARH,EASGG,YATH,CATD,CADD;AAuBA,CAhCD;;eAkCeL,uB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<span className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"]}
|
|
@@ -37,12 +37,13 @@ const PluginsMenuItem = props => // Menu item is marked with unstable prop for b
|
|
|
37
37
|
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
38
38
|
(0, _element.createElement)(_components.MenuItem, (0, _lodash.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
|
|
39
39
|
|
|
40
|
-
function ComplementaryAreaMoreMenuItem({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
function ComplementaryAreaMoreMenuItem(_ref) {
|
|
41
|
+
let {
|
|
42
|
+
scope,
|
|
43
|
+
target,
|
|
44
|
+
__unstableExplicitMenuItem,
|
|
45
|
+
...props
|
|
46
|
+
} = _ref;
|
|
46
47
|
return (0, _element.createElement)(_complementaryAreaToggle.default, (0, _extends2.default)({
|
|
47
48
|
as: toggleProps => {
|
|
48
49
|
return (0, _element.createElement)(_actionItem.default, (0, _extends2.default)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","props","ComplementaryAreaMoreMenuItem","scope","target","__unstableExplicitMenuItem","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAKC,KAAF,IACvB;AACA;AACA;AACA,4BAAC,oBAAD,EACM,kBAAMA,KAAN,EAAa,CACjB,4BADiB,EAEjB,kBAFiB,CAAb,CADN,CAJD;;AAYe,SAASC,6BAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","props","ComplementaryAreaMoreMenuItem","scope","target","__unstableExplicitMenuItem","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAKC,KAAF,IACvB;AACA;AACA;AACA,4BAAC,oBAAD,EACM,kBAAMA,KAAN,EAAa,CACjB,4BADiB,EAEjB,kBAFiB,CAAb,CADN,CAJD;;AAYe,SAASC,6BAAT,OAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDC,IAAAA,0BAHsD;AAItD,OAAGJ;AAJmD,GAKnD;AACH,SACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAKK,WAAF,IAAmB;AACvB,aACC,4BAAC,mBAAD;AACC,QAAA,0BAA0B,EACzBD,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGF,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGJ,eALN;AAMC,QAAA,IAAI,EAAI,GAAGG,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGC,YAfhB;AAgBC,IAAA,IAAI,EAAGH,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBMF,KAlBN,EADD;AAsBA","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( props ) => (\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t<MenuItem\n\t\t{ ...omit( props, [\n\t\t\t'__unstableExplicitMenuItem',\n\t\t\t'__unstableTarget',\n\t\t] ) }\n\t/>\n);\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -32,14 +32,15 @@ var _complementaryAreaContext = _interopRequireDefault(require("../complementary
|
|
|
32
32
|
/**
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
|
-
function ComplementaryAreaToggle({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
function ComplementaryAreaToggle(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
as = _components.Button,
|
|
38
|
+
scope,
|
|
39
|
+
identifier,
|
|
40
|
+
icon,
|
|
41
|
+
selectedIcon,
|
|
42
|
+
...props
|
|
43
|
+
} = _ref;
|
|
43
44
|
const ComponentToUse = as;
|
|
44
45
|
const isSelected = (0, _data.useSelect)(select => select(_store.store).getActiveComplementaryArea(scope) === identifier, [identifier]);
|
|
45
46
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,OAOI;AAAA,MAP8B;AACjCC,IAAAA,EAAE,GAAGC,kBAD4B;AAEjCC,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjC,OAAGC;AAN8B,GAO9B;AACH,QAAMC,cAAc,GAAGP,EAAvB;AACA,QAAMQ,UAAU,GAAG,qBAChBC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,0BAAzB,CAAqDT,KAArD,MACAC,UAHiB,EAIlB,CAAEA,UAAF,CAJkB,CAAnB;AAMA,QAAM;AAAES,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DH,YAD6D,CAA9D;AAGA,SACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGL,YAAY,IAAIG,UAAhB,GAA6BH,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKI,UAAL,EAAkB;AACjBK,QAAAA,wBAAwB,CAAEX,KAAF,CAAxB;AACA,OAFD,MAEO;AACNU,QAAAA,uBAAuB,CAAEV,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASM,kBAAMG,KAAN,EAAa,CAAE,MAAF,CAAb,CATN,EADD;AAaA;;eAEc,uCAA0BP,uBAA1B,C","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...omit( props, [ 'name' ] ) }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"]}
|
|
@@ -10,9 +10,10 @@ var _element = require("@wordpress/element");
|
|
|
10
10
|
/**
|
|
11
11
|
* WordPress dependencies
|
|
12
12
|
*/
|
|
13
|
-
const FullscreenMode =
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const FullscreenMode = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
isActive
|
|
16
|
+
} = _ref;
|
|
16
17
|
(0, _element.useEffect)(() => {
|
|
17
18
|
let isSticky = false; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
|
|
18
19
|
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC1C,0BAAW,MAAM;AAChB,QAAIC,QAAQ,GAAG,KAAf,CADgB,CAEhB;AACA;AACA;AACA;;AACA,QAAKC,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBC,QAAxB,CAAkC,aAAlC,CAAL,EAAyD;AACxDJ,MAAAA,QAAQ,GAAG,IAAX;AACAC,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,aAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKL,QAAL,EAAgB;AACfC,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,aAA7B;AACA;AACD,KAJD;AAKA,GAhBD,EAgBG,EAhBH;AAkBA,0BAAW,MAAM;AAChB,QAAKP,QAAL,EAAgB;AACfE,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,oBAA7B;AACA,KAFD,MAEO;AACNL,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfE,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;AACD,KAJD;AAKA,GAZD,EAYG,CAAEN,QAAF,CAZH;AAcA,SAAO,IAAP;AACA,CAlCD;;eAmCeD,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"]}
|
|
@@ -5,6 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
Object.defineProperty(exports, "ActionItem", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _actionItem.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
Object.defineProperty(exports, "ComplementaryArea", {
|
|
9
15
|
enumerable: true,
|
|
10
16
|
get: function () {
|
|
@@ -29,12 +35,6 @@ Object.defineProperty(exports, "InterfaceSkeleton", {
|
|
|
29
35
|
return _interfaceSkeleton.default;
|
|
30
36
|
}
|
|
31
37
|
});
|
|
32
|
-
Object.defineProperty(exports, "PinnedItems", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _pinnedItems.default;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
38
|
Object.defineProperty(exports, "MoreMenuDropdown", {
|
|
39
39
|
enumerable: true,
|
|
40
40
|
get: function () {
|
|
@@ -47,10 +47,10 @@ Object.defineProperty(exports, "MoreMenuFeatureToggle", {
|
|
|
47
47
|
return _moreMenuFeatureToggle.default;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
Object.defineProperty(exports, "
|
|
50
|
+
Object.defineProperty(exports, "PinnedItems", {
|
|
51
51
|
enumerable: true,
|
|
52
52
|
get: function () {
|
|
53
|
-
return
|
|
53
|
+
return _pinnedItems.default;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -45,19 +45,20 @@ function useHTMLClass(className) {
|
|
|
45
45
|
}, [className]);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function InterfaceSkeleton({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
function InterfaceSkeleton(_ref, ref) {
|
|
49
|
+
let {
|
|
50
|
+
footer,
|
|
51
|
+
header,
|
|
52
|
+
sidebar,
|
|
53
|
+
secondarySidebar,
|
|
54
|
+
notices,
|
|
55
|
+
content,
|
|
56
|
+
drawer,
|
|
57
|
+
actions,
|
|
58
|
+
labels,
|
|
59
|
+
className,
|
|
60
|
+
shortcuts
|
|
61
|
+
} = _ref;
|
|
61
62
|
const navigateRegionsProps = (0, _components.__unstableUseNavigateRegions)(shortcuts);
|
|
62
63
|
useHTMLClass('interface-interface-skeleton__html-container');
|
|
63
64
|
const defaultLabels = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","footer","header","sidebar","secondarySidebar","notices","content","drawer","actions","labels","shortcuts","
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","ref","footer","header","sidebar","secondarySidebar","notices","content","drawer","actions","labels","shortcuts","navigateRegionsProps","defaultLabels","body","mergedLabels"],"mappings":";;;;;;;;;AAWA;;;;AARA;;AASA;;AACA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AACA;AACA;AACA;AAMA,SAASA,YAAT,CAAuBC,SAAvB,EAAmC;AAClC,0BAAW,MAAM;AAChB,UAAMC,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAT,CAAyB,aAAaH,SAAW,GAAjD,CADb;;AAEA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,WAAO,MAAM;AACZC,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,KAFD;AAGA,GAVD,EAUG,CAAEA,SAAF,CAVH;AAWA;;AAED,SAASM,iBAAT,OAcCC,GAdD,EAeE;AAAA,MAdD;AACCC,IAAAA,MADD;AAECC,IAAAA,MAFD;AAGCC,IAAAA,OAHD;AAICC,IAAAA,gBAJD;AAKCC,IAAAA,OALD;AAMCC,IAAAA,OAND;AAOCC,IAAAA,MAPD;AAQCC,IAAAA,OARD;AASCC,IAAAA,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f,KACG,CAAC,CAAEE,gBAAH,IACD;AACC,IAAA,SAAS,EAAC,iDADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaU,YAAY,CAACV,gBAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,gBANH,CAFF,EAWG,CAAC,CAAEC,OAAH,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CAZF,EAgBC;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaS,YAAY,CAACD,IAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGP,OANH,CAhBD,EAwBG,CAAC,CAAEH,OAAH,IACD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaW,YAAY,CAACX,OAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,OANH,CAzBF,EAkCG,CAAC,CAAEK,OAAH,IACD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaM,YAAY,CAACN,OAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,OANH,CAnCF,CAXD,CAnBD,EA4EG,CAAC,CAAEP,MAAH,IACD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaa,YAAY,CAACb,MAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,MANH,CA7EF,CADD;AAyFA;;eAEc,yBAAYF,iBAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nfunction InterfaceSkeleton(\n\t{\n\t\tfooter,\n\t\theader,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tdrawer,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the nav bar landmark region. */\n\t\tdrawer: __( 'Drawer' ),\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: __( 'Header' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\treturn (\n\t\t<div\n\t\t\t{ ...navigateRegionsProps }\n\t\t\tref={ useMergeRefs( [ ref, navigateRegionsProps.ref ] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t{ !! drawer && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"interface-interface-skeleton__drawer\"\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label={ mergedLabels.drawer }\n\t\t\t\t>\n\t\t\t\t\t{ drawer }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\taria-label={ mergedLabels.body }\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.sidebar }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.actions }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label={ mergedLabels.footer }\n\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"]}
|
|
@@ -24,16 +24,17 @@ var _icons = require("@wordpress/icons");
|
|
|
24
24
|
/**
|
|
25
25
|
* WordPress dependencies
|
|
26
26
|
*/
|
|
27
|
-
function MoreMenuDropdown({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
function MoreMenuDropdown(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
as: DropdownComponent = _components.DropdownMenu,
|
|
30
|
+
className,
|
|
31
|
+
|
|
32
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
33
|
+
label = (0, _i18n.__)('Options'),
|
|
34
|
+
popoverProps,
|
|
35
|
+
toggleProps,
|
|
36
|
+
children
|
|
37
|
+
} = _ref;
|
|
37
38
|
return (0, _element.createElement)(DropdownComponent, {
|
|
38
39
|
className: (0, _classnames.default)('interface-more-menu-dropdown', className),
|
|
39
40
|
icon: _icons.moreVertical,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","position","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","position","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,OAQX;AAAA,MARsC;AACzCC,IAAAA,EAAE,EAAEC,iBAAiB,GAAGC,wBADiB;AAEzCC,IAAAA,SAFyC;;AAGzC;AACAC,IAAAA,KAAK,GAAG,cAAI,SAAJ,CAJiC;AAKzCC,IAAAA,YALyC;AAMzCC,IAAAA,WANyC;AAOzCC,IAAAA;AAPyC,GAQtC;AACH,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,IAAI,EAAGK,mBALR;AAMC,IAAA,KAAK,EAAGJ,KANT;AAOC,IAAA,YAAY,EAAG;AACdK,MAAAA,QAAQ,EAAE,aADI;AAEd,SAAGJ,YAFW;AAGdF,MAAAA,SAAS,EAAE,yBACV,uCADU,EAEVE,YAFU,aAEVA,YAFU,uBAEVA,YAAY,CAAEF,SAFJ;AAHG,KAPhB;AAeC,IAAA,WAAW,EAAG;AACbO,MAAAA,eAAe,EAAE,QADJ;AAEb,SAAGJ;AAFU;AAff,KAoBKK,OAAF,IAAeJ,QAAQ,CAAEI,OAAF,CApB1B,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { DropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nexport default function MoreMenuDropdown( {\n\tas: DropdownComponent = DropdownMenu,\n\tclassName,\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tlabel = __( 'Options' ),\n\tpopoverProps,\n\ttoggleProps,\n\tchildren,\n} ) {\n\treturn (\n\t\t<DropdownComponent\n\t\t\tclassName={ classnames(\n\t\t\t\t'interface-more-menu-dropdown',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ label }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom left',\n\t\t\t\t...popoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'interface-more-menu-dropdown__content',\n\t\t\t\t\tpopoverProps?.className\n\t\t\t\t),\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t...toggleProps,\n\t\t\t} }\n\t\t>\n\t\t\t{ ( onClose ) => children( onClose ) }\n\t\t</DropdownComponent>\n\t);\n}\n"]}
|
|
@@ -26,15 +26,16 @@ var _store = require("../../store");
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
function MoreMenuFeatureToggle({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
function MoreMenuFeatureToggle(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
scope,
|
|
32
|
+
label,
|
|
33
|
+
info,
|
|
34
|
+
messageActivated,
|
|
35
|
+
messageDeactivated,
|
|
36
|
+
shortcut,
|
|
37
|
+
feature
|
|
38
|
+
} = _ref;
|
|
38
39
|
const isActive = (0, _data.useSelect)(select => select(_store.store).isFeatureActive(scope, feature), [feature]);
|
|
39
40
|
const {
|
|
40
41
|
toggleFeature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,OAQX;AAAA,MAR2C;AAC9CC,IAAAA,KAD8C;AAE9CC,IAAAA,KAF8C;AAG9CC,IAAAA,IAH8C;AAI9CC,IAAAA,gBAJ8C;AAK9CC,IAAAA,kBAL8C;AAM9CC,IAAAA,QAN8C;AAO9CC,IAAAA;AAP8C,GAQ3C;AACH,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,eAAzB,CAA0CV,KAA1C,EAAiDM,OAAjD,CAFe,EAGhB,CAAEA,OAAF,CAHgB,CAAjB;AAKA,QAAM;AAAEK,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;;AACA,QAAMG,YAAY,GAAG,MAAM;AAC1B,QAAKL,QAAL,EAAgB;AACf,uBAAOH,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGI,QAAQ,IAAIM,YADpB;AAEC,IAAA,UAAU,EAAGN,QAFd;AAGC,IAAA,OAAO,EAAG,MAAM;AACfI,MAAAA,aAAa,CAAEX,KAAF,EAASM,OAAT,CAAb;AACAM,MAAAA,YAAY;AACZ,KANF;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGV,IARR;AASC,IAAA,QAAQ,EAAGG;AATZ,KAWGJ,KAXH,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\n\nexport default function MoreMenuFeatureToggle( {\n\tscope,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\tfeature,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isFeatureActive( scope, feature ),\n\t\t[ feature ]\n\t);\n\tconst { toggleFeature } = useDispatch( interfaceStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\ttoggleFeature( scope, feature );\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}
|
|
@@ -24,20 +24,22 @@ var _components = require("@wordpress/components");
|
|
|
24
24
|
/**
|
|
25
25
|
* WordPress dependencies
|
|
26
26
|
*/
|
|
27
|
-
function PinnedItems({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
function PinnedItems(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
scope,
|
|
30
|
+
...props
|
|
31
|
+
} = _ref;
|
|
31
32
|
return (0, _element.createElement)(_components.Fill, (0, _extends2.default)({
|
|
32
33
|
name: `PinnedItems/${scope}`
|
|
33
34
|
}, props));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function PinnedItemsSlot({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
function PinnedItemsSlot(_ref2) {
|
|
38
|
+
let {
|
|
39
|
+
scope,
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
} = _ref2;
|
|
41
43
|
return (0, _element.createElement)(_components.Slot, (0, _extends2.default)({
|
|
42
44
|
name: `PinnedItems/${scope}`
|
|
43
45
|
}, props), fills => !(0, _lodash.isEmpty)(fills) && (0, _element.createElement)("div", {
|