@astryxdesign/cli 0.7.16-canary.gca36b56 → 0.7.16-canary.gcc14978
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/api/build/_adapter.d.mts +5 -0
- package/api/build/_adapter.mjs +47 -12
- package/api/build/kit/rank.mjs +14 -0
- package/api/build/kit/weights.d.mts +2 -0
- package/api/build/kit/weights.mjs +136 -5
- package/api/build/kit/words.d.mts +1 -0
- package/api/build/kit/words.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +3 -3
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +217 -5
- package/api/docs/node/node.mjs +1 -1
- package/api/doctor/_adapter.d.mts +12 -2
- package/api/doctor/_adapter.mjs +43 -2
- package/api/doctor/doctor.mjs +1 -1
- package/api/doctor/theme-checks.mjs +113 -17
- package/api/theme/build/build.d.mts +28 -0
- package/api/theme/build/build.mjs +77 -0
- package/api/theme-edit/_adapter.mjs +55 -4
- package/api/theme-edit/_check.d.mts +6 -22
- package/api/theme-edit/_check.mjs +89 -83
- package/api/theme-edit/_edit.mjs +65 -6
- package/api/theme-edit/_how-question.mjs +360 -32
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_normal.d.mts +80 -0
- package/api/theme-edit/_normal.mjs +359 -0
- package/api/theme-edit/_preview-app.mjs +1 -1
- package/api/theme-edit/_preview.d.mts +18 -7
- package/api/theme-edit/_preview.mjs +79 -37
- package/api/theme-edit/_settings.d.mts +4 -1
- package/api/theme-edit/_settings.mjs +218 -43
- package/api/theme-edit/theme-edit.type.d.mts +9 -0
- package/api/theme-edit/theme-edit.type.mjs +3 -0
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ide/page.tsx +24 -2
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +23 -0
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +27 -2
- package/foundation/discovery/entry-name-files.d.mts +43 -0
- package/foundation/discovery/entry-name-files.mjs +264 -0
- package/foundation/discovery/hook-discovery.d.mts +8 -2
- package/foundation/discovery/hook-discovery.mjs +20 -7
- package/foundation/discovery/template-adapter.d.mts +52 -0
- package/foundation/discovery/template-adapter.mjs +169 -0
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +22 -0
- package/foundation/doc-compiler/stored-docs.mjs +49 -0
- package/foundation/fs/gather-cache.d.mts +20 -0
- package/foundation/fs/gather-cache.mjs +103 -4
- package/foundation/fs/kept-tree.d.mts +60 -0
- package/foundation/fs/kept-tree.mjs +154 -0
- package/foundation/render/page-worker.mjs +4 -1
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +13 -0
- package/package.json +6 -6
package/api/build/_adapter.d.mts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @property {string} category The template's own `Family - Variant` label; empty when it declares none.
|
|
13
13
|
* @property {string[]} keywords The ideas the page serves, as its own descriptor names them; empty when it declares none.
|
|
14
14
|
* @property {string} filePath Absolute path to the template source file on disk.
|
|
15
|
+
* @property {string[]} components The components its page composes, read from its source on first use; empty when the source cannot be read.
|
|
15
16
|
*/
|
|
16
17
|
/**
|
|
17
18
|
* A component the project can use, as the ranker reads it.
|
|
@@ -158,6 +159,10 @@ export type PageTemplate = {
|
|
|
158
159
|
* Absolute path to the template source file on disk.
|
|
159
160
|
*/
|
|
160
161
|
filePath: string;
|
|
162
|
+
/**
|
|
163
|
+
* The components its page composes, read from its source on first use; empty when the source cannot be read.
|
|
164
|
+
*/
|
|
165
|
+
components: string[];
|
|
161
166
|
};
|
|
162
167
|
/**
|
|
163
168
|
* A component the project can use, as the ranker reads it.
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -28,6 +28,7 @@ import {componentKeywords} from '../search/search.mjs';
|
|
|
28
28
|
import {findCoreDir, requireCoreDir} from '../../foundation/fs/paths.mjs';
|
|
29
29
|
import {persistedDerived} from '../../foundation/fs/gather-cache.mjs';
|
|
30
30
|
import {analyzeTemplateNeeds} from '../../foundation/discovery/template-needs.mjs';
|
|
31
|
+
import {extractComponents} from '../../foundation/discovery/template-adapter.mjs';
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Runs one build with a single directory listing per path: the kit resolves
|
|
@@ -47,6 +48,7 @@ export {withListingCache} from '../../foundation/fs/listing-cache.mjs';
|
|
|
47
48
|
* @property {string} category The template's own `Family - Variant` label; empty when it declares none.
|
|
48
49
|
* @property {string[]} keywords The ideas the page serves, as its own descriptor names them; empty when it declares none.
|
|
49
50
|
* @property {string} filePath Absolute path to the template source file on disk.
|
|
51
|
+
* @property {string[]} components The components its page composes, read from its source on first use; empty when the source cannot be read.
|
|
50
52
|
*/
|
|
51
53
|
|
|
52
54
|
/**
|
|
@@ -99,18 +101,23 @@ export async function loadTemplates(cwd) {
|
|
|
99
101
|
}
|
|
100
102
|
const pages = templates
|
|
101
103
|
.filter(t => t.type === 'page' && t.isReady !== false)
|
|
102
|
-
.map(t =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
.map(t =>
|
|
105
|
+
withComponents(
|
|
106
|
+
{
|
|
107
|
+
name: t.dirName,
|
|
108
|
+
displayName: t.displayName || t.name,
|
|
109
|
+
description: t.description || '',
|
|
110
|
+
package: t.package ?? '@astryxdesign/core',
|
|
111
|
+
category: t.category || '',
|
|
112
|
+
keywords: t.keywords ?? [],
|
|
113
|
+
filePath: t.filePath,
|
|
114
|
+
// The id `template()` resolves back to this entry: an active
|
|
115
|
+
// replacement owns the Core id it names, so that id selects it.
|
|
116
|
+
command: `astryx template ${t.replaces ?? t.dirName} --type page`,
|
|
117
|
+
},
|
|
118
|
+
t.filePath,
|
|
119
|
+
),
|
|
120
|
+
);
|
|
114
121
|
const blocks = templates
|
|
115
122
|
.filter(t => t.type === 'block')
|
|
116
123
|
.map(t => ({
|
|
@@ -362,3 +369,31 @@ export function templateSetupNotes(template, cwd) {
|
|
|
362
369
|
export function requireBuildCoreDir(cwd) {
|
|
363
370
|
return requireCoreDir(cwd);
|
|
364
371
|
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Adds a lazy, non-enumerable `components` getter to a page entry: the page's
|
|
375
|
+
* source is read and parsed only when a caller reads it, once, so loading the
|
|
376
|
+
* catalog stays cheap and the entry's own fields are unchanged.
|
|
377
|
+
* @template {object} T
|
|
378
|
+
* @param {T} entry
|
|
379
|
+
* @param {string | undefined} filePath
|
|
380
|
+
* @returns {T & {readonly components: string[]}}
|
|
381
|
+
*/
|
|
382
|
+
function withComponents(entry, filePath) {
|
|
383
|
+
/** @type {string[] | undefined} */
|
|
384
|
+
let components;
|
|
385
|
+
return /** @type {T & {readonly components: string[]}} */ (
|
|
386
|
+
Object.defineProperty(entry, 'components', {
|
|
387
|
+
get() {
|
|
388
|
+
if (components === undefined) {
|
|
389
|
+
try {
|
|
390
|
+
components = filePath ? extractComponents(filePath) : [];
|
|
391
|
+
} catch {
|
|
392
|
+
components = [];
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return components;
|
|
396
|
+
},
|
|
397
|
+
})
|
|
398
|
+
);
|
|
399
|
+
}
|
package/api/build/kit/rank.mjs
CHANGED
|
@@ -175,6 +175,16 @@ export function rankPages(query, pages) {
|
|
|
175
175
|
return d ? Math.log(1 + (n - d + 0.5) / (d + 0.5)) : 0;
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
+
// How many templates of each family carry each term, for how typical of its
|
|
179
|
+
// family a template's descriptor is.
|
|
180
|
+
/** @type {Map<string, Map<string, number>>} */
|
|
181
|
+
const familyDf = new Map();
|
|
182
|
+
for (const {family, bag} of docs) {
|
|
183
|
+
const counts = familyDf.get(family) ?? new Map();
|
|
184
|
+
familyDf.set(family, counts);
|
|
185
|
+
for (const t of bag.keys()) counts.set(t, (counts.get(t) ?? 0) + 1);
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
const familyOfWord = familyWordsOf(pages);
|
|
179
189
|
/** @param {string[]} ts */
|
|
180
190
|
const familiesIn = ts =>
|
|
@@ -226,8 +236,12 @@ export function rankPages(query, pages) {
|
|
|
226
236
|
else if (familyNamed) score += BODY_FAMILY;
|
|
227
237
|
const base = normalized(page.name) === normalized(family);
|
|
228
238
|
if (familyNamed && base) score += FAMILY_BASE;
|
|
239
|
+
const inFamily = familyDf.get(family);
|
|
240
|
+
let shared = 0;
|
|
241
|
+
for (const t of bag.keys()) shared += (inFamily?.get(t) ?? 1) - 1;
|
|
229
242
|
return {
|
|
230
243
|
name: page.name,
|
|
244
|
+
typical: bag.size ? shared / bag.size : 0,
|
|
231
245
|
score,
|
|
232
246
|
hits,
|
|
233
247
|
familyNamed,
|
|
@@ -233,6 +233,8 @@ function memberFeatures(v) {
|
|
|
233
233
|
* @property {string} [displayName]
|
|
234
234
|
* @property {string} [category]
|
|
235
235
|
* @property {string[]} [keywords]
|
|
236
|
+
* @property {string} [description]
|
|
237
|
+
* @property {string[]} [components]
|
|
236
238
|
*/
|
|
237
239
|
|
|
238
240
|
/**
|
|
@@ -259,6 +261,16 @@ function ownWords(name, catalog, words) {
|
|
|
259
261
|
return n;
|
|
260
262
|
}
|
|
261
263
|
|
|
264
|
+
/**
|
|
265
|
+
* A template's family: the part of its category before ` - `.
|
|
266
|
+
* @param {string} name
|
|
267
|
+
* @param {DescribedTemplate[]} catalog
|
|
268
|
+
*/
|
|
269
|
+
const familyOf = (name, catalog) =>
|
|
270
|
+
String(catalog.find(c => c.name === name)?.category ?? '')
|
|
271
|
+
.split(' - ')[0]
|
|
272
|
+
.trim();
|
|
273
|
+
|
|
262
274
|
/** How many fewer own words a template whose family the idea names first may
|
|
263
275
|
* name than the listed template it competes with, and still start. */
|
|
264
276
|
const FAMILY_SLACK = 2;
|
|
@@ -330,6 +342,118 @@ function blend(idea, ranked, pick, catalog, weights) {
|
|
|
330
342
|
return {cands, scores, position};
|
|
331
343
|
}
|
|
332
344
|
|
|
345
|
+
/**
|
|
346
|
+
* The most typical of the ready templates the ranker ties with `name` in its
|
|
347
|
+
* family (same score, same id length): the one whose descriptor's words are
|
|
348
|
+
* shared by the most of its family's templates, on average. `name` keeps its
|
|
349
|
+
* place on an equal value. Reads only the templates' descriptors.
|
|
350
|
+
* @param {string} name
|
|
351
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
352
|
+
* @param {string[]} cands
|
|
353
|
+
* @returns {string}
|
|
354
|
+
*/
|
|
355
|
+
function typicalOfTie(name, ranked, cands) {
|
|
356
|
+
const self = ranked.find(r => r.name === name);
|
|
357
|
+
if (!self || self.family === SHELL_FAMILY || !self.family) return name;
|
|
358
|
+
const length = (/** @type {string} */ n) => n.split('-').length;
|
|
359
|
+
let chosen = self;
|
|
360
|
+
for (const r of ranked) {
|
|
361
|
+
if (
|
|
362
|
+
r.score === self.score &&
|
|
363
|
+
r.family === self.family &&
|
|
364
|
+
length(r.name) === length(self.name) &&
|
|
365
|
+
cands.includes(r.name) &&
|
|
366
|
+
r.typical > chosen.typical
|
|
367
|
+
)
|
|
368
|
+
chosen = r;
|
|
369
|
+
}
|
|
370
|
+
return chosen.name;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* The words of a template's whole descriptor, stemmed, less search's
|
|
375
|
+
* stopwords: its display name, category, keywords, description, and the names
|
|
376
|
+
* of the components its page composes.
|
|
377
|
+
* @param {DescribedTemplate} t
|
|
378
|
+
* @returns {Set<string>}
|
|
379
|
+
*/
|
|
380
|
+
function descriptorWords(t) {
|
|
381
|
+
const components = (t.components ?? []).map(c =>
|
|
382
|
+
c.replace(/([a-z0-9])([A-Z])/g, '$1 $2'),
|
|
383
|
+
);
|
|
384
|
+
return new Set(
|
|
385
|
+
weightWords(
|
|
386
|
+
[
|
|
387
|
+
t.displayName ?? '',
|
|
388
|
+
t.category ?? '',
|
|
389
|
+
...(t.keywords ?? []),
|
|
390
|
+
t.description ?? '',
|
|
391
|
+
...components,
|
|
392
|
+
].join(' '),
|
|
393
|
+
)
|
|
394
|
+
.filter(w => !STOPWORDS.has(w))
|
|
395
|
+
.map(stem),
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Settles an exact tie in the ranker by a fuller reading of each tied
|
|
401
|
+
* template's own descriptor. Words every tied template names cannot choose
|
|
402
|
+
* between them, so they are left out; each other word of the idea that a
|
|
403
|
+
* template's descriptor names adds its rarity within the family. The highest
|
|
404
|
+
* total starts. An equal total goes to the most typical of the family
|
|
405
|
+
* (`typicalOfTie`), then to `name`. Reads only the templates' descriptors.
|
|
406
|
+
* @param {string} name
|
|
407
|
+
* @param {string} idea
|
|
408
|
+
* @param {import('./rank.mjs').RankedPage[]} ranked
|
|
409
|
+
* @param {string[]} cands
|
|
410
|
+
* @param {DescribedTemplate[]} catalog
|
|
411
|
+
* @returns {string}
|
|
412
|
+
*/
|
|
413
|
+
function fullerOfTie(name, idea, ranked, cands, catalog) {
|
|
414
|
+
const self = ranked.find(r => r.name === name);
|
|
415
|
+
if (!self || self.family === SHELL_FAMILY || !self.family) return name;
|
|
416
|
+
const length = (/** @type {string} */ n) => n.split('-').length;
|
|
417
|
+
const tied = ranked.filter(
|
|
418
|
+
r =>
|
|
419
|
+
r.score === self.score &&
|
|
420
|
+
r.family === self.family &&
|
|
421
|
+
length(r.name) === length(self.name) &&
|
|
422
|
+
cands.includes(r.name),
|
|
423
|
+
);
|
|
424
|
+
if (tied.length < 2) return name;
|
|
425
|
+
const family = catalog.filter(t => familyOf(t.name, catalog) === self.family);
|
|
426
|
+
const words = new Map(family.map(t => [t.name, descriptorWords(t)]));
|
|
427
|
+
const df = (/** @type {string} */ w) =>
|
|
428
|
+
family.filter(t => words.get(t.name)?.has(w)).length;
|
|
429
|
+
const said = new Set(
|
|
430
|
+
weightWords(idea)
|
|
431
|
+
.filter(w => !STOPWORDS.has(w))
|
|
432
|
+
.map(stem),
|
|
433
|
+
);
|
|
434
|
+
const own = tied.map(r => words.get(r.name) ?? new Set());
|
|
435
|
+
const n = family.length;
|
|
436
|
+
const score = tied.map((_, i) => {
|
|
437
|
+
let s = 0;
|
|
438
|
+
for (const w of said) {
|
|
439
|
+
if (!own[i].has(w) || own.every(o => o.has(w))) continue;
|
|
440
|
+
const d = df(w);
|
|
441
|
+
s += Math.log(1 + (n - d + 0.5) / (d + 0.5));
|
|
442
|
+
}
|
|
443
|
+
return s;
|
|
444
|
+
});
|
|
445
|
+
const top = Math.max(...score);
|
|
446
|
+
if (top === 0) return typicalOfTie(name, ranked, cands);
|
|
447
|
+
const leaders = tied.filter((_, i) => score[i] >= top - 1e-9);
|
|
448
|
+
if (leaders.length === 1) return leaders[0].name;
|
|
449
|
+
const lead = leaders.some(r => r.name === name) ? self : leaders[0];
|
|
450
|
+
return typicalOfTie(
|
|
451
|
+
lead.name,
|
|
452
|
+
ranked,
|
|
453
|
+
leaders.map(r => r.name),
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
333
457
|
/**
|
|
334
458
|
* Every ready, non-shell template in the blend's own order, best first: the
|
|
335
459
|
* order the page start is chosen from, so the alternatives build names beside
|
|
@@ -401,15 +525,22 @@ export function weighStart(
|
|
|
401
525
|
const said = new Set(content.map(stem));
|
|
402
526
|
const mine = ownWords(kept, catalog, said);
|
|
403
527
|
const theirs = ownWords(listed, catalog, said);
|
|
404
|
-
if (mine >= theirs) return kept;
|
|
405
528
|
// An idea that names the template's family before the listed one's
|
|
406
529
|
// ("a dashboard with a data table") is that family's page, unless it
|
|
407
530
|
// names far more of the listed template's words.
|
|
408
531
|
const order = content.map(stem);
|
|
409
|
-
|
|
410
|
-
mine >= theirs
|
|
411
|
-
|
|
412
|
-
|
|
532
|
+
const stays =
|
|
533
|
+
mine >= theirs ||
|
|
534
|
+
(familyAt(kept, catalog, order) < familyAt(listed, catalog, order) &&
|
|
535
|
+
mine >= theirs - FAMILY_SLACK);
|
|
536
|
+
if (!stays) return listed;
|
|
537
|
+
// A tie in the ranker is no preference: every table that names "table"
|
|
538
|
+
// scores the same, and the alphabet must not choose the page. Among the
|
|
539
|
+
// family's templates the ranker ties with this unlisted one, the template
|
|
540
|
+
// whose own descriptor best matches the idea starts (`fullerOfTie`), then
|
|
541
|
+
// the one most typical of the family. Only the templates' descriptors
|
|
542
|
+
// decide this tie, never the tables.
|
|
543
|
+
return fullerOfTie(kept, idea, ranked, cands, catalog);
|
|
413
544
|
}
|
|
414
545
|
const top = best(() => true);
|
|
415
546
|
if (top !== SHELL) return top;
|
package/api/build/kit/words.mjs
CHANGED
|
@@ -163,7 +163,7 @@ export const SYNONYMS_OF = (() => {
|
|
|
163
163
|
/**
|
|
164
164
|
* @typedef {import('../_adapter.mjs').PageTemplate} PageTemplate
|
|
165
165
|
* @typedef {import('../_adapter.mjs').ComponentWords} ComponentWords
|
|
166
|
-
* @typedef {{name: string, score: number, hits: number, familyNamed: boolean, headNamed: boolean, containerMatched: boolean, family: string, base: boolean, matched: Set<string
|
|
166
|
+
* @typedef {{name: string, score: number, hits: number, familyNamed: boolean, headNamed: boolean, containerMatched: boolean, family: string, base: boolean, matched: Set<string>, typical: number}} RankedPage
|
|
167
167
|
* @typedef {'page' | 'part' | 'edit'} IdeaKind
|
|
168
168
|
*/
|
|
169
169
|
|
|
@@ -111,7 +111,7 @@ dataTokens dataTokens theme/MediaTheme.doc.mjs theme/domainTokens/dataTokens.ts
|
|
|
111
111
|
dayCellUtils dayCellUtils Calendar/Calendar.doc.mjs Calendar/dayCellUtils.ts
|
|
112
112
|
declarationBoundary declarationBoundary theme/MediaTheme.doc.mjs theme/declarationBoundary.ts
|
|
113
113
|
defaultIcons defaultIcons Icon/Icon.doc.mjs Icon/defaultIcons.tsx
|
|
114
|
-
defineSyntaxTheme defineSyntaxTheme theme/
|
|
114
|
+
defineSyntaxTheme defineSyntaxTheme theme/syntax/useSyntaxTheme.doc.mjs theme/syntax/defineSyntaxTheme.ts
|
|
115
115
|
defineTheme defineTheme theme/MediaTheme.doc.mjs theme/defineTheme.ts
|
|
116
116
|
derivedVarRegistry derivedVarRegistry theme/MediaTheme.doc.mjs theme/derivedVarRegistry.ts
|
|
117
117
|
dockerfile dockerfile CodeBlock/CodeBlock.doc.mjs CodeBlock/languages/dockerfile.ts
|
|
@@ -191,7 +191,7 @@ popoverOperations popoverOperations Layer/Layer.doc.mjs Layer/popoverOperations.
|
|
|
191
191
|
powerSearchSheetUtils powerSearchSheetUtils PowerSearch/PowerSearch.doc.mjs PowerSearch/powerSearchSheetUtils.ts
|
|
192
192
|
powershell powershell CodeBlock/CodeBlock.doc.mjs CodeBlock/languages/powershell.ts
|
|
193
193
|
preserveAnimations preserveAnimations Layer/Layer.doc.mjs Layer/preserveAnimations.ts
|
|
194
|
-
presets presets theme/
|
|
194
|
+
presets presets theme/syntax/useSyntaxTheme.doc.mjs theme/syntax/presets.ts
|
|
195
195
|
pressGroupContext pressGroupContext hooks/useAnimatedLayout.doc.mjs hooks/pressGroupContext.ts
|
|
196
196
|
protocol protocol Markdown/Markdown.doc.mjs Markdown/plugins/protocol.ts
|
|
197
197
|
publicContext publicContext i18n/InternationalizationProvider.doc.mjs i18n/publicContext.ts
|
|
@@ -251,7 +251,7 @@ useCalendarConstraints useCalendarConstraints Calendar/useCalendarConstraints.do
|
|
|
251
251
|
useCalendarDays useCalendarDays Calendar/useCalendarDays.doc.mjs Calendar/hooks/useCalendarDays.ts
|
|
252
252
|
useCalendarNavigation useCalendarNavigation Calendar/useCalendarNavigation.doc.mjs Calendar/hooks/useCalendarNavigation.ts
|
|
253
253
|
useChatComposerTokens useChatComposerTokens Chat/Chat.doc.mjs Chat/useChatComposerTokens.ts
|
|
254
|
-
useChatDictation useChatDictation Chat/
|
|
254
|
+
useChatDictation useChatDictation Chat/useChatDictation.doc.mjs Chat/useChatDictation.ts
|
|
255
255
|
useChatNewMessages useChatNewMessages Chat/Chat.doc.mjs Chat/useChatNewMessages.ts
|
|
256
256
|
useChatPasteAsToken useChatPasteAsToken Chat/Chat.doc.mjs Chat/useChatPasteAsToken.ts
|
|
257
257
|
useChatStreamScroll useChatStreamScroll Chat/Chat.doc.mjs Chat/useChatStreamScroll.ts
|
package/api/docs/_adapter.d.mts
CHANGED
|
@@ -366,12 +366,36 @@ export function routeOwner(tree: DocsTree, entry: import("../../foundation/disco
|
|
|
366
366
|
* Otherwise it suggests the docs the argument names in another spelling, or
|
|
367
367
|
* failing that the topics and top-level namespaces, closest first and cut
|
|
368
368
|
* where the matches get weaker (every one of them when none shares a word
|
|
369
|
-
* with the argument).
|
|
369
|
+
* with the argument). When the argument is the name of a component, hook or
|
|
370
|
+
* template, the command that reads that entry comes first and takes the last
|
|
371
|
+
* suggestion's place, so the list keeps its length; when no suggested doc
|
|
372
|
+
* shares a word with the argument, that command is the only suggestion.
|
|
370
373
|
* @param {unknown} topic
|
|
371
374
|
* @param {DocsCatalog} catalog
|
|
375
|
+
* @param {{cwd?: string}} [options]
|
|
372
376
|
* @returns {Promise<AstryxError>}
|
|
373
377
|
*/
|
|
374
|
-
export function unknownTopicError(topic: unknown, catalog: DocsCatalog
|
|
378
|
+
export function unknownTopicError(topic: unknown, catalog: DocsCatalog, { cwd }?: {
|
|
379
|
+
cwd?: string;
|
|
380
|
+
}): Promise<AstryxError>;
|
|
381
|
+
/**
|
|
382
|
+
* The command that reads the component, hook or template a docs argument
|
|
383
|
+
* names, or null. Only an exact name counts, in any case and with or without
|
|
384
|
+
* spaces and hyphens; a hook also answers to its name without `use`. A
|
|
385
|
+
* component wins over a hook, and a hook over a template. A route never names
|
|
386
|
+
* one of them.
|
|
387
|
+
* @param {string} topic
|
|
388
|
+
* @param {{components?: string[], hooks?: string[], templates?: string[]}} names
|
|
389
|
+
* @returns {{name: string, reason: string} | null}
|
|
390
|
+
*/
|
|
391
|
+
export function entryCommand(topic: string, { components, hooks, templates }: {
|
|
392
|
+
components?: string[];
|
|
393
|
+
hooks?: string[];
|
|
394
|
+
templates?: string[];
|
|
395
|
+
}): {
|
|
396
|
+
name: string;
|
|
397
|
+
reason: string;
|
|
398
|
+
} | null;
|
|
375
399
|
/**
|
|
376
400
|
* A sentence naming the packages whose docs did not load, or nothing: a doc
|
|
377
401
|
* that fails to load withdraws its package's docs, so a reader who cannot
|