@wordpress/edit-post 7.26.0 → 7.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/header/index.js +2 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/layout/index.native.js +1 -3
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -2
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +11 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +11 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +31 -149
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +11 -5
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/editor.js +3 -26
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +4 -28
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +48 -8
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -1
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +11 -10
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +24 -6
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/index.js +2 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +1 -3
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +3 -2
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +10 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +10 -2
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +31 -150
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +7 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/editor.js +3 -26
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +5 -29
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +49 -9
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +11 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +16 -182
- package/build-style/style.css +16 -182
- package/package.json +32 -32
- package/src/components/header/index.js +2 -4
- package/src/components/header/style.scss +13 -4
- package/src/components/layout/index.native.js +1 -4
- package/src/components/meta-boxes/index.js +4 -2
- package/src/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -3
- package/src/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +9 -2
- package/src/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +9 -2
- package/src/components/preferences-modal/index.js +44 -267
- package/src/components/preferences-modal/meta-boxes-section.js +6 -2
- package/src/components/preferences-modal/{options/test → test}/__snapshots__/enable-custom-fields.js.snap +4 -4
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +18 -18
- package/src/components/sidebar/plugin-document-setting-panel/index.js +6 -2
- package/src/editor.js +55 -85
- package/src/editor.native.js +4 -33
- package/src/hooks/commands/use-common-commands.js +77 -7
- package/src/index.js +2 -2
- package/src/index.native.js +1 -1
- package/src/store/actions.js +14 -33
- package/src/store/selectors.js +52 -26
- package/src/store/test/actions.js +9 -9
- package/src/style.scss +0 -1
- package/build/components/block-manager/category.js +0 -105
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -127
- package/build/components/block-manager/index.js.map +0 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -36
- package/build/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -32
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build/components/preferences-modal/options/index.js +0 -42
- package/build/components/preferences-modal/options/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -96
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -27
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -118
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +0 -29
- package/build-module/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -24
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/preferences-modal/options/index.js +0 -6
- package/build-module/components/preferences-modal/options/index.js.map +0 -1
- package/src/components/block-manager/category.js +0 -94
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -158
- package/src/components/block-manager/style.scss +0 -82
- package/src/components/preferences-modal/options/enable-feature.js +0 -31
- package/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -23
- package/src/components/preferences-modal/options/index.js +0 -5
- /package/src/components/preferences-modal/{options/test → test}/enable-custom-fields.js +0 -0
|
@@ -6,179 +6,60 @@ import { createElement, Fragment } from "react";
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { useViewportMatch } from '@wordpress/compose';
|
|
8
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
|
+
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
11
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Internal dependencies
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
import { EnablePluginDocumentSettingPanelOption, EnablePublishSidebarOption, EnablePanelOption, EnableFeature } from './options';
|
|
16
|
+
import { unlock } from '../../lock-unlock';
|
|
19
17
|
import MetaBoxesSection from './meta-boxes-section';
|
|
20
|
-
import
|
|
21
|
-
|
|
18
|
+
import EnablePublishSidebarOption from './enable-publish-sidebar';
|
|
19
|
+
const {
|
|
20
|
+
PreferencesModalSection,
|
|
21
|
+
PreferenceToggleControl
|
|
22
|
+
} = unlock(preferencesPrivateApis);
|
|
23
|
+
const {
|
|
24
|
+
PreferencesModal
|
|
25
|
+
} = unlock(editorPrivateApis);
|
|
22
26
|
export const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
|
|
23
27
|
export default function EditPostPreferencesModal() {
|
|
24
28
|
const isLargeViewport = useViewportMatch('medium');
|
|
25
29
|
const {
|
|
26
30
|
closeModal
|
|
27
31
|
} = useDispatch(interfaceStore);
|
|
28
|
-
const [isModalActive, showBlockBreadcrumbsOption] = useSelect(select => {
|
|
29
|
-
const {
|
|
30
|
-
getEditorSettings
|
|
31
|
-
} = select(editorStore);
|
|
32
|
-
const {
|
|
33
|
-
getEditorMode
|
|
34
|
-
} = select(editPostStore);
|
|
35
|
-
const {
|
|
36
|
-
get
|
|
37
|
-
} = select(preferencesStore);
|
|
38
|
-
const modalActive = select(interfaceStore).isModalActive(PREFERENCES_MODAL_NAME);
|
|
39
|
-
const mode = getEditorMode();
|
|
40
|
-
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
41
|
-
const isDistractionFreeEnabled = get('core', 'distractionFree');
|
|
42
|
-
return [modalActive, !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled && mode === 'visual', isDistractionFreeEnabled];
|
|
43
|
-
}, [isLargeViewport]);
|
|
44
|
-
const {
|
|
45
|
-
closeGeneralSidebar
|
|
46
|
-
} = useDispatch(editPostStore);
|
|
47
|
-
const {
|
|
48
|
-
setIsListViewOpened,
|
|
49
|
-
setIsInserterOpened
|
|
50
|
-
} = useDispatch(editorStore);
|
|
51
32
|
const {
|
|
52
|
-
|
|
53
|
-
} =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
setPreference('core', 'distractionFree', false);
|
|
62
|
-
};
|
|
63
|
-
const sections = useMemo(() => [{
|
|
64
|
-
name: 'general',
|
|
65
|
-
tabLabel: __('General'),
|
|
66
|
-
content: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
|
|
33
|
+
isModalActive
|
|
34
|
+
} = useSelect(select => {
|
|
35
|
+
const modalActive = select(interfaceStore).isModalActive(PREFERENCES_MODAL_NAME);
|
|
36
|
+
return {
|
|
37
|
+
isModalActive: modalActive
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
const extraSections = {
|
|
41
|
+
general: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
|
|
67
42
|
title: __('Publishing')
|
|
68
43
|
}, createElement(EnablePublishSidebarOption, {
|
|
69
44
|
help: __('Review settings, such as visibility and tags.'),
|
|
70
45
|
label: __('Enable pre-publish checks')
|
|
71
|
-
})), createElement(
|
|
72
|
-
title: __('Interface')
|
|
73
|
-
}, createElement(EnableFeature, {
|
|
74
|
-
scope: "core",
|
|
75
|
-
featureName: "showListViewByDefault",
|
|
76
|
-
help: __('Opens the block list view sidebar by default.'),
|
|
77
|
-
label: __('Always open list view')
|
|
78
|
-
}), showBlockBreadcrumbsOption && createElement(EnableFeature, {
|
|
79
|
-
scope: "core",
|
|
80
|
-
featureName: "showBlockBreadcrumbs",
|
|
81
|
-
help: __('Display the block hierarchy trail at the bottom of the editor.'),
|
|
82
|
-
label: __('Show block breadcrumbs')
|
|
83
|
-
}), createElement(EnableFeature, {
|
|
84
|
-
scope: "core",
|
|
85
|
-
featureName: "allowRightClickOverrides",
|
|
86
|
-
help: __('Allows contextual list view menus via right-click, overriding browser defaults.'),
|
|
87
|
-
label: __('Allow right-click contextual menus')
|
|
88
|
-
})), createElement(PreferencesModalSection, {
|
|
89
|
-
title: __('Document settings'),
|
|
90
|
-
description: __('Select what settings are shown in the document panel.')
|
|
91
|
-
}, createElement(EnablePluginDocumentSettingPanelOption.Slot, null), createElement(PostTaxonomies, {
|
|
92
|
-
taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
|
|
93
|
-
label: taxonomy.labels.menu_name,
|
|
94
|
-
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
95
|
-
})
|
|
96
|
-
}), createElement(PostFeaturedImageCheck, null, createElement(EnablePanelOption, {
|
|
97
|
-
label: __('Featured image'),
|
|
98
|
-
panelName: "featured-image"
|
|
99
|
-
})), createElement(PostExcerptCheck, null, createElement(EnablePanelOption, {
|
|
100
|
-
label: __('Excerpt'),
|
|
101
|
-
panelName: "post-excerpt"
|
|
102
|
-
})), createElement(PostTypeSupportCheck, {
|
|
103
|
-
supportKeys: ['comments', 'trackbacks']
|
|
104
|
-
}, createElement(EnablePanelOption, {
|
|
105
|
-
label: __('Discussion'),
|
|
106
|
-
panelName: "discussion-panel"
|
|
107
|
-
})), createElement(PageAttributesCheck, null, createElement(EnablePanelOption, {
|
|
108
|
-
label: __('Page attributes'),
|
|
109
|
-
panelName: "page-attributes"
|
|
110
|
-
}))), createElement(MetaBoxesSection, {
|
|
46
|
+
})), createElement(MetaBoxesSection, {
|
|
111
47
|
title: __('Advanced')
|
|
112
|
-
}))
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
tabLabel: __('Appearance'),
|
|
116
|
-
content: createElement(PreferencesModalSection, {
|
|
117
|
-
title: __('Appearance'),
|
|
118
|
-
description: __('Customize the editor interface to suit your needs.')
|
|
119
|
-
}, createElement(EnableFeature, {
|
|
120
|
-
scope: "core",
|
|
121
|
-
featureName: "fixedToolbar",
|
|
122
|
-
onToggle: turnOffDistractionFree,
|
|
123
|
-
help: __('Access all block and document tools in a single place.'),
|
|
124
|
-
label: __('Top toolbar')
|
|
125
|
-
}), createElement(EnableFeature, {
|
|
126
|
-
scope: "core",
|
|
127
|
-
featureName: "distractionFree",
|
|
128
|
-
onToggle: toggleDistractionFree,
|
|
129
|
-
help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
130
|
-
label: __('Distraction free')
|
|
131
|
-
}), createElement(EnableFeature, {
|
|
132
|
-
scope: "core",
|
|
133
|
-
featureName: "focusMode",
|
|
134
|
-
help: __('Highlights the current block and fades other content.'),
|
|
135
|
-
label: __('Spotlight mode')
|
|
136
|
-
}), createElement(EnableFeature, {
|
|
48
|
+
})),
|
|
49
|
+
appearance: createElement(PreferenceToggleControl, {
|
|
50
|
+
scope: "core/edit-post",
|
|
137
51
|
featureName: "themeStyles",
|
|
138
52
|
help: __('Make the editor look like your theme.'),
|
|
139
53
|
label: __('Use theme styles')
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
name: 'accessibility',
|
|
143
|
-
tabLabel: __('Accessibility'),
|
|
144
|
-
content: createElement(Fragment, null, createElement(PreferencesModalSection, {
|
|
145
|
-
title: __('Navigation'),
|
|
146
|
-
description: __('Optimize the editing experience for enhanced control.')
|
|
147
|
-
}, createElement(EnableFeature, {
|
|
148
|
-
scope: "core",
|
|
149
|
-
featureName: "keepCaretInsideBlock",
|
|
150
|
-
help: __('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
|
|
151
|
-
label: __('Contain text cursor inside block')
|
|
152
|
-
})), createElement(PreferencesModalSection, {
|
|
153
|
-
title: __('Interface')
|
|
154
|
-
}, createElement(EnableFeature, {
|
|
155
|
-
scope: "core",
|
|
156
|
-
featureName: "showIconLabels",
|
|
157
|
-
label: __('Show button text labels'),
|
|
158
|
-
help: __('Show text instead of icons on buttons across the interface.')
|
|
159
|
-
})))
|
|
160
|
-
}, {
|
|
161
|
-
name: 'blocks',
|
|
162
|
-
tabLabel: __('Blocks'),
|
|
163
|
-
content: createElement(Fragment, null, createElement(PreferencesModalSection, {
|
|
164
|
-
title: __('Inserter')
|
|
165
|
-
}, createElement(EnableFeature, {
|
|
166
|
-
scope: "core",
|
|
167
|
-
featureName: "mostUsedBlocks",
|
|
168
|
-
help: __('Adds a category with the most frequently used blocks in the inserter.'),
|
|
169
|
-
label: __('Show most used blocks')
|
|
170
|
-
})), createElement(PreferencesModalSection, {
|
|
171
|
-
title: __('Manage block visibility'),
|
|
172
|
-
description: __("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
|
|
173
|
-
}, createElement(BlockManager, null)))
|
|
174
|
-
}], [isLargeViewport, showBlockBreadcrumbsOption]);
|
|
54
|
+
})
|
|
55
|
+
};
|
|
175
56
|
if (!isModalActive) {
|
|
176
57
|
return null;
|
|
177
58
|
}
|
|
178
59
|
return createElement(PreferencesModal, {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
})
|
|
60
|
+
extraSections: extraSections,
|
|
61
|
+
isActive: isModalActive,
|
|
62
|
+
onClose: closeModal
|
|
63
|
+
});
|
|
183
64
|
}
|
|
184
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","store","editorStore","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","interfaceStore","preferencesStore","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnablePanelOption","EnableFeature","MetaBoxesSection","editPostStore","BlockManager","PREFERENCES_MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","getEditorMode","get","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","help","label","scope","featureName","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","onToggle"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode } = select( editPostStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\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<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\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<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,sBAAsB,EACtBC,oBAAoB,EACpBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SACCC,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBJ,KAAK,IAAIK,cAAc,QACjB,sBAAsB;AAC7B,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;;AAEA,SACCC,sCAAsC,EACtCC,0BAA0B,EAC1BC,iBAAiB,EACjBC,aAAa,QACP,WAAW;AAClB,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,OAAO,MAAMC,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,M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3,"names":["__","useViewportMatch","useSelect","useDispatch","store","interfaceStore","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","EnablePublishSidebarOption","PreferencesModalSection","PreferenceToggleControl","PreferencesModal","PREFERENCES_MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","select","modalActive","extraSections","general","createElement","Fragment","title","help","label","appearance","scope","featureName","isActive","onClose"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\n\nconst { PreferencesModalSection, PreferenceToggleControl } = unlock(\n\tpreferencesPrivateApis\n);\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst { isModalActive } = useSelect( ( select ) => {\n\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\tPREFERENCES_MODAL_NAME\n\t\t);\n\t\treturn {\n\t\t\tisModalActive: modalActive,\n\t\t};\n\t}, [] );\n\n\tconst extraSections = {\n\t\tgeneral: (\n\t\t\t<>\n\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Publishing' ) }>\n\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t) }\n\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t</>\n\t\t),\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal\n\t\t\textraSections={ extraSections }\n\t\t\tisActive={ isModalActive }\n\t\t\tonClose={ closeModal }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;AAC9D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,0BAA0B,MAAM,0BAA0B;AAEjE,MAAM;EAAEC,uBAAuB;EAAEC;AAAwB,CAAC,GAAGJ,MAAM,CAClEF,sBACD,CAAC;AACD,MAAM;EAAEO;AAAiB,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAExD,OAAO,MAAMO,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAGhB,gBAAgB,CAAE,QAAS,CAAC;EACpD,MAAM;IAAEiB;EAAW,CAAC,GAAGf,WAAW,CAAEE,cAAe,CAAC;EACpD,MAAM;IAAEc;EAAc,CAAC,GAAGjB,SAAS,CAAIkB,MAAM,IAAM;IAClD,MAAMC,WAAW,GAAGD,MAAM,CAAEf,cAAe,CAAC,CAACc,aAAa,CACzDJ,sBACD,CAAC;IACD,OAAO;MACNI,aAAa,EAAEE;IAChB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,aAAa,GAAG;IACrBC,OAAO,EACNC,aAAA,CAAAC,QAAA,QACGR,eAAe,IAChBO,aAAA,CAACZ,uBAAuB;MAACc,KAAK,EAAG1B,EAAE,CAAE,YAAa;IAAG,GACpDwB,aAAA,CAACb,0BAA0B;MAC1BgB,IAAI,EAAG3B,EAAE,CACR,+CACD,CAAG;MACH4B,KAAK,EAAG5B,EAAE,CAAE,2BAA4B;IAAG,CAC3C,CACuB,CACzB,EACDwB,aAAA,CAACd,gBAAgB;MAACgB,KAAK,EAAG1B,EAAE,CAAE,UAAW;IAAG,CAAE,CAC7C,CACF;IACD6B,UAAU,EACTL,aAAA,CAACX,uBAAuB;MACvBiB,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBJ,IAAI,EAAG3B,EAAE,CAAE,uCAAwC,CAAG;MACtD4B,KAAK,EAAG5B,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,IAAK,CAAEmB,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACCK,aAAA,CAACV,gBAAgB;IAChBQ,aAAa,EAAGA,aAAe;IAC/BU,QAAQ,EAAGb,aAAe;IAC1Bc,OAAO,EAAGf;EAAY,CACtB,CAAC;AAEJ"}
|
|
@@ -5,13 +5,18 @@ import { createElement } from "react";
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { withSelect } from '@wordpress/data';
|
|
7
7
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
-
import {
|
|
8
|
+
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import EnableCustomFieldsOption from './enable-custom-fields';
|
|
14
|
+
import EnablePanelOption from './enable-panel';
|
|
14
15
|
import { store as editPostStore } from '../../store';
|
|
16
|
+
import { unlock } from '../../lock-unlock';
|
|
17
|
+
const {
|
|
18
|
+
PreferencesModalSection
|
|
19
|
+
} = unlock(preferencesPrivateApis);
|
|
15
20
|
export function MetaBoxesSection({
|
|
16
21
|
areCustomFieldsRegistered,
|
|
17
22
|
metaBoxes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","withSelect","store","editorStore","
|
|
1
|
+
{"version":3,"names":["__","withSelect","store","editorStore","privateApis","preferencesPrivateApis","EnableCustomFieldsOption","EnablePanelOption","editPostStore","unlock","PreferencesModalSection","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","createElement","label","map","title","key","panelName","select","getEditorSettings","getAllMetaBoxes","enableCustomFields","undefined"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,wBAAwB;AAC7D,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAwB,CAAC,GAAGD,MAAM,CAAEJ,sBAAuB,CAAC;AAEpE,OAAO,SAASM,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACT,uBAAuB;IAAA,GAAMI;EAAY,GACvCF,yBAAyB,IAC1BO,aAAA,CAACb,wBAAwB;IAACc,KAAK,EAAGpB,EAAE,CAAE,eAAgB;EAAG,CAAE,CAC3D,EACCe,mBAAmB,CAACM,GAAG,CAAE,CAAE;IAAEJ,EAAE;IAAEK;EAAM,CAAC,KACzCH,aAAA,CAACZ,iBAAiB;IACjBgB,GAAG,EAAGN,EAAI;IACVG,KAAK,EAAGE,KAAO;IACfE,SAAS,EAAI,YAAYP,EAAI;EAAG,CAChC,CACA,CACsB,CAAC;AAE5B;AAEA,eAAehB,UAAU,CAAIwB,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAkB,CAAC,GAAGD,MAAM,CAAEtB,WAAY,CAAC;EACnD,MAAM;IAAEwB;EAAgB,CAAC,GAAGF,MAAM,CAAEjB,aAAc,CAAC;EAEnD,OAAO;IACN;IACAI,yBAAyB,EACxBc,iBAAiB,CAAC,CAAC,CAACE,kBAAkB,KAAKC,SAAS;IACrDhB,SAAS,EAAEc,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAEhB,gBAAiB,CAAC"}
|
|
@@ -6,16 +6,19 @@ import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
|
6
6
|
import { usePluginContext } from '@wordpress/plugins';
|
|
7
7
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
8
|
import warning from '@wordpress/warning';
|
|
9
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
9
|
+
import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { unlock } from '../../../lock-unlock';
|
|
15
15
|
const {
|
|
16
16
|
Fill,
|
|
17
17
|
Slot
|
|
18
18
|
} = createSlotFill('PluginDocumentSettingPanel');
|
|
19
|
+
const {
|
|
20
|
+
EnablePluginDocumentSettingPanelOption
|
|
21
|
+
} = unlock(editorPrivateApis);
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Renders items below the Status & Availability panel in the Document Sidebar.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","store","editorStore","
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","store","editorStore","privateApis","editorPrivateApis","unlock","Fill","Slot","EnablePluginDocumentSettingPanelOption","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","SCRIPT_DEBUG","createElement","Fragment","label","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\nconst { EnablePluginDocumentSettingPanelOption } = unlock( editorPrivateApis );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SACCC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGZ,cAAc,CAAE,4BAA6B,CAAC;AACrE,MAAM;EAAEa;AAAuC,CAAC,GAAGH,MAAM,CAAED,iBAAkB,CAAC;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,CAACF,IAAI,GAAGA,IAAI;AAEtC,eAAeE,0BAA0B"}
|
package/build-module/editor.js
CHANGED
|
@@ -2,7 +2,6 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { store as blocksStore } from '@wordpress/blocks';
|
|
6
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
6
|
import { ErrorBoundary, PostLockedModal, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
7
|
import { useMemo } from '@wordpress/element';
|
|
@@ -38,15 +37,12 @@ function Editor({
|
|
|
38
37
|
hasInlineToolbar,
|
|
39
38
|
post,
|
|
40
39
|
preferredStyleVariations,
|
|
41
|
-
hiddenBlockTypes,
|
|
42
|
-
blockTypes,
|
|
43
40
|
template
|
|
44
41
|
} = useSelect(select => {
|
|
45
42
|
var _getPostType$viewable;
|
|
46
43
|
const {
|
|
47
44
|
isFeatureActive,
|
|
48
|
-
getEditedPostTemplate
|
|
49
|
-
getHiddenBlockTypes
|
|
45
|
+
getEditedPostTemplate
|
|
50
46
|
} = select(editPostStore);
|
|
51
47
|
const {
|
|
52
48
|
getEntityRecord,
|
|
@@ -57,9 +53,6 @@ function Editor({
|
|
|
57
53
|
const {
|
|
58
54
|
getEditorSettings
|
|
59
55
|
} = select(editorStore);
|
|
60
|
-
const {
|
|
61
|
-
getBlockTypes
|
|
62
|
-
} = select(blocksStore);
|
|
63
56
|
const isTemplate = ['wp_template', 'wp_template_part'].includes(currentPost.postType);
|
|
64
57
|
// Ideally the initializeEditor function should be called using the ID of the REST endpoint.
|
|
65
58
|
// to avoid the special case.
|
|
@@ -78,8 +71,6 @@ function Editor({
|
|
|
78
71
|
return {
|
|
79
72
|
hasInlineToolbar: isFeatureActive('inlineToolbar'),
|
|
80
73
|
preferredStyleVariations: select(preferencesStore).get('core/edit-post', 'preferredStyleVariations'),
|
|
81
|
-
hiddenBlockTypes: getHiddenBlockTypes(),
|
|
82
|
-
blockTypes: getBlockTypes(),
|
|
83
74
|
template: supportsTemplateMode && isViewable && canEditTemplate ? getEditedPostTemplate() : null,
|
|
84
75
|
post: postObject
|
|
85
76
|
};
|
|
@@ -96,24 +87,10 @@ function Editor({
|
|
|
96
87
|
value: preferredStyleVariations,
|
|
97
88
|
onChange: updatePreferredStyleVariations
|
|
98
89
|
},
|
|
99
|
-
hasInlineToolbar
|
|
100
|
-
// Keep a reference of the `allowedBlockTypes` from the server to handle use cases
|
|
101
|
-
// where we need to differentiate if a block is disabled by the user or some plugin.
|
|
102
|
-
defaultAllowedBlockTypes: settings.allowedBlockTypes
|
|
90
|
+
hasInlineToolbar
|
|
103
91
|
};
|
|
104
|
-
|
|
105
|
-
// Omit hidden block types if exists and non-empty.
|
|
106
|
-
if (hiddenBlockTypes.length > 0) {
|
|
107
|
-
// Defer to passed setting for `allowedBlockTypes` if provided as
|
|
108
|
-
// anything other than `true` (where `true` is equivalent to allow
|
|
109
|
-
// all block types).
|
|
110
|
-
const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
|
|
111
|
-
name
|
|
112
|
-
}) => name) : settings.allowedBlockTypes || [];
|
|
113
|
-
result.allowedBlockTypes = defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
|
|
114
|
-
}
|
|
115
92
|
return result;
|
|
116
|
-
}, [settings, hasInlineToolbar,
|
|
93
|
+
}, [settings, hasInlineToolbar, preferredStyleVariations, updatePreferredStyleVariations, getPostLinkProps, goBack]);
|
|
117
94
|
if (!post) {
|
|
118
95
|
return null;
|
|
119
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","ErrorBoundary","PostLockedModal","store","editorStore","privateApis","editorPrivateApis","useMemo","SlotFillProvider","coreStore","preferencesStore","CommandMenu","Layout","EditorInitialization","editPostStore","unlock","usePostHistory","ExperimentalEditorProvider","Editor","postId","initialPostId","postType","initialPostType","settings","initialEdits","props","currentPost","getPostLinkProps","goBack","hasInlineToolbar","post","preferredStyleVariations","template","select","_getPostType$viewable","isFeatureActive","getEditedPostTemplate","getEntityRecord","getPostType","getEntityRecords","canUser","getEditorSettings","isTemplate","includes","postObject","posts","wp_id","supportsTemplateMode","isViewable","viewable","canEditTemplate","get","updatePreferredStyleVariations","editorSettings","result","__experimentalPreferredStyleVariations","value","onChange","createElement","useSubRegistry","__unstableTemplate"],"sources":["@wordpress/edit-post/src/editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './lock-unlock';\nimport usePostHistory from './hooks/use-post-history';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\n\nfunction Editor( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n\t...props\n} ) {\n\tconst { currentPost, getPostLinkProps, goBack } = usePostHistory(\n\t\tinitialPostId,\n\t\tinitialPostType\n\t);\n\n\tconst { hasInlineToolbar, post, preferredStyleVariations, template } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { isFeatureActive, getEditedPostTemplate } =\n\t\t\t\t\tselect( editPostStore );\n\t\t\t\tconst {\n\t\t\t\t\tgetEntityRecord,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\tgetEntityRecords,\n\t\t\t\t\tcanUser,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\t\tconst isTemplate = [\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t].includes( currentPost.postType );\n\t\t\t\t// Ideally the initializeEditor function should be called using the ID of the REST endpoint.\n\t\t\t\t// to avoid the special case.\n\t\t\t\tlet postObject;\n\t\t\t\tif ( isTemplate ) {\n\t\t\t\t\tconst posts = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tcurrentPost.postType,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twp_id: currentPost.postId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tpostObject = posts?.[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tpostObject = getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tcurrentPost.postType,\n\t\t\t\t\t\tcurrentPost.postId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst supportsTemplateMode =\n\t\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\t\tconst isViewable =\n\t\t\t\t\tgetPostType( currentPost.postType )?.viewable ?? false;\n\t\t\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\t\t\t\treturn {\n\t\t\t\t\thasInlineToolbar: isFeatureActive( 'inlineToolbar' ),\n\t\t\t\t\tpreferredStyleVariations: select( preferencesStore ).get(\n\t\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t\t'preferredStyleVariations'\n\t\t\t\t\t),\n\t\t\t\t\ttemplate:\n\t\t\t\t\t\tsupportsTemplateMode && isViewable && canEditTemplate\n\t\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\tpost: postObject,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ currentPost.postType, currentPost.postId ]\n\t\t);\n\n\tconst { updatePreferredStyleVariations } = useDispatch( editPostStore );\n\n\tconst editorSettings = useMemo( () => {\n\t\tconst result = {\n\t\t\t...settings,\n\t\t\tgetPostLinkProps,\n\t\t\tgoBack,\n\t\t\t__experimentalPreferredStyleVariations: {\n\t\t\t\tvalue: preferredStyleVariations,\n\t\t\t\tonChange: updatePreferredStyleVariations,\n\t\t\t},\n\t\t\thasInlineToolbar,\n\t\t};\n\t\treturn result;\n\t}, [\n\t\tsettings,\n\t\thasInlineToolbar,\n\t\tpreferredStyleVariations,\n\t\tupdatePreferredStyleVariations,\n\t\tgetPostLinkProps,\n\t\tgoBack,\n\t] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ExperimentalEditorProvider\n\t\t\t\tsettings={ editorSettings }\n\t\t\t\tpost={ post }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t__unstableTemplate={ template }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t<EditorInitialization postId={ currentPost.postId } />\n\t\t\t\t\t<Layout />\n\t\t\t\t</ErrorBoundary>\n\t\t\t\t<PostLockedModal />\n\t\t\t</ExperimentalEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Editor;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASL,KAAK,IAAIM,SAAS,QAAQ,sBAAsB;AACzD,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,QAAQ,qBAAqB;;AAEjD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,oBAAoB,MAAM,oC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C3BvB,IAAI,EAAGA,IAAM;IACbN,YAAY,EAAGA,YAAc;IAC7BmC,cAAc,EAAG,KAAO;IACxBC,kBAAkB,EAAG5B,QAAU;IAAA,GAC1BP;EAAK,GAEViC,aAAA,CAACzD,aAAa,QACbyD,aAAA,CAAC/C,WAAW,MAAE,CAAC,EACf+C,aAAA,CAAC7C,oBAAoB;IAACM,MAAM,EAAGO,WAAW,CAACP;EAAQ,CAAE,CAAC,EACtDuC,aAAA,CAAC9C,MAAM,MAAE,CACK,CAAC,EAChB8C,aAAA,CAACxD,eAAe,MAAE,CACS,CACX,CAAC;AAErB;AAEA,eAAegB,MAAM"}
|
|
@@ -11,7 +11,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
|
11
11
|
*/
|
|
12
12
|
import { Component } from '@wordpress/element';
|
|
13
13
|
import { EditorProvider } from '@wordpress/editor';
|
|
14
|
-
import { parse, serialize
|
|
14
|
+
import { parse, serialize } from '@wordpress/blocks';
|
|
15
15
|
import { withDispatch, withSelect } from '@wordpress/data';
|
|
16
16
|
import { compose } from '@wordpress/compose';
|
|
17
17
|
import { subscribeSetFocusOnTitle, subscribeFeaturedImageIdNativeUpdated } from '@wordpress/react-native-bridge';
|
|
@@ -42,27 +42,11 @@ class Editor extends Component {
|
|
|
42
42
|
});
|
|
43
43
|
this.setTitleRef = this.setTitleRef.bind(this);
|
|
44
44
|
}
|
|
45
|
-
getEditorSettings(settings
|
|
45
|
+
getEditorSettings(settings) {
|
|
46
46
|
settings = {
|
|
47
47
|
...settings,
|
|
48
48
|
isRTL: I18nManager.isRTL
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
// Omit hidden block types if exists and non-empty.
|
|
52
|
-
if (hiddenBlockTypes.length > 0) {
|
|
53
|
-
if (settings.allowedBlockTypes === undefined) {
|
|
54
|
-
// If no specific flags for allowedBlockTypes are set, assume `true`
|
|
55
|
-
// meaning allow all block types.
|
|
56
|
-
settings.allowedBlockTypes = true;
|
|
57
|
-
}
|
|
58
|
-
// Defer to passed setting for `allowedBlockTypes` if provided as
|
|
59
|
-
// anything other than `true` (where `true` is equivalent to allow
|
|
60
|
-
// all block types).
|
|
61
|
-
const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
|
|
62
|
-
name
|
|
63
|
-
}) => name) : settings.allowedBlockTypes || [];
|
|
64
|
-
settings.allowedBlockTypes = defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
|
|
65
|
-
}
|
|
66
50
|
return settings;
|
|
67
51
|
}
|
|
68
52
|
componentDidMount() {
|
|
@@ -106,8 +90,6 @@ class Editor extends Component {
|
|
|
106
90
|
const {
|
|
107
91
|
settings,
|
|
108
92
|
initialEdits,
|
|
109
|
-
hiddenBlockTypes,
|
|
110
|
-
blockTypes,
|
|
111
93
|
post,
|
|
112
94
|
postId,
|
|
113
95
|
postType,
|
|
@@ -115,7 +97,7 @@ class Editor extends Component {
|
|
|
115
97
|
initialHtml,
|
|
116
98
|
...props
|
|
117
99
|
} = this.props;
|
|
118
|
-
const editorSettings = this.getEditorSettings(settings
|
|
100
|
+
const editorSettings = this.getEditorSettings(settings);
|
|
119
101
|
const normalizedPost = post || {
|
|
120
102
|
id: postId,
|
|
121
103
|
title: {
|
|
@@ -149,16 +131,10 @@ class Editor extends Component {
|
|
|
149
131
|
}
|
|
150
132
|
export default compose([withSelect(select => {
|
|
151
133
|
const {
|
|
152
|
-
getEditorMode
|
|
153
|
-
getHiddenBlockTypes
|
|
134
|
+
getEditorMode
|
|
154
135
|
} = select(editPostStore);
|
|
155
|
-
const {
|
|
156
|
-
getBlockTypes
|
|
157
|
-
} = select(blocksStore);
|
|
158
136
|
return {
|
|
159
|
-
mode: getEditorMode()
|
|
160
|
-
hiddenBlockTypes: getHiddenBlockTypes(),
|
|
161
|
-
blockTypes: getBlockTypes()
|
|
137
|
+
mode: getEditorMode()
|
|
162
138
|
};
|
|
163
139
|
}), withDispatch(dispatch => {
|
|
164
140
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","parse","serialize","store","blocksStore","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","editPostStore","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","hiddenBlockTypes","blockTypes","isRTL","length","allowedBlockTypes","undefined","defaultAllowedBlockTypes","map","name","filter","type","includes","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","status","meta","createElement","style","flex","useSubRegistry","select","getEditorMode","getHiddenBlockTypes","getBlockTypes","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 { EditorProvider } from '@wordpress/editor';\nimport { parse, serialize, store as blocksStore } 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';\nimport { store as editPostStore } from './store';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\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, hiddenBlockTypes, blockTypes ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\tif ( settings.allowedBlockTypes === undefined ) {\n\t\t\t\t// If no specific flags for allowedBlockTypes are set, assume `true`\n\t\t\t\t// meaning allow all block types.\n\t\t\t\tsettings.allowedBlockTypes = true;\n\t\t\t}\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tsettings.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\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\thiddenBlockTypes,\n\t\t\tblockTypes,\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(\n\t\t\tsettings,\n\t\t\thiddenBlockTypes,\n\t\t\tblockTypes\n\t\t);\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<Layout setTitleRef={ this.setTitleRef } />\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, getHiddenBlockTypes } = select( editPostStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\tblockTypes: getBlockTypes(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\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,MAAM,MAAM,QAAQ;AAC3B,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,KAAK,EAAEC,SAAS,EAAEC,KAAK,IAAIC,W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AepB,OAAO,CAAE,CACvBD,UAAU,CAAIqE,MAAM,IAAM;EACzB,MAAM;IAAEC,aAAa;IAAEC;EAAoB,CAAC,GAAGF,MAAM,CAAE9D,aAAc,CAAC;EACtE,MAAM;IAAEiE;EAAc,CAAC,GAAGH,MAAM,CAAEvE,WAAY,CAAC;EAE/C,OAAO;IACNmB,IAAI,EAAEqD,aAAa,CAAC,CAAC;IACrB9C,gBAAgB,EAAE+C,mBAAmB,CAAC,CAAC;IACvC9C,UAAU,EAAE+C,aAAa,CAAC;EAC3B,CAAC;AACF,CAAE,CAAC,EACHzE,YAAY,CAAI0E,QAAQ,IAAM;EAC7B,MAAM;IAAEvD;EAAiB,CAAC,GAAGuD,QAAQ,CAAElE,aAAc,CAAC;EACtD,MAAM;IAAE8B;EAAiB,CAAC,GAAGoC,QAAQ,CAAEpE,SAAU,CAAC;EAClD,OAAO;IACNa,gBAAgB;IAChBmB;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE7B,MAAO,CAAC"}
|
|
1
|
+
{"version":3,"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","parse","serialize","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","store","coreStore","Layout","editPostStore","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","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","createElement","style","flex","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 { EditorProvider } 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';\nimport { store as editPostStore } from './store';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\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<Layout setTitleRef={ this.setTitleRef } />\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( editPostStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\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,MAAM,MAAM,QAAQ;AAC3B,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACpD,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,wBAAwB,EACxBC,qCAAqC,QAC/B,gCAAgC;AACvC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;A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