wimui 0.23.4 → 0.23.5
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/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.d.ts +11 -0
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +24 -10
- package/dist/llms-full.txt +5 -1
- package/dist/llms.txt +1 -1
- package/package.json +6 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../typography/Text/Text.cjs"),r=require("../../navigation/Link/Link.cjs"),i=require("../../typography/Title/Title.cjs"),a=require("../../typography/Blockquote/Blockquote.cjs"),o=require("../CodeBlock/CodeBlock.cjs"),s=require("./markdown-renderer.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),d=require("react-markdown");d=e.__toESM(d,1);let f=require("remark-gfm");f=e.__toESM(f,1);var p=({content:e,className:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../typography/Text/Text.cjs"),r=require("../../navigation/Link/Link.cjs"),i=require("../../typography/Title/Title.cjs"),a=require("../../typography/Blockquote/Blockquote.cjs"),o=require("../CodeBlock/CodeBlock.cjs"),s=require("./markdown-renderer.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),d=require("react-markdown");d=e.__toESM(d,1);let f=require("remark-gfm");f=e.__toESM(f,1);var p=[`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`];function m(e,t){let n=p.indexOf(t);return p[Math.max(0,n-(e-1))]}var h=({content:e,baseLevel:c=`2xl`,className:p})=>{let{t:h}=t.useWimTranslation(`form`);return(0,u.jsx)(`div`,{className:(0,l.default)(`wim-markdown-renderer`,s.default.root,p),children:(0,u.jsx)(d.default,{remarkPlugins:[f.default],components:{h1:({children:e})=>(0,u.jsx)(i.Title,{tag:`h1`,size:m(1,c),className:s.default.heading,children:e}),h2:({children:e})=>(0,u.jsx)(i.Title,{tag:`h2`,size:m(2,c),className:s.default.heading,children:e}),h3:({children:e})=>(0,u.jsx)(i.Title,{tag:`h3`,size:m(3,c),className:s.default.heading,children:e}),h4:({children:e})=>(0,u.jsx)(i.Title,{tag:`h4`,size:m(4,c),className:s.default.heading,children:e}),p:({children:e})=>(0,u.jsx)(n.Text,{className:s.default.paragraph,children:e}),a:({href:e,children:t})=>(0,u.jsx)(r.Link,{href:e,children:t}),blockquote:({children:e})=>(0,u.jsx)(a.Blockquote,{children:e}),ul:({children:e})=>(0,u.jsx)(`ul`,{className:s.default.list,children:e}),ol:({children:e})=>(0,u.jsx)(`ol`,{className:s.default.list,children:e}),li:({children:e})=>(0,u.jsx)(`li`,{className:s.default.listItem,children:e}),code({className:e,children:t,...n}){let r=/language-(\w+)/.exec(e||``);return r?(0,u.jsx)(o.CodeBlock,{code:String(t).replace(/\n$/,``),language:r[1],className:s.default.codeBlock}):(0,u.jsx)(`code`,{className:s.default.inlineCode,...n,children:t})},table:({children:e})=>(0,u.jsx)(`div`,{className:s.default.tableWrapper,children:(0,u.jsx)(`table`,{className:s.default.table,children:e})}),th:({children:e})=>(0,u.jsx)(`th`,{className:s.default.th,children:e}),td:({children:e})=>(0,u.jsx)(`td`,{className:s.default.td,children:e}),input:({type:e,checked:t,disabled:n})=>e===`checkbox`?(0,u.jsx)(`input`,{type:`checkbox`,checked:t,disabled:n,readOnly:!0,"aria-label":h(t?`markdown.task_done`:`markdown.task_todo`)}):null},children:e})})};h.displayName=`MarkdownRenderer`,exports.MarkdownRenderer=h;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/** Title sizes, smallest first. Markdown h1 starts at `baseLevel`; h2–h4 step down. */
|
|
3
|
+
declare const TITLE_SIZE_STEPS: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl"];
|
|
4
|
+
export type MarkdownHeadingSize = (typeof TITLE_SIZE_STEPS)[number];
|
|
2
5
|
export interface MarkdownRendererProps {
|
|
3
6
|
/** The markdown string to render */
|
|
4
7
|
content: string;
|
|
8
|
+
/**
|
|
9
|
+
* Visual size of markdown `h1`. `h2`–`h4` step one Title size down from this,
|
|
10
|
+
* clamped at `xs`. Does not change the HTML heading tag — that stays as
|
|
11
|
+
* written in the markdown. Default `"2xl"` keeps the historical mapping
|
|
12
|
+
* (`h1` 2xl / `h2` xl / `h3` lg / `h4` md).
|
|
13
|
+
*/
|
|
14
|
+
baseLevel?: (typeof TITLE_SIZE_STEPS)[number];
|
|
5
15
|
/** Additional CSS class for the root element */
|
|
6
16
|
className?: string;
|
|
7
17
|
/** Whether to render titles with anchor links (default: false) */
|
|
@@ -12,3 +22,4 @@ export interface MarkdownRendererProps {
|
|
|
12
22
|
* It uses react-markdown under the hood and applies WIM's typography system.
|
|
13
23
|
*/
|
|
14
24
|
export declare const MarkdownRenderer: React.FC<MarkdownRendererProps>;
|
|
25
|
+
export {};
|
|
@@ -12,34 +12,48 @@ import { jsx as c } from "react/jsx-runtime";
|
|
|
12
12
|
import l from "react-markdown";
|
|
13
13
|
import u from "remark-gfm";
|
|
14
14
|
//#region src/components/ai/MarkdownRenderer/MarkdownRenderer.tsx
|
|
15
|
-
var d =
|
|
16
|
-
|
|
15
|
+
var d = [
|
|
16
|
+
"xs",
|
|
17
|
+
"sm",
|
|
18
|
+
"md",
|
|
19
|
+
"lg",
|
|
20
|
+
"xl",
|
|
21
|
+
"2xl",
|
|
22
|
+
"3xl",
|
|
23
|
+
"4xl"
|
|
24
|
+
];
|
|
25
|
+
function f(e, t) {
|
|
26
|
+
let n = d.indexOf(t);
|
|
27
|
+
return d[Math.max(0, n - (e - 1))];
|
|
28
|
+
}
|
|
29
|
+
var p = ({ content: d, baseLevel: p = "2xl", className: m }) => {
|
|
30
|
+
let { t: h } = e("form");
|
|
17
31
|
return /* @__PURE__ */ c("div", {
|
|
18
|
-
className: s("wim-markdown-renderer", o.root,
|
|
32
|
+
className: s("wim-markdown-renderer", o.root, m),
|
|
19
33
|
children: /* @__PURE__ */ c(l, {
|
|
20
34
|
remarkPlugins: [u],
|
|
21
35
|
components: {
|
|
22
36
|
h1: ({ children: e }) => /* @__PURE__ */ c(r, {
|
|
23
37
|
tag: "h1",
|
|
24
|
-
size:
|
|
38
|
+
size: f(1, p),
|
|
25
39
|
className: o.heading,
|
|
26
40
|
children: e
|
|
27
41
|
}),
|
|
28
42
|
h2: ({ children: e }) => /* @__PURE__ */ c(r, {
|
|
29
43
|
tag: "h2",
|
|
30
|
-
size:
|
|
44
|
+
size: f(2, p),
|
|
31
45
|
className: o.heading,
|
|
32
46
|
children: e
|
|
33
47
|
}),
|
|
34
48
|
h3: ({ children: e }) => /* @__PURE__ */ c(r, {
|
|
35
49
|
tag: "h3",
|
|
36
|
-
size:
|
|
50
|
+
size: f(3, p),
|
|
37
51
|
className: o.heading,
|
|
38
52
|
children: e
|
|
39
53
|
}),
|
|
40
54
|
h4: ({ children: e }) => /* @__PURE__ */ c(r, {
|
|
41
55
|
tag: "h4",
|
|
42
|
-
size:
|
|
56
|
+
size: f(4, p),
|
|
43
57
|
className: o.heading,
|
|
44
58
|
children: e
|
|
45
59
|
}),
|
|
@@ -96,13 +110,13 @@ var d = ({ content: d, className: f }) => {
|
|
|
96
110
|
checked: t,
|
|
97
111
|
disabled: n,
|
|
98
112
|
readOnly: !0,
|
|
99
|
-
"aria-label":
|
|
113
|
+
"aria-label": h(t ? "markdown.task_done" : "markdown.task_todo")
|
|
100
114
|
}) : null
|
|
101
115
|
},
|
|
102
116
|
children: d
|
|
103
117
|
})
|
|
104
118
|
});
|
|
105
119
|
};
|
|
106
|
-
|
|
120
|
+
p.displayName = "MarkdownRenderer";
|
|
107
121
|
//#endregion
|
|
108
|
-
export {
|
|
122
|
+
export { p as MarkdownRenderer };
|
package/dist/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.23.
|
|
7
|
+
**wimui** v0.23.5 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|
|
@@ -3053,6 +3053,10 @@ When set, an expand/collapse toggle is shown.
|
|
|
3053
3053
|
- `showControls: boolean` — Whether to show controls
|
|
3054
3054
|
- **MarkdownRenderer** — MarkdownRenderer converts a markdown string into WIM UI components. It uses react-markdown under the hood and applies WIM's typography system.
|
|
3055
3055
|
- `content: string` (required) — The markdown string to render
|
|
3056
|
+
- `baseLevel: (typeof TITLE_SIZE_STEPS)[number]` = "2xl" — Visual size of markdown `h1`. `h2`–`h4` step one Title size down from this,
|
|
3057
|
+
clamped at `xs`. Does not change the HTML heading tag — that stays as
|
|
3058
|
+
written in the markdown. Default `"2xl"` keeps the historical mapping
|
|
3059
|
+
(`h1` 2xl / `h2` xl / `h3` lg / `h4` md).
|
|
3056
3060
|
- `className: string` — Additional CSS class for the root element
|
|
3057
3061
|
- `withAnchors: boolean` — Whether to render titles with anchor links (default: false)
|
|
3058
3062
|
- **ModelSelector** — ModelSelector is a dropdown for switching between AI models, surfacing the metadata that matters when choosing one — context window size and per-token pricing.
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.23.
|
|
7
|
+
**wimui** v0.23.5 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wimui",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React component library with design tokens, dark mode, i18n (en/ja/pt-BR), and WAI-ARIA compliant accessibility. 200+ components documented in Storybook.",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -323,6 +323,7 @@
|
|
|
323
323
|
"i18n:check": "node scripts/check-i18n.js",
|
|
324
324
|
"i18n:props": "node scripts/backfill-prop-keys.js",
|
|
325
325
|
"i18n:quality": "node scripts/check-i18n-quality.js",
|
|
326
|
+
"i18n:aliases": "node scripts/check-i18n-aliases.js",
|
|
326
327
|
"i18n:check:components": "node scripts/check-i18n-components.js",
|
|
327
328
|
"i18n:missing": "node scripts/find_missing_keys.js",
|
|
328
329
|
"i18n:check:mdx": "node scripts/check-mdx-hardcoded.js",
|
|
@@ -599,7 +600,8 @@
|
|
|
599
600
|
"{stories,sandbox}/**/*.tsx": [
|
|
600
601
|
"node scripts/check-slop.js",
|
|
601
602
|
"node scripts/check-story-tokens.js",
|
|
602
|
-
"node scripts/check-sandbox-pin.js"
|
|
603
|
+
"node scripts/check-sandbox-pin.js",
|
|
604
|
+
"node scripts/check-i18n-aliases.js"
|
|
603
605
|
],
|
|
604
606
|
"{src,stories}/**/*.{css,scss}": [
|
|
605
607
|
"stylelint --fix --max-warnings=0 --cache",
|
|
@@ -613,6 +615,7 @@
|
|
|
613
615
|
"node --max-old-space-size=4096 ./node_modules/eslint/bin/eslint.js --fix --max-warnings=0 --cache",
|
|
614
616
|
"node scripts/check-mdx-hardcoded.js",
|
|
615
617
|
"node scripts/check-i18n-components.js",
|
|
618
|
+
"node scripts/check-i18n-aliases.js",
|
|
616
619
|
"node scripts/check-mdx-links.js",
|
|
617
620
|
"node scripts/audit-mdx.js",
|
|
618
621
|
"node scripts/check-slop.js",
|
|
@@ -623,6 +626,7 @@
|
|
|
623
626
|
"node scripts/stage-generated.js public/locales --",
|
|
624
627
|
"node scripts/check-i18n.js",
|
|
625
628
|
"node scripts/check-i18n-quality.js",
|
|
629
|
+
"node scripts/check-i18n-aliases.js",
|
|
626
630
|
"node scripts/check-mdx-links.js",
|
|
627
631
|
"node scripts/generate-i18n-resources.js",
|
|
628
632
|
"node scripts/stage-generated.js src/i18n/generated/resources.ts src/i18n/generated/keys.ts --"
|