@spiffcommerce/core 0.10.175 → 0.10.177

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/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, IServerModel, MaterialResource, AssetType as _AssetType1, 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, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, StepGroup, FrameData as _FrameData1, 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, 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, getAxisAlignedBoundingBox } 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, IServerModel, MaterialResource, AssetType as _AssetType1, 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, Point, ScaleAxis, UnitOfMeasurement as _UnitOfMeasurement1, StepType as _StepType1, BulkStepData as _BulkStepData1, StepGroup, FrameData as _FrameData1, 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, 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[];
@@ -1136,6 +1136,13 @@ export const useEditorInteraction: (editorRef: RefObject<SVGRectElement>, intera
1136
1136
  handleSequenceStart: () => void;
1137
1137
  };
1138
1138
  export const useShortcutCombination: (shortcutKeys: string[], onCombinationPressed: () => void, onCombinationReleased?: () => void) => void;
1139
+ export interface DesignInputStep {
1140
+ data: DesignInputStepData;
1141
+ name: string;
1142
+ }
1143
+ interface DesignInputStepData {
1144
+ }
1145
+ export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], server: ServerService, productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
1139
1146
  export const EditorCore: FunctionComponent<{
1140
1147
  isMobile: boolean;
1141
1148
  color?: string;
@@ -1170,6 +1177,8 @@ export const EditorCore: FunctionComponent<{
1170
1177
  onSequenceStart: () => void;
1171
1178
  setElementEvent: (e: ElementEvent | undefined) => void;
1172
1179
  onElementSelected: (elementId: string | undefined, event: PointerEvent) => void;
1180
+ variationRecord: null | VariationRecord;
1181
+ workflow: _Workflow1;
1173
1182
  }>;
1174
1183
  /**
1175
1184
  * The advanced editor encapsulates the logic required to allow users to manipulate a design
@@ -1188,6 +1197,8 @@ export const AdvancedEditor: FunctionComponent<{
1188
1197
  onContextMenuHandlePointerDown?: (event: PointerEvent) => void;
1189
1198
  onElementSelected?: (id: string | undefined, element: PointerEvent) => void;
1190
1199
  onDragEnd?: () => void;
1200
+ variationRecord: null | VariationRecord;
1201
+ workflow: _Workflow1;
1191
1202
  }>;
1192
1203
  /**
1193
1204
  * A StepHandle allows for managing the state of a specific step in a workflow. This class
@@ -1514,7 +1525,6 @@ export interface WorkflowExperience {
1514
1525
  * Saves this experience to storage. This may be local or remote depending
1515
1526
  * on configuration.
1516
1527
  * @param title The title for the saved design.
1517
- * @param thumbnail An optional thumbnail for the saved design. If none is provided this field will be saved blank.
1518
1528
  */
1519
1529
  save(title: string): Promise<SavedDesign>;
1520
1530
  /**
@@ -1535,13 +1545,6 @@ export interface WorkflowExperience {
1535
1545
  */
1536
1546
  onDesignFinished(product: Product, onProgressUpdate: DesignCreationProgressUpdate, selections: WorkflowSelections, metadata?: WorkflowMetadata | undefined): Promise<DesignCreationMessage>;
1537
1547
  }
1538
- export interface DesignInputStep {
1539
- data: DesignInputStepData;
1540
- name: string;
1541
- }
1542
- interface DesignInputStepData {
1543
- }
1544
- export const generateCommands: (designInputSteps: DesignInputStep[], workflow: _Workflow1, layouts: _ILayout1[], server: ServerService, productOverlayImageUrl?: string) => Promise<_CanvasCommand1[]>;
1545
1548
  /**
1546
1549
  * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
1547
1550
  * Please refer to the documentation for more information.
@@ -1695,7 +1698,7 @@ export class FrameStepHandle extends StepHandle<_FrameStepData1> {
1695
1698
  }
1696
1699
  export const TransformWrapper: React.FunctionComponent;
1697
1700
  export { CommandContext };
1698
- export { AssetType, BringForwardCommand, 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, getSvgString, loadFontFromDataUrl, loadFontFromExternalUrl, determineCorrectFontSizeAndLines, patternImageDataCache, registerJSDOM };
1701
+ export { AssetType, BringForwardCommand, 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 };
1699
1702
  export { Animatable, AnyStepData, Asset, BulkStepData, ColorProfileProps, ColorDefinition, CommandState, WorkflowPanel, DigitalContentStepData, FrameElement, FrameStepData, ILayout, IllustrationElement, IllustrationStepData, ImageElement, LayoutData, LayoutElement, LayoutsState, MaterialStepData, ModelStepData, ModuleStepData, OptionResource, PictureStepData, QuestionStepData, ShapeStepData, Step, StepAspect, StepStorage, TextStepData, TextboxElement, VariantResource, Workflow };
1700
1703
 
1701
1704
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.175",
3
+ "version": "0.10.177",
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",
@@ -10,7 +10,8 @@
10
10
  "build": "parcel build",
11
11
  "dev": "ladle serve",
12
12
  "test": "tsc --noEmit --isolatedModules --skipLibCheck && jest",
13
- "prepare": "yarn run build"
13
+ "prepare": "yarn run build",
14
+ "lint": "npx eslint src"
14
15
  },
15
16
  "targets": {
16
17
  "main": {
@@ -51,11 +52,16 @@
51
52
  "@types/qrcode": "^1.3.5",
52
53
  "@types/react": "^17.0.9",
53
54
  "@types/react-dom": "^17.0.9",
55
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
56
+ "@typescript-eslint/parser": "^5.43.0",
54
57
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
55
58
  "agent-base": "^6.0.2",
56
59
  "assert": "^2.0.0",
57
60
  "buffer": "^6.0.3",
58
61
  "enzyme": "^3.11.0",
62
+ "eslint": "^8.28.0",
63
+ "eslint-plugin-react": "^7.31.11",
64
+ "eslint-plugin-react-hooks": "^4.6.0",
59
65
  "events": "^3.3.0",
60
66
  "https-browserify": "^1.0.0",
61
67
  "husky": "^8.0.1",
@@ -79,7 +85,7 @@
79
85
  },
80
86
  "dependencies": {
81
87
  "@apollo/client": "^3.7.0",
82
- "@spiffcommerce/papyrus": "^1.5.54",
88
+ "@spiffcommerce/papyrus": "1.5.56",
83
89
  "canvg": "https://github.com/spiffdev/canvg.git#03bcd151b12441e88ecb552bb658356f5bbe92c4",
84
90
  "cross-fetch": "^3.1.5",
85
91
  "graphql": "^16.6.0",