@ones-editor/editor 2.8.25-beta.4 → 2.8.25-beta.6

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.
@@ -46,6 +46,7 @@ import CommentIcon from './comment.svg?raw';
46
46
  import RefreshIcon from './refresh.svg?raw';
47
47
  import HelpIcon from './help.svg?raw';
48
48
  import CheckMarkIcon from './check-mark.svg?raw';
49
+ import CircleCheckMarkIcon from './circle-check-mark.svg?raw';
49
50
  import TextIcon from './text.svg?raw';
50
51
  import RightArrowIcon from './right-arrow.svg?raw';
51
52
  import BilibiliIcon from './bilibili-icon.svg?raw';
@@ -126,4 +127,4 @@ import ShiftTabIcon from './shift-tab.svg?raw';
126
127
  import TableEditIcon from './table-edit.svg?raw';
127
128
  import AdjustWidthIcon from './adjust-width.svg?raw';
128
129
  import TocIcon from './toc.svg?raw';
129
- export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, AdjustWidthIcon, TocIcon, };
130
+ export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, CircleCheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, AdjustWidthIcon, TocIcon, };
package/dist/index.js CHANGED
@@ -4347,7 +4347,7 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4347
4347
  box-shadow: var(--editor-box-shadow);
4348
4348
  padding-bottom: 10px;
4349
4349
  }
4350
- .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .item-head-switch .editor-text-button.resolved {
4350
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .comment-item-head .item-head-switch {
4351
4351
  display: none;
4352
4352
  }
4353
4353
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.resolved .item-head-tools {
@@ -4404,22 +4404,23 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4404
4404
  display: flex;
4405
4405
  align-items: center;
4406
4406
  height: 22px;
4407
- visibility: hidden;
4408
4407
  }
4409
4408
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button {
4410
4409
  padding: 0;
4411
4410
  width: var(--editor-comment-switch-button-width);
4412
- margin: 3px 0;
4411
+ margin-right: 5px;
4413
4412
  color: #606060;
4413
+ width: 16px;
4414
+ height: 16px;
4414
4415
  }
4415
4416
  .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] {
4416
- margin-right: 16px;
4417
+ visibility: hidden;
4417
4418
  }
4418
4419
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=switch-down] {
4419
- margin-right: 16px;
4420
+ visibility: hidden;
4420
4421
  }
4421
- .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=resolve].resolved {
4422
- color: green;
4422
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button[data-button-id=resolve] {
4423
+ margin-right: 0;
4423
4424
  }
4424
4425
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-head .item-head-switch .editor-text-button:not(.disabled):hover {
4425
4426
  color: var(--text-button-color-hover);
@@ -4440,9 +4441,14 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4440
4441
  }
4441
4442
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-date {
4442
4443
  flex: 1;
4444
+ white-space: nowrap;
4443
4445
  }
4444
4446
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .removed-tips {
4445
4447
  color: #87888A;
4448
+ white-space: nowrap;
4449
+ text-overflow: ellipsis;
4450
+ overflow: hidden;
4451
+ margin-left: 10px;
4446
4452
  }
4447
4453
  .editor-web-comment-root .comment-groups-container .comment-group-item-root .comment-item-footer .comment-actions .comment-reopen {
4448
4454
  background: none;
@@ -4457,7 +4463,10 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
4457
4463
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.active::before {
4458
4464
  background-color: #f59300;
4459
4465
  }
4460
- .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch {
4466
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-up] {
4467
+ visibility: visible;
4468
+ }
4469
+ .editor-web-comment-root .comment-groups-container .comment-group-item-root.active .item-head-switch .editor-text-button[data-button-id=switch-down] {
4461
4470
  visibility: visible;
4462
4471
  }
4463
4472
  .editor-web-comment-root .comment-groups-container .comment-group-item-root.readonly .comment-quick-reply .quick-reply-button.invisible {
@@ -40755,6 +40764,7 @@ ${codeText}
40755
40764
  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>';
40756
40765
  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';
40757
40766
  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>';
40767
+ 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';
40758
40768
  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';
40759
40769
  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';
40760
40770
  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';
@@ -40910,6 +40920,7 @@ ${codeText}
40910
40920
  RefreshIcon,
40911
40921
  HelpIcon,
40912
40922
  CheckMarkIcon,
40923
+ CircleCheckMarkIcon,
40913
40924
  TextIcon,
40914
40925
  RightArrowIcon: rightArrow,
40915
40926
  TencentVideoIcon,
@@ -69282,8 +69293,8 @@ ${codeText}
69282
69293
  });
69283
69294
  }
69284
69295
  }
69285
- 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>';
69286
- 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>';
69296
+ const switchUpIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g opacity="0.5">\n<path d="M4.17757 10.2343L7.99993 6.41191L11.8208 10.2343" stroke="currentColor"/>\n</g>\n</svg>\n';
69297
+ const switchDownIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g opacity="0.5">\n<path d="M4.17757 5.76573L7.99993 9.58809L11.8208 5.76573" stroke="currentColor"/>\n</g>\n</svg>\n';
69287
69298
  const index$8 = "";
69288
69299
  const REPLY_EDITOR_EDITING_CLS = "reply-editor-editing";
69289
69300
  const { t: t$3 } = i18n$1;
@@ -69512,10 +69523,11 @@ ${codeText}
69512
69523
  const switchContainer = createElement("span", ["item-head-switch"], head);
69513
69524
  const switchUp = createTextButton(switchContainer, GroupItemActions.SwitchUp, "up", switchUpIcon);
69514
69525
  const switchDown = createTextButton(switchContainer, GroupItemActions.SwitchDown, "down", switchDownIcon);
69515
- const resolve = createTextButton(switchContainer, GroupItemActions.Resolve, "resolve", CheckMarkIcon);
69526
+ const resolve = createTextButton(switchContainer, GroupItemActions.Resolve, "resolve", CircleCheckMarkIcon);
69516
69527
  addGroupActionToElement(switchUp, GroupItemActions.SwitchUp);
69517
69528
  addGroupActionToElement(switchDown, GroupItemActions.SwitchDown);
69518
69529
  addGroupActionToElement(resolve, GroupItemActions.Resolve);
69530
+ addClass(resolve, "disable-active");
69519
69531
  if (comment.resolver) {
69520
69532
  addClass(resolve, "resolved");
69521
69533
  }
@@ -69761,7 +69773,7 @@ ${codeText}
69761
69773
  date: Date.now()
69762
69774
  });
69763
69775
  });
69764
- __publicField(this, "execute", (element, groupItem, commentId, itemIndex) => {
69776
+ __publicField(this, "execute", (element, groupItem, commentId, itemIndex, event) => {
69765
69777
  const actionElement = getClosestGroupItemActionElement(element);
69766
69778
  if (!actionElement)
69767
69779
  return;
@@ -69801,6 +69813,8 @@ ${codeText}
69801
69813
  this.handleQuickReplyCancel(groupItem);
69802
69814
  break;
69803
69815
  case GroupItemActions.Resolve:
69816
+ event.preventDefault();
69817
+ event.stopPropagation();
69804
69818
  this.handleResolve(groupItem);
69805
69819
  break;
69806
69820
  default:
@@ -69855,7 +69869,9 @@ ${codeText}
69855
69869
  const commentId = getClosestCommentItemId(event.target);
69856
69870
  const index2 = this.items.findIndex((item) => item.root === itemRoot);
69857
69871
  if (index2 !== -1) {
69858
- if (this.activeIndex !== index2) {
69872
+ const disableActive = !!event.target.closest(".disable-active");
69873
+ const enableActive = !disableActive;
69874
+ if (this.activeIndex !== index2 && enableActive) {
69859
69875
  this.setActiveItem(index2);
69860
69876
  }
69861
69877
  const { groupItemHandlers } = this;
@@ -69863,7 +69879,8 @@ ${codeText}
69863
69879
  event.target,
69864
69880
  this.items[index2],
69865
69881
  commentId,
69866
- index2
69882
+ index2,
69883
+ event
69867
69884
  );
69868
69885
  }
69869
69886
  });
@@ -70224,6 +70241,16 @@ ${codeText}
70224
70241
  });
