@onereach/ui-components 8.18.2 → 8.18.3-beta.3938.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 (28) hide show
  1. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +15 -8
  2. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +2 -0
  3. package/dist/bundled/v2/index.js +1 -1
  4. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +1 -1
  5. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +1 -0
  6. package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +1 -1
  7. package/dist/bundled/v3/components/OrRichTextEditorV3/props.js +1 -1
  8. package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +1 -1
  9. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +1 -1
  10. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +1 -1
  11. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +1 -1
  12. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +1 -1
  13. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +1 -1
  14. package/dist/bundled/v3/components/{OrRichTextEditorV3-243f2ed9.js → OrRichTextEditorV3-1ebcb9b0.js} +17 -11
  15. package/dist/bundled/v3/components/index.js +1 -1
  16. package/dist/bundled/v3/index.js +2 -2
  17. package/dist/esm/v2/{OrRichTextEditor-1b7aeae0.js → OrRichTextEditor-a0463597.js} +15 -8
  18. package/dist/esm/v2/components/index.js +1 -1
  19. package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +2 -0
  20. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +1 -1
  21. package/dist/esm/v2/index.js +1 -1
  22. package/dist/esm/v3/{OrRichTextEditor-9b45fff5.js → OrRichTextEditor-9a0602f9.js} +17 -11
  23. package/dist/esm/v3/components/index.js +1 -1
  24. package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +1 -0
  25. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +1 -1
  26. package/dist/esm/v3/index.js +1 -1
  27. package/package.json +2 -3
  28. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +8 -4
@@ -1716,11 +1716,12 @@ var script = defineComponent({
1716
1716
  proxyModelValue.value = markdownOutput.value;
1717
1717
  };
1718
1718
  const handleToolbarClick = (item, level) => {
1719
- var _a, _b;
1719
+ var _a, _b, _c, _d;
1720
1720
  switch (item) {
1721
1721
  case 'source':
1722
1722
  disableMarkdown.value = !disableMarkdown.value;
1723
1723
  sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
1724
+ (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('height', `${((_b = editorRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 88}px`);
1724
1725
  nextTick(() => {
1725
1726
  var _a;
1726
1727
  return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
@@ -1738,15 +1739,15 @@ var script = defineComponent({
1738
1739
  to,
1739
1740
  empty
1740
1741
  } = editor.state.selection;
1741
- const isLink = (_a = editor.view.state.doc.nodeAt(cursorPosition)) === null || _a === void 0 ? void 0 : _a.marks.filter(mark => mark.type.name === 'link');
1742
- const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_b = editor.view.state.doc.nodeAt(cursorPosition)) === null || _b === void 0 ? void 0 : _b.text) || '' : '';
1742
+ const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
1743
+ const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_d = editor.view.state.doc.nodeAt(cursorPosition)) === null || _d === void 0 ? void 0 : _d.text) || '' : '';
1743
1744
  text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
1744
1745
  link.value = editor.getAttributes('link').href || '';
1745
1746
  }
1746
1747
  isOpenLinkModal.value = !isOpenLinkModal.value;
1747
1748
  break;
1748
1749
  case 'blockquote':
1749
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleBlockquote().run();
1750
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
1750
1751
  break;
1751
1752
  case 'codeBlock':
1752
1753
  if (!isActive.value['codeBlock']) {
@@ -1767,7 +1768,6 @@ var script = defineComponent({
1767
1768
  level: level
1768
1769
  });
1769
1770
  }
1770
- editor === null || editor === void 0 ? void 0 : editor.commands.focus();
1771
1771
  break;
1772
1772
  case 'undo':
1773
1773
  case 'redo':
@@ -1777,7 +1777,7 @@ var script = defineComponent({
1777
1777
  context.emit('file-upload');
1778
1778
  break;
1779
1779
  default:
1780
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleMark(item).run();
1780
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
1781
1781
  break;
1782
1782
  }
1783
1783
  };
@@ -1896,7 +1896,8 @@ var script = defineComponent({
1896
1896
  handleInput,
1897
1897
  proxyModelValue,
1898
1898
  disableMarkdown,
1899
- sourceValue
1899
+ sourceValue,
1900
+ activeHeadingLevel
1900
1901
  };
1901
1902
  }
1902
1903
  });
@@ -1955,7 +1956,7 @@ var __vue_render__ = function () {
1955
1956
  },
1956
1957
  on: {
1957
1958
  "click": function ($event) {
1958
- return _vm.menuRef.open();
1959
+ return _vm.menuRef.toggle();
1959
1960
  }
1960
1961
  }
1961
1962
  }) : _vm.isVisible(item) ? _c('or-icon-button', {
@@ -2076,6 +2077,9 @@ var __vue_render__ = function () {
2076
2077
  }, [_vm._l(_vm.headingLevels, function (heading) {
2077
2078
  return _c('or-menu-item', {
2078
2079
  key: heading,
2080
+ class: {
2081
+ 'bg-surface-1': _vm.activeHeadingLevel === heading
2082
+ },
2079
2083
  on: {
2080
2084
  "click": function ($event) {
2081
2085
  return _vm.handleToolbarClick('heading', heading);
@@ -2083,6 +2087,9 @@ var __vue_render__ = function () {
2083
2087
  }
2084
2088
  }, [_vm._v("\n Heading " + _vm._s(heading) + "\n ")]);
2085
2089
  }), _vm._v(" "), _c('or-menu-item', {
2090
+ class: {
2091
+ 'bg-surface-1': !_vm.activeHeadingLevel
2092
+ },
2086
2093
  on: {
2087
2094
  "click": function ($event) {
2088
2095
  return _vm.handleToolbarClick('heading');
@@ -53,6 +53,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
53
53
  proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
54
54
  disableMarkdown: import("@vue/composition-api").Ref<boolean>;
55
55
  sourceValue: import("@vue/composition-api").Ref<string>;
56
+ activeHeadingLevel: import("@vue/composition-api").Ref<number>;
56
57
  }> & import("@vue/composition-api").Data, {}, {}, {
57
58
  modelValue: {
58
59
  type: StringConstructor;
@@ -172,6 +173,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
172
173
  proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
173
174
  disableMarkdown: import("@vue/composition-api").Ref<boolean>;
174
175
  sourceValue: import("@vue/composition-api").Ref<string>;
176
+ activeHeadingLevel: import("@vue/composition-api").Ref<number>;
175
177
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
176
178
  modelValue: string;
177
179
  toolbar: Tools;