@ones-editor/editor 2.8.35 → 2.8.37-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 (45) hide show
  1. package/@ones-editor/comments/src/comments/comments.d.ts +5 -1
  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 +14 -2
  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 +8 -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 +9 -0
  18. package/@ones-editor/comments/src/locale/ja-jp.d.ts +9 -0
  19. package/@ones-editor/comments/src/locale/zh-cn.d.ts +9 -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 +7 -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 +11 -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/main-toolbar/src/index.d.ts +7 -1
  30. package/@ones-editor/main-toolbar/src/items/index.d.ts +1 -1
  31. package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +2 -1
  32. package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +2 -1
  33. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +3 -1
  34. package/@ones-editor/sharedb-doc/src/types.d.ts +1 -0
  35. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  36. package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +1 -0
  37. package/@ones-editor/ui-base/src/command-bar/types.d.ts +8 -7
  38. package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
  39. package/@ones-editor/versions/src/version-dialog/history-handler.d.ts +1 -0
  40. package/dist/comments/local-doc-comments-provider.d.ts +2 -1
  41. package/dist/comments/sharedb-doc-comments-provider.d.ts +3 -1
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.js +1133 -206
  44. package/dist/types.d.ts +2 -0
  45. 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 .comment-groups-container .no-comment-tip {
4330
+ font-size: 12px;
4331
+ width: 100%;
4332
+ color: #BEBFC2;
4333
+ display: flex;
4334
+ justify-content: center;
4335
+ align-items: center;
4336
+ margin-top: 100px;
4337
+ }
4338
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container {
4339
+ display: flex;
4340
+ flex-direction: column;
4341
+ padding-left: 8px;
4342
+ padding-top: 60px;
4343
+ }
4344
+ .editor-web-comment-root[list-type=resolved] .comment-groups-container .comment-group-item-root {
4345
+ margin-bottom: 20px;
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,70 @@ 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-resolved {
4455
+ font-size: 12px;
4456
+ color: #87888a;
4457
+ flex-grow: 1;
4458
+ display: flex;
4459
+ white-space: nowrap;
4460
+ }
4461
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-resolved .resolver-name {
4462
+ flex-shrink: 1;
4463
+ white-space: nowrap;
4464
+ overflow: hidden;
4465
+ text-overflow: ellipsis;
4466
+ }
4467
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions {
4468
+ display: flex;
4469
+ align-items: center;
4470
+ }
4471
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-date {
4472
+ flex: 1;
4473
+ white-space: nowrap;
4474
+ }
4475
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .removed-tips {
4476
+ color: #87888A;
4477
+ white-space: nowrap;
4478
+ text-overflow: ellipsis;
4479
+ overflow: hidden;
4480
+ margin-left: 10px;
4481
+ }
4482
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen {
4483
+ background: none;
4484
+ border: none;
4485
+ cursor: pointer;
4486
+ color: #575859;
4487
+ font-size: 12px;
4488
+ }
4489
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen:hover {
4490
+ color: #0064FF;
4491
+ }
4401
4492
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.active::before {
4402
4493
  background-color: #f59300;
4403
4494
  }
4404
- .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch {
4495
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-up] {
4496
+ visibility: visible;
4497
+ }
4498
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-down] {
4405
4499
  visibility: visible;
4406
4500
  }
4407
4501
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply .quick-reply-button.invisible {
4408
4502
  display: none;
4409
4503
  }
4504
+ .editor-web-comment-root .comment-switcher-container {
4505
+ position: absolute;
4506
+ z-index: 1;
4507
+ top: 0;
4508
+ left: 0;
4509
+ right: 0;
4510
+ font-size: 14px;
4511
+ }
4410
4512
  .editor-mobile-comments-root {
4411
4513
  position: fixed;
4412
4514
  left: 0;
@@ -4508,6 +4610,108 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4508
4610
  }
4509
4611
  :is(.editor-web-comment-root, .editor-mobile-comments-root, .editor-mini-comment-root).hidden {
4510
4612
  display: none;
4613
+ }
4614
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block].text-block.comment > div[data-type=block-content] > span {
4615
+ border-bottom-color: transparent;
4616
+ }
4617
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block] span.text.comment,
4618
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block] span[data-type=editor-box].comment {
4619
+ border-bottom-color: transparent;
4620
+ }
4621
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block] span.text.comment.active,
4622
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block] span[data-type=editor-box].comment.active {
4623
+ background-color: transparent;
4624
+ }
4625
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block].comment::after {
4626
+ background-color: transparent;
4627
+ }
4628
+ .editor-root .editor-content [data-type=editor-container][comment-list-type=resolved] div[data-type=editor-block].comment.active {
4629
+ outline: none;
4630
+ }.resolved-comment-list .resolved-comment-group-item-root {
4631
+ padding: 10px 20px;
4632
+ border-bottom: 1px solid #f0f0f0;
4633
+ margin-right: 10px;
4634
+ }
4635
+ .resolved-comment-list .resolved-comment-group-item-root .comment-group-head {
4636
+ margin-bottom: 5px;
4637
+ }
4638
+ .resolved-comment-list .resolved-comment-group-item-root .comment-group-head span {
4639
+ padding: 0 5px;
4640
+ display: inline-block;
4641
+ line-height: 2;
4642
+ background-color: #FFF0D9;
4643
+ }
4644
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container,
4645
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container {
4646
+ padding-left: 10px;
4647
+ }
4648
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root,
4649
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root {
4650
+ position: relative;
4651
+ }
4652
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:not(.no-children)::before,
4653
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root:not(.no-children)::before {
4654
+ content: " ";
4655
+ display: block;
4656
+ position: absolute;
4657
+ left: 10px;
4658
+ width: 1px;
4659
+ background-color: #DFE1E5;
4660
+ overflow: hidden;
4661
+ opacity: 0.8;
4662
+ top: 21px;
4663
+ bottom: -12px;
4664
+ transform: scaleX(0.5);
4665
+ }
4666
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head,
4667
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head {
4668
+ padding: 0;
4669
+ position: relative;
4670
+ display: flex;
4671
+ align-items: center;
4672
+ }
4673
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-avatar,
4674
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-avatar {
4675
+ margin-right: 5px;
4676
+ width: var(--editor-comment-avatar-width, 22px);
4677
+ height: var(--editor-comment-avatar-width, 22px);
4678
+ border-radius: 100%;
4679
+ }
4680
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-username,
4681
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-username {
4682
+ font-size: var(--editor-comment-username-font-size, 12px);
4683
+ color: #2d2d2e;
4684
+ overflow: hidden;
4685
+ text-overflow: ellipsis;
4686
+ white-space: nowrap;
4687
+ }
4688
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-head .comment-modified,
4689
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-head .comment-modified {
4690
+ margin-left: 10px;
4691
+ font-size: 12px;
4692
+ color: #87888a;
4693
+ flex-grow: 1;
4694
+ white-space: nowrap;
4695
+ }
4696
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root .comment-editor,
4697
+ .resolved-comment-list .resolved-comment-group-item-root .comment-container .resolved-comment-item-root .comment-editor {
4698
+ border: none;
4699
+ padding-top: 0;
4700
+ margin-top: 0;
4701
+ padding-left: 10px;
4702
+ margin-left: 0;
4703
+ }
4704
+ .resolved-comment-list .resolved-comment-group-item-root .comment-children-container .resolved-comment-item-root:last-child::before {
4705
+ display: none;
4706
+ }
4707
+ .resolved-comment-list .resolved-comment-group-item-root .comment-item-footer .comment-resolved {
4708
+ margin-left: 10px;
4709
+ font-size: 12px;
4710
+ color: #87888a;
4711
+ flex-grow: 1;
4712
+ white-space: nowrap;
4713
+ overflow: hidden;
4714
+ text-overflow: ellipsis;
4511
4715
  }div[data-type=editor-block].table-block {
4512
4716
  --table-bar-width: 6px;
4513
4717
  --table-bar-left: -6px;
@@ -8671,6 +8875,35 @@ div.editor-root.compact.no-heading-collapse.no-block-menu > .editor-content {
8671
8875
  }
8672
8876
  [data-command-bar-id=main-toolbar-more-menu] .editor-command-bar.toolbar .command-item.hidden, [data-command-bar-id=main-toolbar-more-menu] .editor-command-bar.menu .command-item.hidden {
8673
8877
  display: flex;
8878
+ }
8879
+ .editor-main-toolbar-root {
8880
+ display: flex;
8881
+ width: 100%;
8882
+ height: 100%;
8883
+ }
8884
+ .editor-main-toolbar-root .editor-main-toolbar-resizer {
8885
+ position: relative;
8886
+ flex-grow: 1;
8887
+ flex-shrink: 1;
8888
+ }
8889
+ .editor-main-toolbar-root .editor-main-toolbar-resizer .editor-main-toolbar-container {
8890
+ position: absolute;
8891
+ left: 0;
8892
+ right: 0;
8893
+ top: 0;
8894
+ bottom: 0;
8895
+ display: flex;
8896
+ align-items: center;
8897
+ }
8898
+ .editor-main-toolbar-root .editor-main-toolbar-resizer .editor-main-toolbar-container .editor-command-bar-root {
8899
+ overflow: hidden !important;
8900
+ }
8901
+ .editor-main-toolbar-root [data-command-bar-root-id=main-toolbar-fullscreen] {
8902
+ flex-grow: 0 !important;
8903
+ flex-shrink: 0 !important;
8904
+ display: flex;
8905
+ align-items: center;
8906
+ justify-content: center;
8674
8907
  }`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
8675
8908
  var __defProp = Object.defineProperty;
8676
8909
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -9228,22 +9461,22 @@ var __publicField = (obj, key, value) => {
9228
9461
  function toFloat(value) {
9229
9462
  return parseFloat(value) || 0;
9230
9463
  }
9231
- function getBordersSize(styles) {
9464
+ function getBordersSize(styles2) {
9232
9465
  var positions = [];
9233
9466
  for (var _i = 1; _i < arguments.length; _i++) {
9234
9467
  positions[_i - 1] = arguments[_i];
9235
9468
  }
9236
9469
  return positions.reduce(function(size, position) {
9237
- var value = styles["border-" + position + "-width"];
9470
+ var value = styles2["border-" + position + "-width"];
9238
9471
  return size + toFloat(value);
9239
9472
  }, 0);
9240
9473
  }
9241
- function getPaddings(styles) {
9474
+ function getPaddings(styles2) {
9242
9475
  var positions = ["top", "right", "bottom", "left"];
9243
9476
  var paddings = {};
9244
9477
  for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
9245
9478
  var position = positions_1[_i];
9246
- var value = styles["padding-" + position];
9479
+ var value = styles2["padding-" + position];
9247
9480
  paddings[position] = toFloat(value);
9248
9481
  }
9249
9482
  return paddings;
@@ -9257,17 +9490,17 @@ var __publicField = (obj, key, value) => {
9257
9490
  if (!clientWidth && !clientHeight) {
9258
9491
  return emptyRect;
9259
9492
  }
9260
- var styles = getWindowOf(target).getComputedStyle(target);
9261
- var paddings = getPaddings(styles);
9493
+ var styles2 = getWindowOf(target).getComputedStyle(target);
9494
+ var paddings = getPaddings(styles2);
9262
9495
  var horizPad = paddings.left + paddings.right;
9263
9496
  var vertPad = paddings.top + paddings.bottom;
9264
- var width = toFloat(styles.width), height = toFloat(styles.height);
9265
- if (styles.boxSizing === "border-box") {
9497
+ var width = toFloat(styles2.width), height = toFloat(styles2.height);
9498
+ if (styles2.boxSizing === "border-box") {
9266
9499
  if (Math.round(width + horizPad) !== clientWidth) {
9267
- width -= getBordersSize(styles, "left", "right") + horizPad;
9500
+ width -= getBordersSize(styles2, "left", "right") + horizPad;
9268
9501
  }
9269
9502
  if (Math.round(height + vertPad) !== clientHeight) {
9270
- height -= getBordersSize(styles, "top", "bottom") + vertPad;
9503
+ height -= getBordersSize(styles2, "top", "bottom") + vertPad;
9271
9504
  }
9272
9505
  }
9273
9506
  if (!isDocumentElement(target)) {
@@ -9922,8 +10155,8 @@ var __publicField = (obj, key, value) => {
9922
10155
  el.setAttribute(key, value);
9923
10156
  });
9924
10157
  }
9925
- function setStyles(el, styles) {
9926
- Object.entries(styles).forEach(([key, value]) => {
10158
+ function setStyles(el, styles2) {
10159
+ Object.entries(styles2).forEach(([key, value]) => {
9927
10160
  el.style.setProperty(key, value);
9928
10161
  });
9929
10162
  }
@@ -12343,12 +12576,12 @@ var __publicField = (obj, key, value) => {
12343
12576
  return blockClass.getBlockStyles(editor, block);
12344
12577
  }
12345
12578
  const data2 = editor.getBlockData(block);
12346
- const styles = Object.fromEntries(Object.entries(data2).filter(([key]) => key.startsWith("style-")));
12347
- Object.entries(styles).forEach(([, value]) => {
12579
+ const styles2 = Object.fromEntries(Object.entries(data2).filter(([key]) => key.startsWith("style-")));
12580
+ Object.entries(styles2).forEach(([, value]) => {
12348
12581
  const type = typeof value;
12349
12582
  assert(logger$4C, type === "string" || type === "number" || type === "boolean", "invalid style value");
12350
12583
  });
12351
- return styles;
12584
+ return styles2;
12352
12585
  }
12353
12586
  function getContainerWidth(container, options) {
12354
12587
  const ret = container.getBoundingClientRect().width;
@@ -24937,7 +25170,7 @@ var __publicField = (obj, key, value) => {
24937
25170
  if (attributes) {
24938
25171
  let string = op.insert;
24939
25172
  const tags = [];
24940
- let styles = "";
25173
+ let styles2 = "";
24941
25174
  if (attributes["style-bold"]) {
24942
25175
  tags.push("strong");
24943
25176
  }
@@ -24955,25 +25188,25 @@ var __publicField = (obj, key, value) => {
24955
25188
  }
24956
25189
  const fontBgColor = Object.keys(attributes).find((k) => k.startsWith("style-bg-color-"));
24957
25190
  if (fontBgColor) {
24958
- styles += `background-color: ${styleBackgroundColorToHighlight$1(fontBgColor)};`;
25191
+ styles2 += `background-color: ${styleBackgroundColorToHighlight$1(fontBgColor)};`;
24959
25192
  }
24960
25193
  const fontColor = Object.keys(attributes).find((k) => k.startsWith("style-color-"));
24961
25194
  if (fontColor) {
24962
- styles += `color: ${styleColorToColor$1(fontColor)};`;
25195
+ styles2 += `color: ${styleColorToColor$1(fontColor)};`;
24963
25196
  }
24964
25197
  if (attributes.link) {
24965
25198
  string = `<a href="${attributes.link}">${string}</a>`;
24966
25199
  }
24967
25200
  let prefix = tags.map((s) => `<${s}>`).join("");
24968
25201
  let suffix = tags.reverse().map((s) => `</${s}>`).join("");
24969
- if (styles) {
25202
+ if (styles2) {
24970
25203
  if (attributes.link) {
24971
- string = `<a href="${attributes.link}" style="${styles}">${op.insert}</a>`;
25204
+ string = `<a href="${attributes.link}" style="${styles2}">${op.insert}</a>`;
24972
25205
  } else {
24973
25206
  if (prefix) {
24974
- prefix = prefix.replace(">", ` style="${styles}">`);
25207
+ prefix = prefix.replace(">", ` style="${styles2}">`);
24975
25208
  } else {
24976
- prefix = `<span style="${styles}">`;
25209
+ prefix = `<span style="${styles2}">`;
24977
25210
  suffix = "</span>";
24978
25211
  }
24979
25212
  }
@@ -25416,6 +25649,9 @@ var __publicField = (obj, key, value) => {
25416
25649
  __publicField(this, "renders", []);
25417
25650
  this.editor = editor;
25418
25651
  }
25652
+ getRenderers() {
25653
+ return this.renders;
25654
+ }
25419
25655
  registerRender(render) {
25420
25656
  this.renders.push(render);
25421
25657
  }
@@ -25653,8 +25889,8 @@ var __publicField = (obj, key, value) => {
25653
25889
  renderBlock(editor, path, blockData) {
25654
25890
  var _a, _b;
25655
25891
  const attributes = {};
25656
- const styles = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
25657
- styles.forEach(([key, value]) => {
25892
+ const styles2 = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
25893
+ styles2.forEach(([key, value]) => {
25658
25894
  attributes[`data-${key}`] = `${value}`;
25659
25895
  });
25660
25896
  const classes = [];
@@ -25861,6 +26097,7 @@ var __publicField = (obj, key, value) => {
25861
26097
  constructor(editor, callbacks) {
25862
26098
  __publicField(this, "editor");
25863
26099
  __publicField(this, "composing", false);
26100
+ __publicField(this, "composingTimer");
25864
26101
  __publicField(this, "callbacks");
25865
26102
  __publicField(this, "inputElement");
25866
26103
  __publicField(this, "handleBlur", () => {
@@ -25920,12 +26157,13 @@ var __publicField = (obj, key, value) => {
25920
26157
  if (!this.editor.isWritable()) {
25921
26158
  return;
25922
26159
  }
26160
+ clearTimeout(this.composingTimer);
25923
26161
  this.composing = true;
25924
26162
  this.callbacks.onCompositionStart(event);
25925
26163
  });
25926
26164
  __publicField(this, "handleCompositionend", (event) => {
25927
26165
  if (isSafari()) {
25928
- setTimeout(() => {
26166
+ this.composingTimer = setTimeout(() => {
25929
26167
  this.composing = false;
25930
26168
  }, 100);
25931
26169
  } else {
@@ -31625,7 +31863,7 @@ ${codeText}
31625
31863
  const logger$38 = getLogger("editor");
31626
31864
  class Editor extends tinyTypedEmitter.TypedEmitter {
31627
31865
  constructor(parent, doc2, optionalOptions) {
31628
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
31866
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
31629
31867
  super();
31630
31868
  __publicField(this, "parent");
31631
31869
  __publicField(this, "rootElement");
@@ -31671,12 +31909,13 @@ ${codeText}
31671
31909
  componentsOptions: (_c = (_b = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _b.options) != null ? _c : {},
31672
31910
  scrollContainer: optionalOptions == null ? void 0 : optionalOptions.scrollContainer,
31673
31911
  enableComments: (_d = optionalOptions == null ? void 0 : optionalOptions.enableComments) != null ? _d : true,
31674
- enableContextMenu: (_e = optionalOptions == null ? void 0 : optionalOptions.enableContextMenu) != null ? _e : true
31912
+ enableResolveComments: (_e = optionalOptions == null ? void 0 : optionalOptions.enableResolveComments) != null ? _e : true,
31913
+ enableContextMenu: (_f = optionalOptions == null ? void 0 : optionalOptions.enableContextMenu) != null ? _f : true
31675
31914
  };
31676
- this.settingsProvider = (_f = optionalOptions == null ? void 0 : optionalOptions.settingsProvider) != null ? _f : new DefaultSettingsProvider(this);
31915
+ this.settingsProvider = (_g = optionalOptions == null ? void 0 : optionalOptions.settingsProvider) != null ? _g : new DefaultSettingsProvider(this);
31677
31916
  registerComponents(this, optionalOptions == null ? void 0 : optionalOptions.components);
31678
- this.blockHooks.push(...(_h = (_g = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _g.blockHooks) != null ? _h : []);
31679
- this.id = (_i = optionalOptions == null ? void 0 : optionalOptions.id) != null ? _i : genId();
31917
+ this.blockHooks.push(...(_i = (_h = optionalOptions == null ? void 0 : optionalOptions.components) == null ? void 0 : _h.blockHooks) != null ? _i : []);
31918
+ this.id = (_j = optionalOptions == null ? void 0 : optionalOptions.id) != null ? _j : genId();
31680
31919
  this.clientId = genId();
31681
31920
  this.undoManager = new UndoManager(this);
31682
31921
  this.doc = new EditorDoc(this, doc2, this.undoManager);
@@ -32162,6 +32401,9 @@ ${codeText}
32162
32401
  toJSON() {
32163
32402
  return cloneDeep__default.default(this.doc);
32164
32403
  }
32404
+ rawData() {
32405
+ return this.doc;
32406
+ }
32165
32407
  getContainerBlocks(containerId) {
32166
32408
  const blocks = this.doc.blocks[containerId];
32167
32409
  return blocks;
@@ -38682,6 +38924,12 @@ ${codeText}
38682
38924
  commentId
38683
38925
  });
38684
38926
  }
38927
+ onUpdateCommentResolver(commentId) {
38928
+ this.pushActions({
38929
+ type: "updateCommentResolved",
38930
+ commentId
38931
+ });
38932
+ }
38685
38933
  end() {
38686
38934
  const actions2 = this.actions;
38687
38935
  const deletedBlocks = /* @__PURE__ */ new Set();
@@ -38756,6 +39004,9 @@ ${codeText}
38756
39004
  } else if (action.type === "updateComment") {
38757
39005
  const a = action;
38758
39006
  this.outerHandler.onUpdateComment(a.commentId, this.local);
39007
+ } else if (action.type === "updateCommentResolved") {
39008
+ const a = action;
39009
+ this.outerHandler.onUpdateCommentResolver(a.commentId, this.local);
38759
39010
  }
38760
39011
  });
38761
39012
  Array.from(updatingBlockDataDeltaMap.entries()).forEach(([blockId, objectData]) => {
@@ -38933,7 +39184,14 @@ ${codeText}
38933
39184
  assert(logger$2W, commentId, `invalid comment op, no commentId: ${JSON.stringify(ops)}`);
38934
39185
  assert(logger$2W, actions2, `invalid comment op, no actions: ${JSON.stringify(ops)}`);
38935
39186
  if (typeof actions2 === "string") {
38936
- logger$2W.error(`unknown comment op, ${JSON.stringify(ops)}`);
39187
+ const data2 = ops[3];
39188
+ if (actions2 === "resolver" && typeof data2 === "object") {
39189
+ if (parseType === "upsert") {
39190
+ handler.onUpdateCommentResolver(commentId);
39191
+ }
39192
+ } else {
39193
+ logger$2W.error(`unknown comment op, ${JSON.stringify(ops)}`);
39194
+ }
38937
39195
  } else {
38938
39196
  if (actions2.i && actions2.r) {
38939
39197
  if (parseType === "upsert") {
@@ -39043,7 +39301,8 @@ ${codeText}
39043
39301
  avatarUrl,
39044
39302
  abstract,
39045
39303
  created,
39046
- modified
39304
+ modified,
39305
+ resolver: resolved
39047
39306
  } = shareDBComment;
39048
39307
  return {
39049
39308
  id,
@@ -39053,7 +39312,8 @@ ${codeText}
39053
39312
  avatarUrl,
39054
39313
  abstract,
39055
39314
  created,
39056
- modified
39315
+ modified,
39316
+ resolver: resolved
39057
39317
  };
39058
39318
  }
39059
39319
  function commentToShareDbComment(comment, doc2) {
@@ -39525,6 +39785,21 @@ ${codeText}
39525
39785
  const op = ["comments", comment.id, { r: true, i: shareDBComment }];
39526
39786
  return this.submitOp(op);
39527
39787
  }
39788
+ localUpdateCommentResolver(commentId, resolver) {
39789
+ const oldComment = this.getComment(commentId);
39790
+ const oldResolved = oldComment.resolver;
39791
+ const op = ["comments", commentId, "resolver", {}];
39792
+ if (!oldResolved && !resolver) {
39793
+ return Promise.resolve(true);
39794
+ }
39795
+ if (oldResolved !== void 0) {
39796
+ op[3] = { r: true };
39797
+ }
39798
+ if (resolver) {
39799
+ op[3].i = resolver;
39800
+ }
39801
+ return this.submitOp(op);
39802
+ }
39528
39803
  destroy() {
39529
39804
  var _a;
39530
39805
  this.destroyed = true;
@@ -39601,6 +39876,13 @@ ${codeText}
39601
39876
  return (_a = cb.onUpdateComment) == null ? void 0 : _a.call(cb, commentId, local);
39602
39877
  });
39603
39878
  }
39879
+ onUpdateCommentResolver(commentId, local) {
39880
+ assert(logger$2T, this.callbacks.length > 0, "no callbacks");
39881
+ this.callbacks.forEach((cb) => {
39882
+ var _a;
39883
+ return (_a = cb.onUpdateCommentResolver) == null ? void 0 : _a.call(cb, commentId, local);
39884
+ });
39885
+ }
39604
39886
  onCustomMessage(msg) {
39605
39887
  const message = msg;
39606
39888
  if ((message == null ? void 0 : message.type) === "custom" && (message == null ? void 0 : message.clientId) !== this.client.clientId) {
@@ -40669,6 +40951,7 @@ ${codeText}
40669
40951
  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>';
40670
40952
  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';
40671
40953
  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>';
40954
+ 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';
40672
40955
  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';
40673
40956
  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';
40674
40957
  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';
@@ -40824,6 +41107,7 @@ ${codeText}
40824
41107
  RefreshIcon,
40825
41108
  HelpIcon,
40826
41109
  CheckMarkIcon,
41110
+ CircleCheckMarkIcon,
40827
41111
  TextIcon,
40828
41112
  RightArrowIcon: rightArrow,
40829
41113
  TencentVideoIcon,
@@ -41499,6 +41783,9 @@ ${codeText}
41499
41783
  }
41500
41784
  const content = createElement("div", ["editor-command-bar-root"], null);
41501
41785
  content.setAttribute("data-keep-editor-focus", "");
41786
+ if (this.options.rootId) {
41787
+ content.setAttribute("data-command-bar-root-id", this.options.rootId);
41788
+ }
41502
41789
  if (this.options.header) {
41503
41790
  const headerElem = createElement("div", ["editor-command-bar-header"], null);
41504
41791
  if (this.options.header instanceof Function) {
@@ -50633,7 +50920,7 @@ ${codeText}
50633
50920
  });
50634
50921
  return !!ret;
50635
50922
  }
50636
- function addBlockClasses(from, to, styles) {
50923
+ function addBlockClasses(from, to, styles2) {
50637
50924
  const container = getParentContainer(from);
50638
50925
  if (to) {
50639
50926
  const container2 = getParentContainer(to);
@@ -50644,18 +50931,18 @@ ${codeText}
50644
50931
  const toIndex = getBlockIndex(to);
50645
50932
  assert(logger$24, fromIndex <= toIndex, "invalid block index");
50646
50933
  }
50647
- addClass(from, ...styles);
50934
+ addClass(from, ...styles2);
50648
50935
  if (!to || to === from) {
50649
50936
  return;
50650
50937
  }
50651
50938
  let next2 = getNextBlock(from);
50652
50939
  while (next2 !== to) {
50653
50940
  assert(logger$24, next2, "no next button");
50654
- addClass(next2, ...styles);
50941
+ addClass(next2, ...styles2);
50655
50942
  next2 = getNextBlock(next2);
50656
50943
  }
50657
50944
  if (next2) {
50658
- addClass(next2, ...styles);
50945
+ addClass(next2, ...styles2);
50659
50946
  }
50660
50947
  }
50661
50948
  async function requestMindmapFullscreen(editor, block, mindmapTools) {
@@ -51643,7 +51930,7 @@ ${codeText}
51643
51930
  html = `<input type="checkbox" disabled="disabled" /> ${html}`;
51644
51931
  }
51645
51932
  let listTag = "ul";
51646
- let styles = "";
51933
+ let styles2 = "";
51647
51934
  if (list2.ordered) {
51648
51935
  html = `<li value="${list2.start}">${html}</li>`;
51649
51936
  listTag = "ol";
@@ -51651,18 +51938,18 @@ ${codeText}
51651
51938
  case 2:
51652
51939
  case 5:
51653
51940
  case 8:
51654
- styles = "list-style-type: lower-alpha;";
51941
+ styles2 = "list-style-type: lower-alpha;";
51655
51942
  break;
51656
51943
  case 3:
51657
51944
  case 6:
51658
- styles = "list-style-type: lower-roman;";
51945
+ styles2 = "list-style-type: lower-roman;";
51659
51946
  break;
51660
51947
  }
51661
51948
  } else {
51662
51949
  html = `<li>${html}</li>`;
51663
51950
  }
51664
51951
  if (isFirstListItem(editor, blockData, doc2, path)) {
51665
- html = `<${listTag}${styles ? ` style="${styles}"` : ""}>${html}`;
51952
+ html = `<${listTag}${styles2 ? ` style="${styles2}"` : ""}>${html}`;
51666
51953
  }
51667
51954
  if (isLastListItem(editor, blockData, doc2, path)) {
51668
51955
  html = `${html}</${listTag}>`;
@@ -54559,7 +54846,7 @@ ${codeText}
54559
54846
  const svg = await mathjax2Svg(editor, tex);
54560
54847
  const data2 = svg;
54561
54848
  const file2 = new File([data2], "math.svg");
54562
- const path = await editor.doc.uploadResource(file2);
54849
+ const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54563
54850
  return path.resourceId;
54564
54851
  }
54565
54852
  async function convertAndUploadMathjaxForEmbed(editor, tex) {
@@ -54567,7 +54854,7 @@ ${codeText}
54567
54854
  const perfectState = analyzeMathjaxSvgWidth(svg);
54568
54855
  const data2 = svg;
54569
54856
  const file2 = new File([data2], "math.svg");
54570
- const path = await editor.doc.uploadResource(file2);
54857
+ const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54571
54858
  return {
54572
54859
  resourceId: path.resourceId,
54573
54860
  ...perfectState
@@ -62591,13 +62878,13 @@ $$${mathData.mathjaxText}$$
62591
62878
  if (!op.attributes) {
62592
62879
  return /* @__PURE__ */ new Map();
62593
62880
  }
62594
- const styles = Object.entries(op.attributes).filter(([key]) => {
62881
+ const styles2 = Object.entries(op.attributes).filter(([key]) => {
62595
62882
  if (key.startsWith("style-")) {
62596
62883
  return true;
62597
62884
  }
62598
62885
  return false;
62599
62886
  });
62600
- return new Map(styles);
62887
+ return new Map(styles2);
62601
62888
  };
62602
62889
  if (text2.length === 0) {
62603
62890
  return /* @__PURE__ */ new Map();
@@ -62641,11 +62928,11 @@ $$${mathData.mathjaxText}$$
62641
62928
  if (getTextLength(text2) === 0) {
62642
62929
  return textStyles;
62643
62930
  }
62644
- let styles = getIntersectionStyles(text2);
62645
- styles = mergeActiveStyle(editor, styles);
62931
+ let styles2 = getIntersectionStyles(text2);
62932
+ styles2 = mergeActiveStyle(editor, styles2);
62646
62933
  function getTextStyle(item) {
62647
62934
  const { id, icon, desc, name } = item;
62648
- const value = styles.get(id);
62935
+ const value = styles2.get(id);
62649
62936
  if (value !== void 0) {
62650
62937
  return {
62651
62938
  id,
@@ -63241,6 +63528,7 @@ $$${mathData.mathjaxText}$$
63241
63528
  GroupItemActions2["QuickReply"] = "quick-reply";
63242
63529
  GroupItemActions2["QuickReplyOk"] = "quick-reply-ok";
63243
63530
  GroupItemActions2["QuickReplyCancel"] = "quick-reply-cancel";
63531
+ GroupItemActions2["Resolve"] = "resolve";
63244
63532
  return GroupItemActions2;
63245
63533
  })(GroupItemActions || {});
63246
63534
  const GROUP_ITEM_ACTION_MARK = "group-item-action";
@@ -63288,7 +63576,7 @@ $$${mathData.mathjaxText}$$
63288
63576
  return attributes.filter((attribute) => attribute.startsWith("comment-")).map((attribute) => attribute.replace("comment-", ""));
63289
63577
  }
63290
63578
  const logger$1G = getLogger("doc-comments");
63291
- function addBlockComments(doc2, block, result, resultSet) {
63579
+ function addBlockComments$1(doc2, block, result, resultSet) {
63292
63580
  if (block.comments) {
63293
63581
  const blockComments = block.comments;
63294
63582
  if (Array.isArray(blockComments)) {
@@ -63324,7 +63612,7 @@ $$${mathData.mathjaxText}$$
63324
63612
  children.forEach((childContainerId) => {
63325
63613
  const childBlocks = doc2.blocks[childContainerId];
63326
63614
  childBlocks.forEach((subBlock) => {
63327
- addBlockComments(doc2, subBlock, result, resultSet);
63615
+ addBlockComments$1(doc2, subBlock, result, resultSet);
63328
63616
  });
63329
63617
  });
63330
63618
  }
@@ -63332,7 +63620,7 @@ $$${mathData.mathjaxText}$$
63332
63620
  const result = [];
63333
63621
  const resultSet = /* @__PURE__ */ new Set();
63334
63622
  doc2.blocks.root.forEach((block) => {
63335
- addBlockComments(doc2, block, result, resultSet);
63623
+ addBlockComments$1(doc2, block, result, resultSet);
63336
63624
  });
63337
63625
  const resultMap = /* @__PURE__ */ new Map();
63338
63626
  result.forEach((commentId, index2) => resultMap.set(commentId, index2));
@@ -63388,6 +63676,26 @@ $$${mathData.mathjaxText}$$
63388
63676
  });
63389
63677
  return result;
63390
63678
  }
63679
+ function getUnresolvedCommentsGroupFromDoc(editor, commentsProvider) {
63680
+ return getCommentsGroupFromDoc(editor, commentsProvider).filter((group) => !group.resolver);
63681
+ }
63682
+ function getResolvedCommentsGroupFromDoc(editor, commentsProvider) {
63683
+ const doc2 = editor.doc.toJSON();
63684
+ const commentsMap = getCommentsFromDoc(doc2);
63685
+ const commentGroup = getCommentsGroup(commentsProvider.getComments());
63686
+ const result = commentGroup.filter((group) => group.resolver).sort((group1, group2) => {
63687
+ var _a, _b, _c, _d;
63688
+ const date1 = (_b = (_a = group1.resolver) == null ? void 0 : _a.date) != null ? _b : 0;
63689
+ const date2 = (_d = (_c = group2.resolver) == null ? void 0 : _c.date) != null ? _d : 0;
63690
+ return date2 - date1;
63691
+ });
63692
+ result.forEach((group) => {
63693
+ if (!commentsMap.has(group.groupId)) {
63694
+ group.removedFromDoc = true;
63695
+ }
63696
+ });
63697
+ return result;
63698
+ }
63391
63699
  function flattenCommentGroup(comment) {
63392
63700
  const { children, ...raw } = comment;
63393
63701
  const comments = [raw];
@@ -63397,9 +63705,12 @@ $$${mathData.mathjaxText}$$
63397
63705
  return comments;
63398
63706
  }
63399
63707
  function getCommentsCountInDoc(editor, commentsProvider) {
63400
- const commentGroups = getCommentsGroupFromDoc(editor, commentsProvider);
63401
- const count = commentGroups.length;
63402
- return count;
63708
+ const unresolved = getUnresolvedCommentsGroupFromDoc(editor, commentsProvider).length;
63709
+ const commentsGroup = getCommentsGroup(commentsProvider.getComments());
63710
+ const resolved = commentsGroup.filter((group) => group.resolver).length;
63711
+ const total = unresolved + resolved;
63712
+ logger$1G.debug(`total comments: ${total}, unresolved: ${unresolved}, resolved: ${resolved}`);
63713
+ return total;
63403
63714
  }
63404
63715
  function getCommentsFromPos(editor, pos) {
63405
63716
  const commentIds = [];
@@ -63444,6 +63755,24 @@ $$${mathData.mathjaxText}$$
63444
63755
  const commentIds = intersection__default.default(comments1, comments2);
63445
63756
  return commentIds;
63446
63757
  }
63758
+ function removeUnresolvedComments(commentProvider, commentIds) {
63759
+ return commentIds.filter((commentId) => {
63760
+ const comment = commentProvider.getComment(commentId);
63761
+ if (!comment) {
63762
+ return false;
63763
+ }
63764
+ return !!comment.resolver;
63765
+ });
63766
+ }
63767
+ function removeResolvedComments(commentProvider, commentIds) {
63768
+ return commentIds.filter((commentId) => {
63769
+ const comment = commentProvider.getComment(commentId);
63770
+ if (!comment) {
63771
+ return false;
63772
+ }
63773
+ return !(comment == null ? void 0 : comment.resolver);
63774
+ });
63775
+ }
63447
63776
  const logger$1F = getLogger("active-comments");
63448
63777
  function inactiveComment(editor, commentId) {
63449
63778
  const activeCommentElements = editor.rootContainer.querySelectorAll(`span.comment[comment-${commentId}],[data-type=editor-block].comment[comment-${commentId}]`);
@@ -63499,6 +63828,11 @@ $$${mathData.mathjaxText}$$
63499
63828
  }
63500
63829
  }
63501
63830
  }
63831
+ function getElementsByCommentId(editor, commentId) {
63832
+ const lowerCommentId = commentId.toLocaleLowerCase();
63833
+ const elements = editor.rootContainer.querySelectorAll(`span.comment[comment-${lowerCommentId}],[data-type=editor-block].comment[comment-${lowerCommentId}]`);
63834
+ return Array.from(elements);
63835
+ }
63502
63836
  function isImageBlock(block) {
63503
63837
  return getBlockType(block) === "embed" && getEmbedType(block) === "image";
63504
63838
  }
@@ -64524,7 +64858,8 @@ $$${mathData.mathjaxText}$$
64524
64858
  const res = await this.editor.doc.uploadResource(file2, {
64525
64859
  onProgress: (progress) => {
64526
64860
  setImageUploading(imageContainer, progress);
64527
- }
64861
+ },
64862
+ resourceType: "image"
64528
64863
  });
64529
64864
  removeClass(imageContainer, "uploading");
64530
64865
  this.images[index2].src = res.resourceId;
@@ -68501,7 +68836,7 @@ ${codeText}
68501
68836
  }
68502
68837
  const fileName = `image.${ext}`;
68503
68838
  const file2 = new File([blob], fileName, { type: mimeString });
68504
- const ret = await editor.doc.uploadResource(file2);
68839
+ const ret = await editor.doc.uploadResource(file2, { resourceType: "paste" });
68505
68840
  return ret.resourceId;
68506
68841
  }
68507
68842
  return src;
@@ -69303,8 +69638,9 @@ ${codeText}
69303
69638
  return items;
69304
69639
  }
69305
69640
  reloadList(data2) {
69641
+ this._items.forEach((item) => item.destroy());
69306
69642
  this.container.innerHTML = "";
69307
- this.createList(data2);
69643
+ this._items = this.createList(data2);
69308
69644
  }
69309
69645
  insertItem(data2) {
69310
69646
  const index2 = this.findInsertPos(data2);
@@ -69377,8 +69713,8 @@ ${codeText}
69377
69713
  });
69378
69714
  }
69379
69715
  }
69380
- 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>';
69381
- 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>';
69716
+ 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';
69717
+ 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';
69382
69718
  const index$8 = "";
69383
69719
  const REPLY_EDITOR_EDITING_CLS = "reply-editor-editing";
69384
69720
  const { t: t$3 } = i18n$1;
@@ -69501,6 +69837,9 @@ ${codeText}
69501
69837
  __publicField(this, "quickReply");
69502
69838
  __publicField(this, "createRoot", () => {
69503
69839
  const root2 = createElement("div", ["comment-group-item-root"], null);
69840
+ if (this.comment.resolver) {
69841
+ addClass(root2, "resolved");
69842
+ }
69504
69843
  return root2;
69505
69844
  });
69506
69845
  __publicField(this, "createChildrenList", () => {
@@ -69557,6 +69896,7 @@ ${codeText}
69557
69896
  this.mainItem = this.createItem();
69558
69897
  this.childrenList = this.createChildrenList();
69559
69898
  this.quickReply = this.createQuickReply();
69899
+ this.createFooter();
69560
69900
  this.editor.on("readonlyChanged", this.handleReadonlyChanged);
69561
69901
  this.resizeObserver = new index$g(this.handleResize);
69562
69902
  this.resizeObserver.observe(this.root);
@@ -69566,9 +69906,49 @@ ${codeText}
69566
69906
  const count = getCommentItemCountInGroupItem(this.root);
69567
69907
  return count;
69568
69908
  }
69909
+ createFooter() {
69910
+ if (!this.comment.resolver) {
69911
+ return null;
69912
+ }
69913
+ const footer = createElement("div", ["comment-item-footer"], this.root);
69914
+ const resolved = createElement("span", ["comment-resolved"], footer);
69915
+ const date = new Date(this.comment.modified);
69916
+ const resolver = this.comment.resolver;
69917
+ assert(logger$1h, resolver, "resolver should not be null");
69918
+ const html = i18n$1.t("comment.resolvedBy", { name: resolver.displayName, date: fromNowString(date) });
69919
+ resolved.innerHTML = html;
69920
+ const actions2 = createElement("div", ["comment-actions"], footer);
69921
+ createElement("span", ["comment-date"], actions2, fromNowString(new Date(resolver.date)));
69922
+ if (this.comment.removedFromDoc) {
69923
+ createElement("span", ["removed-tips"], actions2, i18n$1.t("comment.removedFromDoc"));
69924
+ } else {
69925
+ const reopen = createElement("button", ["comment-reopen"], actions2, i18n$1.t("comment.reopen"));
69926
+ reopen.onclick = () => {
69927
+ const editor = this.editor;
69928
+ const doc2 = editor.doc.toJSON();
69929
+ const commentsMap = getCommentsFromDoc(doc2);
69930
+ if (!commentsMap.has(this.comment.groupId)) {
69931
+ showToast(i18n$1.t("comment.commentHasAlreadyRemoved"), {
69932
+ position: {
69933
+ y: 30,
69934
+ x: window.innerWidth / 2
69935
+ },
69936
+ theme: "warn"
69937
+ });
69938
+ return;
69939
+ }
69940
+ this.commentsProvider.localUpdateCommentResolver(this.comment.id, void 0);
69941
+ };
69942
+ }
69943
+ return footer;
69944
+ }
69569
69945
  createQuickReply() {
69570
69946
  const { editor, commentsProvider, comment } = this;
69571
69947
  const commentQuickReply = new CommentQuickReply(editor, commentsProvider, comment, this);
69948
+ const commentOptions = this.editor.getComponentOptions("comment");
69949
+ if (commentOptions == null ? void 0 : commentOptions.disableReply) {
69950
+ commentQuickReply.root.classList.add("hidden");
69951
+ }
69572
69952
  this.root.append(commentQuickReply.root);
69573
69953
  return commentQuickReply;
69574
69954
  }
@@ -69580,8 +69960,15 @@ ${codeText}
69580
69960
  const switchContainer = createElement("span", ["item-head-switch"], head);
69581
69961
  const switchUp = createTextButton(switchContainer, GroupItemActions.SwitchUp, "up", switchUpIcon);
69582
69962
  const switchDown = createTextButton(switchContainer, GroupItemActions.SwitchDown, "down", switchDownIcon);
69963
+ const resolve = createTextButton(switchContainer, GroupItemActions.Resolve, "resolve", CircleCheckMarkIcon);
69583
69964
  addGroupActionToElement(switchUp, GroupItemActions.SwitchUp);
69584
69965
  addGroupActionToElement(switchDown, GroupItemActions.SwitchDown);
69966
+ addGroupActionToElement(resolve, GroupItemActions.Resolve);
69967
+ resolve.setAttribute(`data-editor-tooltip-${this.editor.clientId}`, i18n$1.t("comment.resolveComment"));
69968
+ addClass(resolve, "disable-active");
69969
+ if (comment.resolver) {
69970
+ addClass(resolve, "resolved");
69971
+ }
69585
69972
  return head;
69586
69973
  }
69587
69974
  createItem() {
@@ -69621,6 +70008,7 @@ ${codeText}
69621
70008
  handleUpdateMainComment(comment) {
69622
70009
  assert(logger$1h, comment.id === this.mainItem.comment.id, "invalid comment");
69623
70010
  this.mainItem.reloadDoc();
70011
+ this.setCreatingComment(false);
69624
70012
  }
69625
70013
  deleteMainComment(commentId) {
69626
70014
  assert(logger$1h, commentId === this.mainItem.comment.id, "invalid comment");
@@ -69629,6 +70017,18 @@ ${codeText}
69629
70017
  edit() {
69630
70018
  this.mainItem.edit();
69631
70019
  }
70020
+ setCreatingComment(creating) {
70021
+ const resolveButton = this.header.querySelector('.editor-text-button[group-item-action="resolve"]');
70022
+ if (!resolveButton) {
70023
+ return;
70024
+ }
70025
+ resolveButton.disabled = creating;
70026
+ if (creating) {
70027
+ resolveButton.classList.add("disabled");
70028
+ } else {
70029
+ resolveButton.classList.remove("disabled");
70030
+ }
70031
+ }
69632
70032
  destroy() {
69633
70033
  this.quickReply.destroy();
69634
70034
  this.mainItem.destroy();
@@ -69814,7 +70214,21 @@ ${codeText}
69814
70214
  this.commentsProvider.localDeleteComment(comment.id);
69815
70215
  quickReply.show();
69816
70216
  });
69817
- __publicField(this, "execute", (element, groupItem, commentId, itemIndex) => {
70217
+ __publicField(this, "handleResolve", (groupItem) => {
70218
+ var _a;
70219
+ const { commentsProvider } = this;
70220
+ let comment = commentsProvider.getComment(groupItem.comment.id);
70221
+ if (!comment) {
70222
+ comment = (_a = groupItem.childrenList.items[0]) == null ? void 0 : _a.comment;
70223
+ }
70224
+ const user = this.groupList.editor.doc.getUser();
70225
+ commentsProvider.localUpdateCommentResolver(comment.id, {
70226
+ userId: user.userId,
70227
+ displayName: user.displayName,
70228
+ date: Date.now()
70229
+ });
70230
+ });
70231
+ __publicField(this, "execute", (element, groupItem, commentId, itemIndex, event) => {
69818
70232
  const actionElement = getClosestGroupItemActionElement(element);
69819
70233
  if (!actionElement)
69820
70234
  return;
@@ -69853,6 +70267,11 @@ ${codeText}
69853
70267
  case GroupItemActions.QuickReplyCancel:
69854
70268
  this.handleQuickReplyCancel(groupItem);
69855
70269
  break;
70270
+ case GroupItemActions.Resolve:
70271
+ event.preventDefault();
70272
+ event.stopPropagation();
70273
+ this.handleResolve(groupItem);
70274
+ break;
69856
70275
  default:
69857
70276
  const exhaustiveCheck = actionId;
69858
70277
  logger$1f.debug(`not implement handler for ${exhaustiveCheck}`);
@@ -69866,8 +70285,8 @@ ${codeText}
69866
70285
  }
69867
70286
  const logger$1e = getLogger("comment-group-list");
69868
70287
  class CommentGroupList extends ListBase {
69869
- constructor(editor, commentsProvider, parent) {
69870
- super(editor, commentsProvider, parent, getCommentsGroupFromDoc(editor, commentsProvider), {});
70288
+ constructor(editor, commentsProvider, parent, type) {
70289
+ super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
69871
70290
  __publicField(this, "groupItemHandlers");
69872
70291
  __publicField(this, "dispatchScroll", debounce__default.default(() => {
69873
70292
  this.editor.scrollContainer.dispatchEvent(new Event("scroll"));
@@ -69905,7 +70324,9 @@ ${codeText}
69905
70324
  const commentId = getClosestCommentItemId(event.target);
69906
70325
  const index2 = this.items.findIndex((item) => item.root === itemRoot);
69907
70326
  if (index2 !== -1) {
69908
- if (this.activeIndex !== index2) {
70327
+ const disableActive = !!event.target.closest(".disable-active");
70328
+ const enableActive = !disableActive;
70329
+ if (this.activeIndex !== index2 && enableActive) {
69909
70330
  this.setActiveItem(index2);
69910
70331
  }
69911
70332
  const { groupItemHandlers } = this;
@@ -69913,7 +70334,8 @@ ${codeText}
69913
70334
  event.target,
69914
70335
  this.items[index2],
69915
70336
  commentId,
69916
- index2
70337
+ index2,
70338
+ event
69917
70339
  );
69918
70340
  }
69919
70341
  });
@@ -69954,7 +70376,10 @@ ${codeText}
69954
70376
  __publicField(this, "handleSelectionChanged", () => {
69955
70377
  setTimeout(() => {
69956
70378
  var _a;
69957
- const commentIds = getCommentsFromSelection(this.editor);
70379
+ if (this.type !== "current") {
70380
+ return;
70381
+ }
70382
+ const commentIds = this.type === "current" ? removeResolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor)) : removeUnresolvedComments(this.commentsProvider, getCommentsFromSelection(this.editor));
69958
70383
  if (commentIds.length > 0) {
69959
70384
  if (((_a = this.activeItem) == null ? void 0 : _a.comment.id) && commentIds.includes(this.activeItem.comment.id)) {
69960
70385
  return;
@@ -69995,7 +70420,9 @@ ${codeText}
69995
70420
  const top = Number.parseFloat(firstItem.style.top);
69996
70421
  const targetTop = Number.parseFloat(firstItem.getAttribute("data-target-top") || "0");
69997
70422
  if (!Number.isNaN(top) && !Number.isNaN(targetTop) && top < targetTop) {
69998
- arrangeItems(this.editor, this.items, null, Math.min(top + (0 - event.deltaY) * 3, targetTop));
70423
+ if (this.type === "current") {
70424
+ arrangeItems(this.editor, this.items, null, Math.min(top + (0 - event.deltaY) * 3, targetTop));
70425
+ }
69999
70426
  }
70000
70427
  });
70001
70428
  __publicField(this, "updateGroupItemSwitch", () => {
@@ -70004,7 +70431,7 @@ ${codeText}
70004
70431
  activeItem.updateSwitchButton();
70005
70432
  });
70006
70433
  __publicField(this, "updateComments", debounce__default.default(() => {
70007
- const commentsGroup = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70434
+ const commentsGroup = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70008
70435
  let hasBeenChanged = false;
70009
70436
  for (let i = 0; i < commentsGroup.length; i++) {
70010
70437
  const comment = commentsGroup[i];
@@ -70027,6 +70454,8 @@ ${codeText}
70027
70454
  this.emit("commentCountChanged");
70028
70455
  }
70029
70456
  }, 100));
70457
+ this.editor = editor;
70458
+ this.type = type;
70030
70459
  this.updateItemsLayout();
70031
70460
  this.bindEvents();
70032
70461
  this.editor.addListener("selectionChanged", this.handleSelectionChanged);
@@ -70047,7 +70476,9 @@ ${codeText}
70047
70476
  document.removeEventListener("click", this.handleDocumentClick);
70048
70477
  }
70049
70478
  updateItemsLayout(dispatchScroll = true) {
70050
- arrangeItems(this.editor, this.items, this.activeItem);
70479
+ if (this.type === "current") {
70480
+ arrangeItems(this.editor, this.items, this.activeItem);
70481
+ }
70051
70482
  if (dispatchScroll) {
70052
70483
  this.dispatchScroll();
70053
70484
  }
@@ -70071,7 +70502,7 @@ ${codeText}
70071
70502
  return item;
70072
70503
  }
70073
70504
  findInsertPos(data2) {
70074
- const commentsMap = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
70505
+ const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70075
70506
  const index2 = commentsMap.findIndex((group) => group.id === data2.id);
70076
70507
  if (index2 === -1) {
70077
70508
  return -1;
@@ -70171,6 +70602,7 @@ ${codeText}
70171
70602
  newItem.quickReply.hide();
70172
70603
  setTimeout(() => {
70173
70604
  newItem.edit();
70605
+ newItem.setCreatingComment(true);
70174
70606
  }, 300);
70175
70607
  }
70176
70608
  }
@@ -70195,6 +70627,18 @@ ${codeText}
70195
70627
  }
70196
70628
  }
70197
70629
  }
70630
+ handleResolveComment(commentId) {
70631
+ const item = this.findItem(commentId);
70632
+ if (item) {
70633
+ this.deleteItem(item.comment.id);
70634
+ }
70635
+ }
70636
+ removeGroupItem(comment) {
70637
+ const item = this.findItem(comment.id) || this.findItem(comment.groupId);
70638
+ if (item) {
70639
+ this.deleteItem(item.comment.id);
70640
+ }
70641
+ }
70198
70642
  handleUpdateComment(comment) {
70199
70643
  const group = this.findItemAsGroupId(comment.groupId);
70200
70644
  if (group && group.comment.id !== comment.id) {
@@ -70206,6 +70650,236 @@ ${codeText}
70206
70650
  item.handleUpdateMainComment(comment);
70207
70651
  }
70208
70652
  }
70653
+ changeType(type) {
70654
+ this.type = type;
70655
+ const comments = this.type === "current" ? getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider) : getResolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70656
+ this.reloadList(comments);
70657
+ if (this.type === "current") {
70658
+ setTimeout(() => {
70659
+ arrangeItems(this.editor, this.items, null);
70660
+ });
70661
+ }
70662
+ }
70663
+ reloadList(data2) {
70664
+ super.reloadList(data2);
70665
+ this._items.forEach((item) => item.addListener("resize", this.handleItemResize));
70666
+ }
70667
+ }
70668
+ function addBlockComments(doc2, block, resultMap) {
70669
+ if (block.comments) {
70670
+ const blockComments = block.comments;
70671
+ if (Array.isArray(blockComments)) {
70672
+ blockComments.forEach((commentId) => {
70673
+ const commentIds = resultMap.get(block.id);
70674
+ if (commentIds) {
70675
+ commentIds.add(commentId);
70676
+ } else {
70677
+ resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
70678
+ }
70679
+ });
70680
+ }
70681
+ }
70682
+ if (block.text) {
70683
+ const text2 = block.text;
70684
+ text2.forEach((op) => {
70685
+ if (op.attributes) {
70686
+ const prefix = "comment-";
70687
+ Object.entries(op.attributes).forEach(([key, value]) => {
70688
+ if (key.startsWith(prefix)) {
70689
+ const commentId = value;
70690
+ const commentIds = resultMap.get(block.id);
70691
+ if (commentIds) {
70692
+ commentIds.add(commentId);
70693
+ } else {
70694
+ resultMap.set(block.id, /* @__PURE__ */ new Set([commentId]));
70695
+ }
70696
+ }
70697
+ });
70698
+ }
70699
+ });
70700
+ }
70701
+ const children = block.children;
70702
+ if (!children) {
70703
+ return;
70704
+ }
70705
+ children.forEach((childContainerId) => {
70706
+ const childBlocks = doc2.blocks[childContainerId];
70707
+ childBlocks.forEach((subBlock) => {
70708
+ addBlockComments(doc2, subBlock, resultMap);
70709
+ });
70710
+ });
70711
+ }
70712
+ function getBlockCommentsFromDoc(doc2) {
70713
+ const resultMap = /* @__PURE__ */ new Map();
70714
+ doc2.blocks.root.forEach((block) => {
70715
+ addBlockComments(doc2, block, resultMap);
70716
+ });
70717
+ return resultMap;
70718
+ }
70719
+ function getBlocksByCommentId(doc2, commentId) {
70720
+ const result = [];
70721
+ const resultMap = getBlockCommentsFromDoc(doc2);
70722
+ resultMap.forEach((commentIds, blockId) => {
70723
+ if (commentIds.has(commentId)) {
70724
+ result.push(blockId);
70725
+ }
70726
+ });
70727
+ return result;
70728
+ }
70729
+ class OnesEditorCommentsRender {
70730
+ constructor(type = "current") {
70731
+ __publicField(this, "updateUnknownCommentsDelayed", debounce__default.default((editor) => {
70732
+ const comments = this.getComments(editor);
70733
+ const invisibleComments = Object.values(comments).filter((comment) => {
70734
+ const ret = this.type === "current" ? !!comment.resolver : !comment.resolver;
70735
+ return ret;
70736
+ });
70737
+ const root2 = editor.rootContainer;
70738
+ const effectedElements = /* @__PURE__ */ new Set();
70739
+ invisibleComments.forEach((comment) => {
70740
+ const key = `comment-${comment.groupId.toLocaleLowerCase()}`;
70741
+ const elements = root2.querySelectorAll(`[${key}]`);
70742
+ elements.forEach((elem) => {
70743
+ elem.removeAttribute(key);
70744
+ effectedElements.add(elem);
70745
+ });
70746
+ });
70747
+ effectedElements.forEach((elem) => {
70748
+ const commentAttributes = Array.from(elem.attributes).filter((a) => a.name.startsWith("comment-"));
70749
+ if (commentAttributes.length === 0) {
70750
+ elem.classList.remove("comment");
70751
+ }
70752
+ });
70753
+ }));
70754
+ this.type = type;
70755
+ }
70756
+ renderText(editor, path, attributes) {
70757
+ const classes = [];
70758
+ const textAttributes = {};
70759
+ Object.entries(attributes).forEach(([key, value]) => {
70760
+ if (key.startsWith("comment-")) {
70761
+ this.renderCommentElement(editor, key, value, classes, textAttributes);
70762
+ }
70763
+ });
70764
+ return { classes, attributes: textAttributes };
70765
+ }
70766
+ renderBox(editor, path, attributes) {
70767
+ const classes = [];
70768
+ const textAttributes = {};
70769
+ Object.entries(attributes).forEach(([key, value]) => {
70770
+ if (key.startsWith("comment-")) {
70771
+ this.renderCommentElement(editor, key, value, classes, textAttributes);
70772
+ }
70773
+ });
70774
+ return { classes, attributes: textAttributes };
70775
+ }
70776
+ renderBlock(editor, path, blockData) {
70777
+ const comments = blockData.comments;
70778
+ if (!comments || comments.length === 0) {
70779
+ return {};
70780
+ }
70781
+ const classes = [];
70782
+ const attributes = {};
70783
+ comments.forEach((commentId) => {
70784
+ const key = `comment-${commentId.toLocaleLowerCase()}`;
70785
+ this.renderCommentElement(editor, key, commentId, classes, attributes);
70786
+ });
70787
+ return {
70788
+ classes,
70789
+ attributes
70790
+ };
70791
+ }
70792
+ updateBlock(editor, path, blockElement, blockData) {
70793
+ const comments = blockData.comments;
70794
+ removeClass(blockElement, "comment");
70795
+ Array.from(blockElement.attributes).forEach((a) => {
70796
+ if (a.name.startsWith("comment-")) {
70797
+ blockElement.removeAttribute(a.name);
70798
+ }
70799
+ });
70800
+ if (!comments || comments.length === 0) {
70801
+ return;
70802
+ }
70803
+ if (this.type === "resolved") {
70804
+ return;
70805
+ }
70806
+ addClass(blockElement, "comment");
70807
+ const classList = [];
70808
+ const attributes = {};
70809
+ comments.forEach((commentId) => {
70810
+ const key = `comment-${commentId.toLocaleLowerCase()}`;
70811
+ this.renderCommentElement(editor, key, commentId, classList, attributes);
70812
+ });
70813
+ Object.entries(attributes).forEach(([key, value]) => {
70814
+ blockElement.setAttribute(key, value);
70815
+ });
70816
+ if (classList.length > 0) {
70817
+ addClass(blockElement, ...classList);
70818
+ }
70819
+ }
70820
+ getCommentStatus(editor, commentId) {
70821
+ const comments = editor.findCustom("editor-comments");
70822
+ if (!comments) {
70823
+ return "unknown";
70824
+ }
70825
+ const commentsProvider = comments.commentProvider;
70826
+ const comment = commentsProvider.getComment(commentId);
70827
+ if (!comment) {
70828
+ return "unknown";
70829
+ }
70830
+ if (comment.resolver) {
70831
+ return "resolved";
70832
+ }
70833
+ return "unresolved";
70834
+ }
70835
+ renderCommentElement(editor, key, commentId, classes, textAttributes) {
70836
+ const status = this.getCommentStatus(editor, commentId);
70837
+ if (this.type === "current") {
70838
+ if (status === "resolved") {
70839
+ return;
70840
+ }
70841
+ } else {
70842
+ return;
70843
+ }
70844
+ classes.push("comment");
70845
+ textAttributes[key] = commentId;
70846
+ if (status === "unknown") {
70847
+ this.updateUnknownCommentsDelayed(editor);
70848
+ }
70849
+ }
70850
+ getComments(editor) {
70851
+ const editorComments = editor.findCustom("editor-comments");
70852
+ if (!editorComments) {
70853
+ return [];
70854
+ }
70855
+ const commentProvider = editorComments.commentProvider;
70856
+ return commentProvider.getComments();
70857
+ }
70858
+ changeType(editor, type) {
70859
+ this.type = type;
70860
+ const elements = editor.rootContainer.querySelectorAll(".comment");
70861
+ elements.forEach((elem) => {
70862
+ elem.classList.remove("comment");
70863
+ Array.from(elem.attributes).forEach((a) => {
70864
+ if (a.name.startsWith("comment-")) {
70865
+ elem.removeAttribute(a.name);
70866
+ }
70867
+ });
70868
+ });
70869
+ const comments = this.getComments(editor);
70870
+ const resolvedCommentsId = new Set(Object.values(comments).filter((comment) => !!comment.resolver).map((comment) => comment.groupId));
70871
+ const unresolvedCommentsId = new Set(Object.values(comments).filter((comment) => !resolvedCommentsId.has(comment.groupId)).map((comment) => comment.groupId));
70872
+ const visibleCommentsId = type === "current" ? unresolvedCommentsId : resolvedCommentsId;
70873
+ const commentsFromDoc = getBlockCommentsFromDoc(editor.doc.toJSON());
70874
+ commentsFromDoc.forEach((commentIds, blockId) => {
70875
+ if (Array.from(commentIds).some((c) => visibleCommentsId.has(c))) {
70876
+ const block = editor.findBlockById(blockId);
70877
+ if (block) {
70878
+ editor.reloadBlock(block);
70879
+ }
70880
+ }
70881
+ });
70882
+ }
70209
70883
  }
70210
70884
  const COMMENT_MINI_CLS = "comment-mini";
70211
70885
  getLogger("comment-list");
@@ -70215,6 +70889,46 @@ ${codeText}
70215
70889
  __publicField(this, "root");
70216
70890
  __publicField(this, "groupsContainer");
70217
70891
  __publicField(this, "list");
70892
+ __publicField(this, "listType", "current");
70893
+ __publicField(this, "switcherItem", {
70894
+ id: "switch-comment",
70895
+ name: i18n$1.t("comment.currentComment"),
70896
+ dropdown: true,
70897
+ manualShowChildren: true,
70898
+ childrenPlacement: "bottom-start",
70899
+ children: [{
70900
+ id: "current-comment",
70901
+ name: i18n$1.t("comment.currentComment"),
70902
+ states: ["checked"]
70903
+ }, {
70904
+ id: "resolved-comment",
70905
+ name: i18n$1.t("comment.resolvedComment")
70906
+ }]
70907
+ });
70908
+ __publicField(this, "switcherBar");
70909
+ __publicField(this, "noCommentTip", null);
70910
+ __publicField(this, "handleSwitchType", (bar2, item) => {
70911
+ var _a, _b;
70912
+ if (item.id === "current-comment") {
70913
+ this.listType = "current";
70914
+ } else {
70915
+ this.listType = "resolved";
70916
+ }
70917
+ this.editor.rootContainer.setAttribute("comment-list-type", this.listType);
70918
+ this.root.setAttribute("list-type", this.listType);
70919
+ this.switcherItem.name = this.listType === "current" ? i18n$1.t("comment.currentComment") : i18n$1.t("comment.resolvedComment");
70920
+ const children = this.switcherItem.children;
70921
+ children[0].states = this.listType === "current" ? ["checked"] : [];
70922
+ children[1].states = this.listType === "resolved" ? ["checked"] : [];
70923
+ this.switcherBar.updateItems([this.switcherItem]);
70924
+ this.list.changeType(this.listType);
70925
+ const renderer = this.editor.editorBlockRenders.getRenderers().find((r) => r instanceof OnesEditorCommentsRender);
70926
+ if (renderer) {
70927
+ renderer.changeType(this.editor, this.listType);
70928
+ }
70929
+ this.updateCommentCountTip();
70930
+ (_b = (_a = this.commentOptions) == null ? void 0 : _a.onCommentListTypeChange) == null ? void 0 : _b.call(_a, this.editor, this.listType);
70931
+ });
70218
70932
  __publicField(this, "handleSelectionOnComment", () => {
70219
70933
  this.emit("onSelectComment");
70220
70934
  });
@@ -70222,8 +70936,12 @@ ${codeText}
70222
70936
  var _a, _b;
70223
70937
  const count = getCommentsCountInDoc(this.editor, this.commentsProvider);
70224
70938
  (_b = (_a = this.commentOptions) == null ? void 0 : _a.onCommentCountChange) == null ? void 0 : _b.call(_a, count);
70939
+ this.updateCommentCountTip();
70225
70940
  });
70226
70941
  __publicField(this, "handleActiveItemChanged", (index2, direction) => {
70942
+ if (this.listType === "resolved") {
70943
+ return;
70944
+ }
70227
70945
  setTimeout(() => {
70228
70946
  var _a, _b;
70229
70947
  const item = this.list.activeItem;
@@ -70240,13 +70958,19 @@ ${codeText}
70240
70958
  this.editor = editor;
70241
70959
  this.commentsProvider = commentsProvider;
70242
70960
  this.root = createElement("div", ["editor-web-comment-root"], null);
70961
+ this.root.setAttribute("list-type", this.listType);
70243
70962
  this.groupsContainer = createElement("div", ["comment-groups-container"], this.root);
70244
70963
  this.list = this.createList();
70964
+ this.switcherBar = this.createSwitcher();
70245
70965
  this.commentsProvider.addListener(this);
70246
70966
  this.list.addListener("activeItemChanged", this.handleActiveItemChanged);
70247
70967
  this.list.addListener("itemLayoutUpdated", this.handleItemLayoutUpdated);
70248
70968
  this.list.addListener("selectionOnComment", this.handleSelectionOnComment);
70249
70969
  this.list.addListener("commentCountChanged", this.updateCommentCount);
70970
+ if (!this.editor.options.enableResolveComments) {
70971
+ this.root.classList.add("disable-resolve");
70972
+ }
70973
+ this.editor.rootContainer.setAttribute("comment-list-type", this.listType);
70250
70974
  this.updateCommentCount();
70251
70975
  }
70252
70976
  get commentOptions() {
@@ -70254,10 +70978,13 @@ ${codeText}
70254
70978
  return commentOptions;
70255
70979
  }
70256
70980
  destroy() {
70981
+ var _a;
70257
70982
  this.list.removeAllListeners();
70258
70983
  this.commentsProvider.removeListener(this);
70259
70984
  this.list.destroy();
70260
70985
  this.root.remove();
70986
+ this.switcherBar.destroy();
70987
+ (_a = this.noCommentTip) == null ? void 0 : _a.remove();
70261
70988
  }
70262
70989
  onCreateComment(commentId, local) {
70263
70990
  const comment = this.commentsProvider.getComment(commentId);
@@ -70272,8 +70999,73 @@ ${codeText}
70272
70999
  const comment = this.commentsProvider.getComment(commentId);
70273
71000
  this.list.handleUpdateComment(comment);
70274
71001
  }
71002
+ onUpdateCommentResolver(commentId, local) {
71003
+ const comment = this.commentsProvider.getComment(commentId);
71004
+ if (!comment) {
71005
+ return;
71006
+ }
71007
+ let type = "add";
71008
+ if (this.listType === "current") {
71009
+ if (comment.resolver) {
71010
+ type = "remove";
71011
+ }
71012
+ } else {
71013
+ if (!comment.resolver) {
71014
+ type = "remove";
71015
+ }
71016
+ }
71017
+ const blocks = /* @__PURE__ */ new Set();
71018
+ if (type === "remove") {
71019
+ getElementsByCommentId(this.editor, comment.groupId).forEach((element) => {
71020
+ if (isBlock$1(element)) {
71021
+ blocks.add(element);
71022
+ } else {
71023
+ const block = getParentBlock(element);
71024
+ if (block) {
71025
+ blocks.add(block);
71026
+ }
71027
+ }
71028
+ });
71029
+ } else {
71030
+ const blockIds = getBlocksByCommentId(this.editor.doc.toJSON(), comment.groupId);
71031
+ blockIds.forEach((blockId) => {
71032
+ const block = this.editor.findBlockById(blockId);
71033
+ if (block) {
71034
+ blocks.add(block);
71035
+ }
71036
+ });
71037
+ }
71038
+ blocks.forEach((block) => {
71039
+ this.editor.reloadBlock(block);
71040
+ });
71041
+ const commentGroup = getCommentsGroup(this.commentsProvider.getComments());
71042
+ const commentWithChildren = commentGroup.find((group) => group.groupId === comment.groupId);
71043
+ if (!commentWithChildren) {
71044
+ return;
71045
+ }
71046
+ setTimeout(() => {
71047
+ if (type === "add") {
71048
+ this.list.handleCreateComment(commentWithChildren, local);
71049
+ } else {
71050
+ this.list.removeGroupItem(comment);
71051
+ }
71052
+ this.updateCommentCount();
71053
+ }, 300);
71054
+ }
70275
71055
  createList() {
70276
- return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer);
71056
+ return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer, this.listType);
71057
+ }
71058
+ createSwitcher() {
71059
+ const container = createElement("div", ["comment-switcher-container"], this.root);
71060
+ const commandBar2 = new FixedToolbar(container, [this.switcherItem], {
71061
+ id: "comment-switcher"
71062
+ });
71063
+ commandBar2.addListener("click", this.handleSwitchType);
71064
+ return commandBar2;
71065
+ }
71066
+ setSwitcherParent(parent) {
71067
+ this.switcherBar.content.remove();
71068
+ parent.append(this.switcherBar.content);
70277
71069
  }
70278
71070
  isEditing(includeEmpty) {
70279
71071
  return this.list.isEditing(includeEmpty);
@@ -70281,14 +71073,49 @@ ${codeText}
70281
71073
  setFirstEditingCommentActive() {
70282
71074
  this.list.setFirstEditingCommentActive();
70283
71075
  }
70284
- show(groupId) {
71076
+ getListType() {
71077
+ return this.listType;
71078
+ }
71079
+ setListType(type) {
71080
+ var _a, _b;
71081
+ if (type === "resolved") {
71082
+ const item = (_a = this.switcherItem.children) == null ? void 0 : _a[1];
71083
+ this.handleSwitchType(this.switcherBar, item);
71084
+ } else {
71085
+ const item = (_b = this.switcherItem.children) == null ? void 0 : _b[0];
71086
+ this.handleSwitchType(this.switcherBar, item);
71087
+ }
71088
+ }
71089
+ updateCommentCountTip() {
70285
71090
  var _a;
71091
+ (_a = this.noCommentTip) == null ? void 0 : _a.remove();
71092
+ this.noCommentTip = null;
71093
+ if (this.listType === "resolved" && this.list.items.length === 0) {
71094
+ if (!this.noCommentTip) {
71095
+ this.noCommentTip = createElement("div", ["no-comment-tip"], this.groupsContainer);
71096
+ this.noCommentTip.innerText = i18n$1.t("comment.noResolvedComment");
71097
+ }
71098
+ return;
71099
+ }
71100
+ if (this.listType === "current" && this.list.items.length === 0) {
71101
+ if (!this.noCommentTip) {
71102
+ this.noCommentTip = createElement("div", ["no-comment-tip"], this.groupsContainer);
71103
+ this.noCommentTip.innerText = i18n$1.t("comment.noCurrentComment");
71104
+ }
71105
+ }
71106
+ }
71107
+ show(groupId) {
71108
+ var _a, _b;
70286
71109
  removeClass(this.root, "hidden");
70287
71110
  if (groupId) {
71111
+ if (this.listType !== "current") {
71112
+ const commandItem = (_a = this.switcherItem.children) == null ? void 0 : _a[0];
71113
+ this.handleSwitchType(this.switcherBar, commandItem);
71114
+ }
70288
71115
  const index2 = this.list.findItemIndex(groupId);
70289
71116
  this.list.setActiveItem(index2);
70290
71117
  }
70291
- (_a = this.commentOptions) == null ? void 0 : _a.controller.showCommentList();
71118
+ (_b = this.commentOptions) == null ? void 0 : _b.controller.showCommentList();
70292
71119
  }
70293
71120
  hide() {
70294
71121
  addClass(this.root, "hidden");
@@ -70416,7 +71243,7 @@ ${codeText}
70416
71243
  const logger$1c = getLogger("mobile-group-list");
70417
71244
  class MobileGroupList extends ListBase {
70418
71245
  constructor(editor, commentsProvider, parent, scrollElement) {
70419
- super(editor, commentsProvider, parent, getCommentsGroupFromDoc(editor, commentsProvider), {});
71246
+ super(editor, commentsProvider, parent, getUnresolvedCommentsGroupFromDoc(editor, commentsProvider), {});
70420
71247
  __publicField(this, "scroller");
70421
71248
  __publicField(this, "refreshScroller", () => {
70422
71249
  this.scroller.refresh();
@@ -70464,7 +71291,7 @@ ${codeText}
70464
71291
  this.updateComments();
70465
71292
  });
70466
71293
  __publicField(this, "updateComments", debounce__default.default(() => {
70467
- const commentsGroup = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
71294
+ const commentsGroup = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70468
71295
  for (let i = 0; i < commentsGroup.length; i++) {
70469
71296
  const comment = commentsGroup[i];
70470
71297
  const groupItem = this.findGroupItem(comment.groupId);
@@ -70498,7 +71325,7 @@ ${codeText}
70498
71325
  return item;
70499
71326
  }
70500
71327
  findInsertPos(data2) {
70501
- const commentsMap = getCommentsGroupFromDoc(this.editor, this.commentsProvider);
71328
+ const commentsMap = getUnresolvedCommentsGroupFromDoc(this.editor, this.commentsProvider);
70502
71329
  const index2 = commentsMap.findIndex((group) => group.id === data2.id);
70503
71330
  if (index2 === -1) {
70504
71331
  return -1;
@@ -70634,6 +71461,8 @@ ${codeText}
70634
71461
  const comment = this.commentsProvider.getComment(commentId);
70635
71462
  this.list.handleUpdateComment(comment);
70636
71463
  }
71464
+ onUpdateCommentResolver(commentId, local) {
71465
+ }
70637
71466
  get commentOptions() {
70638
71467
  const commentOptions = this.editor.getComponentOptions("comment");
70639
71468
  return commentOptions;
@@ -70659,7 +71488,7 @@ ${codeText}
70659
71488
  }
70660
71489
  }
70661
71490
  function getMiniCommentsGroupFromDoc(editor, commentsProvider) {
70662
- const commentsGroupFromDoc = getCommentsGroupFromDoc(editor, commentsProvider);
71491
+ const commentsGroupFromDoc = getUnresolvedCommentsGroupFromDoc(editor, commentsProvider);
70663
71492
  const miniCommentGroups = /* @__PURE__ */ new Map();
70664
71493
  for (const commentGroup of commentsGroupFromDoc) {
70665
71494
  const blockId = getBlockIdByGroupId(editor, commentGroup.groupId);
@@ -70806,6 +71635,9 @@ ${codeText}
70806
71635
  }
70807
71636
  onUpdateComment(commentId, local) {
70808
71637
  }
71638
+ onUpdateCommentResolver(commentId, local) {
71639
+ this.list.updateMiniCommentsGroup();
71640
+ }
70809
71641
  show() {
70810
71642
  removeClass(this.root, "hidden");
70811
71643
  }
@@ -71034,12 +71866,18 @@ ${codeText}
71034
71866
  (_b = this.commentList) == null ? void 0 : _b.show(groupId);
71035
71867
  }
71036
71868
  });
71037
- __publicField(this, "showCommentList", (groupId) => {
71869
+ __publicField(this, "showCommentList", (groupId, type) => {
71870
+ var _a, _b;
71038
71871
  if (this.isMobile) {
71039
71872
  this.showComment("mobile", groupId);
71040
71873
  } else {
71041
71874
  this.showComment("web", groupId);
71042
71875
  }
71876
+ if (type) {
71877
+ (_a = this.getCommentList()) == null ? void 0 : _a.setListType(type);
71878
+ } else if (type === void 0) {
71879
+ (_b = this.getCommentList()) == null ? void 0 : _b.setListType("current");
71880
+ }
71043
71881
  });
71044
71882
  __publicField(this, "handleCommentListClose", () => {
71045
71883
  this.showComment("mini");
@@ -71074,6 +71912,15 @@ ${codeText}
71074
71912
  get isMobile() {
71075
71913
  return clientType.isMobile;
71076
71914
  }
71915
+ getCommentList() {
71916
+ return this.commentList;
71917
+ }
71918
+ getMobileCommentList() {
71919
+ return this.mobileCommentList;
71920
+ }
71921
+ getMiniCommentList() {
71922
+ return this.miniCommentList;
71923
+ }
71077
71924
  destroy() {
71078
71925
  var _a, _b;
71079
71926
  (_a = this.commentList) == null ? void 0 : _a.destroy();
@@ -71099,6 +71946,9 @@ ${codeText}
71099
71946
  if (containers.mobileContainer && this.mobileCommentList) {
71100
71947
  containers.mobileContainer.append(this.mobileCommentList.root);
71101
71948
  }
71949
+ if (containers.switchBarContainer && this.commentList) {
71950
+ this.commentList.setSwitcherParent(containers.switchBarContainer);
71951
+ }
71102
71952
  }
71103
71953
  }
71104
71954
  const style$7 = "";
@@ -71122,7 +71972,16 @@ ${codeText}
71122
71972
  more: "\u66F4\u591A",
71123
71973
  comment: "\u6DFB\u52A0\u6279\u6CE8",
71124
71974
  command: "\u6DFB\u52A0\u6279\u6CE8",
71125
- quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8"
71975
+ quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8",
71976
+ resolvedBy: '\u5DF2\u7531&nbsp;<span class="resolver-name">{name}</span>&nbsp;\u89E3\u51B3',
71977
+ reopen: "\u91CD\u65B0\u6253\u5F00",
71978
+ currentComment: "\u5F53\u524D\u6279\u6CE8",
71979
+ resolvedComment: "\u5DF2\u89E3\u51B3\u6279\u6CE8",
71980
+ removedFromDoc: "\u5F15\u7528\u5185\u5BB9\u5DF2\u5220\u9664",
71981
+ noCurrentComment: "\u6682\u65E0\u6279\u6CE8",
71982
+ noResolvedComment: "\u65E0\u5DF2\u89E3\u51B3\u6279\u6CE8",
71983
+ resolveComment: "\u6807\u8BB0\u4E3A\u5DF2\u89E3\u51B3",
71984
+ commentHasAlreadyRemoved: "\u5F15\u7528\u5185\u5BB9\u5DF2\u88AB\u5220\u9664\uFF0C\u4E0D\u53EF\u91CD\u65B0\u6253\u5F00\u6279\u6CE8"
71126
71985
  }
71127
71986
  };
71128
71987
  const zhHK$k = {
@@ -71168,7 +72027,16 @@ ${codeText}
71168
72027
  more: "More",
71169
72028
  comment: "Add annotation",
71170
72029
  command: "Add annotation",
71171
- quickMenuCommand: "Add annotation"
72030
+ quickMenuCommand: "Add annotation",
72031
+ resolvedBy: 'Resolved by&nbsp;<span class="resolver-name">{name}<span>',
72032
+ reopen: "Reopen",
72033
+ currentComment: "Unresolved annotations",
72034
+ resolvedComment: "Resolved annotations",
72035
+ removedFromDoc: "Quoted content deleted.",
72036
+ noCurrentComment: "No annotation.",
72037
+ noResolvedComment: "No resolved annotations.",
72038
+ resolveComment: "Mark as resolved",
72039
+ commentHasAlreadyRemoved: "Referenced content deleted. Comment can't be reopened."
71172
72040
  }
71173
72041
  };
71174
72042
  const jaJP$k = {
@@ -71191,7 +72059,16 @@ ${codeText}
71191
72059
  more: "\u305D\u306E\u4ED6",
71192
72060
  comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
71193
72061
  command: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
71194
- quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
72062
+ quickMenuCommand: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
72063
+ resolvedBy: '<span class="resolver-name">{name}</span>\u3055\u3093\u304C\u89E3\u6C7A\u3057\u307E\u3057\u305F',
72064
+ reopen: "\u518D\u958B",
72065
+ currentComment: "\u672A\u89E3\u6C7A\u30B3\u30E1\u30F3\u30C8",
72066
+ resolvedComment: "\u89E3\u6C7A\u6E08\u307F\u30B3\u30E1\u30F3\u30C8",
72067
+ removedFromDoc: "\u5F15\u7528\u3055\u308C\u305F\u5185\u5BB9\u306F\u524A\u9664\u3055\u308C\u307E\u3057\u305F\u3002",
72068
+ noCurrentComment: "\u6CE8\u91C8\u306A\u3057",
72069
+ noResolvedComment: "\u89E3\u6C7A\u6E08\u307F\u30B3\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
72070
+ resolveComment: "\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F",
72071
+ commentHasAlreadyRemoved: "\u5F15\u7528\u5143\u304C\u524A\u9664\u3055\u308C\u305F\u305F\u3081\u3001\u30B3\u30E1\u30F3\u30C8\u518D\u958B\u3067\u304D\u307E\u305B\u3093\u3002"
71195
72072
  }
71196
72073
  };
71197
72074
  i18n$1.mergeLang({
@@ -71200,61 +72077,6 @@ ${codeText}
71200
72077
  "en-US": enUS$k,
71201
72078
  "ja-JP": jaJP$k
71202
72079
  });
71203
- class OnesEditorCommentsRender {
71204
- renderText(editor, path, attributes) {
71205
- const classes = [];
71206
- const textAttributes = {};
71207
- Object.entries(attributes).forEach(([key, value]) => {
71208
- if (key.startsWith("comment-")) {
71209
- classes.push("comment");
71210
- textAttributes[key] = value;
71211
- }
71212
- });
71213
- return { classes, attributes: textAttributes };
71214
- }
71215
- renderBox(editor, path, attributes) {
71216
- const classes = [];
71217
- const textAttributes = {};
71218
- Object.entries(attributes).forEach(([key, value]) => {
71219
- if (key.startsWith("comment-")) {
71220
- classes.push("comment");
71221
- textAttributes[key] = value;
71222
- }
71223
- });
71224
- return { classes, attributes: textAttributes };
71225
- }
71226
- renderBlock(editor, path, blockData) {
71227
- const comments = blockData.comments;
71228
- if (!comments || comments.length === 0) {
71229
- return {};
71230
- }
71231
- const classes = ["comment"];
71232
- const attributes = {};
71233
- comments.forEach((commentId) => {
71234
- attributes[`comment-${commentId.toLocaleLowerCase()}`] = commentId;
71235
- });
71236
- return {
71237
- classes,
71238
- attributes
71239
- };
71240
- }
71241
- updateBlock(editor, path, blockElement, blockData) {
71242
- const comments = blockData.comments;
71243
- removeClass(blockElement, "comment");
71244
- Array.from(blockElement.attributes).forEach((a) => {
71245
- if (a.name.startsWith("comment-")) {
71246
- blockElement.removeAttribute(a.name);
71247
- }
71248
- });
71249
- if (!comments || comments.length === 0) {
71250
- return;
71251
- }
71252
- addClass(blockElement, "comment");
71253
- comments.forEach((commentId) => {
71254
- blockElement.setAttribute(`comment-${commentId.toLocaleLowerCase()}`, commentId);
71255
- });
71256
- }
71257
- }
71258
72080
  class OnesEditorCommentPlaceholderHandler {
71259
72081
  constructor(editor) {
71260
72082
  __publicField(this, "handleUpdateCompositionText", (editor, containerId, blockIndex, offset, end) => {
@@ -71406,6 +72228,21 @@ ${codeText}
71406
72228
  method: "delete"
71407
72229
  });
71408
72230
  }
72231
+ function updateCommentResolverToOldDoc(editor, version, commentId, resolver) {
72232
+ var _a, _b;
72233
+ const doc2 = editor.doc;
72234
+ const server = (_b = (_a = doc2.getServerMeta) == null ? void 0 : _a.call(doc2)) == null ? void 0 : _b.apiServer;
72235
+ assert(logger$16, server, "apiServer is not set");
72236
+ const api = `${server}/${version}/comments/${commentId}/resolver`;
72237
+ return doc2.request(api, {
72238
+ method: "put",
72239
+ data: {
72240
+ resolver
72241
+ }
72242
+ });
72243
+ }
72244
+ getLogger("resolved-comment-item");
72245
+ const styles = "";
71409
72246
  const isAllContainersSelected = (editor) => {
71410
72247
  var _a;
71411
72248
  const range = editor.selection.range;
@@ -71480,6 +72317,16 @@ ${codeText}
71480
72317
  await updateCommentToOldDoc(this.editor, this.version, commentId, comments.commentProvider.getCommentDoc(commentId));
71481
72318
  }
71482
72319
  }
72320
+ onUpdateCommentResolver(commentId, local) {
72321
+ const comments = this.editor.getCustom("editor-comments");
72322
+ const provider = comments.commentProvider;
72323
+ const comment = provider.getComment(commentId);
72324
+ if (!comment) {
72325
+ return;
72326
+ }
72327
+ const resolver = comment.resolver;
72328
+ updateCommentResolverToOldDoc(this.editor, this.version, commentId, resolver);
72329
+ }
71483
72330
  hideToolbar(editor) {
71484
72331
  const toolbar2 = editor.findCustom("toolbar-handler");
71485
72332
  toolbar2 == null ? void 0 : toolbar2.disableTextToolbar();
@@ -71506,6 +72353,7 @@ ${codeText}
71506
72353
  order: 60
71507
72354
  }],
71508
72355
  executeCommand: (editor2, block, item, child2) => {
72356
+ var _a2;
71509
72357
  if (!child2) {
71510
72358
  return;
71511
72359
  }
@@ -71516,6 +72364,7 @@ ${codeText}
71516
72364
  }
71517
72365
  this.hideToolbar(editor2);
71518
72366
  comments.showCommentList();
72367
+ (_a2 = comments.getCommentList()) == null ? void 0 : _a2.setListType("current");
71519
72368
  const offset = getChildOffset(block, child2);
71520
72369
  const range = createBlockSimpleRange(this.editor, block, offset.start, offset.end);
71521
72370
  const comment = addCommentToTextBlocks(editor2, range, comments.commentProvider);
@@ -71540,15 +72389,16 @@ ${codeText}
71540
72389
  order: 60
71541
72390
  }],
71542
72391
  executeCommand: (editor2, block, item) => {
72392
+ var _a2;
71543
72393
  if (item.id === "add-comment-to-old-doc") {
71544
72394
  const comments = editor2.getCustom("editor-comments");
71545
72395
  if (!comments) {
71546
72396
  return;
71547
72397
  }
71548
72398
  editor2.selection.selectBlock(block, 0, getBlockTextLength$6(editor2, block), { noScroll: true });
71549
- const editorComments = editor2.getCustom("editor-comments");
71550
- editorComments.showCommentList();
71551
- addCommentToBlock(editor2, block, editorComments.commentProvider);
72399
+ comments.showCommentList();
72400
+ (_a2 = comments.getCommentList()) == null ? void 0 : _a2.setListType("current");
72401
+ addCommentToBlock(editor2, block, comments.commentProvider);
71552
72402
  }
71553
72403
  }
71554
72404
  };
@@ -71573,12 +72423,14 @@ ${codeText}
71573
72423
  }];
71574
72424
  }
71575
72425
  executeCommand(editor, command, options) {
72426
+ var _a;
71576
72427
  if (command.id === "add-comment-to-old-doc/text") {
71577
72428
  const comments = editor.getCustom("editor-comments");
71578
72429
  if (!comments) {
71579
72430
  return;
71580
72431
  }
71581
72432
  comments.showCommentList();
72433
+ (_a = comments.getCommentList()) == null ? void 0 : _a.setListType("current");
71582
72434
  const range = editor.selection.range;
71583
72435
  if (!range.isSimple()) {
71584
72436
  if (isFullSelectedOneComplexBlock(editor, range)) {
@@ -76833,14 +77685,14 @@ ${docStr}
76833
77685
  }
76834
77686
  function isList(elem) {
76835
77687
  var _a;
76836
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76837
- return styles.findIndex((style2) => style2.startsWith("level")) !== -1;
77688
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77689
+ return styles2.findIndex((style2) => style2.startsWith("level")) !== -1;
76838
77690
  }
76839
77691
  function getOfficeListGroupId(elem) {
76840
77692
  var _a;
76841
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76842
- for (let i = 0; i < styles.length; i++) {
76843
- const name = styles[i];
77693
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77694
+ for (let i = 0; i < styles2.length; i++) {
77695
+ const name = styles2[i];
76844
77696
  if (name.startsWith("mso-list:")) {
76845
77697
  return name;
76846
77698
  }
@@ -76849,9 +77701,9 @@ ${docStr}
76849
77701
  }
76850
77702
  function getLevel(elem) {
76851
77703
  var _a, _b;
76852
- const styles = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
76853
- for (let i = 0; i < styles.length; i++) {
76854
- const name = styles[i];
77704
+ const styles2 = Array.from(((_a = elem.getAttribute("style")) != null ? _a : "").split(" "));
77705
+ for (let i = 0; i < styles2.length; i++) {
77706
+ const name = styles2[i];
76855
77707
  if (name.startsWith("level")) {
76856
77708
  const level = (_b = Number.parseInt(name.substring(5), 10)) != null ? _b : void 0;
76857
77709
  if (level) {
@@ -80542,6 +81394,8 @@ ${docStr}
80542
81394
  }
80543
81395
  onUpdateComment() {
80544
81396
  }
81397
+ onUpdateCommentResolver(commentId, local) {
81398
+ }
80545
81399
  }
80546
81400
  async function playHistoryData(doc2, versionHelper, historyData) {
80547
81401
  for (const data2 of historyData) {
@@ -85081,7 +85935,7 @@ ${docStr}
85081
85935
  const file2 = new File([buffer], `${genId()}.svg`, {
85082
85936
  type: "image/svg+xml"
85083
85937
  });
85084
- const ret = await editor.doc.uploadResource(file2);
85938
+ const ret = await editor.doc.uploadResource(file2, { resourceType: "graph" });
85085
85939
  return ret.resourceId;
85086
85940
  }
85087
85941
  const _MermaidInstance = class extends GraphBase {
@@ -85319,7 +86173,7 @@ ${data2.mermaidText}
85319
86173
  const file2 = new File([buffer], `${genId()}.svg`, {
85320
86174
  type: "image/svg+xml"
85321
86175
  });
85322
- const resource = await editor.doc.uploadResource(file2);
86176
+ const resource = await editor.doc.uploadResource(file2, { resourceType: "graph" });
85323
86177
  return resource.resourceId;
85324
86178
  }
85325
86179
  const _FlowChartInstance = class extends GraphBase {
@@ -85774,7 +86628,7 @@ ${data2.flowchartText}
85774
86628
  });
85775
86629
  const targetBlock = editor.findBlockById(getBlockId(block));
85776
86630
  if (targetBlock) {
85777
- const res = await editor.doc.uploadResource(file2);
86631
+ const res = await editor.doc.uploadResource(file2, { resourceType: "graph" });
85778
86632
  const { resourceId } = res;
85779
86633
  const oldData = editor.getBlockData(targetBlock);
85780
86634
  const oldEmbedData = oldData.embedData;
@@ -85826,31 +86680,40 @@ ${data2.flowchartText}
85826
86680
  const xml = drawIoData.xmlSvg || drawIoData.xml || "";
85827
86681
  switch (msg.event) {
85828
86682
  case "configure":
85829
- iframe.contentWindow.postMessage(JSON.stringify({
85830
- action: "configure",
85831
- config: {
85832
- defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
85833
- }
85834
- }), "*");
86683
+ iframe.contentWindow.postMessage(
86684
+ JSON.stringify({
86685
+ action: "configure",
86686
+ config: {
86687
+ defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
86688
+ }
86689
+ }),
86690
+ "*"
86691
+ );
85835
86692
  break;
85836
86693
  case "init":
85837
- iframe.contentWindow.postMessage(JSON.stringify({
85838
- action: "load",
85839
- saveAndExit: 1,
85840
- noSaveBtn: 1,
85841
- noExitBtn: 0,
85842
- xml
85843
- }), "*");
86694
+ iframe.contentWindow.postMessage(
86695
+ JSON.stringify({
86696
+ action: "load",
86697
+ saveAndExit: 1,
86698
+ noSaveBtn: 1,
86699
+ noExitBtn: 0,
86700
+ xml
86701
+ }),
86702
+ "*"
86703
+ );
85844
86704
  loaded();
85845
86705
  loadingHandler.removeLoading();
85846
86706
  break;
85847
86707
  case "save":
85848
86708
  exportFlag = "save";
85849
- iframe.contentWindow.postMessage(JSON.stringify({
85850
- action: "export",
85851
- format: "xmlsvg",
85852
- spin: "Saving graph"
85853
- }), "*");
86709
+ iframe.contentWindow.postMessage(
86710
+ JSON.stringify({
86711
+ action: "export",
86712
+ format: "xmlsvg",
86713
+ spin: "Saving graph"
86714
+ }),
86715
+ "*"
86716
+ );
85854
86717
  break;
85855
86718
  case "export":
85856
86719
  if (exportFlag !== "auto") {
@@ -85876,12 +86739,15 @@ ${data2.flowchartText}
85876
86739
  allowRetry: true,
85877
86740
  onOk: () => {
85878
86741
  setTimeout(() => {
85879
- drawioIframeWindow.postMessage(JSON.stringify({
85880
- action: "export",
85881
- format: "xmlsvg",
85882
- spin: i18n$1.t("drawio.save"),
85883
- autoSave: exportFlag
85884
- }), "*");
86742
+ drawioIframeWindow.postMessage(
86743
+ JSON.stringify({
86744
+ action: "export",
86745
+ format: "xmlsvg",
86746
+ spin: i18n$1.t("drawio.save"),
86747
+ autoSave: exportFlag
86748
+ }),
86749
+ "*"
86750
+ );
85885
86751
  }, 1e3);
85886
86752
  },
85887
86753
  onClose: () => {
@@ -85947,12 +86813,15 @@ ${data2.flowchartText}
85947
86813
  if (!drawioIframe || !drawioIframe.contentWindow) {
85948
86814
  return;
85949
86815
  }
85950
- drawioIframe.contentWindow.postMessage(JSON.stringify({
85951
- action: "export",
85952
- format: "xmlsvg",
85953
- spin: "Saving graph",
85954
- autoSave: true
85955
- }), "*");
86816
+ drawioIframe.contentWindow.postMessage(
86817
+ JSON.stringify({
86818
+ action: "export",
86819
+ format: "xmlsvg",
86820
+ spin: "Saving graph",
86821
+ autoSave: true
86822
+ }),
86823
+ "*"
86824
+ );
85956
86825
  }, SAVE_DELAY_TIME);
85957
86826
  };
85958
86827
  const exit = () => {
@@ -86092,10 +86961,12 @@ ${data2.flowchartText}
86092
86961
  }
86093
86962
  function updateGraphByXml(mxFile, embed, editor) {
86094
86963
  assert(logger$i, editor, "parameter missing");
86095
- initDrawIo(editor).then(() => loopCheckResourceWasLoaded({
86096
- checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
86097
- maxRetryTime: 5e3
86098
- })).then(() => {
86964
+ initDrawIo(editor).then(
86965
+ () => loopCheckResourceWasLoaded({
86966
+ checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
86967
+ maxRetryTime: 5e3
86968
+ })
86969
+ ).then(() => {
86099
86970
  const { mxUtils, mxGraph: MxGraph, mxCodec: MxCodec, Graph } = window;
86100
86971
  assert(logger$i, mxUtils, "External resource loading exception: mxUtils");
86101
86972
  assert(logger$i, MxGraph, "External resource loading exception: MxGraph");
@@ -86115,7 +86986,10 @@ ${data2.flowchartText}
86115
86986
  const raw = atob(diagramBase64);
86116
86987
  const pako = window.pako;
86117
86988
  assert(logger$i, pako, "External resource loading exception: pako");
86118
- const encodedXml = pako.inflateRaw(Uint8Array.from(raw, (c) => c.charCodeAt(0)), { to: "string" });
86989
+ const encodedXml = pako.inflateRaw(
86990
+ Uint8Array.from(raw, (c) => c.charCodeAt(0)),
86991
+ { to: "string" }
86992
+ );
86119
86993
  const xml = decodeURIComponent(encodedXml);
86120
86994
  xmlDoc = mxUtils.parseXml(xml);
86121
86995
  } else {
@@ -86449,7 +87323,7 @@ ${data2.flowchartText}
86449
87323
  if (!plantumlImgFile) {
86450
87324
  return await Promise.resolve(url);
86451
87325
  }
86452
- const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile);
87326
+ const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile, { resourceType: "graph" });
86453
87327
  return uploadResourceResult.resourceId;
86454
87328
  } catch (error2) {
86455
87329
  return Promise.resolve(url);
@@ -89984,7 +90858,8 @@ ${data2.plantumlText}
89984
90858
  const { resourceId } = await editor.doc.uploadResource(file2, {
89985
90859
  onProgress: (progress) => {
89986
90860
  this.renderProgress(progress, file2);
89987
- }
90861
+ },
90862
+ resourceType: "media"
89988
90863
  });
89989
90864
  const { name, type, size } = file2;
89990
90865
  const newBlockData = {
@@ -90122,7 +90997,11 @@ ${data2.plantumlText}
90122
90997
  renderEmpty(blockData) {
90123
90998
  assert(logger$9, this.abstract, "no abstract");
90124
90999
  assert(logger$9, this.mediaContainer, "The media element not exist");
90125
- const empty = createElement("div", ["media-empty", "embed-selected-content", "embed-hover-content"], this.mediaContainer);
91000
+ const empty = createElement(
91001
+ "div",
91002
+ ["media-empty", "embed-selected-content", "embed-hover-content"],
91003
+ this.mediaContainer
91004
+ );
90126
91005
  empty.innerHTML = this.abstract.mediaIcon;
90127
91006
  this.updateMediaContent(empty);
90128
91007
  const { editor } = this.options;
@@ -90143,7 +91022,7 @@ ${data2.plantumlText}
90143
91022
  }
90144
91023
  await editor.doc.addResources([resourceId]);
90145
91024
  const serviceAppId = (_b = (_a = editor.doc).getServerMeta) == null ? void 0 : _b.call(_a).appId;
90146
- if (resourceUrl !== blockData.embedData.src && (serviceAppId && blockData.embedData.src.includes(serviceAppId))) {
91025
+ if (resourceUrl !== blockData.embedData.src && serviceAppId && blockData.embedData.src.includes(serviceAppId)) {
90147
91026
  const block = getParentBlock(content);
90148
91027
  if (block && !editor.readonly && editor.isBlockWritable(block)) {
90149
91028
  const newBlockData = cloneDeep__default.default(blockData);
@@ -90871,6 +91750,9 @@ ${data2.plantumlText}
90871
91750
  localUpdateComment(comment, doc2) {
90872
91751
  this.doc.localUpdateComment(comment, doc2);
90873
91752
  }
91753
+ localUpdateCommentResolver(commentId, resolver) {
91754
+ this.doc.localUpdateCommentResolver(commentId, resolver);
91755
+ }
90874
91756
  onCreateComment(commentId, local) {
90875
91757
  Array.from(this.listeners.values()).forEach((listener) => listener.onCreateComment(commentId, local));
90876
91758
  }
@@ -90880,6 +91762,9 @@ ${data2.plantumlText}
90880
91762
  onUpdateComment(commentId, local) {
90881
91763
  Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateComment(commentId, local));
90882
91764
  }
91765
+ onUpdateCommentResolver(commentId, local) {
91766
+ Array.from(this.listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, local));
91767
+ }
90883
91768
  addListener(callback) {
90884
91769
  this.listeners.add(callback);
90885
91770
  }
@@ -90905,9 +91790,10 @@ ${data2.plantumlText}
90905
91790
  constructor(editor, localDoc) {
90906
91791
  __publicField(this, "_listeners", /* @__PURE__ */ new Set());
90907
91792
  __publicField(this, "_doc");
91793
+ var _a, _b;
90908
91794
  this.editor = editor;
90909
91795
  this.localDoc = localDoc;
90910
- this._doc = this.localDoc.toJSON();
91796
+ this._doc = ((_b = (_a = this.localDoc).rawData) == null ? void 0 : _b.call(_a)) || this.localDoc.toJSON();
90911
91797
  }
90912
91798
  get doc() {
90913
91799
  return this._doc;
@@ -90962,6 +91848,17 @@ ${data2.plantumlText}
90962
91848
  this._doc.comments[id] = shareDBComment;
90963
91849
  Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateComment(id, true));
90964
91850
  }
91851
+ localUpdateCommentResolver(commentId, resolver) {
91852
+ const comment = this.getComment(commentId);
91853
+ if (comment) {
91854
+ if (resolver) {
91855
+ comment.resolver = resolver;
91856
+ } else {
91857
+ delete comment.resolver;
91858
+ }
91859
+ Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, true));
91860
+ }
91861
+ }
90965
91862
  createCommentEditor(parent, childDoc) {
90966
91863
  const commentEditor = createCommentEditor(this.editor, {
90967
91864
  root: parent,
@@ -91732,8 +92629,8 @@ ${JSON.stringify(error2, null, 2)}`);
91732
92629
  const inlineStyles = attributesOfText(text2, "inlineStyle");
