@cropvue/vue 0.1.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/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/components/CropDropzone.vue.d.ts +35 -0
- package/dist/components/CropDropzone.vue.d.ts.map +1 -0
- package/dist/components/CropEditor.vue.d.ts +63 -0
- package/dist/components/CropEditor.vue.d.ts.map +1 -0
- package/dist/components/CropPreview.vue.d.ts +33 -0
- package/dist/components/CropPreview.vue.d.ts.map +1 -0
- package/dist/components/CropQueue.vue.d.ts +204 -0
- package/dist/components/CropQueue.vue.d.ts.map +1 -0
- package/dist/components/CropStencil.vue.d.ts +28 -0
- package/dist/components/CropStencil.vue.d.ts.map +1 -0
- package/dist/components/CropToolbar.vue.d.ts +49 -0
- package/dist/components/CropToolbar.vue.d.ts.map +1 -0
- package/dist/components/CropVue.vue.d.ts +304 -0
- package/dist/components/CropVue.vue.d.ts.map +1 -0
- package/dist/cropvue.cjs +1 -0
- package/dist/cropvue.mjs +831 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Philip Rutberg
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @cropvue/vue
|
|
2
|
+
|
|
3
|
+
Renderless Vue 3 components for image cropping and upload. Fully customizable via scoped slots and CSS custom properties.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @cropvue/vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Components
|
|
12
|
+
|
|
13
|
+
- **`CropVue`** - Main orchestrator (dropzone -> editor -> result)
|
|
14
|
+
- **`CropEditor`** - Interactive crop editor with CSS transforms
|
|
15
|
+
- **`CropPreview`** - Real-time canvas preview
|
|
16
|
+
- **`CropDropzone`** - File drop area
|
|
17
|
+
- **`CropToolbar`** - Rotate/flip/zoom controls
|
|
18
|
+
- **`CropQueue`** - Multi-image queue
|
|
19
|
+
- **`CropStencil`** - Crop shape overlay
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<script setup>
|
|
25
|
+
import { CropVue } from '@cropvue/vue'
|
|
26
|
+
import '@cropvue/vue/styles'
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<CropVue stencil="circle" :aspect-ratio="1" @done="handleDone">
|
|
31
|
+
<template #dropzone="{ open, isDragging }">
|
|
32
|
+
<div @click="open">{{ isDragging ? 'Drop!' : 'Click to select' }}</div>
|
|
33
|
+
</template>
|
|
34
|
+
</CropVue>
|
|
35
|
+
</template>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Theming
|
|
39
|
+
|
|
40
|
+
Override CSS custom properties:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
:root {
|
|
44
|
+
--cropvue-overlay-color: rgba(0, 0, 0, 0.7);
|
|
45
|
+
--cropvue-crop-border-color: #3b82f6;
|
|
46
|
+
--cropvue-toolbar-bg: #1f2937;
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CropVueError } from '@cropvue/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
accept?: string[];
|
|
4
|
+
maxSize?: number;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {
|
|
8
|
+
open: () => void;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
15
|
+
open: () => void;
|
|
16
|
+
files: import("vue").Ref<File[], File[]>;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
error: (error: CropVueError) => any;
|
|
19
|
+
files: (files: File[]) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onError?: ((error: CropVueError) => any) | undefined;
|
|
22
|
+
onFiles?: ((files: File[]) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
accept: string[];
|
|
25
|
+
multiple: boolean;
|
|
26
|
+
maxSize: number;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=CropDropzone.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropDropzone.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropDropzone.vue"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA0DF,QAAA,IAAI,OAAO;;;CAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAyB/C,QAAA,MAAM,eAAe;;;;;;;;;;YAxFV,MAAM,EAAE;cAEN,OAAO;aADR,MAAM;6EAgGhB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TransformState, CropState, ImageData as CropImageData } from '@cropvue/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
image: CropImageData | null;
|
|
4
|
+
transform: TransformState;
|
|
5
|
+
crop: CropState;
|
|
6
|
+
pannable?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
image: CropImageData | null;
|
|
10
|
+
transform: TransformState;
|
|
11
|
+
style: {
|
|
12
|
+
width: string;
|
|
13
|
+
height: string;
|
|
14
|
+
transform: string;
|
|
15
|
+
transformOrigin: string;
|
|
16
|
+
};
|
|
17
|
+
}, __VLS_3: {
|
|
18
|
+
crop: CropState;
|
|
19
|
+
clipPath: string;
|
|
20
|
+
}, __VLS_5: {
|
|
21
|
+
style: {
|
|
22
|
+
left: string;
|
|
23
|
+
top: string;
|
|
24
|
+
width: string;
|
|
25
|
+
height: string;
|
|
26
|
+
};
|
|
27
|
+
crop: CropState;
|
|
28
|
+
}, __VLS_7: {
|
|
29
|
+
crop: CropState;
|
|
30
|
+
}, __VLS_9: {
|
|
31
|
+
crop: CropState;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Slots = {} & {
|
|
34
|
+
image?: (props: typeof __VLS_1) => any;
|
|
35
|
+
} & {
|
|
36
|
+
overlay?: (props: typeof __VLS_3) => any;
|
|
37
|
+
} & {
|
|
38
|
+
'crop-area'?: (props: typeof __VLS_5) => any;
|
|
39
|
+
} & {
|
|
40
|
+
grid?: (props: typeof __VLS_7) => any;
|
|
41
|
+
} & {
|
|
42
|
+
handles?: (props: typeof __VLS_9) => any;
|
|
43
|
+
};
|
|
44
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
45
|
+
editorRef: import("vue").Ref<HTMLElement | null | undefined, HTMLElement | null | undefined>;
|
|
46
|
+
displayScale: import("vue").ComputedRef<number>;
|
|
47
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
|
+
"update:transform": (transform: TransformState) => any;
|
|
49
|
+
"update:crop": (crop: CropState) => any;
|
|
50
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
51
|
+
"onUpdate:transform"?: ((transform: TransformState) => any) | undefined;
|
|
52
|
+
"onUpdate:crop"?: ((crop: CropState) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
pannable: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=CropEditor.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropEditor.vue"],"names":[],"mappings":"AAgeA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,eAAe,CAAA;AAY1F,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;IAC3B,SAAS,EAAE,cAAc,CAAA;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA2ZF,QAAA,IAAI,OAAO;;;;;;;;;CAAU,EAAE,OAAO;;;CAAU,EAAE,OAAO;;;;;;;;CAAU,EAAE,OAAO;;CAAU,EAAE,OAAO;;CAAW,CAAE;AACpG,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC1C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAChD;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA+B/C,QAAA,MAAM,eAAe;;;;;;;;;;cAjcR,OAAO;6EA0clB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TransformState, CropState, ImageData as CropImageData } from '@cropvue/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
image: CropImageData | null;
|
|
4
|
+
transform: TransformState;
|
|
5
|
+
crop: CropState;
|
|
6
|
+
maxWidth?: number;
|
|
7
|
+
maxHeight?: number;
|
|
8
|
+
debounce?: number;
|
|
9
|
+
};
|
|
10
|
+
declare function render(): void;
|
|
11
|
+
declare var __VLS_1: {
|
|
12
|
+
canvasRef: HTMLCanvasElement | null;
|
|
13
|
+
render: typeof render;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
19
|
+
canvasRef: import("vue").Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
20
|
+
render: typeof render;
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
22
|
+
maxWidth: number;
|
|
23
|
+
maxHeight: number;
|
|
24
|
+
debounce: number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=CropPreview.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropPreview.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,eAAe,CAAA;AAE1F,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;IAC3B,SAAS,EAAE,cAAc,CAAA;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;AAUF,iBAAS,MAAM,SASd;AAoDD,QAAA,IAAI,OAAO;;;CAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAuB/C,QAAA,MAAM,eAAe;;;;cAnGR,MAAM;eACL,MAAM;cACP,MAAM;6EAyGjB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { QueueItem } from '@cropvue/core';
|
|
2
|
+
declare function selectItem(index: number): void;
|
|
3
|
+
declare function removeItem(index: number): void;
|
|
4
|
+
declare var __VLS_1: {
|
|
5
|
+
items: {
|
|
6
|
+
id: string;
|
|
7
|
+
file: {
|
|
8
|
+
readonly lastModified: number;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly webkitRelativePath: string;
|
|
11
|
+
readonly size: number;
|
|
12
|
+
readonly type: string;
|
|
13
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
14
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
15
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
16
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
17
|
+
text: () => Promise<string>;
|
|
18
|
+
};
|
|
19
|
+
thumbnail: string;
|
|
20
|
+
result?: {
|
|
21
|
+
blob: {
|
|
22
|
+
readonly size: number;
|
|
23
|
+
readonly type: string;
|
|
24
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
25
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
26
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
27
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
28
|
+
text: () => Promise<string>;
|
|
29
|
+
};
|
|
30
|
+
file: {
|
|
31
|
+
readonly lastModified: number;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly webkitRelativePath: string;
|
|
34
|
+
readonly size: number;
|
|
35
|
+
readonly type: string;
|
|
36
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
37
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
38
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
39
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
40
|
+
text: () => Promise<string>;
|
|
41
|
+
};
|
|
42
|
+
url: string;
|
|
43
|
+
coords: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
rotation: number;
|
|
49
|
+
flipX: boolean;
|
|
50
|
+
flipY: boolean;
|
|
51
|
+
scale: number;
|
|
52
|
+
};
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
originalWidth: number;
|
|
56
|
+
originalHeight: number;
|
|
57
|
+
} | undefined;
|
|
58
|
+
status: "pending" | "cropping" | "done";
|
|
59
|
+
}[];
|
|
60
|
+
currentIndex: number;
|
|
61
|
+
select: typeof selectItem;
|
|
62
|
+
remove: typeof removeItem;
|
|
63
|
+
add: (files: File[]) => void;
|
|
64
|
+
};
|
|
65
|
+
type __VLS_Slots = {} & {
|
|
66
|
+
default?: (props: typeof __VLS_1) => any;
|
|
67
|
+
};
|
|
68
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
69
|
+
queue: {
|
|
70
|
+
images: import("vue").Ref<{
|
|
71
|
+
id: string;
|
|
72
|
+
file: {
|
|
73
|
+
readonly lastModified: number;
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly webkitRelativePath: string;
|
|
76
|
+
readonly size: number;
|
|
77
|
+
readonly type: string;
|
|
78
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
79
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
80
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
81
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
82
|
+
text: () => Promise<string>;
|
|
83
|
+
};
|
|
84
|
+
thumbnail: string;
|
|
85
|
+
result?: {
|
|
86
|
+
blob: {
|
|
87
|
+
readonly size: number;
|
|
88
|
+
readonly type: string;
|
|
89
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
90
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
91
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
92
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
93
|
+
text: () => Promise<string>;
|
|
94
|
+
};
|
|
95
|
+
file: {
|
|
96
|
+
readonly lastModified: number;
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly webkitRelativePath: string;
|
|
99
|
+
readonly size: number;
|
|
100
|
+
readonly type: string;
|
|
101
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
102
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
103
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
104
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
105
|
+
text: () => Promise<string>;
|
|
106
|
+
};
|
|
107
|
+
url: string;
|
|
108
|
+
coords: {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
rotation: number;
|
|
114
|
+
flipX: boolean;
|
|
115
|
+
flipY: boolean;
|
|
116
|
+
scale: number;
|
|
117
|
+
};
|
|
118
|
+
width: number;
|
|
119
|
+
height: number;
|
|
120
|
+
originalWidth: number;
|
|
121
|
+
originalHeight: number;
|
|
122
|
+
} | undefined;
|
|
123
|
+
status: "pending" | "cropping" | "done";
|
|
124
|
+
}[], QueueItem[] | {
|
|
125
|
+
id: string;
|
|
126
|
+
file: {
|
|
127
|
+
readonly lastModified: number;
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly webkitRelativePath: string;
|
|
130
|
+
readonly size: number;
|
|
131
|
+
readonly type: string;
|
|
132
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
133
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
134
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
135
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
136
|
+
text: () => Promise<string>;
|
|
137
|
+
};
|
|
138
|
+
thumbnail: string;
|
|
139
|
+
result?: {
|
|
140
|
+
blob: {
|
|
141
|
+
readonly size: number;
|
|
142
|
+
readonly type: string;
|
|
143
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
144
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
145
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
146
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
147
|
+
text: () => Promise<string>;
|
|
148
|
+
};
|
|
149
|
+
file: {
|
|
150
|
+
readonly lastModified: number;
|
|
151
|
+
readonly name: string;
|
|
152
|
+
readonly webkitRelativePath: string;
|
|
153
|
+
readonly size: number;
|
|
154
|
+
readonly type: string;
|
|
155
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
156
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
157
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
158
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
159
|
+
text: () => Promise<string>;
|
|
160
|
+
};
|
|
161
|
+
url: string;
|
|
162
|
+
coords: {
|
|
163
|
+
x: number;
|
|
164
|
+
y: number;
|
|
165
|
+
width: number;
|
|
166
|
+
height: number;
|
|
167
|
+
rotation: number;
|
|
168
|
+
flipX: boolean;
|
|
169
|
+
flipY: boolean;
|
|
170
|
+
scale: number;
|
|
171
|
+
};
|
|
172
|
+
width: number;
|
|
173
|
+
height: number;
|
|
174
|
+
originalWidth: number;
|
|
175
|
+
originalHeight: number;
|
|
176
|
+
} | undefined;
|
|
177
|
+
status: "pending" | "cropping" | "done";
|
|
178
|
+
}[]>;
|
|
179
|
+
current: import("vue").Ref<number, number>;
|
|
180
|
+
add: (files: File[]) => void;
|
|
181
|
+
remove: (index: number) => void;
|
|
182
|
+
select: (index: number) => void;
|
|
183
|
+
next: () => void;
|
|
184
|
+
previous: () => void;
|
|
185
|
+
clear: () => void;
|
|
186
|
+
results: import("vue").ComputedRef<import("@cropvue/core").CropResult[]>;
|
|
187
|
+
};
|
|
188
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
189
|
+
select: (item: QueueItem) => any;
|
|
190
|
+
change: (items: QueueItem[]) => any;
|
|
191
|
+
remove: (item: QueueItem) => any;
|
|
192
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
193
|
+
onSelect?: ((item: QueueItem) => any) | undefined;
|
|
194
|
+
onChange?: ((items: QueueItem[]) => any) | undefined;
|
|
195
|
+
onRemove?: ((item: QueueItem) => any) | undefined;
|
|
196
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
197
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
198
|
+
export default _default;
|
|
199
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
200
|
+
new (): {
|
|
201
|
+
$slots: S;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=CropQueue.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropQueue.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropQueue.vue"],"names":[],"mappings":"AAsJA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAW9C,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,QAKhC;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,QAMhC;AAiGD,QAAA,IAAI,OAAO;;;;;;;;;;;yBAlFkB,CAAC,aAAa,CAAC,qBAAqB,CAAC;;;;;;;;;;;6BAad,CAAC,aAAa,CAAC,qBACnE,CAAC;;;;;;;;;;;;6BAciC,CAAC,aAEjC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDH,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;;;;;;;6BA1GQ,CAAC,aAAa,CAAC,qBAAqB,CAAC;;;;;kBAM5C,CAAC;;;;;;iCAO6B,CAAC,aAAa,CAAC,qBACnE,CAAC;;;;;;;;;;;;iCAciC,CAAC,aAEjC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0CzB,CAAC,aAGK,CAAC,qBAAqB,CAAC;;;;;kBAGP,CAAC;;;;;;iCAMT,CAAA,aAAa,CAAC,qBAC3B,CAAC;;;;;;;;;;;;iCAgBqB,CAAC,aAAa,CAAC,qBAG9B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFASP,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CropState, Point } from '@cropvue/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
crop: CropState;
|
|
4
|
+
containerWidth: number;
|
|
5
|
+
containerHeight: number;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {
|
|
8
|
+
crop: CropState;
|
|
9
|
+
stencil: import("@cropvue/core").StencilType;
|
|
10
|
+
points: Point[] | undefined;
|
|
11
|
+
style: {
|
|
12
|
+
clipPath: string;
|
|
13
|
+
WebkitClipPath: string;
|
|
14
|
+
};
|
|
15
|
+
clipPath: string;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
default?: (props: typeof __VLS_1) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=CropStencil.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropStencil.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropStencil.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC;AA0DF,QAAA,IAAI,OAAO;;;;;;;;;CAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAqB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { TransformState } from '@cropvue/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
transform: TransformState;
|
|
4
|
+
};
|
|
5
|
+
declare function rotateLeft(): void;
|
|
6
|
+
declare function rotateRight(): void;
|
|
7
|
+
declare function flipX(): void;
|
|
8
|
+
declare function flipY(): void;
|
|
9
|
+
declare function zoomIn(): void;
|
|
10
|
+
declare function zoomOut(): void;
|
|
11
|
+
declare function reset(): void;
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
rotateLeft: typeof rotateLeft;
|
|
14
|
+
rotateRight: typeof rotateRight;
|
|
15
|
+
flipX: typeof flipX;
|
|
16
|
+
flipY: typeof flipY;
|
|
17
|
+
zoomIn: typeof zoomIn;
|
|
18
|
+
zoomOut: typeof zoomOut;
|
|
19
|
+
reset: typeof reset;
|
|
20
|
+
transform: TransformState;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_Slots = {} & {
|
|
23
|
+
default?: (props: typeof __VLS_1) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
+
"rotate-left": () => any;
|
|
27
|
+
"rotate-right": () => any;
|
|
28
|
+
"flip-x": () => any;
|
|
29
|
+
"flip-y": () => any;
|
|
30
|
+
"zoom-in": () => any;
|
|
31
|
+
"zoom-out": () => any;
|
|
32
|
+
reset: () => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
+
"onRotate-left"?: (() => any) | undefined;
|
|
35
|
+
"onRotate-right"?: (() => any) | undefined;
|
|
36
|
+
"onFlip-x"?: (() => any) | undefined;
|
|
37
|
+
"onFlip-y"?: (() => any) | undefined;
|
|
38
|
+
"onZoom-in"?: (() => any) | undefined;
|
|
39
|
+
"onZoom-out"?: (() => any) | undefined;
|
|
40
|
+
onReset?: (() => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=CropToolbar.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CropToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/components/CropToolbar.vue"],"names":[],"mappings":"AAAA,OA4IO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,cAAc,CAAA;CAC1B,CAAC;AAcF,iBAAS,UAAU,SAA0B;AAC7C,iBAAS,WAAW,SAA2B;AAC/C,iBAAS,KAAK,SAAqB;AACnC,iBAAS,KAAK,SAAqB;AACnC,iBAAS,MAAM,SAAsB;AACrC,iBAAS,OAAO,SAAuB;AACvC,iBAAS,KAAK,SAAoB;AAiNlC,QAAA,IAAI,OAAO;;;;;;;;;CAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA2B/C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|