@spiffcommerce/core 12.5.0 → 12.5.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 +69 -54
- package/dist/module.js +67 -52
- package/dist/types.d.ts +59 -22
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, 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,
|
|
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, 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, 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 } 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[];
|
|
@@ -1476,6 +1476,10 @@ export abstract class StepHandle<T extends _AnyStepData1> {
|
|
|
1476
1476
|
* @returns The type of the step handle.
|
|
1477
1477
|
*/
|
|
1478
1478
|
getType(): _StepType1;
|
|
1479
|
+
/**
|
|
1480
|
+
* @returns The underlying data for this step. Favor using the step handle methods instead of this.
|
|
1481
|
+
*/
|
|
1482
|
+
getRaw(): _Step1<T>;
|
|
1479
1483
|
/**
|
|
1480
1484
|
* Fires any configured animations on the 3D preview for this step.
|
|
1481
1485
|
* This includes camera & model animations. If the preview is unavailable
|
|
@@ -1862,6 +1866,53 @@ export interface WorkflowExperience {
|
|
|
1862
1866
|
[key: string]: string;
|
|
1863
1867
|
}>;
|
|
1864
1868
|
}
|
|
1869
|
+
export enum FrameStep {
|
|
1870
|
+
SelectFrame = "SelectFrame",
|
|
1871
|
+
SelectImage = "SelectImage",
|
|
1872
|
+
Position = "Position"
|
|
1873
|
+
}
|
|
1874
|
+
export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
1875
|
+
constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
|
|
1876
|
+
selectVariant(variant: Variant): Promise<void>;
|
|
1877
|
+
onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
|
|
1878
|
+
selectImage(asset: _Asset1): void;
|
|
1879
|
+
getImageData(): PatternImageData | undefined;
|
|
1880
|
+
getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
|
|
1881
|
+
getFrameService(): FrameService | undefined;
|
|
1882
|
+
hasOverlayImageKey(): string | undefined;
|
|
1883
|
+
hasOverlayImageUrl(): any;
|
|
1884
|
+
hasVaryingUpload(): boolean | undefined;
|
|
1885
|
+
hasVaryingSelection(): boolean | undefined;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* TODO: Add GlobalPropertyState mutation & queries to bundle.
|
|
1889
|
+
* TODO: Optimize workflow experience state updates.
|
|
1890
|
+
*/
|
|
1891
|
+
/**
|
|
1892
|
+
* A GlobalPropertyHandle acts as an interface to global properties on our platform. Currently
|
|
1893
|
+
* bundles can return a handle for any global properties associated to the collection.
|
|
1894
|
+
*/
|
|
1895
|
+
declare abstract class GlobalPropertyHandle {
|
|
1896
|
+
protected readonly bundle: _Bundle1;
|
|
1897
|
+
protected readonly property: GlobalPropertyConfigurationAspect;
|
|
1898
|
+
constructor(bundle: _Bundle1, property: GlobalPropertyConfigurationAspect);
|
|
1899
|
+
/**
|
|
1900
|
+
* @returns The human friendly name of the property.
|
|
1901
|
+
*/
|
|
1902
|
+
getName(): string;
|
|
1903
|
+
/**
|
|
1904
|
+
* @returns A human friendly description.
|
|
1905
|
+
*/
|
|
1906
|
+
getDescription(): string;
|
|
1907
|
+
/**
|
|
1908
|
+
* @returns The type of the global property. Use this to determine how to render the property.
|
|
1909
|
+
*/
|
|
1910
|
+
getType(): AspectType;
|
|
1911
|
+
/**
|
|
1912
|
+
* Returns all steps that share this property.
|
|
1913
|
+
*/
|
|
1914
|
+
protected getSharedSteps(): import("stepHandles").StepHandle<import("@spiffcommerce/papyrus").AnyStepData>[];
|
|
1915
|
+
}
|
|
1865
1916
|
/**
|
|
1866
1917
|
* A bundle serves as a container for a set of workflow experience.
|
|
1867
1918
|
*/
|
|
@@ -1895,14 +1946,14 @@ interface _Bundle1 {
|
|
|
1895
1946
|
*/
|
|
1896
1947
|
setMetadata(metadata: Map<string, string>): Promise<void>;
|
|
1897
1948
|
/**
|
|
1898
|
-
* Returns true when the bundle contains
|
|
1949
|
+
* Returns true when the bundle contains products that share global properties.
|
|
1899
1950
|
*/
|
|
1900
|
-
hasGlobalProperties(): boolean
|
|
1951
|
+
hasGlobalProperties(): Promise<boolean>;
|
|
1901
1952
|
/**
|
|
1902
1953
|
* Get a handle to the global properties available within this bundle. Setting values
|
|
1903
1954
|
* via this method will make selections on all bundles that share the property.
|
|
1904
1955
|
*/
|
|
1905
|
-
getGlobalProperties():
|
|
1956
|
+
getGlobalProperties(): Promise<GlobalPropertyHandle[]>;
|
|
1906
1957
|
/**
|
|
1907
1958
|
* Return the total in subunits for this bundle. This is the sum of the total for all individual transactions.
|
|
1908
1959
|
*/
|
|
@@ -1922,6 +1973,10 @@ interface _Bundle1 {
|
|
|
1922
1973
|
* @param experience The workflow experience to remove from this bundle.
|
|
1923
1974
|
*/
|
|
1924
1975
|
removeWorkflowExperience(experience: WorkflowExperience): Promise<void>;
|
|
1976
|
+
/**
|
|
1977
|
+
* Returns all workflow experiences currently added to this bundle.
|
|
1978
|
+
*/
|
|
1979
|
+
getWorkflowExperiences(): WorkflowExperience[];
|
|
1925
1980
|
/**
|
|
1926
1981
|
* Sort the list of workflow experiences.
|
|
1927
1982
|
*/
|
|
@@ -2177,24 +2232,6 @@ export class MockWorkflowManager implements WorkflowManager {
|
|
|
2177
2232
|
updateMetadata(_stepName: string, _update: any): void;
|
|
2178
2233
|
updateStorage(_stepName: string, _update: _StepStorage1): Promise<void>;
|
|
2179
2234
|
}
|
|
2180
|
-
export enum FrameStep {
|
|
2181
|
-
SelectFrame = "SelectFrame",
|
|
2182
|
-
SelectImage = "SelectImage",
|
|
2183
|
-
Position = "Position"
|
|
2184
|
-
}
|
|
2185
|
-
export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
2186
|
-
constructor(manager: WorkflowManager, step: _Step1<_FrameStepData1>);
|
|
2187
|
-
selectVariant(variant: Variant): Promise<void>;
|
|
2188
|
-
onFrameDataChanged(callback: (frameData: _FrameData1) => void): void;
|
|
2189
|
-
selectImage(asset: _Asset1): void;
|
|
2190
|
-
getImageData(): PatternImageData | undefined;
|
|
2191
|
-
getCurrentFrameStep(frameData: _FrameData1, uploading?: any, imageUploadComplete?: any, variants?: _VariantResource1[]): FrameStep;
|
|
2192
|
-
getFrameService(): FrameService | undefined;
|
|
2193
|
-
hasOverlayImageKey(): string | undefined;
|
|
2194
|
-
hasOverlayImageUrl(): any;
|
|
2195
|
-
hasVaryingUpload(): boolean | undefined;
|
|
2196
|
-
hasVaryingSelection(): boolean | undefined;
|
|
2197
|
-
}
|
|
2198
2235
|
export const TransformWrapper: React.FunctionComponent;
|
|
2199
2236
|
export { CommandContext };
|
|
2200
2237
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.1",
|
|
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",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@apollo/client": "^3.7.0",
|
|
90
|
-
"@spiffcommerce/papyrus": "^2.0.
|
|
90
|
+
"@spiffcommerce/papyrus": "^2.0.9",
|
|
91
91
|
"cross-fetch": "^3.1.5",
|
|
92
92
|
"graphql": "^16.6.0",
|
|
93
93
|
"lodash.clonedeep": "^4.5.0",
|