70225
70242
  return resultMap;
70226
70243
  }
70244
+ function getBlocksByCommentId(doc2, commentId) {
70245
+ const result = [];
70246
+ const resultMap = getBlockCommentsFromDoc(doc2);
70247
+ resultMap.forEach((commentIds, blockId) => {
70248
+ if (commentIds.has(commentId)) {
70249
+ result.push(blockId);
70250
+ }
70251
+ });
70252
+ return result;
70253
+ }
70227
70254
  class OnesEditorCommentsRender {
70228
70255
  constructor(type = "current") {
70229
70256
  __publicField(this, "updateUnknownCommentsDelayed", debounce__default.default((editor) => {
@@ -70482,40 +70509,51 @@ ${codeText}
70482
70509
  }
70483
70510
  onUpdateCommentResolver(commentId, local) {
70484
70511
  const comment = this.commentsProvider.getComment(commentId);
70485
- const groupItem = this.list.findGroupItem(comment.groupId);
70486
- if (!groupItem) {
70512
+ if (!comment) {
70487
70513
  return;
70488
70514
  }
70489
- setTimeout(() => {
70490
- if (this.listType === "current") {
70491
- if (comment.resolver) {
70492
- this.list.handleDeleteComment(commentId);
70493
- } else {
70494
- this.list.handleCreateComment(comment, local);
70495
- }
70496
- } else {
70497
- if (comment.resolver) {
70498
- this.list.handleCreateComment(comment, local);
70499
- } else {
70500
- this.list.handleDeleteComment(commentId);
70501
- }
70515
+ let type = "add";
70516
+ if (this.listType === "current") {
70517
+ if (comment.resolver) {
70518
+ type = "remove";
70502
70519
  }
70503
- }, 300);
70504
- this.updateCommentCount();
70520
+ } else {
70521
+ if (!comment.resolver) {
70522
+ type = "remove";
70523
+ }
70524
+ }
70505
70525
  const blocks = /* @__PURE__ */ new Set();
70506
- getElementsByCommentId(this.editor, groupItem.comment.id).forEach((element) => {
70507
- if (isBlock$1(element)) {
70508
- blocks.add(element);
70509
- } else {
70510
- const block = getParentBlock(element);
70526
+ if (type === "remove") {
70527
+ getElementsByCommentId(this.editor, commentId).forEach((element) => {
70528
+ if (isBlock$1(element)) {
70529
+ blocks.add(element);
70530
+ } else {
70531
+ const block = getParentBlock(element);
70532
+ if (block) {
70533
+ blocks.add(block);
70534
+ }
70535
+ }
70536
+ });
70537
+ } else {
70538
+ const blockIds = getBlocksByCommentId(this.editor.doc.toJSON(), commentId);
70539
+ blockIds.forEach((blockId) => {
70540
+ const block = this.editor.findBlockById(blockId);
70511
70541
  if (block) {
70512
70542
  blocks.add(block);
70513
70543
  }
70514
- }
70515
- });
70544
+ });
70545
+ }
70516
70546
  blocks.forEach((block) => {
70517
70547
  this.editor.reloadBlock(block);
70518
70548
  });
70549
+ setTimeout(() => {
70550
+ if (type === "add") {
70551
+ this.list.handleCreateComment(comment, local);
70552
+ } else {
70553
+ this.list.handleDeleteComment(commentId);
70554
+ }
70555
+ this.updateCommentCount();
70556
+ }, 300);
70519
70557
  }
70520
70558
  createList() {
70521
70559
  return new CommentGroupList(this.editor, this.commentsProvider, this.groupsContainer, this.listType);
@@ -71616,6 +71654,19 @@ ${codeText}
71616
71654
  method: "delete"
71617
71655
  });
71618
71656
  }
71657
+ function updateCommentResolverToOldDoc(editor, version, commentId, resolver) {
71658
+ var _a, _b;
71659
+ const doc2 = editor.doc;
71660
+ const server = (_b = (_a = doc2.getServerMeta) == null ? void 0 : _a.call(doc2)) == null ? void 0 : _b.apiServer;
71661
+ assert(logger$16, server, "apiServer is not set");
71662
+ const api = `${server}/${version}/comments/${commentId}/resolver`;
71663
+ return doc2.request(api, {
71664
+ method: "put",
71665
+ data: {
71666
+ resolver
71667
+ }
71668
+ });
71669
+ }
71619
71670
  getLogger("resolved-comment-item");
71620
71671
  const styles = "";
71621
71672
  const isAllContainersSelected = (editor) => {
@@ -71693,6 +71744,14 @@ ${codeText}
71693
71744
  }
71694
71745
  }
71695
71746
  onUpdateCommentResolver(commentId, local) {
71747
+ const comments = this.editor.getCustom("editor-comments");
71748
+ const provider = comments.commentProvider;
71749
+ const comment = provider.getComment(commentId);
71750
+ if (!comment) {
71751
+ return;
71752
+ }
71753
+ const resolver = comment.resolver;
71754
+ updateCommentResolverToOldDoc(this.editor, this.version, commentId, resolver);
71696
71755
  }
71697
71756
  hideToolbar(editor) {
71698
71757
  const toolbar2 = editor.findCustom("toolbar-handler");
@@ -90892,8 +90951,12 @@ ${data2.plantumlText}
90892
90951
  localUpdateCommentResolver(commentId, resolver) {
90893
90952
  const comment = this.getComment(commentId);
90894
90953
  if (comment) {
90895
- comment.resolver = resolver;
90896
- this.localUpdateComment(comment, this.getCommentDoc(commentId));
90954
+ if (resolver) {
90955
+ comment.resolver = resolver;
90956
+ } else {
90957
+ delete comment.resolver;
90958
+ }
90959
+ Array.from(this._listeners.values()).forEach((listener) => listener.onUpdateCommentResolver(commentId, true));
90897
90960
  }
90898
90961
  }
90899
90962
  createCommentEditor(parent, childDoc) {
@@ -93687,7 +93750,7 @@ ${data2.plantumlText}
93687
93750
  }
93688
93751
  }
93689
93752
  });
93690
- editor.version = "2.8.25-beta.4";
93753
+ editor.version = "2.8.25-beta.6";
93691
93754
  return editor;
93692
93755
  }
93693
93756
  function isDoc(doc2) {
@@ -93800,7 +93863,7 @@ ${data2.plantumlText}
93800
93863
  }
93801
93864
  });
93802
93865
  OnesEditorToolbar.register(editor);
93803
- editor.version = "2.8.25-beta.4";
93866
+ editor.version = "2.8.25-beta.6";
93804
93867
  return editor;
93805
93868
  }
93806
93869
  async function showDocVersions(editor, options, serverUrl) {
@@ -139620,6 +139683,7 @@ ${data2.plantumlText}
139620
139683
  exports2.CheckMarkIcon = CheckMarkIcon;
139621
139684
  exports2.CheckboxIcon = CheckboxIcon;
139622
139685
  exports2.CircleAddIcon = CircleAddIcon;
139686
+ exports2.CircleCheckMarkIcon = CircleCheckMarkIcon;
139623
139687
  exports2.ClearIcon = ClearIcon;
139624
139688
  exports2.ClipboardProvider = ClipboardProvider;
139625
139689
  exports2.CloseIcon = CloseIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.8.25-beta.4",
3
+ "version": "2.8.25-beta.6",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {