@dxos/react-ui-editor 0.5.3-next.57eca40 → 0.5.3

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.
@@ -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) {