snackng 1.0.0 → 1.1.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 +18 -0
- package/README.md +151 -57
- package/fesm2022/snackng.mjs +28 -1
- package/fesm2022/snackng.mjs.map +1 -1
- package/package.json +1 -1
- package/types/snackng.d.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -12,8 +12,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
12
12
|
- Toasts now glide into the gap left by a dismissed neighbour instead of snapping to their new
|
|
13
13
|
position. Honours `prefers-reduced-motion`.
|
|
14
14
|
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Toasts are dismissible by default.** Every toast now renders its close button, because not
|
|
18
|
+
being able to close one is the more annoying default. Turn it off globally with
|
|
19
|
+
`provideSnackng({ dismissible: false })`, or per call with `{ dismissible: false }` — the
|
|
20
|
+
per-call value still wins over the global one either way.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `SnackngOverflow` is exported. It was already the declared type of the public
|
|
25
|
+
`SnackngConfig.overflow`, but could not be imported.
|
|
26
|
+
- Deep documentation under `docs/` — API reference, theming, recipes — linked from the README.
|
|
27
|
+
|
|
15
28
|
### Fixed
|
|
16
29
|
|
|
30
|
+
- **Custom types can be recoloured, as the docs always claimed.** `--snackng-<type>-bg`,
|
|
31
|
+
`-ink` and `-solid` were read by nothing: a type registered through `provideSnackng`
|
|
32
|
+
rendered with the `info` surface and no override reached it. A custom type's name is only
|
|
33
|
+
known at runtime, so the element now points at its own tokens. Types with no tokens set look
|
|
34
|
+
exactly as before.
|
|
17
35
|
- Bottom-anchored stacks no longer shimmer when a toast is added. The stack now fills the viewport
|
|
18
36
|
height instead of growing upward, so existing toasts keep a stable layout position and their
|
|
19
37
|
`backdrop-filter` is not re-rasterized on every add.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://deepwiki.com/xgreymx/snackng)
|
|
2
|
+
|
|
1
3
|
# snackng
|
|
2
4
|
|
|
3
5
|
Toasts for Angular with a glass design, **zero UI dependencies** and CSS-variable theming.
|
|
@@ -20,7 +22,7 @@ no theme tokens to define.
|
|
|
20
22
|
import { Component, inject } from '@angular/core';
|
|
21
23
|
import { SnackngService } from 'snackng';
|
|
22
24
|
|
|
23
|
-
@Component({
|
|
25
|
+
@Component({/* … */})
|
|
24
26
|
export class SyncPage {
|
|
25
27
|
private readonly toast = inject(SnackngService);
|
|
26
28
|
|
|
@@ -42,16 +44,19 @@ this.toast.warning('3 records left unreconciled.');
|
|
|
42
44
|
this.toast.danger('Could not reach the server.');
|
|
43
45
|
this.toast.info('Next sync at 18:00.');
|
|
44
46
|
|
|
45
|
-
// A title
|
|
46
|
-
this.toast.info('Import running…', { title: 'In progress', duration: 0
|
|
47
|
+
// A title and a longer life. The close button is already there.
|
|
48
|
+
this.toast.info('Import running…', { title: 'In progress', duration: 0 });
|
|
47
49
|
// duration: 0 means "stay until dismissed"
|
|
48
50
|
|
|
51
|
+
// Unless you don't want it.
|
|
52
|
+
this.toast.success('Saved.', { dismissible: false });
|
|
53
|
+
|
|
49
54
|
// An action button, and knowing how it ended.
|
|
50
55
|
const ref = this.toast.success('Movement deleted.', {
|
|
51
56
|
action: { label: 'Undo', handler: () => this.restore() },
|
|
52
57
|
});
|
|
53
|
-
ref.afterDismissed.then(reason => {}); // 'timeout' | 'action' | 'manual' | 'replaced'
|
|
54
|
-
ref.dismiss();
|
|
58
|
+
ref.afterDismissed.then((reason) => {}); // 'timeout' | 'action' | 'manual' | 'replaced'
|
|
59
|
+
ref.dismiss(); // close it yourself
|
|
55
60
|
|
|
56
61
|
// Somewhere other than the top-right.
|
|
57
62
|
this.toast.info('Down here.', { position: 'bottom-center' });
|
|
@@ -77,15 +82,15 @@ its internal MDC surface with `!important` — or ship Tailwind classes that ren
|
|
|
77
82
|
markup unless the consuming app happens to run the same CSS pipeline. snackng ships **compiled,
|
|
78
83
|
encapsulated CSS** and owns its own overlay, so it has neither problem.
|
|
79
84
|
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
| Peer dependencies
|
|
83
|
-
| Global CSS you must add
|
|
84
|
-
| Stacks multiple toasts
|
|
85
|
-
| Handles bursts
|
|
86
|
-
| SSR
|
|
87
|
-
| Respects `prefers-reduced-motion` | yes
|
|
88
|
-
| Angular
|
|
85
|
+
| | snackng |
|
|
86
|
+
| --------------------------------- | --------------------------------------------------------------- |
|
|
87
|
+
| Peer dependencies | `@angular/core`, `@angular/common`, `@angular/platform-browser` |
|
|
88
|
+
| Global CSS you must add | none |
|
|
89
|
+
| Stacks multiple toasts | yes (`MatSnackBar` shows one at a time) |
|
|
90
|
+
| Handles bursts | queued and staggered, never dropped |
|
|
91
|
+
| SSR | safe — no-ops on the server |
|
|
92
|
+
| Respects `prefers-reduced-motion` | yes |
|
|
93
|
+
| Angular | 21 and up |
|
|
89
94
|
|
|
90
95
|
## API
|
|
91
96
|
|
|
@@ -106,21 +111,77 @@ const ref = toast.success('Item deleted', {
|
|
|
106
111
|
action: { label: 'Undo', handler: () => restore() },
|
|
107
112
|
});
|
|
108
113
|
|
|
109
|
-
ref.
|
|
110
|
-
ref.dismiss();
|
|
114
|
+
ref.id; // 'sng-4'
|
|
115
|
+
ref.dismiss(); // close it yourself; resolves with 'manual'
|
|
116
|
+
ref.afterDismissed.then((reason) => console.log(reason));
|
|
111
117
|
```
|
|
112
118
|
|
|
119
|
+
`afterDismissed` is a **promise, so it resolves once, for that one toast, and never fires
|
|
120
|
+
again** — it is not a stream. It settles after the exit animation, with one of four reasons:
|
|
121
|
+
|
|
122
|
+
| Reason | When |
|
|
123
|
+
| ------------ | --------------------------------------------------------------- |
|
|
124
|
+
| `'timeout'` | `duration` elapsed. Never with `duration: 0`. |
|
|
125
|
+
| `'action'` | The action button was clicked (unless `dismissOnClick: false`). |
|
|
126
|
+
| `'manual'` | The close button, `ref.dismiss()`, or `dismissAll()`. |
|
|
127
|
+
| `'replaced'` | Evicted under `overflow: 'dismiss-oldest'`. |
|
|
128
|
+
|
|
129
|
+
To react to _every_ toast, attach it where you create them rather than keeping one ref —
|
|
130
|
+
[full details and edge cases](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/api.md#afterdismissed).
|
|
131
|
+
|
|
113
132
|
### Options
|
|
114
133
|
|
|
115
|
-
| Option
|
|
116
|
-
|
|
117
|
-
| `title`
|
|
118
|
-
| `duration`
|
|
119
|
-
| `action`
|
|
120
|
-
| `position`
|
|
121
|
-
| `dismissible` | `boolean`
|
|
122
|
-
| `politeness`
|
|
123
|
-
| `
|
|
134
|
+
| Option | Type | Default | |
|
|
135
|
+
| ------------- | -------------------------------------- | ----------- | ----------------------------------------- |
|
|
136
|
+
| `title` | `string` | — | Bold line above the message |
|
|
137
|
+
| `duration` | `number` | `5000` | ms before auto-dismiss; `0` keeps it open |
|
|
138
|
+
| `action` | `{ label, handler?, dismissOnClick? }` | — | Snackbar-style button |
|
|
139
|
+
| `position` | `SnackngPosition` | `'top-end'` | `top`/`bottom` × `start`/`center`/`end` |
|
|
140
|
+
| `dismissible` | `boolean` | `true` | Close button; `false` hides it |
|
|
141
|
+
| `politeness` | `'polite' \| 'assertive' \| 'off'` | by type | Screen-reader urgency |
|
|
142
|
+
| `style` | `SnackngStyle` | `'glass'` | Glass preset — see below |
|
|
143
|
+
| `effect` | `SnackngEffect` | `'drift'` | Surface light effect — see below |
|
|
144
|
+
| `panelClass` | `string \| string[]` | — | Extra classes on the toast element |
|
|
145
|
+
|
|
146
|
+
### Glass presets & surface effects
|
|
147
|
+
|
|
148
|
+
Don't want to hand-tune opacity and blur to get a look? Pick a **preset**. Each is a bundle of
|
|
149
|
+
glass settings, applied per call, globally, or via a chained shortcut — all three are equivalent:
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
toast.success('Saved', { style: 'solid' }); // per call
|
|
153
|
+
toast.success.solid('Saved'); // chained sugar (built-in types)
|
|
154
|
+
provideSnackng({ style: 'solid' }); // global default for every toast
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
| `style` | Look |
|
|
158
|
+
| --------------------- | -------------------------------------------------------------------------------- |
|
|
159
|
+
| `'glass'` _(default)_ | Rich translucent glass with depth |
|
|
160
|
+
| `'solid'` | Nearly opaque, a whisper of glass |
|
|
161
|
+
| `'translucent'` | More of the background shows through |
|
|
162
|
+
| `'transparent'` | Barely-there tint, very see-through |
|
|
163
|
+
| `'frosted'` | Heavy blur, high tint — classic frosted glass |
|
|
164
|
+
| `'flat'` | Fully opaque, no blur — flat design, and the cleanest `backdrop-filter` fallback |
|
|
165
|
+
|
|
166
|
+
Define your own with a `.sng-style--<name>` rule setting the five private aliases —
|
|
167
|
+
`--sng-p-tint`, `--sng-p-blur`, `--sng-p-spec`, `--sng-p-spec-size`, `--sng-p-drift-dur` — and
|
|
168
|
+
pass `{ style: '<name>' }`. **The rule has to be global**; under Angular's default emulated
|
|
169
|
+
encapsulation it silently does nothing. Same goes for `panelClass`.
|
|
170
|
+
[Example and preset values](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/theming.md#writing-your-own-preset).
|
|
171
|
+
|
|
172
|
+
`effect` adds subtle motion/light to the glass surface — it never touches the enter/exit
|
|
173
|
+
animations:
|
|
174
|
+
|
|
175
|
+
| `effect` | Behaviour |
|
|
176
|
+
| --------------------- | --------------------------------------------------- |
|
|
177
|
+
| `'drift'` _(default)_ | A slow specular highlight drifts across the surface |
|
|
178
|
+
| `'glare'` | The highlight follows the pointer (hover) |
|
|
179
|
+
| `'both'` | Drift when idle, glare on hover |
|
|
180
|
+
| `'none'` | Static glass, no light motion |
|
|
181
|
+
|
|
182
|
+
Both `drift` and the drift half of `both` stop under `prefers-reduced-motion: reduce`.
|
|
183
|
+
`'glare'` needs a pointer, so it is inert on touch — use `'both'` if touch users should still
|
|
184
|
+
get the drift.
|
|
124
185
|
|
|
125
186
|
### Global defaults
|
|
126
187
|
|
|
@@ -132,13 +193,15 @@ import { provideSnackng } from 'snackng';
|
|
|
132
193
|
bootstrapApplication(App, {
|
|
133
194
|
providers: [
|
|
134
195
|
provideSnackng({
|
|
135
|
-
duration: 4000,
|
|
196
|
+
duration: 4000, // ms; 0 = stay until dismissed
|
|
136
197
|
position: 'bottom-end',
|
|
137
|
-
max: 5,
|
|
138
|
-
overflow: 'queue',
|
|
139
|
-
stagger: 90,
|
|
140
|
-
pauseOnHover: true,
|
|
141
|
-
dismissible: false
|
|
198
|
+
max: 5, // visible at once
|
|
199
|
+
overflow: 'queue', // 'queue' | 'dismiss-oldest'
|
|
200
|
+
stagger: 90, // ms between releases; 0 = all at once
|
|
201
|
+
pauseOnHover: true, // also pauses on keyboard focus
|
|
202
|
+
dismissible: true, // close button on every toast; false hides them all
|
|
203
|
+
style: 'glass', // default glass preset for every toast
|
|
204
|
+
effect: 'drift', // 'drift' | 'glare' | 'both' | 'none'
|
|
142
205
|
types: {
|
|
143
206
|
deploy: { icon: '<svg viewBox="0 0 24 24"><path d="..."/></svg>' },
|
|
144
207
|
},
|
|
@@ -160,7 +223,10 @@ The trade-off is honest: a flood of 50 errors becomes a long parade. If you'd ra
|
|
|
160
223
|
always win, `overflow: 'dismiss-oldest'` evicts the oldest visible toast to make room, and those
|
|
161
224
|
resolve `afterDismissed` with `'replaced'`.
|
|
162
225
|
|
|
163
|
-
Custom types
|
|
226
|
+
### Custom types
|
|
227
|
+
|
|
228
|
+
Register one through `provideSnackng`, then emit it with `show`. It starts from the neutral
|
|
229
|
+
surface and is recoloured through its own variables:
|
|
164
230
|
|
|
165
231
|
```ts
|
|
166
232
|
toast.show('deploy', 'Version 2.4.0 is now live in production.');
|
|
@@ -170,6 +236,7 @@ toast.show('deploy', 'Version 2.4.0 is now live in production.');
|
|
|
170
236
|
:root {
|
|
171
237
|
--snackng-deploy-bg: linear-gradient(135deg, #7c3aed, #4c1d95);
|
|
172
238
|
--snackng-deploy-ink: #ffffff;
|
|
239
|
+
--snackng-deploy-solid: #6d28d9; /* where backdrop-filter is unsupported */
|
|
173
240
|
}
|
|
174
241
|
```
|
|
175
242
|
|
|
@@ -190,42 +257,58 @@ variables anywhere they inherit to the toast (`:root` is simplest).
|
|
|
190
257
|
}
|
|
191
258
|
```
|
|
192
259
|
|
|
193
|
-
| Variable
|
|
194
|
-
|
|
195
|
-
| `--snackng-{type}-bg`
|
|
196
|
-
| `--snackng-{type}-ink`
|
|
197
|
-
| `--snackng-{type}-solid`
|
|
198
|
-
| `--snackng-
|
|
199
|
-
| `--snackng-
|
|
200
|
-
| `--snackng-
|
|
201
|
-
| `--snackng-
|
|
202
|
-
| `--snackng-
|
|
203
|
-
| `--snackng-
|
|
204
|
-
| `--snackng-
|
|
205
|
-
| `--snackng-
|
|
206
|
-
| `--snackng-
|
|
207
|
-
| `--snackng-
|
|
208
|
-
| `--snackng-
|
|
209
|
-
| `--snackng-
|
|
210
|
-
| `--snackng-
|
|
211
|
-
| `--snackng-
|
|
212
|
-
| `--snackng-
|
|
213
|
-
| `--snackng-
|
|
260
|
+
| Variable | Default |
|
|
261
|
+
| ------------------------------------------------------ | ------------------------------------------------------ |
|
|
262
|
+
| `--snackng-{type}-bg` | glass gradient per type |
|
|
263
|
+
| `--snackng-{type}-ink` | `#ffffff` |
|
|
264
|
+
| `--snackng-{type}-solid` | opaque fallback where `backdrop-filter` is unsupported |
|
|
265
|
+
| `--snackng-tint` | `0.86` — tint opacity (how much shows through) |
|
|
266
|
+
| `--snackng-radius` | `14px` |
|
|
267
|
+
| `--snackng-blur` | `20px` |
|
|
268
|
+
| `--snackng-saturate` | `180%` |
|
|
269
|
+
| `--snackng-brightness` | `1.06` |
|
|
270
|
+
| `--snackng-gloss` | `0.22` — static highlight strength |
|
|
271
|
+
| `--snackng-spec-strength` / `--snackng-spec-size` | `0.15` / `30%` — drift & glare reflection |
|
|
272
|
+
| `--snackng-drift-duration` | `4s` — only affects `drift` / `both` |
|
|
273
|
+
| `--snackng-blur-reduced` | `10px` — under `prefers-reduced-motion` |
|
|
274
|
+
| `--snackng-shift` | `28px` — enter/exit travel; `0` under reduced motion |
|
|
275
|
+
| `--snackng-action-size` / `--snackng-action-weight` | `13px` / `600` |
|
|
276
|
+
| `--snackng-border` | `1px solid rgba(255,255,255,.22)` |
|
|
277
|
+
| `--snackng-shadow` | layered drop + inner highlight |
|
|
278
|
+
| `--snackng-min-width` / `--snackng-max-width` | `340px` / `460px` |
|
|
279
|
+
| `--snackng-padding` | `14px 18px` |
|
|
280
|
+
| `--snackng-gap` | `14px` |
|
|
281
|
+
| `--snackng-font` | `'Manrope', system-ui, sans-serif` |
|
|
282
|
+
| `--snackng-title-size` / `--snackng-title-weight` | `14px` / `700` |
|
|
283
|
+
| `--snackng-message-size` / `--snackng-message-weight` | `13px` / `400` |
|
|
284
|
+
| `--snackng-line-height` | `1.45` |
|
|
285
|
+
| `--snackng-enter-duration` / `--snackng-exit-duration` | `400ms` / `200ms` |
|
|
286
|
+
| `--snackng-z` | `2000` |
|
|
287
|
+
| `--snackng-stack-gap` / `--snackng-stack-padding` | `12px` / `16px` |
|
|
214
288
|
|
|
215
289
|
`{type}` is `success`, `warning`, `danger`, `info`, or any custom type you register.
|
|
216
290
|
|
|
291
|
+
Your `:root` values beat presets, which beat the library defaults — the library never declares
|
|
292
|
+
a public token on the toast itself, precisely so your override wins. Note that replacing
|
|
293
|
+
`--snackng-{type}-bg` with a flat gradient disconnects `--snackng-tint` for that type, and that
|
|
294
|
+
`-solid` is only used where `backdrop-filter` is unsupported.
|
|
295
|
+
[Every variable, with the reasoning](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/theming.md).
|
|
296
|
+
|
|
217
297
|
### Using daisyUI?
|
|
218
298
|
|
|
219
299
|
snackng does **not** depend on daisyUI or Tailwind. If you happen to use them, one optional import
|
|
220
300
|
re-points the toast at your daisy theme, so it follows theme switching and dark mode for free:
|
|
221
301
|
|
|
222
302
|
```css
|
|
223
|
-
@import
|
|
303
|
+
@import 'snackng/themes/daisy.css';
|
|
224
304
|
```
|
|
225
305
|
|
|
226
|
-
That maps
|
|
227
|
-
|
|
228
|
-
the glass and only borrow the hues, skip the import and set the variables
|
|
306
|
+
That maps the twelve colour variables plus `--snackng-radius` and `--snackng-font` onto daisyUI
|
|
307
|
+
semantics (note `danger` → `--color-error`). It trades the glass gradients for daisy's flat theme
|
|
308
|
+
colours — to keep the glass and only borrow the hues, skip the import and set the variables
|
|
309
|
+
yourself. Two gotchas: `--snackng-font: inherit` drops Manrope, and the bridge declares on
|
|
310
|
+
`:root`, so a `data-theme` set on a subtree rather than `<html>` will not reach the toasts.
|
|
311
|
+
[Full mapping](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/theming.md#using-daisyui).
|
|
229
312
|
|
|
230
313
|
## Accessibility
|
|
231
314
|
|
|
@@ -237,6 +320,17 @@ the glass and only borrow the hues, skip the import and set the variables yourse
|
|
|
237
320
|
The library never overrides that OS setting on your behalf.
|
|
238
321
|
- Timers pause on hover **and** on keyboard focus, so a toast can't vanish mid-read.
|
|
239
322
|
|
|
323
|
+
## Documentation
|
|
324
|
+
|
|
325
|
+
This README is the tour. The details live next to the source:
|
|
326
|
+
|
|
327
|
+
- **[API reference](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/api.md)** — every export, every option, `SnackngRef` and
|
|
328
|
+
`afterDismissed`, the precedence rules, SSR behaviour.
|
|
329
|
+
- **[Theming](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/theming.md)** — all 40-odd CSS variables with defaults, the cascade,
|
|
330
|
+
writing your own preset, the daisyUI bridge.
|
|
331
|
+
- **[Recipes](https://github.com/xgreymx/snackng/blob/main/projects/snackng/docs/recipes.md)** — HTTP interceptor, undo, custom types, wrapping the
|
|
332
|
+
service, accessibility notes.
|
|
333
|
+
|
|
240
334
|
## License
|
|
241
335
|
|
|
242
336
|
Apache-2.0
|
package/fesm2022/snackng.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const SNACKNG_DEFAULTS = {
|
|
|
10
10
|
overflow: 'queue',
|
|
11
11
|
stagger: 90,
|
|
12
12
|
pauseOnHover: true,
|
|
13
|
-
dismissible:
|
|
13
|
+
dismissible: true,
|
|
14
14
|
style: 'glass',
|
|
15
15
|
effect: 'drift',
|
|
16
16
|
types: {},
|
|
@@ -279,6 +279,9 @@ class SnackngToast {
|
|
|
279
279
|
return custom ? this.sanitizer.bypassSecurityTrustHtml(custom) : null;
|
|
280
280
|
}, ...(ngDevMode ? [{ debugName: "iconSvg" }] : /* istanbul ignore next */ []));
|
|
281
281
|
constructor() {
|
|
282
|
+
effect(() => {
|
|
283
|
+
this.applyCustomTypeColours();
|
|
284
|
+
});
|
|
282
285
|
effect(() => {
|
|
283
286
|
if (this.item().leaving) {
|
|
284
287
|
this.stopTimer();
|
|
@@ -295,6 +298,30 @@ class SnackngToast {
|
|
|
295
298
|
}
|
|
296
299
|
});
|
|
297
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Points a custom type's surface at its own `--snackng-<type>-*` tokens.
|
|
303
|
+
*
|
|
304
|
+
* The built-ins get theirs from a `:host(.sng--success)` rule, but a custom
|
|
305
|
+
* type's name is only known at runtime, so no stylesheet can name its tokens
|
|
306
|
+
* — the element has to. Written as properties (not `style=`) so the glare's
|
|
307
|
+
* inline `--sng-glare-*` writes survive.
|
|
308
|
+
*
|
|
309
|
+
* The fallbacks are the neutral surface `:host` already resolves to, so a
|
|
310
|
+
* type with no tokens set looks exactly as it did before.
|
|
311
|
+
*/
|
|
312
|
+
applyCustomTypeColours() {
|
|
313
|
+
const type = this.item().type;
|
|
314
|
+
// SNACKNG_ICONS is keyed by the built-ins, which own a :host rule already.
|
|
315
|
+
if (type in SNACKNG_ICONS) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const style = this.element.nativeElement.style;
|
|
319
|
+
style.setProperty('--sng-bg', `var(--snackng-${type}-bg, linear-gradient(135deg, ` +
|
|
320
|
+
`rgb(var(--sng-c1) / var(--sng-tint)), ` +
|
|
321
|
+
`rgb(var(--sng-c2) / calc(var(--sng-tint) - 0.06))))`);
|
|
322
|
+
style.setProperty('--sng-ink', `var(--snackng-${type}-ink, #ffffff)`);
|
|
323
|
+
style.setProperty('--sng-solid', `var(--snackng-${type}-solid, #47556a)`);
|
|
324
|
+
}
|
|
298
325
|
/** Writes the cursor position into CSS vars the glare layer reads. Runs
|
|
299
326
|
* outside Angular — it only mutates style, no change detection needed. */
|
|
300
327
|
bindGlare() {
|
package/fesm2022/snackng.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snackng.mjs","sources":["../../../projects/snackng/src/lib/snackng.config.ts","../../../projects/snackng/src/lib/live-region.ts","../../../projects/snackng/src/lib/icons.ts","../../../projects/snackng/src/lib/snackng.store.ts","../../../projects/snackng/src/lib/snackng-toast/snackng-toast.ts","../../../projects/snackng/src/lib/snackng-toast/snackng-toast.html","../../../projects/snackng/src/lib/snackng-host/snackng-host.ts","../../../projects/snackng/src/lib/snackng-host/snackng-host.html","../../../projects/snackng/src/lib/snackng.service.ts","../../../projects/snackng/src/public-api.ts","../../../projects/snackng/src/snackng.ts"],"sourcesContent":["import { InjectionToken, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport {\n SnackngEffect,\n SnackngOverflow,\n SnackngPosition,\n SnackngStyle,\n SnackngTypeDef,\n} from './snackng.model';\n\nexport interface SnackngConfig {\n duration: number;\n position: SnackngPosition;\n /** Maximum toasts on screen at once. Extras are handled per `overflow`. */\n max: number;\n /**\n * What happens when a toast arrives while `max` are already visible.\n * `'queue'` waits for a free slot — nothing is ever lost, but a flood becomes\n * a long parade. `'dismiss-oldest'` evicts the oldest to make room, so the\n * newest always wins; useful when an interceptor can emit toasts in bursts.\n */\n overflow: SnackngOverflow;\n /**\n * Milliseconds between releasing consecutive queued toasts. Staggering keeps\n * a burst from firing every enter animation at the same instant. `0` releases\n * as many as fit at once.\n */\n stagger: number;\n pauseOnHover: boolean;\n dismissible: boolean;\n /** Default glass preset for every toast. Overridable per call via `options.style`. */\n style: SnackngStyle;\n /** Default surface light effect. Overridable per call via `options.effect`. */\n effect: SnackngEffect;\n types: Record<string, SnackngTypeDef>;\n}\n\nexport const SNACKNG_DEFAULTS: SnackngConfig = {\n duration: 5000,\n position: 'top-end',\n max: 5,\n overflow: 'queue',\n stagger: 90,\n pauseOnHover: true,\n dismissible: false,\n style: 'glass',\n effect: 'drift',\n types: {},\n};\n\nexport const SNACKNG_CONFIG = new InjectionToken<SnackngConfig>('snackng.config', {\n providedIn: 'root',\n factory: () => SNACKNG_DEFAULTS,\n});\n\n/**\n * Optional. Without it the defaults above apply, so `npm i snackng` and calling\n * the service is enough to get working toasts.\n */\nexport function provideSnackng(config: Partial<SnackngConfig> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: SNACKNG_CONFIG,\n useValue: {\n ...SNACKNG_DEFAULTS,\n ...config,\n types: { ...SNACKNG_DEFAULTS.types, ...config.types },\n } satisfies SnackngConfig,\n },\n ]);\n}\n","import { DOCUMENT, Injectable, OnDestroy, inject } from '@angular/core';\nimport { SnackngPoliteness } from './snackng.model';\n\n/**\n * Announces toast text to screen readers, in place of the CDK `LiveAnnouncer`.\n *\n * The toast markup carries no `aria-live` of its own: text is copied into this\n * off-screen region instead. Keep it that way — a live region nested inside\n * another throws `HierarchyRequestError` when the outer one relocates its\n * content.\n */\n@Injectable({ providedIn: 'root' })\nexport class SnackngLiveRegion implements OnDestroy {\n private readonly document = inject(DOCUMENT);\n private region?: HTMLElement;\n private clearTimer?: ReturnType<typeof setTimeout>;\n\n announce(message: string, politeness: SnackngPoliteness = 'polite'): void {\n if (politeness === 'off' || !message) {\n return;\n }\n\n const region = this.ensureRegion();\n region.setAttribute('aria-live', politeness);\n\n // Clearing first forces assistive tech to treat an identical repeated\n // message as a new announcement.\n region.textContent = '';\n clearTimeout(this.clearTimer);\n this.clearTimer = setTimeout(() => (region.textContent = message), 100);\n }\n\n private ensureRegion(): HTMLElement {\n if (this.region?.isConnected) {\n return this.region;\n }\n\n const region = this.document.createElement('div');\n region.setAttribute('aria-atomic', 'true');\n region.setAttribute('aria-live', 'polite');\n region.classList.add('sng-live-region');\n // Visually hidden but still announced: `display:none` would silence it.\n region.style.cssText =\n 'position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;' +\n 'clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;';\n\n this.document.body.appendChild(region);\n this.region = region;\n return region;\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.clearTimer);\n this.region?.remove();\n this.region = undefined;\n }\n}\n","import { SnackngBuiltInType } from './snackng.model';\n\n/**\n * Path data for the built-in glyphs, inlined so the package never requires an\n * icon font. Bound with `[attr.d]`, so no sanitizer is involved.\n */\nexport const SNACKNG_ICONS: Record<SnackngBuiltInType, string> = {\n success: 'M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z',\n warning: 'M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z',\n danger:\n 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z',\n info: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z',\n};\n","import { Injectable, OnDestroy, computed, inject, signal } from '@angular/core';\nimport { SNACKNG_CONFIG } from './snackng.config';\nimport {\n SnackngAction,\n SnackngDismissReason,\n SnackngEffect,\n SnackngPoliteness,\n SnackngPosition,\n SnackngStyle,\n SnackngType,\n} from './snackng.model';\n\nexport interface SnackngItem {\n readonly id: string;\n readonly type: SnackngType;\n readonly message: string;\n readonly title?: string;\n readonly duration: number;\n readonly position: SnackngPosition;\n readonly dismissible: boolean;\n readonly action?: SnackngAction;\n readonly style: SnackngStyle;\n readonly effect: SnackngEffect;\n readonly panelClass: readonly string[];\n readonly politeness: SnackngPoliteness;\n /** Set while the exit animation runs; the item is still in the DOM. */\n readonly leaving: boolean;\n}\n\nexport interface SnackngStack {\n readonly position: SnackngPosition;\n readonly items: readonly SnackngItem[];\n}\n\n/**\n * Toast state, and the pacing of how toasts reach the screen.\n *\n * Producer/consumer: `add` only enqueues; `pump` is the sole consumer moving\n * items into view as capacity allows. Releasing directly would let a burst\n * render in one tick, appearing and evicting itself in the same frame.\n *\n * Separate from `SnackngService` so the service can create the host while the\n * host reads state, without an import cycle.\n */\n@Injectable({ providedIn: 'root' })\nexport class SnackngStore implements OnDestroy {\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly resolvers = new Map<string, (reason: SnackngDismissReason) => void>();\n private readonly reasons = new Map<string, SnackngDismissReason>();\n private pumpTimer?: ReturnType<typeof setTimeout>;\n private lastReleaseAt = 0;\n private counter = 0;\n\n /** Toasts currently rendered (including those playing their exit animation). */\n readonly items = signal<readonly SnackngItem[]>([]);\n /** Toasts accepted but still waiting for a free slot. */\n readonly queue = signal<readonly SnackngItem[]>([]);\n readonly pending = computed(() => this.queue().length);\n\n readonly stacks = computed<readonly SnackngStack[]>(() => {\n const byPosition = new Map<SnackngPosition, SnackngItem[]>();\n for (const item of this.items()) {\n const bucket = byPosition.get(item.position);\n bucket ? bucket.push(item) : byPosition.set(item.position, [item]);\n }\n return [...byPosition].map(([position, items]) => ({ position, items }));\n });\n\n add(item: Omit<SnackngItem, 'id' | 'leaving'>): {\n id: string;\n afterDismissed: Promise<SnackngDismissReason>;\n } {\n const id = `sng-${++this.counter}`;\n const afterDismissed = new Promise<SnackngDismissReason>((resolve) =>\n this.resolvers.set(id, resolve),\n );\n\n this.queue.update((queue) => [...queue, { ...item, id, leaving: false }]);\n this.pump();\n\n return { id, afterDismissed };\n }\n\n /**\n * Starts the exit animation; the item leaves the DOM on `finalize`. A toast\n * still queued is dropped outright, having never been shown.\n */\n dismiss(id: string, reason: SnackngDismissReason = 'manual'): void {\n if (this.queue().some((item) => item.id === id)) {\n this.queue.update((queue) => queue.filter((item) => item.id !== id));\n this.resolve(id, reason);\n return;\n }\n\n const target = this.items().find((item) => item.id === id);\n if (!target || target.leaving) {\n return;\n }\n this.reasons.set(id, reason);\n this.items.update((items) => items.map((i) => (i.id === id ? { ...i, leaving: true } : i)));\n }\n\n /** Removes the item and resolves its `afterDismissed` promise. */\n finalize(id: string): void {\n if (!this.resolvers.has(id)) {\n return;\n }\n this.items.update((items) => items.filter((item) => item.id !== id));\n this.resolve(id, this.reasons.get(id) ?? 'manual');\n this.reasons.delete(id);\n this.pump();\n }\n\n dismissAll(reason: SnackngDismissReason = 'manual'): void {\n // Drain the queue first, or it would march onto a screen just cleared.\n clearTimeout(this.pumpTimer);\n this.pumpTimer = undefined;\n for (const item of this.queue()) {\n this.resolve(item.id, reason);\n }\n this.queue.set([]);\n\n for (const item of this.items()) {\n this.dismiss(item.id, reason);\n }\n }\n\n /** The consumer. Runs on every add and every finalize. */\n private pump(): void {\n if (this.pumpTimer) {\n return; // a staggered release is already pending\n }\n\n while (this.queue().length) {\n // Counts leaving toasts too: they hold their slot until finalize removes\n // them, so ignoring them reads an expiring batch as free space.\n const onScreen = this.items();\n\n if (onScreen.length >= this.config.max) {\n if (this.config.overflow === 'dismiss-oldest') {\n // Evicting an already-leaving toast frees nothing.\n const victim = onScreen.find((item) => !item.leaving);\n if (victim) {\n this.dismiss(victim.id, 'replaced');\n }\n }\n return;\n }\n\n // Spaced by elapsed time, not queue length: callers add one at a time, so\n // a burst arrives as N pumps of one item and would never wait.\n const wait = this.config.stagger - (Date.now() - this.lastReleaseAt);\n if (this.config.stagger > 0 && wait > 0) {\n this.pumpTimer = setTimeout(() => {\n this.pumpTimer = undefined;\n this.pump();\n }, wait);\n return;\n }\n\n const [next, ...rest] = this.queue();\n this.queue.set(rest);\n this.items.update((items) => [...items, next]);\n this.lastReleaseAt = Date.now();\n }\n }\n\n private resolve(id: string, reason: SnackngDismissReason): void {\n this.resolvers.get(id)?.(reason);\n this.resolvers.delete(id);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.pumpTimer);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n OnDestroy,\n computed,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { SNACKNG_CONFIG } from '../snackng.config';\nimport { SNACKNG_ICONS } from '../icons';\nimport { SnackngBuiltInType } from '../snackng.model';\nimport { SnackngItem, SnackngStore } from '../snackng.store';\n\nconst EXIT_DURATION = 200;\n/** Guards against `animationend` never firing (reduced motion, jsdom, backgrounded tab). */\nconst EXIT_FALLBACK = EXIT_DURATION + 150;\n\n@Component({\n selector: 'sng-toast',\n templateUrl: './snackng-toast.html',\n styleUrl: './snackng-toast.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'hostClasses()',\n '(mouseenter)': 'pause()',\n '(mouseleave)': 'resume()',\n '(focusin)': 'pause()',\n '(focusout)': 'resume()',\n },\n})\nexport class SnackngToast implements OnDestroy {\n readonly item = input.required<SnackngItem>();\n\n private readonly store = inject(SnackngStore);\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n private timer?: ReturnType<typeof setTimeout>;\n private exitTimer?: ReturnType<typeof setTimeout>;\n private armed = false;\n private remaining = 0;\n private startedAt = 0;\n private glareBound = false;\n\n protected readonly hostClasses = computed(() => {\n const item = this.item();\n const classes = [\n 'sng-toast',\n `sng--${item.type}`,\n `sng-at--${item.position}`,\n `sng-style--${item.style}`,\n item.leaving ? 'sng-leaving' : 'sng-entering',\n ...item.panelClass,\n ];\n if (item.effect === 'drift' || item.effect === 'both') {\n classes.push('sng-fx--drift');\n }\n if (item.effect === 'glare' || item.effect === 'both') {\n classes.push('sng-fx--glare');\n }\n return classes.join(' ');\n });\n\n /** Whether this toast tracks the pointer for the cursor glare effect. */\n protected readonly glareEnabled = computed(() => {\n const fx = this.item().effect;\n return fx === 'glare' || fx === 'both';\n });\n\n /** Null when the type brings its own SVG; unknown types fall back to `info`. */\n protected readonly iconPath = computed<string | null>(() => {\n const type = this.item().type;\n if (this.config.types[type]?.icon) {\n return null;\n }\n return SNACKNG_ICONS[type as SnackngBuiltInType] ?? SNACKNG_ICONS.info;\n });\n\n /** Custom types may supply raw SVG markup, trusted as authored config. */\n protected readonly iconSvg = computed<SafeHtml | null>(() => {\n const custom = this.config.types[this.item().type]?.icon;\n return custom ? this.sanitizer.bypassSecurityTrustHtml(custom) : null;\n });\n\n constructor() {\n effect(() => {\n if (this.item().leaving) {\n this.stopTimer();\n this.scheduleFinalize();\n } else {\n this.startTimer();\n }\n });\n\n // Bind pointer tracking once, only if this toast uses the glare effect.\n effect(() => {\n if (this.glareEnabled() && !this.glareBound) {\n this.bindGlare();\n }\n });\n }\n\n /** Writes the cursor position into CSS vars the glare layer reads. Runs\n * outside Angular — it only mutates style, no change detection needed. */\n private bindGlare(): void {\n this.glareBound = true;\n const el = this.element.nativeElement;\n this.zone.runOutsideAngular(() => {\n el.addEventListener('pointermove', this.onGlareMove);\n el.addEventListener('pointerleave', this.onGlareLeave);\n });\n }\n\n private readonly onGlareMove = (event: PointerEvent): void => {\n const el = this.element.nativeElement;\n const rect = el.getBoundingClientRect();\n if (!rect.width || !rect.height) {\n return;\n }\n el.style.setProperty('--sng-glare-x', `${((event.clientX - rect.left) / rect.width) * 100}%`);\n el.style.setProperty('--sng-glare-y', `${((event.clientY - rect.top) / rect.height) * 100}%`);\n el.style.setProperty('--sng-glare-op', '1');\n };\n\n private readonly onGlareLeave = (): void => {\n this.element.nativeElement.style.setProperty('--sng-glare-op', '0');\n };\n\n protected onAction(): void {\n const action = this.item().action;\n action?.handler?.();\n if (action?.dismissOnClick !== false) {\n this.store.dismiss(this.item().id, 'action');\n }\n }\n\n protected onDismiss(): void {\n this.store.dismiss(this.item().id, 'manual');\n }\n\n protected pause(): void {\n if (!this.config.pauseOnHover || !this.timer) {\n return;\n }\n this.remaining -= Date.now() - this.startedAt;\n clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n protected resume(): void {\n if (!this.config.pauseOnHover || this.timer || this.remaining <= 0 || this.item().leaving) {\n return;\n }\n this.arm(this.remaining);\n }\n\n /** Arms once per toast: re-running on later item updates would reset a paused timer. */\n private startTimer(): void {\n const duration = this.item().duration;\n if (this.armed || duration <= 0) {\n return;\n }\n this.armed = true;\n this.remaining = duration;\n this.arm(duration);\n }\n\n private arm(ms: number): void {\n this.startedAt = Date.now();\n this.timer = setTimeout(() => this.store.dismiss(this.item().id, 'timeout'), ms);\n }\n\n private stopTimer(): void {\n clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private scheduleFinalize(): void {\n if (this.exitTimer) {\n return;\n }\n const finalize = () => {\n clearTimeout(this.exitTimer);\n this.store.finalize(this.item().id);\n };\n this.element.nativeElement.addEventListener('animationend', finalize, { once: true });\n this.exitTimer = setTimeout(finalize, EXIT_FALLBACK);\n }\n\n ngOnDestroy(): void {\n this.stopTimer();\n clearTimeout(this.exitTimer);\n if (this.glareBound) {\n const el = this.element.nativeElement;\n el.removeEventListener('pointermove', this.onGlareMove);\n el.removeEventListener('pointerleave', this.onGlareLeave);\n }\n }\n}\n","@let toast = item();\n\n<!-- No aria-live here: SnackngLiveRegion announces instead. -->\n@if (glareEnabled()) {\n <div class=\"sng-glare\" aria-hidden=\"true\"></div>\n}\n\n<div class=\"sng-icon\" aria-hidden=\"true\">\n @if (iconPath(); as path) {\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <path [attr.d]=\"path\" fill=\"currentColor\" />\n </svg>\n } @else {\n <span class=\"sng-icon-custom\" [innerHTML]=\"iconSvg()\"></span>\n }\n</div>\n\n<div class=\"sng-body\">\n @if (toast.title) {\n <p class=\"sng-title\">{{ toast.title }}</p>\n }\n <p class=\"sng-message\">{{ toast.message }}</p>\n</div>\n\n@if (toast.action; as action) {\n <button type=\"button\" class=\"sng-action\" (click)=\"onAction()\">{{ action.label }}</button>\n}\n\n@if (toast.dismissible) {\n <button type=\"button\" class=\"sng-close\" (click)=\"onDismiss()\" aria-label=\"Close notification\">\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterEveryRender,\n inject,\n} from '@angular/core';\nimport { SnackngToast } from '../snackng-toast/snackng-toast';\nimport { SnackngStore } from '../snackng.store';\n\nconst SHIFT_DURATION = 260;\nconst SHIFT_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';\n\n/** Guarded: test environments such as jsdom render without `matchMedia`. */\nfunction prefersReducedMotion(): boolean {\n return (\n typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n\n@Component({\n selector: 'sng-host',\n imports: [SnackngToast],\n templateUrl: './snackng-host.html',\n styleUrl: './snackng-host.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackngHost {\n private readonly store = inject(SnackngStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly stacks = this.store.stacks;\n\n private readonly offsets = new Map<string, number>();\n private readonly shifts = new Map<string, Animation>();\n\n constructor() {\n afterEveryRender(() => this.absorbLayoutShift());\n }\n\n /**\n * FLIP: offset each slot back to where it was, then animate that offset away,\n * so neighbours glide into a freed gap instead of snapping.\n *\n * Measured with `offsetTop` rather than `getBoundingClientRect`: the latter\n * includes transforms and would read an in-flight shift instead of the layout\n * beneath it. Stacks are full height and top-anchored, so a slot's offsetTop\n * only changes when it truly moves. Applied to the slot, never the toast, to\n * leave the toast's own enter/exit transform alone.\n */\n private absorbLayoutShift(): void {\n const slots = this.element.nativeElement.querySelectorAll<HTMLElement>('.sng-slot');\n const present = new Set<string>();\n\n for (const slot of slots) {\n const id = slot.dataset['sngId'];\n if (!id) {\n continue;\n }\n present.add(id);\n\n const top = slot.offsetTop;\n const previous = this.offsets.get(id);\n this.offsets.set(id, top);\n\n if (previous === undefined || previous === top || prefersReducedMotion()) {\n continue;\n }\n\n this.shifts.get(id)?.cancel();\n this.shifts.set(\n id,\n slot.animate([{ transform: `translateY(${previous - top}px)` }, { transform: 'none' }], {\n duration: SHIFT_DURATION,\n easing: SHIFT_EASING,\n }),\n );\n }\n\n for (const id of [...this.offsets.keys()]) {\n if (!present.has(id)) {\n this.offsets.delete(id);\n this.shifts.delete(id);\n }\n }\n }\n}\n","@for (stack of stacks(); track stack.position) {\n <div class=\"sng-stack\" [class]=\"'sng-stack--' + stack.position\">\n @for (item of stack.items; track item.id) {\n <div class=\"sng-slot\" [attr.data-sng-id]=\"item.id\">\n <sng-toast [item]=\"item\" />\n </div>\n }\n </div>\n}\n","import {\n ApplicationRef,\n ComponentRef,\n DOCUMENT,\n EnvironmentInjector,\n Injectable,\n OnDestroy,\n PLATFORM_ID,\n createComponent,\n inject,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { SNACKNG_CONFIG } from './snackng.config';\nimport { SnackngLiveRegion } from './live-region';\nimport { SnackngHost } from './snackng-host/snackng-host';\nimport { SnackngStore } from './snackng.store';\nimport {\n SnackngDismissReason,\n SnackngOptions,\n SnackngPoliteness,\n SnackngRef,\n SnackngStyle,\n SnackngType,\n} from './snackng.model';\n\nconst NOOP_REF: SnackngRef = {\n id: 'sng-noop',\n dismiss: () => {},\n afterDismissed: Promise.resolve<SnackngDismissReason>('manual'),\n};\n\n/**\n * A variant shortcut (`success`, `danger`, …). Callable directly, and also\n * carries a method per built-in glass preset so you can pick a look inline:\n * `snackng.success.solid('Saved')` is sugar for\n * `snackng.success('Saved', { style: 'solid' })`.\n */\nexport interface SnackngVariantFn {\n (message: string, options?: SnackngOptions): SnackngRef;\n glass(message: string, options?: SnackngOptions): SnackngRef;\n solid(message: string, options?: SnackngOptions): SnackngRef;\n translucent(message: string, options?: SnackngOptions): SnackngRef;\n transparent(message: string, options?: SnackngOptions): SnackngRef;\n frosted(message: string, options?: SnackngOptions): SnackngRef;\n flat(message: string, options?: SnackngOptions): SnackngRef;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SnackngService implements OnDestroy {\n private readonly store = inject(SnackngStore);\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly liveRegion = inject(SnackngLiveRegion);\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private readonly document = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private host?: ComponentRef<SnackngHost>;\n\n /**\n * Toasts accepted but still waiting for a free slot under `overflow: 'queue'`.\n * Useful for a \"3 more\" affordance.\n */\n readonly pending = this.store.pending;\n\n /** Callable shortcut with per-preset sugar, e.g. `success.solid('Saved')`. */\n readonly success = this.variant('success');\n readonly warning = this.variant('warning');\n readonly danger = this.variant('danger');\n readonly info = this.variant('info');\n\n /** Builds a callable variant carrying a method per built-in preset. */\n private variant(type: SnackngType): SnackngVariantFn {\n const withStyle =\n (style?: SnackngStyle) =>\n (message: string, options?: SnackngOptions): SnackngRef =>\n this.show(type, message, style ? { ...options, style } : options);\n\n return Object.assign(withStyle(), {\n glass: withStyle('glass'),\n solid: withStyle('solid'),\n translucent: withStyle('translucent'),\n transparent: withStyle('transparent'),\n frosted: withStyle('frosted'),\n flat: withStyle('flat'),\n });\n }\n\n show(type: SnackngType, message: string, options: SnackngOptions = {}): SnackngRef {\n // Client-only: no-op rather than throw on `document` during SSR.\n if (!this.isBrowser) {\n return NOOP_REF;\n }\n\n this.ensureHost();\n\n const politeness = this.resolvePoliteness(type, options);\n const { id, afterDismissed } = this.store.add({\n type,\n message,\n title: options.title,\n duration: options.duration ?? this.config.duration,\n position: options.position ?? this.config.position,\n dismissible: options.dismissible ?? this.config.dismissible,\n action: options.action,\n style: options.style ?? this.config.style,\n effect: options.effect ?? this.config.effect,\n panelClass: normalizeClasses(options.panelClass),\n politeness,\n });\n\n this.liveRegion.announce([options.title, message].filter(Boolean).join('. '), politeness);\n\n return {\n id,\n afterDismissed,\n dismiss: () => this.store.dismiss(id, 'manual'),\n };\n }\n\n dismissAll(): void {\n this.store.dismissAll();\n }\n\n private resolvePoliteness(type: SnackngType, options: SnackngOptions): SnackngPoliteness {\n if (options.politeness) {\n return options.politeness;\n }\n const configured = this.config.types[type]?.politeness;\n if (configured) {\n return configured;\n }\n // Errors interrupt; everything else waits for a pause.\n return type === 'danger' ? 'assertive' : 'polite';\n }\n\n private ensureHost(): void {\n if (this.host) {\n return;\n }\n this.host = createComponent(SnackngHost, { environmentInjector: this.injector });\n this.appRef.attachView(this.host.hostView);\n this.document.body.appendChild(this.host.location.nativeElement);\n }\n\n ngOnDestroy(): void {\n if (this.host) {\n this.appRef.detachView(this.host.hostView);\n this.host.destroy();\n this.host = undefined;\n }\n }\n}\n\nfunction normalizeClasses(panelClass: string | string[] | undefined): string[] {\n if (!panelClass) {\n return [];\n }\n return Array.isArray(panelClass) ? panelClass : [panelClass];\n}\n","/*\n * Public API Surface of snackng\n */\n\nexport { SnackngService } from './lib/snackng.service';\nexport type { SnackngVariantFn } from './lib/snackng.service';\nexport { provideSnackng, SNACKNG_CONFIG, SNACKNG_DEFAULTS } from './lib/snackng.config';\nexport type { SnackngConfig } from './lib/snackng.config';\nexport type {\n SnackngAction,\n SnackngBuiltInStyle,\n SnackngBuiltInType,\n SnackngDismissReason,\n SnackngEffect,\n SnackngOptions,\n SnackngPoliteness,\n SnackngPosition,\n SnackngRef,\n SnackngStyle,\n SnackngType,\n SnackngTypeDef,\n} from './lib/snackng.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAoCO,MAAM,gBAAgB,GAAkB;AAC7C,IAAA,QAAQ,EAAE,IAA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AG,SAAS;QACvB;IACF;wGAvGW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;4FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AA2GlC,SAAS,gBAAgB,CAAC,UAAyC,EAAA;IACjE,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,EAAE;IACX;AACA,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,UAAU,CAAC;AAC9D;;AC/JA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"snackng.mjs","sources":["../../../projects/snackng/src/lib/snackng.config.ts","../../../projects/snackng/src/lib/live-region.ts","../../../projects/snackng/src/lib/icons.ts","../../../projects/snackng/src/lib/snackng.store.ts","../../../projects/snackng/src/lib/snackng-toast/snackng-toast.ts","../../../projects/snackng/src/lib/snackng-toast/snackng-toast.html","../../../projects/snackng/src/lib/snackng-host/snackng-host.ts","../../../projects/snackng/src/lib/snackng-host/snackng-host.html","../../../projects/snackng/src/lib/snackng.service.ts","../../../projects/snackng/src/public-api.ts","../../../projects/snackng/src/snackng.ts"],"sourcesContent":["import { InjectionToken, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport {\n SnackngEffect,\n SnackngOverflow,\n SnackngPosition,\n SnackngStyle,\n SnackngTypeDef,\n} from './snackng.model';\n\nexport interface SnackngConfig {\n duration: number;\n position: SnackngPosition;\n /** Maximum toasts on screen at once. Extras are handled per `overflow`. */\n max: number;\n /**\n * What happens when a toast arrives while `max` are already visible.\n * `'queue'` waits for a free slot — nothing is ever lost, but a flood becomes\n * a long parade. `'dismiss-oldest'` evicts the oldest to make room, so the\n * newest always wins; useful when an interceptor can emit toasts in bursts.\n */\n overflow: SnackngOverflow;\n /**\n * Milliseconds between releasing consecutive queued toasts. Staggering keeps\n * a burst from firing every enter animation at the same instant. `0` releases\n * as many as fit at once.\n */\n stagger: number;\n pauseOnHover: boolean;\n /** Show the close button. Overridable per call via `options.dismissible`. */\n dismissible: boolean;\n /** Default glass preset for every toast. Overridable per call via `options.style`. */\n style: SnackngStyle;\n /** Default surface light effect. Overridable per call via `options.effect`. */\n effect: SnackngEffect;\n types: Record<string, SnackngTypeDef>;\n}\n\nexport const SNACKNG_DEFAULTS: SnackngConfig = {\n duration: 5000,\n position: 'top-end',\n max: 5,\n overflow: 'queue',\n stagger: 90,\n pauseOnHover: true,\n dismissible: true,\n style: 'glass',\n effect: 'drift',\n types: {},\n};\n\nexport const SNACKNG_CONFIG = new InjectionToken<SnackngConfig>('snackng.config', {\n providedIn: 'root',\n factory: () => SNACKNG_DEFAULTS,\n});\n\n/**\n * Optional. Without it the defaults above apply, so `npm i snackng` and calling\n * the service is enough to get working toasts.\n */\nexport function provideSnackng(config: Partial<SnackngConfig> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: SNACKNG_CONFIG,\n useValue: {\n ...SNACKNG_DEFAULTS,\n ...config,\n types: { ...SNACKNG_DEFAULTS.types, ...config.types },\n } satisfies SnackngConfig,\n },\n ]);\n}\n","import { DOCUMENT, Injectable, OnDestroy, inject } from '@angular/core';\nimport { SnackngPoliteness } from './snackng.model';\n\n/**\n * Announces toast text to screen readers, in place of the CDK `LiveAnnouncer`.\n *\n * The toast markup carries no `aria-live` of its own: text is copied into this\n * off-screen region instead. Keep it that way — a live region nested inside\n * another throws `HierarchyRequestError` when the outer one relocates its\n * content.\n */\n@Injectable({ providedIn: 'root' })\nexport class SnackngLiveRegion implements OnDestroy {\n private readonly document = inject(DOCUMENT);\n private region?: HTMLElement;\n private clearTimer?: ReturnType<typeof setTimeout>;\n\n announce(message: string, politeness: SnackngPoliteness = 'polite'): void {\n if (politeness === 'off' || !message) {\n return;\n }\n\n const region = this.ensureRegion();\n region.setAttribute('aria-live', politeness);\n\n // Clearing first forces assistive tech to treat an identical repeated\n // message as a new announcement.\n region.textContent = '';\n clearTimeout(this.clearTimer);\n this.clearTimer = setTimeout(() => (region.textContent = message), 100);\n }\n\n private ensureRegion(): HTMLElement {\n if (this.region?.isConnected) {\n return this.region;\n }\n\n const region = this.document.createElement('div');\n region.setAttribute('aria-atomic', 'true');\n region.setAttribute('aria-live', 'polite');\n region.classList.add('sng-live-region');\n // Visually hidden but still announced: `display:none` would silence it.\n region.style.cssText =\n 'position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;' +\n 'clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;';\n\n this.document.body.appendChild(region);\n this.region = region;\n return region;\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.clearTimer);\n this.region?.remove();\n this.region = undefined;\n }\n}\n","import { SnackngBuiltInType } from './snackng.model';\n\n/**\n * Path data for the built-in glyphs, inlined so the package never requires an\n * icon font. Bound with `[attr.d]`, so no sanitizer is involved.\n */\nexport const SNACKNG_ICONS: Record<SnackngBuiltInType, string> = {\n success: 'M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z',\n warning: 'M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z',\n danger:\n 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z',\n info: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z',\n};\n","import { Injectable, OnDestroy, computed, inject, signal } from '@angular/core';\nimport { SNACKNG_CONFIG } from './snackng.config';\nimport {\n SnackngAction,\n SnackngDismissReason,\n SnackngEffect,\n SnackngPoliteness,\n SnackngPosition,\n SnackngStyle,\n SnackngType,\n} from './snackng.model';\n\nexport interface SnackngItem {\n readonly id: string;\n readonly type: SnackngType;\n readonly message: string;\n readonly title?: string;\n readonly duration: number;\n readonly position: SnackngPosition;\n readonly dismissible: boolean;\n readonly action?: SnackngAction;\n readonly style: SnackngStyle;\n readonly effect: SnackngEffect;\n readonly panelClass: readonly string[];\n readonly politeness: SnackngPoliteness;\n /** Set while the exit animation runs; the item is still in the DOM. */\n readonly leaving: boolean;\n}\n\nexport interface SnackngStack {\n readonly position: SnackngPosition;\n readonly items: readonly SnackngItem[];\n}\n\n/**\n * Toast state, and the pacing of how toasts reach the screen.\n *\n * Producer/consumer: `add` only enqueues; `pump` is the sole consumer moving\n * items into view as capacity allows. Releasing directly would let a burst\n * render in one tick, appearing and evicting itself in the same frame.\n *\n * Separate from `SnackngService` so the service can create the host while the\n * host reads state, without an import cycle.\n */\n@Injectable({ providedIn: 'root' })\nexport class SnackngStore implements OnDestroy {\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly resolvers = new Map<string, (reason: SnackngDismissReason) => void>();\n private readonly reasons = new Map<string, SnackngDismissReason>();\n private pumpTimer?: ReturnType<typeof setTimeout>;\n private lastReleaseAt = 0;\n private counter = 0;\n\n /** Toasts currently rendered (including those playing their exit animation). */\n readonly items = signal<readonly SnackngItem[]>([]);\n /** Toasts accepted but still waiting for a free slot. */\n readonly queue = signal<readonly SnackngItem[]>([]);\n readonly pending = computed(() => this.queue().length);\n\n readonly stacks = computed<readonly SnackngStack[]>(() => {\n const byPosition = new Map<SnackngPosition, SnackngItem[]>();\n for (const item of this.items()) {\n const bucket = byPosition.get(item.position);\n bucket ? bucket.push(item) : byPosition.set(item.position, [item]);\n }\n return [...byPosition].map(([position, items]) => ({ position, items }));\n });\n\n add(item: Omit<SnackngItem, 'id' | 'leaving'>): {\n id: string;\n afterDismissed: Promise<SnackngDismissReason>;\n } {\n const id = `sng-${++this.counter}`;\n const afterDismissed = new Promise<SnackngDismissReason>((resolve) =>\n this.resolvers.set(id, resolve),\n );\n\n this.queue.update((queue) => [...queue, { ...item, id, leaving: false }]);\n this.pump();\n\n return { id, afterDismissed };\n }\n\n /**\n * Starts the exit animation; the item leaves the DOM on `finalize`. A toast\n * still queued is dropped outright, having never been shown.\n */\n dismiss(id: string, reason: SnackngDismissReason = 'manual'): void {\n if (this.queue().some((item) => item.id === id)) {\n this.queue.update((queue) => queue.filter((item) => item.id !== id));\n this.resolve(id, reason);\n return;\n }\n\n const target = this.items().find((item) => item.id === id);\n if (!target || target.leaving) {\n return;\n }\n this.reasons.set(id, reason);\n this.items.update((items) => items.map((i) => (i.id === id ? { ...i, leaving: true } : i)));\n }\n\n /** Removes the item and resolves its `afterDismissed` promise. */\n finalize(id: string): void {\n if (!this.resolvers.has(id)) {\n return;\n }\n this.items.update((items) => items.filter((item) => item.id !== id));\n this.resolve(id, this.reasons.get(id) ?? 'manual');\n this.reasons.delete(id);\n this.pump();\n }\n\n dismissAll(reason: SnackngDismissReason = 'manual'): void {\n // Drain the queue first, or it would march onto a screen just cleared.\n clearTimeout(this.pumpTimer);\n this.pumpTimer = undefined;\n for (const item of this.queue()) {\n this.resolve(item.id, reason);\n }\n this.queue.set([]);\n\n for (const item of this.items()) {\n this.dismiss(item.id, reason);\n }\n }\n\n /** The consumer. Runs on every add and every finalize. */\n private pump(): void {\n if (this.pumpTimer) {\n return; // a staggered release is already pending\n }\n\n while (this.queue().length) {\n // Counts leaving toasts too: they hold their slot until finalize removes\n // them, so ignoring them reads an expiring batch as free space.\n const onScreen = this.items();\n\n if (onScreen.length >= this.config.max) {\n if (this.config.overflow === 'dismiss-oldest') {\n // Evicting an already-leaving toast frees nothing.\n const victim = onScreen.find((item) => !item.leaving);\n if (victim) {\n this.dismiss(victim.id, 'replaced');\n }\n }\n return;\n }\n\n // Spaced by elapsed time, not queue length: callers add one at a time, so\n // a burst arrives as N pumps of one item and would never wait.\n const wait = this.config.stagger - (Date.now() - this.lastReleaseAt);\n if (this.config.stagger > 0 && wait > 0) {\n this.pumpTimer = setTimeout(() => {\n this.pumpTimer = undefined;\n this.pump();\n }, wait);\n return;\n }\n\n const [next, ...rest] = this.queue();\n this.queue.set(rest);\n this.items.update((items) => [...items, next]);\n this.lastReleaseAt = Date.now();\n }\n }\n\n private resolve(id: string, reason: SnackngDismissReason): void {\n this.resolvers.get(id)?.(reason);\n this.resolvers.delete(id);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.pumpTimer);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n OnDestroy,\n computed,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { SNACKNG_CONFIG } from '../snackng.config';\nimport { SNACKNG_ICONS } from '../icons';\nimport { SnackngBuiltInType } from '../snackng.model';\nimport { SnackngItem, SnackngStore } from '../snackng.store';\n\nconst EXIT_DURATION = 200;\n/** Guards against `animationend` never firing (reduced motion, jsdom, backgrounded tab). */\nconst EXIT_FALLBACK = EXIT_DURATION + 150;\n\n@Component({\n selector: 'sng-toast',\n templateUrl: './snackng-toast.html',\n styleUrl: './snackng-toast.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'hostClasses()',\n '(mouseenter)': 'pause()',\n '(mouseleave)': 'resume()',\n '(focusin)': 'pause()',\n '(focusout)': 'resume()',\n },\n})\nexport class SnackngToast implements OnDestroy {\n readonly item = input.required<SnackngItem>();\n\n private readonly store = inject(SnackngStore);\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n private timer?: ReturnType<typeof setTimeout>;\n private exitTimer?: ReturnType<typeof setTimeout>;\n private armed = false;\n private remaining = 0;\n private startedAt = 0;\n private glareBound = false;\n\n protected readonly hostClasses = computed(() => {\n const item = this.item();\n const classes = [\n 'sng-toast',\n `sng--${item.type}`,\n `sng-at--${item.position}`,\n `sng-style--${item.style}`,\n item.leaving ? 'sng-leaving' : 'sng-entering',\n ...item.panelClass,\n ];\n if (item.effect === 'drift' || item.effect === 'both') {\n classes.push('sng-fx--drift');\n }\n if (item.effect === 'glare' || item.effect === 'both') {\n classes.push('sng-fx--glare');\n }\n return classes.join(' ');\n });\n\n /** Whether this toast tracks the pointer for the cursor glare effect. */\n protected readonly glareEnabled = computed(() => {\n const fx = this.item().effect;\n return fx === 'glare' || fx === 'both';\n });\n\n /** Null when the type brings its own SVG; unknown types fall back to `info`. */\n protected readonly iconPath = computed<string | null>(() => {\n const type = this.item().type;\n if (this.config.types[type]?.icon) {\n return null;\n }\n return SNACKNG_ICONS[type as SnackngBuiltInType] ?? SNACKNG_ICONS.info;\n });\n\n /** Custom types may supply raw SVG markup, trusted as authored config. */\n protected readonly iconSvg = computed<SafeHtml | null>(() => {\n const custom = this.config.types[this.item().type]?.icon;\n return custom ? this.sanitizer.bypassSecurityTrustHtml(custom) : null;\n });\n\n constructor() {\n effect(() => {\n this.applyCustomTypeColours();\n });\n\n effect(() => {\n if (this.item().leaving) {\n this.stopTimer();\n this.scheduleFinalize();\n } else {\n this.startTimer();\n }\n });\n\n // Bind pointer tracking once, only if this toast uses the glare effect.\n effect(() => {\n if (this.glareEnabled() && !this.glareBound) {\n this.bindGlare();\n }\n });\n }\n\n /**\n * Points a custom type's surface at its own `--snackng-<type>-*` tokens.\n *\n * The built-ins get theirs from a `:host(.sng--success)` rule, but a custom\n * type's name is only known at runtime, so no stylesheet can name its tokens\n * — the element has to. Written as properties (not `style=`) so the glare's\n * inline `--sng-glare-*` writes survive.\n *\n * The fallbacks are the neutral surface `:host` already resolves to, so a\n * type with no tokens set looks exactly as it did before.\n */\n private applyCustomTypeColours(): void {\n const type = this.item().type;\n // SNACKNG_ICONS is keyed by the built-ins, which own a :host rule already.\n if (type in SNACKNG_ICONS) {\n return;\n }\n const style = this.element.nativeElement.style;\n style.setProperty(\n '--sng-bg',\n `var(--snackng-${type}-bg, linear-gradient(135deg, ` +\n `rgb(var(--sng-c1) / var(--sng-tint)), ` +\n `rgb(var(--sng-c2) / calc(var(--sng-tint) - 0.06))))`,\n );\n style.setProperty('--sng-ink', `var(--snackng-${type}-ink, #ffffff)`);\n style.setProperty('--sng-solid', `var(--snackng-${type}-solid, #47556a)`);\n }\n\n /** Writes the cursor position into CSS vars the glare layer reads. Runs\n * outside Angular — it only mutates style, no change detection needed. */\n private bindGlare(): void {\n this.glareBound = true;\n const el = this.element.nativeElement;\n this.zone.runOutsideAngular(() => {\n el.addEventListener('pointermove', this.onGlareMove);\n el.addEventListener('pointerleave', this.onGlareLeave);\n });\n }\n\n private readonly onGlareMove = (event: PointerEvent): void => {\n const el = this.element.nativeElement;\n const rect = el.getBoundingClientRect();\n if (!rect.width || !rect.height) {\n return;\n }\n el.style.setProperty('--sng-glare-x', `${((event.clientX - rect.left) / rect.width) * 100}%`);\n el.style.setProperty('--sng-glare-y', `${((event.clientY - rect.top) / rect.height) * 100}%`);\n el.style.setProperty('--sng-glare-op', '1');\n };\n\n private readonly onGlareLeave = (): void => {\n this.element.nativeElement.style.setProperty('--sng-glare-op', '0');\n };\n\n protected onAction(): void {\n const action = this.item().action;\n action?.handler?.();\n if (action?.dismissOnClick !== false) {\n this.store.dismiss(this.item().id, 'action');\n }\n }\n\n protected onDismiss(): void {\n this.store.dismiss(this.item().id, 'manual');\n }\n\n protected pause(): void {\n if (!this.config.pauseOnHover || !this.timer) {\n return;\n }\n this.remaining -= Date.now() - this.startedAt;\n clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n protected resume(): void {\n if (!this.config.pauseOnHover || this.timer || this.remaining <= 0 || this.item().leaving) {\n return;\n }\n this.arm(this.remaining);\n }\n\n /** Arms once per toast: re-running on later item updates would reset a paused timer. */\n private startTimer(): void {\n const duration = this.item().duration;\n if (this.armed || duration <= 0) {\n return;\n }\n this.armed = true;\n this.remaining = duration;\n this.arm(duration);\n }\n\n private arm(ms: number): void {\n this.startedAt = Date.now();\n this.timer = setTimeout(() => this.store.dismiss(this.item().id, 'timeout'), ms);\n }\n\n private stopTimer(): void {\n clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private scheduleFinalize(): void {\n if (this.exitTimer) {\n return;\n }\n const finalize = () => {\n clearTimeout(this.exitTimer);\n this.store.finalize(this.item().id);\n };\n this.element.nativeElement.addEventListener('animationend', finalize, { once: true });\n this.exitTimer = setTimeout(finalize, EXIT_FALLBACK);\n }\n\n ngOnDestroy(): void {\n this.stopTimer();\n clearTimeout(this.exitTimer);\n if (this.glareBound) {\n const el = this.element.nativeElement;\n el.removeEventListener('pointermove', this.onGlareMove);\n el.removeEventListener('pointerleave', this.onGlareLeave);\n }\n }\n}\n","@let toast = item();\n\n<!-- No aria-live here: SnackngLiveRegion announces instead. -->\n@if (glareEnabled()) {\n <div class=\"sng-glare\" aria-hidden=\"true\"></div>\n}\n\n<div class=\"sng-icon\" aria-hidden=\"true\">\n @if (iconPath(); as path) {\n <svg viewBox=\"0 0 24 24\" focusable=\"false\">\n <path [attr.d]=\"path\" fill=\"currentColor\" />\n </svg>\n } @else {\n <span class=\"sng-icon-custom\" [innerHTML]=\"iconSvg()\"></span>\n }\n</div>\n\n<div class=\"sng-body\">\n @if (toast.title) {\n <p class=\"sng-title\">{{ toast.title }}</p>\n }\n <p class=\"sng-message\">{{ toast.message }}</p>\n</div>\n\n@if (toast.action; as action) {\n <button type=\"button\" class=\"sng-action\" (click)=\"onAction()\">{{ action.label }}</button>\n}\n\n@if (toast.dismissible) {\n <button type=\"button\" class=\"sng-close\" (click)=\"onDismiss()\" aria-label=\"Close notification\">\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterEveryRender,\n inject,\n} from '@angular/core';\nimport { SnackngToast } from '../snackng-toast/snackng-toast';\nimport { SnackngStore } from '../snackng.store';\n\nconst SHIFT_DURATION = 260;\nconst SHIFT_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';\n\n/** Guarded: test environments such as jsdom render without `matchMedia`. */\nfunction prefersReducedMotion(): boolean {\n return (\n typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n\n@Component({\n selector: 'sng-host',\n imports: [SnackngToast],\n templateUrl: './snackng-host.html',\n styleUrl: './snackng-host.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackngHost {\n private readonly store = inject(SnackngStore);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly stacks = this.store.stacks;\n\n private readonly offsets = new Map<string, number>();\n private readonly shifts = new Map<string, Animation>();\n\n constructor() {\n afterEveryRender(() => this.absorbLayoutShift());\n }\n\n /**\n * FLIP: offset each slot back to where it was, then animate that offset away,\n * so neighbours glide into a freed gap instead of snapping.\n *\n * Measured with `offsetTop` rather than `getBoundingClientRect`: the latter\n * includes transforms and would read an in-flight shift instead of the layout\n * beneath it. Stacks are full height and top-anchored, so a slot's offsetTop\n * only changes when it truly moves. Applied to the slot, never the toast, to\n * leave the toast's own enter/exit transform alone.\n */\n private absorbLayoutShift(): void {\n const slots = this.element.nativeElement.querySelectorAll<HTMLElement>('.sng-slot');\n const present = new Set<string>();\n\n for (const slot of slots) {\n const id = slot.dataset['sngId'];\n if (!id) {\n continue;\n }\n present.add(id);\n\n const top = slot.offsetTop;\n const previous = this.offsets.get(id);\n this.offsets.set(id, top);\n\n if (previous === undefined || previous === top || prefersReducedMotion()) {\n continue;\n }\n\n this.shifts.get(id)?.cancel();\n this.shifts.set(\n id,\n slot.animate([{ transform: `translateY(${previous - top}px)` }, { transform: 'none' }], {\n duration: SHIFT_DURATION,\n easing: SHIFT_EASING,\n }),\n );\n }\n\n for (const id of [...this.offsets.keys()]) {\n if (!present.has(id)) {\n this.offsets.delete(id);\n this.shifts.delete(id);\n }\n }\n }\n}\n","@for (stack of stacks(); track stack.position) {\n <div class=\"sng-stack\" [class]=\"'sng-stack--' + stack.position\">\n @for (item of stack.items; track item.id) {\n <div class=\"sng-slot\" [attr.data-sng-id]=\"item.id\">\n <sng-toast [item]=\"item\" />\n </div>\n }\n </div>\n}\n","import {\n ApplicationRef,\n ComponentRef,\n DOCUMENT,\n EnvironmentInjector,\n Injectable,\n OnDestroy,\n PLATFORM_ID,\n createComponent,\n inject,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { SNACKNG_CONFIG } from './snackng.config';\nimport { SnackngLiveRegion } from './live-region';\nimport { SnackngHost } from './snackng-host/snackng-host';\nimport { SnackngStore } from './snackng.store';\nimport {\n SnackngDismissReason,\n SnackngOptions,\n SnackngPoliteness,\n SnackngRef,\n SnackngStyle,\n SnackngType,\n} from './snackng.model';\n\nconst NOOP_REF: SnackngRef = {\n id: 'sng-noop',\n dismiss: () => {},\n afterDismissed: Promise.resolve<SnackngDismissReason>('manual'),\n};\n\n/**\n * A variant shortcut (`success`, `danger`, …). Callable directly, and also\n * carries a method per built-in glass preset so you can pick a look inline:\n * `snackng.success.solid('Saved')` is sugar for\n * `snackng.success('Saved', { style: 'solid' })`.\n */\nexport interface SnackngVariantFn {\n (message: string, options?: SnackngOptions): SnackngRef;\n glass(message: string, options?: SnackngOptions): SnackngRef;\n solid(message: string, options?: SnackngOptions): SnackngRef;\n translucent(message: string, options?: SnackngOptions): SnackngRef;\n transparent(message: string, options?: SnackngOptions): SnackngRef;\n frosted(message: string, options?: SnackngOptions): SnackngRef;\n flat(message: string, options?: SnackngOptions): SnackngRef;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SnackngService implements OnDestroy {\n private readonly store = inject(SnackngStore);\n private readonly config = inject(SNACKNG_CONFIG);\n private readonly liveRegion = inject(SnackngLiveRegion);\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private readonly document = inject(DOCUMENT);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private host?: ComponentRef<SnackngHost>;\n\n /**\n * Toasts accepted but still waiting for a free slot under `overflow: 'queue'`.\n * Useful for a \"3 more\" affordance.\n */\n readonly pending = this.store.pending;\n\n /** Callable shortcut with per-preset sugar, e.g. `success.solid('Saved')`. */\n readonly success = this.variant('success');\n readonly warning = this.variant('warning');\n readonly danger = this.variant('danger');\n readonly info = this.variant('info');\n\n /** Builds a callable variant carrying a method per built-in preset. */\n private variant(type: SnackngType): SnackngVariantFn {\n const withStyle =\n (style?: SnackngStyle) =>\n (message: string, options?: SnackngOptions): SnackngRef =>\n this.show(type, message, style ? { ...options, style } : options);\n\n return Object.assign(withStyle(), {\n glass: withStyle('glass'),\n solid: withStyle('solid'),\n translucent: withStyle('translucent'),\n transparent: withStyle('transparent'),\n frosted: withStyle('frosted'),\n flat: withStyle('flat'),\n });\n }\n\n show(type: SnackngType, message: string, options: SnackngOptions = {}): SnackngRef {\n // Client-only: no-op rather than throw on `document` during SSR.\n if (!this.isBrowser) {\n return NOOP_REF;\n }\n\n this.ensureHost();\n\n const politeness = this.resolvePoliteness(type, options);\n const { id, afterDismissed } = this.store.add({\n type,\n message,\n title: options.title,\n duration: options.duration ?? this.config.duration,\n position: options.position ?? this.config.position,\n dismissible: options.dismissible ?? this.config.dismissible,\n action: options.action,\n style: options.style ?? this.config.style,\n effect: options.effect ?? this.config.effect,\n panelClass: normalizeClasses(options.panelClass),\n politeness,\n });\n\n this.liveRegion.announce([options.title, message].filter(Boolean).join('. '), politeness);\n\n return {\n id,\n afterDismissed,\n dismiss: () => this.store.dismiss(id, 'manual'),\n };\n }\n\n dismissAll(): void {\n this.store.dismissAll();\n }\n\n private resolvePoliteness(type: SnackngType, options: SnackngOptions): SnackngPoliteness {\n if (options.politeness) {\n return options.politeness;\n }\n const configured = this.config.types[type]?.politeness;\n if (configured) {\n return configured;\n }\n // Errors interrupt; everything else waits for a pause.\n return type === 'danger' ? 'assertive' : 'polite';\n }\n\n private ensureHost(): void {\n if (this.host) {\n return;\n }\n this.host = createComponent(SnackngHost, { environmentInjector: this.injector });\n this.appRef.attachView(this.host.hostView);\n this.document.body.appendChild(this.host.location.nativeElement);\n }\n\n ngOnDestroy(): void {\n if (this.host) {\n this.appRef.detachView(this.host.hostView);\n this.host.destroy();\n this.host = undefined;\n }\n }\n}\n\nfunction normalizeClasses(panelClass: string | string[] | undefined): string[] {\n if (!panelClass) {\n return [];\n }\n return Array.isArray(panelClass) ? panelClass : [panelClass];\n}\n","/*\n * Public API Surface of snackng\n */\n\nexport { SnackngService } from './lib/snackng.service';\nexport type { SnackngVariantFn } from './lib/snackng.service';\nexport { provideSnackng, SNACKNG_CONFIG, SNACKNG_DEFAULTS } from './lib/snackng.config';\nexport type { SnackngConfig } from './lib/snackng.config';\nexport type {\n SnackngAction,\n SnackngBuiltInStyle,\n SnackngBuiltInType,\n SnackngDismissReason,\n SnackngEffect,\n SnackngOptions,\n SnackngOverflow,\n SnackngPoliteness,\n SnackngPosition,\n SnackngRef,\n SnackngStyle,\n SnackngType,\n SnackngTypeDef,\n} from './lib/snackng.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAqCO,MAAM,gBAAgB,GAAkB;AAC7C,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,QAAQ,EAAE,OAAO;AACjB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,KAAK,EAAE,EAAE;;MAGE,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AAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1C,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;IAClE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1C,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACnB,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS;QACvB;IACF;wGAvGW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;4FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AA2GlC,SAAS,gBAAgB,CAAC,UAAyC,EAAA;IACjE,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,EAAE;IACX;AACA,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,UAAU,CAAC;AAC9D;;AC/JA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snackng",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The easiest way to show toasts and snackbars in Angular with a glass design, zero UI dependencies and CSS-variable theming. No Material, no CDK, no Tailwind required.",
|
|
5
5
|
"author": "xgreymx",
|
|
6
6
|
"keywords": [
|
package/types/snackng.d.ts
CHANGED
|
@@ -22,9 +22,10 @@ interface SnackngAction {
|
|
|
22
22
|
dismissOnClick?: boolean;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Definition for a custom type. Built-in types already have icon and
|
|
26
|
-
* a custom type
|
|
27
|
-
* `--snackng-<type>-bg`
|
|
25
|
+
* Definition for a custom type. Built-in types already have icon and colours;
|
|
26
|
+
* a custom type starts from the neutral surface and is recoloured through
|
|
27
|
+
* `--snackng-<type>-bg`, `--snackng-<type>-ink` and `--snackng-<type>-solid`,
|
|
28
|
+
* set anywhere they inherit to the toast (`:root` is simplest).
|
|
28
29
|
*/
|
|
29
30
|
interface SnackngTypeDef {
|
|
30
31
|
/**
|
|
@@ -121,6 +122,7 @@ interface SnackngConfig {
|
|
|
121
122
|
*/
|
|
122
123
|
stagger: number;
|
|
123
124
|
pauseOnHover: boolean;
|
|
125
|
+
/** Show the close button. Overridable per call via `options.dismissible`. */
|
|
124
126
|
dismissible: boolean;
|
|
125
127
|
/** Default glass preset for every toast. Overridable per call via `options.style`. */
|
|
126
128
|
style: SnackngStyle;
|
|
@@ -137,4 +139,4 @@ declare const SNACKNG_CONFIG: InjectionToken<SnackngConfig>;
|
|
|
137
139
|
declare function provideSnackng(config?: Partial<SnackngConfig>): EnvironmentProviders;
|
|
138
140
|
|
|
139
141
|
export { SNACKNG_CONFIG, SNACKNG_DEFAULTS, SnackngService, provideSnackng };
|
|
140
|
-
export type { SnackngAction, SnackngBuiltInStyle, SnackngBuiltInType, SnackngConfig, SnackngDismissReason, SnackngEffect, SnackngOptions, SnackngPoliteness, SnackngPosition, SnackngRef, SnackngStyle, SnackngType, SnackngTypeDef, SnackngVariantFn };
|
|
142
|
+
export type { SnackngAction, SnackngBuiltInStyle, SnackngBuiltInType, SnackngConfig, SnackngDismissReason, SnackngEffect, SnackngOptions, SnackngOverflow, SnackngPoliteness, SnackngPosition, SnackngRef, SnackngStyle, SnackngType, SnackngTypeDef, SnackngVariantFn };
|