@spiffcommerce/core 0.10.20 → 0.10.22

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,6 +1,6 @@
1
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, StepGroup, 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
- import { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent, MouseEvent } from "react";
3
+ import { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
4
4
  export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
5
5
  export interface WorkflowScene {
6
6
  name: string;
@@ -1024,7 +1024,7 @@ export const useEditorInteraction: (editorRef: RefObject<SVGRectElement>, intera
1024
1024
  handleScroll: () => void;
1025
1025
  handleSequenceStart: () => void;
1026
1026
  };
1027
- export const useShortcutCombination: (shortcutKeys: string[], callback: (keys: string[]) => void) => void;
1027
+ export const useShortcutCombination: (shortcutKeys: string[], callback: () => void) => void;
1028
1028
  export const EditorCore: FunctionComponent<{
1029
1029
  color?: string;
1030
1030
  editorRef: RefObject<SVGRectElement>;
@@ -1044,7 +1044,7 @@ export const EditorCore: FunctionComponent<{
1044
1044
  targetedElements?: string[];
1045
1045
  borderRadius?: number;
1046
1046
  handleContextMenu?: (e: any) => void;
1047
- onMouseMove?: (event: React.MouseEvent<SVGSVGElement, React.MouseEvent>) => void;
1047
+ onMouseMove?: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
1048
1048
  handleKeyDown: (event: KeyboardEvent, adjustmentBoundary?: Region) => void;
1049
1049
  handleKeyUp: (event: KeyboardEvent) => void;
1050
1050
  handlePointerMove: (e: PointerEvent, adjustmentBoundary?: Region) => void;
@@ -1064,7 +1064,7 @@ export const AdvancedEditor: FunctionComponent<{
1064
1064
  guidelineColor?: string;
1065
1065
  borderRadius?: number;
1066
1066
  handleContextMenu?: (event: React.MouseEvent) => void;
1067
- onMouseMove?: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
1067
+ onMouseMove?: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
1068
1068
  onElementSelected?: (id: string | undefined, element: PointerEvent) => void;
1069
1069
  }>;
1070
1070
  /**
@@ -1118,6 +1118,11 @@ export abstract class StepHandle<T extends _AnyStepData1> {
1118
1118
  }
1119
1119
  export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
1120
1120
  constructor(manager: WorkflowManager, step: _Step1<_IllustrationStepData1>);
1121
+ /**
1122
+ * Allows for select a vector from the available vectors configured on this steps base option.
1123
+ * @param variant The new vector variant to use for this step.
1124
+ * @returns A promise that can be awaited to know when the new vector asset has been updated on the design.
1125
+ */
1121
1126
  selectVariant(variant: _VariantResource1): Promise<void>;
1122
1127
  /**
1123
1128
  * Get colors for the illustration.
@@ -1129,6 +1134,11 @@ export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
1129
1134
  }
1130
1135
  export class PictureStepHandle extends StepHandle<_PictureStepData1> {
1131
1136
  constructor(manager: WorkflowManager, step: _Step1<_PictureStepData1>);
1137
+ /**
1138
+ * Allows the user to select an image variant from the available variants configured on this steps base option.
1139
+ * @param variant The new image variant to use.
1140
+ * @returns A promise that can be awaited to ensure the new image asset has been updated on the design.
1141
+ */
1132
1142
  selectVariant(variant: _VariantResource1): Promise<void>;
1133
1143
  }
1134
1144
  interface TextChangeResult {
@@ -1138,6 +1148,10 @@ interface TextChangeResult {
1138
1148
  }
1139
1149
  export class TextStepHandle extends StepHandle<_TextStepData1> {
1140
1150
  constructor(manager: WorkflowManager, step: _Step1<_TextStepData1>);
1151
+ /**
1152
+ * Allows for select a font from the available fonts configured on this steps base option.
1153
+ * @param variant The font variant to use.
1154
+ */
1141
1155
  selectVariant(variant: _VariantResource1): Promise<void>;
1142
1156
  /**
1143
1157
  * @returns A list of colors that can be used to fill the text.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.10.20",
3
+ "version": "0.10.22",
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",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@apollo/client": "^3.7.0",
83
- "@spiffcommerce/papyrus": "^1.5.12",
83
+ "@spiffcommerce/papyrus": "^1.5.13",
84
84
  "canvg": "https://github.com/spiffdev/canvg.git#03bcd151b12441e88ecb552bb658356f5bbe92c4",
85
85
  "cross-fetch": "^3.1.5",
86
86
  "graphql": "^16.6.0",