@ones-editor/editor 0.0.7-beta.36 → 0.0.7-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1739,17 +1739,24 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
1739
1739
  align-items: center;
1740
1740
  height: calc(var(--font-size) * var(--line-height));
1741
1741
  }
1742
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap,
1742
1743
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap {
1743
1744
  display: flex;
1744
1745
  flex-direction: row;
1745
1746
  justify-content: center;
1746
1747
  }
1747
- .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=mention-button]:hover {
1748
- background: #eaeaea;
1748
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap > button.editor-button[data-button-id=mention-button]:hover,
1749
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap > button.editor-button[data-button-id=list-to-mindmap]:hover,
1750
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=mention-button]:hover,
1751
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=list-to-mindmap]:hover {
1752
+ background: rgba(0, 36, 90, 0.0392156863);
1749
1753
  border-radius: 3px;
1750
1754
  }
1751
- .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=mention-button]:active:hover {
1752
- background: #dedede;
1755
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap > button.editor-button[data-button-id=mention-button]:active:hover,
1756
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .list-to-mindmap-wrap > button.editor-button[data-button-id=list-to-mindmap]:active:hover,
1757
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=mention-button]:active:hover,
1758
+ .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block .mention-button-wrap > button.editor-button[data-button-id=list-to-mindmap]:active:hover {
1759
+ background: rgba(0, 36, 90, 0.0588235294);
1753
1760
  }
1754
1761
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap],
1755
1762
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button] {
@@ -1764,20 +1771,15 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
1764
1771
  outline: 0;
1765
1772
  display: flex;
1766
1773
  align-items: center;
1767
- justify-content: end;
1774
+ justify-content: center;
1768
1775
  background-color: transparent;
1769
1776
  color: #07142a;
1770
- margin-right: 8px;
1771
1777
  }
1772
1778
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-to-mindmap] svg,
1773
1779
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button] svg {
1774
1780
  width: 16px;
1775
1781
  height: 16px;
1776
1782
  }
1777
- .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=mention-button] {
1778
- justify-content: center;
1779
- margin-right: 0;
1780
- }
1781
1783
  .editor-root [data-type=editor-container].root div[data-type=editor-block].list-block button[data-button-id=list-block-mention]:hover > svg {
1782
1784
  cursor: initial;
1783
1785
  background-color: #eeeeee;
@@ -2058,16 +2060,17 @@ div.editor-root div.editor-content div[data-block-type=list][data-style-heading=
2058
2060
  .editor-root:not(.readonly) div[data-type=editor-block].list-block.active .list-container, .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover .list-container {
2059
2061
  cursor: pointer;
2060
2062
  }
2061
- .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked] > div.list-container,
2063
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=ordered] > div.list-container,
2064
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=ordered] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered] > div.list-container,
2065
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked] > div.list-container,
2062
2066
  .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unchecked] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked] > div.list-container,
2063
- .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked] > div.list-container,
2067
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=checked] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered] > div.list-container,
2068
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered] > div.list-container,
2069
+ .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked] > div.list-container,
2064
2070
  .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unchecked] > div[data-type=block-content], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked] > div.list-container,
2065
2071
  .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=checked] > div[data-type=block-content] {
2066
2072
  background-color: #f8f8f8;
2067
2073
  }
2068
- .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=ordered], .editor-root:not(.readonly) div[data-type=editor-block].list-block.active[data-list-type=unordered], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=ordered], .editor-root:not(.readonly) div[data-type=editor-block].list-block.hover[data-list-type=unordered] {
2069
- background-color: #f8f8f8;
2070
- }
2071
2074
  .editor-root:not(.readonly) div[data-type=editor-block].list-block .list-container:hover .list-marker {
2072
2075
  cursor: pointer;
2073
2076
  }
@@ -57197,6 +57200,13 @@ ${codeText}
57197
57200
  }
57198
57201
  return this.items[index2];
57199
57202
  }
57203
+ findItemAsGroupId(commentId) {
57204
+ const index2 = this.items.findIndex((i) => i.comment.groupId === commentId);
57205
+ if (index2 === -1) {
57206
+ return null;
57207
+ }
57208
+ return this.items[index2];
57209
+ }
57200
57210
  destroy() {
57201
57211
  this._items.forEach((item) => item.destroy());
57202
57212
  this._items = [];
@@ -57444,7 +57454,6 @@ ${codeText}
57444
57454
  return this.childrenList.createItem(comment);
57445
57455
  }
57446
57456
  handleUpdateChildComment(comment) {
57447
- assert(logger$D, comment.groupId === this.mainItem.comment.id, "invalid child comment");
57448
57457
  const item = this.childrenList.findItem(comment.id);
57449
57458
  if (!item) {
57450
57459
  logger$D.error(`can't find child comment item: ${comment.id}`);
@@ -57626,7 +57635,7 @@ ${codeText}
57626
57635
  quickReply.show();
57627
57636
  });
57628
57637
  __publicField(this, "handleCommentItemEdit", (commentItem2) => {
57629
- const groupItem = this.groupList.findItem(commentItem2.comment.groupId);
57638
+ const groupItem = this.groupList.findItemAsGroupId(commentItem2.comment.groupId);
57630
57639
  if (!groupItem)
57631
57640
  return;
57632
57641
  const { quickReply } = groupItem;
@@ -57635,7 +57644,7 @@ ${codeText}
57635
57644
  quickReply.hide();
57636
57645
  });
57637
57646
  __publicField(this, "handleCommentItemDelete", (commentItem2) => {
57638
- const groupItem = this.groupList.findItem(commentItem2.comment.groupId);
57647
+ const groupItem = this.groupList.findItemAsGroupId(commentItem2.comment.groupId);
57639
57648
  if (!groupItem)
57640
57649
  return;
57641
57650
  const { quickReply } = groupItem;
@@ -58013,12 +58022,9 @@ ${codeText}
58013
58022
  }
58014
58023
  }
58015
58024
  handleUpdateComment(comment) {
58016
- if (isChildComment(comment)) {
58017
- const groupComment = this.commentsProvider.getComment(comment.groupId);
58018
- const group = this.findItem(groupComment.id);
58019
- if (group) {
58020
- group.handleUpdateChildComment(comment);
58021
- }
58025
+ const group = this.findItemAsGroupId(comment.groupId);
58026
+ if (group && group.comment.id !== comment.id) {
58027
+ group.handleUpdateChildComment(comment);
58022
58028
  return;
58023
58029
  }
58024
58030
  const item = this.findItem(comment.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.7-beta.36",
3
+ "version": "0.0.7-beta.37",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",