@pixeasy/customizer-stage 0.0.1 → 0.0.2
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 +81 -0
- package/package.json +33 -33
- package/pixeasy-customizer.css +1 -1
- package/pixeasy-customizer.min.js +282 -261
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -78,6 +78,55 @@ export const SDK_EVENTS: {
|
|
|
78
78
|
export type BuilderEventName = (typeof SDK_EVENTS)[keyof typeof SDK_EVENTS];
|
|
79
79
|
export type UrlOrText = { type: 'url'; value: string } | { type: 'text'; value: string };
|
|
80
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
|
+
|
|
81
130
|
export class PixeasyBuilder {
|
|
82
131
|
open(options: PixeasyOpenOptions): this;
|
|
83
132
|
on<K extends BuilderEventName>(
|
|
@@ -115,6 +164,38 @@ export class PixeasyBuilder {
|
|
|
115
164
|
export function createPixeasyBuilder(): PixeasyBuilder;
|
|
116
165
|
export function definePixeasyCustomizerElement(): void;
|
|
117
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
|
+
|
|
118
199
|
export type ThumbnailView = 'front' | 'right' | 'back' | 'left';
|
|
119
200
|
|
|
120
201
|
export interface GeneratedThumbnail {
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pixeasy/customizer-stage",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"main": "./pixeasy-customizer.min.js",
|
|
10
|
-
"module": "./pixeasy-customizer.min.js",
|
|
11
|
-
"types": "./index.d.ts",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./index.d.ts",
|
|
15
|
-
"import": "./pixeasy-customizer.min.js",
|
|
16
|
-
"default": "./pixeasy-customizer.min.js"
|
|
17
|
-
},
|
|
18
|
-
"./styles.css": "./pixeasy-customizer.css",
|
|
19
|
-
"./pixeasy-customizer.css": "./pixeasy-customizer.css"
|
|
20
|
-
},
|
|
21
|
-
"sideEffects": [
|
|
22
|
-
"./pixeasy-customizer.min.js",
|
|
23
|
-
"./pixeasy-customizer.css"
|
|
24
|
-
],
|
|
25
|
-
"files": [
|
|
26
|
-
"pixeasy-customizer.min.js",
|
|
27
|
-
"pixeasy-customizer.css",
|
|
28
|
-
"index.d.ts",
|
|
29
|
-
"README.md",
|
|
30
|
-
"LICENSE",
|
|
31
|
-
"assets",
|
|
32
|
-
"media"
|
|
33
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "@pixeasy/customizer-stage",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "./pixeasy-customizer.min.js",
|
|
10
|
+
"module": "./pixeasy-customizer.min.js",
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./pixeasy-customizer.min.js",
|
|
16
|
+
"default": "./pixeasy-customizer.min.js"
|
|
17
|
+
},
|
|
18
|
+
"./styles.css": "./pixeasy-customizer.css",
|
|
19
|
+
"./pixeasy-customizer.css": "./pixeasy-customizer.css"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"./pixeasy-customizer.min.js",
|
|
23
|
+
"./pixeasy-customizer.css"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"pixeasy-customizer.min.js",
|
|
27
|
+
"pixeasy-customizer.css",
|
|
28
|
+
"index.d.ts",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"assets",
|
|
32
|
+
"media"
|
|
33
|
+
]
|
|
34
34
|
}
|