@tenphi/renderer 0.22.1 → 0.24.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/client-navigation.d.ts +1 -0
- package/dist/client/client-navigation.js +32 -0
- package/dist/client/client-navigation.js.map +1 -0
- 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-router.d.ts +2 -0
- package/dist/client/navigation-router.js +36 -0
- package/dist/client/navigation-router.js.map +1 -0
- package/dist/client/navigation.js +3 -3
- package/dist/client/navigation.js.map +1 -1
- package/dist/client/search.d.ts.map +1 -1
- package/dist/client/search.js +16 -2
- 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/AppearanceInit.astro +6 -0
- 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 +54 -25
- 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 +18 -9
- 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/appearance-bootstrap.js +21 -0
- 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 +22 -15
- package/dist/overrides/Sidebar.astro +2 -3
- package/dist/overrides/ThemeSelect.astro +2 -2
- package/dist/routes/Page.astro +17 -9
- 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
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",
|