@wordpress/edit-site 6.8.4 → 6.8.6
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/editor/index.js +1 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +2 -16
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +0 -4
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +1 -3
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +0 -42
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -4
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +4 -18
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +0 -4
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +1 -3
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -42
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -5
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-style/posts-rtl.css +4 -15
- package/build-style/posts.css +4 -15
- package/build-style/style-rtl.css +7 -18
- package/build-style/style.css +7 -18
- package/package.json +30 -30
- package/src/components/editor/index.js +2 -2
- package/src/components/editor/style.scss +4 -0
- package/src/components/global-styles/font-families.js +5 -28
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/global-styles/ui.js +0 -5
- package/src/components/sidebar-dataviews/dataview-item.js +0 -2
- package/src/components/sidebar-dataviews/default-views.js +1 -45
- package/src/components/sidebar-dataviews/index.js +2 -7
- package/src/components/sidebar-dataviews/style.scss +0 -4
- package/build/components/global-styles/screen-typeset.js +0 -40
- package/build/components/global-styles/screen-typeset.js.map +0 -1
- package/build/components/global-styles/typeset-button.js +0 -98
- package/build/components/global-styles/typeset-button.js.map +0 -1
- package/build-module/components/global-styles/screen-typeset.js +0 -34
- package/build-module/components/global-styles/screen-typeset.js.map +0 -1
- package/build-module/components/global-styles/typeset-button.js +0 -90
- package/build-module/components/global-styles/typeset-button.js.map +0 -1
- package/src/components/global-styles/screen-typeset.js +0 -42
- package/src/components/global-styles/typeset-button.js +0 -100
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_editor","_i18n","_coreData","_blockLibrary","_element","_notices","_router","_preferences","_htmlEntities","_icons","_welcomeGuide","_store","_globalStylesRenderer","_canvasLoader","_lockUnlock","_useSiteEditorSettings","_pluginTemplateSettingPanel","_globalStylesSidebar","_isPreviewingTheme2","_editorCanvasContainer","_saveButton","_savePanel","_moreMenu","_siteIcon","_useEditorIframeProps","_useEditorTitle","_hooks","_jsxRuntime","Editor","BackButton","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","toggleHomeIconVariants","edit","opacity","scale","hover","clipPath","siteIconVariants","tap","EditSiteEditor","isPostsList","disableMotion","useReducedMotion","params","isLoading","useIsSiteEditorLoading","editedPostType","editedPostId","contextPostType","contextPostId","canvasMode","isEditingPage","supportsGlobalStyles","showIconLabels","editorCanvasView","currentPostIsTrashed","hasSiteIcon","useSelect","select","getEditorCanvasContainerView","getEditedPostContext","getCanvasMode","isPage","getEditedPostType","getEditedPostId","editSiteStore","get","preferencesStore","getCurrentTheme","getEntityRecord","coreDataStore","_context","siteData","undefined","postId","postType","is_block_theme","editorStore","getCurrentPostAttribute","site_icon_url","useEditorTitle","_isPreviewingTheme","isPreviewingTheme","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","iframeProps","useEditorIframeProps","isEditMode","postWithTemplate","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","styles","useMemo","css","setCanvasMode","useDispatch","createSuccessNotice","noticesStore","history","onActionPerformed","useCallback","actionId","items","push","type","newItem","_title","title","rendered","sprintf","__","decodeEntities","id","actions","label","onClick","canvas","getEditorCanvasContainerTitle","isReady","transition","duration","jsxs","Fragment","children","jsx","GlobalStylesRenderer","EditorKeyboardShortcutsRegister","default","templateId","className","clsx","enableRegionNavigation","customSaveButton","size","customSavePanel","forceDisableBlockTools","extraSidebarPanels","Slot","length","__unstableMotion","div","animate","initial","whileHover","whileTap","Button","__next40pxDefaultSize","showTooltip","tooltipPosition","focusMode","page","variants","Icon","icon","homeButton"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { Icon, homeButton } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport GlobalStylesSidebar from '../global-styles-sidebar';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport SaveButton from '../save-button';\nimport SavePanel from '../save-panel';\nimport SiteEditorMoreMenu from '../more-menu';\nimport SiteIcon from '../site-icon';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport useEditorTitle from './use-editor-title';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nexport default function EditSiteEditor( { isPostsList = false } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst { params } = useLocation();\n\tconst isLoading = useIsSiteEditorLoading();\n\tconst {\n\t\teditedPostType,\n\t\teditedPostId,\n\t\tcontextPostType,\n\t\tcontextPostId,\n\t\tcanvasMode,\n\t\tisEditingPage,\n\t\tsupportsGlobalStyles,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tcurrentPostIsTrashed,\n\t\thasSiteIcon,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditorCanvasContainerView,\n\t\t\tgetEditedPostContext,\n\t\t\tgetCanvasMode,\n\t\t\tisPage,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getCurrentTheme, getEntityRecord } = select( coreDataStore );\n\t\tconst _context = getEditedPostContext();\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\teditedPostType: getEditedPostType(),\n\t\t\teditedPostId: getEditedPostId(),\n\t\t\tcontextPostType: _context?.postId ? _context.postType : undefined,\n\t\t\tcontextPostId: _context?.postId ? _context.postId : undefined,\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tisEditingPage: isPage(),\n\t\t\tsupportsGlobalStyles: getCurrentTheme()?.is_block_theme,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: getEditorCanvasContainerView(),\n\t\t\tcurrentPostIsTrashed:\n\t\t\t\tselect( editorStore ).getCurrentPostAttribute( 'status' ) ===\n\t\t\t\t'trash',\n\t\t\thasSiteIcon: !! siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\tuseEditorTitle();\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvasMode === 'edit';\n\tconst postWithTemplate = !! contextPostId;\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\tcss:\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? `body{min-height: 100vh; ${\n\t\t\t\t\t\t\t\tcurrentPostIsTrashed ? '' : 'cursor: pointer;'\n\t\t\t\t\t\t }}`\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, canvasMode, currentPostIsTrashed ]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostType: items[ 0 ].type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\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\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\t// Replace the title and icon displayed in the DocumentBar when there's an overlay visible.\n\tconst title = getEditorCanvasContainerTitle( editorCanvasView );\n\n\tconst isReady = ! isLoading;\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesRenderer />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={\n\t\t\t\t\t\tpostWithTemplate ? contextPostType : editedPostType\n\t\t\t\t\t}\n\t\t\t\t\tpostId={ postWithTemplate ? contextPostId : editedPostId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? editedPostId : undefined }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tclassName={ clsx( 'edit-site-editor__editor-interface', {\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t} ) }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tcustomSavePanel={ _isPreviewingTheme && <SavePanel /> }\n\t\t\t\t\tforceDisableBlockTools={ ! hasDefaultEditorCanvasView }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingPage && <PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__view-mode-toggle\"\n\t\t\t\t\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\t\t\t\t\tanimate=\"edit\"\n\t\t\t\t\t\t\t\t\t\tinitial=\"edit\"\n\t\t\t\t\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\t\t\t\t\twhileTap=\"tap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetCanvasMode( 'view' );\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO: this is a temporary solution to navigate to the posts list if we are\n\t\t\t\t\t\t\t\t\t\t\t\t// come here through `posts list` and are in focus mode editing a template, template part etc..\n\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPostsList &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tparams?.focusMode\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpage: 'gutenberg-posts-dashboard',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostType: 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\tvariants={ siteIconVariants }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-editor__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-editor__back-icon',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'has-site-icon':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thasSiteIcon,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tvariants={ toggleHomeIconVariants }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ homeButton } />\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t\t\t</Editor>\n\t\t\t) }\n\t\t</>\n\t);\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A0G,GAAA,EAACpH,oBAAA,CAAAuH,OAAmB,IAAE,CAAC;IAAA,CAC1C,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_editor","_i18n","_coreData","_blockLibrary","_element","_notices","_router","_preferences","_htmlEntities","_icons","_welcomeGuide","_store","_globalStylesRenderer","_canvasLoader","_lockUnlock","_useSiteEditorSettings","_pluginTemplateSettingPanel","_globalStylesSidebar","_isPreviewingTheme2","_editorCanvasContainer","_saveButton","_savePanel","_moreMenu","_siteIcon","_useEditorIframeProps","_useEditorTitle","_hooks","_jsxRuntime","Editor","BackButton","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","toggleHomeIconVariants","edit","opacity","scale","hover","clipPath","siteIconVariants","tap","EditSiteEditor","isPostsList","disableMotion","useReducedMotion","params","isLoading","useIsSiteEditorLoading","editedPostType","editedPostId","contextPostType","contextPostId","canvasMode","isEditingPage","supportsGlobalStyles","showIconLabels","editorCanvasView","currentPostIsTrashed","hasSiteIcon","useSelect","select","getEditorCanvasContainerView","getEditedPostContext","getCanvasMode","isPage","getEditedPostType","getEditedPostId","editSiteStore","get","preferencesStore","getCurrentTheme","getEntityRecord","coreDataStore","_context","siteData","undefined","postId","postType","is_block_theme","editorStore","getCurrentPostAttribute","site_icon_url","useEditorTitle","_isPreviewingTheme","isPreviewingTheme","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","iframeProps","useEditorIframeProps","isEditMode","postWithTemplate","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","styles","useMemo","css","setCanvasMode","useDispatch","createSuccessNotice","noticesStore","history","onActionPerformed","useCallback","actionId","items","push","type","newItem","_title","title","rendered","sprintf","__","decodeEntities","id","actions","label","onClick","canvas","getEditorCanvasContainerTitle","isReady","transition","duration","jsxs","Fragment","children","jsx","GlobalStylesRenderer","EditorKeyboardShortcutsRegister","default","templateId","className","clsx","enableRegionNavigation","customSaveButton","size","customSavePanel","forceDisableBlockTools","extraSidebarPanels","Slot","length","__unstableMotion","div","animate","initial","whileHover","whileTap","Button","__next40pxDefaultSize","showTooltip","tooltipPosition","focusMode","page","variants","Icon","icon","arrowUpLeft"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { Icon, arrowUpLeft } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport GlobalStylesSidebar from '../global-styles-sidebar';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport SaveButton from '../save-button';\nimport SavePanel from '../save-panel';\nimport SiteEditorMoreMenu from '../more-menu';\nimport SiteIcon from '../site-icon';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport useEditorTitle from './use-editor-title';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nexport default function EditSiteEditor( { isPostsList = false } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst { params } = useLocation();\n\tconst isLoading = useIsSiteEditorLoading();\n\tconst {\n\t\teditedPostType,\n\t\teditedPostId,\n\t\tcontextPostType,\n\t\tcontextPostId,\n\t\tcanvasMode,\n\t\tisEditingPage,\n\t\tsupportsGlobalStyles,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tcurrentPostIsTrashed,\n\t\thasSiteIcon,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditorCanvasContainerView,\n\t\t\tgetEditedPostContext,\n\t\t\tgetCanvasMode,\n\t\t\tisPage,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getCurrentTheme, getEntityRecord } = select( coreDataStore );\n\t\tconst _context = getEditedPostContext();\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\teditedPostType: getEditedPostType(),\n\t\t\teditedPostId: getEditedPostId(),\n\t\t\tcontextPostType: _context?.postId ? _context.postType : undefined,\n\t\t\tcontextPostId: _context?.postId ? _context.postId : undefined,\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tisEditingPage: isPage(),\n\t\t\tsupportsGlobalStyles: getCurrentTheme()?.is_block_theme,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: getEditorCanvasContainerView(),\n\t\t\tcurrentPostIsTrashed:\n\t\t\t\tselect( editorStore ).getCurrentPostAttribute( 'status' ) ===\n\t\t\t\t'trash',\n\t\t\thasSiteIcon: !! siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\tuseEditorTitle();\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvasMode === 'edit';\n\tconst postWithTemplate = !! contextPostId;\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\tcss:\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? `body{min-height: 100vh; ${\n\t\t\t\t\t\t\t\tcurrentPostIsTrashed ? '' : 'cursor: pointer;'\n\t\t\t\t\t\t }}`\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, canvasMode, currentPostIsTrashed ]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostType: items[ 0 ].type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\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\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\t// Replace the title and icon displayed in the DocumentBar when there's an overlay visible.\n\tconst title = getEditorCanvasContainerTitle( editorCanvasView );\n\n\tconst isReady = ! isLoading;\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesRenderer />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={\n\t\t\t\t\t\tpostWithTemplate ? contextPostType : editedPostType\n\t\t\t\t\t}\n\t\t\t\t\tpostId={ postWithTemplate ? contextPostId : editedPostId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? editedPostId : undefined }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tclassName={ clsx( 'edit-site-editor__editor-interface', {\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t} ) }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tcustomSavePanel={ _isPreviewingTheme && <SavePanel /> }\n\t\t\t\t\tforceDisableBlockTools={ ! hasDefaultEditorCanvasView }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingPage && <PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__view-mode-toggle\"\n\t\t\t\t\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\t\t\t\t\tanimate=\"edit\"\n\t\t\t\t\t\t\t\t\t\tinitial=\"edit\"\n\t\t\t\t\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\t\t\t\t\twhileTap=\"tap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetCanvasMode( 'view' );\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO: this is a temporary solution to navigate to the posts list if we are\n\t\t\t\t\t\t\t\t\t\t\t\t// come here through `posts list` and are in focus mode editing a template, template part etc..\n\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPostsList &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tparams?.focusMode\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpage: 'gutenberg-posts-dashboard',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostType: 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\tvariants={ siteIconVariants }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-editor__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-editor__back-icon',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'has-site-icon':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thasSiteIcon,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tvariants={ toggleHomeIconVariants }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ arrowUpLeft } />\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t\t\t</Editor>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,G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,EAChB;gBACDnD,OAAO,CAACK,IAAI,CAAE;kBACb+C,IAAI,EAAE,2BAA2B;kBACjC9E,QAAQ,EAAE;gBACX,CAAE,CAAC;cACJ;YACD,CAAG;YAAAmD,QAAA,eAEH,IAAAzG,WAAA,CAAA0G,GAAA,EAACvI,WAAA,CAAAsJ,gBAAM,CAACC,GAAG;cACVW,QAAQ,EAAGrH,gBAAkB;cAAAyF,QAAA,eAE7B,IAAAzG,WAAA,CAAA0G,GAAA,EAAC9G,SAAA,CAAAiH,OAAQ;gBAACE,SAAS,EAAC;cAAyC,CAAE;YAAC,CACrD;UAAC,CACN,CAAC,eACT,IAAA/G,WAAA,CAAA0G,GAAA,EAACvI,WAAA,CAAAsJ,gBAAM,CAACC,GAAG;YACVX,SAAS,EAAG,IAAAC,aAAI,EACf,6BAA6B,EAC7B;cACC,eAAe,EACd7E;YACF,CACD,CAAG;YACHkG,QAAQ,EAAG3H,sBAAwB;YAAA+F,QAAA,eAEnC,IAAAzG,WAAA,CAAA0G,GAAA,EAAC5H,MAAA,CAAAwJ,IAAI;cAACC,IAAI,EAAGC;YAAa,CAAE;UAAC,CAClB,CAAC;QAAA,CACF;MACZ,CAES,CACZ,eACD,IAAAxI,WAAA,CAAA0G,GAAA,EAAC/G,SAAA,CAAAkH,OAAkB,IAAE,CAAC,EACpB9E,oBAAoB,iBAAI,IAAA/B,WAAA,CAAA0G,GAAA,EAACpH,oBAAA,CAAAuH,OAAmB,IAAE,CAAC;IAAA,CAC1C,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -51,11 +51,10 @@ function FontFamilies() {
|
|
|
51
51
|
defaultTabId: modalTabOpen
|
|
52
52
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
53
53
|
spacing: 4,
|
|
54
|
-
children: [themeFonts.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
54
|
+
children: [[...themeFonts, ...customFonts].length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
55
55
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_subtitle.default, {
|
|
56
56
|
level: 3,
|
|
57
|
-
children:
|
|
58
|
-
(0, _i18n._x)('Theme', 'font source')
|
|
57
|
+
children: (0, _i18n.__)('Fonts')
|
|
59
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
|
|
60
59
|
size: "large",
|
|
61
60
|
isBordered: true,
|
|
@@ -64,19 +63,6 @@ function FontFamilies() {
|
|
|
64
63
|
font: font
|
|
65
64
|
}, font.slug))
|
|
66
65
|
})]
|
|
67
|
-
}), customFonts.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
68
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_subtitle.default, {
|
|
69
|
-
level: 3,
|
|
70
|
-
children: /* translators: Heading for a list of fonts installed by the user. */
|
|
71
|
-
(0, _i18n._x)('Custom', 'font source')
|
|
72
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
|
|
73
|
-
size: "large",
|
|
74
|
-
isBordered: true,
|
|
75
|
-
isSeparated: true,
|
|
76
|
-
children: customFonts.map(font => /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontFamilyItem.default, {
|
|
77
|
-
font: font
|
|
78
|
-
}, font.slug))
|
|
79
|
-
})]
|
|
80
66
|
}), !hasFonts && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
81
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_subtitle.default, {
|
|
82
68
|
level: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blockEditor","_element","_context","_interopRequireWildcard","_fontLibraryModal","_interopRequireDefault","_fontFamilyItem","_subtitle","_utils","_lockUnlock","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useGlobalSetting","unlock","blockEditorPrivateApis","FontFamilies","baseCustomFonts","modalTabOpen","setModalTabOpen","useContext","FontLibraryContext","fontFamilies","baseFontFamilies","undefined","themeFonts","theme","map","f","setUIValuesNeeded","source","sort","b","name","localeCompare","customFonts","custom","hasFonts","length","hasInstalledFonts","jsxs","Fragment","children","jsx","onRequestClose","defaultTabId","__experimentalVStack","spacing","level","_x","__experimentalItemGroup","size","isBordered","isSeparated","font","slug","__","__experimentalText","as","Button","className","variant","__next40pxDefaultSize","onClick","_default","props","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/font-families.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalText as Text,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider, {\n\tFontLibraryContext,\n} from './font-library-modal/context';\nimport FontLibraryModal from './font-library-modal';\nimport FontFamilyItem from './font-family-item';\nimport Subtitle from './subtitle';\nimport { setUIValuesNeeded } from './font-library-modal/utils';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontFamilies() {\n\tconst { baseCustomFonts, modalTabOpen, setModalTabOpen } =\n\t\tuseContext( FontLibraryContext );\n\tconst [ fontFamilies ] = useGlobalSetting( 'typography.fontFamilies' );\n\tconst [ baseFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies',\n\t\tundefined,\n\t\t'base'\n\t);\n\tconst themeFonts = fontFamilies?.theme\n\t\t? fontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\tconst customFonts = fontFamilies?.custom\n\t\t? fontFamilies.custom\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\tconst hasFonts = 0 < customFonts.length || 0 < themeFonts.length;\n\n\tconst hasInstalledFonts =\n\t\thasFonts ||\n\t\tbaseFontFamilies?.theme?.length > 0 ||\n\t\tbaseCustomFonts?.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! modalTabOpen && (\n\t\t\t\t<FontLibraryModal\n\t\t\t\t\tonRequestClose={ () => setModalTabOpen( null ) }\n\t\t\t\t\tdefaultTabId={ modalTabOpen }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t{ themeFonts.length > 0 && (\n\t\t\t\t\t<VStack>\n\t\t\t\t\t\t<Subtitle level={ 3 }>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Heading for a list of fonts provided by the theme. */\n\t\t\t\t\t\t\t\t_x( 'Theme', 'font source' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</Subtitle>\n\t\t\t\t\t\t<ItemGroup size=\"large\" isBordered isSeparated>\n\t\t\t\t\t\t\t{ themeFonts.map( ( font ) => (\n\t\t\t\t\t\t\t\t<FontFamilyItem\n\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t) }\n\t\t\t\t{ customFonts.length > 0 && (\n\t\t\t\t\t<VStack>\n\t\t\t\t\t\t<Subtitle level={ 3 }>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: Heading for a list of fonts installed by the user. */\n\t\t\t\t\t\t\t\t_x( 'Custom', 'font source' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</Subtitle>\n\t\t\t\t\t\t<ItemGroup size=\"large\" isBordered isSeparated>\n\t\t\t\t\t\t\t{ customFonts.map( ( font ) => (\n\t\t\t\t\t\t\t\t<FontFamilyItem\n\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t) }\n\t\t\t\t{ ! hasFonts && (\n\t\t\t\t\t<VStack>\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t\t<Text as=\"p\">\n\t\t\t\t\t\t\t{ hasInstalledFonts\n\t\t\t\t\t\t\t\t? __( 'No fonts activated.' )\n\t\t\t\t\t\t\t\t: __( 'No fonts installed.' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</VStack>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-global-styles-font-families__manage-fonts\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetModalTabOpen(\n\t\t\t\t\t\t\thasInstalledFonts\n\t\t\t\t\t\t\t\t? 'installed-fonts'\n\t\t\t\t\t\t\t\t: 'upload-fonts'\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ hasInstalledFonts\n\t\t\t\t\t\t? __( 'Manage fonts' )\n\t\t\t\t\t\t: __( 'Add fonts' ) }\n\t\t\t\t</Button>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default ( { ...props } ) => (\n\t<FontLibraryProvider>\n\t\t<FontFamilies { ...props } />\n\t</FontLibraryProvider>\n);\n"],"mappings":";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O,EAAC,WAAW;QACnBC,qBAAqB;QACrBC,OAAO,EAAGA,CAAA,KAAM;UACf5C,eAAe,CACdoB,iBAAiB,GACd,iBAAiB,GACjB,cACJ,CAAC;QACF,CAAG;QAAAG,QAAA,EAEDH,iBAAiB,GAChB,IAAAiB,QAAE,EAAE,cAAe,CAAC,GACpB,IAAAA,QAAE,EAAE,WAAY;MAAC,CACb,CAAC;IAAA,CACF,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAQ,QAAA,GAEcA,CAAE;EAAE,GAAGC;AAAM,CAAC,kBAC5B,IAAAzE,WAAA,CAAAmD,GAAA,EAAC3D,QAAA,CAAAe,OAAmB;EAAA2C,QAAA,eACnB,IAAAlD,WAAA,CAAAmD,GAAA,EAAC3B,YAAY;IAAA,GAAMiD;EAAK,CAAI;AAAC,CACT,CACrB;AAAAC,OAAA,CAAAnE,OAAA,GAAAiE,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_element","_context","_interopRequireWildcard","_fontLibraryModal","_interopRequireDefault","_fontFamilyItem","_subtitle","_utils","_lockUnlock","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useGlobalSetting","unlock","blockEditorPrivateApis","FontFamilies","baseCustomFonts","modalTabOpen","setModalTabOpen","useContext","FontLibraryContext","fontFamilies","baseFontFamilies","undefined","themeFonts","theme","map","f","setUIValuesNeeded","source","sort","b","name","localeCompare","customFonts","custom","hasFonts","length","hasInstalledFonts","jsxs","Fragment","children","jsx","onRequestClose","defaultTabId","__experimentalVStack","spacing","level","__","__experimentalItemGroup","size","isBordered","isSeparated","font","slug","__experimentalText","as","Button","className","variant","__next40pxDefaultSize","onClick","_default","props","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/font-families.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalText as Text,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider, {\n\tFontLibraryContext,\n} from './font-library-modal/context';\nimport FontLibraryModal from './font-library-modal';\nimport FontFamilyItem from './font-family-item';\nimport Subtitle from './subtitle';\nimport { setUIValuesNeeded } from './font-library-modal/utils';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontFamilies() {\n\tconst { baseCustomFonts, modalTabOpen, setModalTabOpen } =\n\t\tuseContext( FontLibraryContext );\n\tconst [ fontFamilies ] = useGlobalSetting( 'typography.fontFamilies' );\n\tconst [ baseFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies',\n\t\tundefined,\n\t\t'base'\n\t);\n\tconst themeFonts = fontFamilies?.theme\n\t\t? fontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\tconst customFonts = fontFamilies?.custom\n\t\t? fontFamilies.custom\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\tconst hasFonts = 0 < customFonts.length || 0 < themeFonts.length;\n\n\tconst hasInstalledFonts =\n\t\thasFonts ||\n\t\tbaseFontFamilies?.theme?.length > 0 ||\n\t\tbaseCustomFonts?.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! modalTabOpen && (\n\t\t\t\t<FontLibraryModal\n\t\t\t\t\tonRequestClose={ () => setModalTabOpen( null ) }\n\t\t\t\t\tdefaultTabId={ modalTabOpen }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t{ [ ...themeFonts, ...customFonts ].length > 0 && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t\t<ItemGroup size=\"large\" isBordered isSeparated>\n\t\t\t\t\t\t\t{ themeFonts.map( ( font ) => (\n\t\t\t\t\t\t\t\t<FontFamilyItem\n\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ ! hasFonts && (\n\t\t\t\t\t<VStack>\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t\t<Text as=\"p\">\n\t\t\t\t\t\t\t{ hasInstalledFonts\n\t\t\t\t\t\t\t\t? __( 'No fonts activated.' )\n\t\t\t\t\t\t\t\t: __( 'No fonts installed.' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</VStack>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-global-styles-font-families__manage-fonts\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetModalTabOpen(\n\t\t\t\t\t\t\thasInstalledFonts\n\t\t\t\t\t\t\t\t? 'installed-fonts'\n\t\t\t\t\t\t\t\t: 'upload-fonts'\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ hasInstalledFonts\n\t\t\t\t\t\t? __( 'Manage fonts' )\n\t\t\t\t\t\t: __( 'Add fonts' ) }\n\t\t\t\t</Button>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default ( { ...props } ) => (\n\t<Font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AAC,OAAA,CAAAlE,OAAA,GAAAgE,QAAA","ignoreList":[]}
|
|
@@ -11,8 +11,8 @@ var _data = require("@wordpress/data");
|
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
12
|
var _typographyElements = _interopRequireDefault(require("./typography-elements"));
|
|
13
13
|
var _header = _interopRequireDefault(require("./header"));
|
|
14
|
+
var _variationsTypography = _interopRequireDefault(require("./variations/variations-typography"));
|
|
14
15
|
var _fontSizesCount = _interopRequireDefault(require("./font-sizes/font-sizes-count"));
|
|
15
|
-
var _typesetButton = _interopRequireDefault(require("./typeset-button"));
|
|
16
16
|
var _fontFamilies = _interopRequireDefault(require("./font-families"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
/**
|
|
@@ -28,12 +28,14 @@ function ScreenTypography() {
|
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
29
29
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
|
|
30
30
|
title: (0, _i18n.__)('Typography'),
|
|
31
|
-
description: (0, _i18n.__)('
|
|
31
|
+
description: (0, _i18n.__)('Available fonts, typographic styles, and the application of those styles.')
|
|
32
32
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
33
|
className: "edit-site-global-styles-screen",
|
|
34
34
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
35
35
|
spacing: 7,
|
|
36
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
|
|
37
|
+
title: (0, _i18n.__)('Typesets')
|
|
38
|
+
}), fontLibraryEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontFamilies.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typographyElements.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontSizesCount.default, {})]
|
|
37
39
|
})
|
|
38
40
|
})]
|
|
39
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_editor","_typographyElements","_interopRequireDefault","_header","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_editor","_typographyElements","_interopRequireDefault","_header","_variationsTypography","_fontSizesCount","_fontFamilies","_jsxRuntime","ScreenTypography","fontLibraryEnabled","useSelect","select","editorStore","getEditorSettings","jsxs","Fragment","children","jsx","default","title","__","description","className","__experimentalVStack","spacing","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TypographyElements from './typography-elements';\nimport ScreenHeader from './header';\nimport TypographyVariations from './variations/variations-typography';\nimport FontSizesCount from './font-sizes/font-sizes-count';\nimport FontFamilies from './font-families';\n\nfunction ScreenTypography() {\n\tconst fontLibraryEnabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().fontLibraryEnabled,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Available fonts, typographic styles, and the application of those styles.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack spacing={ 7 }>\n\t\t\t\t\t<TypographyVariations title={ __( 'Typesets' ) } />\n\t\t\t\t\t{ fontLibraryEnabled && <FontFamilies /> }\n\t\t\t\t\t<TypographyElements />\n\t\t\t\t\t<FontSizesCount />\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"],"mapp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AAY,IAAE,CAAC,eACxC,IAAAX,WAAA,CAAAU,GAAA,EAAChB,mBAAA,CAAAiB,OAAkB,IAAE,CAAC,eACtB,IAAAX,WAAA,CAAAU,GAAA,EAACZ,eAAA,CAAAa,OAAc,IAAE,CAAC;MAAA,CACX;IAAC,CACL,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEcV,gBAAgB","ignoreList":[]}
|
|
@@ -18,7 +18,6 @@ var _screenRoot = _interopRequireDefault(require("./screen-root"));
|
|
|
18
18
|
var _screenBlockList = _interopRequireWildcard(require("./screen-block-list"));
|
|
19
19
|
var _screenBlock = _interopRequireDefault(require("./screen-block"));
|
|
20
20
|
var _screenTypography = _interopRequireDefault(require("./screen-typography"));
|
|
21
|
-
var _screenTypeset = _interopRequireDefault(require("./screen-typeset"));
|
|
22
21
|
var _screenTypographyElement = _interopRequireDefault(require("./screen-typography-element"));
|
|
23
22
|
var _fontSize = _interopRequireDefault(require("./font-sizes/font-size"));
|
|
24
23
|
var _fontSizes = _interopRequireDefault(require("./font-sizes/font-sizes"));
|
|
@@ -287,9 +286,6 @@ function GlobalStylesUI() {
|
|
|
287
286
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesNavigationScreen, {
|
|
288
287
|
path: "/typography/font-sizes/:origin/:slug",
|
|
289
288
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontSize.default, {})
|
|
290
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesNavigationScreen, {
|
|
291
|
-
path: "/typography/typeset",
|
|
292
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_screenTypeset.default, {})
|
|
293
289
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesNavigationScreen, {
|
|
294
290
|
path: "/typography/text",
|
|
295
291
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_screenTypographyElement.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_blocks","_data","_blockEditor","_i18n","_preferences","_icons","_coreData","_element","_screenRoot","_interopRequireDefault","_screenBlockList","_interopRequireWildcard","_screenBlock","_screenTypography","_screenTypeset","_screenTypographyElement","_fontSize","_fontSizes","_screenColors","_screenColorPalette","_screenBackground","_screenShadows","_screenLayout","_screenStyleVariations","_styleBook","_screenCss","_screenRevisions","_lockUnlock","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SLOT_FILL_NAME","useGlobalStylesReset","unlock","blockEditorPrivateApis","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","createSlotFill","exports","GlobalStylesActionMenu","canReset","onReset","toggle","useDispatch","preferencesStore","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","editSiteStore","goTo","useNavigator","loadCustomCSS","jsx","children","DropdownMenu","icon","moreVertical","label","__","toggleProps","size","onClose","jsxs","Fragment","MenuGroup","MenuItem","onClick","disabled","GlobalStylesNavigationScreen","className","props","__experimentalNavigatorScreen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","useBlockHasGlobalStyles","useEffect","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","getBlockTypes","__experimentalNavigatorProvider","initialPath","element","ScreenShadows","ScreenShadowsEdit","block","_default"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypeset from './screen-typeset';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackground from './screen-background';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/typeset\">\n\t\t\t\t<ScreenTypeset />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/background\">\n\t\t\t\t<ScreenBackground />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAC,uBAAA,CAAAZ,OAAA;AAIA,IAAAa,YAAA,GAAAH,sBAAA,CAAAV,OAAA;AACA,IAAAc,iBAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,cAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,wBAAA,GAAAN,sBAAA,CAAAV,OAAA;AACA,IAAAiB,SAAA,GAAAP,sBAAA,CAAAV,OAAA;AACA,IAAAkB,UAAA,GAAAR,sBAAA,CAAAV,OAAA;AACA,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CAACvC,IAIC,CAC7B,CAAC,eAEH,IAAAnF,WAAA,CAAAoD,GAAA,EAACiC,cAAc,IAAE,CAAC,EAEhB8B,MAAM,CAACpC,GAAG,CAAI2C,KAAK,iBACpB,IAAA1H,WAAA,CAAAoD,GAAA,EAACiC,cAAc;MAEdF,IAAI,EAAGuC,KAAK,CAACvC,IAAM;MACnBP,UAAU,EAAG,UAAU,GAAGkB,kBAAkB,CAAE4B,KAAK,CAACvC,IAAK;IAAG,GAFtD,gBAAgB,GAAGuC,KAAK,CAACvC,IAG/B,CACA,CAAC,EAED,YAAY,KAAK4B,yBAAyB,iBAC3C,IAAA/G,WAAA,CAAAoD,GAAA,EAACsC,qBAAqB,IAAE,CACxB,eAED,IAAA1F,WAAA,CAAAoD,GAAA,EAACrB,sBAAsB,IAAE,CAAC,eAC1B,IAAA/B,WAAA,CAAAoD,GAAA,EAAC6C,qBAAqB,IAAE,CAAC,eACzB,IAAAjG,WAAA,CAAAoD,GAAA,EAAC0D,qCAAqC,IAAE,CAAC;EAAA,CACvB,CAAC;AAEtB;AAAC,IAAAa,QAAA,GAAA7F,OAAA,CAAAvB,OAAA,GAEc2G,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_blocks","_data","_blockEditor","_i18n","_preferences","_icons","_coreData","_element","_screenRoot","_interopRequireDefault","_screenBlockList","_interopRequireWildcard","_screenBlock","_screenTypography","_screenTypographyElement","_fontSize","_fontSizes","_screenColors","_screenColorPalette","_screenBackground","_screenShadows","_screenLayout","_screenStyleVariations","_styleBook","_screenCss","_screenRevisions","_lockUnlock","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SLOT_FILL_NAME","useGlobalStylesReset","unlock","blockEditorPrivateApis","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","createSlotFill","exports","GlobalStylesActionMenu","canReset","onReset","toggle","useDispatch","preferencesStore","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","editSiteStore","goTo","useNavigator","loadCustomCSS","jsx","children","DropdownMenu","icon","moreVertical","label","__","toggleProps","size","onClose","jsxs","Fragment","MenuGroup","MenuItem","onClick","disabled","GlobalStylesNavigationScreen","className","props","__experimentalNavigatorScreen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","useBlockHasGlobalStyles","useEffect","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","getBlockTypes","__experimentalNavigatorProvider","initialPath","element","ScreenShadows","ScreenShadowsEdit","block","_default"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenBackground from './screen-background';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/background\">\n\t\t\t\t<ScreenBackground />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE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Suffix
|
|
39
|
+
suffix
|
|
41
40
|
}) {
|
|
42
41
|
const {
|
|
43
42
|
params: {
|
|
@@ -63,7 +62,6 @@ function DataViewItem({
|
|
|
63
62
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
64
63
|
icon: iconToUse,
|
|
65
64
|
...linkInfo,
|
|
66
|
-
suffix: navigationItemSuffix,
|
|
67
65
|
"aria-current": isActive ? 'true' : undefined,
|
|
68
66
|
children: title
|
|
69
67
|
}), suffix]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_link","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_link","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","postType","iconToUse","VIEW_LAYOUTS","find","v","activeView","undefined","linkInfo","useLink","layout","jsxs","__experimentalHStack","justify","className","clsx","children","jsx","default"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { postType },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tlet activeView = isCustom ? customViewId : slug;\n\tif ( activeView === 'all' ) {\n\t\tactiveView = undefined;\n\t}\n\tconst linkInfo = useLink( {\n\t\tpostType,\n\t\tlayout: type,\n\t\tactiveView,\n\t\tisCustom: isCustom ? 'true' : undefined,\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAjB3C;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAS;EACpB,CAAC,GAAGb,WAAW,CAAC,CAAC;EAEjB,MAAMc,SAAS,GACdN,IAAI,IAAIO,uBAAY,CAACC,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACV,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,IAAIU,UAAU,GAAGR,QAAQ,GAAGJ,YAAY,GAAGD,IAAI;EAC/C,IAAKa,UAAU,KAAK,KAAK,EAAG;IAC3BA,UAAU,GAAGC,SAAS;EACvB;EACA,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBR,QAAQ;IACRS,MAAM,EAAEf,IAAI;IACZW,UAAU;IACVR,QAAQ,EAAEA,QAAQ,GAAG,MAAM,GAAGS;EAC/B,CAAE,CAAC;EACH,oBACC,IAAApB,WAAA,CAAAwB,IAAA,EAAC7B,WAAA,CAAA8B,oBAAM;IACNC,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG,IAAAC,aAAI,EAAE,2CAA2C,EAAE;MAC9D,aAAa,EAAElB;IAChB,CAAE,CAAG;IAAAmB,QAAA,gBAEL,IAAA7B,WAAA,CAAA8B,GAAA,EAAChC,sBAAA,CAAAiC,OAAqB;MACrBtB,IAAI,EAAGM,SAAW;MAAA,GACbM,QAAQ;MACb,gBAAeX,QAAQ,GAAG,MAAM,GAAGU,SAAW;MAAAS,QAAA,EAE5CxB;IAAK,CACe,CAAC,EACtBO,MAAM;EAAA,CACD,CAAC;AAEX","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultLayouts = void 0;
|
|
7
7
|
exports.useDefaultViews = useDefaultViews;
|
|
8
|
-
exports.useDefaultViewsWithItemCounts = useDefaultViewsWithItemCounts;
|
|
9
8
|
var _i18n = require("@wordpress/i18n");
|
|
10
9
|
var _icons = require("@wordpress/icons");
|
|
11
10
|
var _data = require("@wordpress/data");
|
|
@@ -60,47 +59,6 @@ const DEFAULT_POST_BASE = {
|
|
|
60
59
|
fields: ['title', 'author', 'status'],
|
|
61
60
|
layout: defaultLayouts[_constants.LAYOUT_LIST].layout
|
|
62
61
|
};
|
|
63
|
-
function useDefaultViewsWithItemCounts({
|
|
64
|
-
postType
|
|
65
|
-
}) {
|
|
66
|
-
const defaultViews = useDefaultViews({
|
|
67
|
-
postType
|
|
68
|
-
});
|
|
69
|
-
const {
|
|
70
|
-
records,
|
|
71
|
-
totalItems
|
|
72
|
-
} = (0, _coreData.useEntityRecords)('postType', postType, {
|
|
73
|
-
per_page: -1,
|
|
74
|
-
status: ['any', 'trash']
|
|
75
|
-
});
|
|
76
|
-
return (0, _element.useMemo)(() => {
|
|
77
|
-
if (!defaultViews) {
|
|
78
|
-
return [];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// If there are no records, return the default views with no counts.
|
|
82
|
-
if (!records) {
|
|
83
|
-
return defaultViews;
|
|
84
|
-
}
|
|
85
|
-
const counts = {
|
|
86
|
-
drafts: records.filter(record => record.status === 'draft').length,
|
|
87
|
-
future: records.filter(record => record.status === 'future').length,
|
|
88
|
-
pending: records.filter(record => record.status === 'pending').length,
|
|
89
|
-
private: records.filter(record => record.status === 'private').length,
|
|
90
|
-
published: records.filter(record => record.status === 'publish').length,
|
|
91
|
-
trash: records.filter(record => record.status === 'trash').length
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// All items excluding trashed items as per the default "all" status query.
|
|
95
|
-
counts.all = totalItems ? totalItems - counts.trash : 0;
|
|
96
|
-
|
|
97
|
-
// Filter out views with > 0 item counts.
|
|
98
|
-
return defaultViews.map(_view => {
|
|
99
|
-
_view.count = counts[_view.slug];
|
|
100
|
-
return _view;
|
|
101
|
-
});
|
|
102
|
-
}, [defaultViews, records, totalItems]);
|
|
103
|
-
}
|
|
104
62
|
function useDefaultViews({
|
|
105
63
|
postType
|
|
106
64
|
}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","layout","primaryField","styles","width","title","maxWidth","LAYOUT_GRID","mediaField","LAYOUT_LIST","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViewsWithItemCounts","postType","defaultViews","useDefaultViews","records","totalItems","useEntityRecords","per_page","status","useMemo","counts","drafts","filter","record","length","future","pending","private","published","trash","all","map","_view","count","slug","labels","useSelect","select","getPostType","coreStore","all_items","__","icon","pages","view","operator","OPERATOR_IS_ANY","value","scheduled","notAllowed"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore, useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\t'featured-image': {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured-image',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured-image',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViewsWithItemCounts( { postType } ) {\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { records, totalItems } = useEntityRecords( 'postType', postType, {\n\t\tper_page: -1,\n\t\tstatus: [ 'any', 'trash' ],\n\t} );\n\n\treturn useMemo( () => {\n\t\tif ( ! defaultViews ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// If there are no records, return the default views with no counts.\n\t\tif ( ! records ) {\n\t\t\treturn defaultViews;\n\t\t}\n\n\t\tconst counts = {\n\t\t\tdrafts: records.filter( ( record ) => record.status === 'draft' )\n\t\t\t\t.length,\n\t\t\tfuture: records.filter( ( record ) => record.status === 'future' )\n\t\t\t\t.length,\n\t\t\tpending: records.filter( ( record ) => record.status === 'pending' )\n\t\t\t\t.length,\n\t\t\tprivate: records.filter( ( record ) => record.status === 'private' )\n\t\t\t\t.length,\n\t\t\tpublished: records.filter(\n\t\t\t\t( record ) => record.status === 'publish'\n\t\t\t).length,\n\t\t\ttrash: records.filter( ( record ) => record.status === 'trash' )\n\t\t\t\t.length,\n\t\t};\n\n\t\t// All items excluding trashed items as per the default \"all\" status query.\n\t\tcounts.all = totalItems ? totalItems - counts.trash : 0;\n\n\t\t// Filter out views with > 0 item counts.\n\t\treturn defaultViews.map( ( _view ) => {\n\t\t\t_view.count = counts[ _view.slug ];\n\t\t\treturn _view;\n\t\t} );\n\t}, [ defaultViews, records, totalItems ] );\n}\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAL,OAAA;AArBA;AACA;AACA;;AAgBA;AACA;AACA;;AAQO,MAAMM,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC7B,CAAEE,uBAAY,GAAI;IACjBC,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBC,MAAM,EAAE;QACP,gBAAgB,EAAE;UACjBC,KAAK,EAAE;QACR,CAAC;QACDC,KAAK,EAAE;UACNC,QAAQ,EAAE;QACX;MACD;IACD;EACD,CAAC;EACD,CAAEC,sBAAW,GAAI;IAChBN,MAAM,EAAE;MACPO,UAAU,EAAE,gBAAgB;MAC5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;QACfsC,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCpD,KAAK,EAAE,IAAA8C,QAAE,EAAE,OAAQ,CAAC;MACpBP,IAAI,EAAE,OAAO;MACbQ,IAAI,EAAEb,YAAK;MACXe,IAAI,EAAE;QACL,GAAG5C,iBAAiB;QACpBC,IAAI,EAAEX,uBAAY;QAClBC,MAAM,EAAEH,cAAc,CAAEE,uBAAY,CAAE,CAACC;MACxC,CAAC;MACDY,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfsC,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAEZ,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","layout","primaryField","styles","width","title","maxWidth","LAYOUT_GRID","mediaField","LAYOUT_LIST","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViews","postType","labels","useSelect","select","getPostType","coreStore","useMemo","all_items","__","slug","icon","pages","view","published","operator","OPERATOR_IS_ANY","value","scheduled","drafts","pending","notAllowed","trash"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\t'featured-image': {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured-image',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured-image',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAL,OAAA;AArBA;AACA;AACA;;AAgBA;AACA;AACA;;AAQO,MAAMM,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC7B,CAAEE,uBAAY,GAAI;IACjBC,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBC,MAAM,EAAE;QACP,gBAAgB,EAAE;UACjBC,KAAK,EAAE;QACR,CAAC;QACDC,KAAK,EAAE;UACNC,QAAQ,EAAE;QACX;MACD;IACD;EACD,CAAC;EACD,CAAEC,sBAAW,GAAI;IAChBN,MAAM,EAAE;MACPO,UAAU,EAAE,gBAAgB;MAC5BN,YAAY,EAAE;IACf;EACD,CAAC;EACD,CAAEO,sBAAW,GAAI;IAChBR,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBM,UAAU,EAAE;IACb;EACD;AACD,CAAC;AAED,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAEF,sBAAW;EACjBG,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACDC,MAAM,EAAE,CAAE,OAAO,EAAE,QAAQ,EAAE,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,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACChC,KAAK,EAAE,IAAAwB,QAAE,EAAE,SAAU,CAAC;MACtBC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAES,cAAO;MACbP,IAAI,EAAEvB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACChC,KAAK,EAAE,IAAAwB,QAAE,EAAE,SAAU,CAAC;MACtBC,IAAI,EAAE,SAAS;MACfC,IAAI,EAAEU,iBAAU;MAChBR,IAAI,EAAEvB,iBAAiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACChC,KAAK,EAAE,IAAAwB,QAAE,EAAE,OAAQ,CAAC;MACpBC,IAAI,EAAE,OAAO;MACbC,IAAI,EAAEW,YAAK;MACXT,IAAI,EAAE;QACL,GAAGvB,iBAAiB;QACpBC,IAAI,EAAEX,uBAAY;QAClBC,MAAM,EAAEH,cAAc,CAAEE,uBAAY,CAAE,CAACC;MACxC,CAAC;MACDY,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfkB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAEf,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ function DataViewsSidebarContent() {
|
|
|
31
31
|
isCustom = 'false'
|
|
32
32
|
}
|
|
33
33
|
} = useLocation();
|
|
34
|
-
const defaultViews = (0, _defaultViews.
|
|
34
|
+
const defaultViews = (0, _defaultViews.useDefaultViews)({
|
|
35
35
|
postType
|
|
36
36
|
});
|
|
37
37
|
if (!postType) {
|
|
@@ -45,9 +45,6 @@ function DataViewsSidebarContent() {
|
|
|
45
45
|
slug: dataview.slug,
|
|
46
46
|
title: dataview.title,
|
|
47
47
|
icon: dataview.icon,
|
|
48
|
-
navigationItemSuffix: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
49
|
-
children: dataview.count
|
|
50
|
-
}),
|
|
51
48
|
type: dataview.view.type,
|
|
52
49
|
isActive: !isCustomBoolean && dataview.slug === activeView,
|
|
53
50
|
isCustom: false
|