@wordpress/edit-site 6.35.1-next.16d95556a.0 → 6.36.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 +6 -0
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +109 -0
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.js.map +7 -0
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.js +328 -0
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.js.map +7 -0
- package/build/components/add-new-template-legacy/index.js +389 -0
- package/build/components/add-new-template-legacy/index.js.map +7 -0
- package/build/components/add-new-template-legacy/utils.js +620 -0
- package/build/components/add-new-template-legacy/utils.js.map +7 -0
- package/build/components/page-templates/fields.js +3 -1
- package/build/components/page-templates/fields.js.map +2 -2
- package/build/components/page-templates/index-legacy.js +185 -0
- package/build/components/page-templates/index-legacy.js.map +7 -0
- package/build/components/post-list/index.js +10 -0
- package/build/components/post-list/index.js.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.js +101 -0
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.js.map +7 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +3 -3
- package/build/components/site-editor-routes/templates.js +10 -2
- package/build/components/site-editor-routes/templates.js.map +3 -3
- package/build/components/site-hub/index.js +1 -1
- package/build/components/site-hub/index.js.map +2 -2
- package/build/utils/constants.js +6 -0
- package/build/utils/constants.js.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +93 -0
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.js.map +7 -0
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.js +316 -0
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.js.map +7 -0
- package/build-module/components/add-new-template-legacy/index.js +390 -0
- package/build-module/components/add-new-template-legacy/index.js.map +7 -0
- package/build-module/components/add-new-template-legacy/utils.js +589 -0
- package/build-module/components/add-new-template-legacy/utils.js.map +7 -0
- package/build-module/components/page-templates/fields.js +3 -1
- package/build-module/components/page-templates/fields.js.map +2 -2
- package/build-module/components/page-templates/index-legacy.js +154 -0
- package/build-module/components/page-templates/index-legacy.js.map +7 -0
- package/build-module/components/post-list/index.js +12 -0
- package/build-module/components/post-list/index.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.js +70 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.js.map +7 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +2 -2
- package/build-module/components/site-editor-routes/templates.js +10 -2
- package/build-module/components/site-editor-routes/templates.js.map +2 -2
- package/build-module/components/site-hub/index.js +1 -1
- package/build-module/components/site-hub/index.js.map +2 -2
- package/build-module/utils/constants.js +4 -0
- package/build-module/utils/constants.js.map +2 -2
- package/build-style/style-rtl.css +309 -40
- package/build-style/style.css +309 -40
- package/package.json +46 -46
- package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +94 -0
- package/src/components/add-new-template-legacy/add-custom-template-modal-content.js +314 -0
- package/src/components/add-new-template-legacy/index.js +454 -0
- package/src/components/add-new-template-legacy/utils.js +760 -0
- package/src/components/page-templates/fields.js +13 -9
- package/src/components/page-templates/index-legacy.js +166 -0
- package/src/components/post-list/index.js +13 -0
- package/src/components/sidebar-navigation-screen-templates-browse/content-legacy.js +79 -0
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +8 -1
- package/src/components/site-editor-routes/templates.js +22 -3
- package/src/components/site-hub/index.js +1 -1
- package/src/components/welcome-guide/style.scss +8 -0
- package/src/utils/constants.js +2 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/add-new-template-legacy/index.js
|
|
31
|
+
var add_new_template_legacy_exports = {};
|
|
32
|
+
__export(add_new_template_legacy_exports, {
|
|
33
|
+
default: () => add_new_template_legacy_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(add_new_template_legacy_exports);
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_components = require("@wordpress/components");
|
|
38
|
+
var import_html_entities = require("@wordpress/html-entities");
|
|
39
|
+
var import_element = require("@wordpress/element");
|
|
40
|
+
var import_data = require("@wordpress/data");
|
|
41
|
+
var import_core_data = require("@wordpress/core-data");
|
|
42
|
+
var import_compose = require("@wordpress/compose");
|
|
43
|
+
var import_icons = require("@wordpress/icons");
|
|
44
|
+
var import_i18n = require("@wordpress/i18n");
|
|
45
|
+
var import_notices = require("@wordpress/notices");
|
|
46
|
+
var import_router = require("@wordpress/router");
|
|
47
|
+
var import_dom = require("@wordpress/dom");
|
|
48
|
+
var import_constants = require("../../utils/constants");
|
|
49
|
+
var import_add_custom_template_modal_content = __toESM(require("./add-custom-template-modal-content"));
|
|
50
|
+
var import_utils = require("./utils");
|
|
51
|
+
var import_add_custom_generic_template_modal_content = __toESM(require("./add-custom-generic-template-modal-content"));
|
|
52
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
var { useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
55
|
+
var DEFAULT_TEMPLATE_SLUGS = [
|
|
56
|
+
"front-page",
|
|
57
|
+
"home",
|
|
58
|
+
"single",
|
|
59
|
+
"page",
|
|
60
|
+
"index",
|
|
61
|
+
"archive",
|
|
62
|
+
"author",
|
|
63
|
+
"category",
|
|
64
|
+
"date",
|
|
65
|
+
"tag",
|
|
66
|
+
"search",
|
|
67
|
+
"404"
|
|
68
|
+
];
|
|
69
|
+
var TEMPLATE_ICONS = {
|
|
70
|
+
"front-page": import_icons.home,
|
|
71
|
+
home: import_icons.verse,
|
|
72
|
+
single: import_icons.pin,
|
|
73
|
+
page: import_icons.page,
|
|
74
|
+
archive: import_icons.archive,
|
|
75
|
+
search: import_icons.search,
|
|
76
|
+
404: import_icons.notFound,
|
|
77
|
+
index: import_icons.list,
|
|
78
|
+
category: import_icons.category,
|
|
79
|
+
author: import_icons.commentAuthorAvatar,
|
|
80
|
+
taxonomy: import_icons.blockMeta,
|
|
81
|
+
date: import_icons.calendar,
|
|
82
|
+
tag: import_icons.tag,
|
|
83
|
+
attachment: import_icons.media
|
|
84
|
+
};
|
|
85
|
+
function TemplateListItem({
|
|
86
|
+
title,
|
|
87
|
+
direction,
|
|
88
|
+
className,
|
|
89
|
+
description,
|
|
90
|
+
icon,
|
|
91
|
+
onClick,
|
|
92
|
+
children
|
|
93
|
+
}) {
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
import_components.Button,
|
|
96
|
+
{
|
|
97
|
+
__next40pxDefaultSize: true,
|
|
98
|
+
className,
|
|
99
|
+
onClick,
|
|
100
|
+
label: description,
|
|
101
|
+
showTooltip: !!description,
|
|
102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
103
|
+
import_components.Flex,
|
|
104
|
+
{
|
|
105
|
+
as: "span",
|
|
106
|
+
spacing: 2,
|
|
107
|
+
align: "center",
|
|
108
|
+
justify: "center",
|
|
109
|
+
style: { width: "100%" },
|
|
110
|
+
direction,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-add-new-template__template-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { icon }) }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
114
|
+
import_components.__experimentalVStack,
|
|
115
|
+
{
|
|
116
|
+
className: "edit-site-add-new-template__template-name",
|
|
117
|
+
alignment: "center",
|
|
118
|
+
spacing: 0,
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
import_components.__experimentalText,
|
|
122
|
+
{
|
|
123
|
+
align: "center",
|
|
124
|
+
weight: 500,
|
|
125
|
+
lineHeight: 1.53846153846,
|
|
126
|
+
children: title
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
children
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
var modalContentMap = {
|
|
140
|
+
templatesList: 1,
|
|
141
|
+
customTemplate: 2,
|
|
142
|
+
customGenericTemplate: 3
|
|
143
|
+
};
|
|
144
|
+
function NewTemplateModal({ onClose }) {
|
|
145
|
+
const [modalContent, setModalContent] = (0, import_element.useState)(
|
|
146
|
+
modalContentMap.templatesList
|
|
147
|
+
);
|
|
148
|
+
const [entityForSuggestions, setEntityForSuggestions] = (0, import_element.useState)({});
|
|
149
|
+
const [isSubmitting, setIsSubmitting] = (0, import_element.useState)(false);
|
|
150
|
+
const missingTemplates = useMissingTemplates(
|
|
151
|
+
setEntityForSuggestions,
|
|
152
|
+
() => setModalContent(modalContentMap.customTemplate)
|
|
153
|
+
);
|
|
154
|
+
const history = useHistory();
|
|
155
|
+
const { saveEntityRecord } = (0, import_data.useDispatch)(import_core_data.store);
|
|
156
|
+
const { createErrorNotice, createSuccessNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
157
|
+
const containerRef = (0, import_element.useRef)(null);
|
|
158
|
+
const isMobile = (0, import_compose.useViewportMatch)("medium", "<");
|
|
159
|
+
const homeUrl = (0, import_data.useSelect)((select) => {
|
|
160
|
+
return select(import_core_data.store).getEntityRecord("root", "__unstableBase")?.home;
|
|
161
|
+
}, []);
|
|
162
|
+
const TEMPLATE_SHORT_DESCRIPTIONS = {
|
|
163
|
+
"front-page": homeUrl,
|
|
164
|
+
date: (0, import_i18n.sprintf)(
|
|
165
|
+
// translators: %s: The homepage url.
|
|
166
|
+
(0, import_i18n.__)("E.g. %s"),
|
|
167
|
+
homeUrl + "/" + (/* @__PURE__ */ new Date()).getFullYear()
|
|
168
|
+
)
|
|
169
|
+
};
|
|
170
|
+
(0, import_element.useEffect)(() => {
|
|
171
|
+
if (containerRef.current && modalContent === modalContentMap.templatesList) {
|
|
172
|
+
const [firstFocusable] = import_dom.focus.focusable.find(
|
|
173
|
+
containerRef.current
|
|
174
|
+
);
|
|
175
|
+
firstFocusable?.focus();
|
|
176
|
+
}
|
|
177
|
+
}, [modalContent]);
|
|
178
|
+
async function createTemplate(template, isWPSuggestion = true) {
|
|
179
|
+
if (isSubmitting) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
setIsSubmitting(true);
|
|
183
|
+
try {
|
|
184
|
+
const { title, description, slug } = template;
|
|
185
|
+
const newTemplate = await saveEntityRecord(
|
|
186
|
+
"postType",
|
|
187
|
+
import_constants.TEMPLATE_POST_TYPE,
|
|
188
|
+
{
|
|
189
|
+
description,
|
|
190
|
+
// Slugs need to be strings, so this is for template `404`
|
|
191
|
+
slug: slug.toString(),
|
|
192
|
+
status: "publish",
|
|
193
|
+
title,
|
|
194
|
+
// This adds a post meta field in template that is part of `is_custom` value calculation.
|
|
195
|
+
is_wp_suggestion: isWPSuggestion
|
|
196
|
+
},
|
|
197
|
+
{ throwOnError: true }
|
|
198
|
+
);
|
|
199
|
+
history.navigate(
|
|
200
|
+
`/${import_constants.TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit`
|
|
201
|
+
);
|
|
202
|
+
createSuccessNotice(
|
|
203
|
+
(0, import_i18n.sprintf)(
|
|
204
|
+
// translators: %s: Title of the created post or template, e.g: "Hello world".
|
|
205
|
+
(0, import_i18n.__)('"%s" successfully created.'),
|
|
206
|
+
(0, import_html_entities.decodeEntities)(newTemplate.title?.rendered || title) || (0, import_i18n.__)("(no title)")
|
|
207
|
+
),
|
|
208
|
+
{
|
|
209
|
+
type: "snackbar"
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n.__)("An error occurred while creating the template.");
|
|
214
|
+
createErrorNotice(errorMessage, {
|
|
215
|
+
type: "snackbar"
|
|
216
|
+
});
|
|
217
|
+
} finally {
|
|
218
|
+
setIsSubmitting(false);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const onModalClose = () => {
|
|
222
|
+
onClose();
|
|
223
|
+
setModalContent(modalContentMap.templatesList);
|
|
224
|
+
};
|
|
225
|
+
let modalTitle = (0, import_i18n.__)("Add template");
|
|
226
|
+
if (modalContent === modalContentMap.customTemplate) {
|
|
227
|
+
modalTitle = (0, import_i18n.sprintf)(
|
|
228
|
+
// translators: %s: Name of the post type e.g: "Post".
|
|
229
|
+
(0, import_i18n.__)("Add template: %s"),
|
|
230
|
+
entityForSuggestions.labels.singular_name
|
|
231
|
+
);
|
|
232
|
+
} else if (modalContent === modalContentMap.customGenericTemplate) {
|
|
233
|
+
modalTitle = (0, import_i18n.__)("Create custom template");
|
|
234
|
+
}
|
|
235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
236
|
+
import_components.Modal,
|
|
237
|
+
{
|
|
238
|
+
title: modalTitle,
|
|
239
|
+
className: (0, import_clsx.default)("edit-site-add-new-template__modal", {
|
|
240
|
+
"edit-site-add-new-template__modal_template_list": modalContent === modalContentMap.templatesList,
|
|
241
|
+
"edit-site-custom-template-modal": modalContent === modalContentMap.customTemplate
|
|
242
|
+
}),
|
|
243
|
+
onRequestClose: onModalClose,
|
|
244
|
+
overlayClassName: modalContent === modalContentMap.customGenericTemplate ? "edit-site-custom-generic-template__modal" : void 0,
|
|
245
|
+
ref: containerRef,
|
|
246
|
+
children: [
|
|
247
|
+
modalContent === modalContentMap.templatesList && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
248
|
+
import_components.__experimentalGrid,
|
|
249
|
+
{
|
|
250
|
+
columns: isMobile ? 2 : 3,
|
|
251
|
+
gap: 4,
|
|
252
|
+
align: "flex-start",
|
|
253
|
+
justify: "center",
|
|
254
|
+
className: "edit-site-add-new-template__template-list__contents",
|
|
255
|
+
children: [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Flex, { className: "edit-site-add-new-template__template-list__prompt", children: (0, import_i18n.__)(
|
|
257
|
+
"Select what the new template should apply to:"
|
|
258
|
+
) }),
|
|
259
|
+
missingTemplates.map((template) => {
|
|
260
|
+
const { title, slug, onClick } = template;
|
|
261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
262
|
+
TemplateListItem,
|
|
263
|
+
{
|
|
264
|
+
title,
|
|
265
|
+
direction: "column",
|
|
266
|
+
className: "edit-site-add-new-template__template-button",
|
|
267
|
+
description: TEMPLATE_SHORT_DESCRIPTIONS[slug],
|
|
268
|
+
icon: TEMPLATE_ICONS[slug] || import_icons.layout,
|
|
269
|
+
onClick: () => onClick ? onClick(template) : createTemplate(template)
|
|
270
|
+
},
|
|
271
|
+
slug
|
|
272
|
+
);
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
275
|
+
TemplateListItem,
|
|
276
|
+
{
|
|
277
|
+
title: (0, import_i18n.__)("Custom template"),
|
|
278
|
+
direction: "row",
|
|
279
|
+
className: "edit-site-add-new-template__custom-template-button",
|
|
280
|
+
icon: import_icons.pencil,
|
|
281
|
+
onClick: () => setModalContent(
|
|
282
|
+
modalContentMap.customGenericTemplate
|
|
283
|
+
),
|
|
284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
285
|
+
import_components.__experimentalText,
|
|
286
|
+
{
|
|
287
|
+
lineHeight: 1.53846153846,
|
|
288
|
+
children: (0, import_i18n.__)(
|
|
289
|
+
"A custom template can be manually applied to any post or page."
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
modalContent === modalContentMap.customTemplate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
299
|
+
import_add_custom_template_modal_content.default,
|
|
300
|
+
{
|
|
301
|
+
onSelect: createTemplate,
|
|
302
|
+
entityForSuggestions,
|
|
303
|
+
onBack: () => setModalContent(modalContentMap.templatesList),
|
|
304
|
+
containerRef
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
modalContent === modalContentMap.customGenericTemplate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
308
|
+
import_add_custom_generic_template_modal_content.default,
|
|
309
|
+
{
|
|
310
|
+
createTemplate,
|
|
311
|
+
onBack: () => setModalContent(modalContentMap.templatesList)
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
function NewTemplate() {
|
|
319
|
+
const [showModal, setShowModal] = (0, import_element.useState)(false);
|
|
320
|
+
const { postType } = (0, import_data.useSelect)((select) => {
|
|
321
|
+
const { getPostType } = select(import_core_data.store);
|
|
322
|
+
return {
|
|
323
|
+
postType: getPostType(import_constants.TEMPLATE_POST_TYPE)
|
|
324
|
+
};
|
|
325
|
+
}, []);
|
|
326
|
+
if (!postType) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
331
|
+
import_components.Button,
|
|
332
|
+
{
|
|
333
|
+
variant: "primary",
|
|
334
|
+
onClick: () => setShowModal(true),
|
|
335
|
+
label: postType.labels.add_new_item,
|
|
336
|
+
__next40pxDefaultSize: true,
|
|
337
|
+
children: postType.labels.add_new_item
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
showModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NewTemplateModal, { onClose: () => setShowModal(false) })
|
|
341
|
+
] });
|
|
342
|
+
}
|
|
343
|
+
function useMissingTemplates(setEntityForSuggestions, onClick) {
|
|
344
|
+
const existingTemplates = (0, import_utils.useExistingTemplates)();
|
|
345
|
+
const defaultTemplateTypes = (0, import_utils.useDefaultTemplateTypes)();
|
|
346
|
+
const existingTemplateSlugs = (existingTemplates || []).map(
|
|
347
|
+
({ slug }) => slug
|
|
348
|
+
);
|
|
349
|
+
const missingDefaultTemplates = (defaultTemplateTypes || []).filter(
|
|
350
|
+
(template) => DEFAULT_TEMPLATE_SLUGS.includes(template.slug) && !existingTemplateSlugs.includes(template.slug)
|
|
351
|
+
);
|
|
352
|
+
const onClickMenuItem = (_entityForSuggestions) => {
|
|
353
|
+
onClick?.();
|
|
354
|
+
setEntityForSuggestions(_entityForSuggestions);
|
|
355
|
+
};
|
|
356
|
+
const enhancedMissingDefaultTemplateTypes = [...missingDefaultTemplates];
|
|
357
|
+
const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } = (0, import_utils.useTaxonomiesMenuItems)(onClickMenuItem);
|
|
358
|
+
const { defaultPostTypesMenuItems, postTypesMenuItems } = (0, import_utils.usePostTypeMenuItems)(onClickMenuItem);
|
|
359
|
+
const authorMenuItem = (0, import_utils.useAuthorMenuItem)(onClickMenuItem);
|
|
360
|
+
[
|
|
361
|
+
...defaultTaxonomiesMenuItems,
|
|
362
|
+
...defaultPostTypesMenuItems,
|
|
363
|
+
authorMenuItem
|
|
364
|
+
].forEach((menuItem) => {
|
|
365
|
+
if (!menuItem) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex(
|
|
369
|
+
(template) => template.slug === menuItem.slug
|
|
370
|
+
);
|
|
371
|
+
if (matchIndex > -1) {
|
|
372
|
+
enhancedMissingDefaultTemplateTypes[matchIndex] = menuItem;
|
|
373
|
+
} else {
|
|
374
|
+
enhancedMissingDefaultTemplateTypes.push(menuItem);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
enhancedMissingDefaultTemplateTypes?.sort((template1, template2) => {
|
|
378
|
+
return DEFAULT_TEMPLATE_SLUGS.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS.indexOf(template2.slug);
|
|
379
|
+
});
|
|
380
|
+
const missingTemplates = [
|
|
381
|
+
...enhancedMissingDefaultTemplateTypes,
|
|
382
|
+
...(0, import_utils.usePostTypeArchiveMenuItems)(),
|
|
383
|
+
...postTypesMenuItems,
|
|
384
|
+
...taxonomiesMenuItems
|
|
385
|
+
];
|
|
386
|
+
return missingTemplates;
|
|
387
|
+
}
|
|
388
|
+
var add_new_template_legacy_default = (0, import_element.memo)(NewTemplate);
|
|
389
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/add-new-template-legacy/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalGrid as Grid,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tFlex,\n\tIcon,\n} from '@wordpress/components';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState, memo, useRef, useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tarchive,\n\tblockMeta,\n\tcalendar,\n\tcategory,\n\tcommentAuthorAvatar,\n\tpencil,\n\thome,\n\tlayout,\n\tlist,\n\tmedia,\n\tnotFound,\n\tpage,\n\tpin,\n\tverse,\n\tsearch,\n\ttag,\n} from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\n/**\n * Internal dependencies\n */\nimport AddCustomTemplateModalContent from './add-custom-template-modal-content';\nimport {\n\tuseExistingTemplates,\n\tuseDefaultTemplateTypes,\n\tuseTaxonomiesMenuItems,\n\tusePostTypeMenuItems,\n\tuseAuthorMenuItem,\n\tusePostTypeArchiveMenuItems,\n} from './utils';\nimport AddCustomGenericTemplateModalContent from './add-custom-generic-template-modal-content';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst DEFAULT_TEMPLATE_SLUGS = [\n\t'front-page',\n\t'home',\n\t'single',\n\t'page',\n\t'index',\n\t'archive',\n\t'author',\n\t'category',\n\t'date',\n\t'tag',\n\t'search',\n\t'404',\n];\n\nconst TEMPLATE_ICONS = {\n\t'front-page': home,\n\thome: verse,\n\tsingle: pin,\n\tpage,\n\tarchive,\n\tsearch,\n\t404: notFound,\n\tindex: list,\n\tcategory,\n\tauthor: commentAuthorAvatar,\n\ttaxonomy: blockMeta,\n\tdate: calendar,\n\ttag,\n\tattachment: media,\n};\n\nfunction TemplateListItem( {\n\ttitle,\n\tdirection,\n\tclassName,\n\tdescription,\n\ticon,\n\tonClick,\n\tchildren,\n} ) {\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName={ className }\n\t\t\tonClick={ onClick }\n\t\t\tlabel={ description }\n\t\t\tshowTooltip={ !! description }\n\t\t>\n\t\t\t<Flex\n\t\t\t\tas=\"span\"\n\t\t\t\tspacing={ 2 }\n\t\t\t\talign=\"center\"\n\t\t\t\tjustify=\"center\"\n\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\tdirection={ direction }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-add-new-template__template-icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"edit-site-add-new-template__template-name\"\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tspacing={ 0 }\n\t\t\t\t>\n\t\t\t\t\t<Text\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tweight={ 500 }\n\t\t\t\t\t\tlineHeight={ 1.53846153846 } // 20px\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Text>\n\t\t\t\t\t{ children }\n\t\t\t\t</VStack>\n\t\t\t</Flex>\n\t\t</Button>\n\t);\n}\n\nconst modalContentMap = {\n\ttemplatesList: 1,\n\tcustomTemplate: 2,\n\tcustomGenericTemplate: 3,\n};\n\nfunction NewTemplateModal( { onClose } ) {\n\tconst [ modalContent, setModalContent ] = useState(\n\t\tmodalContentMap.templatesList\n\t);\n\tconst [ entityForSuggestions, setEntityForSuggestions ] = useState( {} );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst missingTemplates = useMissingTemplates( setEntityForSuggestions, () =>\n\t\tsetModalContent( modalContentMap.customTemplate )\n\t);\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst containerRef = useRef( null );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tconst TEMPLATE_SHORT_DESCRIPTIONS = {\n\t\t'front-page': homeUrl,\n\t\tdate: sprintf(\n\t\t\t// translators: %s: The homepage url.\n\t\t\t__( 'E.g. %s' ),\n\t\t\thomeUrl + '/' + new Date().getFullYear()\n\t\t),\n\t};\n\n\tuseEffect( () => {\n\t\t// Focus the first focusable element when component mounts or UI changes\n\t\t// We don't want to focus on the other modals because they have their own focus management.\n\t\tif (\n\t\t\tcontainerRef.current &&\n\t\t\tmodalContent === modalContentMap.templatesList\n\t\t) {\n\t\t\tconst [ firstFocusable ] = focus.focusable.find(\n\t\t\t\tcontainerRef.current\n\t\t\t);\n\t\t\tfirstFocusable?.focus();\n\t\t}\n\t}, [ modalContent ] );\n\n\tasync function createTemplate( template, isWPSuggestion = true ) {\n\t\tif ( isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsSubmitting( true );\n\t\ttry {\n\t\t\tconst { title, description, slug } = template;\n\t\t\tconst newTemplate = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tdescription,\n\t\t\t\t\t// Slugs need to be strings, so this is for template `404`\n\t\t\t\t\tslug: slug.toString(),\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\ttitle,\n\t\t\t\t\t// This adds a post meta field in template that is part of `is_custom` value calculation.\n\t\t\t\t\tis_wp_suggestion: isWPSuggestion,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\t// Navigate to the created template editor.\n\t\t\thistory.navigate(\n\t\t\t\t`/${ TEMPLATE_POST_TYPE }/${ newTemplate.id }?canvas=edit`\n\t\t\t);\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newTemplate.title?.rendered || title ) ||\n\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the template.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\tconst onModalClose = () => {\n\t\tonClose();\n\t\tsetModalContent( modalContentMap.templatesList );\n\t};\n\n\tlet modalTitle = __( 'Add template' );\n\tif ( modalContent === modalContentMap.customTemplate ) {\n\t\tmodalTitle = sprintf(\n\t\t\t// translators: %s: Name of the post type e.g: \"Post\".\n\t\t\t__( 'Add template: %s' ),\n\t\t\tentityForSuggestions.labels.singular_name\n\t\t);\n\t} else if ( modalContent === modalContentMap.customGenericTemplate ) {\n\t\tmodalTitle = __( 'Create custom template' );\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle }\n\t\t\tclassName={ clsx( 'edit-site-add-new-template__modal', {\n\t\t\t\t'edit-site-add-new-template__modal_template_list':\n\t\t\t\t\tmodalContent === modalContentMap.templatesList,\n\t\t\t\t'edit-site-custom-template-modal':\n\t\t\t\t\tmodalContent === modalContentMap.customTemplate,\n\t\t\t} ) }\n\t\t\tonRequestClose={ onModalClose }\n\t\t\toverlayClassName={\n\t\t\t\tmodalContent === modalContentMap.customGenericTemplate\n\t\t\t\t\t? 'edit-site-custom-generic-template__modal'\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tref={ containerRef }\n\t\t>\n\t\t\t{ modalContent === modalContentMap.templatesList && (\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns={ isMobile ? 2 : 3 }\n\t\t\t\t\tgap={ 4 }\n\t\t\t\t\talign=\"flex-start\"\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\tclassName=\"edit-site-add-new-template__template-list__contents\"\n\t\t\t\t>\n\t\t\t\t\t<Flex className=\"edit-site-add-new-template__template-list__prompt\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select what the new template should apply to:'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t\t{ missingTemplates.map( ( template ) => {\n\t\t\t\t\t\tconst { title, slug, onClick } = template;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<TemplateListItem\n\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-add-new-template__template-button\"\n\t\t\t\t\t\t\t\tdescription={\n\t\t\t\t\t\t\t\t\tTEMPLATE_SHORT_DESCRIPTIONS[ slug ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ticon={ TEMPLATE_ICONS[ slug ] || layout }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tonClick\n\t\t\t\t\t\t\t\t\t\t? onClick( template )\n\t\t\t\t\t\t\t\t\t\t: createTemplate( template )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t\t<TemplateListItem\n\t\t\t\t\t\ttitle={ __( 'Custom template' ) }\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tclassName=\"edit-site-add-new-template__custom-template-button\"\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tsetModalContent(\n\t\t\t\t\t\t\t\tmodalContentMap.customGenericTemplate\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tlineHeight={ 1.53846153846 } // 20px\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</TemplateListItem>\n\t\t\t\t</Grid>\n\t\t\t) }\n\t\t\t{ modalContent === modalContentMap.customTemplate && (\n\t\t\t\t<AddCustomTemplateModalContent\n\t\t\t\t\tonSelect={ createTemplate }\n\t\t\t\t\tentityForSuggestions={ entityForSuggestions }\n\t\t\t\t\tonBack={ () =>\n\t\t\t\t\t\tsetModalContent( modalContentMap.templatesList )\n\t\t\t\t\t}\n\t\t\t\t\tcontainerRef={ containerRef }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ modalContent === modalContentMap.customGenericTemplate && (\n\t\t\t\t<AddCustomGenericTemplateModalContent\n\t\t\t\t\tcreateTemplate={ createTemplate }\n\t\t\t\t\tonBack={ () =>\n\t\t\t\t\t\tsetModalContent( modalContentMap.templatesList )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Modal>\n\t);\n}\n\nfunction NewTemplate() {\n\tconst [ showModal, setShowModal ] = useState( false );\n\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( TEMPLATE_POST_TYPE ),\n\t\t};\n\t}, [] );\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonClick={ () => setShowModal( true ) }\n\t\t\t\tlabel={ postType.labels.add_new_item }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t>\n\t\t\t\t{ postType.labels.add_new_item }\n\t\t\t</Button>\n\t\t\t{ showModal && (\n\t\t\t\t<NewTemplateModal onClose={ () => setShowModal( false ) } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction useMissingTemplates( setEntityForSuggestions, onClick ) {\n\tconst existingTemplates = useExistingTemplates();\n\tconst defaultTemplateTypes = useDefaultTemplateTypes();\n\tconst existingTemplateSlugs = ( existingTemplates || [] ).map(\n\t\t( { slug } ) => slug\n\t);\n\tconst missingDefaultTemplates = ( defaultTemplateTypes || [] ).filter(\n\t\t( template ) =>\n\t\t\tDEFAULT_TEMPLATE_SLUGS.includes( template.slug ) &&\n\t\t\t! existingTemplateSlugs.includes( template.slug )\n\t);\n\tconst onClickMenuItem = ( _entityForSuggestions ) => {\n\t\tonClick?.();\n\t\tsetEntityForSuggestions( _entityForSuggestions );\n\t};\n\t// We need to replace existing default template types with\n\t// the create specific template functionality. The original\n\t// info (title, description, etc.) is preserved in the\n\t// used hooks.\n\tconst enhancedMissingDefaultTemplateTypes = [ ...missingDefaultTemplates ];\n\tconst { defaultTaxonomiesMenuItems, taxonomiesMenuItems } =\n\t\tuseTaxonomiesMenuItems( onClickMenuItem );\n\tconst { defaultPostTypesMenuItems, postTypesMenuItems } =\n\t\tusePostTypeMenuItems( onClickMenuItem );\n\n\tconst authorMenuItem = useAuthorMenuItem( onClickMenuItem );\n\t[\n\t\t...defaultTaxonomiesMenuItems,\n\t\t...defaultPostTypesMenuItems,\n\t\tauthorMenuItem,\n\t].forEach( ( menuItem ) => {\n\t\tif ( ! menuItem ) {\n\t\t\treturn;\n\t\t}\n\t\tconst matchIndex = enhancedMissingDefaultTemplateTypes.findIndex(\n\t\t\t( template ) => template.slug === menuItem.slug\n\t\t);\n\t\t// Some default template types might have been filtered above from\n\t\t// `missingDefaultTemplates` because they only check for the general\n\t\t// template. So here we either replace or append the item, augmented\n\t\t// with the check if it has available specific item to create a\n\t\t// template for.\n\t\tif ( matchIndex > -1 ) {\n\t\t\tenhancedMissingDefaultTemplateTypes[ matchIndex ] = menuItem;\n\t\t} else {\n\t\t\tenhancedMissingDefaultTemplateTypes.push( menuItem );\n\t\t}\n\t} );\n\t// Update the sort order to match the DEFAULT_TEMPLATE_SLUGS order.\n\tenhancedMissingDefaultTemplateTypes?.sort( ( template1, template2 ) => {\n\t\treturn (\n\t\t\tDEFAULT_TEMPLATE_SLUGS.indexOf( template1.slug ) -\n\t\t\tDEFAULT_TEMPLATE_SLUGS.indexOf( template2.slug )\n\t\t);\n\t} );\n\tconst missingTemplates = [\n\t\t...enhancedMissingDefaultTemplateTypes,\n\t\t...usePostTypeArchiveMenuItems(),\n\t\t...postTypesMenuItems,\n\t\t...taxonomiesMenuItems,\n\t];\n\treturn missingTemplates;\n}\n\nexport default memo( NewTemplate );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAQO;AACP,2BAA+B;AAC/B,qBAAkD;AAClD,kBAAuC;AACvC,uBAAmC;AACn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CAAE,GAAG,uBAAwB;AACzE,QAAM,EAAE,4BAA4B,oBAAoB,QACvD,qCAAwB,eAAgB;AACzC,QAAM,EAAE,2BAA2B,mBAAmB,QACrD,mCAAsB,eAAgB;AAEvC,QAAM,qBAAiB,gCAAmB,eAAgB;AAC1D;AAAA,IACC,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,EACD,EAAE,QAAS,CAAE,aAAc;AAC1B,QAAK,CAAE,UAAW;AACjB;AAAA,IACD;AACA,UAAM,aAAa,oCAAoC;AAAA,MACtD,CAAE,aAAc,SAAS,SAAS,SAAS;AAAA,IAC5C;AAMA,QAAK,aAAa,IAAK;AACtB,0CAAqC,UAAW,IAAI;AAAA,IACrD,OAAO;AACN,0CAAoC,KAAM,QAAS;AAAA,IACpD;AAAA,EACD,CAAE;AAEF,uCAAqC,KAAM,CAAE,WAAW,cAAe;AACtE,WACC,uBAAuB,QAAS,UAAU,IAAK,IAC/C,uBAAuB,QAAS,UAAU,IAAK;AAAA,EAEjD,CAAE;AACF,QAAM,mBAAmB;AAAA,IACxB,GAAG;AAAA,IACH,OAAG,0CAA4B;AAAA,IAC/B,GAAG;AAAA,IACH,GAAG;AAAA,EACJ;AACA,SAAO;AACR;AAEA,IAAO,sCAAQ,qBAAM,WAAY;",
|
|
6
|
+
"names": ["routerPrivateApis", "VStack", "Text", "coreStore", "noticesStore", "clsx", "Grid", "AddCustomTemplateModalContent", "AddCustomGenericTemplateModalContent"]
|
|
7
|
+
}
|