@wordpress/edit-site 5.28.3 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-editor/use-site-editor-settings.js +2 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/code-editor/index.js +3 -2
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/editor/index.js +4 -4
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +1 -2
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +3 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +7 -4
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -18
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +0 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +0 -1
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +48 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/style-book/index.js +2 -0
- package/build/components/style-book/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +3 -171
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +4 -5
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +91 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build/store/actions.js +19 -50
- package/build/store/actions.js.map +1 -1
- package/build/utils/clone-deep.js +15 -0
- package/build/utils/clone-deep.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +2 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/code-editor/index.js +3 -2
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +4 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +2 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +1 -2
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +3 -1
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +6 -3
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -18
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +1 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +0 -1
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +50 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/style-book/index.js +2 -0
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -172
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +82 -0
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build-module/store/actions.js +19 -50
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/clone-deep.js +9 -0
- package/build-module/utils/clone-deep.js.map +1 -0
- package/build-style/style-rtl.css +24 -208
- package/build-style/style.css +24 -208
- package/package.json +43 -42
- package/src/components/block-editor/use-site-editor-settings.js +1 -0
- package/src/components/code-editor/index.js +3 -2
- package/src/components/editor/index.js +10 -7
- package/src/components/editor-canvas-container/index.js +2 -5
- package/src/components/{test → error-boundary/test}/error-boundary.js +7 -5
- package/src/components/global-styles/screen-revisions/style.scss +2 -2
- package/src/components/global-styles/style.scss +1 -1
- package/src/components/header-edit-mode/document-tools/index.js +1 -2
- package/src/components/header-edit-mode/index.js +1 -1
- package/src/components/header-edit-mode/more-menu/index.js +8 -3
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -11
- package/src/components/keyboard-shortcuts/register.js +0 -19
- package/src/components/layout/index.js +0 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +41 -10
- package/src/components/page-patterns/header.js +1 -0
- package/src/components/page-patterns/index.js +0 -1
- package/src/components/page-patterns/style.scss +0 -182
- package/src/components/save-button/index.js +2 -1
- package/src/components/save-hub/style.scss +1 -1
- package/src/components/sidebar/index.js +2 -1
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +5 -7
- package/src/components/sidebar-edit-mode/style.scss +4 -0
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +37 -24
- package/src/components/sidebar-edit-mode/template-panel/index.js +76 -18
- package/src/components/sidebar-edit-mode/template-panel/style.scss +5 -14
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +1 -12
- package/src/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/src/components/style-book/index.js +5 -1
- package/src/hooks/commands/use-edit-mode-commands.js +3 -184
- package/src/hooks/index.js +0 -1
- package/src/hooks/push-changes-to-global-styles/index.js +1 -4
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +964 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +92 -0
- package/src/store/actions.js +21 -85
- package/src/store/test/actions.js +0 -75
- package/src/style.scss +1 -6
- package/src/utils/clone-deep.js +8 -0
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -62
- package/build/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build/components/page-patterns/duplicate-menu-item.js +0 -93
- package/build/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build/components/page-patterns/grid-item.js +0 -223
- package/build/components/page-patterns/grid-item.js.map +0 -1
- package/build/components/page-patterns/grid.js +0 -31
- package/build/components/page-patterns/grid.js.map +0 -1
- package/build/components/page-patterns/no-patterns.js +0 -18
- package/build/components/page-patterns/no-patterns.js.map +0 -1
- package/build/components/page-patterns/patterns-list.js +0 -168
- package/build/components/page-patterns/patterns-list.js.map +0 -1
- package/build/components/page-patterns/rename-menu-item.js +0 -105
- package/build/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -83
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build/hooks/navigation-menu-edit.js +0 -82
- package/build/hooks/navigation-menu-edit.js.map +0 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -56
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +0 -85
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build-module/components/page-patterns/grid-item.js +0 -215
- package/build-module/components/page-patterns/grid-item.js.map +0 -1
- package/build-module/components/page-patterns/grid.js +0 -23
- package/build-module/components/page-patterns/grid.js.map +0 -1
- package/build-module/components/page-patterns/no-patterns.js +0 -11
- package/build-module/components/page-patterns/no-patterns.js.map +0 -1
- package/build-module/components/page-patterns/patterns-list.js +0 -160
- package/build-module/components/page-patterns/patterns-list.js.map +0 -1
- package/build-module/components/page-patterns/rename-menu-item.js +0 -98
- package/build-module/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -76
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build-module/hooks/navigation-menu-edit.js +0 -75
- package/build-module/hooks/navigation-menu-edit.js.map +0 -1
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -60
- package/src/components/page-patterns/duplicate-menu-item.js +0 -105
- package/src/components/page-patterns/grid-item.js +0 -331
- package/src/components/page-patterns/grid.js +0 -22
- package/src/components/page-patterns/no-patterns.js +0 -12
- package/src/components/page-patterns/patterns-list.js +0 -229
- package/src/components/page-patterns/rename-menu-item.js +0 -132
- package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -89
- package/src/hooks/navigation-menu-edit.js +0 -92
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useMemo } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';
|
|
10
|
+
import cloneDeep from '../../utils/clone-deep';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns a new object, with properties specified in `property`,
|
|
14
|
+
* maintain the original object tree structure.
|
|
15
|
+
* The function is recursive, so it will perform a deep search for the given property.
|
|
16
|
+
* E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} object The object to filter
|
|
19
|
+
* @param {Object} property The property to filter by
|
|
20
|
+
* @return {Object} The merged object.
|
|
21
|
+
*/
|
|
22
|
+
export const filterObjectByProperty = ( object, property ) => {
|
|
23
|
+
if ( ! object ) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const newObject = {};
|
|
28
|
+
Object.keys( object ).forEach( ( key ) => {
|
|
29
|
+
if ( key === property ) {
|
|
30
|
+
newObject[ key ] = object[ key ];
|
|
31
|
+
} else if ( typeof object[ key ] === 'object' ) {
|
|
32
|
+
const newFilter = filterObjectByProperty( object[ key ], property );
|
|
33
|
+
if ( Object.keys( newFilter ).length ) {
|
|
34
|
+
newObject[ key ] = newFilter;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} );
|
|
38
|
+
return newObject;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns a new object with only the properties specified in `property`.
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} props Object of hook args.
|
|
45
|
+
* @param {Object[]} props.variations The theme style variations to filter.
|
|
46
|
+
* @param {string} props.property The property to filter by.
|
|
47
|
+
* @param {Function} props.filter Optional. The filter function to apply to the variations.
|
|
48
|
+
* @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.
|
|
49
|
+
* @return {Object[]|*} The merged object.
|
|
50
|
+
*/
|
|
51
|
+
export default function useThemeStyleVariationsByProperty( {
|
|
52
|
+
variations,
|
|
53
|
+
property,
|
|
54
|
+
filter,
|
|
55
|
+
baseVariation,
|
|
56
|
+
} ) {
|
|
57
|
+
return useMemo( () => {
|
|
58
|
+
if ( ! property || ! variations || variations?.length === 0 ) {
|
|
59
|
+
return variations;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const clonedBaseVariation =
|
|
63
|
+
typeof baseVariation === 'object' &&
|
|
64
|
+
Object.keys( baseVariation ).length > 0
|
|
65
|
+
? cloneDeep( baseVariation )
|
|
66
|
+
: null;
|
|
67
|
+
|
|
68
|
+
let processedStyleVariations = variations.map( ( variation ) => {
|
|
69
|
+
let result = {
|
|
70
|
+
...filterObjectByProperty( cloneDeep( variation ), property ),
|
|
71
|
+
title: variation?.title,
|
|
72
|
+
description: variation?.description,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
if ( clonedBaseVariation ) {
|
|
76
|
+
/*
|
|
77
|
+
* Overwrites all baseVariation object `styleProperty` properties
|
|
78
|
+
* with the theme variation `styleProperty` properties.
|
|
79
|
+
*/
|
|
80
|
+
result = mergeBaseAndUserConfigs( clonedBaseVariation, result );
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
} );
|
|
84
|
+
|
|
85
|
+
if ( 'function' === typeof filter ) {
|
|
86
|
+
processedStyleVariations =
|
|
87
|
+
processedStyleVariations.filter( filter );
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return processedStyleVariations;
|
|
91
|
+
}, [ variations, property, baseVariation, filter ] );
|
|
92
|
+
}
|
package/src/store/actions.js
CHANGED
|
@@ -11,7 +11,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
11
11
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
12
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
13
|
import { store as editorStore } from '@wordpress/editor';
|
|
14
|
-
import { speak } from '@wordpress/a11y';
|
|
15
14
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -477,13 +476,7 @@ export const revertTemplate =
|
|
|
477
476
|
*/
|
|
478
477
|
export const openGeneralSidebar =
|
|
479
478
|
( name ) =>
|
|
480
|
-
( {
|
|
481
|
-
const isDistractionFree = registry
|
|
482
|
-
.select( preferencesStore )
|
|
483
|
-
.get( 'core', 'distractionFree' );
|
|
484
|
-
if ( isDistractionFree ) {
|
|
485
|
-
dispatch.toggleDistractionFree();
|
|
486
|
-
}
|
|
479
|
+
( { registry } ) => {
|
|
487
480
|
registry
|
|
488
481
|
.dispatch( interfaceStore )
|
|
489
482
|
.enableComplementaryArea( editSiteStoreName, name );
|
|
@@ -500,29 +493,21 @@ export const closeGeneralSidebar =
|
|
|
500
493
|
.disableComplementaryArea( editSiteStoreName );
|
|
501
494
|
};
|
|
502
495
|
|
|
496
|
+
/**
|
|
497
|
+
* Triggers an action used to switch editor mode.
|
|
498
|
+
*
|
|
499
|
+
* @deprecated
|
|
500
|
+
*
|
|
501
|
+
* @param {string} mode The editor mode.
|
|
502
|
+
*/
|
|
503
503
|
export const switchEditorMode =
|
|
504
504
|
( mode ) =>
|
|
505
|
-
( {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if ( mode !== 'visual' ) {
|
|
512
|
-
registry.dispatch( blockEditorStore ).clearSelectedBlock();
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
if ( mode === 'visual' ) {
|
|
516
|
-
speak( __( 'Visual editor selected' ), 'assertive' );
|
|
517
|
-
} else if ( mode === 'text' ) {
|
|
518
|
-
const isDistractionFree = registry
|
|
519
|
-
.select( preferencesStore )
|
|
520
|
-
.get( 'core', 'distractionFree' );
|
|
521
|
-
if ( isDistractionFree ) {
|
|
522
|
-
dispatch.toggleDistractionFree();
|
|
523
|
-
}
|
|
524
|
-
speak( __( 'Code editor selected' ), 'assertive' );
|
|
525
|
-
}
|
|
505
|
+
( { registry } ) => {
|
|
506
|
+
deprecated( "dispatch( 'core/edit-site' ).switchEditorMode", {
|
|
507
|
+
since: '6.6',
|
|
508
|
+
alternative: "dispatch( 'core/editor').switchEditorMode",
|
|
509
|
+
} );
|
|
510
|
+
registry.dispatch( editorStore ).switchEditorMode( mode );
|
|
526
511
|
};
|
|
527
512
|
|
|
528
513
|
/**
|
|
@@ -552,64 +537,15 @@ export const setHasPageContentFocus =
|
|
|
552
537
|
* Action that toggles Distraction free mode.
|
|
553
538
|
* Distraction free mode expects there are no sidebars, as due to the
|
|
554
539
|
* z-index values set, you can't close sidebars.
|
|
540
|
+
*
|
|
541
|
+
* @deprecated
|
|
555
542
|
*/
|
|
556
543
|
export const toggleDistractionFree =
|
|
557
544
|
() =>
|
|
558
|
-
( {
|
|
559
|
-
|
|
560
|
-
.
|
|
561
|
-
|
|
562
|
-
if ( isDistractionFree ) {
|
|
563
|
-
registry
|
|
564
|
-
.dispatch( preferencesStore )
|
|
565
|
-
.set( 'core', 'fixedToolbar', false );
|
|
566
|
-
}
|
|
567
|
-
if ( ! isDistractionFree ) {
|
|
568
|
-
registry.batch( () => {
|
|
569
|
-
registry
|
|
570
|
-
.dispatch( preferencesStore )
|
|
571
|
-
.set( 'core', 'fixedToolbar', true );
|
|
572
|
-
registry.dispatch( editorStore ).setIsInserterOpened( false );
|
|
573
|
-
registry.dispatch( editorStore ).setIsListViewOpened( false );
|
|
574
|
-
dispatch.closeGeneralSidebar();
|
|
575
|
-
} );
|
|
576
|
-
}
|
|
577
|
-
registry.batch( () => {
|
|
578
|
-
registry
|
|
579
|
-
.dispatch( preferencesStore )
|
|
580
|
-
.set( 'core', 'distractionFree', ! isDistractionFree );
|
|
581
|
-
registry
|
|
582
|
-
.dispatch( noticesStore )
|
|
583
|
-
.createInfoNotice(
|
|
584
|
-
isDistractionFree
|
|
585
|
-
? __( 'Distraction free off.' )
|
|
586
|
-
: __( 'Distraction free on.' ),
|
|
587
|
-
{
|
|
588
|
-
id: 'core/edit-site/distraction-free-mode/notice',
|
|
589
|
-
type: 'snackbar',
|
|
590
|
-
actions: [
|
|
591
|
-
{
|
|
592
|
-
label: __( 'Undo' ),
|
|
593
|
-
onClick: () => {
|
|
594
|
-
registry.batch( () => {
|
|
595
|
-
registry
|
|
596
|
-
.dispatch( preferencesStore )
|
|
597
|
-
.set(
|
|
598
|
-
'core',
|
|
599
|
-
'fixedToolbar',
|
|
600
|
-
isDistractionFree ? true : false
|
|
601
|
-
);
|
|
602
|
-
registry
|
|
603
|
-
.dispatch( preferencesStore )
|
|
604
|
-
.toggle(
|
|
605
|
-
'core',
|
|
606
|
-
'distractionFree'
|
|
607
|
-
);
|
|
608
|
-
} );
|
|
609
|
-
},
|
|
610
|
-
},
|
|
611
|
-
],
|
|
612
|
-
}
|
|
613
|
-
);
|
|
545
|
+
( { registry } ) => {
|
|
546
|
+
deprecated( "dispatch( 'core/edit-site' ).toggleDistractionFree", {
|
|
547
|
+
since: '6.6',
|
|
548
|
+
alternative: "dispatch( 'core/editor').toggleDistractionFree",
|
|
614
549
|
} );
|
|
550
|
+
registry.dispatch( editorStore ).toggleDistractionFree();
|
|
615
551
|
};
|
|
@@ -75,79 +75,4 @@ describe( 'actions', () => {
|
|
|
75
75
|
expect( select.getEditedPostType() ).toBe( 'wp_template_part' );
|
|
76
76
|
} );
|
|
77
77
|
} );
|
|
78
|
-
|
|
79
|
-
describe( 'openGeneralSidebar', () => {
|
|
80
|
-
it( 'should turn off distraction free mode when opening a general sidebar', () => {
|
|
81
|
-
const registry = createRegistryWithStores();
|
|
82
|
-
registry
|
|
83
|
-
.dispatch( preferencesStore )
|
|
84
|
-
.set( 'core', 'distractionFree', true );
|
|
85
|
-
registry
|
|
86
|
-
.dispatch( editSiteStore )
|
|
87
|
-
.openGeneralSidebar( 'edit-site/global-styles' );
|
|
88
|
-
expect(
|
|
89
|
-
registry
|
|
90
|
-
.select( preferencesStore )
|
|
91
|
-
.get( 'core', 'distractionFree' )
|
|
92
|
-
).toBe( false );
|
|
93
|
-
} );
|
|
94
|
-
} );
|
|
95
|
-
|
|
96
|
-
describe( 'switchEditorMode', () => {
|
|
97
|
-
it( 'should turn off distraction free mode when switching to code editor', () => {
|
|
98
|
-
const registry = createRegistryWithStores();
|
|
99
|
-
registry
|
|
100
|
-
.dispatch( preferencesStore )
|
|
101
|
-
.set( 'core', 'distractionFree', true );
|
|
102
|
-
registry.dispatch( editSiteStore ).switchEditorMode( 'visual' );
|
|
103
|
-
expect(
|
|
104
|
-
registry
|
|
105
|
-
.select( preferencesStore )
|
|
106
|
-
.get( 'core', 'distractionFree' )
|
|
107
|
-
).toBe( true );
|
|
108
|
-
registry.dispatch( editSiteStore ).switchEditorMode( 'text' );
|
|
109
|
-
expect(
|
|
110
|
-
registry
|
|
111
|
-
.select( preferencesStore )
|
|
112
|
-
.get( 'core', 'distractionFree' )
|
|
113
|
-
).toBe( false );
|
|
114
|
-
} );
|
|
115
|
-
} );
|
|
116
|
-
|
|
117
|
-
describe( 'toggleDistractionFree', () => {
|
|
118
|
-
it( 'should properly update settings to prevent layout corruption when enabling distraction free mode', () => {
|
|
119
|
-
const registry = createRegistryWithStores();
|
|
120
|
-
// Enable everything that shouldn't be enabled in distraction free mode.
|
|
121
|
-
registry
|
|
122
|
-
.dispatch( preferencesStore )
|
|
123
|
-
.set( 'core', 'fixedToolbar', true );
|
|
124
|
-
registry.dispatch( editorStore ).setIsListViewOpened( true );
|
|
125
|
-
registry
|
|
126
|
-
.dispatch( editSiteStore )
|
|
127
|
-
.openGeneralSidebar( 'edit-site/global-styles' );
|
|
128
|
-
// Initial state is falsy.
|
|
129
|
-
registry.dispatch( editSiteStore ).toggleDistractionFree();
|
|
130
|
-
expect(
|
|
131
|
-
registry
|
|
132
|
-
.select( preferencesStore )
|
|
133
|
-
.get( 'core', 'fixedToolbar' )
|
|
134
|
-
).toBe( true );
|
|
135
|
-
expect( registry.select( editorStore ).isListViewOpened() ).toBe(
|
|
136
|
-
false
|
|
137
|
-
);
|
|
138
|
-
expect( registry.select( editorStore ).isInserterOpened() ).toBe(
|
|
139
|
-
false
|
|
140
|
-
);
|
|
141
|
-
expect(
|
|
142
|
-
registry
|
|
143
|
-
.select( interfaceStore )
|
|
144
|
-
.getActiveComplementaryArea( editSiteStore.name )
|
|
145
|
-
).toBeNull();
|
|
146
|
-
expect(
|
|
147
|
-
registry
|
|
148
|
-
.select( preferencesStore )
|
|
149
|
-
.get( 'core', 'distractionFree' )
|
|
150
|
-
).toBe( true );
|
|
151
|
-
} );
|
|
152
|
-
} );
|
|
153
78
|
} );
|
package/src/style.scss
CHANGED
|
@@ -67,13 +67,8 @@ body.js.site-editor-php {
|
|
|
67
67
|
background: $gray-900;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.edit-site,
|
|
71
|
-
// The modals are shown outside the .edit-site wrapper, they need these styles.
|
|
72
|
-
.components-modal__frame {
|
|
73
|
-
@include reset;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
70
|
.edit-site {
|
|
71
|
+
@include reset;
|
|
77
72
|
height: 100vh;
|
|
78
73
|
|
|
79
74
|
// On mobile the main content area has to scroll, otherwise you can invoke
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes a copy of an object without storing any references to the original object.
|
|
3
|
+
* @param {Object} object
|
|
4
|
+
* @return {Object} The cloned object.
|
|
5
|
+
*/
|
|
6
|
+
export default function cloneDeep( object ) {
|
|
7
|
+
return ! object ? {} : JSON.parse( JSON.stringify( object ) );
|
|
8
|
+
}
|
|
@@ -1,62 +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 _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
12
|
-
var _store = require("../../../store");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Set of available mode options.
|
|
23
|
-
*
|
|
24
|
-
* @type {Array}
|
|
25
|
-
*/
|
|
26
|
-
const MODES = [{
|
|
27
|
-
value: 'visual',
|
|
28
|
-
label: (0, _i18n.__)('Visual editor')
|
|
29
|
-
}, {
|
|
30
|
-
value: 'text',
|
|
31
|
-
label: (0, _i18n.__)('Code editor')
|
|
32
|
-
}];
|
|
33
|
-
function ModeSwitcher() {
|
|
34
|
-
const {
|
|
35
|
-
shortcut,
|
|
36
|
-
mode
|
|
37
|
-
} = (0, _data.useSelect)(select => ({
|
|
38
|
-
shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-site/toggle-mode'),
|
|
39
|
-
mode: select(_store.store).getEditorMode()
|
|
40
|
-
}), []);
|
|
41
|
-
const {
|
|
42
|
-
switchEditorMode
|
|
43
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
44
|
-
const choices = MODES.map(choice => {
|
|
45
|
-
if (choice.value !== mode) {
|
|
46
|
-
return {
|
|
47
|
-
...choice,
|
|
48
|
-
shortcut
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return choice;
|
|
52
|
-
});
|
|
53
|
-
return (0, _react.createElement)(_components.MenuGroup, {
|
|
54
|
-
label: (0, _i18n.__)('Editor')
|
|
55
|
-
}, (0, _react.createElement)(_components.MenuItemsChoice, {
|
|
56
|
-
choices: choices,
|
|
57
|
-
value: mode,
|
|
58
|
-
onSelect: switchEditorMode
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
var _default = exports.default = ModeSwitcher;
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_keyboardShortcuts","_store","MODES","value","label","__","ModeSwitcher","shortcut","mode","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editSiteStore","getEditorMode","switchEditorMode","useDispatch","choices","map","choice","_react","createElement","MenuGroup","MenuItemsChoice","onSelect","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst { shortcut, mode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-site/toggle-mode' ),\n\t\t\tmode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( choice.value !== mode ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ mode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMK,KAAK,GAAG,CACb;EACCC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB;AAC5B,CAAC,EACD;EACCF,KAAK,EAAE,MAAM;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,aAAc;AAC1B,CAAC,CACD;AAED,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAM;IAAEC,QAAQ;IAAEC;EAAK,CAAC,GAAG,IAAAC,eAAS,EACjCC,MAAM,KAAQ;IACfH,QAAQ,EAAEG,MAAM,CACfC,wBACD,CAAC,CAACC,yBAAyB,CAAE,4BAA6B,CAAC;IAC3DJ,IAAI,EAAEE,MAAM,CAAEG,YAAc,CAAC,CAACC,aAAa,CAAC;EAC7C,CAAC,CAAE,EACH,EACD,CAAC;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAc,CAAC;EAEzD,MAAMI,OAAO,GAAGf,KAAK,CAACgB,GAAG,CAAIC,MAAM,IAAM;IACxC,IAAKA,MAAM,CAAChB,KAAK,KAAKK,IAAI,EAAG;MAC5B,OAAO;QAAE,GAAGW,MAAM;QAAEZ;MAAS,CAAC;IAC/B;IACA,OAAOY,MAAM;EACd,CAAE,CAAC;EAEH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACvB,WAAA,CAAAwB,SAAS;IAAClB,KAAK,EAAG,IAAAC,QAAE,EAAE,QAAS;EAAG,GAClC,IAAAe,MAAA,CAAAC,aAAA,EAACvB,WAAA,CAAAyB,eAAe;IACfN,OAAO,EAAGA,OAAS;IACnBd,KAAK,EAAGK,IAAM;IACdgB,QAAQ,EAAGT;EAAkB,CAC7B,CACS,CAAC;AAEd;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrB,YAAY"}
|
|
@@ -1,93 +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 = DuplicateMenuItem;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _element = require("@wordpress/element");
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
var _notices = require("@wordpress/notices");
|
|
14
|
-
var _patterns = require("@wordpress/patterns");
|
|
15
|
-
var _router = require("@wordpress/router");
|
|
16
|
-
var _constants = require("../../utils/constants");
|
|
17
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
18
|
-
var _createTemplatePartModal = _interopRequireDefault(require("../create-template-part-modal"));
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
DuplicatePatternModal
|
|
29
|
-
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
30
|
-
const {
|
|
31
|
-
useHistory
|
|
32
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
33
|
-
function DuplicateMenuItem({
|
|
34
|
-
categoryId,
|
|
35
|
-
item,
|
|
36
|
-
label = (0, _i18n.__)('Duplicate'),
|
|
37
|
-
onClose
|
|
38
|
-
}) {
|
|
39
|
-
const {
|
|
40
|
-
createSuccessNotice
|
|
41
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
42
|
-
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
|
|
43
|
-
const history = useHistory();
|
|
44
|
-
const closeModal = () => setIsModalOpen(false);
|
|
45
|
-
const isTemplatePart = item.type === _constants.TEMPLATE_PART_POST_TYPE;
|
|
46
|
-
const isThemePattern = item.type === _constants.PATTERN_TYPES.theme;
|
|
47
|
-
async function onTemplatePartSuccess(templatePart) {
|
|
48
|
-
createSuccessNotice((0, _i18n.sprintf)(
|
|
49
|
-
// translators: %s: The new template part's title e.g. 'Call to action (copy)'.
|
|
50
|
-
(0, _i18n.__)('"%s" duplicated.'), item.title), {
|
|
51
|
-
type: 'snackbar',
|
|
52
|
-
id: 'edit-site-patterns-success'
|
|
53
|
-
});
|
|
54
|
-
history.push({
|
|
55
|
-
postType: _constants.TEMPLATE_PART_POST_TYPE,
|
|
56
|
-
postId: templatePart?.id,
|
|
57
|
-
categoryType: _constants.TEMPLATE_PART_POST_TYPE,
|
|
58
|
-
categoryId
|
|
59
|
-
});
|
|
60
|
-
onClose();
|
|
61
|
-
}
|
|
62
|
-
function onPatternSuccess({
|
|
63
|
-
pattern
|
|
64
|
-
}) {
|
|
65
|
-
history.push({
|
|
66
|
-
categoryType: _constants.PATTERN_TYPES.theme,
|
|
67
|
-
categoryId,
|
|
68
|
-
postType: _constants.PATTERN_TYPES.user,
|
|
69
|
-
postId: pattern.id
|
|
70
|
-
});
|
|
71
|
-
onClose();
|
|
72
|
-
}
|
|
73
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuItem, {
|
|
74
|
-
onClick: () => setIsModalOpen(true),
|
|
75
|
-
"aria-expanded": isModalOpen,
|
|
76
|
-
"aria-haspopup": "dialog"
|
|
77
|
-
}, label), isModalOpen && !isTemplatePart && (0, _react.createElement)(DuplicatePatternModal, {
|
|
78
|
-
onClose: closeModal,
|
|
79
|
-
onSuccess: onPatternSuccess,
|
|
80
|
-
pattern: isThemePattern ? item : item.patternPost
|
|
81
|
-
}), isModalOpen && isTemplatePart && (0, _react.createElement)(_createTemplatePartModal.default, {
|
|
82
|
-
blocks: item.blocks,
|
|
83
|
-
closeModal: closeModal,
|
|
84
|
-
confirmLabel: (0, _i18n.__)('Duplicate'),
|
|
85
|
-
defaultArea: item.templatePart.area,
|
|
86
|
-
defaultTitle: (0, _i18n.sprintf)( /* translators: %s: Existing template part title */
|
|
87
|
-
(0, _i18n.__)('%s (Copy)'), item.title),
|
|
88
|
-
modalTitle: (0, _i18n.__)('Duplicate template part'),
|
|
89
|
-
onCreate: onTemplatePartSuccess,
|
|
90
|
-
onError: closeModal
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=duplicate-menu-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_element","_i18n","_notices","_patterns","_router","_constants","_lockUnlock","_createTemplatePartModal","_interopRequireDefault","DuplicatePatternModal","unlock","patternsPrivateApis","useHistory","routerPrivateApis","DuplicateMenuItem","categoryId","item","label","__","onClose","createSuccessNotice","useDispatch","noticesStore","isModalOpen","setIsModalOpen","useState","history","closeModal","isTemplatePart","type","TEMPLATE_PART_POST_TYPE","isThemePattern","PATTERN_TYPES","theme","onTemplatePartSuccess","templatePart","sprintf","title","id","push","postType","postId","categoryType","onPatternSuccess","pattern","user","_react","createElement","Fragment","MenuItem","onClick","onSuccess","patternPost","default","blocks","confirmLabel","defaultArea","area","defaultTitle","modalTitle","onCreate","onError"],"sources":["@wordpress/edit-site/src/components/page-patterns/duplicate-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport CreateTemplatePartModal from '../create-template-part-modal';\n\nconst { DuplicatePatternModal } = unlock( patternsPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function DuplicateMenuItem( {\n\tcategoryId,\n\titem,\n\tlabel = __( 'Duplicate' ),\n\tonClose,\n} ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst history = useHistory();\n\n\tconst closeModal = () => setIsModalOpen( false );\n\n\tconst isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;\n\tconst isThemePattern = item.type === PATTERN_TYPES.theme;\n\n\tasync function onTemplatePartSuccess( templatePart ) {\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s: The new template part's title e.g. 'Call to action (copy)'.\n\t\t\t\t__( '\"%s\" duplicated.' ),\n\t\t\t\titem.title\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'edit-site-patterns-success',\n\t\t\t}\n\t\t);\n\n\t\thistory.push( {\n\t\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\t\tpostId: templatePart?.id,\n\t\t\tcategoryType: TEMPLATE_PART_POST_TYPE,\n\t\t\tcategoryId,\n\t\t} );\n\n\t\tonClose();\n\t}\n\n\tfunction onPatternSuccess( { pattern } ) {\n\t\thistory.push( {\n\t\t\tcategoryType: PATTERN_TYPES.theme,\n\t\t\tcategoryId,\n\t\t\tpostType: PATTERN_TYPES.user,\n\t\t\tpostId: pattern.id,\n\t\t} );\n\n\t\tonClose();\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => setIsModalOpen( true ) }\n\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && ! isTemplatePart && (\n\t\t\t\t<DuplicatePatternModal\n\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\tonSuccess={ onPatternSuccess }\n\t\t\t\t\tpattern={ isThemePattern ? item : item.patternPost }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isModalOpen && isTemplatePart && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tblocks={ item.blocks }\n\t\t\t\t\tcloseModal={ closeModal }\n\t\t\t\t\tconfirmLabel={ __( 'Duplicate' ) }\n\t\t\t\t\tdefaultArea={ item.templatePart.area }\n\t\t\t\t\tdefaultTitle={ sprintf(\n\t\t\t\t\t\t/* translators: %s: Existing template part title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\titem.title\n\t\t\t\t\t) }\n\t\t\t\t\tmodalTitle={ __( 'Duplicate template part' ) }\n\t\t\t\t\tonCreate={ on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