@open-pioneer/notifier 4.0.0 → 4.1.0-dev.20250707115222
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 +16 -1
- package/Notifier.js +5 -5
- package/Notifier.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @open-pioneer/notifier
|
|
2
2
|
|
|
3
|
+
## 4.1.0-dev.20250707115222
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3c6191a: Icons have been changed to Lucide react-icons to unify the appearance of the components.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- b7a854d: Update dependencies
|
|
12
|
+
- adf277b: Update dependencies
|
|
13
|
+
- Updated dependencies [b7a854d]
|
|
14
|
+
- Updated dependencies [adf277b]
|
|
15
|
+
- @open-pioneer/core@4.1.0-dev.20250707115222
|
|
16
|
+
- @open-pioneer/react-utils@4.1.0-dev.20250707115222
|
|
17
|
+
- @open-pioneer/runtime@4.1.0-dev.20250707115222
|
|
18
|
+
|
|
3
19
|
## 4.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -62,7 +78,6 @@
|
|
|
62
78
|
### Major Changes
|
|
63
79
|
|
|
64
80
|
- 9477e54: Update dependencies
|
|
65
|
-
|
|
66
81
|
- React 19
|
|
67
82
|
- Vite 6
|
|
68
83
|
- FormatJS 3
|
package/Notifier.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Portal, Toaster as Toaster$1, Toast, Spinner, Stack, useToastStyles, Icon } from '@chakra-ui/react';
|
|
3
3
|
import { useIntl, useService } from './_virtual/_virtual-pioneer-module_react-hooks.js';
|
|
4
4
|
import { memo, useState, useEffect } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { LuTriangleAlert, LuCircleAlert, LuCircleCheck, LuInfo } from 'react-icons/lu';
|
|
6
6
|
|
|
7
7
|
function Notifier(_props) {
|
|
8
8
|
const notificationService = useService(
|
|
@@ -53,10 +53,10 @@ const Toaster = memo(function Toaster2(props) {
|
|
|
53
53
|
) });
|
|
54
54
|
});
|
|
55
55
|
const icons = {
|
|
56
|
-
info:
|
|
57
|
-
success:
|
|
58
|
-
warning:
|
|
59
|
-
error:
|
|
56
|
+
info: LuInfo,
|
|
57
|
+
success: LuCircleCheck,
|
|
58
|
+
warning: LuCircleAlert,
|
|
59
|
+
error: LuTriangleAlert
|
|
60
60
|
};
|
|
61
61
|
function ToastIndicator(props) {
|
|
62
62
|
const styles = useToastStyles();
|
package/Notifier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifier.js","sources":["Notifier.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n Toaster as ChakraToaster,\n Icon,\n Portal,\n Spinner,\n Stack,\n Toast,\n useToastStyles\n} from \"@chakra-ui/react\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { memo, useEffect, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"Notifier.js","sources":["Notifier.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {\n Toaster as ChakraToaster,\n Icon,\n Portal,\n Spinner,\n Stack,\n Toast,\n useToastStyles\n} from \"@chakra-ui/react\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { memo, useEffect, useState } from \"react\";\nimport { LuTriangleAlert, LuInfo, LuCircleCheck, LuCircleAlert } from \"react-icons/lu\";\nimport { InternalNotificationAPI, ToasterObject } from \"./NotificationServiceImpl\";\n\n/** Props supported by the {@link Notifier} component. */\nexport interface NotifierProps {}\n\n/**\n * Shows notifications sent via the `NotificationService`.\n *\n * Only one instance of `<Notifier />` should be present in the application.\n * It currently does not matter where the Notifier is located in the react tree.\n *\n * ```ts\n * import { Notifier } from \"@open-pioneer/notifier\";\n *\n * export function AppUI() {\n * return (\n * <>\n * <Notifier />\n * <h1>Your application</h1>\n * </>\n * );\n * }\n * ```\n */\nexport function Notifier(_props: NotifierProps) {\n const notificationService = useService(\n \"notifier.NotificationService\"\n ) as InternalNotificationAPI;\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n const handle = notificationService.registerUI();\n if (!handle) {\n return;\n }\n\n setActive(true);\n return () => {\n setActive(false);\n handle.destroy();\n };\n }, [notificationService]);\n\n return active && <Toaster toaster={notificationService.toaster} />;\n}\n\nconst Toaster = memo(function Toaster(props: { toaster: ToasterObject }) {\n const intl = useIntl();\n return (\n <Portal>\n <ChakraToaster\n toaster={props.toaster}\n insetInline={{ mdDown: \"4\" }}\n aria-label={intl.formatMessage({\n id: \"regionLabel\"\n })}\n >\n {(toast) => (\n <Toast.Root width={{ md: \"sm\" }} alignItems=\"center\">\n {toast.type === \"loading\" ? (\n <Spinner size=\"sm\" color=\"blue.solid\" />\n ) : (\n <ToastIndicator type={toast.type ?? \"\"} />\n )}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && (\n <Toast.Description>{toast.description}</Toast.Description>\n )}\n </Stack>\n {toast.action && (\n <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>\n )}\n {toast.meta?.closable && (\n <Toast.CloseTrigger\n cursor=\"pointer\"\n aria-label={intl.formatMessage({\n id: \"notification.close\"\n })}\n />\n )}\n </Toast.Root>\n )}\n </ChakraToaster>\n </Portal>\n );\n});\n\nconst icons: Record<string, React.ElementType> = {\n info: LuInfo,\n success: LuCircleCheck,\n warning: LuCircleAlert,\n error: LuTriangleAlert\n};\n\nfunction ToastIndicator(props: { type: string }) {\n const styles = useToastStyles();\n\n const Component = icons[props.type];\n if (!Component) return null;\n\n return (\n <Icon css={styles.indicator}>\n <span>\n <Component style={{ width: \"100%\", height: \"100%\" }} />\n </span>\n </Icon>\n );\n}\n"],"names":["Toaster","ChakraToaster"],"mappings":";;;;;;AAsCO,SAAS,SAAS,MAAuB,EAAA;AAC5C,EAAA,MAAM,mBAAsB,GAAA,UAAA;AAAA,IACxB;AAAA,GACJ;AACA,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE1C,EAAA,SAAA,CAAU,MAAM;AACZ,IAAM,MAAA,MAAA,GAAS,oBAAoB,UAAW,EAAA;AAC9C,IAAA,IAAI,CAAC,MAAQ,EAAA;AACT,MAAA;AAAA;AAGJ,IAAA,SAAA,CAAU,IAAI,CAAA;AACd,IAAA,OAAO,MAAM;AACT,MAAA,SAAA,CAAU,KAAK,CAAA;AACf,MAAA,MAAA,CAAO,OAAQ,EAAA;AAAA,KACnB;AAAA,GACJ,EAAG,CAAC,mBAAmB,CAAC,CAAA;AAExB,EAAA,OAAO,MAAU,oBAAA,GAAA,CAAC,OAAQ,EAAA,EAAA,OAAA,EAAS,oBAAoB,OAAS,EAAA,CAAA;AACpE;AAEA,MAAM,OAAU,GAAA,IAAA,CAAK,SAASA,QAAAA,CAAQ,KAAmC,EAAA;AACrE,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAA,2BACK,MACG,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACG,SAAS,KAAM,CAAA,OAAA;AAAA,MACf,WAAA,EAAa,EAAE,MAAA,EAAQ,GAAI,EAAA;AAAA,MAC3B,YAAA,EAAY,KAAK,aAAc,CAAA;AAAA,QAC3B,EAAI,EAAA;AAAA,OACP,CAAA;AAAA,MAEA,QAAC,EAAA,CAAA,KAAA,qBACG,IAAA,CAAA,KAAA,CAAM,IAAN,EAAA,EAAW,KAAO,EAAA,EAAE,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KAAM,CAAA,KAAA,CAAM,IAAI,CAAA;AAClC,EAAI,IAAA,CAAC,WAAkB,OAAA,IAAA;AAEvB,EAAA,2BACK,IAAK,EAAA,EAAA,GAAA,EAAK,MAAO,CAAA,SAAA,EACd,8BAAC,MACG,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAU,EAAA,EAAA,KAAA,EAAO,EAAE,KAAO,EAAA,MAAA,EAAQ,QAAQ,MAAO,EAAA,EAAG,GACzD,CACJ,EAAA,CAAA;AAER;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/notifier",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.1.0-dev.20250707115222",
|
|
5
5
|
"description": "Provides support for application-wide notifications.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"directory": "src/packages/notifier"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@chakra-ui/react": "^3.
|
|
17
|
+
"@chakra-ui/react": "^3.21.1",
|
|
18
18
|
"react-icons": "^5.5.0",
|
|
19
19
|
"react": "^19.1.0",
|
|
20
|
-
"@open-pioneer/core": "
|
|
21
|
-
"@open-pioneer/
|
|
22
|
-
"@open-pioneer/
|
|
20
|
+
"@open-pioneer/core": "4.1.0-dev.20250707115222",
|
|
21
|
+
"@open-pioneer/runtime": "4.1.0-dev.20250707115222",
|
|
22
|
+
"@open-pioneer/react-utils": "4.1.0-dev.20250707115222"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|