weifuwu 0.27.17 β 0.27.18
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/dist/template/ui/app/page.ts +0 -2
- package/dist/weifuwu-ui.js +12 -0
- package/package.json +2 -4
|
@@ -12,9 +12,7 @@ export default function (ctx: any) {
|
|
|
12
12
|
<strong class="wu-text-lg">weifuwu</strong>
|
|
13
13
|
<div class="wu-flex wu-gap-sm wu-items-center">
|
|
14
14
|
<button wu-theme="dark" class="wu-btn wu-btn-sm">π</button>
|
|
15
|
-
<button wu-theme="light" class="wu-btn wu-btn-sm">βοΈ</button>
|
|
16
15
|
<button wu-lang="zh-CN" class="wu-btn wu-btn-sm">δΈζ</button>
|
|
17
|
-
<button wu-lang="en" class="wu-btn wu-btn-sm">EN</button>
|
|
18
16
|
</div>
|
|
19
17
|
</nav>
|
|
20
18
|
|
package/dist/weifuwu-ui.js
CHANGED
|
@@ -754,6 +754,12 @@
|
|
|
754
754
|
document.cookie = 'theme=' + value + '; Path=/; SameSite=Lax; Max-Age=31536000'
|
|
755
755
|
// Sync with server (no redirect, JSON request)
|
|
756
756
|
fetch('/__theme/' + value, { headers: { Accept: 'application/json' } }).catch(() => {})
|
|
757
|
+
// Toggle all [wu-theme] buttons: dark β light
|
|
758
|
+
document.querySelectorAll('[wu-theme]').forEach((b) => {
|
|
759
|
+
const v = b.getAttribute('wu-theme')
|
|
760
|
+
if (v === 'dark') b.setAttribute('wu-theme', 'light')
|
|
761
|
+
else if (v === 'light') b.setAttribute('wu-theme', 'dark')
|
|
762
|
+
})
|
|
757
763
|
})
|
|
758
764
|
|
|
759
765
|
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -777,6 +783,12 @@
|
|
|
777
783
|
if (!btn) return
|
|
778
784
|
const locale = btn.getAttribute('wu-lang')
|
|
779
785
|
switchLocale(locale)
|
|
786
|
+
// Toggle all [wu-lang] buttons: zh-CN β en
|
|
787
|
+
document.querySelectorAll('[wu-lang]').forEach((b) => {
|
|
788
|
+
const v = b.getAttribute('wu-lang')
|
|
789
|
+
if (v === 'zh-CN') b.setAttribute('wu-lang', 'en')
|
|
790
|
+
else if (v === 'en') b.setAttribute('wu-lang', 'zh-CN')
|
|
791
|
+
})
|
|
780
792
|
})
|
|
781
793
|
|
|
782
794
|
async function switchLocale(locale) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weifuwu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.18",
|
|
5
5
|
"description": "Web-standard HTTP microframework for Node.js β (req, ctx) => Response",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js"
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
"test": "node --test 'test/**/*.test.ts'",
|
|
24
24
|
"test:coverage": "node --experimental-test-coverage --test 'test/**/*.test.ts'",
|
|
25
25
|
"test:quick": "bash scripts/test-quick.sh",
|
|
26
|
-
"prepare": "husky"
|
|
27
|
-
"dev": "node --watch cli/template/index.ts",
|
|
28
|
-
"start": "node cli/template/index.ts"
|
|
26
|
+
"prepare": "husky"
|
|
29
27
|
},
|
|
30
28
|
"dependencies": {
|
|
31
29
|
"@ai-sdk/openai": "^3.0.66",
|