@spiffcommerce/core 20.1.0-beta.2 → 20.1.0-beta.3
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/index.d.ts +6 -23
- package/dist/index.js +54 -56
- package/dist/index.umd.cjs +59 -59
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2961,49 +2961,32 @@ declare class PromiseCache {
|
|
|
2961
2961
|
}
|
|
2962
2962
|
declare const promiseCache: PromiseCache;
|
|
2963
2963
|
|
|
2964
|
-
|
|
2965
|
-
/**
|
|
2966
|
-
* This event is sent when the user has clicked a close button within the frame.
|
|
2967
|
-
*/
|
|
2968
|
-
OnCancel = "onCancel",
|
|
2969
|
-
/**
|
|
2970
|
-
* This event is sent when the frame has encountered an error.
|
|
2971
|
-
*/
|
|
2972
|
-
OnError = "onError",
|
|
2973
|
-
/**
|
|
2974
|
-
* This event is sent when the user has completed the experience in the frame and is passign back information to the parent.
|
|
2975
|
-
*/
|
|
2976
|
-
OnComplete = "onComplete",
|
|
2977
|
-
/**
|
|
2978
|
-
* This event is sent when the content in the frame is loaded and ready to display.
|
|
2979
|
-
*/
|
|
2980
|
-
OnLoad = "onLoad"
|
|
2981
|
-
}
|
|
2964
|
+
type FrameEventType = "onCancel" | "onError" | "onComplete" | "onLoad";
|
|
2982
2965
|
/**
|
|
2983
2966
|
* This event is sent when the frame has encountered an error.
|
|
2984
2967
|
*/
|
|
2985
2968
|
interface ErrorEvent {
|
|
2986
|
-
event:
|
|
2969
|
+
event: "OnError";
|
|
2987
2970
|
data: Error;
|
|
2988
2971
|
}
|
|
2989
2972
|
/**
|
|
2990
2973
|
* This event is sent when the user has clicked a close button within the frame.
|
|
2991
2974
|
*/
|
|
2992
2975
|
interface CancelEvent {
|
|
2993
|
-
event:
|
|
2976
|
+
event: "OnCancel";
|
|
2994
2977
|
}
|
|
2995
2978
|
/**
|
|
2996
2979
|
* This event is sent when the content in the frame is loaded and ready to display. As
|
|
2997
2980
|
* the point at which the content is considered 'loaded' can vary between themes, we require the theme developer to report it.
|
|
2998
2981
|
*/
|
|
2999
2982
|
interface LoadEvent {
|
|
3000
|
-
event:
|
|
2983
|
+
event: "OnLoad";
|
|
3001
2984
|
}
|
|
3002
2985
|
/**
|
|
3003
2986
|
* This event is sent when the user has completed the transaction in the frame and is passing back information to the parent.
|
|
3004
2987
|
*/
|
|
3005
2988
|
interface TransactionCompleteEvent {
|
|
3006
|
-
event:
|
|
2989
|
+
event: "OnComplete";
|
|
3007
2990
|
}
|
|
3008
2991
|
/**
|
|
3009
2992
|
* This event is sent when the user has completed the bundle experience in the frame and is passing back information to the parent.
|
|
@@ -3011,7 +2994,7 @@ interface TransactionCompleteEvent {
|
|
|
3011
2994
|
interface BundleCompleteEvent {
|
|
3012
2995
|
bundleId: string;
|
|
3013
2996
|
items: TransactionCompleteEvent[];
|
|
3014
|
-
event:
|
|
2997
|
+
event: "OnComplete";
|
|
3015
2998
|
}
|
|
3016
2999
|
/**
|
|
3017
3000
|
* A union of the various frame events that can be sent to the parent window.
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHttpLink as Et, InMemoryCache as ht, ApolloClient as Ct, from as Qt, gql as F } from "@apollo/client/core";
|
|
2
2
|
import { fetch as $A, getAttributesFromArrayBuffer as ye, AssetType as Be, StepType as D, getFrameData as _A, frameDataCache as ut, GroupCommand as G, UpdateFramePattern as Ye, UpdateFrameThresholdSettingsCommand as mt, calculateOffsets as Ae, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Se, svgObjectURL as pA, fetchAsString as q, DeleteElementCommand as Z, generateDefaultRectangleFrameSvg as de, GetSVGDimensions as It, patternImageDataCache as we, fetchAsArrayBuffer as pt, findElement as fA, modifySVGWithElementProperties as ft, IllustrationColorCommand as zA, IllustrationCacheCommand as Dt, getFontMetrics as Ft, getPatternImageData as KA, FontAlignmentCommand as Mt, FontColorCommand as yt, FontImageFillCommand as kA, applyTextTransformations as jA, determineCorrectFontSizeAndLines as uA, FontSourceCommand as Ee, loadFont as ee, TextChangeCommand as Yt, FontSizeCommand as St, createElementNS as xt, createElement as lA, _loadFontExternalDataURL as te, UpdateWorkflowStateCommand as he, CommandContext as Pt, createCanvas as DA, getSvgElement as xe, LayoutRenderingPurpose as Pe, renderPapyrusComponentAsString as Ne, loadImage as He, getDomParser as Re, toBase64 as Ce, getVariant as Nt, generateFrameSVG as Ht, getDefaultVariant as NA, domParser as Ue, sanitizeSvgTree as Ge, traverse as Rt, xmlSerializer as ve, CreateLayoutCommand as Ut, AspectType as mA, rehydrateSerializedLayout as _ } from "@spiffcommerce/papyrus";
|
|
3
|
-
import { AssetType as
|
|
3
|
+
import { AssetType as ji, BringForwardCommand as Vi, BringToBackCommand as Wi, BringToFrontCommand as Xi, CanvasCommand as qi, CommandContext as Zi, CreateElementCommand as $i, CreateLayoutCommand as _i, DeleteElementCommand as As, FontAlignmentCommand as es, FontColorCommand as ts, FontSizeCommand as ns, FontSourceCommand as as, GroupCommand as is, LayoutElementFactory as ss, LayoutElementType as os, MoveCommand as rs, ResizeCommand as cs, RotateCommand as gs, SendBackwardsCommand as ls, StepAspectType as Bs, StepType as ds, TextChangeCommand as ws, UnitOfMeasurement as Es, dataUrlFromExternalUrl as hs, determineCorrectFontSizeAndLines as Cs, findElement as Qs, frameDataCache as us, generate as ms, generateSVGWithUnknownColors as Is, getAttributesFromArrayBuffer as ps, getAxisAlignedBoundingBox as fs, getFrameData as Ds, getSvgElement as Fs, loadFont as Ms, patternImageDataCache as ys, registerFetchImplementation as Ys, registerWindowImplementation as Ss, rehydrateSerializedLayout as xs, setCanvasModule as Ps } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as Gt } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as vt } from "@apollo/client/link/error";
|
|
6
6
|
import { Pith as ke } from "pith";
|
|
@@ -7478,7 +7478,7 @@ class Ya extends We {
|
|
|
7478
7478
|
B.resize(s, o), await B.render(), this.onRender();
|
|
7479
7479
|
}
|
|
7480
7480
|
}
|
|
7481
|
-
const
|
|
7481
|
+
const ki = (c, A) => {
|
|
7482
7482
|
const e = [];
|
|
7483
7483
|
return c.forEach((t) => {
|
|
7484
7484
|
const n = A.steps.find((a) => a.stepName === t.stepName);
|
|
@@ -7489,7 +7489,7 @@ const Ji = (c, A) => {
|
|
|
7489
7489
|
}
|
|
7490
7490
|
});
|
|
7491
7491
|
}), e;
|
|
7492
|
-
},
|
|
7492
|
+
}, Ji = async (c, A, e, t) => {
|
|
7493
7493
|
let n = {
|
|
7494
7494
|
serializableWorkflow: { steps: [] },
|
|
7495
7495
|
layouts: {}
|
|
@@ -9010,7 +9010,7 @@ class le {
|
|
|
9010
9010
|
}
|
|
9011
9011
|
}
|
|
9012
9012
|
var ai = /* @__PURE__ */ ((c) => (c.Transaction = "Transaction", c.Bundle = "Bundle", c.Product = "Product", c.Variant = "Variant", c.Option = "Option", c.LineItem = "LineItem", c.Asset = "Asset", c))(ai || {});
|
|
9013
|
-
class
|
|
9013
|
+
class bi extends le {
|
|
9014
9014
|
constructor(A) {
|
|
9015
9015
|
super(`"${A}"`);
|
|
9016
9016
|
}
|
|
@@ -9025,7 +9025,7 @@ class dt extends le {
|
|
|
9025
9025
|
return A.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
|
9026
9026
|
}
|
|
9027
9027
|
}
|
|
9028
|
-
class
|
|
9028
|
+
class Li extends le {
|
|
9029
9029
|
constructor(A) {
|
|
9030
9030
|
super(`[${A.map((e) => e.getRaw()).join(",")}]`);
|
|
9031
9031
|
}
|
|
@@ -10520,7 +10520,7 @@ class Ii {
|
|
|
10520
10520
|
return new Me(a);
|
|
10521
10521
|
}
|
|
10522
10522
|
}
|
|
10523
|
-
class
|
|
10523
|
+
class Ti {
|
|
10524
10524
|
getInitializationPromise() {
|
|
10525
10525
|
return Promise.resolve();
|
|
10526
10526
|
}
|
|
@@ -10686,8 +10686,7 @@ class fi extends W {
|
|
|
10686
10686
|
return this.step.data.overlayImageUrl;
|
|
10687
10687
|
}
|
|
10688
10688
|
}
|
|
10689
|
-
|
|
10690
|
-
class Fi {
|
|
10689
|
+
class Di {
|
|
10691
10690
|
/**
|
|
10692
10691
|
* * Send a message to the parent window.
|
|
10693
10692
|
* We don't currently know the domain of the parent window in a secure way so we use `window.parent.origin` to send the message.
|
|
@@ -10698,48 +10697,47 @@ class Fi {
|
|
|
10698
10697
|
window.self !== window.top ? window.parent.postMessage(A, window.parent.origin) : console.warn("The frame service is being used in a context where there is no parent window.");
|
|
10699
10698
|
}
|
|
10700
10699
|
}
|
|
10701
|
-
const
|
|
10700
|
+
const Oi = new Di();
|
|
10702
10701
|
export {
|
|
10703
|
-
|
|
10702
|
+
Li as ArrayInput,
|
|
10704
10703
|
$ as AssetNotFoundError,
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10704
|
+
ji as AssetType,
|
|
10705
|
+
Vi as BringForwardCommand,
|
|
10706
|
+
Wi as BringToBackCommand,
|
|
10707
|
+
Xi as BringToFrontCommand,
|
|
10708
|
+
qi as CanvasCommand,
|
|
10710
10709
|
TA as CollectionProduct,
|
|
10711
|
-
|
|
10710
|
+
Zi as CommandContext,
|
|
10712
10711
|
cn as ConversionDataType,
|
|
10713
10712
|
rn as ConversionLocation,
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10713
|
+
$i as CreateElementCommand,
|
|
10714
|
+
_i as CreateLayoutCommand,
|
|
10715
|
+
As as DeleteElementCommand,
|
|
10717
10716
|
CA as FlowExecutionNodeResult,
|
|
10718
10717
|
ni as FlowExecutionResult,
|
|
10719
10718
|
ti as FlowService,
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
Di as FrameEventType,
|
|
10719
|
+
es as FontAlignmentCommand,
|
|
10720
|
+
ts as FontColorCommand,
|
|
10721
|
+
ns as FontSizeCommand,
|
|
10722
|
+
as as FontSourceCommand,
|
|
10725
10723
|
In as FrameService,
|
|
10726
10724
|
pi as FrameStep,
|
|
10727
10725
|
fi as FrameStepHandle,
|
|
10728
10726
|
ge as GlobalPropertyHandle,
|
|
10729
|
-
|
|
10727
|
+
is as GroupCommand,
|
|
10730
10728
|
Zn as IllustrationStepHandle,
|
|
10731
10729
|
PA as InformationMessageType,
|
|
10732
10730
|
aa as InformationStepHandle,
|
|
10733
10731
|
Me as IntegrationProduct,
|
|
10734
10732
|
sn as IntegrationType,
|
|
10735
|
-
|
|
10736
|
-
|
|
10733
|
+
ss as LayoutElementFactory,
|
|
10734
|
+
os as LayoutElementType,
|
|
10737
10735
|
z as LayoutNotFoundError,
|
|
10738
10736
|
$n as MaterialStepHandle,
|
|
10739
10737
|
MA as MisconfigurationError,
|
|
10740
|
-
|
|
10738
|
+
Ti as MockWorkflowManager,
|
|
10741
10739
|
_n as ModelStepHandle,
|
|
10742
|
-
|
|
10740
|
+
rs as MoveCommand,
|
|
10743
10741
|
dt as ObjectInput,
|
|
10744
10742
|
ai as ObjectInputType,
|
|
10745
10743
|
FA as OptionNotFoundError,
|
|
@@ -10752,65 +10750,65 @@ export {
|
|
|
10752
10750
|
Xe as PromiseQueue,
|
|
10753
10751
|
ea as QuestionStepHandle,
|
|
10754
10752
|
We as QueueablePromise,
|
|
10755
|
-
|
|
10753
|
+
cs as ResizeCommand,
|
|
10756
10754
|
rA as ResourceNotFoundError,
|
|
10757
|
-
|
|
10758
|
-
|
|
10755
|
+
gs as RotateCommand,
|
|
10756
|
+
ls as SendBackwardsCommand,
|
|
10759
10757
|
ta as ShapeStepHandle,
|
|
10760
10758
|
Ii as SpiffCommerceClient,
|
|
10761
10759
|
YA as StakeholderType,
|
|
10762
|
-
|
|
10760
|
+
Bs as StepAspectType,
|
|
10763
10761
|
W as StepHandle,
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10762
|
+
ds as StepType,
|
|
10763
|
+
ws as TextChangeCommand,
|
|
10764
|
+
bi as TextInput,
|
|
10767
10765
|
na as TextStepHandle,
|
|
10768
10766
|
Ai as Transform,
|
|
10769
10767
|
_a as TransformCollection,
|
|
10770
10768
|
k as UnhandledBehaviorError,
|
|
10771
|
-
|
|
10769
|
+
Es as UnitOfMeasurement,
|
|
10772
10770
|
X as Variant,
|
|
10773
10771
|
EA as WorkflowExperienceImpl,
|
|
10774
10772
|
O as assetService,
|
|
10775
10773
|
ga as createDesign,
|
|
10776
|
-
|
|
10774
|
+
hs as dataUrlFromExternalUrl,
|
|
10777
10775
|
LA as designService,
|
|
10778
|
-
|
|
10776
|
+
Cs as determineCorrectFontSizeAndLines,
|
|
10779
10777
|
Dn as digitalContentStepService,
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10778
|
+
Qs as findElement,
|
|
10779
|
+
us as frameDataCache,
|
|
10780
|
+
Oi as frameService,
|
|
10783
10781
|
WA as frameStepService,
|
|
10784
|
-
|
|
10782
|
+
ms as generate,
|
|
10785
10783
|
Da as generateCommands,
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10784
|
+
Is as generateSVGWithUnknownColors,
|
|
10785
|
+
Ji as generateStateFromDesignInputSteps,
|
|
10786
|
+
ps as getAttributesFromArrayBuffer,
|
|
10787
|
+
fs as getAxisAlignedBoundingBox,
|
|
10790
10788
|
mn as getBoundedOffsets,
|
|
10791
|
-
|
|
10792
|
-
|
|
10789
|
+
Ds as getFrameData,
|
|
10790
|
+
Fs as getSvgElement,
|
|
10793
10791
|
QA as getWorkflow,
|
|
10794
10792
|
wt as getWorkflows,
|
|
10795
10793
|
P as graphQlManager,
|
|
10796
10794
|
IA as illustrationStepService,
|
|
10797
|
-
|
|
10795
|
+
Ms as loadFont,
|
|
10798
10796
|
Ze as materialStepService,
|
|
10799
10797
|
$e as modelStepService,
|
|
10800
10798
|
xn as moduleStepService,
|
|
10801
10799
|
j as optionService,
|
|
10802
|
-
|
|
10800
|
+
ys as patternImageDataCache,
|
|
10803
10801
|
x as persistenceService,
|
|
10804
10802
|
_e as pictureStepService,
|
|
10805
10803
|
At as questionStepService,
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10804
|
+
Ys as registerFetchImplementation,
|
|
10805
|
+
Ss as registerWindowImplementation,
|
|
10806
|
+
xs as rehydrateSerializedLayout,
|
|
10807
|
+
Ps as setCanvasModule,
|
|
10810
10808
|
oA as shapeStepService,
|
|
10811
10809
|
pn as shortenUrl,
|
|
10812
10810
|
yA as spiffCoreConfiguration,
|
|
10813
|
-
|
|
10811
|
+
ki as stepAspectValuesToDesignInputSteps,
|
|
10814
10812
|
K as textStepService,
|
|
10815
10813
|
Un as toast
|
|
10816
10814
|
};
|