@varianta/sdk 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/README.md +254 -0
- package/dist/index.cjs.js +8 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +2354 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +8 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/react/Customizer.d.ts +119 -0
- package/dist/types/react/Customizer.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +10 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/react/useCustomizer.d.ts +133 -0
- package/dist/types/react/useCustomizer.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +298 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/vanilla/index.d.ts +36 -0
- package/dist/types/vanilla/index.d.ts.map +1 -0
- package/dist/types/vue/index.d.ts +8 -0
- package/dist/types/vue/index.d.ts.map +1 -0
- package/dist/types/vue/types.d.ts +60 -0
- package/dist/types/vue/types.d.ts.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Customizer.d.ts","sourceRoot":"","sources":["../../../src/react/Customizer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAEV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAExC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAEjD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;CAAG;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,UAAU,8GA2NtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React SDK exports
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export { Customizer } from './Customizer';
|
|
6
|
+
export type { CustomizerProps, CustomizerHandle } from './Customizer';
|
|
7
|
+
export { useCustomizer } from './useCustomizer';
|
|
8
|
+
export type { UseCustomizerOptions, UseCustomizerReturn } from './useCustomizer';
|
|
9
|
+
export type * from '../types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGjF,mBAAmB,UAAU,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hook for controlling the customizer editor
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import type { CustomizerHandle } from './Customizer';
|
|
6
|
+
import type { DesignJSON, FinalizeResult } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Options for the useCustomizer hook
|
|
9
|
+
*/
|
|
10
|
+
export interface UseCustomizerOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Auto-save design to localStorage
|
|
13
|
+
*/
|
|
14
|
+
autoSave?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* localStorage key for auto-save
|
|
17
|
+
* @default 'customizer-design'
|
|
18
|
+
*/
|
|
19
|
+
autoSaveKey?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Debounce time for auto-save in ms
|
|
22
|
+
* @default 1000
|
|
23
|
+
*/
|
|
24
|
+
autoSaveDebounce?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Return type for useCustomizer hook
|
|
28
|
+
*/
|
|
29
|
+
export interface UseCustomizerReturn {
|
|
30
|
+
/**
|
|
31
|
+
* Ref to attach to the Customizer component
|
|
32
|
+
*/
|
|
33
|
+
customizerRef: React.RefObject<CustomizerHandle>;
|
|
34
|
+
/**
|
|
35
|
+
* Current design state
|
|
36
|
+
*/
|
|
37
|
+
design: DesignJSON | null;
|
|
38
|
+
/**
|
|
39
|
+
* Whether undo is available
|
|
40
|
+
*/
|
|
41
|
+
canUndo: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether redo is available
|
|
44
|
+
*/
|
|
45
|
+
canRedo: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Selected layer ID
|
|
48
|
+
*/
|
|
49
|
+
selectedLayerId: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Whether finalization is in progress
|
|
52
|
+
*/
|
|
53
|
+
isFinalizing: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Finalization result
|
|
56
|
+
*/
|
|
57
|
+
finalizeResult: FinalizeResult | null;
|
|
58
|
+
/**
|
|
59
|
+
* Get the current design
|
|
60
|
+
*/
|
|
61
|
+
getDesign: () => DesignJSON | null;
|
|
62
|
+
/**
|
|
63
|
+
* Set a new design
|
|
64
|
+
*/
|
|
65
|
+
setDesign: (design: DesignJSON) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Undo the last action
|
|
68
|
+
*/
|
|
69
|
+
undo: () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Redo the last undone action
|
|
72
|
+
*/
|
|
73
|
+
redo: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Finalize the design
|
|
76
|
+
*/
|
|
77
|
+
finalize: () => Promise<FinalizeResult | null>;
|
|
78
|
+
/**
|
|
79
|
+
* Add a text layer
|
|
80
|
+
*/
|
|
81
|
+
addTextLayer: (text?: string) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Add an image layer
|
|
84
|
+
*/
|
|
85
|
+
addImageLayer: (url: string) => Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove a layer
|
|
88
|
+
*/
|
|
89
|
+
removeLayer: (layerId: string) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Select a layer
|
|
92
|
+
*/
|
|
93
|
+
selectLayer: (layerId: string | null) => void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* React hook for controlling the customizer editor
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* import { Customizer } from '@varianta/sdk/react';
|
|
101
|
+
* import { useCustomizer } from '@varianta/sdk/react';
|
|
102
|
+
*
|
|
103
|
+
* function App() {
|
|
104
|
+
* const {
|
|
105
|
+
* customizerRef,
|
|
106
|
+
* design,
|
|
107
|
+
* canUndo,
|
|
108
|
+
* canRedo,
|
|
109
|
+
* undo,
|
|
110
|
+
* redo,
|
|
111
|
+
* finalize,
|
|
112
|
+
* isFinalizing,
|
|
113
|
+
* } = useCustomizer({ autoSave: true });
|
|
114
|
+
*
|
|
115
|
+
* return (
|
|
116
|
+
* <>
|
|
117
|
+
* <Customizer
|
|
118
|
+
* ref={customizerRef}
|
|
119
|
+
* templateId="tshirt-001"
|
|
120
|
+
* onChange={(d) => console.log('Changed:', d)}
|
|
121
|
+
* />
|
|
122
|
+
* <button onClick={undo} disabled={!canUndo}>Undo</button>
|
|
123
|
+
* <button onClick={redo} disabled={!canRedo}>Redo</button>
|
|
124
|
+
* <button onClick={finalize} disabled={isFinalizing}>
|
|
125
|
+
* {isFinalizing ? 'Finalizing...' : 'Finalize'}
|
|
126
|
+
* </button>
|
|
127
|
+
* </>
|
|
128
|
+
* );
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export declare function useCustomizer(options?: UseCustomizerOptions): UseCustomizerReturn;
|
|
133
|
+
//# sourceMappingURL=useCustomizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCustomizer.d.ts","sourceRoot":"","sources":["../../../src/react/useCustomizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,O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AEG;IACH,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CA6JrB"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript types for the Customizer SDK
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 2D transformation properties for positioning and transforming layers
|
|
7
|
+
*/
|
|
8
|
+
export interface Transform {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
rotation: number;
|
|
12
|
+
scaleX: number;
|
|
13
|
+
scaleY: number;
|
|
14
|
+
}
|
|
15
|
+
export type LayerType = 'text' | 'image' | 'shape';
|
|
16
|
+
export interface BaseLayer {
|
|
17
|
+
id: string;
|
|
18
|
+
type: LayerType;
|
|
19
|
+
name: string;
|
|
20
|
+
locked: boolean;
|
|
21
|
+
visible: boolean;
|
|
22
|
+
transform: Transform;
|
|
23
|
+
zIndex: number;
|
|
24
|
+
}
|
|
25
|
+
export type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
26
|
+
export interface TextLayer extends BaseLayer {
|
|
27
|
+
type: 'text';
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
fontSize: number;
|
|
30
|
+
color: string;
|
|
31
|
+
align: TextAlign;
|
|
32
|
+
content: string;
|
|
33
|
+
fontWeight?: number | string;
|
|
34
|
+
lineHeight?: number;
|
|
35
|
+
letterSpacing?: number;
|
|
36
|
+
clipX?: number;
|
|
37
|
+
clipY?: number;
|
|
38
|
+
clipWidth?: number;
|
|
39
|
+
clipHeight?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface ImageCrop {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ImageLayer extends BaseLayer {
|
|
48
|
+
type: 'image';
|
|
49
|
+
assetId: string;
|
|
50
|
+
crop?: ImageCrop;
|
|
51
|
+
opacity: number;
|
|
52
|
+
fitWidth?: number;
|
|
53
|
+
fitHeight?: number;
|
|
54
|
+
clipX?: number;
|
|
55
|
+
clipY?: number;
|
|
56
|
+
clipWidth?: number;
|
|
57
|
+
clipHeight?: number;
|
|
58
|
+
}
|
|
59
|
+
export type ShapeType = 'rectangle' | 'circle' | 'ellipse' | 'line';
|
|
60
|
+
export interface Stroke {
|
|
61
|
+
color: string;
|
|
62
|
+
width: number;
|
|
63
|
+
}
|
|
64
|
+
export interface ShapeLayer extends BaseLayer {
|
|
65
|
+
type: 'shape';
|
|
66
|
+
shapeType: ShapeType;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
fill: string;
|
|
70
|
+
stroke?: Stroke;
|
|
71
|
+
}
|
|
72
|
+
export type Layer = TextLayer | ImageLayer | ShapeLayer;
|
|
73
|
+
export interface SafeArea {
|
|
74
|
+
top: number;
|
|
75
|
+
right: number;
|
|
76
|
+
bottom: number;
|
|
77
|
+
left: number;
|
|
78
|
+
}
|
|
79
|
+
export interface Artboard {
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
bleed: number;
|
|
83
|
+
safeArea?: SafeArea;
|
|
84
|
+
backgroundColor: string;
|
|
85
|
+
}
|
|
86
|
+
export interface Scene {
|
|
87
|
+
artboard: Artboard;
|
|
88
|
+
layers: Layer[];
|
|
89
|
+
engineVersion: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Design JSON format returned by the editor
|
|
93
|
+
*/
|
|
94
|
+
export interface DesignJSON {
|
|
95
|
+
version: string;
|
|
96
|
+
scene: Scene;
|
|
97
|
+
metadata?: {
|
|
98
|
+
createdAt?: string;
|
|
99
|
+
modifiedAt?: string;
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Configuration options for initializing the customizer
|
|
105
|
+
*/
|
|
106
|
+
export interface CustomizerOptions {
|
|
107
|
+
/**
|
|
108
|
+
* Template ID to load
|
|
109
|
+
*/
|
|
110
|
+
templateId: string;
|
|
111
|
+
/**
|
|
112
|
+
* API base URL for fetching templates and finalizing designs
|
|
113
|
+
* @default 'https://api.varianta.io'
|
|
114
|
+
*/
|
|
115
|
+
apiUrl?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Visual theme
|
|
118
|
+
* @default 'light'
|
|
119
|
+
*/
|
|
120
|
+
theme?: 'light' | 'dark';
|
|
121
|
+
/**
|
|
122
|
+
* Editor mode
|
|
123
|
+
* @default 'edit'
|
|
124
|
+
*/
|
|
125
|
+
mode?: 'edit' | 'preview';
|
|
126
|
+
/**
|
|
127
|
+
* Enable debug mode with additional logging
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
debug?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Custom CSS class to add to the editor container
|
|
133
|
+
*/
|
|
134
|
+
className?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Initial design data to load
|
|
137
|
+
*/
|
|
138
|
+
initialDesign?: DesignJSON;
|
|
139
|
+
/**
|
|
140
|
+
* Called when the editor is ready
|
|
141
|
+
*/
|
|
142
|
+
onReady?: (instance: CustomizerInstance) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Called when the design changes
|
|
145
|
+
*/
|
|
146
|
+
onChange?: (design: DesignJSON) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Called when a layer is selected
|
|
149
|
+
*/
|
|
150
|
+
onLayerSelect?: (layerId: string | null) => void;
|
|
151
|
+
/**
|
|
152
|
+
* Called when a layer is added
|
|
153
|
+
*/
|
|
154
|
+
onLayerAdd?: (layerId: string) => void;
|
|
155
|
+
/**
|
|
156
|
+
* Called when a layer is removed
|
|
157
|
+
*/
|
|
158
|
+
onLayerRemove?: (layerId: string) => void;
|
|
159
|
+
/**
|
|
160
|
+
* Called when a layer is updated
|
|
161
|
+
*/
|
|
162
|
+
onLayerUpdate?: (layerId: string) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Called when an error occurs
|
|
165
|
+
*/
|
|
166
|
+
onError?: (error: CustomizerError) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Called when finalization is complete
|
|
169
|
+
*/
|
|
170
|
+
onFinalize?: (result: FinalizeResult) => void;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Error object returned by the customizer
|
|
174
|
+
*/
|
|
175
|
+
export interface CustomizerError {
|
|
176
|
+
code: string;
|
|
177
|
+
message: string;
|
|
178
|
+
details?: any;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Result of the finalize operation
|
|
182
|
+
*/
|
|
183
|
+
export interface FinalizeResult {
|
|
184
|
+
designId: string;
|
|
185
|
+
proofUrl: string;
|
|
186
|
+
printUrl?: string;
|
|
187
|
+
renderKey: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Methods available on a customizer instance
|
|
191
|
+
*/
|
|
192
|
+
export interface CustomizerInstance {
|
|
193
|
+
/**
|
|
194
|
+
* Get the current design as JSON
|
|
195
|
+
*/
|
|
196
|
+
getDesign(): DesignJSON;
|
|
197
|
+
/**
|
|
198
|
+
* Set the design from JSON
|
|
199
|
+
*/
|
|
200
|
+
setDesign(design: DesignJSON): void;
|
|
201
|
+
/**
|
|
202
|
+
* Undo the last action
|
|
203
|
+
*/
|
|
204
|
+
undo(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Redo the last undone action
|
|
207
|
+
*/
|
|
208
|
+
redo(): void;
|
|
209
|
+
/**
|
|
210
|
+
* Check if undo is available
|
|
211
|
+
*/
|
|
212
|
+
canUndo(): boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Check if redo is available
|
|
215
|
+
*/
|
|
216
|
+
canRedo(): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Finalize the design and generate print-ready files
|
|
219
|
+
*/
|
|
220
|
+
finalize(): Promise<FinalizeResult>;
|
|
221
|
+
/**
|
|
222
|
+
* Add a text layer
|
|
223
|
+
*/
|
|
224
|
+
addTextLayer(text?: string): void;
|
|
225
|
+
/**
|
|
226
|
+
* Add an image layer
|
|
227
|
+
*/
|
|
228
|
+
addImageLayer(url: string): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Remove a layer by ID
|
|
231
|
+
*/
|
|
232
|
+
removeLayer(layerId: string): void;
|
|
233
|
+
/**
|
|
234
|
+
* Select a layer by ID
|
|
235
|
+
*/
|
|
236
|
+
selectLayer(layerId: string | null): void;
|
|
237
|
+
/**
|
|
238
|
+
* Get the selected layer ID
|
|
239
|
+
*/
|
|
240
|
+
getSelectedLayerId(): string | null;
|
|
241
|
+
/**
|
|
242
|
+
* Set the theme
|
|
243
|
+
*/
|
|
244
|
+
setTheme(theme: 'light' | 'dark'): void;
|
|
245
|
+
/**
|
|
246
|
+
* Set the mode
|
|
247
|
+
*/
|
|
248
|
+
setMode(mode: 'edit' | 'preview'): void;
|
|
249
|
+
/**
|
|
250
|
+
* Destroy the editor instance and clean up
|
|
251
|
+
*/
|
|
252
|
+
destroy(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Get the underlying Web Component element
|
|
255
|
+
*/
|
|
256
|
+
getElement(): HTMLElement;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Event detail types
|
|
260
|
+
*/
|
|
261
|
+
export interface ReadyEventDetail {
|
|
262
|
+
templateId: string;
|
|
263
|
+
}
|
|
264
|
+
export interface ChangeEventDetail {
|
|
265
|
+
design: DesignJSON;
|
|
266
|
+
}
|
|
267
|
+
export interface LayerSelectEventDetail {
|
|
268
|
+
layerId: string | null;
|
|
269
|
+
}
|
|
270
|
+
export interface LayerAddEventDetail {
|
|
271
|
+
layerId: string;
|
|
272
|
+
}
|
|
273
|
+
export interface LayerRemoveEventDetail {
|
|
274
|
+
layerId: string;
|
|
275
|
+
}
|
|
276
|
+
export interface LayerUpdateEventDetail {
|
|
277
|
+
layerId: string;
|
|
278
|
+
}
|
|
279
|
+
export interface ErrorEventDetail {
|
|
280
|
+
error: CustomizerError;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Web Component element interface for type safety
|
|
284
|
+
*/
|
|
285
|
+
export interface CustomizerEditorElement extends HTMLElement {
|
|
286
|
+
getDesign(): DesignJSON;
|
|
287
|
+
setDesign(design: DesignJSON): void;
|
|
288
|
+
undo(): void;
|
|
289
|
+
redo(): void;
|
|
290
|
+
canUndo(): boolean;
|
|
291
|
+
canRedo(): boolean;
|
|
292
|
+
addTextLayer(text?: string): void;
|
|
293
|
+
addImageLayer(url: string): Promise<void>;
|
|
294
|
+
removeLayer(layerId: string): void;
|
|
295
|
+
selectLayer(layerId: string | null): void;
|
|
296
|
+
getSelectedLayerId(): string | null;
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;C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AsB;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,eAAe,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,SAAS,IAAI,UAAU,CAAC;IACxB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,OAAO,CAAC;IACnB,OAAO,IAAI,OAAO,CAAC;IACnB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vanilla JavaScript SDK for Customizer Editor
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import type { CustomizerOptions, CustomizerInstance } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Initialize the customizer editor
|
|
8
|
+
*
|
|
9
|
+
* @param elementOrSelector - DOM element or CSS selector where to mount the editor
|
|
10
|
+
* @param options - Configuration options
|
|
11
|
+
* @returns CustomizerInstance with methods to control the editor
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { initCustomizer } from '@varianta/sdk';
|
|
16
|
+
*
|
|
17
|
+
* const editor = initCustomizer('#editor', {
|
|
18
|
+
* templateId: 'tshirt-001',
|
|
19
|
+
* theme: 'light',
|
|
20
|
+
* onReady: () => console.log('Editor ready!'),
|
|
21
|
+
* onChange: (design) => console.log('Design changed:', design),
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // Get current design
|
|
25
|
+
* const design = editor.getDesign();
|
|
26
|
+
*
|
|
27
|
+
* // Finalize design
|
|
28
|
+
* const result = await editor.finalize();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function initCustomizer(elementOrSelector: HTMLElement | string, options: CustomizerOptions): CustomizerInstance;
|
|
32
|
+
/**
|
|
33
|
+
* Re-export types for convenience
|
|
34
|
+
*/
|
|
35
|
+
export type * from '../types';
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vanilla/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAKnB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,WAAW,GAAG,MAAM,EACvC,OAAO,EAAE,iBAAiB,GACzB,kBAAkB,CAsQpB;AAED;;GAEG;AACH,mBAAmB,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vue/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGhE,mBAAmB,UAAU,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue component types
|
|
3
|
+
*/
|
|
4
|
+
import type { CSSProperties } from 'vue';
|
|
5
|
+
import type { DesignJSON, FinalizeResult, CustomizerError } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the Customizer Vue component
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomizerProps {
|
|
10
|
+
/**
|
|
11
|
+
* Template ID to load
|
|
12
|
+
*/
|
|
13
|
+
templateId: string;
|
|
14
|
+
/**
|
|
15
|
+
* API base URL for fetching templates and finalizing designs
|
|
16
|
+
* @default 'https://api.varianta.io'
|
|
17
|
+
*/
|
|
18
|
+
apiUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Visual theme
|
|
21
|
+
* @default 'light'
|
|
22
|
+
*/
|
|
23
|
+
theme?: 'light' | 'dark';
|
|
24
|
+
/**
|
|
25
|
+
* Editor mode
|
|
26
|
+
* @default 'edit'
|
|
27
|
+
*/
|
|
28
|
+
mode?: 'edit' | 'preview';
|
|
29
|
+
/**
|
|
30
|
+
* Enable debug mode with additional logging
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
debug?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Custom CSS class name
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom inline styles
|
|
40
|
+
*/
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
/**
|
|
43
|
+
* Initial design data to load
|
|
44
|
+
*/
|
|
45
|
+
initialDesign?: DesignJSON;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Emits for the Customizer Vue component
|
|
49
|
+
*/
|
|
50
|
+
export interface CustomizerEmits {
|
|
51
|
+
(e: 'ready'): void;
|
|
52
|
+
(e: 'change', design: DesignJSON): void;
|
|
53
|
+
(e: 'layer:select', layerId: string | null): void;
|
|
54
|
+
(e: 'layer:add', layerId: string): void;
|
|
55
|
+
(e: 'layer:remove', layerId: string): void;
|
|
56
|
+
(e: 'layer:update', layerId: string): void;
|
|
57
|
+
(e: 'error', error: CustomizerError): void;
|
|
58
|
+
(e: 'finalize', result: FinalizeResult): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vue/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACnB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACxC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;CAC/C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@varianta/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Multi-framework JavaScript SDK for product customization",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs.js",
|
|
7
|
+
"module": "./dist/index.esm.js",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.esm.js",
|
|
13
|
+
"require": "./dist/index.cjs.js"
|
|
14
|
+
},
|
|
15
|
+
"./react": {
|
|
16
|
+
"types": "./dist/types/react/index.d.ts",
|
|
17
|
+
"import": "./dist/index.esm.js",
|
|
18
|
+
"require": "./dist/index.cjs.js"
|
|
19
|
+
},
|
|
20
|
+
"./vue": {
|
|
21
|
+
"types": "./dist/types/vue/index.d.ts",
|
|
22
|
+
"import": "./dist/index.esm.js",
|
|
23
|
+
"require": "./dist/index.cjs.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"sideEffects": true,
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite build --watch",
|
|
32
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"lint": "eslint src --max-warnings 0",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"prepublishOnly": "pnpm build"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"customizer",
|
|
41
|
+
"sdk",
|
|
42
|
+
"editor",
|
|
43
|
+
"react",
|
|
44
|
+
"vue",
|
|
45
|
+
"web-component",
|
|
46
|
+
"product-customization",
|
|
47
|
+
"2d-editor"
|
|
48
|
+
],
|
|
49
|
+
"dependencies": {},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": "^18.0.0",
|
|
52
|
+
"react-dom": "^18.0.0",
|
|
53
|
+
"vue": "^3.0.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"react": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"react-dom": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"vue": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@customizer/editor": "workspace:*",
|
|
68
|
+
"@customizer/scene-engine": "workspace:*",
|
|
69
|
+
"@types/node": "^22.10.2",
|
|
70
|
+
"@types/react": "^18.3.18",
|
|
71
|
+
"@types/react-dom": "^18.3.5",
|
|
72
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
73
|
+
"typescript": "^5.7.3",
|
|
74
|
+
"vite": "^6.0.7",
|
|
75
|
+
"vitest": "^2.1.9",
|
|
76
|
+
"vue": "^3.5.13"
|
|
77
|
+
},
|
|
78
|
+
"author": "Tedy Development",
|
|
79
|
+
"license": "ISC",
|
|
80
|
+
"homepage": "https://varianta.io"
|
|
81
|
+
}
|