@tenphi/renderer 0.22.1 → 0.23.0
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/client/code-copy.js +3 -3
- package/dist/client/code-copy.js.map +1 -1
- package/dist/client/heading-links.js +4 -4
- package/dist/client/heading-links.js.map +1 -1
- package/dist/client/navigation.js +3 -3
- package/dist/client/navigation.js.map +1 -1
- package/dist/client/search.js +1 -1
- package/dist/client/search.js.map +1 -1
- package/dist/client/table-of-contents.js +2 -2
- package/dist/client/table-of-contents.js.map +1 -1
- package/dist/components/Card.styles.js +1 -0
- package/dist/components/CodeGroup.astro +8 -1
- package/dist/components/CodeGroup.styles.js +1 -2
- package/dist/components/Document.styles.js +47 -31
- package/dist/components/EditLink.astro +1 -1
- package/dist/components/Header.styles.js +13 -13
- package/dist/components/HeaderLinks.astro +4 -8
- package/dist/components/HeaderLinks.styles.js +17 -17
- package/dist/components/Hero.styles.js +28 -30
- package/dist/components/Icon.astro +3 -3
- package/dist/components/LanguageSelect.styles.js +8 -8
- package/dist/components/MainContent.styles.js +3 -3
- package/dist/components/MainPane.styles.js +1 -1
- package/dist/components/MarkdownAlert.styles.js +16 -17
- package/dist/components/MarkdownCodeBlock.styles.js +31 -19
- package/dist/components/MarkdownContent.styles.js +47 -89
- package/dist/components/MarkdownHeading.styles.js +23 -24
- package/dist/components/MarkdownInlineCode.styles.js +1 -1
- package/dist/components/MarkdownTable.styles.js +5 -5
- package/dist/components/Mermaid.styles.js +4 -1
- package/dist/components/MermaidSource.styles.js +1 -1
- package/dist/components/MobileMenuFooter.styles.js +1 -1
- package/dist/components/MobileMenuToggle.styles.js +3 -3
- package/dist/components/MobileNavigationTabs.astro +3 -2
- package/dist/components/MobileNavigationTabs.styles.js +3 -3
- package/dist/components/MobileTableOfContents.styles.js +2 -2
- package/dist/components/PackageVersion.styles.js +1 -1
- package/dist/components/PageFrame.styles.js +6 -6
- package/dist/components/Pagination.astro +2 -2
- package/dist/components/Pagination.styles.js +10 -10
- package/dist/components/Preview.astro +3 -4
- package/dist/components/Preview.styles.js +2 -2
- package/dist/components/Search.styles.js +13 -13
- package/dist/components/SearchButton.styles.js +10 -10
- package/dist/components/SearchResults.styles.js +21 -31
- package/dist/components/SelectPopover.astro +6 -6
- package/dist/components/Sidebar.styles.js +58 -49
- package/dist/components/SidebarList.astro +9 -6
- package/dist/components/SiteLogo.astro +2 -2
- package/dist/components/SiteLogo.styles.js +4 -4
- package/dist/components/SyntaxHighlight.styles.js +69 -48
- package/dist/components/TableOfContents.styles.js +1 -1
- package/dist/components/TableOfContentsLayout.styles.js +7 -7
- package/dist/components/ThemeSelect.styles.js +12 -12
- package/dist/components/TopNavigation.styles.js +1 -1
- package/dist/components/VersionSwitcher.styles.js +1 -1
- package/dist/components/select-popover-styles.js +14 -14
- package/dist/components/tasty-states.js +10 -9
- package/dist/eslint-plugin.js +6 -9
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/dist/markdown/rendered-content.js +2 -2
- package/dist/markdown/rendered-content.js.map +1 -1
- package/dist/overrides/Header.astro +8 -12
- package/dist/overrides/Hero.astro +11 -6
- package/dist/overrides/MobileMenuFooter.astro +1 -1
- package/dist/overrides/MobileMenuToggle.astro +6 -5
- package/dist/overrides/PageFrame.astro +4 -3
- package/dist/overrides/Search.astro +7 -7
- package/dist/overrides/Sidebar.astro +2 -3
- package/dist/overrides/ThemeSelect.astro +2 -2
- package/dist/routes/Page.astro +11 -8
- package/dist/styling.js +1 -1
- package/dist/{tasty-states-_JhxFdK1.js → tasty-states-BIgiJQ3N.js} +7 -10
- package/dist/tasty-states-BIgiJQ3N.js.map +1 -0
- package/dist/theme/shiki-theme.d.ts.map +1 -1
- package/dist/theme/shiki-theme.js +37 -19
- package/dist/theme/shiki-theme.js.map +1 -1
- package/package.json +3 -3
- package/dist/tasty-states-_JhxFdK1.js.map +0 -1
|
@@ -15,7 +15,7 @@ const logo = content.logo;
|
|
|
15
15
|
aria-hidden={logo.decorative ? "true" : undefined}
|
|
16
16
|
>
|
|
17
17
|
<img
|
|
18
|
-
|
|
18
|
+
data-element={logo.dark ? "Light" : undefined}
|
|
19
19
|
src={logo.light.src}
|
|
20
20
|
width={logo.light.width}
|
|
21
21
|
height={logo.light.height}
|
|
@@ -24,7 +24,7 @@ const logo = content.logo;
|
|
|
24
24
|
/>
|
|
25
25
|
{logo.dark && (
|
|
26
26
|
<img
|
|
27
|
-
|
|
27
|
+
data-element="Dark"
|
|
28
28
|
src={logo.dark.src}
|
|
29
29
|
width={logo.dark.width}
|
|
30
30
|
height={logo.dark.height}
|
|
@@ -11,8 +11,8 @@ export const SiteLogoRoot = defineComponent("SiteLogo", {
|
|
|
11
11
|
alignItems: "center",
|
|
12
12
|
justifyContent: "center",
|
|
13
13
|
flexShrink: 0,
|
|
14
|
-
inlineSize: { "": "auto max 12rem", "
|
|
15
|
-
blockSize: { "": "2rem", "
|
|
14
|
+
inlineSize: { "": "auto max 12rem", "!@md": "auto max 30vw" },
|
|
15
|
+
blockSize: { "": "2rem", "!@md": "1.75rem" },
|
|
16
16
|
Image: {
|
|
17
17
|
$: "> img",
|
|
18
18
|
display: "block",
|
|
@@ -21,11 +21,11 @@ export const SiteLogoRoot = defineComponent("SiteLogo", {
|
|
|
21
21
|
objectFit: "contain",
|
|
22
22
|
},
|
|
23
23
|
Light: {
|
|
24
|
-
$: ">
|
|
24
|
+
$: "> Light",
|
|
25
25
|
hide: { "": false, "@dark": true },
|
|
26
26
|
},
|
|
27
27
|
Dark: {
|
|
28
|
-
$: ">
|
|
28
|
+
$: "> Dark",
|
|
29
29
|
hide: { "": true, "@dark": false },
|
|
30
30
|
},
|
|
31
31
|
},
|
|
@@ -11,75 +11,96 @@ export function SyntaxHighlightStyles() {
|
|
|
11
11
|
resolveComponentStyles("SyntaxHighlight", {
|
|
12
12
|
color: {
|
|
13
13
|
"": null,
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
},
|
|
28
|
-
fill: { "": null, "
|
|
29
|
-
overflowX: { "": null, "
|
|
30
|
-
whiteSpace: { "": null, "
|
|
31
|
-
overflowWrap: { "": null, "
|
|
14
|
+
"[data-syntax-comment]": "#syntax-comment",
|
|
15
|
+
"[data-syntax-punctuation]": "#syntax-punctuation",
|
|
16
|
+
"[data-syntax-keyword]": "#syntax-keyword",
|
|
17
|
+
"[data-syntax-string]": "#syntax-string",
|
|
18
|
+
"[data-syntax-token]": "#syntax-token",
|
|
19
|
+
"[data-syntax-property]": "#syntax-property",
|
|
20
|
+
"[data-syntax-number]": "#syntax-number",
|
|
21
|
+
"[data-syntax-function]": "#syntax-function",
|
|
22
|
+
"[data-syntax-value]": "#syntax-value",
|
|
23
|
+
"[data-syntax-operator]": "#syntax-operator",
|
|
24
|
+
"[data-syntax-text]": "#syntax-text",
|
|
25
|
+
"[data-green-text]": "#green-text",
|
|
26
|
+
"[data-red-text]": "#red-text",
|
|
27
|
+
},
|
|
28
|
+
fill: { "": null, "[data-syntax-bg]": "#syntax-bg" },
|
|
29
|
+
overflowX: { "": null, "[data-syntax-scroll]": "auto" },
|
|
30
|
+
whiteSpace: { "": null, "[data-syntax-wrap]": "pre-wrap" },
|
|
31
|
+
overflowWrap: { "": null, "[data-syntax-wrap]": "break-word" },
|
|
32
32
|
// Descendant identities stay neutral so these rules retain their original weight.
|
|
33
|
-
Marker: {
|
|
33
|
+
Marker: {
|
|
34
|
+
$: ":where(span)",
|
|
35
|
+
userSelect: { "": null, "@own(syntax-marker)": "none" },
|
|
36
|
+
},
|
|
34
37
|
Comment: {
|
|
35
|
-
$: ":where(
|
|
36
|
-
color: "#syntax-comment",
|
|
38
|
+
$: ":where(span)",
|
|
39
|
+
color: { "": null, "@own(syntax-comment)": "#syntax-comment" },
|
|
37
40
|
},
|
|
38
41
|
Punctuation: {
|
|
39
|
-
$: ":where(
|
|
40
|
-
color: "#syntax-punctuation",
|
|
42
|
+
$: ":where(span)",
|
|
43
|
+
color: { "": null, "@own(syntax-punctuation)": "#syntax-punctuation" },
|
|
41
44
|
},
|
|
42
45
|
Keyword: {
|
|
43
|
-
$: ":where(
|
|
44
|
-
color: "#syntax-keyword",
|
|
46
|
+
$: ":where(span)",
|
|
47
|
+
color: { "": null, "@own(syntax-keyword)": "#syntax-keyword" },
|
|
45
48
|
},
|
|
46
49
|
String: {
|
|
47
|
-
$: ":where(
|
|
48
|
-
color: "#syntax-string",
|
|
50
|
+
$: ":where(span)",
|
|
51
|
+
color: { "": null, "@own(syntax-string)": "#syntax-string" },
|
|
49
52
|
},
|
|
50
53
|
Token: {
|
|
51
|
-
$: ":where(
|
|
52
|
-
color: "#syntax-token",
|
|
54
|
+
$: ":where(span)",
|
|
55
|
+
color: { "": null, "@own(syntax-token)": "#syntax-token" },
|
|
53
56
|
},
|
|
54
57
|
Property: {
|
|
55
|
-
$: ":where(
|
|
56
|
-
color: "#syntax-property",
|
|
58
|
+
$: ":where(span)",
|
|
59
|
+
color: { "": null, "@own(syntax-property)": "#syntax-property" },
|
|
57
60
|
},
|
|
58
61
|
Number: {
|
|
59
|
-
$: ":where(
|
|
60
|
-
color: "#syntax-number",
|
|
62
|
+
$: ":where(span)",
|
|
63
|
+
color: { "": null, "@own(syntax-number)": "#syntax-number" },
|
|
61
64
|
},
|
|
62
65
|
Function: {
|
|
63
|
-
$: ":where(
|
|
64
|
-
color: "#syntax-function",
|
|
66
|
+
$: ":where(span)",
|
|
67
|
+
color: { "": null, "@own(syntax-function)": "#syntax-function" },
|
|
65
68
|
},
|
|
66
69
|
Value: {
|
|
67
|
-
$: ":where(
|
|
68
|
-
color: "#syntax-value",
|
|
70
|
+
$: ":where(span)",
|
|
71
|
+
color: { "": null, "@own(syntax-value)": "#syntax-value" },
|
|
69
72
|
},
|
|
70
73
|
Operator: {
|
|
71
|
-
$: ":where(
|
|
72
|
-
color: "#syntax-operator",
|
|
73
|
-
},
|
|
74
|
-
Text: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
$: ":where(span)",
|
|
75
|
+
color: { "": null, "@own(syntax-operator)": "#syntax-operator" },
|
|
76
|
+
},
|
|
77
|
+
Text: {
|
|
78
|
+
$: ":where(span)",
|
|
79
|
+
color: { "": null, "@own(syntax-text)": "#syntax-text" },
|
|
80
|
+
},
|
|
81
|
+
Bg: {
|
|
82
|
+
$: ":where(span)",
|
|
83
|
+
fill: { "": null, "@own(syntax-bg)": "#syntax-bg" },
|
|
84
|
+
},
|
|
85
|
+
Inserted: {
|
|
86
|
+
$: ":where(span)",
|
|
87
|
+
color: { "": null, "@own(green-text)": "#green-text" },
|
|
88
|
+
},
|
|
89
|
+
Deleted: {
|
|
90
|
+
$: ":where(span)",
|
|
91
|
+
color: { "": null, "@own(red-text)": "#red-text" },
|
|
92
|
+
},
|
|
93
|
+
Italic: {
|
|
94
|
+
$: ":where(span)",
|
|
95
|
+
preset: { "": null, "@own(syntax-italic)": "italic" },
|
|
96
|
+
},
|
|
97
|
+
Strong: {
|
|
98
|
+
$: ":where(span)",
|
|
99
|
+
preset: { "": null, "@own(syntax-strong)": "strong" },
|
|
100
|
+
},
|
|
80
101
|
Underline: {
|
|
81
|
-
$: ":where(
|
|
82
|
-
textDecoration: "underline",
|
|
102
|
+
$: ":where(span)",
|
|
103
|
+
textDecoration: { "": null, "@own(syntax-underline)": "underline" },
|
|
83
104
|
},
|
|
84
105
|
}),
|
|
85
106
|
);
|
|
@@ -8,7 +8,7 @@ export const TableOfContentsRoot = defineComponent("TableOfContents", {
|
|
|
8
8
|
"data-element": "TableOfContents",
|
|
9
9
|
styles: {
|
|
10
10
|
display: "block",
|
|
11
|
-
hide: { "": false, "
|
|
11
|
+
hide: { "": false, "!@lg": true },
|
|
12
12
|
blockPadding: "($gap * 4) start",
|
|
13
13
|
inlinePadding: "$docs-sidebar-pad-x",
|
|
14
14
|
Heading: {
|
|
@@ -12,25 +12,25 @@ export const TableOfContentsLayoutRoot = defineComponent(
|
|
|
12
12
|
display: { "": "", ":has(cookbook-mobile-toc)": "block" },
|
|
13
13
|
hide: {
|
|
14
14
|
"": false,
|
|
15
|
-
"
|
|
15
|
+
"!@lg": true,
|
|
16
16
|
":has(cookbook-mobile-toc)": false,
|
|
17
17
|
},
|
|
18
|
-
order: { "": "2", "
|
|
18
|
+
order: { "": "2", "!@lg": "0" },
|
|
19
19
|
position: "relative",
|
|
20
20
|
inlineSize: {
|
|
21
21
|
"": "max($sidebar-width, calc($sidebar-width + (100% - $content-width - $sidebar-width) / 2))",
|
|
22
|
-
"
|
|
22
|
+
"!@lg": "100%",
|
|
23
23
|
},
|
|
24
24
|
Content: {
|
|
25
|
-
$: "
|
|
26
|
-
position: { "": "sticky", "
|
|
25
|
+
$: "Content",
|
|
26
|
+
position: { "": "sticky", "!@lg": "static" },
|
|
27
27
|
blockInset: "$docs-nav-height start",
|
|
28
28
|
inlineSize: "100%",
|
|
29
29
|
blockSize: {
|
|
30
30
|
"": "(100vh - $docs-nav-height)",
|
|
31
|
-
"
|
|
31
|
+
"!@lg": "auto",
|
|
32
32
|
},
|
|
33
|
-
overflowY: { "": "auto", "
|
|
33
|
+
overflowY: { "": "auto", "!@lg": "visible" },
|
|
34
34
|
scrollbar: "none",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
@@ -16,11 +16,11 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
|
|
|
16
16
|
placeItems: "center",
|
|
17
17
|
inlineSize: {
|
|
18
18
|
"": "$control-height",
|
|
19
|
-
"
|
|
19
|
+
"!@md": "$docs-menu-button-size",
|
|
20
20
|
},
|
|
21
21
|
blockSize: {
|
|
22
22
|
"": "$control-height",
|
|
23
|
-
"
|
|
23
|
+
"!@md": "$docs-menu-button-size",
|
|
24
24
|
},
|
|
25
25
|
padding: "0",
|
|
26
26
|
color: "#text-soft",
|
|
@@ -33,11 +33,11 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
|
|
|
33
33
|
$: "> button",
|
|
34
34
|
color: {
|
|
35
35
|
"": null,
|
|
36
|
-
"@own(:hover) | :has([popover]:popover-open)": "#text",
|
|
36
|
+
"@own(:hover) | :has([popover]:is(:popover-open))": "#text",
|
|
37
37
|
},
|
|
38
38
|
fill: {
|
|
39
39
|
"": null,
|
|
40
|
-
"@own(:hover) | :has([popover]:popover-open)": "#surface-2-hover",
|
|
40
|
+
"@own(:hover) | :has([popover]:is(:popover-open))": "#surface-2-hover",
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
ActiveTrigger: {
|
|
@@ -48,14 +48,14 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
|
|
|
48
48
|
Icon: {
|
|
49
49
|
$: "> button svg",
|
|
50
50
|
display: "block",
|
|
51
|
-
inlineSize: { "": "1.25rem", "
|
|
52
|
-
blockSize: { "": "1.25rem", "
|
|
51
|
+
inlineSize: { "": "1.25rem", "!@md": "1.125rem" },
|
|
52
|
+
blockSize: { "": "1.25rem", "!@md": "1.125rem" },
|
|
53
53
|
},
|
|
54
54
|
Panel: {
|
|
55
55
|
$: "Panel",
|
|
56
56
|
position: "fixed",
|
|
57
57
|
inset: "auto",
|
|
58
|
-
blockInset: { "": "4rem start", "
|
|
58
|
+
blockInset: { "": "4rem start", "!@md": "3.5rem start" },
|
|
59
59
|
inlineInset:
|
|
60
60
|
"max($docs-nav-pad-x, ((100vw - $layout-width) / 2 + $docs-sidebar-pad-x)) end",
|
|
61
61
|
inlineSize: "min(15rem, calc(100vw - 2 * $docs-nav-pad-x))",
|
|
@@ -81,9 +81,9 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
|
|
|
81
81
|
$: '[data-element="Panel"]',
|
|
82
82
|
opacity: {
|
|
83
83
|
"": null,
|
|
84
|
-
"@own(
|
|
84
|
+
"@own(:is(:popover-open) & [data-open])": "1",
|
|
85
85
|
},
|
|
86
|
-
scale: { "": null, "@own(
|
|
86
|
+
scale: { "": null, "@own(:is(:popover-open) & [data-open])": "1" },
|
|
87
87
|
},
|
|
88
88
|
Section: {
|
|
89
89
|
$: "fieldset",
|
|
@@ -164,15 +164,15 @@ export const ThemeSelectRoot = defineComponent("ThemeSelect", {
|
|
|
164
164
|
$: "label > svg",
|
|
165
165
|
inlineMargin: {
|
|
166
166
|
"": null,
|
|
167
|
-
"@own(:
|
|
167
|
+
"@own(:last-child)": "auto start",
|
|
168
168
|
},
|
|
169
|
-
visibility: { "": null, "@own(:
|
|
169
|
+
visibility: { "": null, "@own(:last-child)": "hidden" },
|
|
170
170
|
},
|
|
171
171
|
SelectedCheckmark: {
|
|
172
172
|
$: "label > svg",
|
|
173
173
|
visibility: {
|
|
174
174
|
"": null,
|
|
175
|
-
"@own(:is(
|
|
175
|
+
"@own(:last-child & :is(:has(input:checked) >))": "visible",
|
|
176
176
|
},
|
|
177
177
|
},
|
|
178
178
|
},
|
|
@@ -8,7 +8,7 @@ export const TopNavigationRoot = defineComponent("TopNavigation", {
|
|
|
8
8
|
"data-element": "TopNavigation",
|
|
9
9
|
styles: {
|
|
10
10
|
display: "flex",
|
|
11
|
-
hide: { "": false, "
|
|
11
|
+
hide: { "": false, "!@md": true },
|
|
12
12
|
alignItems: "stretch",
|
|
13
13
|
gap: "clamp(1.25rem, 2.5vw, 2.5rem)",
|
|
14
14
|
inlineSize: "100%",
|
|
@@ -38,7 +38,7 @@ export const VersionSwitcherRoot = defineComponent("VersionSwitcher", {
|
|
|
38
38
|
blockInset: "(anchor(bottom) + $gap) start, auto end",
|
|
39
39
|
inlineInset: {
|
|
40
40
|
"": "anchor(left) start, auto end",
|
|
41
|
-
"
|
|
41
|
+
"!@md": "auto start, anchor(right) end",
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
},
|
|
@@ -21,21 +21,21 @@ export function selectPopoverStyles({
|
|
|
21
21
|
$: "> button",
|
|
22
22
|
color: {
|
|
23
23
|
"": null,
|
|
24
|
-
"@own(:hover) | :has([popover]:popover-open)": "#text",
|
|
24
|
+
"@own(:hover) | :has([popover]:is(:popover-open))": "#text",
|
|
25
25
|
},
|
|
26
26
|
fill: {
|
|
27
27
|
"": null,
|
|
28
|
-
"@own(:hover) | :has([popover]:popover-open)": "#surface-2-hover",
|
|
28
|
+
"@own(:hover) | :has([popover]:is(:popover-open))": "#surface-2-hover",
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
TriggerLabel: {
|
|
32
|
-
$: "
|
|
32
|
+
$: "TriggerLabel",
|
|
33
33
|
overflow: "hidden",
|
|
34
34
|
textOverflow: "ellipsis",
|
|
35
35
|
whiteSpace: "nowrap",
|
|
36
36
|
},
|
|
37
37
|
Caret: {
|
|
38
|
-
$: "> button >
|
|
38
|
+
$: "> button > Caret",
|
|
39
39
|
flexShrink: "0",
|
|
40
40
|
inlineSize: "0.875rem",
|
|
41
41
|
blockSize: "0.875rem",
|
|
@@ -67,12 +67,12 @@ export function selectPopoverStyles({
|
|
|
67
67
|
$: '> [data-element="Panel"]',
|
|
68
68
|
opacity: {
|
|
69
69
|
"": null,
|
|
70
|
-
"@own(
|
|
70
|
+
"@own(:is(:popover-open) & [data-open])": "1",
|
|
71
71
|
},
|
|
72
|
-
scale: { "": null, "@own(
|
|
72
|
+
scale: { "": null, "@own(:is(:popover-open) & [data-open])": "1" },
|
|
73
73
|
},
|
|
74
74
|
PanelTitle: {
|
|
75
|
-
$: "
|
|
75
|
+
$: "PanelTitle",
|
|
76
76
|
padding: "($gap * 0.75) $gap",
|
|
77
77
|
color: "#text-muted",
|
|
78
78
|
preset: "small / strong",
|
|
@@ -92,22 +92,22 @@ export function selectPopoverStyles({
|
|
|
92
92
|
},
|
|
93
93
|
[hoverOption]: {
|
|
94
94
|
$: "nav a",
|
|
95
|
-
color: { "": null, "@own(:
|
|
96
|
-
fill: { "": null, "@own(:
|
|
95
|
+
color: { "": null, "@own(:hover)": "#text" },
|
|
96
|
+
fill: { "": null, "@own(:hover)": "#surface-2-hover" },
|
|
97
97
|
},
|
|
98
98
|
[currentOption]: {
|
|
99
99
|
$: "nav a",
|
|
100
100
|
color: {
|
|
101
101
|
"": null,
|
|
102
|
-
'@own(
|
|
102
|
+
'@own([aria-current="page"])': "#accent-text",
|
|
103
103
|
},
|
|
104
104
|
fill: {
|
|
105
105
|
"": null,
|
|
106
|
-
'@own(
|
|
106
|
+
'@own([aria-current="page"])': "#accent-surface-2-subtle",
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
Checkmark: {
|
|
110
|
-
$: "nav a >
|
|
110
|
+
$: "nav a > Checkmark",
|
|
111
111
|
flexShrink: "0",
|
|
112
112
|
inlineMargin: "auto start",
|
|
113
113
|
inlineSize: "1rem",
|
|
@@ -115,10 +115,10 @@ export function selectPopoverStyles({
|
|
|
115
115
|
visibility: "hidden",
|
|
116
116
|
},
|
|
117
117
|
SelectedCheckmark: {
|
|
118
|
-
$: "nav a >
|
|
118
|
+
$: "nav a > [data-element=Checkmark]",
|
|
119
119
|
visibility: {
|
|
120
120
|
"": null,
|
|
121
|
-
'@own(:is(
|
|
121
|
+
'@own(:is([aria-current="page"] >))': "visible",
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
};
|
|
@@ -13,16 +13,17 @@ export const cookbookStates = {
|
|
|
13
13
|
"@system-dark": systemDark,
|
|
14
14
|
"@light": `@root(theme=light) | (!@root(theme) & ${systemLight})`,
|
|
15
15
|
"@dark": `@root(theme=dark) | (!@root(theme) & ${systemDark})`,
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@compact": "@media(w <= 23rem)",
|
|
20
|
-
"@shell-mobile": "@media(w <= 48rem)",
|
|
21
|
-
"@shell-desktop": "@media(w > 48rem)",
|
|
22
|
-
"@narrow-layout": "@media(w < 72rem)",
|
|
23
|
-
"@medium-layout": "@media(w >= 50rem) & @media(w < 72rem)",
|
|
16
|
+
"@sm": "@media(w > 40rem)",
|
|
17
|
+
"@md": "@media(w >= 50rem)",
|
|
18
|
+
"@lg": "@media(w >= 72rem)",
|
|
24
19
|
"@reduced-motion": "@media(prefers-reduced-motion: reduce)",
|
|
25
|
-
|
|
20
|
+
// Check each selected element's ancestry so isolated sections do not affect
|
|
21
|
+
// surrounding prose in the same Markdown root.
|
|
22
|
+
"@prose": "@own(!:is([data-not-content] *))",
|
|
23
|
+
"@prose-block":
|
|
24
|
+
"@own(!:is([data-not-content] *)) & (@own(block) | @own(!:is(a,strong,em,del,span,input,code,br,li,dt,dd))) & (@own(:is(:not(a,strong,em,del,span,input,code,br) + *)) | @own(:is([data-block] + *)))",
|
|
25
|
+
"@prose-heading":
|
|
26
|
+
"@own(!:is([data-not-content] *)) & @own(!:is(h1 + *,h2 + *,h3 + *,h4 + *,h5 + *,h6 + *,[data-heading] + *))",
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
let configured = false;
|
package/dist/eslint-plugin.js
CHANGED
|
@@ -126,16 +126,13 @@ var tasty_config_default = {
|
|
|
126
126
|
"@system-dark",
|
|
127
127
|
"@light",
|
|
128
128
|
"@dark",
|
|
129
|
-
"@
|
|
130
|
-
"@
|
|
131
|
-
"@
|
|
132
|
-
"@compact",
|
|
133
|
-
"@shell-mobile",
|
|
134
|
-
"@shell-desktop",
|
|
135
|
-
"@narrow-layout",
|
|
136
|
-
"@medium-layout",
|
|
129
|
+
"@sm",
|
|
130
|
+
"@md",
|
|
131
|
+
"@lg",
|
|
137
132
|
"@reduced-motion",
|
|
138
|
-
"@
|
|
133
|
+
"@prose",
|
|
134
|
+
"@prose-block",
|
|
135
|
+
"@prose-heading"
|
|
139
136
|
],
|
|
140
137
|
presets: [
|
|
141
138
|
"body",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-plugin.js","names":["validationConfig"],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"sourcesContent":["import type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\n\nexport default {\n importSources: [\n \"@tenphi/cookbook/styling\",\n \"@tenphi/renderer/styling\",\n \"./component-styles.js\",\n \"../define-component.js\",\n ],\n styleFunctions: {\n defineComponent: { argument: 1, kind: \"options\" },\n extendComponent: { argument: 2, kind: \"options\", partial: true },\n resolveComponentStyles: { argument: 1, kind: \"styles\" },\n mergeStyles: { argument: \"all\", kind: \"styles\", partial: true },\n },\n tokens: [\n \"$gap\",\n \"$margin-block-start\",\n \"$margin-block-end\",\n \"$padding-block-start\",\n \"$padding-block-end\",\n \"$radius\",\n \"$header-control-radius\",\n \"$card-radius\",\n \"$border-width\",\n \"$outline-width\",\n \"$outline-offset\",\n \"$layout-width\",\n \"$content-width\",\n \"$sidebar-width\",\n \"$control-height\",\n \"$transition\",\n \"$sharp-radius\",\n \"$bold-font-weight\",\n \"#white\",\n \"#black\",\n \"#clear\",\n \"#current\",\n \"#surface\",\n \"#header\",\n \"#heading\",\n \"#surface-2\",\n \"#surface-3\",\n \"#surface-2-hover\",\n \"#surface-2-pressed\",\n \"#surface-3-hover\",\n \"#surface-3-pressed\",\n \"#text\",\n \"#text-soft\",\n \"#text-muted\",\n \"#sidebar-text\",\n \"#border\",\n \"#border-strong\",\n \"#accent-text\",\n \"#accent-surface\",\n \"#accent-surface-text\",\n \"#logo-surface\",\n \"#logo-mark\",\n \"#accent-surface-subtle\",\n \"#accent-surface-2-subtle\",\n \"#focus\",\n \"#shadow\",\n \"#overlay\",\n \"#syntax-bg\",\n \"#syntax-text\",\n \"#syntax-comment\",\n \"#syntax-punctuation\",\n \"#syntax-keyword\",\n \"#syntax-string\",\n \"#syntax-token\",\n \"#syntax-property\",\n \"#syntax-number\",\n \"#syntax-function\",\n \"#syntax-value\",\n \"#syntax-operator\",\n \"#info\",\n \"#info-surface\",\n \"#info-text\",\n \"#success\",\n \"#success-surface\",\n \"#success-text\",\n \"#warning\",\n \"#warning-surface\",\n \"#warning-text\",\n \"#danger\",\n \"#danger-surface\",\n \"#danger-text\",\n \"#orange-surface\",\n \"#orange\",\n \"#orange-text\",\n \"#green-surface\",\n \"#green\",\n \"#green-text\",\n \"#blue-surface\",\n \"#blue\",\n \"#blue-text\",\n \"#purple-surface\",\n \"#purple\",\n \"#purple-text\",\n \"#red-surface\",\n \"#red\",\n \"#red-text\",\n ],\n units: [\"x\", \"r\", \"cr\", \"bw\"],\n states: [\n \"@system-light\",\n \"@system-dark\",\n \"@light\",\n \"@dark\",\n \"@
|
|
1
|
+
{"version":3,"file":"eslint-plugin.js","names":["validationConfig"],"sources":["../src/tasty.config.ts","../src/eslint-plugin.ts"],"sourcesContent":["import type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\n\nexport default {\n importSources: [\n \"@tenphi/cookbook/styling\",\n \"@tenphi/renderer/styling\",\n \"./component-styles.js\",\n \"../define-component.js\",\n ],\n styleFunctions: {\n defineComponent: { argument: 1, kind: \"options\" },\n extendComponent: { argument: 2, kind: \"options\", partial: true },\n resolveComponentStyles: { argument: 1, kind: \"styles\" },\n mergeStyles: { argument: \"all\", kind: \"styles\", partial: true },\n },\n tokens: [\n \"$gap\",\n \"$margin-block-start\",\n \"$margin-block-end\",\n \"$padding-block-start\",\n \"$padding-block-end\",\n \"$radius\",\n \"$header-control-radius\",\n \"$card-radius\",\n \"$border-width\",\n \"$outline-width\",\n \"$outline-offset\",\n \"$layout-width\",\n \"$content-width\",\n \"$sidebar-width\",\n \"$control-height\",\n \"$transition\",\n \"$sharp-radius\",\n \"$bold-font-weight\",\n \"#white\",\n \"#black\",\n \"#clear\",\n \"#current\",\n \"#surface\",\n \"#header\",\n \"#heading\",\n \"#surface-2\",\n \"#surface-3\",\n \"#surface-2-hover\",\n \"#surface-2-pressed\",\n \"#surface-3-hover\",\n \"#surface-3-pressed\",\n \"#text\",\n \"#text-soft\",\n \"#text-muted\",\n \"#sidebar-text\",\n \"#border\",\n \"#border-strong\",\n \"#accent-text\",\n \"#accent-surface\",\n \"#accent-surface-text\",\n \"#logo-surface\",\n \"#logo-mark\",\n \"#accent-surface-subtle\",\n \"#accent-surface-2-subtle\",\n \"#focus\",\n \"#shadow\",\n \"#overlay\",\n \"#syntax-bg\",\n \"#syntax-text\",\n \"#syntax-comment\",\n \"#syntax-punctuation\",\n \"#syntax-keyword\",\n \"#syntax-string\",\n \"#syntax-token\",\n \"#syntax-property\",\n \"#syntax-number\",\n \"#syntax-function\",\n \"#syntax-value\",\n \"#syntax-operator\",\n \"#info\",\n \"#info-surface\",\n \"#info-text\",\n \"#success\",\n \"#success-surface\",\n \"#success-text\",\n \"#warning\",\n \"#warning-surface\",\n \"#warning-text\",\n \"#danger\",\n \"#danger-surface\",\n \"#danger-text\",\n \"#orange-surface\",\n \"#orange\",\n \"#orange-text\",\n \"#green-surface\",\n \"#green\",\n \"#green-text\",\n \"#blue-surface\",\n \"#blue\",\n \"#blue-text\",\n \"#purple-surface\",\n \"#purple\",\n \"#purple-text\",\n \"#red-surface\",\n \"#red\",\n \"#red-text\",\n ],\n units: [\"x\", \"r\", \"cr\", \"bw\"],\n states: [\n \"@system-light\",\n \"@system-dark\",\n \"@light\",\n \"@dark\",\n \"@sm\",\n \"@md\",\n \"@lg\",\n \"@reduced-motion\",\n \"@prose\",\n \"@prose-block\",\n \"@prose-heading\",\n ],\n presets: [\n \"body\",\n \"heading\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"navigation\",\n \"small\",\n \"code\",\n \"hero-title\",\n \"hero-tagline\",\n \"prose\",\n \"inline-code\",\n ],\n} satisfies TastyValidationConfig;\n","export { default, recommended, strict } from \"@tenphi/eslint-plugin-tasty\";\nexport type {\n ResolvedConfig,\n StyleFunctionConfig,\n TastyValidationConfig,\n} from \"@tenphi/eslint-plugin-tasty\";\nexport { default as validationConfig } from \"./tasty.config.js\";\n\nimport type { ThemeConfig } from \"@tenphi/docs\";\nimport type { TastyValidationConfig } from \"@tenphi/eslint-plugin-tasty\";\nimport validationConfig from \"./tasty.config.js\";\n\n/** Keep editor/linter names aligned with a Cookbook theme. */\nexport function createValidationConfig(\n theme: ThemeConfig = {},\n): TastyValidationConfig {\n return {\n ...validationConfig,\n tokens: [\n ...validationConfig.tokens,\n ...Object.keys(theme.tokens ?? {}),\n ...Object.keys(theme.palette ?? {}).map((name) => `#${name}`),\n ],\n units: [...validationConfig.units, ...Object.keys(theme.units ?? {})],\n states: [...validationConfig.states, ...Object.keys(theme.states ?? {})],\n presets: [...validationConfig.presets, ...Object.keys(theme.presets ?? {})],\n recipes: Object.keys(theme.recipes ?? {}),\n };\n}\n"],"mappings":";;AAEA,IAAA,uBAAe;CACb,eAAe;EACb;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd,iBAAiB;GAAE,UAAU;GAAG,MAAM;EAAU;EAChD,iBAAiB;GAAE,UAAU;GAAG,MAAM;GAAW,SAAS;EAAK;EAC/D,wBAAwB;GAAE,UAAU;GAAG,MAAM;EAAS;EACtD,aAAa;GAAE,UAAU;GAAO,MAAM;GAAU,SAAS;EAAK;CAChE;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAK;EAAK;EAAM;CAAI;CAC5B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;ACzHA,SAAgB,uBACd,QAAqB,CAAC,GACC;CACvB,OAAO;EACL,GAAGA;EACH,QAAQ;GACN,GAAGA,qBAAiB;GACpB,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC;GACjC,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM;EAC9D;EACA,OAAO,CAAC,GAAGA,qBAAiB,OAAO,GAAG,OAAO,KAAK,MAAM,SAAS,CAAC,CAAC,CAAC;EACpE,QAAQ,CAAC,GAAGA,qBAAiB,QAAQ,GAAG,OAAO,KAAK,MAAM,UAAU,CAAC,CAAC,CAAC;EACvE,SAAS,CAAC,GAAGA,qBAAiB,SAAS,GAAG,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC;EAC1E,SAAS,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC;CAC1C;AACF"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { DEFAULT_THEME_TOKENS, DEFAULT_TYPOGRAPHY_PRESETS, resolveThemeTokens, r
|
|
|
4
4
|
import { configureCodeHighlighting, cookbookShikiConfig } from "./theme/shiki-theme.js";
|
|
5
5
|
import { TASTY_SPACING_PROPERTIES, TASTY_UNITS, tastyTokens } from "./theme/tasty-config.js";
|
|
6
6
|
import { r as unusedCustomStyleNames, t as configureComponentStyles } from "./component-styles-DstqPFf3.js";
|
|
7
|
-
import { n as cookbookStates } from "./tasty-states-
|
|
7
|
+
import { n as cookbookStates } from "./tasty-states-BIgiJQ3N.js";
|
|
8
8
|
import { agentPagePath } from "./page-metadata.js";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
10
|
import { cp, mkdir, readFile, readdir, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -238,7 +238,7 @@ function replaceMermaidCodeBlocks(parent) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
function renderMermaidElement(source) {
|
|
241
|
-
return `<div class="td-mermaid" data-mermaid-state="ready">${accessibleSvg(render(source), source)}</div>`;
|
|
241
|
+
return `<div class="td-mermaid" data-element="Mermaid" data-mermaid-state="ready">${accessibleSvg(render(source), source)}</div>`;
|
|
242
242
|
}
|
|
243
243
|
function isMermaidCodeBlock(node) {
|
|
244
244
|
if (node.type !== "element" || node.tagName !== "pre") return false;
|
|
@@ -258,7 +258,7 @@ function render(source) {
|
|
|
258
258
|
border: "var(--border-strong-color)",
|
|
259
259
|
font: "var(--body-font-family)",
|
|
260
260
|
transparent: true
|
|
261
|
-
}).replace(svgStyleBlock, "").replace(/(<svg\b[^>]*?)\sstyle="[^"]*"/, "$1");
|
|
261
|
+
}).replace(svgStyleBlock, "").replace(/\sclass="([^"]*)"/g, (_, names) => names.split(/\s+/).includes("mono") ? " data-mono=\"\"" : "").replace(/(<svg\b[^>]*?)\sstyle="[^"]*"/, "$1");
|
|
262
262
|
}
|
|
263
263
|
function accessibleSvg(svg, source) {
|
|
264
264
|
const title = directive(source, "accTitle") ?? "Diagram";
|
|
@@ -345,13 +345,15 @@ function alert(blockquote) {
|
|
|
345
345
|
type: "element",
|
|
346
346
|
tagName: "aside",
|
|
347
347
|
properties: {
|
|
348
|
-
className: ["cookbook-alert"
|
|
348
|
+
className: ["cookbook-alert"],
|
|
349
|
+
dataElement: "MarkdownAlert",
|
|
350
|
+
[`data-${kind}`]: "",
|
|
349
351
|
ariaLabel: title
|
|
350
352
|
},
|
|
351
353
|
children: [{
|
|
352
354
|
type: "element",
|
|
353
355
|
tagName: "p",
|
|
354
|
-
properties: {
|
|
356
|
+
properties: { dataElement: "Title" },
|
|
355
357
|
children: [{
|
|
356
358
|
type: "text",
|
|
357
359
|
value: title
|
|
@@ -359,14 +361,14 @@ function alert(blockquote) {
|
|
|
359
361
|
}, {
|
|
360
362
|
type: "element",
|
|
361
363
|
tagName: "div",
|
|
362
|
-
properties: {
|
|
364
|
+
properties: { dataElement: "Content" },
|
|
363
365
|
children: body
|
|
364
366
|
}]
|
|
365
367
|
};
|
|
366
368
|
}
|
|
367
369
|
//#endregion
|
|
368
370
|
//#region src/markdown/rehype-table-scroll.ts
|
|
369
|
-
const
|
|
371
|
+
const containerElement = "Scroll";
|
|
370
372
|
/** Wrap Markdown tables in a dedicated horizontal scroll container. */
|
|
371
373
|
function rehypeTableScroll() {
|
|
372
374
|
return (tree) => {
|
|
@@ -397,13 +399,12 @@ function scrollContainer(table) {
|
|
|
397
399
|
return {
|
|
398
400
|
type: "element",
|
|
399
401
|
tagName: "div",
|
|
400
|
-
properties: {
|
|
402
|
+
properties: { dataElement: containerElement },
|
|
401
403
|
children: [table]
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
406
|
function isScrollContainer(node) {
|
|
405
|
-
|
|
406
|
-
return node.type === "element" && node.tagName === "div" && Array.isArray(className) && className.includes(containerClass);
|
|
407
|
+
return node.type === "element" && node.tagName === "div" && node.properties?.dataElement === containerElement;
|
|
407
408
|
}
|
|
408
409
|
//#endregion
|
|
409
410
|
//#region src/markdown/rehype-page-affordances.ts
|
|
@@ -442,9 +443,11 @@ function isOrdinaryCodeBlock(node) {
|
|
|
442
443
|
return (node.properties?.dataLanguage ?? node.properties?.["data-language"]) !== "mermaid" && node.children?.[0]?.tagName === "code";
|
|
443
444
|
}
|
|
444
445
|
function codeBlockWithCopy(pre) {
|
|
446
|
+
const language = pre.properties?.dataLanguage ?? pre.properties?.["data-language"];
|
|
445
447
|
return element("cookbook-code-block", {
|
|
446
448
|
className: ["td-code-block"],
|
|
447
|
-
dataElement: "MarkdownCodeBlock"
|
|
449
|
+
dataElement: "MarkdownCodeBlock",
|
|
450
|
+
dataDiff: language === "diff" || language === "patch" ? "" : void 0
|
|
448
451
|
}, [pre, element("button", {
|
|
449
452
|
type: "button",
|
|
450
453
|
dataElement: "CopyButton",
|