weifuwu 0.27.17 β†’ 0.27.19

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.
@@ -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
 
@@ -754,6 +754,17 @@
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') {
761
+ b.setAttribute('wu-theme', 'light')
762
+ b.textContent = 'β˜€οΈ'
763
+ } else if (v === 'light') {
764
+ b.setAttribute('wu-theme', 'dark')
765
+ b.textContent = 'πŸŒ™'
766
+ }
767
+ })
757
768
  })
758
769
 
759
770
  // ═══════════════════════════════════════════════════════════════════
@@ -777,6 +788,12 @@
777
788
  if (!btn) return
778
789
  const locale = btn.getAttribute('wu-lang')
779
790
  switchLocale(locale)
791
+ // Toggle all [wu-lang] buttons: zh-CN ↔ en
792
+ document.querySelectorAll('[wu-lang]').forEach((b) => {
793
+ const v = b.getAttribute('wu-lang')
794
+ if (v === 'zh-CN') b.setAttribute('wu-lang', 'en')
795
+ else if (v === 'en') b.setAttribute('wu-lang', 'zh-CN')
796
+ })
780
797
  })
781
798
 
782
799
  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.17",
4
+ "version": "0.27.19",
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",