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,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.splitLineStyle = exports.axisLineStyle = exports.axisLabelStyle = exports.withAlpha = exports.CHART_FONT_FAMILY = exports.renderChartToSVG = exports.METRIC_META = exports.WORK_TYPE_META = exports.platformLogo = exports.platformColor = exports.PLATFORM_ORDER = exports.PLATFORM_META = exports.getChartPalette = void 0;
|
|
37
|
+
const charts_1 = require("echarts/charts");
|
|
38
|
+
const components_1 = require("echarts/components");
|
|
39
|
+
const echarts = __importStar(require("echarts/core"));
|
|
40
|
+
const renderers_1 = require("echarts/renderers");
|
|
41
|
+
/**
|
|
42
|
+
* 统计海报的图表基座。
|
|
43
|
+
*
|
|
44
|
+
* 三条硬约束(都是实测出来的):
|
|
45
|
+
* 1. **必须 `dispose()`** —— ECharts 内部有一张全局实例表,不 dispose 每渲染一次就漏一份,
|
|
46
|
+
* 实测 300 次后 heap 从 25MB 涨到 62MB。
|
|
47
|
+
* 2. **不能嵌进外层 `<svg>`** —— `renderToSVGString()` 返回的是完整独立 `<svg>`,
|
|
48
|
+
* 只能整段注入 DOM,不能像 Victory 那样 `standalone={false}` 塞进父 svg。
|
|
49
|
+
* 3. **颜色只能用 hex** —— zrender 的颜色解析器不认 `oklch()` / `color-mix()`
|
|
50
|
+
* (`parse()` 返回 undefined,任何参与颜色运算的路径都会静默变黑)。
|
|
51
|
+
* HeroUI 主题 token 是 oklch,所以这里的色板都是换算好的 hex 常量。
|
|
52
|
+
*/
|
|
53
|
+
// 按需注册:只挂统计海报真正用到的图表与组件,避免把整个 echarts 打进产物。
|
|
54
|
+
// 漏注册的后果分两种:渲染器漏了直接抛错,图表/组件漏了则是静默画不出东西,
|
|
55
|
+
// 所以这张清单必须和两个模板实际用到的 series/component 严格对齐(test/statistics-render.test.ts 会兜底)。
|
|
56
|
+
echarts.use([
|
|
57
|
+
charts_1.PieChart,
|
|
58
|
+
charts_1.LineChart,
|
|
59
|
+
charts_1.BarChart,
|
|
60
|
+
charts_1.HeatmapChart,
|
|
61
|
+
charts_1.BoxplotChart,
|
|
62
|
+
charts_1.ScatterChart,
|
|
63
|
+
charts_1.TreemapChart,
|
|
64
|
+
components_1.GridComponent,
|
|
65
|
+
components_1.PolarComponent,
|
|
66
|
+
components_1.GraphicComponent,
|
|
67
|
+
components_1.VisualMapComponent,
|
|
68
|
+
renderers_1.SVGRenderer
|
|
69
|
+
]);
|
|
70
|
+
const LIGHT_PALETTE = {
|
|
71
|
+
text: '#18181b',
|
|
72
|
+
textMuted: '#71717a',
|
|
73
|
+
axisLine: '#d4d4d8',
|
|
74
|
+
splitLine: '#e4e4e7',
|
|
75
|
+
accent: '#8b5cf6',
|
|
76
|
+
accentAlt: '#a1a1aa',
|
|
77
|
+
textOnColor: '#ffffff'
|
|
78
|
+
};
|
|
79
|
+
const DARK_PALETTE = {
|
|
80
|
+
text: '#fcfcfc',
|
|
81
|
+
textMuted: '#9f9fa9',
|
|
82
|
+
axisLine: '#3f3f46',
|
|
83
|
+
splitLine: '#28282c',
|
|
84
|
+
accent: '#a78bfa',
|
|
85
|
+
accentAlt: '#71717a',
|
|
86
|
+
textOnColor: '#18181b'
|
|
87
|
+
};
|
|
88
|
+
/** 按明暗取图表配色 */
|
|
89
|
+
const getChartPalette = (dark) => (dark ? DARK_PALETTE : LIGHT_PALETTE);
|
|
90
|
+
exports.getChartPalette = getChartPalette;
|
|
91
|
+
/** 平台展示信息表 */
|
|
92
|
+
exports.PLATFORM_META = {
|
|
93
|
+
douyin: {
|
|
94
|
+
name: '抖音',
|
|
95
|
+
nameEn: 'Douyin',
|
|
96
|
+
logo: { light: '/image/douyin/dylogo-dark.svg', dark: '/image/douyin/dylogo-light.svg' },
|
|
97
|
+
color: { light: '#111111', dark: '#ffffff' }
|
|
98
|
+
},
|
|
99
|
+
bilibili: {
|
|
100
|
+
name: '哔哩哔哩',
|
|
101
|
+
nameEn: 'Bilibili',
|
|
102
|
+
logo: { light: '/image/bilibili/bilibili-light.png', dark: '/image/bilibili/bilibili-light.png' },
|
|
103
|
+
color: { light: '#fb7299', dark: '#fb7299' }
|
|
104
|
+
},
|
|
105
|
+
kuaishou: {
|
|
106
|
+
name: '快手',
|
|
107
|
+
nameEn: 'Kuaishou',
|
|
108
|
+
logo: { light: '/image/kuaishou/logo.png', dark: '/image/kuaishou/logo.png' },
|
|
109
|
+
color: { light: '#ff4906', dark: '#ff4906' }
|
|
110
|
+
},
|
|
111
|
+
xiaohongshu: {
|
|
112
|
+
name: '小红书',
|
|
113
|
+
nameEn: 'XiaoHongShu',
|
|
114
|
+
logo: { light: '/image/xiaohongshu/logo.png', dark: '/image/xiaohongshu/logo.png' },
|
|
115
|
+
color: { light: '#ff2442', dark: '#ff2442' }
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/** 平台展示顺序,多张图统一用它,避免各图排序不一致 */
|
|
119
|
+
exports.PLATFORM_ORDER = ['douyin', 'bilibili', 'kuaishou', 'xiaohongshu'];
|
|
120
|
+
/** 取平台品牌色 */
|
|
121
|
+
const platformColor = (platform, dark) => exports.PLATFORM_META[platform].color[dark ? 'dark' : 'light'];
|
|
122
|
+
exports.platformColor = platformColor;
|
|
123
|
+
/** 取平台 logo 路径 */
|
|
124
|
+
const platformLogo = (platform, dark) => exports.PLATFORM_META[platform].logo[dark ? 'dark' : 'light'];
|
|
125
|
+
exports.platformLogo = platformLogo;
|
|
126
|
+
/**
|
|
127
|
+
* 内容形态展示信息。
|
|
128
|
+
*
|
|
129
|
+
* 配色刻意避开四大平台的品牌色区间(粉/橙/红),
|
|
130
|
+
* 免得「平台」和「形态」两张图摆在一起时读者串色。
|
|
131
|
+
*/
|
|
132
|
+
exports.WORK_TYPE_META = {
|
|
133
|
+
video: { label: '视频', color: '#8b5cf6' },
|
|
134
|
+
gallery: { label: '图集', color: '#06b6d4' },
|
|
135
|
+
collection: { label: '合辑', color: '#0ea5e9' },
|
|
136
|
+
article: { label: '文章', color: '#f59e0b' },
|
|
137
|
+
live: { label: '直播', color: '#ef4444' },
|
|
138
|
+
bangumi: { label: '番剧', color: '#22c55e' },
|
|
139
|
+
dynamic: { label: '动态', color: '#14b8a6' },
|
|
140
|
+
music: { label: '音乐', color: '#a855f7' },
|
|
141
|
+
unknown: { label: '其他', color: '#a1a1aa' }
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* 量化指标图的展示信息。
|
|
145
|
+
*
|
|
146
|
+
* 目前只有解析耗时一项:作品时长、作品点赞属于**内容**属性而非解析服务本身的表现,
|
|
147
|
+
* 混进这张海报会跑题;而且它们的单位在各平台不统一(抖音毫秒、B站秒、快手/小红书未知),
|
|
148
|
+
* 口径也站不住,所以整体砍掉。
|
|
149
|
+
*/
|
|
150
|
+
exports.METRIC_META = {
|
|
151
|
+
duration: { title: '解析耗时分布', subtitle: 'PARSE TIME', accent: 'bg-sky-500' }
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* 把 ECharts option 渲染成一段独立 SVG 字符串。
|
|
155
|
+
*
|
|
156
|
+
* 纯同步函数,可以在 React 的 render 体里直接调 —— 这是本方案能绕开 hooks 的关键。
|
|
157
|
+
* @param option ECharts 配置,颜色需由调用方按主题算好(见 `getChartPalette`)
|
|
158
|
+
* @param width 画布宽(px)
|
|
159
|
+
* @param height 画布高(px)
|
|
160
|
+
* @returns 完整的 `<svg>...</svg>` 字符串
|
|
161
|
+
*/
|
|
162
|
+
const renderChartToSVG = (option, width, height) => {
|
|
163
|
+
const chart = echarts.init(null, null, { renderer: 'svg', ssr: true, width, height });
|
|
164
|
+
try {
|
|
165
|
+
chart.setOption({
|
|
166
|
+
// SSR 下本来就不跑动画,显式关掉是防止将来有人在浏览器侧复用时动起来
|
|
167
|
+
animation: false,
|
|
168
|
+
// 海报底色由外层卡片提供,图表本身保持透明
|
|
169
|
+
backgroundColor: 'transparent',
|
|
170
|
+
...option
|
|
171
|
+
});
|
|
172
|
+
return chart.renderToSVGString();
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
// 不 dispose 会持续泄漏,见文件头注释
|
|
176
|
+
chart.dispose();
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
exports.renderChartToSVG = renderChartToSVG;
|
|
180
|
+
/** 图表内文字统一走海报字体,否则 SVG 会退回浏览器默认字体 */
|
|
181
|
+
exports.CHART_FONT_FAMILY = 'HarmonyOSHans-Regular';
|
|
182
|
+
/**
|
|
183
|
+
* hex 转 `rgba()`。
|
|
184
|
+
*
|
|
185
|
+
* 刻意不产出 8 位 hex(`#RRGGBBAA`):zrender 的颜色解析器只认 `#RGB` / `#RRGGBB`,
|
|
186
|
+
* 8 位会被判为非法值,凡是需要拿它做运算的地方都会静默出问题。
|
|
187
|
+
* @param hex 形如 `#8b5cf6` 或 `#abc`
|
|
188
|
+
* @param alpha 0~1
|
|
189
|
+
*/
|
|
190
|
+
const withAlpha = (hex, alpha) => {
|
|
191
|
+
const raw = hex.replace('#', '');
|
|
192
|
+
const full = raw.length === 3
|
|
193
|
+
? raw
|
|
194
|
+
.split('')
|
|
195
|
+
.map((c) => c + c)
|
|
196
|
+
.join('')
|
|
197
|
+
: raw;
|
|
198
|
+
const r = parseInt(full.slice(0, 2), 16);
|
|
199
|
+
const g = parseInt(full.slice(2, 4), 16);
|
|
200
|
+
const b = parseInt(full.slice(4, 6), 16);
|
|
201
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
202
|
+
};
|
|
203
|
+
exports.withAlpha = withAlpha;
|
|
204
|
+
/**
|
|
205
|
+
* 坐标轴文字样式
|
|
206
|
+
* @param palette 配色
|
|
207
|
+
* @param fontSize 字号;海报宽 1440,轴标签不要小于 20
|
|
208
|
+
* @param rotate 类目轴标签倾斜角度
|
|
209
|
+
*/
|
|
210
|
+
const axisLabelStyle = (palette, fontSize = 24, rotate = 0) => ({
|
|
211
|
+
fontSize,
|
|
212
|
+
rotate,
|
|
213
|
+
color: palette.textMuted,
|
|
214
|
+
fontFamily: exports.CHART_FONT_FAMILY
|
|
215
|
+
});
|
|
216
|
+
exports.axisLabelStyle = axisLabelStyle;
|
|
217
|
+
/** 坐标轴主线样式 */
|
|
218
|
+
const axisLineStyle = (palette) => ({
|
|
219
|
+
lineStyle: { width: 2, color: palette.axisLine }
|
|
220
|
+
});
|
|
221
|
+
exports.axisLineStyle = axisLineStyle;
|
|
222
|
+
/** 网格分隔线样式 */
|
|
223
|
+
const splitLineStyle = (palette) => ({
|
|
224
|
+
lineStyle: { width: 1, color: palette.splitLine }
|
|
225
|
+
});
|
|
226
|
+
exports.splitLineStyle = splitLineStyle;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 统计海报共用的数字格式化。
|
|
4
|
+
* 逻辑取自旧版两张海报里各自复制过一份的实现,这里合并成一处,口径保持不变。
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.formatDateShort = exports.formatPercent = exports.formatWithCommas = exports.formatCompact = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* 大数字紧凑格式(1.2k / 3.4w / 1.1亿)。
|
|
10
|
+
* 向下截断而不是四舍五入 —— 统计数字宁可少报也不要看起来比实际多。
|
|
11
|
+
*/
|
|
12
|
+
const formatCompact = (num) => {
|
|
13
|
+
const truncate = (divisor, suffix) => {
|
|
14
|
+
const result = Math.floor(num / (divisor / 10)) / 10;
|
|
15
|
+
return (result % 1 === 0 ? result.toFixed(0) : result.toFixed(1)) + suffix;
|
|
16
|
+
};
|
|
17
|
+
if (num >= 100000000)
|
|
18
|
+
return truncate(100000000, '亿');
|
|
19
|
+
if (num >= 10000)
|
|
20
|
+
return truncate(10000, 'w');
|
|
21
|
+
if (num >= 1000)
|
|
22
|
+
return truncate(1000, 'k');
|
|
23
|
+
return num.toString();
|
|
24
|
+
};
|
|
25
|
+
exports.formatCompact = formatCompact;
|
|
26
|
+
/** 千位分隔符 */
|
|
27
|
+
const formatWithCommas = (num) => num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
28
|
+
exports.formatWithCommas = formatWithCommas;
|
|
29
|
+
/**
|
|
30
|
+
* 占比百分比,保留一位小数。
|
|
31
|
+
* @param value 分子
|
|
32
|
+
* @param total 分母;为 0 时返回 '0.0'
|
|
33
|
+
*/
|
|
34
|
+
const formatPercent = (value, total) => (total > 0 ? ((value / total) * 100).toFixed(1) : '0.0');
|
|
35
|
+
exports.formatPercent = formatPercent;
|
|
36
|
+
/** 日期 `YYYY-MM-DD` → `MM-DD`,折线图类目轴用 */
|
|
37
|
+
const formatDateShort = (date) => date.substring(5);
|
|
38
|
+
exports.formatDateShort = formatDateShort;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 统计海报共用的数据类型。
|
|
4
|
+
*
|
|
5
|
+
* 这两个联合类型与 core 侧 `ParsePlatform` / `ParseWorkType` 一一对应,
|
|
6
|
+
* 但**刻意在这里裸写一份**:模板要能在开发面板的浏览器里跑,不能反向 import `@/module/db`
|
|
7
|
+
* (那条链会把 node-karin/sqlite3 拖进浏览器包)。改 core 侧值域时记得同步这里。
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalStatistics = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const theme_1 = require("../../../../utils/theme");
|
|
6
|
+
const DefaultLayout_1 = require("../../../components/DefaultLayout");
|
|
7
|
+
const BoxplotGuide_1 = require("../../components/BoxplotGuide");
|
|
8
|
+
const ChartCard_1 = require("../../components/ChartCard");
|
|
9
|
+
const PlatformTable_1 = require("../../components/PlatformTable");
|
|
10
|
+
const RankList_1 = require("../../components/RankList");
|
|
11
|
+
const KpiCard_1 = require("../../components/KpiCard");
|
|
12
|
+
const SSRChart_1 = require("../../components/SSRChart");
|
|
13
|
+
const chartTheme_1 = require("../../components/chartTheme");
|
|
14
|
+
const chartPresets_1 = require("../../components/chartPresets");
|
|
15
|
+
const format_1 = require("../../components/format");
|
|
16
|
+
/**
|
|
17
|
+
* 全局解析统计海报。
|
|
18
|
+
*
|
|
19
|
+
* 与群海报同一套密排卡片版式:每张图独占一张卡、卡内自带紧凑标题行,
|
|
20
|
+
* 两列网格铺满 1440 宽的画面,尽量压低总高度以适配手机竖屏浏览。
|
|
21
|
+
* 图表由 ECharts 在 render 期同步出 SVG 字符串再注入,不用 hooks、不碰 DOM。
|
|
22
|
+
*/
|
|
23
|
+
/** 海报内容区宽度:1440 - 左右各 72(p-18) */
|
|
24
|
+
const CONTENT_WIDTH = 1296;
|
|
25
|
+
/** 两列网格:gap-14(56px) 下每张卡 620 */
|
|
26
|
+
const GRID_GAP = 56;
|
|
27
|
+
const HALF_CARD_WIDTH = (CONTENT_WIDTH - GRID_GAP) / 2;
|
|
28
|
+
/** 卡片内边距 p-6 = 24px,算画布宽度时必须减掉,否则 SVG 会溢出卡片边框 */
|
|
29
|
+
const CARD_PADDING = 24;
|
|
30
|
+
const FULL_CHART_WIDTH = CONTENT_WIDTH - CARD_PADDING * 2;
|
|
31
|
+
const HALF_CHART_WIDTH = HALF_CARD_WIDTH - CARD_PADDING * 2;
|
|
32
|
+
const HALF_CHART_HEIGHT = 340;
|
|
33
|
+
/**
|
|
34
|
+
* 热力图的画布高度。
|
|
35
|
+
* 比同排的箱线图卡片高一截是刻意为之:箱线图那边多了个 `BoxplotGuide`(约 190px),
|
|
36
|
+
* 两列网格会把同排卡片拉成等高,左卡不跟着长高的话底部就会空出一大块。
|
|
37
|
+
* 加上说明文字补到三行之后,两边内容高度基本对齐。
|
|
38
|
+
*/
|
|
39
|
+
const HEATMAP_CHART_HEIGHT = 520;
|
|
40
|
+
/** 平台分布里环形图的画布尺寸,剩下宽度留给右侧明细列表 */
|
|
41
|
+
const DONUT_SIZE = { width: 420, height: 300 };
|
|
42
|
+
/** 平台趋势:分平台堆叠面积图 */
|
|
43
|
+
const buildPlatformTrendOption = (trend, dark) => {
|
|
44
|
+
const palette = (0, chartTheme_1.getChartPalette)(dark);
|
|
45
|
+
return {
|
|
46
|
+
grid: { top: 44, right: 24, bottom: 56, left: 76 },
|
|
47
|
+
xAxis: {
|
|
48
|
+
type: 'category',
|
|
49
|
+
boundaryGap: false,
|
|
50
|
+
data: trend.dates.map((date) => (0, format_1.formatDateShort)(date)),
|
|
51
|
+
axisLine: (0, chartTheme_1.axisLineStyle)(palette),
|
|
52
|
+
axisTick: { show: false },
|
|
53
|
+
axisLabel: (0, chartTheme_1.axisLabelStyle)(palette, 20, 45),
|
|
54
|
+
splitLine: { show: false }
|
|
55
|
+
},
|
|
56
|
+
yAxis: {
|
|
57
|
+
type: 'value',
|
|
58
|
+
name: '解析次数',
|
|
59
|
+
nameTextStyle: { fontSize: 20, color: palette.textMuted, fontFamily: chartTheme_1.CHART_FONT_FAMILY, align: 'right' },
|
|
60
|
+
axisLine: { show: false },
|
|
61
|
+
axisTick: { show: false },
|
|
62
|
+
axisLabel: (0, chartTheme_1.axisLabelStyle)(palette, 20),
|
|
63
|
+
splitLine: (0, chartTheme_1.splitLineStyle)(palette)
|
|
64
|
+
},
|
|
65
|
+
series: trend.series.map((item) => {
|
|
66
|
+
const color = (0, chartTheme_1.platformColor)(item.platform, dark);
|
|
67
|
+
return {
|
|
68
|
+
type: 'line',
|
|
69
|
+
name: chartTheme_1.PLATFORM_META[item.platform].name,
|
|
70
|
+
stack: 'total',
|
|
71
|
+
smooth: 0.3,
|
|
72
|
+
symbol: 'none',
|
|
73
|
+
lineStyle: { width: 2, color },
|
|
74
|
+
itemStyle: { color },
|
|
75
|
+
areaStyle: { color: (0, chartTheme_1.withAlpha)(color, 0.5) },
|
|
76
|
+
data: item.values
|
|
77
|
+
};
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
/** 平台 × 内容形态:按平台归一的百分比堆叠条,比绝对堆叠更能看出各平台的口味差异 */
|
|
82
|
+
const buildPlatformWorkTypeOption = (rows, dark) => {
|
|
83
|
+
const palette = (0, chartTheme_1.getChartPalette)(dark);
|
|
84
|
+
// 平台顺序走全局常量,不跟着数据库返回顺序走,否则两次渲染的堆叠顺序可能不一样
|
|
85
|
+
const platforms = chartTheme_1.PLATFORM_ORDER.filter((platform) => rows.some((row) => row.platform === platform));
|
|
86
|
+
const workTypes = [...new Set(rows.map((row) => row.workType))];
|
|
87
|
+
const countOf = (platform, workType) => rows.find((row) => row.platform === platform && row.workType === workType)?.count ?? 0;
|
|
88
|
+
const totalOf = (platform) => rows.filter((row) => row.platform === platform).reduce((sum, row) => sum + row.count, 0);
|
|
89
|
+
return {
|
|
90
|
+
grid: { top: 16, right: 24, bottom: 44, left: 150 },
|
|
91
|
+
xAxis: {
|
|
92
|
+
type: 'value',
|
|
93
|
+
max: 100,
|
|
94
|
+
axisLine: { show: false },
|
|
95
|
+
axisTick: { show: false },
|
|
96
|
+
axisLabel: { ...(0, chartTheme_1.axisLabelStyle)(palette, 20), formatter: '{value}%' },
|
|
97
|
+
splitLine: (0, chartTheme_1.splitLineStyle)(palette)
|
|
98
|
+
},
|
|
99
|
+
yAxis: {
|
|
100
|
+
type: 'category',
|
|
101
|
+
inverse: true,
|
|
102
|
+
data: platforms.map((platform) => `${chartTheme_1.PLATFORM_META[platform].name} ${(0, format_1.formatCompact)(totalOf(platform))}`),
|
|
103
|
+
axisLine: { show: false },
|
|
104
|
+
axisTick: { show: false },
|
|
105
|
+
axisLabel: { fontSize: 22, color: palette.text, fontFamily: chartTheme_1.CHART_FONT_FAMILY }
|
|
106
|
+
},
|
|
107
|
+
series: workTypes.map((workType) => ({
|
|
108
|
+
type: 'bar',
|
|
109
|
+
name: chartTheme_1.WORK_TYPE_META[workType].label,
|
|
110
|
+
stack: 'share',
|
|
111
|
+
barWidth: 52,
|
|
112
|
+
itemStyle: { color: chartTheme_1.WORK_TYPE_META[workType].color },
|
|
113
|
+
label: {
|
|
114
|
+
show: true,
|
|
115
|
+
position: 'inside',
|
|
116
|
+
fontSize: 20,
|
|
117
|
+
color: palette.textOnColor,
|
|
118
|
+
fontFamily: chartTheme_1.CHART_FONT_FAMILY,
|
|
119
|
+
// 占比太小的段落放不下字,硬塞会糊成一团,交给下方图例认色
|
|
120
|
+
formatter: (params) => (params.value >= 14 ? `${Math.round(params.value)}%` : '')
|
|
121
|
+
},
|
|
122
|
+
data: platforms.map((platform) => {
|
|
123
|
+
const total = totalOf(platform);
|
|
124
|
+
return total > 0 ? Number(((countOf(platform, workType) / total) * 100).toFixed(2)) : 0;
|
|
125
|
+
})
|
|
126
|
+
}))
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/** 群组增长:累计群数的阶梯折线 */
|
|
130
|
+
const buildGroupGrowthOption = (growth, dark) => {
|
|
131
|
+
const palette = (0, chartTheme_1.getChartPalette)(dark);
|
|
132
|
+
return {
|
|
133
|
+
grid: { top: 44, right: 24, bottom: 56, left: 76 },
|
|
134
|
+
xAxis: {
|
|
135
|
+
type: 'category',
|
|
136
|
+
boundaryGap: false,
|
|
137
|
+
data: growth.map((point) => (0, format_1.formatDateShort)(point.date)),
|
|
138
|
+
axisLine: (0, chartTheme_1.axisLineStyle)(palette),
|
|
139
|
+
axisTick: { show: false },
|
|
140
|
+
axisLabel: (0, chartTheme_1.axisLabelStyle)(palette, 20, 45),
|
|
141
|
+
splitLine: { show: false }
|
|
142
|
+
},
|
|
143
|
+
yAxis: {
|
|
144
|
+
type: 'value',
|
|
145
|
+
name: '累计群数',
|
|
146
|
+
nameTextStyle: { fontSize: 20, color: palette.textMuted, fontFamily: chartTheme_1.CHART_FONT_FAMILY, align: 'right' },
|
|
147
|
+
axisLine: { show: false },
|
|
148
|
+
axisTick: { show: false },
|
|
149
|
+
axisLabel: (0, chartTheme_1.axisLabelStyle)(palette, 20),
|
|
150
|
+
minInterval: 1,
|
|
151
|
+
splitLine: (0, chartTheme_1.splitLineStyle)(palette)
|
|
152
|
+
},
|
|
153
|
+
series: [
|
|
154
|
+
{
|
|
155
|
+
type: 'line',
|
|
156
|
+
// 群数是跳变的,阶梯线比斜线诚实
|
|
157
|
+
step: 'end',
|
|
158
|
+
symbol: 'none',
|
|
159
|
+
lineStyle: { width: 4, color: palette.accent },
|
|
160
|
+
itemStyle: { color: palette.accent },
|
|
161
|
+
areaStyle: {
|
|
162
|
+
color: {
|
|
163
|
+
type: 'linear',
|
|
164
|
+
x: 0,
|
|
165
|
+
y: 0,
|
|
166
|
+
x2: 0,
|
|
167
|
+
y2: 1,
|
|
168
|
+
colorStops: [
|
|
169
|
+
{ offset: 0, color: (0, chartTheme_1.withAlpha)(palette.accent, 0.35) },
|
|
170
|
+
{ offset: 1, color: (0, chartTheme_1.withAlpha)(palette.accent, 0.02) }
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
data: growth.map((point) => point.count)
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* 全局解析统计组件 Global Statistics
|
|
181
|
+
*/
|
|
182
|
+
const GlobalStatistics = (props) => {
|
|
183
|
+
const dark = (0, theme_1.isDark)(props.ctx);
|
|
184
|
+
const data = props.data;
|
|
185
|
+
const palette = (0, chartTheme_1.getChartPalette)(dark);
|
|
186
|
+
// 热力图的两个派生量:总人数(说明里报占比用)和最密集的那一格
|
|
187
|
+
const heatTotal = data.userActivity.cells.reduce((sum, [, , count]) => sum + count, 0);
|
|
188
|
+
// 沉默分布里「最近一周还在用」的群占比,写进卡片说明
|
|
189
|
+
const silenceTotal = data.silenceBuckets.reduce((sum, bucket) => sum + bucket.count, 0);
|
|
190
|
+
const silenceActive = data.silenceBuckets.slice(0, 2).reduce((sum, bucket) => sum + bucket.count, 0);
|
|
191
|
+
const silenceActivePercent = silenceTotal > 0 ? Math.round((silenceActive / silenceTotal) * 100) : 0;
|
|
192
|
+
const heatPeak = data.userActivity.cells.reduce((peak, [x, y, count]) => (count > peak.count ? { x, y, count } : peak), { x: 0, y: 0, count: 0 });
|
|
193
|
+
const platformTotal = data.platformData.reduce((sum, item) => sum + item.count, 0);
|
|
194
|
+
const parsesPerUser = data.totalUsers > 0 ? data.totalParses / data.totalUsers : 0;
|
|
195
|
+
const parsesPerGroup = data.totalGroups > 0 ? data.totalParses / data.totalGroups : 0;
|
|
196
|
+
const hasTrend = data.trend.some((point) => point.count > 0);
|
|
197
|
+
const hasPlatformTrend = data.platformTrend.dates.length > 0;
|
|
198
|
+
const hasWorkTypes = data.workTypes.length > 0;
|
|
199
|
+
const weekdayTotal = data.weekday.reduce((sum, count) => sum + count, 0);
|
|
200
|
+
const trendIsSplit = Boolean(data.trendCompleteFrom) && data.trend.some((point) => point.date < data.trendCompleteFrom);
|
|
201
|
+
const platformLegend = (0, chartPresets_1.buildPlatformLegend)(data.platformData, dark);
|
|
202
|
+
const maxPlatformCount = Math.max(...data.platformData.map((item) => item.count), 1);
|
|
203
|
+
const groupRows = data.topGroups.map((group) => ({
|
|
204
|
+
name: group.name,
|
|
205
|
+
avatar: group.avatar,
|
|
206
|
+
segments: group.segments,
|
|
207
|
+
label: `${(0, format_1.formatWithCommas)(group.totalParses)} 次 · ${(0, format_1.formatWithCommas)(group.uniqueUsers)} 人`
|
|
208
|
+
}));
|
|
209
|
+
return ((0, jsx_runtime_1.jsxs)(DefaultLayout_1.DefaultLayout, { ...props, className: "relative overflow-hidden bg-surface", children: [(0, jsx_runtime_1.jsxs)("div", { className: "absolute inset-0 pointer-events-none z-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute rounded-full w-450 h-500 -top-100 -left-75 blur-[180px]", style: {
|
|
210
|
+
background: `radial-gradient(ellipse at 40% 40%, ${dark ? 'rgba(99, 102, 241, 0.4)' : 'rgba(129, 140, 248, 0.45)'} 0%, transparent 70%)`
|
|
211
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "absolute rounded-full w-350 h-400 top-150 -right-50 blur-[160px]", style: {
|
|
212
|
+
background: `radial-gradient(ellipse at 50% 50%, ${dark ? 'rgba(139, 92, 246, 0.3)' : 'rgba(167, 139, 250, 0.4)'} 0%, transparent 70%)`
|
|
213
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "absolute rounded-full w-400 h-350 -bottom-75 left-75 blur-[180px]", style: {
|
|
214
|
+
background: `radial-gradient(ellipse at 50% 60%, ${dark ? 'rgba(56, 189, 248, 0.22)' : 'rgba(125, 211, 252, 0.3)'} 0%, transparent 70%)`
|
|
215
|
+
} })] }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 pointer-events-none z-0 opacity-[0.08] dark:opacity-[0.12]", children: (0, jsx_runtime_1.jsxs)("svg", { className: "w-full h-full", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsxs)("filter", { id: "pixelNoise", children: [(0, jsx_runtime_1.jsx)("feTurbulence", { type: "fractalNoise", baseFrequency: "0.8", numOctaves: "1", stitchTiles: "stitch" }), (0, jsx_runtime_1.jsx)("feColorMatrix", { type: "saturate", values: "0" }), (0, jsx_runtime_1.jsxs)("feComponentTransfer", { children: [(0, jsx_runtime_1.jsx)("feFuncR", { type: "discrete", tableValues: "0 1" }), (0, jsx_runtime_1.jsx)("feFuncG", { type: "discrete", tableValues: "0 1" }), (0, jsx_runtime_1.jsx)("feFuncB", { type: "discrete", tableValues: "0 1" })] })] }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", filter: "url(#pixelNoise)" })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-24 right-15 pointer-events-none select-none opacity-[0.03] z-0", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[180px] font-black tracking-tighter leading-none block text-right text-foreground", children: "GLOBAL" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative z-10 p-14 flex flex-col gap-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "border-b-4 border-border/30 pb-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 opacity-60 mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "w-3 h-3 rounded-full bg-indigo-500 animate-pulse" }), (0, jsx_runtime_1.jsx)("span", { className: "text-2xl font-mono tracking-widest text-muted/80", children: "GLOBAL_ANALYTICS" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-[5rem] font-black leading-none tracking-tighter text-foreground/90", children: "\u5168\u5C40\u89E3\u6790\u7EDF\u8BA1" }), (0, jsx_runtime_1.jsxs)("div", { className: "shrink-0 whitespace-nowrap text-2xl text-muted/70 font-mono", children: [data.statsSince ? `统计自 ${data.statsSince} · ` : '', "\u6570\u636E\u622A\u6B62 ", data.generatedAt] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-6 gap-5", children: [(0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u670D\u52A1\u7FA4\u7EC4", titleEn: "GROUPS", value: (0, format_1.formatCompact)(data.totalGroups), unit: "\u4E2A" }), (0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u4F7F\u7528\u7528\u6237", titleEn: "USERS", value: (0, format_1.formatCompact)(data.totalUsers), unit: "\u4EBA" }), (0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u603B\u89E3\u6790", titleEn: "PARSES", value: (0, format_1.formatCompact)(data.totalParses), unit: "\u6B21" }), (0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u8986\u76D6\u5E73\u53F0", titleEn: "PLATFORMS", value: String(data.activePlatforms), unit: "\u4E2A" }), (0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u4EBA\u5747\u89E3\u6790", titleEn: "PER USER", value: parsesPerUser.toFixed(1), unit: "\u6B21" }), (0, jsx_runtime_1.jsx)(KpiCard_1.KpiCard, { title: "\u7FA4\u5747\u89E3\u6790", titleEn: "PER GROUP", value: (0, format_1.formatCompact)(Math.round(parsesPerGroup)), unit: "\u6B21" })] }), platformTotal > 0 && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u5E73\u53F0\u5206\u5E03", subtitle: "DISTRIBUTION", accentClassName: "bg-blue-500", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-6", children: [(0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildPlatformDonutOption)(data.platformData, dark, DONUT_SIZE, 'TOTAL PARSES'), width: DONUT_SIZE.width, height: DONUT_SIZE.height, className: "shrink-0" }), (0, jsx_runtime_1.jsx)(PlatformTable_1.PlatformTable, { className: "flex-1", columns: ['解析次数', '占比', '覆盖群数', '覆盖用户'], rows: platformLegend.map((row) => {
|
|
216
|
+
const detail = data.platformData.find((item) => item.platform === row.key);
|
|
217
|
+
return {
|
|
218
|
+
key: row.key,
|
|
219
|
+
logo: row.logo,
|
|
220
|
+
name: row.name,
|
|
221
|
+
color: row.color,
|
|
222
|
+
// 条长按「相对最大项」而不是相对总量:最大的那条顶满,量级差距一眼可见
|
|
223
|
+
barPercent: (row.count / maxPlatformCount) * 100,
|
|
224
|
+
cells: [
|
|
225
|
+
(0, format_1.formatWithCommas)(row.count),
|
|
226
|
+
`${row.percent}%`,
|
|
227
|
+
detail ? (0, format_1.formatWithCommas)(detail.groups) : '—',
|
|
228
|
+
detail ? (0, format_1.formatWithCommas)(detail.users) : '—'
|
|
229
|
+
]
|
|
230
|
+
};
|
|
231
|
+
}) })] }) })), (0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u89E3\u6790\u8D8B\u52BF", subtitle: "TREND", accentClassName: "bg-violet-500", children: hasTrend ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildTrendLineOption)(data.trend, dark, {
|
|
232
|
+
splitFrom: data.trendCompleteFrom,
|
|
233
|
+
baseline: data.dailyAverage,
|
|
234
|
+
baselineLabel: '全局日均'
|
|
235
|
+
}), width: FULL_CHART_WIDTH, height: 360 }), trendIsSplit ? ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 text-center text-xl text-muted/80", children: ["\u8FD1 30 \u5929 \u00B7 \u865A\u7EBF\u4E3A\u5168\u5C40\u65E5\u5747 ", (0, jsx_runtime_1.jsx)("span", { className: "font-bold text-foreground/80", children: data.dailyAverage.toFixed(1) }), " \u6B21 \u00B7", ' ', (0, jsx_runtime_1.jsx)("span", { className: "text-foreground/80 font-bold", children: data.trendCompleteFrom }), " \u4E4B\u524D\u7684\u7070\u8272\u865A\u7EBF\u4E3A\u65E7\u7248\u56DE\u586B\u6570\u636E\uFF0C\u53E3\u5F84\u5931\u771F\u4EC5\u4F5C\u53C2\u8003"] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 text-center text-xl text-muted/80", children: ["\u8FD1 30 \u5929 \u00B7 \u865A\u7EBF\u4E3A\u5168\u5C40\u65E5\u5747 ", (0, jsx_runtime_1.jsx)("span", { className: "font-bold text-foreground/80", children: data.dailyAverage.toFixed(1) }), " \u6B21"] }))] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "h-80 flex flex-col items-center justify-center gap-3 text-muted/70", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-3xl font-bold", children: "\u6682\u65E0\u8D8B\u52BF\u6570\u636E" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xl", children: "\u8BE5\u7EDF\u8BA1\u4ECE\u672C\u529F\u80FD\u4E0A\u7EBF\u540E\u5F00\u59CB\u6309\u5929\u8BB0\u5F55\uFF0C\u5148\u79EF\u7D2F\u51E0\u5929\u518D\u6765\u770B ~" })] })) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-14", children: [hasPlatformTrend && ((0, jsx_runtime_1.jsxs)(ChartCard_1.ChartCard, { title: "\u5E73\u53F0\u8D8B\u52BF", subtitle: "PLATFORM TREND", accentClassName: "bg-sky-500", children: [(0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: buildPlatformTrendOption(data.platformTrend, dark), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 flex flex-wrap justify-center gap-x-6 gap-y-2", children: data.platformTrend.series.map((item) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "w-6 h-6 rounded shrink-0", style: { backgroundColor: (0, chartTheme_1.platformColor)(item.platform, dark) } }), (0, jsx_runtime_1.jsx)("span", { className: "text-xl text-foreground/80", children: chartTheme_1.PLATFORM_META[item.platform].name })] }, item.platform))) })] })), hasWorkTypes && ((0, jsx_runtime_1.jsxs)(ChartCard_1.ChartCard, { title: "\u5185\u5BB9\u5F62\u6001", subtitle: "WORK TYPES", accentClassName: "bg-cyan-500", children: [(0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: buildPlatformWorkTypeOption(data.workTypes, dark), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 flex flex-wrap justify-center gap-x-6 gap-y-2", children: (0, chartPresets_1.buildWorkTypeLegend)(data.workTypes).map((row) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "w-6 h-6 rounded shrink-0", style: { backgroundColor: row.color } }), (0, jsx_runtime_1.jsx)("span", { className: "text-xl text-foreground/80", children: row.label })] }, row.key))) })] }))] }), data.metrics.map((item) => {
|
|
236
|
+
// 拿「≤5s」那一档的累计占比当读法示例。档位会被裁剪,只能按标签找,不能按下标
|
|
237
|
+
const metricTotal = item.buckets.reduce((sum, bucket) => sum + bucket.count, 0);
|
|
238
|
+
const fiveSecondIndex = item.buckets.findIndex((bucket) => bucket.upper === '≤5s');
|
|
239
|
+
const fiveSecondShare = fiveSecondIndex >= 0 && metricTotal > 0
|
|
240
|
+
? Math.round((item.buckets.slice(0, fiveSecondIndex + 1).reduce((sum, bucket) => sum + bucket.count, 0) / metricTotal) * 100)
|
|
241
|
+
: undefined;
|
|
242
|
+
return ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: chartTheme_1.METRIC_META[item.metric].title, subtitle: chartTheme_1.METRIC_META[item.metric].subtitle, accentClassName: chartTheme_1.METRIC_META[item.metric].accent, caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u6A2A\u8F74 = ", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: "\u8017\u65F6\u4E0A\u9650" }), " \u00B7 \u7EB5\u8F74 = \u6709\u591A\u5C11\u6BD4\u4F8B\u7684\u89E3\u6790\u5728\u8FD9\u4E2A\u65F6\u95F4\u5185\u8DD1\u5B8C \u00B7 \u4E24\u6761\u865A\u7EBF\u662F 50% / 90% \u7684\u4F4D\u7F6E", (0, jsx_runtime_1.jsx)("br", {}), "\u8BFB\u6CD5\uFF1A", fiveSecondShare !== undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u300C\u22645s\u300D\u90A3\u4E2A\u70B9\u662F ", (0, jsx_runtime_1.jsxs)("b", { className: "text-foreground/80", children: [fiveSecondShare, "%"] }), "\uFF0C\u610F\u601D\u5C31\u662F ", fiveSecondShare, "% \u7684\u89E3\u6790 5 \u79D2\u5185\u8DD1\u5B8C"] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "\u4EFB\u53D6\u4E00\u70B9\uFF0C\u6A2A\u8F74\u662F\u8017\u65F6\u4E0A\u9650\u3001\u7EB5\u8F74\u5C31\u662F\u8DD1\u5B8C\u7684\u6BD4\u4F8B" })), "\uFF1B\u66F2\u7EBF\u8D8A\u9661\u8BF4\u660E\u89E3\u6790\u8D8A\u96C6\u4E2D\u5728\u8FD9\u4E00\u6BB5"] }), children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildDurationCurveOption)(item, dark), width: FULL_CHART_WIDTH, height: 380 }) }, item.metric));
|
|
243
|
+
}), groupRows.length > 0 && ((0, jsx_runtime_1.jsxs)(ChartCard_1.ChartCard, { title: "\u7FA4\u7EC4\u6392\u884C", subtitle: "TOP GROUPS", accentClassName: "bg-emerald-500", caption: "\u8FDB\u5EA6\u6761\u6309\u5E73\u53F0\u5206\u8272\uFF0C\u989C\u8272 = \u8BE5\u7FA4\u7684\u89E3\u6790\u6765\u81EA\u54EA\u4E2A\u5E73\u53F0\uFF1B\u53F3\u4FA7\u662F\u603B\u6B21\u6570\u548C\u4F7F\u7528\u4EBA\u6570", children: [(0, jsx_runtime_1.jsx)(RankList_1.RankList, { rows: groupRows, dark: dark }), (0, jsx_runtime_1.jsx)(RankList_1.RankLegend, { platforms: (0, RankList_1.collectRankPlatforms)(groupRows), dark: dark })] })), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-14", children: [data.sizeBuckets.some((bucket) => bucket.count > 0) && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u7FA4\u89C4\u6A21\u5206\u5E03", subtitle: "GROUP SIZES", accentClassName: "bg-amber-500", caption: "\u6309\u5404\u7FA4\u7D2F\u8BA1\u89E3\u6790\u6B21\u6570\u5206\u6876", children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildBucketOption)(data.sizeBuckets, dark, { yName: '群数' }), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }) })), data.groupGrowth.length > 0 && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u7FA4\u7EC4\u589E\u957F", subtitle: "GROUP GROWTH", accentClassName: "bg-teal-500", caption: "\u6309\u7FA4\u9996\u6B21\u51FA\u73B0\u89E3\u6790\u7684\u65E5\u671F\u7D2F\u8BA1", children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: buildGroupGrowthOption(data.groupGrowth, dark), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-14", children: [data.userActivity.cells.length > 0 && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u7528\u6237\u6D3B\u8DC3\u5EA6", subtitle: "USER ACTIVITY", accentClassName: "bg-rose-500", caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u6A2A\u8F74 \u2192 \u7528\u8FC7\u51E0\u4E2A\u7FA4 \u00B7 \u7EB5\u8F74 \u2191 \u603B\u89E3\u6790\u6B21\u6570 \u00B7 \u683C\u5B50\u6570\u5B57 = \u843D\u5728\u8FD9\u6863\u7684\u7528\u6237\u6570", (0, jsx_runtime_1.jsx)("br", {}), "\u5171 ", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: (0, format_1.formatWithCommas)(heatTotal) }), " \u4F4D\u7528\u6237 \u00B7 \u6700\u5BC6\u96C6\u7684\u4E00\u683C\u662F\u300C", data.userActivity.xLabels[heatPeak.x], " \u00D7 ", data.userActivity.yLabels[heatPeak.y], "\u300D\uFF0C \u5360 ", (0, jsx_runtime_1.jsxs)("b", { className: "text-foreground/80", children: [(0, format_1.formatPercent)(heatPeak.count, heatTotal), "%"] }), (0, jsx_runtime_1.jsx)("br", {}), "\u989C\u8272\u8D8A\u6DF1\u4EBA\u8D8A\u591A\uFF1B\u5DE6\u4E0A\u89D2\u5927\u7247\u6DF1\u8272 = \u5927\u591A\u6570\u4EBA\u53EA\u5728\u5C11\u6570\u7FA4\u91CC\u8F7B\u5EA6\u4F7F\u7528"] }), children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildHeatmapOption)(data.userActivity, dark), width: HALF_CHART_WIDTH, height: HEATMAP_CHART_HEIGHT }) })), data.groupActivity.length > 0 && ((0, jsx_runtime_1.jsxs)(ChartCard_1.ChartCard, { title: "\u7FA4\u7EC4\u6D3B\u8DC3\u5EA6", subtitle: "GROUP ACTIVITY", accentClassName: "bg-purple-500", caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u600E\u4E48\u7B97\u7684\uFF1A\u628A\u6BCF\u4E2A\u7FA4\u6309", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: "\u7FA4\u5185\u4F7F\u7528\u4EBA\u6570" }), "\u5206\u6863\uFF0C \u6863\u5185\u6240\u6709\u7FA4\u7684", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: "\u603B\u89E3\u6790\u6B21\u6570" }), "\u5408\u8D77\u6765\u753B\u6210\u4E00\u4E2A\u7BB1\u4F53", (0, jsx_runtime_1.jsx)("br", {}), "\u6A2A\u8F74 = \u4F7F\u7528\u4EBA\u6570\u6863 \u00B7 \u7EB5\u8F74 = \u7FA4\u603B\u89E3\u6790\u6B21\u6570 \u00B7 \u7BB1\u4F53\u4E0A\u65B9\u7684\u6570\u5B57\u662F\u4E2D\u4F4D\u6570"] }), children: [(0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildBoxplotOption)(data.groupActivity, dark, '群总解析次数'), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }), (0, jsx_runtime_1.jsx)(BoxplotGuide_1.BoxplotGuide, { accent: palette.accent })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-14", children: [weekdayTotal > 0 && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u5468\u5185\u5206\u5E03", subtitle: "BY WEEKDAY", accentClassName: "bg-orange-500", caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u6A2A\u8F74 = \u5468\u4E00\u5230\u5468\u65E5 \u00B7 \u7EB5\u8F74 = \u8BE5\u661F\u671F\u51E0\u7684", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: "\u65E5\u5747" }), "\u89E3\u6790\u6B21\u6570 \u00B7 \u865A\u7EBF = \u4E03\u65E5\u5747\u503C", (0, jsx_runtime_1.jsx)("br", {}), "\u67F1\u5B50\u6BD4\u865A\u7EBF\u9AD8 = \u8FD9\u5929\u6BD4\u5E73\u65F6\u66F4\u6D3B\u8DC3\uFF1B\u53D6\u65E5\u5747\u800C\u4E0D\u662F\u4E03\u5929\u603B\u548C\uFF0C\u662F\u56E0\u4E3A\u7A97\u53E3\u4E0D\u662F\u6574\u5468"] }), children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildWeekdayOption)(data.weekday, dark), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }) })), data.silenceBuckets.some((bucket) => bucket.count > 0) && ((0, jsx_runtime_1.jsx)(ChartCard_1.ChartCard, { title: "\u7FA4\u6C89\u9ED8\u5206\u5E03", subtitle: "SILENT GROUPS", accentClassName: "bg-slate-500", caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u600E\u4E48\u7B97\u7684\uFF1A\u6BCF\u4E2A\u7FA4\u6309", (0, jsx_runtime_1.jsx)("b", { className: "text-foreground/80", children: "\u6700\u540E\u4E00\u6B21\u89E3\u6790\u8DDD\u4ECA\u51E0\u5929" }), "\u5F52\u5230\u4E00\u6863\uFF0C\u67F1\u5B50\u9AD8\u5EA6 = \u843D\u5728\u8FD9\u6863\u7684\u7FA4\u6570", (0, jsx_runtime_1.jsx)("br", {}), "\u7EFF = \u6700\u8FD1\u4E00\u5468\u8FD8\u5728\u7528 \u00B7 \u9EC4 = \u4E00\u5468\u5230\u4E00\u6708 \u00B7 \u7070 = \u8D85\u8FC7\u4E00\u6708\u6CA1\u52A8\u9759 \u00B7 \u67F1\u9876\u7B2C\u4E8C\u884C\u662F\u8BE5\u6863\u5360\u5168\u90E8\u7FA4\u7684\u6BD4\u4F8B", (0, jsx_runtime_1.jsx)("br", {}), "\u5F53\u524D\u6709 ", (0, jsx_runtime_1.jsxs)("b", { className: "text-foreground/80", children: [silenceActivePercent, "%"] }), " \u7684\u7FA4\u6700\u8FD1\u4E00\u5468\u7528\u8FC7"] }), children: (0, jsx_runtime_1.jsx)(SSRChart_1.SSRChart, { option: (0, chartPresets_1.buildSilenceBucketsOption)(data.silenceBuckets, dark), width: HALF_CHART_WIDTH, height: HALF_CHART_HEIGHT }) }))] }), (0, jsx_runtime_1.jsx)("div", { className: "pt-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-mono tracking-widest text-muted mb-2", children: "TOTAL SERVICE" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl font-medium text-foreground/70", children: ["\u7D2F\u8BA1\u670D\u52A1 ", (0, jsx_runtime_1.jsx)("span", { className: "font-black text-foreground", children: (0, format_1.formatWithCommas)(data.totalGroups) }), " \u4E2A\u7FA4\u7EC4 \u00B7 \u89E3\u6790", ' ', (0, jsx_runtime_1.jsx)("span", { className: "font-black text-foreground", children: (0, format_1.formatWithCommas)(data.totalParses) }), " \u6B21"] })] }) })] })] }));
|
|
244
|
+
};
|
|
245
|
+
exports.GlobalStatistics = GlobalStatistics;
|
|
246
|
+
exports.default = exports.GlobalStatistics;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_react_1 = require("../../../../compat/template-react.js");
|
|
4
|
+
const GlobalStatistics_1 = require("./components/GlobalStatistics");
|
|
5
|
+
exports.default = (0, template_react_1.defineTemplate)({
|
|
6
|
+
name: '全局统计',
|
|
7
|
+
description: '全局解析统计页面',
|
|
8
|
+
component: GlobalStatistics_1.GlobalStatistics
|
|
9
|
+
});
|