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,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DouyinArticleWork = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("../../../../../compat/phosphor-icons.js");
|
|
9
|
+
const date_fns_1 = require("date-fns");
|
|
10
|
+
const lucide_react_1 = require("lucide-react");
|
|
11
|
+
const react_2 = __importDefault(require("react"));
|
|
12
|
+
const react_markdown_1 = __importDefault(require("react-markdown"));
|
|
13
|
+
const theme_1 = require("../../../../utils/theme");
|
|
14
|
+
const DefaultLayout_1 = require("../../../components/DefaultLayout");
|
|
15
|
+
const QRCodeWithAvatar_1 = require("../../../components/QRCodeWithAvatar");
|
|
16
|
+
const Icons_1 = require("../../components/Icons");
|
|
17
|
+
const getTitleClassName = (titleLength) => {
|
|
18
|
+
if (titleLength > 96)
|
|
19
|
+
return 'text-[42px] leading-[1.34]';
|
|
20
|
+
if (titleLength > 72)
|
|
21
|
+
return 'text-[48px] leading-[1.3]';
|
|
22
|
+
if (titleLength > 48)
|
|
23
|
+
return 'text-[54px] leading-[1.26]';
|
|
24
|
+
return 'text-[62px] leading-[1.18]';
|
|
25
|
+
};
|
|
26
|
+
const getArticleImageUrl = (image) => image?.ai_high_image_url || image?.high_image_url || image?.origin_image_url || image?.markdown_url;
|
|
27
|
+
const preprocessMarkdown = (markdown) => markdown.replace(/!\[([^\]]*)\]\(([^\s)]+)(?:\s+width=\d+)?(?:\s+height=\d+)?\)/g, '');
|
|
28
|
+
const DouyinDiffuseBackground = ({ data }) => {
|
|
29
|
+
const coverUrl = getArticleImageUrl(data.images[0]);
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-none absolute inset-0 overflow-hidden select-none", children: [coverUrl && ((0, jsx_runtime_1.jsx)("img", { src: coverUrl, alt: "", className: "absolute inset-0 h-full w-full scale-150 object-cover opacity-50 blur-[120px] saturate-[1.8]", referrerPolicy: "no-referrer", crossOrigin: "anonymous" })), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 bg-linear-to-b from-background/70 via-background/50 to-background/70" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 opacity-[0.35] mix-blend-overlay dark:mix-blend-soft-light", children: (0, jsx_runtime_1.jsxs)("svg", { className: "h-full w-full", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("filter", { id: "douyinArticleWorkNoise", children: [(0, jsx_runtime_1.jsx)("feTurbulence", { type: "fractalNoise", baseFrequency: "1.2", numOctaves: "3", 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)("feComponentTransfer", { children: (0, jsx_runtime_1.jsx)("feFuncA", { type: "linear", slope: "2", intercept: "-0.5" }) })] }), (0, jsx_runtime_1.jsxs)("mask", { id: "douyinArticleWorkNoiseMask", children: [(0, jsx_runtime_1.jsxs)("linearGradient", { id: "douyinArticleWorkNoiseGradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", stopColor: "white", stopOpacity: "1" }), (0, jsx_runtime_1.jsx)("stop", { offset: "15%", stopColor: "white", stopOpacity: "0.6" }), (0, jsx_runtime_1.jsx)("stop", { offset: "50%", stopColor: "white", stopOpacity: "0.15" }), (0, jsx_runtime_1.jsx)("stop", { offset: "85%", stopColor: "white", stopOpacity: "0.6" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", stopColor: "white", stopOpacity: "1" })] }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: "url(#douyinArticleWorkNoiseGradient)" })] })] }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", filter: "url(#douyinArticleWorkNoise)", mask: "url(#douyinArticleWorkNoiseMask)", fill: "white" })] }) })] }));
|
|
31
|
+
};
|
|
32
|
+
const DouyinPosterHeader = ({ data, ctx }) => {
|
|
33
|
+
const { avater_url, username, create_time, read_time } = data;
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)("header", { className: "flex items-start justify-between gap-14", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex min-w-0 items-center gap-6", children: [(0, jsx_runtime_1.jsx)("img", { src: avater_url, alt: "\u5934\u50CF", className: "h-24 w-24 shrink-0 rounded-full object-cover shadow-2xl", referrerPolicy: "no-referrer", crossOrigin: "anonymous" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "max-w-165 truncate text-[44px] font-black leading-tight text-foreground select-text", children: username }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 flex flex-wrap items-center gap-x-5 gap-y-2 text-[30px] text-muted", children: [(0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock3, { size: 28 }), (0, jsx_runtime_1.jsx)("span", { className: "select-text", children: create_time })] }), (0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.BookOpenText, { size: 30 }), (0, jsx_runtime_1.jsxs)("span", { className: "select-text", children: ["\u9605\u8BFB ", read_time, " \u5206\u949F"] })] })] })] })] }), (0, jsx_runtime_1.jsx)("img", { src: (0, theme_1.isDark)(ctx) ? '/image/douyin/dylogo-light.svg' : '/image/douyin/dylogo-dark.svg', alt: "\u6296\u97F3", className: "mt-2 h-17 w-auto shrink-0 object-contain opacity-90" })] }));
|
|
35
|
+
};
|
|
36
|
+
const DouyinArticleTitle = ({ data }) => ((0, jsx_runtime_1.jsx)("section", { className: "mt-13", children: (0, jsx_runtime_1.jsx)("h1", { className: `${getTitleClassName(data.title.length)} font-bold text-foreground select-text`, style: { wordBreak: 'break-word', overflowWrap: 'break-word' }, children: data.title }) }));
|
|
37
|
+
const DouyinArticleContent = ({ data }) => {
|
|
38
|
+
const imageMap = new Map();
|
|
39
|
+
data.images.forEach((image) => {
|
|
40
|
+
const highQualityUrl = getArticleImageUrl(image);
|
|
41
|
+
if (highQualityUrl)
|
|
42
|
+
imageMap.set(image.markdown_url, highQualityUrl);
|
|
43
|
+
});
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)("section", { className: "mt-12 select-text", children: (0, jsx_runtime_1.jsx)(react_markdown_1.default, { components: {
|
|
45
|
+
h1: ({ children }) => (0, jsx_runtime_1.jsx)("h2", { className: "mt-14 text-[56px] font-black leading-tight text-foreground", children: children }),
|
|
46
|
+
h2: ({ children }) => (0, jsx_runtime_1.jsx)("h2", { className: "mt-12 text-[50px] font-black leading-tight text-foreground", children: children }),
|
|
47
|
+
h3: ({ children }) => (0, jsx_runtime_1.jsx)("h3", { className: "mt-10 text-[44px] font-black leading-snug text-foreground", children: children }),
|
|
48
|
+
h4: ({ children }) => (0, jsx_runtime_1.jsx)("h4", { className: "mt-9 text-[40px] font-bold leading-snug text-foreground", children: children }),
|
|
49
|
+
p: ({ children }) => (0, jsx_runtime_1.jsx)("p", { className: "mb-7 text-[42px] font-medium leading-[1.62] text-foreground/90", children: children }),
|
|
50
|
+
ul: ({ children }) => ((0, jsx_runtime_1.jsx)("ul", { className: "mb-8 list-inside list-disc text-[42px] font-medium leading-[1.6] text-foreground/90", children: children })),
|
|
51
|
+
ol: ({ children }) => ((0, jsx_runtime_1.jsx)("ol", { className: "mb-8 list-inside list-decimal text-[42px] font-medium leading-[1.6] text-foreground/90", children: children })),
|
|
52
|
+
li: ({ children }) => (0, jsx_runtime_1.jsx)("li", { className: "mb-3", children: children }),
|
|
53
|
+
strong: ({ children }) => (0, jsx_runtime_1.jsx)("strong", { className: "font-black text-foreground", children: children }),
|
|
54
|
+
em: ({ children }) => (0, jsx_runtime_1.jsx)("em", { className: "italic text-foreground/80", children: children }),
|
|
55
|
+
blockquote: ({ children }) => ((0, jsx_runtime_1.jsx)("blockquote", { className: "my-10 pl-7 text-[40px] font-medium leading-[1.62] text-muted", children: children })),
|
|
56
|
+
code: ({ children }) => (0, jsx_runtime_1.jsx)("code", { className: "font-mono text-[34px] text-foreground/80", children: children }),
|
|
57
|
+
img: ({ src, alt }) => {
|
|
58
|
+
const imageUrl = src ? imageMap.get(src) || src : '';
|
|
59
|
+
if (!imageUrl)
|
|
60
|
+
return null;
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("figure", { className: "relative -mx-20 my-12 overflow-visible", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -inset-x-16 -inset-y-20 z-0 overflow-hidden", style: {
|
|
62
|
+
maskImage: 'linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%)',
|
|
63
|
+
WebkitMaskImage: 'linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%)'
|
|
64
|
+
}, children: (0, jsx_runtime_1.jsx)("img", { src: imageUrl, alt: "", className: "h-full w-full scale-[1.08] object-cover opacity-62 blur-[46px] saturate-[1.15]", referrerPolicy: "no-referrer", crossOrigin: "anonymous" }) }), (0, jsx_runtime_1.jsx)("img", { src: imageUrl, alt: alt || '文章图片', className: "relative z-10 block h-auto w-full drop-shadow-2xl", style: {
|
|
65
|
+
maskImage: 'linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%)',
|
|
66
|
+
WebkitMaskImage: 'linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%)'
|
|
67
|
+
}, referrerPolicy: "no-referrer", crossOrigin: "anonymous" }), alt && alt !== '图片描述' && ((0, jsx_runtime_1.jsx)("figcaption", { className: "relative z-10 mt-5 px-20 text-[30px] font-medium text-muted", children: alt }))] }));
|
|
68
|
+
}
|
|
69
|
+
}, children: preprocessMarkdown(data.markdown) }) }));
|
|
70
|
+
};
|
|
71
|
+
const DouyinSignalLine = ({ data }) => {
|
|
72
|
+
const { dianzan, pinglun, shouchang, share } = data;
|
|
73
|
+
const renderTime = (0, date_fns_1.format)(new Date(), 'yyyy-MM-dd HH:mm:ss');
|
|
74
|
+
const stats = [
|
|
75
|
+
{ icon: Icons_1.DouyinLikeIcon, value: dianzan, label: '点赞' },
|
|
76
|
+
{ icon: Icons_1.DouyinCommentIcon, value: pinglun, label: '评论' },
|
|
77
|
+
{ icon: Icons_1.DouyinFavoriteIcon, value: shouchang, label: '收藏' },
|
|
78
|
+
{ icon: Icons_1.DouyinShareIcon, value: share, label: '分享' }
|
|
79
|
+
];
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: "mt-12", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap items-end gap-x-16 gap-y-8", children: stats.map((stat) => {
|
|
81
|
+
const Icon = stat.icon;
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "min-w-37.5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 text-[28px] font-semibold text-muted", children: [(0, jsx_runtime_1.jsx)(Icon, { size: 36, weight: "fill", className: "text-foreground/80" }), (0, jsx_runtime_1.jsx)("span", { children: stat.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-[64px] font-black leading-none text-foreground tabular-nums select-text", children: stat.value })] }, stat.label));
|
|
83
|
+
}) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-8 text-[29px] leading-[1.45] text-muted", children: (0, jsx_runtime_1.jsxs)("span", { className: "select-text", children: ["\u56FE\u7247\u751F\u6210\u4E8E: ", renderTime] }) })] }));
|
|
84
|
+
};
|
|
85
|
+
const DouyinPosterFooter = ({ data, ctx }) => {
|
|
86
|
+
const { avater_url, username, 抖音号, 获赞, 关注, 粉丝, share_url } = data;
|
|
87
|
+
const stats = [
|
|
88
|
+
{ icon: Icons_1.DouyinLikeIcon, iconSize: 26, label: '获赞', value: 获赞 },
|
|
89
|
+
{ icon: react_1.UserPlusIcon, iconSize: 32, label: '关注', value: 关注 },
|
|
90
|
+
{ icon: react_1.UsersThreeIcon, iconSize: 32, label: '粉丝', value: 粉丝 }
|
|
91
|
+
];
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)("footer", { className: "mt-16 flex items-start justify-between gap-16", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1 pt-10", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-6", children: [(0, jsx_runtime_1.jsx)("img", { src: avater_url, alt: "\u5934\u50CF", className: "h-24 w-24 shrink-0 rounded-full object-cover shadow-xl", referrerPolicy: "no-referrer", crossOrigin: "anonymous" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "max-w-162.5 truncate text-[48px] font-black leading-tight text-foreground select-text", children: username }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 flex items-center gap-2 text-[30px] text-muted", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Hash, { size: 28 }), (0, jsx_runtime_1.jsxs)("span", { className: "truncate select-text", children: ["\u6296\u97F3\u53F7: ", 抖音号] })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-10 flex flex-wrap gap-x-14 gap-y-6", children: stats.map((stat) => {
|
|
93
|
+
const Icon = stat.icon;
|
|
94
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "min-w-37.5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 text-[25px] font-semibold text-muted", children: [(0, jsx_runtime_1.jsx)(Icon, { size: stat.iconSize, weight: "fill", className: "text-foreground/80" }), (0, jsx_runtime_1.jsx)("span", { children: stat.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-[32px] font-black leading-none text-foreground select-text", children: stat.value })] }, stat.label));
|
|
95
|
+
}) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "shrink-0 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "drop-shadow-2xl", children: (0, jsx_runtime_1.jsx)(QRCodeWithAvatar_1.QRCodeWithAvatar, { value: share_url, avatarUrl: avater_url, useDarkTheme: (0, theme_1.isDark)(ctx), alt: "\u4E8C\u7EF4\u7801", className: "h-75 w-75" }) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-[28px] font-black text-foreground/80", children: "\u626B\u7801\u67E5\u770B\u4F5C\u54C1\u8BE6\u60C5" })] })] }));
|
|
96
|
+
};
|
|
97
|
+
exports.DouyinArticleWork = react_2.default.memo((props) => ((0, jsx_runtime_1.jsxs)(DefaultLayout_1.DefaultLayout, { ...props, className: "relative overflow-hidden", children: [(0, jsx_runtime_1.jsx)(DouyinDiffuseBackground, { ...props }), (0, jsx_runtime_1.jsxs)("section", { className: "relative z-10 px-20 pt-18", children: [(0, jsx_runtime_1.jsx)(DouyinPosterHeader, { ...props }), (0, jsx_runtime_1.jsx)(DouyinArticleTitle, { ...props }), (0, jsx_runtime_1.jsx)(DouyinArticleContent, { ...props }), (0, jsx_runtime_1.jsx)(DouyinSignalLine, { ...props }), (0, jsx_runtime_1.jsx)(DouyinPosterFooter, { ...props })] })] })));
|
|
98
|
+
exports.DouyinArticleWork.displayName = 'DouyinArticleWork';
|
|
99
|
+
exports.default = exports.DouyinArticleWork;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_react_1 = require("../../../../compat/template-react.js");
|
|
4
|
+
const ArticleWork_1 = require("./components/ArticleWork");
|
|
5
|
+
exports.default = (0, template_react_1.defineTemplate)({
|
|
6
|
+
name: '文章作品',
|
|
7
|
+
description: '抖音文章作品解析与推送模板',
|
|
8
|
+
component: ArticleWork_1.DouyinArticleWork,
|
|
9
|
+
validate: (data) => typeof data === 'object' && data !== null && typeof data.share_url === 'string'
|
|
10
|
+
});
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DouyinComment = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const richtext_1 = require("../../../../../richtext");
|
|
9
|
+
const react_1 = require("../../../../../compat/phosphor-icons.js");
|
|
10
|
+
const date_fns_1 = require("date-fns");
|
|
11
|
+
const locale_1 = require("date-fns/locale");
|
|
12
|
+
const lucide_react_1 = require("lucide-react");
|
|
13
|
+
const react_2 = __importDefault(require("react"));
|
|
14
|
+
const cn_1 = require("../../../../utils/cn");
|
|
15
|
+
const theme_1 = require("../../../../utils/theme");
|
|
16
|
+
const DefaultLayout_1 = require("../../../components/DefaultLayout");
|
|
17
|
+
const QRCodeWithAvatar_1 = require("../../../components/QRCodeWithAvatar");
|
|
18
|
+
const Icons_1 = require("../../components/Icons");
|
|
19
|
+
const douyinMentionClassName = 'text-[#04498d] dark:text-[#face15]';
|
|
20
|
+
const douyinSearchKeywordClassName = 'font-medium text-[#04498d] dark:text-[#face15]';
|
|
21
|
+
const douyinSearchKeywordIconClassName = 'opacity-90';
|
|
22
|
+
// 注意不能提升到模块顶层调用:打包后注册表与共享 chunk 存在循环引用,
|
|
23
|
+
// 模块求值期调用会在「未初始化」的绑定上炸出 is not a function,必须惰性创建。
|
|
24
|
+
const createEmptyDouyinRichText = () => (0, richtext_1.createRichTextDocument)([], { platform: 'douyin' });
|
|
25
|
+
const renderDouyinCommentRichText = (content) => {
|
|
26
|
+
return (0, richtext_1.renderRichTextToReact)(content, {
|
|
27
|
+
mention: { className: douyinMentionClassName },
|
|
28
|
+
searchKeyword: { className: douyinSearchKeywordClassName, iconClassName: douyinSearchKeywordIconClassName }
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const formatDouyinCommentTime = (timestamp) => {
|
|
32
|
+
if (!timestamp) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
const commentDate = (0, date_fns_1.fromUnixTime)(timestamp);
|
|
36
|
+
const diffSeconds = (0, date_fns_1.differenceInSeconds)(new Date(), commentDate);
|
|
37
|
+
if (diffSeconds < 30) {
|
|
38
|
+
return '刚刚';
|
|
39
|
+
}
|
|
40
|
+
if (diffSeconds < 7776000) {
|
|
41
|
+
return (0, date_fns_1.formatDistanceToNow)(commentDate, {
|
|
42
|
+
locale: locale_1.zhCN,
|
|
43
|
+
addSuffix: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return (0, date_fns_1.format)(commentDate, 'yyyy-MM-dd');
|
|
47
|
+
};
|
|
48
|
+
const formatDouyinCommentDiggCount = (count) => {
|
|
49
|
+
if (count >= 10000) {
|
|
50
|
+
return `${(count / 10000).toFixed(1)}w`;
|
|
51
|
+
}
|
|
52
|
+
return String(count);
|
|
53
|
+
};
|
|
54
|
+
const formatPublishTime = (timestamp) => {
|
|
55
|
+
if (!timestamp)
|
|
56
|
+
return '';
|
|
57
|
+
return (0, date_fns_1.format)((0, date_fns_1.fromUnixTime)(timestamp), 'yyyy年MM月dd日 HH:mm', { locale: locale_1.zhCN });
|
|
58
|
+
};
|
|
59
|
+
// const DouyinLogo: React.FC<{ useDarkTheme?: boolean }> = ({ useDarkTheme }) => {
|
|
60
|
+
// const [hasError, setHasError] = React.useState(false)
|
|
61
|
+
// if (hasError) {
|
|
62
|
+
// return (
|
|
63
|
+
// <div className='flex items-center h-full text-6xl font-bold text-foreground/70'>
|
|
64
|
+
// 抖音
|
|
65
|
+
// </div>
|
|
66
|
+
// )
|
|
67
|
+
// }
|
|
68
|
+
// return (
|
|
69
|
+
// <img
|
|
70
|
+
// src={useDarkTheme ? '/image/douyin/dylogo-light.svg' : '/image/douyin/dylogo-dark.svg'}
|
|
71
|
+
// alt='抖音Logo'
|
|
72
|
+
// className='object-contain h-full w-auto max-w-125'
|
|
73
|
+
// onError={() => setHasError(true)}
|
|
74
|
+
// />
|
|
75
|
+
// )
|
|
76
|
+
// }
|
|
77
|
+
/**
|
|
78
|
+
* 二维码组件
|
|
79
|
+
* @param props 组件属性
|
|
80
|
+
* @returns JSX元素
|
|
81
|
+
*/
|
|
82
|
+
const QRCodeSection = (props) => {
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-center", children: (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center items-center w-100 h-100 p-4", children: (0, jsx_runtime_1.jsx)(QRCodeWithAvatar_1.QRCodeWithAvatar, { value: props.share_url, avatarUrl: props.AuthorAvatar, useDarkTheme: props.useDarkTheme, alt: "\u4E8C\u7EF4\u7801", className: "object-contain w-full h-full rounded-lg" }) }) }));
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* 视频信息头部组件
|
|
87
|
+
* @param props 组件属性
|
|
88
|
+
* @returns JSX元素
|
|
89
|
+
*/
|
|
90
|
+
const VideoInfoHeader = (props) => {
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "max-w-350 mx-auto px-10 pt-14", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between gap-10", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-10 flex-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-start justify-between gap-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-6 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-35 h-35 shrink-0 rounded-full overflow-hidden bg-surface-secondary ring-2 ring-border/40", children: (0, jsx_runtime_1.jsx)("img", { src: props.AuthorAvatar, className: "w-full h-full object-cover", alt: props.Author }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-4 flex-wrap", children: (0, jsx_runtime_1.jsx)("span", { className: "text-5xl font-medium text-foreground truncate", children: props.Author }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-muted", children: formatPublishTime(props.CreateTime) })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 text-foreground/50", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 48 }), (0, jsx_runtime_1.jsx)("span", { className: "text-5xl font-medium text-foreground/90", children: formatDouyinCommentDiggCount(props.Statistics.digg_count) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 text-foreground/50", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinCommentIcon, { size: 48 }), (0, jsx_runtime_1.jsx)("span", { className: "text-5xl font-medium text-foreground/90", children: formatDouyinCommentDiggCount(props.Statistics.comment_count) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 text-foreground/50", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinShareIcon, { size: 48 }), (0, jsx_runtime_1.jsx)("span", { className: "text-5xl font-medium text-foreground/90", children: formatDouyinCommentDiggCount(props.Statistics.share_count) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 text-foreground/50", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinFavoriteIcon, { size: 48 }), (0, jsx_runtime_1.jsx)("span", { className: "text-5xl font-medium text-foreground/90", children: formatDouyinCommentDiggCount(props.Statistics.collect_count) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4 flex-wrap text-muted", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: props.Type }), props.Type === '视频' && props.Resolution && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-border", children: "\u00B7" }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: props.Resolution })] })), props.Type === '视频' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-border", children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-4xl", children: [props.VideoSize, "MB"] }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-border", children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-4xl", children: [props.VideoFPS, "Hz"] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-border", children: "\u00B7" }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: props.Region }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl text-border", children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-4xl", children: [props.ImageLength, "\u5F20"] })] }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "shrink-0", children: (0, jsx_runtime_1.jsx)(QRCodeSection, { ...props }) })] }) }));
|
|
92
|
+
};
|
|
93
|
+
const organizeReplies = (replies, rootCid, maxDepth = 6) => {
|
|
94
|
+
const map = new Map();
|
|
95
|
+
const roots = [];
|
|
96
|
+
// 第一遍:创建节点
|
|
97
|
+
replies.forEach((r) => {
|
|
98
|
+
map.set(r.cid, { ...r, children: [] });
|
|
99
|
+
});
|
|
100
|
+
// 第二遍:构建树
|
|
101
|
+
replies.forEach((r) => {
|
|
102
|
+
const node = map.get(r.cid);
|
|
103
|
+
const parentId = r.reply_to_reply_id;
|
|
104
|
+
if (parentId && map.has(parentId) && parentId !== rootCid && parentId !== '0') {
|
|
105
|
+
map.get(parentId).children.push(node);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
roots.push(node);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
// 计算深度并修剪树的函数
|
|
112
|
+
const pruneTree = (nodes, currentDepth) => {
|
|
113
|
+
if (currentDepth > maxDepth) {
|
|
114
|
+
const count = nodes.length + nodes.reduce((acc, node) => acc + countChildren(node), 0);
|
|
115
|
+
if (count > 0) {
|
|
116
|
+
return [
|
|
117
|
+
{
|
|
118
|
+
cid: `more-${Date.now()}-${Math.random()}`,
|
|
119
|
+
text: createEmptyDouyinRichText(),
|
|
120
|
+
digg_count: 0,
|
|
121
|
+
create_time: 0,
|
|
122
|
+
nickname: '',
|
|
123
|
+
userimageurl: '',
|
|
124
|
+
ip_label: '',
|
|
125
|
+
text_extra: [],
|
|
126
|
+
label_text: '',
|
|
127
|
+
image_list: null,
|
|
128
|
+
reply_to_reply_id: '',
|
|
129
|
+
reply_to_username: '',
|
|
130
|
+
children: [],
|
|
131
|
+
hiddenCount: count
|
|
132
|
+
}
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
return nodes.map((node) => {
|
|
138
|
+
node.children = pruneTree(node.children, currentDepth + 1);
|
|
139
|
+
return node;
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
const countChildren = (node) => {
|
|
143
|
+
return node.children.length + node.children.reduce((acc, child) => acc + countChildren(child), 0);
|
|
144
|
+
};
|
|
145
|
+
return pruneTree(roots, 1);
|
|
146
|
+
};
|
|
147
|
+
const ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
|
|
148
|
+
const nicknameLength = reply.nickname.length;
|
|
149
|
+
const replyToLength = reply.reply_to_username?.length || 0;
|
|
150
|
+
const isNicknameLonger = nicknameLength >= replyToLength;
|
|
151
|
+
if (reply.hiddenCount) {
|
|
152
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex relative flex-col mb-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-[100px_minmax(0,1fr)] relative", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex relative justify-center", children: [!isLast && (0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 bottom-0 left-1/2 w-0.5 bg-border -ml-px" }), !isLast && (0, jsx_runtime_1.jsx)("div", { className: "absolute -bottom-6 left-1/2 w-0.5 h-6 bg-border -ml-px" }), (0, jsx_runtime_1.jsx)("svg", { className: "absolute top-0 left-0 w-full h-12.5 pointer-events-none overflow-visible z-0 text-border", children: (0, jsx_runtime_1.jsx)("path", { d: "M 50 0 V 15 Q 50 50 85 50 H 90", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col mt-6 min-w-0", children: (0, jsx_runtime_1.jsx)("div", { className: "flex items-center h-12.5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-muted", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinMoreIcon, { size: 45, className: "mr-5" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-4xl font-medium tracking-wide", children: ["\u53E6\u5916 ", reply.hiddenCount, " \u6761\u56DE\u590D"] })] }) }) })] }) }));
|
|
153
|
+
}
|
|
154
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex relative flex-col", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-[100px_minmax(0,1fr)] relative", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex relative justify-center", children: [!isLast && (0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 bottom-0 left-1/2 w-0.5 bg-border-secondary -ml-px" }), !isLast && (0, jsx_runtime_1.jsx)("div", { className: "absolute -bottom-6 left-1/2 w-0.5 h-6 bg-border -ml-px" }), (0, jsx_runtime_1.jsx)("svg", { className: "absolute top-0 left-0 w-full h-12.5 pointer-events-none overflow-visible z-0 text-border-secondary", children: (0, jsx_runtime_1.jsx)("path", { d: "M 50 0 V 15 Q 50 50 85 50 H 90", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-[100px_minmax(0,1fr)] relative", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex relative flex-col items-center h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-25 h-25 shrink-0 z-10 relative", children: (0, jsx_runtime_1.jsx)("img", { src: reply.userimageurl, className: "object-cover rounded-full w-25 h-25 bg-background", alt: "\u7528\u6237\u5934\u50CF" }) }), reply.children.length > 0 && (0, jsx_runtime_1.jsx)("div", { className: "w-0.5 bg-border-secondary h-full grow mt-3 rounded-t-full" })] }), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)('flex flex-col pl-6 min-w-0 gap-2', isLast && reply.children.length === 0 ? 'pb-16' : 'pb-6'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-nowrap items-center content-center w-full overflow-hidden", children: [(0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)('mr-2 text-4xl font-normal text-muted', isNicknameLonger ? 'min-w-0 truncate shrink' : 'shrink-0'), children: reply.nickname }), reply.label_text !== '' && ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)('px-4 py-1 text-3xl rounded-xl mr-2', reply.label_text === '作者' ? 'bg-[#fe2c55] text-white' : 'bg-surface text-muted'), children: reply.label_text })), reply.reply_to_username && ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)('flex items-center', !isNicknameLonger ? 'overflow-hidden min-w-0 shrink' : 'shrink-0'), children: [(0, jsx_runtime_1.jsx)(react_1.PlayIcon, { weight: "fill", className: "w-7 h-auto mr-3.5 mx-1 text-muted shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)('text-4xl font-normal text-muted', !isNicknameLonger && 'truncate'), children: reply.reply_to_username })] }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-5xl text-foreground leading-normal whitespace-pre-wrap select-text", style: {
|
|
155
|
+
wordBreak: 'break-word',
|
|
156
|
+
overflowWrap: 'break-word'
|
|
157
|
+
}, children: renderDouyinCommentRichText(reply.text) }), reply.image_list &&
|
|
158
|
+
reply.image_list.length > 0 &&
|
|
159
|
+
reply.image_list.filter(Boolean).map((img, idx) => ((0, jsx_runtime_1.jsx)("div", { className: "my-4 overflow-hidden shadow-sm rounded-xl max-w-150", children: (0, jsx_runtime_1.jsx)("img", { className: "object-contain w-full h-auto rounded-xl", src: img, alt: "\u8BC4\u8BBA\u56FE\u7247" }) }, idx)))] }), (0, jsx_runtime_1.jsx)("div", { className: "pb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-6 items-center text-muted", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: formatDouyinCommentTime(reply.create_time) }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: reply.ip_label }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 40 }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl select-text", children: formatDouyinCommentDiggCount(reply.digg_count) })] })] }) })] })] }), reply.children.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "flex relative flex-col", children: (0, jsx_runtime_1.jsx)("div", { children: reply.children.map((child, index) => ((0, jsx_runtime_1.jsx)(ReplyItemComponent, { reply: child, depth: depth + 1, isLast: index === reply.children.length - 1, maxDepth: maxDepth }, child.cid))) }) }))] })] }) }));
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 单个评论组件
|
|
163
|
+
* @param props 组件属性
|
|
164
|
+
* @returns JSX元素
|
|
165
|
+
* @description Root comment component
|
|
166
|
+
*/
|
|
167
|
+
const CommentItemComponent = (props) => {
|
|
168
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)('flex flex-col px-6 pt-8', { 'pb-0': props.isLast, 'pb-10': !props.isLast }), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-[140px_minmax(0,1fr)] relative", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex relative flex-col items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-35 h-35 shrink-0 z-10 relative", children: (0, jsx_runtime_1.jsx)("img", { src: props.userimageurl, className: "w-35 h-35 rounded-full object-cover shadow-md bg-background", alt: "\u7528\u6237\u5934\u50CF" }) }), props.replyComment && props.replyComment.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "w-0.5 bg-border-secondary h-full grow mt-4 rounded-t-full" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col py-4 pl-6 min-w-0 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-4 items-center mb-3 text-4xl select-text content-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-normal text-muted", children: props.nickname }), props.label_type === 1 && ((0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-1 rounded-lg text-3xl bg-[#fe2c55] text-white", children: "\u4F5C\u8005" })), props.is_author_digged && props.status_label !== '作者赞过' && ((0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-1 text-3xl font-light rounded-lg bg-surface-secondary text-foreground/80", children: "\u4F5C\u8005\u8D5E\u8FC7" })), props.status_label && ((0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-1 text-3xl font-light rounded-lg bg-surface-secondary text-foreground/80", children: props.status_label }))] }), (0, jsx_runtime_1.jsx)("div", { className: "text-5xl text-foreground leading-normal whitespace-pre-wrap select-text", style: {
|
|
169
|
+
wordBreak: 'break-word',
|
|
170
|
+
overflowWrap: 'break-word'
|
|
171
|
+
}, children: renderDouyinCommentRichText(props.text) }), (props.commentimage || props.sticker) && ((0, jsx_runtime_1.jsx)("div", { className: "my-6 overflow-hidden shadow-sm rounded-2xl max-w-200", children: (0, jsx_runtime_1.jsx)("img", { className: "object-contain w-full h-auto rounded-2xl", src: props.commentimage || props.sticker, alt: "\u8BC4\u8BBA\u56FE\u7247" }) })), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-between items-center text-muted", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-6 items-center shrink-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: formatDouyinCommentTime(props.create_time) }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl", children: props.ip_label }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center transition-colors cursor-pointer", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 44 }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl select-text", children: formatDouyinCommentDiggCount(props.digg_count) })] })] }) })] })] }), props.replyComment && props.replyComment.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex relative flex-col mt-8 ml-5", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -top-8 left-12.5 w-0.5 h-8 bg-border-secondary -ml-px" }), organizeReplies(props.replyComment, props.cid || '', props.maxDepth).map((reply, index, arr) => ((0, jsx_runtime_1.jsx)(ReplyItemComponent, { reply: reply, depth: 1, isLast: index === arr.length - 1, maxDepth: props.maxDepth }, reply.cid)))] }))] }) }));
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* 抖音评论组件
|
|
175
|
+
* @param props 组件属性
|
|
176
|
+
* @returns JSX元素
|
|
177
|
+
*/
|
|
178
|
+
exports.DouyinComment = react_2.default.memo((props) => {
|
|
179
|
+
// 随机选择一个搜索词
|
|
180
|
+
const randomSuggestWord = () => {
|
|
181
|
+
if (props.data.suggestWrod && props.data.suggestWrod.length > 0) {
|
|
182
|
+
const randomIndex = Math.floor(Math.random() * props.data.suggestWrod.length);
|
|
183
|
+
return props.data.suggestWrod[randomIndex];
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
};
|
|
187
|
+
return ((0, jsx_runtime_1.jsx)(DefaultLayout_1.DefaultLayout, { ...props, children: (0, jsx_runtime_1.jsxs)("div", { className: "p-5 px-15", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-20" }), (0, jsx_runtime_1.jsx)(VideoInfoHeader, { ...props.data, useDarkTheme: (0, theme_1.isDark)(props.ctx) }), randomSuggestWord() && ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto my-20 mb-5 ml-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3 items-center px-6 py-4 rounded-2xl", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-5xl text-muted", children: "\u5927\u5BB6\u90FD\u5728\u641C\uFF1A" }), (0, jsx_runtime_1.jsxs)("span", { className: "relative text-5xl text-[#04498d] dark:text-[#face15]", children: [randomSuggestWord(), (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { size: 32, className: "absolute -top-2 -right-8" })] })] }) })), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden mt-8", children: props.data.CommentsData.length > 0 ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props.data.CommentsData.map((comment, index) => ((0, jsx_runtime_1.jsx)(CommentItemComponent, { ...comment, isLast: index === props.data.CommentsData.length - 1, maxDepth: props.data.maxDepth }, comment.cid || index))) })) : ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center items-center py-20 text-muted", children: (0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-xl", children: "\u6682\u65E0\u8BC4\u8BBA\u6570\u636E" }) }) })) })] }) }));
|
|
188
|
+
});
|
|
189
|
+
exports.default = exports.DouyinComment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_react_1 = require("../../../../compat/template-react.js");
|
|
4
|
+
const Comment_1 = require("./components/Comment");
|
|
5
|
+
exports.default = (0, template_react_1.defineTemplate)({
|
|
6
|
+
name: '评论列表',
|
|
7
|
+
description: '抖音评论列表展示模板',
|
|
8
|
+
component: Comment_1.DouyinComment,
|
|
9
|
+
validate: (data) => typeof data === 'object' && data !== null && typeof data.share_url === 'string'
|
|
10
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DouyinMoreIcon = exports.DouyinRecommendIcon = exports.DouyinShareIcon = exports.DouyinFavoriteIcon = exports.DouyinCommentIcon = exports.DouyinLikeIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const svgProps = (size, { weight: _weight, ...props }) => ({
|
|
6
|
+
width: size,
|
|
7
|
+
height: size,
|
|
8
|
+
fill: 'none',
|
|
9
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
/** 抖音官方点赞图标,提取自 packages/template/icon.html。 */
|
|
13
|
+
const DouyinLikeIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 891 816", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M453.036 88.712C493.774 30.664 560.66 0 634.251 0 774.403 0 890.972 121.59 890.972 266.137v.054c.01-.02.019-.04.028-.06 0 4.121-.07 7.241-.122 9.537-.072 3.151-.108 4.747.122 5.247-.531 30.403-5.778 55.522-15.101 88.712-5.289 5.96-10.204 17.184-15.1 29.572-7.724 11.998-10.647 17.81-15.101 29.57a546.67 546.67 0 0 1-14.452 22.974c-37.449 56.8-87.537 113.33-137.579 163.509-78.331 79.025-158.123 144.805-192.835 173.422-9.585 7.901-15.732 12.969-17.464 14.7-12.301 12.303-24.603 12.611-36.905 12.619-.324.004-.649.006-.977.006-25.236 0-37.854-12.619-50.472-25.237-.963-.963-3.413-2.984-7.156-5.979-38.233-28.184-124.273-96.997-205.116-180C121.066 542.02 61.622 470.007 29.092 399.588 16.474 374.351.731 314.264 0 280.922c.269-.267.227-1.873.144-5.078C.083 273.498 0 270.297 0 266.137 0 121.524 116.502 0 256.721 0c73.458 0 140.405 30.664 196.315 88.712Z" }) }));
|
|
14
|
+
exports.DouyinLikeIcon = DouyinLikeIcon;
|
|
15
|
+
/** 抖音官方评论图标,提取自 packages/template/icon.html。 */
|
|
16
|
+
const DouyinCommentIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "-24.75 -11.25 22.5 22.31", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: " M-4.644999980926514,4.482999801635742 C-7.25,7.818999767303467 -13.482000350952148,8.300000190734863 -13.482000350952148,8.300000190734863 C-13.482000350952148,8.300000190734863 -14.413999557495117,11.48799991607666 -12.135000228881836,10.821000099182129 C-9.855999946594238,10.154000282287598 -7.25,8.152000427246094 -4.644999980926514,4.482999801635742z M-17.36,-1.04 C-17.36,-0.16 -18.07,0.56 -18.96,0.56 C-18.96,0.56 -18.96,0.56 -18.96,0.56 C-19.85,0.56 -20.57,-0.16 -20.57,-1.04 C-20.57,-1.92 -19.85,-2.64 -18.96,-2.64 C-18.07,-2.64 -17.36,-1.92 -17.36,-1.04z M-11.89,-1.04 C-11.89,-0.16 -12.61,0.56 -13.5,0.56 C-13.5,0.56 -13.5,0.56 -13.5,0.56 C-14.39,0.56 -15.11,-0.16 -15.11,-1.04 C-15.11,-1.92 -14.39,-2.64 -13.5,-2.64 C-12.61,-2.64 -11.89,-1.92 -11.89,-1.04z M-6.43,-1.04 C-6.43,-0.16 -7.15,0.56 -8.04,0.56 C-8.04,0.56 -8.04,0.56 -8.04,0.56 C-8.92,0.56 -9.64,-0.16 -9.64,-1.04 C-9.64,-1.92 -8.92,-2.64 -8.04,-2.64 C-7.15,-2.64 -6.43,-1.92 -6.43,-1.04z M-5.79,5.98 C-3.56,3.75 -2.25,1.42 -2.25,-1.29 C-2.25,-6.79 -7.29,-11.25 -13.5,-11.25 C-19.71,-11.25 -24.75,-6.79 -24.75,-1.29 C-24.75,4.21 -19.55,7.99 -13.34,7.99 C-13.34,7.99 -13.34,11.06 -13.34,11.06 C-13.34,11.06 -8.51,8.72 -5.79,5.98z" }) }));
|
|
17
|
+
exports.DouyinCommentIcon = DouyinCommentIcon;
|
|
18
|
+
/** 抖音官方收藏图标,提取自 packages/template/icon.html。 */
|
|
19
|
+
const DouyinFavoriteIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "-2.285 -1.439 104.57 99.703", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M43.79199981689453,4.316999912261963 C45.93899917602539,-1.4390000104904175 54.06100082397461,-1.4390000104904175 56.20800018310547,4.316999912261963 C56.20800018310547,4.316999912261963 65.927001953125,30.375 65.927001953125,30.375 C65.927001953125,30.375 93.6510009765625,31.59000015258789 93.6510009765625,31.59000015258789 C99.7750015258789,31.857999801635742 102.28500366210938,39.60200119018555 97.48799896240234,43.428001403808594 C97.48799896240234,43.428001403808594 75.77100372314453,60.74700164794922 75.77100372314453,60.74700164794922 C75.77100372314453,60.74700164794922 83.18599700927734,87.55599975585938 83.18599700927734,87.55599975585938 C84.8239974975586,93.47799682617188 78.25299835205078,98.26399993896484 73.14099884033203,94.87200164794922 C73.14099884033203,94.87200164794922 50,79.51799774169922 50,79.51799774169922 C50,79.51799774169922 26.858999252319336,94.87200164794922 26.858999252319336,94.87200164794922 C21.746999740600586,98.26399993896484 15.175999641418457,93.47799682617188 16.81399917602539,87.55599975585938 C16.81399917602539,87.55599975585938 24.229000091552734,60.74700164794922 24.229000091552734,60.74700164794922 C24.229000091552734,60.74700164794922 2.51200008392334,43.428001403808594 2.51200008392334,43.428001403808594 C-2.2850000858306885,39.60200119018555 0.22499999403953552,31.857999801635742 6.348999977111816,31.59000015258789 C6.348999977111816,31.59000015258789 34.073001861572266,30.375 34.073001861572266,30.375 C34.073001861572266,30.375 43.79199981689453,4.316999912261963 43.79199981689453,4.316999912261963z" }) }));
|
|
20
|
+
exports.DouyinFavoriteIcon = DouyinFavoriteIcon;
|
|
21
|
+
/** 抖音官方分享图标,提取自 packages/template/icon.html。 */
|
|
22
|
+
const DouyinShareIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "-13.517 -10.558 25.734 22.375", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M.815 4.762V-4.93s-6.033-.564-10.06 3.755c-4.027 4.319-4.272 12.992-1.597 8.919C-8.062 3.511.815 4.762.815 4.762Zm9.699-1.767c1.655-1.461 1.703-3.887.107-5.413L3.706-9.032C2.11-10.558.815-10.264.815-8.375v3.421c.009 6.839 0 6.039 0 6.039 0 2.208 0 5.452 0 7.24 0 1.788 1.343 2.053 2.998.591l6.701-5.921Z" }) }));
|
|
23
|
+
exports.DouyinShareIcon = DouyinShareIcon;
|
|
24
|
+
/** 抖音官方推荐图标。 */
|
|
25
|
+
const DouyinRecommendIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 27 27", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M18.544 22.86H8.42V9.697l5.821-5.821a1.79 1.79 0 0 1 2.531 0c.118.118.215.278.291.48.076.203.114.397.114.583v.354l-1.114 4.404h5.518c.54 0 1.012.203 1.417.608.405.405.608.877.608 1.417v2.025a2.059 2.059 0 0 1-.152.759l-3.037 7.137c-.152.338-.405.625-.76.861a1.978 1.978 0 0 1-1.113.354ZM6.79 9.697V22.86H4.366a1.625 1.625 0 0 1-1.625-1.625v-9.91c0-.898.728-1.626 1.625-1.626H6.79Z" }) }));
|
|
26
|
+
exports.DouyinRecommendIcon = DouyinRecommendIcon;
|
|
27
|
+
/** 抖音官方更多图标,提取自 packages/template/icon.html。 */
|
|
28
|
+
const DouyinMoreIcon = ({ size = 36, ...props }) => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 36 36", ...svgProps(size, props), children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M13.556 17.778a1.778 1.778 0 1 1-3.556 0 1.778 1.778 0 0 1 3.556 0Zm6.222 0a1.778 1.778 0 1 1-3.556 0 1.778 1.778 0 0 1 3.556 0Zm4.444 1.778a1.778 1.778 0 1 0 0-3.556 1.778 1.778 0 0 0 0 3.556Z" }) }));
|
|
29
|
+
exports.DouyinMoreIcon = DouyinMoreIcon;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DouyinDynamic = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const date_fns_1 = require("date-fns");
|
|
9
|
+
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
11
|
+
const theme_1 = require("../../../../utils/theme");
|
|
12
|
+
const DefaultLayout_1 = require("../../../components/DefaultLayout");
|
|
13
|
+
const QRCodeWithAvatar_1 = require("../../../components/QRCodeWithAvatar");
|
|
14
|
+
const Icons_1 = require("../../components/Icons");
|
|
15
|
+
/**
|
|
16
|
+
* 抖音Logo头部组件
|
|
17
|
+
* @param props 组件属性
|
|
18
|
+
* @returns JSX元素
|
|
19
|
+
*/
|
|
20
|
+
const DouyinHeader = ({ useDarkTheme }) => {
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center px-12 py-15", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-[39%] h-50 bg-cover bg-center bg-fixed", children: (0, jsx_runtime_1.jsx)("img", { src: useDarkTheme ? '/image/douyin/dylogo-light.svg' : '/image/douyin/dylogo-dark.svg', alt: "\u6296\u97F3Logo", className: "object-contain w-full h-full" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[65px] ml-4 text-foreground/70", children: "\u8BB0\u5F55\u7F8E\u597D\u751F\u6D3B" })] }));
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 作品封面组件
|
|
25
|
+
* @param props 组件属性
|
|
26
|
+
* @returns JSX元素
|
|
27
|
+
*/
|
|
28
|
+
const CoverSection = ({ imageUrl }) => {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-center my-5", children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-center overflow-hidden shadow-large rounded-[25px] w-[90%] relative", children: (0, jsx_runtime_1.jsx)("img", { className: "rounded-[25px] object-contain w-full h-full", src: imageUrl, alt: "\u5C01\u9762" }) }) }));
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 作品信息组件
|
|
33
|
+
* @param props 组件属性
|
|
34
|
+
* @returns JSX元素
|
|
35
|
+
*/
|
|
36
|
+
const InfoSection = (props) => {
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col px-16 py-5", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[70px] font-bold leading-relaxed mb-9 text-foreground select-text", style: { letterSpacing: '1.5px', wordWrap: 'break-word' }, dangerouslySetInnerHTML: { __html: props.data.desc } }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-6 text-[45px] text-muted font-light mb-2.5 select-text", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 44 }), (0, jsx_runtime_1.jsxs)("span", { children: [props.data.dianzan, "\u70B9\u8D5E"] })] }), (0, jsx_runtime_1.jsx)("span", { children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinCommentIcon, { size: 44 }), (0, jsx_runtime_1.jsxs)("span", { children: [props.data.pinglun, "\u8BC4\u8BBA"] })] }), (0, jsx_runtime_1.jsx)("span", { children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinFavoriteIcon, { size: 44 }), (0, jsx_runtime_1.jsxs)("span", { children: [props.data.shouchang, "\u6536\u85CF"] })] }), (0, jsx_runtime_1.jsx)("span", { children: "\u00B7" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinShareIcon, { size: 44 }), (0, jsx_runtime_1.jsxs)("span", { children: [props.data.share, "\u5206\u4EAB"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-[45px] text-muted font-light select-text", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-11 h-11 text-muted" }), (0, jsx_runtime_1.jsxs)("span", { children: ["\u53D1\u5E03\u4E8E: ", props.data.create_time] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-[45px] text-muted font-light select-text", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, { className: "w-11 h-11 text-muted" }), (0, jsx_runtime_1.jsxs)("span", { children: ["\u56FE\u7247\u751F\u6210\u4E8E: ", (0, date_fns_1.format)(new Date(), 'yyyy-MM-dd HH:mm:ss')] })] })] }));
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* 用户信息组件
|
|
41
|
+
* @param props 组件属性
|
|
42
|
+
* @returns JSX元素
|
|
43
|
+
*/
|
|
44
|
+
const UserInfoSection = (props) => {
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-12", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-12 items-start", children: [(0, jsx_runtime_1.jsx)("div", { className: "relative shrink-0", children: (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center items-center bg-white rounded-full w-35 h-35", children: (0, jsx_runtime_1.jsx)("img", { src: props.data.avater_url, alt: "\u5934\u50CF", className: "rounded-full w-33 h-33 shadow-large" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-7xl font-bold select-text text-foreground", children: ["@", props.data.username] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-center text-4xl text-muted", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Hash, { size: 32, className: "text-muted" }), (0, jsx_runtime_1.jsxs)("span", { className: "select-text", children: ["\u6296\u97F3\u53F7: ", props.data.抖音号] })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl flex gap-6 items-center text-foreground/70", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1 items-start px-6 py-3 rounded-2xl bg-surface", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 items-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 28 }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted", children: "\u83B7\u8D5E" })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-px bg-border" }), (0, jsx_runtime_1.jsx)("span", { className: "select-text font-medium text-4xl", children: props.data.获赞 })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1 items-start px-6 py-3 rounded-2xl bg-surface", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 items-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { size: 28, className: "text-view" }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted", children: "\u5173\u6CE8" })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-px bg-border" }), (0, jsx_runtime_1.jsx)("span", { className: "select-text font-medium text-4xl", children: props.data.关注 })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1 items-start px-6 py-3 rounded-2xl bg-surface", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 items-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { size: 28, className: "text-accent" }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted", children: "\u7C89\u4E1D" })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-px bg-border" }), (0, jsx_runtime_1.jsx)("span", { className: "select-text font-medium text-4xl", children: props.data.粉丝 })] })] })] }));
|
|
46
|
+
};
|
|
47
|
+
/** 共创者信息 */
|
|
48
|
+
const CoCreatorsInfo = ({ info }) => {
|
|
49
|
+
const creators = info?.co_creators ?? [];
|
|
50
|
+
if (creators.length === 0)
|
|
51
|
+
return null;
|
|
52
|
+
const items = creators.slice(0, 50);
|
|
53
|
+
// 根据容器宽度,计算可显示的条目数;剩余用省略占位符
|
|
54
|
+
const listRef = react_1.default.useRef(null);
|
|
55
|
+
const [visibleCount, setVisibleCount] = react_1.default.useState(items.length);
|
|
56
|
+
react_1.default.useEffect(() => {
|
|
57
|
+
const calc = () => {
|
|
58
|
+
const el = listRef.current;
|
|
59
|
+
if (!el)
|
|
60
|
+
return;
|
|
61
|
+
const containerWidth = el.offsetWidth;
|
|
62
|
+
// 每项实际宽度约152px(头像w-38),间距gap-8=32px,右内边距pr-2=8px
|
|
63
|
+
const ITEM_W = 152;
|
|
64
|
+
const GAP = 32;
|
|
65
|
+
const PAD_R = 8;
|
|
66
|
+
const capacity = Math.floor((containerWidth - PAD_R) / (ITEM_W + GAP));
|
|
67
|
+
const needEllipsis = items.length > capacity;
|
|
68
|
+
const nextVisible = needEllipsis ? Math.max(0, capacity - 1) : items.length;
|
|
69
|
+
setVisibleCount(nextVisible);
|
|
70
|
+
};
|
|
71
|
+
calc();
|
|
72
|
+
window.addEventListener('resize', calc);
|
|
73
|
+
return () => window.removeEventListener('resize', calc);
|
|
74
|
+
}, [items.length]);
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col pl-16 w-full", children: (0, jsx_runtime_1.jsxs)("div", { ref: listRef, className: "flex overflow-hidden gap-8 py-1 pr-2 w-full", style: { scrollbarWidth: 'thin' }, children: [items.slice(0, visibleCount).map((c, idx) => {
|
|
76
|
+
const avatar = c.avatar_url;
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center min-w-38 w-38 shrink-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center items-center bg-white rounded-full w-30 h-30", children: (0, jsx_runtime_1.jsx)("img", { src: avatar, alt: "\u5171\u521B\u8005\u5934\u50CF", className: "object-cover w-28 h-auto rounded-full" }) }), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground/80", children: c.nickname || '未提供' }), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-foreground/70", children: c.role_title || '未提供' })] }, `${c.nickname || 'creator'}-${idx}`));
|
|
78
|
+
}), items.length > visibleCount && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center min-w-38 w-38 shrink-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center items-center rounded-full bg-surface-secondary w-38 h-38", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[42px] leading-none text-muted", children: "\u00B7\u00B7\u00B7" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground/80", children: ["\u8FD8\u6709", items.length - visibleCount, "\u4EBA"] }), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-foreground/70", children: "\u5171\u521B" })] }))] }) }));
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* 抖音动态组件
|
|
82
|
+
* @param props 组件属性
|
|
83
|
+
* @returns JSX元素
|
|
84
|
+
*/
|
|
85
|
+
const DouyinDynamic = (props) => {
|
|
86
|
+
const coCreatorCount = props.data.cooperation_info?.co_creator_nums ?? props.data.cooperation_info?.co_creators?.length ?? undefined;
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(DefaultLayout_1.DefaultLayout, { ...props, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "h-15" }), (0, jsx_runtime_1.jsx)(DouyinHeader, { useDarkTheme: (0, theme_1.isDark)(props.ctx) }), (0, jsx_runtime_1.jsx)("div", { className: "h-15" }), (0, jsx_runtime_1.jsx)(CoverSection, { imageUrl: props.data.image_url }), (0, jsx_runtime_1.jsx)("div", { className: "h-5" }), (0, jsx_runtime_1.jsx)(InfoSection, { ...props }), (0, jsx_runtime_1.jsx)("div", { className: "h-25" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-10 px-0 pt-25", children: [(0, jsx_runtime_1.jsxs)("div", { className: "w-full", children: [coCreatorCount && coCreatorCount > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "px-16 pb-8", children: (0, jsx_runtime_1.jsxs)("div", { className: "gap-2 inline-flex items-center rounded-2xl bg-surface text-foreground/80 px-6 py-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-7 h-7" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-3xl font-medium leading-none select-text text-foreground/80", children: [coCreatorCount, "\u4EBA\u5171\u521B"] })] }) })), (0, jsx_runtime_1.jsx)(CoCreatorsInfo, { info: props.data.cooperation_info })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start px-20 pb-20", children: [(0, jsx_runtime_1.jsx)(UserInfoSection, { ...props }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-center gap-4", children: (0, jsx_runtime_1.jsx)(QRCodeWithAvatar_1.QRCodeWithAvatar, { value: props.data.share_url, avatarUrl: props.data.avater_url, useDarkTheme: (0, theme_1.isDark)(props.ctx), alt: "\u4E8C\u7EF4\u7801", className: "h-auto w-75 rounded-xl" }) })] })] })] }) }));
|
|
88
|
+
};
|
|
89
|
+
exports.DouyinDynamic = DouyinDynamic;
|
|
90
|
+
exports.default = exports.DouyinDynamic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_react_1 = require("../../../../compat/template-react.js");
|
|
4
|
+
const Dynamic_1 = require("./components/Dynamic");
|
|
5
|
+
exports.default = (0, template_react_1.defineTemplate)({
|
|
6
|
+
name: '作品列表',
|
|
7
|
+
description: '抖音作品列表推送模板',
|
|
8
|
+
component: Dynamic_1.DouyinDynamic,
|
|
9
|
+
validate: (data) => typeof data === 'object' && data !== null && typeof data.share_url === 'string'
|
|
10
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DouyinFavoriteList = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const date_fns_1 = require("date-fns");
|
|
6
|
+
const lucide_react_1 = require("lucide-react");
|
|
7
|
+
const theme_1 = require("../../../../utils/theme");
|
|
8
|
+
const DefaultLayout_1 = require("../../../components/DefaultLayout");
|
|
9
|
+
const QRCodeWithAvatar_1 = require("../../../components/QRCodeWithAvatar");
|
|
10
|
+
const Icons_1 = require("../../components/Icons");
|
|
11
|
+
/**
|
|
12
|
+
* 抖音喜欢列表组件
|
|
13
|
+
*/
|
|
14
|
+
const DouyinFavoriteList = (props) => {
|
|
15
|
+
const dark = (0, theme_1.isDark)(props.ctx);
|
|
16
|
+
// 弥散光颜色配置
|
|
17
|
+
const glowColors = dark
|
|
18
|
+
? {
|
|
19
|
+
primary: 'rgba(225, 29, 72, 0.15)', // Rose-600 (Lower opacity)
|
|
20
|
+
secondary: 'rgba(20, 184, 166, 0.15)' // Teal-500 (Complementary)
|
|
21
|
+
}
|
|
22
|
+
: {
|
|
23
|
+
primary: 'rgba(244, 63, 94, 0.25)', // Rose-500
|
|
24
|
+
secondary: 'rgba(20, 184, 166, 0.2)' // Teal-400
|
|
25
|
+
};
|
|
26
|
+
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-full h-[60%] top-[-20%] left-[-20%] blur-[150px]", style: { background: glowColors.primary } }), (0, jsx_runtime_1.jsx)("div", { className: "absolute rounded-full w-full h-[60%] bottom-[-20%] right-[-20%] blur-[180px]", style: { background: glowColors.secondary } })] }), (0, jsx_runtime_1.jsx)("div", { className: 'absolute inset-0 pointer-events-none z-10 mix-blend-overlay', 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: "noiseFilter", children: [(0, jsx_runtime_1.jsx)("feTurbulence", { type: "fractalNoise", baseFrequency: "0.8", numOctaves: "3", stitchTiles: "stitch" }), (0, jsx_runtime_1.jsx)("feColorMatrix", { type: "saturate", values: "0" })] }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", filter: "url(#noiseFilter)" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative z-20 p-12 pb-0 grid grid-cols-12 gap-12 min-h-150 items-stretch", children: [(0, jsx_runtime_1.jsxs)("div", { className: "col-span-4 flex flex-col justify-between py-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1 select-none", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-6xl font-black text-foreground/10 tracking-tighter leading-none", children: "LIKE" }), (0, jsx_runtime_1.jsx)("span", { className: "text-6xl font-black text-rose-500/20 tracking-tighter leading-none", children: "FAVORITE" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mt-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-1.5 w-16 bg-rose-500 rounded-full" }), (0, jsx_runtime_1.jsx)("span", { className: "text-base text-muted font-mono tracking-widest uppercase", children: "Push Notification" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-10 relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -left-8 top-10 w-16 h-16 rounded-full border-4 border-rose-300/30 animate-[bounce_4s_infinite]" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute right-10 -top-4 w-6 h-6 rounded-full bg-orange-300/40" }), (0, jsx_runtime_1.jsxs)("div", { className: "relative w-fit self-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute -inset-8 bg-linear-to-br from-rose-400 to-orange-400 rounded-full blur-2xl opacity-40 animate-pulse" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute -inset-4 rounded-full border-2 border-dashed border-rose-400/30 animate-[spin_10s_linear_infinite]" }), (0, jsx_runtime_1.jsx)("img", { src: props.data.liker_avatar, className: "relative w-64 h-64 rounded-full border-[6px] border-white object-cover shadow-2xl", alt: "Liker" }), (0, jsx_runtime_1.jsxs)("div", { className: "absolute -bottom-3 -right-3 bg-rose-500 text-white px-5 py-2 rounded-full border-[5px] border-white font-bold text-xl shadow-xl flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 20 }), (0, jsx_runtime_1.jsx)("span", { children: "\u8D5E\u4E86" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center text-center", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-6xl font-black text-foreground leading-tight relative", children: [props.data.liker_username, (0, jsx_runtime_1.jsx)("svg", { className: "absolute -right-8 -top-2 text-orange-400 w-8 h-8 opacity-60", viewBox: "0 0 24 24", fill: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { d: "M12 2l2.4 7.2h7.6l-6 4.8 2.4 7.2-6-4.8-6 4.8 2.4-7.2-6-4.8h7.6z" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "px-6 py-6 pt-0 rounded-full text-3xl text-muted font-mono", children: ["@", props.data.liker_douyin_id] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-6 flex flex-col items-center gap-2 text-rose-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Icons_1.DouyinLikeIcon, { size: 40 }), (0, jsx_runtime_1.jsx)("span", { className: "text-4xl font-bold", children: "\u521A\u521A\u8D5E\u4E86\u8FD9\u4E2A\u4F5C\u54C1" })] }), (0, jsx_runtime_1.jsx)("svg", { width: "200", height: "20", viewBox: "0 0 200 20", className: "opacity-60", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 10 Q 50 20, 100 10 T 200 10", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeLinecap: "round" }) })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-8 relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute left-4 bottom-4 w-32 h-32 bg-rose-500/5 rounded-2xl -z-10 rotate-12" }), (0, jsx_runtime_1.jsx)("div", { className: "h-px w-full bg-linear-to-r from-surface-secondary via-border to-transparent" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-end gap-6", children: [(0, jsx_runtime_1.jsx)(QRCodeWithAvatar_1.QRCodeWithAvatar, { value: props.data.share_url, avatarUrl: props.data.author_avatar, useDarkTheme: dark, className: "w-65 h-auto rounded-2xl mix-blend-multiply", alt: "QR" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col justify-end h-56 pb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-muted text-sm font-mono mb-2", children: "SCAN TO VIEW" }), (0, jsx_runtime_1.jsx)("span", { className: "text-3xl font-bold text-foreground/80 leading-none", children: (0, date_fns_1.format)(new Date(), 'HH:mm') }), (0, jsx_runtime_1.jsx)("span", { className: "text-lg text-muted font-medium", children: (0, date_fns_1.format)(new Date(), 'yyyy.MM.dd') })] })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-8 h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full bg-surface/60 backdrop-blur-xl rounded-[3rem] p-10 border border-border flex flex-col gap-8 shadow-2xl relative overflow-hidden", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between z-10", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-6 flex-1 min-w-0 mr-6", children: [(0, jsx_runtime_1.jsx)("img", { src: props.data.author_avatar, className: "w-24 h-24 rounded-full border-2 border-surface shadow-md shrink-0", alt: "Author" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-4xl font-bold text-foreground/90 truncate", title: props.data.author_username, children: props.data.author_username }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xl text-muted font-mono truncate", children: ["\u6296\u97F3\u53F7: ", props.data.author_douyin_id] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "px-6 py-3 bg-surface/80 backdrop-blur-md rounded-full text-muted font-medium text-lg shrink-0", children: ["\u53D1\u5E03\u4E8E ", props.data.create_time.split(' ')[0]] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 relative rounded-[2.5rem] overflow-hidden group shadow-inner bg-black/5", children: [(0, jsx_runtime_1.jsx)("img", { src: props.data.image_url, className: "w-full h-full object-cover transition-transform duration-700", alt: "Cover" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-x-0 bottom-0 pt-40 pb-12 px-12 bg-linear-to-t from-black/90 via-black/50 to-transparent", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-6 items-start", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Quote, { size: 48, className: "text-rose-500/90 shrink-0 rotate-180 mt-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-4xl font-medium leading-relaxed line-clamp-3 drop-shadow-lg tracking-wide", dangerouslySetInnerHTML: { __html: props.data.desc || '分享视频' } })] }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-5 gap-6 z-10", children: [(0, jsx_runtime_1.jsx)(StatItem, { icon: Icons_1.DouyinLikeIcon, value: props.data.dianzan, iconColor: "#FE2C55" }), (0, jsx_runtime_1.jsx)(StatItem, { icon: Icons_1.DouyinRecommendIcon, value: props.data.tuijian }), (0, jsx_runtime_1.jsx)(StatItem, { icon: Icons_1.DouyinCommentIcon, value: props.data.pinglun }), (0, jsx_runtime_1.jsx)(StatItem, { icon: Icons_1.DouyinFavoriteIcon, value: props.data.shouchang }), (0, jsx_runtime_1.jsx)(StatItem, { icon: Icons_1.DouyinShareIcon, value: props.data.share })] })] }) })] })] }));
|
|
27
|
+
};
|
|
28
|
+
exports.DouyinFavoriteList = DouyinFavoriteList;
|
|
29
|
+
/** 统计项小组件 */
|
|
30
|
+
const StatItem = ({ icon: IconComponent, value, iconColor }) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center gap-2 py-6 rounded-3xl bg-surface", children: [(0, jsx_runtime_1.jsx)(IconComponent, { size: 48, color: iconColor, className: "opacity-90" }), (0, jsx_runtime_1.jsx)("span", { className: "text-2xl font-bold text-foreground/70 mt-1", children: value })] }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_react_1 = require("../../../../compat/template-react.js");
|
|
4
|
+
const FavoriteList_1 = require("./components/FavoriteList");
|
|
5
|
+
exports.default = (0, template_react_1.defineTemplate)({
|
|
6
|
+
name: '喜欢列表',
|
|
7
|
+
description: '抖音喜欢列表推送模板',
|
|
8
|
+
component: FavoriteList_1.DouyinFavoriteList,
|
|
9
|
+
validate: (data) => typeof data === 'object' && data !== null && typeof data.share_url === 'string'
|
|
10
|
+
});
|