@clossys/writer 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,6 +66,11 @@ remains the only required first-day assessment.
66
66
  `VoiceChannel`.
67
67
  - `@clossys/writer/voice-record.template.jsonc` is an annotated,
68
68
  unbound template to copy into a consumer repository and fill in.
69
+ - `@clossys/writer/front-door` exports `resolveFrontDoorCopy` and its types
70
+ for browser rendering with immutable shipped English defaults. It accepts
71
+ only key and nouns; it exposes no registry or approval overrides. Returned
72
+ values and provenance do not share private catalog state. Package defaults
73
+ are not consumer approval; consumer registries use the strict root APIs.
69
74
  - `@clossys/writer/front-door.en.json` is the shipped English front-door
70
75
  catalog (`FRONT_DOOR_COPY_EN`) as a `CopyRegistry` JSON file.
71
76
 
@@ -109,7 +114,7 @@ registered `CopyRecord`. It exits 0 when clean, 1 when it finds traceability
109
114
  issues, and 2 when it cannot run.
110
115
 
111
116
  This package does not resolve a claim's `factRef`, infer tone or grammar, or
112
- ship actual product language, except for the 63 English front-door defaults in
117
+ ship actual product language, except for the 72 English front-door defaults in
113
118
  "Front-door copy" below. Those decisions remain with the consumer and the
114
119
  product's facts system.
115
120
 
@@ -310,7 +315,7 @@ An FAQ and a tagline are out of scope (`site.tagline` already exists).
310
315
  The words on a sign-in page and the pages around it are a reserved copy kind
311
316
  too, so each page does not carry its own. An id is
312
317
  `front-door.<state>.<slot>`, where the slot is one of `title`, `description`,
313
- `label`, `primary`, `secondary`, `notice` or `alt`. This version ships 63
318
+ `label`, `primary`, `secondary`, `notice` or `alt`. This version ships 72
314
319
  ids, listed in `FRONT_DOOR_COPY_IDS` (typed as `FrontDoorKey`), as
315
320
  `FRONT_DOOR_COPY_EN`, a `CopyRegistry` with the id `front-door`, locale `en`
316
321
  and revision `1`; the same registry ships as data in
@@ -336,14 +341,14 @@ label:
336
341
  | `front-door.password.secondary` | Use a different email |
337
342
  | `front-door.identifier-not-found.notice` | We couldn’t find an account for that email. Check it and try again. |
338
343
  | `front-door.forgot-password.label` | Forgot password? |
339
- | `front-door.password.notice` | That password isn’t right. Try again or reset it. |
344
+ | `front-door.password.notice` | That password isn’t right. Try again. |
340
345
  | `front-door.sign-in.alt` | Sign in to {brand} |
341
- | `front-door.code.title` | Check your email |
342
- | `front-door.code.description` | Enter the code sent to {identifier}. |
346
+ | `front-door.code.title` | Verify your sign-in |
347
+ | `front-door.code.description` | Enter your verification code to continue. |
343
348
  | `front-door.code.label` | Code |
344
349
  | `front-door.code.primary` | Verify |
345
350
  | `front-door.code.secondary` | Send a new code |
346
- | `front-door.code.notice` | That code isn’t right or has expired. Try again or send a new code. |
351
+ | `front-door.code.notice` | That code isn’t right or has expired. Try again. |
347
352
  | `front-door.unavailable.notice` | Sign-in isn’t available right now. Try again in a few minutes. |
348
353
  | `front-door.rate-limited.notice` | Too many attempts. Wait a few minutes, then try again. |
349
354
  | `front-door.locked.notice` | This account is temporarily locked after too many attempts. Try again later. |
@@ -389,6 +394,38 @@ label:
389
394
  | `front-door.activation-last-name.label` | Last name |
390
395
  | `front-door.name-required.notice` | Enter your first and last name. |
391
396
 
