@bimetal/toast-svelte-components 0.35.0 → 0.36.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.
|
@@ -45,10 +45,20 @@
|
|
|
45
45
|
data-theme={darkMode ? 'dark' : undefined}
|
|
46
46
|
onmouseenter={pauseOnHover ? () => controller.pause() : undefined}
|
|
47
47
|
onmouseleave={pauseOnHover ? () => controller.resume() : undefined}
|
|
48
|
+
onfocusin={pauseOnHover ? () => controller.pause() : undefined}
|
|
49
|
+
onfocusout={pauseOnHover ? (e) => {
|
|
50
|
+
// Focus move WITHIN the viewport is not a leave (mcp-63 R1).
|
|
51
|
+
if (e.relatedTarget instanceof Node && (e.currentTarget as HTMLElement).contains(e.relatedTarget)) return;
|
|
52
|
+
controller.resume();
|
|
53
|
+
} : undefined}
|
|
48
54
|
>
|
|
49
55
|
{#each snap.toasts as t (t.id)}
|
|
50
56
|
<div class={`bm-toast bm-toast--${t.variant}`} role={ROLE[t.variant]} aria-live={LIVE[t.variant]}>
|
|
51
57
|
<span class="bm-toast__message">{t.message}</span>
|
|
58
|
+
{#if t.action}
|
|
59
|
+
<!-- mcp-63: inline action — the controller owns consume-on-action. -->
|
|
60
|
+
<button type="button" class="bm-toast__action" onclick={() => controller.invokeAction(t.id)}>{t.action.label}</button>
|
|
61
|
+
{/if}
|
|
52
62
|
{#if t.dismissible}
|
|
53
63
|
<button type="button" class="bm-toast__close" aria-label={config.locale.close} onclick={() => controller.dismiss(t.id)}>×</button>
|
|
54
64
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastViewport.svelte.d.ts","sourceRoot":"","sources":["../src/ToastViewport.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAyC,MAAM,yBAAyB,CAAC;AAErG,KAAK,gBAAgB,GAAI;IACtB,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"ToastViewport.svelte.d.ts","sourceRoot":"","sources":["../src/ToastViewport.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAyC,MAAM,yBAAyB,CAAC;AAErG,KAAK,gBAAgB,GAAI;IACtB,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA6DJ,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bimetal/toast-svelte-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Default Svelte 5 toast viewport — canonical .bm-toast* render layer over the headless controller: queue, auto-dismiss, pause-on-hover, variants, positioning, a11y. Bound-only (the app owns the controller it pushes to).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"svelte": "./dist/index.js",
|
|
13
13
|
"import": "./dist/index.js"
|
|
14
14
|
},
|
|
15
|
-
"./styles":
|
|
15
|
+
"./styles": {
|
|
16
|
+
"types": "./dist/styles/index.css.d.ts",
|
|
17
|
+
"default": "./dist/styles/index.css"
|
|
18
|
+
}
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
@@ -20,23 +23,23 @@
|
|
|
20
23
|
"LICENSE"
|
|
21
24
|
],
|
|
22
25
|
"scripts": {
|
|
23
|
-
"build": "svelte-package -i src -o dist && node scripts/copy-css.mjs",
|
|
26
|
+
"build": "svelte-package -i src -o dist && node scripts/copy-css.mjs && node ../../../scripts/generate-css-stubs.mjs",
|
|
24
27
|
"dev": "svelte-package -i src -o dist --watch",
|
|
25
|
-
"typecheck": "svelte-check --tsconfig ./tsconfig.json",
|
|
28
|
+
"typecheck": "svelte-check --tsconfig ./tsconfig.test.json",
|
|
26
29
|
"test": "vitest run",
|
|
27
30
|
"prepublishOnly": "npm run build"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@bimetal/svelte": "^0.
|
|
31
|
-
"@bimetal/toast-headless": "^0.
|
|
32
|
-
"@bimetal/toast-themes": "^0.
|
|
33
|
+
"@bimetal/svelte": "^0.36.0",
|
|
34
|
+
"@bimetal/toast-headless": "^0.36.0",
|
|
35
|
+
"@bimetal/toast-themes": "^0.36.0"
|
|
33
36
|
},
|
|
34
37
|
"peerDependencies": {
|
|
35
38
|
"svelte": "^5.46.4"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@sveltejs/package": "^2.5.0",
|
|
39
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
40
43
|
"@testing-library/svelte": "^5.2.7",
|
|
41
44
|
"happy-dom": "^18.0.1",
|
|
42
45
|
"svelte": "^5.46.4",
|