@pixeasy/customizer-stage 0.0.14-beta → 0.0.14

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.
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixeasy/customizer-stage",
3
- "version": "0.0.14-beta",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {