@wordpress/block-library 9.33.2 → 9.33.3
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-heading/block.json +1 -1
- package/build/freeform/block.json +5 -1
- package/build/math/deprecated.js +54 -0
- package/build/math/deprecated.js.map +7 -0
- package/build/math/index.js +3 -1
- package/build/math/index.js.map +3 -3
- package/build/math/save.js +2 -3
- package/build/math/save.js.map +2 -2
- package/build/missing/block.json +3 -0
- package/build/utils/get-transformed-attributes.js +0 -3
- package/build/utils/get-transformed-attributes.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/freeform/block.json +5 -1
- package/build-module/math/deprecated.js +34 -0
- package/build-module/math/deprecated.js.map +7 -0
- package/build-module/math/index.js +3 -1
- package/build-module/math/index.js.map +2 -2
- package/build-module/math/save.js +2 -3
- package/build-module/math/save.js.map +2 -2
- package/build-module/missing/block.json +3 -0
- package/build-module/utils/get-transformed-attributes.js +0 -3
- package/build-module/utils/get-transformed-attributes.js.map +2 -2
- package/build-style/math/style-rtl.css +4 -0
- package/build-style/math/style.css +4 -0
- package/build-style/style-rtl.css +5 -0
- package/build-style/style.css +5 -0
- package/package.json +6 -6
- package/src/accordion-heading/block.json +1 -1
- package/src/archives/index.php +53 -1
- package/src/categories/index.php +25 -7
- package/src/freeform/block.json +5 -1
- package/src/math/deprecated.js +44 -0
- package/src/math/index.js +2 -0
- package/src/math/save.js +6 -5
- package/src/math/style.scss +4 -0
- package/src/missing/block.json +3 -0
- package/src/style.scss +1 -0
- package/src/utils/get-transformed-attributes.js +2 -8
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/accordion-heading",
|
|
5
5
|
"title": "Accordion Heading",
|
|
6
6
|
"category": "design",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Displays a heading that toggles the accordion panel.",
|
|
8
8
|
"parent": [ "core/accordion-item" ],
|
|
9
9
|
"usesContext": [
|
|
10
10
|
"core/accordion-icon-position",
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"supports": {
|
|
16
|
+
"html": false,
|
|
16
17
|
"className": false,
|
|
17
18
|
"customClassName": false,
|
|
18
|
-
"
|
|
19
|
+
"lock": false,
|
|
20
|
+
"reusable": false,
|
|
21
|
+
"renaming": false,
|
|
22
|
+
"blockVisibility": false
|
|
19
23
|
},
|
|
20
24
|
"editorStyle": "wp-block-freeform-editor"
|
|
21
25
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
var deprecated_exports = {};
|
|
20
|
+
__export(deprecated_exports, {
|
|
21
|
+
default: () => deprecated_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(deprecated_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
26
|
+
const v1 = {
|
|
27
|
+
attributes: {
|
|
28
|
+
latex: {
|
|
29
|
+
type: "string",
|
|
30
|
+
role: "content"
|
|
31
|
+
},
|
|
32
|
+
mathML: {
|
|
33
|
+
type: "string",
|
|
34
|
+
source: "html",
|
|
35
|
+
selector: "math"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
save({ attributes }) {
|
|
39
|
+
const { latex, mathML } = attributes;
|
|
40
|
+
if (!latex) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
"math",
|
|
45
|
+
{
|
|
46
|
+
...import_block_editor.useBlockProps.save(),
|
|
47
|
+
display: "block",
|
|
48
|
+
dangerouslySetInnerHTML: { __html: mathML }
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var deprecated_default = [v1];
|
|
54
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/math/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n// v1: Add a wrapper div around the math element.\nconst v1 = {\n\tattributes: {\n\t\tlatex: {\n\t\t\ttype: 'string',\n\t\t\trole: 'content',\n\t\t},\n\t\tmathML: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'math',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { latex, mathML } = attributes;\n\n\t\tif ( ! latex ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<math\n\t\t\t\t{ ...useBlockProps.save() }\n\t\t\t\tdisplay=\"block\"\n\t\t\t\tdangerouslySetInnerHTML={ { __html: mathML } }\n\t\t\t/>\n\t\t);\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v1 ];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BG;AAvBH,0BAA8B;AAG9B,MAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,OAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,KAAM,EAAE,WAAW,GAAI;AACtB,UAAM,EAAE,OAAO,OAAO,IAAI;AAE1B,QAAK,CAAE,OAAQ;AACd,aAAO;AAAA,IACR;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG,kCAAc,KAAK;AAAA,QACxB,SAAQ;AAAA,QACR,yBAA0B,EAAE,QAAQ,OAAO;AAAA;AAAA,IAC5C;AAAA,EAEF;AACD;AAUA,IAAO,qBAAQ,CAAE,EAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/math/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_init_block = __toESM(require("../utils/init-block"));
|
|
|
39
39
|
var import_edit = __toESM(require("./edit"));
|
|
40
40
|
var import_block = __toESM(require("./block.json"));
|
|
41
41
|
var import_save = __toESM(require("./save"));
|
|
42
|
+
var import_deprecated = __toESM(require("./deprecated"));
|
|
42
43
|
const { name } = import_block.default;
|
|
43
44
|
const settings = {
|
|
44
45
|
icon: import_icons.math,
|
|
@@ -50,7 +51,8 @@ const settings = {
|
|
|
50
51
|
viewportWidth: 300
|
|
51
52
|
},
|
|
52
53
|
edit: import_edit.default,
|
|
53
|
-
save: import_save.default
|
|
54
|
+
save: import_save.default,
|
|
55
|
+
deprecated: import_deprecated.default
|
|
54
56
|
};
|
|
55
57
|
const init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
56
58
|
// Annotate the CommonJS export names for ESM import in node:
|
package/build/math/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/math/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { math as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tlatex: 'x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}',\n\t\t\tmathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace=\"0em\" rspace=\"0em\">\u2212</mo><mi>b</mi><mo>\u00B1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding=\"application/x-tex\">x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}</annotation></semantics>',\n\t\t},\n\t\tviewportWidth: 300,\n\t},\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAA6B;AAK7B,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;
|
|
6
|
-
"names": ["metadata", "icon", "edit", "save", "initBlock"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { math as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tlatex: 'x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}',\n\t\t\tmathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace=\"0em\" rspace=\"0em\">\u2212</mo><mi>b</mi><mo>\u00B1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding=\"application/x-tex\">x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}</annotation></semantics>',\n\t\t},\n\t\tviewportWidth: 300,\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAA6B;AAK7B,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,MAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,MAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,OAAO;AAAA,MACP,QAAQ;AAAA,IACT;AAAA,IACA,eAAe;AAAA,EAChB;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,MAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAL,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "icon", "edit", "save", "deprecated", "initBlock"]
|
|
7
7
|
}
|
package/build/math/save.js
CHANGED
|
@@ -28,13 +28,12 @@ function save({ attributes }) {
|
|
|
28
28
|
if (!latex) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...import_block_editor.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
32
32
|
"math",
|
|
33
33
|
{
|
|
34
|
-
...import_block_editor.useBlockProps.save(),
|
|
35
34
|
display: "block",
|
|
36
35
|
dangerouslySetInnerHTML: { __html: mathML }
|
|
37
36
|
}
|
|
38
|
-
);
|
|
37
|
+
) });
|
|
39
38
|
}
|
|
40
39
|
//# sourceMappingURL=save.js.map
|
package/build/math/save.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/math/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { latex, mathML } = attributes;\n\n\tif ( ! latex ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { latex, mathML } = attributes;\n\n\tif ( ! latex ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps.save() }>\n\t\t\t<math\n\t\t\t\tdisplay=\"block\"\n\t\t\t\tdangerouslySetInnerHTML={ { __html: mathML } }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcG;AAXH,0BAA8B;AAEf,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM,EAAE,OAAO,OAAO,IAAI;AAE1B,MAAK,CAAE,OAAQ;AACd,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,SAAM,GAAG,kCAAc,KAAK,GAC5B;AAAA,IAAC;AAAA;AAAA,MACA,SAAQ;AAAA,MACR,yBAA0B,EAAE,QAAQ,OAAO;AAAA;AAAA,EAC5C,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/missing/block.json
CHANGED
|
@@ -31,9 +31,6 @@ function getTransformedAttributes(attributes, newBlockName, bindingsCallback = n
|
|
|
31
31
|
return void 0;
|
|
32
32
|
}
|
|
33
33
|
const transformedAttributes = {};
|
|
34
|
-
if ((0, import_blocks.hasBlockSupport)(newBlockType, "allowedBlocks") && attributes.allowedBlocks) {
|
|
35
|
-
transformedAttributes.allowedBlocks = attributes.allowedBlocks;
|
|
36
|
-
}
|
|
37
34
|
if ((0, import_blocks.hasBlockSupport)(newBlockType, "anchor") && attributes.anchor) {
|
|
38
35
|
transformedAttributes.anchor = attributes.anchor;
|
|
39
36
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/get-transformed-attributes.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support. The custom class name\n\t// attribute is handled
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA8C;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,mBAAe,4BAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;AAI/B,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support. The custom class name and\n\t// allowed blocks attribute is handled separately.\n\tif ( hasBlockSupport( newBlockType, 'anchor' ) && attributes.anchor ) {\n\t\ttransformedAttributes.anchor = attributes.anchor;\n\t}\n\tif (\n\t\thasBlockSupport( newBlockType, 'ariaLabel' ) &&\n\t\tattributes.ariaLabel\n\t) {\n\t\ttransformedAttributes.ariaLabel = attributes.ariaLabel;\n\t}\n\n\t// Handle metadata transformation.\n\tif ( attributes.metadata ) {\n\t\t// The metadata properties that should be preserved after the transform.\n\t\t// The noteId, name, and blockVisibility properties are separately handled\n\t\t// in the `core/metadata/addTransforms` hook.\n\t\tconst transformedMetadata = [];\n\n\t\t// If there is a transform bindings callback, add the `id` and `bindings` properties.\n\t\tif ( bindingsCallback ) {\n\t\t\ttransformedMetadata.push( 'id', 'bindings' );\n\t\t}\n\n\t\t// Only process metadata if there are supported properties.\n\t\tif ( transformedMetadata.length > 0 ) {\n\t\t\tconst newMetadata = Object.entries( attributes.metadata ).reduce(\n\t\t\t\t( obj, [ prop, value ] ) => {\n\t\t\t\t\t// If prop is not supported, don't add it to the new metadata object.\n\t\t\t\t\tif ( ! transformedMetadata.includes( prop ) ) {\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t\tobj[ prop ] =\n\t\t\t\t\t\tprop === 'bindings' ? bindingsCallback( value ) : value;\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\t// Only add metadata if object is not empty.\n\t\t\tif ( Object.keys( newMetadata ).length > 0 ) {\n\t\t\t\ttransformedAttributes.metadata = newMetadata;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( Object.keys( transformedAttributes ).length === 0 ) {\n\t\treturn undefined;\n\t}\n\n\treturn transformedAttributes;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA8C;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,mBAAe,4BAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;AAI/B,UAAK,+BAAiB,cAAc,QAAS,KAAK,WAAW,QAAS;AACrE,0BAAsB,SAAS,WAAW;AAAA,EAC3C;AACA,UACC,+BAAiB,cAAc,WAAY,KAC3C,WAAW,WACV;AACD,0BAAsB,YAAY,WAAW;AAAA,EAC9C;AAGA,MAAK,WAAW,UAAW;AAI1B,UAAM,sBAAsB,CAAC;AAG7B,QAAK,kBAAmB;AACvB,0BAAoB,KAAM,MAAM,UAAW;AAAA,IAC5C;AAGA,QAAK,oBAAoB,SAAS,GAAI;AACrC,YAAM,cAAc,OAAO,QAAS,WAAW,QAAS,EAAE;AAAA,QACzD,CAAE,KAAK,CAAE,MAAM,KAAM,MAAO;AAE3B,cAAK,CAAE,oBAAoB,SAAU,IAAK,GAAI;AAC7C,mBAAO;AAAA,UACR;AACA,cAAK,IAAK,IACT,SAAS,aAAa,iBAAkB,KAAM,IAAI;AACnD,iBAAO;AAAA,QACR;AAAA,QACA,CAAC;AAAA,MACF;AAGA,UAAK,OAAO,KAAM,WAAY,EAAE,SAAS,GAAI;AAC5C,8BAAsB,WAAW;AAAA,MAClC;AAAA,IACD;AAAA,EACD;AAEA,MAAK,OAAO,KAAM,qBAAsB,EAAE,WAAW,GAAI;AACxD,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/accordion-heading",
|
|
5
5
|
"title": "Accordion Heading",
|
|
6
6
|
"category": "design",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Displays a heading that toggles the accordion panel.",
|
|
8
8
|
"parent": [ "core/accordion-item" ],
|
|
9
9
|
"usesContext": [
|
|
10
10
|
"core/accordion-icon-position",
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"supports": {
|
|
16
|
+
"html": false,
|
|
16
17
|
"className": false,
|
|
17
18
|
"customClassName": false,
|
|
18
|
-
"
|
|
19
|
+
"lock": false,
|
|
20
|
+
"reusable": false,
|
|
21
|
+
"renaming": false,
|
|
22
|
+
"blockVisibility": false
|
|
19
23
|
},
|
|
20
24
|
"editorStyle": "wp-block-freeform-editor"
|
|
21
25
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useBlockProps } from "@wordpress/block-editor";
|
|
3
|
+
const v1 = {
|
|
4
|
+
attributes: {
|
|
5
|
+
latex: {
|
|
6
|
+
type: "string",
|
|
7
|
+
role: "content"
|
|
8
|
+
},
|
|
9
|
+
mathML: {
|
|
10
|
+
type: "string",
|
|
11
|
+
source: "html",
|
|
12
|
+
selector: "math"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
save({ attributes }) {
|
|
16
|
+
const { latex, mathML } = attributes;
|
|
17
|
+
if (!latex) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"math",
|
|
22
|
+
{
|
|
23
|
+
...useBlockProps.save(),
|
|
24
|
+
display: "block",
|
|
25
|
+
dangerouslySetInnerHTML: { __html: mathML }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var deprecated_default = [v1];
|
|
31
|
+
export {
|
|
32
|
+
deprecated_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/math/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n// v1: Add a wrapper div around the math element.\nconst v1 = {\n\tattributes: {\n\t\tlatex: {\n\t\t\ttype: 'string',\n\t\t\trole: 'content',\n\t\t},\n\t\tmathML: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'math',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { latex, mathML } = attributes;\n\n\t\tif ( ! latex ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<math\n\t\t\t\t{ ...useBlockProps.save() }\n\t\t\t\tdisplay=\"block\"\n\t\t\t\tdangerouslySetInnerHTML={ { __html: mathML } }\n\t\t\t/>\n\t\t);\n\t},\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v1 ];\n"],
|
|
5
|
+
"mappings": "AA0BG;AAvBH,SAAS,qBAAqB;AAG9B,MAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,OAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,KAAM,EAAE,WAAW,GAAI;AACtB,UAAM,EAAE,OAAO,OAAO,IAAI;AAE1B,QAAK,CAAE,OAAQ;AACd,aAAO;AAAA,IACR;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG,cAAc,KAAK;AAAA,QACxB,SAAQ;AAAA,QACR,yBAA0B,EAAE,QAAQ,OAAO;AAAA;AAAA,IAC5C;AAAA,EAEF;AACD;AAUA,IAAO,qBAAQ,CAAE,EAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,6 +3,7 @@ import initBlock from "../utils/init-block";
|
|
|
3
3
|
import edit from "./edit";
|
|
4
4
|
import metadata from "./block.json";
|
|
5
5
|
import save from "./save";
|
|
6
|
+
import deprecated from "./deprecated";
|
|
6
7
|
const { name } = metadata;
|
|
7
8
|
const settings = {
|
|
8
9
|
icon,
|
|
@@ -14,7 +15,8 @@ const settings = {
|
|
|
14
15
|
viewportWidth: 300
|
|
15
16
|
},
|
|
16
17
|
edit,
|
|
17
|
-
save
|
|
18
|
+
save,
|
|
19
|
+
deprecated
|
|
18
20
|
};
|
|
19
21
|
const init = () => initBlock({ name, metadata, settings });
|
|
20
22
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/math/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { math as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tlatex: 'x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}',\n\t\t\tmathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace=\"0em\" rspace=\"0em\">\u2212</mo><mi>b</mi><mo>\u00B1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding=\"application/x-tex\">x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}</annotation></semantics>',\n\t\t},\n\t\tviewportWidth: 300,\n\t},\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { math as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tlatex: 'x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}',\n\t\t\tmathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace=\"0em\" rspace=\"0em\">\u2212</mo><mi>b</mi><mo>\u00B1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding=\"application/x-tex\">x = \\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}</annotation></semantics>',\n\t\t},\n\t\tviewportWidth: 300,\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AAEvB,MAAM,EAAE,KAAK,IAAI;AAIV,MAAM,WAAW;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,OAAO;AAAA,MACP,QAAQ;AAAA,IACT;AAAA,IACA,eAAe;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,MAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,14 +5,13 @@ function save({ attributes }) {
|
|
|
5
5
|
if (!latex) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { ...useBlockProps.save(), children: /* @__PURE__ */ jsx(
|
|
9
9
|
"math",
|
|
10
10
|
{
|
|
11
|
-
...useBlockProps.save(),
|
|
12
11
|
display: "block",
|
|
13
12
|
dangerouslySetInnerHTML: { __html: mathML }
|
|
14
13
|
}
|
|
15
|
-
);
|
|
14
|
+
) });
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
17
|
save as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/math/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { latex, mathML } = attributes;\n\n\tif ( ! latex ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { latex, mathML } = attributes;\n\n\tif ( ! latex ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps.save() }>\n\t\t\t<math\n\t\t\t\tdisplay=\"block\"\n\t\t\t\tdangerouslySetInnerHTML={ { __html: mathML } }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAcG;AAXH,SAAS,qBAAqB;AAEf,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM,EAAE,OAAO,OAAO,IAAI;AAE1B,MAAK,CAAE,OAAQ;AACd,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAM,GAAG,cAAc,KAAK,GAC5B;AAAA,IAAC;AAAA;AAAA,MACA,SAAQ;AAAA,MACR,yBAA0B,EAAE,QAAQ,OAAO;AAAA;AAAA,EAC5C,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,9 +8,6 @@ function getTransformedAttributes(attributes, newBlockName, bindingsCallback = n
|
|
|
8
8
|
return void 0;
|
|
9
9
|
}
|
|
10
10
|
const transformedAttributes = {};
|
|
11
|
-
if (hasBlockSupport(newBlockType, "allowedBlocks") && attributes.allowedBlocks) {
|
|
12
|
-
transformedAttributes.allowedBlocks = attributes.allowedBlocks;
|
|
13
|
-
}
|
|
14
11
|
if (hasBlockSupport(newBlockType, "anchor") && attributes.anchor) {
|
|
15
12
|
transformedAttributes.anchor = attributes.anchor;
|
|
16
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/get-transformed-attributes.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support. The custom class name\n\t// attribute is handled
|
|
5
|
-
"mappings": "AAGA,SAAS,cAAc,uBAAuB;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,eAAe,aAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;AAI/B,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Transform block support attributes and metadata during block transforms.\n *\n * @param {Object} attributes Original attributes from the block being transformed.\n * @param {string} newBlockName Name of the target block after transformation.\n * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object.\n * @return {Object} New attributes object with preserved block support attributes and metadata.\n */\nexport function getTransformedAttributes(\n\tattributes,\n\tnewBlockName,\n\tbindingsCallback = null\n) {\n\tif ( ! attributes ) {\n\t\treturn undefined;\n\t}\n\n\tconst newBlockType = getBlockType( newBlockName );\n\tif ( ! newBlockType ) {\n\t\treturn undefined;\n\t}\n\n\tconst transformedAttributes = {};\n\n\t// Handle attributes derived from block support. The custom class name and\n\t// allowed blocks attribute is handled separately.\n\tif ( hasBlockSupport( newBlockType, 'anchor' ) && attributes.anchor ) {\n\t\ttransformedAttributes.anchor = attributes.anchor;\n\t}\n\tif (\n\t\thasBlockSupport( newBlockType, 'ariaLabel' ) &&\n\t\tattributes.ariaLabel\n\t) {\n\t\ttransformedAttributes.ariaLabel = attributes.ariaLabel;\n\t}\n\n\t// Handle metadata transformation.\n\tif ( attributes.metadata ) {\n\t\t// The metadata properties that should be preserved after the transform.\n\t\t// The noteId, name, and blockVisibility properties are separately handled\n\t\t// in the `core/metadata/addTransforms` hook.\n\t\tconst transformedMetadata = [];\n\n\t\t// If there is a transform bindings callback, add the `id` and `bindings` properties.\n\t\tif ( bindingsCallback ) {\n\t\t\ttransformedMetadata.push( 'id', 'bindings' );\n\t\t}\n\n\t\t// Only process metadata if there are supported properties.\n\t\tif ( transformedMetadata.length > 0 ) {\n\t\t\tconst newMetadata = Object.entries( attributes.metadata ).reduce(\n\t\t\t\t( obj, [ prop, value ] ) => {\n\t\t\t\t\t// If prop is not supported, don't add it to the new metadata object.\n\t\t\t\t\tif ( ! transformedMetadata.includes( prop ) ) {\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t\tobj[ prop ] =\n\t\t\t\t\t\tprop === 'bindings' ? bindingsCallback( value ) : value;\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\t// Only add metadata if object is not empty.\n\t\t\tif ( Object.keys( newMetadata ).length > 0 ) {\n\t\t\t\ttransformedAttributes.metadata = newMetadata;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( Object.keys( transformedAttributes ).length === 0 ) {\n\t\treturn undefined;\n\t}\n\n\treturn transformedAttributes;\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,cAAc,uBAAuB;AAUvC,SAAS,yBACf,YACA,cACA,mBAAmB,MAClB;AACD,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,QAAM,eAAe,aAAc,YAAa;AAChD,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,QAAM,wBAAwB,CAAC;AAI/B,MAAK,gBAAiB,cAAc,QAAS,KAAK,WAAW,QAAS;AACrE,0BAAsB,SAAS,WAAW;AAAA,EAC3C;AACA,MACC,gBAAiB,cAAc,WAAY,KAC3C,WAAW,WACV;AACD,0BAAsB,YAAY,WAAW;AAAA,EAC9C;AAGA,MAAK,WAAW,UAAW;AAI1B,UAAM,sBAAsB,CAAC;AAG7B,QAAK,kBAAmB;AACvB,0BAAoB,KAAM,MAAM,UAAW;AAAA,IAC5C;AAGA,QAAK,oBAAoB,SAAS,GAAI;AACrC,YAAM,cAAc,OAAO,QAAS,WAAW,QAAS,EAAE;AAAA,QACzD,CAAE,KAAK,CAAE,MAAM,KAAM,MAAO;AAE3B,cAAK,CAAE,oBAAoB,SAAU,IAAK,GAAI;AAC7C,mBAAO;AAAA,UACR;AACA,cAAK,IAAK,IACT,SAAS,aAAa,iBAAkB,KAAM,IAAI;AACnD,iBAAO;AAAA,QACR;AAAA,QACA,CAAC;AAAA,MACF;AAGA,UAAK,OAAO,KAAM,WAAY,EAAE,SAAS,GAAI;AAC5C,8BAAsB,WAAW;AAAA,MAClC;AAAA,IACD;AAAA,EACD;AAEA,MAAK,OAAO,KAAM,qBAAsB,EAAE,WAAW,GAAI;AACxD,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.33.
|
|
3
|
+
"version": "9.33.3",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
"@wordpress/autop": "^4.33.1",
|
|
87
87
|
"@wordpress/base-styles": "^6.9.1",
|
|
88
88
|
"@wordpress/blob": "^4.33.1",
|
|
89
|
-
"@wordpress/block-editor": "^15.6.
|
|
89
|
+
"@wordpress/block-editor": "^15.6.2",
|
|
90
90
|
"@wordpress/blocks": "^15.6.1",
|
|
91
91
|
"@wordpress/components": "^30.6.1",
|
|
92
92
|
"@wordpress/compose": "^7.33.1",
|
|
93
|
-
"@wordpress/core-data": "^7.33.
|
|
93
|
+
"@wordpress/core-data": "^7.33.2",
|
|
94
94
|
"@wordpress/data": "^10.33.1",
|
|
95
95
|
"@wordpress/date": "^5.33.1",
|
|
96
96
|
"@wordpress/deprecated": "^4.33.1",
|
|
@@ -107,10 +107,10 @@
|
|
|
107
107
|
"@wordpress/keycodes": "^4.33.1",
|
|
108
108
|
"@wordpress/latex-to-mathml": "^1.1.1",
|
|
109
109
|
"@wordpress/notices": "^5.33.1",
|
|
110
|
-
"@wordpress/patterns": "^2.33.
|
|
110
|
+
"@wordpress/patterns": "^2.33.2",
|
|
111
111
|
"@wordpress/primitives": "^4.33.1",
|
|
112
112
|
"@wordpress/private-apis": "^1.33.1",
|
|
113
|
-
"@wordpress/reusable-blocks": "^5.33.
|
|
113
|
+
"@wordpress/reusable-blocks": "^5.33.2",
|
|
114
114
|
"@wordpress/rich-text": "^7.33.1",
|
|
115
115
|
"@wordpress/server-side-render": "^6.9.1",
|
|
116
116
|
"@wordpress/url": "^4.33.1",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"publishConfig": {
|
|
134
134
|
"access": "public"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "45005cc254bab59182927e35a68cd22f6320634d"
|
|
137
137
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/accordion-heading",
|
|
5
5
|
"title": "Accordion Heading",
|
|
6
6
|
"category": "design",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Displays a heading that toggles the accordion panel.",
|
|
8
8
|
"parent": [ "core/accordion-item" ],
|
|
9
9
|
"usesContext": [
|
|
10
10
|
"core/accordion-icon-position",
|
package/src/archives/index.php
CHANGED
|
@@ -66,9 +66,12 @@ function render_block_core_archives( $attributes ) {
|
|
|
66
66
|
$show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : '';
|
|
67
67
|
|
|
68
68
|
$block_content = '<label for="' . $dropdown_id . '" class="wp-block-archives__label' . $show_label . '">' . esc_html( $title ) . '</label>
|
|
69
|
-
<select id="' . $dropdown_id . '" name="archive-dropdown"
|
|
69
|
+
<select id="' . esc_attr( $dropdown_id ) . '" name="archive-dropdown">
|
|
70
70
|
<option value="">' . esc_html( $label ) . '</option>' . $archives . '</select>';
|
|
71
71
|
|
|
72
|
+
// Inject the dropdown script immediately after the select dropdown.
|
|
73
|
+
$block_content .= block_core_archives_build_dropdown_script( $dropdown_id );
|
|
74
|
+
|
|
72
75
|
return sprintf(
|
|
73
76
|
'<div %1$s>%2$s</div>',
|
|
74
77
|
$wrapper_attributes,
|
|
@@ -106,6 +109,55 @@ function render_block_core_archives( $attributes ) {
|
|
|
106
109
|
);
|
|
107
110
|
}
|
|
108
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Generates the inline script for an archives dropdown field.
|
|
114
|
+
*
|
|
115
|
+
* @since 6.9.0
|
|
116
|
+
*
|
|
117
|
+
* @param string $dropdown_id ID of the dropdown field.
|
|
118
|
+
*
|
|
119
|
+
* @return string Returns the dropdown onChange redirection script.
|
|
120
|
+
*/
|
|
121
|
+
function block_core_archives_build_dropdown_script( $dropdown_id ) {
|
|
122
|
+
ob_start();
|
|
123
|
+
|
|
124
|
+
$exports = array( $dropdown_id, home_url() );
|
|
125
|
+
?>
|
|
126
|
+
<script>
|
|
127
|
+
( ( [ dropdownId, homeUrl ] ) => {
|
|
128
|
+
const dropdown = document.getElementById( dropdownId );
|
|
129
|
+
function onSelectChange() {
|
|
130
|
+
setTimeout( () => {
|
|
131
|
+
if ( 'escape' === dropdown.dataset.lastkey ) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if ( dropdown.value ) {
|
|
135
|
+
location.href = dropdown.value;
|
|
136
|
+
}
|
|
137
|
+
}, 250 );
|
|
138
|
+
}
|
|
139
|
+
function onKeyUp( event ) {
|
|
140
|
+
if ( 'Escape' === event.key ) {
|
|
141
|
+
dropdown.dataset.lastkey = 'escape';
|
|
142
|
+
} else {
|
|
143
|
+
delete dropdown.dataset.lastkey;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function onClick() {
|
|
147
|
+
delete dropdown.dataset.lastkey;
|
|
148
|
+
}
|
|
149
|
+
dropdown.addEventListener( 'keyup', onKeyUp );
|
|
150
|
+
dropdown.addEventListener( 'click', onClick );
|
|
151
|
+
dropdown.addEventListener( 'change', onSelectChange );
|
|
152
|
+
} )( <?php echo wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
|
|
153
|
+
</script>
|
|
154
|
+
<?php
|
|
155
|
+
return wp_get_inline_script_tag(
|
|
156
|
+
trim( str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) ) .
|
|
157
|
+
"\n//# sourceURL=" . rawurlencode( __FUNCTION__ )
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
109
161
|
/**
|
|
110
162
|
* Register archives block.
|
|
111
163
|
*
|
package/src/categories/index.php
CHANGED
|
@@ -104,14 +104,32 @@ function build_dropdown_script_block_core_categories( $dropdown_id ) {
|
|
|
104
104
|
?>
|
|
105
105
|
<script>
|
|
106
106
|
( ( [ dropdownId, homeUrl ] ) => {
|
|
107
|
-
document.getElementById( dropdownId )
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
const dropdown = document.getElementById( dropdownId );
|
|
108
|
+
function onSelectChange() {
|
|
109
|
+
setTimeout( () => {
|
|
110
|
+
if ( 'escape' === dropdown.dataset.lastkey ) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if ( dropdown.value && dropdown instanceof HTMLSelectElement ) {
|
|
114
|
+
const url = new URL( homeUrl );
|
|
115
|
+
url.searchParams.set( dropdown.name, dropdown.value );
|
|
116
|
+
location.href = url.href;
|
|
117
|
+
}
|
|
118
|
+
}, 250 );
|
|
119
|
+
}
|
|
120
|
+
function onKeyUp( event ) {
|
|
121
|
+
if ( 'Escape' === event.key ) {
|
|
122
|
+
dropdown.dataset.lastkey = 'escape';
|
|
123
|
+
} else {
|
|
124
|
+
delete dropdown.dataset.lastkey;
|
|
113
125
|
}
|
|
114
|
-
}
|
|
126
|
+
}
|
|
127
|
+
function onClick() {
|
|
128
|
+
delete dropdown.dataset.lastkey;
|
|
129
|
+
}
|
|
130
|
+
dropdown.addEventListener( 'keyup', onKeyUp );
|
|
131
|
+
dropdown.addEventListener( 'click', onClick );
|
|
132
|
+
dropdown.addEventListener( 'change', onSelectChange );
|
|
115
133
|
} )( <?php echo wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
|
|
116
134
|
</script>
|
|
117
135
|
<?php
|
package/src/freeform/block.json
CHANGED
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"supports": {
|
|
16
|
+
"html": false,
|
|
16
17
|
"className": false,
|
|
17
18
|
"customClassName": false,
|
|
18
|
-
"
|
|
19
|
+
"lock": false,
|
|
20
|
+
"reusable": false,
|
|
21
|
+
"renaming": false,
|
|
22
|
+
"blockVisibility": false
|
|
19
23
|
},
|
|
20
24
|
"editorStyle": "wp-block-freeform-editor"
|
|
21
25
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useBlockProps } from '@wordpress/block-editor';
|
|
5
|
+
|
|
6
|
+
// v1: Add a wrapper div around the math element.
|
|
7
|
+
const v1 = {
|
|
8
|
+
attributes: {
|
|
9
|
+
latex: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
role: 'content',
|
|
12
|
+
},
|
|
13
|
+
mathML: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
source: 'html',
|
|
16
|
+
selector: 'math',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
save( { attributes } ) {
|
|
20
|
+
const { latex, mathML } = attributes;
|
|
21
|
+
|
|
22
|
+
if ( ! latex ) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<math
|
|
28
|
+
{ ...useBlockProps.save() }
|
|
29
|
+
display="block"
|
|
30
|
+
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* New deprecations need to be placed first
|
|
38
|
+
* for them to have higher priority.
|
|
39
|
+
*
|
|
40
|
+
* Old deprecations may need to be updated as well.
|
|
41
|
+
*
|
|
42
|
+
* See block-deprecation.md
|
|
43
|
+
*/
|
|
44
|
+
export default [ v1 ];
|
package/src/math/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import initBlock from '../utils/init-block';
|
|
|
10
10
|
import edit from './edit';
|
|
11
11
|
import metadata from './block.json';
|
|
12
12
|
import save from './save';
|
|
13
|
+
import deprecated from './deprecated';
|
|
13
14
|
|
|
14
15
|
const { name } = metadata;
|
|
15
16
|
|
|
@@ -26,6 +27,7 @@ export const settings = {
|
|
|
26
27
|
},
|
|
27
28
|
edit,
|
|
28
29
|
save,
|
|
30
|
+
deprecated,
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/math/save.js
CHANGED
|
@@ -11,10 +11,11 @@ export default function save( { attributes } ) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
<div { ...useBlockProps.save() }>
|
|
15
|
+
<math
|
|
16
|
+
display="block"
|
|
17
|
+
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
19
20
|
);
|
|
20
21
|
}
|
package/src/missing/block.json
CHANGED
package/src/style.scss
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
@use "./latest-posts/style.scss" as *;
|
|
33
33
|
@use "./list/style.scss" as *;
|
|
34
34
|
@use "./loginout/style.scss" as *;
|
|
35
|
+
@use "./math/style.scss" as *;
|
|
35
36
|
@use "./media-text/style.scss" as *;
|
|
36
37
|
@use "./navigation/style.scss" as *;
|
|
37
38
|
@use "./navigation-link/style.scss" as *;
|
|
@@ -27,14 +27,8 @@ export function getTransformedAttributes(
|
|
|
27
27
|
|
|
28
28
|
const transformedAttributes = {};
|
|
29
29
|
|
|
30
|
-
// Handle attributes derived from block support. The custom class name
|
|
31
|
-
// attribute is handled
|
|
32
|
-
if (
|
|
33
|
-
hasBlockSupport( newBlockType, 'allowedBlocks' ) &&
|
|
34
|
-
attributes.allowedBlocks
|
|
35
|
-
) {
|
|
36
|
-
transformedAttributes.allowedBlocks = attributes.allowedBlocks;
|
|
37
|
-
}
|
|
30
|
+
// Handle attributes derived from block support. The custom class name and
|
|
31
|
+
// allowed blocks attribute is handled separately.
|
|
38
32
|
if ( hasBlockSupport( newBlockType, 'anchor' ) && attributes.anchor ) {
|
|
39
33
|
transformedAttributes.anchor = attributes.anchor;
|
|
40
34
|
}
|