@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,204 +0,0 @@
|
|
|
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 _reactNative = require("react-native");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _compose = require("@wordpress/compose");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _viewport = require("@wordpress/viewport");
|
|
13
|
-
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
-
var _components = require("@wordpress/components");
|
|
16
|
-
var _icons = require("@wordpress/icons");
|
|
17
|
-
var _editor = require("@wordpress/editor");
|
|
18
|
-
var _blocks = require("@wordpress/blocks");
|
|
19
|
-
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
20
|
-
var _style = _interopRequireDefault(require("./style.scss"));
|
|
21
|
-
var _store = require("../../../store");
|
|
22
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
/**
|
|
24
|
-
* External dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* WordPress dependencies
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Internal dependencies
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
const shadowStyle = {
|
|
36
|
-
shadowOffset: {
|
|
37
|
-
width: 2,
|
|
38
|
-
height: 2
|
|
39
|
-
},
|
|
40
|
-
shadowOpacity: 1,
|
|
41
|
-
shadowRadius: 6,
|
|
42
|
-
elevation: 18
|
|
43
|
-
};
|
|
44
|
-
function HeaderToolbar({
|
|
45
|
-
hasRedo,
|
|
46
|
-
hasUndo,
|
|
47
|
-
redo,
|
|
48
|
-
undo,
|
|
49
|
-
showInserter,
|
|
50
|
-
showKeyboardHideButton,
|
|
51
|
-
insertBlock,
|
|
52
|
-
onHideKeyboard,
|
|
53
|
-
isRTL,
|
|
54
|
-
noContentSelected
|
|
55
|
-
}) {
|
|
56
|
-
const anchorNodeRef = (0, _element.useRef)();
|
|
57
|
-
const containerStyle = [(0, _compose.usePreferredColorSchemeStyle)(_style.default['header-toolbar__container'], _style.default['header-toolbar__container--dark']), {
|
|
58
|
-
borderTopWidth: _reactNative.StyleSheet.hairlineWidth
|
|
59
|
-
}];
|
|
60
|
-
(0, _element.useEffect)(() => {
|
|
61
|
-
const onUndoSubscription = (0, _reactNativeBridge.subscribeOnUndoPressed)(undo);
|
|
62
|
-
const onRedoSubscription = (0, _reactNativeBridge.subscribeOnRedoPressed)(redo);
|
|
63
|
-
return () => {
|
|
64
|
-
onUndoSubscription?.remove();
|
|
65
|
-
onRedoSubscription?.remove();
|
|
66
|
-
};
|
|
67
|
-
}, [undo, redo]);
|
|
68
|
-
(0, _element.useEffect)(() => {
|
|
69
|
-
(0, _reactNativeBridge.toggleUndoButton)(!hasUndo);
|
|
70
|
-
}, [hasUndo]);
|
|
71
|
-
(0, _element.useEffect)(() => {
|
|
72
|
-
(0, _reactNativeBridge.toggleRedoButton)(!hasRedo);
|
|
73
|
-
}, [hasRedo]);
|
|
74
|
-
const scrollViewRef = (0, _element.useRef)(null);
|
|
75
|
-
const scrollToStart = () => {
|
|
76
|
-
// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android
|
|
77
|
-
if (_element.Platform.isAndroid && isRTL) {
|
|
78
|
-
scrollViewRef.current.scrollToEnd();
|
|
79
|
-
} else {
|
|
80
|
-
scrollViewRef.current.scrollTo({
|
|
81
|
-
x: 0
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const onInsertBlock = (0, _element.useCallback)(blockType => () => {
|
|
86
|
-
insertBlock((0, _blocks.createBlock)(blockType), undefined, undefined, true, {
|
|
87
|
-
source: 'inserter_menu',
|
|
88
|
-
inserterMethod: 'quick-inserter'
|
|
89
|
-
});
|
|
90
|
-
}, [insertBlock]);
|
|
91
|
-
const renderMediaButtons = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ToolbarGroup, {
|
|
92
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
93
|
-
title: (0, _i18n.__)('Image'),
|
|
94
|
-
icon: _icons.media,
|
|
95
|
-
onClick: onInsertBlock('core/image'),
|
|
96
|
-
testID: "insert-image-button",
|
|
97
|
-
extraProps: {
|
|
98
|
-
hint: (0, _i18n.__)('Insert Image Block')
|
|
99
|
-
}
|
|
100
|
-
}, "imageButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
101
|
-
title: (0, _i18n.__)('Video'),
|
|
102
|
-
icon: _icons.video,
|
|
103
|
-
onClick: onInsertBlock('core/video'),
|
|
104
|
-
testID: "insert-video-button",
|
|
105
|
-
extraProps: {
|
|
106
|
-
hint: (0, _i18n.__)('Insert Video Block')
|
|
107
|
-
}
|
|
108
|
-
}, "videoButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
109
|
-
title: (0, _i18n.__)('Gallery'),
|
|
110
|
-
icon: _icons.gallery,
|
|
111
|
-
onClick: onInsertBlock('core/gallery'),
|
|
112
|
-
testID: "insert-gallery-button",
|
|
113
|
-
extraProps: {
|
|
114
|
-
hint: (0, _i18n.__)('Insert Gallery Block')
|
|
115
|
-
}
|
|
116
|
-
}, "galleryButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
117
|
-
title: (0, _i18n.__)('Audio'),
|
|
118
|
-
icon: _icons.audio,
|
|
119
|
-
onClick: onInsertBlock('core/audio'),
|
|
120
|
-
testID: "insert-audio-button",
|
|
121
|
-
extraProps: {
|
|
122
|
-
hint: (0, _i18n.__)('Insert Audio Block')
|
|
123
|
-
}
|
|
124
|
-
}, "audioButton")]
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
/* translators: accessibility text for the editor toolbar */
|
|
128
|
-
const toolbarAriaLabel = (0, _i18n.__)('Document tools');
|
|
129
|
-
const shadowColor = (0, _compose.usePreferredColorSchemeStyle)(_style.default['header-toolbar__keyboard-hide-shadow--light'], _style.default['header-toolbar__keyboard-hide-shadow--dark']);
|
|
130
|
-
const showKeyboardButtonStyles = [(0, _compose.usePreferredColorSchemeStyle)(_style.default['header-toolbar__keyboard-hide-container'], _style.default['header-toolbar__keyboard-hide-container--dark']), shadowStyle, {
|
|
131
|
-
shadowColor: _element.Platform.isAndroid ? _style.default['header-toolbar__keyboard-hide-shadow--solid'].color : shadowColor.color
|
|
132
|
-
}];
|
|
133
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
134
|
-
ref: anchorNodeRef,
|
|
135
|
-
testID: toolbarAriaLabel,
|
|
136
|
-
accessibilityLabel: toolbarAriaLabel,
|
|
137
|
-
style: containerStyle,
|
|
138
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
139
|
-
ref: scrollViewRef,
|
|
140
|
-
onContentSizeChange: scrollToStart,
|
|
141
|
-
horizontal: true,
|
|
142
|
-
showsHorizontalScrollIndicator: false,
|
|
143
|
-
keyboardShouldPersistTaps: "always",
|
|
144
|
-
alwaysBounceHorizontal: false,
|
|
145
|
-
contentContainerStyle: _style.default['header-toolbar__scrollable-content'],
|
|
146
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Inserter, {
|
|
147
|
-
disabled: !showInserter
|
|
148
|
-
}), noContentSelected && renderMediaButtons, /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockToolbar, {
|
|
149
|
-
anchorNodeRef: anchorNodeRef.current
|
|
150
|
-
})]
|
|
151
|
-
}), showKeyboardHideButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
|
|
152
|
-
passedStyle: showKeyboardButtonStyles,
|
|
153
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
154
|
-
title: (0, _i18n.__)('Hide keyboard'),
|
|
155
|
-
icon: _icons.keyboardClose,
|
|
156
|
-
onClick: onHideKeyboard,
|
|
157
|
-
extraProps: {
|
|
158
|
-
hint: (0, _i18n.__)('Tap to hide the keyboard')
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
})]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
165
|
-
const {
|
|
166
|
-
getBlockRootClientId,
|
|
167
|
-
getBlockSelectionEnd,
|
|
168
|
-
hasInserterItems,
|
|
169
|
-
hasSelectedBlock
|
|
170
|
-
} = select(_blockEditor.store);
|
|
171
|
-
const {
|
|
172
|
-
getEditorSettings
|
|
173
|
-
} = select(_editor.store);
|
|
174
|
-
const isAnyBlockSelected = hasSelectedBlock();
|
|
175
|
-
return {
|
|
176
|
-
hasRedo: select(_editor.store).hasEditorRedo(),
|
|
177
|
-
hasUndo: select(_editor.store).hasEditorUndo(),
|
|
178
|
-
// This setting (richEditingEnabled) should not live in the block editor's setting.
|
|
179
|
-
showInserter: select(_store.store).getEditorMode() === 'visual' && getEditorSettings().richEditingEnabled && hasInserterItems(getBlockRootClientId(getBlockSelectionEnd())),
|
|
180
|
-
isTextModeEnabled: select(_store.store).getEditorMode() === 'text',
|
|
181
|
-
isRTL: select(_blockEditor.store).getSettings().isRTL,
|
|
182
|
-
noContentSelected: !isAnyBlockSelected
|
|
183
|
-
};
|
|
184
|
-
}), (0, _data.withDispatch)(dispatch => {
|
|
185
|
-
const {
|
|
186
|
-
clearSelectedBlock,
|
|
187
|
-
insertBlock
|
|
188
|
-
} = dispatch(_blockEditor.store);
|
|
189
|
-
const {
|
|
190
|
-
togglePostTitleSelection
|
|
191
|
-
} = dispatch(_editor.store);
|
|
192
|
-
return {
|
|
193
|
-
redo: dispatch(_editor.store).redo,
|
|
194
|
-
undo: dispatch(_editor.store).undo,
|
|
195
|
-
onHideKeyboard() {
|
|
196
|
-
clearSelectedBlock();
|
|
197
|
-
togglePostTitleSelection(false);
|
|
198
|
-
},
|
|
199
|
-
insertBlock
|
|
200
|
-
};
|
|
201
|
-
}), (0, _viewport.withViewportMatch)({
|
|
202
|
-
isLargeViewport: 'medium'
|
|
203
|
-
})])(HeaderToolbar);
|
|
204
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_compose","_data","_viewport","_i18n","_blockEditor","_components","_icons","_editor","_blocks","_reactNativeBridge","_style","_interopRequireDefault","_store","_jsxRuntime","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","useRef","containerStyle","usePreferredColorSchemeStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","useEffect","onUndoSubscription","subscribeOnUndoPressed","onRedoSubscription","subscribeOnRedoPressed","remove","toggleUndoButton","toggleRedoButton","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","useCallback","blockType","createBlock","undefined","source","inserterMethod","renderMediaButtons","jsxs","ToolbarGroup","children","jsx","ToolbarButton","title","__","icon","imageIcon","onClick","testID","extraProps","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","View","ref","accessibilityLabel","style","ScrollView","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","Inserter","disabled","BlockToolbar","passedStyle","keyboardClose","_default","exports","default","compose","withSelect","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","withDispatch","dispatch","clearSelectedBlock","togglePostTitleSelection","withViewportMatch","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\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,KAAK,MAAM;IACnDvF,KAAK,EAAE2E,MAAM,CAAEK,kBAAiB,CAAC,CAACU,WAAW,CAAC,CAAC,CAAC1F,KAAK;IACrDC,iBAAiB,EAAE,CAAEkF;EACtB,CAAC;AACF,CAAE,CAAC,EACH,IAAAQ,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,kBAAkB;IAAE/F;EAAY,CAAC,GACxC8F,QAAQ,CAAEZ,kBAAiB,CAAC;EAC7B,MAAM;IAAEc;EAAyB,CAAC,GAAGF,QAAQ,CAAEV,aAAY,CAAC;EAE5D,OAAO;IACNxF,IAAI,EAAEkG,QAAQ,CAAEV,aAAY,CAAC,CAACxF,IAAI;IAClCC,IAAI,EAAEiG,QAAQ,CAAEV,aAAY,CAAC,CAACvF,IAAI;IAClCI,cAAcA,CAAA,EAAG;MAChB8F,kBAAkB,CAAC,CAAC;MACpBC,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDhG;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAiG,2BAAiB,EAAE;EAAEC,eAAe,EAAE;AAAS,CAAE,CAAC,CACjD,CAAC,CAAEzG,aAAc,CAAC","ignoreList":[]}
|
|
@@ -1,59 +0,0 @@
|
|
|
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 _reactNative = require("react-native");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
require("@wordpress/editor");
|
|
11
|
-
var _headerToolbar = _interopRequireDefault(require("./header-toolbar"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
/**
|
|
14
|
-
* External dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* WordPress dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Internal dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
class Header extends _element.Component {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.keyboardDidShow = this.keyboardDidShow.bind(this);
|
|
29
|
-
this.keyboardDidHide = this.keyboardDidHide.bind(this);
|
|
30
|
-
this.state = {
|
|
31
|
-
isKeyboardVisible: false
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
this.keyboardShowSubscription = _reactNative.Keyboard.addListener('keyboardDidShow', this.keyboardDidShow);
|
|
36
|
-
this.keyboardHideSubscription = _reactNative.Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);
|
|
37
|
-
}
|
|
38
|
-
componentWillUnmount() {
|
|
39
|
-
this.keyboardShowSubscription.remove();
|
|
40
|
-
this.keyboardHideSubscription.remove();
|
|
41
|
-
}
|
|
42
|
-
keyboardDidShow() {
|
|
43
|
-
this.setState({
|
|
44
|
-
isKeyboardVisible: true
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
keyboardDidHide() {
|
|
48
|
-
this.setState({
|
|
49
|
-
isKeyboardVisible: false
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_headerToolbar.default, {
|
|
54
|
-
showKeyboardHideButton: this.state.isKeyboardVisible
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = Header;
|
|
59
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_headerToolbar","_interopRequireDefault","_jsxRuntime","Header","Component","constructor","arguments","keyboardDidShow","bind","keyboardDidHide","state","isKeyboardVisible","componentDidMount","keyboardShowSubscription","Keyboard","addListener","keyboardHideSubscription","componentWillUnmount","remove","setState","render","jsx","default","showKeyboardHideButton","exports"],"sources":["@wordpress/edit-post/src/components/header/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Keyboard } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport HeaderToolbar from './header-toolbar';\n\nexport default class Header extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.keyboardDidShow = this.keyboardDidShow.bind( this );\n\t\tthis.keyboardDidHide = this.keyboardDidHide.bind( this );\n\n\t\tthis.state = {\n\t\t\tisKeyboardVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.keyboardShowSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidShow',\n\t\t\tthis.keyboardDidShow\n\t\t);\n\t\tthis.keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tthis.keyboardDidHide\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.keyboardShowSubscription.remove();\n\t\tthis.keyboardHideSubscription.remove();\n\t}\n\n\tkeyboardDidShow() {\n\t\tthis.setState( { isKeyboardVisible: true } );\n\t}\n\n\tkeyboardDidHide() {\n\t\tthis.setState( { isKeyboardVisible: false } );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<HeaderToolbar\n\t\t\t\tshowKeyboardHideButton={ this.state.isKeyboardVisible }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACAA,OAAA;AAKA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6C,IAAAI,WAAA,GAAAJ,OAAA;AAd7C;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMK,MAAM,SAASC,kBAAS,CAAC;EAC7CC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACC,IAAI,CAAE,IAAK,CAAC;IACxD,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACD,IAAI,CAAE,IAAK,CAAC;IAExD,IAAI,CAACE,KAAK,GAAG;MACZC,iBAAiB,EAAE;IACpB,CAAC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,wBAAwB,GAAGC,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACR,eACN,CAAC;IACD,IAAI,CAACS,wBAAwB,GAAGF,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACN,eACN,CAAC;EACF;EAEAQ,oBAAoBA,CAAA,EAAG;IACtB,IAAI,CAACJ,wBAAwB,CAACK,MAAM,CAAC,CAAC;IACtC,IAAI,CAACF,wBAAwB,CAACE,MAAM,CAAC,CAAC;EACvC;EAEAX,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACY,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAK,CAAE,CAAC;EAC7C;EAEAF,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACU,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAM,CAAE,CAAC;EAC9C;EAEAS,MAAMA,CAAA,EAAG;IACR,oBACC,IAAAlB,WAAA,CAAAmB,GAAA,EAACrB,cAAA,CAAAsB,OAAa;MACbC,sBAAsB,EAAG,IAAI,CAACb,KAAK,CAACC;IAAmB,CACvD,CAAC;EAEJ;AACD;AAACa,OAAA,CAAAF,OAAA,GAAAnB,MAAA","ignoreList":[]}
|
|
@@ -1,166 +0,0 @@
|
|
|
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 _reactNative = require("react-native");
|
|
9
|
-
var _reactNativeSafeArea = _interopRequireDefault(require("react-native-safe-area"));
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
13
|
-
var _compose = require("@wordpress/compose");
|
|
14
|
-
var _components = require("@wordpress/components");
|
|
15
|
-
var _editor = require("@wordpress/editor");
|
|
16
|
-
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
17
|
-
var _style = _interopRequireDefault(require("./style.scss"));
|
|
18
|
-
var _style2 = _interopRequireDefault(require("../header/header-toolbar/style.scss"));
|
|
19
|
-
var _header = _interopRequireDefault(require("../header"));
|
|
20
|
-
var _visualEditor = _interopRequireDefault(require("../visual-editor"));
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
/**
|
|
23
|
-
* External dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* WordPress dependencies
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Internal dependencies
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
class Layout extends _element.Component {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind(this);
|
|
38
|
-
this.onRootViewLayout = this.onRootViewLayout.bind(this);
|
|
39
|
-
this.state = {
|
|
40
|
-
rootViewHeight: 0,
|
|
41
|
-
safeAreaInsets: {
|
|
42
|
-
top: 0,
|
|
43
|
-
bottom: 0,
|
|
44
|
-
right: 0,
|
|
45
|
-
left: 0
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
_reactNativeSafeArea.default.getSafeAreaInsetsForRootView().then(this.onSafeAreaInsetsUpdate);
|
|
49
|
-
}
|
|
50
|
-
componentDidMount() {
|
|
51
|
-
this._isMounted = true;
|
|
52
|
-
this.safeAreaSubscription = _reactNativeSafeArea.default.addEventListener('safeAreaInsetsForRootViewDidChange', this.onSafeAreaInsetsUpdate);
|
|
53
|
-
}
|
|
54
|
-
componentWillUnmount() {
|
|
55
|
-
this.safeAreaSubscription?.remove();
|
|
56
|
-
this._isMounted = false;
|
|
57
|
-
}
|
|
58
|
-
onSafeAreaInsetsUpdate(result) {
|
|
59
|
-
const {
|
|
60
|
-
safeAreaInsets
|
|
61
|
-
} = result;
|
|
62
|
-
if (this._isMounted) {
|
|
63
|
-
this.setState({
|
|
64
|
-
safeAreaInsets
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
onRootViewLayout(event) {
|
|
69
|
-
if (this._isMounted) {
|
|
70
|
-
this.setHeightState(event);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
setHeightState(event) {
|
|
74
|
-
const {
|
|
75
|
-
height
|
|
76
|
-
} = event.nativeEvent.layout;
|
|
77
|
-
if (height !== this.state.rootViewHeight) {
|
|
78
|
-
this.setState({
|
|
79
|
-
rootViewHeight: height
|
|
80
|
-
}, _reactNativeBridge.sendNativeEditorDidLayout);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
renderHTML() {
|
|
84
|
-
const {
|
|
85
|
-
globalStyles
|
|
86
|
-
} = this.props;
|
|
87
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.HTMLTextInput, {
|
|
88
|
-
parentHeight: this.state.rootViewHeight,
|
|
89
|
-
style: globalStyles
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
renderVisual() {
|
|
93
|
-
const {
|
|
94
|
-
isReady
|
|
95
|
-
} = this.props;
|
|
96
|
-
if (!isReady) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_visualEditor.default, {
|
|
100
|
-
setTitleRef: this.props.setTitleRef
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
const {
|
|
105
|
-
getStylesFromColorScheme,
|
|
106
|
-
mode,
|
|
107
|
-
globalStyles
|
|
108
|
-
} = this.props;
|
|
109
|
-
const isHtmlView = mode === 'text';
|
|
110
|
-
|
|
111
|
-
// Add a margin view at the bottom for the header.
|
|
112
|
-
const marginBottom = _reactNative.Platform.OS === 'android' && !isHtmlView ? _style2.default['header-toolbar__container'].height : 0;
|
|
113
|
-
const containerStyles = getStylesFromColorScheme(_style.default.container, _style.default.containerDark);
|
|
114
|
-
const toolbarKeyboardAvoidingViewStyle = {
|
|
115
|
-
..._style.default.toolbarKeyboardAvoidingView,
|
|
116
|
-
left: this.state.safeAreaInsets.left,
|
|
117
|
-
right: this.state.safeAreaInsets.right,
|
|
118
|
-
bottom: this.state.safeAreaInsets.bottom,
|
|
119
|
-
backgroundColor: containerStyles.backgroundColor
|
|
120
|
-
};
|
|
121
|
-
const editorStyles = [getStylesFromColorScheme(_style.default.background, _style.default.backgroundDark), globalStyles?.background && {
|
|
122
|
-
backgroundColor: globalStyles.background
|
|
123
|
-
}];
|
|
124
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip.Slot, {
|
|
125
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.SafeAreaView, {
|
|
126
|
-
style: containerStyles,
|
|
127
|
-
onLayout: this.onRootViewLayout,
|
|
128
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.AutosaveMonitor, {
|
|
129
|
-
disableIntervalChecks: true
|
|
130
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.OfflineStatus, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
131
|
-
style: editorStyles,
|
|
132
|
-
children: [isHtmlView ? this.renderHTML() : this.renderVisual(), !isHtmlView && _reactNative.Platform.OS === 'android' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.FloatingToolbar, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoticeList, {})]
|
|
133
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
134
|
-
style: {
|
|
135
|
-
flex: 0,
|
|
136
|
-
flexBasis: marginBottom,
|
|
137
|
-
height: marginBottom
|
|
138
|
-
}
|
|
139
|
-
}), !isHtmlView && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.KeyboardAvoidingView, {
|
|
140
|
-
parentHeight: this.state.rootViewHeight,
|
|
141
|
-
style: toolbarKeyboardAvoidingViewStyle,
|
|
142
|
-
withAnimatedHeight: true,
|
|
143
|
-
children: [_reactNative.Platform.OS === 'ios' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
144
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableAutocompletionItemsSlot, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.FloatingToolbar, {})]
|
|
145
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BottomSheetSettings, {})]
|
|
146
|
-
}), _reactNative.Platform.OS === 'android' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableAutocompletionItemsSlot, {})]
|
|
147
|
-
})
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
152
|
-
const {
|
|
153
|
-
__unstableIsEditorReady: isEditorReady,
|
|
154
|
-
getEditorMode
|
|
155
|
-
} = select(_editor.store);
|
|
156
|
-
const {
|
|
157
|
-
getSettings
|
|
158
|
-
} = select(_blockEditor.store);
|
|
159
|
-
const globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles?.color;
|
|
160
|
-
return {
|
|
161
|
-
isReady: isEditorReady(),
|
|
162
|
-
mode: getEditorMode(),
|
|
163
|
-
globalStyles
|
|
164
|
-
};
|
|
165
|
-
}), _compose.withPreferredColorScheme])(Layout);
|
|
166
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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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eAC3B,IAAA9E,WAAA,CAAAmC,GAAA,EAAC5C,YAAA,CAAAgF,eAAe,IAAE,CAAC;UAAA,CAClB,CACF,eACD,IAAAvE,WAAA,CAAAmC,GAAA,EAACrC,OAAA,CAAA2C,OAAM,IAAE,CAAC,eACV,IAAAzC,WAAA,CAAAmC,GAAA,EAAC5C,YAAA,CAAAwF,mBAAmB,IAAE,CAAC;QAAA,CACF,CACtB,EACC/B,qBAAQ,CAACC,EAAE,KAAK,SAAS,iBAAI,IAAAjD,WAAA,CAAAmC,GAAA,EAAC1C,WAAA,CAAAqF,iCAAuB,IAAE,CAAC;MAAA,CAC7C;IAAC,CACF,CAAC;EAEjB;AACD;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAxC,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":[]}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _compose = require("@wordpress/compose");
|
|
12
|
-
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* External dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const Header = (0, _element.memo)(function EditorHeader({
|
|
24
|
-
editTitle,
|
|
25
|
-
setTitleRef,
|
|
26
|
-
title
|
|
27
|
-
}) {
|
|
28
|
-
const [wrapperStyles] = (0, _blockEditor.useEditorWrapperStyles)();
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
30
|
-
style: wrapperStyles,
|
|
31
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PostTitle, {
|
|
32
|
-
innerRef: setTitleRef,
|
|
33
|
-
title: title,
|
|
34
|
-
onUpdate: editTitle,
|
|
35
|
-
placeholder: (0, _i18n.__)('Add title'),
|
|
36
|
-
accessibilityLabel: "post-title"
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
}, (prevProps, nextProps) => prevProps.title === nextProps.title);
|
|
40
|
-
var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
41
|
-
const {
|
|
42
|
-
getEditedPostAttribute
|
|
43
|
-
} = select('core/editor');
|
|
44
|
-
return {
|
|
45
|
-
title: getEditedPostAttribute('title')
|
|
46
|
-
};
|
|
47
|
-
}), (0, _data.withDispatch)(dispatch => {
|
|
48
|
-
const {
|
|
49
|
-
editPost
|
|
50
|
-
} = dispatch('core/editor');
|
|
51
|
-
const {
|
|
52
|
-
clearSelectedBlock
|
|
53
|
-
} = dispatch(_blockEditor.store);
|
|
54
|
-
return {
|
|
55
|
-
clearSelectedBlock,
|
|
56
|
-
editTitle(title) {
|
|
57
|
-
editPost({
|
|
58
|
-
title
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}), _compose.withPreferredColorScheme])(Header);
|
|
63
|
-
//# sourceMappingURL=header.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_i18n","_data","_compose","_editor","_blockEditor","_jsxRuntime","Header","memo","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","useEditorWrapperStyles","jsx","View","style","children","PostTitle","innerRef","onUpdate","placeholder","__","accessibilityLabel","prevProps","nextProps","_default","exports","default","compose","withSelect","select","getEditedPostAttribute","withDispatch","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"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":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAGiC,IAAAO,WAAA,GAAAP,OAAA;AAhBjC;AACA;AACA;;AAGA;AACA;AACA;;AAWA,MAAMQ,MAAM,GAAG,IAAAC,aAAI,EAClB,SAASC,YAAYA,CAAE;EAAEC,SAAS;EAAEC,WAAW;EAAEC;AAAM,CAAC,EAAG;EAC1D,MAAM,CAAEC,aAAa,CAAE,GAAG,IAAAC,mCAAsB,EAAC,CAAC;EAClD,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,KAAK,EAAGJ,aAAe;IAAAK,QAAA,eAC5B,IAAAZ,WAAA,CAAAS,GAAA,EAACX,OAAA,CAAAe,SAAS;MACTC,QAAQ,EAAGT,WAAa;MACxBC,KAAK,EAAGA,KAAO;MACfS,QAAQ,EAAGX,SAAW;MACtBY,WAAW,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;MACjCC,kBAAkB,EAAC;IAAY,CAC/B;EAAC,CACG,CAAC;AAET,CAAC,EACD,CAAEC,SAAS,EAAEC,SAAS,KAAMD,SAAS,CAACb,KAAK,KAAKc,SAAS,CAACd,KAC3D,CAAC;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAE,aAAc,CAAC;EAE1D,OAAO;IACNpB,KAAK,EAAEqB,sBAAsB,CAAE,OAAQ;EACxC,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAGD,QAAQ,CAAE,aAAc,CAAC;EAE9C,MAAM;IAAEE;EAAmB,CAAC,GAAGF,QAAQ,CAAEG,kBAAiB,CAAC;EAE3D,OAAO;IACND,kBAAkB;IAClB3B,SAASA,CAAEE,KAAK,EAAG;MAClBwB,QAAQ,CAAE;QAAExB;MAAM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACH2B,iCAAwB,CACvB,CAAC,CAAEhC,MAAO,CAAC","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
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 _element = require("@wordpress/element");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
-
var _header = _interopRequireDefault(require("./header"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
class VisualEditor extends _element.Component {
|
|
21
|
-
constructor(props) {
|
|
22
|
-
super(props);
|
|
23
|
-
this.renderHeader = this.renderHeader.bind(this);
|
|
24
|
-
}
|
|
25
|
-
renderHeader() {
|
|
26
|
-
const {
|
|
27
|
-
setTitleRef
|
|
28
|
-
} = this.props;
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
|
|
30
|
-
setTitleRef: setTitleRef
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
const {
|
|
35
|
-
safeAreaBottomInset
|
|
36
|
-
} = this.props;
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
|
|
38
|
-
header: this.renderHeader,
|
|
39
|
-
safeAreaBottomInset: safeAreaBottomInset
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.default = VisualEditor;
|
|
44
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blockEditor","_header","_interopRequireDefault","_jsxRuntime","VisualEditor","Component","constructor","props","renderHeader","bind","setTitleRef","jsx","default","render","safeAreaBottomInset","BlockList","header","exports"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8B,IAAAI,WAAA,GAAAJ,OAAA;AAT9B;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMK,YAAY,SAASC,kBAAS,CAAC;EACnDC,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,oBAAO,IAAAJ,WAAA,CAAAQ,GAAA,EAACV,OAAA,CAAAW,OAAM;MAACF,WAAW,EAAGA;IAAa,CAAE,CAAC;EAC9C;EAEAG,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC;IAAoB,CAAC,GAAG,IAAI,CAACP,KAAK;IAE1C,oBACC,IAAAJ,WAAA,CAAAQ,GAAA,EAACX,YAAA,CAAAe,SAAS;MACTC,MAAM,EAAG,IAAI,CAACR,YAAc;MAC5BM,mBAAmB,EAAGA;IAAqB,CAC3C,CAAC;EAEJ;AACD;AAACG,OAAA,CAAAL,OAAA,GAAAR,YAAA","ignoreList":[]}
|