@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.
- package/dist/lib/browser/index.mjs +21 -0
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts +3 -0
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +2 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts +1 -0
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/decorate.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/formatting.d.ts +2 -2
- package/dist/types/src/extensions/markdown/formatting.d.ts.map +1 -1
- package/dist/types/src/extensions/markdown/link.d.ts.map +1 -1
- package/dist/types/src/hooks/useTextEditor.stories.d.ts +1 -0
- package/dist/types/src/hooks/useTextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +25 -25
- package/src/components/TextEditor/TextEditor.stories.tsx +17 -1
- package/src/extensions/markdown/decorate.ts +27 -1
|
@@ -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) {
|