yz-yuki-plugin 1.0.1-rc.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.
Files changed (124) hide show
  1. package/.puppeteerrc.cjs +4 -0
  2. package/CHANGELOG.md +7 -0
  3. package/LICENSE +21 -0
  4. package/README.md +195 -0
  5. package/defaultConfig/bilibili/config.yaml +41 -0
  6. package/defaultConfig/bilibili/push.yaml +0 -0
  7. package/defaultConfig/help/help.yaml +86 -0
  8. package/defaultConfig/weibo/config.yaml +41 -0
  9. package/defaultConfig/weibo/push.yaml +0 -0
  10. package/lib/apps/bilibili.js +402 -0
  11. package/lib/apps/help.js +37 -0
  12. package/lib/apps/index.js +4 -0
  13. package/lib/apps/version.js +34 -0
  14. package/lib/apps/weibo.js +252 -0
  15. package/lib/components/dynamic/Account.js +26 -0
  16. package/lib/components/dynamic/Content.js +118 -0
  17. package/lib/components/dynamic/Footer.js +36 -0
  18. package/lib/components/dynamic/ForwardContent.js +15 -0
  19. package/lib/components/dynamic/LogoText.js +10 -0
  20. package/lib/components/dynamic/MainPage.js +22 -0
  21. package/lib/components/help/Help.js +33 -0
  22. package/lib/components/index.js +6 -0
  23. package/lib/components/loginQrcode/Page.js +21 -0
  24. package/lib/components/version/Version.js +27 -0
  25. package/lib/index.js +29 -0
  26. package/lib/models/bilibili/bilibili.api.js +49 -0
  27. package/lib/models/bilibili/bilibili.get.web.data.js +80 -0
  28. package/lib/models/bilibili/bilibili.models.js +484 -0
  29. package/lib/models/bilibili/bilibili.query.js +393 -0
  30. package/lib/models/bilibili/bilibili.task.js +256 -0
  31. package/lib/models/bilibili/bilibili.wbi.js +49 -0
  32. package/lib/models/help/help.js +20 -0
  33. package/lib/models/version/version.js +62 -0
  34. package/lib/models/weibo/weibo.api.js +19 -0
  35. package/lib/models/weibo/weibo.get.web.data.js +55 -0
  36. package/lib/models/weibo/weibo.query.js +323 -0
  37. package/lib/models/weibo/weibo.task.js +215 -0
  38. package/lib/types/apps/bilibili.d.ts +6 -0
  39. package/lib/types/apps/help.d.ts +6 -0
  40. package/lib/types/apps/index.d.ts +4 -0
  41. package/lib/types/apps/version.d.ts +6 -0
  42. package/lib/types/apps/weibo.d.ts +6 -0
  43. package/lib/types/components/dynamic/Account.d.ts +13 -0
  44. package/lib/types/components/dynamic/Content.d.ts +12 -0
  45. package/lib/types/components/dynamic/Footer.d.ts +11 -0
  46. package/lib/types/components/dynamic/ForwardContent.d.ts +6 -0
  47. package/lib/types/components/dynamic/LogoText.d.ts +9 -0
  48. package/lib/types/components/dynamic/MainPage.d.ts +34 -0
  49. package/lib/types/components/help/Help.d.ts +12 -0
  50. package/lib/types/components/index.d.ts +5 -0
  51. package/lib/types/components/loginQrcode/Page.d.ts +7 -0
  52. package/lib/types/components/version/Version.d.ts +8 -0
  53. package/lib/types/index.d.ts +5 -0
  54. package/lib/types/models/bilibili/bilibili.api.d.ts +47 -0
  55. package/lib/types/models/bilibili/bilibili.buid.fp.d.ts +2 -0
  56. package/lib/types/models/bilibili/bilibili.get.web.data.d.ts +6 -0
  57. package/lib/types/models/bilibili/bilibili.models.d.ts +20 -0
  58. package/lib/types/models/bilibili/bilibili.query.d.ts +13 -0
  59. package/lib/types/models/bilibili/bilibili.task.d.ts +18 -0
  60. package/lib/types/models/bilibili/bilibili.wbi.d.ts +5 -0
  61. package/lib/types/models/help/help.d.ts +8 -0
  62. package/lib/types/models/version/version.d.ts +7 -0
  63. package/lib/types/models/weibo/weibo.api.d.ts +17 -0
  64. package/lib/types/models/weibo/weibo.get.web.data.d.ts +8 -0
  65. package/lib/types/models/weibo/weibo.query.d.ts +18 -0
  66. package/lib/types/models/weibo/weibo.task.d.ts +17 -0
  67. package/lib/types/utils/config.d.ts +21 -0
  68. package/lib/types/utils/image.d.ts +10 -0
  69. package/lib/types/utils/paths.d.ts +10 -0
  70. package/lib/types/utils/puppeteer.render.d.ts +23 -0
  71. package/lib/utils/config.js +108 -0
  72. package/lib/utils/image.js +26 -0
  73. package/lib/utils/paths.js +18 -0
  74. package/lib/utils/puppeteer.render.js +102 -0
  75. package/package.json +110 -0
  76. package/public/output.css +1 -0
  77. package/resources/css/dynamic/Account.css +68 -0
  78. package/resources/css/dynamic/Content.box.grid.4.css +4 -0
  79. package/resources/css/dynamic/Content.box.grid.9.css +4 -0
  80. package/resources/css/dynamic/Content.css +87 -0
  81. package/resources/css/dynamic/Footer.css +44 -0
  82. package/resources/css/dynamic/ForwardContent.css +11 -0
  83. package/resources/css/dynamic/LogoText.css +15 -0
  84. package/resources/css/dynamic/MainPage.css +93 -0
  85. package/resources/css/help/help.css +182 -0
  86. package/resources/css/loginQrcode/Page.css +55 -0
  87. package/resources/css/version/version.css +116 -0
  88. package/resources/fonts/iconfont.16acc2.ttf +0 -0
  89. package/resources/img/background/Girl.png +0 -0
  90. package/resources/img/icon/dynamic/bili-rich-text-module-goods-taobao.svg +1 -0
  91. package/resources/img/icon/dynamic/bili-rich-text-module-lottery.svg +1 -0
  92. package/resources/img/icon/dynamic/bilibili.svg +6 -0
  93. package/resources/img/icon/dynamic/weibo.svg +43 -0
  94. package/resources/img/icon/puplic/archaic_stone.png +0 -0
  95. package/resources/img/icon/puplic/condessence_crystal.png +0 -0
  96. package/resources/img/icon/puplic/delightful_encounter.png +0 -0
  97. package/resources/img/icon/puplic/diagram.png +0 -0
  98. package/resources/img/icon/puplic/essence_of_pure_sacred_dewdrop.png +0 -0
  99. package/resources/img/icon/puplic/everamber.png +0 -0
  100. package/resources/img/icon/puplic/flower_1.png +0 -0
  101. package/resources/img/icon/puplic/flower_2.png +0 -0
  102. package/resources/img/icon/puplic/kamera.png +0 -0
  103. package/resources/img/icon/puplic/lumidouce_bell.png +0 -0
  104. package/resources/img/icon/puplic/mora.png +0 -0
  105. package/resources/img/icon/puplic/pluie_lotus.png +0 -0
  106. package/resources/img/icon/puplic/restaurant_smoothie.png +0 -0
  107. package/resources/img/icon/puplic/romaritime_flower.png +0 -0
  108. package/resources/img/icon/puplic/shell.png +0 -0
  109. package/resources/img/icon/puplic/spring_of_pure_sacred_dewdrop.png +0 -0
  110. package/resources/img/icon/puplic/surging_sacred_chalice.png +0 -0
  111. package/resources/img/icon/puplic/tourbillon_device.png +0 -0
  112. package/resources/img/icon/puplic/unfading_silky_grace.png +0 -0
  113. package/resources/img/icon/puplic/wisdom.png +0 -0
  114. package/resources/img/icon/puplic/wondrous_lovely_flower.png +0 -0
  115. package/resources/img/icon/puplic//345/262/251/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
  116. package/resources/img/icon/puplic//346/260/264/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
  117. package/resources/img/icon/puplic//350/215/211/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
  118. package/resources/img/icon/puplic//351/222/223/351/261/274.png +0 -0
  119. package/resources/img/icon/puplic//351/233/267/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
  120. package/resources/img/icon/puplic//351/243/216/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
  121. package/resources/img/icon/puplic//351/243/216/350/275/246.png +0 -0
  122. package/resources/img/readme/girl.png +0 -0
  123. package/resources/img/readme/min-Girl.png +0 -0
  124. package/resources/img/readme/mini-help.jpg +0 -0
