@zipify/wysiwyg 3.1.2 → 4.0.0-vue3.0
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/.eslintrc.js +1 -1
- package/config/build/example.config.js +12 -2
- package/config/build/lib.config.js +10 -2
- package/config/jest/matchers/index.js +0 -2
- package/config/jest/setupTests.js +4 -7
- package/config/jest/typing.d.ts +1 -2
- package/dist/cli.js +2 -7
- package/dist/wysiwyg.css +153 -152
- package/dist/wysiwyg.mjs +3594 -3172
- package/example/example.js +34 -35
- package/jest.config.js +4 -1
- package/lib/Wysiwyg.vue +166 -190
- package/lib/__tests__/utils/buildTestExtensions.js +1 -1
- package/lib/components/base/Button.vue +31 -37
- package/lib/components/base/ButtonToggle.vue +11 -17
- package/lib/components/base/Checkbox.vue +14 -20
- package/lib/components/base/FieldLabel.vue +7 -11
- package/lib/components/base/Icon.vue +31 -43
- package/lib/components/base/Modal.vue +59 -74
- package/lib/components/base/NumberField.vue +65 -80
- package/lib/components/base/Range.vue +46 -56
- package/lib/components/base/ScrollView.vue +13 -21
- package/lib/components/base/TextField.vue +28 -33
- package/lib/components/base/__tests__/Button.test.js +1 -1
- package/lib/components/base/__tests__/Icon.test.js +1 -1
- package/lib/components/base/__tests__/Modal.test.js +21 -13
- package/lib/components/base/__tests__/Range.test.js +1 -1
- package/lib/components/base/__tests__/TextField.test.js +8 -7
- package/lib/components/base/colorPicker/ColorPicker.vue +33 -51
- package/lib/components/base/composables/__tests__/useDeselectionLock.test.js +4 -2
- package/lib/components/base/composables/__tests__/useModalToggler.test.js +3 -1
- package/lib/components/base/composables/__tests__/useScrollView.test.js +3 -1
- package/lib/components/base/dropdown/Dropdown.vue +35 -55
- package/lib/components/base/dropdown/DropdownActivator.vue +38 -66
- package/lib/components/base/dropdown/DropdownDivider.vue +0 -6
- package/lib/components/base/dropdown/DropdownGroup.vue +8 -20
- package/lib/components/base/dropdown/DropdownMenu.vue +8 -21
- package/lib/components/base/dropdown/DropdownOption.vue +27 -45
- package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +5 -3
- package/lib/components/base/dropdown/__tests__/DropdownOption.test.js +9 -7
- package/lib/components/toolbar/Toolbar.vue +26 -42
- package/lib/components/toolbar/__tests__/Toolbar.test.js +1 -1
- package/lib/components/toolbar/base/__tests__/ToolbarDivider.test.js +1 -1
- package/lib/components/toolbar/controls/AlignmentControl.vue +27 -46
- package/lib/components/toolbar/controls/BackgroundColorControl.vue +5 -26
- package/lib/components/toolbar/controls/CaseStyleControl.vue +10 -32
- package/lib/components/toolbar/controls/FontColorControl.vue +5 -27
- package/lib/components/toolbar/controls/FontFamilyControl.vue +27 -49
- package/lib/components/toolbar/controls/FontSizeControl.vue +9 -29
- package/lib/components/toolbar/controls/FontWeightControl.vue +7 -27
- package/lib/components/toolbar/controls/ItalicControl.vue +6 -27
- package/lib/components/toolbar/controls/LineHeightControl.vue +10 -37
- package/lib/components/toolbar/controls/ListControl.vue +18 -49
- package/lib/components/toolbar/controls/RemoveFormatControl.vue +4 -21
- package/lib/components/toolbar/controls/StrikeThroughControl.vue +5 -25
- package/lib/components/toolbar/controls/StylePresetControl.vue +34 -59
- package/lib/components/toolbar/controls/SuperscriptControl.vue +5 -25
- package/lib/components/toolbar/controls/UnderlineControl.vue +5 -26
- package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +15 -13
- package/lib/components/toolbar/controls/__tests__/BackgroundColorControl.test.js +17 -15
- package/lib/components/toolbar/controls/__tests__/CaseStyleControl.test.js +9 -8
- package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +17 -15
- package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +14 -12
- package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +5 -3
- package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +11 -9
- package/lib/components/toolbar/controls/__tests__/ListControl.test.js +16 -14
- package/lib/components/toolbar/controls/__tests__/RemoveFormatControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/StrikeThroughControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/StylePresetControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/SuperscriptControl.test.js +3 -1
- package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +3 -1
- package/lib/components/toolbar/controls/composables/__tests__/useRecentFonts.test.js +6 -4
- package/lib/components/toolbar/controls/link/LinkControl.vue +75 -108
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +8 -14
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +5 -3
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +3 -1
- package/lib/components/toolbar/controls/link/composables/__tests__/useLink.test.js +5 -4
- package/lib/components/toolbar/controls/link/destination/LinkControlDestination.vue +28 -47
- package/lib/components/toolbar/controls/link/destination/LinkControlPageBlock.vue +12 -20
- package/lib/components/toolbar/controls/link/destination/LinkControlUrl.vue +18 -26
- package/lib/components/toolbar/controls/link/destination/__tests__/LinkControlPageBlock.test.js +10 -10
- package/lib/components/toolbar/controls/link/destination/__tests__/LinkControlUrl.test.js +12 -10
- package/lib/components/toolbar/layouts/ToolbarDesktop.vue +36 -64
- package/lib/components/toolbar/layouts/ToolbarMobile.vue +38 -66
- package/lib/components/toolbar/layouts/ToolbarPopup.vue +36 -64
- package/lib/composables/__tests__/useEditor.test.js +3 -3
- package/lib/composables/useEditor.js +1 -1
- package/lib/directives/__tests__/outClick.test.js +9 -9
- package/lib/directives/outClick.js +3 -3
- package/lib/extensions/Alignment.js +1 -1
- package/lib/extensions/BackgroundColor.js +1 -1
- package/lib/extensions/CaseStyle.js +1 -1
- package/lib/extensions/DeviceManager.js +1 -1
- package/lib/extensions/FontColor.js +1 -1
- package/lib/extensions/FontFamily.js +2 -2
- package/lib/extensions/FontSize.js +3 -3
- package/lib/extensions/FontStyle.js +1 -1
- package/lib/extensions/FontWeight.js +1 -1
- package/lib/extensions/LineHeight.js +1 -1
- package/lib/extensions/Link.js +1 -1
- package/lib/extensions/Margin.js +1 -1
- package/lib/extensions/StylePreset.js +9 -9
- package/lib/extensions/Superscript.js +1 -1
- package/lib/extensions/TextDecoration.js +1 -1
- package/lib/extensions/__tests__/Alignment.test.js +1 -1
- package/lib/extensions/__tests__/BackgroundColor.test.js +1 -1
- package/lib/extensions/__tests__/CaseStyle.test.js +1 -1
- package/lib/extensions/__tests__/FontColor.test.js +1 -1
- package/lib/extensions/__tests__/FontFamily.test.js +1 -1
- package/lib/extensions/__tests__/FontSize.test.js +1 -1
- package/lib/extensions/__tests__/FontStyle.test.js +1 -1
- package/lib/extensions/__tests__/FontWeight.test.js +1 -1
- package/lib/extensions/__tests__/LineHeight.test.js +1 -1
- package/lib/extensions/__tests__/Link.test.js +1 -1
- package/lib/extensions/__tests__/StylePreset.test.js +1 -1
- package/lib/extensions/__tests__/Superscript.test.js +1 -1
- package/lib/extensions/__tests__/TextDecoration.test.js +1 -1
- package/lib/extensions/core/NodeProcessor.js +1 -1
- package/lib/extensions/core/SelectionProcessor.js +1 -1
- package/lib/extensions/core/TextProcessor.js +1 -1
- package/lib/extensions/core/__tests__/NodeProcessor.test.js +1 -1
- package/lib/extensions/core/__tests__/SelectionProcessor.test.js +1 -1
- package/lib/extensions/core/__tests__/TextProcessor.test.js +1 -1
- package/lib/extensions/core/index.js +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/extensions/list/List.js +4 -4
- package/lib/extensions/list/__tests__/List.test.js +1 -1
- package/package.json +19 -20
- package/config/jest/matchers/toVueEmpty.js +0 -16
- package/config/jest/matchers/toVuexActionHasBeenDispatched.js +0 -19
- package/lib/components/base/__tests__/__snapshots__/TextField.test.js.snap +0 -9
- package/lib/components/base/dropdown/__tests__/DropdownMenu.test.js +0 -67
|
@@ -17,36 +17,28 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script>
|
|
20
|
+
<script setup>
|
|
21
21
|
import { TextField, Checkbox } from '../../../../base';
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
props: {
|
|
29
|
-
href: {
|
|
30
|
-
type: String,
|
|
31
|
-
required: true
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
isTargetBlank: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
required: true
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
validator: {
|
|
40
|
-
type: Object,
|
|
41
|
-
required: true
|
|
42
|
-
}
|
|
23
|
+
defineProps({
|
|
24
|
+
href: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
43
27
|
},
|
|
44
28
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
isTargetBlank: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
48
33
|
|
|
49
|
-
|
|
34
|
+
validator: {
|
|
35
|
+
type: Object,
|
|
36
|
+
required: true
|
|
50
37
|
}
|
|
51
|
-
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits(['update-link', 'update-target']);
|
|
41
|
+
|
|
42
|
+
const updateLink = (value) => emit('update-link', value);
|
|
43
|
+
const updateTarget = (value) => emit('update-target', value);
|
|
52
44
|
</script>
|
package/lib/components/toolbar/controls/link/destination/__tests__/LinkControlPageBlock.test.js
CHANGED
|
@@ -6,19 +6,19 @@ import { Dropdown } from '../../../../../base';
|
|
|
6
6
|
|
|
7
7
|
function createComponent() {
|
|
8
8
|
return shallowMount(LinkControlPageBlock, {
|
|
9
|
-
|
|
9
|
+
props: {
|
|
10
10
|
value: 12
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
global: {
|
|
13
|
+
stubs: {
|
|
14
|
+
Dropdown: {
|
|
15
|
+
render: () => h('div'),
|
|
16
|
+
props: ['value']
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
provide: {
|
|
20
|
+
[InjectionTokens.PAGE_BLOCKS]: ref([{ id: 1 }, { id: 2 }])
|
|
17
21
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
provide: {
|
|
21
|
-
[InjectionTokens.PAGE_BLOCKS]: ref([{ id: 1 }, { id: 2 }])
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -5,21 +5,23 @@ import LinkControlUrl from '../LinkControlUrl';
|
|
|
5
5
|
|
|
6
6
|
function createComponent() {
|
|
7
7
|
return shallowMount(LinkControlUrl, {
|
|
8
|
-
|
|
8
|
+
props: {
|
|
9
9
|
validator: { error: ref({ value: null }) },
|
|
10
10
|
href: '',
|
|
11
11
|
isTargetBlank: false
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
global: {
|
|
15
|
+
stubs: {
|
|
16
|
+
TextField: {
|
|
17
|
+
render: () => h('div'),
|
|
18
|
+
props: ['value']
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
Checkbox: {
|
|
22
|
+
render: () => h('div'),
|
|
23
|
+
props: ['value']
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
});
|
|
@@ -1,52 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<ToolbarDivider vertical />
|
|
2
|
+
<ToolbarRow>
|
|
3
|
+
<StylePresetControl />
|
|
4
|
+
<ToolbarDivider vertical />
|
|
5
|
+
<FontFamilyControl />
|
|
6
|
+
<ToolbarDivider vertical />
|
|
7
|
+
<FontWeightControl />
|
|
8
|
+
<ToolbarDivider vertical />
|
|
9
|
+
<FontSizeControl />
|
|
10
|
+
<ToolbarDivider vertical />
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
<ToolbarGroup>
|
|
13
|
+
<FontColorControl />
|
|
14
|
+
<BackgroundColorControl />
|
|
15
|
+
</ToolbarGroup>
|
|
16
|
+
</ToolbarRow>
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
<ToolbarDivider horizontal />
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
<ToolbarRow>
|
|
21
|
+
<ToolbarGroup>
|
|
22
|
+
<ItalicControl />
|
|
23
|
+
<UnderlineControl />
|
|
24
|
+
<StrikeThroughControl />
|
|
25
|
+
<SuperscriptControl />
|
|
26
|
+
<CaseStyleControl />
|
|
27
|
+
</ToolbarGroup>
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
<ToolbarDivider vertical />
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<AlignmentControl />
|
|
32
|
+
<ToolbarDivider vertical />
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<LineHeightControl />
|
|
35
|
+
<ToolbarDivider vertical />
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
<ListControl />
|
|
38
|
+
<ToolbarDivider vertical />
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</div>
|
|
40
|
+
<ToolbarGroup>
|
|
41
|
+
<LinkControl />
|
|
42
|
+
<RemoveFormatControl />
|
|
43
|
+
</ToolbarGroup>
|
|
44
|
+
</ToolbarRow>
|
|
47
45
|
</template>
|
|
48
46
|
|
|
49
|
-
<script>
|
|
47
|
+
<script setup>
|
|
50
48
|
import { ToolbarDivider, ToolbarRow, ToolbarGroup } from '../base';
|
|
51
49
|
import {
|
|
52
50
|
StylePresetControl,
|
|
@@ -66,30 +64,4 @@ import {
|
|
|
66
64
|
RemoveFormatControl,
|
|
67
65
|
LinkControl
|
|
68
66
|
} from '../controls';
|
|
69
|
-
|
|
70
|
-
export default {
|
|
71
|
-
name: 'ToolbarDesktop',
|
|
72
|
-
|
|
73
|
-
components: {
|
|
74
|
-
ToolbarRow,
|
|
75
|
-
ToolbarGroup,
|
|
76
|
-
ToolbarDivider,
|
|
77
|
-
StylePresetControl,
|
|
78
|
-
CaseStyleControl,
|
|
79
|
-
FontFamilyControl,
|
|
80
|
-
FontWeightControl,
|
|
81
|
-
FontSizeControl,
|
|
82
|
-
FontColorControl,
|
|
83
|
-
BackgroundColorControl,
|
|
84
|
-
ItalicControl,
|
|
85
|
-
UnderlineControl,
|
|
86
|
-
SuperscriptControl,
|
|
87
|
-
StrikeThroughControl,
|
|
88
|
-
AlignmentControl,
|
|
89
|
-
LineHeightControl,
|
|
90
|
-
ListControl,
|
|
91
|
-
RemoveFormatControl,
|
|
92
|
-
LinkControl
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
67
|
</script>
|
|
@@ -1,57 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</ToolbarRow>
|
|
2
|
+
<ToolbarRow>
|
|
3
|
+
<StylePresetControl />
|
|
4
|
+
<ToolbarDivider vertical />
|
|
5
|
+
<FontFamilyControl />
|
|
6
|
+
<ToolbarDivider vertical />
|
|
7
|
+
<FontWeightControl />
|
|
8
|
+
</ToolbarRow>
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
<ToolbarDivider horizontal />
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
<ToolbarRow>
|
|
13
|
+
<FontSizeControl />
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
<ToolbarDivider vertical />
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
<ToolbarGroup>
|
|
18
|
+
<FontColorControl />
|
|
19
|
+
<BackgroundColorControl />
|
|
20
|
+
</ToolbarGroup>
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
<ToolbarDivider vertical />
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
<ToolbarGroup>
|
|
25
|
+
<ItalicControl />
|
|
26
|
+
<UnderlineControl />
|
|
27
|
+
<StrikeThroughControl />
|
|
28
|
+
<SuperscriptControl />
|
|
29
|
+
<CaseStyleControl />
|
|
30
|
+
</ToolbarGroup>
|
|
31
|
+
</ToolbarRow>
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
<ToolbarDivider horizontal />
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<ToolbarRow>
|
|
36
|
+
<AlignmentControl />
|
|
37
|
+
<ToolbarDivider vertical />
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
<LineHeightControl />
|
|
40
|
+
<ToolbarDivider vertical />
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
<ListControl />
|
|
43
|
+
<ToolbarDivider vertical />
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</div>
|
|
45
|
+
<ToolbarGroup>
|
|
46
|
+
<LinkControl />
|
|
47
|
+
<RemoveFormatControl />
|
|
48
|
+
</ToolbarGroup>
|
|
49
|
+
</ToolbarRow>
|
|
52
50
|
</template>
|
|
53
51
|
|
|
54
|
-
<script>
|
|
52
|
+
<script setup>
|
|
55
53
|
import { ToolbarDivider, ToolbarRow, ToolbarGroup } from '../base';
|
|
56
54
|
import {
|
|
57
55
|
StylePresetControl,
|
|
@@ -71,30 +69,4 @@ import {
|
|
|
71
69
|
RemoveFormatControl,
|
|
72
70
|
LinkControl
|
|
73
71
|
} from '../controls';
|
|
74
|
-
|
|
75
|
-
export default {
|
|
76
|
-
name: 'ToolbarMobile',
|
|
77
|
-
|
|
78
|
-
components: {
|
|
79
|
-
ToolbarRow,
|
|
80
|
-
ToolbarGroup,
|
|
81
|
-
ToolbarDivider,
|
|
82
|
-
StylePresetControl,
|
|
83
|
-
CaseStyleControl,
|
|
84
|
-
FontFamilyControl,
|
|
85
|
-
FontWeightControl,
|
|
86
|
-
FontSizeControl,
|
|
87
|
-
FontColorControl,
|
|
88
|
-
BackgroundColorControl,
|
|
89
|
-
ItalicControl,
|
|
90
|
-
UnderlineControl,
|
|
91
|
-
SuperscriptControl,
|
|
92
|
-
StrikeThroughControl,
|
|
93
|
-
AlignmentControl,
|
|
94
|
-
LineHeightControl,
|
|
95
|
-
ListControl,
|
|
96
|
-
RemoveFormatControl,
|
|
97
|
-
LinkControl
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
72
|
</script>
|
|
@@ -1,52 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<ToolbarDivider vertical />
|
|
2
|
+
<ToolbarRow>
|
|
3
|
+
<StylePresetControl />
|
|
4
|
+
<ToolbarDivider vertical />
|
|
5
|
+
<FontFamilyControl />
|
|
6
|
+
<ToolbarDivider vertical />
|
|
7
|
+
<FontWeightControl />
|
|
8
|
+
<ToolbarDivider vertical />
|
|
9
|
+
<FontSizeControl />
|
|
10
|
+
<ToolbarDivider vertical />
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
<ToolbarGroup>
|
|
13
|
+
<FontColorControl />
|
|
14
|
+
<BackgroundColorControl />
|
|
15
|
+
</ToolbarGroup>
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
<ToolbarDivider vertical />
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
<ToolbarGroup>
|
|
20
|
+
<ItalicControl />
|
|
21
|
+
<UnderlineControl />
|
|
22
|
+
<StrikeThroughControl />
|
|
23
|
+
<SuperscriptControl />
|
|
24
|
+
<CaseStyleControl />
|
|
25
|
+
</ToolbarGroup>
|
|
26
|
+
</ToolbarRow>
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
<ToolbarDivider horizontal />
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<ToolbarRow>
|
|
31
|
+
<AlignmentControl />
|
|
32
|
+
<ToolbarDivider vertical />
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<LineHeightControl />
|
|
35
|
+
<ToolbarDivider vertical />
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
<ListControl />
|
|
38
|
+
<ToolbarDivider vertical />
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</div>
|
|
40
|
+
<ToolbarGroup>
|
|
41
|
+
<LinkControl />
|
|
42
|
+
<RemoveFormatControl />
|
|
43
|
+
</ToolbarGroup>
|
|
44
|
+
</ToolbarRow>
|
|
47
45
|
</template>
|
|
48
46
|
|
|
49
|
-
<script>
|
|
47
|
+
<script setup>
|
|
50
48
|
import { ToolbarDivider, ToolbarRow, ToolbarGroup } from '../base';
|
|
51
49
|
import {
|
|
52
50
|
StylePresetControl,
|
|
@@ -66,30 +64,4 @@ import {
|
|
|
66
64
|
RemoveFormatControl,
|
|
67
65
|
LinkControl
|
|
68
66
|
} from '../controls';
|
|
69
|
-
|
|
70
|
-
export default {
|
|
71
|
-
name: 'ToolbarPopup',
|
|
72
|
-
|
|
73
|
-
components: {
|
|
74
|
-
ToolbarRow,
|
|
75
|
-
ToolbarGroup,
|
|
76
|
-
ToolbarDivider,
|
|
77
|
-
StylePresetControl,
|
|
78
|
-
CaseStyleControl,
|
|
79
|
-
FontFamilyControl,
|
|
80
|
-
FontWeightControl,
|
|
81
|
-
FontSizeControl,
|
|
82
|
-
FontColorControl,
|
|
83
|
-
BackgroundColorControl,
|
|
84
|
-
ItalicControl,
|
|
85
|
-
UnderlineControl,
|
|
86
|
-
SuperscriptControl,
|
|
87
|
-
StrikeThroughControl,
|
|
88
|
-
AlignmentControl,
|
|
89
|
-
LineHeightControl,
|
|
90
|
-
ListControl,
|
|
91
|
-
RemoveFormatControl,
|
|
92
|
-
LinkControl
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
67
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, ref, toRef } from 'vue';
|
|
2
|
-
import { EditorContent } from '@tiptap/vue-
|
|
2
|
+
import { EditorContent } from '@tiptap/vue-3';
|
|
3
3
|
import { shallowMount } from '@vue/test-utils';
|
|
4
4
|
import { buildTestExtensions } from '../../__tests__/utils';
|
|
5
5
|
import { useEditor } from '../useEditor';
|
|
@@ -35,7 +35,7 @@ const createContent = (text = 'test') => NodeFactory.doc([
|
|
|
35
35
|
|
|
36
36
|
function createComponent({ content } = {}) {
|
|
37
37
|
const wrapper = shallowMount(TestComponent, {
|
|
38
|
-
|
|
38
|
+
props: { value: content || createContent('test') }
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
return {
|
|
@@ -62,7 +62,7 @@ describe('life cycle', () => {
|
|
|
62
62
|
test('should destroy editor', () => {
|
|
63
63
|
const { wrapper, editor } = createComponent();
|
|
64
64
|
|
|
65
|
-
wrapper.
|
|
65
|
+
wrapper.unmount();
|
|
66
66
|
|
|
67
67
|
expect(editor.isDestroyed).toBe(true);
|
|
68
68
|
});
|
|
@@ -6,7 +6,7 @@ describe('out click', () => {
|
|
|
6
6
|
const el = document.createElement('div');
|
|
7
7
|
const onOutClick = jest.fn();
|
|
8
8
|
|
|
9
|
-
outClick.
|
|
9
|
+
outClick.mounted(el, { value: onOutClick });
|
|
10
10
|
await waitAsyncOperation();
|
|
11
11
|
|
|
12
12
|
document.dispatchEvent(new Event('click'));
|
|
@@ -19,7 +19,7 @@ describe('out click', () => {
|
|
|
19
19
|
const el = document.createElement('div');
|
|
20
20
|
const onOutClick = jest.fn();
|
|
21
21
|
|
|
22
|
-
outClick.
|
|
22
|
+
outClick.mounted(el, { value: onOutClick });
|
|
23
23
|
await waitAsyncOperation();
|
|
24
24
|
|
|
25
25
|
el.dispatchEvent(new Event('click'));
|
|
@@ -34,7 +34,7 @@ describe('out click', () => {
|
|
|
34
34
|
const onOutClick = jest.fn();
|
|
35
35
|
|
|
36
36
|
el.append(child);
|
|
37
|
-
outClick.
|
|
37
|
+
outClick.mounted(el, { value: onOutClick });
|
|
38
38
|
await waitAsyncOperation();
|
|
39
39
|
|
|
40
40
|
child.dispatchEvent(new Event('click'));
|
|
@@ -47,10 +47,10 @@ describe('out click', () => {
|
|
|
47
47
|
const el = document.createElement('div');
|
|
48
48
|
const onOutClick = jest.fn();
|
|
49
49
|
|
|
50
|
-
outClick.
|
|
50
|
+
outClick.mounted(el, { value: onOutClick });
|
|
51
51
|
await waitAsyncOperation();
|
|
52
52
|
|
|
53
|
-
outClick.
|
|
53
|
+
outClick.beforeUnmount(el);
|
|
54
54
|
|
|
55
55
|
document.dispatchEvent(new Event('click'));
|
|
56
56
|
await waitAsyncOperation();
|
|
@@ -62,10 +62,10 @@ describe('out click', () => {
|
|
|
62
62
|
const el = document.createElement('div');
|
|
63
63
|
const onOutClick = jest.fn();
|
|
64
64
|
|
|
65
|
-
outClick.
|
|
65
|
+
outClick.mounted(el, { value: { onOutClick, isDisabled: true } });
|
|
66
66
|
await waitAsyncOperation();
|
|
67
67
|
|
|
68
|
-
outClick.
|
|
68
|
+
outClick.updated(el, { value: { isDisabled: false } });
|
|
69
69
|
await waitAsyncOperation();
|
|
70
70
|
|
|
71
71
|
document.dispatchEvent(new Event('click'));
|
|
@@ -78,10 +78,10 @@ describe('out click', () => {
|
|
|
78
78
|
const el = document.createElement('div');
|
|
79
79
|
const onOutClick = jest.fn();
|
|
80
80
|
|
|
81
|
-
outClick.
|
|
81
|
+
outClick.mounted(el, { value: { onOutClick, isDisabled: false } });
|
|
82
82
|
await waitAsyncOperation();
|
|
83
83
|
|
|
84
|
-
outClick.
|
|
84
|
+
outClick.updated(el, { value: { isDisabled: true } });
|
|
85
85
|
await waitAsyncOperation();
|
|
86
86
|
|
|
87
87
|
document.dispatchEvent(new Event('click'));
|
|
@@ -14,7 +14,7 @@ function toggleListener(toEnable, onClick) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const outClick = {
|
|
17
|
-
|
|
17
|
+
mounted(el, { value }) {
|
|
18
18
|
const onOutClick = value.onOutClick || value;
|
|
19
19
|
const isEnabled = !value.isDisabled;
|
|
20
20
|
|
|
@@ -33,7 +33,7 @@ export const outClick = {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
updated(el, { value }) {
|
|
37
37
|
const data = dataStorage.get(el);
|
|
38
38
|
const isEnabled = !value.isDisabled;
|
|
39
39
|
|
|
@@ -44,7 +44,7 @@ export const outClick = {
|
|
|
44
44
|
dataStorage.set(el, { callback: data.callback, isEnabled });
|
|
45
45
|
},
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
beforeUnmount(el) {
|
|
48
48
|
toggleListener(false, dataStorage.get(el).callback);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/vue-
|
|
1
|
+
import { Extension } from '@tiptap/vue-3';
|
|
2
2
|
import { computed, unref } from 'vue';
|
|
3
3
|
import { convertAlignment, createCommand, createKeyboardShortcut, renderInlineSetting } from '../utils';
|
|
4
4
|
import { Alignments, NodeTypes, TextSettings } from '../enums';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mark } from '@tiptap/vue-
|
|
1
|
+
import { Mark } from '@tiptap/vue-3';
|
|
2
2
|
import { computed, unref } from 'vue';
|
|
3
3
|
import { createCommand, renderMark } from '../utils';
|
|
4
4
|
import { MarkGroups, TextSettings } from '../enums';
|
|
@@ -42,7 +42,7 @@ export const FontFamily = Mark.create({
|
|
|
42
42
|
}),
|
|
43
43
|
|
|
44
44
|
findFontByName: createCommand((_, name) => {
|
|
45
|
-
return this.options.fonts.find((font) => font.name === name);
|
|
45
|
+
return unref(this.options.fonts).find((font) => font.name === name);
|
|
46
46
|
}),
|
|
47
47
|
|
|
48
48
|
getFontFamily: createCommand(({ commands }) => {
|