shopar-plugin 0.8.10 → 0.9.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 CHANGED
@@ -32,7 +32,7 @@ There are two distinct ways of integrating the plugin: via Script tag and via NP
32
32
  Add the following script to your HTML.
33
33
 
34
34
  ```html
35
- <script src="https://cdn.jsdelivr.net/npm/shopar-plugin@0.8.10/dist/shopar-plugin.js"></script>
35
+ <script src="https://cdn.jsdelivr.net/npm/shopar-plugin@0.9.0/dist/shopar-plugin.js"></script>
36
36
  ```
37
37
 
38
38
  It is possible to use a different CDN instead of [jsDelivr](https://www.jsdelivr.com/) (e.g. [cdnjs](https://cdnjs.com/), [unpkg](https://www.unpkg.com/)), or even a relative path if the plugin is distributed as a static asset to your app. Just make sure to set the `baseUrl` parameter accordingly (see [setup options](#shoparpluginsetupoptions) for more details).
@@ -153,7 +153,7 @@ Options used for the plugin setup:
153
153
  - `baseUrl` (optional)
154
154
  - Type: `string`
155
155
  - If provided, defines where the additional ShopAR plugin files are fetched from.
156
- - Default value: `https://cdn.jsdelivr.net/npm/shopar-plugin@0.8.10/dist`
156
+ - Default value: `https://cdn.jsdelivr.net/npm/shopar-plugin@0.9.0/dist`
157
157
  - `defaultUI` (optional)
158
158
  - Type: `boolean`
159
159
  - If provided and set to `false`, disables the default UI such as buttons, loading and error views.
@@ -193,6 +193,22 @@ Options used for the plugin setup:
193
193
  - Default values:
194
194
  - `loading.ar`: `Loading Try On...`
195
195
  - `loading.3d`: `Loading 3D...`
196
+ - `debounceAREngagementMs` (optional)
197
+ - Type: `number`
198
+ - If provided, it will be used as the debounce duration for debounced AR engagement tracking.
199
+ - Default value: `2000`
200
+ - `onDebouncedAREngagement` (optional)
201
+ - Type: `function`
202
+ - If provided, it will get called with the engagement duration on every (debounced) AR engagement.
203
+ - AR engagement is measured as the time spent by the user virtually trying out the product in AR.
204
+ - `debounce3DEngagementMs` (optional)
205
+ - Type: `number`
206
+ - If provided, it will be used as the debounce duration for debounced 3D engagement tracking.
207
+ - Default value: `2000`
208
+ - `onDebounced3DEngagement` (optional)
209
+ - Type: `function`
210
+ - If provided, it will be called with the engagement duration on every (debounced) 3D engagement.
211
+ - 3D engagement is measured as the time spent by the user rotating, panning or zooming the product in 3D.
196
212
 
197
213
  ## License
198
214
 
@@ -173,6 +173,42 @@ type SetupOptions = {
173
173
  * ]
174
174
  */
175
175
  initialAnimation?: KeyFrameConfig[] | string;
176
+ /**
177
+ * If provided, it will be used as the debounce duration for debounced AR engagement tracking.
178
+ *
179
+ * @default 2000
180
+ * @see onDebouncedAREngagement
181
+ */
182
+ debounceAREngagementMs?: number;
183
+ /**
184
+ * If provided, it will get called with the engagement duration on every (debounced) AR engagement.
185
+ *
186
+ * AR engagement is measured as the time spent by the user virtually trying out the product in AR.
187
+ * The callback is called after engagement stops for the specified debounce duration.
188
+ * Additionally, any outstanding engagement duration is flushed when AR is closed.
189
+ *
190
+ * @param durationMs Engagement duration in milliseconds.
191
+ * @see debounceAREngagementMs
192
+ */
193
+ onDebouncedAREngagement?: (durationMs: number) => void;
194
+ /**
195
+ * If provided, it will be used as the debounce duration for debounced 3D engagement tracking.
196
+ *
197
+ * @default 2000
198
+ * @see onDebounced3DEngagement
199
+ */
200
+ debounce3DEngagementMs?: number;
201
+ /**
202
+ * If provided, it will be called with the engagement duration on every (debounced) 3D engagement.
203
+ *
204
+ * 3D engagement is measured as the time spent by the user rotating, panning or zooming the product in 3D.
205
+ * The callback is called after engagement stops for the specified debounce duration.
206
+ * Additionally, any outstanding engagement duration is flushed when 3D is closed.
207
+ *
208
+ * @param durationMs Engagement duration in milliseconds.
209
+ * @see debounce3DEngagementMs
210
+ */
211
+ onDebounced3DEngagement?: (durationMs: number) => void;
176
212
  _internalOptions?: any;
177
213
  };
178
214
  /**