@pixeasy/customizer 0.0.3-beta.0 → 0.0.5-beta.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/LICENSE +20 -20
- package/README.md +115 -115
- package/index.d.ts +13 -0
- package/package.json +32 -32
- package/pixeasy-customizer.css +1 -1
- package/pixeasy-customizer.min.js +244 -242
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
Pixeasy Customizer SDK License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Pixeasy.
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted to any person obtaining a copy of this software and
|
|
7
|
-
associated documentation files (the "Software") to use the Software for internal
|
|
8
|
-
evaluation and integration with authorized Pixeasy services only.
|
|
9
|
-
|
|
10
|
-
Any redistribution, sublicensing, sale, modification for redistribution, or
|
|
11
|
-
public hosting of the Software is prohibited unless expressly authorized in
|
|
12
|
-
writing by Pixeasy.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
|
|
19
|
-
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
SOFTWARE.
|
|
1
|
+
Pixeasy Customizer SDK License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Pixeasy.
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted to any person obtaining a copy of this software and
|
|
7
|
+
associated documentation files (the "Software") to use the Software for internal
|
|
8
|
+
evaluation and integration with authorized Pixeasy services only.
|
|
9
|
+
|
|
10
|
+
Any redistribution, sublicensing, sale, modification for redistribution, or
|
|
11
|
+
public hosting of the Software is prohibited unless expressly authorized in
|
|
12
|
+
writing by Pixeasy.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
# Pixeasy Customizer SDK
|
|
2
|
-
|
|
3
|
-
Framework-agnostic SDK to embed the Pixeasy customizer in Angular, React, Vue, or any ESM app.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @pixeasy/customizer
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Quick start
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
15
|
-
import '@pixeasy/customizer/styles.css';
|
|
16
|
-
|
|
17
|
-
const builder = createPixeasyBuilder();
|
|
18
|
-
|
|
19
|
-
builder.open({
|
|
20
|
-
container: 'pixeasyBuilder',
|
|
21
|
-
apiKey: 'dk_xxx_yyy',
|
|
22
|
-
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
23
|
-
});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
`container` can be an element id (`string`) or an `HTMLElement`.
|
|
27
|
-
|
|
28
|
-
## API
|
|
29
|
-
|
|
30
|
-
### `createPixeasyBuilder()`
|
|
31
|
-
|
|
32
|
-
Returns an instance of `PixeasyBuilder`.
|
|
33
|
-
|
|
34
|
-
### `PixeasyBuilder.open(options)`
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
type PixeasyOpenOptions = {
|
|
38
|
-
container: string | HTMLElement;
|
|
39
|
-
apiKey: string;
|
|
40
|
-
productId: string;
|
|
41
|
-
locale?: string;
|
|
42
|
-
theme?: string;
|
|
43
|
-
readonly?: boolean;
|
|
44
|
-
};
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### `PixeasyBuilder` events
|
|
48
|
-
|
|
49
|
-
- `manifest-loaded`
|
|
50
|
-
- `sdk-ready`
|
|
51
|
-
- `design-change`
|
|
52
|
-
- `design:created`
|
|
53
|
-
- `error`
|
|
54
|
-
- `closed`
|
|
55
|
-
|
|
56
|
-
Usage:
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
builder
|
|
60
|
-
.on('sdk-ready', (event) => console.log(event.productId))
|
|
61
|
-
.on('design:created', (event) => console.log(event.data.designs))
|
|
62
|
-
.on('error', (event) => console.error(event.code, event.message));
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Framework examples
|
|
66
|
-
|
|
67
|
-
### React
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
import { useEffect } from 'react';
|
|
71
|
-
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
72
|
-
import '@pixeasy/customizer/styles.css';
|
|
73
|
-
|
|
74
|
-
export function CustomizerHost() {
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
const builder = createPixeasyBuilder();
|
|
77
|
-
builder.open({
|
|
78
|
-
container: 'pixeasyBuilder',
|
|
79
|
-
apiKey: 'dk_xxx_yyy',
|
|
80
|
-
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
81
|
-
});
|
|
82
|
-
return () => builder.close();
|
|
83
|
-
}, []);
|
|
84
|
-
|
|
85
|
-
return <div id="pixeasyBuilder" />;
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Vue
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
import { onMounted, onBeforeUnmount } from 'vue';
|
|
93
|
-
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
94
|
-
import '@pixeasy/customizer/styles.css';
|
|
95
|
-
|
|
96
|
-
const builder = createPixeasyBuilder();
|
|
97
|
-
|
|
98
|
-
onMounted(() => {
|
|
99
|
-
builder.open({
|
|
100
|
-
container: 'pixeasyBuilder',
|
|
101
|
-
apiKey: 'dk_xxx_yyy',
|
|
102
|
-
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
onBeforeUnmount(() => builder.close());
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Exports
|
|
110
|
-
|
|
111
|
-
- `createPixeasyBuilder`
|
|
112
|
-
- `PixeasyBuilder`
|
|
113
|
-
- `definePixeasyCustomizerElement`
|
|
114
|
-
- typed options/events (`PixeasyOpenOptions`, `ManifestLoadedEventDetail`, etc.)
|
|
115
|
-
- stylesheet export: `@pixeasy/customizer/styles.css`
|
|
1
|
+
# Pixeasy Customizer SDK
|
|
2
|
+
|
|
3
|
+
Framework-agnostic SDK to embed the Pixeasy customizer in Angular, React, Vue, or any ESM app.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @pixeasy/customizer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
15
|
+
import '@pixeasy/customizer/styles.css';
|
|
16
|
+
|
|
17
|
+
const builder = createPixeasyBuilder();
|
|
18
|
+
|
|
19
|
+
builder.open({
|
|
20
|
+
container: 'pixeasyBuilder',
|
|
21
|
+
apiKey: 'dk_xxx_yyy',
|
|
22
|
+
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`container` can be an element id (`string`) or an `HTMLElement`.
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### `createPixeasyBuilder()`
|
|
31
|
+
|
|
32
|
+
Returns an instance of `PixeasyBuilder`.
|
|
33
|
+
|
|
34
|
+
### `PixeasyBuilder.open(options)`
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
type PixeasyOpenOptions = {
|
|
38
|
+
container: string | HTMLElement;
|
|
39
|
+
apiKey: string;
|
|
40
|
+
productId: string;
|
|
41
|
+
locale?: string;
|
|
42
|
+
theme?: string;
|
|
43
|
+
readonly?: boolean;
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `PixeasyBuilder` events
|
|
48
|
+
|
|
49
|
+
- `manifest-loaded`
|
|
50
|
+
- `sdk-ready`
|
|
51
|
+
- `design-change`
|
|
52
|
+
- `design:created`
|
|
53
|
+
- `error`
|
|
54
|
+
- `closed`
|
|
55
|
+
|
|
56
|
+
Usage:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
builder
|
|
60
|
+
.on('sdk-ready', (event) => console.log(event.productId))
|
|
61
|
+
.on('design:created', (event) => console.log(event.data.designs))
|
|
62
|
+
.on('error', (event) => console.error(event.code, event.message));
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Framework examples
|
|
66
|
+
|
|
67
|
+
### React
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { useEffect } from 'react';
|
|
71
|
+
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
72
|
+
import '@pixeasy/customizer/styles.css';
|
|
73
|
+
|
|
74
|
+
export function CustomizerHost() {
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const builder = createPixeasyBuilder();
|
|
77
|
+
builder.open({
|
|
78
|
+
container: 'pixeasyBuilder',
|
|
79
|
+
apiKey: 'dk_xxx_yyy',
|
|
80
|
+
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
81
|
+
});
|
|
82
|
+
return () => builder.close();
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
return <div id="pixeasyBuilder" />;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Vue
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { onMounted, onBeforeUnmount } from 'vue';
|
|
93
|
+
import { createPixeasyBuilder } from '@pixeasy/customizer';
|
|
94
|
+
import '@pixeasy/customizer/styles.css';
|
|
95
|
+
|
|
96
|
+
const builder = createPixeasyBuilder();
|
|
97
|
+
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
builder.open({
|
|
100
|
+
container: 'pixeasyBuilder',
|
|
101
|
+
apiKey: 'dk_xxx_yyy',
|
|
102
|
+
productId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
onBeforeUnmount(() => builder.close());
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Exports
|
|
110
|
+
|
|
111
|
+
- `createPixeasyBuilder`
|
|
112
|
+
- `PixeasyBuilder`
|
|
113
|
+
- `definePixeasyCustomizerElement`
|
|
114
|
+
- typed options/events (`PixeasyOpenOptions`, `ManifestLoadedEventDetail`, etc.)
|
|
115
|
+
- stylesheet export: `@pixeasy/customizer/styles.css`
|
package/index.d.ts
CHANGED
|
@@ -77,3 +77,16 @@ export class PixeasyBuilder {
|
|
|
77
77
|
|
|
78
78
|
export function createPixeasyBuilder(): PixeasyBuilder;
|
|
79
79
|
export function definePixeasyCustomizerElement(): void;
|
|
80
|
+
|
|
81
|
+
export type ThumbnailView = 'front' | 'right' | 'back' | 'left';
|
|
82
|
+
|
|
83
|
+
export interface GeneratedThumbnail {
|
|
84
|
+
view: ThumbnailView;
|
|
85
|
+
dataUrl: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function generateThumbnails(
|
|
89
|
+
svgUrl: string,
|
|
90
|
+
objUrl: string,
|
|
91
|
+
mtlUrl: string,
|
|
92
|
+
): Promise<GeneratedThumbnail[]>;
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pixeasy/customizer",
|
|
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
|
-
},
|
|
20
|
-
"sideEffects": [
|
|
21
|
-
"./pixeasy-customizer.min.js",
|
|
22
|
-
"./pixeasy-customizer.css"
|
|
23
|
-
],
|
|
24
|
-
"files": [
|
|
25
|
-
"pixeasy-customizer.min.js",
|
|
26
|
-
"pixeasy-customizer.css",
|
|
27
|
-
"index.d.ts",
|
|
28
|
-
"README.md",
|
|
29
|
-
"LICENSE",
|
|
30
|
-
"assets",
|
|
31
|
-
"media"
|
|
32
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "@pixeasy/customizer",
|
|
3
|
+
"version": "0.0.5-beta.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
|
+
},
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"./pixeasy-customizer.min.js",
|
|
22
|
+
"./pixeasy-customizer.css"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"pixeasy-customizer.min.js",
|
|
26
|
+
"pixeasy-customizer.css",
|
|
27
|
+
"index.d.ts",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"assets",
|
|
31
|
+
"media"
|
|
32
|
+
]
|
|
33
33
|
}
|