@wordpress/edit-post 5.0.22 → 5.1.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 (92) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/block-manager/category.js +42 -47
  4. package/build/components/block-manager/category.js.map +1 -1
  5. package/build/components/header/index.native.js +4 -6
  6. package/build/components/header/index.native.js.map +1 -1
  7. package/build/components/layout/index.js +3 -1
  8. package/build/components/layout/index.js.map +1 -1
  9. package/build/components/layout/index.native.js +3 -3
  10. package/build/components/layout/index.native.js.map +1 -1
  11. package/build/components/preferences-modal/index.js +20 -10
  12. package/build/components/preferences-modal/index.js.map +1 -1
  13. package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
  14. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  15. package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
  16. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  17. package/build/components/sidebar/post-author/index.js +3 -1
  18. package/build/components/sidebar/post-author/index.js.map +1 -1
  19. package/build/components/sidebar/template/index.js +2 -1
  20. package/build/components/sidebar/template/index.js.map +1 -1
  21. package/build/components/visual-editor/index.js +14 -6
  22. package/build/components/visual-editor/index.js.map +1 -1
  23. package/build/components/welcome-guide/template.js +1 -1
  24. package/build/components/welcome-guide/template.js.map +1 -1
  25. package/build/editor.js +6 -11
  26. package/build/editor.js.map +1 -1
  27. package/build/index.native.js +3 -9
  28. package/build/index.native.js.map +1 -1
  29. package/build/store/selectors.js +3 -1
  30. package/build/store/selectors.js.map +1 -1
  31. package/build-module/components/block-manager/category.js +44 -48
  32. package/build-module/components/block-manager/category.js.map +1 -1
  33. package/build-module/components/header/index.native.js +4 -4
  34. package/build-module/components/header/index.native.js.map +1 -1
  35. package/build-module/components/layout/index.js +4 -2
  36. package/build-module/components/layout/index.js.map +1 -1
  37. package/build-module/components/layout/index.native.js +4 -2
  38. package/build-module/components/layout/index.native.js.map +1 -1
  39. package/build-module/components/preferences-modal/index.js +20 -10
  40. package/build-module/components/preferences-modal/index.js.map +1 -1
  41. package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
  42. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  43. package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
  44. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  45. package/build-module/components/sidebar/post-author/index.js +3 -1
  46. package/build-module/components/sidebar/post-author/index.js.map +1 -1
  47. package/build-module/components/sidebar/template/index.js +2 -1
  48. package/build-module/components/sidebar/template/index.js.map +1 -1
  49. package/build-module/components/visual-editor/index.js +15 -7
  50. package/build-module/components/visual-editor/index.js.map +1 -1
  51. package/build-module/components/welcome-guide/template.js +1 -1
  52. package/build-module/components/welcome-guide/template.js.map +1 -1
  53. package/build-module/editor.js +7 -10
  54. package/build-module/editor.js.map +1 -1
  55. package/build-module/index.native.js +2 -9
  56. package/build-module/index.native.js.map +1 -1
  57. package/build-module/store/selectors.js +3 -1
  58. package/build-module/store/selectors.js.map +1 -1
  59. package/build-style/style-rtl.css +17 -16
  60. package/build-style/style.css +17 -16
  61. package/package.json +27 -27
  62. package/src/components/block-manager/category.js +41 -48
  63. package/src/components/header/index.native.js +10 -4
  64. package/src/components/header/template-title/style.scss +1 -1
  65. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +2 -2
  66. package/src/components/layout/index.js +2 -1
  67. package/src/components/layout/index.native.js +2 -5
  68. package/src/components/preferences-modal/index.js +9 -16
  69. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +7 -13
  70. package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
  71. package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
  72. package/src/components/secondary-sidebar/style.scss +0 -4
  73. package/src/components/sidebar/post-author/index.js +1 -1
  74. package/src/components/sidebar/template/index.js +1 -0
  75. package/src/components/visual-editor/index.js +16 -6
  76. package/src/components/welcome-guide/style.scss +8 -1
  77. package/src/components/welcome-guide/template.js +1 -1
  78. package/src/editor.js +22 -26
  79. package/src/index.native.js +1 -10
  80. package/src/store/selectors.js +1 -1
  81. package/src/style.scss +1 -2
  82. package/src/test/editor.native.js +4 -4
  83. package/build/components/edit-post-settings/index.js +0 -16
  84. package/build/components/edit-post-settings/index.js.map +0 -1
  85. package/build/prevent-event-discovery.js +0 -24
  86. package/build/prevent-event-discovery.js.map +0 -1
  87. package/build-module/components/edit-post-settings/index.js +0 -7
  88. package/build-module/components/edit-post-settings/index.js.map +0 -1
  89. package/build-module/prevent-event-discovery.js +0 -17
  90. package/build-module/prevent-event-discovery.js.map +0 -1
  91. package/src/components/edit-post-settings/index.js +0 -7
  92. package/src/prevent-event-discovery.js +0 -21
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`PreferencesModal should match snapshot when the modal is active large viewports 1`] = `
4
- <Modal
4
+ <ForwardRef(Modal)
5
5
  className="edit-post-preferences-modal"
6
6
  closeLabel="Close"
7
7
  onRequestClose={[Function]}
@@ -30,11 +30,11 @@ exports[`PreferencesModal should match snapshot when the modal is active large v
30
30
  >
31
31
  <Component />
32
32
  </TabPanel>
33
- </Modal>
33
+ </ForwardRef(Modal)>
34
34
  `;
35
35
 
36
36
  exports[`PreferencesModal should match snapshot when the modal is active small viewports 1`] = `
37
- <Modal
37
+ <ForwardRef(Modal)
38
38
  className="edit-post-preferences-modal"
39
39
  closeLabel="Close"
40
40
  onRequestClose={[Function]}
@@ -187,7 +187,7 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
187
187
  justify="left"
188
188
  size="small"
189
189
  >
190
- <NavigationButton
190
+ <NavigationBackButton
191
191
  aria-label="Navigate to the previous view"
192
192
  icon={
193
193
  <SVG
@@ -199,8 +199,6 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
199
199
  />
200
200
  </SVG>
201
201
  }
202
- isBack={true}
203
- path="/"
204
202
  />
205
203
  <Text
206
204
  size="16"
@@ -256,7 +254,7 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
256
254
  justify="left"
257
255
  size="small"
258
256
  >
259
- <NavigationButton
257
+ <NavigationBackButton
260
258
  aria-label="Navigate to the previous view"
261
259
  icon={
262
260
  <SVG
@@ -268,8 +266,6 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
268
266
  />
269
267
  </SVG>
270
268
  }
271
- isBack={true}
272
- path="/"
273
269
  />
274
270
  <Text
275
271
  size="16"
@@ -316,7 +312,7 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
316
312
  justify="left"
317
313
  size="small"
318
314
  >
319
- <NavigationButton
315
+ <NavigationBackButton
320
316
  aria-label="Navigate to the previous view"
321
317
  icon={
322
318
  <SVG
@@ -328,8 +324,6 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
328
324
  />
329
325
  </SVG>
330
326
  }
331
- isBack={true}
332
- path="/"
333
327
  />
334
328
  <Text
335
329
  size="16"
@@ -386,5 +380,5 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
386
380
  </Card>
387
381
  </NavigatorScreen>
388
382
  </NavigatorProvider>
389
- </Modal>
383
+ </ForwardRef(Modal)>
390
384
  `;
@@ -2,13 +2,15 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useDispatch, useSelect } from '@wordpress/data';
5
- import { Button } from '@wordpress/components';
5
+ import { Button, VisuallyHidden } from '@wordpress/components';
6
6
  import { __experimentalLibrary as Library } from '@wordpress/block-editor';
7
7
  import { close } from '@wordpress/icons';
8
8
  import {
9
9
  useViewportMatch,
10
10
  __experimentalUseDialog as useDialog,
11
11
  } from '@wordpress/compose';
12
+ import { __ } from '@wordpress/i18n';
13
+ import { useEffect, useRef } from '@wordpress/element';
12
14
 
13
15
  /**
14
16
  * Internal dependencies
@@ -28,22 +30,30 @@ export default function InserterSidebar() {
28
30
  const { setIsInserterOpened } = useDispatch( editPostStore );
29
31
 
30
32
  const isMobileViewport = useViewportMatch( 'medium', '<' );
33
+ const TagName = ! isMobileViewport ? VisuallyHidden : 'div';
31
34
  const [ inserterDialogRef, inserterDialogProps ] = useDialog( {
32
35
  onClose: () => setIsInserterOpened( false ),
36
+ focusOnMount: null,
33
37
  } );
34
38
 
39
+ const libraryRef = useRef();
40
+ useEffect( () => {
41
+ libraryRef.current.focusSearch();
42
+ }, [] );
43
+
35
44
  return (
36
45
  <div
37
46
  ref={ inserterDialogRef }
38
47
  { ...inserterDialogProps }
39
48
  className="edit-post-editor__inserter-panel"
40
49
  >
41
- <div className="edit-post-editor__inserter-panel-header">
50
+ <TagName className="edit-post-editor__inserter-panel-header">
42
51
  <Button
43
52
  icon={ close }
53
+ label={ __( 'Close block inserter' ) }
44
54
  onClick={ () => setIsInserterOpened( false ) }
45
55
  />
46
- </div>
56
+ </TagName>
47
57
  <div className="edit-post-editor__inserter-panel-content">
48
58
  <Library
49
59
  showMostUsedBlocks={ showMostUsedBlocks }
@@ -54,6 +64,7 @@ export default function InserterSidebar() {
54
64
  insertionPoint.insertionIndex
55
65
  }
56
66
  __experimentalFilterValue={ insertionPoint.filterValue }
67
+ ref={ libraryRef }
57
68
  />
58
69
  </div>
59
70
  </div>
@@ -32,7 +32,8 @@ export default function ListViewSidebar() {
32
32
  }
33
33
 
34
34
  const focusOnMountRef = useFocusOnMount( 'firstElement' );
35
- const focusReturnRef = useFocusReturn();
35
+ const headerFocusReturnRef = useFocusReturn();
36
+ const contentFocusReturnRef = useFocusReturn();
36
37
  function closeOnEscape( event ) {
37
38
  if ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {
38
39
  event.preventDefault();
@@ -50,17 +51,23 @@ export default function ListViewSidebar() {
50
51
  className="edit-post-editor__list-view-panel"
51
52
  onKeyDown={ closeOnEscape }
52
53
  >
53
- <div className="edit-post-editor__list-view-panel-header">
54
- <strong id={ labelId }>{ __( 'List view' ) }</strong>
54
+ <div
55
+ className="edit-post-editor__list-view-panel-header"
56
+ ref={ headerFocusReturnRef }
57
+ >
58
+ <strong id={ labelId }>{ __( 'List View' ) }</strong>
55
59
  <Button
56
60
  icon={ closeSmall }
57
- label={ __( 'Close list view sidebar' ) }
61
+ label={ __( 'Close List View Sidebar' ) }
58
62
  onClick={ () => setIsListViewOpened( false ) }
59
63
  />
60
64
  </div>
61
65
  <div
62
66
  className="edit-post-editor__list-view-panel-content"
63
- ref={ useMergeRefs( [ focusReturnRef, focusOnMountRef ] ) }
67
+ ref={ useMergeRefs( [
68
+ contentFocusReturnRef,
69
+ focusOnMountRef,
70
+ ] ) }
64
71
  >
65
72
  <ListView
66
73
  onSelect={ selectEditorBlock }
@@ -16,10 +16,6 @@
16
16
  padding-right: $grid-unit-10;
17
17
  display: flex;
18
18
  justify-content: flex-end;
19
-
20
- @include break-medium() {
21
- display: none;
22
- }
23
19
  }
24
20
 
25
21
  .edit-post-editor__inserter-panel-content,
@@ -10,7 +10,7 @@ import {
10
10
  export function PostAuthor() {
11
11
  return (
12
12
  <PostAuthorCheck>
13
- <PanelRow>
13
+ <PanelRow className="edit-post-post-author">
14
14
  <PostAuthorForm />
15
15
  </PanelRow>
16
16
  </PostAuthorCheck>
@@ -55,6 +55,7 @@ export function TemplatePanel() {
55
55
 
56
56
  const wpTemplates = getEntityRecords( 'postType', 'wp_template', {
57
57
  post_type: currentPostType,
58
+ per_page: -1,
58
59
  } );
59
60
 
60
61
  const newAvailableTemplates = fromPairs(
@@ -22,7 +22,6 @@ import {
22
22
  __unstableUseTypingObserver as useTypingObserver,
23
23
  __unstableBlockSettingsMenuFirstItem,
24
24
  __experimentalUseResizeCanvas as useResizeCanvas,
25
- __unstableUseCanvasClickRedirect as useCanvasClickRedirect,
26
25
  __unstableEditorStyles as EditorStyles,
27
26
  useSetting,
28
27
  __experimentalLayoutStyle as LayoutStyle,
@@ -43,7 +42,14 @@ import { __ } from '@wordpress/i18n';
43
42
  import BlockInspectorButton from './block-inspector-button';
44
43
  import { store as editPostStore } from '../../store';
45
44
 
46
- function MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {
45
+ function MaybeIframe( {
46
+ children,
47
+ contentRef,
48
+ shouldIframe,
49
+ styles,
50
+ assets,
51
+ style,
52
+ } ) {
47
53
  const ref = useMouseMoveTypingReset();
48
54
 
49
55
  if ( ! shouldIframe ) {
@@ -65,6 +71,7 @@ function MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {
65
71
  return (
66
72
  <Iframe
67
73
  head={ <EditorStyles styles={ styles } /> }
74
+ assets={ assets }
68
75
  ref={ ref }
69
76
  contentRef={ contentRef }
70
77
  style={ { width: '100%', height: '100%', display: 'block' } }
@@ -107,9 +114,12 @@ export default function VisualEditor( { styles } ) {
107
114
  ( select ) => select( editPostStore ).hasMetaBoxes(),
108
115
  []
109
116
  );
110
- const themeSupportsLayout = useSelect( ( select ) => {
111
- const { getSettings } = select( blockEditorStore );
112
- return getSettings().supportsLayout;
117
+ const { themeSupportsLayout, assets } = useSelect( ( select ) => {
118
+ const _settings = select( blockEditorStore ).getSettings();
119
+ return {
120
+ themeSupportsLayout: _settings.supportsLayout,
121
+ assets: _settings.__unstableResolvedAssets,
122
+ };
113
123
  }, [] );
114
124
  const { clearSelectedBlock } = useDispatch( blockEditorStore );
115
125
  const { setIsEditingTemplate } = useDispatch( editPostStore );
@@ -153,7 +163,6 @@ export default function VisualEditor( { styles } ) {
153
163
  const contentRef = useMergeRefs( [
154
164
  ref,
155
165
  useClipboardHandler(),
156
- useCanvasClickRedirect(),
157
166
  useTypewriter(),
158
167
  useTypingObserver(),
159
168
  useBlockSelectionClearer(),
@@ -218,6 +227,7 @@ export default function VisualEditor( { styles } ) {
218
227
  }
219
228
  contentRef={ contentRef }
220
229
  styles={ styles }
230
+ assets={ assets }
221
231
  style={ { paddingBottom } }
222
232
  >
223
233
  { themeSupportsLayout && ! isTemplateMode && (
@@ -1,4 +1,5 @@
1
- .edit-post-welcome-guide {
1
+ .edit-post-welcome-guide,
2
+ .edit-template-welcome-guide {
2
3
  width: 312px;
3
4
 
4
5
  &__image {
@@ -31,3 +32,9 @@
31
32
  vertical-align: text-top;
32
33
  }
33
34
  }
35
+
36
+ .edit-template-welcome-guide {
37
+ .components-button svg {
38
+ fill: $white;
39
+ }
40
+ }
@@ -16,7 +16,7 @@ export default function WelcomeGuideTemplate() {
16
16
 
17
17
  return (
18
18
  <Guide
19
- className="edit-post-welcome-guide"
19
+ className="edit-template-welcome-guide"
20
20
  contentLabel={ __( 'Welcome to the template editor' ) }
21
21
  finishButtonText={ __( 'Get started' ) }
22
22
  onFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }
package/src/editor.js CHANGED
@@ -15,17 +15,15 @@ import {
15
15
  store as editorStore,
16
16
  } from '@wordpress/editor';
17
17
  import { StrictMode, useMemo } from '@wordpress/element';
18
- import { KeyboardShortcuts, SlotFillProvider } from '@wordpress/components';
18
+ import { SlotFillProvider } from '@wordpress/components';
19
19
  import { store as coreStore } from '@wordpress/core-data';
20
20
  import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
21
21
 
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- import preventEventDiscovery from './prevent-event-discovery';
26
25
  import Layout from './components/layout';
27
26
  import EditorInitialization from './components/editor-initialization';
28
- import EditPostSettings from './components/edit-post-settings';
29
27
  import { store as editPostStore } from './store';
30
28
 
31
29
  function Editor( {
@@ -127,6 +125,9 @@ function Editor( {
127
125
  // This is marked as experimental to give time for the quick inserter to mature.
128
126
  __experimentalSetIsInserterOpened: setIsInserterOpened,
129
127
  keepCaretInsideBlock,
128
+ // Keep a reference of the `allowedBlockTypes` from the server to handle use cases
129
+ // where we need to differentiate if a block is disabled by the user or some plugin.
130
+ defaultAllowedBlockTypes: settings.allowedBlockTypes,
130
131
  };
131
132
 
132
133
  // Omit hidden block types if exists and non-empty.
@@ -186,29 +187,24 @@ function Editor( {
186
187
  return (
187
188
  <StrictMode>
188
189
  <ShortcutProvider>
189
- <EditPostSettings.Provider value={ settings }>
190
- <SlotFillProvider>
191
- <EditorProvider
192
- settings={ editorSettings }
193
- post={ post }
194
- initialEdits={ initialEdits }
195
- useSubRegistry={ false }
196
- __unstableTemplate={
197
- isTemplateMode ? template : undefined
198
- }
199
- { ...props }
200
- >
201
- <ErrorBoundary onError={ onError }>
202
- <EditorInitialization postId={ postId } />
203
- <Layout styles={ styles } />
204
- <KeyboardShortcuts
205
- shortcuts={ preventEventDiscovery }
206
- />
207
- </ErrorBoundary>
208
- <PostLockedModal />
209
- </EditorProvider>
210
- </SlotFillProvider>
211
- </EditPostSettings.Provider>
190
+ <SlotFillProvider>
191
+ <EditorProvider
192
+ settings={ editorSettings }
193
+ post={ post }
194
+ initialEdits={ initialEdits }
195
+ useSubRegistry={ false }
196
+ __unstableTemplate={
197
+ isTemplateMode ? template : undefined
198
+ }
199
+ { ...props }
200
+ >
201
+ <ErrorBoundary onError={ onError }>
202
+ <EditorInitialization postId={ postId } />
203
+ <Layout styles={ styles } />
204
+ </ErrorBoundary>
205
+ <PostLockedModal />
206
+ </EditorProvider>
207
+ </SlotFillProvider>
212
208
  </ShortcutProvider>
213
209
  </StrictMode>
214
210
  );
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import '@wordpress/core-data';
5
5
  import '@wordpress/format-library';
6
- import { render } from '@wordpress/element';
7
6
 
8
7
  /**
9
8
  * Internal dependencies
@@ -11,8 +10,6 @@ import { render } from '@wordpress/element';
11
10
  export { store } from './store';
12
11
  import Editor from './editor';
13
12
 
14
- let editorInitialized = false;
15
-
16
13
  /**
17
14
  * Initializes the Editor and returns a componentProvider
18
15
  * that can be registered with `AppRegistry.registerComponent`
@@ -22,11 +19,5 @@ let editorInitialized = false;
22
19
  * @param {Object} postId ID of the post to edit (unused right now)
23
20
  */
24
21
  export function initializeEditor( id, postType, postId ) {
25
- if ( editorInitialized ) {
26
- return;
27
- }
28
-
29
- editorInitialized = true;
30
-
31
- render( <Editor postId={ postId } postType={ postType } />, id );
22
+ return <Editor postId={ postId } postType={ postType } />;
32
23
  }
@@ -394,7 +394,7 @@ export const getEditedPostTemplate = createRegistrySelector(
394
394
  );
395
395
  if ( currentTemplate ) {
396
396
  const templateWithSameSlug = select( coreStore )
397
- .getEntityRecords( 'postType', 'wp_template' )
397
+ .getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )
398
398
  ?.find( ( template ) => template.slug === currentTemplate );
399
399
  if ( ! templateWithSameSlug ) {
400
400
  return templateWithSameSlug;
package/src/style.scss CHANGED
@@ -59,9 +59,8 @@ body.block-editor-page {
59
59
  }
60
60
  }
61
61
 
62
- // Target the editor UI excluding the metaboxes and custom fields areas.
62
+ // Target the editor UI excluding the visual editor contents, metaboxes and custom fields areas.
63
63
  .edit-post-header,
64
- .edit-post-visual-editor,
65
64
  .edit-post-text-editor,
66
65
  .edit-post-sidebar,
67
66
  .editor-post-publish-panel,
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { mount } from 'enzyme';
5
- import { act } from 'react-dom/test-utils';
4
+ import { act, render } from 'test/helpers';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -26,11 +25,12 @@ const unsupportedBlock = `
26
25
  <!-- /wp:notablock -->
