@spiffcommerce/core 17.5.0-alpha.1 → 17.5.0-alpha.3
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.d.ts +2 -2
- package/dist/index.js +15 -15
- package/dist/index.umd.cjs +15 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1434,7 +1434,7 @@ interface WorkflowExperience {
|
|
|
1434
1434
|
* @param experience The experience to take selections from.
|
|
1435
1435
|
* @param filter A list of steps to apply the selections to. If undefined all steps will be updated.
|
|
1436
1436
|
*/
|
|
1437
|
-
|
|
1437
|
+
copySelectionsViaGlobalConfiguration(bundle: Bundle, experience: WorkflowExperience, filter?: StepHandle<AnyStepData>[]): Promise<void>;
|
|
1438
1438
|
/**
|
|
1439
1439
|
* Attach specific details about the customer to the experience. This is useful for things like retargeting. Currently only
|
|
1440
1440
|
* email is supported. From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
|
|
@@ -1511,7 +1511,7 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
|
|
|
1511
1511
|
getSelectionPriceSubunits(): number;
|
|
1512
1512
|
getBasePriceSubunits(): number;
|
|
1513
1513
|
getTotalPriceSubunits(): number;
|
|
1514
|
-
|
|
1514
|
+
copySelectionsViaGlobalConfiguration(bundle: Bundle, experience: WorkflowExperience, filter?: StepHandle<AnyStepData>[]): Promise<void>;
|
|
1515
1515
|
getStepByName(name: string): TextStepHandle | FrameStepHandle | ShapeStepHandle | InformationStepHandle | IllustrationStepHandle | MaterialStepHandle | ModelStepHandle | PictureStepHandle | QuestionStepHandle | undefined;
|
|
1516
1516
|
getStepsByType(type: StepType): StepHandle<AnyStepData>[];
|
|
1517
1517
|
getStepsByScene(scene: Scene): StepHandle<AnyStepData>[];
|
package/dist/index.js
CHANGED
|
@@ -6519,22 +6519,22 @@ class dA {
|
|
|
6519
6519
|
getTotalPriceSubunits() {
|
|
6520
6520
|
return this.getBasePriceSubunits() + this.getSelectionPriceSubunits();
|
|
6521
6521
|
}
|
|
6522
|
-
|
|
6523
|
-
const
|
|
6524
|
-
|
|
6525
|
-
const
|
|
6526
|
-
|
|
6527
|
-
const
|
|
6528
|
-
|
|
6529
|
-
const
|
|
6530
|
-
if (
|
|
6531
|
-
const
|
|
6532
|
-
if (!
|
|
6522
|
+
async copySelectionsViaGlobalConfiguration(A, e, t) {
|
|
6523
|
+
const a = await A.getGlobalProperties(), n = t == null ? void 0 : t.map((r) => r.getId()), s = this.getSteps().filter((r) => n === void 0 || n.includes(r.getId())), i = e.getSteps(), o = (r) => a.find((g) => g.getRawProperty().name === r.aspectName);
|
|
6524
|
+
s.forEach((r) => {
|
|
6525
|
+
const g = /* @__PURE__ */ new Set(), B = r.getRaw().globalPropertyAspectConfigurations;
|
|
6526
|
+
B !== void 0 && (B.forEach((l) => g.add(JSON.stringify(l))), console.log(B), i.forEach((l) => {
|
|
6527
|
+
const w = l.getRaw().globalPropertyAspectConfigurations;
|
|
6528
|
+
w !== void 0 && w.forEach((d) => {
|
|
6529
|
+
const C = o(d), E = g.has(JSON.stringify(d));
|
|
6530
|
+
if (E && (C == null ? void 0 : C.getType()) === "Option") {
|
|
6531
|
+
const Q = l.getCurrentVariant();
|
|
6532
|
+
if (!Q)
|
|
6533
6533
|
return;
|
|
6534
|
-
|
|
6535
|
-
} else if (
|
|
6536
|
-
const
|
|
6537
|
-
|
|
6534
|
+
r.selectVariant(Q), g.delete(JSON.stringify(d));
|
|
6535
|
+
} else if (E && (C == null ? void 0 : C.getType()) === "Text") {
|
|
6536
|
+
const Q = l.getText();
|
|
6537
|
+
r.setText(Q), g.delete(JSON.stringify(d));
|
|
6538
6538
|
}
|
|
6539
6539
|
});
|
|
6540
6540
|
}));
|