@ones-editor/editor 2.8.27 → 2.8.28-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.
Files changed (42) hide show
  1. package/@ones-editor/comments/src/comments/comments.d.ts +4 -0
  2. package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +3 -1
  3. package/@ones-editor/comments/src/comments-helper/get-comment-from-selection.d.ts +3 -0
  4. package/@ones-editor/comments/src/comments-helper/get-comments-from-doc.d.ts +5 -1
  5. package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +2 -1
  6. package/@ones-editor/comments/src/comments-list/comments-list.d.ts +11 -1
  7. package/@ones-editor/comments/src/comments-list/group-item.d.ts +2 -0
  8. package/@ones-editor/comments/src/comments-list/group-list.d.ts +7 -2
  9. package/@ones-editor/comments/src/comments-list/handler.d.ts +2 -1
  10. package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -1
  11. package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -0
  12. package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +1 -0
  13. package/@ones-editor/comments/src/comments-render/get-block-comments.d.ts +5 -0
  14. package/@ones-editor/comments/src/comments-render/index.d.ts +10 -1
  15. package/@ones-editor/comments/src/constant/index.d.ts +2 -1
  16. package/@ones-editor/comments/src/index.d.ts +1 -0
  17. package/@ones-editor/comments/src/locale/en-us.d.ts +7 -0
  18. package/@ones-editor/comments/src/locale/ja-jp.d.ts +7 -0
  19. package/@ones-editor/comments/src/locale/zh-cn.d.ts +7 -0
  20. package/@ones-editor/comments/src/resolved-comments/index.d.ts +4 -0
  21. package/@ones-editor/comments/src/resolved-comments/resolved-comment-editor.d.ts +14 -0
  22. package/@ones-editor/comments/src/resolved-comments/resolved-comment-list.d.ts +4 -0
  23. package/@ones-editor/comments/src/types.d.ts +6 -1
  24. package/@ones-editor/core/src/core/block-renderers/block-renderers.d.ts +1 -0
  25. package/@ones-editor/core/src/core/composition/editor-input.d.ts +2 -0
  26. package/@ones-editor/core/src/core/doc/doc.d.ts +9 -0
  27. package/@ones-editor/core/src/core/types.d.ts +3 -0
  28. package/@ones-editor/core/src/local-doc/index.d.ts +1 -0
  29. package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +2 -1
  30. package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +2 -1
  31. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +3 -1
  32. package/@ones-editor/sharedb-doc/src/types.d.ts +1 -0
  33. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  34. package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +1 -0
  35. package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
  36. package/@ones-editor/versions/src/version-dialog/history-handler.d.ts +1 -0
  37. package/dist/comments/local-doc-comments-provider.d.ts +2 -1
  38. package/dist/comments/sharedb-doc-comments-provider.d.ts +3 -1
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +876 -147
  41. package/dist/types.d.ts +2 -0
  42. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4116,6 +4116,7 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4116
4116
  .comment-item-root .item-head-tools {
4117
4117
  display: flex;
4118
4118
  align-items: center;
4119
+ justify-content: center;
4119
4120
  visibility: hidden;
4120
4121
  }
4121
4122
  .comment-item-root .item-head-tools .editor-text-button {
@@ -4125,8 +4126,8 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4125
4126
  color: #0064ff;
4126
4127
  }
4127
4128
  .comment-item-root .item-head-tools .editor-text-button svg {
4128
- width: 20px;
4129
- height: 20px;
4129
+ width: 16px;
4130
+ height: 16px;
4130
4131
  }
4131
4132
  .comment-item-root .item-head-tools.active {
4132
4133
  visibility: visible;
@@ -4319,6 +4320,36 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4319
4320
  will-change: width;
4320
4321
  font-family: var(--editor-font-family);
4321
4322
  }
4323
+ .editor-web-comment-root.disable-resolve .comment-groups-container .item-head-switch .editor-text-button[data-button-id=resolve] {
4324
+ display: none;
4325
+ }
4326
+ .editor-web-comment-root.disable-resolve .comment-groups-container .comment-actions button.comment-reopen {
4327
+ display: none;
4328
+ }
4329
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container {
4330
+ display: flex;
4331
+ flex-direction: column;
4332
+ gap: 20px;
4333
+ padding-left: 8px;
4334
+ padding-top: 60px;
4335
+ }
4336
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-no-resolved-tip {
4337
+ font-size: 12px;
4338
+ width: 100%;
4339
+ color: #BEBFC2;
4340
+ display: flex;
4341
+ justify-content: center;
4342
+ align-items: center;
4343
+ margin-top: 100px;
4344
+ }
4345
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-group-item-root {
4346
+ position: inherit;
4347
+ transform: none;
4348
+ }
4349
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-group-item-root::before {
4350
+ left: 8px;
4351
+ right: 8px;
4352
+ }
4322
4353
  .editor-web-comment-root .comment-groups-container .comment-group-item-root {
4323
4354
  position: absolute;
4324
4355
  left: 50%;
@@ -4332,8 +4363,17 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4332
4363
  box-shadow: var(--editor-box-shadow);
4333
4364
  padding-bottom: 10px;
4334
4365
  }
4366
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .comment-item-head .item-head-switch {
4367
+ display: none;
4368
+ }
4369
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .item-head-tools {
4370
+ display: none;
4371
+ }
4372
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .comment-quick-reply {
4373
+ display: none;
4374
+ }
4335
4375
  .editor-web-comment-root .comment-groups-container .comment-group-item-root:not(.no-animation) {
4336
- transition: top 0.2s ease-in, opacity 0.35s ease-in;
4376
+ transition: top 0.2s ease-in, opacity 0.2s ease-in;
4337
4377
  }
4338
4378
  .editor-web-comment-root .comment-groups-container .comment-group-item-root::before {
4339
4379
  content: "";
@@ -4380,16 +4420,23 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4380
4420
  display: flex;
4381
4421
  align-items: center;
4382
4422
  height: 22px;
4383
- visibility: hidden;
4384
4423
  }
4385
4424
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button {
4386
4425
  padding: 0;
4387
4426
  width: var(--editor-comment-switch-button-width);
4388
- margin: 3px 0;
4427
+ margin-right: 5px;
4389
4428
  color: #606060;
4429
+ width: 16px;
4430
+ height: 16px;
4390
4431
  }
4391
4432
  .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
- margin-right: 16px;
4433
+ visibility: hidden;
4434
+ }
4435
+ .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] {
4436
+ visibility: hidden;
4437
+ }
4438
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=resolve] {
4439
+ margin-right: 0;
4393
4440
  }
4394
4441
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button:not(.disabled):hover {
4395
4442
  color: var(--text-button-color-hover);
@@ -4398,15 +4445,57 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4398
4445
  color: rgba(96, 96, 96, 0.5019607843);
4399
4446
  cursor: not-allowed;
4400
4447
  }
4448
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer {
4449
+ font-size: 12px;
4450
+ line-height: 20px;
4451
+ color: #87888A;
4452
+ margin-top: 10px;
4453
+ }
4454
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions {
4455
+ display: flex;
4456
+ align-items: center;
4457
+ }
4458
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-date {
4459
+ flex: 1;
4460
+ white-space: nowrap;
4461
+ }
4462
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .removed-tips {
4463
+ color: #87888A;
4464
+ white-space: nowrap;
4465
+ text-overflow: ellipsis;
4466
+ overflow: hidden;
4467
+ margin-left: 10px;
4468
+ }
4469
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen {
4470
+ background: none;
4471
+ border: none;
4472
+ cursor: pointer;
4473
+ color: #575859;
4474
+ font-size: 12px;
4475
+ }
4476
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen:hover {
4477
+ color: #0064FF;
4478
+ }
4401
4479
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.active::before {
4402
4480
  background-color: #f59300;
4403
4481
  }
4404
- .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch {
4482
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-up] {
4483
+ visibility: visible;
4484
+ }
4485
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-down] {
4405
4486
  visibility: visible;
4406
4487
  }
4407
4488
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply .quick-reply-button.invisible {
4408
4489
  display: none;
4409
4490
  }
4491
+ .editor-web-comment-root .comment-switcher-container {
4492
+ position: absolute;
4493
+ z-index: 1;
4494
+ top: 0;
4495
+ left: 0;
4496
+ right: 0;
4497
+ font-size: 14px;
4498
+ }
4410
4499
  .editor-mobile-comments-root {
4411
4500
  position: fixed;
4412
4501
  left: 0;
@@ -4508,6 +4597,82 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4508
4597
  }
4509
4598
  :is(.editor-web-comment-root, .editor-mobile-comments-root, .editor-mini-comment-root).hidden {
4510
4599
  display: none;
4600
+ }.resolved-comment-list .resolved-comment-group-item-root {
4601
+ padding: 10px 20px;
4602
+ border-bottom: 1px solid #f0f0f0;
4603
+ margin-right: 10px;
4604
+ }
4605
+ .resolved-comment-list .resolved-comment-group-item-root .comment-group-head {
4606
+ margin-bottom: 5px;
4607
+ }
4608
+ .resolved-comment-list .resolved-comment-group-item-root .comment-group-head span {
4609
+ padding: 0 5px;
4610
+ display: inline-block;
4611
+ line-height: 2;
4612
+ background-color: #FFF0D9;
4613
+ }
4614
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container,
4615
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container {
4616
+ padding-left: 10px;
4617
+ }
4618
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root,
4619
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root {
4620
+ position: relative;
4621
+ }
4622
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:not(.no-children)::before,
4623
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root:not(.no-children)::before {
4624
+ content: " ";
4625
+ display: block;
4626
+ position: absolute;
4627
+ left: 10px;
4628
+ width: 1px;
4629
+ background-color: #DFE1E5;
4630
+ overflow: hidden;
4631
+ opacity: 0.8;
4632
+ top: 21px;
4633
+ bottom: -12px;
4634
+ transform: scaleX(0.5);
4635
+ }
4636
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head,
4637
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head {
4638
+ padding: 0;
4639
+ position: relative;
4640
+ display: flex;
4641
+ align-items: center;
4642
+ }
4643
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-avatar,
4644
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-avatar {
4645
+ margin-right: 5px;
4646
+ width: var(--editor-comment-avatar-width, 22px);
4647
+ height: var(--editor-comment-avatar-width, 22px);
4648
+ border-radius: 100%;
4649
+ }
4650
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-username,
4651
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-username {
4652
+ font-size: var(--editor-comment-username-font-size, 12px);
4653
+ color: #2d2d2e;
4654
+ overflow: hidden;
4655
+ text-overflow: ellipsis;
4656
+ white-space: nowrap;
4657
+ }
4658
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-modified,
4659
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-modified {
4660
+ margin-left: 10px;
4661
+ font-size: 12px;
4662
+ color: #87888a;
4663
+ flex-grow: 1;
4664
+ white-space: nowrap;
4665
+ }
4666
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-editor,
4667
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-editor {
4668
+ border: none;
4669
+ padding-top: 0;
4670
+ margin-top: 0;
4671
+ padding-left: 10px;
4672
+ margin-left: 0;
4673
+ }
4674
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:last-child::before {
4675
+ display: none;
4511
4676
  }div[data-type=editor-block].table-block {
4512
4677
  --table-bar-width: 6px;
4513
4678
  --table-bar-left: -6px;
@@ -9207,22 +9372,22 @@ var __publicField = (obj, key, value) => {
9207
9372
  function toFloat(value) {
9208
9373
  return parseFloat(value) || 0;
9209
9374
  }
9210
- function getBordersSize(styles) {
9375
+ function getBordersSize(styles2) {
9211
9376
  var positions = [];
9212
9377
  for (var _i = 1; _i < arguments.length; _i++) {
9213
9378
  positions[_i - 1] = arguments[_i];
9214
9379
  }
9215
9380
  return positions.reduce(function(size, position) {
9216
- var value = styles["border-" + position + "-width"];
9381
+ var value = styles2["border-" + position + "-width"];
9217
9382
  return size + toFloat(value);
9218
9383
  }, 0);
9219
9384
  }
9220
- function getPaddings(styles) {
9385
+ function getPaddings(styles2) {
9221
9386
  var positions = ["top", "right", "bottom", "left"];
9222
9387
  var paddings = {};
9223
9388
  for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
9224
9389
  var position = positions_1[_i];
9225
- var value = styles["padding-" + position];
9390
+ var value = styles2["padding-" + position];
9226
9391
  paddings[position] = toFloat(value);
9227
9392
  }
9228
9393
  return paddings;
@@ -9236,17 +9401,17 @@ var __publicField = (obj, key, value) => {
9236
9401
  if (!clientWidth && !clientHeight) {
9237
9402
  return emptyRect;
9238
9403
  }
9239
- var styles = getWindowOf(target).getComputedStyle(target);
9240
- var paddings = getPaddings(styles);
9404
+ var styles2 = getWindowOf(target).getComputedStyle(target);
9405
+ var paddings = getPaddings(styles2);
9241
9406
  var horizPad = paddings.left + paddings.right;
9242
9407
  var vertPad = paddings.top + paddings.bottom;
9243
- var width = toFloat(styles.width), height = toFloat(styles.height);
9244
- if (styles.boxSizing === "border-box") {
9408
+ var width = toFloat(styles2.width), height = toFloat(styles2.height);
9409
+ if (styles2.boxSizing === "border-box") {
9245
9410
  if (Math.round(width + horizPad) !== clientWidth) {
9246
- width -= getBordersSize(styles, "left", "right") + horizPad;
9411
+ width -= getBordersSize(styles2, "left", "right") + horizPad;
9247
9412
  }
9248
9413
  if (Math.round(height + vertPad) !== clientHeight) {
9249
- height -= getBordersSize(styles, "top", "bottom") + vertPad;
9414
+ height -= getBordersSize(styles2, "top", "bottom") + vertPad;
9250
9415
  }
9251
9416
  }
9252
9417
  if (!isDocumentElement(target)) {
@@ -9901,8 +10066,8 @@ var __publicField = (obj, key, value) => {
9901
10066
  el.setAttribute(key, value);
9902
10067
  });
9903
10068
  }
9904
- function setStyles(el, styles) {
9905
- Object.entries(styles).forEach(([key, value]) => {
10069
+ function setStyles(el, styles2) {
10070
+ Object.entries(styles2).forEach(([key, value]) => {
9906
10071
  el.style.setProperty(key, value);
9907
10072
  });
9908
10073
  }
@@ -12322,12 +12487,12 @@ var __publicField = (obj, key, value) => {
12322
12487
  return blockClass.getBlockStyles(editor, block);
12323
12488
  }
12324
12489
  const data2 = editor.getBlockData(block);
12325
- const styles = Object.fromEntries(Object.entries(data2).filter(([key]) => key.startsWith("style-")));
12326
- Object.entries(styles).forEach(([, value]) => {
12490
+ const styles2 = Object.fromEntries(Object.entries(data2).filter(([key]) => key.startsWith("style-")));
12491
+ Object.entries(styles2).forEach(([, value]) => {
12327
12492
  const type = typeof value;
12328
12493
  assert(logger$4C, type === "string" || type === "number" || type === "boolean", "invalid style value");
12329
12494
  });
12330
- return styles;
12495
+ return styles2;
12331
12496
  }
12332
12497
  function getContainerWidth(container, options) {
12333
12498
  const ret = container.getBoundingClientRect().width;
@@ -24916,7 +25081,7 @@ var __publicField = (obj, key, value) => {
24916
25081
  if (attributes) {
24917
25082
  let string = op.insert;
24918
25083
  const tags = [];
24919
- let styles = "";
25084
+ let styles2 = "";
24920
25085
  if (attributes["style-bold"]) {
24921
25086
  tags.push("strong");
24922
25087
  }
@@ -24934,25 +25099,25 @@ var __publicField = (obj, key, value) => {
24934
25099
  }
24935
25100
  const fontBgColor = Object.keys(attributes).find((k) => k.startsWith("style-bg-color-"));
24936
25101
  if (fontBgColor) {
24937
- styles += `background-color: ${styleBackgroundColorToHighlight$1(fontBgColor)};`;
25102
+ styles2 += `background-color: ${styleBackgroundColorToHighlight$1(fontBgColor)};`;
24938
25103
  }
24939
25104
  const fontColor = Object.keys(attributes).find((k) => k.startsWith("style-color-"));
24940
25105
  if (fontColor) {
24941
- styles += `color: ${styleColorToColor$1(fontColor)};`;
25106
+ styles2 += `color: ${styleColorToColor$1(fontColor)};`;
24942
25107
  }
24943
25108
  if (attributes.link) {
24944
25109
  string = `<a href="${attributes.link}">${string}</a>`;
24945
25110
  }
24946
25111
  let prefix = tags.map((s) => `<${s}>`).join("");
24947
25112
  let suffix = tags.reverse().map((s) => `</${s}>`).join("");
24948
- if (styles) {
25113
+ if (styles2) {
24949
25114
  if (attributes.link) {
24950
- string = `<a href="${attributes.link}" style="${styles}">${op.insert}</a>`;
25115
+ string = `<a href="${attributes.link}" style="${styles2}">${op.insert}</a>`;
24951
25116
  } else {
24952
25117
  if (prefix) {
24953
- prefix = prefix.replace(">", ` style="${styles}">`);
25118
+ prefix = prefix.replace(">", ` style="${styles2}">`);
24954
25119
  } else {
24955
- prefix = `<span style="${styles}">`;
25120
+ prefix = `<span style="${styles2}">`;
24956
25121
  suffix = "</span>";
24957
25122
  }
24958
25123
  }
@@ -25395,6 +25560,9 @@ var __publicField = (obj, key, value) => {
25395
25560
  __publicField(this, "renders", []);
25396
25561
  this.editor = editor;
25397
25562
  }
25563
+ getRenderers() {
25564
+ return this.renders;
25565
+ }
25398
25566
  registerRender(render) {
25399
25567
  this.renders.push(render);
25400
25568
  }
@@ -25632,8 +25800,8 @@ var __publicField = (obj, key, value) => {
25632
25800
  renderBlock(editor, path, blockData) {
25633
25801
  var _a, _b;
25634
25802
  const attributes = {};
25635
- const styles = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
25636
- styles.forEach(([key, value]) => {
25803
+ const styles2 = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
25804
+ styles2.forEach(([key, value]) => {
25637
25805
  attributes[`data-${key}`] = `${value}`;
25638
25806
  });
25639
25807
  const classes = [];
@@ -25840,6 +26008,7 @@ var __publicField = (obj, key, value) => {
25840
26008
  constructor(editor, callbacks) {
25841
26009
  __publicField(this, "editor");
25842
26010
  __publicField(this, "composing", false);
26011
+ __publicField(this, "composingTimer");
25843
26012
  __publicField(this, "callbacks");
25844
26013
  __publicField(this, "inputElement");
25845
26014
  __publicField(this, "handleBlur", () => {
@@ -25899,12 +26068,13 @@ var __publicField = (obj, key, value) => {
25899
26068
  if (!this.editor.isWritable()) {
25900
26069
  return;
25901
26070
  }
26071
+ clearTimeout(this.composingTimer);
25902
26072
  this.composing = true;
25903
26073
  this.callbacks.onCompositionStart(event);
25904
26074
  });
25905
26075
  __publicField(this, "handleCompositionend", (event) => {
25906
26076
  if (isSafari()) {
25907
- setTimeout(() => {
26077
+ this.composingTimer = setTimeout(() => {
25908
26078
  this.composing = false;
25909
26079
  }, 100);
25910
26080
  } else {
@@ -31604,7 +31774,7 @@ ${codeText}
31604
31774
  const logger$38 = getLogger("editor");
31605
31775
  class Editor extends tinyTypedEmitter.TypedEmitter {
31606
31776
  constructor(parent, doc2, optionalOptions) {
31607
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
31777
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
31608
31778
  super();
31609
31779
  __publicField(this, "parent");
31610
31780
  __publicField(this, "rootElement");
@@ -31650,12 +31820,13 @@ ${codeText}
31650
31820
  componentsOptions: (_c = (_b = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _b.options) != null ? _c : {},
31651
31821
  scrollContainer: optionalOptions == null ? void 0 : optionalOptions.scrollContainer,
31652
31822
  enableComments: (_d = optionalOptions == null ? void 0 : optionalOptions.enableComments) != null ? _d : true,
31653
- enableContextMenu: (_e = optionalOptions == null ? void 0 : optionalOptions.enableContextMenu) != null ? _e : true
31823
+ enableResolveComments: (_e = optionalOptions == null ? void 0 : optionalOptions.enableResolveComments) != null ? _e : true,
31824
+ enableContextMenu: (_f = optionalOptions == null ? void 0 : optionalOptions.enableContextMenu) != null ? _f : true
31654
31825
  };
31655
- this.settingsProvider = (_f = optionalOptions == null ? void 0 : optionalOptions.settingsProvider) != null ? _f : new DefaultSettingsProvider(this);
31826
+ this.settingsProvider = (_g = optionalOptions == null ? void 0 : optionalOptions.settingsProvider) != null ? _g : new DefaultSettingsProvider(this);
31656
31827
  registerComponents(this, optionalOptions == null ? void 0 : optionalOptions.components);
31657
- this.blockHooks.push(...(_h = (_g = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _g.blockHooks) != null ? _h : []);
31658
- this.id = (_i = optionalOptions == null ? void 0 : optionalOptions.id) != null ? _i : genId();
31828
+ this.blockHooks.push(...(_i = (_h = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _h.blockHooks) != null ? _i : []);
31829
+ this.id = (_j = optionalOptions == null ? void 0 : optionalOptions.id) != null ? _j : genId();
31659
31830
  this.clientId = genId();
31660
31831
  this.undoManager = new UndoManager(this);
31661
31832
  this.doc = new EditorDoc(this, doc2, this.undoManager);
@@ -32141,6 +32312,9 @@ ${codeText}
32141
32312
  toJSON() {
32142
32313
  return cloneDeep__default.default(this.doc);
32143
32314
  }
32315
+ rawData() {
32316
+ return this.doc;
32317
+ }
32144
32318
  getContainerBlocks(containerId) {
32145
32319
  const blocks = this.doc.blocks[containerId];
32146
32320
  return blocks;
@@ -38661,6 +38835,12 @@ ${codeText}
38661
38835
  commentId
38662
38836
  });
38663
38837
  }
38838
+ onUpdateCommentResolver(commentId) {
38839
+ this.pushActions({
38840
+ type: "updateCommentResolved",
38841
+ commentId
38842
+ });
38843
+ }
38664
38844
  end() {
38665
38845
  const actions2 = this.actions;
38666
38846
  const deletedBlocks = /* @__PURE__ */ new Set();
@@ -38735,6 +38915,9 @@ ${codeText}
38735
38915
  } else if (action.type === "updateComment") {
38736
38916
  const a = action;
38737
38917
  this.outerHandler.onUpdateComment(a.commentId, this.local);
38918
+ } else if (action.type === "updateCommentResolved") {
38919
+ const a = action;
38920
+ this.outerHandler.onUpdateCommentResolver(a.commentId, this.local);
38738
38921
  }
38739
38922
  });
38740
38923
  Array.from(updatingBlockDataDeltaMap.entries()).forEach(([blockId, objectData]) => {
@@ -38912,7 +39095,14 @@ ${codeText}
38912
39095
  assert(logger$2W, commentId, `invalid comment op, no commentId: ${JSON.stringify(ops)}`);
38913
39096
  assert(logger$2W, actions2, `invalid comment op, no actions: ${JSON.stringify(ops)}`);
38914
39097
  if (typeof actions2 === "string") {
38915
- logger$2W.error(`unknown comment op, ${JSON.stringify(ops)}`);
39098
+ const data2 = ops[3];
39099
+ if (actions2 === "resolver" && typeof data2 === "object") {
39100
+ if (parseType === "upsert") {
39101
+ handler.onUpdateCommentResolver(commentId);
39102
+ }
39103
+ } else {
39104
+ logger$2W.error(`unknown comment op, ${JSON.stringify(ops)}`);
39105
+ }
38916
39106
  } else {
38917
39107
  if (actions2.i && actions2.r) {
38918
39108
  if (parseType === "upsert") {
@@ -39022,7 +39212,8 @@ ${codeText}
39022
39212
  avatarUrl,
39023
39213
  abstract,
39024
39214
  created,
39025
- modified
39215
+ modified,
39216
+ resolver: resolved
39026
39217
  } = shareDBComment;
39027
39218
  return {
39028
39219
  id,
@@ -39032,7 +39223,8 @@ ${codeText}
39032
39223
  avatarUrl,
39033
39224
  abstract,
39034
39225
  created,
39035
- modified
39226
+ modified,
39227
+ resolver: resolved
39036
39228
  };
39037
39229
  }
39038
39230
  function commentToShareDbComment(comment, doc2) {
@@ -39504,6 +39696,21 @@ ${codeText}
39504
39696
  const op = ["comments", comment.id, { r: true, i: shareDBComment }];
39505
39697
  return this.submitOp(op);
39506
39698
  }
39699
+ localUpdateCommentResolver(commentId, resolver) {
39700
+ const oldComment = this.getComment(commentId);
39701
+ const oldResolved = oldComment.resolver;
39702
+ const op = ["comments", commentId, "resolver", {}];
39703
+ if (!oldResolved && !resolver) {
39704
+ return Promise.resolve(true);
39705
+ }
39706
+ if (oldResolved !== void 0) {
39707
+ op[3] = { r: true };
39708
+ }
39709
+ if (resolver) {
39710
+ op[3].i = resolver;
39711
+ }
39712
+ return this.submitOp(op);
39713
+ }
39507
39714
  destroy() {
39508
39715
  var _a;
39509
39716
  this.destroyed = true;
@@ -39580,6 +39787,13 @@ ${codeText}
39580
39787
  return (_a = cb.onUpdateComment) == null ? void 0 : _a.call(cb, commentId, local);
39581
39788
  });
39582
39789
  }
39790
+ onUpdateCommentResolver(commentId, local) {
39791
+ assert(logger$2T, this.callbacks.length > 0, "no callbacks");
39792
+ this.callbacks.forEach((cb) => {
39793
+ var _a;
39794
+ return (_a = cb.onUpdateCommentResolver) == null ? void 0 : _a.call(cb, commentId, local);
39795
+ });
39796
+ }
39583
39797
  onCustomMessage(msg) {
39584
39798
  const message = msg;
39585
39799
  if ((message == null ? void 0 : message.type) === "custom" && (message == null ? void 0 : message.clientId) !== this.client.clientId) {
@@ -40609,6 +40823,7 @@ ${codeText}
40609
40823
  const RefreshIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M15.3498 7.51663L12.9692 9.49971L10.5902 7.51663" stroke="currentColor"/>\n<path d="M12.811 9.5C12.9344 9.02057 13 8.51795 13 8C13 4.68629 10.3137 2 7 2C3.68629 2 1 4.68629 1 8C1 11.3137 3.68629 14 7 14C8.39546 14 9.67966 13.5236 10.6988 12.7246" stroke="currentColor"/>\n</svg>';
40610
40824
  const HelpIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M15 8C15 11.8659 11.8659 15 8 15C4.13408 15 1 11.8659 1 8C1 4.13408 4.13408 1 8 1C11.8659 1 15 4.13408 15 8Z" stroke="currentColor"/>\n<path d="M6 6.41815C6 5.81984 6.55057 4.52136 7.98652 4.52136C9.24198 4.52136 10 5.42027 10 6.41815C10 7.24315 9.34611 7.76435 8.89738 8.21308C7.99992 9.11055 7.99992 10.0001 7.99992 10.0001" stroke="currentColor"/>\n<path d="M8 11V13" stroke="currentColor"/>\n</svg>\n';
40611
40825
  const CheckMarkIcon = '<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" stroke-width="2">\n <path d="m1 7.4 1.497-1.498 3.861 3.86L12.85 2.45l1.498 1.497-6.491 7.312.005.007-.096.095-1.318 1.486L1 7.399Z" fill="currentColor" fill-rule="nonzero"></path>\n</svg>';
40826
+ const CircleCheckMarkIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10.9825 5.99158L7.19788 10.0128L5.30554 8.12045" stroke="currentColor" stroke-linejoin="round"/>\n<circle cx="8.03119" cy="7.99481" r="4.98883" stroke="currentColor"/>\n</svg>\n';
40612
40827
  const TextIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.5 4L2.5 1.5L13.5 1.5V4" stroke="currentColor" stroke-linejoin="round"/>\n<path d="M8 14.5V2" stroke="currentColor"/>\n<path d="M5 14.5H11" stroke="currentColor" stroke-linejoin="round"/>\n</svg>\n';
40613
40828
  const rightArrow = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.76573 4.17763L9.58809 7.99999L5.76573 11.8209" stroke="currentColor" stroke-width="2"/>\n</svg>\n';
40614
40829
  const BilibiliIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.3909 3.71427H11.8891C12.7699 3.74577 13.5043 4.05144 14.09 4.63244C14.6757 5.21285 14.979 5.94435 15 6.82577V11.1191C14.979 11.9999 14.6757 12.7344 14.09 13.32C13.5043 13.9057 12.7705 14.209 11.8891 14.23H4.11092C3.23008 14.209 2.49567 13.9057 1.91 13.32C1.32433 12.7344 1.021 12.0005 1 11.1191V6.82577C1.021 5.94435 1.32433 5.21285 1.91 4.63244C2.49567 4.05144 3.2295 3.74577 4.11092 3.71427H4.56242L3.87758 3.06094C3.80715 2.99237 3.75151 2.9101 3.71409 2.81921C3.67667 2.72831 3.65826 2.63072 3.66 2.53244C3.66 2.32477 3.73233 2.1486 3.87758 2.00335L3.89333 1.9876C4.04908 1.84235 4.22758 1.77002 4.43 1.77002C4.63242 1.77002 4.81092 1.84235 4.96667 1.9876L6.63092 3.59002C6.67233 3.63144 6.70908 3.67285 6.74 3.71427H9.22908C9.25335 3.66813 9.28486 3.62618 9.32242 3.59002L10.9867 1.9876C11.1424 1.84235 11.3209 1.77002 11.5233 1.77002C11.7258 1.77002 11.9095 1.8581 12.0652 2.00335C12.221 2.1486 12.2933 2.32477 12.2933 2.53244C12.2933 2.73952 12.221 2.91569 12.0757 3.06094L11.3909 3.71427ZM4.11092 5.22335C3.67575 5.23385 3.31 5.38435 3.01425 5.67427C2.71908 5.96477 2.56567 6.33344 2.55575 6.7791V11.1658C2.56567 11.6114 2.71908 11.9795 3.01425 12.27C3.31 12.5605 3.67575 12.711 4.11092 12.7209H11.8891C12.3242 12.711 12.69 12.5605 12.9858 12.27C13.2809 11.9795 13.4343 11.6114 13.4442 11.1658V6.7791C13.4343 6.33285 13.2809 5.96477 12.9858 5.67427C12.69 5.38435 12.3242 5.23385 11.8891 5.22335H4.11092ZM5.66667 7.4791C5.88425 7.4791 6.06567 7.55144 6.21092 7.69669C6.35675 7.84194 6.43433 8.0286 6.44425 8.25669V8.94094C6.43433 9.16902 6.35675 9.35569 6.21092 9.50094C6.06567 9.64677 5.88425 9.7191 5.66667 9.7191C5.44908 9.7191 5.26767 9.64619 5.12242 9.50094C4.97658 9.35569 4.899 9.16902 4.88908 8.94094V8.25669C4.88908 8.0391 4.96433 7.85477 5.11425 7.70427C5.26475 7.55435 5.44908 7.4791 5.66667 7.4791ZM10.3333 7.4791C10.5509 7.4791 10.7323 7.55144 10.8776 7.69669C11.0234 7.84194 11.101 8.0286 11.1109 8.25669V8.94094C11.101 9.16902 11.0234 9.35569 10.8776 9.50094C10.7323 9.64677 10.5509 9.7191 10.3333 9.7191C10.1157 9.7191 9.93433 9.64619 9.78908 9.50094C9.64325 9.35569 9.56567 9.16902 9.55575 8.94094V8.25669C9.56567 8.0286 9.64325 7.84194 9.78908 7.69669C9.93433 7.55144 10.1157 7.4791 10.3333 7.4791Z" fill="#07A3D7"/>\n</svg>\n';
@@ -40764,6 +40979,7 @@ ${codeText}
40764
40979
  RefreshIcon,
40765
40980
  HelpIcon,
40766
40981
  CheckMarkIcon,
40982
+ CircleCheckMarkIcon,
40767
40983
  TextIcon,
40768
40984
  RightArrowIcon: rightArrow,
40769
40985
  TencentVideoIcon,
@@ -50551,7 +50767,7 @@ ${codeText}
50551
50767
  });
50552
50768
  return !!ret;
50553
50769
  }
50554
- function addBlockClasses(from, to, styles) {
50770
+ function addBlockClasses(from, to, styles2) {
50555
50771
  const container = getParentContainer(from);
50556
50772
  if (to) {
50557
50773
  const container2 = getParentContainer(to);
@@ -50562,18 +50778,18 @@ ${codeText}
50562
50778
  const toIndex = getBlockIndex(to);
50563
50779
  assert(logger$24, fromIndex <= toIndex, "invalid block index");
50564
50780
  }
50565
- addClass(from, ...styles);
50781
+ addClass(from, ...styles2);
50566
50782
  if (!to || to === from) {
50567
50783
  return;
50568
50784
  }
50569
50785
  let next2 = getNextBlock(from);
50570
50786
  while (next2 !== to) {
50571
50787
  assert(logger$24, next2, "no next button");
50572
- addClass(next2, ...styles);
50788
+ addClass(next2, ...styles2);
50573
50789
  next2 = getNextBlock(next2);
50574
50790
  }
50575
50791
  if (next2) {
50576
- addClass(next2, ...styles);
50792
+ addClass(next2, ...styles2);
50577
50793
  }
50578
50794
  }
50579
50795
  async function requestMindmapFullscreen(editor, block, mindmapTools) {
@@ -51561,7 +51777,7 @@ ${codeText}
51561
51777
  html = `<input type="checkbox" disabled="disabled" /> ${html}`;
51562
51778
  }
51563
51779
  let listTag = "ul";
51564
- let styles = "";
51780
+ let styles2 = "";
51565
51781
  if (list2.ordered) {
51566
51782
  html = `<li value="${list2.start}">${html}</li>`;
51567
51783
  listTag = "ol";
@@ -51569,18 +51785,18 @@ ${codeText}
51569
51785
  case 2:
51570
51786
  case 5:
51571
51787
  case 8:
51572
- styles = "list-style-type: lower-alpha;";
51788
+ styles2 = "list-style-type: lower-alpha;";
51573
51789
  break;
51574
51790
  case 3:
51575
51791
  case 6:
51576
- styles = "list-style-type: lower-roman;";
51792
+ styles2 = "list-style-type: lower-roman;";
51577
51793
  break;
51578
51794
  }
51579
51795
  } else {
51580
51796
  html = `<li>${html}</li>`;
51581
51797
  }
51582
51798
  if (isFirstListItem(editor, blockData, doc2, path)) {
51583
- html = `<${listTag}${styles ? ` style="${styles}"` : ""}>${html}`;
51799
+ html = `<${listTag}${styles2 ? ` style="${styles2}"` : ""}>${html}`;
51584
51800
  }
51585
51801
  if (isLastListItem(editor, blockData, doc2, path)) {
51586
51802
  html = `${html}</${listTag}>`;
@@ -62396,13 +62612,13 @@ $$${mathData.mathjaxText}$$
62396
62612
  if (!op.attributes) {
62397
62613
  return /* @__PURE__ */ new Map();
62398
62614
  }
62399
- const styles = Object.entries(op.attributes).filter(([key]) => {
62615
+ const styles2 = Object.entries(op.attributes).filter(([key]) => {
62400
62616
  if (key.startsWith("style-")) {
62401
62617
  return true;
62402
62618
  }
62403
62619
  return false;
62404
62620
  });
62405
- return new Map(styles);
62621
+ return new Map(styles2);
62406
62622
  };
62407
62623
  if (text2.length === 0) {
62408
62624
  return /* @__PURE__ */ new Map();
@@ -62446,11 +62662,11 @@ $$${mathData.mathjaxText}$$
62446
62662
  if (getTextLength(text2) === 0) {
62447
62663
  return textStyles;
62448
62664
  }
62449
- let styles = getIntersectionStyles(text2);
62450
- styles = mergeActiveStyle(editor, styles);
62665
+ let styles2 = getIntersectionStyles(text2);
62666
+ styles2 = mergeActiveStyle(editor, styles2);
62451
62667
  function getTextStyle(item) {
62452
62668
  const { id, icon, desc, name } = item;
62453
- const value = styles.get(id);
62669
+ const value = styles2.get(id);
62454
62670
  if (value !== void 0) {
62455
62671
  return {
62456
62672
  id,
@@ -63046,6 +63262,7 @@ $$${mathData.mathjaxText}$$
63046
63262
  GroupItemActions2["QuickReply"] = "quick-reply";
63047
63263
  GroupItemActions2["QuickReplyOk"] = "quick-reply-ok";
63048
63264
  GroupItemActions2["QuickReplyCancel"] = "quick-reply-cancel";
63265
+ GroupItemActions2["Resolve"] = "resolve";
63049
63266
  return GroupItemActions2;
63050
63267
  })(GroupItemActions || {});
63051
63268
  const GROUP_ITEM_ACTION_MARK = "group-item-action";
@@ -63093,7 +63310,7 @@ $$${mathData.mathjaxText}$$
63093
63310
  return attributes.filter((attribute) => attribute.startsWith("comment-")).map((attribute) => attribute.replace("comment-", ""));
63094
63311
  }
63095
63312
  const logger$1G = getLogger("doc-comments");
63096
- function addBlockComments(doc2, block, result, resultSet) {
63313
+ function addBlockComments$1(doc2, block, result, resultSet) {
63097
63314
  if (block.comments) {
63098
63315
  const blockComments = block.comments;
63099
63316
  if (Array.isArray(blockComments)) {
@@ -63129,7 +63346,7 @@ $$${mathData.mathjaxText}$$
63129
63346
  children.forEach((childContainerId) => {
63130
63347
  const childBlocks = doc2.blocks[childContainerId];
63131
63348
  childBlocks.forEach((subBlock) => {
63132
- addBlockComments(doc2, subBlock, result, resultSet);
63349
+ addBlockComments$1(doc2, subBlock, result, resultSet);
63133
63350
  });
63134
63351
  });
63135
63352
  }
@@ -63137,7 +63354,7 @@ $$${mathData.mathjaxText}$$
63137
63354
  const result = [];
63138
63355
  const resultSet = /* @__PURE__ */ new Set();
63139
63356
  doc2.blocks.root.forEach((block) => {
63140
- addBlockComments(doc2, block, result, resultSet);
63357
+ addBlockComments$1(doc2, block, result, resultSet);
63141
63358
  });
63142
63359
  const resultMap = /* @__PURE__ */ new Map();
63143
63360
  result.forEach((commentId, index2) => resultMap.set(commentId, index2));
@@ -63193,6 +63410,26 @@ $$${mathData.mathjaxText}$$
63193
63410
  });
63194
63411
  return result;
63195
63412
  }
63413
+ function getUnresolvedCommentsGroupFromDoc(editor, commentsProvider) {
63414
+ return getCommentsGroupFromDoc(editor, commentsProvider).filter((group) => !group.resolver);
63415
+ }
63416
+ function getResolvedCommentsGroupFromDoc(editor, commentsProvider) {
63417
+ const doc2 = editor.doc.toJSON();
63418
+ const commentsMap = getCommentsFromDoc(doc2);
63419
+ const commentGroup = getCommentsGroup(commentsProvider.getComments());
63420
+ const result = commentGroup.filter((group) => group.resolver).sort((group1, group2) => {
63421
+ var _a, _b, _c, _d;
63422
+ const date1 = (_b = (_a = group1.resolver) == null ? void 0 : _a.date) != null ? _b : 0;
63423
+ const date2 = (_d = (_c = group2.resolver) == null ? void 0 : _c.date) != null ? _d : 0;
63424
+ return date2 - date1;
63425
+ });
63426
+ result.forEach((group) => {
63427
+ if (!commentsMap.has(group.id)) {
63428
+ group.removedFromDoc = true;
63429
+ }
63430
+ });
63431
+ return result;
63432
+ }
63196
63433
  function flattenCommentGroup(comment) {
63197
63434
  const { children, ...raw } = comment;
63198
63435
  const comments = [raw];
@@ -63249,6 +63486,18 @@ $$${mathData.mathjaxText}$$
63249
63486
  const commentIds = intersection__default.default(comments1, comments2);
63250
63487
  return commentIds;
63251
63488
  }
63489
+ function removeUnresolvedComments(commentProvider, commentIds) {
63490
+ return commentIds.filter((commentId) => {
63491
+ const comment = commentProvider.getComment(commentId);
63492
+ return !!comment.resolver;
63493
+ });
63494
+ }
63495
+ function removeResolvedComments(commentProvider, commentIds) {
63496
+ return commentIds.filter((commentId) => {
63497
+ const comment = commentProvider.getComment(commentId);
63498
+ return !(comment == null ? void 0 : comment.resolver);
63499
+ });
63500
+ }
63252
63501
  const logger$1F = getLogger("active-comments");
63253
63502
  function inactiveComment(editor, commentId) {
63254
63503
  const activeCommentElements = editor.rootContainer.querySelectorAll(`span.comment[comment-${commentId}],[data-type=editor-block].comment[comment-${commentId}]`);
@@ -63304,6 +63553,11 @@ $$${mathData.mathjaxText}$$
63304
63553
  }
63305
63554
  }
63306
63555
  }
63556
+ function getElementsByCommentId(editor, commentId) {
63557
+ const lowerCommentId = commentId.toLocaleLowerCase();
63558
+ const elements = editor.rootContainer.querySelectorAll(`span.comment[comment-${lowerCommentId}],[data-type=editor-block].comment[comment-${lowerCommentId}]`);
63559
+ return Array.from(elements);
63560
+ }
63307
63561
  function isImageBlock(block) {
63308
63562
  return getBlockType(block) === "embed" && getEmbedType(block) === "image";
63309
63563
  }
@@ -69036,8 +69290,9 @@ ${codeText}
69036
69290
  return items;
69037
69291
  }
69038
69292
  reloadList(data2) {
69293
+ this._items.forEach((item) => item.destroy());
69039
69294
  this.container.innerHTML = "";
69040
- this.createList(data2);
69295
+ this._items = this.createList(data2);
69041
69296
  }
69042
69297
  insertItem(data2) {
69043
69298
  const index2 = this.findInsertPos(data2);
@@ -69110,8 +69365,8 @@ ${codeText}
69110
69365
  });
69111
69366
  }
69112
69367
  }
69113
- const switchUpIcon = '<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.00218 11.0005L8.00341 4.99923L14.0046 11.0005" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>\n</svg>';
69114
- const switchDownIcon = '<svg width="17" height="16" viewBox="0 0 17 16" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0029 4.99933L8.00172 11.0006L2.00049 4.99933" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>\n</svg>';
69368
+ const switchUpIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.17757 10.2343L7.99993 6.41191L11.8208 10.2343" stroke="currentColor"/>\n</svg>\n';
69369
+ const switchDownIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M4.17757 5.76573L7.99993 9.58809L11.8208 5.76573" stroke="currentColor"/>\n</svg>\n';
69115
69370
  const index$8 = "";
69116
69371
  const REPLY_EDITOR_EDITING_CLS = "reply-editor-editing";
69117
69372
  const { t: t$3 } = i18n$1;
@@ -69234,6 +69489,9 @@ ${codeText}
69234
69489
  __publicField(this, "quickReply");
69235
69490
  __publicField(this, "createRoot", () => {
69236
69491
  const root2 = createElement("div", ["comment-group-item-root"], null);
69492
+ if (this.comment.resolver) {
69493
+ addClass(root2, "resolved");
69494
+ }
69237
69495
  return root2;
69238
69496
  });
69239
69497
  __publicField(this, "createChildrenList", () => {
@@ -69290,6 +69548,7 @@ ${codeText}
69290
69548
  this.mainItem = this.createItem();
69291
69549
  this.childrenList = this.createChildrenList();
69292
69550
  this.quickReply = this.createQuickReply();
69551
+ this.createFooter();
69293
69552
  this.editor.on("readonlyChanged", this.handleReadonlyChanged);
69294
69553
  this.resizeObserver = new index$g(this.handleResize);
69295
69554
  this.resizeObserver.observe(this.root);
@@ -69299,6 +69558,29 @@ ${codeText}
69299
69558
  const count = getCommentItemCountInGroupItem(this.root);
69300
69559
  return count;
69301
69560
  }
69561
+ createFooter() {
69562
+ if (!this.comment.resolver) {
69563
+ return null;
69564
+ }
69565
+ const footer = createElement("div", ["comment-item-footer"], this.root);
69566
+ const modified = createElement("span", ["comment-modified"], footer);
69567
+ const date = new Date(this.comment.modified);
69568
+ const resolver = this.comment.resolver;
69569
+ assert(logger$1h, resolver, "resolver should not be null");
69570
+ const text2 = i18n$1.t("comment.resolvedBy", { name: resolver.displayName, date: fromNowString(date) });
69571
+ modified.innerText = text2;
69572
+ const actions2 = createElement("div", ["comment-actions"], footer);
69573
+ createElement("span", ["comment-date"], actions2, fromNowString(new Date(resolver.date)));
69574
+ if (this.comment.removedFromDoc) {
69575
+ createElement("span", ["removed-tips"], actions2, i18n$1.t("comment.removedFromDoc"));
69576
+ } else {
69577
+ const reopen = createElement("button", ["comment-reopen"], actions2, i18n$1.t("comment.reopen"));
69578
+ reopen.onclick = () => {
69579
+ this.commentsProvider.localUpdateCommentResolver(this.comment.id, void 0);
69580
+ };
69581
+ }
69582
+ return footer;
69583
+ }
69302
69584
  createQuickReply() {
69303
69585
  const { editor, commentsProvider, comment } = this;
69304
69586
  const commentQuickReply = new CommentQuickReply(editor, commentsProvider, comment, this);
@@ -69313,8 +69595,15 @@ ${codeText}
69313
69595
  const switchContainer = createElement("span", ["item-head-switch"], head);
69314
69596
  const switchUp = createTextButton(switchContainer, GroupItemActions.SwitchUp, "up", switchUpIcon);
69315
69597
  const switchDown = createTextButton(switchContainer, GroupItemActions.SwitchDown, "down", switchDownIcon);
69598
+ const resolve = createTextButton(switchContainer, GroupItemActions.Resolve, "resolve", CircleCheckMarkIcon);
69316
69599
  addGroupActionToElement(switchUp, GroupItemActions.SwitchUp);
69317
69600
  addGroupActionToElement(switchDown, GroupItemActions.SwitchDown);
69601
+ addGroupActionToElement(resolve, GroupItemActions.Resolve);
69602
+ resolve.setAttribute(`data-editor-tooltip-${this.editor.clientId}`, i18n$1.t("comment.resolveComment"));
69603
+ addClass(resolve, "disable-active");
69604
+ if (comment.resolver) {
69605
+ addClass(resolve, "resolved");
69606
+ }
69318
69607
  return head;
69319
69608
  }
69320
69609
  createItem() {
@@ -69354,6 +69643,7 @@ ${codeText}
69354
69643
  handleUpdateMainComment(comment) {
69355
69644
  assert(logger$1h, comment.id === this.mainItem.comment.id, "invalid comment");
69356
69645
  this.mainItem.reloadDoc();
69646
+ this.setCreatingComment(false);
69357
69647
  }
69358
69648
  deleteMainComment(commentId) {
69359
69649
  assert(logger$1h, commentId === this.mainItem.comment.id, "invalid comment");
@@ -69362,6 +69652,18 @@ ${codeText}
69362
69652
  edit() {
69363
69653
  this.mainItem.edit();
69364
69654
  }
69655
+ setCreatingComment(creating) {
69656
+ const resolveButton = this.header.querySelector('.editor-text-button[group-item-action="resolve"]');
69657
+ if (!resolveButton) {
69658
+ return;
69659
+ }
69660
+ resolveButton.disabled = creating;
69661
+ if (creating) {
69662
+ resolveButton.classList.add("disabled");
69663
+ } else {
69664
+ resolveButton.classList.remove("disabled");
69665
+ }
69666
+ }
69365
69667
  destroy() {
69366
69668
  this.quickReply.destroy();
69367
69669
  this.mainItem.destroy();
@@ -69547,7 +69849,17 @@ ${codeText}
69547
69849
  this.commentsProvider.localDeleteComment(comment.id);
69548
69850
  quickReply.show();
69549
69851
  });
69550
- __publicField(this, "execute", (element, groupItem, commentId, itemIndex) => {
69852
+ __publicField(this, "handleResolve", (groupItem) => {
69853
+ const { commentsProvider } = this;
69854
+ const comment = commentsProvider.getComment(groupItem.comment.id);
69855
+ const user = this.groupList.editor.doc.getUser();
69856
+ commentsProvider.localUpdateCommentResolver(comment.id, {
69857
+ userId: user.userId,
69858
+ displayName: user.displayName,
69859
+ date: Date.now()
69860
+ });
69861
+ });
69862
+ __publicField(this, "execute", (element, groupItem, commentId, itemIndex, event) => {
69551
69863
  const actionElement = getClosestGroupItemActionElement(element);
69552
69864
  if (!actionElement)
69553
69865
  return;
@@ -69586,6 +69898,11 @@ ${codeText}
69586
69898
  case GroupItemActions.QuickReplyCancel:
69587
69899
  this.handleQuickReplyCancel(groupItem);
69588
69900
  break;
69901
+ case GroupItemActions.Resolve:
69902
+ event.preventDefault();
69903
+ event.stopPropagation();
69904
+ this.handleResolve(groupItem);
69905
+ break;
69589
69906
  default:
69590
69907
  const exhaustiveCheck = actionId;
69591
69908
  logger$1f.debug(`not implement handler for ${exhaustiveCheck}`);
@@ -69599,8 +69916,8 @@ ${codeText}
69599
69916
  }
69600
69917
  const logger$1e = getLogger("comment-group-list");
69601
69918
  class CommentGroupList extends ListBase {
69602
- constructor(editor, commentsProvider, parent) {
69603
- super(editor, commentsProvider, parent, getCommentsGroupFromDoc(editor, commentsProvider), {});
69919
+ constructor(editor, commentsProvider, parent, type) {
69920
+ super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
69604
69921
  __publicField(this, "groupItemHandlers");
69605
69922
  __publicField(this, "dispatchScroll", debounce__default.default(() => {
69606
69923
  this.editor.scrollContainer.dispatchEvent(new Event("scroll"));
@@ -69638,7 +69955,9 @@ ${codeText}
69638
69955
  const commentId = getClosestCommentItemId(event.target);
69639
69956
  const index2 = this.items.findIndex((item) => item.root === itemRoot);
69640
69957
  if (index2 !== -1) {
69641
- if (this.activeIndex !== index2) {
69958
+ const disableActive = !!event.target.closest(".disable-active");
69959
+ const enableActive = !disableActive;
69960
+ if (this.activeIndex !== index2 && enableActive) {
69642
69961
  this.setActiveItem(index2);
69643
69962
  }
69644
69963
  const { groupItemHandlers } = this;
@@ -69646,7 +69965,8 @@ ${codeText}
69646
69965
  event.target,
69647
69966
  this.items[index2],
69648
69967
  commentId,
69649
- index2
69968
+ index2,
69969
+ event
69650
69970
  );
69651
69971
  }
69652
69972
  });
@@ -69687,7 +70007,7 @@ ${codeText}
69687
70007
  __publicField(this, "handleSelectionChanged", () => {
69688
70008
  setTimeout(() => {
69689
70009
  var _a;
69690
- const commentIds = getCommentsFromSelection(this.editor);
70010
+ const commentIds = this.type === "current" ? removeResolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor)) : removeUnresolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor));
69691
70011
  if (commentIds.length > 0) {
69692
70012
  if (((_a = this.activeItem) == null ? void 0 : _a.comment.id) && commentIds.includes(this.activeItem.comment.id)) {
69693
70013
  return;
@@ -69728,7 +70048,9 @@ ${codeText}
69728
70048
  const top = Number.parseFloat(firstItem.style.top);
69729
70049
  const targetTop = Number.parseFloat(firstItem.getAttribute("data-target-top") || "0");
69730
70050
  if (!Number.isNaN(top) && !Number.isNaN(targetTop) && top < targetTop) {
69731
- arrangeItems(this.editor, this.items, null, Math.min(top + (0 - event.deltaY) * 3, targetTop));
70051
+ if (this.type === "current") {
70052
+ arrangeItems(this.editor, this.items, null, Math.min(top + (0 - event.deltaY) * 3, targetTop));
70053
+ }
69732
70054
  }
69733
70055
  });
69734
70056
  __publicField(this, "updateGroupItemSwitch", () => {
@@ -69737,7 +70059,7 @@ ${codeText}
69737
70059
  activeItem.updateSwitchButton();
69738
70060
  });
69739
70061
  __publicField(this, "updateComments", debounce__default.default(() => {
69740
- const commentsGroup = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70062
+ const commentsGroup = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
69741
70063
  let hasBeenChanged = false;
69742
70064
  for (let i = 0; i < commentsGroup.length; i++) {
69743
70065
  const comment = commentsGroup[i];
@@ -69760,6 +70082,8 @@ ${codeText}
69760
70082
  this.emit("commentCountChanged");
69761
70083
  }
69762
70084
  }, 100));
70085
+ this.editor = editor;
70086
+ this.type = type;
69763
70087
  this.updateItemsLayout();
69764
70088
  this.bindEvents();
69765
70089
  this.editor.addListener("selectionChanged", this.handleSelectionChanged);
@@ -69780,7 +70104,9 @@ ${codeText}
69780
70104
  document.removeEventListener("click", this.handleDocumentClick);
69781
70105
  }
69782
70106
  updateItemsLayout(dispatchScroll = true) {
69783
- arrangeItems(this.editor, this.items, this.activeItem);
70107
+ if (this.type === "current") {
70108
+ arrangeItems(this.editor, this.items, this.activeItem);
70109
+ }
69784
70110
  if (dispatchScroll) {
69785
70111
  this.dispatchScroll();
69786
70112
  }
@@ -69804,7 +70130,7 @@ ${codeText}
69804
70130
  return item;
69805
70131
  }
69806
70132
  findInsertPos(data2) {
69807
- const commentsMap = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70133
+ const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
69808
70134
  const index2 = commentsMap.findIndex((group) => group.id === data2.id);
69809
70135
  if (index2 === -1) {
69810
70136
  return -1;
@@ -69904,6 +70230,7 @@ ${codeText}
69904
70230
  newItem.quickReply.hide();
69905
70231
  setTimeout(() => {
69906
70232
  newItem.edit();
70233
+ newItem.setCreatingComment(true);
69907
70234
  }, 300);
69908
70235
  }
69909
70236
  }
@@ -69928,6 +70255,12 @@ ${codeText}
69928
70255
  }
69929
70256
  }
69930
70257
  }
70258
+ handleResolveComment(commentId) {
70259
+ const item = this.findItem(commentId);
70260
+ if (item) {
70261
+ this.deleteItem(item.comment.id);
70262
+ }
70263
+ }
69931
70264
  handleUpdateComment(comment) {
69932
70265
  const group = this.findItemAsGroupId(comment.groupId);
69933
70266
  if (group && group.comment.id !== comment.id) {
@@ -69939,6 +70272,239 @@ ${codeText}
69939
70272
  item.handleUpdateMainComment(comment);
69940
70273
  }
69941
70274
  }
70275
+ changeType(type) {
70276
+ this.type = type;
70277
+ const comments = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70278
+ this.reloadList(comments);
70279
+ if (this.type === "current") {
70280
+ setTimeout(() => {
70281
+ arrangeItems(this.editor, this.items, null);
70282
+ });
70283
+ }
70284
+ }
70285
+ reloadList(data2) {
70286
+ super.reloadList(data2);
70287
+ this._items.forEach((item) => item.addListener("resize", this.handleItemResize));
70288
+ }
70289
+ }
70290
+ function addBlockComments(doc2, block, resultMap) {
70291
+ if (block.comments) {
70292
+ const blockComments = block.comments;
70293
+ if (Array.isArray(blockComments)) {
70294
+ blockComments.forEach((commentId) => {
70295
+ const commentIds = resultMap.get(block.id);
70296
+ if (commentIds) {
70297
+ commentIds.add(commentId);
70298
+ } else {
70299
+ resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
70300
+ }
70301
+ });
70302
+ }
70303
+ }
70304
+ if (block.text) {
70305
+ const text2 = block.text;
70306
+ text2.forEach((op) => {
70307
+ if (op.attributes) {
70308
+ const prefix = "comment-";
70309
+ Object.entries(op.attributes).forEach(([key, value]) => {
70310
+ if (key.startsWith(prefix)) {
70311
+ const commentId = value;
70312
+ const commentIds = resultMap.get(block.id);
70313
+ if (commentIds) {
70314
+ commentIds.add(commentId);
70315
+ } else {
70316
+ resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
70317
+ }
70318
+ }
70319
+ });
70320
+ }
70321
+ });
70322
+ }
70323
+ const children = block.children;
70324
+ if (!children) {
70325
+ return;
70326
+ }
70327
+ children.forEach((childContainerId) => {
70328
+ const childBlocks = doc2.blocks[childContainerId];
70329
+ childBlocks.forEach((subBlock) => {
70330
+ addBlockComments(doc2, subBlock, resultMap);
70331
+ });
70332
+ });
70333
+ }
70334
+ function getBlockCommentsFromDoc(doc2) {
70335
+ const resultMap = /* @__PURE__ */ new Map();
70336
+ doc2.blocks.root.forEach((block) => {
70337
+ addBlockComments(doc2, block, resultMap);
70338
+ });
70339
+ return resultMap;
70340
+ }
70341
+ function getBlocksByCommentId(doc2, commentId) {
70342
+ const result = [];
70343
+ const resultMap = getBlockCommentsFromDoc(doc2);
70344
+ resultMap.forEach((commentIds, blockId) => {
70345
+ if (commentIds.has(commentId)) {
70346
+ result.push(blockId);
70347
+ }
70348
+ });
70349
+ return result;
70350
+ }
70351
+ class OnesEditorCommentsRender {
70352
+ constructor(type = "current") {
70353
+ __publicField(this, "updateUnknownCommentsDelayed", debounce__default.default((editor) => {
70354
+ const comments = this.getComments(editor);
70355
+ const invisibleComments = Object.values(comments).filter((comment) => {
70356
+ if (comment.id !== comment.groupId) {
70357
+ return false;
70358
+ }
70359
+ const ret = this.type === "current" ? !!comment.resolver : !comment.resolver;
70360
+ return ret;
70361
+ });
70362
+ const root2 = editor.rootContainer;
70363
+ const effectedElements = /* @__PURE__ */ new Set();
70364
+ invisibleComments.forEach((comment) => {
70365
+ const key = `comment-${comment.id.toLocaleLowerCase()}`;
70366
+ const elements = root2.querySelectorAll(`[${key}]`);
70367
+ elements.forEach((elem) => {
70368
+ elem.removeAttribute(key);
70369
+ effectedElements.add(elem);
70370
+ });
70371
+ });
70372
+ effectedElements.forEach((elem) => {
70373
+ const commentAttributes = Array.from(elem.attributes).filter((a) => a.name.startsWith("comment-"));
70374
+ if (commentAttributes.length === 0) {
70375
+ elem.classList.remove("comment");
70376
+ }
70377
+ });
70378
+ }));
70379
+ this.type = type;
70380
+ }
70381
+ renderText(editor, path, attributes) {
70382
+ const classes = [];
70383
+ const textAttributes = {};
70384
+ Object.entries(attributes).forEach(([key, value]) => {
70385
+ if (key.startsWith("comment-")) {
70386
+ this.renderCommentElement(editor, key, value, classes, textAttributes);
70387
+ }
70388
+ });
70389
+ return { classes, attributes: textAttributes };
70390
+ }
70391
+ renderBox(editor, path, attributes) {
70392
+ const classes = [];
70393
+ const textAttributes = {};
70394
+ Object.entries(attributes).forEach(([key, value]) => {
70395
+ if (key.startsWith("comment-")) {
70396
+ this.renderCommentElement(editor, key, value, classes, textAttributes);
70397
+ }
70398
+ });
70399
+ return { classes, attributes: textAttributes };
70400
+ }
70401
+ renderBlock(editor, path, blockData) {
70402
+ const comments = blockData.comments;
70403
+ if (!comments || comments.length === 0) {
70404
+ return {};
70405
+ }
70406
+ const classes = [];
70407
+ const attributes = {};
70408
+ comments.forEach((commentId) => {
70409
+ const key = `comment-${commentId.toLocaleLowerCase()}`;
70410
+ this.renderCommentElement(editor, key, commentId, classes, attributes);
70411
+ });
70412
+ return {
70413
+ classes,
70414
+ attributes
70415
+ };
70416
+ }
70417
+ updateBlock(editor, path, blockElement, blockData) {
70418
+ const comments = blockData.comments;
70419
+ removeClass(blockElement, "comment");
70420
+ Array.from(blockElement.attributes).forEach((a) => {
70421
+ if (a.name.startsWith("comment-")) {
70422
+ blockElement.removeAttribute(a.name);
70423
+ }
70424
+ });
70425
+ if (!comments || comments.length === 0) {
70426
+ return;
70427
+ }
70428
+ addClass(blockElement, "comment");
70429
+ const classList = [];
70430
+ comments.forEach((commentId) => {
70431
+ const key = `comment-${commentId.toLocaleLowerCase()}`;
70432
+ this.renderCommentElement(editor, key, commentId, classList, {});
70433
+ });
70434
+ if (classList.length > 0) {
70435
+ addClass(blockElement, ...classList);
70436
+ }
70437
+ }
70438
+ getCommentStatus(editor, commentId) {
70439
+ const comments = editor.findCustom("editor-comments");
70440
+ if (!comments) {
70441
+ return "unknown";
70442
+ }
70443
+ const commentsProvider = comments.commentProvider;
70444
+ const comment = commentsProvider.getComment(commentId);
70445
+ if (!comment) {
70446
+ return "unknown";
70447
+ }
70448
+ if (comment.resolver) {
70449
+ return "resolved";
70450
+ }
70451
+ return "unresolved";
70452
+ }
70453
+ renderCommentElement(editor, key, commentId, classes, textAttributes) {
70454
+ const status = this.getCommentStatus(editor, commentId);
70455
+ if (this.type === "current") {
70456
+ if (status === "resolved") {
70457
+ return;
70458
+ }
70459
+ } else {
70460
+ if (status === "unresolved") {
70461
+ return;
70462
+ }
70463
+ }
70464
+ classes.push("comment");
70465
+ textAttributes[key] = commentId;
70466
+ if (status === "unknown") {
70467
+ this.updateUnknownCommentsDelayed(editor);
70468
+ }
70469
+ }
70470
+ getComments(editor) {
70471
+ const editorComments = editor.findCustom("editor-comments");
70472
+ if (!editorComments) {
70473
+ return [];
70474
+ }
70475
+ const commentProvider = editorComments.commentProvider;
70476
+ return commentProvider.getComments();
70477
+ }
70478
+ changeType(editor, type) {
70479
+ this.type = type;
70480
+ const elements = editor.rootContainer.querySelectorAll(".comment");
70481
+ elements.forEach((elem) => {
70482
+ elem.classList.remove("comment");
70483
+ Array.from(elem.attributes).forEach((a) => {
70484
+ if (a.name.startsWith("comment-")) {
70485
+ elem.removeAttribute(a.name);
70486
+ }
70487
+ });
70488
+ });
70489
+ const comments = this.getComments(editor);
70490
+ const visibleComments = Object.values(comments).filter((comment) => {
70491
+ if (comment.id !== comment.groupId) {
70492
+ return false;
70493
+ }
70494
+ const ret = this.type === "current" ? !comment.resolver : !!comment.resolver;
70495
+ return ret;
70496
+ });
70497
+ const visibleCommentsId = new Set(visibleComments.map((c) => c.id));
70498
+ const commentsFromDoc = getBlockCommentsFromDoc(editor.doc.toJSON());
70499
+ commentsFromDoc.forEach((commentIds, blockId) => {
70500
+ if (Array.from(commentIds).some((c) => visibleCommentsId.has(c))) {
70501
+ const block = editor.findBlockById(blockId);
70502
+ if (block) {
70503
+ editor.reloadBlock(block);
70504
+ }
70505
+ }
70506
+ });
70507
+ }
69942
70508
  }
69943
70509
  const COMMENT_MINI_CLS = "comment-mini";
69944
70510
  getLogger("comment-list");
@@ -69948,6 +70514,43 @@ ${codeText}
69948
70514
  __publicField(this, "root");
69949
70515
  __publicField(this, "groupsContainer");
69950
70516
  __publicField(this, "list");
70517
+ __publicField(this, "listType", "current");
70518
+ __publicField(this, "switcherItem", {
70519
+ id: "switch-comment",
70520
+ name: i18n$1.t("comment.currentComment"),
70521
+ dropdown: true,
70522
+ manualShowChildren: true,
70523
+ childrenPlacement: "bottom-start",
70524
+ children: [{
70525
+ id: "current-comment",
70526
+ name: i18n$1.t("comment.currentComment"),
70527
+ states: ["checked"]
70528
+ }, {
70529
+ id: "resolved-comment",
70530
+ name: i18n$1.t("comment.resolvedComment")
70531
+ }]
70532
+ });
70533
+ __publicField(this, "switcherBar");
70534
+ __publicField(this, "noResolvedCommentTip", null);
70535
+ __publicField(this, "handleSwitchType", (bar2, item) => {
70536
+ if (item.id === "current-comment") {
70537
+ this.listType = "current";
70538
+ } else {
70539
+ this.listType = "resolved";
70540
+ }
70541
+ this.root.setAttribute("list-type", this.listType);
70542
+ this.switcherItem.name = this.listType === "current" ? i18n$1.t("comment.currentComment") : i18n$1.t("comment.resolvedComment");
70543
+ const children = this.switcherItem.children;
70544
+ children[0].states = this.listType === "current" ? ["checked"] : [];
70545
+ children[1].states = this.listType === "resolved" ? ["checked"] : [];
70546
+ this.switcherBar.updateItems([this.switcherItem]);
70547
+ this.list.changeType(this.listType);
70548
+ const renderer = this.editor.editorBlockRenders.getRenderers().find((r) => r instanceof OnesEditorCommentsRender);
70549
+ if (renderer) {
70550
+ renderer.changeType(this.editor, this.listType);
70551
+ }
70552
+ this.updateNoResolvedCommentTip();
70553
+ });
69951
70554
  __publicField(this, "handleSelectionOnComment", () => {
69952
70555
  this.emit("onSelectComment");
69953
70556
  });
@@ -69955,8 +70558,12 @@ ${codeText}
69955
70558
  var _a, _b;
69956
70559
  const count = getCommentsCountInDoc(this.editor, this.commentsProvider);
69957
70560
  (_b = (_a = this.commentOptions) == null ? void 0 : _a.onCommentCountChange) == null ? void 0 : _b.call(_a, count);
70561
+ this.updateNoResolvedCommentTip();
69958
70562
  });
69959
70563
  __publicField(this, "handleActiveItemChanged", (index2, direction) => {
70564
+ if (this.listType === "resolved") {
70565
+ return;
70566
+ }
69960
70567
  setTimeout(() => {
69961
70568
  var _a, _b;
69962
70569
  const item = this.list.activeItem;
@@ -69973,13 +70580,18 @@ ${codeText}
69973
70580
  this.editor = editor;
69974
70581
  this.commentsProvider = commentsProvider;
69975
70582
  this.root = createElement("div", ["editor-web-comment-root"], null);
70583
+ this.root.setAttribute("list-type", this.listType);
69976
70584
  this.groupsContainer = createElement("div", ["comment-groups-container"], this.root);
69977
70585
  this.list = this.createList();
70586
+ this.switcherBar = this.createSwitcher();
69978
70587
  this.commentsProvider.addListener(this);
69979
70588
  this.list.addListener("activeItemChanged", this.handleActiveItemChanged);
69980
70589
  this.list.addListener("itemLayoutUpdated", this.handleItemLayoutUpdated);
69981
70590
  this.list.addListener("selectionOnComment", this.handleSelectionOnComment);
69982
70591
  this.list.addListener("commentCountChanged", this.updateCommentCount);
70592
+ if (!this.editor.options.enableResolveComments) {
70593
+ this.root.classList.add("disable-resolve");
70594
+ }
69983
70595
  this.updateCommentCount();
69984
70596
  }
69985
70597
  get commentOptions() {
@@ -69987,10 +70599,13 @@ ${codeText}
69987
70599
  return commentOptions;
69988
70600
  }
69989
70601
  destroy() {
70602
+ var _a;
69990
70603
  this.list.removeAllListeners();
69991
70604
  this.commentsProvider.removeListener(this);
69992
70605
  this.list.destroy();
69993
70606
  this.root.remove();
70607
+ this.switcherBar.destroy();
70608
+ (_a = this.noResolvedCommentTip) == null ? void 0 : _a.remove();
69994
70609
  }
69995
70610
  onCreateComment(commentId, local) {
69996
70611
  const comment = this.commentsProvider.getComment(commentId);
@@ -70005,8 +70620,73 @@ ${codeText}
70005
70620
  const comment = this.commentsProvider.getComment(commentId);
70006
70621
  this.list.handleUpdateComment(comment);
70007
70622
  }
70623
+ onUpdateCommentResolver(commentId, local) {
70624
+ const comment = this.commentsProvider.getComment(commentId);
70625
+ if (!comment) {
70626
+ return;
70627
+ }
70628
+ let type = "add";
70629
+ if (this.listType === "current") {
70630
+ if (comment.resolver) {
70631
+ type = "remove";
70632
+ }
70633
+ } else {
70634
+ if (!comment.resolver) {
70635
+ type = "remove";
70636
+ }
70637
+ }
70638
+ const blocks = /* @__PURE__ */ new Set();
70639
+ if (type === "remove") {
70640
+ getElementsByCommentId(this.editor, commentId).forEach((element) => {
70641
+ if (isBlock$1(element)) {
70642
+ blocks.add(element);
70643
+ } else {
70644
+ const block = getParentBlock(element);
70645
+ if (block) {
70646
+ blocks.add(block);
70647
+ }
70648
+ }
70649
+ });
70650
+ } else {
70651
+ const blockIds = getBlocksByCommentId(this.editor.doc.toJSON(), commentId);
70652
+ blockIds.forEach((blockId) => {
70653
+ const block = this.editor.findBlockById(blockId);
70654
+ if (block) {
70655
+ blocks.add(block);
70656
+ }
70657
+ });
70658
+ }
70659
+ blocks.forEach((block) => {
70660
+ this.editor.reloadBlock(block);
70661
+ });
70662
+ const commentGroup = getCommentsGroup(this.commentsProvider.getComments());
70663
+ const commentWithChildren = commentGroup.find((group) => group.groupId === comment.groupId);
70664
+ if (!commentWithChildren) {
70665
+ return;
70666
+ }
70667
+ setTimeout(() => {
70668
+ if (type === "add") {
70669
+ this.list.handleCreateComment(commentWithChildren, local);
70670
+ } else {
70671
+ this.list.handleResolveComment(commentId);
70672
+ }
70673
+ this.updateCommentCount();
70674
+ }, 300);
70675
+ }
70008
70676
  createList() {
70009
- return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer);
70677
+ return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer, this.listType);
70678
+ }
70679
+ createSwitcher() {
70680
+ const container = createElement("div", ["comment-switcher-container"], this.root);
70681
+ const commandBar2 = new FixedToolbar(container, [this.switcherItem], {
70682
+ id: "comment-switcher"
70683
+ });
70684
+ commandBar2.addListener("click", this.handleSwitchType);
70685
+ return commandBar2;
70686
+ }
70687
+ setSwitcherParent(parent) {
70688
+ this.switcherBar.content.remove();
70689
+ parent.append(this.switcherBar.content);
70010
70690
  }
70011
70691
  isEditing(includeEmpty) {
70012
70692
  return this.list.isEditing(includeEmpty);
@@ -70014,14 +70694,30 @@ ${codeText}
70014
70694
  setFirstEditingCommentActive() {
70015
70695
  this.list.setFirstEditingCommentActive();
70016
70696
  }
70017
- show(groupId) {
70697
+ updateNoResolvedCommentTip() {
70018
70698
  var _a;
70699
+ if (this.listType === "resolved" && this.list.items.length === 0) {
70700
+ if (!this.noResolvedCommentTip) {
70701
+ this.noResolvedCommentTip = createElement("div", ["comment-no-resolved-tip"], this.groupsContainer);
70702
+ this.noResolvedCommentTip.innerText = i18n$1.t("comment.noResolvedComment");
70703
+ }
70704
+ return;
70705
+ }
70706
+ (_a = this.noResolvedCommentTip) == null ? void 0 : _a.remove();
70707
+ this.noResolvedCommentTip = null;
70708
+ }
70709
+ show(groupId) {
70710
+ var _a, _b;
70019
70711
  removeClass(this.root, "hidden");
70020
70712
  if (groupId) {
70713
+ if (this.listType !== "current") {
70714
+ const commandItem = (_a = this.switcherItem.children) == null ? void 0 : _a[0];
70715
+ this.handleSwitchType(this.switcherBar, commandItem);
70716
+ }
70021
70717
  const index2 = this.list.findItemIndex(groupId);
70022
70718
  this.list.setActiveItem(index2);
70023
70719
  }
70024
- (_a = this.commentOptions) == null ? void 0 : _a.controller.showCommentList();
70720
+ (_b = this.commentOptions) == null ? void 0 : _b.controller.showCommentList();
70025
70721
  }
70026
70722
  hide() {
70027
70723
  addClass(this.root, "hidden");
@@ -70149,7 +70845,7 @@ ${codeText}
70149
70845
  const logger$1c = getLogger("mobile-group-list");
70150
70846
  class MobileGroupList extends ListBase {
70151
70847
  constructor(editor, commentsProvider, parent, scrollElement) {
70152
- super(editor, commentsProvider, parent, getCommentsGroupFromDoc(editor, commentsProvider), {});
70848
+ super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
70153
70849
  __publicField(this, "scroller");
70154
70850
  __publicField(this, "refreshScroller", () => {
70155
70851
  this.scroller.refresh();
@@ -70197,7 +70893,7 @@ ${codeText}
70197
70893
  this.updateComments();
70198
70894
  });
70199
70895
  __publicField(this, "updateComments", debounce__default.default(() => {
70200
- const commentsGroup = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70896
+ const commentsGroup = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70201
70897
  for (let i = 0; i < commentsGroup.length; i++) {
70202
70898
  const comment = commentsGroup[i];
70203
70899
  const groupItem = this.findGroupItem(comment.groupId);
@@ -70231,7 +70927,7 @@ ${codeText}
70231
70927
  return item;
70232
70928
  }
70233
70929
  findInsertPos(data2) {
70234
- const commentsMap = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70930
+ const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70235
70931
  const index2 = commentsMap.findIndex((group) => group.id === data2.id);
70236
70932
  if (index2 === -1) {
70237
70933
  return -1;
@@ -70367,6 +71063,8 @@ ${codeText}
70367
71063
  const comment = this.commentsProvider.getComment(commentId);
70368
71064
  this.list.handleUpdateComment(comment);
70369
71065
  }
71066
+ onUpdateCommentResolver(commentId, local) {
71067
+ }
70370
71068
  get commentOptions() {
70371
71069
  const commentOptions = this.editor.getComponentOptions("comment");
70372
71070
  return commentOptions;
@@ -70392,7 +71090,7 @@ ${codeText}
70392
71090
  }
70393
71091
  }
70394
71092
  function getMiniCommentsGroupFromDoc(editor, commentsProvider) {
70395
- const commentsGroupFromDoc = getCommentsGroupFromDoc(editor, commentsProvider);
71093
+ const commentsGroupFromDoc = getUnresolvedCommentsGroupFromDoc(editor, commentsProvider);
70396
71094
  const miniCommentGroups = /* @__PURE__ */ new Map();
70397
71095
  for (const commentGroup of commentsGroupFromDoc) {
70398
71096
  const blockId = getBlockIdByGroupId(editor, commentGroup.groupId);
@@ -70539,6 +71237,9 @@ ${codeText}
70539
71237
  }
70540
71238
  onUpdateComment(commentId, local) {
70541
71239
  }
71240
+ onUpdateCommentResolver(commentId, local) {
71241
+ this.list.updateMiniCommentsGroup();
71242
+ }
70542
71243
  show() {
70543
71244
  removeClass(this.root, "hidden");
70544
71245
  }
@@ -70807,6 +71508,15 @@ ${codeText}
70807
71508
  get isMobile() {
70808
71509
  return clientType.isMobile;
70809
71510
  }
71511
+ getCommentList() {
71512
+ return this.commentList;
71513
+ }
71514
+ getMobileCommentList() {
71515
+ return this.mobileCommentList;
71516
+ }
71517
+ getMiniCommentList() {
71518
+ return this.miniCommentList;
71519
+ }
70810
71520
  destroy() {
70811
71521
  var _a, _b;
70812
71522
  (_a = this.commentList) == null ? void 0 : _a.destroy();
@@ -70832,6 +71542,9 @@ ${codeText}
70832
71542
  if (containers.mobileContainer && this.mobileCommentList) {
70833
71543
  containers.mobileContainer.append(this.mobileCommentList.root);
70834
71544
  }
71545
+ if (containers.switchBarContainer && this.commentList) {
71546
+ this.commentList.setSwitcherParent(containers.switchBarContainer);
71547
+ }
70835
71548
  }
70836
71549
  }
70837
71550
  const style$7 = "";
@@ -70855,7 +71568,14 @@ ${codeText}
70855
71568
  more: "\u66F4\u591A",
70856
71569
  comment: "\u6DFB\u52A0\u6279\u6CE8",
70857
71570
  command: "\u6DFB\u52A0\u6279\u6CE8",
70858
- quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8"
71571
+ quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8",
71572
+ resolvedBy: "\u5DF2\u7531 {name} \u6210\u5458\u89E3\u51B3",
71573
+ reopen: "\u91CD\u65B0\u6253\u5F00",
71574
+ currentComment: "\u5F53\u524D\u6279\u6CE8",
71575
+ resolvedComment: "\u5DF2\u89E3\u51B3\u6279\u6CE8",
71576
+ removedFromDoc: "\u5F15\u7528\u5185\u5BB9\u5DF2\u5220\u9664",
71577
+ noResolvedComment: "\u65E0\u5DF2\u89E3\u51B3\u6279\u6CE8",
71578
+ resolveComment: "\u6807\u8BB0\u4E3A\u5DF2\u89E3\u51B3"
70859
71579
  }
70860
71580
  };
70861
71581
  const enUS$k = {
@@ -70878,7 +71598,14 @@ ${codeText}
70878
71598
  more: "More",
70879
71599
  comment: "Add annotation",
70880
71600
  command: "Add annotation",
70881
- quickMenuCommand: "Add annotation"
71601
+ quickMenuCommand: "Add annotation",
71602
+ resolvedBy: "Resolved by {name}",
71603
+ reopen: "Reopen",
71604
+ currentComment: "Unresolved annotations",
71605
+ resolvedComment: "Resolved annotations",
71606
+ removedFromDoc: "Quoted content deleted.",
71607
+ noResolvedComment: "No resolved annotations.",
71608
+ resolveComment: "Mark as resolved"
70882
71609
  }
70883
71610
  };
70884
71611
  const jaJP$k = {
@@ -70901,7 +71628,14 @@ ${codeText}
70901
71628
  more: "\u305D\u306E\u4ED6",
70902
71629
  comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
70903
71630
  command: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
70904
- quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
71631
+ quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
71632
+ resolvedBy: "{name}\u3055\u3093\u304C\u89E3\u6C7A\u3057\u307E\u3057\u305F",
71633
+ reopen: "\u518D\u958B",
71634
+ currentComment: "\u672A\u89E3\u6C7A\u30B3\u30E1\u30F3\u30C8",
71635
+ resolvedComment: "\u89E3\u6C7A\u6E08\u307F\u30B3\u30E1\u30F3\u30C8",
71636
+ removedFromDoc: "\u5F15\u7528\u3055\u308C\u305F\u5185\u5BB9\u306F\u524A\u9664\u3055\u308C\u307E\u3057\u305F\u3002",
71637
+ noResolvedComment: "\u89E3\u6C7A\u6E08\u307F\u30B3\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
71638
+ resolveComment: "\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F"
70905
71639
  }
70906
71640
  };
70907
71641
  i18n$1.mergeLang({
@@ -70909,61 +71643,6 @@ ${codeText}
70909
71643
  "en-US": enUS$k,
70910
71644
  "ja-JP": jaJP$k
70911
71645
  });
70912
- class OnesEditorCommentsRender {
70913
- renderText(editor, path, attributes) {
70914
- const classes = [];
70915
- const textAttributes = {};
70916
- Object.entries(attributes).forEach(([key, value]) => {
70917
- if (key.startsWith("comment-")) {
70918
- classes.push("comment");
70919
- textAttributes[key] = value;
70920
- }
70921
- });
70922
- return { classes, attributes: textAttributes };
70923
- }
70924
- renderBox(editor, path, attributes) {
70925
- const classes = [];
70926
- const textAttributes = {};
70927
- Object.entries(attributes).forEach(([key, value]) => {
70928
- if (key.startsWith("comment-")) {
70929
- classes.push("comment");
70930
- textAttributes[key] = value;
70931
- }
70932
- });
70933
- return { classes, attributes: textAttributes };
70934
- }
70935
- renderBlock(editor, path, blockData) {
70936
- const comments = blockData.comments;
70937
- if (!comments || comments.length === 0) {
70938
- return {};
70939
- }
70940
- const classes = ["comment"];
70941
- const attributes = {};
70942
- comments.forEach((commentId) => {
70943
- attributes[`comment-${commentId.toLocaleLowerCase()}`] = commentId;
70944
- });
70945
- return {
70946
- classes,
70947
- attributes
70948
- };
70949
- }
70950
- updateBlock(editor, path, blockElement, blockData) {
70951
- const comments = blockData.comments;
70952
- removeClass(blockElement, "comment");
70953
- Array.from(blockElement.attributes).forEach((a) => {
70954
- if (a.name.startsWith("comment-")) {
70955
- blockElement.removeAttribute(a.name);
70956
- }
70957
- });
70958
- if (!comments || comments.length === 0) {
70959
- return;
70960
- }
70961
- addClass(blockElement, "comment");
70962
- comments.forEach((commentId) => {
70963
- blockElement.setAttribute(`comment-${commentId.toLocaleLowerCase()}`, commentId);
70964
- });
70965
- }
70966
- }
70967
71646
  class OnesEditorCommentPlaceholderHandler {
70968
71647
  constructor(editor) {
70969
71648
  __publicField(this, "handleUpdateCompositionText", (editor, containerId, blockIndex, offset, end) => {
@@ -71115,6 +71794,21 @@ ${codeText}
71115
71794
  method: "delete"
71116
71795
  });
71117
71796
  }
71797
+ function updateCommentResolverToOldDoc(editor, version, commentId, resolver) {
71798
+ var _a, _b;
71799
+ const doc2 = editor.doc;
71800
+ const server = (_b = (_a = doc2.getServerMeta) == null ? void 0 : _a.call(doc2)) == null ? void 0 : _b.apiServer;
71801
+ assert(logger$16, server, "apiServer is not set");
71802
+ const api = `${server}/${version}/comments/${commentId}/resolver`;
71803
+ return doc2.request(api, {
71804
+ method: "put",
71805
+ data: {
71806
+ resolver
71807
+ }
71808
+ });
71809
+ }
71810
+ getLogger("resolved-comment-item");
71811
+ const styles = "";
71118
71812
  const isAllContainersSelected = (editor) => {
71119
71813
  var _a;
71120
71814
  const range = editor.selection.range;
@@ -71189,6 +71883,16 @@ ${codeText}
71189
71883
  await updateCommentToOldDoc(this.editor, this.version, commentId, comments.commentProvider.getCommentDoc(commentId));
71190
71884
  }
71191
71885
  }
71886
+ onUpdateCommentResolver(commentId, local) {
71887
+ const comments = this.editor.getCustom("editor-comments");
71888
+ const provider = comments.commentProvider;
71889
+ const comment = provider.getComment(commentId);
71890
+ if (!comment) {
71891
+ return;
71892
+ }
71893
+ const resolver = comment.resolver;
71894
+ updateCommentResolverToOldDoc(this.editor, this.version, commentId, resolver);
71895
+ }
71192
71896
  hideToolbar(editor) {
71193
71897
  const toolbar2 = editor.findCustom("toolbar-handler");
71194
71898
  toolbar2 == null ? void 0 : toolbar2.disableTextToolbar();
@@ -76501,14 +77205,14 @@ ${docStr}
76501
77205
  }
76502
77206
  function isList(elem) {
76503
77207
  var _a;
76504
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76505
- return styles.findIndex((style2) => style2.startsWith("level")) !== -1;
77208
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77209
+ return styles2.findIndex((style2) => style2.startsWith("level")) !== -1;
76506
77210
  }
76507
77211
  function getOfficeListGroupId(elem) {
76508
77212
  var _a;
76509
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76510
- for (let i = 0; i < styles.length; i++) {
76511
- const name = styles[i];
77213
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77214
+ for (let i = 0; i < styles2.length; i++) {
77215
+ const name = styles2[i];
76512
77216
  if (name.startsWith("mso-list:")) {
76513
77217
  return name;
76514
77218
  }
@@ -76517,9 +77221,9 @@ ${docStr}
76517
77221
  }
76518
77222
  function getLevel(elem) {
76519
77223
  var _a, _b;
76520
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76521
- for (let i = 0; i < styles.length; i++) {
76522
- const name = styles[i];
77224
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77225
+ for (let i = 0; i < styles2.length; i++) {
77226
+ const name = styles2[i];
76523
77227
  if (name.startsWith("level")) {
76524
77228
  const level = (_b = Number.parseInt(name.substring(5), 10)) != null ? _b : void 0;
76525
77229
  if (level) {
@@ -80123,6 +80827,8 @@ ${docStr}
80123
80827
  }
80124
80828
  onUpdateComment() {
80125
80829
  }
80830
+ onUpdateCommentResolver(commentId, local) {
80831
+ }
80126
80832
  }
80127
80833
  async function playHistoryData(doc2, versionHelper, historyData) {
80128
80834
  for (const data2 of historyData) {
@@ -90294,6 +91000,9 @@ ${data2.plantumlText}
90294
91000
  localUpdateComment(comment, doc2) {
90295
91001
  this.doc.localUpdateComment(comment, doc2);
90296
91002
  }
91003
+ localUpdateCommentResolver(commentId, resolver) {
91004
+ this.doc.localUpdateCommentResolver(commentId, resolver);
91005
+ }
90297
91006
  onCreateComment(commentId, local) {
90298
91007
  Array.from(this.listeners.values()).forEach((listener) => listener.onCreateComment(commentId, local));
90299
91008
  }
@@ -90303,6 +91012,9 @@ ${data2.plantumlText}
90303
91012
  onUpdateComment(commentId, local) {
90304
91013
  Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateComment(commentId, local));
90305
91014
  }
91015
+ onUpdateCommentResolver(commentId, local) {
91016
+ Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, local));
91017
+ }
90306
91018
  addListener(callback) {
90307
91019
  this.listeners.add(callback);
90308
91020
  }
@@ -90328,9 +91040,10 @@ ${data2.plantumlText}
90328
91040
  constructor(editor, localDoc) {
90329
91041
  __publicField(this, "_listeners", /* @__PURE__ */ new Set());
90330
91042
  __publicField(this, "_doc");
91043
+ var _a, _b;
90331
91044
  this.editor = editor;
90332
91045
  this.localDoc = localDoc;
90333
- this._doc = this.localDoc.toJSON();
91046
+ this._doc = ((_b = (_a = this.localDoc).rawData) == null ? void 0 : _b.call(_a)) || this.localDoc.toJSON();
90334
91047
  }
90335
91048
  get doc() {
90336
91049
  return this._doc;
@@ -90385,6 +91098,17 @@ ${data2.plantumlText}
90385
91098
  this._doc.comments[id] = shareDBComment;
90386
91099
  Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateComment(id, true));
90387
91100
  }
91101
+ localUpdateCommentResolver(commentId, resolver) {
91102
+ const comment = this.getComment(commentId);
91103
+ if (comment) {
91104
+ if (resolver) {
91105
+ comment.resolver = resolver;
91106
+ } else {
91107
+ delete comment.resolver;
91108
+ }
91109
+ Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, true));
91110
+ }
91111
+ }
90388
91112
  createCommentEditor(parent, childDoc) {
90389
91113
  const commentEditor = createCommentEditor(this.editor, {
90390
91114
  root: parent,
@@ -91123,8 +91847,8 @@ ${data2.plantumlText}
91123
91847
  const inlineStyles = attributesOfText(text2, "inlineStyle");
91124
91848
  if (inlineStyles == null)
91125
91849
  return;
91126
- const styles = inlineStyles.split(";");
91127
- for (const style2 of styles) {
91850
+ const styles2 = inlineStyles.split(";");
91851
+ for (const style2 of styles2) {
91128
91852
  const pair = style2.split(":");
91129
91853
  if (pair.length !== 2)
91130
91854
  continue;
@@ -92940,6 +93664,7 @@ ${data2.plantumlText}
92940
93664
  id: options.id,
92941
93665
  scrollContainer: options == null ? void 0 : options.scrollContainer,
92942
93666
  enableComments: options == null ? void 0 : options.enableComments,
93667
+ enableResolveComments: options == null ? void 0 : options.enableResolveComments,
92943
93668
  enableContextMenu: options == null ? void 0 : options.enableContextMenu,
92944
93669
  components: {
92945
93670
  blocks: [...StandardBlocks, ...((_d = options == null ? void 0 : options.components) == null ? void 0 : _d.blocks) || []],
@@ -93177,7 +93902,7 @@ ${data2.plantumlText}
93177
93902
  }
93178
93903
  }
93179
93904
  });
93180
- editor.version = "2.8.27";
93905
+ editor.version = "2.8.28-beta.1";
93181
93906
  return editor;
93182
93907
  }
93183
93908
  function isDoc(doc2) {
@@ -93199,6 +93924,7 @@ ${data2.plantumlText}
93199
93924
  const editor = createEditor(root2, doc2, {
93200
93925
  id: options.id,
93201
93926
  scrollContainer: options == null ? void 0 : options.scrollContainer,
93927
+ enableResolveComments: options == null ? void 0 : options.enableResolveComments,
93202
93928
  components: {
93203
93929
  blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
93204
93930
  commandProviders: [new TableBlockCommandProvider()],
@@ -93290,7 +94016,7 @@ ${data2.plantumlText}
93290
94016
  }
93291
94017
  });
93292
94018
  OnesEditorToolbar.register(editor);
93293
- editor.version = "2.8.27";
94019
+ editor.version = "2.8.28-beta.1";
93294
94020
  return editor;
93295
94021
  }
93296
94022
  async function showDocVersions(editor, options, serverUrl) {
@@ -139110,6 +139836,7 @@ ${data2.plantumlText}
139110
139836
  exports2.CheckMarkIcon = CheckMarkIcon;
139111
139837
  exports2.CheckboxIcon = CheckboxIcon;
139112
139838
  exports2.CircleAddIcon = CircleAddIcon;
139839
+ exports2.CircleCheckMarkIcon = CircleCheckMarkIcon;
139113
139840
  exports2.ClearIcon = ClearIcon;
139114
139841
  exports2.ClipboardProvider = ClipboardProvider;
139115
139842
  exports2.CloseIcon = CloseIcon;
@@ -139260,6 +139987,8 @@ ${data2.plantumlText}
139260
139987
  exports2.MoreItem = MoreItem;
139261
139988
  exports2.NextIcon = NextIcon;
139262
139989
  exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
139990
+ exports2.OnesEditorComments = OnesEditorComments;
139991
+ exports2.OnesEditorCommentsRender = OnesEditorCommentsRender;
139263
139992
  exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
139264
139993
  exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
139265
139994
  exports2.OnesEditorHoveringBlock = OnesEditorHoveringBlock;