@spiffcommerce/core 21.9.0-alpha.0 → 21.9.0-alpha.10
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 +57 -5
- package/dist/index.js +2358 -2128
- package/dist/index.umd.cjs +92 -79
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _spiffcommerce_papyrus from '@spiffcommerce/papyrus';
|
|
2
|
-
import { OptionResource, VariantResource, Step, AnyStepData, FrameOffsets, PatternImageData, Region, Workflow, ILayout, LayoutsState, LayoutData, SilentStepData, Placeable, StepStorage, CanvasCommand, CommandContext, LayoutState, SerializableStep, CommandState, GlobalPropertyConfiguration, Asset, MaterialResource, AssetType, StepType,
|
|
2
|
+
import { OptionResource, VariantResource, Step, AnyStepData, FrameOffsets, PatternImageData, Region, Workflow, ILayout, LayoutsState, LayoutData, SilentStepData, Placeable, StepStorage, CanvasCommand, CommandContext, LayoutState, SerializableStep, CommandState, GlobalPropertyConfiguration, AspectType, Asset, MaterialResource, AssetType, StepType, GlobalPropertyConfigurationAspect, Theme, FrameStepData, CreateElementCommand, FrameElement, IllustrationStepData, IllustrationElement, ColorDefinition, MaterialStepData, ModelStepData, TextStepData, TextboxElement, TextFillImage, FontData, GroupCommand, PictureStepData, QuestionStepData, ShapeStepData, ModuleStepData, DigitalContentStepData, FrameData as FrameData$1, InformationStepData } from '@spiffcommerce/papyrus';
|
|
3
3
|
export { Animatable, AnyStepData, AspectType, Asset, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, 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, loadFont, patternImageDataCache, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout, setCanvasModule } from '@spiffcommerce/papyrus';
|
|
4
4
|
import { ApolloClient, MutationOptions, FetchResult } from '@apollo/client/core';
|
|
5
5
|
import { RenderableContextService, RenderableContext, ThreeDPreviewService, ModelContainer } from '@spiffcommerce/preview';
|
|
@@ -1057,6 +1057,14 @@ type GlobalPropertyState = {
|
|
|
1057
1057
|
type GlobalPropertyStateAspect = {
|
|
1058
1058
|
name: string;
|
|
1059
1059
|
value: string;
|
|
1060
|
+
type?: AspectType;
|
|
1061
|
+
storage?: GlobalPropertyStateAspectStorage;
|
|
1062
|
+
};
|
|
1063
|
+
type GlobalPropertyStateAspectStorage = GlobalPropertyStateFileUploadStorage;
|
|
1064
|
+
type GlobalPropertyStateFileUploadStorage = {
|
|
1065
|
+
originalAssetKey?: string;
|
|
1066
|
+
backgroundRemovedAssetKey?: string;
|
|
1067
|
+
useOriginalAsset?: boolean;
|
|
1060
1068
|
};
|
|
1061
1069
|
interface BundleStateTransform {
|
|
1062
1070
|
position: Vector3;
|
|
@@ -1771,6 +1779,12 @@ declare class FileUploadGlobalPropertyHandle extends GlobalPropertyHandle {
|
|
|
1771
1779
|
* @returns A promise resolving when all affected steps have been updated.
|
|
1772
1780
|
*/
|
|
1773
1781
|
selectImage(asset: Asset): Promise<void>;
|
|
1782
|
+
/**
|
|
1783
|
+
* Removes the background from an image, stores it in the state, and returns the new asset.
|
|
1784
|
+
* @param applyNewAsset Optionally applies the new asset to all shared steps. Default: `true`.
|
|
1785
|
+
* @returns A promise that resolves with the newly generated Asset.
|
|
1786
|
+
*/
|
|
1787
|
+
removeBackgroundFromImage(applyNewAsset?: boolean): Promise<Asset>;
|
|
1774
1788
|
/**
|
|
1775
1789
|
* Returns `true` if the state has an image assigned, otherwise `false`.
|
|
1776
1790
|
*/
|
|
@@ -1780,8 +1794,21 @@ declare class FileUploadGlobalPropertyHandle extends GlobalPropertyHandle {
|
|
|
1780
1794
|
* @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
|
|
1781
1795
|
*/
|
|
1782
1796
|
getImage(): Promise<Asset | undefined>;
|
|
1797
|
+
/**
|
|
1798
|
+
* Retrieves the original, unmodified image selection, if one exists.
|
|
1799
|
+
* @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
|
|
1800
|
+
*/
|
|
1801
|
+
getOriginalImage(): Promise<Asset | undefined>;
|
|
1802
|
+
/**
|
|
1803
|
+
* Retrieves the version of the image selection that has the background removed, if one exists.
|
|
1804
|
+
* @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
|
|
1805
|
+
*/
|
|
1806
|
+
getBackgroundRemovedImage(): Promise<Asset | undefined>;
|
|
1807
|
+
getUseOriginalImage(): boolean;
|
|
1808
|
+
setUseOriginalImage(value: boolean): Promise<void>;
|
|
1783
1809
|
applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
|
|
1784
1810
|
private applyImageSelection;
|
|
1811
|
+
private updateSharedStepStorage;
|
|
1785
1812
|
}
|
|
1786
1813
|
declare class TextGlobalPropertyHandle extends GlobalPropertyHandle {
|
|
1787
1814
|
constructor(bundle: Bundle, property: GlobalPropertyConfigurationAspect);
|
|
@@ -1844,8 +1871,17 @@ interface GlobalPropertyStateManager {
|
|
|
1844
1871
|
getInitializationPromise(): Promise<void>;
|
|
1845
1872
|
getGlobalPropertyState(): GlobalPropertyState | undefined;
|
|
1846
1873
|
getAspect(name: string): string | undefined;
|
|
1847
|
-
|
|
1848
|
-
|
|
1874
|
+
getAspectStorage(name: string): GlobalPropertyStateAspectStorage | undefined;
|
|
1875
|
+
/**
|
|
1876
|
+
* Updates the value of a named aspect in the state.
|
|
1877
|
+
* @param name The name (key) of the aspect. This must match the key in the associated Global Property Config
|
|
1878
|
+
* @param value The value, represented as a string.
|
|
1879
|
+
* @param storage Optional: Additional data storage for the aspect. Not specifying this parameter, or providing `undefined`, will not update the
|
|
1880
|
+
* storage (if it already exists). Providing `null` will clear the existing storage.
|
|
1881
|
+
*/
|
|
1882
|
+
setAspect(name: string, value: string, storage?: GlobalPropertyStateAspectStorage | null): Promise<void>;
|
|
1883
|
+
setAspectStorage(name: string, storage: GlobalPropertyStateAspectStorage | null): Promise<void>;
|
|
1884
|
+
setBundleOptions(bundleOptions?: BundleOptions): void;
|
|
1849
1885
|
}
|
|
1850
1886
|
interface BundleOptions {
|
|
1851
1887
|
additionalHeaders?: {
|
|
@@ -2701,7 +2737,7 @@ interface FrameCreateOpts {
|
|
|
2701
2737
|
declare class FrameStepService implements StepService<FrameStepData> {
|
|
2702
2738
|
init(stepData: Step<FrameStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
|
|
2703
2739
|
private reload;
|
|
2704
|
-
selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager): void
|
|
2740
|
+
selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager): Promise<void>;
|
|
2705
2741
|
selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
2706
2742
|
getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
|
|
2707
2743
|
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
@@ -3144,12 +3180,28 @@ declare class FrameStepHandle extends StepHandle<FrameStepData> {
|
|
|
3144
3180
|
private frameService;
|
|
3145
3181
|
selectVariant(variant: Variant): Promise<void>;
|
|
3146
3182
|
onFrameDataChanged(callback: (frameData: FrameData$1[]) => void): void;
|
|
3147
|
-
|
|
3183
|
+
/**
|
|
3184
|
+
* Updates the image selection inside the frame.
|
|
3185
|
+
* @param asset The asset to use.
|
|
3186
|
+
* @param storeAsOriginal Optional: Store this asset as the original, unmodified version of the image. Default: `true`.
|
|
3187
|
+
*/
|
|
3188
|
+
selectImage(asset: Asset, storeAsOriginal?: boolean): Promise<void>;
|
|
3189
|
+
/**
|
|
3190
|
+
* Removes the background from an image, stores it in the state, and returns the new asset.
|
|
3191
|
+
* @param applyNewAsset Optionally applies the new asset as the current image selection. Default: `true`.
|
|
3192
|
+
* @returns A promise that resolves with the newly generated Asset.
|
|
3193
|
+
*/
|
|
3194
|
+
removeBackgroundFromImageSelection(applyNewAsset?: boolean): Promise<Asset>;
|
|
3148
3195
|
getImageData(): PatternImageData | undefined;
|
|
3149
3196
|
getCurrentFrameStep(frameData: FrameData$1, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
|
|
3150
3197
|
getFrameService(): FrameService | undefined;
|
|
3151
3198
|
hasOverlayImageKey(): string | undefined;
|
|
3152
3199
|
hasOverlayImageUrl(): any;
|
|
3200
|
+
getOriginalImageSelection(): Promise<Asset | undefined>;
|
|
3201
|
+
getBackgroundRemovedImageSelection(): Promise<Asset | undefined>;
|
|
3202
|
+
hasBackgroundRemovedImageSelection(): boolean;
|
|
3203
|
+
getUseOriginalImageSelection(): boolean;
|
|
3204
|
+
setUseOriginalImageSelection(value: boolean): Promise<void>;
|
|
3153
3205
|
}
|
|
3154
3206
|
|
|
3155
3207
|
declare class MaterialStepHandle extends StepHandle<MaterialStepData> {
|