@fluid-app/portal-sdk 0.1.428 → 0.1.429
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/{SubscriptionsScreen-BnPKupHu.mjs → SubscriptionsScreen-BfkCm2sX.mjs} +1 -1
- package/dist/{SubscriptionsScreen-1KiMhO3l.mjs → SubscriptionsScreen-C9ZW0UCg.mjs} +11 -9
- package/dist/SubscriptionsScreen-C9ZW0UCg.mjs.map +1 -0
- package/dist/{SubscriptionsScreen-BJWA3S9y.cjs → SubscriptionsScreen-CHssmfkf.cjs} +11 -9
- package/dist/SubscriptionsScreen-CHssmfkf.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-RMjqJpCY.cjs → SubscriptionsScreen-wxcIwNni.cjs} +1 -1
- package/dist/adapters/subscriptions-api-adapter.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/subscriptions/PortalSubscriptionShippingAddressSection.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/SubscriptionsScreen-1KiMhO3l.mjs.map +0 -1
- package/dist/SubscriptionsScreen-BJWA3S9y.cjs.map +0 -1
|
@@ -33,7 +33,7 @@ import "./MediaRenderer-BydUiy9x.mjs";
|
|
|
33
33
|
import "./CarouselWidget-oOuu0X3D.mjs";
|
|
34
34
|
import "./CatchUpWidget-C40BJpiX.mjs";
|
|
35
35
|
import "./src-CAi8-qUm.mjs";
|
|
36
|
-
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-
|
|
36
|
+
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-C9ZW0UCg.mjs";
|
|
37
37
|
import "./ChartWidget-1xYX5bcU.mjs";
|
|
38
38
|
import "./ContainerWidget-DHGGtJzK.mjs";
|
|
39
39
|
import "./EmbedWidget-CUt5_brr.mjs";
|
|
@@ -2623,8 +2623,9 @@ function mapDetailSubscription(bff) {
|
|
|
2623
2623
|
cv_in_currency: "0"
|
|
2624
2624
|
}
|
|
2625
2625
|
},
|
|
2626
|
+
address_id: bff.address_id ?? null,
|
|
2626
2627
|
address: bff.address ? {
|
|
2627
|
-
id: bff.address.id ??
|
|
2628
|
+
id: bff.address.id ?? null,
|
|
2628
2629
|
name: bff.address.name ?? null,
|
|
2629
2630
|
address1: bff.address.address1 ?? "",
|
|
2630
2631
|
address2: bff.address.address2 ?? null,
|
|
@@ -2635,7 +2636,7 @@ function mapDetailSubscription(bff) {
|
|
|
2635
2636
|
country_code: bff.address.country_code ?? null,
|
|
2636
2637
|
default: false
|
|
2637
2638
|
} : {
|
|
2638
|
-
id:
|
|
2639
|
+
id: null,
|
|
2639
2640
|
name: null,
|
|
2640
2641
|
address1: "",
|
|
2641
2642
|
address2: null,
|
|
@@ -6332,7 +6333,8 @@ function SubscriptionManagementSection({ subscription, isActive, isPaused, isCan
|
|
|
6332
6333
|
}), /* @__PURE__ */ jsxs("div", {
|
|
6333
6334
|
className: "flex flex-col",
|
|
6334
6335
|
children: [renderShippingAddress ? renderShippingAddress({
|
|
6335
|
-
|
|
6336
|
+
addressId: subscription.address_id,
|
|
6337
|
+
address: subscription.address,
|
|
6336
6338
|
subscriptionToken: subscription.subscription_token,
|
|
6337
6339
|
customerId: subscription.customer?.id ?? 0,
|
|
6338
6340
|
countryCode: subscription.address?.country_code ?? "US"
|
|
@@ -7419,7 +7421,7 @@ function mapToFluidPayAddress$1(raw) {
|
|
|
7419
7421
|
function subscriptionAddressToFluidPay(raw) {
|
|
7420
7422
|
if (!raw) return null;
|
|
7421
7423
|
return {
|
|
7422
|
-
id: raw.id,
|
|
7424
|
+
id: raw.id ?? 0,
|
|
7423
7425
|
address1: raw.address1,
|
|
7424
7426
|
address2: raw.address2,
|
|
7425
7427
|
city: raw.city,
|
|
@@ -7435,7 +7437,7 @@ function subscriptionAddressToFluidPay(raw) {
|
|
|
7435
7437
|
function PortalSubscriptionShippingAddressSection(props) {
|
|
7436
7438
|
return /* @__PURE__ */ jsx(ProfileTranslationBridge, { children: /* @__PURE__ */ jsx(PortalSubscriptionShippingAddressSectionInner, { ...props }) });
|
|
7437
7439
|
}
|
|
7438
|
-
function PortalSubscriptionShippingAddressSectionInner({ address: currentAddress, subscriptionToken, onSuccess, onError }) {
|
|
7440
|
+
function PortalSubscriptionShippingAddressSectionInner({ addressId, address: currentAddress, subscriptionToken, onSuccess, onError }) {
|
|
7439
7441
|
const { t: profileT } = useProfileTranslation();
|
|
7440
7442
|
const { t: subsT } = useSubscriptionsTranslation();
|
|
7441
7443
|
const { config } = useFluidContext();
|
|
@@ -7549,7 +7551,7 @@ function PortalSubscriptionShippingAddressSectionInner({ address: currentAddress
|
|
|
7549
7551
|
},
|
|
7550
7552
|
onError: (err) => onError?.(profileT("failed_to_update_default_address"), err)
|
|
7551
7553
|
});
|
|
7552
|
-
const displayed = addresses.find((a) => a.id ===
|
|
7554
|
+
const displayed = (addressId !== null ? addresses.find((a) => a.id === addressId) : void 0) ?? (currentAddress ? addresses.find((a) => a.address1 === currentAddress.address1 && a.postal_code === currentAddress.postal_code && a.city === currentAddress.city) : void 0) ?? subscriptionAddressToFluidPay(currentAddress);
|
|
7553
7555
|
const handleCloseFormDialog = () => {
|
|
7554
7556
|
setIsFormDialogOpen(false);
|
|
7555
7557
|
setEditingAddress(null);
|
|
@@ -7571,9 +7573,9 @@ function PortalSubscriptionShippingAddressSectionInner({ address: currentAddress
|
|
|
7571
7573
|
title: subsT("shipping_address"),
|
|
7572
7574
|
displayAddress: displayed,
|
|
7573
7575
|
addressList: addresses,
|
|
7574
|
-
selectedAddressId:
|
|
7576
|
+
selectedAddressId: addressId ?? 0,
|
|
7575
7577
|
onSelectAddress: (addr) => {
|
|
7576
|
-
if (addr.id ===
|
|
7578
|
+
if (addr.id === addressId) return;
|
|
7577
7579
|
updateSubscription.mutate({
|
|
7578
7580
|
subscriptionToken,
|
|
7579
7581
|
body: { address_id: addr.id }
|
|
@@ -7837,4 +7839,4 @@ const subscriptionsScreenPropertySchema = {
|
|
|
7837
7839
|
//#endregion
|
|
7838
7840
|
export { subscriptionsScreenPropertySchema as n, SubscriptionsScreen as t };
|
|
7839
7841
|
|
|
7840
|
-
//# sourceMappingURL=SubscriptionsScreen-
|
|
7842
|
+
//# sourceMappingURL=SubscriptionsScreen-C9ZW0UCg.mjs.map
|