@pixeasy/customizer-stage 0.0.1-beta
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/LICENSE +20 -0
- package/README.md +477 -0
- package/assets/images/logos/google-icon.png +0 -0
- package/assets/styles/_variables.css +0 -0
- package/assets/styles/theme.css +53 -0
- package/assets/theme/custom-preset.ts +256 -0
- package/index.d.ts +112 -0
- package/media/remixicon.eot +0 -0
- package/media/remixicon.svg +9709 -0
- package/media/remixicon.ttf +0 -0
- package/media/remixicon.woff +0 -0
- package/media/remixicon.woff2 +0 -0
- package/package.json +34 -0
- package/pixeasy-customizer.css +1 -0
- package/pixeasy-customizer.min.js +4620 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { definePreset } from '@primeuix/themes';
|
|
2
|
+
import Aura from '@primeuix/themes/aura';
|
|
3
|
+
|
|
4
|
+
const primaryPalette = {
|
|
5
|
+
50: '#aeaff2',
|
|
6
|
+
100: '#a6a8f1',
|
|
7
|
+
200: '#9698f0',
|
|
8
|
+
300: '#8587f0',
|
|
9
|
+
400: '#7477f0',
|
|
10
|
+
500: '#6265f1', // Your new base primary (close to #6366f1)
|
|
11
|
+
600: '#474aea',
|
|
12
|
+
700: '#2c30e3',
|
|
13
|
+
800: '#1f23ce',
|
|
14
|
+
900: '#1e21ad',
|
|
15
|
+
950: '#1d209d',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const secondaryPalette = {
|
|
19
|
+
50: '#F9FAFB',
|
|
20
|
+
100: '#F0F2F4',
|
|
21
|
+
200: '#DBE0E5',
|
|
22
|
+
300: '#C4CBD4',
|
|
23
|
+
400: '#A6B0BF',
|
|
24
|
+
500: '#64748b',
|
|
25
|
+
600: '#556377',
|
|
26
|
+
700: '#404A59',
|
|
27
|
+
800: '#2B323B',
|
|
28
|
+
900: '#1A1E24',
|
|
29
|
+
950: '#0D0F12',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const successPalette = {
|
|
33
|
+
50: '#e6fcf7',
|
|
34
|
+
100: '#ccf9f0',
|
|
35
|
+
200: '#99f3e1',
|
|
36
|
+
300: '#66ecd2',
|
|
37
|
+
400: '#33e6c4',
|
|
38
|
+
500: '#00dfb6', // New base secondary (mint/teal accent)
|
|
39
|
+
600: '#00b394',
|
|
40
|
+
700: '#008772',
|
|
41
|
+
800: '#005c50',
|
|
42
|
+
900: '#003f38',
|
|
43
|
+
950: '#002e29',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const customPreset = definePreset(Aura, {
|
|
47
|
+
semantic: {
|
|
48
|
+
...Aura.semantic, // Inherit neutrals (surface, text, etc.) and default severities
|
|
49
|
+
primary: primaryPalette,
|
|
50
|
+
secondary: secondaryPalette,
|
|
51
|
+
success: successPalette,
|
|
52
|
+
},
|
|
53
|
+
colorScheme: {
|
|
54
|
+
// Light/dark mappings (optimized for new primary and secondary)
|
|
55
|
+
light: {
|
|
56
|
+
primary: {
|
|
57
|
+
color: '{primary.500}',
|
|
58
|
+
inverseColor: '#ffffff', // White text on primary bg
|
|
59
|
+
hoverColor: '{primary.400}',
|
|
60
|
+
activeColor: '{primary.600}',
|
|
61
|
+
focusColor: '{primary.400}',
|
|
62
|
+
},
|
|
63
|
+
secondary: {
|
|
64
|
+
color: '{secondary.500}',
|
|
65
|
+
inverseColor: '#ffffff',
|
|
66
|
+
hoverColor: '{secondary.400}',
|
|
67
|
+
activeColor: '{secondary.600}',
|
|
68
|
+
focusColor: '{secondary.400}',
|
|
69
|
+
},
|
|
70
|
+
success: {
|
|
71
|
+
color: '{success.500}',
|
|
72
|
+
inverseColor: '#ffffff',
|
|
73
|
+
hoverColor: '{success.400}',
|
|
74
|
+
activeColor: '{success.600}',
|
|
75
|
+
focusColor: '{success.400}',
|
|
76
|
+
},
|
|
77
|
+
highlight: {
|
|
78
|
+
background: '{primary.100}', // Subtle primary tint for selections
|
|
79
|
+
focusBackground: '{primary.300}',
|
|
80
|
+
color: '{primary.700}',
|
|
81
|
+
focusColor: '{primary.700}',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
dark: {
|
|
85
|
+
primary: {
|
|
86
|
+
color: '{primary.400}', // Lighter primary in dark mode
|
|
87
|
+
inverseColor: '{primary.950}',
|
|
88
|
+
hoverColor: '{primary.300}',
|
|
89
|
+
activeColor: '{primary.500}',
|
|
90
|
+
focusColor: '{primary.300}',
|
|
91
|
+
},
|
|
92
|
+
secondary: {
|
|
93
|
+
color: '{secondary.400}',
|
|
94
|
+
inverseColor: '{secondary.950}',
|
|
95
|
+
hoverColor: '{secondary.300}',
|
|
96
|
+
activeColor: '{secondary.500}',
|
|
97
|
+
focusColor: '{secondary.300}',
|
|
98
|
+
},
|
|
99
|
+
success: {
|
|
100
|
+
color: '{success.400}',
|
|
101
|
+
inverseColor: '{success.950}',
|
|
102
|
+
hoverColor: '{success.300}',
|
|
103
|
+
activeColor: '{success.500}',
|
|
104
|
+
focusColor: '{success.300}',
|
|
105
|
+
},
|
|
106
|
+
highlight: {
|
|
107
|
+
background: 'rgba(99, 102, 241, 0.16)', // Semi-transparent new primary
|
|
108
|
+
focusBackground: 'rgba(99, 102, 241, 0.24)',
|
|
109
|
+
color: 'rgba(255, 255, 255, 0.87)',
|
|
110
|
+
focusColor: 'rgba(255, 255, 255, 0.87)',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
// Component-specific tokens (base overrides)
|
|
115
|
+
components: {
|
|
116
|
+
// Base button tokens (e.g., radius, font-weight, padding)
|
|
117
|
+
button: {
|
|
118
|
+
root: {
|
|
119
|
+
borderRadius: '12px',
|
|
120
|
+
transitionDuration: '0.3s',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
// Base inputtext tokens (e.g., border, radius, transition)
|
|
124
|
+
inputtext: {
|
|
125
|
+
root: {
|
|
126
|
+
borderRadius: '8px',
|
|
127
|
+
transitionDuration: '0.3s',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
// Float label base
|
|
131
|
+
floatlabel: {
|
|
132
|
+
root: { fontWeight: '600' },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
css: ({ dt }) => `
|
|
136
|
+
/* p-button Styles (Primary by default) */
|
|
137
|
+
.p-button.p-button-primary,
|
|
138
|
+
.p-button.p-button-success,
|
|
139
|
+
.p-button.p-button-secondary,
|
|
140
|
+
.p-button.p-button-info,
|
|
141
|
+
.p-button.p-button-warn,
|
|
142
|
+
.p-button.p-button-help,
|
|
143
|
+
.p-button.p-button-danger,
|
|
144
|
+
.p-button.p-button-contrast {
|
|
145
|
+
|
|
146
|
+
border: none;
|
|
147
|
+
border-radius: ${dt('button.root.borderRadius')} ;
|
|
148
|
+
font-weight: 600 ;
|
|
149
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) ;
|
|
150
|
+
color: white ;
|
|
151
|
+
box-shadow: 0 4px 14px 0 rgba(100, 116, 139, 0.3) ;
|
|
152
|
+
&:hover:not(:disabled) {
|
|
153
|
+
transform: translateY(-1px) ;
|
|
154
|
+
|
|
155
|
+
)} 100%) ;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.p-button.p-button-primary:not(.p-button-success):not(.p-button-info):not(.p-button-warn):not(.p-button-help):not(.p-button-danger):not(.p-button-contrast):not(.p-button-outlined):not(.p-button-text) {
|
|
160
|
+
background: linear-gradient(135deg, ${dt('primary.600')} 0%, ${dt('primary.500')} 100%) ;
|
|
161
|
+
|
|
162
|
+
box-shadow: 0 4px 14px 0 rgba(98, 101, 241, 0.3) ;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.p-button:not(.p-button-secondary):not(.p-button-success):not(.p-button-info):not(.p-button-warn):not(.p-button-help):not(.p-button-danger):not(.p-button-contrast):not(.p-button-outlined):not(.p-button-text):hover:not(:disabled) {
|
|
166
|
+
transform: translateY(-1px) ;
|
|
167
|
+
box-shadow: 0 6px 20px 0 rgba(98, 101, 241, 0.4) ;
|
|
168
|
+
background: linear-gradient(135deg, ${dt('primary.700')} 0%, ${dt('primary.600')} 100%) ;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* p-button-secondary Styles */
|
|
172
|
+
.p-button.p-button-secondary {
|
|
173
|
+
background: linear-gradient(135deg, ${dt('secondary.600')} 0%, ${dt('secondary.500')} 100%) ;
|
|
174
|
+
|
|
175
|
+
color: white !important;
|
|
176
|
+
box-shadow: 0 4px 14px 0 rgba(100, 116, 139, 0.3) !important;
|
|
177
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
|
178
|
+
background: linear-gradient(135deg, var(--p-secondary-600) 0%, var(--p-secondary-500) 100%) !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.p-button.p-button-secondary:hover:not(:disabled) {
|
|
182
|
+
transform: translateY(-1px)!important ;
|
|
183
|
+
box-shadow: 0 6px 20px 0 rgba(100, 116, 139, 0.4) !important;
|
|
184
|
+
background: linear-gradient(135deg, ${dt('secondary.700')} 0%, ${dt('secondary.600')} 100%) !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* p-button-success Styles */
|
|
188
|
+
.p-button.p-button-success {
|
|
189
|
+
background: linear-gradient(135deg, ${dt('success.600')} 0%, ${dt('success.500')} 100%) ;
|
|
190
|
+
|
|
191
|
+
box-shadow: 0 4px 14px 0 rgba(0, 223, 182, 0.3) ;
|
|
192
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) ;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.p-button.p-button-success:hover:not(:disabled) {
|
|
196
|
+
transform: translateY(-1px) ;
|
|
197
|
+
box-shadow: 0 6px 20px 0 rgba(0, 223, 182, 0.4) ;
|
|
198
|
+
background: linear-gradient(135deg, ${dt('success.700')} 0%, ${dt('success.600')} 100%) ;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.p-button:disabled {
|
|
202
|
+
opacity: 0.7 ;
|
|
203
|
+
transform: none ;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* p-inputtext Styles */
|
|
207
|
+
.p-inputtext {
|
|
208
|
+
border: 2px solid #e5e7eb ;
|
|
209
|
+
border-radius: ${dt('inputtext.root.borderRadius')} ;
|
|
210
|
+
transition: all 0.3s ease ;
|
|
211
|
+
background: rgba(255, 255, 255, 0.8) ;
|
|
212
|
+
backdrop-filter: blur(5px) ;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.p-inputtext:focus {
|
|
216
|
+
border-color: ${dt('primary.500')} ;
|
|
217
|
+
box-shadow: 0 0 0 3px rgba(98, 101, 241, 0.1) ;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.p-select.field-invalid ,.p-password.field-invalid .p-password-input,.p-inputtext.field-invalid {
|
|
221
|
+
border-color: #ef4444 ;
|
|
222
|
+
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) ;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/* p-float-label Styles */
|
|
227
|
+
.p-float-label label {
|
|
228
|
+
color: #6b7280 ;
|
|
229
|
+
font-weight: 500 ;
|
|
230
|
+
i{
|
|
231
|
+
color: #6b7280 ;
|
|
232
|
+
font-weight: 500 ;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* Dark Mode Overrides */
|
|
237
|
+
.dark .p-inputtext.field-invalid {
|
|
238
|
+
border-color: #f87171 ;
|
|
239
|
+
box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1) ;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.dark .p-button-outlined {
|
|
243
|
+
border-color: #4b5563 ;
|
|
244
|
+
color: #d1d5db ;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Breadcrumb Styles */
|
|
248
|
+
.p-breadcrumb{
|
|
249
|
+
background: transparent !important
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.p-breadcrumb-item-label{
|
|
253
|
+
cursor: pointer ;
|
|
254
|
+
}
|
|
255
|
+
`,
|
|
256
|
+
});
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export interface SdkElementConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
productId: string;
|
|
4
|
+
predesignId?: string;
|
|
5
|
+
submissionNumber?: string;
|
|
6
|
+
userUniqueId?: string;
|
|
7
|
+
locale?: string;
|
|
8
|
+
theme?: string;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PixeasyOpenOptions extends SdkElementConfig {
|
|
13
|
+
container: string | HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ManifestLoadedEventDetail {
|
|
17
|
+
productId: string;
|
|
18
|
+
manifestMeta?: {
|
|
19
|
+
version?: string;
|
|
20
|
+
} | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SdkReadyEventDetail {
|
|
24
|
+
productId: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ErrorEventDetail {
|
|
28
|
+
code: 'INVALID_CONFIG' | 'MANIFEST_LOAD_FAILED' | 'ASSET_LOAD_FAILED' | 'RUNTIME_ERROR';
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SubmissionSuccessEventDetail {
|
|
33
|
+
productId?: string;
|
|
34
|
+
views?: string[];
|
|
35
|
+
submissionNumber: string;
|
|
36
|
+
personalizationPlacements: SubmissionPersonalizationPlacementDetail[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SubmissionPersonalizationPlacementDetail {
|
|
40
|
+
placementKey: string;
|
|
41
|
+
type: 'logo' | 'text';
|
|
42
|
+
value: string | null;
|
|
43
|
+
logoUrl: string | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface SubmissionFailedEventDetail {
|
|
47
|
+
productId?: string;
|
|
48
|
+
views?: string[];
|
|
49
|
+
message: string;
|
|
50
|
+
errors?: string[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const SDK_EVENTS: {
|
|
54
|
+
readonly MANIFEST_LOADED: 'manifest-loaded';
|
|
55
|
+
readonly SDK_READY: 'sdk-ready';
|
|
56
|
+
readonly SUBMISSION_SUCCESS: 'submission:success';
|
|
57
|
+
readonly SUBMISSION_FAILED: 'submission:failed';
|
|
58
|
+
readonly ERROR: 'error';
|
|
59
|
+
readonly CLOSED: 'closed';
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type BuilderEventName = (typeof SDK_EVENTS)[keyof typeof SDK_EVENTS];
|
|
63
|
+
export type UrlOrText = { type: 'url'; value: string } | { type: 'text'; value: string };
|
|
64
|
+
|
|
65
|
+
export class PixeasyBuilder {
|
|
66
|
+
open(options: PixeasyOpenOptions): this;
|
|
67
|
+
on<K extends BuilderEventName>(
|
|
68
|
+
name: K,
|
|
69
|
+
handler: (
|
|
70
|
+
payload: {
|
|
71
|
+
[typeof SDK_EVENTS.MANIFEST_LOADED]: ManifestLoadedEventDetail;
|
|
72
|
+
[typeof SDK_EVENTS.SDK_READY]: SdkReadyEventDetail;
|
|
73
|
+
[typeof SDK_EVENTS.SUBMISSION_SUCCESS]: SubmissionSuccessEventDetail;
|
|
74
|
+
[typeof SDK_EVENTS.SUBMISSION_FAILED]: SubmissionFailedEventDetail;
|
|
75
|
+
[typeof SDK_EVENTS.ERROR]: ErrorEventDetail;
|
|
76
|
+
[typeof SDK_EVENTS.CLOSED]: undefined;
|
|
77
|
+
}[K],
|
|
78
|
+
) => void,
|
|
79
|
+
): this;
|
|
80
|
+
off<K extends BuilderEventName>(
|
|
81
|
+
name: K,
|
|
82
|
+
handler: (
|
|
83
|
+
payload: {
|
|
84
|
+
[typeof SDK_EVENTS.MANIFEST_LOADED]: ManifestLoadedEventDetail;
|
|
85
|
+
[typeof SDK_EVENTS.SDK_READY]: SdkReadyEventDetail;
|
|
86
|
+
[typeof SDK_EVENTS.SUBMISSION_SUCCESS]: SubmissionSuccessEventDetail;
|
|
87
|
+
[typeof SDK_EVENTS.SUBMISSION_FAILED]: SubmissionFailedEventDetail;
|
|
88
|
+
[typeof SDK_EVENTS.ERROR]: ErrorEventDetail;
|
|
89
|
+
[typeof SDK_EVENTS.CLOSED]: undefined;
|
|
90
|
+
}[K],
|
|
91
|
+
) => void,
|
|
92
|
+
): this;
|
|
93
|
+
close(emitClosed?: Boolean): this;
|
|
94
|
+
saveDesign(): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function createPixeasyBuilder(): PixeasyBuilder;
|
|
98
|
+
export function definePixeasyCustomizerElement(): void;
|
|
99
|
+
|
|
100
|
+
export type ThumbnailView = 'front' | 'right' | 'back' | 'left';
|
|
101
|
+
|
|
102
|
+
export interface GeneratedThumbnail {
|
|
103
|
+
view: ThumbnailView;
|
|
104
|
+
dataUrl: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function generateThumbnails(
|
|
108
|
+
svgUrl: UrlOrText,
|
|
109
|
+
objUrl: UrlOrText,
|
|
110
|
+
mtlUrl?: UrlOrText,
|
|
111
|
+
materialSourceUrl?: string | null,
|
|
112
|
+
): Promise<GeneratedThumbnail[]>;
|
|
Binary file
|