91733
92630
  if (inlineStyles == null)
91734
92631
  return;
91735
- const styles = inlineStyles.split(";");
91736
- for (const style2 of styles) {
92632
+ const styles2 = inlineStyles.split(";");
92633
+ for (const style2 of styles2) {
91737
92634
  const pair = style2.split(":");
91738
92635
  if (pair.length !== 2)
91739
92636
  continue;
@@ -93262,11 +94159,11 @@ ${JSON.stringify(error2, null, 2)}`);
93262
94159
  this.fixedToolbar = (_a = editor.findCustom("main-toolbar-fixed-toolbar")) == null ? void 0 : _a.toolbar;
93263
94160
  if (this.fixedToolbar) {
93264
94161
  const content = this.fixedToolbar.content;
93265
- const toolbar2 = content.closest(".editor-command-bar-root");
94162
+ const resizer = content.closest(".editor-main-toolbar-resizer");
93266
94163
  this.observer = new ResizeObserver(() => {
93267
94164
  this.updateItems();
93268
94165
  });
93269
- this.observer.observe(toolbar2);
94166
+ this.observer.observe(resizer);
93270
94167
  editor.addCustom("main-toolbar-more-item", () => this);
93271
94168
  }
93272
94169
  });
@@ -93384,8 +94281,6 @@ ${JSON.stringify(error2, null, 2)}`);
93384
94281
  new AlignCenterItem(),
93385
94282
  new AlignRightItem(),
93386
94283
  new SeparatorItem(),
93387
- new InsertImageItem(),
93388
- new SeparatorItem(),
93389
94284
  new InsertItem(editor),
93390
94285
  new SeparatorItem(),
93391
94286
  new FindReplaceItem(),
@@ -93457,8 +94352,9 @@ ${JSON.stringify(error2, null, 2)}`);
93457
94352
  });
93458
94353
  const style = "";
93459
94354
  class MainToolbar {
93460
- constructor(editor, parent) {
94355
+ constructor(editor, parent, options = {}) {
93461
94356
  __publicField(this, "toolbar");
94357
+ __publicField(this, "toolbarFullScreen");
93462
94358
  __publicField(this, "handleClick", (bar2, item) => {
93463
94359
  const command = item;
93464
94360
  if (command.onClick) {
@@ -93495,7 +94391,11 @@ ${JSON.stringify(error2, null, 2)}`);
93495
94391
  this.updateState();
