@spiffcommerce/core 0.6.15 → 0.7.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/types.d.ts CHANGED
@@ -1,13 +1,8 @@
1
- import { StepAspect, Workflow, AnyStepData, Step, Asset, AssetType, IServerModel, MaterialResource, IllustrationStepData, VariantResource, DigitalContentStepData, FrameStepData, MaterialStepData, ModelStepData, ModuleStepData, PatchworkStepData, PictureStepData, QuestionStepData, ShapeStepData, TextStepData as _TextStepData1, OptionResource, StepType, TextStepData } from "papyrus/build/main/generation/Workflow";
2
- import { PatternImageData, FrameData as _FrameData1, Point, ScaleAxis, UnitOfMeasurement } from "papyrus/build/main/types";
3
- import { FrameOffsets, ColorDefinition, ILayout, IllustrationElement as _IllustrationElement1, LayoutsState as _LayoutsState1, Region, FrameElement as _FrameElement1, PatchworkOffsets, TextboxElement as _TextboxElement1, FontData, SerializableStep, StepStorage, FrameElement, IllustrationElement, LayoutElement, LayoutsState, PatchworkElement, TextboxElement, ImageElement } from "papyrus/build/main/LayoutsState/types";
1
+ import { Workflow, StepAspect, Step, AnyStepData, FrameOffsets, PatternImageData, IServerModel, Asset, MaterialResource, AssetType, ColorDefinition, IllustrationStepData, Region, ILayout, CreateElementCommand as _CreateElementCommand1, IllustrationElement as _IllustrationElement1, LayoutsState as _LayoutsState1, VariantResource, CanvasCommand, LayoutData as _LayoutData1, DigitalContentStepData, FrameStepData, FrameElement as _FrameElement1, MaterialStepData, ModelStepData, ModuleStepData, PatchworkStepData, PatchworkOffsets, PictureStepData, QuestionStepData, ShapeStepData, FontData, GroupCommand, TextboxElement as _TextboxElement1, TextStepData as _TextStepData1, StepStorage, SerializableStep, CommandState, OptionResource, CommandContext as _CommandContext1, Point, ScaleAxis, UnitOfMeasurement, StepType, CommandContext, CreateElementCommand, FontAlignmentCommand, FontColorCommand, FrameElement, generate, IllustrationElement, LayoutData, LayoutElement, LayoutElementFactory, LayoutsState, PatchworkElement, TextboxElement, TextChangeCommand, TextStepData } from "@spiffcommerce/papyrus";
4
2
  import { ApolloClient } from "@apollo/client";
5
- import { CanvasCommand, CreateElementCommand as _CreateElementCommand1, GroupCommand, CreateElementCommand, FontAlignmentCommand, FontColorCommand, TextChangeCommand } from "papyrus/build/main/command";
6
- import { LayoutData as _LayoutData1, CommandState, CommandContext as _CommandContext1, CommandContext, LayoutData } from "papyrus/build/main/CommandContext";
7
- import { ModuleProduct } from "papyrus/build/main/module/ModuleProduct";
8
- import { ThreeDPreviewService as _ThreeDPreviewService1, LoadProgressEventData, ProductCameraRig, SpiffCommerce3DPreviewService, ThreeDPreviewService } from "spiff-preview";
3
+ import { ThreeDPreviewService as _ThreeDPreviewService1, SpiffCommerce3DPreviewService, ThreeDPreviewService } from "@spiffcommerce/preview";
9
4
  import { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent, MouseEvent } from "react";
10
- import { LayoutElementFactory } from "papyrus/build/main/Elements/factory";
5
+ import { ImageElement } from "canvg";
11
6
  export const gatherVaryingStepAspects: (workflow: Workflow) => StepAspect[];
