@cmstops/pro-compo 0.3.39 → 0.3.40

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 (41) hide show
  1. package/dist/index.css +74 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/docHistory/component.d.ts +0 -0
  4. package/es/docHistory/component.js +100 -0
  5. package/es/docHistory/components/DocDiffPanel/index.d.ts +0 -0
  6. package/es/docHistory/components/DocDiffPanel/index.js +22 -0
  7. package/es/docHistory/components/DocHistoryList/index.d.ts +0 -0
  8. package/es/docHistory/components/DocHistoryList/index.js +37 -0
  9. package/es/docHistory/index.d.ts +2 -0
  10. package/es/docHistory/index.js +7 -0
  11. package/es/docHistory/scripts/diff.d.ts +1 -0
  12. package/es/docHistory/scripts/diff.js +293 -0
  13. package/es/docHistory/scripts/useDocHistory.d.ts +10 -0
  14. package/es/docHistory/scripts/useDocHistory.js +71 -0
  15. package/es/docHistory/style/css.js +1 -0
  16. package/es/docHistory/style/docDiffPanel.less +9 -0
  17. package/es/docHistory/style/docHistoryList.less +58 -0
  18. package/es/docHistory/style/index.css +74 -0
  19. package/es/docHistory/style/index.d.ts +1 -0
  20. package/es/docHistory/style/index.js +1 -0
  21. package/es/docHistory/style/index.less +28 -0
  22. package/es/index.css +74 -0
  23. package/es/index.d.ts +1 -0
  24. package/es/index.js +1 -0
  25. package/es/index.less +1 -0
  26. package/lib/docHistory/component.js +101 -0
  27. package/lib/docHistory/components/DocDiffPanel/index.js +23 -0
  28. package/lib/docHistory/components/DocHistoryList/index.js +38 -0
  29. package/lib/docHistory/index.js +8 -0
  30. package/lib/docHistory/scripts/diff.js +295 -0
  31. package/lib/docHistory/scripts/useDocHistory.js +74 -0
  32. package/lib/docHistory/style/css.js +2 -0
  33. package/lib/docHistory/style/docDiffPanel.less +9 -0
  34. package/lib/docHistory/style/docHistoryList.less +58 -0
  35. package/lib/docHistory/style/index.css +74 -0
  36. package/lib/docHistory/style/index.js +2 -0
  37. package/lib/docHistory/style/index.less +28 -0
  38. package/lib/index.css +74 -0
  39. package/lib/index.js +2 -0
  40. package/lib/index.less +1 -0
  41. package/package.json +7 -5
@@ -0,0 +1,100 @@
1
+ import { defineComponent, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createCommentVNode } from "vue";
2
+ import { Drawer, Spin, Scrollbar } from "@arco-design/web-vue";
3
+ import { DEFAULT_BASE_API } from "../config.js";
4
+ import { useDocHistory } from "./scripts/useDocHistory.js";
5
+ import _sfc_main$2 from "./components/DocHistoryList/index.js";
6
+ import _sfc_main$1 from "./components/DocDiffPanel/index.js";
7
+ const _hoisted_1 = { class: "doc-history-wrap" };
8
+ const _hoisted_2 = { class: "doc-diff-panel" };
9
+ const _hoisted_3 = { class: "doc-history-list" };
10
+ const _sfc_main = defineComponent({
11
+ ...{ name: "docHistory" },
12
+ __name: "component",
13
+ props: {
14
+ BASE_API: {},
15
+ visible: { type: Boolean },
16
+ docInfo: {},
17
+ pub: { type: Boolean }
18
+ },
19
+ emits: ["update:visible"],
20
+ setup(__props, { emit: __emit }) {
21
+ const props = __props;
22
+ const emits = __emit;
23
+ const vis = computed({
24
+ get: () => props.visible,
25
+ set: (val) => {
26
+ emits("update:visible", val);
27
+ }
28
+ });
29
+ const BASE_API = props.BASE_API || DEFAULT_BASE_API;
30
+ const {
31
+ initParams,
32
+ loadData,
33
+ handleSelect,
34
+ loading,
35
+ diffContent,
36
+ list,
37
+ current
38
+ } = useDocHistory(BASE_API);
39
+ onMounted(() => {
40
+ if (!props.docInfo)
41
+ return;
42
+ initParams(props.docInfo.id, props.pub);
43
+ loadData();
44
+ });
45
+ return (_ctx, _cache) => {
46
+ return openBlock(), createBlock(unref(Drawer), {
47
+ visible: vis.value,
48
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event),
49
+ class: "doc-history-drawer",
50
+ title: "\u7248\u672C\u8BB0\u5F55",
51
+ width: 1e3,
52
+ footer: false
53
+ }, {
54
+ default: withCtx(() => [
55
+ createElementVNode("div", _hoisted_1, [
56
+ createElementVNode("div", _hoisted_2, [
57
+ createVNode(unref(Spin), {
58
+ loading: unref(loading),
59
+ style: { "height": "100%", "width": "100%" }
60
+ }, {
61
+ default: withCtx(() => [
62
+ createVNode(unref(Scrollbar), {
63
+ "outer-style": { height: "100%" },
64
+ style: { "height": "100%", "overflow": "auto" }
65
+ }, {
66
+ default: withCtx(() => [
67
+ unref(diffContent) ? (openBlock(), createBlock(_sfc_main$1, {
68
+ key: 0,
69
+ doc: unref(diffContent)
70
+ }, null, 8, ["doc"])) : createCommentVNode("v-if", true)
71
+ ]),
72
+ _: 1
73
+ })
74
+ ]),
75
+ _: 1
76
+ }, 8, ["loading"])
77
+ ]),
78
+ createElementVNode("div", _hoisted_3, [
79
+ createVNode(unref(Scrollbar), {
80
+ "outer-style": { height: "100%" },
81
+ style: { "height": "100%", "overflow": "auto" }
82
+ }, {
83
+ default: withCtx(() => [
84
+ createVNode(_sfc_main$2, {
85
+ list: unref(list),
86
+ current: unref(current),
87
+ onSelect: unref(handleSelect)
88
+ }, null, 8, ["list", "current", "onSelect"])
89
+ ]),
90
+ _: 1
91
+ })
92
+ ])
93
+ ])
94
+ ]),
95
+ _: 1
96
+ }, 8, ["visible"]);
97
+ };
98
+ }
99
+ });
100
+ export { _sfc_main as default };
@@ -0,0 +1,22 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
+ const _hoisted_1 = { class: "doc-diff-panel-wrap" };
3
+ const _hoisted_2 = { class: "doc-title" };
4
+ const _hoisted_3 = ["innerHTML"];
5
+ const _sfc_main = defineComponent({
6
+ __name: "index",
7
+ props: {
8
+ doc: {}
9
+ },
10
+ setup(__props) {
11
+ return (_ctx, _cache) => {
12
+ return openBlock(), createElementBlock("div", _hoisted_1, [
13
+ createElementVNode("div", _hoisted_2, toDisplayString(_ctx.doc.title), 1),
14
+ createElementVNode("div", {
15
+ class: "doc-content",
16
+ innerHTML: _ctx.doc.content
17
+ }, null, 8, _hoisted_3)
18
+ ]);
19
+ };
20
+ }
21
+ });
22
+ export { _sfc_main as default };
@@ -0,0 +1,37 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, unref, createCommentVNode } from "vue";
2
+ import { timeFormat } from "../../../utils/index.js";
3
+ const _hoisted_1 = { class: "doc-history-list-wrap" };
4
+ const _hoisted_2 = ["onClick"];
5
+ const _hoisted_3 = { class: "update-time" };
6
+ const _hoisted_4 = {
7
+ key: 0,
8
+ class: "tips"
9
+ };
10
+ const _hoisted_5 = { class: "doc-author" };
11
+ const _sfc_main = defineComponent({
12
+ __name: "index",
13
+ props: {
14
+ list: {},
15
+ current: {}
16
+ },
17
+ emits: ["select"],
18
+ setup(__props, { emit: __emit }) {
19
+ const emits = __emit;
20
+ return (_ctx, _cache) => {
21
+ return openBlock(), createElementBlock("div", _hoisted_1, [
22
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, idx) => {
23
+ return openBlock(), createElementBlock("div", {
24
+ key: item,
25
+ class: normalizeClass(["doc-history-item", { active: idx === _ctx.current }]),
26
+ onClick: ($event) => emits("select", idx)
27
+ }, [
28
+ createElementVNode("div", _hoisted_3, toDisplayString(unref(timeFormat)(item.update_time)), 1),
29
+ idx === 0 ? (openBlock(), createElementBlock("div", _hoisted_4, " \u6700\u8FD1\u66F4\u65B0")) : createCommentVNode("v-if", true),
30
+ createElementVNode("div", _hoisted_5, toDisplayString(item.author), 1)
31
+ ], 10, _hoisted_2);
32
+ }), 128))
33
+ ]);
34
+ };
35
+ }
36
+ });
37
+ export { _sfc_main as default };
@@ -0,0 +1,2 @@
1
+ declare const docHistory: any;
2
+ export default docHistory;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./component.js";
2
+ const docHistory = Object.assign(_sfc_main, {
3
+ install: (app) => {
4
+ app.component(_sfc_main.name, _sfc_main);
5
+ }
6
+ });
7
+ export { docHistory as default };
@@ -0,0 +1 @@
1
+ export declare function CompareById2(leftNode: HTMLElement, rightNode: HTMLElement): string;
@@ -0,0 +1,293 @@
1
+ import { diffChars } from "diff";
2
+ function GetAllTextNodes(parent) {
3
+ let nodesList = [];
4
+ const layer = parent.childNodes;
5
+ const childNum = layer.length;
6
+ for (let i = 0; i < childNum; i++) {
7
+ const childNode = layer[i];
8
+ const noteType = childNode.nodeType;
9
+ if (noteType === 3 && Trim(childNode.data).length !== 0) {
10
+ nodesList[nodesList.length] = childNode;
11
+ }
12
+ if (noteType === 1) {
13
+ nodesList = nodesList.concat(GetAllTextNodes(childNode));
14
+ }
15
+ }
16
+ return nodesList;
17
+ }
18
+ function CompareById2(leftNode, rightNode) {
19
+ const lftList = GetAllTextNodes(leftNode);
20
+ const rhtList = GetAllTextNodes(rightNode);
21
+ CompareNodes(lftList, rhtList);
22
+ return leftNode.innerHTML;
23
+ }
24
+ function Equal(v_node1, v_node2) {
25
+ if (v_node1.data === v_node2.data)
26
+ return true;
27
+ return false;
28
+ }
29
+ function CompareText(v_LeftList, v_RightList, lftPNode = null) {
30
+ const leftLen = v_LeftList.length;
31
+ const rightLen = v_RightList.length;
32
+ if (rightLen === leftLen && rightLen === 1) {
33
+ if (v_LeftList[0].data.length === v_RightList[0].data.length && v_RightList[0].data.length === 1)
34
+ return;
35
+ }
36
+ if (leftLen === 0) {
37
+ let rightFather = null;
38
+ for (let i = 0; i < rightLen; i++) {
39
+ if (!rightFather)
40
+ rightFather = v_RightList[i].parentNode;
41
+ const node = v_RightList[i].clone(true);
42
+ try {
43
+ rightFather.removeChild(v_RightList[i]);
44
+ } catch (e) {
45
+ console.log(e);
46
+ }
47
+ if (lftPNode)
48
+ lftPNode.appendChild(node);
49
+ PaintRemove(node);
50
+ }
51
+ } else if (rightLen === 0) {
52
+ for (let i = 0; i < leftLen; i++)
53
+ PaintAdd(v_LeftList[i]);
54
+ } else {
55
+ const LeftTextList = GetCharList(v_LeftList);
56
+ const RightTextList = GetCharList(v_RightList);
57
+ const diff = diffChars(RightTextList.join(""), LeftTextList.join(""));
58
+ let leftFather = null;
59
+ for (let i = 0; i < v_LeftList.length; i++) {
60
+ if (!leftFather)
61
+ leftFather = v_LeftList[i].parentNode;
62
+ try {
63
+ leftFather.removeChild(v_LeftList[i]);
64
+ } catch (e) {
65
+ console.log(e);
66
+ }
67
+ }
68
+ diff.forEach((item) => {
69
+ if (item.added) {
70
+ const addNode = document.createTextNode(item.value);
71
+ leftFather.appendChild(addNode);
72
+ PaintAdd(addNode);
73
+ return;
74
+ }
75
+ if (item.removed) {
76
+ const removeNode = document.createTextNode(item.value);
77
+ leftFather.appendChild(removeNode);
78
+ PaintRemove(removeNode);
79
+ return;
80
+ }
81
+ const changeNode = document.createTextNode(item.value);
82
+ leftFather.appendChild(changeNode);
83
+ });
84
+ }
85
+ }
86
+ function GetCharList(v_nodeList) {
87
+ const CharList = [];
88
+ for (let i = 0; i < v_nodeList.length; i++) {
89
+ const text = v_nodeList[i].data;
90
+ for (let j = 0; j < text.length; j++) {
91
+ CharList[CharList.length] = text.charAt(j);
92
+ }
93
+ }
94
+ return CharList;
95
+ }
96
+ function PaintAdd(vNode) {
97
+ const nNode = document.createElement("span");
98
+ nNode.style.background = "#d3fadc";
99
+ const c = vNode.cloneNode(true);
100
+ nNode.appendChild(c);
101
+ const f = vNode.parentNode;
102
+ f.replaceChild(nNode, vNode);
103
+ vNode = c;
104
+ return vNode;
105
+ }
106
+ function PaintRemove(vNode) {
107
+ const nNode = document.createElement("span");
108
+ nNode.style.textDecoration = "line-through";
109
+ nNode.style.background = "#f7cfd3";
110
+ const c = vNode.cloneNode(true);
111
+ nNode.appendChild(c);
112
+ const f = vNode.parentNode;
113
+ f.replaceChild(nNode, vNode);
114
+ vNode = c;
115
+ return vNode;
116
+ }
117
+ function GetNodeList(v_nodesList, v_begin, v_len) {
118
+ const List = [];
119
+ for (let j = 0; j < v_len; j++) {
120
+ List[j] = v_nodesList[v_begin + j];
121
+ }
122
+ return List;
123
+ }
124
+ function LTrim(s) {
125
+ return s.replace(/^\s*/, "");
126
+ }
127
+ function RTrim(s) {
128
+ return s.replace(/\s*$/, "");
129
+ }
130
+ function Trim(s) {
131
+ return RTrim(LTrim(s));
132
+ }
133
+ function CompareNodes(v_LeftNodesList, v_RightNodesList) {
134
+ let PreRightIndex = -1;
135
+ let PreLeftIndex = -1;
136
+ let RightIndex = 0;
137
+ let LeftIndex = 0;
138
+ const nLeftNodesListLen = v_LeftNodesList.length;
139
+ const nRightNodesListLen = v_RightNodesList.length;
140
+ while (LeftIndex <= nLeftNodesListLen || RightIndex <= nRightNodesListLen) {
141
+ const leftFather = LeftIndex === nLeftNodesListLen ? v_LeftNodesList[LeftIndex - 1] : v_LeftNodesList[LeftIndex];
142
+ if (LeftIndex === nLeftNodesListLen) {
143
+ try {
144
+ CompareText(
145
+ GetNodeList(
146
+ v_LeftNodesList,
147
+ PreLeftIndex + 1,
148
+ LeftIndex - PreLeftIndex - 1
149
+ ),
150
+ GetNodeList(
151
+ v_RightNodesList,
152
+ PreRightIndex + 1,
153
+ RightIndex - PreRightIndex - 1
154
+ ),
155
+ leftFather
156
+ );
157
+ } catch (e) {
158
+ console.log("\u5220\u9664\u6570\u636E\u586B\u5145\u5F02\u5E38");
159
+ throw e;
160
+ }
161
+ break;
162
+ }
163
+ if (RightIndex === nRightNodesListLen) {
164
+ try {
165
+ CompareText(
166
+ GetNodeList(
167
+ v_LeftNodesList,
168
+ PreLeftIndex + 1,
169
+ LeftIndex - PreLeftIndex - 1
170
+ ),
171
+ GetNodeList(
172
+ v_RightNodesList,
173
+ PreRightIndex + 1,
174
+ RightIndex - PreRightIndex - 1
175
+ ),
176
+ leftFather
177
+ );
178
+ for (let j = LeftIndex; j < nLeftNodesListLen; j++)
179
+ v_RightNodesList[j] = PaintAdd(v_LeftNodesList[j]);
180
+ break;
181
+ } catch (e) {
182
+ console.log("\u65B0\u589E\u6570\u636E\u586B\u5145\u5F02\u5E38");
183
+ throw e;
184
+ }
185
+ }
186
+ if (Equal(v_LeftNodesList[LeftIndex], v_RightNodesList[RightIndex])) {
187
+ if (v_LeftNodesList[LeftIndex].data.length > 1) {
188
+ try {
189
+ CompareText(
190
+ GetNodeList(
191
+ v_LeftNodesList,
192
+ PreLeftIndex + 1,
193
+ LeftIndex - PreLeftIndex - 1
194
+ ),
195
+ GetNodeList(
196
+ v_RightNodesList,
197
+ PreRightIndex + 1,
198
+ RightIndex - PreRightIndex - 1
199
+ ),
200
+ leftFather
201
+ );
202
+ } catch (e) {
203
+ console.log("\u76F8\u4F3C\u8282\u70B9\u5BF9\u6BD4\u5F02\u5E38");
204
+ throw e;
205
+ }
206
+ PreLeftIndex = LeftIndex;
207
+ PreRightIndex = RightIndex;
208
+ } else if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
209
+ PreLeftIndex = LeftIndex;
210
+ PreRightIndex = RightIndex;
211
+ }
212
+ LeftIndex++;
213
+ RightIndex++;
214
+ } else {
215
+ let i = 0;
216
+ for (i = RightIndex + 1; i < nRightNodesListLen; i++) {
217
+ if (Equal(v_LeftNodesList[LeftIndex], v_RightNodesList[i])) {
218
+ if (v_LeftNodesList[LeftIndex].data.length > 1) {
219
+ CompareText(
220
+ GetNodeList(
221
+ v_LeftNodesList,
222
+ PreLeftIndex + 1,
223
+ LeftIndex - PreLeftIndex - 1
224
+ ),
225
+ GetNodeList(
226
+ v_RightNodesList,
227
+ PreRightIndex + 1,
228
+ i - PreRightIndex - 1
229
+ ),
230
+ leftFather
231
+ );
232
+ PreLeftIndex = LeftIndex;
233
+ PreRightIndex = i;
234
+ LeftIndex++;
235
+ RightIndex = i + 1;
236
+ } else {
237
+ if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
238
+ PreLeftIndex = LeftIndex;
239
+ PreRightIndex = RightIndex;
240
+ }
241
+ RightIndex++;
242
+ LeftIndex++;
243
+ }
244
+ break;
245
+ }
246
+ }
247
+ if (i === nRightNodesListLen) {
248
+ i = 0;
249
+ for (i = LeftIndex + 1; i < nLeftNodesListLen; i++) {
250
+ if (Equal(v_RightNodesList[RightIndex], v_LeftNodesList[i])) {
251
+ if (v_LeftNodesList[i].data.length > 1) {
252
+ try {
253
+ CompareText(
254
+ GetNodeList(
255
+ v_LeftNodesList,
256
+ PreLeftIndex + 1,
257
+ i - PreLeftIndex - 1
258
+ ),
259
+ GetNodeList(
260
+ v_RightNodesList,
261
+ PreRightIndex + 1,
262
+ RightIndex - PreRightIndex - 1
263
+ ),
264
+ leftFather
265
+ );
266
+ } catch (e) {
267
+ console.log("\u975E\u76F8\u4F3C\u8282\u70B9\u5BF9\u6BD4\u5F02\u5E38");
268
+ throw e;
269
+ }
270
+ PreLeftIndex = i;
271
+ PreRightIndex = RightIndex;
272
+ RightIndex++;
273
+ LeftIndex = i + 1;
274
+ } else {
275
+ if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
276
+ PreLeftIndex = LeftIndex;
277
+ PreRightIndex = RightIndex;
278
+ }
279
+ RightIndex++;
280
+ LeftIndex++;
281
+ }
282
+ break;
283
+ }
284
+ }
285
+ if (i === nLeftNodesListLen) {
286
+ LeftIndex++;
287
+ RightIndex++;
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ export { CompareById2 };
@@ -0,0 +1,10 @@
1
+ export declare function getDocHistory(BASE_API: string, id: number, pub: boolean): import("axios").AxiosPromise<any>;
2
+ export declare function useDocHistory(BASE_API: string): {
3
+ diffContent: import("vue").Ref<any>;
4
+ current: import("vue").Ref<number>;
5
+ loading: import("vue").Ref<boolean>;
6
+ list: import("vue").Ref<any[]>;
7
+ loadData: () => Promise<void>;
8
+ initParams: (mediaId: number, docPub: boolean) => void;
9
+ handleSelect: (idx: number) => Promise<void>;
10
+ };
@@ -0,0 +1,71 @@
1
+ import { ref } from "vue";
2
+ import request from "../../utils/request.js";
3
+ import { CompareById2 } from "./diff.js";
4
+ function getDocHistory(BASE_API, id, pub) {
5
+ return request(BASE_API, {
6
+ url: `/poplar/v2/content/${id}/history?pub=${pub}`,
7
+ method: "get"
8
+ });
9
+ }
10
+ function useDocHistory(BASE_API) {
11
+ const list = ref([]);
12
+ const loading = ref(true);
13
+ const current = ref(0);
14
+ const diffContent = ref();
15
+ const id = ref();
16
+ const pub = ref(false);
17
+ function initParams(mediaId, docPub) {
18
+ id.value = mediaId;
19
+ pub.value = docPub;
20
+ }
21
+ async function loadData() {
22
+ if (!id.value)
23
+ return;
24
+ loading.value = true;
25
+ try {
26
+ const { code, message } = await getDocHistory(BASE_API, id.value, pub.value);
27
+ if (code !== 0)
28
+ return;
29
+ list.value = message;
30
+ handleSelect(0);
31
+ } catch (e) {
32
+ console.log(e);
33
+ } finally {
34
+ loading.value = false;
35
+ }
36
+ }
37
+ async function handleSelect(idx) {
38
+ loading.value = true;
39
+ try {
40
+ current.value = idx;
41
+ await new Promise((resolve) => setTimeout(resolve, 500));
42
+ const cur = list.value[idx];
43
+ const prev = list.value[idx + 1];
44
+ const value = JSON.parse(JSON.stringify(cur));
45
+ if (!prev) {
46
+ diffContent.value = value;
47
+ return;
48
+ }
49
+ const curHtml = document.createElement("div");
50
+ curHtml.innerHTML = cur.content;
51
+ const prevHtml = document.createElement("div");
52
+ prevHtml.innerHTML = prev.content;
53
+ value.content = CompareById2(curHtml, prevHtml);
54
+ diffContent.value = value;
55
+ } catch (e) {
56
+ console.log(e, "diff \u5931\u8D25");
57
+ } finally {
58
+ loading.value = false;
59
+ }
60
+ }
61
+ return {
62
+ diffContent,
63
+ current,
64
+ loading,
65
+ list,
66
+ loadData,
67
+ initParams,
68
+ handleSelect
69
+ };
70
+ }
71
+ export { getDocHistory, useDocHistory };
@@ -0,0 +1 @@
1
+ import "./index.css";
@@ -0,0 +1,9 @@
1
+ .doc-diff-panel-wrap {
2
+ padding: 24px;
3
+
4
+ .doc-title {
5
+ color: var(--color-text-1);
6
+ font-weight: bold;
7
+ font-size: 24px;
8
+ }
9
+ }
@@ -0,0 +1,58 @@
1
+ .doc-history-list-wrap {
2
+ box-sizing: border-box;
3
+ border-left: 1px solid var(--color-border-1);
4
+
5
+ // 单条历史记录
6
+ .doc-history-item {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 5px;
10
+ box-sizing: border-box;
11
+ width: 260px;
12
+ padding: 20px 16px;
13
+ border-bottom: 1px solid var(--color-border-1);
14
+ border-left: 3px solid transparent;
15
+ cursor: pointer;
16
+
17
+ .update-time {
18
+ color: var(--color-text-1);
19
+ font-size: 14px;
20
+ }
21
+
22
+ .tips {
23
+ color: var(--color-text-2);
24
+ font-size: 12px;
25
+ }
26
+
27
+ .doc-author {
28
+ display: flex;
29
+ gap: 8px;
30
+ align-items: center;
31
+ color: var(--color-text-1);
32
+ font-size: 14px;
33
+
34
+ &::before {
35
+ width: 5px;
36
+ height: 5px;
37
+ background-color: rgb(var(--primary-6));
38
+ border-radius: 50%;
39
+ content: ' ';
40
+ }
41
+ }
42
+
43
+ // 激活/选中状态
44
+ &.active {
45
+ background-color: rgba(var(--primary-6), 0.1);
46
+ border-left-color: rgb(var(--primary-6));
47
+
48
+ .update-time {
49
+ color: rgb(var(--primary-6));
50
+ }
51
+ }
52
+
53
+ // 悬浮
54
+ &:hover {
55
+ background-color: var(--color-fill-1);
56
+ }
57
+ }
58
+ }