@astryxdesign/cli 0.7.13-canary.e09956b → 0.7.13
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 +38 -0
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +21 -0
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.tsx +46 -0
- package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.doc.mjs +18 -0
- package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +101 -0
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @xds/cli
|
|
2
2
|
|
|
3
|
+
# 0.7.13
|
|
4
|
+
|
|
5
|
+
#### Experimental APIs
|
|
6
|
+
|
|
7
|
+
- `astryx discover` lists the experimental TabBarMoreList component from `@astryxdesign/lab`. (#10619)
|
|
8
|
+
- Icon sets: a project picks one main icon set and backup sets in order, and an icon no set has becomes a placeholder in the copied file. Only the experimental icon commands, projects that set `experimental.iconSet`, templates that declare `icons`, and the icon-set guide change. (#10959)
|
|
9
|
+
|
|
10
|
+
- **Main set and backups.** `astryx experimental icon use <main> --backup <set>` (repeatable, order kept) writes `experimental.iconSet` as a list, the main set first; with no `--backup` it writes the plain string as before. The receipt adds `backups`, the installed sets the list leaves out (`unlisted`), and the command that adds them (`next`). `experimental icon --list` shows the `order` and each set's `role` and `rank`, and, when two or more sets are installed and none is the main set, the command to run. A CLI before 0.7.12 refuses the list form, and `use` warns when the project's CLI range admits one.
|
|
11
|
+
- **Copied templates follow the list.** `astryx template` takes each icon from the first set in the list that has its meaning, never mixing sets within one icon, and reports the set used, a missing look (`variant: {asked, used}`), and each set used with its license (`icons.sets`).
|
|
12
|
+
- **No stray library imports.** An icon no set in the list loses the template's original import. The copied file declares a small `MissingIcon` component once (a dashed square, 1em, in the current text color, hidden from screen readers unless a use gives it a label), and each place the icon was renders it, with a comment naming the meaning. It needs no new package. The output prints a note naming the meaning and both fixes (map it in the main set, or add a backup set), and the JSON lists it in `icons.placeholder`.
|
|
13
|
+
- **Doctor.** With the opt-in, the `icon-sets` check fails when the list names a set that is not installed, withdrawn, or shipped by two packages, and when more than one set is installed and the list leaves one out. A new `icon-placeholders` check warns while copied code still uses the placeholder, naming each file and meaning; a commented-out or quoted copy does not count. Projects that have not opted in see no change.
|
|
14
|
+
- **Labeled template icons.** Every icon a bundled template uses now declares its meaning, with 30 new icon definitions. `integration check` notes an icon a template imports but does not declare (`template_icon_undeclared`), in a package whose templates declare `icons`: an import from a module the package declares icons from, which the template renders as an element with no children or passes as a value. Any other import from that module, such as a type, a function it calls, or a provider with children, is listed as not checked. The note fails `--strict --next` and leaves `--strict` as it was. A generic renderer (a bare `Icon`, or one every use gives an icon prop) and an import that matches an icon by its name only are listed as not checked instead.
|
|
15
|
+
|
|
16
|
+
#### New Features
|
|
17
|
+
|
|
18
|
+
- The CLI adds a `BaseTypeaheadMenu` block: a BaseTypeahead whose listbox menu shows information around the result list, and whose pick or filter button opens a dialog-role menu on the same layer. (#10625)
|
|
19
|
+
|
|
20
|
+
#### Fixes
|
|
21
|
+
|
|
22
|
+
- dependency floors move to current releases: the build package needs autoprefixer 10.6.2, browserslist 4.29.5 and lightningcss 1.33.0; the CLI needs ignore 7.0.14, jscodeshift 17.4.0, linkedom 0.18.15, zod 4.6.7 and @stylexjs/babel-plugin 0.19.1; each theme needs lucide-react 1.66.0. Peer ranges do not change. (#10709)
|
|
23
|
+
|
|
24
|
+
#### Documentation
|
|
25
|
+
|
|
26
|
+
- Add hook documentation and interactive sparkline example block for `useDirection`, detailing render-time direction handling and CSS logical properties best practices. (#10547)
|
|
27
|
+
- InternationalizationProvider has a calendar example: the provider's `calendar` prop shows a `Calendar` and a `DateInput` in the Japanese or Buddhist calendar, and the value stays a Gregorian ISO date. Both calendars work without `Temporal`. (#10135)
|
|
28
|
+
|
|
29
|
+
#### Contributors
|
|
30
|
+
|
|
31
|
+
Thanks to everyone who contributed to this release:
|
|
32
|
+
|
|
33
|
+
- @cixzhang
|
|
34
|
+
- @josephfarina
|
|
35
|
+
- @nynexman4464
|
|
36
|
+
- @utkarshpatwa393-sys
|
|
37
|
+
- @vjeux
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
3
41
|
# 0.7.12
|
|
4
42
|
|
|
5
43
|
#### Experimental APIs
|
|
@@ -257,7 +257,7 @@ useChatPasteAsToken useChatPasteAsToken Chat/Chat.doc.mjs Chat/useChatPasteAsTok
|
|
|
257
257
|
useChatStreamScroll useChatStreamScroll Chat/Chat.doc.mjs Chat/useChatStreamScroll.ts
|
|
258
258
|
useCloseMobileDrawerOnActivate useCloseMobileDrawerOnActivate AppShell/AppShell.doc.mjs AppShell/useCloseMobileDrawerOnActivate.ts
|
|
259
259
|
useComponentTranslator useComponentTranslator i18n/InternationalizationProvider.doc.mjs i18n/useComponentTranslator.ts
|
|
260
|
-
useDirection useDirection i18n/
|
|
260
|
+
useDirection useDirection i18n/useDirection.doc.mjs i18n/useDirection.ts
|
|
261
261
|
useDrawerDialogPresence useDrawerDialogPresence Drawer/Drawer.doc.mjs Drawer/useDrawerDialogPresence.ts
|
|
262
262
|
useEndLaneReserve useEndLaneReserve Tokenizer/Tokenizer.doc.mjs Tokenizer/useEndLaneReserve.ts
|
|
263
263
|
useFieldStatusAnnouncement useFieldStatusAnnouncement FieldStatus/FieldStatus.doc.mjs FieldStatus/useFieldStatusAnnouncement.ts
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'InternationalizationProvider',
|
|
7
|
+
name: 'InternationalizationProvider — Calendar',
|
|
8
|
+
displayName: 'Internationalization Provider — Calendar',
|
|
9
|
+
description:
|
|
10
|
+
'Set the `calendar` prop and the `Calendar` and `DateInput` inside the provider show that calendar system. The value stays a Gregorian ISO date. Japanese and Buddhist dates work in every browser; calendars such as Persian or Hebrew also need `Temporal` or a polyfill.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'InternationalizationProvider',
|
|
15
|
+
'Calendar',
|
|
16
|
+
'DateInput',
|
|
17
|
+
'SegmentedControl',
|
|
18
|
+
'Layout',
|
|
19
|
+
'Text',
|
|
20
|
+
],
|
|
21
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
7
|
+
import {Calendar, type ISODateString} from '@astryxdesign/core/Calendar';
|
|
8
|
+
import {DateInput} from '@astryxdesign/core/DateInput';
|
|
9
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
10
|
+
import {
|
|
11
|
+
SegmentedControl,
|
|
12
|
+
SegmentedControlItem,
|
|
13
|
+
} from '@astryxdesign/core/SegmentedControl';
|
|
14
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
15
|
+
|
|
16
|
+
type CalendarSystem = 'gregory' | 'japanese' | 'buddhist';
|
|
17
|
+
|
|
18
|
+
export default function InternationalizationProviderCalendar() {
|
|
19
|
+
const [calendar, setCalendar] = useState<CalendarSystem>('japanese');
|
|
20
|
+
const [value, setValue] = useState<ISODateString | undefined>('2026-10-30');
|
|
21
|
+
return (
|
|
22
|
+
<InternationalizationProvider locale="en" calendar={calendar}>
|
|
23
|
+
<VStack gap={4} hAlign="center">
|
|
24
|
+
<SegmentedControl
|
|
25
|
+
label="Calendar"
|
|
26
|
+
value={calendar}
|
|
27
|
+
onChange={next => setCalendar(next as CalendarSystem)}
|
|
28
|
+
size="sm">
|
|
29
|
+
<SegmentedControlItem value="gregory" label="Gregorian" />
|
|
30
|
+
<SegmentedControlItem value="japanese" label="Japanese" />
|
|
31
|
+
<SegmentedControlItem value="buddhist" label="Buddhist" />
|
|
32
|
+
</SegmentedControl>
|
|
33
|
+
<DateInput
|
|
34
|
+
label="Start date"
|
|
35
|
+
value={value}
|
|
36
|
+
onChange={setValue}
|
|
37
|
+
controlStyle={{width: 300}}
|
|
38
|
+
/>
|
|
39
|
+
<Calendar value={value ?? null} onChange={next => setValue(next)} />
|
|
40
|
+
<Text type="supporting" color="secondary">
|
|
41
|
+
{value ? `Value: ${value}` : 'No date'}
|
|
42
|
+
</Text>
|
|
43
|
+
</VStack>
|
|
44
|
+
</InternationalizationProvider>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'useDirection',
|
|
7
|
+
name: 'useDirection — Hook Usage',
|
|
8
|
+
displayName: 'useDirection — Hook Usage',
|
|
9
|
+
description:
|
|
10
|
+
'Demonstrates reading ambient text direction during render to draw a direction-aware canvas sparkline whose time axis runs from the logical inline start edge.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'InternationalizationProvider',
|
|
15
|
+
'SegmentedControl',
|
|
16
|
+
'Layout',
|
|
17
|
+
],
|
|
18
|
+
};
|
package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useEffect, useRef, useState} from 'react';
|
|
6
|
+
import {InternationalizationProvider, useDirection} from '@astryxdesign/core';
|
|
7
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
8
|
+
import {
|
|
9
|
+
SegmentedControl,
|
|
10
|
+
SegmentedControlItem,
|
|
11
|
+
} from '@astryxdesign/core/SegmentedControl';
|
|
12
|
+
|
|
13
|
+
const DATA_POINTS = [10, 25, 18, 40, 32, 60, 48, 75];
|
|
14
|
+
|
|
15
|
+
function Sparkline() {
|
|
16
|
+
const direction = useDirection();
|
|
17
|
+
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const canvas = canvasRef.current;
|
|
21
|
+
if (!canvas) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const ctx = canvas.getContext('2d');
|
|
25
|
+
if (!ctx) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const width = canvas.width;
|
|
30
|
+
const height = canvas.height;
|
|
31
|
+
ctx.clearRect(0, 0, width, height);
|
|
32
|
+
|
|
33
|
+
const step = width / (DATA_POINTS.length - 1);
|
|
34
|
+
const maxVal = Math.max(...DATA_POINTS);
|
|
35
|
+
const minVal = Math.min(...DATA_POINTS);
|
|
36
|
+
const range = maxVal - minVal || 1;
|
|
37
|
+
|
|
38
|
+
ctx.beginPath();
|
|
39
|
+
ctx.strokeStyle = '#0064e0';
|
|
40
|
+
ctx.lineWidth = 2;
|
|
41
|
+
|
|
42
|
+
DATA_POINTS.forEach((val, i) => {
|
|
43
|
+
// In LTR: oldest data starts at 0 (left), newest at right.
|
|
44
|
+
// In RTL: oldest data starts at right (width), newest at left.
|
|
45
|
+
const x = direction === 'rtl' ? width - i * step : i * step;
|
|
46
|
+
const y = height - ((val - minVal) / range) * (height - 10) - 5;
|
|
47
|
+
if (i === 0) {
|
|
48
|
+
ctx.moveTo(x, y);
|
|
49
|
+
} else {
|
|
50
|
+
ctx.lineTo(x, y);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
ctx.stroke();
|
|
54
|
+
|
|
55
|
+
// Draw point at latest value
|
|
56
|
+
const lastIndex = DATA_POINTS.length - 1;
|
|
57
|
+
const lastX = direction === 'rtl' ? 0 : width;
|
|
58
|
+
const lastY =
|
|
59
|
+
height - ((DATA_POINTS[lastIndex] - minVal) / range) * (height - 10) - 5;
|
|
60
|
+
ctx.beginPath();
|
|
61
|
+
ctx.arc(lastX, lastY, 4, 0, Math.PI * 2);
|
|
62
|
+
ctx.fillStyle = '#0064e0';
|
|
63
|
+
ctx.fill();
|
|
64
|
+
}, [direction]);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<canvas
|
|
68
|
+
ref={canvasRef}
|
|
69
|
+
width={200}
|
|
70
|
+
height={60}
|
|
71
|
+
data-testid="sparkline-canvas"
|
|
72
|
+
data-direction={direction}
|
|
73
|
+
style={{border: '1px solid #e1e4e8', borderRadius: 4}}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default function UseDirectionHookUsage() {
|
|
79
|
+
const [lang, setLang] = useState<'en' | 'ar'>('en');
|
|
80
|
+
const isRtl = lang === 'ar';
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<InternationalizationProvider locale={lang} dir={isRtl ? 'rtl' : 'ltr'}>
|
|
84
|
+
<VStack
|
|
85
|
+
gap={4}
|
|
86
|
+
hAlign="center"
|
|
87
|
+
dir={isRtl ? 'rtl' : 'ltr'}
|
|
88
|
+
style={{width: '100%'}}>
|
|
89
|
+
<SegmentedControl
|
|
90
|
+
label="Locale"
|
|
91
|
+
value={lang}
|
|
92
|
+
onChange={next => setLang(next as 'en' | 'ar')}
|
|
93
|
+
size="sm">
|
|
94
|
+
<SegmentedControlItem value="en" label="English (LTR)" />
|
|
95
|
+
<SegmentedControlItem value="ar" label="العربية (RTL)" />
|
|
96
|
+
</SegmentedControl>
|
|
97
|
+
<Sparkline />
|
|
98
|
+
</VStack>
|
|
99
|
+
</InternationalizationProvider>
|
|
100
|
+
);
|
|
101
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.13
|
|
3
|
+
"version": "0.7.13",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -111,21 +111,21 @@
|
|
|
111
111
|
"@babel/parser": "7.29.8",
|
|
112
112
|
"@babel/plugin-transform-typescript": "7.29.7",
|
|
113
113
|
"@babel/types": "7.29.8",
|
|
114
|
-
"@stylexjs/babel-plugin": "^0.19.
|
|
114
|
+
"@stylexjs/babel-plugin": "^0.19.1",
|
|
115
115
|
"ast-types": "0.16.3",
|
|
116
116
|
"commander": "^12.1.0",
|
|
117
|
-
"ignore": "^7.0.
|
|
117
|
+
"ignore": "^7.0.14",
|
|
118
118
|
"jiti": "^2.7.0",
|
|
119
|
-
"jscodeshift": "^17.
|
|
120
|
-
"linkedom": "^0.18.
|
|
119
|
+
"jscodeshift": "^17.4.0",
|
|
120
|
+
"linkedom": "^0.18.15",
|
|
121
121
|
"node-diff3": "3.2.1",
|
|
122
122
|
"postcss": "^8.5.23",
|
|
123
123
|
"postcss-selector-parser": "^7.1.6",
|
|
124
124
|
"recast": "0.23.21",
|
|
125
|
-
"zod": "^4.
|
|
125
|
+
"zod": "^4.6.7"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"@astryxdesign/core": "
|
|
128
|
+
"@astryxdesign/core": "*"
|
|
129
129
|
},
|
|
130
130
|
"peerDependenciesMeta": {
|
|
131
131
|
"@astryxdesign/core": {
|
|
@@ -133,15 +133,15 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@astryxdesign/charts": "
|
|
137
|
-
"@astryxdesign/core": "
|
|
138
|
-
"@astryxdesign/lab": "
|
|
139
|
-
"@astryxdesign/theme-neutral": "
|
|
136
|
+
"@astryxdesign/charts": "*",
|
|
137
|
+
"@astryxdesign/core": "*",
|
|
138
|
+
"@astryxdesign/lab": "*",
|
|
139
|
+
"@astryxdesign/theme-neutral": "*",
|
|
140
140
|
"@heroicons/react": "^2.2.0",
|
|
141
|
-
"@stylexjs/stylex": "^0.19.
|
|
141
|
+
"@stylexjs/stylex": "^0.19.1",
|
|
142
142
|
"@types/babel__core": "^7.20.5",
|
|
143
|
-
"lucide-react": "^1.
|
|
144
|
-
"recharts": "^3.
|
|
143
|
+
"lucide-react": "^1.66.0",
|
|
144
|
+
"recharts": "^3.10.1"
|
|
145
145
|
},
|
|
146
146
|
"scripts": {
|
|
147
147
|
"api:report": "node ../../scripts/api-report/cli.mjs --package .",
|