@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,33 @@
|
|
|
1
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* SettingsContainer component.
|
|
5
|
+
*
|
|
6
|
+
* Outer settings-panel layout: padded vertical stack that hosts the section
|
|
7
|
+
* sub-components (projected content). The host IS the `<div>` React renders
|
|
8
|
+
* (`div[mol-settings-container]`), with `cm.sp('p', 6)` + `cm.stack(6)`.
|
|
9
|
+
*
|
|
10
|
+
* Publishes `onClose` to descendants via the settings-panel context so
|
|
11
|
+
* `<LogOutDeleteSection>` etc. can dismiss the panel after an action without
|
|
12
|
+
* explicit prop threading. The registration happens in the constructor, which
|
|
13
|
+
* Angular runs before any projected child is created.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SettingsContainer {
|
|
16
|
+
/** Closes the settings panel, published to sections through the container context. */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
private readonly host;
|
|
19
|
+
/** The context registration removal (set in the constructor). */
|
|
20
|
+
private removeContext;
|
|
21
|
+
/** Registers the container context before any projected child resolves it. */
|
|
22
|
+
constructor();
|
|
23
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
24
|
+
protected readonly cm: UIClassMap;
|
|
25
|
+
/**
|
|
26
|
+
* Computes the container class list (`cm.sp('p', 6)` + `cm.stack(6)`).
|
|
27
|
+
* @returns The class string.
|
|
28
|
+
*/
|
|
29
|
+
classes(): string;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsContainer, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SettingsContainer, "div[mol-settings-container]", never, { "onClose": { "alias": "onClose"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=settings-container.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-container.component.d.ts","sourceRoot":"","sources":["../src/settings-container.component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAKlD;;;;;;;;;;;GAWG;AACH,qBASa,iBAAiB;IAC5B,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAE1C,iEAAiE;IACjE,OAAO,CAAC,aAAa,CAAuB;IAE5C,8EAA8E;;IAM9E,mEAAmE;IACnE,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAgB;IAEjD;;;OAGG;IACH,OAAO,IAAI,MAAM;yCAtBN,iBAAiB;2CAAjB,iBAAiB;CAyB7B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SettingsContainer component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Component, DestroyRef, ElementRef, inject } from '@angular/core';
|
|
7
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { provideSettingsPanelContext } from './context.js';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
const _c0 = ["*"];
|
|
11
|
+
/**
|
|
12
|
+
* SettingsContainer component.
|
|
13
|
+
*
|
|
14
|
+
* Outer settings-panel layout: padded vertical stack that hosts the section
|
|
15
|
+
* sub-components (projected content). The host IS the `<div>` React renders
|
|
16
|
+
* (`div[mol-settings-container]`), with `cm.sp('p', 6)` + `cm.stack(6)`.
|
|
17
|
+
*
|
|
18
|
+
* Publishes `onClose` to descendants via the settings-panel context so
|
|
19
|
+
* `<LogOutDeleteSection>` etc. can dismiss the panel after an action without
|
|
20
|
+
* explicit prop threading. The registration happens in the constructor, which
|
|
21
|
+
* Angular runs before any projected child is created.
|
|
22
|
+
*/
|
|
23
|
+
export class SettingsContainer {
|
|
24
|
+
/** Closes the settings panel, published to sections through the container context. */
|
|
25
|
+
onClose;
|
|
26
|
+
host = inject(ElementRef);
|
|
27
|
+
/** The context registration removal (set in the constructor). */
|
|
28
|
+
removeContext = () => { };
|
|
29
|
+
/** Registers the container context before any projected child resolves it. */
|
|
30
|
+
constructor() {
|
|
31
|
+
this.removeContext = provideSettingsPanelContext(this.host.nativeElement, () => this.onClose);
|
|
32
|
+
inject(DestroyRef).onDestroy(this.removeContext);
|
|
33
|
+
}
|
|
34
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
35
|
+
cm = getClassMap();
|
|
36
|
+
/**
|
|
37
|
+
* Computes the container class list (`cm.sp('p', 6)` + `cm.stack(6)`).
|
|
38
|
+
* @returns The class string.
|
|
39
|
+
*/
|
|
40
|
+
classes() {
|
|
41
|
+
return this.cm.cn(this.cm.sp('p', 6), this.cm.stack(6));
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = function SettingsContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SettingsContainer)(); };
|
|
44
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsContainer, selectors: [["div", "mol-settings-container", ""]], hostVars: 2, hostBindings: function SettingsContainer_HostBindings(rf, ctx) { if (rf & 2) {
|
|
45
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
46
|
+
} }, inputs: { onClose: "onClose" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function SettingsContainer_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵprojectionDef();
|
|
48
|
+
i0.ɵɵprojection(0);
|
|
49
|
+
} }, encapsulation: 2 });
|
|
50
|
+
}
|
|
51
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SettingsContainer, [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: 'div[mol-settings-container]',
|
|
55
|
+
standalone: true,
|
|
56
|
+
inputs: ['onClose'],
|
|
57
|
+
host: {
|
|
58
|
+
'[class]': 'classes()',
|
|
59
|
+
},
|
|
60
|
+
template: `<ng-content></ng-content>`,
|
|
61
|
+
}]
|
|
62
|
+
}], () => [], null); })();
|
|
63
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsContainer, { className: "SettingsContainer", filePath: "settings-container.component.ts", lineNumber: 35 }); })();
|
|
64
|
+
//# sourceMappingURL=settings-container.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-container.component.js","sourceRoot":"","sources":["../src/settings-container.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;;;AAE1D;;;;;;;;;;;GAWG;AAUH,MAAM,OAAO,iBAAiB;IAC5B,sFAAsF;IACtF,OAAO,CAAa;IAEH,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;IAE1C,iEAAiE;IACzD,aAAa,GAAe,GAAG,EAAE,GAAE,CAAC,CAAA;IAE5C,8EAA8E;IAC9E;QACE,IAAI,CAAC,aAAa,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC7F,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAClD,CAAC;IAED,mEAAmE;IAChD,EAAE,GAAe,WAAW,EAAE,CAAA;IAEjD;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,CAAC;2GAxBU,iBAAiB;6DAAjB,iBAAiB;YAAjB,cAAA,aAAS,CAAQ;;;YAFjB,kBAAyB;;;iFAEzB,iBAAiB;cAT7B,SAAS;eAAC;gBACT,QAAQ,EAAE,6BAA6B;gBACvC,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,SAAS,CAAC;gBACnB,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,iBAAiB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* ThisDeviceSection component.
|
|
5
|
+
*
|
|
6
|
+
* "This device" detail strip — OS, browser, online/offline. The host IS the
|
|
7
|
+
* `<section>` React renders.
|
|
8
|
+
*
|
|
9
|
+
* Reads everything from `@molecule/app-device` through the `useDevice` hook
|
|
10
|
+
* (`deviceInfo` and `isOnline()`), so the bonded device provider decides what
|
|
11
|
+
* it shows. No side effects, no app-specific state.
|
|
12
|
+
*
|
|
13
|
+
* The network line's `isOnline()` call is mediated by a `computed` over the
|
|
14
|
+
* i18n notifications (its only change signal), so the provider is read once
|
|
15
|
+
* per render — the same call count React's render records — and again on a
|
|
16
|
+
* locale switch, exactly like a React re-render.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ThisDeviceSection {
|
|
19
|
+
/** The bonded device provider's info (read once, like React's memoized hook). */
|
|
20
|
+
protected readonly device: import("@molecule/app-angular").UseDeviceResult;
|
|
21
|
+
/** Reactive translation, read in the injection context. */
|
|
22
|
+
protected readonly i18n: import("@molecule/app-angular").UseTranslationResult;
|
|
23
|
+
/** The translation function for the template. */
|
|
24
|
+
protected t: (key: string, values?: import("@molecule/app-i18n").InterpolationValues, options?: import("@molecule/app-i18n").TranslateOptions) => string;
|
|
25
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
26
|
+
protected readonly cm: UIClassMap;
|
|
27
|
+
/** The OS name, or the localized Unknown fallback. */
|
|
28
|
+
protected readonly platformLabel: import("@angular/core").Signal<string>;
|
|
29
|
+
/** The browser name, or the localized Unknown fallback. */
|
|
30
|
+
protected readonly browserLabel: import("@angular/core").Signal<string>;
|
|
31
|
+
/**
|
|
32
|
+
* The network line: `isOnline()` runs when this computed first renders and
|
|
33
|
+
* again whenever the locale changes (the t() calls track the i18n
|
|
34
|
+
* notifications), matching React's per-render call exactly.
|
|
35
|
+
*/
|
|
36
|
+
protected readonly networkLabel: import("@angular/core").Signal<string>;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThisDeviceSection, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ThisDeviceSection, "section[mol-settings-this-device]", never, {}, {}, never, never, true, never>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=this-device-section.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"this-device-section.component.d.ts","sourceRoot":"","sources":["../src/this-device-section.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAIlD;;;;;;;;;;;;;;GAcG;AACH,qBA4Ba,iBAAiB;IAC5B,iFAAiF;IACjF,SAAS,CAAC,QAAQ,CAAC,MAAM,kDAAc;IAEvC,2DAA2D;IAC3D,SAAS,CAAC,QAAQ,CAAC,IAAI,uDAAmB;IAE1C,iDAAiD;IACjD,SAAS,CAAC,CAAC,8IAAc;IAEzB,mEAAmE;IACnE,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAgB;IAEjD,sDAAsD;IACtD,SAAS,CAAC,QAAQ,CAAC,aAAa,yCAK9B;IAEF,2DAA2D;IAC3D,SAAS,CAAC,QAAQ,CAAC,YAAY,yCAK7B;IAEF;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,yCAI7B;yCAtCS,iBAAiB;2CAAjB,iBAAiB;CAuC7B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThisDeviceSection component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Component, computed } from '@angular/core';
|
|
7
|
+
import { useDevice, useTranslation } from '@molecule/app-angular';
|
|
8
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import { Flex } from '@molecule/app-ui-angular';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
const _c0 = () => ({ defaultValue: "This Device" });
|
|
12
|
+
const _c1 = () => ({ defaultValue: "Platform" });
|
|
13
|
+
const _c2 = () => ({ defaultValue: "Browser" });
|
|
14
|
+
const _c3 = () => ({ defaultValue: "Network" });
|
|
15
|
+
/**
|
|
16
|
+
* ThisDeviceSection component.
|
|
17
|
+
*
|
|
18
|
+
* "This device" detail strip — OS, browser, online/offline. The host IS the
|
|
19
|
+
* `<section>` React renders.
|
|
20
|
+
*
|
|
21
|
+
* Reads everything from `@molecule/app-device` through the `useDevice` hook
|
|
22
|
+
* (`deviceInfo` and `isOnline()`), so the bonded device provider decides what
|
|
23
|
+
* it shows. No side effects, no app-specific state.
|
|
24
|
+
*
|
|
25
|
+
* The network line's `isOnline()` call is mediated by a `computed` over the
|
|
26
|
+
* i18n notifications (its only change signal), so the provider is read once
|
|
27
|
+
* per render — the same call count React's render records — and again on a
|
|
28
|
+
* locale switch, exactly like a React re-render.
|
|
29
|
+
*/
|
|
30
|
+
export class ThisDeviceSection {
|
|
31
|
+
/** The bonded device provider's info (read once, like React's memoized hook). */
|
|
32
|
+
device = useDevice();
|
|
33
|
+
/** Reactive translation, read in the injection context. */
|
|
34
|
+
i18n = useTranslation();
|
|
35
|
+
/** The translation function for the template. */
|
|
36
|
+
t = this.i18n.t;
|
|
37
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
38
|
+
cm = getClassMap();
|
|
39
|
+
/** The OS name, or the localized Unknown fallback. */
|
|
40
|
+
platformLabel = computed(() => {
|
|
41
|
+
return (this.device.deviceInfo.os.name ||
|
|
42
|
+
this.t('settings.unknown', undefined, { defaultValue: 'Unknown' }));
|
|
43
|
+
}, /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "platformLabel" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** The browser name, or the localized Unknown fallback. */
|
|
46
|
+
browserLabel = computed(() => {
|
|
47
|
+
return (this.device.deviceInfo.browser.name ||
|
|
48
|
+
this.t('settings.unknown', undefined, { defaultValue: 'Unknown' }));
|
|
49
|
+
}, /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "browserLabel" }] : /* istanbul ignore next */ []));
|
|
51
|
+
/**
|
|
52
|
+
* The network line: `isOnline()` runs when this computed first renders and
|
|
53
|
+
* again whenever the locale changes (the t() calls track the i18n
|
|
54
|
+
* notifications), matching React's per-render call exactly.
|
|
55
|
+
*/
|
|
56
|
+
networkLabel = computed(() => {
|
|
57
|
+
return this.device.isOnline()
|
|
58
|
+
? this.t('settings.online', undefined, { defaultValue: 'Online' })
|
|
59
|
+
: this.t('settings.offline', undefined, { defaultValue: 'Offline' });
|
|
60
|
+
}, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "networkLabel" }] : /* istanbul ignore next */ []));
|
|
62
|
+
static ɵfac = function ThisDeviceSection_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ThisDeviceSection)(); };
|
|
63
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ThisDeviceSection, selectors: [["section", "mol-settings-this-device", ""]], decls: 18, vars: 24, consts: [["mol-flex", "", 3, "justify"]], template: function ThisDeviceSection_Template(rf, ctx) { if (rf & 1) {
|
|
64
|
+
i0.ɵɵelementStart(0, "h3");
|
|
65
|
+
i0.ɵɵtext(1);
|
|
66
|
+
i0.ɵɵelementEnd();
|
|
67
|
+
i0.ɵɵelementStart(2, "dl")(3, "div", 0)(4, "dt");
|
|
68
|
+
i0.ɵɵtext(5);
|
|
69
|
+
i0.ɵɵelementEnd();
|
|
70
|
+
i0.ɵɵelementStart(6, "dd");
|
|
71
|
+
i0.ɵɵtext(7);
|
|
72
|
+
i0.ɵɵelementEnd()();
|
|
73
|
+
i0.ɵɵelementStart(8, "div", 0)(9, "dt");
|
|
74
|
+
i0.ɵɵtext(10);
|
|
75
|
+
i0.ɵɵelementEnd();
|
|
76
|
+
i0.ɵɵelementStart(11, "dd");
|
|
77
|
+
i0.ɵɵtext(12);
|
|
78
|
+
i0.ɵɵelementEnd()();
|
|
79
|
+
i0.ɵɵelementStart(13, "div", 0)(14, "dt");
|
|
80
|
+
i0.ɵɵtext(15);
|
|
81
|
+
i0.ɵɵelementEnd();
|
|
82
|
+
i0.ɵɵelementStart(16, "dd");
|
|
83
|
+
i0.ɵɵtext(17);
|
|
84
|
+
i0.ɵɵelementEnd()()();
|
|
85
|
+
} if (rf & 2) {
|
|
86
|
+
i0.ɵɵclassMap(ctx.cm.cn(ctx.cm.sectionHeading, ctx.cm.sp("mb", 3)));
|
|
87
|
+
i0.ɵɵadvance();
|
|
88
|
+
i0.ɵɵtextInterpolate1(" ", ctx.t("settings.thisDevice", undefined, i0.ɵɵpureFunction0(20, _c0)), " ");
|
|
89
|
+
i0.ɵɵadvance();
|
|
90
|
+
i0.ɵɵclassMap(ctx.cm.cn(ctx.cm.stack(1), ctx.cm.textSize("sm")));
|
|
91
|
+
i0.ɵɵadvance();
|
|
92
|
+
i0.ɵɵproperty("justify", "between");
|
|
93
|
+
i0.ɵɵadvance();
|
|
94
|
+
i0.ɵɵclassMap(ctx.cm.textMuted);
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵtextInterpolate1(" ", ctx.t("settings.platform", undefined, i0.ɵɵpureFunction0(21, _c1)), " ");
|
|
97
|
+
i0.ɵɵadvance(2);
|
|
98
|
+
i0.ɵɵtextInterpolate(ctx.platformLabel());
|
|
99
|
+
i0.ɵɵadvance();
|
|
100
|
+
i0.ɵɵproperty("justify", "between");
|
|
101
|
+
i0.ɵɵadvance();
|
|
102
|
+
i0.ɵɵclassMap(ctx.cm.textMuted);
|
|
103
|
+
i0.ɵɵadvance();
|
|
104
|
+
i0.ɵɵtextInterpolate1(" ", ctx.t("settings.browser", undefined, i0.ɵɵpureFunction0(22, _c2)), " ");
|
|
105
|
+
i0.ɵɵadvance(2);
|
|
106
|
+
i0.ɵɵtextInterpolate(ctx.browserLabel());
|
|
107
|
+
i0.ɵɵadvance();
|
|
108
|
+
i0.ɵɵproperty("justify", "between");
|
|
109
|
+
i0.ɵɵadvance();
|
|
110
|
+
i0.ɵɵclassMap(ctx.cm.textMuted);
|
|
111
|
+
i0.ɵɵadvance();
|
|
112
|
+
i0.ɵɵtextInterpolate1(" ", ctx.t("settings.network", undefined, i0.ɵɵpureFunction0(23, _c3)), " ");
|
|
113
|
+
i0.ɵɵadvance(2);
|
|
114
|
+
i0.ɵɵtextInterpolate(ctx.networkLabel());
|
|
115
|
+
} }, dependencies: [Flex], encapsulation: 2 });
|
|
116
|
+
}
|
|
117
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ThisDeviceSection, [{
|
|
118
|
+
type: Component,
|
|
119
|
+
args: [{
|
|
120
|
+
selector: 'section[mol-settings-this-device]',
|
|
121
|
+
standalone: true,
|
|
122
|
+
imports: [Flex],
|
|
123
|
+
template: `<h3 [class]="cm.cn(cm.sectionHeading, cm.sp('mb', 3))">
|
|
124
|
+
{{ t('settings.thisDevice', undefined, { defaultValue: 'This Device' }) }}
|
|
125
|
+
</h3>
|
|
126
|
+
<dl [class]="cm.cn(cm.stack(1), cm.textSize('sm'))">
|
|
127
|
+
<div mol-flex [justify]="'between'">
|
|
128
|
+
<dt [class]="cm.textMuted">
|
|
129
|
+
{{ t('settings.platform', undefined, { defaultValue: 'Platform' }) }}
|
|
130
|
+
</dt>
|
|
131
|
+
<dd>{{ platformLabel() }}</dd>
|
|
132
|
+
</div>
|
|
133
|
+
<div mol-flex [justify]="'between'">
|
|
134
|
+
<dt [class]="cm.textMuted">
|
|
135
|
+
{{ t('settings.browser', undefined, { defaultValue: 'Browser' }) }}
|
|
136
|
+
</dt>
|
|
137
|
+
<dd>{{ browserLabel() }}</dd>
|
|
138
|
+
</div>
|
|
139
|
+
<div mol-flex [justify]="'between'">
|
|
140
|
+
<dt [class]="cm.textMuted">
|
|
141
|
+
{{ t('settings.network', undefined, { defaultValue: 'Network' }) }}
|
|
142
|
+
</dt>
|
|
143
|
+
<dd>{{ networkLabel() }}</dd>
|
|
144
|
+
</div>
|
|
145
|
+
</dl>`,
|
|
146
|
+
}]
|
|
147
|
+
}], null, null); })();
|
|
148
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ThisDeviceSection, { className: "ThisDeviceSection", filePath: "this-device-section.component.ts", lineNumber: 57 }); })();
|
|
149
|
+
//# sourceMappingURL=this-device-section.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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Y,iBAAiB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** One tier price as the section renders it (React's local `TierPrice`). */
|
|
4
|
+
interface TierPrice {
|
|
5
|
+
stripePriceId?: string;
|
|
6
|
+
interval: string;
|
|
7
|
+
priceLabel: string;
|
|
8
|
+
}
|
|
9
|
+
/** One upgrade tier with its subscribe-able prices (React's local `Tier`). */
|
|
10
|
+
interface Tier {
|
|
11
|
+
planKey: string;
|
|
12
|
+
name: string;
|
|
13
|
+
prices: TierPrice[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* TiersUpgradeSection component.
|
|
17
|
+
*
|
|
18
|
+
* Billing section with full multi-tier upgrade flow. React's root is a
|
|
19
|
+
* fragment (the `<section>` plus the upgrade modal), so the host is unwrapped
|
|
20
|
+
* by the DOM normalizer and `display: contents` keeps the layout
|
|
21
|
+
* fragment-like.
|
|
22
|
+
*
|
|
23
|
+
* Replaces the simpler `BillingSection` for apps backed by
|
|
24
|
+
* `@molecule/api-payments-stripe` + `@molecule/api-resource-payment` — loads
|
|
25
|
+
* the user's current plan from `/api/billing/status`, loads available tiers
|
|
26
|
+
* from `/api/billing/tiers`, and renders an Upgrade modal with a Subscribe
|
|
27
|
+
* button per tier price. Subscribe POSTs to `/api/billing/checkout` and
|
|
28
|
+
* redirects to the Stripe checkout URL; paid users see a Cancel button that
|
|
29
|
+
* POSTs to `/api/billing/cancel`. A refused request shows the server's
|
|
30
|
+
* message.
|
|
31
|
+
*/
|
|
32
|
+
export declare class TiersUpgradeSection {
|
|
33
|
+
/**
|
|
34
|
+
* How the page leaves for the checkout URL the server returns. Defaults to
|
|
35
|
+
* a full-page navigation (`openUrl`); an app passes its own opener (React's
|
|
36
|
+
* `redirectToCheckout` prop).
|
|
37
|
+
*/
|
|
38
|
+
redirectToCheckout: (checkoutUrl: string) => void;
|
|
39
|
+
/** Reactive translation, read in the injection context. */
|
|
40
|
+
protected readonly i18n: import("@molecule/app-angular").UseTranslationResult;
|
|
41
|
+
/** The translation function for the template. */
|
|
42
|
+
protected t: (key: string, values?: import("@molecule/app-i18n").InterpolationValues, options?: import("@molecule/app-i18n").TranslateOptions) => string;
|
|
43
|
+
private readonly http;
|
|
44
|
+
/** The user's current plan name. */
|
|
45
|
+
protected readonly plan: import("@angular/core").WritableSignal<string>;
|
|
46
|
+
/** The user's current plan key. */
|
|
47
|
+
protected readonly planKey: import("@angular/core").WritableSignal<string>;
|
|
48
|
+
/** The tiers loaded from `/api/billing/tiers`. */
|
|
49
|
+
protected readonly tiers: import("@angular/core").WritableSignal<Tier[]>;
|
|
50
|
+
/** Whether the upgrade modal is open. */
|
|
51
|
+
protected readonly showUpgrade: import("@angular/core").WritableSignal<boolean>;
|
|
52
|
+
/** The price id whose checkout request is running, or null. */
|
|
53
|
+
protected readonly upgradeLoading: import("@angular/core").WritableSignal<string | null>;
|
|
54
|
+
/** The upgrade modal's error message. */
|
|
55
|
+
protected readonly upgradeError: import("@angular/core").WritableSignal<string>;
|
|
56
|
+
/** The bonded ClassMap (styling tokens resolve at render time). */
|
|
57
|
+
protected readonly cm: UIClassMap;
|
|
58
|
+
/**
|
|
59
|
+
* The (tier, price) pairs the modal lists: every paid tier's prices that
|
|
60
|
+
* carry a stripe price id (React's filter + flatMap).
|
|
61
|
+
* @returns The entries.
|
|
62
|
+
*/
|
|
63
|
+
protected subscribeEntries(): {
|
|
64
|
+
key: string;
|
|
65
|
+
tier: Tier;
|
|
66
|
+
price: TierPrice;
|
|
67
|
+
}[];
|
|
68
|
+
/**
|
|
69
|
+
* Loads the current plan and the available tiers on mount (React's mount
|
|
70
|
+
* effect): each fetch resolves null on failure and the mapping keeps the
|
|
71
|
+
* defaults instead of throwing. A result that lands after unmount is
|
|
72
|
+
* dropped like React's cancelled one.
|
|
73
|
+
*/
|
|
74
|
+
constructor();
|
|
75
|
+
/**
|
|
76
|
+
* Starts the checkout for one price (React's `handleStartCheckout`).
|
|
77
|
+
* @param stripePriceId - The price to subscribe to.
|
|
78
|
+
*/
|
|
79
|
+
protected startCheckout(stripePriceId: string | undefined): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Cancels the subscription (React's `handleCancelSubscription`); a failure
|
|
82
|
+
* shows the server's message and keeps the plan.
|
|
83
|
+
*/
|
|
84
|
+
protected cancelSubscription: () => Promise<void>;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TiersUpgradeSection, never>;
|
|
86
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TiersUpgradeSection, "mol-tiers-upgrade-section", never, { "redirectToCheckout": { "alias": "redirectToCheckout"; "required": false; }; }, {}, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=tiers-upgrade-section.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiers-upgrade-section.component.d.ts","sourceRoot":"","sources":["../src/tiers-upgrade-section.component.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAKlD,4EAA4E;AAC5E,UAAU,SAAS;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,8EAA8E;AAC9E,UAAU,IAAI;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAoFa,mBAAmB;IAC9B;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAU;IAE3D,2DAA2D;IAC3D,SAAS,CAAC,QAAQ,CAAC,IAAI,uDAAmB;IAE1C,iDAAiD;IACjD,SAAS,CAAC,CAAC,8IA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