@clossys/writer 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +592 -2
- package/dist/approval-bypass.d.ts +120 -0
- package/dist/approval-bypass.d.ts.map +1 -0
- package/dist/approval-bypass.js +2318 -0
- package/dist/approval-bypass.js.map +1 -0
- package/dist/approval.d.ts +62 -0
- package/dist/approval.d.ts.map +1 -0
- package/dist/approval.js +421 -0
- package/dist/approval.js.map +1 -0
- package/dist/approve-cli.d.ts +82 -0
- package/dist/approve-cli.d.ts.map +1 -0
- package/dist/approve-cli.js +430 -0
- package/dist/approve-cli.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -13
- package/dist/cli.js.map +1 -1
- package/dist/field-options.d.ts +59 -0
- package/dist/field-options.d.ts.map +1 -0
- package/dist/field-options.js +109 -0
- package/dist/field-options.js.map +1 -0
- package/dist/front-door-browser.d.ts +5 -0
- package/dist/front-door-browser.d.ts.map +1 -0
- package/dist/front-door-browser.js +30 -0
- package/dist/front-door-browser.js.map +1 -0
- package/dist/front-door-core.d.ts +45 -0
- package/dist/front-door-core.d.ts.map +1 -0
- package/dist/front-door-core.js +224 -0
- package/dist/front-door-core.js.map +1 -0
- package/dist/front-door.check.d.ts +2 -0
- package/dist/front-door.check.d.ts.map +1 -0
- package/dist/front-door.check.js +8 -0
- package/dist/front-door.check.js.map +1 -0
- package/dist/front-door.d.ts +46 -0
- package/dist/front-door.d.ts.map +1 -0
- package/dist/front-door.js +61 -0
- package/dist/front-door.js.map +1 -0
- package/dist/generated/advisor-plan-contract.generated.d.ts +3 -0
- package/dist/generated/advisor-plan-contract.generated.d.ts.map +1 -0
- package/dist/generated/advisor-plan-contract.generated.js +430 -0
- package/dist/generated/advisor-plan-contract.generated.js.map +1 -0
- package/dist/generated/contract-schema.generated.d.ts +97 -0
- package/dist/generated/contract-schema.generated.d.ts.map +1 -0
- package/dist/generated/contract-schema.generated.js +496 -0
- package/dist/generated/contract-schema.generated.js.map +1 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/messaging-kit.d.ts +113 -0
- package/dist/messaging-kit.d.ts.map +1 -0
- package/dist/messaging-kit.js +121 -0
- package/dist/messaging-kit.js.map +1 -0
- package/dist/passage.d.ts +2 -1
- package/dist/passage.d.ts.map +1 -1
- package/dist/passage.js +2 -1
- package/dist/passage.js.map +1 -1
- package/dist/plan-authority.d.ts +73 -0
- package/dist/plan-authority.d.ts.map +1 -0
- package/dist/plan-authority.js +126 -0
- package/dist/plan-authority.js.map +1 -0
- package/dist/plan-contract.d.ts +16 -0
- package/dist/plan-contract.d.ts.map +1 -0
- package/dist/plan-contract.js +33 -0
- package/dist/plan-contract.js.map +1 -0
- package/dist/plan-digest.d.ts +23 -0
- package/dist/plan-digest.d.ts.map +1 -0
- package/dist/plan-digest.js +82 -0
- package/dist/plan-digest.js.map +1 -0
- package/dist/plan-rules.d.ts +54 -0
- package/dist/plan-rules.d.ts.map +1 -0
- package/dist/plan-rules.js +145 -0
- package/dist/plan-rules.js.map +1 -0
- package/dist/resolve.d.ts +40 -6
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +144 -18
- package/dist/resolve.js.map +1 -1
- package/dist/scan.d.ts +32 -0
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +67 -6
- package/dist/scan.js.map +1 -1
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +209 -5
- package/dist/schema.js.map +1 -1
- package/dist/site-identity.d.ts +88 -0
- package/dist/site-identity.d.ts.map +1 -0
- package/dist/site-identity.js +82 -0
- package/dist/site-identity.js.map +1 -0
- package/dist/types.d.ts +65 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -7
- package/dist/types.js.map +1 -1
- package/package.json +11 -6
- package/skill/SKILL.md +2 -2
- package/src/approval-bypass.ts +2263 -0
- package/src/approval.ts +491 -0
- package/src/approve-cli.ts +474 -0
- package/src/cli.ts +46 -13
- package/src/field-options.ts +134 -0
- package/src/front-door-browser.ts +31 -0
- package/src/front-door-core.ts +265 -0
- package/src/front-door.check.ts +10 -0
- package/src/front-door.ts +65 -0
- package/src/generated/advisor-plan-contract.generated.ts +430 -0
- package/src/generated/contract-schema.generated.ts +520 -0
- package/src/index.ts +97 -1
- package/src/messaging-kit.ts +195 -0
- package/src/passage.ts +2 -1
- package/src/plan-authority.ts +160 -0
- package/src/plan-contract.ts +45 -0
- package/src/plan-digest.ts +81 -0
- package/src/plan-rules.ts +179 -0
- package/src/resolve.ts +185 -19
- package/src/scan.ts +97 -6
- package/src/schema.ts +223 -5
- package/src/site-identity.ts +125 -0
- package/src/types.ts +72 -7
- package/templates/front-door.en.json +423 -0
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
]);
|
|
67
|
+
/** The closed set of nouns a front-door text may name as a `{token}`. */
|
|
68
|
+
export const CANONICAL_NOUNS = Object.freeze(["brand", "surface", "identifier", "digest", "requestAccessLabel"]);
|
|
69
|
+
const DEFAULTS = {
|
|
70
|
+
"front-door.sign-in.title": { text: "Sign in", context: "sign-in page: heading" },
|
|
71
|
+
"front-door.sign-in.description": { text: "Continue to {surface}.", context: "sign-in page: line under the heading" },
|
|
72
|
+
"front-door.sign-in.label": { text: "Email", context: "sign-in page: email field label" },
|
|
73
|
+
"front-door.sign-in.primary": { text: "Continue", context: "sign-in page: main button" },
|
|
74
|
+
"front-door.password.title": { text: "Enter your password", context: "password page: heading" },
|
|
75
|
+
"front-door.password.description": { text: "Signing in as {identifier}.", context: "password page: line under the heading" },
|
|
76
|
+
"front-door.password.label": { text: "Password", context: "password page: password field label" },
|
|
77
|
+
"front-door.password.primary": { text: "Sign in", context: "password page: main button" },
|
|
78
|
+
"front-door.password.secondary": { text: "Use a different email", context: "password page: link back to the email step" },
|
|
79
|
+
"front-door.identifier-not-found.notice": {
|
|
80
|
+
text: "We couldn’t find an account for that email. Check it and try again.",
|
|
81
|
+
context: "sign-in page: notice when no account matches the email",
|
|
82
|
+
},
|
|
83
|
+
"front-door.forgot-password.label": { text: "Forgot password?", context: "sign-in page: link to start a password reset" },
|
|
84
|
+
"front-door.password.notice": { text: "That password isn’t right. Try again.", context: "password page: notice when the password is wrong" },
|
|
85
|
+
"front-door.sign-in.alt": { text: "Sign in to {brand}", context: "sign-in page: alt text for the brand mark" },
|
|
86
|
+
"front-door.code.title": { text: "Verify your sign-in", context: "code page: heading" },
|
|
87
|
+
"front-door.code.description": { text: "Enter your verification code to continue.", context: "code page: line under the heading" },
|
|
88
|
+
"front-door.code.label": { text: "Code", context: "code page: code field label" },
|
|
89
|
+
"front-door.code.primary": { text: "Verify", context: "code page: main button" },
|
|
90
|
+
"front-door.code.secondary": { text: "Send a new code", context: "code page: link to request another code" },
|
|
91
|
+
"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" },
|
|
92
|
+
"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" },
|
|
93
|
+
"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" },
|
|
94
|
+
"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" },
|
|
95
|
+
"front-door.expired.notice": { text: "Your session expired. Sign in again to continue.", context: "sign-in page: notice when the session has expired" },
|
|
96
|
+
"front-door.signed-out.notice": { text: "You’re signed out.", context: "sign-in page: notice after signing out" },
|
|
97
|
+
"front-door.error.title": { text: "This page didn’t load", context: "error page: heading" },
|
|
98
|
+
"front-door.error.description": { text: "Something went wrong. Error: {digest}.", context: "error page: line under the heading, with the error digest" },
|
|
99
|
+
"front-door.error.primary": { text: "Try again", context: "error page: main button" },
|
|
100
|
+
"front-door.not-found.title": { text: "Page not found", context: "not-found page: heading" },
|
|
101
|
+
"front-door.not-found.description": { text: "This page doesn’t exist or has moved.", context: "not-found page: line under the heading" },
|
|
102
|
+
"front-door.not-found.primary": { text: "Go to {surface}", context: "not-found page: main button back to the surface" },
|
|
103
|
+
"front-door.not-authorized.title": { text: "You don’t have access", context: "not-authorized page: heading" },
|
|
104
|
+
"front-door.not-authorized.description": { text: "{identifier} doesn’t have access to {surface}.", context: "not-authorized page: line under the heading" },
|
|
105
|
+
"front-door.not-authorized.primary": { text: "Switch account", context: "not-authorized page: main button" },
|
|
106
|
+
"front-door.not-authorized.secondary": { text: "Sign out", context: "not-authorized page: link to sign out" },
|
|
107
|
+
"front-door.access-pending.title": { text: "Access pending", context: "access-pending page: heading" },
|
|
108
|
+
"front-door.access-pending.description": { text: "Your access to {surface} awaits approval. Check back later.", context: "access-pending page: line under the heading" },
|
|
109
|
+
"front-door.access-pending.primary": { text: "Sign out", context: "access-pending page: main button" },
|
|
110
|
+
"front-door.service-unavailable.title": { text: "{surface} isn’t available", context: "service-unavailable page: heading" },
|
|
111
|
+
"front-door.service-unavailable.description": { text: "This is temporary. Try again soon.", context: "service-unavailable page: line under the heading" },
|
|
112
|
+
"front-door.service-unavailable.primary": { text: "Try again", context: "service-unavailable page: main button" },
|
|
113
|
+
"front-door.request-access.description": { text: "Don’t have an account?", context: "sign-in page: line before the request-access link" },
|
|
114
|
+
"front-door.request-access.label": { text: "{requestAccessLabel}", context: "sign-in page: request-access link label" },
|
|
115
|
+
"front-door.reset.title": { text: "Reset your password", context: "reset page: heading" },
|
|
116
|
+
"front-door.reset.description": { text: "Enter your email and we’ll send you a code.", context: "reset page: line under the heading" },
|
|
117
|
+
"front-door.reset.label": { text: "New password", context: "reset page: new password field label" },
|
|
118
|
+
"front-door.reset.primary": { text: "Send code", context: "reset page: main button" },
|
|
119
|
+
"front-door.reset.secondary": { text: "Back to sign in", context: "reset page: link back to sign-in" },
|
|
120
|
+
"front-door.reset.notice": { text: "Password updated. Sign in with your new password.", context: "sign-in page: notice after a password reset" },
|
|
121
|
+
"front-door.activation.title": { text: "Set up your account", context: "activation page: heading" },
|
|
122
|
+
"front-door.activation.description": { text: "You’re invited to {surface}. Choose a password to finish.", context: "activation page: line under the heading" },
|
|
123
|
+
"front-door.activation.primary": { text: "Activate account", context: "activation page: main button" },
|
|
124
|
+
"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" },
|
|
125
|
+
"front-door.internal-note.label": { text: "Internal", context: "label marking a note visible only inside the organization" },
|
|
126
|
+
"front-door.identifier-required.notice": { text: "Enter your email.", context: "sign-in page: notice when the email is empty" },
|
|
127
|
+
"front-door.password-required.notice": { text: "Enter your password.", context: "password page: notice when the password is empty" },
|
|
128
|
+
"front-door.code-required.notice": { text: "Enter the code.", context: "code page: notice when the code is empty" },
|
|
129
|
+
"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" },
|
|
130
|
+
"front-door.password-weak.notice": {
|
|
131
|
+
text: "That password isn’t strong enough. Use a longer one you haven’t used anywhere else.",
|
|
132
|
+
context: "reset and activation pages: notice when the new password is refused as too weak",
|
|
133
|
+
},
|
|
134
|
+
"front-door.reset-code.primary": { text: "Reset password", context: "reset page, code step: main button" },
|
|
135
|
+
"front-door.activation.label": { text: "Password", context: "activation page: password field label" },
|
|
136
|
+
"front-door.activation-first-name.label": { text: "First name", context: "activation page: first name field label" },
|
|
137
|
+
"front-door.activation-last-name.label": { text: "Last name", context: "activation page: last name field label" },
|
|
138
|
+
"front-door.name-required.notice": { text: "Enter your first and last name.", context: "activation page: notice when a name field is empty" },
|
|
139
|
+
};
|
|
140
|
+
for (const entry of Object.values(DEFAULTS))
|
|
141
|
+
Object.freeze(entry);
|
|
142
|
+
Object.freeze(DEFAULTS);
|
|
143
|
+
function placeholdersOf(text) {
|
|
144
|
+
return [...new Set([...text.matchAll(/\{([^{}]+)\}/g)].map((match) => match[1]))];
|
|
145
|
+
}
|
|
146
|
+
function entryFor(id) {
|
|
147
|
+
const { text, context } = DEFAULTS[id];
|
|
148
|
+
const placeholders = placeholdersOf(text);
|
|
149
|
+
return {
|
|
150
|
+
id,
|
|
151
|
+
text,
|
|
152
|
+
context,
|
|
153
|
+
status: "approved",
|
|
154
|
+
...(placeholders.length > 0 ? { placeholders } : {}),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** Returns independent mutable defaults for the legacy registry resolver. */
|
|
158
|
+
export function createDefaultCatalog() {
|
|
159
|
+
return {
|
|
160
|
+
id: "front-door", locale: "en", revision: "1",
|
|
161
|
+
source: { kind: "imported", reference: "@clossys/writer/front-door.en.json" },
|
|
162
|
+
entries: CANONICAL_IDS.map(entryFor)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/** Copies the own, enumerable string-keyed values of `nouns`; anything unreadable reads as no nouns at all. */
|
|
166
|
+
function readNouns(nouns) {
|
|
167
|
+
const read = new Map();
|
|
168
|
+
if (typeof nouns !== "object" || nouns === null || Array.isArray(nouns))
|
|
169
|
+
return read;
|
|
170
|
+
try {
|
|
171
|
+
for (const name of Object.keys(nouns))
|
|
172
|
+
read.set(name, nouns[name]);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return new Map();
|
|
176
|
+
}
|
|
177
|
+
return read;
|
|
178
|
+
}
|
|
179
|
+
/** Names a lookup key for a message; a key that cannot be stringified (a null-prototype object, a throwing `toString`) reads as its type. */
|
|
180
|
+
function describeKey(key) {
|
|
181
|
+
try {
|
|
182
|
+
return String(key);
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return `<${typeof key}>`;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Reads and validates nouns without importing registry approval machinery. */
|
|
189
|
+
export function prepareFrontDoorCopy(key, nouns, catalog, ids, nounNames) {
|
|
190
|
+
if (typeof key !== "string" || !ids.includes(key)) {
|
|
191
|
+
return {
|
|
192
|
+
complete: false,
|
|
193
|
+
issues: [{ reason: "unknown-copy-id", id: describeKey(key), message: `Front-door copy id "${describeKey(key)}" is not a reserved id.` }],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const entry = catalog.entries.find((candidate) => candidate.id === key);
|
|
197
|
+
if (!entry) {
|
|
198
|
+
return {
|
|
199
|
+
complete: false,
|
|
200
|
+
issues: [{ reason: "unknown-copy-id", id: key, message: `Front-door copy "${key}" is not present in the catalog.` }],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const supplied = readNouns(nouns);
|
|
204
|
+
const issues = [];
|
|
205
|
+
for (const name of supplied.keys()) {
|
|
206
|
+
if (!nounNames.includes(name)) {
|
|
207
|
+
issues.push({ reason: "unknown-noun", noun: name, message: `"${name}" is not a front-door noun.` });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const values = {};
|
|
211
|
+
for (const name of entry.placeholders ?? []) {
|
|
212
|
+
const value = supplied.get(name);
|
|
213
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
214
|
+
issues.push({ reason: "missing-noun", id: key, noun: name, message: `Front-door copy "${key}" needs the noun "${name}", which is absent or blank.` });
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
values[name] = value;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (issues.length > 0)
|
|
221
|
+
return { complete: false, issues };
|
|
222
|
+
return { complete: true, entry, values };
|
|
223
|
+
}
|
|
224
|
+
//# 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;IACvC,mCAAmC;IACnC,sCAAsC;IACtC,4CAA4C;IAC5C,wCAAwC;IACxC,uCAAuC;IACvC,iCAAiC;IACjC,wBAAwB;IACxB,8BAA8B;IAC9B,wBAAwB;IACxB,0BAA0B;IAC1B,4BAA4B;IAC5B,yBAAyB;IACzB,6BAA6B;IAC7B,mCAAmC;IACnC,+B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,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,GAAG,qBAAqB,IAAI,8BAA8B,EAAE,CAAC,CAAC;QACxJ,CAAC;aAAM,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-door.check.d.ts","sourceRoot":"","sources":["../src/front-door.check.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Compile-time assertions for the front-door copy kind. This file has no
|
|
2
|
+
// runtime footprint and is not exported from `index.ts`; `tsc` compiling it is
|
|
3
|
+
// the check.
|
|
4
|
+
import { resolveFrontDoorCopy } from "./front-door.js";
|
|
5
|
+
// @ts-expect-error unknown front-door key
|
|
6
|
+
resolveFrontDoorCopy("front-door.sign-in.heading", {});
|
|
7
|
+
resolveFrontDoorCopy("front-door.sign-in.title", {});
|
|
8
|
+
//# sourceMappingURL=front-door.check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-door.check.js","sourceRoot":"","sources":["../src/front-door.check.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+EAA+E;AAC/E,aAAa;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,0CAA0C;AAC1C,oBAAoB,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;AAEvD,oBAAoB,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The front-door copy kind: the words on a sign-in page and the pages around
|
|
3
|
+
* it, as one shipped catalog of reserved ids with English defaults and a
|
|
4
|
+
* noun resolver.
|
|
5
|
+
*
|
|
6
|
+
* Sign-in and boundary pages each used to carry their own copy. This module
|
|
7
|
+
* is a reserved copy kind like the messaging kit, not a second text store or
|
|
8
|
+
* a second approval path: `resolveFrontDoorCopy` asks `resolveCopyRef`, so
|
|
9
|
+
* everything that resolver refuses is refused here for the same reason.
|
|
10
|
+
*
|
|
11
|
+
* Invariants:
|
|
12
|
+
*
|
|
13
|
+
* - F1: an id is `front-door.<state>.<slot>`, where the slot is one of
|
|
14
|
+
* `title`, `description`, `label`, `primary`, `secondary`, `notice` or
|
|
15
|
+
* `alt`. This version ships 63 ids; `FRONT_DOOR_COPY_IDS` is
|
|
16
|
+
* the closed list and `FrontDoorKey` its element union.
|
|
17
|
+
* - F2: a `{token}` in a default text is a noun from `FRONT_DOOR_NOUNS`
|
|
18
|
+
* and is declared in the entry's `placeholders`. The nouns are a closed
|
|
19
|
+
* set: a caller cannot invent one.
|
|
20
|
+
* - F3: `resolveFrontDoorCopy` hands `resolveCopyRef` only the nouns the
|
|
21
|
+
* entry declares. A known noun the entry does not use is dropped, not
|
|
22
|
+
* an error; a name outside the closed set is `"unknown-noun"`.
|
|
23
|
+
* - F4: a declared noun that is absent or blank (after trimming) is
|
|
24
|
+
* `"missing-noun"`. A blank noun never renders as an empty gap.
|
|
25
|
+
* - F5: every issue is reported, in order: unknown nouns, then missing
|
|
26
|
+
* nouns. `text` and `resolution` exist only when `issues` is empty.
|
|
27
|
+
* Nothing here throws for any input.
|
|
28
|
+
* - F6: a site overrides one entry by registering the same id in its own
|
|
29
|
+
* registry and resolving it with `resolveCopyRef`; these defaults are
|
|
30
|
+
* the fallback, not a lock.
|
|
31
|
+
*
|
|
32
|
+
* The defaults are US English, shipped on purpose, and carry no approval
|
|
33
|
+
* record: their `approved` status is the package's own statement, not a
|
|
34
|
+
* consumer's sign-off.
|
|
35
|
+
*/
|
|
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;
|
|
43
|
+
export declare function isFrontDoorCopyId(value: unknown): value is FrontDoorKey;
|
|
44
|
+
/** Resolves through the strict registry resolver, preserving approval refusals. */
|
|
45
|
+
export declare function resolveFrontDoorCopy(key: FrontDoorKey, nouns: FrontDoorNouns): FrontDoorCopyResolution;
|
|
46
|
+
//# sourceMappingURL=front-door.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-door.d.ts","sourceRoot":"","sources":["../src/front-door.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,aAAa,EAAE,eAAe,EAA8C,MAAM,sBAAsB,CAAC;AAClH,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;AAE/J,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,EAAoC,OAAO,aAAa,CAAC;AACzF,eAAO,MAAM,gBAAgB,EAAsC,OAAO,eAAe,CAAC;AAC1F,eAAO,MAAM,kBAAkB,mCAAyB,CAAC;AAEzD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEvE;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,uBAAuB,CAatG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The front-door copy kind: the words on a sign-in page and the pages around
|
|
3
|
+
* it, as one shipped catalog of reserved ids with English defaults and a
|
|
4
|
+
* noun resolver.
|
|
5
|
+
*
|
|
6
|
+
* Sign-in and boundary pages each used to carry their own copy. This module
|
|
7
|
+
* is a reserved copy kind like the messaging kit, not a second text store or
|
|
8
|
+
* a second approval path: `resolveFrontDoorCopy` asks `resolveCopyRef`, so
|
|
9
|
+
* everything that resolver refuses is refused here for the same reason.
|
|
10
|
+
*
|
|
11
|
+
* Invariants:
|
|
12
|
+
*
|
|
13
|
+
* - F1: an id is `front-door.<state>.<slot>`, where the slot is one of
|
|
14
|
+
* `title`, `description`, `label`, `primary`, `secondary`, `notice` or
|
|
15
|
+
* `alt`. This version ships 63 ids; `FRONT_DOOR_COPY_IDS` is
|
|
16
|
+
* the closed list and `FrontDoorKey` its element union.
|
|
17
|
+
* - F2: a `{token}` in a default text is a noun from `FRONT_DOOR_NOUNS`
|
|
18
|
+
* and is declared in the entry's `placeholders`. The nouns are a closed
|
|
19
|
+
* set: a caller cannot invent one.
|
|
20
|
+
* - F3: `resolveFrontDoorCopy` hands `resolveCopyRef` only the nouns the
|
|
21
|
+
* entry declares. A known noun the entry does not use is dropped, not
|
|
22
|
+
* an error; a name outside the closed set is `"unknown-noun"`.
|
|
23
|
+
* - F4: a declared noun that is absent or blank (after trimming) is
|
|
24
|
+
* `"missing-noun"`. A blank noun never renders as an empty gap.
|
|
25
|
+
* - F5: every issue is reported, in order: unknown nouns, then missing
|
|
26
|
+
* nouns. `text` and `resolution` exist only when `issues` is empty.
|
|
27
|
+
* Nothing here throws for any input.
|
|
28
|
+
* - F6: a site overrides one entry by registering the same id in its own
|
|
29
|
+
* registry and resolving it with `resolveCopyRef`; these defaults are
|
|
30
|
+
* the fallback, not a lock.
|
|
31
|
+
*
|
|
32
|
+
* The defaults are US English, shipped on purpose, and carry no approval
|
|
33
|
+
* record: their `approved` status is the package's own statement, not a
|
|
34
|
+
* consumer's sign-off.
|
|
35
|
+
*/
|
|
36
|
+
import { resolveCopyRef } from "./resolve.js";
|
|
37
|
+
import { CANONICAL_IDS, CANONICAL_NOUNS, createDefaultCatalog, prepareFrontDoorCopy } from "./front-door-core.js";
|
|
38
|
+
/** Independent mutable legacy catalog objects; private browser defaults never share them. */
|
|
39
|
+
export const FRONT_DOOR_COPY_IDS = [...CANONICAL_IDS];
|
|
40
|
+
export const FRONT_DOOR_NOUNS = [...CANONICAL_NOUNS];
|
|
41
|
+
export const FRONT_DOOR_COPY_EN = createDefaultCatalog();
|
|
42
|
+
export function isFrontDoorCopyId(value) {
|
|
43
|
+
return typeof value === "string" && FRONT_DOOR_COPY_IDS.includes(value);
|
|
44
|
+
}
|
|
45
|
+
/** Resolves through the strict registry resolver, preserving approval refusals. */
|
|
46
|
+
export function resolveFrontDoorCopy(key, nouns) {
|
|
47
|
+
const prepared = prepareFrontDoorCopy(key, nouns, FRONT_DOOR_COPY_EN, FRONT_DOOR_COPY_IDS, FRONT_DOOR_NOUNS);
|
|
48
|
+
if (!prepared.complete)
|
|
49
|
+
return prepared;
|
|
50
|
+
const { values } = prepared;
|
|
51
|
+
const result = resolveCopyRef(FRONT_DOOR_COPY_EN, { id: key, values });
|
|
52
|
+
if (!result.complete || !result.resolution) {
|
|
53
|
+
// Unreachable for the shipped catalog (every id resolves, which the tests pin); kept so nothing here can throw or pass silently.
|
|
54
|
+
return {
|
|
55
|
+
complete: false,
|
|
56
|
+
issues: [{ reason: "unknown-copy-id", id: key, message: result.issues[0]?.message ?? `Front-door copy "${key}" could not be resolved.` }],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return { complete: true, text: result.resolution.text, resolution: result.resolution, issues: [] };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=front-door.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-door.js","sourceRoot":"","sources":["../src/front-door.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIlH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,aAAa,CAAoC,CAAC;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAG,eAAe,CAAsC,CAAC;AAC1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,EAAE,CAAC;AAEzD,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,mBAAyC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACjG,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,oBAAoB,CAAC,GAAiB,EAAE,KAAqB;IAC3E,MAAM,QAAQ,GAAG,oBAAoB,CAAC,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;IAC7G,IAAI,CAAC,QAAQ,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAC5B,MAAM,MAAM,GAAG,cAAc,CAAC,kBAAkB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACvE,IAAI,CAAC,MAAM,C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