@molecule/app-settings-panel-angular 2.0.2 → 3.0.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.
@@ -12,27 +12,49 @@ import { openUrl } from '@molecule/app-utilities';
12
12
  import * as i0 from "@angular/core";
13
13
  import * as i1 from "@molecule/app-angular";
14
14
  const _c0 = () => ({ defaultValue: "Billing" });
15
- const _c1 = () => ({ defaultValue: "Plan: " });
16
- const _c2 = () => ({ defaultValue: "Upgrade your plan" });
15
+ const _c1 = () => ({ defaultValue: "Upgrade your plan" });
16
+ const _c2 = () => ({ defaultValue: "Plan: " });
17
17
  const _c3 = () => ({ defaultValue: "Upgrade" });
18
18
  const _c4 = () => ({ defaultValue: "Cancel" });
19
19
  const _c5 = () => ({ defaultValue: "Cancel your subscription?" });
20
- const _c6 = () => ({ defaultValue: "No paid plans configured." });
21
- const _c7 = () => ({ defaultValue: "Subscribe" });
20
+ const _c6 = () => ({ defaultValue: "Subscribe" });
22
21
  const _forTrack0 = ($index, $item) => $item.key;
23
- function TiersUpgradeSection_Conditional_8_Template(rf, ctx) { if (rf & 1) {
24
- const _r1 = i0.ɵɵgetCurrentView();
22
+ function TiersUpgradeSection_Conditional_4_Template(rf, ctx) { if (rf & 1) {
23
+ i0.ɵɵelementStart(0, "span");
24
+ i0.ɵɵtext(1);
25
+ i0.ɵɵelementStart(2, "strong");
26
+ i0.ɵɵtext(3);
27
+ i0.ɵɵelementEnd()();
28
+ } if (rf & 2) {
29
+ const ctx_r0 = i0.ɵɵnextContext();
30
+ i0.ɵɵclassMap(ctx_r0.cm.textSize("sm"));
31
+ i0.ɵɵadvance();
32
+ i0.ɵɵtextInterpolate(ctx_r0.t("settings.plan", undefined, i0.ɵɵpureFunction0(4, _c2)));
33
+ i0.ɵɵadvance(2);
34
+ i0.ɵɵtextInterpolate(ctx);
35
+ } }
36
+ function TiersUpgradeSection_Conditional_5_Template(rf, ctx) { if (rf & 1) {
37
+ i0.ɵɵelement(0, "span");
38
+ } }
39
+ function TiersUpgradeSection_Conditional_6_Conditional_0_Template(rf, ctx) { if (rf & 1) {
40
+ const _r2 = i0.ɵɵgetCurrentView();
25
41
  i0.ɵɵelementStart(0, "button", 6);
26
- i0.ɵɵlistener("click", function TiersUpgradeSection_Conditional_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showUpgrade.set(true)); });
42
+ i0.ɵɵlistener("click", function TiersUpgradeSection_Conditional_6_Conditional_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.showUpgrade.set(true)); });
27
43
  i0.ɵɵtext(1);
28
44
  i0.ɵɵelementEnd();
29
45
  } if (rf & 2) {
30
- const ctx_r1 = i0.ɵɵnextContext();
46
+ const ctx_r0 = i0.ɵɵnextContext(2);
31
47
  i0.ɵɵproperty("variant", "outline")("size", "sm");
32
48
  i0.ɵɵadvance();
33
- i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.upgrade", undefined, i0.ɵɵpureFunction0(3, _c3)), " ");
49
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.t("settings.upgrade", undefined, i0.ɵɵpureFunction0(3, _c3)), " ");
50
+ } }
51
+ function TiersUpgradeSection_Conditional_6_Template(rf, ctx) { if (rf & 1) {
52
+ i0.ɵɵconditionalCreate(0, TiersUpgradeSection_Conditional_6_Conditional_0_Template, 2, 4, "button", 5);
53
+ } if (rf & 2) {
54
+ const ctx_r0 = i0.ɵɵnextContext();
55
+ i0.ɵɵconditional(ctx_r0.forSale().length > 0 ? 0 : -1);
34
56
  } }
