@wordpress/editor 13.28.7 → 13.28.9
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/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/package.json +10 -10
- package/src/components/document-tools/index.js +16 -14
|
@@ -116,7 +116,7 @@ function DocumentTools({
|
|
|
116
116
|
variant: "unstyled"
|
|
117
117
|
}, (0, _react.createElement)("div", {
|
|
118
118
|
className: "editor-document-tools__left"
|
|
119
|
-
}, (0, _react.createElement)(_components.ToolbarItem, {
|
|
119
|
+
}, !isDistractionFree && (0, _react.createElement)(_components.ToolbarItem, {
|
|
120
120
|
ref: inserterButton,
|
|
121
121
|
as: _components.Button,
|
|
122
122
|
className: "editor-document-tools__inserter-toggle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","useCanBlockToolbarBeFocused","unlock","blockEditorPrivateApis","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","__","inserterButton","useRef","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","useSelect","select","getSettings","blockEditorStore","get","preferencesStore","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","keyboardShortcutsStore","isLargeViewport","useViewportMatch","isWideViewport","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","useCallback","toggleInserter","current","focus","longLabel","_x","shortLabel","_react","createElement","NavigableToolbar","classnames","shouldUseKeyboardFocusShortcut","variant","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useCanBlockToolbarBeFocused } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\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) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAMA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAA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,MAAA,CAAAC,aAAA,EAACzD,WAAA,CAAA8D,WAAW;MACXE,EAAE,EAAGc,aAAmB;MACxBL,WAAW,EAAG,CAAEzC,cAAgB;MAChC6B,OAAO,EAAG7B,cAAc,GAAG,UAAU,GAAG4C,SAAW;MACnDC,IAAI,EAAC;IAAS,CACd,CAAC,EACF,IAAArB,MAAA,CAAAC,aAAA,EAACzD,WAAA,CAAA8D,WAAW;MACXE,EAAE,EAAGe,aAAmB;MACxBN,WAAW,EAAG,CAAEzC,cAAgB;MAChC6B,OAAO,EAAG7B,cAAc,GAAG,UAAU,GAAG4C,SAAW;MACnDC,IAAI,EAAC;IAAS,CACd,CAAC,EACA,CAAEnD,iBAAiB,IACpB,IAAA8B,MAAA,CAAAC,aAAA,EAACzD,WAAA,CAAA8D,WAAW;MACXE,EAAE,EAAGC,kBAAQ;MACblD,SAAS,EAAC,iDAAiD;MAC3DuD,IAAI,EAAGU,eAAU;MACjBX,QAAQ,EAAGrD,iBAAmB;MAC9BkD,SAAS,EAAGtC;MACZ;MACA4C,KAAK,EAAGtD,aAAe;MACvBkD,OAAO,EAAGpB,cAAgB;MAC1BiC,QAAQ,EAAGpD,gBAAkB;MAC7B4C,WAAW,EAAG,CAAEzC,cAAgB;MAChC6B,OAAO,EACN7B,cAAc,GAAG,UAAU,GAAG4C,SAC9B;MACD,iBAAgBhD,cAAgB;MAChCmC,GAAG,EAAGjC,iBAAmB;MACzB+C,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC5D,QACE,CACY;EAAC;AAErB;AAAC,IAAAiE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctE,aAAa"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","useCanBlockToolbarBeFocused","unlock","blockEditorPrivateApis","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","__","inserterButton","useRef","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","useSelect","select","getSettings","blockEditorStore","get","preferencesStore","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","keyboardShortcutsStore","isLargeViewport","useViewportMatch","isWideViewport","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","useCallback","toggleInserter","current","focus","longLabel","_x","shortLabel","_react","createElement","NavigableToolbar","classnames","shouldUseKeyboardFocusShortcut","variant","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useCanBlockToolbarBeFocused } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\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) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAMA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA,MAAM;EAAEc;AAA4B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAExE,MAAMC,cAAc,GAAKC,KAAK,IAAM;EACnCA,KAAK,CAACD,cAAc,CAAC,CAAC;AACvB,CAAC;AAED,SAASE,aAAaA,CAAE;EACvBC,SAAS;EACTC,iBAAiB,GAAG,KAAK;EACzBC,QAAQ;EACR;EACAC,aAAa,GAAG,IAAAC,QAAE,EAAE,mBAAoB;AACzC,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC/B,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjD,IA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AQ,EAAGpD,gBAAkB;MAC7B4C,WAAW,EAAG,CAAEzC,cAAgB;MAChC6B,OAAO,EACN7B,cAAc,GAAG,UAAU,GAAG4C,SAC9B;MACD,iBAAgBhD,cAAgB;MAChCmC,GAAG,EAAGjC,iBAAmB;MACzB+C,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC5D,QACE,CACY;EAAC;AAErB;AAAC,IAAAiE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctE,aAAa"}
|
|
@@ -108,7 +108,7 @@ function DocumentTools({
|
|
|
108
108
|
variant: "unstyled"
|
|
109
109
|
}, createElement("div", {
|
|
110
110
|
className: "editor-document-tools__left"
|
|
111
|
-
}, createElement(ToolbarItem, {
|
|
111
|
+
}, !isDistractionFree && createElement(ToolbarItem, {
|
|
112
112
|
ref: inserterButton,
|
|
113
113
|
as: Button,
|
|
114
114
|
className: "editor-document-tools__inserter-toggle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","useCanBlockToolbarBeFocused","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","inserterButton","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","select","getSettings","get","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","isLargeViewport","isWideViewport","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","toggleInserter","current","focus","longLabel","shortLabel","createElement","shouldUseKeyboardFocusShortcut","variant","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","Fragment","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useCanBlockToolbarBeFocused } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\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) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ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S,CACd,CAAC,EACFd,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGxC,iBAAmB;MACxB+C,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EAAGnB,cAAc,GAAG,UAAU,GAAG8B,SAAW;MACnDC,IAAI,EAAC;IAAS,CACd,CAAC,EACA,CAAErC,iBAAiB,IACpBuB,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGlD,MAAQ;MACbgB,SAAS,EAAC,iDAAiD;MAC3DuC,IAAI,EAAGrD,QAAU;MACjBoD,QAAQ,EAAGrC,iBAAmB;MAC9BkC,SAAS,EAAG1B;MACZ;MACA+B,KAAK,EAAGrC,aAAe;MACvBkC,OAAO,EAAGb,cAAgB;MAC1BqB,QAAQ,EAAGnC,gBAAkB;MAC7B+B,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EACNnB,cAAc,GAAG,UAAU,GAAG8B,SAC9B;MACD,iBAAgBlC,cAAgB;MAChCwB,GAAG,EAAGtB,iBAAmB;MACzBiC,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC1C,QACE,CACY;EAAC;AAErB;AAEA,eAAeH,aAAa"}
|
|
1
|
+
{"version":3,"names":["classnames","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","useCanBlockToolbarBeFocused","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","inserterButton","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","select","getSettings","get","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","isLargeViewport","isWideViewport","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","toggleInserter","current","focus","longLabel","shortLabel","createElement","shouldUseKeyboardFocusShortcut","variant","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","Fragment","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useCanBlockToolbarBeFocused } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\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) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,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AQ,EAAGrC,iBAAmB;MAC9B2C,IAAI,EAAC;IAAS,CACd,CACD,EACDd,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGvC,iBAAmB;MACxB8C,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EAAGnB,cAAc,GAAG,UAAU,GAAG8B,SAAW;MACnDC,IAAI,EAAC;IAAS,CACd,CAAC,EACFd,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGxC,iBAAmB;MACxB+C,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EAAGnB,cAAc,GAAG,UAAU,GAAG8B,SAAW;MACnDC,IAAI,EAAC;IAAS,CACd,CAAC,EACA,CAAErC,iBAAiB,IACpBuB,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGlD,MAAQ;MACbgB,SAAS,EAAC,iDAAiD;MAC3DuC,IAAI,EAAGrD,QAAU;MACjBoD,QAAQ,EAAGrC,iBAAmB;MAC9BkC,SAAS,EAAG1B;MACZ;MACA+B,KAAK,EAAGrC,aAAe;MACvBkC,OAAO,EAAGb,cAAgB;MAC1BqB,QAAQ,EAAGnC,gBAAkB;MAC7B+B,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EACNnB,cAAc,GAAG,UAAU,GAAG8B,SAC9B;MACD,iBAAgBlC,cAAgB;MAChCwB,GAAG,EAAGtB,iBAAmB;MACzBiC,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC1C,QACE,CACY;EAAC;AAErB;AAEA,eAAeH,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.28.
|
|
3
|
+
"version": "13.28.9",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"@wordpress/a11y": "^3.51.1",
|
|
35
35
|
"@wordpress/api-fetch": "^6.48.1",
|
|
36
36
|
"@wordpress/blob": "^3.51.1",
|
|
37
|
-
"@wordpress/block-editor": "^12.19.
|
|
37
|
+
"@wordpress/block-editor": "^12.19.9",
|
|
38
38
|
"@wordpress/blocks": "^12.28.6",
|
|
39
|
-
"@wordpress/commands": "^0.22.
|
|
40
|
-
"@wordpress/components": "^26.0.
|
|
39
|
+
"@wordpress/commands": "^0.22.6",
|
|
40
|
+
"@wordpress/components": "^26.0.6",
|
|
41
41
|
"@wordpress/compose": "^6.28.1",
|
|
42
|
-
"@wordpress/core-data": "^6.28.
|
|
42
|
+
"@wordpress/core-data": "^6.28.9",
|
|
43
43
|
"@wordpress/data": "^9.21.1",
|
|
44
44
|
"@wordpress/date": "^4.51.1",
|
|
45
45
|
"@wordpress/deprecated": "^3.51.1",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"@wordpress/keycodes": "^3.51.1",
|
|
54
54
|
"@wordpress/media-utils": "^4.42.2",
|
|
55
55
|
"@wordpress/notices": "^4.19.1",
|
|
56
|
-
"@wordpress/patterns": "^1.12.
|
|
57
|
-
"@wordpress/preferences": "^3.28.
|
|
56
|
+
"@wordpress/patterns": "^1.12.9",
|
|
57
|
+
"@wordpress/preferences": "^3.28.6",
|
|
58
58
|
"@wordpress/private-apis": "^0.33.1",
|
|
59
|
-
"@wordpress/reusable-blocks": "^4.28.
|
|
59
|
+
"@wordpress/reusable-blocks": "^4.28.9",
|
|
60
60
|
"@wordpress/rich-text": "^6.28.4",
|
|
61
|
-
"@wordpress/server-side-render": "^4.28.
|
|
61
|
+
"@wordpress/server-side-render": "^4.28.7",
|
|
62
62
|
"@wordpress/url": "^3.52.1",
|
|
63
63
|
"@wordpress/wordcount": "^3.51.1",
|
|
64
64
|
"classnames": "^2.3.1",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "88cd256155d396c639216515e05346c687a64112"
|
|
79
79
|
}
|
|
@@ -121,20 +121,22 @@ function DocumentTools( {
|
|
|
121
121
|
variant="unstyled"
|
|
122
122
|
>
|
|
123
123
|
<div className="editor-document-tools__left">
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
{ ! isDistractionFree && (
|
|
125
|
+
<ToolbarItem
|
|
126
|
+
ref={ inserterButton }
|
|
127
|
+
as={ Button }
|
|
128
|
+
className="editor-document-tools__inserter-toggle"
|
|
129
|
+
variant="primary"
|
|
130
|
+
isPressed={ isInserterOpened }
|
|
131
|
+
onMouseDown={ preventDefault }
|
|
132
|
+
onClick={ toggleInserter }
|
|
133
|
+
disabled={ disableBlockTools }
|
|
134
|
+
icon={ plus }
|
|
135
|
+
label={ showIconLabels ? shortLabel : longLabel }
|
|
136
|
+
showTooltip={ ! showIconLabels }
|
|
137
|
+
aria-expanded={ isInserterOpened }
|
|
138
|
+
/>
|
|
139
|
+
) }
|
|
138
140
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
139
141
|
<>
|
|
140
142
|
{ isLargeViewport && ! hasFixedToolbar && (
|