@dxos/react-ui-editor 0.5.3-main.f752aaa → 0.5.3-main.fffc127

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.
@@ -1788,7 +1788,7 @@ var comments = (options = {}) => {
1788
1788
  options.onUpdate ? trackPastedComments(options.onUpdate) : []
1789
1789
  ];
1790
1790
  };
1791
- var focusComment = (view, id, center = true) => {
1791
+ var scrollThreadIntoView = (view, id, center = true) => {
1792
1792
  const comment = view.state.field(commentsState).comments.find((range2) => range2.comment.id === id);
1793
1793
  if (!comment?.comment.cursor) {
1794
1794
  return;
@@ -3726,6 +3726,9 @@ var fencedCodeLineFirst = Decoration5.line({
3726
3726
  var fencedCodeLineLast = Decoration5.line({
3727
3727
  class: mx2("cm-code cm-codeblock-line", "cm-codeblock-last")
3728
3728
  });
3729
+ var commentBlockLine = fencedCodeLine;
3730
+ var commentBlockLineFirst = fencedCodeLineFirst;
3731
+ var commentBlockLineLast = fencedCodeLineLast;
3729
3732
  var horizontalRule = Decoration5.replace({
3730
3733
  widget: new HorizontalRuleWidget()
3731
3734
  });
@@ -3756,6 +3759,24 @@ var buildDecorations = (view, options, focus) => {
3756
3759
  to,
3757
3760
  enter: (node) => {
3758
3761
  switch (node.name) {
3762
+ case "CommentBlock": {
3763
+ const editing = editingRange(state2, node, focus);
3764
+ for (const block of view.viewportLineBlocks) {
3765
+ if (block.to < node.from) {
3766
+ continue;
3767
+ }
3768
+ if (block.from > node.to) {
3769
+ break;
3770
+ }
3771
+ const first = block.from <= node.from;
3772
+ const last = block.to >= node.to && /^(\s>)*-->$/.test(state2.doc.sliceString(block.from, block.to));
3773
+ deco.add(block.from, block.from, first ? commentBlockLineFirst : last ? commentBlockLineLast : commentBlockLine);
3774
+ if (!editing && (first || last)) {
3775
+ atomicDeco.add(block.from, block.to, hide);
3776
+ }
3777
+ }
3778
+ break;
3779
+ }
3759
3780
  case "FencedCode": {
3760
3781
  const editing = editingRange(state2, node, focus);
3761
3782
  for (const block of view.viewportLineBlocks) {
@@ -4990,7 +5011,6 @@ export {
4990
5011
  editorFillLayoutRoot,
4991
5012
  editorMode,
4992
5013
  editorWithToolbarLayout,
4993
- focusComment,
4994
5014
  focusEvent,
4995
5015
  formattingEquals,
4996
5016
  formattingKeymap,
@@ -5014,6 +5034,7 @@ export {
5014
5034
  removeLink,
5015
5035
  removeList,
5016
5036
  removeStyle,
5037
+ scrollThreadIntoView,
5017
5038
  setBlockquote,
5018
5039
  setComments,
5019
5040
  setHeading,