@spiffcommerce/core 33.13.5-beta.bf9e6812-4b7d-59ec-92d3-64859ca497f4 → 34.0.0-beta.1033a071-5801-5320-9771-1b3f56e549da
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 +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8902,6 +8902,7 @@ class _o {
|
|
|
8902
8902
|
});
|
|
8903
8903
|
}
|
|
8904
8904
|
updateInputText(t, e, a, i) {
|
|
8905
|
+
console.log(`LOG: updateInputText start | ${t}`);
|
|
8905
8906
|
const r = i.getStepStorage(a.stepName), o = xt(t, i), s = this.getProcessedInput(o, a.data, r?.customiseAllText ?? !1), l = {
|
|
8906
8907
|
command: void 0,
|
|
8907
8908
|
helperData: {},
|
|
@@ -8925,7 +8926,7 @@ class _o {
|
|
|
8925
8926
|
`);
|
|
8926
8927
|
c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, m));
|
|
8927
8928
|
}
|
|
8928
|
-
return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (i.updateStorage(a.stepName, { text: t }), i.updateMetadata(a.stepName, {
|
|
8929
|
+
return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (console.log("LOG: updateInputText workflowManager"), i.updateStorage(a.stepName, { text: t }), i.updateMetadata(a.stepName, {
|
|
8929
8930
|
text: s
|
|
8930
8931
|
}), (r?.defaultCleared || !a.data.deleteDefaultOnFocus) && s.trim() !== "" && i.setMandatoryFulfilled(a.stepName, !0), l.command = new $(c), l);
|
|
8931
8932
|
}
|
|
@@ -11360,11 +11361,12 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11360
11361
|
...this.storage,
|
|
11361
11362
|
[t]: { ...this.storage[t], ...e }
|
|
11362
11363
|
};
|
|
11363
|
-
if (!jt(a, this.storage)) {
|
|
11364
|
-
this.storage = a;
|
|
11364
|
+
if (console.log(`LOG: updateStorage start | ${t} ${JSON.stringify(e, null, 2)}`), !jt(a, this.storage)) {
|
|
11365
|
+
console.log("LOG: updateStorage logic"), this.storage = a;
|
|
11365
11366
|
const i = new tn(this.constructSerializableWorkflow());
|
|
11366
11367
|
this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
|
11367
11368
|
}
|
|
11369
|
+
console.log("LOG: updateStorage end");
|
|
11368
11370
|
}
|
|
11369
11371
|
constructSerializableWorkflow() {
|
|
11370
11372
|
const t = [];
|
|
@@ -11415,13 +11417,13 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11415
11417
|
return JSON.stringify(a, this.sortKeysReplacer, void 0);
|
|
11416
11418
|
}
|
|
11417
11419
|
async getStateHash() {
|
|
11418
|
-
const
|
|
11420
|
+
const t = this.getCommandContext().getState(), a = Object.values(t?.transaction.layouts || {}).map((o) => o.modificationID ?? "").sort().join(""), r = new TextEncoder().encode(a);
|
|
11419
11421
|
if (typeof window < "u" && window.crypto && window.crypto.subtle && window.crypto.subtle.digest) {
|
|
11420
|
-
const
|
|
11421
|
-
return Array.from(new Uint8Array(
|
|
11422
|
+
const o = await window.crypto.subtle.digest("SHA-256", r);
|
|
11423
|
+
return Array.from(new Uint8Array(o)).map((c) => c.toString(16).padStart(2, "0")).join("");
|
|
11422
11424
|
}
|
|
11423
11425
|
try {
|
|
11424
|
-
return (await import("crypto")).createHash("sha256").update(
|
|
11426
|
+
return (await import("crypto")).createHash("sha256").update(a, "utf8").digest("hex");
|
|
11425
11427
|
} catch {
|
|
11426
11428
|
throw new Error("Unable to compute SHA-256 hash: no suitable crypto implementation available.");
|
|
11427
11429
|
}
|
|
@@ -11443,7 +11445,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11443
11445
|
return this.workflowStatePromiseQueue.finalize();
|
|
11444
11446
|
}
|
|
11445
11447
|
updateMetadata(t, e) {
|
|
11446
|
-
this.stepMetadata = {
|
|
11448
|
+
console.log("LOG: updateMetadata"), this.stepMetadata = {
|
|
11447
11449
|
...this.stepMetadata,
|
|
11448
11450
|
[t]: { ...this.stepMetadata[t], ...e }
|
|
11449
11451
|
}, this.onMetadataChange();
|
|
@@ -12203,34 +12205,27 @@ class cl extends tt {
|
|
|
12203
12205
|
* @param userInput Input from the user.
|
|
12204
12206
|
*/
|
|
12205
12207
|
setText(t) {
|
|
12208
|
+
console.log(`LOG: setText start | ${t}`);
|
|
12206
12209
|
const e = {
|
|
12207
12210
|
input: t,
|
|
12208
12211
|
helperData: {}
|
|
12209
12212
|
}, a = H.findLayoutElements(this.manager, this.step), i = H.filterUnsupportedCharacters(t, a[0]?.fontData), r = xt(i, this.manager).length, o = !!this.step.data && !!this.step.data.maxLength && r > this.step.data.maxLength;
|
|
12210
12213
|
o || (e.input = i);
|
|
12211
|
-
const s =
|
|
12212
|
-
this.manager.updateStorage(this.step.stepName,
|
|
12213
|
-
const
|
|
12214
|
+
const s = { inputText: i, text: i };
|
|
12215
|
+
this.manager.updateStorage(this.step.stepName, s);
|
|
12216
|
+
const l = this.manager.getStepStorage(this.step.stepName), c = H.getProcessedInput(
|
|
12214
12217
|
i,
|
|
12215
12218
|
this.step.data,
|
|
12216
|
-
|
|
12219
|
+
l?.customiseAllText ?? !1
|
|
12220
|
+
), { command: d, errorData: A, helperData: u } = H.updateInputText(
|
|
12221
|
+
i,
|
|
12222
|
+
a,
|
|
12223
|
+
this.step,
|
|
12224
|
+
this.manager
|
|
12217
12225
|
);
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
});
|
|
12222
|
-
else {
|
|
12223
|
-
const { command: A, errorData: u, helperData: h } = H.updateInputText(
|
|
12224
|
-
i,
|
|
12225
|
-
a,
|
|
12226
|
-
this.step,
|
|
12227
|
-
this.manager
|
|
12228
|
-
);
|
|
12229
|
-
A && this.manager.getCommandDispatcher()(A), e.helperData = h, e.errorData = u, !o && !u && this.manager.updateMetadata(this.step.stepName, {
|
|
12230
|
-
text: d
|
|
12231
|
-
});
|
|
12232
|
-
}
|
|
12233
|
-
return e;
|
|
12226
|
+
return d && (console.log("LOG: setText command"), this.manager.getCommandDispatcher()(d)), e.helperData = u, e.errorData = A, !o && !A ? this.manager.updateMetadata(this.step.stepName, {
|
|
12227
|
+
text: c
|
|
12228
|
+
}) : console.log(`Text update - Helper data: ${JSON.stringify(u, null, 2)}, Error data: ${JSON.stringify(A, null, 2)}`), e;
|
|
12234
12229
|
}
|
|
12235
12230
|
/**
|
|
12236
12231
|
* Gets the text currently applied to the elements of this step.
|
|
@@ -16114,6 +16109,7 @@ const nc = async (n, t) => {
|
|
|
16114
16109
|
class Rd {
|
|
16115
16110
|
constructor(t) {
|
|
16116
16111
|
this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
|
|
16112
|
+
console.log(`LOG: update state ${JSON.stringify(e, null, 2)}`), console.trace();
|
|
16117
16113
|
try {
|
|
16118
16114
|
return y.getShadowGraphqlClient().mutate({
|
|
16119
16115
|
...e,
|
|
@@ -16122,7 +16118,7 @@ class Rd {
|
|
|
16122
16118
|
} catch (a) {
|
|
16123
16119
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16124
16120
|
}
|
|
16125
|
-
}, this.options = t, this.options.applicationKey && ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version:
|
|
16121
|
+
}, this.options = t, this.options.applicationKey && ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.0.0-beta.f9a65e6d-b579-5217-bb7a-7b2964aa0a43"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16126
16122
|
}
|
|
16127
16123
|
configure(t) {
|
|
16128
16124
|
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && ir(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|