@nauticana/sail 1.1.10 → 1.1.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nauticana/sail",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "Metadata-driven Angular component library for CRUD admin frontends backed by the keel Go backend. Tables, forms, navigation, OTP/2FA/social auth, billing, payout onboarding.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<p class="sail-sms-consent">
|
|
2
|
+
By providing your phone number and tapping “{{ action() }},” you agree to receive
|
|
3
|
+
recurring automated text messages ({{ messagePurpose() }}) from {{ brandName() }} at that number.
|
|
4
|
+
Message frequency varies. Msg & data rates may apply. Reply STOP to opt out, HELP for help.
|
|
5
|
+
@if (terms() || privacy()) {
|
|
6
|
+
See our
|
|
7
|
+
@if (terms()) { <a [href]="terms()" target="_blank" rel="noopener">Terms</a> }
|
|
8
|
+
@if (terms() && privacy()) { and }
|
|
9
|
+
@if (privacy()) { <a [href]="privacy()" target="_blank" rel="noopener">Privacy Policy</a> }.
|
|
10
|
+
}
|
|
11
|
+
</p>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { SAIL_GUI_CONFIG, SailGuiConfig, DEFAULT_CONFIG } from '../../config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SmsConsent — the shared 10DLC / A2P SMS opt-in disclosure.
|
|
6
|
+
*
|
|
7
|
+
* Presentational only: renders the carrier-required consent language (recurring
|
|
8
|
+
* automated messages, frequency, rates, STOP/HELP, Terms + Privacy links) with
|
|
9
|
+
* the host app's brand and message purpose. Every SMS-sending app renders the
|
|
10
|
+
* same carrier-compliant copy — which must match the wording registered in its
|
|
11
|
+
* 10DLC campaign sample. Consent is *captured* server-side via keel's
|
|
12
|
+
* ConsentService (with the phone number); this component is only the disclosure
|
|
13
|
+
* shown at the point of opt-in. Styling is the consuming app's (sail ships no CSS).
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'sail-sms-consent',
|
|
17
|
+
templateUrl: './sms_consent.html',
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
encapsulation: ViewEncapsulation.None,
|
|
20
|
+
})
|
|
21
|
+
export class SmsConsentComponent {
|
|
22
|
+
private readonly guiConfig: SailGuiConfig = inject(SAIL_GUI_CONFIG, { optional: true }) ?? DEFAULT_CONFIG;
|
|
23
|
+
|
|
24
|
+
/** Brand name in the disclosure. Defaults to config.appName. */
|
|
25
|
+
readonly brand = input<string>('');
|
|
26
|
+
/** What the messages are — e.g. "one-time verification codes" or "verification codes and trip updates". */
|
|
27
|
+
readonly messagePurpose = input<string>('one-time verification codes');
|
|
28
|
+
/** The action label the disclosure references (the opt-in button's text). */
|
|
29
|
+
readonly action = input<string>('the button below');
|
|
30
|
+
/** Terms URL. Defaults to config.termsUrl. */
|
|
31
|
+
readonly termsUrl = input<string>('');
|
|
32
|
+
/** Privacy URL. Defaults to config.privacyPolicyUrl. */
|
|
33
|
+
readonly privacyUrl = input<string>('');
|
|
34
|
+
|
|
35
|
+
protected readonly brandName = computed(() => this.brand() || this.guiConfig.appName || 'us');
|
|
36
|
+
protected readonly terms = computed(() => this.termsUrl() || this.guiConfig.termsUrl || '');
|
|
37
|
+
protected readonly privacy = computed(() => this.privacyUrl() || this.guiConfig.privacyPolicyUrl || '');
|
|
38
|
+
}
|
package/src/config.ts
CHANGED
|
@@ -55,6 +55,10 @@ export interface SailGuiConfig {
|
|
|
55
55
|
appleRedirectUri?: string;
|
|
56
56
|
/** Public URL of your privacy policy. Shown as a link in ConsentGateComponent. */
|
|
57
57
|
privacyPolicyUrl?: string;
|
|
58
|
+
/** Public URL of your terms of service. Shown in the SMS-consent disclosure. */
|
|
59
|
+
termsUrl?: string;
|
|
60
|
+
/** Brand name shown in the SMS/10DLC consent disclosure (e.g. "Daxoom"). */
|
|
61
|
+
appName?: string;
|
|
58
62
|
/** Content hash / version of the currently-deployed privacy policy. */
|
|
59
63
|
defaultPolicyVersion?: string;
|
|
60
64
|
/** ISO 639-1 language code of the policy variant shown ('en', 'fr', ...). */
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from './component/login/chpass_component';
|
|
|
32
32
|
export * from './component/login/confirm_register_component';
|
|
33
33
|
export * from './component/login/confirm_chpass_component';
|
|
34
34
|
export * from './component/login/consent_gate';
|
|
35
|
+
export * from './component/login/sms_consent';
|
|
35
36
|
export * from './component/login/otp_input';
|
|
36
37
|
export * from './component/login/social_login';
|
|
37
38
|
export * from './component/login/account_deletion';
|