tiptapify 0.0.14 → 0.0.15
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 +12409 -12462
- package/dist/tiptapify.umd.js +35 -35
- package/package.json +1 -1
- package/src/components/Tiptapify.vue +25 -31
- package/src/components/Toolbar/Items.vue +0 -2
- package/src/components/Toolbar/items.ts +1 -6
- package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +1 -1
- package/src/types/toolbarItems.ts +0 -2
- package/src/components/Toolbar/Toggle.vue +0 -30
package/package.json
CHANGED
|
@@ -74,37 +74,31 @@ onBeforeUnmount(() => {
|
|
|
74
74
|
</script>
|
|
75
75
|
|
|
76
76
|
<template>
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<Footer :show-words-count="showWordsCount" :show-characters-count="showCharactersCount" />
|
|
104
|
-
</div>
|
|
105
|
-
</VCol>
|
|
106
|
-
</VRow>
|
|
107
|
-
</VContainer>
|
|
77
|
+
<template v-if="toolbar">
|
|
78
|
+
<Toolbar
|
|
79
|
+
v-if="editor"
|
|
80
|
+
:variant-btn="variantBtn"
|
|
81
|
+
:variant-field="variantField"
|
|
82
|
+
:font-measure="fontMeasure"
|
|
83
|
+
:items="items"
|
|
84
|
+
:items-exclude="itemsExclude"
|
|
85
|
+
:rounded="rounded"
|
|
86
|
+
:custom-extensions="customExtensions"
|
|
87
|
+
:theme="currentTheme"
|
|
88
|
+
/>
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
<div :class="`border border-t-0 rounded-b-${rounded}`">
|
|
92
|
+
<div class="pa-2 tiptapify-container resizable" :style="`${height > 0 ? `height: ${height}px` : ''}`">
|
|
93
|
+
<MenuFloating v-if="floatingMenu" :variant="variantBtn" :theme="currentTheme" />
|
|
94
|
+
|
|
95
|
+
<MenuBubble v-if="bubbleMenu" :variant="variantBtn" :theme="currentTheme" />
|
|
96
|
+
|
|
97
|
+
<EditorContent :editor="editor" class="tiptapify-editor" />
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<Footer :show-words-count="showWordsCount" :show-characters-count="showCharactersCount" />
|
|
101
|
+
</div>
|
|
108
102
|
</template>
|
|
109
103
|
|
|
110
104
|
<style scoped lang="scss">
|
|
@@ -19,8 +19,6 @@ const toolbarItemsRef: Ref<ToolbarItemSections> = ref(computed(() => props.items
|
|
|
19
19
|
<template v-for="(toolbarSection, sectionKey) in toolbarItemsRef" :key="sectionKey">
|
|
20
20
|
<Group v-if="toolbarSection.group" :variant="variantBtn" :toolbar-section="toolbarSection" />
|
|
21
21
|
|
|
22
|
-
<Toggle v-else-if="toolbarSection.toggle" :variant="variantBtn" :toolbar-section="toolbarSection" />
|
|
23
|
-
|
|
24
22
|
<VBtn
|
|
25
23
|
v-else
|
|
26
24
|
v-for="(toolbarItem, itemKey) in toolbarSection.items"
|
|
@@ -28,16 +28,11 @@ export function toolbarItems(
|
|
|
28
28
|
const mediaItems = ref(useMediaItems())
|
|
29
29
|
|
|
30
30
|
const allMenuItems: ToolbarItemSections = {
|
|
31
|
-
/**
|
|
32
|
-
* todo
|
|
33
|
-
*
|
|
34
|
-
* media (video)
|
|
35
|
-
*/
|
|
36
31
|
style: { group: true, items: styleItems.value },
|
|
37
32
|
format: { group: true, items: formatItems.value },
|
|
38
33
|
format_extra: { group: true, items: formatExtraItems.value },
|
|
39
34
|
media: { group: true, items: mediaItems.value },
|
|
40
|
-
alignment: {
|
|
35
|
+
alignment: { group: true, items: alignmentItems.value },
|
|
41
36
|
list: { group: true, items: listItems.value },
|
|
42
37
|
actions: { group: true, items: actionsItems.value },
|
|
43
38
|
misc: { group: true, items: miscItems.value },
|
|
@@ -10,7 +10,7 @@ export function useInvisibleCharacters() {
|
|
|
10
10
|
name: 'show/hide invisible characters',
|
|
11
11
|
tooltip: computed(() => t('misc.toggleInvisibleCharacters')),
|
|
12
12
|
svg: true,
|
|
13
|
-
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M256 64L512 64C529.7 64 544 78.3 544 96C544 113.7 529.7 128 512 128L480 128L480 544C480 561.7 465.7 576 448 576C430.3 576 416 561.7 416 544L416 128L368 128L368 544C368 561.7 353.7 576 336 576C318.3 576 304 561.7 304 544L304 384L256 384C167.6 384 96 312.4 96 224C96 135.6 167.6 64 256 64z"/></svg>`,
|
|
13
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path fill="currentColor" d="M256 64L512 64C529.7 64 544 78.3 544 96C544 113.7 529.7 128 512 128L480 128L480 544C480 561.7 465.7 576 448 576C430.3 576 416 561.7 416 544L416 128L368 128L368 544C368 561.7 353.7 576 336 576C318.3 576 304 561.7 304 544L304 384L256 384C167.6 384 96 312.4 96 224C96 135.6 167.6 64 256 64z"/></svg>`,
|
|
14
14
|
enabled: true,
|
|
15
15
|
props: {
|
|
16
16
|
color: computed(() => editor.value.storage.invisibleCharacters.visibility() ? 'primary' : ''),
|
|
@@ -20,7 +20,6 @@ export type ToolbarItem = {
|
|
|
20
20
|
component?: any,
|
|
21
21
|
modelValue?: any,
|
|
22
22
|
group?: boolean,
|
|
23
|
-
toggle?: boolean,
|
|
24
23
|
icon2Props?: ToolbarItemProps,
|
|
25
24
|
componentProps?: ToolbarItemProps,
|
|
26
25
|
props?: ToolbarItemProps,
|
|
@@ -34,7 +33,6 @@ export type ToolbarItems = {
|
|
|
34
33
|
|
|
35
34
|
export type ToolbarItemSection = {
|
|
36
35
|
group?: boolean,
|
|
37
|
-
toggle?: boolean,
|
|
38
36
|
items: ToolbarItems | {},
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineProps, inject, PropType } from 'vue'
|
|
3
|
-
import * as mdi from '@mdi/js'
|
|
4
|
-
|
|
5
|
-
import { ToolbarItemSection } from "@tiptapify/components/Toolbar/items";
|
|
6
|
-
|
|
7
|
-
defineProps({
|
|
8
|
-
variant: { type: String, default () { return 'flat' }},
|
|
9
|
-
toolbarSection: { type: Object as PropType<ToolbarItemSection>, default() { return {} }}
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
13
|
-
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<VBtnToggle :variant="variant" elevation="4">
|
|
18
|
-
<template v-for="(item, key) in toolbarSection.items" :key="key">
|
|
19
|
-
<VBtn v-bind="item.props" v-on="item.attrs" size="32">
|
|
20
|
-
<VTooltip :text="item.name" location="top" activator="parent" />
|
|
21
|
-
|
|
22
|
-
<VIcon :icon="item.icon || `mdiSvg:${mdi.mdiImageBrokenVariant}`" size="small" />
|
|
23
|
-
</VBtn>
|
|
24
|
-
</template>
|
|
25
|
-
</VBtnToggle>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<style lang="scss" scoped>
|
|
29
|
-
|
|
30
|
-
</style>
|