@ones-editor/editor 2.8.23 → 2.8.25-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +3 -1
- package/@ones-editor/comments/src/comments-helper/get-comment-from-selection.d.ts +3 -0
- package/@ones-editor/comments/src/comments-helper/get-comments-from-doc.d.ts +5 -1
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +8 -1
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +5 -2
- package/@ones-editor/comments/src/comments-list/handler.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +1 -0
- package/@ones-editor/comments/src/comments-render/get-block-comments.d.ts +2 -0
- package/@ones-editor/comments/src/comments-render/index.d.ts +8 -0
- package/@ones-editor/comments/src/constant/index.d.ts +2 -1
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/comments/src/resolved-comments/index.d.ts +4 -0
- package/@ones-editor/comments/src/resolved-comments/resolved-comment-editor.d.ts +14 -0
- package/@ones-editor/comments/src/resolved-comments/resolved-comment-list.d.ts +4 -0
- package/@ones-editor/comments/src/types.d.ts +5 -1
- package/@ones-editor/core/src/core/block-renderers/block-renderers.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +8 -0
- package/@ones-editor/core/src/core/types.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/config/drawio.d.ts +1 -1
- package/@ones-editor/drawio-embed/types/index.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +2 -1
- package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +2 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +3 -1
- package/@ones-editor/sharedb-doc/src/types.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/history-handler.d.ts +1 -0
- package/dist/comments/local-doc-comments-provider.d.ts +2 -1
- package/dist/comments/sharedb-doc-comments-provider.d.ts +3 -1
- package/dist/index.js +691 -136
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4319,6 +4319,21 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4319
4319
|
will-change: width;
|
|
4320
4320
|
font-family: var(--editor-font-family);
|
|
4321
4321
|
}
|
|
4322
|
+
.editor-web-comment-root[list-type=resolved] .comment-groups-container {
|
|
4323
|
+
display: flex;
|
|
4324
|
+
flex-direction: column;
|
|
4325
|
+
gap: 20px;
|
|
4326
|
+
padding-left: 8px;
|
|
4327
|
+
padding-top: 60px;
|
|
4328
|
+
}
|
|
4329
|
+
.editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-group-item-root {
|
|
4330
|
+
position: inherit;
|
|
4331
|
+
transform: none;
|
|
4332
|
+
}
|
|
4333
|
+
.editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-group-item-root::before {
|
|
4334
|
+
left: 8px;
|
|
4335
|
+
right: 8px;
|
|
4336
|
+
}
|
|
4322
4337
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root {
|
|
4323
4338
|
position: absolute;
|
|
4324
4339
|
left: 50%;
|
|
@@ -4332,8 +4347,17 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4332
4347
|
box-shadow: var(--editor-box-shadow);
|
|
4333
4348
|
padding-bottom: 10px;
|
|
4334
4349
|
}
|
|
4350
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .item-head-switch .editor-text-button.resolved {
|
|
4351
|
+
display: none;
|
|
4352
|
+
}
|
|
4353
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .item-head-tools {
|
|
4354
|
+
display: none;
|
|
4355
|
+
}
|
|
4356
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .comment-quick-reply {
|
|
4357
|
+
display: none;
|
|
4358
|
+
}
|
|
4335
4359
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root:not(.no-animation) {
|
|
4336
|
-
transition: top 0.2s ease-in, opacity 0.
|
|
4360
|
+
transition: top 0.2s ease-in, opacity 0.2s ease-in;
|
|
4337
4361
|
}
|
|
4338
4362
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root::before {
|
|
4339
4363
|
content: "";
|
|
@@ -4391,6 +4415,12 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4391
4415
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=switch-up] {
|
|
4392
4416
|
margin-right: 16px;
|
|
4393
4417
|
}
|
|
4418
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=switch-down] {
|
|
4419
|
+
margin-right: 16px;
|
|
4420
|
+
}
|
|
4421
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=resolve].resolved {
|
|
4422
|
+
color: green;
|
|
4423
|
+
}
|
|
4394
4424
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button:not(.disabled):hover {
|
|
4395
4425
|
color: var(--text-button-color-hover);
|
|
4396
4426
|
}
|
|
@@ -4398,6 +4428,32 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4398
4428
|
color: rgba(96, 96, 96, 0.5019607843);
|
|
4399
4429
|
cursor: not-allowed;
|
|
4400
4430
|
}
|
|
4431
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer {
|
|
4432
|
+
font-size: 12px;
|
|
4433
|
+
line-height: 20px;
|
|
4434
|
+
color: #87888A;
|
|
4435
|
+
margin-top: 10px;
|
|
4436
|
+
}
|
|
4437
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions {
|
|
4438
|
+
display: flex;
|
|
4439
|
+
align-items: center;
|
|
4440
|
+
}
|
|
4441
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-date {
|
|
4442
|
+
flex: 1;
|
|
4443
|
+
}
|
|
4444
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .removed-tips {
|
|
4445
|
+
color: #87888A;
|
|
4446
|
+
}
|
|
4447
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen {
|
|
4448
|
+
background: none;
|
|
4449
|
+
border: none;
|
|
4450
|
+
cursor: pointer;
|
|
4451
|
+
color: #575859;
|
|
4452
|
+
font-size: 12px;
|
|
4453
|
+
}
|
|
4454
|
+
.editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen:hover {
|
|
4455
|
+
color: #0064FF;
|
|
4456
|
+
}
|
|
4401
4457
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root.active::before {
|
|
4402
4458
|
background-color: #f59300;
|
|
4403
4459
|
}
|
|
@@ -4407,6 +4463,14 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4407
4463
|
.editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply .quick-reply-button.invisible {
|
|
4408
4464
|
display: none;
|
|
4409
4465
|
}
|
|
4466
|
+
.editor-web-comment-root .comment-switcher-container {
|
|
4467
|
+
position: absolute;
|
|
4468
|
+
z-index: 1;
|
|
4469
|
+
top: 0;
|
|
4470
|
+
left: 0;
|
|
4471
|
+
right: 0;
|
|
4472
|
+
font-size: 14px;
|
|
4473
|
+
}
|
|
4410
4474
|
.editor-mobile-comments-root {
|
|
4411
4475
|
position: fixed;
|
|
4412
4476
|
left: 0;
|
|
@@ -4508,6 +4572,82 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
|
|
|
4508
4572
|
}
|
|
4509
4573
|
:is(.editor-web-comment-root, .editor-mobile-comments-root, .editor-mini-comment-root).hidden {
|
|
4510
4574
|
display: none;
|
|
4575
|
+
}.resolved-comment-list .resolved-comment-group-item-root {
|
|
4576
|
+
padding: 10px 20px;
|
|
4577
|
+
border-bottom: 1px solid #f0f0f0;
|
|
4578
|
+
margin-right: 10px;
|
|
4579
|
+
}
|
|
4580
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-group-head {
|
|
4581
|
+
margin-bottom: 5px;
|
|
4582
|
+
}
|
|
4583
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-group-head span {
|
|
4584
|
+
padding: 0 5px;
|
|
4585
|
+
display: inline-block;
|
|
4586
|
+
line-height: 2;
|
|
4587
|
+
background-color: #FFF0D9;
|
|
4588
|
+
}
|
|
4589
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container,
|
|
4590
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container {
|
|
4591
|
+
padding-left: 10px;
|
|
4592
|
+
}
|
|
4593
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root,
|
|
4594
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root {
|
|
4595
|
+
position: relative;
|
|
4596
|
+
}
|
|
4597
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:not(.no-children)::before,
|
|
4598
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root:not(.no-children)::before {
|
|
4599
|
+
content: " ";
|
|
4600
|
+
display: block;
|
|
4601
|
+
position: absolute;
|
|
4602
|
+
left: 10px;
|
|
4603
|
+
width: 1px;
|
|
4604
|
+
background-color: #DFE1E5;
|
|
4605
|
+
overflow: hidden;
|
|
4606
|
+
opacity: 0.8;
|
|
4607
|
+
top: 21px;
|
|
4608
|
+
bottom: -12px;
|
|
4609
|
+
transform: scaleX(0.5);
|
|
4610
|
+
}
|
|
4611
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head,
|
|
4612
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head {
|
|
4613
|
+
padding: 0;
|
|
4614
|
+
position: relative;
|
|
4615
|
+
display: flex;
|
|
4616
|
+
align-items: center;
|
|
4617
|
+
}
|
|
4618
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-avatar,
|
|
4619
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-avatar {
|
|
4620
|
+
margin-right: 5px;
|
|
4621
|
+
width: var(--editor-comment-avatar-width, 22px);
|
|
4622
|
+
height: var(--editor-comment-avatar-width, 22px);
|
|
4623
|
+
border-radius: 100%;
|
|
4624
|
+
}
|
|
4625
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-username,
|
|
4626
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-username {
|
|
4627
|
+
font-size: var(--editor-comment-username-font-size, 12px);
|
|
4628
|
+
color: #2d2d2e;
|
|
4629
|
+
overflow: hidden;
|
|
4630
|
+
text-overflow: ellipsis;
|
|
4631
|
+
white-space: nowrap;
|
|
4632
|
+
}
|
|
4633
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-modified,
|
|
4634
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-modified {
|
|
4635
|
+
margin-left: 10px;
|
|
4636
|
+
font-size: 12px;
|
|
4637
|
+
color: #87888a;
|
|
4638
|
+
flex-grow: 1;
|
|
4639
|
+
white-space: nowrap;
|
|
4640
|
+
}
|
|
4641
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-editor,
|
|
4642
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-editor {
|
|
4643
|
+
border: none;
|
|
4644
|
+
padding-top: 0;
|
|
4645
|
+
margin-top: 0;
|
|
4646
|
+
padding-left: 10px;
|
|
4647
|
+
margin-left: 0;
|
|
4648
|
+
}
|
|
4649
|
+
.resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:last-child::before {
|
|
4650
|
+
display: none;
|
|
4511
4651
|
}div[data-type=editor-block].table-block {
|
|
4512
4652
|
--table-bar-width: 6px;
|
|
4513
4653
|
--table-bar-left: -6px;
|
|
@@ -4842,17 +4982,17 @@ div[data-type=editor-block].table-block.child-focused div[data-type=table-conten
|
|
|
4842
4982
|
border-color: #b9bfc8;
|
|
4843
4983
|
}
|
|
4844
4984
|
div[data-type=editor-block].table-block.full-selected > div[data-type=block-content] > .scroll-container-root > .scroll-container > .scroll-area > div[data-type=table-content] > table {
|
|
4845
|
-
background-color: var(--background-selection);
|
|
4985
|
+
background-color: var(--background-selection) !important;
|
|
4846
4986
|
}
|
|
4847
4987
|
div[data-type=editor-block].table-block.full-selected > div[data-type=block-content] > .scroll-container-root > .scroll-container > .scroll-area > div[data-type=table-content] > table td,
|
|
4848
4988
|
div[data-type=editor-block].table-block.full-selected > div[data-type=block-content] > .scroll-container-root > .scroll-container > .scroll-area > div[data-type=table-content] > table th,
|
|
4849
4989
|
div[data-type=editor-block].table-block.full-selected > div[data-type=block-content] > .scroll-container-root > .scroll-container > .scroll-area > div[data-type=table-content] > table tr {
|
|
4850
|
-
background-color: transparent;
|
|
4990
|
+
background-color: transparent !important;
|
|
4851
4991
|
}
|
|
4852
4992
|
div[data-type=editor-block].table-block div[data-type=table-content] > table tbody tr td.selected,
|
|
4853
4993
|
div[data-type=editor-block].table-block div[data-type=table-content] > table.row-title tbody tr td.selected,
|
|
4854
4994
|
div[data-type=editor-block].table-block div[data-type=table-content] > table.col-title tbody tr td.selected {
|
|
4855
|
-
background-color: var(--background-selection);
|
|
4995
|
+
background-color: var(--background-selection) !important;
|
|
4856
4996
|
}
|
|
4857
4997
|
div[data-type=editor-block].table-block div[data-type=table-content] > table td div[data-type=editor-block].table-block div[data-type=table-content] > table {
|
|
4858
4998
|
max-width: 100%;
|
|
@@ -9207,22 +9347,22 @@ var __publicField = (obj, key, value) => {
|
|
|
9207
9347
|
function toFloat(value) {
|
|
9208
9348
|
return parseFloat(value) || 0;
|
|
9209
9349
|
}
|
|
9210
|
-
function getBordersSize(
|
|
9350
|
+
function getBordersSize(styles2) {
|
|
9211
9351
|
var positions = [];
|
|
9212
9352
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
9213
9353
|
positions[_i - 1] = arguments[_i];
|
|
9214
9354
|
}
|
|
9215
9355
|
return positions.reduce(function(size, position) {
|
|
9216
|
-
var value =
|
|
9356
|
+
var value = styles2["border-" + position + "-width"];
|
|
9217
9357
|
return size + toFloat(value);
|
|
9218
9358
|
}, 0);
|
|
9219
9359
|
}
|
|
9220
|
-
function getPaddings(
|
|
9360
|
+
function getPaddings(styles2) {
|
|
9221
9361
|
var positions = ["top", "right", "bottom", "left"];
|
|
9222
9362
|
var paddings = {};
|
|
9223
9363
|
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
9224
9364
|
var position = positions_1[_i];
|
|
9225
|
-
var value =
|
|
9365
|
+
var value = styles2["padding-" + position];
|
|
9226
9366
|
paddings[position] = toFloat(value);
|
|
9227
9367
|
}
|
|
9228
9368
|
return paddings;
|
|
@@ -9236,17 +9376,17 @@ var __publicField = (obj, key, value) => {
|
|
|
9236
9376
|
if (!clientWidth && !clientHeight) {
|
|
9237
9377
|
return emptyRect;
|
|
9238
9378
|
}
|
|
9239
|
-
var
|
|
9240
|
-
var paddings = getPaddings(
|
|
9379
|
+
var styles2 = getWindowOf(target).getComputedStyle(target);
|
|
9380
|
+
var paddings = getPaddings(styles2);
|
|
9241
9381
|
var horizPad = paddings.left + paddings.right;
|
|
9242
9382
|
var vertPad = paddings.top + paddings.bottom;
|
|
9243
|
-
var width = toFloat(
|
|
9244
|
-
if (
|
|
9383
|
+
var width = toFloat(styles2.width), height = toFloat(styles2.height);
|
|
9384
|
+
if (styles2.boxSizing === "border-box") {
|
|
9245
9385
|
if (Math.round(width + horizPad) !== clientWidth) {
|
|
9246
|
-
width -= getBordersSize(
|
|
9386
|
+
width -= getBordersSize(styles2, "left", "right") + horizPad;
|
|
9247
9387
|
}
|
|
9248
9388
|
if (Math.round(height + vertPad) !== clientHeight) {
|
|
9249
|
-
height -= getBordersSize(
|
|
9389
|
+
height -= getBordersSize(styles2, "top", "bottom") + vertPad;
|
|
9250
9390
|
}
|
|
9251
9391
|
}
|
|
9252
9392
|
if (!isDocumentElement(target)) {
|
|
@@ -9901,8 +10041,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9901
10041
|
el.setAttribute(key, value);
|
|
9902
10042
|
});
|
|
9903
10043
|
}
|
|
9904
|
-
function setStyles(el,
|
|
9905
|
-
Object.entries(
|
|
10044
|
+
function setStyles(el, styles2) {
|
|
10045
|
+
Object.entries(styles2).forEach(([key, value]) => {
|
|
9906
10046
|
el.style.setProperty(key, value);
|
|
9907
10047
|
});
|
|
9908
10048
|
}
|
|
@@ -12322,12 +12462,12 @@ var __publicField = (obj, key, value) => {
|
|
|
12322
12462
|
return blockClass.getBlockStyles(editor, block);
|
|
12323
12463
|
}
|
|
12324
12464
|
const data2 = editor.getBlockData(block);
|
|
12325
|
-
const
|
|
12326
|
-
Object.entries(
|
|
12465
|
+
const styles2 = Object.fromEntries(Object.entries(data2).filter(([key]) => key.startsWith("style-")));
|
|
12466
|
+
Object.entries(styles2).forEach(([, value]) => {
|
|
12327
12467
|
const type = typeof value;
|
|
12328
12468
|
assert(logger$4B, type === "string" || type === "number" || type === "boolean", "invalid style value");
|
|
12329
12469
|
});
|
|
12330
|
-
return
|
|
12470
|
+
return styles2;
|
|
12331
12471
|
}
|
|
12332
12472
|
function getContainerWidth(container, options) {
|
|
12333
12473
|
const ret = container.getBoundingClientRect().width;
|
|
@@ -24916,7 +25056,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24916
25056
|
if (attributes) {
|
|
24917
25057
|
let string = op.insert;
|
|
24918
25058
|
const tags = [];
|
|
24919
|
-
let
|
|
25059
|
+
let styles2 = "";
|
|
24920
25060
|
if (attributes["style-bold"]) {
|
|
24921
25061
|
tags.push("strong");
|
|
24922
25062
|
}
|
|
@@ -24934,25 +25074,25 @@ var __publicField = (obj, key, value) => {
|
|
|
24934
25074
|
}
|
|
24935
25075
|
const fontBgColor = Object.keys(attributes).find((k) => k.startsWith("style-bg-color-"));
|
|
24936
25076
|
if (fontBgColor) {
|
|
24937
|
-
|
|
25077
|
+
styles2 += `background-color: ${styleBackgroundColorToHighlight$1(fontBgColor)};`;
|
|
24938
25078
|
}
|
|
24939
25079
|
const fontColor = Object.keys(attributes).find((k) => k.startsWith("style-color-"));
|
|
24940
25080
|
if (fontColor) {
|
|
24941
|
-
|
|
25081
|
+
styles2 += `color: ${styleColorToColor$1(fontColor)};`;
|
|
24942
25082
|
}
|
|
24943
25083
|
if (attributes.link) {
|
|
24944
25084
|
string = `<a href="${attributes.link}">${string}</a>`;
|
|
24945
25085
|
}
|
|
24946
25086
|
let prefix = tags.map((s) => `<${s}>`).join("");
|
|
24947
25087
|
let suffix = tags.reverse().map((s) => `</${s}>`).join("");
|
|
24948
|
-
if (
|
|
25088
|
+
if (styles2) {
|
|
24949
25089
|
if (attributes.link) {
|
|
24950
|
-
string = `<a href="${attributes.link}" style="${
|
|
25090
|
+
string = `<a href="${attributes.link}" style="${styles2}">${op.insert}</a>`;
|
|
24951
25091
|
} else {
|
|
24952
25092
|
if (prefix) {
|
|
24953
|
-
prefix = prefix.replace(">", ` style="${
|
|
25093
|
+
prefix = prefix.replace(">", ` style="${styles2}">`);
|
|
24954
25094
|
} else {
|
|
24955
|
-
prefix = `<span style="${
|
|
25095
|
+
prefix = `<span style="${styles2}">`;
|
|
24956
25096
|
suffix = "</span>";
|
|
24957
25097
|
}
|
|
24958
25098
|
}
|
|
@@ -25395,6 +25535,9 @@ var __publicField = (obj, key, value) => {
|
|
|
25395
25535
|
__publicField(this, "renders", []);
|
|
25396
25536
|
this.editor = editor;
|
|
25397
25537
|
}
|
|
25538
|
+
getRenderers() {
|
|
25539
|
+
return this.renders;
|
|
25540
|
+
}
|
|
25398
25541
|
registerRender(render) {
|
|
25399
25542
|
this.renders.push(render);
|
|
25400
25543
|
}
|
|
@@ -25632,8 +25775,8 @@ var __publicField = (obj, key, value) => {
|
|
|
25632
25775
|
renderBlock(editor, path, blockData) {
|
|
25633
25776
|
var _a, _b;
|
|
25634
25777
|
const attributes = {};
|
|
25635
|
-
const
|
|
25636
|
-
|
|
25778
|
+
const styles2 = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
|
|
25779
|
+
styles2.forEach(([key, value]) => {
|
|
25637
25780
|
attributes[`data-${key}`] = `${value}`;
|
|
25638
25781
|
});
|
|
25639
25782
|
const classes = [];
|
|
@@ -38661,6 +38804,12 @@ ${codeText}
|
|
|
38661
38804
|
commentId
|
|
38662
38805
|
});
|
|
38663
38806
|
}
|
|
38807
|
+
onUpdateCommentResolver(commentId) {
|
|
38808
|
+
this.pushActions({
|
|
38809
|
+
type: "updateCommentResolved",
|
|
38810
|
+
commentId
|
|
38811
|
+
});
|
|
38812
|
+
}
|
|
38664
38813
|
end() {
|
|
38665
38814
|
const actions2 = this.actions;
|
|
38666
38815
|
const deletedBlocks = /* @__PURE__ */ new Set();
|
|
@@ -38735,6 +38884,9 @@ ${codeText}
|
|
|
38735
38884
|
} else if (action.type === "updateComment") {
|
|
38736
38885
|
const a = action;
|
|
38737
38886
|
this.outerHandler.onUpdateComment(a.commentId, this.local);
|
|
38887
|
+
} else if (action.type === "updateCommentResolved") {
|
|
38888
|
+
const a = action;
|
|
38889
|
+
this.outerHandler.onUpdateCommentResolver(a.commentId, this.local);
|
|
38738
38890
|
}
|
|
38739
38891
|
});
|
|
38740
38892
|
Array.from(updatingBlockDataDeltaMap.entries()).forEach(([blockId, objectData]) => {
|
|
@@ -38912,7 +39064,14 @@ ${codeText}
|
|
|
38912
39064
|
assert(logger$2V, commentId, `invalid comment op, no commentId: ${JSON.stringify(ops)}`);
|
|
38913
39065
|
assert(logger$2V, actions2, `invalid comment op, no actions: ${JSON.stringify(ops)}`);
|
|
38914
39066
|
if (typeof actions2 === "string") {
|
|
38915
|
-
|
|
39067
|
+
const data2 = ops[3];
|
|
39068
|
+
if (actions2 === "resolver" && typeof data2 === "object") {
|
|
39069
|
+
if (parseType === "upsert") {
|
|
39070
|
+
handler.onUpdateCommentResolver(commentId);
|
|
39071
|
+
}
|
|
39072
|
+
} else {
|
|
39073
|
+
logger$2V.error(`unknown comment op, ${JSON.stringify(ops)}`);
|
|
39074
|
+
}
|
|
38916
39075
|
} else {
|
|
38917
39076
|
if (actions2.i && actions2.r) {
|
|
38918
39077
|
if (parseType === "upsert") {
|
|
@@ -39022,7 +39181,8 @@ ${codeText}
|
|
|
39022
39181
|
avatarUrl,
|
|
39023
39182
|
abstract,
|
|
39024
39183
|
created,
|
|
39025
|
-
modified
|
|
39184
|
+
modified,
|
|
39185
|
+
resolver: resolved
|
|
39026
39186
|
} = shareDBComment;
|
|
39027
39187
|
return {
|
|
39028
39188
|
id,
|
|
@@ -39032,7 +39192,8 @@ ${codeText}
|
|
|
39032
39192
|
avatarUrl,
|
|
39033
39193
|
abstract,
|
|
39034
39194
|
created,
|
|
39035
|
-
modified
|
|
39195
|
+
modified,
|
|
39196
|
+
resolver: resolved
|
|
39036
39197
|
};
|
|
39037
39198
|
}
|
|
39038
39199
|
function commentToShareDbComment(comment, doc2) {
|
|
@@ -39504,6 +39665,21 @@ ${codeText}
|
|
|
39504
39665
|
const op = ["comments", comment.id, { r: true, i: shareDBComment }];
|
|
39505
39666
|
return this.submitOp(op);
|
|
39506
39667
|
}
|
|
39668
|
+
localUpdateCommentResolver(commentId, resolver) {
|
|
39669
|
+
const oldComment = this.getComment(commentId);
|
|
39670
|
+
const oldResolved = oldComment.resolver;
|
|
39671
|
+
const op = ["comments", commentId, "resolver", {}];
|
|
39672
|
+
if (!oldResolved && !resolver) {
|
|
39673
|
+
return Promise.resolve(true);
|
|
39674
|
+
}
|
|
39675
|
+
if (oldResolved !== void 0) {
|
|
39676
|
+
op[3] = { r: true };
|
|
39677
|
+
}
|
|
39678
|
+
if (resolver) {
|
|
39679
|
+
op[3].i = resolver;
|
|
39680
|
+
}
|
|
39681
|
+
return this.submitOp(op);
|
|
39682
|
+
}
|
|
39507
39683
|
destroy() {
|
|
39508
39684
|
var _a;
|
|
39509
39685
|
this.destroyed = true;
|
|
@@ -39580,6 +39756,13 @@ ${codeText}
|
|
|
39580
39756
|
return (_a = cb.onUpdateComment) == null ? void 0 : _a.call(cb, commentId, local);
|
|
39581
39757
|
});
|
|
39582
39758
|
}
|
|
39759
|
+
onUpdateCommentResolver(commentId, local) {
|
|
39760
|
+
assert(logger$2S, this.callbacks.length > 0, "no callbacks");
|
|
39761
|
+
this.callbacks.forEach((cb) => {
|
|
39762
|
+
var _a;
|
|
39763
|
+
return (_a = cb.onUpdateCommentResolver) == null ? void 0 : _a.call(cb, commentId, local);
|
|
39764
|
+
});
|
|
39765
|
+
}
|
|
39583
39766
|
onCustomMessage(msg) {
|
|
39584
39767
|
const message = msg;
|
|
39585
39768
|
if ((message == null ? void 0 : message.type) === "custom" && (message == null ? void 0 : message.clientId) !== this.client.clientId) {
|
|
@@ -50514,7 +50697,7 @@ ${codeText}
|
|
|
50514
50697
|
});
|
|
50515
50698
|
return !!ret;
|
|
50516
50699
|
}
|
|
50517
|
-
function addBlockClasses(from, to,
|
|
50700
|
+
function addBlockClasses(from, to, styles2) {
|
|
50518
50701
|
const container = getParentContainer(from);
|
|
50519
50702
|
if (to) {
|
|
50520
50703
|
const container2 = getParentContainer(to);
|
|
@@ -50525,18 +50708,18 @@ ${codeText}
|
|
|
50525
50708
|
const toIndex = getBlockIndex(to);
|
|
50526
50709
|
assert(logger$24, fromIndex <= toIndex, "invalid block index");
|
|
50527
50710
|
}
|
|
50528
|
-
addClass(from, ...
|
|
50711
|
+
addClass(from, ...styles2);
|
|
50529
50712
|
if (!to || to === from) {
|
|
50530
50713
|
return;
|
|
50531
50714
|
}
|
|
50532
50715
|
let next2 = getNextBlock(from);
|
|
50533
50716
|
while (next2 !== to) {
|
|
50534
50717
|
assert(logger$24, next2, "no next button");
|
|
50535
|
-
addClass(next2, ...
|
|
50718
|
+
addClass(next2, ...styles2);
|
|
50536
50719
|
next2 = getNextBlock(next2);
|
|
50537
50720
|
}
|
|
50538
50721
|
if (next2) {
|
|
50539
|
-
addClass(next2, ...
|
|
50722
|
+
addClass(next2, ...styles2);
|
|
50540
50723
|
}
|
|
50541
50724
|
}
|
|
50542
50725
|
async function requestMindmapFullscreen(editor, block, mindmapTools) {
|
|
@@ -51524,7 +51707,7 @@ ${codeText}
|
|
|
51524
51707
|
html = `<input type="checkbox" disabled="disabled" /> ${html}`;
|
|
51525
51708
|
}
|
|
51526
51709
|
let listTag = "ul";
|
|
51527
|
-
let
|
|
51710
|
+
let styles2 = "";
|
|
51528
51711
|
if (list2.ordered) {
|
|
51529
51712
|
html = `<li value="${list2.start}">${html}</li>`;
|
|
51530
51713
|
listTag = "ol";
|
|
@@ -51532,18 +51715,18 @@ ${codeText}
|
|
|
51532
51715
|
case 2:
|
|
51533
51716
|
case 5:
|
|
51534
51717
|
case 8:
|
|
51535
|
-
|
|
51718
|
+
styles2 = "list-style-type: lower-alpha;";
|
|
51536
51719
|
break;
|
|
51537
51720
|
case 3:
|
|
51538
51721
|
case 6:
|
|
51539
|
-
|
|
51722
|
+
styles2 = "list-style-type: lower-roman;";
|
|
51540
51723
|
break;
|
|
51541
51724
|
}
|
|
51542
51725
|
} else {
|
|
51543
51726
|
html = `<li>${html}</li>`;
|
|
51544
51727
|
}
|
|
51545
51728
|
if (isFirstListItem(editor, blockData, doc2, path)) {
|
|
51546
|
-
html = `<${listTag}${
|
|
51729
|
+
html = `<${listTag}${styles2 ? ` style="${styles2}"` : ""}>${html}`;
|
|
51547
51730
|
}
|
|
51548
51731
|
if (isLastListItem(editor, blockData, doc2, path)) {
|
|
51549
51732
|
html = `${html}</${listTag}>`;
|
|
@@ -62359,13 +62542,13 @@ $$${mathData.mathjaxText}$$
|
|
|
62359
62542
|
if (!op.attributes) {
|
|
62360
62543
|
return /* @__PURE__ */ new Map();
|
|
62361
62544
|
}
|
|
62362
|
-
const
|
|
62545
|
+
const styles2 = Object.entries(op.attributes).filter(([key]) => {
|
|
62363
62546
|
if (key.startsWith("style-")) {
|
|
62364
62547
|
return true;
|
|
62365
62548
|
}
|
|
62366
62549
|
return false;
|
|
62367
62550
|
});
|
|
62368
|
-
return new Map(
|
|
62551
|
+
return new Map(styles2);
|
|
62369
62552
|
};
|
|
62370
62553
|
if (text2.length === 0) {
|
|
62371
62554
|
return /* @__PURE__ */ new Map();
|
|
@@ -62409,11 +62592,11 @@ $$${mathData.mathjaxText}$$
|
|
|
62409
62592
|
if (getTextLength(text2) === 0) {
|
|
62410
62593
|
return textStyles;
|
|
62411
62594
|
}
|
|
62412
|
-
let
|
|
62413
|
-
|
|
62595
|
+
let styles2 = getIntersectionStyles(text2);
|
|
62596
|
+
styles2 = mergeActiveStyle(editor, styles2);
|
|
62414
62597
|
function getTextStyle(item) {
|
|
62415
62598
|
const { id, icon, desc, name } = item;
|
|
62416
|
-
const value =
|
|
62599
|
+
const value = styles2.get(id);
|
|
62417
62600
|
if (value !== void 0) {
|
|
62418
62601
|
return {
|
|
62419
62602
|
id,
|
|
@@ -63009,6 +63192,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63009
63192
|
GroupItemActions2["QuickReply"] = "quick-reply";
|
|
63010
63193
|
GroupItemActions2["QuickReplyOk"] = "quick-reply-ok";
|
|
63011
63194
|
GroupItemActions2["QuickReplyCancel"] = "quick-reply-cancel";
|
|
63195
|
+
GroupItemActions2["Resolve"] = "resolve";
|
|
63012
63196
|
return GroupItemActions2;
|
|
63013
63197
|
})(GroupItemActions || {});
|
|
63014
63198
|
const GROUP_ITEM_ACTION_MARK = "group-item-action";
|
|
@@ -63056,7 +63240,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63056
63240
|
return attributes.filter((attribute) => attribute.startsWith("comment-")).map((attribute) => attribute.replace("comment-", ""));
|
|
63057
63241
|
}
|
|
63058
63242
|
const logger$1G = getLogger("doc-comments");
|
|
63059
|
-
function addBlockComments(doc2, block, result, resultSet) {
|
|
63243
|
+
function addBlockComments$1(doc2, block, result, resultSet) {
|
|
63060
63244
|
if (block.comments) {
|
|
63061
63245
|
const blockComments = block.comments;
|
|
63062
63246
|
if (Array.isArray(blockComments)) {
|
|
@@ -63092,7 +63276,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63092
63276
|
children.forEach((childContainerId) => {
|
|
63093
63277
|
const childBlocks = doc2.blocks[childContainerId];
|
|
63094
63278
|
childBlocks.forEach((subBlock) => {
|
|
63095
|
-
addBlockComments(doc2, subBlock, result, resultSet);
|
|
63279
|
+
addBlockComments$1(doc2, subBlock, result, resultSet);
|
|
63096
63280
|
});
|
|
63097
63281
|
});
|
|
63098
63282
|
}
|
|
@@ -63100,7 +63284,7 @@ $$${mathData.mathjaxText}$$
|
|
|
63100
63284
|
const result = [];
|
|
63101
63285
|
const resultSet = /* @__PURE__ */ new Set();
|
|
63102
63286
|
doc2.blocks.root.forEach((block) => {
|
|
63103
|
-
addBlockComments(doc2, block, result, resultSet);
|
|
63287
|
+
addBlockComments$1(doc2, block, result, resultSet);
|
|
63104
63288
|
});
|
|
63105
63289
|
const resultMap = /* @__PURE__ */ new Map();
|
|
63106
63290
|
result.forEach((commentId, index2) => resultMap.set(commentId, index2));
|
|
@@ -63156,6 +63340,26 @@ $$${mathData.mathjaxText}$$
|
|
|
63156
63340
|
});
|
|
63157
63341
|
return result;
|
|
63158
63342
|
}
|
|
63343
|
+
function getUnresolvedCommentsGroupFromDoc(editor, commentsProvider) {
|
|
63344
|
+
return getCommentsGroupFromDoc(editor, commentsProvider).filter((group) => !group.resolver);
|
|
63345
|
+
}
|
|
63346
|
+
function getResolvedCommentsGroupFromDoc(editor, commentsProvider) {
|
|
63347
|
+
const doc2 = editor.doc.toJSON();
|
|
63348
|
+
const commentsMap = getCommentsFromDoc(doc2);
|
|
63349
|
+
const commentGroup = getCommentsGroup(commentsProvider.getComments());
|
|
63350
|
+
const result = commentGroup.filter((group) => group.resolver).sort((group1, group2) => {
|
|
63351
|
+
var _a, _b, _c, _d;
|
|
63352
|
+
const date1 = (_b = (_a = group1.resolver) == null ? void 0 : _a.date) != null ? _b : 0;
|
|
63353
|
+
const date2 = (_d = (_c = group2.resolver) == null ? void 0 : _c.date) != null ? _d : 0;
|
|
63354
|
+
return date2 - date1;
|
|
63355
|
+
});
|
|
63356
|
+
result.forEach((group) => {
|
|
63357
|
+
if (!commentsMap.has(group.id)) {
|
|
63358
|
+
group.removedFromDoc = true;
|
|
63359
|
+
}
|
|
63360
|
+
});
|
|
63361
|
+
return result;
|
|
63362
|
+
}
|
|
63159
63363
|
function flattenCommentGroup(comment) {
|
|
63160
63364
|
const { children, ...raw } = comment;
|
|
63161
63365
|
const comments = [raw];
|
|
@@ -63212,6 +63416,18 @@ $$${mathData.mathjaxText}$$
|
|
|
63212
63416
|
const commentIds = intersection__default.default(comments1, comments2);
|
|
63213
63417
|
return commentIds;
|
|
63214
63418
|
}
|
|
63419
|
+
function removeUnresolvedComments(commentProvider, commentIds) {
|
|
63420
|
+
return commentIds.filter((commentId) => {
|
|
63421
|
+
const comment = commentProvider.getComment(commentId);
|
|
63422
|
+
return !!comment.resolver;
|
|
63423
|
+
});
|
|
63424
|
+
}
|
|
63425
|
+
function removeResolvedComments(commentProvider, commentIds) {
|
|
63426
|
+
return commentIds.filter((commentId) => {
|
|
63427
|
+
const comment = commentProvider.getComment(commentId);
|
|
63428
|
+
return !comment.resolver;
|
|
63429
|
+
});
|
|
63430
|
+
}
|
|
63215
63431
|
const logger$1F = getLogger("active-comments");
|
|
63216
63432
|
function inactiveComment(editor, commentId) {
|
|
63217
63433
|
const activeCommentElements = editor.rootContainer.querySelectorAll(`span.comment[comment-${commentId}],[data-type=editor-block].comment[comment-${commentId}]`);
|
|
@@ -63267,6 +63483,11 @@ $$${mathData.mathjaxText}$$
|
|
|
63267
63483
|
}
|
|
63268
63484
|
}
|
|
63269
63485
|
}
|
|
63486
|
+
function getElementsByCommentId(editor, commentId) {
|
|
63487
|
+
const lowerCommentId = commentId.toLocaleLowerCase();
|
|
63488
|
+
const elements = editor.rootContainer.querySelectorAll(`span.comment[comment-${lowerCommentId}],[data-type=editor-block].comment[comment-${lowerCommentId}]`);
|
|
63489
|
+
return Array.from(elements);
|
|
63490
|
+
}
|
|
63270
63491
|
function isImageBlock(block) {
|
|
63271
63492
|
return getBlockType(block) === "embed" && getEmbedType(block) === "image";
|
|
63272
63493
|
}
|
|
@@ -68986,8 +69207,9 @@ ${codeText}
|
|
|
68986
69207
|
return items;
|
|
68987
69208
|
}
|
|
68988
69209
|
reloadList(data2) {
|
|
69210
|
+
this._items.forEach((item) => item.destroy());
|
|
68989
69211
|
this.container.innerHTML = "";
|
|
68990
|
-
this.createList(data2);
|
|
69212
|
+
this._items = this.createList(data2);
|
|
68991
69213
|
}
|
|
68992
69214
|
insertItem(data2) {
|
|
68993
69215
|
const index2 = this.findInsertPos(data2);
|
|
@@ -69184,6 +69406,9 @@ ${codeText}
|
|
|
69184
69406
|
__publicField(this, "quickReply");
|
|
69185
69407
|
__publicField(this, "createRoot", () => {
|
|
69186
69408
|
const root2 = createElement("div", ["comment-group-item-root"], null);
|
|
69409
|
+
if (this.comment.resolver) {
|
|
69410
|
+
addClass(root2, "resolved");
|
|
69411
|
+
}
|
|
69187
69412
|
return root2;
|
|
69188
69413
|
});
|
|
69189
69414
|
__publicField(this, "createChildrenList", () => {
|
|
@@ -69240,6 +69465,7 @@ ${codeText}
|
|
|
69240
69465
|
this.mainItem = this.createItem();
|
|
69241
69466
|
this.childrenList = this.createChildrenList();
|
|
69242
69467
|
this.quickReply = this.createQuickReply();
|
|
69468
|
+
this.createFooter();
|
|
69243
69469
|
this.editor.on("readonlyChanged", this.handleReadonlyChanged);
|
|
69244
69470
|
this.resizeObserver = new index$g(this.handleResize);
|
|
69245
69471
|
this.resizeObserver.observe(this.root);
|
|
@@ -69249,6 +69475,29 @@ ${codeText}
|
|
|
69249
69475
|
const count = getCommentItemCountInGroupItem(this.root);
|
|
69250
69476
|
return count;
|
|
69251
69477
|
}
|
|
69478
|
+
createFooter() {
|
|
69479
|
+
if (!this.comment.resolver) {
|
|
69480
|
+
return null;
|
|
69481
|
+
}
|
|
69482
|
+
const footer = createElement("div", ["comment-item-footer"], this.root);
|
|
69483
|
+
const modified = createElement("span", ["comment-modified"], footer);
|
|
69484
|
+
const date = new Date(this.comment.modified);
|
|
69485
|
+
const resolver = this.comment.resolver;
|
|
69486
|
+
assert(logger$1h, resolver, "resolver should not be null");
|
|
69487
|
+
const text2 = i18n$1.t("comment.resolvedBy", { name: resolver.displayName, date: fromNowString(date) });
|
|
69488
|
+
modified.innerText = text2;
|
|
69489
|
+
const actions2 = createElement("div", ["comment-actions"], footer);
|
|
69490
|
+
createElement("span", ["comment-date"], actions2, fromNowString(new Date(resolver.date)));
|
|
69491
|
+
if (this.comment.removedFromDoc) {
|
|
69492
|
+
createElement("span", ["removed-tips"], actions2, i18n$1.t("comment.removedFromDoc"));
|
|
69493
|
+
} else {
|
|
69494
|
+
const reopen = createElement("button", ["comment-reopen"], actions2, i18n$1.t("comment.reopen"));
|
|
69495
|
+
reopen.onclick = () => {
|
|
69496
|
+
this.commentsProvider.localUpdateCommentResolver(this.comment.id, void 0);
|
|
69497
|
+
};
|
|
69498
|
+
}
|
|
69499
|
+
return footer;
|
|
69500
|
+
}
|
|
69252
69501
|
createQuickReply() {
|
|
69253
69502
|
const { editor, commentsProvider, comment } = this;
|
|
69254
69503
|
const commentQuickReply = new CommentQuickReply(editor, commentsProvider, comment, this);
|
|
@@ -69263,8 +69512,13 @@ ${codeText}
|
|
|
69263
69512
|
const switchContainer = createElement("span", ["item-head-switch"], head);
|
|
69264
69513
|
const switchUp = createTextButton(switchContainer, GroupItemActions.SwitchUp, "up", switchUpIcon);
|
|
69265
69514
|
const switchDown = createTextButton(switchContainer, GroupItemActions.SwitchDown, "down", switchDownIcon);
|
|
69515
|
+
const resolve = createTextButton(switchContainer, GroupItemActions.Resolve, "resolve", CheckMarkIcon);
|
|
69266
69516
|
addGroupActionToElement(switchUp, GroupItemActions.SwitchUp);
|
|
69267
69517
|
addGroupActionToElement(switchDown, GroupItemActions.SwitchDown);
|
|
69518
|
+
addGroupActionToElement(resolve, GroupItemActions.Resolve);
|
|
69519
|
+
if (comment.resolver) {
|
|
69520
|
+
addClass(resolve, "resolved");
|
|
69521
|
+
}
|
|
69268
69522
|
return head;
|
|
69269
69523
|
}
|
|
69270
69524
|
createItem() {
|
|
@@ -69497,6 +69751,16 @@ ${codeText}
|
|
|
69497
69751
|
this.commentsProvider.localDeleteComment(comment.id);
|
|
69498
69752
|
quickReply.show();
|
|
69499
69753
|
});
|
|
69754
|
+
__publicField(this, "handleResolve", (groupItem) => {
|
|
69755
|
+
const { commentsProvider } = this;
|
|
69756
|
+
const comment = commentsProvider.getComment(groupItem.comment.id);
|
|
69757
|
+
const user = this.groupList.editor.doc.getUser();
|
|
69758
|
+
commentsProvider.localUpdateCommentResolver(comment.id, {
|
|
69759
|
+
userId: user.userId,
|
|
69760
|
+
displayName: user.displayName,
|
|
69761
|
+
date: Date.now()
|
|
69762
|
+
});
|
|
69763
|
+
});
|
|
69500
69764
|
__publicField(this, "execute", (element, groupItem, commentId, itemIndex) => {
|
|
69501
69765
|
const actionElement = getClosestGroupItemActionElement(element);
|
|
69502
69766
|
if (!actionElement)
|
|
@@ -69536,6 +69800,9 @@ ${codeText}
|
|
|
69536
69800
|
case GroupItemActions.QuickReplyCancel:
|
|
69537
69801
|
this.handleQuickReplyCancel(groupItem);
|
|
69538
69802
|
break;
|
|
69803
|
+
case GroupItemActions.Resolve:
|
|
69804
|
+
this.handleResolve(groupItem);
|
|
69805
|
+
break;
|
|
69539
69806
|
default:
|
|
69540
69807
|
const exhaustiveCheck = actionId;
|
|
69541
69808
|
logger$1f.debug(`not implement handler for ${exhaustiveCheck}`);
|
|
@@ -69549,8 +69816,8 @@ ${codeText}
|
|
|
69549
69816
|
}
|
|
69550
69817
|
const logger$1e = getLogger("comment-group-list");
|
|
69551
69818
|
class CommentGroupList extends ListBase {
|
|
69552
|
-
constructor(editor, commentsProvider, parent) {
|
|
69553
|
-
super(editor, commentsProvider, parent,
|
|
69819
|
+
constructor(editor, commentsProvider, parent, type) {
|
|
69820
|
+
super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
|
|
69554
69821
|
__publicField(this, "groupItemHandlers");
|
|
69555
69822
|
__publicField(this, "dispatchScroll", debounce__default.default(() => {
|
|
69556
69823
|
this.editor.scrollContainer.dispatchEvent(new Event("scroll"));
|
|
@@ -69637,7 +69904,7 @@ ${codeText}
|
|
|
69637
69904
|
__publicField(this, "handleSelectionChanged", () => {
|
|
69638
69905
|
setTimeout(() => {
|
|
69639
69906
|
var _a;
|
|
69640
|
-
const commentIds = getCommentsFromSelection(this.editor);
|
|
69907
|
+
const commentIds = this.type === "current" ? removeResolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor)) : removeUnresolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor));
|
|
69641
69908
|
if (commentIds.length > 0) {
|
|
69642
69909
|
if (((_a = this.activeItem) == null ? void 0 : _a.comment.id) && commentIds.includes(this.activeItem.comment.id)) {
|
|
69643
69910
|
return;
|
|
@@ -69678,7 +69945,9 @@ ${codeText}
|
|
|
69678
69945
|
const top = Number.parseFloat(firstItem.style.top);
|
|
69679
69946
|
const targetTop = Number.parseFloat(firstItem.getAttribute("data-target-top") || "0");
|
|
69680
69947
|
if (!Number.isNaN(top) && !Number.isNaN(targetTop) && top < targetTop) {
|
|
69681
|
-
|
|
69948
|
+
if (this.type === "current") {
|
|
69949
|
+
arrangeItems(this.editor, this.items, null, Math.min(top + (0 - event.deltaY) * 3, targetTop));
|
|
69950
|
+
}
|
|
69682
69951
|
}
|
|
69683
69952
|
});
|
|
69684
69953
|
__publicField(this, "updateGroupItemSwitch", () => {
|
|
@@ -69687,7 +69956,7 @@ ${codeText}
|
|
|
69687
69956
|
activeItem.updateSwitchButton();
|
|
69688
69957
|
});
|
|
69689
69958
|
__publicField(this, "updateComments", debounce__default.default(() => {
|
|
69690
|
-
const commentsGroup =
|
|
69959
|
+
const commentsGroup = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
|
|
69691
69960
|
let hasBeenChanged = false;
|
|
69692
69961
|
for (let i = 0; i < commentsGroup.length; i++) {
|
|
69693
69962
|
const comment = commentsGroup[i];
|
|
@@ -69710,6 +69979,8 @@ ${codeText}
|
|
|
69710
69979
|
this.emit("commentCountChanged");
|
|
69711
69980
|
}
|
|
69712
69981
|
}, 100));
|
|
69982
|
+
this.editor = editor;
|
|
69983
|
+
this.type = type;
|
|
69713
69984
|
this.updateItemsLayout();
|
|
69714
69985
|
this.bindEvents();
|
|
69715
69986
|
this.editor.addListener("selectionChanged", this.handleSelectionChanged);
|
|
@@ -69730,7 +70001,9 @@ ${codeText}
|
|
|
69730
70001
|
document.removeEventListener("click", this.handleDocumentClick);
|
|
69731
70002
|
}
|
|
69732
70003
|
updateItemsLayout(dispatchScroll = true) {
|
|
69733
|
-
|
|
70004
|
+
if (this.type === "current") {
|
|
70005
|
+
arrangeItems(this.editor, this.items, this.activeItem);
|
|
70006
|
+
}
|
|
69734
70007
|
if (dispatchScroll) {
|
|
69735
70008
|
this.dispatchScroll();
|
|
69736
70009
|
}
|
|
@@ -69754,7 +70027,7 @@ ${codeText}
|
|
|
69754
70027
|
return item;
|
|
69755
70028
|
}
|
|
69756
70029
|
findInsertPos(data2) {
|
|
69757
|
-
const commentsMap =
|
|
70030
|
+
const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
|
|
69758
70031
|
const index2 = commentsMap.findIndex((group) => group.id === data2.id);
|
|
69759
70032
|
if (index2 === -1) {
|
|
69760
70033
|
return -1;
|
|
@@ -69889,6 +70162,217 @@ ${codeText}
|
|
|
69889
70162
|
item.handleUpdateMainComment(comment);
|
|
69890
70163
|
}
|
|
69891
70164
|
}
|
|
70165
|
+
changeType(type) {
|
|
70166
|
+
this.type = type;
|
|
70167
|
+
const comments = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
|
|
70168
|
+
this.reloadList(comments);
|
|
70169
|
+
if (this.type === "current") {
|
|
70170
|
+
setTimeout(() => {
|
|
70171
|
+
arrangeItems(this.editor, this.items, null);
|
|
70172
|
+
});
|
|
70173
|
+
}
|
|
70174
|
+
}
|
|
70175
|
+
}
|
|
70176
|
+
function addBlockComments(doc2, block, resultMap) {
|
|
70177
|
+
if (block.comments) {
|
|
70178
|
+
const blockComments = block.comments;
|
|
70179
|
+
if (Array.isArray(blockComments)) {
|
|
70180
|
+
blockComments.forEach((commentId) => {
|
|
70181
|
+
const commentIds = resultMap.get(block.id);
|
|
70182
|
+
if (commentIds) {
|
|
70183
|
+
commentIds.add(commentId);
|
|
70184
|
+
} else {
|
|
70185
|
+
resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
|
|
70186
|
+
}
|
|
70187
|
+
});
|
|
70188
|
+
}
|
|
70189
|
+
}
|
|
70190
|
+
if (block.text) {
|
|
70191
|
+
const text2 = block.text;
|
|
70192
|
+
text2.forEach((op) => {
|
|
70193
|
+
if (op.attributes) {
|
|
70194
|
+
const prefix = "comment-";
|
|
70195
|
+
Object.entries(op.attributes).forEach(([key, value]) => {
|
|
70196
|
+
if (key.startsWith(prefix)) {
|
|
70197
|
+
const commentId = value;
|
|
70198
|
+
const commentIds = resultMap.get(block.id);
|
|
70199
|
+
if (commentIds) {
|
|
70200
|
+
commentIds.add(commentId);
|
|
70201
|
+
} else {
|
|
70202
|
+
resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
|
|
70203
|
+
}
|
|
70204
|
+
}
|
|
70205
|
+
});
|
|
70206
|
+
}
|
|
70207
|
+
});
|
|
70208
|
+
}
|
|
70209
|
+
const children = block.children;
|
|
70210
|
+
if (!children) {
|
|
70211
|
+
return;
|
|
70212
|
+
}
|
|
70213
|
+
children.forEach((childContainerId) => {
|
|
70214
|
+
const childBlocks = doc2.blocks[childContainerId];
|
|
70215
|
+
childBlocks.forEach((subBlock) => {
|
|
70216
|
+
addBlockComments(doc2, subBlock, resultMap);
|
|
70217
|
+
});
|
|
70218
|
+
});
|
|
70219
|
+
}
|
|
70220
|
+
function getBlockCommentsFromDoc(doc2) {
|
|
70221
|
+
const resultMap = /* @__PURE__ */ new Map();
|
|
70222
|
+
doc2.blocks.root.forEach((block) => {
|
|
70223
|
+
addBlockComments(doc2, block, resultMap);
|
|
70224
|
+
});
|
|
70225
|
+
return resultMap;
|
|
70226
|
+
}
|
|
70227
|
+
class OnesEditorCommentsRender {
|
|
70228
|
+
constructor(type = "current") {
|
|
70229
|
+
__publicField(this, "updateUnknownCommentsDelayed", debounce__default.default((editor) => {
|
|
70230
|
+
const comments = editor.doc.toJSON().comments;
|
|
70231
|
+
const invisibleComments = Object.values(comments).filter((comment) => {
|
|
70232
|
+
if (comment.id !== comment.groupId) {
|
|
70233
|
+
return false;
|
|
70234
|
+
}
|
|
70235
|
+
const ret = this.type === "current" ? !!comment.resolver : !comment.resolver;
|
|
70236
|
+
return ret;
|
|
70237
|
+
});
|
|
70238
|
+
const root2 = editor.rootContainer;
|
|
70239
|
+
const effectedElements = /* @__PURE__ */ new Set();
|
|
70240
|
+
invisibleComments.forEach((comment) => {
|
|
70241
|
+
const key = `comment-${comment.id.toLocaleLowerCase()}`;
|
|
70242
|
+
const elements = root2.querySelectorAll(`[${key}]`);
|
|
70243
|
+
elements.forEach((elem) => {
|
|
70244
|
+
elem.removeAttribute(key);
|
|
70245
|
+
effectedElements.add(elem);
|
|
70246
|
+
});
|
|
70247
|
+
});
|
|
70248
|
+
effectedElements.forEach((elem) => {
|
|
70249
|
+
const commentAttributes = Array.from(elem.attributes).filter((a) => a.name.startsWith("comment-"));
|
|
70250
|
+
if (commentAttributes.length === 0) {
|
|
70251
|
+
elem.classList.remove("comment");
|
|
70252
|
+
}
|
|
70253
|
+
});
|
|
70254
|
+
}));
|
|
70255
|
+
this.type = type;
|
|
70256
|
+
}
|
|
70257
|
+
renderText(editor, path, attributes) {
|
|
70258
|
+
const classes = [];
|
|
70259
|
+
const textAttributes = {};
|
|
70260
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
70261
|
+
if (key.startsWith("comment-")) {
|
|
70262
|
+
this.renderCommentElement(editor, key, value, classes, textAttributes);
|
|
70263
|
+
}
|
|
70264
|
+
});
|
|
70265
|
+
return { classes, attributes: textAttributes };
|
|
70266
|
+
}
|
|
70267
|
+
renderBox(editor, path, attributes) {
|
|
70268
|
+
const classes = [];
|
|
70269
|
+
const textAttributes = {};
|
|
70270
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
70271
|
+
if (key.startsWith("comment-")) {
|
|
70272
|
+
this.renderCommentElement(editor, key, value, classes, textAttributes);
|
|
70273
|
+
}
|
|
70274
|
+
});
|
|
70275
|
+
return { classes, attributes: textAttributes };
|
|
70276
|
+
}
|
|
70277
|
+
renderBlock(editor, path, blockData) {
|
|
70278
|
+
const comments = blockData.comments;
|
|
70279
|
+
if (!comments || comments.length === 0) {
|
|
70280
|
+
return {};
|
|
70281
|
+
}
|
|
70282
|
+
const classes = [];
|
|
70283
|
+
const attributes = {};
|
|
70284
|
+
comments.forEach((commentId) => {
|
|
70285
|
+
const key = `comment-${commentId.toLocaleLowerCase()}`;
|
|
70286
|
+
this.renderCommentElement(editor, key, commentId, classes, attributes);
|
|
70287
|
+
});
|
|
70288
|
+
return {
|
|
70289
|
+
classes,
|
|
70290
|
+
attributes
|
|
70291
|
+
};
|
|
70292
|
+
}
|
|
70293
|
+
updateBlock(editor, path, blockElement, blockData) {
|
|
70294
|
+
const comments = blockData.comments;
|
|
70295
|
+
removeClass(blockElement, "comment");
|
|
70296
|
+
Array.from(blockElement.attributes).forEach((a) => {
|
|
70297
|
+
if (a.name.startsWith("comment-")) {
|
|
70298
|
+
blockElement.removeAttribute(a.name);
|
|
70299
|
+
}
|
|
70300
|
+
});
|
|
70301
|
+
if (!comments || comments.length === 0) {
|
|
70302
|
+
return;
|
|
70303
|
+
}
|
|
70304
|
+
addClass(blockElement, "comment");
|
|
70305
|
+
const classList = [];
|
|
70306
|
+
comments.forEach((commentId) => {
|
|
70307
|
+
const key = `comment-${commentId.toLocaleLowerCase()}`;
|
|
70308
|
+
this.renderCommentElement(editor, key, commentId, classList, {});
|
|
70309
|
+
});
|
|
70310
|
+
if (classList.length > 0) {
|
|
70311
|
+
addClass(blockElement, ...classList);
|
|
70312
|
+
}
|
|
70313
|
+
}
|
|
70314
|
+
getCommentStatus(editor, commentId) {
|
|
70315
|
+
const comments = editor.findCustom("editor-comments");
|
|
70316
|
+
if (!comments) {
|
|
70317
|
+
return "unknown";
|
|
70318
|
+
}
|
|
70319
|
+
const commentsProvider = comments.commentProvider;
|
|
70320
|
+
const comment = commentsProvider.getComment(commentId);
|
|
70321
|
+
if (!comment) {
|
|
70322
|
+
return "unknown";
|
|
70323
|
+
}
|
|
70324
|
+
if (comment.resolver) {
|
|
70325
|
+
return "resolved";
|
|
70326
|
+
}
|
|
70327
|
+
return "unresolved";
|
|
70328
|
+
}
|
|
70329
|
+
renderCommentElement(editor, key, commentId, classes, textAttributes) {
|
|
70330
|
+
const status = this.getCommentStatus(editor, commentId);
|
|
70331
|
+
if (this.type === "current") {
|
|
70332
|
+
if (status === "resolved") {
|
|
70333
|
+
return;
|
|
70334
|
+
}
|
|
70335
|
+
} else {
|
|
70336
|
+
if (status === "unresolved") {
|
|
70337
|
+
return;
|
|
70338
|
+
}
|
|
70339
|
+
}
|
|
70340
|
+
classes.push("comment");
|
|
70341
|
+
textAttributes[key] = commentId;
|
|
70342
|
+
if (status === "unknown") {
|
|
70343
|
+
this.updateUnknownCommentsDelayed(editor);
|
|
70344
|
+
}
|
|
70345
|
+
}
|
|
70346
|
+
changeType(editor, type) {
|
|
70347
|
+
this.type = type;
|
|
70348
|
+
const elements = editor.rootContainer.querySelectorAll(".comment");
|
|
70349
|
+
elements.forEach((elem) => {
|
|
70350
|
+
elem.classList.remove("comment");
|
|
70351
|
+
Array.from(elem.attributes).forEach((a) => {
|
|
70352
|
+
if (a.name.startsWith("comment-")) {
|
|
70353
|
+
elem.removeAttribute(a.name);
|
|
70354
|
+
}
|
|
70355
|
+
});
|
|
70356
|
+
});
|
|
70357
|
+
const doc2 = editor.doc.toJSON();
|
|
70358
|
+
const visibleComments = Object.values(doc2.comments).filter((comment) => {
|
|
70359
|
+
if (comment.id !== comment.groupId) {
|
|
70360
|
+
return false;
|
|
70361
|
+
}
|
|
70362
|
+
const ret = this.type === "current" ? !comment.resolver : !!comment.resolver;
|
|
70363
|
+
return ret;
|
|
70364
|
+
});
|
|
70365
|
+
const visibleCommentsId = new Set(visibleComments.map((c) => c.id));
|
|
70366
|
+
const commentsFromDoc = getBlockCommentsFromDoc(doc2);
|
|
70367
|
+
commentsFromDoc.forEach((commentIds, blockId) => {
|
|
70368
|
+
if (Array.from(commentIds).some((c) => visibleCommentsId.has(c))) {
|
|
70369
|
+
const block = editor.findBlockById(blockId);
|
|
70370
|
+
if (block) {
|
|
70371
|
+
editor.reloadBlock(block);
|
|
70372
|
+
}
|
|
70373
|
+
}
|
|
70374
|
+
});
|
|
70375
|
+
}
|
|
69892
70376
|
}
|
|
69893
70377
|
const COMMENT_MINI_CLS = "comment-mini";
|
|
69894
70378
|
getLogger("comment-list");
|
|
@@ -69898,6 +70382,41 @@ ${codeText}
|
|
|
69898
70382
|
__publicField(this, "root");
|
|
69899
70383
|
__publicField(this, "groupsContainer");
|
|
69900
70384
|
__publicField(this, "list");
|
|
70385
|
+
__publicField(this, "listType", "current");
|
|
70386
|
+
__publicField(this, "switcherItem", {
|
|
70387
|
+
id: "switch-comment",
|
|
70388
|
+
name: i18n$1.t("comment.currentComment"),
|
|
70389
|
+
dropdown: true,
|
|
70390
|
+
manualShowChildren: true,
|
|
70391
|
+
childrenPlacement: "bottom-start",
|
|
70392
|
+
children: [{
|
|
70393
|
+
id: "current-comment",
|
|
70394
|
+
name: i18n$1.t("comment.currentComment"),
|
|
70395
|
+
states: ["checked"]
|
|
70396
|
+
}, {
|
|
70397
|
+
id: "resolved-comment",
|
|
70398
|
+
name: i18n$1.t("comment.resolvedComment")
|
|
70399
|
+
}]
|
|
70400
|
+
});
|
|
70401
|
+
__publicField(this, "switcherBar");
|
|
70402
|
+
__publicField(this, "handleSwitchType", (bar2, item) => {
|
|
70403
|
+
if (item.id === "current-comment") {
|
|
70404
|
+
this.listType = "current";
|
|
70405
|
+
} else {
|
|
70406
|
+
this.listType = "resolved";
|
|
70407
|
+
}
|
|
70408
|
+
this.root.setAttribute("list-type", this.listType);
|
|
70409
|
+
this.switcherItem.name = this.listType === "current" ? i18n$1.t("comment.currentComment") : i18n$1.t("comment.resolvedComment");
|
|
70410
|
+
const children = this.switcherItem.children;
|
|
70411
|
+
children[0].states = this.listType === "current" ? ["checked"] : [];
|
|
70412
|
+
children[1].states = this.listType === "resolved" ? ["checked"] : [];
|
|
70413
|
+
this.switcherBar.updateItems([this.switcherItem]);
|
|
70414
|
+
this.list.changeType(this.listType);
|
|
70415
|
+
const renderer = this.editor.editorBlockRenders.getRenderers().find((r) => r instanceof OnesEditorCommentsRender);
|
|
70416
|
+
if (renderer) {
|
|
70417
|
+
renderer.changeType(this.editor, this.listType);
|
|
70418
|
+
}
|
|
70419
|
+
});
|
|
69901
70420
|
__publicField(this, "handleSelectionOnComment", () => {
|
|
69902
70421
|
this.emit("onSelectComment");
|
|
69903
70422
|
});
|
|
@@ -69923,8 +70442,10 @@ ${codeText}
|
|
|
69923
70442
|
this.editor = editor;
|
|
69924
70443
|
this.commentsProvider = commentsProvider;
|
|
69925
70444
|
this.root = createElement("div", ["editor-web-comment-root"], null);
|
|
70445
|
+
this.root.setAttribute("list-type", this.listType);
|
|
69926
70446
|
this.groupsContainer = createElement("div", ["comment-groups-container"], this.root);
|
|
69927
70447
|
this.list = this.createList();
|
|
70448
|
+
this.switcherBar = this.createSwitcher();
|
|
69928
70449
|
this.commentsProvider.addListener(this);
|
|
69929
70450
|
this.list.addListener("activeItemChanged", this.handleActiveItemChanged);
|
|
69930
70451
|
this.list.addListener("itemLayoutUpdated", this.handleItemLayoutUpdated);
|
|
@@ -69941,6 +70462,7 @@ ${codeText}
|
|
|
69941
70462
|
this.commentsProvider.removeListener(this);
|
|
69942
70463
|
this.list.destroy();
|
|
69943
70464
|
this.root.remove();
|
|
70465
|
+
this.switcherBar.destroy();
|
|
69944
70466
|
}
|
|
69945
70467
|
onCreateComment(commentId, local) {
|
|
69946
70468
|
const comment = this.commentsProvider.getComment(commentId);
|
|
@@ -69955,8 +70477,53 @@ ${codeText}
|
|
|
69955
70477
|
const comment = this.commentsProvider.getComment(commentId);
|
|
69956
70478
|
this.list.handleUpdateComment(comment);
|
|
69957
70479
|
}
|
|
70480
|
+
onUpdateCommentResolver(commentId, local) {
|
|
70481
|
+
const comment = this.commentsProvider.getComment(commentId);
|
|
70482
|
+
const groupItem = this.list.findGroupItem(comment.groupId);
|
|
70483
|
+
if (!groupItem) {
|
|
70484
|
+
return;
|
|
70485
|
+
}
|
|
70486
|
+
setTimeout(() => {
|
|
70487
|
+
if (this.listType === "current") {
|
|
70488
|
+
if (comment.resolver) {
|
|
70489
|
+
this.list.handleDeleteComment(commentId);
|
|
70490
|
+
} else {
|
|
70491
|
+
this.list.handleCreateComment(comment, local);
|
|
70492
|
+
}
|
|
70493
|
+
} else {
|
|
70494
|
+
if (comment.resolver) {
|
|
70495
|
+
this.list.handleCreateComment(comment, local);
|
|
70496
|
+
} else {
|
|
70497
|
+
this.list.handleDeleteComment(commentId);
|
|
70498
|
+
}
|
|
70499
|
+
}
|
|
70500
|
+
}, 300);
|
|
70501
|
+
this.updateCommentCount();
|
|
70502
|
+
const blocks = /* @__PURE__ */ new Set();
|
|
70503
|
+
getElementsByCommentId(this.editor, groupItem.comment.id).forEach((element) => {
|
|
70504
|
+
if (isBlock$1(element)) {
|
|
70505
|
+
blocks.add(element);
|
|
70506
|
+
} else {
|
|
70507
|
+
const block = getParentBlock(element);
|
|
70508
|
+
if (block) {
|
|
70509
|
+
blocks.add(block);
|
|
70510
|
+
}
|
|
70511
|
+
}
|
|
70512
|
+
});
|
|
70513
|
+
blocks.forEach((block) => {
|
|
70514
|
+
this.editor.reloadBlock(block);
|
|
70515
|
+
});
|
|
70516
|
+
}
|
|
69958
70517
|
createList() {
|
|
69959
|
-
return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer);
|
|
70518
|
+
return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer, this.listType);
|
|
70519
|
+
}
|
|
70520
|
+
createSwitcher() {
|
|
70521
|
+
const container = createElement("div", ["comment-switcher-container"], this.root);
|
|
70522
|
+
const commandBar2 = new FixedToolbar(container, [this.switcherItem], {
|
|
70523
|
+
id: "comment-switcher"
|
|
70524
|
+
});
|
|
70525
|
+
commandBar2.addListener("click", this.handleSwitchType);
|
|
70526
|
+
return commandBar2;
|
|
69960
70527
|
}
|
|
69961
70528
|
isEditing(includeEmpty) {
|
|
69962
70529
|
return this.list.isEditing(includeEmpty);
|
|
@@ -70099,7 +70666,7 @@ ${codeText}
|
|
|
70099
70666
|
const logger$1c = getLogger("mobile-group-list");
|
|
70100
70667
|
class MobileGroupList extends ListBase {
|
|
70101
70668
|
constructor(editor, commentsProvider, parent, scrollElement) {
|
|
70102
|
-
super(editor, commentsProvider, parent,
|
|
70669
|
+
super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
|
|
70103
70670
|
__publicField(this, "scroller");
|
|
70104
70671
|
__publicField(this, "refreshScroller", () => {
|
|
70105
70672
|
this.scroller.refresh();
|
|
@@ -70147,7 +70714,7 @@ ${codeText}
|
|
|
70147
70714
|
this.updateComments();
|
|
70148
70715
|
});
|
|
70149
70716
|
__publicField(this, "updateComments", debounce__default.default(() => {
|
|
70150
|
-
const commentsGroup =
|
|
70717
|
+
const commentsGroup = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
|
|
70151
70718
|
for (let i = 0; i < commentsGroup.length; i++) {
|
|
70152
70719
|
const comment = commentsGroup[i];
|
|
70153
70720
|
const groupItem = this.findGroupItem(comment.groupId);
|
|
@@ -70181,7 +70748,7 @@ ${codeText}
|
|
|
70181
70748
|
return item;
|
|
70182
70749
|
}
|
|
70183
70750
|
findInsertPos(data2) {
|
|
70184
|
-
const commentsMap =
|
|
70751
|
+
const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
|
|
70185
70752
|
const index2 = commentsMap.findIndex((group) => group.id === data2.id);
|
|
70186
70753
|
if (index2 === -1) {
|
|
70187
70754
|
return -1;
|
|
@@ -70317,6 +70884,8 @@ ${codeText}
|
|
|
70317
70884
|
const comment = this.commentsProvider.getComment(commentId);
|
|
70318
70885
|
this.list.handleUpdateComment(comment);
|
|
70319
70886
|
}
|
|
70887
|
+
onUpdateCommentResolver(commentId, local) {
|
|
70888
|
+
}
|
|
70320
70889
|
get commentOptions() {
|
|
70321
70890
|
const commentOptions = this.editor.getComponentOptions("comment");
|
|
70322
70891
|
return commentOptions;
|
|
@@ -70342,7 +70911,7 @@ ${codeText}
|
|
|
70342
70911
|
}
|
|
70343
70912
|
}
|
|
70344
70913
|
function getMiniCommentsGroupFromDoc(editor, commentsProvider) {
|
|
70345
|
-
const commentsGroupFromDoc =
|
|
70914
|
+
const commentsGroupFromDoc = getUnresolvedCommentsGroupFromDoc(editor, commentsProvider);
|
|
70346
70915
|
const miniCommentGroups = /* @__PURE__ */ new Map();
|
|
70347
70916
|
for (const commentGroup of commentsGroupFromDoc) {
|
|
70348
70917
|
const blockId = getBlockIdByGroupId(editor, commentGroup.groupId);
|
|
@@ -70489,6 +71058,9 @@ ${codeText}
|
|
|
70489
71058
|
}
|
|
70490
71059
|
onUpdateComment(commentId, local) {
|
|
70491
71060
|
}
|
|
71061
|
+
onUpdateCommentResolver(commentId, local) {
|
|
71062
|
+
this.list.updateMiniCommentsGroup();
|
|
71063
|
+
}
|
|
70492
71064
|
show() {
|
|
70493
71065
|
removeClass(this.root, "hidden");
|
|
70494
71066
|
}
|
|
@@ -70805,7 +71377,12 @@ ${codeText}
|
|
|
70805
71377
|
more: "\u66F4\u591A",
|
|
70806
71378
|
comment: "\u6DFB\u52A0\u6279\u6CE8",
|
|
70807
71379
|
command: "\u6DFB\u52A0\u6279\u6CE8",
|
|
70808
|
-
quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8"
|
|
71380
|
+
quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8",
|
|
71381
|
+
resolvedBy: "\u5DF2\u7531 {name} \u6210\u5458\u89E3\u51B3",
|
|
71382
|
+
reopen: "\u91CD\u65B0\u6253\u5F00",
|
|
71383
|
+
currentComment: "\u5F53\u524D\u6279\u6CE8",
|
|
71384
|
+
resolvedComment: "\u5DF2\u89E3\u51B3\u6279\u6CE8",
|
|
71385
|
+
removedFromDoc: "\u5F15\u7528\u5185\u5BB9\u5DF2\u5220\u9664"
|
|
70809
71386
|
}
|
|
70810
71387
|
};
|
|
70811
71388
|
const enUS$k = {
|
|
@@ -70828,7 +71405,12 @@ ${codeText}
|
|
|
70828
71405
|
more: "More",
|
|
70829
71406
|
comment: "Add annotation",
|
|
70830
71407
|
command: "Add annotation",
|
|
70831
|
-
quickMenuCommand: "Add annotation"
|
|
71408
|
+
quickMenuCommand: "Add annotation",
|
|
71409
|
+
resolvedBy: "Resolved by {name}",
|
|
71410
|
+
reopen: "Reopen",
|
|
71411
|
+
currentComment: "Current Annotations",
|
|
71412
|
+
resolvedComment: "Resolved Annotations",
|
|
71413
|
+
removedFromDoc: "This annotation has been removed from the document"
|
|
70832
71414
|
}
|
|
70833
71415
|
};
|
|
70834
71416
|
const jaJP$k = {
|
|
@@ -70851,7 +71433,12 @@ ${codeText}
|
|
|
70851
71433
|
more: "\u305D\u306E\u4ED6",
|
|
70852
71434
|
comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
70853
71435
|
command: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
70854
|
-
quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
|
|
71436
|
+
quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
|
|
71437
|
+
resolvedBy: "{name} \u306B\u3088\u3063\u3066\u89E3\u6C7A\u6E08\u307F",
|
|
71438
|
+
reopen: "\u518D\u958B",
|
|
71439
|
+
currentComment: "\u73FE\u5728\u306E\u6CE8\u91C8",
|
|
71440
|
+
resolvedComment: "\u89E3\u6C7A\u6E08\u307F\u306E\u6CE8\u91C8",
|
|
71441
|
+
removedFromDoc: "\u3053\u306E\u6CE8\u91C8\u306F\u6587\u66F8\u304B\u3089\u524A\u9664\u3055\u308C\u307E\u3057\u305F"
|
|
70855
71442
|
}
|
|
70856
71443
|
};
|
|
70857
71444
|
i18n$1.mergeLang({
|
|
@@ -70859,61 +71446,6 @@ ${codeText}
|
|
|
70859
71446
|
"en-US": enUS$k,
|
|
70860
71447
|
"ja-JP": jaJP$k
|
|
70861
71448
|
});
|
|
70862
|
-
class OnesEditorCommentsRender {
|
|
70863
|
-
renderText(editor, path, attributes) {
|
|
70864
|
-
const classes = [];
|
|
70865
|
-
const textAttributes = {};
|
|
70866
|
-
Object.entries(attributes).forEach(([key, value]) => {
|
|
70867
|
-
if (key.startsWith("comment-")) {
|
|
70868
|
-
classes.push("comment");
|
|
70869
|
-
textAttributes[key] = value;
|
|
70870
|
-
}
|
|
70871
|
-
});
|
|
70872
|
-
return { classes, attributes: textAttributes };
|
|
70873
|
-
}
|
|
70874
|
-
renderBox(editor, path, attributes) {
|
|
70875
|
-
const classes = [];
|
|
70876
|
-
const textAttributes = {};
|
|
70877
|
-
Object.entries(attributes).forEach(([key, value]) => {
|
|
70878
|
-
if (key.startsWith("comment-")) {
|
|
70879
|
-
classes.push("comment");
|
|
70880
|
-
textAttributes[key] = value;
|
|
70881
|
-
}
|
|
70882
|
-
});
|
|
70883
|
-
return { classes, attributes: textAttributes };
|
|
70884
|
-
}
|
|
70885
|
-
renderBlock(editor, path, blockData) {
|
|
70886
|
-
const comments = blockData.comments;
|
|
70887
|
-
if (!comments || comments.length === 0) {
|
|
70888
|
-
return {};
|
|
70889
|
-
}
|
|
70890
|
-
const classes = ["comment"];
|
|
70891
|
-
const attributes = {};
|
|
70892
|
-
comments.forEach((commentId) => {
|
|
70893
|
-
attributes[`comment-${commentId.toLocaleLowerCase()}`] = commentId;
|
|
70894
|
-
});
|
|
70895
|
-
return {
|
|
70896
|
-
classes,
|
|
70897
|
-
attributes
|
|
70898
|
-
};
|
|
70899
|
-
}
|
|
70900
|
-
updateBlock(editor, path, blockElement, blockData) {
|
|
70901
|
-
const comments = blockData.comments;
|
|
70902
|
-
removeClass(blockElement, "comment");
|
|
70903
|
-
Array.from(blockElement.attributes).forEach((a) => {
|
|
70904
|
-
if (a.name.startsWith("comment-")) {
|
|
70905
|
-
blockElement.removeAttribute(a.name);
|
|
70906
|
-
}
|
|
70907
|
-
});
|
|
70908
|
-
if (!comments || comments.length === 0) {
|
|
70909
|
-
return;
|
|
70910
|
-
}
|
|
70911
|
-
addClass(blockElement, "comment");
|
|
70912
|
-
comments.forEach((commentId) => {
|
|
70913
|
-
blockElement.setAttribute(`comment-${commentId.toLocaleLowerCase()}`, commentId);
|
|
70914
|
-
});
|
|
70915
|
-
}
|
|
70916
|
-
}
|
|
70917
71449
|
class OnesEditorCommentPlaceholderHandler {
|
|
70918
71450
|
constructor(editor) {
|
|
70919
71451
|
__publicField(this, "handleUpdateCompositionText", (editor, containerId, blockIndex, offset, end) => {
|
|
@@ -71065,6 +71597,8 @@ ${codeText}
|
|
|
71065
71597
|
method: "delete"
|
|
71066
71598
|
});
|
|
71067
71599
|
}
|
|
71600
|
+
getLogger("resolved-comment-item");
|
|
71601
|
+
const styles = "";
|
|
71068
71602
|
const isAllContainersSelected = (editor) => {
|
|
71069
71603
|
var _a;
|
|
71070
71604
|
const range = editor.selection.range;
|
|
@@ -71139,6 +71673,8 @@ ${codeText}
|
|
|
71139
71673
|
await updateCommentToOldDoc(this.editor, this.version, commentId, comments.commentProvider.getCommentDoc(commentId));
|
|
71140
71674
|
}
|
|
71141
71675
|
}
|
|
71676
|
+
onUpdateCommentResolver(commentId, local) {
|
|
71677
|
+
}
|
|
71142
71678
|
hideToolbar(editor) {
|
|
71143
71679
|
const toolbar2 = editor.findCustom("toolbar-handler");
|
|
71144
71680
|
toolbar2 == null ? void 0 : toolbar2.disableTextToolbar();
|
|
@@ -72017,8 +72553,8 @@ ${codeText}
|
|
|
72017
72553
|
const blockData = this.editor.getBlockData(this.activeTableBlock);
|
|
72018
72554
|
const containerId = focus.childContainerId;
|
|
72019
72555
|
const bkg = blockData[`${containerId}_background`];
|
|
72020
|
-
if (bkg) {
|
|
72021
|
-
return Number.parseInt((_a = bkg.substring(BACKGROUND_COLOR_PREFIX.length)) != null ? _a : "0", 10);
|
|
72556
|
+
if (bkg && bkg.startsWith(BACKGROUND_COLOR_PREFIX)) {
|
|
72557
|
+
return Number.parseInt((_a = bkg.substring(BACKGROUND_COLOR_PREFIX.length)) != null ? _a : "0", 10) || -1;
|
|
72022
72558
|
}
|
|
72023
72559
|
return -1;
|
|
72024
72560
|
}
|
|
@@ -72481,8 +73017,12 @@ ${codeText}
|
|
|
72481
73017
|
cellElem.rowSpan = cell.rowSpan;
|
|
72482
73018
|
}
|
|
72483
73019
|
const backgroundClass = tableData[getCellBkgColorKey(subContainerId)];
|
|
72484
|
-
if (backgroundClass) {
|
|
72485
|
-
|
|
73020
|
+
if (backgroundClass && typeof backgroundClass === "string") {
|
|
73021
|
+
if (backgroundClass.startsWith("style-bg-")) {
|
|
73022
|
+
addClass(cellElem, backgroundClass);
|
|
73023
|
+
} else {
|
|
73024
|
+
cellElem.style.backgroundColor = backgroundClass;
|
|
73025
|
+
}
|
|
72486
73026
|
}
|
|
72487
73027
|
if (col === 0 && tableData.hasColTitle) {
|
|
72488
73028
|
addClass(cellElem, TABLE_CLASS.COL_TITLE_ITEM);
|
|
@@ -76447,14 +76987,14 @@ ${docStr}
|
|
|
76447
76987
|
}
|
|
76448
76988
|
function isList(elem) {
|
|
76449
76989
|
var _a;
|
|
76450
|
-
const
|
|
76451
|
-
return
|
|
76990
|
+
const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
|
|
76991
|
+
return styles2.findIndex((style2) => style2.startsWith("level")) !== -1;
|
|
76452
76992
|
}
|
|
76453
76993
|
function getOfficeListGroupId(elem) {
|
|
76454
76994
|
var _a;
|
|
76455
|
-
const
|
|
76456
|
-
for (let i = 0; i <
|
|
76457
|
-
const name =
|
|
76995
|
+
const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
|
|
76996
|
+
for (let i = 0; i < styles2.length; i++) {
|
|
76997
|
+
const name = styles2[i];
|
|
76458
76998
|
if (name.startsWith("mso-list:")) {
|
|
76459
76999
|
return name;
|
|
76460
77000
|
}
|
|
@@ -76463,9 +77003,9 @@ ${docStr}
|
|
|
76463
77003
|
}
|
|
76464
77004
|
function getLevel(elem) {
|
|
76465
77005
|
var _a, _b;
|
|
76466
|
-
const
|
|
76467
|
-
for (let i = 0; i <
|
|
76468
|
-
const name =
|
|
77006
|
+
const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
|
|
77007
|
+
for (let i = 0; i < styles2.length; i++) {
|
|
77008
|
+
const name = styles2[i];
|
|
76469
77009
|
if (name.startsWith("level")) {
|
|
76470
77010
|
const level = (_b = Number.parseInt(name.substring(5), 10)) != null ? _b : void 0;
|
|
76471
77011
|
if (level) {
|
|
@@ -80069,6 +80609,8 @@ ${docStr}
|
|
|
80069
80609
|
}
|
|
80070
80610
|
onUpdateComment() {
|
|
80071
80611
|
}
|
|
80612
|
+
onUpdateCommentResolver(commentId, local) {
|
|
80613
|
+
}
|
|
80072
80614
|
}
|
|
80073
80615
|
async function playHistoryData(doc2, versionHelper, historyData) {
|
|
80074
80616
|
for (const data2 of historyData) {
|
|
@@ -85011,7 +85553,7 @@ ${data2.flowchartText}
|
|
|
85011
85553
|
};
|
|
85012
85554
|
const drawioIframeUrl = "https://embed.diagrams.net/?embed=1";
|
|
85013
85555
|
const DrawioJsUrl = "https://www.draw.io/embed.js";
|
|
85014
|
-
const PakoJsUrl = "https://cdn.jsdelivr.net/npm/pako@2.0.3/dist/pako.es5.
|
|
85556
|
+
const PakoJsUrl = "https://cdn.jsdelivr.net/npm/pako@2.0.3/dist/pako.es5.js";
|
|
85015
85557
|
const EmptyIcon = '<svg width="48" height="49" viewBox="0 0 48 49" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="27" y="18.5" width="18" height="9" stroke="#C7C7C7" stroke-width="3"/>\n<rect x="12" y="18.5" width="9" height="9" transform="rotate(45 12 18.5)" stroke="#C7C7C7" stroke-width="3"/>\n<rect x="27" y="36.5" width="18" height="9" stroke="#C7C7C7" stroke-width="3"/>\n<path d="M27 24.5L18 24.5" stroke="#C7C7C7" stroke-width="3"/>\n<path d="M28.5 41H18" stroke="#C7C7C7" stroke-width="3"/>\n<path d="M18 41H12L12 30.5" stroke="#C7C7C7" stroke-width="3"/>\n<path d="M12 21.5L12 12.5" stroke="#C7C7C7" stroke-width="3"/>\n<rect x="7.5" y="3.5" width="9" height="9" rx="4.5" stroke="#C7C7C7" stroke-width="3"/>\n</svg>\n';
|
|
85016
85558
|
const DEFAULT_STYLES = `
|
|
85017
85559
|
<mxStylesheet>
|
|
@@ -85433,7 +85975,7 @@ ${data2.flowchartText}
|
|
|
85433
85975
|
async function initDrawIo(editor) {
|
|
85434
85976
|
var _a, _b;
|
|
85435
85977
|
const option = getDrawioOptions(editor);
|
|
85436
|
-
const drawIoUrl = ((_a = option.cdn) == null ? void 0 : _a.
|
|
85978
|
+
const drawIoUrl = ((_a = option.cdn) == null ? void 0 : _a.drawio) || DrawioJsUrl;
|
|
85437
85979
|
const pakoUrl = ((_b = option.cdn) == null ? void 0 : _b.pako) || PakoJsUrl;
|
|
85438
85980
|
await loadJsPromise(pakoUrl, "editor-pako");
|
|
85439
85981
|
await loadJsPromise(drawIoUrl, "editor-drawio");
|
|
@@ -90231,6 +90773,9 @@ ${data2.plantumlText}
|
|
|
90231
90773
|
localUpdateComment(comment, doc2) {
|
|
90232
90774
|
this.doc.localUpdateComment(comment, doc2);
|
|
90233
90775
|
}
|
|
90776
|
+
localUpdateCommentResolver(commentId, resolver) {
|
|
90777
|
+
this.doc.localUpdateCommentResolver(commentId, resolver);
|
|
90778
|
+
}
|
|
90234
90779
|
onCreateComment(commentId, local) {
|
|
90235
90780
|
Array.from(this.listeners.values()).forEach((listener) => listener.onCreateComment(commentId, local));
|
|
90236
90781
|
}
|
|
@@ -90240,6 +90785,9 @@ ${data2.plantumlText}
|
|
|
90240
90785
|
onUpdateComment(commentId, local) {
|
|
90241
90786
|
Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateComment(commentId, local));
|
|
90242
90787
|
}
|
|
90788
|
+
onUpdateCommentResolver(commentId, local) {
|
|
90789
|
+
Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, local));
|
|
90790
|
+
}
|
|
90243
90791
|
addListener(callback) {
|
|
90244
90792
|
this.listeners.add(callback);
|
|
90245
90793
|
}
|
|
@@ -90322,6 +90870,13 @@ ${data2.plantumlText}
|
|
|
90322
90870
|
this._doc.comments[id] = shareDBComment;
|
|
90323
90871
|
Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateComment(id, true));
|
|
90324
90872
|
}
|
|
90873
|
+
localUpdateCommentResolver(commentId, resolver) {
|
|
90874
|
+
const comment = this.getComment(commentId);
|
|
90875
|
+
if (comment) {
|
|
90876
|
+
comment.resolver = resolver;
|
|
90877
|
+
this.localUpdateComment(comment, this.getCommentDoc(commentId));
|
|
90878
|
+
}
|
|
90879
|
+
}
|
|
90325
90880
|
createCommentEditor(parent, childDoc) {
|
|
90326
90881
|
const commentEditor = createCommentEditor(this.editor, {
|
|
90327
90882
|
root: parent,
|
|
@@ -91059,8 +91614,8 @@ ${data2.plantumlText}
|
|
|
91059
91614
|
const inlineStyles = attributesOfText(text2, "inlineStyle");
|
|
91060
91615
|
if (inlineStyles == null)
|
|
91061
91616
|
return;
|
|
91062
|
-
const
|
|
91063
|
-
for (const style2 of
|
|
91617
|
+
const styles2 = inlineStyles.split(";");
|
|
91618
|
+
for (const style2 of styles2) {
|
|
91064
91619
|
const pair = style2.split(":");
|
|
91065
91620
|
if (pair.length !== 2)
|
|
91066
91621
|
continue;
|
|
@@ -93113,7 +93668,7 @@ ${data2.plantumlText}
|
|
|
93113
93668
|
}
|
|
93114
93669
|
}
|
|
93115
93670
|
});
|
|
93116
|
-
editor.version = "2.8.
|
|
93671
|
+
editor.version = "2.8.25-beta.1";
|
|
93117
93672
|
return editor;
|
|
93118
93673
|
}
|
|
93119
93674
|
function isDoc(doc2) {
|
|
@@ -93226,7 +93781,7 @@ ${data2.plantumlText}
|
|
|
93226
93781
|
}
|
|
93227
93782
|
});
|
|
93228
93783
|
OnesEditorToolbar.register(editor);
|
|
93229
|
-
editor.version = "2.8.
|
|
93784
|
+
editor.version = "2.8.25-beta.1";
|
|
93230
93785
|
return editor;
|
|
93231
93786
|
}
|
|
93232
93787
|
async function showDocVersions(editor, options, serverUrl) {
|