karin-plugin-mys-core 1.0.10 → 1.0.12

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 (154) hide show
  1. package/README.md +1 -1
  2. package/lib/apps/MiHoYoLogin.js +6 -38
  3. package/lib/apps/MysDevice.js +5 -37
  4. package/lib/apps/UIDManage.js +6 -38
  5. package/lib/{chunk-JT3SU5UU.js → chunk-A5FZEOIN.js} +78 -6
  6. package/lib/{chunk-4BTKE3LO.js → chunk-HTL64YH2.js} +300 -178
  7. package/lib/chunk-IASM5MM5.js +639 -0
  8. package/lib/{chunk-5DXIT7UB.js → chunk-RX4VMVAI.js} +0 -5
  9. package/lib/{chunk-MQ52BX7O.js → chunk-SZHK7OGF.js} +9 -13
  10. package/lib/chunk-UIPRZFST.js +184 -0
  11. package/lib/exports/config/index.d.ts +56 -1
  12. package/lib/exports/config/index.js +3 -9
  13. package/lib/exports/database/index.d.ts +78 -12
  14. package/lib/exports/database/index.js +12 -40
  15. package/lib/exports/mys/index.d.ts +379 -14
  16. package/lib/exports/mys/index.js +9 -43
  17. package/lib/exports/render/index.d.ts +38 -4
  18. package/lib/exports/render/index.js +3 -8
  19. package/lib/exports/utils/index.d.ts +45 -2
  20. package/lib/exports/utils/index.js +1 -4
  21. package/lib/{exports/database/types/dbs/base.d.ts → mysUserInfo-BsyEENbc.d.ts} +60 -1
  22. package/package.json +1 -1
  23. package/resources/image/frame-logo.webp +0 -0
  24. package/resources/image/launcher-icon//345/216/237/347/245/236.webp +0 -0
  25. package/resources/image/launcher-icon//345/264/251/345/235/2173.webp +0 -0
  26. package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.webp +0 -0
  27. package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/345/233/240/347/274/230/347/262/276/347/201/265.webp +0 -0
  28. package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/346/230/237/347/251/271/351/223/201/351/201/223.webp +0 -0
  29. package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.webp +0 -0
  30. package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.webp +0 -0
  31. package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.webp +0 -0
  32. package/resources/image/mys-core-logo.webp +0 -0
  33. package/resources/image/mys-logo.webp +0 -0
  34. package/resources/styles/karin-plugin-mys-core.css +4 -4
  35. package/lib/chunk-2BVJS5VE.js +0 -49
  36. package/lib/chunk-3ERB3ILC.js +0 -0
  37. package/lib/chunk-3JN5WYUN.js +0 -135
  38. package/lib/chunk-7KEG6SDX.js +0 -0
  39. package/lib/chunk-7VAWV6ZE.js +0 -0
  40. package/lib/chunk-ARLTXJFJ.js +0 -0
  41. package/lib/chunk-CFS2WFOO.js +0 -0
  42. package/lib/chunk-DMJ5OQR6.js +0 -73
  43. package/lib/chunk-EDNBKOMS.js +0 -30
  44. package/lib/chunk-FBWSEBAW.js +0 -0
  45. package/lib/chunk-FOAQZIZ2.js +0 -0
  46. package/lib/chunk-G5W5WAY5.js +0 -64
  47. package/lib/chunk-G7TMVDGP.js +0 -68
  48. package/lib/chunk-HJ6HX5HB.js +0 -29
  49. package/lib/chunk-I7XZONDN.js +0 -13
  50. package/lib/chunk-JRH4JC43.js +0 -0
  51. package/lib/chunk-JVJQKRJ4.js +0 -89
  52. package/lib/chunk-K5U2O3HH.js +0 -0
  53. package/lib/chunk-KQVWWGRH.js +0 -31
  54. package/lib/chunk-LBLGKL3W.js +0 -77
  55. package/lib/chunk-LJSDSOY6.js +0 -0
  56. package/lib/chunk-LYTNREAI.js +0 -0
  57. package/lib/chunk-MPZP23EX.js +0 -219
  58. package/lib/chunk-MWYDWDR4.js +0 -0
  59. package/lib/chunk-PMFOX5HA.js +0 -80
  60. package/lib/chunk-PYTECG57.js +0 -0
  61. package/lib/chunk-SEWEEPJN.js +0 -0
  62. package/lib/chunk-SHW6FHIB.js +0 -10
  63. package/lib/chunk-T7W4DXRM.js +0 -0
  64. package/lib/chunk-TTN7NFCA.js +0 -109
  65. package/lib/chunk-W4DBT7AD.js +0 -0
  66. package/lib/chunk-WCX7WZAQ.js +0 -0
  67. package/lib/chunk-Z5I6A73Y.js +0 -0
  68. package/lib/chunk-ZTOR2DXG.js +0 -38
  69. package/lib/common-BlI5Gsw_.d.ts +0 -35
  70. package/lib/define-B9r20dK6.d.ts +0 -130
  71. package/lib/exports/config/array.d.ts +0 -1
  72. package/lib/exports/config/array.js +0 -7
  73. package/lib/exports/config/config.d.ts +0 -56
  74. package/lib/exports/config/config.js +0 -12
  75. package/lib/exports/database/database.d.ts +0 -30
  76. package/lib/exports/database/database.js +0 -22
  77. package/lib/exports/database/dbs/base.d.ts +0 -25
  78. package/lib/exports/database/dbs/base.js +0 -19
  79. package/lib/exports/database/dbs/index.d.ts +0 -4
  80. package/lib/exports/database/dbs/index.js +0 -29
  81. package/lib/exports/database/dbs/sqlite3.d.ts +0 -27
  82. package/lib/exports/database/dbs/sqlite3.js +0 -23
  83. package/lib/exports/database/dbs/table.d.ts +0 -20
  84. package/lib/exports/database/dbs/table.js +0 -25
  85. package/lib/exports/database/tables/index.d.ts +0 -9
  86. package/lib/exports/database/tables/index.js +0 -40
  87. package/lib/exports/database/tables/mysAccountInfo.d.ts +0 -9
  88. package/lib/exports/database/tables/mysAccountInfo.js +0 -27
  89. package/lib/exports/database/tables/mysDeviceInfo.d.ts +0 -9
  90. package/lib/exports/database/tables/mysDeviceInfo.js +0 -27
  91. package/lib/exports/database/tables/mysUserInfo.d.ts +0 -9
  92. package/lib/exports/database/tables/mysUserInfo.js +0 -27
  93. package/lib/exports/database/types/database.d.ts +0 -6
  94. package/lib/exports/database/types/database.js +0 -1
  95. package/lib/exports/database/types/dbs/base.js +0 -11
  96. package/lib/exports/database/types/dbs/index.d.ts +0 -2
  97. package/lib/exports/database/types/dbs/index.js +0 -12
  98. package/lib/exports/database/types/index.d.ts +0 -6
  99. package/lib/exports/database/types/index.js +0 -24
  100. package/lib/exports/database/types/tables/index.d.ts +0 -5
  101. package/lib/exports/database/types/tables/index.js +0 -13
  102. package/lib/exports/database/types/tables/mysAccountInfo.d.ts +0 -14
  103. package/lib/exports/database/types/tables/mysAccountInfo.js +0 -7
  104. package/lib/exports/database/types/tables/mysDeviceInfo.d.ts +0 -19
  105. package/lib/exports/database/types/tables/mysDeviceInfo.js +0 -1
  106. package/lib/exports/database/types/tables/mysUserInfo.d.ts +0 -32
  107. package/lib/exports/database/types/tables/mysUserInfo.js +0 -7
  108. package/lib/exports/mys/api/apis.d.ts +0 -82
  109. package/lib/exports/mys/api/apis.js +0 -56
  110. package/lib/exports/mys/api/app.d.ts +0 -60
  111. package/lib/exports/mys/api/app.js +0 -32
  112. package/lib/exports/mys/api/define.d.ts +0 -6
  113. package/lib/exports/mys/api/define.js +0 -42
  114. package/lib/exports/mys/api/index.d.ts +0 -11
  115. package/lib/exports/mys/api/index.js +0 -63
  116. package/lib/exports/mys/types/api/define.d.ts +0 -6
  117. package/lib/exports/mys/types/api/define.js +0 -1
  118. package/lib/exports/mys/types/api/index.d.ts +0 -6
  119. package/lib/exports/mys/types/api/index.js +0 -2
  120. package/lib/exports/mys/types/index.d.ts +0 -12
  121. package/lib/exports/mys/types/index.js +0 -6
  122. package/lib/exports/mys/types/user/game.d.ts +0 -23
  123. package/lib/exports/mys/types/user/game.js +0 -1
  124. package/lib/exports/mys/types/user/index.d.ts +0 -12
  125. package/lib/exports/mys/types/user/index.js +0 -3
  126. package/lib/exports/mys/types/user/userInfo.d.ts +0 -42
  127. package/lib/exports/mys/types/user/userInfo.js +0 -1
  128. package/lib/exports/mys/user/deviceInfo.d.ts +0 -11
  129. package/lib/exports/mys/user/deviceInfo.js +0 -30
  130. package/lib/exports/mys/user/game.d.ts +0 -40
  131. package/lib/exports/mys/user/game.js +0 -9
  132. package/lib/exports/mys/user/index.d.ts +0 -14
  133. package/lib/exports/mys/user/index.js +0 -52
  134. package/lib/exports/mys/user/userInfo.d.ts +0 -53
  135. package/lib/exports/mys/user/userInfo.js +0 -44
  136. package/lib/exports/render/render.d.ts +0 -38
  137. package/lib/exports/render/render.js +0 -12
  138. package/lib/exports/utils/common.d.ts +0 -1
  139. package/lib/exports/utils/common.js +0 -15
  140. package/lib/exports/utils/types/common.d.ts +0 -11
  141. package/lib/exports/utils/types/common.js +0 -1
  142. package/lib/exports/utils/types/index.d.ts +0 -1
  143. package/lib/exports/utils/types/index.js +0 -2
  144. package/resources/image/frame-logo.png +0 -0
  145. package/resources/image/launcher-icon//345/216/237/347/245/236.png +0 -0
  146. package/resources/image/launcher-icon//345/264/251/345/235/2173.png +0 -0
  147. package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.png +0 -0
  148. package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/345/233/240/347/274/230/347/262/276/347/201/265.png +0 -0
  149. package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/346/230/237/347/251/271/351/223/201/351/201/223.png +0 -0
  150. package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.png +0 -0
  151. package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.png +0 -0
  152. package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.png +0 -0
  153. package/resources/image/mys-core-logo.png +0 -0
  154. package/resources/image/mys-logo.png +0 -0
package/README.md CHANGED
@@ -878,7 +878,7 @@ const UserCard: React.FC<UserCardProps> = ({ username, level, avatar }) => {
878
878
  <p>等级: {level}</p>
879
879
  <p>主题: {plugin.theme}</p>
880
880
  {/* 使用插件资源 */}
881
- <img src={`${plugin.resources.default}/image/icon.png`} />
881
+ <img src={`${plugin.resources.default}/image/icon.webp`} />
882
882
  </div>
883
883
  )
884
884
  }
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  ShowBindAccountCmdFunc
3
- } from "../chunk-MQ52BX7O.js";
4
- import "../chunk-JT3SU5UU.js";
5
- import "../chunk-LBLGKL3W.js";
3
+ } from "../chunk-SZHK7OGF.js";
4
+ import "../chunk-A5FZEOIN.js";
6
5
  import {
7
6
  UserInfo,
8
7
  fetchQRcode,
@@ -10,44 +9,13 @@ import {
10
9
  getTokenByGameToken,
11
10
  getUserFullInfo,
12
11
  queryQRcode
13
- } from "../chunk-4BTKE3LO.js";
14
- import "../chunk-2BVJS5VE.js";
15
- import "../chunk-G5W5WAY5.js";
16
- import "../chunk-7VAWV6ZE.js";
17
- import "../chunk-LJSDSOY6.js";
18
- import "../chunk-CFS2WFOO.js";
19
- import "../chunk-MWYDWDR4.js";
20
- import "../chunk-FOAQZIZ2.js";
21
- import "../chunk-WCX7WZAQ.js";
22
- import "../chunk-KQVWWGRH.js";
23
- import "../chunk-3ERB3ILC.js";
24
- import "../chunk-W4DBT7AD.js";
25
- import "../chunk-Z5I6A73Y.js";
26
- import "../chunk-EDNBKOMS.js";
27
- import "../chunk-ZTOR2DXG.js";
28
- import "../chunk-HJ6HX5HB.js";
29
- import "../chunk-SEWEEPJN.js";
30
- import "../chunk-G7TMVDGP.js";
31
- import "../chunk-DMJ5OQR6.js";
32
- import "../chunk-MPZP23EX.js";
33
- import "../chunk-3JN5WYUN.js";
34
- import "../chunk-7KEG6SDX.js";
35
- import "../chunk-FBWSEBAW.js";
36
- import "../chunk-JVJQKRJ4.js";
37
- import "../chunk-LYTNREAI.js";
38
- import "../chunk-SHW6FHIB.js";
39
- import "../chunk-K5U2O3HH.js";
40
- import "../chunk-I7XZONDN.js";
41
- import "../chunk-JRH4JC43.js";
12
+ } from "../chunk-HTL64YH2.js";
13
+ import "../chunk-IASM5MM5.js";
42
14
  import "../chunk-SHLPPEAY.js";
