@backstage/plugin-notifications 0.5.21-next.2 → 0.6.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 +19 -0
- package/dist/alpha/extensions/unreadNotificationsHomeWidget.esm.js +57 -0
- package/dist/alpha/extensions/unreadNotificationsHomeWidget.esm.js.map +1 -0
- package/dist/alpha.d.ts +17 -0
- package/dist/alpha.esm.js +2 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/NotificationsPage/NotificationsPage.esm.js +47 -3
- package/dist/components/NotificationsPage/NotificationsPage.esm.js.map +1 -1
- package/dist/components/NotificationsSideBarItem/NotificationsSideBarItem.esm.js +1 -1
- package/dist/components/NotificationsTable/NotificationIcon.esm.js +14 -8
- package/dist/components/NotificationsTable/NotificationIcon.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationsTable.esm.js +76 -41
- package/dist/components/NotificationsTable/NotificationsTable.esm.js.map +1 -1
- package/dist/components/NotificationsTable/NotificationsTable.module.css.esm.js +2 -2
- package/dist/components/UnreadNotificationsCard/UnreadNotificationsCard.esm.js +255 -0
- package/dist/components/UnreadNotificationsCard/UnreadNotificationsCard.esm.js.map +1 -0
- package/dist/components/UnreadNotificationsCard/UnreadNotificationsCard.module.css.esm.js +8 -0
- package/dist/components/UnreadNotificationsCard/UnreadNotificationsCard.module.css.esm.js.map +1 -0
- package/dist/components/UnreadNotificationsCard/index.esm.js +7 -0
- package/dist/components/UnreadNotificationsCard/index.esm.js.map +1 -0
- package/dist/components/UserNotificationSettingsCard/OriginRow.esm.js +3 -3
- package/dist/components/UserNotificationSettingsCard/OriginRow.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/TopicRow.esm.js +1 -3
- package/dist/components/UserNotificationSettingsCard/TopicRow.esm.js.map +1 -1
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsCard.esm.js +1 -0
- package/dist/components/UserNotificationSettingsCard/UserNotificationSettingsCard.esm.js.map +1 -1
- package/dist/hooks/useNotificationsRefresh.esm.js +24 -0
- package/dist/hooks/useNotificationsRefresh.esm.js.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/plugins/notifications/package.json.esm.js +2 -1
- package/dist/plugins/notifications/package.json.esm.js.map +1 -1
- package/dist/translation.esm.js +9 -0
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils/notificationLinks.esm.js +11 -0
- package/dist/utils/notificationLinks.esm.js.map +1 -0
- package/dist/utils/plainText.esm.js +30 -0
- package/dist/utils/plainText.esm.js.map +1 -0
- package/package.json +14 -13
package/dist/index.esm.js
CHANGED
|
@@ -3,6 +3,7 @@ export { notificationsApiRef } from './api/NotificationsApi.esm.js';
|
|
|
3
3
|
export { NotificationsClient } from './api/NotificationsClient.esm.js';
|
|
4
4
|
export { useNotificationsApi } from './hooks/useNotificationsApi.esm.js';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '@backstage/plugin-signals-react';
|
|
6
7
|
import '@backstage/core-plugin-api';
|
|
7
8
|
import './routes.esm.js';
|
|
8
9
|
import './hooks/useTitleCounter.esm.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "@backstage/plugin-notifications";
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.6.0";
|
|
3
3
|
var backstage = {
|
|
4
4
|
role: "frontend-plugin",
|
|
5
5
|
pluginId: "notifications",
|
|
@@ -54,6 +54,7 @@ var dependencies = {
|
|
|
54
54
|
"@backstage/core-plugin-api": "workspace:^",
|
|
55
55
|
"@backstage/errors": "workspace:^",
|
|
56
56
|
"@backstage/frontend-plugin-api": "workspace:^",
|
|
57
|
+
"@backstage/plugin-home-react": "workspace:^",
|
|
57
58
|
"@backstage/plugin-notifications-common": "workspace:^",
|
|
58
59
|
"@backstage/plugin-signals-react": "workspace:^",
|
|
59
60
|
"@backstage/theme": "workspace:^",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -97,6 +97,15 @@ const notificationsTranslationRef = createTranslationRef({
|
|
|
97
97
|
errors: {
|
|
98
98
|
useNotificationFormat: "useNotificationFormat must be used within a NotificationFormatProvider"
|
|
99
99
|
}
|
|
100
|
+
},
|
|
101
|
+
unreadCard: {
|
|
102
|
+
title_one: "Last unread notifications ({{count}})",
|
|
103
|
+
title_other: "Last unread notifications ({{count}})",
|
|
104
|
+
viewAll: "View All",
|
|
105
|
+
emptyState: "All caught up!",
|
|
106
|
+
columnNotification: "Notification",
|
|
107
|
+
columnActions: "Actions",
|
|
108
|
+
resultsCount: "{{displayed}} results out of {{total}}"
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const notificationsTranslationRef = createTranslationRef({\n id: 'plugin.notifications',\n messages: {\n notificationsPage: {\n title: 'Notifications',\n tableTitle: {\n all_one: 'All notifications ({{count}})',\n all_other: 'All notifications ({{count}})',\n saved_one: 'Saved notifications ({{count}})',\n saved_other: 'Saved notifications ({{count}})',\n unread_one: 'Unread notifications ({{count}})',\n unread_other: 'Unread notifications ({{count}})',\n read_one: 'Read notifications ({{count}})',\n read_other: 'Read notifications ({{count}})',\n },\n },\n filters: {\n title: 'Filters',\n view: {\n label: 'View',\n unread: 'Unread notifications',\n read: 'Read notifications',\n saved: 'Saved',\n all: 'All',\n },\n createdAfter: {\n label: 'Sent out',\n placeholder: 'Notifications since',\n last24h: 'Last 24h',\n lastWeek: 'Last week',\n anyTime: 'Any time',\n },\n sortBy: {\n label: 'Sort by',\n placeholder: 'Field to sort by',\n newest: 'Newest on top',\n oldest: 'Oldest on top',\n topic: 'Topic',\n origin: 'Origin',\n },\n severity: {\n label: 'Min severity',\n critical: 'Critical',\n high: 'High',\n normal: 'Normal',\n low: 'Low',\n },\n topic: {\n label: 'Topic',\n anyTopic: 'Any topic',\n },\n },\n table: {\n emptyMessage: 'No records to display',\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n bulkActions: {\n markAllRead: 'Mark all read',\n markSelectedAsRead: 'Mark selected as read',\n returnSelectedAmongUnread: 'Return selected among unread',\n saveSelectedForLater: 'Save selected for later',\n undoSaveForSelected: 'Undo save for selected',\n },\n confirmDialog: {\n title: 'Are you sure?',\n markAllReadDescription: 'Mark all notifications as read.',\n markAllReadConfirmation: 'Mark All',\n cancel: 'Cancel',\n },\n errors: {\n markAllReadFailed: 'Failed to mark all notifications as read',\n },\n },\n sidebar: {\n title: 'Notifications',\n errors: {\n markAsReadFailed: 'Failed to mark notification as read',\n fetchNotificationFailed: 'Failed to fetch notification',\n },\n },\n settings: {\n title: 'Notification settings',\n errorTitle: 'Failed to load settings',\n noSettingsAvailable:\n 'No notification settings available, check back later',\n table: {\n origin: 'Origin',\n topic: 'Topic',\n },\n errors: {\n useNotificationFormat:\n 'useNotificationFormat must be used within a NotificationFormatProvider',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,oBAAA,CAAqB;AAAA,EAC9D,EAAA,EAAI,sBAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,eAAA;AAAA,MACP,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,+BAAA;AAAA,QACT,SAAA,EAAW,+BAAA;AAAA,QACX,SAAA,EAAW,iCAAA;AAAA,QACX,WAAA,EAAa,iCAAA;AAAA,QACb,UAAA,EAAY,kCAAA;AAAA,QACZ,YAAA,EAAc,kCAAA;AAAA,QACd,QAAA,EAAU,gCAAA;AAAA,QACV,UAAA,EAAY;AAAA;AACd,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,MAAA,EAAQ,sBAAA;AAAA,QACR,IAAA,EAAM,oBAAA;AAAA,QACN,KAAA,EAAO,OAAA;AAAA,QACP,GAAA,EAAK;AAAA,OACP;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO,UAAA;AAAA,QACP,WAAA,EAAa,qBAAA;AAAA,QACb,OAAA,EAAS,UAAA;AAAA,QACT,QAAA,EAAU,WAAA;AAAA,QACV,OAAA,EAAS;AAAA,OACX;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,KAAA,EAAO,SAAA;AAAA,QACP,WAAA,EAAa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A,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,uBAAA;AAAA,MACP,UAAA,EAAY,yBAAA;AAAA,MACZ,mBAAA,EACE,sDAAA;AAAA,MACF,KAAA,EAAO;AAAA,QACL,MAAA,EAAQ,QAAA;AAAA,QACR,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,qBAAA,EACE;AAAA;AACJ;
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const notificationsTranslationRef = createTranslationRef({\n id: 'plugin.notifications',\n messages: {\n notificationsPage: {\n title: 'Notifications',\n tableTitle: {\n all_one: 'All notifications ({{count}})',\n all_other: 'All notifications ({{count}})',\n saved_one: 'Saved notifications ({{count}})',\n saved_other: 'Saved notifications ({{count}})',\n unread_one: 'Unread notifications ({{count}})',\n unread_other: 'Unread notifications ({{count}})',\n read_one: 'Read notifications ({{count}})',\n read_other: 'Read notifications ({{count}})',\n },\n },\n filters: {\n title: 'Filters',\n view: {\n label: 'View',\n unread: 'Unread notifications',\n read: 'Read notifications',\n saved: 'Saved',\n all: 'All',\n },\n createdAfter: {\n label: 'Sent out',\n placeholder: 'Notifications since',\n last24h: 'Last 24h',\n lastWeek: 'Last week',\n anyTime: 'Any time',\n },\n sortBy: {\n label: 'Sort by',\n placeholder: 'Field to sort by',\n newest: 'Newest on top',\n oldest: 'Oldest on top',\n topic: 'Topic',\n origin: 'Origin',\n },\n severity: {\n label: 'Min severity',\n critical: 'Critical',\n high: 'High',\n normal: 'Normal',\n low: 'Low',\n },\n topic: {\n label: 'Topic',\n anyTopic: 'Any topic',\n },\n },\n table: {\n emptyMessage: 'No records to display',\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n bulkActions: {\n markAllRead: 'Mark all read',\n markSelectedAsRead: 'Mark selected as read',\n returnSelectedAmongUnread: 'Return selected among unread',\n saveSelectedForLater: 'Save selected for later',\n undoSaveForSelected: 'Undo save for selected',\n },\n confirmDialog: {\n title: 'Are you sure?',\n markAllReadDescription: 'Mark all notifications as read.',\n markAllReadConfirmation: 'Mark All',\n cancel: 'Cancel',\n },\n errors: {\n markAllReadFailed: 'Failed to mark all notifications as read',\n },\n },\n sidebar: {\n title: 'Notifications',\n errors: {\n markAsReadFailed: 'Failed to mark notification as read',\n fetchNotificationFailed: 'Failed to fetch notification',\n },\n },\n settings: {\n title: 'Notification settings',\n errorTitle: 'Failed to load settings',\n noSettingsAvailable:\n 'No notification settings available, check back later',\n table: {\n origin: 'Origin',\n topic: 'Topic',\n },\n errors: {\n useNotificationFormat:\n 'useNotificationFormat must be used within a NotificationFormatProvider',\n },\n },\n unreadCard: {\n title_one: 'Last unread notifications ({{count}})',\n title_other: 'Last unread notifications ({{count}})',\n viewAll: 'View All',\n emptyState: 'All caught up!',\n columnNotification: 'Notification',\n columnActions: 'Actions',\n resultsCount: '{{displayed}} results out of {{total}}',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,oBAAA,CAAqB;AAAA,EAC9D,EAAA,EAAI,sBAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,eAAA;AAAA,MACP,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,+BAAA;A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 @@
|
|
|
1
|
+
const NOTIFICATIONS_PAGE_PATH = "/notifications";
|
|
2
|
+
function getNotificationsPageLink(notificationId) {
|
|
3
|
+
if (!notificationId) {
|
|
4
|
+
return NOTIFICATIONS_PAGE_PATH;
|
|
5
|
+
}
|
|
6
|
+
const params = new URLSearchParams({ id: notificationId });
|
|
7
|
+
return `${NOTIFICATIONS_PAGE_PATH}?${params.toString()}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { NOTIFICATIONS_PAGE_PATH, getNotificationsPageLink };
|
|
11
|
+
//# sourceMappingURL=notificationLinks.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationLinks.esm.js","sources":["../../src/utils/notificationLinks.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @public */\nexport const NOTIFICATIONS_PAGE_PATH = '/notifications';\n\n/** @public */\nexport function getNotificationsPageLink(notificationId?: string): string {\n if (!notificationId) {\n return NOTIFICATIONS_PAGE_PATH;\n }\n\n const params = new URLSearchParams({ id: notificationId });\n return `${NOTIFICATIONS_PAGE_PATH}?${params.toString()}`;\n}\n"],"names":[],"mappings":"AAiBO,MAAM,uBAAA,GAA0B;AAGhC,SAAS,yBAAyB,cAAA,EAAiC;AACxE,EAAA,IAAI,CAAC,cAAA,EAAgB;AACnB,IAAA,OAAO,uBAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAS,IAAI,eAAA,CAAgB,EAAE,EAAA,EAAI,gBAAgB,CAAA;AACzD,EAAA,OAAO,CAAA,EAAG,uBAAuB,CAAA,CAAA,EAAI,MAAA,CAAO,UAAU,CAAA,CAAA;AACxD;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const HTML_ENTITY_MAP = {
|
|
2
|
+
"&": "&",
|
|
3
|
+
"<": "<",
|
|
4
|
+
">": ">",
|
|
5
|
+
""": '"',
|
|
6
|
+
"'": "'",
|
|
7
|
+
" ": " "
|
|
8
|
+
};
|
|
9
|
+
function toPlainText(text) {
|
|
10
|
+
const withoutEntities = text.replace(
|
|
11
|
+
/&(?:amp|lt|gt|quot|#39|nbsp);/g,
|
|
12
|
+
(entity) => HTML_ENTITY_MAP[entity] ?? entity
|
|
13
|
+
);
|
|
14
|
+
const withoutHtml = withoutEntities.replace(/<\/?[a-zA-Z][^>]*>/g, " ");
|
|
15
|
+
return withoutHtml.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/(\*\*|__)(.*?)\1/g, "$2").replace(/(\*|_)(.*?)\1/g, "$2").replace(/`([^`]+)`/g, "$1").replace(/^#{1,6}\s+/gm, "").replace(/\s+/g, " ").trim();
|
|
16
|
+
}
|
|
17
|
+
function truncateText(text, maxChars) {
|
|
18
|
+
const full = toPlainText(text);
|
|
19
|
+
if (full.length <= maxChars) {
|
|
20
|
+
return { display: full, truncated: false, full };
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
display: `${full.slice(0, maxChars)}...`,
|
|
24
|
+
truncated: true,
|
|
25
|
+
full
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { toPlainText, truncateText };
|
|
30
|
+
//# sourceMappingURL=plainText.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plainText.esm.js","sources":["../../src/utils/plainText.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst HTML_ENTITY_MAP: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n ' ': ' ',\n};\n\n/** @public */\nexport function toPlainText(text: string): string {\n // Decode entities before stripping tags so encoded markup like\n // `<b>...</b>` does not reappear as HTML in the result.\n const withoutEntities = text.replace(\n /&(?:amp|lt|gt|quot|#39|nbsp);/g,\n entity => HTML_ENTITY_MAP[entity] ?? entity,\n );\n // Only strip real HTML tags (names starting with a letter), so text like\n // \"<3\" or placeholders is preserved after entity decoding.\n const withoutHtml = withoutEntities.replace(/<\\/?[a-zA-Z][^>]*>/g, ' ');\n\n return withoutHtml\n .replace(/!\\[([^\\]]*)\\]\\([^)]*\\)/g, '$1')\n .replace(/\\[([^\\]]+)\\]\\([^)]*\\)/g, '$1')\n .replace(/(\\*\\*|__)(.*?)\\1/g, '$2')\n .replace(/(\\*|_)(.*?)\\1/g, '$2')\n .replace(/`([^`]+)`/g, '$1')\n .replace(/^#{1,6}\\s+/gm, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/** @public */\nexport function truncateText(\n text: string,\n maxChars: number,\n): { display: string; truncated: boolean; full: string } {\n const full = toPlainText(text);\n\n if (full.length <= maxChars) {\n return { display: full, truncated: false, full };\n }\n\n return {\n display: `${full.slice(0, maxChars)}...`,\n truncated: true,\n full,\n };\n}\n"],"names":[],"mappings":"AAgBA,MAAM,eAAA,GAA0C;AAAA,EAC9C,OAAA,EAAS,GAAA;AAAA,EACT,MAAA,EAAQ,GAAA;AAAA,EACR,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,GAAA;AAAA,EACV,OAAA,EAAS,GAAA;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plugin",
|
|
6
6
|
"pluginId": "notifications",
|
|
@@ -63,14 +63,15 @@
|
|
|
63
63
|
"test": "backstage-cli package test"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@backstage/core-components": "0.18.14
|
|
67
|
-
"@backstage/core-plugin-api": "1.12.10
|
|
68
|
-
"@backstage/errors": "1.3.1",
|
|
69
|
-
"@backstage/frontend-plugin-api": "0.18.1
|
|
70
|
-
"@backstage/plugin-
|
|
71
|
-
"@backstage/plugin-
|
|
72
|
-
"@backstage/
|
|
73
|
-
"@backstage/
|
|
66
|
+
"@backstage/core-components": "^0.18.14",
|
|
67
|
+
"@backstage/core-plugin-api": "^1.12.10",
|
|
68
|
+
"@backstage/errors": "^1.3.1",
|
|
69
|
+
"@backstage/frontend-plugin-api": "^0.18.1",
|
|
70
|
+
"@backstage/plugin-home-react": "^0.1.42",
|
|
71
|
+
"@backstage/plugin-notifications-common": "^0.2.4",
|
|
72
|
+
"@backstage/plugin-signals-react": "^0.0.26",
|
|
73
|
+
"@backstage/theme": "^0.7.3",
|
|
74
|
+
"@backstage/ui": "^0.18.0",
|
|
74
75
|
"@remixicon/react": ">=4.6.0 <4.9.0",
|
|
75
76
|
"lodash": "^4.17.21",
|
|
76
77
|
"notistack": "^3.0.1",
|
|
@@ -79,10 +80,10 @@
|
|
|
79
80
|
"react-use": "^17.2.4"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@backstage/cli": "0.36.6
|
|
83
|
-
"@backstage/dev-utils": "1.1.27
|
|
84
|
-
"@backstage/plugin-signals": "0.0.35
|
|
85
|
-
"@backstage/test-utils": "1.7.22
|
|
83
|
+
"@backstage/cli": "^0.36.6",
|
|
84
|
+
"@backstage/dev-utils": "^1.1.27",
|
|
85
|
+
"@backstage/plugin-signals": "^0.0.35",
|
|
86
|
+
"@backstage/test-utils": "^1.7.22",
|
|
86
87
|
"@testing-library/dom": "^10.0.0",
|
|
87
88
|
"@testing-library/jest-dom": "^6.0.0",
|
|
88
89
|
"@testing-library/react": "^16.0.0",
|