@spiffcommerce/core 20.1.0-beta.3 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -58
- package/dist/index.js +324 -324
- package/dist/index.umd.cjs +29 -29
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ declare class PromiseQueue<T extends QueueablePromise> {
|
|
|
137
137
|
* @param mustCover When true the image sgould be bounded in such a way that it covers the entire frame at all times.
|
|
138
138
|
*/
|
|
139
139
|
declare function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
|
|
140
|
-
declare class FrameService
|
|
140
|
+
declare class FrameService {
|
|
141
141
|
private offsets;
|
|
142
142
|
private thresholdSettings;
|
|
143
143
|
private forceImageCover?;
|
|
@@ -379,7 +379,7 @@ declare enum InformationMessageType {
|
|
|
379
379
|
* Services required for the operaiton of individual steps.
|
|
380
380
|
*/
|
|
381
381
|
interface StepSpecificServices {
|
|
382
|
-
frameService?: FrameService
|
|
382
|
+
frameService?: FrameService;
|
|
383
383
|
module?: ModuleProduct;
|
|
384
384
|
}
|
|
385
385
|
type DesignCreationProgressUpdate = (message: string) => void;
|
|
@@ -2141,6 +2141,7 @@ declare class IntegrationProduct {
|
|
|
2141
2141
|
getResource(): IntegrationProductResource;
|
|
2142
2142
|
getBasePrice(): number;
|
|
2143
2143
|
getDefaultWorkflow(): ProductWorkflow;
|
|
2144
|
+
getAllWorkflows(): ProductWorkflow[];
|
|
2144
2145
|
}
|
|
2145
2146
|
|
|
2146
2147
|
declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
|
|
@@ -2378,6 +2379,7 @@ declare class SpiffCommerceClient {
|
|
|
2378
2379
|
* @returns The transaction associated with this client.
|
|
2379
2380
|
*/
|
|
2380
2381
|
getTransaction(): Transaction;
|
|
2382
|
+
configureUrls(hubUrl: string, serverUrl: string, servicesApiUrl: string): void;
|
|
2381
2383
|
/**
|
|
2382
2384
|
* A function used to synchronize transaction state with the server.
|
|
2383
2385
|
* @param options New state details. To be spread into the query.
|
|
@@ -2438,7 +2440,7 @@ declare class FrameStepService implements StepService<FrameStepData> {
|
|
|
2438
2440
|
selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager): void;
|
|
2439
2441
|
selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
2440
2442
|
getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
|
|
2441
|
-
loadPatternFromString(src: string, frameService: FrameService
|
|
2443
|
+
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
2442
2444
|
private selectVariantCommand;
|
|
2443
2445
|
private frameSourceSvg;
|
|
2444
2446
|
/**
|
|
@@ -2881,7 +2883,7 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
|
|
|
2881
2883
|
selectImage(asset: Asset): void;
|
|
2882
2884
|
getImageData(): PatternImageData | undefined;
|
|
2883
2885
|
getCurrentFrameStep(frameData: FrameData$1, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
|
|
2884
|
-
getFrameService(): FrameService
|
|
2886
|
+
getFrameService(): FrameService | undefined;
|
|
2885
2887
|
hasOverlayImageKey(): string | undefined;
|
|
2886
2888
|
hasOverlayImageUrl(): any;
|
|
2887
2889
|
}
|
|
@@ -2961,57 +2963,4 @@ declare class PromiseCache {
|
|
|
2961
2963
|
}
|
|
2962
2964
|
declare const promiseCache: PromiseCache;
|
|
2963
2965
|
|
|
2964
|
-
|
|
2965
|
-
/**
|
|
2966
|
-
* This event is sent when the frame has encountered an error.
|
|
2967
|
-
*/
|
|
2968
|
-
interface ErrorEvent {
|
|
2969
|
-
event: "OnError";
|
|
2970
|
-
data: Error;
|
|
2971
|
-
}
|
|
2972
|
-
/**
|
|
2973
|
-
* This event is sent when the user has clicked a close button within the frame.
|
|
2974
|
-
*/
|
|
2975
|
-
interface CancelEvent {
|
|
2976
|
-
event: "OnCancel";
|
|
2977
|
-
}
|
|
2978
|
-
/**
|
|
2979
|
-
* This event is sent when the content in the frame is loaded and ready to display. As
|
|
2980
|
-
* the point at which the content is considered 'loaded' can vary between themes, we require the theme developer to report it.
|
|
2981
|
-
*/
|
|
2982
|
-
interface LoadEvent {
|
|
2983
|
-
event: "OnLoad";
|
|
2984
|
-
}
|
|
2985
|
-
/**
|
|
2986
|
-
* This event is sent when the user has completed the transaction in the frame and is passing back information to the parent.
|
|
2987
|
-
*/
|
|
2988
|
-
interface TransactionCompleteEvent {
|
|
2989
|
-
event: "OnComplete";
|
|
2990
|
-
}
|
|
2991
|
-
/**
|
|
2992
|
-
* This event is sent when the user has completed the bundle experience in the frame and is passing back information to the parent.
|
|
2993
|
-
*/
|
|
2994
|
-
interface BundleCompleteEvent {
|
|
2995
|
-
bundleId: string;
|
|
2996
|
-
items: TransactionCompleteEvent[];
|
|
2997
|
-
event: "OnComplete";
|
|
2998
|
-
}
|
|
2999
|
-
/**
|
|
3000
|
-
* A union of the various frame events that can be sent to the parent window.
|
|
3001
|
-
*/
|
|
3002
|
-
type FrameEvent = BundleCompleteEvent | (TransactionCompleteEvent & DesignCreationMessage) | CancelEvent | ErrorEvent | LoadEvent;
|
|
3003
|
-
/**
|
|
3004
|
-
* Service for communicating with the parent window. Wraps calls to `window.parent.postMessage` and provides strongly typed events.
|
|
3005
|
-
*/
|
|
3006
|
-
declare class FrameService {
|
|
3007
|
-
/**
|
|
3008
|
-
* * Send a message to the parent window.
|
|
3009
|
-
* We don't currently know the domain of the parent window in a secure way so we use `window.parent.origin` to send the message.
|
|
3010
|
-
* FIXME: One day in the future let's build a whitelist or something similar that can be used to validate the origin of the parent window.
|
|
3011
|
-
* @param event The event to send. Must be strongly typed as one of the FrameEvent types.
|
|
3012
|
-
*/
|
|
3013
|
-
postMessage(event: FrameEvent): void;
|
|
3014
|
-
}
|
|
3015
|
-
declare const frameService: FrameService;
|
|
3016
|
-
|
|
3017
|
-
export { ArrayInput, AssetNotFoundError, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameEventType, FrameService$1 as FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
|
|
2966
|
+
export { ArrayInput, AssetNotFoundError, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextInput, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
|