feat: add htmx as npm dependency

This commit is contained in:
log101 2024-06-22 13:41:37 +03:00
parent ea496f4182
commit 92ab6c07ad
5 changed files with 18 additions and 3400 deletions

6
package-lock.json generated
View File

@ -11,6 +11,7 @@
"@astrojs/check": "^0.5.10", "@astrojs/check": "^0.5.10",
"@astrojs/tailwind": "^5.1.0", "@astrojs/tailwind": "^5.1.0",
"astro": "^4.10.0", "astro": "^4.10.0",
"htmx.org": "^1.9.12",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.3",
"typescript": "^5.4.5" "typescript": "^5.4.5"
}, },
@ -3597,6 +3598,11 @@
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
}, },
"node_modules/htmx.org": {
"version": "1.9.12",
"resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.9.12.tgz",
"integrity": "sha512-VZAohXyF7xPGS52IM8d1T1283y+X4D+Owf3qY1NZ9RuBypyu9l8cGsxUMAG5fEAb/DhT7rDoJ9Hpu5/HxFD3cw=="
},
"node_modules/http-cache-semantics": { "node_modules/http-cache-semantics": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",

View File

@ -14,6 +14,7 @@
"@astrojs/check": "^0.5.10", "@astrojs/check": "^0.5.10",
"@astrojs/tailwind": "^5.1.0", "@astrojs/tailwind": "^5.1.0",
"astro": "^4.10.0", "astro": "^4.10.0",
"htmx.org": "^1.9.12",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.3",
"typescript": "^5.4.5" "typescript": "^5.4.5"
}, },

6
src/env.d.ts vendored
View File

@ -1,2 +1,8 @@
/// <reference path="../.astro/types.d.ts" /> /// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />
export declare global {
interface Window {
htmx: any;
}
}

View File

@ -15,7 +15,6 @@ import "../styles/main.css";
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<script src="../scripts/htmx.min.js"></script>
<meta name="htmx-config" content='{code:"204", swap: false}' /> <meta name="htmx-config" content='{code:"204", swap: false}' />
<title>{title}</title> <title>{title}</title>
</head> </head>
@ -25,4 +24,9 @@ import "../styles/main.css";
<slot /> <slot />
</div> </div>
</body> </body>
<script>
import htmx from "htmx.org";
window.htmx = htmx;
</script>
</html> </html>

3399
src/scripts/htmx.min.js vendored

File diff suppressed because it is too large Load Diff