@datawhale/prosemirror-render 0.0.1 → 0.0.3

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 (199) hide show
  1. package/dist/{AttachmentBlock-ChMNTUOo.mjs → AttachmentBlock-BU56Jral.js} +100 -107
  2. package/dist/AttachmentBlock-D4287MIh.cjs +1 -0
  3. package/dist/AttachmentInline-DjENK-yS.cjs +1 -0
  4. package/dist/{AttachmentInline-tbC8BJBy.mjs → AttachmentInline-Dpuxwof6.js} +2 -2
  5. package/dist/{AttachmentMenu-B5x8P9_n.mjs → AttachmentMenu-CGVTP1Yv.js} +1 -1
  6. package/dist/AttachmentMenu-DbbJfEmt.cjs +1 -0
  7. package/dist/{Callout-Cu6HI-xq.mjs → Callout-BXchNfJk.js} +2 -2
  8. package/dist/Callout-DaFC0yQ4.cjs +1 -0
  9. package/dist/{CellOutput-DiKZlIFa.js → CellOutput-B7Lb-RKC.cjs} +1 -1
  10. package/dist/{CellOutput-C33VK0df.mjs → CellOutput-DvijyrkS.js} +1 -1
  11. package/dist/{CodeBlock-Cjuxuq7B.mjs → CodeBlock-B2ZZtPly.js} +1 -1
  12. package/dist/{CodeBlock-DWniNUQB.js → CodeBlock-CdWT5lK0.cjs} +1 -1
  13. package/dist/{FoldBlock-DRdlU-DX.mjs → FoldBlock-DndxoDsF.js} +2 -2
  14. package/dist/FoldBlock-HGN28wvI.cjs +1 -0
  15. package/dist/{Grid-GfmJxM93.mjs → Grid-253iqCMF.js} +1 -1
  16. package/dist/Grid-xOWRvjRR.cjs +1 -0
  17. package/dist/{IFrame-CaAOVLGN.mjs → IFrame-CY4qkGFL.js} +1 -1
  18. package/dist/IFrame-k7fk5enb.cjs +1 -0
  19. package/dist/Image-DkfpQMVQ.cjs +1 -0
  20. package/dist/{Image-C8v5dCij.mjs → Image-R6iVek-9.js} +1 -1
  21. package/dist/MathDisplay-Bimaa4Y6.cjs +1 -0
  22. package/dist/{MathDisplay-CoGsFzXW.mjs → MathDisplay-CEY2k2fV.js} +2 -2
  23. package/dist/{MathInline-0xTZoIIq.mjs → MathInline-Bz9Baz68.js} +2 -2
  24. package/dist/MathInline-C3GWYu2n.cjs +1 -0
  25. package/dist/McChoices-Cq68UY4X.cjs +1 -0
  26. package/dist/{McChoices-Aj394G5E.mjs → McChoices-D3HhRraE.js} +1 -1
  27. package/dist/{McQuestion-DvD-J47M.mjs → McQuestion-BtWjhEnd.js} +1 -1
  28. package/dist/McQuestion-D7skHE3m.cjs +1 -0
  29. package/dist/{McSolution-C5sTXz3y.mjs → McSolution-DiMXYCQt.js} +1 -1
  30. package/dist/McSolution-ytOHw96W.cjs +1 -0
  31. package/dist/MultipleChoice-Byg7IpwO.cjs +1 -0
  32. package/dist/{MultipleChoice-Dv-k1zUU.mjs → MultipleChoice-Cl8wfstN.js} +4 -4
  33. package/dist/Paragraph-Bc08aEUA.cjs +1 -0
  34. package/dist/{Paragraph-DGcZy8t_.mjs → Paragraph-BipTa7mo.js} +1 -1
  35. package/dist/SlotNode-BBgyADP6.cjs +1 -0
  36. package/dist/{SlotNode-6OpoUcOa.mjs → SlotNode-Dy-7S7b1.js} +1 -1
  37. package/dist/{Text-Br_pcGz4.mjs → Text-CRiw47FV.js} +1 -1
  38. package/dist/Text-DmgJshdk.cjs +1 -0
  39. package/dist/index-CEnrh8_5.cjs +1 -0
  40. package/dist/{index-DVmWCrQE.mjs → index-CnHgx6Xd.js} +30 -30
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +1 -1
  43. package/dist/prosemirror-render.css +1 -1
  44. package/package.json +10 -3
  45. package/dist/AttachmentBlock-DsmJP3Kw.js +0 -1
  46. package/dist/AttachmentInline-Dc3dp0g-.js +0 -1
  47. package/dist/AttachmentMenu-ExoCOe4B.js +0 -1
  48. package/dist/Callout-DPdOqTb4.js +0 -1
  49. package/dist/FoldBlock-ZPMf0QsR.js +0 -1
  50. package/dist/Grid-QToZdaRT.js +0 -1
  51. package/dist/IFrame-DcCpSoDC.js +0 -1
  52. package/dist/Image-cHL85CXs.js +0 -1
  53. package/dist/MathDisplay-CESKZV46.js +0 -1
  54. package/dist/MathInline-C_1SJUVz.js +0 -1
  55. package/dist/McChoices-B4euzY7M.js +0 -1
  56. package/dist/McQuestion-Dq0aM5tC.js +0 -1
  57. package/dist/McSolution-N79CllH9.js +0 -1
  58. package/dist/MultipleChoice-DTCF3Q8m.js +0 -1
  59. package/dist/Paragraph-CzRSCJNr.js +0 -1
  60. package/dist/SlotNode-DMG0R6Vf.js +0 -1
  61. package/dist/Text-DlUfrsNI.js +0 -1
  62. package/dist/index-D2CtpNvR.js +0 -1
  63. package/src/apis/monitor.ts +0 -8
  64. package/src/apis/tingwu.ts +0 -22
  65. package/src/apis/types.ts +0 -45
  66. package/src/components/TreeRecursive.vue +0 -47
  67. package/src/components/TreeRender.vue +0 -404
  68. package/src/components/collections/async/AsyncError.vue +0 -17
  69. package/src/components/collections/async/AsyncLoading.vue +0 -1
  70. package/src/components/collections/attachment/AttachmentBlock.vue +0 -561
  71. package/src/components/collections/attachment/AttachmentInline.vue +0 -90
  72. package/src/components/collections/attachment/AttachmentMenu.vue +0 -359
  73. package/src/components/collections/attachment/VideoDetail.vue +0 -375
  74. package/src/components/collections/attachment/index.ts +0 -6
  75. package/src/components/collections/basic/Blockquote.vue +0 -15
  76. package/src/components/collections/basic/BulletList.vue +0 -15
  77. package/src/components/collections/basic/HardBreak.vue +0 -11
  78. package/src/components/collections/basic/Heading.vue +0 -15
  79. package/src/components/collections/basic/HorizontalRule.vue +0 -11
  80. package/src/components/collections/basic/ListItem.vue +0 -15
  81. package/src/components/collections/basic/OrderedList.vue +0 -15
  82. package/src/components/collections/basic/Paragraph.vue +0 -19
  83. package/src/components/collections/basic/Text.vue +0 -73
  84. package/src/components/collections/basic/index.ts +0 -13
  85. package/src/components/collections/callout/Callout.vue +0 -77
  86. package/src/components/collections/callout/index.ts +0 -5
  87. package/src/components/collections/code/CellOutput.vue +0 -72
  88. package/src/components/collections/code/CodeBlock.vue +0 -83
  89. package/src/components/collections/code/index.ts +0 -6
  90. package/src/components/collections/fold/FoldBlock.vue +0 -130
  91. package/src/components/collections/fold/index.ts +0 -5
  92. package/src/components/collections/grid/Grid.vue +0 -70
  93. package/src/components/collections/grid/index.ts +0 -5
  94. package/src/components/collections/iframe/IFrame.vue +0 -19
  95. package/src/components/collections/iframe/index.ts +0 -5
  96. package/src/components/collections/img/Image.vue +0 -318
  97. package/src/components/collections/img/index.ts +0 -5
  98. package/src/components/collections/index.ts +0 -29
  99. package/src/components/collections/math/MathDisplay.vue +0 -42
  100. package/src/components/collections/math/MathInline.vue +0 -42
  101. package/src/components/collections/math/index.ts +0 -6
  102. package/src/components/collections/multipleChoice/McChoices.vue +0 -72
  103. package/src/components/collections/multipleChoice/McQuestion.vue +0 -61
  104. package/src/components/collections/multipleChoice/McSolution.vue +0 -47
  105. package/src/components/collections/multipleChoice/MultipleChoice.vue +0 -62
  106. package/src/components/collections/multipleChoice/index.ts +0 -8
  107. package/src/components/collections/table/TableCell.vue +0 -20
  108. package/src/components/collections/table/TableContainer.vue +0 -32
  109. package/src/components/collections/table/TableHeader.vue +0 -15
  110. package/src/components/collections/table/TableRow.vue +0 -15
  111. package/src/components/collections/table/index.ts +0 -8
  112. package/src/components/collections/utils.ts +0 -17
  113. package/src/components/collections/wrapper/Doc.vue +0 -15
  114. package/src/components/collections/wrapper/SlotNode.vue +0 -5
  115. package/src/components/collections/wrapper/index.ts +0 -6
  116. package/src/components/index.ts +0 -1
  117. package/src/icons/Attachment/CardView.vue +0 -21
  118. package/src/icons/Attachment/Code/Bat.vue +0 -26
  119. package/src/icons/Attachment/Code/C.vue +0 -26
  120. package/src/icons/Attachment/Code/Cpp.vue +0 -26
  121. package/src/icons/Attachment/Code/Css.vue +0 -34
  122. package/src/icons/Attachment/Code/Go.vue +0 -26
  123. package/src/icons/Attachment/Code/Html.vue +0 -34
  124. package/src/icons/Attachment/Code/Java.vue +0 -42
  125. package/src/icons/Attachment/Code/Js.vue +0 -26
  126. package/src/icons/Attachment/Code/Json.vue +0 -26
  127. package/src/icons/Attachment/Code/Jsx.vue +0 -30
  128. package/src/icons/Attachment/Code/Md.vue +0 -26
  129. package/src/icons/Attachment/Code/Php.vue +0 -26
  130. package/src/icons/Attachment/Code/Python.vue +0 -30
  131. package/src/icons/Attachment/Code/Rb.vue +0 -26
  132. package/src/icons/Attachment/Code/Sh.vue +0 -30
  133. package/src/icons/Attachment/Code/Sql.vue +0 -30
  134. package/src/icons/Attachment/Code/Swift.vue +0 -26
  135. package/src/icons/Attachment/Code/Ts.vue +0 -26
  136. package/src/icons/Attachment/Code/Tsx.vue +0 -30
  137. package/src/icons/Attachment/Code/Vue.vue +0 -24
  138. package/src/icons/Attachment/Excel.vue +0 -26
  139. package/src/icons/Attachment/Eye.vue +0 -15
  140. package/src/icons/Attachment/FullScreen.vue +0 -15
  141. package/src/icons/Attachment/InlineView.vue +0 -21
  142. package/src/icons/Attachment/Pdf.vue +0 -25
  143. package/src/icons/Attachment/Ppt.vue +0 -26
  144. package/src/icons/Attachment/PreviewView.vue +0 -21
  145. package/src/icons/Attachment/UnknownFile.vue +0 -26
  146. package/src/icons/Attachment/VideoIcon.vue +0 -25
  147. package/src/icons/Attachment/VideoPlay.vue +0 -15
  148. package/src/icons/Attachment/Word.vue +0 -26
  149. package/src/icons/Code/Confirm.vue +0 -38
  150. package/src/icons/Code/Paste.vue +0 -8
  151. package/src/icons/Common/Choice.vue +0 -28
  152. package/src/icons/Common/Close.vue +0 -15
  153. package/src/icons/Common/Comment.vue +0 -16
  154. package/src/icons/Common/CopyAnchorLink.vue +0 -15
  155. package/src/icons/Common/Delete.vue +0 -15
  156. package/src/icons/Common/Download.vue +0 -15
  157. package/src/icons/Common/FoldClose.vue +0 -9
  158. package/src/icons/Common/FoldOpen.vue +0 -9
  159. package/src/icons/Common/Plate.vue +0 -23
  160. package/src/icons/Common/Question.vue +0 -8
  161. package/src/icons/Common/ShareTextLink.vue +0 -15
  162. package/src/index.ts +0 -3
  163. package/src/types.ts +0 -236
  164. package/src/utils/common.ts +0 -6
  165. package/src/utils/emoji.ts +0 -3715
  166. package/src/utils/globalStatus.ts +0 -19
  167. package/src/utils/shiki.ts +0 -25
  168. package/src/utils/useAttachment.ts +0 -215
  169. package/tsconfig.build.json +0 -10
  170. package/tsconfig.json +0 -23
  171. package/vite.config.ts +0 -24
  172. /package/dist/{Blockquote-BamWUQND.mjs → Blockquote-BamWUQND.js} +0 -0
  173. /package/dist/{Blockquote-CQSBFnsu.js → Blockquote-CQSBFnsu.cjs} +0 -0
  174. /package/dist/{BulletList-BQTUD69X.mjs → BulletList-BQTUD69X.js} +0 -0
  175. /package/dist/{BulletList-CFjF3U-l.js → BulletList-CFjF3U-l.cjs} +0 -0
  176. /package/dist/{Doc-6s4VMDsx.mjs → Doc-6s4VMDsx.js} +0 -0
  177. /package/dist/{Doc-D2yvlSII.js → Doc-D2yvlSII.cjs} +0 -0
  178. /package/dist/{HardBreak-B2tFO31P.mjs → HardBreak-B2tFO31P.js} +0 -0
  179. /package/dist/{HardBreak-Dbf5Zg5o.js → HardBreak-Dbf5Zg5o.cjs} +0 -0
  180. /package/dist/{Heading-BElRvhGn.mjs → Heading-BElRvhGn.js} +0 -0
  181. /package/dist/{Heading-BUnffIAz.js → Heading-BUnffIAz.cjs} +0 -0
  182. /package/dist/{HorizontalRule-BRG45oT0.mjs → HorizontalRule-BRG45oT0.js} +0 -0
  183. /package/dist/{HorizontalRule-CE09LZGf.js → HorizontalRule-CE09LZGf.cjs} +0 -0
  184. /package/dist/{ListItem-BrjxeGxz.js → ListItem-BrjxeGxz.cjs} +0 -0
  185. /package/dist/{ListItem-X0T7a_z8.mjs → ListItem-X0T7a_z8.js} +0 -0
  186. /package/dist/{OrderedList-B8v1gchv.mjs → OrderedList-B8v1gchv.js} +0 -0
  187. /package/dist/{OrderedList-DMl3tvwP.js → OrderedList-DMl3tvwP.cjs} +0 -0
  188. /package/dist/{TableCell-BY9gdldc.js → TableCell-BY9gdldc.cjs} +0 -0
  189. /package/dist/{TableCell-Bp52L368.mjs → TableCell-Bp52L368.js} +0 -0
  190. /package/dist/{TableContainer-C5KXY6f7.js → TableContainer-C5KXY6f7.cjs} +0 -0
  191. /package/dist/{TableContainer-C9PhNGlz.mjs → TableContainer-C9PhNGlz.js} +0 -0
  192. /package/dist/{TableHeader-BTuqvorM.js → TableHeader-BTuqvorM.cjs} +0 -0
  193. /package/dist/{TableHeader-C7KKz3e1.mjs → TableHeader-C7KKz3e1.js} +0 -0
  194. /package/dist/{TableRow-D4F6AKFt.js → TableRow-D4F6AKFt.cjs} +0 -0
  195. /package/dist/{TableRow-OzpVq1qW.mjs → TableRow-OzpVq1qW.js} +0 -0
  196. /package/dist/{emoji-Bk6FG72F.js → emoji-Bk6FG72F.cjs} +0 -0
  197. /package/dist/{emoji-CmOToDEU.mjs → emoji-CmOToDEU.js} +0 -0
  198. /package/dist/{katex-CS0ZfoxP.js → katex-CS0ZfoxP.cjs} +0 -0
  199. /package/dist/{katex-r9TeExgs.mjs → katex-r9TeExgs.js} +0 -0
