@live-change/image-frontend 0.9.32 → 0.9.33
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/front/src/EditorTest.vue +2 -2
- package/front/src/ImageCrop.vue +4 -3
- package/front/src/ImageEditor.vue +12 -12
- package/front/src/ImageInput.vue +6 -6
- package/front/src/NavBar.vue +25 -25
- package/front/src/UploadTest.vue +4 -4
- package/package.json +13 -13
package/front/src/EditorTest.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-full">
|
|
3
|
-
<div class="w-full surface-0">
|
|
4
|
-
<h2 class="p-
|
|
3
|
+
<div class="w-full bg-surface-0 dark:bg-surface-900">
|
|
4
|
+
<h2 class="p-6">Editor:</h2>
|
|
5
5
|
<ImageEditor v-model="image" />
|
|
6
6
|
<!-- :source-image="'[Wc6P55MDs.0@1V6ZJBwyF_1I98X_]'"-->
|
|
7
7
|
</div>
|
package/front/src/ImageCrop.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="w-full relative surface-400 overflow-hidden" ref="dragArea"
|
|
2
|
+
<div class="w-full relative bg-surface-400 dark:bg-surface-400 overflow-hidden" ref="dragArea"
|
|
3
3
|
@mousedown="handleEditorMouseDown"
|
|
4
4
|
@mouseup="handleEditorMouseUp"
|
|
5
5
|
@mouseout="handleEditorMouseOut"
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
@touchcancel="handleEditorTouchCancel"
|
|
10
10
|
@touchmove="handleEditorTouchMove"
|
|
11
11
|
@wheel="handleEditorWheel">
|
|
12
|
-
<div class="p-
|
|
12
|
+
<div class="p-6 md:p-8 lg:p-12 flex flex-row justify-center items-center">
|
|
13
13
|
<div class="w-full relative"
|
|
14
14
|
:style="`aspect-ratio: ${aspectRatio}; max-width: 40vh;`"
|
|
15
15
|
ref="cropArea">
|
|
16
|
-
<div class="absolute left-
|
|
16
|
+
<div class="absolute left-1/2 top-1/2">
|
|
17
17
|
<Image :image="sourceImage"
|
|
18
18
|
:style="{ width: `${rectSize?.x}px`, transform: imageTransform }"
|
|
19
|
+
class="max-w-none"
|
|
19
20
|
@size="handleImageSize" />
|
|
20
21
|
</div>
|
|
21
22
|
</div>
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
:type="type"
|
|
10
10
|
v-model:ready="cropReady"
|
|
11
11
|
ref="imageCrop" style="max-height: 60vh" />
|
|
12
|
-
<div class="flex p-
|
|
13
|
-
<div class="
|
|
12
|
+
<div class="flex p-4 pb-2 flex-wrap">
|
|
13
|
+
<div class="grow flex justify-center">
|
|
14
14
|
<Button type="button" label="Upload" icon="pi pi-upload" class="p-button-primary mb-2"
|
|
15
15
|
@click="() => state = 'upload' "/>
|
|
16
16
|
</div>
|
|
17
|
-
<div class="flex
|
|
17
|
+
<div class="flex grow justify-center">
|
|
18
18
|
<Button type="button" label="Save" icon="pi pi-save" class="p-button-warning ml-2 mb-2"
|
|
19
19
|
:disabled="!cropReady" @click="saveImage" />
|
|
20
20
|
<Button type="button" label="Remove" icon="pi pi-times" class="p-button-danger ml-2 mb-2"
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
|
-
<div v-else-if="state === 'upload'" class="flex flex-
|
|
26
|
-
<DropZone class="
|
|
25
|
+
<div v-else-if="state === 'upload'" class="flex flex-col items-center">
|
|
26
|
+
<DropZone class="grow w-full relative p-6 md:p-8 lg:p-12 pt-2 md:pt-4 lg:pt-6 bg-surface-0 dark:bg-surface-950"
|
|
27
27
|
:accept="acceptList" @input="handleFile">
|
|
28
|
-
<div class="w-auto flex flex-row
|
|
29
|
-
<div class="w-full border-dashed border-primary-500 flex
|
|
28
|
+
<div class="w-auto flex flex-row items-center justify-center">
|
|
29
|
+
<div class="w-full border-2 border-dashed border-primary-500 flex items-center justify-center"
|
|
30
30
|
:style="`aspect-ratio: ${aspectRatio}; max-width: 50vh`">
|
|
31
31
|
<p class="text-primary text-xl">Drop image here!</p>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
34
|
</DropZone>
|
|
35
|
-
<div class="w-full flex justify-
|
|
35
|
+
<div class="w-full flex justify-center px-6 pt-4 pb-4 grow-0">
|
|
36
36
|
<FileInput :accept="acceptList" @input="handleFile" class="block">
|
|
37
37
|
<Button type="button" label="Upload Image" icon="pi pi-upload" class="p-button-primary" />
|
|
38
38
|
</FileInput>
|
|
@@ -191,9 +191,9 @@
|
|
|
191
191
|
)
|
|
192
192
|
const originalImage = imageData.value.originalImage
|
|
193
193
|
console.log("IM DATA", imageData, originalImage)
|
|
194
|
-
imageName.value = originalImage.name
|
|
195
|
-
const
|
|
196
|
-
|
|
194
|
+
imageName.value = originalImage?.name ?? imageData.value.name
|
|
195
|
+
const extension = (imageData.value.extension ?? originalImage?.extension) ||
|
|
196
|
+
(originalImage?.name && originalImage.name.split('.').pop())
|
|
197
197
|
switch(extension) {
|
|
198
198
|
case 'jpg':
|
|
199
199
|
case 'jpeg':
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
break
|
|
209
209
|
}
|
|
210
210
|
cropData.value = imageData.value.crop
|
|
211
|
-
sourceImage.value = originalImage.id
|
|
211
|
+
sourceImage.value = originalImage?.id ?? imageData.value.id
|
|
212
212
|
console.log("IMAGE", imageName.value, imageType.value)
|
|
213
213
|
})())
|
|
214
214
|
}
|
package/front/src/ImageInput.vue
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div v-if="modelValue" class="flex flex-
|
|
3
|
+
<div v-if="modelValue" class="flex flex-col items-center">
|
|
4
4
|
<Image :image="modelValue" :key="modelValue"
|
|
5
5
|
:width="definition?.width ?? 400" :height="definition?.height ?? 400"
|
|
6
6
|
style="max-width: 100%" />
|
|
7
|
-
<div class="w-full mt-2 flex flex-row flex-wrap justify-
|
|
7
|
+
<div class="w-full mt-2 flex flex-row flex-wrap justify-around items-center">
|
|
8
8
|
<Button @click="cropImage" type="button" label="Crop Image"
|
|
9
|
-
icon="pi pi-pencil" class="p-button-secondary w-
|
|
9
|
+
icon="pi pi-pencil" class="p-button-secondary w-48" />
|
|
10
10
|
<Button @click="deleteImage" type="button" label="Remove Image"
|
|
11
|
-
icon="pi pi-trash" class="p-button-danger w-
|
|
11
|
+
icon="pi pi-trash" class="p-button-danger w-48" />
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
<div v-else>
|
|
15
|
-
<DropZone class="w-full relative p-2 flex justify-
|
|
15
|
+
<DropZone class="w-full relative p-2 flex justify-center items-center"
|
|
16
16
|
:accept="acceptList" @input="handleFile">
|
|
17
|
-
<div class="w-auto border-dashed border-primary-500 flex
|
|
17
|
+
<div class="w-auto border-dashed border-primary-500 flex items-center justify-center p-2"
|
|
18
18
|
:style="dropZoneStyle">
|
|
19
19
|
<p class="text-primary text-xl">Drop image here!</p>
|
|
20
20
|
</div>
|
package/front/src/NavBar.vue
CHANGED
|
@@ -2,49 +2,49 @@
|
|
|
2
2
|
<div class="surface-overlay py-3 px-6 shadow-2 flex align-items-center justify-content-between
|
|
3
3
|
relative md:sticky top-0 z-5"
|
|
4
4
|
style="min-height: 80px" key="navbar">
|
|
5
|
-
<img src="/images/logo.svg" alt="Image" height="40" class="mr-0 lg:mr-
|
|
6
|
-
<a v-ripple class="cursor-pointer block lg:hidden text-700 p-ripple"
|
|
7
|
-
v-styleclass="{ selector: '@next',
|
|
5
|
+
<img src="/images/logo.svg" alt="Image" height="40" class="mr-0 lg:mr-12">
|
|
6
|
+
<a v-ripple class="cursor-pointer block lg:hidden text-surface-700 dark:text-surface-100 p-ripple"
|
|
7
|
+
v-styleclass="{ selector: '@next', enterFromClass: 'hidden', leaveToClass: 'hidden', hideOnOutsideClick: true }">
|
|
8
8
|
<i class="pi pi-bars text-4xl"></i>
|
|
9
9
|
</a>
|
|
10
|
-
<div class="
|
|
11
|
-
<ul class="list-none p-0 m-0 flex lg:
|
|
10
|
+
<div class="items-center grow justify-between hidden lg:flex absolute lg:static w-full bg-surface-0 dark:bg-surface-900 left-0 top-full z-10 shadow lg:shadow-none">
|
|
11
|
+
<ul class="list-none p-0 m-0 flex lg:items-center select-none flex-col lg:flex-row">
|
|
12
12
|
<li>
|
|
13
|
-
<a v-ripple class="flex px-
|
|
13
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple">
|
|
14
14
|
<i class="pi pi-home mr-2"></i>
|
|
15
15
|
<span>Home</span>
|
|
16
16
|
</a>
|
|
17
17
|
</li>
|
|
18
18
|
<li class="lg:relative">
|
|
19
|
-
<a v-ripple class="flex px-
|
|
20
|
-
v-styleclass="{ selector: '@next',
|
|
19
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple"
|
|
20
|
+
v-styleclass="{ selector: '@next', enterFromClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
|
|
21
21
|
<i class="pi pi-users mr-2"></i>
|
|
22
22
|
<span>Customers</span>
|
|
23
|
-
<i class="pi pi-angle-down ml-auto lg:ml-
|
|
23
|
+
<i class="pi pi-angle-down ml-auto lg:ml-4"></i>
|
|
24
24
|
</a>
|
|
25
|
-
<ul class="list-none py-
|
|
25
|
+
<ul class="list-none py-4 px-12 m-0 lg:px-0 lg:py-0 rounded-border shadow-0 lg:shadow lg:border border-surface-50 dark:border-surface-800 lg:absolute bg-surface-0 dark:bg-surface-900 hidden origin-top w-full lg:w-60 cursor-pointer">
|
|
26
26
|
<li>
|
|
27
|
-
<a v-ripple class="flex p-
|
|
27
|
+
<a v-ripple class="flex p-4 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors duration-150 p-ripple">
|
|
28
28
|
<i class="pi pi-user-plus mr-2"></i>
|
|
29
29
|
<span class="font-medium">Add New</span>
|
|
30
30
|
</a>
|
|
31
31
|
</li>
|
|
32
32
|
<li class="relative">
|
|
33
|
-
<a v-ripple class="flex p-
|
|
34
|
-
v-styleclass="{ selector: '@next',
|
|
33
|
+
<a v-ripple class="flex p-4 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors duration-150 p-ripple"
|
|
34
|
+
v-styleclass="{ selector: '@next', enterFromClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
|
|
35
35
|
<i class="pi pi-search mr-2"></i>
|
|
36
36
|
<span class="font-medium">Search</span>
|
|
37
37
|
<i class="pi pi-angle-down ml-auto lg:-rotate-90"></i>
|
|
38
38
|
</a>
|
|
39
|
-
<ul class="list-none py-
|
|
39
|
+
<ul class="list-none py-4 pl-4 m-0 lg:px-0 lg:py-0 rounded-border shadow-0 lg:shadow lg:border border-surface-50 dark:border-surface-800 lg:absolute bg-surface-0 dark:bg-surface-900 hidden origin-top w-full lg:w-60 cursor-pointer left-full top-0">
|
|
40
40
|
<li>
|
|
41
|
-
<a v-ripple class="flex p-
|
|
41
|
+
<a v-ripple class="flex p-4 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors duration-150 p-ripple">
|
|
42
42
|
<i class="pi pi-shopping-cart mr-2"></i>
|
|
43
43
|
<span class="font-medium">Purchases</span>
|
|
44
44
|
</a>
|
|
45
45
|
</li>
|
|
46
46
|
<li class="relative">
|
|
47
|
-
<a v-ripple class="flex p-
|
|
47
|
+
<a v-ripple class="flex p-4 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors duration-150 p-ripple">
|
|
48
48
|
<i class="pi pi-comments mr-2"></i>
|
|
49
49
|
<span class="font-medium">Messages</span>
|
|
50
50
|
</a>
|
|
@@ -54,21 +54,21 @@
|
|
|
54
54
|
</ul>
|
|
55
55
|
</li>
|
|
56
56
|
<li>
|
|
57
|
-
<a v-ripple class="flex px-
|
|
57
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple">
|
|
58
58
|
<i class="pi pi-calendar mr-2"></i>
|
|
59
59
|
<span>Calendar</span>
|
|
60
60
|
</a>
|
|
61
61
|
</li>
|
|
62
62
|
<li>
|
|
63
|
-
<a v-ripple class="flex px-
|
|
63
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple">
|
|
64
64
|
<i class="pi pi-chart-line mr-2"></i>
|
|
65
65
|
<span>Stats</span>
|
|
66
66
|
</a>
|
|
67
67
|
</li>
|
|
68
68
|
</ul>
|
|
69
|
-
<ul class="list-none p-0 m-0 flex lg:
|
|
69
|
+
<ul class="list-none p-0 m-0 flex lg:items-center select-none flex-col lg:flex-row border-t border-surface lg:border-t-0">
|
|
70
70
|
<li>
|
|
71
|
-
<a v-ripple class="flex px-
|
|
71
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center text-surface-600 dark:text-surface-200 hover:text-surface-900 dark:hover:text-surface-0 hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple">
|
|
72
72
|
<i class="pi pi-inbox text-base lg:text-2xl mr-2 lg:mr-0"></i>
|
|
73
73
|
<span class="block lg:hidden font-medium">Inbox</span>
|
|
74
74
|
</a>
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
<span class="block lg:hidden font-medium">Notifications</span>
|
|
83
83
|
</a>
|
|
84
84
|
</li>
|
|
85
|
-
<li class="border-
|
|
86
|
-
<a v-ripple class="flex px-
|
|
87
|
-
<img src="/images/empty-user-photo.svg" class="mr-
|
|
85
|
+
<li class="border-t border-surface lg:border-t-0">
|
|
86
|
+
<a v-ripple class="flex px-12 p-4 lg:px-4 lg:py-2 items-center hover:bg-surface-100 dark:hover:bg-surface-700 font-medium rounded-border cursor-pointer transition-colors duration-150 p-ripple">
|
|
87
|
+
<img src="/images/empty-user-photo.svg" class="mr-4 lg:mr-0 rounded-full" style="width: 28px; height: 28px"/>
|
|
88
88
|
<div class="block lg:hidden">
|
|
89
|
-
<div class="text-900 font-medium">Josephine Lillard</div>
|
|
90
|
-
<span class="text-600 font-medium text-sm">Marketing Specialist</span>
|
|
89
|
+
<div class="text-surface-900 dark:text-surface-0 font-medium">Josephine Lillard</div>
|
|
90
|
+
<span class="text-surface-600 dark:text-surface-200 font-medium text-sm">Marketing Specialist</span>
|
|
91
91
|
</div>
|
|
92
92
|
</a>
|
|
93
93
|
</li>
|
package/front/src/UploadTest.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="w-full sm:w-9 md:w-8 lg:w-6 surface-
|
|
3
|
-
<div class="text-center mb-
|
|
4
|
-
<div class="text-900 text-3xl font-medium mb-
|
|
2
|
+
<div class="w-full sm:w-9/12 md:w-8/12 lg:w-6/12 bg-surface-0 dark:bg-surface-900 p-6 shadow rounded-border">
|
|
3
|
+
<div class="text-center mb-8">
|
|
4
|
+
<div class="text-surface-900 dark:text-surface-0 text-3xl font-medium mb-4">
|
|
5
5
|
Upload Test
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h2>Image: {{ image }}</h2>
|
|
18
18
|
<Image :image="image" width="200" height="200" />
|
|
19
19
|
</div>
|
|
20
|
-
<!-- <UploadView v-if="upload" :upload="upload" cancelable class="surface-
|
|
20
|
+
<!-- <UploadView v-if="upload" :upload="upload" cancelable class="bg-surface-0 dark:bg-surface-900 shadow rounded-border p-6 mt-4" />-->
|
|
21
21
|
</div>
|
|
22
22
|
</template>
|
|
23
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/image-frontend",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.33",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@fortawesome/fontawesome-free": "^6.7.2",
|
|
25
|
-
"@live-change/cli": "^0.9.
|
|
26
|
-
"@live-change/dao": "^0.9.
|
|
27
|
-
"@live-change/dao-vue3": "^0.9.
|
|
28
|
-
"@live-change/dao-websocket": "^0.9.
|
|
29
|
-
"@live-change/framework": "^0.9.
|
|
30
|
-
"@live-change/image-service": "^0.9.
|
|
31
|
-
"@live-change/session-service": "^0.9.
|
|
32
|
-
"@live-change/vue3-components": "^0.9.
|
|
33
|
-
"@live-change/vue3-ssr": "^0.9.
|
|
25
|
+
"@live-change/cli": "^0.9.33",
|
|
26
|
+
"@live-change/dao": "^0.9.33",
|
|
27
|
+
"@live-change/dao-vue3": "^0.9.33",
|
|
28
|
+
"@live-change/dao-websocket": "^0.9.33",
|
|
29
|
+
"@live-change/framework": "^0.9.33",
|
|
30
|
+
"@live-change/image-service": "^0.9.33",
|
|
31
|
+
"@live-change/session-service": "^0.9.33",
|
|
32
|
+
"@live-change/vue3-components": "^0.9.33",
|
|
33
|
+
"@live-change/vue3-ssr": "^0.9.33",
|
|
34
34
|
"@vueuse/core": "^12.3.0",
|
|
35
35
|
"codeceptjs-assert": "^0.0.5",
|
|
36
36
|
"compression": "^1.7.5",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"pretty-bytes": "^6.1.1",
|
|
41
41
|
"primeflex": "^3.3.1",
|
|
42
42
|
"primeicons": "^7.0.0",
|
|
43
|
-
"primevue": "^
|
|
43
|
+
"primevue": "^4.2.5",
|
|
44
44
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
45
45
|
"rollup-plugin-visualizer": "5.14.0",
|
|
46
46
|
"serialize-javascript": "^6.0.2",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"vue3-scroll-border": "0.1.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@live-change/codeceptjs-helper": "^0.9.
|
|
53
|
+
"@live-change/codeceptjs-helper": "^0.9.33",
|
|
54
54
|
"codeceptjs": "^3.6.10",
|
|
55
55
|
"generate-password": "1.7.1",
|
|
56
56
|
"playwright": "1.49.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
62
62
|
"license": "BSD-3-Clause",
|
|
63
63
|
"description": "",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c6eaa7764dc12b9489b74386b1227b71d0640e09"
|
|
65
65
|
}
|