397
+ ### Restricted front-door variants
398
+
399
+ These additional reserved ids follow the same placeholder, approval and
400
+ provenance conventions as the open-surface defaults. They are variants;
401
+ hosts select them deliberately for staff-only or invitation-only sign-in.
402
+
403
+ | Id | Surface | English default |
404
+ | --- | --- | --- |
405
+ | `front-door.sign-in-staff-only.description` | Staff-only | Sign-in is for staff with access to {surface}. |
406
+ | `front-door.sign-in-invite-only.description` | Invitation-only | Sign-in is by invitation to {surface}. |
407
+ | `front-door.not-authorized-staff-only.title` | Staff-only | Staff access required |
408
+ | `front-door.not-authorized-staff-only.description` | Staff-only | This account doesn’t have staff access to {surface}. |
409
+ | `front-door.not-authorized-staff-only.primary` | Staff-only | Switch account |
410
+ | `front-door.not-authorized-invite-only.title` | Invitation-only | Invitation required |
411
+ | `front-door.not-authorized-invite-only.description` | Invitation-only | This account doesn’t have an invitation to {surface}. |
412
+ | `front-door.not-authorized-invite-only.primary` | Invitation-only | Switch account |
413
+ | `front-door.identifier-not-found-neutral.notice` | Either restricted surface | Sign-in couldn’t continue. Check your details and try again. |
414
+
415
+ Descriptions declare only `surface`; the titles, primary actions and neutral
416
+ notice declare no nouns. No `identifier` or `requestAccessLabel` is required.
417
+ Resolve `front-door.sign-in.title`, `front-door.sign-in.primary` and
418
+ `front-door.unavailable.notice` as usual. Omit request-access and sign-up
419
+ copy on these surfaces. A not-authorized composition uses the three matching
420
+ ids with one primary “Switch account” control and no secondary action. The
421
+ neutral notice uses no first-person plural and does not confirm account
422
+ existence. These words do not enforce access; the host owns authorization.
423
+
424
+ Passkey, email-code and share-card ids, and consumer-defined catalog ids,
425
+ are outside this sign-in addition.
426
+
427
+ ### Front-door noun resolution
428
+
392
429
  A `{token}` in a text is a noun from the closed set `FRONT_DOOR_NOUNS`:
