@spiffcommerce/core 37.0.3 → 37.1.0

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 CHANGED
@@ -806,13 +806,17 @@ declare class Variant {
806
806
  */
807
807
  isDefault(): boolean;
808
808
  /**
809
- * @returns The underlying variant resource. Generally not needed but made available just incase.
809
+ * @returns The underlying variant resource. Generally not needed but made available just in case.
810
810
  */
811
811
  getResource(): VariantResource;
812
812
  /**
813
813
  * @returns True when the variant is enabled. False otherwise.
814
814
  */
815
815
  isEnabled(): boolean;
816
+ /**
817
+ * @returns The category for grouping variants in an option.
818
+ */
819
+ getCategory(): string | undefined;
816
820
  }
817
821
 
818
822
  /**
@@ -3069,6 +3073,7 @@ interface VariantResource {
3069
3073
  default?: boolean;
3070
3074
  namedColor?: string;
3071
3075
  option?: OptionResource;
3076
+ category?: string;
3072
3077
  }
3073
3078
  interface IntegrationOptionResource {
3074
3079
  id?: string;
@@ -3193,6 +3198,7 @@ interface FrameStepData extends Animatable, Placeable, Colorable {
3193
3198
  displaySelectionOnFinishStep?: boolean;
3194
3199
  displayImageOnFinishStep?: boolean;
3195
3200
  disablePlaceholder?: boolean;
3201
+ enableVariantCategories?: boolean;
3196
3202
  initialZoomLevel?: number;
3197
3203
  markSelectionAsCustomField?: boolean;
3198
3204
  markImageAsCustomField?: boolean;
@@ -3213,6 +3219,7 @@ interface IllustrationStepData extends Animatable, Placeable, Colorable {
3213
3219
  hideColorsInCart?: boolean;
3214
3220
  displaySelectionOnFinishStep?: boolean;
3215
3221
  displayColorsOnFinishStep?: boolean;
3222
+ enableVariantCategories?: boolean;
3216
3223
  enableVariantSearch?: boolean;
3217
3224
  markSelectionAsCustomField?: boolean;
3218
3225
  markColorsAsCustomField?: boolean;
@@ -3227,6 +3234,7 @@ interface IllustrationStepData extends Animatable, Placeable, Colorable {
3227
3234
  interface MaterialStepData extends Animatable {
3228
3235
  hideSelectionInCart?: boolean;
3229
3236
  displaySelectionOnFinishStep?: boolean;
3237
+ enableVariantCategories?: boolean;
3230
3238
  markSelectionAsCustomField?: boolean;
3231
3239
  targetMaterials: string[];
3232
3240
  varySelection?: boolean;
@@ -3235,6 +3243,7 @@ interface ModelStepData extends Animatable {
3235
3243
  replaceProductModel?: boolean;
3236
3244
  hideSelectionInCart?: boolean;
3237
3245
  displaySelectionOnFinishStep?: boolean;
3246
+ enableVariantCategories?: boolean;
3238
3247
  markSelectionAsCustomField?: boolean;
3239
3248
  varySelection?: boolean;
3240
3249
  }
@@ -3249,6 +3258,7 @@ interface ModuleStepData extends Animatable, Placeable {
3249
3258
  interface PictureStepData extends Animatable, Placeable {
3250
3259
  hideSelectionInCart?: boolean;
3251
3260
  displaySelectionOnFinishStep?: boolean;
3261
+ enableVariantCategories?: boolean;
3252
3262
  enableVariantSearch?: boolean;
3253
3263
  markSelectionAsCustomField?: boolean;
3254
3264
  varySelection?: boolean;
@@ -3262,6 +3272,7 @@ interface QuestionStepData extends Animatable {
3262
3272
  interface ShapeStepData extends Animatable, Placeable {
3263
3273
  hideSelectionInCart?: boolean;
3264
3274
  displaySelectionOnFinishStep?: boolean;
3275
+ enableVariantCategories?: boolean;
3265
3276
  markSelectionAsCustomField?: boolean;
3266
3277
  defaultColour?: string;
3267
3278
  excludeFromPrint?: boolean;
@@ -3278,6 +3289,7 @@ interface TextStepData extends Animatable, Placeable, Colorable {
3278
3289
  displayColorOnFinishStep?: boolean;
3279
3290
  displayTextOnFinishStep?: boolean;
3280
3291
  displayStrokeOnFinishStep?: boolean;
3292
+ enableVariantCategories?: boolean;
3281
3293
  markSelectionAsCustomField?: boolean;
3282
3294
  markFillImageAsCustomField?: boolean;
3283
3295
  markColorAsCustomField?: boolean;
@@ -5333,6 +5345,7 @@ declare class IllustrationStepHandle extends StepHandle<IllustrationStepData> {
5333
5345
  isColorPickerEnabled(): boolean;
5334
5346
  isPMSPickerEnabled(): boolean;
5335
5347
  isVariantSearchEnabled(): boolean;
5348
+ isVariantCategoriesEnabled(): boolean;
5336
5349
  }
5337
5350
 
5338
5351
  interface TextChangeResult {
@@ -5426,6 +5439,7 @@ declare class TextStepHandle extends StepHandle<TextStepData> implements CustomC
5426
5439
  * @param stroke A new stroke value to use.
5427
5440
  */
