@bunnyapp/components 1.3.0 → 1.4.0-beta.1

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/cjs/index.js CHANGED
@@ -154,7 +154,7 @@ var BrandContext = react.createContext({
154
154
  });
155
155
 
156
156
  // This will be replaced at build time by rollup-plugin-replace
157
- var PACKAGE_VERSION = '1.3.0-beta.10';
157
+ var PACKAGE_VERSION = '1.3.0';
158
158
  var createRequestHeaders = function (token) {
159
159
  var headers = common.createClientDevHeaders({ token: token });
160
160
  // Add the components version header
@@ -21758,7 +21758,7 @@ var PlanPickerCheckoutBar = function (_a) {
21758
21758
  // WARNING: There is a preview button on APP that will need to be changed if this query is changed
21759
21759
  var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n showPriceAsMonthly\n basePrice\n currencyId\n id\n monthlyBasePrice\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n featureAddon\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n priceList {\n id\n }\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
21760
21760
  var getPriceListChangeOptions = function (_a) {
21761
- var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription, accountCurrencyId = _a.accountCurrencyId;
21761
+ var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
21762
21762
  return __awaiter(void 0, void 0, void 0, function () {
21763
21763
  var response, priceListChangeOptions;
21764
21764
  return __generator(this, function (_b) {
@@ -21779,8 +21779,6 @@ var getPriceListChangeOptions = function (_a) {
21779
21779
  if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) {
21780
21780
  priceListChangeOptions.priceLists.sort(function (a, b) { return a.plan.position - b.plan.position; });
21781
21781
  }
21782
- // Filter out price lists that don't have the same currency as the account
21783
- priceListChangeOptions.priceLists = priceListChangeOptions.priceLists.filter(function (priceList) { return priceList.currencyId === accountCurrencyId; });
21784
21782
  return [2 /*return*/, priceListChangeOptions];
21785
21783
  }
21786
21784
  });
@@ -22552,7 +22550,6 @@ var PlanPicker = function () {
22552
22550
  var apiHost = react.useContext(BunnyContext).apiHost;
22553
22551
  var _b = react.useContext(SubscriptionsContext), isInPreviewMode = _b.isInPreviewMode, productId = _b.productId, upgradingSubscription = _b.upgradingSubscription;
22554
22552
  var _c = react.useContext(QuotePreviewContext), quotePreviewData = _c.quotePreviewData, setQuotePreviewData = _c.setQuotePreviewData;
22555
- var account = useCurrentUserData(token).account;
22556
22553
  // Hooks
22557
22554
  var showInfoNotification = common.useInfoNotification();
22558
22555
  // Queries
@@ -22575,7 +22572,6 @@ var PlanPicker = function () {
22575
22572
  productId: productId,
22576
22573
  token: token,
22577
22574
  upgradingSubscription: upgradingSubscription,
22578
- accountCurrencyId: account === null || account === void 0 ? void 0 : account.currencyId,
22579
22575
  });
22580
22576
  },
22581
22577
  enabled: !areSubscriptionsLoading,
@@ -23159,13 +23155,10 @@ var SubscriptionsListContainer = function (_a) {
23159
23155
  var apiHost = react.useContext(BunnyContext).apiHost;
23160
23156
  var gap = react.useContext(SubscriptionsContext).gap;
23161
23157
  var token = useToken();
23162
- var account = useCurrentUserData(token).account;
23163
23158
  // Queries
23164
23159
  var _c = reactQuery.useQuery({
23165
23160
  queryKey: common.QueryKeyFactory.default.planChangeOptionsKey({ token: token }),
23166
- queryFn: function () {
23167
- return getPriceListChangeOptions({ apiHost: apiHost, token: token, accountCurrencyId: account === null || account === void 0 ? void 0 : account.currencyId });
23168
- },
23161
+ queryFn: function () { return getPriceListChangeOptions({ apiHost: apiHost, token: token }); },
23169
23162
  enabled: Boolean(onChangePlanClick),
23170
23163
  }), priceListChangeOptions = _c.data, arePriceListChangeOptionsLoading = _c.isLoading;
23171
23164
  if (subscriptionsAreLoading ||
@@ -1,10 +1,9 @@
1
1
  import { Subscription } from '@bunnyapp/common';
2
- declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, productId, token, upgradingSubscription, accountCurrencyId, }: {
2
+ declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, productId, token, upgradingSubscription, }: {
3
3
  apiHost: string;
4
4
  isInPreviewMode?: boolean | undefined;
5
5
  productId?: string | undefined;
6
6
  token?: string | undefined;
7
7
  upgradingSubscription?: Subscription | undefined;
8
- accountCurrencyId: string;
9
8
  }) => Promise<any>;
10
9
  export default getPriceListChangeOptions;
package/dist/esm/index.js CHANGED
@@ -143,7 +143,7 @@ var BrandContext = createContext({
143
143
  });
144
144
 
145
145
  // This will be replaced at build time by rollup-plugin-replace
146
- var PACKAGE_VERSION = '1.3.0-beta.10';
146
+ var PACKAGE_VERSION = '1.3.0';
147
147
  var createRequestHeaders = function (token) {
148
148
  var headers = createClientDevHeaders({ token: token });
149
149
  // Add the components version header
@@ -21747,7 +21747,7 @@ var PlanPickerCheckoutBar = function (_a) {
21747
21747
  // WARNING: There is a preview button on APP that will need to be changed if this query is changed
21748
21748
  var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n showPriceAsMonthly\n basePrice\n currencyId\n id\n monthlyBasePrice\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n featureAddon\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n priceList {\n id\n }\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
21749
21749
  var getPriceListChangeOptions = function (_a) {
21750
- var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription, accountCurrencyId = _a.accountCurrencyId;
21750
+ var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
21751
21751
  return __awaiter(void 0, void 0, void 0, function () {
21752
21752
  var response, priceListChangeOptions;
21753
21753
  return __generator(this, function (_b) {
@@ -21768,8 +21768,6 @@ var getPriceListChangeOptions = function (_a) {
21768
21768
  if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) {
21769
21769
  priceListChangeOptions.priceLists.sort(function (a, b) { return a.plan.position - b.plan.position; });
21770
21770
  }
21771
- // Filter out price lists that don't have the same currency as the account
21772
- priceListChangeOptions.priceLists = priceListChangeOptions.priceLists.filter(function (priceList) { return priceList.currencyId === accountCurrencyId; });
21773
21771
  return [2 /*return*/, priceListChangeOptions];
21774
21772
  }
21775
21773
  });
@@ -22541,7 +22539,6 @@ var PlanPicker = function () {
22541
22539
  var apiHost = useContext(BunnyContext).apiHost;
22542
22540
  var _b = useContext(SubscriptionsContext), isInPreviewMode = _b.isInPreviewMode, productId = _b.productId, upgradingSubscription = _b.upgradingSubscription;
22543
22541
  var _c = useContext(QuotePreviewContext), quotePreviewData = _c.quotePreviewData, setQuotePreviewData = _c.setQuotePreviewData;
22544
- var account = useCurrentUserData(token).account;
22545
22542
  // Hooks
22546
22543
  var showInfoNotification = useInfoNotification();
22547
22544
  // Queries
@@ -22564,7 +22561,6 @@ var PlanPicker = function () {
22564
22561
  productId: productId,
22565
22562
  token: token,
22566
22563
  upgradingSubscription: upgradingSubscription,
22567
- accountCurrencyId: account === null || account === void 0 ? void 0 : account.currencyId,
22568
22564
  });
22569
22565
  },
22570
22566
  enabled: !areSubscriptionsLoading,
@@ -23148,13 +23144,10 @@ var SubscriptionsListContainer = function (_a) {
23148
23144
  var apiHost = useContext(BunnyContext).apiHost;
23149
23145
  var gap = useContext(SubscriptionsContext).gap;
23150
23146
  var token = useToken();
23151
- var account = useCurrentUserData(token).account;
23152
23147
  // Queries
23153
23148
  var _c = useQuery({
23154
23149
  queryKey: QueryKeyFactory.default.planChangeOptionsKey({ token: token }),
23155
- queryFn: function () {
23156
- return getPriceListChangeOptions({ apiHost: apiHost, token: token, accountCurrencyId: account === null || account === void 0 ? void 0 : account.currencyId });
23157
- },
23150
+ queryFn: function () { return getPriceListChangeOptions({ apiHost: apiHost, token: token }); },
23158
23151
  enabled: Boolean(onChangePlanClick),
23159
23152
  }), priceListChangeOptions = _c.data, arePriceListChangeOptionsLoading = _c.isLoading;
23160
23153
  if (subscriptionsAreLoading ||
@@ -1,10 +1,9 @@
1
1
  import { Subscription } from '@bunnyapp/common';
2
- declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, productId, token, upgradingSubscription, accountCurrencyId, }: {
2
+ declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, productId, token, upgradingSubscription, }: {
3
3
  apiHost: string;
4
4
  isInPreviewMode?: boolean | undefined;
5
5
  productId?: string | undefined;
6
6
  token?: string | undefined;
7
7
  upgradingSubscription?: Subscription | undefined;
8
- accountCurrencyId: string;
9
8
  }) => Promise<any>;
10
9
  export default getPriceListChangeOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-beta.1",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",