@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
@@ -527,11 +527,12 @@ var script = defineComponent({
527
527
  proxyModelValue.value = markdownOutput.value;
528
528
  };
529
529
  const handleToolbarClick = (item, level) => {
530
- var _a, _b;
530
+ var _a, _b, _c, _d;
531
531
  switch (item) {
532
532
  case 'source':
533
533
  disableMarkdown.value = !disableMarkdown.value;
534
534
  sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
535
+ (_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`);
535
536
  nextTick(() => {
536
537
  var _a;
537
538
  return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
@@ -549,15 +550,15 @@ var script = defineComponent({
549
550
  to,
550
551
  empty
551
552
  } = editor.state.selection;
552
- const isLink = (_a = editor.view.state.doc.nodeAt(cursorPosition)) === null || _a === void 0 ? void 0 : _a.marks.filter(mark => mark.type.name === 'link');
553
- 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) || '' : '';
553
+ const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
554
+ 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) || '' : '';
554
555
  text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
555
556
  link.value = editor.getAttributes('link').href || '';
556
557
  }
557
558
  isOpenLinkModal.value = !isOpenLinkModal.value;
558
559
  break;
559
560
  case 'blockquote':
560
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleBlockquote().run();
561
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
561
562
  break;
562
563
  case 'codeBlock':
563
564
  if (!isActive.value['codeBlock']) {
@@ -578,7 +579,6 @@ var script = defineComponent({
578
579
  level: level
579
580
  });
580
581
  }
581
- editor === null || editor === void 0 ? void 0 : editor.commands.focus();
582
582
  break;
583
583
  case 'undo':
584
584
  case 'redo':
@@ -588,7 +588,7 @@ var script = defineComponent({
588
588
  context.emit('file-upload');
589
589
  break;
590
590
  default:
591
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleMark(item).run();
591
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
592
592
  break;
593
593
  }
594
594
  };
@@ -707,7 +707,8 @@ var script = defineComponent({
707
707
  handleInput,
708
708
  proxyModelValue,
709
709
  disableMarkdown,
710
- sourceValue
710
+ sourceValue,
711
+ activeHeadingLevel
711
712
  };
712
713
  }
713
714
  });
@@ -766,7 +767,7 @@ var __vue_render__ = function () {
766
767
  },
767
768
  on: {
768
769
  "click": function ($event) {
769
- return _vm.menuRef.open();
770
+ return _vm.menuRef.toggle();
770
771
  }
771
772
  }
772
773
  }) : _vm.isVisible(item) ? _c('or-icon-button', {
@@ -887,6 +888,9 @@ var __vue_render__ = function () {
887
888
  }, [_vm._l(_vm.headingLevels, function (heading) {
888
889
  return _c('or-menu-item', {
889
890
  key: heading,
891
+ class: {
892
+ 'bg-surface-1': _vm.activeHeadingLevel === heading
893
+ },
890
894
  on: {
891
895
  "click": function ($event) {
892
896
  return _vm.handleToolbarClick('heading', heading);
@@ -894,6 +898,9 @@ var __vue_render__ = function () {
894
898
  }
895
899
  }, [_vm._v("\n Heading " + _vm._s(heading) + "\n ")]);
896
900
  }), _vm._v(" "), _c('or-menu-item', {
901
+ class: {
902
+ 'bg-surface-1': !_vm.activeHeadingLevel
903
+ },
897
904
  on: {
898
905
  "click": function ($event) {
899
906
  return _vm.handleToolbarClick('heading');
@@ -97,7 +97,7 @@ export { _ as OrSliderV3 } from '../OrSlider-dd60a4a1.js';
97
97
  export { S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from '../OrSlider.vue_rollup-plugin-vue_script-eadc5fc6.js';
98
98
  export { _ as OrRatingV3 } from '../OrRating-abf1b609.js';
99
99
  export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from '../OrResizeablePanel-037600c1.js';
100
- export { F as Formats, _ as OrRichTextEditorV3 } from '../OrRichTextEditor-1b7aeae0.js';
100
+ export { F as Formats, _ as OrRichTextEditorV3 } from '../OrRichTextEditor-a0463597.js';
101
101
  export { _ as OrSearch } from '../OrSearch-ddf244e6.js';
102
102
  export { _ as OrSearchV3 } from '../OrSearch-b357d036.js';
103
103
  export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-00583234.js';
@@ -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;
@@ -1,4 +1,4 @@
1
- export { F as Formats, _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-1b7aeae0.js';
1
+ export { F as Formats, _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-a0463597.js';
2
2
  import 'vue-demi';
3
3
  import '@vueuse/integrations/useFocusTrap';
4
4
  import '@vueuse/core';
@@ -97,7 +97,7 @@ export { _ as OrSliderV3 } from './OrSlider-dd60a4a1.js';
97
97
  export { S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSlider.vue_rollup-plugin-vue_script-eadc5fc6.js';
98
98
  export { _ as OrRatingV3 } from './OrRating-abf1b609.js';
99
99
  export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanel-037600c1.js';
100
- export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditor-1b7aeae0.js';
100
+ export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditor-a0463597.js';
101
101
  export { _ as OrSearch } from './OrSearch-ddf244e6.js';
102
102
  export { _ as OrSearchV3 } from './OrSearch-b357d036.js';
103
103
  export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-00583234.js';
@@ -526,11 +526,12 @@ var script = defineComponent({
526
526
  proxyModelValue.value = markdownOutput.value;
527
527
  };
528
528
  const handleToolbarClick = (item, level) => {
529
- var _a, _b;
529
+ var _a, _b, _c, _d;
530
530
  switch (item) {
531
531
  case 'source':
532
532
  disableMarkdown.value = !disableMarkdown.value;
533
533
  sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
534
+ (_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`);
534
535
  nextTick(() => {
535
536
  var _a;
536
537
  return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
@@ -548,15 +549,15 @@ var script = defineComponent({
548
549
  to,
549
550
  empty
550
551
  } = editor.state.selection;
551
- const isLink = (_a = editor.view.state.doc.nodeAt(cursorPosition)) === null || _a === void 0 ? void 0 : _a.marks.filter(mark => mark.type.name === 'link');
552
- 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) || '' : '';
552
+ const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
553
+ 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) || '' : '';
553
554
  text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
554
555
  link.value = editor.getAttributes('link').href || '';
555
556
  }
556
557
  isOpenLinkModal.value = !isOpenLinkModal.value;
557
558
  break;
558
559
  case 'blockquote':
559
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleBlockquote().run();
560
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
560
561
  break;
561
562
  case 'codeBlock':
562
563
  if (!isActive.value['codeBlock']) {
@@ -577,7 +578,6 @@ var script = defineComponent({
577
578
  level: level
578
579
  });
579
580
  }
580
- editor === null || editor === void 0 ? void 0 : editor.commands.focus();
581
581
  break;
582
582
  case 'undo':
583
583
  case 'redo':
@@ -587,7 +587,7 @@ var script = defineComponent({
587
587
  context.emit('file-upload');
588
588
  break;
589
589
  default:
590
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleMark(item).run();
590
+ editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
591
591
  break;
592
592
  }
593
593
  };
@@ -706,7 +706,8 @@ var script = defineComponent({
706
706
  handleInput,
707
707
  proxyModelValue,
708
708
  disableMarkdown,
709
- sourceValue
709
+ sourceValue,
710
+ activeHeadingLevel
710
711
  };
711
712
  }
712
713
  });
@@ -774,7 +775,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
774
775
  variant: 'inherit',
775
776
  size: 'm'
776
777
  },
