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.
Files changed (94) hide show
  1. package/README.md +6 -2
  2. package/dist/tiptapify.css +1 -1
  3. package/dist/tiptapify.mjs +16191 -15808
  4. package/dist/tiptapify.umd.js +73 -33
  5. package/index.d.ts +2 -2
  6. package/package.json +2 -1
  7. package/src/components/MenuBubble.vue +8 -8
  8. package/src/components/Tiptapify.vue +4 -5
  9. package/src/components/Toolbar/Group.vue +2 -2
  10. package/src/components/Toolbar/GroupBtn.vue +11 -8
  11. package/src/components/Toolbar/GroupDropdown.vue +3 -17
  12. package/src/components/Toolbar/Index.vue +13 -10
  13. package/src/components/Toolbar/Items.vue +3 -6
  14. package/src/components/Toolbar/Toggle.vue +2 -4
  15. package/src/components/Toolbar/defaultExtensionComponents.ts +34 -13
  16. package/src/components/Toolbar/items.ts +43 -60
  17. package/src/components/UI/BtnIcon.vue +24 -0
  18. package/src/components/UI/{Dialog.vue → TiptapifyDialog.vue} +4 -3
  19. package/src/components/editorExtensions.ts +16 -1
  20. package/src/components/index.ts +8 -2
  21. package/src/composables/Toolbar/Actions/useRedo.ts +23 -0
  22. package/src/composables/Toolbar/Actions/useUndo.ts +23 -0
  23. package/src/composables/Toolbar/Alignment/useAlignmentCenter.ts +24 -0
  24. package/src/composables/Toolbar/Alignment/useAlignmentJustify.ts +24 -0
  25. package/src/composables/Toolbar/Alignment/useAlignmentLeft.ts +24 -0
  26. package/src/composables/Toolbar/Alignment/useAlignmentRight.ts +24 -0
  27. package/src/composables/Toolbar/Format/useBold.ts +24 -0
  28. package/src/composables/Toolbar/Format/useItalic.ts +24 -0
  29. package/src/composables/Toolbar/Format/useStrike.ts +24 -0
  30. package/src/composables/Toolbar/Format/useUnderline.ts +24 -0
  31. package/src/composables/Toolbar/FormatExtra/useBlockquote.ts +24 -0
  32. package/src/composables/Toolbar/FormatExtra/useCode.ts +24 -0
  33. package/src/composables/Toolbar/FormatExtra/useCodeBlock.ts +24 -0
  34. package/src/composables/Toolbar/FormatExtra/useSub.ts +24 -0
  35. package/src/composables/Toolbar/FormatExtra/useSup.ts +24 -0
  36. package/src/composables/Toolbar/List/useBullet.ts +23 -0
  37. package/src/composables/Toolbar/List/useIndent.ts +24 -0
  38. package/src/composables/Toolbar/List/useNumbered.ts +23 -0
  39. package/src/composables/Toolbar/List/useOutdent.ts +24 -0
  40. package/src/composables/Toolbar/List/useTask.ts +23 -0
  41. package/src/composables/Toolbar/Media/useImage.ts +24 -0
  42. package/src/composables/Toolbar/Media/useLink.ts +24 -0
  43. package/src/composables/Toolbar/Media/useTable.ts +188 -0
  44. package/src/composables/Toolbar/Misc/useBreak.ts +21 -0
  45. package/src/composables/Toolbar/Misc/useFormatClear.ts +23 -0
  46. package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +23 -0
  47. package/src/composables/Toolbar/Misc/useLine.ts +21 -0
  48. package/src/composables/Toolbar/Misc/usePreview.ts +20 -0
  49. package/src/composables/Toolbar/Misc/useSource.ts +21 -0
  50. package/src/composables/Toolbar/Style/useColor.ts +36 -0
  51. package/src/composables/Toolbar/Style/useFontFamily.ts +49 -0
  52. package/src/composables/Toolbar/Style/useFontSize.ts +50 -0
  53. package/src/composables/Toolbar/Style/useHeading.ts +64 -0
  54. package/src/composables/Toolbar/Style/useHighlight.ts +36 -0
  55. package/src/composables/Toolbar/Style/useLineHeight.ts +49 -0
  56. package/src/composables/Toolbar/useActionsItems.ts +5 -31
  57. package/src/composables/Toolbar/useAlignmentItems.ts +9 -59
  58. package/src/composables/Toolbar/useFormatExtraItems.ts +11 -72
  59. package/src/composables/Toolbar/useFormatItems.ts +9 -59
  60. package/src/composables/Toolbar/useListItems.ts +11 -69
  61. package/src/composables/Toolbar/useMediaItems.ts +7 -209
  62. package/src/composables/Toolbar/useMiscItems.ts +13 -58
  63. package/src/composables/Toolbar/useStyleItems.ts +14 -228
  64. package/src/extensions/components/ImageDialog.vue +7 -3
  65. package/src/extensions/components/LinkDialog.vue +7 -3
  66. package/src/extensions/components/PreviewDialog.vue +11 -4
  67. package/src/extensions/components/ShowSourceDialog.vue +7 -4
  68. package/src/extensions/components/StyleColor.vue +2 -2
  69. package/src/extensions/components/slashCommands/CommandsList.vue +1 -4
  70. package/src/extensions/image.ts +2 -1
  71. package/src/extensions/link.ts +2 -1
  72. package/src/extensions/preview.ts +2 -1
  73. package/src/extensions/view-source.ts +2 -1
  74. package/src/i18n/index.ts +1 -0
  75. package/src/i18n/locales/ch.json +2 -1
  76. package/src/i18n/locales/cz.json +2 -1
  77. package/src/i18n/locales/de.json +2 -1
  78. package/src/i18n/locales/en.json +2 -1
  79. package/src/i18n/locales/es.json +2 -1
  80. package/src/i18n/locales/fr.json +2 -1
  81. package/src/i18n/locales/it.json +2 -1
  82. package/src/i18n/locales/la.json +2 -1
  83. package/src/i18n/locales/lt.json +2 -1
  84. package/src/i18n/locales/nl.json +2 -1
  85. package/src/i18n/locales/pl.json +2 -1
  86. package/src/i18n/locales/pt.json +2 -1
  87. package/src/i18n/locales/ru.json +2 -1
  88. package/src/i18n/locales/se.json +2 -1
  89. package/src/i18n/locales/ua.json +2 -1
  90. package/src/index.ts +3 -1
  91. package/src/types/extensionComponents.ts +22 -0
  92. package/src/types/toolbarItems.ts +43 -0
  93. package/src/types/toolbarSections.ts +11 -0
  94. package/src/types/overridable-extensions.ts +0 -6
