diff --git a/.gitignore b/.gitignore
index 82fe8e7e..00e1d7a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,13 +11,5 @@ dist
notivue-*.tgz
-cypress/downloads
-cypress/screenshots
-
-*.sublime-workspace
-*.sublime-project
-
.nuxt
pnpm-lock.yaml
-
-astro-dev
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 17236687..2312dc58 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,6 +1 @@
-#!/usr/bin/env sh
-. "$(dirname -- "$0")/_/husky.sh"
-
npx lint-staged
-
-#
diff --git a/.prettierrc b/.prettierrc
index f9ee1cb0..192e0d23 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -5,6 +5,7 @@
"tabWidth": 3,
"trailingComma": "es5",
"useTabs": false,
+ "plugins": ["prettier-plugin-astro"],
"overrides": [
{
"files": "README.md",
@@ -13,6 +14,11 @@
"trailingComma": "none",
"printWidth": 90
}
+ }, {
+ "files": "*.astro",
+ "options": {
+ "parser": "astro"
+ }
}
]
}
diff --git a/astro-playground/.gitignore b/astro-playground/.gitignore
new file mode 100644
index 00000000..aa210b11
--- /dev/null
+++ b/astro-playground/.gitignore
@@ -0,0 +1,20 @@
+# build output
+dist/
+# generated types
+.astro/
+
+# dependencies
+node_modules/
+
+# logs
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# environment variables
+.env
+.env.production
+
+# macOS-specific files
+.DS_Store
diff --git a/astro-playground/astro.config.mjs b/astro-playground/astro.config.mjs
new file mode 100644
index 00000000..c662b2b3
--- /dev/null
+++ b/astro-playground/astro.config.mjs
@@ -0,0 +1,19 @@
+import { defineConfig } from 'astro/config'
+
+import vue from '@astrojs/vue'
+import react from '@astrojs/react'
+
+export default defineConfig({
+ integrations: [
+ vue({
+ appEntrypoint: '/src/pages/_app.ts',
+ devtools: true,
+ }),
+ react(),
+ ],
+ vite: {
+ optimizeDeps: {
+ include: ['notivue'],
+ },
+ },
+})
diff --git a/astro-playground/package.json b/astro-playground/package.json
new file mode 100644
index 00000000..d6cf642c
--- /dev/null
+++ b/astro-playground/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "notivue-astro-playground",
+ "type": "module",
+ "private": true,
+ "scripts": {
+ "dev": "astro dev",
+ "start": "astro dev",
+ "build": "astro build",
+ "preview": "astro preview",
+ "astro": "astro"
+ },
+ "dependencies": {
+ "@astrojs/react": "^3.6.2",
+ "@astrojs/vue": "^4.5.0",
+ "astro": "^4.15.1",
+ "notivue": "workspace:*",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "vue": "^3.4.30"
+ },
+ "devDependencies": {
+ "@types/react": "^18.3.3",
+ "@types/react-dom": "^18.3.0"
+ }
+}
diff --git a/astro-playground/public/favicon.svg b/astro-playground/public/favicon.svg
new file mode 100644
index 00000000..f157bd1c
--- /dev/null
+++ b/astro-playground/public/favicon.svg
@@ -0,0 +1,9 @@
+
diff --git a/astro-playground/src/components/AstroComponent.astro b/astro-playground/src/components/AstroComponent.astro
new file mode 100644
index 00000000..7e5ac845
--- /dev/null
+++ b/astro-playground/src/components/AstroComponent.astro
@@ -0,0 +1,59 @@
+
+
From a Script Tag
+
+
+
+
+
+
+
+
diff --git a/astro-playground/src/components/Notivue.vue b/astro-playground/src/components/Notivue.vue
new file mode 100644
index 00000000..29aadea4
--- /dev/null
+++ b/astro-playground/src/components/Notivue.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/astro-playground/src/components/ReactComponent.tsx b/astro-playground/src/components/ReactComponent.tsx
new file mode 100644
index 00000000..540d0852
--- /dev/null
+++ b/astro-playground/src/components/ReactComponent.tsx
@@ -0,0 +1,35 @@
+import { push } from 'notivue/astro'
+
+function pushStatic() {
+ push.info({
+ title: 'React Notification',
+ message: 'Notification from React!',
+ })
+}
+
+function pushPromise() {
+ const promise = push.promise({
+ title: 'Loading React Notification...',
+ message: 'Loading notification from React...',
+ })
+
+ setTimeout(() => {
+ promise.resolve({
+ title: 'React Notification',
+ message: 'Loaded notification from React!',
+ })
+ }, 2000)
+}
+
+export function ReactComponent() {
+ return (
+
+
From React
+
+
+
+
+
+
+ )
+}
diff --git a/astro-playground/src/components/VueComponent.vue b/astro-playground/src/components/VueComponent.vue
new file mode 100644
index 00000000..1cf8ebf5
--- /dev/null
+++ b/astro-playground/src/components/VueComponent.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
From Vue
+
+
+
+
+
+
+
diff --git a/astro-playground/src/env.d.ts b/astro-playground/src/env.d.ts
new file mode 100644
index 00000000..acef35f1
--- /dev/null
+++ b/astro-playground/src/env.d.ts
@@ -0,0 +1,2 @@
+///
+///
diff --git a/astro-playground/src/layouts/Layout.astro b/astro-playground/src/layouts/Layout.astro
new file mode 100644
index 00000000..7b1b79ec
--- /dev/null
+++ b/astro-playground/src/layouts/Layout.astro
@@ -0,0 +1,28 @@
+---
+import { ViewTransitions } from 'astro:transitions'
+
+import Notivue from '@/components/Notivue.vue'
+
+import 'notivue/astro/notification.css'
+import 'notivue/astro/animations.css'
+
+import '@/styles/reset.css'
+---
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/astro-playground/src/pages/_app.ts b/astro-playground/src/pages/_app.ts
new file mode 100644
index 00000000..2a74a271
--- /dev/null
+++ b/astro-playground/src/pages/_app.ts
@@ -0,0 +1,11 @@
+import { createNotivue } from 'notivue/astro'
+
+import type { App, Plugin } from 'vue'
+
+const notivue = createNotivue({
+ teleportTo: '#notivue_teleport',
+})
+
+export default (app: App) => {
+ app.use(notivue as unknown as Plugin)
+}
diff --git a/astro-playground/src/pages/about.astro b/astro-playground/src/pages/about.astro
new file mode 100644
index 00000000..4e4741c6
--- /dev/null
+++ b/astro-playground/src/pages/about.astro
@@ -0,0 +1,15 @@
+---
+import Layout from '@/layouts/Layout.astro'
+
+import VueComponent from '@/components/VueComponent.vue'
+import AstroComponent from '@/components/AstroComponent.astro'
+import { ReactComponent } from '@/components/ReactComponent'
+---
+
+
+ Home
+
+
+
+
+
diff --git a/astro-playground/src/pages/index.astro b/astro-playground/src/pages/index.astro
new file mode 100644
index 00000000..18f02c9a
--- /dev/null
+++ b/astro-playground/src/pages/index.astro
@@ -0,0 +1,15 @@
+---
+import Layout from '../layouts/Layout.astro'
+
+import VueComponent from '../components/VueComponent.vue'
+import AstroComponent from '@/components/AstroComponent.astro'
+import { ReactComponent } from '../components/ReactComponent'
+---
+
+
+ About
+
+
+
+
+
diff --git a/astro-playground/src/styles/reset.css b/astro-playground/src/styles/reset.css
new file mode 100644
index 00000000..ded5d7de
--- /dev/null
+++ b/astro-playground/src/styles/reset.css
@@ -0,0 +1,96 @@
+/* https://andy-bell.co.uk/a-more-modern-css-reset/ */
+
+/* Box sizing rules */
+*,
+*::before,
+*::after {
+ box-sizing: border-box;
+}
+
+html {
+ font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji',
+ 'Segoe UI Emoji';
+}
+
+/* Prevent font size inflation */
+html {
+ -moz-text-size-adjust: none;
+ -webkit-text-size-adjust: none;
+ text-size-adjust: none;
+}
+
+/* Remove default margin in favour of better control in authored CSS */
+body,
+h1,
+h2,
+h3,
+h4,
+p,
+figure,
+blockquote,
+dl,
+dd {
+ margin: 0;
+}
+
+/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
+ul[role='list'],
+ol[role='list'] {
+ list-style: none;
+}
+
+/* Set core body defaults */
+body {
+ min-height: 100vh;
+ line-height: 1.5;
+}
+
+/* Set shorter line heights on headings and interactive elements */
+h1,
+h2,
+h3,
+h4,
+button,
+input,
+label {
+ line-height: 1.1;
+}
+
+/* Balance text wrapping on headings */
+h1,
+h2,
+h3,
+h4 {
+ text-wrap: balance;
+}
+
+/* A elements that don't have a class get default styles */
+a:not([class]) {
+ text-decoration-skip-ink: auto;
+ color: currentColor;
+}
+
+/* Make images easier to work with */
+img,
+picture {
+ max-width: 100%;
+ display: block;
+}
+
+/* Inherit fonts for inputs and buttons */
+input,
+button,
+textarea,
+select {
+ font: inherit;
+}
+
+/* Make sure textareas without a rows attribute are not tiny */
+textarea:not([rows]) {
+ min-height: 10em;
+}
+
+/* Anything that has been anchored to should have extra scroll margin */
+:target {
+ scroll-margin-block: 5ex;
+}
diff --git a/astro-playground/tsconfig.json b/astro-playground/tsconfig.json
new file mode 100644
index 00000000..51ddc129
--- /dev/null
+++ b/astro-playground/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "astro/tsconfigs/strict",
+ "compilerOptions": {
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["src/*"]
+ },
+ "jsx": "react-jsx"
+ }
+}
diff --git a/package.json b/package.json
index 99d1ca2c..b7c6044c 100644
--- a/package.json
+++ b/package.json
@@ -6,19 +6,21 @@
"node": ">=20.0.0"
},
"scripts": {
- "dev": "pnpm build && concurrently \"pnpm -C packages/notivue run watch\" \"pnpm -C demo install && pnpm -C demo run dev --host\"",
+ "dev": "pnpm build && concurrently \"pnpm -C packages/notivue run watch\" \"pnpm -C playground install && pnpm -C playground run dev --host\"",
+ "dev:astro": "pnpm build && concurrently \"pnpm -C packages/notivue run watch\" \"pnpm -C astro-playground install && pnpm -C astro-playground run dev --host\"",
"build": "pnpm -C packages/notivue run build",
- "build:demo": "pnpm build && pnpm install && pnpm -C demo run build",
+ "build:playground": "pnpm build && pnpm install && pnpm -C playground run build",
"test": "pnpm build && pnpm install && pnpm -C tests run test",
"test:gui": "pnpm build && concurrently \"pnpm -C packages/notivue run watch\" \"pnpm -C tests install && pnpm -C tests run test:gui\"",
"test:unit": "pnpm -C tests run test:unit",
- "prepare": "husky install"
+ "prepare": "husky"
},
"devDependencies": {
"concurrently": "^8.2.2",
- "husky": "^8.0.3",
- "lint-staged": "^15.2.2",
- "prettier": "^3.2.5"
+ "husky": "^9.1.5",
+ "lint-staged": "^15.2.9",
+ "prettier": "^3.3.3",
+ "prettier-plugin-astro": "^0.14.1"
},
"lint-staged": {
"*.{js,ts,vue,json,css,md}": "prettier --write"
diff --git a/packages/notivue/Notivue/NotivueImpl.vue b/packages/notivue/Notivue/NotivueImpl.vue
index b066f092..176c9c09 100644
--- a/packages/notivue/Notivue/NotivueImpl.vue
+++ b/packages/notivue/Notivue/NotivueImpl.vue
@@ -9,7 +9,7 @@ import { getSlotItem } from '@/core/utils'
import { useMouseEvents } from './composables/useMouseEvents'
import { useTouchEvents } from './composables/useTouchEvents'
import { useNotivueStyles } from './composables/useNotivueStyles'
-import { useRepositioning } from './composables/useRepositioning'
+import { useSizes } from './composables/useSizes'
import { useWindowFocus } from './composables/useWindowFocus'
import { useReducedMotion } from './composables/useReducedMotion'
@@ -36,7 +36,7 @@ const touchEvents = useTouchEvents()
useReducedMotion()
useWindowFocus()
-useRepositioning()
+useSizes()
diff --git a/packages/notivue/Notivue/composables/useRepositioning.ts b/packages/notivue/Notivue/composables/useSizes.ts
similarity index 90%
rename from packages/notivue/Notivue/composables/useRepositioning.ts
rename to packages/notivue/Notivue/composables/useSizes.ts
index 35ce2ad1..41796077 100644
--- a/packages/notivue/Notivue/composables/useRepositioning.ts
+++ b/packages/notivue/Notivue/composables/useSizes.ts
@@ -2,7 +2,7 @@ import { useWindowSize } from './useWindowSize'
import { useResizeListObserver } from './useResizeListObserver'
import { useStore } from '@/core/useStore'
-export function useRepositioning() {
+export function useSizes() {
const { elements, animations } = useStore()
useWindowSize(() => animations.updatePositions({ isImmediate: true }))
diff --git a/packages/notivue/astro/Notivue.vue b/packages/notivue/astro/Notivue.vue
index d65458d6..7b19eca2 100644
--- a/packages/notivue/astro/Notivue.vue
+++ b/packages/notivue/astro/Notivue.vue
@@ -1,18 +1,40 @@