@godxjp/ui 31.22.0 → 31.22.1
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/agent/START-HERE.md +1 -1
- package/agent/components/ChatSuggestion.json +1 -1
- package/agent/components/CommandPalette.json +1 -1
- package/agent/components.json +2 -2
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/data-entry/chat-suggestion.js +16 -3
- package/dist/components/data-entry/command-palette.d.ts +2 -1
- package/dist/components/data-entry/command-palette.js +4 -3
- package/dist/contracts/measurement.json +1 -1
- package/dist/styles/layers.json +1 -1
- package/package.json +2 -2
package/agent/START-HERE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
You are about to write code against a design system you did not author. This file is the whole
|
|
4
4
|
contract. Read it before you write JSX.
|
|
5
5
|
|
|
6
|
-
**This catalog describes `@godxjp/ui` 31.22.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.22.1.** If the project you are editing has a different
|
|
7
7
|
version in its `package.json`, read the pinned catalog for THAT version instead
|
|
8
8
|
(`…/v<their-version>/agent/…`). A catalog newer than the installed package describes props that do
|
|
9
9
|
not exist yet; older, and it hides props that do. Neither failure announces itself.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"defaultValue": "\"/\"",
|
|
21
|
-
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so
|
|
21
|
+
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so `/` opens right after Japanese text (gh#1127); an ASCII letter still blocks a ONE-character trigger, so `https://x` opens nothing. A multi-character trigger (`[[`) opens anywhere, `abc[[` included (gh#1129). After Escape the list stays shut until a new trigger is typed. Use \"@\" for mentions, \"[[\" for a link picker.",
|
|
22
22
|
"name": "triggerCharacter",
|
|
23
23
|
"type": "string"
|
|
24
24
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"defaultValue": "true",
|
|
27
|
-
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘
|
|
27
|
+
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘ on Apple platforms and Ctrl elsewhere — never both, so Ctrl+O / Ctrl+P keep their editing meaning on a Mac (gh#1129); Shift / Alt must match exactly. Never fires during IME composition; the default trigger shows the combo (gh#1126).",
|
|
28
28
|
"name": "shortcut",
|
|
29
29
|
"type": "boolean | string"
|
|
30
30
|
},
|
package/agent/components.json
CHANGED
|
@@ -14154,7 +14154,7 @@
|
|
|
14154
14154
|
},
|
|
14155
14155
|
{
|
|
14156
14156
|
"defaultValue": "true",
|
|
14157
|
-
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘
|
|
14157
|
+
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘ on Apple platforms and Ctrl elsewhere — never both, so Ctrl+O / Ctrl+P keep their editing meaning on a Mac (gh#1129); Shift / Alt must match exactly. Never fires during IME composition; the default trigger shows the combo (gh#1126).",
|
|
14158
14158
|
"name": "shortcut",
|
|
14159
14159
|
"type": "boolean | string"
|
|
14160
14160
|
},
|
|
@@ -15483,7 +15483,7 @@
|
|
|
15483
15483
|
},
|
|
15484
15484
|
{
|
|
15485
15485
|
"defaultValue": "\"/\"",
|
|
15486
|
-
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so
|
|
15486
|
+
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so `/` opens right after Japanese text (gh#1127); an ASCII letter still blocks a ONE-character trigger, so `https://x` opens nothing. A multi-character trigger (`[[`) opens anywhere, `abc[[` included (gh#1129). After Escape the list stays shut until a new trigger is typed. Use \"@\" for mentions, \"[[\" for a link picker.",
|
|
15487
15487
|
"name": "triggerCharacter",
|
|
15488
15488
|
"type": "string"
|
|
15489
15489
|
},
|
package/agent/index.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"note": "Pin to the tag that matches the @godxjp/ui version you installed. A catalog newer than your package describes props you do not have; older, and it hides props you do.",
|
|
49
49
|
"read": {
|
|
50
50
|
"live": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/index.json",
|
|
51
|
-
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.22.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.22.1/agent/index.json"
|
|
52
52
|
},
|
|
53
53
|
"source": "mcp/src/data — the same data @godxjp/ui-mcp serves — plus the foundation and semantic token tiers, read from src/tokens/*.css",
|
|
54
54
|
"start": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/START-HERE.md",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"foundation": "the seeds a consumer is invited to set — --primary, --background, --radius",
|
|
63
63
|
"semantic": "named roles that follow the seeds — --ring, --text-link, --overlay-background"
|
|
64
64
|
},
|
|
65
|
-
"version": "31.22.
|
|
65
|
+
"version": "31.22.1"
|
|
66
66
|
}
|
package/agent/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @godxjp/ui
|
|
2
2
|
|
|
3
3
|
> A Japanese-enterprise React design system: 181 components, 2129 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.22.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.22.1.
|
|
5
5
|
|
|
6
6
|
If your client can run a process, do not read these files — run the MCP server instead
|
|
7
|
-
(`npx @godxjp/ui-mcp@31.22.
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.22.1`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -26,7 +26,7 @@ that can only fetch URLs.
|
|
|
26
26
|
## Pinning
|
|
27
27
|
|
|
28
28
|
Every URL above tracks `main`. To pin to the release a project actually installed, swap `main` for
|
|
29
|
-
the tag: `.../godx-jp/godxjp-ui/v31.22.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.22.1/agent/...`. A catalog that does not match the installed
|
|
30
30
|
package describes props that are absent, or hides props that are present, and says nothing either way.
|
|
31
31
|
|
|
32
32
|
Pinned catalogs only exist for releases whose tag actually contains `agent/`. If `…/v<version>/agent/index.json` returns 404, that release predates this catalog: read `…/main/…` instead and compare `index.json` → `version` against the package you have, so you at least know which way it drifted.
|
|
@@ -16,8 +16,10 @@ function matchTrigger(text, caret, trigger, { allowSpaces = false, terminator }
|
|
|
16
16
|
if (allowSpaces ? /\n/.test(query) : /\s/.test(query)) return null;
|
|
17
17
|
if (terminator && query.includes(terminator)) return null;
|
|
18
18
|
const preceding = start === 0 ? "" : before[start - 1];
|
|
19
|
-
if (preceding !== "" && !/\s/.test(preceding) && preceding.charCodeAt(0) < 128)
|
|
20
|
-
|
|
19
|
+
if (trigger.length === 1 && preceding !== "" && !/\s/.test(preceding) && preceding.charCodeAt(0) < 128) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return { query, start };
|
|
21
23
|
}
|
|
22
24
|
function levelItems(items, path) {
|
|
23
25
|
let current = items;
|
|
@@ -106,19 +108,30 @@ function ChatSuggestion({
|
|
|
106
108
|
setListId(content?.querySelector("[cmdk-list]")?.id || void 0);
|
|
107
109
|
setActiveId(content?.querySelector('[cmdk-item][aria-selected="true"]')?.id || void 0);
|
|
108
110
|
});
|
|
111
|
+
const dismissedStartRef = React.useRef(null);
|
|
109
112
|
const close = React.useCallback(() => {
|
|
113
|
+
const node = field();
|
|
114
|
+
const caret = node ? node.selectionStart ?? node.value.length : 0;
|
|
115
|
+
const hit = node ? matchTrigger(node.value, caret, triggerCharacter, { allowSpaces, terminator }) : null;
|
|
116
|
+
dismissedStartRef.current = hit ? hit.start : null;
|
|
110
117
|
setOpen(false);
|
|
111
118
|
field()?.focus();
|
|
112
|
-
}, [field, setOpen]);
|
|
119
|
+
}, [field, setOpen, triggerCharacter, allowSpaces, terminator]);
|
|
113
120
|
const evaluate = React.useCallback(() => {
|
|
114
121
|
const node = field();
|
|
115
122
|
if (!node) return;
|
|
116
123
|
const caret = node.selectionStart ?? node.value.length;
|
|
117
124
|
const hit = matchTrigger(node.value, caret, triggerCharacter, { allowSpaces, terminator });
|
|
118
125
|
if (!hit) {
|
|
126
|
+
dismissedStartRef.current = null;
|
|
127
|
+
setOpen(false);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (hit.start === dismissedStartRef.current) {
|
|
119
131
|
setOpen(false);
|
|
120
132
|
return;
|
|
121
133
|
}
|
|
134
|
+
dismissedStartRef.current = null;
|
|
122
135
|
setQuery(hit.query);
|
|
123
136
|
setOpen(true);
|
|
124
137
|
}, [field, setOpen, triggerCharacter, allowSpaces, terminator]);
|
|
@@ -80,7 +80,8 @@ export type CommandPaletteProps = {
|
|
|
80
80
|
* The global shortcut that toggles the palette (gh#1126). `true` (default) is ⌘K / Ctrl+K;
|
|
81
81
|
* `false` binds none; a combo string — `"mod+o"`, `"mod+p"`, `"mod+shift+p"` — binds that, so two
|
|
82
82
|
* palettes (a quick switcher and a command palette) can live side by side. `mod` is ⌘ on Apple
|
|
83
|
-
* and Ctrl elsewhere
|
|
83
|
+
* and Ctrl elsewhere — never both, so Ctrl+O keeps its editing meaning on a Mac; `shift` and
|
|
84
|
+
* `alt` must match exactly, so `mod+p` and
|
|
84
85
|
* `mod+shift+p` are different shortcuts. Never fires during IME composition.
|
|
85
86
|
*/
|
|
86
87
|
shortcut?: boolean | string;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
CommandItem,
|
|
13
13
|
CommandList
|
|
14
14
|
} from "./command.js";
|
|
15
|
+
import { isApplePlatform } from "../../lib/platform.js";
|
|
15
16
|
import { isImeComposing } from "../../lib/ime.js";
|
|
16
17
|
function parseShortcut(shortcut) {
|
|
17
18
|
if (shortcut === false) return null;
|
|
@@ -30,15 +31,15 @@ function parseShortcut(shortcut) {
|
|
|
30
31
|
function shortcutMatches(spec, event) {
|
|
31
32
|
const keyMatches = event.key.toLowerCase() === spec.key || /^[a-z]$/.test(spec.key) && event.code === `Key${spec.key.toUpperCase()}`;
|
|
32
33
|
if (!keyMatches) return false;
|
|
33
|
-
if (spec.mod && !(event.metaKey
|
|
34
|
+
if (spec.mod && !(isApplePlatform() ? event.metaKey : event.ctrlKey)) return false;
|
|
34
35
|
if (spec.meta && !event.metaKey) return false;
|
|
35
36
|
if (spec.ctrl && !event.ctrlKey) return false;
|
|
36
37
|
return event.shiftKey === spec.shift && event.altKey === spec.alt;
|
|
37
38
|
}
|
|
38
39
|
function shortcutHint(spec) {
|
|
39
40
|
return [
|
|
40
|
-
spec.
|
|
41
|
-
spec.ctrl ? "Ctrl+" : "",
|
|
41
|
+
spec.meta || spec.mod && isApplePlatform() ? "\u2318" : "",
|
|
42
|
+
spec.ctrl || spec.mod && !isApplePlatform() ? "Ctrl+" : "",
|
|
42
43
|
spec.alt ? "\u2325" : "",
|
|
43
44
|
spec.shift ? "\u21E7" : "",
|
|
44
45
|
spec.key.length === 1 ? spec.key.toUpperCase() : spec.key
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
|
|
3
|
-
"version": "31.22.
|
|
3
|
+
"version": "31.22.1",
|
|
4
4
|
"targetSize": {
|
|
5
5
|
"standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
|
|
6
6
|
"min": 24,
|
package/dist/styles/layers.json
CHANGED