@astryxdesign/cli 0.7.6-canary.fdabeba → 0.7.7-canary.36f8ea1
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/CHANGELOG.md +42 -0
- package/README.md +2 -2
- package/api/component/detail/showcase/showcase.mjs +9 -3
- package/api/search/_adapter.d.mts +3 -1
- package/api/search/_adapter.mjs +19 -19
- package/api/template/copy/copy.mjs +13 -7
- package/api/template/show/show.mjs +12 -8
- package/api/template/skeleton/skeleton.mjs +14 -5
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +2 -2
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +2 -0
- package/api/template/template.type.mjs +2 -0
- package/assets/docs/motion.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsx +12 -12
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx +14 -10
- package/assets/templates/blocks/components/Hooks/useCollatorHookUsage.doc.mjs +20 -0
- package/assets/templates/blocks/components/Hooks/useCollatorHookUsage.tsx +55 -0
- package/assets/templates/blocks/components/Hooks/useListFocusHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useListFocusHookUsage.tsx +42 -0
- package/assets/templates/blocks/components/Hooks/usePressFeedbackHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/usePressFeedbackHookUsage.tsx +41 -0
- package/assets/templates/blocks/components/Hooks/useTranslatorHookUsage.doc.mjs +22 -0
- package/assets/templates/blocks/components/Hooks/useTranslatorHookUsage.tsx +88 -0
- package/assets/templates/blocks/components/Toast/useToastHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Toast/useToastHookUsage.tsx +65 -0
- package/clients/cli/commands/template.mjs +29 -3
- package/foundation/discovery/package-tsconfig.mjs +34 -0
- package/foundation/discovery/template-adapter.d.mts +76 -1
- package/foundation/discovery/template-adapter.mjs +418 -13
- package/foundation/discovery/template-icons.mjs +7 -89
- package/foundation/discovery/template-source-tree.d.mts +48 -0
- package/foundation/discovery/template-source-tree.mjs +159 -0
- package/foundation/fs/read-record.d.mts +4 -1
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/response/response-types.doc.mjs +2 -2
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @xds/cli
|
|
2
2
|
|
|
3
|
+
# 0.7.6
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- When a template imports Astryx's docs-only demo content, `astryx template <name> <path>`, `astryx template <name>`, `astryx template <name> --skeleton`, and `astryx component <Name> --showcase` replace each demo-content element with a marked `<Text>Card content</Text>` placeholder and remove the demo-content import, so the code they hand out never imports a module that only Astryx's own previews have. The placeholder uses the file's own Astryx `Text` import when that import is in scope, and otherwise imports `Text`, under an alias when the file already uses that name. `template.copy` and `template.show` gain `demoContentReplaced` (0 when the template carried none), their text output says how many elements became placeholders, and the `components` that `template.show` and `template.skeleton` list are the components of the returned source. No shipped template uses demo content yet, so every current template is copied, shown, and outlined exactly as before. The docsite's shadcn install of a block or page applies the same replacement and also replaces demo media, each with a marked placeholder: a placeholder image for an image and a `data:,placeholder-video-add-your-own` source for a video. The item's description says how many references and elements were replaced. The adjacent `.astryx/<item>.json` receipt keeps its current shape, so every released `astryx upgrade` still reads it. (#9430)
|
|
8
|
+
- A theme's `motion` takes two knobs beside the duration scale: `tempo` (0.75–1.5) scales every motion duration, and `character` (`'crisp'`, `'standard'` or `'expressive'`) sets the new `--ease-entrance` and `--ease-move` tokens; `--ease-exit` stays the same at every character. Their types, `ThemeMotionConfig`, `ThemeMotionKnobs` and `MotionCharacter`, are exported. A theme without them renders exactly as before; a duration scale and explicit tokens win over the knobs, Spinner's and Skeleton's loops keep their timing under every tempo, and the press release fade follows tempo up to the 200 ms Reduce Motion cap under the person's setting. Springs don't read the knobs yet. The motion, token and theme-authoring docs and the theme template describe the knobs. (#8661)
|
|
9
|
+
|
|
10
|
+
#### Fixes
|
|
11
|
+
|
|
12
|
+
- BottomSheet checklist examples use CheckboxList so the whole row toggles, not just the label (#9533)
|
|
13
|
+
- The motion guide now says that under Reduce Motion, components cross-fade under a finger and change at once under a mouse, and that a value changing in place, such as a progress fill, takes its new value at once under any pointer (design:reduced-motion DR1–DR3). (#8615)
|
|
14
|
+
- Published packages no longer include repository test and benchmark files, reducing install size without changing exports. (#9153)
|
|
15
|
+
|
|
16
|
+
#### Performance
|
|
17
|
+
|
|
18
|
+
- Calling `integrationComponentConflicts()` or `integrationCheck()` from `@astryxdesign/cli/api` more than once in one process now reads each TypeScript file a package's `tsconfig.json` includes once while the file is unchanged, instead of on every call. A single `astryx doctor integration components` or `astryx integration check` run is unchanged. (#9422)
|
|
19
|
+
- `search()` shares a catalog gather that is still running: searches that start together in one long-running process, such as a docs site's search right after it starts, now gather once instead of once each (#9460)
|
|
20
|
+
|
|
21
|
+
#### Documentation
|
|
22
|
+
|
|
23
|
+
- A new `useCollator — Locale-aware Name Sort` example block sorts a list of names with the compare function from `useCollator`: accented and lowercase names land where a reader expects, and switching the provider locale to Swedish moves Å and Ö after Z. Copy it with `astryx template useCollatorHookUsage <path>`. (#9510)
|
|
24
|
+
- A new `usePressFeedback — Pressable Card` example block shows the hook on an Astryx Card: the hook's marker and the `interactionOverlayStyles.backgroundImage` overlay go straight on the Card, so pressing the card darkens it the way every Astryx pressable does, under a finger or a mouse (Enter or Space flips it), and `focusOutlineStyles.focusVisible` gives keyboard users the shared Astryx focus ring on it. Copy it with `astryx template usePressFeedbackHookUsage <path>`; the docs-only playing card it shows becomes a `<Text>` placeholder for your own content. (#9431)
|
|
25
|
+
- A new `useToast — Settings Saved` example block calls the function from `useToast` on a settings form: Save shows a "Settings saved" toast with an Undo action, its `uniqueID` makes a second Save replace the toast instead of stacking another, and a failed save shows an error toast instead. Copy it with `astryx template useToastHookUsage <path>`. (#9512)
|
|
26
|
+
- A new `useTranslator — Load More Footer` example block gets a list footer's "Load more" label and its "Showing 3 of 9" count from the function `useTranslator` returns. The app's own message keys are supplied per locale through `InternationalizationProvider`, so switching the provider to French changes both strings. Copy it with `astryx template useTranslatorHookUsage <path>`. (#9573)
|
|
27
|
+
|
|
28
|
+
#### Other Changes
|
|
29
|
+
|
|
30
|
+
- Preserved the v0.7.5 upgrade codemod registry when the release outputs returned to main (#9086), so the v0.7.6 CLI continues to offer that migration.
|
|
31
|
+
|
|
32
|
+
#### Contributors
|
|
33
|
+
|
|
34
|
+
Thanks to everyone who contributed to this release:
|
|
35
|
+
|
|
36
|
+
- @cixzhang
|
|
37
|
+
- @divyanshudhruv
|
|
38
|
+
- @kyu-rong
|
|
39
|
+
- @MannXo
|
|
40
|
+
- @parinith-web
|
|
41
|
+
- @vjeux
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
3
45
|
# 0.7.5
|
|
4
46
|
|
|
5
47
|
#### Experimental APIs
|
package/README.md
CHANGED
|
@@ -503,9 +503,9 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
503
503
|
| `gap-report.categories` | The fixed gap category values and human-readable labels; when a loaded integration names its own issues URL, meta.destinations lists every destination ({to, default, issuesUrl}) and meta.ask tells an agent to ask the person. |
|
|
504
504
|
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals; without --to, when a loaded integration names its own issues URL, destinations and ask as on gap-report.categories. |
|
|
505
505
|
| `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
|
|
506
|
-
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media).
|
|
506
|
+
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media), and demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder for your own content). |
|
|
507
507
|
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
|
|
508
|
-
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template.
|
|
508
|
+
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template. |
|
|
509
509
|
| `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
510
510
|
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
|
|
511
511
|
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `component.detail.showcase` leaf — a component's hero showcase source
|
|
4
|
+
* @file `component.detail.showcase` leaf — a component's hero showcase source,
|
|
5
|
+
* with each demo-content element replaced by a placeholder.
|
|
5
6
|
*
|
|
6
7
|
* @input a component name (+ cwd / package scope) or an explicit "no match"
|
|
7
8
|
* @output the `component.detail.showcase` envelope
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
import * as fs from 'node:fs';
|
|
12
13
|
import {AstryxError} from '../../../error.mjs';
|
|
13
14
|
import {ERROR_CODES} from '../../../../foundation/response/error-codes.mjs';
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
findShowcase,
|
|
17
|
+
replaceDemoContent,
|
|
18
|
+
} from '../../../template/template.mjs';
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Resolve and read a component's showcase block into the
|
|
@@ -41,7 +45,9 @@ export async function componentDetailShowcase(componentName, {cwd, name, package
|
|
|
41
45
|
data: {
|
|
42
46
|
component: componentName,
|
|
43
47
|
aspectRatio: /** @type {number} */ (match.aspectRatio),
|
|
44
|
-
source:
|
|
48
|
+
// Handed-out source, not a copy: demo content becomes the placeholder a
|
|
49
|
+
// copy writes, and fixture media stays.
|
|
50
|
+
source: replaceDemoContent(fs.readFileSync(match.filePath, 'utf-8')).source,
|
|
45
51
|
},
|
|
46
52
|
};
|
|
47
53
|
}
|
|
@@ -31,7 +31,9 @@ export function gatherCandidates(options: {
|
|
|
31
31
|
* folder, for the same `type`, ranks the candidates an earlier search
|
|
32
32
|
* gathered when none of the files that gather read, and none of the folders
|
|
33
33
|
* it listed or probed, changed since (each is checked by its change time and
|
|
34
|
-
* size, so an edited doc in a linked package is seen on the next call).
|
|
34
|
+
* size, so an edited doc in a linked package is seen on the next call). That
|
|
35
|
+
* holds for a gather that is still running too, so searches that start
|
|
36
|
+
* together (a docs site's search right after it starts) share one gather. A
|
|
35
37
|
* long-running caller (a docs site's search, an agent harness) then pays the
|
|
36
38
|
* gather once. A one-shot `astryx search` gathers once, as before.
|
|
37
39
|
* @param {{cwd?: string, type?: string}} options
|
package/api/search/_adapter.mjs
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
import {readFileSync} from 'node:fs';
|
|
10
10
|
import * as path from 'node:path';
|
|
11
11
|
import {requireCoreDir} from '../../foundation/fs/paths.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
reusedWhileUnchanged,
|
|
14
|
+
unchangedSince,
|
|
15
|
+
} from '../../foundation/fs/read-record.mjs';
|
|
13
16
|
import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
|
|
14
17
|
import {coreDirOrThrow} from '../error.mjs';
|
|
15
18
|
import {CORELESS_DOMAINS} from './_query.mjs';
|
|
@@ -95,7 +98,7 @@ export async function gatherCandidates(options) {
|
|
|
95
98
|
|
|
96
99
|
/**
|
|
97
100
|
* @typedef {Awaited<ReturnType<typeof gatherCandidates>>} Gathered
|
|
98
|
-
* @type {Map<string, {
|
|
101
|
+
* @type {Map<string, (options?: {fresh?: boolean}) => Promise<Gathered>>}
|
|
99
102
|
*/
|
|
100
103
|
const gathered = new Map();
|
|
101
104
|
|
|
@@ -104,30 +107,27 @@ const gathered = new Map();
|
|
|
104
107
|
* folder, for the same `type`, ranks the candidates an earlier search
|
|
105
108
|
* gathered when none of the files that gather read, and none of the folders
|
|
106
109
|
* it listed or probed, changed since (each is checked by its change time and
|
|
107
|
-
* size, so an edited doc in a linked package is seen on the next call).
|
|
110
|
+
* size, so an edited doc in a linked package is seen on the next call). That
|
|
111
|
+
* holds for a gather that is still running too, so searches that start
|
|
112
|
+
* together (a docs site's search right after it starts) share one gather. A
|
|
108
113
|
* long-running caller (a docs site's search, an agent harness) then pays the
|
|
109
114
|
* gather once. A one-shot `astryx search` gathers once, as before.
|
|
110
115
|
* @param {{cwd?: string, type?: string}} options
|
|
111
116
|
* @returns {Promise<Gathered>}
|
|
112
117
|
*/
|
|
113
|
-
export
|
|
118
|
+
export function gatherCandidatesReused(options) {
|
|
114
119
|
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (gathered.get(key)?.value === value) gathered.delete(key);
|
|
125
|
-
throw error;
|
|
120
|
+
const type = options.type;
|
|
121
|
+
const key = `${cwd}\0${type ?? ''}`;
|
|
122
|
+
let gather = gathered.get(key);
|
|
123
|
+
if (!gather) {
|
|
124
|
+
gather = reusedWhileUnchanged(
|
|
125
|
+
() => gatherCandidates({cwd, type}),
|
|
126
|
+
unchangedSince,
|
|
127
|
+
);
|
|
128
|
+
gathered.set(key, gather);
|
|
126
129
|
}
|
|
127
|
-
|
|
128
|
-
// the gather ran shows as a change on the next call.
|
|
129
|
-
gathered.set(key, {reads: seen, value});
|
|
130
|
-
return value;
|
|
130
|
+
return gather();
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
/**
|
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
} from '../../../foundation/fs/path-safety.mjs';
|
|
19
19
|
import {AstryxError, writeFailed} from '../../error.mjs';
|
|
20
20
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
pkgOf,
|
|
23
|
+
replaceTemplateDemos,
|
|
24
|
+
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
22
25
|
import {analyzeTemplateNeeds} from '../../../foundation/discovery/template-needs.mjs';
|
|
23
26
|
import {
|
|
24
27
|
NO_ICON_SETS,
|
|
@@ -89,12 +92,14 @@ export function templateCopy(
|
|
|
89
92
|
);
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
// leaves nothing behind.
|
|
95
|
-
const {
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
// Replace docs-only demo content and demo media references so the
|
|
96
|
+
// scaffolded file renders without anything only Astryx's previews provide.
|
|
97
|
+
// Read before any write, so a failure below leaves nothing behind.
|
|
98
|
+
const {
|
|
99
|
+
source: withMedia,
|
|
100
|
+
demoContentReplaced,
|
|
101
|
+
demoMediaReplaced,
|
|
102
|
+
} = replaceTemplateDemos(fs.readFileSync(match.filePath, 'utf-8'));
|
|
98
103
|
// Icons follow the project's icon set (AST-084 FR9). An icon with no match
|
|
99
104
|
// keeps its import, so its library stays a needed dependency below.
|
|
100
105
|
const {source: outputSource, icons} = mapTemplateIcons(
|
|
@@ -127,6 +132,7 @@ export function templateCopy(
|
|
|
127
132
|
fileName: outputFileName,
|
|
128
133
|
filesCopied: 1,
|
|
129
134
|
demoMediaReplaced,
|
|
135
|
+
demoContentReplaced,
|
|
130
136
|
notes,
|
|
131
137
|
missingPackages: missing,
|
|
132
138
|
installCommand,
|
|
@@ -12,9 +12,9 @@ import * as fs from 'node:fs';
|
|
|
12
12
|
import {AstryxError} from '../../error.mjs';
|
|
13
13
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
componentsInSource,
|
|
16
16
|
pkgOf,
|
|
17
|
-
|
|
17
|
+
replaceTemplateDemos,
|
|
18
18
|
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
19
19
|
import {
|
|
20
20
|
NO_ICON_SETS,
|
|
@@ -38,11 +38,14 @@ export function templateShow(match, {iconSets = NO_ICON_SETS} = {}) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// The source template.copy writes (spec:AST-028 FR7): a template printed and
|
|
41
|
-
// pasted must not keep a media path only Astryx's previews
|
|
42
|
-
// caller is told how many it replaced, the way the copy
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
// pasted must not keep demo content or a media path only Astryx's previews
|
|
42
|
+
// serve, and the caller is told how many it replaced, the way the copy
|
|
43
|
+
// receipt tells it.
|
|
44
|
+
const {
|
|
45
|
+
source: withMedia,
|
|
46
|
+
demoContentReplaced,
|
|
47
|
+
demoMediaReplaced,
|
|
48
|
+
} = replaceTemplateDemos(fs.readFileSync(match.filePath, 'utf-8'));
|
|
46
49
|
// Icons follow the project's icon set, as template.copy writes them.
|
|
47
50
|
const {source, icons} = mapTemplateIcons(withMedia, iconSets, match.icons);
|
|
48
51
|
|
|
@@ -53,9 +56,10 @@ export function templateShow(match, {iconSets = NO_ICON_SETS} = {}) {
|
|
|
53
56
|
template: match.dirName,
|
|
54
57
|
description: match.description,
|
|
55
58
|
type: match.type,
|
|
56
|
-
components:
|
|
59
|
+
components: componentsInSource(source),
|
|
57
60
|
source,
|
|
58
61
|
demoMediaReplaced,
|
|
62
|
+
demoContentReplaced,
|
|
59
63
|
...(icons ? {icons} : {}),
|
|
60
64
|
},
|
|
61
65
|
};
|
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
* spatial annotations) plus the components a resolved template composes.
|
|
6
6
|
*
|
|
7
7
|
* @position api/template/skeleton — derives a compact layout reference from the
|
|
8
|
-
* resolved match's source
|
|
8
|
+
* resolved match's source, with demo content replaced as a copy replaces it;
|
|
9
|
+
* the template dispatcher routes `--skeleton` here.
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import * as fs from 'node:fs';
|
|
12
13
|
import {AstryxError} from '../../error.mjs';
|
|
13
14
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
componentsInSource,
|
|
17
|
+
pkgOf,
|
|
18
|
+
replaceTemplateDemos,
|
|
19
|
+
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
15
20
|
|
|
16
21
|
const STRUCTURAL = new Set([
|
|
17
22
|
'AppShell',
|
|
@@ -242,15 +247,19 @@ export function templateSkeleton(match, templates) {
|
|
|
242
247
|
ERROR_CODES.ERR_NO_SOURCE,
|
|
243
248
|
);
|
|
244
249
|
}
|
|
245
|
-
|
|
250
|
+
// The skeleton outlines the source that template.show returns, so it never
|
|
251
|
+
// names demo content that a copy replaces.
|
|
252
|
+
const {source} = replaceTemplateDemos(
|
|
253
|
+
fs.readFileSync(match.filePath, 'utf-8'),
|
|
254
|
+
);
|
|
246
255
|
return {
|
|
247
256
|
type: 'template.skeleton',
|
|
248
257
|
package: pkgOf(match),
|
|
249
258
|
data: {
|
|
250
259
|
template: match.dirName,
|
|
251
260
|
description: match.description,
|
|
252
|
-
components:
|
|
253
|
-
skeleton: extractSkeleton(
|
|
261
|
+
components: componentsInSource(source),
|
|
262
|
+
skeleton: extractSkeleton(source),
|
|
254
263
|
},
|
|
255
264
|
};
|
|
256
265
|
}
|
|
@@ -41,4 +41,4 @@ export function template(name?: string, options?: {
|
|
|
41
41
|
export type DiscoveredTemplate = import("../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate;
|
|
42
42
|
export type TemplateDiscoveryError = import("../../foundation/discovery/template-adapter.mjs").TemplateDiscoveryError;
|
|
43
43
|
export type TemplateDocModule = import("../../foundation/discovery/template-adapter.mjs").TemplateDocModule;
|
|
44
|
-
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, replaceDemoMedia, listTemplates, findRelatedBlocks, findShowcase, extractComponents, pkgOf } from "../../foundation/discovery/template-adapter.mjs";
|
|
44
|
+
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, replaceDemoMedia, replaceDemoContent, listTemplates, findRelatedBlocks, findShowcase, extractComponents, pkgOf } from "../../foundation/discovery/template-adapter.mjs";
|
|
@@ -115,7 +115,7 @@ export const doc = {
|
|
|
115
115
|
{
|
|
116
116
|
type: 'template.show',
|
|
117
117
|
description:
|
|
118
|
-
"The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the source were replaced with placeholders for you to swap for your own media.",
|
|
118
|
+
"The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the source were replaced with placeholders for you to swap for your own media, and `demoContentReplaced` — how many Astryx docs-only demo content elements were replaced with a `<Text>` placeholder for your own content.",
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
type: 'template.skeleton',
|
|
@@ -125,7 +125,7 @@ export const doc = {
|
|
|
125
125
|
{
|
|
126
126
|
type: 'template.copy',
|
|
127
127
|
description:
|
|
128
|
-
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, file count, `demoMediaReplaced` — how many Astryx demo media references were replaced with placeholders, `notes` — setup notes naming what the template needs that the project lacks (missing packages, missing StyleX compiler; empty when satisfied), `missingPackages` — external package names the template imports that are not in the project, and `installCommand` — a ready-to-run install command with the detected package manager and workspace version ranges (null when nothing is missing, or when several lockfiles leave the package manager undetermined; `missingPackages` still names the packages).',
|
|
128
|
+
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, file count, `demoMediaReplaced` — how many Astryx demo media references were replaced with placeholders, `demoContentReplaced` — how many Astryx docs-only demo content elements were replaced with a `<Text>` placeholder, `notes` — setup notes naming what the template needs that the project lacks (missing packages, missing StyleX compiler; empty when satisfied), `missingPackages` — external package names the template imports that are not in the project, and `installCommand` — a ready-to-run install command with the detected package manager and workspace version ranges (null when nothing is missing, or when several lockfiles leave the package manager undetermined; `missingPackages` still names the packages).',
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
type: 'template.cdn',
|
|
@@ -72,6 +72,7 @@ export type TemplateShowResponse = {
|
|
|
72
72
|
components: string[];
|
|
73
73
|
source: string;
|
|
74
74
|
demoMediaReplaced: number;
|
|
75
|
+
demoContentReplaced: number;
|
|
75
76
|
icons?: TemplateIconsReport | undefined;
|
|
76
77
|
};
|
|
77
78
|
};
|
|
@@ -106,6 +107,7 @@ export type TemplateCopyResponse = {
|
|
|
106
107
|
fileName: string;
|
|
107
108
|
filesCopied: number;
|
|
108
109
|
demoMediaReplaced: number;
|
|
110
|
+
demoContentReplaced: number;
|
|
109
111
|
notes: string[];
|
|
110
112
|
missingPackages: string[];
|
|
111
113
|
installCommand: string | null;
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
* @property {string[]} data.components
|
|
56
56
|
* @property {string} data.source
|
|
57
57
|
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the returned source: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
58
|
+
* @property {number} data.demoContentReplaced Astryx docs-only demo content elements (such as a playing card's face in a motion example) replaced in the returned source with a `<Text>Card content</Text>` placeholder. Put your own content there. 0 when the template carried none.
|
|
58
59
|
* @property {TemplateIconsReport} [data.icons] Experimental, present only when the project sets `experimental.iconSet`: how the template's icons follow the project's icon set, each icon `mapped` (source and target) or `kept`, and the icon-set state. It may change or be removed in a patch release.
|
|
59
60
|
*/
|
|
60
61
|
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
* @property {string} data.fileName
|
|
82
83
|
* @property {number} data.filesCopied
|
|
83
84
|
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the written file: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
85
|
+
* @property {number} data.demoContentReplaced Astryx docs-only demo content elements (such as a playing card's face in a motion example) replaced in the written file with a `<Text>Card content</Text>` placeholder. Put your own content there. 0 when the template carried none.
|
|
84
86
|
* @property {string[]} data.notes Setup notes: what the template needs that the project lacks (missing packages, missing StyleX compiler). Each note is one actionable line. Empty when the template needs nothing the project lacks.
|
|
85
87
|
* @property {string[]} data.missingPackages External package names the template imports that are not in the project's dependencies. Empty when none are missing.
|
|
86
88
|
* @property {string | null} data.installCommand A ready-to-run install command for the missing packages, using the project's package manager and the CLI workspace's version ranges. Null when no packages are missing, or when several lockfiles leave the package manager undetermined; missingPackages still names the packages.
|
|
@@ -109,7 +109,7 @@ export const docs = {
|
|
|
109
109
|
content: [
|
|
110
110
|
{
|
|
111
111
|
type: 'prose',
|
|
112
|
-
text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. Astryx components
|
|
112
|
+
text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. When the OS reduced-motion setting is on, Astryx components change at once under a mouse or trackpad, and under a finger they cross-fade instead of moving: opacity only, in 200 ms or less. A value that changes in place, such as a progress fill, takes its new value at once under any pointer. Do the same in your own animations with `@media (prefers-reduced-motion: reduce)`, adding `(pointer: coarse)` for the touch cross-fade.',
|
|
113
113
|
},
|
|
114
114
|
],
|
|
115
115
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
-
import {
|
|
8
|
+
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
9
9
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
10
10
|
import {Heading} from '@astryxdesign/core/Heading';
|
|
11
11
|
import {Section} from '@astryxdesign/core/Section';
|
|
@@ -25,23 +25,23 @@ export default function BottomSheetShowcase() {
|
|
|
25
25
|
<VStack gap={4}>
|
|
26
26
|
<Heading level={3}>Filters</Heading>
|
|
27
27
|
<Divider />
|
|
28
|
-
<
|
|
29
|
-
<
|
|
28
|
+
<CheckboxList label="Filters" isLabelHidden>
|
|
29
|
+
<CheckboxListItem
|
|
30
30
|
label="In stock"
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
isChecked={inStock}
|
|
32
|
+
onCheck={setInStock}
|
|
33
33
|
/>
|
|
34
|
-
<
|
|
34
|
+
<CheckboxListItem
|
|
35
35
|
label="On sale"
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
isChecked={onSale}
|
|
37
|
+
onCheck={setOnSale}
|
|
38
38
|
/>
|
|
39
|
-
<
|
|
39
|
+
<CheckboxListItem
|
|
40
40
|
label="Free shipping"
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
isChecked={freeShipping}
|
|
42
|
+
onCheck={setFreeShipping}
|
|
43
43
|
/>
|
|
44
|
-
</
|
|
44
|
+
</CheckboxList>
|
|
45
45
|
<Button label="Apply" onClick={() => setIsOpen(false)} />
|
|
46
46
|
</VStack>
|
|
47
47
|
</Section>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
-
import {
|
|
8
|
+
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
9
9
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
10
10
|
import {Heading} from '@astryxdesign/core/Heading';
|
|
11
11
|
import {Section} from '@astryxdesign/core/Section';
|
|
@@ -175,19 +175,23 @@ function NotificationChannelsSheet({
|
|
|
175
175
|
<Text type="supporting" color="secondary">
|
|
176
176
|
Choose any combination. You can change these preferences later.
|
|
177
177
|
</Text>
|
|
178
|
-
<
|
|
179
|
-
<
|
|
180
|
-
|
|
178
|
+
<CheckboxList label="Notification channels" isLabelHidden>
|
|
179
|
+
<CheckboxListItem
|
|
180
|
+
label="Email"
|
|
181
|
+
isChecked={email}
|
|
182
|
+
onCheck={setEmail}
|
|
183
|
+
/>
|
|
184
|
+
<CheckboxListItem
|
|
181
185
|
label="Push notifications"
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
isChecked={pushNotifications}
|
|
187
|
+
onCheck={setPushNotifications}
|
|
184
188
|
/>
|
|
185
|
-
<
|
|
189
|
+
<CheckboxListItem
|
|
186
190
|
label="Text messages"
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
isChecked={textMessages}
|
|
192
|
+
onCheck={setTextMessages}
|
|
189
193
|
/>
|
|
190
|
-
</
|
|
194
|
+
</CheckboxList>
|
|
191
195
|
<HStack gap={2} hAlign="end">
|
|
192
196
|
<Button label="Back" variant="secondary" onClick={onBack} />
|
|
193
197
|
<Button label="Finish" onClick={onFinish} />
|