@spiffcommerce/core 22.0.1 → 22.0.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.d.ts CHANGED
@@ -495,6 +495,21 @@ declare class Variant {
495
495
  isEnabled(): boolean;
496
496
  }
497
497
 
498
+ /**
499
+ * Steps that support custom color variants should implement the following interface to
500
+ * add the behavior in the way that makes sense to the step.
501
+ */
502
+ interface CustomColorSupport {
503
+ /**
504
+ * Allows for setting a custom color when the custom variant is selected. Will
505
+ * throw when a non-custom variant is selected.
506
+ */
507
+ setCustomColor(color: string): any;
508
+ /**
509
+ * Get the custom color that is currently set on the step.
510
+ */
511
+ getCustomColor(): string;
512
+ }
498
513
  /**
499
514
  * A StepHandle allows for managing the state of a specific step in a workflow. This class
500
515
  * abstracts away the complexities of dealing with a step directly and allows for using high level
@@ -1104,6 +1119,13 @@ declare class OptionGlobalPropertyHandle extends GlobalPropertyHandle {
1104
1119
  */
1105
1120
  declare class ColorOptionGlobalPropertyHandle extends OptionGlobalPropertyHandle {
1106
1121
  constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect, optionResource: OptionResource | undefined);
1122
+ /**
1123
+ * Select a given variant on the option for all shared steps.
1124
+ * @param variant The variant to select.
1125
+ */
1126
+ selectVariant(variant: Variant): Promise<void>;
1127
+ applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
1128
+ private applyColorVariant;
1107
1129
  /**
1108
1130
  * Sets a custom color on the global state.
1109
1131
  */
@@ -3123,7 +3145,7 @@ interface TextChangeResult {
3123
3145
  helperText?: string;
3124
3146
  errorText?: string;
3125
3147
  }
3126
- declare class TextStepHandle extends StepHandle<TextStepData> {
3148
+ declare class TextStepHandle extends StepHandle<TextStepData> implements CustomColorSupport {
3127
3149
  constructor(manager: WorkflowManager, step: Step<TextStepData>);
3128
3150
  /**
3129
3151
  * Allows for select a font from the available fonts configured on this steps base option.
@@ -3182,6 +3204,8 @@ declare class TextStepHandle extends StepHandle<TextStepData> {
3182
3204
  * the user is allowed to add, or undefined if there is no limit.
3183
3205
  */
3184
3206
  getCharactersRemaining(): number | undefined;
3207
+ setCustomColor(_color: string): void;
3208
+ getCustomColor(): string;
3185
3209
  }
3186
3210
 
3187
3211
  declare class PictureStepHandle extends StepHandle<PictureStepData> {
@@ -3340,7 +3364,7 @@ declare class QuestionStepHandle extends StepHandle<QuestionStepData> {
3340
3364
  getDisplayType(): any;
3341
3365
  }
3342
3366
 
3343
- declare class ShapeStepHandle extends StepHandle<ShapeStepData> {
3367
+ declare class ShapeStepHandle extends StepHandle<ShapeStepData> implements CustomColorSupport {
3344
3368
  constructor(manager: WorkflowManager, step: Step<ShapeStepData>);
3345
3369
  selectVariant(variant: Variant): Promise<void>;
3346
3370
  /**