@wordpress/block-library 9.44.0 → 9.44.1-next.v.202604201441.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/button/constants.cjs +1 -1
- package/build/button/constants.cjs.map +1 -1
- package/build/group/block.json +2 -1
- package/build/image/constants.cjs +1 -1
- package/build/image/constants.cjs.map +2 -2
- package/build/image/edit.cjs +1 -3
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +20 -9
- package/build/image/image.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +1 -1
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/paragraph/use-enter.cjs +12 -23
- package/build/paragraph/use-enter.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs +2 -5
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-template/edit.cjs +8 -2
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +1 -4
- package/build/site-logo/edit.cjs +2 -2
- package/build/site-logo/edit.cjs.map +1 -1
- package/build/tab/block.json +2 -2
- package/build/tab/edit.cjs +3 -21
- package/build/tab/edit.cjs.map +3 -3
- package/build/tab-panel/block.json +1 -1
- package/build/tab-panel/edit.cjs +1 -4
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -1
- package/build/tabs/edit.cjs +10 -86
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/use-tab-menu-sync.cjs +192 -0
- package/build/tabs/use-tab-menu-sync.cjs.map +7 -0
- package/build/tabs-menu/block.json +1 -1
- package/build/tabs-menu/edit.cjs +5 -10
- package/build/tabs-menu/edit.cjs.map +3 -3
- package/build/tabs-menu-item/block.json +1 -4
- package/build/tabs-menu-item/edit.cjs +3 -12
- package/build/tabs-menu-item/edit.cjs.map +2 -2
- package/build-module/button/constants.mjs +1 -1
- package/build-module/button/constants.mjs.map +1 -1
- package/build-module/group/block.json +2 -1
- package/build-module/image/constants.mjs +1 -1
- package/build-module/image/constants.mjs.map +2 -2
- package/build-module/image/edit.mjs +1 -3
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +20 -9
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +1 -1
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/paragraph/use-enter.mjs +13 -23
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +2 -5
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-template/edit.mjs +8 -2
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +1 -4
- package/build-module/site-logo/edit.mjs +2 -2
- package/build-module/site-logo/edit.mjs.map +1 -1
- package/build-module/tab/block.json +2 -2
- package/build-module/tab/edit.mjs +3 -21
- package/build-module/tab/edit.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -1
- package/build-module/tab-panel/edit.mjs +1 -4
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -1
- package/build-module/tabs/edit.mjs +12 -88
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/use-tab-menu-sync.mjs +171 -0
- package/build-module/tabs/use-tab-menu-sync.mjs.map +7 -0
- package/build-module/tabs-menu/block.json +1 -1
- package/build-module/tabs-menu/edit.mjs +5 -10
- package/build-module/tabs-menu/edit.mjs.map +2 -2
- package/build-module/tabs-menu-item/block.json +1 -4
- package/build-module/tabs-menu-item/edit.mjs +3 -12
- package/build-module/tabs-menu-item/edit.mjs.map +2 -2
- package/build-style/latest-comments/style-rtl.css +4 -4
- package/build-style/latest-comments/style.css +4 -4
- package/build-style/post-template/style-rtl.css +1 -1
- package/build-style/post-template/style.css +1 -1
- package/build-style/style-rtl.css +5 -8
- package/build-style/style.css +5 -8
- package/build-style/tabs/style-rtl.css +0 -3
- package/build-style/tabs/style.css +0 -3
- package/package.json +38 -38
- package/src/block/test/edit.native.js +1 -1
- package/src/button/constants.js +1 -1
- package/src/button/test/get-updated-link-attributes.js +6 -10
- package/src/group/block.json +2 -1
- package/src/image/constants.js +1 -1
- package/src/image/edit.js +0 -2
- package/src/image/image.js +33 -22
- package/src/image/test/edit.native.js +2 -2
- package/src/latest-comments/style.scss +7 -7
- package/src/latest-posts/edit.js +1 -1
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/test/overlay-template-part-selector.js +1 -0
- package/src/paragraph/use-enter.js +18 -24
- package/src/post-featured-image/edit.js +2 -9
- package/src/post-template/edit.js +7 -1
- package/src/post-template/index.php +3 -0
- package/src/post-template/style.scss +2 -2
- package/src/pullquote/block.json +1 -4
- package/src/site-logo/edit.js +2 -2
- package/src/tab/block.json +2 -2
- package/src/tab/edit.js +2 -27
- package/src/tab-panel/block.json +1 -1
- package/src/tab-panel/edit.js +2 -4
- package/src/tabs/block.json +0 -1
- package/src/tabs/edit.js +11 -134
- package/src/tabs/style.scss +0 -3
- package/src/tabs/use-tab-menu-sync.js +239 -0
- package/src/tabs-menu/block.json +1 -1
- package/src/tabs-menu/edit.js +6 -15
- package/src/tabs-menu-item/block.json +1 -4
- package/src/tabs-menu-item/edit.js +3 -12
- package/build/tab/slug-from-label.cjs +0 -37
- package/build/tab/slug-from-label.cjs.map +0 -7
- package/build-module/tab/slug-from-label.mjs +0 -16
- package/build-module/tab/slug-from-label.mjs.map +0 -7
- package/src/tab/slug-from-label.js +0 -26
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/block-library/src/tab/slug-from-label.js
|
|
21
|
-
var slug_from_label_exports = {};
|
|
22
|
-
__export(slug_from_label_exports, {
|
|
23
|
-
default: () => slugFromLabel
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(slug_from_label_exports);
|
|
26
|
-
var import_url = require("@wordpress/url");
|
|
27
|
-
function slugFromLabel(label, tabIndex) {
|
|
28
|
-
const htmlDocument = new window.DOMParser().parseFromString(
|
|
29
|
-
label,
|
|
30
|
-
"text/html"
|
|
31
|
-
);
|
|
32
|
-
if (htmlDocument.body?.textContent) {
|
|
33
|
-
return (0, import_url.cleanForSlug)(htmlDocument.body.textContent);
|
|
34
|
-
}
|
|
35
|
-
return `tab-panel-${tabIndex}`;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=slug-from-label.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/slug-from-label.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Generates a slug from a tab's text label.\n *\n * @param {string} label Tab label RichText value.\n * @param {number} tabIndex Tab index value.\n *\n * @return {string} The generated slug with HTML stripped out.\n */\nexport default function slugFromLabel( label, tabIndex ) {\n\t// Get just the text content, filtering out any HTML tags from the RichText value.\n\tconst htmlDocument = new window.DOMParser().parseFromString(\n\t\tlabel,\n\t\t'text/html'\n\t);\n\tif ( htmlDocument.body?.textContent ) {\n\t\treturn cleanForSlug( htmlDocument.body.textContent );\n\t}\n\n\t// Fall back to using the tab index if the label is empty.\n\treturn `tab-panel-${ tabIndex }`;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAA6B;AAUd,SAAR,cAAgC,OAAO,UAAW;AAExD,QAAM,eAAe,IAAI,OAAO,UAAU,EAAE;AAAA,IAC3C;AAAA,IACA;AAAA,EACD;AACA,MAAK,aAAa,MAAM,aAAc;AACrC,eAAO,yBAAc,aAAa,KAAK,WAAY;AAAA,EACpD;AAGA,SAAO,aAAc,QAAS;AAC/B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/tab/slug-from-label.js
|
|
2
|
-
import { cleanForSlug } from "@wordpress/url";
|
|
3
|
-
function slugFromLabel(label, tabIndex) {
|
|
4
|
-
const htmlDocument = new window.DOMParser().parseFromString(
|
|
5
|
-
label,
|
|
6
|
-
"text/html"
|
|
7
|
-
);
|
|
8
|
-
if (htmlDocument.body?.textContent) {
|
|
9
|
-
return cleanForSlug(htmlDocument.body.textContent);
|
|
10
|
-
}
|
|
11
|
-
return `tab-panel-${tabIndex}`;
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
slugFromLabel as default
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=slug-from-label.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/slug-from-label.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Generates a slug from a tab's text label.\n *\n * @param {string} label Tab label RichText value.\n * @param {number} tabIndex Tab index value.\n *\n * @return {string} The generated slug with HTML stripped out.\n */\nexport default function slugFromLabel( label, tabIndex ) {\n\t// Get just the text content, filtering out any HTML tags from the RichText value.\n\tconst htmlDocument = new window.DOMParser().parseFromString(\n\t\tlabel,\n\t\t'text/html'\n\t);\n\tif ( htmlDocument.body?.textContent ) {\n\t\treturn cleanForSlug( htmlDocument.body.textContent );\n\t}\n\n\t// Fall back to using the tab index if the label is empty.\n\treturn `tab-panel-${ tabIndex }`;\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,oBAAoB;AAUd,SAAR,cAAgC,OAAO,UAAW;AAExD,QAAM,eAAe,IAAI,OAAO,UAAU,EAAE;AAAA,IAC3C;AAAA,IACA;AAAA,EACD;AACA,MAAK,aAAa,MAAM,aAAc;AACrC,WAAO,aAAc,aAAa,KAAK,WAAY;AAAA,EACpD;AAGA,SAAO,aAAc,QAAS;AAC/B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { cleanForSlug } from '@wordpress/url';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Generates a slug from a tab's text label.
|
|
8
|
-
*
|
|
9
|
-
* @param {string} label Tab label RichText value.
|
|
10
|
-
* @param {number} tabIndex Tab index value.
|
|
11
|
-
*
|
|
12
|
-
* @return {string} The generated slug with HTML stripped out.
|
|
13
|
-
*/
|
|
14
|
-
export default function slugFromLabel( label, tabIndex ) {
|
|
15
|
-
// Get just the text content, filtering out any HTML tags from the RichText value.
|
|
16
|
-
const htmlDocument = new window.DOMParser().parseFromString(
|
|
17
|
-
label,
|
|
18
|
-
'text/html'
|
|
19
|
-
);
|
|
20
|
-
if ( htmlDocument.body?.textContent ) {
|
|
21
|
-
return cleanForSlug( htmlDocument.body.textContent );
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Fall back to using the tab index if the label is empty.
|
|
25
|
-
return `tab-panel-${ tabIndex }`;
|
|
26
|
-
}
|