@fluid-app/portal-sdk 0.1.798 → 0.1.800
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/{FluidProvider-DAdZ-Lh8.mjs → FluidProvider-Bd329rjh.mjs} +71 -1
- package/dist/{FluidProvider-DAdZ-Lh8.mjs.map → FluidProvider-Bd329rjh.mjs.map} +1 -1
- package/dist/{FluidProvider-D6XJUmmK.cjs → FluidProvider-BwPBJfjs.cjs} +71 -1
- package/dist/{FluidProvider-D6XJUmmK.cjs.map → FluidProvider-BwPBJfjs.cjs.map} +1 -1
- package/dist/{MessagingScreen-B9Gw6jjz.cjs → MessagingScreen-CuiB8nPo.cjs} +2 -2
- package/dist/{MessagingScreen-CzFuFEqU.mjs → MessagingScreen-DLulZTv7.mjs} +2 -2
- package/dist/{MessagingScreen-CzFuFEqU.mjs.map → MessagingScreen-DLulZTv7.mjs.map} +1 -1
- package/dist/{MessagingScreen-DUJItpLf.cjs → MessagingScreen-Ry8EzZ0D.cjs} +2 -2
- package/dist/{MessagingScreen-DUJItpLf.cjs.map → MessagingScreen-Ry8EzZ0D.cjs.map} +1 -1
- package/dist/{MessagingScreen-yVAOdTnE.mjs → MessagingScreen-Ypz2-nu-.mjs} +2 -2
- package/dist/{OrdersScreen-urfCu-XA.mjs → OrdersScreen-6e2ikl1w.mjs} +2 -2
- package/dist/{OrdersScreen-urfCu-XA.mjs.map → OrdersScreen-6e2ikl1w.mjs.map} +1 -1
- package/dist/{OrdersScreen-C9Pt99gL.cjs → OrdersScreen-Cu6fDSB5.cjs} +2 -2
- package/dist/{OrdersScreen-D2i2EY7A.mjs → OrdersScreen-D0U5Zn1I.mjs} +2 -2
- package/dist/{OrdersScreen-DRUTC3FF.cjs → OrdersScreen-zcTwch78.cjs} +2 -2
- package/dist/{OrdersScreen-DRUTC3FF.cjs.map → OrdersScreen-zcTwch78.cjs.map} +1 -1
- package/dist/{ProfileScreen-yk2c_ICl.mjs → ProfileScreen-BpIPlbd2.mjs} +2 -2
- package/dist/{ProfileScreen-yk2c_ICl.mjs.map → ProfileScreen-BpIPlbd2.mjs.map} +1 -1
- package/dist/{ProfileScreen-DKp6Zvc-.mjs → ProfileScreen-CM3oqiU0.mjs} +3 -3
- package/dist/{ProfileScreen-CbhmsXGu.cjs → ProfileScreen-CY6anL_g.cjs} +2 -2
- package/dist/{ProfileScreen-CbhmsXGu.cjs.map → ProfileScreen-CY6anL_g.cjs.map} +1 -1
- package/dist/{ProfileScreen-JTRkqU7o.cjs → ProfileScreen-ChEvNc_d.cjs} +3 -3
- package/dist/{SubscriptionsScreen-B4lVFytP.mjs → SubscriptionsScreen-6GEqH3WA.mjs} +3 -3
- package/dist/{SubscriptionsScreen-CwiHeAUq.cjs → SubscriptionsScreen-B3Wk53We.cjs} +30 -31
- package/dist/SubscriptionsScreen-B3Wk53We.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-CbPW31HU.cjs → SubscriptionsScreen-CHtDjlJK.cjs} +3 -3
- package/dist/{SubscriptionsScreen-DiRBZN4T.mjs → SubscriptionsScreen-D505K6IM.mjs} +30 -31
- package/dist/SubscriptionsScreen-D505K6IM.mjs.map +1 -0
- package/dist/index.cjs +14 -14
- package/dist/index.mjs +14 -14
- package/dist/{use-portal-card-add-3ds-flow-CsjnX_VV.mjs → use-portal-card-add-3ds-flow-C8LP1_2P.mjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-CsjnX_VV.mjs.map → use-portal-card-add-3ds-flow-C8LP1_2P.mjs.map} +1 -1
- package/dist/{use-portal-card-add-3ds-flow-C4h3wg2u.cjs → use-portal-card-add-3ds-flow-D9H4Q46n.cjs} +2 -2
- package/dist/{use-portal-card-add-3ds-flow-C4h3wg2u.cjs.map → use-portal-card-add-3ds-flow-D9H4Q46n.cjs.map} +1 -1
- package/package.json +3 -3
- package/dist/SubscriptionsScreen-CwiHeAUq.cjs.map +0 -1
- package/dist/SubscriptionsScreen-DiRBZN4T.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./src-8ihOpuAU.mjs";
|
|
2
2
|
import "./build-widget-registry-mTHeMMXC.mjs";
|
|
3
3
|
import "./ContactsTranslationBridge-D3J4a-56.mjs";
|
|
4
|
-
import "./FluidProvider-
|
|
4
|
+
import "./FluidProvider-Bd329rjh.mjs";
|
|
5
5
|
import "./ScreenRenderer-DJnHvFb-.mjs";
|
|
6
6
|
import "./account-api-context-DCEDXtbM.mjs";
|
|
7
7
|
import "./use-optional-store-D6XsdB-j.mjs";
|
|
@@ -68,6 +68,6 @@ import "./translation-adapter-D4UNUw8I.mjs";
|
|
|
68
68
|
import "./translation-adapter-BGwgAecf.mjs";
|
|
69
69
|
import "./sidebar-BqTwYEfE.mjs";
|
|
70
70
|
import "./ScreenHeaderContext-D7jhJX8j.mjs";
|
|
71
|
-
import "./use-portal-card-add-3ds-flow-
|
|
72
|
-
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-
|
|
71
|
+
import "./use-portal-card-add-3ds-flow-C8LP1_2P.mjs";
|
|
72
|
+
import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-D505K6IM.mjs";
|
|
73
73
|
export { SubscriptionsScreen, subscriptionsScreenPropertySchema };
|
|
@@ -2,7 +2,7 @@ require("./chunk-9hOWP6kD.cjs");
|
|
|
2
2
|
const require_build_widget_registry = require("./build-widget-registry-CR5qbb2G.cjs");
|
|
3
3
|
const require_fetch_client = require("./fetch-client-BG7NeNDx.cjs");
|
|
4
4
|
const require_ContactsTranslationBridge = require("./ContactsTranslationBridge-FyqcnCwN.cjs");
|
|
5
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
5
|
+
const require_FluidProvider = require("./FluidProvider-BwPBJfjs.cjs");
|
|
6
6
|
const require_use_optional_store = require("./use-optional-store-DiiiefyO.cjs");
|
|
7
7
|
const require_Combobox = require("./Combobox-DW-UuPXX.cjs");
|
|
8
8
|
const require_prop_types = require("./prop-types-BcTujKu2.cjs");
|
|
@@ -17,7 +17,7 @@ const require_AppNavigationContext = require("./AppNavigationContext-WjLfoRRa.cj
|
|
|
17
17
|
const require_use_store = require("./use-store-DFwGIM83.cjs");
|
|
18
18
|
const require_sidebar = require("./sidebar-BnZL8dM6.cjs");
|
|
19
19
|
const require_ScreenHeaderContext = require("./ScreenHeaderContext-fJKG4BUl.cjs");
|
|
20
|
-
const require_use_portal_card_add_3ds_flow = require("./use-portal-card-add-3ds-flow-
|
|
20
|
+
const require_use_portal_card_add_3ds_flow = require("./use-portal-card-add-3ds-flow-D9H4Q46n.cjs");
|
|
21
21
|
const require_isAfter = require("./isAfter-CUqiCNz0.cjs");
|
|
22
22
|
let react = require("react");
|
|
23
23
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
@@ -2988,6 +2988,7 @@ function useAutoApplyPointsApi() {
|
|
|
2988
2988
|
if (!api) throw new Error("useAutoApplyPointsApi must be used within an AutoApplyPointsApiProvider");
|
|
2989
2989
|
return api;
|
|
2990
2990
|
}
|
|
2991
|
+
(0, react.createContext)(null).Provider;
|
|
2991
2992
|
//#endregion
|
|
2992
2993
|
//#region src/adapters/subscriptions-api-adapter.ts
|
|
2993
2994
|
/**
|
|
@@ -3701,7 +3702,7 @@ function countByFilter(list) {
|
|
|
3701
3702
|
cancelled: list.filter((s) => filterPredicate("cancelled", s)).length
|
|
3702
3703
|
};
|
|
3703
3704
|
}
|
|
3704
|
-
function formatCadence(plan, t) {
|
|
3705
|
+
function formatCadence$1(plan, t) {
|
|
3705
3706
|
const interval = plan.billing_interval;
|
|
3706
3707
|
const unit = plan.billing_interval_unit;
|
|
3707
3708
|
if (interval === 1 && unit === "day") return t("list_cadence_daily");
|
|
@@ -4224,7 +4225,7 @@ function SubscriptionCard({ sub, onClick, onResume, t }) {
|
|
|
4224
4225
|
const isPaused = status.kind === "paused";
|
|
4225
4226
|
const isCancelled = status.kind === "cancelled";
|
|
4226
4227
|
const isPastDue = status.kind === "past_due";
|
|
4227
|
-
const cadence = formatCadence(sub.subscription_plan, t);
|
|
4228
|
+
const cadence = formatCadence$1(sub.subscription_plan, t);
|
|
4228
4229
|
const nextBillLong = sub.next_bill_date ? formatLongDate$1(sub.next_bill_date) : null;
|
|
4229
4230
|
const lastBillLong = sub.last_bill_date ? formatLongDate$1(sub.last_bill_date) : null;
|
|
4230
4231
|
const daysOverdue = isPastDue && sub.next_bill_date ? Math.max(0, Math.round((Date.now() - new Date(sub.next_bill_date).getTime()) / (1e3 * 60 * 60 * 24))) : 0;
|
|
@@ -4341,7 +4342,7 @@ function CycleProgress({ cycle }) {
|
|
|
4341
4342
|
}
|
|
4342
4343
|
function InactiveSubscriptionRow({ sub, onClick, t }) {
|
|
4343
4344
|
const status = mapStatus(sub.status, t);
|
|
4344
|
-
const detail = `${formatCadence(sub.subscription_plan, t)} · ${status.label}`;
|
|
4345
|
+
const detail = `${formatCadence$1(sub.subscription_plan, t)} · ${status.label}`;
|
|
4345
4346
|
const variant = variantLabel(sub.variant);
|
|
4346
4347
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4347
4348
|
type: "button",
|
|
@@ -4824,7 +4825,7 @@ function DrawerStepSelect({ subscriptions, selectedTokens, onToggle, isLoading,
|
|
|
4824
4825
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Repeat, {
|
|
4825
4826
|
className: "size-3",
|
|
4826
4827
|
strokeWidth: 2
|
|
4827
|
-
}), formatCadence(sub.subscription_plan, t)]
|
|
4828
|
+
}), formatCadence$1(sub.subscription_plan, t)]
|
|
4828
4829
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4829
4830
|
className: "text-muted-foreground/75 mt-1 text-xs",
|
|
4830
4831
|
children: formatBillDate(sub.next_bill_date)
|
|
@@ -5857,6 +5858,23 @@ const UNIT_KEYS = {
|
|
|
5857
5858
|
plural: "unit_years"
|
|
5858
5859
|
}
|
|
5859
5860
|
};
|
|
5861
|
+
const SHORTHAND_CADENCE_KEYS = {
|
|
5862
|
+
day: "list_cadence_daily",
|
|
5863
|
+
week: "list_cadence_weekly",
|
|
5864
|
+
month: "list_cadence_monthly",
|
|
5865
|
+
year: "list_cadence_yearly"
|
|
5866
|
+
};
|
|
5867
|
+
/** "Monthly" for an interval of one, else "Every 2 months". */
|
|
5868
|
+
function formatCadence(interval, unit, t) {
|
|
5869
|
+
const normalized = unit.toLowerCase();
|
|
5870
|
+
if (interval === 1 && Object.hasOwn(SHORTHAND_CADENCE_KEYS, normalized)) return t(SHORTHAND_CADENCE_KEYS[normalized]);
|
|
5871
|
+
const unitKeys = UNIT_KEYS[normalized];
|
|
5872
|
+
if (!unitKeys) return t("list_cadence_every_unit", { unit: startCase(unit) });
|
|
5873
|
+
return t("list_cadence_every_n_units", {
|
|
5874
|
+
n: interval,
|
|
5875
|
+
unit: t(unitKeys.plural)
|
|
5876
|
+
});
|
|
5877
|
+
}
|
|
5860
5878
|
/** Statuses that have a corresponding `list_status_*` translation key. */
|
|
5861
5879
|
const KNOWN_STATUSES = new Set([
|
|
5862
5880
|
"active",
|
|
@@ -6210,7 +6228,7 @@ const SUBSCRIPTION_COLORS = [
|
|
|
6210
6228
|
"#84cc16"
|
|
6211
6229
|
];
|
|
6212
6230
|
const MAX_PROJECTIONS_PER_SUB = 104;
|
|
6213
|
-
function EditBillDateDialog({ open, onOpenChange, onConfirm, isLoading, errorMessage, currentNextBillDate, billingInterval = 1, billingIntervalUnit = "month", otherSubscriptions, onNavigateToSubscription, presentation = "dialog" }) {
|
|
6231
|
+
function EditBillDateDialog({ open, onOpenChange, onConfirm, isLoading, errorMessage, currentNextBillDate, billingInterval = 1, billingIntervalUnit = "month", otherSubscriptions, onNavigateToSubscription, presentation = "dialog", title, confirmLabel, description }) {
|
|
6214
6232
|
const { t, locale } = useSubscriptionsTranslation();
|
|
6215
6233
|
const [selectedDate, setSelectedDate] = (0, react.useState)(void 0);
|
|
6216
6234
|
const [calendarOpen, setCalendarOpen] = (0, react.useState)(false);
|
|
@@ -6290,8 +6308,8 @@ function EditBillDateDialog({ open, onOpenChange, onConfirm, isLoading, errorMes
|
|
|
6290
6308
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ResponsiveDialog.ResponsiveDialog, {
|
|
6291
6309
|
open,
|
|
6292
6310
|
onOpenChange: handleDismiss,
|
|
6293
|
-
title: t("edit_bill_date_title"),
|
|
6294
|
-
description: t("edit_bill_date_description"),
|
|
6311
|
+
title: title ?? t("edit_bill_date_title"),
|
|
6312
|
+
description: description ?? t("edit_bill_date_description"),
|
|
6295
6313
|
presentation,
|
|
6296
6314
|
contentOverflow: "visible",
|
|
6297
6315
|
children: [
|
|
@@ -6430,7 +6448,7 @@ function EditBillDateDialog({ open, onOpenChange, onConfirm, isLoading, errorMes
|
|
|
6430
6448
|
className: "h-10 min-w-[70px] rounded p-3",
|
|
6431
6449
|
onClick: handleConfirm,
|
|
6432
6450
|
disabled: !selectedDate || isLoading,
|
|
6433
|
-
children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) : t("edit_bill_date_action")
|
|
6451
|
+
children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) : confirmLabel ?? t("edit_bill_date_action")
|
|
6434
6452
|
})]
|
|
6435
6453
|
}) })
|
|
6436
6454
|
]
|
|
@@ -6751,16 +6769,6 @@ function BundledWithCard({ bundledSubscriptions, currentToken, plan, onNavigateT
|
|
|
6751
6769
|
}
|
|
6752
6770
|
//#endregion
|
|
6753
6771
|
//#region ../../subscriptions/ui/src/components/subscription-detail.tsx
|
|
6754
|
-
/** Map a billing_interval_unit to its shorthand cadence key (daily/weekly/…), or null. */
|
|
6755
|
-
function getCadenceKey(unit) {
|
|
6756
|
-
switch (unit.toLowerCase()) {
|
|
6757
|
-
case "day": return "daily";
|
|
6758
|
-
case "week": return "weekly";
|
|
6759
|
-
case "month": return "monthly";
|
|
6760
|
-
case "year": return "yearly";
|
|
6761
|
-
default: return null;
|
|
6762
|
-
}
|
|
6763
|
-
}
|
|
6764
6772
|
function isRecoveryStateChanged(error) {
|
|
6765
6773
|
if (!isRecord(error) || error.status !== 422 || !isRecord(error.body)) return false;
|
|
6766
6774
|
const body = error.body;
|
|
@@ -7177,16 +7185,7 @@ function SubscriptionManagementSection({ subscription, actionPolicy, isMutating,
|
|
|
7177
7185
|
const quantity = subscription.quantity;
|
|
7178
7186
|
const totalPrice = formatCurrency(subscription.price * quantity, subscription.currency?.code, locale);
|
|
7179
7187
|
const displayStatus = getSubscriptionDisplayStatus(subscription);
|
|
7180
|
-
const
|
|
7181
|
-
const interval = plan.billing_interval;
|
|
7182
|
-
const unitKeys = UNIT_KEYS[plan.billing_interval_unit.toLowerCase()];
|
|
7183
|
-
let cadenceLabel;
|
|
7184
|
-
if (interval === 1 && cadenceKey) cadenceLabel = t(`list_cadence_${cadenceKey}`);
|
|
7185
|
-
else if (unitKeys) cadenceLabel = t("list_cadence_every_n_units", {
|
|
7186
|
-
n: String(interval),
|
|
7187
|
-
unit: t(unitKeys.plural)
|
|
7188
|
-
});
|
|
7189
|
-
else cadenceLabel = t("list_cadence_every_unit", { unit: startCase(plan.billing_interval_unit) });
|
|
7188
|
+
const cadenceLabel = formatCadence(plan.billing_interval, plan.billing_interval_unit, t);
|
|
7190
7189
|
const paymentMethod = subscription.payment_method;
|
|
7191
7190
|
const paymentDetails = paymentMethod?.details ?? null;
|
|
7192
7191
|
const paymentDisplay = paymentMethod ? resolveSubscriptionPaymentMethodDisplay(paymentMethod, paymentDetails) : null;
|
|
@@ -9587,4 +9586,4 @@ Object.defineProperty(exports, "subscriptionsScreenPropertySchema", {
|
|
|
9587
9586
|
}
|
|
9588
9587
|
});
|
|
9589
9588
|
|
|
9590
|
-
//# sourceMappingURL=SubscriptionsScreen-
|
|
9589
|
+
//# sourceMappingURL=SubscriptionsScreen-B3Wk53We.cjs.map
|