@spiffcommerce/core 16.2.4-rc.0 → 16.2.5
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/dist/index.js +34 -23
- package/dist/index.umd.cjs +21 -21
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8349,38 +8349,30 @@ class As {
|
|
|
8349
8349
|
A && (this.state = JSON.parse(A));
|
|
8350
8350
|
}
|
|
8351
8351
|
applyStateToWorkflowExperience(A) {
|
|
8352
|
-
var
|
|
8353
|
-
if (!this.state || !((
|
|
8352
|
+
var n, s;
|
|
8353
|
+
if (!this.state || !((n = A == null ? void 0 : A.getWorkflowManager()) != null && n.getModelContainer()))
|
|
8354
8354
|
return;
|
|
8355
|
-
const e = (
|
|
8356
|
-
(
|
|
8357
|
-
)) == null ? void 0 :
|
|
8355
|
+
const e = (s = this.state.transactions.find(
|
|
8356
|
+
(i) => i.transactionId === A.getWorkflowManager().getTransaction().id && i.transform
|
|
8357
|
+
)) == null ? void 0 : s.transform;
|
|
8358
8358
|
if (!e)
|
|
8359
8359
|
return;
|
|
8360
|
-
const t = A.getWorkflowManager().getModelContainer();
|
|
8361
|
-
|
|
8362
|
-
x: e.rotation.x * Math.PI / 180,
|
|
8363
|
-
y: e.rotation.y * Math.PI / 180,
|
|
8364
|
-
z: e.rotation.z * Math.PI / 180
|
|
8365
|
-
}, t.scale = e.scale;
|
|
8360
|
+
const t = this.flipTransform(e, A.getWorkflowManager().getPreviewService()), a = A.getWorkflowManager().getModelContainer();
|
|
8361
|
+
a.position = t.position, a.rotation = t.rotation, a.scale = t.scale;
|
|
8366
8362
|
}
|
|
8367
8363
|
setWorkflowExperienceTransform(A, e) {
|
|
8368
|
-
var
|
|
8369
|
-
if (!((
|
|
8364
|
+
var i;
|
|
8365
|
+
if (!((i = A == null ? void 0 : A.getWorkflowManager()) != null && i.getModelContainer()))
|
|
8370
8366
|
return;
|
|
8371
|
-
const t = A.getWorkflowManager().getModelContainer();
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
y: e.rotation.y * Math.PI / 180,
|
|
8375
|
-
z: e.rotation.z * Math.PI / 180
|
|
8376
|
-
}, t.scale = e.scale;
|
|
8377
|
-
const a = A.getWorkflowManager().getTransaction().id;
|
|
8367
|
+
const t = this.flipTransform(e, A.getWorkflowManager().getPreviewService()), a = A.getWorkflowManager().getModelContainer();
|
|
8368
|
+
a.position = t.position, a.rotation = t.rotation, a.scale = t.scale;
|
|
8369
|
+
const n = A.getWorkflowManager().getTransaction().id;
|
|
8378
8370
|
this.state ? this.state.transactions || (this.state.transactions = []) : this.state = {
|
|
8379
8371
|
transactions: []
|
|
8380
8372
|
};
|
|
8381
|
-
const
|
|
8382
|
-
|
|
8383
|
-
transactionId:
|
|
8373
|
+
const s = this.state.transactions.find((o) => o.transactionId === n);
|
|
8374
|
+
s ? s.transform = e : this.state.transactions.push({
|
|
8375
|
+
transactionId: n,
|
|
8384
8376
|
transform: e
|
|
8385
8377
|
});
|
|
8386
8378
|
}
|
|
@@ -8394,6 +8386,25 @@ class As {
|
|
|
8394
8386
|
if (this.state)
|
|
8395
8387
|
return JSON.stringify(this.state);
|
|
8396
8388
|
}
|
|
8389
|
+
flipTransform(A, e) {
|
|
8390
|
+
return e && e.flipTransform ? e.flipTransform(
|
|
8391
|
+
A.position,
|
|
8392
|
+
{
|
|
8393
|
+
x: A.rotation.x * Math.PI / 180,
|
|
8394
|
+
y: A.rotation.y * Math.PI / 180,
|
|
8395
|
+
z: A.rotation.z * Math.PI / 180
|
|
8396
|
+
},
|
|
8397
|
+
A.scale
|
|
8398
|
+
) : {
|
|
8399
|
+
position: A.position,
|
|
8400
|
+
rotation: {
|
|
8401
|
+
x: A.rotation.x * Math.PI / 180,
|
|
8402
|
+
y: A.rotation.y * Math.PI / 180,
|
|
8403
|
+
z: A.rotation.z * Math.PI / 180
|
|
8404
|
+
},
|
|
8405
|
+
scale: A.scale
|
|
8406
|
+
};
|
|
8407
|
+
}
|
|
8397
8408
|
}
|
|
8398
8409
|
class es {
|
|
8399
8410
|
constructor(A) {
|