93496
94392
  });
93497
94393
  this.editor = editor;
93498
- this.toolbar = new FixedToolbar(parent, this.getItems(), {
94394
+ this.options = options;
94395
+ const root2 = createElement("div", ["editor-main-toolbar-root"], parent);
94396
+ const container = createElement("div", ["editor-main-toolbar-resizer"], root2);
94397
+ const resizer = createElement("div", ["editor-main-toolbar-container"], container);
94398
+ this.toolbar = new FixedToolbar(resizer, this.getItems(), {
93499
94399
  tooltipId: editor.clientId,
93500
94400
  id: "main-toolbar"
93501
94401
  });
@@ -93507,9 +94407,31 @@ ${JSON.stringify(error2, null, 2)}`);
93507
94407
  destroy: () => {
93508
94408
  }
93509
94409
  }));
94410
+ if (options.enableFullScreen) {
94411
+ const fullScreenItem = {
94412
+ id: "main-toolbar-fullscreen",
94413
+ icon: FullScreenIcon,
94414
+ name: i18n$1.t("toolbar.fullscreen")
94415
+ };
94416
+ this.toolbarFullScreen = new FixedToolbar(root2, [fullScreenItem], {
94417
+ tooltipId: editor.clientId,
94418
+ id: "main-toolbar-fullscreen",
94419
+ rootId: "main-toolbar-fullscreen"
94420
+ });
94421
+ this.toolbarFullScreen.addListener("click", (bar2, item) => {
94422
+ var _a;
94423
+ if (item.id === "main-toolbar-fullscreen") {
94424
+ (_a = options.onFullScreenClick) == null ? void 0 : _a.call(options, this.editor, item);
94425
+ this.handleSelectionChanged();
94426
+ }
94427
+ });
94428
+ }
93510
94429
  }
93511
94430
  destroy() {
94431
+ var _a;
93512
94432
  this.toolbar.destroy();
94433
+ this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
94434
+ (_a = this.toolbarFullScreen) == null ? void 0 : _a.destroy();
93513
94435
  }
93514
94436
  setItems(items) {
93515
94437
  this.toolbar.updateItems(items);
@@ -93564,6 +94486,7 @@ ${JSON.stringify(error2, null, 2)}`);
93564
94486
  id: options.id,
93565
94487
  scrollContainer: options == null ? void 0 : options.scrollContainer,
93566
94488
  enableComments: options == null ? void 0 : options.enableComments,
94489
+ enableResolveComments: options == null ? void 0 : options.enableResolveComments,
93567
94490
  enableContextMenu: options == null ? void 0 : options.enableContextMenu,
93568
94491
  components: {
93569
94492
  blocks: [...StandardBlocks, ...((_d = options == null ? void 0 : options.components) == null ? void 0 : _d.blocks) || []],
@@ -93801,7 +94724,7 @@ ${JSON.stringify(error2, null, 2)}`);
93801
94724
  }
93802
94725
  }
93803
94726
  });
93804
- editor.version = "2.8.35";
94727
+ editor.version = "2.8.37-beta.1";
93805
94728
  return editor;
93806
94729
  }
93807
94730
  function isDoc(doc2) {
@@ -93823,6 +94746,7 @@ ${JSON.stringify(error2, null, 2)}`);
93823
94746
  const editor = createEditor(root2, doc2, {
93824
94747
  id: options.id,
93825
94748
  scrollContainer: options == null ? void 0 : options.scrollContainer,
94749
+ enableResolveComments: options == null ? void 0 : options.enableResolveComments,
93826
94750
  components: {
93827
94751
  blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
93828
94752
  commandProviders: [new TableBlockCommandProvider()],
@@ -93914,7 +94838,7 @@ ${JSON.stringify(error2, null, 2)}`);
93914
94838
  }
93915
94839
  });
93916
94840
  OnesEditorToolbar.register(editor);
93917
- editor.version = "2.8.35";
94841
+ editor.version = "2.8.37-beta.1";
93918
94842
  return editor;
93919
94843
  }
93920
94844
  async function showDocVersions(editor, options, serverUrl) {
@@ -139734,6 +140658,7 @@ ${JSON.stringify(error2, null, 2)}`);
139734
140658
  exports2.CheckMarkIcon = CheckMarkIcon;
139735
140659
  exports2.CheckboxIcon = CheckboxIcon;
139736
140660
  exports2.CircleAddIcon = CircleAddIcon;
140661
+ exports2.CircleCheckMarkIcon = CircleCheckMarkIcon;
139737
140662
  exports2.ClearIcon = ClearIcon;
139738
140663
  exports2.ClipboardProvider = ClipboardProvider;
139739
140664
  exports2.CloseIcon = CloseIcon;
@@ -139884,6 +140809,8 @@ ${JSON.stringify(error2, null, 2)}`);
139884
140809
  exports2.MoreItem = MoreItem;
139885
140810
  exports2.NextIcon = NextIcon;
139886
140811
  exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
140812
+ exports2.OnesEditorComments = OnesEditorComments;
140813
+ exports2.OnesEditorCommentsRender = OnesEditorCommentsRender;
139887
140814
  exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
139888
140815
  exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
139889
140816
  exports2.OnesEditorHoveringBlock = OnesEditorHoveringBlock;