xactsize-webcomponents 1.0.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.md +18 -0
- package/README.md +30 -0
- package/dist/body-measurer.d.ts +75 -0
- package/dist/body-measurer.es.js +1317 -0
- package/dist/body-measurer.umd.js +591 -0
- package/package.json +38 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# xactsize-webcomponent License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Your Name or Company. All rights reserved.
|
|
4
|
+
|
|
5
|
+
## License Terms
|
|
6
|
+
|
|
7
|
+
This software is provided as a compiled, closed-source package for public use under the following terms:
|
|
8
|
+
|
|
9
|
+
1. **Usage**: You are permitted to use the compiled version of `xactsize-webcomponent` (as distributed via npm or CDN) in your projects, subject to the terms below.
|
|
10
|
+
2. **No Source Access**: The source code of this software is proprietary and closed-source. You are not permitted to access, view, modify, or distribute the source code.
|
|
11
|
+
3. **No Reverse Engineering**: You may not reverse-engineer, decompile, or disassemble the compiled code to derive the source code.
|
|
12
|
+
4. **Redistribution**: You may not redistribute this package or its compiled files except as part of a larger application where the package is used as a dependency.
|
|
13
|
+
5. **API Key Requirement**: Usage of this package requires an API key, which must be obtained by registering your domain with the provider. Unauthorized use is prohibited.
|
|
14
|
+
6. **No Warranty**: This software is provided "as is," without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
|
|
15
|
+
7. **Liability**: In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of this software.
|
|
16
|
+
|
|
17
|
+
## Contact
|
|
18
|
+
For licensing inquiries, API key registration, or support, contact [support@yourwebsite.com](mailto:support@yourwebsite.com).
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# xactsize-webcomponent
|
|
2
|
+
|
|
3
|
+
A lightweight Web Component for precise body measurements and size recommendations in web applications, built with Lit.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
<details>
|
|
8
|
+
<summary>With NPM</summary>
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install xactsize-webcomponent
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<body-measurer culture="pt-BR" product-name="Calça Legging" skus='[{"dimensions":{"Size":"S"},"measures":{"height":39,"length":78,"width":78}},{"dimensions":{"Size":"M"},"measures":{"height":40,"length":82,"width":82}}]'></body-measurer>
|
|
16
|
+
<script type="module">
|
|
17
|
+
import { BodyMeasurer } from 'xactsize-webcomponent';
|
|
18
|
+
// The component is automatically registered via @customElement
|
|
19
|
+
</script>
|
|
20
|
+
```
|
|
21
|
+
</details>
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary>With CDN</summary>
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<body-measurer culture="pt-BR" product-name="Calça Legging" skus='[{"dimensions":{"Size":"S"},"measures":{"height":39,"length":78,"width":78}},{"dimensions":{"Size":"M"},"measures":{"height":40,"length":82,"width":82}}]'></body-measurer>
|
|
28
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/xactsize-webcomponent@1.0.0/dist/body-measurer.es.js"></script>
|
|
29
|
+
```
|
|
30
|
+
</details>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
interface SKU {
|
|
3
|
+
dimensions: {
|
|
4
|
+
Size: string;
|
|
5
|
+
};
|
|
6
|
+
measures: {
|
|
7
|
+
height: number;
|
|
8
|
+
length: number;
|
|
9
|
+
width: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare class BodyMeasurer extends LitElement {
|
|
13
|
+
static styles: import('lit', { with: { "resolution-mode": "import" } }).CSSResult;
|
|
14
|
+
apiKey: string;
|
|
15
|
+
culture: string;
|
|
16
|
+
skus: SKU[];
|
|
17
|
+
productName: string;
|
|
18
|
+
private showModal;
|
|
19
|
+
private step;
|
|
20
|
+
private height;
|
|
21
|
+
private recommendedSize;
|
|
22
|
+
private measurements;
|
|
23
|
+
private errorMessage;
|
|
24
|
+
private instructionMessage;
|
|
25
|
+
private shouldStartMeasurement;
|
|
26
|
+
private videoElement;
|
|
27
|
+
private stream;
|
|
28
|
+
private pollingInterval;
|
|
29
|
+
private translations;
|
|
30
|
+
private getTranslation;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
private handleEscKey;
|
|
34
|
+
private openModal;
|
|
35
|
+
private closeModal;
|
|
36
|
+
private startMeasurement;
|
|
37
|
+
updated(changedProperties: Map<string, any>): void;
|
|
38
|
+
private initializeMeasurement;
|
|
39
|
+
private startPolling;
|
|
40
|
+
private isFetching;
|
|
41
|
+
private stopPolling;
|
|
42
|
+
private acceptMeasurement;
|
|
43
|
+
private resetMeasurement;
|
|
44
|
+
private stopMeasurement;
|
|
45
|
+
render(): import('lit-html', { with: { "resolution-mode": "import" } }).TemplateResult<1>;
|
|
46
|
+
}
|
|
47
|
+
declare global {
|
|
48
|
+
interface HTMLElementTagNameMap {
|
|
49
|
+
'body-measurer': BodyMeasurer;
|
|
50
|
+
}
|
|
51
|
+
interface BodyMeasurer extends HTMLElement {
|
|
52
|
+
'api-key': string;
|
|
53
|
+
culture: string;
|
|
54
|
+
skus: SKU[];
|
|
55
|
+
'product-name': string;
|
|
56
|
+
openModal(): void;
|
|
57
|
+
closeModal(): void;
|
|
58
|
+
addEventListener(type: 'measurementAccepted', listener: (this: BodyMeasurer, ev: CustomEvent<{
|
|
59
|
+
size: string;
|
|
60
|
+
}>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
61
|
+
addEventListener(type: 'measurementCanceled', listener: (this: BodyMeasurer, ev: CustomEvent<{}>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
62
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
interface SKU {
|
|
66
|
+
dimensions: {
|
|
67
|
+
Size: string;
|
|
68
|
+
};
|
|
69
|
+
measures: {
|
|
70
|
+
height: number;
|
|
71
|
+
length: number;
|
|
72
|
+
width: number;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export {};
|