diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-03-28 23:37:15 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-05-16 00:54:56 +0200 |
commit | 04555cc62c9cded08c3090288fa372d961c50737 (patch) | |
tree | 4566893892216446dfe24490c98881316b97cb41 /packages/shared | |
parent | design: Increase location bar UI density (diff) | |
download | sophie-04555cc62c9cded08c3090288fa372d961c50737.tar.gz sophie-04555cc62c9cded08c3090288fa372d961c50737.tar.zst sophie-04555cc62c9cded08c3090288fa372d961c50737.zip |
feat: New window banner
* Add renderer code for notification banners with buttons
* Handle new window open requests by denying them and displaying
a notification
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/shared')
-rw-r--r-- | packages/shared/src/schemas/ServiceAction.ts | 18 | ||||
-rw-r--r-- | packages/shared/src/stores/ServiceBase.ts | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/packages/shared/src/schemas/ServiceAction.ts b/packages/shared/src/schemas/ServiceAction.ts index da0b96b..cfaba08 100644 --- a/packages/shared/src/schemas/ServiceAction.ts +++ b/packages/shared/src/schemas/ServiceAction.ts | |||
@@ -49,6 +49,24 @@ export const ServiceAction = /* @__PURE__ */ (() => | |||
49 | z.object({ | 49 | z.object({ |
50 | action: z.literal('open-current-url-in-external-browser'), | 50 | action: z.literal('open-current-url-in-external-browser'), |
51 | }), | 51 | }), |
52 | z.object({ | ||
53 | action: z.literal('follow-popup'), | ||
54 | url: z.string(), | ||
55 | }), | ||
56 | z.object({ | ||
57 | action: z.literal('open-popup-in-external-browser'), | ||
58 | url: z.string(), | ||
59 | }), | ||
60 | z.object({ | ||
61 | action: z.literal('open-all-popups-in-external-browser'), | ||
62 | }), | ||
63 | z.object({ | ||
64 | action: z.literal('dismiss-popup'), | ||
65 | url: z.string(), | ||
66 | }), | ||
67 | z.object({ | ||
68 | action: z.literal('dismiss-all-popups'), | ||
69 | }), | ||
52 | ]))(); | 70 | ]))(); |
53 | 71 | ||
54 | /* | 72 | /* |
diff --git a/packages/shared/src/stores/ServiceBase.ts b/packages/shared/src/stores/ServiceBase.ts index c69f339..a19f59e 100644 --- a/packages/shared/src/stores/ServiceBase.ts +++ b/packages/shared/src/stores/ServiceBase.ts | |||
@@ -37,6 +37,7 @@ export function defineServiceModel<TS extends IAnyModelType>(settings: TS) { | |||
37 | state: ServiceState, | 37 | state: ServiceState, |
38 | directMessageCount: 0, | 38 | directMessageCount: 0, |
39 | indirectMessageCount: 0, | 39 | indirectMessageCount: 0, |
40 | popups: types.array(types.string), | ||
40 | }) | 41 | }) |
41 | .views((self) => ({ | 42 | .views((self) => ({ |
42 | get loading(): boolean { | 43 | get loading(): boolean { |