@wordpress/interface 10.0.0 → 10.0.2-next.v.202608281122.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 +7 -0
- package/build/components/action-item/index.cjs +1 -1
- package/build/components/action-item/index.cjs.map +1 -1
- package/build/components/complementary-area/index.cjs +1 -1
- package/build/components/complementary-area/index.cjs.map +1 -1
- package/build/components/complementary-area-header/index.cjs +1 -1
- package/build/components/complementary-area-header/index.cjs.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.cjs +1 -1
- package/build/components/complementary-area-more-menu-item/index.cjs.map +1 -1
- package/build/components/complementary-area-toggle/index.cjs +1 -1
- package/build/components/complementary-area-toggle/index.cjs.map +1 -1
- package/build/components/interface-skeleton/index.cjs +1 -1
- package/build/components/interface-skeleton/index.cjs.map +1 -1
- package/build/components/pinned-items/index.cjs +1 -1
- package/build/components/pinned-items/index.cjs.map +1 -1
- package/build-module/components/action-item/index.mjs +1 -1
- package/build-module/components/action-item/index.mjs.map +1 -1
- package/build-module/components/complementary-area/index.mjs +1 -1
- package/build-module/components/complementary-area/index.mjs.map +1 -1
- package/build-module/components/complementary-area-header/index.mjs +1 -1
- package/build-module/components/complementary-area-header/index.mjs.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.mjs +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.mjs.map +1 -1
- package/build-module/components/complementary-area-toggle/index.mjs +1 -1
- package/build-module/components/complementary-area-toggle/index.mjs.map +1 -1
- package/build-module/components/interface-skeleton/index.mjs +1 -1
- package/build-module/components/interface-skeleton/index.mjs.map +1 -1
- package/build-module/components/pinned-items/index.mjs +1 -1
- package/build-module/components/pinned-items/index.mjs.map +1 -1
- package/package.json +14 -15
- /package/src/components/action-item/{index.js → index.jsx} +0 -0
- /package/src/components/complementary-area/{index.js → index.jsx} +0 -0
- /package/src/components/complementary-area-header/{index.js → index.jsx} +0 -0
- /package/src/components/complementary-area-more-menu-item/{index.js → index.jsx} +0 -0
- /package/src/components/complementary-area-toggle/{index.js → index.jsx} +0 -0
- /package/src/components/fullscreen-mode/test/{index.js → index.jsx} +0 -0
- /package/src/components/interface-skeleton/{index.js → index.jsx} +0 -0
- /package/src/components/pinned-items/{index.js → index.jsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 10.0.1-next.0 (2026-08-28)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Remove unused dependency `@wordpress/a11y` ([#82103](https://github.com/WordPress/gutenberg/pull/82103)).
|
|
10
|
+
- Use the `.jsx` extension for JavaScript source files that contain JSX ([#80990](https://github.com/WordPress/gutenberg/pull/80990)).
|
|
11
|
+
|
|
5
12
|
## 10.0.0 (2026-08-26)
|
|
6
13
|
|
|
7
14
|
### Breaking Changes
|
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/interface/src/components/action-item/index.
|
|
19
|
+
// packages/interface/src/components/action-item/index.jsx
|
|
20
20
|
var action_item_exports = {};
|
|
21
21
|
__export(action_item_exports, {
|
|
22
22
|
default: () => action_item_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/action-item/index.
|
|
3
|
+
"sources": ["../../../src/components/action-item/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { MenuGroup, MenuItem, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = MenuGroup,\n\tfillProps = {},\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot name={ name } fillProps={ fillProps }>\n\t\t\t{ ( fills ) => {\n\t\t\t\t// Each fill renders an array of its own, so flatten them into a\n\t\t\t\t// single list before handing them over.\n\t\t\t\tconst items = Children.toArray( fills );\n\n\t\t\t\tif ( ! items.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif ( typeof children === 'function' ) {\n\t\t\t\t\treturn children( items );\n\t\t\t\t}\n\n\t\t\t\treturn <Component { ...props }>{ items }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { as: slotAs = MenuItem, onClick: slotOnClick } ) => {\n\t\t\t\t// The slot provides the component to render the item with, so\n\t\t\t\t// that it fits the menu it ends up in, and an onClick handler,\n\t\t\t\t// for example one that closes that menu. The `as` prop\n\t\t\t\t// replaces the component. The `onClick` prop does not replace\n\t\t\t\t// the handler: both run.\n\t\t\t\tconst Component = as ?? slotAs;\n\t\t\t\tconst handlers = [ onClick, slotOnClick ].filter( Boolean );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\thandlers.length\n\t\t\t\t\t\t\t\t? ( ...args ) =>\n\t\t\t\t\t\t\t\t\t\thandlers.forEach( ( handler ) =>\n\t\t\t\t\t\t\t\t\t\t\thandler( ...args )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,qBAAyB;AAwBd;AAtBX,SAAS,eAAgB;AAAA,EACxB;AAAA,EACA,IAAI,YAAY;AAAA,EAChB,YAAY,CAAC;AAAA,EACb;AAAA,EACA,GAAG;AACJ,GAAI;AACH,SACC,4CAAC,0BAAK,MAAc,WACjB,WAAE,UAAW;AAGd,UAAM,QAAQ,wBAAS,QAAS,KAAM;AAEtC,QAAK,CAAE,MAAM,QAAS;AACrB,aAAO;AAAA,IACR;AAEA,QAAK,OAAO,aAAa,YAAa;AACrC,aAAO,SAAU,KAAM;AAAA,IACxB;AAEA,WAAO,4CAAC,aAAY,GAAG,OAAU,iBAAO;AAAA,EACzC,GACD;AAEF;AAEA,SAAS,WAAY,EAAE,MAAM,IAAI,SAAS,GAAG,MAAM,GAAI;AACtD,SACC,4CAAC,0BAAK,MACH,WAAE,EAAE,IAAI,SAAS,4BAAU,SAAS,YAAY,MAAO;AAMxD,UAAM,YAAY,MAAM;AACxB,UAAM,WAAW,CAAE,SAAS,WAAY,EAAE,OAAQ,OAAQ;AAE1D,WACC;AAAA,MAAC;AAAA;AAAA,QACA,SACC,SAAS,SACN,IAAK,SACL,SAAS;AAAA,UAAS,CAAE,YACnB,QAAS,GAAG,IAAK;AAAA,QAClB,IACA;AAAA,QAEF,GAAG;AAAA;AAAA,IACN;AAAA,EAEF,GACD;AAEF;AAEA,WAAW,OAAO;AAElB,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// packages/interface/src/components/complementary-area/index.
|
|
29
|
+
// packages/interface/src/components/complementary-area/index.jsx
|
|
30
30
|
var complementary_area_exports = {};
|
|
31
31
|
__export(complementary_area_exports, {
|
|
32
32
|
default: () => complementary_area_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\nimport {\n\tButton,\n\tPanel,\n\tSlot,\n\tFill,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport {\n\tcloneElement,\n\tisValidElement,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { usePluginContext } from '@wordpress/plugins';\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport {\n\tDefaultComplementaryAreaMoreMenuItem,\n\tuseHasComplementaryAreaMenuItem,\n} from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nconst ANIMATION_DURATION = 0.3;\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nconst variants = {\n\t// `auto` leaves the width to the area's own stylesheet, so it stays in one\n\t// place. framer-motion measures the element to animate, then restores\n\t// `auto`.\n\topen: { width: 'auto' },\n\t// Resolved with the `custom` value passed to `AnimatePresence`, which is\n\t// the only way an already removed element can be given a fresh transition.\n\tclosed: ( transition ) => ( { width: 0, transition } ),\n};\n\n/**\n * Renders the complementary area container, replacing the default `div` with\n * the element given via the `render` prop.\n *\n * `className` and `style` are composed rather than overwritten, since the\n * container is also the scroll container for the sidebar.\n *\n * @param {Object} [render] Replacement element.\n * @param {Object} props Props for the container.\n */\nfunction renderContainer( render, props ) {\n\tif ( isValidElement( render ) ) {\n\t\treturn cloneElement( render, {\n\t\t\t...props,\n\t\t\tclassName: clsx( render.props.className, props.className ),\n\t\t\tstyle: { ...render.props.style, ...props.style },\n\t\t} );\n\t}\n\n\treturn <div { ...props } />;\n}\n\nfunction ComplementaryAreaFill( {\n\tactiveArea,\n\tisActive,\n\tscope,\n\tchildren,\n\tclassName,\n\tid,\n\trender,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t// Swapping one open area straight for another should not animate.\n\tconst previousActiveArea = usePrevious( activeArea );\n\tconst isSwitchingAreas =\n\t\t!! previousActiveArea &&\n\t\t!! activeArea &&\n\t\tactiveArea !== previousActiveArea;\n\tconst transition = {\n\t\ttype: 'tween',\n\t\tduration:\n\t\t\tdisableMotion || isMobileViewport || isSwitchingAreas\n\t\t\t\t? 0\n\t\t\t\t: ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<AnimatePresence initial={ false } custom={ transition }>\n\t\t\t\t{ isActive && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ variants }\n\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\tclassName=\"interface-complementary-area__fill\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderContainer( render, {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmallRef = useRef( false );\n\tconst shouldOpenWhenNotSmallRef = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmallRef.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmallRef.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmallRef.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmallRef.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmallRef.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmallRef.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmallRef.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmallRef.current ) {\n\t\t\tpreviousIsSmallRef.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier: identifierProp,\n\theader,\n\theaderClassName,\n\ticon: iconProp,\n\tisPinnable = true,\n\tpanelClassName,\n\trender,\n\tscope,\n\tname,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\tconst context = usePluginContext();\n\tconst icon = iconProp || context.icon;\n\tconst identifier = identifierProp || `${ context.name }/${ name }`;\n\n\t// This state is used to delay the rendering of the Fill\n\t// until the initial effect runs.\n\t// This prevents the animation from running on mount if\n\t// the complementary area is active by default.\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\n\tconst hasMenuItem = useHasComplementaryAreaMenuItem( scope, name );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t\tsetIsReady( true );\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\tif ( ! isReady ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tshortcut={ toggleShortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && ! hasMenuItem && (\n\t\t\t\t<DefaultComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</DefaultComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t<ComplementaryAreaFill\n\t\t\t\tactiveArea={ activeArea }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tclassName={ clsx( 'interface-complementary-area', className ) }\n\t\t\t\tscope={ scope }\n\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t\trender={ render }\n\t\t\t>\n\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\tsize: 'compact',\n\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tidentifier,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ header || (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t{ isPinnable && ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\ticon={ isPinned ? starFilled : starEmpty }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t</ComplementaryAreaFill>\n\t\t</>\n\t);\n}\n\nComplementaryArea.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryArea;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,wBAOO;AACP,kBAAuC;AACvC,kBAAmB;AACnB,mBAA6C;AAC7C,qBAMO;AACP,sBAAuC;AACvC,yBAA0C;AAC1C,qBAIO;AACP,qBAAiC;AACjC,uCAAoC;AACpC,+CAGO;AACP,uCAAoC;AACpC,0BAAwB;AACxB,mBAAwC;AAKhC;AAHR,IAAM,qBAAqB;AAE3B,SAAS,sBAAuB,EAAE,OAAO,GAAG,MAAM,GAAI;AACrD,SAAO,4CAAC,0BAAK,MAAO,qBAAsB,KAAM,IAAO,GAAG,OAAQ;AACnE;AAEA,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAIhB,MAAM,EAAE,OAAO,OAAO;AAAA;AAAA;AAAA,EAGtB,QAAQ,CAAE,gBAAkB,EAAE,OAAO,GAAG,WAAW;AACpD;AAYA,SAAS,gBAAiB,QAAQ,OAAQ;AACzC,UAAK,+BAAgB,MAAO,GAAI;AAC/B,eAAO,6BAAc,QAAQ;AAAA,MAC5B,GAAG;AAAA,MACH,eAAW,YAAAA,SAAM,OAAO,MAAM,WAAW,MAAM,SAAU;AAAA,MACzD,OAAO,EAAE,GAAG,OAAO,MAAM,OAAO,GAAG,MAAM,MAAM;AAAA,IAChD,CAAE;AAAA,EACH;AAEA,SAAO,4CAAC,SAAM,GAAG,OAAQ;AAC1B;AAEA,SAAS,sBAAuB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,oBAAgB,iCAAi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A;AAAA,cACA,WAAY;AAAA,cACZ;AAAA,cACA,SAAU,MAAM,yBAA0B,KAAM;AAAA,cAChD,mBAAoB;AAAA,gBACnB,OAAO;AAAA,gBACP,MAAM;AAAA,gBACN,UAAU;AAAA,gBACV;AAAA,gBACA;AAAA,cACD;AAAA,cAEE,oBACD,4EACC;AAAA,4DAAC,QAAG,WAAU,8CACX,iBACH;AAAA,gBACE,cAAc,CAAE,oBACjB;AAAA,kBAAC;AAAA;AAAA,oBACA,WAAU;AAAA,oBACV,MAAO,WAAW,0BAAa;AAAA,oBAC/B,OACC,eACG,gBAAI,oBAAqB,QACzB,gBAAI,gBAAiB;AAAA,oBAEzB,SAAU,OACP,WAAW,YAAY;AAAA,sBACxB;AAAA,sBACA;AAAA,oBACD;AAAA,oBAED,WAAY;AAAA,oBACZ,MAAK;AAAA;AAAA,gBACN;AAAA,iBAEF;AAAA;AAAA,UAEF;AAAA,UACA,4CAAC,2BAAM,WAAY,gBAAmB,UAAU;AAAA;AAAA;AAAA,IACjD;AAAA,KACD;AAEF;AAEA,kBAAkB,OAAO;AAEzB,IAAO,6BAAQ;",
|
|
6
6
|
"names": ["clsx", "AnimatePresence", "motion", "interfaceStore", "preferencesStore", "viewportStore", "PinnedItems", "ComplementaryAreaToggle", "ComplementaryAreaHeader"]
|
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// packages/interface/src/components/complementary-area-header/index.
|
|
29
|
+
// packages/interface/src/components/complementary-area-header/index.jsx
|
|
30
30
|
var complementary_area_header_exports = {};
|
|
31
31
|
__export(complementary_area_header_exports, {
|
|
32
32
|
default: () => complementary_area_header_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-header/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-header/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\nimport { closeSmall } from '@wordpress/icons';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-panel__header',\n\t\t\t\t'interface-complementary-area-header',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ children }\n\t\t\t{ toggleButton }\n\t\t</div>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,mBAA2B;AAC3B,uCAAoC;AAQlC;AANF,IAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,eACL,4CAAC,iCAAAA,SAAA,EAAwB,MAAO,yBAAe,GAAG,mBAAoB;AAEvE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAY,YAAAC;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,UAAW;AAAA,MAET;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,oCAAQ;",
|
|
6
6
|
"names": ["ComplementaryAreaToggle", "clsx"]
|
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// packages/interface/src/components/complementary-area-more-menu-item/index.
|
|
29
|
+
// packages/interface/src/components/complementary-area-more-menu-item/index.jsx
|
|
30
30
|
var complementary_area_more_menu_item_exports = {};
|
|
31
31
|
__export(complementary_area_more_menu_item_exports, {
|
|
32
32
|
DefaultComplementaryAreaMoreMenuItem: () => DefaultComplementaryAreaMoreMenuItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-more-menu-item/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-more-menu-item/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { observableMap, useObservableValue } from '@wordpress/compose';\nimport { useLayoutEffect } from '@wordpress/element';\nimport { check } from '@wordpress/icons';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\n// How many more menu items are rendered for a complementary area, by\n// `scope/target`.\nconst menuItems = observableMap();\n\nexport function useHasComplementaryAreaMenuItem( scope, target ) {\n\treturn !! useObservableValue( menuItems, `${ scope }/${ target }` );\n}\n\n// The more menu item `ComplementaryArea` injects for every pinnable area. It is\n// left out while a plugin renders one of its own for the same area.\n// @see https://github.com/WordPress/gutenberg/issues/14457\nexport function DefaultComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => (\n\t\t\t\t<ActionItem\n\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t// Accepted so they don't leak to DOM elements. Registering the menu item is\n\t// what keeps `ComplementaryArea` from injecting a second one.\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...props\n} ) {\n\tuseLayoutEffect( () => {\n\t\tconst key = `${ scope }/${ target }`;\n\t\tmenuItems.set( key, ( menuItems.get( key ) ?? 0 ) + 1 );\n\n\t\treturn () => {\n\t\t\tconst count = menuItems.get( key ) - 1;\n\t\t\tif ( count ) {\n\t\t\t\tmenuItems.set( key, count );\n\t\t\t} else {\n\t\t\t\tmenuItems.delete( key );\n\t\t\t}\n\t\t};\n\t}, [ scope, target ] );\n\n\treturn (\n\t\t<DefaultComplementaryAreaMoreMenuItem\n\t\t\tscope={ scope }\n\t\t\ttarget={ target }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkD;AAClD,qBAAgC;AAChC,mBAAsB;AACtB,uCAAoC;AACpC,yBAAuB;AAqBnB;AAjBJ,IAAM,gBAAY,8BAAc;AAEzB,SAAS,gCAAiC,OAAO,QAAS;AAChE,SAAO,CAAC,KAAE,mCAAoB,WAAW,GAAI,KAAM,IAAK,MAAO,EAAG;AACnE;AAKO,SAAS,qCAAsC;AAAA,EACrD;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,SACC;AAAA,IAAC,iCAAAA;AAAA,IAAA;AAAA,MACA,IAAK,CAAE,gBACN;AAAA,QAAC,mBAAAC;AAAA,QAAA;AAAA,UACA,MAAO,GAAI,KAAM;AAAA,UACf,GAAG;AAAA;AAAA,MACN;AAAA,MAED,MAAK;AAAA,MACL,cAAe;AAAA,MACf,MAAO;AAAA,MACP;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;AAEe,SAAR,8BAAgD;AAAA,EACtD;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,sCAAiB,MAAM;AACtB,UAAM,MAAM,GAAI,KAAM,IAAK,MAAO;AAClC,cAAU,IAAK,MAAO,UAAU,IAAK,GAAI,KAAK,KAAM,CAAE;AAEtD,WAAO,MAAM;AACZ,YAAM,QAAQ,UAAU,IAAK,GAAI,IAAI;AACrC,UAAK,OAAQ;AACZ,kBAAU,IAAK,KAAK,KAAM;AAAA,MAC3B,OAAO;AACN,kBAAU,OAAQ,GAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD,GAAG,CAAE,OAAO,MAAO,CAAE;AAErB,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
6
|
"names": ["ComplementaryAreaToggle", "ActionItem"]
|
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/interface/src/components/complementary-area-toggle/index.
|
|
19
|
+
// packages/interface/src/components/complementary-area-toggle/index.jsx
|
|
20
20
|
var complementary_area_toggle_exports = {};
|
|
21
21
|
__export(complementary_area_toggle_exports, {
|
|
22
22
|
default: () => ComplementaryAreaToggle
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-toggle/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-toggle/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { store as interfaceStore } from '../../store';\n\n/**\n * Whether the role supports checked state.\n *\n * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n * @param {React.AriaRole} role Role.\n * @return {boolean} Whether the role supports checked state.\n */\nfunction roleSupportsCheckedState( role ) {\n\treturn [\n\t\t'checkbox',\n\t\t'option',\n\t\t'radio',\n\t\t'switch',\n\t\t'menuitemcheckbox',\n\t\t'menuitemradio',\n\t\t'treeitem',\n\t].includes( role );\n}\n\nexport default function ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier: identifierProp,\n\ticon: iconProp,\n\tselectedIcon,\n\tname,\n\tshortcut,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst context = usePluginContext();\n\tconst icon = iconProp || context.icon;\n\tconst identifier = identifierProp || `${ context.name }/${ name }`;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\troleSupportsCheckedState( props.role ) ? isSelected : undefined\n\t\t\t}\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,kBAAuC;AACvC,qBAAiC;AACjC,mBAAwC;AA8CtC;AArCF,SAAS,yBAA0B,MAAO;AACzC,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EAAE,SAAU,IAAK;AAClB;AAEe,SAAR,wBAA0C;AAAA,EAChD,KAAK;AAAA,EACL;AAAA,EACA,YAAY;AAAA,EACZ,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM,iBAAiB;AACvB,QAAM,cAAU,iCAAiB;AACjC,QAAM,OAAO,YAAY,QAAQ;AACjC,QAAM,aAAa,kBAAkB,GAAI,QAAQ,IAAK,IAAK,IAAK;AAChE,QAAM,iBAAa;AAAA,IAClB,CAAE,WACD,OAAQ,aAAAA,KAAe,EAAE,2BAA4B,KAAM,MAC3D;AAAA,IACD,CAAE,YAAY,KAAM;AAAA,EACrB;AAEA,QAAM,EAAE,yBAAyB,yBAAyB,QACzD,yBAAa,aAAAA,KAAe;AAE7B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,gBAAgB,aAAa,eAAe;AAAA,MACnD,iBAAgB,WAAW,QAAS,KAAK,GAAI;AAAA,MAE7C,gBACC,yBAA0B,MAAM,IAAK,IAAI,aAAa;AAAA,MAEvD,SAAU,MAAM;AACf,YAAK,YAAa;AACjB,mCAA0B,KAAM;AAAA,QACjC,OAAO;AACN,kCAAyB,OAAO,UAAW;AAAA,QAC5C;AAAA,MACD;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
6
|
"names": ["interfaceStore"]
|
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// packages/interface/src/components/interface-skeleton/index.
|
|
29
|
+
// packages/interface/src/components/interface-skeleton/index.jsx
|
|
30
30
|
var interface_skeleton_exports = {};
|
|
31
31
|
__export(interface_skeleton_exports, {
|
|
32
32
|
default: () => interface_skeleton_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/interface-skeleton/index.
|
|
3
|
+
"sources": ["../../../src/components/interface-skeleton/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\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 { useReducedMotion, useViewportMatch } 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 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\tariaLabel={ 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\t// `auto` leaves the open width to the panel, so a\n\t\t\t\t\t\t\t\t// sidebar that is already open on page load is\n\t\t\t\t\t\t\t\t// at its full width on the first paint instead\n\t\t\t\t\t\t\t\t// of animating there. framer-motion measures\n\t\t\t\t\t\t\t\t// the element to animate, then restores `auto`.\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\topen: { width: 'auto' },\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\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: 'max-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\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{ 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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,sBAAgC;AAChC,qBAAsC;AACtC,wBAGO;AACP,kBAAuB;AACvB,qBAAmD;AAuG7C;AArGN,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM,CAAE,KAAK,GAAG,KAAK,CAAE;AACxB;AAEA,SAAS,aAAc,WAAY;AAClC,gCAAW,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,IAAM,iBAAiB;AAAA,EACtB,QAAQ,EAAE,SAAS,GAAG,WAAW,IAAI;AAAA,EACrC,SAAS,EAAE,SAAS,GAAG,WAAW,EAAE;AAAA,EACpC,sBAAsB;AAAA,IACrB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,YAAY;AAAA,MACX,GAAG;AAAA,M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Y,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,iCAAQ,2BAAY,iBAAkB;",
|
|
6
6
|
"names": ["clsx", "AnimatePresence", "motion"]
|
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// packages/interface/src/components/pinned-items/index.
|
|
29
|
+
// packages/interface/src/components/pinned-items/index.jsx
|
|
30
30
|
var pinned_items_exports = {};
|
|
31
31
|
__export(pinned_items_exports, {
|
|
32
32
|
default: () => pinned_items_default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/pinned-items/index.
|
|
3
|
+
"sources": ["../../../src/components/pinned-items/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,wBAA2B;AAGnB;AADR,SAAS,YAAa,EAAE,OAAO,GAAG,MAAM,GAAI;AAC3C,SAAO,4CAAC,0BAAK,MAAO,eAAgB,KAAM,IAAO,GAAG,OAAQ;AAC7D;AAEA,SAAS,gBAAiB,EAAE,OAAO,WAAW,GAAG,MAAM,GAAI;AAC1D,SACC,4CAAC,0BAAK,MAAO,eAAgB,KAAM,IAAO,GAAG,OAC1C,WAAE,UACH,OAAO,SAAS,KACf;AAAA,IAAC;AAAA;AAAA,MACA,eAAY,YAAAA;AAAA,QACX;AAAA,QACA;AAAA,MACD;AAAA,MAEE;AAAA;AAAA,EACH,GAGH;AAEF;AAEA,YAAY,OAAO;AAEnB,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["clsx"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/interface/src/components/action-item/index.
|
|
1
|
+
// packages/interface/src/components/action-item/index.jsx
|
|
2
2
|
import { MenuGroup, MenuItem, Slot, Fill } from "@wordpress/components";
|
|
3
3
|
import { Children } from "@wordpress/element";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/action-item/index.
|
|
3
|
+
"sources": ["../../../src/components/action-item/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { MenuGroup, MenuItem, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = MenuGroup,\n\tfillProps = {},\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot name={ name } fillProps={ fillProps }>\n\t\t\t{ ( fills ) => {\n\t\t\t\t// Each fill renders an array of its own, so flatten them into a\n\t\t\t\t// single list before handing them over.\n\t\t\t\tconst items = Children.toArray( fills );\n\n\t\t\t\tif ( ! items.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif ( typeof children === 'function' ) {\n\t\t\t\t\treturn children( items );\n\t\t\t\t}\n\n\t\t\t\treturn <Component { ...props }>{ items }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { as: slotAs = MenuItem, onClick: slotOnClick } ) => {\n\t\t\t\t// The slot provides the component to render the item with, so\n\t\t\t\t// that it fits the menu it ends up in, and an onClick handler,\n\t\t\t\t// for example one that closes that menu. The `as` prop\n\t\t\t\t// replaces the component. The `onClick` prop does not replace\n\t\t\t\t// the handler: both run.\n\t\t\t\tconst Component = as ?? slotAs;\n\t\t\t\tconst handlers = [ onClick, slotOnClick ].filter( Boolean );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\thandlers.length\n\t\t\t\t\t\t\t\t? ( ...args ) =>\n\t\t\t\t\t\t\t\t\t\thandlers.forEach( ( handler ) =>\n\t\t\t\t\t\t\t\t\t\t\thandler( ...args )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,WAAW,UAAU,MAAM,YAAY;AAChD,SAAS,gBAAgB;AAwBd;AAtBX,SAAS,eAAgB;AAAA,EACxB;AAAA,EACA,IAAI,YAAY;AAAA,EAChB,YAAY,CAAC;AAAA,EACb;AAAA,EACA,GAAG;AACJ,GAAI;AACH,SACC,oBAAC,QAAK,MAAc,WACjB,WAAE,UAAW;AAGd,UAAM,QAAQ,SAAS,QAAS,KAAM;AAEtC,QAAK,CAAE,MAAM,QAAS;AACrB,aAAO;AAAA,IACR;AAEA,QAAK,OAAO,aAAa,YAAa;AACrC,aAAO,SAAU,KAAM;AAAA,IACxB;AAEA,WAAO,oBAAC,aAAY,GAAG,OAAU,iBAAO;AAAA,EACzC,GACD;AAEF;AAEA,SAAS,WAAY,EAAE,MAAM,IAAI,SAAS,GAAG,MAAM,GAAI;AACtD,SACC,oBAAC,QAAK,MACH,WAAE,EAAE,IAAI,SAAS,UAAU,SAAS,YAAY,MAAO;AAMxD,UAAM,YAAY,MAAM;AACxB,UAAM,WAAW,CAAE,SAAS,WAAY,EAAE,OAAQ,OAAQ;AAE1D,WACC;AAAA,MAAC;AAAA;AAAA,QACA,SACC,SAAS,SACN,IAAK,SACL,SAAS;AAAA,UAAS,CAAE,YACnB,QAAS,GAAG,IAAK;AAAA,QAClB,IACA;AAAA,QAEF,GAAG;AAAA;AAAA,IACN;AAAA,EAEF,GACD;AAEF;AAEA,WAAW,OAAO;AAElB,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\nimport {\n\tButton,\n\tPanel,\n\tSlot,\n\tFill,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport {\n\tcloneElement,\n\tisValidElement,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { usePluginContext } from '@wordpress/plugins';\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport {\n\tDefaultComplementaryAreaMoreMenuItem,\n\tuseHasComplementaryAreaMenuItem,\n} from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nconst ANIMATION_DURATION = 0.3;\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nconst variants = {\n\t// `auto` leaves the width to the area's own stylesheet, so it stays in one\n\t// place. framer-motion measures the element to animate, then restores\n\t// `auto`.\n\topen: { width: 'auto' },\n\t// Resolved with the `custom` value passed to `AnimatePresence`, which is\n\t// the only way an already removed element can be given a fresh transition.\n\tclosed: ( transition ) => ( { width: 0, transition } ),\n};\n\n/**\n * Renders the complementary area container, replacing the default `div` with\n * the element given via the `render` prop.\n *\n * `className` and `style` are composed rather than overwritten, since the\n * container is also the scroll container for the sidebar.\n *\n * @param {Object} [render] Replacement element.\n * @param {Object} props Props for the container.\n */\nfunction renderContainer( render, props ) {\n\tif ( isValidElement( render ) ) {\n\t\treturn cloneElement( render, {\n\t\t\t...props,\n\t\t\tclassName: clsx( render.props.className, props.className ),\n\t\t\tstyle: { ...render.props.style, ...props.style },\n\t\t} );\n\t}\n\n\treturn <div { ...props } />;\n}\n\nfunction ComplementaryAreaFill( {\n\tactiveArea,\n\tisActive,\n\tscope,\n\tchildren,\n\tclassName,\n\tid,\n\trender,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t// Swapping one open area straight for another should not animate.\n\tconst previousActiveArea = usePrevious( activeArea );\n\tconst isSwitchingAreas =\n\t\t!! previousActiveArea &&\n\t\t!! activeArea &&\n\t\tactiveArea !== previousActiveArea;\n\tconst transition = {\n\t\ttype: 'tween',\n\t\tduration:\n\t\t\tdisableMotion || isMobileViewport || isSwitchingAreas\n\t\t\t\t? 0\n\t\t\t\t: ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<AnimatePresence initial={ false } custom={ transition }>\n\t\t\t\t{ isActive && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ variants }\n\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\tclassName=\"interface-complementary-area__fill\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderContainer( render, {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmallRef = useRef( false );\n\tconst shouldOpenWhenNotSmallRef = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmallRef.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmallRef.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmallRef.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmallRef.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmallRef.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmallRef.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmallRef.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmallRef.current ) {\n\t\t\tpreviousIsSmallRef.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier: identifierProp,\n\theader,\n\theaderClassName,\n\ticon: iconProp,\n\tisPinnable = true,\n\tpanelClassName,\n\trender,\n\tscope,\n\tname,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\tconst context = usePluginContext();\n\tconst icon = iconProp || context.icon;\n\tconst identifier = identifierProp || `${ context.name }/${ name }`;\n\n\t// This state is used to delay the rendering of the Fill\n\t// until the initial effect runs.\n\t// This prevents the animation from running on mount if\n\t// the complementary area is active by default.\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\n\tconst hasMenuItem = useHasComplementaryAreaMenuItem( scope, name );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t\tsetIsReady( true );\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\tif ( ! isReady ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tshortcut={ toggleShortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && ! hasMenuItem && (\n\t\t\t\t<DefaultComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</DefaultComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t<ComplementaryAreaFill\n\t\t\t\tactiveArea={ activeArea }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tclassName={ clsx( 'interface-complementary-area', className ) }\n\t\t\t\tscope={ scope }\n\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t\trender={ render }\n\t\t\t>\n\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\tsize: 'compact',\n\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tidentifier,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ header || (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t{ isPinnable && ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\ticon={ isPinned ? starFilled : starEmpty }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t</ComplementaryAreaFill>\n\t\t</>\n\t);\n}\n\nComplementaryArea.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryArea;\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,UAAU;AACjB;AAAA,EACC;A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M;AAAA,gBACN,UAAU;AAAA,gBACV;AAAA,gBACA;AAAA,cACD;AAAA,cAEE,oBACD,iCACC;AAAA,oCAAC,QAAG,WAAU,8CACX,iBACH;AAAA,gBACE,cAAc,CAAE,oBACjB;AAAA,kBAAC;AAAA;AAAA,oBACA,WAAU;AAAA,oBACV,MAAO,WAAW,aAAa;AAAA,oBAC/B,OACC,WACG,GAAI,oBAAqB,IACzB,GAAI,gBAAiB;AAAA,oBAEzB,SAAU,OACP,WAAW,YAAY;AAAA,sBACxB;AAAA,sBACA;AAAA,oBACD;AAAA,oBAED,WAAY;AAAA,oBACZ,MAAK;AAAA;AAAA,gBACN;AAAA,iBAEF;AAAA;AAAA,UAEF;AAAA,UACA,oBAAC,SAAM,WAAY,gBAAmB,UAAU;AAAA;AAAA;AAAA,IACjD;AAAA,KACD;AAEF;AAEA,kBAAkB,OAAO;AAEzB,IAAO,6BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/interface/src/components/complementary-area-header/index.
|
|
1
|
+
// packages/interface/src/components/complementary-area-header/index.jsx
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { closeSmall } from "@wordpress/icons";
|
|
4
4
|
import ComplementaryAreaToggle from "../complementary-area-toggle/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-header/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-header/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\nimport { closeSmall } from '@wordpress/icons';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-panel__header',\n\t\t\t\t'interface-complementary-area-header',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ children }\n\t\t\t{ toggleButton }\n\t\t</div>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,OAAO,6BAA6B;AAQlC,cAGA,YAHA;AANF,IAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,eACL,oBAAC,2BAAwB,MAAO,YAAe,GAAG,mBAAoB;AAEvE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAY;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,UAAW;AAAA,MAET;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,oCAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/interface/src/components/complementary-area-more-menu-item/index.
|
|
1
|
+
// packages/interface/src/components/complementary-area-more-menu-item/index.jsx
|
|
2
2
|
import { observableMap, useObservableValue } from "@wordpress/compose";
|
|
3
3
|
import { useLayoutEffect } from "@wordpress/element";
|
|
4
4
|
import { check } from "@wordpress/icons";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-more-menu-item/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-more-menu-item/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { observableMap, useObservableValue } from '@wordpress/compose';\nimport { useLayoutEffect } from '@wordpress/element';\nimport { check } from '@wordpress/icons';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\n// How many more menu items are rendered for a complementary area, by\n// `scope/target`.\nconst menuItems = observableMap();\n\nexport function useHasComplementaryAreaMenuItem( scope, target ) {\n\treturn !! useObservableValue( menuItems, `${ scope }/${ target }` );\n}\n\n// The more menu item `ComplementaryArea` injects for every pinnable area. It is\n// left out while a plugin renders one of its own for the same area.\n// @see https://github.com/WordPress/gutenberg/issues/14457\nexport function DefaultComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => (\n\t\t\t\t<ActionItem\n\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t// Accepted so they don't leak to DOM elements. Registering the menu item is\n\t// what keeps `ComplementaryArea` from injecting a second one.\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...props\n} ) {\n\tuseLayoutEffect( () => {\n\t\tconst key = `${ scope }/${ target }`;\n\t\tmenuItems.set( key, ( menuItems.get( key ) ?? 0 ) + 1 );\n\n\t\treturn () => {\n\t\t\tconst count = menuItems.get( key ) - 1;\n\t\t\tif ( count ) {\n\t\t\t\tmenuItems.set( key, count );\n\t\t\t} else {\n\t\t\t\tmenuItems.delete( key );\n\t\t\t}\n\t\t};\n\t}, [ scope, target ] );\n\n\treturn (\n\t\t<DefaultComplementaryAreaMoreMenuItem\n\t\t\tscope={ scope }\n\t\t\ttarget={ target }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,eAAe,0BAA0B;AAClD,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAO,6BAA6B;AACpC,OAAO,gBAAgB;AAqBnB;AAjBJ,IAAM,YAAY,cAAc;AAEzB,SAAS,gCAAiC,OAAO,QAAS;AAChE,SAAO,CAAC,CAAE,mBAAoB,WAAW,GAAI,KAAM,IAAK,MAAO,EAAG;AACnE;AAKO,SAAS,qCAAsC;AAAA,EACrD;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,IAAK,CAAE,gBACN;AAAA,QAAC;AAAA;AAAA,UACA,MAAO,GAAI,KAAM;AAAA,UACf,GAAG;AAAA;AAAA,MACN;AAAA,MAED,MAAK;AAAA,MACL,cAAe;AAAA,MACf,MAAO;AAAA,MACP;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;AAEe,SAAR,8BAAgD;AAAA,EACtD;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,kBAAiB,MAAM;AACtB,UAAM,MAAM,GAAI,KAAM,IAAK,MAAO;AAClC,cAAU,IAAK,MAAO,UAAU,IAAK,GAAI,KAAK,KAAM,CAAE;AAEtD,WAAO,MAAM;AACZ,YAAM,QAAQ,UAAU,IAAK,GAAI,IAAI;AACrC,UAAK,OAAQ;AACZ,kBAAU,IAAK,KAAK,KAAM;AAAA,MAC3B,OAAO;AACN,kBAAU,OAAQ,GAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD,GAAG,CAAE,OAAO,MAAO,CAAE;AAErB,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/interface/src/components/complementary-area-toggle/index.
|
|
1
|
+
// packages/interface/src/components/complementary-area-toggle/index.jsx
|
|
2
2
|
import { Button } from "@wordpress/components";
|
|
3
3
|
import { useDispatch, useSelect } from "@wordpress/data";
|
|
4
4
|
import { usePluginContext } from "@wordpress/plugins";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/complementary-area-toggle/index.
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-toggle/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { store as interfaceStore } from '../../store';\n\n/**\n * Whether the role supports checked state.\n *\n * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n * @param {React.AriaRole} role Role.\n * @return {boolean} Whether the role supports checked state.\n */\nfunction roleSupportsCheckedState( role ) {\n\treturn [\n\t\t'checkbox',\n\t\t'option',\n\t\t'radio',\n\t\t'switch',\n\t\t'menuitemcheckbox',\n\t\t'menuitemradio',\n\t\t'treeitem',\n\t].includes( role );\n}\n\nexport default function ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier: identifierProp,\n\ticon: iconProp,\n\tselectedIcon,\n\tname,\n\tshortcut,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst context = usePluginContext();\n\tconst icon = iconProp || context.icon;\n\tconst identifier = identifierProp || `${ context.name }/${ name }`;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\troleSupportsCheckedState( props.role ) ? isSelected : undefined\n\t\t\t}\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,cAAc;AACvB,SAAS,aAAa,iBAAiB;AACvC,SAAS,wBAAwB;AACjC,SAAS,SAAS,sBAAsB;AA8CtC;AArCF,SAAS,yBAA0B,MAAO;AACzC,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EAAE,SAAU,IAAK;AAClB;AAEe,SAAR,wBAA0C;AAAA,EAChD,KAAK;AAAA,EACL;AAAA,EACA,YAAY;AAAA,EACZ,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM,iBAAiB;AACvB,QAAM,UAAU,iBAAiB;AACjC,QAAM,OAAO,YAAY,QAAQ;AACjC,QAAM,aAAa,kBAAkB,GAAI,QAAQ,IAAK,IAAK,IAAK;AAChE,QAAM,aAAa;AAAA,IAClB,CAAE,WACD,OAAQ,cAAe,EAAE,2BAA4B,KAAM,MAC3D;AAAA,IACD,CAAE,YAAY,KAAM;AAAA,EACrB;AAEA,QAAM,EAAE,yBAAyB,yBAAyB,IACzD,YAAa,cAAe;AAE7B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,gBAAgB,aAAa,eAAe;AAAA,MACnD,iBAAgB,WAAW,QAAS,KAAK,GAAI;AAAA,MAE7C,gBACC,yBAA0B,MAAM,IAAK,IAAI,aAAa;AAAA,MAEvD,SAAU,MAAM;AACf,YAAK,YAAa;AACjB,mCAA0B,KAAM;AAAA,QACjC,OAAO;AACN,kCAAyB,OAAO,UAAW;AAAA,QAC5C;AAAA,MACD;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/interface/src/components/interface-skeleton/index.
|
|
1
|
+
// packages/interface/src/components/interface-skeleton/index.jsx
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { NavigableRegion } from "@wordpress/admin-ui";
|
|
4
4
|
import { forwardRef, useEffect } from "@wordpress/element";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/interface-skeleton/index.
|
|
3
|
+
"sources": ["../../../src/components/interface-skeleton/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\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 { useReducedMotion, useViewportMatch } 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 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\tariaLabel={ 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\t// `auto` leaves the open width to the panel, so a\n\t\t\t\t\t\t\t\t// sidebar that is already open on page load is\n\t\t\t\t\t\t\t\t// at its full width on the first paint instead\n\t\t\t\t\t\t\t\t// of animating there. framer-motion measures\n\t\t\t\t\t\t\t\t// the element to animate, then restores `auto`.\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\topen: { width: 'auto' },\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\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: 'max-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\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{ 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
5
|
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,uBAAuB;AAChC,SAAS,YAAY,iBAAiB;AACtC;AAAA,EACC,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,OACvB;AACP,SAAS,IAAI,UAAU;AACvB,SAAS,kBAAkB,wBAAwB;AAuG7C,cAoCF,YApCE;AArGN,IAAM,qBAAqB;AAC3B,IAAM,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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ACtB;AAAA,oBACA,YAAa;AAAA,oBAEX;AAAA;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
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/pinned-items/index.
|
|
3
|
+
"sources": ["../../../src/components/pinned-items/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import clsx from 'clsx';\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
5
|
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,MAAM,YAAY;AAGnB;AADR,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
6
|
"names": []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "10.0.0",
|
|
3
|
+
"version": "10.0.2-next.v.202608281122.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",
|
|
@@ -52,19 +52,18 @@
|
|
|
52
52
|
"build-module/store/index.mjs"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
66
|
-
"@wordpress/
|
|
67
|
-
"@wordpress/viewport": "^6.54.0",
|
|
55
|
+
"@wordpress/admin-ui": "^2.9.1-next.v.202608281122.0",
|
|
56
|
+
"@wordpress/base-styles": "^13.0.1-next.v.202608281122.0",
|
|
57
|
+
"@wordpress/components": "^40.1.1-next.v.202608281122.0",
|
|
58
|
+
"@wordpress/compose": "^8.7.2-next.v.202608281122.0",
|
|
59
|
+
"@wordpress/data": "^10.54.2-next.v.202608281122.0",
|
|
60
|
+
"@wordpress/deprecated": "^4.54.1-next.v.202608281122.0",
|
|
61
|
+
"@wordpress/element": "^8.6.2-next.v.202608281122.0",
|
|
62
|
+
"@wordpress/i18n": "^6.27.1-next.v.202608281122.0",
|
|
63
|
+
"@wordpress/icons": "^15.5.1-next.v.202608281122.0",
|
|
64
|
+
"@wordpress/plugins": "^7.54.1-next.v.202608281122.0",
|
|
65
|
+
"@wordpress/preferences": "^4.54.2-next.v.202608281122.0",
|
|
66
|
+
"@wordpress/viewport": "^6.54.1-next.v.202608281122.0",
|
|
68
67
|
"clsx": "^2.1.1"
|
|
69
68
|
},
|
|
70
69
|
"devDependencies": {
|
|
@@ -78,5 +77,5 @@
|
|
|
78
77
|
"publishConfig": {
|
|
79
78
|
"access": "public"
|
|
80
79
|
},
|
|
81
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "de479d415171765f7b573c81aeec5334ff506a12"
|
|
82
81
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|