@datawhale/prosemirror-render 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AttachmentBlock-ChMNTUOo.mjs +351 -0
- package/dist/AttachmentBlock-DsmJP3Kw.js +1 -0
- package/dist/AttachmentInline-Dc3dp0g-.js +1 -0
- package/dist/AttachmentInline-tbC8BJBy.mjs +52 -0
- package/dist/AttachmentMenu-B5x8P9_n.mjs +541 -0
- package/dist/AttachmentMenu-ExoCOe4B.js +1 -0
- package/dist/Blockquote-BamWUQND.mjs +15 -0
- package/dist/Blockquote-CQSBFnsu.js +1 -0
- package/dist/BulletList-BQTUD69X.mjs +15 -0
- package/dist/BulletList-CFjF3U-l.js +1 -0
- package/dist/Callout-Cu6HI-xq.mjs +28 -0
- package/dist/Callout-DPdOqTb4.js +1 -0
- package/dist/CellOutput-C33VK0df.mjs +981 -0
- package/dist/CellOutput-DiKZlIFa.js +6 -0
- package/dist/CodeBlock-Cjuxuq7B.mjs +8359 -0
- package/dist/CodeBlock-DWniNUQB.js +148 -0
- package/dist/Doc-6s4VMDsx.mjs +15 -0
- package/dist/Doc-D2yvlSII.js +1 -0
- package/dist/FoldBlock-DRdlU-DX.mjs +75 -0
- package/dist/FoldBlock-ZPMf0QsR.js +1 -0
- package/dist/Grid-GfmJxM93.mjs +31 -0
- package/dist/Grid-QToZdaRT.js +1 -0
- package/dist/HardBreak-B2tFO31P.mjs +13 -0
- package/dist/HardBreak-Dbf5Zg5o.js +1 -0
- package/dist/Heading-BElRvhGn.mjs +21 -0
- package/dist/Heading-BUnffIAz.js +1 -0
- package/dist/HorizontalRule-BRG45oT0.mjs +13 -0
- package/dist/HorizontalRule-CE09LZGf.js +1 -0
- package/dist/IFrame-CaAOVLGN.mjs +17 -0
- package/dist/IFrame-DcCpSoDC.js +1 -0
- package/dist/Image-C8v5dCij.mjs +105 -0
- package/dist/Image-cHL85CXs.js +1 -0
- package/dist/ListItem-BrjxeGxz.js +1 -0
- package/dist/ListItem-X0T7a_z8.mjs +15 -0
- package/dist/MathDisplay-CESKZV46.js +1 -0
- package/dist/MathDisplay-CoGsFzXW.mjs +30 -0
- package/dist/MathInline-0xTZoIIq.mjs +30 -0
- package/dist/MathInline-C_1SJUVz.js +1 -0
- package/dist/McChoices-Aj394G5E.mjs +52 -0
- package/dist/McChoices-B4euzY7M.js +1 -0
- package/dist/McQuestion-Dq0aM5tC.js +1 -0
- package/dist/McQuestion-DvD-J47M.mjs +38 -0
- package/dist/McSolution-C5sTXz3y.mjs +24 -0
- package/dist/McSolution-N79CllH9.js +1 -0
- package/dist/MultipleChoice-DTCF3Q8m.js +1 -0
- package/dist/MultipleChoice-Dv-k1zUU.mjs +47 -0
- package/dist/OrderedList-B8v1gchv.mjs +17 -0
- package/dist/OrderedList-DMl3tvwP.js +1 -0
- package/dist/Paragraph-CzRSCJNr.js +1 -0
- package/dist/Paragraph-DGcZy8t_.mjs +16 -0
- package/dist/SlotNode-6OpoUcOa.mjs +10 -0
- package/dist/SlotNode-DMG0R6Vf.js +1 -0
- package/dist/TableCell-BY9gdldc.js +1 -0
- package/dist/TableCell-Bp52L368.mjs +20 -0
- package/dist/TableContainer-C5KXY6f7.js +1 -0
- package/dist/TableContainer-C9PhNGlz.mjs +29 -0
- package/dist/TableHeader-BTuqvorM.js +1 -0
- package/dist/TableHeader-C7KKz3e1.mjs +17 -0
- package/dist/TableRow-D4F6AKFt.js +1 -0
- package/dist/TableRow-OzpVq1qW.mjs +15 -0
- package/dist/Text-Br_pcGz4.mjs +78 -0
- package/dist/Text-DlUfrsNI.js +1 -0
- package/dist/emoji-Bk6FG72F.js +1 -0
- package/dist/emoji-CmOToDEU.mjs +3711 -0
- package/dist/index-D2CtpNvR.js +1 -0
- package/dist/index-DVmWCrQE.mjs +159 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +4 -0
- package/dist/katex-CS0ZfoxP.js +261 -0
- package/dist/katex-r9TeExgs.mjs +11690 -0
- package/dist/prosemirror-render.css +1 -0
- package/dist/types/apis/monitor.d.ts +9 -0
- package/dist/types/apis/tingwu.d.ts +14 -0
- package/dist/types/apis/types.d.ts +23 -0
- package/dist/types/components/TreeRecursive.vue.d.ts +7 -0
- package/dist/types/components/TreeRender.vue.d.ts +9 -0
- package/dist/types/components/collections/async/AsyncError.vue.d.ts +3 -0
- package/dist/types/components/collections/async/AsyncLoading.vue.d.ts +3 -0
- package/dist/types/components/collections/attachment/AttachmentBlock.vue.d.ts +7 -0
- package/dist/types/components/collections/attachment/AttachmentInline.vue.d.ts +7 -0
- package/dist/types/components/collections/attachment/AttachmentMenu.vue.d.ts +16 -0
- package/dist/types/components/collections/attachment/VideoDetail.vue.d.ts +7 -0
- package/dist/types/components/collections/attachment/index.d.ts +1 -0
- package/dist/types/components/collections/basic/Blockquote.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/BulletList.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/HardBreak.vue.d.ts +7 -0
- package/dist/types/components/collections/basic/Heading.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/HorizontalRule.vue.d.ts +7 -0
- package/dist/types/components/collections/basic/ListItem.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/OrderedList.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/Paragraph.vue.d.ts +17 -0
- package/dist/types/components/collections/basic/Text.vue.d.ts +7 -0
- package/dist/types/components/collections/basic/index.d.ts +1 -0
- package/dist/types/components/collections/callout/Callout.vue.d.ts +7 -0
- package/dist/types/components/collections/callout/index.d.ts +1 -0
- package/dist/types/components/collections/code/CellOutput.vue.d.ts +7 -0
- package/dist/types/components/collections/code/CodeBlock.vue.d.ts +7 -0
- package/dist/types/components/collections/code/index.d.ts +1 -0
- package/dist/types/components/collections/fold/FoldBlock.vue.d.ts +7 -0
- package/dist/types/components/collections/fold/index.d.ts +1 -0
- package/dist/types/components/collections/grid/Grid.vue.d.ts +7 -0
- package/dist/types/components/collections/grid/index.d.ts +1 -0
- package/dist/types/components/collections/iframe/IFrame.vue.d.ts +7 -0
- package/dist/types/components/collections/iframe/index.d.ts +1 -0
- package/dist/types/components/collections/img/Image.vue.d.ts +7 -0
- package/dist/types/components/collections/img/index.d.ts +1 -0
- package/dist/types/components/collections/index.d.ts +1 -0
- package/dist/types/components/collections/math/MathDisplay.vue.d.ts +7 -0
- package/dist/types/components/collections/math/MathInline.vue.d.ts +7 -0
- package/dist/types/components/collections/math/index.d.ts +1 -0
- package/dist/types/components/collections/multipleChoice/McChoices.vue.d.ts +16 -0
- package/dist/types/components/collections/multipleChoice/McQuestion.vue.d.ts +7 -0
- package/dist/types/components/collections/multipleChoice/McSolution.vue.d.ts +8 -0
- package/dist/types/components/collections/multipleChoice/MultipleChoice.vue.d.ts +7 -0
- package/dist/types/components/collections/multipleChoice/index.d.ts +1 -0
- package/dist/types/components/collections/table/TableCell.vue.d.ts +17 -0
- package/dist/types/components/collections/table/TableContainer.vue.d.ts +17 -0
- package/dist/types/components/collections/table/TableHeader.vue.d.ts +17 -0
- package/dist/types/components/collections/table/TableRow.vue.d.ts +17 -0
- package/dist/types/components/collections/table/index.d.ts +1 -0
- package/dist/types/components/collections/utils.d.ts +2 -0
- package/dist/types/components/collections/wrapper/Doc.vue.d.ts +17 -0
- package/dist/types/components/collections/wrapper/SlotNode.vue.d.ts +13 -0
- package/dist/types/components/collections/wrapper/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/icons/Attachment/CardView.vue.d.ts +9 -0
- package/dist/types/icons/Attachment/Code/Bat.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/C.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Cpp.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Css.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Go.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Html.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Java.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Js.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Json.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Jsx.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Md.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Php.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Python.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Rb.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Sh.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Sql.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Swift.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Ts.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Tsx.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Code/Vue.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Excel.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Eye.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/FullScreen.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/InlineView.vue.d.ts +9 -0
- package/dist/types/icons/Attachment/Pdf.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Ppt.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/PreviewView.vue.d.ts +9 -0
- package/dist/types/icons/Attachment/UnknownFile.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/VideoIcon.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/VideoPlay.vue.d.ts +3 -0
- package/dist/types/icons/Attachment/Word.vue.d.ts +3 -0
- package/dist/types/icons/Code/Confirm.vue.d.ts +3 -0
- package/dist/types/icons/Code/Paste.vue.d.ts +3 -0
- package/dist/types/icons/Common/Choice.vue.d.ts +3 -0
- package/dist/types/icons/Common/Close.vue.d.ts +3 -0
- package/dist/types/icons/Common/Comment.vue.d.ts +3 -0
- package/dist/types/icons/Common/CopyAnchorLink.vue.d.ts +3 -0
- package/dist/types/icons/Common/Delete.vue.d.ts +3 -0
- package/dist/types/icons/Common/Download.vue.d.ts +3 -0
- package/dist/types/icons/Common/FoldClose.vue.d.ts +3 -0
- package/dist/types/icons/Common/FoldOpen.vue.d.ts +3 -0
- package/dist/types/icons/Common/Plate.vue.d.ts +3 -0
- package/dist/types/icons/Common/Question.vue.d.ts +3 -0
- package/dist/types/icons/Common/ShareTextLink.vue.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types.d.ts +269 -0
- package/dist/types/utils/common.d.ts +1 -0
- package/dist/types/utils/emoji.d.ts +10 -0
- package/dist/types/utils/globalStatus.d.ts +16 -0
- package/dist/types/utils/shiki.d.ts +3 -0
- package/dist/types/utils/useAttachment.d.ts +8 -0
- package/package.json +29 -0
- package/src/apis/monitor.ts +8 -0
- package/src/apis/tingwu.ts +22 -0
- package/src/apis/types.ts +45 -0
- package/src/components/TreeRecursive.vue +47 -0
- package/src/components/TreeRender.vue +404 -0
- package/src/components/collections/async/AsyncError.vue +17 -0
- package/src/components/collections/async/AsyncLoading.vue +1 -0
- package/src/components/collections/attachment/AttachmentBlock.vue +561 -0
- package/src/components/collections/attachment/AttachmentInline.vue +90 -0
- package/src/components/collections/attachment/AttachmentMenu.vue +359 -0
- package/src/components/collections/attachment/VideoDetail.vue +375 -0
- package/src/components/collections/attachment/index.ts +6 -0
- package/src/components/collections/basic/Blockquote.vue +15 -0
- package/src/components/collections/basic/BulletList.vue +15 -0
- package/src/components/collections/basic/HardBreak.vue +11 -0
- package/src/components/collections/basic/Heading.vue +15 -0
- package/src/components/collections/basic/HorizontalRule.vue +11 -0
- package/src/components/collections/basic/ListItem.vue +15 -0
- package/src/components/collections/basic/OrderedList.vue +15 -0
- package/src/components/collections/basic/Paragraph.vue +19 -0
- package/src/components/collections/basic/Text.vue +73 -0
- package/src/components/collections/basic/index.ts +13 -0
- package/src/components/collections/callout/Callout.vue +77 -0
- package/src/components/collections/callout/index.ts +5 -0
- package/src/components/collections/code/CellOutput.vue +72 -0
- package/src/components/collections/code/CodeBlock.vue +83 -0
- package/src/components/collections/code/index.ts +6 -0
- package/src/components/collections/fold/FoldBlock.vue +130 -0
- package/src/components/collections/fold/index.ts +5 -0
- package/src/components/collections/grid/Grid.vue +70 -0
- package/src/components/collections/grid/index.ts +5 -0
- package/src/components/collections/iframe/IFrame.vue +19 -0
- package/src/components/collections/iframe/index.ts +5 -0
- package/src/components/collections/img/Image.vue +318 -0
- package/src/components/collections/img/index.ts +5 -0
- package/src/components/collections/index.ts +29 -0
- package/src/components/collections/math/MathDisplay.vue +42 -0
- package/src/components/collections/math/MathInline.vue +42 -0
- package/src/components/collections/math/index.ts +6 -0
- package/src/components/collections/multipleChoice/McChoices.vue +72 -0
- package/src/components/collections/multipleChoice/McQuestion.vue +61 -0
- package/src/components/collections/multipleChoice/McSolution.vue +47 -0
- package/src/components/collections/multipleChoice/MultipleChoice.vue +62 -0
- package/src/components/collections/multipleChoice/index.ts +8 -0
- package/src/components/collections/table/TableCell.vue +20 -0
- package/src/components/collections/table/TableContainer.vue +32 -0
- package/src/components/collections/table/TableHeader.vue +15 -0
- package/src/components/collections/table/TableRow.vue +15 -0
- package/src/components/collections/table/index.ts +8 -0
- package/src/components/collections/utils.ts +17 -0
- package/src/components/collections/wrapper/Doc.vue +15 -0
- package/src/components/collections/wrapper/SlotNode.vue +5 -0
- package/src/components/collections/wrapper/index.ts +6 -0
- package/src/components/index.ts +1 -0
- package/src/icons/Attachment/CardView.vue +21 -0
- package/src/icons/Attachment/Code/Bat.vue +26 -0
- package/src/icons/Attachment/Code/C.vue +26 -0
- package/src/icons/Attachment/Code/Cpp.vue +26 -0
- package/src/icons/Attachment/Code/Css.vue +34 -0
- package/src/icons/Attachment/Code/Go.vue +26 -0
- package/src/icons/Attachment/Code/Html.vue +34 -0
- package/src/icons/Attachment/Code/Java.vue +42 -0
- package/src/icons/Attachment/Code/Js.vue +26 -0
- package/src/icons/Attachment/Code/Json.vue +26 -0
- package/src/icons/Attachment/Code/Jsx.vue +30 -0
- package/src/icons/Attachment/Code/Md.vue +26 -0
- package/src/icons/Attachment/Code/Php.vue +26 -0
- package/src/icons/Attachment/Code/Python.vue +30 -0
- package/src/icons/Attachment/Code/Rb.vue +26 -0
- package/src/icons/Attachment/Code/Sh.vue +30 -0
- package/src/icons/Attachment/Code/Sql.vue +30 -0
- package/src/icons/Attachment/Code/Swift.vue +26 -0
- package/src/icons/Attachment/Code/Ts.vue +26 -0
- package/src/icons/Attachment/Code/Tsx.vue +30 -0
- package/src/icons/Attachment/Code/Vue.vue +24 -0
- package/src/icons/Attachment/Excel.vue +26 -0
- package/src/icons/Attachment/Eye.vue +15 -0
- package/src/icons/Attachment/FullScreen.vue +15 -0
- package/src/icons/Attachment/InlineView.vue +21 -0
- package/src/icons/Attachment/Pdf.vue +25 -0
- package/src/icons/Attachment/Ppt.vue +26 -0
- package/src/icons/Attachment/PreviewView.vue +21 -0
- package/src/icons/Attachment/UnknownFile.vue +26 -0
- package/src/icons/Attachment/VideoIcon.vue +25 -0
- package/src/icons/Attachment/VideoPlay.vue +15 -0
- package/src/icons/Attachment/Word.vue +26 -0
- package/src/icons/Code/Confirm.vue +38 -0
- package/src/icons/Code/Paste.vue +8 -0
- package/src/icons/Common/Choice.vue +28 -0
- package/src/icons/Common/Close.vue +15 -0
- package/src/icons/Common/Comment.vue +16 -0
- package/src/icons/Common/CopyAnchorLink.vue +15 -0
- package/src/icons/Common/Delete.vue +15 -0
- package/src/icons/Common/Download.vue +15 -0
- package/src/icons/Common/FoldClose.vue +9 -0
- package/src/icons/Common/FoldOpen.vue +9 -0
- package/src/icons/Common/Plate.vue +23 -0
- package/src/icons/Common/Question.vue +8 -0
- package/src/icons/Common/ShareTextLink.vue +15 -0
- package/src/index.ts +3 -0
- package/src/types.ts +236 -0
- package/src/utils/common.ts +6 -0
- package/src/utils/emoji.ts +3715 -0
- package/src/utils/globalStatus.ts +19 -0
- package/src/utils/shiki.ts +25 -0
- package/src/utils/useAttachment.ts +215 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +23 -0
- package/vite.config.ts +24 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@datawhale/prosemirror-render",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"description": "",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/katex": "^0.16.7",
|
|
14
|
+
"@types/node": "^25.0.3",
|
|
15
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
16
|
+
"@vue/tsconfig": "^0.8.1",
|
|
17
|
+
"sass-embedded": "^1.97.1",
|
|
18
|
+
"shiki": "^1.29.2",
|
|
19
|
+
"typescript": "^5.9.3",
|
|
20
|
+
"vite": "^7.3.0",
|
|
21
|
+
"vue-tsc": "^3.2.1"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"ansi-to-vue3": "^0.1.2",
|
|
25
|
+
"axios": "^1.13.2",
|
|
26
|
+
"katex": "^0.16.27",
|
|
27
|
+
"vue": "^3.5.26"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HTTPClientType } from "./types";
|
|
2
|
+
|
|
3
|
+
export type VideoProgressDetail = {
|
|
4
|
+
id?: number;
|
|
5
|
+
videoUrl?: string;
|
|
6
|
+
progress?: number;
|
|
7
|
+
tingwuTaskId?: string;
|
|
8
|
+
tingwuStatus?: "pending" | "running" | "done" | "failed";
|
|
9
|
+
chapters: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
keywords: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export async function videoProgressDetailApi(
|
|
15
|
+
service: HTTPClientType,
|
|
16
|
+
params: { taskId: string }
|
|
17
|
+
): Promise<VideoProgressDetail> {
|
|
18
|
+
const response = await service.get("/admin/editor/v2/videoProgressDetail", {
|
|
19
|
+
params,
|
|
20
|
+
});
|
|
21
|
+
return response.data;
|
|
22
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
type HTTPResponse<T = any> = {
|
|
2
|
+
data: T;
|
|
3
|
+
code: number;
|
|
4
|
+
message: string;
|
|
5
|
+
traceId: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type HTTPOptions<P = any, D = any> = {
|
|
9
|
+
data?: D;
|
|
10
|
+
params?: P;
|
|
11
|
+
headers?: Record<string, any>;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type CustomConfig = {
|
|
16
|
+
ignoreErrHandler?: boolean; // 是否不使用错误拦截
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export interface HTTPClientType {
|
|
20
|
+
get<P = any, R = any>(
|
|
21
|
+
url: string,
|
|
22
|
+
options?: HTTPOptions<P>,
|
|
23
|
+
customConfig?: CustomConfig
|
|
24
|
+
): Promise<HTTPResponse<R>>;
|
|
25
|
+
|
|
26
|
+
post<D = any, R = any, P = any>(
|
|
27
|
+
url: string,
|
|
28
|
+
options?: HTTPOptions<P, D>,
|
|
29
|
+
customConfig?: CustomConfig
|
|
30
|
+
): Promise<HTTPResponse<R>>;
|
|
31
|
+
|
|
32
|
+
patch<D = any, R = any, P = any>(
|
|
33
|
+
url: string,
|
|
34
|
+
options?: HTTPOptions<P, D>,
|
|
35
|
+
customConfig?: CustomConfig
|
|
36
|
+
): Promise<HTTPResponse<R>>;
|
|
37
|
+
|
|
38
|
+
delete<D = any, R = any, P = any>(
|
|
39
|
+
url: string,
|
|
40
|
+
options?: HTTPOptions<P, D>,
|
|
41
|
+
customConfig?: CustomConfig
|
|
42
|
+
): Promise<HTTPResponse<R>>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const axiosKey = Symbol();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Suspense>
|
|
3
|
+
<component :is="componentMapper[node.type]" :node="node" v-bind="dataBlockId">
|
|
4
|
+
<template v-if="node.content && !(node.type in ['foldBlock', 'grid', 'callout'])">
|
|
5
|
+
<TreeRecursive v-for="child in node.content" :node="child" :key="useId()" />
|
|
6
|
+
</template>
|
|
7
|
+
</component>
|
|
8
|
+
</Suspense>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { computed, useId } from 'vue';
|
|
13
|
+
import type { PMNode } from '@datawhale/dipwap-types/index';
|
|
14
|
+
import { componentMapper } from './collections';
|
|
15
|
+
|
|
16
|
+
const { node } = defineProps<{
|
|
17
|
+
node: PMNode;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
const dataBlockIdContainerNames = new Set<string>([
|
|
21
|
+
'blockquote',
|
|
22
|
+
'orderedList',
|
|
23
|
+
'bulletList',
|
|
24
|
+
'paragraph',
|
|
25
|
+
'math_display',
|
|
26
|
+
'codeBlock',
|
|
27
|
+
'cellOutput',
|
|
28
|
+
'callout',
|
|
29
|
+
'foldBlock',
|
|
30
|
+
'image',
|
|
31
|
+
'attachment-block',
|
|
32
|
+
'grid',
|
|
33
|
+
'table',
|
|
34
|
+
'iframe',
|
|
35
|
+
'multipleChoice',
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
const dataBlockId = computed(() => {
|
|
39
|
+
// @ts-ignore every node here has a block-id
|
|
40
|
+
if (dataBlockIdContainerNames.has(node.type) && node.attrs && node.attrs['block-id']) {
|
|
41
|
+
// @ts-ignore every node here has a block-id
|
|
42
|
+
return { 'data-block-id': node.attrs['block-id'] };
|
|
43
|
+
} else {
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tree-render">
|
|
3
|
+
<TreeRecursive :node="node" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { provide, watch } from 'vue';
|
|
9
|
+
import { type HTTPClientType, axiosKey } from '@datawhale/dipwap-render/apis/types';
|
|
10
|
+
import type { PMNode } from '@datawhale/dipwap-types/index';
|
|
11
|
+
import { getAllImageNodes, imageNodes, imageNodesKey } from '../utils/globalStatus';
|
|
12
|
+
import TreeRecursive from './TreeRecursive.vue';
|
|
13
|
+
|
|
14
|
+
const { node, axios } = defineProps<{
|
|
15
|
+
node: PMNode;
|
|
16
|
+
axios: HTTPClientType;
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
provide(imageNodesKey, imageNodes);
|
|
20
|
+
provide(axiosKey, axios);
|
|
21
|
+
|
|
22
|
+
watch(
|
|
23
|
+
() => node,
|
|
24
|
+
(newNode) => {
|
|
25
|
+
imageNodes.value = getAllImageNodes(newNode);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
.tree-render {
|
|
32
|
+
mark {
|
|
33
|
+
color: inherit;
|
|
34
|
+
background-color: inherit;
|
|
35
|
+
}
|
|
36
|
+
min-height: calc(100vh - 232.25px);
|
|
37
|
+
outline: none;
|
|
38
|
+
width: 100%;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
::selection {
|
|
41
|
+
background-color: rgba(20, 86, 240, 0.18);
|
|
42
|
+
/* 选中背景颜色 */
|
|
43
|
+
}
|
|
44
|
+
color: rgb(31, 35, 41);
|
|
45
|
+
letter-spacing: 0.28px;
|
|
46
|
+
word-wrap: break-word;
|
|
47
|
+
font-family:
|
|
48
|
+
LarkHackSafariFont,
|
|
49
|
+
LarkEmojiFont,
|
|
50
|
+
LarkChineseQuote,
|
|
51
|
+
-apple-system,
|
|
52
|
+
BlinkMacSystemFont,
|
|
53
|
+
Helvetica Neue,
|
|
54
|
+
Tahoma,
|
|
55
|
+
PingFang SC,
|
|
56
|
+
Microsoft Yahei,
|
|
57
|
+
Arial,
|
|
58
|
+
Hiragino Sans GB,
|
|
59
|
+
sans-serif,
|
|
60
|
+
Apple Color Emoji,
|
|
61
|
+
Segoe UI Emoji,
|
|
62
|
+
Segoe UI Symbol,
|
|
63
|
+
Noto Color Emoji;
|
|
64
|
+
code {
|
|
65
|
+
font-family: 'Source Code Pro', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', 'Microsoft Yahei';
|
|
66
|
+
}
|
|
67
|
+
h1,
|
|
68
|
+
h2,
|
|
69
|
+
h3,
|
|
70
|
+
h4,
|
|
71
|
+
h5,
|
|
72
|
+
h6 {
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
letter-spacing: -0.52px;
|
|
75
|
+
code {
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
margin: 0 3px;
|
|
78
|
+
padding: 1px 2px;
|
|
79
|
+
background-color: rgb(245, 246, 247);
|
|
80
|
+
border-radius: 4px;
|
|
81
|
+
border: 1px solid rgb(222, 224, 227);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
& .doc > h1:first-child {
|
|
85
|
+
margin-top: 22px;
|
|
86
|
+
}
|
|
87
|
+
h1 {
|
|
88
|
+
margin-top: 26px;
|
|
89
|
+
margin-bottom: 10px;
|
|
90
|
+
font-size: 26px;
|
|
91
|
+
line-height: 36.4px;
|
|
92
|
+
}
|
|
93
|
+
h2 {
|
|
94
|
+
margin-top: 22px;
|
|
95
|
+
margin-bottom: 8px;
|
|
96
|
+
font-size: 22px;
|
|
97
|
+
line-height: 30.8px;
|
|
98
|
+
}
|
|
99
|
+
h3 {
|
|
100
|
+
margin-top: 20px;
|
|
101
|
+
margin-bottom: 8px;
|
|
102
|
+
font-size: 20px;
|
|
103
|
+
line-height: 28px;
|
|
104
|
+
}
|
|
105
|
+
h4 {
|
|
106
|
+
margin-top: 18px;
|
|
107
|
+
margin-bottom: 8px;
|
|
108
|
+
font-size: 18px;
|
|
109
|
+
line-height: 25.2px;
|
|
110
|
+
}
|
|
111
|
+
h5 {
|
|
112
|
+
margin-top: 18px;
|
|
113
|
+
margin-bottom: 8px;
|
|
114
|
+
font-size: 16px;
|
|
115
|
+
line-height: 22.4px;
|
|
116
|
+
}
|
|
117
|
+
h6 {
|
|
118
|
+
margin-top: 16px;
|
|
119
|
+
margin-bottom: 8px;
|
|
120
|
+
font-size: 16px;
|
|
121
|
+
line-height: 22.4px;
|
|
122
|
+
}
|
|
123
|
+
hr {
|
|
124
|
+
border: none;
|
|
125
|
+
margin: 8px 0;
|
|
126
|
+
height: 26px;
|
|
127
|
+
position: relative;
|
|
128
|
+
&::after {
|
|
129
|
+
content: '';
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 50%;
|
|
132
|
+
left: 0;
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 1px;
|
|
135
|
+
background-color: rgba(31, 35, 41, 0.15);
|
|
136
|
+
transform: translateY(-50%);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
blockquote {
|
|
140
|
+
border-left: 2px solid rgb(187, 191, 196);
|
|
141
|
+
padding-left: 12px;
|
|
142
|
+
p {
|
|
143
|
+
color: rgb(100, 106, 115);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
span.math-src {
|
|
147
|
+
div[contenteditable='true'] {
|
|
148
|
+
outline: none;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
p {
|
|
152
|
+
margin: 8px 0;
|
|
153
|
+
line-height: 26px;
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
white-space-collapse: break-spaces;
|
|
157
|
+
text-wrap-mode: wrap;
|
|
158
|
+
a {
|
|
159
|
+
color: rgb(51, 109, 244);
|
|
160
|
+
text-decoration: none;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
&:hover {
|
|
163
|
+
text-decoration: underline;
|
|
164
|
+
text-decoration-color: rgb(51, 109, 244);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
strong {
|
|
168
|
+
font-weight: 700;
|
|
169
|
+
}
|
|
170
|
+
em {
|
|
171
|
+
font-style: italic;
|
|
172
|
+
}
|
|
173
|
+
del {
|
|
174
|
+
text-decoration: line-through;
|
|
175
|
+
}
|
|
176
|
+
u {
|
|
177
|
+
text-decoration: underline;
|
|
178
|
+
}
|
|
179
|
+
code {
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
margin: 0 3px;
|
|
182
|
+
padding: 1px 2px;
|
|
183
|
+
background-color: rgb(245, 246, 247);
|
|
184
|
+
border-radius: 4px;
|
|
185
|
+
border: 1px solid rgb(222, 224, 227);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
ul {
|
|
189
|
+
margin-left: 22px;
|
|
190
|
+
margin-top: 8px;
|
|
191
|
+
margin-bottom: 8px;
|
|
192
|
+
& > li::marker {
|
|
193
|
+
content: '• ';
|
|
194
|
+
color: rgb(20, 86, 240);
|
|
195
|
+
font-size: 16px;
|
|
196
|
+
}
|
|
197
|
+
ul {
|
|
198
|
+
& > li::marker {
|
|
199
|
+
content: '◦ ';
|
|
200
|
+
color: rgb(20, 86, 240);
|
|
201
|
+
font-size: 16px;
|
|
202
|
+
}
|
|
203
|
+
ul {
|
|
204
|
+
& > li::marker {
|
|
205
|
+
content: '▪ ';
|
|
206
|
+
color: rgb(20, 86, 240);
|
|
207
|
+
font-size: 16px;
|
|
208
|
+
}
|
|
209
|
+
ul {
|
|
210
|
+
& > li::marker {
|
|
211
|
+
content: '• ';
|
|
212
|
+
color: rgb(20, 86, 240);
|
|
213
|
+
font-size: 16px;
|
|
214
|
+
}
|
|
215
|
+
ul {
|
|
216
|
+
& > li::marker {
|
|
217
|
+
content: '◦ ';
|
|
218
|
+
color: rgb(20, 86, 240);
|
|
219
|
+
font-size: 16px;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
li {
|
|
227
|
+
margin: 8px 0;
|
|
228
|
+
}
|
|
229
|
+
ol {
|
|
230
|
+
margin-left: 29px;
|
|
231
|
+
list-style-type: decimal;
|
|
232
|
+
li::marker {
|
|
233
|
+
color: rgb(20, 86, 240);
|
|
234
|
+
font-family: 'Helvetica Neue', Consolas;
|
|
235
|
+
}
|
|
236
|
+
ol {
|
|
237
|
+
list-style-type: lower-alpha;
|
|
238
|
+
ol {
|
|
239
|
+
list-style-type: lower-roman;
|
|
240
|
+
ol {
|
|
241
|
+
list-style-type: decimal;
|
|
242
|
+
ol {
|
|
243
|
+
list-style-type: lower-alpha;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
.tiptap .shiki {
|
|
250
|
+
border-radius: 4px;
|
|
251
|
+
padding: 8px;
|
|
252
|
+
}
|
|
253
|
+
.tiptap .shiki:focus-visible {
|
|
254
|
+
outline: 2px solid transparent;
|
|
255
|
+
outline-offset: 2px;
|
|
256
|
+
}
|
|
257
|
+
pre {
|
|
258
|
+
padding: 24px;
|
|
259
|
+
border-radius: 6px;
|
|
260
|
+
margin: 16px 0;
|
|
261
|
+
outline: none;
|
|
262
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
263
|
+
overflow-x: auto;
|
|
264
|
+
background-color: rgb(245, 246, 247);
|
|
265
|
+
code {
|
|
266
|
+
width: 100%;
|
|
267
|
+
outline: none;
|
|
268
|
+
line-height: 22px;
|
|
269
|
+
font-size: 14px;
|
|
270
|
+
span {
|
|
271
|
+
text-wrap-mode: nowrap;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
.tableWrapper {
|
|
276
|
+
margin: 24px 0;
|
|
277
|
+
max-width: 100%;
|
|
278
|
+
overflow-x: auto;
|
|
279
|
+
}
|
|
280
|
+
table {
|
|
281
|
+
th,
|
|
282
|
+
td {
|
|
283
|
+
min-width: 39px;
|
|
284
|
+
border: 1px solid rgb(222, 224, 227);
|
|
285
|
+
padding: 12px;
|
|
286
|
+
position: relative;
|
|
287
|
+
:not(a.grip-column):not(a.grip-row):nth-child(1),
|
|
288
|
+
a.grip-column + :not(a.grip-row):nth-child(2),
|
|
289
|
+
a.grip-row + :not(a.grip-column):nth-child(2),
|
|
290
|
+
a.grip-column + *:nth-child(3),
|
|
291
|
+
a.grip-row + *:nth-child(3) {
|
|
292
|
+
margin-top: 0;
|
|
293
|
+
}
|
|
294
|
+
:not(a.grip-column):not(a.grip-row):nth-last-child(1),
|
|
295
|
+
:not(a.grip-column):not(a.grip-row):nth-last-child(2) {
|
|
296
|
+
margin-bottom: 0;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
.column-resize-handle {
|
|
300
|
+
background-color: rgb(20, 86, 240);
|
|
301
|
+
bottom: 0px;
|
|
302
|
+
pointer-events: none;
|
|
303
|
+
position: absolute;
|
|
304
|
+
right: -1px;
|
|
305
|
+
top: 0;
|
|
306
|
+
width: 2px;
|
|
307
|
+
}
|
|
308
|
+
.selectedCell {
|
|
309
|
+
background-color: rgba(20, 86, 240, 0.18) !important;
|
|
310
|
+
// filter: brightness(0.9);
|
|
311
|
+
}
|
|
312
|
+
.grip-column,
|
|
313
|
+
.grip-row {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: center;
|
|
317
|
+
position: absolute;
|
|
318
|
+
z-index: 10;
|
|
319
|
+
background-color: rgb(239, 240, 241);
|
|
320
|
+
cursor: pointer;
|
|
321
|
+
}
|
|
322
|
+
.grip-column {
|
|
323
|
+
width: 100%;
|
|
324
|
+
height: 8px;
|
|
325
|
+
left: 0;
|
|
326
|
+
top: -8px;
|
|
327
|
+
margin-left: -1px;
|
|
328
|
+
margin-top: -1px;
|
|
329
|
+
border-left: 1px solid rgb(239, 240, 241);
|
|
330
|
+
border-right: 1px solid rgb(239, 240, 241);
|
|
331
|
+
&:hover,
|
|
332
|
+
&.selected {
|
|
333
|
+
z-index: 15;
|
|
334
|
+
&::before {
|
|
335
|
+
content: '';
|
|
336
|
+
width: 10px;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
&:hover {
|
|
340
|
+
border-left: 1px solid rgb(227, 227, 227);
|
|
341
|
+
border-right: 1px solid rgb(227, 227, 227);
|
|
342
|
+
background-color: rgb(227, 227, 227);
|
|
343
|
+
&::before {
|
|
344
|
+
border-bottom: 2px dotted rgb(95, 95, 95);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
&.selected {
|
|
348
|
+
border-left: 1px solid rgb(20, 86, 240);
|
|
349
|
+
border-right: 1px solid rgb(20, 86, 240);
|
|
350
|
+
background-color: rgb(20, 86, 240);
|
|
351
|
+
&::before {
|
|
352
|
+
border-bottom: 2px dotted rgb(251, 251, 251);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
&.first {
|
|
356
|
+
border-top-left-radius: 4px;
|
|
357
|
+
}
|
|
358
|
+
&.last {
|
|
359
|
+
border-top-right-radius: 4px;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
.grip-row {
|
|
363
|
+
width: 8px;
|
|
364
|
+
height: 100%;
|
|
365
|
+
top: 0;
|
|
366
|
+
left: -8px;
|
|
367
|
+
margin-top: -1px;
|
|
368
|
+
margin-left: -1px;
|
|
369
|
+
border-top: 1px solid rgb(239, 240, 241);
|
|
370
|
+
border-bottom: 1px solid rgb(239, 240, 241);
|
|
371
|
+
&:hover,
|
|
372
|
+
&.selected {
|
|
373
|
+
z-index: 15;
|
|
374
|
+
&::before {
|
|
375
|
+
content: '';
|
|
376
|
+
height: 10px;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
&:hover {
|
|
380
|
+
border-top: 1px solid rgb(227, 227, 227);
|
|
381
|
+
border-bottom: 1px solid rgb(227, 227, 227);
|
|
382
|
+
background-color: rgb(227, 227, 227);
|
|
383
|
+
&::before {
|
|
384
|
+
border-left: 2px dotted rgb(95, 95, 95);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
&.selected {
|
|
388
|
+
border-top: 1px solid rgb(20, 86, 240);
|
|
389
|
+
border-bottom: 1px solid rgb(20, 86, 240);
|
|
390
|
+
background-color: rgb(20, 86, 240);
|
|
391
|
+
&::before {
|
|
392
|
+
border-left: 2px dotted rgb(251, 251, 251);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
&.first {
|
|
396
|
+
border-top-left-radius: 4px;
|
|
397
|
+
}
|
|
398
|
+
&.last {
|
|
399
|
+
border-bottom-left-radius: 4px;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="error-wrapper">组件加载失败</div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<style scoped>
|
|
6
|
+
.error-wrapper {
|
|
7
|
+
width: 160px;
|
|
8
|
+
height: 90px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
color: rgb(136, 46, 46);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
border: 1px solid #888;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template>loading...</template>
|