@wordpress/edit-post 7.31.0 → 7.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +9 -323
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -1
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -38
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +5 -5
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -1
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +7 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +11 -13
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +12 -4
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -36
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +4 -7
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +16 -21
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -21
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +9 -9
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +42 -40
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -1
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +62 -0
- package/build/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +9 -4
- package/build/editor.js.map +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +7 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +36 -19
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +7 -12
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -4
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +46 -31
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +1 -15
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +44 -24
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -2
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -38
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +4 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +5 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +11 -3
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -36
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +4 -5
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +15 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -20
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +9 -10
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +55 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +9 -4
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +9 -26
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +8 -8
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -4
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +38 -22
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -13
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +42 -21
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/style-rtl.css +12 -454
- package/build-style/style.css +12 -454
- package/package.json +32 -34
- package/src/classic.scss +2 -1
- package/src/components/editor-initialization/index.js +1 -5
- package/src/components/editor-initialization/listener-hooks.js +1 -40
- package/src/components/editor-initialization/test/listener-hooks.js +1 -96
- package/src/components/header/index.js +3 -4
- package/src/components/header/index.native.js +1 -1
- package/src/components/header/more-menu/index.js +3 -4
- package/src/components/header/post-publish-button-or-toggle.js +10 -11
- package/src/components/header/preferences-menu-item/index.js +9 -3
- package/src/components/header/style.scss +5 -3
- package/src/components/header/test/index.js +13 -1
- package/src/components/keyboard-shortcuts/index.js +3 -44
- package/src/components/layout/actions-panel.js +5 -4
- package/src/components/layout/index.js +20 -42
- package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
- package/src/components/preferences-modal/index.js +1 -24
- package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
- package/src/components/sidebar/post-status/index.js +6 -9
- package/src/components/sidebar/settings-sidebar/index.js +64 -56
- package/src/components/visual-editor/block-inspector-button.js +1 -1
- package/src/components/visual-editor/index.js +4 -0
- package/src/components/visual-editor/use-padding-appender.js +66 -0
- package/src/editor.js +14 -4
- package/src/hooks/commands/use-common-commands.js +13 -28
- package/src/hooks/use-navigate-to-entity-record.js +37 -24
- package/src/index.js +11 -6
- package/src/index.native.js +1 -4
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
- package/src/store/actions.js +37 -24
- package/src/store/reducer.js +0 -13
- package/src/store/selectors.js +52 -36
- package/src/store/test/actions.js +11 -10
- package/src/style.scss +1 -20
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build/components/header/plugin-more-menu-item/index.js +0 -78
- package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
- package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -104
- package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar/template-summary/index.js +0 -36
- package/build/components/sidebar/template-summary/index.js.map +0 -1
- package/build/components/start-page-options/index.js +0 -107
- package/build/components/start-page-options/index.js.map +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar/template-summary/index.js +0 -29
- package/build-module/components/sidebar/template-summary/index.js.map +0 -1
- package/build-module/components/start-page-options/index.js +0 -100
- package/build-module/components/start-page-options/index.js.map +0 -1
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
- package/src/components/header/plugin-more-menu-item/index.js +0 -73
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
- package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
- package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
- package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
- package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-sidebar/index.js +0 -94
- package/src/components/sidebar/template-summary/index.js +0 -37
- package/src/components/sidebar/template-summary/style.scss +0 -5
- package/src/components/start-page-options/index.js +0 -108
- package/src/components/start-page-options/style.scss +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","BlockBreadcrumb","BlockToolbar","blockEditorPrivateApis","blockEditorStore","Button","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","InitPatternModal","BrowserURL","Header","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","unlock","useCommonCommands","getLayoutStyles","useCommands","useCommandContext","InserterSidebar","ListViewSidebar","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","initialPost","isMobileViewport","isHugeViewport","isWideViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","createErrorNotice","setIsInserterOpened","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","showMetaBoxes","documentLabel","hasHistory","get","getPostTypeLabel","postTypeLabel","getRenderingMode","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","onPluginAreaError","Fragment","isActive","labels","editorNotices","variant","onClick","Slot","scope","notices","content","hideDragHandle","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useCommonCommands from '../../hooks/commands/use-common-commands';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { InserterSidebar, ListViewSidebar } = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tshowMetaBoxes,\n\t\tdocumentLabel,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'post-editor-edit';\n\tuseCommandContext( commandContext );\n\n\tconst styles = useEditorStyles();\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ isHugeViewport, setIsInserterOpened, sidebarIsOpened ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ closeGeneralSidebar, isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'is-distraction-free': isDistractionFree && isWideViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ( isMobileViewport && sidebarIsOpened ) ||\n\t\t\t\t\t\t( ! isMobileViewport && ! isDistractionFree ) ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<StartPageOptions />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && <SettingsSidebar /> }\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,aAAa,EACbC,+BAA+B,EAC/BC,uBAAuB,EACvBC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,eAAe,EACfC,YAAY,EACZL,WAAW,IAAIM,sBAAsB,EACrCR,KAAK,IAAIS,gBAAgB,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AAY;MACZkF,wBAAwB,EAAGA,wBAA0B;MACrDwB,yBAAyB,EACxB1B,2BACA;MACDC,8BAA8B,EAC7BA;IACA,CACD,CACD;IACD0B,SAAS,EAAG;MACXC,QAAQ,EAAEtD,gBAAgB;MAC1BuD,IAAI,EAAEtD;IACP;EAAG,CACH,CAAC,EACFoC,aAAA,CAAClG,wBAAwB,MAAE,CAAC,EAC5BkG,aAAA,CAACnG,yBAAyB,MAAE,CAAC,EAC7BmG,aAAA,CAAC5F,YAAY,MAAE,CAAC,EAChB4F,aAAA,CAACjG,gBAAgB,MAAE,CAAC,EACpBiG,aAAA,CAAC1F,gBAAgB,MAAE,CAAC,EACpB0F,aAAA,CAACvH,UAAU;IAAC0I,OAAO,EAAGlB;EAAmB,CAAE,CAAC,EAC1C,CAAEhC,iBAAiB,IAAI+B,aAAA,CAAC9F,eAAe,MAAE,CAC1C,CAAC;AAEL;AAEA,eAAe0C,MAAM"}
|
|
1
|
+
{"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","store","editorStore","privateApis","editorPrivateApis","useSelect","useDispatch","BlockBreadcrumb","BlockToolbar","blockEditorPrivateApis","blockEditorStore","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","preferencesStore","commandsPrivateApis","coreCommandsPrivateApis","TextEditor","VisualEditor","EditPostKeyboardShortcuts","EditPostPreferencesModal","InitPatternModal","BrowserURL","Header","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","editPostStore","unlock","useCommonCommands","getLayoutStyles","useCommands","useCommandContext","InserterSidebar","ListViewSidebar","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","initialPost","isMobileViewport","isHugeViewport","isWideViewport","isLargeViewport","closeGeneralSidebar","createErrorNotice","setIsInserterOpened","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","showMetaBoxes","documentLabel","hasHistory","get","getPostTypeLabel","postTypeLabel","getRenderingMode","getActiveComplementaryArea","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","getBlockSelectionStart","onNavigateToPreviousEntityRecord","commandContext","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","isRightSidebarOpen","onPluginAreaError","name","Fragment","isActive","labels","editorNotices","Slot","scope","notices","content","hideDragHandle","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ScrollLock } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useCommonCommands from '../../hooks/commands/use-common-commands';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst {\n\tInserterSidebar,\n\tListViewSidebar,\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tinterfaceStore,\n} = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout( { initialPost } ) {\n\tuseCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tshowMetaBoxes,\n\t\tdocumentLabel,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tshowMetaBoxes:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ) ||\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\thasBlockSelected:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasHistory: !! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'post-editor-edit';\n\tuseCommandContext( commandContext );\n\n\tconst styles = useEditorStyles();\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ isHugeViewport, setIsInserterOpened, sidebarIsOpened ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ closeGeneralSidebar, isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'is-distraction-free': isDistractionFree && isWideViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn (\n\t\t\t\t<InserterSidebar\n\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\tisRightSidebarOpen={ sidebarIsOpened }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core\" />\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && showMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<InitPatternModal />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t{ ! isDistractionFree && <SettingsSidebar /> }\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,aAAa,EACbC,+BAA+B,EAC/BC,uBAAuB,EACvBC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,eAAe,EACfC,YAAY,EACZL,WAAW,IAAIM,sBAAsB,EACrCR,KAAK,IAAIS,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAA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AQ,EAAC;IAAU,CAAE,CAC5B,CACL,EACC5D,gBAAgB,IAAIU,eAAe,IACpCqC,aAAA,CAACpH,UAAU,MAAE,CAEb,CACF;IACD2C,MAAM,EACL,CAAE4C,iBAAiB,IACnB,CAAElB,gBAAgB,IAClBmB,oBAAoB,IACpBV,oBAAoB,IACpBF,IAAI,KAAK,QAAQ,IAChBwC,aAAA;MAAKH,SAAS,EAAC;IAA0B,GACxCG,aAAA,CAACxH,eAAe;MAACsI,aAAa,EAAGxC;IAAe,CAAE,CAC9C,CAEN;IACDhD,OAAO,EACN0E,aAAA,CAAC3F,YAAY;MACZkF,wBAAwB,EAAGA,wBAA0B;MACrDwB,yBAAyB,EACxB1B,2BACA;MACDC,8BAA8B,EAC7BA;IACA,CACD,CACD;IACD0B,SAAS,EAAG;MACXC,QAAQ,EAAEpD,gBAAgB;MAC1BqD,IAAI,EAAEpD;IACP;EAAG,CACH,CAAC,EACFkC,aAAA,CAAClG,wBAAwB,MAAE,CAAC,EAC5BkG,aAAA,CAAC5F,YAAY,MAAE,CAAC,EAChB4F,aAAA,CAACjG,gBAAgB,MAAE,CAAC,EACpBiG,aAAA,CAAClH,UAAU;IAACqI,OAAO,EAAGjB;EAAmB,CAAE,CAAC,EAC1C,CAAE/B,iBAAiB,IAAI6B,aAAA,CAAC9F,eAAe,MAAE,CAC1C,CAAC;AAEL;AAEA,eAAe6C,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","SafeAreaView","View","SafeArea","Component","withSelect","BottomSheetSettings","FloatingToolbar","store","blockEditorStore","compose","withPreferredColorScheme","HTMLTextInput","KeyboardAvoidingView","NoticeList","Tooltip","__unstableAutocompletionItemsSlot","AutocompletionItemsSlot","AutosaveMonitor","OfflineStatus","editorStore","sendNativeEditorDidLayout","styles","headerToolbarStyles","Header","VisualEditor","Layout","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","renderHTML","globalStyles","props","createElement","parentHeight","style","renderVisual","isReady","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","OS","containerStyles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Slot","onLayout","disableIntervalChecks","flex","flexBasis","withAnimatedHeight","Fragment","select","__unstableIsEditorReady","isEditorReady","getEditorMode","getSettings","__experimentalGlobalStylesBaseStyles","color"],"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport {\n\tAutosaveMonitor,\n\tOfflineStatus,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<OfflineStatus />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\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<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady, getEditorMode } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SACCC,mBAAmB,EACnBC,eAAe,EACfC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,wBAAwB,QAAQ,oBAAoB;AACtE,SACCC,aAAa,EACbC,oBAAoB,EACpBC,UAAU,EACVC,OAAO,EACPC,iCAAiC,IAAIC,uBAAuB,QACtD,uBAAuB;AAC9B,SACCC,eAAe,EACfC,aA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CAAC5C,oBAAoB;MACpB6C,YAAY,EAAG,IAAI,CAAC1B,KAAK,CAACC,cAAgB;MAC1C0B,KAAK,EAAGa,gCAAkC;MAC1CW,kBAAkB;IAAA,GAEhBnF,QAAQ,CAACoE,EAAE,KAAK,KAAK,IACtBX,aAAA,CAAA2B,QAAA,QACC3B,aAAA,CAACxC,uBAAuB,MAAE,CAAC,EAC3BwC,aAAA,CAAClD,eAAe,MAAE,CACjB,CACF,EACDkD,aAAA,CAACjC,MAAM,MAAE,CAAC,EACViC,aAAA,CAACnD,mBAAmB,MAAE,CACD,CACtB,EACCN,QAAQ,CAACoE,EAAE,KAAK,SAAS,IAAIX,aAAA,CAACxC,uBAAuB,MAAE,CAC5C,CACD,CAAC;EAEjB;AACD;AAEA,eAAeP,OAAO,CAAE,CACvBL,UAAU,CAAIgF,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEjE,WAAY,CAAC;EACtB,MAAM;IAAEqE;EAAY,CAAC,GAAGJ,MAAM,CAAE5E,gBAAiB,CAAC;EAClD,MAAM8C,YAAY,GACjBkC,WAAW,CAAC,CAAC,EAAEC,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACN9B,OAAO,EAAE0B,aAAa,CAAC,CAAC;IACxBtB,IAAI,EAAEuB,aAAa,CAAC,CAAC;IACrBjC;EACD,CAAC;AACF,CAAE,CAAC,EACH5C,wBAAwB,CACvB,CAAC,CAAEe,MAAO,CAAC"}
|
|
1
|
+
{"version":3,"names":["Platform","SafeAreaView","View","SafeArea","Component","withSelect","BottomSheetSettings","FloatingToolbar","store","blockEditorStore","compose","withPreferredColorScheme","HTMLTextInput","KeyboardAvoidingView","NoticeList","Tooltip","__unstableAutocompletionItemsSlot","AutocompletionItemsSlot","AutosaveMonitor","OfflineStatus","editorStore","sendNativeEditorDidLayout","styles","headerToolbarStyles","Header","VisualEditor","Layout","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","renderHTML","globalStyles","props","createElement","parentHeight","style","renderVisual","isReady","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","OS","containerStyles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Slot","onLayout","disableIntervalChecks","flex","flexBasis","withAnimatedHeight","Fragment","select","__unstableIsEditorReady","isEditorReady","getEditorMode","getSettings","__experimentalGlobalStylesBaseStyles","color"],"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport {\n\tAutosaveMonitor,\n\tOfflineStatus,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<OfflineStatus />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\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<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady, getEditorMode } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SACCC,mBAAmB,EACnBC,eAAe,EACfC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,wBAAwB,QAAQ,oBAAoB;AACtE,SACCC,aAAa,EACbC,oBAAoB,EACpBC,UAAU,EACVC,OAAO,EACPC,iCAAiC,IAAIC,uBA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;IAAG,CACH,CAAC,EACA,CAAED,UAAU,IACbT,aAAA,CAAC5C,oBAAoB;MACpB6C,YAAY,EAAG,IAAI,CAAC1B,KAAK,CAACC,cAAgB;MAC1C0B,KAAK,EAAGa,gCAAkC;MAC1CW,kBAAkB;IAAA,GAEhBnF,QAAQ,CAACoE,EAAE,KAAK,KAAK,IACtBX,aAAA,CAAA2B,QAAA,QACC3B,aAAA,CAACxC,uBAAuB,MAAE,CAAC,EAC3BwC,aAAA,CAAClD,eAAe,MAAE,CACjB,CACF,EACDkD,aAAA,CAACjC,MAAM,MAAE,CAAC,EACViC,aAAA,CAACnD,mBAAmB,MAAE,CACD,CACtB,EACCN,QAAQ,CAACoE,EAAE,KAAK,SAAS,IAAIX,aAAA,CAACxC,uBAAuB,MAAE,CAC5C,CACD,CAAC;EAEjB;AACD;AAEA,eAAeP,OAAO,CAAE,CACvBL,UAAU,CAAIgF,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEjE,WAAY,CAAC;EACtB,MAAM;IAAEqE;EAAY,CAAC,GAAGJ,MAAM,CAAE5E,gBAAiB,CAAC;EAClD,MAAM8C,YAAY,GACjBkC,WAAW,CAAC,CAAC,EAAEC,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACN9B,OAAO,EAAE0B,aAAa,CAAC,CAAC;IACxBtB,IAAI,EAAEuB,aAAa,CAAC,CAAC;IACrBjC;EACD,CAAC;AACF,CAAE,CAAC,EACH5C,wBAAwB,CACvB,CAAC,CAAEe,MAAO,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useRegistry","useEffect","store","editorStore","MetaBoxesArea","MetaBoxVisibility","editPostStore","MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","getMetaBoxesPerLocation","_areMetaBoxesInitialized","hasMetaBoxes","length","dispatch","initializeMetaBoxes","createElement","Fragment","map","id","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\tconst hasMetaBoxes = !! metaBoxes?.length;\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA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A,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGa,GAAG,CAAE,CAAE;IAAEC;EAAG,CAAC,KAClCH,aAAA,CAAChB,iBAAiB;IAACoB,GAAG,EAAGD,EAAI;IAACA,EAAE,EAAGA;EAAI,CAAE,CACxC,CAAC,EACHH,aAAA,CAACjB,aAAa;IAACI,QAAQ,EAAGA;EAAU,CAAE,CACrC,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["useSelect","useRegistry","useEffect","store","editorStore","MetaBoxesArea","MetaBoxVisibility","editPostStore","MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","getMetaBoxesPerLocation","_areMetaBoxesInitialized","hasMetaBoxes","length","dispatch","initializeMetaBoxes","createElement","Fragment","map","id","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\tconst hasMetaBoxes = !! metaBoxes?.length;\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,eAAe,SAASC,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEU,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAGb,SAAS,CACpEc,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEV,WAAY,CAAC;IACzD,MAAM;MACLY,uBAAuB;MACvBJ,uBAAuB,EAAEK;IAC1B,CAAC,GAAGH,MAAM,CAAEP,aAAc,CAAC;IAC3B,OAAO;MACNI,SAAS,EAAEK,uBAAuB,CAAEP,QAAS,CAAC;MAC9CG,uBAAuB,EAAEK,wBAAwB,CAAC,CAAC;MACnDJ,aAAa,EAAEE,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAEN,QAAQ,CACX,CAAC;EAED,MAAMS,YAAY,GAAG,CAAC,CAAEP,SAAS,EAAEQ,MAAM;;EAEzC;EACA;EACA;EACAjB,SAAS,CAAE,MAAM;IAChB,IAAKW,aAAa,IAAIK,YAAY,IAAI,CAAEN,uBAAuB,EAAG;MACjEF,QAAQ,CAACU,QAAQ,CAAEb,aAAc,CAAC,CAACc,mBAAmB,CAAC,CAAC;IACzD;EACD,CAAC,EAAE,CAAER,aAAa,EAAEK,YAAY,EAAEN,uBAAuB,CAAG,CAAC;EAE7D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACCU,aAAA,CAAAC,QAAA,QACG,CAAEZ,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGa,GAAG,CAAE,CAAE;IAAEC;EAAG,CAAC,KAClCH,aAAA,CAAChB,iBAAiB;IAACoB,GAAG,EAAGD,EAAI;IAACA,EAAE,EAAGA;EAAI,CAAE,CACxC,CAAC,EACHH,aAAA,CAACjB,aAAa;IAACI,QAAQ,EAAGA;EAAU,CAAE,CACrC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Component","withSelect","store","editorStore","MetaBoxVisibility","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","select","isEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editorStore ).isEditorPanelEnabled( `meta-box-${ id }` ),\n} ) )( MetaBoxVisibility );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,MAAMC,iBAAiB,SAASJ,SAAS,CAAC;EACzCK,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,SAAS,CAAC,CAAC;EACjB;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACC,KAAK,CAACC,SAAS,KAAKF,SAAS,CAACE,SAAS,EAAG;MACnD,IAAI,CAACJ,SAAS,CAAC,CAAC;IACjB;EACD;EAEAA,SAASA,CAAA,EAAG;IACX,MAAM;MAAEK,EAAE;MAAED;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEpC,MAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAEH,EAAG,CAAC;IAC7C,IAAK,CAAEC,OAAO,EAAG;MAChB;IACD;IAEA,IAAKF,SAAS,EAAG;MAChBE,OAAO,CAACG,SAAS,CAACC,MAAM,CAAE,WAAY,CAAC;IACxC,CAAC,MAAM;MACNJ,OAAO,CAACG,SAAS,CAACE,GAAG,CAAE,WAAY,CAAC;IACrC;EACD;EAEAC,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAEA,eAAejB,UAAU,CAAE,CAAEkB,MAAM,EAAE;EAAER;AAAG,CAAC,MAAQ;EAClDD,SAAS,EAAES,MAAM,CAAEhB,WAAY,CAAC,CAACiB,oBAAoB,CAAG,YAAYT,EAAI,EAAE;AAC3E,CAAC,CAAG,CAAC,CAAEP,iBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"names":["Component","withSelect","store","editorStore","MetaBoxVisibility","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","select","isEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editorStore ).isEditorPanelEnabled( `meta-box-${ id }` ),\n} ) )( MetaBoxVisibility );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,MAAMC,iBAAiB,SAASJ,SAAS,CAAC;EACzCK,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,SAAS,CAAC,CAAC;EACjB;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACC,KAAK,CAACC,SAAS,KAAKF,SAAS,CAACE,SAAS,EAAG;MACnD,IAAI,CAACJ,SAAS,CAAC,CAAC;IACjB;EACD;EAEAA,SAASA,CAAA,EAAG;IACX,MAAM;MAAEK,EAAE;MAAED;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEpC,MAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAEH,EAAG,CAAC;IAC7C,IAAK,CAAEC,OAAO,EAAG;MAChB;IACD;IAEA,IAAKF,SAAS,EAAG;MAChBE,OAAO,CAACG,SAAS,CAACC,MAAM,CAAE,WAAY,CAAC;IACxC,CAAC,MAAM;MACNJ,OAAO,CAACG,SAAS,CAACE,GAAG,CAAE,WAAY,CAAC;IACrC;EACD;EAEAC,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAEA,eAAejB,UAAU,CAAE,CAAEkB,MAAM,EAAE;EAAER;AAAG,CAAC,MAAQ;EAClDD,SAAS,EAAES,MAAM,CAAEhB,WAAY,CAAC,CAACiB,oBAAoB,CAAG,YAAYT,EAAI,EAAE;AAC3E,CAAC,CAAG,CAAC,CAAEP,iBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useRef","useEffect","Spinner","useSelect","store","editPostStore","MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","isSavingMetaBoxes","classes","createElement","className","ref"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = classnames(\n\t\t'edit-post-meta-boxes-area',\n\t\t`is-${ location }`,\n\t\t{\n\t\t\t'is-loading': isSaving,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAGR,MAAM,CAAE,IAAK,CAAC;EAChC,MAAMS,OAAO,GAAGT,MAAM,CAAE,IAAK,CAAC;EAE9BC,SAAS,CAAE,MAAM;IAChBQ,OAAO,CAACC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGL,QACxB,CAAC;IAED,IAAKE,OAAO,CAACC,OAAO,EAAG;MACtBF,SAAS,CAACE,OAAO,CAACG,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKD,OAAO,CAACC,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAAG,CAAC;EAEjB,MAAMO,QAAQ,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEV,aAAc,CAAC,CAACW,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAGlB,UAAU,CACzB,2BAA2B,EAC1B,MAAMQ,QAAU,EAAC,EAClB;IACC,YAAY,EAAEO;EACf,CACD,CAAC;EAED,OACCI,aAAA;IAAKC,SAAS,EAAGF;EAAS,GACvBH,QAAQ,IAAII,aAAA,CAAChB,OAAO,MAAE,CAAC,EACzBgB,aAAA;IACCC,SAAS,EAAC,sCAAsC;IAChDC,GAAG,EAAGZ;EAAW,CACjB,CAAC,EACFU,aAAA;IAAKC,SAAS,EAAC;EAAkC,CAAE,CAC/C,CAAC;AAER;AAEA,eAAeb,aAAa"}
|
|
1
|
+
{"version":3,"names":["classnames","useRef","useEffect","Spinner","useSelect","store","editPostStore","MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","isSavingMetaBoxes","classes","createElement","className","ref"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = classnames(\n\t\t'edit-post-meta-boxes-area',\n\t\t`is-${ location }`,\n\t\t{\n\t\t\t'is-loading': isSaving,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAGR,MAAM,CAAE,IAAK,CAAC;EAChC,MAAMS,OAAO,GAAGT,MAAM,CAAE,IAAK,CAAC;EAE9BC,SAAS,CAAE,MAAM;IAChBQ,OAAO,CAACC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGL,QACxB,CAAC;IAED,IAAKE,OAAO,CAACC,OAAO,EAAG;MACtBF,SAAS,CAACE,OAAO,CAACG,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKD,OAAO,CAACC,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAAG,CAAC;EAEjB,MAAMO,QAAQ,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEV,aAAc,CAAC,CAACW,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAGlB,UAAU,CACzB,2BAA2B,EAC1B,MAAMQ,QAAU,EAAC,EAClB;IACC,YAAY,EAAEO;EACf,CACD,CAAC;EAED,OACCI,aAAA;IAAKC,SAAS,EAAGF;EAAS,GACvBH,QAAQ,IAAII,aAAA,CAAChB,OAAO,MAAE,CAAC,EACzBgB,aAAA;IACCC,SAAS,EAAC,sCAAsC;IAChDC,GAAG,EAAGZ;EAAW,CACjB,CAAC,EACFU,aAAA;IAAKC,SAAS,EAAC;EAAkC,CAAE,CAC/C,CAAC;AAER;AAEA,eAAeb,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","createElement","Fragment","className","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASC,qBAAqB,QAAQ,gBAAgB;;AAEtD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAEF,sBAAuB,CAAC;AAEjE,SAASI,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAER,qBAAqB,CAAES,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExEP,gBAAgB,CAACQ,MAAM,CAAC,CAAC;AAC1B;AAEA,OAAO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGxB,QAAQ,CAAE,KAAM,CAAC;EACzD,OACCyB,aAAA,CAAAC,QAAA,QACCD,aAAA;IAAGE,SAAS,EAAC;EAAiE,GAC3E1B,EAAE,CACH,8FACD,CACE,CAAC,EACJwB,aAAA,CAACvB,MAAM;IACNyB,SAAS,EAAC,gEAAgE;IAC1EC,OAAO,EAAC,WAAW;IACnBC,MAAM,EAAGN,WAAa;IACtBO,QAAQ,EAAGP,WAAa;IACxBQ,OAAO,EAAGA,CAAA,KAAM;MACfP,cAAc,CAAE,IAAK,CAAC;MACtBb,sBAAsB,CAAC,CAAC;IACzB;EAAG,GAEDW,UAAU,GACTrB,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,oBAAqB,CACrB,CACP,CAAC;AAEL;AAEA,OAAO,SAAS+B,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAGpC,QAAQ,CAAEkC,sBAAuB,CAAC;EAEtE,OACCT,aAAA,CAACf,oBAAoB;IACpBuB,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD;EAAc,GAEvBD,SAAS,KAAKD,sBAAsB,IACrCT,aAAA,CAACJ,wBAAwB;IAACC,UAAU,EAAGa;EAAW,CAAE,CAEhC,CAAC;AAEzB;AAEA,eAAehC,UAAU,CAAImC,MAAM,KAAQ;EAC1CJ,sBAAsB,EACrB,CAAC,CAAEI,MAAM,CAAEjC,WAAY,CAAC,CAACkC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAER,wBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","createElement","Fragment","className","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASC,qBAAqB,QAAQ,gBAAgB;;AAEtD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAEF,sBAAuB,CAAC;AAEjE,SAASI,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAER,qBAAqB,CAAES,MAAM,CAACC,QAAQ,C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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compose","ifCondition","withSelect","withDispatch","store","editorStore","privateApis","preferencesPrivateApis","unlock","PreferenceBaseOption","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEQ,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEL,WAAY,CAAC;EACtB,OAAO;IACNS,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHV,WAAW,CAAE,CAAE;EAAEa;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CX,YAAY,CAAE,CAAEa,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEX,WAAY,CAAC,CAACa,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEF,oBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"names":["compose","ifCondition","withSelect","withDispatch","store","editorStore","privateApis","preferencesPrivateApis","unlock","PreferenceBaseOption","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEQ,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEL,WAAY,CAAC;EACtB,OAAO;IACNS,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHV,WAAW,CAAE,CAAE;EAAEa;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CX,YAAY,CAAE,CAAEa,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEX,WAAY,CAAC,CAACa,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEF,oBAAqB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compose","withSelect","withDispatch","ifViewportMatches","store","editorStore","privateApis","preferencesPrivateApis","unlock","PreferenceBaseOption","select","isChecked","isPublishSidebarEnabled","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeP,OAAO,CACrBC,UAAU,CAAIS,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEL,WAAY,CAAC,CAACO,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACLV,YAAY,CAAIW,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAER,WAAY,CAAC;EACxB,OAAO;IACNW,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAZ,iBAAiB,CAAE,QAAS,CAC7B,CAAC,CAAEM,oBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"names":["compose","withSelect","withDispatch","ifViewportMatches","store","editorStore","privateApis","preferencesPrivateApis","unlock","PreferenceBaseOption","select","isChecked","isPublishSidebarEnabled","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( PreferenceBaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,eAAeP,OAAO,CACrBC,UAAU,CAAIS,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEL,WAAY,CAAC,CAACO,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACLV,YAAY,CAAIW,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAER,WAAY,CAAC;EACxB,OAAO;IACNW,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAZ,iBAAiB,CAAE,QAAS,CAC7B,CAAC,CAAEM,oBAAqB,CAAC","ignoreList":[]}
|
|
@@ -5,8 +5,6 @@ import { createElement, Fragment } from "react";
|
|
|
5
5
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { useViewportMatch } from '@wordpress/compose';
|
|
8
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
8
|
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
11
9
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
12
10
|
|
|
@@ -23,20 +21,8 @@ const {
|
|
|
23
21
|
const {
|
|
24
22
|
PreferencesModal
|
|
25
23
|
} = unlock(editorPrivateApis);
|
|
26
|
-
export const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
|
|
27
24
|
export default function EditPostPreferencesModal() {
|
|
28
25
|
const isLargeViewport = useViewportMatch('medium');
|
|
29
|
-
const {
|
|
30
|
-
closeModal
|
|
31
|
-
} = useDispatch(interfaceStore);
|
|
32
|
-
const {
|
|
33
|
-
isModalActive
|
|
34
|
-
} = useSelect(select => {
|
|
35
|
-
const modalActive = select(interfaceStore).isModalActive(PREFERENCES_MODAL_NAME);
|
|
36
|
-
return {
|
|
37
|
-
isModalActive: modalActive
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
26
|
const extraSections = {
|
|
41
27
|
general: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
|
|
42
28
|
title: __('Publishing')
|
|
@@ -53,13 +39,8 @@ export default function EditPostPreferencesModal() {
|
|
|
53
39
|
label: __('Use theme styles')
|
|
54
40
|
})
|
|
55
41
|
};
|
|
56
|
-
if (!isModalActive) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
42
|
return createElement(PreferencesModal, {
|
|
60
|
-
extraSections: extraSections
|
|
61
|
-
isActive: isModalActive,
|
|
62
|
-
onClose: closeModal
|
|
43
|
+
extraSections: extraSections
|
|
63
44
|
});
|
|
64
45
|
}
|
|
65
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useViewportMatch","
|
|
1
|
+
{"version":3,"names":["__","useViewportMatch","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","EnablePublishSidebarOption","PreferencesModalSection","PreferenceToggleControl","PreferencesModal","EditPostPreferencesModal","isLargeViewport","extraSections","general","createElement","Fragment","title","help","label","appearance","scope","featureName"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\n\nconst { PreferencesModalSection, PreferenceToggleControl } = unlock(\n\tpreferencesPrivateApis\n);\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst extraSections = {\n\t\tgeneral: (\n\t\t\t<>\n\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Publishing' ) }>\n\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t) }\n\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t</>\n\t\t),\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,0BAA0B,MAAM,0BAA0B;AAEjE,MAAM;EAAEC,uBAAuB;EAAEC;AAAwB,CAAC,GAAGJ,MAAM,CAClEF,sBACD,CAAC;AACD,MAAM;EAAEO;AAAiB,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAExD,eAAe,SAASO,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAGX,gBAAgB,CAAE,QAAS,CAAC;EAEpD,MAAMY,aAAa,GAAG;IACrBC,OAAO,EACNC,aAAA,CAAAC,QAAA,QACGJ,eAAe,IAChBG,aAAA,CAACP,uBAAuB;MAACS,KAAK,EAAGjB,EAAE,CAAE,YAAa;IAAG,GACpDe,aAAA,CAACR,0BAA0B;MAC1BW,IAAI,EAAGlB,EAAE,CACR,+CACD,CAAG;MACHmB,KAAK,EAAGnB,EAAE,CAAE,2BAA4B;IAAG,CAC3C,CACuB,CACzB,EACDe,aAAA,CAACT,gBAAgB;MAACW,KAAK,EAAGjB,EAAE,CAAE,UAAW;IAAG,CAAE,CAC7C,CACF;IACDoB,UAAU,EACTL,aAAA,CAACN,uBAAuB;MACvBY,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBJ,IAAI,EAAGlB,EAAE,CAAE,uCAAwC,CAAG;MACtDmB,KAAK,EAAGnB,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,OAAOe,aAAA,CAACL,gBAAgB;IAACG,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","withSelect","store","editorStore","privateApis","preferencesPrivateApis","EnableCustomFieldsOption","EnablePanelOption","editPostStore","unlock","PreferencesModalSection","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","createElement","label","map","title","key","panelName","select","getEditorSettings","getAllMetaBoxes","enableCustomFields","undefined"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SA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AAS,EAAEc,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAEhB,gBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"names":["__","withSelect","store","editorStore","privateApis","preferencesPrivateApis","EnableCustomFieldsOption","EnablePanelOption","editPostStore","unlock","PreferencesModalSection","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","createElement","label","map","title","key","panelName","select","getEditorSettings","getAllMetaBoxes","enableCustomFields","undefined"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,wBAAwB;AAC7D,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAwB,CAAC,GAAGD,MAAM,CAAEJ,sBAAuB,CAAC;AAEpE,OAAO,SAASM,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACT,uBAAuB;IAAA,GAAMI;EAAY,GACvCF,yBAAyB,IAC1BO,aAAA,CAACb,wBAAwB;IAACc,KAAK,EAAGpB,EAAE,CAAE,eAAgB;EAAG,CAAE,CAC3D,EACCe,mBAAmB,CAACM,GAAG,CAAE,CAAE;IAAEJ,EAAE;IAAEK;EAAM,CAAC,KACzCH,aAAA,CAACZ,iBAAiB;IACjBgB,GAAG,EAAGN,EAAI;IACVG,KAAK,EAAGE,KAAO;IACfE,SAAS,EAAI,YAAYP,EAAI;EAAG,CAChC,CACA,CACsB,CAAC;AAE5B;AAEA,eAAehB,UAAU,CAAIwB,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAkB,CAAC,GAAGD,MAAM,CAAEtB,WAAY,CAAC;EACnD,MAAM;IAAEwB;EAAgB,CAAC,GAAGF,MAAM,CAAEjB,aAAc,CAAC;EAEnD,OAAO;IACN;IACAI,yBAAyB,EACxBc,iBAAiB,CAAC,CAAC,CAACE,kBAAkB,KAAKC,SAAS;IACrDhB,SAAS,EAAEc,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAEhB,gBAAiB,CAAC","ignoreList":[]}
|
|
@@ -2,79 +2,31 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
const {
|
|
8
|
-
Fill,
|
|
9
|
-
Slot
|
|
10
|
-
} = createSlotFill('PluginPostPublishPanel');
|
|
5
|
+
import deprecated from '@wordpress/deprecated';
|
|
6
|
+
import { PluginPostPublishPanel } from '@wordpress/editor';
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
9
|
* Renders provided content to the post-publish panel in the publish flow
|
|
14
10
|
* (side panel that opens after a user publishes the post).
|
|
15
11
|
*
|
|
12
|
+
* @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
|
|
13
|
+
*
|
|
16
14
|
* @param {Object} props Component properties.
|
|
17
15
|
* @param {string} [props.className] An optional class name added to the panel.
|
|
18
16
|
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
19
17
|
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
20
18
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
21
19
|
* @param {Element} props.children Children to be rendered
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```js
|
|
25
|
-
* // Using ES5 syntax
|
|
26
|
-
* var __ = wp.i18n.__;
|
|
27
|
-
* var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
|
|
28
|
-
*
|
|
29
|
-
* function MyPluginPostPublishPanel() {
|
|
30
|
-
* return React.createElement(
|
|
31
|
-
* PluginPostPublishPanel,
|
|
32
|
-
* {
|
|
33
|
-
* className: 'my-plugin-post-publish-panel',
|
|
34
|
-
* title: __( 'My panel title' ),
|
|
35
|
-
* initialOpen: true,
|
|
36
|
-
* },
|
|
37
|
-
* __( 'My panel content' )
|
|
38
|
-
* );
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```jsx
|
|
44
|
-
* // Using ESNext syntax
|
|
45
|
-
* import { __ } from '@wordpress/i18n';
|
|
46
|
-
* import { PluginPostPublishPanel } from '@wordpress/edit-post';
|
|
47
|
-
*
|
|
48
|
-
* const MyPluginPostPublishPanel = () => (
|
|
49
|
-
* <PluginPostPublishPanel
|
|
50
|
-
* className="my-plugin-post-publish-panel"
|
|
51
|
-
* title={ __( 'My panel title' ) }
|
|
52
|
-
* initialOpen={ true }
|
|
53
|
-
* >
|
|
54
|
-
* { __( 'My panel content' ) }
|
|
55
|
-
* </PluginPostPublishPanel>
|
|
56
|
-
* );
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
20
|
* @return {Component} The component to be rendered.
|
|
60
21
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return createElement(Fill, null, createElement(PanelBody, {
|
|
72
|
-
className: className,
|
|
73
|
-
initialOpen: initialOpen || !title,
|
|
74
|
-
title: title,
|
|
75
|
-
icon: icon !== null && icon !== void 0 ? icon : pluginIcon
|
|
76
|
-
}, children));
|
|
77
|
-
};
|
|
78
|
-
PluginPostPublishPanel.Slot = Slot;
|
|
79
|
-
export default PluginPostPublishPanel;
|
|
22
|
+
export default function EditPostPluginPostPublishPanel(props) {
|
|
23
|
+
deprecated('wp.editPost.PluginPostPublishPanel', {
|
|
24
|
+
since: '6.6',
|
|
25
|
+
version: '6.8',
|
|
26
|
+
alternative: 'wp.editor.PluginPostPublishPanel'
|
|
27
|
+
});
|
|
28
|
+
return createElement(PluginPostPublishPanel, {
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
80
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["deprecated","PluginPostPublishPanel","EditPostPluginPostPublishPanel","props","since","version","alternative","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { PluginPostPublishPanel } from '@wordpress/editor';\n\n/**\n * Renders provided content to the post-publish panel in the publish flow\n * (side panel that opens after a user publishes the post).\n *\n * @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n * @return {Component} The component to be rendered.\n */\nexport default function EditPostPluginPostPublishPanel( props ) {\n\tdeprecated( 'wp.editPost.PluginPostPublishPanel', {\n\t\tsince: '6.6',\n\t\tversion: '6.8',\n\t\talternative: 'wp.editor.PluginPostPublishPanel',\n\t} );\n\treturn <PluginPostPublishPanel { ...props } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAC9C,SAASC,sBAAsB,QAAQ,mBAAmB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,8BAA8BA,CAAEC,KAAK,EAAG;EAC/DH,UAAU,CAAE,oCAAoC,EAAE;IACjDI,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAOC,aAAA,CAACN,sBAAsB;IAAA,GAAME;EAAK,CAAI,CAAC;AAC/C","ignoreList":[]}
|