@wordpress/editor 12.5.2 → 12.5.5
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/components/post-taxonomies/index.js +7 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +7 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/post-taxonomies/index.js +3 -1
|
@@ -42,7 +42,13 @@ function PostTaxonomies(_ref) {
|
|
|
42
42
|
taxonomyWrapper = _lodash.identity
|
|
43
43
|
} = _ref;
|
|
44
44
|
const availableTaxonomies = (0, _lodash.filter)(taxonomies, taxonomy => (0, _lodash.includes)(taxonomy.types, postType));
|
|
45
|
-
const visibleTaxonomies = (0, _lodash.filter)(availableTaxonomies,
|
|
45
|
+
const visibleTaxonomies = (0, _lodash.filter)(availableTaxonomies, // In some circumstances .visibility can end up as undefined so optional chaining operator required.
|
|
46
|
+
// https://github.com/WordPress/gutenberg/issues/40326
|
|
47
|
+
taxonomy => {
|
|
48
|
+
var _taxonomy$visibility;
|
|
49
|
+
|
|
50
|
+
return (_taxonomy$visibility = taxonomy.visibility) === null || _taxonomy$visibility === void 0 ? void 0 : _taxonomy$visibility.show_ui;
|
|
51
|
+
});
|
|
46
52
|
return visibleTaxonomies.map(taxonomy => {
|
|
47
53
|
const TaxonomyComponent = taxonomy.hierarchical ? _hierarchicalTermSelector.default : _flatTermSelector.default;
|
|
48
54
|
return (0, _element.createElement)(_element.Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"names":["PostTaxonomies","postType","taxonomies","taxonomyWrapper","identity","availableTaxonomies","taxonomy","types","visibleTaxonomies","visibility","show_ui","map","TaxonomyComponent","hierarchical","HierarchicalTermSelector","FlatTermSelector","slug","select","editorStore","getCurrentPostType","coreStore","getTaxonomies","per_page"],"mappings":";;;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKO,SAASA,cAAT,OAIH;AAAA,MAJ4B;AAC/BC,IAAAA,QAD+B;AAE/BC,IAAAA,UAF+B;AAG/BC,IAAAA,eAAe,GAAGC;AAHa,GAI5B;AACH,QAAMC,mBAAmB,GAAG,oBAAQH,UAAR,EAAsBI,QAAF,IAC/C,sBAAUA,QAAQ,CAACC,KAAnB,EAA0BN,QAA1B,CAD2B,CAA5B;AAGA,QAAMO,iBAAiB,GAAG,oBACzBH,mBADyB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"names":["PostTaxonomies","postType","taxonomies","taxonomyWrapper","identity","availableTaxonomies","taxonomy","types","visibleTaxonomies","visibility","show_ui","map","TaxonomyComponent","hierarchical","HierarchicalTermSelector","FlatTermSelector","slug","select","editorStore","getCurrentPostType","coreStore","getTaxonomies","per_page"],"mappings":";;;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKO,SAASA,cAAT,OAIH;AAAA,MAJ4B;AAC/BC,IAAAA,QAD+B;AAE/BC,IAAAA,UAF+B;AAG/BC,IAAAA,eAAe,GAAGC;AAHa,GAI5B;AACH,QAAMC,mBAAmB,GAAG,oBAAQH,UAAR,EAAsBI,QAAF,IAC/C,sBAAUA,QAAQ,CAACC,KAAnB,EAA0BN,QAA1B,CAD2B,CAA5B;AAGA,QAAMO,iBAAiB,GAAG,oBACzBH,mBADyB,EAEzB;AACA;AACEC,EAAAA,QAAF;AAAA;;AAAA,mCAAgBA,QAAQ,CAACG,UAAzB,yDAAgB,qBAAqBC,OAArC;AAAA,GAJyB,CAA1B;AAMA,SAAOF,iBAAiB,CAACG,GAAlB,CAAyBL,QAAF,IAAgB;AAC7C,UAAMM,iBAAiB,GAAGN,QAAQ,CAACO,YAAT,GACvBC,iCADuB,GAEvBC,yBAFH;AAGA,WACC,4BAAC,iBAAD;AAAU,MAAA,GAAG,EAAI,YAAYT,QAAQ,CAACU,IAAM;AAA5C,OACGb,eAAe,CAChB,4BAAC,iBAAD;AAAmB,MAAA,IAAI,EAAGG,QAAQ,CAACU;AAAnC,MADgB,EAEhBV,QAFgB,CADlB,CADD;AAQA,GAZM,CAAP;AAaA;;eAEc,sBAAS,CACvB,sBAAcW,MAAF,IAAc;AACzB,SAAO;AACNhB,IAAAA,QAAQ,EAAEgB,MAAM,CAAEC,YAAF,CAAN,CAAsBC,kBAAtB,EADJ;AAENjB,IAAAA,UAAU,EAAEe,MAAM,CAAEG,eAAF,CAAN,CAAoBC,aAApB,CAAmC;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KAAnC;AAFN,GAAP;AAIA,CALD,CADuB,CAAT,EAOVtB,cAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, identity, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from './hierarchical-term-selector';\nimport FlatTermSelector from './flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nexport function PostTaxonomies( {\n\tpostType,\n\ttaxonomies,\n\ttaxonomyWrapper = identity,\n} ) {\n\tconst availableTaxonomies = filter( taxonomies, ( taxonomy ) =>\n\t\tincludes( taxonomy.types, postType )\n\t);\n\tconst visibleTaxonomies = filter(\n\t\tavailableTaxonomies,\n\t\t// In some circumstances .visibility can end up as undefined so optional chaining operator required.\n\t\t// https://github.com/WordPress/gutenberg/issues/40326\n\t\t( taxonomy ) => taxonomy.visibility?.show_ui\n\t);\n\treturn visibleTaxonomies.map( ( taxonomy ) => {\n\t\tconst TaxonomyComponent = taxonomy.hierarchical\n\t\t\t? HierarchicalTermSelector\n\t\t\t: FlatTermSelector;\n\t\treturn (\n\t\t\t<Fragment key={ `taxonomy-${ taxonomy.slug }` }>\n\t\t\t\t{ taxonomyWrapper(\n\t\t\t\t\t<TaxonomyComponent slug={ taxonomy.slug } />,\n\t\t\t\t\ttaxonomy\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t);\n\t} );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t} ),\n] )( PostTaxonomies );\n"]}
|
|
@@ -26,7 +26,13 @@ export function PostTaxonomies(_ref) {
|
|
|
26
26
|
taxonomyWrapper = identity
|
|
27
27
|
} = _ref;
|
|
28
28
|
const availableTaxonomies = filter(taxonomies, taxonomy => includes(taxonomy.types, postType));
|
|
29
|
-
const visibleTaxonomies = filter(availableTaxonomies,
|
|
29
|
+
const visibleTaxonomies = filter(availableTaxonomies, // In some circumstances .visibility can end up as undefined so optional chaining operator required.
|
|
30
|
+
// https://github.com/WordPress/gutenberg/issues/40326
|
|
31
|
+
taxonomy => {
|
|
32
|
+
var _taxonomy$visibility;
|
|
33
|
+
|
|
34
|
+
return (_taxonomy$visibility = taxonomy.visibility) === null || _taxonomy$visibility === void 0 ? void 0 : _taxonomy$visibility.show_ui;
|
|
35
|
+
});
|
|
30
36
|
return visibleTaxonomies.map(taxonomy => {
|
|
31
37
|
const TaxonomyComponent = taxonomy.hierarchical ? HierarchicalTermSelector : FlatTermSelector;
|
|
32
38
|
return createElement(Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"names":["filter","identity","includes","Fragment","withSelect","compose","store","coreStore","HierarchicalTermSelector","FlatTermSelector","editorStore","PostTaxonomies","postType","taxonomies","taxonomyWrapper","availableTaxonomies","taxonomy","types","visibleTaxonomies","visibility","show_ui","map","TaxonomyComponent","hierarchical","slug","select","getCurrentPostType","getTaxonomies","per_page"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,QAA3B,QAA2C,QAA3C;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,wBAAP,MAAqC,8BAArC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,SAASH,KAAK,IAAII,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,cAAT,OAIH;AAAA,MAJ4B;AAC/BC,IAAAA,QAD+B;AAE/BC,IAAAA,UAF+B;AAG/BC,IAAAA,eAAe,GAAGb;AAHa,GAI5B;AACH,QAAMc,mBAAmB,GAAGf,MAAM,CAAEa,UAAF,EAAgBG,QAAF,IAC/Cd,QAAQ,CAAEc,QAAQ,CAACC,KAAX,EAAkBL,QAAlB,CADyB,CAAlC;AAGA,QAAMM,iBAAiB,GAAGlB,MAAM,CAC/Be,mBAD+B,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"names":["filter","identity","includes","Fragment","withSelect","compose","store","coreStore","HierarchicalTermSelector","FlatTermSelector","editorStore","PostTaxonomies","postType","taxonomies","taxonomyWrapper","availableTaxonomies","taxonomy","types","visibleTaxonomies","visibility","show_ui","map","TaxonomyComponent","hierarchical","slug","select","getCurrentPostType","getTaxonomies","per_page"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,QAA3B,QAA2C,QAA3C;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAC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C;AAFN,GAAP;AAIA,CALS,CADa,CAAF,CAAP,CAOVjB,cAPU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, identity, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from './hierarchical-term-selector';\nimport FlatTermSelector from './flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nexport function PostTaxonomies( {\n\tpostType,\n\ttaxonomies,\n\ttaxonomyWrapper = identity,\n} ) {\n\tconst availableTaxonomies = filter( taxonomies, ( taxonomy ) =>\n\t\tincludes( taxonomy.types, postType )\n\t);\n\tconst visibleTaxonomies = filter(\n\t\tavailableTaxonomies,\n\t\t// In some circumstances .visibility can end up as undefined so optional chaining operator required.\n\t\t// https://github.com/WordPress/gutenberg/issues/40326\n\t\t( taxonomy ) => taxonomy.visibility?.show_ui\n\t);\n\treturn visibleTaxonomies.map( ( taxonomy ) => {\n\t\tconst TaxonomyComponent = taxonomy.hierarchical\n\t\t\t? HierarchicalTermSelector\n\t\t\t: FlatTermSelector;\n\t\treturn (\n\t\t\t<Fragment key={ `taxonomy-${ taxonomy.slug }` }>\n\t\t\t\t{ taxonomyWrapper(\n\t\t\t\t\t<TaxonomyComponent slug={ taxonomy.slug } />,\n\t\t\t\t\ttaxonomy\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t);\n\t} );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t} ),\n] )( PostTaxonomies );\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.5",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
34
|
"@wordpress/a11y": "^3.6.1",
|
|
35
35
|
"@wordpress/api-fetch": "^6.3.1",
|
|
36
|
-
"@wordpress/block-editor": "^8.5.
|
|
37
|
-
"@wordpress/blocks": "^11.5.
|
|
38
|
-
"@wordpress/components": "^19.8.
|
|
36
|
+
"@wordpress/block-editor": "^8.5.5",
|
|
37
|
+
"@wordpress/blocks": "^11.5.3",
|
|
38
|
+
"@wordpress/components": "^19.8.4",
|
|
39
39
|
"@wordpress/compose": "^5.4.1",
|
|
40
|
-
"@wordpress/core-data": "^4.4.
|
|
40
|
+
"@wordpress/core-data": "^4.4.5",
|
|
41
41
|
"@wordpress/data": "^6.6.1",
|
|
42
42
|
"@wordpress/date": "^4.6.1",
|
|
43
43
|
"@wordpress/deprecated": "^3.6.1",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@wordpress/hooks": "^3.6.1",
|
|
46
46
|
"@wordpress/html-entities": "^3.6.1",
|
|
47
47
|
"@wordpress/i18n": "^4.6.1",
|
|
48
|
-
"@wordpress/icons": "^8.2.
|
|
48
|
+
"@wordpress/icons": "^8.2.2",
|
|
49
49
|
"@wordpress/keyboard-shortcuts": "^3.4.1",
|
|
50
50
|
"@wordpress/keycodes": "^3.6.1",
|
|
51
51
|
"@wordpress/media-utils": "^3.4.1",
|
|
52
52
|
"@wordpress/notices": "^3.6.1",
|
|
53
|
-
"@wordpress/preferences": "^1.2.
|
|
54
|
-
"@wordpress/reusable-blocks": "^3.4.
|
|
55
|
-
"@wordpress/rich-text": "^5.4.
|
|
56
|
-
"@wordpress/server-side-render": "^3.4.
|
|
53
|
+
"@wordpress/preferences": "^1.2.4",
|
|
54
|
+
"@wordpress/reusable-blocks": "^3.4.5",
|
|
55
|
+
"@wordpress/rich-text": "^5.4.2",
|
|
56
|
+
"@wordpress/server-side-render": "^3.4.5",
|
|
57
57
|
"@wordpress/url": "^3.7.1",
|
|
58
58
|
"@wordpress/wordcount": "^3.6.1",
|
|
59
59
|
"classnames": "^2.3.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b97f41a0716be45abd8bf897c7f135b86dc0760c"
|
|
73
73
|
}
|
|
@@ -28,7 +28,9 @@ export function PostTaxonomies( {
|
|
|
28
28
|
);
|
|
29
29
|
const visibleTaxonomies = filter(
|
|
30
30
|
availableTaxonomies,
|
|
31
|
-
|
|
31
|
+
// In some circumstances .visibility can end up as undefined so optional chaining operator required.
|
|
32
|
+
// https://github.com/WordPress/gutenberg/issues/40326
|
|
33
|
+
( taxonomy ) => taxonomy.visibility?.show_ui
|
|
32
34
|
);
|
|
33
35
|
return visibleTaxonomies.map( ( taxonomy ) => {
|
|
34
36
|
const TaxonomyComponent = taxonomy.hierarchical
|