diff --git a/.gitignore b/.gitignore index f3d34641..3ba8e083 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,6 @@ node_modules/ /e2e/ /.e2e/ /tests/ -*.test.* -*.spec.* -# Maintained unit regressions are source; local acceptance suites stay ignored. -!test/unit/*.test.js /playwright/.auth/ /playwright-report/ /test-results/ diff --git a/AGENTS.md b/AGENTS.md index 2fc4dcf3..26a2d4fe 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -60,7 +60,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd - **样式**:不新增 ConfigProvider、主题状态或存储 key;颜色只来自 token 或页面变量,JSX 不写十六进制,不用全局 `!important`。 - **图标与依赖**:按钮图标从 `src/components/common/icons/ActionIcons.js` 导入,装饰图标用 `lucide-react`;禁止引入 Semi、Radix UI、Floating UI、`@lobehub/*`、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit。 - **请求**:只用 `API`,参数用 `params`,先判 `success`;分页 `p` 从 1 开始、`page_size` ≤ 100;`catch` 不重复提示 AxiosError;`finally` 回收 loading。 -- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;新 `.js` / `.jsx` 带 AGPL 许可证头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。 +- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;不重复添加通用长版权文件头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。 - **可访问性**:交互元素可键盘操作且焦点可见;纯图标按钮加 `aria-label`;状态不只靠颜色表达;动效遵守 `prefers-reduced-motion`。 ## 5. 目录规则 @@ -123,7 +123,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd - 新规则先写入对应 `docs/` 文档,再在第 6 节加索引;改动只动相关段落,更新本节版本与日期。 - 文档的新增、调整、删除按 `docs/README.md` 的“阅读与维护”执行;删除与重命名需用户确认清单。 -> 规范版本:v3.6 · 更新:2026-11-19 +> 规范版本:v3.7 · 更新:2026-11-20 ## 10. 工具差异(本节允许不同) diff --git a/CLAUDE.md b/CLAUDE.md index e32c4587..d61bf9b4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -60,7 +60,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd - **样式**:不新增 ConfigProvider、主题状态或存储 key;颜色只来自 token 或页面变量,JSX 不写十六进制,不用全局 `!important`。 - **图标与依赖**:按钮图标从 `src/components/common/icons/ActionIcons.js` 导入,装饰图标用 `lucide-react`;禁止引入 Semi、Radix UI、Floating UI、`@lobehub/*`、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit。 - **请求**:只用 `API`,参数用 `params`,先判 `success`;分页 `p` 从 1 开始、`page_size` ≤ 100;`catch` 不重复提示 AxiosError;`finally` 回收 loading。 -- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;新 `.js` / `.jsx` 带 AGPL 许可证头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。 +- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;不重复添加通用长版权文件头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。 - **可访问性**:交互元素可键盘操作且焦点可见;纯图标按钮加 `aria-label`;状态不只靠颜色表达;动效遵守 `prefers-reduced-motion`。 ## 5. 目录规则 @@ -123,7 +123,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd - 新规则先写入对应 `docs/` 文档,再在第 6 节加索引;改动只动相关段落,更新本节版本与日期。 - 文档的新增、调整、删除按 `docs/README.md` 的“阅读与维护”执行;删除与重命名需用户确认清单。 -> 规范版本:v3.6 · 更新:2026-11-19 +> 规范版本:v3.7 · 更新:2026-11-20 ## 10. 工具差异(本节允许不同) diff --git a/NOTICE.md b/NOTICE.md new file mode 100644 index 00000000..0689b9bb --- /dev/null +++ b/NOTICE.md @@ -0,0 +1,18 @@ +# Copyright and License Notice + +Copyright (C) 2025 QuantumNous + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +For commercial licensing, please contact support@quantumnous.com diff --git a/README.md b/README.md index b0190b6b..495f8908 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ monkey-ai-web/ - **路由与权限**:在 `src/App.jsx` 注册路由,用 `PrivateRoute`、`AdminRoute`(role ≥ 10)、`RootRoute`(role ≥ 100)守卫;企业中心子路由在 `src/pages/Organization/index.jsx`。部分模块的可见性来自 `/api/status`,不能只靠隐藏菜单控制权限。 - **UI**:通用组件用 Ant Design;存量页面经 `src/components/ui` 适配层保留原契约;主题只由 `UiThemeProvider` 提供,不新增 ConfigProvider;按钮图标从 `src/components/common/icons/ActionIcons.js` 导入。页面改动需检查浅色、深色与窄屏。 - **国际化**:文案写 `t('中文原文')`,新 key 补齐 `src/i18n/locales/` 下 9 个语言包;运行时开放语言以 `src/i18n/catalog.js` 为准(简中、繁中、英、日、韩、越、泰),`fr.json`、`ru.json` 尚未登记。 -- **文件头**:每个 `.js` / `.jsx` 顶部须带 AGPL 许可证注释(ESLint 强制),参考相邻文件。 +- **版权声明**:通用版权与许可声明见 [NOTICE.md](NOTICE.md),源码无需重复添加长文件头;保留独立的第三方声明。 ## 6. 常用命令与提交检查 @@ -143,11 +143,12 @@ monkey-ai-web/ | --- | --- | | `npm run dev` | 启动开发服务 | | `npm run build` | 生产构建,输出 `dist/` | +| `npm run verify:build -- <产物目录> --startup` | 校验静态入口、首屏 JS gzip 预算和按需加载边界;产物须用 `--manifest` 生成 | | `npm run preview` | 本地预览构建结果(默认端口 4173) | -| `npm test -- --test-concurrency=1` | 串行运行单测(扫描 `src/`、`tests/`、`test/unit/`) | +| `npm test -- --test-concurrency=1` | 串行运行单测(扫描 `src/`、`tests/`、`test/unit/`;新增共享单测放 `test/unit/`) | | `npm run eslint` / `npm run eslint:fix` | ESLint 检查(零警告门禁)/ 自动修复 | | `npm run lint` / `npm run lint:fix` | Prettier 检查 / 全仓格式化 | -| `npm run check:ui` | UI 依赖、完整 lock 图与品牌图标资产 hash 审计 | +| `npm run check:ui` | 审计应用源码、脚本、单测和根目录 JS 配置中的旧 UI 库引用,以及依赖声明、锁文件和品牌图标资产 SHA-256 | | `npm run check` | 依次执行 `check:ui`、ESLint、单测与生产构建,任一步失败即停止 | | `npm run vendor:icons` | 重新生成品牌图标资产 | | `npm run test:e2e` / `test:e2e:headed` / `test:e2e:report` | Playwright 验收 / 有头运行 / 查看报告 | @@ -191,6 +192,9 @@ Trace、失败截图、CI JUnit 在 `test-results//`,HTML 在 `playwrig ## 7. 构建与部署 +- **首屏分包**:React 运行时独立缓存,公告和协议预览保留在按需 chunk;首页仅在收到非空 Markdown 时下载解析器。首屏启动 JS 预算为 820 KiB gzip,不含路由按需包和 CSS;验收构建使用 `npm run build -- --manifest --outDir <临时目录>`,再执行 `npm run verify:build -- <临时目录> --startup`。 +- **开发预热**:只预热应用入口、布局和路由,不预热所有页面或禁用依赖发现。没有全量 `vendor` 分组,也没有将图表、文档等浏览器依赖外置。 + ```bash npm ci npm run build diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2b208c3f..9706ffde 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # 变更记录(CHANGELOG) -> 状态:有效(持续追加) · 更新:2026-11-19 · 版本:v3.6 +> 状态:有效(持续追加) · 更新:2026-11-20 · 版本:v3.7 对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。 @@ -10,6 +10,69 @@ ## 2026-11-20 +### 性能 · 开发预热与公共首屏分包 + +- **范围**:Vite 开发和生产配置、应用启动、首页和认证页的加载边界。 +- **变更**:预热入口、布局和路由;启动路径直接导入所需模块,拆出可单独缓存的 React 运行时;公告、协议预览和首页 Markdown 解析按需加载。 +- **影响**:减少默认首页和认证页首屏 JS,不改变接口、权限、设置与登录流程;支持基于构建清单验收启动预算及懒加载边界。 +- **回滚**:仅逆向恢复本条对应的配置、显式导入、懒加载与产物校验差异。 +- **关联**:`vite.config.js`、`src/index.jsx`、`src/components/auth/LazyAgreementModal.jsx`、`scripts/verify-build.mjs`。 + +### 修复 · 旧 UI 库审计规则统一 + +- **范围**:ESLint、UI 依赖审计、回归单测与开发文档。 +- **变更**:通过共享规则拦截旧 UI 包的导入、重导出及静态可确定的动态加载;审计扩展到根目录 JS 配置、脚本和单测,并检查 npm 别名与嵌套传递依赖。 +- **影响**:不改变运行时依赖或 UI 行为;保留本地品牌图标的来源与 SHA-256 校验。 +- **回滚**:仅逆向恢复本条对应的规则、审计、测试和文档差异。 +- **关联**:`eslint.config.cjs`、`scripts/ui-dependency-policy.cjs`、`scripts/check-ui-dependencies.mjs`、`test/unit/ui-dependency-policy.test.js`。 + +### 修复 · 个人密钥管理查询交互对齐 + +- **范围**:用户中心密钥管理的查询、搜索、分页。 +- **变更**:保留按名称、Key 或分组匹配的单输入框,对齐控制台的输入防抖、立即搜索和重置操作。 +- **影响**:普通列表复用 `/api/token/` 服务端分页;搜索复用该个人接口取全,在本地匹配和分页,不调用管理员接口。 +- **回滚**:仅逆向恢复本条对应的查询表单和密钥数据加载差异。 +- **关联**:`src/pages/KeyManagement/index.jsx`、`src/hooks/tokens/useTokensData.jsx`、`docs/ui/KEY_MANAGEMENT_SPEC.md`。 + +### 修复 · 客服浮钮收起箭头残留 + +- **范围**:全站右下角客服浮钮。 +- **变更**:从展开状态打开面板后,仅用底部圆形关闭按钮关闭时保留收起箭头;点面板右上角关闭或外部时隐藏箭头。点击侧边展开按钮后,箭头不再因按钮位置变化而立即消失;从收起状态临时打开面板后仍回到收起状态。 +- **影响**:保留键盘焦点反馈和触屏收起入口,不改变客服会话逻辑。 +- **回滚**:逆向恢复本条对应的客服浮钮焦点处理和样式差异。 +- **关联**:`src/components/customer-service/index.jsx`、`src/components/customer-service/styles.css`。 + +### 修复 · 全站表格统一分页 + +- **范围**:各中心、业务页面、卡片和弹层内原有分页的表格。 +- **变更**:统一为密钥管理的小型右对齐分页,补齐单页结果的条数入口和移动端跳页;未启用分页的表格保持原样。 +- **影响**:前端分页继续使用已加载数据,接口分页沿用原接口与筛选条件;换条数回到第一页,已分页的行不再二次切片。密钥管理本地筛选不再仅查当前接口页;兑换码翻页和换条数保留已提交的关键词。 +- **回滚**:逆向恢复本条对应的共享分页、页面分页接入、测试和规范差异。 + +### 更新 · 移除重复的长版权文件头 + +- **范围**:源码、脚本、样式、配置和测试中的统一长文件头。 +- **变更**:将原声明集中到 `NOTICE.md`,移除重复模板、ESLint 文件头规则及相关依赖。 +- **影响**:不改变业务逻辑,独立版权和第三方声明保持原样。 +- **回滚**:按本条差异逆向恢复长文件头、规则、依赖和规范,保留其他工作区改动。 +- **关联**:`NOTICE.md`、`eslint.config.cjs`、`package.json`、`package-lock.json`、`docs/standards/DEV_STANDARDS.md`。 + +### 修复 · ESLint 不再自动补写许可证头 + +- **范围**:JavaScript / JSX 许可证头检查。 +- **变更**:保留原许可证校验,关闭该规则的自动写入与替换。 +- **影响**:文件头缺失仍报错,现有版权和许可证声明保持不变。 +- **回滚**:还原本条配置和文档差异。 +- **关联**:`eslint.config.cjs`、`README.md`、`docs/standards/DEV_STANDARDS.md`。 + +### 修复 · 共享单测不再被全局忽略 + +- **范围**:Git 忽略规则和前端单测目录。 +- **变更**:移除按测试扩展名全局忽略的规则,将 12 个本地回归测试迁入 `test/unit/`,保留已跟踪的存量测试。 +- **影响**:团队可共享这些测试;本地验收目录仍被忽略,不改变生产代码。 +- **回滚**:恢复本条忽略规则与文档差异,并将迁移用例按原路径移回。 +- **关联**:`.gitignore`、`test/unit/`、`docs/standards/DEV_STANDARDS.md`、`README.md`。 + ### 修复 · 全量 undefined / NaN 展示防护与主题兼容回归 - **范围**:分析看板、组织/个人中心、充值/发票/订单/订阅、佣金、渠道模型测试、服务监控,以及亮色/暗色主题下的数字展示路径。 diff --git a/docs/standards/DEV_STANDARDS.md b/docs/standards/DEV_STANDARDS.md index f195f133..23b17e4e 100644 --- a/docs/standards/DEV_STANDARDS.md +++ b/docs/standards/DEV_STANDARDS.md @@ -1,6 +1,6 @@ # 统一开发与 Ant Design CRUD 规范 -> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-18 · 版本:v2.3 +> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-20 · 版本:v2.5 新增与重构 CRUD 的编码规范:目录与命名、组件选择、请求、React 组件与状态、表单与弹层、权限、i18n,以及可直接复制的页面模板。外观取值见 `UI_COMPONENT_STANDARDS.md`。 @@ -18,7 +18,7 @@ | React | 函数组件 + Hooks;派生值在渲染中计算;记忆化只用于测量过的问题(第 4 节) | | 状态命名 | `items`、`total`、`page`、`pageSize`、`filters`、`loading`、`submitting`、`editingRecord`、`drawerOpen` | | 表单 | `Form.useForm` + `rules`;失败不关闭弹层;提交按钮 `loading` 防重复(第 6 节) | -| 文件 | 带 AGPL 许可证头;单测放 `test/unit/`;文案补齐 9 个语言包 | +| 文件 | 不重复添加通用长版权文件头;单测放 `test/unit/`;文案补齐 9 个语言包 | **相关代码**:`src/helpers/api.js`、`src/helpers/utils.jsx`、`src/helpers/paging.js`、`src/helpers/auth.jsx`、`src/components/ui/`、`src/components/console/`、`src/pages/Organization/components/` @@ -39,7 +39,7 @@ | 视图(企业中心) | `src/pages/Organization/Org.jsx`,Hook 放 `src/hooks/org/` | 同上;单文件过大时拆到 `components/` | | 视图(用户中心) | `src/pages/UserCenter/.jsx` + 同名 `.css` | 同上 | | 控制台路由入口 | `src/pages//index.jsx` | 由 `App.jsx` 以 `React.lazy` 加载 | -| 单元测试 | `test/unit/-*.test.js` | `.gitignore` 忽略 `*.test.*`,仅此目录可入库 | +| 单元测试 | `test/unit/-*.test.js` | `.gitignore` 不再按测试扩展名全局忽略;保留已跟踪的存量测试 | ### 1.2 命名 @@ -53,9 +53,9 @@ | 样式 | 页面根类 + 局部变量族 `--<前缀>-*`;文件 kebab-case | `.km-page`、`--km-card-border`、`key-management.css` | | 后端字段 | 保持 snake_case 原样,不在前端改名 | `created_time`、`page_size` | -### 1.3 必备文件头 +### 1.3 版权声明 -ESLint 规则 `header/header` 要求每个 `.js/.jsx` 顶部带 AGPL 许可证块注释,直接复制任一现有源码文件的第 1–18 行;缺失会让 `npm run eslint` 失败。 +通用版权与许可声明集中保留在 [NOTICE.md](../../NOTICE.md)。源码不重复添加长版权文件头,不移除独立的第三方声明。 ## 2. Ant Design 组件边界 @@ -110,7 +110,7 @@ ESLint 规则 `header/header` 要求每个 `.js/.jsx` 顶部带 AGPL 许可证 - 外观取值(颜色、间距、圆角、字号、各组件样式)以 `docs/standards/UI_COMPONENT_STANDARDS.md` 为准,本文只写编码约束。 - 按钮与操作图标:`import { Plus, Pencil, Trash2, RefreshCw, Search } from '@/components/common/icons/ActionIcons'`,按钮内传 `size={16}`;装饰图标用 `lucide-react`。 -- 禁止导入 `@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(ESLint `no-restricted-imports` 与 `npm run check:ui` 拦截)。 +- 禁止导入 `@lobehub/*`、Radix UI、Floating UI、Semi、MUI(含旧 `@material-ui/*`)、Chakra、Headless UI、leva、antd-style、react-layout-kit。ESLint 的 `ui-dependencies/no-legacy-ui` 与 `npm run check:ui` 共用 `scripts/ui-dependency-policy.cjs`,不要在入口重复维护包名。 - JSX 不写十六进制颜色;不用全局 `!important`;新视图不用 Tailwind 颜色类(如 `text-gray-500`),改用 token 或页面变量。 ## 3. 请求封装与错误处理 @@ -202,7 +202,7 @@ try { - 批量操作:`rowSelection={{ selectedRowKeys, onChange: setSelectedRowKeys }}`。 - 删除后的页码回退、筛选后的页码重置放在 hook 中处理(不要散落在组件中)。 - 列设置只用于已有该功能的表格(`docs/ui/TABLE_COLUMN_SETTINGS_SPEC.md`)。 -- 分页统一用适配层 `Table` / `Pagination`;`/console`、`/org` 下自动统一,其他路由按下例显式传入,避免改页容量时请求两次: +- 所有路由的分页表格用适配层 `Table` / `Pagination`。完整数据交给 `Table` 本地分页,不传 `total`;已由页面筛选切片或由接口返回单页数据时传 `total`,表格不会再次切片。未开启分页的表格保持原样。受控分页按下例传入,条数回调自行回到第 1 页,不再触发翻页回调: ```jsx pagination={{ @@ -211,10 +211,6 @@ pagination={{ total, onPageChange: handlePageChange, onPageSizeChange: handlePageSizeChange, - showSizeChanger: true, - pageSizeOpts: [10, 20, 50, 100], - showTotal: (count) => t('共 {{total}} 条', { total: count }), - preventPageChangeOnPageSizeChange: true, }} ``` @@ -294,7 +290,7 @@ pagination={{ ### 12.1 检查与构建 - Prettier:`singleQuote`、`jsxSingleQuote`,换行 LF;规范类文档使用紧凑表格(`.prettierrc.mjs` 的 overrides)。 -- ESLint:许可证头、`no-undef`、未使用 import 报错、Hooks 规则、禁用 UI 库导入,`--max-warnings=0`。 +- ESLint:`no-undef`、未使用 import 报错、Hooks 规则、禁用 UI 库导入,`--max-warnings=0`。 ```bash npm run eslint # 0 错误 0 警告 diff --git a/docs/standards/UI_COMPONENT_STANDARDS.md b/docs/standards/UI_COMPONENT_STANDARDS.md index bdcc1a2f..b337f1c9 100644 --- a/docs/standards/UI_COMPONENT_STANDARDS.md +++ b/docs/standards/UI_COMPONENT_STANDARDS.md @@ -1,6 +1,6 @@ # UI 公共组件与样式规范 -> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.5 +> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-20 · 版本:v2.6 所有后台页面共用的主题与组件标准。页面规范只记录与本文不同的部分;编码约定见 `DEV_STANDARDS.md`,外壳与布局见 `GLOBAL_UI_BASELINE.md`。 @@ -172,6 +172,7 @@ html.dark .km-page { - 外观:小尺寸,可切换每页条数 `[10, 20, 50, 100]`,总数文案 `t('共 {{total}} 条', { total })`。 - 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`。第 4 节的标准列表及其明细分页均沿用密钥管理:表格底部右对齐、小尺寸,依次显示“共 N 条”、上一页/页码/下一页、每页条数(10、20、50、100),移动端保留跳页。已加载的明细可本地分页;服务端分页传 `currentPage`、`pageSize`、`total` 以及分页回调,切换每页条数回到第 1 页,只发一次请求。导出仍作用于原有结果范围,不受当前页条数影响。 - 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。`/org/*` 的独立表格、页签和下钻明细均用此分页规则;已加载的树形表格按根节点分页,子节点不拆散;接口已分页时沿用原查询与总数。 +- 受控分页须实现条数回调(或兼容的统一变更回调)才显示条数选择,不用客户端切片模拟固定条数的服务端接口;分页启用且有结果时单页也显示分页栏。 ## 7. 表单项 @@ -245,8 +246,8 @@ html.dark .km-page { 组件分层(antd 原生、中心封装、契约封装、专用组件)及选用方式见 `DEV_STANDARDS.md` 2.1、2.2 节。`src/components/ui/*` 只做视图映射,不放请求、权限与业务状态。 -- 禁止导入:`@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(`eslint.config.cjs` 的 `no-restricted-imports`)。 -- `npm run check:ui` 审计源码导入、完整 lock 图与品牌图标资产 hash,已包含在 `npm run check` 中。 +- 禁用范围见开发规范第 2.4 节;ESLint 与 `npm run check:ui` 共用一份规则,本地品牌图标不是运行时 UI 依赖。 +- `npm run check:ui` 审计根目录 JS 配置、应用源码、脚本和单测的包引用,并检查依赖声明、锁文件中的传递包和别名,以及品牌图标资产 SHA-256。命令已包含在 `npm run check` 中。 - `antd` 与 `@ant-design/icons` 精确锁定版本;`src/components/ui/antd-v5-compat.css` 统一标签间距、分页选择器宽度与必填标记字体,页面样式可以覆盖。 - 当前版本 API 约定:Card 用 `variant`,Drawer 用 `size`,弹层遮罩用 `mask` 配置,Alert 标题用 `title`;样式选择器使用 `.ant-modal-container`、`.ant-alert-title`、`.ant-collapse-body`。聊天消息列表使用 `List`(antd 已标记弃用),替换前需先建立该区域的视觉基线。 diff --git a/docs/ui/KEY_MANAGEMENT_SPEC.md b/docs/ui/KEY_MANAGEMENT_SPEC.md index 86cfd6a6..694aaa4f 100644 --- a/docs/ui/KEY_MANAGEMENT_SPEC.md +++ b/docs/ui/KEY_MANAGEMENT_SPEC.md @@ -12,8 +12,8 @@ | --- | --- | | 路由 | `/user-center/key-management`,旧 `/key-management` 重定向 | | 视图 | `KeyManagement/index.jsx` + `key-management.css`;编辑抽屉由 `EditTokenModal presentation='drawer'` 渲染 | -| 业务 | `useTokensData`、`/api/token*`、`buildTokenPayload`、启停与删除确认不变 | -| 列表 | 固定列宽,每页 5 条;列设置不持久化 | +| 业务 | `useTokensData` 负责后端查询与分页;`buildTokenPayload`、启停与删除确认不变 | +| 列表 | 固定列宽,默认每页 10 条;列设置不持久化 | | 抽屉 | 模型列表 440px;创建 / 编辑 560px(移动 100%) | | 外壳 | 页头与边距按 `GLOBAL_UI_BASELINE.md` 4.4 | @@ -27,7 +27,7 @@ | `src/pages/KeyManagement/key-management.css` | 页面作用域样式与 `--km-*` 变量 | | `src/components/table/tokens/modals/EditTokenDrawer.jsx` | 创建 / 编辑抽屉视图 | | `src/components/table/tokens/modals/EditTokenModal.jsx` | 状态、`formApi`、`submit`、`buildTokenPayload`;`presentation='drawer'` 时渲染抽屉 | -| `src/hooks/tokens/useTokensData.jsx` | 列表、搜索、分页、启停、删除(不改) | +| `src/hooks/tokens/useTokensData.jsx` | 列表、搜索、分页、启停、删除 | 独立路由形态(`.km-page-standalone`)只补顶栏偏移(桌面 100px、移动 80px)。 @@ -36,8 +36,8 @@ | 区域 | 规则 | | --- | --- | | 页头 | `UserCenterPageHeader`;“新手教程 / 查看操作指引”图标按钮保留在右侧 | -| 查询卡 | 单字段:标签 + `Input allowClear`(宽 620px)+“重置”“搜索”;卡片上下内边距 22px,描边 `#f0f0f0`(深色 `--border-subtle`) | -| 列表 | `Table size='middle' tableLayout='fixed'`,列宽 150 / 300 / 150 / 100 / 180 / 100 / 100 / 130;每页 5 条;列设置用 `ColumnSettings`,不持久化 | +| 查询卡 | 保留单输入框,匹配密钥名称、Key 或分组。输入防抖,点击搜索或按回车立即提交,重置取消待提交条件并回到普通列表第 1 页 | +| 列表 | `Table size='middle' tableLayout='fixed'`,列宽 150 / 300 / 150 / 100 / 180 / 100 / 100 / 130;默认每页 10 条;列设置用 `ColumnSettings`,不持久化 | | 状态 | `Switch`(`onChange` 仍走原 `Modal.confirm` → `manageToken`);已过期 / 已耗尽另显示语义 `Tag` | | 分组 | `Tag color='blue'` 无边框 + `Tooltip`;额度为 `Tag color='success'` | | 密钥 | `` 密钥框(底 `#f4f6f9`、描边 `#e4e9ee`,深色引用 `--surface-bg-base` / `--border-subtle`)+ 显示、隐藏、复制图标按钮 + `Tooltip`;脱敏提示 `Alert type='success'` | @@ -48,7 +48,8 @@ ## 3. 保留功能与已知差异 -- 默认名称 `claudeNN`、每页 5 条、过去日期禁用为业务默认;“搜索”与回车即时生效。 +- 默认名称 `claudeNN`、过去日期禁用为业务默认。 +- 普通列表通过 `/api/token/` 服务端分页。个人搜索接口当前不支持单条件同时匹配名称、Key 和分组,也不提供分页结果;为保持原有条件,搜索复用个人列表接口取全后本地匹配和分页,不调用控制台管理接口。未取全时不展示部分搜索结果。 - 技能注入关闭时“绑定技能”字段仅隐藏,仍注册在表单中,载荷不变。 - 模型抽屉不显示来源说明行;“自定义”过期选项选中时仅文字变主色。 - 第三方新手引导(Joyride)沿用其自身配色配置。 diff --git a/eslint.config.cjs b/eslint.config.cjs index 066fef8d..8f6d2b13 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -1,24 +1,8 @@ const globals = require('globals'); -const { rules: headerRules } = require('eslint-plugin-header'); const react = require('eslint-plugin-react'); const reactHooks = require('eslint-plugin-react-hooks'); const unusedImports = require('eslint-plugin-unused-imports'); - -const headerRule = headerRules.header; -const header = { - rules: { - header: { - ...headerRule, - meta: { - ...headerRule.meta, - schema: [ - { enum: ['block', 'line'] }, - { type: 'array', items: { type: 'string' } }, - ], - }, - }, - }, -}; +const { uiDependencyConfig } = require('./scripts/ui-dependency-policy.cjs'); module.exports = [ { @@ -34,6 +18,7 @@ module.exports = [ 'src/assets/brand-icons/*.js', ], }, + uiDependencyConfig, { files: ['**/*.{js,jsx}'], linterOptions: { reportUnusedDisableDirectives: 'off' }, @@ -45,63 +30,11 @@ module.exports = [ }, settings: { react: { version: 'detect' } }, plugins: { - header, react, 'react-hooks': reactHooks, 'unused-imports': unusedImports, }, rules: { - 'no-restricted-imports': [ - 'error', - { - patterns: [ - { - group: [ - '@radix-ui/*', - '@floating-ui/*', - '@lobehub/ui', - '@lobehub/ui/*', - '@lobehub/icons', - '@lobehub/icons/*', - '@douyinfe/semi-*', - '@headlessui/*', - '@mui/*', - '@chakra-ui/*', - 'leva', - 'leva/*', - 'antd-style', - 'react-layout-kit', - ], - message: - 'Use antd public APIs or the audited local brand SVG assets. Preserve legacy components/ui callback contracts.', - }, - ], - }, - ], - 'header/header': [ - 2, - 'block', - [ - '', - 'Copyright (C) 2025 QuantumNous', - '', - 'This program is free software: you can redistribute it and/or modify', - 'it under the terms of the GNU Affero General Public License as', - 'published by the Free Software Foundation, either version 3 of the', - 'License, or (at your option) any later version.', - '', - 'This program is distributed in the hope that it will be useful,', - 'but WITHOUT ANY WARRANTY; without even the implied warranty of', - 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the', - 'GNU Affero General Public License for more details.', - '', - 'You should have received a copy of the GNU Affero General Public License', - 'along with this program. If not, see .', - '', - 'For commercial licensing, please contact support@quantumnous.com', - '', - ], - ], 'no-multiple-empty-lines': ['error', { max: 1 }], // ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)===== diff --git a/i18next.config.js b/i18next.config.js index 4cc65548..eff27be8 100644 --- a/i18next.config.js +++ b/i18next.config.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { defineConfig } from 'i18next-cli'; /** @type {import('i18next-cli').I18nextToolkitConfig} */ diff --git a/package-lock.json b/package-lock.json index 2f450034..6e1d2034 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,6 @@ "autoprefixer": "^10.4.21", "esbuild": "0.21.5", "eslint": "9.39.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-unused-imports": "4.4.1", @@ -5947,16 +5946,6 @@ } } }, - "node_modules/eslint-plugin-header": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", - "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "eslint": ">=7.7.0" - } - }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmmirror.com/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", diff --git a/package.json b/package.json index ba1ea6a3..c868e2f7 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,6 @@ "autoprefixer": "^10.4.21", "esbuild": "0.21.5", "eslint": "9.39.5", - "eslint-plugin-header": "^3.1.1", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-unused-imports": "4.4.1", diff --git a/playwright.config.js b/playwright.config.js index f8aa828f..f5e63241 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { defineConfig } from '@playwright/test'; import { browserChannel, diff --git a/postcss.config.js b/postcss.config.js index 5731ce76..2aa7205d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - export default { plugins: { tailwindcss: {}, diff --git a/scripts/browser-capture.mjs b/scripts/browser-capture.mjs index d1a25f52..27daaa9c 100644 --- a/scripts/browser-capture.mjs +++ b/scripts/browser-capture.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 有头 Chrome 焦点守卫:唯一页面、禁止新建 / 切换标签页、后台建页兜底、前台状态检测。 // 规则见 docs/ui/GLOBAL_UI_BASELINE.md 第 7.1 节。 diff --git a/scripts/browser-environment.mjs b/scripts/browser-environment.mjs index cdd9e94d..6571bdcb 100644 --- a/scripts/browser-environment.mjs +++ b/scripts/browser-environment.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { readFileSync } from 'node:fs'; import { createHash } from 'node:crypto'; import { devices } from '@playwright/test'; diff --git a/scripts/check-ui-dependencies.mjs b/scripts/check-ui-dependencies.mjs index 61e033f7..d9028e83 100644 --- a/scripts/check-ui-dependencies.mjs +++ b/scripts/check-ui-dependencies.mjs @@ -3,20 +3,28 @@ import { createHash } from 'node:crypto'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { Linter } from 'eslint'; +import policy from './ui-dependency-policy.cjs'; const root = fileURLToPath(new URL('../', import.meta.url)); -const forbidden = [ - /^@radix-ui\//, - /^@floating-ui\//, - /^@lobehub\/(?:ui|icons)(?:\/|$)/, - /^@douyinfe\/semi-(?:ui|icons|foundation)(?:\/|$)/, - /^@headlessui\//, - /^@mui\//, - /^@chakra-ui\//, - /^(?:leva|antd-style|react-layout-kit)(?:\/|$)/, -]; -export const isForbiddenUiDependency = (name) => - forbidden.some((pattern) => pattern.test(name)); +const { isForbiddenUiDependency, uiDependencyConfig } = policy; +const linter = new Linter({ cwd: root }); +const sourceConfig = [uiDependencyConfig]; +const sourceDirectories = new Set(['src', 'scripts', 'test', 'tests']); +const excludedDirectories = new Set([ + 'node_modules', + 'dist', + 'dist-ssr', + 'build', + 'coverage', + 'report', + 'logs', + 'test-results', + 'playwright-report', + 'blob-report', + 'kt_batches', + 'kt_out', +]); +export { isForbiddenUiDependency }; export function auditManifest(manifest, lock) { const issues = []; @@ -26,14 +34,22 @@ export function auditManifest(manifest, lock) { 'optionalDependencies', 'peerDependencies', ]) { - for (const name of Object.keys(manifest[section] || {})) { - if (isForbiddenUiDependency(name)) + for (const [name, specifier] of Object.entries(manifest[section] || {})) { + const alias = /^npm:((?:@[^/]+\/)?[^@/]+)(?:@|$)/.exec(specifier)?.[1]; + if (isForbiddenUiDependency(name)) { issues.push(`package.json ${section}: ${name}`); + } else if (isForbiddenUiDependency(alias)) { + issues.push(`package.json ${section}: ${name} -> ${alias}`); + } } } - for (const location of Object.keys(lock.packages || {})) { - if (isForbiddenUiDependency(location.split('node_modules/').at(-1))) { + for (const [location, entry] of Object.entries(lock.packages || {})) { + const names = location.split(/(?:^|\/)node_modules\//); + if (names.length === 1) continue; + if (isForbiddenUiDependency(names.at(-1))) { issues.push(`package-lock.json: ${location}`); + } else if (isForbiddenUiDependency(entry.name)) { + issues.push(`package-lock.json: ${location} -> ${entry.name}`); } } if (!lock.packages || lock.lockfileVersion < 2) @@ -42,58 +58,26 @@ export function auditManifest(manifest, lock) { } export function auditSource(source, filename) { - const linter = new Linter({ configType: 'eslintrc' }); - linter.defineRule('ui-dependencies', { - create(context) { - const inspect = (node) => { - if ( - node?.type === 'Literal' && - typeof node.value === 'string' && - isForbiddenUiDependency(node.value) - ) { - context.report({ - node, - message: `Use Ant Design or the audited local brand assets: ${node.value}`, - }); - } - }; - return { - ImportDeclaration: (node) => inspect(node.source), - ExportNamedDeclaration: (node) => inspect(node.source), - ExportAllDeclaration: (node) => inspect(node.source), - ImportExpression: (node) => inspect(node.source), - CallExpression: (node) => { - if ( - node.callee.type === 'Identifier' && - node.callee.name === 'require' - ) - inspect(node.arguments[0]); - }, - }; - }, - }); return linter - .verify( - source, - { - parserOptions: { - ecmaVersion: 2022, - sourceType: 'module', - ecmaFeatures: { jsx: true }, - }, - rules: { 'ui-dependencies': 'error' }, - }, - { filename, allowInlineConfig: false }, - ) + .verify(source, sourceConfig, { filename, allowInlineConfig: false }) .map((issue) => `${filename}:${issue.line}: ${issue.message}`); } -async function sourceFiles(dir) { +async function sourceFiles(dir, isRoot = true) { const files = []; for (const entry of await readdir(dir, { withFileTypes: true })) { const name = path.join(dir, entry.name); - if (entry.isDirectory()) files.push(...(await sourceFiles(name))); - else if (/\.[cm]?[jt]sx?$/.test(entry.name)) files.push(name); + if (entry.isDirectory()) { + if ( + isRoot + ? sourceDirectories.has(entry.name) + : !entry.name.startsWith('.') && !excludedDirectories.has(entry.name) + ) { + files.push(...(await sourceFiles(name, false))); + } + } else if (entry.isFile() && /\.(?:js|jsx|cjs|mjs)$/.test(entry.name)) { + files.push(name); + } } return files; } @@ -106,7 +90,7 @@ export async function checkUiDependencies(directory = root) { await readFile(path.join(directory, 'package-lock.json'), 'utf8'), ); const issues = auditManifest(manifest, lock); - const files = await sourceFiles(path.join(directory, 'src')); + const files = await sourceFiles(directory); for (const filename of files) { issues.push( ...auditSource( @@ -143,7 +127,7 @@ export async function checkUiDependencies(directory = root) { return { issues, files: files.length, - packages: Object.keys(lock.packages).length - 1, + packages: Math.max(0, Object.keys(lock.packages || {}).length - 1), }; } diff --git a/scripts/dev-service.mjs b/scripts/dev-service.mjs index c3ed6dc6..b1e67d80 100644 --- a/scripts/dev-service.mjs +++ b/scripts/dev-service.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { readFile, readdir } from 'node:fs/promises'; import { execFile } from 'node:child_process'; import { promisify } from 'node:util'; diff --git a/scripts/i18n_kt_overflow.cjs b/scripts/i18n_kt_overflow.cjs index 2707b23d..c877ec58 100644 --- a/scripts/i18n_kt_overflow.cjs +++ b/scripts/i18n_kt_overflow.cjs @@ -3,7 +3,7 @@ // 找出会溢出的具体位置。控制台是围绕中文两字标签设计的,泰语平均膨胀 3.16x, // 短标签最高 9x,密集表格首当其冲。 // -// 判据:Semi 的 Table column `width: N`(px)在 14px 字号下大致可容 +// 判据:表格列的 `width: N`(px)在 14px 字号下大致可容 // 中文 ≈ N/14 字,拉丁/泰文 ≈ N/7.5 字符(泰文含上下叠加符号,按拉丁估更保守)。 // 超出即报,按超出比例排序。这是静态估算,不替代真机目视走查。 const fs = require('fs'); @@ -20,7 +20,7 @@ const DICTS = LANGS.map((l) => [l, load(l)]); const PX_PER_CHAR = 7.5; // 拼音文字/韩/泰在 14px 下的保守平均字宽 // 日文假名与汉字、繁体中文都是全角,按字号整宽计 const PX_PER_CHAR_BY_LANG = { ja: 14, 'zh-TW': 14 }; -const PADDING = 24; // Semi 表头左右内边距 + 排序图标余量 +const PADDING = 24; // 表头左右内边距及排序图标的估算余量 function walk(dir, files = []) { for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { diff --git a/scripts/playwright-focus-guard.mjs b/scripts/playwright-focus-guard.mjs index 872d2d0b..3e81e4cc 100644 --- a/scripts/playwright-focus-guard.mjs +++ b/scripts/playwright-focus-guard.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 有头 Chrome 焦点守卫:唯一页面、禁止新建 / 切换标签页、后台建页兜底、前台状态检测。 // 规则见 docs/ui/GLOBAL_UI_BASELINE.md 第 7.1 节。 diff --git a/scripts/playwright-reporter.mjs b/scripts/playwright-reporter.mjs index 01558c6d..d7c7bd79 100644 --- a/scripts/playwright-reporter.mjs +++ b/scripts/playwright-reporter.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - const FOCUS_ANNOTATION = 'focus-guard'; export default class AcceptanceReporter { diff --git a/scripts/playwright-runner-focus.mjs b/scripts/playwright-runner-focus.mjs index b63af286..c1d44493 100644 --- a/scripts/playwright-runner-focus.mjs +++ b/scripts/playwright-runner-focus.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 浏览器焦点守护:有头真实 Chrome 运行时尽最大可能不抢占用户桌面焦点。 // - 唯一页面:每个用例只有一个页面,由 CDP Target.createTarget({ background: true }) 后台创建, // 不走 context.newPage()(Playwright 内部创建时不带 background,会以前台方式打开窗口)。 diff --git a/scripts/playwright-runtime.mjs b/scripts/playwright-runtime.mjs index 4dba0cc5..7b364ebd 100644 --- a/scripts/playwright-runtime.mjs +++ b/scripts/playwright-runtime.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { randomUUID } from 'node:crypto'; export const browserStabilityArgs = Object.freeze([ diff --git a/scripts/playwright-test.mjs b/scripts/playwright-test.mjs index 985dc5b6..89dd84f9 100644 --- a/scripts/playwright-test.mjs +++ b/scripts/playwright-test.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { test as base, expect } from '@playwright/test'; import { checkFocus, diff --git a/scripts/preview-dist.mjs b/scripts/preview-dist.mjs index df9eb136..a47d6386 100644 --- a/scripts/preview-dist.mjs +++ b/scripts/preview-dist.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { preview } from 'vite'; import { fileURLToPath } from 'node:url'; import { positiveInteger } from './playwright-runtime.mjs'; diff --git a/scripts/run-acceptance.mjs b/scripts/run-acceptance.mjs index 8f4dd609..f0a454b7 100644 --- a/scripts/run-acceptance.mjs +++ b/scripts/run-acceptance.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { mkdtemp, rm } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import path from 'node:path'; diff --git a/scripts/run-playwright.mjs b/scripts/run-playwright.mjs index e1ef765e..9544a7ea 100644 --- a/scripts/run-playwright.mjs +++ b/scripts/run-playwright.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { spawn } from 'node:child_process'; import { readdir, stat, access } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; diff --git a/scripts/test-playwright-environment.mjs b/scripts/test-playwright-environment.mjs index 6c3cd2a1..412bc885 100644 --- a/scripts/test-playwright-environment.mjs +++ b/scripts/test-playwright-environment.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { mkdtemp, writeFile, rm } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import path from 'node:path'; diff --git a/scripts/test.mjs b/scripts/test.mjs index 5bb5e6de..546312e7 100644 --- a/scripts/test.mjs +++ b/scripts/test.mjs @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { readdir } from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; diff --git a/scripts/ui-dependency-policy.cjs b/scripts/ui-dependency-policy.cjs new file mode 100644 index 00000000..18912f3d --- /dev/null +++ b/scripts/ui-dependency-policy.cjs @@ -0,0 +1,64 @@ +const forbiddenPackages = [ + /^@(?:radix-ui|floating-ui|lobehub|headlessui|mui|material-ui|chakra-ui)\//, + /^@douyinfe\/semi-/, + /^(?:leva|antd-style|react-layout-kit)(?:[/?#]|$)/, +]; + +function isForbiddenUiDependency(specifier) { + return ( + typeof specifier === 'string' && + forbiddenPackages.some((pattern) => pattern.test(specifier)) + ); +} + +const rule = { + meta: { + schema: [], + messages: { + forbidden: + 'Use Ant Design or the audited local brand assets instead of {{specifier}}.', + }, + }, + create(context) { + const inspect = (node) => { + const specifier = + node?.type === 'Literal' + ? node.value + : node?.type === 'TemplateLiteral' && node.expressions.length === 0 + ? node.quasis[0].value.cooked + : null; + + if (isForbiddenUiDependency(specifier)) { + context.report({ node, messageId: 'forbidden', data: { specifier } }); + } + }; + + return { + ImportDeclaration: (node) => inspect(node.source), + ExportNamedDeclaration: (node) => inspect(node.source), + ExportAllDeclaration: (node) => inspect(node.source), + ImportExpression: (node) => inspect(node.source), + CallExpression: (node) => { + const { callee } = node; + const isRequire = + callee.type === 'Identifier' && callee.name === 'require'; + const isRequireResolve = + callee.type === 'MemberExpression' && + !callee.computed && + callee.object.type === 'Identifier' && + callee.object.name === 'require' && + callee.property.name === 'resolve'; + if (isRequire || isRequireResolve) inspect(node.arguments[0]); + }, + }; + }, +}; + +const uiDependencyConfig = { + files: ['**/*.{js,jsx,cjs,mjs}'], + languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, + plugins: { 'ui-dependencies': { rules: { 'no-legacy-ui': rule } } }, + rules: { 'ui-dependencies/no-legacy-ui': 'error' }, +}; + +module.exports = { isForbiddenUiDependency, uiDependencyConfig }; diff --git a/scripts/verify-build.mjs b/scripts/verify-build.mjs index 728d4380..e1520eb2 100644 --- a/scripts/verify-build.mjs +++ b/scripts/verify-build.mjs @@ -1,27 +1,77 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { readFile, access } from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { gzipSync } from 'node:zlib'; -export async function verifyBuild(directory) { +const BOOTSTRAP_GZIP_LIMIT = 820 * 1024; +const NOTICE = 'src/components/layout/NoticeModal.jsx'; +const AGREEMENT = 'src/components/common/DocumentRenderer/AgreementModal.jsx'; +const HEADER = 'src/components/layout/headerbar/index.jsx'; +const HOME = 'src/pages/Home/index.jsx'; +const MARKED = 'node_modules/marked/lib/marked.esm.js'; + +function resolveAsset(root, asset) { + const filename = path.resolve(root, asset.replace(/^\//, '')); + if (!filename.startsWith(root + path.sep)) + throw new Error(`Build asset escapes output directory: ${asset}`); + return filename; +} + +function staticChunks(manifest, roots) { + const seen = new Set(); + const visit = (key) => { + if (seen.has(key)) return; + const chunk = manifest[key]; + if (!chunk) throw new Error(`Missing build manifest chunk: ${key}`); + seen.add(key); + for (const dependency of chunk.imports || []) visit(dependency); + }; + roots.forEach(visit); + return seen; +} + +async function verifyStartup(root) { + const manifest = JSON.parse( + await readFile(path.join(root, '.vite', 'manifest.json'), 'utf8'), + ); + const entry = 'index.html'; + for (const [routes, deferred] of [ + [ + [entry, HOME, HEADER], + [NOTICE, MARKED], + ], + [ + [entry, 'src/components/auth/LoginForm.jsx', HEADER], + [AGREEMENT, NOTICE], + ], + [ + [entry, 'src/components/auth/RegisterForm.jsx', HEADER], + [AGREEMENT, NOTICE], + ], + ]) { + const eager = staticChunks(manifest, routes); + for (const feature of deferred) { + if (!manifest[feature]?.isDynamicEntry || eager.has(feature)) + throw new Error(`Expected an independent lazy chunk: ${feature}`); + } + } + + const files = new Set( + [...staticChunks(manifest, [entry])].map((key) => manifest[key].file), + ); + let bootstrapGzipBytes = 0; + for (const file of files) { + const source = await readFile(resolveAsset(root, file)); + bootstrapGzipBytes += gzipSync(source).length; + } + if (bootstrapGzipBytes > BOOTSTRAP_GZIP_LIMIT) + throw new Error( + `Bootstrap JS exceeds 820 KiB gzip: ${bootstrapGzipBytes} B`, + ); + return { bootstrapGzipBytes, bootstrapChunks: files.size }; +} + +export async function verifyBuild(directory, { startup = false } = {}) { const root = path.resolve(directory); const html = await readFile(path.join(root, 'index.html'), 'utf8'); // Inspect actual resource tags, not URLs embedded in comments or inline scripts. @@ -40,17 +90,22 @@ export async function verifyBuild(directory) { if (!assets.some((value) => /\.js$/.test(value))) throw new Error('Build has no JavaScript entry'); for (const asset of assets) { - const filename = path.resolve(root, asset.replace(/^\//, '')); - if (!filename.startsWith(root + path.sep)) - throw new Error(`Build asset escapes output directory: ${asset}`); - await access(filename); + await access(resolveAsset(root, asset)); } - return { root, assets: assets.length }; + return { + root, + assets: assets.length, + ...(startup ? await verifyStartup(root) : {}), + }; } if ( process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url) ) { - console.log(await verifyBuild(process.argv[2] || 'dist')); + const args = process.argv.slice(2); + const directory = args.find((argument) => argument !== '--startup') || 'dist'; + console.log( + await verifyBuild(directory, { startup: args.includes('--startup') }), + ); } diff --git a/scripts/vite/legacy-css-layers.js b/scripts/vite/legacy-css-layers.js index 3846aa04..4b83abd5 100644 --- a/scripts/vite/legacy-css-layers.js +++ b/scripts/vite/legacy-css-layers.js @@ -1,28 +1,8 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import postcss from 'postcss'; // 旧浏览器的级联层(@layer)兜底。 // // index.css 把 Tailwind 的 base / components / utilities 整体包在原生 @layer 里, -// Semi 的按需样式也由 vitePluginSemi({ cssLayer: true }) 包进 @layer semi。 // @layer 自 Chromium 99 / Firefox 97 / Safari 15.4 才支持;更老的内核(停更的 // Edge、Win10 LTSC 自带 Edge、各类国产壳浏览器)把它当未知 at-rule 连同块内 // 全部规则一起丢弃 —— Tailwind 整体失效,页面只剩无尺寸约束的原图 logo。 @@ -91,8 +71,7 @@ export function flattenCssLayers(sources) { roots.forEach(assertSupportedShape); // 层外已有逐字相同的规则时,层内那份不必收:选择器与声明都一样、层外的又加载 - // 在后,它在旧浏览器里必然被覆盖。Semi 的 @layer 副本整份属于这种情况 - // (index.jsx 另行全量引入了层外的 semi.css),剔掉后兜底表只剩约五分之一。 + // 在后,它在旧浏览器里必然被覆盖。 const unlayered = new Set(); for (const root of roots) { root.each((node) => { diff --git a/src/App.jsx b/src/App.jsx index b35713a0..a6b8068d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { lazy, Suspense, useContext, useMemo } from 'react'; import { Route, Routes, Navigate, useLocation } from 'react-router-dom'; import { @@ -24,7 +5,12 @@ import { isMiniProgramWebView, } from './helpers/miniProgram'; import Loading from './components/common/ui/Loading'; -import { AuthRedirect, PrivateRoute, AdminRoute, RootRoute } from './helpers'; +import { + AuthRedirect, + PrivateRoute, + AdminRoute, + RootRoute, +} from './helpers/auth'; import NotFound from './pages/NotFound'; import Forbidden from './pages/Forbidden'; import { StatusContext } from './context/Status'; diff --git a/src/components/analytics/ChannelConsumption.jsx b/src/components/analytics/ChannelConsumption.jsx index f0829beb..7250e669 100644 --- a/src/components/analytics/ChannelConsumption.jsx +++ b/src/components/analytics/ChannelConsumption.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatPercent } from '../../helpers/safeDisplay'; import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; diff --git a/src/components/analytics/CollapsibleHeader.jsx b/src/components/analytics/CollapsibleHeader.jsx index a86f9bb3..612993e5 100644 --- a/src/components/analytics/CollapsibleHeader.jsx +++ b/src/components/analytics/CollapsibleHeader.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons'; import React from 'react'; import './collapsible-panel.css'; diff --git a/src/components/analytics/DailyStatsTable.jsx b/src/components/analytics/DailyStatsTable.jsx index a224a038..30201efb 100644 --- a/src/components/analytics/DailyStatsTable.jsx +++ b/src/components/analytics/DailyStatsTable.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Card, Table, Button } from '@/components/ui'; import { IconDownload } from '@/components/ui/icons'; diff --git a/src/components/analytics/HighFreqLowCostUsers.jsx b/src/components/analytics/HighFreqLowCostUsers.jsx index b107dad1..346c54d1 100644 --- a/src/components/analytics/HighFreqLowCostUsers.jsx +++ b/src/components/analytics/HighFreqLowCostUsers.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatUserReference } from '../../helpers/safeDisplay'; import React, { useMemo, useState } from 'react'; diff --git a/src/components/analytics/ModelDistribution.jsx b/src/components/analytics/ModelDistribution.jsx index d226685b..c1ec8212 100644 --- a/src/components/analytics/ModelDistribution.jsx +++ b/src/components/analytics/ModelDistribution.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo } from 'react'; import { Card } from '@/components/ui'; import { VChart } from '@visactor/react-vchart'; diff --git a/src/components/analytics/OrgCacheHourlySheet.jsx b/src/components/analytics/OrgCacheHourlySheet.jsx index 8fefa144..20e1814a 100644 --- a/src/components/analytics/OrgCacheHourlySheet.jsx +++ b/src/components/analytics/OrgCacheHourlySheet.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo, useState, useEffect } from 'react'; import { Button, Empty, Segmented, Skeleton, theme } from 'antd'; import { VChart } from '@visactor/react-vchart'; diff --git a/src/components/analytics/OrgRealtimeUsage.jsx b/src/components/analytics/OrgRealtimeUsage.jsx index 4443acba..105e8e51 100644 --- a/src/components/analytics/OrgRealtimeUsage.jsx +++ b/src/components/analytics/OrgRealtimeUsage.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { formatIdReference, formatPercent } from '../../helpers/safeDisplay'; import React, { useState, useCallback } from 'react'; import { Badge, Empty, Progress, Skeleton, Tag, Tooltip, theme } from 'antd'; diff --git a/src/components/analytics/OverviewCards.jsx b/src/components/analytics/OverviewCards.jsx index 0533f555..1cd52e6b 100644 --- a/src/components/analytics/OverviewCards.jsx +++ b/src/components/analytics/OverviewCards.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatNumber, formatPercent } from '../../helpers/safeDisplay'; import React from 'react'; diff --git a/src/components/analytics/RiskControlBanLogs.jsx b/src/components/analytics/RiskControlBanLogs.jsx index 9980f06f..afa31afa 100644 --- a/src/components/analytics/RiskControlBanLogs.jsx +++ b/src/components/analytics/RiskControlBanLogs.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatUserReference } from '../../helpers/safeDisplay'; import { Trans } from 'react-i18next'; diff --git a/src/components/analytics/RiskControlRulesModal.jsx b/src/components/analytics/RiskControlRulesModal.jsx index a41dd71b..a1b9b6dd 100644 --- a/src/components/analytics/RiskControlRulesModal.jsx +++ b/src/components/analytics/RiskControlRulesModal.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Trans } from 'react-i18next'; import React, { useEffect, useRef, useState } from 'react'; import { diff --git a/src/components/analytics/TopupChannelChart.jsx b/src/components/analytics/TopupChannelChart.jsx index 3b7adf13..fcbaab38 100644 --- a/src/components/analytics/TopupChannelChart.jsx +++ b/src/components/analytics/TopupChannelChart.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js'; import { formatNumber, diff --git a/src/components/analytics/TrendCharts.jsx b/src/components/analytics/TrendCharts.jsx index 4460c447..eecb806e 100644 --- a/src/components/analytics/TrendCharts.jsx +++ b/src/components/analytics/TrendCharts.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo } from 'react'; import { Card } from '@/components/ui'; import { VChart } from '@visactor/react-vchart'; diff --git a/src/components/analytics/UserRanking.jsx b/src/components/analytics/UserRanking.jsx index 06e7afe2..3afa88c7 100644 --- a/src/components/analytics/UserRanking.jsx +++ b/src/components/analytics/UserRanking.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatIdReference, formatUserReference, diff --git a/src/components/analytics/UserSurveyStats.jsx b/src/components/analytics/UserSurveyStats.jsx index d5a34636..a829988a 100644 --- a/src/components/analytics/UserSurveyStats.jsx +++ b/src/components/analytics/UserSurveyStats.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatPercent, formatRatioPercent } from '../../helpers/safeDisplay'; import React, { useMemo, useState, useEffect, useCallback } from 'react'; diff --git a/src/components/analytics/UserTopupRanking.jsx b/src/components/analytics/UserTopupRanking.jsx index 21521423..6db46b85 100644 --- a/src/components/analytics/UserTopupRanking.jsx +++ b/src/components/analytics/UserTopupRanking.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatNumber, formatIdReference, diff --git a/src/components/analytics/orgReport/ActionCenter.jsx b/src/components/analytics/orgReport/ActionCenter.jsx index 2a838a57..42e7cdde 100644 --- a/src/components/analytics/orgReport/ActionCenter.jsx +++ b/src/components/analytics/orgReport/ActionCenter.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Download as ActionDownload } from '@/components/common/icons/ActionIcons'; import React from 'react'; import { @@ -518,11 +499,7 @@ export const ActionCenter = ({ lists, activeTab, onTabChange, cny, t }) => ( rowKey='org_id' size='small' scroll={{ x: 1200 }} - pagination={ - lists[tab].length > 10 - ? { pageSize: 10, showSizeChanger: false } - : false - } + pagination={lists[tab].length > 10 ? { pageSize: 10 } : false} empty={} /> diff --git a/src/components/analytics/orgReport/Analysis.jsx b/src/components/analytics/orgReport/Analysis.jsx index b99f0d71..afd623c2 100644 Binary files a/src/components/analytics/orgReport/Analysis.jsx and b/src/components/analytics/orgReport/Analysis.jsx differ diff --git a/src/components/analytics/orgReport/Overview.jsx b/src/components/analytics/orgReport/Overview.jsx index 1b146c19..61b7002b 100644 --- a/src/components/analytics/orgReport/Overview.jsx +++ b/src/components/analytics/orgReport/Overview.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Trans } from 'react-i18next'; import { I18N_TECHNICAL_TEXT } from '../../../i18n/technicalText.js'; import { Download as ActionDownload } from '@/components/common/icons/ActionIcons'; diff --git a/src/components/analytics/orgReport/Tables.jsx b/src/components/analytics/orgReport/Tables.jsx index c786d5f9..18eea787 100644 --- a/src/components/analytics/orgReport/Tables.jsx +++ b/src/components/analytics/orgReport/Tables.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Download as ActionDownload } from '@/components/common/icons/ActionIcons'; import React, { useMemo } from 'react'; import { @@ -142,9 +123,7 @@ export const SalesRepTable = ({ reps, cny, onSelect, t }) => { rowKey={(r) => r.sales_rep || '__none__'} size='small' scroll={{ x: 920 }} - pagination={ - reps.length > 8 ? { pageSize: 8, showSizeChanger: false } : false - } + pagination={reps.length > 8 ? { pageSize: 10 } : false} empty={} /> diff --git a/src/components/analytics/orgReport/index.jsx b/src/components/analytics/orgReport/index.jsx index c63740fa..a7df35fb 100644 --- a/src/components/analytics/orgReport/index.jsx +++ b/src/components/analytics/orgReport/index.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useCallback, useMemo, useState } from 'react'; import { Button, Card, Typography } from '@/components/ui'; import { ActionCenter, ACTION_TABS } from './ActionCenter'; diff --git a/src/components/analytics/orgReport/shared.jsx b/src/components/analytics/orgReport/shared.jsx index 86b872e6..09361e22 100644 --- a/src/components/analytics/orgReport/shared.jsx +++ b/src/components/analytics/orgReport/shared.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Card, Tag, Tooltip } from '@/components/ui'; import { TrendingDown, TrendingUp } from 'lucide-react'; diff --git a/src/components/analytics/orgReport/utils.js b/src/components/analytics/orgReport/utils.js index ee45aa4e..a8245781 100644 --- a/src/components/analytics/orgReport/utils.js +++ b/src/components/analytics/orgReport/utils.js @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { formatIdReference, formatPercent, diff --git a/src/components/auth/AuthCardHeader.jsx b/src/components/auth/AuthCardHeader.jsx index feef02ed..07c727c4 100644 --- a/src/components/auth/AuthCardHeader.jsx +++ b/src/components/auth/AuthCardHeader.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { useTranslation } from 'react-i18next'; import React from 'react'; import { Sparkles } from 'lucide-react'; diff --git a/src/components/auth/AuthCustomerServiceFloat.jsx b/src/components/auth/AuthCustomerServiceFloat.jsx index 76333726..61a2885f 100644 --- a/src/components/auth/AuthCustomerServiceFloat.jsx +++ b/src/components/auth/AuthCustomerServiceFloat.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons'; import React, { useState, useEffect } from 'react'; import { Avatar } from '@/components/ui'; diff --git a/src/components/auth/AuthDivider.jsx b/src/components/auth/AuthDivider.jsx index 796e0bfa..33cbd803 100644 --- a/src/components/auth/AuthDivider.jsx +++ b/src/components/auth/AuthDivider.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; /** diff --git a/src/components/auth/AuthLoginTabs.jsx b/src/components/auth/AuthLoginTabs.jsx index 077a247d..bcdb69ff 100644 --- a/src/components/auth/AuthLoginTabs.jsx +++ b/src/components/auth/AuthLoginTabs.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Button } from 'antd'; import { useNavigate, useSearchParams } from 'react-router-dom'; diff --git a/src/components/auth/GlassCard.jsx b/src/components/auth/GlassCard.jsx index d0225ca2..b7868afa 100644 --- a/src/components/auth/GlassCard.jsx +++ b/src/components/auth/GlassCard.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; /** diff --git a/src/components/auth/LazyAgreementModal.jsx b/src/components/auth/LazyAgreementModal.jsx new file mode 100644 index 00000000..39868897 --- /dev/null +++ b/src/components/auth/LazyAgreementModal.jsx @@ -0,0 +1,15 @@ +import React, { lazy, Suspense } from 'react'; + +const AgreementModal = lazy( + () => import('../common/DocumentRenderer/AgreementModal'), +); + +export default function LazyAgreementModal(props) { + if (!props.type) return null; + + return ( + + + + ); +} diff --git a/src/components/auth/LoginForm.jsx b/src/components/auth/LoginForm.jsx index 872b0621..23dd9329 100644 --- a/src/components/auth/LoginForm.jsx +++ b/src/components/auth/LoginForm.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons'; import React, { useContext, @@ -72,7 +53,7 @@ import GlassCard from './GlassCard'; import AuthCardHeader from './AuthCardHeader'; import AuthLoginTabs from './AuthLoginTabs'; import AuthDivider from './AuthDivider'; -import AgreementModal from '../common/DocumentRenderer/AgreementModal'; +import AgreementModal from './LazyAgreementModal'; import { isMiniProgramWebView, withMiniProgramLogins, diff --git a/src/components/auth/OAuth2Callback.jsx b/src/components/auth/OAuth2Callback.jsx index f643fe68..fb19e994 100644 --- a/src/components/auth/OAuth2Callback.jsx +++ b/src/components/auth/OAuth2Callback.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { useEffectEvent } from '../../hooks/common/useEffectEvent'; import React, { useContext, useEffect } from 'react'; import { useNavigate, useSearchParams } from 'react-router-dom'; diff --git a/src/components/auth/OrgCredentialResult.jsx b/src/components/auth/OrgCredentialResult.jsx index d5c8418e..79507c1b 100644 --- a/src/components/auth/OrgCredentialResult.jsx +++ b/src/components/auth/OrgCredentialResult.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons'; import React from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/auth/PasswordResetConfirm.jsx b/src/components/auth/PasswordResetConfirm.jsx index 24a71bf7..170e6b18 100644 --- a/src/components/auth/PasswordResetConfirm.jsx +++ b/src/components/auth/PasswordResetConfirm.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useState } from 'react'; import { API, diff --git a/src/components/auth/PasswordResetForm.jsx b/src/components/auth/PasswordResetForm.jsx index c7b406c4..9037b23c 100644 --- a/src/components/auth/PasswordResetForm.jsx +++ b/src/components/auth/PasswordResetForm.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useState } from 'react'; import { API, diff --git a/src/components/auth/RegisterForm.jsx b/src/components/auth/RegisterForm.jsx index b3c8c121..c82728dd 100644 --- a/src/components/auth/RegisterForm.jsx +++ b/src/components/auth/RegisterForm.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons'; import React, { useContext, @@ -67,7 +48,7 @@ import AuthCardHeader from './AuthCardHeader'; import AuthLoginTabs from './AuthLoginTabs'; import AuthDivider from './AuthDivider'; import { Shield, Smartphone, QrCode } from 'lucide-react'; -import AgreementModal from '../common/DocumentRenderer/AgreementModal'; +import AgreementModal from './LazyAgreementModal'; import { isMiniProgramWebView, withMiniProgramLogins, diff --git a/src/components/auth/TelegramLogin.jsx b/src/components/auth/TelegramLogin.jsx index 0932e801..1941b1e1 100644 --- a/src/components/auth/TelegramLogin.jsx +++ b/src/components/auth/TelegramLogin.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React from 'react'; import TelegramLoginButton from 'react-telegram-login'; diff --git a/src/components/auth/TwoFAVerification.jsx b/src/components/auth/TwoFAVerification.jsx index f792dec7..3fea4cb1 100644 --- a/src/components/auth/TwoFAVerification.jsx +++ b/src/components/auth/TwoFAVerification.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { Trans } from 'react-i18next'; import { API, showError } from '../../helpers'; import { Button, Card, Divider, Form, Typography } from '@/components/ui'; diff --git a/src/components/common/AuthBackground/index.jsx b/src/components/common/AuthBackground/index.jsx index 5eca4bf1..fd6de208 100644 --- a/src/components/common/AuthBackground/index.jsx +++ b/src/components/common/AuthBackground/index.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { Suspense, lazy, useContext } from 'react'; import { StatusContext } from '../../../context/Status'; diff --git a/src/components/common/AuthBackground/themes/CinematicTokenFactory.jsx b/src/components/common/AuthBackground/themes/CinematicTokenFactory.jsx index de655eea..55e5503e 100644 --- a/src/components/common/AuthBackground/themes/CinematicTokenFactory.jsx +++ b/src/components/common/AuthBackground/themes/CinematicTokenFactory.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { useEffect, useRef } from 'react'; import './CinematicTokenFactory.css'; diff --git a/src/components/common/AuthBackground/themes/TokenFactory.jsx b/src/components/common/AuthBackground/themes/TokenFactory.jsx index 7912023f..f34c50e2 100644 --- a/src/components/common/AuthBackground/themes/TokenFactory.jsx +++ b/src/components/common/AuthBackground/themes/TokenFactory.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { useEffect, useRef } from 'react'; /** diff --git a/src/components/common/ChunkErrorBoundary.jsx b/src/components/common/ChunkErrorBoundary.jsx index 19681b6d..ff80fda1 100644 --- a/src/components/common/ChunkErrorBoundary.jsx +++ b/src/components/common/ChunkErrorBoundary.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import i18next from 'i18next'; import React from 'react'; import Loading from './ui/Loading'; diff --git a/src/components/common/DocumentRenderer/AgreementModal.jsx b/src/components/common/DocumentRenderer/AgreementModal.jsx index 9f89b925..50cbcbb5 100644 --- a/src/components/common/DocumentRenderer/AgreementModal.jsx +++ b/src/components/common/DocumentRenderer/AgreementModal.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { X as ActionX } from '@/components/common/icons/ActionIcons'; import React, { useState, useCallback } from 'react'; import { Modal } from '@/components/ui'; diff --git a/src/components/common/DocumentRenderer/index.jsx b/src/components/common/DocumentRenderer/index.jsx index 45a4b9ba..72b50fe4 100644 --- a/src/components/common/DocumentRenderer/index.jsx +++ b/src/components/common/DocumentRenderer/index.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { ChevronUp as ActionChevronUp, ArrowLeft as ActionArrowLeft, diff --git a/src/components/common/LobeHubIcon.jsx b/src/components/common/LobeHubIcon.jsx index 4837aef4..fff6b437 100644 --- a/src/components/common/LobeHubIcon.jsx +++ b/src/components/common/LobeHubIcon.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { OpenAI, Claude, diff --git a/src/components/common/LobeHubIcon.test.js b/src/components/common/LobeHubIcon.test.js index af0dcd8d..03cc3367 100644 --- a/src/components/common/LobeHubIcon.test.js +++ b/src/components/common/LobeHubIcon.test.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import assert from 'node:assert/strict'; import { readFile } from 'node:fs/promises'; import { runInNewContext } from 'node:vm'; diff --git a/src/components/common/MapleBackground.jsx b/src/components/common/MapleBackground.jsx index f3b903ac..0fe85c9a 100644 --- a/src/components/common/MapleBackground.jsx +++ b/src/components/common/MapleBackground.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { useEffect, useRef } from 'react'; const MapleBackground = () => { diff --git a/src/components/common/ModelSelector.jsx b/src/components/common/ModelSelector.jsx index d61cdaaa..0d925953 100644 --- a/src/components/common/ModelSelector.jsx +++ b/src/components/common/ModelSelector.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useRef } from 'react'; import { Select, Spin, Typography, Empty, Tag, Tooltip } from '@/components/ui'; import { Lock } from 'lucide-react'; diff --git a/src/components/common/OceanBackground.jsx b/src/components/common/OceanBackground.jsx index 3cff15f1..35882a14 100644 --- a/src/components/common/OceanBackground.jsx +++ b/src/components/common/OceanBackground.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { useEffect, useRef } from 'react'; /** diff --git a/src/components/common/PageBackground.jsx b/src/components/common/PageBackground.jsx index b3aa44d4..8766c87c 100644 --- a/src/components/common/PageBackground.jsx +++ b/src/components/common/PageBackground.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; /** diff --git a/src/components/common/PageGuide/index.jsx b/src/components/common/PageGuide/index.jsx index 9024e96a..93542476 100644 --- a/src/components/common/PageGuide/index.jsx +++ b/src/components/common/PageGuide/index.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - /* * PageGuide —— 企业控制台页面级「使用指引」三层体系的可复用实现。 * diff --git a/src/components/common/UserCenterBreadcrumb.jsx b/src/components/common/UserCenterBreadcrumb.jsx index ec8927b3..d7d41284 100644 --- a/src/components/common/UserCenterBreadcrumb.jsx +++ b/src/components/common/UserCenterBreadcrumb.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Breadcrumb } from 'antd'; import { useLocation } from 'react-router-dom'; diff --git a/src/components/common/UserCenterPageHeader.jsx b/src/components/common/UserCenterPageHeader.jsx index f5e5fc5d..6c93063f 100644 --- a/src/components/common/UserCenterPageHeader.jsx +++ b/src/components/common/UserCenterPageHeader.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import UserCenterBreadcrumb from './UserCenterBreadcrumb'; diff --git a/src/components/common/brand-icons/IconAvatar.jsx b/src/components/common/brand-icons/IconAvatar.jsx index 40bb5fd6..1b5d14fa 100644 --- a/src/components/common/brand-icons/IconAvatar.jsx +++ b/src/components/common/brand-icons/IconAvatar.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { forwardRef } from 'react'; import { Avatar, theme } from 'antd'; diff --git a/src/components/common/brand-icons/IconCombine.jsx b/src/components/common/brand-icons/IconCombine.jsx index 63f00d5b..4c266e60 100644 --- a/src/components/common/brand-icons/IconCombine.jsx +++ b/src/components/common/brand-icons/IconCombine.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { forwardRef } from 'react'; export default forwardRef(function IconCombine( diff --git a/src/components/common/brand-icons/useThemeMode.js b/src/components/common/brand-icons/useThemeMode.js index 240c8809..070c08a5 100644 --- a/src/components/common/brand-icons/useThemeMode.js +++ b/src/components/common/brand-icons/useThemeMode.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { useActualTheme } from '../../../context/Theme'; // Dify and Moonshot variants read the existing app theme without a second provider. diff --git a/src/components/common/examples/ChannelKeyViewExample.jsx b/src/components/common/examples/ChannelKeyViewExample.jsx index e6f7897b..32d0258b 100644 --- a/src/components/common/examples/ChannelKeyViewExample.jsx +++ b/src/components/common/examples/ChannelKeyViewExample.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Modal } from '@/components/ui'; diff --git a/src/components/common/icons/ActionIcons.js b/src/components/common/icons/ActionIcons.js index 6e994229..2c33f4ba 100644 --- a/src/components/common/icons/ActionIcons.js +++ b/src/components/common/icons/ActionIcons.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { forwardRef } from 'react'; import { AccountBookOutlined, diff --git a/src/components/common/icons/BrandIcons.jsx b/src/components/common/icons/BrandIcons.jsx index 3a30255d..87c2ca3c 100644 --- a/src/components/common/icons/BrandIcons.jsx +++ b/src/components/common/icons/BrandIcons.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; // 微信图标 (已经存在于 WeChatIcon.jsx,但为了统一导入,这里也提供) diff --git a/src/components/common/illustrations/index.jsx b/src/components/common/illustrations/index.jsx index 0897868c..e072ac11 100644 --- a/src/components/common/illustrations/index.jsx +++ b/src/components/common/illustrations/index.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; // ========== 无结果插图 ========== diff --git a/src/components/common/logo/DiscordIcon.jsx b/src/components/common/logo/DiscordIcon.jsx index d21f75e7..cd5ce923 100644 --- a/src/components/common/logo/DiscordIcon.jsx +++ b/src/components/common/logo/DiscordIcon.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React from 'react'; const DiscordIcon = ({ style = {}, ...props }) => { diff --git a/src/components/common/logo/DolphinLogo.jsx b/src/components/common/logo/DolphinLogo.jsx index 57dc81aa..20cbd47b 100644 --- a/src/components/common/logo/DolphinLogo.jsx +++ b/src/components/common/logo/DolphinLogo.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import './DolphinLogo.css'; diff --git a/src/components/common/logo/LinuxDoIcon.jsx b/src/components/common/logo/LinuxDoIcon.jsx index f66711a3..4c51d4eb 100644 --- a/src/components/common/logo/LinuxDoIcon.jsx +++ b/src/components/common/logo/LinuxDoIcon.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Icon } from '@/components/ui'; diff --git a/src/components/common/logo/OIDCIcon.jsx b/src/components/common/logo/OIDCIcon.jsx index 981274ed..5f0797a2 100644 --- a/src/components/common/logo/OIDCIcon.jsx +++ b/src/components/common/logo/OIDCIcon.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Icon } from '@/components/ui'; diff --git a/src/components/common/logo/WeChatIcon.jsx b/src/components/common/logo/WeChatIcon.jsx index 9339385a..df509199 100644 --- a/src/components/common/logo/WeChatIcon.jsx +++ b/src/components/common/logo/WeChatIcon.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Icon } from '@/components/ui'; diff --git a/src/components/common/logo/WeeLogo.jsx b/src/components/common/logo/WeeLogo.jsx index 0da9c6c6..80ad00fc 100644 --- a/src/components/common/logo/WeeLogo.jsx +++ b/src/components/common/logo/WeeLogo.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import './WeeLogo.css'; diff --git a/src/components/common/markdown/MarkdownRenderer.jsx b/src/components/common/markdown/MarkdownRenderer.jsx index bf39aff9..5b3fc14f 100644 --- a/src/components/common/markdown/MarkdownRenderer.jsx +++ b/src/components/common/markdown/MarkdownRenderer.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { useEffectEvent } from '../../../hooks/common/useEffectEvent'; import ReactMarkdown from 'react-markdown'; import 'katex/dist/katex.min.css'; diff --git a/src/components/common/modals/NewUserGiftModal.jsx b/src/components/common/modals/NewUserGiftModal.jsx index 57e8805b..7ad17dba 100644 --- a/src/components/common/modals/NewUserGiftModal.jsx +++ b/src/components/common/modals/NewUserGiftModal.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { X as ActionX, ArrowRight as ActionArrowRight, diff --git a/src/components/common/modals/SecureVerificationModal.jsx b/src/components/common/modals/SecureVerificationModal.jsx index 36680740..ff0400d7 100644 --- a/src/components/common/modals/SecureVerificationModal.jsx +++ b/src/components/common/modals/SecureVerificationModal.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { diff --git a/src/components/common/modals/TwoFactorAuthModal.jsx b/src/components/common/modals/TwoFactorAuthModal.jsx index 3180d4bb..4184be40 100644 --- a/src/components/common/modals/TwoFactorAuthModal.jsx +++ b/src/components/common/modals/TwoFactorAuthModal.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { useTranslation } from 'react-i18next'; import { Modal, Button, Input, Typography } from '@/components/ui'; diff --git a/src/components/common/modals/UserSurveyModal.jsx b/src/components/common/modals/UserSurveyModal.jsx index fa952f8a..efd3f528 100644 --- a/src/components/common/modals/UserSurveyModal.jsx +++ b/src/components/common/modals/UserSurveyModal.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { X as ActionX, ChevronRight as ActionChevronRight, diff --git a/src/components/common/table/ColumnSettings.jsx b/src/components/common/table/ColumnSettings.jsx index f81759c6..0c7675be 100644 --- a/src/components/common/table/ColumnSettings.jsx +++ b/src/components/common/table/ColumnSettings.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Settings as ActionSettings } from '@/components/common/icons/ActionIcons'; import React, { useState } from 'react'; import { Alert, Button, Checkbox, Modal, Tooltip, theme } from 'antd'; diff --git a/src/components/common/table/FilterSearchButton.jsx b/src/components/common/table/FilterSearchButton.jsx index d8cec433..6d9c4308 100644 --- a/src/components/common/table/FilterSearchButton.jsx +++ b/src/components/common/table/FilterSearchButton.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Search as ActionSearch } from '@/components/common/icons/ActionIcons'; import React from 'react'; import { Button } from 'antd'; diff --git a/src/components/common/table/TableEmpty.jsx b/src/components/common/table/TableEmpty.jsx index 3e48a7d8..e10fb1f3 100644 --- a/src/components/common/table/TableEmpty.jsx +++ b/src/components/common/table/TableEmpty.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useLayoutEffect, useRef, useState } from 'react'; import { Empty } from 'antd'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/common/table/TableToolbar.jsx b/src/components/common/table/TableToolbar.jsx index d6935ecf..1aa14c03 100644 --- a/src/components/common/table/TableToolbar.jsx +++ b/src/components/common/table/TableToolbar.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Button, Dropdown } from 'antd'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/common/ui/CardPro.jsx b/src/components/common/ui/CardPro.jsx index 7c54615b..9bdce1cf 100644 --- a/src/components/common/ui/CardPro.jsx +++ b/src/components/common/ui/CardPro.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState } from 'react'; import { Card, Divider, Button } from '@/components/ui'; import PropTypes from 'prop-types'; diff --git a/src/components/common/ui/CardTable.jsx b/src/components/common/ui/CardTable.jsx index 4832c415..8e83ce45 100644 --- a/src/components/common/ui/CardTable.jsx +++ b/src/components/common/ui/CardTable.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { diff --git a/src/components/common/ui/ChannelKeyDisplay.jsx b/src/components/common/ui/ChannelKeyDisplay.jsx index 4b166b37..a93703ee 100644 --- a/src/components/common/ui/ChannelKeyDisplay.jsx +++ b/src/components/common/ui/ChannelKeyDisplay.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { useTranslation } from 'react-i18next'; import { Card, Button, Typography, Tag } from '@/components/ui'; diff --git a/src/components/common/ui/CompactModeToggle.jsx b/src/components/common/ui/CompactModeToggle.jsx index ce4129aa..0c3ce7e0 100644 --- a/src/components/common/ui/CompactModeToggle.jsx +++ b/src/components/common/ui/CompactModeToggle.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Button } from '@/components/ui'; import PropTypes from 'prop-types'; diff --git a/src/components/common/ui/JSONEditor.jsx b/src/components/common/ui/JSONEditor.jsx index 51ea9ed0..b60acdf6 100644 --- a/src/components/common/ui/JSONEditor.jsx +++ b/src/components/common/ui/JSONEditor.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState, useEffect, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { diff --git a/src/components/common/ui/Loading.jsx b/src/components/common/ui/Loading.jsx index 05021bab..f7d9eba3 100644 --- a/src/components/common/ui/Loading.jsx +++ b/src/components/common/ui/Loading.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import React, { useEffect, useMemo, useState } from 'react'; import i18next from 'i18next'; diff --git a/src/components/common/ui/QuotaInput.jsx b/src/components/common/ui/QuotaInput.jsx index 681c068e..ab4450d6 100644 --- a/src/components/common/ui/QuotaInput.jsx +++ b/src/components/common/ui/QuotaInput.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useRef, useState } from 'react'; import { InputNumber, withField } from '@/components/ui'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/common/ui/RenderUtils.jsx b/src/components/common/ui/RenderUtils.jsx index a3f2b3af..54b1ef27 100644 --- a/src/components/common/ui/RenderUtils.jsx +++ b/src/components/common/ui/RenderUtils.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Space, Tag, Typography, Popover } from '@/components/ui'; diff --git a/src/components/common/ui/RichTextEditor.jsx b/src/components/common/ui/RichTextEditor.jsx index 2fa930d8..00053c58 100644 --- a/src/components/common/ui/RichTextEditor.jsx +++ b/src/components/common/ui/RichTextEditor.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { useTranslation } from 'react-i18next'; import React, { useEffect, useRef, useState } from 'react'; import Quill, { Delta } from 'quill/core'; diff --git a/src/components/common/ui/ScrollableContainer.jsx b/src/components/common/ui/ScrollableContainer.jsx index ec2d8fd3..df67a333 100644 --- a/src/components/common/ui/ScrollableContainer.jsx +++ b/src/components/common/ui/ScrollableContainer.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useRef, useState, diff --git a/src/components/common/ui/SelectableButtonGroup.jsx b/src/components/common/ui/SelectableButtonGroup.jsx index 000b6051..13af2e8c 100644 --- a/src/components/common/ui/SelectableButtonGroup.jsx +++ b/src/components/common/ui/SelectableButtonGroup.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState, useRef, useEffect } from 'react'; import { useMinimumLoadingTime } from '../../../hooks/common/useMinimumLoadingTime'; import { useContainerWidth } from '../../../hooks/common/useContainerWidth'; diff --git a/src/components/common/ui/richTextContent.js b/src/components/common/ui/richTextContent.js index f0f889b5..253df961 100644 --- a/src/components/common/ui/richTextContent.js +++ b/src/components/common/ui/richTextContent.js @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { articleImageSource } from './richTextImages.js'; const TAGS = new Set([ diff --git a/src/components/common/ui/richTextImages.js b/src/components/common/ui/richTextImages.js index 837e02a3..d0ff1e17 100644 --- a/src/components/common/ui/richTextImages.js +++ b/src/components/common/ui/richTextImages.js @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ export const ARTICLE_IMAGE_LIMIT = 2 * 1024 * 1024; export const ARTICLE_IMAGE_TYPES = [ 'image/jpeg', diff --git a/src/components/common/ui/richTextLength.js b/src/components/common/ui/richTextLength.js index 437200ab..5a643c19 100644 --- a/src/components/common/ui/richTextLength.js +++ b/src/components/common/ui/richTextLength.js @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { decodeHTML } from 'entities'; export const ARTICLE_BODY_LIMIT = 20000; diff --git a/src/components/console/ConsoleCollection.jsx b/src/components/console/ConsoleCollection.jsx index 66b71dac..7e19c545 100644 --- a/src/components/console/ConsoleCollection.jsx +++ b/src/components/console/ConsoleCollection.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useState } from 'react'; import { Button } from 'antd'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/console/ConsoleContext.jsx b/src/components/console/ConsoleContext.jsx index becc7b74..c190ccff 100644 --- a/src/components/console/ConsoleContext.jsx +++ b/src/components/console/ConsoleContext.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { createContext, useContext } from 'react'; import { theme } from 'antd'; diff --git a/src/components/console/ConsoleModuleFilters.jsx b/src/components/console/ConsoleModuleFilters.jsx index d292c7d1..371dbd00 100644 --- a/src/components/console/ConsoleModuleFilters.jsx +++ b/src/components/console/ConsoleModuleFilters.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useId } from 'react'; import { Button } from 'antd'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/console/ConsolePageContainer.jsx b/src/components/console/ConsolePageContainer.jsx index 8a5f858c..725f76ed 100644 --- a/src/components/console/ConsolePageContainer.jsx +++ b/src/components/console/ConsolePageContainer.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo, useState } from 'react'; import { createPortal } from 'react-dom'; import { Breadcrumb } from 'antd'; diff --git a/src/components/console/ConsolePrimitives.jsx b/src/components/console/ConsolePrimitives.jsx index f3d67c51..139d96dc 100644 --- a/src/components/console/ConsolePrimitives.jsx +++ b/src/components/console/ConsolePrimitives.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { forwardRef } from 'react'; import Table from '../ui/CenterActionTable'; import { diff --git a/src/components/console/consoleRoutes.js b/src/components/console/consoleRoutes.js index 9dbd2eb6..20dccf7b 100644 --- a/src/components/console/consoleRoutes.js +++ b/src/components/console/consoleRoutes.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // Presentation metadata only. Route guards and feature visibility remain in App/SiderBar. export const consolePages = [ { diff --git a/src/components/console/consoleTableAdapter.js b/src/components/console/consoleTableAdapter.js index abc62525..df8b5a29 100644 --- a/src/components/console/consoleTableAdapter.js +++ b/src/components/console/consoleTableAdapter.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - export function toConsoleTableChange(pagination, filters, sorter, extra) { const normalize = (value) => ({ ...value, diff --git a/src/components/creation/CompareSummary.jsx b/src/components/creation/CompareSummary.jsx index c473d9a2..fbe2e43c 100644 --- a/src/components/creation/CompareSummary.jsx +++ b/src/components/creation/CompareSummary.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Button, Modal, Spin } from '@/components/ui'; import { AlertTriangle } from 'lucide-react'; diff --git a/src/components/creation/CreationDock.jsx b/src/components/creation/CreationDock.jsx index 97fa962c..dabafc49 100644 --- a/src/components/creation/CreationDock.jsx +++ b/src/components/creation/CreationDock.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { LayoutTemplate as ActionLayoutTemplate } from '@/components/common/icons/ActionIcons'; import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons'; import { diff --git a/src/components/creation/CreationGuide.jsx b/src/components/creation/CreationGuide.jsx index bac931b9..be652699 100644 --- a/src/components/creation/CreationGuide.jsx +++ b/src/components/creation/CreationGuide.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useMemo, useState } from 'react'; import Joyride, { EVENTS, STATUS } from 'react-joyride'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/creation/CreationStudio.jsx b/src/components/creation/CreationStudio.jsx index 821fefa1..f1b5edc2 100644 --- a/src/components/creation/CreationStudio.jsx +++ b/src/components/creation/CreationStudio.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useCallback, useContext, diff --git a/src/components/creation/ModelPicker/ModelPicker.jsx b/src/components/creation/ModelPicker/ModelPicker.jsx index 88668b2d..42657c66 100644 --- a/src/components/creation/ModelPicker/ModelPicker.jsx +++ b/src/components/creation/ModelPicker/ModelPicker.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Lock as ActionLock, ChevronDown as ActionChevronDown, diff --git a/src/components/creation/ModelPicker/ModelPickerPanel.jsx b/src/components/creation/ModelPicker/ModelPickerPanel.jsx index e25507e5..b0c36512 100644 --- a/src/components/creation/ModelPicker/ModelPickerPanel.jsx +++ b/src/components/creation/ModelPicker/ModelPickerPanel.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useEffect, useId, useMemo, useRef, useState } from 'react'; import { Button, Skeleton, Switch } from '@/components/ui'; import { Check, Clock, Columns2, Lock, Search, Square } from 'lucide-react'; diff --git a/src/components/creation/ModelPicker/index.js b/src/components/creation/ModelPicker/index.js index b07cd40c..e0c81e1c 100644 --- a/src/components/creation/ModelPicker/index.js +++ b/src/components/creation/ModelPicker/index.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - export { default } from './ModelPicker'; export { default as ModelPicker } from './ModelPicker'; export { default as ModelPickerPanel } from './ModelPickerPanel'; diff --git a/src/components/creation/ModelPicker/model-picker.css b/src/components/creation/ModelPicker/model-picker.css index 23bc432f..79f3b455 100644 --- a/src/components/creation/ModelPicker/model-picker.css +++ b/src/components/creation/ModelPicker/model-picker.css @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - /* 模型选择器(WP B-4):配色全部从主题 token 派生。 */ .mp-trigger, .mp-panel { diff --git a/src/components/creation/ModelPicker/modelPickerUtils.js b/src/components/creation/ModelPicker/modelPickerUtils.js index 7f06da43..f451291c 100644 --- a/src/components/creation/ModelPicker/modelPickerUtils.js +++ b/src/components/creation/ModelPicker/modelPickerUtils.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 模型选择器(WP B-4)的纯函数:分组、搜索、能力标签、单价、不兼容原因、最近使用。 // 无 React / i18n 依赖(文案以 i18n key + 插值返回),可直接 node --test。 diff --git a/src/components/creation/ModelPicker/modelPickerUtils.test.js b/src/components/creation/ModelPicker/modelPickerUtils.test.js index 8b7d4c12..fd0b4976 100644 --- a/src/components/creation/ModelPicker/modelPickerUtils.test.js +++ b/src/components/creation/ModelPicker/modelPickerUtils.test.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import assert from 'node:assert/strict'; import test from 'node:test'; import { diff --git a/src/components/creation/WorkFeed/ApiCodePanel.jsx b/src/components/creation/WorkFeed/ApiCodePanel.jsx index 7b843352..15fbc7b1 100644 --- a/src/components/creation/WorkFeed/ApiCodePanel.jsx +++ b/src/components/creation/WorkFeed/ApiCodePanel.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Code2 as ActionCode2, ChevronDown as ActionChevronDown, diff --git a/src/components/creation/WorkFeed/FilterBar.jsx b/src/components/creation/WorkFeed/FilterBar.jsx index 37cc4484..c8efc4cb 100644 --- a/src/components/creation/WorkFeed/FilterBar.jsx +++ b/src/components/creation/WorkFeed/FilterBar.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { GitCompare as ActionGitCompare } from '@/components/common/icons/ActionIcons'; import { Star as ActionStar, diff --git a/src/components/creation/WorkFeed/WorkCard.jsx b/src/components/creation/WorkFeed/WorkCard.jsx index ff6172f8..907219b8 100644 --- a/src/components/creation/WorkFeed/WorkCard.jsx +++ b/src/components/creation/WorkFeed/WorkCard.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { RefreshCw as ActionRefreshCw, Check as ActionCheck, diff --git a/src/components/creation/WorkFeed/WorkDetailDrawer.jsx b/src/components/creation/WorkFeed/WorkDetailDrawer.jsx index fd03e11a..7b044b99 100644 --- a/src/components/creation/WorkFeed/WorkDetailDrawer.jsx +++ b/src/components/creation/WorkFeed/WorkDetailDrawer.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Star as ActionStar, Copy as ActionCopy, diff --git a/src/components/creation/WorkFeed/WorkFeed.jsx b/src/components/creation/WorkFeed/WorkFeed.jsx index c3962be4..10a3a023 100644 --- a/src/components/creation/WorkFeed/WorkFeed.jsx +++ b/src/components/creation/WorkFeed/WorkFeed.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons'; import React, { useCallback, diff --git a/src/components/creation/WorkFeed/work-feed.css b/src/components/creation/WorkFeed/work-feed.css index b7722afc..4a4b5941 100644 --- a/src/components/creation/WorkFeed/work-feed.css +++ b/src/components/creation/WorkFeed/work-feed.css @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - /* * 作品流(WP B-6,方案 §4.1 / §4.4 / §4.5)。 * 配色全部从 --studio-*(creation.css)与语义 token 派生;不画整页背景。 diff --git a/src/components/creation/batchConfirm.js b/src/components/creation/batchConfirm.js index 067789ef..d849654b 100644 --- a/src/components/creation/batchConfirm.js +++ b/src/components/creation/batchConfirm.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { Modal } from '@/components/ui'; import { formatQuoteAmount } from '../../hooks/creation/useCreationQuote'; diff --git a/src/components/creation/creation.css b/src/components/creation/creation.css index 6537ad60..25046011 100644 --- a/src/components/creation/creation.css +++ b/src/components/creation/creation.css @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - /* * 新创作台外壳(WP B-2,方案 §4.1):头部 / 全宽作品流 / 底部创作台。 * - 整页背景由父级 ExperienceCenter 的 提供,这里不画背景。 diff --git a/src/components/creation/params/ChipGroup.jsx b/src/components/creation/params/ChipGroup.jsx index 52b6ce98..1fce2936 100644 --- a/src/components/creation/params/ChipGroup.jsx +++ b/src/components/creation/params/ChipGroup.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { useTranslation } from 'react-i18next'; import OptionGroup from './OptionGroup'; diff --git a/src/components/creation/params/DurationSegmented.jsx b/src/components/creation/params/DurationSegmented.jsx index 176e8597..7f7fc4f9 100644 --- a/src/components/creation/params/DurationSegmented.jsx +++ b/src/components/creation/params/DurationSegmented.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { useTranslation } from 'react-i18next'; import OptionGroup from './OptionGroup'; diff --git a/src/components/creation/params/ImageSlot.jsx b/src/components/creation/params/ImageSlot.jsx index a42a4129..f24fd8ec 100644 --- a/src/components/creation/params/ImageSlot.jsx +++ b/src/components/creation/params/ImageSlot.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { RotateCcw as ActionRotateCcw, X as ActionX, diff --git a/src/components/creation/params/OptionGroup.jsx b/src/components/creation/params/OptionGroup.jsx index 1851c923..6f7e1619 100644 --- a/src/components/creation/params/OptionGroup.jsx +++ b/src/components/creation/params/OptionGroup.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useRef } from 'react'; import { Tooltip } from '@/components/ui'; import { optionKey, optionValue } from './constraints'; diff --git a/src/components/creation/params/ParamRenderer.jsx b/src/components/creation/params/ParamRenderer.jsx index cbe484b2..5eaaca69 100644 --- a/src/components/creation/params/ParamRenderer.jsx +++ b/src/components/creation/params/ParamRenderer.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import RatioPicker from './RatioPicker'; diff --git a/src/components/creation/params/ParamSelect.jsx b/src/components/creation/params/ParamSelect.jsx index 65db5d6b..a342c3c0 100644 --- a/src/components/creation/params/ParamSelect.jsx +++ b/src/components/creation/params/ParamSelect.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useMemo } from 'react'; import { Select, Tooltip } from '@/components/ui'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/creation/params/ParamSlider.jsx b/src/components/creation/params/ParamSlider.jsx index f1b98267..2ea3edc9 100644 --- a/src/components/creation/params/ParamSlider.jsx +++ b/src/components/creation/params/ParamSlider.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Slider, Tooltip } from '@/components/ui'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/creation/params/ParamSwitch.jsx b/src/components/creation/params/ParamSwitch.jsx index 138eda4e..8fa7d2cb 100644 --- a/src/components/creation/params/ParamSwitch.jsx +++ b/src/components/creation/params/ParamSwitch.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { Switch, Tooltip } from '@/components/ui'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/creation/params/ParamTextArea.jsx b/src/components/creation/params/ParamTextArea.jsx index fa2e7de8..762d8d38 100644 --- a/src/components/creation/params/ParamTextArea.jsx +++ b/src/components/creation/params/ParamTextArea.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { TextArea, Tooltip } from '@/components/ui'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/creation/params/RatioPicker.jsx b/src/components/creation/params/RatioPicker.jsx index de6e5be6..bac80629 100644 --- a/src/components/creation/params/RatioPicker.jsx +++ b/src/components/creation/params/RatioPicker.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React from 'react'; import { useTranslation } from 'react-i18next'; import OptionGroup from './OptionGroup'; diff --git a/src/components/creation/params/SeedInput.jsx b/src/components/creation/params/SeedInput.jsx index 7c726773..e5d1067a 100644 --- a/src/components/creation/params/SeedInput.jsx +++ b/src/components/creation/params/SeedInput.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import React, { useRef } from 'react'; import { InputNumber, Switch, Tooltip } from '@/components/ui'; import { Dices } from 'lucide-react'; diff --git a/src/components/creation/params/constraints.js b/src/components/creation/params/constraints.js index bb6d6ac6..11081c55 100644 --- a/src/components/creation/params/constraints.js +++ b/src/components/creation/params/constraints.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 创作参数 schema 的纯函数工具(无 React / 无 i18n 依赖,可直接 node --test)。 // // schema 约定见 docs/11-前端与体验中心/12-体验中心图像与视频生成升级改造方案.md §3.1: diff --git a/src/components/creation/params/constraints.test.js b/src/components/creation/params/constraints.test.js index 4f210b6a..7c8d9661 100644 --- a/src/components/creation/params/constraints.test.js +++ b/src/components/creation/params/constraints.test.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import assert from 'node:assert/strict'; import test from 'node:test'; import { diff --git a/src/components/creation/params/index.js b/src/components/creation/params/index.js index fffcfc8f..4487b47f 100644 --- a/src/components/creation/params/index.js +++ b/src/components/creation/params/index.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - export { default as ParamRenderer, PARAM_CONTROLS } from './ParamRenderer'; export { default as OptionGroup } from './OptionGroup'; export { default as RatioPicker, RatioShape } from './RatioPicker'; diff --git a/src/components/creation/params/labels.js b/src/components/creation/params/labels.js index 6b56c1c8..fb92b1fd 100644 --- a/src/components/creation/params/labels.js +++ b/src/components/creation/params/labels.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { optionKey, optionValue } from './constraints'; // 已知参数 key 的中文标签(作为 i18n key)。schema 下发了 label 时优先用 label。 diff --git a/src/components/creation/viewport.js b/src/components/creation/viewport.js index 7a2fc708..2c9d4527 100644 --- a/src/components/creation/viewport.js +++ b/src/components/creation/viewport.js @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - // 底部抽屉高度:支持 dvh 时用动态视口单位(iOS Safari / 微信 H5 地址栏伸缩、键盘弹起时不被裁切), // 旧内核(不支持 dvh 的 X5 / 旧 WebView)回退 vh——内联样式里写不支持的单位会整条失效。 const SUPPORTS_DVH = (() => { diff --git a/src/components/customer-service/CustomerServiceQRCard.jsx b/src/components/customer-service/CustomerServiceQRCard.jsx index df29921f..a37d1cea 100644 --- a/src/components/customer-service/CustomerServiceQRCard.jsx +++ b/src/components/customer-service/CustomerServiceQRCard.jsx @@ -1,22 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ - import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons'; import React, { useState, useEffect } from 'react'; import { Avatar, Button } from '@/components/ui'; diff --git a/src/components/customer-service/index.jsx b/src/components/customer-service/index.jsx index bf7dc074..7e22bb66 100644 --- a/src/components/customer-service/index.jsx +++ b/src/components/customer-service/index.jsx @@ -1,21 +1,3 @@ -/* -Copyright (C) 2025 QuantumNous - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -For commercial licensing, please contact support@quantumnous.com -*/ import { Headphones as ActionHeadphones, ChevronLeft as ActionChevronLeft, @@ -42,6 +24,7 @@ const CustomerServiceFloat = () => { const { token } = theme.useToken(); const [isOpen, setIsOpen] = useState(false); const [isCollapsed, setIsCollapsed] = useState(false); + const [arrowOverride, setArrowOverride] = useState(null); const [loading, setLoading] = useState(false); const [currentAgent, setCurrentAgent] = useState(null); const [agentList, setAgentList] = useState([]); @@ -57,7 +40,20 @@ const CustomerServiceFloat = () => { // 容器(点击外部关闭)、面板(打开时聚焦)、触发器(关闭后归还焦点) const containerRef = useRef(null); const panelRef = useRef(null); + const wrapperRef = useRef(null); const triggerRef = useRef(null); + const collapsedTriggerRef = useRef(null); + + // 收起或展开会替换按钮;键盘操作后把焦点移到新的客服入口。 + const changeCollapsed = (collapsed, event) => { + setIsCollapsed(collapsed); + setArrowOverride(collapsed ? null : 'shown'); + if (event.detail === 0) { + requestAnimationFrame(() => { + (collapsed ? collapsedTriggerRef : triggerRef).current?.focus(); + }); + } + }; // 结束当前持有的会话计数(精确释放 /allocate 自增的那一次) const endAllocatedSession = useCallback(({ beacon = false } = {}) => { @@ -77,11 +73,9 @@ const CustomerServiceFloat = () => { API.post(path).catch(() => {}); }, []); - // 打开面板时恢复完整浮钮,确保关闭后的焦点可以回到触发器。 - const handleExpand = () => { - setIsCollapsed(false); - setIsOpen(true); - }; + // 打开面板时临时显示完整按钮,关闭后保留用户原来的收起状态。 + const showCollapsed = isCollapsed && !isOpen; + const handleOpen = () => setIsOpen(true); // 获取客服配置 const fetchConfig = useCallback(async () => { @@ -104,7 +98,6 @@ const CustomerServiceFloat = () => { if (!config.enabled) return undefined; const onOpenRequest = (event) => { event.preventDefault(); - setIsCollapsed(false); setIsOpen(true); }; window.addEventListener(CUSTOMER_SERVICE_OPEN_EVENT, onOpenRequest); @@ -188,13 +181,45 @@ const CustomerServiceFloat = () => { }; // 关闭面板:乐观关闭(不等待网络),释放会话计数,但保留已分配客服以便下次秒开 - const handleClose = useCallback(() => { - endAllocatedSession(); - setIsOpen(false); - setShowAgentList(false); - // 归还焦点到触发按钮(无障碍) - requestAnimationFrame(() => triggerRef.current?.focus?.()); - }, [endAllocatedSession]); + const handleClose = useCallback( + ({ restoreFocus = true, keepArrow = false } = {}) => { + endAllocatedSession(); + setArrowOverride(keepArrow ? 'shown' : 'hidden'); + setIsOpen(false); + setShowAgentList(false); + if (restoreFocus) { + requestAnimationFrame(() => { + (isCollapsed ? collapsedTriggerRef : triggerRef).current?.focus(); + }); + } + }, + [endAllocatedSession, isCollapsed], + ); + + // 显式展开或从底部关闭后,等真实鼠标移动再恢复悬停规则。 + // 不能用 pointerleave:展开会改变热区位置,即使鼠标没动也可能触发离开。 + useEffect(() => { + if (!arrowOverride || isOpen) return; + const onPointerMove = (event) => { + if (event.pointerType !== 'mouse') return; + const isInside = wrapperRef.current?.contains(event.target); + if (isInside === (arrowOverride === 'hidden')) setArrowOverride(null); + }; + const onPointerDown = (event) => { + if ( + arrowOverride === 'shown' && + !wrapperRef.current?.contains(event.target) + ) { + setArrowOverride(null); + } + }; + document.addEventListener('pointermove', onPointerMove); + document.addEventListener('pointerdown', onPointerDown); + return () => { + document.removeEventListener('pointermove', onPointerMove); + document.removeEventListener('pointerdown', onPointerDown); + }; + }, [arrowOverride, isOpen]); // ESC 关闭 + 点击面板外部关闭 useEffect(() => { @@ -203,15 +228,19 @@ const CustomerServiceFloat = () => { if (e.key === 'Escape') handleClose(); }; const onPointerDown = (e) => { - if (containerRef.current && !containerRef.current.contains(e.target)) { - handleClose(); + if ( + e.button === 0 && + containerRef.current && + !containerRef.current.contains(e.target) + ) { + handleClose({ restoreFocus: false }); } }; document.addEventListener('keydown', onKeyDown); - document.addEventListener('mousedown', onPointerDown); + document.addEventListener('pointerdown', onPointerDown); return () => { document.removeEventListener('keydown', onKeyDown); - document.removeEventListener('mousedown', onPointerDown); + document.removeEventListener('pointerdown', onPointerDown); }; }, [isOpen, handleClose]); @@ -253,7 +282,7 @@ const CustomerServiceFloat = () => { return (
{ }} > {isOpen && ( -