koishi-plugin-kkk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/LICENSE +674 -0
- package/README.md +98 -0
- package/assets/web/assets/CronEditor-CYgFpX-g.js +1 -0
- package/assets/web/assets/DesktopLayout-iI43ij11.js +1 -0
- package/assets/web/assets/MobileLayout-CziU8MCR.js +1 -0
- package/assets/web/assets/ThemeSwitch-DFohhwd9.js +1 -0
- package/assets/web/assets/index-BRROK0vh.js +47 -0
- package/assets/web/assets/index-Dj-StEiS.css +2 -0
- package/assets/web/assets/separator-CxcFlCzz.js +1 -0
- package/assets/web/favicon.svg +1 -0
- package/assets/web/icons.svg +24 -0
- package/assets/web/index.html +15 -0
- package/assets/webui.html +115 -0
- package/client/index.ts +63 -0
- package/config/default_config/app.yaml +64 -0
- package/config/default_config/bilibili.yaml +116 -0
- package/config/default_config/config.json +157 -0
- package/config/default_config/cookies.yaml +11 -0
- package/config/default_config/douyin.yaml +99 -0
- package/config/default_config/kuaishou.yaml +8 -0
- package/config/default_config/pushlist.yaml +37 -0
- package/config/default_config/request.yaml +22 -0
- package/config/default_config/upload.yaml +50 -0
- package/config/default_config/xiaohongshu.yaml +23 -0
- package/dist/index.js +1 -0
- package/lib/compat/axios.js +23 -0
- package/lib/compat/cron.js +77 -0
- package/lib/compat/esm.js +15 -0
- package/lib/compat/express.js +23 -0
- package/lib/compat/heroui.js +12 -0
- package/lib/compat/lodash.js +33 -0
- package/lib/compat/logger.js +118 -0
- package/lib/compat/node-karin.js +1053 -0
- package/lib/compat/phosphor-icons.js +27 -0
- package/lib/compat/qqcard.js +256 -0
- package/lib/compat/root.js +44 -0
- package/lib/compat/runtime.js +87 -0
- package/lib/compat/segment.js +167 -0
- package/lib/compat/sqlite3.js +117 -0
- package/lib/compat/start.js +7 -0
- package/lib/compat/syncConfig.js +65 -0
- package/lib/compat/template-react.js +30 -0
- package/lib/compat/text.js +65 -0
- package/lib/compat/yaml.js +13 -0
- package/lib/configBridge.js +91 -0
- package/lib/index.js +775 -0
- package/lib/karin/app.js +34 -0
- package/lib/karin/apps/__ready.js +9 -0
- package/lib/karin/apps/admin.js +136 -0
- package/lib/karin/apps/help.js +233 -0
- package/lib/karin/apps/push.js +291 -0
- package/lib/karin/apps/qrlogin.js +176 -0
- package/lib/karin/apps/statistics.js +209 -0
- package/lib/karin/apps/testPush.js +247 -0
- package/lib/karin/apps/tools.js +473 -0
- package/lib/karin/apps/update.js +252 -0
- package/lib/karin/index.js +37 -0
- package/lib/karin/module/db/bilibili.js +831 -0
- package/lib/karin/module/db/douyin.js +918 -0
- package/lib/karin/module/db/index.js +165 -0
- package/lib/karin/module/db/migration.js +199 -0
- package/lib/karin/module/db/statistics.js +559 -0
- package/lib/karin/module/index.js +94 -0
- package/lib/karin/module/server/constants/routes.js +48 -0
- package/lib/karin/module/server/controllers/bots.js +230 -0
- package/lib/karin/module/server/controllers/config.js +75 -0
- package/lib/karin/module/server/controllers/video.js +208 -0
- package/lib/karin/module/server/index.js +26 -0
- package/lib/karin/module/server/middlewares/auth.js +133 -0
- package/lib/karin/module/server/routes/amagi.js +57 -0
- package/lib/karin/module/server/routes/api.js +40 -0
- package/lib/karin/module/server/routes/index.js +97 -0
- package/lib/karin/module/server/routes/ssr.js +16 -0
- package/lib/karin/module/server/routes/static.js +43 -0
- package/lib/karin/module/utils/Base.js +403 -0
- package/lib/karin/module/utils/CardParser.js +487 -0
- package/lib/karin/module/utils/Common.js +418 -0
- package/lib/karin/module/utils/Config.js +434 -0
- package/lib/karin/module/utils/EmojiReaction.js +242 -0
- package/lib/karin/module/utils/ErrorHandler/handler.js +114 -0
- package/lib/karin/module/utils/ErrorHandler/index.js +55 -0
- package/lib/karin/module/utils/ErrorHandler/render.js +182 -0
- package/lib/karin/module/utils/ErrorHandler/sender.js +206 -0
- package/lib/karin/module/utils/ErrorHandler/strategy.js +41 -0
- package/lib/karin/module/utils/ErrorHandler/types.js +2 -0
- package/lib/karin/module/utils/ErrorHandler/utils.js +108 -0
- package/lib/karin/module/utils/FFmpeg.js +298 -0
- package/lib/karin/module/utils/ImageHelper.js +91 -0
- package/lib/karin/module/utils/ImageSlice.js +429 -0
- package/lib/karin/module/utils/MotionPhoto.js +250 -0
- package/lib/karin/module/utils/Network/Downloader.js +413 -0
- package/lib/karin/module/utils/Network/ImageDownloader.js +250 -0
- package/lib/karin/module/utils/Network/Network.js +332 -0
- package/lib/karin/module/utils/Network/ThrottleStream.js +71 -0
- package/lib/karin/module/utils/Network/constants.js +129 -0
- package/lib/karin/module/utils/Network/helpers.js +174 -0
- package/lib/karin/module/utils/Network/index.js +34 -0
- package/lib/karin/module/utils/Network/types.js +12 -0
- package/lib/karin/module/utils/Networks.js +17 -0
- package/lib/karin/module/utils/ParseLock.js +34 -0
- package/lib/karin/module/utils/ParseOverride.js +88 -0
- package/lib/karin/module/utils/QqCardResolve.js +114 -0
- package/lib/karin/module/utils/QqPanel.js +879 -0
- package/lib/karin/module/utils/Render/coverTheme.js +256 -0
- package/lib/karin/module/utils/Render/index.js +582 -0
- package/lib/karin/module/utils/amagiClient.js +338 -0
- package/lib/karin/module/utils/avatar.js +201 -0
- package/lib/karin/module/utils/bot.js +141 -0
- package/lib/karin/module/utils/build-metadata.js +50 -0
- package/lib/karin/module/utils/changelog.js +166 -0
- package/lib/karin/module/utils/index.js +26 -0
- package/lib/karin/module/utils/loginSession.js +259 -0
- package/lib/karin/module/utils/parseTip.js +93 -0
- package/lib/karin/module/utils/runtime-report.js +140 -0
- package/lib/karin/module/utils/semver.js +72 -0
- package/lib/karin/module/utils/statisticsAggregate.js +415 -0
- package/lib/karin/platform/bilibili/bilibili.js +1805 -0
- package/lib/karin/platform/bilibili/comments.js +294 -0
- package/lib/karin/platform/bilibili/danmaku.js +555 -0
- package/lib/karin/platform/bilibili/dynamic-text.js +827 -0
- package/lib/karin/platform/bilibili/genParams.js +37 -0
- package/lib/karin/platform/bilibili/getID.js +159 -0
- package/lib/karin/platform/bilibili/index.js +24 -0
- package/lib/karin/platform/bilibili/live-status.js +40 -0
- package/lib/karin/platform/bilibili/login.js +132 -0
- package/lib/karin/platform/bilibili/push.js +1397 -0
- package/lib/karin/platform/bilibili/riskControl.js +133 -0
- package/lib/karin/platform/bilibili/search.js +299 -0
- package/lib/karin/platform/common/danmaku-types.js +12 -0
- package/lib/karin/platform/douyin/comments.js +310 -0
- package/lib/karin/platform/douyin/danmaku.js +893 -0
- package/lib/karin/platform/douyin/douyin.js +1145 -0
- package/lib/karin/platform/douyin/getID.js +94 -0
- package/lib/karin/platform/douyin/index.js +24 -0
- package/lib/karin/platform/douyin/login.js +230 -0
- package/lib/karin/platform/douyin/push/favorite.js +75 -0
- package/lib/karin/platform/douyin/push/index.js +21 -0
- package/lib/karin/platform/douyin/push/live.js +69 -0
- package/lib/karin/platform/douyin/push/post.js +60 -0
- package/lib/karin/platform/douyin/push/recommend.js +74 -0
- package/lib/karin/platform/douyin/push/render.js +621 -0
- package/lib/karin/platform/douyin/push/types.js +2 -0
- package/lib/karin/platform/douyin/push.js +1128 -0
- package/lib/karin/platform/douyin/types.js +13 -0
- package/lib/karin/platform/douyin/videoQuality.js +222 -0
- package/lib/karin/platform/douyin/workType.js +182 -0
- package/lib/karin/platform/index.js +20 -0
- package/lib/karin/platform/kuaishou/comments.js +91 -0
- package/lib/karin/platform/kuaishou/getID.js +43 -0
- package/lib/karin/platform/kuaishou/getdata.js +41 -0
- package/lib/karin/platform/kuaishou/index.js +20 -0
- package/lib/karin/platform/kuaishou/kuaishou.js +122 -0
- package/lib/karin/platform/xiaohongshu/comments.js +162 -0
- package/lib/karin/platform/xiaohongshu/getID.js +129 -0
- package/lib/karin/platform/xiaohongshu/index.js +18 -0
- package/lib/karin/platform/xiaohongshu/xiaohongshu.js +643 -0
- package/lib/karin/root.js +73 -0
- package/lib/karin/setup.js +99 -0
- package/lib/karin/types/config/amagi.js +2 -0
- package/lib/karin/types/config/app.js +2 -0
- package/lib/karin/types/config/bilibili.js +2 -0
- package/lib/karin/types/config/cookies.js +2 -0
- package/lib/karin/types/config/douyin.js +2 -0
- package/lib/karin/types/config/index.js +2 -0
- package/lib/karin/types/config/kuaishou.js +2 -0
- package/lib/karin/types/config/pushlist.js +2 -0
- package/lib/karin/types/config/request.js +2 -0
- package/lib/karin/types/config/upload.js +2 -0
- package/lib/karin/types/config/xiaohongshu.js +2 -0
- package/lib/karin/types/datatypes.js +2 -0
- package/lib/karin/types/index.js +18 -0
- package/lib/karin/types/netrorks/NetworksConfigType.js +2 -0
- package/lib/karin/types/netrorks/index.js +17 -0
- package/lib/karin/web.config.js +49 -0
- package/lib/ktr/registry.js +82 -0
- package/lib/ktr/template/_preview/components/PreviewInfoCard.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewLayout.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewVideoCard.js +8 -0
- package/lib/ktr/template/_preview/render.js +142 -0
- package/lib/ktr/template/_preview/types.js +2 -0
- package/lib/ktr/template/_preview/utils/status.js +31 -0
- package/lib/ktr/template/_preview/utils/time.js +12 -0
- package/lib/ktr/template/bilibili/bangumi/components/bangumi.js +127 -0
- package/lib/ktr/template/bilibili/bangumi/components/types.js +2 -0
- package/lib/ktr/template/bilibili/bangumi/index.js +12 -0
- package/lib/ktr/template/bilibili/comment/components/Comment.js +193 -0
- package/lib/ktr/template/bilibili/comment/components/types.js +2 -0
- package/lib/ktr/template/bilibili/comment/index.js +10 -0
- package/lib/ktr/template/bilibili/components/Icons.js +66 -0
- package/lib/ktr/template/bilibili/components/shared.js +93 -0
- package/lib/ktr/template/bilibili/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.js +66 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.js +87 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.js +93 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.js +132 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.js +84 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.js +38 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/components/AdditionalCard.js +59 -0
- package/lib/ktr/template/bilibili/dynamic/components/CommonComponents.js +30 -0
- package/lib/ktr/template/bilibili/dynamic/types.js +2 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.js +48 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/bilibili/qrcodeImg/index.js +10 -0
- package/lib/ktr/template/bilibili/userlist/components/UserList.js +53 -0
- package/lib/ktr/template/bilibili/userlist/components/types.js +3 -0
- package/lib/ktr/template/bilibili/userlist/index.js +13 -0
- package/lib/ktr/template/bilibili/videoInfo/components/types.js +2 -0
- package/lib/ktr/template/bilibili/videoInfo/components/videoInfo.js +62 -0
- package/lib/ktr/template/bilibili/videoInfo/index.js +10 -0
- package/lib/ktr/template/components/AmbientCover.js +36 -0
- package/lib/ktr/template/components/DefaultLayout.js +33 -0
- package/lib/ktr/template/components/GlowImage.js +276 -0
- package/lib/ktr/template/components/QRCodeWithAvatar.js +34 -0
- package/lib/ktr/template/components/RolldownLogo.js +6 -0
- package/lib/ktr/template/components/ViteLogo.js +6 -0
- package/lib/ktr/template/components/iconRegistry.js +173 -0
- package/lib/ktr/template/douyin/article-work/components/ArticleWork.js +99 -0
- package/lib/ktr/template/douyin/article-work/components/types.js +3 -0
- package/lib/ktr/template/douyin/article-work/index.js +10 -0
- package/lib/ktr/template/douyin/comment/components/Comment.js +189 -0
- package/lib/ktr/template/douyin/comment/components/types.js +2 -0
- package/lib/ktr/template/douyin/comment/index.js +10 -0
- package/lib/ktr/template/douyin/components/Icons.js +29 -0
- package/lib/ktr/template/douyin/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/components/Dynamic.js +90 -0
- package/lib/ktr/template/douyin/dynamic/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/index.js +10 -0
- package/lib/ktr/template/douyin/favorite-list/components/FavoriteList.js +30 -0
- package/lib/ktr/template/douyin/favorite-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/favorite-list/index.js +10 -0
- package/lib/ktr/template/douyin/image-work/components/ImageWork.js +136 -0
- package/lib/ktr/template/douyin/image-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/image-work/index.js +10 -0
- package/lib/ktr/template/douyin/live/components/Live.js +51 -0
- package/lib/ktr/template/douyin/live/components/types.js +3 -0
- package/lib/ktr/template/douyin/live/index.js +10 -0
- package/lib/ktr/template/douyin/musicinfo/components/MusicInfo.js +60 -0
- package/lib/ktr/template/douyin/musicinfo/components/types.js +3 -0
- package/lib/ktr/template/douyin/musicinfo/index.js +10 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/qrcodeImg.js +39 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/douyin/qrcodeImg/index.js +9 -0
- package/lib/ktr/template/douyin/recommend-list/components/RecommendList.js +30 -0
- package/lib/ktr/template/douyin/recommend-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/recommend-list/index.js +10 -0
- package/lib/ktr/template/douyin/user_profile/components/UserVideoList.js +54 -0
- package/lib/ktr/template/douyin/user_profile/components/types.js +3 -0
- package/lib/ktr/template/douyin/user_profile/index.js +9 -0
- package/lib/ktr/template/douyin/userlist/components/UserList.js +50 -0
- package/lib/ktr/template/douyin/userlist/components/types.js +3 -0
- package/lib/ktr/template/douyin/userlist/index.js +13 -0
- package/lib/ktr/template/douyin/video-work/components/VideoWork.js +127 -0
- package/lib/ktr/template/douyin/video-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/video-work/index.js +10 -0
- package/lib/ktr/template/kuaishou/comment/components/Comment.js +88 -0
- package/lib/ktr/template/kuaishou/comment/components/types.js +2 -0
- package/lib/ktr/template/kuaishou/comment/index.js +10 -0
- package/lib/ktr/template/other/changelog/components/changelog.js +117 -0
- package/lib/ktr/template/other/changelog/components/types.js +3 -0
- package/lib/ktr/template/other/changelog/index.js +9 -0
- package/lib/ktr/template/other/handlerError/components/errorTitles.js +227 -0
- package/lib/ktr/template/other/handlerError/components/handlerError.js +392 -0
- package/lib/ktr/template/other/handlerError/components/stackHighlight.js +109 -0
- package/lib/ktr/template/other/handlerError/components/types.js +2 -0
- package/lib/ktr/template/other/handlerError/index.js +9 -0
- package/lib/ktr/template/other/help/components/Help.js +79 -0
- package/lib/ktr/template/other/help/components/types.js +3 -0
- package/lib/ktr/template/other/help/index.js +12 -0
- package/lib/ktr/template/other/live-photo-tip/components/LivePhotoTip.js +80 -0
- package/lib/ktr/template/other/live-photo-tip/components/types.js +3 -0
- package/lib/ktr/template/other/live-photo-tip/index.js +9 -0
- package/lib/ktr/template/other/qrlogin/components/qrlogin.js +58 -0
- package/lib/ktr/template/other/qrlogin/components/types.js +3 -0
- package/lib/ktr/template/other/qrlogin/index.js +9 -0
- package/lib/ktr/template/other/runtime/components/runtime.js +101 -0
- package/lib/ktr/template/other/runtime/components/types.js +3 -0
- package/lib/ktr/template/other/runtime/index.js +9 -0
- package/lib/ktr/template/other/version_warning/components/VersionWarning.js +38 -0
- package/lib/ktr/template/other/version_warning/components/types.js +3 -0
- package/lib/ktr/template/other/version_warning/index.js +9 -0
- package/lib/ktr/template/statistics/components/BoxplotGuide.js +17 -0
- package/lib/ktr/template/statistics/components/ChartCard.js +15 -0
- package/lib/ktr/template/statistics/components/KpiCard.js +14 -0
- package/lib/ktr/template/statistics/components/PlatformTable.js +20 -0
- package/lib/ktr/template/statistics/components/RankList.js +61 -0
- package/lib/ktr/template/statistics/components/SSRChart.js +22 -0
- package/lib/ktr/template/statistics/components/chartPresets.js +630 -0
- package/lib/ktr/template/statistics/components/chartTheme.js +226 -0
- package/lib/ktr/template/statistics/components/format.js +38 -0
- package/lib/ktr/template/statistics/components/types.js +9 -0
- package/lib/ktr/template/statistics/global/components/GlobalStatistics.js +246 -0
- package/lib/ktr/template/statistics/global/components/types.js +3 -0
- package/lib/ktr/template/statistics/global/index.js +9 -0
- package/lib/ktr/template/statistics/group/components/GroupStatistics.js +181 -0
- package/lib/ktr/template/statistics/group/components/types.js +3 -0
- package/lib/ktr/template/statistics/group/index.js +9 -0
- package/lib/ktr/template/types/ctx.js +2 -0
- package/lib/ktr/template/xiaohongshu/comment/components/Comment.js +99 -0
- package/lib/ktr/template/xiaohongshu/comment/components/types.js +3 -0
- package/lib/ktr/template/xiaohongshu/comment/index.js +9 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/noteInfo.js +93 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/types.js +2 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/index.js +9 -0
- package/lib/ktr/utils/QRCodeAvatar.js +99 -0
- package/lib/ktr/utils/QRcode.js +56 -0
- package/lib/ktr/utils/avatarProxy.js +45 -0
- package/lib/ktr/utils/cn.js +11 -0
- package/lib/ktr/utils/theme.js +12 -0
- package/lib/qqFields.json +75 -0
- package/lib/qqOptions.js +44 -0
- package/lib/richtext/index.js +25 -0
- package/lib/richtext/parse/index.js +232 -0
- package/lib/richtext/react/cn.js +11 -0
- package/lib/richtext/react/index.js +221 -0
- package/lib/richtext/types.js +2 -0
- package/lib/schema.js +352 -0
- package/lib/webui.js +341 -0
- package/package.json +88 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_BV.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_GOODS.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_LOTTERY.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VIEW_PICTURE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VOTE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_WEB.svg +1 -0
- package/resources/image/bilibili/bilibili-dark.png +0 -0
- package/resources/image/bilibili/bilibili-light.png +0 -0
- package/resources/image/bilibili/bilibili.png +0 -0
- package/resources/image/bilibili/id-dark.svg +1 -0
- package/resources/image/bilibili/id-light.svg +1 -0
- package/resources/image/bilibili/level/lv0.svg +1 -0
- package/resources/image/bilibili/level/lv1.svg +1 -0
- package/resources/image/bilibili/level/lv2.svg +1 -0
- package/resources/image/bilibili/level/lv3.svg +1 -0
- package/resources/image/bilibili/level/lv4.svg +1 -0
- package/resources/image/bilibili/level/lv5.svg +1 -0
- package/resources/image/bilibili/level/lv6.svg +1 -0
- package/resources/image/bilibili/level/lv7.svg +1 -0
- package/resources/image/bilibili/like-dark.svg +6 -0
- package/resources/image/bilibili/like-light.svg +6 -0
- package/resources/image/bilibili/play.svg +28 -0
- package/resources/image/bilibili/res-local1.png +0 -0
- package/resources/image/bilibili/up_pb.svg +1 -0
- package/resources/image/bilibili//347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/douyin/douyin.png +0 -0
- package/resources/image/douyin/dylogo-dark.svg +23 -0
- package/resources/image/douyin/dylogo-light.svg +38 -0
- package/resources/image/douyin/search-dark.svg +1 -0
- package/resources/image/douyin/search-light.svg +3 -0
- package/resources/image/douyin//346/212/226/351/237/263-/347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/frame-logo.png +0 -0
- package/resources/image/kuaishou/logo.png +0 -0
- package/resources/image/other/handlerError/Milky.png +0 -0
- package/resources/image/other/handlerError/chronocat.svg +43 -0
- package/resources/image/other/handlerError/conwechat.webp +0 -0
- package/resources/image/other/handlerError/gocq-http.webp +0 -0
- package/resources/image/other/handlerError/lagrange.webp +0 -0
- package/resources/image/other/handlerError/llonebot.webp +0 -0
- package/resources/image/other/handlerError/napcat.webp +0 -0
- package/resources/image/other/handlerError/onebot.png +0 -0
- package/resources/image/other/handlerError/satori.png +0 -0
- package/resources/image/xiaohongshu/logo.png +0 -0
- package/resources/template/style.css +23708 -0
- package/resources/vite.svg +130 -0
- package/scripts/build.mjs +129 -0
- package/scripts/check-schema.cjs +55 -0
- package/scripts/deploy.mjs +78 -0
- package/scripts/make-demo-placeholders.mjs +112 -0
- package/scripts/patch-deps.mjs +46 -0
- package/scripts/patch-webui.mjs +112 -0
- package/scripts/smoke-commands.cjs +39 -0
- package/scripts/smoke-config.cjs +122 -0
- package/scripts/smoke-douyin.cjs +170 -0
- package/scripts/smoke-koishi-commands.cjs +210 -0
- package/scripts/smoke-login.cjs +110 -0
- package/scripts/smoke-parse.cjs +54 -0
- package/scripts/smoke-push-mock.cjs +114 -0
- package/scripts/smoke-push.cjs +104 -0
- package/scripts/smoke-qq.cjs +147 -0
- package/scripts/smoke-qqcard.cjs +108 -0
- package/scripts/smoke-qqpanel.cjs +205 -0
- package/scripts/smoke-render.cjs +106 -0
- package/scripts/smoke-server.cjs +94 -0
- package/src/compat/axios.ts +5 -0
- package/src/compat/cron.ts +86 -0
- package/src/compat/esm.ts +13 -0
- package/src/compat/express.ts +5 -0
- package/src/compat/heroui.tsx +53 -0
- package/src/compat/lodash.ts +32 -0
- package/src/compat/logger.ts +121 -0
- package/src/compat/node-karin.ts +1064 -0
- package/src/compat/phosphor-icons.tsx +25 -0
- package/src/compat/qqcard.ts +251 -0
- package/src/compat/root.ts +44 -0
- package/src/compat/runtime.ts +120 -0
- package/src/compat/segment.ts +161 -0
- package/src/compat/sqlite3.ts +123 -0
- package/src/compat/start.ts +3 -0
- package/src/compat/syncConfig.ts +64 -0
- package/src/compat/template-react.ts +54 -0
- package/src/compat/text.ts +58 -0
- package/src/compat/yaml.ts +6 -0
- package/src/configBridge.ts +94 -0
- package/src/index.ts +769 -0
- package/src/karin/app.ts +1 -0
- package/src/karin/apps/__ready.ts +14 -0
- package/src/karin/apps/admin.ts +127 -0
- package/src/karin/apps/help.ts +228 -0
- package/src/karin/apps/push.ts +327 -0
- package/src/karin/apps/qrlogin.ts +160 -0
- package/src/karin/apps/statistics.ts +203 -0
- package/src/karin/apps/testPush.ts +226 -0
- package/src/karin/apps/tools.ts +510 -0
- package/src/karin/apps/update.ts +239 -0
- package/src/karin/index.ts +9 -0
- package/src/karin/module/db/bilibili.ts +1089 -0
- package/src/karin/module/db/douyin.ts +1218 -0
- package/src/karin/module/db/index.ts +159 -0
- package/src/karin/module/db/migration.ts +249 -0
- package/src/karin/module/db/statistics.ts +817 -0
- package/src/karin/module/index.ts +37 -0
- package/src/karin/module/server/constants/routes.ts +53 -0
- package/src/karin/module/server/controllers/bots.ts +289 -0
- package/src/karin/module/server/controllers/config.ts +85 -0
- package/src/karin/module/server/controllers/video.ts +212 -0
- package/src/karin/module/server/index.ts +11 -0
- package/src/karin/module/server/middlewares/auth.ts +147 -0
- package/src/karin/module/server/routes/amagi.ts +57 -0
- package/src/karin/module/server/routes/api.ts +42 -0
- package/src/karin/module/server/routes/index.ts +68 -0
- package/src/karin/module/server/routes/ssr.ts +14 -0
- package/src/karin/module/server/routes/static.ts +43 -0
- package/src/karin/module/utils/Base.ts +497 -0
- package/src/karin/module/utils/CardParser.ts +503 -0
- package/src/karin/module/utils/Common.ts +448 -0
- package/src/karin/module/utils/Config.ts +443 -0
- package/src/karin/module/utils/EmojiReaction.ts +268 -0
- package/src/karin/module/utils/ErrorHandler/handler.ts +124 -0
- package/src/karin/module/utils/ErrorHandler/index.ts +48 -0
- package/src/karin/module/utils/ErrorHandler/render.ts +180 -0
- package/src/karin/module/utils/ErrorHandler/sender.ts +192 -0
- package/src/karin/module/utils/ErrorHandler/strategy.ts +41 -0
- package/src/karin/module/utils/ErrorHandler/types.ts +122 -0
- package/src/karin/module/utils/ErrorHandler/utils.ts +108 -0
- package/src/karin/module/utils/FFmpeg.ts +357 -0
- package/src/karin/module/utils/ImageHelper.ts +90 -0
- package/src/karin/module/utils/ImageSlice.ts +383 -0
- package/src/karin/module/utils/MotionPhoto.ts +297 -0
- package/src/karin/module/utils/Network/Downloader.ts +481 -0
- package/src/karin/module/utils/Network/ImageDownloader.ts +291 -0
- package/src/karin/module/utils/Network/Network.ts +344 -0
- package/src/karin/module/utils/Network/ThrottleStream.ts +76 -0
- package/src/karin/module/utils/Network/constants.ts +135 -0
- package/src/karin/module/utils/Network/helpers.ts +183 -0
- package/src/karin/module/utils/Network/index.ts +28 -0
- package/src/karin/module/utils/Network/types.ts +46 -0
- package/src/karin/module/utils/Networks.ts +20 -0
- package/src/karin/module/utils/ParseLock.ts +33 -0
- package/src/karin/module/utils/ParseOverride.ts +128 -0
- package/src/karin/module/utils/QqCardResolve.ts +116 -0
- package/src/karin/module/utils/QqPanel.ts +880 -0
- package/src/karin/module/utils/Render/coverTheme.ts +294 -0
- package/src/karin/module/utils/Render/index.ts +574 -0
- package/src/karin/module/utils/amagiClient.ts +368 -0
- package/src/karin/module/utils/avatar.ts +220 -0
- package/src/karin/module/utils/bot.ts +115 -0
- package/src/karin/module/utils/build-metadata.ts +60 -0
- package/src/karin/module/utils/changelog.ts +175 -0
- package/src/karin/module/utils/index.ts +10 -0
- package/src/karin/module/utils/loginSession.ts +291 -0
- package/src/karin/module/utils/parseTip.ts +59 -0
- package/src/karin/module/utils/runtime-report.ts +142 -0
- package/src/karin/module/utils/semver.ts +60 -0
- package/src/karin/module/utils/statisticsAggregate.ts +507 -0
- package/src/karin/platform/bilibili/bilibili.ts +2004 -0
- package/src/karin/platform/bilibili/comments.ts +397 -0
- package/src/karin/platform/bilibili/danmaku.ts +653 -0
- package/src/karin/platform/bilibili/dynamic-text.ts +926 -0
- package/src/karin/platform/bilibili/genParams.ts +30 -0
- package/src/karin/platform/bilibili/getID.ts +163 -0
- package/src/karin/platform/bilibili/index.ts +8 -0
- package/src/karin/platform/bilibili/live-status.ts +36 -0
- package/src/karin/platform/bilibili/login.ts +130 -0
- package/src/karin/platform/bilibili/push.ts +1615 -0
- package/src/karin/platform/bilibili/riskControl.ts +114 -0
- package/src/karin/platform/bilibili/search.ts +305 -0
- package/src/karin/platform/common/danmaku-types.ts +18 -0
- package/src/karin/platform/douyin/comments.ts +404 -0
- package/src/karin/platform/douyin/danmaku.ts +1187 -0
- package/src/karin/platform/douyin/douyin.ts +1244 -0
- package/src/karin/platform/douyin/getID.ts +101 -0
- package/src/karin/platform/douyin/index.ts +8 -0
- package/src/karin/platform/douyin/login.ts +251 -0
- package/src/karin/platform/douyin/push/favorite.ts +97 -0
- package/src/karin/platform/douyin/push/index.ts +5 -0
- package/src/karin/platform/douyin/push/live.ts +86 -0
- package/src/karin/platform/douyin/push/post.ts +75 -0
- package/src/karin/platform/douyin/push/recommend.ts +96 -0
- package/src/karin/platform/douyin/push/render.ts +768 -0
- package/src/karin/platform/douyin/push/types.ts +41 -0
- package/src/karin/platform/douyin/push.ts +1241 -0
- package/src/karin/platform/douyin/types.ts +151 -0
- package/src/karin/platform/douyin/videoQuality.ts +234 -0
- package/src/karin/platform/douyin/workType.ts +238 -0
- package/src/karin/platform/index.ts +4 -0
- package/src/karin/platform/kuaishou/comments.ts +114 -0
- package/src/karin/platform/kuaishou/getID.ts +48 -0
- package/src/karin/platform/kuaishou/getdata.ts +78 -0
- package/src/karin/platform/kuaishou/index.ts +4 -0
- package/src/karin/platform/kuaishou/kuaishou.ts +130 -0
- package/src/karin/platform/xiaohongshu/comments.ts +227 -0
- package/src/karin/platform/xiaohongshu/getID.ts +127 -0
- package/src/karin/platform/xiaohongshu/index.ts +2 -0
- package/src/karin/platform/xiaohongshu/xiaohongshu.ts +733 -0
- package/src/karin/root.ts +78 -0
- package/src/karin/setup.ts +77 -0
- package/src/karin/types/config/amagi.ts +46 -0
- package/src/karin/types/config/app.ts +129 -0
- package/src/karin/types/config/bilibili.ts +121 -0
- package/src/karin/types/config/cookies.ts +11 -0
- package/src/karin/types/config/douyin.ts +93 -0
- package/src/karin/types/config/index.ts +41 -0
- package/src/karin/types/config/kuaishou.ts +10 -0
- package/src/karin/types/config/pushlist.ts +55 -0
- package/src/karin/types/config/request.ts +27 -0
- package/src/karin/types/config/upload.ts +49 -0
- package/src/karin/types/config/xiaohongshu.ts +24 -0
- package/src/karin/types/datatypes.ts +42 -0
- package/src/karin/types/index.ts +4 -0
- package/src/karin/types/netrorks/NetworksConfigType.ts +61 -0
- package/src/karin/types/netrorks/index.ts +1 -0
- package/src/karin/web.config.ts +48 -0
- package/src/ktr/registry.ts +55 -0
- package/src/ktr/template/_preview/components/PreviewInfoCard.tsx +33 -0
- package/src/ktr/template/_preview/components/PreviewLayout.tsx +65 -0
- package/src/ktr/template/_preview/components/PreviewVideoCard.tsx +22 -0
- package/src/ktr/template/_preview/render.ts +158 -0
- package/src/ktr/template/_preview/types.ts +15 -0
- package/src/ktr/template/_preview/utils/status.ts +29 -0
- package/src/ktr/template/_preview/utils/time.ts +8 -0
- package/src/ktr/template/bilibili/bangumi/components/bangumi.tsx +462 -0
- package/src/ktr/template/bilibili/bangumi/components/types.ts +36 -0
- package/src/ktr/template/bilibili/bangumi/index.tsx +9 -0
- package/src/ktr/template/bilibili/comment/components/Comment.tsx +657 -0
- package/src/ktr/template/bilibili/comment/components/types.ts +26 -0
- package/src/ktr/template/bilibili/comment/index.tsx +11 -0
- package/src/ktr/template/bilibili/components/Icons.tsx +209 -0
- package/src/ktr/template/bilibili/components/shared.tsx +162 -0
- package/src/ktr/template/bilibili/components/types.ts +388 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.tsx +251 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.ts +67 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.tsx +238 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.ts +39 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.tsx +205 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.ts +20 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.tsx +11 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.tsx +348 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.ts +16 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.tsx +264 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.ts +32 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.tsx +68 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.ts +14 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/components/AdditionalCard.tsx +165 -0
- package/src/ktr/template/bilibili/dynamic/components/CommonComponents.tsx +142 -0
- package/src/ktr/template/bilibili/dynamic/types.ts +382 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.tsx +179 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/bilibili/qrcodeImg/index.tsx +12 -0
- package/src/ktr/template/bilibili/userlist/components/UserList.tsx +246 -0
- package/src/ktr/template/bilibili/userlist/components/types.ts +35 -0
- package/src/ktr/template/bilibili/userlist/index.tsx +11 -0
- package/src/ktr/template/bilibili/videoInfo/components/types.ts +28 -0
- package/src/ktr/template/bilibili/videoInfo/components/videoInfo.tsx +217 -0
- package/src/ktr/template/bilibili/videoInfo/index.tsx +12 -0
- package/src/ktr/template/components/AmbientCover.tsx +50 -0
- package/src/ktr/template/components/DefaultLayout.tsx +166 -0
- package/src/ktr/template/components/GlowImage.tsx +572 -0
- package/src/ktr/template/components/QRCodeWithAvatar.tsx +52 -0
- package/src/ktr/template/components/RolldownLogo.tsx +110 -0
- package/src/ktr/template/components/ViteLogo.tsx +134 -0
- package/src/ktr/template/components/iconRegistry.ts +294 -0
- package/src/ktr/template/douyin/article-work/components/ArticleWork.tsx +301 -0
- package/src/ktr/template/douyin/article-work/components/types.ts +53 -0
- package/src/ktr/template/douyin/article-work/index.tsx +12 -0
- package/src/ktr/template/douyin/comment/components/Comment.tsx +612 -0
- package/src/ktr/template/douyin/comment/components/types.ts +85 -0
- package/src/ktr/template/douyin/comment/index.tsx +11 -0
- package/src/ktr/template/douyin/components/Icons.tsx +75 -0
- package/src/ktr/template/douyin/components/types.ts +83 -0
- package/src/ktr/template/douyin/dynamic/components/Dynamic.tsx +283 -0
- package/src/ktr/template/douyin/dynamic/components/types.ts +46 -0
- package/src/ktr/template/douyin/dynamic/index.tsx +11 -0
- package/src/ktr/template/douyin/favorite-list/components/FavoriteList.tsx +201 -0
- package/src/ktr/template/douyin/favorite-list/components/types.ts +38 -0
- package/src/ktr/template/douyin/favorite-list/index.tsx +12 -0
- package/src/ktr/template/douyin/image-work/components/ImageWork.tsx +437 -0
- package/src/ktr/template/douyin/image-work/components/types.ts +78 -0
- package/src/ktr/template/douyin/image-work/index.tsx +11 -0
- package/src/ktr/template/douyin/live/components/Live.tsx +229 -0
- package/src/ktr/template/douyin/live/components/types.ts +47 -0
- package/src/ktr/template/douyin/live/index.tsx +11 -0
- package/src/ktr/template/douyin/musicinfo/components/MusicInfo.tsx +187 -0
- package/src/ktr/template/douyin/musicinfo/components/types.ts +31 -0
- package/src/ktr/template/douyin/musicinfo/index.tsx +11 -0
- package/src/ktr/template/douyin/qrcodeImg/components/qrcodeImg.tsx +170 -0
- package/src/ktr/template/douyin/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/douyin/qrcodeImg/index.tsx +9 -0
- package/src/ktr/template/douyin/recommend-list/components/RecommendList.tsx +201 -0
- package/src/ktr/template/douyin/recommend-list/components/types.ts +37 -0
- package/src/ktr/template/douyin/recommend-list/index.tsx +12 -0
- package/src/ktr/template/douyin/user_profile/components/UserVideoList.tsx +225 -0
- package/src/ktr/template/douyin/user_profile/components/types.ts +71 -0
- package/src/ktr/template/douyin/user_profile/index.tsx +9 -0
- package/src/ktr/template/douyin/userlist/components/UserList.tsx +229 -0
- package/src/ktr/template/douyin/userlist/components/types.ts +35 -0
- package/src/ktr/template/douyin/userlist/index.tsx +11 -0
- package/src/ktr/template/douyin/video-work/components/VideoWork.tsx +398 -0
- package/src/ktr/template/douyin/video-work/components/types.ts +80 -0
- package/src/ktr/template/douyin/video-work/index.tsx +11 -0
- package/src/ktr/template/font.css +6071 -0
- package/src/ktr/template/global.d.ts +69 -0
- package/src/ktr/template/kuaishou/comment/components/Comment.tsx +207 -0
- package/src/ktr/template/kuaishou/comment/components/types.ts +47 -0
- package/src/ktr/template/kuaishou/comment/index.tsx +11 -0
- package/src/ktr/template/other/changelog/components/changelog.tsx +411 -0
- package/src/ktr/template/other/changelog/components/types.ts +21 -0
- package/src/ktr/template/other/changelog/index.tsx +9 -0
- package/src/ktr/template/other/handlerError/components/errorTitles.ts +224 -0
- package/src/ktr/template/other/handlerError/components/handlerError.tsx +1076 -0
- package/src/ktr/template/other/handlerError/components/stackHighlight.ts +127 -0
- package/src/ktr/template/other/handlerError/components/types.ts +124 -0
- package/src/ktr/template/other/handlerError/index.tsx +9 -0
- package/src/ktr/template/other/help/components/Help.tsx +249 -0
- package/src/ktr/template/other/help/components/types.ts +47 -0
- package/src/ktr/template/other/help/index.tsx +9 -0
- package/src/ktr/template/other/live-photo-tip/components/LivePhotoTip.tsx +295 -0
- package/src/ktr/template/other/live-photo-tip/components/types.ts +8 -0
- package/src/ktr/template/other/live-photo-tip/index.tsx +9 -0
- package/src/ktr/template/other/qrlogin/components/qrlogin.tsx +295 -0
- package/src/ktr/template/other/qrlogin/components/types.ts +11 -0
- package/src/ktr/template/other/qrlogin/index.tsx +9 -0
- package/src/ktr/template/other/runtime/components/runtime.tsx +347 -0
- package/src/ktr/template/other/runtime/components/types.ts +75 -0
- package/src/ktr/template/other/runtime/index.tsx +9 -0
- package/src/ktr/template/other/version_warning/components/VersionWarning.tsx +392 -0
- package/src/ktr/template/other/version_warning/components/types.ts +8 -0
- package/src/ktr/template/other/version_warning/index.tsx +9 -0
- package/src/ktr/template/statistics/components/BoxplotGuide.tsx +57 -0
- package/src/ktr/template/statistics/components/ChartCard.tsx +40 -0
- package/src/ktr/template/statistics/components/KpiCard.tsx +39 -0
- package/src/ktr/template/statistics/components/PlatformTable.tsx +83 -0
- package/src/ktr/template/statistics/components/RankList.tsx +127 -0
- package/src/ktr/template/statistics/components/SSRChart.tsx +41 -0
- package/src/ktr/template/statistics/components/chartPresets.ts +700 -0
- package/src/ktr/template/statistics/components/chartTheme.ts +234 -0
- package/src/ktr/template/statistics/components/format.ts +33 -0
- package/src/ktr/template/statistics/components/types.ts +92 -0
- package/src/ktr/template/statistics/global/components/GlobalStatistics.tsx +597 -0
- package/src/ktr/template/statistics/global/components/types.ts +138 -0
- package/src/ktr/template/statistics/global/index.tsx +9 -0
- package/src/ktr/template/statistics/group/components/GroupStatistics.tsx +468 -0
- package/src/ktr/template/statistics/group/components/types.ts +113 -0
- package/src/ktr/template/statistics/group/index.tsx +9 -0
- package/src/ktr/template/style.css +65 -0
- package/src/ktr/template/types/ctx.ts +42 -0
- package/src/ktr/template/xiaohongshu/comment/components/Comment.tsx +264 -0
- package/src/ktr/template/xiaohongshu/comment/components/types.ts +119 -0
- package/src/ktr/template/xiaohongshu/comment/index.tsx +9 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/noteInfo.tsx +271 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/types.ts +66 -0
- package/src/ktr/template/xiaohongshu/noteInfo/index.tsx +9 -0
- package/src/ktr/utils/QRCodeAvatar.ts +102 -0
- package/src/ktr/utils/QRcode.ts +65 -0
- package/src/ktr/utils/avatarProxy.ts +42 -0
- package/src/ktr/utils/cn.ts +6 -0
- package/src/ktr/utils/theme.ts +10 -0
- package/src/qqFields.json +75 -0
- package/src/qqOptions.ts +64 -0
- package/src/richtext/index.ts +9 -0
- package/src/richtext/parse/index.ts +271 -0
- package/src/richtext/react/cn.ts +6 -0
- package/src/richtext/react/index.tsx +582 -0
- package/src/richtext/types.ts +320 -0
- package/src/schema.ts +372 -0
- package/src/webui.ts +352 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 调用栈的结构化高亮。
|
|
3
|
+
*
|
|
4
|
+
* 与 `convertAnsiToHtml` 的分工:那个按 ANSI 转义上色,只适用于 `util.inspect`
|
|
5
|
+
* 的彩色转储。amagi 的错误现在只印 `error.stack`(纯文本、没有 ANSI),交给它
|
|
6
|
+
* 整段就是一个颜色 —— 所以这里按**结构**上色:错误名、`[kind/CODE]` 标签、
|
|
7
|
+
* 函数名、目录、文件名、行列号各一色,外部帧(依赖库与 node 内部)整行压暗,
|
|
8
|
+
* 一眼能挑出项目里的帧。归属由调用方的 {@link HighlightStackOptions.isOwnFrame} 判定 ——
|
|
9
|
+
* 不能只看路径里有没有 `node_modules`:发布后的插件自己就装在 `node_modules` 里。
|
|
10
|
+
*
|
|
11
|
+
* 单独成文件(不带 JSX / React import)是为了能直接单测 —— 颜色是否真的分层,
|
|
12
|
+
* 只有断言才说得清。
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 调用栈高亮用的一组颜色。
|
|
17
|
+
*
|
|
18
|
+
* 整个错误页是暖红底,所以这里只用邻近色:玫瑰 → 红 → 橙 → 琥珀,靠色相小步移动
|
|
19
|
+
* 加明度差把各段分开,不再借蓝紫这类对比色 —— 蓝紫压在红底上会跳出来抢戏。
|
|
20
|
+
*/
|
|
21
|
+
export const stackPalette = (dark: boolean) => ({
|
|
22
|
+
base: dark ? 'rgba(255,255,255,0.82)' : 'rgba(127,29,29,0.88)',
|
|
23
|
+
dim: dark ? 'rgba(255,255,255,0.32)' : 'rgba(127,29,29,0.38)',
|
|
24
|
+
errName: dark ? '#f87171' : '#dc2626',
|
|
25
|
+
tag: dark ? '#fb923c' : '#9a3412',
|
|
26
|
+
fn: dark ? '#fda4af' : '#be123c',
|
|
27
|
+
file: dark ? '#fcd34d' : '#a16207',
|
|
28
|
+
num: dark ? '#fdba74' : '#c2410c'
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const escapeHtmlText = (str: string) =>
|
|
32
|
+
str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')
|
|
33
|
+
|
|
34
|
+
/** 转义 + 给 CJK 段落套字体,与 convertAnsiToHtml 的 formatLogContent 同款 */
|
|
35
|
+
const withCjkFont = (str: string) =>
|
|
36
|
+
escapeHtmlText(str).replace(/([㐀-鿿豈- -〿-]+)/g, '<span class="font-[HarmonyOSHans-Regular]">$1</span>')
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 兜底的外部帧判定:只看文本特征,认不出路径。
|
|
40
|
+
*
|
|
41
|
+
* 它区分不了「第三方依赖」与「装在 node_modules 里跑的插件自己」—— 发布后的 kkk 正是
|
|
42
|
+
* 后者,调用帧形如
|
|
43
|
+
* `file:///…/node_modules/.pnpm/koishi-plugin-kkk@…/node_modules/koishi-plugin-kkk/lib/core_chunk/main.js:84860:65`,
|
|
44
|
+
* `node_modules` 出现两次,于是每一帧都被压暗、整块图失去分层。所以它只作兜底(单测等
|
|
45
|
+
* 无调用方上下文的场景),真实渲染一律由调用方给出 {@link HighlightStackOptions.isOwnFrame}。
|
|
46
|
+
* @param location - 帧里的位置原文
|
|
47
|
+
* @returns 是否属于本插件自己的代码
|
|
48
|
+
*/
|
|
49
|
+
const defaultIsOwnFrame = (location: string): boolean => !/node_modules|^node:|\(node:/.test(location)
|
|
50
|
+
|
|
51
|
+
/** {@link highlightStack} 的选项。 */
|
|
52
|
+
export interface HighlightStackOptions {
|
|
53
|
+
/**
|
|
54
|
+
* 判断一个调用帧的位置是否属于本插件自己的代码;返回 false 的帧整行压暗。
|
|
55
|
+
* @param location - 帧里的位置原文,形如 `路径:行:列` 或 `node:internal/…`
|
|
56
|
+
*/
|
|
57
|
+
isOwnFrame?: (location: string) => boolean
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 按结构高亮 JS 调用栈。
|
|
62
|
+
* @param text - `error.stack` 原文(纯文本)
|
|
63
|
+
* @param dark - 是否深色模式
|
|
64
|
+
* @param options - 可选覆盖项;不给 `isOwnFrame` 时退回文本特征判定
|
|
65
|
+
* @returns 可交给 dangerouslySetInnerHTML 的 HTML
|
|
66
|
+
*/
|
|
67
|
+
export const highlightStack = (text: string, dark: boolean, options: HighlightStackOptions = {}): string => {
|
|
68
|
+
const isOwnFrame = options.isOwnFrame ?? defaultIsOwnFrame
|
|
69
|
+
const c = stackPalette(dark)
|
|
70
|
+
const paint = (color: string, str: string, bold = false) =>
|
|
71
|
+
`<span style="color:${color}${bold ? ';font-weight:700' : ''}">${withCjkFont(str)}</span>`
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* `路径:行:列` —— 目录压暗、文件名高亮、行列号另一色。
|
|
75
|
+
* @param loc - 位置原文
|
|
76
|
+
* @param foreign - 外部帧,整行压暗
|
|
77
|
+
* @param ownFrame - 有路径可判归属的帧;裸文件名无从判断,按外部保守处理
|
|
78
|
+
*/
|
|
79
|
+
const paintLocation = (loc: string, foreign: boolean, ownFrame: boolean): string => {
|
|
80
|
+
const dimAll = foreign || !ownFrame
|
|
81
|
+
const pos = /^(.*?):(\d+):(\d+)$/.exec(loc)
|
|
82
|
+
const body = pos ? pos[1] : loc
|
|
83
|
+
const tail = pos ? paint(dimAll ? c.dim : c.num, `:${pos[2]}:${pos[3]}`) : ''
|
|
84
|
+
const cut = Math.max(body.lastIndexOf('/'), body.lastIndexOf('\\'))
|
|
85
|
+
if (cut < 0) return paint(dimAll ? c.dim : c.file, body) + tail
|
|
86
|
+
return paint(c.dim, body.slice(0, cut + 1)) + paint(dimAll ? c.dim : c.file, body.slice(cut + 1)) + tail
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return text
|
|
90
|
+
.split('\n')
|
|
91
|
+
.map((line) => {
|
|
92
|
+
// 调用帧:` at [async |new ]名字 (位置)` 或 ` at 位置`
|
|
93
|
+
const frame = /^(\s*)at\s+(.*)$/.exec(line)
|
|
94
|
+
if (frame) {
|
|
95
|
+
const rest = frame[2]
|
|
96
|
+
const prefix = paint(c.dim, `${frame[1]}at `)
|
|
97
|
+
|
|
98
|
+
const named = /^(?:(async|new)\s+)?(.+?)\s+\((.+)\)$/.exec(rest)
|
|
99
|
+
if (named) {
|
|
100
|
+
const foreign = !isOwnFrame(named[3])
|
|
101
|
+
const modifier = named[1] ? paint(c.dim, `${named[1]} `) : ''
|
|
102
|
+
return (
|
|
103
|
+
prefix +
|
|
104
|
+
modifier +
|
|
105
|
+
paint(foreign ? c.dim : c.fn, named[2]) +
|
|
106
|
+
paint(c.dim, ' (') +
|
|
107
|
+
paintLocation(named[3], foreign, true) +
|
|
108
|
+
paint(c.dim, ')')
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
// 匿名帧:整段就是位置;没有行列号的多半是裸文件名,无从判归属,按外部处理
|
|
112
|
+
const hasPosition = /^(.*?):(\d+):(\d+)$/.test(rest)
|
|
113
|
+
return prefix + paintLocation(rest, !isOwnFrame(rest), hasPosition)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// 首行:`AmagiError: [risk/ANTIBOT_PAGE] 平台返回了反爬页面 (...)`
|
|
117
|
+
const head = /^([A-Za-z_$][\w$]*):\s([\s\S]*)$/.exec(line)
|
|
118
|
+
if (head) {
|
|
119
|
+
const tagMatch = /^(\[[^\]]+\])\s?([\s\S]*)$/.exec(head[2])
|
|
120
|
+
const body = tagMatch ? paint(c.tag, tagMatch[1], true) + paint(c.base, ` ${tagMatch[2]}`) : paint(c.base, head[2])
|
|
121
|
+
return paint(c.errName, head[1], true) + paint(c.dim, ': ') + body
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return paint(c.base, line)
|
|
125
|
+
})
|
|
126
|
+
.join('\n')
|
|
127
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** 本模板的数据类型(路由 index.tsx 与 components/ 实现共用)。 */
|
|
2
|
+
import type { AmagiErrorCode, ErrorKind, RequestTrace, ValidationIssue } from '@ikenxuan/amagi'
|
|
3
|
+
import type { AdapterInfo as KarinAdapterInfo } from 'node-karin'
|
|
4
|
+
|
|
5
|
+
/** 业务错误类型。组件内需要时从总类型取:ApiErrorData['error'] */
|
|
6
|
+
interface BusinessError {
|
|
7
|
+
/** 错误消息 */
|
|
8
|
+
message: string
|
|
9
|
+
/** 错误名称 */
|
|
10
|
+
name: string
|
|
11
|
+
/**
|
|
12
|
+
* 调用栈信息,纯文本(amagi 的 `error.stack`,或调用方显式覆盖的文本)。
|
|
13
|
+
* 模板按「有没有 ANSI」挑高亮方式:没有的按结构上色,有的走 ANSI 解析。
|
|
14
|
+
*/
|
|
15
|
+
stack: string
|
|
16
|
+
/**
|
|
17
|
+
* 非 amagi 异常的自有属性转储(`util.inspect`,带 ANSI)。
|
|
18
|
+
*
|
|
19
|
+
* 调用帧已经在上面单独印了,这里只有 message 与调用点挂的属性 —— 那种情况下
|
|
20
|
+
* 它们往往是唯一线索。amagi 异常与显式覆盖堆栈的情况都没有这一块。
|
|
21
|
+
*/
|
|
22
|
+
dump?: string
|
|
23
|
+
/** 业务名称 */
|
|
24
|
+
businessName: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* amagi v7 的分层错误信息。
|
|
29
|
+
*
|
|
30
|
+
* v6 只有一个混装的 `code`(HTTP 状态码、平台业务码、内部码挤在一起),错误图
|
|
31
|
+
* 也就只能印那个数字。v7 把三种码分了层,另外还给出可重试与请求归因信息 ——
|
|
32
|
+
* 这些正是「这次失败该怎么办」的判据,所以整块透到模板上:
|
|
33
|
+
* `kind` 决定是配置问题还是平台问题,`retryable` 决定要不要让用户重试,
|
|
34
|
+
* `requestId` / `attempts` 决定排查时从哪条日志看起。
|
|
35
|
+
*
|
|
36
|
+
* 只有 amagi 抛出的错误才有这一块;插件自身的异常没有。
|
|
37
|
+
*/
|
|
38
|
+
export interface AmagiErrorDetail {
|
|
39
|
+
/** 跨平台统一的错误大类,12 个之一 */
|
|
40
|
+
kind: ErrorKind
|
|
41
|
+
/** amagi 自己的字符串错误码,22 个之一 */
|
|
42
|
+
code: AmagiErrorCode
|
|
43
|
+
/** 平台返回的原文(未经 inspect 包装) */
|
|
44
|
+
reason: string
|
|
45
|
+
/** 是否值得重试 */
|
|
46
|
+
retryable: boolean
|
|
47
|
+
/** 平台业务码,如 B站的 -352(风控)/ 12061(评论区关闭) */
|
|
48
|
+
platformCode?: string | number
|
|
49
|
+
/** 真实发生的 HTTP 状态 */
|
|
50
|
+
httpStatus?: number
|
|
51
|
+
/** 一次逻辑调用的 id,事件、日志、trace 共用 */
|
|
52
|
+
requestId?: string
|
|
53
|
+
/** 实际发出的请求数,含重试与翻页 */
|
|
54
|
+
attempts?: number
|
|
55
|
+
/** 从 fetcher 入口到信封返回的耗时(毫秒) */
|
|
56
|
+
durationMs?: number
|
|
57
|
+
/** 参数校验的字段级错误,仅 `kind === 'validation'` 时有 */
|
|
58
|
+
issues?: ValidationIssue[]
|
|
59
|
+
/**
|
|
60
|
+
* 逐个请求的明细:URL(含签名参数)、方法、HTTP 状态、耗时与发起原因
|
|
61
|
+
* (`initial` / `retry` / `page` / `segment` / `prepare`)。
|
|
62
|
+
*
|
|
63
|
+
* amagi 只在 `debug: true` 时把它放进 `meta.trace`。它替代了原先靠
|
|
64
|
+
* `util.inspect` 整体转储才能看到的那部分上下文 —— 一次「翻 3 页 + 重试 1 次」
|
|
65
|
+
* 的调用在这里就是 4 行,而转储要几十行还会把同一个 URL 印两遍。
|
|
66
|
+
*/
|
|
67
|
+
trace?: RequestTrace[]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 日志等级类型。组件内需要时从总类型逐步取:NonNullable<ApiErrorData['logs']>[number]['level'] */
|
|
71
|
+
type LogLevel = 'TRAC' | 'DEBU' | 'MARK' | 'INFO' | 'ERRO' | 'WARN' | 'FATA'
|
|
72
|
+
|
|
73
|
+
/** 日志条目接口。 */
|
|
74
|
+
interface LogEntry {
|
|
75
|
+
/** 时间戳 */
|
|
76
|
+
timestamp: string
|
|
77
|
+
/** 日志等级 */
|
|
78
|
+
level: LogLevel
|
|
79
|
+
/** 日志内容 */
|
|
80
|
+
message: string
|
|
81
|
+
/** 原始日志字符串 */
|
|
82
|
+
raw: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** 适配器信息接口。 */
|
|
86
|
+
type AdapterInfo = Omit<KarinAdapterInfo, 'index' | 'secret' | 'connectTime' | 'address'>
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* API错误组件属性接口
|
|
90
|
+
*/
|
|
91
|
+
export interface ApiErrorData {
|
|
92
|
+
/** 错误类型 */
|
|
93
|
+
type: 'business_error'
|
|
94
|
+
/** 平台名称 */
|
|
95
|
+
platform: 'douyin' | 'bilibili' | 'kuaishou' | 'xiaohongshu' | 'system' | 'unknown'
|
|
96
|
+
/** 错误信息 */
|
|
97
|
+
error: BusinessError
|
|
98
|
+
/** amagi v7 的分层错误信息,仅当这次失败来自 amagi 时有 */
|
|
99
|
+
amagi?: AmagiErrorDetail
|
|
100
|
+
/** 调用的方法名 */
|
|
101
|
+
method: string
|
|
102
|
+
/** 错误发生时间 */
|
|
103
|
+
timestamp: string
|
|
104
|
+
/** 收集到的日志信息 */
|
|
105
|
+
logs?: LogEntry[]
|
|
106
|
+
/** 触发命令 */
|
|
107
|
+
triggerCommand?: string
|
|
108
|
+
/** 框架版本 */
|
|
109
|
+
frameworkVersion: string
|
|
110
|
+
/** 插件版本 */
|
|
111
|
+
pluginVersion: string
|
|
112
|
+
/** 构建时间 */
|
|
113
|
+
buildTime?: string
|
|
114
|
+
/** Commit ID */
|
|
115
|
+
commitHash?: string
|
|
116
|
+
/** 适配器信息 */
|
|
117
|
+
adapterInfo?: AdapterInfo
|
|
118
|
+
/** 是否为验证流程 */
|
|
119
|
+
isVerification?: boolean
|
|
120
|
+
/** 验证链接 */
|
|
121
|
+
verificationUrl?: string
|
|
122
|
+
/** 分享链接(用于生成二维码) */
|
|
123
|
+
share_url?: string
|
|
124
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { isDark } from '../../../../utils/theme'
|
|
4
|
+
import { DefaultLayout } from '../../../components/DefaultLayout'
|
|
5
|
+
import { resolveIcon } from '../../../components/iconRegistry'
|
|
6
|
+
import type { PosterProps } from '../../../types/ctx'
|
|
7
|
+
import type { HelpData } from './types'
|
|
8
|
+
|
|
9
|
+
/** 菜单分组类型:从 HelpData 逐步索引派生,types.ts 不再单独导出子类型 */
|
|
10
|
+
type MenuGroup = NonNullable<HelpData['menu']>[number]
|
|
11
|
+
/** 菜单项类型:同上,由 MenuGroup 继续索引得到 */
|
|
12
|
+
type MenuItem = MenuGroup['items'][number]
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 获取图标组件,兜底为默认图标
|
|
16
|
+
* @param icon - 图标:可以是字符串或带颜色的对象
|
|
17
|
+
* @returns React 图标组件类型
|
|
18
|
+
*/
|
|
19
|
+
const getIconForItem = (icon?: MenuItem['icon']): React.ComponentType<any> => {
|
|
20
|
+
if (!icon) return resolveIcon('ph:question-fill')
|
|
21
|
+
const name = typeof icon === 'string' ? icon : icon.name
|
|
22
|
+
return resolveIcon(name)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 菜单项组件
|
|
27
|
+
* 展示单个功能的图标、标题和描述
|
|
28
|
+
*/
|
|
29
|
+
const MenuItemComponent: React.FC<{
|
|
30
|
+
/** 菜单项数据 */
|
|
31
|
+
item: MenuItem
|
|
32
|
+
/** 主题色 */
|
|
33
|
+
themeColor: string
|
|
34
|
+
}> = ({ item, themeColor }) => {
|
|
35
|
+
const IconComponent = getIconForItem(item.icon)
|
|
36
|
+
const iconColor = typeof item.icon === 'object' && item.icon?.color ? item.icon.color : themeColor
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="flex flex-row gap-8 py-2 relative">
|
|
40
|
+
<div className="pt-2 shrink-0 relative">
|
|
41
|
+
<IconComponent className="w-16 h-16 relative z-10 text-foreground" style={{ color: iconColor }} />
|
|
42
|
+
</div>
|
|
43
|
+
<div className="flex-1 min-w-0">
|
|
44
|
+
<h3 className="mb-3 text-4xl font-black leading-tight tracking-wide text-foreground">{item.title}</h3>
|
|
45
|
+
<p className="text-2xl font-medium leading-relaxed whitespace-pre-line text-muted">{item.description}</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 菜单分组组件
|
|
53
|
+
*/
|
|
54
|
+
const MenuGroupComponent: React.FC<{
|
|
55
|
+
/** 分组数据 */
|
|
56
|
+
group: MenuGroup
|
|
57
|
+
/** 主题色 */
|
|
58
|
+
themeColor: string
|
|
59
|
+
}> = ({ group, themeColor }) => {
|
|
60
|
+
return (
|
|
61
|
+
<div className="relative py-8">
|
|
62
|
+
{/* 分组标题 */}
|
|
63
|
+
<div className="flex items-center gap-6 mb-16">
|
|
64
|
+
<div className="w-3 h-16 rounded-full" style={{ backgroundColor: themeColor }} />
|
|
65
|
+
<h2 className="m-0 text-[4rem] font-black tracking-tight uppercase leading-none text-foreground">{group.title}</h2>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-24 gap-y-16">
|
|
69
|
+
{group.items.map((item, idx) => (
|
|
70
|
+
<MenuItemComponent key={idx} item={item} themeColor={themeColor} />
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{group.subGroups?.map((sub, i) => (
|
|
75
|
+
<div key={i} className="mt-20 relative">
|
|
76
|
+
<h3 className="m-0 mb-10 text-3xl font-bold tracking-wide uppercase opacity-60 flex items-center gap-4 text-foreground">
|
|
77
|
+
<div className="w-2 h-2 rounded-full bg-current" />
|
|
78
|
+
{sub.title}
|
|
79
|
+
</h3>
|
|
80
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-24 gap-y-16">
|
|
81
|
+
{sub.items.map((item, idx) => (
|
|
82
|
+
<MenuItemComponent key={idx} item={item} themeColor={themeColor} />
|
|
83
|
+
))}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 帮助页面组件
|
|
93
|
+
*/
|
|
94
|
+
export const Help: React.FC<PosterProps<HelpData>> = React.memo((props) => {
|
|
95
|
+
const title = props.data?.title || 'KKK PLUGIN'
|
|
96
|
+
const menuData = props.data?.menu || []
|
|
97
|
+
const dark = isDark(props.ctx)
|
|
98
|
+
|
|
99
|
+
// 弥散光颜色配置
|
|
100
|
+
const glowColors = dark
|
|
101
|
+
? {
|
|
102
|
+
primary: 'rgba(59, 130, 246, 0.4)', // Blue
|
|
103
|
+
secondary: 'rgba(139, 92, 246, 0.3)', // Violet
|
|
104
|
+
accent: 'rgba(6, 182, 212, 0.25)' // Cyan
|
|
105
|
+
}
|
|
106
|
+
: {
|
|
107
|
+
primary: 'rgba(56, 189, 248, 0.5)', // Sky
|
|
108
|
+
secondary: 'rgba(167, 139, 250, 0.4)', // Violet
|
|
109
|
+
accent: 'rgba(45, 212, 191, 0.3)' // Teal
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 内容主题色轮换
|
|
113
|
+
const contentColors = dark
|
|
114
|
+
? ['#60a5fa', '#a78bfa', '#2dd4bf'] // Blue-400, Violet-400, Teal-400
|
|
115
|
+
: ['#2563eb', '#7c3aed', '#0d9488'] // Blue-600, Violet-600, Teal-600
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<DefaultLayout {...props}>
|
|
119
|
+
{/* 1. 弥散光背景层 */}
|
|
120
|
+
<div className="absolute inset-0 pointer-events-none z-0">
|
|
121
|
+
<div
|
|
122
|
+
className="absolute rounded-full w-315 h-360 -top-67.5 -left-45 blur-[128px] -rotate-20"
|
|
123
|
+
style={{
|
|
124
|
+
background: `radial-gradient(ellipse at 40% 40%, ${glowColors.primary} 0%, transparent 70%)`
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
<div
|
|
128
|
+
className="absolute rounded-full w-225 h-270 top-112.5 -right-22.5 blur-[108px] rotate-15"
|
|
129
|
+
style={{
|
|
130
|
+
background: `radial-gradient(ellipse at 50% 50%, ${glowColors.secondary} 0%, transparent 70%)`
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
<div
|
|
134
|
+
className="absolute rounded-full w-270 h-225 -bottom-45 left-45 blur-[128px] -rotate-10"
|
|
135
|
+
style={{
|
|
136
|
+
background: `radial-gradient(ellipse at 50% 60%, ${glowColors.accent} 0%, transparent 70%)`
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
{/* 2. 杂色纹理层 */}
|
|
142
|
+
<div className="absolute inset-0 pointer-events-none z-0 opacity-[0.08] dark:opacity-[0.12]">
|
|
143
|
+
<svg className="w-full h-full" xmlns="http://www.w3.org/2000/svg">
|
|
144
|
+
<filter id="pixelNoise" x="0%" y="0%" width="100%" height="100%">
|
|
145
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="1" stitchTiles="stitch" result="noise" />
|
|
146
|
+
<feColorMatrix type="saturate" values="0" result="gray" />
|
|
147
|
+
<feComponentTransfer>
|
|
148
|
+
<feFuncR type="discrete" tableValues="0 1" />
|
|
149
|
+
<feFuncG type="discrete" tableValues="0 1" />
|
|
150
|
+
<feFuncB type="discrete" tableValues="0 1" />
|
|
151
|
+
</feComponentTransfer>
|
|
152
|
+
</filter>
|
|
153
|
+
<rect width="100%" height="100%" filter="url(#pixelNoise)" />
|
|
154
|
+
</svg>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
{/* 3. 背景大字装饰 */}
|
|
158
|
+
<div className="absolute top-30 right-15 pointer-events-none select-none opacity-[0.03] z-0">
|
|
159
|
+
<span
|
|
160
|
+
className="text-[200px] font-black tracking-tighter leading-none block text-right text-foreground"
|
|
161
|
+
style={{
|
|
162
|
+
writingMode: 'vertical-rl',
|
|
163
|
+
textOrientation: 'mixed'
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
GUIDE
|
|
167
|
+
</span>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
{/* 4. 四周装饰性图形点缀 */}
|
|
171
|
+
<div className="absolute inset-0 pointer-events-none z-0 overflow-hidden">
|
|
172
|
+
{/* 左上角:矩阵点阵 */}
|
|
173
|
+
<div className="absolute top-12 left-12 grid grid-cols-4 gap-2 opacity-20">
|
|
174
|
+
{[...Array(16)].map((_, i) => (
|
|
175
|
+
<div key={i} className="w-1.5 h-1.5 rounded-full bg-foreground" />
|
|
176
|
+
))}
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
{/* 右上角 */}
|
|
180
|
+
<div className="absolute top-12 right-12 flex flex-col items-end gap-1 opacity-20">
|
|
181
|
+
<div className="w-32 h-1 bg-foreground" />
|
|
182
|
+
<div className="w-24 h-1 bg-foreground" />
|
|
183
|
+
<div className="w-16 h-1 bg-foreground" />
|
|
184
|
+
<div className="text-xs font-mono mt-1 text-foreground">SYS.32.91</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
{/* 左侧边缘 */}
|
|
188
|
+
<div className="absolute top-1/2 -translate-y-1/2 left-0 w-8 h-64 flex flex-col justify-between opacity-10">
|
|
189
|
+
{[...Array(20)].map((_, i) => (
|
|
190
|
+
<div
|
|
191
|
+
key={i}
|
|
192
|
+
className="w-full bg-foreground"
|
|
193
|
+
style={{ height: Math.random() > 0.5 ? '4px' : '2px', width: Math.random() * 100 + '%' }}
|
|
194
|
+
/>
|
|
195
|
+
))}
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
{/* 右侧边缘 */}
|
|
199
|
+
<div className="absolute top-1/3 right-0 w-0 h-0 border-t-20 border-t-transparent border-r-30 border-r-foreground border-b-20 border-b-transparent opacity-10" />
|
|
200
|
+
|
|
201
|
+
{/* 底部装饰 */}
|
|
202
|
+
<div className="absolute bottom-0 left-0 right-0 h-48 pointer-events-none">
|
|
203
|
+
{/* 左下角装饰条纹 */}
|
|
204
|
+
<div
|
|
205
|
+
className="absolute bottom-0 left-0 w-130 h-100 opacity-[0.04]"
|
|
206
|
+
style={{
|
|
207
|
+
background: `repeating-linear-gradient(45deg, ${dark ? '#fff' : '#000'}, ${dark ? '#fff' : '#000'} 5px, transparent 2px, transparent 10px)`
|
|
208
|
+
}}
|
|
209
|
+
/>
|
|
210
|
+
{/* 右下角大圆环 */}
|
|
211
|
+
<div className="absolute -bottom-120 -right-90 w-300 h-300 rounded-full border-200 border-foreground opacity-[0.04]" />
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
{/* 5. 主要内容区域 */}
|
|
216
|
+
<div className="relative z-10 p-18 flex flex-col min-h-100">
|
|
217
|
+
{/* 头部区域 */}
|
|
218
|
+
<div className="flex justify-between items-end mb-24 border-b-4 border-foreground/10 pb-8">
|
|
219
|
+
<div className="flex flex-col gap-2">
|
|
220
|
+
<div className="flex items-center gap-3 opacity-60">
|
|
221
|
+
<span className="w-2 h-2 rounded-full bg-blue-500 animate-pulse" />
|
|
222
|
+
<span className="text-sm font-mono tracking-widest text-muted">SYSTEM_READY</span>
|
|
223
|
+
</div>
|
|
224
|
+
<h1 className="text-[5rem] font-black leading-none tracking-tighter text-foreground">COMMANDS</h1>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div className="text-right pb-2 opacity-80">
|
|
228
|
+
<div className="text-xs font-bold tracking-[0.2em] uppercase text-muted mb-1">CURRENT MODULE</div>
|
|
229
|
+
<div className="text-2xl font-bold text-foreground">{title}</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
{/* 菜单列表区域 */}
|
|
234
|
+
<div className="space-y-28 flex-1 pb-48">
|
|
235
|
+
{menuData.map((group, index) => {
|
|
236
|
+
// 轮换颜色
|
|
237
|
+
const themeColor = contentColors[index % contentColors.length]
|
|
238
|
+
|
|
239
|
+
return <MenuGroupComponent key={index} group={group} themeColor={themeColor} />
|
|
240
|
+
})}
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</DefaultLayout>
|
|
244
|
+
)
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
Help.displayName = 'Help'
|
|
248
|
+
|
|
249
|
+
export default Help
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** 本模板的数据类型(路由 index.tsx 与 components/ 实现共用)。 */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 帮助页面组件属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface HelpData {
|
|
7
|
+
/** 页面标题 */
|
|
8
|
+
title?: string
|
|
9
|
+
/** 角色:主人/普通 */
|
|
10
|
+
role?: 'master' | 'member'
|
|
11
|
+
/** 菜单数据:按角色筛选后的分组 */
|
|
12
|
+
menu?: MenuGroup[]
|
|
13
|
+
/** 简单的列表数据 (用于 Help.tsx 渲染) */
|
|
14
|
+
list: {
|
|
15
|
+
title: string
|
|
16
|
+
description: string
|
|
17
|
+
}[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 菜单项接口
|
|
22
|
+
*/
|
|
23
|
+
interface MenuItem {
|
|
24
|
+
/** 菜单项标题 */
|
|
25
|
+
title: string
|
|
26
|
+
/** 菜单项描述 */
|
|
27
|
+
description: string
|
|
28
|
+
/** 图标:可以是图标名称字符串,或带颜色的对象 */
|
|
29
|
+
icon?: string | { name: string; color?: string }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 菜单分组接口
|
|
34
|
+
*/
|
|
35
|
+
interface MenuGroup {
|
|
36
|
+
/** 分组标题 */
|
|
37
|
+
title: string
|
|
38
|
+
/** 菜单项列表 */
|
|
39
|
+
items: MenuItem[]
|
|
40
|
+
/** 子分组(可选) */
|
|
41
|
+
subGroups?: {
|
|
42
|
+
/** 子分组标题 */
|
|
43
|
+
title: string
|
|
44
|
+
/** 子分组菜单项 */
|
|
45
|
+
items: MenuItem[]
|
|
46
|
+
}[]
|
|
47
|
+
}
|