@ones-editor/editor 0.0.7-beta.35 → 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
  }
@@ -23309,17 +23312,9 @@ var __publicField = (obj, key, value) => {
23309
23312
  const blockIndex2 = getBlockIndex(block);
23310
23313
  let lastBlock22;
23311
23314
  blocks.forEach((b, index2) => {
23312
- var _a2;
23313
- const currentBlock = getBlockByIndex(getContainerById(editor, containerId), blockIndex2 + index2);
23314
- if (currentBlock && isTextKindBlock(editor, currentBlock) && isEmptyTextBlock(editor, currentBlock)) {
23315
- editor.doc.localUpdateBlockText(containerId, blockIndex2, [
23316
- ...(_a2 = b.text) != null ? _a2 : []
23317
- ]);
23318
- } else {
23319
- const newBlock2 = editor.insertBlock(containerId, blockIndex2 + index2, b, void 0, { noFocus: true });
23320
- if (index2 === blocks.length - 1) {
23321
- lastBlock22 = newBlock2;
23322
- }
23315
+ const newBlock2 = editor.insertBlock(containerId, blockIndex2 + index2, b, void 0, { noFocus: true });
23316
+ if (index2 === blocks.length - 1) {
23317
+ lastBlock22 = newBlock2;
23323
23318
  }
23324
23319
  });
23325
23320
  if (lastBlock22) {
@@ -57205,6 +57200,13 @@ ${codeText}
57205
57200
  }
57206
57201
  return this.items[index2];
57207
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
+ }
57208
57210
  destroy() {
57209
57211
  this._items.forEach((item) => item.destroy());
57210
57212
  this._items = [];
@@ -57452,7 +57454,6 @@ ${codeText}
57452
57454
  return this.childrenList.createItem(comment);
57453
57455
  }
57454
57456
  handleUpdateChildComment(comment) {
57455
- assert(logger$D, comment.groupId === this.mainItem.comment.id, "invalid child comment");
57456
57457
  const item = this.childrenList.findItem(comment.id);
57457
57458
  if (!item) {
57458
57459
  logger$D.error(`can't find child comment item: ${comment.id}`);
@@ -57634,7 +57635,7 @@ ${codeText}
57634
57635
  quickReply.show();
57635
57636
  });
57636
57637
  __publicField(this, "handleCommentItemEdit", (commentItem2) => {
57637
- const groupItem = this.groupList.findItem(commentItem2.comment.groupId);
57638
+ const groupItem = this.groupList.findItemAsGroupId(commentItem2.comment.groupId);
57638
57639
  if (!groupItem)
57639
57640
  return;
57640
57641
  const { quickReply } = groupItem;
@@ -57643,7 +57644,7 @@ ${codeText}
57643
57644
  quickReply.hide();
57644
57645
  });
57645
57646
  __publicField(this, "handleCommentItemDelete", (commentItem2) => {
57646
- const groupItem = this.groupList.findItem(commentItem2.comment.groupId);
57647
+ const groupItem = this.groupList.findItemAsGroupId(commentItem2.comment.groupId);
57647
57648
  if (!groupItem)
57648
57649
  return;
57649
57650
  const { quickReply } = groupItem;
@@ -58021,12 +58022,9 @@ ${codeText}
58021
58022
  }
58022
58023
  }
58023
58024
  handleUpdateComment(comment) {
58024
- if (isChildComment(comment)) {
58025
- const groupComment = this.commentsProvider.getComment(comment.groupId);
58026
- const group = this.findItem(groupComment.id);
58027
- if (group) {
58028
- group.handleUpdateChildComment(comment);
58029
- }
58025
+ const group = this.findItemAsGroupId(comment.groupId);
58026
+ if (group && group.comment.id !== comment.id) {
58027
+ group.handleUpdateChildComment(comment);
58030
58028
  return;
58031
58029
  }
58032
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.35",
3
+ "version": "0.0.7-beta.37",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",