@fluid-app/portal-sdk 0.1.341 → 0.1.343
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/{AddressAutocompleteInput-C0ns8N-l.cjs → AddressAutocompleteInput-BVxYYKMa.cjs} +3 -2
- package/dist/AddressAutocompleteInput-BVxYYKMa.cjs.map +1 -0
- package/dist/{AddressAutocompleteInput-BQ7HCDqS.mjs → AddressAutocompleteInput-CaIj4sj0.mjs} +3 -2
- package/dist/AddressAutocompleteInput-CaIj4sj0.mjs.map +1 -0
- package/dist/{FluidProvider-BqJ-t2bW.mjs → FluidProvider-7uXylc_0.mjs} +3 -3
- package/dist/{FluidProvider-BqJ-t2bW.mjs.map → FluidProvider-7uXylc_0.mjs.map} +1 -1
- package/dist/{FluidProvider-BFU7ermL.cjs → FluidProvider-DvM9XXPP.cjs} +3 -3
- package/dist/{FluidProvider-BFU7ermL.cjs.map → FluidProvider-DvM9XXPP.cjs.map} +1 -1
- package/dist/{MessagingScreen-ZwSPp6zu.mjs → MessagingScreen-B0ssUtlx.mjs} +2 -2
- package/dist/{MessagingScreen-ZwSPp6zu.mjs.map → MessagingScreen-B0ssUtlx.mjs.map} +1 -1
- package/dist/{MessagingScreen-D_wVko-i.cjs → MessagingScreen-C0H6oqOh.cjs} +2 -2
- package/dist/{MessagingScreen-D_wVko-i.cjs.map → MessagingScreen-C0H6oqOh.cjs.map} +1 -1
- package/dist/{MessagingScreen-7BBNidBx.cjs → MessagingScreen-CMoiGTh4.cjs} +3 -3
- package/dist/{MessagingScreen-BIWRCS3T.mjs → MessagingScreen-DeUg6OJ_.mjs} +3 -3
- package/dist/{OrdersScreen-t1EwXPZx.cjs → OrdersScreen-C-QurbNs.cjs} +3 -3
- package/dist/{OrdersScreen-BkUvISL0.mjs → OrdersScreen-CAjLwrbh.mjs} +3 -3
- package/dist/{OrdersScreen-DgriwQBo.mjs → OrdersScreen-CbsE8ftf.mjs} +2 -2
- package/dist/{OrdersScreen-DgriwQBo.mjs.map → OrdersScreen-CbsE8ftf.mjs.map} +1 -1
- package/dist/{OrdersScreen-TGNvFpjj.cjs → OrdersScreen-Cd5sBHDs.cjs} +2 -2
- package/dist/{OrdersScreen-TGNvFpjj.cjs.map → OrdersScreen-Cd5sBHDs.cjs.map} +1 -1
- package/dist/{ProfileScreen-CP5ijd_t.cjs → ProfileScreen-BO7nLKOQ.cjs} +25 -16
- package/dist/ProfileScreen-BO7nLKOQ.cjs.map +1 -0
- package/dist/{ProfileScreen-DXlKK4gO.cjs → ProfileScreen-BYQD2sva.cjs} +4 -4
- package/dist/{ProfileScreen-Bw8W8nxK.mjs → ProfileScreen-BZ5jKqkD.mjs} +25 -16
- package/dist/ProfileScreen-BZ5jKqkD.mjs.map +1 -0
- package/dist/{ProfileScreen-CArZ7TAm.mjs → ProfileScreen-HwGAs-oy.mjs} +4 -4
- package/dist/{QuickLinksWidget-Cik7DoRr.cjs → QuickLinksWidget-BRcUEh_P.cjs} +16 -9
- package/dist/{QuickLinksWidget-Cik7DoRr.cjs.map → QuickLinksWidget-BRcUEh_P.cjs.map} +1 -1
- package/dist/{QuickLinksWidget-Dwk93xrT.mjs → QuickLinksWidget-D8LqZkUS.mjs} +16 -9
- package/dist/{QuickLinksWidget-Dwk93xrT.mjs.map → QuickLinksWidget-D8LqZkUS.mjs.map} +1 -1
- package/dist/{ShopScreen-CtqHSaUW.mjs → ShopScreen-Bg63UWLt.mjs} +3 -3
- package/dist/{ShopScreen-BjuLPVrk.cjs → ShopScreen-Bo8d-yeD.cjs} +2 -2
- package/dist/{ShopScreen-BjuLPVrk.cjs.map → ShopScreen-Bo8d-yeD.cjs.map} +1 -1
- package/dist/{ShopScreen-DNJ4Geoq.mjs → ShopScreen-DNA1VtjP.mjs} +2 -2
- package/dist/{ShopScreen-DNJ4Geoq.mjs.map → ShopScreen-DNA1VtjP.mjs.map} +1 -1
- package/dist/{ShopScreen-CwGh-q7J.cjs → ShopScreen-DojSbbAC.cjs} +3 -3
- package/dist/{SubscriptionsScreen-TAXj2UXa.cjs → SubscriptionsScreen-CBSQGdm6.cjs} +4 -4
- package/dist/{SubscriptionsScreen-Dz1PGO2z.cjs → SubscriptionsScreen-Cq3Bacp2.cjs} +49 -31
- package/dist/SubscriptionsScreen-Cq3Bacp2.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-CVKyyzbR.mjs → SubscriptionsScreen-eKtKSQNa.mjs} +49 -31
- package/dist/SubscriptionsScreen-eKtKSQNa.mjs.map +1 -0
- package/dist/{SubscriptionsScreen-B55dK8Qb.mjs → SubscriptionsScreen-jCZjoRc6.mjs} +4 -4
- package/dist/index.cjs +18 -18
- package/dist/index.mjs +18 -18
- package/package.json +18 -18
- package/dist/AddressAutocompleteInput-BQ7HCDqS.mjs.map +0 -1
- package/dist/AddressAutocompleteInput-C0ns8N-l.cjs.map +0 -1
- package/dist/ProfileScreen-Bw8W8nxK.mjs.map +0 -1
- package/dist/ProfileScreen-CP5ijd_t.cjs.map +0 -1
- package/dist/SubscriptionsScreen-CVKyyzbR.mjs.map +0 -1
- package/dist/SubscriptionsScreen-Dz1PGO2z.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { at as subscriptions_list, ct as subscriptions_resume, dt as subscriptions_skip, ft as subscriptions_update, it as subscriptions_cancel, lt as subscriptions_retry, n as usePortalTenantClient, nt as subscription_bundles_create, ot as subscriptions_pause, rt as subscription_bundles_list, st as subscriptions_reactivate, ut as subscriptions_show } from "./PortalTenantClientProvider-BmRtQAbi.mjs";
|
|
2
|
-
import { R as isApiError, V as usePayApi, n as useFluidContext } from "./FluidProvider-
|
|
2
|
+
import { R as isApiError, V as usePayApi, n as useFluidContext } from "./FluidProvider-7uXylc_0.mjs";
|
|
3
3
|
import { n as useCountriesApi } from "./countries-api-context-DScC_39w.mjs";
|
|
4
4
|
import { a as useActiveLocale, n as createDomainTranslations, r as useDomainDict, t as createStaticDictAdapter } from "./static-dict-adapter-DjCpubZc.mjs";
|
|
5
5
|
import { t as createTranslationContext } from "./translation-api-context-factory-CJrVq_EB.mjs";
|
|
@@ -9,7 +9,7 @@ import { t as useStore } from "./use-store-fLSf5hUc.mjs";
|
|
|
9
9
|
import { n as payKeys, r as storeKeys } from "./query-keys-BkMRwfNo.mjs";
|
|
10
10
|
import { t as useAccount } from "./use-account-DtQOpv3N.mjs";
|
|
11
11
|
import { n as useAppNavigation } from "./AppNavigationContext-DNomMUij.mjs";
|
|
12
|
-
import { a as AddressFormDialog, c as PaymentIcon, f as ConfirmActionDialog, h as useProfileTranslation, i as CreditCardFormDialog, l as getCardDisplayName, m as ProfileTranslationBridge, n as createFluidPayApiAdapter, o as EditPaymentMethodDialog, p as EllipsesDropdown, r as mapToFluidPayPaymentMethod, s as FluidPayCoreProvider, t as AddressAutocompleteInput, u as getCardExpiry } from "./AddressAutocompleteInput-
|
|
12
|
+
import { a as AddressFormDialog, c as PaymentIcon, f as ConfirmActionDialog, h as useProfileTranslation, i as CreditCardFormDialog, l as getCardDisplayName, m as ProfileTranslationBridge, n as createFluidPayApiAdapter, o as EditPaymentMethodDialog, p as EllipsesDropdown, r as mapToFluidPayPaymentMethod, s as FluidPayCoreProvider, t as AddressAutocompleteInput, u as getCardExpiry } from "./AddressAutocompleteInput-CaIj4sj0.mjs";
|
|
13
13
|
import { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
15
15
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -4574,6 +4574,7 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4574
4574
|
const payApi = usePayApi();
|
|
4575
4575
|
const countriesApi = useCountriesApi();
|
|
4576
4576
|
const { t } = useSubscriptionsTranslation();
|
|
4577
|
+
const { t: profileT } = useProfileTranslation();
|
|
4577
4578
|
const { config } = useFluidContext();
|
|
4578
4579
|
const { data: store } = useStore();
|
|
4579
4580
|
const bundlingEnabled = !!store?.bundle_subscriptions_enabled;
|
|
@@ -4625,21 +4626,29 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4625
4626
|
}, [countriesData]);
|
|
4626
4627
|
const fetchStatesFromCountries = useCallback((countryCode) => Promise.resolve(statesByCountry.get(countryCode) ?? []), [statesByCountry]);
|
|
4627
4628
|
const createAddressMutation = useMutation({
|
|
4628
|
-
mutationFn: (body) =>
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4629
|
+
mutationFn: async (body) => {
|
|
4630
|
+
const existingIds = new Set(addresses.map((a) => a.id));
|
|
4631
|
+
const address = await payApi.createAddress({ address: {
|
|
4632
|
+
name: composeAddressName$1(body.address.first_name, body.address.last_name),
|
|
4633
|
+
street1: body.address.address1,
|
|
4634
|
+
street2: body.address.address2,
|
|
4635
|
+
city: body.address.city,
|
|
4636
|
+
state: body.address.state,
|
|
4637
|
+
zip: body.address.postal_code,
|
|
4638
|
+
country: body.address.country_code,
|
|
4639
|
+
default: body.address.default
|
|
4640
|
+
} });
|
|
4641
|
+
return {
|
|
4642
|
+
address,
|
|
4643
|
+
deduped: existingIds.has(address.id)
|
|
4644
|
+
};
|
|
4645
|
+
},
|
|
4646
|
+
onSuccess: ({ deduped }) => {
|
|
4639
4647
|
queryClient.invalidateQueries({ queryKey: payKeys.addresses.all });
|
|
4640
|
-
onToast?.("
|
|
4648
|
+
if (deduped) onToast?.(profileT("address_already_exists"), "warning");
|
|
4649
|
+
else onToast?.(profileT("address_created"), "success");
|
|
4641
4650
|
},
|
|
4642
|
-
onError: () => onToast?.("
|
|
4651
|
+
onError: () => onToast?.(profileT("failed_to_create_address"), "error")
|
|
4643
4652
|
});
|
|
4644
4653
|
const addCreditCardMutation = useMutation({
|
|
4645
4654
|
mutationFn: (data) => payApi.createPaymentMethod({
|
|
@@ -4771,7 +4780,8 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4771
4780
|
t: addressDialogT,
|
|
4772
4781
|
onSubmit: async (formData) => {
|
|
4773
4782
|
try {
|
|
4774
|
-
|
|
4783
|
+
const { address } = await createAddressMutation.mutateAsync(formData);
|
|
4784
|
+
onAddressCreated(mapToFluidPayAddress$2(address));
|
|
4775
4785
|
} catch {}
|
|
4776
4786
|
},
|
|
4777
4787
|
isSubmitting: createAddressMutation.isPending,
|
|
@@ -4795,7 +4805,7 @@ function SubscriptionsListScreen(props) {
|
|
|
4795
4805
|
const payApi = usePayApi();
|
|
4796
4806
|
return /* @__PURE__ */ jsx(FluidPayCoreProvider, {
|
|
4797
4807
|
api: useMemo(() => createFluidPayApiAdapter(payApi), [payApi]),
|
|
4798
|
-
children: /* @__PURE__ */ jsx(SubscriptionsListScreenInner, { ...props })
|
|
4808
|
+
children: /* @__PURE__ */ jsx(ProfileTranslationBridge, { children: /* @__PURE__ */ jsx(SubscriptionsListScreenInner, { ...props }) })
|
|
4799
4809
|
});
|
|
4800
4810
|
}
|
|
4801
4811
|
//#endregion
|
|
@@ -7123,19 +7133,27 @@ function PortalSubscriptionShippingAddressSectionInner({ address: currentAddress
|
|
|
7123
7133
|
onError: (err) => onError?.(profileT("failed_to_update_shipping_address"), err)
|
|
7124
7134
|
});
|
|
7125
7135
|
const createAddressMutation = useMutation({
|
|
7126
|
-
mutationFn: (body) =>
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7136
|
+
mutationFn: async (body) => {
|
|
7137
|
+
const existingIds = new Set(addresses.map((a) => a.id));
|
|
7138
|
+
const address = await payApi.createAddress({ address: {
|
|
7139
|
+
name: composeAddressName(body.address.first_name, body.address.last_name),
|
|
7140
|
+
street1: body.address.address1,
|
|
7141
|
+
street2: body.address.address2,
|
|
7142
|
+
city: body.address.city,
|
|
7143
|
+
state: body.address.state,
|
|
7144
|
+
zip: body.address.postal_code,
|
|
7145
|
+
country: body.address.country_code,
|
|
7146
|
+
default: body.address.default
|
|
7147
|
+
} });
|
|
7148
|
+
return {
|
|
7149
|
+
address,
|
|
7150
|
+
deduped: existingIds.has(address.id)
|
|
7151
|
+
};
|
|
7152
|
+
},
|
|
7153
|
+
onSuccess: ({ deduped }) => {
|
|
7137
7154
|
queryClient.invalidateQueries({ queryKey: payKeys.addresses.all });
|
|
7138
|
-
onSuccess?.(profileT("
|
|
7155
|
+
if (deduped) onSuccess?.(profileT("address_already_exists"), "warning");
|
|
7156
|
+
else onSuccess?.(profileT("address_created"), "success");
|
|
7139
7157
|
},
|
|
7140
7158
|
onError: (err) => onError?.(profileT("failed_to_create_address"), err)
|
|
7141
7159
|
});
|
|
@@ -7315,7 +7333,7 @@ function SubscriptionDetailScreen({ token, onToast }) {
|
|
|
7315
7333
|
}),
|
|
7316
7334
|
renderShippingAddress: (ctx) => /* @__PURE__ */ jsx(PortalSubscriptionShippingAddressSection, {
|
|
7317
7335
|
...ctx,
|
|
7318
|
-
onSuccess: (msg) => onToast(msg, "success"),
|
|
7336
|
+
onSuccess: (msg, severity) => onToast(msg, severity ?? "success"),
|
|
7319
7337
|
onError: (msg, err) => {
|
|
7320
7338
|
onToast(`${msg}: ${err instanceof Error ? err.message : t("error_occurred")}`, "error");
|
|
7321
7339
|
}
|
|
@@ -7362,4 +7380,4 @@ const subscriptionsScreenPropertySchema = {
|
|
|
7362
7380
|
//#endregion
|
|
7363
7381
|
export { subscriptionsScreenPropertySchema as n, SubscriptionsScreen as t };
|
|
7364
7382
|
|
|
7365
|
-
//# sourceMappingURL=SubscriptionsScreen-
|
|
7383
|
+
//# sourceMappingURL=SubscriptionsScreen-eKtKSQNa.mjs.map
|