@wordpress/editor 10.1.15 → 10.1.18
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/editor-notices/index.js +1 -8
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +39 -0
- package/build/components/editor-snackbars/index.js.map +1 -0
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +1 -0
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/editor-notices/index.js +2 -9
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +28 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -0
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/package.json +27 -27
- package/src/components/editor-notices/index.js +1 -9
- package/src/components/editor-snackbars/index.js +30 -0
- package/src/components/index.js +1 -0
- package/src/components/post-taxonomies/most-used-terms.js +1 -0
|
@@ -45,9 +45,6 @@ function EditorNotices({
|
|
|
45
45
|
isDismissible: false,
|
|
46
46
|
type: 'default'
|
|
47
47
|
});
|
|
48
|
-
const snackbarNotices = (0, _lodash.filter)(notices, {
|
|
49
|
-
type: 'snackbar'
|
|
50
|
-
});
|
|
51
48
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.NoticeList, {
|
|
52
49
|
notices: nonDismissibleNotices,
|
|
53
50
|
className: "components-editor-notices__pinned"
|
|
@@ -55,11 +52,7 @@ function EditorNotices({
|
|
|
55
52
|
notices: dismissibleNotices,
|
|
56
53
|
className: "components-editor-notices__dismissible",
|
|
57
54
|
onRemove: onRemove
|
|
58
|
-
}, (0, _element.createElement)(_templateValidationNotice.default, null))
|
|
59
|
-
notices: snackbarNotices,
|
|
60
|
-
className: "components-editor-notices__snackbar",
|
|
61
|
-
onRemove: onRemove
|
|
62
|
-
}));
|
|
55
|
+
}, (0, _element.createElement)(_templateValidationNotice.default, null)));
|
|
63
56
|
}
|
|
64
57
|
|
|
65
58
|
var _default = (0, _compose.compose)([(0, _data.withSelect)(select => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","isDismissible","type","nonDismissibleNotices","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","isDismissible","type","nonDismissibleNotices","select","noticesStore","getNotices","dispatch","removeNotice"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,aAAT,CAAwB;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAxB,EAAgD;AACtD,QAAMC,kBAAkB,GAAG,oBAAQF,OAAR,EAAiB;AAC3CG,IAAAA,aAAa,EAAE,IAD4B;AAE3CC,IAAAA,IAAI,EAAE;AAFqC,GAAjB,CAA3B;AAIA,QAAMC,qBAAqB,GAAG,oBAAQL,OAAR,EAAiB;AAC9CG,IAAAA,aAAa,EAAE,KAD+B;AAE9CC,IAAAA,IAAI,EAAE;AAFwC,GAAjB,CAA9B;AAKA,SACC,qDACC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGH,kBADX;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKC,4BAAC,iCAAD,OALD,CALD,CADD;AAeA;;eAEc,sBAAS,CACvB,sBAAcK,MAAF,KAAgB;AAC3BN,EAAAA,OAAO,EAAEM,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,QAAQ,EAAEQ,QAAQ,CAAEF,cAAF,CAAR,CAAyBG;AADJ,CAAlB,CAAd,CAJuB,CAAT,EAOVX,aAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\nexport function EditorNotices( { notices, onRemove } ) {\n\tconst dismissibleNotices = filter( notices, {\n\t\tisDismissible: true,\n\t\ttype: 'default',\n\t} );\n\tconst nonDismissibleNotices = filter( notices, {\n\t\tisDismissible: false,\n\t\ttype: 'default',\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__dismissible\"\n\t\t\t\tonRemove={ onRemove }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tnotices: select( noticesStore ).getNotices(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonRemove: dispatch( noticesStore ).removeNotice,\n\t} ) ),\n] )( EditorNotices );\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = EditorSnackbars;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
|
|
16
|
+
var _notices = require("@wordpress/notices");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* External dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
function EditorSnackbars() {
|
|
26
|
+
const notices = (0, _data.useSelect)(select => select(_notices.store).getNotices(), []);
|
|
27
|
+
const {
|
|
28
|
+
removeNotice
|
|
29
|
+
} = (0, _data.useDispatch)(_notices.store);
|
|
30
|
+
const snackbarNotices = (0, _lodash.filter)(notices, {
|
|
31
|
+
type: 'snackbar'
|
|
32
|
+
});
|
|
33
|
+
return (0, _element.createElement)(_components.SnackbarList, {
|
|
34
|
+
notices: snackbarNotices,
|
|
35
|
+
className: "components-editor-notices__snackbar",
|
|
36
|
+
onRemove: removeNotice
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-snackbars/index.js"],"names":["EditorSnackbars","notices","select","noticesStore","getNotices","removeNotice","snackbarNotices","type"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,eAAT,GAA2B;AACzC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB,EADC,EAEf,EAFe,CAAhB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmB,uBAAaF,cAAb,CAAzB;AACA,QAAMG,eAAe,GAAG,oBAAQL,OAAR,EAAiB;AACxCM,IAAAA,IAAI,EAAE;AADkC,GAAjB,CAAxB;AAIA,SACC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGD,eADX;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IADD;AAOA","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function EditorSnackbars() {\n\tconst notices = useSelect(\n\t\t( select ) => select( noticesStore ).getNotices(),\n\t\t[]\n\t);\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst snackbarNotices = filter( notices, {\n\t\ttype: 'snackbar',\n\t} );\n\n\treturn (\n\t\t<SnackbarList\n\t\t\tnotices={ snackbarNotices }\n\t\t\tclassName=\"components-editor-notices__snackbar\"\n\t\t\tonRemove={ removeNotice }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -15,6 +15,7 @@ var _exportNames = {
|
|
|
15
15
|
EditorHistoryRedo: true,
|
|
16
16
|
EditorHistoryUndo: true,
|
|
17
17
|
EditorNotices: true,
|
|
18
|
+
EditorSnackbars: true,
|
|
18
19
|
EntitiesSavedStates: true,
|
|
19
20
|
ErrorBoundary: true,
|
|
20
21
|
LocalAutosaveMonitor: true,
|
|
@@ -119,6 +120,12 @@ Object.defineProperty(exports, "EditorNotices", {
|
|
|
119
120
|
return _editorNotices.default;
|
|
120
121
|
}
|
|
121
122
|
});
|
|
123
|
+
Object.defineProperty(exports, "EditorSnackbars", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () {
|
|
126
|
+
return _editorSnackbars.default;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
122
129
|
Object.defineProperty(exports, "EntitiesSavedStates", {
|
|
123
130
|
enumerable: true,
|
|
124
131
|
get: function () {
|
|
@@ -446,6 +453,8 @@ var _undo = _interopRequireDefault(require("./editor-history/undo"));
|
|
|
446
453
|
|
|
447
454
|
var _editorNotices = _interopRequireDefault(require("./editor-notices"));
|
|
448
455
|
|
|
456
|
+
var _editorSnackbars = _interopRequireDefault(require("./editor-snackbars"));
|
|
457
|
+
|
|
449
458
|
var _entitiesSavedStates = _interopRequireDefault(require("./entities-saved-states"));
|
|
450
459
|
|
|
451
460
|
var _errorBoundary = _interopRequireDefault(require("./error-boundary"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// Block Creation Components\nexport * from './autocompleters';\n\n// Post Related Components\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { default as VisualEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/visual-editor-shortcuts';\nexport { default as TextEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/text-editor-shortcuts';\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostComments } from './post-comments';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport { default as PostScheduleLabel } from './post-schedule/label';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostVisibility } from './post-visibility';\nexport { default as PostVisibilityLabel } from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\n\n// State Related Components\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","_fields","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","coreStore","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,OAAO,EAAE;
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","hide_empty","_fields","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","coreStore","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,UAAU,EAAE,IAJS;AAKrBC,EAAAA,OAAO,EAAE;AALY,CAAtB;;AAQe,SAASC,aAAT,CAAwB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAxB,EAAiD;AAC/D,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAMC,aAAa,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,gBAApB,CACrB,UADqB,EAErBN,QAAQ,CAACO,IAFY,EAGrBf,aAHqB,CAAtB;AAKA,WAAO;AACNS,MAAAA,MAAM,EAAEG,aADF;AAENF,MAAAA,SAAS,EAAE,CAAAE,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEI,MAAf,KAAyBjB;AAF9B,KAAP;AAIA,GAV6B,EAU3B,EAV2B,CAA9B;;AAYA,MAAK,CAAEW,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMO,KAAK,GAAG,2BAAeR,MAAf,CAAd;AACA,QAAMS,KAAK,GAAG,iBAAKV,QAAL,EAAe,CAAE,QAAF,EAAY,WAAZ,CAAf,CAAd;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGU,KADH,CADD,EASC;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,KAAK,CAACE,GAAN,CAAaC,IAAF,IACZ;AAAI,IAAA,GAAG,EAAGA,IAAI,CAACC;AAAf,KACC,4BAAC,kBAAD;AAAQ,IAAA,MAAM,MAAd;AAAe,IAAA,OAAO,EAAG,MAAMd,QAAQ,CAAEa,IAAF;AAAvC,KACGA,IAAI,CAACE,IADR,CADD,CADC,CAJH,CATD,CADD;AAyBA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unescapeTerms } from '../../utils/terms';\n\nconst MAX_MOST_USED_TERMS = 10;\nconst DEFAULT_QUERY = {\n\tper_page: MAX_MOST_USED_TERMS,\n\torderby: 'count',\n\torder: 'desc',\n\thide_empty: true,\n\t_fields: 'id,name,count',\n};\n\nexport default function MostUsedTerms( { onSelect, taxonomy } ) {\n\tconst { _terms, showTerms } = useSelect( ( select ) => {\n\t\tconst mostUsedTerms = select( coreStore ).getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\ttaxonomy.slug,\n\t\t\tDEFAULT_QUERY\n\t\t);\n\t\treturn {\n\t\t\t_terms: mostUsedTerms,\n\t\t\tshowTerms: mostUsedTerms?.length >= MAX_MOST_USED_TERMS,\n\t\t};\n\t}, [] );\n\n\tif ( ! showTerms ) {\n\t\treturn null;\n\t}\n\n\tconst terms = unescapeTerms( _terms );\n\tconst label = get( taxonomy, [ 'labels', 'most_used' ] );\n\n\treturn (\n\t\t<div className=\"editor-post-taxonomies__flat-term-most-used\">\n\t\t\t<h3 className=\"editor-post-taxonomies__flat-term-most-used-label\">\n\t\t\t\t{ label }\n\t\t\t</h3>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\trole=\"list\"\n\t\t\t\tclassName=\"editor-post-taxonomies__flat-term-most-used-list\"\n\t\t\t>\n\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t<li key={ term.id }>\n\t\t\t\t\t\t<Button isLink onClick={ () => onSelect( term ) }>\n\t\t\t\t\t\t\t{ term.name }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -8,7 +8,7 @@ import { filter } from 'lodash';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { NoticeList
|
|
11
|
+
import { NoticeList } from '@wordpress/components';
|
|
12
12
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
13
13
|
import { compose } from '@wordpress/compose';
|
|
14
14
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -29,9 +29,6 @@ export function EditorNotices({
|
|
|
29
29
|
isDismissible: false,
|
|
30
30
|
type: 'default'
|
|
31
31
|
});
|
|
32
|
-
const snackbarNotices = filter(notices, {
|
|
33
|
-
type: 'snackbar'
|
|
34
|
-
});
|
|
35
32
|
return createElement(Fragment, null, createElement(NoticeList, {
|
|
36
33
|
notices: nonDismissibleNotices,
|
|
37
34
|
className: "components-editor-notices__pinned"
|
|
@@ -39,11 +36,7 @@ export function EditorNotices({
|
|
|
39
36
|
notices: dismissibleNotices,
|
|
40
37
|
className: "components-editor-notices__dismissible",
|
|
41
38
|
onRemove: onRemove
|
|
42
|
-
}, createElement(TemplateValidationNotice, null))
|
|
43
|
-
notices: snackbarNotices,
|
|
44
|
-
className: "components-editor-notices__snackbar",
|
|
45
|
-
onRemove: onRemove
|
|
46
|
-
}));
|
|
39
|
+
}, createElement(TemplateValidationNotice, null)));
|
|
47
40
|
}
|
|
48
41
|
export default compose([withSelect(select => ({
|
|
49
42
|
notices: select(noticesStore).getNotices()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["filter","NoticeList","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["filter","NoticeList","withSelect","withDispatch","compose","store","noticesStore","TemplateValidationNotice","EditorNotices","notices","onRemove","dismissibleNotices","isDismissible","type","nonDismissibleNotices","select","getNotices","dispatch","removeNotice"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,QAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,uBAA3B;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEA,OAAO,SAASC,aAAT,CAAwB;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAxB,EAAgD;AACtD,QAAMC,kBAAkB,GAAGX,MAAM,CAAES,OAAF,EAAW;AAC3CG,IAAAA,aAAa,EAAE,IAD4B;AAE3CC,IAAAA,IAAI,EAAE;AAFqC,GAAX,CAAjC;AAIA,QAAMC,qBAAqB,GAAGd,MAAM,CAAES,OAAF,EAAW;AAC9CG,IAAAA,aAAa,EAAE,KAD+B;AAE9CC,IAAAA,IAAI,EAAE;AAFwC,GAAX,CAApC;AAKA,SACC,8BACC,cAAC,UAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,cAAC,UAAD;AACC,IAAA,OAAO,EAAGH,kBADX;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKC,cAAC,wBAAD,OALD,CALD,CADD;AAeA;AAED,eAAeN,OAAO,CAAE,CACvBF,UAAU,CAAIa,MAAF,KAAgB;AAC3BN,EAAAA,OAAO,EAAEM,MAAM,CAAET,YAAF,CAAN,CAAuBU,UAAvB;AADkB,CAAhB,CAAF,CADa,EAIvBb,YAAY,CAAIc,QAAF,KAAkB;AAC/BP,EAAAA,QAAQ,EAAEO,QAAQ,CAAEX,YAAF,CAAR,CAAyBY;AADJ,CAAlB,CAAF,CAJW,CAAF,CAAP,CAOVV,aAPU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\nexport function EditorNotices( { notices, onRemove } ) {\n\tconst dismissibleNotices = filter( notices, {\n\t\tisDismissible: true,\n\t\ttype: 'default',\n\t} );\n\tconst nonDismissibleNotices = filter( notices, {\n\t\tisDismissible: false,\n\t\ttype: 'default',\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__dismissible\"\n\t\t\t\tonRemove={ onRemove }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tnotices: select( noticesStore ).getNotices(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonRemove: dispatch( noticesStore ).removeNotice,\n\t} ) ),\n] )( EditorNotices );\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { filter } from 'lodash';
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { SnackbarList } from '@wordpress/components';
|
|
12
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
14
|
+
export default function EditorSnackbars() {
|
|
15
|
+
const notices = useSelect(select => select(noticesStore).getNotices(), []);
|
|
16
|
+
const {
|
|
17
|
+
removeNotice
|
|
18
|
+
} = useDispatch(noticesStore);
|
|
19
|
+
const snackbarNotices = filter(notices, {
|
|
20
|
+
type: 'snackbar'
|
|
21
|
+
});
|
|
22
|
+
return createElement(SnackbarList, {
|
|
23
|
+
notices: snackbarNotices,
|
|
24
|
+
className: "components-editor-notices__snackbar",
|
|
25
|
+
onRemove: removeNotice
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-snackbars/index.js"],"names":["filter","SnackbarList","useSelect","useDispatch","store","noticesStore","EditorSnackbars","notices","select","getNotices","removeNotice","snackbarNotices","type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,QAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,QAA6B,uBAA7B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAMC,OAAO,GAAGL,SAAS,CACtBM,MAAF,IAAcA,MAAM,CAAEH,YAAF,CAAN,CAAuBI,UAAvB,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmBP,WAAW,CAAEE,YAAF,CAApC;AACA,QAAMM,eAAe,GAAGX,MAAM,CAAEO,OAAF,EAAW;AACxCK,IAAAA,IAAI,EAAE;AADkC,GAAX,CAA9B;AAIA,SACC,cAAC,YAAD;AACC,IAAA,OAAO,EAAGD,eADX;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IADD;AAOA","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function EditorSnackbars() {\n\tconst notices = useSelect(\n\t\t( select ) => select( noticesStore ).getNotices(),\n\t\t[]\n\t);\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst snackbarNotices = filter( notices, {\n\t\ttype: 'snackbar',\n\t} );\n\n\treturn (\n\t\t<SnackbarList\n\t\t\tnotices={ snackbarNotices }\n\t\t\tclassName=\"components-editor-notices__snackbar\"\n\t\t\tonRemove={ removeNotice }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export { default as EditorKeyboardShortcutsRegister } from './global-keyboard-sh
|
|
|
10
10
|
export { default as EditorHistoryRedo } from './editor-history/redo';
|
|
11
11
|
export { default as EditorHistoryUndo } from './editor-history/undo';
|
|
12
12
|
export { default as EditorNotices } from './editor-notices';
|
|
13
|
+
export { default as EditorSnackbars } from './editor-snackbars';
|
|
13
14
|
export { default as EntitiesSavedStates } from './entities-saved-states';
|
|
14
15
|
export { default as ErrorBoundary } from './error-boundary';
|
|
15
16
|
export { default as LocalAutosaveMonitor } from './local-autosave-monitor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":["default","AutosaveMonitor","DocumentOutline","DocumentOutlineCheck","VisualEditorGlobalKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts","EditorKeyboardShortcutsRegister","EditorHistoryRedo","EditorHistoryUndo","EditorNotices","EntitiesSavedStates","ErrorBoundary","LocalAutosaveMonitor","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","PageTemplate","PostAuthor","PostAuthorCheck","PostComments","PostExcerpt","PostExcerptCheck","PostFeaturedImage","PostFeaturedImageCheck","PostFormat","PostFormatCheck","PostLastRevision","PostLastRevisionCheck","PostLockedModal","PostPendingStatus","PostPendingStatusCheck","PostPingbacks","PostPreviewButton","PostPublishButton","PostPublishButtonLabel","PostPublishPanel","PostSavedState","PostSchedule","PostScheduleCheck","PostScheduleLabel","PostSlug","PostSlugCheck","PostSticky","PostStickyCheck","PostSwitchToDraftButton","PostTaxonomies","PostTaxonomiesCheck","PostTextEditor","PostTitle","PostTrash","PostTrashCheck","PostTypeSupportCheck","PostVisibility","PostVisibilityLabel","PostVisibilityCheck","TableOfContents","UnsavedChangesWarning","WordCount","EditorProvider"],"mappings":"AAAA;AACA,cAAc,kBAAd,C,CAEA;;AACA,SAASA,OAAO,IAAIC,eAApB,QAA2C,oBAA3C;AACA,SAASD,OAAO,IAAIE,eAApB,QAA2C,oBAA3C;AACA,SAASF,OAAO,IAAIG,oBAApB,QAAgD,0BAAhD;AACA,SAASH,OAAO,IAAII,mCAApB,QAA+D,qDAA/D;AACA,SAASJ,OAAO,IAAIK,iCAApB,QAA6D,mDAA7D;AACA,SAASL,OAAO,IAAIM,+BAApB,QAA2D,gDAA3D;AACA,SAASN,OAAO,IAAIO,iBAApB,QAA6C,uBAA7C;AACA,SAASP,OAAO,IAAIQ,iBAApB,QAA6C,uBAA7C;AACA,SAASR,OAAO,IAAIS,aAApB,QAAyC,kBAAzC;AACA,SAAST,OAAO,IAAIU,mBAApB,QAA+C,yBAA/C;AACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":["default","AutosaveMonitor","DocumentOutline","DocumentOutlineCheck","VisualEditorGlobalKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts","EditorKeyboardShortcutsRegister","EditorHistoryRedo","EditorHistoryUndo","EditorNotices","EditorSnackbars","EntitiesSavedStates","ErrorBoundary","LocalAutosaveMonitor","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","PageTemplate","PostAuthor","PostAuthorCheck","PostComments","PostExcerpt","PostExcerptCheck","PostFeaturedImage","PostFeaturedImageCheck","PostFormat","PostFormatCheck","PostLastRevision","PostLastRevisionCheck","PostLockedModal","PostPendingStatus","PostPendingStatusCheck","PostPingbacks","PostPreviewButton","PostPublishButton","PostPublishButtonLabel","PostPublishPanel","PostSavedState","PostSchedule","PostScheduleCheck","PostScheduleLabel","PostSlug","PostSlugCheck","PostSticky","PostStickyCheck","PostSwitchToDraftButton","PostTaxonomies","PostTaxonomiesCheck","PostTextEditor","PostTitle","PostTrash","PostTrashCheck","PostTypeSupportCheck","PostVisibility","PostVisibilityLabel","PostVisibilityCheck","TableOfContents","UnsavedChangesWarning","WordCount","EditorProvider"],"mappings":"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","sourcesContent":["// Block Creation Components\nexport * from './autocompleters';\n\n// Post Related Components\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { default as VisualEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/visual-editor-shortcuts';\nexport { default as TextEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/text-editor-shortcuts';\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostComments } from './post-comments';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport { default as PostScheduleLabel } from './post-schedule/label';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostVisibility } from './post-visibility';\nexport { default as PostVisibilityLabel } from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\n\n// State Related Components\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["get","Button","useSelect","store","coreStore","unescapeTerms","MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","_fields","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;AAEA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,OAAO,EAAE;
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["get","Button","useSelect","store","coreStore","unescapeTerms","MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","hide_empty","_fields","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;AAEA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,UAAU,EAAE,IAJS;AAKrBC,EAAAA,OAAO,EAAE;AALY,CAAtB;AAQA,eAAe,SAASC,aAAT,CAAwB;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAxB,EAAiD;AAC/D,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAwBf,SAAS,CAAIgB,MAAF,IAAc;AACtD,UAAMC,aAAa,GAAGD,MAAM,CAAEd,SAAF,CAAN,CAAoBgB,gBAApB,CACrB,UADqB,EAErBL,QAAQ,CAACM,IAFY,EAGrBd,aAHqB,CAAtB;AAKA,WAAO;AACNS,MAAAA,MAAM,EAAEG,aADF;AAENF,MAAAA,SAAS,EAAE,CAAAE,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEG,MAAf,KAAyBhB;AAF9B,KAAP;AAIA,GAVsC,EAUpC,EAVoC,CAAvC;;AAYA,MAAK,CAAEW,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMM,KAAK,GAAGlB,aAAa,CAAEW,MAAF,CAA3B;AACA,QAAMQ,KAAK,GAAGxB,GAAG,CAAEe,QAAF,EAAY,CAAE,QAAF,EAAY,WAAZ,CAAZ,CAAjB;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGS,KADH,CADD,EASC;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,KAAK,CAACE,GAAN,CAAaC,IAAF,IACZ;AAAI,IAAA,GAAG,EAAGA,IAAI,CAACC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,MAAM,MAAd;AAAe,IAAA,OAAO,EAAG,MAAMb,QAAQ,CAAEY,IAAF;AAAvC,KACGA,IAAI,CAACE,IADR,CADD,CADC,CAJH,CATD,CADD;AAyBA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unescapeTerms } from '../../utils/terms';\n\nconst MAX_MOST_USED_TERMS = 10;\nconst DEFAULT_QUERY = {\n\tper_page: MAX_MOST_USED_TERMS,\n\torderby: 'count',\n\torder: 'desc',\n\thide_empty: true,\n\t_fields: 'id,name,count',\n};\n\nexport default function MostUsedTerms( { onSelect, taxonomy } ) {\n\tconst { _terms, showTerms } = useSelect( ( select ) => {\n\t\tconst mostUsedTerms = select( coreStore ).getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\ttaxonomy.slug,\n\t\t\tDEFAULT_QUERY\n\t\t);\n\t\treturn {\n\t\t\t_terms: mostUsedTerms,\n\t\t\tshowTerms: mostUsedTerms?.length >= MAX_MOST_USED_TERMS,\n\t\t};\n\t}, [] );\n\n\tif ( ! showTerms ) {\n\t\treturn null;\n\t}\n\n\tconst terms = unescapeTerms( _terms );\n\tconst label = get( taxonomy, [ 'labels', 'most_used' ] );\n\n\treturn (\n\t\t<div className=\"editor-post-taxonomies__flat-term-most-used\">\n\t\t\t<h3 className=\"editor-post-taxonomies__flat-term-most-used-label\">\n\t\t\t\t{ label }\n\t\t\t</h3>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\trole=\"list\"\n\t\t\t\tclassName=\"editor-post-taxonomies__flat-term-most-used-list\"\n\t\t\t>\n\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t<li key={ term.id }>\n\t\t\t\t\t\t<Button isLink onClick={ () => onSelect( term ) }>\n\t\t\t\t\t\t\t{ term.name }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t</div>\n\t);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.18",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,33 +31,33 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@wordpress/api-fetch": "^5.1.
|
|
35
|
-
"@wordpress/autop": "^3.1.
|
|
36
|
-
"@wordpress/blob": "^3.1.
|
|
37
|
-
"@wordpress/block-editor": "^6.1.
|
|
38
|
-
"@wordpress/blocks": "^9.1.
|
|
39
|
-
"@wordpress/components": "^14.1.
|
|
40
|
-
"@wordpress/compose": "^4.1.
|
|
41
|
-
"@wordpress/core-data": "^3.1.
|
|
42
|
-
"@wordpress/data": "^5.1.
|
|
43
|
-
"@wordpress/data-controls": "^2.1.
|
|
44
|
-
"@wordpress/date": "^4.1.
|
|
45
|
-
"@wordpress/deprecated": "^3.1.
|
|
46
|
-
"@wordpress/element": "^3.1.
|
|
34
|
+
"@wordpress/api-fetch": "^5.1.3",
|
|
35
|
+
"@wordpress/autop": "^3.1.2",
|
|
36
|
+
"@wordpress/blob": "^3.1.2",
|
|
37
|
+
"@wordpress/block-editor": "^6.1.15",
|
|
38
|
+
"@wordpress/blocks": "^9.1.8",
|
|
39
|
+
"@wordpress/components": "^14.1.11",
|
|
40
|
+
"@wordpress/compose": "^4.1.6",
|
|
41
|
+
"@wordpress/core-data": "^3.1.13",
|
|
42
|
+
"@wordpress/data": "^5.1.6",
|
|
43
|
+
"@wordpress/data-controls": "^2.1.7",
|
|
44
|
+
"@wordpress/date": "^4.1.2",
|
|
45
|
+
"@wordpress/deprecated": "^3.1.2",
|
|
46
|
+
"@wordpress/element": "^3.1.2",
|
|
47
47
|
"@wordpress/hooks": "^3.1.1",
|
|
48
|
-
"@wordpress/html-entities": "^3.1.
|
|
49
|
-
"@wordpress/i18n": "^4.1.
|
|
50
|
-
"@wordpress/icons": "^4.0.
|
|
48
|
+
"@wordpress/html-entities": "^3.1.2",
|
|
49
|
+
"@wordpress/i18n": "^4.1.2",
|
|
50
|
+
"@wordpress/icons": "^4.0.3",
|
|
51
51
|
"@wordpress/is-shallow-equal": "^4.1.1",
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^2.1.
|
|
53
|
-
"@wordpress/keycodes": "^3.1.
|
|
54
|
-
"@wordpress/media-utils": "^2.1.
|
|
55
|
-
"@wordpress/notices": "^3.1.
|
|
56
|
-
"@wordpress/reusable-blocks": "^2.1.
|
|
57
|
-
"@wordpress/rich-text": "^4.1.
|
|
58
|
-
"@wordpress/server-side-render": "^2.1.
|
|
59
|
-
"@wordpress/url": "^3.1.
|
|
60
|
-
"@wordpress/wordcount": "^3.1.
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^2.1.7",
|
|
53
|
+
"@wordpress/keycodes": "^3.1.2",
|
|
54
|
+
"@wordpress/media-utils": "^2.1.3",
|
|
55
|
+
"@wordpress/notices": "^3.1.6",
|
|
56
|
+
"@wordpress/reusable-blocks": "^2.1.18",
|
|
57
|
+
"@wordpress/rich-text": "^4.1.6",
|
|
58
|
+
"@wordpress/server-side-render": "^2.1.13",
|
|
59
|
+
"@wordpress/url": "^3.1.3",
|
|
60
|
+
"@wordpress/wordcount": "^3.1.2",
|
|
61
61
|
"classnames": "^2.2.5",
|
|
62
62
|
"lodash": "^4.17.21",
|
|
63
63
|
"memize": "^1.1.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "6464883c6c546233543a1ee01428059dee3560fc"
|
|
71
71
|
}
|
|
@@ -6,7 +6,7 @@ import { filter } from 'lodash';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { NoticeList
|
|
9
|
+
import { NoticeList } from '@wordpress/components';
|
|
10
10
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
11
11
|
import { compose } from '@wordpress/compose';
|
|
12
12
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -25,9 +25,6 @@ export function EditorNotices( { notices, onRemove } ) {
|
|
|
25
25
|
isDismissible: false,
|
|
26
26
|
type: 'default',
|
|
27
27
|
} );
|
|
28
|
-
const snackbarNotices = filter( notices, {
|
|
29
|
-
type: 'snackbar',
|
|
30
|
-
} );
|
|
31
28
|
|
|
32
29
|
return (
|
|
33
30
|
<>
|
|
@@ -42,11 +39,6 @@ export function EditorNotices( { notices, onRemove } ) {
|
|
|
42
39
|
>
|
|
43
40
|
<TemplateValidationNotice />
|
|
44
41
|
</NoticeList>
|
|
45
|
-
<SnackbarList
|
|
46
|
-
notices={ snackbarNotices }
|
|
47
|
-
className="components-editor-notices__snackbar"
|
|
48
|
-
onRemove={ onRemove }
|
|
49
|
-
/>
|
|
50
42
|
</>
|
|
51
43
|
);
|
|
52
44
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { filter } from 'lodash';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { SnackbarList } from '@wordpress/components';
|
|
10
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
+
|
|
13
|
+
export default function EditorSnackbars() {
|
|
14
|
+
const notices = useSelect(
|
|
15
|
+
( select ) => select( noticesStore ).getNotices(),
|
|
16
|
+
[]
|
|
17
|
+
);
|
|
18
|
+
const { removeNotice } = useDispatch( noticesStore );
|
|
19
|
+
const snackbarNotices = filter( notices, {
|
|
20
|
+
type: 'snackbar',
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<SnackbarList
|
|
25
|
+
notices={ snackbarNotices }
|
|
26
|
+
className="components-editor-notices__snackbar"
|
|
27
|
+
onRemove={ removeNotice }
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
package/src/components/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { default as EditorKeyboardShortcutsRegister } from './global-keyboard-sh
|
|
|
11
11
|
export { default as EditorHistoryRedo } from './editor-history/redo';
|
|
12
12
|
export { default as EditorHistoryUndo } from './editor-history/undo';
|
|
13
13
|
export { default as EditorNotices } from './editor-notices';
|
|
14
|
+
export { default as EditorSnackbars } from './editor-snackbars';
|
|
14
15
|
export { default as EntitiesSavedStates } from './entities-saved-states';
|
|
15
16
|
export { default as ErrorBoundary } from './error-boundary';
|
|
16
17
|
export { default as LocalAutosaveMonitor } from './local-autosave-monitor';
|