@spiffcommerce/core 0.10.116 → 0.10.118
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 +9 -9
- package/dist/module.js +9 -9
- package/dist/types.d.ts +24 -38
- package/package.json +6 -8
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,
|
|
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, 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 } from "@spiffcommerce/papyrus";
|
|
2
2
|
import { ApolloClient } from "@apollo/client";
|
|
3
3
|
import { ReactNode, Dispatch, FunctionComponent, RefObject, PointerEvent, KeyboardEvent } from "react";
|
|
4
4
|
export const gatherVaryingStepAspects: (workflow: _Workflow1) => _StepAspect1[];
|
|
@@ -238,6 +238,11 @@ declare class Poller {
|
|
|
238
238
|
*/
|
|
239
239
|
constructor(predicate: () => Promise<boolean>, onSuccess: () => void, onFailure: () => void, interval?: number, maxAttempts?: number);
|
|
240
240
|
}
|
|
241
|
+
declare class DigitalContentStepService implements StepService<_DigitalContentStepData1> {
|
|
242
|
+
init(stepData: _Step1<_DigitalContentStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
243
|
+
regenerateQRCode(elements: RegionElement[], uploading: boolean, assetKey: string, url: string, workflowManager: WorkflowManager, stepData: _Step1<_DigitalContentStepData1>, setUrl: (finalUrl: string) => void, commandDispatcher: (command: _CanvasCommand1) => void, setIsRegenerating: (state: boolean) => void): Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
export const digitalContentStepService: DigitalContentStepService;
|
|
241
246
|
interface StorageService {
|
|
242
247
|
/**
|
|
243
248
|
* Get a value.
|
|
@@ -324,6 +329,23 @@ interface PersistedAsset {
|
|
|
324
329
|
src: string;
|
|
325
330
|
}
|
|
326
331
|
export const assetService: AssetService;
|
|
332
|
+
interface FrameCreateOpts {
|
|
333
|
+
stepName?: string;
|
|
334
|
+
frameData: FrameData;
|
|
335
|
+
disablePlaceholder?: boolean;
|
|
336
|
+
focalBlur?: boolean;
|
|
337
|
+
focalBlurStrength?: number;
|
|
338
|
+
focalBlurRadius?: number;
|
|
339
|
+
pattern?: any;
|
|
340
|
+
}
|
|
341
|
+
declare class FrameStepService implements StepService<_FrameStepData1> {
|
|
342
|
+
init(stepData: _Step1<_FrameStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
343
|
+
selectImage(stepData: _Step1<_FrameStepData1>, asset: IServerModel<_Asset1>, workflowManager: WorkflowManager): void;
|
|
344
|
+
selectVariant(stepData: _Step1<_FrameStepData1>, variant: _VariantResource1 | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
345
|
+
getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: FrameCreateOpts): _CreateElementCommand1<_FrameElement1>;
|
|
346
|
+
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
347
|
+
}
|
|
348
|
+
export const frameStepService: FrameStepService;
|
|
327
349
|
interface SVGCreateOpts {
|
|
328
350
|
stepName?: string;
|
|
329
351
|
src: string;
|
|
@@ -343,43 +365,12 @@ declare class IllustrationStepService implements StepService<_IllustrationStepDa
|
|
|
343
365
|
fill: string | undefined;
|
|
344
366
|
stroke: string | undefined;
|
|
345
367
|
variant: _VariantResource1;
|
|
346
|
-
}[] | {
|
|
347
|
-
fill: string;
|
|
348
|
-
stroke: string;
|
|
349
368
|
}[]>;
|
|
350
369
|
changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string>): Promise<_CanvasCommand1>;
|
|
351
370
|
changeColors(stepData: _Step1<_IllustrationStepData1>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => _LayoutData1[], newFills: Map<string, string>): Promise<void>;
|
|
352
371
|
selectVariant(stepData: _Step1<_IllustrationStepData1>, variant: _VariantResource1, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
|
|
353
372
|
}
|
|
354
|
-
/**
|
|
355
|
-
* FIXME: This should be shifted to papyrus at some point
|
|
356
|
-
* @param svg The SVG to get an object URL for.
|
|
357
|
-
* @returns An object URL storing the cached image of this svg file.
|
|
358
|
-
*/
|
|
359
|
-
export const svgObjectURL: (svg: string) => Promise<string>;
|
|
360
373
|
export const illustrationStepService: IllustrationStepService;
|
|
361
|
-
declare class DigitalContentStepService implements StepService<_DigitalContentStepData1> {
|
|
362
|
-
init(stepData: _Step1<_DigitalContentStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
363
|
-
regenerateQRCode(elements: RegionElement[], uploading: boolean, assetKey: string, url: string, workflowManager: WorkflowManager, stepData: _Step1<_DigitalContentStepData1>, setUrl: (finalUrl: string) => void, commandDispatcher: (command: _CanvasCommand1) => void, setIsRegenerating: (state: boolean) => void): Promise<void>;
|
|
364
|
-
}
|
|
365
|
-
export const digitalContentStepService: DigitalContentStepService;
|
|
366
|
-
interface FrameCreateOpts {
|
|
367
|
-
stepName?: string;
|
|
368
|
-
frameData: FrameData;
|
|
369
|
-
disablePlaceholder?: boolean;
|
|
370
|
-
focalBlur?: boolean;
|
|
371
|
-
focalBlurStrength?: number;
|
|
372
|
-
focalBlurRadius?: number;
|
|
373
|
-
pattern?: any;
|
|
374
|
-
}
|
|
375
|
-
declare class FrameStepService implements StepService<_FrameStepData1> {
|
|
376
|
-
init(stepData: _Step1<_FrameStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<CommandWithFollowup | null>;
|
|
377
|
-
selectImage(stepData: _Step1<_FrameStepData1>, asset: IServerModel<_Asset1>, workflowManager: WorkflowManager): void;
|
|
378
|
-
selectVariant(stepData: _Step1<_FrameStepData1>, variant: _VariantResource1 | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
|
|
379
|
-
getCreateElementCommand(id: string, region: Region, layout: _ILayout1, options: FrameCreateOpts): _CreateElementCommand1<_FrameElement1>;
|
|
380
|
-
loadPatternFromString(src: string, frameService: FrameService): Promise<void>;
|
|
381
|
-
}
|
|
382
|
-
export const frameStepService: FrameStepService;
|
|
383
374
|
declare class MaterialStepService implements StepService<_MaterialStepData1> {
|
|
384
375
|
init(stepData: _Step1<_MaterialStepData1>, workflowManager: WorkflowManager, reducerState?: _LayoutsState1): Promise<null | CommandWithFollowup>;
|
|
385
376
|
selectVariant(step: _Step1<_MaterialStepData1>, variant: _VariantResource1, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
|
|
@@ -1140,12 +1131,11 @@ export const EditorCore: FunctionComponent<{
|
|
|
1140
1131
|
interactionElementRef: RefObject<HTMLDivElement>;
|
|
1141
1132
|
guidelines: SnapPoint[];
|
|
1142
1133
|
isMakingAdjustments?: boolean;
|
|
1143
|
-
|
|
1134
|
+
outlineArea?: {
|
|
1144
1135
|
x?: number;
|
|
1145
1136
|
y?: number;
|
|
1146
1137
|
height?: number;
|
|
1147
1138
|
width?: number;
|
|
1148
|
-
backgroundFill?: string;
|
|
1149
1139
|
};
|
|
1150
1140
|
visibleLayoutId: string;
|
|
1151
1141
|
xTranslation: number;
|
|
@@ -1288,9 +1278,6 @@ export class IllustrationStepHandle extends StepHandle<_IllustrationStepData1> {
|
|
|
1288
1278
|
fill: string | undefined;
|
|
1289
1279
|
stroke: string | undefined;
|
|
1290
1280
|
variant: _VariantResource1;
|
|
1291
|
-
}[] | {
|
|
1292
|
-
fill: string;
|
|
1293
|
-
stroke: string;
|
|
1294
1281
|
}[]>;
|
|
1295
1282
|
hasVaryingSelection(): boolean | undefined;
|
|
1296
1283
|
hasVaryingColors(): boolean | undefined;
|
|
@@ -1471,7 +1458,6 @@ export class SpiffCommerceClient {
|
|
|
1471
1458
|
getSavedDesigns(): Promise<import("services/design").SavedDesign[]>;
|
|
1472
1459
|
/**
|
|
1473
1460
|
* Removes a design from storage. This will be a noop if the design isn't already saved.
|
|
1474
|
-
* @param experience The workflow experience to remove from storage.
|
|
1475
1461
|
*/
|
|
1476
1462
|
deleteDesign(transactionId: string): Promise<void>;
|
|
1477
1463
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.118",
|
|
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",
|
|
@@ -39,16 +39,15 @@
|
|
|
39
39
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
40
40
|
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
|
|
41
41
|
"@ladle/react": "^2.4.5",
|
|
42
|
-
"@parcel/packager-ts": "2.
|
|
43
|
-
"@parcel/transformer-typescript-tsc": "^2.
|
|
44
|
-
"@parcel/transformer-typescript-types": "
|
|
45
|
-
"@parcel/validator-typescript": "^2.
|
|
42
|
+
"@parcel/packager-ts": "2.8.0",
|
|
43
|
+
"@parcel/transformer-typescript-tsc": "^2.8.0",
|
|
44
|
+
"@parcel/transformer-typescript-types": "2.8.0",
|
|
45
|
+
"@parcel/validator-typescript": "^2.8.0",
|
|
46
46
|
"@types/enzyme": "^3.10.12",
|
|
47
47
|
"@types/jest": "^29.0.3",
|
|
48
48
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
49
49
|
"@types/lodash.debounce": "^4.0.7",
|
|
50
50
|
"@types/lodash.isequal": "^4.5.6",
|
|
51
|
-
"@types/opentype.js": "^0.7.2",
|
|
52
51
|
"@types/qrcode": "^1.3.5",
|
|
53
52
|
"@types/react": "^17.0.9",
|
|
54
53
|
"@types/react-dom": "^17.0.9",
|
|
@@ -80,14 +79,13 @@
|
|
|
80
79
|
},
|
|
81
80
|
"dependencies": {
|
|
82
81
|
"@apollo/client": "^3.7.0",
|
|
83
|
-
"@spiffcommerce/papyrus": "
|
|
82
|
+
"@spiffcommerce/papyrus": "1.5.39",
|
|
84
83
|
"canvg": "https://github.com/spiffdev/canvg.git#03bcd151b12441e88ecb552bb658356f5bbe92c4",
|
|
85
84
|
"cross-fetch": "^3.1.5",
|
|
86
85
|
"graphql": "^16.6.0",
|
|
87
86
|
"lodash.clonedeep": "^4.5.0",
|
|
88
87
|
"lodash.debounce": "^4.0.8",
|
|
89
88
|
"lodash.isequal": "^4.5.0",
|
|
90
|
-
"opentype.js": "^1.3.4",
|
|
91
89
|
"qrcode": "^1.5.1",
|
|
92
90
|
"svg-path-bbox": "^1.2.2",
|
|
93
91
|
"swagger-client": "3.18.5"
|