@wordpress/block-library 9.30.1-next.6870dfe5b.0 → 9.30.1-next.6f42e1382.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/buttons/index.js +2 -1
- package/build/buttons/index.js.map +1 -1
- package/build/categories/edit.js +3 -1
- package/build/categories/edit.js.map +1 -1
- package/build/index.js +4 -0
- package/build/index.js.map +1 -1
- package/build/social-links/index.js +2 -1
- package/build/social-links/index.js.map +1 -1
- package/build/table-of-contents/edit.js +33 -9
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +4 -0
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +6 -3
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +6 -3
- package/build/table-of-contents/save.js.map +1 -1
- package/build/term-template/edit.js +318 -0
- package/build/term-template/edit.js.map +1 -0
- package/build/term-template/index.js +109 -0
- package/build/term-template/index.js.map +1 -0
- package/build/term-template/save.js +16 -0
- package/build/term-template/save.js.map +1 -0
- package/build/term-template/variations.js +83 -0
- package/build/term-template/variations.js.map +1 -0
- package/build/terms-query/edit.js +20 -0
- package/build/terms-query/edit.js.map +1 -0
- package/build/terms-query/index.js +83 -0
- package/build/terms-query/index.js.map +1 -0
- package/build/terms-query/inspector-controls.js +246 -0
- package/build/terms-query/inspector-controls.js.map +1 -0
- package/build/terms-query/save.js +24 -0
- package/build/terms-query/save.js.map +1 -0
- package/build/terms-query/terms-query-content.js +71 -0
- package/build/terms-query/terms-query-content.js.map +1 -0
- package/build-module/buttons/index.js +2 -1
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/categories/edit.js +3 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/index.js +4 -0
- package/build-module/index.js.map +1 -1
- package/build-module/social-links/index.js +2 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table-of-contents/edit.js +35 -11
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +4 -0
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +6 -3
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +6 -3
- package/build-module/table-of-contents/save.js.map +1 -1
- package/build-module/term-template/edit.js +310 -0
- package/build-module/term-template/edit.js.map +1 -0
- package/build-module/term-template/index.js +102 -0
- package/build-module/term-template/index.js.map +1 -0
- package/build-module/term-template/save.js +9 -0
- package/build-module/term-template/save.js.map +1 -0
- package/build-module/term-template/variations.js +76 -0
- package/build-module/term-template/variations.js.map +1 -0
- package/build-module/terms-query/edit.js +12 -0
- package/build-module/terms-query/edit.js.map +1 -0
- package/build-module/terms-query/index.js +76 -0
- package/build-module/terms-query/index.js.map +1 -0
- package/build-module/terms-query/inspector-controls.js +239 -0
- package/build-module/terms-query/inspector-controls.js.map +1 -0
- package/build-module/terms-query/save.js +17 -0
- package/build-module/terms-query/save.js.map +1 -0
- package/build-module/terms-query/terms-query-content.js +63 -0
- package/build-module/terms-query/terms-query-content.js.map +1 -0
- package/build-style/editor-rtl.css +24 -0
- package/build-style/editor.css +24 -0
- package/build-style/style-rtl.css +16 -0
- package/build-style/style.css +16 -0
- package/build-style/term-template/editor-rtl.css +160 -0
- package/build-style/term-template/editor.css +160 -0
- package/build-style/term-template/style-rtl.css +146 -0
- package/build-style/term-template/style.css +146 -0
- package/build-style/terms-query/style-rtl.css +140 -0
- package/build-style/terms-query/style.css +140 -0
- package/build-types/table-of-contents/list.d.ts +2 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +35 -35
- package/src/buttons/block.json +2 -1
- package/src/categories/edit.js +2 -1
- package/src/editor.scss +1 -0
- package/src/index.js +4 -0
- package/src/post-date/index.php +18 -13
- package/src/social-links/block.json +2 -1
- package/src/style.scss +2 -0
- package/src/table-of-contents/block.json +4 -0
- package/src/table-of-contents/edit.js +58 -21
- package/src/table-of-contents/list.tsx +7 -2
- package/src/table-of-contents/save.js +7 -3
- package/src/term-template/block.json +73 -0
- package/src/term-template/edit.js +391 -0
- package/src/term-template/editor.scss +26 -0
- package/src/term-template/index.js +26 -0
- package/src/term-template/index.php +224 -0
- package/src/term-template/save.js +8 -0
- package/src/term-template/style.scss +12 -0
- package/src/term-template/variations.js +87 -0
- package/src/terms-query/block.json +49 -0
- package/src/terms-query/edit.js +10 -0
- package/src/terms-query/index.js +24 -0
- package/src/terms-query/index.php +44 -0
- package/src/terms-query/inspector-controls.js +233 -0
- package/src/terms-query/save.js +10 -0
- package/src/terms-query/style.scss +6 -0
- package/src/terms-query/terms-query-content.js +74 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _termsQueryContent = _interopRequireDefault(require("./terms-query-content"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const TermsQueryEdit = props => {
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_termsQueryContent.default, {
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var _default = exports.default = TermsQueryEdit;
|
|
20
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_termsQueryContent","_interopRequireDefault","require","_jsxRuntime","TermsQueryEdit","props","jsx","default","_default","exports"],"sources":["@wordpress/block-library/src/terms-query/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport TermsQueryContent from './terms-query-content';\n\nconst TermsQueryEdit = ( props ) => {\n\treturn <TermsQueryContent { ...props } />;\n};\n\nexport default TermsQueryEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAsD,IAAAC,WAAA,GAAAD,OAAA;AAHtD;AACA;AACA;;AAGA,MAAME,cAAc,GAAKC,KAAK,IAAM;EACnC,oBAAO,IAAAF,WAAA,CAAAG,GAAA,EAACN,kBAAA,CAAAO,OAAiB;IAAA,GAAMF;EAAK,CAAI,CAAC;AAC1C,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEaH,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.settings = exports.name = exports.metadata = exports.init = void 0;
|
|
8
|
+
var _icons = require("@wordpress/icons");
|
|
9
|
+
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
10
|
+
var _edit = _interopRequireDefault(require("./edit"));
|
|
11
|
+
var _save = _interopRequireDefault(require("./save"));
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
const metadata = exports.metadata = {
|
|
19
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
20
|
+
apiVersion: 3,
|
|
21
|
+
__experimental: true,
|
|
22
|
+
name: "core/terms-query",
|
|
23
|
+
title: "Terms Query",
|
|
24
|
+
category: "theme",
|
|
25
|
+
description: "An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.",
|
|
26
|
+
keywords: ["terms", "taxonomy", "categories", "tags", "list"],
|
|
27
|
+
textdomain: "default",
|
|
28
|
+
attributes: {
|
|
29
|
+
termQueryId: {
|
|
30
|
+
type: "number"
|
|
31
|
+
},
|
|
32
|
+
termQuery: {
|
|
33
|
+
type: "object",
|
|
34
|
+
"default": {
|
|
35
|
+
perPage: 10,
|
|
36
|
+
pages: 0,
|
|
37
|
+
taxonomy: "category",
|
|
38
|
+
order: "asc",
|
|
39
|
+
orderBy: "name",
|
|
40
|
+
hideEmpty: true,
|
|
41
|
+
include: [],
|
|
42
|
+
exclude: [],
|
|
43
|
+
parent: 0,
|
|
44
|
+
hierarchical: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
tagName: {
|
|
48
|
+
type: "string",
|
|
49
|
+
"default": "div"
|
|
50
|
+
},
|
|
51
|
+
namespace: {
|
|
52
|
+
type: "string"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
providesContext: {
|
|
56
|
+
termQueryId: "termQueryId",
|
|
57
|
+
termQuery: "termQuery"
|
|
58
|
+
},
|
|
59
|
+
supports: {
|
|
60
|
+
align: ["wide", "full"],
|
|
61
|
+
html: false,
|
|
62
|
+
interactivity: true
|
|
63
|
+
},
|
|
64
|
+
allowedBlocks: ["core/term-template"],
|
|
65
|
+
style: "wp-block-terms-query"
|
|
66
|
+
};
|
|
67
|
+
const {
|
|
68
|
+
name
|
|
69
|
+
} = metadata;
|
|
70
|
+
exports.name = name;
|
|
71
|
+
const settings = exports.settings = {
|
|
72
|
+
icon: _icons.loop,
|
|
73
|
+
edit: _edit.default,
|
|
74
|
+
save: _save.default,
|
|
75
|
+
example: {}
|
|
76
|
+
};
|
|
77
|
+
const init = () => (0, _initBlock.default)({
|
|
78
|
+
name,
|
|
79
|
+
metadata,
|
|
80
|
+
settings
|
|
81
|
+
});
|
|
82
|
+
exports.init = init;
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_save","metadata","exports","$schema","apiVersion","__experimental","name","title","category","description","keywords","textdomain","attributes","termQueryId","type","termQuery","perPage","pages","taxonomy","order","orderBy","hideEmpty","include","exclude","parent","hierarchical","tagName","namespace","providesContext","supports","align","html","interactivity","allowedBlocks","style","settings","icon","edit","save","example","init","initBlock"],"sources":["@wordpress/block-library/src/terms-query/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\texample: {},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;IAAA;IAAAC,SAAA;MAAAD,IAAA;MAAA;QAAAE,OAAA;QAAAC,KAAA;QAAAC,QAAA;QAAAC,KAAA;QAAAC,OAAA;QAAAC,SAAA;QAAAC,OAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,YAAA;MAAA;IAAA;IAAAC,OAAA;MAAAZ,IAAA;MAAA;IAAA;IAAAa,SAAA;MAAAb,IAAA;IAAA;EAAA;EAAAc,eAAA;IAAAf,WAAA;IAAAE,SAAA;EAAA;EAAAc,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,aAAA;EAAA;EAAAC,aAAA;EAAAC,KAAA;AAAA;AAQA,MAAM;EAAE5B;AAAK,CAAC,GAAGL,QAAQ;AAACC,OAAA,CAAAI,IAAA,GAAAA,IAAA;AAGnB,MAAM6B,QAAQ,GAAAjC,OAAA,CAAAiC,QAAA,GAAG;EACvBC,IAAI,EAAJA,WAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,OAAO,EAAE,CAAC;AACX,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEnC,IAAI;EAAEL,QAAQ;EAAEkC;AAAS,CAAE,CAAC;AAACjC,OAAA,CAAAsC,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = TermsQueryInspectorControls;
|
|
7
|
+
var _i18n = require("@wordpress/i18n");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
var _coreData = require("@wordpress/core-data");
|
|
12
|
+
var _hooks = require("../utils/hooks");
|
|
13
|
+
var _lockUnlock = require("../lock-unlock");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* WordPress dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
HTMLElementControl
|
|
25
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
26
|
+
function TermsQueryInspectorControls({
|
|
27
|
+
attributes,
|
|
28
|
+
setQuery,
|
|
29
|
+
setAttributes,
|
|
30
|
+
TagName,
|
|
31
|
+
clientId
|
|
32
|
+
}) {
|
|
33
|
+
const {
|
|
34
|
+
termQuery
|
|
35
|
+
} = attributes;
|
|
36
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
37
|
+
const {
|
|
38
|
+
taxonomies
|
|
39
|
+
} = (0, _data.useSelect)(select => {
|
|
40
|
+
const {
|
|
41
|
+
getEntityRecords
|
|
42
|
+
} = select(_coreData.store);
|
|
43
|
+
const allTaxonomies = getEntityRecords('root', 'taxonomy');
|
|
44
|
+
return {
|
|
45
|
+
taxonomies: allTaxonomies?.filter(t => t.visibility.public) || []
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
const taxonomyOptions = taxonomies.map(taxonomy => ({
|
|
49
|
+
label: taxonomy.name,
|
|
50
|
+
value: taxonomy.slug
|
|
51
|
+
}));
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
53
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
55
|
+
label: (0, _i18n.__)('Terms Query Settings'),
|
|
56
|
+
resetAll: () => {
|
|
57
|
+
setAttributes({
|
|
58
|
+
termQuery: {
|
|
59
|
+
taxonomy: 'category',
|
|
60
|
+
order: 'asc',
|
|
61
|
+
orderBy: 'name',
|
|
62
|
+
hideEmpty: true,
|
|
63
|
+
hierarchical: false,
|
|
64
|
+
parent: 0,
|
|
65
|
+
perPage: 10
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
71
|
+
hasValue: () => termQuery.taxonomy !== 'category',
|
|
72
|
+
label: (0, _i18n.__)('Taxonomy'),
|
|
73
|
+
onDeselect: () => setQuery({
|
|
74
|
+
taxonomy: 'category'
|
|
75
|
+
}),
|
|
76
|
+
isShownByDefault: true,
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
78
|
+
__nextHasNoMarginBottom: true,
|
|
79
|
+
__next40pxDefaultSize: true,
|
|
80
|
+
label: (0, _i18n.__)('Taxonomy'),
|
|
81
|
+
options: taxonomyOptions,
|
|
82
|
+
value: termQuery.taxonomy,
|
|
83
|
+
onChange: selectedTaxonomy => setQuery({
|
|
84
|
+
taxonomy: selectedTaxonomy
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
88
|
+
hasValue: () => termQuery.order !== 'asc',
|
|
89
|
+
label: (0, _i18n.__)('Order'),
|
|
90
|
+
onDeselect: () => setQuery({
|
|
91
|
+
order: 'asc'
|
|
92
|
+
}),
|
|
93
|
+
isShownByDefault: true,
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
95
|
+
__nextHasNoMarginBottom: true,
|
|
96
|
+
__next40pxDefaultSize: true,
|
|
97
|
+
label: (0, _i18n.__)('Order'),
|
|
98
|
+
options: [{
|
|
99
|
+
label: (0, _i18n.__)('Ascending'),
|
|
100
|
+
value: 'asc'
|
|
101
|
+
}, {
|
|
102
|
+
label: (0, _i18n.__)('Descending'),
|
|
103
|
+
value: 'desc'
|
|
104
|
+
}],
|
|
105
|
+
value: termQuery.order,
|
|
106
|
+
onChange: order => setQuery({
|
|
107
|
+
order
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
111
|
+
hasValue: () => termQuery.orderBy !== 'name',
|
|
112
|
+
label: (0, _i18n.__)('Order by'),
|
|
113
|
+
onDeselect: () => setQuery({
|
|
114
|
+
orderBy: 'name'
|
|
115
|
+
}),
|
|
116
|
+
isShownByDefault: true,
|
|
117
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
118
|
+
__nextHasNoMarginBottom: true,
|
|
119
|
+
__next40pxDefaultSize: true,
|
|
120
|
+
label: (0, _i18n.__)('Order by'),
|
|
121
|
+
options: [{
|
|
122
|
+
label: (0, _i18n.__)('Name'),
|
|
123
|
+
value: 'name'
|
|
124
|
+
}, {
|
|
125
|
+
label: (0, _i18n.__)('Slug'),
|
|
126
|
+
value: 'slug'
|
|
127
|
+
}, {
|
|
128
|
+
label: (0, _i18n.__)('Count'),
|
|
129
|
+
value: 'count'
|
|
130
|
+
}],
|
|
131
|
+
value: termQuery.orderBy,
|
|
132
|
+
onChange: orderBy => setQuery({
|
|
133
|
+
orderBy
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
137
|
+
hasValue: () => termQuery.parent !== 0,
|
|
138
|
+
label: (0, _i18n.__)('Show only top level terms'),
|
|
139
|
+
onDeselect: () => setQuery({
|
|
140
|
+
parent: 0
|
|
141
|
+
}),
|
|
142
|
+
isShownByDefault: true,
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
144
|
+
__nextHasNoMarginBottom: true,
|
|
145
|
+
label: (0, _i18n.__)('Show only top level terms'),
|
|
146
|
+
checked: termQuery.parent === 0,
|
|
147
|
+
onChange: showTopLevel => {
|
|
148
|
+
setQuery({
|
|
149
|
+
parent: showTopLevel ? 0 : undefined
|
|
150
|
+
});
|
|
151
|
+
if (showTopLevel && termQuery.hierarchical) {
|
|
152
|
+
setQuery({
|
|
153
|
+
hierarchical: false
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
disabled: !!termQuery.hierarchical
|
|
158
|
+
})
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
160
|
+
hasValue: () => termQuery.hideEmpty !== true,
|
|
161
|
+
label: (0, _i18n.__)('Show empty terms'),
|
|
162
|
+
onDeselect: () => setQuery({
|
|
163
|
+
hideEmpty: true
|
|
164
|
+
}),
|
|
165
|
+
isShownByDefault: true,
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
167
|
+
__nextHasNoMarginBottom: true,
|
|
168
|
+
label: (0, _i18n.__)('Show empty terms'),
|
|
169
|
+
checked: !termQuery.hideEmpty,
|
|
170
|
+
onChange: showEmpty => setQuery({
|
|
171
|
+
hideEmpty: !showEmpty
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
175
|
+
hasValue: () => termQuery.hierarchical !== false,
|
|
176
|
+
label: (0, _i18n.__)('Show hierarchy'),
|
|
177
|
+
onDeselect: () => setQuery({
|
|
178
|
+
hierarchical: false
|
|
179
|
+
}),
|
|
180
|
+
isShownByDefault: true,
|
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
182
|
+
__nextHasNoMarginBottom: true,
|
|
183
|
+
label: (0, _i18n.__)('Show hierarchy'),
|
|
184
|
+
checked: termQuery.hierarchical,
|
|
185
|
+
onChange: hierarchical => {
|
|
186
|
+
setQuery({
|
|
187
|
+
hierarchical
|
|
188
|
+
});
|
|
189
|
+
if (hierarchical && termQuery.parent) {
|
|
190
|
+
setQuery({
|
|
191
|
+
parent: 0
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
disabled: termQuery.parent === 0
|
|
196
|
+
})
|
|
197
|
+
}), !termQuery.hierarchical && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
198
|
+
hasValue: () => termQuery.perPage !== 10,
|
|
199
|
+
label: (0, _i18n.__)('Max terms'),
|
|
200
|
+
onDeselect: () => setQuery({
|
|
201
|
+
perPage: 10
|
|
202
|
+
}),
|
|
203
|
+
isShownByDefault: true,
|
|
204
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
205
|
+
__nextHasNoMarginBottom: true,
|
|
206
|
+
__next40pxDefaultSize: true,
|
|
207
|
+
label: (0, _i18n.__)('Max terms'),
|
|
208
|
+
value: termQuery.perPage,
|
|
209
|
+
min: 0,
|
|
210
|
+
max: 100,
|
|
211
|
+
onChange: perPage => {
|
|
212
|
+
// Show all terms (-1) when 0 is selected.
|
|
213
|
+
setQuery({
|
|
214
|
+
perPage: perPage === 0 ? -1 : perPage
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
help: (0, _i18n.__)('Limit the number of terms you want to show. To show all terms, use 0 (zero).')
|
|
218
|
+
})
|
|
219
|
+
})]
|
|
220
|
+
})
|
|
221
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
222
|
+
group: "advanced",
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HTMLElementControl, {
|
|
224
|
+
tagName: TagName,
|
|
225
|
+
onChange: value => setAttributes({
|
|
226
|
+
tagName: value
|
|
227
|
+
}),
|
|
228
|
+
clientId: clientId,
|
|
229
|
+
options: [{
|
|
230
|
+
label: (0, _i18n.__)('Default (<div>)'),
|
|
231
|
+
value: 'div'
|
|
232
|
+
}, {
|
|
233
|
+
label: '<main>',
|
|
234
|
+
value: 'main'
|
|
235
|
+
}, {
|
|
236
|
+
label: '<section>',
|
|
237
|
+
value: 'section'
|
|
238
|
+
}, {
|
|
239
|
+
label: '<aside>',
|
|
240
|
+
value: 'aside'
|
|
241
|
+
}]
|
|
242
|
+
})
|
|
243
|
+
})]
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=inspector-controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_data","_coreData","_hooks","_lockUnlock","_jsxRuntime","HTMLElementControl","unlock","blockEditorPrivateApis","TermsQueryInspectorControls","attributes","setQuery","setAttributes","TagName","clientId","termQuery","dropdownMenuProps","useToolsPanelDropdownMenuProps","taxonomies","useSelect","select","getEntityRecords","coreStore","allTaxonomies","filter","t","visibility","public","taxonomyOptions","map","taxonomy","label","name","value","slug","jsxs","Fragment","children","jsx","InspectorControls","__experimentalToolsPanel","__","resetAll","order","orderBy","hideEmpty","hierarchical","parent","perPage","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","onChange","selectedTaxonomy","ToggleControl","checked","showTopLevel","undefined","disabled","showEmpty","RangeControl","min","max","help","group","tagName"],"sources":["@wordpress/block-library/src/terms-query/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nexport default function TermsQueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetAttributes,\n\tTagName,\n\tclientId,\n} ) {\n\tconst { termQuery } = attributes;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { taxonomies } = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst allTaxonomies = getEntityRecords( 'root', 'taxonomy' );\n\t\treturn {\n\t\t\ttaxonomies:\n\t\t\t\tallTaxonomies?.filter( ( t ) => t.visibility.public ) || [],\n\t\t};\n\t}, [] );\n\n\tconst taxonomyOptions = taxonomies.map( ( taxonomy ) => ( {\n\t\tlabel: taxonomy.name,\n\t\tvalue: taxonomy.slug,\n\t} ) );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Terms Query Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttermQuery: {\n\t\t\t\t\t\t\t\ttaxonomy: 'category',\n\t\t\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\t\t\torderBy: 'name',\n\t\t\t\t\t\t\t\thideEmpty: true,\n\t\t\t\t\t\t\t\thierarchical: false,\n\t\t\t\t\t\t\t\tparent: 0,\n\t\t\t\t\t\t\t\tperPage: 10,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.taxonomy !== 'category' }\n\t\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetQuery( { taxonomy: 'category' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\t\t\toptions={ taxonomyOptions }\n\t\t\t\t\t\t\tvalue={ termQuery.taxonomy }\n\t\t\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\t\t\tsetQuery( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.order !== 'asc' }\n\t\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { order: 'asc' } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Order' ) }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Ascending' ), value: 'asc' },\n\t\t\t\t\t\t\t\t{ label: __( 'Descending' ), value: 'desc' },\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tvalue={ termQuery.order }\n\t\t\t\t\t\t\tonChange={ ( order ) => setQuery( { order } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.orderBy !== 'name' }\n\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { orderBy: 'name' } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Name' ), value: 'name' },\n\t\t\t\t\t\t\t\t{ label: __( 'Slug' ), value: 'slug' },\n\t\t\t\t\t\t\t\t{ label: __( 'Count' ), value: 'count' },\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tvalue={ termQuery.orderBy }\n\t\t\t\t\t\t\tonChange={ ( orderBy ) => setQuery( { orderBy } ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.parent !== 0 }\n\t\t\t\t\t\tlabel={ __( 'Show only top level terms' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { parent: 0 } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show only top level terms' ) }\n\t\t\t\t\t\t\tchecked={ termQuery.parent === 0 }\n\t\t\t\t\t\t\tonChange={ ( showTopLevel ) => {\n\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\tparent: showTopLevel ? 0 : undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tif ( showTopLevel && termQuery.hierarchical ) {\n\t\t\t\t\t\t\t\t\tsetQuery( { hierarchical: false } );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ !! termQuery.hierarchical }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.hideEmpty !== true }\n\t\t\t\t\t\tlabel={ __( 'Show empty terms' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { hideEmpty: true } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show empty terms' ) }\n\t\t\t\t\t\t\tchecked={ ! termQuery.hideEmpty }\n\t\t\t\t\t\t\tonChange={ ( showEmpty ) =>\n\t\t\t\t\t\t\t\tsetQuery( { hideEmpty: ! showEmpty } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.hierarchical !== false }\n\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { hierarchical: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\t\tchecked={ termQuery.hierarchical }\n\t\t\t\t\t\t\tonChange={ ( hierarchical ) => {\n\t\t\t\t\t\t\t\tsetQuery( { hierarchical } );\n\t\t\t\t\t\t\t\tif ( hierarchical && termQuery.parent ) {\n\t\t\t\t\t\t\t\t\tsetQuery( { parent: 0 } );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ termQuery.parent === 0 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t{ ! termQuery.hierarchical && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => termQuery.perPage !== 10 }\n\t\t\t\t\t\t\tlabel={ __( 'Max terms' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { perPage: 10 } ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Max terms' ) }\n\t\t\t\t\t\t\t\tvalue={ termQuery.perPage }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\tonChange={ ( perPage ) => {\n\t\t\t\t\t\t\t\t\t// Show all terms (-1) when 0 is selected.\n\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\tperPage: perPage === 0 ? -1 : perPage,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Limit the number of terms you want to show. To show all terms, use 0 (zero).'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAAwC,IAAAO,WAAA,GAAAP,OAAA;AAtBxC;AACA;AACA;;AAgBA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAmB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEhD,SAASC,2BAA2B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|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = save;
|
|
7
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
/**
|
|
10
|
+
* WordPress dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function save({
|
|
14
|
+
attributes: {
|
|
15
|
+
tagName: Tag = 'div'
|
|
16
|
+
}
|
|
17
|
+
}) {
|
|
18
|
+
const blockProps = _blockEditor.useBlockProps.save();
|
|
19
|
+
const innerBlocksProps = _blockEditor.useInnerBlocksProps.save(blockProps);
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, {
|
|
21
|
+
...innerBlocksProps
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_jsxRuntime","save","attributes","tagName","Tag","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","jsx"],"sources":["@wordpress/block-library/src/terms-query/save.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes: { tagName: Tag = 'div' } } ) {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\treturn <Tag { ...innerBlocksProps } />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAA6E,IAAAC,WAAA,GAAAD,OAAA;AAH7E;AACA;AACA;;AAGe,SAASE,IAAIA,CAAE;EAAEC,UAAU,EAAE;IAAEC,OAAO,EAAEC,GAAG,GAAG;EAAM;AAAE,CAAC,EAAG;EACxE,MAAMC,UAAU,GAAGC,0BAAa,CAACL,IAAI,CAAC,CAAC;EACvC,MAAMM,gBAAgB,GAAGC,gCAAmB,CAACP,IAAI,CAAEI,UAAW,CAAC;EAC/D,oBAAO,IAAAL,WAAA,CAAAS,GAAA,EAACL,GAAG;IAAA,GAAMG;EAAgB,CAAI,CAAC;AACvC","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = TermsQueryContent;
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
var _compose = require("@wordpress/compose");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _inspectorControls = _interopRequireDefault(require("./inspector-controls"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const TEMPLATE = [['core/term-template']];
|
|
23
|
+
function TermsQueryContent({
|
|
24
|
+
attributes,
|
|
25
|
+
setAttributes,
|
|
26
|
+
clientId,
|
|
27
|
+
name
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
termQueryId,
|
|
31
|
+
termQuery = {},
|
|
32
|
+
tagName: TagName = 'div'
|
|
33
|
+
} = attributes;
|
|
34
|
+
const {
|
|
35
|
+
__unstableMarkNextChangeAsNotPersistent
|
|
36
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
37
|
+
const instanceId = (0, _compose.useInstanceId)(TermsQueryContent);
|
|
38
|
+
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
39
|
+
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
40
|
+
template: TEMPLATE
|
|
41
|
+
});
|
|
42
|
+
const setQuery = newQuery => {
|
|
43
|
+
setAttributes({
|
|
44
|
+
termQuery: {
|
|
45
|
+
...termQuery,
|
|
46
|
+
...newQuery
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
(0, _element.useEffect)(() => {
|
|
51
|
+
if (!termQueryId) {
|
|
52
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
53
|
+
setAttributes({
|
|
54
|
+
termQueryId: instanceId
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, [termQueryId, instanceId, setAttributes, __unstableMarkNextChangeAsNotPersistent]);
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_inspectorControls.default, {
|
|
60
|
+
name: name,
|
|
61
|
+
attributes: attributes,
|
|
62
|
+
setQuery: setQuery,
|
|
63
|
+
setAttributes: setAttributes,
|
|
64
|
+
clientId: clientId,
|
|
65
|
+
tagName: TagName
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(TagName, {
|
|
67
|
+
...innerBlocksProps
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=terms-query-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_compose","_element","_blockEditor","_inspectorControls","_interopRequireDefault","_jsxRuntime","TEMPLATE","TermsQueryContent","attributes","setAttributes","clientId","name","termQueryId","termQuery","tagName","TagName","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","setQuery","newQuery","useEffect","jsxs","Fragment","children","jsx","default"],"sources":["@wordpress/block-library/src/terms-query/terms-query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TermsQueryInspectorControls from './inspector-controls';\n\nconst TEMPLATE = [ [ 'core/term-template' ] ];\n\nexport default function TermsQueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tname,\n} ) {\n\tconst {\n\t\ttermQueryId,\n\t\ttermQuery = {},\n\t\ttagName: TagName = 'div',\n\t} = attributes;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( TermsQueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tconst setQuery = ( newQuery ) => {\n\t\tsetAttributes( {\n\t\t\ttermQuery: {\n\t\t\t\t...termQuery,\n\t\t\t\t...newQuery,\n\t\t\t},\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! termQueryId ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { termQueryId: instanceId } );\n\t\t}\n\t}, [\n\t\ttermQueryId,\n\t\tinstanceId,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t<TermsQueryInspectorControls\n\t\t\t\tname={ name }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ setQuery }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t\ttagName={ TagName }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAS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U,EAAGA,UAAY;MACzBkB,QAAQ,EAAGA,QAAU;MACrBjB,aAAa,EAAGA,aAAe;MAC/BC,QAAQ,EAAGA,QAAU;MACrBI,OAAO,EAAGC;IAAS,CACnB,CAAC,eACF,IAAAV,WAAA,CAAA2B,GAAA,EAACjB,OAAO;MAAA,GAAMQ;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","buttons","icon","initBlock","deprecated","transforms","edit","metadata","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","supports","anchor","align","html","__experimentalExposeControlsToChildren","color","gradients","text","__experimentalDefaultControls","background","spacing","blockGap","padding","margin","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","style","width","layout","allowSwitching","allowInheriting","type","interactivity","clientNavigation","editorStyle","save","settings","example","attributes","justifyContent","innerBlocks","init"],"sources":["@wordpress/block-library/src/buttons/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { buttons as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport transforms from './transforms';\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\tlayout: {\n\t\t\t\ttype: 'flex',\n\t\t\t\tjustifyContent: 'center',\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/button',\n\t\t\t\tattributes: { text: __( 'Find out more' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/button',\n\t\t\t\tattributes: { text: __( 'Contact us' ) },\n\t\t\t},\n\t\t],\n\t},\n\tdeprecated,\n\ttransforms,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,IAAI,QAAQ,kBAAkB;;AAElD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,aAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,QAAA;IAAAC,MAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,sCAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,QAAA;MAAAC,OAAA;MAAAC,MAAA;MAAAL,6BAAA;QAAAG,QAAA;MAAA;IAAA;IAAAG,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAlB,KAAA;MAAAmB,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAlB,6BAAA;QAAAH,KAAA;QAAAmB,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAAAC,MAAA;MAAAC,cAAA;MAAAC,eAAA;MAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,WAAA;
|
|
1
|
+
{"version":3,"names":["__","buttons","icon","initBlock","deprecated","transforms","edit","metadata","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","supports","anchor","align","html","__experimentalExposeControlsToChildren","color","gradients","text","__experimentalDefaultControls","background","spacing","blockGap","padding","margin","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","style","width","layout","allowSwitching","allowInheriting","type","interactivity","clientNavigation","contentRole","editorStyle","save","settings","example","attributes","justifyContent","innerBlocks","init"],"sources":["@wordpress/block-library/src/buttons/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { buttons as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport transforms from './transforms';\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\tlayout: {\n\t\t\t\ttype: 'flex',\n\t\t\t\tjustifyContent: 'center',\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/button',\n\t\t\t\tattributes: { text: __( 'Find out more' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/button',\n\t\t\t\tattributes: { text: __( 'Contact us' ) },\n\t\t\t},\n\t\t],\n\t},\n\tdeprecated,\n\ttransforms,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,IAAI,QAAQ,kBAAkB;;AAElD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OA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,EACD;MACCU,IAAI,EAAE,aAAa;MACnB6C,UAAU,EAAE;QAAE/B,IAAI,EAAExB,EAAE,CAAE,YAAa;MAAE;IACxC,CAAC;EAEH,CAAC;EACDI,UAAU;EACVC,UAAU;EACVC,IAAI;EACJ8C;AACD,CAAC;AAED,OAAO,MAAMM,IAAI,GAAGA,CAAA,KAAMvD,SAAS,CAAE;EAAEO,IAAI;EAAEH,QAAQ;EAAE8C;AAAS,CAAE,CAAC","ignoreList":[]}
|
|
@@ -40,7 +40,9 @@ export default function CategoriesEdit({
|
|
|
40
40
|
const {
|
|
41
41
|
records: allTaxonomies,
|
|
42
42
|
isResolvingTaxonomies
|
|
43
|
-
} = useEntityRecords('root', 'taxonomy'
|
|
43
|
+
} = useEntityRecords('root', 'taxonomy', {
|
|
44
|
+
per_page: -1
|
|
45
|
+
});
|
|
44
46
|
const taxonomies = allTaxonomies?.filter(t => t.visibility.public);
|
|
45
47
|
const taxonomy = taxonomies?.find(t => t.slug === taxonomySlug);
|
|
46
48
|
const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical;
|