@wordpress/edit-widgets 6.39.1-next.v.202602111440.0 → 6.40.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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.40.0 (2026-02-18)
6
+
5
7
  ## 6.39.0 (2026-01-29)
6
8
 
7
9
  ## 6.38.0 (2026-01-16)
@@ -22,49 +22,18 @@ __export(notices_exports, {
22
22
  default: () => notices_default
23
23
  });
24
24
  module.exports = __toCommonJS(notices_exports);
25
- var import_components = require("@wordpress/components");
26
- var import_data = require("@wordpress/data");
27
25
  var import_notices = require("@wordpress/notices");
28
26
  var import_jsx_runtime = require("react/jsx-runtime");
29
- var MAX_VISIBLE_NOTICES = -3;
30
27
  function Notices() {
31
- const { removeNotice } = (0, import_data.useDispatch)(import_notices.store);
32
- const { notices } = (0, import_data.useSelect)((select) => {
33
- return {
34
- notices: select(import_notices.store).getNotices()
35
- };
36
- }, []);
37
- const dismissibleNotices = notices.filter(
38
- ({ isDismissible, type }) => isDismissible && type === "default"
39
- );
40
- const nonDismissibleNotices = notices.filter(
41
- ({ isDismissible, type }) => !isDismissible && type === "default"
42
- );
43
- const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES);
44
28
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
45
29
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
- import_components.NoticeList,
30
+ import_notices.InlineNotices,
47
31
  {
48
- notices: nonDismissibleNotices,
49
- className: "edit-widgets-notices__pinned"
32
+ pinnedNoticesClassName: "edit-widgets-notices__pinned",
33
+ dismissibleNoticesClassName: "edit-widgets-notices__dismissible"
50
34
  }
51
35
  ),
52
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
- import_components.NoticeList,
54
- {
55
- notices: dismissibleNotices,
56
- className: "edit-widgets-notices__dismissible",
57
- onRemove: removeNotice
58
- }
59
- ),
60
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
- import_components.SnackbarList,
62
- {
63
- notices: snackbarNotices,
64
- className: "edit-widgets-notices__snackbar",
65
- onRemove: removeNotice
66
- }
67
- )
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_notices.SnackbarNotices, { className: "edit-widgets-notices__snackbar" })
68
37
  ] });
69
38
  }
70
39
  var notices_default = Notices;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/notices/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n// Last three notices. Slices from the tail end of the list.\nconst MAX_VISIBLE_NOTICES = -3;\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices\n\t\t.filter( ( { type } ) => type === 'snackbar' )\n\t\t.slice( MAX_VISIBLE_NOTICES );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyC;AACzC,kBAAuC;AACvC,qBAAsC;AAwBpC;AArBF,IAAM,sBAAsB;AAE5B,SAAS,UAAU;AAClB,QAAM,EAAE,aAAa,QAAI,yBAAa,eAAAA,KAAa;AACnD,QAAM,EAAE,QAAQ,QAAI,uBAAW,CAAE,WAAY;AAC5C,WAAO;AAAA,MACN,SAAS,OAAQ,eAAAA,KAAa,EAAE,WAAW;AAAA,IAC5C;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,qBAAqB,QAAQ;AAAA,IAClC,CAAE,EAAE,eAAe,KAAK,MAAO,iBAAiB,SAAS;AAAA,EAC1D;AACA,QAAM,wBAAwB,QAAQ;AAAA,IACrC,CAAE,EAAE,eAAe,KAAK,MAAO,CAAE,iBAAiB,SAAS;AAAA,EAC5D;AACA,QAAM,kBAAkB,QACtB,OAAQ,CAAE,EAAE,KAAK,MAAO,SAAS,UAAW,EAC5C,MAAO,mBAAoB;AAE7B,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,KACD;AAEF;AAEA,IAAO,kBAAQ;",