777
- onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.open())
778
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.toggle())
778
779
  }, null, 8 /* PROPS */, ["selected", "disabled", "tooltip", "icon"])) : _ctx.isVisible(item) ? (openBlock(), createBlock(_component_or_icon_button, {
779
780
  key: 1,
780
781
  tooltip: {
@@ -852,19 +853,24 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
852
853
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.headingLevels, heading => {
853
854
  return openBlock(), createBlock(_component_or_menu_item, {
854
855
  key: heading,
856
+ class: normalizeClass({
857
+ 'bg-surface-1': _ctx.activeHeadingLevel === heading
858
+ }),
855
859
  onClick: $event => _ctx.handleToolbarClick('heading', heading)
856
860
  }, {
857
861
  default: withCtx(() => [createTextVNode(" Heading " + toDisplayString(heading), 1 /* TEXT */)]),
858
862
 
859
863
  _: 2 /* DYNAMIC */
860
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
864
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClick"]);
861
865
  }), 128 /* KEYED_FRAGMENT */)), createVNode(_component_or_menu_item, {
866
+ class: normalizeClass({
867
+ 'bg-surface-1': !_ctx.activeHeadingLevel
868
+ }),
862
869
  onClick: _cache[5] || (_cache[5] = $event => _ctx.handleToolbarClick('heading'))
863
870
  }, {
864
871
  default: withCtx(() => [createTextVNode(" None ")]),
865
872
  _: 1 /* STABLE */
866
- })]),
867
-
873
+ }, 8 /* PROPS */, ["class"])]),
868
874
  _: 1 /* STABLE */
869
875
  }, 8 /* PROPS */, ["trigger"])) : createCommentVNode("v-if", true), createVNode(_component_or_modal, {
870
876
  "is-open": _ctx.isOpenLinkModal,
@@ -93,7 +93,7 @@ export { s as OrRangeSliderV3 } from '../OrRangeSlider-1c6ff524.js';
93
93
  export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from '../OrSlider-654bd19f.js';
94
94
  export { s as OrRatingV3 } from '../OrRating-ec9462c5.js';
95
95
  export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from '../OrResizeablePanel-ae6a014f.js';
96
- export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditor-9b45fff5.js';
96
+ export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditor-9a0602f9.js';
97
97
  export { s as OrSearch } from '../OrSearch-aa57d4e8.js';
98
98
  export { s as OrSearchV3 } from '../OrSearch-e56db8af.js';
99
99
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-adbf7f4e.js';
@@ -74,6 +74,7 @@ declare const _default: import("vue-demi").DefineComponent<{
74
74
  proxyModelValue: import("vue-demi").WritableComputedRef<string | undefined>;
75
75
  disableMarkdown: import("vue-demi").Ref<boolean>;
76
76
  sourceValue: import("vue-demi").Ref<string>;
77
+ activeHeadingLevel: import("vue-demi").Ref<number>;
77
78
  }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("update:modelValue" | "input" | "file-upload")[], "update:modelValue" | "input" | "file-upload", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
78
79
  modelValue: {
79
80
  type: StringConstructor;
@@ -1,4 +1,4 @@
1
- export { F as Formats, s as OrRichTextEditorV3 } from '../../OrRichTextEditor-9b45fff5.js';
1
+ export { F as Formats, s as OrRichTextEditorV3 } from '../../OrRichTextEditor-9a0602f9.js';
2
2
  import 'vue-demi';
3
3
  import '@vueuse/integrations/useFocusTrap';
4
4
  import '@vueuse/core';
@@ -93,7 +93,7 @@ export { s as OrRangeSliderV3 } from './OrRangeSlider-1c6ff524.js';
93
93
  export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSlider-654bd19f.js';
94
94
  export { s as OrRatingV3 } from './OrRating-ec9462c5.js';
95
95
  export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanel-ae6a014f.js';
96
- export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditor-9b45fff5.js';
96
+ export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditor-9a0602f9.js';
97
97
  export { s as OrSearch } from './OrSearch-aa57d4e8.js';
98
98
  export { s as OrSearchV3 } from './OrSearch-e56db8af.js';
99
99
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-adbf7f4e.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "8.18.2",
3
+ "version": "8.18.3-beta.3938.0",
4
4
  "npmUnpacked": "4.15.2",
5
5
  "description": "Vue components library for v2/3",
6
6
  "sideEffects": false,
@@ -176,6 +176,5 @@
176
176
  "default": "./dist/bundled/v3/components/*/index.js"
177
177
  },
178
178
  "./package.json": "./package.json"
179
- },
180
- "gitHead": "56bcce7868733b19a49a5cb2a4ac90eec8247416"
179
+ }
181
180
  }
@@ -32,7 +32,7 @@
32
32
  :disabled="!isFocused"
33
33
  :tooltip="{content: item, placement: 'top'}"
34
34
  :icon="{icon: headingIcon, variant: 'inherit', size: 'm'}"
35
- @click="menuRef.open()"
35
+ @click="menuRef.toggle()"
36
36
  />
37
37
  <or-icon-button
38
38
  v-else-if="isVisible(item)"
@@ -98,11 +98,13 @@
98
98
  <or-menu-item
99
99
  v-for="heading in headingLevels"
100
100
  :key="heading"
101
+ :class="{'bg-surface-1': activeHeadingLevel === heading}"
101
102
  @click="handleToolbarClick('heading', heading)"
102
103
  >
103
104
  Heading {{ heading }}
104
105
  </or-menu-item>
105
106
  <or-menu-item
107
+ :class="{'bg-surface-1': !activeHeadingLevel}"
106
108
  @click="handleToolbarClick('heading')"
107
109
  >
108
110
  None
@@ -524,6 +526,8 @@ export default defineComponent({
524
526
  disableMarkdown.value = !disableMarkdown.value;
525
527
  sourceValue.value = serialize(editor?.schema, editor?.getJSON());
526
528
 
529
+ textareaRef.value?.style.setProperty('height', `${editorRef.value?.offsetHeight || 88}px`);
530
+
527
531
  nextTick(() => textareaRef.value?.focus());
528
532
  break;
529
533
  case 'bulletList':
@@ -543,7 +547,7 @@ export default defineComponent({
543
547
  isOpenLinkModal.value = !isOpenLinkModal.value;
544
548
  break;
545
549
  case 'blockquote':
546
- editor?.chain().focus().toggleBlockquote().run();
550
+ editor?.chain().toggleBlockquote().run();
547
551
  break;
548
552
  case 'codeBlock':
549
553
  if (!isActive.value['codeBlock']) {
@@ -560,7 +564,6 @@ export default defineComponent({
560
564
  activeHeadingLevel.value = level;
561
565
  editor?.commands.toggleHeading({ level: level as Level });
562
566
  }
563
- editor?.commands.focus();
564
567
  break;
565
568
  case 'undo':
566
569
  case 'redo':
@@ -570,7 +573,7 @@ export default defineComponent({
570
573
  context.emit('file-upload');
571
574
  break;
572
575
  default:
573
- editor?.chain().focus().toggleMark(item).run();
576
+ editor?.chain().toggleMark(item).run();
574
577
  break;
575
578
  }
576
579
  };
@@ -726,6 +729,7 @@ export default defineComponent({
726
729
  proxyModelValue,
727
730
  disableMarkdown,
728
731
  sourceValue,
732
+ activeHeadingLevel,
729
733
  };
730
734
  },
731
735
  });