@onereach/ui-components 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.
@@ -56,7 +56,7 @@ declare const _default: import("vue").DefineComponent<{
56
56
  toolbarButtonRef: import("vue").Ref<any>;
57
57
  moreButtonRef: import("vue").Ref<any>;
58
58
  textareaRef: import("vue").Ref<HTMLTextAreaElement | undefined>;
59
- moreRef: import("vue").Ref<any>;
59
+ morePopoverRef: import("vue").Ref<any>;
60
60
  menuRef: import("vue").Ref<any>;
61
61
  handleToolbarClick: (item: string, level?: number) => void;
62
62
  handleEditorClick: () => void;
@@ -75,6 +75,7 @@ declare const _default: import("vue").DefineComponent<{
75
75
  link: import("vue").Ref<string>;
76
76
  isFocused: import("vue").Ref<boolean>;
77
77
  isVisible: (value: string | Array<string>) => boolean;
78
+ isMobile: import("vue").ComputedRef<boolean>;
78
79
  countOfNotVisibleTools: import("vue").Ref<number>;
79
80
  notVisibleTools: import("vue").ComputedRef<Set<string>>;
80
81
  handleInput: (event: InputEvent) => void;
@@ -13,7 +13,7 @@ import Underline from '@tiptap/extension-underline';
13
13
  import StarterKit from '@tiptap/starter-kit';
14
14
  import { useResizeObserver, useDebounceFn, onClickOutside } from '@vueuse/core';
15
15
  import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
16
- import { u as ue, c } from '../OrAutocompleteV3-961163d0.js';
16
+ import { u as ue, n as ne, c } from '../OrAutocompleteV3-961163d0.js';
17
17
  import { TextSelection, Selection } from 'prosemirror-state';
18
18
  import { exitCode } from 'prosemirror-commands';
19
19
  import { EditorState } from '@codemirror/state';
@@ -108,6 +108,8 @@ const RichTextEditor = [
108
108
  const RichTextEditorToolbar = [
109
109
  // Layout
110
110
  'layout-row',
111
+ // Overflow
112
+ 'overflow-x-scroll md:overflow-x-hidden', 'scrollbar-hidden',
111
113
  // Spacing
112
114
  'px-0', 'py-sm',
113
115
  // Theme
@@ -656,7 +658,7 @@ var script = defineComponent({
656
658
  const textareaRef = ref();
657
659
  const containerRef = ref();
658
660
  const moreButtonRef = ref();
659
- const moreRef = ref();
661
+ const morePopoverRef = ref();
660
662
  const toolbarButtonRef = ref();
661
663
  const menuRef = ref();
662
664
  // isActive should be set with default values for all toolbar buttons, otherwise it will not work in vue2
@@ -686,6 +688,9 @@ var script = defineComponent({
686
688
  const link = ref('');
687
689
  const countOfNotVisibleTools = ref(0);
688
690
  const sourceValue = ref('');
691
+ const {
692
+ isMobile
693
+ } = ne();
689
694
  let trap = useFocusTrap(controlRef, {
690
695
  fallbackFocus: '.container',
691
696
  allowOutsideClick: true
@@ -854,9 +859,10 @@ var script = defineComponent({
854
859
  activeHeadingLevel.value = ((_c = (_b = editor.value) === null || _b === void 0 ? void 0 : _b.getAttributes('heading')) === null || _c === void 0 ? void 0 : _c.level) || 0;
855
860
  };
856
861
  const isVisible = value => {
862
+ if (isMobile.value) return true;
857
863
  if (c(value)) {
858
864
  const isHaveNotVisibleTools = value.some(item => notVisibleTools.value.has(item));
859
- return isHaveNotVisibleTools;
865
+ return !isHaveNotVisibleTools;
860
866
  }
861
867
  return !notVisibleTools.value.has(value);
862
868
  };
@@ -1013,7 +1019,7 @@ var script = defineComponent({
1013
1019
  toolbarButtonRef,
1014
1020
  moreButtonRef,
1015
1021
  textareaRef,
1016
- moreRef,
1022
+ morePopoverRef,
1017
1023
  menuRef,
1018
1024
  handleToolbarClick,
1019
1025
  handleEditorClick,
@@ -1030,6 +1036,7 @@ var script = defineComponent({
1030
1036
  link,
1031
1037
  isFocused,
1032
1038
  isVisible,
1039
+ isMobile,
1033
1040
  countOfNotVisibleTools,
1034
1041
  notVisibleTools,
1035
1042
  handleInput,
@@ -1096,7 +1103,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1096
1103
  return openBlock(), createElementBlock("div", {
1097
1104
  key: index,
1098
1105
  class: normalizeClass([..._ctx.toolbarGroupStyles, {
1099
- 'hidden': _ctx.isVisible(tools)
1106
+ 'hidden': !_ctx.isVisible(tools)
1100
1107
  }]),
1101
1108
  disabled: _ctx.disabled || !_ctx.isFocused
1102
1109
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(tools, item => {
@@ -1135,17 +1142,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1135
1142
  onClick: $event => _ctx.handleToolbarClick(item)
1136
1143
  }, null, 8 /* PROPS */, ["icon", "tooltip", "selected", "disabled", "onClick"])) : createCommentVNode("v-if", true)], 2 /* CLASS */);
1137
1144
  }), 128 /* KEYED_FRAGMENT */))], 10 /* CLASS, PROPS */, _hoisted_2);
1138
- }), 128 /* KEYED_FRAGMENT */)), _ctx.countOfNotVisibleTools > 0 ? (openBlock(), createBlock(_component_OrIconButton, {
1145
+ }), 128 /* KEYED_FRAGMENT */)), _ctx.countOfNotVisibleTools > 0 && !_ctx.isMobile ? (openBlock(), createBlock(_component_OrIconButton, {
1139
1146
  key: 0,
1140
1147
  ref: 'moreButtonRef',
1141
- class: normalizeClass(['px-sm']),
1148
+ class: normalizeClass(['mx-sm']),
1142
1149
  icon: {
1143
1150
  icon: 'more_horiz',
1144
1151
  variant: 'inherit'
1145
1152
  },
1146
1153
  disabled: _ctx.disabled || !_ctx.isFocused,
1147
- onClick: _cache[1] || (_cache[1] = $event => _ctx.moreRef && _ctx.moreRef.open())
1148
- }, null, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true)], 10 /* CLASS, PROPS */, _hoisted_1), createElementVNode("div", _hoisted_3, [withDirectives(createElementVNode("textarea", {
1154
+ "force-state": _ctx.morePopoverRef && _ctx.morePopoverRef.state === 'open' ? 'hover' : undefined,
1155
+ onClick: _cache[1] || (_cache[1] = $event => _ctx.morePopoverRef && _ctx.morePopoverRef.open())
1156
+ }, null, 8 /* PROPS */, ["disabled", "force-state"])) : createCommentVNode("v-if", true)], 10 /* CLASS, PROPS */, _hoisted_1), createElementVNode("div", _hoisted_3, [withDirectives(createElementVNode("textarea", {
1149
1157
  ref: 'textareaRef',
1150
1158
  "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => _ctx.sourceValue = $event),
1151
1159
  activated: _ctx.disableMarkdown,
@@ -1169,7 +1177,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1169
1177
  _: 1 /* STABLE */
1170
1178
  }, 8 /* PROPS */, ["disabled"]), [[vShow, typeof _ctx.error === 'string' && _ctx.error.length > 0]]), _ctx.moreButtonRef ? (openBlock(), createBlock(_component_OrPopover, {
1171
1179
  key: 2,
1172
- ref: 'moreRef',
1180
+ ref: 'morePopoverRef',
1173
1181
  trigger: _ctx.moreButtonRef && _ctx.moreButtonRef.root,
1174
1182
  placement: 'top-end'
1175
1183
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "21.4.0",
3
+ "version": "21.4.1",
4
4
  "description": "Vue components library for v3",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,8 +45,8 @@
45
45
  "@codemirror/view": "^6",
46
46
  "@floating-ui/dom": "1.5.3",
47
47
  "@lezer/highlight": "*",
48
- "@onereach/styles": "^21.4.0",
49
- "@onereach/ui-components-common": "^21.4.0",
48
+ "@onereach/styles": "^21.4.1",
49
+ "@onereach/ui-components-common": "^21.4.1",
50
50
  "@splidejs/splide": "4.0.6",
51
51
  "@tiptap/core": "2.0.3",
52
52
  "@tiptap/extension-blockquote": "2.0.3",
@@ -103,5 +103,5 @@
103
103
  "access": "public"
104
104
  },
105
105
  "npmUnpacked": "4.15.2",
106
- "gitHead": "6ed081f6c690d452613d05afdfb30703139644c3"
106
+ "gitHead": "ed1ded657f63a00f392e38abc14b3b8c92d6f048"
107
107
  }