@@ -1,72 +0,0 @@
1
- <template>
2
- <template v-if="outputType != 'empty'">
3
- <div class="cell-ouput-container">
4
- <template v-if="outputType === 'error'">
5
- <pre class="jp-error monospace-text"><Ansi>{{ ensureString(value) }}</Ansi></pre>
6
- </template>
7
- <template v-else-if="outputType === 'stream'">
8
- <pre class="monospace-text">{{ value }}</pre>
9
- </template>
10
- <template v-else-if="outputType === 'image'">
11
- <img :src="value?.startsWith('http') ? value : 'data:image/png;base64,' + value" class="jp-img" />
12
- </template>
13
- <template v-else-if="outputType === 'html'">
14
- <div v-html="value"></div>
15
- </template>
16
- <template v-else-if="outputType === 'text'">
17
- <pre class="monospace-text">{{ value }}</pre>
18
- </template>
19
- </div>
20
- </template>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import Ansi from 'ansi-to-vue3';
25
- import { computed } from 'vue';
26
- import type { PMCellOutput, PMText } from '@datawhale/dipwap-types/index';
27
-
28
- const { node } = defineProps<{
29
- node: PMCellOutput;
30
- }>();
31
- const outputType = computed(() => node.attrs.outputType);
32
- const value = computed(() => (node.content ? (node.content[0] as PMText).text : undefined));
33
-
34
- function ensureString(maybeString: string[] | string | undefined, joinWith = '\n'): string {
35
- if (!maybeString) return '';
36
- if (typeof maybeString === 'string') return maybeString;
37
- if (maybeString.join) return maybeString.join(joinWith);
38
- return maybeString as unknown as string;
39
- }
40
- </script>
41
-
42
- <style scoped>
43
- pre {
44
- margin: 0;
45
- padding: 0 10px;
46
- box-shadow: none;
47
- background-color: transparent;
48
- }
49
-
50
- .cell-ouput-container {
51
- margin: 20px 0 20px 10px;
52
- }
53
-
54
- .jp-error {
55
- /* margin: 0;
56
- padding: 0 10px; */
57
- line-height: 14px;
58
- font-size: 14px;
59
- overflow-x: auto;
60
- overflow-y: hidden;
61
- }
62
-
63
- .jp-img {
64
- max-width: 50%;
65
- height: auto;
66
- }
67
-
68
- .monospace-text {
69
- font-family: monospace;
70
- overflow-y: hidden;
71
- }
72
- </style>
@@ -1,83 +0,0 @@
1
- <template>
2
- <div class="code-block-wrapper">
3
- <div class="code-block-container" v-html="code"></div>
4
- <button class="copy-btn" @click="copyCode">
5
- <Confirm v-if="copied" />
6
- <Paste v-else />
7
- </button>
8
- </div>
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import { ref, watch } from 'vue';
13
- import Confirm from '@datawhale/dipwap-render/icons/Code/Confirm.vue';
14
- import Paste from '@datawhale/dipwap-render/icons/Code/Paste.vue';
15
- import { getHighlighter, supportedLangs } from '@datawhale/dipwap-render/utils/shiki';
16
- import type { PMCode, PMText } from '@datawhale/dipwap-types/index';
17
-
18
- const { node } = defineProps<{
19
- node: PMCode;
20
- }>();
21
-
22
- const code = ref('');
23
- const rawText = ref('');
24
- const copied = ref(false);
25
-
26
- function resolveLanguage(lang: string | undefined | null) {
27
- if (lang && supportedLangs.includes(lang)) {
28
- return lang;
29
- } else {
30
- return 'text';
31
- }
32
- }
33
-
34
- watch(
35
- () => node,
36
- () => {
37
- if (node.content?.[0]) {
38
- const text = (node.content[0] as PMText).text;
39
- rawText.value = text.trim();
40
-
41
- code.value = getHighlighter().codeToHtml(text, {
42
- lang: resolveLanguage(node.attrs.language),
43
- theme: 'min-light',
44
- });
45
- }
46
- },
47
- { immediate: true },
48
- );
49
-
50
- const copyCode = async () => {
51
- try {
52
- await navigator.clipboard.writeText(rawText.value);
53
- copied.value = true;
54
- setTimeout(() => {
55
- copied.value = false;
56
- }, 2000);
57
- } catch (_e) {
58
- alert('复制失败');
59
- }
60
- };
61
- </script>
62
-
63
- <style scoped lang="scss">
64
- .code-block-wrapper {
65
- position: relative;
66
- .copy-btn {
67
- position: absolute;
68
- top: 8px;
69
- right: 8px;
70
- cursor: pointer;
71
- border: none;
72
- background-color: transparent;
73
- padding: 0;
74
- outline: none;
75
- height: 20px;
76
- width: 20px;
77
- display: flex;
78
- align-items: center;
79
- justify-content: center;
80
- color: #909090;
81
- }
82
- }
83
- </style>
@@ -1,6 +0,0 @@
1
- import { customDefineAsyncComponent } from '../utils';
2
-
3
- export const codeMapper: Record<string, any> = {
4
- codeBlock: customDefineAsyncComponent(() => import('./CodeBlock.vue')),
5
- cellOutput: customDefineAsyncComponent(() => import('./CellOutput.vue')),
6
- };
@@ -1,130 +0,0 @@
1
- <template>
2
- <div class="foldBlock-wrapper" :style="{ backgroundColor: node.attrs.bgColor, borderColor: node.attrs.bdColor }">
3
- <div class="collapse-icon" @click="isFolded = !isFolded">
4
- <component :is="!isFolded ? FoldOpen : FoldClose"></component>
5
- </div>
6
- <div class="foldBlock-icon">
7
- {{ EMOJI_MAP[node.content[0].attrs.emoji] ? EMOJI_MAP[node.content[0].attrs.emoji] : EMOJI_MAP['whale'] }}
8
- </div>
9
- <div class="foldBlock-inner" :class="isFolded ? 'is-folded' : 'not-folded'">
10
- <div class="foldBlock-header">
11
- <TreeRecursive v-for="child in node.content[0].content" :node="child" :key="useId()" />
12
- </div>
13
- <div class="foldBlock-content">
14
- <TreeRecursive v-for="child in node.content[1].content" :node="child" :key="useId()" />
15
- </div>
16
- </div>
17
- </div>
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import { ref, useId } from 'vue';
22
- import TreeRecursive from '@datawhale/dipwap-render/components/TreeRecursive.vue';
23
- import FoldClose from '@datawhale/dipwap-render/icons/Common/FoldClose.vue';
24
- import FoldOpen from '@datawhale/dipwap-render/icons/Common/FoldOpen.vue';
25
- import { EMOJI_MAP } from '@datawhale/dipwap-render/utils/emoji';
26
- import type { PMFoldBlock } from '@datawhale/dipwap-types/index';
27
-
28
- const { node } = defineProps<{
29
- node: PMFoldBlock;
30
- }>();
31
-
32
- const isFolded = ref(node.attrs.initFolded);
33
- </script>
34
-
35
- <style scoped lang="scss">
36
- .foldBlock-wrapper {
37
- position: relative;
38
- margin: 16px 0;
39
- padding: 16px;
40
- border-radius: 6px;
41
- display: flex;
42
- flex-direction: row;
43
- border-width: 1.5px;
44
- border-style: solid;
45
- .collapse-icon {
46
- cursor: pointer;
47
- font-size: 22px;
48
- position: absolute;
49
- top: calc(22px - 1.5px);
50
- right: calc(4px - 1.5px);
51
- padding: 4px 12px;
52
- border-radius: 0 6px 0 0;
53
- z-index: 1;
54
- display: flex;
55
- align-items: center;
56
- }
57
- .foldBlock-icon {
58
- font-size: 22px;
59
- width: 26px;
60
- height: 26px;
61
- display: flex;
62
- justify-content: center;
63
- align-items: center;
64
- cursor: default;
65
- &:hover {
66
- background-color: rgba(0, 0, 0, 0.1);
67
- border-radius: 4px;
68
- }
69
- }
70
- .foldBlock-inner {
71
- display: flex;
72
- flex-direction: column;
73
- flex: 1;
74
- min-width: 0;
75
- .foldBlock-header {
76
- padding-left: 12px;
77
- padding-right: 14px;
78
- padding-bottom: 16px;
79
- p {
80
- font-size: 20px;
81
- font-weight: 600;
82
- }
83
- justify-content: flex-start;
84
- align-items: center;
85
- }
86
- .foldBlock-header > *:first-child,
87
- .foldBlock-header > ul > li:first-child,
88
- .foldBlock-header > ul > li:first-child > p:first-child,
89
- .foldBlock-header > ol > li:first-child,
90
- .foldBlock-header > ol > li:first-child > p:first-child {
91
- margin-top: 0;
92
- }
93
- .foldBlock-header > *:last-child,
94
- .foldBlock-header > ul > li:last-child,
95
- .foldBlock-header > ul > li:last-child > p:last-child,
96
- .foldBlock-header > ol > li:last-child,
97
- .foldBlock-header > ol > li:last-child > p:last-child {
98
- margin-bottom: 0;
99
- }
100
- &.is-folded {
101
- .foldBlock-header {
102
- padding-bottom: 0;
103
- }
104
- .foldBlock-content {
105
- display: none;
106
- }
107
- }
108
- .foldBlock-content {
109
- padding-left: 12px;
110
- overflow-x: auto;
111
- }
112
- .foldBlock-content > :deep(*:first-child),
113
- .foldBlock-content > :deep(ul > li:first-child),
114
- .foldBlock-content > :deep(ul > li:first-child > p:first-child),
115
- .foldBlock-content > :deep(ol > li:first-child),
116
- .foldBlock-content > :deep(ol > li:first-child > p:first-child),
117
- .foldBlock-content > :deep(div:first-child > pre) {
118
- margin-top: 0;
119
- }
120
- .foldBlock-content > :deep(*:last-child),
121
- .foldBlock-content > :deep(ul > li:last-child),
122
- .foldBlock-content > :deep(ul > li:last-child > p:last-child),
123
- .foldBlock-content > :deep(ol > li:last-child),
124
- .foldBlock-content > :deep(ol > li:last-child > p:last-child),
125
- .foldBlock-content > :deep(div:last-child > pre) {
126
- margin-bottom: 0;
127
- }
128
- }
129
- }
130
- </style>
@@ -1,5 +0,0 @@
1
- import { customDefineAsyncComponent } from '../utils';
2
-
3
- export const foldBlockMapper: Record<string, any> = {
4
- foldBlock: customDefineAsyncComponent(() => import('./FoldBlock.vue')),
5
- };
@@ -1,70 +0,0 @@
1
- <template>
2
- <div class="dipwap-grid">
3
- <div v-for="column in node.content" :style="{ flex: column.attrs.colWidth / totalWidth }" :key="useId()"
4
- class="dipwap-column">
5
- <TreeRecursive v-for="child in column.content" :node="child" :key="useId()" />
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { computed, useId } from 'vue';
12
- import TreeRecursive from '@datawhale/dipwap-render/components/TreeRecursive.vue';
13
- import type { PMGrid } from '@datawhale/dipwap-types/index';
14
-
15
- const { node } = defineProps<{
16
- node: PMGrid;
17
- }>();
18
-
19
- const totalWidth = computed(() => {
20
- let total = 0;
21
- for (const column of node.content) {
22
- total += column.attrs.colWidth;
23
- }
24
- return total;
25
- });
26
- </script>
27
-
28
- <style lang="scss" scoped>
29
- .dipwap-grid {
30
- display: flex;
31
- flex-direction: row;
32
- width: calc(100% - 8px);
33
- gap: 12px;
34
- margin: 16px 0;
35
-
36
- &:hover {
37
- .dipwap-column {
38
- background-color: rgba(100, 106, 115, 0.05);
39
- }
40
- }
41
-
42
- .dipwap-column {
43
- position: relative;
44
- border-radius: 8px;
45
- min-width: 50px;
46
- padding: 12px;
47
- background-color: transparent;
48
- transition: background-color 0.2s ease;
49
-
50
- > :nth-child(1) {
51
- margin-top: 0;
52
- }
53
-
54
- > :nth-last-child(1) {
55
- margin-bottom: 0;
56
- }
57
- }
58
- }
59
-
60
- @media screen and (max-width: 768px) {
61
- .dipwap-grid {
62
- flex-direction: column !important;
63
- width: 100%;
64
- }
65
-
66
- .dipwap-column {
67
- flex: none !important;
68
- }
69
- }
70
- </style>
@@ -1,5 +0,0 @@
1
- import { customDefineAsyncComponent } from '../utils';
2
-
3
- export const gridMapper: Record<string, any> = {
4
- grid: customDefineAsyncComponent(() => import('./Grid.vue')),
5
- };
@@ -1,19 +0,0 @@
1
- <template>
2
- <iframe class="iframe-wrapper" :src="node.attrs.src"></iframe>
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import type { PMIFrame } from '@datawhale/dipwap-types/index';
7
-
8
- const { node } = defineProps<{
9
- node: PMIFrame;
10
- }>();
11
- </script>
12
-
13
- <style scoped lang="scss">
14
- iframe.iframe-wrapper {
15
- width: 100%;
16
- margin: 16px 0;
17
- aspect-ratio: 16 / 9;
18
- }
19
- </style>
@@ -1,5 +0,0 @@
1
- import { customDefineAsyncComponent } from '../utils';
2
-
3
- export const iframeMapper: Record<string, any> = {
4
- iframe: customDefineAsyncComponent(() => import('./IFrame.vue')),
5
- };