@zipify/wysiwyg 1.0.0-dev.38 → 1.0.0-dev.40
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/.editorconfig +1 -1
- package/.eslintrc.js +2 -2
- package/.lintstagedrc +1 -1
- package/.stylelintrc +0 -4
- package/README.md +2 -2
- package/config/jest/setupTests.js +0 -3
- package/config/vite/lib.config.js +25 -0
- package/config/vite/settings.js +9 -0
- package/config/webpack/lib.config.js +5 -0
- package/dist/style.css +1 -0
- package/dist/wysiwyg.mjs +18198 -0
- package/example/ExampleApp.vue +1 -1
- package/example/example.js +0 -3
- package/lib/Wysiwyg.vue +1 -1
- package/lib/__tests__/utils/withComponentContext.js +1 -1
- package/lib/components/base/Button.vue +1 -1
- package/lib/components/base/Icon.vue +1 -1
- package/lib/components/base/Modal.vue +1 -1
- package/lib/components/base/NumberField.vue +2 -2
- package/lib/components/base/Range.vue +1 -1
- package/lib/components/base/ScrollView.vue +2 -2
- package/lib/components/base/TextField.vue +2 -2
- package/lib/components/base/__tests__/Modal.test.js +8 -2
- package/lib/components/base/colorPicker/ColorPicker.vue +1 -1
- package/lib/components/base/colorPicker/composables/__tests__/usePickerApi.test.js +1 -1
- package/lib/components/base/colorPicker/composables/usePickerApi.js +1 -1
- package/lib/components/base/colorPicker/composables/usePickerHotkeys.js +1 -1
- package/lib/components/base/composables/__tests__/useActivatedListener.test.js +1 -1
- package/lib/components/base/composables/__tests__/useDeselectionLock.test.js +1 -1
- package/lib/components/base/composables/__tests__/useElementRef.test.js +1 -1
- package/lib/components/base/composables/__tests__/useModalToggler.test.js +1 -1
- package/lib/components/base/composables/__tests__/useNumberValue.test.js +1 -1
- package/lib/components/base/composables/__tests__/useScrollView.test.js +1 -1
- package/lib/components/base/composables/__tests__/useTempValue.test.js +1 -1
- package/lib/components/base/composables/useActivatedListener.js +1 -1
- package/lib/components/base/composables/useDeselectionLock.js +1 -1
- package/lib/components/base/composables/useElementRef.js +1 -1
- package/lib/components/base/composables/useModalToggler.js +1 -1
- package/lib/components/base/composables/useScrollView.js +1 -1
- package/lib/components/base/composables/useTempValue.js +1 -1
- package/lib/components/base/composables/useValidator.js +1 -1
- package/lib/components/base/dropdown/Dropdown.vue +1 -1
- package/lib/components/base/dropdown/DropdownActivator.vue +1 -1
- package/lib/components/base/dropdown/DropdownGroup.vue +1 -1
- package/lib/components/base/dropdown/DropdownMenu.vue +1 -1
- package/lib/components/base/dropdown/DropdownOption.vue +2 -2
- package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +1 -1
- package/lib/components/base/dropdown/__tests__/DropdownMenu.test.js +1 -1
- package/lib/components/base/dropdown/__tests__/DropdownOption.test.js +1 -1
- package/lib/components/base/dropdown/composables/__tests__/useActiveOptionManager.test.js +1 -1
- package/lib/components/base/dropdown/composables/__tests__/useDropdownEntityTitle.test.js +1 -1
- package/lib/components/base/dropdown/composables/useActiveOptionManager.js +1 -1
- package/lib/components/base/dropdown/composables/useDropdownEntityTitle.js +1 -1
- package/lib/components/toolbar/Toolbar.vue +1 -1
- package/lib/components/toolbar/ToolbarDivider.vue +1 -1
- package/lib/components/toolbar/__tests__/Toolbar.test.js +3 -2
- package/lib/components/toolbar/controls/AlignmentControl.vue +1 -1
- package/lib/components/toolbar/controls/AlignmentDeviceControl.vue +1 -1
- package/lib/components/toolbar/controls/BackgroundColorControl.vue +1 -1
- package/lib/components/toolbar/controls/CaseStyleControl.vue +1 -1
- package/lib/components/toolbar/controls/FontColorControl.vue +1 -1
- package/lib/components/toolbar/controls/FontFamilyControl.vue +1 -1
- package/lib/components/toolbar/controls/FontSizeControl.vue +1 -1
- package/lib/components/toolbar/controls/FontWeightControl.vue +1 -1
- package/lib/components/toolbar/controls/ItalicControl.vue +1 -1
- package/lib/components/toolbar/controls/LineHeightControl.vue +1 -1
- package/lib/components/toolbar/controls/ListControl.vue +1 -1
- package/lib/components/toolbar/controls/RemoveFormatControl.vue +1 -1
- package/lib/components/toolbar/controls/StrikeThroughControl.vue +1 -1
- package/lib/components/toolbar/controls/StylePresetControl.vue +1 -1
- package/lib/components/toolbar/controls/SuperscriptControl.vue +1 -1
- package/lib/components/toolbar/controls/UnderlineControl.vue +1 -1
- package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/AlignmentDeviceControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/BackgroundColorControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/CaseStyleControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/ListControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/StrikeThroughControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/StylePresetControl.test.js +1 -1
- package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +1 -1
- package/lib/components/toolbar/controls/composables/useRecentFonts.js +1 -1
- package/lib/components/toolbar/controls/link/LinkControl.vue +1 -1
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +1 -1
- package/lib/components/toolbar/controls/link/composables/useLink.js +1 -1
- package/lib/components/toolbar/controls/link/destination/LinkControlDestination.vue +1 -1
- package/lib/components/toolbar/controls/link/destination/LinkControlPageBlock.vue +1 -1
- package/lib/composables/__tests__/useEditor.test.js +1 -1
- package/lib/composables/useEditor.js +1 -1
- package/lib/extensions/Alignment.js +1 -1
- package/lib/extensions/BackgroundColor.js +1 -1
- package/lib/extensions/DeviceManager.js +2 -5
- package/lib/extensions/FontColor.js +1 -1
- package/lib/extensions/FontFamily.js +1 -1
- package/lib/extensions/FontSize.js +1 -1
- package/lib/extensions/FontStyle.js +1 -1
- package/lib/extensions/FontWeight.js +1 -1
- package/lib/extensions/LineHeight.js +1 -1
- package/lib/extensions/StylePreset.js +4 -11
- package/lib/extensions/TextDecoration.js +1 -1
- package/lib/extensions/__tests__/Alignment.test.js +2 -2
- package/lib/extensions/__tests__/BackgroundColor.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 +2 -2
- 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 +2 -2
- package/lib/extensions/__tests__/StylePreset.test.js +1 -2
- package/lib/extensions/__tests__/TextDecoration.test.js +1 -1
- package/lib/extensions/core/NodeProcessor.js +1 -1
- package/lib/extensions/index.js +2 -2
- package/lib/extensions/list/List.js +1 -1
- package/lib/extensions/list/__tests__/List.test.js +2 -3
- package/lib/index.js +0 -1
- package/lib/services/__tests__/FavoriteColors.test.js +1 -1
- package/lib/utils/importIcon.js +7 -6
- package/package.json +8 -6
- package/dist/wysiwyg.css +0 -1118
- package/dist/wysiwyg.js +0 -2
- package/dist/wysiwyg.js.LICENSE.txt +0 -1
- package/lib/WysiwygPlugin.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref, h, nextTick } from '
|
|
2
|
+
import { ref, h, nextTick } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Alignments } from '../../../../enums';
|
|
5
5
|
import { Button, Icon, Modal } from '../../../base';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h, ref } from '
|
|
2
|
+
import { h, ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { ColorPicker } from '../../../base';
|
|
5
5
|
import BackgroundColorControl from '../BackgroundColorControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h } from '
|
|
2
|
+
import { h } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Dropdown } from '../../../base';
|
|
5
5
|
import CaseStyleControl from '../CaseStyleControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h, ref } from '
|
|
2
|
+
import { h, ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { ColorPicker } from '../../../base';
|
|
5
5
|
import FontColorControl from '../FontColorControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h, ref } from '
|
|
2
|
+
import { h, ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Dropdown } from '../../../base';
|
|
5
5
|
import FontFamilyControl from '../FontFamilyControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Dropdown } from '../../../base';
|
|
5
5
|
import FontSizeControl from '../FontSizeControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Dropdown } from '../../../base';
|
|
5
5
|
import FontWeightControl from '../FontWeightControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Button } from '../../../base';
|
|
5
5
|
import ItalicControl from '../ItalicControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h, nextTick, ref } from '
|
|
2
|
+
import { h, nextTick, ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Button, Modal, NumberField, Range } from '../../../base';
|
|
5
5
|
import LineHeightControl from '../LineHeightControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { h, ref } from '
|
|
2
|
+
import { h, ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Dropdown, Icon } from '../../../base';
|
|
5
5
|
import ListControl from '../ListControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Button } from '../../../base';
|
|
5
5
|
import StrikeThroughControl from '../StrikeThroughControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Button, Dropdown } from '../../../base';
|
|
5
5
|
import StylePresetControl from '../StylePresetControl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
4
4
|
import { Button } from '../../../base';
|
|
5
5
|
import UnderlineControl from '../UnderlineControl';
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
|
-
import { computed, ref, inject } from '
|
|
34
|
+
import { computed, ref, inject } from 'vue';
|
|
35
35
|
import { InjectionTokens } from '../../../../injectionTokens';
|
|
36
36
|
import { tooltip } from '../../../../directives';
|
|
37
37
|
import { useValidator } from '../../../base/composables';
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script>
|
|
42
|
-
import { computed, toRef } from '
|
|
42
|
+
import { computed, toRef } from 'vue';
|
|
43
43
|
import { LinkDestinations, LinkTargets } from '../../../../../enums';
|
|
44
44
|
import { Dropdown, DropdownOption, FieldLabel } from '../../../../base';
|
|
45
45
|
import LinkControlPageBlock from './LinkControlPageBlock';
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script>
|
|
25
|
-
import { inject } from '
|
|
25
|
+
import { inject } from 'vue';
|
|
26
26
|
import { FieldLabel, DropdownOption, Dropdown } from '../../../../base';
|
|
27
27
|
import { InjectionTokens } from '../../../../../injectionTokens';
|
|
28
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/vue-2';
|
|
2
|
-
import { onUnmounted, watch, reactive } from '
|
|
2
|
+
import { onUnmounted, watch, reactive } from 'vue';
|
|
3
3
|
import { ContentNormalizer } from '../services';
|
|
4
4
|
|
|
5
5
|
export function useEditor({ content, onChange, extensions }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { computed } from '
|
|
2
|
+
import { computed } from 'vue';
|
|
3
3
|
import { createCommand, createKeyboardShortcut, renderInlineSetting } from '../utils';
|
|
4
4
|
import { Alignments, NodeTypes, TextSettings } from '../enums';
|
|
5
5
|
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
+
import { toRef } from 'vue';
|
|
1
2
|
import { Extension } from '@tiptap/vue-2';
|
|
2
3
|
import { createCommand } from '../utils';
|
|
3
4
|
|
|
4
5
|
export const DeviceManager = Extension.create({
|
|
5
6
|
name: 'device_manager',
|
|
6
7
|
|
|
7
|
-
addOptions: () => ({
|
|
8
|
-
deviceRef: null
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
8
|
addCommands() {
|
|
12
9
|
return {
|
|
13
|
-
getDevice: createCommand(() => this.options
|
|
10
|
+
getDevice: createCommand(() => toRef(this.options, 'device'))
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
13
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { computed } from '
|
|
2
|
+
import { computed } from 'vue';
|
|
3
3
|
import { createCommand, renderInlineSetting } from '../utils';
|
|
4
4
|
import { NodeTypes, TextSettings } from '../enums';
|
|
5
5
|
import { ContextWindow } from '../services';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { computed, toRef } from '
|
|
2
|
+
import { computed, toRef } from 'vue';
|
|
3
3
|
import { Heading } from '@tiptap/extension-heading';
|
|
4
4
|
import { createCommand } from '../utils';
|
|
5
5
|
import { Devices, NodeTypes, TextSettings } from '../enums';
|
|
@@ -21,13 +21,6 @@ export const StylePreset = Extension.create({
|
|
|
21
21
|
})
|
|
22
22
|
],
|
|
23
23
|
|
|
24
|
-
addOptions: () => ({
|
|
25
|
-
presetsRef: null,
|
|
26
|
-
defaultId: null,
|
|
27
|
-
baseClass: null,
|
|
28
|
-
makeVariable: null
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
24
|
addStorage: () => ({
|
|
32
25
|
presetStyleEl: null
|
|
33
26
|
}),
|
|
@@ -42,7 +35,7 @@ export const StylePreset = Extension.create({
|
|
|
42
35
|
default: { id: this.options.defaultId },
|
|
43
36
|
|
|
44
37
|
parseHTML: (element) => {
|
|
45
|
-
const presets = this.options.
|
|
38
|
+
const presets = this.options.presets;
|
|
46
39
|
|
|
47
40
|
if (element.parentElement.tagName === 'LI') return null;
|
|
48
41
|
|
|
@@ -79,7 +72,7 @@ export const StylePreset = Extension.create({
|
|
|
79
72
|
|
|
80
73
|
return {
|
|
81
74
|
getPresetList: createCommand(() => computed(() => {
|
|
82
|
-
return this.options.
|
|
75
|
+
return this.options.presets.filter((preset) => !preset.hidden);
|
|
83
76
|
})),
|
|
84
77
|
|
|
85
78
|
getPreset: createCommand(({ commands }) => {
|
|
@@ -175,7 +168,7 @@ export const StylePreset = Extension.create({
|
|
|
175
168
|
this.storage.presetStyleEl = ContextWindow.document.createElement('style');
|
|
176
169
|
this.storage.presetStyleEl.dataset.zwStyles = '';
|
|
177
170
|
|
|
178
|
-
for (const preset of this.options.
|
|
171
|
+
for (const preset of this.options.presets) {
|
|
179
172
|
const className = makePresetClass(this.options.baseClass, preset);
|
|
180
173
|
const css = [` ${className} {`];
|
|
181
174
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { Alignment } from '../Alignment';
|
|
@@ -27,7 +27,7 @@ function createEditor({ content }) {
|
|
|
27
27
|
content: ContentNormalizer.normalize(content),
|
|
28
28
|
extensions: buildCoreExtensions().concat(
|
|
29
29
|
MockStylePreset,
|
|
30
|
-
DeviceManager.configure({
|
|
30
|
+
DeviceManager.configure({ device: ref('desktop') }),
|
|
31
31
|
Alignment
|
|
32
32
|
)
|
|
33
33
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { BackgroundColor } from '../BackgroundColor';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { FontColor } from '../FontColor';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { FontSize } from '../FontSize';
|
|
@@ -27,7 +27,7 @@ function createEditor({ content }) {
|
|
|
27
27
|
extensions: buildCoreExtensions().concat(
|
|
28
28
|
MockStylePreset,
|
|
29
29
|
DeviceManager.configure({
|
|
30
|
-
|
|
30
|
+
device: ref('desktop')
|
|
31
31
|
}),
|
|
32
32
|
FontSize.configure({
|
|
33
33
|
minSize: 5,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { FontStyle } from '../FontStyle';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { DeviceManager } from '../DeviceManager';
|
|
@@ -26,7 +26,7 @@ function createEditor({ content }) {
|
|
|
26
26
|
content: ContentNormalizer.normalize(content),
|
|
27
27
|
extensions: buildCoreExtensions().concat(
|
|
28
28
|
MockStylePreset,
|
|
29
|
-
DeviceManager.configure({
|
|
29
|
+
DeviceManager.configure({ device: ref('desktop') }),
|
|
30
30
|
LineHeight
|
|
31
31
|
)
|
|
32
32
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Editor, Extension, Mark } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '@vue/composition-api';
|
|
3
2
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
3
|
import { StylePreset } from '../StylePreset';
|
|
5
4
|
import { List } from '../list';
|
|
@@ -111,7 +110,7 @@ function createEditor({ content, presets, defaultId }) {
|
|
|
111
110
|
|
|
112
111
|
extensions: buildCoreExtensions().concat(
|
|
113
112
|
StylePreset.configure({
|
|
114
|
-
|
|
113
|
+
presets: presets,
|
|
115
114
|
baseClass: 'zw ts-',
|
|
116
115
|
defaultId,
|
|
117
116
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, Extension } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { NodeFactory } from '../../__tests__/utils';
|
|
4
4
|
import { createCommand } from '../../utils';
|
|
5
5
|
import { TextDecoration } from '../TextDecoration';
|
package/lib/extensions/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export function buildExtensions(options) {
|
|
|
21
21
|
|
|
22
22
|
return buildCoreExtensions(options).concat([
|
|
23
23
|
StylePreset.configure({
|
|
24
|
-
|
|
24
|
+
presets: options.presetsRef,
|
|
25
25
|
defaultId: options.defaultPresetId,
|
|
26
26
|
baseClass: options.basePresetClass,
|
|
27
27
|
makeVariable: options.makePresetVariable
|
|
@@ -30,7 +30,7 @@ export function buildExtensions(options) {
|
|
|
30
30
|
baseClass: options.baseListClass
|
|
31
31
|
}),
|
|
32
32
|
DeviceManager.configure({
|
|
33
|
-
|
|
33
|
+
device: options.deviceRef
|
|
34
34
|
}),
|
|
35
35
|
FontFamily.configure({
|
|
36
36
|
fonts: options.fonts,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, wrappingInputRule } from '@tiptap/vue-2';
|
|
2
|
-
import { computed } from '
|
|
2
|
+
import { computed } from 'vue';
|
|
3
3
|
import { createCommand } from '../../utils';
|
|
4
4
|
import { ListTypes, NodeTypes } from '../../enums';
|
|
5
5
|
import { ListItem } from './ListItem';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/vue-2';
|
|
2
|
-
import { ref } from '@vue/composition-api';
|
|
3
2
|
import { NodeFactory } from '../../../__tests__/utils';
|
|
4
3
|
import { ListTypes } from '../../../enums';
|
|
5
4
|
import { StylePreset } from '../../StylePreset';
|
|
@@ -16,7 +15,7 @@ function createEditor({ content }) {
|
|
|
16
15
|
baseClass: 'zw-list--'
|
|
17
16
|
}),
|
|
18
17
|
StylePreset.configure({
|
|
19
|
-
|
|
18
|
+
presets: [
|
|
20
19
|
{
|
|
21
20
|
id: 'regular-1',
|
|
22
21
|
common: {},
|
|
@@ -24,7 +23,7 @@ function createEditor({ content }) {
|
|
|
24
23
|
tablet: {},
|
|
25
24
|
desktop: {}
|
|
26
25
|
}
|
|
27
|
-
]
|
|
26
|
+
],
|
|
28
27
|
defaultId: 'regular-1',
|
|
29
28
|
baseClass: 'zw ts-'
|
|
30
29
|
})
|
package/lib/index.js
CHANGED
package/lib/utils/importIcon.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
const importFile = require.context('../assets/icons', true, /\.svg/);
|
|
1
|
+
const modules = import.meta.glob('../assets/icons/*.svg', { as: 'raw', eager: true });
|
|
3
2
|
|
|
4
3
|
export function importIcon(name) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const icon = modules[`../assets/icons/${name}.svg`];
|
|
5
|
+
|
|
6
|
+
if (!icon) {
|
|
8
7
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.warn(
|
|
8
|
+
console.warn(`[WSWG] Cannot resolve ${name} icon`);
|
|
10
9
|
return '';
|
|
11
10
|
}
|
|
11
|
+
|
|
12
|
+
return icon;
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipify/wysiwyg",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.40",
|
|
4
4
|
"description": "Zipify modification of TipTap text editor",
|
|
5
5
|
"main": "dist/wysiwyg.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/ZipifyApps/ZipifyWysiwyg/issues"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"lib:build": "
|
|
17
|
+
"lib:build": "vite build --config ./config/vite/lib.config.js",
|
|
18
18
|
"example:start": "NODE_ENV=development webpack serve --config ./config/webpack/example.config.js",
|
|
19
19
|
"example:build": "NODE_ENV=production webpack --config ./config/webpack/example.config.js",
|
|
20
20
|
"test:unit": "jest .",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@tiptap/extension-superscript": "^2.0.0-beta.13",
|
|
37
37
|
"@tiptap/extension-text": "^2.0.0-beta.17",
|
|
38
38
|
"@tiptap/vue-2": "^2.0.0-beta.84",
|
|
39
|
-
"@vue/composition-api": "^1.7.0",
|
|
40
39
|
"simplebar": "^5.3.8"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
42
|
+
"vue": "2.7.*",
|
|
43
43
|
"zipify-colorpicker": "*"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -68,9 +68,11 @@
|
|
|
68
68
|
"style-loader": "^3.3.1",
|
|
69
69
|
"stylelint": "^14.9.1",
|
|
70
70
|
"svgo": "^2.8.0",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"vue
|
|
71
|
+
"vite": "^3.0.4",
|
|
72
|
+
"vite-plugin-vue2": "^2.0.2",
|
|
73
|
+
"vue": "^2.7.8",
|
|
74
|
+
"vue-loader": "^15.10.0",
|
|
75
|
+
"vue-template-compiler": "^2.7.8",
|
|
74
76
|
"webpack": "^5.74.0",
|
|
75
77
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
76
78
|
"webpack-cli": "^4.10.0",
|