5428
5441
  setStrokeColor(stroke: ColorOption | undefined): Promise<void>;
5442
+ isVariantCategoriesEnabled(): boolean;
5429
5443
  }
5430
5444
 
5431
5445
  declare class PictureStepHandle extends StepHandle<PictureStepData> {
@@ -5437,6 +5451,7 @@ declare class PictureStepHandle extends StepHandle<PictureStepData> {
5437
5451
  */
5438
5452
  selectVariant(variant: Variant): Promise<void>;
5439
5453
  isVariantSearchEnabled(): boolean;
5454
+ isVariantCategoriesEnabled(): boolean;
5440
5455
  }
5441
5456
 
5442
5457
  /**
@@ -5516,6 +5531,7 @@ declare class ParseError extends ImplementationError {
5516
5531
  declare class ModelStepHandle extends StepHandle<ModelStepData> {
5517
5532
  constructor(manager: WorkflowManager, step: Step<ModelStepData>, tags: string[]);
5518
5533
  selectVariant(variant: Variant): Promise<void>;
5534
+ isVariantCategoriesEnabled(): boolean;
5519
5535
  }
5520
5536
 
5521
5537
  declare enum FrameStep {
@@ -5571,11 +5587,13 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
5571
5587
  getUseOriginalImageSelection(): boolean;
5572
5588
  setUseOriginalImageSelection(value: boolean): Promise<void>;
5573
5589
  private getFrameStepStorage;
5590
+ isVariantCategoriesEnabled(): boolean;
5574
5591
  }
5575
5592
 
5576
5593
  declare class MaterialStepHandle extends StepHandle<MaterialStepData> {
5577
5594
  constructor(manager: WorkflowManager, step: Step<MaterialStepData>, tags: string[]);
5578
5595
  selectVariant(variant: Variant): Promise<void>;
5596
+ isVariantCategoriesEnabled(): boolean;
5579
5597
  }
5580
5598
 
5581
5599
  declare class QuestionStepHandle extends StepHandle<QuestionStepData> {
@@ -5612,6 +5630,7 @@ declare class ShapeStepHandle extends StepHandle<ShapeStepData> implements Custo
5612
5630
  */
5613
5631
  setCustomColor(color: string): void;
5614
5632
  getCustomColor(): string;
5633
+ isVariantCategoriesEnabled(): boolean;
5615
5634
  }
5616
5635
 
5617
5636
  declare const shortenUrl: (longUrl: string) => Promise<string>;
package/dist/index.mjs CHANGED
@@ -3877,6 +3877,7 @@ const Ie = new $r(), Ur = C`
3877
3877
  material {
3878
3878
  ...MaterialFields
3879
3879
  }
3880
+ category
3880
3881
  }
3881
3882
  defaultVariant {
3882
3883
  id
@@ -4751,6 +4752,7 @@ const B = new Wr(), Ln = C`
4751
4752
  disablePlaceholder
4752
4753
  displayImageOnFinishStep
4753
4754
  displaySelectionOnFinishStep
4755
+ enableVariantCategories
4754
4756
  forceImageCover
4755
4757
  hideImageInCart
4756
4758
  hideSelectionInCart
@@ -4784,6 +4786,7 @@ const B = new Wr(), Ln = C`
4784
4786
  pmsPickerEnabled
4785
4787
  displayColorsOnFinishStep
4786
4788
  displaySelectionOnFinishStep
4789
+ enableVariantCategories
4787
4790
  enableVariantSearch
4788
4791
  hideColorsInCart
4789
4792
  hideSelectionInCart
@@ -4805,6 +4808,7 @@ const B = new Wr(), Ln = C`
4805
4808
  layoutName
4806
4809
  }
4807
4810
  displaySelectionOnFinishStep
4811
+ enableVariantCategories
4808
4812
  hideSelectionInCart
4809
4813
  lookAtAnimation {
4810
4814
  ...LookAtAnimationFields
@@ -4822,6 +4826,7 @@ const B = new Wr(), Ln = C`
4822
4826
  layoutName
4823
4827
  }
4824
4828
  displaySelectionOnFinishStep
4829
+ enableVariantCategories
4825
4830
  hideSelectionInCart
4826
4831
  lookAtAnimation {
4827
4832
  ...LookAtAnimationFields
@@ -4860,6 +4865,7 @@ const B = new Wr(), Ln = C`
4860
4865
  layoutName
4861
4866
  }
4862
4867
  displaySelectionOnFinishStep
4868
+ enableVariantCategories
4863
4869
  enableVariantSearch
4864
4870
  hideSelectionInCart
