@nevios/storefront-kit 1.5.0 → 1.6.0
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/README.md +6 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3982,7 +3982,7 @@ function Manager({
|
|
|
3982
3982
|
const money = (n) => formatCents(n, s.currency, loc);
|
|
3983
3983
|
const scope = mode === "mix" ? "recurring" : "one_time";
|
|
3984
3984
|
const selected = Object.entries(quantities).filter(([, quantity]) => quantity > 0).map(([variant_id, quantity]) => ({ variant_id, quantity }));
|
|
3985
|
-
const changes = mode === "cadence" ? { cadence_option_id: option } : { lines: selected };
|
|
3985
|
+
const changes = mode === "cadence" ? s.plan_options?.length ? { plan_option_id: option } : { cadence_option_id: option } : { lines: selected };
|
|
3986
3986
|
const amount = quote ? "recurring_total_cents" in quote ? quote.recurring_total_cents : quote.after.total_cents : upcoming.total_cents;
|
|
3987
3987
|
const enter = (next) => {
|
|
3988
3988
|
setMode(next);
|
|
@@ -4069,7 +4069,7 @@ function Manager({
|
|
|
4069
4069
|
new Date(upcoming.edit_cutoff_at).toLocaleString(loc)
|
|
4070
4070
|
] }),
|
|
4071
4071
|
!mode ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: ".5rem", flexWrap: "wrap" }, children: [
|
|
4072
|
-
!!upcoming.capabilities.cadence_options?.length && /* @__PURE__ */ jsx(
|
|
4072
|
+
!!(s.plan_options?.length || upcoming.capabilities.cadence_options?.length) && /* @__PURE__ */ jsx(
|
|
4073
4073
|
SubscriptionButton,
|
|
4074
4074
|
{
|
|
4075
4075
|
disabled: !upcoming.editable,
|
|
@@ -4201,6 +4201,7 @@ function Manager({
|
|
|
4201
4201
|
" \xD7 ",
|
|
4202
4202
|
li.quantity
|
|
4203
4203
|
] }, li.variant_id)),
|
|
4204
|
+
"terms_text" in quote.after && typeof quote.after.terms_text === "string" && /* @__PURE__ */ jsx("p", { children: quote.after.terms_text }),
|
|
4204
4205
|
/* @__PURE__ */ jsxs("strong", { children: [
|
|
4205
4206
|
t("subscriptions.reviewTotal"),
|
|
4206
4207
|
": ",
|
|
@@ -4212,12 +4213,12 @@ function Manager({
|
|
|
4212
4213
|
role: "group",
|
|
4213
4214
|
"aria-label": t("subscriptions.changeInterval"),
|
|
4214
4215
|
style: { display: "flex", gap: ".5rem", flexWrap: "wrap" },
|
|
4215
|
-
children: upcoming.capabilities.cadence_options?.map((o) => /* @__PURE__ */ jsx(
|
|
4216
|
+
children: (s.plan_options?.length ? s.plan_options : upcoming.capabilities.cadence_options)?.map((o) => /* @__PURE__ */ jsx(
|
|
4216
4217
|
SubscriptionButton,
|
|
4217
4218
|
{
|
|
4218
4219
|
"aria-pressed": option === o.id,
|
|
4219
4220
|
onClick: () => setOption(o.id),
|
|
4220
|
-
children: t(`subscriptions.unit.${o.unit}`, { count: o.count })
|
|
4221
|
+
children: "name" in o && typeof o.name === "string" ? o.name : t(`subscriptions.unit.${o.unit}`, { count: o.count })
|
|
4221
4222
|
},
|
|
4222
4223
|
o.id
|
|
4223
4224
|
))
|