@seafile/comment-editor 0.0.1-alpha.2 → 0.0.1-alpha.21
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/basic-sdk/assets/css/layout.css +1 -45
- package/dist/basic-sdk/comment/utils.js +39 -0
- package/dist/basic-sdk/context.js +2 -1
- package/dist/basic-sdk/editor/comment-editor.css +138 -0
- package/dist/basic-sdk/{comment/components → editor}/comment-editor.js +43 -33
- package/dist/basic-sdk/extension/plugins/image/helpers.js +1 -1
- package/dist/basic-sdk/extension/plugins/image/use-copy-image.js +1 -1
- package/dist/basic-sdk/extension/plugins/image/use-upload-image.js +1 -1
- package/dist/basic-sdk/extension/plugins/text-style/menu/index.js +1 -2
- package/dist/basic-sdk/hooks/use-comment.js +16 -183
- package/dist/basic-sdk/index.js +3 -10
- package/dist/index.js +0 -12
- package/dist/pages/seafile-comment-editor.js +34 -14
- package/package.json +1 -1
- package/dist/assets/css/plugin-editor.css +0 -7
- package/dist/assets/css/simple-viewer.css +0 -6
- package/dist/basic-sdk/comment/components/comment-all-participants/index.css +0 -83
- package/dist/basic-sdk/comment/components/comment-all-participants/index.js +0 -67
- package/dist/basic-sdk/comment/components/comment-all-participants/participant-avatar.js +0 -43
- package/dist/basic-sdk/comment/components/comment-context-menu/index.css +0 -16
- package/dist/basic-sdk/comment/components/comment-context-menu/index.js +0 -43
- package/dist/basic-sdk/comment/components/comment-context-menu/menu-item.js +0 -57
- package/dist/basic-sdk/comment/components/comment-delete-popover.js +0 -80
- package/dist/basic-sdk/comment/components/comment-item-collapse-wrapper.js +0 -160
- package/dist/basic-sdk/comment/components/comment-item-content.js +0 -154
- package/dist/basic-sdk/comment/components/comment-item-reply.js +0 -124
- package/dist/basic-sdk/comment/components/comment-item-resolved-reply.js +0 -38
- package/dist/basic-sdk/comment/components/comment-item-wrapper.js +0 -364
- package/dist/basic-sdk/comment/components/comment-list.css +0 -422
- package/dist/basic-sdk/comment/components/comment-list.js +0 -216
- package/dist/basic-sdk/comment/components/comment-operation/index.css +0 -26
- package/dist/basic-sdk/comment/components/comment-operation/index.js +0 -31
- package/dist/basic-sdk/comment/components/comment-participants-editor/index.css +0 -132
- package/dist/basic-sdk/comment/components/comment-participants-editor/index.js +0 -69
- package/dist/basic-sdk/comment/components/comment-participants-editor/searched-collaborators.js +0 -62
- package/dist/basic-sdk/comment/components/comment-participants-editor/selected-participants.js +0 -48
- package/dist/basic-sdk/comment/components/editor-comment.js +0 -183
- package/dist/basic-sdk/comment/components/elements-comment-count/element-comment-count.js +0 -64
- package/dist/basic-sdk/comment/components/elements-comment-count/index.css +0 -29
- package/dist/basic-sdk/comment/components/elements-comment-count/index.js +0 -49
- package/dist/basic-sdk/comment/components/global-comment/global-comment-body-header.js +0 -88
- package/dist/basic-sdk/comment/components/global-comment/global-comment-header.js +0 -89
- package/dist/basic-sdk/comment/components/global-comment/index.css +0 -328
- package/dist/basic-sdk/comment/components/global-comment/index.js +0 -217
- package/dist/basic-sdk/comment/components/index.js +0 -21
- package/dist/basic-sdk/comment/components/style.css +0 -40
- package/dist/basic-sdk/comment/helper.js +0 -184
- package/dist/basic-sdk/comment/hooks/comment-hooks/use-comment-context.js +0 -20
- package/dist/basic-sdk/comment/hooks/comment-hooks/use-comment-list.js +0 -45
- package/dist/basic-sdk/comment/hooks/comment-hooks/use-comment-mount.js +0 -57
- package/dist/basic-sdk/comment/hooks/notification-hooks/index.js +0 -25
- package/dist/basic-sdk/comment/hooks/notification-hooks/use-notification-context.js +0 -20
- package/dist/basic-sdk/comment/hooks/notification-hooks/use-notification-mount.js +0 -70
- package/dist/basic-sdk/comment/hooks/use-participants.js +0 -26
- package/dist/basic-sdk/comment/index.js +0 -21
- package/dist/basic-sdk/comment/reducer/comment-reducer.js +0 -353
- package/dist/basic-sdk/comment/reducer/notification-reducer.js +0 -89
- package/dist/basic-sdk/comment/utils/get-event-transfer.js +0 -77
- package/dist/basic-sdk/comment/utils/index.js +0 -281
- package/dist/basic-sdk/comment/utils/notification-utils.js +0 -62
- package/dist/basic-sdk/layout/comment-layout/index.css +0 -15
- package/dist/basic-sdk/layout/comment-layout/index.js +0 -87
- package/dist/basic-sdk/layout/comment-layout/resize-width/index.css +0 -38
- package/dist/basic-sdk/layout/comment-layout/resize-width/index.js +0 -132
- package/dist/basic-sdk/layout/editor-container.js +0 -32
- package/dist/basic-sdk/layout/index.js +0 -13
- package/dist/basic-sdk/socket/helpers.js +0 -299
- package/dist/basic-sdk/socket/index.js +0 -20
- package/dist/basic-sdk/socket/socket-client.js +0 -211
- package/dist/basic-sdk/socket/socket-manager.js +0 -386
- package/dist/basic-sdk/socket/with-socket-io.js +0 -73
- /package/dist/basic-sdk/comment/{constants/index.js → constants.js} +0 -0
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
.sdoc-comment-list-container {
|
|
2
|
-
position: absolute;
|
|
3
|
-
right: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.sdoc-comment-list-container .article.comment-editor {
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* comment detail list */
|
|
11
|
-
.sdoc-comment-list-container .comment-item-detail-wrapper .comment-item-list .comment-item .comment-content {
|
|
12
|
-
margin-bottom: 0px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sdoc-comment-list-container .comment-item-detail-wrapper .comment-item {
|
|
16
|
-
padding: 16px 16px 0px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.sdoc-comment-list-container .comment-item-selected-text-container .sdoc-comment-quote {
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.sdoc-comment-list-container .comment-item-selected-text-container .comment-item-selected-text {
|
|
25
|
-
flex: 1;
|
|
26
|
-
font-size: 14px;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
text-overflow: ellipsis;
|
|
29
|
-
white-space: nowrap;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.sdoc-comment-list-container .comment-item-list {
|
|
33
|
-
min-width: 280px;
|
|
34
|
-
overflow-x: hidden;
|
|
35
|
-
overflow-y: auto;
|
|
36
|
-
margin: 0;
|
|
37
|
-
padding: 0;
|
|
38
|
-
padding-bottom: 0px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sdoc-context-comment-list-container {
|
|
42
|
-
max-height: 430px;
|
|
43
|
-
overflow-y: auto;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.sdoc-context-comment-popover-wrapper .comment-item-list {
|
|
47
|
-
border-bottom: none !important;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.sdoc-context-comment-popover-wrapper .non-global-comment-input-wrapper {
|
|
51
|
-
border-bottom: 1px solid #ececec;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.sdoc-comment-list-container .sdoc-context-comment-popover-wrapper:last-child .non-global-comment-input-wrapper {
|
|
55
|
-
border-bottom: none !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.sdoc-comment-list-container .comment-item-list .context-comment-item-selected-text-container {
|
|
59
|
-
padding: 16px 16px 0 16px;
|
|
60
|
-
color: #666;
|
|
61
|
-
display: flex;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.comment-item-list .context-comment-item-selected-text-container .sdoc-comment-quote {
|
|
65
|
-
font-size: 12px;
|
|
66
|
-
padding-top: 2px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.comment-item-list .context-comment-item-selected-text-container .context-comment-items {
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sdoc-comment-list-container .comment-item {
|
|
76
|
-
position: relative;
|
|
77
|
-
padding: 0px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sdoc-comment-list-container .comment-item .comment-item-operation-wrapper {
|
|
81
|
-
margin-top: -12px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.comment-delete-popover .comment-delete-popover-container {
|
|
85
|
-
padding: 16px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.comment-delete-popover .comment-delete-popover-container .delete-control {
|
|
89
|
-
display: flex;
|
|
90
|
-
justify-content: flex-end;
|
|
91
|
-
width: 100%;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.sdoc-comment-list-container .comment-item .comment-header,
|
|
95
|
-
.sdoc-comment-list-container .comment-item .comment-author {
|
|
96
|
-
display: flex;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
align-items: center;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* content */
|
|
102
|
-
.comment-item .comment-content {
|
|
103
|
-
margin-top: 10px;
|
|
104
|
-
margin-left: 35px;
|
|
105
|
-
word-wrap: break-word;
|
|
106
|
-
font-size: 14px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.comment-item .comment-content ol,
|
|
110
|
-
.comment-item .comment-content ul {
|
|
111
|
-
padding-left: 2em;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.comment-item .comment-content ol li p,
|
|
115
|
-
.comment-item .comment-content ul li p {
|
|
116
|
-
margin: 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.comment-item .comment-content p {
|
|
120
|
-
margin: 0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* footer */
|
|
124
|
-
.comment-item .comment-footer {
|
|
125
|
-
display: flex;
|
|
126
|
-
color: #666666;
|
|
127
|
-
font-size: 14px;
|
|
128
|
-
margin-left: 35px;
|
|
129
|
-
margin-top: 16px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.comment-item .comment-footer .comments-count {
|
|
133
|
-
display: flex;
|
|
134
|
-
align-items: center;
|
|
135
|
-
position: relative;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.comment-item .comment-footer .comments-count .comments-count-number {
|
|
139
|
-
margin-left: 8px;
|
|
140
|
-
margin-top: -2px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.comment-item .comment-footer .comment-author {
|
|
144
|
-
margin-left: 20px;
|
|
145
|
-
align-items: initial;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.comment-item .comment-footer .comment-author__latest-reply {
|
|
149
|
-
margin-left: 8px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.comment-item .comment-footer .comment-author__latest-reply p {
|
|
153
|
-
margin: 0px;
|
|
154
|
-
overflow: hidden;
|
|
155
|
-
text-overflow: ellipsis;
|
|
156
|
-
white-space: nowrap;
|
|
157
|
-
width: 220px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.sdoc-comment-list-container .comment-header .comment-author__info {
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
align-items: flex-start;
|
|
164
|
-
justify-content: center;
|
|
165
|
-
padding-left: 10px;
|
|
166
|
-
overflow: hidden;
|
|
167
|
-
white-space: nowrap;
|
|
168
|
-
text-overflow: ellipsis;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sdoc-comment-list-container .comment-header .comment-author__info .name {
|
|
172
|
-
color: #1f1f1f;
|
|
173
|
-
font-size: 14px;
|
|
174
|
-
line-height: 20px;
|
|
175
|
-
font-weight: 500;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.sdoc-comment-list-container .comment-header .comment-author__info .time {
|
|
179
|
-
color: #444746;
|
|
180
|
-
font-size: 12px;
|
|
181
|
-
line-height: 16px;
|
|
182
|
-
display: inline-flex;
|
|
183
|
-
align-items: center;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.sdoc-comment-list-container .comment-header .comment-author__info .time .comment-success-resolved {
|
|
187
|
-
color: rgb(71, 184, 129);
|
|
188
|
-
margin-left: 6px;
|
|
189
|
-
font-size: 14px;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.sdoc-comment-list-container .comment-header .sdoc-unread-message-tip {
|
|
193
|
-
display: inline-block;
|
|
194
|
-
height: 6px;
|
|
195
|
-
width: 6px;
|
|
196
|
-
border-radius: 50%;
|
|
197
|
-
background-color: #fc6440;
|
|
198
|
-
margin-right: 6px;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.sdoc-comment-list-container .comment-header .sdoc-unread-message-text-tip {
|
|
202
|
-
display: none;
|
|
203
|
-
height: 16px;
|
|
204
|
-
padding: 0 5px;
|
|
205
|
-
border-radius: 8px;
|
|
206
|
-
margin-left: 6px;
|
|
207
|
-
background-color: #fc6440;
|
|
208
|
-
color: #fff;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.sdoc-comment-list-container .comment-ui-container .comment-operation {
|
|
212
|
-
width: 24px;
|
|
213
|
-
height: 24px;
|
|
214
|
-
padding: 0 !important;
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
background-color: #fff;
|
|
219
|
-
color: rgb(70, 77, 90);
|
|
220
|
-
overflow: hidden;
|
|
221
|
-
border-radius: 2px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.sdoc-comment-list-container .comment-ui-container.active .comment-operation:hover {
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
background-color: #EFEFEF;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.sdoc-comment-menu {
|
|
230
|
-
padding: 0;
|
|
231
|
-
border-radius: 2px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.sdoc-popover-menu {
|
|
235
|
-
background: rgb(255, 255, 255);
|
|
236
|
-
width: 140px;
|
|
237
|
-
padding: 8px 0;
|
|
238
|
-
height: auto;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.sdoc-popover-menu__item {
|
|
242
|
-
padding: 4px 24px;
|
|
243
|
-
height: 28px;
|
|
244
|
-
vertical-align: middle;
|
|
245
|
-
font-size: 14px;
|
|
246
|
-
background-color: transparent;
|
|
247
|
-
cursor: default;
|
|
248
|
-
color: #202428;
|
|
249
|
-
background-color: #fff;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.sdoc-popover-menu__item:hover {
|
|
253
|
-
background-color: #20a0ff;
|
|
254
|
-
color: #fff;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.comment-editor-content {
|
|
258
|
-
border: 1px solid #ececec;
|
|
259
|
-
border-top-left-radius: 3px;
|
|
260
|
-
border-top-right-radius: 3px;
|
|
261
|
-
border-radius: 3px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.comment-editor-wrapper .comment-editor-content .article.comment-editor {
|
|
265
|
-
width: 100%;
|
|
266
|
-
padding: 8px;
|
|
267
|
-
padding-bottom: 0;
|
|
268
|
-
min-height: 60px;
|
|
269
|
-
max-height: 130px;
|
|
270
|
-
box-shadow: none;
|
|
271
|
-
overflow-y: auto;
|
|
272
|
-
overflow-x: hidden;
|
|
273
|
-
border: none;
|
|
274
|
-
background-color: transparent;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.comment-container-right .sdoc-editor-container {
|
|
278
|
-
width: 365px;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.sdoc-comment-container .comment-container-right .sdoc-editor-container {
|
|
282
|
-
width: auto;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.article.comment-editor :first-child {
|
|
286
|
-
margin-top: 0 !important;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.sdoc-comment-list-container .comment-editor-wrapper {
|
|
290
|
-
display: flex;
|
|
291
|
-
flex-direction: column;
|
|
292
|
-
justify-content: center;
|
|
293
|
-
cursor: text;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor:empty:before {
|
|
297
|
-
content: attr(placeholder);
|
|
298
|
-
opacity: .6;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor:focus-visible {
|
|
302
|
-
outline: none;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor:focus {
|
|
306
|
-
border: 1px solid rgba(0, 0, 0, .12);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor-user-info {
|
|
310
|
-
display: flex;
|
|
311
|
-
align-items: center;
|
|
312
|
-
margin-bottom: 10px;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor-user-info .comment-editor-user-img {
|
|
316
|
-
height: 30px;
|
|
317
|
-
width: 30px;
|
|
318
|
-
border-radius: 50%;
|
|
319
|
-
overflow: hidden;
|
|
320
|
-
margin-right: 8px;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-editor-user-info .comment-editor-user-name {
|
|
324
|
-
flex: 1;
|
|
325
|
-
overflow: hidden;
|
|
326
|
-
text-overflow: ellipsis;
|
|
327
|
-
white-space: nowrap;
|
|
328
|
-
user-select: none;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.sdoc-comment-list-container .comment-editor-wrapper .comment-operations {
|
|
332
|
-
display: flex;
|
|
333
|
-
justify-content: flex-end;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/* Side comment style */
|
|
337
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-header .comment-author__avatar {
|
|
338
|
-
display: flex;
|
|
339
|
-
align-items: center;
|
|
340
|
-
margin-top: 3px;
|
|
341
|
-
width: 24px;
|
|
342
|
-
height: 24px;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-header .comment-author__avatar img {
|
|
346
|
-
border-radius: 50%;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-footer .comment-author__avatar {
|
|
350
|
-
width: 16px;
|
|
351
|
-
height: 16px;
|
|
352
|
-
margin-top: -1px
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-footer .comment-author__avatar img {
|
|
356
|
-
border-radius: 50%;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-editor-wrapper.pb-3 {
|
|
360
|
-
padding-bottom: 0 !important;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-author {
|
|
364
|
-
align-items: flex-start;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-author__info {
|
|
368
|
-
padding-left: 8px;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.sdoc-article-container .sdoc-comment-list-container .comment-content div:last-child p {
|
|
372
|
-
margin-bottom: 0;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
.sdoc-comment-list-container-popover {
|
|
376
|
-
background-color: rgba(255, 255, 255);
|
|
377
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 4px 8px 3px rgba(0, 0, 0, .15);
|
|
378
|
-
border-radius: 5px;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.sdoc-comment-list-container-popover .comment-item-list {
|
|
382
|
-
max-height: 260px;
|
|
383
|
-
margin-bottom: 16px;
|
|
384
|
-
padding-bottom: 16px;
|
|
385
|
-
border-bottom: 1px solid #ececec;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper {
|
|
389
|
-
padding: 0px 16px 16px 16px;
|
|
390
|
-
width: 100%;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control[readonly] {
|
|
394
|
-
background-color: #fff;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control {
|
|
398
|
-
font-size: 14px;
|
|
399
|
-
font-weight: unset;
|
|
400
|
-
border: 1px solid #ececec;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper.active .form-control {
|
|
404
|
-
padding-top: 14px;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control:focus {
|
|
408
|
-
box-shadow: none;
|
|
409
|
-
border-color: #e1e2e5;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control::placeholder {
|
|
413
|
-
color: rgb(191, 191, 191);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/* Override seafile ui */
|
|
417
|
-
.sdoc-comment-list-container .btn {
|
|
418
|
-
height: 30px;
|
|
419
|
-
line-height: 15px;
|
|
420
|
-
font-size: 14px;
|
|
421
|
-
font-weight: 500;
|
|
422
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactI18next = require("react-i18next");
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
14
|
-
var _slugid = _interopRequireDefault(require("slugid"));
|
|
15
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
16
|
-
var _useSelectionPosition = require("../../hooks/use-selection-position");
|
|
17
|
-
var _helper = require("../helper");
|
|
18
|
-
var _useCommentContext = require("../hooks/comment-hooks/use-comment-context");
|
|
19
|
-
var _commentEditor = _interopRequireDefault(require("./comment-editor"));
|
|
20
|
-
var _commentItemWrapper = _interopRequireDefault(require("./comment-item-wrapper"));
|
|
21
|
-
require("./comment-list.css");
|
|
22
|
-
const CommentList = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
activeElementIds,
|
|
25
|
-
commentDetail = {},
|
|
26
|
-
onSetCommentDetail,
|
|
27
|
-
isContextComment = false,
|
|
28
|
-
isClickedContextComment = false,
|
|
29
|
-
setIsClickedContextComment,
|
|
30
|
-
onSelectElement,
|
|
31
|
-
closeComment,
|
|
32
|
-
commentedDom,
|
|
33
|
-
editor,
|
|
34
|
-
t
|
|
35
|
-
} = _ref;
|
|
36
|
-
const commentPopover = (0, _react.useRef)(null);
|
|
37
|
-
const commentDetailRef = (0, _react.useRef)(null);
|
|
38
|
-
const position = (0, _useSelectionPosition.useCommentListPosition)(activeElementIds, isContextComment, isClickedContextComment, commentedDom, commentDetail, closeComment);
|
|
39
|
-
const {
|
|
40
|
-
dispatch
|
|
41
|
-
} = (0, _useCommentContext.useCommentContext)();
|
|
42
|
-
const [showEditor, setShowEditor] = (0, _react.useState)(false);
|
|
43
|
-
const [inputContent, setInputContent] = (0, _react.useState)(null);
|
|
44
|
-
const [activeCommentKey, setActiveCommentKey] = (0, _react.useState)(null);
|
|
45
|
-
const [translateY, setTranslateY] = (0, _react.useState)();
|
|
46
|
-
const isEmptyComment = Object.keys(commentDetail).length ? false : true;
|
|
47
|
-
const isCollapseCommentEditor = !isEmptyComment && !showEditor;
|
|
48
|
-
const [isCommentPanelVisible, setIsCommentPanelVisible] = (0, _react.useState)(true);
|
|
49
|
-
|
|
50
|
-
// Multi context comments
|
|
51
|
-
const [commentInputs, setCommentInputs] = (0, _react.useState)({});
|
|
52
|
-
const contextCommentRef = (0, _react.useRef)({});
|
|
53
|
-
const insertComment = (0, _react.useCallback)(async function (elementId, comment) {
|
|
54
|
-
let isContextComment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
55
|
-
const res = await _context.default.insertComment(comment);
|
|
56
|
-
const {
|
|
57
|
-
comment: returnComment
|
|
58
|
-
} = res.data;
|
|
59
|
-
const newComment = {
|
|
60
|
-
...comment,
|
|
61
|
-
isContextComment: isContextComment,
|
|
62
|
-
id: returnComment.id,
|
|
63
|
-
user_name: returnComment.user_name,
|
|
64
|
-
avatar_url: returnComment.avatar_url,
|
|
65
|
-
replies: []
|
|
66
|
-
};
|
|
67
|
-
dispatch({
|
|
68
|
-
type: 'INSERT_COMMENT',
|
|
69
|
-
payload: {
|
|
70
|
-
element_id: elementId,
|
|
71
|
-
comment: newComment
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
onSetCommentDetail(newComment);
|
|
75
|
-
setShowEditor(true);
|
|
76
|
-
}, [dispatch, onSetCommentDetail]);
|
|
77
|
-
const addNewComment = (0, _react.useCallback)(content => {
|
|
78
|
-
const user = _context.default.getUserInfo();
|
|
79
|
-
const time = (0, _dayjs.default)().format('YYYY-MM-DD HH:mm:ss');
|
|
80
|
-
const textCommentId = _slugid.default.nice();
|
|
81
|
-
const comment = {
|
|
82
|
-
comment: content,
|
|
83
|
-
detail: {
|
|
84
|
-
text_comment_id: textCommentId,
|
|
85
|
-
element_id_list: activeElementIds
|
|
86
|
-
},
|
|
87
|
-
author: user.username,
|
|
88
|
-
updated_at: time
|
|
89
|
-
};
|
|
90
|
-
(0, _helper.updateElementsAttrs)(activeElementIds, editor, textCommentId);
|
|
91
|
-
insertComment(activeElementIds[0], comment, isContextComment);
|
|
92
|
-
}, [isContextComment, activeElementIds, editor, insertComment]);
|
|
93
|
-
const replyComment = (0, _react.useCallback)(content => {
|
|
94
|
-
if (commentDetailRef !== null && commentDetailRef !== void 0 && commentDetailRef.current) {
|
|
95
|
-
commentDetailRef.current.insertContent(content);
|
|
96
|
-
}
|
|
97
|
-
}, []);
|
|
98
|
-
const hiddenComment = (0, _react.useCallback)(() => {
|
|
99
|
-
setShowEditor(false);
|
|
100
|
-
}, []);
|
|
101
|
-
(0, _react.useEffect)(() => {
|
|
102
|
-
queueMicrotask(() => {
|
|
103
|
-
if (commentPopover !== null && commentPopover !== void 0 && commentPopover.current && Array.isArray(activeElementIds)) {
|
|
104
|
-
const {
|
|
105
|
-
bottom
|
|
106
|
-
} = commentPopover.current.getBoundingClientRect();
|
|
107
|
-
const viewportHeight = window.innerHeight;
|
|
108
|
-
if (bottom > viewportHeight) {
|
|
109
|
-
const overflowY = bottom - viewportHeight;
|
|
110
|
-
setTranslateY(-(overflowY + 16));
|
|
111
|
-
} else {
|
|
112
|
-
setTranslateY(0);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}, [activeElementIds]);
|
|
117
|
-
const handleInputChange = (id, value) => {
|
|
118
|
-
setCommentInputs(prev => ({
|
|
119
|
-
...prev,
|
|
120
|
-
[id]: value
|
|
121
|
-
}));
|
|
122
|
-
};
|
|
123
|
-
const handleReplySubmit = (content, id) => {
|
|
124
|
-
var _contextCommentRef$cu;
|
|
125
|
-
if (contextCommentRef !== null && contextCommentRef !== void 0 && (_contextCommentRef$cu = contextCommentRef.current) !== null && _contextCommentRef$cu !== void 0 && _contextCommentRef$cu[id]) {
|
|
126
|
-
contextCommentRef.current[id].insertContent(content);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
ref: commentPopover,
|
|
131
|
-
id: "sdoc-comment-list-container",
|
|
132
|
-
className: (0, _classnames.default)('sdoc-comment-list-container sdoc-comment-list-container-popover', 'sdoc-context-comment-list-container'),
|
|
133
|
-
style: {
|
|
134
|
-
top: position.y,
|
|
135
|
-
...(isContextComment || isClickedContextComment ? {
|
|
136
|
-
right: position.right
|
|
137
|
-
} : {}),
|
|
138
|
-
width: '300px',
|
|
139
|
-
transform: `translateY(${translateY}px)`
|
|
140
|
-
}
|
|
141
|
-
}, Object.values(commentDetail).length !== 0 && isCommentPanelVisible && Object.values(commentDetail).map((item, index) => {
|
|
142
|
-
const isActiveEditor = activeCommentKey === index;
|
|
143
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
-
className: "sdoc-context-comment-popover-wrapper",
|
|
145
|
-
key: item.id || index
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement(_commentItemWrapper.default, {
|
|
147
|
-
ref: el => {
|
|
148
|
-
if (el) contextCommentRef.current[item.id] = el;else delete contextCommentRef.current[item.id];
|
|
149
|
-
},
|
|
150
|
-
editor: editor,
|
|
151
|
-
comment: item,
|
|
152
|
-
commentsDetail: commentDetail,
|
|
153
|
-
setIsClickedContextComment: setIsClickedContextComment,
|
|
154
|
-
setIsCommentPanelVisible: setIsCommentPanelVisible,
|
|
155
|
-
onSelectElement: onSelectElement,
|
|
156
|
-
isActive: true,
|
|
157
|
-
isEmptyComment: isEmptyComment,
|
|
158
|
-
isCollapseCommentEditor: isCollapseCommentEditor,
|
|
159
|
-
isClickedContextComment: isClickedContextComment,
|
|
160
|
-
closeComment: closeComment
|
|
161
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
-
className: "non-global-comment-input-wrapper",
|
|
163
|
-
style: {
|
|
164
|
-
paddingTop: isEmptyComment ? '16px' : ''
|
|
165
|
-
}
|
|
166
|
-
}, isEmptyComment && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
167
|
-
type: "comment",
|
|
168
|
-
insertContent: addNewComment,
|
|
169
|
-
hiddenComment: hiddenComment,
|
|
170
|
-
isContextComment: isContextComment,
|
|
171
|
-
closeComment: closeComment
|
|
172
|
-
}), !isEmptyComment && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isActiveEditor && /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
173
|
-
value: inputContent !== null && inputContent !== void 0 && inputContent.trim() ? '.....' : '',
|
|
174
|
-
readOnly: true,
|
|
175
|
-
placeholder: t('Enter_reply'),
|
|
176
|
-
onFocus: () => {
|
|
177
|
-
setActiveCommentKey(index);
|
|
178
|
-
}
|
|
179
|
-
}), isActiveEditor && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
180
|
-
type: "reply",
|
|
181
|
-
placeholder: 'Enter_reply_shift_Enter_for_new_line_Enter_to_send',
|
|
182
|
-
commentContent: commentInputs[item.id] || '',
|
|
183
|
-
insertContent: value => handleReplySubmit(value, item.id),
|
|
184
|
-
onContentChange: content => handleInputChange(item.id, content),
|
|
185
|
-
hiddenComment: hiddenComment
|
|
186
|
-
}))));
|
|
187
|
-
}), Object.values(commentDetail).length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
-
className: "non-global-comment-input-wrapper",
|
|
189
|
-
style: {
|
|
190
|
-
paddingTop: isEmptyComment ? '16px' : ''
|
|
191
|
-
}
|
|
192
|
-
}, isEmptyComment && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
193
|
-
type: "comment",
|
|
194
|
-
insertContent: addNewComment,
|
|
195
|
-
hiddenComment: hiddenComment,
|
|
196
|
-
isContextComment: isContextComment,
|
|
197
|
-
closeComment: closeComment
|
|
198
|
-
}), !isEmptyComment && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !showEditor && /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
199
|
-
value: inputContent !== null && inputContent !== void 0 && inputContent.trim() ? '.....' : '',
|
|
200
|
-
readOnly: true,
|
|
201
|
-
placeholder: t('Enter_reply'),
|
|
202
|
-
onFocus: () => {
|
|
203
|
-
setShowEditor(true);
|
|
204
|
-
}
|
|
205
|
-
}), showEditor && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
206
|
-
type: "reply",
|
|
207
|
-
placeholder: 'Enter_reply_shift_Enter_for_new_line_Enter_to_send',
|
|
208
|
-
commentContent: inputContent,
|
|
209
|
-
insertContent: replyComment,
|
|
210
|
-
onContentChange: content => {
|
|
211
|
-
setInputContent(content);
|
|
212
|
-
},
|
|
213
|
-
hiddenComment: hiddenComment
|
|
214
|
-
}))));
|
|
215
|
-
};
|
|
216
|
-
var _default = exports.default = (0, _reactI18next.withTranslation)('sdoc-editor')(CommentList);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.sdoc-notification-count {
|
|
2
|
-
position: absolute;
|
|
3
|
-
color: #fff;
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
top: -7px;
|
|
6
|
-
right: -10px;
|
|
7
|
-
padding: 2px;
|
|
8
|
-
background: #fc6440;
|
|
9
|
-
border-radius: 50%;
|
|
10
|
-
min-width: 20px;
|
|
11
|
-
min-height: 20px;
|
|
12
|
-
transform: scale(.7);
|
|
13
|
-
text-align: center;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.sdoc-plugin-operation-btn-container .sdoc-unread-message-tip {
|
|
17
|
-
position: absolute;
|
|
18
|
-
left: 12px;
|
|
19
|
-
top: 4px;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
height: 6px;
|
|
22
|
-
width: 6px;
|
|
23
|
-
border-radius: 50%;
|
|
24
|
-
background-color: #fc6440;
|
|
25
|
-
margin-left: 6px;
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = CommentsOperation;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _constants = require("../../../constants");
|
|
11
|
-
var _eventBus = _interopRequireDefault(require("../../../utils/event-bus"));
|
|
12
|
-
require("./index.css");
|
|
13
|
-
function CommentsOperation() {
|
|
14
|
-
const [unseenNotificationsCount, setUnseenNotificationsCount] = (0, _react.useState)(0);
|
|
15
|
-
const updateUnseenNotificationsCount = (0, _react.useCallback)(count => {
|
|
16
|
-
setUnseenNotificationsCount(count);
|
|
17
|
-
}, []);
|
|
18
|
-
(0, _react.useEffect)(() => {
|
|
19
|
-
const eventBus = _eventBus.default.getInstance();
|
|
20
|
-
const unsubscribeUnseenNotificationsCount = eventBus.subscribe(_constants.INTERNAL_EVENT.UNSEEN_NOTIFICATIONS_COUNT, updateUnseenNotificationsCount);
|
|
21
|
-
return () => {
|
|
22
|
-
unsubscribeUnseenNotificationsCount();
|
|
23
|
-
};
|
|
24
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
|
-
}, []);
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
27
|
-
className: "sdocfont sdoc-comments"
|
|
28
|
-
}), unseenNotificationsCount > 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
29
|
-
className: "sdoc-unread-message-tip"
|
|
30
|
-
}));
|
|
31
|
-
}
|