3.0.0原版

This commit is contained in:
anian
2026-03-16 00:03:35 +08:00
commit ac569b2a57
105 changed files with 14437 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />
+64
View File
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link href="/favicon.ico" rel="icon" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>@halo-dev/comment-widget - example</title>
<script src="/src/main.ts" type="module"></script>
<style>
#toggle-theme {
margin-bottom: 1rem;
}
:root {
--halo-cw-base-rounded: 0.5em;
--halo-cw-avatar-rounded: 1px;
--halo-cw-avatar-size: 2em;
--halo-cw-base-font-family: 'Inter', sans-serif;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
const button = document.getElementById("toggle-theme");
button.addEventListener("click", () => {
document.documentElement.classList.toggle("dark");
// save the theme to local storage
localStorage.setItem(
"theme",
document.documentElement.classList.contains("dark")
? "dark"
: "light"
);
});
// get the theme from local storage
const theme = localStorage.getItem("theme");
if (theme) {
document.documentElement.classList.add(theme);
}
});
window.addEventListener("halo:comment:created", () => {
console.log("halo:comment:created");
});
window.addEventListener("halo:comment-reply:created", () => {
console.log("halo:comment-reply:created");
});
</script>
</head>
<body>
<button id="toggle-theme">Dark / Light</button>
<comment-widget
baseUrl="http://127.0.0.1:8090"
group="content.halo.run"
kind="Post"
version="v1alpha1"
name="5152aea5-c2e8-4717-8bba-2263d46e19d5"
with-replies="false"
></comment-widget>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
{
"scripts": {
"dev": "vite"
},
"dependencies": {
"@halo-dev/comment-widget": "workspace:*"
}
}
+2
View File
@@ -0,0 +1,2 @@
import '@halo-dev/comment-widget';
import '@halo-dev/comment-widget/var.css';
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"]
}
+28
View File
@@ -0,0 +1,28 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 4000,
proxy: {
'/actuator': {
target: 'http://localhost:8090',
changeOrigin: true,
},
'/apis': {
target: 'http://localhost:8090',
changeOrigin: true,
},
'/upload': {
target: 'http://localhost:8090',
changeOrigin: true,
},
},
},
});