@spiffcommerce/core 0.9.11 → 0.10.1
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 +2 -2
- package/dist/module.js +2 -2
- package/dist/types.d.ts +32 -2
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, FrameOffsets, PatternImageData, IServerModel, Asset as _Asset1, MaterialResource, AssetType as _AssetType1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, Region, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, IllustrationElement as _IllustrationElement1, LayoutsState as _LayoutsState1,
|
|
1
|
+
import { Workflow as _Workflow1, StepAspect as _StepAspect1, Step as _Step1, AnyStepData as _AnyStepData1, FrameOffsets, PatternImageData, IServerModel, Asset as _Asset1, MaterialResource, AssetType as _AssetType1, VariantResource as _VariantResource1, ColorDefinition as _ColorDefinition1, IllustrationStepData as _IllustrationStepData1, Region, ILayout as _ILayout1, CreateElementCommand as _CreateElementCommand1, IllustrationElement as _IllustrationElement1, LayoutsState as _LayoutsState1, CanvasCommand as _CanvasCommand1, LayoutData as _LayoutData1, DigitalContentStepData as _DigitalContentStepData1, FrameStepData as _FrameStepData1, FrameElement as _FrameElement1, MaterialStepData as _MaterialStepData1, ModelStepData as _ModelStepData1, ModuleStepData as _ModuleStepData1, PatchworkStepData as _PatchworkStepData1, PatchworkOffsets as _PatchworkOffsets1, 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, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, Animatable, AnyStepData, Asset, AssetType, BringForwardCommand, 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, PatchworkElement, PatchworkOffsets, PatchworkStepData, PictureStepData, QuestionStepData, ResizeCommand, RotateCommand, SendBackwardsCommand, ShapeStepData, Step, StepAspect, StepAspectType, StepStorage, StepType, TextChangeCommand, TextStepData, TextboxElement, UnitOfMeasurement, VariantResource, Workflow, dataUrlFromExternalUrl, findElement, frameDataCache, generate, generateSVGWithUnknownColors, getAttributesFromArrayBuffer, getFrameData, getSvgString, loadFontFromDataUrl, loadFontFromExternalUrl, patternImageDataCache, CreateLayoutCommand, rehydrateSerializedLayout, ColorProfileProps, WorkflowPanel, determineCorrectFontSizeAndLines, registerJSDOM } from "@spiffcommerce/papyrus";
|
|
2
2
|
import { ApolloClient } from "@apollo/client";
|
|
3
3
|
import { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent, MouseEvent } from "react";
|
|
4
4
|
export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
|
|
@@ -208,6 +208,13 @@ declare class AssetService {
|
|
|
208
208
|
* Convert a File object for an image into a FileInfo.
|
|
209
209
|
*/
|
|
210
210
|
loadImageAsFileInfo: (file: File) => Promise<FileInfo>;
|
|
211
|
+
/**
|
|
212
|
+
* Search for the asset of a variant. First looks for an asset inlined in the variant,
|
|
213
|
+
* otherwise check for ID in our cache and go to the server as a last resort.
|
|
214
|
+
* @param variant The variant to search on.
|
|
215
|
+
* @returns An asset entity as a promise.
|
|
216
|
+
*/
|
|
217
|
+
getAssetFromVariant: (variant: _VariantResource1) => Promise<IServerModel<_Asset1>>;
|
|
211
218
|
}
|
|
212
219
|
interface PersistedAsset {
|
|
213
220
|
assetKey: string;
|
|
@@ -235,7 +242,7 @@ declare class IllustrationStepService implements StepService<_IllustrationStepDa
|
|
|
235
242
|
}[];
|
|
236
243
|
changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string>): Promise<_CanvasCommand1>;
|
|
237
244
|
changeColors(stepData: _Step1<_IllustrationStepData1>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => _LayoutData1[], newFills: Map<string, string>): Promise<void>;
|
|
238
|
-
selectVariant(stepData: _Step1<_IllustrationStepData1>, variant: _VariantResource1, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): void
|
|
245
|
+
selectVariant(stepData: _Step1<_IllustrationStepData1>, variant: _VariantResource1, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
|
|
239
246
|
}
|
|
240
247
|
export const svgObjectURL: (svg: string) => Promise<string>;
|
|
241
248
|
export const illustrationStepService: IllustrationStepService;
|
|
@@ -844,6 +851,13 @@ declare class OptionService {
|
|
|
844
851
|
* Returns all selected variants. This is used by the question step as multiple selections can be made.
|
|
845
852
|
*/
|
|
846
853
|
getSelectedVariants: (option: _OptionResource1 | undefined, selectedVariantIds: string[]) => _VariantResource1[];
|
|
854
|
+
/**
|
|
855
|
+
* Returns the option from a given step. When the option is inline, we return that.
|
|
856
|
+
* Otherwise look for an option ID, check our cache and go to the server as a last resort.
|
|
857
|
+
* @param step The step to find an option on.
|
|
858
|
+
* @returns An OptionResource in a promise.
|
|
859
|
+
*/
|
|
860
|
+
getOptionFromStep: (step: _Step1<_AnyStepData1>) => Promise<IServerModel<_OptionResource1>>;
|
|
847
861
|
}
|
|
848
862
|
export const optionService: OptionService;
|
|
849
863
|
export const CommandContextContext: import("react").Context<_CommandContext1>;
|
|
@@ -1055,9 +1069,25 @@ export const AdvancedEditor: FunctionComponent<{
|
|
|
1055
1069
|
* concepts instead of dealing with the underlying data structures.
|
|
1056
1070
|
*/
|
|
1057
1071
|
declare abstract class StepHandle<T extends _AnyStepData1> {
|
|
1072
|
+
/**
|
|
1073
|
+
* Access to the workflow manager this step is contained by.
|
|
1074
|
+
*/
|
|
1058
1075
|
protected readonly manager: WorkflowManager;
|
|
1076
|
+
/**
|
|
1077
|
+
* The step metadata, useful for determining logic based on configuration.
|
|
1078
|
+
*/
|
|
1059
1079
|
protected readonly step: _Step1<T>;
|
|
1060
1080
|
constructor(manager: WorkflowManager, step: _Step1<T>);
|
|
1081
|
+
/**
|
|
1082
|
+
* Set the current update state of this step. All step handles pointing to this step will
|
|
1083
|
+
* see this value.
|
|
1084
|
+
* @param value The new value
|
|
1085
|
+
*/
|
|
1086
|
+
protected setUpdateState(value: boolean): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* @returns Gets the current update state of this step. All step handles for this step will see this value.
|
|
1089
|
+
*/
|
|
1090
|
+
protected getUpdateState(): boolean;
|
|
1061
1091
|
/**
|
|
1062
1092
|
* Gets the currently selected variant, or undefined if no variant is selected.
|
|
1063
1093
|
*/
|