@onereach/ui-components 4.4.0-beta.2679.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.
Files changed (25) hide show
  1. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +11 -3
  2. package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +1 -1
  3. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.js +1 -1
  4. package/dist/bundled/v2/components/index.js +1 -1
  5. package/dist/bundled/v2/index.js +1 -1
  6. package/dist/bundled/v2/{markdown-ff71fff3.js → markdown-d43767b0.js} +2 -2
  7. package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-21bf1074.js → OrRichTextEditor.vue_vue_type_script_lang-6d5a6b7e.js} +10 -2
  8. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +4 -4
  9. package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +2 -2
  10. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +1 -1
  11. package/dist/bundled/v3/components/index.js +2 -2
  12. package/dist/bundled/v3/index.js +2 -2
  13. package/dist/bundled/v3/{markdown-ff71fff3.js → markdown-d43767b0.js} +2 -2
  14. package/dist/esm/v2/{OrRichTextEditor-b6522b20.js → OrRichTextEditor-cb50c4f6.js} +12 -4
  15. package/dist/esm/v2/components/index.js +1 -1
  16. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +1 -1
  17. package/dist/esm/v2/index.js +1 -1
  18. package/dist/esm/v3/{OrRichTextEditor-69cf03de.js → OrRichTextEditor-c3560ddb.js} +12 -4
  19. package/dist/esm/v3/components/index.js +1 -1
  20. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +1 -1
  21. package/dist/esm/v3/index.js +1 -1
  22. package/package.json +2 -2
  23. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +3 -3
  24. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +21 -1
  25. package/src/components/or-rich-text-editor-v3/utils/markdown.ts +2 -2
@@ -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-ff71fff3.js';
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';
@@ -1725,9 +1725,17 @@ var script = defineComponent({
1725
1725
  switch (item) {
1726
1726
  case 'source':
1727
1727
  disableMarkdown.value = !disableMarkdown.value;
1728
+ editor === null || editor === void 0 ? void 0 : editor.setOptions({
1729
+ enableInputRules: !disableMarkdown.value,
1730
+ enablePasteRules: !disableMarkdown.value
1731
+ });
1732
+ editor === null || editor === void 0 ? void 0 : editor.view.updateState(editor === null || editor === void 0 ? void 0 : editor.state.reconfigure({
1733
+ plugins: editor.extensionManager.plugins
1734
+ }));
1728
1735
  if (disableMarkdown.value) {
1736
+ const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
1729
1737
  editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
1730
- editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(proxyModelValue.value);
1738
+ editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
1731
1739
  } else {
1732
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()));
1733
1741
  }
@@ -1904,7 +1912,7 @@ var script = defineComponent({
1904
1912
  }
1905
1913
  });
1906
1914
 
1907
- 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)}";
1908
1916
  styleInject(css_248z);
1909
1917
 
1910
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-ff71fff3.js';
5
+ import '../../markdown-d43767b0.js';
6
6
  import '../../index-85c2efe8.js';
7
7
  import 'node:punycode';
8
8
  import '../../index-1182caa8.js';
@@ -1,4 +1,4 @@
1
- export { d as deserialize, s as serialize } from '../../../markdown-ff71fff3.js';
1
+ export { d as deserialize, s as serialize } from '../../../markdown-d43767b0.js';
2
2
  import '../../../index-85c2efe8.js';
3
3
  import 'node:punycode';
4
4
  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-ff71fff3.js';
255
+ import '../markdown-d43767b0.js';
256
256
  import '../index-85c2efe8.js';
257
257
  import 'node:punycode';
258
258
  import '../index-1182caa8.js';
@@ -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-ff71fff3.js';
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
  },
@@ -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-ff71fff3.js';
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';
@@ -1679,9 +1679,17 @@ var script = defineComponent({
1679
1679
  switch (item) {
1680
1680
  case 'source':
1681
1681
  disableMarkdown.value = !disableMarkdown.value;
1682
+ editor === null || editor === void 0 ? void 0 : editor.setOptions({
1683
+ enableInputRules: !disableMarkdown.value,
1684
+ enablePasteRules: !disableMarkdown.value
1685
+ });
1686
+ editor === null || editor === void 0 ? void 0 : editor.view.updateState(editor === null || editor === void 0 ? void 0 : editor.state.reconfigure({
1687
+ plugins: editor.extensionManager.plugins
1688
+ }));
1682
1689
  if (disableMarkdown.value) {
1690
+ const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
1683
1691
  editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
1684
- editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(proxyModelValue.value);
1692
+ editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
1685
1693
  } else {
1686
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()));
1687
1695
  }
@@ -1,11 +1,11 @@
1
- import { s as script } from '../../OrRichTextEditor.vue_vue_type_script_lang-21bf1074.js';
2
- export { s as default } from '../../OrRichTextEditor.vue_vue_type_script_lang-21bf1074.js';
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-ff71fff3.js';
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-21bf1074.js';
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-ff71fff3.js';
5
+ import '../../markdown-d43767b0.js';
6
6
  import '../../index-85c2efe8.js';
7
7
  import 'node:punycode';
8
8
  import '../../index-1182caa8.js';
@@ -1,4 +1,4 @@
1
- export { d as deserialize, s as serialize } from '../../../markdown-ff71fff3.js';
1
+ export { d as deserialize, s as serialize } from '../../../markdown-d43767b0.js';
2
2
  import '../../../index-85c2efe8.js';
3
3
  import 'node:punycode';
4
4
  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-21bf1074.js';
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-ff71fff3.js';
296
+ import '../markdown-d43767b0.js';
297
297
  import '../index-85c2efe8.js';
298
298
  import 'node:punycode';
299
299
  import '../index-1182caa8.js';
@@ -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-21bf1074.js';
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-ff71fff3.js';
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
  },
@@ -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
  },
@@ -448,9 +448,17 @@ var script = defineComponent({
448
448
  switch (item) {
449
449
  case 'source':
450
450
  disableMarkdown.value = !disableMarkdown.value;
451
+ editor === null || editor === void 0 ? void 0 : editor.setOptions({
452
+ enableInputRules: !disableMarkdown.value,
453
+ enablePasteRules: !disableMarkdown.value
454
+ });
455
+ editor === null || editor === void 0 ? void 0 : editor.view.updateState(editor === null || editor === void 0 ? void 0 : editor.state.reconfigure({
456
+ plugins: editor.extensionManager.plugins
457
+ }));
451
458
  if (disableMarkdown.value) {
459
+ const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
452
460
  editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
453
- editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(proxyModelValue.value);
461
+ editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
454
462
  } else {
455
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()));
456
464
  }
@@ -627,7 +635,7 @@ var script = defineComponent({
627
635
  }
628
636
  });
629
637
 
630
- 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)}";
631
639
  styleInject(css_248z);
632
640
 
633
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-b6522b20.js';
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';
@@ -1,4 +1,4 @@
1
- export { _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-b6522b20.js';
1
+ export { _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-cb50c4f6.js';
2
2
  import 'vue-demi';
3
3
  import '@vueuse/integrations/useFocusTrap';
4
4
  import '@vueuse/core';
@@ -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-b6522b20.js';
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
  },
@@ -448,9 +448,17 @@ var script = defineComponent({
448
448
  switch (item) {
449
449
  case 'source':
450
450
  disableMarkdown.value = !disableMarkdown.value;
451
+ editor === null || editor === void 0 ? void 0 : editor.setOptions({
452
+ enableInputRules: !disableMarkdown.value,
453
+ enablePasteRules: !disableMarkdown.value
454
+ });
455
+ editor === null || editor === void 0 ? void 0 : editor.view.updateState(editor === null || editor === void 0 ? void 0 : editor.state.reconfigure({
456
+ plugins: editor.extensionManager.plugins
457
+ }));
451
458
  if (disableMarkdown.value) {
459
+ const content = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
452
460
  editor === null || editor === void 0 ? void 0 : editor.commands.clearContent();
453
- editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(proxyModelValue.value);
461
+ editor === null || editor === void 0 ? void 0 : editor.commands.insertContent(content);
454
462
  } else {
455
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()));
456
464
  }
@@ -808,7 +816,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
808
816
  }, 8 /* PROPS */, ["is-open"])], 2 /* CLASS */);
809
817
  }
810
818
 
811
- 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}";
812
820
  styleInject(css_248z);
813
821
 
814
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-69cf03de.js';
111
+ export { s as OrRichTextEditorV3 } from '../OrRichTextEditor-c3560ddb.js';
112
112
  import 'vue-demi';
113
113
  import 'lodash';
114
114
  import 'vue';
@@ -1,4 +1,4 @@
1
- export { s as OrRichTextEditorV3 } from '../../OrRichTextEditor-69cf03de.js';
1
+ export { s as OrRichTextEditorV3 } from '../../OrRichTextEditor-c3560ddb.js';
2
2
  import 'vue-demi';
3
3
  import '@vueuse/integrations/useFocusTrap';
4
4
  import '@vueuse/core';
@@ -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-69cf03de.js';
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.2679.0",
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.2679.0",
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,8 +131,8 @@ Markdown.args = {
131
131
  placeholder: 'Write something...',
132
132
  format: 'markdown',
133
133
  modelValue: `
134
- **export** async function beforeSaveFlow() {}
135
- _export_ async function beforeActivateFlow() {}
136
- ~export~ async function flowDeactivated() {}
134
+ **export**
135
+ _export_
136
+ ~export~
137
137
  `,
138
138
  };
@@ -460,10 +460,19 @@ export default defineComponent({
460
460
  switch (item) {
461
461
  case 'source':
462
462
  disableMarkdown.value = !disableMarkdown.value;
463
+ editor?.setOptions({
464
+ enableInputRules: !disableMarkdown.value,
465
+ enablePasteRules: !disableMarkdown.value,
466
+ });
467
+
468
+ editor?.view.updateState(editor?.state.reconfigure({
469
+ plugins: editor.extensionManager.plugins,
470
+ }));
463
471
 
464
472
  if (disableMarkdown.value) {
473
+ const content = serialize(editor?.schema, editor?.getJSON());
465
474
  editor?.commands.clearContent();
466
- editor?.commands.insertContent(proxyModelValue.value as string);
475
+ editor?.commands.insertContent(content);
467
476
  } else {
468
477
  editor?.commands.setContent(deserialize(editor?.schema, editor?.getText()));
469
478
  }
@@ -675,6 +684,17 @@ export default defineComponent({
675
684
  list-style: decimal;
676
685
  }
677
686
 
687
+ .ProseMirror {
688
+ p {
689
+ margin: 4px;
690
+ }
691
+
692
+ h1, h2, h3, h4, h5, h6 {
693
+ margin: 4px;
694
+ }
695
+ }
696
+
697
+
678
698
  ul {
679
699
  margin: 0 24px;
680
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
  },