@@ -1,231 +1,17 @@
1
- import * as mdi from "@mdi/js";
2
- import { Level } from "@tiptap/extension-heading";
3
- import FontFamily from "@tiptapify/extensions/components/FontFamily.vue";
4
- import FontSize from "@tiptapify/extensions/components/FontSize.vue";
5
- import LineHeight from "@tiptapify/extensions/components/LineHeight.vue";
6
- import { Editor } from "@tiptap/vue-3";
7
- import StyleColor from "@tiptapify/extensions/components/StyleColor.vue";
8
- import { computed, markRaw } from "vue";
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
- name: 'heading',
33
- tooltip: computed(() => t('style.heading')),
34
- icon: mdi.mdiFormatHeaderPound,
35
- modelValue: null,
36
- enabled: true,
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 Dialog from "@tiptapify/components/UI/Dialog.vue";
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
- <Dialog ref="dialog" module="image" :max-width="800">
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
- </Dialog>
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 Dialog from "@tiptapify/components/UI/Dialog.vue"
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
- <Dialog ref="dialog" module="link">
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
- </Dialog>
176
+ </TiptapifyDialog>
173
177
  </template>
@@ -1,12 +1,19 @@
1
1
  <script setup lang="ts">
2
- import Dialog from "@tiptapify/components/UI/Dialog.vue";
3
- import { ref, onMounted, onUnmounted } from 'vue'
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
- <Dialog ref="dialog" module="preview" fullscreen>
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
- </Dialog>
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 Dialog from "@tiptapify/components/UI/Dialog.vue";
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
- <Dialog ref="dialog" module="source" :max-width="1500">
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 = false">
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
- </Dialog>
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 v-if="item.icon" :icon="mdi[`mdi${item.icon}`]" size="16" />
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>
@@ -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
 
@@ -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
 
