@wordpress/editor 13.24.0 → 13.25.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.
Files changed (175) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/document-bar/index.js +152 -0
  3. package/build/components/document-bar/index.js.map +1 -0
  4. package/build/components/editor-canvas/edit-template-blocks-notification.js +106 -0
  5. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -0
  6. package/build/components/editor-canvas/index.js +292 -0
  7. package/build/components/editor-canvas/index.js.map +1 -0
  8. package/build/components/index.js +24 -8
  9. package/build/components/index.js.map +1 -1
  10. package/build/components/post-publish-button/index.js +1 -0
  11. package/build/components/post-publish-button/index.js.map +1 -1
  12. package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
  13. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  14. package/build/components/post-saved-state/index.js +1 -0
  15. package/build/components/post-saved-state/index.js.map +1 -1
  16. package/build/components/post-schedule/panel.js +1 -1
  17. package/build/components/post-schedule/panel.js.map +1 -1
  18. package/build/components/post-template/block-theme.js +99 -0
  19. package/build/components/post-template/block-theme.js.map +1 -0
  20. package/build/components/post-template/classic-theme.js +171 -0
  21. package/build/components/post-template/classic-theme.js.map +1 -0
  22. package/build/components/post-template/create-new-template-modal.js +98 -0
  23. package/build/components/post-template/create-new-template-modal.js.map +1 -0
  24. package/build/components/post-template/create-new-template.js +55 -0
  25. package/build/components/post-template/create-new-template.js.map +1 -0
  26. package/build/components/post-template/hooks.js +88 -0
  27. package/build/components/post-template/hooks.js.map +1 -0
  28. package/build/components/post-template/panel.js +71 -0
  29. package/build/components/post-template/panel.js.map +1 -0
  30. package/build/components/post-template/reset-default-template.js +48 -0
  31. package/build/components/post-template/reset-default-template.js.map +1 -0
  32. package/build/components/post-template/swap-template-button.js +84 -0
  33. package/build/components/post-template/swap-template-button.js.map +1 -0
  34. package/build/components/post-title/index.native.js +0 -1
  35. package/build/components/post-title/index.native.js.map +1 -1
  36. package/build/components/preview-dropdown/index.js +113 -0
  37. package/build/components/preview-dropdown/index.js.map +1 -0
  38. package/build/components/provider/index.js +36 -77
  39. package/build/components/provider/index.js.map +1 -1
  40. package/build/components/provider/index.native.js +17 -8
  41. package/build/components/provider/index.native.js.map +1 -1
  42. package/build/components/provider/navigation-block-editing-mode.js +40 -0
  43. package/build/components/provider/navigation-block-editing-mode.js.map +1 -0
  44. package/build/components/provider/use-block-editor-settings.js +9 -10
  45. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  46. package/build/hooks/index.js +1 -0
  47. package/build/hooks/index.js.map +1 -1
  48. package/build/hooks/pattern-partial-syncing.js +49 -0
  49. package/build/hooks/pattern-partial-syncing.js.map +1 -0
  50. package/build/private-apis.js +4 -0
  51. package/build/private-apis.js.map +1 -1
  52. package/build/store/actions.js +59 -11
  53. package/build/store/actions.js.map +1 -1
  54. package/build/store/defaults.js +2 -1
  55. package/build/store/defaults.js.map +1 -1
  56. package/build/store/index.js +3 -0
  57. package/build/store/index.js.map +1 -1
  58. package/build/store/private-actions.js +52 -0
  59. package/build/store/private-actions.js.map +1 -0
  60. package/build/store/reducer.js +32 -27
  61. package/build/store/reducer.js.map +1 -1
  62. package/build/store/reducer.native.js +0 -1
  63. package/build/store/reducer.native.js.map +1 -1
  64. package/build/store/selectors.js +31 -10
  65. package/build/store/selectors.js.map +1 -1
  66. package/build-module/components/document-bar/index.js +144 -0
  67. package/build-module/components/document-bar/index.js.map +1 -0
  68. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +100 -0
  69. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -0
  70. package/build-module/components/editor-canvas/index.js +283 -0
  71. package/build-module/components/editor-canvas/index.js.map +1 -0
  72. package/build-module/components/index.js +3 -1
  73. package/build-module/components/index.js.map +1 -1
  74. package/build-module/components/post-publish-button/index.js +1 -0
  75. package/build-module/components/post-publish-button/index.js.map +1 -1
  76. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
  77. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  78. package/build-module/components/post-saved-state/index.js +1 -0
  79. package/build-module/components/post-saved-state/index.js.map +1 -1
  80. package/build-module/components/post-schedule/panel.js +1 -1
  81. package/build-module/components/post-schedule/panel.js.map +1 -1
  82. package/build-module/components/post-template/block-theme.js +91 -0
  83. package/build-module/components/post-template/block-theme.js.map +1 -0
  84. package/build-module/components/post-template/classic-theme.js +162 -0
  85. package/build-module/components/post-template/classic-theme.js.map +1 -0
  86. package/build-module/components/post-template/create-new-template-modal.js +91 -0
  87. package/build-module/components/post-template/create-new-template-modal.js.map +1 -0
  88. package/build-module/components/post-template/create-new-template.js +47 -0
  89. package/build-module/components/post-template/create-new-template.js.map +1 -0
  90. package/build-module/components/post-template/hooks.js +78 -0
  91. package/build-module/components/post-template/hooks.js.map +1 -0
  92. package/build-module/components/post-template/panel.js +63 -0
  93. package/build-module/components/post-template/panel.js.map +1 -0
  94. package/build-module/components/post-template/reset-default-template.js +41 -0
  95. package/build-module/components/post-template/reset-default-template.js.map +1 -0
  96. package/build-module/components/post-template/swap-template-button.js +77 -0
  97. package/build-module/components/post-template/swap-template-button.js.map +1 -0
  98. package/build-module/components/post-title/index.native.js +0 -1
  99. package/build-module/components/post-title/index.native.js.map +1 -1
  100. package/build-module/components/preview-dropdown/index.js +105 -0
  101. package/build-module/components/preview-dropdown/index.js.map +1 -0
  102. package/build-module/components/provider/index.js +37 -78
  103. package/build-module/components/provider/index.js.map +1 -1
  104. package/build-module/components/provider/index.native.js +18 -9
  105. package/build-module/components/provider/index.native.js.map +1 -1
  106. package/build-module/components/provider/navigation-block-editing-mode.js +34 -0
  107. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -0
  108. package/build-module/components/provider/use-block-editor-settings.js +9 -10
  109. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  110. package/build-module/hooks/index.js +1 -0
  111. package/build-module/hooks/index.js.map +1 -1
  112. package/build-module/hooks/pattern-partial-syncing.js +46 -0
  113. package/build-module/hooks/pattern-partial-syncing.js.map +1 -0
  114. package/build-module/private-apis.js +4 -0
  115. package/build-module/private-apis.js.map +1 -1
  116. package/build-module/store/actions.js +53 -9
  117. package/build-module/store/actions.js.map +1 -1
  118. package/build-module/store/defaults.js +2 -1
  119. package/build-module/store/defaults.js.map +1 -1
  120. package/build-module/store/index.js +3 -0
  121. package/build-module/store/index.js.map +1 -1
  122. package/build-module/store/private-actions.js +44 -0
  123. package/build-module/store/private-actions.js.map +1 -0
  124. package/build-module/store/reducer.js +30 -26
  125. package/build-module/store/reducer.js.map +1 -1
  126. package/build-module/store/reducer.native.js +1 -2
  127. package/build-module/store/reducer.native.js.map +1 -1
  128. package/build-module/store/selectors.js +26 -6
  129. package/build-module/store/selectors.js.map +1 -1
  130. package/build-style/style-rtl.css +182 -0
  131. package/build-style/style.css +182 -0
  132. package/package.json +32 -31
  133. package/src/components/document-bar/index.js +182 -0
  134. package/src/components/document-bar/style.scss +130 -0
  135. package/src/components/editor-canvas/edit-template-blocks-notification.js +108 -0
  136. package/src/components/editor-canvas/index.js +381 -0
  137. package/src/components/index.js +3 -1
  138. package/src/components/post-publish-button/index.js +1 -0
  139. package/src/components/post-publish-panel/maybe-upload-media.js +3 -8
  140. package/src/components/post-saved-state/index.js +1 -0
  141. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +2 -2
  142. package/src/components/post-schedule/panel.js +1 -1
  143. package/src/components/post-template/block-theme.js +109 -0
  144. package/src/components/post-template/classic-theme.js +213 -0
  145. package/src/components/post-template/create-new-template-modal.js +139 -0
  146. package/src/components/post-template/create-new-template.js +50 -0
  147. package/src/components/post-template/hooks.js +95 -0
  148. package/src/components/post-template/panel.js +67 -0
  149. package/src/components/post-template/reset-default-template.js +43 -0
  150. package/src/components/post-template/style.scss +52 -0
  151. package/src/components/post-template/swap-template-button.js +83 -0
  152. package/src/components/post-title/index.native.js +0 -1
  153. package/src/components/preview-dropdown/index.js +136 -0
  154. package/src/components/preview-dropdown/style.scss +5 -0
  155. package/src/components/provider/index.js +39 -112
  156. package/src/components/provider/index.native.js +26 -12
  157. package/src/components/provider/navigation-block-editing-mode.js +37 -0
  158. package/src/components/provider/use-block-editor-settings.js +6 -9
  159. package/src/hooks/index.js +1 -0
  160. package/src/hooks/pattern-partial-syncing.js +73 -0
  161. package/src/private-apis.js +4 -0
  162. package/src/store/actions.js +51 -9
  163. package/src/store/defaults.js +1 -0
  164. package/src/store/index.js +3 -0
  165. package/src/store/private-actions.js +61 -0
  166. package/src/store/reducer.js +32 -27
  167. package/src/store/reducer.native.js +0 -2
  168. package/src/store/selectors.js +64 -42
  169. package/src/store/test/selectors.js +88 -147
  170. package/src/style.scss +3 -0
  171. package/build/components/post-template/index.js +0 -66
  172. package/build/components/post-template/index.js.map +0 -1
  173. package/build-module/components/post-template/index.js +0 -57
  174. package/build-module/components/post-template/index.js.map +0 -1
  175. package/src/components/post-template/index.js +0 -64
