@wordpress/edit-site 3.0.9 → 3.0.10
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/build/components/add-new-template/index.js +49 -0
- package/build/components/add-new-template/index.js.map +1 -0
- package/build/components/add-new-template/new-template-part.js +79 -0
- package/build/components/add-new-template/new-template-part.js.map +1 -0
- package/build/components/add-new-template/new-template.js +115 -0
- package/build/components/add-new-template/new-template.js.map +1 -0
- package/build/components/create-template-part-modal/index.js +115 -0
- package/build/components/create-template-part-modal/index.js.map +1 -0
- package/build/components/editor/index.js +11 -13
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +4 -4
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/hooks.js +27 -25
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +9 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/index.js +1 -5
- package/build/components/header/index.js.map +1 -1
- package/build/components/list/header.js +50 -0
- package/build/components/list/header.js.map +1 -0
- package/build/components/list/index.js +55 -0
- package/build/components/list/index.js.map +1 -0
- package/build/components/list/table.js +128 -0
- package/build/components/list/table.js.map +1 -0
- package/build/components/navigation-sidebar/index.js +11 -10
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +33 -53
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +3 -24
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/template-details/index.js +3 -2
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +20 -84
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/welcome-guide/editor.js +58 -0
- package/build/components/welcome-guide/editor.js.map +1 -0
- package/build/components/welcome-guide/image.js +27 -0
- package/build/components/welcome-guide/image.js.map +1 -0
- package/build/components/welcome-guide/index.js +49 -0
- package/build/components/welcome-guide/index.js.map +1 -0
- package/build/components/welcome-guide/styles.js +83 -0
- package/build/components/welcome-guide/styles.js.map +1 -0
- package/build/index.js +29 -5
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +4 -2
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item.js +39 -0
- package/build/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build/store/actions.js +5 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +4 -1
- package/build/store/defaults.js.map +1 -1
- package/build/utils/is-template-removable.js +21 -0
- package/build/utils/is-template-removable.js.map +1 -0
- package/build-module/components/add-new-template/index.js +36 -0
- package/build-module/components/add-new-template/index.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +66 -0
- package/build-module/components/add-new-template/new-template-part.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +98 -0
- package/build-module/components/add-new-template/new-template.js.map +1 -0
- package/build-module/components/create-template-part-modal/index.js +102 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -0
- package/build-module/components/editor/index.js +9 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +4 -4
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +28 -26
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +7 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/index.js +1 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/list/header.js +37 -0
- package/build-module/components/list/header.js.map +1 -0
- package/build-module/components/list/index.js +40 -0
- package/build-module/components/list/index.js.map +1 -0
- package/build-module/components/list/table.js +112 -0
- package/build-module/components/list/table.js.map +1 -0
- package/build-module/components/navigation-sidebar/index.js +12 -8
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +35 -53
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +4 -24
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/template-details/index.js +3 -2
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +20 -84
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +45 -0
- package/build-module/components/welcome-guide/editor.js.map +1 -0
- package/build-module/components/welcome-guide/image.js +19 -0
- package/build-module/components/welcome-guide/image.js.map +1 -0
- package/build-module/components/welcome-guide/index.js +35 -0
- package/build-module/components/welcome-guide/index.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +69 -0
- package/build-module/components/welcome-guide/styles.js.map +1 -0
- package/build-module/index.js +21 -1
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +3 -2
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item.js +27 -0
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build-module/store/actions.js +5 -8
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +4 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/utils/is-template-removable.js +14 -0
- package/build-module/utils/is-template-removable.js.map +1 -0
- package/build-style/style-rtl.css +348 -32
- package/build-style/style.css +348 -32
- package/package.json +7 -7
- package/src/components/add-new-template/index.js +30 -0
- package/src/components/add-new-template/new-template-part.js +67 -0
- package/src/components/add-new-template/new-template.js +117 -0
- package/src/components/add-new-template/style.scss +11 -0
- package/src/components/create-template-part-modal/index.js +132 -0
- package/src/components/{template-part-converter → create-template-part-modal}/style.scss +9 -9
- package/src/components/editor/index.js +10 -14
- package/src/components/editor/style.scss +8 -0
- package/src/components/global-styles/global-styles-provider.js +4 -3
- package/src/components/global-styles/hooks.js +58 -26
- package/src/components/global-styles/screen-block-list.js +11 -1
- package/src/components/global-styles/test/use-global-styles-output.js +2 -2
- package/src/components/global-styles/use-global-styles-output.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/header/index.js +0 -6
- package/src/components/list/header.js +34 -0
- package/src/components/list/index.js +38 -0
- package/src/components/list/style.scss +113 -0
- package/src/components/list/table.js +133 -0
- package/src/components/navigation-sidebar/index.js +15 -8
- package/src/components/navigation-sidebar/navigation-panel/index.js +44 -55
- package/src/components/navigation-sidebar/navigation-panel/style.scss +4 -2
- package/src/components/navigation-sidebar/navigation-toggle/index.js +4 -28
- package/src/components/template-details/index.js +3 -2
- package/src/components/template-part-converter/convert-to-template-part.js +20 -140
- package/src/components/welcome-guide/editor.js +63 -0
- package/src/components/welcome-guide/image.js +11 -0
- package/src/components/welcome-guide/index.js +33 -0
- package/src/components/welcome-guide/style.scss +37 -0
- package/src/components/welcome-guide/styles.js +116 -0
- package/src/index.js +21 -1
- package/src/plugins/index.js +3 -1
- package/src/plugins/welcome-guide-menu-item.js +35 -0
- package/src/store/actions.js +11 -9
- package/src/store/defaults.js +4 -1
- package/src/store/test/actions.js +14 -20
- package/src/style.scss +9 -6
- package/src/utils/is-template-removable.js +13 -0
- package/build/components/header/navigation-link/index.js +0 -87
- package/build/components/header/navigation-link/index.js.map +0 -1
- package/build-module/components/header/navigation-link/index.js +0 -74
- package/build-module/components/header/navigation-link/index.js.map +0 -1
- package/src/components/header/navigation-link/index.js +0 -71
- package/src/components/header/navigation-link/style.scss +0 -69
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -15,8 +17,6 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
15
17
|
|
|
16
18
|
var _components = require("@wordpress/components");
|
|
17
19
|
|
|
18
|
-
var _compose = require("@wordpress/compose");
|
|
19
|
-
|
|
20
20
|
var _blocks = require("@wordpress/blocks");
|
|
21
21
|
|
|
22
22
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -25,11 +25,7 @@ var _coreData = require("@wordpress/core-data");
|
|
|
25
25
|
|
|
26
26
|
var _notices = require("@wordpress/notices");
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var _icons = require("@wordpress/icons");
|
|
31
|
-
|
|
32
|
-
var _constants = require("../../store/constants");
|
|
28
|
+
var _createTemplatePartModal = _interopRequireDefault(require("../create-template-part-modal"));
|
|
33
29
|
|
|
34
30
|
/**
|
|
35
31
|
* External dependencies
|
|
@@ -47,9 +43,7 @@ function ConvertToTemplatePart(_ref) {
|
|
|
47
43
|
clientIds,
|
|
48
44
|
blocks
|
|
49
45
|
} = _ref;
|
|
50
|
-
const instanceId = (0, _compose.useInstanceId)(ConvertToTemplatePart);
|
|
51
46
|
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
|
|
52
|
-
const [title, setTitle] = (0, _element.useState)('');
|
|
53
47
|
const {
|
|
54
48
|
replaceBlocks
|
|
55
49
|
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
@@ -59,14 +53,15 @@ function ConvertToTemplatePart(_ref) {
|
|
|
59
53
|
const {
|
|
60
54
|
createSuccessNotice
|
|
61
55
|
} = (0, _data.useDispatch)(_notices.store);
|
|
62
|
-
const [area, setArea] = (0, _element.useState)(_constants.TEMPLATE_PART_AREA_GENERAL);
|
|
63
|
-
const templatePartAreas = (0, _data.useSelect)(select => select(_editor.store).__experimentalGetDefaultTemplatePartAreas(), []);
|
|
64
56
|
|
|
65
|
-
const onConvert = async
|
|
66
|
-
|
|
57
|
+
const onConvert = async _ref2 => {
|
|
58
|
+
let {
|
|
59
|
+
title,
|
|
60
|
+
area
|
|
61
|
+
} = _ref2;
|
|
67
62
|
const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
|
|
68
|
-
slug: (0, _lodash.kebabCase)(
|
|
69
|
-
title
|
|
63
|
+
slug: (0, _lodash.kebabCase)(title),
|
|
64
|
+
title,
|
|
70
65
|
content: (0, _blocks.serialize)(blocks),
|
|
71
66
|
area
|
|
72
67
|
});
|
|
@@ -79,80 +74,21 @@ function ConvertToTemplatePart(_ref) {
|
|
|
79
74
|
});
|
|
80
75
|
};
|
|
81
76
|
|
|
82
|
-
return (0, _element.createElement)(_blockEditor.BlockSettingsMenuControls, null,
|
|
77
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockSettingsMenuControls, null, _ref3 => {
|
|
83
78
|
let {
|
|
84
79
|
onClose
|
|
85
|
-
} =
|
|
86
|
-
return (0, _element.createElement)(
|
|
80
|
+
} = _ref3;
|
|
81
|
+
return (0, _element.createElement)(_components.MenuItem, {
|
|
87
82
|
onClick: () => {
|
|
88
83
|
setIsModalOpen(true);
|
|
89
|
-
}
|
|
90
|
-
}, (0, _i18n.__)('Make template part')), isModalOpen && (0, _element.createElement)(_components.Modal, {
|
|
91
|
-
title: (0, _i18n.__)('Create a template part'),
|
|
92
|
-
closeLabel: (0, _i18n.__)('Close'),
|
|
93
|
-
onRequestClose: () => {
|
|
94
|
-
setIsModalOpen(false);
|
|
95
|
-
setTitle('');
|
|
96
|
-
},
|
|
97
|
-
overlayClassName: "edit-site-template-part-converter__modal"
|
|
98
|
-
}, (0, _element.createElement)("form", {
|
|
99
|
-
onSubmit: event => {
|
|
100
|
-
event.preventDefault();
|
|
101
|
-
onConvert(title);
|
|
102
|
-
setIsModalOpen(false);
|
|
103
|
-
setTitle('');
|
|
104
84
|
onClose();
|
|
105
85
|
}
|
|
106
|
-
}, (0,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
className: "edit-site-template-part-converter__area-base-control"
|
|
114
|
-
}, (0, _element.createElement)(_components.__experimentalRadioGroup, {
|
|
115
|
-
label: (0, _i18n.__)('Area'),
|
|
116
|
-
className: "edit-site-template-part-converter__area-radio-group",
|
|
117
|
-
id: `edit-site-template-part-converter__area-selection-${instanceId}`,
|
|
118
|
-
onChange: setArea,
|
|
119
|
-
checked: area
|
|
120
|
-
}, templatePartAreas.map(_ref3 => {
|
|
121
|
-
let {
|
|
122
|
-
icon,
|
|
123
|
-
label,
|
|
124
|
-
area: value,
|
|
125
|
-
description
|
|
126
|
-
} = _ref3;
|
|
127
|
-
return (0, _element.createElement)(_components.__experimentalRadio, {
|
|
128
|
-
key: label,
|
|
129
|
-
value: value,
|
|
130
|
-
className: "edit-site-template-part-converter__area-radio"
|
|
131
|
-
}, (0, _element.createElement)(_components.Flex, {
|
|
132
|
-
align: "start",
|
|
133
|
-
justify: "start"
|
|
134
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Icon, {
|
|
135
|
-
icon: icon
|
|
136
|
-
})), (0, _element.createElement)(_components.FlexBlock, {
|
|
137
|
-
className: "edit-site-template-part-converter__option-label"
|
|
138
|
-
}, label, (0, _element.createElement)("div", null, description)), (0, _element.createElement)(_components.FlexItem, {
|
|
139
|
-
className: "edit-site-template-part-converter__checkbox"
|
|
140
|
-
}, area === value && (0, _element.createElement)(_components.Icon, {
|
|
141
|
-
icon: _icons.check
|
|
142
|
-
}))));
|
|
143
|
-
}))), (0, _element.createElement)(_components.Flex, {
|
|
144
|
-
className: "edit-site-template-part-converter__convert-modal-actions",
|
|
145
|
-
justify: "flex-end"
|
|
146
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Button, {
|
|
147
|
-
variant: "secondary",
|
|
148
|
-
onClick: () => {
|
|
149
|
-
setIsModalOpen(false);
|
|
150
|
-
setTitle('');
|
|
151
|
-
}
|
|
152
|
-
}, (0, _i18n.__)('Cancel'))), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Button, {
|
|
153
|
-
variant: "primary",
|
|
154
|
-
type: "submit"
|
|
155
|
-
}, (0, _i18n.__)('Create')))))));
|
|
156
|
-
});
|
|
86
|
+
}, (0, _i18n.__)('Make template part'));
|
|
87
|
+
}), isModalOpen && (0, _element.createElement)(_createTemplatePartModal.default, {
|
|
88
|
+
closeModal: () => {
|
|
89
|
+
setIsModalOpen(false);
|
|
90
|
+
},
|
|
91
|
+
onCreate: onConvert
|
|
92
|
+
}));
|
|
157
93
|
}
|
|
158
94
|
//# sourceMappingURL=convert-to-template-part.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-template-part.js"],"names":["ConvertToTemplatePart","clientIds","blocks","instanceId","isModalOpen","setIsModalOpen","title","setTitle","replaceBlocks","blockEditorStore","saveEntityRecord","coreStore","createSuccessNotice","noticesStore","area","setArea","TEMPLATE_PART_AREA_GENERAL","templatePartAreas","select","editorStore","__experimentalGetDefaultTemplatePartAreas","onConvert","templatePartTitle","defaultTitle","templatePart","slug","content","theme","type","onClose","event","preventDefault","map","icon","label","value","description","check"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuItem,\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { createBlock, serialize } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_AREA_GENERAL } from '../../store/constants';\n\nexport default function ConvertToTemplatePart( { clientIds, blocks } ) {\n\tconst instanceId = useInstanceId( ConvertToTemplatePart );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst [ area, setArea ] = useState( TEMPLATE_PART_AREA_GENERAL );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\n\tconst onConvert = async ( templatePartTitle ) => {\n\t\tconst defaultTitle = __( 'Untitled Template Part' );\n\t\tconst templatePart = await saveEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t{\n\t\t\t\tslug: kebabCase( templatePartTitle || defaultTitle ),\n\t\t\t\ttitle: templatePartTitle || defaultTitle,\n\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\tarea,\n\t\t\t}\n\t\t);\n\t\treplaceBlocks(\n\t\t\tclientIds,\n\t\t\tcreateBlock( 'core/template-part', {\n\t\t\t\tslug: templatePart.slug,\n\t\t\t\ttheme: templatePart.theme,\n\t\t\t} )\n\t\t);\n\t\tcreateSuccessNotice( __( 'Template part created.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Make template part' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t\t{ isModalOpen && (\n\t\t\t\t\t\t<Modal\n\t\t\t\t\t\t\ttitle={ __( 'Create a template part' ) }\n\t\t\t\t\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\tsetTitle( '' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toverlayClassName=\"edit-site-template-part-converter__modal\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<form\n\t\t\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tonConvert( title );\n\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\t\tsetTitle( '' );\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\t\t\t\tid={ `edit-site-template-part-converter__area-selection-${ instanceId }` }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-template-part-converter__area-base-control\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-template-part-converter__area-radio-group\"\n\t\t\t\t\t\t\t\t\t\tid={ `edit-site-template-part-converter__area-selection-${ instanceId }` }\n\t\t\t\t\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t\t\t\t\t( {\n\t\t\t\t\t\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\t\t\tarea: value,\n\t\t\t\t\t\t\t\t\t\t\t\tdescription,\n\t\t\t\t\t\t\t\t\t\t\t} ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-template-part-converter__area-radio\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjustify=\"start\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"edit-site-template-part-converter__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"edit-site-template-part-converter__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ area ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</RadioGroup>\n\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-template-part-converter__convert-modal-actions\"\n\t\t\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\t\t\t\t\tsetTitle( '' );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</Modal>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-template-part.js"],"names":["ConvertToTemplatePart","clientIds","blocks","isModalOpen","setIsModalOpen","replaceBlocks","blockEditorStore","saveEntityRecord","coreStore","createSuccessNotice","noticesStore","onConvert","title","area","templatePart","slug","content","theme","type","onClose"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAIA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;AAGe,SAASA,qBAAT,OAAwD;AAAA,MAAxB;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAAwB;AACtE,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,uBAAaC,kBAAb,CAA1B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,eAAb,CAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,cAAb,CAAhC;;AAEA,QAAMC,SAAS,GAAG,eAA6B;AAAA,QAArB;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KAAqB;AAC9C,UAAMC,YAAY,GAAG,MAAMP,gBAAgB,CAC1C,UAD0C,EAE1C,kBAF0C,EAG1C;AACCQ,MAAAA,IAAI,EAAE,uBAAWH,KAAX,CADP;AAECA,MAAAA,KAFD;AAGCI,MAAAA,OAAO,EAAE,uBAAWd,MAAX,CAHV;AAICW,MAAAA;AAJD,KAH0C,CAA3C;AAUAR,IAAAA,aAAa,CACZJ,SADY,EAEZ,yBAAa,oBAAb,EAAmC;AAClCc,MAAAA,IAAI,EAAED,YAAY,CAACC,IADe;AAElCE,MAAAA,KAAK,EAAEH,YAAY,CAACG;AAFc,KAAnC,CAFY,CAAb;AAOAR,IAAAA,mBAAmB,CAAE,cAAI,wBAAJ,CAAF,EAAkC;AACpDS,MAAAA,IAAI,EAAE;AAD8C,KAAlC,CAAnB;AAGA,GArBD;;AAuBA,SACC,qDACC,4BAAC,sCAAD,QACG;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACD,4BAAC,oBAAD;AACC,MAAA,OAAO,EAAG,MAAM;AACff,QAAAA,cAAc,CAAE,IAAF,CAAd;AACAe,QAAAA,OAAO;AACP;AAJF,OAMG,cAAI,oBAAJ,CANH,CADC;AAAA,GADH,CADD,EAaGhB,WAAW,IACZ,4BAAC,gCAAD;AACC,IAAA,UAAU,EAAG,MAAM;AAClBC,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGO;AAJZ,IAdF,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { createBlock, serialize } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport CreateTemplatePartModal from '../create-template-part-modal';\n\nexport default function ConvertToTemplatePart( { clientIds, blocks } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onConvert = async ( { title, area } ) => {\n\t\tconst templatePart = await saveEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t{\n\t\t\t\tslug: kebabCase( title ),\n\t\t\t\ttitle,\n\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\tarea,\n\t\t\t}\n\t\t);\n\t\treplaceBlocks(\n\t\t\tclientIds,\n\t\t\tcreateBlock( 'core/template-part', {\n\t\t\t\tslug: templatePart.slug,\n\t\t\t\ttheme: templatePart.theme,\n\t\t\t} )\n\t\t);\n\t\tcreateSuccessNotice( __( 'Template part created.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Make template part' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) }\n\t\t\t</BlockSettingsMenuControls>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCreate={ onConvert }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = WelcomeGuideEditor;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _components = require("@wordpress/components");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("@wordpress/i18n");
|
|
17
|
+
|
|
18
|
+
var _image = _interopRequireDefault(require("./image"));
|
|
19
|
+
|
|
20
|
+
var _store = require("../../store");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
function WelcomeGuideEditor() {
|
|
30
|
+
const {
|
|
31
|
+
toggleFeature
|
|
32
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
33
|
+
return (0, _element.createElement)(_components.Guide, {
|
|
34
|
+
className: "edit-site-welcome-guide",
|
|
35
|
+
contentLabel: (0, _i18n.__)('Welcome to the site editor'),
|
|
36
|
+
finishButtonText: (0, _i18n.__)('Get Started'),
|
|
37
|
+
onFinish: () => toggleFeature('welcomeGuide'),
|
|
38
|
+
pages: [{
|
|
39
|
+
image: (0, _element.createElement)(_image.default, {
|
|
40
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/edit-your-site.svg?1",
|
|
41
|
+
animatedSrc: "https://s.w.org/images/block-editor/edit-your-site.gif?1"
|
|
42
|
+
}),
|
|
43
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
|
|
44
|
+
className: "edit-site-welcome-guide__heading"
|
|
45
|
+
}, (0, _i18n.__)('Edit your site')), (0, _element.createElement)("p", {
|
|
46
|
+
className: "edit-site-welcome-guide__text"
|
|
47
|
+
}, (0, _i18n.__)('Design everything on your site — from the header right down to the footer — using blocks.')), (0, _element.createElement)("p", {
|
|
48
|
+
className: "edit-site-welcome-guide__text"
|
|
49
|
+
}, (0, _element.createInterpolateElement)((0, _i18n.__)('Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'), {
|
|
50
|
+
StylesIconImage: (0, _element.createElement)("img", {
|
|
51
|
+
alt: (0, _i18n.__)('styles'),
|
|
52
|
+
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"
|
|
53
|
+
})
|
|
54
|
+
})))
|
|
55
|
+
}]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/editor.js"],"names":["WelcomeGuideEditor","toggleFeature","editSiteStore","image","content","StylesIconImage"],"mappings":";;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAMA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIe,SAASA,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAoB,uBAAaC,YAAb,CAA1B;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,YAAY,EAAG,cAAI,4BAAJ,CAFhB;AAGC,IAAA,gBAAgB,EAAG,cAAI,aAAJ,CAHpB;AAIC,IAAA,QAAQ,EAAG,MAAMD,aAAa,CAAE,cAAF,CAJ/B;AAKC,IAAA,KAAK,EAAG,CACP;AACCE,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,gBAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,2FADC,CADH,CAJD,EASC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,uCACD,cACC,2GADD,CADC,EAID;AACCC,QAAAA,eAAe,EACd;AACC,UAAA,GAAG,EAAG,cAAI,QAAJ,CADP;AAEC,UAAA,GAAG,EAAC;AAFL;AAFF,OAJC,CADH,CATD;AARF,KADO;AALT,IADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get Started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\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/>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = WelcomeGuideImage;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
function WelcomeGuideImage(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
nonAnimatedSrc,
|
|
13
|
+
animatedSrc
|
|
14
|
+
} = _ref;
|
|
15
|
+
return (0, _element.createElement)("picture", {
|
|
16
|
+
className: "edit-site-welcome-guide__image"
|
|
17
|
+
}, (0, _element.createElement)("source", {
|
|
18
|
+
srcSet: nonAnimatedSrc,
|
|
19
|
+
media: "(prefers-reduced-motion: reduce)"
|
|
20
|
+
}), (0, _element.createElement)("img", {
|
|
21
|
+
src: animatedSrc,
|
|
22
|
+
width: "312",
|
|
23
|
+
height: "240",
|
|
24
|
+
alt: ""
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/image.js"],"names":["WelcomeGuideImage","nonAnimatedSrc","animatedSrc"],"mappings":";;;;;;;;;AAAe,SAASA,iBAAT,OAA8D;AAAA,MAAlC;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,GAAkC;AAC5E,SACC;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC;AACC,IAAA,MAAM,EAAGD,cADV;AAEC,IAAA,KAAK,EAAC;AAFP,IADD,EAKC;AAAK,IAAA,GAAG,EAAGC,WAAX;AAAyB,IAAA,KAAK,EAAC,KAA/B;AAAqC,IAAA,MAAM,EAAC,KAA5C;AAAkD,IAAA,GAAG,EAAC;AAAtD,IALD,CADD;AASA","sourcesContent":["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-site-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = WelcomeGuide;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _interface = require("@wordpress/interface");
|
|
15
|
+
|
|
16
|
+
var _editor = _interopRequireDefault(require("./editor"));
|
|
17
|
+
|
|
18
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
19
|
+
|
|
20
|
+
var _store = require("../../store");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
function WelcomeGuide() {
|
|
30
|
+
const {
|
|
31
|
+
isActive,
|
|
32
|
+
isStylesOpen
|
|
33
|
+
} = (0, _data.useSelect)(select => {
|
|
34
|
+
const sidebar = select(_interface.store).getActiveComplementaryArea(_store.store.name);
|
|
35
|
+
const isStylesSidebar = sidebar === 'edit-site/global-styles';
|
|
36
|
+
const feature = isStylesSidebar ? 'welcomeGuideStyles' : 'welcomeGuide';
|
|
37
|
+
return {
|
|
38
|
+
isActive: select(_store.store).isFeatureActive(feature),
|
|
39
|
+
isStylesOpen: isStylesSidebar
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
|
|
43
|
+
if (!isActive) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return isStylesOpen ? (0, _element.createElement)(_styles.default, null) : (0, _element.createElement)(_editor.default, null);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"names":["WelcomeGuide","isActive","isStylesOpen","select","sidebar","interfaceStore","getActiveComplementaryArea","editSiteStore","name","isStylesSidebar","feature","isFeatureActive"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKe,SAASA,YAAT,GAAwB;AACtC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA6B,qBAAaC,MAAF,IAAc;AAC3D,UAAMC,OAAO,GAAGD,MAAM,CAAEE,gBAAF,CAAN,CAAyBC,0BAAzB,CACfC,aAAcC,IADC,CAAhB;AAGA,UAAMC,eAAe,GAAGL,OAAO,KAAK,yBAApC;AACA,UAAMM,OAAO,GAAGD,eAAe,GAAG,oBAAH,GAA0B,cAAzD;AAEA,WAAO;AACNR,MAAAA,QAAQ,EAAEE,MAAM,CAAEI,YAAF,CAAN,CAAwBI,eAAxB,CAAyCD,OAAzC,CADJ;AAENR,MAAAA,YAAY,EAAEO;AAFR,KAAP;AAIA,GAXkC,EAWhC,EAXgC,CAAnC;;AAaA,MAAK,CAAER,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SAAOC,YAAY,GAAG,4BAAC,eAAD,OAAH,GAA4B,4BAAC,eAAD,OAA/C;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst { isActive, isStylesOpen } = useSelect( ( select ) => {\n\t\tconst sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditSiteStore.name\n\t\t);\n\t\tconst isStylesSidebar = sidebar === 'edit-site/global-styles';\n\t\tconst feature = isStylesSidebar ? 'welcomeGuideStyles' : 'welcomeGuide';\n\n\t\treturn {\n\t\t\tisActive: select( editSiteStore ).isFeatureActive( feature ),\n\t\t\tisStylesOpen: isStylesSidebar,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn isStylesOpen ? <WelcomeGuideStyles /> : <WelcomeGuideEditor />;\n}\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = WelcomeGuideStyles;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _components = require("@wordpress/components");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("@wordpress/i18n");
|
|
17
|
+
|
|
18
|
+
var _image = _interopRequireDefault(require("./image"));
|
|
19
|
+
|
|
20
|
+
var _store = require("../../store");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
function WelcomeGuideStyles() {
|
|
30
|
+
const {
|
|
31
|
+
toggleFeature
|
|
32
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
33
|
+
return (0, _element.createElement)(_components.Guide, {
|
|
34
|
+
className: "edit-site-welcome-guide",
|
|
35
|
+
contentLabel: (0, _i18n.__)('Welcome to styles'),
|
|
36
|
+
finishButtonText: (0, _i18n.__)('Get Started'),
|
|
37
|
+
onFinish: () => toggleFeature('welcomeGuideStyles'),
|
|
38
|
+
pages: [{
|
|
39
|
+
image: (0, _element.createElement)(_image.default, {
|
|
40
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.svg?1",
|
|
41
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-to-styles.gif?1"
|
|
42
|
+
}),
|
|
43
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
|
|
44
|
+
className: "edit-site-welcome-guide__heading"
|
|
45
|
+
}, (0, _i18n.__)('Welcome to Styles')), (0, _element.createElement)("p", {
|
|
46
|
+
className: "edit-site-welcome-guide__text"
|
|
47
|
+
}, (0, _i18n.__)('Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.')))
|
|
48
|
+
}, {
|
|
49
|
+
image: (0, _element.createElement)(_image.default, {
|
|
50
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/set-the-design.svg?1",
|
|
51
|
+
animatedSrc: "https://s.w.org/images/block-editor/set-the-design.gif?1"
|
|
52
|
+
}),
|
|
53
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
|
|
54
|
+
className: "edit-site-welcome-guide__heading"
|
|
55
|
+
}, (0, _i18n.__)('Set the design')), (0, _element.createElement)("p", {
|
|
56
|
+
className: "edit-site-welcome-guide__text"
|
|
57
|
+
}, (0, _i18n.__)('You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ')))
|
|
58
|
+
}, {
|
|
59
|
+
image: (0, _element.createElement)(_image.default, {
|
|
60
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.svg?1",
|
|
61
|
+
animatedSrc: "https://s.w.org/images/block-editor/personalize-blocks.gif?1"
|
|
62
|
+
}),
|
|
63
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
|
|
64
|
+
className: "edit-site-welcome-guide__heading"
|
|
65
|
+
}, (0, _i18n.__)('Personalize blocks')), (0, _element.createElement)("p", {
|
|
66
|
+
className: "edit-site-welcome-guide__text"
|
|
67
|
+
}, (0, _i18n.__)('You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.')))
|
|
68
|
+
}, {
|
|
69
|
+
image: (0, _element.createElement)(_image.default, {
|
|
70
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
|
|
71
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
|
|
72
|
+
}),
|
|
73
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h1", {
|
|
74
|
+
className: "edit-site-welcome-guide__heading"
|
|
75
|
+
}, (0, _i18n.__)('Learn more')), (0, _element.createElement)("p", {
|
|
76
|
+
className: "edit-site-welcome-guide__text"
|
|
77
|
+
}, (0, _i18n.__)('New to block themes and styling your site? '), (0, _element.createElement)(_components.ExternalLink, {
|
|
78
|
+
href: (0, _i18n.__)('https://wordpress.org/support/article/wordpress-editor/')
|
|
79
|
+
}, (0, _i18n.__)('Here’s a detailed guide to learn how to make the most of it.'))))
|
|
80
|
+
}]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"names":["WelcomeGuideStyles","toggleFeature","editSiteStore","image","content"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIe,SAASA,kBAAT,GAA8B;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAoB,uBAAaC,YAAb,CAA1B;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,YAAY,EAAG,cAAI,mBAAJ,CAFhB;AAGC,IAAA,gBAAgB,EAAG,cAAI,aAAJ,CAHpB;AAIC,IAAA,QAAQ,EAAG,MAAMD,aAAa,CAAE,oBAAF,CAJ/B;AAKC,IAAA,KAAK,EAAG,CACP;AACCE,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,6DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,mBAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,2KADC,CADH,CAJD;AARF,KADO,EAqBP;AACCD,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,0DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,gBAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,8JADC,CADH,CAJD;AARF,KArBO,EAyCP;AACCD,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,8DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,oBAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,qLADC,CADH,CAJD;AARF,KAzCO,EA6DP;AACCD,MAAAA,KAAK,EACJ,4BAAC,cAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,qDACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACG,cAAI,YAAJ,CADH,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACG,cACD,6CADC,CADH,EAIC,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAG,cACN,yDADM;AADR,SAKG,cACD,8DADC,CALH,CAJD,CAJD;AARF,KA7DO;AALT,IADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuideStyles() {\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to styles' ) }\n\t\t\tfinishButtonText={ __( 'Get Started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideStyles' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to Styles' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Set the design' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Personalize blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to block themes and styling your site? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/wordpress-editor/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Here’s a detailed guide to learn how to make the most of it.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\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/>\n\t);\n}\n"]}
|
package/build/index.js
CHANGED
|
@@ -35,7 +35,8 @@ Object.defineProperty(exports, "__experimentalNavigationToggle", {
|
|
|
35
35
|
return _navigationToggle.default;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
exports.
|
|
38
|
+
exports.initializeEditor = initializeEditor;
|
|
39
|
+
exports.initializeList = initializeList;
|
|
39
40
|
exports.reinitializeEditor = reinitializeEditor;
|
|
40
41
|
|
|
41
42
|
var _element = require("@wordpress/element");
|
|
@@ -48,13 +49,17 @@ var _data = require("@wordpress/data");
|
|
|
48
49
|
|
|
49
50
|
var _coreData = require("@wordpress/core-data");
|
|
50
51
|
|
|
52
|
+
var _editor = require("@wordpress/editor");
|
|
53
|
+
|
|
51
54
|
require("./plugins");
|
|
52
55
|
|
|
53
56
|
require("./hooks");
|
|
54
57
|
|
|
55
58
|
require("./store");
|
|
56
59
|
|
|
57
|
-
var
|
|
60
|
+
var _editor2 = _interopRequireDefault(require("./components/editor"));
|
|
61
|
+
|
|
62
|
+
var _list = _interopRequireDefault(require("./components/list"));
|
|
58
63
|
|
|
59
64
|
var _mainDashboardButton = _interopRequireDefault(require("./components/main-dashboard-button"));
|
|
60
65
|
|
|
@@ -85,7 +90,7 @@ var _pluginMoreMenuItem = _interopRequireDefault(require("./components/header/pl
|
|
|
85
90
|
function reinitializeEditor(target, settings) {
|
|
86
91
|
(0, _element.unmountComponentAtNode)(target);
|
|
87
92
|
const reboot = reinitializeEditor.bind(null, target, settings);
|
|
88
|
-
(0, _element.render)((0, _element.createElement)(
|
|
93
|
+
(0, _element.render)((0, _element.createElement)(_editor2.default, {
|
|
89
94
|
initialSettings: settings,
|
|
90
95
|
onError: reboot
|
|
91
96
|
}), target);
|
|
@@ -98,7 +103,7 @@ function reinitializeEditor(target, settings) {
|
|
|
98
103
|
*/
|
|
99
104
|
|
|
100
105
|
|
|
101
|
-
function
|
|
106
|
+
function initializeEditor(id, settings) {
|
|
102
107
|
settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0, _coreData.__experimentalFetchLinkSuggestions)(search, searchOptions, settings);
|
|
103
108
|
|
|
104
109
|
settings.__experimentalFetchRichUrlData = _coreData.__experimentalFetchUrlData;
|
|
@@ -116,9 +121,28 @@ function initialize(id, settings) {
|
|
|
116
121
|
});
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
(0, _element.render)((0, _element.createElement)(
|
|
124
|
+
(0, _element.render)((0, _element.createElement)(_editor2.default, {
|
|
120
125
|
initialSettings: settings,
|
|
121
126
|
onError: reboot
|
|
122
127
|
}), target);
|
|
123
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Initializes the site editor templates list screen.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} id ID of the root element to render the screen in.
|
|
133
|
+
* @param {string} templateType The type of the list. "wp_template" or "wp_template_part".
|
|
134
|
+
* @param {Object} settings Editor settings.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
function initializeList(id, templateType, settings) {
|
|
139
|
+
const target = document.getElementById(id);
|
|
140
|
+
(0, _data.dispatch)(_editor.store).updateEditorSettings({
|
|
141
|
+
defaultTemplateTypes: settings.defaultTemplateTypes,
|
|
142
|
+
defaultTemplatePartAreas: settings.defaultTemplatePartAreas
|
|
143
|
+
});
|
|
144
|
+
(0, _element.render)((0, _element.createElement)(_list.default, {
|
|
145
|
+
templateType: templateType
|
|
146
|
+
}), target);
|
|
147
|
+
}
|
|
124
148
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["reinitializeEditor","target","settings","reboot","bind","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["reinitializeEditor","target","settings","reboot","bind","initializeEditor","id","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","__experimentalSpotlightEntityBlocks","document","getElementById","blocksStore","__experimentalReapplyBlockTypeFilters","process","env","GUTENBERG_PHASE","enableFSEBlocks","initializeList","templateType","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;AANA;;AACA;;AAIA;;AAEA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAkEA;;AACA;;AACA;;AACA;;AACA;;AA7FA;AACA;AACA;;AAcA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAT,CAA6BC,MAA7B,EAAqCC,QAArC,EAAgD;AACtD,uCAAwBD,MAAxB;AACA,QAAME,MAAM,GAAGH,kBAAkB,CAACI,IAAnB,CAAyB,IAAzB,EAA+BH,MAA/B,EAAuCC,QAAvC,CAAf;AACA,uBACC,4BAAC,gBAAD;AAAQ,IAAA,eAAe,EAAGA,QAA1B;AAAqC,IAAA,OAAO,EAAGC;AAA/C,IADD,EAECF,MAFD;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,gBAAT,CAA2BC,EAA3B,EAA+BJ,QAA/B,EAA0C;AAChDA,EAAAA,QAAQ,CAACK,kCAAT,GAA8C,CAAEC,MAAF,EAAUC,aAAV,KAC7C,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6CP,QAA7C,CADD;;AAEAA,EAAAA,QAAQ,CAACQ,8BAAT,GAA0CC,oCAA1C;AACAT,EAAAA,QAAQ,CAACU,mCAAT,GAA+C,CAAE,oBAAF,CAA/C;AAEA,QAAMX,MAAM,GAAGY,QAAQ,CAACC,cAAT,CAAyBR,EAAzB,CAAf;AACA,QAAMH,MAAM,GAAGH,kBAAkB,CAACI,IAAnB,CAAyB,IAAzB,EAA+BH,MAA/B,EAAuCC,QAAvC,CAAf;;AAEA,sBAAUa,aAAV,EAAwBC,qCAAxB;;AACA;;AACA,MAAKC,OAAO,CAACC,GAAR,CAAYC,eAAZ,KAAgC,CAArC,EAAyC;AACxC,oEAA8C;AAC7CC,MAAAA,eAAe,EAAE;AAD4B,KAA9C;AAGA;;AAED,uBACC,4BAAC,gBAAD;AAAQ,IAAA,eAAe,EAAGlB,QAA1B;AAAqC,IAAA,OAAO,EAAGC;AAA/C,IADD,EAECF,MAFD;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASoB,cAAT,CAAyBf,EAAzB,EAA6BgB,YAA7B,EAA2CpB,QAA3C,EAAsD;AAC5D,QAAMD,MAAM,GAAGY,QAAQ,CAACC,cAAT,CAAyBR,EAAzB,CAAf;AAEA,sBAAUiB,aAAV,EAAwBC,oBAAxB,CAA8C;AAC7CC,IAAAA,oBAAoB,EAAEvB,QAAQ,CAACuB,oBADc;AAE7CC,IAAAA,wBAAwB,EAAExB,QAAQ,CAACwB;AAFU,GAA9C;AAKA,uBAAQ,4BAAC,aAAD;AAAM,IAAA,YAAY,EAAGJ;AAArB,IAAR,EAAgDrB,MAAhD;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './plugins';\nimport './hooks';\nimport './store';\nimport Editor from './components/editor';\nimport List from './components/list';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\trender(\n\t\t<Editor initialSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\tsettings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ];\n\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks();\n\tif ( process.env.GUTENBERG_PHASE === 2 ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\trender(\n\t\t<Editor initialSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Initializes the site editor templates list screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {string} templateType The type of the list. \"wp_template\" or \"wp_template_part\".\n * @param {Object} settings Editor settings.\n */\nexport function initializeList( id, templateType, settings ) {\n\tconst target = document.getElementById( id );\n\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\trender( <List templateType={ templateType } />, target );\n}\n\nexport { default as __experimentalMainDashboardButton } from './components/main-dashboard-button';\nexport { default as __experimentalNavigationToggle } from './components/navigation-sidebar/navigation-toggle';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\n"]}
|
package/build/plugins/index.js
CHANGED
|
@@ -18,6 +18,8 @@ var _icons = require("@wordpress/icons");
|
|
|
18
18
|
|
|
19
19
|
var _toolsMoreMenuGroup = _interopRequireDefault(require("../components/header/tools-more-menu-group"));
|
|
20
20
|
|
|
21
|
+
var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* External dependencies
|
|
23
25
|
*/
|
|
@@ -35,11 +37,11 @@ var _toolsMoreMenuGroup = _interopRequireDefault(require("../components/header/t
|
|
|
35
37
|
role: "menuitem",
|
|
36
38
|
icon: _icons.download,
|
|
37
39
|
onClick: () => (0, _apiFetch.default)({
|
|
38
|
-
path: '/
|
|
40
|
+
path: '/wp-block-editor/v1/export',
|
|
39
41
|
parse: false
|
|
40
42
|
}).then(res => res.blob()).then(blob => (0, _downloadjs.default)(blob, 'edit-site-export.zip', 'application/zip')),
|
|
41
43
|
info: (0, _i18n.__)('Download your templates and template parts.')
|
|
42
|
-
}, (0, _i18n.__)('Export'))));
|
|
44
|
+
}, (0, _i18n.__)('Export')), (0, _element.createElement)(_welcomeGuideMenuItem.default, null)));
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/plugins/index.js"],"names":["render","download","path","parse","then","res","blob"],"mappings":";;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/plugins/index.js"],"names":["render","download","path","parse","then","res","blob"],"mappings":";;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA,6BAAgB,WAAhB,EAA6B;AAC5BA,EAAAA,MAAM,GAAG;AACR,WACC,qDACC,4BAAC,2BAAD,QACC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGC,eAFR;AAGC,MAAA,OAAO,EAAG,MACT,uBAAU;AACTC,QAAAA,IAAI,EAAE,4BADG;AAETC,QAAAA,KAAK,EAAE;AAFE,OAAV,EAIEC,IAJF,CAIUC,GAAF,IAAWA,GAAG,CAACC,IAAJ,EAJnB,EAKEF,IALF,CAKUE,IAAF,IACN,yBACCA,IADD,EAEC,sBAFD,EAGC,iBAHD,CANF,CAJF;AAiBC,MAAA,IAAI,EAAG,cACN,6CADM;AAjBR,OAqBG,cAAI,QAAJ,CArBH,CADD,EAwBC,4BAAC,6BAAD,OAxBD,CADD,CADD;AA8BA;;AAhC2B,CAA7B","sourcesContent":["/**\n * External dependencies\n */\nimport downloadjs from 'downloadjs';\n\n/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport apiFetch from '@wordpress/api-fetch';\nimport { download } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-site', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\ticon={ download }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tapiFetch( {\n\t\t\t\t\t\t\t\tpath: '/wp-block-editor/v1/export',\n\t\t\t\t\t\t\t\tparse: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t.then( ( res ) => res.blob() )\n\t\t\t\t\t\t\t\t.then( ( blob ) =>\n\t\t\t\t\t\t\t\t\tdownloadjs(\n\t\t\t\t\t\t\t\t\t\tblob,\n\t\t\t\t\t\t\t\t\t\t'edit-site-export.zip',\n\t\t\t\t\t\t\t\t\t\t'application/zip'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t'Download your templates and template parts.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Export' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = WelcomeGuideMenuItem;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _i18n = require("@wordpress/i18n");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _components = require("@wordpress/components");
|
|
15
|
+
|
|
16
|
+
var _interface = require("@wordpress/interface");
|
|
17
|
+
|
|
18
|
+
var _store = require("../store");
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
function WelcomeGuideMenuItem() {
|
|
28
|
+
const {
|
|
29
|
+
toggleFeature
|
|
30
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
31
|
+
const isStylesOpen = (0, _data.useSelect)(select => {
|
|
32
|
+
const sidebar = select(_interface.store).getActiveComplementaryArea(_store.store.name);
|
|
33
|
+
return sidebar === 'edit-site/global-styles';
|
|
34
|
+
}, []);
|
|
35
|
+
return (0, _element.createElement)(_components.MenuItem, {
|
|
36
|
+
onClick: () => toggleFeature(isStylesOpen ? 'welcomeGuideStyles' : 'welcomeGuide')
|
|
37
|
+
}, (0, _i18n.__)('Welcome Guide'));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=welcome-guide-menu-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/plugins/welcome-guide-menu-item.js"],"names":["WelcomeGuideMenuItem","toggleFeature","editSiteStore","isStylesOpen","select","sidebar","interfaceStore","getActiveComplementaryArea","name"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGe,SAASA,oBAAT,GAAgC;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAoB,uBAAaC,YAAb,CAA1B;AACA,QAAMC,YAAY,GAAG,qBAAaC,MAAF,IAAc;AAC7C,UAAMC,OAAO,GAAGD,MAAM,CAAEE,gBAAF,CAAN,CAAyBC,0BAAzB,CACfL,aAAcM,IADC,CAAhB;AAIA,WAAOH,OAAO,KAAK,yBAAnB;AACA,GANoB,EAMlB,EANkB,CAArB;AAQA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MACTJ,aAAa,CACZE,YAAY,GAAG,oBAAH,GAA0B,cAD1B;AAFf,KAOG,cAAI,eAAJ,CAPH,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../store';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst { toggleFeature } = useDispatch( editSiteStore );\n\tconst isStylesOpen = useSelect( ( select ) => {\n\t\tconst sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditSiteStore.name\n\t\t);\n\n\t\treturn sidebar === 'edit-site/global-styles';\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () =>\n\t\t\t\ttoggleFeature(\n\t\t\t\t\tisStylesOpen ? 'welcomeGuideStyles' : 'welcomeGuide'\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{ __( 'Welcome Guide' ) }\n\t\t</MenuItem>\n\t);\n}\n"]}
|