@wordpress/interface 5.32.0 → 5.33.0
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/CHANGELOG.md +2 -0
- package/README.md +10 -10
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +58 -3
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-context/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/interface-skeleton/index.js +36 -2
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +21 -5
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/deprecated.js +42 -0
- package/build/store/deprecated.js.map +1 -0
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +9 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +60 -5
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-context/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +38 -4
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +21 -5
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/deprecated.js +33 -0
- package/build-module/store/deprecated.js.map +1 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +9 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +6 -4
- package/build-style/style.css +6 -4
- package/package.json +14 -14
- package/src/components/complementary-area/README.md +2 -2
- package/src/components/complementary-area/index.js +139 -58
- package/src/components/complementary-area-more-menu-item/README.md +1 -1
- package/src/components/complementary-area-toggle/README.md +1 -1
- package/src/components/interface-skeleton/index.js +50 -10
- package/src/components/interface-skeleton/style.scss +3 -3
- package/src/components/pinned-items/README.md +2 -2
- package/src/store/actions.js +24 -5
- package/src/store/deprecated.js +37 -0
- package/src/store/selectors.js +12 -0
|
@@ -8,14 +8,15 @@ import classnames from 'classnames';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { forwardRef, useEffect } from '@wordpress/element';
|
|
11
|
-
import { __unstableUseNavigateRegions as useNavigateRegions, __unstableMotion as motion } from '@wordpress/components';
|
|
11
|
+
import { __unstableUseNavigateRegions as useNavigateRegions, __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence } from '@wordpress/components';
|
|
12
12
|
import { __, _x } from '@wordpress/i18n';
|
|
13
|
-
import { useMergeRefs } from '@wordpress/compose';
|
|
13
|
+
import { useMergeRefs, useReducedMotion, useViewportMatch, useResizeObserver } from '@wordpress/compose';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
18
|
import NavigableRegion from '../navigable-region';
|
|
19
|
+
const ANIMATION_DURATION = 0.25;
|
|
19
20
|
function useHTMLClass(className) {
|
|
20
21
|
useEffect(() => {
|
|
21
22
|
const element = document && document.querySelector(`html:not(.${className})`);
|
|
@@ -64,6 +65,14 @@ function InterfaceSkeleton({
|
|
|
64
65
|
// Can we use a dependency to keyboard-shortcuts directly?
|
|
65
66
|
shortcuts
|
|
66
67
|
}, ref) {
|
|
68
|
+
const [secondarySidebarResizeListener, secondarySidebarSize] = useResizeObserver();
|
|
69
|
+
const isMobileViewport = useViewportMatch('medium', '<');
|
|
70
|
+
const disableMotion = useReducedMotion();
|
|
71
|
+
const defaultTransition = {
|
|
72
|
+
type: 'tween',
|
|
73
|
+
duration: disableMotion ? 0 : ANIMATION_DURATION,
|
|
74
|
+
ease: [0.6, 0, 0.4, 1]
|
|
75
|
+
};
|
|
67
76
|
const navigateRegionsProps = useNavigateRegions(shortcuts);
|
|
68
77
|
useHTMLClass('interface-interface-skeleton__html-container');
|
|
69
78
|
const defaultLabels = {
|
|
@@ -106,10 +115,35 @@ function InterfaceSkeleton({
|
|
|
106
115
|
className: "interface-interface-skeleton__header"
|
|
107
116
|
}, editorNotices), createElement("div", {
|
|
108
117
|
className: "interface-interface-skeleton__body"
|
|
118
|
+
}, createElement(AnimatePresence, {
|
|
119
|
+
initial: false
|
|
109
120
|
}, !!secondarySidebar && createElement(NavigableRegion, {
|
|
110
121
|
className: "interface-interface-skeleton__secondary-sidebar",
|
|
111
|
-
ariaLabel: mergedLabels.secondarySidebar
|
|
112
|
-
|
|
122
|
+
ariaLabel: mergedLabels.secondarySidebar,
|
|
123
|
+
as: motion.div,
|
|
124
|
+
initial: "closed",
|
|
125
|
+
animate: isMobileViewport ? 'mobileOpen' : 'open',
|
|
126
|
+
exit: "closed",
|
|
127
|
+
variants: {
|
|
128
|
+
open: {
|
|
129
|
+
width: secondarySidebarSize.width
|
|
130
|
+
},
|
|
131
|
+
closed: {
|
|
132
|
+
width: 0
|
|
133
|
+
},
|
|
134
|
+
mobileOpen: {
|
|
135
|
+
width: '100vw'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
transition: defaultTransition
|
|
139
|
+
}, createElement("div", {
|
|
140
|
+
style: {
|
|
141
|
+
position: 'absolute',
|
|
142
|
+
width: 'fit-content',
|
|
143
|
+
height: '100%',
|
|
144
|
+
right: 0
|
|
145
|
+
}
|
|
146
|
+
}, secondarySidebarResizeListener, secondarySidebar))), !!notices && createElement("div", {
|
|
113
147
|
className: "interface-interface-skeleton__notices"
|
|
114
148
|
}, notices), createElement(NavigableRegion, {
|
|
115
149
|
className: "interface-interface-skeleton__content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__unstableMotion","motion","__","_x","useMergeRefs","NavigableRegion","useHTMLClass","className","element","document","querySelector","classList","toggle","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","distractionFreeInactive","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","ref","navigateRegionsProps","defaultLabels","body","mergedLabels","createElement","undefined","as","div","initial","whileHover","animate","variants","ariaLabel"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\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\nconst headerVariants = {\n\thidden: { opacity: 0 },\n\thover: {\n\t\topacity: 1,\n\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t},\n\tdistractionFreeInactive: { opacity: 1, transition: { delay: 0 } },\n};\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\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 top bar landmark region. */\n\t\theader: _x( 'Header', 'header landmark area' ),\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{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\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<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? { type: 'tween', delay: 0.8 }\n\t\t\t\t\t\t\t\t: undefined\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</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\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<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</NavigableRegion>\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<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\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<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SACCC,4BAA4B,IAAIC,kBAAkB,EAClDC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,YAAY,QAAQ,oBAAoB;;AAE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AAC;EAAoC,GAChD,CAAC,CAAEqB,gBAAgB,IACpBY,aAAA,CAACnC,eAAe;IACfE,SAAS,EAAC,iDAAiD;IAC3DyC,SAAS,EAAGT,YAAY,CAACX;EAAkB,GAEzCA,gBACc,CACjB,EACC,CAAC,CAAEC,OAAO,IACXW,aAAA;IAAKjC,SAAS,EAAC;EAAuC,GACnDsB,OACE,CACL,EACDW,aAAA,CAACnC,eAAe;IACfE,SAAS,EAAC,uCAAuC;IACjDyC,SAAS,EAAGT,YAAY,CAACD;EAAM,GAE7BR,OACc,CAAC,EAChB,CAAC,CAAEH,OAAO,IACXa,aAAA,CAACnC,eAAe;IACfE,SAAS,EAAC,uCAAuC;IACjDyC,SAAS,EAAGT,YAAY,CAACZ;EAAS,GAEhCA,OACc,CACjB,EACC,CAAC,CAAEI,OAAO,IACXS,aAAA,CAACnC,eAAe;IACfE,SAAS,EAAC,uCAAuC;IACjDyC,SAAS,EAAGT,YAAY,CAACR;EAAS,GAEhCA,OACc,CAEd,CACD,CAAC,EACJ,CAAC,CAAEP,MAAM,IACVgB,aAAA,CAACnC,eAAe;IACfE,SAAS,EAAC,sCAAsC;IAChDyC,SAAS,EAAGT,YAAY,CAACf;EAAQ,GAE/BA,MACc,CAEd,CAAC;AAER;AAEA,eAAe5B,UAAU,CAAE0B,iBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"names":["classnames","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__","_x","useMergeRefs","useReducedMotion","useViewportMatch","useResizeObserver","NavigableRegion","ANIMATION_DURATION","useHTMLClass","className","element","document","querySelector","classList","toggle","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","distractionFreeInactive","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","ref","secondarySidebarResizeListener","secondarySidebarSize","isMobileViewport","disableMotion","defaultTransition","duration","ease","navigateRegionsProps","defaultLabels","body","mergedLabels","createElement","undefined","as","div","initial","whileHover","animate","variants","ariaLabel","exit","open","width","closed","mobileOpen","style","position","height","right"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tuseMergeRefs,\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nconst ANIMATION_DURATION = 0.25;\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\nconst headerVariants = {\n\thidden: { opacity: 0 },\n\thover: {\n\t\topacity: 1,\n\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t},\n\tdistractionFreeInactive: { opacity: 1, transition: { delay: 0 } },\n};\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst [ secondarySidebarResizeListener, secondarySidebarSize ] =\n\t\tuseResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst disableMotion = useReducedMotion();\n\tconst defaultTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: _x( 'Header', 'header landmark area' ),\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{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\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<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? { type: 'tween', delay: 0.8 }\n\t\t\t\t\t\t\t\t: undefined\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</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\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<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\t\tisMobileViewport ? 'mobileOpen' : 'open'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\topen: { width: secondarySidebarSize.width },\n\t\t\t\t\t\t\t\t\tclosed: { width: 0 },\n\t\t\t\t\t\t\t\t\tmobileOpen: { width: '100vw' },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\twidth: 'fit-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tright: 0,\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\t\t{ secondarySidebarResizeListener }\n\t\t\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\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<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\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<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SACCC,4BAA4B,IAAIC,kBAAkB,EAClDC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,MAAMC,kBAAkB,GAAG,IAAI;AAE/B,SAASC,YAAYA,CAAEC,SAAS,EAAG;EAClChB,SAAS,CAAE,MAAM;IAChB,MAAMiB,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAa,CAAG,aAAaH,SAAW,GAAG,CAAC;IAClE,IAAK,CAAEC,OAAO,EAAG;MAChB;IACD;IACAA,OAAO,CAACG,SAAS,CAACC,MAAM,CAAEL,SAAU,CAAC;IACrC,OAAO,MAAM;MACZC,OAAO,CAACG,SAAS,CAACC,MAAM,CAAEL,SAAU,CAAC;IACtC,CAAC;EACF,CAAC,EAAE,CAAEA,SAAS,CAAG,CAAC;AACnB;AAEA,MAAMM,cAAc,GAAG;EACtBC,MAAM,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAC;EACtBC,KA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AAQ,GAE/BA,MACc,CAEd,CAAC;AAER;AAEA,eAAelC,UAAU,CAAEgC,iBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","NavigableRegion","children","className","ariaLabel","as","Tag","props","createElement","role","tabIndex"],"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nexport default function NavigableRegion( {\n\tchildren,\n\tclassName,\n\tariaLabel,\n\tas: Tag = 'div',\n\t...props\n} ) {\n\treturn (\n\t\t<Tag\n\t\t\tclassName={ classnames( 'interface-navigable-region', className ) }\n\t\t\taria-label={ ariaLabel }\n\t\t\trole=\"region\"\n\t\t\ttabIndex=\"-1\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,eAAe,SAASC,eAAeA,CAAE;EACxCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,EAAE,EAAEC,GAAG,GAAG,KAAK;EACf,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACF,GAAG;IACHH,SAAS,EAAGH,UAAU,CAAE,4BAA4B,EAAEG,SAAU,CAAG;IACnE,cAAaC,SAAW;IACxBK,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,IAAI;IAAA,GACRH;EAAK,GAERL,QACE,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["classnames","NavigableRegion","children","className","ariaLabel","as","Tag","props","createElement","role","tabIndex"],"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nexport default function NavigableRegion( {\n\tchildren,\n\tclassName,\n\tariaLabel,\n\tas: Tag = 'div',\n\t...props\n} ) {\n\treturn (\n\t\t<Tag\n\t\t\tclassName={ classnames( 'interface-navigable-region', className ) }\n\t\t\taria-label={ ariaLabel }\n\t\t\trole=\"region\"\n\t\t\ttabIndex=\"-1\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,eAAe,SAASC,eAAeA,CAAE;EACxCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,EAAE,EAAEC,GAAG,GAAG,KAAK;EACf,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACF,GAAG;IACHH,SAAS,EAAGH,UAAU,CAAE,4BAA4B,EAAEG,SAAU,CAAG;IACnE,cAAaC,SAAW;IACxBK,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,IAAI;IAAA,GACRH;EAAK,GAERL,QACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","Slot","Fill","PinnedItems","scope","props","createElement","name","PinnedItemsSlot","className","fills","length"],"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Slot, Fill } from '@wordpress/components';\n\nfunction PinnedItems( { scope, ...props } ) {\n\treturn <Fill name={ `PinnedItems/${ scope }` } { ...props } />;\n}\n\nfunction PinnedItemsSlot( { scope, className, ...props } ) {\n\treturn (\n\t\t<Slot name={ `PinnedItems/${ scope }` } { ...props }>\n\t\t\t{ ( fills ) =>\n\t\t\t\tfills?.length > 0 && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'interface-pinned-items'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</Slot>\n\t);\n}\n\nPinnedItems.Slot = PinnedItemsSlot;\n\nexport default PinnedItems;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AAElD,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC3C,OAAOC,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAI,eAAeH,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AAC/D;AAEA,SAASG,eAAeA,CAAE;EAAEJ,KAAK;EAAEK,SAAS;EAAE,GAAGJ;AAAM,CAAC,EAAG;EAC1D,OACCC,aAAA,CAACL,IAAI;IAACM,IAAI,EAAI,eAAeH,KAAO,EAAG;IAAA,GAAMC;EAAK,GAC7CK,KAAK,IACRA,KAAK,EAAEC,MAAM,GAAG,CAAC,IAChBL,aAAA;IACCG,SAAS,EAAGT,UAAU,CACrBS,SAAS,EACT,wBACD;EAAG,GAEDC,KACE,CAGF,CAAC;AAET;AAEAP,WAAW,CAACF,IAAI,GAAGO,eAAe;AAElC,eAAeL,WAAW"}
|
|
1
|
+
{"version":3,"names":["classnames","Slot","Fill","PinnedItems","scope","props","createElement","name","PinnedItemsSlot","className","fills","length"],"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Slot, Fill } from '@wordpress/components';\n\nfunction PinnedItems( { scope, ...props } ) {\n\treturn <Fill name={ `PinnedItems/${ scope }` } { ...props } />;\n}\n\nfunction PinnedItemsSlot( { scope, className, ...props } ) {\n\treturn (\n\t\t<Slot name={ `PinnedItems/${ scope }` } { ...props }>\n\t\t\t{ ( fills ) =>\n\t\t\t\tfills?.length > 0 && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'interface-pinned-items'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</Slot>\n\t);\n}\n\nPinnedItems.Slot = PinnedItemsSlot;\n\nexport default PinnedItems;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AAElD,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC3C,OAAOC,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAI,eAAeH,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AAC/D;AAEA,SAASG,eAAeA,CAAE;EAAEJ,KAAK;EAAEK,SAAS;EAAE,GAAGJ;AAAM,CAAC,EAAG;EAC1D,OACCC,aAAA,CAACL,IAAI;IAACM,IAAI,EAAI,eAAeH,KAAO,EAAG;IAAA,GAAMC;EAAK,GAC7CK,KAAK,IACRA,KAAK,EAAEC,MAAM,GAAG,CAAC,IAChBL,aAAA;IACCG,SAAS,EAAGT,UAAU,CACrBS,SAAS,EACT,wBACD;EAAG,GAEDC,KACE,CAGF,CAAC;AAET;AAEAP,WAAW,CAACF,IAAI,GAAGO,eAAe;AAElC,eAAeL,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store"],"sources":["@wordpress/interface/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,SAASA,KAAK,QAAQ,SAAS"}
|
|
1
|
+
{"version":3,"names":["store"],"sources":["@wordpress/interface/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,SAASA,KAAK,QAAQ,SAAS","ignoreList":[]}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
import deprecated from '@wordpress/deprecated';
|
|
5
5
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { normalizeComplementaryAreaScope, normalizeComplementaryAreaName } from './deprecated';
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Set a default complementary area.
|
|
9
14
|
*
|
|
@@ -12,11 +17,15 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
12
17
|
*
|
|
13
18
|
* @return {Object} Action object.
|
|
14
19
|
*/
|
|
15
|
-
export const setDefaultComplementaryArea = (scope, area) =>
|
|
16
|
-
|
|
17
|
-
scope,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
export const setDefaultComplementaryArea = (scope, area) => {
|
|
21
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
22
|
+
area = normalizeComplementaryAreaName(scope, area);
|
|
23
|
+
return {
|
|
24
|
+
type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
|
|
25
|
+
scope,
|
|
26
|
+
area
|
|
27
|
+
};
|
|
28
|
+
};
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
31
|
* Enable the complementary area.
|
|
@@ -32,6 +41,8 @@ export const enableComplementaryArea = (scope, area) => ({
|
|
|
32
41
|
if (!area) {
|
|
33
42
|
return;
|
|
34
43
|
}
|
|
44
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
45
|
+
area = normalizeComplementaryAreaName(scope, area);
|
|
35
46
|
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
36
47
|
if (!isComplementaryAreaVisible) {
|
|
37
48
|
registry.dispatch(preferencesStore).set(scope, 'isComplementaryAreaVisible', true);
|
|
@@ -51,6 +62,7 @@ export const enableComplementaryArea = (scope, area) => ({
|
|
|
51
62
|
export const disableComplementaryArea = scope => ({
|
|
52
63
|
registry
|
|
53
64
|
}) => {
|
|
65
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
54
66
|
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
55
67
|
if (isComplementaryAreaVisible) {
|
|
56
68
|
registry.dispatch(preferencesStore).set(scope, 'isComplementaryAreaVisible', false);
|
|
@@ -72,6 +84,8 @@ export const pinItem = (scope, item) => ({
|
|
|
72
84
|
if (!item) {
|
|
73
85
|
return;
|
|
74
86
|
}
|
|
87
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
88
|
+
item = normalizeComplementaryAreaName(scope, item);
|
|
75
89
|
const pinnedItems = registry.select(preferencesStore).get(scope, 'pinnedItems');
|
|
76
90
|
|
|
77
91
|
// The item is already pinned, there's nothing to do.
|
|
@@ -97,6 +111,8 @@ export const unpinItem = (scope, item) => ({
|
|
|
97
111
|
if (!item) {
|
|
98
112
|
return;
|
|
99
113
|
}
|
|
114
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
115
|
+
item = normalizeComplementaryAreaName(scope, item);
|
|
100
116
|
const pinnedItems = registry.select(preferencesStore).get(scope, 'pinnedItems');
|
|
101
117
|
registry.dispatch(preferencesStore).set(scope, 'pinnedItems', {
|
|
102
118
|
...pinnedItems,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deprecated","store","preferencesStore","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults","openModal","name","closeModal"],"sources":["@wordpress/interface/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAGA,CAAEC,KAAK,EAAEC,IAAI,MAAQ;EAC/DC,IAAI,EAAE,gCAAgC;EACtCF,KAAK;EACLC;AACD,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,uBAAuB,GACnCA,CAAEH,KAAK,EAAEC,IAAI,KACb,CAAE;EAAEG,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B;EACA,IAAK,CAAEJ,IAAI,EAAG;IACb;EACD;EAEA,MAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MAAM,CAAET,gBAAiB,CAAC,CAC1BU,GAAG,CAAER,KAAK,EAAE,4BAA6B,CAAC;EAE5C,IAAK,CAAEM,0BAA0B,EAAG;IACnCF,QAAQ,CACNC,QAAQ,CAAEP,gBAAiB,CAAC,CAC5BW,GAAG,CAAET,KAAK,EAAE,4BAA4B,EAAE,IAAK,CAAC;EACnD;EAEAK,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AiB,CAAC,CAAC0B,WAAW,CAAExB,KAAK,EAAEuB,QAAS,CAAC;EACrE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,SAASA,CAAEC,IAAI,EAAG;EACjC,OAAO;IACNxB,IAAI,EAAE,YAAY;IAClBwB;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OAAO;IACNzB,IAAI,EAAE;EACP,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["deprecated","store","preferencesStore","normalizeComplementaryAreaScope","normalizeComplementaryAreaName","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults","openModal","name","closeModal"],"sources":["@wordpress/interface/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tnormalizeComplementaryAreaScope,\n\tnormalizeComplementaryAreaName,\n} from './deprecated';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => {\n\tscope = normalizeComplementaryAreaScope( scope );\n\tarea = normalizeComplementaryAreaName( scope, area );\n\treturn {\n\t\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\t\tscope,\n\t\tarea,\n\t};\n};\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tarea = normalizeComplementaryAreaName( scope, area );\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SACCC,+BAA+B,EAC/BC,8BAA8B,QACxB,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAGA,CAAEC,KAAK,EAAEC,IAAI,KAAM;EAC7DD,KAAK,GAAGH,+BAA+B,CAAEG,KAAM,CAAC;EAChDC,IAAI,GAAGH,8BAA8B,CAAEE,KAAK,EAAEC,IAAK,CAAC;EACpD,OAAO;IACNC,IAAI,EAAE,gCAAgC;IACtCF,KAAK;IACLC;EACD,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,uBAAuB,GACnCA,CAAEH,KAAK,EAAEC,IAAI,KACb,CAAE;EAAEG,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B;EACA,IAAK,CAAEJ,IAAI,EAAG;IACb;EACD;EACAD,KAAK,GAAGH,+BAA+B,CAAEG,KAAM,CAAC;EAChDC,IAAI,GAAGH,8BAA8B,CAAEE,KAAK,EAAEC,IA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,OAAO,UAAW;IAAEjB;EAAS,CAAC,EAAG;IAChCV,UAAU,CAAG,8CAA6C,EAAE;MAC3DuB,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG;IACf,CAAE,CAAC;IAEHd,QAAQ,CACNC,QAAQ,CAAET,gBAAiB,CAAC,CAC5Ba,GAAG,CAAET,KAAK,EAAEgB,WAAW,EAAE,CAAC,CAAEK,KAAM,CAAC;EACtC,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAEtB,KAAK,EAAEuB,QAAQ,EAAG;EACrD,OAAO,UAAW;IAAEnB;EAAS,CAAC,EAAG;IAChCV,UAAU,CAAG,iDAAgD,EAAE;MAC9DuB,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG;IACf,CAAE,CAAC;IAEHd,QAAQ,CAACC,QAAQ,CAAET,gBAAiB,CAAC,CAAC4B,WAAW,CAAExB,KAAK,EAAEuB,QAAS,CAAC;EACrE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,SAASA,CAAEC,IAAI,EAAG;EACjC,OAAO;IACNxB,IAAI,EAAE,YAAY;IAClBwB;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OAAO;IACNzB,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["STORE_NAME"],"sources":["@wordpress/interface/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/interface';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["STORE_NAME"],"sources":["@wordpress/interface/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/interface';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
|
+
export function normalizeComplementaryAreaScope(scope) {
|
|
6
|
+
if (['core/edit-post', 'core/edit-site'].includes(scope)) {
|
|
7
|
+
deprecated(`${scope} interface scope`, {
|
|
8
|
+
alternative: 'core interface scope',
|
|
9
|
+
hint: 'core/edit-post and core/edit-site are merging.',
|
|
10
|
+
version: '6.6'
|
|
11
|
+
});
|
|
12
|
+
return 'core';
|
|
13
|
+
}
|
|
14
|
+
return scope;
|
|
15
|
+
}
|
|
16
|
+
export function normalizeComplementaryAreaName(scope, name) {
|
|
17
|
+
if (scope === 'core' && name === 'edit-site/template') {
|
|
18
|
+
deprecated(`edit-site/template sidebar`, {
|
|
19
|
+
alternative: 'edit-post/document',
|
|
20
|
+
version: '6.6'
|
|
21
|
+
});
|
|
22
|
+
return 'edit-post/document';
|
|
23
|
+
}
|
|
24
|
+
if (scope === 'core' && name === 'edit-site/block-inspector') {
|
|
25
|
+
deprecated(`edit-site/block-inspector sidebar`, {
|
|
26
|
+
alternative: 'edit-post/block',
|
|
27
|
+
version: '6.6'
|
|
28
|
+
});
|
|
29
|
+
return 'edit-post/block';
|
|
30
|
+
}
|
|
31
|
+
return name;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["deprecated","normalizeComplementaryAreaScope","scope","includes","alternative","hint","version","normalizeComplementaryAreaName","name"],"sources":["@wordpress/interface/src/store/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport function normalizeComplementaryAreaScope( scope ) {\n\tif ( [ 'core/edit-post', 'core/edit-site' ].includes( scope ) ) {\n\t\tdeprecated( `${ scope } interface scope`, {\n\t\t\talternative: 'core interface scope',\n\t\t\thint: 'core/edit-post and core/edit-site are merging.',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'core';\n\t}\n\n\treturn scope;\n}\n\nexport function normalizeComplementaryAreaName( scope, name ) {\n\tif ( scope === 'core' && name === 'edit-site/template' ) {\n\t\tdeprecated( `edit-site/template sidebar`, {\n\t\t\talternative: 'edit-post/document',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'edit-post/document';\n\t}\n\n\tif ( scope === 'core' && name === 'edit-site/block-inspector' ) {\n\t\tdeprecated( `edit-site/block-inspector sidebar`, {\n\t\t\talternative: 'edit-post/block',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'edit-post/block';\n\t}\n\n\treturn name;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAE9C,OAAO,SAASC,+BAA+BA,CAAEC,KAAK,EAAG;EACxD,IAAK,CAAE,gBAAgB,EAAE,gBAAgB,CAAE,CAACC,QAAQ,CAAED,KAAM,CAAC,EAAG;IAC/DF,UAAU,CAAG,GAAGE,KAAO,kBAAiB,EAAE;MACzCE,WAAW,EAAE,sBAAsB;MACnCC,IAAI,EAAE,gDAAgD;MACtDC,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,MAAM;EACd;EAEA,OAAOJ,KAAK;AACb;AAEA,OAAO,SAASK,8BAA8BA,CAAEL,KAAK,EAAEM,IAAI,EAAG;EAC7D,IAAKN,KAAK,KAAK,MAAM,IAAIM,IAAI,KAAK,oBAAoB,EAAG;IACxDR,UAAU,CAAG,4BAA2B,EAAE;MACzCI,WAAW,EAAE,oBAAoB;MACjCE,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,oBAAoB;EAC5B;EAEA,IAAKJ,KAAK,KAAK,MAAM,IAAIM,IAAI,KAAK,2BAA2B,EAAG;IAC/DR,UAAU,CAAG,mCAAkC,EAAE;MAChDI,WAAW,EAAE,iBAAiB;MAC9BE,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,iBAAiB;EACzB;EAEA,OAAOE,IAAI;AACZ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createReduxStore","register","actions","selectors","reducer","STORE_NAME","store"],"sources":["@wordpress/interface/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport reducer from './reducer';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAOC,OAAO,MAAM,WAAW;AAC/B,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAU,EAAE;EAClDD,OAAO;EACPF,OAAO;EACPC;AACD,CAAE,CAAC;;AAEH;AACA;AACAF,QAAQ,CAAEK,KAAM,CAAC"}
|
|
1
|
+
{"version":3,"names":["createReduxStore","register","actions","selectors","reducer","STORE_NAME","store"],"sources":["@wordpress/interface/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport reducer from './reducer';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAOC,OAAO,MAAM,WAAW;AAC/B,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAU,EAAE;EAClDD,OAAO;EACPF,OAAO;EACPC;AACD,CAAE,CAAC;;AAEH;AACA;AACAF,QAAQ,CAAEK,KAAM,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["combineReducers","complementaryAreas","state","action","type","scope","area","activeModal","name"],"sources":["@wordpress/interface/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACxD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,gCAAgC;MAAE;QACtC,MAAM;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;;QAE9B;QACA,IAAKD,KAAK,CAAEG,KAAK,CAAE,EAAG;UACrB,OAAOH,KAAK;QACb;QAEA,OAAO;UACN,GAAGA,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;IACA,KAAK,2BAA2B;MAAE;QACjC,MAAM;UAAED,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;QAC9B,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;EACD;EAEA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,WAAWA,CAAEL,KAAK,GAAG,IAAI,EAAEC,MAAM,EAAG;EACnD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,YAAY;MAChB,OAAOD,MAAM,CAACK,IAAI;IACnB,KAAK,aAAa;MACjB,OAAO,IAAI;EACb;EAEA,OAAON,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,kBAAkB;EAClBM;AACD,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["combineReducers","complementaryAreas","state","action","type","scope","area","activeModal","name"],"sources":["@wordpress/interface/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACxD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,gCAAgC;MAAE;QACtC,MAAM;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;;QAE9B;QACA,IAAKD,KAAK,CAAEG,KAAK,CAAE,EAAG;UACrB,OAAOH,KAAK;QACb;QAEA,OAAO;UACN,GAAGA,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;IACA,KAAK,2BAA2B;MAAE;QACjC,MAAM;UAAED,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;QAC9B,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;EACD;EAEA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,WAAWA,CAAEL,KAAK,GAAG,IAAI,EAAEC,MAAM,EAAG;EACnD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,YAAY;MAChB,OAAOD,MAAM,CAACK,IAAI;IACnB,KAAK,aAAa;MACjB,OAAO,IAAI;EACb;EAEA,OAAON,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,kBAAkB;EAClBM;AACD,CAAE,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,11 @@ import { createRegistrySelector } from '@wordpress/data';
|
|
|
5
5
|
import deprecated from '@wordpress/deprecated';
|
|
6
6
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { normalizeComplementaryAreaScope, normalizeComplementaryAreaName } from './deprecated';
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* Returns the complementary area that is active in a given scope.
|
|
10
15
|
*
|
|
@@ -14,6 +19,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
14
19
|
* @return {string | null | undefined} The complementary area that is active in the given scope.
|
|
15
20
|
*/
|
|
16
21
|
export const getActiveComplementaryArea = createRegistrySelector(select => (state, scope) => {
|
|
22
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
17
23
|
const isComplementaryAreaVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
18
24
|
|
|
19
25
|
// Return `undefined` to indicate that the user has never toggled
|
|
@@ -30,6 +36,7 @@ export const getActiveComplementaryArea = createRegistrySelector(select => (stat
|
|
|
30
36
|
return state?.complementaryAreas?.[scope];
|
|
31
37
|
});
|
|
32
38
|
export const isComplementaryAreaLoading = createRegistrySelector(select => (state, scope) => {
|
|
39
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
33
40
|
const isVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
34
41
|
const identifier = state?.complementaryAreas?.[scope];
|
|
35
42
|
return isVisible && identifier === undefined;
|
|
@@ -46,6 +53,8 @@ export const isComplementaryAreaLoading = createRegistrySelector(select => (stat
|
|
|
46
53
|
*/
|
|
47
54
|
export const isItemPinned = createRegistrySelector(select => (state, scope, item) => {
|
|
48
55
|
var _pinnedItems$item;
|
|
56
|
+
scope = normalizeComplementaryAreaScope(scope);
|
|
57
|
+
item = normalizeComplementaryAreaName(scope, item);
|
|
49
58
|
const pinnedItems = select(preferencesStore).get(scope, 'pinnedItems');
|
|
50
59
|
return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
|
|
51
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRegistrySelector","deprecated","store","preferencesStore","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","_pinnedItems$item","pinnedItems","isFeatureActive","featureName","since","alternative","isModalActive","modalName","activeModal"],"sources":["@wordpress/interface/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,
|
|
1
|
+
{"version":3,"names":["createRegistrySelector","deprecated","store","preferencesStore","normalizeComplementaryAreaScope","normalizeComplementaryAreaName","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","_pinnedItems$item","pinnedItems","isFeatureActive","featureName","since","alternative","isModalActive","modalName","activeModal"],"sources":["@wordpress/interface/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tnormalizeComplementaryAreaScope,\n\tnormalizeComplementaryAreaName,\n} from './deprecated';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SACCC,+BAA+B,EAC/BC,8BAA8B,QACxB,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAGN,sBAAsB,CAC7DO,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,KAAM;EACjCA,KAAK,GAAGL,+BAA+B,CAAEK,KAAM,CAAC;EAChD,MAAMC,0BAA0B,GAAGH,MAAM,CAAEJ,gBAAiB,CAAC,CAACQ,GAAG,CAChEF,KAAK,EACL,4BACD,CAAC;;EAED;EACA;EACA;EACA,IAAKC,0BAA0B,KAAKE,SAAS,EAAG;IAC/C,OAAOA,SAAS;EACjB;;EAEA;EACA,IAAKF,0BAA0B,KAAK,KAAK,EAAG;IAC3C,OAAO,IAAI;EACZ;EAEA,OAAOF,KAAK,EAAEK,kBAAkB,GAAIJ,KAAK,CAAE;AAC5C,CACD,CAAC;AAED,OAAO,MAAMK,0BAA0B,GAAGd,sBAAsB,CAC7DO,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,KAAM;EACjCA,KAAK,GAAGL,+BAA+B,CAAEK,KAAM,CAAC;EAChD,MAAMM,SAAS,GAAGR,MAAM,CAAEJ,gBAAiB,CAAC,CAACQ,GAAG,CAC/CF,KAAK,EACL,4BACD,CAAC;EACD,MAAMO,UAAU,GAAGR,KAAK,EAAEK,kBAAkB,GAAIJ,KAAK,CAAE;EAEvD,OAAOM,SAAS,IAAIC,UAAU,KAAKJ,SAAS;AAC7C,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,YAAY,GAAGjB,sBAAsB,CAC/CO,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAES,IAAI,KAAM;EAAA,IAAAC,iBAAA;EACvCV,KAAK,GAAGL,+BAA+B,CAAEK,KAAM,CAAC;EAChDS,IAAI,GAAGb,8BAA8B,CAAEI,KAAK,EAAES,IAAK,CAAC;EACpD,MAAME,WAAW,GAAGb,MAAM,CAAEJ,gBAAiB,CAAC,CAACQ,GAAG,CACjDF,KAAK,EACL,aACD,CAAC;EACD,QAAAU,iBAAA,GAAOC,WAAW,GAAIF,IAAI,CAAE,cAAAC,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AACrC,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,eAAe,GAAGrB,sBAAsB,CAClDO,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAEa,WAAW,KAAM;EAC9CrB,UAAU,CACR,kEAAiE,EAClE;IACCsB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CACD,CAAC;EAED,OAAO,CAAC,CAAEjB,MAAM,CAAEJ,gBAAiB,CAAC,CAACQ,GAAG,CAAEF,KAAK,EAAEa,WAAY,CAAC;AAC/D,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,aAAaA,CAAEjB,KAAK,EAAEkB,SAAS,EAAG;EACjD,OAAOlB,KAAK,CAACmB,WAAW,KAAKD,SAAS;AACvC","ignoreList":[]}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
--wp-admin-border-width-focus: 2px;
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
|
-
--wp-bound-block-color:
|
|
99
|
+
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
100
100
|
}
|
|
101
101
|
@media (min-resolution: 192dpi) {
|
|
102
102
|
:root {
|
|
@@ -337,17 +337,16 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
337
337
|
position: absolute;
|
|
338
338
|
z-index: 100000;
|
|
339
339
|
top: 0;
|
|
340
|
-
left: 0;
|
|
341
|
-
bottom: 0;
|
|
342
340
|
right: 0;
|
|
341
|
+
bottom: 0;
|
|
343
342
|
background: #fff;
|
|
344
343
|
color: #1e1e1e;
|
|
344
|
+
width: auto;
|
|
345
345
|
}
|
|
346
346
|
@media (min-width: 782px) {
|
|
347
347
|
.interface-interface-skeleton__secondary-sidebar,
|
|
348
348
|
.interface-interface-skeleton__sidebar {
|
|
349
349
|
position: relative !important;
|
|
350
|
-
width: auto;
|
|
351
350
|
}
|
|
352
351
|
.is-sidebar-opened .interface-interface-skeleton__secondary-sidebar,
|
|
353
352
|
.is-sidebar-opened .interface-interface-skeleton__sidebar {
|
|
@@ -364,6 +363,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
364
363
|
}
|
|
365
364
|
}
|
|
366
365
|
|
|
366
|
+
.interface-interface-skeleton__secondary-sidebar {
|
|
367
|
+
left: 0;
|
|
368
|
+
}
|
|
367
369
|
@media (min-width: 782px) {
|
|
368
370
|
.interface-interface-skeleton__secondary-sidebar {
|
|
369
371
|
border-left: 1px solid #e0e0e0;
|
package/build-style/style.css
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
--wp-admin-border-width-focus: 2px;
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
|
-
--wp-bound-block-color:
|
|
99
|
+
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
100
100
|
}
|
|
101
101
|
@media (min-resolution: 192dpi) {
|
|
102
102
|
:root {
|
|
@@ -337,17 +337,16 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
337
337
|
position: absolute;
|
|
338
338
|
z-index: 100000;
|
|
339
339
|
top: 0;
|
|
340
|
-
right: 0;
|
|
341
|
-
bottom: 0;
|
|
342
340
|
left: 0;
|
|
341
|
+
bottom: 0;
|
|
343
342
|
background: #fff;
|
|
344
343
|
color: #1e1e1e;
|
|
344
|
+
width: auto;
|
|
345
345
|
}
|
|
346
346
|
@media (min-width: 782px) {
|
|
347
347
|
.interface-interface-skeleton__secondary-sidebar,
|
|
348
348
|
.interface-interface-skeleton__sidebar {
|
|
349
349
|
position: relative !important;
|
|
350
|
-
width: auto;
|
|
351
350
|
}
|
|
352
351
|
.is-sidebar-opened .interface-interface-skeleton__secondary-sidebar,
|
|
353
352
|
.is-sidebar-opened .interface-interface-skeleton__sidebar {
|
|
@@ -364,6 +363,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
364
363
|
}
|
|
365
364
|
}
|
|
366
365
|
|
|
366
|
+
.interface-interface-skeleton__secondary-sidebar {
|
|
367
|
+
right: 0;
|
|
368
|
+
}
|
|
367
369
|
@media (min-width: 782px) {
|
|
368
370
|
.interface-interface-skeleton__secondary-sidebar {
|
|
369
371
|
border-right: 1px solid #e0e0e0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.0",
|
|
4
4
|
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^3.
|
|
36
|
-
"@wordpress/components": "^27.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/data": "^9.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/element": "^5.
|
|
41
|
-
"@wordpress/i18n": "^4.
|
|
42
|
-
"@wordpress/icons": "^9.
|
|
43
|
-
"@wordpress/plugins": "^6.
|
|
44
|
-
"@wordpress/preferences": "^3.
|
|
45
|
-
"@wordpress/private-apis": "^0.
|
|
46
|
-
"@wordpress/viewport": "^5.
|
|
35
|
+
"@wordpress/a11y": "^3.56.0",
|
|
36
|
+
"@wordpress/components": "^27.4.0",
|
|
37
|
+
"@wordpress/compose": "^6.33.0",
|
|
38
|
+
"@wordpress/data": "^9.26.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.56.0",
|
|
40
|
+
"@wordpress/element": "^5.33.0",
|
|
41
|
+
"@wordpress/i18n": "^4.56.0",
|
|
42
|
+
"@wordpress/icons": "^9.47.0",
|
|
43
|
+
"@wordpress/plugins": "^6.24.0",
|
|
44
|
+
"@wordpress/preferences": "^3.33.0",
|
|
45
|
+
"@wordpress/private-apis": "^0.38.0",
|
|
46
|
+
"@wordpress/viewport": "^5.33.0",
|
|
47
47
|
"classnames": "^2.3.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "280403b4c1cf6cc2c55a6c4d56f9ef91145e4191"
|
|
57
57
|
}
|
|
@@ -79,7 +79,7 @@ A className passed to the panel that contains the contents of the sidebar.
|
|
|
79
79
|
|
|
80
80
|
### scope
|
|
81
81
|
|
|
82
|
-
The scope of the complementary area e.g: "core
|
|
82
|
+
The scope of the complementary area e.g: "core", "myplugin/custom-screen-a",
|
|
83
83
|
|
|
84
84
|
- Type: `String`
|
|
85
85
|
- Required: Yes
|
|
@@ -114,7 +114,7 @@ A slot that renders the currently active ComplementaryArea.
|
|
|
114
114
|
|
|
115
115
|
### scope
|
|
116
116
|
|
|
117
|
-
The scope of the complementary area e.g: "core
|
|
117
|
+
The scope of the complementary area e.g: "core", "myplugin/custom-screen-a",
|
|
118
118
|
|
|
119
119
|
- Type: `String`
|
|
120
120
|
- Required: Yes
|