@onereach/ui-components-vue2 21.4.0 → 21.4.1

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.
@@ -13,13 +13,13 @@ import { useResizeObserver, useDebounceFn, onClickOutside } from '@vueuse/core';
13
13
  import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
14
14
  import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue-demi';
15
15
  import { aa as c } from '../../utils-72d9c2bb.js';
16
+ import { u as ue, n as ne } from '../../useValidationAttributes-BpeWsfb0-24439d6f.js';
16
17
  import { TextSelection, Selection } from 'prosemirror-state';
17
18
  import { exitCode } from 'prosemirror-commands';
18
19
  import { EditorState } from '@codemirror/state';
19
20
  import { EditorView, highlightActiveLine, highlightActiveLineGutter, lineNumbers, keymap } from '@codemirror/view';
20
21
  import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
21
22
  import { tags } from '@lezer/highlight';
22
- import { u as ue } from '../../useValidationAttributes-BpeWsfb0-24439d6f.js';
23
23
  import { minimalSetup } from 'codemirror';
24
24
  import { javascript } from '@codemirror/lang-javascript';
25
25
  import { defaultMarkdownSerializer, MarkdownSerializer } from 'prosemirror-markdown';
@@ -110,6 +110,8 @@ const RichTextEditor = [
110
110
  const RichTextEditorToolbar = [
111
111
  // Layout
112
112
  'layout-row',
113
+ // Overflow
114
+ 'overflow-x-scroll md:overflow-x-hidden', 'scrollbar-hidden',
113
115
  // Spacing
114
116
  'px-0', 'py-sm',
115
117
  // Theme
@@ -657,7 +659,7 @@ var script = defineComponent({
657
659
  const textareaRef = ref();
658
660
  const containerRef = ref();
659
661
  const moreButtonRef = ref();
660
- const moreRef = ref();
662
+ const morePopoverRef = ref();
661
663
  const toolbarButtonRef = ref();
662
664
  const menuRef = ref();
663
665
  // isActive should be set with default values for all toolbar buttons, otherwise it will not work in vue2
@@ -687,6 +689,9 @@ var script = defineComponent({
687
689
  const link = ref('');
688
690
  const countOfNotVisibleTools = ref(0);
689
691
  const sourceValue = ref('');
692
+ const {
693
+ isMobile
694
+ } = ne();
690
695
  let trap = useFocusTrap(controlRef, {
691
696
  fallbackFocus: '.container',
692
697
  allowOutsideClick: true
@@ -855,9 +860,10 @@ var script = defineComponent({
855
860
  activeHeadingLevel.value = ((_c = (_b = editor.value) === null || _b === void 0 ? void 0 : _b.getAttributes('heading')) === null || _c === void 0 ? void 0 : _c.level) || 0;
856
861
  };
857
862
  const isVisible = value => {
863
+ if (isMobile.value) return true;
858
864
  if (c(value)) {
859
865
  const isHaveNotVisibleTools = value.some(item => notVisibleTools.value.has(item));
860
- return isHaveNotVisibleTools;
866
+ return !isHaveNotVisibleTools;
861
867
  }
862
868
  return !notVisibleTools.value.has(value);
863
869
  };
@@ -1014,7 +1020,7 @@ var script = defineComponent({
1014
1020
  toolbarButtonRef,
1015
1021
  moreButtonRef,
1016
1022
  textareaRef,
1017
- moreRef,
1023
+ morePopoverRef,
1018
1024
  menuRef,
1019
1025
  handleToolbarClick,
1020
1026
  handleEditorClick,
@@ -1031,6 +1037,7 @@ var script = defineComponent({
1031
1037
  link,
1032
1038
  isFocused,
1033
1039
  isVisible,
1040
+ isMobile,
1034
1041
  countOfNotVisibleTools,
1035
1042
  notVisibleTools,
1036
1043
  handleInput,
@@ -1093,7 +1100,7 @@ var __vue_render__ = function () {
1093
1100
  return _c('div', {
1094
1101
  key: index,
1095
1102
  class: _vm.toolbarGroupStyles.concat([{
1096
- 'hidden': _vm.isVisible(tools)
1103
+ 'hidden': !_vm.isVisible(tools)
1097
1104
  }]),
1098
1105
  attrs: {
1099
1106
  "disabled": _vm.disabled || !_vm.isFocused
@@ -1144,19 +1151,20 @@ var __vue_render__ = function () {
1144
1151
  }
1145
1152
  }) : _vm._e()], 1);
1146
1153
  }), 0);
1147
- }), _vm._v(" "), _vm.countOfNotVisibleTools > 0 ? _c('OrIconButton', {
1154
+ }), _vm._v(" "), _vm.countOfNotVisibleTools > 0 && !_vm.isMobile ? _c('OrIconButton', {
1148
1155
  ref: 'moreButtonRef',
1149
- class: ['px-sm'],
1156
+ class: ['mx-sm'],
1150
1157
  attrs: {
1151
1158
  "icon": {
1152
1159
  icon: 'more_horiz',
1153
1160
  variant: 'inherit'
1154
1161
  },
1155
- "disabled": _vm.disabled || !_vm.isFocused
1162
+ "disabled": _vm.disabled || !_vm.isFocused,
1163
+ "force-state": _vm.morePopoverRef && _vm.morePopoverRef.state === 'open' ? 'hover' : undefined
1156
1164
  },
1157
1165
  on: {
1158
1166
  "click": function ($event) {
1159
- _vm.moreRef && _vm.moreRef.open();
1167
+ _vm.morePopoverRef && _vm.morePopoverRef.open();
1160
1168
  }
1161
1169
  }
1162
1170
  }) : _vm._e()], 2), _vm._v(" "), _c('div', {
@@ -1221,7 +1229,7 @@ var __vue_render__ = function () {
1221
1229
  "disabled": _vm.disabled
1222
1230
  }
1223
1231
  }, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")]), _vm._v(" "), _vm.moreButtonRef ? _c('OrPopover', {
1224
- ref: 'moreRef',
1232
+ ref: 'morePopoverRef',
1225
1233
  attrs: {
1226
1234
  "trigger": _vm.moreButtonRef && _vm.moreButtonRef.root,
1227
1235
  "placement": 'top-end'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "21.4.0",
3
+ "version": "21.4.1",
4
4
  "description": "Vue components library for v2",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -40,8 +40,8 @@
40
40
  "@codemirror/view": "^6",
41
41
  "@floating-ui/dom": "1.5.3",
42
42
  "@lezer/highlight": "*",
43
- "@onereach/styles": "^21.4.0",
44
- "@onereach/ui-components-common": "^21.4.0",
43
+ "@onereach/styles": "^21.4.1",
44
+ "@onereach/ui-components-common": "^21.4.1",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.0.3",
47
47
  "@tiptap/extension-blockquote": "2.0.3",
@@ -105,5 +105,5 @@
105
105
  "access": "public"
106
106
  },
107
107
  "npmUnpacked": "4.15.2",
108
- "gitHead": "6ed081f6c690d452613d05afdfb30703139644c3"
108
+ "gitHead": "ed1ded657f63a00f392e38abc14b3b8c92d6f048"
109
109
  }