393
430
  `brand`, `surface`, `identifier`, `digest` and `requestAccessLabel` (typed as
394
431
  `FrontDoorNoun`; a caller's values are `FrontDoorNouns`). The defaults are
@@ -0,0 +1,5 @@
1
+ import type { FrontDoorKey, FrontDoorNouns, FrontDoorCopyResolution } from "./front-door-core.js";
2
+ export type { FrontDoorKey, FrontDoorNoun, FrontDoorNouns, FrontDoorCopyIssueReason, FrontDoorCopyIssue, FrontDoorCopyResolution } from "./front-door-core.js";
3
+ /** Pure and total; each success returns independent values and provenance. */
4
+ export declare function resolveFrontDoorCopy(key: FrontDoorKey, nouns: FrontDoorNouns): FrontDoorCopyResolution;
5
+ //# sourceMappingURL=front-door-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-door-browser.d.ts","sourceRoot":"","sources":["../src/front-door-browser.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAW/J,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,uBAAuB,CAWtG"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Immutable shipped English defaults for browser rendering. This entry accepts
3
+ * only a reserved key and nouns; package defaults do not authorize consumer copy.
4
+ * Consumer registries and approval records belong to the strict root resolver.
5
+ */
6
+ import { CANONICAL_IDS, CANONICAL_NOUNS, createDefaultCatalog, prepareFrontDoorCopy } from "./front-door-core.js";
7
+ const defaults = createDefaultCatalog();
8
+ for (const entry of defaults.entries) {
9
+ if (entry.placeholders)
10
+ Object.freeze(entry.placeholders);
11
+ Object.freeze(entry);
12
+ }
13
+ Object.freeze(defaults.entries);
14
+ Object.freeze(defaults.source);
15
+ Object.freeze(defaults);
16
+ /** Pure and total; each success returns independent values and provenance. */
17
+ export function resolveFrontDoorCopy(key, nouns) {
18
+ const prepared = prepareFrontDoorCopy(key, nouns, defaults, CANONICAL_IDS, CANONICAL_NOUNS);
19
+ if (!prepared.complete)
20
+ return prepared;
21
+ const { entry, values } = prepared;
22
+ const text = entry.text.replace(/\{([^{}]+)\}/g, (_match, name) => String(values[name]));
23
+ return {
24
+ complete: true, text, issues: [], resolution: {
25
+ ref: { id: key, values }, text, recordId: defaults.id, revision: defaults.revision,
26
+ locale: defaults.locale, source: { ...defaults.source }, entryId: entry.id,
27
+ }
28
+ };
29
+ }
30
+ //# sourceMappingURL=front-door-browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-door-browser.js","sourceRoot":"","sources":["../src/front-door-browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIlH,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;AACxC,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,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /** Pure private catalog and noun validation shared by the two public entry points. */
2
+ import type { CopyRegistry, CopyRegistryEntry, CopyResolution } from "./types.js";
3
+ /** All reserved front-door copy ids, in catalog order. */
4
+ export declare const CANONICAL_IDS: readonly ["front-door.sign-in.title", "front-door.sign-in.description", "front-door.sign-in.label", "front-door.sign-in.primary", "front-door.password.title", "front-door.password.description", "front-door.password.label", "front-door.password.primary", "front-door.password.secondary", "front-door.identifier-not-found.notice", "front-door.forgot-password.label", "front-door.password.notice", "front-door.sign-in.alt", "front-door.code.title", "front-door.code.description", "front-door.code.label", "front-door.code.primary", "front-door.code.secondary", "front-door.code.notice", "front-door.unavailable.notice", "front-door.rate-limited.notice", "front-door.locked.notice", "front-door.expired.notice", "front-door.signed-out.notice", "front-door.error.title", "front-door.error.description", "front-door.error.primary", "front-door.not-found.title", "front-door.not-found.description", "front-door.not-found.primary", "front-door.not-authorized.title", "front-door.not-authorized.description", "front-door.not-authorized.primary", "front-door.not-authorized.secondary", "front-door.access-pending.title", "front-door.access-pending.description", "front-door.access-pending.primary", "front-door.service-unavailable.title", "front-door.service-unavailable.description", "front-door.service-unavailable.primary", "front-door.request-access.description", "front-door.request-access.label", "front-door.reset.title", "front-door.reset.description", "front-door.reset.label", "front-door.reset.primary", "front-door.reset.secondary", "front-door.reset.notice", "front-door.activation.title", "front-door.activation.description", "front-door.activation.primary", "front-door.activation.notice", "front-door.internal-note.label", "front-door.identifier-required.notice", "front-door.password-required.notice", "front-door.code-required.notice", "front-door.network.notice", "front-door.password-weak.notice", "front-door.reset-code.primary", "front-door.activation.label", "front-door.activation-first-name.label", "front-door.activation-last-name.label", "front-door.name-required.notice", "front-door.sign-in-staff-only.description", "front-door.sign-in-invite-only.description", "front-door.not-authorized-staff-only.title", "front-door.not-authorized-staff-only.description", "front-door.not-authorized-staff-only.primary", "front-door.not-authorized-invite-only.title", "front-door.not-authorized-invite-only.description", "front-door.not-authorized-invite-only.primary", "front-door.identifier-not-found-neutral.notice"];
5
+ /** A reserved front-door copy id. */
6
+ export type FrontDoorKey = (typeof CANONICAL_IDS)[number];
7
+ /** The closed set of nouns a front-door text may name as a `{token}`. */
8
+ export declare const CANONICAL_NOUNS: readonly ["brand", "surface", "identifier", "digest", "requestAccessLabel"];
9
+ /** One noun a front-door text may name. */
10
+ export type FrontDoorNoun = (typeof CANONICAL_NOUNS)[number];
11
+ /** The nouns a caller supplies; each is read only when the entry declares it. */
12
+ export type FrontDoorNouns = Partial<Record<FrontDoorNoun, string>>;
13
+ /** Why a front-door entry could not be resolved. */
14
+ export type FrontDoorCopyIssueReason = "unknown-copy-id" | "missing-noun" | "unknown-noun";
15
+ /** One reason a front-door entry could not be resolved. */
16
+ export interface FrontDoorCopyIssue {
17
+ reason: FrontDoorCopyIssueReason;
18
+ message: string;
19
+ /** The id asked for, on `"unknown-copy-id"`. */
20
+ id?: string;
21
+ /** The noun at fault, on `"missing-noun"` and `"unknown-noun"`. */
22
+ noun?: string;
23
+ }
24
+ /**
25
+ * The outcome of `resolveFrontDoorCopy`. `text` and `resolution` are
26
+ * present only when `complete` is `true`; `issues` is empty exactly then.
27
+ */
28
+ export interface FrontDoorCopyResolution {
29
+ complete: boolean;
30
+ text?: string;
31
+ resolution?: CopyResolution;
32
+ issues: FrontDoorCopyIssue[];
33
+ }
34
+ /** Returns independent mutable defaults for the legacy registry resolver. */
35
+ export declare function createDefaultCatalog(): CopyRegistry;
36
+ /** Reads and validates nouns without importing registry approval machinery. */
37
+ export declare function prepareFrontDoorCopy(key: FrontDoorKey, nouns: FrontDoorNouns, catalog: CopyRegistry, ids: readonly string[], nounNames: readonly string[]): {
38
+ complete: false;
39
+ issues: FrontDoorCopyIssue[];
40
+ } | {
41
+ complete: true;
42
+ entry: CopyRegistryEntry;
43
+ values: Record<string, string>;
44
+ };
45
+ //# sourceMappingURL=front-door-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-door-core.d.ts","source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,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAoCxL"}
@@ -0,0 +1,242 @@
1
+ /** All reserved front-door copy ids, in catalog order. */
2
+ export const CANONICAL_IDS = Object.freeze([
3
+ "front-door.sign-in.title",
4
+ "front-door.sign-in.description",
5
+ "front-door.sign-in.label",
6
+ "front-door.sign-in.primary",
7
+ "front-door.password.title",
8
+ "front-door.password.description",
9
+ "front-door.password.label",
10
+ "front-door.password.primary",
11
+ "front-door.password.secondary",
12
+ "front-door.identifier-not-found.notice",
13
+ "front-door.forgot-password.label",
14
+ "front-door.password.notice",
15
+ "front-door.sign-in.alt",
16
+ "front-door.code.title",
17
+ "front-door.code.description",
18
+ "front-door.code.label",
19
+ "front-door.code.primary",
20
+ "front-door.code.secondary",
21
+ "front-door.code.notice",
22
+ "front-door.unavailable.notice",
23
+ "front-door.rate-limited.notice",
24
+ "front-door.locked.notice",
25
+ "front-door.expired.notice",
26
+ "front-door.signed-out.notice",
27
+ "front-door.error.title",
28
+ "front-door.error.description",
29
+ "front-door.error.primary",
30
+ "front-door.not-found.title",
31
+ "front-door.not-found.description",
32
+ "front-door.not-found.primary",
33
+ "front-door.not-authorized.title",
34
+ "front-door.not-authorized.description",
35
+ "front-door.not-authorized.primary",
36
+ "front-door.not-authorized.secondary",
37
+ "front-door.access-pending.title",
38
+ "front-door.access-pending.description",
39
+ "front-door.access-pending.primary",
40
+ "front-door.service-unavailable.title",
41
+ "front-door.service-unavailable.description",
42
+ "front-door.service-unavailable.primary",
43
+ "front-door.request-access.description",
44
+ "front-door.request-access.label",
45
+ "front-door.reset.title",
46
+ "front-door.reset.description",
47
+ "front-door.reset.label",
48
+ "front-door.reset.primary",
49
+ "front-door.reset.secondary",
50
+ "front-door.reset.notice",
51
+ "front-door.activation.title",
52
+ "front-door.activation.description",
53
+ "front-door.activation.primary",
54
+ "front-door.activation.notice",
55
+ "front-door.internal-note.label",
56
+ "front-door.identifier-required.notice",
57
+ "front-door.password-required.notice",
58
+ "front-door.code-required.notice",
59
+ "front-door.network.notice",
60
+ "front-door.password-weak.notice",
61
+ "front-door.reset-code.primary",
62
+ "front-door.activation.label",
63
+ "front-door.activation-first-name.label",
64
+ "front-door.activation-last-name.label",
65
+ "front-door.name-required.notice",
66
+ "front-door.sign-in-staff-only.description",
67
+ "front-door.sign-in-invite-only.description",
68
+ "front-door.not-authorized-staff-only.title",
69
+ "front-door.not-authorized-staff-only.description",
70
+ "front-door.not-authorized-staff-only.primary",
71
+ "front-door.not-authorized-invite-only.title",
72
+ "front-door.not-authorized-invite-only.description",
73
+ "front-door.not-authorized-invite-only.primary",
74
+ "front-door.identifier-not-found-neutral.notice",
75
+ ]);
76
+ /** The closed set of nouns a front-door text may name as a `{token}`. */
77
+ export const CANONICAL_NOUNS = Object.freeze(["brand", "surface", "identifier", "digest", "requestAccessLabel"]);
78
+ const DEFAULTS = {
79
+ "front-door.sign-in.title": { text: "Sign in", context: "sign-in page: heading" },
80
+ "front-door.sign-in.description": { text: "Continue to {surface}.", context: "sign-in page: line under the heading" },
81
+ "front-door.sign-in.label": { text: "Email", context: "sign-in page: email field label" },
82
+ "front-door.sign-in.primary": { text: "Continue", context: "sign-in page: main button" },
83
+ "front-door.password.title": { text: "Enter your password", context: "password page: heading" },
84
+ "front-door.password.description": { text: "Signing in as {identifier}.", context: "password page: line under the heading" },
85
+ "front-door.password.label": { text: "Password", context: "password page: password field label" },
86
+ "front-door.password.primary": { text: "Sign in", context: "password page: main button" },
87
+ "front-door.password.secondary": { text: "Use a different email", context: "password page: link back to the email step" },
88
+ "front-door.identifier-not-found.notice": {
89
+ text: "We couldn’t find an account for that email. Check it and try again.",
90
+ context: "sign-in page: notice when no account matches the email",
91
+ },
92
+ "front-door.forgot-password.label": { text: "Forgot password?", context: "sign-in page: link to start a password reset" },
93
+ "front-door.password.notice": { text: "That password isn’t right. Try again.", context: "password page: notice when the password is wrong" },
94
+ "front-door.sign-in.alt": { text: "Sign in to {brand}", context: "sign-in page: alt text for the brand mark" },
95
+ "front-door.code.title": { text: "Verify your sign-in", context: "code page: heading" },
96
+ "front-door.code.description": { text: "Enter your verification code to continue.", context: "code page: line under the heading" },
97
+ "front-door.code.label": { text: "Code", context: "code page: code field label" },
98
+ "front-door.code.primary": { text: "Verify", context: "code page: main button" },
99
+ "front-door.code.secondary": { text: "Send a new code", context: "code page: link to request another code" },
100
+ "front-door.code.notice": { text: "That code isn’t right or has expired. Try again.", context: "code page: notice when the code is wrong or expired" },
101
+ "front-door.unavailable.notice": { text: "Sign-in isn’t available right now. Try again in a few minutes.", context: "sign-in page: notice when sign-in is temporarily unavailable" },
102
+ "front-door.rate-limited.notice": { text: "Too many attempts. Wait a few minutes, then try again.", context: "sign-in page: notice when attempts are rate limited" },
103
+ "front-door.locked.notice": { text: "This account is temporarily locked after too many attempts. Try again later.", context: "sign-in page: notice when the account is temporarily locked" },
104
+ "front-door.expired.notice": { text: "Your session expired. Sign in again to continue.", context: "sign-in page: notice when the session has expired" },
105
+ "front-door.signed-out.notice": { text: "You’re signed out.", context: "sign-in page: notice after signing out" },
106
+ "front-door.error.title": { text: "This page didn’t load", context: "error page: heading" },
107
+ "front-door.error.description": { text: "Something went wrong. Error: {digest}.", context: "error page: line under the heading, with the error digest" },
108
+ "front-door.error.primary": { text: "Try again", context: "error page: main button" },
109
+ "front-door.not-found.title": { text: "Page not found", context: "not-found page: heading" },
110
+ "front-door.not-found.description": { text: "This page doesn’t exist or has moved.", context: "not-found page: line under the heading" },
111
+ "front-door.not-found.primary": { text: "Go to {surface}", context: "not-found page: main button back to the surface" },
112
+ "front-door.not-authorized.title": { text: "You don’t have access", context: "not-authorized page: heading" },
113
+ "front-door.not-authorized.description": { text: "{identifier} doesn’t have access to {surface}.", context: "not-authorized page: line under the heading" },
114
+ "front-door.not-authorized.primary": { text: "Switch account", context: "not-authorized page: main button" },
115
+ "front-door.not-authorized.secondary": { text: "Sign out", context: "not-authorized page: link to sign out" },
116
+ "front-door.access-pending.title": { text: "Access pending", context: "access-pending page: heading" },
117
+ "front-door.access-pending.description": { text: "Your access to {surface} awaits approval. Check back later.", context: "access-pending page: line under the heading" },
118
+ "front-door.access-pending.primary": { text: "Sign out", context: "access-pending page: main button" },
119
+ "front-door.service-unavailable.title": { text: "{surface} isn’t available", context: "service-unavailable page: heading" },
120
+ "front-door.service-unavailable.description": { text: "This is temporary. Try again soon.", context: "service-unavailable page: line under the heading" },
121
+ "front-door.service-unavailable.primary": { text: "Try again", context: "service-unavailable page: main button" },
122
+ "front-door.request-access.description": { text: "Don’t have an account?", context: "sign-in page: line before the request-access link" },
123
+ "front-door.request-access.label": { text: "{requestAccessLabel}", context: "sign-in page: request-access link label" },
124
+ "front-door.reset.title": { text: "Reset your password", context: "reset page: heading" },
125
+ "front-door.reset.description": { text: "Enter your email and we’ll send you a code.", context: "reset page: line under the heading" },
126
+ "front-door.reset.label": { text: "New password", context: "reset page: new password field label" },
127
+ "front-door.reset.primary": { text: "Send code", context: "reset page: main button" },
128
+ "front-door.reset.secondary": { text: "Back to sign in", context: "reset page: link back to sign-in" },
129
+ "front-door.reset.notice": { text: "Password updated. Sign in with your new password.", context: "sign-in page: notice after a password reset" },
130
+ "front-door.activation.title": { text: "Set up your account", context: "activation page: heading" },
131
+ "front-door.activation.description": { text: "You’re invited to {surface}. Choose a password to finish.", context: "activation page: line under the heading" },
132
+ "front-door.activation.primary": { text: "Activate account", context: "activation page: main button" },
133
+ "front-door.activation.notice": { text: "This invitation has expired or was already used. Ask for a new invitation.", context: "activation page: notice when the invitation is no longer valid" },
134
+ "front-door.internal-note.label": { text: "Internal", context: "label marking a note visible only inside the organization" },
135
+ "front-door.identifier-required.notice": { text: "Enter your email.", context: "sign-in page: notice when the email is empty" },
136
+ "front-door.password-required.notice": { text: "Enter your password.", context: "password page: notice when the password is empty" },
137
+ "front-door.code-required.notice": { text: "Enter the code.", context: "code page: notice when the code is empty" },
138
+ "front-door.network.notice": { text: "Couldn’t reach {surface}. Check your connection and try again.", context: "any page: notice when the request could not reach the surface" },
139
+ "front-door.password-weak.notice": {
140
+ text: "That password isn’t strong enough. Use a longer one you haven’t used anywhere else.",
141
+ context: "reset and activation pages: notice when the new password is refused as too weak",
142
+ },
143
+ "front-door.reset-code.primary": { text: "Reset password", context: "reset page, code step: main button" },
144
+ "front-door.activation.label": { text: "Password", context: "activation page: password field label" },
145
+ "front-door.activation-first-name.label": { text: "First name", context: "activation page: first name field label" },
146
+ "front-door.activation-last-name.label": { text: "Last name", context: "activation page: last name field label" },
147
+ "front-door.name-required.notice": { text: "Enter your first and last name.", context: "activation page: notice when a name field is empty" },
148
+ "front-door.sign-in-staff-only.description": { text: "Sign-in is for staff with access to {surface}.", context: "staff-only sign-in page: line under the heading" },
149
+ "front-door.sign-in-invite-only.description": { text: "Sign-in is by invitation to {surface}.", context: "invite-only sign-in page: line under the heading" },
150
+ "front-door.not-authorized-staff-only.title": { text: "Staff access required", context: "staff-only not-authorized page: heading" },
151
+ "front-door.not-authorized-staff-only.description": { text: "This account doesn’t have staff access to {surface}.", context: "staff-only not-authorized page: line under the heading" },
152
+ "front-door.not-authorized-staff-only.primary": { text: "Switch account", context: "staff-only not-authorized page: single primary action" },
153
+ "front-door.not-authorized-invite-only.title": { text: "Invitation required", context: "invite-only not-authorized page: heading" },
154
+ "front-door.not-authorized-invite-only.description": { text: "This account doesn’t have an invitation to {surface}.", context: "invite-only not-authorized page: line under the heading" },
155
+ "front-door.not-authorized-invite-only.primary": { text: "Switch account", context: "invite-only not-authorized page: single primary action" },
156
+ "front-door.identifier-not-found-neutral.notice": { text: "Sign-in couldn’t continue. Check your details and try again.", context: "restricted sign-in page: neutral failure notice without confirming account existence" },
157
+ };
158
+ for (const entry of Object.values(DEFAULTS))
159
+ Object.freeze(entry);
160
+ Object.freeze(DEFAULTS);
161
+ function placeholdersOf(text) {
162
+ return [...new Set([...text.matchAll(/\{([^{}]+)\}/g)].map((match) => match[1]))];
163
+ }
164
+ function entryFor(id) {
165
+ const { text, context } = DEFAULTS[id];
166
+ const placeholders = placeholdersOf(text);
167
+ return {
168
+ id,
169
+ text,
170
+ context,
171
+ status: "approved",
172
+ ...(placeholders.length > 0 ? { placeholders } : {}),
173
+ };
174
+ }
175
+ /** Returns independent mutable defaults for the legacy registry resolver. */
176
+ export function createDefaultCatalog() {
177
+ return {
178
+ id: "front-door", locale: "en", revision: "1",
179
+ source: { kind: "imported", reference: "@clossys/writer/front-door.en.json" },
180
+ entries: CANONICAL_IDS.map(entryFor)
181
+ };
182
+ }
183
+ /** Copies the own, enumerable string-keyed values of `nouns`; anything unreadable reads as no nouns at all. */
184
+ function readNouns(nouns) {
185
+ const read = new Map();
186
+ if (typeof nouns !== "object" || nouns === null || Array.isArray(nouns))
187
+ return read;
188
+ try {
189
+ for (const name of Object.keys(nouns))
190
+ read.set(name, nouns[name]);
191
+ }
192
+ catch {
193
+ return new Map();
194
+ }
195
+ return read;
196
+ }
197
+ /** Names a lookup key for a message; a key that cannot be stringified (a null-prototype object, a throwing `toString`) reads as its type. */
198
+ function describeKey(key) {
199
+ try {
200
+ return String(key);
201
+ }
202
+ catch {
203
+ return `<${typeof key}>`;
204
+ }
205
+ }
206
+ /** Reads and validates nouns without importing registry approval machinery. */
207
+ export function prepareFrontDoorCopy(key, nouns, catalog, ids, nounNames) {
208
+ if (typeof key !== "string" || !ids.includes(key)) {
209
+ return {
210
+ complete: false,
211
+ issues: [{ reason: "unknown-copy-id", id: describeKey(key), message: `Front-door copy id "${describeKey(key)}" is not a reserved id.` }],
212
+ };
213
+ }
214
+ const entry = catalog.entries.find((candidate) => candidate.id === key);
215
+ if (!entry) {
216
+ return {
217
+ complete: false,
218
+ issues: [{ reason: "unknown-copy-id", id: key, message: `Front-door copy "${key}" is not present in the catalog.` }],
219
+ };
220
+ }
221
+ const supplied = readNouns(nouns);
222
+ const issues = [];
223
+ for (const name of supplied.keys()) {
224
+ if (!nounNames.includes(name)) {
225
+ issues.push({ reason: "unknown-noun", noun: name, message: `"${name}" is not a front-door noun.` });
226
+ }
227
+ }
228
+ const values = {};
229
+ for (const name of entry.placeholders ?? []) {
230
+ const value = supplied.get(name);
231
+ if (typeof value !== "string" || value.trim().length === 0) {
232
+ issues.push({ reason: "missing-noun", id: key, noun: name, message: `Front-door copy "${key}" needs the noun "${name}", which is absent or blank.` });
233
+ }
234
+ else {
235
+ values[name] = value;
236
+ }
237
+ }
238
+ if (issues.length > 0)
239
+ return { complete: false, issues };
240
+ return { complete: true, entry, values };
241
+ }
242
+ //# sourceMappingURL=front-door-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-door-core.js","sourceRoot":"","sources":["../src/front-door-core.ts"],"names":[],"mappings":"AAEA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,0BAA0B;IAC1B,gCAAgC;IAChC,0BAA0B;IAC1B,4BAA4B;IAC5B,2BAA2B;IAC3B,iCAAiC;IACjC,2BAA2B;IAC3B,6BAA6B;IAC7B,+BAA+B;IAC/B,wCAAwC;IACxC,kCAAkC;IAClC,4BAA4B;IAC5B,wBAAwB;IACxB,uBAAuB;IACvB,6BAA6B;IAC7B,uBAAuB;IACvB,yBAAyB;IACzB,2BAA2B;IAC3B,wBAAwB;IACxB,+BAA+B;IAC/B,gCAAgC;IAChC,0BAA0B;IAC1B,2BAA2B;IAC3B,8BAA8B;IAC9B,wBAAwB;IACxB,8BAA8B;IAC9B,0BAA0B;IAC1B,4BAA4B;IAC5B,kCAAkC;IAClC,8BAA8B;IAC9B,iCAAiC;IACjC,uCAAuC;IACvC,mCAAmC;IACnC,qCAAqC;IACrC,iCAAiC;IACjC,uCAAuC;IACv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AAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAc,EAAE,MAAM,EAAE,CAAC;IAEnE,OAAO,EAAE,QAAQ,EAAE,IAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACpD,CAAC"}
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * - F1: an id is `front-door.<state>.<slot>`, where the slot is one of
14
14
  * `title`, `description`, `label`, `primary`, `secondary`, `notice` or
15
- * `alt`. This version ships 63 ids; `FRONT_DOOR_COPY_IDS` is
15
+ * `alt`. This version ships 72 ids; `FRONT_DOOR_COPY_IDS` is
16
16
  * the closed list and `FrontDoorKey` its element union.
17
17
  * - F2: a `{token}` in a default text is a noun from `FRONT_DOOR_NOUNS`
18
18
  * and is declared in the entry's `placeholders`. The nouns are a closed
@@ -33,50 +33,14 @@
33
33
  * record: their `approved` status is the package's own statement, not a
34
34
  * consumer's sign-off.
35
35
  */
36
- import type { CopyRegistry, CopyResolution } from "./types.js";
37
- /** All reserved front-door copy ids, in catalog order. */
38
- export declare const FRONT_DOOR_COPY_IDS: readonly ["front-door.sign-in.title", "front-door.sign-in.description", "front-door.sign-in.label", "front-door.sign-in.primary", "front-door.password.title", "front-door.password.description", "front-door.password.label", "front-door.password.primary", "front-door.password.secondary", "front-door.identifier-not-found.notice", "front-door.forgot-password.label", "front-door.password.notice", "front-door.sign-in.alt", "front-door.code.title", "front-door.code.description", "front-door.code.label", "front-door.code.primary", "front-door.code.secondary", "front-door.code.notice", "front-door.unavailable.notice", "front-door.rate-limited.notice", "front-door.locked.notice", "front-door.expired.notice", "front-door.signed-out.notice", "front-door.error.title", "front-door.error.description", "front-door.error.primary", "front-door.not-found.title", "front-door.not-found.description", "front-door.not-found.primary", "front-door.not-authorized.title", "front-door.not-authorized.description", "front-door.not-authorized.primary", "front-door.not-authorized.secondary", "front-door.access-pending.title", "front-door.access-pending.description", "front-door.access-pending.primary", "front-door.service-unavailable.title", "front-door.service-unavailable.description", "front-door.service-unavailable.primary", "front-door.request-access.description", "front-door.request-access.label", "front-door.reset.title", "front-door.reset.description", "front-door.reset.label", "front-door.reset.primary", "front-door.reset.secondary", "front-door.reset.notice", "front-door.activation.title", "front-door.activation.description", "front-door.activation.primary", "front-door.activation.notice", "front-door.internal-note.label", "front-door.identifier-required.notice", "front-door.password-required.notice", "front-door.code-required.notice", "front-door.network.notice", "front-door.password-weak.notice", "front-door.reset-code.primary", "front-door.activation.label", "front-door.activation-first-name.label", "front-door.activation-last-name.label", "front-door.name-required.notice"];
39
- /** A reserved front-door copy id. */
40
- export type FrontDoorKey = (typeof FRONT_DOOR_COPY_IDS)[number];
41
- /** The closed set of nouns a front-door text may name as a `{token}`. */
42
- export declare const FRONT_DOOR_NOUNS: readonly ["brand", "surface", "identifier", "digest", "requestAccessLabel"];
43
- /** One noun a front-door text may name. */
44
- export type FrontDoorNoun = (typeof FRONT_DOOR_NOUNS)[number];
45
- /** The nouns a caller supplies; each is read only when the entry declares it. */
46
- export type FrontDoorNouns = Partial<Record<FrontDoorNoun, string>>;
47
- /** Why a front-door entry could not be resolved. */
48
- export type FrontDoorCopyIssueReason = "unknown-copy-id" | "missing-noun" | "unknown-noun";
49
- /** One reason a front-door entry could not be resolved. */
50
- export interface FrontDoorCopyIssue {
51
- reason: FrontDoorCopyIssueReason;
52
- message: string;
53
- /** The id asked for, on `"unknown-copy-id"`. */
54
- id?: string;
55
- /** The noun at fault, on `"missing-noun"` and `"unknown-noun"`. */
56
- noun?: string;
57
- }
58
- /**
59
- * The outcome of `resolveFrontDoorCopy`. `text` and `resolution` are
60
- * present only when `complete` is `true`; `issues` is empty exactly then.
61
- */
62
- export interface FrontDoorCopyResolution {
63
- complete: boolean;
64
- text?: string;
65
- resolution?: CopyResolution;
66
- issues: FrontDoorCopyIssue[];
67
- }
68
- /** The shipped English defaults for every id in `FRONT_DOOR_COPY_IDS`. */
69
- export declare const FRONT_DOOR_COPY_EN: CopyRegistry;
70
- /** Whether `value` is one of the reserved front-door copy ids. */
36
+ import { CANONICAL_IDS, CANONICAL_NOUNS } from "./front-door-core.js";
37
+ import type { FrontDoorKey, FrontDoorNouns, FrontDoorCopyResolution } from "./front-door-core.js";
38
+ export type { FrontDoorKey, FrontDoorNoun, FrontDoorNouns, FrontDoorCopyIssueReason, FrontDoorCopyIssue, FrontDoorCopyResolution } from "./front-door-core.js";
39
+ /** Independent mutable legacy catalog objects; private browser defaults never share them. */
40
+ export declare const FRONT_DOOR_COPY_IDS: typeof CANONICAL_IDS;
41
+ export declare const FRONT_DOOR_NOUNS: typeof CANONICAL_NOUNS;
42
+ export declare const FRONT_DOOR_COPY_EN: import("./types.js").CopyRegistry;
71
43
  export declare function isFrontDoorCopyId(value: unknown): value is FrontDoorKey;
72
- /**
73
- * Resolves one front-door entry from the shipped English defaults, naming
74
- * the nouns it declares. Only nouns the entry declares reach
75
- * `resolveCopyRef`; a name outside `FRONT_DOOR_NOUNS` is reported as
76
- * `"unknown-noun"` and a declared noun that is absent or blank as
77
- * `"missing-noun"`. An id outside `FRONT_DOOR_COPY_IDS` is
78
- * `"unknown-copy-id"`. Pure and total: the defaults and `nouns` are not
79
- * modified and no input makes this throw.
80
- */
44
+ /** Resolves through the strict registry resolver, preserving approval refusals. */
81
45
  export declare function resolveFrontDoorCopy(key: FrontDoorKey, nouns: FrontDoorNouns): FrontDoorCopyResolution;
82
46
  //# sourceMappingURL=front-door.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"front-door.d.ts","sourceRoot":"","sources":["../src/front-door.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AAElF,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,2iEAgEtB,CAAC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