@molecule/app-settings-panel-angular 0.0.0-stage → 0.0.1-stage
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/LICENSE +202 -0
- package/README.md +1992 -2
- package/dist/account-section.component.d.ts +123 -0
- package/dist/account-section.component.d.ts.map +1 -0
- package/dist/account-section.component.js +350 -0
- package/dist/account-section.component.js.map +1 -0
- package/dist/appearance-section.component.d.ts +52 -0
- package/dist/appearance-section.component.d.ts.map +1 -0
- package/dist/appearance-section.component.js +128 -0
- package/dist/appearance-section.component.js.map +1 -0
- package/dist/auth-section.component.d.ts +125 -0
- package/dist/auth-section.component.d.ts.map +1 -0
- package/dist/auth-section.component.js +667 -0
- package/dist/auth-section.component.js.map +1 -0
- package/dist/billing-section.component.d.ts +52 -0
- package/dist/billing-section.component.d.ts.map +1 -0
- package/dist/billing-section.component.js +137 -0
- package/dist/billing-section.component.js.map +1 -0
- package/dist/context.d.ts +46 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +73 -0
- package/dist/context.js.map +1 -0
- package/dist/controlled-switch.d.ts +38 -0
- package/dist/controlled-switch.d.ts.map +1 -0
- package/dist/controlled-switch.js +56 -0
- package/dist/controlled-switch.js.map +1 -0
- package/dist/devices-section.component.d.ts +88 -0
- package/dist/devices-section.component.d.ts.map +1 -0
- package/dist/devices-section.component.js +374 -0
- package/dist/devices-section.component.js.map +1 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/log-out-delete-section.component.d.ts +50 -0
- package/dist/log-out-delete-section.component.d.ts.map +1 -0
- package/dist/log-out-delete-section.component.js +249 -0
- package/dist/log-out-delete-section.component.js.map +1 -0
- package/dist/notifications-section.component.d.ts +78 -0
- package/dist/notifications-section.component.d.ts.map +1 -0
- package/dist/notifications-section.component.js +256 -0
- package/dist/notifications-section.component.js.map +1 -0
- package/dist/push-toggle.d.ts +12 -0
- package/dist/push-toggle.d.ts.map +1 -0
- package/dist/push-toggle.js +11 -0
- package/dist/push-toggle.js.map +1 -0
- package/dist/settings-container.component.d.ts +33 -0
- package/dist/settings-container.component.d.ts.map +1 -0
- package/dist/settings-container.component.js +64 -0
- package/dist/settings-container.component.js.map +1 -0
- package/dist/this-device-section.component.d.ts +40 -0
- package/dist/this-device-section.component.d.ts.map +1 -0
- package/dist/this-device-section.component.js +149 -0
- package/dist/this-device-section.component.js.map +1 -0
- package/dist/tiers-upgrade-section.component.d.ts +89 -0
- package/dist/tiers-upgrade-section.component.d.ts.map +1 -0
- package/dist/tiers-upgrade-section.component.js +407 -0
- package/dist/tiers-upgrade-section.component.js.map +1 -0
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +78 -4
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TiersUpgradeSection component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Component, DestroyRef, inject, signal } from '@angular/core';
|
|
7
|
+
import { useHttpClient, useTranslation } from '@molecule/app-angular';
|
|
8
|
+
import { serverErrorMessage } from '@molecule/app-http';
|
|
9
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
+
import { Alert, Button, ConfirmButton, Flex, Modal } from '@molecule/app-ui-angular';
|
|
11
|
+
import { openUrl } from '@molecule/app-utilities';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
const _c0 = () => ({ defaultValue: "Billing" });
|
|
14
|
+
const _c1 = () => ({ defaultValue: "Plan: " });
|
|
15
|
+
const _c2 = () => ({ defaultValue: "Upgrade your plan" });
|
|
16
|
+
const _c3 = () => ({ defaultValue: "Upgrade" });
|
|
17
|
+
const _c4 = () => ({ defaultValue: "Cancel" });
|
|
18
|
+
const _c5 = () => ({ defaultValue: "Cancel your subscription?" });
|
|
19
|
+
const _c6 = () => ({ defaultValue: "No paid plans configured." });
|
|
20
|
+
const _c7 = () => ({ defaultValue: "Subscribe" });
|
|
21
|
+
const _forTrack0 = ($index, $item) => $item.key;
|
|
22
|
+
function TiersUpgradeSection_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
24
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
25
|
+
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)); });
|
|
26
|
+
i0.ɵɵtext(1);
|
|
27
|
+
i0.ɵɵelementEnd();
|
|
28
|
+
} if (rf & 2) {
|
|
29
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
30
|
+
i0.ɵɵproperty("variant", "outline")("size", "sm");
|
|
31
|
+
i0.ɵɵadvance();
|
|
32
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.upgrade", undefined, i0.ɵɵpureFunction0(3, _c3)), " ");
|
|
33
|
+
} }
|
|
34
|
+
function TiersUpgradeSection_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelementStart(0, "button", 2);
|
|
36
|
+
i0.ɵɵelementContainerStart(1, 7);
|
|
37
|
+
i0.ɵɵtext(2);
|
|
38
|
+
i0.ɵɵelementContainerEnd();
|
|
39
|
+
i0.ɵɵelementContainerStart(3, 8);
|
|
40
|
+
i0.ɵɵtext(4);
|
|
41
|
+
i0.ɵɵelementContainerEnd();
|
|
42
|
+
i0.ɵɵelementEnd();
|
|
43
|
+
} if (rf & 2) {
|
|
44
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
45
|
+
i0.ɵɵproperty("variant", "outline")("size", "sm")("onConfirm", ctx_r1.cancelSubscription);
|
|
46
|
+
i0.ɵɵadvance(2);
|
|
47
|
+
i0.ɵɵtextInterpolate(ctx_r1.t("settings.billing.cancel", undefined, i0.ɵɵpureFunction0(5, _c4)));
|
|
48
|
+
i0.ɵɵadvance(2);
|
|
49
|
+
i0.ɵɵtextInterpolate(ctx_r1.t("settings.billing.cancelConfirm", undefined, i0.ɵɵpureFunction0(6, _c5)));
|
|
50
|
+
} }
|
|
51
|
+
function TiersUpgradeSection_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
i0.ɵɵelementStart(0, "div", 4);
|
|
53
|
+
i0.ɵɵtext(1);
|
|
54
|
+
i0.ɵɵelementEnd();
|
|
55
|
+
} if (rf & 2) {
|
|
56
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
57
|
+
i0.ɵɵproperty("status", "error")("className", ctx_r1.cm.sp("mb", 4));
|
|
58
|
+
i0.ɵɵadvance();
|
|
59
|
+
i0.ɵɵtextInterpolate(ctx);
|
|
60
|
+
} }
|
|
61
|
+
function TiersUpgradeSection_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
62
|
+
i0.ɵɵelementStart(0, "p");
|
|
63
|
+
i0.ɵɵtext(1);
|
|
64
|
+
i0.ɵɵelementEnd();
|
|
65
|
+
} if (rf & 2) {
|
|
66
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
67
|
+
i0.ɵɵclassMap(ctx_r1.cm.cn(ctx_r1.cm.textSize("sm"), ctx_r1.cm.textMuted));
|
|
68
|
+
i0.ɵɵadvance();
|
|
69
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.billing.noTiers", undefined, i0.ɵɵpureFunction0(3, _c6)), " ");
|
|
70
|
+
} }
|
|
71
|
+
function TiersUpgradeSection_Conditional_13_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
73
|
+
i0.ɵɵelementStart(0, "li")(1, "div", 0)(2, "div")(3, "p");
|
|
74
|
+
i0.ɵɵtext(4);
|
|
75
|
+
i0.ɵɵelementEnd();
|
|
76
|
+
i0.ɵɵelementStart(5, "p");
|
|
77
|
+
i0.ɵɵtext(6);
|
|
78
|
+
i0.ɵɵelementEnd()();
|
|
79
|
+
i0.ɵɵelementStart(7, "button", 9);
|
|
80
|
+
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)); });
|
|
81
|
+
i0.ɵɵtext(8);
|
|
82
|
+
i0.ɵɵelementEnd()()();
|
|
83
|
+
} if (rf & 2) {
|
|
84
|
+
const entry_r4 = ctx.$implicit;
|
|
85
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
86
|
+
i0.ɵɵclassMap(ctx_r1.cm.sp("p", 4));
|
|
87
|
+
i0.ɵɵadvance();
|
|
88
|
+
i0.ɵɵproperty("align", "center")("justify", "between");
|
|
89
|
+
i0.ɵɵadvance(2);
|
|
90
|
+
i0.ɵɵclassMap(ctx_r1.cm.fontWeight("semibold"));
|
|
91
|
+
i0.ɵɵadvance();
|
|
92
|
+
i0.ɵɵtextInterpolate2(" ", entry_r4.tier.name, " (", entry_r4.price.interval, ") ");
|
|
93
|
+
i0.ɵɵadvance();
|
|
94
|
+
i0.ɵɵclassMap(ctx_r1.cm.cn(ctx_r1.cm.textSize("xs"), ctx_r1.cm.textMuted));
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵtextInterpolate1(" ", entry_r4.price.priceLabel, " ");
|
|
97
|
+
i0.ɵɵadvance();
|
|
98
|
+
i0.ɵɵproperty("size", "sm")("loading", ctx_r1.upgradeLoading() === entry_r4.price.stripePriceId);
|
|
99
|
+
i0.ɵɵadvance();
|
|
100
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.t("settings.billing.subscribe", undefined, i0.ɵɵpureFunction0(14, _c7)), " ");
|
|
101
|
+
} }
|
|
102
|
+
function TiersUpgradeSection_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
103
|
+
i0.ɵɵelementStart(0, "ul");
|
|
104
|
+
i0.ɵɵrepeaterCreate(1, TiersUpgradeSection_Conditional_13_For_2_Template, 9, 15, "li", 5, _forTrack0);
|
|
105
|
+
i0.ɵɵelementEnd();
|
|
106
|
+
} if (rf & 2) {
|
|
107
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
108
|
+
i0.ɵɵclassMap(ctx_r1.cm.stack(3));
|
|
109
|
+
i0.ɵɵadvance();
|
|
110
|
+
i0.ɵɵrepeater(ctx_r1.subscribeEntries());
|
|
111
|
+
} }
|
|
112
|
+
/**
|
|
113
|
+
* TiersUpgradeSection component.
|
|
114
|
+
*
|
|
115
|
+
* Billing section with full multi-tier upgrade flow. React's root is a
|
|
116
|
+
* fragment (the `<section>` plus the upgrade modal), so the host is unwrapped
|
|
117
|
+
* by the DOM normalizer and `display: contents` keeps the layout
|
|
118
|
+
* fragment-like.
|
|
119
|
+
*
|
|
120
|
+
* Replaces the simpler `BillingSection` for apps backed by
|
|
121
|
+
* `@molecule/api-payments-stripe` + `@molecule/api-resource-payment` — loads
|
|
122
|
+
* the user's current plan from `/api/billing/status`, loads available tiers
|
|
123
|
+
* 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
|
|
126
|
+
* POSTs to `/api/billing/cancel`. A refused request shows the server's
|
|
127
|
+
* message.
|
|
128
|
+
*/
|
|
129
|
+
export class TiersUpgradeSection {
|
|
130
|
+
/**
|
|
131
|
+
* How the page leaves for the checkout URL the server returns. Defaults to
|
|
132
|
+
* a full-page navigation (`openUrl`); an app passes its own opener (React's
|
|
133
|
+
* `redirectToCheckout` prop).
|
|
134
|
+
*/
|
|
135
|
+
redirectToCheckout = openUrl;
|
|
136
|
+
/** Reactive translation, read in the injection context. */
|
|
137
|
+
i18n = useTranslation();
|
|
138
|
+
/** The translation function for the template. */
|
|
139
|
+
t = this.i18n.t;
|
|
140
|
+
http = useHttpClient();
|
|
141
|
+
/** The user's current plan name. */
|
|
142
|
+
plan = signal('Free', /* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [{ debugName: "plan" }] : /* istanbul ignore next */ []));
|
|
144
|
+
/** The user's current plan key. */
|
|
145
|
+
planKey = signal('free', /* @ts-ignore */
|
|
146
|
+
...(ngDevMode ? [{ debugName: "planKey" }] : /* istanbul ignore next */ []));
|
|
147
|
+
/** The tiers loaded from `/api/billing/tiers`. */
|
|
148
|
+
tiers = signal([], /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "tiers" }] : /* istanbul ignore next */ []));
|
|
150
|
+
/** Whether the upgrade modal is open. */
|
|
151
|
+
showUpgrade = signal(false, /* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [{ debugName: "showUpgrade" }] : /* istanbul ignore next */ []));
|
|
153
|
+
/** The price id whose checkout request is running, or null. */
|
|
154
|
+
upgradeLoading = signal(null, /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "upgradeLoading" }] : /* istanbul ignore next */ []));
|
|
156
|
+
/** The upgrade modal's error message. */
|
|
157
|
+
upgradeError = signal('', /* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [{ debugName: "upgradeError" }] : /* istanbul ignore next */ []));
|
|
159
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
160
|
+
cm = getClassMap();
|
|
161
|
+
/**
|
|
162
|
+
* The (tier, price) pairs the modal lists: every paid tier's prices that
|
|
163
|
+
* carry a stripe price id (React's filter + flatMap).
|
|
164
|
+
* @returns The entries.
|
|
165
|
+
*/
|
|
166
|
+
subscribeEntries() {
|
|
167
|
+
const entries = [];
|
|
168
|
+
for (const tier of this.tiers()) {
|
|
169
|
+
if (tier.planKey === 'free')
|
|
170
|
+
continue;
|
|
171
|
+
for (const price of tier.prices) {
|
|
172
|
+
if (!price.stripePriceId)
|
|
173
|
+
continue;
|
|
174
|
+
entries.push({ key: `${tier.planKey}-${price.stripePriceId}`, tier, price });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return entries;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Loads the current plan and the available tiers on mount (React's mount
|
|
181
|
+
* effect): each fetch resolves null on failure and the mapping keeps the
|
|
182
|
+
* defaults instead of throwing. A result that lands after unmount is
|
|
183
|
+
* dropped like React's cancelled one.
|
|
184
|
+
*/
|
|
185
|
+
constructor() {
|
|
186
|
+
let cancelled = false;
|
|
187
|
+
inject(DestroyRef).onDestroy(() => {
|
|
188
|
+
cancelled = true;
|
|
189
|
+
});
|
|
190
|
+
void Promise.all([
|
|
191
|
+
// Each fetch resolves null on failure; the .then handler then keeps the
|
|
192
|
+
// defaults ('Free', empty tier list) instead of throwing.
|
|
193
|
+
this.http
|
|
194
|
+
.get('/api/billing/status')
|
|
195
|
+
.catch((_error) => null),
|
|
196
|
+
this.http
|
|
197
|
+
.get('/api/billing/tiers')
|
|
198
|
+
.catch((_error) => null),
|
|
199
|
+
])
|
|
200
|
+
.then(([statusRes, tiersRes]) => {
|
|
201
|
+
if (cancelled)
|
|
202
|
+
return;
|
|
203
|
+
const status = statusRes?.data ?? null;
|
|
204
|
+
if (status?.name)
|
|
205
|
+
this.plan.set(status.name);
|
|
206
|
+
if (status?.planKey)
|
|
207
|
+
this.planKey.set(status.planKey);
|
|
208
|
+
const list = tiersRes?.data?.data ?? [];
|
|
209
|
+
if (Array.isArray(list)) {
|
|
210
|
+
this.tiers.set(list.map((tier) => ({
|
|
211
|
+
planKey: tier.key,
|
|
212
|
+
name: tier.name,
|
|
213
|
+
prices: (tier.prices || []).map((p) => ({
|
|
214
|
+
stripePriceId: p.stripePriceId ?? undefined,
|
|
215
|
+
interval: p.period,
|
|
216
|
+
priceLabel: p.price,
|
|
217
|
+
})),
|
|
218
|
+
})));
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
.catch((_error) => {
|
|
222
|
+
// Fetch failures already resolve to null above; this only guards the
|
|
223
|
+
// mapping, keeping the section on its defaults rather than throwing.
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Starts the checkout for one price (React's `handleStartCheckout`).
|
|
228
|
+
* @param stripePriceId - The price to subscribe to.
|
|
229
|
+
*/
|
|
230
|
+
async startCheckout(stripePriceId) {
|
|
231
|
+
if (!stripePriceId)
|
|
232
|
+
return;
|
|
233
|
+
this.upgradeError.set('');
|
|
234
|
+
this.upgradeLoading.set(stripePriceId);
|
|
235
|
+
try {
|
|
236
|
+
const res = await this.http.post('/api/billing/checkout', { priceId: stripePriceId });
|
|
237
|
+
const data = res.data;
|
|
238
|
+
if (data?.checkoutUrl) {
|
|
239
|
+
this.redirectToCheckout(data.checkoutUrl);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (data?.updated) {
|
|
243
|
+
this.showUpgrade.set(false);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.upgradeError.set(this.t('settings.billing.checkoutFailed', undefined, {
|
|
247
|
+
defaultValue: 'Could not start checkout.',
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
this.upgradeError.set(serverErrorMessage(err) ??
|
|
252
|
+
this.t('settings.billing.checkoutFailed', undefined, {
|
|
253
|
+
defaultValue: 'Could not start checkout.',
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
finally {
|
|
257
|
+
this.upgradeLoading.set(null);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Cancels the subscription (React's `handleCancelSubscription`); a failure
|
|
262
|
+
* shows the server's message and keeps the plan.
|
|
263
|
+
*/
|
|
264
|
+
cancelSubscription = async () => {
|
|
265
|
+
this.upgradeError.set('');
|
|
266
|
+
try {
|
|
267
|
+
await this.http.post('/api/billing/cancel', {});
|
|
268
|
+
this.plan.set('Free');
|
|
269
|
+
this.planKey.set('free');
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
this.upgradeError.set(serverErrorMessage(err) ??
|
|
273
|
+
this.t('settings.billing.cancelFailed', undefined, {
|
|
274
|
+
defaultValue: 'Could not cancel.',
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
static ɵfac = function TiersUpgradeSection_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TiersUpgradeSection)(); };
|
|
279
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TiersUpgradeSection, selectors: [["mol-tiers-upgrade-section"]], hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { redirectToCheckout: "redirectToCheckout" }, 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) {
|
|
280
|
+
i0.ɵɵelementStart(0, "section")(1, "h3");
|
|
281
|
+
i0.ɵɵtext(2);
|
|
282
|
+
i0.ɵɵelementEnd();
|
|
283
|
+
i0.ɵɵelementStart(3, "div", 0)(4, "span");
|
|
284
|
+
i0.ɵɵtext(5);
|
|
285
|
+
i0.ɵɵelementStart(6, "strong");
|
|
286
|
+
i0.ɵɵtext(7);
|
|
287
|
+
i0.ɵɵelementEnd()();
|
|
288
|
+
i0.ɵɵconditionalCreate(8, TiersUpgradeSection_Conditional_8_Template, 2, 4, "button", 1)(9, TiersUpgradeSection_Conditional_9_Template, 5, 7, "button", 2);
|
|
289
|
+
i0.ɵɵelementEnd()();
|
|
290
|
+
i0.ɵɵelementStart(10, "mol-modal", 3);
|
|
291
|
+
i0.ɵɵlistener("close", function TiersUpgradeSection_Template_mol_modal_close_10_listener() { return ctx.showUpgrade.set(false); });
|
|
292
|
+
i0.ɵɵconditionalCreate(11, TiersUpgradeSection_Conditional_11_Template, 2, 3, "div", 4);
|
|
293
|
+
i0.ɵɵconditionalCreate(12, TiersUpgradeSection_Conditional_12_Template, 2, 4, "p", 5)(13, TiersUpgradeSection_Conditional_13_Template, 3, 2, "ul", 5);
|
|
294
|
+
i0.ɵɵelementEnd();
|
|
295
|
+
} if (rf & 2) {
|
|
296
|
+
let tmp_10_0;
|
|
297
|
+
i0.ɵɵadvance();
|
|
298
|
+
i0.ɵɵclassMap(ctx.cm.cn(ctx.cm.sectionHeading, ctx.cm.sp("mb", 3)));
|
|
299
|
+
i0.ɵɵadvance();
|
|
300
|
+
i0.ɵɵtextInterpolate1(" ", ctx.t("settings.billing", undefined, i0.ɵɵpureFunction0(14, _c0)), " ");
|
|
301
|
+
i0.ɵɵadvance();
|
|
302
|
+
i0.ɵɵproperty("align", "center")("justify", "between");
|
|
303
|
+
i0.ɵɵadvance();
|
|
304
|
+
i0.ɵɵclassMap(ctx.cm.textSize("sm"));
|
|
305
|
+
i0.ɵɵadvance();
|
|
306
|
+
i0.ɵɵtextInterpolate(ctx.t("settings.plan", undefined, i0.ɵɵpureFunction0(15, _c1)));
|
|
307
|
+
i0.ɵɵadvance(2);
|
|
308
|
+
i0.ɵɵtextInterpolate(ctx.plan());
|
|
309
|
+
i0.ɵɵadvance();
|
|
310
|
+
i0.ɵɵconditional(ctx.planKey() === "free" ? 8 : 9);
|
|
311
|
+
i0.ɵɵadvance(2);
|
|
312
|
+
i0.ɵɵproperty("open", ctx.showUpgrade())("title", ctx.t("settings.billing.upgradeTitle", undefined, i0.ɵɵpureFunction0(16, _c2)));
|
|
313
|
+
i0.ɵɵadvance();
|
|
314
|
+
i0.ɵɵconditional((tmp_10_0 = ctx.upgradeError()) ? 11 : -1, tmp_10_0);
|
|
315
|
+
i0.ɵɵadvance();
|
|
316
|
+
i0.ɵɵconditional(ctx.tiers().length === 0 ? 12 : 13);
|
|
317
|
+
} }, dependencies: [Alert, Button, ConfirmButton, Flex, Modal], encapsulation: 2 });
|
|
318
|
+
}
|
|
319
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TiersUpgradeSection, [{
|
|
320
|
+
type: Component,
|
|
321
|
+
args: [{
|
|
322
|
+
selector: 'mol-tiers-upgrade-section',
|
|
323
|
+
standalone: true,
|
|
324
|
+
imports: [Alert, Button, ConfirmButton, Flex, Modal],
|
|
325
|
+
inputs: ['redirectToCheckout'],
|
|
326
|
+
host: {
|
|
327
|
+
'data-parity-unwrap': '',
|
|
328
|
+
style: 'display: contents',
|
|
329
|
+
},
|
|
330
|
+
template: `<section>
|
|
331
|
+
<h3 [class]="cm.cn(cm.sectionHeading, cm.sp('mb', 3))">
|
|
332
|
+
{{ t('settings.billing', undefined, { defaultValue: 'Billing' }) }}
|
|
333
|
+
</h3>
|
|
334
|
+
<div mol-flex [align]="'center'" [justify]="'between'">
|
|
335
|
+
<span [class]="cm.textSize('sm')"
|
|
336
|
+
>{{ t('settings.plan', undefined, { defaultValue: 'Plan: ' })
|
|
337
|
+
}}<strong>{{ plan() }}</strong></span
|
|
338
|
+
>
|
|
339
|
+
@if (planKey() === 'free') {
|
|
340
|
+
<button mol-button [variant]="'outline'" [size]="'sm'" (click)="showUpgrade.set(true)">
|
|
341
|
+
{{ t('settings.upgrade', undefined, { defaultValue: 'Upgrade' }) }}
|
|
342
|
+
</button>
|
|
343
|
+
} @else {
|
|
344
|
+
<button
|
|
345
|
+
mol-confirm-button
|
|
346
|
+
[variant]="'outline'"
|
|
347
|
+
[size]="'sm'"
|
|
348
|
+
[onConfirm]="cancelSubscription"
|
|
349
|
+
data-mol-id="billing-cancel-subscription"
|
|
350
|
+
>
|
|
351
|
+
<ng-container ngProjectAs="[slot=label]">{{
|
|
352
|
+
t('settings.billing.cancel', undefined, { defaultValue: 'Cancel' })
|
|
353
|
+
}}</ng-container
|
|
354
|
+
><ng-container ngProjectAs="[slot=confirmLabel]">{{
|
|
355
|
+
t('settings.billing.cancelConfirm', undefined, {
|
|
356
|
+
defaultValue: 'Cancel your subscription?',
|
|
357
|
+
})
|
|
358
|
+
}}</ng-container>
|
|
359
|
+
</button>
|
|
360
|
+
}
|
|
361
|
+
</div>
|
|
362
|
+
</section>
|
|
363
|
+
<mol-modal
|
|
364
|
+
[open]="showUpgrade()"
|
|
365
|
+
(close)="showUpgrade.set(false)"
|
|
366
|
+
[title]="t('settings.billing.upgradeTitle', undefined, { defaultValue: 'Upgrade your plan' })"
|
|
367
|
+
>
|
|
368
|
+
@if (upgradeError(); as checkoutError) {
|
|
369
|
+
<div mol-alert [status]="'error'" [className]="cm.sp('mb', 4)">{{ checkoutError }}</div>
|
|
370
|
+
}
|
|
371
|
+
@if (tiers().length === 0) {
|
|
372
|
+
<p [class]="cm.cn(cm.textSize('sm'), cm.textMuted)">
|
|
373
|
+
{{
|
|
374
|
+
t('settings.billing.noTiers', undefined, { defaultValue: 'No paid plans configured.' })
|
|
375
|
+
}}
|
|
376
|
+
</p>
|
|
377
|
+
} @else {
|
|
378
|
+
<ul [class]="cm.stack(3)">
|
|
379
|
+
@for (entry of subscribeEntries(); track entry.key) {
|
|
380
|
+
<li [class]="cm.sp('p', 4)">
|
|
381
|
+
<div mol-flex [align]="'center'" [justify]="'between'">
|
|
382
|
+
<div>
|
|
383
|
+
<p [class]="cm.fontWeight('semibold')">
|
|
384
|
+
{{ entry.tier.name }} ({{ entry.price.interval }})
|
|
385
|
+
</p>
|
|
386
|
+
<p [class]="cm.cn(cm.textSize('xs'), cm.textMuted)">
|
|
387
|
+
{{ entry.price.priceLabel }}
|
|
388
|
+
</p>
|
|
389
|
+
</div>
|
|
390
|
+
<button
|
|
391
|
+
mol-button
|
|
392
|
+
[size]="'sm'"
|
|
393
|
+
[loading]="upgradeLoading() === entry.price.stripePriceId"
|
|
394
|
+
(click)="startCheckout(entry.price.stripePriceId)"
|
|
395
|
+
>
|
|
396
|
+
{{ t('settings.billing.subscribe', undefined, { defaultValue: 'Subscribe' }) }}
|
|
397
|
+
</button>
|
|
398
|
+
</div>
|
|
399
|
+
</li>
|
|
400
|
+
}
|
|
401
|
+
</ul>
|
|
402
|
+
}
|
|
403
|
+
</mol-modal>`,
|
|
404
|
+
}]
|
|
405
|
+
}], () => [], null); })();
|
|
406
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TiersUpgradeSection, { className: "TiersUpgradeSection", filePath: "tiers-upgrade-section.component.ts", lineNumber: 131 }); })();
|
|
407
|
+
//# sourceMappingURL=tiers-upgrade-section.component.js.map
|
|
@@ -0,0 +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,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;;;;;;;;;;;;;IAoDvC,iCAAuF;IAAhC,uLAAS,uBAAgB,IAAI,CAAC,KAAC;IACpF,YACF;IAAA,iBAAS;;;IAFgC,AAA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xC,mBAAmB;cApF/B,SAAS;eAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC;gBACpD,MAAM,EAAE,CAAC,oBAAoB,CAAC;gBAC9B,IAAI,EAAE;oBACJ,oBAAoB,EAAE,EAAE;oBACxB,KAAK,EAAE,mBAAmB;iBAC3B;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyEK;aAChB;;kFACY,mBAAmB"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of `@molecule/app-settings-panel-angular` — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-settings-panel-react`, same props and DOM.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Context published by `<SettingsContainer>` to its children (the same shape
|
|
9
|
+
* React's `SettingsPanelContext` carries).
|
|
10
|
+
*
|
|
11
|
+
* The container owns the dismiss-the-panel handler; sub-components that need
|
|
12
|
+
* to close after an action (logout, delete account) read it from the context
|
|
13
|
+
* rather than threading the prop down.
|
|
14
|
+
*/
|
|
15
|
+
export interface SettingsPanelContextValue {
|
|
16
|
+
/** Closes the settings panel (the container's `onClose` prop). */
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A user's registered device (subset rendered in the settings list) — the
|
|
21
|
+
* same shape React's `DevicesSection` renders.
|
|
22
|
+
*/
|
|
23
|
+
export interface Device {
|
|
24
|
+
/** The device row's id. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Display name (blank rows fall back to the platform). */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Platform label. */
|
|
29
|
+
platform: string;
|
|
30
|
+
/** Human-readable last-seen text, when the API supplies one. */
|
|
31
|
+
lastSeen?: string;
|
|
32
|
+
/** `true` for the device making the current request (the API marks it). */
|
|
33
|
+
isCurrent?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Props for `TiersUpgradeSection` — the same props
|
|
37
|
+
* `@molecule/app-settings-panel-react` accepts.
|
|
38
|
+
*/
|
|
39
|
+
export interface TiersUpgradeSectionProps {
|
|
40
|
+
/**
|
|
41
|
+
* How the page leaves for the checkout URL the server returns. Defaults to a
|
|
42
|
+
* full-page navigation (`openUrl` from `@molecule/app-utilities`).
|
|
43
|
+
*/
|
|
44
|
+
redirectToCheckout?: (checkoutUrl: string) => void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-settings-panel-angular",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
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
|
+
"homepage": "https://www.molecule.dev/packages/app-settings-panel-angular",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "ngc",
|
|
21
|
+
"dev": "ngc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"settings",
|
|
28
|
+
"panel",
|
|
29
|
+
"angular"
|
|
30
|
+
],
|
|
31
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
36
|
+
"directory": "packages/app/features/settings-panel-angular"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
},
|
|
41
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@angular/common": "^22.0.0",
|
|
47
|
+
"@angular/core": "^22.0.0",
|
|
48
|
+
"@angular/platform-browser": "^22.0.0",
|
|
49
|
+
"@molecule/app-angular": "^3.5.0",
|
|
50
|
+
"@molecule/app-auth": "^3.0.0",
|
|
51
|
+
"@molecule/app-http": "^1.8.0",
|
|
52
|
+
"@molecule/app-push": "^1.1.0",
|
|
53
|
+
"@molecule/app-ui": "^1.0.1",
|
|
54
|
+
"@molecule/app-ui-angular": "^1.1.0",
|
|
55
|
+
"@molecule/app-utilities": "^1.0.6"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@angular/common": "22.2.3",
|
|
59
|
+
"@angular/compiler": "22.2.3",
|
|
60
|
+
"@angular/compiler-cli": "22.2.3",
|
|
61
|
+
"@angular/core": "22.2.3",
|
|
62
|
+
"@angular/platform-browser": "22.2.3",
|
|
63
|
+
"@molecule/app-angular": "3.5.0",
|
|
64
|
+
"@molecule/app-auth": "3.4.2",
|
|
65
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
66
|
+
"@molecule/app-http": "1.8.0",
|
|
67
|
+
"@molecule/app-i18n": "1.2.1",
|
|
68
|
+
"@molecule/app-icons": "1.0.4",
|
|
69
|
+
"@molecule/app-push": "1.1.0",
|
|
70
|
+
"@molecule/app-ui": "1.3.11",
|
|
71
|
+
"@molecule/app-ui-angular": "1.1.1",
|
|
72
|
+
"@molecule/app-utilities": "1.0.6",
|
|
73
|
+
"@types/node": "26.6.5",
|
|
74
|
+
"jsdom": "30.1.3",
|
|
75
|
+
"rxjs": "7.8.2",
|
|
76
|
+
"typescript": "6.0.3",
|
|
77
|
+
"vitest": "4.1.12",
|
|
78
|
+
"zone.js": "0.16.3"
|
|
79
|
+
}
|
|
80
|
+
}
|