27
26
  `;
28
27
 
28
+ jest.useFakeTimers( 'legacy' );
29
+
29
30
  describe( 'Editor', () => {
30
31
  beforeAll( registerCoreBlocks );
31
32
 
32
33
  it( 'detects unsupported block and sends hasUnsupportedBlocks true to native', () => {
33
- jest.useFakeTimers();
34
34
  RNReactNativeGutenbergBridge.editorDidMount = jest.fn();
35
35
 
36
36
  const appContainer = renderEditorWith( unsupportedBlock );
@@ -51,7 +51,7 @@ describe( 'Editor', () => {
51
51
 
52
52
  // Utilities
53
53
  const renderEditorWith = ( content ) => {
54
- return mount(
54
+ return render(
55
55
  <Editor
56
56
  initialHtml={ content }
57
57
  initialHtmlModeEnabled={ false }
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _element = require("@wordpress/element");
9
-
10
- /**
11
- * WordPress dependencies
12
- */
13
- const EditPostSettings = (0, _element.createContext)({});
14
- var _default = EditPostSettings;
15
- exports.default = _default;
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/edit-post-settings/index.js"],"names":["EditPostSettings"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAG,4BAAe,EAAf,CAAzB;eACeA,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst EditPostSettings = createContext( {} );\nexport default EditPostSettings;\n"]}
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _default = {
8
- 't a l e s o f g u t e n b e r g': event => {
9
- const {
10
- ownerDocument
11
- } = event.target;
12
-
13
- if (!ownerDocument.activeElement.classList.contains('edit-post-visual-editor') && ownerDocument.activeElement !== ownerDocument.body) {
14
- return;
15
- }
16
-
17
- event.preventDefault();
18
- window.wp.data.dispatch('core/block-editor').insertBlock(window.wp.blocks.createBlock('core/paragraph', {
19
- content: '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️'
20
- }));
21
- }
22
- };
23
- exports.default = _default;
24
- //# sourceMappingURL=prevent-event-discovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/prevent-event-discovery.js"],"names":["event","ownerDocument","target","activeElement","classList","contains","body","preventDefault","window","wp","data","dispatch","insertBlock","blocks","createBlock","content"],"mappings":";;;;;;eAAe;AACd,qCAAqCA,KAAF,IAAa;AAC/C,UAAM;AAAEC,MAAAA;AAAF,QAAoBD,KAAK,CAACE,MAAhC;;AACA,QACC,CAAED,aAAa,CAACE,aAAd,CAA4BC,SAA5B,CAAsCC,QAAtC,CACD,yBADC,CAAF,IAGAJ,aAAa,CAACE,aAAd,KAAgCF,aAAa,CAACK,IAJ/C,EAKE;AACD;AACA;;AAEDN,IAAAA,KAAK,CAACO,cAAN;AACAC,IAAAA,MAAM,CAACC,EAAP,CAAUC,IAAV,CAAeC,QAAf,CAAyB,mBAAzB,EAA+CC,WAA/C,CACCJ,MAAM,CAACC,EAAP,CAAUI,MAAV,CAAiBC,WAAjB,CAA8B,gBAA9B,EAAgD;AAC/CC,MAAAA,OAAO,EACN;AAF8C,KAAhD,CADD;AAMA;AAnBa,C","sourcesContent":["export default {\n\t't a l e s o f g u t e n b e r g': ( event ) => {\n\t\tconst { ownerDocument } = event.target;\n\t\tif (\n\t\t\t! ownerDocument.activeElement.classList.contains(\n\t\t\t\t'edit-post-visual-editor'\n\t\t\t) &&\n\t\t\townerDocument.activeElement !== ownerDocument.body\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\twindow.wp.data.dispatch( 'core/block-editor' ).insertBlock(\n\t\t\twindow.wp.blocks.createBlock( 'core/paragraph', {\n\t\t\t\tcontent:\n\t\t\t\t\t'🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️',\n\t\t\t} )\n\t\t);\n\t},\n};\n"]}
@@ -1,7 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createContext } from '@wordpress/element';
5
- const EditPostSettings = createContext({});
6
- export default EditPostSettings;
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/edit-post-settings/index.js"],"names":["createContext","EditPostSettings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AAEA,MAAMC,gBAAgB,GAAGD,aAAa,CAAE,EAAF,CAAtC;AACA,eAAeC,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst EditPostSettings = createContext( {} );\nexport default EditPostSettings;\n"]}
@@ -1,17 +0,0 @@
1
- export default {
2
- 't a l e s o f g u t e n b e r g': event => {
3
- const {
4
- ownerDocument
5
- } = event.target;
6
-
7
- if (!ownerDocument.activeElement.classList.contains('edit-post-visual-editor') && ownerDocument.activeElement !== ownerDocument.body) {
8
- return;
9
- }
10
-
11
- event.preventDefault();
12
- window.wp.data.dispatch('core/block-editor').insertBlock(window.wp.blocks.createBlock('core/paragraph', {
13
- content: '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️'
14
- }));
15
- }
16
- };
17
- //# sourceMappingURL=prevent-event-discovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/prevent-event-discovery.js"],"names":["event","ownerDocument","target","activeElement","classList","contains","body","preventDefault","window","wp","data","dispatch","insertBlock","blocks","createBlock","content"],"mappings":"AAAA,eAAe;AACd,qCAAqCA,KAAF,IAAa;AAC/C,UAAM;AAAEC,MAAAA;AAAF,QAAoBD,KAAK,CAACE,MAAhC;;AACA,QACC,CAAED,aAAa,CAACE,aAAd,CAA4BC,SAA5B,CAAsCC,QAAtC,CACD,yBADC,CAAF,IAGAJ,aAAa,CAACE,aAAd,KAAgCF,aAAa,CAACK,IAJ/C,EAKE;AACD;AACA;;AAEDN,IAAAA,KAAK,CAACO,cAAN;AACAC,IAAAA,MAAM,CAACC,EAAP,CAAUC,IAAV,CAAeC,QAAf,CAAyB,mBAAzB,EAA+CC,WAA/C,CACCJ,MAAM,CAACC,EAAP,CAAUI,MAAV,CAAiBC,WAAjB,CAA8B,gBAA9B,EAAgD;AAC/CC,MAAAA,OAAO,EACN;AAF8C,KAAhD,CADD;AAMA;AAnBa,CAAf","sourcesContent":["export default {\n\t't a l e s o f g u t e n b e r g': ( event ) => {\n\t\tconst { ownerDocument } = event.target;\n\t\tif (\n\t\t\t! ownerDocument.activeElement.classList.contains(\n\t\t\t\t'edit-post-visual-editor'\n\t\t\t) &&\n\t\t\townerDocument.activeElement !== ownerDocument.body\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\twindow.wp.data.dispatch( 'core/block-editor' ).insertBlock(\n\t\t\twindow.wp.blocks.createBlock( 'core/paragraph', {\n\t\t\t\tcontent:\n\t\t\t\t\t'🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️',\n\t\t\t} )\n\t\t);\n\t},\n};\n"]}
@@ -1,7 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createContext } from '@wordpress/element';
5
-
6
- const EditPostSettings = createContext( {} );
7
- export default EditPostSettings;
@@ -1,21 +0,0 @@
1
- export default {
2
- 't a l e s o f g u t e n b e r g': ( event ) => {
3
- const { ownerDocument } = event.target;
4
- if (
5
- ! ownerDocument.activeElement.classList.contains(
6
- 'edit-post-visual-editor'
7
- ) &&
8
- ownerDocument.activeElement !== ownerDocument.body
9
- ) {
10
- return;
11
- }
12
-
13
- event.preventDefault();
14
- window.wp.data.dispatch( 'core/block-editor' ).insertBlock(
15
- window.wp.blocks.createBlock( 'core/paragraph', {
16
- content:
17
- '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️',
18
- } )
19
- );
20
- },
21
- };