tiptapify 0.0.11 → 0.0.12
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/README.md +6 -2
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +16191 -15808
- package/dist/tiptapify.umd.js +73 -33
- package/index.d.ts +2 -2
- package/package.json +2 -1
- package/src/components/MenuBubble.vue +8 -8
- package/src/components/Tiptapify.vue +4 -5
- package/src/components/Toolbar/Group.vue +2 -2
- package/src/components/Toolbar/GroupBtn.vue +11 -8
- package/src/components/Toolbar/GroupDropdown.vue +3 -17
- package/src/components/Toolbar/Index.vue +13 -10
- package/src/components/Toolbar/Items.vue +3 -6
- package/src/components/Toolbar/Toggle.vue +2 -4
- package/src/components/Toolbar/defaultExtensionComponents.ts +34 -13
- package/src/components/Toolbar/items.ts +43 -60
- package/src/components/UI/BtnIcon.vue +24 -0
- package/src/components/UI/{Dialog.vue → TiptapifyDialog.vue} +4 -3
- package/src/components/editorExtensions.ts +16 -1
- package/src/components/index.ts +8 -2
- package/src/composables/Toolbar/Actions/useRedo.ts +23 -0
- package/src/composables/Toolbar/Actions/useUndo.ts +23 -0
- package/src/composables/Toolbar/Alignment/useAlignmentCenter.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentJustify.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentLeft.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentRight.ts +24 -0
- package/src/composables/Toolbar/Format/useBold.ts +24 -0
- package/src/composables/Toolbar/Format/useItalic.ts +24 -0
- package/src/composables/Toolbar/Format/useStrike.ts +24 -0
- package/src/composables/Toolbar/Format/useUnderline.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useBlockquote.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useCode.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useCodeBlock.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useSub.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useSup.ts +24 -0
- package/src/composables/Toolbar/List/useBullet.ts +23 -0
- package/src/composables/Toolbar/List/useIndent.ts +24 -0
- package/src/composables/Toolbar/List/useNumbered.ts +23 -0
- package/src/composables/Toolbar/List/useOutdent.ts +24 -0
- package/src/composables/Toolbar/List/useTask.ts +23 -0
- package/src/composables/Toolbar/Media/useImage.ts +24 -0
- package/src/composables/Toolbar/Media/useLink.ts +24 -0
- package/src/composables/Toolbar/Media/useTable.ts +188 -0
- package/src/composables/Toolbar/Misc/useBreak.ts +21 -0
- package/src/composables/Toolbar/Misc/useFormatClear.ts +23 -0
- package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +23 -0
- package/src/composables/Toolbar/Misc/useLine.ts +21 -0
- package/src/composables/Toolbar/Misc/usePreview.ts +20 -0
- package/src/composables/Toolbar/Misc/useSource.ts +21 -0
- package/src/composables/Toolbar/Style/useColor.ts +36 -0
- package/src/composables/Toolbar/Style/useFontFamily.ts +49 -0
- package/src/composables/Toolbar/Style/useFontSize.ts +50 -0
- package/src/composables/Toolbar/Style/useHeading.ts +64 -0
- package/src/composables/Toolbar/Style/useHighlight.ts +36 -0
- package/src/composables/Toolbar/Style/useLineHeight.ts +49 -0
- package/src/composables/Toolbar/useActionsItems.ts +5 -31
- package/src/composables/Toolbar/useAlignmentItems.ts +9 -59
- package/src/composables/Toolbar/useFormatExtraItems.ts +11 -72
- package/src/composables/Toolbar/useFormatItems.ts +9 -59
- package/src/composables/Toolbar/useListItems.ts +11 -69
- package/src/composables/Toolbar/useMediaItems.ts +7 -209
- package/src/composables/Toolbar/useMiscItems.ts +13 -58
- package/src/composables/Toolbar/useStyleItems.ts +14 -228
- package/src/extensions/components/ImageDialog.vue +7 -3
- package/src/extensions/components/LinkDialog.vue +7 -3
- package/src/extensions/components/PreviewDialog.vue +11 -4
- package/src/extensions/components/ShowSourceDialog.vue +7 -4
- package/src/extensions/components/StyleColor.vue +2 -2
- package/src/extensions/components/slashCommands/CommandsList.vue +1 -4
- package/src/extensions/image.ts +2 -1
- package/src/extensions/link.ts +2 -1
- package/src/extensions/preview.ts +2 -1
- package/src/extensions/view-source.ts +2 -1
- package/src/i18n/index.ts +1 -0
- package/src/i18n/locales/ch.json +2 -1
- package/src/i18n/locales/cz.json +2 -1
- package/src/i18n/locales/de.json +2 -1
- package/src/i18n/locales/en.json +2 -1
- package/src/i18n/locales/es.json +2 -1
- package/src/i18n/locales/fr.json +2 -1
- package/src/i18n/locales/it.json +2 -1
- package/src/i18n/locales/la.json +2 -1
- package/src/i18n/locales/lt.json +2 -1
- package/src/i18n/locales/nl.json +2 -1
- package/src/i18n/locales/pl.json +2 -1
- package/src/i18n/locales/pt.json +2 -1
- package/src/i18n/locales/ru.json +2 -1
- package/src/i18n/locales/se.json +2 -1
- package/src/i18n/locales/ua.json +2 -1
- package/src/index.ts +3 -1
- package/src/types/extensionComponents.ts +22 -0
- package/src/types/toolbarItems.ts +43 -0
- package/src/types/toolbarSections.ts +11 -0
- package/src/types/overridable-extensions.ts +0 -6
|
@@ -1,231 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { useI18n } from "vue-i18n";
|
|
10
|
-
import {
|
|
11
|
-
fonts,
|
|
12
|
-
fontSizes,
|
|
13
|
-
lineHeights,
|
|
14
|
-
headingLevels,
|
|
15
|
-
setHeadingLevels,
|
|
16
|
-
defaultFontSize,
|
|
17
|
-
defaultLineHeight
|
|
18
|
-
} from "@tiptapify/constants/style";
|
|
19
|
-
|
|
20
|
-
interface MDIIcons {
|
|
21
|
-
[key: string]: string
|
|
22
|
-
}
|
|
23
|
-
const mdiIcons = mdi as MDIIcons
|
|
24
|
-
|
|
25
|
-
export function useStyleItems(editor: Editor, theme: any, fontMeasure: string, customHeadingLevels: Array<number> = []) {
|
|
26
|
-
const { t } = useI18n();
|
|
27
|
-
|
|
28
|
-
setHeadingLevels(customHeadingLevels)
|
|
29
|
-
|
|
1
|
+
import { useColor } from "@tiptapify/composables/Toolbar/Style/useColor";
|
|
2
|
+
import { useFontFamily } from "@tiptapify/composables/Toolbar/Style/useFontFamily";
|
|
3
|
+
import { useFontSize } from "@tiptapify/composables/Toolbar/Style/useFontSize";
|
|
4
|
+
import { useHeading } from "@tiptapify/composables/Toolbar/Style/useHeading";
|
|
5
|
+
import { useHighlight } from "@tiptapify/composables/Toolbar/Style/useHighlight";
|
|
6
|
+
import { useLineHeight } from "@tiptapify/composables/Toolbar/Style/useLineHeight";
|
|
7
|
+
|
|
8
|
+
export function useStyleItems(theme: any, fontMeasure: string, customHeadingLevels: Array<number> = []) {
|
|
30
9
|
return {
|
|
31
|
-
heading:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
props: {
|
|
38
|
-
color: computed(() => editor.isActive('heading') || editor.isActive('paragraph') ? 'primary' : ''),
|
|
39
|
-
},
|
|
40
|
-
children: [
|
|
41
|
-
{
|
|
42
|
-
name: 'paragraph',
|
|
43
|
-
tooltip: computed(() => t('style.paragraph')),
|
|
44
|
-
icon: mdiIcons['mdiFormatParagraph'],
|
|
45
|
-
noI18n: true,
|
|
46
|
-
enabled: true,
|
|
47
|
-
props: {
|
|
48
|
-
color: computed(() => editor.isActive('paragraph') ? 'primary' : ''),
|
|
49
|
-
},
|
|
50
|
-
attrs: {
|
|
51
|
-
click: () => editor.chain().focus().setParagraph().run()
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
].concat(
|
|
55
|
-
headingLevels.value.map(level => {
|
|
56
|
-
const headingLevel: Level = level as Level
|
|
57
|
-
return {
|
|
58
|
-
name: `H${level}`,
|
|
59
|
-
tooltip: computed(() => t(`style.headings.h${level}`)),
|
|
60
|
-
icon: mdiIcons[`mdiFormatHeader${level}`],
|
|
61
|
-
noI18n: true,
|
|
62
|
-
enabled: true,
|
|
63
|
-
props: {
|
|
64
|
-
color: computed(() => editor.isActive('heading', { level: level }) ? 'primary' : ''),
|
|
65
|
-
},
|
|
66
|
-
attrs: {
|
|
67
|
-
click: () => editor.chain().focus().toggleHeading({ level: headingLevel }).run()
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
)
|
|
72
|
-
},
|
|
73
|
-
fontFamily: {
|
|
74
|
-
name: 'font-family',
|
|
75
|
-
tooltip: computed(() => t('style.fontFamily')),
|
|
76
|
-
icon: mdi.mdiFormatFont,
|
|
77
|
-
modelValue: false,
|
|
78
|
-
enabled: true,
|
|
79
|
-
props: {
|
|
80
|
-
disabled: computed(() => !editor.can().chain().focus().unsetFontFamily().run()),
|
|
81
|
-
color: computed(() => {
|
|
82
|
-
let color = ''
|
|
83
|
-
for (const font in fonts) {
|
|
84
|
-
if (editor.isActive('textStyle', { fontFamily: fonts[font].fontFamily })) {
|
|
85
|
-
color = 'primary'
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return color
|
|
91
|
-
}),
|
|
92
|
-
},
|
|
93
|
-
component: markRaw(FontFamily),
|
|
94
|
-
componentProps: {
|
|
95
|
-
fonts: fonts,
|
|
96
|
-
fontFamily: computed(() => {
|
|
97
|
-
let fontFamily = ''
|
|
98
|
-
for (const font in fonts) {
|
|
99
|
-
if (editor.isActive('textStyle', { fontFamily: fonts[font].fontFamily })) {
|
|
100
|
-
fontFamily = fonts[font].fontFamily
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return fontFamily
|
|
106
|
-
}),
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
fontSize: {
|
|
110
|
-
name: 'font-size',
|
|
111
|
-
tooltip: computed(() => t('style.fontSize')),
|
|
112
|
-
icon: mdi.mdiFormatSize,
|
|
113
|
-
modelValue: false,
|
|
114
|
-
enabled: true,
|
|
115
|
-
props: {
|
|
116
|
-
disabled: computed(() => !editor.can().chain().focus().unsetFontSize().run()),
|
|
117
|
-
color: computed(() => {
|
|
118
|
-
let color = ''
|
|
119
|
-
for (const size of fontSizes) {
|
|
120
|
-
if (editor.isActive('textStyle', { fontSize: `${size}${fontMeasure}` })) {
|
|
121
|
-
color = 'primary'
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return color
|
|
127
|
-
}),
|
|
128
|
-
},
|
|
129
|
-
component: markRaw(FontSize),
|
|
130
|
-
componentProps: {
|
|
131
|
-
sizes: fontSizes,
|
|
132
|
-
measure: fontMeasure,
|
|
133
|
-
fontSize: computed(() => {
|
|
134
|
-
let fontSize = null
|
|
135
|
-
for (const size of fontSizes) {
|
|
136
|
-
if (editor.isActive('textStyle', { fontSize: `${size}${fontMeasure}` })) {
|
|
137
|
-
fontSize = size
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return fontSize
|
|
143
|
-
}),
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
lineHeight: {
|
|
147
|
-
name: 'line-height',
|
|
148
|
-
tooltip: computed(() => t('style.lineHeight')),
|
|
149
|
-
icon: mdi.mdiFormatLineHeight,
|
|
150
|
-
modelValue: null,
|
|
151
|
-
enabled: true,
|
|
152
|
-
props: {
|
|
153
|
-
disabled: computed(() => !editor.can().chain().focus().unsetLineHeight().run()),
|
|
154
|
-
color: computed(() => {
|
|
155
|
-
let color = ''
|
|
156
|
-
for (const height of lineHeights) {
|
|
157
|
-
if (editor.isActive('textStyle', { lineHeight: height.toString() })) {
|
|
158
|
-
color = 'primary'
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return color
|
|
164
|
-
}),
|
|
165
|
-
},
|
|
166
|
-
component: markRaw(LineHeight),
|
|
167
|
-
componentProps: {
|
|
168
|
-
lineHeights,
|
|
169
|
-
lineHeight: computed(() => {
|
|
170
|
-
let lineHeight = null
|
|
171
|
-
for (const height of lineHeights) {
|
|
172
|
-
if (editor.isActive('textStyle', { lineHeight: height.toString() })) {
|
|
173
|
-
lineHeight = height
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return lineHeight
|
|
179
|
-
}),
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
highlight: {
|
|
183
|
-
name: 'highlight',
|
|
184
|
-
tooltip: computed(() => t('style.color.highlight')),
|
|
185
|
-
icon: mdi.mdiFormatColorFill,
|
|
186
|
-
icon2: mdi.mdiColorHelper,
|
|
187
|
-
enabled: true,
|
|
188
|
-
props: {
|
|
189
|
-
disabled: computed(() => !editor.can().chain().focus().toggleHighlight().run()),
|
|
190
|
-
},
|
|
191
|
-
icon2Props: {
|
|
192
|
-
disabled: computed(() => !editor.can().chain().focus().toggleHighlight().run()),
|
|
193
|
-
color: computed(() => {
|
|
194
|
-
const defaultColor = theme.global.current.value.dark ? '#fff' : '#000'
|
|
195
|
-
return editor.getAttributes('highlight').color || defaultColor
|
|
196
|
-
}),
|
|
197
|
-
style: 'filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px);'
|
|
198
|
-
},
|
|
199
|
-
component: markRaw(StyleColor),
|
|
200
|
-
componentProps: {
|
|
201
|
-
fontColor: false,
|
|
202
|
-
backgroundColor: true,
|
|
203
|
-
color: computed(() => editor.getAttributes('highlight').color || ''),
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
color: {
|
|
207
|
-
name: 'color',
|
|
208
|
-
tooltip: computed(() => t('style.color.text')),
|
|
209
|
-
icon: mdi.mdiFormatColorText,
|
|
210
|
-
icon2: mdi.mdiColorHelper,
|
|
211
|
-
enabled: true,
|
|
212
|
-
props: {
|
|
213
|
-
disabled: computed(() => !editor.can().chain().focus().toggleHighlight().run()),
|
|
214
|
-
},
|
|
215
|
-
icon2Props: {
|
|
216
|
-
disabled: computed(() => !editor.can().chain().focus().toggleHighlight().run()),
|
|
217
|
-
color: computed(() => {
|
|
218
|
-
const defaultColor = theme.global.current.value.dark ? '#fff' : '#000'
|
|
219
|
-
return editor.getAttributes('textStyle').color || defaultColor
|
|
220
|
-
}),
|
|
221
|
-
style: 'filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px);'
|
|
222
|
-
},
|
|
223
|
-
component: markRaw(StyleColor),
|
|
224
|
-
componentProps: {
|
|
225
|
-
fontColor: true,
|
|
226
|
-
backgroundColor: false,
|
|
227
|
-
color: computed(() => editor.getAttributes('textStyle').color || ''),
|
|
228
|
-
}
|
|
229
|
-
}
|
|
10
|
+
heading: useHeading(customHeadingLevels),
|
|
11
|
+
fontFamily: useFontFamily(),
|
|
12
|
+
fontSize: useFontSize(fontMeasure),
|
|
13
|
+
lineHeight: useLineHeight(),
|
|
14
|
+
highlight: useHighlight(theme),
|
|
15
|
+
color: useColor(theme)
|
|
230
16
|
}
|
|
231
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
3
|
import { Editor } from "@tiptap/vue-3";
|
|
4
|
-
import
|
|
4
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
5
5
|
|
|
6
6
|
import { useI18n } from 'vue-i18n'
|
|
7
7
|
import { computed, inject, onMounted, onUnmounted, Ref, ref } from 'vue'
|
|
@@ -66,6 +66,10 @@ function close() {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const showTiptapifyImage = (event: CustomEvent) => {
|
|
69
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
attrs.value.src = event.detail.image?.src
|
|
70
74
|
attrs.value.alt = event.detail.image?.alt
|
|
71
75
|
attrs.value.width = event.detail.image?.width
|
|
@@ -84,7 +88,7 @@ onUnmounted(() => {
|
|
|
84
88
|
</script>
|
|
85
89
|
|
|
86
90
|
<template>
|
|
87
|
-
<
|
|
91
|
+
<TiptapifyDialog ref="dialog" module="image" :max-width="800">
|
|
88
92
|
<template #content>
|
|
89
93
|
<VCardText>
|
|
90
94
|
<VRow>
|
|
@@ -126,5 +130,5 @@ onUnmounted(() => {
|
|
|
126
130
|
</VRow>
|
|
127
131
|
</VCardActions>
|
|
128
132
|
</template>
|
|
129
|
-
</
|
|
133
|
+
</TiptapifyDialog>
|
|
130
134
|
</template>
|
|
@@ -5,7 +5,7 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import { useI18n } from 'vue-i18n'
|
|
6
6
|
import { computed, inject, onMounted, onUnmounted, Ref, ref, watch } from 'vue'
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue"
|
|
9
9
|
|
|
10
10
|
defineProps({
|
|
11
11
|
variantBtn: { type: String, default() { return 'elevated' }},
|
|
@@ -63,6 +63,10 @@ function close() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const showLink = (event: CustomEvent) => {
|
|
66
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
|
|
66
70
|
attrs.value.href = event.detail.link?.href ?? ''
|
|
67
71
|
attrs.value.target = targetAttrs.value.find(item => item.value === event.detail.link?.target) ?? targetAttrs[0]
|
|
68
72
|
attrs.value.rel = event.detail.link?.rel?.split(' ')
|
|
@@ -103,7 +107,7 @@ watch(() => attrs.value.href, () => {
|
|
|
103
107
|
</script>
|
|
104
108
|
|
|
105
109
|
<template>
|
|
106
|
-
<
|
|
110
|
+
<TiptapifyDialog ref="dialog" module="link">
|
|
107
111
|
<template #content>
|
|
108
112
|
<VCardText>
|
|
109
113
|
<VRow>
|
|
@@ -169,5 +173,5 @@ watch(() => attrs.value.href, () => {
|
|
|
169
173
|
</VRow>
|
|
170
174
|
</VCardActions>
|
|
171
175
|
</template>
|
|
172
|
-
</
|
|
176
|
+
</TiptapifyDialog>
|
|
173
177
|
</template>
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { Editor } from "@tiptap/vue-3";
|
|
3
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
4
|
+
import { ref, onMounted, onUnmounted, inject, Ref } from 'vue'
|
|
4
5
|
|
|
5
6
|
const content = ref()
|
|
6
7
|
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
7
10
|
const dialog = ref(null)
|
|
8
11
|
|
|
9
12
|
const showDialog = (event: CustomEvent) => {
|
|
13
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
content.value = event.detail.html
|
|
11
18
|
|
|
12
19
|
dialog.value.open()
|
|
@@ -22,13 +29,13 @@ onUnmounted(() => {
|
|
|
22
29
|
</script>
|
|
23
30
|
|
|
24
31
|
<template>
|
|
25
|
-
<
|
|
32
|
+
<TiptapifyDialog ref="dialog" module="preview" fullscreen>
|
|
26
33
|
<template #content>
|
|
27
34
|
<VCardItem>
|
|
28
35
|
<div class="tiptap" v-html="content"></div>
|
|
29
36
|
</VCardItem>
|
|
30
37
|
</template>
|
|
31
|
-
</
|
|
38
|
+
</TiptapifyDialog>
|
|
32
39
|
</template>
|
|
33
40
|
|
|
34
41
|
<style lang="scss">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import
|
|
3
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
4
4
|
import { ref, onMounted, onUnmounted, watch, inject, Ref } from 'vue'
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
6
6
|
|
|
@@ -54,6 +54,9 @@ const unformatHtml = (html: string): string => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const showDialog = (event: CustomEvent) => {
|
|
57
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
58
|
+
return
|
|
59
|
+
}
|
|
57
60
|
sourceCode.value = event.detail.html
|
|
58
61
|
|
|
59
62
|
dialog.value.open()
|
|
@@ -79,7 +82,7 @@ watch(() => formatted.value, () => {
|
|
|
79
82
|
</script>
|
|
80
83
|
|
|
81
84
|
<template>
|
|
82
|
-
<
|
|
85
|
+
<TiptapifyDialog ref="dialog" module="source" :max-width="1500">
|
|
83
86
|
<template #content>
|
|
84
87
|
<VCardText>
|
|
85
88
|
<VContainer fluid class="pt-0 pl-0 pr-0">
|
|
@@ -105,7 +108,7 @@ watch(() => formatted.value, () => {
|
|
|
105
108
|
<template #actions>
|
|
106
109
|
<VCardActions>
|
|
107
110
|
<VSpacer></VSpacer>
|
|
108
|
-
<VBtn :variant="variantBtn" @click="dialog
|
|
111
|
+
<VBtn :variant="variantBtn" @click="dialog.close()">
|
|
109
112
|
{{ t('dialog.close') }}
|
|
110
113
|
</VBtn>
|
|
111
114
|
<VBtn :variant="variantBtn" color="primary" @click="saveChanges">
|
|
@@ -113,7 +116,7 @@ watch(() => formatted.value, () => {
|
|
|
113
116
|
</VBtn>
|
|
114
117
|
</VCardActions>
|
|
115
118
|
</template>
|
|
116
|
-
</
|
|
119
|
+
</TiptapifyDialog>
|
|
117
120
|
</template>
|
|
118
121
|
|
|
119
122
|
<style scoped lang="scss">
|
|
@@ -170,7 +170,7 @@ function isColorActive(color: string): boolean {
|
|
|
170
170
|
|
|
171
171
|
<VMenu v-model="colorPicker" :close-on-content-click="false">
|
|
172
172
|
<template #activator="{ props: menuProps }">
|
|
173
|
-
<VBtn v-bind="menuProps" variant="flat" block>
|
|
173
|
+
<VBtn v-bind="menuProps" color="default" variant="flat" block>
|
|
174
174
|
<template #prepend>
|
|
175
175
|
<div
|
|
176
176
|
class="tiptapify-style-color-picker"
|
|
@@ -198,7 +198,7 @@ function isColorActive(color: string): boolean {
|
|
|
198
198
|
|
|
199
199
|
<VDivider class="mt-2 mb-2" />
|
|
200
200
|
|
|
201
|
-
<VBtn @click="unsetColor" block variant="flat">
|
|
201
|
+
<VBtn @click="unsetColor" color="default" block variant="flat">
|
|
202
202
|
{{ t('style.color.unset') }}
|
|
203
203
|
</VBtn>
|
|
204
204
|
</VSheet>
|
|
@@ -77,10 +77,7 @@ defineExpose({
|
|
|
77
77
|
@click="selectItem(index)"
|
|
78
78
|
size="small"
|
|
79
79
|
>
|
|
80
|
-
<VIcon
|
|
81
|
-
<span v-else>
|
|
82
|
-
{{ item.title }}
|
|
83
|
-
</span>
|
|
80
|
+
<VIcon :icon="`mdiSvg:${mdi[`mdi${item.icon}`]}` || `mdiSvg:${mdi.mdiImageBrokenVariant}`" size="16" />
|
|
84
81
|
</VBtn>
|
|
85
82
|
</template>
|
|
86
83
|
<div class="item" v-else>No result</div>
|
package/src/extensions/image.ts
CHANGED
|
@@ -18,7 +18,8 @@ export const TiptapifyImage = Extension.create({
|
|
|
18
18
|
showTiptapifyImage: () => ({ editor }) => {
|
|
19
19
|
const event = new CustomEvent(`tiptapify-show-${name}`, {
|
|
20
20
|
detail: {
|
|
21
|
-
image: editor.getAttributes('image')
|
|
21
|
+
image: editor.getAttributes('image'),
|
|
22
|
+
editorId: editor.instanceId
|
|
22
23
|
}
|
|
23
24
|
})
|
|
24
25
|
|
package/src/extensions/link.ts
CHANGED
|
@@ -19,7 +19,8 @@ export const TiptapifyLink = Link.extend({
|
|
|
19
19
|
showLink: () => ({ editor }) => {
|
|
20
20
|
const event = new CustomEvent(`tiptapify-show-${name}`, {
|
|
21
21
|
detail: {
|
|
22
|
-
link: editor.getAttributes('link')
|
|
22
|
+
link: editor.getAttributes('link'),
|
|
23
|
+
editorId: editor.instanceId
|
|
23
24
|
}
|
|
24
25
|
})
|
|
25
26
|
|
|
@@ -27,7 +27,8 @@ export const ViewSource = Extension.create<ViewSourceOptions>({
|
|
|
27
27
|
showSource: () => ({ editor }) => {
|
|
28
28
|
const event = new CustomEvent('tiptapify-show-source', {
|
|
29
29
|
detail: {
|
|
30
|
-
html: editor.getHTML()
|
|
30
|
+
html: editor.getHTML(),
|
|
31
|
+
editorId: editor.instanceId
|
|
31
32
|
}
|
|
32
33
|
})
|
|
33
34
|
|
package/src/i18n/index.ts
CHANGED
package/src/i18n/locales/ch.json
CHANGED
package/src/i18n/locales/cz.json
CHANGED
package/src/i18n/locales/de.json
CHANGED
package/src/i18n/locales/en.json
CHANGED
package/src/i18n/locales/es.json
CHANGED
package/src/i18n/locales/fr.json
CHANGED
package/src/i18n/locales/it.json
CHANGED
package/src/i18n/locales/la.json
CHANGED
package/src/i18n/locales/lt.json
CHANGED
package/src/i18n/locales/nl.json
CHANGED
package/src/i18n/locales/pl.json
CHANGED
package/src/i18n/locales/pt.json
CHANGED
package/src/i18n/locales/ru.json
CHANGED
package/src/i18n/locales/se.json
CHANGED
package/src/i18n/locales/ua.json
CHANGED
|
@@ -110,7 +110,8 @@
|
|
|
110
110
|
},
|
|
111
111
|
"misc": {
|
|
112
112
|
"source": "Перегляд вихідного коду",
|
|
113
|
-
"preview": "Попередній перегляд"
|
|
113
|
+
"preview": "Попередній перегляд",
|
|
114
|
+
"toggleInvisibleCharacters": "Показати/приховати невидимі символи"
|
|
114
115
|
},
|
|
115
116
|
"footer": {
|
|
116
117
|
"words": "слова",
|