Skip to content

Commit 40604ba

Browse files
committed
Add development page and enhance widget preview functionality
1 parent 06f1236 commit 40604ba

15 files changed

Lines changed: 176 additions & 81 deletions

.eslintcache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</p>
88

99
<p align="center">
10-
<img src="https://img.shields.io/github/license/widget-js/widgets" alt="">
1110
<img src="https://img.shields.io/badge/Q%E7%BE%A4-701784679-EB1923?logo=tencentqq&logoColor=white&sanitize=true" alt="Chat">
1211
<a href="https://space.bilibili.com/207395767"><img src="https://img.shields.io/badge/-Bilibili-00A1D6?logo=bilibili&logoColor=white" alt="bilibili"></a>
1312
<a href="https://faq.widgetjs.cn"><img src="https://img.shields.io/badge/-功能建议-2378ff?logo=vowpalwabbit&logoColor=white&sanitize=true" alt="Feedback"></a>
@@ -19,7 +18,7 @@
1918

2019
## 🔗预览所有组件
2120

22-
https://widget-js.github.io/widgets/#/
21+
https://widget-js.github.io/widgets/#/
2322

2423
![png](screenshot/react.png)
2524

@@ -32,26 +31,6 @@ Windows 10/11 客户端下载地址:
3231
1️⃣ https://www.microsoft.com/store/productId/9NPR50GQ7T53
3332
2️⃣ https://widgetjs.cn
3433

35-
## 🗂️项目目录结构
36-
37-
```
38-
widgets
39-
├── src
40-
│ ├── components // 常用Vue组件
41-
│ ├── views // 页面文件
42-
│ ├── widgets // 桌面组件文件
43-
│ │ ├── countdown // 每个桌面组件一个文件夹
44-
│ │ │ ├── XXWidget.vue // 桌面小组件
45-
│ │ │ ├── XXConfig.vue // 小组件配置页面
46-
│ │ │ └── XXView.vue // 小组件页面
47-
│ │ └── ...
48-
│ └── index.ts
49-
├── .gitignore
50-
├── package.json
51-
├── README.md
52-
└── tsconfig.json
53-
```
54-
5534
## ▶️运行项目
5635

5736
1. 下载并运行桌面组件客户端
@@ -74,9 +53,6 @@ pnpm run dev
7453
```
7554
## 📋组件列表
7655

77-
78-
> 🔗全部组件预览地址:https://widget-js.github.io/widgets/#/add
79-
8056
### AI组件包
8157

8258
https://github.com/rtugeek/ai

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default antfu({
2424
'unused-imports/no-unused-vars': ['error', {
2525
caughtErrors: 'none',
2626
argsIgnorePattern: '^_',
27+
varsIgnorePattern: '^_',
2728
}],
2829
'ts/explicit-function-return-type': 'off',
2930
'style/max-statements-per-line': ['error', {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@tailwindcss/vite": "^4.2.0",
2121
"@uiw/react-color": "^2.9.5",
2222
"@widget-js/core": "latest",
23+
"@widget-js/react": "workspace:^",
2324
"@widget-js/web-api": "24.1.1-beta.70",
2425
"axios": "^1.13.5",
2526
"baseline-browser-mapping": "^2.10.0",

src/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'
33
import { RouterProvider } from 'react-router-dom'
44
import { useAppLanguage } from './hooks/use-app-language'
55
import { router } from './router'
6+
import '@widget-js/react/style.css'
67
import './app.css'
78

89
function App() {

src/components/dashboard-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { WindowControls } from '@widget-js/react'
12
import { useTranslation } from 'react-i18next'
23
import { Outlet, useMatches } from 'react-router-dom'
34
import { AppSidebar } from '@/components/app-sidebar'
@@ -11,7 +12,6 @@ import {
1112
SidebarInset,
1213
SidebarProvider,
1314
} from '@/components/ui/sidebar'
14-
import { WindowControls } from '@/components/window-controls'
1515

1616
export function DashboardLayout() {
1717
const { t } = useTranslation()

src/components/window-controls.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@
144144
.draggable-region a {
145145
-webkit-app-region: no-drag;
146146
}
147+
148+
[data-rmiz-modal-overlay="visible"] {
149+
background-color: rgba(0, 0, 0, 0.7) !important;
150+
}

src/locales/en/translation.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
"widgetManagement": "Widget Management",
3636
"settings": "Settings",
3737
"loading": "Loading...",
38-
"widgetHub": "Widget Hub"
38+
"widgetHub": "Widget Hub",
39+
"dev": "Widget Dev"
40+
},
41+
"dev": {
42+
"emptyTitle": "Develop Your Own Desktop Widget",
43+
"viewDocs": "View Documentation"
3944
},
4045
"general": {
4146
"title": "General Settings",

src/locales/zh/translation.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
"widgetManagement": "组件管理",
3636
"settings": "设置",
3737
"loading": "加载中...",
38-
"widgetHub": "桌面组件"
38+
"widgetHub": "桌面组件",
39+
"dev": "开发组件"
40+
},
41+
"dev": {
42+
"emptyTitle": "开发属于自己的桌面组件",
43+
"viewDocs": "查看文档"
3944
},
4045
"general": {
4146
"title": "常用设置",

0 commit comments

Comments
 (0)