@astryxdesign/cli 0.7.7-canary.fc68123 → 0.7.8-canary.30b1896
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 +31 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/promote-tokenizer-presentation.mjs +174 -0
- package/assets/discover/official-packages.json +4 -8
- package/assets/templates/blocks/components/Hooks/useAnnounceHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useAnnounceHookUsage.tsx +90 -0
- package/assets/templates/blocks/components/Hooks/useFocusTrapHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useFocusTrapHookUsage.tsx +70 -0
- package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -0
- package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +1 -0
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -0
- package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -0
- package/assets/templates/pages/table-inbox/page.tsx +6 -0
- package/assets/templates/pages/work-item-detail/page.tsx +1 -0
- package/foundation/integrations/public-imports.d.mts +24 -0
- package/foundation/integrations/public-imports.mjs +2 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @xds/cli
|
|
2
2
|
|
|
3
|
+
# 0.7.7
|
|
4
|
+
|
|
5
|
+
#### New Components
|
|
6
|
+
|
|
7
|
+
- `astryx discover` no longer lists `InfoTip` among the components `@astryxdesign/lab` contributes: InfoTip is a Core component now, described by `astryx component InfoTip`.
|
|
8
|
+
|
|
9
|
+
#### Performance
|
|
10
|
+
|
|
11
|
+
- With TypeScript 5.3 or later, `validateIntegration()`, `integrationComponentConflicts()` and `integrationCheck()` from `@astryxdesign/cli/api`, and the commands that run them, reuse each TypeScript file a check parsed for later checks in the same process that parse it the same way, while the file is unchanged, instead of parsing it again for every check. Their results are unchanged.
|
|
12
|
+
|
|
13
|
+
#### Documentation
|
|
14
|
+
|
|
15
|
+
- Hook docs for `useOutlineFromMarkdown`, so `astryx hook useOutlineFromMarkdown` and `astryx search` return it, and a `useOutlineFromMarkdown — Docs Article` example block: a Markdown article and an Outline built from the same string through the hook, with a button that adds a section and its linked entry.
|
|
16
|
+
- The `usePressFeedback — Pressable Card` example now shows a small card in real playing-card proportions, with corner indices, a full face and a patterned back, and a line under it that says what to try: press and hold to see the press, tap, click, Enter or Space to flip. Copying the example (`astryx template`, the docsite's Code tab and Install) still gives you only the hook on a Card (`width={120}`, `padding={1}`) with one `<Text>` placeholder: the hint line is left out, not replaced.
|
|
17
|
+
- A new `useCombobox — Assign To Field` example block spreads the field, listbox and option props from `useCombobox` onto a `TextInput` and a list of `Item` rows: typing filters a list of teammates, ArrowUp and ArrowDown move the active option while focus stays in the input, Enter or a press picks one, and Escape closes the list. Copy it with `astryx template useComboboxHookUsage <path>`.
|
|
18
|
+
- A new `useGridFocus — Color Swatch Grid` example block wires `useGridFocus` to a color swatch picker in rows of eight: the grid has one Tab stop, the arrow keys move focus cell to cell, Home and End jump within a row, Ctrl+Home and Ctrl+End jump to the corners. Each swatch is a button, so Enter or a click picks it. Copy it with `astryx template useGridFocusHookUsage <path>`.
|
|
19
|
+
- A new `useListFocus — Recent Files` example block gives a list of buttons keyboard navigation from `useListFocus`: ArrowUp and ArrowDown move between rows, Home and End jump to the first and last row, focus wraps at the ends, and only one row is in the tab order. Copy it with `astryx template useListFocusHookUsage <path>`.
|
|
20
|
+
- A new `useOverflow — Editor Toolbar` example block shows the hook on its own: eight toolbar actions sit in a card you can resize, a hidden copy of the row holds every action plus the `More` menu marked `data-overflow-indicator`, and the actions that do not fit move into the `More` menu with no flicker. Copy it with `astryx template useOverflowHookUsage <path>`.
|
|
21
|
+
|
|
22
|
+
#### Contributors
|
|
23
|
+
|
|
24
|
+
Thanks to everyone who contributed to this release:
|
|
25
|
+
|
|
26
|
+
- @cixzhang
|
|
27
|
+
- @hskl18
|
|
28
|
+
- @kyu-rong
|
|
29
|
+
- @maheshrijal
|
|
30
|
+
- @vjeux
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
3
34
|
# 0.7.6
|
|
4
35
|
|
|
5
36
|
#### New Features
|
|
@@ -7,4 +7,14 @@
|
|
|
7
7
|
* this file into the resolved version folder.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import promoteTokenizerPresentation, {
|
|
11
|
+
meta as promoteTokenizerPresentationMeta,
|
|
12
|
+
} from './promote-tokenizer-presentation.mjs';
|
|
13
|
+
|
|
14
|
+
export default [
|
|
15
|
+
{
|
|
16
|
+
name: 'promote-tokenizer-presentation',
|
|
17
|
+
transform: promoteTokenizerPresentation,
|
|
18
|
+
meta: promoteTokenizerPresentationMeta,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Codemod: move Tokenizer's experimental presentation to the stable prop
|
|
5
|
+
*
|
|
6
|
+
* `experimental={{presentation: x}}` on a Tokenizer becomes
|
|
7
|
+
* `presentation={x}`, or `presentation="x"` for a string. Other keys stay in
|
|
8
|
+
* the `experimental` object, and an object left empty is removed. The
|
|
9
|
+
* deprecated spelling selects the same surface, so the result renders the
|
|
10
|
+
* same. Built on the shared `transformProp` helper, so it does not follow
|
|
11
|
+
* variables, helpers, wrappers, or types. Where it cannot prove the result it
|
|
12
|
+
* keeps the deprecated spelling, which still works, and leaves a TODO: an
|
|
13
|
+
* `experimental` value that is not an object literal, a spread or computed
|
|
14
|
+
* key in it, a Tokenizer that already passes `presentation`, and a spread of
|
|
15
|
+
* props after `experimental`, which could set `presentation` over the moved
|
|
16
|
+
* value. A spread before `experimental` is safe: the moved attribute takes
|
|
17
|
+
* `experimental`'s place, so it still wins over the spread, as the
|
|
18
|
+
* experimental value did, and before this release a spread's `presentation`
|
|
19
|
+
* did nothing. Each TODO is added once, so a second run changes
|
|
20
|
+
* nothing.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import {transformProp} from '../../transform-prop.mjs';
|
|
24
|
+
|
|
25
|
+
export const meta = {
|
|
26
|
+
title: "Move Tokenizer's experimental presentation to presentation",
|
|
27
|
+
description:
|
|
28
|
+
'Rewrites `experimental={{presentation: x}}` on Tokenizer to the stable ' +
|
|
29
|
+
'`presentation={x}`. Keeps the deprecated spelling, which still works, ' +
|
|
30
|
+
'with a TODO where the experimental value is not an object literal, ' +
|
|
31
|
+
'where the Tokenizer already passes presentation, and where it spreads ' +
|
|
32
|
+
'props after experimental.',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const CORE_IMPORT_RE = /^@(astryxdesign|xds)\/core(?:\/|$)/;
|
|
36
|
+
const COMPONENT_PROPS = new Map([['Tokenizer', new Set(['experimental'])]]);
|
|
37
|
+
|
|
38
|
+
const TODO_COMMENT =
|
|
39
|
+
' TODO(astryx upgrade): experimental.presentation is deprecated. Pass ' +
|
|
40
|
+
'presentation instead; this one was left unchanged because the codemod ' +
|
|
41
|
+
'could not prove the rewrite. ';
|
|
42
|
+
|
|
43
|
+
const TYPE_WRAPPERS = new Set([
|
|
44
|
+
'TSAsExpression',
|
|
45
|
+
'TSSatisfiesExpression',
|
|
46
|
+
'TSTypeAssertion',
|
|
47
|
+
'TSNonNullExpression',
|
|
48
|
+
'TypeCastExpression',
|
|
49
|
+
'ParenthesizedExpression',
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
/** @param {any} node */
|
|
53
|
+
function unwrap(node) {
|
|
54
|
+
let current = node;
|
|
55
|
+
while (current && TYPE_WRAPPERS.has(current.type)) {
|
|
56
|
+
current = current.expression;
|
|
57
|
+
}
|
|
58
|
+
return current;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The static key of an object entry, or null. @param {any} entry */
|
|
62
|
+
function keyName(entry) {
|
|
63
|
+
if (
|
|
64
|
+
(entry.type !== 'ObjectProperty' && entry.type !== 'Property') ||
|
|
65
|
+
entry.computed
|
|
66
|
+
) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const key = entry.key;
|
|
70
|
+
if (key.type === 'Identifier') {
|
|
71
|
+
return key.name;
|
|
72
|
+
}
|
|
73
|
+
if (
|
|
74
|
+
(key.type === 'StringLiteral' || key.type === 'Literal') &&
|
|
75
|
+
typeof key.value === 'string'
|
|
76
|
+
) {
|
|
77
|
+
return key.value;
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** @param {any} j @param {any} node @param {string} text */
|
|
83
|
+
function addComment(j, node, text) {
|
|
84
|
+
node.comments ??= [];
|
|
85
|
+
if (node.comments.some((/** @type {any} */ c) => c.value === text)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
node.comments.push(j.commentBlock(text, true, false));
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param {import('../../../../authoring/codemod/type').AstryxCodemodFile} file
|
|
94
|
+
* @param {import('../../../../authoring/codemod/type').CodemodTransformApi} api
|
|
95
|
+
* @returns {string | null | undefined}
|
|
96
|
+
*/
|
|
97
|
+
export default function transformer(file, api) {
|
|
98
|
+
const j = api.jscodeshift;
|
|
99
|
+
const root = j(file.source);
|
|
100
|
+
let hasChanges = false;
|
|
101
|
+
|
|
102
|
+
transformProp(
|
|
103
|
+
root,
|
|
104
|
+
j,
|
|
105
|
+
{
|
|
106
|
+
matchesImport: source => CORE_IMPORT_RE.test(source),
|
|
107
|
+
components: COMPONENT_PROPS,
|
|
108
|
+
},
|
|
109
|
+
propPath => {
|
|
110
|
+
const opening = propPath.parent?.node;
|
|
111
|
+
const attributes = opening?.attributes ?? [];
|
|
112
|
+
const prop = propPath.node;
|
|
113
|
+
const value =
|
|
114
|
+
prop.value?.type === 'JSXExpressionContainer'
|
|
115
|
+
? unwrap(prop.value.expression)
|
|
116
|
+
: null;
|
|
117
|
+
const entries =
|
|
118
|
+
value?.type === 'ObjectExpression' ? value.properties : [];
|
|
119
|
+
const presentationEntries = entries.filter(
|
|
120
|
+
(/** @type {any} */ entry) => keyName(entry) === 'presentation',
|
|
121
|
+
);
|
|
122
|
+
const hasUnprovenEntry = entries.some(
|
|
123
|
+
(/** @type {any} */ entry) => keyName(entry) == null,
|
|
124
|
+
);
|
|
125
|
+
if (
|
|
126
|
+
value?.type === 'ObjectExpression' &&
|
|
127
|
+
presentationEntries.length === 0 &&
|
|
128
|
+
!hasUnprovenEntry
|
|
129
|
+
) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const isProvable =
|
|
133
|
+
value?.type === 'ObjectExpression' &&
|
|
134
|
+
presentationEntries.length === 1 &&
|
|
135
|
+
!hasUnprovenEntry &&
|
|
136
|
+
!attributes.some(
|
|
137
|
+
(/** @type {any} */ a, /** @type {number} */ index) =>
|
|
138
|
+
(a.type === 'JSXSpreadAttribute' &&
|
|
139
|
+
index > attributes.indexOf(prop)) ||
|
|
140
|
+
(a.type === 'JSXAttribute' && a.name?.name === 'presentation'),
|
|
141
|
+
);
|
|
142
|
+
if (!isProvable) {
|
|
143
|
+
hasChanges = addComment(j, prop, TODO_COMMENT) || hasChanges;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const entry = presentationEntries[0];
|
|
148
|
+
const entryValue = entry.value;
|
|
149
|
+
const literal = unwrap(entryValue);
|
|
150
|
+
const attributeValue =
|
|
151
|
+
(literal?.type === 'StringLiteral' || literal?.type === 'Literal') &&
|
|
152
|
+
typeof literal.value === 'string'
|
|
153
|
+
? j.stringLiteral(literal.value)
|
|
154
|
+
: j.jsxExpressionContainer(entryValue);
|
|
155
|
+
const presentation = j.jsxAttribute(
|
|
156
|
+
j.jsxIdentifier('presentation'),
|
|
157
|
+
attributeValue,
|
|
158
|
+
);
|
|
159
|
+
value.properties = entries.filter((/** @type {any} */ e) => e !== entry);
|
|
160
|
+
const index = opening.attributes.indexOf(prop);
|
|
161
|
+
if (value.properties.length === 0) {
|
|
162
|
+
opening.attributes.splice(index, 1, presentation);
|
|
163
|
+
} else {
|
|
164
|
+
opening.attributes.splice(index + 1, 0, presentation);
|
|
165
|
+
}
|
|
166
|
+
hasChanges = true;
|
|
167
|
+
},
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
if (!hasChanges) return undefined;
|
|
171
|
+
// `auto` keeps every reprinted string's own quotes and writes the new
|
|
172
|
+
// attribute string in double quotes, as JSX attributes are written.
|
|
173
|
+
return root.toSource({quote: 'auto'});
|
|
174
|
+
}
|
|
@@ -140,14 +140,6 @@
|
|
|
140
140
|
"kind": "component",
|
|
141
141
|
"name": "LogStream"
|
|
142
142
|
},
|
|
143
|
-
{
|
|
144
|
-
"kind": "component",
|
|
145
|
-
"name": "MobilePowerSearch"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"kind": "component",
|
|
149
|
-
"name": "MobileTokenizer"
|
|
150
|
-
},
|
|
151
143
|
{
|
|
152
144
|
"kind": "component",
|
|
153
145
|
"name": "RadialChart"
|
|
@@ -160,6 +152,10 @@
|
|
|
160
152
|
"kind": "component",
|
|
161
153
|
"name": "Schedule"
|
|
162
154
|
},
|
|
155
|
+
{
|
|
156
|
+
"kind": "component",
|
|
157
|
+
"name": "SelectableCardGroup"
|
|
158
|
+
},
|
|
163
159
|
{
|
|
164
160
|
"kind": "component",
|
|
165
161
|
"name": "Stat"
|
|
@@ -0,0 +1,14 @@
|
|
|
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: 'useAnnounce',
|
|
7
|
+
name: 'useAnnounce — Filter Result Count',
|
|
8
|
+
displayName: 'useAnnounce — Filter Result Count',
|
|
9
|
+
description:
|
|
10
|
+
'A product filter that announces its result count with useAnnounce: once typing pauses for 500 ms, a screen reader hears "3 results" or "No results". The count has its own hasReplace instance, as the hook\'s docs advise for a changing value.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Card', 'TextInput', 'List', 'Text', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useEffect, useRef, useState} from 'react';
|
|
6
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
+
import {useAnnounce} from '@astryxdesign/core/hooks';
|
|
8
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
9
|
+
import {List, ListItem} from '@astryxdesign/core/List';
|
|
10
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
11
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
12
|
+
|
|
13
|
+
const PRODUCTS = [
|
|
14
|
+
'Desk lamp',
|
|
15
|
+
'Desk organizer',
|
|
16
|
+
'Standing desk',
|
|
17
|
+
'Office chair',
|
|
18
|
+
'Chair mat',
|
|
19
|
+
'Monitor arm',
|
|
20
|
+
'Monitor stand',
|
|
21
|
+
'Keyboard tray',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const ANNOUNCE_DELAY_MS = 500;
|
|
25
|
+
|
|
26
|
+
function filterProducts(query: string): string[] {
|
|
27
|
+
const needle = query.trim().toLowerCase();
|
|
28
|
+
return PRODUCTS.filter(product => product.toLowerCase().includes(needle));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function UseAnnounceHookUsage() {
|
|
32
|
+
const announce = useAnnounce({hasReplace: true});
|
|
33
|
+
const [query, setQuery] = useState('');
|
|
34
|
+
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
35
|
+
const matches = filterProducts(query);
|
|
36
|
+
const count = matches.length;
|
|
37
|
+
|
|
38
|
+
const handleChange = (value: string) => {
|
|
39
|
+
setQuery(value);
|
|
40
|
+
if (timerRef.current != null) {
|
|
41
|
+
clearTimeout(timerRef.current);
|
|
42
|
+
timerRef.current = null;
|
|
43
|
+
}
|
|
44
|
+
if (value === '') {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const nextCount = filterProducts(value).length;
|
|
48
|
+
timerRef.current = setTimeout(() => {
|
|
49
|
+
timerRef.current = null;
|
|
50
|
+
announce(
|
|
51
|
+
nextCount === 0
|
|
52
|
+
? 'No results'
|
|
53
|
+
: `${nextCount} ${nextCount === 1 ? 'result' : 'results'}`,
|
|
54
|
+
);
|
|
55
|
+
}, ANNOUNCE_DELAY_MS);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// A count still pending at unmount would be spoken for a filter that is gone.
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
return () => {
|
|
61
|
+
if (timerRef.current != null) {
|
|
62
|
+
clearTimeout(timerRef.current);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Card width={360} padding={4}>
|
|
69
|
+
<VStack gap={3}>
|
|
70
|
+
<TextInput
|
|
71
|
+
label="Filter products"
|
|
72
|
+
value={query}
|
|
73
|
+
onChange={handleChange}
|
|
74
|
+
hasClear
|
|
75
|
+
/>
|
|
76
|
+
{count === 0 ? (
|
|
77
|
+
<Text type="body" color="secondary">
|
|
78
|
+
No results
|
|
79
|
+
</Text>
|
|
80
|
+
) : (
|
|
81
|
+
<List density="compact">
|
|
82
|
+
{matches.map(product => (
|
|
83
|
+
<ListItem key={product} label={product} />
|
|
84
|
+
))}
|
|
85
|
+
</List>
|
|
86
|
+
)}
|
|
87
|
+
</VStack>
|
|
88
|
+
</Card>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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: 'useFocusTrap',
|
|
7
|
+
name: 'useFocusTrap — Quick Edit Panel',
|
|
8
|
+
displayName: 'useFocusTrap — Quick Edit Panel',
|
|
9
|
+
description:
|
|
10
|
+
'A custom quick-edit panel, not built on Dialog, that traps focus with useFocusTrap: focusFirst moves focus to its field on open, Tab and Shift+Tab stay inside it, Escape closes it through onEscape, and closing returns focus to the Quick edit button.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Card', 'Button', 'TextInput', 'Text', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useEffect, useState} from 'react';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
8
|
+
import {useFocusTrap} from '@astryxdesign/core/hooks';
|
|
9
|
+
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
10
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
11
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
12
|
+
|
|
13
|
+
export default function UseFocusTrapHookUsage() {
|
|
14
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
15
|
+
const [title, setTitle] = useState('Update onboarding guide');
|
|
16
|
+
const [draft, setDraft] = useState(title);
|
|
17
|
+
const close = () => setIsOpen(false);
|
|
18
|
+
const {containerRef, focusFirst} = useFocusTrap<HTMLDivElement>({
|
|
19
|
+
isActive: isOpen,
|
|
20
|
+
onEscape: close,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Runs after commit, once the panel is mounted and useFocusTrap has recorded
|
|
24
|
+
// the opener, so closing the panel returns focus to it.
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (isOpen) {
|
|
27
|
+
focusFirst();
|
|
28
|
+
}
|
|
29
|
+
}, [isOpen, focusFirst]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<HStack gap={4} vAlign="start">
|
|
33
|
+
<VStack gap={2}>
|
|
34
|
+
<Text type="body" weight="bold">
|
|
35
|
+
{title}
|
|
36
|
+
</Text>
|
|
37
|
+
<Button
|
|
38
|
+
label="Quick edit"
|
|
39
|
+
onClick={() => {
|
|
40
|
+
setDraft(title);
|
|
41
|
+
setIsOpen(true);
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
</VStack>
|
|
45
|
+
{isOpen && (
|
|
46
|
+
<Card
|
|
47
|
+
ref={containerRef}
|
|
48
|
+
role="dialog"
|
|
49
|
+
aria-label="Quick edit"
|
|
50
|
+
width={280}
|
|
51
|
+
padding={4}>
|
|
52
|
+
<VStack gap={3}>
|
|
53
|
+
<TextInput label="Title" value={draft} onChange={setDraft} />
|
|
54
|
+
<HStack gap={2} hAlign="end">
|
|
55
|
+
<Button label="Cancel" variant="secondary" onClick={close} />
|
|
56
|
+
<Button
|
|
57
|
+
label="Save"
|
|
58
|
+
variant="primary"
|
|
59
|
+
onClick={() => {
|
|
60
|
+
setTitle(draft);
|
|
61
|
+
close();
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</HStack>
|
|
65
|
+
</VStack>
|
|
66
|
+
</Card>
|
|
67
|
+
)}
|
|
68
|
+
</HStack>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -41,6 +41,7 @@ export default function TokenizerOverflow() {
|
|
|
41
41
|
value={inlineValue}
|
|
42
42
|
onChange={items => setInlineValue(items)}
|
|
43
43
|
tokenOverflowBehavior="unfocusedInline"
|
|
44
|
+
presentation="popover"
|
|
44
45
|
/>
|
|
45
46
|
</Stack>
|
|
46
47
|
<Stack direction="vertical" gap={1}>
|
|
@@ -54,6 +55,7 @@ export default function TokenizerOverflow() {
|
|
|
54
55
|
value={layerValue}
|
|
55
56
|
onChange={items => setLayerValue(items)}
|
|
56
57
|
tokenOverflowBehavior="unfocusedLayer"
|
|
58
|
+
presentation="popover"
|
|
57
59
|
/>
|
|
58
60
|
</Stack>
|
|
59
61
|
</Stack>
|
|
@@ -1874,6 +1874,10 @@ function ComposeWindow({
|
|
|
1874
1874
|
)}
|
|
1875
1875
|
</>
|
|
1876
1876
|
}
|
|
1877
|
+
// The recipient rows read as one header, so all three stay
|
|
1878
|
+
// inline fields on every device; the sheet has no end lane
|
|
1879
|
+
// for the Cc and Bcc buttons.
|
|
1880
|
+
presentation="popover"
|
|
1877
1881
|
/>
|
|
1878
1882
|
{hasCc ? (
|
|
1879
1883
|
<Tokenizer
|
|
@@ -1884,6 +1888,7 @@ function ComposeWindow({
|
|
|
1884
1888
|
value={cc}
|
|
1885
1889
|
onChange={items => setCc(items)}
|
|
1886
1890
|
hasCreate
|
|
1891
|
+
presentation="popover"
|
|
1887
1892
|
/>
|
|
1888
1893
|
) : null}
|
|
1889
1894
|
{hasBcc ? (
|
|
@@ -1895,6 +1900,7 @@ function ComposeWindow({
|
|
|
1895
1900
|
value={bcc}
|
|
1896
1901
|
onChange={items => setBcc(items)}
|
|
1897
1902
|
hasCreate
|
|
1903
|
+
presentation="popover"
|
|
1898
1904
|
/>
|
|
1899
1905
|
) : null}
|
|
1900
1906
|
<TextInput
|
|
@@ -36,6 +36,30 @@ export function moduleExportNames(file: string, cache?: ExportNameCache): {
|
|
|
36
36
|
types: Set<string>;
|
|
37
37
|
typed: boolean;
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Every file a declared subpath names, and whether each is on disk.
|
|
41
|
+
* @param {string} packageDir
|
|
42
|
+
* @param {SubpathDeclaration} declaration
|
|
43
|
+
* @returns {{files: string[], allPresent: boolean}}
|
|
44
|
+
*/
|
|
45
|
+
export function declaredTargets(packageDir: string, declaration: SubpathDeclaration): {
|
|
46
|
+
files: string[];
|
|
47
|
+
allPresent: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The names an import statement asks for that the module provably lacks.
|
|
51
|
+
* A name is missing only when every file the subpath names is on disk and
|
|
52
|
+
* read in full, and at least one of those lists includes its types: any
|
|
53
|
+
* construct the reader does not model leaves the import unchecked.
|
|
54
|
+
* @param {ImportStatement} statement
|
|
55
|
+
* @param {string[]} files candidate targets on disk
|
|
56
|
+
* @param {ExportNameCache} cache
|
|
57
|
+
* @param {boolean} [allPresent] every target the subpath names is on disk
|
|
58
|
+
* @param {boolean} [values] every name is known to be a value (a component),
|
|
59
|
+
* so a list without the module's types can still judge it
|
|
60
|
+
* @returns {string[] | null} null when it cannot be judged
|
|
61
|
+
*/
|
|
62
|
+
export function missingNames(statement: ImportStatement, files: string[], cache: ExportNameCache, allPresent?: boolean, values?: boolean): string[] | null;
|
|
39
63
|
/**
|
|
40
64
|
* Every public-import finding for one package, as notes, and the report of
|
|
41
65
|
* what could not be judged. It returns no issues: the notes are listed
|
|
@@ -667,7 +667,7 @@ function readOwnExportNames(file, cache, stack) {
|
|
|
667
667
|
* @param {SubpathDeclaration} declaration
|
|
668
668
|
* @returns {{files: string[], allPresent: boolean}}
|
|
669
669
|
*/
|
|
670
|
-
function declaredTargets(packageDir, declaration) {
|
|
670
|
+
export function declaredTargets(packageDir, declaration) {
|
|
671
671
|
if (declaration.state !== 'declared') return {files: [], allPresent: false};
|
|
672
672
|
const root = path.resolve(packageDir);
|
|
673
673
|
const all = allTargets(declaration.value)
|
|
@@ -693,7 +693,7 @@ function declaredTargets(packageDir, declaration) {
|
|
|
693
693
|
* so a list without the module's types can still judge it
|
|
694
694
|
* @returns {string[] | null} null when it cannot be judged
|
|
695
695
|
*/
|
|
696
|
-
function missingNames(
|
|
696
|
+
export function missingNames(
|
|
697
697
|
statement,
|
|
698
698
|
files,
|
|
699
699
|
cache,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8-canary.30b1896",
|
|
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",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"zod": "^4.4.3"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@astryxdesign/charts": "0.7.
|
|
128
|
-
"@astryxdesign/core": "0.7.
|
|
129
|
-
"@astryxdesign/lab": "0.7.
|
|
130
|
-
"@astryxdesign/theme-neutral": "0.7.
|
|
127
|
+
"@astryxdesign/charts": "0.7.8-canary.30b1896",
|
|
128
|
+
"@astryxdesign/core": "0.7.8-canary.30b1896",
|
|
129
|
+
"@astryxdesign/lab": "0.7.8-canary.30b1896",
|
|
130
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.30b1896"
|
|
131
131
|
},
|
|
132
132
|
"peerDependenciesMeta": {
|
|
133
133
|
"@astryxdesign/charts": {
|
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"devDependencies": {
|
|
147
|
-
"@astryxdesign/charts": "0.7.
|
|
148
|
-
"@astryxdesign/core": "0.7.
|
|
149
|
-
"@astryxdesign/lab": "0.7.
|
|
150
|
-
"@astryxdesign/theme-neutral": "0.7.
|
|
147
|
+
"@astryxdesign/charts": "0.7.8-canary.30b1896",
|
|
148
|
+
"@astryxdesign/core": "0.7.8-canary.30b1896",
|
|
149
|
+
"@astryxdesign/lab": "0.7.8-canary.30b1896",
|
|
150
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.30b1896",
|
|
151
151
|
"@heroicons/react": "^2.2.0",
|
|
152
152
|
"@stylexjs/stylex": "^0.19.0",
|
|
153
153
|
"@types/babel__core": "^7.20.5",
|