@spiffcommerce/core 34.0.0-beta.1033a071-5801-5320-9771-1b3f56e549da → 34.0.0-beta.3f2fe6a9-805d-5c25-a99f-4d12215f8c94

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
@@ -3349,7 +3349,10 @@ const de = (n) => {
3349
3349
  Pa(e);
3350
3350
  const a = {};
3351
3351
  Dt(e, (o) => {
3352
- fr.includes(o.tagName) && !o.attributes.getNamedItem("fill") && o.setAttribute("fill", "black");
3352
+ if (fr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
3353
+ const c = "spiff-fill-none";
3354
+ o.setAttribute("spiff-fill", "none"), o.classList.add(c), a.none = { browserValue: "none" };
3355
+ }
3353
3356
  const s = o.attributes.getNamedItem("fill");
3354
3357
  if (s && s.value !== "none" && !s.value.startsWith("url(")) {
3355
3358
  const c = Ya(s.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
@@ -8902,7 +8905,6 @@ class _o {
8902
8905
  });
8903
8906
  }
8904
8907
  updateInputText(t, e, a, i) {
8905
- console.log(`LOG: updateInputText start | ${t}`);
8906
8908
  const r = i.getStepStorage(a.stepName), o = xt(t, i), s = this.getProcessedInput(o, a.data, r?.customiseAllText ?? !1), l = {
8907
8909
  command: void 0,
8908
8910
  helperData: {},
@@ -8926,7 +8928,7 @@ class _o {
8926
8928
  `);
8927
8929
  c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, m));
8928
8930
  }
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, {
8931
+ 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, {
8930
8932
  text: s
8931
8933
  }), (r?.defaultCleared || !a.data.deleteDefaultOnFocus) && s.trim() !== "" && i.setMandatoryFulfilled(a.stepName, !0), l.command = new $(c), l);
8932
8934
  }
@@ -11361,12 +11363,11 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11361
11363
  ...this.storage,
11362
11364
  [t]: { ...this.storage[t], ...e }
11363
11365
  };
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;
11366
+ if (!jt(a, this.storage)) {
11367
+ this.storage = a;
11366
11368
  const i = new tn(this.constructSerializableWorkflow());
11367
11369
  this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
11368
11370
  }
11369
- console.log("LOG: updateStorage end");
11370
11371
  }
11371
11372
  constructSerializableWorkflow() {
11372
11373
  const t = [];
@@ -11445,7 +11446,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11445
11446
  return this.workflowStatePromiseQueue.finalize();
11446
11447
  }
11447
11448
  updateMetadata(t, e) {
11448
- console.log("LOG: updateMetadata"), this.stepMetadata = {
11449
+ this.stepMetadata = {
11449
11450
  ...this.stepMetadata,
11450
11451
  [t]: { ...this.stepMetadata[t], ...e }
11451
11452
  }, this.onMetadataChange();
@@ -12205,27 +12206,34 @@ class cl extends tt {
12205
12206
  * @param userInput Input from the user.
12206
12207
  */
12207
12208
  setText(t) {
12208
- console.log(`LOG: setText start | ${t}`);
12209
12209
  const e = {
12210
12210
  input: t,
12211
12211
  helperData: {}
12212
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;
12213
12213
  o || (e.input = i);
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
+ const s = a.length <= 0, l = s ? { inputText: i, text: i } : { inputText: i };
12215
+ this.manager.updateStorage(this.step.stepName, l);
12216
+ const c = this.manager.getStepStorage(this.step.stepName), d = H.getProcessedInput(
12217
12217
  i,
12218
12218
  this.step.data,
12219
- l?.customiseAllText ?? !1
12220
- ), { command: d, errorData: A, helperData: u } = H.updateInputText(
12221
- i,
12222
- a,
12223
- this.step,
12224
- this.manager
12219
+ c?.customiseAllText ?? !1
12225
12220
  );
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;
12221
+ if (s)
12222
+ o || this.manager.updateMetadata(this.step.stepName, {
12223
+ text: d
12224
+ });
12225
+ else {
12226
+ const { command: A, errorData: u, helperData: h } = H.updateInputText(
12227
+ i,
12228
+ a,
12229
+ this.step,
12230
+ this.manager
12231
+ );
12232
+ A && this.manager.getCommandDispatcher()(A), e.helperData = h, e.errorData = u, !o && !u && this.manager.updateMetadata(this.step.stepName, {
12233
+ text: d
12234
+ });
12235
+ }
12236
+ return e;
12229
12237
  }
12230
12238
  /**
12231
12239
  * Gets the text currently applied to the elements of this step.
@@ -16109,7 +16117,6 @@ const nc = async (n, t) => {
16109
16117
  class Rd {
16110
16118
  constructor(t) {
16111
16119
  this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
16112
- console.log(`LOG: update state ${JSON.stringify(e, null, 2)}`), console.trace();
16113
16120
  try {
16114
16121
  return y.getShadowGraphqlClient().mutate({
16115
16122
  ...e,
@@ -16118,7 +16125,7 @@ class Rd {
16118
16125
  } catch (a) {
16119
16126
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16120
16127
  }
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("------------------------");
16128
+ }, 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.c6fd98dc-c442-53b2-b921-8f53e4fd56f9"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16122
16129
  }
16123
16130
  configure(t) {
16124
16131
  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);