shop-components 0.1.10 → 0.1.11
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/dist/cropper/index.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
2
2
|
import { Application } from 'pixi.js';
|
|
3
3
|
import { Texture as Texture3 } from 'three';
|
|
4
4
|
import { Viewport } from 'pixi-viewport';
|
|
5
|
+
export interface CropperConfigs {
|
|
6
|
+
canvasWidth: number;
|
|
7
|
+
canvasHeight: number;
|
|
8
|
+
scale: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
5
13
|
export declare class Cropper extends LitElement {
|
|
6
14
|
static styles: import("lit").CSSResult;
|
|
7
15
|
private _domBoundingRect;
|
|
@@ -15,6 +23,8 @@ export declare class Cropper extends LitElement {
|
|
|
15
23
|
width: number;
|
|
16
24
|
height: number;
|
|
17
25
|
};
|
|
26
|
+
private _imageUrl;
|
|
27
|
+
private _canvasScale;
|
|
18
28
|
texture: Texture3;
|
|
19
29
|
private _timer;
|
|
20
30
|
private _sprite;
|
|
@@ -31,16 +41,17 @@ export declare class Cropper extends LitElement {
|
|
|
31
41
|
width: number;
|
|
32
42
|
height: number;
|
|
33
43
|
};
|
|
44
|
+
getConfigs: () => CropperConfigs;
|
|
34
45
|
constructor();
|
|
46
|
+
private _onChanged;
|
|
47
|
+
private _wheelEvent;
|
|
35
48
|
resize(width: number, height: number): void;
|
|
36
49
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
37
|
-
add(url: string,
|
|
38
|
-
width: number;
|
|
39
|
-
height: number;
|
|
40
|
-
}, logoSize: {
|
|
50
|
+
add(url: string, logoSize: {
|
|
41
51
|
width: number;
|
|
42
52
|
height: number;
|
|
43
53
|
}): Promise<void>;
|
|
54
|
+
updateConfigs: ({ canvasWidth, x, y, scale, url }: CropperConfigs) => Promise<void>;
|
|
44
55
|
fit(): void;
|
|
45
56
|
disconnectedCallback(): void;
|
|
46
57
|
protected render(): unknown;
|
|
@@ -23,7 +23,12 @@ export declare class DeviceViewer extends LitElement {
|
|
|
23
23
|
shelfLevel: number;
|
|
24
24
|
shapeKeys: Map<any, any>;
|
|
25
25
|
colors: Skin[];
|
|
26
|
+
selectedLogo: Logo | undefined;
|
|
26
27
|
logos: Logo[];
|
|
28
|
+
logoSize: {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
27
32
|
progressBar: HTMLDivElement | undefined;
|
|
28
33
|
cropperContainer: HTMLDivElement | undefined;
|
|
29
34
|
lineCircles: HTMLDivElement[] | undefined;
|
|
@@ -46,7 +51,10 @@ export declare class DeviceViewer extends LitElement {
|
|
|
46
51
|
changeGoodsSize: (e: any) => void;
|
|
47
52
|
changeColor: (s: Skin, value: string) => void;
|
|
48
53
|
selectLogo: (l: Logo) => void;
|
|
54
|
+
selectImage: (e: Event) => void;
|
|
49
55
|
resetLogo: (l: Logo) => void;
|
|
56
|
+
loadConfigs: () => void;
|
|
57
|
+
saveConfigs: (l: Logo) => void;
|
|
50
58
|
dragstart: (e: DragEvent) => void;
|
|
51
59
|
dragend: (e: DragEvent) => void;
|
|
52
60
|
getShapeKeyValue: (key: string) => any;
|
|
@@ -35,6 +35,7 @@ export declare class Logo {
|
|
|
35
35
|
private _props;
|
|
36
36
|
name: string;
|
|
37
37
|
imageUrl?: string;
|
|
38
|
+
target: Mesh;
|
|
38
39
|
get imageSize(): {
|
|
39
40
|
width: number;
|
|
40
41
|
height: number;
|
|
@@ -43,12 +44,9 @@ export declare class Logo {
|
|
|
43
44
|
width: number;
|
|
44
45
|
height: number;
|
|
45
46
|
};
|
|
46
|
-
private _defaults;
|
|
47
|
+
private readonly _defaults;
|
|
47
48
|
constructor(_props: LogoProps);
|
|
48
|
-
change(url: string
|
|
49
|
-
width: number;
|
|
50
|
-
height: number;
|
|
51
|
-
}): void;
|
|
49
|
+
change(url: string): void;
|
|
52
50
|
reset(): void;
|
|
53
51
|
}
|
|
54
52
|
export declare class Skin {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, Mesh, Object3D, Vector3 } from 'three';
|
|
1
|
+
import { Box3, Mesh, Object3D, Vector2, Vector3 } from 'three';
|
|
2
2
|
export declare const clearThreeObjectMesh: (object: Object3D) => void;
|
|
3
3
|
export declare const uuid: () => string;
|
|
4
4
|
export declare function getElementLeftPosition(element: any): {
|
|
@@ -38,3 +38,4 @@ export declare const generateLogoSize: (m: Mesh) => {
|
|
|
38
38
|
width: number;
|
|
39
39
|
height: number;
|
|
40
40
|
};
|
|
41
|
+
export declare function findPositionFromUV(mesh: Mesh, targetUV: Vector2): Vector3 | null;
|