@spiffcommerce/core 2.0.0 → 3.1.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/dist/types.d.ts CHANGED
@@ -368,7 +368,7 @@ declare class TextStepService implements StepService<_TextStepData1> {
368
368
  * @param stepData The text step to get colors for.
369
369
  * @returns A list of color objects containg fill, stroke and variant if available.
370
370
  */
371
- availableColors(stepData: _Step1<_TextStepData1>): Promise<ColorOption[]>;
371
+ availableColors(stepData: _Step1<_TextStepData1>): ColorOption[];
372
372
  changeFill(stepData: _Step1<_TextStepData1>, newColor: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
373
373
  /**
374
374
  * Given an element and a string, filters any characters from the string that are
@@ -824,7 +824,7 @@ interface Product {
824
824
  */
825
825
  conversionConfiguration?: ConversionConfiguration;
826
826
  }
827
- interface ColorOption {
827
+ export interface ColorOption {
828
828
  id?: string;
829
829
  fill?: string;
830
830
  stroke?: string;
@@ -1474,7 +1474,7 @@ export class TextStepHandle extends StepHandle<_TextStepData1> {
1474
1474
  /**
1475
1475
  * @returns A list of colors that can be used to fill the text.
1476
1476
  */
1477
- getAvailableColors(): Promise<ColorOption[]>;
1477
+ getAvailableColors(): ColorOption[];
1478
1478
  /**
1479
1479
  * Changes the fill of text related to this step to the new fill value.
1480
1480
  * @param fill A new fill value to use.
@@ -1511,6 +1511,16 @@ export class TextStepHandle extends StepHandle<_TextStepData1> {
1511
1511
  hasVaryingSelection(): boolean | undefined;
1512
1512
  hasColorPicker(): boolean | undefined;
1513
1513
  getRegions(): import("@spiffcommerce/papyrus").Region[];
1514
+ /**
1515
+ * Return the maximum characters allowed for
1516
+ * this step, or undefined if there is no limit.
1517
+ */
1518
+ getCharacterLimit(): number | undefined;
1519
+ /**
1520
+ * Return the remaining amount of characters that
1521
+ * the user is allowed to add, or undefined if there is no limit.
1522
+ */
1523
+ getCharactersRemaining(): number | undefined;
1514
1524
  }
1515
1525
  export const createDesign: (workflowManager: WorkflowManager, workflow: _Workflow1, layouts: _ILayout1[], getReducerState: () => _CommandState1, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, updateVariationRecords: (variationRecords: VariationRecord[]) => Promise<void>, variationRecords: VariationRecord[], createPreviewImage: (shouldRender3D?: boolean) => Promise<string>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
1516
1526
  export interface SavedDesign {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "2.0.0",
3
+ "version": "3.1.0",
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",