@spiffcommerce/core 22.0.2 → 22.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 +23 -3
- package/dist/index.js +9882 -9799
- package/dist/index.umd.cjs +81 -80
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1995,12 +1995,15 @@ declare enum InformationMessageType {
|
|
|
1995
1995
|
Info = "Info"
|
|
1996
1996
|
}
|
|
1997
1997
|
/**
|
|
1998
|
-
* Services required for the
|
|
1998
|
+
* Services required for the operation of individual steps.
|
|
1999
1999
|
*/
|
|
2000
2000
|
interface StepSpecificServices {
|
|
2001
2001
|
frameService?: FrameService;
|
|
2002
2002
|
module?: ModuleProduct;
|
|
2003
2003
|
}
|
|
2004
|
+
interface ValidationErrors {
|
|
2005
|
+
steps: Map<string, Map<string, string>>;
|
|
2006
|
+
}
|
|
2004
2007
|
type DesignCreationProgressUpdate = (message: string) => void;
|
|
2005
2008
|
type ConfirmCallback = (isConfirmed: boolean) => void;
|
|
2006
2009
|
type EditedCallback = (editedSteps: EditedSteps) => void;
|
|
@@ -2017,6 +2020,7 @@ type SelectionCallback = (callbackOptions: {
|
|
|
2017
2020
|
}) => void;
|
|
2018
2021
|
type StepSpecificStorageCallback = (selections: StepStorage) => void;
|
|
2019
2022
|
type StorageCallback = (storage: WorkflowStorage) => void;
|
|
2023
|
+
type ValidationCallback = (validationErrors: ValidationErrors) => void;
|
|
2020
2024
|
type StateMutationFunc = (options?: Omit<MutationOptions, "mutation">) => Promise<FetchResult<any, Record<string, any>, Record<string, any>>>;
|
|
2021
2025
|
interface WorkflowManager {
|
|
2022
2026
|
addPoller: (poller: Poller) => void;
|
|
@@ -2031,6 +2035,7 @@ interface WorkflowManager {
|
|
|
2031
2035
|
addSelectionCallback: (callback: SelectionCallback) => void;
|
|
2032
2036
|
addStepSpecificStorageCallback: (callback: StepSpecificStorageCallback, stepName: string) => void;
|
|
2033
2037
|
addStorageCallback: (callback: StorageCallback) => void;
|
|
2038
|
+
addValidationCallback: (callback: ValidationCallback) => void;
|
|
2034
2039
|
getCommandDispatcher: () => (command: CanvasCommand) => void;
|
|
2035
2040
|
getCommandContext: () => CommandContext;
|
|
2036
2041
|
getLayouts: () => ILayout[];
|
|
@@ -2076,6 +2081,11 @@ interface WorkflowManager {
|
|
|
2076
2081
|
setInformationResults: (results: InformationResult[]) => void;
|
|
2077
2082
|
setMandatoryFulfilled: (stepName: string, status: boolean) => void;
|
|
2078
2083
|
setSelectionsAndElements: (stepName: string, variants: VariantResource[], elements: RegionElement[], callback?: () => Promise<void>) => Promise<void>;
|
|
2084
|
+
setStepError: (stepName: string, field: string, error: string | undefined) => void;
|
|
2085
|
+
/** Gets any validation errors for a specific step, or `undefined` if there are none. */
|
|
2086
|
+
getStepErrors: (stepName: string) => Map<string, string> | undefined;
|
|
2087
|
+
/** Gets validation errors for all steps. Only steps with errors will be present. */
|
|
2088
|
+
getValidationErrors: () => ValidationErrors;
|
|
2079
2089
|
toggleDesignConfirmed: () => void;
|
|
2080
2090
|
updateMetadata: (stepName: string, update: any) => void;
|
|
2081
2091
|
/**
|
|
@@ -2859,9 +2869,11 @@ declare class FrameStepService implements StepService<FrameStepData> {
|
|
|
2859
2869
|
getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
|
|
2860
2870
|
loadPatternFromString(src: string, frameService: FrameService, recalculateOffsets?: boolean, colors?: {
|
|
2861
2871
|
[key: string]: ColorDefinition;
|
|
2862
|
-
} | undefined): Promise<void>;
|
|
2872
|
+
} | undefined, colorSafeSvg?: boolean): Promise<void>;
|
|
2863
2873
|
changeColors(stepData: Step<FrameStepData>, workflowManager: WorkflowManager, newFills: Map<string, ColorDefinition>): void;
|
|
2874
|
+
getUniqueColorCount(stepData: Step<FrameStepData>, workflowManager: WorkflowManager): number;
|
|
2864
2875
|
private calculateColorMetadata;
|
|
2876
|
+
private validateColorCount;
|
|
2865
2877
|
private selectVariantCommand;
|
|
2866
2878
|
private frameSourceSvg;
|
|
2867
2879
|
/**
|
|
@@ -3108,6 +3120,12 @@ declare class MockWorkflowManager implements WorkflowManager {
|
|
|
3108
3120
|
ejectFromPreviewService(): void;
|
|
3109
3121
|
setWorkflowStateSyncEnabled(_enabled: boolean): void;
|
|
3110
3122
|
updateTransactionShareActions(): Promise<void>;
|
|
3123
|
+
addValidationCallback(_callback: ValidationCallback): void;
|
|
3124
|
+
setStepError(_stepName: string, _field: string, _error: string | undefined): void;
|
|
3125
|
+
getStepErrors(_stepName: string): undefined;
|
|
3126
|
+
getValidationErrors(): {
|
|
3127
|
+
steps: Map<any, any>;
|
|
3128
|
+
};
|
|
3111
3129
|
}
|
|
3112
3130
|
|
|
3113
3131
|
declare const generateCommands: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<CanvasCommand[]>;
|
|
@@ -3328,7 +3346,7 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
|
|
|
3328
3346
|
* @returns A promise that resolves with the newly generated Asset.
|
|
3329
3347
|
*/
|
|
3330
3348
|
removeBackgroundFromImageSelection(applyNewAsset?: boolean): Promise<Asset>;
|
|
3331
|
-
changeColors(newFills: Map<string, ColorDefinition>):
|
|
3349
|
+
changeColors(newFills: Map<string, ColorDefinition>): void;
|
|
3332
3350
|
getImageData(): PatternImageData | undefined;
|
|
3333
3351
|
getColorOption(): Promise<_spiffcommerce_papyrus.OptionResource | undefined>;
|
|
3334
3352
|
getAvailableColors(): Promise<ColorOption[]>;
|
|
@@ -3336,6 +3354,8 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
|
|
|
3336
3354
|
getOriginalImageColors(): Promise<{
|
|
3337
3355
|
[key: string]: ColorDefinition;
|
|
3338
3356
|
} | undefined>;
|
|
3357
|
+
getMaxAllowedColors(): number | undefined;
|
|
3358
|
+
getUniqueColorCount(): number;
|
|
3339
3359
|
getCurrentFrameStep(frameData: FrameData$1, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
|
|
3340
3360
|
getFrameService(): FrameService | undefined;
|
|
3341
3361
|
hasOverlayImageKey(): string | undefined;
|