@spiffcommerce/core 12.13.0 → 13.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/main.js +76 -74
- package/dist/module.js +53 -51
- package/dist/types.d.ts +19 -7
- 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, 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";
|
|
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, GlobalPropertyConfiguration, 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[];
|
|
@@ -1057,6 +1057,7 @@ interface BundleStakeholderInput {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
type ProductCollection = {
|
|
1059
1059
|
id: string;
|
|
1060
|
+
globalPropertyConfiguration?: GlobalPropertyConfiguration;
|
|
1060
1061
|
name: string;
|
|
1061
1062
|
products: Product[];
|
|
1062
1063
|
};
|
|
@@ -1908,10 +1909,6 @@ export class FrameStepHandle extends StepHandle<_FrameStepData1> {
|
|
|
1908
1909
|
hasVaryingUpload(): boolean | undefined;
|
|
1909
1910
|
hasVaryingSelection(): boolean | undefined;
|
|
1910
1911
|
}
|
|
1911
|
-
/**
|
|
1912
|
-
* TODO: Add GlobalPropertyState mutation & queries to bundle.
|
|
1913
|
-
* TODO: Optimize workflow experience state updates.
|
|
1914
|
-
*/
|
|
1915
1912
|
/**
|
|
1916
1913
|
* A GlobalPropertyHandle acts as an interface to global properties on our platform. Currently
|
|
1917
1914
|
* bundles can return a handle for any global properties associated to the collection.
|
|
@@ -1921,9 +1918,13 @@ declare abstract class GlobalPropertyHandle {
|
|
|
1921
1918
|
protected readonly property: GlobalPropertyConfigurationAspect;
|
|
1922
1919
|
constructor(bundle: _Bundle1, property: GlobalPropertyConfigurationAspect);
|
|
1923
1920
|
/**
|
|
1924
|
-
* @returns The
|
|
1921
|
+
* @returns The name of the global property. This is the key used to store the property in the state.
|
|
1925
1922
|
*/
|
|
1926
1923
|
getName(): string;
|
|
1924
|
+
/**
|
|
1925
|
+
* @returns A human friendly title.
|
|
1926
|
+
*/
|
|
1927
|
+
getTitle(): string;
|
|
1927
1928
|
/**
|
|
1928
1929
|
* @returns A human friendly description.
|
|
1929
1930
|
*/
|
|
@@ -1990,7 +1991,7 @@ interface _Bundle1 {
|
|
|
1990
1991
|
/**
|
|
1991
1992
|
* Returns true when the bundle contains products that share global properties.
|
|
1992
1993
|
*/
|
|
1993
|
-
hasGlobalProperties():
|
|
1994
|
+
hasGlobalProperties(): boolean;
|
|
1994
1995
|
/**
|
|
1995
1996
|
* Get a handle to the global properties available within this bundle. Setting values
|
|
1996
1997
|
* via this method will make selections on all bundles that share the property.
|
|
@@ -2054,7 +2055,18 @@ interface _Bundle1 {
|
|
|
2054
2055
|
* helpful details like what product to add to cart on supported e-commerce platforms.
|
|
2055
2056
|
*/
|
|
2056
2057
|
finish(): Promise<DesignCreationMessage[]>;
|
|
2058
|
+
/**
|
|
2059
|
+
* Add an event listener to this bundle.
|
|
2060
|
+
* @param event The event to listen for. Currently only "conditional-global-properties-changed" is supported.
|
|
2061
|
+
* @param listener The listener to call when the event occurs.
|
|
2062
|
+
*/
|
|
2063
|
+
addEventListener(event: BundleEvent, listener: () => void): void;
|
|
2064
|
+
/**
|
|
2065
|
+
* Remove a previously added event listener from this bundle.
|
|
2066
|
+
*/
|
|
2067
|
+
removeEventListener(event: BundleEvent, listener: () => void): void;
|
|
2057
2068
|
}
|
|
2069
|
+
type BundleEvent = "conditional-global-properties-changed";
|
|
2058
2070
|
export const getWorkflow: (id: string) => Promise<_Workflow1>;
|
|
2059
2071
|
/**
|
|
2060
2072
|
* Options that can be used during instantiation of the SpiffCommerce Javascript Client.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.1.0",
|
|
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": "^
|
|
90
|
+
"@spiffcommerce/papyrus": "^3.1.0",
|
|
91
91
|
"cross-fetch": "^3.1.5",
|
|
92
92
|
"graphql": "^16.6.0",
|
|
93
93
|
"lodash.clonedeep": "^4.5.0",
|