43
- import "../chunk-TTN7NFCA.js";
44
- import "../chunk-ARLTXJFJ.js";
45
- import "../chunk-PYTECG57.js";
46
- import "../chunk-T7W4DXRM.js";
15
+ import "../chunk-UIPRZFST.js";
47
16
  import {
48
17
  common_exports
49
- } from "../chunk-5DXIT7UB.js";
50
- import "../chunk-PMFOX5HA.js";
18
+ } from "../chunk-RX4VMVAI.js";
51
19
  import "../chunk-MLKGABMK.js";
52
20
 
53
21
  // src/apps/MiHoYoLogin.ts
@@ -1,43 +1,11 @@
1
1
  import {
2
+ DeviceInfo,
2
3
  UserInfo
3
- } from "../chunk-4BTKE3LO.js";
4
- import "../chunk-2BVJS5VE.js";
5
- import "../chunk-G5W5WAY5.js";
6
- import "../chunk-7VAWV6ZE.js";
7
- import "../chunk-LJSDSOY6.js";
8
- import "../chunk-CFS2WFOO.js";
9
- import "../chunk-MWYDWDR4.js";
10
- import "../chunk-FOAQZIZ2.js";
11
- import "../chunk-WCX7WZAQ.js";
12
- import {
13
- DeviceInfo
14
- } from "../chunk-KQVWWGRH.js";
15
- import "../chunk-3ERB3ILC.js";
16
- import "../chunk-W4DBT7AD.js";
17
- import "../chunk-Z5I6A73Y.js";
18
- import "../chunk-EDNBKOMS.js";
19
- import "../chunk-ZTOR2DXG.js";
20
- import "../chunk-HJ6HX5HB.js";
21
- import "../chunk-SEWEEPJN.js";
22
- import "../chunk-G7TMVDGP.js";
23
- import "../chunk-DMJ5OQR6.js";
24
- import "../chunk-MPZP23EX.js";
25
- import "../chunk-3JN5WYUN.js";
26
- import "../chunk-7KEG6SDX.js";
27
- import "../chunk-FBWSEBAW.js";
28
- import "../chunk-JVJQKRJ4.js";
29
- import "../chunk-LYTNREAI.js";
30
- import "../chunk-SHW6FHIB.js";
31
- import "../chunk-K5U2O3HH.js";
32
- import "../chunk-I7XZONDN.js";
33
- import "../chunk-JRH4JC43.js";
4
+ } from "../chunk-HTL64YH2.js";
5
+ import "../chunk-IASM5MM5.js";
34
6
  import "../chunk-SHLPPEAY.js";
35
- import "../chunk-TTN7NFCA.js";
36
- import "../chunk-ARLTXJFJ.js";
37
- import "../chunk-PYTECG57.js";
38
- import "../chunk-T7W4DXRM.js";
39
- import "../chunk-5DXIT7UB.js";
40
- import "../chunk-PMFOX5HA.js";
7
+ import "../chunk-UIPRZFST.js";
8
+ import "../chunk-RX4VMVAI.js";
41
9
  import "../chunk-MLKGABMK.js";
42
10
 
43
11
  // src/apps/MysDevice.ts
@@ -4,45 +4,13 @@ import {
4
4
  ShowBindAccountCmdFunc,
5
5
  UnbindAccount,
6
6
  UnbindUID
7
- } from "../chunk-MQ52BX7O.js";
8
- import "../chunk-JT3SU5UU.js";
9
- import "../chunk-LBLGKL3W.js";
10
- import "../chunk-4BTKE3LO.js";
11
- import "../chunk-2BVJS5VE.js";
12
- import "../chunk-G5W5WAY5.js";
13
- import "../chunk-7VAWV6ZE.js";
14
- import "../chunk-LJSDSOY6.js";
15
- import "../chunk-CFS2WFOO.js";
16
- import "../chunk-MWYDWDR4.js";
17
- import "../chunk-FOAQZIZ2.js";
18
- import "../chunk-WCX7WZAQ.js";
19
- import "../chunk-KQVWWGRH.js";
20
- import "../chunk-3ERB3ILC.js";
21
- import "../chunk-W4DBT7AD.js";
22
- import "../chunk-Z5I6A73Y.js";
23
- import "../chunk-EDNBKOMS.js";
24
- import "../chunk-ZTOR2DXG.js";
25
- import "../chunk-HJ6HX5HB.js";
26
- import "../chunk-SEWEEPJN.js";
27
- import "../chunk-G7TMVDGP.js";
28
- import "../chunk-DMJ5OQR6.js";
29
- import "../chunk-MPZP23EX.js";
30
- import "../chunk-3JN5WYUN.js";
31
- import "../chunk-7KEG6SDX.js";
32
- import "../chunk-FBWSEBAW.js";
33
- import "../chunk-JVJQKRJ4.js";
34
- import "../chunk-LYTNREAI.js";
35
- import "../chunk-SHW6FHIB.js";
36
- import "../chunk-K5U2O3HH.js";
37
- import "../chunk-I7XZONDN.js";
38
- import "../chunk-JRH4JC43.js";
7
+ } from "../chunk-SZHK7OGF.js";
8
+ import "../chunk-A5FZEOIN.js";
9
+ import "../chunk-HTL64YH2.js";
10
+ import "../chunk-IASM5MM5.js";
39
11
  import "../chunk-SHLPPEAY.js";