6
- "names": ["noticesStore"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { InlineNotices, SnackbarNotices } from '@wordpress/notices';\n\nfunction Notices() {\n\treturn (\n\t\t<>\n\t\t\t<InlineNotices\n\t\t\t\tpinnedNoticesClassName=\"edit-widgets-notices__pinned\"\n\t\t\t\tdismissibleNoticesClassName=\"edit-widgets-notices__dismissible\"\n\t\t\t/>\n\t\t\t<SnackbarNotices className=\"edit-widgets-notices__snackbar\" />\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA+C;AAI7C;AAFF,SAAS,UAAU;AAClB,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,wBAAuB;AAAA,QACvB,6BAA4B;AAAA;AAAA,IAC7B;AAAA,IACA,4CAAC,kCAAgB,WAAU,kCAAiC;AAAA,KAC7D;AAEF;AAEA,IAAO,kBAAQ;",
6
+ "names": []
7
7
  }
@@ -1,47 +1,16 @@
1
1
  // packages/edit-widgets/src/components/notices/index.js
2
- import { NoticeList, SnackbarList } from "@wordpress/components";
3
- import { useSelect, useDispatch } from "@wordpress/data";
4
- import { store as noticesStore } from "@wordpress/notices";
2
+ import { InlineNotices, SnackbarNotices } from "@wordpress/notices";
5
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- var MAX_VISIBLE_NOTICES = -3;
7
4
  function Notices() {
8
- const { removeNotice } = useDispatch(noticesStore);
9
- const { notices } = useSelect((select) => {
10
- return {
11
- notices: select(noticesStore).getNotices()
12
- };
13
- }, []);
14
- const dismissibleNotices = notices.filter(
15
- ({ isDismissible, type }) => isDismissible && type === "default"
16
- );
17
- const nonDismissibleNotices = notices.filter(
18
- ({ isDismissible, type }) => !isDismissible && type === "default"
19
- );
20
- const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES);
21
5
  return /* @__PURE__ */ jsxs(Fragment, { children: [
22
6
  /* @__PURE__ */ jsx(
23
- NoticeList,
7
+ InlineNotices,
24
8
  {
25
- notices: nonDismissibleNotices,
26
- className: "edit-widgets-notices__pinned"
9
+ pinnedNoticesClassName: "edit-widgets-notices__pinned",
10
+ dismissibleNoticesClassName: "edit-widgets-notices__dismissible"
27
11
  }
28
12
  ),
29
- /* @__PURE__ */ jsx(
30
- NoticeList,
31
- {
32
- notices: dismissibleNotices,
33
- className: "edit-widgets-notices__dismissible",
34
- onRemove: removeNotice
35
- }
36
- ),
37
- /* @__PURE__ */ jsx(
38
- SnackbarList,
39
- {
40
- notices: snackbarNotices,
41
- className: "edit-widgets-notices__snackbar",
42
- onRemove: removeNotice
43
- }
44
- )
13
+ /* @__PURE__ */ jsx(SnackbarNotices, { className: "edit-widgets-notices__snackbar" })
45
14
  ] });
46
15
  }
47
16
  var notices_default = Notices;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/notices/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n// Last three notices. Slices from the tail end of the list.\nconst MAX_VISIBLE_NOTICES = -3;\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices\n\t\t.filter( ( { type } ) => type === 'snackbar' )\n\t\t.slice( MAX_VISIBLE_NOTICES );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],
5
- "mappings": ";AAGA,SAAS,YAAY,oBAAoB;AACzC,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,oBAAoB;AAwBpC,mBACC,KADD;AArBF,IAAM,sBAAsB;AAE5B,SAAS,UAAU;AAClB,QAAM,EAAE,aAAa,IAAI,YAAa,YAAa;AACnD,QAAM,EAAE,QAAQ,IAAI,UAAW,CAAE,WAAY;AAC5C,WAAO;AAAA,MACN,SAAS,OAAQ,YAAa,EAAE,WAAW;AAAA,IAC5C;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,qBAAqB,QAAQ;AAAA,IAClC,CAAE,EAAE,eAAe,KAAK,MAAO,iBAAiB,SAAS;AAAA,EAC1D;AACA,QAAM,wBAAwB,QAAQ;AAAA,IACrC,CAAE,EAAE,eAAe,KAAK,MAAO,CAAE,iBAAiB,SAAS;AAAA,EAC5D;AACA,QAAM,kBAAkB,QACtB,OAAQ,CAAE,EAAE,KAAK,MAAO,SAAS,UAAW,EAC5C,MAAO,mBAAoB;AAE7B,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,KACD;AAEF;AAEA,IAAO,kBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { InlineNotices, SnackbarNotices } from '@wordpress/notices';\n\nfunction Notices() {\n\treturn (\n\t\t<>\n\t\t\t<InlineNotices\n\t\t\t\tpinnedNoticesClassName=\"edit-widgets-notices__pinned\"\n\t\t\t\tdismissibleNoticesClassName=\"edit-widgets-notices__dismissible\"\n\t\t\t/>\n\t\t\t<SnackbarNotices className=\"edit-widgets-notices__snackbar\" />\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],
5
+ "mappings": ";AAGA,SAAS,eAAe,uBAAuB;AAI7C,mBACC,KADD;AAFF,SAAS,UAAU;AAClB,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,wBAAuB;AAAA,QACvB,6BAA4B;AAAA;AAAA,IAC7B;AAAA,IACA,oBAAC,mBAAgB,WAAU,kCAAiC;AAAA,KAC7D;AAEF;AAEA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -953,57 +953,16 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
953
953
 
954
954
  .edit-widgets-notices__snackbar {
955
955
  position: fixed;
956
- left: 0;
957
- bottom: 20px;
958
- padding-right: 16px;
959
- padding-left: 16px;
960
- }
961
-
962
- .edit-widgets-notices__snackbar { /* Set left position when auto-fold is not on the body element. */
963
- right: 0;
964
- }
965
- @media (min-width: 783px) {
966
- .edit-widgets-notices__snackbar {
967
- right: 160px;
968
- }
969
- }
970
-
971
- .auto-fold .edit-widgets-notices__snackbar { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
972
- @media (min-width: 783px) {
973
- .auto-fold .edit-widgets-notices__snackbar {
974
- right: 36px;
975
- }
976
- }
977
- @media (min-width: 961px) {
978
- .auto-fold .edit-widgets-notices__snackbar {
979
- right: 160px;
980
- }
981
- }
982
-
983
- /* Sidebar manually collapsed. */
984
- .folded .edit-widgets-notices__snackbar {
985
- right: 0;
986
- }
987
- @media (min-width: 783px) {
988
- .folded .edit-widgets-notices__snackbar {
989
- right: 36px;
990
- }
991
- }
992
-
993
- body.is-fullscreen-mode .edit-widgets-notices__snackbar {
994
- right: 0 !important;
995
- }
996
-
997
- .edit-widgets-notices__dismissible .components-notice,
998
- .edit-widgets-notices__pinned .components-notice {
956
+ bottom: 24px;
957
+ right: 50%;
958
+ left: auto;
959
+ transform: translateX(50%);
960
+ width: max-content;
961
+ max-width: calc(100vw - 32px);
999
962
  box-sizing: border-box;
1000
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
1001
- padding: 0 12px;
1002
- min-height: 64px;
1003
- }
1004
- .edit-widgets-notices__dismissible .components-notice .components-notice__dismiss,
1005
- .edit-widgets-notices__pinned .components-notice .components-notice__dismiss {
1006
- margin-top: 12px;
963
+ display: flex;
964
+ flex-direction: column;
965
+ align-items: center;
1007
966
  }
1008
967
 
1009
968
  .edit-widgets-layout__inserter-panel {
@@ -953,57 +953,16 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
953
953
 
954
954
  .edit-widgets-notices__snackbar {
955
955
  position: fixed;
956
- right: 0;
957
- bottom: 20px;
958
- padding-left: 16px;
959
- padding-right: 16px;
960
- }
961
-
962
- .edit-widgets-notices__snackbar { /* Set left position when auto-fold is not on the body element. */
963
- left: 0;
964
- }
965
- @media (min-width: 783px) {
966
- .edit-widgets-notices__snackbar {
967
- left: 160px;
968
- }
969
- }
970
-
971
- .auto-fold .edit-widgets-notices__snackbar { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
972
- @media (min-width: 783px) {
973
- .auto-fold .edit-widgets-notices__snackbar {
974
- left: 36px;
975
- }
976
- }
977
- @media (min-width: 961px) {
978
- .auto-fold .edit-widgets-notices__snackbar {
979
- left: 160px;
980
- }
981
- }
982
-
983
- /* Sidebar manually collapsed. */
984
- .folded .edit-widgets-notices__snackbar {
985
- left: 0;
986
- }
987
- @media (min-width: 783px) {
988
- .folded .edit-widgets-notices__snackbar {
989
- left: 36px;
990
- }
991
- }
992
-
993
- body.is-fullscreen-mode .edit-widgets-notices__snackbar {
994
- left: 0 !important;
995
- }
996
-
997
- .edit-widgets-notices__dismissible .components-notice,
998
- .edit-widgets-notices__pinned .components-notice {
956
+ bottom: 24px;
957
+ left: 50%;
958
+ right: auto;
959
+ transform: translateX(-50%);
960
+ width: max-content;
961
+ max-width: calc(100vw - 32px);
999
962
  box-sizing: border-box;
1000
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
1001
- padding: 0 12px;
1002
- min-height: 64px;
1003
- }
1004
- .edit-widgets-notices__dismissible .components-notice .components-notice__dismiss,
1005
- .edit-widgets-notices__pinned .components-notice .components-notice__dismiss {
1006
- margin-top: 12px;
963
+ display: flex;
964
+ flex-direction: column;
965
+ align-items: center;
1007
966
  }
1008
967
 
1009
968
  .edit-widgets-layout__inserter-panel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-widgets",
3
- "version": "6.39.1-next.v.202602111440.0+a307a2e35",
3
+ "version": "6.40.0",
4
4
  "description": "Widgets Page module for WordPress..",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -48,33 +48,33 @@
48
48
  ]
49
49
  },
50
50
  "dependencies": {
51
- "@wordpress/api-fetch": "^7.39.1-next.v.202602111440.0+a307a2e35",
52
- "@wordpress/base-styles": "^6.15.1-next.v.202602111440.0+a307a2e35",
53
- "@wordpress/block-editor": "^15.12.2-next.v.202602111440.0+a307a2e35",
54
- "@wordpress/block-library": "^9.39.1-next.v.202602111440.0+a307a2e35",
55
- "@wordpress/blocks": "^15.12.1-next.v.202602111440.0+a307a2e35",
56
- "@wordpress/components": "^32.2.1-next.v.202602111440.0+a307a2e35",
57
- "@wordpress/compose": "^7.39.1-next.v.202602111440.0+a307a2e35",
58
- "@wordpress/core-data": "^7.39.1-next.v.202602111440.0+a307a2e35",
59
- "@wordpress/data": "^10.39.1-next.v.202602111440.0+a307a2e35",
60
- "@wordpress/deprecated": "^4.39.1-next.v.202602111440.0+a307a2e35",
61
- "@wordpress/dom": "^4.39.1-next.v.202602111440.0+a307a2e35",
62
- "@wordpress/element": "^6.39.1-next.v.202602111440.0+a307a2e35",
63
- "@wordpress/hooks": "^4.39.1-next.v.202602111440.0+a307a2e35",
64
- "@wordpress/i18n": "^6.12.1-next.v.202602111440.0+a307a2e35",
65
- "@wordpress/icons": "^11.6.1-next.v.202602111440.0+a307a2e35",
66
- "@wordpress/interface": "^9.24.1-next.v.202602111440.0+a307a2e35",
67
- "@wordpress/keyboard-shortcuts": "^5.39.1-next.v.202602111440.0+a307a2e35",
68
- "@wordpress/keycodes": "^4.39.1-next.v.202602111440.0+a307a2e35",
69
- "@wordpress/media-utils": "^5.39.1-next.v.202602111440.0+a307a2e35",
70
- "@wordpress/notices": "^5.39.1-next.v.202602111440.0+a307a2e35",
71
- "@wordpress/patterns": "^2.39.1-next.v.202602111440.0+a307a2e35",
72
- "@wordpress/plugins": "^7.39.1-next.v.202602111440.0+a307a2e35",
73
- "@wordpress/preferences": "^4.39.1-next.v.202602111440.0+a307a2e35",
74
- "@wordpress/private-apis": "^1.39.1-next.v.202602111440.0+a307a2e35",
75
- "@wordpress/reusable-blocks": "^5.39.1-next.v.202602111440.0+a307a2e35",
76
- "@wordpress/url": "^4.39.1-next.v.202602111440.0+a307a2e35",
77
- "@wordpress/widgets": "^4.39.1-next.v.202602111440.0+a307a2e35",
51
+ "@wordpress/api-fetch": "^7.40.0",
52
+ "@wordpress/base-styles": "^6.16.0",
53
+ "@wordpress/block-editor": "^15.13.0",
54
+ "@wordpress/block-library": "^9.40.0",
55
+ "@wordpress/blocks": "^15.13.0",
56
+ "@wordpress/components": "^32.2.0",
57
+ "@wordpress/compose": "^7.40.0",
58
+ "@wordpress/core-data": "^7.40.0",
59
+ "@wordpress/data": "^10.40.0",
60
+ "@wordpress/deprecated": "^4.40.0",
61
+ "@wordpress/dom": "^4.40.0",
62
+ "@wordpress/element": "^6.40.0",
63
+ "@wordpress/hooks": "^4.40.0",
64
+ "@wordpress/i18n": "^6.13.0",
65
+ "@wordpress/icons": "^11.7.0",
66
+ "@wordpress/interface": "^9.25.0",
67
+ "@wordpress/keyboard-shortcuts": "^5.40.0",
68
+ "@wordpress/keycodes": "^4.40.0",
69
+ "@wordpress/media-utils": "^5.40.0",
70
+ "@wordpress/notices": "^5.40.0",
71
+ "@wordpress/patterns": "^2.40.0",
72
+ "@wordpress/plugins": "^7.40.0",
73
+ "@wordpress/preferences": "^4.40.0",
74
+ "@wordpress/private-apis": "^1.40.0",
75
+ "@wordpress/reusable-blocks": "^5.40.0",
76
+ "@wordpress/url": "^4.40.0",
77
+ "@wordpress/widgets": "^4.40.0",
78
78
  "clsx": "^2.1.1"
79
79
  },
80
80
  "devDependencies": {
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "e0a2324a9690e55f4101d61113f4bbbf240b55ed"
90
+ "gitHead": "376124aa10dbc2cc0c81c964ec00b99fcfee5382"
91
91
  }
@@ -1,47 +1,16 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { NoticeList, SnackbarList } from '@wordpress/components';
5
- import { useSelect, useDispatch } from '@wordpress/data';
6
- import { store as noticesStore } from '@wordpress/notices';
7
-
8
- // Last three notices. Slices from the tail end of the list.
9
- const MAX_VISIBLE_NOTICES = -3;
4
+ import { InlineNotices, SnackbarNotices } from '@wordpress/notices';
10
5
 
11
6
  function Notices() {
12
- const { removeNotice } = useDispatch( noticesStore );
13
- const { notices } = useSelect( ( select ) => {
14
- return {
15
- notices: select( noticesStore ).getNotices(),
16
- };
17
- }, [] );
18
-
19
- const dismissibleNotices = notices.filter(
20
- ( { isDismissible, type } ) => isDismissible && type === 'default'
21
- );
22
- const nonDismissibleNotices = notices.filter(
23
- ( { isDismissible, type } ) => ! isDismissible && type === 'default'
24
- );
25
- const snackbarNotices = notices
26
- .filter( ( { type } ) => type === 'snackbar' )
27
- .slice( MAX_VISIBLE_NOTICES );
28
-
29
7
  return (
30
8
  <>
31
- <NoticeList
32
- notices={ nonDismissibleNotices }
33
- className="edit-widgets-notices__pinned"
34
- />
35
- <NoticeList
36
- notices={ dismissibleNotices }
37
- className="edit-widgets-notices__dismissible"
38
- onRemove={ removeNotice }
39
- />
40
- <SnackbarList
41
- notices={ snackbarNotices }
42
- className="edit-widgets-notices__snackbar"
43
- onRemove={ removeNotice }
9
+ <InlineNotices
10
+ pinnedNoticesClassName="edit-widgets-notices__pinned"
11
+ dismissibleNoticesClassName="edit-widgets-notices__dismissible"
44
12
  />
13
+ <SnackbarNotices className="edit-widgets-notices__snackbar" />
45
14
  </>
46
15
  );
47
16
  }
@@ -2,27 +2,6 @@
2
2
  @use "@wordpress/base-styles/variables" as *;
3
3
 
4
4
  .edit-widgets-notices__snackbar {
5
- position: fixed;
6
- right: 0;
7
- bottom: 20px;
8
- padding-left: 16px;
9
- padding-right: 16px;
5
+ @include snackbar-container();
10
6
  }
11
- @include editor-left(".edit-widgets-notices__snackbar");
12
7
 
13
- .edit-widgets-notices__dismissible,
14
- .edit-widgets-notices__pinned {
15
- .components-notice {
16
- box-sizing: border-box;
17
- border-bottom: $border-width solid rgba(0, 0, 0, 0.2);
18
- padding: 0 $grid-unit-15;
19
-
20
- // Min-height matches the height of a single-line notice with an action button.
21
- min-height: $header-height;
22
-
23
- // Margins ensure that the dismiss button aligns to the center of the first line of text.
24
- .components-notice__dismiss {
25
- margin-top: $grid-unit-15;
26
- }
27
- }
28
- }