@onereach/ui-components 4.4.0-beta.2678.0 → 4.4.0-beta.2680.0
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/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +13 -6
- package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.js +1 -1
- package/dist/bundled/v2/components/index.js +1 -1
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v2/{markdown-d704b3a8.js → markdown-d43767b0.js} +9 -4
- package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-c1cc12b1.js → OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js} +12 -5
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +4 -4
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +2 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +1 -1
- package/dist/bundled/v3/components/index.js +2 -2
- package/dist/bundled/v3/index.js +2 -2
- package/dist/bundled/v3/{markdown-d704b3a8.js → markdown-d43767b0.js} +9 -4
- package/dist/esm/v2/{OrRichTextEditor-c184da4b.js → OrRichTextEditor-cb50c4f6.js} +21 -9
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrRichTextEditor-592db26c.js → OrRichTextEditor-c3560ddb.js} +21 -9
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v3/index.js +1 -1
- package/package.json +2 -2
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +3 -11
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +22 -4
- package/src/components/or-rich-text-editor-v3/utils/markdown.ts +7 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, onBeforeUnmount, computed, watch } from 'vue-demi';
|
|
2
2
|
import { u as useFocusTrap } from '../../useFocusTrap-48767a70.js';
|
|
3
3
|
import { useResizeObserver, onClickOutside } from '@vueuse/core';
|
|
4
|
-
import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, U as Underline, c as Link, e as Highlight } from '../../markdown-
|
|
4
|
+
import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, U as Underline, c as Link, e as Highlight } from '../../markdown-d43767b0.js';
|
|
5
5
|
import { EditorContainer, ToolbarContainer, Toolbar, ToolbarButtonFocused, ToolbarButton, EditorInput } from './styles.js';
|
|
6
6
|
import { Formats } from './props.js';
|
|
7
7
|
import { M as Mark, m as mergeAttributes, a as markInputRule, b as markPasteRule, N as Node, E as Extension, k as keydownHandler, D as DecorationSet, c as Decoration, d as callOrReturn, g as getExtensionField, t as textblockTypeInputRule, n as nodeInputRule, e as Editor } from '../../index-1182caa8.js';
|
|
@@ -1622,6 +1622,8 @@ var script = defineComponent({
|
|
|
1622
1622
|
},
|
|
1623
1623
|
element: editorRef.value,
|
|
1624
1624
|
autofocus: props.autofocus,
|
|
1625
|
+
enableInputRules: true,
|
|
1626
|
+
enablePasteRules: true,
|
|
1625
1627
|
extensions: [codemirrorNode, StarterKit.configure({
|
|
1626
1628
|
heading: false,
|
|
1627
1629
|
codeBlock: false
|
|
@@ -1655,6 +1657,9 @@ var script = defineComponent({
|
|
|
1655
1657
|
attributes: {
|
|
1656
1658
|
class: 'focus:outline-none'
|
|
1657
1659
|
}
|
|
1660
|
+
},
|
|
1661
|
+
parseOptions: {
|
|
1662
|
+
preserveWhitespace: true
|
|
1658
1663
|
}
|
|
1659
1664
|
});
|
|
1660
1665
|
setActiveFormats();
|
|
@@ -1728,9 +1733,11 @@ var script = defineComponent({
|
|
|
1728
1733
|
plugins: editor.extensionManager.plugins
|
|
1729
1734
|
}));
|
|
1730
1735
|
if (disableMarkdown.value) {
|
|
1731
|
-
|
|
1736
|
+
const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
1737
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
|
|
1738
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
|
|
1732
1739
|
} else {
|
|
1733
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.
|
|
1740
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getText()));
|
|
1734
1741
|
}
|
|
1735
1742
|
break;
|
|
1736
1743
|
case 'bulletList':
|
|
@@ -1865,8 +1872,8 @@ var script = defineComponent({
|
|
|
1865
1872
|
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
1866
1873
|
}
|
|
1867
1874
|
if (props.format === 'markdown' && value !== markdownOutput.value) {
|
|
1868
|
-
const deserialized = deserialize(editor
|
|
1869
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(
|
|
1875
|
+
// const deserialized = deserialize(editor?.schema, value);
|
|
1876
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
1870
1877
|
}
|
|
1871
1878
|
});
|
|
1872
1879
|
return {
|
|
@@ -1905,7 +1912,7 @@ var script = defineComponent({
|
|
|
1905
1912
|
}
|
|
1906
1913
|
});
|
|
1907
1914
|
|
|
1908
|
-
var css_248z = ".tiptap-editor-v3 ol{margin:0 24px;list-style:decimal}.tiptap-editor-v3 ul{margin:0 24px;list-style:disc outside none;list-style:initial}.tiptap-editor-v3 blockquote{margin:8px 24px;padding:0 24px;border-left:4px solid #bad1ec}.tiptap-editor-v3 .is-editor-empty::before{content:attr(data-placeholder);height:0;pointer-events:none;float:left}.tiptap-editor-v3 .cm-editor{border:none;border-radius:4px}.tiptap-editor-v3 .cm-editor .cm-scroller{border-radius:4px}.tiptap-editor-v3 .cm-editor.cm-focused{outline:0}.tiptap-editor-v3 .cm-editor .cm-gutters{background-color:rgba(0,95,177,.08);border:none}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement{padding:0 10px}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter{background-color:rgba(0,95,177,.07)}";
|
|
1915
|
+
var css_248z = ".tiptap-editor-v3 ol{margin:0 24px;list-style:decimal}.tiptap-editor-v3 .ProseMirror p{margin:4px}.tiptap-editor-v3 .ProseMirror h1,.tiptap-editor-v3 .ProseMirror h2,.tiptap-editor-v3 .ProseMirror h3,.tiptap-editor-v3 .ProseMirror h4,.tiptap-editor-v3 .ProseMirror h5,.tiptap-editor-v3 .ProseMirror h6{margin:4px}.tiptap-editor-v3 ul{margin:0 24px;list-style:disc outside none;list-style:initial}.tiptap-editor-v3 blockquote{margin:8px 24px;padding:0 24px;border-left:4px solid #bad1ec}.tiptap-editor-v3 .is-editor-empty::before{content:attr(data-placeholder);height:0;pointer-events:none;float:left}.tiptap-editor-v3 .cm-editor{border:none;border-radius:4px}.tiptap-editor-v3 .cm-editor .cm-scroller{border-radius:4px}.tiptap-editor-v3 .cm-editor.cm-focused{outline:0}.tiptap-editor-v3 .cm-editor .cm-gutters{background-color:rgba(0,95,177,.08);border:none}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement{padding:0 10px}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter{background-color:rgba(0,95,177,.07)}";
|
|
1909
1916
|
styleInject(css_248z);
|
|
1910
1917
|
|
|
1911
1918
|
/* script */
|
|
@@ -2,7 +2,7 @@ export { default as OrRichTextEditorV3 } from './OrRichTextEditor.js';
|
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../useFocusTrap-48767a70.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
|
-
import '../../markdown-
|
|
5
|
+
import '../../markdown-d43767b0.js';
|
|
6
6
|
import '../../index-85c2efe8.js';
|
|
7
7
|
import 'node:punycode';
|
|
8
8
|
import '../../index-1182caa8.js';
|
|
@@ -252,7 +252,7 @@ import './OrToast/Timer.js';
|
|
|
252
252
|
import './OrToastV3/styles.js';
|
|
253
253
|
import './OrToastV3/composable/useToastEventBus.js';
|
|
254
254
|
import './OrToastV3/Timer.js';
|
|
255
|
-
import '../markdown-
|
|
255
|
+
import '../markdown-d43767b0.js';
|
|
256
256
|
import '../index-85c2efe8.js';
|
|
257
257
|
import 'node:punycode';
|
|
258
258
|
import '../index-1182caa8.js';
|
package/dist/bundled/v2/index.js
CHANGED
|
@@ -227,7 +227,7 @@ import './components/OrToastV3/composable/useToastEventBus.js';
|
|
|
227
227
|
import './components/OrToastV3/styles.js';
|
|
228
228
|
import './components/OrToastV3/Timer.js';
|
|
229
229
|
import './useFocusTrap-48767a70.js';
|
|
230
|
-
import './markdown-
|
|
230
|
+
import './markdown-d43767b0.js';
|
|
231
231
|
import './index-85c2efe8.js';
|
|
232
232
|
import 'node:punycode';
|
|
233
233
|
import './index-1182caa8.js';
|
|
@@ -17918,8 +17918,8 @@ const serializerMarks = {
|
|
|
17918
17918
|
expelEnclosingWhitespace: true
|
|
17919
17919
|
},
|
|
17920
17920
|
[Italic.name]: {
|
|
17921
|
-
open: '_',
|
|
17922
|
-
close: '_',
|
|
17921
|
+
open: ' _',
|
|
17922
|
+
close: '_ ',
|
|
17923
17923
|
mixable: true,
|
|
17924
17924
|
expelEnclosingWhitespace: true
|
|
17925
17925
|
},
|
|
@@ -17956,11 +17956,16 @@ const isPlainURL = (link, parent, index, side) => {
|
|
|
17956
17956
|
const serialize = (schema, content) => {
|
|
17957
17957
|
const proseMirrorDocument = schema.nodeFromJSON(content);
|
|
17958
17958
|
const serializer = new MarkdownSerializer(serializerNodes, serializerMarks);
|
|
17959
|
-
return serializer.serialize(proseMirrorDocument
|
|
17959
|
+
return serializer.serialize(proseMirrorDocument, {
|
|
17960
|
+
tightLists: true
|
|
17961
|
+
});
|
|
17960
17962
|
};
|
|
17961
17963
|
const deserialize = (schema, content) => {
|
|
17962
17964
|
if (!content) return null;
|
|
17963
|
-
const html = marked
|
|
17965
|
+
const html = marked(content, {
|
|
17966
|
+
gfm: true,
|
|
17967
|
+
breaks: true
|
|
17968
|
+
});
|
|
17964
17969
|
if (!html) return null;
|
|
17965
17970
|
const parser = new DOMParser();
|
|
17966
17971
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, onBeforeUnmount, computed, watch } from 'vue-demi';
|
|
2
2
|
import { u as useFocusTrap } from './useFocusTrap-48767a70.js';
|
|
3
3
|
import { useResizeObserver, onClickOutside } from '@vueuse/core';
|
|
4
|
-
import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, U as Underline, c as Link, e as Highlight } from './markdown-
|
|
4
|
+
import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, U as Underline, c as Link, e as Highlight } from './markdown-d43767b0.js';
|
|
5
5
|
import { EditorContainer, ToolbarContainer, Toolbar, ToolbarButtonFocused, ToolbarButton, EditorInput } from './components/OrRichTextEditorV3/styles.js';
|
|
6
6
|
import { Formats } from './components/OrRichTextEditorV3/props.js';
|
|
7
7
|
import { M as Mark, m as mergeAttributes, a as markInputRule, b as markPasteRule, N as Node, E as Extension, k as keydownHandler, D as DecorationSet, c as Decoration, d as callOrReturn, g as getExtensionField, t as textblockTypeInputRule, n as nodeInputRule, e as Editor } from './index-1182caa8.js';
|
|
@@ -1576,6 +1576,8 @@ var script = defineComponent({
|
|
|
1576
1576
|
},
|
|
1577
1577
|
element: editorRef.value,
|
|
1578
1578
|
autofocus: props.autofocus,
|
|
1579
|
+
enableInputRules: true,
|
|
1580
|
+
enablePasteRules: true,
|
|
1579
1581
|
extensions: [codemirrorNode, StarterKit.configure({
|
|
1580
1582
|
heading: false,
|
|
1581
1583
|
codeBlock: false
|
|
@@ -1609,6 +1611,9 @@ var script = defineComponent({
|
|
|
1609
1611
|
attributes: {
|
|
1610
1612
|
class: 'focus:outline-none'
|
|
1611
1613
|
}
|
|
1614
|
+
},
|
|
1615
|
+
parseOptions: {
|
|
1616
|
+
preserveWhitespace: true
|
|
1612
1617
|
}
|
|
1613
1618
|
});
|
|
1614
1619
|
setActiveFormats();
|
|
@@ -1682,9 +1687,11 @@ var script = defineComponent({
|
|
|
1682
1687
|
plugins: editor.extensionManager.plugins
|
|
1683
1688
|
}));
|
|
1684
1689
|
if (disableMarkdown.value) {
|
|
1685
|
-
|
|
1690
|
+
const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
1691
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
|
|
1692
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
|
|
1686
1693
|
} else {
|
|
1687
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.
|
|
1694
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getText()));
|
|
1688
1695
|
}
|
|
1689
1696
|
break;
|
|
1690
1697
|
case 'bulletList':
|
|
@@ -1819,8 +1826,8 @@ var script = defineComponent({
|
|
|
1819
1826
|
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
1820
1827
|
}
|
|
1821
1828
|
if (props.format === 'markdown' && value !== markdownOutput.value) {
|
|
1822
|
-
const deserialized = deserialize(editor
|
|
1823
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(
|
|
1829
|
+
// const deserialized = deserialize(editor?.schema, value);
|
|
1830
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
1824
1831
|
}
|
|
1825
1832
|
});
|
|
1826
1833
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { s as script } from '../../OrRichTextEditor.vue_vue_type_script_lang-
|
|
2
|
-
export { s as default } from '../../OrRichTextEditor.vue_vue_type_script_lang-
|
|
1
|
+
import { s as script } from '../../OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js';
|
|
2
|
+
export { s as default } from '../../OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js';
|
|
3
3
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, createBlock, createCommentVNode, renderSlot } from 'vue';
|
|
4
4
|
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
5
5
|
import 'vue-demi';
|
|
6
6
|
import '../../useFocusTrap-48767a70.js';
|
|
7
7
|
import '@vueuse/core';
|
|
8
|
-
import '../../markdown-
|
|
8
|
+
import '../../markdown-d43767b0.js';
|
|
9
9
|
import '../../index-85c2efe8.js';
|
|
10
10
|
import 'node:punycode';
|
|
11
11
|
import '../../index-1182caa8.js';
|
|
@@ -267,7 +267,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
267
267
|
}, 8 /* PROPS */, ["is-open"])], 2 /* CLASS */);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
var css_248z = ".tiptap-editor-v3 ol {\n margin: 0 24px;\n list-style: decimal;\n}\n.tiptap-editor-v3 ul {\n margin: 0 24px;\n list-style: disc outside none;\n list-style: initial;\n}\n.tiptap-editor-v3 blockquote {\n margin: 8px 24px;\n padding: 0 24px;\n border-left: 4px solid #bad1ec;\n}\n.tiptap-editor-v3 .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}\n.tiptap-editor-v3 .cm-editor {\n border: none;\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor .cm-scroller {\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor.cm-focused {\n outline: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters {\n background-color: rgba(0, 95, 177, 0.08);\n border: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement {\n padding: 0 10px;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter {\n background-color: rgba(0, 95, 177, 0.07);\n}";
|
|
270
|
+
var css_248z = ".tiptap-editor-v3 ol {\n margin: 0 24px;\n list-style: decimal;\n}\n.tiptap-editor-v3 .ProseMirror p {\n margin: 4px;\n}\n.tiptap-editor-v3 .ProseMirror h1, .tiptap-editor-v3 .ProseMirror h2, .tiptap-editor-v3 .ProseMirror h3, .tiptap-editor-v3 .ProseMirror h4, .tiptap-editor-v3 .ProseMirror h5, .tiptap-editor-v3 .ProseMirror h6 {\n margin: 4px;\n}\n.tiptap-editor-v3 ul {\n margin: 0 24px;\n list-style: disc outside none;\n list-style: initial;\n}\n.tiptap-editor-v3 blockquote {\n margin: 8px 24px;\n padding: 0 24px;\n border-left: 4px solid #bad1ec;\n}\n.tiptap-editor-v3 .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}\n.tiptap-editor-v3 .cm-editor {\n border: none;\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor .cm-scroller {\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor.cm-focused {\n outline: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters {\n background-color: rgba(0, 95, 177, 0.08);\n border: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement {\n padding: 0 10px;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter {\n background-color: rgba(0, 95, 177, 0.07);\n}";
|
|
271
271
|
styleInject(css_248z);
|
|
272
272
|
|
|
273
273
|
script.render = render;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { s as OrRichTextEditorV3 } from '../../OrRichTextEditor.vue_vue_type_script_lang-
|
|
1
|
+
export { s as OrRichTextEditorV3 } from '../../OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../useFocusTrap-48767a70.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
|
-
import '../../markdown-
|
|
5
|
+
import '../../markdown-d43767b0.js';
|
|
6
6
|
import '../../index-85c2efe8.js';
|
|
7
7
|
import 'node:punycode';
|
|
8
8
|
import '../../index-1182caa8.js';
|
|
@@ -155,7 +155,7 @@ export { p as PropsV3 } from '../props-7be029c7.js';
|
|
|
155
155
|
export { s as OrTooltip } from '../OrTooltip.vue_vue_type_script_lang-76a6b7f4.js';
|
|
156
156
|
export { s as OrTooltipContent } from '../OrTooltipContent.vue_vue_type_script_lang-969c20ed.js';
|
|
157
157
|
export { s as OrTooltipV3 } from '../OrTooltip.vue_vue_type_script_lang-56496d67.js';
|
|
158
|
-
export { s as OrRichTextEditorV3 } from '../OrRichTextEditor.vue_vue_type_script_lang-
|
|
158
|
+
export { s as OrRichTextEditorV3 } from '../OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js';
|
|
159
159
|
import 'vue-demi';
|
|
160
160
|
import 'lodash';
|
|
161
161
|
import './OrIcon/OrIcon.js';
|
|
@@ -293,7 +293,7 @@ import './OrToast/Timer.js';
|
|
|
293
293
|
import './OrToastV3/styles.js';
|
|
294
294
|
import './OrToastV3/composable/useToastEventBus.js';
|
|
295
295
|
import './OrToastV3/Timer.js';
|
|
296
|
-
import '../markdown-
|
|
296
|
+
import '../markdown-d43767b0.js';
|
|
297
297
|
import '../index-85c2efe8.js';
|
|
298
298
|
import 'node:punycode';
|
|
299
299
|
import '../index-1182caa8.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -124,7 +124,7 @@ import './components/OrToastContainerV3/OrToastContainer.js';
|
|
|
124
124
|
export { s as OrToastContainerV3 } from './OrToastContainer.vue_vue_type_script_lang-9a91e4ab.js';
|
|
125
125
|
export { default as useToastV3 } from './components/OrToastV3/composable/useToast.js';
|
|
126
126
|
import './components/OrRichTextEditorV3/OrRichTextEditor.js';
|
|
127
|
-
export { s as OrRichTextEditorV3 } from './OrRichTextEditor.vue_vue_type_script_lang-
|
|
127
|
+
export { s as OrRichTextEditorV3 } from './OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js';
|
|
128
128
|
export { OR_AVATAR_SIZE } from './components/OrAvatar/constants.js';
|
|
129
129
|
export { AvatarColor, AvatarSize } from './components/OrAvatarV3/props.js';
|
|
130
130
|
export { s as OrBottomSheetV3 } from './OrBottomSheet.vue_vue_type_script_lang-a81b2abb.js';
|
|
@@ -325,7 +325,7 @@ import './components/OrToastV3/styles.js';
|
|
|
325
325
|
import './components/OrTeleportV3/OrTeleport.js';
|
|
326
326
|
import './components/OrToastV3/Timer.js';
|
|
327
327
|
import './useFocusTrap-48767a70.js';
|
|
328
|
-
import './markdown-
|
|
328
|
+
import './markdown-d43767b0.js';
|
|
329
329
|
import './index-85c2efe8.js';
|
|
330
330
|
import 'node:punycode';
|
|
331
331
|
import './index-1182caa8.js';
|
|
@@ -17918,8 +17918,8 @@ const serializerMarks = {
|
|
|
17918
17918
|
expelEnclosingWhitespace: true
|
|
17919
17919
|
},
|
|
17920
17920
|
[Italic.name]: {
|
|
17921
|
-
open: '_',
|
|
17922
|
-
close: '_',
|
|
17921
|
+
open: ' _',
|
|
17922
|
+
close: '_ ',
|
|
17923
17923
|
mixable: true,
|
|
17924
17924
|
expelEnclosingWhitespace: true
|
|
17925
17925
|
},
|
|
@@ -17956,11 +17956,16 @@ const isPlainURL = (link, parent, index, side) => {
|
|
|
17956
17956
|
const serialize = (schema, content) => {
|
|
17957
17957
|
const proseMirrorDocument = schema.nodeFromJSON(content);
|
|
17958
17958
|
const serializer = new MarkdownSerializer(serializerNodes, serializerMarks);
|
|
17959
|
-
return serializer.serialize(proseMirrorDocument
|
|
17959
|
+
return serializer.serialize(proseMirrorDocument, {
|
|
17960
|
+
tightLists: true
|
|
17961
|
+
});
|
|
17960
17962
|
};
|
|
17961
17963
|
const deserialize = (schema, content) => {
|
|
17962
17964
|
if (!content) return null;
|
|
17963
|
-
const html = marked
|
|
17965
|
+
const html = marked(content, {
|
|
17966
|
+
gfm: true,
|
|
17967
|
+
breaks: true
|
|
17968
|
+
});
|
|
17964
17969
|
if (!html) return null;
|
|
17965
17970
|
const parser = new DOMParser();
|
|
17966
17971
|
const {
|
|
@@ -55,8 +55,8 @@ const serializerMarks = {
|
|
|
55
55
|
expelEnclosingWhitespace: true
|
|
56
56
|
},
|
|
57
57
|
[Italic.name]: {
|
|
58
|
-
open: '_',
|
|
59
|
-
close: '_',
|
|
58
|
+
open: ' _',
|
|
59
|
+
close: '_ ',
|
|
60
60
|
mixable: true,
|
|
61
61
|
expelEnclosingWhitespace: true
|
|
62
62
|
},
|
|
@@ -93,11 +93,16 @@ const isPlainURL = (link, parent, index, side) => {
|
|
|
93
93
|
const serialize = (schema, content) => {
|
|
94
94
|
const proseMirrorDocument = schema.nodeFromJSON(content);
|
|
95
95
|
const serializer = new MarkdownSerializer(serializerNodes, serializerMarks);
|
|
96
|
-
return serializer.serialize(proseMirrorDocument
|
|
96
|
+
return serializer.serialize(proseMirrorDocument, {
|
|
97
|
+
tightLists: true
|
|
98
|
+
});
|
|
97
99
|
};
|
|
98
100
|
const deserialize = (schema, content) => {
|
|
99
101
|
if (!content) return null;
|
|
100
|
-
const html = marked
|
|
102
|
+
const html = marked(content, {
|
|
103
|
+
gfm: true,
|
|
104
|
+
breaks: true
|
|
105
|
+
});
|
|
101
106
|
if (!html) return null;
|
|
102
107
|
const parser = new DOMParser();
|
|
103
108
|
const {
|
|
@@ -340,6 +345,8 @@ var script = defineComponent({
|
|
|
340
345
|
},
|
|
341
346
|
element: editorRef.value,
|
|
342
347
|
autofocus: props.autofocus,
|
|
348
|
+
enableInputRules: true,
|
|
349
|
+
enablePasteRules: true,
|
|
343
350
|
extensions: [codemirrorNode, StarterKit.configure({
|
|
344
351
|
heading: false,
|
|
345
352
|
codeBlock: false
|
|
@@ -373,6 +380,9 @@ var script = defineComponent({
|
|
|
373
380
|
attributes: {
|
|
374
381
|
class: 'focus:outline-none'
|
|
375
382
|
}
|
|
383
|
+
},
|
|
384
|
+
parseOptions: {
|
|
385
|
+
preserveWhitespace: true
|
|
376
386
|
}
|
|
377
387
|
});
|
|
378
388
|
setActiveFormats();
|
|
@@ -446,9 +456,11 @@ var script = defineComponent({
|
|
|
446
456
|
plugins: editor.extensionManager.plugins
|
|
447
457
|
}));
|
|
448
458
|
if (disableMarkdown.value) {
|
|
449
|
-
|
|
459
|
+
const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
460
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
|
|
461
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
|
|
450
462
|
} else {
|
|
451
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.
|
|
463
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getText()));
|
|
452
464
|
}
|
|
453
465
|
break;
|
|
454
466
|
case 'bulletList':
|
|
@@ -583,8 +595,8 @@ var script = defineComponent({
|
|
|
583
595
|
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
584
596
|
}
|
|
585
597
|
if (props.format === 'markdown' && value !== markdownOutput.value) {
|
|
586
|
-
const deserialized = deserialize(editor
|
|
587
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(
|
|
598
|
+
// const deserialized = deserialize(editor?.schema, value);
|
|
599
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
588
600
|
}
|
|
589
601
|
});
|
|
590
602
|
return {
|
|
@@ -623,7 +635,7 @@ var script = defineComponent({
|
|
|
623
635
|
}
|
|
624
636
|
});
|
|
625
637
|
|
|
626
|
-
var css_248z = ".tiptap-editor-v3 ol{margin:0 24px;list-style:decimal}.tiptap-editor-v3 ul{margin:0 24px;list-style:initial}.tiptap-editor-v3 blockquote{margin:8px 24px;padding:0 24px;border-left:4px solid #bad1ec}.tiptap-editor-v3 .is-editor-empty::before{content:attr(data-placeholder);height:0;pointer-events:none;float:left}.tiptap-editor-v3 .cm-editor{border:none;border-radius:4px}.tiptap-editor-v3 .cm-editor .cm-scroller{border-radius:4px}.tiptap-editor-v3 .cm-editor.cm-focused{outline:0}.tiptap-editor-v3 .cm-editor .cm-gutters{background-color:rgba(0,95,177,.08);border:none}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement{padding:0 10px}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter{background-color:rgba(0,95,177,.07)}";
|
|
638
|
+
var css_248z = ".tiptap-editor-v3 ol{margin:0 24px;list-style:decimal}.tiptap-editor-v3 .ProseMirror p{margin:4px}.tiptap-editor-v3 .ProseMirror h1,.tiptap-editor-v3 .ProseMirror h2,.tiptap-editor-v3 .ProseMirror h3,.tiptap-editor-v3 .ProseMirror h4,.tiptap-editor-v3 .ProseMirror h5,.tiptap-editor-v3 .ProseMirror h6{margin:4px}.tiptap-editor-v3 ul{margin:0 24px;list-style:initial}.tiptap-editor-v3 blockquote{margin:8px 24px;padding:0 24px;border-left:4px solid #bad1ec}.tiptap-editor-v3 .is-editor-empty::before{content:attr(data-placeholder);height:0;pointer-events:none;float:left}.tiptap-editor-v3 .cm-editor{border:none;border-radius:4px}.tiptap-editor-v3 .cm-editor .cm-scroller{border-radius:4px}.tiptap-editor-v3 .cm-editor.cm-focused{outline:0}.tiptap-editor-v3 .cm-editor .cm-gutters{background-color:rgba(0,95,177,.08);border:none}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement{padding:0 10px}.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter{background-color:rgba(0,95,177,.07)}";
|
|
627
639
|
styleInject(css_248z);
|
|
628
640
|
|
|
629
641
|
/* script */
|
|
@@ -110,7 +110,7 @@ export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../useToast-a133
|
|
|
110
110
|
export { _ as OrTooltip } from '../OrTooltip-97a42707.js';
|
|
111
111
|
export { _ as OrTooltipContent } from '../OrTooltipContent-d85e1071.js';
|
|
112
112
|
export { _ as OrTooltipV3 } from '../OrTooltip-93a3eefb.js';
|
|
113
|
-
export { _ as OrRichTextEditorV3 } from '../OrRichTextEditor-
|
|
113
|
+
export { _ as OrRichTextEditorV3 } from '../OrRichTextEditor-cb50c4f6.js';
|
|
114
114
|
import 'vue-demi';
|
|
115
115
|
import 'lodash';
|
|
116
116
|
import '../style-inject.es-4c6f2515.js';
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -110,7 +110,7 @@ export { p as PropsV3, a as useQueueV3, u as useToastV3 } from './useToast-a1332
|
|
|
110
110
|
export { _ as OrTooltip } from './OrTooltip-97a42707.js';
|
|
111
111
|
export { _ as OrTooltipContent } from './OrTooltipContent-d85e1071.js';
|
|
112
112
|
export { _ as OrTooltipV3 } from './OrTooltip-93a3eefb.js';
|
|
113
|
-
export { _ as OrRichTextEditorV3 } from './OrRichTextEditor-
|
|
113
|
+
export { _ as OrRichTextEditorV3 } from './OrRichTextEditor-cb50c4f6.js';
|
|
114
114
|
export { D as DropdownClose, a as DropdownOpen } from './dropdown-open-e1f90e0a.js';
|
|
115
115
|
export { u as useControlAttributes, a as useIdAttribute } from './useIdAttribute-859439f0.js';
|
|
116
116
|
export { u as useElevation } from './useElevation-b5a49746.js';
|
|
@@ -55,8 +55,8 @@ const serializerMarks = {
|
|
|
55
55
|
expelEnclosingWhitespace: true
|
|
56
56
|
},
|
|
57
57
|
[Italic.name]: {
|
|
58
|
-
open: '_',
|
|
59
|
-
close: '_',
|
|
58
|
+
open: ' _',
|
|
59
|
+
close: '_ ',
|
|
60
60
|
mixable: true,
|
|
61
61
|
expelEnclosingWhitespace: true
|
|
62
62
|
},
|
|
@@ -93,11 +93,16 @@ const isPlainURL = (link, parent, index, side) => {
|
|
|
93
93
|
const serialize = (schema, content) => {
|
|
94
94
|
const proseMirrorDocument = schema.nodeFromJSON(content);
|
|
95
95
|
const serializer = new MarkdownSerializer(serializerNodes, serializerMarks);
|
|
96
|
-
return serializer.serialize(proseMirrorDocument
|
|
96
|
+
return serializer.serialize(proseMirrorDocument, {
|
|
97
|
+
tightLists: true
|
|
98
|
+
});
|
|
97
99
|
};
|
|
98
100
|
const deserialize = (schema, content) => {
|
|
99
101
|
if (!content) return null;
|
|
100
|
-
const html = marked
|
|
102
|
+
const html = marked(content, {
|
|
103
|
+
gfm: true,
|
|
104
|
+
breaks: true
|
|
105
|
+
});
|
|
101
106
|
if (!html) return null;
|
|
102
107
|
const parser = new DOMParser();
|
|
103
108
|
const {
|
|
@@ -340,6 +345,8 @@ var script = defineComponent({
|
|
|
340
345
|
},
|
|
341
346
|
element: editorRef.value,
|
|
342
347
|
autofocus: props.autofocus,
|
|
348
|
+
enableInputRules: true,
|
|
349
|
+
enablePasteRules: true,
|
|
343
350
|
extensions: [codemirrorNode, StarterKit.configure({
|
|
344
351
|
heading: false,
|
|
345
352
|
codeBlock: false
|
|
@@ -373,6 +380,9 @@ var script = defineComponent({
|
|
|
373
380
|
attributes: {
|
|
374
381
|
class: 'focus:outline-none'
|
|
375
382
|
}
|
|
383
|
+
},
|
|
384
|
+
parseOptions: {
|
|
385
|
+
preserveWhitespace: true
|
|
376
386
|
}
|
|
377
387
|
});
|
|
378
388
|
setActiveFormats();
|
|
@@ -446,9 +456,11 @@ var script = defineComponent({
|
|
|
446
456
|
plugins: editor.extensionManager.plugins
|
|
447
457
|
}));
|
|
448
458
|
if (disableMarkdown.value) {
|
|
449
|
-
|
|
459
|
+
const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
460
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
|
|
461
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
|
|
450
462
|
} else {
|
|
451
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.
|
|
463
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getText()));
|
|
452
464
|
}
|
|
453
465
|
break;
|
|
454
466
|
case 'bulletList':
|
|
@@ -583,8 +595,8 @@ var script = defineComponent({
|
|
|
583
595
|
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
584
596
|
}
|
|
585
597
|
if (props.format === 'markdown' && value !== markdownOutput.value) {
|
|
586
|
-
const deserialized = deserialize(editor
|
|
587
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(
|
|
598
|
+
// const deserialized = deserialize(editor?.schema, value);
|
|
599
|
+
editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
|
|
588
600
|
}
|
|
589
601
|
});
|
|
590
602
|
return {
|
|
@@ -804,7 +816,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
804
816
|
}, 8 /* PROPS */, ["is-open"])], 2 /* CLASS */);
|
|
805
817
|
}
|
|
806
818
|
|
|
807
|
-
var css_248z = ".tiptap-editor-v3 ol {\n margin: 0 24px;\n list-style: decimal;\n}\n.tiptap-editor-v3 ul {\n margin: 0 24px;\n list-style: initial;\n}\n.tiptap-editor-v3 blockquote {\n margin: 8px 24px;\n padding: 0 24px;\n border-left: 4px solid #bad1ec;\n}\n.tiptap-editor-v3 .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}\n.tiptap-editor-v3 .cm-editor {\n border: none;\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor .cm-scroller {\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor.cm-focused {\n outline: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters {\n background-color: rgba(0, 95, 177, 0.08);\n border: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement {\n padding: 0 10px;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter {\n background-color: rgba(0, 95, 177, 0.07);\n}";
|
|
819
|
+
var css_248z = ".tiptap-editor-v3 ol {\n margin: 0 24px;\n list-style: decimal;\n}\n.tiptap-editor-v3 .ProseMirror p {\n margin: 4px;\n}\n.tiptap-editor-v3 .ProseMirror h1, .tiptap-editor-v3 .ProseMirror h2, .tiptap-editor-v3 .ProseMirror h3, .tiptap-editor-v3 .ProseMirror h4, .tiptap-editor-v3 .ProseMirror h5, .tiptap-editor-v3 .ProseMirror h6 {\n margin: 4px;\n}\n.tiptap-editor-v3 ul {\n margin: 0 24px;\n list-style: initial;\n}\n.tiptap-editor-v3 blockquote {\n margin: 8px 24px;\n padding: 0 24px;\n border-left: 4px solid #bad1ec;\n}\n.tiptap-editor-v3 .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}\n.tiptap-editor-v3 .cm-editor {\n border: none;\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor .cm-scroller {\n border-radius: 4px;\n}\n.tiptap-editor-v3 .cm-editor.cm-focused {\n outline: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters {\n background-color: rgba(0, 95, 177, 0.08);\n border: none;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement {\n padding: 0 10px;\n}\n.tiptap-editor-v3 .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter {\n background-color: rgba(0, 95, 177, 0.07);\n}";
|
|
808
820
|
styleInject(css_248z);
|
|
809
821
|
|
|
810
822
|
script.render = render;
|
|
@@ -108,7 +108,7 @@ export { p as PropsV3, a as useQueueV3, u as useToastV3 } from '../useToast-a133
|
|
|
108
108
|
export { s as OrTooltip } from '../OrTooltip-89ce98e8.js';
|
|
109
109
|
export { s as OrTooltipContent } from '../OrTooltipContent-37a5f562.js';
|
|
110
110
|
export { s as OrTooltipV3 } from '../OrTooltip-4bb0054a.js';
|
|
111
|
-
export { s as OrRichTextEditorV3 } from '../OrRichTextEditor-
|
|
111
|
+
export { s as OrRichTextEditorV3 } from '../OrRichTextEditor-c3560ddb.js';
|
|
112
112
|
import 'vue-demi';
|
|
113
113
|
import 'lodash';
|
|
114
114
|
import 'vue';
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -108,7 +108,7 @@ export { p as PropsV3, a as useQueueV3, u as useToastV3 } from './useToast-a1332
|
|
|
108
108
|
export { s as OrTooltip } from './OrTooltip-89ce98e8.js';
|
|
109
109
|
export { s as OrTooltipContent } from './OrTooltipContent-37a5f562.js';
|
|
110
110
|
export { s as OrTooltipV3 } from './OrTooltip-4bb0054a.js';
|
|
111
|
-
export { s as OrRichTextEditorV3 } from './OrRichTextEditor-
|
|
111
|
+
export { s as OrRichTextEditorV3 } from './OrRichTextEditor-c3560ddb.js';
|
|
112
112
|
export { D as DropdownClose, a as DropdownOpen } from './dropdown-open-e1f90e0a.js';
|
|
113
113
|
export { u as useControlAttributes, a as useIdAttribute } from './useIdAttribute-859439f0.js';
|
|
114
114
|
export { u as useElevation } from './useElevation-b5a49746.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "4.4.0-beta.
|
|
3
|
+
"version": "4.4.0-beta.2680.0",
|
|
4
4
|
"description": "Vue components library for v2/3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/auto/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@codemirror/lang-json": "6.0.0",
|
|
39
39
|
"@codemirror/lang-markdown": "6.0.1",
|
|
40
40
|
"@floating-ui/dom": "0.3.1",
|
|
41
|
-
"@onereach/styles": "^2.39.4-beta.
|
|
41
|
+
"@onereach/styles": "^2.39.4-beta.2680.0",
|
|
42
42
|
"@splidejs/splide": "4.0.6",
|
|
43
43
|
"@tiptap/core": "2.0.2",
|
|
44
44
|
"@tiptap/extension-blockquote": "2.0.2",
|
|
@@ -131,16 +131,8 @@ Markdown.args = {
|
|
|
131
131
|
placeholder: 'Write something...',
|
|
132
132
|
format: 'markdown',
|
|
133
133
|
modelValue: `
|
|
134
|
-
export
|
|
135
|
-
|
|
136
|
-
export
|
|
137
|
-
|
|
138
|
-
export async function flowDeactivated() {}
|
|
139
|
-
|
|
140
|
-
export async function flowDeleted() {}
|
|
141
|
-
|
|
142
|
-
export async function stepAddedToCanvas() {}
|
|
143
|
-
|
|
144
|
-
export async function stepRemovedFromCanvas() {}
|
|
134
|
+
**export**
|
|
135
|
+
_export_
|
|
136
|
+
~export~
|
|
145
137
|
`,
|
|
146
138
|
};
|
|
@@ -341,6 +341,8 @@ export default defineComponent({
|
|
|
341
341
|
},
|
|
342
342
|
element: editorRef.value,
|
|
343
343
|
autofocus: props.autofocus,
|
|
344
|
+
enableInputRules: true,
|
|
345
|
+
enablePasteRules: true,
|
|
344
346
|
extensions: [
|
|
345
347
|
codemirrorNode,
|
|
346
348
|
StarterKit.configure({
|
|
@@ -382,6 +384,9 @@ export default defineComponent({
|
|
|
382
384
|
class: 'focus:outline-none',
|
|
383
385
|
},
|
|
384
386
|
},
|
|
387
|
+
parseOptions: {
|
|
388
|
+
preserveWhitespace: true,
|
|
389
|
+
},
|
|
385
390
|
});
|
|
386
391
|
setActiveFormats();
|
|
387
392
|
trap.activate();
|
|
@@ -465,9 +470,11 @@ export default defineComponent({
|
|
|
465
470
|
}));
|
|
466
471
|
|
|
467
472
|
if (disableMarkdown.value) {
|
|
468
|
-
|
|
473
|
+
const content = serialize(editor?.schema, editor?.getJSON());
|
|
474
|
+
editor?.commands.clearContent();
|
|
475
|
+
editor?.commands.insertContent(content);
|
|
469
476
|
} else {
|
|
470
|
-
editor?.commands.setContent(deserialize(editor?.schema, editor?.
|
|
477
|
+
editor?.commands.setContent(deserialize(editor?.schema, editor?.getText()));
|
|
471
478
|
}
|
|
472
479
|
break;
|
|
473
480
|
case 'bulletList':
|
|
@@ -628,8 +635,8 @@ export default defineComponent({
|
|
|
628
635
|
editor?.commands.setContent(value as string);
|
|
629
636
|
}
|
|
630
637
|
if (props.format === 'markdown' && value !== markdownOutput.value) {
|
|
631
|
-
const deserialized = deserialize(editor?.schema, value);
|
|
632
|
-
editor?.commands.setContent(
|
|
638
|
+
// const deserialized = deserialize(editor?.schema, value);
|
|
639
|
+
editor?.commands.setContent(value as string);
|
|
633
640
|
}
|
|
634
641
|
});
|
|
635
642
|
|
|
@@ -677,6 +684,17 @@ export default defineComponent({
|
|
|
677
684
|
list-style: decimal;
|
|
678
685
|
}
|
|
679
686
|
|
|
687
|
+
.ProseMirror {
|
|
688
|
+
p {
|
|
689
|
+
margin: 4px;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
h1, h2, h3, h4, h5, h6 {
|
|
693
|
+
margin: 4px;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
|
|
680
698
|
ul {
|
|
681
699
|
margin: 0 24px;
|
|
682
700
|
list-style: initial;
|
|
@@ -40,8 +40,8 @@ const serializerMarks = {
|
|
|
40
40
|
expelEnclosingWhitespace: true,
|
|
41
41
|
},
|
|
42
42
|
[Italic.name]: {
|
|
43
|
-
open: '_',
|
|
44
|
-
close: '_',
|
|
43
|
+
open: ' _',
|
|
44
|
+
close: '_ ',
|
|
45
45
|
mixable: true,
|
|
46
46
|
expelEnclosingWhitespace: true,
|
|
47
47
|
},
|
|
@@ -94,13 +94,16 @@ const serialize = (schema: any, content: any) => {
|
|
|
94
94
|
serializerMarks,
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
return serializer.serialize(proseMirrorDocument);
|
|
97
|
+
return serializer.serialize(proseMirrorDocument, { tightLists: true });
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const deserialize = (schema: any, content: any) => {
|
|
101
101
|
if (!content) return null;
|
|
102
102
|
|
|
103
|
-
const html = marked
|
|
103
|
+
const html = marked(content, {
|
|
104
|
+
gfm: true,
|
|
105
|
+
breaks: true,
|
|
106
|
+
});
|
|
104
107
|
|
|
105
108
|
if (!html) return null;
|
|
106
109
|
|