40
- import "../chunk-TTN7NFCA.js";
41
- import "../chunk-ARLTXJFJ.js";
42
- import "../chunk-PYTECG57.js";
43
- import "../chunk-T7W4DXRM.js";
44
- import "../chunk-5DXIT7UB.js";
45
- import "../chunk-PMFOX5HA.js";
12
+ import "../chunk-UIPRZFST.js";
13
+ import "../chunk-RX4VMVAI.js";
46
14
  import "../chunk-MLKGABMK.js";
47
15
  export {
48
16
  BindUID,
@@ -1,23 +1,27 @@
1
1
  import {
2
2
  dir
3
3
  } from "./chunk-SHLPPEAY.js";
4
+ import {
5
+ common_exports
6
+ } from "./chunk-RX4VMVAI.js";
4
7
 
5
8
  // src/exports/render/index.ts
6
- import React2 from "react";
9
+ import React3 from "react";
7
10
 
8
11
  // src/exports/render/layout/DefaultLayout.tsx
9
12
  import { config } from "node-karin";
10
13
  import React from "react";
11
14
  var DefaultLayoutComponent = ({
12
15
  children,
13
- bgColor,
16
+ bg,
17
+ width,
14
18
  mysPlugin
15
19
  }) => {
16
20
  const karinVersion = config.pkg().version;
17
21
  return /* @__PURE__ */ React.createElement(
18
22
  "div",
19
23
  {
20
- className: `relative flex w-[600px] flex-col pb-10 font-hywh text-black ${bgColor}`,
24
+ className: `relative flex ${width} flex-col pb-10 font-hywh text-black ${bg}`,
21
25
  id: "container"
22
26
  },
23
27
  children,
@@ -31,14 +35,14 @@ var DefaultLayoutComponent = ({
31
35
  ), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement("span", { className: "text-[5px] font-bold leading-none text-black" }, "KARIN-MYS-PLUGIN"), /* @__PURE__ */ React.createElement("div", { className: "flex items-baseline gap-0.5" }, /* @__PURE__ */ React.createElement("span", { className: "font-semibold" }, mysPlugin.name), /* @__PURE__ */ React.createElement("strong", { className: "text-xs font-bold text-[#f2c06f]" }, "v", mysPlugin.version)))), /* @__PURE__ */ React.createElement("div", { className: "h-8 w-px bg-gray-600" })), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
32
36
  "img",
33
37
  {
34
- src: `${dir.pluginDir}/resources/image/mys-core-logo.png`,
38
+ src: `${dir.pluginDir}/resources/image/mys-core-logo.webp`,
35
39
  alt: "MysCore Logo",
36
40
  className: "h-6 w-6 rounded-sm"
37
41
  }
38
42
  ), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement("span", { className: "text-[5px] font-bold leading-none text-black" }, "KARIN-PLUGIN"), /* @__PURE__ */ React.createElement("div", { className: "flex items-baseline gap-0.5" }, /* @__PURE__ */ React.createElement("span", { className: "font-semibold" }, "MysCore"), /* @__PURE__ */ React.createElement("strong", { className: "text-xs font-bold text-[#f2c06f]" }, "v", dir.version)))), /* @__PURE__ */ React.createElement("div", { className: "h-8 w-px bg-gray-600" }), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