35
- function TiersUpgradeSection_Conditional_9_Template(rf, ctx) { if (rf & 1) {
57
+ function TiersUpgradeSection_Conditional_7_Template(rf, ctx) { if (rf & 1) {
36
58
  i0.ɵɵelementStart(0, "button", 2);
37
59
  i0.ɵɵelementContainerStart(1, 7);
38
60
  i0.ɵɵtext(2);
@@ -42,34 +64,34 @@ function TiersUpgradeSection_Conditional_9_Template(rf, ctx) { if (rf & 1) {
42
64
  i0.ɵɵelementContainerEnd();
43
65
  i0.ɵɵelementEnd();
44
66
  } if (rf & 2) {
45
- const ctx_r1 = i0.ɵɵnextContext();
46
- i0.ɵɵproperty("variant", "outline")("size", "sm")("onConfirm", ctx_r1.cancelSubscription);
67
+ const ctx_r0 = i0.ɵɵnextContext();
68
+ i0.ɵɵproperty("variant", "outline")("size", "sm")("onConfirm", ctx_r0.cancelSubscription);
47
69
  i0.ɵɵadvance(2);
48
- i0.ɵɵtextInterpolate(ctx_r1.t("settings.billing.cancel", undefined, i0.ɵɵpureFunction0(5, _c4)));
70
+ i0.ɵɵtextInterpolate(ctx_r0.t("settings.billing.cancel", undefined, i0.ɵɵpureFunction0(5, _c4)));
49
71
  i0.ɵɵadvance(2);
50
- i0.ɵɵtextInterpolate(ctx_r1.t("settings.billing.cancelConfirm", undefined, i0.ɵɵpureFunction0(6, _c5)));
72
+ i0.ɵɵtextInterpolate(ctx_r0.t("settings.billing.cancelConfirm", undefined, i0.ɵɵpureFunction0(6, _c5)));
51
73
  } }
52
- function TiersUpgradeSection_Conditional_11_Template(rf, ctx) { if (rf & 1) {
53
- i0.ɵɵelementStart(0, "div", 4);
74
+ function TiersUpgradeSection_Conditional_8_Template(rf, ctx) { if (rf & 1) {
75
+ i0.ɵɵelementStart(0, "div", 3);
54
76
  i0.ɵɵtext(1);
55
77
  i0.ɵɵelementEnd();
56
78
  } if (rf & 2) {
57
- const ctx_r1 = i0.ɵɵnextContext();
58
- i0.ɵɵproperty("status", "error")("className", ctx_r1.cm.sp("mb", 4));
79
+ const ctx_r0 = i0.ɵɵnextContext();
80
+ i0.ɵɵproperty("status", "error")("className", ctx_r0.cm.sp("mt", 3));
59
81
  i0.ɵɵadvance();
60
82
  i0.ɵɵtextInterpolate(ctx);
61
83
  } }
62
- function TiersUpgradeSection_Conditional_12_Template(rf, ctx) { if (rf & 1) {
63
- i0.ɵɵelementStart(0, "p");
84
+ function TiersUpgradeSection_Conditional_10_Template(rf, ctx) { if (rf & 1) {
85
+ i0.ɵɵelementStart(0, "div", 3);
64
86
  i0.ɵɵtext(1);
65
87
  i0.ɵɵelementEnd();
66
88
  } if (rf & 2) {
67
- const ctx_r1 = i0.ɵɵnextContext();
68
- i0.ɵɵclassMap(ctx_r1.cm.cn(ctx_r1.cm.textSize("sm"), ctx_r1.cm.textMuted));
89
+ const ctx_r0 = i0.ɵɵnextContext();
90
+ i0.ɵɵproperty("status", "error")("className", ctx_r0.cm.sp("mb", 4));
69
91
  i0.ɵɵadvance();
70
- i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.billing.noTiers", undefined, i0.ɵɵpureFunction0(3, _c6)), " ");
92
+ i0.ɵɵtextInterpolate(ctx);
71
93
  } }
72
- function TiersUpgradeSection_Conditional_13_For_2_Template(rf, ctx) { if (rf & 1) {
94
+ function TiersUpgradeSection_For_13_Template(rf, ctx) { if (rf & 1) {
73
95
  const _r3 = i0.ɵɵgetCurrentView();
74
96
  i0.ɵɵelementStart(0, "li")(1, "div", 0)(2, "div")(3, "p");
75
97
  i0.ɵɵtext(4);
@@ -78,37 +100,27 @@ function TiersUpgradeSection_Conditional_13_For_2_Template(rf, ctx) { if (rf & 1
78
100
  i0.ɵɵtext(6);
79
101
  i0.ɵɵelementEnd()();
80
102
  i0.ɵɵelementStart(7, "button", 9);
81
- i0.ɵɵlistener("click", function TiersUpgradeSection_Conditional_13_For_2_Template_button_click_7_listener() { const entry_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.startCheckout(entry_r4.price.stripePriceId)); });
103
+ i0.ɵɵlistener("click", function TiersUpgradeSection_For_13_Template_button_click_7_listener() { const entry_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.startCheckout(entry_r4.priceId)); });
82
104
  i0.ɵɵtext(8);
83
105
  i0.ɵɵelementEnd()()();
84
106
  } if (rf & 2) {
85
107
  const entry_r4 = ctx.$implicit;
86
- const ctx_r1 = i0.ɵɵnextContext(2);
87
- i0.ɵɵclassMap(ctx_r1.cm.sp("p", 4));
108
+ const ctx_r0 = i0.ɵɵnextContext();
109
+ i0.ɵɵclassMap(ctx_r0.cm.sp("p", 4));
88
110
  i0.ɵɵadvance();
89
111
  i0.ɵɵproperty("align", "center")("justify", "between");
90
112
  i0.ɵɵadvance(2);
91
- i0.ɵɵclassMap(ctx_r1.cm.fontWeight("semibold"));
113
+ i0.ɵɵclassMap(ctx_r0.cm.fontWeight("semibold"));
92
114
  i0.ɵɵadvance();
93
115
  i0.ɵɵtextInterpolate2(" ", entry_r4.tier.name, " (", entry_r4.price.interval, ") ");
94
116
  i0.ɵɵadvance();
95
- i0.ɵɵclassMap(ctx_r1.cm.cn(ctx_r1.cm.textSize("xs"), ctx_r1.cm.textMuted));
117
+ i0.ɵɵclassMap(ctx_r0.cm.cn(ctx_r0.cm.textSize("xs"), ctx_r0.cm.textMuted));
96
118
  i0.ɵɵadvance();
97
119
  i0.ɵɵtextInterpolate1(" ", entry_r4.price.priceLabel, " ");
98
120
  i0.ɵɵadvance();
99
- i0.ɵɵproperty("size", "sm")("loading", ctx_r1.upgradeLoading() === entry_r4.price.stripePriceId);
100
- i0.ɵɵadvance();
101
- i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.billing.subscribe", undefined, i0.ɵɵpureFunction0(14, _c7)), " ");
102
- } }
103
- function TiersUpgradeSection_Conditional_13_Template(rf, ctx) { if (rf & 1) {
104
- i0.ɵɵelementStart(0, "ul");
105
- i0.ɵɵrepeaterCreate(1, TiersUpgradeSection_Conditional_13_For_2_Template, 9, 15, "li", 5, _forTrack0);
106
- i0.ɵɵelementEnd();
107
- } if (rf & 2) {
108
- const ctx_r1 = i0.ɵɵnextContext();
109
- i0.ɵɵclassMap(ctx_r1.cm.stack(3));
121
+ i0.ɵɵproperty("size", "sm")("loading", ctx_r0.upgradeLoading() === entry_r4.priceId);
110
122
  i0.ɵɵadvance();
111
- i0.ɵɵrepeater(ctx_r1.subscribeEntries());
123
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.t("settings.billing.subscribe", undefined, i0.ɵɵpureFunction0(14, _c6)), " ");
112
124
  } }
113
125
  /**
114
126
  * TiersUpgradeSection component.
@@ -121,8 +133,10 @@ function TiersUpgradeSection_Conditional_13_Template(rf, ctx) { if (rf & 1) {
121
133
  * `@molecule/api-payments-stripe` + `@molecule/api-resource-payment` — loads
122
134
  * the user's current plan from `/api/billing/status`, loads available tiers
123
135
  * from `/api/billing/tiers`, and renders an Upgrade modal with a Subscribe
124
- * button per tier price. Subscribe POSTs to `/api/billing/checkout` and
125
- * redirects to the Stripe checkout URL; paid users see a Cancel button that
136
+ * button per price that is for sale (one the server lists with a price id).
137
+ * Upgrade appears only for a free user and only when something is for sale.
138
+ * Subscribe POSTs to `/api/billing/checkout` and redirects to the checkout
139
+ * URL; a paid user (`isFree: false` in the status) sees a Cancel button that
126
140
  * POSTs to `/api/billing/cancel`. A refused request shows the server's
127
141
  * message.
128
142
  */
@@ -138,12 +152,15 @@ export class TiersUpgradeSection {
138
152
  /** The translation function for the template. */
139
153
  t = this.i18n.t;
140
154
  http = useHttpClient();
141
- /** The user's current plan name. */
142
- plan = signal('Free', /* @ts-ignore */
155
+ /** The user's current plan name, once the server has reported it. */
156
+ plan = signal(null, /* @ts-ignore */
143
157
  ...(ngDevMode ? [{ debugName: "plan" }] : /* istanbul ignore next */ []));
144
- /** The user's current plan key. */
145
- planKey = signal('free', /* @ts-ignore */
158
+ /** The user's current plan key, once the server has reported it. */
159
+ planKey = signal(null, /* @ts-ignore */
146
160
  ...(ngDevMode ? [{ debugName: "planKey" }] : /* istanbul ignore next */ []));
161
+ /** Whether the user is on a free plan (the status's `isFree`). */
162
+ isFree = signal(true, /* @ts-ignore */
163
+ ...(ngDevMode ? [{ debugName: "isFree" }] : /* istanbul ignore next */ []));
147
164
  /** The tiers loaded from `/api/billing/tiers`. */
148
165
  tiers = signal([], /* @ts-ignore */
149
166
  ...(ngDevMode ? [{ debugName: "tiers" }] : /* istanbul ignore next */ []));
@@ -156,33 +173,38 @@ export class TiersUpgradeSection {
156
173
  /** The upgrade modal's error message. */
157
174
  upgradeError = signal('', /* @ts-ignore */
158
175
  ...(ngDevMode ? [{ debugName: "upgradeError" }] : /* istanbul ignore next */ []));
176
+ /** Why the last cancel failed, shown in the section (the modal is closed then). */
177
+ cancelError = signal('', /* @ts-ignore */
178
+ ...(ngDevMode ? [{ debugName: "cancelError" }] : /* istanbul ignore next */ []));
159
179
  /** The bonded ClassMap (styling tokens resolve at render time). */
160
180
  cm = getClassMap();
161
181
  host = inject(ElementRef);
182
+ loads = 0;
183
+ destroyed = false;
162
184
  /**
163
- * The (tier, price) pairs the modal lists: every paid tier's prices that
164
- * carry a stripe price id (React's filter + flatMap).
185
+ * What can be bought: a price the server lists with a price id, on a tier
186
+ * the user is not on (React's `forSale`).
165
187
  * @returns The entries.
166
188
  */
167
- subscribeEntries() {
189
+ forSale() {
168
190
  const entries = [];
169
191
  for (const tier of this.tiers()) {
170
- if (tier.planKey === 'free')
192
+ if (tier.planKey === this.planKey())
171
193
  continue;
172
194
  for (const price of tier.prices) {
173
195
  if (!price.stripePriceId)
174
196
  continue;
175
- entries.push({ key: `${tier.planKey}-${price.stripePriceId}`, tier, price });
197
+ entries.push({
198
+ key: `${tier.planKey}-${price.stripePriceId}`,
199
+ tier,
200
+ price,
201
+ priceId: price.stripePriceId,
202
+ });
176
203
  }
177
204
  }
178
205
  return entries;
179
206
  }
180
- /**
181
- * Loads the current plan and the available tiers on mount (React's mount
182
- * effect): each fetch resolves null on failure and the mapping keeps the
183
- * defaults instead of throwing. A result that lands after unmount is
184
- * dropped like React's cancelled one.
185
- */
207
+ /** Loads the current plan and the available tiers on mount. */
186
208
  constructor() {
187
209
  usePlacement(() => {
188
210
  // React's fragment (the section plus the upgrade modal) renders in the
@@ -190,13 +212,22 @@ export class TiersUpgradeSection {
190
212
  placeContentBefore(this.host.nativeElement, this.host.nativeElement);
191
213
  setElementPresent(this.host.nativeElement, false);
192
214
  });
193
- let cancelled = false;
194
215
  inject(DestroyRef).onDestroy(() => {
195
- cancelled = true;
216
+ this.destroyed = true;
196
217
  });
218
+ this.load();
219
+ }
220
+ /**
221
+ * Loads the current plan and the available tiers (React's effect): each
222
+ * fetch resolves null on failure and the mapping keeps what the section
223
+ * shows instead of throwing. A result that lands after unmount, or after a
224
+ * newer load started, is dropped like React's cancelled one.
225
+ */
226
+ load() {
227
+ const seq = ++this.loads;
197
228
  void Promise.all([
198
229
  // Each fetch resolves null on failure; the .then handler then keeps the
199
- // defaults ('Free', empty tier list) instead of throwing.
230
+ // defaults (no plan label, nothing for sale) instead of throwing.
200
231
  this.http
201
232
  .get('/api/billing/status')
202
233
  .catch((_error) => null),
@@ -205,14 +236,16 @@ export class TiersUpgradeSection {
205
236
  .catch((_error) => null),
206
237
  ])
207
238
  .then(([statusRes, tiersRes]) => {
208
- if (cancelled)
239
+ if (this.destroyed || seq !== this.loads)
209
240
  return;
210
241
  const status = statusRes?.data ?? null;
211
242
  if (status?.name)
212
243
  this.plan.set(status.name);
213
244
  if (status?.planKey)
214
245
  this.planKey.set(status.planKey);
215
- const list = tiersRes?.data?.data ?? [];
246
+ if (typeof status?.isFree === 'boolean')
247
+ this.isFree.set(status.isFree);
248
+ const list = tiersRes?.data?.data;
216
249
  if (Array.isArray(list)) {
217
250
  this.tiers.set(list.map((tier) => ({
218
251
  planKey: tier.key,
@@ -235,8 +268,6 @@ export class TiersUpgradeSection {
235
268
  * @param stripePriceId - The price to subscribe to.
236
269
  */
237
270
  async startCheckout(stripePriceId) {
238
- if (!stripePriceId)
239
- return;
240
271
  this.upgradeError.set('');
241
272
  this.upgradeLoading.set(stripePriceId);
242
273
  try {
@@ -269,58 +300,60 @@ export class TiersUpgradeSection {
269
300
  * shows the server's message and keeps the plan.
270
301
  */
271
302
  cancelSubscription = async () => {
272
- this.upgradeError.set('');
303
+ this.cancelError.set('');
273
304
  try {
274
305
  await this.http.post('/api/billing/cancel', {});
275
- this.plan.set('Free');
276
- this.planKey.set('free');
306
+ // The server decides what the plan is now (a provider may cancel at period end).
307
+ this.load();
277
308
  }
278
309
  catch (err) {
279
- this.upgradeError.set(serverErrorMessage(err) ??
310
+ this.cancelError.set(serverErrorMessage(err) ??
280
311
  this.t('settings.billing.cancelFailed', undefined, {
281
312
  defaultValue: 'Could not cancel.',
282
313
  }));
283
314
  }
284
315
  };
285
316
  static ɵfac = function TiersUpgradeSection_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TiersUpgradeSection)(); };
286
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TiersUpgradeSection, selectors: [["mol-tiers-upgrade-section"]], inputs: { redirectToCheckout: "redirectToCheckout" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], decls: 14, vars: 17, consts: [["mol-flex", "", 3, "align", "justify"], ["mol-button", "", 3, "variant", "size"], ["mol-confirm-button", "", "data-mol-id", "billing-cancel-subscription", 3, "variant", "size", "onConfirm"], [3, "close", "open", "title"], ["mol-alert", "", 3, "status", "className"], [3, "class"], ["mol-button", "", 3, "click", "variant", "size"], ["ngProjectAs", "[slot=label]", 5, ["", "slot", "label"]], ["ngProjectAs", "[slot=confirmLabel]", 5, ["", "slot", "confirmlabel"]], ["mol-button", "", 3, "click", "size", "loading"]], template: function TiersUpgradeSection_Template(rf, ctx) { if (rf & 1) {
317
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TiersUpgradeSection, selectors: [["mol-tiers-upgrade-section"]], inputs: { redirectToCheckout: "redirectToCheckout" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], decls: 14, vars: 15, consts: [["mol-flex", "", 3, "align", "justify"], [3, "class"], ["mol-confirm-button", "", "data-mol-id", "billing-cancel-subscription", 3, "variant", "size", "onConfirm"], ["mol-alert", "", 3, "status", "className"], [3, "close", "open", "title"], ["mol-button", "", 3, "variant", "size"], ["mol-button", "", 3, "click", "variant", "size"], ["ngProjectAs", "[slot=label]", 5, ["", "slot", "label"]], ["ngProjectAs", "[slot=confirmLabel]", 5, ["", "slot", "confirmlabel"]], ["mol-button", "", 3, "click", "size", "loading"]], template: function TiersUpgradeSection_Template(rf, ctx) { if (rf & 1) {
287
318
  i0.ɵɵelementStart(0, "section")(1, "h3");
288
319
  i0.ɵɵtext(2);
289
320
  i0.ɵɵelementEnd();
290
- i0.ɵɵelementStart(3, "div", 0)(4, "span");
291
- i0.ɵɵtext(5);
292
- i0.ɵɵelementStart(6, "strong");
293
- i0.ɵɵtext(7);
294
- i0.ɵɵelementEnd()();
295
- i0.ɵɵconditionalCreate(8, TiersUpgradeSection_Conditional_8_Template, 2, 4, "button", 1)(9, TiersUpgradeSection_Conditional_9_Template, 5, 7, "button", 2);
296
- i0.ɵɵelementEnd()();
297
- i0.ɵɵelementStart(10, "mol-modal", 3);
298
- i0.ɵɵlistener("close", function TiersUpgradeSection_Template_mol_modal_close_10_listener() { return ctx.showUpgrade.set(false); });
299
- i0.ɵɵconditionalCreate(11, TiersUpgradeSection_Conditional_11_Template, 2, 3, "div", 4);
300
- i0.ɵɵconditionalCreate(12, TiersUpgradeSection_Conditional_12_Template, 2, 4, "p", 5)(13, TiersUpgradeSection_Conditional_13_Template, 3, 2, "ul", 5);
321
+ i0.ɵɵelementStart(3, "div", 0);
322
+ i0.ɵɵconditionalCreate(4, TiersUpgradeSection_Conditional_4_Template, 4, 5, "span", 1)(5, TiersUpgradeSection_Conditional_5_Template, 1, 0, "span");
323
+ i0.ɵɵconditionalCreate(6, TiersUpgradeSection_Conditional_6_Template, 1, 1)(7, TiersUpgradeSection_Conditional_7_Template, 5, 7, "button", 2);
301
324
  i0.ɵɵelementEnd();
325
+ i0.ɵɵconditionalCreate(8, TiersUpgradeSection_Conditional_8_Template, 2, 3, "div", 3);
326
+ i0.ɵɵelementEnd();
327
+ i0.ɵɵelementStart(9, "mol-modal", 4);
328
+ i0.ɵɵlistener("close", function TiersUpgradeSection_Template_mol_modal_close_9_listener() { return ctx.showUpgrade.set(false); });
329
+ i0.ɵɵconditionalCreate(10, TiersUpgradeSection_Conditional_10_Template, 2, 3, "div", 3);
330
+ i0.ɵɵelementStart(11, "ul");
331
+ i0.ɵɵrepeaterCreate(12, TiersUpgradeSection_For_13_Template, 9, 15, "li", 1, _forTrack0);
332
+ i0.ɵɵelementEnd()();
302
333
  } if (rf & 2) {
303
- let tmp_10_0;
334
+ let tmp_4_0;
335
+ let tmp_6_0;
336
+ let tmp_9_0;
304
337
  i0.ɵɵadvance();
305
338
  i0.ɵɵclassMap(ctx.cm.cn(ctx.cm.sectionHeading, ctx.cm.sp("mb", 3)));
306
339
  i0.ɵɵadvance();
307
- i0.ɵɵtextInterpolate1(" ", ctx.t("settings.billing", undefined, i0.ɵɵpureFunction0(14, _c0)), " ");
340
+ i0.ɵɵtextInterpolate1(" ", ctx.t("settings.billing", undefined, i0.ɵɵpureFunction0(13, _c0)), " ");
308
341
  i0.ɵɵadvance();
309
342
  i0.ɵɵproperty("align", "center")("justify", "between");
310
343
  i0.ɵɵadvance();
311
- i0.ɵɵclassMap(ctx.cm.textSize("sm"));
312
- i0.ɵɵadvance();
313
- i0.ɵɵtextInterpolate(ctx.t("settings.plan", undefined, i0.ɵɵpureFunction0(15, _c1)));
344
+ i0.ɵɵconditional((tmp_4_0 = ctx.plan()) ? 4 : 5, tmp_4_0);
314
345
  i0.ɵɵadvance(2);
315
- i0.ɵɵtextInterpolate(ctx.plan());
316
- i0.ɵɵadvance();
317
- i0.ɵɵconditional(ctx.planKey() === "free" ? 8 : 9);
346
+ i0.ɵɵconditional(ctx.isFree() ? 6 : 7);
318
347
  i0.ɵɵadvance(2);
319
- i0.ɵɵproperty("open", ctx.showUpgrade())("title", ctx.t("settings.billing.upgradeTitle", undefined, i0.ɵɵpureFunction0(16, _c2)));
348
+ i0.ɵɵconditional((tmp_6_0 = ctx.cancelError()) ? 8 : -1, tmp_6_0);
349
+ i0.ɵɵadvance();
350
+ i0.ɵɵproperty("open", ctx.showUpgrade())("title", ctx.t("settings.billing.upgradeTitle", undefined, i0.ɵɵpureFunction0(14, _c1)));
320
351
  i0.ɵɵadvance();
321
- i0.ɵɵconditional((tmp_10_0 = ctx.upgradeError()) ? 11 : -1, tmp_10_0);
352
+ i0.ɵɵconditional((tmp_9_0 = ctx.upgradeError()) ? 10 : -1, tmp_9_0);
322
353
  i0.ɵɵadvance();
323
- i0.ɵɵconditional(ctx.tiers().length === 0 ? 12 : 13);
354
+ i0.ɵɵclassMap(ctx.cm.stack(3));
355
+ i0.ɵɵadvance();
356
+ i0.ɵɵrepeater(ctx.forSale());
324
357
  } }, dependencies: [Alert, Button, ConfirmButton, Flex, Modal], encapsulation: 2 });
325
358
  }
326
359
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TiersUpgradeSection, [{
@@ -336,14 +369,21 @@ export class TiersUpgradeSection {
336
369
  {{ t('settings.billing', undefined, { defaultValue: 'Billing' }) }}
337
370
  </h3>
338
371
  <div mol-flex [align]="'center'" [justify]="'between'">
339
- <span [class]="cm.textSize('sm')"
340
- >{{ t('settings.plan', undefined, { defaultValue: 'Plan: ' })
341
- }}<strong>{{ plan() }}</strong></span
342
- >
343
- @if (planKey() === 'free') {
344
- <button mol-button [variant]="'outline'" [size]="'sm'" (click)="showUpgrade.set(true)">
345
- {{ t('settings.upgrade', undefined, { defaultValue: 'Upgrade' }) }}
346
- </button>
372
+ <!-- The plan line waits for the server: there is no plan name to guess. -->
373
+ @if (plan(); as planName) {
374
+ <span [class]="cm.textSize('sm')"
375
+ >{{ t('settings.plan', undefined, { defaultValue: 'Plan: ' })
376
+ }}<strong>{{ planName }}</strong></span
377
+ >
378
+ } @else {
379
+ <span></span>
380
+ }
381
+ @if (isFree()) {
382
+ @if (forSale().length > 0) {
383
+ <button mol-button [variant]="'outline'" [size]="'sm'" (click)="showUpgrade.set(true)">
384
+ {{ t('settings.upgrade', undefined, { defaultValue: 'Upgrade' }) }}
385
+ </button>
386
+ }
347
387
  } @else {
348
388
  <button
349
389
  mol-confirm-button
@@ -363,6 +403,9 @@ export class TiersUpgradeSection {
363
403
  </button>
364
404
  }
365
405
  </div>
406
+ @if (cancelError(); as cancelMessage) {
407
+ <div mol-alert [status]="'error'" [className]="cm.sp('mt', 3)">{{ cancelMessage }}</div>
408
+ }
366
409
  </section>
367
410
  <mol-modal
368
411
  [open]="showUpgrade()"
@@ -372,40 +415,32 @@ export class TiersUpgradeSection {
372
415
  @if (upgradeError(); as checkoutError) {
373
416
  <div mol-alert [status]="'error'" [className]="cm.sp('mb', 4)">{{ checkoutError }}</div>
374
417
  }
375
- @if (tiers().length === 0) {
376
- <p [class]="cm.cn(cm.textSize('sm'), cm.textMuted)">
377
- {{
378
- t('settings.billing.noTiers', undefined, { defaultValue: 'No paid plans configured.' })
379
- }}
380
- </p>
381
- } @else {
382
- <ul [class]="cm.stack(3)">
383
- @for (entry of subscribeEntries(); track entry.key) {
384
- <li [class]="cm.sp('p', 4)">
385
- <div mol-flex [align]="'center'" [justify]="'between'">
386
- <div>
387
- <p [class]="cm.fontWeight('semibold')">
388
- {{ entry.tier.name }} ({{ entry.price.interval }})
389
- </p>
390
- <p [class]="cm.cn(cm.textSize('xs'), cm.textMuted)">
391
- {{ entry.price.priceLabel }}
392
- </p>
393
- </div>
394
- <button
395
- mol-button
396
- [size]="'sm'"
397
- [loading]="upgradeLoading() === entry.price.stripePriceId"
398
- (click)="startCheckout(entry.price.stripePriceId)"
399
- >
400
- {{ t('settings.billing.subscribe', undefined, { defaultValue: 'Subscribe' }) }}
401
- </button>
418
+ <ul [class]="cm.stack(3)">
419
+ @for (entry of forSale(); track entry.key) {
420
+ <li [class]="cm.sp('p', 4)">
421
+ <div mol-flex [align]="'center'" [justify]="'between'">
422
+ <div>
423
+ <p [class]="cm.fontWeight('semibold')">
424
+ {{ entry.tier.name }} ({{ entry.price.interval }})
425
+ </p>
426
+ <p [class]="cm.cn(cm.textSize('xs'), cm.textMuted)">
427
+ {{ entry.price.priceLabel }}
428
+ </p>
402
429
  </div>
403
- </li>
404
- }
405
- </ul>
406
- }
430
+ <button
431
+ mol-button
432
+ [size]="'sm'"
433
+ [loading]="upgradeLoading() === entry.priceId"
434
+ (click)="startCheckout(entry.priceId)"
435
+ >
436
+ {{ t('settings.billing.subscribe', undefined, { defaultValue: 'Subscribe' }) }}
437
+ </button>
438
+ </div>
439
+ </li>
440
+ }
441
+ </ul>
407
442
  </mol-modal>`,
408
443
  }]
409
444
  }], () => [], null); })();
410
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TiersUpgradeSection, { className: "TiersUpgradeSection", filePath: "tiers-upgrade-section.component.ts", lineNumber: 134 }); })();
445
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TiersUpgradeSection, { className: "TiersUpgradeSection", filePath: "tiers-upgrade-section.component.ts", lineNumber: 138 }); })();
411
446
  //# sourceMappingURL=tiers-upgrade-section.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tiers-upgrade-section.component.js","sourceRoot":"","sources":["../src/tiers-upgrade-section.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE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;YAKC,AAJF,wFAA4B,kEAInB;YAmBb,AADE,iBAAM,EACE;YACV,qCAIC;YAFC,oGAAS,oBAAgB,KAAK,CAAC,IAAC;YAGhC,uFAAwC;YAStC,AANF,qFAA4B,gEAMnB;YA0BX,iBAAY;;;YAxEN,cAAkD;YAAlD,mEAAkD;YACpD,cACF;YADE,kGACF;YACc,cAAkB;YAAC,AAAnB,gCAAkB,sBAAsB;YAC9C,cAA2B;YAA3B,oCAA2B;YAC9B,cACC;YADD,oFACC;YAAQ,eAAY;YAAZ,gCAAY;YAExB,cAqBC;YArBD,kDAqBC;YAIH,eAAsB;YAEtB,AAFA,wCAAsB,yFAEwE;YAE9F,cAEC;YAFD,qEAEC;YACD,cA+BC;YA/BD,oDA+BC;4BA1EK,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK;;iFA6ExC,mBAAmB;cAjF/B,SAAS;eAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC;gBACpD,MAAM,EAAE,CAAC,oBAAoB,CAAC;gBAC9B,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyEK;aAChB;;kFACY,mBAAmB"}
1
+ {"version":3,"file":"tiers-upgrade-section.component.js","sourceRoot":"","sources":["../src/tiers-upgrade-section.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,C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B;gBACrC,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC;gBACpD,MAAM,EAAE,CAAC,oBAAoB,CAAC;gBAC9B,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2EK;aAChB;;kFACY,mBAAmB"}
package/dist/types.d.ts CHANGED
@@ -32,6 +32,15 @@ export interface Device {
32
32
  /** `true` for the device making the current request (the API marks it). */
33
33
  isCurrent?: boolean;
34
34
  }
35
+ /** Props for `AuthSection`. Same name and meaning as the React component's. */
36
+ export interface AuthSectionProps {
37
+ /**
38
+ * Show the two-factor row. Set false when the API has no two-factor provider
39
+ * (no `POST /users/:id/verify-two-factor` route). Default true. Bound in a template as
40
+ * `[twoFactor]="false"`.
41
+ */
42
+ twoFactor?: boolean;
43
+ }
35
44
  /**
36
45
  * Props for `TiersUpgradeSection` — the same props
37
46
  * `@molecule/app-settings-panel-react` accepts.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,kEAAkE;IAClE,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,kEAAkE;IAClE,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-settings-panel-angular",
3
- "version": "2.0.2",
3
+ "version": "3.0.1",
4
4
  "description": "Composable settings panel — a SettingsContainer + family of section sub-components (Account, Auth, Notifications, Billing, Devices, ThisDevice, LogOutDelete). Apps compose via content projection, picking which sections to include and what order.",
5
5
  "homepage": "https://www.molecule.dev/packages/app-settings-panel-angular",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "@angular/compiler-cli": "22.2.3",
61
61
  "@angular/core": "22.2.3",
62
62
  "@angular/platform-browser": "22.2.3",
63
- "@molecule/app-angular": "3.13.0",
63
+ "@molecule/app-angular": "3.14.0",
64
64
  "@molecule/app-auth": "3.6.0",
65
65
  "@molecule/app-framework-conformance": "0.0.0",
66
66
  "@molecule/app-http": "1.10.0",
@@ -68,7 +68,7 @@
68
68
  "@molecule/app-icons": "1.0.4",
69
69
  "@molecule/app-push": "1.2.0",
70
70
  "@molecule/app-ui": "1.5.0",
71
- "@molecule/app-ui-angular": "1.5.1",
71
+ "@molecule/app-ui-angular": "1.5.2",
72
72
  "@molecule/app-utilities": "1.0.7",
73
73
  "@types/node": "26.6.5",
74
74
  "jsdom": "31.0.1",