@thryveai/theme-interfaces 2.8.45 → 2.8.46

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.
@@ -2,6 +2,7 @@ import { IDefaultCounty, IDefaultExternal, IValidationType, LinkTarget } from ".
2
2
  import { IDefaultColors, IDefaultThemeInterface } from "./default-theme.interface";
3
3
  import { IDefaultRetailerSettingsVersion2 } from "./default-settings.interfaces";
4
4
  import { IThemeImages } from "./theme.interfaces";
5
+ import { IAttributeLabelVariants } from "./shared-settings.interfaces";
5
6
  /**
6
7
  * Helper types
7
8
  */
@@ -32,7 +33,7 @@ export interface IAdminControl<T> {
32
33
  group?: IAdminGroupType;
33
34
  message?: IMessageProps;
34
35
  helpLink?: string;
35
- options?: string[] | number[] | Object[] | IDefaultCounty[] | IValidationType[] | IImageRequiredFormat | LinkTarget | NumberRange;
36
+ options?: string[] | number[] | Object[] | IDefaultCounty[] | IValidationType[] | IAttributeLabelVariants[] | IImageRequiredFormat | LinkTarget | NumberRange;
36
37
  uniqueOptions?: IDefaultExternal["provider"][];
37
38
  value?: ITemplateObject<T>;
38
39
  optional?: boolean;
@@ -5,8 +5,23 @@ export interface ISharedSettings {
5
5
  features: ISharedFeatures;
6
6
  checkout: ISharedCheckout;
7
7
  general: ISharedGeneral;
8
+ products: ISharedProducts;
8
9
  adminPanelOnly: IAdminOnlyV2;
9
10
  }
11
+ export interface ISharedProducts {
12
+ productLabels: ProductLabelSettings;
13
+ }
14
+ export interface ProductLabelSettings {
15
+ maxListingLabels: number;
16
+ attributeLabelRules: AttributeLabelRule[];
17
+ }
18
+ export interface AttributeLabelRule {
19
+ attributeKey: string;
20
+ matchValue?: string | number;
21
+ variant: IAttributeLabelVariants;
22
+ renderBeforeRuleLabels: boolean;
23
+ }
24
+ export declare type IAttributeLabelVariants = "info" | "warning" | "critical";
10
25
  export interface ISharedFeatures {
11
26
  recommendedSubstitutions: IRecommendedSubstitutions;
12
27
  multilingual: boolean;
@@ -214,4 +214,56 @@ exports.AdminSharedSettingsTemplateSFUI = {
214
214
  // },
215
215
  },
216
216
  },
217
+ products: {
218
+ title: "Products",
219
+ description: "",
220
+ type: exports.AdminSharedTemplateInputTypes.collapsableObject,
221
+ value: {
222
+ productLabels: {
223
+ title: "Product Labels",
224
+ description: "Configure how labels appear on product cards. This includes labels from your shopping rules and labels created from product attributes.",
225
+ type: exports.AdminSharedTemplateInputTypes.collapsableObject,
226
+ value: {
227
+ maxListingLabels: {
228
+ title: "Maximum Labels",
229
+ description: "The total number of labels that can appear on a product card (listings). This applies to both shopping rule labels and attribute-based labels combined.",
230
+ type: exports.AdminSharedTemplateInputTypes.inputNumber,
231
+ options: {
232
+ min: 1,
233
+ max: 8,
234
+ },
235
+ },
236
+ attributeLabelRules: {
237
+ title: "Attribute Based Label Rules",
238
+ description: "Create labels based on your product attributes. These labels will appear together with shopping-rule labels.",
239
+ type: exports.AdminSharedTemplateInputTypes.array,
240
+ value: {
241
+ attributeKey: {
242
+ title: "Attribute Display Name",
243
+ description: "Choose the attribute display name that should trigger this label.",
244
+ type: exports.AdminSharedTemplateInputTypes.inputChar,
245
+ },
246
+ variant: {
247
+ title: "Label Style",
248
+ description: "Select the visual style of the label (informational, warning, or critical).",
249
+ type: exports.AdminSharedTemplateInputTypes.dropdown,
250
+ options: ["info", "warning", "critical"],
251
+ },
252
+ matchValue: {
253
+ title: "Match Specific Value",
254
+ description: "Use only if this label should appear for a specific attribute value. Leave empty to show the label when the attribute exists (for strings) or is true (for boolean attributes).",
255
+ type: exports.AdminSharedTemplateInputTypes.inputChar,
256
+ optional: true,
257
+ },
258
+ renderBeforeRuleLabels: {
259
+ title: "Show Before Shopping Rule Labels",
260
+ description: "If enabled, this label will appear before any labels generated from shopping rules.",
261
+ type: exports.AdminSharedTemplateInputTypes.checkbox,
262
+ },
263
+ },
264
+ },
265
+ },
266
+ },
267
+ },
268
+ },
217
269
  };
@@ -61,5 +61,11 @@ var CommonSharedSettingsConfig = {
61
61
  orderHeader: true,
62
62
  },
63
63
  },
64
+ products: {
65
+ productLabels: {
66
+ maxListingLabels: 1,
67
+ attributeLabelRules: [],
68
+ },
69
+ },
64
70
  };
65
71
  exports.default = CommonSharedSettingsConfig;