@wordpress/block-library 9.40.2-next.v.202602271551.0 → 9.40.2
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/accordion/view.cjs +34 -0
- package/build/accordion/view.cjs.map +2 -2
- package/build/comment-reply-link/edit.cjs +2 -1
- package/build/comment-reply-link/edit.cjs.map +2 -2
- package/build/comments/edit/placeholder.cjs +2 -1
- package/build/comments/edit/placeholder.cjs.map +2 -2
- package/build/cover/edit/index.cjs +39 -26
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +8 -6
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/embed/embed-preview.cjs +2 -1
- package/build/embed/embed-preview.cjs.map +2 -2
- package/build/html/block.json +2 -1
- package/build/html/modal.cjs +147 -230
- package/build/html/modal.cjs.map +3 -3
- package/build/icon/block.json +3 -12
- package/build/image/image.cjs +1 -1
- package/build/image/image.cjs.map +2 -2
- package/build/latest-comments/deprecated.cjs +33 -0
- package/build/latest-comments/deprecated.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +125 -123
- package/build/navigation/edit/index.cjs.map +3 -3
- package/build/navigation/edit/leaf-more-menu.cjs +6 -68
- package/build/navigation/edit/leaf-more-menu.cjs.map +3 -3
- package/build/navigation/edit/menu-inspector-controls.cjs +91 -20
- package/build/navigation/edit/menu-inspector-controls.cjs.map +3 -3
- package/build/navigation/edit/navigation-menu-selector.cjs +4 -5
- package/build/navigation/edit/navigation-menu-selector.cjs.map +3 -3
- package/build/navigation/edit/placeholder/index.cjs +2 -2
- package/build/navigation/edit/placeholder/index.cjs.map +3 -3
- package/build/navigation/use-navigation-entities.cjs +67 -0
- package/build/navigation/use-navigation-entities.cjs.map +7 -0
- package/build/navigation/view.cjs +9 -2
- package/build/navigation/view.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +2 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/shared/use-handle-link-change.cjs +19 -3
- package/build/navigation-link/shared/use-handle-link-change.cjs.map +3 -3
- package/build/navigation-link/shared/use-link-preview.cjs +2 -2
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-submenu/edit.cjs +8 -22
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/nextpage/block.json +0 -1
- package/build/paragraph/edit.cjs +1 -1
- package/build/paragraph/edit.cjs.map +1 -1
- package/build/post-navigation-link/block.json +3 -1
- package/build/post-navigation-link/edit.cjs +36 -2
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-navigation-link/index.cjs +0 -2
- package/build/post-navigation-link/index.cjs.map +3 -3
- package/build/post-title/block.json +3 -1
- package/build/post-title/deprecated.cjs +1 -82
- package/build/post-title/deprecated.cjs.map +3 -3
- package/build/post-title/edit.cjs +36 -10
- package/build/post-title/edit.cjs.map +3 -3
- package/build/query-title/block.json +3 -1
- package/build/query-title/deprecated.cjs +1 -70
- package/build/query-title/deprecated.cjs.map +3 -3
- package/build/query-title/edit.cjs +35 -17
- package/build/query-title/edit.cjs.map +3 -3
- package/build/shortcode/block.json +2 -1
- package/build/site-tagline/block.json +4 -6
- package/build/site-tagline/deprecated.cjs +1 -66
- package/build/site-tagline/deprecated.cjs.map +3 -3
- package/build/site-tagline/edit.cjs +28 -14
- package/build/site-tagline/edit.cjs.map +3 -3
- package/build/site-title/block.json +3 -1
- package/build/site-title/deprecated.cjs +1 -79
- package/build/site-title/deprecated.cjs.map +3 -3
- package/build/site-title/edit.cjs +30 -14
- package/build/site-title/edit.cjs.map +3 -3
- package/build/tabs-menu-item/block.json +26 -1
- package/build/tabs-menu-item/controls.cjs +100 -2
- package/build/tabs-menu-item/controls.cjs.map +3 -3
- package/build/tabs-menu-item/edit.cjs +65 -6
- package/build/tabs-menu-item/edit.cjs.map +2 -2
- package/build/tabs-menu-item/save.cjs +15 -1
- package/build/tabs-menu-item/save.cjs.map +2 -2
- package/build-module/accordion/view.mjs +35 -1
- package/build-module/accordion/view.mjs.map +2 -2
- package/build-module/comment-reply-link/edit.mjs +3 -2
- package/build-module/comment-reply-link/edit.mjs.map +2 -2
- package/build-module/comments/edit/placeholder.mjs +3 -2
- package/build-module/comments/edit/placeholder.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +47 -29
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +7 -5
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/embed/embed-preview.mjs +2 -1
- package/build-module/embed/embed-preview.mjs.map +2 -2
- package/build-module/html/block.json +2 -1
- package/build-module/html/modal.mjs +149 -232
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +3 -12
- package/build-module/image/image.mjs +1 -1
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/latest-comments/deprecated.mjs +33 -0
- package/build-module/latest-comments/deprecated.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +125 -123
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/leaf-more-menu.mjs +7 -73
- package/build-module/navigation/edit/leaf-more-menu.mjs.map +2 -2
- package/build-module/navigation/edit/menu-inspector-controls.mjs +101 -21
- package/build-module/navigation/edit/menu-inspector-controls.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.mjs +5 -6
- package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
- package/build-module/navigation/edit/placeholder/index.mjs +2 -2
- package/build-module/navigation/edit/placeholder/index.mjs.map +2 -2
- package/build-module/navigation/use-navigation-entities.mjs +46 -0
- package/build-module/navigation/use-navigation-entities.mjs.map +7 -0
- package/build-module/navigation/view.mjs +9 -2
- package/build-module/navigation/view.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +2 -1
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-handle-link-change.mjs +19 -3
- package/build-module/navigation-link/shared/use-handle-link-change.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-submenu/edit.mjs +9 -23
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/nextpage/block.json +0 -1
- package/build-module/paragraph/edit.mjs +2 -2
- package/build-module/paragraph/edit.mjs.map +1 -1
- package/build-module/post-navigation-link/block.json +3 -1
- package/build-module/post-navigation-link/edit.mjs +30 -3
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/index.mjs +0 -2
- package/build-module/post-navigation-link/index.mjs.map +2 -2
- package/build-module/post-title/block.json +3 -1
- package/build-module/post-title/deprecated.mjs +1 -82
- package/build-module/post-title/deprecated.mjs.map +2 -2
- package/build-module/post-title/edit.mjs +27 -10
- package/build-module/post-title/edit.mjs.map +2 -2
- package/build-module/query-title/block.json +3 -1
- package/build-module/query-title/deprecated.mjs +1 -70
- package/build-module/query-title/deprecated.mjs.map +2 -2
- package/build-module/query-title/edit.mjs +36 -17
- package/build-module/query-title/edit.mjs.map +2 -2
- package/build-module/shortcode/block.json +2 -1
- package/build-module/site-tagline/block.json +4 -6
- package/build-module/site-tagline/deprecated.mjs +1 -66
- package/build-module/site-tagline/deprecated.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +29 -14
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/block.json +3 -1
- package/build-module/site-title/deprecated.mjs +1 -79
- package/build-module/site-title/deprecated.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +31 -14
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/block.json +26 -1
- package/build-module/tabs-menu-item/controls.mjs +104 -3
- package/build-module/tabs-menu-item/controls.mjs.map +2 -2
- package/build-module/tabs-menu-item/edit.mjs +66 -6
- package/build-module/tabs-menu-item/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/save.mjs +15 -1
- package/build-module/tabs-menu-item/save.mjs.map +2 -2
- package/build-style/editor-rtl.css +20 -6
- package/build-style/editor.css +20 -6
- package/build-style/html/editor-rtl.css +10 -6
- package/build-style/html/editor.css +10 -6
- package/build-style/icon/editor-rtl.css +5 -0
- package/build-style/icon/editor.css +5 -0
- package/build-style/navigation/style-rtl.css +15 -1
- package/build-style/navigation/style.css +15 -1
- package/build-style/navigation-overlay-close/style-rtl.css +3 -3
- package/build-style/navigation-overlay-close/style.css +3 -3
- package/build-style/style-rtl.css +30 -7
- package/build-style/style.css +30 -7
- package/build-style/tabs-menu-item/editor-rtl.css +5 -0
- package/build-style/tabs-menu-item/editor.css +5 -0
- package/build-style/tabs-menu-item/style-rtl.css +12 -3
- package/build-style/tabs-menu-item/style.css +12 -3
- package/package.json +38 -38
- package/src/accordion/view.js +44 -1
- package/src/accordion-item/index.php +18 -5
- package/src/comment-reply-link/edit.js +5 -2
- package/src/comments/edit/placeholder.js +5 -2
- package/src/cover/edit/index.js +72 -35
- package/src/cover/embed-video-utils.js +9 -7
- package/src/cover/index.php +12 -4
- package/src/details/index.php +47 -0
- package/src/embed/embed-preview.js +6 -5
- package/src/html/block.json +2 -1
- package/src/html/editor.scss +15 -5
- package/src/html/modal.js +32 -99
- package/src/icon/block.json +3 -12
- package/src/icon/editor.scss +5 -0
- package/src/icon/index.php +3 -1
- package/src/image/image.js +14 -15
- package/src/image/index.php +7 -5
- package/src/latest-comments/deprecated.js +33 -0
- package/src/navigation/edit/index.js +136 -134
- package/src/navigation/edit/leaf-more-menu.js +11 -86
- package/src/navigation/edit/menu-inspector-controls.js +142 -23
- package/src/navigation/edit/navigation-menu-selector.js +5 -6
- package/src/navigation/edit/placeholder/index.js +2 -3
- package/src/navigation/edit/test/navigation-menu-selector.js +20 -23
- package/src/navigation/index.php +62 -9
- package/src/navigation/style.scss +17 -1
- package/src/navigation/use-navigation-entities.js +72 -0
- package/src/navigation/view.js +14 -2
- package/src/navigation-link/edit.js +1 -0
- package/src/navigation-link/shared/test/use-handle-link-change.test.js +212 -0
- package/src/navigation-link/shared/test/use-link-preview.test.js +9 -0
- package/src/navigation-link/shared/use-handle-link-change.js +36 -9
- package/src/navigation-link/shared/use-link-preview.js +6 -9
- package/src/navigation-overlay-close/style.scss +3 -3
- package/src/navigation-submenu/edit.js +11 -28
- package/src/nextpage/block.json +0 -1
- package/src/page-list/index.php +1 -1
- package/src/paragraph/edit.js +2 -2
- package/src/post-featured-image/index.php +4 -2
- package/src/post-navigation-link/block.json +3 -1
- package/src/post-navigation-link/edit.js +35 -2
- package/src/post-navigation-link/index.js +0 -2
- package/src/post-title/block.json +3 -1
- package/src/post-title/deprecated.js +1 -86
- package/src/post-title/edit.js +18 -2
- package/src/query-title/block.json +3 -1
- package/src/query-title/deprecated.js +1 -74
- package/src/query-title/edit.js +27 -11
- package/src/query-title/index.php +1 -1
- package/src/shortcode/block.json +2 -1
- package/src/site-tagline/block.json +4 -6
- package/src/site-tagline/deprecated.js +1 -70
- package/src/site-tagline/edit.js +22 -9
- package/src/site-title/block.json +3 -1
- package/src/site-title/deprecated.js +1 -83
- package/src/site-title/edit.js +22 -9
- package/src/tabs-menu-item/block.json +26 -1
- package/src/tabs-menu-item/controls.js +108 -0
- package/src/tabs-menu-item/edit.js +79 -6
- package/src/tabs-menu-item/editor.scss +6 -0
- package/src/tabs-menu-item/save.js +26 -1
- package/src/tabs-menu-item/style.scss +14 -3
- package/build/navigation/edit/navigation-link-ui.cjs +0 -97
- package/build/navigation/edit/navigation-link-ui.cjs.map +0 -7
- package/build/navigation/edit/navigation-list-view-header.cjs +0 -86
- package/build/navigation/edit/navigation-list-view-header.cjs.map +0 -7
- package/build/post-navigation-link/deprecated.cjs +0 -100
- package/build/post-navigation-link/deprecated.cjs.map +0 -7
- package/build-module/navigation/edit/navigation-link-ui.mjs +0 -76
- package/build-module/navigation/edit/navigation-link-ui.mjs.map +0 -7
- package/build-module/navigation/edit/navigation-list-view-header.mjs +0 -58
- package/build-module/navigation/edit/navigation-list-view-header.mjs.map +0 -7
- package/build-module/post-navigation-link/deprecated.mjs +0 -69
- package/build-module/post-navigation-link/deprecated.mjs.map +0 -7
- package/src/navigation/edit/navigation-link-ui.js +0 -115
- package/src/navigation/edit/navigation-list-view-header.js +0 -62
- package/src/post-navigation-link/deprecated.js +0 -72
|
@@ -1,100 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA6B;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,0BAAAA;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": ["migrateTextAlign"]
|
|
7
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/navigation/edit/navigation-link-ui.js
|
|
2
|
-
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
3
|
-
import { useDispatch } from "@wordpress/data";
|
|
4
|
-
import {
|
|
5
|
-
LinkUI,
|
|
6
|
-
updateAttributes,
|
|
7
|
-
useEntityBinding
|
|
8
|
-
} from "../../navigation-link/shared/index.mjs";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var BLOCKS_WITH_LINK_UI_SUPPORT = [
|
|
11
|
-
"core/navigation-link",
|
|
12
|
-
"core/navigation-submenu"
|
|
13
|
-
];
|
|
14
|
-
function NavigationLinkUI({ block, insertedBlock, setInsertedBlock }) {
|
|
15
|
-
const { updateBlockAttributes, removeBlock } = useDispatch(blockEditorStore);
|
|
16
|
-
const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(
|
|
17
|
-
insertedBlock?.name
|
|
18
|
-
);
|
|
19
|
-
const blockWasJustInserted = insertedBlock?.clientId === block.clientId;
|
|
20
|
-
const showLinkControls = supportsLinkControls && blockWasJustInserted;
|
|
21
|
-
const { createBinding, clearBinding } = useEntityBinding({
|
|
22
|
-
clientId: insertedBlock?.clientId,
|
|
23
|
-
attributes: insertedBlock?.attributes || {}
|
|
24
|
-
});
|
|
25
|
-
if (!showLinkControls) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
const cleanupInsertedBlock = () => {
|
|
29
|
-
const shouldAutoSelectBlock = false;
|
|
30
|
-
if (!insertedBlock?.attributes?.url && insertedBlock?.clientId) {
|
|
31
|
-
removeBlock(insertedBlock.clientId, shouldAutoSelectBlock);
|
|
32
|
-
}
|
|
33
|
-
setInsertedBlock(null);
|
|
34
|
-
};
|
|
35
|
-
const setInsertedBlockAttributes = (_insertedBlockClientId) => (_updatedAttributes) => {
|
|
36
|
-
if (!_insertedBlockClientId) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
updateBlockAttributes(_insertedBlockClientId, _updatedAttributes);
|
|
40
|
-
};
|
|
41
|
-
const handleSetInsertedBlock = (newBlock) => {
|
|
42
|
-
const shouldAutoSelectBlock = false;
|
|
43
|
-
if (insertedBlock?.clientId && newBlock) {
|
|
44
|
-
removeBlock(insertedBlock.clientId, shouldAutoSelectBlock);
|
|
45
|
-
}
|
|
46
|
-
setInsertedBlock(newBlock);
|
|
47
|
-
};
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
LinkUI,
|
|
50
|
-
{
|
|
51
|
-
clientId: insertedBlock?.clientId,
|
|
52
|
-
link: insertedBlock?.attributes,
|
|
53
|
-
onBlockInsert: handleSetInsertedBlock,
|
|
54
|
-
onClose: () => {
|
|
55
|
-
cleanupInsertedBlock();
|
|
56
|
-
},
|
|
57
|
-
onChange: (updatedValue) => {
|
|
58
|
-
const { isEntityLink, attributes: updatedAttributes } = updateAttributes(
|
|
59
|
-
updatedValue,
|
|
60
|
-
setInsertedBlockAttributes(insertedBlock?.clientId),
|
|
61
|
-
insertedBlock?.attributes
|
|
62
|
-
);
|
|
63
|
-
if (isEntityLink) {
|
|
64
|
-
createBinding(updatedAttributes);
|
|
65
|
-
} else {
|
|
66
|
-
clearBinding();
|
|
67
|
-
}
|
|
68
|
-
setInsertedBlock(null);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
NavigationLinkUI
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=navigation-link-ui.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/edit/navigation-link-ui.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLinkUI,\n\tupdateAttributes,\n\tuseEntityBinding,\n} from '../../navigation-link/shared';\n\nconst BLOCKS_WITH_LINK_UI_SUPPORT = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\nexport function NavigationLinkUI( { block, insertedBlock, setInsertedBlock } ) {\n\tconst { updateBlockAttributes, removeBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(\n\t\tinsertedBlock?.name\n\t);\n\tconst blockWasJustInserted = insertedBlock?.clientId === block.clientId;\n\tconst showLinkControls = supportsLinkControls && blockWasJustInserted;\n\n\t// Get binding utilities for the inserted block\n\tconst { createBinding, clearBinding } = useEntityBinding( {\n\t\tclientId: insertedBlock?.clientId,\n\t\tattributes: insertedBlock?.attributes || {},\n\t} );\n\n\tif ( ! showLinkControls ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Cleanup function for auto-inserted Navigation Link blocks.\n\t *\n\t * Removes the block if it has no URL and clears the inserted block state.\n\t * This ensures consistent cleanup behavior across different contexts.\n\t */\n\tconst cleanupInsertedBlock = () => {\n\t\t// Prevent automatic block selection when removing blocks in list view context\n\t\t// This avoids focus stealing that would close the list view and switch to canvas\n\t\tconst shouldAutoSelectBlock = false;\n\n\t\t// Follows the exact same pattern as Navigation Link block's onClose handler\n\t\t// If there is no URL then remove the auto-inserted block to avoid empty blocks\n\t\tif ( ! insertedBlock?.attributes?.url && insertedBlock?.clientId ) {\n\t\t\t// Remove the block entirely to avoid poor UX\n\t\t\t// This matches the Navigation Link block's behavior\n\t\t\tremoveBlock( insertedBlock.clientId, shouldAutoSelectBlock );\n\t\t}\n\t\tsetInsertedBlock( null );\n\t};\n\n\tconst setInsertedBlockAttributes =\n\t\t( _insertedBlockClientId ) => ( _updatedAttributes ) => {\n\t\t\tif ( ! _insertedBlockClientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupdateBlockAttributes( _insertedBlockClientId, _updatedAttributes );\n\t\t};\n\n\t// Wrapper function to clean up original block when a new block is selected\n\tconst handleSetInsertedBlock = ( newBlock ) => {\n\t\t// Prevent automatic block selection when removing blocks in list view context\n\t\t// This avoids focus stealing that would close the list view and switch to canvas\n\t\tconst shouldAutoSelectBlock = false;\n\n\t\t// If we have an existing inserted block and a new block is being set,\n\t\t// remove the original block to avoid duplicates\n\t\tif ( insertedBlock?.clientId && newBlock ) {\n\t\t\tremoveBlock( insertedBlock.clientId, shouldAutoSelectBlock );\n\t\t}\n\t\tsetInsertedBlock( newBlock );\n\t};\n\n\treturn (\n\t\t<LinkUI\n\t\t\tclientId={ insertedBlock?.clientId }\n\t\t\tlink={ insertedBlock?.attributes }\n\t\t\tonBlockInsert={ handleSetInsertedBlock }\n\t\t\tonClose={ () => {\n\t\t\t\t// Use cleanup function\n\t\t\t\tcleanupInsertedBlock();\n\t\t\t} }\n\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t// updateAttributes determines the final state and returns metadata\n\t\t\t\tconst { isEntityLink, attributes: updatedAttributes } =\n\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\tsetInsertedBlockAttributes( insertedBlock?.clientId ),\n\t\t\t\t\t\tinsertedBlock?.attributes\n\t\t\t\t\t);\n\n\t\t\t\t// Handle URL binding based on the final computed state\n\t\t\t\t// Only create bindings for entity links (posts, pages, taxonomies)\n\t\t\t\t// Never create bindings for custom links (manual URLs)\n\t\t\t\tif ( isEntityLink ) {\n\t\t\t\t\tcreateBinding( updatedAttributes );\n\t\t\t\t} else {\n\t\t\t\t\tclearBinding();\n\t\t\t\t}\n\n\t\t\t\tsetInsertedBlock( null );\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,SAAS,wBAAwB;AAC1C,SAAS,mBAAmB;AAK5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAuEL;AArEF,IAAM,8BAA8B;AAAA,EACnC;AAAA,EACA;AACD;AAEO,SAAS,iBAAkB,EAAE,OAAO,eAAe,iBAAiB,GAAI;AAC9E,QAAM,EAAE,uBAAuB,YAAY,IAC1C,YAAa,gBAAiB;AAE/B,QAAM,uBAAuB,6BAA6B;AAAA,IACzD,eAAe;AAAA,EAChB;AACA,QAAM,uBAAuB,eAAe,aAAa,MAAM;AAC/D,QAAM,mBAAmB,wBAAwB;AAGjD,QAAM,EAAE,eAAe,aAAa,IAAI,iBAAkB;AAAA,IACzD,UAAU,eAAe;AAAA,IACzB,YAAY,eAAe,cAAc,CAAC;AAAA,EAC3C,CAAE;AAEF,MAAK,CAAE,kBAAmB;AACzB,WAAO;AAAA,EACR;AAQA,QAAM,uBAAuB,MAAM;AAGlC,UAAM,wBAAwB;AAI9B,QAAK,CAAE,eAAe,YAAY,OAAO,eAAe,UAAW;AAGlE,kBAAa,cAAc,UAAU,qBAAsB;AAAA,IAC5D;AACA,qBAAkB,IAAK;AAAA,EACxB;AAEA,QAAM,6BACL,CAAE,2BAA4B,CAAE,uBAAwB;AACvD,QAAK,CAAE,wBAAyB;AAC/B;AAAA,IACD;AACA,0BAAuB,wBAAwB,kBAAmB;AAAA,EACnE;AAGD,QAAM,yBAAyB,CAAE,aAAc;AAG9C,UAAM,wBAAwB;AAI9B,QAAK,eAAe,YAAY,UAAW;AAC1C,kBAAa,cAAc,UAAU,qBAAsB;AAAA,IAC5D;AACA,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,UAAW,eAAe;AAAA,MAC1B,MAAO,eAAe;AAAA,MACtB,eAAgB;AAAA,MAChB,SAAU,MAAM;AAEf,6BAAqB;AAAA,MACtB;AAAA,MACA,UAAW,CAAE,iBAAkB;AAE9B,cAAM,EAAE,cAAc,YAAY,kBAAkB,IACnD;AAAA,UACC;AAAA,UACA,2BAA4B,eAAe,QAAS;AAAA,UACpD,eAAe;AAAA,QAChB;AAKD,YAAK,cAAe;AACnB,wBAAe,iBAAkB;AAAA,QAClC,OAAO;AACN,uBAAa;AAAA,QACd;AAEA,yBAAkB,IAAK;AAAA,MACxB;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/navigation/edit/navigation-list-view-header.js
|
|
2
|
-
import {
|
|
3
|
-
__experimentalHStack as HStack,
|
|
4
|
-
__experimentalHeading as Heading
|
|
5
|
-
} from "@wordpress/components";
|
|
6
|
-
import { __ } from "@wordpress/i18n";
|
|
7
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
8
|
-
import NavigationMenuSelector from "./navigation-menu-selector.mjs";
|
|
9
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
var { useBlockDisplayTitle } = unlock(blockEditorPrivateApis);
|
|
12
|
-
var actionLabel = (
|
|
13
|
-
/* translators: %s: The name of a menu. */
|
|
14
|
-
__("Switch to '%s'")
|
|
15
|
-
);
|
|
16
|
-
function NavigationListViewHeader({
|
|
17
|
-
clientId,
|
|
18
|
-
blockEditingMode,
|
|
19
|
-
currentMenuId,
|
|
20
|
-
onSelectClassicMenu,
|
|
21
|
-
onSelectNavigationMenu,
|
|
22
|
-
onCreateNew,
|
|
23
|
-
createNavigationMenuIsSuccess,
|
|
24
|
-
createNavigationMenuIsError,
|
|
25
|
-
isManageMenusButtonDisabled
|
|
26
|
-
}) {
|
|
27
|
-
const blockTitle = useBlockDisplayTitle({
|
|
28
|
-
clientId,
|
|
29
|
-
context: "list-view"
|
|
30
|
-
});
|
|
31
|
-
return /* @__PURE__ */ jsxs(HStack, { className: "wp-block-navigation-off-canvas-editor__header", children: [
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
Heading,
|
|
34
|
-
{
|
|
35
|
-
className: "wp-block-navigation-off-canvas-editor__title",
|
|
36
|
-
level: 2,
|
|
37
|
-
children: blockTitle
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
blockEditingMode === "default" && /* @__PURE__ */ jsx(
|
|
41
|
-
NavigationMenuSelector,
|
|
42
|
-
{
|
|
43
|
-
currentMenuId,
|
|
44
|
-
onSelectClassicMenu,
|
|
45
|
-
onSelectNavigationMenu,
|
|
46
|
-
onCreateNew,
|
|
47
|
-
createNavigationMenuIsSuccess,
|
|
48
|
-
createNavigationMenuIsError,
|
|
49
|
-
actionLabel,
|
|
50
|
-
isManageMenusButtonDisabled
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
] });
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
56
|
-
NavigationListViewHeader as default
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=navigation-list-view-header.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/edit/navigation-list-view-header.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuSelector from './navigation-menu-selector';\nimport { unlock } from '../../lock-unlock';\n\nconst { useBlockDisplayTitle } = unlock( blockEditorPrivateApis );\n\nconst actionLabel =\n\t/* translators: %s: The name of a menu. */ __( \"Switch to '%s'\" );\n\nexport default function NavigationListViewHeader( {\n\tclientId,\n\tblockEditingMode,\n\tcurrentMenuId,\n\tonSelectClassicMenu,\n\tonSelectNavigationMenu,\n\tonCreateNew,\n\tcreateNavigationMenuIsSuccess,\n\tcreateNavigationMenuIsError,\n\tisManageMenusButtonDisabled,\n} ) {\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\n\treturn (\n\t\t<HStack className=\"wp-block-navigation-off-canvas-editor__header\">\n\t\t\t<Heading\n\t\t\t\tclassName=\"wp-block-navigation-off-canvas-editor__title\"\n\t\t\t\tlevel={ 2 }\n\t\t\t>\n\t\t\t\t{ blockTitle }\n\t\t\t</Heading>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<NavigationMenuSelector\n\t\t\t\t\tcurrentMenuId={ currentMenuId }\n\t\t\t\t\tonSelectClassicMenu={ onSelectClassicMenu }\n\t\t\t\t\tonSelectNavigationMenu={ onSelectNavigationMenu }\n\t\t\t\t\tonCreateNew={ onCreateNew }\n\t\t\t\t\tcreateNavigationMenuIsSuccess={\n\t\t\t\t\t\tcreateNavigationMenuIsSuccess\n\t\t\t\t\t}\n\t\t\t\t\tcreateNavigationMenuIsError={ createNavigationMenuIsError }\n\t\t\t\t\tactionLabel={ actionLabel }\n\t\t\t\t\tisManageMenusButtonDisabled={ isManageMenusButtonDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,OACnB;AACP,SAAS,UAAU;AACnB,SAAS,eAAe,8BAA8B;AAKtD,OAAO,4BAA4B;AACnC,SAAS,cAAc;AAwBrB,SACC,KADD;AAtBF,IAAM,EAAE,qBAAqB,IAAI,OAAQ,sBAAuB;AAEhE,IAAM;AAAA;AAAA,EACsC,GAAI,gBAAiB;AAAA;AAElD,SAAR,yBAA2C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,aAAa,qBAAsB;AAAA,IACxC;AAAA,IACA,SAAS;AAAA,EACV,CAAE;AAEF,SACC,qBAAC,UAAO,WAAU,iDACjB;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAQ;AAAA,QAEN;AAAA;AAAA,IACH;AAAA,IACE,qBAAqB,aACtB;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import {
|
|
11
|
-
LinkUI,
|
|
12
|
-
updateAttributes,
|
|
13
|
-
useEntityBinding,
|
|
14
|
-
} from '../../navigation-link/shared';
|
|
15
|
-
|
|
16
|
-
const BLOCKS_WITH_LINK_UI_SUPPORT = [
|
|
17
|
-
'core/navigation-link',
|
|
18
|
-
'core/navigation-submenu',
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export function NavigationLinkUI( { block, insertedBlock, setInsertedBlock } ) {
|
|
22
|
-
const { updateBlockAttributes, removeBlock } =
|
|
23
|
-
useDispatch( blockEditorStore );
|
|
24
|
-
|
|
25
|
-
const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(
|
|
26
|
-
insertedBlock?.name
|
|
27
|
-
);
|
|
28
|
-
const blockWasJustInserted = insertedBlock?.clientId === block.clientId;
|
|
29
|
-
const showLinkControls = supportsLinkControls && blockWasJustInserted;
|
|
30
|
-
|
|
31
|
-
// Get binding utilities for the inserted block
|
|
32
|
-
const { createBinding, clearBinding } = useEntityBinding( {
|
|
33
|
-
clientId: insertedBlock?.clientId,
|
|
34
|
-
attributes: insertedBlock?.attributes || {},
|
|
35
|
-
} );
|
|
36
|
-
|
|
37
|
-
if ( ! showLinkControls ) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Cleanup function for auto-inserted Navigation Link blocks.
|
|
43
|
-
*
|
|
44
|
-
* Removes the block if it has no URL and clears the inserted block state.
|
|
45
|
-
* This ensures consistent cleanup behavior across different contexts.
|
|
46
|
-
*/
|
|
47
|
-
const cleanupInsertedBlock = () => {
|
|
48
|
-
// Prevent automatic block selection when removing blocks in list view context
|
|
49
|
-
// This avoids focus stealing that would close the list view and switch to canvas
|
|
50
|
-
const shouldAutoSelectBlock = false;
|
|
51
|
-
|
|
52
|
-
// Follows the exact same pattern as Navigation Link block's onClose handler
|
|
53
|
-
// If there is no URL then remove the auto-inserted block to avoid empty blocks
|
|
54
|
-
if ( ! insertedBlock?.attributes?.url && insertedBlock?.clientId ) {
|
|
55
|
-
// Remove the block entirely to avoid poor UX
|
|
56
|
-
// This matches the Navigation Link block's behavior
|
|
57
|
-
removeBlock( insertedBlock.clientId, shouldAutoSelectBlock );
|
|
58
|
-
}
|
|
59
|
-
setInsertedBlock( null );
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const setInsertedBlockAttributes =
|
|
63
|
-
( _insertedBlockClientId ) => ( _updatedAttributes ) => {
|
|
64
|
-
if ( ! _insertedBlockClientId ) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
updateBlockAttributes( _insertedBlockClientId, _updatedAttributes );
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// Wrapper function to clean up original block when a new block is selected
|
|
71
|
-
const handleSetInsertedBlock = ( newBlock ) => {
|
|
72
|
-
// Prevent automatic block selection when removing blocks in list view context
|
|
73
|
-
// This avoids focus stealing that would close the list view and switch to canvas
|
|
74
|
-
const shouldAutoSelectBlock = false;
|
|
75
|
-
|
|
76
|
-
// If we have an existing inserted block and a new block is being set,
|
|
77
|
-
// remove the original block to avoid duplicates
|
|
78
|
-
if ( insertedBlock?.clientId && newBlock ) {
|
|
79
|
-
removeBlock( insertedBlock.clientId, shouldAutoSelectBlock );
|
|
80
|
-
}
|
|
81
|
-
setInsertedBlock( newBlock );
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<LinkUI
|
|
86
|
-
clientId={ insertedBlock?.clientId }
|
|
87
|
-
link={ insertedBlock?.attributes }
|
|
88
|
-
onBlockInsert={ handleSetInsertedBlock }
|
|
89
|
-
onClose={ () => {
|
|
90
|
-
// Use cleanup function
|
|
91
|
-
cleanupInsertedBlock();
|
|
92
|
-
} }
|
|
93
|
-
onChange={ ( updatedValue ) => {
|
|
94
|
-
// updateAttributes determines the final state and returns metadata
|
|
95
|
-
const { isEntityLink, attributes: updatedAttributes } =
|
|
96
|
-
updateAttributes(
|
|
97
|
-
updatedValue,
|
|
98
|
-
setInsertedBlockAttributes( insertedBlock?.clientId ),
|
|
99
|
-
insertedBlock?.attributes
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// Handle URL binding based on the final computed state
|
|
103
|
-
// Only create bindings for entity links (posts, pages, taxonomies)
|
|
104
|
-
// Never create bindings for custom links (manual URLs)
|
|
105
|
-
if ( isEntityLink ) {
|
|
106
|
-
createBinding( updatedAttributes );
|
|
107
|
-
} else {
|
|
108
|
-
clearBinding();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
setInsertedBlock( null );
|
|
112
|
-
} }
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalHStack as HStack,
|
|
6
|
-
__experimentalHeading as Heading,
|
|
7
|
-
} from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import NavigationMenuSelector from './navigation-menu-selector';
|
|
15
|
-
import { unlock } from '../../lock-unlock';
|
|
16
|
-
|
|
17
|
-
const { useBlockDisplayTitle } = unlock( blockEditorPrivateApis );
|
|
18
|
-
|
|
19
|
-
const actionLabel =
|
|
20
|
-
/* translators: %s: The name of a menu. */ __( "Switch to '%s'" );
|
|
21
|
-
|
|
22
|
-
export default function NavigationListViewHeader( {
|
|
23
|
-
clientId,
|
|
24
|
-
blockEditingMode,
|
|
25
|
-
currentMenuId,
|
|
26
|
-
onSelectClassicMenu,
|
|
27
|
-
onSelectNavigationMenu,
|
|
28
|
-
onCreateNew,
|
|
29
|
-
createNavigationMenuIsSuccess,
|
|
30
|
-
createNavigationMenuIsError,
|
|
31
|
-
isManageMenusButtonDisabled,
|
|
32
|
-
} ) {
|
|
33
|
-
const blockTitle = useBlockDisplayTitle( {
|
|
34
|
-
clientId,
|
|
35
|
-
context: 'list-view',
|
|
36
|
-
} );
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<HStack className="wp-block-navigation-off-canvas-editor__header">
|
|
40
|
-
<Heading
|
|
41
|
-
className="wp-block-navigation-off-canvas-editor__title"
|
|
42
|
-
level={ 2 }
|
|
43
|
-
>
|
|
44
|
-
{ blockTitle }
|
|
45
|
-
</Heading>
|
|
46
|
-
{ blockEditingMode === 'default' && (
|
|
47
|
-
<NavigationMenuSelector
|
|
48
|
-
currentMenuId={ currentMenuId }
|
|
49
|
-
onSelectClassicMenu={ onSelectClassicMenu }
|
|
50
|
-
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
51
|
-
onCreateNew={ onCreateNew }
|
|
52
|
-
createNavigationMenuIsSuccess={
|
|
53
|
-
createNavigationMenuIsSuccess
|
|
54
|
-
}
|
|
55
|
-
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
56
|
-
actionLabel={ actionLabel }
|
|
57
|
-
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
58
|
-
/>
|
|
59
|
-
) }
|
|
60
|
-
</HStack>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
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 ];
|