12
7
  export interface WorkflowScene {
13
8
  name: string;
@@ -138,7 +133,6 @@ declare class Poller {
138
133
  */
139
134
  constructor(predicate: () => Promise<boolean>, onSuccess: () => void, onFailure: () => void, interval?: number, maxAttempts?: number);
140
135
  }
141
- export const generate: () => string;
142
136
  declare class Configuration {
143
137
  constructor();
144
138
  getServerUrl(): string;
@@ -217,7 +211,7 @@ declare class DigitalContentStepService implements StepService<DigitalContentSte
217
211
  export const digitalContentStepService: DigitalContentStepService;
218
212
  interface FrameCreateOpts {
219
213
  stepName?: string;
220
- frameData: _FrameData1;
214
+ frameData: FrameData;
221
215
  disablePlaceholder?: boolean;
222
216
  focalBlur?: boolean;
223
217
  focalBlurStrength?: number;
@@ -336,6 +330,20 @@ declare class TextStepService implements StepService<_TextStepData1> {
336
330
  textAlign: (stepData: _TextStepData1) => string;
337
331
  }
338
332
  export const textStepService: TextStepService;
333
+ declare abstract class ModuleProduct {
334
+ /**
335
+ * Name used by class. Usually product or brand name.
336
+ */
337
+ abstract moduleName: string;
338
+ /**
339
+ * SVG with styled path positioned on a background image. To be displayed to user.
340
+ */
341
+ abstract svgPreview(text: string): string;
342
+ /**
343
+ * SVG with styled path positioned on a background image. To be submitted for print.
344
+ */
345
+ abstract svgPrint(text: string): string;
346
+ }
339
347
  export interface EditedSteps {
340
348
  [stepName: string]: boolean;
341
349
  }
@@ -768,6 +776,25 @@ interface FrameData {
768
776
  */
769
777
  height: number;
770
778
  }
779
+ /**
780
+ * Defines the different behaviors supported by the camera system
781
+ * for control when viewing a product.
782
+ */
783
+ export enum ProductCameraRig {
784
+ Orbit = 0,
785
+ Pan = 1
786
+ }
787
+ export type LoadProgressEventData = {
788
+ /**
789
+ * The total load value of the scene, this is an average of all
790
+ * 'in progress' loading events. when all events are fully loaded this value will be 100.
791
+ */
792
+ readonly loadValue: number;
793
+ /**
794
+ * This value is true when the base model and scene have been initialized.
795
+ */
796
+ readonly sceneInitialized: boolean;
797
+ };
771
798
  declare class OptionService {
772
799
  /**
773
800
  * Returns a promise that resolves once all options required for a given workflow
@@ -1102,6 +1129,9 @@ interface ClientOptions {
1102
1129
  * containing multiple variations of the base design.
1103
1130
  */
1104
1131
  bulk?: boolean;
1132
+ /**
1133
+ * When set to true caching will be disabled. This is only useful for debugging. Don't use in production code!
1134
+ */
1105
1135
  useUncachedEndpoints?: boolean;
1106
1136
  }
1107
1137
  /**
@@ -1211,9 +1241,9 @@ export class MockWorkflowManager implements WorkflowManager {
1211
1241
  updateStorage(_stepName: string, _update: StepStorage): Promise<void>;
1212
1242
  }
1213
1243
  export { CommandContext };
1214
- export { CreateElementCommand, TextChangeCommand, FontAlignmentCommand, FontColorCommand, LayoutElementFactory };
1244
+ export { generate, CreateElementCommand, TextChangeCommand, FontAlignmentCommand, FontColorCommand, LayoutElementFactory };
1215
1245
  export { LayoutElement, ImageElement, TextboxElement, TextStepData, FrameElement, PatchworkElement, IllustrationElement, LayoutData, LayoutsState };
1216
- export { SpiffCommerce3DPreviewService, ProductCameraRig };
1217
- export { ThreeDPreviewService, LoadProgressEventData };
1246
+ export { SpiffCommerce3DPreviewService };
1247
+ export { ThreeDPreviewService };
1218
1248
 
1219
1249
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "0.6.15",
3
+ "version": "0.7.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",
@@ -44,6 +44,7 @@
44
44
  "@types/lodash.isequal": "^4.5.6",
45
45
  "@types/qrcode": "^1.3.5",
46
46
  "@types/react": "^17.0.9",
47
+ "@types/opentype.js": "^0.7.2",
47
48
  "@types/react-dom": "^17.0.9",
48
49
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
49
50
  "enzyme": "^3.11.0",
@@ -53,21 +54,23 @@
53
54
  "parcel": "^2.7.0",
54
55
  "react-test-renderer": "^18.2.0",
55
56
  "ts-jest": "^29.0.2",
56
- "typescript": "4.7.3"
57
+ "typescript": "4.7.2"
57
58
  },
58
59
  "dependencies": {
59
60
  "@apollo/client": "^3.6.0",
61
+ "@spiffcommerce/papyrus": "^1.3.0",
62
+ "@spiffcommerce/preview": "^2.0.0",
60
63
  "canvg": "https://github.com/spiffdev/canvg.git#03bcd151b12441e88ecb552bb658356f5bbe92c4",
61
64
  "cross-fetch": "^3.1.5",
62
65
  "graphql": "^16.4.0",
66
+ "opentype.js": "^1.3.1",
63
67
  "lodash.clonedeep": "^4.5.0",
64
68
  "lodash.debounce": "^4.0.8",
65
69
  "lodash.isequal": "^4.5.0",
66
- "papyrus": "git+ssh://git@bitbucket.org:spiffdev/papyrus.git#6a2783887029083549e11a86337f808dda050ac8",
67
70
  "qrcode": "^1.4.4",
68
71
  "react": "^17.0.2",
69
72
  "react-dom": "^17.0.2",
70
- "spiff-preview": "git+ssh://git@bitbucket.org:spiffdev/spiff-preview.git#2fb43c88d9326f20829ea3b3a6119220c66b5395",
71
- "swagger-client": "git+https://github.com/spiffdev/swagger-js.git"
73
+ "svg-path-bbox": "^1.2.2",
74
+ "swagger-client": "spiffdev/swagger-js.git"
72
75
  }
73
76
  }