create-widget 26.7.23 → 26.7.24
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/bin/index.js +0 -0
- package/package.json +13 -13
- package/template/react/package.json +42 -42
- package/template/react/public/widget.json +10 -2
- package/template/react/src/assets/main.css +0 -28
- package/template/react/src/widgets/clock/{ClockConfigView.tsx → clock-config-view.tsx} +3 -4
- package/template/react/src/widgets/clock/{ClockWidgetRoutes.ts → clock-widget-routes.ts} +4 -4
- package/template/react/src/widgets/clock/{Clock.widget.ts → clock.widget.ts} +10 -1
- package/template/react/src/widgets/widget-router.ts +11 -11
- package/template/react/widget.package.ts +1 -0
- /package/template/react/src/widgets/clock/{ClockWidgetView.tsx → clock-widget-view.tsx} +0 -0
package/bin/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-widget",
|
|
3
|
-
"version": "26.7.
|
|
3
|
+
"version": "26.7.24",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An easy way to start a Widget project",
|
|
6
6
|
"author": "Neo Fu <rtugeek@gmail.com>",
|
|
@@ -20,6 +20,17 @@
|
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=v16.20.0"
|
|
22
22
|
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prebuild": "release --date-version",
|
|
25
|
+
"build": "tsup-node build src/index.ts",
|
|
26
|
+
"watch": "tsup-node src/index.ts --format cjs --watch",
|
|
27
|
+
"build:run": "npm run build && npm exec create-widget",
|
|
28
|
+
"test": "node index.cjs",
|
|
29
|
+
"update:version": "esno scripts/updateVersion.ts",
|
|
30
|
+
"pnpm:publish": "npm run build && pnpm publish --no-git-checks",
|
|
31
|
+
"link": "pnpm link --global",
|
|
32
|
+
"lint:fix": "eslint"
|
|
33
|
+
},
|
|
23
34
|
"publishConfig": {
|
|
24
35
|
"access": "public"
|
|
25
36
|
},
|
|
@@ -47,16 +58,5 @@
|
|
|
47
58
|
"tsup": "^8.3.5",
|
|
48
59
|
"typescript": "^5.2.2",
|
|
49
60
|
"vitest": "^0.34.6"
|
|
50
|
-
},
|
|
51
|
-
"scripts": {
|
|
52
|
-
"prebuild": "release --date-version",
|
|
53
|
-
"build": "tsup-node build src/index.ts",
|
|
54
|
-
"watch": "tsup-node src/index.ts --format cjs --watch",
|
|
55
|
-
"build:run": "npm run build && npm exec create-widget",
|
|
56
|
-
"test": "node index.cjs",
|
|
57
|
-
"update:version": "esno scripts/updateVersion.ts",
|
|
58
|
-
"pnpm:publish": "npm run build && pnpm publish --no-git-checks",
|
|
59
|
-
"link": "pnpm link --global",
|
|
60
|
-
"lint:fix": "eslint"
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hello-widget",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"preview": "vite preview",
|
|
9
|
-
"build": "vite build",
|
|
10
|
-
"build:offline": "vite build --mode offline",
|
|
11
|
-
"update:widgetjs": "widget dependencies -t remote"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@fontsource-variable/geist": "^5.3.0",
|
|
15
|
-
"@widget-js/core": "
|
|
16
|
-
"@widget-js/react": "
|
|
17
|
-
"class-variance-authority": "^0.7.1",
|
|
18
|
-
"clsx": "^2.1.1",
|
|
19
|
-
"lucide-react": "^1.25.0",
|
|
20
|
-
"radix-ui": "^1.6.3",
|
|
21
|
-
"react": "^19.2.0",
|
|
22
|
-
"react-dom": "^19.2.0",
|
|
23
|
-
"react-router-dom": "^7.9.1",
|
|
24
|
-
"shadcn": "^4.13.1",
|
|
25
|
-
"styled-components": "^6.4.4",
|
|
26
|
-
"tailwind-merge": "^3.6.0",
|
|
27
|
-
"tw-animate-css": "^1.4.0",
|
|
28
|
-
"zustand": "^5.0.14"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@tailwindcss/vite": "^4.3.3",
|
|
32
|
-
"@types/node": "latest",
|
|
33
|
-
"@types/react": "^19.2.7",
|
|
34
|
-
"@types/react-dom": "^19.2.3",
|
|
35
|
-
"@vitejs/plugin-react": "^5.1.1",
|
|
36
|
-
"@widget-js/cli": "
|
|
37
|
-
"@widget-js/vite-plugin-widget": "
|
|
38
|
-
"tailwindcss": "^4.3.3",
|
|
39
|
-
"typescript": "latest",
|
|
40
|
-
"vite": "latest"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "hello-widget",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"preview": "vite preview",
|
|
9
|
+
"build": "vite build",
|
|
10
|
+
"build:offline": "vite build --mode offline",
|
|
11
|
+
"update:widgetjs": "widget dependencies -t remote"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@fontsource-variable/geist": "^5.3.0",
|
|
15
|
+
"@widget-js/core": "^26.7.24",
|
|
16
|
+
"@widget-js/react": "^26.7.23",
|
|
17
|
+
"class-variance-authority": "^0.7.1",
|
|
18
|
+
"clsx": "^2.1.1",
|
|
19
|
+
"lucide-react": "^1.25.0",
|
|
20
|
+
"radix-ui": "^1.6.3",
|
|
21
|
+
"react": "^19.2.0",
|
|
22
|
+
"react-dom": "^19.2.0",
|
|
23
|
+
"react-router-dom": "^7.9.1",
|
|
24
|
+
"shadcn": "^4.13.1",
|
|
25
|
+
"styled-components": "^6.4.4",
|
|
26
|
+
"tailwind-merge": "^3.6.0",
|
|
27
|
+
"tw-animate-css": "^1.4.0",
|
|
28
|
+
"zustand": "^5.0.14"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
32
|
+
"@types/node": "latest",
|
|
33
|
+
"@types/react": "^19.2.7",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
36
|
+
"@widget-js/cli": "^26.7.22",
|
|
37
|
+
"@widget-js/vite-plugin-widget": "^26.7.25",
|
|
38
|
+
"tailwindcss": "^4.3.3",
|
|
39
|
+
"typescript": "latest",
|
|
40
|
+
"vite": "latest"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -47,8 +47,16 @@
|
|
|
47
47
|
"backgroundThrottling": true,
|
|
48
48
|
"previewImage": "/preview_clock.png",
|
|
49
49
|
"supportDeployMode": 17,
|
|
50
|
-
"
|
|
51
|
-
|
|
50
|
+
"configPage": {
|
|
51
|
+
"path": "/widget/config/clock",
|
|
52
|
+
"frame": true,
|
|
53
|
+
"transparent": false,
|
|
54
|
+
"width": 700,
|
|
55
|
+
"height": 800,
|
|
56
|
+
"resizable": true,
|
|
57
|
+
"maximizable": true,
|
|
58
|
+
"alwaysOnTop": false
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
61
|
],
|
|
54
62
|
"pages": []
|
|
@@ -57,34 +57,6 @@ body {
|
|
|
57
57
|
color: #f4f7fb;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
button,
|
|
61
|
-
input {
|
|
62
|
-
font: inherit;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
code {
|
|
66
|
-
padding: 0.12rem 0.35rem;
|
|
67
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
68
|
-
border-radius: 999px;
|
|
69
|
-
background: rgba(255, 255, 255, 0.08);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
a {
|
|
73
|
-
color: inherit;
|
|
74
|
-
text-decoration: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.toggle {
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
gap: 12px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.toggle input {
|
|
84
|
-
width: 18px;
|
|
85
|
-
height: 18px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
60
|
.config-preview {
|
|
89
61
|
display: grid;
|
|
90
62
|
place-items: center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WidgetThemeOption } from '@widget-js/react'
|
|
2
|
-
import {
|
|
2
|
+
import { useWidgetStorage, useWidgetTheme, WidgetThemeForm, Window } from '@widget-js/react'
|
|
3
3
|
import { Button } from '@/components/ui/button'
|
|
4
4
|
import {
|
|
5
5
|
Field,
|
|
@@ -21,7 +21,6 @@ const clockThemeOption: WidgetThemeOption = {
|
|
|
21
21
|
} as const
|
|
22
22
|
|
|
23
23
|
export default function ClockConfigView() {
|
|
24
|
-
const { save } = useWidget()
|
|
25
24
|
const { widgetTheme, setWidgetTheme } = useWidgetTheme()
|
|
26
25
|
const [title, setTitle] = useWidgetStorage('title', 'Clock')
|
|
27
26
|
const [use24Hour, setUse24Hour] = useWidgetStorage('use-24-hour', true)
|
|
@@ -32,10 +31,10 @@ export default function ClockConfigView() {
|
|
|
32
31
|
title={title}
|
|
33
32
|
footer={(
|
|
34
33
|
<div className="flex flex-wrap justify-end gap-3">
|
|
35
|
-
<Button type="button" variant="outline" onClick={() =>
|
|
34
|
+
<Button type="button" variant="outline" onClick={() => window.close()}>
|
|
36
35
|
应用
|
|
37
36
|
</Button>
|
|
38
|
-
<Button type="button" onClick={() =>
|
|
37
|
+
<Button type="button" onClick={() => window.close()}>
|
|
39
38
|
保存并关闭
|
|
40
39
|
</Button>
|
|
41
40
|
</div>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RouteObject } from 'react-router-dom'
|
|
2
2
|
import { createElement } from 'react'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import ClockConfigView from './clock-config-view'
|
|
4
|
+
import ClockWidgetView from './clock-widget-view'
|
|
5
|
+
import ClockWidget from './clock.widget'
|
|
6
6
|
|
|
7
7
|
const path = ClockWidget.path
|
|
8
8
|
const name = ClockWidget.name
|
|
9
9
|
|
|
10
|
-
const configPagePath = ClockWidget.
|
|
10
|
+
const configPagePath = ClockWidget.configPage!.path
|
|
11
11
|
|
|
12
12
|
const ClockWidgetRoutes: RouteObject[] = [
|
|
13
13
|
{
|
|
@@ -15,7 +15,16 @@ const ClockWidget = new Widget({
|
|
|
15
15
|
maxHeight: 6,
|
|
16
16
|
previewImage: '/preview_clock.png',
|
|
17
17
|
path: '/widget/clock',
|
|
18
|
-
|
|
18
|
+
configPage: {
|
|
19
|
+
path: '/widget/config/clock',
|
|
20
|
+
frame: true,
|
|
21
|
+
transparent: false,
|
|
22
|
+
width: 700,
|
|
23
|
+
height: 800,
|
|
24
|
+
resizable: true,
|
|
25
|
+
maximizable: true,
|
|
26
|
+
alwaysOnTop: false,
|
|
27
|
+
},
|
|
19
28
|
})
|
|
20
29
|
|
|
21
30
|
export default ClockWidget
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { RouteObject } from 'react-router-dom'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export const widgets = [
|
|
6
|
-
ClockWidget,
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
export const widgetRoutes: RouteObject[] = [
|
|
10
|
-
...ClockWidgetRoutes,
|
|
11
|
-
]
|
|
1
|
+
import type { RouteObject } from 'react-router-dom'
|
|
2
|
+
import ClockWidgetRoutes from './clock/clock-widget-routes'
|
|
3
|
+
import ClockWidget from './clock/clock.widget'
|
|
4
|
+
|
|
5
|
+
export const widgets = [
|
|
6
|
+
ClockWidget,
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
export const widgetRoutes: RouteObject[] = [
|
|
10
|
+
...ClockWidgetRoutes,
|
|
11
|
+
]
|
|
File without changes
|