@haus-storefront-react/vendure-plugin-configs 0.0.26 → 0.0.28

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
@@ -1,3 +1,19 @@
1
+ ## 0.0.27 (2025-09-04)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated core to 0.0.27
6
+ - Updated common/utils to 0.0.27
7
+ - Updated shared/types to 0.0.27
8
+
9
+ ## 0.0.26 (2025-09-02)
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated core to 0.0.26
14
+ - Updated common/utils to 0.0.26
15
+ - Updated shared/types to 0.0.26
16
+
1
17
  ## 0.0.25 (2025-09-01)
2
18
 
3
19
  ### 🧱 Updated Dependencies
package/campaign.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CATkY-bf.js"),r=require("./index-dZ1ztwCK.js"),d=new o.VendurePluginConfig({name:"campaign",enableFeatures:{ordinaryPrice:({variant:i,orderLine:e,searchResult:n,product:a})=>{if(e){const t=e.productVariant;return t?.ordinaryPrice?r.getPrice(t?.ordinaryPrice)*e.quantity:e.discountedLinePriceWithTax}return i?r.getPrice(i.ordinaryPrice||0):n?r.getPrice(n.ordinaryPrice||0):a?r.getProductPriceFromVariants(a.variants):0}},queryUpdates:{}});d.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]}]},activeOrder:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]}});exports.VendureCampaignPlugin=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CATkY-bf.js"),e=require("./index-dZ1ztwCK.js"),d=new c.VendurePluginConfig({name:"campaign",enableFeatures:{ordinaryPrice:({variant:i,orderLine:r,searchResult:n,product:a})=>{if(r){const t=r.productVariant;return t?.ordinaryPrice?e.getPrice(t?.ordinaryPrice)*r.quantity:r.discountedLinePriceWithTax}return i?e.getPrice(i.ordinaryPrice||0):n?e.getPrice(n.ordinaryPrice||0):a?e.getProductPriceFromVariants(a.variants):0}},queryUpdates:{}});d.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]}]},activeOrder:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]}});const o=(i,r)=>{const n=e.getPrice(i),a=e.getPrice(r);return e.getPrice(i)===0?!1:a!==n};exports.VendureCampaignPlugin=d;exports.isCampaign=o;
package/campaign.mjs CHANGED
@@ -99,6 +99,11 @@ s.setQueryUpdates({
99
99
  }]
100
100
  }
101
101
  });
102
+ const f = (i, r) => {
103
+ const a = e(i), n = e(r);
104
+ return e(i) === 0 ? !1 : n !== a;
105
+ };
102
106
  export {
103
- s as VendureCampaignPlugin
107
+ s as VendureCampaignPlugin,
108
+ f as isCampaign
104
109
  };
@@ -3,6 +3,9 @@ declare module '@haus-storefront-react/shared-types' {
3
3
  interface Product {
4
4
  ordinaryPrice?: Price;
5
5
  }
6
+ interface ProductVariant {
7
+ ordinaryPrice?: Price;
8
+ }
6
9
  interface SearchResult {
7
10
  ordinaryPrice?: Price;
8
11
  }
@@ -1,5 +1,7 @@
1
1
  import { VendurePluginConfig } from '../plugin-config';
2
2
  import { CampaignFeatures } from './vendure-campaign-plugin.types';
3
+ import { PriceRange, SinglePrice } from '@haus-storefront-react/shared-types';
3
4
  export declare const VendureCampaignPlugin: VendurePluginConfig<CampaignFeatures, Record<string, (...args: any[]) => any>, {
4
5
  [x: string]: any;
5
6
  }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
7
+ export declare const isCampaign: (ordinaryPrice: PriceRange | SinglePrice | number, currentPrice: PriceRange | SinglePrice | number) => boolean;
@@ -3,17 +3,9 @@ export interface CampaignFeatures {
3
3
  showCampaignPrices: boolean;
4
4
  ordinaryPrice: (props: {
5
5
  product?: Product;
6
- searchResult?: SearchResult & {
7
- ordinaryPrice?: Price;
8
- };
9
- variant?: ProductVariant & {
10
- ordinaryPrice?: Price;
11
- };
12
- orderLine?: OrderLine & {
13
- productVariant: ProductVariant & {
14
- ordinaryPrice?: Price;
15
- };
16
- };
6
+ searchResult?: SearchResult;
7
+ variant?: ProductVariant;
8
+ orderLine?: OrderLine;
17
9
  identifier?: string;
18
10
  }) => Price;
19
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-storefront-react/vendure-plugin-configs",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -41,8 +41,8 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@haus-storefront-react/common-utils": "0.0.26",
45
- "@haus-storefront-react/core": "0.0.26",
46
- "@haus-storefront-react/shared-types": "0.0.26"
44
+ "@haus-storefront-react/common-utils": "0.0.28",
45
+ "@haus-storefront-react/core": "0.0.28",
46
+ "@haus-storefront-react/shared-types": "0.0.28"
47
47
  }
48
48
  }