@onereach/ui-components-vue2 18.4.1 → 18.4.2
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.
- package/dist/bundled/components/OrRichTextEditorV3/OrRichTextEditor.js +21 -47
- package/dist/bundled/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/components/OrRichTextEditorV3/props.d.ts +32 -0
- package/dist/bundled/components/OrRichTextEditorV3/props.js +35 -1
- package/dist/bundled/components/index.js +1 -1
- package/dist/bundled/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/or-rich-text-editor-v3/index.js +55 -47
- package/dist/esm/components/or-rich-text-editor-v3/props.d.ts +32 -0
- package/dist/esm/index.js +1 -1
- package/package.json +3 -3
|
@@ -10,8 +10,8 @@ import { History } from '@tiptap/extension-history';
|
|
|
10
10
|
import { Text } from '@tiptap/extension-text';
|
|
11
11
|
import { a as useResizeObserver, o as onClickOutside } from '../../index-fe4d407a.js';
|
|
12
12
|
import { u as useFocusTrap } from '../../useFocusTrap-747ad0e5.js';
|
|
13
|
-
import { defineComponent, shallowRef, ref,
|
|
14
|
-
import { Formats } from './props.js';
|
|
13
|
+
import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue-demi';
|
|
14
|
+
import { Formats, RichTextEditorIcons, RichTextEditorTooltips } from './props.js';
|
|
15
15
|
import { RichTextEditor, RichTextEditorToolbar, RichTextEditorToolbarGroup, RichTextEditorControl } from './styles.js';
|
|
16
16
|
import codemirrorNode from './utils/codemirror/codemirrorNode.js';
|
|
17
17
|
import __vue_component__$1 from '../OrButtonV3/OrButton.js';
|
|
@@ -291,14 +291,10 @@ var script = defineComponent({
|
|
|
291
291
|
expose: ['root', 'editor'],
|
|
292
292
|
setup(props, context) {
|
|
293
293
|
let editor = shallowRef();
|
|
294
|
+
const controlRef = ref();
|
|
295
|
+
const toolbarRef = ref();
|
|
294
296
|
// Refs & Styles
|
|
295
297
|
const root = ref();
|
|
296
|
-
const rootStyles = computed(() => ['or-rich-text-editor-v3', ...RichTextEditor]);
|
|
297
|
-
const toolbarRef = ref();
|
|
298
|
-
const toolbarStyles = computed(() => [...RichTextEditorToolbar]);
|
|
299
|
-
const toolbarGroupStyles = computed(() => [...RichTextEditorToolbarGroup]);
|
|
300
|
-
const controlRef = ref();
|
|
301
|
-
const controlStyles = computed(() => ['tiptap-editor-v3', ...RichTextEditorControl]);
|
|
302
298
|
const textareaRef = ref();
|
|
303
299
|
const containerRef = ref();
|
|
304
300
|
const moreButtonRef = ref();
|
|
@@ -333,42 +329,9 @@ var script = defineComponent({
|
|
|
333
329
|
const countOfNotVisibleTools = ref(0);
|
|
334
330
|
const sourceValue = ref('');
|
|
335
331
|
let trap = useFocusTrap(controlRef, {
|
|
336
|
-
immediate: true,
|
|
337
332
|
fallbackFocus: '.container',
|
|
338
333
|
allowOutsideClick: true
|
|
339
334
|
});
|
|
340
|
-
const iconsEnum = ref({
|
|
341
|
-
bold: 'format_bold',
|
|
342
|
-
italic: 'format_italic',
|
|
343
|
-
underline: 'format_underlined',
|
|
344
|
-
strike: 'format_strikethrough',
|
|
345
|
-
bulletList: 'format_list_bulleted',
|
|
346
|
-
orderedList: 'format_list_numbered',
|
|
347
|
-
link: 'link',
|
|
348
|
-
highlight: 'highlight',
|
|
349
|
-
redo: 'redo',
|
|
350
|
-
undo: 'undo',
|
|
351
|
-
codeBlock: 'code_blocks',
|
|
352
|
-
blockquote: 'format_quote',
|
|
353
|
-
file: 'attach_file',
|
|
354
|
-
source: 'source_notes'
|
|
355
|
-
});
|
|
356
|
-
const iconTooltipsEnum = ref({
|
|
357
|
-
bold: 'Bold',
|
|
358
|
-
italic: 'Italic',
|
|
359
|
-
underline: 'Underline',
|
|
360
|
-
strike: 'Strike',
|
|
361
|
-
bulletList: 'Bulleted List',
|
|
362
|
-
orderedList: 'Numbered List',
|
|
363
|
-
link: 'Link',
|
|
364
|
-
highlight: 'Highlight',
|
|
365
|
-
redo: 'Redo',
|
|
366
|
-
undo: 'Undo',
|
|
367
|
-
codeBlock: 'Code Block',
|
|
368
|
-
blockquote: 'Quote',
|
|
369
|
-
file: 'File',
|
|
370
|
-
source: 'Source'
|
|
371
|
-
});
|
|
372
335
|
useResizeObserver(root, useDebounceFn(entries => {
|
|
373
336
|
var _a, _b;
|
|
374
337
|
const entry = entries[0];
|
|
@@ -492,6 +455,12 @@ var script = defineComponent({
|
|
|
492
455
|
const getIndexOfHeading = computed(() => {
|
|
493
456
|
return props.toolbar.flat().indexOf('heading');
|
|
494
457
|
});
|
|
458
|
+
const getRichTextEditorIcon = computed(() => item => {
|
|
459
|
+
return RichTextEditorIcons[item];
|
|
460
|
+
});
|
|
461
|
+
const getRichTextEditorTooltipIcon = computed(() => item => {
|
|
462
|
+
return RichTextEditorTooltips[item];
|
|
463
|
+
});
|
|
495
464
|
const headingIcon = computed(() => {
|
|
496
465
|
if (activeHeadingLevel.value && isActive.value.heading) {
|
|
497
466
|
return `format_h${activeHeadingLevel.value}`;
|
|
@@ -662,6 +631,11 @@ var script = defineComponent({
|
|
|
662
631
|
}
|
|
663
632
|
editor === null || editor === void 0 ? void 0 : editor.setEditable(!disabled);
|
|
664
633
|
});
|
|
634
|
+
// Styles
|
|
635
|
+
const rootStyles = computed(() => ['or-rich-text-editor-v3', ...RichTextEditor]);
|
|
636
|
+
const toolbarStyles = computed(() => [...RichTextEditorToolbar]);
|
|
637
|
+
const toolbarGroupStyles = computed(() => [...RichTextEditorToolbarGroup]);
|
|
638
|
+
const controlStyles = computed(() => ['tiptap-editor-v3', ...RichTextEditorControl]);
|
|
665
639
|
return {
|
|
666
640
|
root,
|
|
667
641
|
rootStyles,
|
|
@@ -677,11 +651,11 @@ var script = defineComponent({
|
|
|
677
651
|
textareaRef,
|
|
678
652
|
moreRef,
|
|
679
653
|
menuRef,
|
|
680
|
-
iconsEnum,
|
|
681
654
|
handleToolbarClick,
|
|
682
655
|
handleEditorClick,
|
|
683
656
|
isActive,
|
|
684
|
-
|
|
657
|
+
getRichTextEditorIcon,
|
|
658
|
+
getRichTextEditorTooltipIcon,
|
|
685
659
|
getIndexOfHeading,
|
|
686
660
|
headingLevels,
|
|
687
661
|
headingIcon,
|
|
@@ -787,11 +761,11 @@ var __vue_render__ = function () {
|
|
|
787
761
|
}) : _vm.isVisible(item) ? _c('OrIconButton', {
|
|
788
762
|
attrs: {
|
|
789
763
|
"icon": {
|
|
790
|
-
icon: _vm.
|
|
764
|
+
icon: _vm.getRichTextEditorIcon(item),
|
|
791
765
|
variant: 'inherit'
|
|
792
766
|
},
|
|
793
767
|
"tooltip": {
|
|
794
|
-
content: _vm.
|
|
768
|
+
content: _vm.getRichTextEditorTooltipIcon(item),
|
|
795
769
|
placement: 'top'
|
|
796
770
|
},
|
|
797
771
|
"selected": _vm.isActive[item],
|
|
@@ -893,11 +867,11 @@ var __vue_render__ = function () {
|
|
|
893
867
|
key: item,
|
|
894
868
|
attrs: {
|
|
895
869
|
"icon": {
|
|
896
|
-
icon: _vm.
|
|
870
|
+
icon: _vm.getRichTextEditorIcon(item),
|
|
897
871
|
variant: 'inherit'
|
|
898
872
|
},
|
|
899
873
|
"tooltip": {
|
|
900
|
-
content: _vm.
|
|
874
|
+
content: _vm.getRichTextEditorTooltipIcon(item),
|
|
901
875
|
placement: 'top'
|
|
902
876
|
},
|
|
903
877
|
"selected": _vm.isActive[item]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as OrRichTextEditorV3 } from './OrRichTextEditor.js';
|
|
2
|
-
export { Formats } from './props.js';
|
|
2
|
+
export { Formats, RichTextEditorIcons, RichTextEditorTooltips } from './props.js';
|
|
@@ -3,3 +3,35 @@ export declare enum Formats {
|
|
|
3
3
|
Markup = "markup"
|
|
4
4
|
}
|
|
5
5
|
export type Tools = string[][];
|
|
6
|
+
export declare enum RichTextEditorIcons {
|
|
7
|
+
bold = "format_bold",
|
|
8
|
+
italic = "format_italic",
|
|
9
|
+
underline = "format_underlined",
|
|
10
|
+
strike = "format_strikethrough",
|
|
11
|
+
bulletList = "format_list_bulleted",
|
|
12
|
+
orderedList = "format_list_numbered",
|
|
13
|
+
link = "link",
|
|
14
|
+
highlight = "highlight",
|
|
15
|
+
redo = "redo",
|
|
16
|
+
undo = "undo",
|
|
17
|
+
codeBlock = "code_blocks",
|
|
18
|
+
blockquote = "format_quote",
|
|
19
|
+
file = "attach_file",
|
|
20
|
+
source = "source_notes"
|
|
21
|
+
}
|
|
22
|
+
export declare enum RichTextEditorTooltips {
|
|
23
|
+
bold = "Bold",
|
|
24
|
+
italic = "Italic",
|
|
25
|
+
underline = "Underline",
|
|
26
|
+
strike = "Strike",
|
|
27
|
+
bulletList = "Bulleted List",
|
|
28
|
+
orderedList = "Numbered List",
|
|
29
|
+
link = "Link",
|
|
30
|
+
highlight = "Highlight",
|
|
31
|
+
redo = "Redo",
|
|
32
|
+
undo = "Undo",
|
|
33
|
+
codeBlock = "Code Block",
|
|
34
|
+
blockquote = "Quote",
|
|
35
|
+
file = "File",
|
|
36
|
+
source = "Source"
|
|
37
|
+
}
|
|
@@ -3,5 +3,39 @@ var Formats;
|
|
|
3
3
|
Formats["Markdown"] = "markdown";
|
|
4
4
|
Formats["Markup"] = "markup";
|
|
5
5
|
})(Formats || (Formats = {}));
|
|
6
|
+
var RichTextEditorIcons;
|
|
7
|
+
(function (RichTextEditorIcons) {
|
|
8
|
+
RichTextEditorIcons["bold"] = "format_bold";
|
|
9
|
+
RichTextEditorIcons["italic"] = "format_italic";
|
|
10
|
+
RichTextEditorIcons["underline"] = "format_underlined";
|
|
11
|
+
RichTextEditorIcons["strike"] = "format_strikethrough";
|
|
12
|
+
RichTextEditorIcons["bulletList"] = "format_list_bulleted";
|
|
13
|
+
RichTextEditorIcons["orderedList"] = "format_list_numbered";
|
|
14
|
+
RichTextEditorIcons["link"] = "link";
|
|
15
|
+
RichTextEditorIcons["highlight"] = "highlight";
|
|
16
|
+
RichTextEditorIcons["redo"] = "redo";
|
|
17
|
+
RichTextEditorIcons["undo"] = "undo";
|
|
18
|
+
RichTextEditorIcons["codeBlock"] = "code_blocks";
|
|
19
|
+
RichTextEditorIcons["blockquote"] = "format_quote";
|
|
20
|
+
RichTextEditorIcons["file"] = "attach_file";
|
|
21
|
+
RichTextEditorIcons["source"] = "source_notes";
|
|
22
|
+
})(RichTextEditorIcons || (RichTextEditorIcons = {}));
|
|
23
|
+
var RichTextEditorTooltips;
|
|
24
|
+
(function (RichTextEditorTooltips) {
|
|
25
|
+
RichTextEditorTooltips["bold"] = "Bold";
|
|
26
|
+
RichTextEditorTooltips["italic"] = "Italic";
|
|
27
|
+
RichTextEditorTooltips["underline"] = "Underline";
|
|
28
|
+
RichTextEditorTooltips["strike"] = "Strike";
|
|
29
|
+
RichTextEditorTooltips["bulletList"] = "Bulleted List";
|
|
30
|
+
RichTextEditorTooltips["orderedList"] = "Numbered List";
|
|
31
|
+
RichTextEditorTooltips["link"] = "Link";
|
|
32
|
+
RichTextEditorTooltips["highlight"] = "Highlight";
|
|
33
|
+
RichTextEditorTooltips["redo"] = "Redo";
|
|
34
|
+
RichTextEditorTooltips["undo"] = "Undo";
|
|
35
|
+
RichTextEditorTooltips["codeBlock"] = "Code Block";
|
|
36
|
+
RichTextEditorTooltips["blockquote"] = "Quote";
|
|
37
|
+
RichTextEditorTooltips["file"] = "File";
|
|
38
|
+
RichTextEditorTooltips["source"] = "Source";
|
|
39
|
+
})(RichTextEditorTooltips || (RichTextEditorTooltips = {}));
|
|
6
40
|
|
|
7
|
-
export { Formats };
|
|
41
|
+
export { Formats, RichTextEditorIcons, RichTextEditorTooltips };
|
|
@@ -147,7 +147,7 @@ export { R as RatingVariant } from '../styles-13d49c4b.js';
|
|
|
147
147
|
export { default as OrResizeablePanelV3 } from './OrResizeablePanelV3/OrResizeablePanel.js';
|
|
148
148
|
export { ResizeablePanelPadding, ResizeablePanelPlacement } from './OrResizeablePanelV3/props.js';
|
|
149
149
|
export { default as OrRichTextEditorV3 } from './OrRichTextEditorV3/OrRichTextEditor.js';
|
|
150
|
-
export { Formats } from './OrRichTextEditorV3/props.js';
|
|
150
|
+
export { Formats, RichTextEditorIcons, RichTextEditorTooltips } from './OrRichTextEditorV3/props.js';
|
|
151
151
|
export { OrRichTooltipV3, RichTooltipBehavior } from './OrRichTooltipV3/index.js';
|
|
152
152
|
export { default as OrSearch } from './OrSearch/OrSearch.js';
|
|
153
153
|
export { default as OrSearchV3 } from './OrSearchV3/OrSearch.js';
|
package/dist/bundled/index.js
CHANGED
|
@@ -181,7 +181,7 @@ export { default as OrRadioV3 } from './components/OrRadioV3/OrRadio.js';
|
|
|
181
181
|
export { R as RatingVariant } from './styles-13d49c4b.js';
|
|
182
182
|
export { default as OrResizeablePanelV3 } from './components/OrResizeablePanelV3/OrResizeablePanel.js';
|
|
183
183
|
export { ResizeablePanelPadding, ResizeablePanelPlacement } from './components/OrResizeablePanelV3/props.js';
|
|
184
|
-
export { Formats } from './components/OrRichTextEditorV3/props.js';
|
|
184
|
+
export { Formats, RichTextEditorIcons, RichTextEditorTooltips } from './components/OrRichTextEditorV3/props.js';
|
|
185
185
|
export { default as OrSearch } from './components/OrSearch/OrSearch.js';
|
|
186
186
|
export { default as OrSearchV3 } from './components/OrSearchV3/OrSearch.js';
|
|
187
187
|
export { SegmentedControlSize } from './components/OrSegmentedControlV3/props.js';
|
|
@@ -106,7 +106,7 @@ export { OrRadioV3 } from './or-radio-v3/index.js';
|
|
|
106
106
|
export { OrRangeSliderV3 } from './or-range-slider-v3/index.js';
|
|
107
107
|
export { OrRatingV3, RatingVariant } from './or-rating-v3/index.js';
|
|
108
108
|
export { OrResizeablePanelV3, ResizeablePanelPadding, ResizeablePanelPlacement } from './or-resizeable-panel-v3/index.js';
|
|
109
|
-
export { Formats, OrRichTextEditorV3 } from './or-rich-text-editor-v3/index.js';
|
|
109
|
+
export { Formats, OrRichTextEditorV3, RichTextEditorIcons, RichTextEditorTooltips } from './or-rich-text-editor-v3/index.js';
|
|
110
110
|
export { OrRichTooltipV3, RichTooltipBehavior } from './or-rich-tooltip-v3/index.js';
|
|
111
111
|
export { OrSearch } from './or-search/index.js';
|
|
112
112
|
export { OrSearchV3 } from './or-search-v3/index.js';
|
|
@@ -11,7 +11,7 @@ import Underline from '@tiptap/extension-underline';
|
|
|
11
11
|
import StarterKit from '@tiptap/starter-kit';
|
|
12
12
|
import { useResizeObserver, useDebounceFn, onClickOutside } from '@vueuse/core';
|
|
13
13
|
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
|
|
14
|
-
import { defineComponent, shallowRef, ref,
|
|
14
|
+
import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue-demi';
|
|
15
15
|
import '../../dom-11141778.js';
|
|
16
16
|
import { i as isArray } from '../../isArray-135d4ff2.js';
|
|
17
17
|
import { OrButtonV3 as __vue_component__$1 } from '../or-button-v3/index.js';
|
|
@@ -78,6 +78,40 @@ var Formats;
|
|
|
78
78
|
Formats["Markdown"] = "markdown";
|
|
79
79
|
Formats["Markup"] = "markup";
|
|
80
80
|
})(Formats || (Formats = {}));
|
|
81
|
+
var RichTextEditorIcons;
|
|
82
|
+
(function (RichTextEditorIcons) {
|
|
83
|
+
RichTextEditorIcons["bold"] = "format_bold";
|
|
84
|
+
RichTextEditorIcons["italic"] = "format_italic";
|
|
85
|
+
RichTextEditorIcons["underline"] = "format_underlined";
|
|
86
|
+
RichTextEditorIcons["strike"] = "format_strikethrough";
|
|
87
|
+
RichTextEditorIcons["bulletList"] = "format_list_bulleted";
|
|
88
|
+
RichTextEditorIcons["orderedList"] = "format_list_numbered";
|
|
89
|
+
RichTextEditorIcons["link"] = "link";
|
|
90
|
+
RichTextEditorIcons["highlight"] = "highlight";
|
|
91
|
+
RichTextEditorIcons["redo"] = "redo";
|
|
92
|
+
RichTextEditorIcons["undo"] = "undo";
|
|
93
|
+
RichTextEditorIcons["codeBlock"] = "code_blocks";
|
|
94
|
+
RichTextEditorIcons["blockquote"] = "format_quote";
|
|
95
|
+
RichTextEditorIcons["file"] = "attach_file";
|
|
96
|
+
RichTextEditorIcons["source"] = "source_notes";
|
|
97
|
+
})(RichTextEditorIcons || (RichTextEditorIcons = {}));
|
|
98
|
+
var RichTextEditorTooltips;
|
|
99
|
+
(function (RichTextEditorTooltips) {
|
|
100
|
+
RichTextEditorTooltips["bold"] = "Bold";
|
|
101
|
+
RichTextEditorTooltips["italic"] = "Italic";
|
|
102
|
+
RichTextEditorTooltips["underline"] = "Underline";
|
|
103
|
+
RichTextEditorTooltips["strike"] = "Strike";
|
|
104
|
+
RichTextEditorTooltips["bulletList"] = "Bulleted List";
|
|
105
|
+
RichTextEditorTooltips["orderedList"] = "Numbered List";
|
|
106
|
+
RichTextEditorTooltips["link"] = "Link";
|
|
107
|
+
RichTextEditorTooltips["highlight"] = "Highlight";
|
|
108
|
+
RichTextEditorTooltips["redo"] = "Redo";
|
|
109
|
+
RichTextEditorTooltips["undo"] = "Undo";
|
|
110
|
+
RichTextEditorTooltips["codeBlock"] = "Code Block";
|
|
111
|
+
RichTextEditorTooltips["blockquote"] = "Quote";
|
|
112
|
+
RichTextEditorTooltips["file"] = "File";
|
|
113
|
+
RichTextEditorTooltips["source"] = "Source";
|
|
114
|
+
})(RichTextEditorTooltips || (RichTextEditorTooltips = {}));
|
|
81
115
|
|
|
82
116
|
const RichTextEditor = [
|
|
83
117
|
// Layout
|
|
@@ -285,14 +319,10 @@ var script = defineComponent({
|
|
|
285
319
|
expose: ['root', 'editor'],
|
|
286
320
|
setup(props, context) {
|
|
287
321
|
let editor = shallowRef();
|
|
322
|
+
const controlRef = ref();
|
|
323
|
+
const toolbarRef = ref();
|
|
288
324
|
// Refs & Styles
|
|
289
325
|
const root = ref();
|
|
290
|
-
const rootStyles = computed(() => ['or-rich-text-editor-v3', ...RichTextEditor]);
|
|
291
|
-
const toolbarRef = ref();
|
|
292
|
-
const toolbarStyles = computed(() => [...RichTextEditorToolbar]);
|
|
293
|
-
const toolbarGroupStyles = computed(() => [...RichTextEditorToolbarGroup]);
|
|
294
|
-
const controlRef = ref();
|
|
295
|
-
const controlStyles = computed(() => ['tiptap-editor-v3', ...RichTextEditorControl]);
|
|
296
326
|
const textareaRef = ref();
|
|
297
327
|
const containerRef = ref();
|
|
298
328
|
const moreButtonRef = ref();
|
|
@@ -327,42 +357,9 @@ var script = defineComponent({
|
|
|
327
357
|
const countOfNotVisibleTools = ref(0);
|
|
328
358
|
const sourceValue = ref('');
|
|
329
359
|
let trap = useFocusTrap(controlRef, {
|
|
330
|
-
immediate: true,
|
|
331
360
|
fallbackFocus: '.container',
|
|
332
361
|
allowOutsideClick: true
|
|
333
362
|
});
|
|
334
|
-
const iconsEnum = ref({
|
|
335
|
-
bold: 'format_bold',
|
|
336
|
-
italic: 'format_italic',
|
|
337
|
-
underline: 'format_underlined',
|
|
338
|
-
strike: 'format_strikethrough',
|
|
339
|
-
bulletList: 'format_list_bulleted',
|
|
340
|
-
orderedList: 'format_list_numbered',
|
|
341
|
-
link: 'link',
|
|
342
|
-
highlight: 'highlight',
|
|
343
|
-
redo: 'redo',
|
|
344
|
-
undo: 'undo',
|
|
345
|
-
codeBlock: 'code_blocks',
|
|
346
|
-
blockquote: 'format_quote',
|
|
347
|
-
file: 'attach_file',
|
|
348
|
-
source: 'source_notes'
|
|
349
|
-
});
|
|
350
|
-
const iconTooltipsEnum = ref({
|
|
351
|
-
bold: 'Bold',
|
|
352
|
-
italic: 'Italic',
|
|
353
|
-
underline: 'Underline',
|
|
354
|
-
strike: 'Strike',
|
|
355
|
-
bulletList: 'Bulleted List',
|
|
356
|
-
orderedList: 'Numbered List',
|
|
357
|
-
link: 'Link',
|
|
358
|
-
highlight: 'Highlight',
|
|
359
|
-
redo: 'Redo',
|
|
360
|
-
undo: 'Undo',
|
|
361
|
-
codeBlock: 'Code Block',
|
|
362
|
-
blockquote: 'Quote',
|
|
363
|
-
file: 'File',
|
|
364
|
-
source: 'Source'
|
|
365
|
-
});
|
|
366
363
|
useResizeObserver(root, useDebounceFn(entries => {
|
|
367
364
|
var _a, _b;
|
|
368
365
|
const entry = entries[0];
|
|
@@ -486,6 +483,12 @@ var script = defineComponent({
|
|
|
486
483
|
const getIndexOfHeading = computed(() => {
|
|
487
484
|
return props.toolbar.flat().indexOf('heading');
|
|
488
485
|
});
|
|
486
|
+
const getRichTextEditorIcon = computed(() => item => {
|
|
487
|
+
return RichTextEditorIcons[item];
|
|
488
|
+
});
|
|
489
|
+
const getRichTextEditorTooltipIcon = computed(() => item => {
|
|
490
|
+
return RichTextEditorTooltips[item];
|
|
491
|
+
});
|
|
489
492
|
const headingIcon = computed(() => {
|
|
490
493
|
if (activeHeadingLevel.value && isActive.value.heading) {
|
|
491
494
|
return `format_h${activeHeadingLevel.value}`;
|
|
@@ -656,6 +659,11 @@ var script = defineComponent({
|
|
|
656
659
|
}
|
|
657
660
|
editor === null || editor === void 0 ? void 0 : editor.setEditable(!disabled);
|
|
658
661
|
});
|
|
662
|
+
// Styles
|
|
663
|
+
const rootStyles = computed(() => ['or-rich-text-editor-v3', ...RichTextEditor]);
|
|
664
|
+
const toolbarStyles = computed(() => [...RichTextEditorToolbar]);
|
|
665
|
+
const toolbarGroupStyles = computed(() => [...RichTextEditorToolbarGroup]);
|
|
666
|
+
const controlStyles = computed(() => ['tiptap-editor-v3', ...RichTextEditorControl]);
|
|
659
667
|
return {
|
|
660
668
|
root,
|
|
661
669
|
rootStyles,
|
|
@@ -671,11 +679,11 @@ var script = defineComponent({
|
|
|
671
679
|
textareaRef,
|
|
672
680
|
moreRef,
|
|
673
681
|
menuRef,
|
|
674
|
-
iconsEnum,
|
|
675
682
|
handleToolbarClick,
|
|
676
683
|
handleEditorClick,
|
|
677
684
|
isActive,
|
|
678
|
-
|
|
685
|
+
getRichTextEditorIcon,
|
|
686
|
+
getRichTextEditorTooltipIcon,
|
|
679
687
|
getIndexOfHeading,
|
|
680
688
|
headingLevels,
|
|
681
689
|
headingIcon,
|
|
@@ -781,11 +789,11 @@ var __vue_render__ = function () {
|
|
|
781
789
|
}) : _vm.isVisible(item) ? _c('OrIconButton', {
|
|
782
790
|
attrs: {
|
|
783
791
|
"icon": {
|
|
784
|
-
icon: _vm.
|
|
792
|
+
icon: _vm.getRichTextEditorIcon(item),
|
|
785
793
|
variant: 'inherit'
|
|
786
794
|
},
|
|
787
795
|
"tooltip": {
|
|
788
|
-
content: _vm.
|
|
796
|
+
content: _vm.getRichTextEditorTooltipIcon(item),
|
|
789
797
|
placement: 'top'
|
|
790
798
|
},
|
|
791
799
|
"selected": _vm.isActive[item],
|
|
@@ -887,11 +895,11 @@ var __vue_render__ = function () {
|
|
|
887
895
|
key: item,
|
|
888
896
|
attrs: {
|
|
889
897
|
"icon": {
|
|
890
|
-
icon: _vm.
|
|
898
|
+
icon: _vm.getRichTextEditorIcon(item),
|
|
891
899
|
variant: 'inherit'
|
|
892
900
|
},
|
|
893
901
|
"tooltip": {
|
|
894
|
-
content: _vm.
|
|
902
|
+
content: _vm.getRichTextEditorTooltipIcon(item),
|
|
895
903
|
placement: 'top'
|
|
896
904
|
},
|
|
897
905
|
"selected": _vm.isActive[item]
|
|
@@ -1016,4 +1024,4 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
1016
1024
|
staticRenderFns: __vue_staticRenderFns__
|
|
1017
1025
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
1018
1026
|
|
|
1019
|
-
export { Formats, __vue_component__ as OrRichTextEditorV3 };
|
|
1027
|
+
export { Formats, __vue_component__ as OrRichTextEditorV3, RichTextEditorIcons, RichTextEditorTooltips };
|
|
@@ -3,3 +3,35 @@ export declare enum Formats {
|
|
|
3
3
|
Markup = "markup"
|
|
4
4
|
}
|
|
5
5
|
export type Tools = string[][];
|
|
6
|
+
export declare enum RichTextEditorIcons {
|
|
7
|
+
bold = "format_bold",
|
|
8
|
+
italic = "format_italic",
|
|
9
|
+
underline = "format_underlined",
|
|
10
|
+
strike = "format_strikethrough",
|
|
11
|
+
bulletList = "format_list_bulleted",
|
|
12
|
+
orderedList = "format_list_numbered",
|
|
13
|
+
link = "link",
|
|
14
|
+
highlight = "highlight",
|
|
15
|
+
redo = "redo",
|
|
16
|
+
undo = "undo",
|
|
17
|
+
codeBlock = "code_blocks",
|
|
18
|
+
blockquote = "format_quote",
|
|
19
|
+
file = "attach_file",
|
|
20
|
+
source = "source_notes"
|
|
21
|
+
}
|
|
22
|
+
export declare enum RichTextEditorTooltips {
|
|
23
|
+
bold = "Bold",
|
|
24
|
+
italic = "Italic",
|
|
25
|
+
underline = "Underline",
|
|
26
|
+
strike = "Strike",
|
|
27
|
+
bulletList = "Bulleted List",
|
|
28
|
+
orderedList = "Numbered List",
|
|
29
|
+
link = "Link",
|
|
30
|
+
highlight = "Highlight",
|
|
31
|
+
redo = "Redo",
|
|
32
|
+
undo = "Undo",
|
|
33
|
+
codeBlock = "Code Block",
|
|
34
|
+
blockquote = "Quote",
|
|
35
|
+
file = "File",
|
|
36
|
+
source = "Source"
|
|
37
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -106,7 +106,7 @@ export { OrRadioV3 } from './components/or-radio-v3/index.js';
|
|
|
106
106
|
export { OrRangeSliderV3 } from './components/or-range-slider-v3/index.js';
|
|
107
107
|
export { OrRatingV3, RatingVariant } from './components/or-rating-v3/index.js';
|
|
108
108
|
export { OrResizeablePanelV3, ResizeablePanelPadding, ResizeablePanelPlacement } from './components/or-resizeable-panel-v3/index.js';
|
|
109
|
-
export { Formats, OrRichTextEditorV3 } from './components/or-rich-text-editor-v3/index.js';
|
|
109
|
+
export { Formats, OrRichTextEditorV3, RichTextEditorIcons, RichTextEditorTooltips } from './components/or-rich-text-editor-v3/index.js';
|
|
110
110
|
export { OrRichTooltipV3, RichTooltipBehavior } from './components/or-rich-tooltip-v3/index.js';
|
|
111
111
|
export { OrSearch } from './components/or-search/index.js';
|
|
112
112
|
export { OrSearchV3 } from './components/or-search-v3/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components-vue2",
|
|
3
|
-
"version": "18.4.
|
|
3
|
+
"version": "18.4.2",
|
|
4
4
|
"npmUnpacked": "4.15.2",
|
|
5
5
|
"description": "Vue components library for v2",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@codemirror/view": "^6",
|
|
36
36
|
"@floating-ui/dom": "1.5.3",
|
|
37
37
|
"@lezer/highlight": "*",
|
|
38
|
-
"@onereach/styles": "^18.4.
|
|
38
|
+
"@onereach/styles": "^18.4.2",
|
|
39
39
|
"@splidejs/splide": "4.0.6",
|
|
40
40
|
"@tiptap/core": "2.0.3",
|
|
41
41
|
"@tiptap/extension-blockquote": "2.0.3",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"default": "./dist/bundled/components/*/index.js"
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "c22551ce5da2acc781045646793561b99225f026"
|
|
138
138
|
}
|