shopar-plugin 1.1.2-alpha.0 → 1.2.0-alpha.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
@@ -223,7 +223,7 @@ Options used for the plugin setup:
223
223
  - Default value: `'pan-y'`
224
224
  - `zoomEnabled` (optional)
225
225
  - Type: `boolean`
226
- - If provided and set to `false`, disables zoom in 3D by ignoring mouse scroll or pinch touch events.
226
+ - If provided and set to `false`, disables zoom in 3D. This includes both user interaction (mouse scroll, pinch touch) and programmatic zoom.
227
227
  - Default value: `true`
228
228
  - `minZoom` (optional)
229
229
  - Type: `number`
@@ -233,6 +233,30 @@ Options used for the plugin setup:
233
233
  - Type: `number`
234
234
  - If provided, it will be used as the maximum zoom level in 3D.
235
235
  - Default value: `5`
236
+ - `onMaxZoomEnter` (optional)
237
+ - Type: `() => void`
238
+ - If provided, it will be called when the maximum zoom level (`maxZoom`) is reached in 3D.
239
+ - `onMaxZoomLeave` (optional)
240
+ - Type: `() => void`
241
+ - If provided, it will be called when the zoom level moves away from the maximum (`maxZoom`) in 3D.
242
+ - `onMinZoomEnter` (optional)
243
+ - Type: `() => void`
244
+ - If provided, it will be called when the minimum zoom level (`minZoom`) is reached in 3D.
245
+ - `onMinZoomLeave` (optional)
246
+ - Type: `() => void`
247
+ - If provided, it will be called when the zoom level moves away from the minimum (`minZoom`) in 3D.
248
+ - `onMinVerticalAngleEnter` (optional)
249
+ - Type: `() => void`
250
+ - If provided, it will be called when the minimum vertical angle is reached in 3D. This corresponds to the camera being positioned at the top of the orbit, looking down at the object.
251
+ - `onMinVerticalAngleLeave` (optional)
252
+ - Type: `() => void`
253
+ - If provided, it will be called when the vertical angle moves away from the minimum in 3D. The camera is no longer at the top of the orbit.
254
+ - `onMaxVerticalAngleEnter` (optional)
255
+ - Type: `() => void`
256
+ - If provided, it will be called when the maximum vertical angle is reached in 3D. This corresponds to the camera being positioned at the bottom of the orbit, looking up at the object.
257
+ - `onMaxVerticalAngleLeave` (optional)
258
+ - Type: `() => void`
259
+ - If provided, it will be called when the vertical angle moves away from the maximum in 3D. The camera is no longer at the bottom of the orbit.
236
260
  - `alwaysTransparentBackground` (optional)
237
261
  - Type: `boolean`
238
262
  - If provided and set to `true`, transparent background will always be used in 3D.
@@ -122,6 +122,42 @@ type Plugin = {
122
122
  * @param value The provided value.
123
123
  */
124
124
  setInteractive: (interactive: boolean) => void;
125
+ /**
126
+ * Zooms the 3D view in.
127
+ * The magnification is multiplied by `2^power`, so a power of 1 doubles the magnification.
128
+ * Has no effect if the 3D view is not currently active.
129
+ * Set to `undefined` if 3D is not supported for given SKU.
130
+ *
131
+ * @param power The exponent applied to the zoom. Each unit doubles the magnification.
132
+ */
133
+ zoomIn3D?: (power: number) => void;
134
+ /**
135
+ * Zooms the 3D view out.
136
+ * The magnification is divided by `2^power`, so a power of 1 halves the magnification.
137
+ * Has no effect if the 3D view is not currently active.
138
+ * Set to `undefined` if 3D is not supported for given SKU.
139
+ *
140
+ * @param power The exponent applied to the zoom. Each unit halves the magnification.
141
+ */
142
+ zoomOut3D?: (power: number) => void;
143
+ /**
144
+ * Rotates the 3D model horizontally by the specified number of degrees.
145
+ * The initial animation is stopped on the first call.
146
+ * Has no effect if the 3D view is not currently active.
147
+ * Set to `undefined` if 3D is not supported for given SKU.
148
+ *
149
+ * @param degrees The rotation angle in degrees. Positive values rotate the model right, negative values rotate left.
150
+ */
151
+ rotateHorizontally3D?: (degrees: number) => void;
152
+ /**
153
+ * Rotates the 3D model vertically by the specified number of degrees.
154
+ * The initial animation is stopped on the first call.
155
+ * Has no effect if the 3D view is not currently active.
156
+ * Set to `undefined` if 3D is not supported for given SKU.
157
+ *
158
+ * @param degrees The rotation angle in degrees. Positive values rotate the model up, negative values rotate down.
159
+ */
160
+ rotateVertically3D?: (degrees: number) => void;
125
161
  };
126
162
  /**
127
163
  * Vision plugin controller
@@ -373,6 +409,42 @@ type SetupOptions = {
373
409
  * @see debounce3DEngagementMs
374
410
  */
375
411
  onDebounced3DEngagement?: (durationMs: number) => void;
412
+ /**
413
+ * If provided, it will be called when the maximum zoom level (`maxZoom`) is reached in 3D.
414
+ */
415
+ onMaxZoomEnter?: () => void;
416
+ /**
417
+ * If provided, it will be called when the zoom level moves away from the maximum (`maxZoom`) in 3D.
418
+ */
419
+ onMaxZoomLeave?: () => void;
420
+ /**
421
+ * If provided, it will be called when the minimum zoom level (`minZoom`) is reached in 3D.
422
+ */
423
+ onMinZoomEnter?: () => void;
424
+ /**
425
+ * If provided, it will be called when the zoom level moves away from the minimum (`minZoom`) in 3D.
426
+ */
427
+ onMinZoomLeave?: () => void;
428
+ /**
429
+ * If provided, it will be called when the minimum vertical angle is reached in 3D.
430
+ * This corresponds to the camera being positioned at the top of the orbit, looking down at the object.
431
+ */
432
+ onMinVerticalAngleEnter?: () => void;
433
+ /**
434
+ * If provided, it will be called when the vertical angle moves away from the minimum in 3D.
435
+ * The camera is no longer at the top of the orbit.
436
+ */
437
+ onMinVerticalAngleLeave?: () => void;
438
+ /**
439
+ * If provided, it will be called when the maximum vertical angle is reached in 3D.
440
+ * This corresponds to the camera being positioned at the bottom of the orbit, looking up at the object.
441
+ */
442
+ onMaxVerticalAngleEnter?: () => void;
443
+ /**
444
+ * If provided, it will be called when the vertical angle moves away from the maximum in 3D.
445
+ * The camera is no longer at the bottom of the orbit.
446
+ */
447
+ onMaxVerticalAngleLeave?: () => void;
376
448
  /**
377
449
  * If provided, it will be used as the video source for AR instead of the default camera used by plugin.
378
450
  *