@spiffcommerce/core 32.4.0-beta.31f8a4dd-4f9f-572b-8792-9d8d6243c25e → 32.4.0-beta.a1f69100-8b64-5ab1-b13d-d042fc2f8765
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/CHANGELOG.md +0 -13
- package/dist/index.d.ts +21 -61
- package/dist/index.js +190 -282
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3633 -3758
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -14,19 +14,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
14
14
|
- `Fixed` for any bug fixes.
|
15
15
|
- `Security` in case of vulnerabilities.
|
16
16
|
|
17
|
-
## [33.0.0] - 14-10-2025
|
18
|
-
|
19
|
-
## Changed
|
20
|
-
|
21
|
-
- Updated `WorkflowExperience` to store `transaction`, `product`, `profanityList`, and `workflow` as direct properties, initialized in the constructor for improved encapsulation and performance.
|
22
|
-
|
23
|
-
## Added
|
24
|
-
|
25
|
-
- Added new methods to `WorkflowExperience`: `getProduct()`, `getProfanityList()`, `setProduct(integrationProductId: string)`, `getTransaction()`, `getWorkflow()`, and `setWorkflow(workflow: Workflow)` for easier access and mutation of core experience data.
|
26
|
-
- Introduced `getIntegrationProductIds()` and `addIntegrationProductId(id: string)` methods to `Bundle` and `BundleImpl` for tracking associated integration product IDs.
|
27
|
-
- Added GraphQL mutation for updating a transaction's integration product, enabling backend synchronization of integration product changes.
|
28
|
-
- Added `getState()` method to `BundleStateManager` for easier external access to the current bundle state.
|
29
|
-
|
30
17
|
## [32.4.0] - 16-10-2025
|
31
18
|
|
32
19
|
## Added
|
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'preact/compat';
|
2
2
|
import * as _apollo_client_core from '@apollo/client/core';
|
3
3
|
import { OperationVariables, QueryOptions, ApolloQueryResult, DefaultContext, MutationOptions, FetchResult, ApolloClient } from '@apollo/client/core';
|
4
|
-
import { RenderableContextService, RenderableContext,
|
4
|
+
import { RenderableContextService, RenderableContext, ThreeDPreviewService, ModelContainer } from '@spiffcommerce/preview';
|
5
5
|
import * as lodash from 'lodash';
|
6
6
|
import { CompleteQuoteMessage, ThemeInstallConfigurationGraphQl, ConversionConfiguration } from '@spiffcommerce/theme-bridge';
|
7
7
|
export { ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation } from '@spiffcommerce/theme-bridge';
|
@@ -1049,10 +1049,16 @@ interface Scene {
|
|
1049
1049
|
* State related to a workflow experience.
|
1050
1050
|
*/
|
1051
1051
|
interface ExperienceOptions {
|
1052
|
+
product: Product;
|
1052
1053
|
transaction: Transaction;
|
1053
1054
|
workflow?: Workflow;
|
1055
|
+
/**
|
1056
|
+
* @deprecated favor inject / eject functions.
|
1057
|
+
*/
|
1058
|
+
previewService?: ThreeDPreviewService;
|
1054
1059
|
modelContainer?: ModelContainer;
|
1055
1060
|
renderableContextService?: LayoutPreviewService;
|
1061
|
+
layouts: ILayout[];
|
1056
1062
|
reloadedState?: LayoutsState;
|
1057
1063
|
/**
|
1058
1064
|
* When true the experience is intended to be immutable.
|
@@ -1088,10 +1094,6 @@ interface ExperienceOptions {
|
|
1088
1094
|
* should get an instance of this class from a Client you have constructed previously.
|
1089
1095
|
*/
|
1090
1096
|
interface WorkflowExperience {
|
1091
|
-
/**
|
1092
|
-
* Get the current transaction for this experience.
|
1093
|
-
*/
|
1094
|
-
getTransaction(): Transaction;
|
1095
1097
|
/**
|
1096
1098
|
* Get the bundle this experience is part of. May be undefined.
|
1097
1099
|
*/
|
@@ -1100,28 +1102,6 @@ interface WorkflowExperience {
|
|
1100
1102
|
* Set the bundle this experience is part of. Can be cleared using undefined.
|
1101
1103
|
*/
|
1102
1104
|
setBundle(bundle: Bundle$1 | undefined): any;
|
1103
|
-
/**
|
1104
|
-
* Get the current product for this experience. May be undefined.
|
1105
|
-
*/
|
1106
|
-
getProduct(): Product | undefined;
|
1107
|
-
/**
|
1108
|
-
* Get the current profanity list for this experience. May be empty.
|
1109
|
-
*/
|
1110
|
-
getProfanityList(): string[];
|
1111
|
-
/**
|
1112
|
-
* Set the current product for this experience.
|
1113
|
-
* @param product The new product to set.
|
1114
|
-
*/
|
1115
|
-
setProduct(integrationProductId: string): Promise<void>;
|
1116
|
-
/**
|
1117
|
-
* Get the current workflow for this experience. May be undefined.
|
1118
|
-
*/
|
1119
|
-
getWorkflow(): Workflow | undefined;
|
1120
|
-
/**
|
1121
|
-
* Set the current workflow for this experience.
|
1122
|
-
* @param workflow The new workflow to set.
|
1123
|
-
*/
|
1124
|
-
setWorkflow(workflow: Workflow): Promise<void>;
|
1125
1105
|
/**
|
1126
1106
|
* Returns the client that was responsible for spawning this experience.
|
1127
1107
|
*/
|
@@ -1310,7 +1290,7 @@ declare enum WorkflowExperienceEventType {
|
|
1310
1290
|
}
|
1311
1291
|
declare class WorkflowExperienceImpl implements WorkflowExperience {
|
1312
1292
|
readonly client: SpiffCommerceClient;
|
1313
|
-
readonly
|
1293
|
+
readonly commandContext: CommandContext;
|
1314
1294
|
readonly graphQlClient: GraphQlClientFunc;
|
1315
1295
|
readonly workflowManager: WorkflowManager;
|
1316
1296
|
readonly isReadOnly: boolean;
|
@@ -1319,20 +1299,11 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
|
|
1319
1299
|
* Bundle this experience has been added to.
|
1320
1300
|
*/
|
1321
1301
|
private bundle?;
|
1322
|
-
private product?;
|
1323
|
-
private profanityList;
|
1324
|
-
private workflow?;
|
1325
1302
|
private currentPriceBreak;
|
1326
1303
|
private renderableScenes;
|
1327
1304
|
private renderableSceneCallbacks;
|
1328
1305
|
private eventCallbacks;
|
1329
1306
|
constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
|
1330
|
-
getTransaction(): Transaction;
|
1331
|
-
getProduct(): Product | undefined;
|
1332
|
-
getProfanityList(): string[];
|
1333
|
-
setProduct(integrationProductId: string): Promise<void>;
|
1334
|
-
getWorkflow(): Workflow | undefined;
|
1335
|
-
setWorkflow(workflow: Workflow): Promise<void>;
|
1336
1307
|
attachAddress(streetAddress?: string, apartment?: string, city?: string, country?: string, state?: string, postCode?: string): Promise<void>;
|
1337
1308
|
attachOrganization(name: string): Promise<void>;
|
1338
1309
|
getBundle(): Bundle$1 | undefined;
|
@@ -1813,9 +1784,6 @@ declare class Transform {
|
|
1813
1784
|
}
|
1814
1785
|
declare const getProductCollections: (ids: string[]) => Promise<ProductCollection[] | undefined>;
|
1815
1786
|
|
1816
|
-
interface BundleIntegrationProductsAddedEventData {
|
1817
|
-
integrationProductIds: string[];
|
1818
|
-
}
|
1819
1787
|
interface ConditionalGlobalPropertiesChangedEventData {
|
1820
1788
|
globalProperties: GlobalPropertyHandle[];
|
1821
1789
|
}
|
@@ -1833,7 +1801,6 @@ interface WorkflowExperienceAddedEventData {
|
|
1833
1801
|
interface WorkflowExperienceRemovedEventData extends WorkflowExperienceAddedEventData {
|
1834
1802
|
}
|
1835
1803
|
type BundleEventMap = {
|
1836
|
-
"bundle-integration-products-added": BundleIntegrationProductsAddedEventData;
|
1837
1804
|
"conditional-global-properties-changed": ConditionalGlobalPropertiesChangedEventData;
|
1838
1805
|
"global-properties-mandatory-changed": GlobalPropertiesMandatoryChangedEventData;
|
1839
1806
|
"workflow-experience-hover-enter": WorkflowExperienceHoverEventData;
|
@@ -1842,7 +1809,7 @@ type BundleEventMap = {
|
|
1842
1809
|
"workflow-experience-removed": WorkflowExperienceRemovedEventData;
|
1843
1810
|
};
|
1844
1811
|
type BundleEventType = keyof BundleEventMap;
|
1845
|
-
type BundleEventData =
|
1812
|
+
type BundleEventData = WorkflowExperienceHoverEventData | ConditionalGlobalPropertiesChangedEventData | WorkflowExperienceAddedEventData;
|
1846
1813
|
type BundleEvent<K extends BundleEventType = BundleEventType> = BundleEventMap[K];
|
1847
1814
|
|
1848
1815
|
/**
|
@@ -2086,8 +2053,6 @@ interface Bundle$1 {
|
|
2086
2053
|
generateQuoteId(): Promise<string>;
|
2087
2054
|
getQuoteCompleteMessage(): CompleteQuoteMessage;
|
2088
2055
|
applyGlobalPropertyState(state: GlobalPropertyState): Promise<void>;
|
2089
|
-
getIntegrationProductIds(): undefined | string[];
|
2090
|
-
addIntegrationProductId(id: string): void;
|
2091
2056
|
}
|
2092
2057
|
|
2093
2058
|
/**
|
@@ -2392,32 +2357,29 @@ interface GetWorkflowFromTransactionOptions extends GetWorkflowOptionsBase {
|
|
2392
2357
|
workflowState?: string;
|
2393
2358
|
type: "transaction";
|
2394
2359
|
}
|
2395
|
-
interface
|
2360
|
+
interface GetNewWorkflowOptionsBase extends GetWorkflowOptionsBase {
|
2396
2361
|
/** A name for the new transaction. */
|
2397
2362
|
designName?: string;
|
2398
2363
|
/** The workflow to load. */
|
2399
|
-
workflowId
|
2364
|
+
workflowId: string;
|
2400
2365
|
/** An existing workflow state, if available. */
|
2401
2366
|
workflowState?: string;
|
2402
2367
|
}
|
2403
|
-
interface
|
2404
|
-
type: "blank";
|
2405
|
-
}
|
2406
|
-
interface GetWorkflowExperienceFromIntegrationProductOptions extends GetNewWorkflowExperienceOptionsBase {
|
2368
|
+
interface GetWorkflowFromIntegrationProductOptions extends GetNewWorkflowOptionsBase {
|
2407
2369
|
integrationProductId: string;
|
2408
2370
|
quantity?: number;
|
2409
2371
|
recipient?: any;
|
2410
2372
|
type: "integration";
|
2411
2373
|
}
|
2412
|
-
interface
|
2374
|
+
interface GetWorkflowFromExternalProductOptions extends GetNewWorkflowOptionsBase {
|
2413
2375
|
/** The external ID associated with an integration. */
|
2414
2376
|
externalIntegrationId: string;
|
2415
2377
|
/** The ID of the product from the external system. */
|
2416
2378
|
externalProductId: string;
|
2417
2379
|
type: "external";
|
2418
2380
|
}
|
2419
|
-
type
|
2420
|
-
type GetWorkflowOptions = GetWorkflowFromTransactionOptions |
|
2381
|
+
type GetNewWorkflowOptions = GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
|
2382
|
+
type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetNewWorkflowOptions;
|
2421
2383
|
interface ClientConfiguration {
|
2422
2384
|
hubUrl: string;
|
2423
2385
|
serverUrl: string;
|
@@ -2697,6 +2659,7 @@ interface WorkflowManager {
|
|
2697
2659
|
getAllLayoutData: () => LayoutState[];
|
2698
2660
|
getLayoutPreviewService: () => LayoutPreviewService | undefined;
|
2699
2661
|
getPreviewService: () => ThreeDPreviewService | undefined;
|
2662
|
+
getProfanities: () => string[];
|
2700
2663
|
getRegionElements: (stepName: string) => RegionElement[];
|
2701
2664
|
getSerializedStep: (stepName: string, serializedSteps: SerializableStep[]) => SerializableStep | undefined;
|
2702
2665
|
getStepSpecificServices: (stepName: string) => StepSpecificServices | undefined;
|
@@ -2704,22 +2667,19 @@ interface WorkflowManager {
|
|
2704
2667
|
getMetadata: (stepName: string) => StepMetadata | undefined;
|
2705
2668
|
getWorkflowMetadata: () => WorkflowMetadata;
|
2706
2669
|
getInformationResults(): InformationResult[];
|
2670
|
+
getTransaction: () => Transaction;
|
2707
2671
|
getTransactionCustomer: () => Customer | undefined;
|
2708
2672
|
setTransactionCustomer: (customer: Customer) => void;
|
2709
|
-
/**
|
2710
|
-
* Sets the current workflow for this experience.
|
2711
|
-
* @param workflow The new workflow to set.
|
2712
|
-
* @returns A promise that resolves when the workflow has been set.
|
2713
|
-
*/
|
2714
|
-
setWorkflow: (workflow: Workflow) => Promise<void>;
|
2715
2673
|
/**
|
2716
2674
|
* @deprecated Use setTransactionCustomer instead.
|
2717
2675
|
*/
|
2718
2676
|
setTransactionCustomerDetails: (details: {
|
2719
2677
|
email: string;
|
2720
2678
|
}) => void;
|
2679
|
+
getWorkflow: () => Workflow;
|
2721
2680
|
getWorkflowSelections: () => WorkflowSelections;
|
2722
2681
|
getStepSelections: () => StepSelections;
|
2682
|
+
getProduct: () => Product;
|
2723
2683
|
/**
|
2724
2684
|
* A promise resolving when the initial state of the workflow has completed loading.
|
2725
2685
|
*/
|
@@ -5218,7 +5178,6 @@ declare class MockWorkflowManager implements WorkflowManager {
|
|
5218
5178
|
getWorkflowExperience(): WorkflowExperience;
|
5219
5179
|
setClient(client: SpiffCommerceClient): void;
|
5220
5180
|
getInitializationPromise(): Promise<void>;
|
5221
|
-
setWorkflow: (workflow: Workflow) => Promise<void>;
|
5222
5181
|
getProduct: () => Product;
|
5223
5182
|
isInitialized(): boolean;
|
5224
5183
|
getCommandContext: () => CommandContext;
|
@@ -5249,6 +5208,7 @@ declare class MockWorkflowManager implements WorkflowManager {
|
|
5249
5208
|
getPreviewService(): undefined;
|
5250
5209
|
setModelContainer: (container: any) => void;
|
5251
5210
|
getModelContainer(): undefined;
|
5211
|
+
getProfanities(): never[];
|
5252
5212
|
getRegionElements(_stepName: string): never[];
|
5253
5213
|
getSerializedStep(_stepName: string, _serializedSteps: SerializableStep[]): undefined;
|
5254
5214
|
getStepSpecificServices(_stepName: string): undefined;
|
@@ -6074,4 +6034,4 @@ declare const overrideWorkflowExperienceRecipientAddress: (workflowExperience: W
|
|
6074
6034
|
*/
|
6075
6035
|
declare const getGlobalPropertyStateForBundle: (bundleId: string) => Promise<GlobalPropertyState | undefined>;
|
6076
6036
|
|
6077
|
-
export { AddonHandle, type AddressComponent, type AddressValidationJob, AddressValidationJobStatus, type AddressValidationResult, AddressValidationResultConfirmationLevel, AddressValidationStatus, type Animatable, type AnyStepData, ArrayInput, AspectType, type Asset, type AssetConfiguration, AssetNotFoundError, type AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, type Bundle$1 as Bundle, BundleDesignCreationCartAddMode, type BundleDesignCreationMessage, type BundleEvent, type BundleEventData, type BundleEventType, type Bundle as BundleRaw, type BundleStakeholder, CanvasCommand, CollectionProduct, type ColorDefinition, type ColorOption, ColorOptionGlobalPropertyHandle, type ColorProfileProps, CommandContext, type CommandState, type Condition, type ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, type Customer, type CustomerDetailsInput, DeleteElementCommand, type DesignCreationMessage, type DesignCreationProgressUpdate, type DesignInputStep, type DigitalContentStepData, DigitalContentStepHandle, type EditedSteps, type ExportedStepData, type ExportedStepDataProperty, type ExportedStepDataPropertyType, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, type FrameElement, FrameService, FrameStep, type FrameStepData, FrameStepHandle, type FrameThresholdSettings, type
|
6037
|
+
export { AddonHandle, type AddressComponent, type AddressValidationJob, AddressValidationJobStatus, type AddressValidationResult, AddressValidationResultConfirmationLevel, AddressValidationStatus, type Animatable, type AnyStepData, ArrayInput, AspectType, type Asset, type AssetConfiguration, AssetNotFoundError, type AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, type Bundle$1 as Bundle, BundleDesignCreationCartAddMode, type BundleDesignCreationMessage, type BundleEvent, type BundleEventData, type BundleEventType, type Bundle as BundleRaw, type BundleStakeholder, CanvasCommand, CollectionProduct, type ColorDefinition, type ColorOption, ColorOptionGlobalPropertyHandle, type ColorProfileProps, CommandContext, type CommandState, type Condition, type ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, CurrencyContext, CurrencyService, type Customer, type CustomerDetailsInput, DeleteElementCommand, type DesignCreationMessage, type DesignCreationProgressUpdate, type DesignInputStep, type DigitalContentStepData, DigitalContentStepHandle, type EditedSteps, type ExportedStepData, type ExportedStepDataProperty, type ExportedStepDataPropertyType, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, type FrameElement, FrameService, FrameStep, type FrameStepData, FrameStepHandle, type FrameThresholdSettings, type GetNewWorkflowOptions, type GetWorkflowOptions, type GlobalPropertiesMandatoryChangedEventData, type GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, type ILayout, type IllustrationElement, type IllustrationStepData, IllustrationStepHandle, type ImageElement, InformationMessageType, type InformationResult, type InformationStepData, InformationStepHandle, type Integration, type IntegrationOptionResource, IntegrationProduct, IntegrationType, type LayoutComponentConfiguration, type LayoutData, type LayoutElement, LayoutElementFactory, LayoutElementType, LayoutNotFoundError, LayoutRenderingPurpose, type LayoutState, type LayoutsState, type MandatorySteps, MaterialEffectMode, type MaterialStepData, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, type ModelStepData, ModelStepHandle, type ModuleStepData, ModuleStepHandle, MoveCommand, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, type OptionResource, type Order, type OrderItem, type PapyrusComponent, ParseError, type PictureStepData, PictureStepHandle, type Placeable, type PmsSearchResult, type Point, type Product, ProductCameraRig, ProductCollection, ProductCollectionProductSortKey, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, type QuestionStepData, QuestionStepHandle, QueueablePromise, type Recipient, type Region, type RegionElement, type RenderableScene, ResizeCommand, ResourceNotFoundError, RotateCommand, type SavedDesign, ScaleAxis, type SelectionStorage, SendBackwardsCommand, type ShapeStepData, ShapeStepHandle, type ShareAction, ShareActionType, type SilentIllustrationStepData, SpiffCommerceClient, type Stakeholder, StakeholderType, type StateMutationFunc, type Step, type StepAspect, StepAspectType, type StepElements, type StepGroup, StepHandle, type StepStorage, StepType, TextAlgorithm, TextChangeCommand, type TextChangeResult, TextGlobalPropertyHandle, TextInput, type TextStepData, TextStepHandle, type TextStepStorage, type TextboxElement, type Theme, type ToastCallback, type Transaction, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, UnitOfMeasurement, UpdateImageSourceCommand, Variant, type VariantResource, type Vector3, type Workflow, type WorkflowExperience, WorkflowExperienceEventType, type WorkflowExperienceHoverEventData, WorkflowExperienceImpl, type WorkflowManager, type WorkflowMetadata, type WorkflowPanel, type WorkflowScene, type WorkflowSelections, type WorkflowStorage, assetService, browserColorToHex, cmPerPixel, createDesign, currentDirection, dataUrlFromExternalUrl, deleteBundle, designService, determineCorrectFontSizeAndLines, digitalContentStepService, domParser, duplicateBundle, duplicateTransaction, fetchAsString, findAngle, findElement, findPmsColors, frameDataCache, frameStepService, generate, generateCommands, generateSVGWithUnknownColors, generateStateFromDesignInputSteps, getAddressValidationJobs, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getGlobalPropertyStateForBundle, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getProductCollections, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getValidationJobsForWorkflowExperiences, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, metafieldManager, mmPerPixel, modelStepService, modifySVGColors, moduleStepService, nameBundle, nameTransaction, optionService, outlineFontsInSvg, overrideWorkflowExperienceRecipientAddress, patternImageDataCache, persistenceService, pictureStepService, pmsToRgb, questionStepService, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout, rgbToPms, rotateAroundPoint, sanitizeSvgTree, setBearerAuthenticationToken, setCanvasModule, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, svgColorValueToDefinition, svgStringDimensions, svgToDataUrl, textStepService, toast, validateWorkflowExperienceRecipient, validateWorkflowExperienceRecipients, xmlSerializer };
|