@wordpress/edit-post 7.34.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/build/commands/use-commands.js +56 -0
- package/build/commands/use-commands.js.map +1 -0
- package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build/components/back-button/index.js +57 -0
- package/build/components/back-button/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +63 -62
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.native.js +2 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +50 -43
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/layout/index.js +134 -156
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +28 -21
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build/components/layout/use-padding-appender.js.map +1 -0
- package/build/components/layout/use-should-iframe.js +46 -0
- package/build/components/layout/use-should-iframe.js.map +1 -0
- package/build/components/meta-boxes/index.js +10 -9
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +13 -13
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/more-menu/index.js +49 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/preferences-modal/enable-custom-fields.js +23 -18
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +13 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/visual-editor/header.native.js +11 -10
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -3
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +50 -33
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +12 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +9 -9
- package/build/deprecated.js.map +1 -1
- package/build/editor.js +16 -11
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +18 -12
- package/build/editor.native.js.map +1 -1
- package/build/index.js +12 -13
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/commands/use-commands.js +49 -0
- package/build-module/commands/use-commands.js.map +1 -0
- package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build-module/components/back-button/index.js +49 -0
- package/build-module/components/back-button/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +64 -62
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -2
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +52 -43
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +139 -159
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +30 -21
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build-module/components/layout/use-padding-appender.js.map +1 -0
- package/build-module/components/layout/use-should-iframe.js +39 -0
- package/build-module/components/layout/use-should-iframe.js.map +1 -0
- package/build-module/components/meta-boxes/index.js +12 -9
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +13 -11
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +43 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +11 -10
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +3 -3
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +52 -33
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +14 -8
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +9 -9
- package/build-module/deprecated.js.map +1 -1
- package/build-module/editor.js +17 -11
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +18 -12
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +10 -7
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +31 -392
- package/build-style/style.css +31 -392
- package/package.json +33 -33
- package/src/commands/use-commands.js +48 -0
- package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +3 -3
- package/src/components/back-button/index.js +34 -0
- package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
- package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
- package/src/components/layout/index.js +151 -207
- package/src/components/layout/style.scss +9 -17
- package/src/components/{visual-editor → layout}/use-padding-appender.js +7 -1
- package/src/components/layout/use-should-iframe.js +40 -0
- package/src/components/meta-boxes/meta-boxes-area/index.js +4 -8
- package/src/components/{header/more-menu → more-menu}/index.js +2 -2
- package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +1 -1
- package/src/index.js +11 -6
- package/src/store/selectors.js +8 -5
- package/src/style.scss +3 -10
- package/src/test/__snapshots__/editor.native.js.snap +72 -0
- package/src/test/editor.native.js +77 -0
- package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build/components/header/index.js +0 -158
- package/build/components/header/index.js.map +0 -1
- package/build/components/header/main-dashboard-button/index.js +0 -33
- package/build/components/header/main-dashboard-button/index.js.map +0 -1
- package/build/components/header/more-menu/index.js +0 -43
- package/build/components/header/more-menu/index.js.map +0 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/sidebar/post-format/index.js +0 -21
- package/build/components/sidebar/post-format/index.js.map +0 -1
- package/build/components/sidebar/post-pending-status/index.js +0 -26
- package/build/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build/components/sidebar/post-slug/index.js +0 -21
- package/build/components/sidebar/post-slug/index.js.map +0 -1
- package/build/components/sidebar/post-status/index.js +0 -92
- package/build/components/sidebar/post-status/index.js.map +0 -1
- package/build/components/sidebar/post-sticky/index.js +0 -26
- package/build/components/sidebar/post-sticky/index.js.map +0 -1
- package/build/components/sidebar/post-trash/index.js +0 -16
- package/build/components/sidebar/post-trash/index.js.map +0 -1
- package/build/components/sidebar/post-visibility/index.js +0 -78
- package/build/components/sidebar/post-visibility/index.js.map +0 -1
- package/build/components/sidebar/settings-header/index.js +0 -53
- package/build/components/sidebar/settings-header/index.js.map +0 -1
- package/build/components/sidebar/settings-sidebar/index.js +0 -193
- package/build/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build/components/text-editor/index.js +0 -61
- package/build/components/text-editor/index.js.map +0 -1
- package/build/components/visual-editor/block-inspector-button.js +0 -55
- package/build/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build/components/visual-editor/index.js +0 -92
- package/build/components/visual-editor/index.js.map +0 -1
- package/build/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build/hooks/commands/use-common-commands.js +0 -119
- package/build/hooks/commands/use-common-commands.js.map +0 -1
- package/build/hooks/components/index.js +0 -11
- package/build/hooks/components/index.js.map +0 -1
- package/build/hooks/index.js +0 -5
- package/build/hooks/index.js.map +0 -1
- package/build/hooks/validate-multiple-use/index.js +0 -134
- package/build/hooks/validate-multiple-use/index.js.map +0 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build-module/components/header/index.js +0 -150
- package/build-module/components/header/index.js.map +0 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -26
- package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
- package/build-module/components/header/more-menu/index.js +0 -35
- package/build-module/components/header/more-menu/index.js.map +0 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/sidebar/post-format/index.js +0 -13
- package/build-module/components/sidebar/post-format/index.js.map +0 -1
- package/build-module/components/sidebar/post-pending-status/index.js +0 -18
- package/build-module/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-slug/index.js +0 -13
- package/build-module/components/sidebar/post-slug/index.js.map +0 -1
- package/build-module/components/sidebar/post-status/index.js +0 -84
- package/build-module/components/sidebar/post-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-sticky/index.js +0 -18
- package/build-module/components/sidebar/post-sticky/index.js.map +0 -1
- package/build-module/components/sidebar/post-trash/index.js +0 -9
- package/build-module/components/sidebar/post-trash/index.js.map +0 -1
- package/build-module/components/sidebar/post-visibility/index.js +0 -70
- package/build-module/components/sidebar/post-visibility/index.js.map +0 -1
- package/build-module/components/sidebar/settings-header/index.js +0 -46
- package/build-module/components/sidebar/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +0 -185
- package/build-module/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build-module/components/text-editor/index.js +0 -54
- package/build-module/components/text-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/block-inspector-button.js +0 -47
- package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/visual-editor/index.js +0 -84
- package/build-module/components/visual-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build-module/hooks/commands/use-common-commands.js +0 -112
- package/build-module/hooks/commands/use-common-commands.js.map +0 -1
- package/build-module/hooks/components/index.js +0 -8
- package/build-module/hooks/components/index.js.map +0 -1
- package/build-module/hooks/index.js +0 -6
- package/build-module/hooks/index.js.map +0 -1
- package/build-module/hooks/validate-multiple-use/index.js +0 -132
- package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
- package/src/components/header/index.js +0 -156
- package/src/components/header/main-dashboard-button/index.js +0 -28
- package/src/components/header/style.scss +0 -251
- package/src/components/sidebar/post-format/index.js +0 -20
- package/src/components/sidebar/post-format/style.scss +0 -5
- package/src/components/sidebar/post-pending-status/index.js +0 -27
- package/src/components/sidebar/post-slug/index.js +0 -17
- package/src/components/sidebar/post-slug/style.scss +0 -5
- package/src/components/sidebar/post-status/index.js +0 -128
- package/src/components/sidebar/post-sticky/index.js +0 -27
- package/src/components/sidebar/post-trash/index.js +0 -12
- package/src/components/sidebar/post-visibility/index.js +0 -88
- package/src/components/sidebar/post-visibility/style.scss +0 -5
- package/src/components/sidebar/settings-header/index.js +0 -49
- package/src/components/sidebar/settings-sidebar/index.js +0 -247
- package/src/components/sidebar/style.scss +0 -18
- package/src/components/text-editor/index.js +0 -63
- package/src/components/text-editor/style.scss +0 -71
- package/src/components/visual-editor/block-inspector-button.js +0 -59
- package/src/components/visual-editor/index.js +0 -101
- package/src/components/visual-editor/style.scss +0 -53
- package/src/hooks/commands/use-common-commands.js +0 -126
- package/src/hooks/components/index.js +0 -13
- package/src/hooks/index.js +0 -5
- package/src/hooks/validate-multiple-use/index.js +0 -163
- /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
- /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
package/src/store/selectors.js
CHANGED
|
@@ -609,10 +609,13 @@ export const getEditedPostTemplate = createRegistrySelector(
|
|
|
609
609
|
const defaultTemplateId = select( coreStore ).getDefaultTemplateId( {
|
|
610
610
|
slug: slugToCheck,
|
|
611
611
|
} );
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
612
|
+
|
|
613
|
+
return defaultTemplateId
|
|
614
|
+
? select( coreStore ).getEditedEntityRecord(
|
|
615
|
+
'postType',
|
|
616
|
+
'wp_template',
|
|
617
|
+
defaultTemplateId
|
|
618
|
+
)
|
|
619
|
+
: null;
|
|
617
620
|
}
|
|
618
621
|
);
|
package/src/style.scss
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
@import "./components/
|
|
2
|
-
@import "./components/header/fullscreen-mode-close/style.scss";
|
|
1
|
+
@import "./components/back-button/style.scss";
|
|
3
2
|
@import "./components/layout/style.scss";
|
|
4
3
|
@import "./components/meta-boxes/meta-boxes-area/style.scss";
|
|
5
|
-
@import "./components/sidebar/style.scss";
|
|
6
|
-
@import "./components/sidebar/post-format/style.scss";
|
|
7
|
-
@import "./components/sidebar/post-slug/style.scss";
|
|
8
|
-
@import "./components/sidebar/post-visibility/style.scss";
|
|
9
|
-
@import "./components/text-editor/style.scss";
|
|
10
|
-
@import "./components/visual-editor/style.scss";
|
|
11
4
|
@import "./components/welcome-guide/style.scss";
|
|
12
5
|
|
|
13
6
|
/**
|
|
@@ -39,8 +32,8 @@ body.js.block-editor-page {
|
|
|
39
32
|
}
|
|
40
33
|
|
|
41
34
|
// Target the editor UI excluding the visual editor contents, metaboxes and custom fields areas.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
35
|
+
.editor-header,
|
|
36
|
+
.editor-text-editor,
|
|
44
37
|
.editor-sidebar,
|
|
45
38
|
.editor-post-publish-panel {
|
|
46
39
|
@include reset;
|
|
@@ -19,3 +19,75 @@ exports[`Editor appends media correctly for allowed types and skips unsupported
|
|
|
19
19
|
<figure class="wp-block-video"><video controls src="file:///local-video-4.mp4"></video></figure>
|
|
20
20
|
<!-- /wp:video -->"
|
|
21
21
|
`;
|
|
22
|
+
|
|
23
|
+
exports[`Editor on content update parses markdown into blocks 1`] = `
|
|
24
|
+
"<!-- wp:paragraph -->
|
|
25
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing<br />elit.</p>
|
|
26
|
+
<!-- /wp:paragraph -->
|
|
27
|
+
|
|
28
|
+
<!-- wp:heading -->
|
|
29
|
+
<h2 class="wp-block-heading">Overview</h2>
|
|
30
|
+
<!-- /wp:heading -->
|
|
31
|
+
|
|
32
|
+
<!-- wp:list -->
|
|
33
|
+
<ul class="wp-block-list"><!-- wp:list-item -->
|
|
34
|
+
<li>Lorem ipsum dolor sit amet</li>
|
|
35
|
+
<!-- /wp:list-item -->
|
|
36
|
+
|
|
37
|
+
<!-- wp:list-item -->
|
|
38
|
+
<li>Consectetur adipiscing<br>elit</li>
|
|
39
|
+
<!-- /wp:list-item -->
|
|
40
|
+
|
|
41
|
+
<!-- wp:list-item -->
|
|
42
|
+
<li>Integer nec odio</li>
|
|
43
|
+
<!-- /wp:list-item --></ul>
|
|
44
|
+
<!-- /wp:list -->
|
|
45
|
+
|
|
46
|
+
<!-- wp:heading -->
|
|
47
|
+
<h2 class="wp-block-heading">Details</h2>
|
|
48
|
+
<!-- /wp:heading -->
|
|
49
|
+
|
|
50
|
+
<!-- wp:list {"ordered":true} -->
|
|
51
|
+
<ol class="wp-block-list"><!-- wp:list-item -->
|
|
52
|
+
<li>Sed cursus ante dapibus diam</li>
|
|
53
|
+
<!-- /wp:list-item -->
|
|
54
|
+
|
|
55
|
+
<!-- wp:list-item -->
|
|
56
|
+
<li>Nulla quis sem at nibh elementum imperdiet</li>
|
|
57
|
+
<!-- /wp:list-item -->
|
|
58
|
+
|
|
59
|
+
<!-- wp:list-item -->
|
|
60
|
+
<li>Duis sagittis ipsum <code>## Mixed Lists</code></li>
|
|
61
|
+
<!-- /wp:list-item --></ol>
|
|
62
|
+
<!-- /wp:list -->
|
|
63
|
+
|
|
64
|
+
<!-- wp:list -->
|
|
65
|
+
<ul class="wp-block-list"><!-- wp:list-item -->
|
|
66
|
+
<li>Key Points:</li>
|
|
67
|
+
<!-- /wp:list-item --></ul>
|
|
68
|
+
<!-- /wp:list -->
|
|
69
|
+
|
|
70
|
+
<!-- wp:list {"ordered":true} -->
|
|
71
|
+
<ol class="wp-block-list"><!-- wp:list-item -->
|
|
72
|
+
<li>Lorem ipsum dolor sit amet</li>
|
|
73
|
+
<!-- /wp:list-item -->
|
|
74
|
+
|
|
75
|
+
<!-- wp:list-item -->
|
|
76
|
+
<li><br>Consectetur adipiscing elit</li>
|
|
77
|
+
<!-- /wp:list-item -->
|
|
78
|
+
|
|
79
|
+
<!-- wp:list-item -->
|
|
80
|
+
<li>Integer nec odio</li>
|
|
81
|
+
<!-- /wp:list-item --></ol>
|
|
82
|
+
<!-- /wp:list -->
|
|
83
|
+
|
|
84
|
+
<!-- wp:list -->
|
|
85
|
+
<ul class="wp-block-list"><!-- wp:list-item -->
|
|
86
|
+
<li>Additional Info:<br>-<br>Sed cursus ante dapibus diam</li>
|
|
87
|
+
<!-- /wp:list-item -->
|
|
88
|
+
|
|
89
|
+
<!-- wp:list-item -->
|
|
90
|
+
<li>Nulla quis sem at nibh elementum imperdiet</li>
|
|
91
|
+
<!-- /wp:list-item --></ul>
|
|
92
|
+
<!-- /wp:list -->"
|
|
93
|
+
`;
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
fireEvent,
|
|
8
8
|
getBlock,
|
|
9
9
|
getEditorHtml,
|
|
10
|
+
getEditorTitle,
|
|
10
11
|
initializeEditor,
|
|
11
12
|
screen,
|
|
12
13
|
setupCoreBlocks,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
requestMediaImport,
|
|
21
22
|
subscribeMediaAppend,
|
|
22
23
|
subscribeParentToggleHTMLMode,
|
|
24
|
+
subscribeToContentUpdate,
|
|
23
25
|
} from '@wordpress/react-native-bridge';
|
|
24
26
|
|
|
25
27
|
setupCoreBlocks();
|
|
@@ -34,6 +36,11 @@ subscribeMediaAppend.mockImplementation( ( callback ) => {
|
|
|
34
36
|
mediaAppendCallback = callback;
|
|
35
37
|
} );
|
|
36
38
|
|
|
39
|
+
let onContentUpdateCallback;
|
|
40
|
+
subscribeToContentUpdate.mockImplementation( ( callback ) => {
|
|
41
|
+
onContentUpdateCallback = callback;
|
|
42
|
+
} );
|
|
43
|
+
|
|
37
44
|
const MEDIA = [
|
|
38
45
|
{
|
|
39
46
|
localId: 1,
|
|
@@ -149,4 +156,74 @@ describe( 'Editor', () => {
|
|
|
149
156
|
screen.queryAllByLabelText( 'Open Settings' );
|
|
150
157
|
expect( openBlockSettingsButton.length ).toBe( 0 );
|
|
151
158
|
} );
|
|
159
|
+
|
|
160
|
+
describe( 'on content update', () => {
|
|
161
|
+
const MARKDOWN = `# Sample Document\nLorem ipsum dolor sit amet, consectetur adipiscing
|
|
162
|
+
elit.\n## Overview\n- Lorem ipsum dolor sit amet\n- Consectetur adipiscing
|
|
163
|
+
elit\n- Integer nec odio\n## Details\n1. Sed cursus ante dapibus diam\n2.
|
|
164
|
+
Nulla quis sem at nibh elementum imperdiet\n3. Duis sagittis ipsum\n
|
|
165
|
+
## Mixed Lists\n- Key Points:\n 1. Lorem ipsum dolor sit amet\n 2.
|
|
166
|
+
Consectetur adipiscing elit\n 3. Integer nec odio\n- Additional Info:\n -
|
|
167
|
+
Sed cursus ante dapibus diam\n - Nulla quis sem at nibh elementum imperdiet\n`;
|
|
168
|
+
|
|
169
|
+
it( 'parses markdown into blocks', async () => {
|
|
170
|
+
// Arrange
|
|
171
|
+
await initializeEditor( {
|
|
172
|
+
initialTitle: null,
|
|
173
|
+
} );
|
|
174
|
+
|
|
175
|
+
// Act
|
|
176
|
+
act( () => {
|
|
177
|
+
onContentUpdateCallback( {
|
|
178
|
+
content: MARKDOWN,
|
|
179
|
+
} );
|
|
180
|
+
} );
|
|
181
|
+
|
|
182
|
+
// Assert
|
|
183
|
+
// Needed to for the "Processed HTML piece" log.
|
|
184
|
+
expect( console ).toHaveLogged();
|
|
185
|
+
expect( getEditorTitle() ).toBe( 'Sample Document' );
|
|
186
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
187
|
+
} );
|
|
188
|
+
|
|
189
|
+
it( 'parses a markdown heading into a title', async () => {
|
|
190
|
+
// Arrange
|
|
191
|
+
await initializeEditor( {
|
|
192
|
+
initialTitle: null,
|
|
193
|
+
} );
|
|
194
|
+
|
|
195
|
+
// Act
|
|
196
|
+
act( () => {
|
|
197
|
+
onContentUpdateCallback( {
|
|
198
|
+
content: `# Sample Document`,
|
|
199
|
+
} );
|
|
200
|
+
} );
|
|
201
|
+
|
|
202
|
+
// Assert
|
|
203
|
+
// Needed to for the "Processed HTML piece" log.
|
|
204
|
+
expect( console ).toHaveLogged();
|
|
205
|
+
expect( getEditorTitle() ).toBe( 'Sample Document' );
|
|
206
|
+
expect( getEditorHtml() ).toBe( '' );
|
|
207
|
+
} );
|
|
208
|
+
|
|
209
|
+
it( 'parses standard text into blocks', async () => {
|
|
210
|
+
// Arrange
|
|
211
|
+
await initializeEditor( {
|
|
212
|
+
initialTitle: null,
|
|
213
|
+
} );
|
|
214
|
+
|
|
215
|
+
// Act
|
|
216
|
+
act( () => {
|
|
217
|
+
onContentUpdateCallback( {
|
|
218
|
+
content: `Lorem ipsum dolor sit amet`,
|
|
219
|
+
} );
|
|
220
|
+
} );
|
|
221
|
+
|
|
222
|
+
// Assert
|
|
223
|
+
// Needed to for the "Processed HTML piece" log.
|
|
224
|
+
expect( console ).toHaveLogged();
|
|
225
|
+
expect( getEditorTitle() ).toBe( 'Lorem ipsum dolor sit amet' );
|
|
226
|
+
expect( getEditorHtml() ).toBe( '' );
|
|
227
|
+
} );
|
|
228
|
+
} );
|
|
152
229
|
} );
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","_react","createElement","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","classnames","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAGA,SAASU,mBAAmBA,CAAE;EAAEC,WAAW;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAY,CAAC,EAAG;EAAA,IAAAC,qBAAA;EACxE,MAAM;IAA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AAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB","ignoreList":[]}
|
|
@@ -1,158 +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 _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _compose = require("@wordpress/compose");
|
|
13
|
-
var _components = require("@wordpress/components");
|
|
14
|
-
var _preferences = require("@wordpress/preferences");
|
|
15
|
-
var _element = require("@wordpress/element");
|
|
16
|
-
var _fullscreenModeClose = _interopRequireDefault(require("./fullscreen-mode-close"));
|
|
17
|
-
var _moreMenu = _interopRequireDefault(require("./more-menu"));
|
|
18
|
-
var _mainDashboardButton = _interopRequireDefault(require("./main-dashboard-button"));
|
|
19
|
-
var _store = require("../../store");
|
|
20
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
21
|
-
/**
|
|
22
|
-
* External dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* WordPress dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Internal dependencies
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
CollapsableBlockToolbar,
|
|
35
|
-
DocumentTools,
|
|
36
|
-
PostViewLink,
|
|
37
|
-
PreviewDropdown,
|
|
38
|
-
PinnedItems,
|
|
39
|
-
MoreMenu,
|
|
40
|
-
PostPublishButtonOrToggle
|
|
41
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
42
|
-
const slideY = {
|
|
43
|
-
hidden: {
|
|
44
|
-
y: '-50px'
|
|
45
|
-
},
|
|
46
|
-
distractionFreeInactive: {
|
|
47
|
-
y: 0
|
|
48
|
-
},
|
|
49
|
-
hover: {
|
|
50
|
-
y: 0,
|
|
51
|
-
transition: {
|
|
52
|
-
type: 'tween',
|
|
53
|
-
delay: 0.2
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const slideX = {
|
|
58
|
-
hidden: {
|
|
59
|
-
x: '-100%'
|
|
60
|
-
},
|
|
61
|
-
distractionFreeInactive: {
|
|
62
|
-
x: 0
|
|
63
|
-
},
|
|
64
|
-
hover: {
|
|
65
|
-
x: 0,
|
|
66
|
-
transition: {
|
|
67
|
-
type: 'tween',
|
|
68
|
-
delay: 0.2
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
function Header({
|
|
73
|
-
setEntitiesSavedStatesCallback,
|
|
74
|
-
initialPost
|
|
75
|
-
}) {
|
|
76
|
-
const isWideViewport = (0, _compose.useViewportMatch)('large');
|
|
77
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
78
|
-
const {
|
|
79
|
-
isTextEditor,
|
|
80
|
-
hasActiveMetaboxes,
|
|
81
|
-
isPublishSidebarOpened,
|
|
82
|
-
showIconLabels,
|
|
83
|
-
hasHistory,
|
|
84
|
-
hasFixedToolbar
|
|
85
|
-
} = (0, _data.useSelect)(select => {
|
|
86
|
-
const {
|
|
87
|
-
get: getPreference
|
|
88
|
-
} = select(_preferences.store);
|
|
89
|
-
const {
|
|
90
|
-
getEditorMode
|
|
91
|
-
} = select(_editor.store);
|
|
92
|
-
return {
|
|
93
|
-
isTextEditor: getEditorMode() === 'text',
|
|
94
|
-
hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
|
|
95
|
-
hasHistory: !!select(_editor.store).getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
96
|
-
isPublishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
|
|
97
|
-
showIconLabels: getPreference('core', 'showIconLabels'),
|
|
98
|
-
hasFixedToolbar: getPreference('core', 'fixedToolbar')
|
|
99
|
-
};
|
|
100
|
-
}, []);
|
|
101
|
-
const hasTopToolbar = isLargeViewport && hasFixedToolbar;
|
|
102
|
-
const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0, _element.useState)(true);
|
|
103
|
-
return (0, _react.createElement)("div", {
|
|
104
|
-
className: "edit-post-header"
|
|
105
|
-
}, (0, _react.createElement)(_mainDashboardButton.default.Slot, null, (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
106
|
-
variants: slideX,
|
|
107
|
-
transition: {
|
|
108
|
-
type: 'tween',
|
|
109
|
-
delay: 0.8
|
|
110
|
-
}
|
|
111
|
-
}, (0, _react.createElement)(_fullscreenModeClose.default, {
|
|
112
|
-
showTooltip: true,
|
|
113
|
-
initialPost: initialPost
|
|
114
|
-
}))), (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
115
|
-
variants: slideY,
|
|
116
|
-
transition: {
|
|
117
|
-
type: 'tween',
|
|
118
|
-
delay: 0.8
|
|
119
|
-
},
|
|
120
|
-
className: "edit-post-header__toolbar"
|
|
121
|
-
}, (0, _react.createElement)(DocumentTools, {
|
|
122
|
-
disableBlockTools: isTextEditor
|
|
123
|
-
}), hasTopToolbar && (0, _react.createElement)(CollapsableBlockToolbar, {
|
|
124
|
-
isCollapsed: isBlockToolsCollapsed,
|
|
125
|
-
onToggle: setIsBlockToolsCollapsed
|
|
126
|
-
}), (0, _react.createElement)("div", {
|
|
127
|
-
className: (0, _classnames.default)('edit-post-header__center', {
|
|
128
|
-
'is-collapsed': hasHistory && !isBlockToolsCollapsed && hasTopToolbar
|
|
129
|
-
})
|
|
130
|
-
}, hasHistory && (0, _react.createElement)(_editor.DocumentBar, null))), (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
131
|
-
variants: slideY,
|
|
132
|
-
transition: {
|
|
133
|
-
type: 'tween',
|
|
134
|
-
delay: 0.8
|
|
135
|
-
},
|
|
136
|
-
className: "edit-post-header__settings"
|
|
137
|
-
}, !isPublishSidebarOpened &&
|
|
138
|
-
// This button isn't completely hidden by the publish sidebar.
|
|
139
|
-
// We can't hide the whole toolbar when the publish sidebar is open because
|
|
140
|
-
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
|
|
141
|
-
// We track that DOM node to return focus to the PostPublishButtonOrToggle
|
|
142
|
-
// when the publish sidebar has been closed.
|
|
143
|
-
(0, _react.createElement)(_editor.PostSavedState, {
|
|
144
|
-
forceIsDirty: hasActiveMetaboxes
|
|
145
|
-
}), (0, _react.createElement)(PreviewDropdown, {
|
|
146
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
147
|
-
}), (0, _react.createElement)(_editor.PostPreviewButton, {
|
|
148
|
-
className: "edit-post-header__post-preview-button",
|
|
149
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
150
|
-
}), (0, _react.createElement)(PostViewLink, null), (0, _react.createElement)(PostPublishButtonOrToggle, {
|
|
151
|
-
forceIsDirty: hasActiveMetaboxes,
|
|
152
|
-
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
|
|
153
|
-
}), (isWideViewport || !showIconLabels) && (0, _react.createElement)(PinnedItems.Slot, {
|
|
154
|
-
scope: "core"
|
|
155
|
-
}), (0, _react.createElement)(MoreMenu, null), (0, _react.createElement)(_moreMenu.default, null)));
|
|
156
|
-
}
|
|
157
|
-
var _default = exports.default = Header;
|
|
158
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_editor","_data","_compose","_components","_preferences","_element","_fullscreenModeClose","_moreMenu","_mainDashboardButton","_store","_lockUnlock","CollapsableBlockToolbar","DocumentTools","PostViewLink","PreviewDropdown","PinnedItems","MoreMenu","PostPublishButtonOrToggle","unlock","editorPrivateApis","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","initialPost","isWideViewport","useViewportMatch","isLargeViewport","isTextEditor","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","hasHistory","hasFixedToolbar","useSelect","select","get","getPreference","preferencesStore","getEditorMode","editorStore","editPostStore","hasMetaBoxes","getEditorSettings","onNavigateToPreviousEntityRecord","hasTopToolbar","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","_react","createElement","className","default","Slot","__unstableMotion","div","variants","showTooltip","disableBlockTools","isCollapsed","onToggle","classnames","DocumentBar","PostSavedState","forceIsDirty","forceIsAutosaveable","PostPreviewButton","scope","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDocumentBar,\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport PostEditorMoreMenu from './more-menu';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tCollapsableBlockToolbar,\n\tDocumentTools,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPinnedItems,\n\tMoreMenu,\n\tPostPublishButtonOrToggle,\n} = unlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback, initialPost } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tisTextEditor,\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t\thasFixedToolbar,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory:\n\t\t\t\t!! select( editorStore ).getEditorSettings()\n\t\t\t\t\t.onNavigateToPreviousEntityRecord,\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\n\tconst hasTopToolbar = isLargeViewport && hasFixedToolbar;\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasTopToolbar && (\n\t\t\t\t\t<CollapsableBlockToolbar\n\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\thasHistory &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasTopToolbar,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasHistory && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconL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,KAAK,EAAE;IAAI,CAAG;IAC5CgC,SAAS,EAAC;EAA4B,GAEpC,CAAErB,sBAAsB;EACzB;EACA;EACA;EACA;EACA;EACA,IAAAmB,MAAA,CAAAC,aAAA,EAAC1D,OAAA,CAAAuE,cAAc;IAACC,YAAY,EAAGnC;EAAoB,CAAE,CACrD,EACD,IAAAoB,MAAA,CAAAC,aAAA,EAAC5C,eAAe;IAAC2D,mBAAmB,EAAGpC;EAAoB,CAAE,CAAC,EAC9D,IAAAoB,MAAA,CAAAC,aAAA,EAAC1D,OAAA,CAAA0E,iBAAiB;IACjBf,SAAS,EAAC,uCAAuC;IACjDc,mBAAmB,EAAGpC;EAAoB,CAC1C,CAAC,EACF,IAAAoB,MAAA,CAAAC,aAAA,EAAC7C,YAAY,MAAE,CAAC,EAChB,IAAA4C,MAAA,CAAAC,aAAA,EAACzC,yBAAyB;IACzBuD,YAAY,EAAGnC,kBAAoB;IACnCN,8BAA8B,EAC7BA;EACA,CACD,CAAC,EACA,CAAEE,cAAc,IAAI,CAAEM,cAAc,KACrC,IAAAkB,MAAA,CAAAC,aAAA,EAAC3C,WAAW,CAAC8C,IAAI;IAACc,KAAK,EAAC;EAAM,CAAE,CAChC,EACD,IAAAlB,MAAA,CAAAC,aAAA,EAAC1C,QAAQ,MAAE,CAAC,EACZ,IAAAyC,MAAA,CAAAC,aAAA,EAACnD,SAAA,CAAAqD,OAAkB,MAAE,CACV,CACR,CAAC;AAER;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEc9B,MAAM","ignoreList":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const slotName = '__experimentalMainDashboardButton';
|
|
14
|
-
const {
|
|
15
|
-
Fill,
|
|
16
|
-
Slot: MainDashboardButtonSlot
|
|
17
|
-
} = (0, _components.createSlotFill)(slotName);
|
|
18
|
-
const MainDashboardButton = Fill;
|
|
19
|
-
const Slot = ({
|
|
20
|
-
children
|
|
21
|
-
}) => {
|
|
22
|
-
const fills = (0, _components.__experimentalUseSlotFills)(slotName);
|
|
23
|
-
const hasFills = Boolean(fills && fills.length);
|
|
24
|
-
if (!hasFills) {
|
|
25
|
-
return children;
|
|
26
|
-
}
|
|
27
|
-
return (0, _react.createElement)(MainDashboardButtonSlot, {
|
|
28
|
-
bubblesVirtually: true
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
MainDashboardButton.Slot = Slot;
|
|
32
|
-
var _default = exports.default = MainDashboardButton;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","slotName","Fill","Slot","MainDashboardButtonSlot","createSlotFill","MainDashboardButton","children","fills","useSlotFills","hasFills","Boolean","length","_react","createElement","bubblesVirtually","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlotFills as useSlotFills,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst fills = useSlotFills( slotName );\n\tconst hasFills = Boolean( fills && fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAMA,MAAMC,QAAQ,GAAG,mCAAmC;AAEpD,MAAM;EAAEC,IAAI;EAAEC,IAAI,EAAEC;AAAwB,CAAC,GAAG,IAAAC,0BAAc,EAAEJ,QAAS,CAAC;AAE1E,MAAMK,mBAAmB,GAAGJ,IAAI;AAEhC,MAAMC,IAAI,GAAGA,CAAE;EAAEI;AAAS,CAAC,KAAM;EAChC,MAAMC,KAAK,GAAG,IAAAC,sCAAY,EAAER,QAAS,CAAC;EACtC,MAAMS,QAAQ,GAAGC,OAAO,CAAEH,KAAK,IAAIA,KAAK,CAACI,MAAO,CAAC;EAEjD,IAAK,CAAEF,QAAQ,EAAG;IACjB,OAAOH,QAAQ;EAChB;EAEA,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACV,uBAAuB;IAACW,gBAAgB;EAAA,CAAE,CAAC;AACpD,CAAC;AAEDT,mBAAmB,CAACH,IAAI,GAAGA,IAAI;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEjBZ,mBAAmB","ignoreList":[]}
|
|
@@ -1,43 +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 _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _compose = require("@wordpress/compose");
|
|
11
|
-
var _editor = require("@wordpress/editor");
|
|
12
|
-
var _preferences = require("@wordpress/preferences");
|
|
13
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
14
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
15
|
-
var _managePatternsMenuItem = _interopRequireDefault(require("./manage-patterns-menu-item"));
|
|
16
|
-
var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
|
|
17
|
-
var _preferencesModal = _interopRequireDefault(require("../../preferences-modal"));
|
|
18
|
-
/**
|
|
19
|
-
* WordPress dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
ToolsMoreMenuGroup,
|
|
28
|
-
ViewMoreMenuGroup
|
|
29
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
30
|
-
const MoreMenu = () => {
|
|
31
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('large');
|
|
32
|
-
return (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(ViewMoreMenuGroup, null, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
33
|
-
scope: "core/edit-post",
|
|
34
|
-
name: "fullscreenMode",
|
|
35
|
-
label: (0, _i18n.__)('Fullscreen mode'),
|
|
36
|
-
info: (0, _i18n.__)('Show and hide the admin user interface'),
|
|
37
|
-
messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
|
|
38
|
-
messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
|
|
39
|
-
shortcut: _keycodes.displayShortcut.secondary('f')
|
|
40
|
-
})), (0, _react.createElement)(ToolsMoreMenuGroup, null, (0, _react.createElement)(_managePatternsMenuItem.default, null), (0, _react.createElement)(_welcomeGuideMenuItem.default, null)), (0, _react.createElement)(_preferencesModal.default, null));
|
|
41
|
-
};
|
|
42
|
-
var _default = exports.default = MoreMenu;
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_editor","_preferences","_keycodes","_lockUnlock","_managePatternsMenuItem","_interopRequireDefault","_welcomeGuideMenuItem","_preferencesModal","ToolsMoreMenuGroup","ViewMoreMenuGroup","unlock","editorPrivateApis","MoreMenu","isLargeViewport","useViewportMatch","_react","createElement","Fragment","PreferenceToggleMenuItem","scope","name","label","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;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AAA,CAAAC,aAAA,EAACV,qBAAA,CAAAuB,OAAoB,MAAE,CACJ,CAAC,EACrB,IAAAd,MAAA,CAAAC,aAAA,EAACT,iBAAA,CAAAsB,OAAwB,MAAE,CAC1B,CAAC;AAEL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEajB,QAAQ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_coreData","_data","_i18n","_url","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA,SAASK,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAON,OAAO,CAAE,MAAM,EAAE,WAAY,CAAC,GAAGK,WAAW,GAAGH,UAAU;EACjE,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAK,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAmB,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGd;EAAK,GACnC,IAAAe,QAAE,EAAE,iBAAkB,CACf,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnB,sBAAsB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/components/header/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PostFormat = PostFormat;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
function PostFormat() {
|
|
16
|
-
return (0, _react.createElement)(_editor.PostFormatCheck, null, (0, _react.createElement)(_components.PanelRow, {
|
|
17
|
-
className: "edit-post-post-format"
|
|
18
|
-
}, (0, _react.createElement)(_editor.PostFormat, null)));
|
|
19
|
-
}
|
|
20
|
-
var _default = exports.default = PostFormat;
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","PostFormat","_react","createElement","PostFormatCheck","PanelRow","className","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport {\n\tPostFormat as PostFormatForm,\n\tPostFormatCheck,\n} from '@wordpress/editor';\n\nexport function PostFormat() {\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<PanelRow className=\"edit-post-post-format\">\n\t\t\t\t<PostFormatForm />\n\t\t\t</PanelRow>\n\t\t</PostFormatCheck>\n\t);\n}\n\nexport default PostFormat;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAOO,SAASE,UAAUA,CAAA,EAAG;EAC5B,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAI,eAAe,QACf,IAAAF,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAO,QAAQ;IAACC,SAAS,EAAC;EAAuB,GAC1C,IAAAJ,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAC,UAAc,MAAE,CACR,CACM,CAAC;AAEpB;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcR,UAAU","ignoreList":[]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PostPendingStatus = PostPendingStatus;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _editor = require("@wordpress/editor");
|
|
10
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
PostPanelRow
|
|
21
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
22
|
-
function PostPendingStatus() {
|
|
23
|
-
return (0, _react.createElement)(_editor.PostPendingStatusCheck, null, (0, _react.createElement)(PostPanelRow, null, (0, _react.createElement)(_editor.PostPendingStatus, null)));
|
|
24
|
-
}
|
|
25
|
-
var _default = exports.default = PostPendingStatus;
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostPendingStatus","_react","createElement","PostPendingStatusCheck","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostPendingStatus as PostPendingStatusForm,\n\tPostPendingStatusCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostPendingStatus() {\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostPendingStatusForm />\n\t\t\t</PostPanelRow>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,sBAAsB,QACtB,IAAAF,MAAA,CAAAC,aAAA,EAACL,YAAY,QACZ,IAAAI,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAM,iBAAqB,MAAE,CACX,CACS,CAAC;AAE3B;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcN,iBAAiB","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PostSlug = PostSlug;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
function PostSlug() {
|
|
16
|
-
return (0, _react.createElement)(_editor.PostSlugCheck, null, (0, _react.createElement)(_components.PanelRow, {
|
|
17
|
-
className: "edit-post-post-slug"
|
|
18
|
-
}, (0, _react.createElement)(_editor.PostSlug, null)));
|
|
19
|
-
}
|
|
20
|
-
var _default = exports.default = PostSlug;
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","PostSlug","_react","createElement","PostSlugCheck","PanelRow","className","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';\n\nexport function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PanelRow className=\"edit-post-post-slug\">\n\t\t\t\t<PostSlugForm />\n\t\t\t</PanelRow>\n\t\t</PostSlugCheck>\n\t);\n}\n\nexport default PostSlug;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIO,SAASE,QAAQA,CAAA,EAAG;EAC1B,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAI,aAAa,QACb,IAAAF,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAO,QAAQ;IAACC,SAAS,EAAC;EAAqB,GACxC,IAAAJ,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAC,QAAY,MAAE,CACN,CACI,CAAC;AAElB;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcR,QAAQ","ignoreList":[]}
|