tiptapify 0.2.3 → 0.2.4
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/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +8 -8
- package/dist/tiptapify.umd.js +1 -1
- package/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Footer.vue +5 -4
- package/src/index.ts +2 -0
package/index.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ import Tiptapify from './src/components/Tiptapify.vue'
|
|
|
64
64
|
import TiptapifyDialog from './src/components/UI/TiptapifyDialog.vue'
|
|
65
65
|
import * as mdi from '@mdi/js'
|
|
66
66
|
|
|
67
|
+
export type TiptapifyFooterAlignment = 'start' | 'center' | 'end'
|
|
68
|
+
|
|
67
69
|
export interface TiptapifyOptions {
|
|
68
70
|
i18n?: string
|
|
69
71
|
}
|
package/package.json
CHANGED
|
@@ -38,8 +38,9 @@ const percentage = computed(() => {
|
|
|
38
38
|
return Math.round((100 / props.limit) * editor.value.storage.characterCount.characters())
|
|
39
39
|
})
|
|
40
40
|
const limitText = computed(() => {
|
|
41
|
-
const current = editor.value.storage.characterCount.characters()
|
|
42
|
-
|
|
41
|
+
const current = editor.value.storage.characterCount.characters().toLocaleString('en-US').replace(/,/g, ' ')
|
|
42
|
+
const limit = props.limit.toLocaleString('en-US').replace(/,/g, ' ')
|
|
43
|
+
return `${t('footer.limit')}<br>${current} / ${limit}`
|
|
43
44
|
})
|
|
44
45
|
|
|
45
46
|
function printStatusItemText(text: string): string {
|
|
@@ -69,7 +70,7 @@ function showFooter() {
|
|
|
69
70
|
:class="{
|
|
70
71
|
'character-count': true,
|
|
71
72
|
'character-count--alert': percentage > 75,
|
|
72
|
-
'character-count--warning': editor.storage.characterCount.characters()
|
|
73
|
+
'character-count--warning': editor.storage.characterCount.characters() >= limit,
|
|
73
74
|
}"
|
|
74
75
|
>
|
|
75
76
|
<circle r="8" cx="10" cy="10" fill="#e9ecef" />
|
|
@@ -92,7 +93,7 @@ function showFooter() {
|
|
|
92
93
|
</template>
|
|
93
94
|
<template v-for="statusItem in statusItems" :key="statusItem.text">
|
|
94
95
|
<span v-if="statusItem.enabled" class="tiptapify-footer--status-item">
|
|
95
|
-
{{ printStatusItemText(statusItem.text) }}: {{ statusItem.value }}
|
|
96
|
+
{{ printStatusItemText(statusItem.text) }}: {{ statusItem.value.toLocaleString('en-US').replace(/,/g, ' ') }}
|
|
96
97
|
</span>
|
|
97
98
|
|
|
98
99
|
<VDivider class="tiptapify-footer--divider" vertical />
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'vue'
|
|
2
2
|
import Tiptapify from '@tiptapify/components/Tiptapify.vue'
|
|
3
3
|
import TiptapifyDialog from '@tiptapify/components/UI/TiptapifyDialog.vue'
|
|
4
|
+
import { TiptapifyFooterAlignment } from '@tiptapify/types/editor'
|
|
4
5
|
|
|
5
6
|
import { Editor as TipTapEditor, nodeViewProps, NodeViewWrapper, VueNodeViewRenderer } from '@tiptap/vue-3'
|
|
6
7
|
import { Node, Mark, markInputRule, markPasteRule, mergeAttributes } from '@tiptap/core'
|
|
@@ -43,6 +44,7 @@ export {
|
|
|
43
44
|
mergeAttributes,
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
export type { TiptapifyFooterAlignment }
|
|
46
48
|
export type { CommandProps, InputRuleMatch, PasteRuleMatch }
|
|
47
49
|
export type {
|
|
48
50
|
TiptapifyAiMode,
|