@mittwald/flow-react-components 0.2.0-alpha.136 → 0.2.0-alpha.138
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 +10 -0
- package/dist/js/components/src/components/NotificationProvider/NotificationController.mjs +3 -2
- package/dist/js/components/src/components/NotificationProvider/NotificationController.mjs.map +1 -1
- package/dist/types/components/NotificationProvider/NotificationController.d.ts +3 -3
- package/dist/types/components/NotificationProvider/NotificationController.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.138](https://github.com/mittwald/flow/compare/0.2.0-alpha.137...0.2.0-alpha.138) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
9
|
+
|
|
10
|
+
# [0.2.0-alpha.137](https://github.com/mittwald/flow/compare/0.2.0-alpha.136...0.2.0-alpha.137) (2025-04-10)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* return notification ID to allow manual closing ([#1359](https://github.com/mittwald/flow/issues/1359)) ([c67c7e2](https://github.com/mittwald/flow/commit/c67c7e22e90769ad063b0d8106c7924f8bbcac9e))
|
|
15
|
+
|
|
6
16
|
# [0.2.0-alpha.136](https://github.com/mittwald/flow/compare/0.2.0-alpha.135...0.2.0-alpha.136) (2025-04-10)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
+
import { useStatic } from '../../lib/hooks/useStatic.mjs';
|
|
3
4
|
import { useSelector } from '../../lib/mobx/useSelector.mjs';
|
|
4
|
-
import { makeObservable, action, observable } from 'mobx';
|
|
5
5
|
import { Timer } from '../../lib/timer/Timer.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { makeObservable, action, observable } from 'mobx';
|
|
7
7
|
|
|
8
8
|
class NotificationController {
|
|
9
9
|
notificationsData = /* @__PURE__ */ new Map();
|
|
@@ -37,6 +37,7 @@ class NotificationController {
|
|
|
37
37
|
this.remove(id);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
return id;
|
|
40
41
|
}
|
|
41
42
|
remove(id) {
|
|
42
43
|
this.notificationsData.delete(id);
|
package/dist/js/components/src/components/NotificationProvider/NotificationController.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationController.mjs","sources":["../../../../../../src/components/NotificationProvider/NotificationController.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"NotificationController.mjs","sources":["../../../../../../src/components/NotificationProvider/NotificationController.ts"],"sourcesContent":["import type { NotificationProps } from \"@/components/Notification\";\nimport { useStatic } from \"@/lib/hooks/useStatic\";\nimport useSelector from \"@/lib/mobx/useSelector\";\nimport Timer from \"@/lib/timer/Timer\";\nimport { action, makeObservable, observable } from \"mobx\";\nimport type { ReactElement } from \"react\";\n\ninterface NotificationMetaData {\n readonly id: number;\n readonly createdAt: number;\n readonly autoCloseTimer: Timer;\n}\n\nexport interface NotificationData {\n readonly element: ReactElement<NotificationProps>;\n readonly meta: NotificationMetaData;\n}\n\nexport class NotificationController {\n public readonly notificationsData = new Map<number, NotificationData>();\n private id = 0;\n\n public constructor() {\n makeObservable(this, {\n notificationsData: observable.shallow,\n add: action.bound,\n remove: action.bound,\n });\n }\n\n public static useNew(): NotificationController {\n return useStatic(() => new NotificationController());\n }\n\n public useNotifications(): NotificationData[] {\n return useSelector(() => Array.from(this.notificationsData.values()));\n }\n\n public add(notification: ReactElement<NotificationProps>): number {\n const id = this.id++;\n\n const meta: NotificationMetaData = {\n id,\n createdAt: Date.now(),\n autoCloseTimer: new Timer(),\n };\n\n this.notificationsData.set(id, {\n element: notification,\n meta,\n });\n\n if (notification.props.autoClose) {\n meta.autoCloseTimer.start({ seconds: 10 }, () => {\n this.remove(id);\n });\n }\n\n return id;\n }\n\n public remove(id: number): void {\n this.notificationsData.delete(id);\n }\n}\n\nexport default NotificationController;\n"],"names":[],"mappings":";;;;;AAkBO,MAAM,sBAAuB,CAAA;AAAA,EAClB,iBAAA,uBAAwB,GAA8B,EAAA;AAAA,EAC9D,EAAK,GAAA,CAAA;AAAA,EAEN,WAAc,GAAA;AACnB,IAAA,cAAA,CAAe,IAAM,EAAA;AAAA,MACnB,mBAAmB,UAAW,CAAA,OAAA;AAAA,MAC9B,KAAK,MAAO,CAAA,KAAA;AAAA,MACZ,QAAQ,MAAO,CAAA;AAAA,KAChB,CAAA;AAAA;AACH,EAEA,OAAc,MAAiC,GAAA;AAC7C,IAAA,OAAO,SAAU,CAAA,MAAM,IAAI,sBAAA,EAAwB,CAAA;AAAA;AACrD,EAEO,gBAAuC,GAAA;AAC5C,IAAO,OAAA,WAAA,CAAY,MAAM,KAAM,CAAA,IAAA,CAAK,KAAK,iBAAkB,CAAA,MAAA,EAAQ,CAAC,CAAA;AAAA;AACtE,EAEO,IAAI,YAAuD,EAAA;AAChE,IAAA,MAAM,KAAK,IAAK,CAAA,EAAA,EAAA;AAEhB,IAAA,MAAM,IAA6B,GAAA;AAAA,MACjC,EAAA;AAAA,MACA,SAAA,EAAW,KAAK,GAAI,EAAA;AAAA,MACpB,cAAA,EAAgB,IAAI,KAAM;AAAA,KAC5B;AAEA,IAAK,IAAA,CAAA,iBAAA,CAAkB,IAAI,EAAI,EAAA;AAAA,MAC7B,OAAS,EAAA,YAAA;AAAA,MACT;AAAA,KACD,CAAA;AAED,IAAI,IAAA,YAAA,CAAa,MAAM,SAAW,EAAA;AAChC,MAAA,IAAA,CAAK,eAAe,KAAM,CAAA,EAAE,OAAS,EAAA,EAAA,IAAM,MAAM;AAC/C,QAAA,IAAA,CAAK,OAAO,EAAE,CAAA;AAAA,OACf,CAAA;AAAA;AAGH,IAAO,OAAA,EAAA;AAAA;AACT,EAEO,OAAO,EAAkB,EAAA;AAC9B,IAAK,IAAA,CAAA,iBAAA,CAAkB,OAAO,EAAE,CAAA;AAAA;AAEpC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { default as Timer } from '../../lib/timer/Timer';
|
|
3
1
|
import { NotificationProps } from '../Notification';
|
|
2
|
+
import { default as Timer } from '../../lib/timer/Timer';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
4
|
interface NotificationMetaData {
|
|
5
5
|
readonly id: number;
|
|
6
6
|
readonly createdAt: number;
|
|
@@ -16,7 +16,7 @@ export declare class NotificationController {
|
|
|
16
16
|
constructor();
|
|
17
17
|
static useNew(): NotificationController;
|
|
18
18
|
useNotifications(): NotificationData[];
|
|
19
|
-
add(notification: ReactElement<NotificationProps>):
|
|
19
|
+
add(notification: ReactElement<NotificationProps>): number;
|
|
20
20
|
remove(id: number): void;
|
|
21
21
|
}
|
|
22
22
|
export default NotificationController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationController.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationProvider/NotificationController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NotificationController.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationProvider/NotificationController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;CACrC;AAED,qBAAa,sBAAsB;IACjC,SAAgB,iBAAiB,gCAAuC;IACxE,OAAO,CAAC,EAAE,CAAK;;WAUD,MAAM,IAAI,sBAAsB;IAIvC,gBAAgB,IAAI,gBAAgB,EAAE;IAItC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,CAAC,GAAG,MAAM;IAuB1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAGhC;AAED,eAAe,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.138",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@chakra-ui/live-region": "^2.1.0",
|
|
55
55
|
"@internationalized/string-compiler": "^3.2.6",
|
|
56
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
56
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.138",
|
|
57
57
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
58
58
|
"@react-aria/form": "^3.0.14",
|
|
59
59
|
"@react-aria/utils": "^3.28.1",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@faker-js/faker": "^9.6.0",
|
|
94
94
|
"@internationalized/date": "^3.7.0",
|
|
95
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
95
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.138",
|
|
96
96
|
"@mittwald/react-use-promise": "^2.6.0",
|
|
97
97
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
98
98
|
"@mittwald/typescript-config": "",
|
|
@@ -173,5 +173,5 @@
|
|
|
173
173
|
"optional": true
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
|
-
"gitHead": "
|
|
176
|
+
"gitHead": "dc3a2ae4d9542bce69c8408cf67282f59945dc6b"
|
|
177
177
|
}
|