@spiffcommerce/core 32.2.1 → 32.2.2

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.mjs CHANGED
@@ -8912,7 +8912,7 @@ class Ms {
8912
8912
  });
8913
8913
  }
8914
8914
  updateInputText(t, e, a, n) {
8915
- const i = n.getStepStorage(a.stepName), s = this.getProcessedInput(t, a.data, i?.customiseAllText ?? !1), o = Ft(s, n), l = {
8915
+ const i = n.getStepStorage(a.stepName), s = Ft(t, n), o = this.getProcessedInput(s, a.data, i?.customiseAllText ?? !1), l = {
8916
8916
  command: void 0,
8917
8917
  helperData: {},
8918
8918
  errorData: this.getErrorsForText(t, o, a, n)
@@ -8931,13 +8931,13 @@ class Ms {
8931
8931
  { size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
8932
8932
  );
8933
8933
  d.set(u.id, h), A.set(u.id, m);
8934
- const g = a.data.curved ? s : (m || []).join(`
8934
+ const g = a.data.curved ? o : (m || []).join(`
8935
8935
  `);
8936
8936
  c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, g));
8937
8937
  }
8938
8938
  return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
8939
- text: s
8940
- }), (i?.defaultCleared || !a.data.deleteDefaultOnFocus) && s.trim() !== "" && n.setMandatoryFulfilled(a.stepName, !0), l.command = new R(c), l);
8939
+ text: o
8940
+ }), (i?.defaultCleared || !a.data.deleteDefaultOnFocus) && o.trim() !== "" && n.setMandatoryFulfilled(a.stepName, !0), l.command = new R(c), l);
8941
8941
  }
8942
8942
  async selectVariant(t, e, a, n, i) {
8943
8943
  const s = await this.selectVariantCommand(
@@ -9171,7 +9171,7 @@ class Ms {
9171
9171
  async createTextboxRegions(t, e, a, n, i, s) {
9172
9172
  if (!a || !a.regions)
9173
9173
  throw new Error("Step data not supplied");
9174
- const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = Ft(l, s), d = async (u) => {
9174
+ const o = i.text || a.defaultText || "", l = Ft(o, s), c = this.getProcessedInput(l, a, !1), d = async (u) => {
9175
9175
  const m = s.getLayouts().find((p) => p.panelId === u.panelId), g = M();
9176
9176
  try {
9177
9177
  if (!m)
@@ -9195,7 +9195,7 @@ class Ms {
9195
9195
  layer: u.layer,
9196
9196
  layerIndex: u.layerIndex,
9197
9197
  rotation: u.rotation,
9198
- text: l,
9198
+ text: c,
9199
9199
  input: o,
9200
9200
  type: x.Textbox,
9201
9201
  vertical: a.vertical,
@@ -9225,7 +9225,7 @@ class Ms {
9225
9225
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9226
9226
  );
9227
9227
  E.set(I.id, B), P.set(I.id, F);
9228
- const Q = a.curved || a.vertical ? l : (F || []).join(`
9228
+ const Q = a.curved || a.vertical ? c : (F || []).join(`
9229
9229
  `);
9230
9230
  C.push(
9231
9231
  this.generateTextChangeCommandsForRegion(B, a, I.id, Q)
@@ -9268,7 +9268,7 @@ class Ms {
9268
9268
  * @deprecated
9269
9269
  */
9270
9270
  async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
9271
- const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = Ft(u, s), m = s.getRegionElements(t.stepName), g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
9271
+ const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, s), h = this.getProcessedInput(u, t.data, o), m = s.getRegionElements(t.stepName), g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
9272
9272
  for (const C of m)
9273
9273
  if (C.region) {
9274
9274
  const [E, P] = fe(
@@ -9283,15 +9283,15 @@ class Ms {
9283
9283
  const S = (() => {
9284
9284
  if (t.data && t.data.maxLength && h.length > t.data.maxLength)
9285
9285
  return d && d(!0), { info: "0" };
9286
- const C = s.getProfanities(), E = ea(u.toLowerCase());
9286
+ const C = s.getProfanities(), E = ea(h.toLowerCase());
9287
9287
  for (const P of E)
9288
9288
  for (const B in C) {
9289
9289
  const F = C[B].toLowerCase().replace(/\s/g, "");
9290
9290
  if (P === F)
9291
9291
  return l(!0), { error: "Blocked profanity." };
9292
9292
  }
9293
- return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
9294
- `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
9293
+ return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
9294
+ `) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
9295
9295
  })();
9296
9296
  if (S.error) {
9297
9297
  c(S.error);
@@ -9304,7 +9304,7 @@ class Ms {
9304
9304
  }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9305
9305
  const b = [];
9306
9306
  for (const C of m) {
9307
- const E = t.data.curved ? u : (p.get(C.id) || []).join(`
9307
+ const E = t.data.curved ? h : (p.get(C.id) || []).join(`
9308
9308
  `);
9309
9309
  b.push(
9310
9310
  this.generateTextChangeCommandsForRegion(
@@ -15965,7 +15965,7 @@ class pd {
15965
15965
  } catch (a) {
15966
15966
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15967
15967
  }
15968
- }, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15968
+ }, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15969
15969
  }
15970
15970
  configure(t) {
15971
15971
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.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 && Gr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);