@wordpress/edit-post 8.32.0 → 8.32.1-next.ff1cebbba.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/build/commands/use-commands.js +54 -47
- package/build/commands/use-commands.js.map +7 -1
- package/build/components/back-button/fullscreen-mode-close.js +127 -118
- package/build/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build/components/back-button/index.js +56 -54
- package/build/components/back-button/index.js.map +7 -1
- package/build/components/browser-url/index.js +45 -44
- package/build/components/browser-url/index.js.map +7 -1
- package/build/components/editor-initialization/index.js +24 -18
- package/build/components/editor-initialization/index.js.map +7 -1
- package/build/components/editor-initialization/listener-hooks.js +42 -43
- package/build/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build/components/init-pattern-modal/index.js +100 -79
- package/build/components/init-pattern-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +37 -33
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +447 -467
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/use-padding-appender.js +66 -59
- package/build/components/layout/use-padding-appender.js.map +7 -1
- package/build/components/layout/use-should-iframe.js +36 -30
- package/build/components/layout/use-should-iframe.js.map +7 -1
- package/build/components/meta-boxes/index.js +46 -33
- package/build/components/meta-boxes/index.js.map +7 -1
- package/build/components/meta-boxes/meta-box-visibility.js +37 -22
- package/build/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +62 -53
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build/components/meta-boxes/use-meta-box-initialization.js +37 -32
- package/build/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build/components/more-menu/index.js +64 -44
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/manage-patterns-menu-item.js +39 -37
- package/build/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +39 -21
- package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build/components/preferences-modal/enable-custom-fields.js +76 -66
- package/build/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build/components/preferences-modal/enable-panel.js +47 -43
- package/build/components/preferences-modal/enable-panel.js.map +7 -1
- package/build/components/preferences-modal/index.js +51 -39
- package/build/components/preferences-modal/index.js.map +7 -1
- package/build/components/preferences-modal/meta-boxes-section.js +65 -52
- package/build/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build/components/welcome-guide/default.js +134 -97
- package/build/components/welcome-guide/default.js.map +7 -1
- package/build/components/welcome-guide/image.js +34 -23
- package/build/components/welcome-guide/image.js.map +7 -1
- package/build/components/welcome-guide/index.js +51 -38
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/welcome-guide/template.js +65 -45
- package/build/components/welcome-guide/template.js.map +7 -1
- package/build/deprecated.js +84 -110
- package/build/deprecated.js.map +7 -1
- package/build/hooks/use-navigate-to-entity-record.js +60 -78
- package/build/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build/index.js +101 -136
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +239 -431
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +33 -26
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +50 -57
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +288 -459
- package/build/store/selectors.js.map +7 -1
- package/build/utils/meta-boxes.js +31 -19
- package/build/utils/meta-boxes.js.map +7 -1
- package/build-module/commands/use-commands.js +35 -40
- package/build-module/commands/use-commands.js.map +7 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +102 -110
- package/build-module/components/back-button/fullscreen-mode-close.js.map +7 -1
- package/build-module/components/back-button/index.js +28 -47
- package/build-module/components/back-button/index.js.map +7 -1
- package/build-module/components/browser-url/index.js +23 -38
- package/build-module/components/browser-url/index.js.map +7 -1
- package/build-module/components/editor-initialization/index.js +6 -13
- package/build-module/components/editor-initialization/index.js.map +7 -1
- package/build-module/components/editor-initialization/listener-hooks.js +20 -34
- package/build-module/components/editor-initialization/listener-hooks.js.map +7 -1
- package/build-module/components/init-pattern-modal/index.js +90 -74
- package/build-module/components/init-pattern-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +21 -26
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +439 -448
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/use-padding-appender.js +44 -54
- package/build-module/components/layout/use-padding-appender.js.map +7 -1
- package/build-module/components/layout/use-should-iframe.js +15 -25
- package/build-module/components/layout/use-should-iframe.js.map +7 -1
- package/build-module/components/meta-boxes/index.js +18 -26
- package/build-module/components/meta-boxes/index.js.map +7 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +18 -15
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +7 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +30 -44
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +7 -1
- package/build-module/components/meta-boxes/use-meta-box-initialization.js +14 -25
- package/build-module/components/meta-boxes/use-meta-box-initialization.js.map +7 -1
- package/build-module/components/more-menu/index.js +36 -37
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/manage-patterns-menu-item.js +21 -31
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +7 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +22 -16
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +51 -56
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +7 -1
- package/build-module/components/preferences-modal/enable-panel.js +30 -38
- package/build-module/components/preferences-modal/enable-panel.js.map +7 -1
- package/build-module/components/preferences-modal/index.js +24 -34
- package/build-module/components/preferences-modal/index.js.map +7 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +34 -45
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +7 -1
- package/build-module/components/welcome-guide/default.js +107 -91
- package/build-module/components/welcome-guide/default.js.map +7 -1
- package/build-module/components/welcome-guide/image.js +16 -18
- package/build-module/components/welcome-guide/image.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +23 -31
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/welcome-guide/template.js +38 -39
- package/build-module/components/welcome-guide/template.js.map +7 -1
- package/build-module/deprecated.js +62 -103
- package/build-module/deprecated.js.map +7 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +42 -73
- package/build-module/hooks/use-navigate-to-entity-record.js.map +7 -1
- package/build-module/index.js +70 -95
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +158 -368
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +9 -21
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +28 -51
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +232 -442
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils/meta-boxes.js +9 -13
- package/build-module/utils/meta-boxes.js.map +7 -1
- package/build-style/classic-rtl.css +0 -154
- package/build-style/classic.css +0 -154
- package/build-style/style-rtl.css +135 -110
- package/build-style/style.css +135 -110
- package/package.json +39 -31
- package/src/classic.scss +3 -0
- package/src/components/back-button/style.scss +3 -0
- package/src/components/layout/index.js +3 -2
- package/src/components/layout/style.scss +4 -0
- package/src/components/meta-boxes/meta-boxes-area/style.scss +3 -0
- package/src/components/welcome-guide/style.scss +3 -0
- package/src/style.scss +8 -4
- package/build/components/header/header-toolbar/index.native.js +0 -204
- package/build/components/header/header-toolbar/index.native.js.map +0 -1
- package/build/components/header/index.native.js +0 -59
- package/build/components/header/index.native.js.map +0 -1
- package/build/components/layout/index.native.js +0 -166
- package/build/components/layout/index.native.js.map +0 -1
- package/build/components/visual-editor/header.native.js +0 -63
- package/build/components/visual-editor/header.native.js.map +0 -1
- package/build/components/visual-editor/index.native.js +0 -44
- package/build/components/visual-editor/index.native.js.map +0 -1
- package/build/editor.native.js +0 -157
- package/build/editor.native.js.map +0 -1
- package/build/index.native.js +0 -58
- package/build/index.native.js.map +0 -1
- package/build-module/components/header/header-toolbar/index.native.js +0 -196
- package/build-module/components/header/header-toolbar/index.native.js.map +0 -1
- package/build-module/components/header/index.native.js +0 -50
- package/build-module/components/header/index.native.js.map +0 -1
- package/build-module/components/layout/index.native.js +0 -158
- package/build-module/components/layout/index.native.js.map +0 -1
- package/build-module/components/visual-editor/header.native.js +0 -56
- package/build-module/components/visual-editor/header.native.js.map +0 -1
- package/build-module/components/visual-editor/index.native.js +0 -35
- package/build-module/components/visual-editor/index.native.js.map +0 -1
- package/build-module/editor.native.js +0 -149
- package/build-module/editor.native.js.map +0 -1
- package/build-module/index.native.js +0 -45
- package/build-module/index.native.js.map +0 -1
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/preferences-modal/meta-boxes-section.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCE;AA9BF,kBAAmB;AACnB,kBAA2B;AAC3B,oBAAqC;AACrC,yBAAsD;AAKtD,kCAAqC;AACrC,0BAA8B;AAC9B,mBAAuC;AACvC,yBAAuB;AAEvB,MAAM,EAAE,wBAAwB,QAAI,2BAAQ,mBAAAA,WAAuB;AAE5D,SAAS,iBAAkB;AAAA,EACjC;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AAEH,QAAM,sBAAsB,UAAU;AAAA,IACrC,CAAE,EAAE,GAAG,MAAO,OAAO;AAAA,EACtB;AAEA,MAAK,CAAE,6BAA6B,oBAAoB,WAAW,GAAI;AACtE,WAAO;AAAA,EACR;AAEA,SACC,6CAAC,2BAA0B,GAAG,cAC3B;AAAA,iCACD,4CAAC,4BAAAC,SAAA,EAAyB,WAAQ,gBAAI,eAAgB,GAAI;AAAA,IAEzD,oBAAoB,IAAK,CAAE,EAAE,IAAI,MAAM,MACxC;AAAA,MAAC,oBAAAC;AAAA,MAAA;AAAA,QAEA,OAAQ;AAAA,QACR,WAAY,YAAa,EAAG;AAAA;AAAA,MAFtB;AAAA,IAGP,CACC;AAAA,KACH;AAEF;AAEA,IAAO,iCAAQ,wBAAY,CAAE,WAAY;AACxC,QAAM,EAAE,kBAAkB,IAAI,OAAQ,cAAAC,KAAY;AAClD,QAAM,EAAE,gBAAgB,IAAI,OAAQ,aAAAC,KAAc;AAElD,SAAO;AAAA;AAAA,IAEN,2BACC,kBAAkB,EAAE,uBAAuB;AAAA,IAC5C,WAAW,gBAAgB;AAAA,EAC5B;AACD,CAAE,EAAG,gBAAiB;",
|
|
6
|
+
"names": ["preferencesPrivateApis", "EnableCustomFieldsOption", "EnablePanelOption", "editorStore", "editPostStore"]
|
|
7
|
+
}
|
|
@@ -1,100 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var default_exports = {};
|
|
29
|
+
__export(default_exports, {
|
|
30
|
+
default: () => WelcomeGuideDefault
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
32
|
+
module.exports = __toCommonJS(default_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_data = require("@wordpress/data");
|
|
35
|
+
var import_components = require("@wordpress/components");
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_element = require("@wordpress/element");
|
|
38
|
+
var import_image = __toESM(require("./image"));
|
|
39
|
+
var import_store = require("../../store");
|
|
23
40
|
function WelcomeGuideDefault() {
|
|
24
|
-
const {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
41
|
+
const { toggleFeature } = (0, import_data.useDispatch)(import_store.store);
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_components.Guide,
|
|
44
|
+
{
|
|
45
|
+
className: "edit-post-welcome-guide",
|
|
46
|
+
contentLabel: (0, import_i18n.__)("Welcome to the editor"),
|
|
47
|
+
finishButtonText: (0, import_i18n.__)("Get started"),
|
|
48
|
+
onFinish: () => toggleFeature("welcomeGuide"),
|
|
49
|
+
pages: [
|
|
50
|
+
{
|
|
51
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
import_image.default,
|
|
53
|
+
{
|
|
54
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
|
|
55
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n.__)("Welcome to the editor") }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n.__)(
|
|
61
|
+
"In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content."
|
|
62
|
+
) })
|
|
63
|
+
] })
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_image.default,
|
|
68
|
+
{
|
|
69
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
|
|
70
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n.__)("Customize each block") }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n.__)(
|
|
76
|
+
"Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected."
|
|
77
|
+
) })
|
|
78
|
+
] })
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_image.default,
|
|
83
|
+
{
|
|
84
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
|
|
85
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n.__)("Explore all blocks") }),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element.createInterpolateElement)(
|
|
91
|
+
(0, import_i18n.__)(
|
|
92
|
+
"All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon."
|
|
93
|
+
),
|
|
94
|
+
{
|
|
95
|
+
InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
"img",
|
|
97
|
+
{
|
|
98
|
+
alt: (0, import_i18n.__)("inserter"),
|
|
99
|
+
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
) })
|
|
104
|
+
] })
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
108
|
+
import_image.default,
|
|
109
|
+
{
|
|
110
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
|
|
111
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n.__)("Learn more") }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element.createInterpolateElement)(
|
|
117
|
+
(0, import_i18n.__)(
|
|
118
|
+
"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"
|
|
119
|
+
),
|
|
120
|
+
{
|
|
121
|
+
a: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
import_components.ExternalLink,
|
|
123
|
+
{
|
|
124
|
+
href: (0, import_i18n.__)(
|
|
125
|
+
"https://wordpress.org/documentation/article/wordpress-block-editor/"
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
) })
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
99
136
|
}
|
|
100
|
-
//# sourceMappingURL=default.js.map
|
|
137
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/welcome-guide/default.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideDefault() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-post-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Customize each block' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Explore all blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BM;AAvBN,kBAA4B;AAC5B,wBAAoC;AACpC,kBAAmB;AACnB,qBAAyC;AAKzC,mBAA8B;AAC9B,mBAAuC;AAExB,SAAR,sBAAuC;AAC7C,QAAM,EAAE,cAAc,QAAI,yBAAa,aAAAA,KAAc;AAErD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,kBAAe,gBAAI,uBAAwB;AAAA,MAC3C,sBAAmB,gBAAI,aAAc;AAAA,MACrC,UAAW,MAAM,cAAe,cAAe;AAAA,MAC/C,OAAQ;AAAA,QACP;AAAA,UACC,OACC;AAAA,YAAC,aAAAC;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,uBAAwB,GAC/B;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,QACA;AAAA,UACC,OACC;AAAA,YAAC,aAAAA;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,sBAAuB,GAC9B;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,QACA;AAAA,UACC,OACC;AAAA,YAAC,aAAAA;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,oBAAqB,GAC5B;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,kBACD;AAAA,gBACC;AAAA,cACD;AAAA,cACA;AAAA,gBACC,mBACC;AAAA,kBAAC;AAAA;AAAA,oBACA,SAAM,gBAAI,UAAW;AAAA,oBACrB,KAAI;AAAA;AAAA,gBACL;AAAA,cAEF;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,QACA;AAAA,UACC,OACC;AAAA,YAAC,aAAAA;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,YAAa,GACpB;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,kBACD;AAAA,gBACC;AAAA,cACD;AAAA,cACA;AAAA,gBACC,GACC;AAAA,kBAAC;AAAA;AAAA,oBACA,UAAO;AAAA,sBACN;AAAA,oBACD;AAAA;AAAA,gBACD;AAAA,cAEF;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["editPostStore", "WelcomeGuideImage"]
|
|
7
|
+
}
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var image_exports = {};
|
|
19
|
+
__export(image_exports, {
|
|
20
|
+
default: () => WelcomeGuideImage
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
function WelcomeGuideImage({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
width: "312",
|
|
20
|
-
height: "240",
|
|
21
|
-
alt: ""
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
22
|
+
module.exports = __toCommonJS(image_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) {
|
|
25
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [
|
|
26
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
27
|
+
"source",
|
|
28
|
+
{
|
|
29
|
+
srcSet: nonAnimatedSrc,
|
|
30
|
+
media: "(prefers-reduced-motion: reduce)"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })
|
|
34
|
+
] });
|
|
24
35
|
}
|
|
25
|
-
//# sourceMappingURL=image.js.map
|
|
36
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/welcome-guide/image.js"],
|
|
4
|
+
"sourcesContent": ["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-post-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEE;AAFa,SAAR,kBAAoC,EAAE,gBAAgB,YAAY,GAAI;AAC5E,SACC,6CAAC,aAAQ,WAAU,kCAClB;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,QAAS;AAAA,QACT,OAAM;AAAA;AAAA,IACP;AAAA,IACA,4CAAC,SAAI,KAAM,aAAc,OAAM,OAAM,QAAO,OAAM,KAAI,IAAG;AAAA,KAC1D;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var welcome_guide_exports = {};
|
|
29
|
+
__export(welcome_guide_exports, {
|
|
30
|
+
default: () => WelcomeGuide
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
isEditingTemplate
|
|
27
|
-
} = (0, _data.useSelect)(select => {
|
|
28
|
-
const {
|
|
29
|
-
isFeatureActive
|
|
30
|
-
} = select(_store.store);
|
|
31
|
-
const _isEditingTemplate = postType === 'wp_template';
|
|
32
|
-
const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide';
|
|
33
|
-
return {
|
|
34
|
-
isActive: isFeatureActive(feature),
|
|
35
|
-
isEditingTemplate: _isEditingTemplate
|
|
36
|
-
};
|
|
37
|
-
}, [postType]);
|
|
32
|
+
module.exports = __toCommonJS(welcome_guide_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_data = require("@wordpress/data");
|
|
35
|
+
var import_default = __toESM(require("./default"));
|
|
36
|
+
var import_template = __toESM(require("./template"));
|
|
37
|
+
var import_store = require("../../store");
|
|
38
|
+
function WelcomeGuide({ postType }) {
|
|
39
|
+
const { isActive, isEditingTemplate } = (0, import_data.useSelect)(
|
|
40
|
+
(select) => {
|
|
41
|
+
const { isFeatureActive } = select(import_store.store);
|
|
42
|
+
const _isEditingTemplate = postType === "wp_template";
|
|
43
|
+
const feature = _isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide";
|
|
44
|
+
return {
|
|
45
|
+
isActive: isFeatureActive(feature),
|
|
46
|
+
isEditingTemplate: _isEditingTemplate
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
[postType]
|
|
50
|
+
);
|
|
38
51
|
if (!isActive) {
|
|
39
52
|
return null;
|
|
40
53
|
}
|
|
41
|
-
return isEditingTemplate ?
|
|
54
|
+
return isEditingTemplate ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_default.default, {});
|
|
42
55
|
}
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/welcome-guide/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideDefault from './default';\nimport WelcomeGuideTemplate from './template';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuide( { postType } ) {\n\tconst { isActive, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst _isEditingTemplate = postType === 'wp_template';\n\t\t\tconst feature = _isEditingTemplate\n\t\t\t\t? 'welcomeGuideTemplate'\n\t\t\t\t: 'welcomeGuide';\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( feature ),\n\t\t\t\tisEditingTemplate: _isEditingTemplate,\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn isEditingTemplate ? (\n\t\t<WelcomeGuideTemplate />\n\t) : (\n\t\t<WelcomeGuideDefault />\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCE;AA/BF,kBAA0B;AAK1B,qBAAgC;AAChC,sBAAiC;AACjC,mBAAuC;AAExB,SAAR,aAA+B,EAAE,SAAS,GAAI;AACpD,QAAM,EAAE,UAAU,kBAAkB,QAAI;AAAA,IACvC,CAAE,WAAY;AACb,YAAM,EAAE,gBAAgB,IAAI,OAAQ,aAAAA,KAAc;AAClD,YAAM,qBAAqB,aAAa;AACxC,YAAM,UAAU,qBACb,yBACA;AAEH,aAAO;AAAA,QACN,UAAU,gBAAiB,OAAQ;AAAA,QACnC,mBAAmB;AAAA,MACpB;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAEA,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AAEA,SAAO,oBACN,4CAAC,gBAAAC,SAAA,EAAqB,IAEtB,4CAAC,eAAAC,SAAA,EAAoB;AAEvB;",
|
|
6
|
+
"names": ["editPostStore", "WelcomeGuideTemplate", "WelcomeGuideDefault"]
|
|
7
|
+
}
|
|
@@ -1,48 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var template_exports = {};
|
|
29
|
+
__export(template_exports, {
|
|
30
|
+
default: () => WelcomeGuideTemplate
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
32
|
+
module.exports = __toCommonJS(template_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_data = require("@wordpress/data");
|
|
35
|
+
var import_components = require("@wordpress/components");
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_image = __toESM(require("./image"));
|
|
38
|
+
var import_store = require("../../store");
|
|
22
39
|
function WelcomeGuideTemplate() {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const { toggleFeature } = (0, import_data.useDispatch)(import_store.store);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_components.Guide,
|
|
43
|
+
{
|
|
44
|
+
className: "edit-template-welcome-guide",
|
|
45
|
+
contentLabel: (0, import_i18n.__)("Welcome to the template editor"),
|
|
46
|
+
finishButtonText: (0, import_i18n.__)("Get started"),
|
|
47
|
+
onFinish: () => toggleFeature("welcomeGuideTemplate"),
|
|
48
|
+
pages: [
|
|
49
|
+
{
|
|
50
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_image.default,
|
|
52
|
+
{
|
|
53
|
+
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg",
|
|
54
|
+
animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n.__)("Welcome to the template editor") }),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n.__)(
|
|
60
|
+
"Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor."
|
|
61
|
+
) })
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
47
67
|
}
|
|
48
|
-
//# sourceMappingURL=template.js.map
|
|
68
|
+
//# sourceMappingURL=template.js.map
|