@astryxdesign/cli 0.7.11-canary.3df65bf → 0.7.11-canary.4e6e67d
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/icon/_authoring.mjs +228 -32
- package/api/icon/icon.type.d.mts +15 -0
- package/api/icon/icon.type.mjs +2 -0
- package/api/integration/add-helpers.d.mts +10 -1
- package/api/integration/add-helpers.mjs +1 -1
- package/api/swizzle/_adapter.d.mts +1 -0
- package/api/swizzle/_adapter.mjs +4 -1
- package/api/swizzle/_moduleGraph.d.mts +162 -0
- package/api/swizzle/_moduleGraph.mjs +754 -0
- package/api/swizzle/copy/copy.d.mts +2 -43
- package/api/swizzle/copy/copy.mjs +194 -314
- package/api/swizzle/swizzle.d.mts +0 -2
- package/api/swizzle/swizzle.doc.mjs +8 -4
- package/api/swizzle/swizzle.mjs +3 -7
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/assets/discover/official-packages.json +12 -0
- package/assets/docs/tree/icon-sets.doc.mjs +2 -2
- package/assets/templates/pages/file-explorer/page.tsx +103 -79
- package/assets/templates/pages/theme-showcase/page.tsx +724 -792
- package/assets/templates/pages/theme-showcase/template.doc.mjs +4 -5
- package/clients/cli/commands/swizzle.doc.mjs +6 -3
- package/clients/cli/commands/swizzle.mjs +8 -9
- package/foundation/discovery/component-loader.d.mts +1 -1
- package/foundation/discovery/icon-set-checks.mjs +4 -15
- package/foundation/discovery/icon-set-discovery.d.mts +13 -0
- package/foundation/discovery/icon-set-discovery.mjs +25 -0
- package/foundation/discovery/icon-set-writer.d.mts +28 -0
- package/foundation/discovery/icon-set-writer.mjs +57 -0
- package/foundation/discovery/module-exports.mjs +57 -2
- package/foundation/fs/paths.d.mts +2 -1
- package/foundation/fs/paths.mjs +3 -4
- package/package.json +6 -6
package/api/swizzle/swizzle.mjs
CHANGED
|
@@ -9,16 +9,12 @@
|
|
|
9
9
|
* - a component name -> api/swizzle/copy -> `swizzle.copy` receipt
|
|
10
10
|
*
|
|
11
11
|
* Errors throw AstryxError (stable code + suggestions). All human prose /
|
|
12
|
-
* package-manager prefixing lives in the CLI renderer.
|
|
13
|
-
*
|
|
14
|
-
* point (api/index.mjs, the CLI command, and the unit tests all import from
|
|
15
|
-
* here).
|
|
12
|
+
* package-manager prefixing lives in the CLI renderer. api/index.mjs, the CLI
|
|
13
|
+
* command, and the unit tests import `swizzle` from here.
|
|
16
14
|
*/
|
|
17
15
|
|
|
18
16
|
import {swizzleList} from './list/list.mjs';
|
|
19
|
-
import {swizzleCopy
|
|
20
|
-
|
|
21
|
-
export {rewriteImports};
|
|
17
|
+
import {swizzleCopy} from './copy/copy.mjs';
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
20
|
* List swizzlable components, or copy one component's source for customization.
|
|
@@ -62,7 +62,7 @@ export type SwizzleOptions = {
|
|
|
62
62
|
*/
|
|
63
63
|
list?: boolean | undefined;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Replace the component's existing files instead of erroring. A copy that carries a helper an earlier swizzle wrote never replaces it, except a changed private attribute owner module and the style modules it imports; swizzling the component whose folder holds the helper counts it as that component's own file.
|
|
66
66
|
*/
|
|
67
67
|
overwrite?: boolean | undefined;
|
|
68
68
|
};
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* @property {string} data.package Owner package the component source was copied from.
|
|
35
35
|
* @property {string} data.outputDir
|
|
36
36
|
* @property {number} data.filesCopied
|
|
37
|
-
* @property {string[]} data.files Copied file names, relative to the component folder;
|
|
37
|
+
* @property {string[]} data.files Copied file names, relative to the component folder; the internal modules copied beside it start with `../` (spec:AST-110 FR2).
|
|
38
38
|
* @property {boolean} data.usesStyleX Whether any copied file uses StyleX (requires build-time setup).
|
|
39
39
|
* @property {SwizzleFeedback} [data.feedback]
|
|
40
40
|
*/
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* @property {string} [output] Output directory (must resolve inside cwd). Defaults to ./components/astryx.
|
|
47
47
|
* @property {string} [package] Scope to a specific owning package when a name is ambiguous.
|
|
48
48
|
* @property {boolean} [list] Force the list response even with a component argument.
|
|
49
|
-
* @property {boolean} [overwrite]
|
|
49
|
+
* @property {boolean} [overwrite] Replace the component's existing files instead of erroring. A copy that carries a helper an earlier swizzle wrote never replaces it, except a changed private attribute owner module and the style modules it imports; swizzling the component whose folder holds the helper counts it as that component's own file.
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
export {};
|
|
@@ -283,6 +283,18 @@
|
|
|
283
283
|
"kind": "component",
|
|
284
284
|
"name": "RichTextEditor"
|
|
285
285
|
},
|
|
286
|
+
{
|
|
287
|
+
"kind": "component",
|
|
288
|
+
"name": "RichTextEditorAutoLinkPlugin"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"kind": "component",
|
|
292
|
+
"name": "RichTextEditorToolbar"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"kind": "component",
|
|
296
|
+
"name": "RichTextView"
|
|
297
|
+
},
|
|
286
298
|
{
|
|
287
299
|
"kind": "template",
|
|
288
300
|
"name": "RichTextEditorShowcase"
|
|
@@ -121,11 +121,11 @@ export const docs = {
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
type: 'prose',
|
|
124
|
-
text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, with an id from its name (`Squares2X2Icon` is `squares-2x2`: a dimension stays one word). `map` is filled only where a definition's name is an icon's id (`delete` → icon `delete`), and the receipt lists those entries under Mapped by name: a library can draw another meaning under the same name (one library's `delete` is a backspace key), so check each. An icon whose id is only one of a definition's words (`trash` for `delete`) may mean something else in this library, so the receipt lists it under Suggestions, with the `experimental icon map <definition> <icon>` command for each, and writes nothing for it: check the meaning, then run the ones that fit. Run it again after a library release to refresh the icons that library supplies; `map` entries whose icon still exists are kept, and the receipt names any icon the library dropped, any icon `--exclude` left out, and the `map` entries each took with it. Icons you added from your own files or another library are left as they are. An icon you already have is known by the library export it re-exports, so it keeps its export name exactly, its `map` entries, variants, and words, even when a newer CLI spells its id differently or your `--exclude` lets a library prefix come off new ids; the receipt lists each changed id under `renamed`. A refresh with `--dry-run` writes nothing and prints the Mapped by name and Suggestions lists again; `--display-name` and `--description` on a refresh rewrite the descriptor. Variants added with `add --variant … --all` are kept too; run that `add` again to pick up icons the release added. `experimental icon --list` shows how many definitions the set maps.",
|
|
124
|
+
text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, with an id from its name (`Squares2X2Icon` is `squares-2x2`: a dimension stays one word). `map` is filled only where a definition's name is an icon's id (`delete` → icon `delete`), and the receipt lists those entries under Mapped by name: a library can draw another meaning under the same name (one library's `delete` is a backspace key), so check each. An icon whose id is only one of a definition's words (`trash` for `delete`) may mean something else in this library, so the receipt lists it under Suggestions, with the `experimental icon map <definition> <icon>` command for each, and writes nothing for it: check the meaning, then run the ones that fit. Run it again after a library release to refresh the icons that library supplies; `map` entries whose icon still exists are kept, and the receipt names any icon the library dropped, any icon `--exclude` left out, and the `map` entries each took with it. Icons you added from your own files or another library are left as they are. Icons you added one file at a time from the same package (`--from <package>/dist/XIcon`) move to the root import when you refresh from the package root and the root exports the same icon; each keeps its id, export, `map` entries, variants, and words on that refresh and every later one, and the receipt lists it under `moved`. A library icon whose id or name a moved icon already has is left out. When another icon of the set already reads the same root export, the icon stays on its own file, and the receipt says why. An icon you already have is known by the library export it re-exports, so it keeps its export name exactly, its `map` entries, variants, and words, even when a newer CLI spells its id differently or your `--exclude` lets a library prefix come off new ids; the receipt lists each changed id under `renamed`. An id you chose that is not a spelling of the library name (`dismiss` for `XIcon`) is kept. A refresh with `--dry-run` writes nothing and prints the Mapped by name and Suggestions lists again; `--display-name` and `--description` on a refresh rewrite the descriptor. Variants added with `add --variant … --all` are kept too; run that `add` again to pick up icons the release added. `experimental icon --list` shows how many definitions the set maps.",
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
type: 'prose',
|
|
128
|
-
text: "With a package or package subpath, it also records the installed library and version as the data file's `source`, so `integration check` warns when your dependency moves to another version; copies the library's LICENSE (and NOTICE) files into the set directory; and sets the descriptor's `license` to the library's. A set you started without `--from` gets the same the first time a refresh records its source, unless you already changed `license`: a `license` you set is kept (the receipt names the library's), and every later refresh keeps it too. Your package.json `license` is never changed. Edit `license` when the artwork's license differs from the library's package license.",
|
|
128
|
+
text: "With a package or package subpath, it also records the installed library and version as the data file's `source`, so `integration check` warns when your dependency moves to another version; copies the library's LICENSE (and NOTICE) files into the set directory; and sets the descriptor's `license` to the library's. A set you started without `--from` gets the same the first time a refresh records its source, unless you already changed `license`: a `license` you set is kept (the receipt names the library's), and every later refresh keeps it too. Your package.json `license` is never changed. Edit `license` when the artwork's license differs from the library's package license. When the library ships no license file to copy, the receipt says so under `licenseNoticeMissing` and in its notes, and the CLI writes nothing: add a `NOTICE` file to the set directory (`icon-sets/<set>/NOTICE`) that names the library, its version, and its license. `integration check` accepts a file named `LICENSE`, `LICENCE`, `NOTICE`, or `COPYING`, in any case and with an optional suffix such as `NOTICE.md` or `LICENSE-MIT`, in the set directory or the package root; without one it reports `icon_license_notice_missing`.",
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
type: 'prose',
|
|
@@ -7,6 +7,8 @@ import {Layout, LayoutContent} from '@astryxdesign/core/Layout';
|
|
|
7
7
|
import {Toolbar} from '@astryxdesign/core/Toolbar';
|
|
8
8
|
import {List, ListItem} from '@astryxdesign/core/List';
|
|
9
9
|
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
10
|
+
import {StackItem} from '@astryxdesign/core/Stack';
|
|
11
|
+
import {rtlStyles} from '@astryxdesign/core/utils';
|
|
10
12
|
import {Text} from '@astryxdesign/core/Text';
|
|
11
13
|
import {Icon} from '@astryxdesign/core/Icon';
|
|
12
14
|
import {IconButton} from '@astryxdesign/core/IconButton';
|
|
@@ -260,14 +262,9 @@ const FILESYSTEM: FileSystemItem[] = [
|
|
|
260
262
|
];
|
|
261
263
|
|
|
262
264
|
const page: CSSProperties = {height: '100dvh'};
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
const detailColumn: CSSProperties = {
|
|
267
|
-
flexGrow: 1,
|
|
268
|
-
flexShrink: 0,
|
|
269
|
-
flexBasis: 320,
|
|
270
|
-
};
|
|
265
|
+
// The detail column fills the rest of the row but never narrows below 320px;
|
|
266
|
+
// past that, the row scrolls sideways.
|
|
267
|
+
const detailFloor: CSSProperties = {flexShrink: 0, flexBasis: 320};
|
|
271
268
|
|
|
272
269
|
function findItem(items: FileSystemItem[], id: string): FileSystemItem | null {
|
|
273
270
|
for (const item of items) {
|
|
@@ -361,7 +358,13 @@ export default function FileExplorerPage() {
|
|
|
361
358
|
<IconButton
|
|
362
359
|
variant="ghost"
|
|
363
360
|
size="sm"
|
|
364
|
-
icon={
|
|
361
|
+
icon={
|
|
362
|
+
<Icon
|
|
363
|
+
icon={ChevronLeftIcon}
|
|
364
|
+
size="sm"
|
|
365
|
+
xstyle={rtlStyles.mirror}
|
|
366
|
+
/>
|
|
367
|
+
}
|
|
365
368
|
onClick={() => {
|
|
366
369
|
if (selectedPath.length > 0) {
|
|
367
370
|
setSelectedPath(selectedPath.slice(0, -1));
|
|
@@ -373,7 +376,13 @@ export default function FileExplorerPage() {
|
|
|
373
376
|
<IconButton
|
|
374
377
|
variant="ghost"
|
|
375
378
|
size="sm"
|
|
376
|
-
icon={
|
|
379
|
+
icon={
|
|
380
|
+
<Icon
|
|
381
|
+
icon={ChevronRightIcon}
|
|
382
|
+
size="sm"
|
|
383
|
+
xstyle={rtlStyles.mirror}
|
|
384
|
+
/>
|
|
385
|
+
}
|
|
377
386
|
isDisabled
|
|
378
387
|
label="Go forward"
|
|
379
388
|
/>
|
|
@@ -449,86 +458,101 @@ export default function FileExplorerPage() {
|
|
|
449
458
|
}
|
|
450
459
|
content={
|
|
451
460
|
<LayoutContent padding={0} isScrollable={false}>
|
|
452
|
-
<HStack height="100%"
|
|
461
|
+
<HStack height="100%" isScrollable>
|
|
453
462
|
{columns.map((col, colIndex) => {
|
|
454
463
|
const showDivider =
|
|
455
464
|
colIndex < columns.length - 1 || selectedFile != null;
|
|
456
465
|
return (
|
|
457
|
-
<
|
|
466
|
+
<StackItem
|
|
458
467
|
key={colIndex}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
size="sm"
|
|
486
|
-
/>
|
|
487
|
-
}
|
|
488
|
-
endContent={
|
|
489
|
-
hasChildren ? (
|
|
468
|
+
size="static"
|
|
469
|
+
isScrollable
|
|
470
|
+
aria-label={
|
|
471
|
+
colIndex === 0
|
|
472
|
+
? 'Home'
|
|
473
|
+
: findItem(FILESYSTEM, selectedPath[colIndex - 1])?.name
|
|
474
|
+
}>
|
|
475
|
+
<Section
|
|
476
|
+
width={240}
|
|
477
|
+
height="100%"
|
|
478
|
+
padding={2}
|
|
479
|
+
variant="transparent"
|
|
480
|
+
dividers={showDivider ? ['end'] : undefined}>
|
|
481
|
+
<List density="compact" hasDividers={false}>
|
|
482
|
+
{col.items.map(item => {
|
|
483
|
+
const isSelected = col.selectedId === item.id;
|
|
484
|
+
const hasChildren =
|
|
485
|
+
item.type === 'folder' &&
|
|
486
|
+
item.children != null &&
|
|
487
|
+
item.children.length > 0;
|
|
488
|
+
return (
|
|
489
|
+
<ListItem
|
|
490
|
+
key={item.id}
|
|
491
|
+
label={item.name}
|
|
492
|
+
startContent={
|
|
490
493
|
<Icon
|
|
491
|
-
icon={
|
|
492
|
-
|
|
493
|
-
|
|
494
|
+
icon={
|
|
495
|
+
item.type === 'folder'
|
|
496
|
+
? FolderIcon
|
|
497
|
+
: DocumentIcon
|
|
498
|
+
}
|
|
499
|
+
color={
|
|
500
|
+
item.type === 'folder'
|
|
501
|
+
? 'accent'
|
|
502
|
+
: 'secondary'
|
|
503
|
+
}
|
|
504
|
+
size="sm"
|
|
494
505
|
/>
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
506
|
+
}
|
|
507
|
+
endContent={
|
|
508
|
+
hasChildren ? (
|
|
509
|
+
<Icon
|
|
510
|
+
icon={ChevronRightIcon}
|
|
511
|
+
size="xsm"
|
|
512
|
+
color="secondary"
|
|
513
|
+
xstyle={rtlStyles.mirror}
|
|
514
|
+
/>
|
|
515
|
+
) : undefined
|
|
516
|
+
}
|
|
517
|
+
onClick={() => handleSelect(colIndex, item.id)}
|
|
518
|
+
isSelected={isSelected}
|
|
519
|
+
/>
|
|
520
|
+
);
|
|
521
|
+
})}
|
|
522
|
+
</List>
|
|
523
|
+
</Section>
|
|
524
|
+
</StackItem>
|
|
504
525
|
);
|
|
505
526
|
})}
|
|
506
527
|
{selectedFile && (
|
|
507
|
-
<
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
<VStack gap={
|
|
514
|
-
<
|
|
515
|
-
<
|
|
516
|
-
{
|
|
517
|
-
|
|
528
|
+
<StackItem
|
|
529
|
+
size="fill"
|
|
530
|
+
isScrollable
|
|
531
|
+
aria-label={selectedFile.name}
|
|
532
|
+
style={detailFloor}>
|
|
533
|
+
<Section padding={6} variant="transparent">
|
|
534
|
+
<VStack gap={4} hAlign="center">
|
|
535
|
+
<Avatar name={selectedFile.name} size={96} />
|
|
536
|
+
<VStack gap={1} hAlign="center">
|
|
537
|
+
<Text type="label">{selectedFile.name}</Text>
|
|
538
|
+
<Text type="supporting">
|
|
539
|
+
{getFileExtension(selectedFile.name)} Document
|
|
540
|
+
</Text>
|
|
541
|
+
</VStack>
|
|
542
|
+
<MetadataList title="Information">
|
|
543
|
+
<MetadataListItem label="Created">
|
|
544
|
+
March 28, 2026 at 2:15 PM
|
|
545
|
+
</MetadataListItem>
|
|
546
|
+
<MetadataListItem label="Modified">
|
|
547
|
+
Yesterday, 10:27 PM
|
|
548
|
+
</MetadataListItem>
|
|
549
|
+
<MetadataListItem label="Kind">
|
|
550
|
+
{getFileExtension(selectedFile.name)} Document
|
|
551
|
+
</MetadataListItem>
|
|
552
|
+
</MetadataList>
|
|
518
553
|
</VStack>
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
March 28, 2026 at 2:15 PM
|
|
522
|
-
</MetadataListItem>
|
|
523
|
-
<MetadataListItem label="Modified">
|
|
524
|
-
Yesterday, 10:27 PM
|
|
525
|
-
</MetadataListItem>
|
|
526
|
-
<MetadataListItem label="Kind">
|
|
527
|
-
{getFileExtension(selectedFile.name)} Document
|
|
528
|
-
</MetadataListItem>
|
|
529
|
-
</MetadataList>
|
|
530
|
-
</VStack>
|
|
531
|
-
</Section>
|
|
554
|
+
</Section>
|
|
555
|
+
</StackItem>
|
|
532
556
|
)}
|
|
533
557
|
</HStack>
|
|
534
558
|
</LayoutContent>
|