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.
Files changed (96) hide show
  1. package/.env.example +21 -0
  2. package/README.md +36 -0
  3. package/app/api/chat/route.ts +84 -0
  4. package/app/api/generate-svg/route.ts +171 -0
  5. package/app/api/generate-theme/route.ts +137 -0
  6. package/app/api/plugins/bindings/route.ts +173 -0
  7. package/app/api/plugins/export/route.ts +122 -0
  8. package/app/api/plugins/export-xye/route.ts +156 -0
  9. package/app/api/plugins/files/route.ts +146 -0
  10. package/app/api/plugins/files-list/route.ts +168 -0
  11. package/app/api/plugins/files-upload/route.ts +101 -0
  12. package/app/api/plugins/files-write/route.ts +272 -0
  13. package/app/api/plugins/import/route.ts +140 -0
  14. package/app/api/plugins/import-package/route.ts +231 -0
  15. package/app/api/plugins/resources/route.ts +109 -0
  16. package/app/api/plugins/route.ts +308 -0
  17. package/app/api/plugins/scan/route.ts +280 -0
  18. package/app/api/plugins/storage/route.ts +146 -0
  19. package/app/api/sessions/route.ts +165 -0
  20. package/app/api/settings/route.ts +40 -0
  21. package/app/api/suggest-fields/route.ts +129 -0
  22. package/app/api/templates/route.ts +159 -0
  23. package/app/api/test-api/route.ts +63 -0
  24. package/app/editor/page.tsx +1466 -0
  25. package/app/extensions/create/page.tsx +1422 -0
  26. package/app/extensions/edit/[id]/page.tsx +2342 -0
  27. package/app/extensions/page.tsx +1572 -0
  28. package/app/extensions/tutorial/page.tsx +4258 -0
  29. package/app/favicon.ico +0 -0
  30. package/app/fonts/GeistMonoVF.woff +0 -0
  31. package/app/fonts/GeistVF.woff +0 -0
  32. package/app/game/[id]/page.tsx +996 -0
  33. package/app/globals.css +3 -0
  34. package/app/layout.tsx +26 -0
  35. package/app/loading.tsx +26 -0
  36. package/app/page.tsx +345 -0
  37. package/app/settings/page.tsx +1490 -0
  38. package/bin/cli.js +262 -0
  39. package/components/ChatInput.tsx +106 -0
  40. package/components/ChatWindow.tsx +52 -0
  41. package/components/FullPageLoader.tsx +107 -0
  42. package/components/LoadingDots.tsx +20 -0
  43. package/components/MathCurveLoader.tsx +173 -0
  44. package/components/MessageBubble.tsx +147 -0
  45. package/components/WorldCardPreview.tsx +98 -0
  46. package/components/WorldCardUploader.tsx +58 -0
  47. package/components/ui/ConfirmDialog.tsx +135 -0
  48. package/components/ui/PageHeader.tsx +99 -0
  49. package/components/ui/PermissionConflictDialog.tsx +206 -0
  50. package/components/ui/PluginConfigForm.tsx +192 -0
  51. package/components/ui/PluginFloatingLayer.tsx +52 -0
  52. package/components/ui/PluginIcon.tsx +53 -0
  53. package/components/ui/PluginModalRenderer.tsx +185 -0
  54. package/components/ui/PluginProvider.tsx +1038 -0
  55. package/components/ui/PluginSlotRenderer.tsx +76 -0
  56. package/components/ui/ThemeCustomizer.tsx +174 -0
  57. package/components/ui/ThemeProvider.tsx +125 -0
  58. package/components/ui/ThemeSwitcher.tsx +140 -0
  59. package/components/ui/ToastProvider.tsx +141 -0
  60. package/lib/builtin-plugins.ts +11 -0
  61. package/lib/db-init.ts +35 -0
  62. package/lib/db.ts +244 -0
  63. package/lib/manifest-parser.ts +185 -0
  64. package/lib/parseWorldCard.ts +110 -0
  65. package/lib/plugin-dom-sandbox.ts +327 -0
  66. package/lib/plugin-events.ts +88 -0
  67. package/lib/plugin-files.ts +186 -0
  68. package/lib/plugin-html-sanitizer.ts +79 -0
  69. package/lib/plugin-resource-tracker.ts +175 -0
  70. package/lib/plugin-runtime.ts +2287 -0
  71. package/lib/plugin-security.ts +151 -0
  72. package/lib/plugin-types.ts +416 -0
  73. package/lib/prompt-builder.ts +55 -0
  74. package/lib/router-history.ts +119 -0
  75. package/lib/storage.ts +381 -0
  76. package/lib/themes.ts +129 -0
  77. package/lib/types.ts +117 -0
  78. package/lib/version.ts +55 -0
  79. package/next.config.mjs +43 -0
  80. package/package.json +56 -0
  81. package/plugins/xinyu.bag-system.xye +0 -0
  82. package/plugins/xinyu.cache-optimizer.xye +0 -0
  83. package/plugins/xinyu.dice-arbiter.xye +0 -0
  84. package/plugins/xinyu.game-auto-start-choices.xye +0 -0
  85. package/plugins/xinyu.markdown-render.xye +0 -0
  86. package/plugins/xinyu.slot-ui-beautify.xye +0 -0
  87. package/plugins/xinyu.world-info.xye +0 -0
  88. package/postcss.config.mjs +8 -0
  89. package/public/templates/atlantis.svg +63 -0
  90. package/public/templates/cyber-city.svg +68 -0
  91. package/public/templates/jianghu.svg +69 -0
  92. package/public/templates//351/255/224/346/263/225/344/270/226/347/225/214.svg +137 -0
  93. package/styles/themes.css +111 -0
  94. package/tailwind.config.ts +18 -0
  95. package/tsconfig.json +26 -0
  96. 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
+ }
package/version.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": "0.21.0",
3
+ "name": "xinyu-pro",
4
+ "displayName": "星语 Pro",
5
+ "description": "AI 驱动的互动叙事平台"
6
+ }