@wordpress/interface 9.17.0 → 9.17.1-next.ff1cebbba.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/build/components/action-item/index.js +68 -66
- package/build/components/action-item/index.js.map +7 -1
- package/build/components/complementary-area/index.js +215 -194
- package/build/components/complementary-area/index.js.map +7 -1
- package/build/components/complementary-area-header/index.js +53 -33
- package/build/components/complementary-area-header/index.js.map +7 -1
- package/build/components/complementary-area-more-menu-item/index.js +60 -39
- package/build/components/complementary-area-more-menu-item/index.js.map +7 -1
- package/build/components/complementary-area-toggle/index.js +61 -50
- package/build/components/complementary-area-toggle/index.js.map +7 -1
- package/build/components/fullscreen-mode/index.js +33 -27
- package/build/components/fullscreen-mode/index.js.map +7 -1
- package/build/components/index.js +52 -55
- package/build/components/index.js.map +7 -1
- package/build/components/interface-skeleton/index.js +156 -132
- package/build/components/interface-skeleton/index.js.map +7 -1
- package/build/components/pinned-items/index.js +48 -39
- package/build/components/pinned-items/index.js.map +7 -1
- package/build/index.js +27 -24
- package/build/index.js.map +7 -1
- package/build/store/actions.js +94 -165
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -12
- package/build/store/constants.js.map +7 -1
- package/build/store/deprecated.js +55 -29
- package/build/store/deprecated.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +49 -51
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +96 -93
- package/build/store/selectors.js.map +7 -1
- package/build-module/components/action-item/index.js +49 -59
- package/build-module/components/action-item/index.js.map +7 -1
- package/build-module/components/complementary-area/index.js +185 -174
- package/build-module/components/complementary-area/index.js.map +7 -1
- package/build-module/components/complementary-area-header/index.js +25 -26
- package/build-module/components/complementary-area-header/index.js.map +7 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +33 -33
- package/build-module/components/complementary-area-more-menu-item/index.js.map +7 -1
- package/build-module/components/complementary-area-toggle/index.js +41 -44
- package/build-module/components/complementary-area-toggle/index.js.map +7 -1
- package/build-module/components/fullscreen-mode/index.js +13 -19
- package/build-module/components/fullscreen-mode/index.js.map +7 -1
- package/build-module/components/index.js +15 -8
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/interface-skeleton/index.js +132 -122
- package/build-module/components/interface-skeleton/index.js.map +7 -1
- package/build-module/components/pinned-items/index.js +20 -32
- package/build-module/components/pinned-items/index.js.map +7 -1
- package/build-module/index.js +6 -3
- package/build-module/index.js.map +7 -1
- package/build-module/store/actions.js +47 -138
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -7
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/deprecated.js +21 -20
- package/build-module/store/deprecated.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +28 -45
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +64 -87
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +87 -85
- package/build-style/style.css +87 -85
- package/package.json +21 -15
- package/src/components/complementary-area/style.scss +5 -0
- package/src/components/complementary-area-header/style.scss +3 -0
- package/src/components/fullscreen-mode/style.scss +3 -0
- package/src/components/index.js +0 -1
- package/src/components/interface-skeleton/index.js +1 -5
- package/src/components/interface-skeleton/style.scss +6 -0
- package/src/components/pinned-items/style.scss +3 -0
- package/src/style.scss +6 -5
- package/build/components/index.native.js +0 -21
- package/build/components/index.native.js.map +0 -1
- package/build/components/navigable-region/index.js +0 -38
- package/build/components/navigable-region/index.js.map +0 -1
- package/build-module/components/index.native.js +0 -3
- package/build-module/components/index.native.js.map +0 -1
- package/build-module/components/navigable-region/index.js +0 -30
- package/build-module/components/navigable-region/index.js.map +0 -1
- package/src/components/navigable-region/README.md +0 -36
- package/src/components/navigable-region/index.js +0 -29
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","forwardRef","useEffect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__","_x","useReducedMotion","useViewportMatch","useResizeObserver","NavigableRegion","jsx","_jsx","jsxs","_jsxs","ANIMATION_DURATION","commonTransition","type","duration","ease","useHTMLClass","className","element","document","querySelector","classList","toggle","headerVariants","hidden","opacity","marginTop","visible","distractionFreeHover","transition","delay","delayChildren","distractionFreeHidden","distractionFreeDisabled","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","content","actions","labels","ref","secondarySidebarResizeListener","secondarySidebarSize","isMobileViewport","disableMotion","defaultTransition","defaultLabels","body","mergedLabels","children","initial","as","div","whileHover","animate","exit","variants","ariaLabel","open","width","closed","style","position","height","left","x"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\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;\nconst commonTransition = {\n\ttype: 'tween',\n\tduration: ANIMATION_DURATION,\n\tease: [ 0.6, 0, 0.4, 1 ],\n};\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: 1, marginTop: -60 },\n\tvisible: { opacity: 1, marginTop: 0 },\n\tdistractionFreeHover: {\n\t\topacity: 1,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.2,\n\t\t\tdelayChildren: 0.2,\n\t\t},\n\t},\n\tdistractionFreeHidden: {\n\t\topacity: 0,\n\t\tmarginTop: -60,\n\t},\n\tdistractionFreeDisabled: {\n\t\topacity: 0,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.8,\n\t\t\tdelayChildren: 0.8,\n\t\t},\n\t},\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\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\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\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: _x( 'Settings', 'settings landmark area' ),\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\tref={ ref }\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\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<AnimatePresence initial={ false }>\n\t\t\t\t\t{ !! header && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHover'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeDisabled'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texit={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ header }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\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=\"open\"\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} }\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<motion.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: isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t\t\t: 'fit-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\t\topen: { x: 0 },\n\t\t\t\t\t\t\t\t\t\tclosed: { x: '-100%' },\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\ttransition={ defaultTransition }\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</motion.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<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,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,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;AAEA,eAAezC,UAAU,CAAEuC,iBAAkB,CAAC","ignoreList":[]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/interface-skeleton/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\nconst ANIMATION_DURATION = 0.25;\nconst commonTransition = {\n\ttype: 'tween',\n\tduration: ANIMATION_DURATION,\n\tease: [ 0.6, 0, 0.4, 1 ],\n};\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: 1, marginTop: -60 },\n\tvisible: { opacity: 1, marginTop: 0 },\n\tdistractionFreeHover: {\n\t\topacity: 1,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.2,\n\t\t\tdelayChildren: 0.2,\n\t\t},\n\t},\n\tdistractionFreeHidden: {\n\t\topacity: 0,\n\t\tmarginTop: -60,\n\t},\n\tdistractionFreeDisabled: {\n\t\topacity: 0,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.8,\n\t\t\tdelayChildren: 0.8,\n\t\t},\n\t},\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\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\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\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: _x( 'Settings', 'settings landmark area' ),\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\tref={ ref }\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\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<AnimatePresence initial={ false }>\n\t\t\t\t\t{ !! header && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHover'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeDisabled'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texit={\n\t\t\t\t\t\t\t\tisDistractionFree && ! isMobileViewport\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ header }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\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=\"open\"\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} }\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<motion.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: isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t\t\t: 'fit-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\t\topen: { x: 0 },\n\t\t\t\t\t\t\t\t\t\tclosed: { x: '-100%' },\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\ttransition={ defaultTransition }\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</motion.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<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"],
|
|
5
|
+
"mappings": "AA4HM,cAoDE,YApDF;AAzHN,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC,SAAS,YAAY,iBAAiB;AACtC;AAAA,EACC,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,OACvB;AACP,SAAS,IAAI,UAAU;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,MAAM,qBAAqB;AAC3B,MAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM,CAAE,KAAK,GAAG,KAAK,CAAE;AACxB;AAEA,SAAS,aAAc,WAAY;AAClC,YAAW,MAAM;AAChB,UAAM,UACL,YAAY,SAAS,cAAe,aAAc,SAAU,GAAI;AACjE,QAAK,CAAE,SAAU;AAChB;AAAA,IACD;AACA,YAAQ,UAAU,OAAQ,SAAU;AACpC,WAAO,MAAM;AACZ,cAAQ,UAAU,OAAQ,SAAU;AAAA,IACrC;AAAA,EACD,GAAG,CAAE,SAAU,CAAE;AAClB;AAEA,MAAM,iBAAiB;AAAA,EACtB,QAAQ,EAAE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;AAAA,gBACH;AAAA;AAAA,YACD,GAEF;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,WAAY,aAAa;AAAA,gBAEvB;AAAA;AAAA,YACH;AAAA,YACE,CAAC,CAAE,WACJ;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,WAAY,aAAa;AAAA,gBAEvB;AAAA;AAAA,YACH;AAAA,YAEC,CAAC,CAAE,WACJ;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,WAAY,aAAa;AAAA,gBAEvB;AAAA;AAAA,YACH;AAAA,aAEF;AAAA,WACD;AAAA,QACE,CAAC,CAAE,UACJ;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,WAAY,aAAa;AAAA,YAEvB;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,6BAAQ,WAAY,iBAAkB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Slot, Fill } from '@wordpress/components';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
function PinnedItems({
|
|
12
|
-
scope,
|
|
13
|
-
...props
|
|
14
|
-
}) {
|
|
15
|
-
return /*#__PURE__*/_jsx(Fill, {
|
|
16
|
-
name: `PinnedItems/${scope}`,
|
|
17
|
-
...props
|
|
18
|
-
});
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Slot, Fill } from "@wordpress/components";
|
|
4
|
+
function PinnedItems({ scope, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Fill, { name: `PinnedItems/${scope}`, ...props });
|
|
19
6
|
}
|
|
20
|
-
function PinnedItemsSlot({
|
|
21
|
-
scope,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
children: fills => fills?.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
29
|
-
className: clsx(className, 'interface-pinned-items'),
|
|
7
|
+
function PinnedItemsSlot({ scope, className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Slot, { name: `PinnedItems/${scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: clsx(
|
|
12
|
+
className,
|
|
13
|
+
"interface-pinned-items"
|
|
14
|
+
),
|
|
30
15
|
children: fills
|
|
31
|
-
}
|
|
32
|
-
});
|
|
16
|
+
}
|
|
17
|
+
) });
|
|
33
18
|
}
|
|
34
19
|
PinnedItems.Slot = PinnedItemsSlot;
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
var pinned_items_default = PinnedItems;
|
|
21
|
+
export {
|
|
22
|
+
pinned_items_default as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/pinned-items/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx(\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"],
|
|
5
|
+
"mappings": "AAWQ;AARR,OAAO,UAAU;AAKjB,SAAS,MAAM,YAAY;AAE3B,SAAS,YAAa,EAAE,OAAO,GAAG,MAAM,GAAI;AAC3C,SAAO,oBAAC,QAAK,MAAO,eAAgB,KAAM,IAAO,GAAG,OAAQ;AAC7D;AAEA,SAAS,gBAAiB,EAAE,OAAO,WAAW,GAAG,MAAM,GAAI;AAC1D,SACC,oBAAC,QAAK,MAAO,eAAgB,KAAM,IAAO,GAAG,OAC1C,WAAE,UACH,OAAO,SAAS,KACf;AAAA,IAAC;AAAA;AAAA,MACA,WAAY;AAAA,QACX;AAAA,QACA;AAAA,MACD;AAAA,MAEE;AAAA;AAAA,EACH,GAGH;AAEF;AAEA,YAAY,OAAO;AAEnB,IAAO,uBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["export * from './components';\nexport { store } from './store';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,SAAS,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,207 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { normalizeComplementaryAreaScope, normalizeComplementaryAreaName } from './deprecated';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Set a default complementary area.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} scope Complementary area scope.
|
|
16
|
-
* @param {string} area Area identifier.
|
|
17
|
-
*
|
|
18
|
-
* @return {Object} Action object.
|
|
19
|
-
*/
|
|
20
|
-
export const setDefaultComplementaryArea = (scope, area) => {
|
|
1
|
+
import deprecated from "@wordpress/deprecated";
|
|
2
|
+
import { store as preferencesStore } from "@wordpress/preferences";
|
|
3
|
+
import {
|
|
4
|
+
normalizeComplementaryAreaScope,
|
|
5
|
+
normalizeComplementaryAreaName
|
|
6
|
+
} from "./deprecated";
|
|
7
|
+
const setDefaultComplementaryArea = (scope, area) => {
|
|
21
8
|
scope = normalizeComplementaryAreaScope(scope);
|
|
22
9
|
area = normalizeComplementaryAreaName(scope, area);
|
|
23
10
|
return {
|
|
24
|
-
type:
|
|
11
|
+
type: "SET_DEFAULT_COMPLEMENTARY_AREA",
|
|
25
12
|
scope,
|
|
26
13
|
area
|
|
27
14
|
};
|
|
28
15
|
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Enable the complementary area.
|
|
32
|
-
*
|
|
33
|
-
* @param {string} scope Complementary area scope.
|
|
34
|
-
* @param {string} area Area identifier.
|
|
35
|
-
*/
|
|
36
|
-
export const enableComplementaryArea = (scope, area) => ({
|
|
37
|
-
registry,
|
|
38
|
-
dispatch
|
|
39
|
-
}) => {
|
|
40
|
-
// Return early if there's no area.
|
|
16
|
+
const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => {
|
|
41
17
|
if (!area) {
|
|
42
18
|
return;
|
|
43
19
|
}
|
|
44
20
|
scope = normalizeComplementaryAreaScope(scope);
|
|
45
21
|
area = normalizeComplementaryAreaName(scope, area);
|
|
46
|
-
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope,
|
|
22
|
+
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope, "isComplementaryAreaVisible");
|
|
47
23
|
if (!isComplementaryAreaVisible) {
|
|
48
|
-
registry.dispatch(preferencesStore).set(scope,
|
|
24
|
+
registry.dispatch(preferencesStore).set(scope, "isComplementaryAreaVisible", true);
|
|
49
25
|
}
|
|
50
26
|
dispatch({
|
|
51
|
-
type:
|
|
27
|
+
type: "ENABLE_COMPLEMENTARY_AREA",
|
|
52
28
|
scope,
|
|
53
29
|
area
|
|
54
30
|
});
|
|
55
31
|
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Disable the complementary area.
|
|
59
|
-
*
|
|
60
|
-
* @param {string} scope Complementary area scope.
|
|
61
|
-
*/
|
|
62
|
-
export const disableComplementaryArea = scope => ({
|
|
63
|
-
registry
|
|
64
|
-
}) => {
|
|
32
|
+
const disableComplementaryArea = (scope) => ({ registry }) => {
|
|
65
33
|
scope = normalizeComplementaryAreaScope(scope);
|
|
66
|
-
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope,
|
|
34
|
+
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope, "isComplementaryAreaVisible");
|
|
67
35
|
if (isComplementaryAreaVisible) {
|
|
68
|
-
registry.dispatch(preferencesStore).set(scope,
|
|
36
|
+
registry.dispatch(preferencesStore).set(scope, "isComplementaryAreaVisible", false);
|
|
69
37
|
}
|
|
70
38
|
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Pins an item.
|
|
74
|
-
*
|
|
75
|
-
* @param {string} scope Item scope.
|
|
76
|
-
* @param {string} item Item identifier.
|
|
77
|
-
*
|
|
78
|
-
* @return {Object} Action object.
|
|
79
|
-
*/
|
|
80
|
-
export const pinItem = (scope, item) => ({
|
|
81
|
-
registry
|
|
82
|
-
}) => {
|
|
83
|
-
// Return early if there's no item.
|
|
39
|
+
const pinItem = (scope, item) => ({ registry }) => {
|
|
84
40
|
if (!item) {
|
|
85
41
|
return;
|
|
86
42
|
}
|
|
87
43
|
scope = normalizeComplementaryAreaScope(scope);
|
|
88
44
|
item = normalizeComplementaryAreaName(scope, item);
|
|
89
|
-
const pinnedItems = registry.select(preferencesStore).get(scope,
|
|
90
|
-
|
|
91
|
-
// The item is already pinned, there's nothing to do.
|
|
45
|
+
const pinnedItems = registry.select(preferencesStore).get(scope, "pinnedItems");
|
|
92
46
|
if (pinnedItems?.[item] === true) {
|
|
93
47
|
return;
|
|
94
48
|
}
|
|
95
|
-
registry.dispatch(preferencesStore).set(scope,
|
|
49
|
+
registry.dispatch(preferencesStore).set(scope, "pinnedItems", {
|
|
96
50
|
...pinnedItems,
|
|
97
51
|
[item]: true
|
|
98
52
|
});
|
|
99
53
|
};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Unpins an item.
|
|
103
|
-
*
|
|
104
|
-
* @param {string} scope Item scope.
|
|
105
|
-
* @param {string} item Item identifier.
|
|
106
|
-
*/
|
|
107
|
-
export const unpinItem = (scope, item) => ({
|
|
108
|
-
registry
|
|
109
|
-
}) => {
|
|
110
|
-
// Return early if there's no item.
|
|
54
|
+
const unpinItem = (scope, item) => ({ registry }) => {
|
|
111
55
|
if (!item) {
|
|
112
56
|
return;
|
|
113
57
|
}
|
|
114
58
|
scope = normalizeComplementaryAreaScope(scope);
|
|
115
59
|
item = normalizeComplementaryAreaName(scope, item);
|
|
116
|
-
const pinnedItems = registry.select(preferencesStore).get(scope,
|
|
117
|
-
registry.dispatch(preferencesStore).set(scope,
|
|
60
|
+
const pinnedItems = registry.select(preferencesStore).get(scope, "pinnedItems");
|
|
61
|
+
registry.dispatch(preferencesStore).set(scope, "pinnedItems", {
|
|
118
62
|
...pinnedItems,
|
|
119
63
|
[item]: false
|
|
120
64
|
});
|
|
121
65
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* Returns an action object used in signalling that a feature should be toggled.
|
|
125
|
-
*
|
|
126
|
-
* @param {string} scope The feature scope (e.g. core/edit-post).
|
|
127
|
-
* @param {string} featureName The feature name.
|
|
128
|
-
*/
|
|
129
|
-
export function toggleFeature(scope, featureName) {
|
|
130
|
-
return function ({
|
|
131
|
-
registry
|
|
132
|
-
}) {
|
|
66
|
+
function toggleFeature(scope, featureName) {
|
|
67
|
+
return function({ registry }) {
|
|
133
68
|
deprecated(`dispatch( 'core/interface' ).toggleFeature`, {
|
|
134
|
-
since:
|
|
69
|
+
since: "6.0",
|
|
135
70
|
alternative: `dispatch( 'core/preferences' ).toggle`
|
|
136
71
|
});
|
|
137
72
|
registry.dispatch(preferencesStore).toggle(scope, featureName);
|
|
138
73
|
};
|
|
139
74
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* Returns an action object used in signalling that a feature should be set to
|
|
143
|
-
* a true or false value
|
|
144
|
-
*
|
|
145
|
-
* @param {string} scope The feature scope (e.g. core/edit-post).
|
|
146
|
-
* @param {string} featureName The feature name.
|
|
147
|
-
* @param {boolean} value The value to set.
|
|
148
|
-
*
|
|
149
|
-
* @return {Object} Action object.
|
|
150
|
-
*/
|
|
151
|
-
export function setFeatureValue(scope, featureName, value) {
|
|
152
|
-
return function ({
|
|
153
|
-
registry
|
|
154
|
-
}) {
|
|
75
|
+
function setFeatureValue(scope, featureName, value) {
|
|
76
|
+
return function({ registry }) {
|
|
155
77
|
deprecated(`dispatch( 'core/interface' ).setFeatureValue`, {
|
|
156
|
-
since:
|
|
78
|
+
since: "6.0",
|
|
157
79
|
alternative: `dispatch( 'core/preferences' ).set`
|
|
158
80
|
});
|
|
159
81
|
registry.dispatch(preferencesStore).set(scope, featureName, !!value);
|
|
160
82
|
};
|
|
161
83
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
* Returns an action object used in signalling that defaults should be set for features.
|
|
165
|
-
*
|
|
166
|
-
* @param {string} scope The feature scope (e.g. core/edit-post).
|
|
167
|
-
* @param {Object<string, boolean>} defaults A key/value map of feature names to values.
|
|
168
|
-
*
|
|
169
|
-
* @return {Object} Action object.
|
|
170
|
-
*/
|
|
171
|
-
export function setFeatureDefaults(scope, defaults) {
|
|
172
|
-
return function ({
|
|
173
|
-
registry
|
|
174
|
-
}) {
|
|
84
|
+
function setFeatureDefaults(scope, defaults) {
|
|
85
|
+
return function({ registry }) {
|
|
175
86
|
deprecated(`dispatch( 'core/interface' ).setFeatureDefaults`, {
|
|
176
|
-
since:
|
|
87
|
+
since: "6.0",
|
|
177
88
|
alternative: `dispatch( 'core/preferences' ).setDefaults`
|
|
178
89
|
});
|
|
179
90
|
registry.dispatch(preferencesStore).setDefaults(scope, defaults);
|
|
180
91
|
};
|
|
181
92
|
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Returns an action object used in signalling that the user opened a modal.
|
|
185
|
-
*
|
|
186
|
-
* @param {string} name A string that uniquely identifies the modal.
|
|
187
|
-
*
|
|
188
|
-
* @return {Object} Action object.
|
|
189
|
-
*/
|
|
190
|
-
export function openModal(name) {
|
|
93
|
+
function openModal(name) {
|
|
191
94
|
return {
|
|
192
|
-
type:
|
|
95
|
+
type: "OPEN_MODAL",
|
|
193
96
|
name
|
|
194
97
|
};
|
|
195
98
|
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Returns an action object signalling that the user closed a modal.
|
|
199
|
-
*
|
|
200
|
-
* @return {Object} Action object.
|
|
201
|
-
*/
|
|
202
|
-
export function closeModal() {
|
|
99
|
+
function closeModal() {
|
|
203
100
|
return {
|
|
204
|
-
type:
|
|
101
|
+
type: "CLOSE_MODAL"
|
|
205
102
|
};
|
|
206
103
|
}
|
|
207
|
-
|
|
104
|
+
export {
|
|
105
|
+
closeModal,
|
|
106
|
+
disableComplementaryArea,
|
|
107
|
+
enableComplementaryArea,
|
|
108
|
+
openModal,
|
|
109
|
+
pinItem,
|
|
110
|
+
setDefaultComplementaryArea,
|
|
111
|
+
setFeatureDefaults,
|
|
112
|
+
setFeatureValue,
|
|
113
|
+
toggleFeature,
|
|
114
|
+
unpinItem
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1,7 @@
|
|
|
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,IAAK,CAAC;EAEpD,MAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MAAM,CAAEX,gBAAiB,CAAC,CAC1BY,GAAG,CAAER,KAAK,EAAE,4BAA6B,CAAC;EAE5C,IAAK,CAAEM,0BAA0B,EAAG;IACnCF,QAAQ,CACNC,QAAQ,CAAET,gBAAiB,CAAC,CAC5Ba,GAAG,CAAET,KAAK,EAAE,4BAA4B,EAAE,IAAK,CAAC;EACnD;EAEAK,QAAQ,CAAE;IACTH,IAAI,EAAE,2BAA2B;IACjCF,KAAK;IACLC;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,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EAAS,CAAC,EAAG;IAChCV,UAAU,CAAE,iDAAiD,EAAE;MAC9DuB,KAAK,EAAE,KAAK;MACZC,WAAW,EAAE;IACd,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
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/actions.js"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": "AAGA,OAAO,gBAAgB;AACvB,SAAS,SAAS,wBAAwB;AAK1C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAUA,MAAM,8BAA8B,CAAE,OAAO,SAAU;AAC7D,UAAQ,gCAAiC,KAAM;AAC/C,SAAO,+BAAgC,OAAO,IAAK;AACnD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAQO,MAAM,0BACZ,CAAE,OAAO,SACT,CAAE,EAAE,UAAU,SAAS,MAAO;AAE7B,MAAK,CAAE,MAAO;AACb;AAAA,EACD;AACA,UAAQ,gCAAiC,KAAM;AAC/C,SAAO,+BAAgC,OAAO,IAAK;AAEnD,QAAM,6BAA6B,SACjC,OAAQ,gBAAiB,EACzB,IAAK,OAAO,4BAA6B;AAE3C,MAAK,CAAE,4BAA6B;AACnC,aACE,SAAU,gBAAiB,EAC3B,IAAK,OAAO,8BAA8B,IAAK;AAAA,EAClD;AAEA,WAAU;AAAA,IACT,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAOM,MAAM,2BACZ,CAAE,UACF,CAAE,EAAE,SAAS,MAAO;AACnB,UAAQ,gCAAiC,KAAM;AAC/C,QAAM,6BAA6B,SACjC,OAA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AAE;AAEF,aACE,SAAU,gBAAiB,EAC3B,IAAK,OAAO,aAAa,CAAC,CAAE,KAAM;AAAA,EACrC;AACD;AAUO,SAAS,mBAAoB,OAAO,UAAW;AACrD,SAAO,SAAW,EAAE,SAAS,GAAI;AAChC,eAAY,mDAAmD;AAAA,MAC9D,OAAO;AAAA,MACP,aAAa;AAAA,IACd,CAAE;AAEF,aAAS,SAAU,gBAAiB,EAAE,YAAa,OAAO,QAAS;AAAA,EACpE;AACD;AASO,SAAS,UAAW,MAAO;AACjC,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAOO,SAAS,aAAa;AAC5B,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const STORE_NAME = 'core/interface';
|
|
7
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
const STORE_NAME = "core/interface";
|
|
2
|
+
export {
|
|
3
|
+
STORE_NAME
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/constants.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/interface';\n"],
|
|
5
|
+
"mappings": "AAKO,MAAM,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import deprecated from '@wordpress/deprecated';
|
|
5
|
-
export function normalizeComplementaryAreaScope(scope) {
|
|
6
|
-
if (['core/edit-post', 'core/edit-site'].includes(scope)) {
|
|
1
|
+
import deprecated from "@wordpress/deprecated";
|
|
2
|
+
function normalizeComplementaryAreaScope(scope) {
|
|
3
|
+
if (["core/edit-post", "core/edit-site"].includes(scope)) {
|
|
7
4
|
deprecated(`${scope} interface scope`, {
|
|
8
|
-
alternative:
|
|
9
|
-
hint:
|
|
10
|
-
version:
|
|
5
|
+
alternative: "core interface scope",
|
|
6
|
+
hint: "core/edit-post and core/edit-site are merging.",
|
|
7
|
+
version: "6.6"
|
|
11
8
|
});
|
|
12
|
-
return
|
|
9
|
+
return "core";
|
|
13
10
|
}
|
|
14
11
|
return scope;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
if (scope ===
|
|
13
|
+
function normalizeComplementaryAreaName(scope, name) {
|
|
14
|
+
if (scope === "core" && name === "edit-site/template") {
|
|
18
15
|
deprecated(`edit-site/template sidebar`, {
|
|
19
|
-
alternative:
|
|
20
|
-
version:
|
|
16
|
+
alternative: "edit-post/document",
|
|
17
|
+
version: "6.6"
|
|
21
18
|
});
|
|
22
|
-
return
|
|
19
|
+
return "edit-post/document";
|
|
23
20
|
}
|
|
24
|
-
if (scope ===
|
|
21
|
+
if (scope === "core" && name === "edit-site/block-inspector") {
|
|
25
22
|
deprecated(`edit-site/block-inspector sidebar`, {
|
|
26
|
-
alternative:
|
|
27
|
-
version:
|
|
23
|
+
alternative: "edit-post/block",
|
|
24
|
+
version: "6.6"
|
|
28
25
|
});
|
|
29
|
-
return
|
|
26
|
+
return "edit-post/block";
|
|
30
27
|
}
|
|
31
28
|
return name;
|
|
32
29
|
}
|
|
33
|
-
|
|
30
|
+
export {
|
|
31
|
+
normalizeComplementaryAreaName,
|
|
32
|
+
normalizeComplementaryAreaScope
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/deprecated.js"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": "AAGA,OAAO,gBAAgB;AAEhB,SAAS,gCAAiC,OAAQ;AACxD,MAAK,CAAE,kBAAkB,gBAAiB,EAAE,SAAU,KAAM,GAAI;AAC/D,eAAY,GAAI,KAAM,oBAAoB;AAAA,MACzC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV,CAAE;AACF,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEO,SAAS,+BAAgC,OAAO,MAAO;AAC7D,MAAK,UAAU,UAAU,SAAS,sBAAuB;AACxD,eAAY,8BAA8B;AAAA,MACzC,aAAa;AAAA,MACb,SAAS;AAAA,IACV,CAAE;AACF,WAAO;AAAA,EACR;AAEA,MAAK,UAAU,UAAU,SAAS,6BAA8B;AAC/D,eAAY,qCAAqC;AAAA,MAChD,aAAa;AAAA,MACb,SAAS;AAAA,IACV,CAAE;AACF,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import * as actions from './actions';
|
|
10
|
-
import * as selectors from './selectors';
|
|
11
|
-
import reducer from './reducer';
|
|
12
|
-
import { STORE_NAME } from './constants';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Store definition for the interface namespace.
|
|
16
|
-
*
|
|
17
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
|
|
18
|
-
*
|
|
19
|
-
* @type {Object}
|
|
20
|
-
*/
|
|
21
|
-
export const store = createReduxStore(STORE_NAME, {
|
|
1
|
+
import { createReduxStore, register } from "@wordpress/data";
|
|
2
|
+
import * as actions from "./actions";
|
|
3
|
+
import * as selectors from "./selectors";
|
|
4
|
+
import reducer from "./reducer";
|
|
5
|
+
import { STORE_NAME } from "./constants";
|
|
6
|
+
const store = createReduxStore(STORE_NAME, {
|
|
22
7
|
reducer,
|
|
23
8
|
actions,
|
|
24
9
|
selectors
|
|
25
10
|
});
|
|
26
11
|
register(store);
|
|
27
|
-
|
|
12
|
+
export {
|
|
13
|
+
store
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/index.js"],
|
|
4
|
+
"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} );\nregister( store );\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,kBAAkB,gBAAgB;AAK3C,YAAY,aAAa;AACzB,YAAY,eAAe;AAC3B,OAAO,aAAa;AACpB,SAAS,kBAAkB;AASpB,MAAM,QAAQ,iBAAkB,YAAY;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACD,CAAE;AACF,SAAU,KAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|