xinyu-pro 0.21.0
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/.env.example +21 -0
- package/README.md +36 -0
- package/app/api/chat/route.ts +84 -0
- package/app/api/generate-svg/route.ts +171 -0
- package/app/api/generate-theme/route.ts +137 -0
- package/app/api/plugins/bindings/route.ts +173 -0
- package/app/api/plugins/export/route.ts +122 -0
- package/app/api/plugins/export-xye/route.ts +156 -0
- package/app/api/plugins/files/route.ts +146 -0
- package/app/api/plugins/files-list/route.ts +168 -0
- package/app/api/plugins/files-upload/route.ts +101 -0
- package/app/api/plugins/files-write/route.ts +272 -0
- package/app/api/plugins/import/route.ts +140 -0
- package/app/api/plugins/import-package/route.ts +231 -0
- package/app/api/plugins/resources/route.ts +109 -0
- package/app/api/plugins/route.ts +308 -0
- package/app/api/plugins/scan/route.ts +280 -0
- package/app/api/plugins/storage/route.ts +146 -0
- package/app/api/sessions/route.ts +165 -0
- package/app/api/settings/route.ts +40 -0
- package/app/api/suggest-fields/route.ts +129 -0
- package/app/api/templates/route.ts +159 -0
- package/app/api/test-api/route.ts +63 -0
- package/app/editor/page.tsx +1466 -0
- package/app/extensions/create/page.tsx +1422 -0
- package/app/extensions/edit/[id]/page.tsx +2342 -0
- package/app/extensions/page.tsx +1572 -0
- package/app/extensions/tutorial/page.tsx +4258 -0
- package/app/favicon.ico +0 -0
- package/app/fonts/GeistMonoVF.woff +0 -0
- package/app/fonts/GeistVF.woff +0 -0
- package/app/game/[id]/page.tsx +996 -0
- package/app/globals.css +3 -0
- package/app/layout.tsx +26 -0
- package/app/loading.tsx +26 -0
- package/app/page.tsx +345 -0
- package/app/settings/page.tsx +1490 -0
- package/bin/cli.js +262 -0
- package/components/ChatInput.tsx +106 -0
- package/components/ChatWindow.tsx +52 -0
- package/components/FullPageLoader.tsx +107 -0
- package/components/LoadingDots.tsx +20 -0
- package/components/MathCurveLoader.tsx +173 -0
- package/components/MessageBubble.tsx +147 -0
- package/components/WorldCardPreview.tsx +98 -0
- package/components/WorldCardUploader.tsx +58 -0
- package/components/ui/ConfirmDialog.tsx +135 -0
- package/components/ui/PageHeader.tsx +99 -0
- package/components/ui/PermissionConflictDialog.tsx +206 -0
- package/components/ui/PluginConfigForm.tsx +192 -0
- package/components/ui/PluginFloatingLayer.tsx +52 -0
- package/components/ui/PluginIcon.tsx +53 -0
- package/components/ui/PluginModalRenderer.tsx +185 -0
- package/components/ui/PluginProvider.tsx +1038 -0
- package/components/ui/PluginSlotRenderer.tsx +76 -0
- package/components/ui/ThemeCustomizer.tsx +174 -0
- package/components/ui/ThemeProvider.tsx +125 -0
- package/components/ui/ThemeSwitcher.tsx +140 -0
- package/components/ui/ToastProvider.tsx +141 -0
- package/lib/builtin-plugins.ts +11 -0
- package/lib/db-init.ts +35 -0
- package/lib/db.ts +244 -0
- package/lib/manifest-parser.ts +185 -0
- package/lib/parseWorldCard.ts +110 -0
- package/lib/plugin-dom-sandbox.ts +327 -0
- package/lib/plugin-events.ts +88 -0
- package/lib/plugin-files.ts +186 -0
- package/lib/plugin-html-sanitizer.ts +79 -0
- package/lib/plugin-resource-tracker.ts +175 -0
- package/lib/plugin-runtime.ts +2287 -0
- package/lib/plugin-security.ts +151 -0
- package/lib/plugin-types.ts +416 -0
- package/lib/prompt-builder.ts +55 -0
- package/lib/router-history.ts +119 -0
- package/lib/storage.ts +381 -0
- package/lib/themes.ts +129 -0
- package/lib/types.ts +117 -0
- package/lib/version.ts +55 -0
- package/next.config.mjs +43 -0
- package/package.json +56 -0
- package/plugins/xinyu.bag-system.xye +0 -0
- package/plugins/xinyu.cache-optimizer.xye +0 -0
- package/plugins/xinyu.dice-arbiter.xye +0 -0
- package/plugins/xinyu.game-auto-start-choices.xye +0 -0
- package/plugins/xinyu.markdown-render.xye +0 -0
- package/plugins/xinyu.slot-ui-beautify.xye +0 -0
- package/plugins/xinyu.world-info.xye +0 -0
- package/postcss.config.mjs +8 -0
- package/public/templates/atlantis.svg +63 -0
- package/public/templates/cyber-city.svg +68 -0
- package/public/templates/jianghu.svg +69 -0
- package/public/templates//351/255/224/346/263/225/344/270/226/347/225/214.svg +137 -0
- package/styles/themes.css +111 -0
- package/tailwind.config.ts +18 -0
- package/tsconfig.json +26 -0
- package/version.json +6 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* styles/themes.css - 主题 CSS 变量定义 */
|
|
2
|
+
|
|
3
|
+
/* 默认主题(暗夜紫)- 通过 JS 动态覆盖 */
|
|
4
|
+
:root {
|
|
5
|
+
--color-bg-primary: #0f0a1a;
|
|
6
|
+
--color-bg-secondary: #1a1128;
|
|
7
|
+
--color-bg-tertiary: #2a1f3d;
|
|
8
|
+
--color-text-primary: #e8e0f0;
|
|
9
|
+
--color-text-secondary: #a89bc2;
|
|
10
|
+
--color-text-muted: #6b5f85;
|
|
11
|
+
--color-accent: #d4a843;
|
|
12
|
+
--color-accent-hover: #e6bc5a;
|
|
13
|
+
--color-border: #2a1f3d;
|
|
14
|
+
--color-shadow: rgba(0, 0, 0, 0.5);
|
|
15
|
+
--color-user-bubble: #2a1f3d;
|
|
16
|
+
--color-ai-bubble: #1a1128;
|
|
17
|
+
--font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
18
|
+
--font-heading: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', serif;
|
|
19
|
+
--border-radius: 12px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* 全局基础样式 */
|
|
23
|
+
body {
|
|
24
|
+
font-family: var(--font-body);
|
|
25
|
+
color: var(--color-text-primary);
|
|
26
|
+
background-color: var(--color-bg-primary);
|
|
27
|
+
transition: background-color 0.3s ease, color 0.3s ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* 主题切换过渡动画 */
|
|
31
|
+
* {
|
|
32
|
+
transition-property: background-color, border-color, color, box-shadow;
|
|
33
|
+
transition-duration: 0.2s;
|
|
34
|
+
transition-timing-function: ease;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ==================== 全局按钮 Hover 样式 ==================== */
|
|
38
|
+
|
|
39
|
+
/* 带边框的普通按钮 hover */
|
|
40
|
+
button[style*="border-color"] {
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
button[style*="border-color"]:hover {
|
|
44
|
+
border-color: var(--color-accent) !important;
|
|
45
|
+
color: var(--color-accent) !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* 强调色背景按钮 hover(开始冒险、保存设置等) */
|
|
49
|
+
button[style*="background-color: var(--color-accent)"]:hover {
|
|
50
|
+
filter: brightness(1.15);
|
|
51
|
+
box-shadow: 0 2px 12px var(--color-shadow);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* 带图标的工具按钮 hover(返回、导入等小按钮) */
|
|
55
|
+
button[style*="color: var(--color-text-secondary)"]:hover,
|
|
56
|
+
button[style*="color: var(--color-text-muted)"]:hover {
|
|
57
|
+
color: var(--color-accent) !important;
|
|
58
|
+
background-color: var(--color-bg-tertiary) !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Tab 按钮特殊处理:非激活态 hover */
|
|
62
|
+
button[class*="rounded-md"]:hover {
|
|
63
|
+
background-color: var(--color-bg-tertiary) !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 覆盖层内按钮 hover(模板卡片编辑/删除) */
|
|
67
|
+
button[style*="rgba(255,255,255,0.2)"]:hover {
|
|
68
|
+
background-color: rgba(255, 255, 255, 0.35) !important;
|
|
69
|
+
}
|
|
70
|
+
button[style*="rgba(255,255,255,0.1)"]:hover {
|
|
71
|
+
background-color: rgba(255, 255, 255, 0.25) !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* 危险按钮 hover(删除、清除等红色按钮) */
|
|
75
|
+
button[style*="rgba(220, 38, 38"]:hover {
|
|
76
|
+
background-color: rgba(220, 38, 38, 0.15) !important;
|
|
77
|
+
border-color: rgba(220, 38, 38, 0.5) !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 左侧分类导航按钮 hover */
|
|
81
|
+
nav button:hover {
|
|
82
|
+
background-color: var(--color-bg-tertiary) !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* 禁用按钮不应用 hover */
|
|
86
|
+
button:disabled {
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
opacity: 0.5;
|
|
89
|
+
}
|
|
90
|
+
button:disabled:hover {
|
|
91
|
+
filter: none !important;
|
|
92
|
+
box-shadow: none !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* 滚动条样式 */
|
|
96
|
+
::-webkit-scrollbar {
|
|
97
|
+
width: 6px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::-webkit-scrollbar-track {
|
|
101
|
+
background: var(--color-bg-primary);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
::-webkit-scrollbar-thumb {
|
|
105
|
+
background: var(--color-text-muted);
|
|
106
|
+
border-radius: 3px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
::-webkit-scrollbar-thumb:hover {
|
|
110
|
+
background: var(--color-text-secondary);
|
|
111
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Config } from "tailwindcss";
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
content: [
|
|
5
|
+
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
6
|
+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
7
|
+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
8
|
+
],
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {
|
|
11
|
+
borderRadius: {
|
|
12
|
+
theme: 'var(--border-radius)',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
plugins: [],
|
|
17
|
+
};
|
|
18
|
+
export default config;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"jsx": "preserve",
|
|
14
|
+
"incremental": true,
|
|
15
|
+
"plugins": [
|
|
16
|
+
{
|
|
17
|
+
"name": "next"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["./*"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
25
|
+
"exclude": ["node_modules"]
|
|
26
|
+
}
|