@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.
- package/dist/{AttachmentBlock-ChMNTUOo.mjs → AttachmentBlock-BTIBSu4p.js} +2 -2
- package/dist/AttachmentBlock-W05YY8zN.cjs +1 -0
- package/dist/{AttachmentInline-tbC8BJBy.mjs → AttachmentInline-BF7QTLxZ.js} +2 -2
- package/dist/AttachmentInline-CgV-t0WF.cjs +1 -0
- package/dist/{AttachmentMenu-B5x8P9_n.mjs → AttachmentMenu-BjM7LAlw.js} +1 -1
- package/dist/AttachmentMenu-vc18PNLc.cjs +1 -0
- package/dist/{Callout-Cu6HI-xq.mjs → Callout-BH6_xPHP.js} +2 -2
- package/dist/Callout-BgG8-zJn.cjs +1 -0
- package/dist/{CellOutput-DiKZlIFa.js → CellOutput-CXb77W7X.cjs} +1 -1
- package/dist/{CellOutput-C33VK0df.mjs → CellOutput-DJqn5MJH.js} +1 -1
- package/dist/{CodeBlock-DWniNUQB.js → CodeBlock-BejcPvxj.cjs} +1 -1
- package/dist/{CodeBlock-Cjuxuq7B.mjs → CodeBlock-D9lrTXj3.js} +1 -1
- package/dist/FoldBlock-CMDkkdoU.cjs +1 -0
- package/dist/{FoldBlock-DRdlU-DX.mjs → FoldBlock-CZwxKsSG.js} +2 -2
- package/dist/{Grid-GfmJxM93.mjs → Grid-B53O57Vv.js} +1 -1
- package/dist/Grid-Cw9joyDF.cjs +1 -0
- package/dist/IFrame-CP2oHuDb.cjs +1 -0
- package/dist/{IFrame-CaAOVLGN.mjs → IFrame-DRvqa1hl.js} +1 -1
- package/dist/Image-B9Rer9RA.cjs +1 -0
- package/dist/{Image-C8v5dCij.mjs → Image-BjIZuyk1.js} +1 -1
- package/dist/{MathDisplay-CoGsFzXW.mjs → MathDisplay-BficZWEq.js} +2 -2
- package/dist/MathDisplay-D5rx_pee.cjs +1 -0
- package/dist/{MathInline-0xTZoIIq.mjs → MathInline-Ca8s53fu.js} +2 -2
- package/dist/MathInline-DZ86cc6g.cjs +1 -0
- package/dist/{McChoices-Aj394G5E.mjs → McChoices-B8W03KdG.js} +1 -1
- package/dist/McChoices-CW1gsp_V.cjs +1 -0
- package/dist/McQuestion-DwBWk5S2.cjs +1 -0
- package/dist/{McQuestion-DvD-J47M.mjs → McQuestion-WyxeDFjM.js} +1 -1
- package/dist/McSolution-BtY7RBEb.cjs +1 -0
- package/dist/{McSolution-C5sTXz3y.mjs → McSolution-CRahjdmW.js} +1 -1
- package/dist/{MultipleChoice-Dv-k1zUU.mjs → MultipleChoice-BgGHy-NW.js} +4 -4
- package/dist/MultipleChoice-mFFm3sQv.cjs +1 -0
- package/dist/{Paragraph-DGcZy8t_.mjs → Paragraph-C3uQVRMm.js} +1 -1
- package/dist/Paragraph-CU-CMQz2.cjs +1 -0
- package/dist/{SlotNode-6OpoUcOa.mjs → SlotNode-BThSEhpr.js} +1 -1
- package/dist/SlotNode-ivBAGFTX.cjs +1 -0
- package/dist/Text-3RT27QJn.cjs +1 -0
- package/dist/{Text-Br_pcGz4.mjs → Text-cG9dlJgd.js} +1 -1
- package/dist/{index-DVmWCrQE.mjs → index-C97tUvOp.js} +30 -30
- package/dist/index-DuVSDVpW.cjs +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +8 -2
- package/dist/AttachmentBlock-DsmJP3Kw.js +0 -1
- package/dist/AttachmentInline-Dc3dp0g-.js +0 -1
- package/dist/AttachmentMenu-ExoCOe4B.js +0 -1
- package/dist/Callout-DPdOqTb4.js +0 -1
- package/dist/FoldBlock-ZPMf0QsR.js +0 -1
- package/dist/Grid-QToZdaRT.js +0 -1
- package/dist/IFrame-DcCpSoDC.js +0 -1
- package/dist/Image-cHL85CXs.js +0 -1
- package/dist/MathDisplay-CESKZV46.js +0 -1
- package/dist/MathInline-C_1SJUVz.js +0 -1
- package/dist/McChoices-B4euzY7M.js +0 -1
- package/dist/McQuestion-Dq0aM5tC.js +0 -1
- package/dist/McSolution-N79CllH9.js +0 -1
- package/dist/MultipleChoice-DTCF3Q8m.js +0 -1
- package/dist/Paragraph-CzRSCJNr.js +0 -1
- package/dist/SlotNode-DMG0R6Vf.js +0 -1
- package/dist/Text-DlUfrsNI.js +0 -1
- package/dist/index-D2CtpNvR.js +0 -1
- package/src/apis/monitor.ts +0 -8
- package/src/apis/tingwu.ts +0 -22
- package/src/apis/types.ts +0 -45
- package/src/components/TreeRecursive.vue +0 -47
- package/src/components/TreeRender.vue +0 -404
- package/src/components/collections/async/AsyncError.vue +0 -17
- package/src/components/collections/async/AsyncLoading.vue +0 -1
- package/src/components/collections/attachment/AttachmentBlock.vue +0 -561
- package/src/components/collections/attachment/AttachmentInline.vue +0 -90
- package/src/components/collections/attachment/AttachmentMenu.vue +0 -359
- package/src/components/collections/attachment/VideoDetail.vue +0 -375
- package/src/components/collections/attachment/index.ts +0 -6
- package/src/components/collections/basic/Blockquote.vue +0 -15
- package/src/components/collections/basic/BulletList.vue +0 -15
- package/src/components/collections/basic/HardBreak.vue +0 -11
- package/src/components/collections/basic/Heading.vue +0 -15
- package/src/components/collections/basic/HorizontalRule.vue +0 -11
- package/src/components/collections/basic/ListItem.vue +0 -15
- package/src/components/collections/basic/OrderedList.vue +0 -15
- package/src/components/collections/basic/Paragraph.vue +0 -19
- package/src/components/collections/basic/Text.vue +0 -73
- package/src/components/collections/basic/index.ts +0 -13
- package/src/components/collections/callout/Callout.vue +0 -77
- package/src/components/collections/callout/index.ts +0 -5
- package/src/components/collections/code/CellOutput.vue +0 -72
- package/src/components/collections/code/CodeBlock.vue +0 -83
- package/src/components/collections/code/index.ts +0 -6
- package/src/components/collections/fold/FoldBlock.vue +0 -130
- package/src/components/collections/fold/index.ts +0 -5
- package/src/components/collections/grid/Grid.vue +0 -70
- package/src/components/collections/grid/index.ts +0 -5
- package/src/components/collections/iframe/IFrame.vue +0 -19
- package/src/components/collections/iframe/index.ts +0 -5
- package/src/components/collections/img/Image.vue +0 -318
- package/src/components/collections/img/index.ts +0 -5
- package/src/components/collections/index.ts +0 -29
- package/src/components/collections/math/MathDisplay.vue +0 -42
- package/src/components/collections/math/MathInline.vue +0 -42
- package/src/components/collections/math/index.ts +0 -6
- package/src/components/collections/multipleChoice/McChoices.vue +0 -72
- package/src/components/collections/multipleChoice/McQuestion.vue +0 -61
- package/src/components/collections/multipleChoice/McSolution.vue +0 -47
- package/src/components/collections/multipleChoice/MultipleChoice.vue +0 -62
- package/src/components/collections/multipleChoice/index.ts +0 -8
- package/src/components/collections/table/TableCell.vue +0 -20
- package/src/components/collections/table/TableContainer.vue +0 -32
- package/src/components/collections/table/TableHeader.vue +0 -15
- package/src/components/collections/table/TableRow.vue +0 -15
- package/src/components/collections/table/index.ts +0 -8
- package/src/components/collections/utils.ts +0 -17
- package/src/components/collections/wrapper/Doc.vue +0 -15
- package/src/components/collections/wrapper/SlotNode.vue +0 -5
- package/src/components/collections/wrapper/index.ts +0 -6
- package/src/components/index.ts +0 -1
- package/src/icons/Attachment/CardView.vue +0 -21
- package/src/icons/Attachment/Code/Bat.vue +0 -26
- package/src/icons/Attachment/Code/C.vue +0 -26
- package/src/icons/Attachment/Code/Cpp.vue +0 -26
- package/src/icons/Attachment/Code/Css.vue +0 -34
- package/src/icons/Attachment/Code/Go.vue +0 -26
- package/src/icons/Attachment/Code/Html.vue +0 -34
- package/src/icons/Attachment/Code/Java.vue +0 -42
- package/src/icons/Attachment/Code/Js.vue +0 -26
- package/src/icons/Attachment/Code/Json.vue +0 -26
- package/src/icons/Attachment/Code/Jsx.vue +0 -30
- package/src/icons/Attachment/Code/Md.vue +0 -26
- package/src/icons/Attachment/Code/Php.vue +0 -26
- package/src/icons/Attachment/Code/Python.vue +0 -30
- package/src/icons/Attachment/Code/Rb.vue +0 -26
- package/src/icons/Attachment/Code/Sh.vue +0 -30
- package/src/icons/Attachment/Code/Sql.vue +0 -30
- package/src/icons/Attachment/Code/Swift.vue +0 -26
- package/src/icons/Attachment/Code/Ts.vue +0 -26
- package/src/icons/Attachment/Code/Tsx.vue +0 -30
- package/src/icons/Attachment/Code/Vue.vue +0 -24
- package/src/icons/Attachment/Excel.vue +0 -26
- package/src/icons/Attachment/Eye.vue +0 -15
- package/src/icons/Attachment/FullScreen.vue +0 -15
- package/src/icons/Attachment/InlineView.vue +0 -21
- package/src/icons/Attachment/Pdf.vue +0 -25
- package/src/icons/Attachment/Ppt.vue +0 -26
- package/src/icons/Attachment/PreviewView.vue +0 -21
- package/src/icons/Attachment/UnknownFile.vue +0 -26
- package/src/icons/Attachment/VideoIcon.vue +0 -25
- package/src/icons/Attachment/VideoPlay.vue +0 -15
- package/src/icons/Attachment/Word.vue +0 -26
- package/src/icons/Code/Confirm.vue +0 -38
- package/src/icons/Code/Paste.vue +0 -8
- package/src/icons/Common/Choice.vue +0 -28
- package/src/icons/Common/Close.vue +0 -15
- package/src/icons/Common/Comment.vue +0 -16
- package/src/icons/Common/CopyAnchorLink.vue +0 -15
- package/src/icons/Common/Delete.vue +0 -15
- package/src/icons/Common/Download.vue +0 -15
- package/src/icons/Common/FoldClose.vue +0 -9
- package/src/icons/Common/FoldOpen.vue +0 -9
- package/src/icons/Common/Plate.vue +0 -23
- package/src/icons/Common/Question.vue +0 -8
- package/src/icons/Common/ShareTextLink.vue +0 -15
- package/src/index.ts +0 -3
- package/src/types.ts +0 -236
- package/src/utils/common.ts +0 -6
- package/src/utils/emoji.ts +0 -3715
- package/src/utils/globalStatus.ts +0 -19
- package/src/utils/shiki.ts +0 -25
- package/src/utils/useAttachment.ts +0 -215
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -23
- package/vite.config.ts +0 -24
- /package/dist/{Blockquote-BamWUQND.mjs → Blockquote-BamWUQND.js} +0 -0
- /package/dist/{Blockquote-CQSBFnsu.js → Blockquote-CQSBFnsu.cjs} +0 -0
- /package/dist/{BulletList-BQTUD69X.mjs → BulletList-BQTUD69X.js} +0 -0
- /package/dist/{BulletList-CFjF3U-l.js → BulletList-CFjF3U-l.cjs} +0 -0
- /package/dist/{Doc-6s4VMDsx.mjs → Doc-6s4VMDsx.js} +0 -0
- /package/dist/{Doc-D2yvlSII.js → Doc-D2yvlSII.cjs} +0 -0
- /package/dist/{HardBreak-B2tFO31P.mjs → HardBreak-B2tFO31P.js} +0 -0
- /package/dist/{HardBreak-Dbf5Zg5o.js → HardBreak-Dbf5Zg5o.cjs} +0 -0
- /package/dist/{Heading-BElRvhGn.mjs → Heading-BElRvhGn.js} +0 -0
- /package/dist/{Heading-BUnffIAz.js → Heading-BUnffIAz.cjs} +0 -0
- /package/dist/{HorizontalRule-BRG45oT0.mjs → HorizontalRule-BRG45oT0.js} +0 -0
- /package/dist/{HorizontalRule-CE09LZGf.js → HorizontalRule-CE09LZGf.cjs} +0 -0
- /package/dist/{ListItem-BrjxeGxz.js → ListItem-BrjxeGxz.cjs} +0 -0
- /package/dist/{ListItem-X0T7a_z8.mjs → ListItem-X0T7a_z8.js} +0 -0
- /package/dist/{OrderedList-B8v1gchv.mjs → OrderedList-B8v1gchv.js} +0 -0
- /package/dist/{OrderedList-DMl3tvwP.js → OrderedList-DMl3tvwP.cjs} +0 -0
- /package/dist/{TableCell-BY9gdldc.js → TableCell-BY9gdldc.cjs} +0 -0
- /package/dist/{TableCell-Bp52L368.mjs → TableCell-Bp52L368.js} +0 -0
- /package/dist/{TableContainer-C5KXY6f7.js → TableContainer-C5KXY6f7.cjs} +0 -0
- /package/dist/{TableContainer-C9PhNGlz.mjs → TableContainer-C9PhNGlz.js} +0 -0
- /package/dist/{TableHeader-BTuqvorM.js → TableHeader-BTuqvorM.cjs} +0 -0
- /package/dist/{TableHeader-C7KKz3e1.mjs → TableHeader-C7KKz3e1.js} +0 -0
- /package/dist/{TableRow-D4F6AKFt.js → TableRow-D4F6AKFt.cjs} +0 -0
- /package/dist/{TableRow-OzpVq1qW.mjs → TableRow-OzpVq1qW.js} +0 -0
- /package/dist/{emoji-Bk6FG72F.js → emoji-Bk6FG72F.cjs} +0 -0
- /package/dist/{emoji-CmOToDEU.mjs → emoji-CmOToDEU.js} +0 -0
- /package/dist/{katex-CS0ZfoxP.js → katex-CS0ZfoxP.cjs} +0 -0
- /package/dist/{katex-r9TeExgs.mjs → katex-r9TeExgs.js} +0 -0
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ai-panel">
|
|
3
|
-
<div class="panel-header">
|
|
4
|
-
<div class="header-title">
|
|
5
|
-
<span class="icon">🤖</span>
|
|
6
|
-
<span>智能分析结果</span>
|
|
7
|
-
</div>
|
|
8
|
-
<button class="close-btn" @click="$emit('close')" title="关闭助手">
|
|
9
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
10
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
11
|
-
</svg>
|
|
12
|
-
</button>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<div v-if="loading" class="panel-loading">
|
|
16
|
-
<div class="spinner"></div>
|
|
17
|
-
<p>正在生成分析结果...</p>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div v-else-if="error" class="panel-error">
|
|
21
|
-
{{ error }}
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div v-else class="panel-content">
|
|
25
|
-
<div class="content-card summary-card" v-if="analysis?.summary">
|
|
26
|
-
<div class="card-header">
|
|
27
|
-
<span class="card-title">全文摘要</span>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="summary-text" :class="{ expanded: isExpanded }">
|
|
30
|
-
{{ analysis.summary }}
|
|
31
|
-
</div>
|
|
32
|
-
<div class="expand-btn" v-if="analysis.summary.length > 100" @click="isExpanded = !isExpanded">
|
|
33
|
-
{{ isExpanded ? '收起' : '展开全文' }}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div class="content-card chapters-card">
|
|
38
|
-
<div class="card-header">
|
|
39
|
-
<span class="card-title">章节速览</span>
|
|
40
|
-
<span class="badge">{{ analysis?.chapters?.length || 0 }}</span>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div class="chapter-list">
|
|
44
|
-
<div v-for="(chapter, index) in analysis?.chapters || []" :key="index" class="chapter-item"
|
|
45
|
-
@click="seekToChapter(chapter)">
|
|
46
|
-
<div class="chapter-index">{{ index + 1 }}</div>
|
|
47
|
-
<div class="chapter-info">
|
|
48
|
-
<div class="chapter-title">{{ chapter.title }}</div>
|
|
49
|
-
<div class="chapter-time">
|
|
50
|
-
<i class="icon-time">🕒</i>
|
|
51
|
-
{{ formatTime(chapter.startTime) }} - {{ formatTime(chapter.endTime) }}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div v-if="!analysis?.chapters || analysis.chapters.length === 0" class="empty-state">暂无章节信息</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script setup lang="ts">
|
|
64
|
-
import { inject, onMounted, ref } from 'vue';
|
|
65
|
-
import { monitorApi } from '@datawhale/dipwap-render/apis/monitor';
|
|
66
|
-
import { videoProgressDetailApi } from '@datawhale/dipwap-render/apis/tingwu';
|
|
67
|
-
import { axiosKey } from '@datawhale/dipwap-render/apis/types';
|
|
68
|
-
|
|
69
|
-
// 接口定义
|
|
70
|
-
interface Chapter {
|
|
71
|
-
title: string;
|
|
72
|
-
startTime: number;
|
|
73
|
-
endTime: number;
|
|
74
|
-
}
|
|
75
|
-
interface Analysis {
|
|
76
|
-
summary?: string;
|
|
77
|
-
chapters?: Chapter[];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const props = defineProps<{
|
|
81
|
-
taskId: string;
|
|
82
|
-
videoRef: HTMLVideoElement | null;
|
|
83
|
-
}>();
|
|
84
|
-
|
|
85
|
-
const loading = ref(false);
|
|
86
|
-
const error = ref('');
|
|
87
|
-
const analysis = ref<Analysis | null>(null);
|
|
88
|
-
const isExpanded = ref(false);
|
|
89
|
-
|
|
90
|
-
const service = inject(axiosKey);
|
|
91
|
-
|
|
92
|
-
const loadAnalysis = async () => {
|
|
93
|
-
if (!props.taskId) return;
|
|
94
|
-
if (!service) return;
|
|
95
|
-
loading.value = true;
|
|
96
|
-
try {
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
const data = await videoProgressDetailApi(service, { taskId: props.taskId });
|
|
99
|
-
analysis.value = {
|
|
100
|
-
summary: data.summary,
|
|
101
|
-
chapters: JSON.parse(data.chapters) as { title: string; startTime: number; endTime: number }[],
|
|
102
|
-
};
|
|
103
|
-
loading.value = false;
|
|
104
|
-
} catch (e) {
|
|
105
|
-
error.value = '加载失败';
|
|
106
|
-
loading.value = false;
|
|
107
|
-
console.error(e);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const seekToChapter = async (chapter: Chapter) => {
|
|
112
|
-
if (props.videoRef) {
|
|
113
|
-
props.videoRef.currentTime = chapter.startTime;
|
|
114
|
-
void props.videoRef.play();
|
|
115
|
-
}
|
|
116
|
-
if (service) {
|
|
117
|
-
// @ts-ignore
|
|
118
|
-
await monitorApi(service, {
|
|
119
|
-
log: JSON.stringify({
|
|
120
|
-
name: 'toggleVideoAiPanelSidebar',
|
|
121
|
-
chapterTitle: chapter.title,
|
|
122
|
-
tingwuTaskId: props.taskId,
|
|
123
|
-
videoPageUrl: window.location.href,
|
|
124
|
-
}),
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const formatTime = (seconds: number) => {
|
|
130
|
-
const m = Math.floor(seconds / 60);
|
|
131
|
-
const s = Math.floor(seconds % 60);
|
|
132
|
-
return `${m}:${s.toString().padStart(2, '0')}`;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
onMounted(async () => {
|
|
136
|
-
await loadAnalysis();
|
|
137
|
-
});
|
|
138
|
-
</script>
|
|
139
|
-
|
|
140
|
-
<style lang="scss" scoped>
|
|
141
|
-
$primary-color: #2563eb;
|
|
142
|
-
$border-color: #e5e7eb;
|
|
143
|
-
$bg-white: #ffffff;
|
|
144
|
-
$text-main: #111827;
|
|
145
|
-
$text-sub: #6b7280;
|
|
146
|
-
$hover-bg: #f3f4f6;
|
|
147
|
-
|
|
148
|
-
.ai-panel {
|
|
149
|
-
background: $bg-white;
|
|
150
|
-
border-radius: 8px;
|
|
151
|
-
border: 1px solid $border-color;
|
|
152
|
-
height: 100%;
|
|
153
|
-
max-height: 500px;
|
|
154
|
-
display: flex;
|
|
155
|
-
flex-direction: column;
|
|
156
|
-
overflow: hidden;
|
|
157
|
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.panel-header {
|
|
161
|
-
padding: 12px 16px;
|
|
162
|
-
background-color: #eff6ff;
|
|
163
|
-
border-bottom: 1px solid #bfdbfe;
|
|
164
|
-
display: flex;
|
|
165
|
-
justify-content: space-between;
|
|
166
|
-
align-items: center;
|
|
167
|
-
|
|
168
|
-
.header-title {
|
|
169
|
-
font-size: 14px;
|
|
170
|
-
font-weight: 600;
|
|
171
|
-
color: #1e40af;
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
gap: 8px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// 新增:关闭按钮样式
|
|
178
|
-
.close-btn {
|
|
179
|
-
background: transparent;
|
|
180
|
-
border: none;
|
|
181
|
-
cursor: pointer;
|
|
182
|
-
color: #60a5fa; // 浅蓝色
|
|
183
|
-
padding: 4px;
|
|
184
|
-
border-radius: 4px;
|
|
185
|
-
display: flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
justify-content: center;
|
|
188
|
-
transition: all 0.2s;
|
|
189
|
-
width: 24px;
|
|
190
|
-
height: 24px;
|
|
191
|
-
|
|
192
|
-
svg {
|
|
193
|
-
width: 18px;
|
|
194
|
-
height: 18px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&:hover {
|
|
198
|
-
background-color: rgba(255, 255, 255, 0.5);
|
|
199
|
-
color: #1e40af; // 深蓝色
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// ... 后面的样式保持不变 ...
|
|
205
|
-
.panel-loading,
|
|
206
|
-
.panel-error {
|
|
207
|
-
padding: 32px;
|
|
208
|
-
text-align: center;
|
|
209
|
-
color: $text-sub;
|
|
210
|
-
font-size: 13px;
|
|
211
|
-
|
|
212
|
-
.spinner {
|
|
213
|
-
width: 20px;
|
|
214
|
-
height: 20px;
|
|
215
|
-
border: 2px solid $border-color;
|
|
216
|
-
border-top-color: $primary-color;
|
|
217
|
-
border-radius: 50%;
|
|
218
|
-
margin: 0 auto 12px;
|
|
219
|
-
animation: spin 1s linear infinite;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.panel-content {
|
|
224
|
-
flex: 1;
|
|
225
|
-
overflow-y: auto;
|
|
226
|
-
padding: 0;
|
|
227
|
-
|
|
228
|
-
&::-webkit-scrollbar {
|
|
229
|
-
width: 4px;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
&::-webkit-scrollbar-thumb {
|
|
233
|
-
background: #d1d5db;
|
|
234
|
-
border-radius: 2px;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.content-card {
|
|
239
|
-
padding: 16px;
|
|
240
|
-
border-bottom: 1px solid $border-color;
|
|
241
|
-
|
|
242
|
-
&:last-child {
|
|
243
|
-
border-bottom: none;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.card-header {
|
|
247
|
-
display: flex;
|
|
248
|
-
justify-content: space-between;
|
|
249
|
-
align-items: center;
|
|
250
|
-
margin-bottom: 12px;
|
|
251
|
-
|
|
252
|
-
.card-title {
|
|
253
|
-
font-size: 13px;
|
|
254
|
-
font-weight: 700;
|
|
255
|
-
color: $text-sub;
|
|
256
|
-
text-transform: uppercase;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.badge {
|
|
260
|
-
font-size: 12px;
|
|
261
|
-
background: $hover-bg;
|
|
262
|
-
padding: 2px 6px;
|
|
263
|
-
border-radius: 4px;
|
|
264
|
-
color: $text-sub;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.summary-card {
|
|
270
|
-
.summary-text {
|
|
271
|
-
font-size: 14px;
|
|
272
|
-
line-height: 1.6;
|
|
273
|
-
color: #374151;
|
|
274
|
-
text-align: justify;
|
|
275
|
-
display: -webkit-box;
|
|
276
|
-
-webkit-line-clamp: 3;
|
|
277
|
-
-webkit-box-orient: vertical;
|
|
278
|
-
overflow: hidden;
|
|
279
|
-
|
|
280
|
-
&.expanded {
|
|
281
|
-
-webkit-line-clamp: unset;
|
|
282
|
-
overflow: visible;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.expand-btn {
|
|
287
|
-
margin-top: 8px;
|
|
288
|
-
font-size: 12px;
|
|
289
|
-
color: $primary-color;
|
|
290
|
-
cursor: pointer;
|
|
291
|
-
|
|
292
|
-
&:hover {
|
|
293
|
-
text-decoration: underline;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.chapter-list {
|
|
299
|
-
display: flex;
|
|
300
|
-
flex-direction: column;
|
|
301
|
-
gap: 8px;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.chapter-item {
|
|
305
|
-
display: flex;
|
|
306
|
-
gap: 12px;
|
|
307
|
-
padding: 8px;
|
|
308
|
-
border-radius: 6px;
|
|
309
|
-
cursor: pointer;
|
|
310
|
-
border: 1px solid transparent;
|
|
311
|
-
transition: all 0.2s;
|
|
312
|
-
|
|
313
|
-
&:hover {
|
|
314
|
-
background-color: $hover-bg;
|
|
315
|
-
border-color: $border-color;
|
|
316
|
-
|
|
317
|
-
.chapter-index {
|
|
318
|
-
background-color: white;
|
|
319
|
-
color: $primary-color;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.chapter-title {
|
|
323
|
-
color: $primary-color;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.chapter-index {
|
|
328
|
-
width: 20px;
|
|
329
|
-
height: 20px;
|
|
330
|
-
background-color: #dbeafe;
|
|
331
|
-
color: $primary-color;
|
|
332
|
-
font-size: 11px;
|
|
333
|
-
font-weight: 700;
|
|
334
|
-
display: flex;
|
|
335
|
-
align-items: center;
|
|
336
|
-
justify-content: center;
|
|
337
|
-
border-radius: 4px;
|
|
338
|
-
flex-shrink: 0;
|
|
339
|
-
margin-top: 2px;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.chapter-info {
|
|
343
|
-
flex: 1;
|
|
344
|
-
min-width: 0;
|
|
345
|
-
|
|
346
|
-
.chapter-title {
|
|
347
|
-
font-size: 14px;
|
|
348
|
-
font-weight: 500;
|
|
349
|
-
color: #374151;
|
|
350
|
-
margin-bottom: 4px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.chapter-time {
|
|
354
|
-
font-size: 12px;
|
|
355
|
-
color: #9ca3af;
|
|
356
|
-
display: flex;
|
|
357
|
-
align-items: center;
|
|
358
|
-
gap: 4px;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.empty-state {
|
|
364
|
-
text-align: center;
|
|
365
|
-
color: #9ca3af;
|
|
366
|
-
font-size: 13px;
|
|
367
|
-
padding: 12px 0;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
@keyframes spin {
|
|
371
|
-
to {
|
|
372
|
-
transform: rotate(360deg);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
</style>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { customDefineAsyncComponent } from '../utils';
|
|
2
|
-
|
|
3
|
-
export const attachmentMapper: Record<string, any> = {
|
|
4
|
-
'attachment-inline': customDefineAsyncComponent(() => import('./AttachmentInline.vue')),
|
|
5
|
-
'attachment-block': customDefineAsyncComponent(() => import('./AttachmentBlock.vue')),
|
|
6
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<blockquote>
|
|
3
|
-
<slot />
|
|
4
|
-
</blockquote>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import type { PMBlockquote } from '@datawhale/dipwap-types/index';
|
|
9
|
-
|
|
10
|
-
defineProps<{
|
|
11
|
-
node: PMBlockquote;
|
|
12
|
-
}>();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style scoped></style>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component :id="node.attrs.id" :is="`h${node.attrs.level}`" class="heading">
|
|
3
|
-
<slot />
|
|
4
|
-
</component>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import type { PMHeading } from '@datawhale/dipwap-types/index';
|
|
9
|
-
|
|
10
|
-
defineProps<{
|
|
11
|
-
node: PMHeading;
|
|
12
|
-
}>();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style scoped></style>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ol :start="node.attrs.start">
|
|
3
|
-
<slot />
|
|
4
|
-
</ol>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import type { PMOrderedList } from '@datawhale/dipwap-types/index';
|
|
9
|
-
|
|
10
|
-
defineProps<{
|
|
11
|
-
node: PMOrderedList;
|
|
12
|
-
}>();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style scoped></style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<p class="paragraph">
|
|
3
|
-
<slot />
|
|
4
|
-
</p>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import type { PMParagraph } from '@datawhale/dipwap-types/index';
|
|
9
|
-
|
|
10
|
-
defineProps<{
|
|
11
|
-
node: PMParagraph;
|
|
12
|
-
}>();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style scoped>
|
|
16
|
-
p:empty::before {
|
|
17
|
-
content: '\00a0';
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<template v-if="node.marks?.length && currentMarkType">
|
|
3
|
-
<!-- 每次取第0个mark渲染对应的标签 -->
|
|
4
|
-
<!-- 再取除了第0个以外的其他marks,再加上其他属性,递归地传至下一层 -->
|
|
5
|
-
<component
|
|
6
|
-
v-if="currentMarkType === 'link'"
|
|
7
|
-
:is="currentHTMLType"
|
|
8
|
-
:target="(currentMark as LinkMark).attrs?.href"
|
|
9
|
-
:href="(currentMark as LinkMark).attrs?.href"
|
|
10
|
-
:class="(currentMark as LinkMark).attrs?.class"
|
|
11
|
-
:rel="(currentMark as LinkMark).attrs?.rel"
|
|
12
|
-
>
|
|
13
|
-
<Text :node="{ ...node, marks: node.marks?.slice(1) }" />
|
|
14
|
-
</component>
|
|
15
|
-
<component
|
|
16
|
-
v-else-if="currentMarkType === 'highlight'"
|
|
17
|
-
:is="currentHTMLType"
|
|
18
|
-
:style="{
|
|
19
|
-
...(currentMark as HighlightMark).attrs,
|
|
20
|
-
color: null,
|
|
21
|
-
'background-color': (currentMark as HighlightMark).attrs.color,
|
|
22
|
-
}"
|
|
23
|
-
>
|
|
24
|
-
<Text :node="{ ...node, marks: node.marks?.slice(1) }" />
|
|
25
|
-
</component>
|
|
26
|
-
<component
|
|
27
|
-
v-else-if="currentMarkType === 'textStyle'"
|
|
28
|
-
:is="currentHTMLType"
|
|
29
|
-
:style="(currentMark as TextStyleMark).attrs ?? null"
|
|
30
|
-
>
|
|
31
|
-
<Text :node="{ ...node, marks: node.marks?.slice(1) }" />
|
|
32
|
-
</component>
|
|
33
|
-
<component v-else :is="currentHTMLType">
|
|
34
|
-
<Text :node="{ ...node, marks: node.marks?.slice(1) }" />
|
|
35
|
-
</component>
|
|
36
|
-
</template>
|
|
37
|
-
<SlotNode v-else>
|
|
38
|
-
{{ node.text }}
|
|
39
|
-
</SlotNode>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script setup lang="ts">
|
|
43
|
-
import { computed } from 'vue';
|
|
44
|
-
import type { HighlightMark, LinkMark, PMText, TextStyleMark } from '@datawhale/dipwap-types/index';
|
|
45
|
-
import SlotNode from '../wrapper/SlotNode.vue';
|
|
46
|
-
|
|
47
|
-
const { node } = defineProps<{
|
|
48
|
-
node: PMText;
|
|
49
|
-
}>();
|
|
50
|
-
|
|
51
|
-
const currentMark = computed(() => {
|
|
52
|
-
return node.marks?.[0];
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const currentMarkType = computed(() => {
|
|
56
|
-
return currentMark.value?.type;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const currentHTMLType = computed(() => {
|
|
60
|
-
return nodeTypeMap[currentMark.value?.type as keyof typeof nodeTypeMap];
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const nodeTypeMap = {
|
|
64
|
-
bold: 'strong',
|
|
65
|
-
italic: 'em',
|
|
66
|
-
underline: 'u',
|
|
67
|
-
strike: 's',
|
|
68
|
-
highlight: 'mark',
|
|
69
|
-
textStyle: 'span',
|
|
70
|
-
link: 'a',
|
|
71
|
-
code: 'code',
|
|
72
|
-
};
|
|
73
|
-
</script>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { customDefineAsyncComponent } from '../utils';
|
|
2
|
-
|
|
3
|
-
export const basicMapper: Record<string, any> = {
|
|
4
|
-
text: customDefineAsyncComponent(() => import('./Text.vue')),
|
|
5
|
-
paragraph: customDefineAsyncComponent(() => import('./Paragraph.vue')),
|
|
6
|
-
heading: customDefineAsyncComponent(() => import('./Heading.vue')),
|
|
7
|
-
orderedList: customDefineAsyncComponent(() => import('./OrderedList.vue')),
|
|
8
|
-
bulletList: customDefineAsyncComponent(() => import('./BulletList.vue')),
|
|
9
|
-
listItem: customDefineAsyncComponent(() => import('./ListItem.vue')),
|
|
10
|
-
horizontalRule: customDefineAsyncComponent(() => import('./HorizontalRule.vue')),
|
|
11
|
-
blockquote: customDefineAsyncComponent(() => import('./Blockquote.vue')),
|
|
12
|
-
hardBreak: customDefineAsyncComponent(() => import('./HardBreak.vue')),
|
|
13
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="callout-wrapper" :style="{ backgroundColor: node.attrs.bgColor, borderColor: node.attrs.bdColor }">
|
|
3
|
-
<div class="callout-icon">
|
|
4
|
-
{{ node.attrs.emoji ? EMOJI_MAP[node.attrs.emoji] : EMOJI_MAP['whale'] }}
|
|
5
|
-
</div>
|
|
6
|
-
<div class="callout-content">
|
|
7
|
-
<div class="node-view-content">
|
|
8
|
-
<TreeRecursive v-for="child in node.content" :node="child" :key="useId()" />
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { useId } from 'vue';
|
|
16
|
-
import TreeRecursive from '@datawhale/dipwap-render/components/TreeRecursive.vue';
|
|
17
|
-
import { EMOJI_MAP } from '@datawhale/dipwap-render/utils/emoji';
|
|
18
|
-
import type { PMLarkCallout } from '@datawhale/dipwap-types/index';
|
|
19
|
-
|
|
20
|
-
const { node } = defineProps<{
|
|
21
|
-
node: PMLarkCallout;
|
|
22
|
-
}>();
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style scoped lang="scss">
|
|
26
|
-
.callout-wrapper {
|
|
27
|
-
position: relative;
|
|
28
|
-
margin: 16px 0;
|
|
29
|
-
padding: 16px;
|
|
30
|
-
border-radius: 6px;
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: row;
|
|
33
|
-
border-width: 1.5px;
|
|
34
|
-
border-style: solid;
|
|
35
|
-
.callout-icon {
|
|
36
|
-
font-size: 22px;
|
|
37
|
-
width: 26px;
|
|
38
|
-
height: 26px;
|
|
39
|
-
display: flex;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
align-items: center;
|
|
42
|
-
cursor: default;
|
|
43
|
-
&:hover {
|
|
44
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
45
|
-
border-radius: 4px;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
.callout-content {
|
|
49
|
-
padding-left: 12px;
|
|
50
|
-
display: flex;
|
|
51
|
-
justify-content: flex-start;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
flex: 1;
|
|
54
|
-
min-width: 0;
|
|
55
|
-
overflow-x: auto;
|
|
56
|
-
.node-view-content {
|
|
57
|
-
width: 100%;
|
|
58
|
-
& > :deep(*:first-child),
|
|
59
|
-
& > :deep(ul > li:first-child),
|
|
60
|
-
& > :deep(ul > li:first-child > p:first-child),
|
|
61
|
-
& > :deep(ol > li:first-child),
|
|
62
|
-
& > :deep(ol > li:first-child > p:first-child),
|
|
63
|
-
& > :deep(div:first-child > pre) {
|
|
64
|
-
margin-top: 0;
|
|
65
|
-
}
|
|
66
|
-
& > :deep(*:last-child),
|
|
67
|
-
& > :deep(ul > li:last-child),
|
|
68
|
-
& > :deep(ul > li:last-child > p:last-child),
|
|
69
|
-
& > :deep(ol > li:last-child),
|
|
70
|
-
& > :deep(ol > li:last-child > p:last-child),
|
|
71
|
-
& > :deep(div:last-child > pre) {
|
|
72
|
-
margin-bottom: 0;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</style>
|