@softistx/alxia-react-router 0.89.2 → 0.89.3

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.
@@ -5,7 +5,7 @@ import {
5
5
  CAPTURE_WIDTHS2,
6
6
  CAPTURE_THEMES2,
7
7
  captureFile2
8
- } from "./index-skwypsjz.js";
8
+ } from "./index-dg35wgk5.js";
9
9
 
10
10
  // src/help/check/check.ts
11
11
  import { existsSync, readdirSync, readFileSync } from "node:fs";
@@ -131,4 +131,4 @@ async function checkHelp2(options = {}) {
131
131
  export { routeId2, flattenRoutes2, matchesIgnore2, readRouteConfig2, checkHelp2 };
132
132
 
133
133
  //# debugId=525272F993E242D864756E2164756E21
134
- //# sourceMappingURL=index-tx36swjx.js.map
134
+ //# sourceMappingURL=index-5jf809bq.js.map
@@ -1,4 +1,4 @@
1
- // src/help/yaml.ts
1
+ // src/help/yaml-error.ts
2
2
  class YamlError extends Error {
3
3
  line;
4
4
  constructor(line, message) {
@@ -7,16 +7,102 @@ class YamlError extends Error {
7
7
  this.name = "YamlError";
8
8
  }
9
9
  }
10
+
11
+ // src/help/yaml-quotes.ts
12
+ function quoteStep(text, i, quote) {
13
+ const char = text[i];
14
+ if (quote === '"') {
15
+ if (char === "\\")
16
+ return { quote, width: 2 };
17
+ return { quote: char === '"' ? "" : quote, width: 1 };
18
+ }
19
+ if (quote === "'") {
20
+ if (char === "'" && text[i + 1] === "'")
21
+ return { quote, width: 2 };
22
+ return { quote: char === "'" ? "" : quote, width: 1 };
23
+ }
24
+ if ((char === '"' || char === "'") && (i === 0 || /[\s[{,:]/.test(text[i - 1]))) {
25
+ return { quote: char, width: 1 };
26
+ }
27
+ return { quote: "", width: 1 };
28
+ }
29
+ var ESCAPES = {
30
+ n: `
31
+ `,
32
+ t: "\t",
33
+ r: "\r",
34
+ "0": "\x00",
35
+ "/": "/",
36
+ "\\": "\\",
37
+ '"': '"',
38
+ a: "\x07",
39
+ b: "\b",
40
+ e: "\x1B",
41
+ f: "\f",
42
+ v: "\v",
43
+ N: "…",
44
+ _: " ",
45
+ L: "\u2028",
46
+ P: "\u2029",
47
+ " ": " ",
48
+ "\t": "\t"
49
+ };
50
+ var LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
51
+ var HEX = { x: 2, u: 4, U: 8 };
52
+ function unquote(value, line) {
53
+ const quote = value[0];
54
+ if (value.length < 2 || !value.endsWith(quote)) {
55
+ throw new YamlError(line, `unterminated quoted string: ${value}`);
56
+ }
57
+ const inner = value.slice(1, -1);
58
+ if (quote === "'") {
59
+ if (/(?:^|[^'])(?:'')*'(?!')/.test(inner)) {
60
+ throw new YamlError(line, `bare ' inside a single-quoted string (double it as '' or use typographic quotes): ${value}`);
61
+ }
62
+ return inner.replace(/''/g, "'");
63
+ }
64
+ let out = "";
65
+ for (let i = 0;i < inner.length; i++) {
66
+ const char = inner[i];
67
+ if (char === '"') {
68
+ throw new YamlError(line, `bare " inside a double-quoted string (escape it as \\" or use typographic quotes): ${value}`);
69
+ }
70
+ if (char !== "\\") {
71
+ out += char;
72
+ continue;
73
+ }
74
+ const next = inner[++i];
75
+ if (next === undefined) {
76
+ throw new YamlError(line, `unterminated escape at the end of a double-quoted string: ${value}`);
77
+ }
78
+ const digits = HEX[next];
79
+ const hex = digits === undefined ? null : new RegExp(`^[0-9a-fA-F]{${digits}}`).exec(inner.slice(i + 1));
80
+ if (hex) {
81
+ const code = Number.parseInt(hex[0], 16);
82
+ if (code > 1114111) {
83
+ throw new YamlError(line, `escape "\\${next}${hex[0]}" is above U+10FFFF in a double-quoted string: ${value}`);
84
+ }
85
+ out += String.fromCodePoint(code);
86
+ i += hex[0].length;
87
+ } else if (next in ESCAPES) {
88
+ out += ESCAPES[next];
89
+ } else {
90
+ throw new YamlError(line, `unknown escape "\\${next}" in a double-quoted string: ${value}`);
91
+ }
92
+ }
93
+ const lone = LONE_SURROGATE.exec(out);
94
+ if (lone) {
95
+ const hex = lone[0].codePointAt(0).toString(16).toUpperCase();
96
+ throw new YamlError(line, `escape "\\u${hex}" is a lone surrogate in a double-quoted string; write the character itself or a \\U escape: ${value}`);
97
+ }
98
+ return out;
99
+ }
100
+
101
+ // src/help/yaml.ts
10
102
  function scalar(text, line) {
11
103
  const value = text.trim();
12
104
  if (value.startsWith('"') || value.startsWith("'")) {
13
- const quote = value[0];
14
- if (value.length < 2 || !value.endsWith(quote)) {
15
- throw new YamlError(line, `unterminated quoted string: ${value}`);
16
- }
17
- const inner = value.slice(1, -1);
18
- return quote === '"' ? inner.replace(/\\(["\\nt])/g, (_, c) => c === "n" ? `
19
- ` : c === "t" ? "\t" : c) : inner.replace(/''/g, "'");
105
+ return unquote(value, line);
20
106
  }
21
107
  if (value === "true")
22
108
  return true;
@@ -31,13 +117,16 @@ function splitFlow(text) {
31
117
  let current = "";
32
118
  let quote = "";
33
119
  let depth = 0;
34
- for (const char of text) {
35
- if (quote) {
36
- if (char === quote)
37
- quote = "";
38
- } else if (char === '"' || char === "'")
39
- quote = char;
40
- else if (char === "[" || char === "{")
120
+ for (let i = 0;i < text.length; i++) {
121
+ const char = text[i];
122
+ const step = quoteStep(text, i, quote);
123
+ if (step.width > 1 || quote || step.quote) {
124
+ current += text.slice(i, i + step.width);
125
+ quote = step.quote;
126
+ i += step.width - 1;
127
+ continue;
128
+ }
129
+ if (char === "[" || char === "{")
41
130
  depth++;
42
131
  else if (char === "]" || char === "}")
43
132
  depth--;
@@ -80,13 +169,11 @@ function keyValue(text, line) {
80
169
  function stripComment(text) {
81
170
  let quote = "";
82
171
  for (let i = 0;i < text.length; i++) {
83
- const char = text[i];
84
- if (quote) {
85
- if (char === quote)
86
- quote = "";
87
- } else if (char === '"' || char === "'")
88
- quote = char;
89
- else if (char === "#" && (i === 0 || /\s/.test(text[i - 1]))) {
172
+ const step = quoteStep(text, i, quote);
173
+ if (step.width > 1 || quote || step.quote) {
174
+ quote = step.quote;
175
+ i += step.width - 1;
176
+ } else if (text[i] === "#" && (i === 0 || /\s/.test(text[i - 1]))) {
90
177
  return text.slice(0, i);
91
178
  }
92
179
  }
@@ -353,5 +440,5 @@ function captureFile2(name, width, theme) {
353
440
 
354
441
  export { FlowFormatError2, langOfFile, parseFlow2, CAPTURE_WIDTHS2, CAPTURE_THEMES2, captureFile2 };
355
442
 
356
- //# debugId=484163F375EBB66D64756E2164756E21
357
- //# sourceMappingURL=index-skwypsjz.js.map
443
+ //# debugId=3DC0FFCDE06F3C8D64756E2164756E21
444
+ //# sourceMappingURL=index-dg35wgk5.js.map
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/help/yaml-error.ts", "../src/help/yaml-quotes.ts", "../src/help/yaml.ts", "../src/help/parse-flow.ts", "../src/help/types.ts"],
4
+ "sourcesContent": [
5
+ "/** A syntax error, with its 1-based line in the front-matter. */\nexport class YamlError extends Error {\n\tconstructor(\n\t\treadonly line: number,\n\t\tmessage: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'YamlError';\n\t}\n}\n",
6
+ "import { YamlError } from './yaml-error';\n\n/**\n * Where a quote opens or closes at `text[i]`, given the quote `quote` that is\n * open ('' for none). `width` is how many characters the step consumes: 2 for\n * an escaped `\\\"`-style pair in double quotes or a doubled `''` in single\n * quotes, so a caller skips them. A quote opens only at the start of a token\n * (after a space, `[`, `{`, `,` or `:`), so `Can't` stays a plain scalar.\n */\nexport function quoteStep(\n\ttext: string,\n\ti: number,\n\tquote: string,\n): { quote: string; width: number } {\n\tconst char = text[i] as string;\n\tif (quote === '\"') {\n\t\tif (char === '\\\\') return { quote, width: 2 };\n\t\treturn { quote: char === '\"' ? '' : quote, width: 1 };\n\t}\n\tif (quote === \"'\") {\n\t\tif (char === \"'\" && text[i + 1] === \"'\") return { quote, width: 2 };\n\t\treturn { quote: char === \"'\" ? '' : quote, width: 1 };\n\t}\n\tif (\n\t\t(char === '\"' || char === \"'\") &&\n\t\t(i === 0 || /[\\s[{,:]/.test(text[i - 1] as string))\n\t) {\n\t\treturn { quote: char, width: 1 };\n\t}\n\treturn { quote: '', width: 1 };\n}\n\nconst ESCAPES: Record<string, string> = {\n\tn: '\\n',\n\tt: '\\t',\n\tr: '\\r',\n\t'0': '\\0',\n\t'/': '/',\n\t'\\\\': '\\\\',\n\t'\"': '\"',\n\ta: '\\x07',\n\tb: '\\b',\n\te: '\\x1b',\n\tf: '\\f',\n\tv: '\\v',\n\tN: '\\u0085',\n\t_: '\\u00a0',\n\tL: '\\u2028',\n\tP: '\\u2029',\n\t' ': ' ',\n\t'\\t': '\\t',\n};\n\n/** A surrogate half with no partner: Bun.YAML.parse refuses it. */\nconst LONE_SURROGATE =\n\t/[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]/;\n\n/** The hex escapes and their digit counts. */\nconst HEX: Record<string, number> = { x: 2, u: 4, U: 8 };\n\n/** The value of a quoted scalar; a bare quote or unknown escape is an error. */\nexport function unquote(value: string, line: number): string {\n\tconst quote = value[0] as string;\n\tif (value.length < 2 || !value.endsWith(quote)) {\n\t\tthrow new YamlError(line, `unterminated quoted string: ${value}`);\n\t}\n\tconst inner = value.slice(1, -1);\n\tif (quote === \"'\") {\n\t\tif (/(?:^|[^'])(?:'')*'(?!')/.test(inner)) {\n\t\t\tthrow new YamlError(\n\t\t\t\tline,\n\t\t\t\t`bare ' inside a single-quoted string (double it as '' or use typographic quotes): ${value}`,\n\t\t\t);\n\t\t}\n\t\treturn inner.replace(/''/g, \"'\");\n\t}\n\tlet out = '';\n\tfor (let i = 0; i < inner.length; i++) {\n\t\tconst char = inner[i] as string;\n\t\tif (char === '\"') {\n\t\t\tthrow new YamlError(\n\t\t\t\tline,\n\t\t\t\t`bare \" inside a double-quoted string (escape it as \\\\\" or use typographic quotes): ${value}`,\n\t\t\t);\n\t\t}\n\t\tif (char !== '\\\\') {\n\t\t\tout += char;\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = inner[++i] as string;\n\t\tif (next === undefined) {\n\t\t\tthrow new YamlError(\n\t\t\t\tline,\n\t\t\t\t`unterminated escape at the end of a double-quoted string: ${value}`,\n\t\t\t);\n\t\t}\n\t\tconst digits = HEX[next];\n\t\tconst hex =\n\t\t\tdigits === undefined\n\t\t\t\t? null\n\t\t\t\t: new RegExp(`^[0-9a-fA-F]{${digits}}`).exec(inner.slice(i + 1));\n\t\tif (hex) {\n\t\t\tconst code = Number.parseInt(hex[0], 16);\n\t\t\tif (code > 0x10ffff) {\n\t\t\t\tthrow new YamlError(\n\t\t\t\t\tline,\n\t\t\t\t\t`escape \"\\\\${next}${hex[0]}\" is above U+10FFFF in a double-quoted string: ${value}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tout += String.fromCodePoint(code);\n\t\t\ti += hex[0].length;\n\t\t} else if (next in ESCAPES) {\n\t\t\tout += ESCAPES[next];\n\t\t} else {\n\t\t\tthrow new YamlError(\n\t\t\t\tline,\n\t\t\t\t`unknown escape \"\\\\${next}\" in a double-quoted string: ${value}`,\n\t\t\t);\n\t\t}\n\t}\n\tconst lone = LONE_SURROGATE.exec(out);\n\tif (lone) {\n\t\tconst hex = (lone[0].codePointAt(0) as number).toString(16).toUpperCase();\n\t\tthrow new YamlError(\n\t\t\tline,\n\t\t\t`escape \"\\\\u${hex}\" is a lone surrogate in a double-quoted string; write the character itself or a \\\\U escape: ${value}`,\n\t\t);\n\t}\n\treturn out;\n}\n",
7
+ "import { YamlError } from './yaml-error';\nimport { quoteStep, unquote } from './yaml-quotes';\n\nexport { YamlError };\n\n/**\n * The small YAML a flow's front-matter uses: `key: value` lines, inline\n * lists (`[a, b]`), block lists (`- a`) and block lists of maps\n * (`- key: value`, then the map's other keys indented). Scalars are strings,\n * `true`/`false` or numbers; `\"…\"` and `'…'` quote one. No anchors, no\n * multi-line scalars: a flow's front-matter has no need of them. Quoting is\n * strict, as in any YAML parser: a quote inside a quoted scalar is escaped.\n */\nexport type YamlValue =\n\t| string\n\t| number\n\t| boolean\n\t| readonly YamlValue[]\n\t| { readonly [key: string]: YamlValue };\n\nfunction scalar(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('\"') || value.startsWith(\"'\")) {\n\t\treturn unquote(value, line);\n\t}\n\tif (value === 'true') return true;\n\tif (value === 'false') return false;\n\tif (/^-?\\d+(\\.\\d+)?$/.test(value)) return Number(value);\n\treturn value;\n}\n\n/** Splits on commas outside quotes. */\nfunction splitFlow(text: string): string[] {\n\tconst parts: string[] = [];\n\tlet current = '';\n\tlet quote = '';\n\tlet depth = 0;\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst char = text[i] as string;\n\t\tconst step = quoteStep(text, i, quote);\n\t\tif (step.width > 1 || quote || step.quote) {\n\t\t\tcurrent += text.slice(i, i + step.width);\n\t\t\tquote = step.quote;\n\t\t\ti += step.width - 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === '[' || char === '{') depth++;\n\t\telse if (char === ']' || char === '}') depth--;\n\t\telse if (char === ',' && depth === 0) {\n\t\t\tparts.push(current);\n\t\t\tcurrent = '';\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t}\n\tif (current.trim() !== '') parts.push(current);\n\treturn parts;\n}\n\nfunction inline(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('[')) {\n\t\tif (!value.endsWith(']'))\n\t\t\tthrow new YamlError(line, `unclosed list: ${value}`);\n\t\treturn splitFlow(value.slice(1, -1)).map((item) => inline(item, line));\n\t}\n\tif (value.startsWith('{')) {\n\t\tif (!value.endsWith('}'))\n\t\t\tthrow new YamlError(line, `unclosed map: ${value}`);\n\t\tconst map: Record<string, YamlValue> = {};\n\t\tfor (const pair of splitFlow(value.slice(1, -1))) {\n\t\t\tconst [key, rest] = keyValue(pair, line);\n\t\t\tmap[key] = inline(rest, line);\n\t\t}\n\t\treturn map;\n\t}\n\treturn scalar(value, line);\n}\n\nfunction keyValue(text: string, line: number): [string, string] {\n\tconst match = /^\\s*([A-Za-z_][\\w-]*)\\s*:(?:\\s+(.*))?$/.exec(text);\n\tif (!match)\n\t\tthrow new YamlError(line, `expected \"key: value\", got: ${text.trim()}`);\n\treturn [match[1] as string, match[2] ?? ''];\n}\n\n/** Drops a trailing ` # comment` that is not inside quotes. */\nfunction stripComment(text: string): string {\n\tlet quote = '';\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst step = quoteStep(text, i, quote);\n\t\tif (step.width > 1 || quote || step.quote) {\n\t\t\tquote = step.quote;\n\t\t\ti += step.width - 1;\n\t\t} else if (\n\t\t\ttext[i] === '#' &&\n\t\t\t(i === 0 || /\\s/.test(text[i - 1] as string))\n\t\t) {\n\t\t\treturn text.slice(0, i);\n\t\t}\n\t}\n\treturn text;\n}\n\ninterface Row {\n\treadonly indent: number;\n\treadonly text: string;\n\treadonly line: number;\n}\n\n/** The non-blank rows of the source, comments stripped. */\nfunction readRows(source: string, firstLine: number): Row[] {\n\tconst rows: Row[] = [];\n\tsource.split('\\n').forEach((raw, index) => {\n\t\tconst text = stripComment(raw.replace(/\\r$/, '')).trimEnd();\n\t\tif (text.trim() === '') return;\n\t\tif (/^ *\\t/.test(text)) {\n\t\t\tthrow new YamlError(firstLine + index, 'indent with spaces, not tabs');\n\t\t}\n\t\trows.push({\n\t\t\tindent: text.length - text.trimStart().length,\n\t\t\ttext: text.trim(),\n\t\t\tline: firstLine + index,\n\t\t});\n\t});\n\treturn rows;\n}\n\n/** A cursor over the rows: `block`, `map` and `list` read what is at it. */\nclass Reader {\n\tat = 0;\n\tconstructor(readonly rows: Row[]) {}\n\n\tget row(): Row | undefined {\n\t\treturn this.rows[this.at];\n\t}\n\n\tblock(indent: number): YamlValue {\n\t\tconst row = this.row as Row;\n\t\treturn row.text.startsWith('- ') || row.text === '-'\n\t\t\t? this.list(indent)\n\t\t\t: this.map(indent);\n\t}\n\n\tmap(indent: number): Record<string, YamlValue> {\n\t\tconst result: Record<string, YamlValue> = {};\n\t\tfor (let row = this.row; row?.indent === indent; row = this.row) {\n\t\t\tif (row.text.startsWith('-')) break;\n\t\t\tconst [key, rest] = keyValue(row.text, row.line);\n\t\t\tif (key in result)\n\t\t\t\tthrow new YamlError(row.line, `duplicate key \"${key}\"`);\n\t\t\tthis.at++;\n\t\t\tconst next = this.row;\n\t\t\tif (rest !== '') {\n\t\t\t\tresult[key] = inline(rest, row.line);\n\t\t\t} else if (next && next.indent > indent) {\n\t\t\t\tresult[key] = this.block(next.indent);\n\t\t\t} else if (next?.indent === indent && next.text.startsWith('- ')) {\n\t\t\t\tresult[key] = this.list(indent);\n\t\t\t} else {\n\t\t\t\tresult[key] = '';\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tlist(indent: number): YamlValue[] {\n\t\tconst result: YamlValue[] = [];\n\t\tfor (let row = this.row; row; row = this.row) {\n\t\t\tif (\n\t\t\t\trow.indent !== indent ||\n\t\t\t\t!(row.text.startsWith('- ') || row.text === '-')\n\t\t\t)\n\t\t\t\tbreak;\n\t\t\tconst rest = row.text.slice(1).trim();\n\t\t\tif (rest === '') {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(this.block((this.row as Row).indent));\n\t\t\t} else if (\n\t\t\t\t/^[A-Za-z_][\\w-]*\\s*:(\\s|$)/.test(rest) &&\n\t\t\t\t!rest.startsWith('{')\n\t\t\t) {\n\t\t\t\t// `- key: value`: a map whose first key sits on the dash's line.\n\t\t\t\tconst inner = indent + 2;\n\t\t\t\tthis.rows[this.at] = { indent: inner, text: rest, line: row.line };\n\t\t\t\tresult.push(this.map(inner));\n\t\t\t} else {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(inline(rest, row.line));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/** Parses a front-matter block to a map; `firstLine` offsets error lines. */\nexport function parseYaml(\n\tsource: string,\n\tfirstLine = 1,\n): Record<string, YamlValue> {\n\tconst rows = readRows(source, firstLine);\n\tif (rows.length === 0) return {};\n\tconst first = rows[0] as Row;\n\tif (first.indent !== 0)\n\t\tthrow new YamlError(first.line, 'the first line must not be indented');\n\tconst reader = new Reader(rows);\n\tconst result = reader.block(0);\n\tconst left = reader.row;\n\tif (left) throw new YamlError(left.line, `unexpected line: ${left.text}`);\n\tif (Array.isArray(result) || typeof result !== 'object') {\n\t\tthrow new YamlError(first.line, 'the front-matter must be a map of keys');\n\t}\n\treturn result as Record<string, YamlValue>;\n}\n",
8
+ "import type { HelpFlow } from './types';\nimport { parseYaml, YamlError, type YamlValue } from './yaml';\n\n/** A flow file the format refuses; the message names the file and line. */\nexport class FlowFormatError extends Error {\n\tconstructor(\n\t\treadonly file: string,\n\t\tmessage: string,\n\t\treadonly line?: number,\n\t) {\n\t\tsuper(`${file}${line === undefined ? '' : `:${line}`}: ${message}`);\n\t\tthis.name = 'FlowFormatError';\n\t}\n}\n\n/** A capture reference of the front-matter: the step it belongs to. */\nexport interface RawCapture {\n\treadonly step: number;\n\treadonly name: string;\n\treadonly alt: string;\n}\n\n/** What a flow file says before its captures are resolved to URLs. */\nexport interface ParsedFlow extends Omit<HelpFlow, 'steps'> {\n\treadonly steps: readonly {\n\t\treadonly index: number;\n\t\treadonly title: string;\n\t\treadonly body: string;\n\t}[];\n\treadonly captures: readonly RawCapture[];\n}\n\nconst ID = /^[a-z0-9]+(?:[-_.][a-z0-9]+)*$/;\nconst CAPTURE_NAME = /^[a-z0-9]+(?:[-_][a-z0-9]+)*$/;\nconst KNOWN = ['id', 'title', 'roles', 'routes', 'overview', 'captures'];\n\nfunction fail(file: string, message: string, line?: number): never {\n\tthrow new FlowFormatError(file, message, line);\n}\n\nfunction strings(\n\tfile: string,\n\tkey: string,\n\tvalue: YamlValue | undefined,\n\trequired: boolean,\n): string[] {\n\tif (value === undefined) {\n\t\tif (required) fail(file, `front-matter \"${key}\" is missing`);\n\t\treturn [];\n\t}\n\tif (\n\t\t!Array.isArray(value) ||\n\t\tvalue.some((item) => typeof item !== 'string' || item === '')\n\t) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t`front-matter \"${key}\" must be a list of non-empty strings, e.g. ${key}: [a, b]`,\n\t\t);\n\t}\n\treturn value as string[];\n}\n\n/** `<role>.<lang>.md` → its language, or undefined when the name has none. */\nexport function langOfFile(file: string): string | undefined {\n\treturn /(?:^|\\/)[^/]+\\.([a-z]{2}(?:-[A-Za-z0-9]+)?)\\.md$/.exec(file)?.[1];\n}\n\n/** Splits the file into its front-matter text and its Markdown. */\nfunction splitFrontMatter(text: string, file: string) {\n\tconst open = /^---[ \\t]*\\n/.exec(text);\n\tif (!open)\n\t\tfail(file, 'the file must start with a \"---\" front-matter block', 1);\n\tconst rest = text.slice(open[0].length);\n\tconst close = /^---[ \\t]*$/m.exec(rest);\n\tif (!close) fail(file, 'the front-matter is not closed by a \"---\" line');\n\treturn {\n\t\thead: rest.slice(0, close.index),\n\t\tmarkdown: rest.slice(close.index + close[0].length).replace(/^\\n/, ''),\n\t};\n}\n\n/** Validates the front-matter keys other than the captures. */\nfunction readHead(head: string, file: string) {\n\tlet data: Record<string, YamlValue>;\n\ttry {\n\t\tdata = parseYaml(head, 2);\n\t} catch (error) {\n\t\tif (error instanceof YamlError) fail(file, error.message, error.line);\n\t\tthrow error;\n\t}\n\tfor (const key of Object.keys(data)) {\n\t\tif (!KNOWN.includes(key)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`unknown front-matter key \"${key}\" (known: ${KNOWN.join(', ')})`,\n\t\t\t);\n\t\t}\n\t}\n\tconst { id, title, overview } = data;\n\tif (typeof id !== 'string' || !ID.test(id)) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"id\" is required: lowercase words joined by - _ or .',\n\t\t);\n\t}\n\tif (typeof title !== 'string' || title.trim() === '') {\n\t\tfail(file, 'front-matter \"title\" is required');\n\t}\n\tconst roles = strings(file, 'roles', data['roles'], true);\n\tif (roles.length === 0)\n\t\tfail(file, 'front-matter \"roles\" lists at least one role');\n\tconst routes = strings(file, 'routes', data['routes'], false);\n\tif (overview !== undefined && typeof overview !== 'boolean') {\n\t\tfail(file, 'front-matter \"overview\" is true or false');\n\t}\n\tif (overview !== true && routes.length === 0) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"routes\" lists the route ids the flow covers (or set overview: true)',\n\t\t);\n\t}\n\treturn {\n\t\tid,\n\t\ttitle: title.trim(),\n\t\troles,\n\t\troutes,\n\t\toverview: overview === true,\n\t\tcaptureRows: data['captures'],\n\t};\n}\n\n/** The `##` sections of the Markdown, outside fenced code. */\nfunction splitSteps(markdown: string) {\n\tlet fence = '';\n\tconst intro: string[] = [];\n\tconst steps: { title: string; body: string[] }[] = [];\n\tfor (const line of markdown.split('\\n')) {\n\t\tconst marker = /^\\s*(```+|~~~+)/.exec(line)?.[1];\n\t\tif (marker) {\n\t\t\tif (fence === '') fence = marker[0] as string;\n\t\t\telse if (marker.startsWith(fence)) fence = '';\n\t\t}\n\t\tconst heading = fence === '' ? /^##\\s+(.+?)\\s*#*\\s*$/.exec(line) : null;\n\t\tif (heading) steps.push({ title: heading[1] as string, body: [] });\n\t\telse (steps.at(-1)?.body ?? intro).push(line);\n\t}\n\treturn { intro, steps };\n}\n\n/** Validates the `captures` list against the number of steps. */\nfunction readCaptures(\n\trows: YamlValue | undefined,\n\tstepCount: number,\n\tfile: string,\n): RawCapture[] {\n\tconst captures: RawCapture[] = [];\n\tif (rows === undefined) return captures;\n\tif (!Array.isArray(rows)) {\n\t\tfail(file, 'front-matter \"captures\" must be a list of { step, name, alt }');\n\t}\n\tfor (const row of rows) {\n\t\tif (typeof row !== 'object' || row === null || Array.isArray(row)) {\n\t\t\tfail(file, 'each capture is a map: - step: 1, name: open-form, alt: …');\n\t\t}\n\t\tconst { step, name, alt } = row as Record<string, YamlValue>;\n\t\tif (\n\t\t\ttypeof step !== 'number' ||\n\t\t\t!Number.isInteger(step) ||\n\t\t\tstep < 1 ||\n\t\t\tstep > stepCount\n\t\t) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture step ${String(step)} is not a step of this flow (it has ${stepCount})`,\n\t\t\t);\n\t\t}\n\t\tif (typeof name !== 'string' || !CAPTURE_NAME.test(name)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture name ${JSON.stringify(name)} must be lowercase words joined by - or _ (no extension, width or theme)`,\n\t\t\t);\n\t\t}\n\t\tif (typeof alt !== 'string' || alt.trim() === '') {\n\t\t\tfail(file, `capture \"${name}\" needs an \"alt\" text`);\n\t\t}\n\t\tif (captures.some((c) => c.step === step)) {\n\t\t\tfail(file, `step ${step} has two captures; a step has one`);\n\t\t}\n\t\tcaptures.push({ step, name, alt });\n\t}\n\treturn captures;\n}\n\n/** Parses one flow file; throws a `FlowFormatError` naming file and line. */\nexport function parseFlow(source: string, file: string): ParsedFlow {\n\tconst lang = langOfFile(file);\n\tif (lang === undefined) {\n\t\tfail(file, 'the file name must be <role>.<lang>.md, e.g. editor.fr.md');\n\t}\n\tconst text = source.replace(/^\\uFEFF/, '').replace(/\\r\\n/g, '\\n');\n\tconst { head, markdown } = splitFrontMatter(text, file);\n\tconst { captureRows, ...meta } = readHead(head, file);\n\tconst { intro, steps } = splitSteps(markdown);\n\treturn {\n\t\t...meta,\n\t\tlang,\n\t\tbody: intro.join('\\n').trim(),\n\t\tsteps: steps.map((step, i) => ({\n\t\t\tindex: i + 1,\n\t\t\ttitle: step.title,\n\t\t\tbody: step.body.join('\\n').trim(),\n\t\t})),\n\t\tcaptures: readCaptures(captureRows, steps.length, file),\n\t\tfile,\n\t};\n}\n",
9
+ "/** The widths a capture is taken at. */\nexport type CaptureWidth = 360 | 1440;\n/** The themes a capture is taken in. */\nexport type CaptureTheme = 'light' | 'dark';\n\nexport const CAPTURE_WIDTHS = [1440, 360] as const;\nexport const CAPTURE_THEMES = ['light', 'dark'] as const;\n\n/** The file name of one capture variant: `<name>.<width>.<theme>.webp`. */\nexport function captureFile(\n\tname: string,\n\twidth: CaptureWidth,\n\ttheme: CaptureTheme,\n): string {\n\treturn `${name}.${width}.${theme}.webp`;\n}\n\n/**\n * One step's screenshot: the URL of each variant and its alt text. The\n * shape `HelpSheet` of `@softistx/material` takes.\n */\nexport interface HelpCapture {\n\treadonly name: string;\n\treadonly alt: string;\n\treadonly light: { readonly 360: string; readonly 1440: string };\n\treadonly dark: { readonly 360: string; readonly 1440: string };\n}\n\n/** One numbered step: a `##` section of the flow's Markdown. */\nexport interface HelpStep {\n\t/** 1-based, in reading order. */\n\treadonly index: number;\n\treadonly title: string;\n\t/** The section's Markdown, without its heading. */\n\treadonly body: string;\n\treadonly capture?: HelpCapture;\n}\n\n/** One flow: a file `docs/flows/<role>.<lang>.md`. */\nexport interface HelpFlow {\n\treadonly id: string;\n\treadonly title: string;\n\treadonly roles: readonly string[];\n\t/** React Router route ids this flow covers. */\n\treadonly routes: readonly string[];\n\t/** The role's overview: shown when no flow covers the screen. */\n\treadonly overview: boolean;\n\treadonly lang: string;\n\t/** The Markdown before the first step. */\n\treadonly body: string;\n\treadonly steps: readonly HelpStep[];\n\t/** The source file, for messages. */\n\treadonly file: string;\n}\n"
10
+ ],
11
+ "mappings": ";AACO,MAAM,kBAAkB,MAAM;AAAA,EAE1B;AAAA,EADV,WAAW,CACD,MACT,SACC;AAAA,IACD,MAAM,OAAO;AAAA,IAHJ;AAAA,IAIT,KAAK,OAAO;AAAA;AAEd;;;ACAO,SAAS,SAAS,CACxB,MACA,GACA,OACmC;AAAA,EACnC,MAAM,OAAO,KAAK;AAAA,EAClB,IAAI,UAAU,KAAK;AAAA,IAClB,IAAI,SAAS;AAAA,MAAM,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAC5C,OAAO,EAAE,OAAO,SAAS,MAAM,KAAK,OAAO,OAAO,EAAE;AAAA,EACrD;AAAA,EACA,IAAI,UAAU,KAAK;AAAA,IAClB,IAAI,SAAS,OAAO,KAAK,IAAI,OAAO;AAAA,MAAK,OAAO,EAAE,OAAO,OAA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AAI;AAAA,EAChE,QAAQ,MAAM,aAAa,iBAAiB,MAAM,IAAI;AAAA,EACtD,QAAQ,gBAAgB,SAAS,SAAS,MAAM,IAAI;AAAA,EACpD,QAAQ,OAAO,UAAU,WAAW,QAAQ;AAAA,EAC5C,OAAO;AAAA,OACH;AAAA,IACH;AAAA,IACA,MAAM,MAAM,KAAK;AAAA,CAAI,EAAE,KAAK;AAAA,IAC5B,OAAO,MAAM,IAAI,CAAC,MAAM,OAAO;AAAA,MAC9B,OAAO,IAAI;AAAA,MACX,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,KAAK,KAAK;AAAA,CAAI,EAAE,KAAK;AAAA,IACjC,EAAE;AAAA,IACF,UAAU,aAAa,aAAa,MAAM,QAAQ,IAAI;AAAA,IACtD;AAAA,EACD;AAAA;;;ACjNM,IAAM,kBAAiB,CAAC,MAAM,GAAG;AACjC,IAAM,kBAAiB,CAAC,SAAS,MAAM;AAGvC,SAAS,YAAW,CAC1B,MACA,OACA,OACS;AAAA,EACT,OAAO,GAAG,QAAQ,SAAS;AAAA;",
12
+ "debugId": "3DC0FFCDE06F3C8D64756E2164756E21",
13
+ "names": []
14
+ }
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  checkHelp2
4
- } from "../chunks/index-tx36swjx.js";
4
+ } from "../chunks/index-5jf809bq.js";
5
5
  import {
6
6
  NAME
7
7
  } from "../chunks/index-sfhshxqz.js";
@@ -4,7 +4,7 @@ import {
4
4
  matchesIgnore2,
5
5
  readRouteConfig2,
6
6
  checkHelp2
7
- } from "../../chunks/index-tx36swjx.js";
7
+ } from "../../chunks/index-5jf809bq.js";
8
8
  export {
9
9
  checkHelp2 as checkHelp,
10
10
  flattenRoutes2 as flattenRoutes,
@@ -5,7 +5,7 @@ import {
5
5
  CAPTURE_WIDTHS2,
6
6
  CAPTURE_THEMES2,
7
7
  captureFile2
8
- } from "../chunks/index-skwypsjz.js";
8
+ } from "../chunks/index-dg35wgk5.js";
9
9
 
10
10
  // src/help/guide.ts
11
11
  import { useState } from "react";
@@ -0,0 +1,6 @@
1
+ /** A syntax error, with its 1-based line in the front-matter. */
2
+ export declare class YamlError extends Error {
3
+ readonly line: number;
4
+ constructor(line: number, message: string);
5
+ }
6
+ //# sourceMappingURL=yaml-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml-error.d.ts","sourceRoot":"","sources":["../../src/help/yaml-error.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,qBAAa,SAAU,SAAQ,KAAK;IAElC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKhB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Where a quote opens or closes at `text[i]`, given the quote `quote` that is
3
+ * open ('' for none). `width` is how many characters the step consumes: 2 for
4
+ * an escaped `\"`-style pair in double quotes or a doubled `''` in single
5
+ * quotes, so a caller skips them. A quote opens only at the start of a token
6
+ * (after a space, `[`, `{`, `,` or `:`), so `Can't` stays a plain scalar.
7
+ */
8
+ export declare function quoteStep(text: string, i: number, quote: string): {
9
+ quote: string;
10
+ width: number;
11
+ };
12
+ /** The value of a quoted scalar; a bare quote or unknown escape is an error. */
13
+ export declare function unquote(value: string, line: number): string;
14
+ //# sourceMappingURL=yaml-quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml-quotes.d.ts","sourceRoot":"","sources":["../../src/help/yaml-quotes.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACX;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiBlC;AA8BD,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAoE3D"}
@@ -1,18 +1,16 @@
1
+ import { YamlError } from './yaml-error';
2
+ export { YamlError };
1
3
  /**
2
4
  * The small YAML a flow's front-matter uses: `key: value` lines, inline
3
5
  * lists (`[a, b]`), block lists (`- a`) and block lists of maps
4
6
  * (`- key: value`, then the map's other keys indented). Scalars are strings,
5
7
  * `true`/`false` or numbers; `"…"` and `'…'` quote one. No anchors, no
6
- * multi-line scalars: a flow's front-matter has no need of them.
8
+ * multi-line scalars: a flow's front-matter has no need of them. Quoting is
9
+ * strict, as in any YAML parser: a quote inside a quoted scalar is escaped.
7
10
  */
8
11
  export type YamlValue = string | number | boolean | readonly YamlValue[] | {
9
12
  readonly [key: string]: YamlValue;
10
13
  };
11
- /** A syntax error, with its 1-based line in the front-matter. */
12
- export declare class YamlError extends Error {
13
- readonly line: number;
14
- constructor(line: number, message: string);
15
- }
16
14
  /** Parses a front-matter block to a map; `firstLine` offsets error lines. */
17
15
  export declare function parseYaml(source: string, firstLine?: number): Record<string, YamlValue>;
18
16
  //# sourceMappingURL=yaml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/help/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEzC,iEAAiE;AACjE,qBAAa,SAAU,SAAQ,KAAK;IAElC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKhB;AAkLD,6EAA6E;AAC7E,wBAAgB,SAAS,CACxB,MAAM,EAAE,MAAM,EACd,SAAS,SAAI,GACX,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAc3B"}
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/help/yaml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAiLzC,6EAA6E;AAC7E,wBAAgB,SAAS,CACxB,MAAM,EAAE,MAAM,EACd,SAAS,SAAI,GACX,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAc3B"}
@@ -59,7 +59,14 @@ Press **Save**: the post is a draft until you submit it.
59
59
 
60
60
  An unknown key is an error, so a typo does not go unnoticed. The front-matter is
61
61
  a small YAML: `key: value`, inline lists (`[a, b]`), block lists and block lists
62
- of maps as above, `"quoted"` or `'quoted'` strings and `# comments`.
62
+ of maps as above, `"quoted"` or `'quoted'` strings and `# comments`. Quoting is
63
+ strict, as in `Bun.YAML.parse` and GitHub's front-matter view: a quote inside a
64
+ quoted value is escaped (`"say \"hi\""`, `'it''s'`) or replaced by a typographic
65
+ one (`“or”`); `alt: "A card with an "or" divider"` fails `help check` with its
66
+ file and line. Double-quoted values decode the YAML 1.2 escapes: `\0 \a \b \t \n \v \f \r \e \" \/ \\ \N \_ \L \P`, an escaped space or tab, and
67
+ `\xXX`, `\uXXXX` and `\UXXXXXXXX` (a code point up to U+10FFFF). A lone
68
+ surrogate is refused; a full `😀` pair or `\U0001F600` is fine. Another escape
69
+ is an error.
63
70
 
64
71
  ### Steps
65
72
 
@@ -2327,10 +2327,39 @@ one of:
2327
2327
  - `front-matter "roles" must be a list of non-empty strings, e.g. roles: [a, b]`.
2328
2328
  - `capture step 5 is not a step of this flow (it has 3)`, `capture "x" needs an "alt" text`, `step 2 has two captures; a step has one`.
2329
2329
  - `flow id "x" is already used by …`: ids are unique per language.
2330
- - `indent with spaces, not tabs`, `duplicate key "x"`, `expected "key: value", got: …`, `unclosed list: …`: YAML syntax; quote a value that contains ` #`.
2330
+ - `indent with spaces, not tabs`, `duplicate key "x"`, `expected "key: value", got: …`, `unclosed list: …`: YAML syntax; quote a value that contains ` #`. For quotes, see the quote errors below.
2331
2331
 
2332
2332
  See [the front-matter](guide/help.md#front-matter).
2333
2333
 
2334
+ ### `bare " inside a double-quoted string (escape it as \" or use typographic quotes): …`
2335
+
2336
+ `help check` (and `loadHelpFlows`) reject a double-quoted front-matter value
2337
+ that holds an unescaped `"`, such as `alt: "A card with an "or" divider"`: a
2338
+ strict YAML parser (`Bun.YAML.parse`, GitHub's front-matter view) rejects it
2339
+ too. Escape it (`"A card with an \"or\" divider"`) or use typographic quotes
2340
+ (`“or”`). A doc that loaded before now fails at startup or build, naming the
2341
+ file and line.
2342
+
2343
+ ### `bare ' inside a single-quoted string (double it as '' or use typographic quotes): …`
2344
+
2345
+ The same for a single-quoted value: write `'it''s'`, or quote with `"…"`.
2346
+
2347
+ ### `unknown escape "\q" in a double-quoted string: …`
2348
+
2349
+ A double-quoted value supports the YAML 1.2 escapes: `\0 \a \b \t \n \v \f \r \e \" \/ \\ \N \_ \L \P`, an escaped space or tab, and `\xXX`, `\uXXXX` and `\UXXXXXXXX` (a code point up to U+10FFFF). A lone surrogate is refused; a full `😀` pair or `\U0001F600` is fine. Any other backslash sequence, or a hex escape with too few digits, is an error, as in strict YAML.
2350
+
2351
+ ### `escape "\U00110000" is above U+10FFFF in a double-quoted string: …`
2352
+
2353
+ Use a code point of at most U+10FFFF.
2354
+
2355
+ ### `escape "\uD83D" is a lone surrogate in a double-quoted string; write the character itself or a \U escape: …`
2356
+
2357
+ A `\u` or `\U` escape decoded to half of a surrogate pair, which `Bun.YAML.parse` refuses. Write the character itself or one `\U0001F600` escape. A full pair (`\uD83D\uDE00`) is accepted.
2358
+
2359
+ ### `unterminated escape at the end of a double-quoted string: …`
2360
+
2361
+ The value ends with a backslash that escapes nothing (`"abc\"` closes on the quote the backslash escapes). Double the backslash (`"abc\\"`) or drop it.
2362
+
2334
2363
  ### `capture file x.1440.light.webp is missing from docs/flows/captures/`
2335
2364
 
2336
2365
  A step cites a capture and one of its four variants is not there. Add
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softistx/alxia-react-router",
3
- "version": "0.89.2",
3
+ "version": "0.89.3",
4
4
  "description": "alxia as the server of a React Router framework app: server rendering behind the app's hooks, loaders reading its typed context, the client's assets served; the code with no UI an installable app shares (`/pwa`), its hooks (`/pwa/react`), `noCache` for the worker's script (`/pwa/server`), the service worker on Workbox (`/pwa/worker`) and its build (`/pwa/build`), an API's refusals worded for the page (`/errors`), the BFF session: cookies, sign-in, step-up and mail links (`/session`), its page hooks (`/session/react`) and what it shares with the page (`/session/model`), a GraphQL subscription relayed to the browser over SSE (`/subscription`) and kept alive in the page (`/subscription/react`), an API's MCP and OAuth endpoints relayed on the app's origin (`/mcp`), per-role flow docs, the help panel's data and its lazy `HelpPanel`, and the role guide's `useGuideRole` (`/help`, `/help/check`), an API's media files read and uploaded through the app (`/media`) and uploaded from the page with progress (`/media/client`), the page's CSP nonce and inline boot scripts (`/document`) and a streaming `entry.server` (`/entry`), the consent screen of an OAuth server: a route's loader and action, the connected apps' list and revoke (`/oauth`) and the decision hook (`/oauth/react`), a user's API keys listed, created behind a step-up and revoked (`/api-keys`) and `/oidc`: a relying party of an external OpenID Connect issuer (authorization code + PKCE, id token validation, a sealed token cookie, refresh and RP-initiated logout)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,12 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/help/yaml.ts", "../src/help/parse-flow.ts", "../src/help/types.ts"],
4
- "sourcesContent": [
5
- "/**\n * The small YAML a flow's front-matter uses: `key: value` lines, inline\n * lists (`[a, b]`), block lists (`- a`) and block lists of maps\n * (`- key: value`, then the map's other keys indented). Scalars are strings,\n * `true`/`false` or numbers; `\"…\"` and `'…'` quote one. No anchors, no\n * multi-line scalars: a flow's front-matter has no need of them.\n */\nexport type YamlValue =\n\t| string\n\t| number\n\t| boolean\n\t| readonly YamlValue[]\n\t| { readonly [key: string]: YamlValue };\n\n/** A syntax error, with its 1-based line in the front-matter. */\nexport class YamlError extends Error {\n\tconstructor(\n\t\treadonly line: number,\n\t\tmessage: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'YamlError';\n\t}\n}\n\nfunction scalar(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('\"') || value.startsWith(\"'\")) {\n\t\tconst quote = value[0] as string;\n\t\tif (value.length < 2 || !value.endsWith(quote)) {\n\t\t\tthrow new YamlError(line, `unterminated quoted string: ${value}`);\n\t\t}\n\t\tconst inner = value.slice(1, -1);\n\t\treturn quote === '\"'\n\t\t\t? inner.replace(/\\\\([\"\\\\nt])/g, (_, c: string) =>\n\t\t\t\t\tc === 'n' ? '\\n' : c === 't' ? '\\t' : c,\n\t\t\t\t)\n\t\t\t: inner.replace(/''/g, \"'\");\n\t}\n\tif (value === 'true') return true;\n\tif (value === 'false') return false;\n\tif (/^-?\\d+(\\.\\d+)?$/.test(value)) return Number(value);\n\treturn value;\n}\n\n/** Splits on commas outside quotes. */\nfunction splitFlow(text: string): string[] {\n\tconst parts: string[] = [];\n\tlet current = '';\n\tlet quote = '';\n\tlet depth = 0;\n\tfor (const char of text) {\n\t\tif (quote) {\n\t\t\tif (char === quote) quote = '';\n\t\t} else if (char === '\"' || char === \"'\") quote = char;\n\t\telse if (char === '[' || char === '{') depth++;\n\t\telse if (char === ']' || char === '}') depth--;\n\t\telse if (char === ',' && depth === 0) {\n\t\t\tparts.push(current);\n\t\t\tcurrent = '';\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t}\n\tif (current.trim() !== '') parts.push(current);\n\treturn parts;\n}\n\nfunction inline(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('[')) {\n\t\tif (!value.endsWith(']'))\n\t\t\tthrow new YamlError(line, `unclosed list: ${value}`);\n\t\treturn splitFlow(value.slice(1, -1)).map((item) => inline(item, line));\n\t}\n\tif (value.startsWith('{')) {\n\t\tif (!value.endsWith('}'))\n\t\t\tthrow new YamlError(line, `unclosed map: ${value}`);\n\t\tconst map: Record<string, YamlValue> = {};\n\t\tfor (const pair of splitFlow(value.slice(1, -1))) {\n\t\t\tconst [key, rest] = keyValue(pair, line);\n\t\t\tmap[key] = inline(rest, line);\n\t\t}\n\t\treturn map;\n\t}\n\treturn scalar(value, line);\n}\n\nfunction keyValue(text: string, line: number): [string, string] {\n\tconst match = /^\\s*([A-Za-z_][\\w-]*)\\s*:(?:\\s+(.*))?$/.exec(text);\n\tif (!match)\n\t\tthrow new YamlError(line, `expected \"key: value\", got: ${text.trim()}`);\n\treturn [match[1] as string, match[2] ?? ''];\n}\n\n/** Drops a trailing ` # comment` that is not inside quotes. */\nfunction stripComment(text: string): string {\n\tlet quote = '';\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst char = text[i] as string;\n\t\tif (quote) {\n\t\t\tif (char === quote) quote = '';\n\t\t} else if (char === '\"' || char === \"'\") quote = char;\n\t\telse if (char === '#' && (i === 0 || /\\s/.test(text[i - 1] as string))) {\n\t\t\treturn text.slice(0, i);\n\t\t}\n\t}\n\treturn text;\n}\n\ninterface Row {\n\treadonly indent: number;\n\treadonly text: string;\n\treadonly line: number;\n}\n\n/** The non-blank rows of the source, comments stripped. */\nfunction readRows(source: string, firstLine: number): Row[] {\n\tconst rows: Row[] = [];\n\tsource.split('\\n').forEach((raw, index) => {\n\t\tconst text = stripComment(raw.replace(/\\r$/, '')).trimEnd();\n\t\tif (text.trim() === '') return;\n\t\tif (/^ *\\t/.test(text)) {\n\t\t\tthrow new YamlError(firstLine + index, 'indent with spaces, not tabs');\n\t\t}\n\t\trows.push({\n\t\t\tindent: text.length - text.trimStart().length,\n\t\t\ttext: text.trim(),\n\t\t\tline: firstLine + index,\n\t\t});\n\t});\n\treturn rows;\n}\n\n/** A cursor over the rows: `block`, `map` and `list` read what is at it. */\nclass Reader {\n\tat = 0;\n\tconstructor(readonly rows: Row[]) {}\n\n\tget row(): Row | undefined {\n\t\treturn this.rows[this.at];\n\t}\n\n\tblock(indent: number): YamlValue {\n\t\tconst row = this.row as Row;\n\t\treturn row.text.startsWith('- ') || row.text === '-'\n\t\t\t? this.list(indent)\n\t\t\t: this.map(indent);\n\t}\n\n\tmap(indent: number): Record<string, YamlValue> {\n\t\tconst result: Record<string, YamlValue> = {};\n\t\tfor (let row = this.row; row?.indent === indent; row = this.row) {\n\t\t\tif (row.text.startsWith('-')) break;\n\t\t\tconst [key, rest] = keyValue(row.text, row.line);\n\t\t\tif (key in result)\n\t\t\t\tthrow new YamlError(row.line, `duplicate key \"${key}\"`);\n\t\t\tthis.at++;\n\t\t\tconst next = this.row;\n\t\t\tif (rest !== '') {\n\t\t\t\tresult[key] = inline(rest, row.line);\n\t\t\t} else if (next && next.indent > indent) {\n\t\t\t\tresult[key] = this.block(next.indent);\n\t\t\t} else if (next?.indent === indent && next.text.startsWith('- ')) {\n\t\t\t\tresult[key] = this.list(indent);\n\t\t\t} else {\n\t\t\t\tresult[key] = '';\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tlist(indent: number): YamlValue[] {\n\t\tconst result: YamlValue[] = [];\n\t\tfor (let row = this.row; row; row = this.row) {\n\t\t\tif (\n\t\t\t\trow.indent !== indent ||\n\t\t\t\t!(row.text.startsWith('- ') || row.text === '-')\n\t\t\t)\n\t\t\t\tbreak;\n\t\t\tconst rest = row.text.slice(1).trim();\n\t\t\tif (rest === '') {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(this.block((this.row as Row).indent));\n\t\t\t} else if (\n\t\t\t\t/^[A-Za-z_][\\w-]*\\s*:(\\s|$)/.test(rest) &&\n\t\t\t\t!rest.startsWith('{')\n\t\t\t) {\n\t\t\t\t// `- key: value`: a map whose first key sits on the dash's line.\n\t\t\t\tconst inner = indent + 2;\n\t\t\t\tthis.rows[this.at] = { indent: inner, text: rest, line: row.line };\n\t\t\t\tresult.push(this.map(inner));\n\t\t\t} else {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(inline(rest, row.line));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/** Parses a front-matter block to a map; `firstLine` offsets error lines. */\nexport function parseYaml(\n\tsource: string,\n\tfirstLine = 1,\n): Record<string, YamlValue> {\n\tconst rows = readRows(source, firstLine);\n\tif (rows.length === 0) return {};\n\tconst first = rows[0] as Row;\n\tif (first.indent !== 0)\n\t\tthrow new YamlError(first.line, 'the first line must not be indented');\n\tconst reader = new Reader(rows);\n\tconst result = reader.block(0);\n\tconst left = reader.row;\n\tif (left) throw new YamlError(left.line, `unexpected line: ${left.text}`);\n\tif (Array.isArray(result) || typeof result !== 'object') {\n\t\tthrow new YamlError(first.line, 'the front-matter must be a map of keys');\n\t}\n\treturn result as Record<string, YamlValue>;\n}\n",
6
- "import type { HelpFlow } from './types';\nimport { parseYaml, YamlError, type YamlValue } from './yaml';\n\n/** A flow file the format refuses; the message names the file and line. */\nexport class FlowFormatError extends Error {\n\tconstructor(\n\t\treadonly file: string,\n\t\tmessage: string,\n\t\treadonly line?: number,\n\t) {\n\t\tsuper(`${file}${line === undefined ? '' : `:${line}`}: ${message}`);\n\t\tthis.name = 'FlowFormatError';\n\t}\n}\n\n/** A capture reference of the front-matter: the step it belongs to. */\nexport interface RawCapture {\n\treadonly step: number;\n\treadonly name: string;\n\treadonly alt: string;\n}\n\n/** What a flow file says before its captures are resolved to URLs. */\nexport interface ParsedFlow extends Omit<HelpFlow, 'steps'> {\n\treadonly steps: readonly {\n\t\treadonly index: number;\n\t\treadonly title: string;\n\t\treadonly body: string;\n\t}[];\n\treadonly captures: readonly RawCapture[];\n}\n\nconst ID = /^[a-z0-9]+(?:[-_.][a-z0-9]+)*$/;\nconst CAPTURE_NAME = /^[a-z0-9]+(?:[-_][a-z0-9]+)*$/;\nconst KNOWN = ['id', 'title', 'roles', 'routes', 'overview', 'captures'];\n\nfunction fail(file: string, message: string, line?: number): never {\n\tthrow new FlowFormatError(file, message, line);\n}\n\nfunction strings(\n\tfile: string,\n\tkey: string,\n\tvalue: YamlValue | undefined,\n\trequired: boolean,\n): string[] {\n\tif (value === undefined) {\n\t\tif (required) fail(file, `front-matter \"${key}\" is missing`);\n\t\treturn [];\n\t}\n\tif (\n\t\t!Array.isArray(value) ||\n\t\tvalue.some((item) => typeof item !== 'string' || item === '')\n\t) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t`front-matter \"${key}\" must be a list of non-empty strings, e.g. ${key}: [a, b]`,\n\t\t);\n\t}\n\treturn value as string[];\n}\n\n/** `<role>.<lang>.md` → its language, or undefined when the name has none. */\nexport function langOfFile(file: string): string | undefined {\n\treturn /(?:^|\\/)[^/]+\\.([a-z]{2}(?:-[A-Za-z0-9]+)?)\\.md$/.exec(file)?.[1];\n}\n\n/** Splits the file into its front-matter text and its Markdown. */\nfunction splitFrontMatter(text: string, file: string) {\n\tconst open = /^---[ \\t]*\\n/.exec(text);\n\tif (!open)\n\t\tfail(file, 'the file must start with a \"---\" front-matter block', 1);\n\tconst rest = text.slice(open[0].length);\n\tconst close = /^---[ \\t]*$/m.exec(rest);\n\tif (!close) fail(file, 'the front-matter is not closed by a \"---\" line');\n\treturn {\n\t\thead: rest.slice(0, close.index),\n\t\tmarkdown: rest.slice(close.index + close[0].length).replace(/^\\n/, ''),\n\t};\n}\n\n/** Validates the front-matter keys other than the captures. */\nfunction readHead(head: string, file: string) {\n\tlet data: Record<string, YamlValue>;\n\ttry {\n\t\tdata = parseYaml(head, 2);\n\t} catch (error) {\n\t\tif (error instanceof YamlError) fail(file, error.message, error.line);\n\t\tthrow error;\n\t}\n\tfor (const key of Object.keys(data)) {\n\t\tif (!KNOWN.includes(key)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`unknown front-matter key \"${key}\" (known: ${KNOWN.join(', ')})`,\n\t\t\t);\n\t\t}\n\t}\n\tconst { id, title, overview } = data;\n\tif (typeof id !== 'string' || !ID.test(id)) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"id\" is required: lowercase words joined by - _ or .',\n\t\t);\n\t}\n\tif (typeof title !== 'string' || title.trim() === '') {\n\t\tfail(file, 'front-matter \"title\" is required');\n\t}\n\tconst roles = strings(file, 'roles', data['roles'], true);\n\tif (roles.length === 0)\n\t\tfail(file, 'front-matter \"roles\" lists at least one role');\n\tconst routes = strings(file, 'routes', data['routes'], false);\n\tif (overview !== undefined && typeof overview !== 'boolean') {\n\t\tfail(file, 'front-matter \"overview\" is true or false');\n\t}\n\tif (overview !== true && routes.length === 0) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"routes\" lists the route ids the flow covers (or set overview: true)',\n\t\t);\n\t}\n\treturn {\n\t\tid,\n\t\ttitle: title.trim(),\n\t\troles,\n\t\troutes,\n\t\toverview: overview === true,\n\t\tcaptureRows: data['captures'],\n\t};\n}\n\n/** The `##` sections of the Markdown, outside fenced code. */\nfunction splitSteps(markdown: string) {\n\tlet fence = '';\n\tconst intro: string[] = [];\n\tconst steps: { title: string; body: string[] }[] = [];\n\tfor (const line of markdown.split('\\n')) {\n\t\tconst marker = /^\\s*(```+|~~~+)/.exec(line)?.[1];\n\t\tif (marker) {\n\t\t\tif (fence === '') fence = marker[0] as string;\n\t\t\telse if (marker.startsWith(fence)) fence = '';\n\t\t}\n\t\tconst heading = fence === '' ? /^##\\s+(.+?)\\s*#*\\s*$/.exec(line) : null;\n\t\tif (heading) steps.push({ title: heading[1] as string, body: [] });\n\t\telse (steps.at(-1)?.body ?? intro).push(line);\n\t}\n\treturn { intro, steps };\n}\n\n/** Validates the `captures` list against the number of steps. */\nfunction readCaptures(\n\trows: YamlValue | undefined,\n\tstepCount: number,\n\tfile: string,\n): RawCapture[] {\n\tconst captures: RawCapture[] = [];\n\tif (rows === undefined) return captures;\n\tif (!Array.isArray(rows)) {\n\t\tfail(file, 'front-matter \"captures\" must be a list of { step, name, alt }');\n\t}\n\tfor (const row of rows) {\n\t\tif (typeof row !== 'object' || row === null || Array.isArray(row)) {\n\t\t\tfail(file, 'each capture is a map: - step: 1, name: open-form, alt: …');\n\t\t}\n\t\tconst { step, name, alt } = row as Record<string, YamlValue>;\n\t\tif (\n\t\t\ttypeof step !== 'number' ||\n\t\t\t!Number.isInteger(step) ||\n\t\t\tstep < 1 ||\n\t\t\tstep > stepCount\n\t\t) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture step ${String(step)} is not a step of this flow (it has ${stepCount})`,\n\t\t\t);\n\t\t}\n\t\tif (typeof name !== 'string' || !CAPTURE_NAME.test(name)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture name ${JSON.stringify(name)} must be lowercase words joined by - or _ (no extension, width or theme)`,\n\t\t\t);\n\t\t}\n\t\tif (typeof alt !== 'string' || alt.trim() === '') {\n\t\t\tfail(file, `capture \"${name}\" needs an \"alt\" text`);\n\t\t}\n\t\tif (captures.some((c) => c.step === step)) {\n\t\t\tfail(file, `step ${step} has two captures; a step has one`);\n\t\t}\n\t\tcaptures.push({ step, name, alt });\n\t}\n\treturn captures;\n}\n\n/** Parses one flow file; throws a `FlowFormatError` naming file and line. */\nexport function parseFlow(source: string, file: string): ParsedFlow {\n\tconst lang = langOfFile(file);\n\tif (lang === undefined) {\n\t\tfail(file, 'the file name must be <role>.<lang>.md, e.g. editor.fr.md');\n\t}\n\tconst text = source.replace(/^\\uFEFF/, '').replace(/\\r\\n/g, '\\n');\n\tconst { head, markdown } = splitFrontMatter(text, file);\n\tconst { captureRows, ...meta } = readHead(head, file);\n\tconst { intro, steps } = splitSteps(markdown);\n\treturn {\n\t\t...meta,\n\t\tlang,\n\t\tbody: intro.join('\\n').trim(),\n\t\tsteps: steps.map((step, i) => ({\n\t\t\tindex: i + 1,\n\t\t\ttitle: step.title,\n\t\t\tbody: step.body.join('\\n').trim(),\n\t\t})),\n\t\tcaptures: readCaptures(captureRows, steps.length, file),\n\t\tfile,\n\t};\n}\n",
7
- "/** The widths a capture is taken at. */\nexport type CaptureWidth = 360 | 1440;\n/** The themes a capture is taken in. */\nexport type CaptureTheme = 'light' | 'dark';\n\nexport const CAPTURE_WIDTHS = [1440, 360] as const;\nexport const CAPTURE_THEMES = ['light', 'dark'] as const;\n\n/** The file name of one capture variant: `<name>.<width>.<theme>.webp`. */\nexport function captureFile(\n\tname: string,\n\twidth: CaptureWidth,\n\ttheme: CaptureTheme,\n): string {\n\treturn `${name}.${width}.${theme}.webp`;\n}\n\n/**\n * One step's screenshot: the URL of each variant and its alt text. The\n * shape `HelpSheet` of `@softistx/material` takes.\n */\nexport interface HelpCapture {\n\treadonly name: string;\n\treadonly alt: string;\n\treadonly light: { readonly 360: string; readonly 1440: string };\n\treadonly dark: { readonly 360: string; readonly 1440: string };\n}\n\n/** One numbered step: a `##` section of the flow's Markdown. */\nexport interface HelpStep {\n\t/** 1-based, in reading order. */\n\treadonly index: number;\n\treadonly title: string;\n\t/** The section's Markdown, without its heading. */\n\treadonly body: string;\n\treadonly capture?: HelpCapture;\n}\n\n/** One flow: a file `docs/flows/<role>.<lang>.md`. */\nexport interface HelpFlow {\n\treadonly id: string;\n\treadonly title: string;\n\treadonly roles: readonly string[];\n\t/** React Router route ids this flow covers. */\n\treadonly routes: readonly string[];\n\t/** The role's overview: shown when no flow covers the screen. */\n\treadonly overview: boolean;\n\treadonly lang: string;\n\t/** The Markdown before the first step. */\n\treadonly body: string;\n\treadonly steps: readonly HelpStep[];\n\t/** The source file, for messages. */\n\treadonly file: string;\n}\n"
8
- ],
9
- "mappings": ";AAeO,MAAM,kBAAkB,MAAM;AAAA,EAE1B;AAAA,EADV,WAAW,CACD,MACT,SACC;AAAA,IACD,MAAM,OAAO;AAAA,IAHJ;AAAA,IAIT,KAAK,OAAO;AAAA;AAEd;AAEA,SAAS,MAAM,CA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