39
43
  "img",
40
44
  {
41
- src: `${dir.pluginDir}/resources/image/frame-logo.png`,
45
+ src: `${dir.pluginDir}/resources/image/frame-logo.webp`,
42
46
  alt: "Karin Logo",
43
47
  className: "h-6 w-6 rounded-sm"
44
48
  }
@@ -46,7 +50,75 @@ var DefaultLayoutComponent = ({
46
50
  );
47
51
  };
48
52
 
53
+ // src/exports/render/render.ts
54
+ import karin, { absPath, config as config2, existToMkdirSync, karinPathBase } from "node-karin";
55
+ import fs from "fs";
56
+ import path from "path";
57
+ import React2 from "react";
58
+ import { renderToString } from "react-dom/server";
59
+ var ReactRender = class {
60
+ #renderCfg;
61
+ #pluginOptions;
62
+ constructor(cfg, pluginOptions = {}) {
63
+ this.#renderCfg = cfg;
64
+ this.#pluginOptions = pluginOptions;
65
+ }
66
+ get plugin() {
67
+ return {
68
+ ...this.#pluginOptions,
69
+ name: this.#renderCfg.name,
70
+ version: this.#renderCfg.version,
71
+ resources: {
72
+ default: absPath(path.join(this.#renderCfg.pluginDir, "resources")),
73
+ download: absPath(this.#renderCfg.ResourcesDir)
74
+ }
75
+ };
76
+ }
77
+ get karin() {
78
+ return {
79
+ version: config2.pkg().version
80
+ };
81
+ }
82
+ async template(template, component, props, options = {}) {
83
+ const element = React2.createElement(component, props);
84
+ const appHtml = renderToString(element);
85
+ const coreCssPath = absPath(path.join(dir.pluginDir, "resources", "styles", `${dir.name}.css`));
86
+ const cssPath = this.#renderCfg.name !== dir.name ? absPath(path.join(this.plugin.resources.default, "styles", `${this.#renderCfg.name}.css`)) : "";
87
+ const Html = `
88
+ <!DOCTYPE html>
89
+ <html lang="zh-CN">
90
+ <head>
91
+ <meta charset="UTF-8">
92
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
93
+ <link rel="stylesheet" href="${coreCssPath}">
94
+ <link rel="stylesheet" href="${cssPath}">
95
+ </head>
96
+ <body>
97
+ ${appHtml}
98
+ </body>
99
+ </html>
100
+ `;
101
+ const saveDir = path.join(karinPathBase, "temp", "html", this.#renderCfg.name, template);
102
+ existToMkdirSync(saveDir);
103
+ const savePath = path.join(saveDir, `${options.render?.name || template}-${common_exports.randomString(8, "Lower")}.html`);
104
+ fs.writeFileSync(savePath, Html, "utf-8");
105
+ const image = await karin.render({
106
+ type: options.type || "jpeg",
107
+ omitBackground: options.type === "png",
108
+ selector: "container",
109
+ setViewport: {
110
+ deviceScaleFactor: 3
111
+ },
112
+ ...options.render || {},
113
+ file: absPath(savePath)
114
+ });
115
+ if (!image) return null;
116
+ return "base64://" + image;
117
+ }
118
+ };
119
+
49
120
  export {
50
121
  DefaultLayoutComponent,
51
- React2 as React
122
+ ReactRender,
123
+ React3 as React
52
124
  };