@wordpress/edit-post 7.35.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/commands/use-commands.js +56 -0
- package/build/commands/use-commands.js.map +1 -0
- package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +16 -14
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build/components/back-button/index.js +57 -0
- package/build/components/back-button/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +63 -62
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.native.js +2 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +50 -43
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/layout/index.js +92 -146
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +28 -21
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/layout/use-padding-appender.js.map +1 -0
- package/build/components/layout/use-should-iframe.js +46 -0
- package/build/components/layout/use-should-iframe.js.map +1 -0
- package/build/components/meta-boxes/index.js +10 -9
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +11 -11
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/more-menu/index.js +49 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +5 -4
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/preferences-modal/enable-custom-fields.js +23 -18
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +13 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/visual-editor/header.native.js +11 -10
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -3
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +50 -33
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +12 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +9 -9
- package/build/deprecated.js.map +1 -1
- package/build/editor.js +16 -11
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +18 -12
- package/build/editor.native.js.map +1 -1
- package/build/index.js +12 -13
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/commands/use-commands.js +49 -0
- package/build-module/commands/use-commands.js.map +1 -0
- package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +16 -14
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build-module/components/back-button/index.js +49 -0
- package/build-module/components/back-button/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +64 -62
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -2
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +52 -43
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +97 -149
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +30 -21
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/layout/use-padding-appender.js.map +1 -0
- package/build-module/components/layout/use-should-iframe.js +39 -0
- package/build-module/components/layout/use-should-iframe.js.map +1 -0
- package/build-module/components/meta-boxes/index.js +12 -9
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +11 -9
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +43 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +5 -4
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +11 -10
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +3 -3
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +52 -33
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +14 -8
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +9 -9
- package/build-module/deprecated.js.map +1 -1
- package/build-module/editor.js +17 -11
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +18 -12
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +10 -7
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +27 -128
- package/build-style/style.css +27 -128
- package/package.json +32 -32
- package/src/commands/use-commands.js +48 -0
- package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +1 -1
- package/src/components/back-button/index.js +34 -0
- package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
- package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
- package/src/components/layout/index.js +85 -194
- package/src/components/layout/style.scss +9 -17
- package/src/components/layout/use-should-iframe.js +40 -0
- package/src/components/{header/more-menu → more-menu}/index.js +2 -2
- package/src/index.js +11 -6
- package/src/store/selectors.js +8 -5
- package/src/style.scss +2 -5
- package/src/test/__snapshots__/editor.native.js.snap +72 -0
- package/src/test/editor.native.js +77 -0
- package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build/components/header/index.js +0 -69
- package/build/components/header/index.js.map +0 -1
- package/build/components/header/main-dashboard-button/index.js +0 -33
- package/build/components/header/main-dashboard-button/index.js.map +0 -1
- package/build/components/header/more-menu/index.js +0 -43
- package/build/components/header/more-menu/index.js.map +0 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/text-editor/index.js +0 -61
- package/build/components/text-editor/index.js.map +0 -1
- package/build/components/visual-editor/block-inspector-button.js +0 -55
- package/build/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build/components/visual-editor/index.js +0 -98
- package/build/components/visual-editor/index.js.map +0 -1
- package/build/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build/hooks/commands/use-common-commands.js +0 -119
- package/build/hooks/commands/use-common-commands.js.map +0 -1
- package/build/hooks/components/index.js +0 -11
- package/build/hooks/components/index.js.map +0 -1
- package/build/hooks/index.js +0 -5
- package/build/hooks/index.js.map +0 -1
- package/build/hooks/validate-multiple-use/index.js +0 -134
- package/build/hooks/validate-multiple-use/index.js.map +0 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build-module/components/header/index.js +0 -61
- package/build-module/components/header/index.js.map +0 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -26
- package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
- package/build-module/components/header/more-menu/index.js +0 -35
- package/build-module/components/header/more-menu/index.js.map +0 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/text-editor/index.js +0 -54
- package/build-module/components/text-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/block-inspector-button.js +0 -47
- package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/visual-editor/index.js +0 -90
- package/build-module/components/visual-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build-module/hooks/commands/use-common-commands.js +0 -112
- package/build-module/hooks/commands/use-common-commands.js.map +0 -1
- package/build-module/hooks/components/index.js +0 -8
- package/build-module/hooks/components/index.js.map +0 -1
- package/build-module/hooks/index.js +0 -6
- package/build-module/hooks/index.js.map +0 -1
- package/build-module/hooks/validate-multiple-use/index.js +0 -132
- package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
- package/src/components/header/index.js +0 -53
- package/src/components/header/main-dashboard-button/index.js +0 -28
- package/src/components/header/style.scss +0 -14
- package/src/components/text-editor/index.js +0 -63
- package/src/components/text-editor/style.scss +0 -71
- package/src/components/visual-editor/block-inspector-button.js +0 -59
- package/src/components/visual-editor/index.js +0 -108
- package/src/components/visual-editor/style.scss +0 -53
- package/src/hooks/commands/use-common-commands.js +0 -126
- package/src/hooks/components/index.js +0 -13
- package/src/hooks/index.js +0 -5
- package/src/hooks/validate-multiple-use/index.js +0 -163
- /package/build/components/{visual-editor → layout}/use-padding-appender.js +0 -0
- /package/build-module/components/{visual-editor → layout}/use-padding-appender.js +0 -0
- /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
- /package/src/components/{visual-editor → layout}/use-padding-appender.js +0 -0
- /package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +0 -0
- /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_reactNativeSafeArea","_interopRequireDefault","_element","_data","_blockEditor","_compose","_components","_editor","_reactNativeBridge","_style","_style2","_header","_visualEditor","Layout","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","SafeArea","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","sendNativeEditorDidLayout","renderHTML","globalStyles","props","_react","createElement","HTMLTextInput","parentHeight","style","renderVisual","isReady","default","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","Platform","OS","headerToolbarStyles","containerStyles","styles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Tooltip","Slot","SafeAreaView","onLayout","AutosaveMonitor","disableIntervalChecks","OfflineStatus","View","FloatingToolbar","NoticeList","flex","flexBasis","KeyboardAvoidingView","withAnimatedHeight","Fragment","__unstableAutocompletionItemsSlot","BottomSheetSettings","_default","exports","compose","withSelect","select","__unstableIsEditorReady","isEditorReady","getEditorMode","editorStore","getSettings","blockEditorStore","__experimentalGlobalStylesBaseStyles","color","withPreferredColorScheme"],"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":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,kBAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,OAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,OAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,aAAA,GAAAX,sBAAA,CAAAF,OAAA;AArCA;AACA;AACA;;AAIA;AACA;AACA;;AAuBA;AACA;AACA;;AAMA,MAAMc,MAAM,SAASC,kBAAS,CAAC;EAC9BC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,sBAAsB,GAAG,IAAI,CAACA,sBAAsB,CAACC,IAAI,CAAE,IAAK,CAAC;IACtE,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACD,IAAI,CAAE,IAAK,CAAC;IAE1D,IAAI,CAACE,KAAK,GAAG;MACZC,cAAc,EAAE,CAAC;MACjBC,cAAc,EAAE;QAAEC,GAAG,EAAE,CAAC;QAAEC,MAAM,EAAE,CAAC;QAAEC,KAAK,EAAE,CAAC;QAAEC,IAAI,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3B,IAAA1C,MAAA,CAAAC,aAAA,EAAC5C,YAAA,CAAA8E,eAAe,MAAE,CACjB,CACF,EACD,IAAAnC,MAAA,CAAAC,aAAA,EAACrC,OAAA,CAAA2C,OAAM,MAAE,CAAC,EACV,IAAAP,MAAA,CAAAC,aAAA,EAAC5C,YAAA,CAAAsF,mBAAmB,MAAE,CACD,CACtB,EACC7B,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAI,IAAAf,MAAA,CAAAC,aAAA,EAAC1C,WAAA,CAAAmF,iCAAuB,MAAE,CAC5C,CACD,CAAC;EAEjB;AACD;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEc,IAAAuC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEI,aAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;EAClD,MAAMxD,YAAY,GACjBuD,WAAW,CAAC,CAAC,EAAEE,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACNlD,OAAO,EAAE4C,aAAa,CAAC,CAAC;IACxBvC,IAAI,EAAEwC,aAAa,CAAC,CAAC;IACrBrD;EACD,CAAC;AACF,CAAE,CAAC,EACH2D,iCAAwB,CACvB,CAAC,CAAE3F,MAAO,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeSafeArea","_interopRequireDefault","_element","_data","_blockEditor","_compose","_components","_editor","_reactNativeBridge","_style","_style2","_header","_visualEditor","_jsxRuntime","Layout","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","SafeArea","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","sendNativeEditorDidLayout","renderHTML","globalStyles","props","jsx","HTMLTextInput","parentHeight","style","renderVisual","isReady","default","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","Platform","OS","headerToolbarStyles","containerStyles","styles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Tooltip","Slot","children","jsxs","SafeAreaView","onLayout","AutosaveMonitor","disableIntervalChecks","OfflineStatus","View","FloatingToolbar","NoticeList","flex","flexBasis","KeyboardAvoidingView","withAnimatedHeight","Fragment","__unstableAutocompletionItemsSlot","BottomSheetSettings","_default","exports","compose","withSelect","select","__unstableIsEditorReady","isEditorReady","getEditorMode","editorStore","getSettings","blockEditorStore","__experimentalGlobalStylesBaseStyles","color","withPreferredColorScheme"],"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":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,kBAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAR,sBAAA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,OAAA,GAEc,IAAAyC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEI,aAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;EAClD,MAAMzD,YAAY,GACjBwD,WAAW,CAAC,CAAC,EAAEE,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACNpD,OAAO,EAAE8C,aAAa,CAAC,CAAC;IACxBzC,IAAI,EAAE0C,aAAa,CAAC,CAAC;IACrBtD;EACD,CAAC;AACF,CAAE,CAAC,EACH4D,iCAAwB,CACvB,CAAC,CAAE5F,MAAO,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst paddingBottom = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node ).paddingBottom,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! paddingBottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\t// Do nothing when only default block appender is present.\n\t\t\t\tif ( ! lastBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,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C,IAAK,IAAAS,gCAAwB,EAAEL,SAAU,CAAC,EAAG;QAC5CE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAzB,IAAI,CAAC4B,gBAAgB,CAAE,WAAW,EAAE3B,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC6B,mBAAmB,CAAE,WAAW,EAAE5B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEJ,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useShouldIframe = useShouldIframe;
|
|
7
|
+
var _editor = require("@wordpress/editor");
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
var _blocks = require("@wordpress/blocks");
|
|
10
|
+
var _store = require("../../store");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
|
|
20
|
+
function useShouldIframe() {
|
|
21
|
+
const {
|
|
22
|
+
isBlockBasedTheme,
|
|
23
|
+
hasV3BlocksOnly,
|
|
24
|
+
isEditingTemplate,
|
|
25
|
+
hasMetaBoxes
|
|
26
|
+
} = (0, _data.useSelect)(select => {
|
|
27
|
+
const {
|
|
28
|
+
getEditorSettings,
|
|
29
|
+
getCurrentPostType
|
|
30
|
+
} = select(_editor.store);
|
|
31
|
+
const {
|
|
32
|
+
getBlockTypes
|
|
33
|
+
} = select(_blocks.store);
|
|
34
|
+
const editorSettings = getEditorSettings();
|
|
35
|
+
return {
|
|
36
|
+
isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
|
|
37
|
+
hasV3BlocksOnly: getBlockTypes().every(type => {
|
|
38
|
+
return type.apiVersion >= 3;
|
|
39
|
+
}),
|
|
40
|
+
isEditingTemplate: getCurrentPostType() === 'wp_template',
|
|
41
|
+
hasMetaBoxes: select(_store.store).hasMetaBoxes()
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=use-should-iframe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_editor","require","_data","_blocks","_store","isGutenbergPlugin","globalThis","IS_GUTENBERG_PLUGIN","useShouldIframe","isBlockBasedTheme","hasV3BlocksOnly","isEditingTemplate","hasMetaBoxes","useSelect","select","getEditorSettings","getCurrentPostType","editorStore","getBlockTypes","blocksStore","editorSettings","__unstableIsBlockBasedTheme","every","type","apiVersion","editPostStore"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\tconst {\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t\tisEditingTemplate,\n\t\thasMetaBoxes,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType } = select( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\treturn {\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t\tisEditingTemplate: getCurrentPostType() === 'wp_template',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisEditingTemplate\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMI,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEhE,SAASC,eAAeA,CAAA,EAAG;EACjC,MAAM;IACLC,iBAAiB;IACjBC,eAAe;IACfC,iBAAiB;IACjBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MAAEC,iBAAiB;MAAEC;IAAmB,CAAC,GAAGF,MAAM,CAAEG,aAAY,CAAC;IACvE,MAAM;MAAEC;IAAc,CAAC,GAAGJ,MAAM,CAAEK,aAAY,CAAC;IAC/C,MAAMC,cAAc,GAAGL,iBAAiB,CAAC,CAAC;IAC1C,OAAO;MACNN,iBAAiB,EAAEW,cAAc,CAACC,2BAA2B;MAC7DX,eAAe,EAAEQ,aAAa,CAAC,CAAC,CAACI,KAAK,CAAIC,IAAI,IAAM;QACnD,OAAOA,IAAI,CAACC,UAAU,IAAI,CAAC;MAC5B,CAAE,CAAC;MACHb,iBAAiB,EAAEK,kBAAkB,CAAC,CAAC,KAAK,aAAa;MACzDJ,YAAY,EAAEE,MAAM,CAAEW,YAAc,CAAC,CAACb,YAAY,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACG,CAAEF,eAAe,IAAML,iBAAiB,IAAII,iBAAmB,KAChE,CAAEG,YAAY,IACfD,iBAAiB;AAEnB","ignoreList":[]}
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = MetaBoxes;
|
|
8
|
-
var _react = require("react");
|
|
9
8
|
var _data = require("@wordpress/data");
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
10
|
var _editor = require("@wordpress/editor");
|
|
12
11
|
var _metaBoxesArea = _interopRequireDefault(require("./meta-boxes-area"));
|
|
13
12
|
var _metaBoxVisibility = _interopRequireDefault(require("./meta-box-visibility"));
|
|
14
13
|
var _store = require("../../store");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
17
17
|
*/
|
|
@@ -55,13 +55,14 @@ function MetaBoxes({
|
|
|
55
55
|
if (!areMetaBoxesInitialized) {
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
|
-
return (0,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
|
+
children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
|
|
60
|
+
id
|
|
61
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxVisibility.default, {
|
|
62
|
+
id: id
|
|
63
|
+
}, id)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxesArea.default, {
|
|
64
|
+
location: location
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
66
67
|
}
|
|
67
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","hasMetaBoxes","length","useEffect","dispatch","initializeMetaBoxes","
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","_jsxRuntime","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","hasMetaBoxes","length","useEffect","dispatch","initializeMetaBoxes","jsxs","Fragment","children","map","id","jsx","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAqD,IAAAO,WAAA,GAAAP,OAAA;AAZrD;AACA;AACA;;AAKA;AACA;AACA;;AAKe,SAASQ,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACzD,MAAM;MACLC,uBAAuB;MACvBN,uBAAuB,EAAEO;IAC1B,CAAC,GAAGJ,MAAM,CAAEK,YAAc,CAAC;IAC3B,OAAO;MACNT,SAAS,EAAEO,uBAAuB,CAAEV,QAAS,CAAC;MAC9CI,uBAAuB,EAAEO,wBAAwB,CAAC,CAAC;MACnDN,aAAa,EAAEG,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAER,QAAQ,CACX,CAAC;EAED,MAAMa,YAAY,GAAG,CAAC,CAAEV,SAAS,EAAEW,MAAM;;EAEzC;EACA;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKV,aAAa,IAAIQ,YAAY,IAAI,CAAET,uBAAuB,EAAG;MACjEH,QAAQ,CAACe,QAAQ,CAAEJ,YAAc,CAAC,CAACK,mBAAmB,CAAC,CAAC;IACzD;EACD,CAAC,EAAE,CAAEZ,aAAa,EAAEQ,YAAY,EAAET,uBAAuB,CAAG,CAAC;EAE7D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAN,WAAA,CAAAoB,IAAA,EAAApB,WAAA,CAAAqB,QAAA;IAAAC,QAAA,GACG,CAAEjB,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGkB,GAAG,CAAE,CAAE;MAAEC;IAAG,CAAC,kBAClC,IAAAxB,WAAA,CAAAyB,GAAA,EAAC3B,kBAAA,CAAA4B,OAAiB;MAAYF,EAAE,EAAGA;IAAI,GAAdA,EAAgB,CACxC,CAAC,eACH,IAAAxB,WAAA,CAAAyB,GAAA,EAAC7B,cAAA,CAAA8B,OAAa;MAACxB,QAAQ,EAAGA;IAAU,CAAE,CAAC;EAAA,CACtC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
8
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
10
|
var _components = require("@wordpress/components");
|
|
12
11
|
var _data = require("@wordpress/data");
|
|
13
12
|
var _store = require("../../../store");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
/**
|
|
15
15
|
* External dependencies
|
|
16
16
|
*/
|
|
@@ -29,8 +29,7 @@ var _store = require("../../../store");
|
|
|
29
29
|
* @param {Object} props Component props.
|
|
30
30
|
* @param {string} props.location metabox location.
|
|
31
31
|
* @return {Component} The component to be rendered.
|
|
32
|
-
*/
|
|
33
|
-
function MetaBoxesArea({
|
|
32
|
+
*/function MetaBoxesArea({
|
|
34
33
|
location
|
|
35
34
|
}) {
|
|
36
35
|
const container = (0, _element.useRef)(null);
|
|
@@ -52,14 +51,15 @@ function MetaBoxesArea({
|
|
|
52
51
|
const classes = (0, _clsx.default)('edit-post-meta-boxes-area', `is-${location}`, {
|
|
53
52
|
'is-loading': isSaving
|
|
54
53
|
});
|
|
55
|
-
return (0,
|
|
56
|
-
className: classes
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
55
|
+
className: classes,
|
|
56
|
+
children: [isSaving && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
57
|
+
className: "edit-post-meta-boxes-area__container",
|
|
58
|
+
ref: container
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
+
className: "edit-post-meta-boxes-area__clear"
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
63
|
}
|
|
64
64
|
var _default = exports.default = MetaBoxesArea;
|
|
65
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_data","_store","MetaBoxesArea","location","container","useRef","formRef","useEffect","current","document","querySelector","appendChild","isSaving","useSelect","select","editPostStore","isSavingMetaBoxes","classes","clsx","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_data","_store","_jsxRuntime","MetaBoxesArea","location","container","useRef","formRef","useEffect","current","document","querySelector","appendChild","isSaving","useSelect","select","editPostStore","isSavingMetaBoxes","classes","clsx","jsxs","className","children","jsx","Spinner","ref","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx( 'edit-post-meta-boxes-area', `is-${ location }`, {\n\t\t'is-loading': isSaving,\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,G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AE,CAAC,eACzB,IAAAtB,WAAA,CAAAqB,GAAA;MACCF,SAAS,EAAC,sCAAsC;MAChDI,GAAG,EAAGpB;IAAW,CACjB,CAAC,eACF,IAAAH,WAAA,CAAAqB,GAAA;MAAKF,SAAS,EAAC;IAAkC,CAAE,CAAC;EAAA,CAChD,CAAC;AAER;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _compose = require("@wordpress/compose");
|
|
10
|
+
var _editor = require("@wordpress/editor");
|
|
11
|
+
var _preferences = require("@wordpress/preferences");
|
|
12
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
14
|
+
var _managePatternsMenuItem = _interopRequireDefault(require("./manage-patterns-menu-item"));
|
|
15
|
+
var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
|
|
16
|
+
var _preferencesModal = _interopRequireDefault(require("../preferences-modal"));
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
ToolsMoreMenuGroup,
|
|
28
|
+
ViewMoreMenuGroup
|
|
29
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
30
|
+
const MoreMenu = () => {
|
|
31
|
+
const isLargeViewport = (0, _compose.useViewportMatch)('large');
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
33
|
+
children: [isLargeViewport && /*#__PURE__*/(0, _jsxRuntime.jsx)(ViewMoreMenuGroup, {
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferences.PreferenceToggleMenuItem, {
|
|
35
|
+
scope: "core/edit-post",
|
|
36
|
+
name: "fullscreenMode",
|
|
37
|
+
label: (0, _i18n.__)('Fullscreen mode'),
|
|
38
|
+
info: (0, _i18n.__)('Show and hide the admin user interface'),
|
|
39
|
+
messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
|
|
40
|
+
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
|
|
41
|
+
shortcut: _keycodes.displayShortcut.secondary('f')
|
|
42
|
+
})
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToolsMoreMenuGroup, {
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_managePatternsMenuItem.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuideMenuItem.default, {})]
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferencesModal.default, {})]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var _default = exports.default = MoreMenu;
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_editor","_preferences","_keycodes","_lockUnlock","_managePatternsMenuItem","_interopRequireDefault","_welcomeGuideMenuItem","_preferencesModal","_jsxRuntime","ToolsMoreMenuGroup","ViewMoreMenuGroup","unlock","editorPrivateApis","MoreMenu","isLargeViewport","useViewportMatch","jsxs","Fragment","children","jsx","PreferenceToggleMenuItem","scope","name","label","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,G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A,CAAAyB,OAAoB,IAAE,CAAC;IAAA,CACL,CAAC,eACrB,IAAAvB,WAAA,CAAAW,GAAA,EAACZ,iBAAA,CAAAwB,OAAwB,IAAE,CAAC;EAAA,CAC3B,CAAC;AAEL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEalB,QAAQ","ignoreList":[]}
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _components = require("@wordpress/components");
|
|
9
8
|
var _coreData = require("@wordpress/core-data");
|
|
10
9
|
var _data = require("@wordpress/data");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
var _url = require("@wordpress/url");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* WordPress dependencies
|
|
15
15
|
*/
|
|
@@ -31,10 +31,11 @@ function ManagePatternsMenuItem() {
|
|
|
31
31
|
// display the manage patterns link if the user can't access it.
|
|
32
32
|
return canUser('create', 'templates') ? patternsUrl : defaultUrl;
|
|
33
33
|
}, []);
|
|
34
|
-
return (0,
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
35
35
|
role: "menuitem",
|
|
36
|
-
href: url
|
|
37
|
-
|
|
36
|
+
href: url,
|
|
37
|
+
children: (0, _i18n.__)('Manage patterns')
|
|
38
|
+
});
|
|
38
39
|
}
|
|
39
40
|
var _default = exports.default = ManagePatternsMenuItem;
|
|
40
41
|
//# sourceMappingURL=manage-patterns-menu-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_coreData","_data","_i18n","_url","_jsxRuntime","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","defaultUrl","addQueryArgs","post_type","patternsUrl","path","jsx","MenuItem","role","href","children","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAP9C;AACA;AACA;;AAOA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAON,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,GAAGK,WAAW,GAAGH,UAAU;EACnE,CAAC,EAAE,EAAG,CAAC;EAEP,oBACC,IAAAP,WAAA,CAAAY,GAAA,EAAClB,WAAA,CAAAmB,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGb,GAAK;IAAAc,QAAA,EACnC,IAAAC,QAAE,EAAE,iBAAkB;EAAC,CAChB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnB,sBAAsB","ignoreList":[]}
|
|
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = WelcomeGuideMenuItem;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _data = require("@wordpress/data");
|
|
9
8
|
var _preferences = require("@wordpress/preferences");
|
|
10
9
|
var _i18n = require("@wordpress/i18n");
|
|
11
10
|
var _editor = require("@wordpress/editor");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
/**
|
|
13
13
|
* WordPress dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
function WelcomeGuideMenuItem() {
|
|
17
17
|
const isEditingTemplate = (0, _data.useSelect)(select => select(_editor.store).getCurrentPostType() === 'wp_template', []);
|
|
18
|
-
return (0,
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferences.PreferenceToggleMenuItem, {
|
|
19
19
|
scope: "core/edit-post",
|
|
20
20
|
name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide',
|
|
21
21
|
label: (0, _i18n.__)('Welcome Guide')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_preferences","_i18n","_editor","_jsxRuntime","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","jsx","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/components/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAyD,IAAAI,WAAA,GAAAJ,OAAA;AANzD;AACA;AACA;;AAMe,SAASK,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGR,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpES,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CustomFieldsConfirmation = CustomFieldsConfirmation;
|
|
7
7
|
exports.EnableCustomFieldsOption = EnableCustomFieldsOption;
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _react = require("react");
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
var _components = require("@wordpress/components");
|
|
@@ -15,6 +14,7 @@ var _editor = require("@wordpress/editor");
|
|
|
15
14
|
var _preferences = require("@wordpress/preferences");
|
|
16
15
|
var _url = require("@wordpress/url");
|
|
17
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
@@ -37,31 +37,36 @@ function CustomFieldsConfirmation({
|
|
|
37
37
|
willEnable
|
|
38
38
|
}) {
|
|
39
39
|
const [isReloading, setIsReloading] = (0, _element.useState)(false);
|
|
40
|
-
return (0,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
42
|
+
className: "edit-post-preferences-modal__custom-fields-confirmation-message",
|
|
43
|
+
children: (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
45
|
+
className: "edit-post-preferences-modal__custom-fields-confirmation-button",
|
|
46
|
+
variant: "secondary",
|
|
47
|
+
isBusy: isReloading,
|
|
48
|
+
disabled: isReloading,
|
|
49
|
+
onClick: () => {
|
|
50
|
+
setIsReloading(true);
|
|
51
|
+
submitCustomFieldsForm();
|
|
52
|
+
},
|
|
53
|
+
children: willEnable ? (0, _i18n.__)('Show & Reload Page') : (0, _i18n.__)('Hide & Reload Page')
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
52
56
|
}
|
|
53
57
|
function EnableCustomFieldsOption({
|
|
54
58
|
label,
|
|
55
59
|
areCustomFieldsEnabled
|
|
56
60
|
}) {
|
|
57
61
|
const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
|
|
58
|
-
return (0,
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceBaseOption, {
|
|
59
63
|
label: label,
|
|
60
64
|
isChecked: isChecked,
|
|
61
|
-
onChange: setIsChecked
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
onChange: setIsChecked,
|
|
66
|
+
children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomFieldsConfirmation, {
|
|
67
|
+
willEnable: isChecked
|
|
68
|
+
})
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
var _default = exports.default = (0, _data.withSelect)(select => ({
|
|
67
72
|
areCustomFieldsEnabled: !!select(_editor.store).getEditorSettings().enableCustomFields
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","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":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAES;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,SAASC,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,EAAE,IAAAC,0BAAqB,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExER,gBAAgB,CAACS,MAAM,CAAC,CAAC;AAC1B;AAEO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAE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,sBAAsB,EACrB,CAAC,CAAEQ,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEb,wBAAyB,CAAC","ignoreList":[]}
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = EditPostPreferencesModal;
|
|
8
|
-
var _react = require("react");
|
|
9
8
|
var _i18n = require("@wordpress/i18n");
|
|
10
9
|
var _preferences = require("@wordpress/preferences");
|
|
11
10
|
var _editor = require("@wordpress/editor");
|
|
12
11
|
var _lockUnlock = require("../../lock-unlock");
|
|
13
12
|
var _metaBoxesSection = _interopRequireDefault(require("./meta-boxes-section"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
/**
|
|
15
15
|
* WordPress dependencies
|
|
16
16
|
*/
|
|
@@ -27,17 +27,17 @@ const {
|
|
|
27
27
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
28
28
|
function EditPostPreferencesModal() {
|
|
29
29
|
const extraSections = {
|
|
30
|
-
general: (0,
|
|
30
|
+
general: /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxesSection.default, {
|
|
31
31
|
title: (0, _i18n.__)('Advanced')
|
|
32
32
|
}),
|
|
33
|
-
appearance: (0,
|
|
33
|
+
appearance: /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceToggleControl, {
|
|
34
34
|
scope: "core/edit-post",
|
|
35
35
|
featureName: "themeStyles",
|
|
36
36
|
help: (0, _i18n.__)('Make the editor look like your theme.'),
|
|
37
37
|
label: (0, _i18n.__)('Use theme styles')
|
|
38
38
|
})
|
|
39
39
|
};
|
|
40
|
-
return (0,
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferencesModal, {
|
|
41
41
|
extraSections: extraSections
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_preferences","_editor","_lockUnlock","_metaBoxesSection","_interopRequireDefault","PreferenceToggleControl","unlock","preferencesPrivateApis","PreferencesModal","editorPrivateApis","EditPostPreferencesModal","extraSections","general","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_preferences","_editor","_lockUnlock","_metaBoxesSection","_interopRequireDefault","_jsxRuntime","PreferenceToggleControl","unlock","preferencesPrivateApis","PreferencesModal","editorPrivateApis","EditPostPreferencesModal","extraSections","general","jsx","default","title","__","appearance","scope","featureName","help","label"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\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';\n\nconst { PreferenceToggleControl } = unlock( preferencesPrivateApis );\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst extraSections = {\n\t\tgeneral: <MetaBoxesSection title={ __( 'Advanced' ) } />,\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":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAoD,IAAAM,WAAA,GAAAN,OAAA;AAZpD;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAwB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpE,MAAM;EAAEC;AAAiB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEzC,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,eAAE,IAAAR,WAAA,CAAAS,GAAA,EAACX,iBAAA,CAAAY,OAAgB;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAAE,CAAC;IACxDC,UAAU,eACT,IAAAb,WAAA,CAAAS,GAAA,EAACR,uBAAuB;MACvBa,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAG,IAAAJ,QAAE,EAAE,uCAAwC,CAAG;MACtDK,KAAK,EAAG,IAAAL,QAAE,EAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,oBAAO,IAAAZ,WAAA,CAAAS,GAAA,EAACL,gBAAgB;IAACG,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.MetaBoxesSection = MetaBoxesSection;
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _react = require("react");
|
|
10
9
|
var _i18n = require("@wordpress/i18n");
|
|
11
10
|
var _data = require("@wordpress/data");
|
|
12
11
|
var _editor = require("@wordpress/editor");
|
|
@@ -15,6 +14,7 @@ var _enableCustomFields = _interopRequireDefault(require("./enable-custom-fields
|
|
|
15
14
|
var _enablePanel = _interopRequireDefault(require("./enable-panel"));
|
|
16
15
|
var _store = require("../../store");
|
|
17
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
@@ -38,18 +38,18 @@ function MetaBoxesSection({
|
|
|
38
38
|
if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
return (0,
|
|
42
|
-
...sectionProps
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PreferencesModalSection, {
|
|
42
|
+
...sectionProps,
|
|
43
|
+
children: [areCustomFieldsRegistered && /*#__PURE__*/(0, _jsxRuntime.jsx)(_enableCustomFields.default, {
|
|
44
|
+
label: (0, _i18n.__)('Custom fields')
|
|
45
|
+
}), thirdPartyMetaBoxes.map(({
|
|
46
|
+
id,
|
|
47
|
+
title
|
|
48
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_enablePanel.default, {
|
|
49
|
+
label: title,
|
|
50
|
+
panelName: `meta-box-${id}`
|
|
51
|
+
}, id))]
|
|
52
|
+
});
|
|
53
53
|
}
|
|
54
54
|
var _default = exports.default = (0, _data.withSelect)(select => {
|
|
55
55
|
const {
|