@@ -19,7 +19,8 @@ export const Preview = Extension.create({
19
19
  showPreview: () => ({ editor }) => {
20
20
  const event = new CustomEvent(`tiptapify-show-${name}`, {
21
21
  detail: {
22
- html: editor.getHTML()
22
+ html: editor.getHTML(),
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
@@ -11,6 +11,7 @@ let _i18n: any = null
11
11
  export const getI18n = (locale: string) => {
12
12
  if (_i18n === null) {
13
13
  _i18n = createI18n({
14
+ legacy: false,
14
15
  locale: locale,
15
16
  fallbackLocale: 'en',
16
17
  messages
@@ -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": "单词",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Zobrazit zdrojový kód",
113
- "preview": "Náhled"
113
+ "preview": "Náhled",
114
+ "toggleInvisibleCharacters": "Zobrazit/skrýt neviditelné znaky"
114
115
  },
115
116
  "footer": {
116
117
  "words": "slova",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Quellcode anzeigen",
113
- "preview": "Vorschau"
113
+ "preview": "Vorschau",
114
+ "toggleInvisibleCharacters": "Unsichtbare Zeichen anzeigen/ausblenden"
114
115
  },
115
116
  "footer": {
116
117
  "words": "Wörter",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "View source code",
113
- "preview": "Preview"
113
+ "preview": "Preview",
114
+ "toggleInvisibleCharacters": "Show/hide invisible characters"
114
115
  },
115
116
  "footer": {
116
117
  "words": "words",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Ver código fuente",
113
- "preview": "Vista previa"
113
+ "preview": "Vista previa",
114
+ "toggleInvisibleCharacters": "Mostrar/ocultar caracteres invisibles"
114
115
  },
115
116
  "footer": {
116
117
  "words": "palabras",
@@ -111,7 +111,8 @@
111
111
  },
112
112
  "misc": {
113
113
  "source": "Voir le code source",
114
- "preview": "Aperçu"
114
+ "preview": "Aperçu",
115
+ "toggleInvisibleCharacters": "Afficher/masquer les caractères invisibles"
115
116
  },
116
117
  "footer": {
117
118
  "words": "mots",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Visualizza codice sorgente",
113
- "preview": "Anteprima"
113
+ "preview": "Anteprima",
114
+ "toggleInvisibleCharacters": "Mostra/nascondi caratteri invisibili"
114
115
  },
115
116
  "footer": {
116
117
  "words": "parole",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Codicem fontem videre",
113
- "preview": "Praevisio"
113
+ "preview": "Praevisio",
114
+ "toggleInvisibleCharacters": "Ostende/cela characteres invisibiles"
114
115
  },
115
116
  "footer": {
116
117
  "words": "verba",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Žiūrėti išeities kodą",
113
- "preview": "Peržiūra"
113
+ "preview": "Peržiūra",
114
+ "toggleInvisibleCharacters": "Rodyti/slėpti nematomus simbolius"
114
115
  },
115
116
  "footer": {
116
117
  "words": "žodžiai",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Broncode bekijken",
113
- "preview": "Voorvertoning"
113
+ "preview": "Voorvertoning",
114
+ "toggleInvisibleCharacters": "Onzichtbare tekens tonen/verbergen"
114
115
  },
115
116
  "footer": {
116
117
  "words": "woorden",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Pokaż kod źródłowy",
113
- "preview": "Podgląd"
113
+ "preview": "Podgląd",
114
+ "toggleInvisibleCharacters": "Pokaż/ukryj niewidoczne znaki"
114
115
  },
115
116
  "footer": {
116
117
  "words": "słowa",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Ver código fonte",
113
- "preview": "Visualização"
113
+ "preview": "Visualização",
114
+ "toggleInvisibleCharacters": "Mostrar/ocultar caracteres invisíveis"
114
115
  },
115
116
  "footer": {
116
117
  "words": "palavras",
@@ -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": "слова",
@@ -110,7 +110,8 @@
110
110
  },
111
111
  "misc": {
112
112
  "source": "Visa källkod",
113
- "preview": "Förhandsgranskning"
113
+ "preview": "Förhandsgranskning",
114
+ "toggleInvisibleCharacters": "Visa/dölj osynliga tecken"
114
115
  },
115
116
  "footer": {
116
117
  "words": "ord",
@@ -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": "слова",