@wordpress/block-library 9.40.0 → 9.40.1-next.v.202602191100.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/post-navigation-link/block.json +1 -3
- package/build/post-navigation-link/deprecated.cjs +100 -0
- package/build/post-navigation-link/deprecated.cjs.map +7 -0
- package/build/post-navigation-link/edit.cjs +2 -36
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-navigation-link/index.cjs +2 -0
- package/build/post-navigation-link/index.cjs.map +3 -3
- package/build-module/post-navigation-link/block.json +1 -3
- package/build-module/post-navigation-link/deprecated.mjs +69 -0
- package/build-module/post-navigation-link/deprecated.mjs.map +7 -0
- package/build-module/post-navigation-link/edit.mjs +3 -30
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/index.mjs +2 -0
- package/build-module/post-navigation-link/index.mjs.map +2 -2
- package/package.json +38 -38
- package/src/post-navigation-link/block.json +1 -3
- package/src/post-navigation-link/deprecated.js +72 -0
- package/src/post-navigation-link/edit.js +2 -35
- package/src/post-navigation-link/index.js +2 -0
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
"description": "Displays the next or previous post link that is adjacent to the current post.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"textAlign": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
10
|
"type": {
|
|
14
11
|
"type": "string",
|
|
15
12
|
"default": "next"
|
|
@@ -46,6 +43,7 @@
|
|
|
46
43
|
"typography": {
|
|
47
44
|
"fontSize": true,
|
|
48
45
|
"lineHeight": true,
|
|
46
|
+
"textAlign": true,
|
|
49
47
|
"__experimentalFontFamily": true,
|
|
50
48
|
"__experimentalFontWeight": true,
|
|
51
49
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/block-library/src/post-navigation-link/deprecated.js
|
|
31
|
+
var deprecated_exports = {};
|
|
32
|
+
__export(deprecated_exports, {
|
|
33
|
+
default: () => deprecated_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(deprecated_exports);
|
|
36
|
+
var import_migrate_text_align = __toESM(require("../utils/migrate-text-align.cjs"));
|
|
37
|
+
var v1 = {
|
|
38
|
+
attributes: {
|
|
39
|
+
textAlign: {
|
|
40
|
+
type: "string"
|
|
41
|
+
},
|
|
42
|
+
type: {
|
|
43
|
+
type: "string",
|
|
44
|
+
default: "next"
|
|
45
|
+
},
|
|
46
|
+
label: {
|
|
47
|
+
type: "string",
|
|
48
|
+
role: "content"
|
|
49
|
+
},
|
|
50
|
+
showTitle: {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
linkLabel: {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
arrow: {
|
|
59
|
+
type: "string",
|
|
60
|
+
default: "none"
|
|
61
|
+
},
|
|
62
|
+
taxonomy: {
|
|
63
|
+
type: "string",
|
|
64
|
+
default: ""
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
supports: {
|
|
68
|
+
anchor: true,
|
|
69
|
+
reusable: false,
|
|
70
|
+
html: false,
|
|
71
|
+
color: {
|
|
72
|
+
link: true
|
|
73
|
+
},
|
|
74
|
+
typography: {
|
|
75
|
+
fontSize: true,
|
|
76
|
+
lineHeight: true,
|
|
77
|
+
__experimentalFontFamily: true,
|
|
78
|
+
__experimentalFontWeight: true,
|
|
79
|
+
__experimentalFontStyle: true,
|
|
80
|
+
__experimentalTextTransform: true,
|
|
81
|
+
__experimentalTextDecoration: true,
|
|
82
|
+
__experimentalLetterSpacing: true,
|
|
83
|
+
__experimentalDefaultControls: {
|
|
84
|
+
fontSize: true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
interactivity: {
|
|
88
|
+
clientNavigation: true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
migrate: import_migrate_text_align.default,
|
|
92
|
+
isEligible(attributes) {
|
|
93
|
+
return !!attributes.textAlign || !!attributes.className?.match(
|
|
94
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
save: () => null
|
|
98
|
+
};
|
|
99
|
+
var deprecated_default = [v1];
|
|
100
|
+
//# sourceMappingURL=deprecated.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/post-navigation-link/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport migrateTextAlign from '../utils/migrate-text-align';\n\nconst v1 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'next',\n\t\t},\n\t\tlabel: {\n\t\t\ttype: 'string',\n\t\t\trole: 'content',\n\t\t},\n\t\tshowTitle: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tlinkLabel: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tarrow: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t\ttaxonomy: {\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\treusable: false,\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tlink: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t\tinteractivity: {\n\t\t\tclientNavigation: true,\n\t\t},\n\t},\n\tmigrate: migrateTextAlign,\n\tisEligible( attributes ) {\n\t\treturn (\n\t\t\t!! attributes.textAlign ||\n\t\t\t!! attributes.className?.match(\n\t\t\t\t/\\bhas-text-align-(left|center|right)\\b/\n\t\t\t)\n\t\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
+
"names": ["migrateTextAlign"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// packages/block-library/src/post-navigation-link/edit.js
|
|
@@ -33,7 +23,6 @@ __export(edit_exports, {
|
|
|
33
23
|
default: () => PostNavigationLinkEdit
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(edit_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
26
|
var import_components = require("@wordpress/components");
|
|
38
27
|
var import_block_editor = require("@wordpress/block-editor");
|
|
39
28
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -43,19 +32,9 @@ var import_hooks = require("../utils/hooks.cjs");
|
|
|
43
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
33
|
function PostNavigationLinkEdit({
|
|
45
34
|
context: { postType },
|
|
46
|
-
attributes: {
|
|
47
|
-
type,
|
|
48
|
-
label,
|
|
49
|
-
showTitle,
|
|
50
|
-
textAlign,
|
|
51
|
-
linkLabel,
|
|
52
|
-
arrow,
|
|
53
|
-
taxonomy
|
|
54
|
-
},
|
|
35
|
+
attributes: { type, label, showTitle, linkLabel, arrow, taxonomy },
|
|
55
36
|
setAttributes
|
|
56
37
|
}) {
|
|
57
|
-
const blockEditingMode = (0, import_block_editor.useBlockEditingMode)();
|
|
58
|
-
const showControls = blockEditingMode === "default";
|
|
59
38
|
const isNext = type === "next";
|
|
60
39
|
let placeholder = isNext ? (0, import_i18n.__)("Next") : (0, import_i18n.__)("Previous");
|
|
61
40
|
const arrowMap = {
|
|
@@ -74,11 +53,7 @@ function PostNavigationLinkEdit({
|
|
|
74
53
|
);
|
|
75
54
|
}
|
|
76
55
|
const ariaLabel = isNext ? (0, import_i18n.__)("Next post") : (0, import_i18n.__)("Previous post");
|
|
77
|
-
const blockProps = (0, import_block_editor.useBlockProps)(
|
|
78
|
-
className: (0, import_clsx.default)({
|
|
79
|
-
[`has-text-align-${textAlign}`]: textAlign
|
|
80
|
-
})
|
|
81
|
-
});
|
|
56
|
+
const blockProps = (0, import_block_editor.useBlockProps)();
|
|
82
57
|
const taxonomies = (0, import_data.useSelect)(
|
|
83
58
|
(select) => {
|
|
84
59
|
const { getTaxonomies } = select(import_core_data.store);
|
|
@@ -237,15 +212,6 @@ function PostNavigationLinkEdit({
|
|
|
237
212
|
)
|
|
238
213
|
}
|
|
239
214
|
) }),
|
|
240
|
-
showControls && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
241
|
-
import_block_editor.AlignmentToolbar,
|
|
242
|
-
{
|
|
243
|
-
value: textAlign,
|
|
244
|
-
onChange: (nextAlign) => {
|
|
245
|
-
setAttributes({ textAlign: nextAlign });
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
) }),
|
|
249
215
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...blockProps, children: [
|
|
250
216
|
!isNext && displayArrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
251
217
|
"span",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-navigation-link/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n\tSelectControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: { type, label, showTitle, linkLabel, arrow, taxonomy },\n\tsetAttributes,\n} ) {\n\tconst isNext = type === 'next';\n\tlet placeholder = isNext ? __( 'Next' ) : __( 'Previous' );\n\n\tconst arrowMap = {\n\t\tnone: '',\n\t\tarrow: isNext ? '\u2192' : '\u2190',\n\t\tchevron: isNext ? '\u00BB' : '\u00AB',\n\t};\n\n\tconst displayArrow = arrowMap[ arrow ];\n\n\tif ( showTitle ) {\n\t\tplaceholder = isNext\n\t\t\t? /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Next: ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t: /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Previous: ' ); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps();\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t\t\tlinkLabel: false,\n\t\t\t\t\t\t\tarrow: 'none',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showTitle }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showTitle: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'If you have entered a custom label, it will be prepended before the title.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! showTitle }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowTitle: ! showTitle,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! linkLabel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkLabel: false } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! linkLabel }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkLabel: ! linkLabel,\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/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => arrow !== 'none' }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { arrow: 'none' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\t\tvalue={ arrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { arrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'A decorative arrow for the next and previous link.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"none\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'None',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"arrow\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Arrow',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"chevron\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Chevron',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-previous is-arrow-${ arrow }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ showTitle && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-navigation-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'An example title' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block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E,UACZ,cAAe;AAAA,UACd,UAAU;AAAA,QACX,CAAE;AAAA,QAEH,UAAO;AAAA,UACN;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,IACA,6CAAC,SAAM,GAAG,YACP;AAAA,OAAE,UAAU,gBACb;AAAA,QAAC;AAAA;AAAA,UACA,WAAY,0DAA2D,KAAM;AAAA,UAE3E;AAAA;AAAA,MACH;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA,SAAQ;AAAA,UACR,YAAW;AAAA,UACX,cAAa;AAAA,UACb;AAAA,UACA,OAAQ;AAAA,UACR,8BAA4B;AAAA,UAC5B,UAAW,CAAE,aACZ,cAAe,EAAE,OAAO,SAAS,CAAE;AAAA;AAAA,MAErC;AAAA,MACE,aACD;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UACL,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,UAE1C,8BAAI,kBAAmB;AAAA;AAAA,MAC1B;AAAA,MAEC,UAAU,gBACX;AAAA,QAAC;AAAA;AAAA,UACA,WAAY,sDAAuD,KAAM;AAAA,UACzE,eAAW;AAAA,UAET;AAAA;AAAA,MACH;AAAA,OAEF;AAAA,KACD;AAEF;",
|
|
6
|
+
"names": ["coreStore", "ToolsPanel", "ToolsPanelItem", "ToggleGroupControl", "ToggleGroupControlOption"]
|
|
7
7
|
}
|
|
@@ -41,10 +41,12 @@ var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
|
41
41
|
var import_block = __toESM(require("./block.json"));
|
|
42
42
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
43
43
|
var import_variations = __toESM(require("./variations.cjs"));
|
|
44
|
+
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
44
45
|
var { name } = import_block.default;
|
|
45
46
|
var settings = {
|
|
46
47
|
edit: import_edit.default,
|
|
47
48
|
variations: import_variations.default,
|
|
49
|
+
deprecated: import_deprecated.default,
|
|
48
50
|
example: {
|
|
49
51
|
attributes: {
|
|
50
52
|
label: (0, import_i18n.__)("Next post"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-navigation-link/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tvariations,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: __( 'Next post' ),\n\t\t\tarrow: 'arrow',\n\t\t},\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAKnB,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAGV,IAAM,WAAW;AAAA,EACvB,kBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,WAAO,gBAAI,WAAY;AAAA,MACvB,OAAO;AAAA,IACR;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
-
"names": ["metadata", "edit", "variations", "initBlock", "metadata"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tvariations,\n\tdeprecated,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: __( 'Next post' ),\n\t\t\tarrow: 'arrow',\n\t\t},\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAKnB,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AACvB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAGV,IAAM,WAAW;AAAA,EACvB,kBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,WAAO,gBAAI,WAAY;AAAA,MACvB,OAAO;AAAA,IACR;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "edit", "variations", "deprecated", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
"description": "Displays the next or previous post link that is adjacent to the current post.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"textAlign": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
10
|
"type": {
|
|
14
11
|
"type": "string",
|
|
15
12
|
"default": "next"
|
|
@@ -46,6 +43,7 @@
|
|
|
46
43
|
"typography": {
|
|
47
44
|
"fontSize": true,
|
|
48
45
|
"lineHeight": true,
|
|
46
|
+
"textAlign": true,
|
|
49
47
|
"__experimentalFontFamily": true,
|
|
50
48
|
"__experimentalFontWeight": true,
|
|
51
49
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// packages/block-library/src/post-navigation-link/deprecated.js
|
|
2
|
+
import migrateTextAlign from "../utils/migrate-text-align.mjs";
|
|
3
|
+
var v1 = {
|
|
4
|
+
attributes: {
|
|
5
|
+
textAlign: {
|
|
6
|
+
type: "string"
|
|
7
|
+
},
|
|
8
|
+
type: {
|
|
9
|
+
type: "string",
|
|
10
|
+
default: "next"
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
type: "string",
|
|
14
|
+
role: "content"
|
|
15
|
+
},
|
|
16
|
+
showTitle: {
|
|
17
|
+
type: "boolean",
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
linkLabel: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
arrow: {
|
|
25
|
+
type: "string",
|
|
26
|
+
default: "none"
|
|
27
|
+
},
|
|
28
|
+
taxonomy: {
|
|
29
|
+
type: "string",
|
|
30
|
+
default: ""
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
supports: {
|
|
34
|
+
anchor: true,
|
|
35
|
+
reusable: false,
|
|
36
|
+
html: false,
|
|
37
|
+
color: {
|
|
38
|
+
link: true
|
|
39
|
+
},
|
|
40
|
+
typography: {
|
|
41
|
+
fontSize: true,
|
|
42
|
+
lineHeight: true,
|
|
43
|
+
__experimentalFontFamily: true,
|
|
44
|
+
__experimentalFontWeight: true,
|
|
45
|
+
__experimentalFontStyle: true,
|
|
46
|
+
__experimentalTextTransform: true,
|
|
47
|
+
__experimentalTextDecoration: true,
|
|
48
|
+
__experimentalLetterSpacing: true,
|
|
49
|
+
__experimentalDefaultControls: {
|
|
50
|
+
fontSize: true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
interactivity: {
|
|
54
|
+
clientNavigation: true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
migrate: migrateTextAlign,
|
|
58
|
+
isEligible(attributes) {
|
|
59
|
+
return !!attributes.textAlign || !!attributes.className?.match(
|
|
60
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
save: () => null
|
|
64
|
+
};
|
|
65
|
+
var deprecated_default = [v1];
|
|
66
|
+
export {
|
|
67
|
+
deprecated_default as default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=deprecated.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/post-navigation-link/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport migrateTextAlign from '../utils/migrate-text-align';\n\nconst v1 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'next',\n\t\t},\n\t\tlabel: {\n\t\t\ttype: 'string',\n\t\t\trole: 'content',\n\t\t},\n\t\tshowTitle: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tlinkLabel: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\tarrow: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t\ttaxonomy: {\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\treusable: false,\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tlink: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t\tinteractivity: {\n\t\t\tclientNavigation: true,\n\t\t},\n\t},\n\tmigrate: migrateTextAlign,\n\tisEligible( attributes ) {\n\t\treturn (\n\t\t\t!! attributes.textAlign ||\n\t\t\t!! attributes.className?.match(\n\t\t\t\t/\\bhas-text-align-(left|center|right)\\b/\n\t\t\t)\n\t\t);\n\t},\n\tsave: () => null,\n};\n\nexport default [ v1 ];\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,sBAAsB;AAE7B,IAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EACA,UAAU;AAAA,IACT,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,0BAA0B;AAAA,MAC1B,0BAA0B;AAAA,MAC1B,yBAAyB;AAAA,MACzB,6BAA6B;AAAA,MAC7B,8BAA8B;AAAA,MAC9B,6BAA6B;AAAA,MAC7B,+BAA+B;AAAA,QAC9B,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,eAAe;AAAA,MACd,kBAAkB;AAAA,IACnB;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,WAAY,YAAa;AACxB,WACC,CAAC,CAAE,WAAW,aACd,CAAC,CAAE,WAAW,WAAW;AAAA,MACxB;AAAA,IACD;AAAA,EAEF;AAAA,EACA,MAAM,MAAM;AACb;AAEA,IAAO,qBAAQ,CAAE,EAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// packages/block-library/src/post-navigation-link/edit.js
|
|
2
|
-
import clsx from "clsx";
|
|
3
2
|
import {
|
|
4
3
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
5
4
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
@@ -11,10 +10,7 @@ import {
|
|
|
11
10
|
import {
|
|
12
11
|
InspectorControls,
|
|
13
12
|
RichText,
|
|
14
|
-
|
|
15
|
-
AlignmentToolbar,
|
|
16
|
-
useBlockProps,
|
|
17
|
-
useBlockEditingMode
|
|
13
|
+
useBlockProps
|
|
18
14
|
} from "@wordpress/block-editor";
|
|
19
15
|
import { __, _x } from "@wordpress/i18n";
|
|
20
16
|
import { useSelect } from "@wordpress/data";
|
|
@@ -23,19 +19,9 @@ import { useToolsPanelDropdownMenuProps } from "../utils/hooks.mjs";
|
|
|
23
19
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
20
|
function PostNavigationLinkEdit({
|
|
25
21
|
context: { postType },
|
|
26
|
-
attributes: {
|
|
27
|
-
type,
|
|
28
|
-
label,
|
|
29
|
-
showTitle,
|
|
30
|
-
textAlign,
|
|
31
|
-
linkLabel,
|
|
32
|
-
arrow,
|
|
33
|
-
taxonomy
|
|
34
|
-
},
|
|
22
|
+
attributes: { type, label, showTitle, linkLabel, arrow, taxonomy },
|
|
35
23
|
setAttributes
|
|
36
24
|
}) {
|
|
37
|
-
const blockEditingMode = useBlockEditingMode();
|
|
38
|
-
const showControls = blockEditingMode === "default";
|
|
39
25
|
const isNext = type === "next";
|
|
40
26
|
let placeholder = isNext ? __("Next") : __("Previous");
|
|
41
27
|
const arrowMap = {
|
|
@@ -54,11 +40,7 @@ function PostNavigationLinkEdit({
|
|
|
54
40
|
);
|
|
55
41
|
}
|
|
56
42
|
const ariaLabel = isNext ? __("Next post") : __("Previous post");
|
|
57
|
-
const blockProps = useBlockProps(
|
|
58
|
-
className: clsx({
|
|
59
|
-
[`has-text-align-${textAlign}`]: textAlign
|
|
60
|
-
})
|
|
61
|
-
});
|
|
43
|
+
const blockProps = useBlockProps();
|
|
62
44
|
const taxonomies = useSelect(
|
|
63
45
|
(select) => {
|
|
64
46
|
const { getTaxonomies } = select(coreStore);
|
|
@@ -217,15 +199,6 @@ function PostNavigationLinkEdit({
|
|
|
217
199
|
)
|
|
218
200
|
}
|
|
219
201
|
) }),
|
|
220
|
-
showControls && /* @__PURE__ */ jsx(BlockControls, { children: /* @__PURE__ */ jsx(
|
|
221
|
-
AlignmentToolbar,
|
|
222
|
-
{
|
|
223
|
-
value: textAlign,
|
|
224
|
-
onChange: (nextAlign) => {
|
|
225
|
-
setAttributes({ textAlign: nextAlign });
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
) }),
|
|
229
202
|
/* @__PURE__ */ jsxs("div", { ...blockProps, children: [
|
|
230
203
|
!isNext && displayArrow && /* @__PURE__ */ jsx(
|
|
231
204
|
"span",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-navigation-link/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";AAGA
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n\tSelectControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: { type, label, showTitle, linkLabel, arrow, taxonomy },\n\tsetAttributes,\n} ) {\n\tconst isNext = type === 'next';\n\tlet placeholder = isNext ? __( 'Next' ) : __( 'Previous' );\n\n\tconst arrowMap = {\n\t\tnone: '',\n\t\tarrow: isNext ? '\u2192' : '\u2190',\n\t\tchevron: isNext ? '\u00BB' : '\u00AB',\n\t};\n\n\tconst displayArrow = arrowMap[ arrow ];\n\n\tif ( showTitle ) {\n\t\tplaceholder = isNext\n\t\t\t? /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Next: ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t: /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Previous: ' ); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps();\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t\t\tlinkLabel: false,\n\t\t\t\t\t\t\tarrow: 'none',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showTitle }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showTitle: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'If you have entered a custom label, it will be prepended before the title.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! showTitle }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowTitle: ! showTitle,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! linkLabel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkLabel: false } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! linkLabel }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkLabel: ! linkLabel,\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/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => arrow !== 'none' }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { arrow: 'none' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\t\tvalue={ arrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { arrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'A decorative arrow for the next and previous link.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"none\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'None',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"arrow\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Arrow',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"chevron\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Chevron',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-previous is-arrow-${ arrow }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ showTitle && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-navigation-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'An example title' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-next is-arrow-${ arrow }` }\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,EAC1C,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,IAAI,UAAU;AACvB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,sCAAsC;AA2D7C,mBAqBI,KA2CA,YAhEJ;AAzDa,SAAR,uBAAyC;AAAA,EAC/C,SAAS,EAAE,SAAS;AAAA,EACpB,YAAY,EAAE,MAAM,OAAO,WAAW,WAAW,OAAO,SAAS;AAAA,EACjE;AACD,GAAI;AACH,QAAM,SAAS,SAAS;AACxB,MAAI,cAAc,SAAS,GAAI,MAAO,IAAI,GAAI,UAAW;AAEzD,QAAM,WAAW;AAAA,IAChB,MAAM;AAAA,IACN,OAAO,SAAS,WAAM;AAAA,IACtB,SAAS,SAAS,SAAM;AAAA,EACzB;AAEA,QAA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init-block.mjs";
|
|
|
4
4
|
import metadata from "./block.json";
|
|
5
5
|
import edit from "./edit.mjs";
|
|
6
6
|
import variations from "./variations.mjs";
|
|
7
|
+
import deprecated from "./deprecated.mjs";
|
|
7
8
|
var { name } = metadata;
|
|
8
9
|
var settings = {
|
|
9
10
|
edit,
|
|
10
11
|
variations,
|
|
12
|
+
deprecated,
|
|
11
13
|
example: {
|
|
12
14
|
attributes: {
|
|
13
15
|
label: __("Next post"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-navigation-link/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tvariations,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: __( 'Next post' ),\n\t\t\tarrow: 'arrow',\n\t\t},\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AAKnB,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAGV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,OAAO,GAAI,WAAY;AAAA,MACvB,OAAO;AAAA,IACR;AAAA,EACD;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tvariations,\n\tdeprecated,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: __( 'Next post' ),\n\t\t\tarrow: 'arrow',\n\t\t},\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AAKnB,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAGV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,OAAO,GAAI,WAAY;AAAA,MACvB,OAAO;AAAA,IACR;AAAA,EACD;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.40.0",
|
|
3
|
+
"version": "9.40.1-next.v.202602191100.0+2f8ac7442",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -94,42 +94,42 @@
|
|
|
94
94
|
"build-module/*/init.mjs"
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@wordpress/a11y": "^4.40.0",
|
|
98
|
-
"@wordpress/api-fetch": "^7.40.0",
|
|
99
|
-
"@wordpress/autop": "^4.40.0",
|
|
100
|
-
"@wordpress/base-styles": "^6.16.0",
|
|
101
|
-
"@wordpress/blob": "^4.40.0",
|
|
102
|
-
"@wordpress/block-editor": "^15.13.0",
|
|
103
|
-
"@wordpress/blocks": "^15.13.0",
|
|
104
|
-
"@wordpress/components": "^32.2.0",
|
|
105
|
-
"@wordpress/compose": "^7.40.0",
|
|
106
|
-
"@wordpress/core-data": "^7.40.0",
|
|
107
|
-
"@wordpress/data": "^10.40.0",
|
|
108
|
-
"@wordpress/date": "^5.40.0",
|
|
109
|
-
"@wordpress/deprecated": "^4.40.0",
|
|
110
|
-
"@wordpress/dom": "^4.40.0",
|
|
111
|
-
"@wordpress/element": "^6.40.0",
|
|
112
|
-
"@wordpress/escape-html": "^3.40.0",
|
|
113
|
-
"@wordpress/hooks": "^4.40.0",
|
|
114
|
-
"@wordpress/html-entities": "^4.40.0",
|
|
115
|
-
"@wordpress/i18n": "^6.13.0",
|
|
116
|
-
"@wordpress/icons": "^11.7.0",
|
|
117
|
-
"@wordpress/interactivity": "^6.40.0",
|
|
118
|
-
"@wordpress/interactivity-router": "^2.40.0",
|
|
119
|
-
"@wordpress/keyboard-shortcuts": "^5.40.0",
|
|
120
|
-
"@wordpress/keycodes": "^4.40.0",
|
|
121
|
-
"@wordpress/latex-to-mathml": "^1.8.0",
|
|
122
|
-
"@wordpress/notices": "^5.40.0",
|
|
123
|
-
"@wordpress/patterns": "^2.40.0",
|
|
124
|
-
"@wordpress/primitives": "^4.40.0",
|
|
125
|
-
"@wordpress/private-apis": "^1.40.0",
|
|
126
|
-
"@wordpress/reusable-blocks": "^5.40.0",
|
|
127
|
-
"@wordpress/rich-text": "^7.40.0",
|
|
128
|
-
"@wordpress/server-side-render": "^6.16.0",
|
|
129
|
-
"@wordpress/upload-media": "^0.25.0",
|
|
130
|
-
"@wordpress/url": "^4.40.0",
|
|
131
|
-
"@wordpress/viewport": "^6.40.0",
|
|
132
|
-
"@wordpress/wordcount": "^4.40.0",
|
|
97
|
+
"@wordpress/a11y": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
98
|
+
"@wordpress/api-fetch": "^7.40.1-next.v.202602191100.0+2f8ac7442",
|
|
99
|
+
"@wordpress/autop": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
100
|
+
"@wordpress/base-styles": "^6.16.1-next.v.202602191100.0+2f8ac7442",
|
|
101
|
+
"@wordpress/blob": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
102
|
+
"@wordpress/block-editor": "^15.13.1-next.v.202602191100.0+2f8ac7442",
|
|
103
|
+
"@wordpress/blocks": "^15.13.1-next.v.202602191100.0+2f8ac7442",
|
|
104
|
+
"@wordpress/components": "^32.2.1-next.v.202602191100.0+2f8ac7442",
|
|
105
|
+
"@wordpress/compose": "^7.40.1-next.v.202602191100.0+2f8ac7442",
|
|
106
|
+
"@wordpress/core-data": "^7.40.1-next.v.202602191100.0+2f8ac7442",
|
|
107
|
+
"@wordpress/data": "^10.40.1-next.v.202602191100.0+2f8ac7442",
|
|
108
|
+
"@wordpress/date": "^5.40.1-next.v.202602191100.0+2f8ac7442",
|
|
109
|
+
"@wordpress/deprecated": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
110
|
+
"@wordpress/dom": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
111
|
+
"@wordpress/element": "^6.40.1-next.v.202602191100.0+2f8ac7442",
|
|
112
|
+
"@wordpress/escape-html": "^3.40.1-next.v.202602191100.0+2f8ac7442",
|
|
113
|
+
"@wordpress/hooks": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
114
|
+
"@wordpress/html-entities": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
115
|
+
"@wordpress/i18n": "^6.13.1-next.v.202602191100.0+2f8ac7442",
|
|
116
|
+
"@wordpress/icons": "^11.7.1-next.v.202602191100.0+2f8ac7442",
|
|
117
|
+
"@wordpress/interactivity": "^6.40.1-next.v.202602191100.0+2f8ac7442",
|
|
118
|
+
"@wordpress/interactivity-router": "^2.40.1-next.v.202602191100.0+2f8ac7442",
|
|
119
|
+
"@wordpress/keyboard-shortcuts": "^5.40.1-next.v.202602191100.0+2f8ac7442",
|
|
120
|
+
"@wordpress/keycodes": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
121
|
+
"@wordpress/latex-to-mathml": "^1.8.1-next.v.202602191100.0+2f8ac7442",
|
|
122
|
+
"@wordpress/notices": "^5.40.1-next.v.202602191100.0+2f8ac7442",
|
|
123
|
+
"@wordpress/patterns": "^2.40.1-next.v.202602191100.0+2f8ac7442",
|
|
124
|
+
"@wordpress/primitives": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
125
|
+
"@wordpress/private-apis": "^1.40.1-next.v.202602191100.0+2f8ac7442",
|
|
126
|
+
"@wordpress/reusable-blocks": "^5.40.1-next.v.202602191100.0+2f8ac7442",
|
|
127
|
+
"@wordpress/rich-text": "^7.40.1-next.v.202602191100.0+2f8ac7442",
|
|
128
|
+
"@wordpress/server-side-render": "^6.16.1-next.v.202602191100.0+2f8ac7442",
|
|
129
|
+
"@wordpress/upload-media": "^0.25.1-next.v.202602191100.0+2f8ac7442",
|
|
130
|
+
"@wordpress/url": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
131
|
+
"@wordpress/viewport": "^6.40.1-next.v.202602191100.0+2f8ac7442",
|
|
132
|
+
"@wordpress/wordcount": "^4.40.1-next.v.202602191100.0+2f8ac7442",
|
|
133
133
|
"change-case": "^4.1.2",
|
|
134
134
|
"clsx": "^2.1.1",
|
|
135
135
|
"colord": "^2.7.0",
|
|
@@ -150,5 +150,5 @@
|
|
|
150
150
|
"publishConfig": {
|
|
151
151
|
"access": "public"
|
|
152
152
|
},
|
|
153
|
-
"gitHead": "
|
|
153
|
+
"gitHead": "de48b2351a7efb8a33a83067612960a0cf239592"
|
|
154
154
|
}
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
"description": "Displays the next or previous post link that is adjacent to the current post.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"textAlign": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
10
|
"type": {
|
|
14
11
|
"type": "string",
|
|
15
12
|
"default": "next"
|
|
@@ -46,6 +43,7 @@
|
|
|
46
43
|
"typography": {
|
|
47
44
|
"fontSize": true,
|
|
48
45
|
"lineHeight": true,
|
|
46
|
+
"textAlign": true,
|
|
49
47
|
"__experimentalFontFamily": true,
|
|
50
48
|
"__experimentalFontWeight": true,
|
|
51
49
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import migrateTextAlign from '../utils/migrate-text-align';
|
|
5
|
+
|
|
6
|
+
const v1 = {
|
|
7
|
+
attributes: {
|
|
8
|
+
textAlign: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
},
|
|
11
|
+
type: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: 'next',
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
role: 'content',
|
|
18
|
+
},
|
|
19
|
+
showTitle: {
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
linkLabel: {
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
arrow: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: 'none',
|
|
30
|
+
},
|
|
31
|
+
taxonomy: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
supports: {
|
|
37
|
+
anchor: true,
|
|
38
|
+
reusable: false,
|
|
39
|
+
html: false,
|
|
40
|
+
color: {
|
|
41
|
+
link: true,
|
|
42
|
+
},
|
|
43
|
+
typography: {
|
|
44
|
+
fontSize: true,
|
|
45
|
+
lineHeight: true,
|
|
46
|
+
__experimentalFontFamily: true,
|
|
47
|
+
__experimentalFontWeight: true,
|
|
48
|
+
__experimentalFontStyle: true,
|
|
49
|
+
__experimentalTextTransform: true,
|
|
50
|
+
__experimentalTextDecoration: true,
|
|
51
|
+
__experimentalLetterSpacing: true,
|
|
52
|
+
__experimentalDefaultControls: {
|
|
53
|
+
fontSize: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
interactivity: {
|
|
57
|
+
clientNavigation: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
migrate: migrateTextAlign,
|
|
61
|
+
isEligible( attributes ) {
|
|
62
|
+
return (
|
|
63
|
+
!! attributes.textAlign ||
|
|
64
|
+
!! attributes.className?.match(
|
|
65
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
save: () => null,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default [ v1 ];
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -17,10 +12,7 @@ import {
|
|
|
17
12
|
import {
|
|
18
13
|
InspectorControls,
|
|
19
14
|
RichText,
|
|
20
|
-
BlockControls,
|
|
21
|
-
AlignmentToolbar,
|
|
22
15
|
useBlockProps,
|
|
23
|
-
useBlockEditingMode,
|
|
24
16
|
} from '@wordpress/block-editor';
|
|
25
17
|
import { __, _x } from '@wordpress/i18n';
|
|
26
18
|
import { useSelect } from '@wordpress/data';
|
|
@@ -33,19 +25,9 @@ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
|
33
25
|
|
|
34
26
|
export default function PostNavigationLinkEdit( {
|
|
35
27
|
context: { postType },
|
|
36
|
-
attributes: {
|
|
37
|
-
type,
|
|
38
|
-
label,
|
|
39
|
-
showTitle,
|
|
40
|
-
textAlign,
|
|
41
|
-
linkLabel,
|
|
42
|
-
arrow,
|
|
43
|
-
taxonomy,
|
|
44
|
-
},
|
|
28
|
+
attributes: { type, label, showTitle, linkLabel, arrow, taxonomy },
|
|
45
29
|
setAttributes,
|
|
46
30
|
} ) {
|
|
47
|
-
const blockEditingMode = useBlockEditingMode();
|
|
48
|
-
const showControls = blockEditingMode === 'default';
|
|
49
31
|
const isNext = type === 'next';
|
|
50
32
|
let placeholder = isNext ? __( 'Next' ) : __( 'Previous' );
|
|
51
33
|
|
|
@@ -66,12 +48,7 @@ export default function PostNavigationLinkEdit( {
|
|
|
66
48
|
}
|
|
67
49
|
|
|
68
50
|
const ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );
|
|
69
|
-
const blockProps = useBlockProps(
|
|
70
|
-
className: clsx( {
|
|
71
|
-
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
72
|
-
} ),
|
|
73
|
-
} );
|
|
74
|
-
|
|
51
|
+
const blockProps = useBlockProps();
|
|
75
52
|
const taxonomies = useSelect(
|
|
76
53
|
( select ) => {
|
|
77
54
|
const { getTaxonomies } = select( coreStore );
|
|
@@ -220,16 +197,6 @@ export default function PostNavigationLinkEdit( {
|
|
|
220
197
|
) }
|
|
221
198
|
/>
|
|
222
199
|
</InspectorControls>
|
|
223
|
-
{ showControls && (
|
|
224
|
-
<BlockControls>
|
|
225
|
-
<AlignmentToolbar
|
|
226
|
-
value={ textAlign }
|
|
227
|
-
onChange={ ( nextAlign ) => {
|
|
228
|
-
setAttributes( { textAlign: nextAlign } );
|
|
229
|
-
} }
|
|
230
|
-
/>
|
|
231
|
-
</BlockControls>
|
|
232
|
-
) }
|
|
233
200
|
<div { ...blockProps }>
|
|
234
201
|
{ ! isNext && displayArrow && (
|
|
235
202
|
<span
|
|
@@ -10,6 +10,7 @@ import initBlock from '../utils/init-block';
|
|
|
10
10
|
import metadata from './block.json';
|
|
11
11
|
import edit from './edit';
|
|
12
12
|
import variations from './variations';
|
|
13
|
+
import deprecated from './deprecated';
|
|
13
14
|
|
|
14
15
|
const { name } = metadata;
|
|
15
16
|
export { metadata, name };
|
|
@@ -17,6 +18,7 @@ export { metadata, name };
|
|
|
17
18
|
export const settings = {
|
|
18
19
|
edit,
|
|
19
20
|
variations,
|
|
21
|
+
deprecated,
|
|
20
22
|
example: {
|
|
21
23
|
attributes: {
|
|
22
24
|
label: __( 'Next post' ),
|