@wordpress/edit-site 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-page/index.js +2 -1
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/app/index.js +17 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/editor/index.js +55 -69
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +39 -0
- package/build/components/editor/use-editor-title.js.map +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +4 -23
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -0
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +11 -16
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +2 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +1 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -0
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +23 -95
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +1 -0
- package/build/components/page/header.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +5 -5
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/pagination/index.js +17 -8
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/posts-app/index.js +50 -0
- package/build/components/posts-app/index.js.map +1 -0
- package/build/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +1 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/site-hub/index.js +38 -128
- package/build/components/site-hub/index.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +53 -0
- package/build/hooks/commands/use-set-command-context.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +3 -2
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +20 -88
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +15 -2
- package/build/index.js.map +1 -1
- package/build/posts.js +34 -0
- package/build/posts.js.map +1 -0
- package/build/store/private-actions.js +33 -18
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/add-new-page/index.js +2 -1
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/app/index.js +17 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/editor/index.js +55 -69
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +31 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +4 -23
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -0
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +11 -16
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +3 -2
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -0
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +27 -99
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -0
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +5 -5
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/pagination/index.js +17 -8
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +43 -0
- package/build-module/components/posts-app/index.js.map +1 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +40 -130
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +46 -0
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +3 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +19 -86
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +8 -2
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +27 -0
- package/build-module/posts.js.map +1 -0
- package/build-module/store/private-actions.js +33 -18
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/posts-rtl.css +1707 -0
- package/build-style/posts.css +1707 -0
- package/build-style/style-rtl.css +59 -104
- package/build-style/style.css +59 -104
- package/package.json +41 -41
- package/src/components/add-new-page/index.js +2 -1
- package/src/components/app/index.js +17 -1
- package/src/components/block-editor/style.scss +11 -0
- package/src/components/editor/index.js +69 -103
- package/src/components/editor/style.scss +1 -5
- package/src/components/editor/use-editor-title.js +35 -0
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/src/components/global-styles/screen-css.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +4 -24
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/screen-revisions/style.scss +4 -8
- package/src/components/global-styles/shadows-edit-panel.js +1 -0
- package/src/components/global-styles/style.scss +1 -7
- package/src/components/global-styles/variations/variation.js +14 -19
- package/src/components/global-styles/variations/variations-color.js +12 -4
- package/src/components/global-styles/variations/variations-typography.js +5 -1
- package/src/components/global-styles-sidebar/index.js +2 -0
- package/src/components/global-styles-sidebar/style.scss +0 -1
- package/src/components/layout/index.js +41 -137
- package/src/components/layout/style.scss +18 -58
- package/src/components/page/header.js +1 -0
- package/src/components/page/style.scss +6 -0
- package/src/components/page-patterns/header.js +8 -2
- package/src/components/page-patterns/index.js +15 -12
- package/src/components/page-patterns/style.scss +6 -0
- package/src/components/pagination/index.js +21 -16
- package/src/components/posts-app/index.js +39 -0
- package/src/components/sidebar/style.scss +4 -4
- package/src/components/sidebar-dataviews/dataview-item.js +6 -2
- package/src/components/sidebar-navigation-screen/index.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +11 -2
- package/src/components/sidebar-navigation-screen-patterns/index.js +5 -1
- package/src/components/site-hub/index.js +55 -146
- package/src/components/site-hub/style.scss +1 -4
- package/src/components/site-icon/style.scss +0 -4
- package/src/hooks/commands/use-set-command-context.js +37 -0
- package/src/hooks/push-changes-to-global-styles/index.js +3 -2
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1 -875
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +29 -117
- package/src/index.js +10 -2
- package/src/posts.js +29 -0
- package/src/posts.scss +46 -0
- package/src/store/private-actions.js +58 -30
- package/build/components/block-editor/block-inspector-button.js +0 -57
- package/build/components/block-editor/block-inspector-button.js.map +0 -1
- package/build/components/block-editor/inserter-media-categories.js +0 -183
- package/build/components/block-editor/inserter-media-categories.js.map +0 -1
- package/build/components/template-part-converter/convert-to-regular.js +0 -38
- package/build/components/template-part-converter/convert-to-regular.js.map +0 -1
- package/build/components/template-part-converter/convert-to-template-part.js +0 -84
- package/build/components/template-part-converter/convert-to-template-part.js.map +0 -1
- package/build/components/template-part-converter/index.js +0 -67
- package/build/components/template-part-converter/index.js.map +0 -1
- package/build-module/components/block-editor/block-inspector-button.js +0 -50
- package/build-module/components/block-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/block-editor/inserter-media-categories.js +0 -177
- package/build-module/components/block-editor/inserter-media-categories.js.map +0 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +0 -31
- package/build-module/components/template-part-converter/convert-to-regular.js.map +0 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +0 -79
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +0 -1
- package/build-module/components/template-part-converter/index.js +0 -59
- package/build-module/components/template-part-converter/index.js.map +0 -1
- package/src/components/block-editor/block-inspector-button.js +0 -60
- package/src/components/block-editor/inserter-media-categories.js +0 -227
- package/src/components/template-part-converter/convert-to-regular.js +0 -32
- package/src/components/template-part-converter/convert-to-template-part.js +0 -78
- package/src/components/template-part-converter/index.js +0 -59
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = ConvertToRegularBlocks;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
function ConvertToRegularBlocks({
|
|
17
|
-
clientId,
|
|
18
|
-
onClose
|
|
19
|
-
}) {
|
|
20
|
-
const {
|
|
21
|
-
getBlocks
|
|
22
|
-
} = (0, _data.useSelect)(_blockEditor.store);
|
|
23
|
-
const {
|
|
24
|
-
replaceBlocks
|
|
25
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
26
|
-
const canRemove = (0, _data.useSelect)(select => select(_blockEditor.store).canRemoveBlock(clientId), [clientId]);
|
|
27
|
-
if (!canRemove) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
31
|
-
onClick: () => {
|
|
32
|
-
replaceBlocks(clientId, getBlocks(clientId));
|
|
33
|
-
onClose();
|
|
34
|
-
},
|
|
35
|
-
children: (0, _i18n.__)('Detach')
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=convert-to-regular.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_components","_i18n","_jsxRuntime","ConvertToRegularBlocks","clientId","onClose","getBlocks","useSelect","blockEditorStore","replaceBlocks","useDispatch","canRemove","select","canRemoveBlock","jsx","MenuItem","onClick","children","__"],"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-regular.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToRegularBlocks( { clientId, onClose } ) {\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tif ( ! canRemove ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\treplaceBlocks( clientId, getBlocks( clientId ) );\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Detach' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,IAAAI,WAAA,GAAAJ,OAAA;AANrC;AACA;AACA;;AAMe,SAASK,sBAAsBA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EAAEC,kBAAiB,CAAC;EACnD,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEF,kBAAiB,CAAC;EAEzD,MAAMG,SAAS,GAAG,IAAAJ,eAAS,EACxBK,MAAM,IAAMA,MAAM,CAAEJ,kBAAiB,CAAC,CAACK,cAAc,CAAET,QAAS,CAAC,EACnE,CAAEA,QAAQ,CACX,CAAC;EAED,IAAK,CAAEO,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAT,WAAA,CAAAY,GAAA,EAACd,WAAA,CAAAe,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfP,aAAa,CAAEL,QAAQ,EAAEE,SAAS,CAAEF,QAAS,CAAE,CAAC;MAChDC,OAAO,CAAC,CAAC;IACV,CAAG;IAAAY,QAAA,EAED,IAAAC,QAAE,EAAE,QAAS;EAAC,CACP,CAAC;AAEb","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = ConvertToTemplatePart;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _blocks = require("@wordpress/blocks");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _element = require("@wordpress/element");
|
|
13
|
-
var _notices = require("@wordpress/notices");
|
|
14
|
-
var _icons = require("@wordpress/icons");
|
|
15
|
-
var _editor = require("@wordpress/editor");
|
|
16
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
-
var _store = require("../../store");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
CreateTemplatePartModal
|
|
29
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
30
|
-
function ConvertToTemplatePart({
|
|
31
|
-
clientIds,
|
|
32
|
-
blocks
|
|
33
|
-
}) {
|
|
34
|
-
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
|
|
35
|
-
const {
|
|
36
|
-
replaceBlocks
|
|
37
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
38
|
-
const {
|
|
39
|
-
createSuccessNotice
|
|
40
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
41
|
-
const {
|
|
42
|
-
canCreate
|
|
43
|
-
} = (0, _data.useSelect)(select => {
|
|
44
|
-
const {
|
|
45
|
-
supportsTemplatePartsMode
|
|
46
|
-
} = select(_store.store).getSettings();
|
|
47
|
-
return {
|
|
48
|
-
canCreate: !supportsTemplatePartsMode
|
|
49
|
-
};
|
|
50
|
-
}, []);
|
|
51
|
-
if (!canCreate) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
const onConvert = async templatePart => {
|
|
55
|
-
replaceBlocks(clientIds, (0, _blocks.createBlock)('core/template-part', {
|
|
56
|
-
slug: templatePart.slug,
|
|
57
|
-
theme: templatePart.theme
|
|
58
|
-
}));
|
|
59
|
-
createSuccessNotice((0, _i18n.__)('Template part created.'), {
|
|
60
|
-
type: 'snackbar'
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// The modal and this component will be unmounted because of `replaceBlocks` above,
|
|
64
|
-
// so no need to call `closeModal` or `onClose`.
|
|
65
|
-
};
|
|
66
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
67
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
68
|
-
icon: _icons.symbolFilled,
|
|
69
|
-
onClick: () => {
|
|
70
|
-
setIsModalOpen(true);
|
|
71
|
-
},
|
|
72
|
-
"aria-expanded": isModalOpen,
|
|
73
|
-
"aria-haspopup": "dialog",
|
|
74
|
-
children: (0, _i18n.__)('Create template part')
|
|
75
|
-
}), isModalOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(CreateTemplatePartModal, {
|
|
76
|
-
closeModal: () => {
|
|
77
|
-
setIsModalOpen(false);
|
|
78
|
-
},
|
|
79
|
-
blocks: blocks,
|
|
80
|
-
onCreate: onConvert
|
|
81
|
-
})]
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=convert-to-template-part.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_components","_blocks","_i18n","_element","_notices","_icons","_editor","_lockUnlock","_store","_jsxRuntime","CreateTemplatePartModal","unlock","editorPrivateApis","ConvertToTemplatePart","clientIds","blocks","isModalOpen","setIsModalOpen","useState","replaceBlocks","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","canCreate","useSelect","select","supportsTemplatePartsMode","editSiteStore","getSettings","onConvert","templatePart","createBlock","slug","theme","__","type","jsxs","Fragment","children","jsx","MenuItem","icon","symbolFilled","onClick","closeModal","onCreate"],"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-template-part.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { symbolFilled } from '@wordpress/icons';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { CreateTemplatePartModal } = unlock( editorPrivateApis );\n\nexport default function ConvertToTemplatePart( { clientIds, blocks } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { canCreate } = useSelect( ( select ) => {\n\t\tconst { supportsTemplatePartsMode } =\n\t\t\tselect( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tcanCreate: ! supportsTemplatePartsMode,\n\t\t};\n\t}, [] );\n\n\tif ( ! canCreate ) {\n\t\treturn null;\n\t}\n\n\tconst onConvert = async ( templatePart ) => {\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\n\t\t// The modal and this component will be unmounted because of `replaceBlocks` above,\n\t\t// so no need to call `closeModal` or `onClose`.\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\ticon={ symbolFilled }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t} }\n\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ __( 'Create template part' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplat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AAK,CAAEH,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMM,SAAS,GAAG,MAAQC,YAAY,IAAM;IAC3CZ,aAAa,CACZL,SAAS,EACT,IAAAkB,mBAAW,EAAE,oBAAoB,EAAE;MAClCC,IAAI,EAAEF,YAAY,CAACE,IAAI;MACvBC,KAAK,EAAEH,YAAY,CAACG;IACrB,CAAE,CACH,CAAC;IACDZ,mBAAmB,CAAE,IAAAa,QAAE,EAAE,wBAAyB,CAAC,EAAE;MACpDC,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;EACD,CAAC;EAED,oBACC,IAAA3B,WAAA,CAAA4B,IAAA,EAAA5B,WAAA,CAAA6B,QAAA;IAAAC,QAAA,gBACC,IAAA9B,WAAA,CAAA+B,GAAA,EAACxC,WAAA,CAAAyC,QAAQ;MACRC,IAAI,EAAGC,mBAAc;MACrBC,OAAO,EAAGA,CAAA,KAAM;QACf3B,cAAc,CAAE,IAAK,CAAC;MACvB,CAAG;MACH,iBAAgBD,WAAa;MAC7B,iBAAc,QAAQ;MAAAuB,QAAA,EAEpB,IAAAJ,QAAE,EAAE,sBAAuB;IAAC,CACrB,CAAC,EACTnB,WAAW,iBACZ,IAAAP,WAAA,CAAA+B,GAAA,EAAC9B,uBAAuB;MACvBmC,UAAU,EAAGA,CAAA,KAAM;QAClB5B,cAAc,CAAE,KAAM,CAAC;MACxB,CAAG;MACHF,MAAM,EAAGA,MAAQ;MACjB+B,QAAQ,EAAGhB;IAAW,CACtB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = TemplatePartConverter;
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
-
var _convertToRegular = _interopRequireDefault(require("./convert-to-regular"));
|
|
11
|
-
var _convertToTemplatePart = _interopRequireDefault(require("./convert-to-template-part"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function TemplatePartConverter() {
|
|
22
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockSettingsMenuControls, {
|
|
23
|
-
children: ({
|
|
24
|
-
selectedClientIds,
|
|
25
|
-
onClose
|
|
26
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(TemplatePartConverterMenuItem, {
|
|
27
|
-
clientIds: selectedClientIds,
|
|
28
|
-
onClose: onClose
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function TemplatePartConverterMenuItem({
|
|
33
|
-
clientIds,
|
|
34
|
-
onClose
|
|
35
|
-
}) {
|
|
36
|
-
const {
|
|
37
|
-
isContentOnly,
|
|
38
|
-
blocks
|
|
39
|
-
} = (0, _data.useSelect)(select => {
|
|
40
|
-
const {
|
|
41
|
-
getBlocksByClientId,
|
|
42
|
-
getBlockEditingMode
|
|
43
|
-
} = select(_blockEditor.store);
|
|
44
|
-
return {
|
|
45
|
-
blocks: getBlocksByClientId(clientIds),
|
|
46
|
-
isContentOnly: clientIds.length === 1 && getBlockEditingMode(clientIds[0]) === 'contentOnly'
|
|
47
|
-
};
|
|
48
|
-
}, [clientIds]);
|
|
49
|
-
|
|
50
|
-
// Do not show the convert button if the block is in content-only mode.
|
|
51
|
-
if (isContentOnly) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Allow converting a single template part to standard blocks.
|
|
56
|
-
if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') {
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_convertToRegular.default, {
|
|
58
|
-
clientId: clientIds[0],
|
|
59
|
-
onClose: onClose
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_convertToTemplatePart.default, {
|
|
63
|
-
clientIds: clientIds,
|
|
64
|
-
blocks: blocks
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_convertToRegular","_interopRequireDefault","_convertToTemplatePart","_jsxRuntime","TemplatePartConverter","jsx","BlockSettingsMenuControls","children","selectedClientIds","onClose","TemplatePartConverterMenuItem","clientIds","isContentOnly","blocks","useSelect","select","getBlocksByClientId","getBlockEditingMode","blockEditorStore","length","name","default","clientId"],"sources":["@wordpress/edit-site/src/components/template-part-converter/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ConvertToRegularBlocks from './convert-to-regular';\nimport ConvertToTemplatePart from './convert-to-template-part';\n\nexport default function TemplatePartConverter() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) => (\n\t\t\t\t<TemplatePartConverterMenuItem\n\t\t\t\t\tclientIds={ selectedClientIds }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n\nfunction TemplatePartConverterMenuItem( { clientIds, onClose } ) {\n\tconst { isContentOnly, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocksByClientId, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tblocks: getBlocksByClientId( clientIds ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tclientIds.length === 1 &&\n\t\t\t\t\tgetBlockEditingMode( clientIds[ 0 ] ) === 'contentOnly',\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\t// Do not show the convert button if the block is in content-only mode.\n\tif ( isContentOnly ) {\n\t\treturn null;\n\t}\n\n\t// Allow converting a single template part to standard blocks.\n\tif ( blocks.length === 1 && blocks[ 0 ]?.name === 'core/template-part' ) {\n\t\treturn (\n\t\t\t<ConvertToRegularBlocks\n\t\t\t\tclientId={ clientIds[ 0 ] }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\treturn <ConvertToTemplatePart clientIds={ clientIds } blocks={ blocks } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA+D,IAAAK,WAAA,GAAAL,OAAA;AAb/D;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASM,qBAAqBA,CAAA,EAAG;EAC/C,oBACC,IAAAD,WAAA,CAAAE,GAAA,EAACN,YAAA,CAAAO,yBAAyB;IAAAC,QAAA,EACvBA,CAAE;MAAEC,iBAAiB;MAAEC;IAAQ,CAAC,kBACjC,IAAAN,WAAA,CAAAE,GAAA,EAACK,6BAA6B;MAC7BC,SAAS,EAAGH,iBAAmB;MAC/BC,OAAO,EAAGA;IAAS,CACnB;EACD,CACyB,CAAC;AAE9B;AAEA,SAASC,6BAA6BA,CAAE;EAAEC,SAAS;EAAEF;AAAQ,CAAC,EAAG;EAChE,MAAM;IAAEG,aAAa;IAAEC;EAAO,CAAC,GAAG,IAAAC,eAAS,EACxCC,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAoB,CAAC,GACjDF,MAAM,CAAEG,kBAAiB,CAAC;IAC3B,OAAO;MACNL,MAAM,EAAEG,mBAAmB,CAAEL,SAAU,CAAC;MACxCC,aAAa,EACZD,SAAS,CAACQ,MAAM,KAAK,CAAC,IACtBF,mBAAmB,CAAEN,SAAS,CAAE,CAAC,CAAG,CAAC,KAAK;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;;EAED;EACA,IAAKC,aAAa,EAAG;IACpB,OAAO,IAAI;EACZ;;EAEA;EACA,IAAKC,MAAM,CAACM,MAAM,KAAK,CAAC,IAAIN,MAAM,CAAE,CAAC,CAAE,EAAEO,IAAI,KAAK,oBAAoB,EAAG;IACxE,oBACC,IAAAjB,WAAA,CAAAE,GAAA,EAACL,iBAAA,CAAAqB,OAAsB;MACtBC,QAAQ,EAAGX,SAAS,CAAE,CAAC,CAAI;MAC3BF,OAAO,EAAGA;IAAS,CACnB,CAAC;EAEJ;EACA,oBAAO,IAAAN,WAAA,CAAAE,GAAA,EAACH,sBAAA,CAAAmB,OAAqB;IAACV,SAAS,EAAGA,SAAW;IAACE,MAAM,EAAGA;EAAQ,CAAE,CAAC;AAC3E","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { speak } from '@wordpress/a11y';
|
|
6
|
-
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
9
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const {
|
|
17
|
-
interfaceStore
|
|
18
|
-
} = unlock(editorPrivateApis);
|
|
19
|
-
export default function BlockInspectorButton({
|
|
20
|
-
onClick = () => {}
|
|
21
|
-
}) {
|
|
22
|
-
const {
|
|
23
|
-
shortcut,
|
|
24
|
-
isBlockInspectorOpen
|
|
25
|
-
} = useSelect(select => ({
|
|
26
|
-
shortcut: select(keyboardShortcutsStore).getShortcutRepresentation('core/editor/toggle-sidebar'),
|
|
27
|
-
isBlockInspectorOpen: select(interfaceStore).getActiveComplementaryArea('core') === 'edit-post/block'
|
|
28
|
-
}), []);
|
|
29
|
-
const {
|
|
30
|
-
enableComplementaryArea,
|
|
31
|
-
disableComplementaryArea
|
|
32
|
-
} = useDispatch(interfaceStore);
|
|
33
|
-
const label = isBlockInspectorOpen ? __('Hide more settings') : __('Show more settings');
|
|
34
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
|
35
|
-
onClick: () => {
|
|
36
|
-
if (isBlockInspectorOpen) {
|
|
37
|
-
disableComplementaryArea('core');
|
|
38
|
-
speak(__('Block settings closed'));
|
|
39
|
-
} else {
|
|
40
|
-
enableComplementaryArea('core', 'edit-post/block');
|
|
41
|
-
speak(__('Additional settings are now available in the Editor block settings sidebar'));
|
|
42
|
-
}
|
|
43
|
-
// Close dropdown menu.
|
|
44
|
-
onClick();
|
|
45
|
-
},
|
|
46
|
-
shortcut: shortcut,
|
|
47
|
-
children: label
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=block-inspector-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","speak","MenuItem","useSelect","useDispatch","store","keyboardShortcutsStore","privateApis","editorPrivateApis","unlock","jsx","_jsx","interfaceStore","BlockInspectorButton","onClick","shortcut","isBlockInspectorOpen","select","getShortcutRepresentation","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea","label","children"],"sources":["@wordpress/edit-site/src/components/block-editor/block-inspector-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function BlockInspectorButton( { onClick = () => {} } ) {\n\tconst { shortcut, isBlockInspectorOpen } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' ),\n\t\t\tisBlockInspectorOpen:\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\t'core'\n\t\t\t\t) === 'edit-post/block',\n\t\t} ),\n\t\t[]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\n\tconst label = isBlockInspectorOpen\n\t\t? __( 'Hide more settings' )\n\t\t: __( 'Show more settings' );\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isBlockInspectorOpen ) {\n\t\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t\t\tspeak( __( 'Block settings closed' ) );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t\t\t\tspeak(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Additional settings are now available in the Editor block settings sidebar'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Close dropdown menu.\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAi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ACAc,OAAO,CAAC,CAAC;IACV,CAAG;IACHC,QAAQ,EAAGA,QAAU;IAAAQ,QAAA,EAEnBD;EAAK,CACE,CAAC;AAEb","ignoreList":[]}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `edit-site` settings here need to be in sync with the corresponding ones in `site-editor` package.
|
|
3
|
-
* See `packages/edit-site/src/components/block-editor/inserter-media-categories.js`.
|
|
4
|
-
*
|
|
5
|
-
* In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`.
|
|
6
|
-
* The rest of the settings would still need to be in sync though.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
import { __, sprintf, _x } from '@wordpress/i18n';
|
|
13
|
-
import { resolveSelect } from '@wordpress/data';
|
|
14
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
20
|
-
|
|
21
|
-
/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */
|
|
22
|
-
/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */
|
|
23
|
-
/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */
|
|
24
|
-
|
|
25
|
-
const getExternalLink = (url, text) => `<a ${getExternalLinkAttributes(url)}>${text}</a>`;
|
|
26
|
-
const getExternalLinkAttributes = url => `href="${url}" target="_blank" rel="noreferrer noopener"`;
|
|
27
|
-
const getOpenverseLicense = (license, licenseVersion) => {
|
|
28
|
-
let licenseName = license.trim();
|
|
29
|
-
// PDM has no abbreviation
|
|
30
|
-
if (license !== 'pdm') {
|
|
31
|
-
licenseName = license.toUpperCase().replace('SAMPLING', 'Sampling');
|
|
32
|
-
}
|
|
33
|
-
// If version is known, append version to the name.
|
|
34
|
-
// The license has to have a version to be valid. Only
|
|
35
|
-
// PDM (public domain mark) doesn't have a version.
|
|
36
|
-
if (licenseVersion) {
|
|
37
|
-
licenseName += ` ${licenseVersion}`;
|
|
38
|
-
}
|
|
39
|
-
// For licenses other than public-domain marks, prepend 'CC' to the name.
|
|
40
|
-
if (!['pdm', 'cc0'].includes(license)) {
|
|
41
|
-
licenseName = `CC ${licenseName}`;
|
|
42
|
-
}
|
|
43
|
-
return licenseName;
|
|
44
|
-
};
|
|
45
|
-
const getOpenverseCaption = item => {
|
|
46
|
-
const {
|
|
47
|
-
title,
|
|
48
|
-
foreign_landing_url: foreignLandingUrl,
|
|
49
|
-
creator,
|
|
50
|
-
creator_url: creatorUrl,
|
|
51
|
-
license,
|
|
52
|
-
license_version: licenseVersion,
|
|
53
|
-
license_url: licenseUrl
|
|
54
|
-
} = item;
|
|
55
|
-
const fullLicense = getOpenverseLicense(license, licenseVersion);
|
|
56
|
-
const _creator = decodeEntities(creator);
|
|
57
|
-
let _caption;
|
|
58
|
-
if (_creator) {
|
|
59
|
-
_caption = title ? sprintf(
|
|
60
|
-
// translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: "CC0 1.0".
|
|
61
|
-
_x('"%1$s" by %2$s/ %3$s', 'caption'), getExternalLink(foreignLandingUrl, decodeEntities(title)), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : sprintf(
|
|
62
|
-
// translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: "CC0 1.0".
|
|
63
|
-
_x('<a %1$s>Work</a> by %2$s/ %3$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense);
|
|
64
|
-
} else {
|
|
65
|
-
_caption = title ? sprintf(
|
|
66
|
-
// translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: "CC0 1.0".
|
|
67
|
-
_x('"%1$s"/ %2$s', 'caption'), getExternalLink(foreignLandingUrl, decodeEntities(title)), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : sprintf(
|
|
68
|
-
// translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: "CC0 1.0".
|
|
69
|
-
_x('<a %1$s>Work</a>/ %3$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), licenseUrl ? getExternalLink(`${licenseUrl}?ref=openverse`, fullLicense) : fullLicense);
|
|
70
|
-
}
|
|
71
|
-
return _caption.replace(/\s{2}/g, ' ');
|
|
72
|
-
};
|
|
73
|
-
const coreMediaFetch = async (query = {}) => {
|
|
74
|
-
const mediaItems = await resolveSelect(coreStore).getMediaItems({
|
|
75
|
-
...query,
|
|
76
|
-
orderBy: !!query?.search ? 'relevance' : 'date'
|
|
77
|
-
});
|
|
78
|
-
return mediaItems.map(mediaItem => ({
|
|
79
|
-
...mediaItem,
|
|
80
|
-
alt: mediaItem.alt_text,
|
|
81
|
-
url: mediaItem.source_url,
|
|
82
|
-
previewUrl: mediaItem.media_details?.sizes?.medium?.source_url,
|
|
83
|
-
caption: mediaItem.caption?.raw
|
|
84
|
-
}));
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/** @type {InserterMediaCategory[]} */
|
|
88
|
-
const inserterMediaCategories = [{
|
|
89
|
-
name: 'images',
|
|
90
|
-
labels: {
|
|
91
|
-
name: __('Images'),
|
|
92
|
-
search_items: __('Search images')
|
|
93
|
-
},
|
|
94
|
-
mediaType: 'image',
|
|
95
|
-
async fetch(query = {}) {
|
|
96
|
-
return coreMediaFetch({
|
|
97
|
-
...query,
|
|
98
|
-
media_type: 'image'
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
name: 'videos',
|
|
103
|
-
labels: {
|
|
104
|
-
name: __('Videos'),
|
|
105
|
-
search_items: __('Search videos')
|
|
106
|
-
},
|
|
107
|
-
mediaType: 'video',
|
|
108
|
-
async fetch(query = {}) {
|
|
109
|
-
return coreMediaFetch({
|
|
110
|
-
...query,
|
|
111
|
-
media_type: 'video'
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
name: 'audio',
|
|
116
|
-
labels: {
|
|
117
|
-
name: __('Audio'),
|
|
118
|
-
search_items: __('Search audio')
|
|
119
|
-
},
|
|
120
|
-
mediaType: 'audio',
|
|
121
|
-
async fetch(query = {}) {
|
|
122
|
-
return coreMediaFetch({
|
|
123
|
-
...query,
|
|
124
|
-
media_type: 'audio'
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}, {
|
|
128
|
-
name: 'openverse',
|
|
129
|
-
labels: {
|
|
130
|
-
name: __('Openverse'),
|
|
131
|
-
search_items: __('Search Openverse')
|
|
132
|
-
},
|
|
133
|
-
mediaType: 'image',
|
|
134
|
-
async fetch(query = {}) {
|
|
135
|
-
const defaultArgs = {
|
|
136
|
-
mature: false,
|
|
137
|
-
excluded_source: 'flickr,inaturalist,wikimedia',
|
|
138
|
-
license: 'pdm,cc0'
|
|
139
|
-
};
|
|
140
|
-
const finalQuery = {
|
|
141
|
-
...query,
|
|
142
|
-
...defaultArgs
|
|
143
|
-
};
|
|
144
|
-
const mapFromInserterMediaRequest = {
|
|
145
|
-
per_page: 'page_size',
|
|
146
|
-
search: 'q'
|
|
147
|
-
};
|
|
148
|
-
const url = new URL('https://api.openverse.engineering/v1/images/');
|
|
149
|
-
Object.entries(finalQuery).forEach(([key, value]) => {
|
|
150
|
-
const queryKey = mapFromInserterMediaRequest[key] || key;
|
|
151
|
-
url.searchParams.set(queryKey, value);
|
|
152
|
-
});
|
|
153
|
-
const response = await window.fetch(url, {
|
|
154
|
-
headers: {
|
|
155
|
-
'User-Agent': 'WordPress/inserter-media-fetch'
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
const jsonResponse = await response.json();
|
|
159
|
-
const results = jsonResponse.results;
|
|
160
|
-
return results.map(result => ({
|
|
161
|
-
...result,
|
|
162
|
-
// This is a temp solution for better titles, until Openverse API
|
|
163
|
-
// completes the cleaning up of some titles of their upstream data.
|
|
164
|
-
title: result.title?.toLowerCase().startsWith('file:') ? result.title.slice(5) : result.title,
|
|
165
|
-
sourceId: result.id,
|
|
166
|
-
id: undefined,
|
|
167
|
-
caption: getOpenverseCaption(result),
|
|
168
|
-
previewUrl: result.thumbnail
|
|
169
|
-
}));
|
|
170
|
-
},
|
|
171
|
-
getReportUrl: ({
|
|
172
|
-
sourceId
|
|
173
|
-
}) => `https://wordpress.org/openverse/image/${sourceId}/report/`,
|
|
174
|
-
isExternalResource: true
|
|
175
|
-
}];
|
|
176
|
-
export default inserterMediaCategories;
|
|
177
|
-
//# sourceMappingURL=inserter-media-categories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","_x","resolveSelect","decodeEntities","store","coreStore","getExternalLink","url","text","getExternalLinkAttributes","getOpenverseLicense","license","licenseVersion","licenseName","trim","toUpperCase","replace","includes","getOpenverseCaption","item","title","foreign_landing_url","foreignLandingUrl","creator","creator_url","creatorUrl","license_version","license_url","licenseUrl","fullLicense","_creator","_caption","coreMediaFetch","query","mediaItems","getMediaItems","orderBy","search","map","mediaItem","alt","alt_text","source_url","previewUrl","media_details","sizes","medium","caption","raw","inserterMediaCategories","name","labels","search_items","mediaType","fetch","media_type","defaultArgs","mature","excluded_source","finalQuery","mapFromInserterMediaRequest","per_page","URL","Object","entries","forEach","key","value","queryKey","searchParams","set","response","window","headers","jsonResponse","json","results","result","toLowerCase","startsWith","slice","sourceId","id","undefined","thumbnail","getReportUrl","isExternalResource"],"sources":["@wordpress/edit-site/src/components/block-editor/inserter-media-categories.js"],"sourcesContent":["/**\n * The `edit-site` settings here need to be in sync with the corresponding ones in `site-editor` package.\n * See `packages/edit-site/src/components/block-editor/inserter-media-categories.js`.\n *\n * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`.\n * The rest of the settings would still need to be in sync though.\n */\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport { resolveSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */\n/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */\n/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */\n\nconst getExternalLink = ( url, text ) =>\n\t`<a ${ getExternalLinkAttributes( url ) }>${ text }</a>`;\n\nconst getExternalLinkAttributes = ( url ) =>\n\t`href=\"${ url }\" target=\"_blank\" rel=\"noreferrer noopener\"`;\n\nconst getOpenverseLicense = ( license, licenseVersion ) => {\n\tlet licenseName = license.trim();\n\t// PDM has no abbreviation\n\tif ( license !== 'pdm' ) {\n\t\tlicenseName = license.toUpperCase().replace( 'SAMPLING', 'Sampling' );\n\t}\n\t// If version is known, append version to the name.\n\t// The license has to have a version to be valid. Only\n\t// PDM (public domain mark) doesn't have a version.\n\tif ( licenseVersion ) {\n\t\tlicenseName += ` ${ licenseVersion }`;\n\t}\n\t// For licenses other than public-domain marks, prepend 'CC' to the name.\n\tif ( ! [ 'pdm', 'cc0' ].includes( license ) ) {\n\t\tlicenseName = `CC ${ licenseName }`;\n\t}\n\treturn licenseName;\n};\n\nconst getOpenverseCaption = ( item ) => {\n\tconst {\n\t\ttitle,\n\t\tforeign_landing_url: foreignLandingUrl,\n\t\tcreator,\n\t\tcreator_url: creatorUrl,\n\t\tlicense,\n\t\tlicense_version: licenseVersion,\n\t\tlicense_url: licenseUrl,\n\t} = item;\n\tconst fullLicense = getOpenverseLicense( license, licenseVersion );\n\tconst _creator = decodeEntities( creator );\n\tlet _caption;\n\tif ( _creator ) {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\" by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a> by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t} else {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\"/ %2$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a>/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t}\n\treturn _caption.replace( /\\s{2}/g, ' ' );\n};\n\nconst coreMediaFetch = async ( query = {} ) => {\n\tconst mediaItems = await resolveSelect( coreStore ).getMediaItems( {\n\t\t...query,\n\t\torderBy: !! query?.search ? 'relevance' : 'date',\n\t} );\n\treturn mediaItems.map( ( mediaItem ) => ( {\n\t\t...mediaItem,\n\t\talt: mediaItem.alt_text,\n\t\turl: mediaItem.source_url,\n\t\tpreviewUrl: mediaItem.media_details?.sizes?.medium?.source_url,\n\t\tcaption: mediaItem.caption?.raw,\n\t} ) );\n};\n\n/** @type {InserterMediaCategory[]} */\nconst inserterMediaCategories = [\n\t{\n\t\tname: 'images',\n\t\tlabels: {\n\t\t\tname: __( 'Images' ),\n\t\t\tsearch_items: __( 'Search images' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'image' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'videos',\n\t\tlabels: {\n\t\t\tname: __( 'Videos' ),\n\t\t\tsearch_items: __( 'Search videos' ),\n\t\t},\n\t\tmediaType: 'video',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'video' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'audio',\n\t\tlabels: {\n\t\t\tname: __( 'Audio' ),\n\t\t\tsearch_items: __( 'Search audio' ),\n\t\t},\n\t\tmediaType: 'audio',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'audio' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'openverse',\n\t\tlabels: {\n\t\t\tname: __( 'Openverse' ),\n\t\t\tsearch_items: __( 'Search Openverse' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\tconst defaultArgs = {\n\t\t\t\tmature: false,\n\t\t\t\texcluded_source: 'flickr,inaturalist,wikimedia',\n\t\t\t\tlicense: 'pdm,cc0',\n\t\t\t};\n\t\t\tconst finalQuery = { ...query, ...defaultArgs };\n\t\t\tconst mapFromInserterMediaRequest = {\n\t\t\t\tper_page: 'page_size',\n\t\t\t\tsearch: 'q',\n\t\t\t};\n\t\t\tconst url = new URL(\n\t\t\t\t'https://api.openverse.engineering/v1/images/'\n\t\t\t);\n\t\t\tObject.entries( finalQuery ).forEach( ( [ key, value ] ) => {\n\t\t\t\tconst queryKey = mapFromInserterMediaRequest[ key ] || key;\n\t\t\t\turl.searchParams.set( queryKey, value );\n\t\t\t} );\n\t\t\tconst response = await window.fetch( url, {\n\t\t\t\theaders: {\n\t\t\t\t\t'User-Agent': 'WordPress/inserter-media-fetch',\n\t\t\t\t},\n\t\t\t} );\n\t\t\tconst jsonResponse = await response.json();\n\t\t\tconst results = jsonResponse.results;\n\t\t\treturn results.map( ( result ) => ( {\n\t\t\t\t...result,\n\t\t\t\t// This is a temp solution for better titles, until Openverse API\n\t\t\t\t// completes the cleaning up of some titles of their upstream data.\n\t\t\t\ttitle: result.title?.toLowerCase().startsWith( 'file:' )\n\t\t\t\t\t? result.title.slice( 5 )\n\t\t\t\t\t: result.title,\n\t\t\t\tsourceId: result.id,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: getOpenverseCaption( result ),\n\t\t\t\tpreviewUrl: result.thumbnail,\n\t\t\t} ) );\n\t\t},\n\t\tgetReportUrl: ( { sourceId } ) =>\n\t\t\t`https://wordpress.org/openverse/image/${ sourceId }/report/`,\n\t\tisExternalResource: true,\n\t},\n];\n\nexport default inserterMediaCategories;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;;AAEA,MAAMC,eAAe,GAAGA,CAAEC,GAAG,EAAEC,IAAI,KACjC,MAAMC,yBAAyB,CAAEF,GAAI,CAAG,IAAIC,IAAM,MAAK;AAEzD,MAAMC,yBAAyB,GAAKF,GAAG,IACrC,SAASA,GAAK,6CAA4C;AAE5D,MAAMG,mBAAmB,GAAGA,CAAEC,OAAO,EAAEC,cAAc,KAAM;EAC1D,IAAIC,WAAW,GAAGF,OAAO,CAACG,IAAI,CAAC,CAAC;EAChC;EACA,IAAKH,OAAO,KAAK,KAAK,EAAG;IACxBE,WAAW,GAAGF,OAAO,CAACI,WAAW,CAAC,CAAC,CAACC,OAAO,CAAE,UAAU,EAAE,UAAW,CAAC;EACtE;EACA;EACA;EACA;EACA,IAAKJ,cAAc,EAAG;IACrBC,WAAW,IAAK,IAAID,cAAgB,EAAC;EACtC;EACA;EACA,IAAK,CAAE,CAAE,KAAK,EAAE,KAAK,CAAE,CAACK,QAAQ,CAAEN,OAAQ,CAAC,EAAG;IAC7CE,WAAW,GAAI,MAAMA,WAAa,EAAC;EACpC;EACA,OAAOA,WAAW;AACnB,CAAC;AAED,MAAMK,mBAAmB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O,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;MAC3D,MAAMC,QAAQ,GAAGR,2BAA2B,CAAEM,GAAG,CAAE,IAAIA,GAAG;MAC1D3D,GAAG,CAAC8D,YAAY,CAACC,GAAG,CAAEF,QAAQ,EAAED,KAAM,CAAC;IACxC,CAAE,CAAC;IACH,MAAMI,QAAQ,GAAG,MAAMC,MAAM,CAAClB,KAAK,CAAE/C,GAAG,EAAE;MACzCkE,OAAO,EAAE;QACR,YAAY,EAAE;MACf;IACD,CAAE,CAAC;IACH,MAAMC,YAAY,GAAG,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAC;IAC1C,MAAMC,OAAO,GAAGF,YAAY,CAACE,OAAO;IACpC,OAAOA,OAAO,CAACtC,GAAG,CAAIuC,MAAM,KAAQ;MACnC,GAAGA,MAAM;MACT;MACA;MACAzD,KAAK,EAAEyD,MAAM,CAACzD,KAAK,EAAE0D,WAAW,CAAC,CAAC,CAACC,UAAU,CAAE,OAAQ,CAAC,GACrDF,MAAM,CAACzD,KAAK,CAAC4D,KAAK,CAAE,CAAE,CAAC,GACvBH,MAAM,CAACzD,KAAK;MACf6D,QAAQ,EAAEJ,MAAM,CAACK,EAAE;MACnBA,EAAE,EAAEC,SAAS;MACbpC,OAAO,EAAE7B,mBAAmB,CAAE2D,MAAO,CAAC;MACtClC,UAAU,EAAEkC,MAAM,CAACO;IACpB,CAAC,CAAG,CAAC;EACN,CAAC;EACDC,YAAY,EAAEA,CAAE;IAAEJ;EAAS,CAAC,KAC1B,yCAAyCA,QAAU,UAAS;EAC9DK,kBAAkB,EAAE;AACrB,CAAC,CACD;AAED,eAAerC,uBAAuB","ignoreList":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export default function ConvertToRegularBlocks({
|
|
10
|
-
clientId,
|
|
11
|
-
onClose
|
|
12
|
-
}) {
|
|
13
|
-
const {
|
|
14
|
-
getBlocks
|
|
15
|
-
} = useSelect(blockEditorStore);
|
|
16
|
-
const {
|
|
17
|
-
replaceBlocks
|
|
18
|
-
} = useDispatch(blockEditorStore);
|
|
19
|
-
const canRemove = useSelect(select => select(blockEditorStore).canRemoveBlock(clientId), [clientId]);
|
|
20
|
-
if (!canRemove) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
|
24
|
-
onClick: () => {
|
|
25
|
-
replaceBlocks(clientId, getBlocks(clientId));
|
|
26
|
-
onClose();
|
|
27
|
-
},
|
|
28
|
-
children: __('Detach')
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=convert-to-regular.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","MenuItem","__","jsx","_jsx","ConvertToRegularBlocks","clientId","onClose","getBlocks","replaceBlocks","canRemove","select","canRemoveBlock","onClick","children"],"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-regular.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToRegularBlocks( { clientId, onClose } ) {\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tif ( ! canRemove ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\treplaceBlocks( clientId, getBlocks( clientId ) );\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Detach' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,eAAe,SAASC,sBAAsBA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EACvE,MAAM;IAAEC;EAAU,CAAC,GAAGX,SAAS,CAAEG,gBAAiB,CAAC;EACnD,MAAM;IAAES;EAAc,CAAC,GAAGX,WAAW,CAAEE,gBAAiB,CAAC;EAEzD,MAAMU,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAMA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,cAAc,CAAEN,QAAS,CAAC,EACnE,CAAEA,QAAQ,CACX,CAAC;EAED,IAAK,CAAEI,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,oBACCN,IAAA,CAACH,QAAQ;IACRY,OAAO,EAAGA,CAAA,KAAM;MACfJ,aAAa,CAAEH,QAAQ,EAAEE,SAAS,CAAEF,QAAS,CAAE,CAAC;MAChDC,OAAO,CAAC,CAAC;IACV,CAAG;IAAAO,QAAA,EAEDZ,EAAE,CAAE,QAAS;EAAC,CACP,CAAC;AAEb","ignoreList":[]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import { createBlock } from '@wordpress/blocks';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { useState } from '@wordpress/element';
|
|
10
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
11
|
-
import { symbolFilled } from '@wordpress/icons';
|
|
12
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import { unlock } from '../../lock-unlock';
|
|
18
|
-
import { store as editSiteStore } from '../../store';
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
const {
|
|
23
|
-
CreateTemplatePartModal
|
|
24
|
-
} = unlock(editorPrivateApis);
|
|
25
|
-
export default function ConvertToTemplatePart({
|
|
26
|
-
clientIds,
|
|
27
|
-
blocks
|
|
28
|
-
}) {
|
|
29
|
-
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
30
|
-
const {
|
|
31
|
-
replaceBlocks
|
|
32
|
-
} = useDispatch(blockEditorStore);
|
|
33
|
-
const {
|
|
34
|
-
createSuccessNotice
|
|
35
|
-
} = useDispatch(noticesStore);
|
|
36
|
-
const {
|
|
37
|
-
canCreate
|
|
38
|
-
} = useSelect(select => {
|
|
39
|
-
const {
|
|
40
|
-
supportsTemplatePartsMode
|
|
41
|
-
} = select(editSiteStore).getSettings();
|
|
42
|
-
return {
|
|
43
|
-
canCreate: !supportsTemplatePartsMode
|
|
44
|
-
};
|
|
45
|
-
}, []);
|
|
46
|
-
if (!canCreate) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
const onConvert = async templatePart => {
|
|
50
|
-
replaceBlocks(clientIds, createBlock('core/template-part', {
|
|
51
|
-
slug: templatePart.slug,
|
|
52
|
-
theme: templatePart.theme
|
|
53
|
-
}));
|
|
54
|
-
createSuccessNotice(__('Template part created.'), {
|
|
55
|
-
type: 'snackbar'
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// The modal and this component will be unmounted because of `replaceBlocks` above,
|
|
59
|
-
// so no need to call `closeModal` or `onClose`.
|
|
60
|
-
};
|
|
61
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
62
|
-
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
63
|
-
icon: symbolFilled,
|
|
64
|
-
onClick: () => {
|
|
65
|
-
setIsModalOpen(true);
|
|
66
|
-
},
|
|
67
|
-
"aria-expanded": isModalOpen,
|
|
68
|
-
"aria-haspopup": "dialog",
|
|
69
|
-
children: __('Create template part')
|
|
70
|
-
}), isModalOpen && /*#__PURE__*/_jsx(CreateTemplatePartModal, {
|
|
71
|
-
closeModal: () => {
|
|
72
|
-
setIsModalOpen(false);
|
|
73
|
-
},
|
|
74
|
-
blocks: blocks,
|
|
75
|
-
onCreate: onConvert
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=convert-to-template-part.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","store","blockEditorStore","MenuItem","createBlock","__","useState","noticesStore","symbolFilled","privateApis","editorPrivateApis","unlock","editSiteStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CreateTemplatePartModal","ConvertToTemplatePart","clientIds","blocks","isModalOpen","setIsModalOpen","replaceBlocks","createSuccessNotice","canCreate","select","supportsTemplatePartsMode","getSettings","onConvert","templatePart","slug","theme","type","children","icon","onClick","closeModal","onCreate"],"sources":["@wordpress/edit-site/src/components/template-part-converter/convert-to-template-part.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { symbolFilled } from '@wordpress/icons';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { CreateTemplatePartModal } = unlock( editorPrivateApis );\n\nexport default function ConvertToTemplatePart( { clientIds, blocks } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { canCreate } = useSelect( ( select ) => {\n\t\tconst { supportsTemplatePartsMode } =\n\t\t\tselect( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tcanCreate: ! supportsTemplatePartsMode,\n\t\t};\n\t}, [] );\n\n\tif ( ! canCreate ) {\n\t\treturn null;\n\t}\n\n\tconst onConvert = async ( templatePart ) => {\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\n\t\t// The modal and this component will be unmounted because of `replaceBlocks` above,\n\t\t// so no need to call `closeModal` or `onClose`.\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\ticon={ symbolFilled }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t} }\n\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ __( 'Create template part' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={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