@pixeasy/customizer-stage 0.0.8-beta → 0.0.8
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/assets/fonts/Lato-Bold.ttf +0 -0
- package/assets/fonts/Lato-Italic.ttf +0 -0
- package/assets/fonts/Lato-Regular.ttf +0 -0
- package/index.d.ts +99 -0
- package/package.json +1 -1
- package/pixeasy-customizer.css +1 -1
- package/pixeasy-customizer.min.js +288 -265
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface SdkElementConfig {
|
|
|
7
7
|
locale?: string;
|
|
8
8
|
theme?: string;
|
|
9
9
|
readonly?: boolean;
|
|
10
|
+
copiedDesignState?: any;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface PixeasyOpenOptions extends SdkElementConfig {
|
|
@@ -31,9 +32,12 @@ export interface ErrorEventDetail {
|
|
|
31
32
|
|
|
32
33
|
export interface SubmissionSuccessEventDetail {
|
|
33
34
|
productId?: string;
|
|
35
|
+
selectedVariantId?: string;
|
|
36
|
+
variantIdentifier?: string;
|
|
34
37
|
views?: string[];
|
|
35
38
|
submissionNumber: string;
|
|
36
39
|
personalizationPlacements: SubmissionPersonalizationPlacementDetail[];
|
|
40
|
+
isCopyAfterSave?: boolean;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface SubmissionPersonalizationPlacementDetail {
|
|
@@ -41,6 +45,17 @@ export interface SubmissionPersonalizationPlacementDetail {
|
|
|
41
45
|
type: 'logo' | 'text';
|
|
42
46
|
value: string | null;
|
|
43
47
|
logoUrl: string | null;
|
|
48
|
+
snapshotId?: string | null;
|
|
49
|
+
designAreaSizeRanges?: Array<{
|
|
50
|
+
sizeRangeId: string;
|
|
51
|
+
name: string;
|
|
52
|
+
isDefault: boolean;
|
|
53
|
+
sizes: string[];
|
|
54
|
+
printableWidthInches: number;
|
|
55
|
+
printableHeightInches: number;
|
|
56
|
+
}>;
|
|
57
|
+
printableWidthInches?: number;
|
|
58
|
+
printableHeightInches?: number;
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
export interface SubmissionFailedEventDetail {
|
|
@@ -57,11 +72,61 @@ export const SDK_EVENTS: {
|
|
|
57
72
|
readonly SUBMISSION_FAILED: 'submission:failed';
|
|
58
73
|
readonly ERROR: 'error';
|
|
59
74
|
readonly CLOSED: 'closed';
|
|
75
|
+
readonly COPY_DESIGN: 'copy-design';
|
|
60
76
|
};
|
|
61
77
|
|
|
62
78
|
export type BuilderEventName = (typeof SDK_EVENTS)[keyof typeof SDK_EVENTS];
|
|
63
79
|
export type UrlOrText = { type: 'url'; value: string } | { type: 'text'; value: string };
|
|
64
80
|
|
|
81
|
+
export interface ArtworkEditorDocument {
|
|
82
|
+
id: string;
|
|
83
|
+
title: string;
|
|
84
|
+
backgroundMode: 'white' | 'transparent';
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
elements: Array<Record<string, unknown>>;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ArtworkEditorOpenOptions {
|
|
93
|
+
container: string | HTMLElement;
|
|
94
|
+
title?: string;
|
|
95
|
+
readonly?: boolean;
|
|
96
|
+
theme?: string;
|
|
97
|
+
document?: ArtworkEditorDocument | null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ArtworkEditorReadyEventDetail {
|
|
101
|
+
documentId: string;
|
|
102
|
+
title: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface ArtworkEditorDocumentChangedEventDetail {
|
|
106
|
+
document: ArtworkEditorDocument;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface ArtworkEditorSavedEventDetail {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
savedAt: string;
|
|
113
|
+
svg: string;
|
|
114
|
+
json: string;
|
|
115
|
+
document: ArtworkEditorDocument;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface ArtworkEditorErrorEventDetail {
|
|
119
|
+
code: 'INVALID_CONFIG' | 'DOCUMENT_ERROR' | 'EXPORT_FAILED' | 'RUNTIME_ERROR';
|
|
120
|
+
message: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type ArtworkEditorBuilderEventName =
|
|
124
|
+
| 'artwork-editor:ready'
|
|
125
|
+
| 'artwork-editor:document-changed'
|
|
126
|
+
| 'artwork-editor:saved'
|
|
127
|
+
| 'artwork-editor:error'
|
|
128
|
+
| 'artwork-editor:closed';
|
|
129
|
+
|
|
65
130
|
export class PixeasyBuilder {
|
|
66
131
|
open(options: PixeasyOpenOptions): this;
|
|
67
132
|
on<K extends BuilderEventName>(
|
|
@@ -74,6 +139,7 @@ export class PixeasyBuilder {
|
|
|
74
139
|
[typeof SDK_EVENTS.SUBMISSION_FAILED]: SubmissionFailedEventDetail;
|
|
75
140
|
[typeof SDK_EVENTS.ERROR]: ErrorEventDetail;
|
|
76
141
|
[typeof SDK_EVENTS.CLOSED]: undefined;
|
|
142
|
+
[typeof SDK_EVENTS.COPY_DESIGN]: any;
|
|
77
143
|
}[K],
|
|
78
144
|
) => void,
|
|
79
145
|
): this;
|
|
@@ -87,6 +153,7 @@ export class PixeasyBuilder {
|
|
|
87
153
|
[typeof SDK_EVENTS.SUBMISSION_FAILED]: SubmissionFailedEventDetail;
|
|
88
154
|
[typeof SDK_EVENTS.ERROR]: ErrorEventDetail;
|
|
89
155
|
[typeof SDK_EVENTS.CLOSED]: undefined;
|
|
156
|
+
[typeof SDK_EVENTS.COPY_DESIGN]: any;
|
|
90
157
|
}[K],
|
|
91
158
|
) => void,
|
|
92
159
|
): this;
|
|
@@ -97,6 +164,38 @@ export class PixeasyBuilder {
|
|
|
97
164
|
export function createPixeasyBuilder(): PixeasyBuilder;
|
|
98
165
|
export function definePixeasyCustomizerElement(): void;
|
|
99
166
|
|
|
167
|
+
export class ArtworkEditorBuilder {
|
|
168
|
+
open(options: ArtworkEditorOpenOptions): this;
|
|
169
|
+
on<K extends ArtworkEditorBuilderEventName>(
|
|
170
|
+
name: K,
|
|
171
|
+
handler: (
|
|
172
|
+
payload: {
|
|
173
|
+
'artwork-editor:ready': ArtworkEditorReadyEventDetail;
|
|
174
|
+
'artwork-editor:document-changed': ArtworkEditorDocumentChangedEventDetail;
|
|
175
|
+
'artwork-editor:saved': ArtworkEditorSavedEventDetail;
|
|
176
|
+
'artwork-editor:error': ArtworkEditorErrorEventDetail;
|
|
177
|
+
'artwork-editor:closed': undefined;
|
|
178
|
+
}[K],
|
|
179
|
+
) => void,
|
|
180
|
+
): this;
|
|
181
|
+
off<K extends ArtworkEditorBuilderEventName>(
|
|
182
|
+
name: K,
|
|
183
|
+
handler: (
|
|
184
|
+
payload: {
|
|
185
|
+
'artwork-editor:ready': ArtworkEditorReadyEventDetail;
|
|
186
|
+
'artwork-editor:document-changed': ArtworkEditorDocumentChangedEventDetail;
|
|
187
|
+
'artwork-editor:saved': ArtworkEditorSavedEventDetail;
|
|
188
|
+
'artwork-editor:error': ArtworkEditorErrorEventDetail;
|
|
189
|
+
'artwork-editor:closed': undefined;
|
|
190
|
+
}[K],
|
|
191
|
+
) => void,
|
|
192
|
+
): this;
|
|
193
|
+
close(emitClosed?: Boolean): this;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function createPixeasyArtworkEditorBuilder(): ArtworkEditorBuilder;
|
|
197
|
+
export function definePixeasyArtworkEditorElement(): void;
|
|
198
|
+
|
|
100
199
|
export type ThumbnailView = 'front' | 'right' | 'back' | 'left';
|
|
101
200
|
|
|
102
201
|
export interface GeneratedThumbnail {
|