@zipify/wysiwyg 3.4.1-dev → 3.5.0-ai-prototype
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/.release-it.json +1 -2
- package/dist/cli.js +3 -3
- package/dist/wysiwyg.css +190 -10
- package/dist/wysiwyg.mjs +4890 -2327
- package/example/ExampleApp.vue +5 -1
- package/example/aiAdapter.js +21 -0
- package/lib/Wysiwyg.vue +11 -2
- package/lib/assets/icons/loading.svg +11 -0
- package/lib/assets/icons/send.svg +3 -0
- package/lib/assets/icons/sparkles.svg +3 -0
- package/lib/components/base/TextArea.vue +108 -0
- package/lib/components/base/index.js +1 -0
- package/lib/components/floatingMenu/AiWidgetSuggestionItem.vue +74 -0
- package/lib/components/floatingMenu/FloatingMenuControl.vue +204 -0
- package/lib/components/floatingMenu/index.js +1 -0
- package/lib/components/toolbar/Toolbar.vue +1 -0
- package/lib/components/toolbar/controls/AlignmentControl.vue +2 -3
- package/lib/components/toolbar/controls/aiComponent/AiControl.vue +185 -0
- package/lib/components/toolbar/controls/aiComponent/AiControlHeader.vue +28 -0
- package/lib/components/toolbar/controls/aiComponent/AiSuggestionItem.vue +74 -0
- package/lib/components/toolbar/controls/index.js +1 -0
- package/lib/components/toolbar/layouts/ToolbarDesktop.vue +5 -2
- package/lib/extensions/AiComponent.js +21 -0
- package/lib/extensions/index.js +5 -0
- package/package.json +32 -39
- package/ci/example/deploy.sh +0 -25
- package/config/build/node.config.js +0 -38
- package/dist/wysiwyg.cjs +0 -16
- package/lib/entryNode.js +0 -2
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="zw-position--relative" ref="wrapperRef">
|
|
3
|
+
<Button icon skin="toolbar" :active="isActive" @click="toggler.open" v-tooltip="'Generate text'">
|
|
4
|
+
<Icon name="sparkles" size="28px" />
|
|
5
|
+
</Button>
|
|
6
|
+
|
|
7
|
+
<Modal class="zw-suggestion-modal" :toggler="toggler" ref="modalRef" focus-first-control>
|
|
8
|
+
|
|
9
|
+
<AiControlHeader />
|
|
10
|
+
<form class="zw-link-modal__body" @submit.prevent="generateText">
|
|
11
|
+
|
|
12
|
+
<AiSuggestionItem
|
|
13
|
+
v-if="isLoading"
|
|
14
|
+
:suggestion="{ content: 'Working on it...', state: 'loading' }"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<AiSuggestionItem
|
|
18
|
+
v-else-if="lastSuggestions"
|
|
19
|
+
:suggestion="lastSuggestions"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<label class="zw-field__label">
|
|
23
|
+
{{ textAreaLabel }}
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<div class="zw-position--relative">
|
|
27
|
+
<TextArea
|
|
28
|
+
class="zw-margin-bottom--sm"
|
|
29
|
+
v-model="prompt"
|
|
30
|
+
/>
|
|
31
|
+
<Button type="submit" class="zw-ai-component__send-button">
|
|
32
|
+
<Icon auto-color class="zw-ai-component__icon" name="send" size="32px" />
|
|
33
|
+
</Button>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<Button :disabled="!lastSuggestions" type="button" skin="primary" @click="applyText">
|
|
37
|
+
Apply
|
|
38
|
+
</Button>
|
|
39
|
+
</form>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
</Modal>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import { computed, ref, inject, unref } from 'vue';
|
|
48
|
+
import { InjectionTokens } from '../../../../injectionTokens';
|
|
49
|
+
import { tooltip } from '../../../../directives';
|
|
50
|
+
import { Button, Icon, Modal, TextArea, useModalToggler } from '../../../base';
|
|
51
|
+
import AiControlHeader from './AiControlHeader';
|
|
52
|
+
import AiSuggestionItem from './AiSuggestionItem';
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: 'AiControl',
|
|
56
|
+
|
|
57
|
+
components: {
|
|
58
|
+
Modal,
|
|
59
|
+
Icon,
|
|
60
|
+
Button,
|
|
61
|
+
TextArea,
|
|
62
|
+
AiControlHeader,
|
|
63
|
+
AiSuggestionItem
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
directives: {
|
|
67
|
+
tooltip
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
setup() {
|
|
71
|
+
const wrapperRef = ref(null);
|
|
72
|
+
const modalRef = ref(null);
|
|
73
|
+
|
|
74
|
+
const prompt = ref('');
|
|
75
|
+
const suggestions = ref([]);
|
|
76
|
+
const isLoading = ref(false);
|
|
77
|
+
|
|
78
|
+
const textAreaLabel = computed(() => {
|
|
79
|
+
return suggestions.value.length ? 'Tell AI what to do next…' : 'Write you request';
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const lastSuggestions = computed(() => suggestions.value[suggestions.value.length - 1]);
|
|
83
|
+
|
|
84
|
+
const editor = inject(InjectionTokens.EDITOR);
|
|
85
|
+
|
|
86
|
+
const onBeforeOpened = () => {};
|
|
87
|
+
|
|
88
|
+
const toggler = useModalToggler({
|
|
89
|
+
onBeforeOpened: () => onBeforeOpened(),
|
|
90
|
+
wrapperRef,
|
|
91
|
+
modalRef
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const onAction = async (action) => {
|
|
95
|
+
isLoading.value = true;
|
|
96
|
+
|
|
97
|
+
const lastSuggestions = suggestions.value[suggestions.value.length - 1];
|
|
98
|
+
|
|
99
|
+
const context = lastSuggestions ? lastSuggestions.content : '';
|
|
100
|
+
|
|
101
|
+
const result = await editor.commands.generateText({ prompt: action, context });
|
|
102
|
+
|
|
103
|
+
isLoading.value = false;
|
|
104
|
+
suggestions.value.push(result);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const generateText = async () => {
|
|
108
|
+
if(isLoading.value) return;
|
|
109
|
+
|
|
110
|
+
isLoading.value = true;
|
|
111
|
+
|
|
112
|
+
const lastSuggestions = suggestions.value[suggestions.value.length - 1];
|
|
113
|
+
|
|
114
|
+
const context = lastSuggestions ? lastSuggestions.content : '';
|
|
115
|
+
|
|
116
|
+
const result = await editor.commands.generateText({ prompt: prompt.value, context });
|
|
117
|
+
|
|
118
|
+
isLoading.value = false;
|
|
119
|
+
prompt.value = '';
|
|
120
|
+
suggestions.value.push(result);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const applyText = () => {
|
|
124
|
+
editor.commands.setContent(lastSuggestions.value.content);
|
|
125
|
+
toggler.close();
|
|
126
|
+
suggestions.value = [];
|
|
127
|
+
prompt.value = '';
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const isActive = computed(() => unref(toggler.isOpened));
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
wrapperRef,
|
|
134
|
+
modalRef,
|
|
135
|
+
toggler,
|
|
136
|
+
isActive,
|
|
137
|
+
prompt,
|
|
138
|
+
generateText,
|
|
139
|
+
lastSuggestions,
|
|
140
|
+
textAreaLabel,
|
|
141
|
+
isLoading,
|
|
142
|
+
onAction,
|
|
143
|
+
applyText
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<style scoped>
|
|
150
|
+
.zw-suggestion-modal {
|
|
151
|
+
width: 500px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.zw-link-modal__body {
|
|
155
|
+
padding: var(--zw-offset-sm);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.zw-generated-text__suggestion {
|
|
159
|
+
font-size: 14px;
|
|
160
|
+
color: #908E8E;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.zw-ai-component__send-button {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 50%;
|
|
166
|
+
transform: translateY(-50%);
|
|
167
|
+
right: 16px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.zw-ai-component__icon {
|
|
171
|
+
color: #CDD1DC;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.zw-ai-component__send-button:hover .zw-ai-component__icon {
|
|
175
|
+
color: #878DA2;
|
|
176
|
+
transition: color 0.1s ease-in-out;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.zw-field__label {
|
|
180
|
+
display: inline-block;
|
|
181
|
+
font-size: var(--zw-font-size-xxs);
|
|
182
|
+
padding-bottom: var(--zw-offset-xxs);
|
|
183
|
+
line-height: var(--zw-line-height-xxs);
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="zw-link-modal-header">
|
|
3
|
+
<span class="zw-link-modal-header__title">Generate text</span>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'AiControlHeader'
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style scoped>
|
|
14
|
+
.zw-link-modal-header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
padding: var(--zw-offset-sm);
|
|
19
|
+
border-bottom: 2px solid rgb(var(--zw-color-n5));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.zw-link-modal-header__title {
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
font-weight: var(--zw-font-weight-semibold);
|
|
25
|
+
font-size: var(--zw-font-size-xxs);
|
|
26
|
+
color: rgb(var(--zw-color-white));
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="zw-ai-component__suggestion">
|
|
3
|
+
<p v-if="!isLoading" class="zw-ai-component-suggestion__request zw-margin-bottom--sm">
|
|
4
|
+
{{ suggestion.request }}
|
|
5
|
+
</p>
|
|
6
|
+
<p :class="{'zw-margin-bottom--sm': !isLoading }" v-html="suggestion.content" />
|
|
7
|
+
|
|
8
|
+
<Button type="button" v-if="!isLoading" @click="sendAction('Rewrite text')" class="zw-ai-component-suggestion__button">
|
|
9
|
+
✍ Rewrite text
|
|
10
|
+
</Button>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import { inject, computed } from 'vue';
|
|
16
|
+
import { Button } from '../../../base';
|
|
17
|
+
import { InjectionTokens } from '../../../../injectionTokens';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'AiSuggestionItem',
|
|
21
|
+
|
|
22
|
+
components: {
|
|
23
|
+
Button
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
suggestion: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
setup(props, { emit }) {
|
|
34
|
+
const isLoading = computed(() => props.suggestion.state === 'loading');
|
|
35
|
+
|
|
36
|
+
const sendAction = (action) => {
|
|
37
|
+
emit('action', action);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
isLoading,
|
|
42
|
+
sendAction
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
.zw-ai-component__suggestion {
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
margin-bottom: 8px;
|
|
52
|
+
padding: 16px 8px;
|
|
53
|
+
color: #CDD1DC;
|
|
54
|
+
border-radius: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.zw-ai-component-suggestion__request {
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
color: #666;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.zw-ai-component-suggestion__button {
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
padding: 4px 8px;
|
|
65
|
+
background-color: #A4A4A4;
|
|
66
|
+
color: #FFF;
|
|
67
|
+
border-radius: 2px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.zw-ai-component-suggestion__button:hover {
|
|
71
|
+
opacity: 0.8;
|
|
72
|
+
background-color: #3AAA35;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -13,4 +13,5 @@ export { default as AlignmentControl } from './AlignmentControl';
|
|
|
13
13
|
export { default as LineHeightControl } from './LineHeightControl';
|
|
14
14
|
export { default as ListControl } from './ListControl';
|
|
15
15
|
export { default as RemoveFormatControl } from './RemoveFormatControl';
|
|
16
|
+
export { default as AiControl } from './aiComponent/AiControl';
|
|
16
17
|
export { LinkControl } from './link';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<ToolbarRow>
|
|
4
|
+
<AiControl />
|
|
4
5
|
<StylePresetControl />
|
|
5
6
|
<ToolbarDivider vertical />
|
|
6
7
|
<FontFamilyControl />
|
|
@@ -64,7 +65,8 @@ import {
|
|
|
64
65
|
UnderlineControl,
|
|
65
66
|
ListControl,
|
|
66
67
|
RemoveFormatControl,
|
|
67
|
-
LinkControl
|
|
68
|
+
LinkControl,
|
|
69
|
+
AiControl
|
|
68
70
|
} from '../controls';
|
|
69
71
|
|
|
70
72
|
export default {
|
|
@@ -89,7 +91,8 @@ export default {
|
|
|
89
91
|
LineHeightControl,
|
|
90
92
|
ListControl,
|
|
91
93
|
RemoveFormatControl,
|
|
92
|
-
LinkControl
|
|
94
|
+
LinkControl,
|
|
95
|
+
AiControl
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { toRef } from 'vue';
|
|
2
|
+
import { Extension } from '@tiptap/vue-2';
|
|
3
|
+
import { createCommand } from '../utils';
|
|
4
|
+
|
|
5
|
+
export const AiComponent = Extension.create({
|
|
6
|
+
name: 'device_manager',
|
|
7
|
+
|
|
8
|
+
addCommands() {
|
|
9
|
+
return {
|
|
10
|
+
// _getAiAdapter: createCommand(() => toRef(this.options, 'device'))
|
|
11
|
+
|
|
12
|
+
generateText: createCommand(async ({ commands }, { prompt, context }) => {
|
|
13
|
+
const aiComponent = this.options.aiComponent;
|
|
14
|
+
const result = await aiComponent.generateText({ prompt, context });
|
|
15
|
+
|
|
16
|
+
result.content = result.content.replace(/\n/g, '');
|
|
17
|
+
return result;
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
package/lib/extensions/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive, toRef, watch } from 'vue';
|
|
2
|
+
import FloatingMenu from '@tiptap/extension-floating-menu';
|
|
2
3
|
import { StylePresetRenderer } from '../services';
|
|
3
4
|
import { buildCoreExtensions } from './core';
|
|
4
5
|
import { FontFamily } from './FontFamily';
|
|
@@ -17,6 +18,7 @@ import { List } from './list';
|
|
|
17
18
|
import { Link } from './Link';
|
|
18
19
|
import { Superscript } from './Superscript';
|
|
19
20
|
import { Margin } from './Margin';
|
|
21
|
+
import { AiComponent } from './AiComponent';
|
|
20
22
|
|
|
21
23
|
export function buildExtensions(options) {
|
|
22
24
|
const getPresetById = (id) => options.presetsRef.value.find((preset) => preset.id === id);
|
|
@@ -37,6 +39,9 @@ export function buildExtensions(options) {
|
|
|
37
39
|
linkPresetId: options.linkPresetId
|
|
38
40
|
})
|
|
39
41
|
}),
|
|
42
|
+
AiComponent.configure({
|
|
43
|
+
aiComponent: options.aiComponent
|
|
44
|
+
}),
|
|
40
45
|
List.configure({
|
|
41
46
|
baseClass: options.baseListClass,
|
|
42
47
|
presetClass: options.basePresetClass + options.defaultPresetId
|
package/package.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipify/wysiwyg",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-ai-prototype",
|
|
4
4
|
"description": "Zipify modification of TipTap text editor",
|
|
5
|
-
"
|
|
6
|
-
".": {
|
|
7
|
-
"node": "./dist/wysiwyg.cjs",
|
|
8
|
-
"default": "./dist/wysiwyg.mjs"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
5
|
+
"main": "dist/wysiwyg.mjs",
|
|
11
6
|
"bin": {
|
|
12
7
|
"zipify-wysiwyg": "bin/cli"
|
|
13
8
|
},
|
|
@@ -26,32 +21,31 @@
|
|
|
26
21
|
"lib:release": "export $(cat ./.env | xargs) && release-it",
|
|
27
22
|
"cli:build": "NODE_ENV=production rollup --config config/build/cli.config.js --bundleConfigAsCjs",
|
|
28
23
|
"cli:dev": "NODE_ENV=development rollup --config config/build/cli.config.js --bundleConfigAsCjs --watch",
|
|
29
|
-
"node:build": "NODE_ENV=production rollup --config config/build/node.config.js --bundleConfigAsCjs",
|
|
30
24
|
"example:start": "NODE_ENV=development vite serve --config config/build/example.config.js",
|
|
31
25
|
"example:build": "NODE_ENV=production vite build --config config/build/example.config.js",
|
|
32
26
|
"test:unit": "jest .",
|
|
33
27
|
"lint:js": "eslint ./lib",
|
|
34
28
|
"lint:css": "stylelint ./lib/**/*.{css,vue}",
|
|
35
29
|
"optimize-svg": "svgo --config ./config/svgo.js",
|
|
36
|
-
"gzip": "gzipper compress",
|
|
37
30
|
"prepare": "husky install"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@popperjs/core": "^2.11.
|
|
41
|
-
"@tiptap/core": "2.0.0
|
|
42
|
-
"@tiptap/extension-document": "2.0.0
|
|
43
|
-
"@tiptap/extension-
|
|
44
|
-
"@tiptap/extension-
|
|
45
|
-
"@tiptap/extension-
|
|
46
|
-
"@tiptap/extension-
|
|
47
|
-
"@tiptap/extension-
|
|
48
|
-
"@tiptap/extension-
|
|
49
|
-
"@tiptap/
|
|
50
|
-
"@tiptap/
|
|
33
|
+
"@popperjs/core": "^2.11.7",
|
|
34
|
+
"@tiptap/core": "^2.0.0",
|
|
35
|
+
"@tiptap/extension-document": "^2.0.0",
|
|
36
|
+
"@tiptap/extension-floating-menu": "^2.0.3",
|
|
37
|
+
"@tiptap/extension-heading": "^2.0.0",
|
|
38
|
+
"@tiptap/extension-history": "^2.0.0",
|
|
39
|
+
"@tiptap/extension-link": "^2.0.0",
|
|
40
|
+
"@tiptap/extension-list-item": "^2.0.0",
|
|
41
|
+
"@tiptap/extension-paragraph": "^2.0.0",
|
|
42
|
+
"@tiptap/extension-text": "^2.0.0",
|
|
43
|
+
"@tiptap/pm": "^2.0.0",
|
|
44
|
+
"@tiptap/vue-2": "^2.0.0",
|
|
51
45
|
"commander": "^10.0.0",
|
|
52
|
-
"jsdom": "^21.1.
|
|
46
|
+
"jsdom": "^21.1.1",
|
|
53
47
|
"lodash": "^4.17.21",
|
|
54
|
-
"simplebar": "^6.2.
|
|
48
|
+
"simplebar": "^6.2.4"
|
|
55
49
|
},
|
|
56
50
|
"peerDependencies": {
|
|
57
51
|
"@zipify/colorpicker": "^2.2",
|
|
@@ -66,11 +60,11 @@
|
|
|
66
60
|
}
|
|
67
61
|
},
|
|
68
62
|
"devDependencies": {
|
|
69
|
-
"@babel/core": "^7.
|
|
70
|
-
"@babel/eslint-parser": "^7.
|
|
71
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
63
|
+
"@babel/core": "^7.21.3",
|
|
64
|
+
"@babel/eslint-parser": "^7.21.3",
|
|
65
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
72
66
|
"@babel/preset-env": "^7.20.2",
|
|
73
|
-
"@babel/runtime": "^7.
|
|
67
|
+
"@babel/runtime": "^7.21.0",
|
|
74
68
|
"@optimize-lodash/rollup-plugin": "^4.0.3",
|
|
75
69
|
"@rollup/plugin-babel": "^6.0.3",
|
|
76
70
|
"@rollup/plugin-commonjs": "^24.0.1",
|
|
@@ -79,25 +73,24 @@
|
|
|
79
73
|
"@rollup/plugin-replace": "^5.0.2",
|
|
80
74
|
"@rollup/plugin-terser": "^0.4.0",
|
|
81
75
|
"@vue/test-utils": "^1.3.4",
|
|
82
|
-
"@vue/vue2-jest": "^29.2.
|
|
83
|
-
"@zipify/colorpicker": "^2.
|
|
84
|
-
"@zipify/eslint-config": "^1.
|
|
85
|
-
"babel-jest": "^29.
|
|
86
|
-
"eslint": "8.
|
|
76
|
+
"@vue/vue2-jest": "^29.2.3",
|
|
77
|
+
"@zipify/colorpicker": "^2.3",
|
|
78
|
+
"@zipify/eslint-config": "^1.2.0",
|
|
79
|
+
"babel-jest": "^29.5.0",
|
|
80
|
+
"eslint": "8.37.0",
|
|
87
81
|
"eslint-plugin-import": "^2.27.5",
|
|
88
82
|
"eslint-plugin-jest": "^27.2.1",
|
|
89
|
-
"eslint-plugin-vue": "^9.
|
|
90
|
-
"gzipper": "^7.2.0",
|
|
83
|
+
"eslint-plugin-vue": "^9.10.0",
|
|
91
84
|
"husky": "^8.0.3",
|
|
92
|
-
"jest": "^29.
|
|
93
|
-
"jest-environment-jsdom": "^29.
|
|
94
|
-
"lint-staged": "^13.
|
|
85
|
+
"jest": "^29.5.0",
|
|
86
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
87
|
+
"lint-staged": "^13.2.0",
|
|
95
88
|
"postcss-html": "^1.5.0",
|
|
96
|
-
"release-it": "^15.
|
|
97
|
-
"rollup": "^3.
|
|
89
|
+
"release-it": "^15.9.3",
|
|
90
|
+
"rollup": "^3.20.2",
|
|
98
91
|
"stylelint": "^14.16.1",
|
|
99
92
|
"svgo": "^3.0.2",
|
|
100
|
-
"vite": "^4.
|
|
93
|
+
"vite": "^4.2.1",
|
|
101
94
|
"vite-plugin-vue2": "^2.0.3",
|
|
102
95
|
"vue": "^2.7.14",
|
|
103
96
|
"vue-template-compiler": "^2.7.14"
|
package/ci/example/deploy.sh
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
export AWS_CONFIG_FILE=./ci/example/.aws-credentials
|
|
4
|
-
|
|
5
|
-
function throw_error() {
|
|
6
|
-
echo -e "\033[0;31m \n\n$1\n\n";
|
|
7
|
-
exit;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if ! command -v aws &> /dev/null; then
|
|
11
|
-
throw_error 'AWS CLI not found. Download from https://aws.amazon.com/cli/'
|
|
12
|
-
fi;
|
|
13
|
-
|
|
14
|
-
if [ ! -f "$AWS_CONFIG_FILE" ]; then
|
|
15
|
-
throw_error 'AWS credentials config not found'
|
|
16
|
-
fi;
|
|
17
|
-
|
|
18
|
-
echo Building... && \
|
|
19
|
-
rm -rf ./example/dist && \
|
|
20
|
-
npm run example:build > /dev/null && \
|
|
21
|
-
npx --yes gzipper compress ./example/dist > /dev/null && \
|
|
22
|
-
echo Uploading... && \
|
|
23
|
-
BRANCH_NAME=$(git branch --show-current) && \
|
|
24
|
-
aws s3 sync --acl public-read --cache-control 'max-age=0,no-cache,no-store,must-revalidate' "./example/dist" "s3://zipify-wysiwyg/$BRANCH_NAME" > /dev/null && \
|
|
25
|
-
echo "on https://zipify-wysiwyg.s3.eu-central-1.amazonaws.com/$BRANCH_NAME/index.html"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
2
|
-
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
|
|
3
|
-
import terser from '@rollup/plugin-terser';
|
|
4
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
5
|
-
import replace from '@rollup/plugin-replace';
|
|
6
|
-
import json from '@rollup/plugin-json';
|
|
7
|
-
import { resolvePath } from './settings';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
input: resolvePath('./lib/entryNode.js'),
|
|
11
|
-
output: {
|
|
12
|
-
file: resolvePath('./dist/wysiwyg.cjs'),
|
|
13
|
-
format: 'cjs',
|
|
14
|
-
plugins: [
|
|
15
|
-
getBabelOutputPlugin({
|
|
16
|
-
presets: [
|
|
17
|
-
['@babel/preset-env', { targets: { node: 18 } }]
|
|
18
|
-
]
|
|
19
|
-
}),
|
|
20
|
-
terser({ toplevel: true })
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
plugins: [
|
|
25
|
-
replace({
|
|
26
|
-
preventAssignment: true,
|
|
27
|
-
values: { 'import.meta.glob': '(() => ({}))' }
|
|
28
|
-
}),
|
|
29
|
-
nodeResolve({
|
|
30
|
-
extensions: ['*', '.js', '.json'],
|
|
31
|
-
preferBuiltins: true
|
|
32
|
-
}),
|
|
33
|
-
commonjs({ ignore: ['canvas'] }),
|
|
34
|
-
json()
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
external: ['jsdom']
|
|
38
|
-
};
|