@spiffcommerce/core 21.24.0 → 22.0.0

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 CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [22.0.0] - 10-07-2024
9
+
10
+ ### Changed
11
+
12
+ - `matchHexToPms` now returns a list of objects of `{ pms: string; hex: string; }` rather than strings.
13
+
14
+ ### Added
15
+
16
+ - `findPmsColors(input: string, limit?: number): PmsSearchResult[]`: A function to find PMS colors by name using fuzzy search.
17
+
8
18
  ## [21.8.1] - 27-03-2024
9
19
 
10
20
  ### Fixed
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { Animatable, AnyStepData, AspectType, Asset, AssetType, BringForwardComm
4
4
  import { ApolloClient, MutationOptions, FetchResult } from '@apollo/client/core';
5
5
  import { RenderableContextService, RenderableContext, ThreeDPreviewService, ModelContainer } from '@spiffcommerce/preview';
6
6
  import * as lodash from 'lodash';
7
+ import { FuseResult } from 'fuse.js';
7
8
 
8
9
  declare class OptionService {
9
10
  /**
@@ -3402,7 +3403,26 @@ declare const promiseCache: PromiseCache;
3402
3403
 
3403
3404
  declare function pmsToRgb(color: string): string;
3404
3405
  declare function rgbToPms(color: string): string;
3405
- declare function matchHexToPms(hex: string, maxDistance?: number): string[];
3406
+ /**
3407
+ * Matches an input hex code (RRGGBB) to a number of PMS values. If an exact match is found, it will always be the first value in the resulting array.
3408
+ * @param hex A string containing the hexadecimal representation of a color, presented as RRGGBB (case sensitive).
3409
+ * @param maxDistance The maximum distance the input can be from a PMS color to be considered a match.
3410
+ * @returns An array of PMS color strings.
3411
+ */
3412
+ declare function matchHexToPms(hex: string, maxDistance?: number): {
3413
+ pms: string;
3414
+ hex: string;
3415
+ }[];
3416
+ type PmsSearchResult = FuseResult<{
3417
+ pms: string;
3418
+ hex: string;
3419
+ }>;
3420
+ /**
3421
+ * Searches for the input string across all of the known PMS values.
3422
+ * @param input The string to find.
3423
+ * @returns An array of objects that contain information on the matched PMS values.
3424
+ */
3425
+ declare function findPmsColors(input: string, limit?: number): PmsSearchResult[];
3406
3426
  /**
3407
3427
  * Converts an arbitrary browser color value into a hexadecimal string (RRGGBB).
3408
3428
  * If the provided color string is anything other than a hex code, it will use a canvas to determine the hex value.
@@ -3420,4 +3440,4 @@ declare class ModuleStepHandle extends StepHandle<ModuleStepData> {
3420
3440
  selectVariant(): Promise<void>;
3421
3441
  }
3422
3442
 
3423
- export { AddonHandle, ArrayInput, AssetNotFoundError, Bundle$1 as Bundle, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, CollectionProduct, ColorOption, ColorOptionGlobalPropertyHandle, ConditionalGlobalPropertiesChangedEventData, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepHandle, EditedSteps, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, ModuleStepHandle, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextGlobalPropertyHandle, TextInput, TextStepHandle, TextStepStorage, ToastCallback, Transaction, TransactionShareAction, TransactionShareActionType, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, browserColorToHex, createDesign, designService, digitalContentStepService, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, matchHexToPms, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, pmsToRgb, questionStepService, rgbToPms, setBearerAuthenticationToken, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
3443
+ export { AddonHandle, ArrayInput, AssetNotFoundError, Bundle$1 as Bundle, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, CollectionProduct, ColorOption, ColorOptionGlobalPropertyHandle, ConditionalGlobalPropertiesChangedEventData, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepHandle, EditedSteps, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, IntegrationProduct, IntegrationType, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, ModuleStepHandle, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, ParseError, PictureStepHandle, PmsSearchResult, Product, ProductCameraRig, ProductCollection, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextGlobalPropertyHandle, TextInput, TextStepHandle, TextStepStorage, ToastCallback, Transaction, TransactionShareAction, TransactionShareActionType, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, Variant, Vector3, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, browserColorToHex, createDesign, designService, digitalContentStepService, findPmsColors, frameStepService, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, matchHexToPms, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, pmsToRgb, questionStepService, rgbToPms, setBearerAuthenticationToken, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };