@godxjp/ui 31.26.0 → 31.26.2
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/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/data-display/prose.js +17 -9
- package/dist/contracts/measurement.json +1 -1
- package/dist/styles/data-display-layout.css +4 -0
- 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.26.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.26.2.** 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.
|
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.26.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.26.2/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.26.
|
|
65
|
+
"version": "31.26.2"
|
|
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, 2137 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.26.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.26.2.
|
|
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.26.
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.26.2`). 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.26.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.26.2/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.
|
|
@@ -5,13 +5,15 @@ import { useTranslation } from "../../i18n/use-translation.js";
|
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
import { ImagePreviewGroup } from "./image.js";
|
|
7
7
|
const PREVIEWABLE = "img:not(a img):not(button img):not(.ui-image-img)";
|
|
8
|
+
const PREVIEWING = '[data-slot="prose"][data-image-preview]';
|
|
9
|
+
const ownedBy = (host, img) => img.closest(PREVIEWING) === host;
|
|
8
10
|
function useMarkedImages(root, enabled, label) {
|
|
9
11
|
React.useLayoutEffect(() => {
|
|
10
12
|
const host = root.current;
|
|
11
13
|
if (!enabled || !host) return void 0;
|
|
12
14
|
const mark = () => {
|
|
13
15
|
for (const img of host.querySelectorAll(PREVIEWABLE)) {
|
|
14
|
-
if (img.hasAttribute("data-prose-preview")) continue;
|
|
16
|
+
if (img.hasAttribute("data-prose-preview") || !ownedBy(host, img)) continue;
|
|
15
17
|
img.setAttribute("data-prose-preview", "");
|
|
16
18
|
img.setAttribute("tabindex", "0");
|
|
17
19
|
img.setAttribute("role", "button");
|
|
@@ -44,10 +46,17 @@ const Prose = React.forwardRef(function Prose2({
|
|
|
44
46
|
[t]
|
|
45
47
|
);
|
|
46
48
|
useMarkedImages(root, imagePreview, label);
|
|
47
|
-
const open = (
|
|
48
|
-
|
|
49
|
-
if (!
|
|
50
|
-
|
|
49
|
+
const open = (event) => {
|
|
50
|
+
const target = event.target;
|
|
51
|
+
if (!imagePreview || event.defaultPrevented || !(target instanceof HTMLImageElement)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const host = root.current;
|
|
55
|
+
if (!target.hasAttribute("data-prose-preview") || !ownedBy(host, target)) return false;
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
const images = [...host.querySelectorAll("img[data-prose-preview]")].filter(
|
|
58
|
+
(img) => ownedBy(host, img)
|
|
59
|
+
);
|
|
51
60
|
setPreview({
|
|
52
61
|
items: images.map((img) => ({ src: img.currentSrc || img.src, alt: img.alt })),
|
|
53
62
|
current: Math.max(images.indexOf(target), 0)
|
|
@@ -66,16 +75,15 @@ const Prose = React.forwardRef(function Prose2({
|
|
|
66
75
|
"data-size": size === "md" ? void 0 : size,
|
|
67
76
|
"data-image-size": imageSize === "fit" ? void 0 : imageSize,
|
|
68
77
|
"data-measure": measure,
|
|
78
|
+
"data-image-preview": imagePreview ? "" : void 0,
|
|
69
79
|
className: cn("ui-prose", className),
|
|
70
80
|
onClick: (event) => {
|
|
71
81
|
onClick?.(event);
|
|
72
|
-
open(event
|
|
82
|
+
open(event);
|
|
73
83
|
},
|
|
74
84
|
onKeyDown: (event) => {
|
|
75
85
|
onKeyDown?.(event);
|
|
76
|
-
if (
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
}
|
|
86
|
+
if (event.key === "Enter" || event.key === " ") open(event);
|
|
79
87
|
},
|
|
80
88
|
...rest,
|
|
81
89
|
children
|
|
@@ -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.26.
|
|
3
|
+
"version": "31.26.2",
|
|
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