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,392 @@
|
|
|
1
|
+
import { Chip } from '@heroui/react'
|
|
2
|
+
import { Puzzle } from 'lucide-react'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import { cn } from '../../../../utils/cn'
|
|
6
|
+
import { isDark } from '../../../../utils/theme'
|
|
7
|
+
import { DefaultLayout } from '../../../components/DefaultLayout'
|
|
8
|
+
import { GlowImage } from '../../../components/GlowImage'
|
|
9
|
+
import type { PosterProps } from '../../../types/ctx'
|
|
10
|
+
import type { VersionWarningData } from './types'
|
|
11
|
+
|
|
12
|
+
export const VersionWarning: React.FC<PosterProps<VersionWarningData>> = (props) => {
|
|
13
|
+
const dark = isDark(props.ctx)
|
|
14
|
+
|
|
15
|
+
const bgColor = dark ? '#1c1917' : '#faf5ef'
|
|
16
|
+
const primaryColor = dark ? '#fb923c' : '#c2410c'
|
|
17
|
+
const secondaryColor = dark ? '#fdba74' : '#9a3412'
|
|
18
|
+
const mutedColor = dark ? 'rgba(251,146,60,0.7)' : '#b45309'
|
|
19
|
+
const accentColor = dark ? '#fed7aa' : '#7c2d12'
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<DefaultLayout
|
|
23
|
+
{...props}
|
|
24
|
+
ctx={{ ...props.ctx, version: undefined }}
|
|
25
|
+
className="relative overflow-hidden"
|
|
26
|
+
style={{ backgroundColor: bgColor, height: '2450px' }}
|
|
27
|
+
>
|
|
28
|
+
{/* 弥散光背景 */}
|
|
29
|
+
<div className="absolute inset-0 pointer-events-none">
|
|
30
|
+
<div
|
|
31
|
+
className="absolute rounded-full w-315 h-360 -top-67.5 -left-45 blur-[108px] -rotate-20"
|
|
32
|
+
style={{
|
|
33
|
+
background: dark
|
|
34
|
+
? 'radial-gradient(ellipse at 40% 40%, rgba(194,65,12,0.4) 0%, rgba(154,52,18,0.2) 50%, transparent 100%)'
|
|
35
|
+
: 'radial-gradient(ellipse at 40% 40%, rgba(234,88,12,0.5) 0%, rgba(251,146,60,0.25) 50%, transparent 100%)'
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
<div
|
|
39
|
+
className="absolute rounded-full w-225 h-270 top-112.5 -right-22.5 blur-[90px] rotate-15"
|
|
40
|
+
style={{
|
|
41
|
+
background: dark
|
|
42
|
+
? 'radial-gradient(ellipse at 50% 50%, rgba(68,44,21,0.35) 0%, rgba(41,26,13,0.18) 50%, transparent 100%)'
|
|
43
|
+
: 'radial-gradient(ellipse at 50% 50%, rgba(251,191,36,0.3) 0%, rgba(245,158,11,0.15) 50%, transparent 100%)'
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
<div
|
|
47
|
+
className="absolute rounded-full w-270 h-225 -bottom-45 left-45 blur-[126px] -rotate-10"
|
|
48
|
+
style={{
|
|
49
|
+
background: dark
|
|
50
|
+
? 'radial-gradient(ellipse at 50% 60%, rgba(180,83,9,0.35) 0%, rgba(146,64,14,0.18) 50%, transparent 100%)'
|
|
51
|
+
: 'radial-gradient(ellipse at 50% 60%, rgba(194,65,12,0.4) 0%, rgba(180,83,9,0.2) 50%, transparent 100%)'
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
{/* 单色噪点层 */}
|
|
57
|
+
<div className="absolute inset-0 pointer-events-none" style={{ opacity: dark ? 0.1 : 0.15 }}>
|
|
58
|
+
<svg className="w-full h-full" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
+
<filter id="pixelNoise" x="0%" y="0%" width="100%" height="100%">
|
|
60
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="1" stitchTiles="stitch" result="noise" />
|
|
61
|
+
{/* 噪点 */}
|
|
62
|
+
<feColorMatrix type="saturate" values="0" result="gray" />
|
|
63
|
+
{/* 二值化 */}
|
|
64
|
+
<feComponentTransfer>
|
|
65
|
+
<feFuncR type="discrete" tableValues="0 1" />
|
|
66
|
+
<feFuncG type="discrete" tableValues="0 1" />
|
|
67
|
+
<feFuncB type="discrete" tableValues="0 1" />
|
|
68
|
+
</feComponentTransfer>
|
|
69
|
+
</filter>
|
|
70
|
+
<rect width="100%" height="100%" filter="url(#pixelNoise)" />
|
|
71
|
+
</svg>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{/* 背景大字 */}
|
|
75
|
+
<div className="absolute bottom-25 right-18 pointer-events-none select-none opacity-[0.03]">
|
|
76
|
+
<span
|
|
77
|
+
className="text-[200px] font-black tracking-tighter leading-none block text-right"
|
|
78
|
+
style={{ color: dark ? '#fff' : '#78350f' }}
|
|
79
|
+
>
|
|
80
|
+
VERSION
|
|
81
|
+
</span>
|
|
82
|
+
<span
|
|
83
|
+
className="text-[200px] font-black tracking-tighter leading-none block text-right"
|
|
84
|
+
style={{ color: dark ? '#fff' : '#78350f' }}
|
|
85
|
+
>
|
|
86
|
+
WARNING
|
|
87
|
+
</span>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
{/* 内容层 */}
|
|
91
|
+
<div className="relative z-10 flex flex-col justify-between h-full p-18">
|
|
92
|
+
{/* 顶部 */}
|
|
93
|
+
<div className="flex justify-between items-start">
|
|
94
|
+
<div className="flex flex-col gap-12">
|
|
95
|
+
<p className="text-[28px] font-medium tracking-[0.3em] uppercase" style={{ color: mutedColor }}>
|
|
96
|
+
koishi-plugin-kkk
|
|
97
|
+
</p>
|
|
98
|
+
<h1 className="text-[180px] font-black leading-none" style={{ color: accentColor }}>
|
|
99
|
+
请升级你的
|
|
100
|
+
</h1>
|
|
101
|
+
<h1 className="text-[120px] font-black leading-none" style={{ color: accentColor }}>
|
|
102
|
+
<span className="font-mono">node-karin</span>
|
|
103
|
+
</h1>
|
|
104
|
+
</div>
|
|
105
|
+
{/* 右上角装饰图形 */}
|
|
106
|
+
<div className="flex flex-col items-end space-y-3 mt-4">
|
|
107
|
+
<div className="flex space-x-3">
|
|
108
|
+
<div className="w-8 h-8 rounded-full" style={{ backgroundColor: accentColor, opacity: 0.2 }} />
|
|
109
|
+
<div className="w-8 h-8 rounded-full" style={{ backgroundColor: accentColor, opacity: 0.4 }} />
|
|
110
|
+
<div className="w-8 h-8 rounded-full" style={{ backgroundColor: accentColor, opacity: 0.6 }} />
|
|
111
|
+
<div className="w-8 h-8 rounded-full" style={{ backgroundColor: accentColor }} />
|
|
112
|
+
</div>
|
|
113
|
+
<div className="flex space-x-3">
|
|
114
|
+
<div className="w-8 h-8 rounded" style={{ backgroundColor: secondaryColor, opacity: 0.15 }} />
|
|
115
|
+
<div className="w-8 h-8 rounded" style={{ backgroundColor: secondaryColor, opacity: 0.3 }} />
|
|
116
|
+
<div className="w-8 h-8 rounded" style={{ backgroundColor: secondaryColor, opacity: 0.5 }} />
|
|
117
|
+
</div>
|
|
118
|
+
<div className="flex space-x-3">
|
|
119
|
+
<div className="w-8 h-8 rotate-45" style={{ backgroundColor: mutedColor, opacity: 0.1 }} />
|
|
120
|
+
<div className="w-8 h-8 rotate-45" style={{ backgroundColor: mutedColor, opacity: 0.25 }} />
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{/* 中间 */}
|
|
126
|
+
<div className="flex-1 flex flex-col justify-center">
|
|
127
|
+
{/* 版本对比卡片 */}
|
|
128
|
+
<div className="rounded-7xl p-12" style={{ backgroundColor: dark ? 'rgba(0,0,0,0.2)' : 'rgba(255,255,255,0.5)' }}>
|
|
129
|
+
{/* 版本对比 */}
|
|
130
|
+
<div className="flex items-stretch mb-10">
|
|
131
|
+
{/* 当前版本 */}
|
|
132
|
+
<div className="flex-1">
|
|
133
|
+
<div className="flex items-center space-x-3 mb-4">
|
|
134
|
+
<div className="w-4 h-4 rounded-full" style={{ backgroundColor: primaryColor }} />
|
|
135
|
+
<span className="text-[28px] font-medium" style={{ color: mutedColor }}>
|
|
136
|
+
当前运行时版本
|
|
137
|
+
</span>
|
|
138
|
+
</div>
|
|
139
|
+
<div className="relative inline-block">
|
|
140
|
+
<span className="text-[56px] font-black font-mono leading-tight opacity-50 break-all" style={{ color: primaryColor }}>
|
|
141
|
+
v{props.data.currentVersion}
|
|
142
|
+
</span>
|
|
143
|
+
<div
|
|
144
|
+
className="absolute top-1/2 -left-2 -right-2 h-1.5 -rotate-3 rounded-full"
|
|
145
|
+
style={{ backgroundColor: primaryColor }}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
{/* 分隔线 */}
|
|
151
|
+
<div
|
|
152
|
+
className="w-0.5 rounded-full mx-10"
|
|
153
|
+
style={{ backgroundColor: dark ? 'rgba(251,146,60,0.2)' : 'rgba(180,83,9,0.15)' }}
|
|
154
|
+
/>
|
|
155
|
+
|
|
156
|
+
{/* 需要版本 */}
|
|
157
|
+
<div className="flex-1">
|
|
158
|
+
<div className="flex items-center space-x-3 mb-4">
|
|
159
|
+
<div className="w-4 h-4 rounded-full" style={{ backgroundColor: accentColor }} />
|
|
160
|
+
<span className="text-[28px] font-medium" style={{ color: mutedColor }}>
|
|
161
|
+
需要/建议的版本
|
|
162
|
+
</span>
|
|
163
|
+
<Chip
|
|
164
|
+
className="text-xl font-bold rounded-full px-4 py-2"
|
|
165
|
+
style={{ backgroundColor: accentColor, color: bgColor }}
|
|
166
|
+
size="md"
|
|
167
|
+
>
|
|
168
|
+
推荐
|
|
169
|
+
</Chip>
|
|
170
|
+
</div>
|
|
171
|
+
<span className="text-[56px] font-black font-mono leading-tight break-all" style={{ color: accentColor }}>
|
|
172
|
+
v{props.data.requireVersion}
|
|
173
|
+
</span>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
{/* 分隔线 */}
|
|
178
|
+
<div className="h-0.5 rounded-full mb-10" style={{ backgroundColor: dark ? 'rgba(251,146,60,0.2)' : 'rgba(180,83,9,0.15)' }} />
|
|
179
|
+
|
|
180
|
+
{/* 更新方案 */}
|
|
181
|
+
<div className="space-y-20">
|
|
182
|
+
{/* 方案一:Web UI */}
|
|
183
|
+
<div>
|
|
184
|
+
<div className="flex items-center space-x-4 mb-6">
|
|
185
|
+
<div
|
|
186
|
+
className="flex items-center justify-center w-10 h-10 rounded-xl"
|
|
187
|
+
style={{ backgroundColor: dark ? 'rgba(251,146,60,0.15)' : 'rgba(194,65,12,0.1)' }}
|
|
188
|
+
>
|
|
189
|
+
<span className="text-[28px] font-black" style={{ color: accentColor }}>
|
|
190
|
+
1
|
|
191
|
+
</span>
|
|
192
|
+
</div>
|
|
193
|
+
<svg className="w-8 h-8" viewBox="0 0 24 24" fill="none" stroke={mutedColor} strokeWidth="2">
|
|
194
|
+
<rect x="3" y="3" width="18" height="18" rx="2" strokeLinecap="round" strokeLinejoin="round" />
|
|
195
|
+
<path d="M9 3v18M3 9h18M3 15h18" strokeLinecap="round" strokeLinejoin="round" />
|
|
196
|
+
</svg>
|
|
197
|
+
<span className="text-[32px] font-bold" style={{ color: mutedColor }}>
|
|
198
|
+
Web 控制台更新
|
|
199
|
+
</span>
|
|
200
|
+
<Chip
|
|
201
|
+
className="text-2xl font-semibold px-5 py-3 rounded-full"
|
|
202
|
+
style={{
|
|
203
|
+
backgroundColor: dark ? 'rgba(251,146,60,0.2)' : 'rgba(194,65,12,0.15)',
|
|
204
|
+
color: accentColor
|
|
205
|
+
}}
|
|
206
|
+
size="lg"
|
|
207
|
+
>
|
|
208
|
+
推荐
|
|
209
|
+
</Chip>
|
|
210
|
+
</div>
|
|
211
|
+
<div className="ml-14 space-y-4">
|
|
212
|
+
<div className="flex items-start space-x-4">
|
|
213
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
214
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
215
|
+
访问 Karin Web 控制台首页,查看 Koishi 版本信息
|
|
216
|
+
</span>
|
|
217
|
+
</div>
|
|
218
|
+
<div className="flex items-start space-x-4">
|
|
219
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
220
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
221
|
+
当有新版本时会高亮提示,点击查看更新日志
|
|
222
|
+
</span>
|
|
223
|
+
</div>
|
|
224
|
+
<div className="flex items-start space-x-4">
|
|
225
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
226
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
227
|
+
点击<span className="font-mono font-black">「更新」</span>按钮,系统将自动完成更新并重启
|
|
228
|
+
</span>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
{/* 方案二:安装 karin-plugin-basic */}
|
|
234
|
+
<div>
|
|
235
|
+
<div className="flex items-center space-x-4 mb-6">
|
|
236
|
+
<div
|
|
237
|
+
className="flex items-center justify-center w-10 h-10 rounded-xl"
|
|
238
|
+
style={{ backgroundColor: dark ? 'rgba(251,146,60,0.15)' : 'rgba(194,65,12,0.1)' }}
|
|
239
|
+
>
|
|
240
|
+
<span className="text-[28px] font-black" style={{ color: accentColor }}>
|
|
241
|
+
2
|
|
242
|
+
</span>
|
|
243
|
+
</div>
|
|
244
|
+
<Puzzle className={cn('w-10 h-auto')} style={{ color: mutedColor }} />
|
|
245
|
+
<span className="text-[32px] font-bold" style={{ color: mutedColor }}>
|
|
246
|
+
使用 basic 插件命令更新
|
|
247
|
+
</span>
|
|
248
|
+
<Chip
|
|
249
|
+
className="text-2xl font-semibold px-5 py-3 rounded-full"
|
|
250
|
+
style={{
|
|
251
|
+
backgroundColor: dark ? 'rgba(251,146,60,0.2)' : 'rgba(194,65,12,0.15)',
|
|
252
|
+
color: accentColor
|
|
253
|
+
}}
|
|
254
|
+
size="lg"
|
|
255
|
+
>
|
|
256
|
+
推荐
|
|
257
|
+
</Chip>
|
|
258
|
+
</div>
|
|
259
|
+
<div className="ml-14 space-y-4">
|
|
260
|
+
<div className="flex items-start space-x-4">
|
|
261
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
262
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
263
|
+
插件市场搜索<span className="font-mono font-black">「karin-plugin-basic」</span>插件并安装
|
|
264
|
+
</span>
|
|
265
|
+
</div>
|
|
266
|
+
<div className="flex items-start space-x-4">
|
|
267
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
268
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
269
|
+
安装完成后发送 <span className="font-mono font-black">「#更新」</span>
|
|
270
|
+
</span>
|
|
271
|
+
</div>
|
|
272
|
+
<div className="flex items-start space-x-4">
|
|
273
|
+
<div className="w-3 h-3 rounded-full mt-3 shrink-0" style={{ backgroundColor: mutedColor }} />
|
|
274
|
+
<span className="text-[28px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
275
|
+
插件会自动执行更新流程
|
|
276
|
+
</span>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
{/* 方案三:命令行手动更新 */}
|
|
282
|
+
<div>
|
|
283
|
+
<div className="flex items-center space-x-4 mb-6">
|
|
284
|
+
<div
|
|
285
|
+
className="flex items-center justify-center w-10 h-10 rounded-xl"
|
|
286
|
+
style={{ backgroundColor: dark ? 'rgba(251,146,60,0.15)' : 'rgba(194,65,12,0.1)' }}
|
|
287
|
+
>
|
|
288
|
+
<span className="text-[28px] font-black" style={{ color: accentColor }}>
|
|
289
|
+
3
|
|
290
|
+
</span>
|
|
291
|
+
</div>
|
|
292
|
+
<svg className="w-8 h-8" viewBox="0 0 24 24" fill="none" stroke={mutedColor} strokeWidth="2">
|
|
293
|
+
<path d="M4 17l6-6-6-6M12 19h8" strokeLinecap="round" strokeLinejoin="round" />
|
|
294
|
+
</svg>
|
|
295
|
+
<span className="text-[32px] font-bold" style={{ color: mutedColor }}>
|
|
296
|
+
命令行手动更新
|
|
297
|
+
</span>
|
|
298
|
+
</div>
|
|
299
|
+
<div className="ml-14 space-y-4">
|
|
300
|
+
<p className="text-[28px]" style={{ color: secondaryColor }}>
|
|
301
|
+
在 Karin 根目录下执行以下命令
|
|
302
|
+
</p>
|
|
303
|
+
<div className="rounded-xl p-6" style={{ backgroundColor: dark ? 'rgba(0,0,0,0.4)' : 'rgba(255,255,255,0.7)' }}>
|
|
304
|
+
<code className="text-[40px] font-mono font-bold block" style={{ color: accentColor }}>
|
|
305
|
+
pnpm add node-karin@{props.data.requireVersion} -w
|
|
306
|
+
</code>
|
|
307
|
+
</div>
|
|
308
|
+
<p className="text-[28px] opacity-80" style={{ color: secondaryColor }}>
|
|
309
|
+
更新完成后手动重启 Karin 即可
|
|
310
|
+
</p>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
{/* 分隔线 */}
|
|
316
|
+
<div className="h-0.5 rounded-full my-10" style={{ backgroundColor: dark ? 'rgba(251,146,60,0.2)' : 'rgba(180,83,9,0.15)' }} />
|
|
317
|
+
|
|
318
|
+
{/* 重要提示 */}
|
|
319
|
+
<div
|
|
320
|
+
className="rounded-4xl p-6 flex items-start space-x-5"
|
|
321
|
+
style={{ backgroundColor: dark ? 'rgba(251,146,60,0.08)' : 'rgba(194,65,12,0.08)' }}
|
|
322
|
+
>
|
|
323
|
+
<svg className="w-10 h-10 mt-1 shrink-0" viewBox="0 0 24 24" fill={accentColor}>
|
|
324
|
+
<path d="M12 2L22 20H2L12 2Z" />
|
|
325
|
+
<path d="M12 9v4M12 17h.01" stroke={bgColor} strokeWidth="2" strokeLinecap="round" />
|
|
326
|
+
</svg>
|
|
327
|
+
<div className="flex-1">
|
|
328
|
+
<p className="text-[28px] font-semibold mb-2" style={{ color: accentColor }}>
|
|
329
|
+
版本兼容性提示
|
|
330
|
+
</p>
|
|
331
|
+
<p className="text-[26px] leading-relaxed" style={{ color: secondaryColor }}>
|
|
332
|
+
当前插件版本基于{' '}
|
|
333
|
+
<span className="font-bold font-mono" style={{ color: accentColor }}>
|
|
334
|
+
node-karin v{props.data.requireVersion}
|
|
335
|
+
</span>{' '}
|
|
336
|
+
开发,低版本运行时可能出现功能异常或兼容性问题,请及时更新以获得最佳体验
|
|
337
|
+
</p>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
{/* 底部 */}
|
|
344
|
+
<div className="flex justify-between items-end">
|
|
345
|
+
{/* 左下角 */}
|
|
346
|
+
<div className="flex flex-col space-y-3">
|
|
347
|
+
<svg className="w-9 h-9 opacity-25" viewBox="0 0 24 24" fill="none" stroke={mutedColor} strokeWidth="1.5">
|
|
348
|
+
<path d="M12 2L22 20H2L12 2Z" />
|
|
349
|
+
</svg>
|
|
350
|
+
<svg className="w-9 h-9 opacity-40" viewBox="0 0 24 24" fill="none" stroke={mutedColor} strokeWidth="1.5">
|
|
351
|
+
<path d="M12 2L22 20H2L12 2Z" />
|
|
352
|
+
</svg>
|
|
353
|
+
<svg className="w-9 h-9 opacity-60" viewBox="0 0 24 24" fill="none" stroke={mutedColor} strokeWidth="1.5">
|
|
354
|
+
<path d="M12 2L22 20H2L12 2Z" />
|
|
355
|
+
</svg>
|
|
356
|
+
<svg className="w-9 h-9" viewBox="0 0 24 24" fill={accentColor}>
|
|
357
|
+
<path d="M12 2L22 20H2L12 2Z" />
|
|
358
|
+
</svg>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
{/* 右下角 */}
|
|
362
|
+
<div className="flex items-end space-x-7">
|
|
363
|
+
<div className="flex flex-col items-end justify-end h-25">
|
|
364
|
+
<span className="text-[22px] font-bold tracking-widest uppercase" style={{ color: mutedColor }}>
|
|
365
|
+
KOISHI-PLUGIN
|
|
366
|
+
</span>
|
|
367
|
+
<span className="text-[54px] font-black leading-none" style={{ color: accentColor }}>
|
|
368
|
+
kkk
|
|
369
|
+
</span>
|
|
370
|
+
</div>
|
|
371
|
+
<GlowImage glowStrength={1} blurRadius={20}>
|
|
372
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 221" className="h-22 w-auto" style={{ color: accentColor }}>
|
|
373
|
+
<path
|
|
374
|
+
d="M132.75,87.37l-53.72-53.37c-4.66-4.63-1.38-12.58,5.18-12.58h115.13c6.57,0,9.84,7.95,5.18,12.58l-53.72,53.37c-4.99,4.96-13.06,4.96-18.05,0Z"
|
|
375
|
+
fill="currentColor"
|
|
376
|
+
/>
|
|
377
|
+
<path
|
|
378
|
+
d="M28.49,186.89l.03-51.42c-.02-6.57,7.92-9.87,12.56-5.23l57.02,57.02c4.64,4.64,1.34,12.41-5.23,12.39h-51.42c-7.04-.02-12.94-5.72-12.96-12.76Z"
|
|
379
|
+
fill="currentColor"
|
|
380
|
+
/>
|
|
381
|
+
<path
|
|
382
|
+
d="M41.54,23.68l163.04,163.05c4.78,4.78,1.39,12.95-5.36,12.94h-47.88c-9.69,0-18.99-3.86-25.84-10.71L39.3,102.75c-6.85-6.85-10.7-16.15-10.7-25.84V29.04c0-6.76,8.16-10.14,12.94-5.36Z"
|
|
383
|
+
fill="currentColor"
|
|
384
|
+
/>
|
|
385
|
+
</svg>
|
|
386
|
+
</GlowImage>
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
389
|
+
</div>
|
|
390
|
+
</DefaultLayout>
|
|
391
|
+
)
|
|
392
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { withAlpha } from './chartTheme'
|
|
4
|
+
|
|
5
|
+
/** 箱线图阅读指南属性 */
|
|
6
|
+
export interface BoxplotGuideProps {
|
|
7
|
+
/** 箱体主色(描边、须、端帽) */
|
|
8
|
+
accent: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 箱线图怎么读 —— 一张示意图 + 一句注解。
|
|
13
|
+
*
|
|
14
|
+
* 加它的原因很直接:箱线图对没接触过的读者就是「一个带横线的方块」,
|
|
15
|
+
* 而 ECharts 的 boxplot 又不支持在图上打标签(series 级和逐项两种写法 SSR 下都不出文本,
|
|
16
|
+
* 实测过),没法把五个要素直接标在真实图形上。
|
|
17
|
+
* 所以退而求其次:在卡片里画一个放大的示意图把五个位置点名,
|
|
18
|
+
* 真实图上的中位数再用一个散点系列单独标数值。
|
|
19
|
+
*/
|
|
20
|
+
export const BoxplotGuide: React.FC<BoxplotGuideProps> = ({ accent }) => (
|
|
21
|
+
<div className="mt-3 rounded-xl bg-surface-secondary/60 px-6 py-4">
|
|
22
|
+
<svg viewBox="0 0 560 96" className="w-full h-24" role="img" aria-label="箱线图读法示意">
|
|
23
|
+
{/* 下须(最小 → 下四分位) */}
|
|
24
|
+
<line x1="30" y1="48" x2="120" y2="48" stroke={accent} strokeWidth="3" />
|
|
25
|
+
<line x1="30" y1="34" x2="30" y2="62" stroke={accent} strokeWidth="3" />
|
|
26
|
+
{/* 箱体(下四分位 → 上四分位) */}
|
|
27
|
+
<rect x="120" y="20" width="280" height="56" rx="8" fill={withAlpha(accent, 0.3)} stroke={accent} strokeWidth="3" />
|
|
28
|
+
{/* 中位线 */}
|
|
29
|
+
<line x1="320" y1="20" x2="320" y2="76" stroke={accent} strokeWidth="4" />
|
|
30
|
+
{/* 上须(上四分位 → 最大) */}
|
|
31
|
+
<line x1="400" y1="48" x2="510" y2="48" stroke={accent} strokeWidth="3" />
|
|
32
|
+
<line x1="510" y1="34" x2="510" y2="62" stroke={accent} strokeWidth="3" />
|
|
33
|
+
|
|
34
|
+
{/* 五个位置的标注 */}
|
|
35
|
+
<text x="42" y="92" textAnchor="middle" fontSize="18" fill="currentColor" opacity="0.7">
|
|
36
|
+
最小
|
|
37
|
+
</text>
|
|
38
|
+
<text x="150" y="92" textAnchor="middle" fontSize="18" fill="currentColor" opacity="0.7">
|
|
39
|
+
下四分位
|
|
40
|
+
</text>
|
|
41
|
+
<text x="320" y="92" textAnchor="middle" fontSize="18" fill="currentColor" opacity="0.7">
|
|
42
|
+
中位数
|
|
43
|
+
</text>
|
|
44
|
+
<text x="410" y="92" textAnchor="middle" fontSize="18" fill="currentColor" opacity="0.7">
|
|
45
|
+
上四分位
|
|
46
|
+
</text>
|
|
47
|
+
<text x="518" y="92" textAnchor="middle" fontSize="18" fill="currentColor" opacity="0.7">
|
|
48
|
+
最大
|
|
49
|
+
</text>
|
|
50
|
+
</svg>
|
|
51
|
+
<div className="mt-2 text-center text-xl text-muted/80">
|
|
52
|
+
每个箱体代表<b className="text-foreground/80">该档位里所有群</b>的分布 · 箱体越扁说明这档群的水平越整齐
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
export default BoxplotGuide
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../../utils/cn'
|
|
4
|
+
|
|
5
|
+
/** 图表卡片属性 */
|
|
6
|
+
export interface ChartCardProps {
|
|
7
|
+
/** 中文标题 */
|
|
8
|
+
title: string
|
|
9
|
+
/** 英文副标题,跟在中文标题后面同一行 */
|
|
10
|
+
subtitle: string
|
|
11
|
+
/** 左侧圆角色条的 Tailwind 背景类 */
|
|
12
|
+
accentClassName?: string
|
|
13
|
+
/** 卡片底部的一行说明,没有则不占位 */
|
|
14
|
+
caption?: React.ReactNode
|
|
15
|
+
/** 追加到卡片根元素的类名 */
|
|
16
|
+
className?: string
|
|
17
|
+
/** 卡片内容(通常是 SSRChart) */
|
|
18
|
+
children: React.ReactNode
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 图表卡片:紧凑标题行 + 内容 + 可选说明。
|
|
23
|
+
*
|
|
24
|
+
* 取代了旧版那个「色条 + 5rem 大标题 + 英文副标题 + 160px 下边距」的分区头 ——
|
|
25
|
+
* 那张头每张图要吃掉约 360px,五张图光标题栏就占掉 1800px,
|
|
26
|
+
* 是海报被撑到 6900px 的主因。这里把标题压进卡片内部,一张图总共只需约 80px。
|
|
27
|
+
*/
|
|
28
|
+
export const ChartCard: React.FC<ChartCardProps> = ({ title, subtitle, accentClassName = 'bg-violet-500', caption, className, children }) => (
|
|
29
|
+
<div className={cn('relative flex flex-col rounded-2xl bg-surface/40 backdrop-blur-md border-2 border-border/40 p-6', className)}>
|
|
30
|
+
<div className="flex items-center gap-4 mb-4">
|
|
31
|
+
<div className={cn('w-3 h-10 rounded-full shrink-0', accentClassName)} />
|
|
32
|
+
<h3 className="text-4xl font-black tracking-tight leading-none text-foreground/90">{title}</h3>
|
|
33
|
+
<span className="text-xl font-medium tracking-[0.15em] uppercase text-muted/60 leading-none">{subtitle}</span>
|
|
34
|
+
</div>
|
|
35
|
+
{children}
|
|
36
|
+
{caption ? <div className="mt-3 text-center text-xl text-muted/80">{caption}</div> : null}
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
export default ChartCard
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../../utils/cn'
|
|
4
|
+
|
|
5
|
+
/** 指标卡属性 */
|
|
6
|
+
export interface KpiCardProps {
|
|
7
|
+
/** 中文标题 */
|
|
8
|
+
title: string
|
|
9
|
+
/** 英文副标题 */
|
|
10
|
+
titleEn: string
|
|
11
|
+
/** 主数值,已格式化好的字符串 */
|
|
12
|
+
value: string
|
|
13
|
+
/** 单位 */
|
|
14
|
+
unit?: string
|
|
15
|
+
/** 补充说明(如「按有记录的 23 天折算」),没有则不占位 */
|
|
16
|
+
hint?: string
|
|
17
|
+
/** 追加到卡片的类名 */
|
|
18
|
+
className?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 指标卡:紧凑竖排。
|
|
23
|
+
*
|
|
24
|
+
* 旧版是「标题条 + 7rem 大数字」的厚卡,6 张要占两行共约 700px。
|
|
25
|
+
* 这里压成一行放 6 张,数值字号降到 5xl,读数依然清楚,但整块只占约 190px。
|
|
26
|
+
*/
|
|
27
|
+
export const KpiCard: React.FC<KpiCardProps> = ({ title, titleEn, value, unit, hint, className }) => (
|
|
28
|
+
<div className={cn('relative flex flex-col rounded-2xl bg-surface/40 backdrop-blur-md border-2 border-border/40 px-5 py-4', className)}>
|
|
29
|
+
<div className="text-2xl font-black leading-tight text-foreground/90">{title}</div>
|
|
30
|
+
<div className="text-base font-medium tracking-widest uppercase text-muted/60 leading-tight mt-1">{titleEn}</div>
|
|
31
|
+
<div className="flex items-baseline gap-1 mt-3">
|
|
32
|
+
<span className="text-5xl font-black leading-none text-foreground/90">{value}</span>
|
|
33
|
+
{unit ? <span className="text-2xl font-medium text-foreground/70">{unit}</span> : null}
|
|
34
|
+
</div>
|
|
35
|
+
{hint ? <div className="mt-2 text-lg leading-tight text-muted/70">{hint}</div> : null}
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export default KpiCard
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../../utils/cn'
|
|
4
|
+
|
|
5
|
+
/** 平台明细表的一行 */
|
|
6
|
+
export interface PlatformTableRow {
|
|
7
|
+
/** 平台标识,用作 React key */
|
|
8
|
+
key: string
|
|
9
|
+
/** 平台 logo */
|
|
10
|
+
logo: string
|
|
11
|
+
/** 平台名 */
|
|
12
|
+
name: string
|
|
13
|
+
/** 条形填充色 */
|
|
14
|
+
color: string
|
|
15
|
+
/** 条长百分比(相对最大值,0~100) */
|
|
16
|
+
barPercent: number
|
|
17
|
+
/** 数值列,顺序与 `columns` 对应,已格式化为展示文案 */
|
|
18
|
+
cells: string[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 平台明细表属性 */
|
|
22
|
+
export interface PlatformTableProps {
|
|
23
|
+
/** 数值列的表头文案 */
|
|
24
|
+
columns: string[]
|
|
25
|
+
/** 数据行 */
|
|
26
|
+
rows: PlatformTableRow[]
|
|
27
|
+
/** 追加到根元素的类名 */
|
|
28
|
+
className?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 数值列宽:够放下 `1,362` 和 `47.6%` */
|
|
32
|
+
const CELL_WIDTH = 'w-28'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 平台明细表。
|
|
36
|
+
*
|
|
37
|
+
* 环图旁边原来只是一列「logo + 名字 + 次数」,本质是图例;
|
|
38
|
+
* 这里升级成带表头的表格,能多塞两列数值(人数、人均之类),
|
|
39
|
+
* 同样的高度装的信息量翻倍 —— 这也是海报里唯一适合「读精确数字」的地方。
|
|
40
|
+
* 中间的占比条保留,让读者不读数字也能看出量级差距。
|
|
41
|
+
*/
|
|
42
|
+
export const PlatformTable: React.FC<PlatformTableProps> = ({ columns, rows, className }) => (
|
|
43
|
+
<div className={cn('flex flex-col gap-3', className)}>
|
|
44
|
+
{/* 表头 */}
|
|
45
|
+
<div className="flex items-center gap-4 pb-2 border-b-2 border-border/40">
|
|
46
|
+
<span className="w-12 shrink-0" />
|
|
47
|
+
<span className="w-36 shrink-0 text-xl tracking-widest uppercase text-muted/60">平台</span>
|
|
48
|
+
{/* 条形列不写表头:占比已经在后面的数值列里给了,重复标一次反而让人以为有两套口径 */}
|
|
49
|
+
<span className="flex-1" />
|
|
50
|
+
{columns.map((column) => (
|
|
51
|
+
<span key={column} className={cn(CELL_WIDTH, 'shrink-0 text-right text-xl tracking-widest uppercase text-muted/60')}>
|
|
52
|
+
{column}
|
|
53
|
+
</span>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
{/* 数据行 */}
|
|
58
|
+
{rows.map((row) => (
|
|
59
|
+
<div key={row.key} className="flex items-center gap-4">
|
|
60
|
+
<img src={row.logo} alt={row.name} className="w-12 h-12 object-contain shrink-0" />
|
|
61
|
+
<span className="w-36 shrink-0 text-2xl font-bold text-foreground/90">{row.name}</span>
|
|
62
|
+
<div className="flex-1 h-6 rounded-full bg-surface-secondary overflow-hidden">
|
|
63
|
+
<div className="h-full rounded-full" style={{ width: `${row.barPercent}%`, backgroundColor: row.color }} />
|
|
64
|
+
</div>
|
|
65
|
+
{row.cells.map((cell, index) => (
|
|
66
|
+
<span
|
|
67
|
+
key={columns[index]}
|
|
68
|
+
className={cn(
|
|
69
|
+
CELL_WIDTH,
|
|
70
|
+
'shrink-0 text-right text-2xl tabular-nums',
|
|
71
|
+
// 第一列是主数值,加粗;其余列弱一档,读起来有主次
|
|
72
|
+
index === 0 ? 'font-black text-foreground/90' : 'text-foreground/70'
|
|
73
|
+
)}
|
|
74
|
+
>
|
|
75
|
+
{cell}
|
|
76
|
+
</span>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
export default PlatformTable
|