xactsize-webcomponents 1.0.12 → 1.0.15

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 CHANGED
@@ -1,18 +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).
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 CHANGED
@@ -1,77 +1,77 @@
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
16
- culture="pt-BR"
17
- product-name="Shirt"
18
- skus='[{"dimensions":{"Size":"M"},"measures":{"height":50,"length":70,"width":40}}]'
19
- ></body-measurer>
20
- <script>
21
- import { BodyMeasurer } from 'xactsize-webcomponent';
22
-
23
- // Select the body-measurer element
24
- const bodyMeasurer = document.querySelector('body-measurer');
25
-
26
- // Check if the element exists
27
- if (bodyMeasurer) {
28
- // Add event listener for measurementAccepted
29
- bodyMeasurer.addEventListener('measurementAccepted', (e) => {
30
- const size = e.detail.size;
31
- alert(`Size selected: ${size}`);
32
- console.log('Measurement accepted:', e.detail);
33
- });
34
-
35
- // Add event listener for measurementCanceled
36
- bodyMeasurer.addEventListener('measurementCanceled', (e) => {
37
- alert('Measurement canceled');
38
- console.log('Measurement canceled');
39
- });
40
- } else {
41
- console.error('body-measurer element not found');
42
- }
43
- </script>
44
- ```
45
- </details>
46
-
47
- <details>
48
- <summary>With CDN</summary>
49
-
50
- ```html
51
- <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>
52
- <script type="module" src="https://cdn.jsdelivr.net/npm/xactsize-webcomponents@1.0.6/dist/body-measurer.es.js"></script>
53
-
54
- <script>
55
- // Select the body-measurer element
56
- const bodyMeasurer = document.querySelector('body-measurer');
57
-
58
- // Check if the element exists
59
- if (bodyMeasurer) {
60
- // Add event listener for measurementAccepted
61
- bodyMeasurer.addEventListener('measurementAccepted', (e) => {
62
- const size = e.detail.size;
63
- alert(`Size selected: ${size}`);
64
- console.log('Measurement accepted:', e.detail);
65
- });
66
-
67
- // Add event listener for measurementCanceled
68
- bodyMeasurer.addEventListener('measurementCanceled', (e) => {
69
- alert('Measurement canceled');
70
- console.log('Measurement canceled');
71
- });
72
- } else {
73
- console.error('body-measurer element not found');
74
- }
75
- </script>
76
- ```
77
- </details>
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
16
+ culture="pt-BR"
17
+ product-name="Shirt"
18
+ skus='[{"dimensions":{"Size":"M"},"measures":{"height":50,"length":70,"width":40}}]'
19
+ ></body-measurer>
20
+ <script>
21
+ import { BodyMeasurer } from 'xactsize-webcomponent';
22
+
23
+ // Select the body-measurer element
24
+ const bodyMeasurer = document.querySelector('body-measurer');
25
+
26
+ // Check if the element exists
27
+ if (bodyMeasurer) {
28
+ // Add event listener for measurementAccepted
29
+ bodyMeasurer.addEventListener('measurementAccepted', (e) => {
30
+ const size = e.detail.size;
31
+ alert(`Size selected: ${size}`);
32
+ console.log('Measurement accepted:', e.detail);
33
+ });
34
+
35
+ // Add event listener for measurementCanceled
36
+ bodyMeasurer.addEventListener('measurementCanceled', (e) => {
37
+ alert('Measurement canceled');
38
+ console.log('Measurement canceled');
39
+ });
40
+ } else {
41
+ console.error('body-measurer element not found');
42
+ }
43
+ </script>
44
+ ```
45
+ </details>
46
+
47
+ <details>
48
+ <summary>With CDN</summary>
49
+
50
+ ```html
51
+ <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>
52
+ <script type="module" src="https://cdn.jsdelivr.net/npm/xactsize-webcomponents@1.0.6/dist/body-measurer.es.js"></script>
53
+
54
+ <script>
55
+ // Select the body-measurer element
56
+ const bodyMeasurer = document.querySelector('body-measurer');
57
+
58
+ // Check if the element exists
59
+ if (bodyMeasurer) {
60
+ // Add event listener for measurementAccepted
61
+ bodyMeasurer.addEventListener('measurementAccepted', (e) => {
62
+ const size = e.detail.size;
63
+ alert(`Size selected: ${size}`);
64
+ console.log('Measurement accepted:', e.detail);
65
+ });
66
+
67
+ // Add event listener for measurementCanceled
68
+ bodyMeasurer.addEventListener('measurementCanceled', (e) => {
69
+ alert('Measurement canceled');
70
+ console.log('Measurement canceled');
71
+ });
72
+ } else {
73
+ console.error('body-measurer element not found');
74
+ }
75
+ </script>
76
+ ```
77
+ </details>
@@ -1,14 +1,4 @@
1
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
2
  export declare const getLocale: (() => string) & {
13
3
  _LIT_LOCALIZE_GET_LOCALE_?: never;
14
4
  }, setLocale: ((newLocale: string) => Promise<void>) & {
@@ -21,7 +11,9 @@ export declare class BodyMeasurer extends LitElement {
21
11
  firstUpdated(): void;
22
12
  private startSpinnerAnimation;
23
13
  apiKey: string;
14
+ tenantId: string;
24
15
  productSku: string;
16
+ apiUrl: string;
25
17
  onMeasurementAccepted: (() => void) | undefined;
26
18
  onMeasurementCanceled: (() => void) | undefined;
27
19
  private _culture;
@@ -30,9 +22,8 @@ export declare class BodyMeasurer extends LitElement {
30
22
  _applyLocale(newLocale: string): Promise<void>;
31
23
  private get errorMap();
32
24
  private getTranslatedMessage;
25
+ private measurerKey;
33
26
  private _isLocaleLoading;
34
- skus: SKU[];
35
- productName: string;
36
27
  private showModal;
37
28
  private step;
38
29
  private height;
@@ -54,6 +45,7 @@ export declare class BodyMeasurer extends LitElement {
54
45
  private handleEscKey;
55
46
  private openModal;
56
47
  private closeModal;
48
+ private step2advancement;
57
49
  private startMeasurement;
58
50
  updated(changedProperties: Map<string, any>): void;
59
51
  private initializeMeasurement;
@@ -71,4 +63,3 @@ declare global {
71
63
  'body-measurer': BodyMeasurer;
72
64
  }
73
65
  }
74
- export {};