@cmstops/pro-compo 0.3.39 → 0.3.41
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/index.css +74 -0
- package/dist/index.min.css +1 -1
- package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +45 -51
- package/es/docHistory/component.d.ts +0 -0
- package/es/docHistory/component.js +100 -0
- package/es/docHistory/components/DocDiffPanel/index.d.ts +0 -0
- package/es/docHistory/components/DocDiffPanel/index.js +22 -0
- package/es/docHistory/components/DocHistoryList/index.d.ts +0 -0
- package/es/docHistory/components/DocHistoryList/index.js +37 -0
- package/es/docHistory/index.d.ts +2 -0
- package/es/docHistory/index.js +7 -0
- package/es/docHistory/scripts/diff.d.ts +1 -0
- package/es/docHistory/scripts/diff.js +293 -0
- package/es/docHistory/scripts/useDocHistory.d.ts +10 -0
- package/es/docHistory/scripts/useDocHistory.js +71 -0
- package/es/docHistory/style/css.js +1 -0
- package/es/docHistory/style/docDiffPanel.less +9 -0
- package/es/docHistory/style/docHistoryList.less +58 -0
- package/es/docHistory/style/index.css +74 -0
- package/es/docHistory/style/index.d.ts +1 -0
- package/es/docHistory/style/index.js +1 -0
- package/es/docHistory/style/index.less +28 -0
- package/es/index.css +74 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +44 -50
- package/lib/docHistory/component.js +101 -0
- package/lib/docHistory/components/DocDiffPanel/index.js +23 -0
- package/lib/docHistory/components/DocHistoryList/index.js +38 -0
- package/lib/docHistory/index.js +8 -0
- package/lib/docHistory/scripts/diff.js +295 -0
- package/lib/docHistory/scripts/useDocHistory.js +74 -0
- package/lib/docHistory/style/css.js +2 -0
- package/lib/docHistory/style/docDiffPanel.less +9 -0
- package/lib/docHistory/style/docHistoryList.less +58 -0
- package/lib/docHistory/style/index.css +74 -0
- package/lib/docHistory/style/index.js +2 -0
- package/lib/docHistory/style/index.less +28 -0
- package/lib/index.css +74 -0
- package/lib/index.js +2 -0
- package/lib/index.less +1 -0
- package/package.json +7 -5
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
var diff = require("diff");
|
|
4
|
+
function GetAllTextNodes(parent) {
|
|
5
|
+
let nodesList = [];
|
|
6
|
+
const layer = parent.childNodes;
|
|
7
|
+
const childNum = layer.length;
|
|
8
|
+
for (let i = 0; i < childNum; i++) {
|
|
9
|
+
const childNode = layer[i];
|
|
10
|
+
const noteType = childNode.nodeType;
|
|
11
|
+
if (noteType === 3 && Trim(childNode.data).length !== 0) {
|
|
12
|
+
nodesList[nodesList.length] = childNode;
|
|
13
|
+
}
|
|
14
|
+
if (noteType === 1) {
|
|
15
|
+
nodesList = nodesList.concat(GetAllTextNodes(childNode));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return nodesList;
|
|
19
|
+
}
|
|
20
|
+
function CompareById2(leftNode, rightNode) {
|
|
21
|
+
const lftList = GetAllTextNodes(leftNode);
|
|
22
|
+
const rhtList = GetAllTextNodes(rightNode);
|
|
23
|
+
CompareNodes(lftList, rhtList);
|
|
24
|
+
return leftNode.innerHTML;
|
|
25
|
+
}
|
|
26
|
+
function Equal(v_node1, v_node2) {
|
|
27
|
+
if (v_node1.data === v_node2.data)
|
|
28
|
+
return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
function CompareText(v_LeftList, v_RightList, lftPNode = null) {
|
|
32
|
+
const leftLen = v_LeftList.length;
|
|
33
|
+
const rightLen = v_RightList.length;
|
|
34
|
+
if (rightLen === leftLen && rightLen === 1) {
|
|
35
|
+
if (v_LeftList[0].data.length === v_RightList[0].data.length && v_RightList[0].data.length === 1)
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (leftLen === 0) {
|
|
39
|
+
let rightFather = null;
|
|
40
|
+
for (let i = 0; i < rightLen; i++) {
|
|
41
|
+
if (!rightFather)
|
|
42
|
+
rightFather = v_RightList[i].parentNode;
|
|
43
|
+
const node = v_RightList[i].clone(true);
|
|
44
|
+
try {
|
|
45
|
+
rightFather.removeChild(v_RightList[i]);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.log(e);
|
|
48
|
+
}
|
|
49
|
+
if (lftPNode)
|
|
50
|
+
lftPNode.appendChild(node);
|
|
51
|
+
PaintRemove(node);
|
|
52
|
+
}
|
|
53
|
+
} else if (rightLen === 0) {
|
|
54
|
+
for (let i = 0; i < leftLen; i++)
|
|
55
|
+
PaintAdd(v_LeftList[i]);
|
|
56
|
+
} else {
|
|
57
|
+
const LeftTextList = GetCharList(v_LeftList);
|
|
58
|
+
const RightTextList = GetCharList(v_RightList);
|
|
59
|
+
const diff$1 = diff.diffChars(RightTextList.join(""), LeftTextList.join(""));
|
|
60
|
+
let leftFather = null;
|
|
61
|
+
for (let i = 0; i < v_LeftList.length; i++) {
|
|
62
|
+
if (!leftFather)
|
|
63
|
+
leftFather = v_LeftList[i].parentNode;
|
|
64
|
+
try {
|
|
65
|
+
leftFather.removeChild(v_LeftList[i]);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.log(e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
diff$1.forEach((item) => {
|
|
71
|
+
if (item.added) {
|
|
72
|
+
const addNode = document.createTextNode(item.value);
|
|
73
|
+
leftFather.appendChild(addNode);
|
|
74
|
+
PaintAdd(addNode);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (item.removed) {
|
|
78
|
+
const removeNode = document.createTextNode(item.value);
|
|
79
|
+
leftFather.appendChild(removeNode);
|
|
80
|
+
PaintRemove(removeNode);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const changeNode = document.createTextNode(item.value);
|
|
84
|
+
leftFather.appendChild(changeNode);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function GetCharList(v_nodeList) {
|
|
89
|
+
const CharList = [];
|
|
90
|
+
for (let i = 0; i < v_nodeList.length; i++) {
|
|
91
|
+
const text = v_nodeList[i].data;
|
|
92
|
+
for (let j = 0; j < text.length; j++) {
|
|
93
|
+
CharList[CharList.length] = text.charAt(j);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return CharList;
|
|
97
|
+
}
|
|
98
|
+
function PaintAdd(vNode) {
|
|
99
|
+
const nNode = document.createElement("span");
|
|
100
|
+
nNode.style.background = "#d3fadc";
|
|
101
|
+
const c = vNode.cloneNode(true);
|
|
102
|
+
nNode.appendChild(c);
|
|
103
|
+
const f = vNode.parentNode;
|
|
104
|
+
f.replaceChild(nNode, vNode);
|
|
105
|
+
vNode = c;
|
|
106
|
+
return vNode;
|
|
107
|
+
}
|
|
108
|
+
function PaintRemove(vNode) {
|
|
109
|
+
const nNode = document.createElement("span");
|
|
110
|
+
nNode.style.textDecoration = "line-through";
|
|
111
|
+
nNode.style.background = "#f7cfd3";
|
|
112
|
+
const c = vNode.cloneNode(true);
|
|
113
|
+
nNode.appendChild(c);
|
|
114
|
+
const f = vNode.parentNode;
|
|
115
|
+
f.replaceChild(nNode, vNode);
|
|
116
|
+
vNode = c;
|
|
117
|
+
return vNode;
|
|
118
|
+
}
|
|
119
|
+
function GetNodeList(v_nodesList, v_begin, v_len) {
|
|
120
|
+
const List = [];
|
|
121
|
+
for (let j = 0; j < v_len; j++) {
|
|
122
|
+
List[j] = v_nodesList[v_begin + j];
|
|
123
|
+
}
|
|
124
|
+
return List;
|
|
125
|
+
}
|
|
126
|
+
function LTrim(s) {
|
|
127
|
+
return s.replace(/^\s*/, "");
|
|
128
|
+
}
|
|
129
|
+
function RTrim(s) {
|
|
130
|
+
return s.replace(/\s*$/, "");
|
|
131
|
+
}
|
|
132
|
+
function Trim(s) {
|
|
133
|
+
return RTrim(LTrim(s));
|
|
134
|
+
}
|
|
135
|
+
function CompareNodes(v_LeftNodesList, v_RightNodesList) {
|
|
136
|
+
let PreRightIndex = -1;
|
|
137
|
+
let PreLeftIndex = -1;
|
|
138
|
+
let RightIndex = 0;
|
|
139
|
+
let LeftIndex = 0;
|
|
140
|
+
const nLeftNodesListLen = v_LeftNodesList.length;
|
|
141
|
+
const nRightNodesListLen = v_RightNodesList.length;
|
|
142
|
+
while (LeftIndex <= nLeftNodesListLen || RightIndex <= nRightNodesListLen) {
|
|
143
|
+
const leftFather = LeftIndex === nLeftNodesListLen ? v_LeftNodesList[LeftIndex - 1] : v_LeftNodesList[LeftIndex];
|
|
144
|
+
if (LeftIndex === nLeftNodesListLen) {
|
|
145
|
+
try {
|
|
146
|
+
CompareText(
|
|
147
|
+
GetNodeList(
|
|
148
|
+
v_LeftNodesList,
|
|
149
|
+
PreLeftIndex + 1,
|
|
150
|
+
LeftIndex - PreLeftIndex - 1
|
|
151
|
+
),
|
|
152
|
+
GetNodeList(
|
|
153
|
+
v_RightNodesList,
|
|
154
|
+
PreRightIndex + 1,
|
|
155
|
+
RightIndex - PreRightIndex - 1
|
|
156
|
+
),
|
|
157
|
+
leftFather
|
|
158
|
+
);
|
|
159
|
+
} catch (e) {
|
|
160
|
+
console.log("\u5220\u9664\u6570\u636E\u586B\u5145\u5F02\u5E38");
|
|
161
|
+
throw e;
|
|
162
|
+
}
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
if (RightIndex === nRightNodesListLen) {
|
|
166
|
+
try {
|
|
167
|
+
CompareText(
|
|
168
|
+
GetNodeList(
|
|
169
|
+
v_LeftNodesList,
|
|
170
|
+
PreLeftIndex + 1,
|
|
171
|
+
LeftIndex - PreLeftIndex - 1
|
|
172
|
+
),
|
|
173
|
+
GetNodeList(
|
|
174
|
+
v_RightNodesList,
|
|
175
|
+
PreRightIndex + 1,
|
|
176
|
+
RightIndex - PreRightIndex - 1
|
|
177
|
+
),
|
|
178
|
+
leftFather
|
|
179
|
+
);
|
|
180
|
+
for (let j = LeftIndex; j < nLeftNodesListLen; j++)
|
|
181
|
+
v_RightNodesList[j] = PaintAdd(v_LeftNodesList[j]);
|
|
182
|
+
break;
|
|
183
|
+
} catch (e) {
|
|
184
|
+
console.log("\u65B0\u589E\u6570\u636E\u586B\u5145\u5F02\u5E38");
|
|
185
|
+
throw e;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (Equal(v_LeftNodesList[LeftIndex], v_RightNodesList[RightIndex])) {
|
|
189
|
+
if (v_LeftNodesList[LeftIndex].data.length > 1) {
|
|
190
|
+
try {
|
|
191
|
+
CompareText(
|
|
192
|
+
GetNodeList(
|
|
193
|
+
v_LeftNodesList,
|
|
194
|
+
PreLeftIndex + 1,
|
|
195
|
+
LeftIndex - PreLeftIndex - 1
|
|
196
|
+
),
|
|
197
|
+
GetNodeList(
|
|
198
|
+
v_RightNodesList,
|
|
199
|
+
PreRightIndex + 1,
|
|
200
|
+
RightIndex - PreRightIndex - 1
|
|
201
|
+
),
|
|
202
|
+
leftFather
|
|
203
|
+
);
|
|
204
|
+
} catch (e) {
|
|
205
|
+
console.log("\u76F8\u4F3C\u8282\u70B9\u5BF9\u6BD4\u5F02\u5E38");
|
|
206
|
+
throw e;
|
|
207
|
+
}
|
|
208
|
+
PreLeftIndex = LeftIndex;
|
|
209
|
+
PreRightIndex = RightIndex;
|
|
210
|
+
} else if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
|
|
211
|
+
PreLeftIndex = LeftIndex;
|
|
212
|
+
PreRightIndex = RightIndex;
|
|
213
|
+
}
|
|
214
|
+
LeftIndex++;
|
|
215
|
+
RightIndex++;
|
|
216
|
+
} else {
|
|
217
|
+
let i = 0;
|
|
218
|
+
for (i = RightIndex + 1; i < nRightNodesListLen; i++) {
|
|
219
|
+
if (Equal(v_LeftNodesList[LeftIndex], v_RightNodesList[i])) {
|
|
220
|
+
if (v_LeftNodesList[LeftIndex].data.length > 1) {
|
|
221
|
+
CompareText(
|
|
222
|
+
GetNodeList(
|
|
223
|
+
v_LeftNodesList,
|
|
224
|
+
PreLeftIndex + 1,
|
|
225
|
+
LeftIndex - PreLeftIndex - 1
|
|
226
|
+
),
|
|
227
|
+
GetNodeList(
|
|
228
|
+
v_RightNodesList,
|
|
229
|
+
PreRightIndex + 1,
|
|
230
|
+
i - PreRightIndex - 1
|
|
231
|
+
),
|
|
232
|
+
leftFather
|
|
233
|
+
);
|
|
234
|
+
PreLeftIndex = LeftIndex;
|
|
235
|
+
PreRightIndex = i;
|
|
236
|
+
LeftIndex++;
|
|
237
|
+
RightIndex = i + 1;
|
|
238
|
+
} else {
|
|
239
|
+
if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
|
|
240
|
+
PreLeftIndex = LeftIndex;
|
|
241
|
+
PreRightIndex = RightIndex;
|
|
242
|
+
}
|
|
243
|
+
RightIndex++;
|
|
244
|
+
LeftIndex++;
|
|
245
|
+
}
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (i === nRightNodesListLen) {
|
|
250
|
+
i = 0;
|
|
251
|
+
for (i = LeftIndex + 1; i < nLeftNodesListLen; i++) {
|
|
252
|
+
if (Equal(v_RightNodesList[RightIndex], v_LeftNodesList[i])) {
|
|
253
|
+
if (v_LeftNodesList[i].data.length > 1) {
|
|
254
|
+
try {
|
|
255
|
+
CompareText(
|
|
256
|
+
GetNodeList(
|
|
257
|
+
v_LeftNodesList,
|
|
258
|
+
PreLeftIndex + 1,
|
|
259
|
+
i - PreLeftIndex - 1
|
|
260
|
+
),
|
|
261
|
+
GetNodeList(
|
|
262
|
+
v_RightNodesList,
|
|
263
|
+
PreRightIndex + 1,
|
|
264
|
+
RightIndex - PreRightIndex - 1
|
|
265
|
+
),
|
|
266
|
+
leftFather
|
|
267
|
+
);
|
|
268
|
+
} catch (e) {
|
|
269
|
+
console.log("\u975E\u76F8\u4F3C\u8282\u70B9\u5BF9\u6BD4\u5F02\u5E38");
|
|
270
|
+
throw e;
|
|
271
|
+
}
|
|
272
|
+
PreLeftIndex = i;
|
|
273
|
+
PreRightIndex = RightIndex;
|
|
274
|
+
RightIndex++;
|
|
275
|
+
LeftIndex = i + 1;
|
|
276
|
+
} else {
|
|
277
|
+
if (v_LeftNodesList[LeftIndex].data.length === 1 && v_LeftNodesList[LeftIndex].data.charCodeAt(0) > 127) {
|
|
278
|
+
PreLeftIndex = LeftIndex;
|
|
279
|
+
PreRightIndex = RightIndex;
|
|
280
|
+
}
|
|
281
|
+
RightIndex++;
|
|
282
|
+
LeftIndex++;
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (i === nLeftNodesListLen) {
|
|
288
|
+
LeftIndex++;
|
|
289
|
+
RightIndex++;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
exports.CompareById2 = CompareById2;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
var vue = require("vue");
|
|
4
|
+
var request = require("../../utils/request.js");
|
|
5
|
+
var diff = require("./diff.js");
|
|
6
|
+
function getDocHistory(BASE_API, id, pub) {
|
|
7
|
+
return request(BASE_API, {
|
|
8
|
+
url: `/poplar/v2/content/${id}/history?pub=${pub}`,
|
|
9
|
+
method: "get"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function useDocHistory(BASE_API) {
|
|
13
|
+
const list = vue.ref([]);
|
|
14
|
+
const loading = vue.ref(true);
|
|
15
|
+
const current = vue.ref(0);
|
|
16
|
+
const diffContent = vue.ref();
|
|
17
|
+
const id = vue.ref();
|
|
18
|
+
const pub = vue.ref(false);
|
|
19
|
+
function initParams(mediaId, docPub) {
|
|
20
|
+
id.value = mediaId;
|
|
21
|
+
pub.value = docPub;
|
|
22
|
+
}
|
|
23
|
+
async function loadData() {
|
|
24
|
+
if (!id.value)
|
|
25
|
+
return;
|
|
26
|
+
loading.value = true;
|
|
27
|
+
try {
|
|
28
|
+
const { code, message } = await getDocHistory(BASE_API, id.value, pub.value);
|
|
29
|
+
if (code !== 0)
|
|
30
|
+
return;
|
|
31
|
+
list.value = message;
|
|
32
|
+
handleSelect(0);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.log(e);
|
|
35
|
+
} finally {
|
|
36
|
+
loading.value = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function handleSelect(idx) {
|
|
40
|
+
loading.value = true;
|
|
41
|
+
try {
|
|
42
|
+
current.value = idx;
|
|
43
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
44
|
+
const cur = list.value[idx];
|
|
45
|
+
const prev = list.value[idx + 1];
|
|
46
|
+
const value = JSON.parse(JSON.stringify(cur));
|
|
47
|
+
if (!prev) {
|
|
48
|
+
diffContent.value = value;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const curHtml = document.createElement("div");
|
|
52
|
+
curHtml.innerHTML = cur.content;
|
|
53
|
+
const prevHtml = document.createElement("div");
|
|
54
|
+
prevHtml.innerHTML = prev.content;
|
|
55
|
+
value.content = diff.CompareById2(curHtml, prevHtml);
|
|
56
|
+
diffContent.value = value;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.log(e, "diff \u5931\u8D25");
|
|
59
|
+
} finally {
|
|
60
|
+
loading.value = false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
diffContent,
|
|
65
|
+
current,
|
|
66
|
+
loading,
|
|
67
|
+
list,
|
|
68
|
+
loadData,
|
|
69
|
+
initParams,
|
|
70
|
+
handleSelect
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
exports.getDocHistory = getDocHistory;
|
|
74
|
+
exports.useDocHistory = useDocHistory;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.doc-diff-panel-wrap {
|
|
2
|
+
padding: 24px;
|
|
3
|
+
}
|
|
4
|
+
.doc-diff-panel-wrap .doc-title {
|
|
5
|
+
color: var(--color-text-1);
|
|
6
|
+
font-weight: bold;
|
|
7
|
+
font-size: 24px;
|
|
8
|
+
}
|
|
9
|
+
.doc-history-list-wrap {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
border-left: 1px solid var(--color-border-1);
|
|
12
|
+
}
|
|
13
|
+
.doc-history-list-wrap .doc-history-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 5px;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 260px;
|
|
19
|
+
padding: 20px 16px;
|
|
20
|
+
border-bottom: 1px solid var(--color-border-1);
|
|
21
|
+
border-left: 3px solid transparent;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
.doc-history-list-wrap .doc-history-item .update-time {
|
|
25
|
+
color: var(--color-text-1);
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
}
|
|
28
|
+
.doc-history-list-wrap .doc-history-item .tips {
|
|
29
|
+
color: var(--color-text-2);
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
}
|
|
32
|
+
.doc-history-list-wrap .doc-history-item .doc-author {
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
align-items: center;
|
|
36
|
+
color: var(--color-text-1);
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
39
|
+
.doc-history-list-wrap .doc-history-item .doc-author::before {
|
|
40
|
+
width: 5px;
|
|
41
|
+
height: 5px;
|
|
42
|
+
background-color: rgb(var(--primary-6));
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
content: ' ';
|
|
45
|
+
}
|
|
46
|
+
.doc-history-list-wrap .doc-history-item.active {
|
|
47
|
+
background-color: rgba(var(--primary-6), 0.1);
|
|
48
|
+
border-left-color: rgb(var(--primary-6));
|
|
49
|
+
}
|
|
50
|
+
.doc-history-list-wrap .doc-history-item.active .update-time {
|
|
51
|
+
color: rgb(var(--primary-6));
|
|
52
|
+
}
|
|
53
|
+
.doc-history-list-wrap .doc-history-item:hover {
|
|
54
|
+
background-color: var(--color-fill-1);
|
|
55
|
+
}
|
|
56
|
+
.doc-history-wrap {
|
|
57
|
+
display: flex;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
.doc-history-wrap .doc-diff-panel {
|
|
63
|
+
flex: 1;
|
|
64
|
+
height: 100%;
|
|
65
|
+
}
|
|
66
|
+
.doc-history-wrap .doc-diff-panel .doc-diff-panel-wrap {
|
|
67
|
+
padding: 24px;
|
|
68
|
+
}
|
|
69
|
+
.doc-history-wrap .doc-history-list {
|
|
70
|
+
height: 100%;
|
|
71
|
+
}
|
|
72
|
+
.doc-history-drawer .arco-drawer-body {
|
|
73
|
+
padding: 0;
|
|
74
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import './docDiffPanel.less';
|
|
2
|
+
@import './docHistoryList.less';
|
|
3
|
+
|
|
4
|
+
.doc-history-wrap {
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
.doc-diff-panel {
|
|
11
|
+
flex: 1;
|
|
12
|
+
height: 100%;
|
|
13
|
+
|
|
14
|
+
.doc-diff-panel-wrap {
|
|
15
|
+
padding: 24px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.doc-history-list {
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.doc-history-drawer {
|
|
25
|
+
.arco-drawer-body {
|
|
26
|
+
padding: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
package/lib/index.css
CHANGED
|
@@ -4672,3 +4672,77 @@
|
|
|
4672
4672
|
font-size: 20px;
|
|
4673
4673
|
cursor: pointer;
|
|
4674
4674
|
}
|
|
4675
|
+
.doc-diff-panel-wrap {
|
|
4676
|
+
padding: 24px;
|
|
4677
|
+
}
|
|
4678
|
+
.doc-diff-panel-wrap .doc-title {
|
|
4679
|
+
color: var(--color-text-1);
|
|
4680
|
+
font-weight: bold;
|
|
4681
|
+
font-size: 24px;
|
|
4682
|
+
}
|
|
4683
|
+
.doc-history-list-wrap {
|
|
4684
|
+
box-sizing: border-box;
|
|
4685
|
+
border-left: 1px solid var(--color-border-1);
|
|
4686
|
+
}
|
|
4687
|
+
.doc-history-list-wrap .doc-history-item {
|
|
4688
|
+
display: flex;
|
|
4689
|
+
flex-direction: column;
|
|
4690
|
+
gap: 5px;
|
|
4691
|
+
box-sizing: border-box;
|
|
4692
|
+
width: 260px;
|
|
4693
|
+
padding: 20px 16px;
|
|
4694
|
+
border-bottom: 1px solid var(--color-border-1);
|
|
4695
|
+
border-left: 3px solid transparent;
|
|
4696
|
+
cursor: pointer;
|
|
4697
|
+
}
|
|
4698
|
+
.doc-history-list-wrap .doc-history-item .update-time {
|
|
4699
|
+
color: var(--color-text-1);
|
|
4700
|
+
font-size: 14px;
|
|
4701
|
+
}
|
|
4702
|
+
.doc-history-list-wrap .doc-history-item .tips {
|
|
4703
|
+
color: var(--color-text-2);
|
|
4704
|
+
font-size: 12px;
|
|
4705
|
+
}
|
|
4706
|
+
.doc-history-list-wrap .doc-history-item .doc-author {
|
|
4707
|
+
display: flex;
|
|
4708
|
+
gap: 8px;
|
|
4709
|
+
align-items: center;
|
|
4710
|
+
color: var(--color-text-1);
|
|
4711
|
+
font-size: 14px;
|
|
4712
|
+
}
|
|
4713
|
+
.doc-history-list-wrap .doc-history-item .doc-author::before {
|
|
4714
|
+
width: 5px;
|
|
4715
|
+
height: 5px;
|
|
4716
|
+
background-color: rgb(var(--primary-6));
|
|
4717
|
+
border-radius: 50%;
|
|
4718
|
+
content: ' ';
|
|
4719
|
+
}
|
|
4720
|
+
.doc-history-list-wrap .doc-history-item.active {
|
|
4721
|
+
background-color: rgba(var(--primary-6), 0.1);
|
|
4722
|
+
border-left-color: rgb(var(--primary-6));
|
|
4723
|
+
}
|
|
4724
|
+
.doc-history-list-wrap .doc-history-item.active .update-time {
|
|
4725
|
+
color: rgb(var(--primary-6));
|
|
4726
|
+
}
|
|
4727
|
+
.doc-history-list-wrap .doc-history-item:hover {
|
|
4728
|
+
background-color: var(--color-fill-1);
|
|
4729
|
+
}
|
|
4730
|
+
.doc-history-wrap {
|
|
4731
|
+
display: flex;
|
|
4732
|
+
width: 100%;
|
|
4733
|
+
height: 100%;
|
|
4734
|
+
overflow: hidden;
|
|
4735
|
+
}
|
|
4736
|
+
.doc-history-wrap .doc-diff-panel {
|
|
4737
|
+
flex: 1;
|
|
4738
|
+
height: 100%;
|
|
4739
|
+
}
|
|
4740
|
+
.doc-history-wrap .doc-diff-panel .doc-diff-panel-wrap {
|
|
4741
|
+
padding: 24px;
|
|
4742
|
+
}
|
|
4743
|
+
.doc-history-wrap .doc-history-list {
|
|
4744
|
+
height: 100%;
|
|
4745
|
+
}
|
|
4746
|
+
.doc-history-drawer .arco-drawer-body {
|
|
4747
|
+
padding: 0;
|
|
4748
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var index$m = require("./mediaView/index.js");
|
|
|
27
27
|
var index$n = require("./thumbCard/index.js");
|
|
28
28
|
var index$o = require("./selectResourceModal/index.js");
|
|
29
29
|
var index$p = require("./docPreview/index.js");
|
|
30
|
+
var index$q = require("./docHistory/index.js");
|
|
30
31
|
exports["default"] = components;
|
|
31
32
|
exports.appCenter = index;
|
|
32
33
|
exports.messageBox = index$1;
|
|
@@ -54,3 +55,4 @@ exports.mediaView = index$m;
|
|
|
54
55
|
exports.thumbCard = index$n;
|
|
55
56
|
exports.selectResourceModal = index$o;
|
|
56
57
|
exports.docPreview = index$p;
|
|
58
|
+
exports.docHistory = index$q;
|
package/lib/index.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmstops/pro-compo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
"gif.js": "^0.2.0",
|
|
56
56
|
"tus-js-client": "^3.1.1",
|
|
57
57
|
"vue": "^3.2.0",
|
|
58
|
-
"vuedraggable": "^4.1.0"
|
|
58
|
+
"vuedraggable": "^4.1.0",
|
|
59
|
+
"diff": "^5.2.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@arco-design/web-vue": "~2",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"@storybook/builder-webpack5": "^6.5.9",
|
|
77
78
|
"@storybook/manager-webpack5": "^6.5.9",
|
|
78
79
|
"@storybook/vue3": "^6.3.0",
|
|
80
|
+
"@types/diff": "^5.2.1",
|
|
79
81
|
"@types/fs-extra": "^9.0.6",
|
|
80
82
|
"@types/jest": "^29.5.5",
|
|
81
83
|
"@types/node": "^20.6.2",
|
|
@@ -117,7 +119,8 @@
|
|
|
117
119
|
"vue": "^3.2.0",
|
|
118
120
|
"vue-loader": "^16.2.0",
|
|
119
121
|
"vuedraggable": "^4.1.0",
|
|
120
|
-
"webpack": "^5.88.2"
|
|
122
|
+
"webpack": "^5.88.2",
|
|
123
|
+
"diff": "^5.2.0"
|
|
121
124
|
},
|
|
122
125
|
"arcoMeta": {
|
|
123
126
|
"type": "vue-library",
|
|
@@ -130,6 +133,5 @@
|
|
|
130
133
|
"es",
|
|
131
134
|
"lib",
|
|
132
135
|
"dist"
|
|
133
|
-
]
|
|
134
|
-
"dependencies": {}
|
|
136
|
+
]
|
|
135
137
|
}
|