refactor(component): new notification center implemented with sonner (#6416)

The Notification has been reimplemented using sooner, no longer relies on jotai, and new story has been added.

- Before
  ```ts
  import { pushNotificationAtom } from '@affine/component/notification-center';
  import { useSetAtom } from 'jotai';

  export const Component = () => {
    const pushNotification = useSetAtom(pushNotificationAtom);
    pushNotification({ ... });
  }
  ```

- After
  ```ts
  import { notify } from "@affine/component";

  export const Component = () => {
    notify({ ... });
  }
  ```
This commit is contained in:
CatsJuice
2024-04-02 03:18:56 +00:00
parent 80c7750f4a
commit a4cd51e503
10 changed files with 583 additions and 0 deletions
+11
View File
@@ -296,6 +296,7 @@ __metadata:
react-transition-state: "npm:^2.1.1"
react-virtuoso: "npm:^4.7.0"
rxjs: "npm:^7.8.1"
sonner: "npm:^1.4.41"
storybook: "npm:^7.6.17"
storybook-dark-mode: "npm:^3.0.3"
swr: "npm:^2.2.5"
@@ -32745,6 +32746,16 @@ __metadata:
languageName: node
linkType: hard
"sonner@npm:^1.4.41":
version: 1.4.41
resolution: "sonner@npm:1.4.41"
peerDependencies:
react: ^18.0.0
react-dom: ^18.0.0
checksum: 10/f300db8b2603e72fad94d895935c17f13c93b91396333a7f77f028c1d0f605d9929ea0c36ead1df0b4ded66dfaa7a20c58cd9bd31b70f6efcd0fbcce91e4487f
languageName: node
linkType: hard
"sortablejs@npm:^1.15.2":
version: 1.15.2
resolution: "sortablejs@npm:1.15.2"