@wordpress/edit-post 8.32.0 → 8.32.1-next.ff1cebbba.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/build/commands/use-commands.js +54 -47
- package/build/commands/use-commands.js.map +7 -1
- package/build/components/back-button/fullscreen-mode-close.js +127 -118
- package/build/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build/components/back-button/index.js +56 -54
- package/build/components/back-button/index.js.map +7 -1
- package/build/components/browser-url/index.js +45 -44
- package/build/components/browser-url/index.js.map +7 -1
- package/build/components/editor-initialization/index.js +24 -18
- package/build/components/editor-initialization/index.js.map +7 -1
- package/build/components/editor-initialization/listener-hooks.js +42 -43
- package/build/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build/components/init-pattern-modal/index.js +100 -79
- package/build/components/init-pattern-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +37 -33
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +447 -467
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/use-padding-appender.js +66 -59
- package/build/components/layout/use-padding-appender.js.map +7 -1
- package/build/components/layout/use-should-iframe.js +36 -30
- package/build/components/layout/use-should-iframe.js.map +7 -1
- package/build/components/meta-boxes/index.js +46 -33
- package/build/components/meta-boxes/index.js.map +7 -1
- package/build/components/meta-boxes/meta-box-visibility.js +37 -22
- package/build/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +62 -53
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +37 -32
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build/components/more-menu/index.js +64 -44
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/manage-patterns-menu-item.js +39 -37
- package/build/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +39 -21
- package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build/components/preferences-modal/enable-custom-fields.js +76 -66
- package/build/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build/components/preferences-modal/enable-panel.js +47 -43
- package/build/components/preferences-modal/enable-panel.js.map +7 -1
- package/build/components/preferences-modal/index.js +51 -39
- package/build/components/preferences-modal/index.js.map +7 -1
- package/build/components/preferences-modal/meta-boxes-section.js +65 -52
- package/build/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build/components/welcome-guide/default.js +134 -97
- package/build/components/welcome-guide/default.js.map +7 -1
- package/build/components/welcome-guide/image.js +34 -23
- package/build/components/welcome-guide/image.js.map +7 -1
- package/build/components/welcome-guide/index.js +51 -38
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/welcome-guide/template.js +65 -45
- package/build/components/welcome-guide/template.js.map +7 -1
- package/build/deprecated.js +84 -110
- package/build/deprecated.js.map +7 -1
- package/build/hooks/use-navigate-to-entity-record.js +60 -78
- package/build/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build/index.js +101 -136
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +239 -431
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +33 -26
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +50 -57
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +288 -459
- package/build/store/selectors.js.map +7 -1
- package/build/utils/meta-boxes.js +31 -19
- package/build/utils/meta-boxes.js.map +7 -1
- package/build-module/commands/use-commands.js +35 -40
- package/build-module/commands/use-commands.js.map +7 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +102 -110
- package/build-module/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build-module/components/back-button/index.js +28 -47
- package/build-module/components/back-button/index.js.map +7 -1
- package/build-module/components/browser-url/index.js +23 -38
- package/build-module/components/browser-url/index.js.map +7 -1
- package/build-module/components/editor-initialization/index.js +6 -13
- package/build-module/components/editor-initialization/index.js.map +7 -1
- package/build-module/components/editor-initialization/listener-hooks.js +20 -34
- package/build-module/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build-module/components/init-pattern-modal/index.js +90 -74
- package/build-module/components/init-pattern-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +21 -26
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +439 -448
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/use-padding-appender.js +44 -54
- package/build-module/components/layout/use-padding-appender.js.map +7 -1
- package/build-module/components/layout/use-should-iframe.js +15 -25
- package/build-module/components/layout/use-should-iframe.js.map +7 -1
- package/build-module/components/meta-boxes/index.js +18 -26
- package/build-module/components/meta-boxes/index.js.map +7 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +18 -15
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +30 -44
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +14 -25
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build-module/components/more-menu/index.js +36 -37
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js +21 -31
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +22 -16
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +51 -56
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build-module/components/preferences-modal/enable-panel.js +30 -38
- package/build-module/components/preferences-modal/enable-panel.js.map +7 -1
- package/build-module/components/preferences-modal/index.js +24 -34
- package/build-module/components/preferences-modal/index.js.map +7 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +34 -45
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build-module/components/welcome-guide/default.js +107 -91
- package/build-module/components/welcome-guide/default.js.map +7 -1
- package/build-module/components/welcome-guide/image.js +16 -18
- package/build-module/components/welcome-guide/image.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +23 -31
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/welcome-guide/template.js +38 -39
- package/build-module/components/welcome-guide/template.js.map +7 -1
- package/build-module/deprecated.js +62 -103
- package/build-module/deprecated.js.map +7 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +42 -73
- package/build-module/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build-module/index.js +70 -95
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +158 -368
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +9 -21
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +28 -51
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +232 -442
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils/meta-boxes.js +9 -13
- package/build-module/utils/meta-boxes.js.map +7 -1
- package/build-style/classic-rtl.css +0 -154
- package/build-style/classic.css +0 -154
- package/build-style/style-rtl.css +135 -110
- package/build-style/style.css +135 -110
- package/package.json +39 -31
- package/src/classic.scss +3 -0
- package/src/components/back-button/style.scss +3 -0
- package/src/components/layout/index.js +3 -2
- package/src/components/layout/style.scss +4 -0
- package/src/components/meta-boxes/meta-boxes-area/style.scss +3 -0
- package/src/components/welcome-guide/style.scss +3 -0
- package/src/style.scss +8 -4
- package/build/components/header/header-toolbar/index.native.js +0 -204
- package/build/components/header/header-toolbar/index.native.js.map +0 -1
- package/build/components/header/index.native.js +0 -59
- package/build/components/header/index.native.js.map +0 -1
- package/build/components/layout/index.native.js +0 -166
- package/build/components/layout/index.native.js.map +0 -1
- package/build/components/visual-editor/header.native.js +0 -63
- package/build/components/visual-editor/header.native.js.map +0 -1
- package/build/components/visual-editor/index.native.js +0 -44
- package/build/components/visual-editor/index.native.js.map +0 -1
- package/build/editor.native.js +0 -157
- package/build/editor.native.js.map +0 -1
- package/build/index.native.js +0 -58
- package/build/index.native.js.map +0 -1
- package/build-module/components/header/header-toolbar/index.native.js +0 -196
- package/build-module/components/header/header-toolbar/index.native.js.map +0 -1
- package/build-module/components/header/index.native.js +0 -50
- package/build-module/components/header/index.native.js.map +0 -1
- package/build-module/components/layout/index.native.js +0 -158
- package/build-module/components/layout/index.native.js.map +0 -1
- package/build-module/components/visual-editor/header.native.js +0 -56
- package/build-module/components/visual-editor/header.native.js.map +0 -1
- package/build-module/components/visual-editor/index.native.js +0 -35
- package/build-module/components/visual-editor/index.native.js.map +0 -1
- package/build-module/editor.native.js +0 -149
- package/build-module/editor.native.js.map +0 -1
- package/build-module/index.native.js +0 -45
- package/build-module/index.native.js.map +0 -1
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Platform, SafeAreaView, View } from 'react-native';
|
|
5
|
-
import SafeArea from 'react-native-safe-area';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { Component } from '@wordpress/element';
|
|
11
|
-
import { withSelect } from '@wordpress/data';
|
|
12
|
-
import { BottomSheetSettings, FloatingToolbar, store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
|
-
import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
14
|
-
import { HTMLTextInput, KeyboardAvoidingView, NoticeList, Tooltip, __unstableAutocompletionItemsSlot as AutocompletionItemsSlot } from '@wordpress/components';
|
|
15
|
-
import { AutosaveMonitor, OfflineStatus, store as editorStore } from '@wordpress/editor';
|
|
16
|
-
import { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
import styles from './style.scss';
|
|
22
|
-
import headerToolbarStyles from '../header/header-toolbar/style.scss';
|
|
23
|
-
import Header from '../header';
|
|
24
|
-
import VisualEditor from '../visual-editor';
|
|
25
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
-
class Layout extends Component {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
this.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind(this);
|
|
30
|
-
this.onRootViewLayout = this.onRootViewLayout.bind(this);
|
|
31
|
-
this.state = {
|
|
32
|
-
rootViewHeight: 0,
|
|
33
|
-
safeAreaInsets: {
|
|
34
|
-
top: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
right: 0,
|
|
37
|
-
left: 0
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
SafeArea.getSafeAreaInsetsForRootView().then(this.onSafeAreaInsetsUpdate);
|
|
41
|
-
}
|
|
42
|
-
componentDidMount() {
|
|
43
|
-
this._isMounted = true;
|
|
44
|
-
this.safeAreaSubscription = SafeArea.addEventListener('safeAreaInsetsForRootViewDidChange', this.onSafeAreaInsetsUpdate);
|
|
45
|
-
}
|
|
46
|
-
componentWillUnmount() {
|
|
47
|
-
this.safeAreaSubscription?.remove();
|
|
48
|
-
this._isMounted = false;
|
|
49
|
-
}
|
|
50
|
-
onSafeAreaInsetsUpdate(result) {
|
|
51
|
-
const {
|
|
52
|
-
safeAreaInsets
|
|
53
|
-
} = result;
|
|
54
|
-
if (this._isMounted) {
|
|
55
|
-
this.setState({
|
|
56
|
-
safeAreaInsets
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
onRootViewLayout(event) {
|
|
61
|
-
if (this._isMounted) {
|
|
62
|
-
this.setHeightState(event);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
setHeightState(event) {
|
|
66
|
-
const {
|
|
67
|
-
height
|
|
68
|
-
} = event.nativeEvent.layout;
|
|
69
|
-
if (height !== this.state.rootViewHeight) {
|
|
70
|
-
this.setState({
|
|
71
|
-
rootViewHeight: height
|
|
72
|
-
}, sendNativeEditorDidLayout);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
renderHTML() {
|
|
76
|
-
const {
|
|
77
|
-
globalStyles
|
|
78
|
-
} = this.props;
|
|
79
|
-
return /*#__PURE__*/_jsx(HTMLTextInput, {
|
|
80
|
-
parentHeight: this.state.rootViewHeight,
|
|
81
|
-
style: globalStyles
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
renderVisual() {
|
|
85
|
-
const {
|
|
86
|
-
isReady
|
|
87
|
-
} = this.props;
|
|
88
|
-
if (!isReady) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return /*#__PURE__*/_jsx(VisualEditor, {
|
|
92
|
-
setTitleRef: this.props.setTitleRef
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
render() {
|
|
96
|
-
const {
|
|
97
|
-
getStylesFromColorScheme,
|
|
98
|
-
mode,
|
|
99
|
-
globalStyles
|
|
100
|
-
} = this.props;
|
|
101
|
-
const isHtmlView = mode === 'text';
|
|
102
|
-
|
|
103
|
-
// Add a margin view at the bottom for the header.
|
|
104
|
-
const marginBottom = Platform.OS === 'android' && !isHtmlView ? headerToolbarStyles['header-toolbar__container'].height : 0;
|
|
105
|
-
const containerStyles = getStylesFromColorScheme(styles.container, styles.containerDark);
|
|
106
|
-
const toolbarKeyboardAvoidingViewStyle = {
|
|
107
|
-
...styles.toolbarKeyboardAvoidingView,
|
|
108
|
-
left: this.state.safeAreaInsets.left,
|
|
109
|
-
right: this.state.safeAreaInsets.right,
|
|
110
|
-
bottom: this.state.safeAreaInsets.bottom,
|
|
111
|
-
backgroundColor: containerStyles.backgroundColor
|
|
112
|
-
};
|
|
113
|
-
const editorStyles = [getStylesFromColorScheme(styles.background, styles.backgroundDark), globalStyles?.background && {
|
|
114
|
-
backgroundColor: globalStyles.background
|
|
115
|
-
}];
|
|
116
|
-
return /*#__PURE__*/_jsx(Tooltip.Slot, {
|
|
117
|
-
children: /*#__PURE__*/_jsxs(SafeAreaView, {
|
|
118
|
-
style: containerStyles,
|
|
119
|
-
onLayout: this.onRootViewLayout,
|
|
120
|
-
children: [/*#__PURE__*/_jsx(AutosaveMonitor, {
|
|
121
|
-
disableIntervalChecks: true
|
|
122
|
-
}), /*#__PURE__*/_jsx(OfflineStatus, {}), /*#__PURE__*/_jsxs(View, {
|
|
123
|
-
style: editorStyles,
|
|
124
|
-
children: [isHtmlView ? this.renderHTML() : this.renderVisual(), !isHtmlView && Platform.OS === 'android' && /*#__PURE__*/_jsx(FloatingToolbar, {}), /*#__PURE__*/_jsx(NoticeList, {})]
|
|
125
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
126
|
-
style: {
|
|
127
|
-
flex: 0,
|
|
128
|
-
flexBasis: marginBottom,
|
|
129
|
-
height: marginBottom
|
|
130
|
-
}
|
|
131
|
-
}), !isHtmlView && /*#__PURE__*/_jsxs(KeyboardAvoidingView, {
|
|
132
|
-
parentHeight: this.state.rootViewHeight,
|
|
133
|
-
style: toolbarKeyboardAvoidingViewStyle,
|
|
134
|
-
withAnimatedHeight: true,
|
|
135
|
-
children: [Platform.OS === 'ios' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
|
-
children: [/*#__PURE__*/_jsx(AutocompletionItemsSlot, {}), /*#__PURE__*/_jsx(FloatingToolbar, {})]
|
|
137
|
-
}), /*#__PURE__*/_jsx(Header, {}), /*#__PURE__*/_jsx(BottomSheetSettings, {})]
|
|
138
|
-
}), Platform.OS === 'android' && /*#__PURE__*/_jsx(AutocompletionItemsSlot, {})]
|
|
139
|
-
})
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
export default compose([withSelect(select => {
|
|
144
|
-
const {
|
|
145
|
-
__unstableIsEditorReady: isEditorReady,
|
|
146
|
-
getEditorMode
|
|
147
|
-
} = select(editorStore);
|
|
148
|
-
const {
|
|
149
|
-
getSettings
|
|
150
|
-
} = select(blockEditorStore);
|
|
151
|
-
const globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles?.color;
|
|
152
|
-
return {
|
|
153
|
-
isReady: isEditorReady(),
|
|
154
|
-
mode: getEditorMode(),
|
|
155
|
-
globalStyles
|
|
156
|
-
};
|
|
157
|
-
}), withPreferredColorScheme])(Layout);
|
|
158
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","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","parentHeight","style","renderVisual","isReady","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","OS","containerStyles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Slot","children","onLayout","disableIntervalChecks","flex","flexBasis","withAnimatedHeight","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,aAAa,EACbX,KAAK,IAAIY,WAAW,QACd,mBAAmB;AAC1B,SAASC,yBAAyB,QAAQ,gCAAgC;;AAE1E;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,mBAAmB,MAAM,qCAAqC;AACrE,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,YAAY,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE5C,MAAMC,MAAM,SAAS5B,SAAS,CAAC;EAC9B6B,WAAW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ACV,uBAAuB,IAAE,CAAC,eAC3BU,IAAA,CAACpB,eAAe,IAAE,CAAC;UAAA,CAClB,CACF,eACDoB,IAAA,CAACH,MAAM,IAAE,CAAC,eACVG,IAAA,CAACrB,mBAAmB,IAAE,CAAC;QAAA,CACF,CACtB,EACCN,QAAQ,CAACyE,EAAE,KAAK,SAAS,iBAAI9C,IAAA,CAACV,uBAAuB,IAAE,CAAC;MAAA,CAC7C;IAAC,CACF,CAAC;EAEjB;AACD;AAEA,eAAeP,OAAO,CAAE,CACvBL,UAAU,CAAIqF,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEtE,WAAY,CAAC;EACtB,MAAM;IAAE0E;EAAY,CAAC,GAAGJ,MAAM,CAAEjF,gBAAiB,CAAC;EAClD,MAAMoD,YAAY,GACjBiC,WAAW,CAAC,CAAC,EAAEC,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACN9B,OAAO,EAAE0B,aAAa,CAAC,CAAC;IACxBtB,IAAI,EAAEuB,aAAa,CAAC,CAAC;IACrBhC;EACD,CAAC;AACF,CAAE,CAAC,EACHlD,wBAAwB,CACvB,CAAC,CAAEqB,MAAO,CAAC","ignoreList":[]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { memo } from '@wordpress/element';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { withDispatch, withSelect } from '@wordpress/data';
|
|
12
|
-
import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
13
|
-
import { PostTitle } from '@wordpress/editor';
|
|
14
|
-
import { store as blockEditorStore, useEditorWrapperStyles } from '@wordpress/block-editor';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const Header = memo(function EditorHeader({
|
|
17
|
-
editTitle,
|
|
18
|
-
setTitleRef,
|
|
19
|
-
title
|
|
20
|
-
}) {
|
|
21
|
-
const [wrapperStyles] = useEditorWrapperStyles();
|
|
22
|
-
return /*#__PURE__*/_jsx(View, {
|
|
23
|
-
style: wrapperStyles,
|
|
24
|
-
children: /*#__PURE__*/_jsx(PostTitle, {
|
|
25
|
-
innerRef: setTitleRef,
|
|
26
|
-
title: title,
|
|
27
|
-
onUpdate: editTitle,
|
|
28
|
-
placeholder: __('Add title'),
|
|
29
|
-
accessibilityLabel: "post-title"
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}, (prevProps, nextProps) => prevProps.title === nextProps.title);
|
|
33
|
-
export default compose([withSelect(select => {
|
|
34
|
-
const {
|
|
35
|
-
getEditedPostAttribute
|
|
36
|
-
} = select('core/editor');
|
|
37
|
-
return {
|
|
38
|
-
title: getEditedPostAttribute('title')
|
|
39
|
-
};
|
|
40
|
-
}), withDispatch(dispatch => {
|
|
41
|
-
const {
|
|
42
|
-
editPost
|
|
43
|
-
} = dispatch('core/editor');
|
|
44
|
-
const {
|
|
45
|
-
clearSelectedBlock
|
|
46
|
-
} = dispatch(blockEditorStore);
|
|
47
|
-
return {
|
|
48
|
-
clearSelectedBlock,
|
|
49
|
-
editTitle(title) {
|
|
50
|
-
editPost({
|
|
51
|
-
title
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}), withPreferredColorScheme])(Header);
|
|
56
|
-
//# sourceMappingURL=header.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["View","memo","__","withDispatch","withSelect","compose","withPreferredColorScheme","PostTitle","store","blockEditorStore","useEditorWrapperStyles","jsx","_jsx","Header","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","style","children","innerRef","onUpdate","placeholder","accessibilityLabel","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock"],"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\nconst Header = memo(\n\tfunction EditorHeader( { editTitle, setTitleRef, title } ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Header );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAA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AM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACHX,wBAAwB,CACvB,CAAC,CAAEO,MAAO,CAAC","ignoreList":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Component } from '@wordpress/element';
|
|
5
|
-
import { BlockList } from '@wordpress/block-editor';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import Header from './header';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export default class VisualEditor extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.renderHeader = this.renderHeader.bind(this);
|
|
16
|
-
}
|
|
17
|
-
renderHeader() {
|
|
18
|
-
const {
|
|
19
|
-
setTitleRef
|
|
20
|
-
} = this.props;
|
|
21
|
-
return /*#__PURE__*/_jsx(Header, {
|
|
22
|
-
setTitleRef: setTitleRef
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
const {
|
|
27
|
-
safeAreaBottomInset
|
|
28
|
-
} = this.props;
|
|
29
|
-
return /*#__PURE__*/_jsx(BlockList, {
|
|
30
|
-
header: this.renderHeader,
|
|
31
|
-
safeAreaBottomInset: safeAreaBottomInset
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Component","BlockList","Header","jsx","_jsx","VisualEditor","constructor","props","renderHeader","bind","setTitleRef","render","safeAreaBottomInset","header"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { BlockList } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\n\nexport default class VisualEditor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.renderHeader = this.renderHeader.bind( this );\n\t}\n\n\trenderHeader() {\n\t\tconst { setTitleRef } = this.props;\n\t\treturn <Header setTitleRef={ setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { safeAreaBottomInset } = this.props;\n\n\t\treturn (\n\t\t\t<BlockList\n\t\t\t\theader={ this.renderHeader }\n\t\t\t\tsafeAreaBottomInset={ safeAreaBottomInset }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,yBAAyB;;AAEnD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9B,eAAe,MAAMC,YAAY,SAASL,SAAS,CAAC;EACnDM,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,YAAY,GAAG,IAAI,CAACA,YAAY,CAACC,IAAI,CAAE,IAAK,CAAC;EACnD;EAEAD,YAAYA,CAAA,EAAG;IACd,MAAM;MAAEE;IAAY,CAAC,GAAG,IAAI,CAACH,KAAK;IAClC,oBAAOH,IAAA,CAACF,MAAM;MAACQ,WAAW,EAAGA;IAAa,CAAE,CAAC;EAC9C;EAEAC,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC;IAAoB,CAAC,GAAG,IAAI,CAACL,KAAK;IAE1C,oBACCH,IAAA,CAACH,SAAS;MACTY,MAAM,EAAG,IAAI,CAACL,YAAc;MAC5BI,mBAAmB,EAAGA;IAAqB,CAC3C,CAAC;EAEJ;AACD","ignoreList":[]}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import memize from 'memize';
|
|
5
|
-
import { I18nManager } from 'react-native';
|
|
6
|
-
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { Component } from '@wordpress/element';
|
|
12
|
-
import { EditorProvider, ErrorBoundary, store as editorStore } from '@wordpress/editor';
|
|
13
|
-
import { parse, serialize } from '@wordpress/blocks';
|
|
14
|
-
import { withDispatch, withSelect } from '@wordpress/data';
|
|
15
|
-
import { compose } from '@wordpress/compose';
|
|
16
|
-
import { subscribeSetFocusOnTitle, subscribeFeaturedImageIdNativeUpdated } from '@wordpress/react-native-bridge';
|
|
17
|
-
import { SlotFillProvider } from '@wordpress/components';
|
|
18
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
import Layout from './components/layout';
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
class Editor extends Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
if (props.initialHtmlModeEnabled && props.mode === 'visual') {
|
|
29
|
-
// Enable html mode if the initial mode the parent wants it but we're not already in it.
|
|
30
|
-
this.props.switchEditorMode('text');
|
|
31
|
-
}
|
|
32
|
-
this.getEditorSettings = memize(this.getEditorSettings, {
|
|
33
|
-
maxSize: 1
|
|
34
|
-
});
|
|
35
|
-
this.setTitleRef = this.setTitleRef.bind(this);
|
|
36
|
-
}
|
|
37
|
-
getEditorSettings(settings) {
|
|
38
|
-
settings = {
|
|
39
|
-
...settings,
|
|
40
|
-
isRTL: I18nManager.isRTL
|
|
41
|
-
};
|
|
42
|
-
return settings;
|
|
43
|
-
}
|
|
44
|
-
componentDidMount() {
|
|
45
|
-
const {
|
|
46
|
-
editEntityRecord,
|
|
47
|
-
postType,
|
|
48
|
-
postId
|
|
49
|
-
} = this.props;
|
|
50
|
-
this.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(() => {
|
|
51
|
-
if (this.postTitleRef) {
|
|
52
|
-
this.postTitleRef.focus();
|
|
53
|
-
} else {
|
|
54
|
-
// If the post title ref is not available, we postpone setting focus to when it's available.
|
|
55
|
-
this.focusTitleWhenAvailable = true;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
this.subscriptionParentFeaturedImageIdNativeUpdated = subscribeFeaturedImageIdNativeUpdated(payload => {
|
|
59
|
-
editEntityRecord('postType', postType, postId, {
|
|
60
|
-
featured_media: payload.featuredImageId
|
|
61
|
-
}, {
|
|
62
|
-
undoIgnore: true
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
componentWillUnmount() {
|
|
67
|
-
if (this.subscriptionParentSetFocusOnTitle) {
|
|
68
|
-
this.subscriptionParentSetFocusOnTitle.remove();
|
|
69
|
-
}
|
|
70
|
-
if (this.subscribeFeaturedImageIdNativeUpdated) {
|
|
71
|
-
this.subscribeFeaturedImageIdNativeUpdated.remove();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
setTitleRef(titleRef) {
|
|
75
|
-
if (this.focusTitleWhenAvailable && !this.postTitleRef) {
|
|
76
|
-
this.focusTitleWhenAvailable = false;
|
|
77
|
-
titleRef.focus();
|
|
78
|
-
}
|
|
79
|
-
this.postTitleRef = titleRef;
|
|
80
|
-
}
|
|
81
|
-
render() {
|
|
82
|
-
const {
|
|
83
|
-
settings,
|
|
84
|
-
initialEdits,
|
|
85
|
-
post,
|
|
86
|
-
postId,
|
|
87
|
-
postType,
|
|
88
|
-
featuredImageId,
|
|
89
|
-
initialHtml,
|
|
90
|
-
...props
|
|
91
|
-
} = this.props;
|
|
92
|
-
const editorSettings = this.getEditorSettings(settings);
|
|
93
|
-
const normalizedPost = post || {
|
|
94
|
-
id: postId,
|
|
95
|
-
title: {
|
|
96
|
-
raw: props.initialTitle || ''
|
|
97
|
-
},
|
|
98
|
-
featured_media: featuredImageId,
|
|
99
|
-
content: {
|
|
100
|
-
// Make sure the post content is in sync with gutenberg store
|
|
101
|
-
// to avoid marking the post as modified when simply loaded
|
|
102
|
-
// For now, let's assume: serialize( parse( html ) ) !== html.
|
|
103
|
-
raw: serialize(parse(initialHtml || ''))
|
|
104
|
-
},
|
|
105
|
-
type: postType,
|
|
106
|
-
status: 'draft',
|
|
107
|
-
meta: []
|
|
108
|
-
};
|
|
109
|
-
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
110
|
-
style: {
|
|
111
|
-
flex: 1
|
|
112
|
-
},
|
|
113
|
-
children: /*#__PURE__*/_jsx(SlotFillProvider, {
|
|
114
|
-
children: /*#__PURE__*/_jsx(EditorProvider, {
|
|
115
|
-
settings: editorSettings,
|
|
116
|
-
post: normalizedPost,
|
|
117
|
-
initialEdits: initialEdits,
|
|
118
|
-
useSubRegistry: false,
|
|
119
|
-
...props,
|
|
120
|
-
children: /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
121
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
122
|
-
setTitleRef: this.setTitleRef
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export default compose([withSelect(select => {
|
|
131
|
-
const {
|
|
132
|
-
getEditorMode
|
|
133
|
-
} = select(editorStore);
|
|
134
|
-
return {
|
|
135
|
-
mode: getEditorMode()
|
|
136
|
-
};
|
|
137
|
-
}), withDispatch(dispatch => {
|
|
138
|
-
const {
|
|
139
|
-
switchEditorMode
|
|
140
|
-
} = dispatch(editorStore);
|
|
141
|
-
const {
|
|
142
|
-
editEntityRecord
|
|
143
|
-
} = dispatch(coreStore);
|
|
144
|
-
return {
|
|
145
|
-
switchEditorMode,
|
|
146
|
-
editEntityRecord
|
|
147
|
-
};
|
|
148
|
-
})])(Editor);
|
|
149
|
-
//# sourceMappingURL=editor.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","ErrorBoundary","store","editorStore","parse","serialize","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","jsx","_jsx","Editor","constructor","props","arguments","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","isRTL","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","type","status","meta","style","flex","children","useSubRegistry","select","getEditorMode","dispatch"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA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U,gBAAgB;IAChBQ;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEd,MAAO,CAAC","ignoreList":[]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import '@wordpress/core-data';
|
|
5
|
-
import '@wordpress/format-library';
|
|
6
|
-
import { dispatch } from '@wordpress/data';
|
|
7
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
export { store } from './store';
|
|
13
|
-
import Editor from './editor';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Initializes the Editor and returns a componentProvider
|
|
17
|
-
* that can be registered with `AppRegistry.registerComponent`
|
|
18
|
-
*
|
|
19
|
-
* @param {string} id Unique identifier for editor instance.
|
|
20
|
-
* @param {Object} postType Post type of the post to edit.
|
|
21
|
-
* @param {Object} postId ID of the post to edit (unused right now)
|
|
22
|
-
*/
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
export function initializeEditor(id, postType, postId) {
|
|
25
|
-
dispatch(preferencesStore).setDefaults('core/edit-post', {
|
|
26
|
-
editorMode: 'visual',
|
|
27
|
-
fullscreenMode: true,
|
|
28
|
-
inactivePanels: [],
|
|
29
|
-
openPanels: ['post-status'],
|
|
30
|
-
welcomeGuide: true
|
|
31
|
-
});
|
|
32
|
-
dispatch(preferencesStore).setDefaults('core', {
|
|
33
|
-
editorTool: 'edit',
|
|
34
|
-
hiddenBlockTypes: [],
|
|
35
|
-
inactivePanels: [],
|
|
36
|
-
openPanels: ['post-status'],
|
|
37
|
-
isPublishSidebarEnabled: true,
|
|
38
|
-
fixedToolbar: false
|
|
39
|
-
});
|
|
40
|
-
return /*#__PURE__*/_jsx(Editor, {
|
|
41
|
-
postId: postId,
|
|
42
|
-
postType: postType
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["dispatch","store","preferencesStore","Editor","jsx","_jsx","initializeEditor","id","postType","postId","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","editorTool","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\teditorTool: 'edit',\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,sBAAsB;AAC7B,OAAO,2BAA2B;AAClC,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASD,KAAK,QAAQ,SAAS;AAC/B,OAAOE,MAAM,MAAM,UAAU;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,OAAO,SAASC,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxDT,QAAQ,CAAEE,gBAAiB,CAAC,CAACQ,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACHf,QAAQ,CAAEE,gBAAiB,CAAC,CAACQ,WAAW,CAAE,MAAM,EAAE;IACjDM,UAAU,EAAE,MAAM;IAClBC,gBAAgB,EAAE,EAAE;IACpBJ,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BI,uBAAuB,EAAE,IAAI;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,oBAAOd,IAAA,CAACF,MAAM;IAACM,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D","ignoreList":[]}
|