@spiffcommerce/core 15.1.4 → 16.0.0-beta.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.
@@ -1,14 +1,37 @@
1
- import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, Asset as _Asset1, Region, VariantResource as _VariantResource1, FrameOffsets, PatternImageData, DigitalContentStepData as _DigitalContentStepData1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, FrameStepData as _FrameStepData1, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, FrameElement as _FrameElement1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, IllustrationElement as _IllustrationElement1, LayoutData as _LayoutData1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PictureStepData as _PictureStepData1, QuestionStepData as _QuestionStepData1, ShapeStepData as _ShapeStepData1, FontData, GroupCommand as _GroupCommand1, OptionResource as _OptionResource1, TextboxElement as _TextboxElement1, TextFillImage, TextStepData as _TextStepData1, SilentStepData, Placeable, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, GlobalPropertyConfiguration, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, InformationStepData as _InformationStepData1, FrameData as _FrameData1, AspectType, GlobalPropertyConfigurationAspect, Theme as _Theme1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, BulkStepData, CanvasCommand, ColorDefinition, CommandContext, CommandState, CreateElementCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM, getAxisAlignedBoundingBox, Theme, InformationStepData } from "@spiffcommerce/papyrus";
2
- import { DefaultContext, OperationVariables } from "@apollo/client/core/types";
3
- import { MutationFunctionOptions } from "@apollo/client/react/types/types";
4
- import { ApolloCache, FetchResult } from "@apollo/client/core";
5
- import { ApolloClient } from "@apollo/client";
6
- import React, { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
7
- export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
1
+ import * as _spiffcommerce_papyrus from '@spiffcommerce/papyrus';
2
+ import { OptionResource, VariantResource, Step, AnyStepData, FrameOffsets, PatternImageData, Region, SilentStepData, Placeable, StepStorage, CanvasCommand, CommandContext, ILayout, LayoutState, SerializableStep, Workflow, CommandState, GlobalPropertyConfiguration, LayoutsState, Asset, MaterialResource, AssetType, StepType, GlobalPropertyConfigurationAspect, AspectType, Theme, StepAspect, FrameStepData, CreateElementCommand, FrameElement, IllustrationStepData, IllustrationElement, ColorDefinition, LayoutData, MaterialStepData, ModelStepData, TextStepData, TextboxElement, TextFillImage, FontData, GroupCommand, PictureStepData, QuestionStepData, ShapeStepData, ModuleStepData, DigitalContentStepData, FrameData as FrameData$1, BulkStepData, InformationStepData } from '@spiffcommerce/papyrus';
3
+ export { Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, BulkStepData, CanvasCommand, ColorDefinition, ColorProfileProps, CommandContext, CommandState, CreateElementCommand, CreateLayoutCommand, DeleteElementCommand, DigitalContentStepData, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameStepData, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, ImageElement, InformationStepData, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, MoveCommand, OptionResource, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, Theme, UnitOfMeasurement, VariantResource, Workflow, WorkflowPanel, dataUrlFromExternalUrl, determineCorrectFontSizeAndLines, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout } from '@spiffcommerce/papyrus';
4
+ import { ApolloClient, FetchResult } from '@apollo/client/core';
5
+ import * as lodash from 'lodash';
6
+
7
+ declare class OptionService {
8
+ /**
9
+ * Allows for retrieving an option, returns the option from a cache if possible.
10
+ * @param id The option ID to be retrieved.
11
+ */
12
+ getOption(id: string): Promise<undefined | OptionResource>;
13
+ getAssetTileImageForVariant(variant: VariantResource): Promise<string>;
14
+ getDefaultVariant(option: OptionResource): VariantResource | undefined;
15
+ getDisplayImageSource: (variant?: VariantResource) => undefined | string;
16
+ /**
17
+ * Returns the first variant marked as selected. This is used by most steps.
18
+ */
19
+ getSelectedVariant: (option: OptionResource | undefined, selectedVariantIds: string[]) => VariantResource | undefined;
20
+ }
21
+ declare const optionService: OptionService;
22
+
23
+ declare class GraphQlManager {
24
+ private shadowGraphqlClient;
25
+ constructor();
26
+ getShadowGraphqlClient(): ApolloClient<any>;
27
+ private constructShadowGraphqlClient;
28
+ }
29
+ declare const graphQlManager: GraphQlManager;
30
+
8
31
  /**
9
32
  * A renderable scene is a scene that can be displayed to the user. This is based on the workflow state.
10
33
  */
11
- export interface RenderableScene {
34
+ interface RenderableScene {
12
35
  /**
13
36
  * The id of the scene.
14
37
  */
@@ -26,7 +49,7 @@ export interface RenderableScene {
26
49
  * Information parsed froma workflow structure that is relevant
27
50
  * to a given scene.
28
51
  */
29
- export interface WorkflowScene {
52
+ interface WorkflowScene {
30
53
  /**
31
54
  * A unique identifier for the scene.
32
55
  */
@@ -39,18 +62,19 @@ export interface WorkflowScene {
39
62
  * Steps which can display to the user.
40
63
  * But may be conditionally hidden based on workflow logic
41
64
  */
42
- renderableSteps: _Step1<_AnyStepData1>[];
65
+ renderableSteps: Step<AnyStepData>[];
43
66
  /**
44
67
  * Steps which don't display to the user.
45
68
  * Their behavior is always silent & executed in the background.
46
69
  */
47
- silentSteps: _Step1<_AnyStepData1>[];
70
+ silentSteps: Step<AnyStepData>[];
48
71
  }
72
+
49
73
  /**
50
74
  * A queue promise is a container for a promise that can be
51
75
  * executed at a later time.
52
76
  */
53
- export abstract class QueueablePromise {
77
+ declare abstract class QueueablePromise {
54
78
  readonly timestamp: number;
55
79
  abstract execute(): Promise<any>;
56
80
  }
@@ -59,7 +83,10 @@ export abstract class QueueablePromise {
59
83
  * as quickly as possible in order. This is ideal in situations where a specific operation should be
60
84
  * applied in an ordered way while still making.
61
85
  */
62
- export class PromiseQueue<T extends QueueablePromise> {
86
+ declare class PromiseQueue<T extends QueueablePromise> {
87
+ private queue;
88
+ private activePromise?;
89
+ private queueMaxSize;
63
90
  /**
64
91
  * Constructs a new promise queue.
65
92
  * @param queueMaxSize An optional maximum size, when the max size is hit.
@@ -84,80 +111,13 @@ export class PromiseQueue<T extends QueueablePromise> {
84
111
  * in the promise being extended.
85
112
  */
86
113
  finalize(): Promise<void>;
114
+ /**
115
+ * Once called will recursively resolve the jobs in the
116
+ * queue until no more are available.
117
+ */
118
+ private dequeue;
87
119
  }
88
- /**
89
- * A generic base class for custom errors that assigns the name
90
- * of the error class automatically. All custom errors should extend this.
91
- */
92
- declare abstract class CustomError extends Error {
93
- constructor(message: any);
94
- }
95
- /**
96
- * A custom class for categorising errors related to workflow configuration.
97
- */
98
- declare abstract class ConfigurationError extends CustomError {
99
- constructor(message: any);
100
- }
101
- /**
102
- * Thrown when an option was expected but not found in the workflow configuration or
103
- * the server returned a 404 for an option we expected.
104
- */
105
- export class OptionNotFoundError extends ConfigurationError {
106
- readonly optionId: string;
107
- constructor(step: _Step1<_AnyStepData1>);
108
- }
109
- /**
110
- * Thrown when a layout is not found for a given region entity. This
111
- * can occur when panels are deleted from a workflow but steps are still relying
112
- * on the layout being present.
113
- */
114
- export class LayoutNotFoundError extends ConfigurationError {
115
- readonly panelId: string;
116
- constructor(region: Region);
117
- }
118
- /**
119
- * Thrown when an asset is not found on a specific variant. This can occur when
120
- * the asset wasn't configured in hub and the variant is loaded in a workflow.
121
- */
122
- export class AssetNotFoundError extends ConfigurationError {
123
- readonly variant: _VariantResource1;
124
- constructor(variant: _VariantResource1);
125
- }
126
- /**
127
- * Thrown when a resource is not found linked to a specific asset. This
128
- * can occur when generation of a resource fails or hasn't completed. Or may be
129
- * a sign of a misconfiguration.
130
- */
131
- export class ResourceNotFoundError extends ConfigurationError {
132
- readonly asset: _Asset1;
133
- constructor(asset: _Asset1);
134
- }
135
- /**
136
- * Thrown when configuration is missing when it was expected. More generic
137
- * to cover remaining cases outside of the more specific ones such as options, variants & assets.
138
- */
139
- export class MisconfigurationError extends ConfigurationError {
140
- readonly step: _Step1<_AnyStepData1>;
141
- constructor(step: _Step1<_AnyStepData1>, message: string);
142
- }
143
- /**
144
- * A custom class for categorising errors related to implementation of core.
145
- */
146
- declare abstract class ImplementationError extends CustomError {
147
- constructor(message: any);
148
- }
149
- /**
150
- * Thrown when we hit a case that we didn't expect to happen
151
- */
152
- export class UnhandledBehaviorError extends ImplementationError {
153
- constructor(message: string);
154
- }
155
- /**
156
- * Thrown when we fail to parse something that we expected to be valid
157
- */
158
- export class ParseError extends ImplementationError {
159
- constructor(message: string);
160
- }
120
+
161
121
  /**
162
122
  * Bounds the offsets for an image to the box, preventing
163
123
  * the user from moving the image in a way that wouldn't be intended.
@@ -166,8 +126,14 @@ export class ParseError extends ImplementationError {
166
126
  * @param borderWidth The width of the border added by the cropper.
167
127
  * @param mustCover When true the image sgould be bounded in such a way that it covers the entire frame at all times.
168
128
  */
169
- export function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
170
- export class FrameService {
129
+ declare function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
130
+ declare class FrameService {
131
+ private offsets;
132
+ private forceImageCover?;
133
+ private targetElements;
134
+ private imageData?;
135
+ private frameData?;
136
+ private readonly _debouncedUpdateFrameOffsets;
171
137
  /**
172
138
  * The calculated minimum zoom value, per frame.
173
139
  */
@@ -176,6 +142,10 @@ export class FrameService {
176
142
  * The calculated maximum zoom value. Note: This is calculated based on the first frame.
177
143
  */
178
144
  maxZoomScale: number[];
145
+ private onFrameDataChangeListeners;
146
+ private onZoomChangeListeners;
147
+ private workflowManager?;
148
+ private stepName?;
179
149
  constructor(forceImageCover?: boolean);
180
150
  /**
181
151
  * When we want to connect a workflow manager to the state of the image cropper we
@@ -240,8 +210,33 @@ export class FrameService {
240
210
  * @param newListener
241
211
  */
242
212
  onZoom(newListener: (zoomValue: number[]) => void): void;
213
+ /**
214
+ * Updates the offsets of the frame
215
+ * @param newOffsets New offset object
216
+ * @param imageData The image data
217
+ * @param frameData The frame data
218
+ * @param targetElements A list of elements that need updating, by ID
219
+ * @param onComplete A callback when the operation is completed.
220
+ */
221
+ private updateFrameOffsets;
222
+ /**
223
+ * Determines limitations of zoom based on relative size of image and frame.
224
+ * @param imageData The image to include in calculations
225
+ * @param frameData The frame to include in calculations.
226
+ */
227
+ private recalculateZoomLimits;
228
+ private recalculateOffsets;
243
229
  }
230
+
244
231
  declare class Poller {
232
+ private pollingId;
233
+ private attempts;
234
+ private readonly interval;
235
+ private readonly maxAttempts;
236
+ private readonly predicate;
237
+ private readonly onSuccess;
238
+ private readonly onFailure;
239
+ private poll;
245
240
  /**
246
241
  * Constructs a new polling service.
247
242
  * @param predicate An async function that returns true when polling has returned a successful result.
@@ -252,154 +247,7 @@ declare class Poller {
252
247
  */
253
248
  constructor(predicate: () => Promise<boolean>, onSuccess: () => void, onFailure: () => void, interval?: number, maxAttempts?: number);
254
249
  }
255
- declare class Configuration {
256
- constructor();
257
- getServerUrl(): string;
258
- getServicesApiUrl(): string;
259
- getHubUrl(): string;
260
- setServerUrl(serverUrl: string): void;
261
- setServicesApiUrl(servicesApiUrl: string): void;
262
- setHubUrl(hubUrl: string): void;
263
- addServerUrlCallback(callback: () => void): void;
264
- }
265
- export const spiffCoreConfiguration: Configuration;
266
- export const shortenUrl: (longUrl: string) => Promise<string>;
267
- declare class DigitalContentStepService implements StepService<_DigitalContentStepData1> {
268
- init(stepData: _Step1<_DigitalContentStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
269
- regenerateQRCode(elements: RegionElement[], uploading: boolean, assetKey: string, url: string, workflowManager: WorkflowManager, stepData: _Step1<_DigitalContentStepData1>, setUrl: (finalUrl: string) => void, commandDispatcher: (command: _CanvasCommand1) => void, setIsRegenerating: (state: boolean) => void): Promise<void>;
270
- }
271
- export const digitalContentStepService: DigitalContentStepService;
272
- interface FrameCreateOpts {
273
- stepName?: string;
274
- frameData: FrameData;
275
- disablePlaceholder?: boolean;
276
- focalBlur?: boolean;
277
- focalBlurStrength?: number;
278
- focalBlurRadius?: number;
279
- pattern?: any;
280
- }
281
- declare class FrameStepService implements StepService<_FrameStepData1> {
282
- init(stepData: _Step1<_FrameStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
283
- selectImage(stepData: _Step1<_FrameStepData1>, asset: _Asset1, workflowManager: WorkflowManager): void;
284
- selectVariant(stepData: _Step1<_FrameStepData1>, variant: _VariantResource1 | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
285
- getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: FrameCreateOpts): _CreateElementCommand1<_FrameElement1>;
286
- loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
287
- }
288
- export const frameStepService: FrameStepService;
289
- interface SVGCreateOpts {
290
- stepName?: string;
291
- src: string;
292
- objectURL: string;
293
- svg: {
294
- svg: string;
295
- colors: {
296
- [key: string]: _ColorDefinition1;
297
- };
298
- };
299
- }
300
- declare class IllustrationStepService implements StepService<_IllustrationStepData1> {
301
- getIllustrationBody(src: string): Promise<string>;
302
- getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: SVGCreateOpts): _CreateElementCommand1<_IllustrationElement1>;
303
- getColors(stepData: _Step1<_IllustrationStepData1>, workflowManager: WorkflowManager): {
304
- [key: string]: _ColorDefinition1;
305
- } | never[];
306
- init(stepData: _Step1<_IllustrationStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
307
- availableColors(stepData: _Step1<_IllustrationStepData1>, workflowManager: WorkflowManager): Promise<{
308
- fill: string | undefined;
309
- stroke: string | undefined;
310
- variant: _VariantResource1;
311
- }[] | undefined>;
312
- changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string>): Promise<_CanvasCommand1>;
313
- changeColors(stepData: _Step1<_IllustrationStepData1>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => _LayoutData1[], newFills: Map<string, string>): Promise<void>;
314
- selectVariant(stepData: _Step1<_IllustrationStepData1>, variant: _VariantResource1, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
315
- }
316
- export const illustrationStepService: IllustrationStepService;
317
- declare class MaterialStepService implements StepService<_MaterialStepData1> {
318
- init(stepData: _Step1<_MaterialStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<null | CommandWithFollowup>;
319
- selectVariant(step: _Step1<_MaterialStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
320
- }
321
- export const materialStepService: MaterialStepService;
322
- declare class ModelStepService implements StepService<_ModelStepData1> {
323
- init(stepData: _Step1<_ModelStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
324
- selectVariant(step: _Step1<_ModelStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
325
- }
326
- export const modelStepService: ModelStepService;
327
- declare class ModuleStepService implements StepService<_ModuleStepData1> {
328
- init(stepData: _Step1<_ModuleStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
329
- changeText(stepData: _Step1<_ModuleStepData1>, input: string, workflowManager: WorkflowManager, error: string, setError: (e: string) => void): Promise<void>;
330
- }
331
- export const moduleStepService: ModuleStepService;
332
- declare class PictureStepService implements StepService<_PictureStepData1> {
333
- init(stepData: _Step1<_PictureStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
334
- selectVariant(stepData: _Step1<_PictureStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setIsUpdating: (status: boolean) => void): Promise<void>;
335
- }
336
- export const pictureStepService: PictureStepService;
337
- declare class QuestionStepService implements StepService<_QuestionStepData1> {
338
- init(stepData: _Step1<_QuestionStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
339
- selectVariant(stepData: _Step1<_QuestionStepData1>, variantId: string, workflowManager: WorkflowManager): Promise<void>;
340
- }
341
- export const questionStepService: QuestionStepService;
342
- declare class ShapeStepService implements StepService<_ShapeStepData1> {
343
- readonly shapeFillId = "spiff-fill-shape";
344
- availableColours(stepData: _Step1<_ShapeStepData1>): Promise<{
345
- fill: string | undefined;
346
- stroke: string | undefined;
347
- variant: _VariantResource1;
348
- }[]>;
349
- setCustomColor(color: string, stepData: _Step1<_ShapeStepData1>, manager: WorkflowManager): void;
350
- init(stepData: _Step1<_ShapeStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
351
- selectVariant(stepData: _Step1<_ShapeStepData1>, colourOption: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
352
- }
353
- export const shapeStepService: ShapeStepService;
354
- type ToastCallback = (callbackOptions: {
355
- toastMessage: null | string;
356
- toastType: InformationMessageType | null;
357
- }) => void;
358
- declare class Toast {
359
- constructor();
360
- addToastCallback(callback: ToastCallback): void;
361
- setLatestToast(errorMessage: null | string, errorType: InformationMessageType | null): void;
362
- }
363
- export const toast: Toast;
364
- interface TextFillSpotColor {
365
- profileName: string;
366
- namedColor: string;
367
- }
368
- interface TextUpdateResult {
369
- command?: _GroupCommand1;
370
- helperText: string;
371
- errors: TextError[];
372
- }
373
- interface TextError {
374
- localizationKey: string;
375
- }
376
- declare class TextStepService implements StepService<_TextStepData1> {
377
- init(stepData: _Step1<_TextStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
378
- findLayoutElements(workflowManager: WorkflowManager, step: _Step1<_TextStepData1>): _TextboxElement1[];
379
- /**
380
- * Get the colors that can be used for a given text step.
381
- * @param stepData The text step to get colors for.
382
- * @returns A list of color objects containg fill, stroke and variant if available.
383
- */
384
- availableFillColors(stepData: _Step1<_TextStepData1>): ColorOption[];
385
- changeFillColor(stepData: _Step1<_TextStepData1>, newColor: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
386
- availableFillImages(stepData: _Step1<_TextStepData1>): Promise<TextFillImage[]>;
387
- changeFillImage(stepData: _Step1<_TextStepData1>, fillImage: TextFillImage, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
388
- /**
389
- * Given an element and a string, filters any characters from the string that are
390
- * not supported by the font of the given element.
391
- * @param text The text string to filter.
392
- * @param fontData An optional fontData object, when provided, we use the font table to determine glyphs that aren't provided and additionally strip these out also.
393
- * @returns A new string representing the passed string with unsupported characters removed.
394
- */
395
- filterUnsupportedCharacters: (text: string, fontData?: FontData) => string;
396
- getProcessedInput(input: string, stepData: _TextStepData1, customiseAllText: boolean): string;
397
- updateInputText(input: string, elements: _TextboxElement1[], step: _Step1<_TextStepData1>, workflowManager: WorkflowManager): TextUpdateResult;
398
- selectVariant(step: _Step1<_TextStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setError: (status: boolean) => void, setHelperText: (text: string) => void): Promise<void>;
399
- textAlign: (stepData: _TextStepData1) => string;
400
- createTextFillSpotColor(colorOption: _OptionResource1, variant: _VariantResource1): TextFillSpotColor | undefined;
401
- }
402
- export const textStepService: TextStepService;
250
+
403
251
  declare abstract class ModuleProduct {
404
252
  /**
405
253
  * Name used by class. Usually product or brand name.
@@ -414,38 +262,39 @@ declare abstract class ModuleProduct {
414
262
  */
415
263
  abstract svgPrint(text: string, region: Region): string;
416
264
  }
417
- export interface SilentIllustrationStepData extends SilentStepData, Placeable {
265
+
266
+ interface SilentIllustrationStepData extends SilentStepData, Placeable {
418
267
  }
419
- export interface EditedSteps {
268
+ interface EditedSteps {
420
269
  [stepName: string]: boolean;
421
270
  }
422
- export interface MandatorySteps {
271
+ interface MandatorySteps {
423
272
  [stepName: string]: boolean;
424
273
  }
425
- export type StepElements = {
274
+ type StepElements = {
426
275
  [key: string]: RegionElement[];
427
276
  };
428
277
  type StepInitialised = {
429
278
  [key: string]: boolean;
430
279
  };
431
280
  type StepMetadata = FrameMetadata | IllustrationMetadata | ModuleMetadata | TextMetadata;
432
- export interface WorkflowStorage {
433
- [stepName: string]: _StepStorage1;
281
+ interface WorkflowStorage {
282
+ [stepName: string]: StepStorage;
434
283
  }
435
- export interface WorkflowMetadata {
284
+ interface WorkflowMetadata {
436
285
  [stepName: string]: StepMetadata;
437
286
  }
438
- export interface WorkflowSelections {
287
+ interface WorkflowSelections {
439
288
  [stepName: string]: {
440
- selections: _VariantResource1[];
289
+ selections: VariantResource[];
441
290
  };
442
291
  }
443
- export interface InformationResult {
292
+ interface InformationResult {
444
293
  message: string;
445
294
  messageType: InformationMessageType;
446
295
  stepID: string;
447
296
  }
448
- export enum InformationMessageType {
297
+ declare enum InformationMessageType {
449
298
  Error = "Error",
450
299
  Warning = "Warning",
451
300
  Info = "Info"
@@ -457,7 +306,7 @@ interface StepSpecificServices {
457
306
  frameService?: FrameService;
458
307
  module?: ModuleProduct;
459
308
  }
460
- export type DesignCreationProgressUpdate = (message: string) => void;
309
+ type DesignCreationProgressUpdate = (message: string) => void;
461
310
  type ConfirmCallback = (isConfirmed: boolean) => void;
462
311
  type EditedCallback = (editedSteps: EditedSteps) => void;
463
312
  type ElementsCallback = (elements: StepElements) => void;
@@ -472,12 +321,12 @@ type SelectionCallback = (callbackOptions: {
472
321
  selections: StepSelections;
473
322
  traversableScenes: WorkflowScene[];
474
323
  }) => void;
475
- type StepSpecificStorageCallback = (selections: _StepStorage1) => void;
324
+ type StepSpecificStorageCallback = (selections: StepStorage) => void;
476
325
  type StorageCallback = (storage: WorkflowStorage) => void;
477
326
  type CurrentVariationRecordCallback = (variationRecord: null | VariationRecord) => void;
478
327
  type VariationRecordsCallback = (records: VariationRecord[]) => void;
479
- export type StateMutationFunc = (options?: MutationFunctionOptions<any, OperationVariables, DefaultContext, ApolloCache<any>> | undefined) => Promise<FetchResult<any, Record<string, any>, Record<string, any>>>;
480
- export interface WorkflowManager {
328
+ type StateMutationFunc = (options?: any) => Promise<FetchResult<any, Record<string, any>, Record<string, any>>>;
329
+ interface WorkflowManager {
481
330
  addPoller: (poller: Poller) => void;
482
331
  addConfirmCallback: (callback: ConfirmCallback) => void;
483
332
  addCurrentVariationCallback: (callback: CurrentVariationRecordCallback) => void;
@@ -493,11 +342,11 @@ export interface WorkflowManager {
493
342
  addStorageCallback: (callback: StorageCallback) => void;
494
343
  addVariationRecord: (variationRecord: Omit<VariationRecord, "recordNumber">) => VariationRecord;
495
344
  addVariationRecordsCallback: (callback: VariationRecordsCallback) => void;
496
- getCommandDispatcher: () => (command: _CanvasCommand1) => void;
345
+ getCommandDispatcher: () => (command: CanvasCommand) => void;
497
346
  getCurrentVariationRecord: () => VariationRecord | undefined;
498
347
  getVariationRecords: () => VariationRecord[];
499
- getCommandContext: () => _CommandContext1;
500
- getLayouts: () => _ILayout1[];
348
+ getCommandContext: () => CommandContext;
349
+ getLayouts: () => ILayout[];
501
350
  getAllLayoutData: () => LayoutState[];
502
351
  getLayoutPreviewService: () => any | undefined;
503
352
  getPreviewService: () => any | undefined;
@@ -505,7 +354,7 @@ export interface WorkflowManager {
505
354
  getRegionElements: (stepName: string) => RegionElement[];
506
355
  getSerializedStep: (stepName: string, serializedSteps: SerializableStep[]) => SerializableStep | undefined;
507
356
  getStepSpecificServices: (stepName: string) => StepSpecificServices | undefined;
508
- getStepStorage: (stepName: string) => _StepStorage1 | undefined;
357
+ getStepStorage: (stepName: string) => StepStorage | undefined;
509
358
  getMetadata: (stepName: string) => StepMetadata | undefined;
510
359
  getWorkflowMetadata: () => WorkflowMetadata;
511
360
  getInformationResults(): InformationResult[];
@@ -518,7 +367,7 @@ export interface WorkflowManager {
518
367
  setTransactionCustomerDetails: (details: {
519
368
  email: string;
520
369
  }) => void;
521
- getWorkflow: () => _Workflow1;
370
+ getWorkflow: () => Workflow;
522
371
  getWorkflowSelections: () => WorkflowSelections;
523
372
  getProduct: () => Product;
524
373
  /**
@@ -544,15 +393,15 @@ export interface WorkflowManager {
544
393
  setEditedStatus: (stepName: string, status: boolean) => void;
545
394
  setInformationResults: (results: InformationResult[]) => void;
546
395
  setMandatoryFulfilled: (stepName: string, status: boolean) => void;
547
- setSelectionsAndElements: (stepName: string, variants: _VariantResource1[], elements: RegionElement[], callback?: () => Promise<void>) => Promise<void>;
396
+ setSelectionsAndElements: (stepName: string, variants: VariantResource[], elements: RegionElement[], callback?: () => Promise<void>) => Promise<void>;
548
397
  setVariationRecords: (variationRecords: VariationRecord[]) => void;
549
398
  toggleDesignConfirmed: () => void;
550
399
  updateMetadata: (stepName: string, update: any) => void;
551
400
  /**
552
401
  * @deprecated State updates are being pulled internally. This function will be removed in the future.
553
402
  */
554
- updateStateWithServerImmediate: (getReducerState: () => _CommandState1) => Promise<void>;
555
- updateStorage: (stepName: string, update: _StepStorage1) => void;
403
+ updateStateWithServerImmediate: (getReducerState: () => CommandState) => Promise<void>;
404
+ updateStorage: (stepName: string, update: StepStorage) => void;
556
405
  getModelContainer: () => any | undefined;
557
406
  setModelContainer: (container: any) => void;
558
407
  /**
@@ -566,11 +415,12 @@ export interface WorkflowManager {
566
415
  */
567
416
  ejectFromPreviewService(): void;
568
417
  }
569
- interface StepService<T extends _AnyStepData1> {
418
+
419
+ interface StepService<T extends AnyStepData> {
570
420
  /**
571
421
  * Initialize the given step, or reload from serialized data if present.
572
422
  */
573
- init(stepData: _Step1<T>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<any>;
423
+ init(stepData: Step<T>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<any>;
574
424
  }
575
425
  interface FileInfo {
576
426
  /**
@@ -587,7 +437,7 @@ interface FileInfo {
587
437
  * A command along with a function to run afterwards.
588
438
  */
589
439
  interface CommandWithFollowup {
590
- command?: _CanvasCommand1;
440
+ command?: CanvasCommand;
591
441
  followup?: () => Promise<void>;
592
442
  }
593
443
  /**
@@ -606,7 +456,7 @@ interface ExportedData {
606
456
  priceModifier: number;
607
457
  };
608
458
  }
609
- export interface DesignCreationMessage {
459
+ interface DesignCreationMessage {
610
460
  baseCost?: number;
611
461
  designProductId?: string;
612
462
  designProductVariantId?: string;
@@ -631,7 +481,7 @@ export interface DesignCreationMessage {
631
481
  /**
632
482
  * Represents a transaction.
633
483
  */
634
- export interface Transaction {
484
+ interface Transaction {
635
485
  /**
636
486
  * A unique identifier for this transaction. Useful for reloading and
637
487
  * modifying state of the transaction.
@@ -757,7 +607,7 @@ interface Integration {
757
607
  externalIntegrationId?: string;
758
608
  type?: IntegrationType;
759
609
  }
760
- enum IntegrationType {
610
+ declare enum IntegrationType {
761
611
  Hub = "Hub",
762
612
  Shopify = "Shopify"
763
613
  }
@@ -797,7 +647,7 @@ interface Partner {
797
647
  currencyCode?: string;
798
648
  customerDetailsPromptMarkdown?: string;
799
649
  }
800
- export interface Product {
650
+ interface Product {
801
651
  /**
802
652
  * ID of the partner owner.
803
653
  */
@@ -895,18 +745,18 @@ interface ProductTag {
895
745
  id: string;
896
746
  name: string;
897
747
  }
898
- export interface ColorOption {
748
+ interface ColorOption {
899
749
  id?: string;
900
750
  fill?: string;
901
751
  stroke?: string;
902
- variant?: _VariantResource1;
752
+ variant?: VariantResource;
903
753
  colorProfileAssetKey?: string;
904
754
  }
905
755
  /**
906
756
  * Represents a variation as seen in Google sheets.
907
757
  * Record number = row# - 1
908
758
  */
909
- export interface VariationRecord {
759
+ interface VariationRecord {
910
760
  recordNumber: number;
911
761
  transactionId: string;
912
762
  values: {
@@ -915,7 +765,7 @@ export interface VariationRecord {
915
765
  value: string;
916
766
  }[];
917
767
  }
918
- export interface RegionElement {
768
+ interface RegionElement {
919
769
  id: string;
920
770
  region?: Region;
921
771
  }
@@ -933,10 +783,10 @@ interface TextMetadata {
933
783
  text: string;
934
784
  fillImage?: string;
935
785
  }
936
- export interface SelectionStorage {
937
- selectedVariants?: _VariantResource1[];
786
+ interface SelectionStorage {
787
+ selectedVariants?: VariantResource[];
938
788
  }
939
- export interface TextStepStorage extends SelectionStorage {
789
+ interface TextStepStorage extends SelectionStorage {
940
790
  color?: string;
941
791
  defaultCleared?: boolean;
942
792
  inputText?: string;
@@ -964,7 +814,7 @@ interface FrameData {
964
814
  * Defines the different behaviors supported by the camera system
965
815
  * for control when viewing a product.
966
816
  */
967
- export enum ProductCameraRig {
817
+ declare enum ProductCameraRig {
968
818
  Orbit = 0,
969
819
  Pan = 1
970
820
  }
@@ -972,7 +822,7 @@ export enum ProductCameraRig {
972
822
  * Defines the different strategies to use when calculating the total price
973
823
  * when creating bulk designs.
974
824
  */
975
- export enum BulkPriceCalculationStrategy {
825
+ declare enum BulkPriceCalculationStrategy {
976
826
  /** The total price should increase with the amount of variations. */
977
827
  PerVariation = "PerVariation",
978
828
  /** The total price should remain at the base price of the product. */
@@ -991,7 +841,7 @@ interface BulkConfiguration {
991
841
  /**
992
842
  * Defines the locations at which a conversion attempt can take place.
993
843
  */
994
- export enum ConversionLocation {
844
+ declare enum ConversionLocation {
995
845
  /**
996
846
  * The client should expose a flow for allowing the user to optionally input details at any point.
997
847
  */
@@ -1012,20 +862,20 @@ export enum ConversionLocation {
1012
862
  /**
1013
863
  * The data configured to be requested.
1014
864
  */
1015
- export enum ConversionDataType {
865
+ declare enum ConversionDataType {
1016
866
  Email = "Email",
1017
867
  FirstName = "FirstName",
1018
868
  LastName = "LastName",
1019
869
  Phone = "Phone"
1020
870
  }
1021
- export interface ConversionData {
871
+ interface ConversionData {
1022
872
  type: ConversionDataType;
1023
873
  mandatory: boolean;
1024
874
  }
1025
875
  /**
1026
876
  * The configuration for conversion, exposed on products currently.
1027
877
  */
1028
- export interface ConversionConfiguration {
878
+ interface ConversionConfiguration {
1029
879
  id: string;
1030
880
  name?: string;
1031
881
  locations: ConversionLocation[];
@@ -1036,7 +886,7 @@ export interface ConversionConfiguration {
1036
886
  /**
1037
887
  * Someone who has used a workflow experience and entered their contact details.
1038
888
  */
1039
- export interface Customer {
889
+ interface Customer {
1040
890
  id?: string;
1041
891
  emailAddress: string;
1042
892
  firstName?: string;
@@ -1047,25 +897,25 @@ export interface Customer {
1047
897
  stakeholders?: Stakeholder[];
1048
898
  bundleStakeholders?: BundleStakeholder[];
1049
899
  }
1050
- export interface CustomerDetailsInput {
900
+ interface CustomerDetailsInput {
1051
901
  emailAddress: string;
1052
902
  firstName?: string;
1053
903
  lastName?: string;
1054
904
  phoneNumber?: string;
1055
905
  }
1056
- export enum StakeholderType {
906
+ declare enum StakeholderType {
1057
907
  Owner = "Owner",
1058
908
  Approver = "Approver",
1059
909
  Editor = "Editor",
1060
910
  Viewer = "Viewer"
1061
911
  }
1062
- export interface Stakeholder {
912
+ interface Stakeholder {
1063
913
  id: string;
1064
914
  type?: StakeholderType;
1065
915
  transaction?: Transaction;
1066
916
  customer?: Customer;
1067
917
  }
1068
- interface _Bundle1 {
918
+ interface Bundle$1 {
1069
919
  id?: string;
1070
920
  bundleOwnerId?: string;
1071
921
  bundleStakeholders?: BundleStakeholder[];
@@ -1081,7 +931,7 @@ interface _Bundle1 {
1081
931
  }
1082
932
  interface BundleStakeholder {
1083
933
  id: string;
1084
- bundle?: _Bundle1;
934
+ bundle?: Bundle$1;
1085
935
  customer?: Customer;
1086
936
  type?: StakeholderType;
1087
937
  }
@@ -1126,41 +976,7 @@ interface TransformCollectionTransform {
1126
976
  rotation: Vector3;
1127
977
  scale: Vector3;
1128
978
  }
1129
- interface StorageService {
1130
- /**
1131
- * Get a value.
1132
- * @param key The key to lookup the value with.
1133
- */
1134
- get(key: string): string | undefined;
1135
- /**
1136
- * Set a value.
1137
- * @param key The key to set.
1138
- * @param val The new value.
1139
- */
1140
- set(key: string, val: string): void;
1141
- /**
1142
- * Remove a value.
1143
- * @param key The key to remove, does nothing if the key doesn't exist.
1144
- */
1145
- remove(key: string): void;
1146
- /**
1147
- * Get a map from persistence.
1148
- * @param key The key to search by.
1149
- */
1150
- getMap<K = any, V = any>(key: string): Map<K, V> | undefined;
1151
- /**
1152
- * St a map into persistence.
1153
- * @param key The key to set the map at.
1154
- * @param val The map to set.
1155
- */
1156
- setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
1157
- }
1158
- export const persistenceService: StorageService;
1159
- declare class GraphQlManager {
1160
- constructor();
1161
- getShadowGraphqlClient(): ApolloClient<any>;
1162
- }
1163
- export const graphQlManager: GraphQlManager;
979
+
1164
980
  /**
1165
981
  * An asset manager provides a way to create and
1166
982
  * manage assets on the Spiff Commerce Platform.
@@ -1169,17 +985,19 @@ interface AssetManager {
1169
985
  /**
1170
986
  * Uploads a file to the Spiff Commerce Platform.
1171
987
  */
1172
- uploadFile: (file: File, onProgress: (val: number) => void) => Promise<_Asset1>;
988
+ uploadFile: (file: File, onProgress: (val: number) => void) => Promise<Asset>;
1173
989
  }
1174
990
  declare class AssetService implements AssetManager {
991
+ private cache;
992
+ private materialCache;
1175
993
  /**
1176
994
  * Allows for retrieving an asset, returns the option from a cache if possible.
1177
995
  */
1178
- getLocalOrFromServer(assetKey: string): Promise<_Asset1>;
996
+ getLocalOrFromServer(assetKey: string): Promise<Asset>;
1179
997
  /**
1180
998
  * Caches an asset if it doesn't already exist.
1181
999
  */
1182
- cacheAsset(asset: _Asset1): void;
1000
+ cacheAsset(asset: Asset): void;
1183
1001
  /**
1184
1002
  * Caches a material if it doesn't already exist.
1185
1003
  */
@@ -1193,329 +1011,128 @@ declare class AssetService implements AssetManager {
1193
1011
  * Upload a user asset to the server. Using callbacks to notify important events.
1194
1012
  * The asset will be stored via the persistence service for future access, if available.
1195
1013
  */
1196
- uploadAssetWithProgress(file: FileInfo, assetType: _AssetType1, onProgress: (val: number) => void, anonymous?: boolean, temporary?: boolean): Promise<_Asset1>;
1197
- uploadFile(file: File, onProgress: (val: number) => void): Promise<_Asset1>;
1014
+ uploadAssetWithProgress(file: FileInfo, assetType: AssetType, onProgress: (val: number) => void, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
1015
+ uploadFile(file: File, onProgress: (val: number) => void): Promise<Asset>;
1198
1016
  removePersistedAsset(assetKey: string): void;
1199
1017
  getPersistedAssets(): PersistedAsset[];
1200
1018
  /**
1201
1019
  * Convert a File object for an image into a FileInfo.
1202
1020
  */
1203
1021
  loadImageAsFileInfo: (file: File) => Promise<FileInfo>;
1022
+ /**
1023
+ * Handles mimeType resolution & asset creation request
1024
+ * @param file A file info object containing data about the file and its name
1025
+ * @param assetType The type of asset we're expecting to upload
1026
+ */
1027
+ private dispatchCreateAssetRequest;
1028
+ private guessMIME;
1204
1029
  }
1205
1030
  interface PersistedAsset {
1206
1031
  assetKey: string;
1207
1032
  src: string;
1208
1033
  }
1209
- export const assetService: AssetService;
1210
- declare class OptionService {
1034
+ declare const assetService: AssetService;
1035
+
1036
+ interface StorageService {
1211
1037
  /**
1212
- * Allows for retrieving an option, returns the option from a cache if possible.
1213
- * @param id The option ID to be retrieved.
1038
+ * Get a value.
1039
+ * @param key The key to lookup the value with.
1214
1040
  */
1215
- getOption(id: string): Promise<undefined | _OptionResource1>;
1216
- getAssetTileImageForVariant(variant: _VariantResource1): Promise<string>;
1217
- getDefaultVariant(option: _OptionResource1): _VariantResource1 | undefined;
1218
- getDisplayImageSource: (variant?: _VariantResource1) => undefined | string;
1041
+ get(key: string): string | undefined;
1219
1042
  /**
1220
- * Returns the first variant marked as selected. This is used by most steps.
1043
+ * Set a value.
1044
+ * @param key The key to set.
1045
+ * @param val The new value.
1221
1046
  */
1222
- getSelectedVariant: (option: _OptionResource1 | undefined, selectedVariantIds: string[]) => _VariantResource1 | undefined;
1223
- }
1224
- export const optionService: OptionService;
1225
- export const CommandContextContext: import("react").Context<_CommandContext1>;
1226
- export const useLayouts: () => {
1227
- commandDispatcher: (command: _CanvasCommand1, leaveOffUndoStack: boolean) => void;
1228
- getLayoutById: (id: string) => _LayoutData1;
1229
- getAllLayouts: () => _LayoutData1[];
1230
- getReducerState: () => _CommandState1;
1231
- lastUpdated: Date;
1232
- flattenSequence: (sequenceId: string, initialState: _LayoutsState1) => void;
1233
- };
1234
- export type CommandDispatcher = (command: _CanvasCommand1, leaveOffUndoStack: boolean) => void;
1235
- export type LayoutGetter = (layoutId: string) => _LayoutData1;
1236
- export type LayoutsGetter = () => _LayoutData1[];
1237
- /**
1238
- * Details about a guideline that can be drawn on the canvas.
1239
- */
1240
- interface SnapPoint {
1241
- type: "x" | "y" | "rotation";
1242
- value: number;
1243
- svgNode?: ReactNode;
1244
- anchorPoint: number;
1245
- guidelineCoordinates?: Point[];
1246
- }
1247
- export enum ElementEventType {
1248
- Translate = "Translate",
1249
- Rotate = "Rotate",
1250
- Resize = "Resize"
1251
- }
1252
- export enum KeyEvent {
1253
- ControlLeft = "ControlLeft",
1254
- ControlRight = "ControlRight",
1255
- Equal = "Equal",
1256
- MetaLeft = "MetaLeft",
1257
- MetaRight = "MetaRight",
1258
- Minus = "Minus",
1259
- ArrowLeft = "ArrowLeft",
1260
- ArrowRight = "ArrowRight",
1261
- ArrowUp = "ArrowUp",
1262
- ArrowDown = "ArrowDown",
1263
- AltLeft = "AltLeft",
1264
- AltRight = "AltRight",
1265
- Delete = "Delete",
1266
- Backspace = "Backspace"
1267
- }
1268
- type ElementEvent = {
1269
- type: ElementEventType.Translate;
1270
- } | {
1271
- type: ElementEventType.Rotate;
1272
- } | {
1273
- type: ElementEventType.Resize;
1274
- relativeAxis: ScaleAxis;
1275
- screenAxis: ScaleAxis;
1276
- };
1277
- export enum EditorSubMenu {
1278
- None = "None",
1279
- FrameAdjustment = "FrameAdjustment",
1280
- Variations = "Variations",
1281
- FinalizeDesign = "FinalizeDesign",
1282
- SavedDesigns = "SavedDesigns",
1283
- ThreeDPreview = "ThreeDPreview",
1284
- Panels = "Panels"
1285
- }
1286
- interface UIState {
1047
+ set(key: string, val: string): void;
1048
+ /**
1049
+ * Remove a value.
1050
+ * @param key The key to remove, does nothing if the key doesn't exist.
1051
+ */
1052
+ remove(key: string): void;
1053
+ /**
1054
+ * Get a map from persistence.
1055
+ * @param key The key to search by.
1056
+ */
1057
+ getMap<K = any, V = any>(key: string): Map<K, V> | undefined;
1058
+ /**
1059
+ * St a map into persistence.
1060
+ * @param key The key to set the map at.
1061
+ * @param val The map to set.
1062
+ */
1063
+ setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
1287
1064
  }
1065
+ declare const persistenceService: StorageService;
1066
+
1288
1067
  /**
1289
- * This context stores global state for
1068
+ * A wrapping component that provides a simple interface for interacting with a variant.
1290
1069
  */
1291
- export interface AdvancedEditorState extends UIState {
1070
+ declare class Variant {
1071
+ private readonly variantData;
1072
+ constructor(variant: VariantResource);
1073
+ getType(): AssetType | undefined;
1292
1074
  /**
1293
- * The layout currently being displayed in the editor.
1075
+ * @returns The unique identifier for the variant.
1294
1076
  */
1295
- layoutId: string;
1077
+ getId(): string;
1296
1078
  /**
1297
- * Returns the id of the currently selected element. Or undefined if no element is selected.
1079
+ * @returns The configured name of the variant. Generally a human readable value.
1298
1080
  */
1299
- selectedElement?: string;
1081
+ getName(): string;
1300
1082
  /**
1301
- * The current zoom level of the editor.
1083
+ * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
1302
1084
  */
1303
- zoom: number;
1085
+ getPriceFormatted(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions | undefined): string;
1304
1086
  /**
1305
- * The current x translation of the transform for the canvas.
1087
+ * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
1088
+ * Presented in subunits of the currency of the option. For example, if the option is configured to use USD, the price modifier will be in cents.
1306
1089
  */
1307
- xTranslation: number;
1090
+ getPrice(): number;
1308
1091
  /**
1309
- * The current y translation of the transform for the canvas.
1092
+ * @returns The URL for the base asset resource configured on this variant
1310
1093
  */
1311
- yTranslation: number;
1094
+ getAsset(): string | undefined;
1312
1095
  /**
1313
- * The maxiumum zoom possible based on current canvas content.
1096
+ * @returns The URL for the base asset resource configured on this variant
1314
1097
  */
1315
- maxZoom: number;
1098
+ getAssetResource(): Asset | undefined;
1316
1099
  /**
1317
- * The current measurement system used for display of coordinates and dimensions.
1100
+ * @returns The URL for a thumbnail resource configured on this variant. When no thumbnail is configured explicitly we fall back to the base asset and see if a thumbnail is genererated for that.
1318
1101
  */
1319
- units: _UnitOfMeasurement1;
1102
+ getThumbnail(): string | undefined;
1320
1103
  /**
1321
- * The sub menu to be displayed to the user in place of the canvas.
1104
+ * @returns The URL for the display image configured on this variant. Can be used for things like size charts.
1105
+ * @deprecated To be removed in a future version
1322
1106
  */
1323
- subMenu: EditorSubMenu;
1107
+ getDisplayImage(): string | undefined;
1324
1108
  /**
1325
- * Any modifier keys that are currently pressed
1109
+ * @returns When this variant is configured to have a color, this will return the hex value for that color.
1326
1110
  */
1327
- activeModifierKeys: KeyEvent[];
1111
+ getColor(): string | undefined;
1328
1112
  /**
1329
- * WHether or not a meta key is pressed.
1113
+ * @returns True when the variant is the default for its containing option. False otherwise.
1330
1114
  */
1331
- metaPressed: boolean;
1115
+ isDefault(): boolean;
1332
1116
  /**
1333
- * Any active element event.
1117
+ * @returns The underlying variant resource. Generally not needed but made available just incase.
1334
1118
  */
1335
- elementEvent?: ElementEvent;
1119
+ getResource(): VariantResource;
1336
1120
  /**
1337
- * If movement should assume that it's operating in a scrolled environment.
1338
- * FIXME: Can we get rid of this somehow.
1339
- */
1340
- scrolledMovement: boolean;
1341
- }
1342
- export const getDefaultState: (getLayouts: LayoutsGetter, defaultZoom: number) => AdvancedEditorState;
1343
- export const commandReducer: (state: AdvancedEditorState, command: UICommand) => AdvancedEditorState;
1344
- export const AdvancedEditorContext: import("react").Context<{
1345
- uiDispatcher: Dispatch<UICommand>;
1346
- state: AdvancedEditorState;
1347
- }>;
1348
- export const AdvancedEditorStateProvider: FunctionComponent<{
1349
- defaultZoom?: number;
1350
- children: ReactNode;
1351
- }>;
1352
- export class UICommand {
1353
- constructor(changes: Partial<AdvancedEditorState>);
1354
- apply(state: AdvancedEditorState): {
1355
- layoutId: string;
1356
- selectedElement?: string | undefined;
1357
- zoom: number;
1358
- xTranslation: number;
1359
- yTranslation: number;
1360
- maxZoom: number;
1361
- units: _UnitOfMeasurement1;
1362
- subMenu: EditorSubMenu;
1363
- activeModifierKeys: KeyEvent[];
1364
- metaPressed: boolean;
1365
- elementEvent?: ElementEvent | undefined;
1366
- scrolledMovement: boolean;
1367
- };
1368
- }
1369
- export const useEditorState: () => {
1370
- uiDispatcher: Dispatch<UICommand>;
1371
- state: AdvancedEditorState;
1372
- };
1373
- /**
1374
- * The minimum zoom that can be applied to a canvas.
1375
- */
1376
- export const minZoom = 0.5;
1377
- export const useEditorInteraction: (editorRef: RefObject<SVGRectElement>, interactionRef: RefObject<HTMLDivElement>, zoomableElementRef: RefObject<HTMLDivElement>, defaultAdjustmentZoom: number | undefined, mode: "adjustment" | "advanced", canvasDispatcher: CommandDispatcher, breakpoint: string, guidelinePrimaryColor?: string, onSequenceComplete?: () => void) => {
1378
- guidelines: SnapPoint[];
1379
- scale: number;
1380
- zoomableElementRef: RefObject<HTMLDivElement>;
1381
- setElementEvent: (newEvent: ElementEvent | undefined) => void;
1382
- handleZoom: (_event: any, value: any) => void;
1383
- handleKeyDown: (event: KeyboardEvent, adjustmentBoundary?: Region) => void;
1384
- handleKeyUp: (event: KeyboardEvent) => void;
1385
- handlePointerPressedBackground: (event: PointerEvent) => void;
1386
- handlePointerReleased: () => void;
1387
- handlePointerMove: (event: PointerEvent, adjustmentBoundary?: Region) => void;
1388
- handleScroll: () => void;
1389
- handleSequenceStart: () => void;
1390
- };
1391
- export const useShortcutCombination: (shortcutKeys: string[], onCombinationPressed: () => void, onCombinationReleased?: () => void) => void;
1392
- export interface DesignInputStep {
1393
- data: DesignInputStepData;
1394
- name: string;
1395
- }
1396
- interface DesignInputStepData {
1397
- }
1398
- export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
1399
- export const EditorCore: FunctionComponent<{
1400
- isMobile: boolean;
1401
- color?: string;
1402
- outlineColor?: string;
1403
- editorRef: RefObject<SVGRectElement>;
1404
- zoomableElementRef: RefObject<HTMLDivElement>;
1405
- interactionElementRef: RefObject<HTMLDivElement>;
1406
- guidelines: SnapPoint[];
1407
- isMakingAdjustments?: boolean;
1408
- outlineArea?: {
1409
- x?: number;
1410
- y?: number;
1411
- height?: number;
1412
- width?: number;
1413
- hidden?: boolean;
1414
- };
1415
- visibleLayoutId: string;
1416
- xTranslation: number;
1417
- yTranslation: number;
1418
- targetedElements?: string[];
1419
- borderRadius?: number;
1420
- canvasFilter?: string;
1421
- handleContextMenu?: (e: any) => void;
1422
- onMouseMove?: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
1423
- onContextMenuHandlePointerDown?: (event: PointerEvent) => void;
1424
- handleKeyDown: (event: KeyboardEvent, adjustmentBoundary?: Region) => void;
1425
- handleKeyUp: (event: KeyboardEvent) => void;
1426
- handlePointerMove: (e: PointerEvent, adjustmentBoundary?: Region) => void;
1427
- handlePointerPressedBackground: (event: PointerEvent) => void;
1428
- handlePointerReleased: () => void;
1429
- handleScroll: () => void;
1430
- onSequenceStart: () => void;
1431
- setElementEvent: (e: ElementEvent | undefined) => void;
1432
- onElementSelected: (elementId: string | undefined, event: PointerEvent) => void;
1433
- variationRecord: null | VariationRecord;
1434
- workflow: _Workflow1;
1435
- }>;
1436
- /**
1437
- * The advanced editor encapsulates the logic required to allow users to manipulate a design
1438
- * with more granular control such as toolbars, direct element manipulation, and more.
1439
- */
1440
- export const AdvancedEditor: FunctionComponent<{
1441
- borderRadius?: number;
1442
- canvasFilter?: string;
1443
- color?: string;
1444
- guidelineColor?: string;
1445
- handleContextMenu?: (event: React.MouseEvent) => void;
1446
- hideEditableAreaRect?: boolean;
1447
- isMobile: boolean;
1448
- onContextMenuHandlePointerDown?: (event: PointerEvent) => void;
1449
- onDragEnd?: () => void;
1450
- onElementSelected?: (id: string | undefined, element: PointerEvent) => void;
1451
- onMouseMove?: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
1452
- outlineColor?: string;
1453
- variationRecord: null | VariationRecord;
1454
- workflow: _Workflow1;
1455
- }>;
1456
- /**
1457
- * A wrapping component that provides a simple interface for interacting with a variant.
1458
- */
1459
- export class Variant {
1460
- constructor(variant: _VariantResource1);
1461
- getType(): _AssetType1 | undefined;
1462
- /**
1463
- * @returns The unique identifier for the variant.
1464
- */
1465
- getId(): string;
1466
- /**
1467
- * @returns The configured name of the variant. Generally a human readable value.
1468
- */
1469
- getName(): string;
1470
- /**
1471
- * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
1472
- */
1473
- getPriceFormatted(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions | undefined): string;
1474
- /**
1475
- * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
1476
- * Presented in subunits of the currency of the option. For example, if the option is configured to use USD, the price modifier will be in cents.
1477
- */
1478
- getPrice(): number;
1479
- /**
1480
- * @returns The URL for the base asset resource configured on this variant
1481
- */
1482
- getAsset(): string | undefined;
1483
- /**
1484
- * @returns The URL for the base asset resource configured on this variant
1485
- */
1486
- getAssetResource(): _Asset1 | undefined;
1487
- /**
1488
- * @returns The URL for a thumbnail resource configured on this variant. When no thumbnail is configured explicitly we fall back to the base asset and see if a thumbnail is genererated for that.
1489
- */
1490
- getThumbnail(): string | undefined;
1491
- /**
1492
- * @returns The URL for the display image configured on this variant. Can be used for things like size charts.
1493
- * @deprecated To be removed in a future version, Please use getThumbnail() instead
1494
- */
1495
- getDisplayImage(): string | undefined;
1496
- /**
1497
- * @returns When this variant is configured to have a color, this will return the hex value for that color.
1498
- */
1499
- getColor(): string | undefined;
1500
- /**
1501
- * @returns True when the variant is the default for its containing option. False otherwise.
1502
- */
1503
- isDefault(): boolean;
1504
- /**
1505
- * @returns The underlying variant resource. Generally not needed but made available just incase.
1506
- */
1507
- getResource(): _VariantResource1;
1508
- /**
1509
- * @returns True when the variant is enabled. False otherwise.
1121
+ * @returns True when the variant is enabled. False otherwise.
1510
1122
  */
1511
1123
  isEnabled(): boolean;
1512
1124
  }
1125
+
1513
1126
  /**
1514
1127
  * A StepHandle allows for managing the state of a specific step in a workflow. This class
1515
1128
  * abstracts away the complexities of dealing with a step directly and allows for using high level
1516
1129
  * concepts instead of dealing with the underlying data structures.
1517
1130
  */
1518
- export abstract class StepHandle<T extends _AnyStepData1> {
1131
+ declare abstract class StepHandle<T extends AnyStepData> {
1132
+ /**
1133
+ * Stores whether or not the step is currently updating.
1134
+ */
1135
+ private static readonly updateState;
1519
1136
  /**
1520
1137
  * Access to the workflow manager this step is contained by.
1521
1138
  */
@@ -1523,8 +1140,8 @@ export abstract class StepHandle<T extends _AnyStepData1> {
1523
1140
  /**
1524
1141
  * The step metadata, useful for determining logic based on configuration.
1525
1142
  */
1526
- protected readonly step: _Step1<T>;
1527
- constructor(manager: WorkflowManager, step: _Step1<T>);
1143
+ protected readonly step: Step<T>;
1144
+ constructor(manager: WorkflowManager, step: Step<T>);
1528
1145
  /**
1529
1146
  * Set the current update state of this step. All step handles pointing to this step will
1530
1147
  * see this value.
@@ -1569,11 +1186,11 @@ export abstract class StepHandle<T extends _AnyStepData1> {
1569
1186
  /**
1570
1187
  * @returns The type of the step handle.
1571
1188
  */
1572
- getType(): _StepType1;
1189
+ getType(): StepType;
1573
1190
  /**
1574
1191
  * @returns The underlying data for this step. Favor using the step handle methods instead of this.
1575
1192
  */
1576
- getRaw(): _Step1<T>;
1193
+ getRaw(): Step<T>;
1577
1194
  getTags(): string[];
1578
1195
  hasTag(tag: string): boolean;
1579
1196
  /**
@@ -1583,183 +1200,9 @@ export abstract class StepHandle<T extends _AnyStepData1> {
1583
1200
  */
1584
1201
  executeAnimations(): void;
1585
1202
  }
1586
- export class BulkStepHandle extends StepHandle<_BulkStepData1> {
1587
- constructor(manager: WorkflowManager, step: _Step1<_BulkStepData1>);
1588
- selectVariant(): Promise<void>;
1589
- setDesignName(designName: string): Promise<void>;
1590
- addVariationRecord(): VariationRecord;
1591
- updateBulkIsConnected(bulkIsConnected: boolean): void;
1592
- /**
1593
- * Opens the bulk source in a seperate tab. This bulk source could be a google sheet or a csv file.
1594
- */
1595
- openBulkSourceUrl(): void;
1596
- sendGoogleSheetLinkToEmail(email: string): Promise<void>;
1597
- /**
1598
- * Removes a variation from the bulk step.
1599
- * @param recordNumber The record number of the variation to remove.
1600
- */
1601
- deleteVariationRecord(recordNumber: number): void;
1602
- /**
1603
- * @returns The aspects of each step that are modifiable from the bulk handle. These are configured in the workflow.
1604
- */
1605
- getAspects(): import("@spiffcommerce/papyrus").StepAspect[];
1606
- }
1607
- export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
1608
- constructor(manager: WorkflowManager, step: _Step1<_IllustrationStepData1>);
1609
- /**
1610
- * Allows for select a vector from the available vectors configured on this steps base option.
1611
- * @param variant The new vector variant to use for this step.
1612
- * @returns A promise that can be awaited to know when the new vector asset has been updated on the design.
1613
- */
1614
- selectVariant(variant: Variant): Promise<void>;
1615
- /**
1616
- * Get colors for the illustration.
1617
- * @returns A list of color definitions that are currently applied to the illustration.
1618
- */
1619
- getColors(): {
1620
- [key: string]: import("@spiffcommerce/papyrus").ColorDefinition;
1621
- } | undefined;
1622
- /**
1623
- * Set color for the illustration.
1624
- */
1625
- setColor(key: string, value: string): Promise<void>;
1626
- getColorOption(): Promise<import("@spiffcommerce/papyrus").OptionResource | undefined>;
1627
- getAvailableColors(): Promise<{
1628
- fill: string | undefined;
1629
- stroke: string | undefined;
1630
- variant: import("@spiffcommerce/papyrus").VariantResource;
1631
- }[] | undefined>;
1632
- hasVaryingSelection(): boolean | undefined;
1633
- hasVaryingColors(): boolean | undefined;
1634
- isColorPickerEnabled(): boolean | undefined;
1635
- }
1636
- export class MaterialStepHandle extends StepHandle<_MaterialStepData1> {
1637
- constructor(manager: WorkflowManager, step: _Step1<_MaterialStepData1>);
1638
- selectVariant(variant: Variant): Promise<void>;
1639
- }
1640
- export class ModelStepHandle extends StepHandle<_ModelStepData1> {
1641
- constructor(manager: WorkflowManager, step: _Step1<_ModelStepData1>);
1642
- selectVariant(variant: Variant): Promise<void>;
1643
- }
1644
- export class PictureStepHandle extends StepHandle<_PictureStepData1> {
1645
- constructor(manager: WorkflowManager, step: _Step1<_PictureStepData1>);
1646
- /**
1647
- * Allows the user to select an image variant from the available variants configured on this steps base option.
1648
- * @param variant The new image variant to use.
1649
- * @returns A promise that can be awaited to ensure the new image asset has been updated on the design.
1650
- */
1651
- selectVariant(variant: Variant): Promise<void>;
1652
- }
1653
- export class QuestionStepHandle extends StepHandle<_QuestionStepData1> {
1654
- constructor(manager: WorkflowManager, step: _Step1<_QuestionStepData1>);
1655
- selectVariant(variant: Variant): Promise<void>;
1656
- /**
1657
- * The way that this step expects to be rendered.
1658
- */
1659
- getDisplayType(): string | undefined;
1660
- }
1661
- export class ShapeStepHandle extends StepHandle<_ShapeStepData1> {
1662
- constructor(manager: WorkflowManager, step: _Step1<_ShapeStepData1>);
1663
- selectVariant(variant: Variant): Promise<void>;
1664
- /**
1665
- * Sets the color of the shape.
1666
- * @param color The color option to use.
1667
- * @returns A promise resolving when the color has changed in the design.
1668
- * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
1669
- */
1670
- setColor(color: ColorOption): Promise<void>;
1671
- /**
1672
- * Get available colors for the shape.
1673
- * @returns A list of color definitions that are currently applied to the illustration.
1674
- */
1675
- getColors(): Promise<{
1676
- fill: string | undefined;
1677
- stroke: string | undefined;
1678
- variant: import("@spiffcommerce/papyrus").VariantResource;
1679
- }[]>;
1680
- /**
1681
- * Allows for setting a custom color when the custom variant is selected. Will
1682
- * throw when a non-custom variant is selected.
1683
- */
1684
- setCustomColor(color: string): void;
1685
- getCustomColor(): string;
1686
- }
1687
- interface TextChangeResult {
1688
- input: string;
1689
- helperText?: string;
1690
- errorText?: string;
1691
- }
1692
- export class TextStepHandle extends StepHandle<_TextStepData1> {
1693
- constructor(manager: WorkflowManager, step: _Step1<_TextStepData1>);
1694
- /**
1695
- * Allows for select a font from the available fonts configured on this steps base option.
1696
- * @param variant The font variant to use.
1697
- */
1698
- selectVariant(variant: Variant): Promise<void>;
1699
- /**
1700
- * @returns A list of colors that can be used to fill the text.
1701
- */
1702
- getAvailableFillColors(): ColorOption[];
1703
- /**
1704
- * Changes the fill of text related to this step to the new fill value.
1705
- * @param fill A new fill value to use.
1706
- */
1707
- setFillColor(fill: ColorOption): Promise<void>;
1708
- /**
1709
- * Gets the color currently applied to the element.
1710
- */
1711
- getFillColor(): string;
1712
- getAvailableFillImages(): Promise<TextFillImage[]>;
1713
- setFillImage(fillImage: TextFillImage): Promise<void>;
1714
- getFillImage(): TextFillImage | undefined;
1715
- /**
1716
- * When true & the step has replaceable text configured the user will be
1717
- * abled to edit the entire text string including the non-replaceable text.
1718
- * @param shouldCustomizeAll When true the user can configure the entire text string.
1719
- */
1720
- setFullTextCustomization(shouldCustomizeAll: boolean): TextChangeResult;
1721
- /**
1722
- * Changes the text value of text related to this step to a new value.
1723
- * @param userInput Input from the user.
1724
- */
1725
- setText(userInput: string): TextChangeResult;
1726
- /**
1727
- * Gets the text currently applied to the elements of this step.
1728
- */
1729
- getText(): string;
1730
- isReplaceable(): boolean | undefined;
1731
- /**
1732
- * Inform the step that now is the time to
1733
- * clear default text if it should do so.
1734
- * Returns a text change rwsult if a clear occurred.
1735
- */
1736
- clearDefaultTextIfNecessary(): TextChangeResult | undefined;
1737
- hasVaryingText(): boolean | undefined;
1738
- hasVaryingColor(): boolean | undefined;
1739
- hasVaryingSelection(): boolean | undefined;
1740
- hasColorPicker(): boolean | undefined;
1741
- getRegions(): import("@spiffcommerce/papyrus").Region[];
1742
- /**
1743
- * Return the maximum characters allowed for
1744
- * this step, or undefined if there is no limit.
1745
- */
1746
- getCharacterLimit(): number | undefined;
1747
- /**
1748
- * Return the remaining amount of characters that
1749
- * the user is allowed to add, or undefined if there is no limit.
1750
- */
1751
- getCharactersRemaining(): number | undefined;
1752
- }
1753
- export class InformationStepHandle extends StepHandle<_InformationStepData1> {
1754
- constructor(manager: WorkflowManager, step: _Step1<_InformationStepData1>);
1755
- selectVariant(): Promise<void>;
1756
- /**
1757
- * The way that this step expects to be rendered.
1758
- */
1759
- getContent(): string;
1760
- }
1761
- export const createDesign: (workflowManager: WorkflowManager, workflow: _Workflow1, layouts: _ILayout1[], getReducerState: () => _CommandState1, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, updateVariationRecords: (variationRecords: VariationRecord[]) => Promise<void>, variationRecords: VariationRecord[], createPreviewImage: (shouldRender3D?: boolean) => Promise<string | undefined>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
1762
- export interface SavedDesign {
1203
+
1204
+ declare const createDesign: (workflowManager: WorkflowManager, workflow: Workflow, layouts: ILayout[], getReducerState: () => CommandState, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, updateVariationRecords: (variationRecords: VariationRecord[]) => Promise<void>, variationRecords: VariationRecord[], createPreviewImage: (shouldRender3D?: boolean) => Promise<string | undefined>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
1205
+ interface SavedDesign {
1763
1206
  /**
1764
1207
  * The user's name for this saved design.
1765
1208
  */
@@ -1799,6 +1242,8 @@ export interface SavedDesign {
1799
1242
  */
1800
1243
  declare class DesignService {
1801
1244
  readonly localPersistenceKey = "designTransactions";
1245
+ private storageMethod;
1246
+ private designSavedListeners;
1802
1247
  /**
1803
1248
  * @param func The function to call when a design is saved.
1804
1249
  */
@@ -1831,8 +1276,10 @@ declare class DesignService {
1831
1276
  * @param transactionId
1832
1277
  */
1833
1278
  removeDesign(transactionId: string): Promise<void>;
1279
+ private setDesigns;
1834
1280
  }
1835
- export const designService: DesignService;
1281
+ declare const designService: DesignService;
1282
+
1836
1283
  /**
1837
1284
  * A scene is a collection of steps that can be used to group steps together.
1838
1285
  */
@@ -1856,11 +1303,11 @@ interface Scene {
1856
1303
  interface ExperienceOptions {
1857
1304
  product: Product;
1858
1305
  transaction: Transaction;
1859
- workflow?: _Workflow1;
1306
+ workflow?: Workflow;
1860
1307
  previewService?: any;
1861
1308
  modelContainer?: any;
1862
1309
  renderableContextService?: any;
1863
- layouts: _ILayout1[];
1310
+ layouts: ILayout[];
1864
1311
  reloadedState?: LayoutsState;
1865
1312
  /**
1866
1313
  * When true the experience is intended to be immutable.
@@ -1880,7 +1327,7 @@ interface ExperienceOptions {
1880
1327
  * provides a simplified interface for interacting with the workflow manager. You
1881
1328
  * should get an instance of this class from a Client you have constructed previously.
1882
1329
  */
1883
- export interface WorkflowExperience {
1330
+ interface WorkflowExperience {
1884
1331
  /**
1885
1332
  * Returns the client that was responsible for spawning this experience.
1886
1333
  */
@@ -1905,7 +1352,7 @@ export interface WorkflowExperience {
1905
1352
  * Returns the step matching a given name, undefined if not found.
1906
1353
  * @param id The id the step must match.
1907
1354
  */
1908
- getStepById(id: string): StepHandle<_AnyStepData1> | undefined;
1355
+ getStepById(id: string): StepHandle<AnyStepData> | undefined;
1909
1356
  /**
1910
1357
  * Returns the bulk step, undefined if not found.
1911
1358
  */
@@ -1914,21 +1361,21 @@ export interface WorkflowExperience {
1914
1361
  * Returns the step matching a given name, undefined if not found.
1915
1362
  * @param name The name the step must match.
1916
1363
  */
1917
- getStepByName(name: string): StepHandle<_AnyStepData1> | undefined;
1364
+ getStepByName(name: string): StepHandle<AnyStepData> | undefined;
1918
1365
  /**
1919
1366
  * Returns all steps matching a specific type in the workflow. These steps
1920
1367
  * may be across multiple scenes and may or may not be active based on condition state.
1921
1368
  */
1922
- getStepsByType(type: _StepType1): StepHandle<_AnyStepData1>[];
1369
+ getStepsByType(type: StepType): StepHandle<AnyStepData>[];
1923
1370
  /**
1924
1371
  * Returns all steps that are children of a given scene.
1925
1372
  * @param scene The scene you want the steps for.
1926
1373
  */
1927
- getStepsByScene(scene: Scene): StepHandle<_AnyStepData1>[];
1374
+ getStepsByScene(scene: Scene): StepHandle<AnyStepData>[];
1928
1375
  /**
1929
1376
  * Returns all steps in the workflow that are currently active. Ordered by scene and appearance within their respective scenes.
1930
1377
  */
1931
- getSteps(): StepHandle<_AnyStepData1>[];
1378
+ getSteps(): StepHandle<AnyStepData>[];
1932
1379
  /**
1933
1380
  * Returns a list of scenes that are configured in the workflow. Each scene
1934
1381
  * contains a list of steps. See getStepsByScene to access these.
@@ -2003,11 +1450,13 @@ export interface WorkflowExperience {
2003
1450
  [key: string]: string;
2004
1451
  }>;
2005
1452
  }
2006
- export class WorkflowExperienceImpl implements WorkflowExperience {
1453
+ declare class WorkflowExperienceImpl implements WorkflowExperience {
2007
1454
  readonly client: SpiffCommerceClient;
2008
1455
  readonly commandContext: CommandContext;
2009
1456
  readonly workflowManager: WorkflowManager;
2010
1457
  readonly isReadOnly: boolean;
1458
+ private renderableScenes;
1459
+ private renderableSceneCallbacks;
2011
1460
  constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
2012
1461
  getClient(): SpiffCommerceClient;
2013
1462
  getIsReadOnly(): boolean;
@@ -2015,53 +1464,42 @@ export class WorkflowExperienceImpl implements WorkflowExperience {
2015
1464
  getWorkflowManager(): WorkflowManager;
2016
1465
  updateVariationRecords(variationRecords: VariationRecord[]): Promise<void>;
2017
1466
  createPreviewImage(isThreeD?: boolean, resolution?: number): Promise<string>;
2018
- getStepById(id: string): BulkStepHandle | import("index").IllustrationStepHandle | import("index").MaterialStepHandle | import("index").ModelStepHandle | import("index").PictureStepHandle | import("index").QuestionStepHandle | import("index").ShapeStepHandle | import("index").TextStepHandle | import("index").InformationStepHandle | import("index").FrameStepHandle | undefined;
2019
- getSteps(): StepHandle<_AnyStepData1>[];
1467
+ getStepById(id: string): TextStepHandle | FrameStepHandle | BulkStepHandle | ShapeStepHandle | InformationStepHandle | IllustrationStepHandle | MaterialStepHandle | ModelStepHandle | PictureStepHandle | QuestionStepHandle | undefined;
1468
+ getSteps(): StepHandle<AnyStepData>[];
2020
1469
  getScenes(): Scene[];
2021
1470
  getSelectionPriceSubunits(): number;
2022
1471
  getBasePriceSubunits(): number;
2023
1472
  getTotalPriceSubunits(): number;
2024
1473
  getBulkStep(): BulkStepHandle | undefined;
2025
- getStepByName(name: string): BulkStepHandle | import("index").IllustrationStepHandle | import("index").MaterialStepHandle | import("index").ModelStepHandle | import("index").PictureStepHandle | import("index").QuestionStepHandle | import("index").ShapeStepHandle | import("index").TextStepHandle | import("index").InformationStepHandle | import("index").FrameStepHandle | undefined;
2026
- getStepsByType(type: _StepType1): StepHandle<_AnyStepData1>[];
2027
- getStepsByScene(scene: Scene): StepHandle<_AnyStepData1>[];
1474
+ getStepByName(name: string): TextStepHandle | FrameStepHandle | BulkStepHandle | ShapeStepHandle | InformationStepHandle | IllustrationStepHandle | MaterialStepHandle | ModelStepHandle | PictureStepHandle | QuestionStepHandle | undefined;
1475
+ getStepsByType(type: StepType): StepHandle<AnyStepData>[];
1476
+ getStepsByScene(scene: Scene): StepHandle<AnyStepData>[];
2028
1477
  attachCustomerDetails(details: {
2029
1478
  email: string;
2030
1479
  }): Promise<void>;
2031
1480
  assignCustomerDetails(details: CustomerDetailsInput): Promise<void>;
2032
1481
  attachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
2033
1482
  detachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
2034
- debouncedSavedDesignUpdate: import("lodash").DebouncedFunc<() => Promise<void>>;
1483
+ debouncedSavedDesignUpdate: lodash.DebouncedFunc<() => Promise<void>>;
2035
1484
  save(title?: string): Promise<SavedDesign>;
2036
1485
  copy(): Promise<WorkflowExperience>;
2037
1486
  onDesignFinished(onProgressUpdate?: DesignCreationProgressUpdate, capturePreviewImage?: boolean): Promise<DesignCreationMessage>;
1487
+ /**
1488
+ * @param step The step to test against.
1489
+ * @returns Returns true when a valid handle is implemented for a given step type. Certain steps don't support handles, such as silent illustrations.
1490
+ */
1491
+ private stepHasHandle;
1492
+ private getCanvasObjectURLAsync;
2038
1493
  getExportedData(): Map<string, {
2039
1494
  [key: string]: string;
2040
1495
  }>;
2041
1496
  }
2042
- export enum FrameStep {
2043
- SelectFrame = "SelectFrame",
2044
- SelectImage = "SelectImage",
2045
- Position = "Position"
2046
- }
2047
- export class FrameStepHandle extends StepHandle<_FrameStepData1> {
2048
- constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
2049
- selectVariant(variant: Variant): Promise<void>;
2050
- onFrameDataChanged(callback: (frameData: _FrameData1[]) => void): void;
2051
- selectImage(asset: _Asset1): void;
2052
- getImageData(): PatternImageData | undefined;
2053
- getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
2054
- getFrameService(): FrameService | undefined;
2055
- hasOverlayImageKey(): string | undefined;
2056
- hasOverlayImageUrl(): any;
2057
- hasVaryingUpload(): boolean | undefined;
2058
- hasVaryingSelection(): boolean | undefined;
2059
- }
1497
+
2060
1498
  /**
2061
1499
  * A GlobalPropertyHandle acts as an interface to global properties on our platform. Currently
2062
1500
  * bundles can return a handle for any global properties associated to the collection.
2063
1501
  */
2064
- export abstract class GlobalPropertyHandle {
1502
+ declare abstract class GlobalPropertyHandle {
2065
1503
  protected readonly bundle: Bundle;
2066
1504
  protected readonly property: GlobalPropertyConfigurationAspect;
2067
1505
  constructor(bundle: Bundle, property: GlobalPropertyConfigurationAspect);
@@ -2094,17 +1532,20 @@ export abstract class GlobalPropertyHandle {
2094
1532
  * Returns all steps that share this property.
2095
1533
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
2096
1534
  */
2097
- protected getSharedSteps(targetExperiences?: WorkflowExperience[]): import("stepHandles").StepHandle<import("index").AnyStepData>[];
1535
+ protected getSharedSteps(targetExperiences?: WorkflowExperience[]): StepHandle<_spiffcommerce_papyrus.AnyStepData>[];
2098
1536
  }
1537
+
2099
1538
  interface GlobalPropertyStateManager {
2100
1539
  getGlobalPropertyState(): GlobalPropertyState | undefined;
2101
1540
  getAspect(name: string): string | undefined;
2102
1541
  setAspect(name: string, value: string): Promise<void>;
2103
1542
  }
1543
+
2104
1544
  /**
2105
1545
  * A collection of products that can be used to form a bundle.
2106
1546
  */
2107
- export class ProductCollection {
1547
+ declare class ProductCollection {
1548
+ private readonly collection;
2108
1549
  constructor(collection: ProductCollectionResource);
2109
1550
  /**
2110
1551
  * The ID of the product collection.
@@ -2126,7 +1567,8 @@ export class ProductCollection {
2126
1567
  /**
2127
1568
  * A collection product is a product within a ProductCollection. It provides a simple interface for interacting with the product.
2128
1569
  */
2129
- export class CollectionProduct {
1570
+ declare class CollectionProduct {
1571
+ private readonly product;
2130
1572
  constructor(product: Product);
2131
1573
  /**
2132
1574
  * The ID of the product in SpiffCommerce.
@@ -2152,10 +1594,11 @@ export class CollectionProduct {
2152
1594
  */
2153
1595
  getResource(): Product;
2154
1596
  }
1597
+
2155
1598
  /**
2156
1599
  * A bundle serves as a container for a set of workflow experience.
2157
1600
  */
2158
- export interface Bundle {
1601
+ interface Bundle {
2159
1602
  /**
2160
1603
  * @returns The client that this bundle is associated with.
2161
1604
  */
@@ -2349,6 +1792,7 @@ interface ConditionalGlobalPropertiesChangedEventData {
2349
1792
  interface WorkflowExperienceHoverEventData {
2350
1793
  workflowExperience: WorkflowExperience;
2351
1794
  }
1795
+
2352
1796
  interface ExecutionResponse {
2353
1797
  id: string;
2354
1798
  completedAt?: string;
@@ -2374,7 +1818,7 @@ declare abstract class FlowExecutionInput {
2374
1818
  /**
2375
1819
  * Represents the type of object being referenced by the input.
2376
1820
  */
2377
- export const enum ObjectInputType {
1821
+ declare const enum ObjectInputType {
2378
1822
  Transaction = "Transaction",
2379
1823
  Bundle = "Bundle",
2380
1824
  Product = "Product",
@@ -2386,18 +1830,19 @@ export const enum ObjectInputType {
2386
1830
  /**
2387
1831
  * Handles validation of spiffObject structure for transmission to the server.
2388
1832
  */
2389
- export class ObjectInput extends FlowExecutionInput {
1833
+ declare class ObjectInput extends FlowExecutionInput {
2390
1834
  constructor(id: string, type: ObjectInputType);
2391
1835
  static validUUID(uuid: string): RegExpMatchArray | null;
2392
1836
  }
2393
1837
  /**
2394
1838
  * Handles validation of text input for transmission to the server.
2395
1839
  */
2396
- export class TextInput extends FlowExecutionInput {
1840
+ declare class TextInput extends FlowExecutionInput {
2397
1841
  constructor(id: string);
2398
1842
  }
2399
- export const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<_Workflow1[]>;
2400
- export const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<_Workflow1>;
1843
+
1844
+ declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
1845
+ declare const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<Workflow>;
2401
1846
  /**
2402
1847
  * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
2403
1848
  * Please refer to the documentation for more information.
@@ -2458,12 +1903,21 @@ interface GetWorkflowFromExternalProductOptions extends GetWorkflowOptionsBase {
2458
1903
  bulk?: boolean;
2459
1904
  type: "external";
2460
1905
  }
2461
- export type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
1906
+ type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
2462
1907
  /**
2463
1908
  * The Spiff Commerce Javascript Client. Required for
2464
1909
  * creating workflow experiences.
2465
1910
  */
2466
- export class SpiffCommerceClient {
1911
+ declare class SpiffCommerceClient {
1912
+ private options;
1913
+ private initialized;
1914
+ private currencyCode?;
1915
+ private customer?;
1916
+ /**
1917
+ * @deprecated This object is passed to the WorkflowExperience constructor and is no longer needed on this object.
1918
+ * Any functionality referencing this object will be removed in a future release.
1919
+ */
1920
+ private experienceOptions?;
2467
1921
  constructor(options: ClientOptions);
2468
1922
  /**
2469
1923
  * @returns The asset manager allows for common operations related to assets
@@ -2496,7 +1950,7 @@ export class SpiffCommerceClient {
2496
1950
  transactionReadOnly?: boolean;
2497
1951
  stakeholderType?: StakeholderType;
2498
1952
  success: boolean;
2499
- theme?: _Theme1;
1953
+ theme?: Theme;
2500
1954
  }>;
2501
1955
  clearCustomer(): void;
2502
1956
  clearCustomerForTransaction(transactionId: string): void;
@@ -2505,6 +1959,7 @@ export class SpiffCommerceClient {
2505
1959
  customer: Customer;
2506
1960
  isAuthenticated: boolean;
2507
1961
  }>;
1962
+ private authenticateCustomerId;
2508
1963
  /**
2509
1964
  * Generates a verification code for the given email address.
2510
1965
  * @param emailAddress The email address to generate a verification code for. The user will be sent an email with the verification code.
@@ -2543,7 +1998,7 @@ export class SpiffCommerceClient {
2543
1998
  * @param options Options to configure loading the transaction and workflow.
2544
1999
  * @returns A workflow experience configured as requested.
2545
2000
  */
2546
- getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any, options?: GetWorkflowOptions): Promise<WorkflowExperience>;
2001
+ getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: Workflow) => any, options?: GetWorkflowOptions): Promise<WorkflowExperience>;
2547
2002
  /**
2548
2003
  * Gets multiple workflow experiences at once.
2549
2004
  * @param optionsArray An array of options to configure loading the transactions and workflows.
@@ -2565,6 +2020,10 @@ export class SpiffCommerceClient {
2565
2020
  * @deprecated Use getWorkflowExperience to initialize the experience.
2566
2021
  */
2567
2022
  initFromTransaction(transactionId: string, readOnly?: boolean): Promise<void>;
2023
+ /**
2024
+ * @deprecated Remove when the initFrom functions are removed.
2025
+ */
2026
+ private getWorkflowExperienceDeprecated;
2568
2027
  /**
2569
2028
  * @deprecated The value this returns will be changed whenever `getWorkflowExperience()` is called. Use `workflowExperience.getWorkflowManager().getPreviewService()` instead.
2570
2029
  * @returns The preview service that was provided during construction.
@@ -2574,27 +2033,259 @@ export class SpiffCommerceClient {
2574
2033
  * @deprecated The value this returns will be changed whenever `getWorkflowExperience()` is called. Use `WorkflowManager.getProduct()` instead.
2575
2034
  * @returns The product associated with this client.
2576
2035
  */
2577
- getProduct(): import("types").Product;
2036
+ getProduct(): Product;
2578
2037
  /**
2579
2038
  * @deprecated The value this returns will be changed whenever `getWorkflowExperience()` is called. Use `WorkflowManager.getTransaction()` instead.
2580
2039
  * @returns The transaction associated with this client.
2581
2040
  */
2582
2041
  getTransaction(): Transaction;
2042
+ /**
2043
+ * A function used to synchronize transaction state with the server.
2044
+ * @param options New state details. To be spread into the query.
2045
+ * @returns
2046
+ */
2047
+ private updateTransactionState;
2583
2048
  storeCustomer(customer: Customer): void;
2584
2049
  }
2585
- export class MockWorkflowManager implements WorkflowManager {
2586
- getInitializationPromise(): Promise<void>;
2587
- getProduct: () => Product;
2588
- isInitialized(): boolean;
2589
- getCommandContext: () => _CommandContext1;
2590
- getAllLayoutData: () => LayoutState[];
2591
- getMetadata: (stepName: string) => StepMetadata | undefined;
2592
- getWorkflowMetadata: () => WorkflowMetadata;
2593
- getStepStorage: (stepName: string) => _StepStorage1 | undefined;
2594
- getInformationResults(): InformationResult[];
2050
+
2051
+ declare class Configuration {
2052
+ private readonly defaultServerUrl;
2053
+ private readonly defaultServicesApiUrl;
2054
+ private readonly defaultHubUrl;
2055
+ private serverUrl;
2056
+ private servicesApiUrl;
2057
+ private hubUrl;
2058
+ private serverUrlCallbacks;
2059
+ constructor();
2060
+ getServerUrl(): string;
2061
+ getServicesApiUrl(): string;
2062
+ getHubUrl(): string;
2063
+ setServerUrl(serverUrl: string): void;
2064
+ setServicesApiUrl(servicesApiUrl: string): void;
2065
+ setHubUrl(hubUrl: string): void;
2066
+ addServerUrlCallback(callback: () => void): void;
2067
+ }
2068
+ declare const spiffCoreConfiguration: Configuration;
2069
+
2070
+ declare const gatherVaryingStepAspects: (workflow: Workflow) => StepAspect[];
2071
+
2072
+ type ToastCallback = (callbackOptions: {
2073
+ toastMessage: null | string;
2074
+ toastType: InformationMessageType | null;
2075
+ }) => void;
2076
+ declare class Toast {
2077
+ private latestToast;
2078
+ private toastType;
2079
+ private toastCallbacks;
2080
+ constructor();
2081
+ addToastCallback(callback: ToastCallback): void;
2082
+ setLatestToast(errorMessage: null | string, errorType: InformationMessageType | null): void;
2083
+ private onToastChange;
2084
+ }
2085
+ declare const toast: Toast;
2086
+
2087
+ interface FrameCreateOpts {
2088
+ stepName?: string;
2089
+ frameData: FrameData;
2090
+ disablePlaceholder?: boolean;
2091
+ focalBlur?: boolean;
2092
+ focalBlurStrength?: number;
2093
+ focalBlurRadius?: number;
2094
+ pattern?: any;
2095
+ }
2096
+ declare class FrameStepService implements StepService<FrameStepData> {
2097
+ init(stepData: Step<FrameStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2098
+ private reload;
2099
+ selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager): void;
2100
+ selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
2101
+ getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
2102
+ loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
2103
+ private selectVariantCommand;
2104
+ private frameSourceSvg;
2105
+ /**
2106
+ * Grab the source to be used for a frame from the variant or throw otherwise.
2107
+ */
2108
+ private patternSource;
2109
+ private loadPatternFromAsset;
2110
+ }
2111
+ declare const frameStepService: FrameStepService;
2112
+
2113
+ interface SVGCreateOpts {
2114
+ stepName?: string;
2115
+ src: string;
2116
+ objectURL: string;
2117
+ svg: {
2118
+ svg: string;
2119
+ colors: {
2120
+ [key: string]: ColorDefinition;
2121
+ };
2122
+ };
2123
+ }
2124
+ declare class IllustrationStepService implements StepService<IllustrationStepData> {
2125
+ getIllustrationBody(src: string): Promise<string>;
2126
+ getCreateElementCommand(id: string, region: Region, layout: ILayout, options: SVGCreateOpts): CreateElementCommand<IllustrationElement>;
2127
+ getColors(stepData: Step<IllustrationStepData>, workflowManager: WorkflowManager): never[] | {
2128
+ [key: string]: ColorDefinition;
2129
+ };
2130
+ init(stepData: Step<IllustrationStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2131
+ private reload;
2132
+ availableColors(stepData: Step<IllustrationStepData>, workflowManager: WorkflowManager): Promise<{
2133
+ fill: string | undefined;
2134
+ stroke: string | undefined;
2135
+ variant: VariantResource;
2136
+ }[] | undefined>;
2137
+ changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string>): Promise<CanvasCommand>;
2138
+ changeColors(stepData: Step<IllustrationStepData>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => LayoutData[], newFills: Map<string, string>): Promise<void>;
2139
+ selectVariant(stepData: Step<IllustrationStepData>, variant: VariantResource, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
2140
+ private selectVariantCommand;
2141
+ }
2142
+ declare const illustrationStepService: IllustrationStepService;
2143
+
2144
+ declare class MaterialStepService implements StepService<MaterialStepData> {
2145
+ init(stepData: Step<MaterialStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<null | CommandWithFollowup>;
2146
+ private reload;
2147
+ selectVariant(step: Step<MaterialStepData>, variant: VariantResource, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
2148
+ private selectVariantLambda;
2149
+ }
2150
+ declare const materialStepService: MaterialStepService;
2151
+
2152
+ declare class ModelStepService implements StepService<ModelStepData> {
2153
+ init(stepData: Step<ModelStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2154
+ private reload;
2155
+ selectVariant(step: Step<ModelStepData>, variant: VariantResource, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
2156
+ private selectVariantLambda;
2157
+ }
2158
+ declare const modelStepService: ModelStepService;
2159
+
2160
+ interface TextFillSpotColor {
2161
+ profileName: string;
2162
+ namedColor: string;
2163
+ }
2164
+ interface TextUpdateResult {
2165
+ command?: GroupCommand;
2166
+ helperText: string;
2167
+ errors: TextError[];
2168
+ }
2169
+ interface TextError {
2170
+ localizationKey: string;
2171
+ }
2172
+ declare class TextStepService implements StepService<TextStepData> {
2173
+ private cachedColors;
2174
+ init(stepData: Step<TextStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2175
+ findLayoutElements(workflowManager: WorkflowManager, step: Step<TextStepData>): TextboxElement[];
2176
+ /**
2177
+ * Get the colors that can be used for a given text step.
2178
+ * @param stepData The text step to get colors for.
2179
+ * @returns A list of color objects containg fill, stroke and variant if available.
2180
+ */
2181
+ availableFillColors(stepData: Step<TextStepData>): ColorOption[];
2182
+ changeFillColor(stepData: Step<TextStepData>, newColor: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
2183
+ availableFillImages(stepData: Step<TextStepData>): Promise<TextFillImage[]>;
2184
+ changeFillImage(stepData: Step<TextStepData>, fillImage: TextFillImage, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
2185
+ /**
2186
+ * Given an element and a string, filters any characters from the string that are
2187
+ * not supported by the font of the given element.
2188
+ * @param text The text string to filter.
2189
+ * @param fontData An optional fontData object, when provided, we use the font table to determine glyphs that aren't provided and additionally strip these out also.
2190
+ * @returns A new string representing the passed string with unsupported characters removed.
2191
+ */
2192
+ filterUnsupportedCharacters: (text: string, fontData?: FontData) => string;
2193
+ getProcessedInput(input: string, stepData: TextStepData, customiseAllText: boolean): string;
2194
+ updateInputText(input: string, elements: TextboxElement[], step: Step<TextStepData>, workflowManager: WorkflowManager): TextUpdateResult;
2195
+ selectVariant(step: Step<TextStepData>, variant: VariantResource, workflowManager: WorkflowManager, setError: (status: boolean) => void, setHelperText: (text: string) => void): Promise<void>;
2196
+ textAlign: (stepData: TextStepData) => string;
2197
+ createTextFillSpotColor(colorOption: OptionResource, variant: VariantResource): TextFillSpotColor | undefined;
2198
+ private reload;
2199
+ private getDefaultColorVariant;
2200
+ private getDefaultColor;
2201
+ private getDefaultImageFillVariant;
2202
+ /**
2203
+ * Validates a string of text based on step confoiguration.
2204
+ * @param text The text to validate
2205
+ * @param step The step providing configuration
2206
+ * @param workflowManager Workflow manager for access to workflow state
2207
+ * @returns A list of errors. Empty if the text passes validation.
2208
+ */
2209
+ private getErrorsForText;
2210
+ private fontDataFromVariant;
2211
+ private selectVariantCommand;
2212
+ /**
2213
+ * When a text step specifies replaceable text, the text input by the user will replace
2214
+ * a specific token within a larger string of text specified in the step configuration. Otherwise
2215
+ * this function will just return the text it's given when the feature is disabled.
2216
+ */
2217
+ private injectReplaceableText;
2218
+ private createTextboxRegions;
2219
+ private generateTextChangeCommandsForRegion;
2220
+ /**
2221
+ * @deprecated
2222
+ */
2223
+ private changeInputTextWithRegion;
2224
+ }
2225
+ declare const textStepService: TextStepService;
2226
+
2227
+ declare class PictureStepService implements StepService<PictureStepData> {
2228
+ init(stepData: Step<PictureStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2229
+ private reload;
2230
+ selectVariant(stepData: Step<PictureStepData>, variant: VariantResource, workflowManager: WorkflowManager, setIsUpdating: (status: boolean) => void): Promise<void>;
2231
+ private selectVariantCommand;
2232
+ }
2233
+ declare const pictureStepService: PictureStepService;
2234
+
2235
+ declare class QuestionStepService implements StepService<QuestionStepData> {
2236
+ init(stepData: Step<QuestionStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2237
+ private reload;
2238
+ selectVariant(stepData: Step<QuestionStepData>, variantId: string, workflowManager: WorkflowManager): Promise<void>;
2239
+ private selectVariantLambda;
2240
+ }
2241
+ declare const questionStepService: QuestionStepService;
2242
+
2243
+ declare class ShapeStepService implements StepService<ShapeStepData> {
2244
+ readonly shapeFillId = "spiff-fill-shape";
2245
+ availableColours(stepData: Step<ShapeStepData>): Promise<{
2246
+ fill: string | undefined;
2247
+ stroke: string | undefined;
2248
+ variant: VariantResource;
2249
+ }[]>;
2250
+ setCustomColor(color: string, stepData: Step<ShapeStepData>, manager: WorkflowManager): void;
2251
+ init(stepData: Step<ShapeStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2252
+ selectVariant(stepData: Step<ShapeStepData>, colourOption: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
2253
+ private reload;
2254
+ private selectVariantCommand;
2255
+ }
2256
+ declare const shapeStepService: ShapeStepService;
2257
+
2258
+ declare class ModuleStepService implements StepService<ModuleStepData> {
2259
+ init(stepData: Step<ModuleStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2260
+ private reload;
2261
+ changeText(stepData: Step<ModuleStepData>, input: string, workflowManager: WorkflowManager, error: string, setError: (e: string) => void): Promise<void>;
2262
+ private changeTextCommand;
2263
+ private validateInput;
2264
+ }
2265
+ declare const moduleStepService: ModuleStepService;
2266
+
2267
+ declare class DigitalContentStepService implements StepService<DigitalContentStepData> {
2268
+ init(stepData: Step<DigitalContentStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
2269
+ private reload;
2270
+ regenerateQRCode(elements: RegionElement[], uploading: boolean, assetKey: string, url: string, workflowManager: WorkflowManager, stepData: Step<DigitalContentStepData>, setUrl: (finalUrl: string) => void, commandDispatcher: (command: CanvasCommand) => void, setIsRegenerating: (state: boolean) => void): Promise<void>;
2271
+ private regionElements;
2272
+ private command;
2273
+ }
2274
+ declare const digitalContentStepService: DigitalContentStepService;
2275
+
2276
+ declare class MockWorkflowManager implements WorkflowManager {
2277
+ getInitializationPromise(): Promise<void>;
2278
+ getProduct: () => Product;
2279
+ isInitialized(): boolean;
2280
+ getCommandContext: () => CommandContext;
2281
+ getAllLayoutData: () => LayoutState[];
2282
+ getMetadata: (stepName: string) => StepMetadata | undefined;
2283
+ getWorkflowMetadata: () => WorkflowMetadata;
2284
+ getStepStorage: (stepName: string) => StepStorage | undefined;
2285
+ getInformationResults(): InformationResult[];
2595
2286
  getVariationRecords(): VariationRecord[];
2596
2287
  reset(): Promise<void>;
2597
- updateStateWithServer(_getReducerState: () => _CommandState1): void;
2288
+ updateStateWithServer(_getReducerState: () => CommandState): void;
2598
2289
  addVariationRecord(_variationRecord: Omit<VariationRecord, "recordNumber">): {
2599
2290
  recordNumber: number;
2600
2291
  transactionId: string;
@@ -2603,7 +2294,7 @@ export class MockWorkflowManager implements WorkflowManager {
2603
2294
  getCurrentVariationRecord(): undefined;
2604
2295
  removeVariationRecord(_recordNumber: number): never[];
2605
2296
  outstandingRequestsPromise(): Promise<void>;
2606
- updateStateWithServerImmediate(_getReducerState: () => _CommandState1): Promise<void>;
2297
+ updateStateWithServerImmediate(_getReducerState: () => CommandState): Promise<void>;
2607
2298
  addPoller(_poller: Poller): void;
2608
2299
  addConfirmCallback(_callback: ConfirmCallback): void;
2609
2300
  addCurrentVariationCallback(_callback: CurrentVariationRecordCallback): void;
@@ -2618,7 +2309,7 @@ export class MockWorkflowManager implements WorkflowManager {
2618
2309
  addStepSpecificStorageCallback(_callback: StepSpecificStorageCallback, _stepName: string): void;
2619
2310
  addStorageCallback(_callback: StorageCallback): void;
2620
2311
  addVariationRecordsCallback(_callback: VariationRecordsCallback): void;
2621
- getCommandDispatcher(): (_command: _CanvasCommand1) => void;
2312
+ getCommandDispatcher(): (_command: CanvasCommand) => void;
2622
2313
  getLayouts(): never[];
2623
2314
  getLayoutPreviewService(): {
2624
2315
  getAll: () => Map<any, any>;
@@ -2656,17 +2347,311 @@ export class MockWorkflowManager implements WorkflowManager {
2656
2347
  setEditedStatus(_stepName: string, _status: boolean): void;
2657
2348
  setInformationResults(_results: InformationResult[]): void;
2658
2349
  setMandatoryFulfilled(_stepName: string, _status: boolean): void;
2659
- setSelectionsAndElements(_stepName: string, _variants: _VariantResource1[], _elements: RegionElement[]): Promise<void>;
2350
+ setSelectionsAndElements(_stepName: string, _variants: VariantResource[], _elements: RegionElement[]): Promise<void>;
2660
2351
  setVariationRecords(_variationRecords: VariationRecord[]): void;
2661
2352
  toggleDesignConfirmed(): void;
2662
2353
  updateMetadata(_stepName: string, _update: any): void;
2663
- updateStorage(_stepName: string, _update: _StepStorage1): Promise<void>;
2354
+ updateStorage(_stepName: string, _update: StepStorage): Promise<void>;
2664
2355
  injectIntoPreviewService(_previewService: any): Promise<void>;
2665
2356
  ejectFromPreviewService(): void;
2666
2357
  }
2667
- export const TransformWrapper: React.FunctionComponent;
2668
- export { CommandContext };
2669
- export { AssetType, BringForwardCommand, BringToFrontCommand, BringToBackCommand, CanvasCommand, CreateElementCommand, CreateLayoutCommand, DeleteElementCommand, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, GroupCommand, LayoutElementFactory, LayoutElementType, MoveCommand, ResizeCommand, RotateCommand, SendBackwardsCommand, StepAspectType, StepType, TextChangeCommand, UnitOfMeasurement, dataUrlFromExternalUrl, findElement, frameDataCache, generate, getAxisAlignedBoundingBox, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, rehydrateSerializedLayout, getFrameData, getSvgElement, loadFontFromDataUrl, loadFontFromExternalUrl, determineCorrectFontSizeAndLines, patternImageDataCache, registerJSDOM };
2670
- export { Animatable, AnyStepData, Asset, BulkStepData, ColorProfileProps, ColorDefinition, CommandState, WorkflowPanel, DigitalContentStepData, FrameElement, FrameStepData, ILayout, IllustrationElement, IllustrationStepData, InformationStepData, ImageElement, LayoutData, LayoutElement, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, OptionResource, PictureStepData, QuestionStepData, ShapeStepData, Step, StepAspect, StepStorage, TextStepData, TextboxElement, Theme, VariantResource, Workflow };
2671
2358
 
2672
- //# sourceMappingURL=types.d.ts.map
2359
+ interface DesignInputStep {
2360
+ data: DesignInputStepData;
2361
+ name: string;
2362
+ }
2363
+ interface DesignInputStepData {
2364
+ }
2365
+
2366
+ declare const generateCommands: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<CanvasCommand[]>;
2367
+
2368
+ declare class IllustrationStepHandle extends StepHandle<IllustrationStepData> {
2369
+ constructor(manager: WorkflowManager, step: Step<IllustrationStepData>);
2370
+ /**
2371
+ * Allows for select a vector from the available vectors configured on this steps base option.
2372
+ * @param variant The new vector variant to use for this step.
2373
+ * @returns A promise that can be awaited to know when the new vector asset has been updated on the design.
2374
+ */
2375
+ selectVariant(variant: Variant): Promise<void>;
2376
+ /**
2377
+ * Get colors for the illustration.
2378
+ * @returns A list of color definitions that are currently applied to the illustration.
2379
+ */
2380
+ getColors(): {
2381
+ [key: string]: _spiffcommerce_papyrus.ColorDefinition;
2382
+ } | undefined;
2383
+ /**
2384
+ * Set color for the illustration.
2385
+ */
2386
+ setColor(key: string, value: string): Promise<void>;
2387
+ getColorOption(): Promise<_spiffcommerce_papyrus.OptionResource | undefined>;
2388
+ getAvailableColors(): Promise<{
2389
+ fill: string | undefined;
2390
+ stroke: string | undefined;
2391
+ variant: _spiffcommerce_papyrus.VariantResource;
2392
+ }[] | undefined>;
2393
+ hasVaryingSelection(): boolean | undefined;
2394
+ hasVaryingColors(): boolean | undefined;
2395
+ isColorPickerEnabled(): boolean | undefined;
2396
+ }
2397
+
2398
+ interface TextChangeResult {
2399
+ input: string;
2400
+ helperText?: string;
2401
+ errorText?: string;
2402
+ }
2403
+ declare class TextStepHandle extends StepHandle<TextStepData> {
2404
+ constructor(manager: WorkflowManager, step: Step<TextStepData>);
2405
+ /**
2406
+ * Allows for select a font from the available fonts configured on this steps base option.
2407
+ * @param variant The font variant to use.
2408
+ */
2409
+ selectVariant(variant: Variant): Promise<void>;
2410
+ /**
2411
+ * @returns A list of colors that can be used to fill the text.
2412
+ */
2413
+ getAvailableFillColors(): ColorOption[];
2414
+ /**
2415
+ * Changes the fill of text related to this step to the new fill value.
2416
+ * @param fill A new fill value to use.
2417
+ */
2418
+ setFillColor(fill: ColorOption): Promise<void>;
2419
+ /**
2420
+ * Gets the color currently applied to the element.
2421
+ */
2422
+ getFillColor(): string;
2423
+ getAvailableFillImages(): Promise<TextFillImage[]>;
2424
+ setFillImage(fillImage: TextFillImage): Promise<void>;
2425
+ getFillImage(): TextFillImage | undefined;
2426
+ /**
2427
+ * When true & the step has replaceable text configured the user will be
2428
+ * abled to edit the entire text string including the non-replaceable text.
2429
+ * @param shouldCustomizeAll When true the user can configure the entire text string.
2430
+ */
2431
+ setFullTextCustomization(shouldCustomizeAll: boolean): TextChangeResult;
2432
+ /**
2433
+ * Changes the text value of text related to this step to a new value.
2434
+ * @param userInput Input from the user.
2435
+ */
2436
+ setText(userInput: string): TextChangeResult;
2437
+ /**
2438
+ * Gets the text currently applied to the elements of this step.
2439
+ */
2440
+ getText(): string;
2441
+ isReplaceable(): boolean | undefined;
2442
+ /**
2443
+ * Inform the step that now is the time to
2444
+ * clear default text if it should do so.
2445
+ * Returns a text change rwsult if a clear occurred.
2446
+ */
2447
+ clearDefaultTextIfNecessary(): TextChangeResult | undefined;
2448
+ hasVaryingText(): boolean | undefined;
2449
+ hasVaryingColor(): boolean | undefined;
2450
+ hasVaryingSelection(): boolean | undefined;
2451
+ hasColorPicker(): boolean | undefined;
2452
+ getRegions(): _spiffcommerce_papyrus.Region[];
2453
+ /**
2454
+ * Return the maximum characters allowed for
2455
+ * this step, or undefined if there is no limit.
2456
+ */
2457
+ getCharacterLimit(): number | undefined;
2458
+ /**
2459
+ * Return the remaining amount of characters that
2460
+ * the user is allowed to add, or undefined if there is no limit.
2461
+ */
2462
+ getCharactersRemaining(): number | undefined;
2463
+ }
2464
+
2465
+ declare class PictureStepHandle extends StepHandle<PictureStepData> {
2466
+ constructor(manager: WorkflowManager, step: Step<PictureStepData>);
2467
+ /**
2468
+ * Allows the user to select an image variant from the available variants configured on this steps base option.
2469
+ * @param variant The new image variant to use.
2470
+ * @returns A promise that can be awaited to ensure the new image asset has been updated on the design.
2471
+ */
2472
+ selectVariant(variant: Variant): Promise<void>;
2473
+ }
2474
+
2475
+ /**
2476
+ * A generic base class for custom errors that assigns the name
2477
+ * of the error class automatically. All custom errors should extend this.
2478
+ */
2479
+ declare abstract class CustomError extends Error {
2480
+ constructor(message: any);
2481
+ }
2482
+ /**
2483
+ * A custom class for categorising errors related to workflow configuration.
2484
+ */
2485
+ declare abstract class ConfigurationError extends CustomError {
2486
+ constructor(message: any);
2487
+ }
2488
+ /**
2489
+ * Thrown when an option was expected but not found in the workflow configuration or
2490
+ * the server returned a 404 for an option we expected.
2491
+ */
2492
+ declare class OptionNotFoundError extends ConfigurationError {
2493
+ readonly optionId: string;
2494
+ constructor(step: Step<AnyStepData>);
2495
+ }
2496
+ /**
2497
+ * Thrown when a layout is not found for a given region entity. This
2498
+ * can occur when panels are deleted from a workflow but steps are still relying
2499
+ * on the layout being present.
2500
+ */
2501
+ declare class LayoutNotFoundError extends ConfigurationError {
2502
+ readonly panelId: string;
2503
+ constructor(region: Region);
2504
+ }
2505
+ /**
2506
+ * Thrown when an asset is not found on a specific variant. This can occur when
2507
+ * the asset wasn't configured in hub and the variant is loaded in a workflow.
2508
+ */
2509
+ declare class AssetNotFoundError extends ConfigurationError {
2510
+ readonly variant: VariantResource;
2511
+ constructor(variant: VariantResource);
2512
+ }
2513
+ /**
2514
+ * Thrown when a resource is not found linked to a specific asset. This
2515
+ * can occur when generation of a resource fails or hasn't completed. Or may be
2516
+ * a sign of a misconfiguration.
2517
+ */
2518
+ declare class ResourceNotFoundError extends ConfigurationError {
2519
+ readonly asset: Asset;
2520
+ constructor(asset: Asset);
2521
+ }
2522
+ /**
2523
+ * Thrown when configuration is missing when it was expected. More generic
2524
+ * to cover remaining cases outside of the more specific ones such as options, variants & assets.
2525
+ */
2526
+ declare class MisconfigurationError extends ConfigurationError {
2527
+ readonly step: Step<AnyStepData>;
2528
+ constructor(step: Step<AnyStepData>, message: string);
2529
+ }
2530
+ /**
2531
+ * A custom class for categorising errors related to implementation of core.
2532
+ */
2533
+ declare abstract class ImplementationError extends CustomError {
2534
+ constructor(message: any);
2535
+ }
2536
+ /**
2537
+ * Thrown when we hit a case that we didn't expect to happen
2538
+ */
2539
+ declare class UnhandledBehaviorError extends ImplementationError {
2540
+ constructor(message: string);
2541
+ }
2542
+ /**
2543
+ * Thrown when we fail to parse something that we expected to be valid
2544
+ */
2545
+ declare class ParseError extends ImplementationError {
2546
+ constructor(message: string);
2547
+ }
2548
+
2549
+ declare class ModelStepHandle extends StepHandle<ModelStepData> {
2550
+ constructor(manager: WorkflowManager, step: Step<ModelStepData>);
2551
+ selectVariant(variant: Variant): Promise<void>;
2552
+ }
2553
+
2554
+ declare enum FrameStep {
2555
+ SelectFrame = "SelectFrame",
2556
+ SelectImage = "SelectImage",
2557
+ Position = "Position"
2558
+ }
2559
+ declare class FrameStepHandle extends StepHandle<FrameStepData> {
2560
+ constructor(manager: WorkflowManager, step: Step<FrameStepData>);
2561
+ private frameService;
2562
+ selectVariant(variant: Variant): Promise<void>;
2563
+ onFrameDataChanged(callback: (frameData: FrameData$1[]) => void): void;
2564
+ selectImage(asset: Asset): void;
2565
+ getImageData(): PatternImageData | undefined;
2566
+ getCurrentFrameStep(frameData: FrameData$1, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
2567
+ getFrameService(): FrameService | undefined;
2568
+ hasOverlayImageKey(): string | undefined;
2569
+ hasOverlayImageUrl(): any;
2570
+ hasVaryingUpload(): boolean | undefined;
2571
+ hasVaryingSelection(): boolean | undefined;
2572
+ }
2573
+
2574
+ declare class MaterialStepHandle extends StepHandle<MaterialStepData> {
2575
+ constructor(manager: WorkflowManager, step: Step<MaterialStepData>);
2576
+ selectVariant(variant: Variant): Promise<void>;
2577
+ }
2578
+
2579
+ declare class QuestionStepHandle extends StepHandle<QuestionStepData> {
2580
+ constructor(manager: WorkflowManager, step: Step<QuestionStepData>);
2581
+ selectVariant(variant: Variant): Promise<void>;
2582
+ /**
2583
+ * The way that this step expects to be rendered.
2584
+ */
2585
+ getDisplayType(): string | undefined;
2586
+ }
2587
+
2588
+ declare class ShapeStepHandle extends StepHandle<ShapeStepData> {
2589
+ constructor(manager: WorkflowManager, step: Step<ShapeStepData>);
2590
+ selectVariant(variant: Variant): Promise<void>;
2591
+ /**
2592
+ * Sets the color of the shape.
2593
+ * @param color The color option to use.
2594
+ * @returns A promise resolving when the color has changed in the design.
2595
+ * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
2596
+ */
2597
+ setColor(color: ColorOption): Promise<void>;
2598
+ /**
2599
+ * Get available colors for the shape.
2600
+ * @returns A list of color definitions that are currently applied to the illustration.
2601
+ */
2602
+ getColors(): Promise<{
2603
+ fill: string | undefined;
2604
+ stroke: string | undefined;
2605
+ variant: _spiffcommerce_papyrus.VariantResource;
2606
+ }[]>;
2607
+ /**
2608
+ * Allows for setting a custom color when the custom variant is selected. Will
2609
+ * throw when a non-custom variant is selected.
2610
+ */
2611
+ setCustomColor(color: string): void;
2612
+ getCustomColor(): string;
2613
+ }
2614
+
2615
+ declare class BulkStepHandle extends StepHandle<BulkStepData> {
2616
+ constructor(manager: WorkflowManager, step: Step<BulkStepData>);
2617
+ private transaction;
2618
+ selectVariant(): Promise<void>;
2619
+ setDesignName(designName: string): Promise<void>;
2620
+ addVariationRecord(): VariationRecord;
2621
+ updateBulkIsConnected(bulkIsConnected: boolean): void;
2622
+ /**
2623
+ * Opens the bulk source in a seperate tab. This bulk source could be a google sheet or a csv file.
2624
+ */
2625
+ openBulkSourceUrl(): void;
2626
+ sendGoogleSheetLinkToEmail(email: string): Promise<void>;
2627
+ /**
2628
+ * Removes a variation from the bulk step.
2629
+ * @param recordNumber The record number of the variation to remove.
2630
+ */
2631
+ deleteVariationRecord(recordNumber: number): void;
2632
+ /**
2633
+ * @returns The aspects of each step that are modifiable from the bulk handle. These are configured in the workflow.
2634
+ */
2635
+ getAspects(): _spiffcommerce_papyrus.StepAspect[];
2636
+ }
2637
+
2638
+ declare const shortenUrl: (longUrl: string) => Promise<string>;
2639
+
2640
+ declare class InformationStepHandle extends StepHandle<InformationStepData> {
2641
+ constructor(manager: WorkflowManager, step: Step<InformationStepData>);
2642
+ selectVariant(): Promise<void>;
2643
+ /**
2644
+ * The way that this step expects to be rendered.
2645
+ */
2646
+ getContent(): string;
2647
+ }
2648
+
2649
+ interface StepAspectValue {
2650
+ stepName: string;
2651
+ stepAspectType: string;
2652
+ value?: string;
2653
+ }
2654
+ declare const stepAspectValuesToDesignInputSteps: (stepAspectValues: StepAspectValue[], workflow: Workflow) => DesignInputStep[];
2655
+ declare const generateStateFromDesignInputSteps: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<LayoutsState>;
2656
+
2657
+ export { AssetNotFoundError, BulkPriceCalculationStrategy, BulkStepHandle, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FrameService, FrameStep, FrameStepHandle, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, UnhandledBehaviorError, Variant, VariationRecord, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, gatherVaryingStepAspects, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };