react-lib-tools 0.0.16 → 0.0.19
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/{GettingStartedRoute-CEUe6r9y.js → GettingStartedRoute-DmHalwMP.js} +2 -2
- package/dist/{GettingStartedRoute-CEUe6r9y.js.map → GettingStartedRoute-DmHalwMP.js.map} +1 -1
- package/dist/{GettingStartedRoute-CfzB3Nvh.cjs → GettingStartedRoute-LGDNviy5.cjs} +2 -2
- package/dist/{GettingStartedRoute-CfzB3Nvh.cjs.map → GettingStartedRoute-LGDNviy5.cjs.map} +1 -1
- package/dist/{PageNotFound-DFuXJCTh.cjs → PageNotFound-DIt5wQ4x.cjs} +2 -2
- package/dist/{PageNotFound-DFuXJCTh.cjs.map → PageNotFound-DIt5wQ4x.cjs.map} +1 -1
- package/dist/{PageNotFound-DPz5PSvL.js → PageNotFound-DuD7brn5.js} +2 -2
- package/dist/{PageNotFound-DPz5PSvL.js.map → PageNotFound-DuD7brn5.js.map} +1 -1
- package/dist/{SupportRoute-CwdgvBKD.js → SupportRoute-B9n9OCoW.js} +2 -2
- package/dist/{SupportRoute-CwdgvBKD.js.map → SupportRoute-B9n9OCoW.js.map} +1 -1
- package/dist/{SupportRoute-BNyX9bXT.cjs → SupportRoute-DWEe-0A7.cjs} +2 -2
- package/dist/{SupportRoute-BNyX9bXT.cjs.map → SupportRoute-DWEe-0A7.cjs.map} +1 -1
- package/dist/VersionsRoute-Br6RZivR.cjs +2 -0
- package/dist/VersionsRoute-Br6RZivR.cjs.map +1 -0
- package/dist/{VersionsRoute-DIBb1iS1.js → VersionsRoute-DOa8Yrmb.js} +20 -19
- package/dist/VersionsRoute-DOa8Yrmb.js.map +1 -0
- package/dist/{index-BGQ7Uo9T.js → index-D1Hn63kY.js} +5 -5
- package/dist/{index-BGQ7Uo9T.js.map → index-D1Hn63kY.js.map} +1 -1
- package/dist/{index-Dishg8MY.cjs → index-DleNtYr0.cjs} +2 -2
- package/dist/{index-Dishg8MY.cjs.map → index-DleNtYr0.cjs.map} +1 -1
- package/dist/react-lib-tools.cjs +1 -1
- package/dist/react-lib-tools.js +1 -1
- package/package.json +6 -4
- package/scripts/utils/docs/compileComponent.ts +8 -5
- package/scripts/utils/docs/getDefaultValueType.test.ts +51 -0
- package/scripts/utils/docs/getDefaultValueType.ts +50 -0
- package/styles.css +4 -0
- package/dist/VersionsRoute-DIBb1iS1.js.map +0 -1
- package/dist/VersionsRoute-WwJGbKHn.cjs +0 -2
- package/dist/VersionsRoute-WwJGbKHn.cjs.map +0 -1
package/dist/react-lib-tools.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DleNtYr0.cjs");exports.AppRoot=e.AppRoot;exports.Block=e.Block;exports.Box=e.Box;exports.Button=e.Button;exports.Callout=e.Callout;exports.Checkbox=e.Checkbox;exports.Code=e.Code;exports.ComponentProps=e.ComponentProps;exports.ComponentPropsSection=e.ComponentPropsSection;exports.DocsSection=e.DocsSection;exports.ErrorBoundary=e.ErrorBoundary;exports.ExternalLink=e.ExternalLink;exports.Header=e.Header;exports.ImperativeHandle=e.ImperativeHandle;exports.Input=e.Input;exports.Link=e.Link;exports.LoadingSpinner=e.LoadingSpinner;exports.NavLink=e.NavLink;exports.NavSection=e.NavSection;exports.Radio=e.Radio;exports.Select=e.Select;exports.assert=e.assert;exports.cn=e.cn;exports.getIntentClassNames=e.getIntentClassNames;
|
|
2
2
|
//# sourceMappingURL=react-lib-tools.cjs.map
|
package/dist/react-lib-tools.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-
|
|
1
|
+
import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-D1Hn63kY.js";
|
|
2
2
|
export {
|
|
3
3
|
o as AppRoot,
|
|
4
4
|
e as Block,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lib-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
|
|
6
6
|
"contributors": [
|
|
@@ -42,25 +42,27 @@
|
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
44
44
|
},
|
|
45
|
-
"
|
|
45
|
+
"dependencies": {
|
|
46
46
|
"@codemirror/lang-css": "latest",
|
|
47
47
|
"@codemirror/lang-html": "latest",
|
|
48
48
|
"@codemirror/lang-javascript": "latest",
|
|
49
49
|
"@codemirror/lang-markdown": "latest",
|
|
50
50
|
"@codemirror/language": "latest",
|
|
51
51
|
"@codemirror/state": "latest",
|
|
52
|
+
"@lezer/highlight": "latest",
|
|
53
|
+
"@ts-ast-parser/core": "^0.8.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
52
56
|
"@csstools/postcss-oklab-function": "^4.0.11",
|
|
53
57
|
"@eslint/js": "^9.30.1",
|
|
54
58
|
"@headlessui/react": "^2.2.4",
|
|
55
59
|
"@headlessui/tailwindcss": "^0.2.2",
|
|
56
60
|
"@heroicons/react": "^2.2.0",
|
|
57
|
-
"@lezer/highlight": "latest",
|
|
58
61
|
"@tailwindcss/vite": "^4.1.11",
|
|
59
62
|
"@tailwindplus/elements": "^1.0.5",
|
|
60
63
|
"@testing-library/jest-dom": "^6.6.4",
|
|
61
64
|
"@testing-library/react": "^16.3.0",
|
|
62
65
|
"@testing-library/user-event": "^14.6.1",
|
|
63
|
-
"@ts-ast-parser/core": "^0.8.0",
|
|
64
66
|
"@types/compression": "^1.8.1",
|
|
65
67
|
"@types/express": "^5.0.5",
|
|
66
68
|
"@types/markdown-it": "^14.1.2",
|
|
@@ -8,6 +8,7 @@ import { syntaxHighlight } from "../syntax-highlight.ts";
|
|
|
8
8
|
import { getPropTypeText } from "./getPropTypeText.ts";
|
|
9
9
|
import { parseDescription } from "./parseDescription.ts";
|
|
10
10
|
import { propsToTable } from "./propsToTable.ts";
|
|
11
|
+
import { getDefaultValueType } from "./getDefaultValueType.ts";
|
|
11
12
|
|
|
12
13
|
const TOKEN_TO_REPLACE = "TOKEN_TO_REPLACE";
|
|
13
14
|
|
|
@@ -61,11 +62,13 @@ export async function compileComponent({
|
|
|
61
62
|
let formattedValue = prop.defaultValue.value;
|
|
62
63
|
|
|
63
64
|
// Wrap strings in quotes
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
switch (getDefaultValueType(prop.defaultValue.value)) {
|
|
66
|
+
case "string": {
|
|
67
|
+
// But don't double quote, e.g.
|
|
68
|
+
// tagName?: keyof IntrinsicElements = ""div" as TagName"
|
|
69
|
+
if (!prop.defaultValue.value.includes('" as ')) {
|
|
70
|
+
formattedValue = `"${prop.defaultValue.value}"`;
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { getDefaultValueType } from "./getDefaultValueType";
|
|
3
|
+
|
|
4
|
+
describe("getDefaultValueType", () => {
|
|
5
|
+
test.each(["[]", "[1,2]", '["a","b","c"]'])(
|
|
6
|
+
"should identify array value: %s",
|
|
7
|
+
(value) => {
|
|
8
|
+
expect(getDefaultValueType(value)).toBe("array");
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
test.each(["true", "false"])("should identify boolean value: %s", (value) => {
|
|
13
|
+
expect(getDefaultValueType(value)).toBe("boolean");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("should detect null values", () => {
|
|
17
|
+
expect(getDefaultValueType("null")).toBe("null");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test.each(["0", "1", "1.0", "-1", "-1.0"])(
|
|
21
|
+
"should identify numeric value: %s",
|
|
22
|
+
(value) => {
|
|
23
|
+
expect(getDefaultValueType(value)).toBe("number");
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
test.each(["{}", '{foo:"a",bar:true, baz:123}'])(
|
|
28
|
+
"should identify object value: %s",
|
|
29
|
+
(value) => {
|
|
30
|
+
expect(getDefaultValueType(value)).toBe("object");
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
test.each(["", " ", "foo bar baz"])(
|
|
35
|
+
"should identify string value: %o",
|
|
36
|
+
(value) => {
|
|
37
|
+
expect(getDefaultValueType(value)).toBe("string");
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
test("should detect undefined values", () => {
|
|
42
|
+
expect(getDefaultValueType("undefined")).toBe("undefined");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test.each(["1a", "-.!/"])(
|
|
46
|
+
"should identify invalid value: %o as string",
|
|
47
|
+
(value) => {
|
|
48
|
+
expect(getDefaultValueType(value)).toBe("string");
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type Type =
|
|
2
|
+
| "array"
|
|
3
|
+
| "boolean"
|
|
4
|
+
| "null"
|
|
5
|
+
| "number"
|
|
6
|
+
| "object"
|
|
7
|
+
| "string"
|
|
8
|
+
| "undefined";
|
|
9
|
+
|
|
10
|
+
export function getDefaultValueType(value: string): Type {
|
|
11
|
+
switch (value) {
|
|
12
|
+
case "false":
|
|
13
|
+
case "true": {
|
|
14
|
+
return "boolean";
|
|
15
|
+
}
|
|
16
|
+
case "null": {
|
|
17
|
+
return "null";
|
|
18
|
+
}
|
|
19
|
+
case "undefined": {
|
|
20
|
+
return "undefined";
|
|
21
|
+
}
|
|
22
|
+
default: {
|
|
23
|
+
if (value.trim() === "") {
|
|
24
|
+
return "string";
|
|
25
|
+
} else if (value.startsWith("{") && value.endsWith("}")) {
|
|
26
|
+
return "object";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(value);
|
|
33
|
+
switch (typeof parsed) {
|
|
34
|
+
case "number": {
|
|
35
|
+
return "number";
|
|
36
|
+
}
|
|
37
|
+
default: {
|
|
38
|
+
if (Array.isArray(parsed)) {
|
|
39
|
+
return "array";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return "object";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} catch {
|
|
46
|
+
// No-op
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return "string";
|
|
50
|
+
}
|
package/styles.css
CHANGED
|
@@ -102,6 +102,9 @@ code {
|
|
|
102
102
|
color: rgba(255, 255, 255, 0.8);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
.tok-bool {
|
|
106
|
+
color: var(--color-teal-300);
|
|
107
|
+
}
|
|
105
108
|
.tok-comment {
|
|
106
109
|
color: var(--color-slate-500);
|
|
107
110
|
}
|
|
@@ -115,6 +118,7 @@ code {
|
|
|
115
118
|
.tok-meta {
|
|
116
119
|
}
|
|
117
120
|
.tok-number {
|
|
121
|
+
color: var(--color-teal-300);
|
|
118
122
|
}
|
|
119
123
|
.tok-operator {
|
|
120
124
|
color: var(--color-slate-400);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VersionsRoute-DIBb1iS1.js","sources":["../scripts/utils/assert.ts","../public/svgs/globe.svg?react","../lib/components/app/components/VersionLink.tsx","../lib/components/app/routes/VersionsRoute.tsx"],"sourcesContent":["export function assert(\n expectedCondition: unknown,\n message: string = \"Assertion error\"\n): asserts expectedCondition {\n if (!expectedCondition) {\n console.error(message);\n\n throw Error(message);\n }\n}\n","import * as React from \"react\";\nconst SvgGlobe = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 640 640\", fill: \"currentColor\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M119.7 263.7L150.6 294.6C156.6 300.6 164.7 304 173.2 304L194.7 304C203.2 304 211.3 307.4 217.3 313.4L246.6 342.7C252.6 348.7 256 356.8 256 365.3L256 402.8C256 411.3 259.4 419.4 265.4 425.4L278.7 438.7C284.7 444.7 288.1 452.8 288.1 461.3L288.1 480C288.1 497.7 302.4 512 320.1 512C337.8 512 352.1 497.7 352.1 480L352.1 477.3C352.1 468.8 355.5 460.7 361.5 454.7L406.8 409.4C412.8 403.4 416.2 395.3 416.2 386.8L416.2 352.1C416.2 334.4 401.9 320.1 384.2 320.1L301.5 320.1C293 320.1 284.9 316.7 278.9 310.7L262.9 294.7C258.7 290.5 256.3 284.7 256.3 278.7C256.3 266.2 266.4 256.1 278.9 256.1L313.6 256.1C326.1 256.1 336.2 246 336.2 233.5C336.2 227.5 333.8 221.7 329.6 217.5L309.9 197.8C306 194 304 189.1 304 184C304 178.9 306 174 309.7 170.3L327 153C332.8 147.2 336.1 139.3 336.1 131.1C336.1 123.9 333.7 117.4 329.7 112.2C326.5 112.1 323.3 112 320.1 112C224.7 112 144.4 176.2 119.8 263.7zM528 320C528 285.4 519.6 252.8 504.6 224.2C498.2 225.1 491.9 228.1 486.7 233.3L473.3 246.7C467.3 252.7 463.9 260.8 463.9 269.3L463.9 304C463.9 321.7 478.2 336 495.9 336L520 336C522.5 336 525 335.7 527.3 335.2C527.7 330.2 527.8 325.1 527.8 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z\" }));\nexport default SvgGlobe;\n","import GlobeIcon from \"../../../../public/svgs/globe.svg?react\";\nimport TagsIcon from \"../../../../public/svgs/tags.svg?react\";\nimport { ExternalLink } from \"../../ExternalLink\";\n\nexport function VersionLink({\n url,\n version\n}: {\n url: string;\n version: string;\n}) {\n return (\n <li className=\"list-disc\">\n {version.split(\".\").slice(0, 2).join(\".\")}\n <span className=\"text-slate-400\">.x</span>\n {url && (\n <ExternalLink\n aria-label={`Documentation for version ${version}`}\n className=\"ml-4\"\n href={url}\n >\n <GlobeIcon className=\"inline w-4 h-4 text-teal-200\" /> documentation\n </ExternalLink>\n )}\n <ExternalLink\n aria-label={`GitHub tag for version ${version}`}\n className=\"ml-4\"\n href={`https://github.com/bvaughn/react-window/releases/tag/${version}`}\n >\n <TagsIcon className=\"inline w-4 h-4 text-teal-200\" /> source code\n </ExternalLink>\n </li>\n );\n}\n","import { Fragment } from \"react/jsx-runtime\";\nimport { assert } from \"../../../../scripts/utils/assert\";\nimport { useLibraryContext } from \"../../../hooks/useLibraryContext\";\nimport { Box } from \"../../Box\";\nimport { Header } from \"../../Header\";\nimport { VersionLink } from \"../components/VersionLink\";\n\nexport default function VersionsRoute() {\n const { versions } = useLibraryContext();\n assert(versions !== undefined);\n\n return (\n <Box direction=\"column\" gap={2}>\n <Header title=\"Previous releases\" />\n <div>Click below to view documentation for past releases.</div>\n {Object.entries(versions)\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map(([major, minors]) => (\n <Fragment key={major}>\n <div className=\"text-lg mt-2\">Version {major}</div>\n <ul className=\"pl-8\">\n {Object.entries(minors)\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map(([version, url]) => (\n <VersionLink key={version} url={url} version={version} />\n ))}\n </ul>\n </Fragment>\n ))}\n </Box>\n );\n}\n"],"names":["assert","expectedCondition","message","SvgGlobe","props","React","VersionLink","url","version","jsxs","jsx","ExternalLink","GlobeIcon","TagsIcon","VersionsRoute","versions","useLibraryContext","Box","Header","a","b","major","minors","Fragment"],"mappings":";;;AAAO,SAASA,EACdC,GACAC,IAAkB,mBACS;AAC3B,MAAI,CAACD;AACH,kBAAQ,MAAMC,CAAO,GAEf,MAAMA,CAAO;AAEvB;ACRA,MAAMC,IAAW,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,eAAe,MAAM,gBAAgB,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,ytCAAwtC,CAAE,CAAC;ACG76C,SAASC,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AACF,GAGG;AACD,SACE,gBAAAC,EAAC,MAAA,EAAG,WAAU,aACX,UAAA;AAAA,IAAAD,EAAQ,MAAM,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG;AAAA,IACxC,gBAAAE,EAAC,QAAA,EAAK,WAAU,kBAAiB,UAAA,MAAE;AAAA,IAClCH,KACC,gBAAAE;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,cAAY,6BAA6BH,CAAO;AAAA,QAChD,WAAU;AAAA,QACV,MAAMD;AAAA,QAEN,UAAA;AAAA,UAAA,gBAAAG,EAACE,GAAA,EAAU,WAAU,+BAAA,CAA+B;AAAA,UAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAG1D,gBAAAH;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,cAAY,0BAA0BH,CAAO;AAAA,QAC7C,WAAU;AAAA,QACV,MAAM,wDAAwDA,CAAO;AAAA,QAErE,UAAA;AAAA,UAAA,gBAAAE,EAACG,GAAA,EAAS,WAAU,+BAAA,CAA+B;AAAA,UAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACvD,GACF;AAEJ;AC1BA,SAAwBC,IAAgB;AACtC,QAAM,EAAE,UAAAC,EAAA,IAAaC,EAAA;AACrB,SAAAhB,EAAOe,MAAa,MAAS,GAG3B,gBAAAN,EAACQ,GAAA,EAAI,WAAU,UAAS,KAAK,GAC3B,UAAA;AAAA,IAAA,gBAAAP,EAACQ,GAAA,EAAO,OAAM,oBAAA,CAAoB;AAAA,IAClC,gBAAAR,EAAC,SAAI,UAAA,uDAAA,CAAoD;AAAA,IACxD,OAAO,QAAQK,CAAQ,EACrB,KAAK,CAACI,GAAGC,MAAMA,EAAE,CAAC,EAAE,cAAcD,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC,CAACE,GAAOC,CAAM,MAClB,gBAAAb,EAACc,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAd,EAAC,OAAA,EAAI,WAAU,gBAAe,UAAA;AAAA,QAAA;AAAA,QAASY;AAAA,MAAA,GAAM;AAAA,MAC7C,gBAAAX,EAAC,MAAA,EAAG,WAAU,QACX,iBAAO,QAAQY,CAAM,EACnB,KAAK,CAACH,GAAGC,MAAMA,EAAE,CAAC,EAAE,cAAcD,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC,CAACX,GAASD,CAAG,wBAChBD,GAAA,EAA0B,KAAAC,GAAU,SAAAC,EAAA,GAAnBA,CAAqC,CACxD,EAAA,CACL;AAAA,IAAA,EAAA,GARaa,CASf,CACD;AAAA,EAAA,GACL;AAEJ;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("./index-Dishg8MY.cjs"),o=require("react");function c(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const i=c(o);function C(t,e="Assertion error"){if(!t)throw console.error(e),Error(e)}const u=t=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",...t},i.createElement("path",{d:"M119.7 263.7L150.6 294.6C156.6 300.6 164.7 304 173.2 304L194.7 304C203.2 304 211.3 307.4 217.3 313.4L246.6 342.7C252.6 348.7 256 356.8 256 365.3L256 402.8C256 411.3 259.4 419.4 265.4 425.4L278.7 438.7C284.7 444.7 288.1 452.8 288.1 461.3L288.1 480C288.1 497.7 302.4 512 320.1 512C337.8 512 352.1 497.7 352.1 480L352.1 477.3C352.1 468.8 355.5 460.7 361.5 454.7L406.8 409.4C412.8 403.4 416.2 395.3 416.2 386.8L416.2 352.1C416.2 334.4 401.9 320.1 384.2 320.1L301.5 320.1C293 320.1 284.9 316.7 278.9 310.7L262.9 294.7C258.7 290.5 256.3 284.7 256.3 278.7C256.3 266.2 266.4 256.1 278.9 256.1L313.6 256.1C326.1 256.1 336.2 246 336.2 233.5C336.2 227.5 333.8 221.7 329.6 217.5L309.9 197.8C306 194 304 189.1 304 184C304 178.9 306 174 309.7 170.3L327 153C332.8 147.2 336.1 139.3 336.1 131.1C336.1 123.9 333.7 117.4 329.7 112.2C326.5 112.1 323.3 112 320.1 112C224.7 112 144.4 176.2 119.8 263.7zM528 320C528 285.4 519.6 252.8 504.6 224.2C498.2 225.1 491.9 228.1 486.7 233.3L473.3 246.7C467.3 252.7 463.9 260.8 463.9 269.3L463.9 304C463.9 321.7 478.2 336 495.9 336L520 336C522.5 336 525 335.7 527.3 335.2C527.7 330.2 527.8 325.1 527.8 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z"}));function d({url:t,version:e}){return r.jsxs("li",{className:"list-disc",children:[e.split(".").slice(0,2).join("."),r.jsx("span",{className:"text-slate-400",children:".x"}),t&&r.jsxs(a.ExternalLink,{"aria-label":`Documentation for version ${e}`,className:"ml-4",href:t,children:[r.jsx(u,{className:"inline w-4 h-4 text-teal-200"})," documentation"]}),r.jsxs(a.ExternalLink,{"aria-label":`GitHub tag for version ${e}`,className:"ml-4",href:`https://github.com/bvaughn/react-window/releases/tag/${e}`,children:[r.jsx(a.SvgTags,{className:"inline w-4 h-4 text-teal-200"})," source code"]})]})}function m(){const{versions:t}=a.useLibraryContext();return C(t!==void 0),r.jsxs(a.Box,{direction:"column",gap:2,children:[r.jsx(a.Header,{title:"Previous releases"}),r.jsx("div",{children:"Click below to view documentation for past releases."}),Object.entries(t).sort((e,s)=>s[0].localeCompare(e[0])).map(([e,s])=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"text-lg mt-2",children:["Version ",e]}),r.jsx("ul",{className:"pl-8",children:Object.entries(s).sort((n,l)=>l[0].localeCompare(n[0])).map(([n,l])=>r.jsx(d,{url:l,version:n},n))})]},e))]})}exports.default=m;
|
|
2
|
-
//# sourceMappingURL=VersionsRoute-WwJGbKHn.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VersionsRoute-WwJGbKHn.cjs","sources":["../scripts/utils/assert.ts","../public/svgs/globe.svg?react","../lib/components/app/components/VersionLink.tsx","../lib/components/app/routes/VersionsRoute.tsx"],"sourcesContent":["export function assert(\n expectedCondition: unknown,\n message: string = \"Assertion error\"\n): asserts expectedCondition {\n if (!expectedCondition) {\n console.error(message);\n\n throw Error(message);\n }\n}\n","import * as React from \"react\";\nconst SvgGlobe = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 640 640\", fill: \"currentColor\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M119.7 263.7L150.6 294.6C156.6 300.6 164.7 304 173.2 304L194.7 304C203.2 304 211.3 307.4 217.3 313.4L246.6 342.7C252.6 348.7 256 356.8 256 365.3L256 402.8C256 411.3 259.4 419.4 265.4 425.4L278.7 438.7C284.7 444.7 288.1 452.8 288.1 461.3L288.1 480C288.1 497.7 302.4 512 320.1 512C337.8 512 352.1 497.7 352.1 480L352.1 477.3C352.1 468.8 355.5 460.7 361.5 454.7L406.8 409.4C412.8 403.4 416.2 395.3 416.2 386.8L416.2 352.1C416.2 334.4 401.9 320.1 384.2 320.1L301.5 320.1C293 320.1 284.9 316.7 278.9 310.7L262.9 294.7C258.7 290.5 256.3 284.7 256.3 278.7C256.3 266.2 266.4 256.1 278.9 256.1L313.6 256.1C326.1 256.1 336.2 246 336.2 233.5C336.2 227.5 333.8 221.7 329.6 217.5L309.9 197.8C306 194 304 189.1 304 184C304 178.9 306 174 309.7 170.3L327 153C332.8 147.2 336.1 139.3 336.1 131.1C336.1 123.9 333.7 117.4 329.7 112.2C326.5 112.1 323.3 112 320.1 112C224.7 112 144.4 176.2 119.8 263.7zM528 320C528 285.4 519.6 252.8 504.6 224.2C498.2 225.1 491.9 228.1 486.7 233.3L473.3 246.7C467.3 252.7 463.9 260.8 463.9 269.3L463.9 304C463.9 321.7 478.2 336 495.9 336L520 336C522.5 336 525 335.7 527.3 335.2C527.7 330.2 527.8 325.1 527.8 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z\" }));\nexport default SvgGlobe;\n","import GlobeIcon from \"../../../../public/svgs/globe.svg?react\";\nimport TagsIcon from \"../../../../public/svgs/tags.svg?react\";\nimport { ExternalLink } from \"../../ExternalLink\";\n\nexport function VersionLink({\n url,\n version\n}: {\n url: string;\n version: string;\n}) {\n return (\n <li className=\"list-disc\">\n {version.split(\".\").slice(0, 2).join(\".\")}\n <span className=\"text-slate-400\">.x</span>\n {url && (\n <ExternalLink\n aria-label={`Documentation for version ${version}`}\n className=\"ml-4\"\n href={url}\n >\n <GlobeIcon className=\"inline w-4 h-4 text-teal-200\" /> documentation\n </ExternalLink>\n )}\n <ExternalLink\n aria-label={`GitHub tag for version ${version}`}\n className=\"ml-4\"\n href={`https://github.com/bvaughn/react-window/releases/tag/${version}`}\n >\n <TagsIcon className=\"inline w-4 h-4 text-teal-200\" /> source code\n </ExternalLink>\n </li>\n );\n}\n","import { Fragment } from \"react/jsx-runtime\";\nimport { assert } from \"../../../../scripts/utils/assert\";\nimport { useLibraryContext } from \"../../../hooks/useLibraryContext\";\nimport { Box } from \"../../Box\";\nimport { Header } from \"../../Header\";\nimport { VersionLink } from \"../components/VersionLink\";\n\nexport default function VersionsRoute() {\n const { versions } = useLibraryContext();\n assert(versions !== undefined);\n\n return (\n <Box direction=\"column\" gap={2}>\n <Header title=\"Previous releases\" />\n <div>Click below to view documentation for past releases.</div>\n {Object.entries(versions)\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map(([major, minors]) => (\n <Fragment key={major}>\n <div className=\"text-lg mt-2\">Version {major}</div>\n <ul className=\"pl-8\">\n {Object.entries(minors)\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map(([version, url]) => (\n <VersionLink key={version} url={url} version={version} />\n ))}\n </ul>\n </Fragment>\n ))}\n </Box>\n );\n}\n"],"names":["assert","expectedCondition","message","SvgGlobe","props","React","VersionLink","url","version","jsxs","jsx","ExternalLink","GlobeIcon","TagsIcon","VersionsRoute","versions","useLibraryContext","Box","Header","a","b","major","minors","Fragment"],"mappings":"ocAAO,SAASA,EACdC,EACAC,EAAkB,kBACS,CAC3B,GAAI,CAACD,EACH,cAAQ,MAAMC,CAAO,EAEf,MAAMA,CAAO,CAEvB,CCRA,MAAMC,EAAYC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,6BAA8B,QAAS,cAAe,KAAM,eAAgB,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,wtCAAwtC,CAAE,CAAC,ECG76C,SAASC,EAAY,CAC1B,IAAAC,EACA,QAAAC,CACF,EAGG,CACD,OACEC,EAAAA,KAAC,KAAA,CAAG,UAAU,YACX,SAAA,CAAAD,EAAQ,MAAM,GAAG,EAAE,MAAM,EAAG,CAAC,EAAE,KAAK,GAAG,EACxCE,EAAAA,IAAC,OAAA,CAAK,UAAU,iBAAiB,SAAA,KAAE,EAClCH,GACCE,EAAAA,KAACE,EAAAA,aAAA,CACC,aAAY,6BAA6BH,CAAO,GAChD,UAAU,OACV,KAAMD,EAEN,SAAA,CAAAG,EAAAA,IAACE,EAAA,CAAU,UAAU,8BAAA,CAA+B,EAAE,gBAAA,CAAA,CAAA,EAG1DH,EAAAA,KAACE,EAAAA,aAAA,CACC,aAAY,0BAA0BH,CAAO,GAC7C,UAAU,OACV,KAAM,wDAAwDA,CAAO,GAErE,SAAA,CAAAE,EAAAA,IAACG,EAAAA,QAAA,CAAS,UAAU,8BAAA,CAA+B,EAAE,cAAA,CAAA,CAAA,CACvD,EACF,CAEJ,CC1BA,SAAwBC,GAAgB,CACtC,KAAM,CAAE,SAAAC,CAAA,EAAaC,oBAAA,EACrB,OAAAhB,EAAOe,IAAa,MAAS,EAG3BN,EAAAA,KAACQ,EAAAA,IAAA,CAAI,UAAU,SAAS,IAAK,EAC3B,SAAA,CAAAP,EAAAA,IAACQ,EAAAA,OAAA,CAAO,MAAM,mBAAA,CAAoB,EAClCR,EAAAA,IAAC,OAAI,SAAA,sDAAA,CAAoD,EACxD,OAAO,QAAQK,CAAQ,EACrB,KAAK,CAACI,EAAGC,IAAMA,EAAE,CAAC,EAAE,cAAcD,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC,CAACE,EAAOC,CAAM,IAClBb,EAAAA,KAACc,WAAA,CACC,SAAA,CAAAd,EAAAA,KAAC,MAAA,CAAI,UAAU,eAAe,SAAA,CAAA,WAASY,CAAA,EAAM,EAC7CX,EAAAA,IAAC,KAAA,CAAG,UAAU,OACX,gBAAO,QAAQY,CAAM,EACnB,KAAK,CAACH,EAAGC,IAAMA,EAAE,CAAC,EAAE,cAAcD,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC,CAACX,EAASD,CAAG,UAChBD,EAAA,CAA0B,IAAAC,EAAU,QAAAC,CAAA,EAAnBA,CAAqC,CACxD,CAAA,CACL,CAAA,CAAA,EARaa,CASf,CACD,CAAA,EACL,CAEJ"}
|