@spiffcommerce/core 0.10.214 → 0.10.216
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/main.js +592 -17
- package/dist/module.js +592 -17
- package/dist/types.d.ts +97 -173
- package/package.json +3 -4
package/dist/types.d.ts
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
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,
|
|
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, TextStepData as _TextStepData1, StepStorage as _StepStorage1, SerializableStep, CommandState as _CommandState1, CommandContext as _CommandContext1, LayoutState, MaterialResource, AssetType as _AssetType1, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, StepGroup, FrameData as _FrameData1, 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 } from "@spiffcommerce/papyrus";
|
|
2
2
|
import { ApolloClient } from "@apollo/client";
|
|
3
3
|
import React, { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
|
|
4
4
|
export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
|
|
5
|
-
declare class Configuration {
|
|
6
|
-
constructor();
|
|
7
|
-
getServerUrl(): string;
|
|
8
|
-
getServicesApiUrl(): string;
|
|
9
|
-
getHubUrl(): string;
|
|
10
|
-
setServerUrl(serverUrl: string): void;
|
|
11
|
-
setServicesApiUrl(servicesApiUrl: string): void;
|
|
12
|
-
setHubUrl(hubUrl: string): void;
|
|
13
|
-
addServerUrlCallback(callback: () => void): void;
|
|
14
|
-
}
|
|
15
|
-
export const spiffCoreConfiguration: Configuration;
|
|
16
|
-
declare class SwaggerServer implements ServerService {
|
|
17
|
-
constructor();
|
|
18
|
-
setUncachedOperations(operationIds: string[]): void;
|
|
19
|
-
execute(operationName: string, parameters?: object): Promise<ServerResponse>;
|
|
20
|
-
}
|
|
21
|
-
export const server: SwaggerServer;
|
|
22
|
-
declare class GraphQlManager {
|
|
23
|
-
constructor();
|
|
24
|
-
getShadowGraphqlClient(): ApolloClient<any>;
|
|
25
|
-
}
|
|
26
|
-
export const graphQlManager: GraphQlManager;
|
|
27
5
|
/**
|
|
28
6
|
* A renderable scene is a scene that can be displayed to the user. This is based on the workflow state.
|
|
29
7
|
*/
|
|
@@ -255,97 +233,22 @@ declare class Poller {
|
|
|
255
233
|
*/
|
|
256
234
|
constructor(predicate: () => Promise<boolean>, onSuccess: () => void, onFailure: () => void, interval?: number, maxAttempts?: number);
|
|
257
235
|
}
|
|
236
|
+
declare class Configuration {
|
|
237
|
+
constructor();
|
|
238
|
+
getServerUrl(): string;
|
|
239
|
+
getServicesApiUrl(): string;
|
|
240
|
+
getHubUrl(): string;
|
|
241
|
+
setServerUrl(serverUrl: string): void;
|
|
242
|
+
setServicesApiUrl(servicesApiUrl: string): void;
|
|
243
|
+
setHubUrl(hubUrl: string): void;
|
|
244
|
+
addServerUrlCallback(callback: () => void): void;
|
|
245
|
+
}
|
|
246
|
+
export const spiffCoreConfiguration: Configuration;
|
|
258
247
|
declare class DigitalContentStepService implements StepService<_DigitalContentStepData1> {
|
|
259
248
|
init(stepData: _Step1<_DigitalContentStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
260
249
|
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>;
|
|
261
250
|
}
|
|
262
251
|
export const digitalContentStepService: DigitalContentStepService;
|
|
263
|
-
interface StorageService {
|
|
264
|
-
/**
|
|
265
|
-
* Get a value.
|
|
266
|
-
* @param key The key to lookup the value with.
|
|
267
|
-
*/
|
|
268
|
-
get(key: string): string | undefined;
|
|
269
|
-
/**
|
|
270
|
-
* Set a value.
|
|
271
|
-
* @param key The key to set.
|
|
272
|
-
* @param val The new value.
|
|
273
|
-
*/
|
|
274
|
-
set(key: string, val: string): void;
|
|
275
|
-
/**
|
|
276
|
-
* Remove a value.
|
|
277
|
-
* @param key The key to remove, does nothing if the key doesn't exist.
|
|
278
|
-
*/
|
|
279
|
-
remove(key: string): void;
|
|
280
|
-
/**
|
|
281
|
-
* Get a map from persistence.
|
|
282
|
-
* @param key The key to search by.
|
|
283
|
-
*/
|
|
284
|
-
getMap<K = any, V = any>(key: string): Map<K, V> | undefined;
|
|
285
|
-
/**
|
|
286
|
-
* St a map into persistence.
|
|
287
|
-
* @param key The key to set the map at.
|
|
288
|
-
* @param val The map to set.
|
|
289
|
-
*/
|
|
290
|
-
setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
|
|
291
|
-
}
|
|
292
|
-
export const persistenceService: StorageService;
|
|
293
|
-
/**
|
|
294
|
-
* An asset manager provides a way to create and
|
|
295
|
-
* manage assets on the Spiff Commerce Platform.
|
|
296
|
-
*/
|
|
297
|
-
interface AssetManager {
|
|
298
|
-
/**
|
|
299
|
-
* Uploads a file to the Spiff Commerce Platform.
|
|
300
|
-
*/
|
|
301
|
-
uploadFile: (file: File, onProgress: (val: number) => void) => Promise<IServerModel<_Asset1>>;
|
|
302
|
-
}
|
|
303
|
-
declare class AssetService implements AssetManager {
|
|
304
|
-
constructor();
|
|
305
|
-
/**
|
|
306
|
-
* Allows for retrieving an asset, returns the option from a cache if possible.
|
|
307
|
-
* @param server The server service for making the request.
|
|
308
|
-
* @param id The asset key to be retrieved.
|
|
309
|
-
*/
|
|
310
|
-
getLocalOrFromServer(assetKey: string): Promise<IServerModel<_Asset1>>;
|
|
311
|
-
/**
|
|
312
|
-
* Allows for retrieving amaterial, returns the option from a cache if possible.
|
|
313
|
-
* @param server The server service for making the request.
|
|
314
|
-
* @param id The option ID to be retrieved.
|
|
315
|
-
*/
|
|
316
|
-
getMaterialLocalOrFromServer(id: string): Promise<IServerModel<MaterialResource>>;
|
|
317
|
-
/**
|
|
318
|
-
* Upload a user asset to the server. Using callbacks to notify important events.
|
|
319
|
-
* The asset will be stored via the persistence service for future access, if available.
|
|
320
|
-
*/
|
|
321
|
-
uploadAssetWithProgress(file: FileInfo, assetType: _AssetType1, onProgress: (val: number) => void, anonymous?: boolean, partnerId?: string): Promise<IServerModel<_Asset1>>;
|
|
322
|
-
uploadFile(file: File, onProgress: (val: number) => void): Promise<IServerModel<_Asset1>>;
|
|
323
|
-
removePersistedAsset(assetKey: string): void;
|
|
324
|
-
getPersistedAssets(): PersistedAsset[];
|
|
325
|
-
/**
|
|
326
|
-
* Convert a File object for an image into a FileInfo.
|
|
327
|
-
*/
|
|
328
|
-
loadImageAsFileInfo: (file: File) => Promise<FileInfo>;
|
|
329
|
-
/**
|
|
330
|
-
* Search for the asset of a variant. First looks for an asset inlined in the variant,
|
|
331
|
-
* otherwise check for ID in our cache and go to the server as a last resort.
|
|
332
|
-
* @param variant The variant to search on.
|
|
333
|
-
* @returns An asset entity as a promise.
|
|
334
|
-
*/
|
|
335
|
-
getAssetFromVariant: (variant: _VariantResource1) => Promise<IServerModel<_Asset1>>;
|
|
336
|
-
/**
|
|
337
|
-
* Search for the material of a variant. First looks for an material inlined in the variant,
|
|
338
|
-
* otherwise check for ID in our cache and go to the server as a last resort.
|
|
339
|
-
* @param variant The variant to search on.
|
|
340
|
-
* @returns A material entity as a promise.
|
|
341
|
-
*/
|
|
342
|
-
getMaterialFromVariant: (variant: _VariantResource1) => Promise<IServerModel<MaterialResource>>;
|
|
343
|
-
}
|
|
344
|
-
interface PersistedAsset {
|
|
345
|
-
assetKey: string;
|
|
346
|
-
src: string;
|
|
347
|
-
}
|
|
348
|
-
export const assetService: AssetService;
|
|
349
252
|
interface FrameCreateOpts {
|
|
350
253
|
stepName?: string;
|
|
351
254
|
frameData: FrameData;
|
|
@@ -357,7 +260,7 @@ interface FrameCreateOpts {
|
|
|
357
260
|
}
|
|
358
261
|
declare class FrameStepService implements StepService<_FrameStepData1> {
|
|
359
262
|
init(stepData: _Step1<_FrameStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
360
|
-
selectImage(stepData: _Step1<_FrameStepData1>, asset:
|
|
263
|
+
selectImage(stepData: _Step1<_FrameStepData1>, asset: _Asset1, workflowManager: WorkflowManager): void;
|
|
361
264
|
selectVariant(stepData: _Step1<_FrameStepData1>, variant: _VariantResource1 | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
362
265
|
getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: FrameCreateOpts): _CreateElementCommand1<_FrameElement1>;
|
|
363
266
|
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
@@ -417,7 +320,7 @@ declare class QuestionStepService implements StepService<_QuestionStepData1> {
|
|
|
417
320
|
}
|
|
418
321
|
export const questionStepService: QuestionStepService;
|
|
419
322
|
declare class ShapeStepService implements StepService<_ShapeStepData1> {
|
|
420
|
-
availableColours(stepData: _Step1<_ShapeStepData1
|
|
323
|
+
availableColours(stepData: _Step1<_ShapeStepData1>): Promise<{
|
|
421
324
|
fill: string | undefined;
|
|
422
325
|
stroke: string | undefined;
|
|
423
326
|
variant: _VariantResource1;
|
|
@@ -470,7 +373,7 @@ declare class TextStepService implements StepService<_TextStepData1> {
|
|
|
470
373
|
updateInputText(input: string, elements: _TextboxElement1[], step: _Step1<_TextStepData1>, workflowManager: WorkflowManager): TextUpdateResult;
|
|
471
374
|
selectVariant(step: _Step1<_TextStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setError: (status: boolean) => void, setHelperText: (text: string) => void): Promise<void>;
|
|
472
375
|
textAlign: (stepData: _TextStepData1) => string;
|
|
473
|
-
createTextFillSpotColor(colorOption:
|
|
376
|
+
createTextFillSpotColor(colorOption: _OptionResource1, variant: _VariantResource1): TextFillSpotColor | undefined;
|
|
474
377
|
}
|
|
475
378
|
export const textStepService: TextStepService;
|
|
476
379
|
declare abstract class ModuleProduct {
|
|
@@ -579,7 +482,6 @@ export interface WorkflowManager {
|
|
|
579
482
|
getMetadata: (stepName: string) => StepMetadata | undefined;
|
|
580
483
|
getWorkflowMetadata: () => WorkflowMetadata;
|
|
581
484
|
getInformationResults(): InformationResult[];
|
|
582
|
-
getServer(): ServerService;
|
|
583
485
|
getTransaction: () => Transaction;
|
|
584
486
|
setTransactionCustomerDetails: (details: {
|
|
585
487
|
email: string;
|
|
@@ -665,8 +567,6 @@ export interface DesignCreationMessage {
|
|
|
665
567
|
weight?: number;
|
|
666
568
|
designProductId?: string;
|
|
667
569
|
designProductVariantId?: string;
|
|
668
|
-
externalCartProductId?: string;
|
|
669
|
-
externalCartProductVariantId?: string;
|
|
670
570
|
event: string;
|
|
671
571
|
exportedData: ExportedData;
|
|
672
572
|
lineItemImageUrl: string;
|
|
@@ -743,25 +643,13 @@ export interface Transaction {
|
|
|
743
643
|
* to this transaction, null unless the createDesignProduct flag was set
|
|
744
644
|
* and the design was finalized using createDesign operation.
|
|
745
645
|
*/
|
|
746
|
-
/**@deprecated use externalCartProductVariantId instead of this moving forward */
|
|
747
646
|
externalDesignProductVariantId?: string;
|
|
748
647
|
/**
|
|
749
648
|
* The external product id representing the design product related
|
|
750
649
|
* to this transaction, null unless the createDesignProduct flag was set
|
|
751
650
|
* and the design was finalized using createDesign operation.
|
|
752
651
|
*/
|
|
753
|
-
/**@deprecated use externalCartProductId instead of this moving forward. */
|
|
754
652
|
externalDesignProductId?: string;
|
|
755
|
-
/**
|
|
756
|
-
* The external product id representing the product related to the transaction.
|
|
757
|
-
* This value can hold any type of transaction such as design and standard products.
|
|
758
|
-
*/
|
|
759
|
-
externalCartProductId?: string;
|
|
760
|
-
/**
|
|
761
|
-
* The external product variant id representing the product related to the transaction.
|
|
762
|
-
* This value can hold any type of transaction such as design and standard products.
|
|
763
|
-
*/
|
|
764
|
-
externalCartProductVariantId?: string;
|
|
765
653
|
priceModifierTotal?: number;
|
|
766
654
|
/**
|
|
767
655
|
* The amount of variations associated with this transaction.
|
|
@@ -772,6 +660,7 @@ export interface Transaction {
|
|
|
772
660
|
*/
|
|
773
661
|
workflowViewerLink?: string;
|
|
774
662
|
workflowViewerReadOnlyLink?: string;
|
|
663
|
+
previewImageLink?: string;
|
|
775
664
|
bulkSourceUrl?: string;
|
|
776
665
|
bulkEmailAddress?: string;
|
|
777
666
|
lastSyncedAt?: string;
|
|
@@ -815,6 +704,7 @@ interface Product {
|
|
|
815
704
|
*/
|
|
816
705
|
partnerId?: string;
|
|
817
706
|
partner?: {
|
|
707
|
+
currencyCode?: string;
|
|
818
708
|
customerDetailsPromptMarkdown?: string;
|
|
819
709
|
};
|
|
820
710
|
/**
|
|
@@ -945,29 +835,6 @@ export interface TextStepStorage extends SelectionStorage {
|
|
|
945
835
|
type StepSelections = {
|
|
946
836
|
[key: string]: SelectionStorage;
|
|
947
837
|
};
|
|
948
|
-
interface ServerResponse {
|
|
949
|
-
/**
|
|
950
|
-
* Will contain error information if an error was recieved
|
|
951
|
-
*/
|
|
952
|
-
errors?: string[];
|
|
953
|
-
/**
|
|
954
|
-
* The body of the response containing any return data.
|
|
955
|
-
*/
|
|
956
|
-
body: any;
|
|
957
|
-
headers: {
|
|
958
|
-
"content-type": string;
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
interface ServerService {
|
|
962
|
-
/**
|
|
963
|
-
* Sets the operation names that should be converted to their correspondingun-cached equivelants.
|
|
964
|
-
*/
|
|
965
|
-
setUncachedOperations: (operationIds: string[]) => void;
|
|
966
|
-
/**
|
|
967
|
-
* Execute an operation against the server.
|
|
968
|
-
*/
|
|
969
|
-
execute: (operationId: string, operationParameters?: object, anonymous?: boolean) => Promise<ServerResponse>;
|
|
970
|
-
}
|
|
971
838
|
interface FrameData {
|
|
972
839
|
/**
|
|
973
840
|
* The path data for a frame SVG
|
|
@@ -990,13 +857,85 @@ export enum ProductCameraRig {
|
|
|
990
857
|
Orbit = 0,
|
|
991
858
|
Pan = 1
|
|
992
859
|
}
|
|
860
|
+
interface StorageService {
|
|
861
|
+
/**
|
|
862
|
+
* Get a value.
|
|
863
|
+
* @param key The key to lookup the value with.
|
|
864
|
+
*/
|
|
865
|
+
get(key: string): string | undefined;
|
|
866
|
+
/**
|
|
867
|
+
* Set a value.
|
|
868
|
+
* @param key The key to set.
|
|
869
|
+
* @param val The new value.
|
|
870
|
+
*/
|
|
871
|
+
set(key: string, val: string): void;
|
|
872
|
+
/**
|
|
873
|
+
* Remove a value.
|
|
874
|
+
* @param key The key to remove, does nothing if the key doesn't exist.
|
|
875
|
+
*/
|
|
876
|
+
remove(key: string): void;
|
|
877
|
+
/**
|
|
878
|
+
* Get a map from persistence.
|
|
879
|
+
* @param key The key to search by.
|
|
880
|
+
*/
|
|
881
|
+
getMap<K = any, V = any>(key: string): Map<K, V> | undefined;
|
|
882
|
+
/**
|
|
883
|
+
* St a map into persistence.
|
|
884
|
+
* @param key The key to set the map at.
|
|
885
|
+
* @param val The map to set.
|
|
886
|
+
*/
|
|
887
|
+
setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
|
|
888
|
+
}
|
|
889
|
+
export const persistenceService: StorageService;
|
|
890
|
+
declare class GraphQlManager {
|
|
891
|
+
constructor();
|
|
892
|
+
getShadowGraphqlClient(): ApolloClient<any>;
|
|
893
|
+
}
|
|
894
|
+
export const graphQlManager: GraphQlManager;
|
|
895
|
+
/**
|
|
896
|
+
* An asset manager provides a way to create and
|
|
897
|
+
* manage assets on the Spiff Commerce Platform.
|
|
898
|
+
*/
|
|
899
|
+
interface AssetManager {
|
|
900
|
+
/**
|
|
901
|
+
* Uploads a file to the Spiff Commerce Platform.
|
|
902
|
+
*/
|
|
903
|
+
uploadFile: (file: File, onProgress: (val: number) => void) => Promise<_Asset1>;
|
|
904
|
+
}
|
|
905
|
+
declare class AssetService implements AssetManager {
|
|
906
|
+
/**
|
|
907
|
+
* Allows for retrieving an asset, returns the option from a cache if possible.
|
|
908
|
+
*/
|
|
909
|
+
getLocalOrFromServer(assetKey: string): Promise<_Asset1>;
|
|
910
|
+
/**
|
|
911
|
+
* Allows for retrieving amaterial, returns the option from a cache if possible.
|
|
912
|
+
* @param id The option ID to be retrieved.
|
|
913
|
+
*/
|
|
914
|
+
getMaterialLocalOrFromServer(id: string): Promise<MaterialResource>;
|
|
915
|
+
/**
|
|
916
|
+
* Upload a user asset to the server. Using callbacks to notify important events.
|
|
917
|
+
* The asset will be stored via the persistence service for future access, if available.
|
|
918
|
+
*/
|
|
919
|
+
uploadAssetWithProgress(file: FileInfo, assetType: _AssetType1, onProgress: (val: number) => void, anonymous?: boolean): Promise<_Asset1>;
|
|
920
|
+
uploadFile(file: File, onProgress: (val: number) => void): Promise<_Asset1>;
|
|
921
|
+
removePersistedAsset(assetKey: string): void;
|
|
922
|
+
getPersistedAssets(): PersistedAsset[];
|
|
923
|
+
/**
|
|
924
|
+
* Convert a File object for an image into a FileInfo.
|
|
925
|
+
*/
|
|
926
|
+
loadImageAsFileInfo: (file: File) => Promise<FileInfo>;
|
|
927
|
+
}
|
|
928
|
+
interface PersistedAsset {
|
|
929
|
+
assetKey: string;
|
|
930
|
+
src: string;
|
|
931
|
+
}
|
|
932
|
+
export const assetService: AssetService;
|
|
993
933
|
declare class OptionService {
|
|
994
934
|
/**
|
|
995
935
|
* Allows for retrieving an option, returns the option from a cache if possible.
|
|
996
|
-
* @param server The server service for making the request.
|
|
997
936
|
* @param id The option ID to be retrieved.
|
|
998
937
|
*/
|
|
999
|
-
getOption(
|
|
938
|
+
getOption(id: string): Promise<undefined | _OptionResource1>;
|
|
1000
939
|
getAssetTileImageForVariant(variant: _VariantResource1): Promise<string>;
|
|
1001
940
|
getDefaultVariant(option: _OptionResource1): _VariantResource1 | undefined;
|
|
1002
941
|
getDisplayImageSource: (variant?: _VariantResource1) => undefined | string;
|
|
@@ -1004,17 +943,6 @@ declare class OptionService {
|
|
|
1004
943
|
* Returns the first variant marked as selected. This is used by most steps.
|
|
1005
944
|
*/
|
|
1006
945
|
getSelectedVariant: (option: _OptionResource1 | undefined, selectedVariantIds: string[]) => _VariantResource1 | undefined;
|
|
1007
|
-
/**
|
|
1008
|
-
* Returns all selected variants. This is used by the question step as multiple selections can be made.
|
|
1009
|
-
*/
|
|
1010
|
-
getSelectedVariants: (option: _OptionResource1 | undefined, selectedVariantIds: string[]) => _VariantResource1[];
|
|
1011
|
-
/**
|
|
1012
|
-
* Returns the option from a given step. When the option is inline, we return that.
|
|
1013
|
-
* Otherwise look for an option ID, check our cache and go to the server as a last resort.
|
|
1014
|
-
* @param step The step to find an option on.
|
|
1015
|
-
* @returns An OptionResource in a promise.
|
|
1016
|
-
*/
|
|
1017
|
-
getOptionFromStep: (step: _Step1<_AnyStepData1>, server: ServerService) => Promise<IServerModel<_OptionResource1> | undefined>;
|
|
1018
946
|
}
|
|
1019
947
|
export const optionService: OptionService;
|
|
1020
948
|
export const CommandContextContext: import("react").Context<_CommandContext1>;
|
|
@@ -1190,7 +1118,7 @@ export interface DesignInputStep {
|
|
|
1190
1118
|
}
|
|
1191
1119
|
interface DesignInputStepData {
|
|
1192
1120
|
}
|
|
1193
|
-
export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[],
|
|
1121
|
+
export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
|
|
1194
1122
|
export const EditorCore: FunctionComponent<{
|
|
1195
1123
|
isMobile: boolean;
|
|
1196
1124
|
color?: string;
|
|
@@ -1342,7 +1270,7 @@ export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
|
|
|
1342
1270
|
* Set color for the illustration.
|
|
1343
1271
|
*/
|
|
1344
1272
|
setColor(key: string, value: string): Promise<void>;
|
|
1345
|
-
getColorOption(): Promise<import("@spiffcommerce/papyrus").
|
|
1273
|
+
getColorOption(): Promise<import("@spiffcommerce/papyrus").OptionResource | undefined>;
|
|
1346
1274
|
getAvailableColors(): Promise<{
|
|
1347
1275
|
fill: string | undefined;
|
|
1348
1276
|
stroke: string | undefined;
|
|
@@ -1350,7 +1278,7 @@ export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
|
|
|
1350
1278
|
}[]>;
|
|
1351
1279
|
hasVaryingSelection(): boolean | undefined;
|
|
1352
1280
|
hasVaryingColors(): boolean | undefined;
|
|
1353
|
-
isColorPickerEnabled(): boolean;
|
|
1281
|
+
isColorPickerEnabled(): boolean | undefined;
|
|
1354
1282
|
}
|
|
1355
1283
|
export class MaterialStepHandle extends StepHandle<_MaterialStepData1> {
|
|
1356
1284
|
constructor(manager: WorkflowManager, step: _Step1<_MaterialStepData1>);
|
|
@@ -1625,10 +1553,6 @@ interface ClientOptions {
|
|
|
1625
1553
|
* containing multiple variations of the base design.
|
|
1626
1554
|
*/
|
|
1627
1555
|
bulk?: boolean;
|
|
1628
|
-
/**
|
|
1629
|
-
* When set to true caching will be disabled. This is only useful for debugging. Don't use in production code!
|
|
1630
|
-
*/
|
|
1631
|
-
useUncachedEndpoints?: boolean;
|
|
1632
1556
|
}
|
|
1633
1557
|
/**
|
|
1634
1558
|
* The Spiff Commerce Javascript Client. Required for
|
|
@@ -1641,6 +1565,7 @@ export class SpiffCommerceClient {
|
|
|
1641
1565
|
* and the Spiff Commerce platform.
|
|
1642
1566
|
*/
|
|
1643
1567
|
getAssetManager(): AssetManager;
|
|
1568
|
+
getCurrencyCode(): string;
|
|
1644
1569
|
/**
|
|
1645
1570
|
* Initialize the client from an integration product.
|
|
1646
1571
|
* @param integrationProductId The integration product to use.
|
|
@@ -1659,7 +1584,7 @@ export class SpiffCommerceClient {
|
|
|
1659
1584
|
* @param previewServiceConstructor A function called during initialization. Takes a class implementing ThreeDPreviewService in return.
|
|
1660
1585
|
* @returns A workflow experience configured as requested.
|
|
1661
1586
|
*/
|
|
1662
|
-
getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any
|
|
1587
|
+
getWorkflowExperience(workflowId?: string, workflowState?: string, previewServiceConstructor?: (workflow: _Workflow1) => any): Promise<WorkflowExperience>;
|
|
1663
1588
|
/**
|
|
1664
1589
|
* @returns The preview service that was provided during construction.
|
|
1665
1590
|
*/
|
|
@@ -1674,7 +1599,6 @@ export class SpiffCommerceClient {
|
|
|
1674
1599
|
getTransaction(): Transaction;
|
|
1675
1600
|
}
|
|
1676
1601
|
export class MockWorkflowManager implements WorkflowManager {
|
|
1677
|
-
getServer(): ServerService;
|
|
1678
1602
|
getInitializationPromise(): Promise<void>;
|
|
1679
1603
|
getProduct: () => Product;
|
|
1680
1604
|
isInitialized(): boolean;
|
|
@@ -1759,7 +1683,7 @@ export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
|
1759
1683
|
constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
|
|
1760
1684
|
selectVariant(variant: _VariantResource1): Promise<void>;
|
|
1761
1685
|
onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
|
|
1762
|
-
selectImage(asset:
|
|
1686
|
+
selectImage(asset: _Asset1): void;
|
|
1763
1687
|
getImageData(): PatternImageData | undefined;
|
|
1764
1688
|
getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
|
|
1765
1689
|
getFrameService(): FrameService | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.216",
|
|
4
4
|
"description": "Core client API for interacting with the Spiff Commerce backend.",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@apollo/client": "^3.7.0",
|
|
88
|
-
"@spiffcommerce/papyrus": "
|
|
88
|
+
"@spiffcommerce/papyrus": "1.5.64",
|
|
89
89
|
"canvg": "https://github.com/spiffdev/canvg.git#03bcd151b12441e88ecb552bb658356f5bbe92c4",
|
|
90
90
|
"cross-fetch": "^3.1.5",
|
|
91
91
|
"graphql": "^16.6.0",
|
|
@@ -93,7 +93,6 @@
|
|
|
93
93
|
"lodash.debounce": "^4.0.8",
|
|
94
94
|
"lodash.isequal": "^4.5.0",
|
|
95
95
|
"qrcode": "^1.5.1",
|
|
96
|
-
"svg-path-bbox": "^1.2.2"
|
|
97
|
-
"swagger-client": "3.18.5"
|
|
96
|
+
"svg-path-bbox": "^1.2.2"
|
|
98
97
|
}
|
|
99
98
|
}
|