@datawhale/prosemirror-render 0.0.1 → 0.0.2

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 (198) hide show
  1. package/dist/{AttachmentBlock-ChMNTUOo.mjs → AttachmentBlock-BTIBSu4p.js} +2 -2
  2. package/dist/AttachmentBlock-W05YY8zN.cjs +1 -0
  3. package/dist/{AttachmentInline-tbC8BJBy.mjs → AttachmentInline-BF7QTLxZ.js} +2 -2
  4. package/dist/AttachmentInline-CgV-t0WF.cjs +1 -0
  5. package/dist/{AttachmentMenu-B5x8P9_n.mjs → AttachmentMenu-BjM7LAlw.js} +1 -1
  6. package/dist/AttachmentMenu-vc18PNLc.cjs +1 -0
  7. package/dist/{Callout-Cu6HI-xq.mjs → Callout-BH6_xPHP.js} +2 -2
  8. package/dist/Callout-BgG8-zJn.cjs +1 -0
  9. package/dist/{CellOutput-DiKZlIFa.js → CellOutput-CXb77W7X.cjs} +1 -1
  10. package/dist/{CellOutput-C33VK0df.mjs → CellOutput-DJqn5MJH.js} +1 -1
  11. package/dist/{CodeBlock-DWniNUQB.js → CodeBlock-BejcPvxj.cjs} +1 -1
  12. package/dist/{CodeBlock-Cjuxuq7B.mjs → CodeBlock-D9lrTXj3.js} +1 -1
  13. package/dist/FoldBlock-CMDkkdoU.cjs +1 -0
  14. package/dist/{FoldBlock-DRdlU-DX.mjs → FoldBlock-CZwxKsSG.js} +2 -2
  15. package/dist/{Grid-GfmJxM93.mjs → Grid-B53O57Vv.js} +1 -1
  16. package/dist/Grid-Cw9joyDF.cjs +1 -0
  17. package/dist/IFrame-CP2oHuDb.cjs +1 -0
  18. package/dist/{IFrame-CaAOVLGN.mjs → IFrame-DRvqa1hl.js} +1 -1
  19. package/dist/Image-B9Rer9RA.cjs +1 -0
  20. package/dist/{Image-C8v5dCij.mjs → Image-BjIZuyk1.js} +1 -1
  21. package/dist/{MathDisplay-CoGsFzXW.mjs → MathDisplay-BficZWEq.js} +2 -2
  22. package/dist/MathDisplay-D5rx_pee.cjs +1 -0
  23. package/dist/{MathInline-0xTZoIIq.mjs → MathInline-Ca8s53fu.js} +2 -2
  24. package/dist/MathInline-DZ86cc6g.cjs +1 -0
  25. package/dist/{McChoices-Aj394G5E.mjs → McChoices-B8W03KdG.js} +1 -1
  26. package/dist/McChoices-CW1gsp_V.cjs +1 -0
  27. package/dist/McQuestion-DwBWk5S2.cjs +1 -0
  28. package/dist/{McQuestion-DvD-J47M.mjs → McQuestion-WyxeDFjM.js} +1 -1
  29. package/dist/McSolution-BtY7RBEb.cjs +1 -0
  30. package/dist/{McSolution-C5sTXz3y.mjs → McSolution-CRahjdmW.js} +1 -1
  31. package/dist/{MultipleChoice-Dv-k1zUU.mjs → MultipleChoice-BgGHy-NW.js} +4 -4
  32. package/dist/MultipleChoice-mFFm3sQv.cjs +1 -0
  33. package/dist/{Paragraph-DGcZy8t_.mjs → Paragraph-C3uQVRMm.js} +1 -1
  34. package/dist/Paragraph-CU-CMQz2.cjs +1 -0
  35. package/dist/{SlotNode-6OpoUcOa.mjs → SlotNode-BThSEhpr.js} +1 -1
  36. package/dist/SlotNode-ivBAGFTX.cjs +1 -0
  37. package/dist/Text-3RT27QJn.cjs +1 -0
  38. package/dist/{Text-Br_pcGz4.mjs → Text-cG9dlJgd.js} +1 -1
  39. package/dist/{index-DVmWCrQE.mjs → index-C97tUvOp.js} +30 -30
  40. package/dist/index-DuVSDVpW.cjs +1 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +1 -1
  43. package/package.json +8 -2
  44. package/dist/AttachmentBlock-DsmJP3Kw.js +0 -1
  45. package/dist/AttachmentInline-Dc3dp0g-.js +0 -1
  46. package/dist/AttachmentMenu-ExoCOe4B.js +0 -1
  47. package/dist/Callout-DPdOqTb4.js +0 -1
  48. package/dist/FoldBlock-ZPMf0QsR.js +0 -1
  49. package/dist/Grid-QToZdaRT.js +0 -1
  50. package/dist/IFrame-DcCpSoDC.js +0 -1
  51. package/dist/Image-cHL85CXs.js +0 -1
  52. package/dist/MathDisplay-CESKZV46.js +0 -1
  53. package/dist/MathInline-C_1SJUVz.js +0 -1
  54. package/dist/McChoices-B4euzY7M.js +0 -1
  55. package/dist/McQuestion-Dq0aM5tC.js +0 -1
  56. package/dist/McSolution-N79CllH9.js +0 -1
  57. package/dist/MultipleChoice-DTCF3Q8m.js +0 -1
  58. package/dist/Paragraph-CzRSCJNr.js +0 -1
  59. package/dist/SlotNode-DMG0R6Vf.js +0 -1
  60. package/dist/Text-DlUfrsNI.js +0 -1
  61. package/dist/index-D2CtpNvR.js +0 -1
  62. package/src/apis/monitor.ts +0 -8
  63. package/src/apis/tingwu.ts +0 -22
  64. package/src/apis/types.ts +0 -45
  65. package/src/components/TreeRecursive.vue +0 -47
  66. package/src/components/TreeRender.vue +0 -404
  67. package/src/components/collections/async/AsyncError.vue +0 -17
  68. package/src/components/collections/async/AsyncLoading.vue +0 -1
  69. package/src/components/collections/attachment/AttachmentBlock.vue +0 -561
  70. package/src/components/collections/attachment/AttachmentInline.vue +0 -90
  71. package/src/components/collections/attachment/AttachmentMenu.vue +0 -359
  72. package/src/components/collections/attachment/VideoDetail.vue +0 -375
  73. package/src/components/collections/attachment/index.ts +0 -6
  74. package/src/components/collections/basic/Blockquote.vue +0 -15
  75. package/src/components/collections/basic/BulletList.vue +0 -15
  76. package/src/components/collections/basic/HardBreak.vue +0 -11
  77. package/src/components/collections/basic/Heading.vue +0 -15
  78. package/src/components/collections/basic/HorizontalRule.vue +0 -11
  79. package/src/components/collections/basic/ListItem.vue +0 -15
  80. package/src/components/collections/basic/OrderedList.vue +0 -15
  81. package/src/components/collections/basic/Paragraph.vue +0 -19
  82. package/src/components/collections/basic/Text.vue +0 -73
  83. package/src/components/collections/basic/index.ts +0 -13
  84. package/src/components/collections/callout/Callout.vue +0 -77
  85. package/src/components/collections/callout/index.ts +0 -5
  86. package/src/components/collections/code/CellOutput.vue +0 -72
  87. package/src/components/collections/code/CodeBlock.vue +0 -83
  88. package/src/components/collections/code/index.ts +0 -6
  89. package/src/components/collections/fold/FoldBlock.vue +0 -130
  90. package/src/components/collections/fold/index.ts +0 -5
  91. package/src/components/collections/grid/Grid.vue +0 -70
  92. package/src/components/collections/grid/index.ts +0 -5
  93. package/src/components/collections/iframe/IFrame.vue +0 -19
  94. package/src/components/collections/iframe/index.ts +0 -5
  95. package/src/components/collections/img/Image.vue +0 -318
  96. package/src/components/collections/img/index.ts +0 -5
  97. package/src/components/collections/index.ts +0 -29
  98. package/src/components/collections/math/MathDisplay.vue +0 -42
  99. package/src/components/collections/math/MathInline.vue +0 -42
  100. package/src/components/collections/math/index.ts +0 -6
  101. package/src/components/collections/multipleChoice/McChoices.vue +0 -72
  102. package/src/components/collections/multipleChoice/McQuestion.vue +0 -61
  103. package/src/components/collections/multipleChoice/McSolution.vue +0 -47
  104. package/src/components/collections/multipleChoice/MultipleChoice.vue +0 -62
  105. package/src/components/collections/multipleChoice/index.ts +0 -8
  106. package/src/components/collections/table/TableCell.vue +0 -20
  107. package/src/components/collections/table/TableContainer.vue +0 -32
  108. package/src/components/collections/table/TableHeader.vue +0 -15
  109. package/src/components/collections/table/TableRow.vue +0 -15
  110. package/src/components/collections/table/index.ts +0 -8
  111. package/src/components/collections/utils.ts +0 -17
  112. package/src/components/collections/wrapper/Doc.vue +0 -15
  113. package/src/components/collections/wrapper/SlotNode.vue +0 -5
  114. package/src/components/collections/wrapper/index.ts +0 -6
  115. package/src/components/index.ts +0 -1
  116. package/src/icons/Attachment/CardView.vue +0 -21
  117. package/src/icons/Attachment/Code/Bat.vue +0 -26
  118. package/src/icons/Attachment/Code/C.vue +0 -26
  119. package/src/icons/Attachment/Code/Cpp.vue +0 -26
  120. package/src/icons/Attachment/Code/Css.vue +0 -34
  121. package/src/icons/Attachment/Code/Go.vue +0 -26
  122. package/src/icons/Attachment/Code/Html.vue +0 -34
  123. package/src/icons/Attachment/Code/Java.vue +0 -42
  124. package/src/icons/Attachment/Code/Js.vue +0 -26
  125. package/src/icons/Attachment/Code/Json.vue +0 -26
  126. package/src/icons/Attachment/Code/Jsx.vue +0 -30
  127. package/src/icons/Attachment/Code/Md.vue +0 -26
  128. package/src/icons/Attachment/Code/Php.vue +0 -26
  129. package/src/icons/Attachment/Code/Python.vue +0 -30
  130. package/src/icons/Attachment/Code/Rb.vue +0 -26
  131. package/src/icons/Attachment/Code/Sh.vue +0 -30
  132. package/src/icons/Attachment/Code/Sql.vue +0 -30
  133. package/src/icons/Attachment/Code/Swift.vue +0 -26
  134. package/src/icons/Attachment/Code/Ts.vue +0 -26
  135. package/src/icons/Attachment/Code/Tsx.vue +0 -30
  136. package/src/icons/Attachment/Code/Vue.vue +0 -24
  137. package/src/icons/Attachment/Excel.vue +0 -26
  138. package/src/icons/Attachment/Eye.vue +0 -15
  139. package/src/icons/Attachment/FullScreen.vue +0 -15
  140. package/src/icons/Attachment/InlineView.vue +0 -21
  141. package/src/icons/Attachment/Pdf.vue +0 -25
  142. package/src/icons/Attachment/Ppt.vue +0 -26
  143. package/src/icons/Attachment/PreviewView.vue +0 -21
  144. package/src/icons/Attachment/UnknownFile.vue +0 -26
  145. package/src/icons/Attachment/VideoIcon.vue +0 -25
  146. package/src/icons/Attachment/VideoPlay.vue +0 -15
  147. package/src/icons/Attachment/Word.vue +0 -26
  148. package/src/icons/Code/Confirm.vue +0 -38
  149. package/src/icons/Code/Paste.vue +0 -8
  150. package/src/icons/Common/Choice.vue +0 -28
  151. package/src/icons/Common/Close.vue +0 -15
  152. package/src/icons/Common/Comment.vue +0 -16
  153. package/src/icons/Common/CopyAnchorLink.vue +0 -15
  154. package/src/icons/Common/Delete.vue +0 -15
  155. package/src/icons/Common/Download.vue +0 -15
  156. package/src/icons/Common/FoldClose.vue +0 -9
  157. package/src/icons/Common/FoldOpen.vue +0 -9
  158. package/src/icons/Common/Plate.vue +0 -23
  159. package/src/icons/Common/Question.vue +0 -8
  160. package/src/icons/Common/ShareTextLink.vue +0 -15
  161. package/src/index.ts +0 -3
  162. package/src/types.ts +0 -236
  163. package/src/utils/common.ts +0 -6
  164. package/src/utils/emoji.ts +0 -3715
  165. package/src/utils/globalStatus.ts +0 -19
  166. package/src/utils/shiki.ts +0 -25
  167. package/src/utils/useAttachment.ts +0 -215
  168. package/tsconfig.build.json +0 -10
  169. package/tsconfig.json +0 -23
  170. package/vite.config.ts +0 -24
  171. /package/dist/{Blockquote-BamWUQND.mjs → Blockquote-BamWUQND.js} +0 -0
  172. /package/dist/{Blockquote-CQSBFnsu.js → Blockquote-CQSBFnsu.cjs} +0 -0
  173. /package/dist/{BulletList-BQTUD69X.mjs → BulletList-BQTUD69X.js} +0 -0
  174. /package/dist/{BulletList-CFjF3U-l.js → BulletList-CFjF3U-l.cjs} +0 -0
  175. /package/dist/{Doc-6s4VMDsx.mjs → Doc-6s4VMDsx.js} +0 -0
  176. /package/dist/{Doc-D2yvlSII.js → Doc-D2yvlSII.cjs} +0 -0
  177. /package/dist/{HardBreak-B2tFO31P.mjs → HardBreak-B2tFO31P.js} +0 -0
  178. /package/dist/{HardBreak-Dbf5Zg5o.js → HardBreak-Dbf5Zg5o.cjs} +0 -0
  179. /package/dist/{Heading-BElRvhGn.mjs → Heading-BElRvhGn.js} +0 -0
  180. /package/dist/{Heading-BUnffIAz.js → Heading-BUnffIAz.cjs} +0 -0
  181. /package/dist/{HorizontalRule-BRG45oT0.mjs → HorizontalRule-BRG45oT0.js} +0 -0
  182. /package/dist/{HorizontalRule-CE09LZGf.js → HorizontalRule-CE09LZGf.cjs} +0 -0
  183. /package/dist/{ListItem-BrjxeGxz.js → ListItem-BrjxeGxz.cjs} +0 -0
  184. /package/dist/{ListItem-X0T7a_z8.mjs → ListItem-X0T7a_z8.js} +0 -0
  185. /package/dist/{OrderedList-B8v1gchv.mjs → OrderedList-B8v1gchv.js} +0 -0
  186. /package/dist/{OrderedList-DMl3tvwP.js → OrderedList-DMl3tvwP.cjs} +0 -0
  187. /package/dist/{TableCell-BY9gdldc.js → TableCell-BY9gdldc.cjs} +0 -0
  188. /package/dist/{TableCell-Bp52L368.mjs → TableCell-Bp52L368.js} +0 -0
  189. /package/dist/{TableContainer-C5KXY6f7.js → TableContainer-C5KXY6f7.cjs} +0 -0
  190. /package/dist/{TableContainer-C9PhNGlz.mjs → TableContainer-C9PhNGlz.js} +0 -0
  191. /package/dist/{TableHeader-BTuqvorM.js → TableHeader-BTuqvorM.cjs} +0 -0
  192. /package/dist/{TableHeader-C7KKz3e1.mjs → TableHeader-C7KKz3e1.js} +0 -0
  193. /package/dist/{TableRow-D4F6AKFt.js → TableRow-D4F6AKFt.cjs} +0 -0
  194. /package/dist/{TableRow-OzpVq1qW.mjs → TableRow-OzpVq1qW.js} +0 -0
  195. /package/dist/{emoji-Bk6FG72F.js → emoji-Bk6FG72F.cjs} +0 -0
  196. /package/dist/{emoji-CmOToDEU.mjs → emoji-CmOToDEU.js} +0 -0
  197. /package/dist/{katex-CS0ZfoxP.js → katex-CS0ZfoxP.cjs} +0 -0
  198. /package/dist/{katex-r9TeExgs.mjs → katex-r9TeExgs.js} +0 -0
@@ -1,23 +0,0 @@
1
- <template>
2
- <svg
3
- width="1em"
4
- height="1em"
5
- viewBox="0 0 24 24"
6
- fill="none"
7
- xmlns="http://www.w3.org/2000/svg"
8
- data-icon="StyleSetOutlined"
9
- >
10
- <path
11
- d="M21.957 2.13a1 1 0 0 0-1.406.147l-9.11 11.25a6.632 6.632 0 0 0-1.367 2.969.221.221 0 0 0 .302.244 6.632 6.632 0 0 0 2.62-1.955l9.109-11.25a1 1 0 0 0-.148-1.406Z"
12
- fill="currentColor"
13
- ></path>
14
- <path
15
- d="M17.008 3.665a13.454 13.454 0 0 0-5.06-.984l-.024.004-.538.011-.51.03c-1.191.091-2.37.343-3.51.75a12.305 12.305 0 0 0-3.754 2.142c-1.096.922-1.96 1.99-2.568 3.176a8.435 8.435 0 0 0-.96 3.885c0 1.335.324 2.63.962 3.848.608 1.157 1.474 2.195 2.573 3.083a12.303 12.303 0 0 0 3.755 2.049c1.444.494 2.981.745 4.563.745l.545-.01.525-.029a14.43 14.43 0 0 0 1.57-.203l.722-.148.196-.06c.514-.186.96-.566 1.253-1.083a2.87 2.87 0 0 0 .26-2.178l-.09-.349-.03-.218a2.301 2.301 0 0 1 .357-1.454c.357-.544.93-.868 1.538-.871h1.768l.204-.007c1.614-.113 2.91-1.56 3.007-3.365l.006-.22-.006-.24-.05-.432-.067-.404a8.844 8.844 0 0 0-1.236-3.08 10.13 10.13 0 0 0-.802-1.096l-1.199 1.48c.154.2.298.406.43.617.483.76.81 1.563.974 2.393l.06.358.032.276.003.086-.007.22-.021.169c-.12.724-.604 1.301-1.19 1.38l-.138.01h-1.77l-.247.008c-1.14.079-2.192.702-2.847 1.7a4.145 4.145 0 0 0-.574 3.156l.068.273.037.13.028.154a.993.993 0 0 1-.118.588.58.58 0 0 1-.248.247l-.07.021-.67.134-.549.085a12.6 12.6 0 0 1-1.657.11 12.18 12.18 0 0 1-3.961-.647 10.426 10.426 0 0 1-3.19-1.734c-.9-.729-1.606-1.57-2.096-2.5a6.38 6.38 0 0 1-.75-2.984c0-1.037.254-2.06.755-3.034.495-.963 1.206-1.839 2.11-2.6A10.494 10.494 0 0 1 7.99 5.235a11.42 11.42 0 0 1 3.41-.677l.538-.01.496.01c1.153.048 2.281.264 3.338.633l1.236-1.526Z"
16
- fill="currentColor"
17
- ></path>
18
- <path
19
- d="M6.875 14.466a1.377 1.377 0 0 0-1.374-1.374 1.375 1.375 0 0 0 0 2.747c.758 0 1.374-.616 1.374-1.373ZM8.124 9.47a1.375 1.375 0 0 0-2.748 0 1.374 1.374 0 1 0 2.748 0Zm5.246-1.874a1.374 1.374 0 1 0-2.747-.001 1.374 1.374 0 0 0 2.747 0Z"
20
- fill="currentColor"
21
- ></path>
22
- </svg>
23
- </template>
@@ -1,8 +0,0 @@
1
- <template>
2
- <svg fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
3
- <path
4
- d="M14.4987 3C15.8793 3 16.9985 4.11916 16.9985 5.49972V9.00234C16.6571 9.0179 16.3179 9.0941 15.9986 9.23094V6.99956H3.99989V14.4987C3.99989 15.3271 4.67139 15.9986 5.49972 15.9986H9.47395C9.45833 16.0499 9.44398 16.1017 9.43092 16.1539L9.21979 16.9985H5.49972C4.11916 16.9985 3 15.8793 3 14.4987V5.49972C3 4.11916 4.11916 3 5.49972 3H14.4987ZM14.4987 3.99989H5.49972C4.67139 3.99989 3.99989 4.67139 3.99989 5.49972V5.99967H15.9986V5.49972C15.9986 4.67139 15.3271 3.99989 14.4987 3.99989ZM10.9789 15.3758L15.8078 10.5469C16.538 9.81666 17.722 9.81666 18.4523 10.5469C19.1826 11.2772 19.1826 12.4612 18.4523 13.1915L13.6234 18.0204C13.3419 18.3019 12.9891 18.5016 12.6028 18.5982L11.1051 18.9726C10.4537 19.1355 9.86376 18.5455 10.0266 17.8942L10.401 16.3964C10.4976 16.0101 10.6973 15.6574 10.9789 15.3758Z"
5
- fill="#212121"
6
- />
7
- </svg>
8
- </template>
@@ -1,15 +0,0 @@
1
- <template>
2
- <svg
3
- width="1em"
4
- height="1em"
5
- viewBox="0 0 24 24"
6
- fill="none"
7
- xmlns="http://www.w3.org/2000/svg"
8
- data-icon="SharewordsOutlined"
9
- >
10
- <path
11
- d="M21.5 5c0-.552-.473-1-1.055-1H3.555C2.974 4 2.5 4.448 2.5 5s.473 1 1.056 1h16.889c.582 0 1.055-.448 1.055-1Zm-9.617 6c.647 0 1.172.448 1.172 1s-.525 1-1.172 1h-8.21c-.648 0-1.173-.448-1.173-1s.525-1 1.173-1h8.21Zm-3.167 7c.648 0 1.173.448 1.173 1s-.525 1-1.173 1H3.673c-.648 0-1.173-.448-1.173-1s.525-1 1.173-1h5.043Zm9.077-8.242a1 1 0 0 1 1.415 0l3.535 3.535a1 1 0 0 1 0 1.415l-3.535 3.535a1 1 0 0 1-1.415-1.414l1.822-1.822c-1.819.07-3.162.64-4.065 1.543-.965.965-1.55 2.435-1.55 4.45a1 1 0 1 1-2 0c0-2.403.706-4.434 2.136-5.864 1.356-1.356 3.251-2.06 5.491-2.13l-1.834-1.834a1 1 0 0 1 0-1.414Z"
12
- fill="rgb(43, 47, 54)"
13
- ></path>
14
- </svg>
15
- </template>
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import TreeRender from './components/TreeRender.vue';
2
-
3
- export { TreeRender };
package/src/types.ts DELETED
@@ -1,236 +0,0 @@
1
- export type PMNode<T = object> = Omit<
2
- {
3
- type: string;
4
- content?: PMNode[];
5
- },
6
- keyof T
7
- > &
8
- T;
9
-
10
- export type StrongMark = { type: "bold" };
11
- export type EmphasisMark = { type: "italic" };
12
- export type UnderlineMark = { type: "underline" };
13
- export type StrikeMark = { type: "strike" };
14
- export type CodeMark = { type: "code" };
15
- export type TextStyleMark = { type: "textStyle"; attrs: { color: string } };
16
- export type HighlightMark = { type: "highlight"; attrs: { color: string } };
17
- export type LinkMark = {
18
- type: "link";
19
- attrs: { href: string; target: string; class: object; rel: string };
20
- };
21
- export type MarkType =
22
- | StrongMark
23
- | EmphasisMark
24
- | UnderlineMark
25
- | StrikeMark
26
- | CodeMark
27
- | TextStyleMark
28
- | HighlightMark
29
- | LinkMark;
30
-
31
- export type PMInline<T = object> = PMNode<T>;
32
- export type PMText = PMInline<{
33
- type: "text";
34
- text: string;
35
- marks?: MarkType[];
36
- }>;
37
- export type PMHardBreak = PMInline<{ type: "hardBreak" }>;
38
- export type PMInlineMath = PMInline<{ type: "math_inline"; content: PMText[] }>;
39
- export type PMMath = PMNode<{
40
- type: "math_display";
41
- content: PMText[];
42
- attrs: { "block-id": string };
43
- }>;
44
-
45
- export type PMDoc = PMNode<{ type: "doc"; content: PMNode[] }>;
46
-
47
- export type PMHeading = PMNode<{
48
- type: "heading";
49
- attrs: { level: number; id?: string };
50
- content: PMText[];
51
- }>;
52
-
53
- export type PMParagraph = PMNode<{
54
- type: "paragraph";
55
- content: PMInline[];
56
- attrs: { "block-id": string };
57
- }>;
58
-
59
- export type PMListItem = PMNode<{ type: "listItem"; content: PMNode[] }>;
60
- export type PMBulletList = PMNode<{
61
- type: "bulletList";
62
- content: PMListItem[];
63
- attrs: { "block-id": string };
64
- }>;
65
- export type PMOrderedList = PMNode<{
66
- type: "orderedList";
67
- attrs: { start: number; "block-id": string };
68
- content: PMListItem[];
69
- }>;
70
-
71
- export type PMThematicBreak = PMNode<{ type: "horizontalRule" }>;
72
-
73
- export type PMBlockquote = PMNode<{
74
- type: "blockquote";
75
- content: PMNode[];
76
- attrs: { "block-id": string };
77
- }>;
78
-
79
- export type PMTableCell = PMNode<{
80
- type: "tableCell";
81
- attrs: {
82
- colspan: number;
83
- rowspan: number;
84
- colwidth: number[] | null;
85
- style: string | null;
86
- bgColor: string | null;
87
- };
88
- content: PMNode[];
89
- }>;
90
- export type PMTableHeader = PMNode<{
91
- type: "tableHeader";
92
- attrs: { colwidth: number[] | null };
93
- content: PMTableCell[];
94
- }>;
95
- export type PMTableRow = PMNode<{
96
- type: "tableRow";
97
- content: (PMTableCell | PMTableHeader)[];
98
- }>;
99
- export type PMTable = PMNode<{
100
- type: "table";
101
- content: PMTableRow[];
102
- attrs: { "block-id": string };
103
- }>;
104
-
105
- export type PMImg = PMNode<{
106
- type: "image";
107
- attrs: {
108
- src: string;
109
- width: string;
110
- height?: string;
111
- align: string;
112
- caption: string | null;
113
- "block-id": string;
114
- };
115
- }>;
116
-
117
- export type PMCode = PMNode<{
118
- type: "codeBlock";
119
- attrs: { language: string; "block-id": string };
120
- content: PMText[];
121
- }>;
122
-
123
- export type PMLarkCallout = PMNode<{
124
- type: "callout";
125
- attrs: {
126
- bgColor: string;
127
- bdColor: string;
128
- emoji?: string;
129
- "block-id": string;
130
- };
131
- content: PMNode[];
132
- }>;
133
-
134
- export enum ATTACHMENT_DISP_TYPE {
135
- INLINE = "inline",
136
- CARD = "card",
137
- PREVIEW = "preview",
138
- }
139
-
140
- interface AttachmentAttributes {
141
- attachmentId?: string | null;
142
- fileName: string;
143
- fileType: string;
144
- fileSize: number; // 单位:字节
145
- videoWidth?: number | null;
146
- videoHeight?: number | null;
147
- src: string;
148
- dispType: ATTACHMENT_DISP_TYPE;
149
- uploadProgress?: number;
150
- uploadError?: boolean;
151
- "block-id": string;
152
- tingwuTaskId?: string;
153
- [key: string]: any;
154
- }
155
-
156
- export type PMAttachmentInline = PMNode<{
157
- type: "attachment-inline";
158
- attrs: AttachmentAttributes;
159
- }>;
160
-
161
- export type PMAttachmentBlock = PMNode<{
162
- type: "attachment-block";
163
- attrs: AttachmentAttributes;
164
- }>;
165
-
166
- export type PMFoldBlock = PMNode<{
167
- type: "foldBlock";
168
- attrs: {
169
- initFolded: boolean;
170
- bgColor: string;
171
- bdColor: string;
172
- "block-id": string;
173
- };
174
- content: [PMFoldBlockHeader, PMFoldBlockContent];
175
- }>;
176
- export type PMFoldBlockHeader = PMNode<{
177
- type: "foldBlockHeader";
178
- attrs: { emoji: string };
179
- content: [PMParagraph];
180
- }>;
181
- export type PMFoldBlockContent = PMNode<{
182
- type: "foldBlockContent";
183
- content: PMNode[];
184
- }>;
185
-
186
- export type PMColumn = PMNode<{
187
- type: "column";
188
- attrs: { colWidth: number; frac?: number };
189
- content: PMNode[];
190
- }>;
191
- export type PMGrid = PMNode<{
192
- type: "grid";
193
- content: PMColumn[];
194
- attrs: { "block-id": string };
195
- }>;
196
-
197
- export type CellOutputType =
198
- | "text"
199
- | "html"
200
- | "image"
201
- | "stream"
202
- | "error"
203
- | "empty";
204
- export type PMCellOutput = PMNode<{
205
- type: "cellOutput";
206
- attrs: { outputType: CellOutputType; "block-id": string };
207
- }>;
208
-
209
- export type PMMultipleChoice = PMNode<{
210
- type: "multipleChoice";
211
- content: [PMMCQuestion, PMMCChoices, PMMCSolution];
212
- attrs: { "block-id": string };
213
- }>;
214
-
215
- export type PMMCQuestion = PMNode<{
216
- type: "mcQuestion";
217
- content: [PMParagraph];
218
- }>;
219
-
220
- export type PMMCChoices = PMNode<{
221
- type: "mcChoices";
222
- attrs: {
223
- correctIndex: number;
224
- };
225
- content: PMParagraph[];
226
- }>;
227
-
228
- export type PMMCSolution = PMNode<{
229
- type: "mcSolution";
230
- content: PMParagraph[];
231
- }>;
232
-
233
- export type PMIFrame = PMNode<{
234
- type: "iframe";
235
- attrs: { src: string; "block-id": string };
236
- }>;
@@ -1,6 +0,0 @@
1
- export function resolvedFileUrl(url: string) {
2
- const lastSlashIndex = url.lastIndexOf('/');
3
- const basePath = url.substring(0, lastSlashIndex + 1);
4
- const fileName = url.substring(lastSlashIndex + 1);
5
- return basePath + encodeURIComponent(fileName);
6
- }