4865
4871
  lookAtAnimation {
@@ -4904,6 +4910,7 @@ const B = new Wr(), Ln = C`
4904
4910
  layoutName
4905
4911
  }
4906
4912
  displaySelectionOnFinishStep
4913
+ enableVariantCategories
4907
4914
  excludeFromPrint
4908
4915
  hideSelectionInCart
4909
4916
  lookAtAnimation {
@@ -4956,6 +4963,7 @@ const B = new Wr(), Ln = C`
4956
4963
  displayImageFillOnFinishStep
4957
4964
  displayStrokeOnFinishStep
4958
4965
  displayTextOnFinishStep
4966
+ enableVariantCategories
4959
4967
  hideColorInCart
4960
4968
  hideImageFillInCart
4961
4969
  hideSelectionInCart
@@ -11800,7 +11808,7 @@ class rt {
11800
11808
  return !!this.variantData.default;
11801
11809
  }
11802
11810
  /**
11803
- * @returns The underlying variant resource. Generally not needed but made available just incase.
11811
+ * @returns The underlying variant resource. Generally not needed but made available just in case.
11804
11812
  */
11805
11813
  getResource() {
11806
11814
  return this.variantData;
@@ -11811,6 +11819,12 @@ class rt {
11811
11819
  isEnabled() {
11812
11820
  return this.variantData.enabled;
11813
11821
  }
11822
+ /**
11823
+ * @returns The category for grouping variants in an option.
11824
+ */
11825
+ getCategory() {
11826
+ return this.variantData.category;
11827
+ }
11814
11828
  }
11815
11829
  const jt = class jt {
11816
11830
  constructor(t, e, a) {
@@ -12025,6 +12039,9 @@ class Al extends tt {
12025
12039
  isVariantSearchEnabled() {
12026
12040
  return this.step.data.enableVariantSearch ?? !1;
12027
12041
  }
12042
+ isVariantCategoriesEnabled() {
12043
+ return this.step.data.enableVariantCategories ?? !1;
12044
+ }
12028
12045
  }
12029
12046
  class ul extends tt {
12030
12047
  constructor(t, e, a) {
@@ -12038,6 +12055,9 @@ class ul extends tt {
12038
12055
  (e) => this.setUpdateState(e)
12039
12056
  );
12040
12057
  }
12058
+ isVariantCategoriesEnabled() {
12059
+ return this.step.data.enableVariantCategories ?? !1;
12060
+ }
12041
12061
  }
12042
12062
  class hl extends tt {
12043
12063
  constructor(t, e, a) {
@@ -12051,6 +12071,9 @@ class hl extends tt {
12051
12071
  (e) => this.setUpdateState(e)
12052
12072
  );
12053
12073
  }
12074
+ isVariantCategoriesEnabled() {
12075
+ return this.step.data.enableVariantCategories ?? !1;
12076
+ }
12054
12077
  }
12055
12078
  class gl extends tt {
12056
12079
  constructor(t, e, a) {
@@ -12072,6 +12095,9 @@ class gl extends tt {
12072
12095
  isVariantSearchEnabled() {
12073
12096
  return this.step.data.enableVariantSearch ?? !1;
12074
12097
  }
12098
+ isVariantCategoriesEnabled() {
12099
+ return this.step.data.enableVariantCategories ?? !1;
12100
+ }
12075
12101
  }
12076
12102
  class ml extends tt {
12077
12103
  constructor(t, e, a) {
@@ -12147,6 +12173,9 @@ class pl extends tt {
12147
12173
  );
12148
12174
  return t;
12149
12175
  }
12176
+ isVariantCategoriesEnabled() {
12177
+ return this.step.data.enableVariantCategories ?? !1;
12178
+ }
12150
12179
  }
12151
12180
  class fl extends tt {
12152
12181
  constructor(t, e, a) {
@@ -12340,6 +12369,9 @@ class fl extends tt {
12340
12369
  const e = this.manager.getRegionElements(this.step.stepName);
12341
12370
  await W.changeStrokeColor(this.step, t, e, this.manager);
12342
12371
  }
12372
+ isVariantCategoriesEnabled() {
12373
+ return this.step.data.enableVariantCategories ?? !1;
12374
+ }
12343
12375
  }
12344
12376
  class Cl extends tt {
12345
12377
  constructor(t, e, a) {
@@ -16111,7 +16143,7 @@ class qd {
16111
16143
  } catch (a) {
16112
16144
  throw console.error(a), new pt("Critical - Unable to synchronize workflow state with server.");
16113
16145
  }
16114
- }, this.options = t, this.options.applicationKey && cr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 37.0.3"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16146
+ }, this.options = t, this.options.applicationKey && cr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 37.1.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16115
16147
  }
16116
16148
  configure(t) {
16117
16149
  Ct.setHubUrl(t.hubUrl), Ct.setServerUrl(t.serverUrl), Ct.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 && Ar(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -17333,6 +17365,9 @@ class Cc extends tt {
17333
17365
  getFrameStepStorage() {
17334
17366
  return this.manager.getStepStorage(this.step.stepName);
17335
17367
  }
17368
+ isVariantCategoriesEnabled() {
17369
+ return this.step.data.enableVariantCategories ?? !1;
17370
+ }
17336
17371
  }
17337
17372
  const wc = C`
17338
17373
  query GetLoggedInCustomer($email: String!) {