@@ -0,0 +1,144 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { __, isRTL, sprintf } from '@wordpress/i18n';
11
+ import { useSelect, useDispatch } from '@wordpress/data';
12
+ import { Button, __experimentalText as Text, __experimentalHStack as HStack } from '@wordpress/components';
13
+ import { BlockIcon } from '@wordpress/block-editor';
14
+ import { chevronLeftSmall, chevronRightSmall, page as pageIcon, navigation as navigationIcon, symbol } from '@wordpress/icons';
15
+ import { displayShortcut } from '@wordpress/keycodes';
16
+ import { useEntityRecord } from '@wordpress/core-data';
17
+ import { store as commandsStore } from '@wordpress/commands';
18
+ import { useState, useEffect, useRef } from '@wordpress/element';
19
+
20
+ /**
21
+ * Internal dependencies
22
+ */
23
+ import { store as editorStore } from '../../store';
24
+ const typeLabels = {
25
+ // translators: 1: Pattern title.
26
+ wp_pattern: __('Editing pattern: %s'),
27
+ // translators: 1: Navigation menu title.
28
+ wp_navigation: __('Editing navigation menu: %s'),
29
+ // translators: 1: Template title.
30
+ wp_template: __('Editing template: %s'),
31
+ // translators: 1: Template part title.
32
+ wp_template_part: __('Editing template part: %s')
33
+ };
34
+ const icons = {
35
+ wp_block: symbol,
36
+ wp_navigation: navigationIcon
37
+ };
38
+ export default function DocumentBar() {
39
+ const {
40
+ isEditingTemplate,
41
+ templateId,
42
+ postType,
43
+ postId
44
+ } = useSelect(select => {
45
+ const {
46
+ getRenderingMode,
47
+ getCurrentTemplateId,
48
+ getCurrentPostId,
49
+ getCurrentPostType
50
+ } = select(editorStore);
51
+ const _templateId = getCurrentTemplateId();
52
+ return {
53
+ isEditingTemplate: !!_templateId && getRenderingMode() === 'template-only',
54
+ templateId: _templateId,
55
+ postType: getCurrentPostType(),
56
+ postId: getCurrentPostId()
57
+ };
58
+ }, []);
59
+ const {
60
+ getEditorSettings
61
+ } = useSelect(editorStore);
62
+ const {
63
+ setRenderingMode
64
+ } = useDispatch(editorStore);
65
+ return createElement(BaseDocumentActions, {
66
+ postType: isEditingTemplate ? 'wp_template' : postType,
67
+ postId: isEditingTemplate ? templateId : postId,
68
+ onBack: isEditingTemplate ? () => setRenderingMode(getEditorSettings().defaultRenderingMode) : undefined
69
+ });
70
+ }
71
+ function BaseDocumentActions({
72
+ postType,
73
+ postId,
74
+ onBack
75
+ }) {
76
+ var _icons$postType;
77
+ const {
78
+ open: openCommandCenter
79
+ } = useDispatch(commandsStore);
80
+ const {
81
+ editedRecord: doc,
82
+ isResolving
83
+ } = useEntityRecord('postType', postType, postId);
84
+ const {
85
+ templateIcon,
86
+ templateTitle
87
+ } = useSelect(select => {
88
+ const {
89
+ __experimentalGetTemplateInfo: getTemplateInfo
90
+ } = select(editorStore);
91
+ const templateInfo = getTemplateInfo(doc);
92
+ return {
93
+ templateIcon: templateInfo.icon,
94
+ templateTitle: templateInfo.title
95
+ };
96
+ });
97
+ const isNotFound = !doc && !isResolving;
98
+ const icon = (_icons$postType = icons[postType]) !== null && _icons$postType !== void 0 ? _icons$postType : pageIcon;
99
+ const [isAnimated, setIsAnimated] = useState(false);
100
+ const isMounting = useRef(true);
101
+ const isTemplate = ['wp_template', 'wp_template_part'].includes(postType);
102
+ const isGlobalEntity = ['wp_template', 'wp_navigation', 'wp_template_part', 'wp_block'].includes(postType);
103
+ useEffect(() => {
104
+ if (!isMounting.current) {
105
+ setIsAnimated(true);
106
+ }
107
+ isMounting.current = false;
108
+ }, [postType, postId]);
109
+ const title = isTemplate ? templateTitle : doc.title;
110
+ return createElement("div", {
111
+ className: classnames('editor-document-bar', {
112
+ 'has-back-button': !!onBack,
113
+ 'is-animated': isAnimated,
114
+ 'is-global': isGlobalEntity
115
+ })
116
+ }, onBack && createElement(Button, {
117
+ className: "editor-document-bar__back",
118
+ icon: isRTL() ? chevronRightSmall : chevronLeftSmall,
119
+ onClick: event => {
120
+ event.stopPropagation();
121
+ onBack();
122
+ },
123
+ size: "compact"
124
+ }, __('Back')), isNotFound && createElement(Text, null, __('Document not found')), !isNotFound && createElement(Button, {
125
+ className: "editor-document-bar__command",
126
+ onClick: () => openCommandCenter(),
127
+ size: "compact"
128
+ }, createElement(HStack, {
129
+ className: "editor-document-bar__title",
130
+ spacing: 1,
131
+ justify: "center"
132
+ }, createElement(BlockIcon, {
133
+ icon: isTemplate ? templateIcon : icon
134
+ }), createElement(Text, {
135
+ size: "body",
136
+ as: "h1",
137
+ "aria-label": typeLabels[postType] ?
138
+ // eslint-disable-next-line @wordpress/valid-sprintf
139
+ sprintf(typeLabels[postType], title) : undefined
140
+ }, title)), createElement("span", {
141
+ className: "editor-document-bar__shortcut"
142
+ }, displayShortcut.primary('k'))));
143
+ }
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","__","isRTL","sprintf","useSelect","useDispatch","Button","__experimentalText","Text","__experimentalHStack","HStack","BlockIcon","chevronLeftSmall","chevronRightSmall","page","pageIcon","navigation","navigationIcon","symbol","displayShortcut","useEntityRecord","store","commandsStore","useState","useEffect","useRef","editorStore","typeLabels","wp_pattern","wp_navigation","wp_template","wp_template_part","icons","wp_block","DocumentBar","isEditingTemplate","templateId","postType","postId","select","getRenderingMode","getCurrentTemplateId","getCurrentPostId","getCurrentPostType","_templateId","getEditorSettings","setRenderingMode","createElement","BaseDocumentActions","onBack","defaultRenderingMode","undefined","_icons$postType","open","openCommandCenter","editedRecord","doc","isResolving","templateIcon","templateTitle","__experimentalGetTemplateInfo","getTemplateInfo","templateInfo","icon","title","isNotFound","isAnimated","setIsAnimated","isMounting","isTemplate","includes","isGlobalEntity","current","className","onClick","event","stopPropagation","size","spacing","justify","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport {\n\tchevronLeftSmall,\n\tchevronRightSmall,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n\tsymbol,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useState, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst typeLabels = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst icons = {\n\twp_block: symbol,\n\twp_navigation: navigationIcon,\n};\n\nexport default function DocumentBar() {\n\tconst { isEditingTemplate, templateId, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetRenderingMode,\n\t\t\t\tgetCurrentTemplateId,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst _templateId = getCurrentTemplateId();\n\t\t\treturn {\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\t!! _templateId && getRenderingMode() === 'template-only',\n\t\t\t\ttemplateId: _templateId,\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { getEditorSettings } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tpostType={ isEditingTemplate ? 'wp_template' : postType }\n\t\t\tpostId={ isEditingTemplate ? templateId : postId }\n\t\t\tonBack={\n\t\t\t\tisEditingTemplate\n\t\t\t\t\t? () =>\n\t\t\t\t\t\t\tsetRenderingMode(\n\t\t\t\t\t\t\t\tgetEditorSettings().defaultRenderingMode\n\t\t\t\t\t\t\t)\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n\nfunction BaseDocumentActions( { postType, postId, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst { editedRecord: doc, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst { templateIcon, templateTitle } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\tselect( editorStore );\n\t\tconst templateInfo = getTemplateInfo( doc );\n\t\treturn {\n\t\t\ttemplateIcon: templateInfo.icon,\n\t\t\ttemplateTitle: templateInfo.title,\n\t\t};\n\t} );\n\tconst isNotFound = ! doc && ! isResolving;\n\tconst icon = icons[ postType ] ?? pageIcon;\n\tconst [ isAnimated, setIsAnimated ] = useState( false );\n\tconst isMounting = useRef( true );\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\tpostType\n\t);\n\tconst isGlobalEntity = [\n\t\t'wp_template',\n\t\t'wp_navigation',\n\t\t'wp_template_part',\n\t\t'wp_block',\n\t].includes( postType );\n\n\tuseEffect( () => {\n\t\tif ( ! isMounting.current ) {\n\t\t\tsetIsAnimated( true );\n\t\t}\n\t\tisMounting.current = false;\n\t}, [ postType, postId ] );\n\n\tconst title = isTemplate ? templateTitle : doc.title;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'editor-document-bar', {\n\t\t\t\t'has-back-button': !! onBack,\n\t\t\t\t'is-animated': isAnimated,\n\t\t\t\t'is-global': isGlobalEntity,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ isNotFound && <Text>{ __( 'Document not found' ) }</Text> }\n\t\t\t{ ! isNotFound && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ isTemplate ? templateIcon : icon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\ttypeLabels[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( typeLabels[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SACCC,gBAAgB,EAChBC,iBAAiB,EACjBC,IAAI,IAAIC,QAAQ,EAChBC,UAAU,IAAIC,cAAc,EAC5BC,MAAM,QACA,kBAAkB;AACzB,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAElD,MAAMC,UAAU,GAAG;EAClB;EACAC,UAAU,EAAE3B,EAAE,CAAE,qBAAsB,CAAC;EACvC;EACA4B,aAAa,EAAE5B,EAAE,CA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GAECa,KACG,CACC,CAAC,EACTjB,aAAA;IAAM0B,SAAS,EAAC;EAA+B,GAC5CtD,eAAe,CAAC8D,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER"}
@@ -0,0 +1,100 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { useSelect, useDispatch } from '@wordpress/data';
6
+ import { useEffect, useState, useRef } from '@wordpress/element';
7
+ import { store as noticesStore } from '@wordpress/notices';
8
+ import { __ } from '@wordpress/i18n';
9
+ import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { store as editorStore } from '../../store';
15
+
16
+ /**
17
+ * Component that:
18
+ *
19
+ * - Displays a 'Edit your template to edit this block' notification when the
20
+ * user is focusing on editing page content and clicks on a disabled template
21
+ * block.
22
+ * - Displays a 'Edit your template to edit this block' dialog when the user
23
+ * is focusing on editing page conetnt and double clicks on a disabled
24
+ * template block.
25
+ *
26
+ * @param {Object} props
27
+ * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block
28
+ * editor iframe canvas.
29
+ */
30
+ export default function EditTemplateBlocksNotification({
31
+ contentRef
32
+ }) {
33
+ const renderingMode = useSelect(select => select(editorStore).getRenderingMode(), []);
34
+ const {
35
+ getNotices
36
+ } = useSelect(noticesStore);
37
+ const {
38
+ createInfoNotice,
39
+ removeNotice
40
+ } = useDispatch(noticesStore);
41
+ const {
42
+ setRenderingMode
43
+ } = useDispatch(editorStore);
44
+ const [isDialogOpen, setIsDialogOpen] = useState(false);
45
+ const lastNoticeId = useRef(0);
46
+ useEffect(() => {
47
+ const handleClick = async event => {
48
+ if (renderingMode !== 'template-locked') {
49
+ return;
50
+ }
51
+ if (!event.target.classList.contains('is-root-container')) {
52
+ return;
53
+ }
54
+ const isNoticeAlreadyShowing = getNotices().some(notice => notice.id === lastNoticeId.current);
55
+ if (isNoticeAlreadyShowing) {
56
+ return;
57
+ }
58
+ const {
59
+ notice
60
+ } = await createInfoNotice(__('Edit your template to edit this block.'), {
61
+ isDismissible: true,
62
+ type: 'snackbar',
63
+ actions: [{
64
+ label: __('Edit template'),
65
+ onClick: () => setRenderingMode('template-only')
66
+ }]
67
+ });
68
+ lastNoticeId.current = notice.id;
69
+ };
70
+ const handleDblClick = event => {
71
+ if (renderingMode !== 'template-locked') {
72
+ return;
73
+ }
74
+ if (!event.target.classList.contains('is-root-container')) {
75
+ return;
76
+ }
77
+ if (lastNoticeId.current) {
78
+ removeNotice(lastNoticeId.current);
79
+ }
80
+ setIsDialogOpen(true);
81
+ };
82
+ const canvas = contentRef.current;
83
+ canvas?.addEventListener('click', handleClick);
84
+ canvas?.addEventListener('dblclick', handleDblClick);
85
+ return () => {
86
+ canvas?.removeEventListener('click', handleClick);
87
+ canvas?.removeEventListener('dblclick', handleDblClick);
88
+ };
89
+ }, [lastNoticeId, renderingMode, contentRef.current]);
90
+ return createElement(ConfirmDialog, {
91
+ isOpen: isDialogOpen,
92
+ confirmButtonText: __('Edit template'),
93
+ onConfirm: () => {
94
+ setIsDialogOpen(false);
95
+ setRenderingMode('template-only');
96
+ },
97
+ onCancel: () => setIsDialogOpen(false)
98
+ }, __('Edit your template to edit this block.'));
99
+ }
100
+ //# sourceMappingURL=edit-template-blocks-notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","useEffect","useState","useRef","store","noticesStore","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","EditTemplateBlocksNotification","contentRef","renderingMode","select","getRenderingMode","getNotices","createInfoNotice","removeNotice","setRenderingMode","isDialogOpen","setIsDialogOpen","lastNoticeId","handleClick","event","target","classList","contains","isNoticeAlreadyShowing","some","notice","id","current","isDismissible","type","actions","label","onClick","handleDblClick","canvas","addEventListener","removeEventListener","createElement","isOpen","confirmButtonText","onConfirm","onCancel"],"sources":["@wordpress/editor/src/components/editor-canvas/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useState, useRef } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst renderingMode = useSelect(\n\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t[]\n\t);\n\tconst { getNotices } = useSelect( noticesStore );\n\n\tconst { createInfoNotice, removeNotice } = useDispatch( noticesStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tconst lastNoticeId = useRef( 0 );\n\n\tuseEffect( () => {\n\t\tconst handleClick = async ( event ) => {\n\t\t\tif ( renderingMode !== 'template-locked' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst isNoticeAlreadyShowing = getNotices().some(\n\t\t\t\t( notice ) => notice.id === lastNoticeId.current\n\t\t\t);\n\t\t\tif ( isNoticeAlreadyShowing ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { notice } = await createInfoNotice(\n\t\t\t\t__( 'Edit your template to edit this block.' ),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Edit template' ),\n\t\t\t\t\t\t\tonClick: () => setRenderingMode( 'template-only' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t\tlastNoticeId.current = notice.id;\n\t\t};\n\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( renderingMode !== 'template-locked' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( lastNoticeId.current ) {\n\t\t\t\tremoveNotice( lastNoticeId.current );\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'click', handleClick );\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'click', handleClick );\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ lastNoticeId, renderingMode, contentRef.current ] );\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tsetRenderingMode( 'template-only' );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t>\n\t\t\t{ __( 'Edit your template to edit this block.' ) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AAChE,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;;AAEpF;AACA;AACA;AACA,SAAS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
1
+ import { createElement, Fragment } from "react";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { BlockList, store as blockEditorStore, __unstableUseTypewriter as useTypewriter, __unstableUseTypingObserver as useTypingObserver, useSettings, __experimentalRecursionProvider as RecursionProvider, privateApis as blockEditorPrivateApis, __experimentalUseResizeCanvas as useResizeCanvas } from '@wordpress/block-editor';
11
+ import { useEffect, useRef, useMemo } from '@wordpress/element';
12
+ import { useSelect } from '@wordpress/data';
13
+ import { parse } from '@wordpress/blocks';
14
+ import { store as coreStore } from '@wordpress/core-data';
15
+ import { useMergeRefs } from '@wordpress/compose';
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+ import PostTitle from '../post-title';
21
+ import { store as editorStore } from '../../store';
22
+ import { unlock } from '../../lock-unlock';
23
+ import EditTemplateBlocksNotification from './edit-template-blocks-notification';
24
+ const {
25
+ LayoutStyle,
26
+ useLayoutClasses,
27
+ useLayoutStyles,
28
+ ExperimentalBlockCanvas: BlockCanvas
29
+ } = unlock(blockEditorPrivateApis);
30
+
31
+ /**
32
+ * Given an array of nested blocks, find the first Post Content
33
+ * block inside it, recursing through any nesting levels,
34
+ * and return its attributes.
35
+ *
36
+ * @param {Array} blocks A list of blocks.
37
+ *
38
+ * @return {Object | undefined} The Post Content block.
39
+ */
40
+ function getPostContentAttributes(blocks) {
41
+ for (let i = 0; i < blocks.length; i++) {
42
+ if (blocks[i].name === 'core/post-content') {
43
+ return blocks[i].attributes;
44
+ }
45
+ if (blocks[i].innerBlocks.length) {
46
+ const nestedPostContent = getPostContentAttributes(blocks[i].innerBlocks);
47
+ if (nestedPostContent) {
48
+ return nestedPostContent;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ function checkForPostContentAtRootLevel(blocks) {
54
+ for (let i = 0; i < blocks.length; i++) {
55
+ if (blocks[i].name === 'core/post-content') {
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ }
61
+ function EditorCanvas({
62
+ // Ideally as we unify post and site editors, we won't need these props.
63
+ autoFocus,
64
+ className,
65
+ renderAppender,
66
+ styles,
67
+ disableIframe = false,
68
+ iframeProps,
69
+ children
70
+ }) {
71
+ const {
72
+ renderingMode,
73
+ postContentAttributes,
74
+ editedPostTemplate = {},
75
+ wrapperBlockName,
76
+ wrapperUniqueId,
77
+ deviceType
78
+ } = useSelect(select => {
79
+ const {
80
+ getCurrentPostId,
81
+ getCurrentPostType,
82
+ getCurrentTemplateId,
83
+ getEditorSettings,
84
+ getRenderingMode,
85
+ getDeviceType
86
+ } = select(editorStore);
87
+ const {
88
+ getPostType,
89
+ canUser,
90
+ getEditedEntityRecord
91
+ } = select(coreStore);
92
+ const postTypeSlug = getCurrentPostType();
93
+ const _renderingMode = getRenderingMode();
94
+ let _wrapperBlockName;
95
+ if (postTypeSlug === 'wp_block') {
96
+ _wrapperBlockName = 'core/block';
97
+ } else if (!_renderingMode === 'post-only') {
98
+ _wrapperBlockName = 'core/post-content';
99
+ }
100
+ const editorSettings = getEditorSettings();
101
+ const supportsTemplateMode = editorSettings.supportsTemplateMode;
102
+ const postType = getPostType(postTypeSlug);
103
+ const canEditTemplate = canUser('create', 'templates');
104
+ const currentTemplateId = getCurrentTemplateId();
105
+ const template = currentTemplateId ? getEditedEntityRecord('postType', 'wp_template', currentTemplateId) : undefined;
106
+ return {
107
+ renderingMode: _renderingMode,
108
+ postContentAttributes: getEditorSettings().postContentAttributes,
109
+ // Post template fetch returns a 404 on classic themes, which
110
+ // messes with e2e tests, so check it's a block theme first.
111
+ editedPostTemplate: postType?.viewable && supportsTemplateMode && canEditTemplate ? template : undefined,
112
+ wrapperBlockName: _wrapperBlockName,
113
+ wrapperUniqueId: getCurrentPostId(),
114
+ deviceType: getDeviceType()
115
+ };
116
+ }, []);
117
+ const {
118
+ isCleanNewPost
119
+ } = useSelect(editorStore);
120
+ const {
121
+ hasRootPaddingAwareAlignments,
122
+ themeHasDisabledLayoutStyles,
123
+ themeSupportsLayout
124
+ } = useSelect(select => {
125
+ const _settings = select(blockEditorStore).getSettings();
126
+ return {
127
+ themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
128
+ themeSupportsLayout: _settings.supportsLayout,
129
+ hasRootPaddingAwareAlignments: _settings.__experimentalFeatures?.useRootPaddingAwareAlignments
130
+ };
131
+ }, []);
132
+ const deviceStyles = useResizeCanvas(deviceType);
133
+ const [globalLayoutSettings] = useSettings('layout');
134
+
135
+ // fallbackLayout is used if there is no Post Content,
136
+ // and for Post Title.
137
+ const fallbackLayout = useMemo(() => {
138
+ if (renderingMode !== 'post-only') {
139
+ return {
140
+ type: 'default'
141
+ };
142
+ }
143
+ if (themeSupportsLayout) {
144
+ // We need to ensure support for wide and full alignments,
145
+ // so we add the constrained type.
146
+ return {
147
+ ...globalLayoutSettings,
148
+ type: 'constrained'
149
+ };
150
+ }
151
+ // Set default layout for classic themes so all alignments are supported.
152
+ return {
153
+ type: 'default'
154
+ };
155
+ }, [renderingMode, themeSupportsLayout, globalLayoutSettings]);
156
+ const newestPostContentAttributes = useMemo(() => {
157
+ if (!editedPostTemplate?.content && !editedPostTemplate?.blocks && postContentAttributes) {
158
+ return postContentAttributes;
159
+ }
160
+ // When in template editing mode, we can access the blocks directly.
161
+ if (editedPostTemplate?.blocks) {
162
+ return getPostContentAttributes(editedPostTemplate?.blocks);
163
+ }
164
+ // If there are no blocks, we have to parse the content string.
165
+ // Best double-check it's a string otherwise the parse function gets unhappy.
166
+ const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
167
+ return getPostContentAttributes(parse(parseableContent)) || {};
168
+ }, [editedPostTemplate?.content, editedPostTemplate?.blocks, postContentAttributes]);
169
+ const hasPostContentAtRootLevel = useMemo(() => {
170
+ if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) {
171
+ return false;
172
+ }
173
+ // When in template editing mode, we can access the blocks directly.
174
+ if (editedPostTemplate?.blocks) {
175
+ return checkForPostContentAtRootLevel(editedPostTemplate?.blocks);
176
+ }
177
+ // If there are no blocks, we have to parse the content string.
178
+ // Best double-check it's a string otherwise the parse function gets unhappy.
179
+ const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
180
+ return checkForPostContentAtRootLevel(parse(parseableContent)) || false;
181
+ }, [editedPostTemplate?.content, editedPostTemplate?.blocks]);
182
+ const {
183
+ layout = {},
184
+ align = ''
185
+ } = newestPostContentAttributes || {};
186
+ const postContentLayoutClasses = useLayoutClasses(newestPostContentAttributes, 'core/post-content');
187
+ const blockListLayoutClass = classnames({
188
+ 'is-layout-flow': !themeSupportsLayout
189
+ }, themeSupportsLayout && postContentLayoutClasses, align && `align${align}`);
190
+ const postContentLayoutStyles = useLayoutStyles(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container');
191
+
192
+ // Update type for blocks using legacy layouts.
193
+ const postContentLayout = useMemo(() => {
194
+ return layout && (layout?.type === 'constrained' || layout?.inherit || layout?.contentSize || layout?.wideSize) ? {
195
+ ...globalLayoutSettings,
196
+ ...layout,
197
+ type: 'constrained'
198
+ } : {
199
+ ...globalLayoutSettings,
200
+ ...layout,
201
+ type: 'default'
202
+ };
203
+ }, [layout?.type, layout?.inherit, layout?.contentSize, layout?.wideSize, globalLayoutSettings]);
204
+
205
+ // If there is a Post Content block we use its layout for the block list;
206
+ // if not, this must be a classic theme, in which case we use the fallback layout.
207
+ const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
208
+ const postEditorLayout = blockListLayout?.type === 'default' && !hasPostContentAtRootLevel ? fallbackLayout : blockListLayout;
209
+ const observeTypingRef = useTypingObserver();
210
+ const titleRef = useRef();
211
+ useEffect(() => {
212
+ if (!autoFocus || !isCleanNewPost()) {
213
+ return;
214
+ }
215
+ titleRef?.current?.focus();
216
+ }, [autoFocus, isCleanNewPost]);
217
+
218
+ // Add some styles for alignwide/alignfull Post Content and its children.
219
+ const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
220
+ .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
221
+ .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
222
+ .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
223
+ const localRef = useRef();
224
+ const typewriterRef = useTypewriter();
225
+ const contentRef = useMergeRefs([localRef, renderingMode === 'post-only' ? typewriterRef : undefined].filter(r => !!r));
226
+ return createElement(BlockCanvas, {
227
+ shouldIframe: !disableIframe || ['Tablet', 'Mobile'].includes(deviceType),
228
+ contentRef: contentRef,
229
+ styles: styles,
230
+ height: "100%",
231
+ iframeProps: {
232
+ ...iframeProps,
233
+ style: {
234
+ ...iframeProps?.style,
235
+ ...deviceStyles
236
+ }
237
+ }
238
+ }, themeSupportsLayout && !themeHasDisabledLayoutStyles && renderingMode === 'post-only' && createElement(Fragment, null, createElement(LayoutStyle, {
239
+ selector: ".editor-editor-canvas__post-title-wrapper",
240
+ layout: fallbackLayout
241
+ }), createElement(LayoutStyle, {
242
+ selector: ".block-editor-block-list__layout.is-root-container",
243
+ layout: postEditorLayout
244
+ }), align && createElement(LayoutStyle, {
245
+ css: alignCSS
246
+ }), postContentLayoutStyles && createElement(LayoutStyle, {
247
+ layout: postContentLayout,
248
+ css: postContentLayoutStyles
249
+ })), renderingMode === 'post-only' && createElement("div", {
250
+ className: classnames('editor-editor-canvas__post-title-wrapper',
251
+ // The following class is only here for backward comapatibility
252
+ // some themes might be using it to style the post title.
253
+ 'edit-post-visual-editor__post-title-wrapper', {
254
+ 'has-global-padding': hasRootPaddingAwareAlignments
255
+ }),
256
+ contentEditable: false,
257
+ ref: observeTypingRef,
258
+ style: {
259
+ // This is using inline styles
260
+ // so it's applied for both iframed and non iframed editors.
261
+ marginTop: '4rem'
262
+ }
263
+ }, createElement(PostTitle, {
264
+ ref: titleRef
265
+ })), createElement(RecursionProvider, {
266
+ blockName: wrapperBlockName,
267
+ uniqueId: wrapperUniqueId
268
+ }, createElement(BlockList, {
269
+ className: classnames(className, 'is-' + deviceType.toLowerCase() + '-preview', renderingMode !== 'post-only' ? 'wp-site-blocks' : `${blockListLayoutClass} wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.
270
+ ),
271
+
272
+ layout: blockListLayout,
273
+ dropZoneElement:
274
+ // When iframed, pass in the html element of the iframe to
275
+ // ensure the drop zone extends to the edges of the iframe.
276
+ disableIframe ? localRef.current : localRef.current?.parentNode,
277
+ renderAppender: renderAppender
278
+ }), createElement(EditTemplateBlocksNotification, {
279
+ contentRef: localRef
280
+ })), children);
281
+ }
282
+ export default EditorCanvas;
283
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","__experimentalRecursionProvider","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useSelect","parse","coreStore","useMergeRefs","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","EditorCanvas","autoFocus","className","renderAppender","styles","disableIframe","iframeProps","children","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","canUser","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postType","canEditTemplate","currentTemplateId","template","undefined","viewable","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","_settings","getSettings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","localRef","typewriterRef","contentRef","filter","r","createElement","shouldIframe","includes","height","style","Fragment","selector","css","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode"],"sources":["@wordpress/editor/src/components/editor-canvas/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\t__experimentalRecursionProvider as RecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction EditorCanvas( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tclassName,\n\trenderAppender,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tchildren,\n} ) {\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, canUser, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( ! _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postType = getPostType( postTypeSlug );\n\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: getEditorSettings().postContentAttributes,\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostType?.viewable && supportsTemplateMode && canEditTemplate\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t} = useSelect( ( select ) => {\n\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [ renderingMode, themeSupportsLayout, globalLayoutSettings ] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tconst contentRef = useMergeRefs(\n\t\t[\n\t\t\tlocalRef,\n\t\t\trenderingMode === 'post-only' ? typewriterRef : undefined,\n\t\t].filter( ( r ) => !! r )\n\t);\n\n\treturn (\n\t\t<BlockCanvas\n\t\t\tshouldIframe={\n\t\t\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType )\n\t\t\t}\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyles={ styles }\n\t\t\theight=\"100%\"\n\t\t\tiframeProps={ {\n\t\t\t\t...iframeProps,\n\t\t\t\tstyle: {\n\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t...deviceStyles,\n\t\t\t\t},\n\t\t\t} }\n\t\t>\n\t\t\t{ themeSupportsLayout &&\n\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\trenderingMode === 'post-only' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".editor-editor-canvas__post-title-wrapper\"\n\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t{ renderingMode === 'post-only' && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'editor-editor-canvas__post-title-wrapper',\n\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-global-padding': hasRootPaddingAwareAlignments,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<RecursionProvider\n\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t>\n\t\t\t\t<BlockList\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\trenderingMode !== 'post-only'\n\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t) }\n\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t}\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t/>\n\t\t\t\t<EditTemplateBlocksNotification contentRef={ localRef } />\n\t\t\t</RecursionProvider>\n\t\t\t{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gE,QAAQ,CAACH,OAAO,GAChBG,QAAQ,CAACH,OAAO,EAAEuB,UACrB;IACDtF,cAAc,EAAGA;EAAgB,CACjC,CAAC,EACFuE,aAAA,CAACzF,8BAA8B;IAACsF,UAAU,EAAGF;EAAU,CAAE,CACvC,CAAC,EAClB9D,QACU,CAAC;AAEhB;AAEA,eAAeP,YAAY"}
@@ -8,6 +8,7 @@ export * from './autocompleters';
8
8
 
9
9
  // Post Related Components.
10
10
  export { default as AutosaveMonitor } from './autosave-monitor';
11
+ export { default as DocumentBar } from './document-bar';
11
12
  export { default as DocumentOutline } from './document-outline';
12
13
  export { default as DocumentOutlineCheck } from './document-outline/check';
13
14
  export { EditorKeyboardShortcuts };
@@ -23,7 +24,8 @@ export { default as LocalAutosaveMonitor } from './local-autosave-monitor';
23
24
  export { default as PageAttributesCheck } from './page-attributes/check';
24
25
  export { default as PageAttributesOrder } from './page-attributes/order';
25
26
  export { default as PageAttributesParent } from './page-attributes/parent';
26
- export { default as PageTemplate } from './post-template';
27
+ export { default as PageTemplate } from './post-template/classic-theme';
28
+ export { default as PostTemplatePanel } from './post-template/panel';
27
29
  export { default as PostAuthor } from './post-author';
28
30
  export { default as PostAuthorCheck } from './post-author/check';
29
31
  export { default as PostAuthorPanel } from './post-author/panel';