@@ -0,0 +1,23 @@
1
+ import { Puppeteer } from 'react-puppeteer';
2
+ export type ScreenshotOptions = {
3
+ SOptions?: {
4
+ type: 'jpeg' | 'png' | 'webp';
5
+ quality: number;
6
+ };
7
+ tab?: string;
8
+ timeout?: number;
9
+ isSplit?: boolean;
10
+ addStyle?: string;
11
+ header?: {
12
+ [key: string]: string;
13
+ };
14
+ pageSplitHeight?: number;
15
+ pageWidth?: number;
16
+ modelName?: string;
17
+ saveHtmlfile?: boolean;
18
+ };
19
+ export declare class YukiPuppeteerRender extends Puppeteer {
20
+ yukiScreenshot(htmlPath: string, Options?: ScreenshotOptions): Promise<false | {
21
+ img: Buffer[];
22
+ }>;
23
+ }
@@ -0,0 +1,108 @@
1
+ import * as fs from 'fs';
2
+ import YAML from 'yaml';
3
+ import chokidar from 'chokidar';
4
+ import lodash from 'lodash';
5
+ import path from 'path';
6
+ import { _paths } from './paths.js';
7
+
8
+ class Config {
9
+ versionPath;
10
+ defaultConfigPath;
11
+ userConfigPath;
12
+ defaultConfig;
13
+ userConfig;
14
+ watcher;
15
+ constructor() {
16
+ this.versionPath = path.join(_paths.pluginPath, 'CHANGELOG.md');
17
+ this.defaultConfigPath = path.join(_paths.pluginPath, 'defaultConfig');
18
+ this.defaultConfig = {};
19
+ this.userConfigPath = path.join(_paths.pluginPath, 'config');
20
+ this.userConfig = {};
21
+ this.watcher = {};
22
+ this.initConfigFiles();
23
+ }
24
+ initConfigFiles() {
25
+ let bilibiliSetFile = path.join(_paths.pluginPath, 'config/bilibili/config.yaml');
26
+ let bilibiliPushFile = path.join(_paths.pluginPath, 'config/bilibili/push.yaml');
27
+ let weiboSetFile = path.join(_paths.pluginPath, 'config/weibo/config.yaml');
28
+ let weiboPushFile = path.join(_paths.pluginPath, 'config/weibo/push.yaml');
29
+ const configFiles = [
30
+ { file: bilibiliSetFile, defaultFile: path.join(_paths.pluginPath, 'defaultConfig/bilibili/config.yaml'), dir: 'config/bilibili' },
31
+ { file: bilibiliPushFile, defaultFile: path.join(_paths.pluginPath, 'defaultConfig/bilibili/push.yaml'), dir: 'config/bilibili' },
32
+ { file: weiboSetFile, defaultFile: path.join(_paths.pluginPath, 'defaultConfig/weibo/config.yaml'), dir: 'config/weibo' },
33
+ { file: weiboPushFile, defaultFile: path.join(_paths.pluginPath, 'defaultConfig/weibo/push.yaml'), dir: 'config/weibo' }
34
+ ];
35
+ for (const { file, defaultFile, dir } of configFiles) {
36
+ if (!fs.existsSync(file)) {
37
+ const configDir = path.join(_paths.pluginPath, dir);
38
+ if (!fs.existsSync(configDir)) {
39
+ fs.mkdirSync(configDir, { recursive: true });
40
+ }
41
+ fs.copyFileSync(defaultFile, file);
42
+ }
43
+ }
44
+ }
45
+ getConfigData(typeDir, appDir, functionName) {
46
+ const configFilePath = this.getConfigFilePath(typeDir, appDir, functionName);
47
+ const key = `${typeDir}_${appDir}_${functionName}`;
48
+ if (this[key])
49
+ return this[key];
50
+ this[key] = YAML.parse(fs.readFileSync(configFilePath, "utf8"));
51
+ this.watch(configFilePath, typeDir, appDir, functionName);
52
+ return this[key];
53
+ }
54
+ getConfigFilePath(typeDir, appDir, functionName) {
55
+ return path.join(_paths.pluginPath, `${typeDir}`, `${appDir}`, `${functionName}.yaml`);
56
+ }
57
+ watch(configFilePath, typeDir, appDir, functionName) {
58
+ const key = `${typeDir}_${appDir}_${functionName}`;
59
+ if (this.watcher[key])
60
+ return;
61
+ const watcher = chokidar.watch(configFilePath);
62
+ watcher.on("change", () => {
63
+ delete this[key];
64
+ logger.mark(`[修改配置文件][${typeDir}][${appDir}][${functionName}]`);
65
+ if (this[`change_${appDir}${functionName}`]) {
66
+ this[`change_${appDir}${functionName}`]();
67
+ }
68
+ });
69
+ this.watcher[key] = watcher;
70
+ }
71
+ getDefaultConfig(appDir, functionName) {
72
+ return this.getConfigData("defaultConfig", appDir, functionName);
73
+ }
74
+ getUserConfig(appDir, functionName) {
75
+ const userConfigData = this.getConfigData("config", appDir, functionName);
76
+ const defaultConfigData = this.getDefaultConfig(appDir, functionName);
77
+ return lodash.merge({}, defaultConfigData, userConfigData);
78
+ }
79
+ saveConfig(typeDir, appDir, functionName, data) {
80
+ const filePath = this.getConfigFilePath(typeDir, appDir, functionName);
81
+ if (lodash.isEmpty(data)) {
82
+ fs.existsSync(filePath) && fs.unlinkSync(filePath);
83
+ }
84
+ else {
85
+ const yamlContent = YAML.stringify(data);
86
+ fs.writeFileSync(filePath, yamlContent, "utf8");
87
+ }
88
+ }
89
+ updateConfigItem(appDir, functionName, key, value) {
90
+ const config = this.getUserConfig(appDir, functionName);
91
+ config[key] = value;
92
+ this.saveConfig("config", appDir, functionName, config);
93
+ }
94
+ getLatestVersion() {
95
+ const content = fs.readFileSync(this.versionPath, 'utf-8');
96
+ const versionPattern = /#\s(\d+\.\d+\.\d+)/g;
97
+ const match = versionPattern.exec(content);
98
+ if (match) {
99
+ return match[1];
100
+ }
101
+ else {
102
+ return null;
103
+ }
104
+ }
105
+ }
106
+ var Config$1 = new Config();
107
+
108
+ export { Config$1 as default };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Component, Picture, Puppeteer } from 'react-puppeteer';
3
+ import { YukiPuppeteerRender } from './puppeteer.render.js';
4
+ import * as index from '../components/index.js';
5
+
6
+ const com = new Component();
7
+ const yukiPuppeteerRender = new YukiPuppeteerRender();
8
+ class Image extends Picture {
9
+ constructor() {
10
+ super();
11
+ this.Pup = new Puppeteer();
12
+ this.Pup.start();
13
+ }
14
+ async renderPage(uid, page, props = {}, ScreenshotOptions, ComponentCreateOpsion) {
15
+ const Page = index[page];
16
+ return yukiPuppeteerRender.yukiScreenshot(com.compile({
17
+ join_dir: page,
18
+ html_name: `${uid}.html`,
19
+ html_body: React.createElement(Page, { ...props }),
20
+ ...ComponentCreateOpsion
21
+ }), ScreenshotOptions);
22
+ }
23
+ }
24
+ var Image$1 = new Image();
25
+
26
+ export { Image, Image$1 as default };
@@ -0,0 +1,18 @@
1
+ import { dirname, join, basename } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+
4
+ const _path = process.cwd();
5
+ const thisFilePath = dirname(fileURLToPath(import.meta.url));
6
+ const pluginPath = join(thisFilePath, '..', '..');
7
+ const pluginName = basename(pluginPath);
8
+ const _paths = {
9
+ root: _path,
10
+ botData: join(_path, 'data'),
11
+ botYukiData: join(_path, 'data/yuki-plugin'),
12
+ botTempPath: join(_path, 'temp'),
13
+ pluginPath,
14
+ pluginResources: join(pluginPath, 'resources'),
15
+ pluginName,
16
+ };
17
+
18
+ export { _paths, pluginName };
@@ -0,0 +1,102 @@
1
+ import { Puppeteer } from 'react-puppeteer';
2
+ import fs__default from 'fs';
3
+ import path from 'path';
4
+ import { _paths } from './paths.js';
5
+
6
+ class YukiPuppeteerRender extends Puppeteer {
7
+ async yukiScreenshot(htmlPath, Options) {
8
+ if (!(await this.isStart()))
9
+ return false;
10
+ let name = Options?.modelName ?? 'yuki-plugin';
11
+ let pageHeight = Options?.pageSplitHeight ?? 8000;
12
+ try {
13
+ const page = await this.browser?.newPage().catch(err => {
14
+ logger.error(err);
15
+ });
16
+ if (!page)
17
+ return false;
18
+ await page.setViewport({
19
+ width: Options?.pageWidth ?? 900,
20
+ height: 7500
21
+ });
22
+ if (Options?.header) {
23
+ await page.setExtraHTTPHeaders(Options.header);
24
+ }
25
+ await page.goto(`file://${htmlPath}`, { timeout: Options?.timeout ?? 120000, waitUntil: 'networkidle2' });
26
+ const body = await page.$(Options?.tab ?? 'body');
27
+ if (!body)
28
+ return false;
29
+ const boundingBox = await body.boundingBox();
30
+ const num = Options?.isSplit ? Math.ceil(boundingBox.height / pageHeight) : 1;
31
+ pageHeight = Math.round(boundingBox.height / num);
32
+ await page.setViewport({
33
+ width: boundingBox.width + 50,
34
+ height: pageHeight + 100
35
+ });
36
+ if (Options?.addStyle) {
37
+ await page.addStyleTag({
38
+ content: Options.addStyle,
39
+ });
40
+ }
41
+ await page.addStyleTag({
42
+ content: `img[src$=".gif"] {animation-play-state: paused !important;}`
43
+ });
44
+ if (Options?.saveHtmlfile === true) {
45
+ const htmlContent = await page.content();
46
+ const Dir = path.join(_paths.root, `/temp/html/yuki-plugin/${name}/`);
47
+ if (!fs__default.existsSync(Dir)) {
48
+ fs__default.mkdirSync(Dir, { recursive: true });
49
+ }
50
+ fs__default.writeFileSync(`${Dir}${Date.now()}.html`, htmlContent);
51
+ }
52
+ logger.info('[puppeteer] success');
53
+ let numSun = 0;
54
+ let start = Date.now();
55
+ const ret = new Array();
56
+ let buff;
57
+ for (let i = 1; i <= num; i++) {
58
+ if (i > 1) {
59
+ await page.evaluate(pageHeight => {
60
+ window.scrollBy(0, pageHeight);
61
+ }, pageHeight);
62
+ await new Promise((resolve) => setTimeout(resolve, 500));
63
+ }
64
+ let renderOptions = Options?.SOptions ?? { type: 'png' };
65
+ const screenshotOptions = {
66
+ ...renderOptions,
67
+ clip: {
68
+ x: 0,
69
+ y: pageHeight * (i - 1),
70
+ width: Math.round(boundingBox.width),
71
+ height: Math.min(pageHeight, boundingBox.height - pageHeight * (i - 1)),
72
+ },
73
+ };
74
+ buff = await page.screenshot(screenshotOptions).catch(err => {
75
+ logger.error('[puppeteer]', 'screenshot', err);
76
+ return false;
77
+ });
78
+ numSun++;
79
+ if (buff !== false) {
80
+ const kb = (buff?.length / 1024).toFixed(2) + "kb";
81
+ logger.mark(`[图片生成][${name}][${numSun}次] ${kb} ${logger.green(`${Date.now() - start}ms`)}`);
82
+ ret.push(buff);
83
+ }
84
+ else {
85
+ logger.error(`[puppeteer]`, '截图失败');
86
+ }
87
+ }
88
+ if (ret.length === 0 || !ret[0]) {
89
+ logger.error(`[图片生成][${name}] 图片生成为空`);
90
+ return false;
91
+ }
92
+ await page.close().catch(err => logger.error(err));
93
+ return { img: ret };
94
+ }
95
+ catch (err) {
96
+ logger.error('[puppeteer] newPage', err);
97
+ return false;
98
+ }
99
+ }
100
+ }
101
+
102
+ export { YukiPuppeteerRender };
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "yz-yuki-plugin",
3
+ "version": "1.0.1-rc.0",
4
+ "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
+ "author": "snowtafir",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "main": "main.js",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/snowtafir/yuki-plugin.git"
12
+ },
13
+ "scripts": {
14
+ "app": "npm run css && node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.js",
15
+ "dev": "npm run css && nodemon",
16
+ "img": "npm run css && nodemon --config routes.nodemon.json",
17
+ "build": "npm run css:m && rollup --config rollup.config.js",
18
+ "css": "tailwindcss -i ./src/input.css -o ./public/output.css",
19
+ "css:m": "tailwindcss -i ./src/input.css -o ./public/output.css -m",
20
+ "css:watch": "tailwindcss -i ./src/input.css -o ./public/output.css --watch",
21
+ "format": "prettier --write ."
22
+ },
23
+ "dependencies": {
24
+ "axios": "^1.7.2",
25
+ "chokidar": "^3.6.0",
26
+ "jsdom": "^24.1.0",
27
+ "json5": "^2.2.3",
28
+ "md5": "^2.3.0",
29
+ "moment": "^2.30.1",
30
+ "node-fetch": "^3.3.2",
31
+ "puppeteer": "^22.14.0",
32
+ "qrcode": "^1.5.3",
33
+ "react": "^18.3.1",
34
+ "react-dom": "^18.3.1",
35
+ "react-puppeteer": "1.0.0-rc.7",
36
+ "redis": "^4.6.13",
37
+ "yaml": "^2.5.0",
38
+ "yarn": "^1.19.1"
39
+ },
40
+ "devDependencies": {
41
+ "@rollup/plugin-commonjs": "^26.0.1",
42
+ "@rollup/plugin-image": "^3.0.3",
43
+ "@rollup/plugin-json": "^6.1.0",
44
+ "@rollup/plugin-node-resolve": "^15.2.3",
45
+ "@rollup/plugin-replace": "^5.0.7",
46
+ "@rollup/plugin-terser": "^0.4.4",
47
+ "@rollup/plugin-typescript": "^11.1.3",
48
+ "@types/jsdom": "^21.1.7",
49
+ "@types/lodash": "^4.17.7",
50
+ "@types/md5": "^2.3.5",
51
+ "@types/node": "^20.8.5",
52
+ "@types/node-fetch": "^2.6.11",
53
+ "@types/qrcode": "^1.5.5",
54
+ "@types/react": "^18.3.3",
55
+ "@types/react-dom": "^18.3.0",
56
+ "@types/rollup-plugin-auto-external": "^2.0.5",
57
+ "@types/yaml": "1.9.7",
58
+ "axios": "^1.7.2",
59
+ "chokidar": "^3.6.0",
60
+ "jsdom": "^24.1.0",
61
+ "json5": "^2.2.3",
62
+ "md5": "^2.3.0",
63
+ "node-fetch": "^3.3.2",
64
+ "nodemon": "^3.0.1",
65
+ "prettier": "^3.2.5",
66
+ "puppeteer": "^22.14.0",
67
+ "qrcode": "^1.5.3",
68
+ "react": "^18.3.1",
69
+ "react-dom": "^18.3.1",
70
+ "react-puppeteer": "1.0.0-rc.7",
71
+ "redis": "^4.6.13",
72
+ "rollup": "^4.16.4",
73
+ "rollup-plugin-auto-external": "^2.0.0",
74
+ "rollup-plugin-copy": "^3.5.0",
75
+ "rollup-plugin-dts": "^6.1.1",
76
+ "rollup-plugin-ignore": "^1.0.10",
77
+ "tailwindcss": "^3.4.3",
78
+ "ts-node": "^10.9.2",
79
+ "typescript": "^5.4.5",
80
+ "yunzai": "^1.0.1-rc.2",
81
+ "yunzai-mys": "^1.0.0-rc.0"
82
+ },
83
+ "files": [
84
+ "public",
85
+ "resources",
86
+ "lib",
87
+ "defaultConfig",
88
+ "CHANGELOG.md",
89
+ "README.md",
90
+ "package.json",
91
+ "LICENSE",
92
+ ".puppeteerrc.cjs"
93
+ ],
94
+ "types": "lib/types",
95
+ "exports": {
96
+ ".": {
97
+ "import": "./lib/index.js",
98
+ "types": "./lib/types/index.d.ts"
99
+ }
100
+ },
101
+ "keywords": [
102
+ "yunzai"
103
+ ],
104
+ "publishConfig": {
105
+ "registry": "https://registry.npmjs.org/"
106
+ },
107
+ "engines": {
108
+ "node": ">=16.14.0"
109
+ }
110
+ }
@@ -0,0 +1 @@
1
+ /*! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-auto{margin:auto}.mb-3{margin-bottom:.75rem}.ml-7{margin-left:1.75rem}.mt-3{margin-top:.75rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-72{height:18rem}.max-h-96{max-height:24rem}.w-32{width:8rem}.w-72{width:18rem}.w-96{width:24rem}.p-1{padding:.25rem}.p-5{padding:1.25rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}
@@ -0,0 +1,68 @@
1
+ .account {
2
+ position: relative;
3
+ display: flex;
4
+ margin-bottom: 20px;
5
+ padding: 20px;
6
+ border-bottom-width: 1px;
7
+ border-bottom-color: #ffcee6;
8
+ border-bottom-style: dashed;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ }
12
+
13
+ .avatar-container {
14
+ position: relative;
15
+ display: flex;
16
+ align-items: center;
17
+ margin-left: 10px;
18
+ }
19
+
20
+ .avatar {
21
+ width: 95px;
22
+ height: 95px;
23
+ border-radius: 50%;
24
+ margin-right: 10px;
25
+ }
26
+
27
+ .pendant {
28
+ width: 160px;
29
+ height: 160px;
30
+ position: absolute;
31
+ top: -32px;
32
+ left: -32px;
33
+ z-index: 1;
34
+ }
35
+
36
+ .account-info {
37
+ display: flex;
38
+ flex-direction: column;
39
+ margin-left: 10px;
40
+ }
41
+
42
+ .nickname {
43
+ font-size: 25px;
44
+ font-weight: bold;
45
+ color: #333;
46
+ margin-left: 10px;
47
+ }
48
+
49
+ .timestamp {
50
+ font-size: 16px;
51
+ color: #666;
52
+ margin-top: 5px;
53
+ margin-left: 10px;
54
+ }
55
+
56
+ .logo-container {
57
+ display: flex;
58
+ flex-direction: column;
59
+ }
60
+
61
+ .bilibili-logo,
62
+ .weibo-logo {
63
+ margin-left: 10px;
64
+ }
65
+
66
+ .weibo-logo {
67
+ max-width: 55px;
68
+ }
@@ -0,0 +1,4 @@
1
+ /*自适应四宫格控制*/
2
+ .pic-item {
3
+ flex: 1 0 calc(50% - 10px);
4
+ }
@@ -0,0 +1,4 @@
1
+ /*自适应九宫格控制*/
2
+ .pic-item {
3
+ flex: 1 0 calc(33.3333% - 10px);
4
+ }
@@ -0,0 +1,87 @@
1
+ @font-face {
2
+ font-family: "iconfont";
3
+ src: url("./../../fonts/iconfont.16acc2.ttf");
4
+ font-weight: normal;
5
+ font-style: normal;
6
+ }
7
+
8
+ .content {
9
+ font-size: 20px;
10
+ color: #333;
11
+ margin-bottom: 20px;
12
+ padding-left: 20px;
13
+ padding-right: 20px;
14
+ }
15
+
16
+ .content-text {
17
+ font-family: "iconfont", Arial, sans-serif;
18
+ }
19
+
20
+ .content img {
21
+ max-width: 100%;
22
+ height: auto;
23
+ border-radius: 8px;
24
+ }
25
+
26
+ /*自适应九宫格*/
27
+ .pic-content {
28
+ margin-top: 15px;
29
+ width: 100%;
30
+ display: flex;
31
+ flex-wrap: wrap;
32
+ }
33
+
34
+ .pic-item {
35
+ /* flex: 1 0 calc(33.3333% - 10px); */
36
+ margin: 2px;
37
+ background-size: contain;
38
+ background-repeat: no-repeat;
39
+ background-position: center center;
40
+ }
41
+
42
+ .pic-item:after {
43
+ display: block;
44
+ padding-bottom: 100%;
45
+ }
46
+
47
+ /******/
48
+
49
+ /**微博content图标*/
50
+ .url-icon img {
51
+ left: 10px;
52
+ position: absolute;
53
+ visibility: hidden;
54
+ }
55
+
56
+ .bili-rich-text-module,
57
+ .surl-text {
58
+ color: #008ac5;
59
+ }
60
+
61
+ /* 定义B站互动抽奖标签的样式 */
62
+ .bili-rich-text-module.lottery {
63
+ display: inline-block;
64
+ padding-left: 20px;
65
+ /* 为图标留出空间 */
66
+ position: relative;
67
+ background-repeat: no-repeat;
68
+ background-position: left center;
69
+ background-size: 20px 20px;
70
+ /* 根据你的SVG图标大小调整 */
71
+ background-image: url('./../../img/icon/dynamic/bili-rich-text-module-lottery.svg');
72
+ /* 引入SVG图标 */
73
+ }
74
+
75
+ /* 定义B站淘宝商品推广标签样式 */
76
+ .bili-rich-text-module.goods.taobao {
77
+ display: inline-block;
78
+ padding-left: 20px;
79
+ /* 为图标留出空间 */
80
+ position: relative;
81
+ background-repeat: no-repeat;
82
+ background-position: left center;
83
+ background-size: 20px 20px;
84
+ /* 根据你的SVG图标大小调整 */
85
+ background-image: url('./../../img/icon/dynamic/bili-rich-text-module-goods-taobao.svg');
86
+ /* 引入SVG图标 */
87
+ }
@@ -0,0 +1,44 @@
1
+ @font-face {
2
+ font-family: "iconfont";
3
+ src: url("./../../fonts/iconfont.16acc2.ttf");
4
+ font-weight: normal;
5
+ font-style: normal;
6
+ }
7
+
8
+ .footer {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ color: #000;
13
+ padding: 10px 20px;
14
+ border-top-width: 1px;
15
+ border-top-color: #ff69b4;
16
+ border-top-style: dashed;
17
+ }
18
+
19
+ .qr-code {
20
+ width: 148px;
21
+ height: 148px;
22
+ border-radius: 8px;
23
+ border: 2px dashed #ff69b4;
24
+ margin-left: 20px;
25
+ margin-top: 20px;
26
+ align-items: center;
27
+ }
28
+
29
+ .footer-text-container {
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: flex-start;
33
+ font-size: 20px;
34
+ font-family: "iconfont", Arial, sans-serif;
35
+ }
36
+
37
+ .bili-logo-0 {
38
+ margin-bottom: 6px;
39
+ }
40
+
41
+ .weibo-logo-0 {
42
+ margin-left: 15px;
43
+ margin-bottom: 10px;
44
+ }
@@ -0,0 +1,11 @@
1
+ .orig-container {
2
+ background-color: #f5f5f5 !important;
3
+ border-radius: 10px !important;
4
+ position: relative;
5
+ }
6
+
7
+ /**微博content图标*/
8
+ .url-icon img {
9
+ left: 10px;
10
+ position: absolute;
11
+ }
@@ -0,0 +1,15 @@
1
+ .bilibili-logo-text {
2
+ margin-left: 40px;
3
+ margin-top: 2px;
4
+ color: #FB7299;
5
+ font-size: 18px;
6
+ font-weight: bold;
7
+ }
8
+
9
+ .weibo-logo-text {
10
+ margin-left: 2px;
11
+ margin-top: 2px;
12
+ color: rgba(232 146 20);
13
+ font-size: 18px;
14
+ font-weight: bold;
15
+ }