@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.
Files changed (90) hide show
  1. package/dist/client/client-navigation.d.ts +1 -0
  2. package/dist/client/client-navigation.js +32 -0
  3. package/dist/client/client-navigation.js.map +1 -0
  4. package/dist/client/code-copy.js +3 -3
  5. package/dist/client/code-copy.js.map +1 -1
  6. package/dist/client/heading-links.js +4 -4
  7. package/dist/client/heading-links.js.map +1 -1
  8. package/dist/client/navigation-router.d.ts +2 -0
  9. package/dist/client/navigation-router.js +36 -0
  10. package/dist/client/navigation-router.js.map +1 -0
  11. package/dist/client/navigation.js +3 -3
  12. package/dist/client/navigation.js.map +1 -1
  13. package/dist/client/search.d.ts.map +1 -1
  14. package/dist/client/search.js +16 -2
  15. package/dist/client/search.js.map +1 -1
  16. package/dist/client/table-of-contents.js +2 -2
  17. package/dist/client/table-of-contents.js.map +1 -1
  18. package/dist/components/AppearanceInit.astro +6 -0
  19. package/dist/components/Card.styles.js +1 -0
  20. package/dist/components/CodeGroup.astro +8 -1
  21. package/dist/components/CodeGroup.styles.js +1 -2
  22. package/dist/components/Document.styles.js +54 -25
  23. package/dist/components/EditLink.astro +1 -1
  24. package/dist/components/Header.styles.js +13 -13
  25. package/dist/components/HeaderLinks.astro +4 -8
  26. package/dist/components/HeaderLinks.styles.js +17 -17
  27. package/dist/components/Hero.styles.js +28 -30
  28. package/dist/components/Icon.astro +3 -3
  29. package/dist/components/LanguageSelect.styles.js +8 -8
  30. package/dist/components/MainContent.styles.js +3 -3
  31. package/dist/components/MainPane.styles.js +1 -1
  32. package/dist/components/MarkdownAlert.styles.js +16 -17
  33. package/dist/components/MarkdownCodeBlock.styles.js +31 -19
  34. package/dist/components/MarkdownContent.styles.js +47 -89
  35. package/dist/components/MarkdownHeading.styles.js +23 -24
  36. package/dist/components/MarkdownInlineCode.styles.js +1 -1
  37. package/dist/components/MarkdownTable.styles.js +5 -5
  38. package/dist/components/Mermaid.styles.js +4 -1
  39. package/dist/components/MermaidSource.styles.js +1 -1
  40. package/dist/components/MobileMenuFooter.styles.js +1 -1
  41. package/dist/components/MobileMenuToggle.styles.js +3 -3
  42. package/dist/components/MobileNavigationTabs.astro +3 -2
  43. package/dist/components/MobileNavigationTabs.styles.js +3 -3
  44. package/dist/components/MobileTableOfContents.styles.js +2 -2
  45. package/dist/components/PackageVersion.styles.js +1 -1
  46. package/dist/components/PageFrame.styles.js +6 -6
  47. package/dist/components/Pagination.astro +2 -2
  48. package/dist/components/Pagination.styles.js +10 -10
  49. package/dist/components/Preview.astro +3 -4
  50. package/dist/components/Preview.styles.js +2 -2
  51. package/dist/components/Search.styles.js +13 -13
  52. package/dist/components/SearchButton.styles.js +10 -10
  53. package/dist/components/SearchResults.styles.js +21 -31
  54. package/dist/components/SelectPopover.astro +18 -9
  55. package/dist/components/Sidebar.styles.js +58 -49
  56. package/dist/components/SidebarList.astro +9 -6
  57. package/dist/components/SiteLogo.astro +2 -2
  58. package/dist/components/SiteLogo.styles.js +4 -4
  59. package/dist/components/SyntaxHighlight.styles.js +69 -48
  60. package/dist/components/TableOfContents.styles.js +1 -1
  61. package/dist/components/TableOfContentsLayout.styles.js +7 -7
  62. package/dist/components/ThemeSelect.styles.js +12 -12
  63. package/dist/components/TopNavigation.styles.js +1 -1
  64. package/dist/components/VersionSwitcher.styles.js +1 -1
  65. package/dist/components/appearance-bootstrap.js +21 -0
  66. package/dist/components/select-popover-styles.js +14 -14
  67. package/dist/components/tasty-states.js +10 -9
  68. package/dist/eslint-plugin.js +6 -9
  69. package/dist/eslint-plugin.js.map +1 -1
  70. package/dist/index.js +14 -11
  71. package/dist/index.js.map +1 -1
  72. package/dist/markdown/rendered-content.js +2 -2
  73. package/dist/markdown/rendered-content.js.map +1 -1
  74. package/dist/overrides/Header.astro +8 -12
  75. package/dist/overrides/Hero.astro +11 -6
  76. package/dist/overrides/MobileMenuFooter.astro +1 -1
  77. package/dist/overrides/MobileMenuToggle.astro +6 -5
  78. package/dist/overrides/PageFrame.astro +4 -3
  79. package/dist/overrides/Search.astro +22 -15
  80. package/dist/overrides/Sidebar.astro +2 -3
  81. package/dist/overrides/ThemeSelect.astro +2 -2
  82. package/dist/routes/Page.astro +17 -9
  83. package/dist/styling.js +1 -1
  84. package/dist/{tasty-states-_JhxFdK1.js → tasty-states-BIgiJQ3N.js} +7 -10
  85. package/dist/tasty-states-BIgiJQ3N.js.map +1 -0
  86. package/dist/theme/shiki-theme.d.ts.map +1 -1
  87. package/dist/theme/shiki-theme.js +37 -19
  88. package/dist/theme/shiki-theme.js.map +1 -1
  89. package/package.json +3 -3
  90. package/dist/tasty-states-_JhxFdK1.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shiki-theme.js","names":[],"sources":["../../src/theme/shiki-theme.ts"],"sourcesContent":["const comment = \"var(--syntax-comment-color)\";\nconst punctuation = \"var(--syntax-punctuation-color)\";\nconst keyword = \"var(--syntax-keyword-color)\";\nconst string = \"var(--syntax-string-color)\";\nconst token = \"var(--syntax-token-color)\";\nconst property = \"var(--syntax-property-color)\";\nconst number = \"var(--syntax-number-color)\";\nconst func = \"var(--syntax-function-color)\";\nconst value = \"var(--syntax-value-color)\";\nconst operator = \"var(--syntax-operator-color)\";\nconst foreground = \"var(--syntax-text-color)\";\nconst background = \"var(--syntax-bg-color)\";\nconst inserted = \"var(--green-text-color)\";\nconst deleted = \"var(--red-text-color)\";\n\ntype HighlightToken = {\n content: string;\n offset: number;\n color?: string;\n};\n\nconst shellLanguages = new Set([\"bash\", \"sh\", \"shell\", \"shellscript\", \"zsh\"]);\nconst shellPlaceholder = /<[A-Za-z][A-Za-z0-9_-]*>/g;\n\n/**\n * Shell grammars interpret documentation placeholders such as `<plan-id>` as\n * redirections and can split the final character into an unscoped token. Keep\n * the placeholder name visually coherent while retaining the operator color\n * on the angle brackets.\n */\nconst bashPlaceholderTransformer = {\n name: \"cookbook:bash-placeholders\",\n enforce: \"post\" as const,\n tokens(\n this: { source: string; options: { lang?: string } },\n lines: HighlightToken[][],\n ): HighlightToken[][] | undefined {\n if (!this.options.lang || !shellLanguages.has(this.options.lang)) return;\n const ranges = [...this.source.matchAll(shellPlaceholder)].map((match) => ({\n start: (match.index ?? 0) + 1,\n end: (match.index ?? 0) + match[0].length - 1,\n }));\n if (ranges.length === 0) return;\n\n for (const line of lines) {\n for (const highlighted of line) {\n const start = highlighted.offset;\n const end = start + highlighted.content.length;\n if (ranges.some((range) => start < range.end && end > range.start)) {\n highlighted.color = string;\n }\n }\n }\n return lines;\n },\n};\n\ntype HastElement = {\n type?: string;\n tagName?: string;\n properties: Record<string, unknown>;\n children?: HastElement[];\n};\n\nconst syntaxColors = new Map(\n [\n comment,\n punctuation,\n keyword,\n string,\n token,\n property,\n number,\n func,\n value,\n operator,\n foreground,\n background,\n inserted,\n deleted,\n ].map((color) => [color, `td-${color.slice(6, -7)}`]),\n);\n\n/** Keep grammar classification in Shiki and all presentation in Tasty. */\nconst tastyClassesTransformer = {\n name: \"cookbook:tasty-classes\",\n enforce: \"post\" as const,\n root(this: DiffTransformerContext, root: HastElement): void {\n const visit = (node: HastElement) => {\n const style = node.properties?.style;\n if (typeof style === \"string\") {\n for (const declaration of style.split(\";\")) {\n if (!declaration.trim()) continue;\n const separator = declaration.indexOf(\":\");\n const key = declaration.slice(0, separator).trim();\n const value = declaration.slice(separator + 1).trim();\n let className: string | undefined;\n if (key === \"color\") className = syntaxColors.get(value);\n else if (key === \"background-color\" && value === background)\n className = \"td-syntax-bg\";\n else if (key === \"font-style\" && value === \"italic\")\n className = \"td-syntax-italic\";\n else if (key === \"font-weight\" && value === \"bold\")\n className = \"td-syntax-strong\";\n else if (key === \"text-decoration\" && value === \"underline\")\n className = \"td-syntax-underline\";\n else if (key === \"overflow-x\" && value === \"auto\")\n className = \"td-syntax-scroll\";\n else if (\n (key === \"white-space\" && value === \"pre-wrap\") ||\n (key === \"word-wrap\" && value === \"break-word\")\n )\n className = \"td-syntax-wrap\";\n else if (key === \"user-select\" && value === \"none\")\n className = \"td-syntax-marker\";\n if (!className)\n throw new Error(\n `Unsupported Shiki style ${JSON.stringify(declaration)}. Use semantic classes and theme.styles.SyntaxHighlight for custom transformers.`,\n );\n this.addClassToHast(node, className);\n }\n delete node.properties.style;\n }\n node.children?.forEach(visit);\n };\n visit(root);\n },\n};\n\ntype DiffTransformerContext = {\n source: string;\n options: { lang?: string };\n addClassToHast(element: HastElement, className: string): HastElement;\n};\n\nconst diffLanguages = new Set([\"diff\", \"patch\"]);\n\n/**\n * The diff grammar colors individual tokens, but it does not expose a stable\n * whole-line selector. Add semantic classes so insertions and deletions can\n * receive subtle, full-width surfaces without hiding their +/- markers.\n */\nconst diffLineTransformer = {\n name: \"cookbook:diff-lines\",\n pre(this: DiffTransformerContext, element: HastElement): void {\n if (this.options.lang && diffLanguages.has(this.options.lang)) {\n this.addClassToHast(element, \"td-diff\");\n }\n },\n line(\n this: DiffTransformerContext,\n element: HastElement,\n lineNumber: number,\n ): void {\n if (!this.options.lang || !diffLanguages.has(this.options.lang)) return;\n\n const line = this.source.split(/\\r?\\n/)[lineNumber - 1] ?? \"\";\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) {\n this.addClassToHast(element, \"td-diff-line--inserted\");\n } else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) {\n this.addClassToHast(element, \"td-diff-line--deleted\");\n }\n },\n};\n\n/**\n * Astro loads fenced-code grammars lazily. MDX embeds TSX, but loading MDX by\n * itself leaves that embedded grammar unavailable and produces partially\n * highlighted imports and JSX. Preload TSX while preserving consumer-supplied\n * languages and transformers.\n */\nexport function cookbookShikiConfig(\n config: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const languages = Array.isArray(config?.langs) ? [...config.langs] : [];\n const transformers = Array.isArray(config?.transformers)\n ? [...config.transformers]\n : [];\n const hasTsx = languages.some(\n (language) =>\n language === \"tsx\" ||\n (typeof language === \"object\" &&\n language !== null &&\n \"name\" in language &&\n language.name === \"tsx\"),\n );\n\n if (!transformers.includes(bashPlaceholderTransformer)) {\n transformers.push(bashPlaceholderTransformer);\n }\n if (!transformers.includes(diffLineTransformer)) {\n transformers.push(diffLineTransformer);\n }\n if (!transformers.includes(tastyClassesTransformer)) {\n transformers.push(tastyClassesTransformer);\n }\n\n return {\n ...config,\n langs: hasTsx ? languages : [...languages, \"tsx\"],\n theme: tastyCodeTheme,\n transformers,\n };\n}\n\n/**\n * Shiki performs the grammatical classification, while every emitted color\n * remains a reference to a Glaze-generated token owned by Tasty.\n */\nconst tastyCodeTheme = {\n name: \"tasty-code\",\n type: \"light\" as const,\n fg: foreground,\n bg: background,\n colors: {\n \"editor.background\": background,\n \"editor.foreground\": foreground,\n },\n settings: [\n {\n scope: [\n \"comment\",\n \"comment.line\",\n \"comment.block\",\n \"punctuation.definition.comment\",\n ],\n settings: { foreground: comment, fontStyle: \"italic\" },\n },\n {\n scope: [\n \"keyword\",\n \"keyword.control\",\n \"keyword.other\",\n \"storage.type\",\n \"storage.modifier\",\n \"keyword.control.at-rule.tasty\",\n \"keyword.control.at-rule.media.tasty\",\n \"keyword.control.at-rule.media-type.tasty\",\n \"keyword.control.at-rule.starting.tasty\",\n \"keyword.control.state-alias.tasty\",\n ],\n settings: { foreground: keyword },\n },\n {\n scope: [\n \"string\",\n \"string.quoted\",\n \"string.template\",\n \"string.quoted.attribute-value.tasty\",\n \"string.unquoted.attribute-value.tasty\",\n ],\n settings: { foreground: string },\n },\n {\n scope: [\n \"support.constant.color.tasty-token\",\n \"support.constant.color.tasty-token.builtin\",\n \"constant.other.color.tasty-token\",\n \"constant.other.color.tasty\",\n \"constant.other.color.hex\",\n \"constant.other.color.rgb-value\",\n ],\n settings: { foreground: token },\n },\n {\n scope: [\n \"constant.numeric\",\n \"constant.numeric.tasty\",\n \"constant.numeric.custom-unit.tasty\",\n \"constant.numeric.css-with-unit\",\n \"constant.numeric.bare.tasty\",\n \"constant.numeric.css\",\n \"constant.numeric.keyframe-step.tasty\",\n \"constant.language.boolean.tasty\",\n ],\n settings: { foreground: number },\n },\n {\n scope: [\n \"support.type.property-name.tasty\",\n \"variable.other.constant.tasty\",\n \"entity.other.attribute-name.tsx\",\n \"entity.other.attribute-name.jsx\",\n ],\n settings: { foreground: property },\n },\n {\n scope: [\"variable\", \"variable.other\"],\n settings: { foreground },\n },\n {\n scope: [\n \"entity.name.function\",\n \"support.function\",\n \"support.function.misc.css\",\n \"entity.name.tag\",\n \"entity.name.tag.tsx\",\n \"support.class.component\",\n \"entity.name.type.tasty\",\n \"entity.name.tag.tasty\",\n ],\n settings: { foreground: func },\n },\n {\n scope: [\n \"support.constant.property-value.tasty\",\n \"support.constant.property-value.tasty-display\",\n \"support.constant.property-value.tasty-directional\",\n \"support.constant.property-value.tasty-preset\",\n \"support.constant.property-value.tasty-shape\",\n \"support.constant.property-value.tasty-scrollbar\",\n \"support.constant.property-value.tasty-state\",\n \"support.constant.property-value.tasty-cursor\",\n \"support.constant.property-value.tasty-overflow\",\n \"support.constant.property-value.tasty-position\",\n \"support.constant.property-value.tasty-flex\",\n \"support.constant.property-value.tasty-font\",\n \"support.constant.property-value.tasty-text\",\n \"support.constant.property-value.tasty-alignment\",\n \"support.constant.property-value.tasty-border-style\",\n \"support.constant.property-value.tasty-whitespace\",\n \"support.constant.property-value.tasty-global\",\n \"support.constant.property-value.tasty-transition\",\n \"support.constant.property-value.css-syntax\",\n \"entity.other.attribute-name\",\n \"entity.other.attribute-name.tasty\",\n \"entity.other.attribute-name.pseudo-class.tasty\",\n \"entity.other.attribute-name.pseudo-class.css\",\n \"entity.other.attribute-name.class.tasty\",\n \"entity.other.attribute-name.pseudo-element.css\",\n \"punctuation.definition.entity.css\",\n ],\n settings: { foreground: value },\n },\n {\n scope: [\n \"keyword.operator\",\n \"keyword.operator.logical.tasty\",\n \"keyword.operator.arithmetic.css\",\n \"keyword.operator.assignment\",\n \"keyword.operator.selector-affix.tasty\",\n \"keyword.operator.attribute-selector.tasty\",\n \"keyword.operator.comparison.tasty\",\n ],\n settings: { foreground: operator },\n },\n {\n scope: [\n \"punctuation.definition.string\",\n \"punctuation.separator\",\n \"punctuation.definition.block\",\n \"punctuation.definition.array\",\n \"punctuation.section\",\n \"punctuation.definition.auto-calc\",\n \"punctuation.definition.attribute-selector\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.pseudo-class\",\n \"punctuation.definition.fallback\",\n \"meta.brace\",\n ],\n settings: { foreground: punctuation },\n },\n {\n scope: [\"keyword.control.at-rule\", \"entity.name.tag.class.css\"],\n settings: { foreground: keyword },\n },\n {\n scope: [\"support.type.property-name.css\", \"meta.property-name.css\"],\n settings: { foreground: property },\n },\n {\n scope: [\"punctuation.definition.inserted.diff\"],\n settings: { foreground: inserted, fontStyle: \"bold\" },\n },\n {\n scope: [\"punctuation.definition.deleted.diff\"],\n settings: { foreground: deleted, fontStyle: \"bold\" },\n },\n ],\n};\n\n// Astro executes integrations and page modules in separate module graphs.\n// Share server-only transformer functions without serializing them into pages.\nconst sharedShiki = globalThis as typeof globalThis & {\n __tenphiCookbookShiki?: Record<string, unknown>;\n};\nexport function configureCodeHighlighting(config: Record<string, unknown>) {\n sharedShiki.__tenphiCookbookShiki = config;\n}\nexport function codeGroupHighlighting() {\n return sharedShiki.__tenphiCookbookShiki ?? cookbookShikiConfig(undefined);\n}\n"],"mappings":";AAAA,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,UAAU;AAQhB,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAM;CAAS;CAAe;AAAK,CAAC;AAC5E,MAAM,mBAAmB;;;;;;;AAQzB,MAAM,6BAA6B;CACjC,MAAM;CACN,SA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IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,KAAK;EAC/B;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,YAAY;EACtC;EACA;GACE,OAAO,CAAC,2BAA2B,2BAA2B;GAC9D,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO,CAAC,kCAAkC,wBAAwB;GAClE,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,sCAAsC;GAC9C,UAAU;IAAE,YAAY;IAAU,WAAW;GAAO;EACtD;EACA;GACE,OAAO,CAAC,qCAAqC;GAC7C,UAAU;IAAE,YAAY;IAAS,WAAW;GAAO;EACrD;CACF;AACF;AAIA,MAAM,cAAc;AAGpB,SAAgB,0BAA0B,QAAiC;CACzE,YAAY,wBAAwB;AACtC;AACA,SAAgB,wBAAwB;CACtC,OAAO,YAAY,yBAAyB,oBAAoB,KAAA,CAAS;AAC3E"}
1
+ {"version":3,"file":"shiki-theme.js","names":[],"sources":["../../src/theme/shiki-theme.ts"],"sourcesContent":["const comment = \"var(--syntax-comment-color)\";\nconst punctuation = \"var(--syntax-punctuation-color)\";\nconst keyword = \"var(--syntax-keyword-color)\";\nconst string = \"var(--syntax-string-color)\";\nconst token = \"var(--syntax-token-color)\";\nconst property = \"var(--syntax-property-color)\";\nconst number = \"var(--syntax-number-color)\";\nconst func = \"var(--syntax-function-color)\";\nconst value = \"var(--syntax-value-color)\";\nconst operator = \"var(--syntax-operator-color)\";\nconst foreground = \"var(--syntax-text-color)\";\nconst background = \"var(--syntax-bg-color)\";\nconst inserted = \"var(--green-text-color)\";\nconst deleted = \"var(--red-text-color)\";\n\ntype HighlightToken = {\n content: string;\n offset: number;\n color?: string;\n};\n\nconst shellLanguages = new Set([\"bash\", \"sh\", \"shell\", \"shellscript\", \"zsh\"]);\nconst shellPlaceholder = /<[A-Za-z][A-Za-z0-9_-]*>/g;\n\n/**\n * Shell grammars interpret documentation placeholders such as `<plan-id>` as\n * redirections and can split the final character into an unscoped token. Keep\n * the placeholder name visually coherent while retaining the operator color\n * on the angle brackets.\n */\nconst bashPlaceholderTransformer = {\n name: \"cookbook:bash-placeholders\",\n enforce: \"post\" as const,\n tokens(\n this: { source: string; options: { lang?: string } },\n lines: HighlightToken[][],\n ): HighlightToken[][] | undefined {\n if (!this.options.lang || !shellLanguages.has(this.options.lang)) return;\n const ranges = [...this.source.matchAll(shellPlaceholder)].map((match) => ({\n start: (match.index ?? 0) + 1,\n end: (match.index ?? 0) + match[0].length - 1,\n }));\n if (ranges.length === 0) return;\n\n for (const line of lines) {\n for (const highlighted of line) {\n const start = highlighted.offset;\n const end = start + highlighted.content.length;\n if (ranges.some((range) => start < range.end && end > range.start)) {\n highlighted.color = string;\n }\n }\n }\n return lines;\n },\n};\n\ntype HastElement = {\n type?: string;\n tagName?: string;\n value?: string;\n properties: Record<string, unknown>;\n children?: HastElement[];\n};\n\nconst syntaxColors = new Map(\n [\n comment,\n punctuation,\n keyword,\n string,\n token,\n property,\n number,\n func,\n value,\n operator,\n foreground,\n background,\n inserted,\n deleted,\n ].map((color) => [color, color.slice(6, -7)]),\n);\n\n/** Keep grammar classification in Shiki and all presentation in Tasty. */\nconst tastyModifiersTransformer = {\n name: \"cookbook:tasty-modifiers\",\n enforce: \"post\" as const,\n root(root: HastElement): void {\n const visit = (node: HastElement) => {\n const style = node.properties?.style;\n if (typeof style === \"string\") {\n for (const declaration of style.split(\";\")) {\n if (!declaration.trim()) continue;\n const separator = declaration.indexOf(\":\");\n const key = declaration.slice(0, separator).trim();\n const value = declaration.slice(separator + 1).trim();\n let modifier: string | undefined;\n if (key === \"color\") modifier = syntaxColors.get(value);\n else if (key === \"background-color\" && value === background)\n modifier = \"syntax-bg\";\n else if (key === \"font-style\" && value === \"italic\")\n modifier = \"syntax-italic\";\n else if (key === \"font-weight\" && value === \"bold\")\n modifier = \"syntax-strong\";\n else if (key === \"text-decoration\" && value === \"underline\")\n modifier = \"syntax-underline\";\n else if (key === \"overflow-x\" && value === \"auto\")\n modifier = \"syntax-scroll\";\n else if (\n (key === \"white-space\" && value === \"pre-wrap\") ||\n (key === \"word-wrap\" && value === \"break-word\")\n )\n modifier = \"syntax-wrap\";\n else if (key === \"user-select\" && value === \"none\")\n modifier = \"syntax-marker\";\n if (!modifier)\n throw new Error(\n `Unsupported Shiki style ${JSON.stringify(declaration)}. Use semantic data modifiers and theme.styles.SyntaxHighlight for custom transformers.`,\n );\n node.properties[`data-${modifier}`] = \"\";\n }\n delete node.properties.style;\n }\n // Keep the stable syntax root class; normalize line anatomy and reject\n // authored token/modifier classes before serialization.\n const classValues = [node.properties?.class, node.properties?.className];\n const classes = classValues.flatMap((value) =>\n typeof value === \"string\"\n ? value.split(/\\s+/).filter(Boolean)\n : Array.isArray(value)\n ? value\n : [],\n );\n if (\n classValues.some(\n (value) => typeof value === \"string\" || Array.isArray(value),\n )\n ) {\n for (const name of classes) {\n if (\n name === \"astro-code\" ||\n name === \"tasty-code\" ||\n name === \"shiki\"\n ) {\n node.properties[\"data-syntax\"] = \"\";\n } else if (name === \"line\") {\n node.properties.dataElement = \"Line\";\n } else if (node.tagName !== \"pre\") {\n throw new Error(\n `Unsupported Shiki class ${JSON.stringify(name)}. Use semantic data modifiers and theme.styles.SyntaxHighlight for custom transformers.`,\n );\n }\n }\n delete node.properties.className;\n if (node.tagName === \"pre\") {\n node.properties.class = [\n \"tasty-code\",\n ...classes.filter(\n (name) => ![\"astro-code\", \"tasty-code\", \"shiki\"].includes(name),\n ),\n ].join(\" \");\n } else {\n delete node.properties.class;\n }\n }\n node.children?.forEach(visit);\n // Some grammars wrap empty lines in an empty token span. Canonicalize\n // those lines so :empty works consistently in fences and CodeGroup.\n if (\n node.properties?.dataElement === \"Line\" &&\n node.children?.every(emptyToken)\n ) {\n node.children = [];\n }\n };\n visit(root);\n },\n};\n\nfunction emptyToken(node: HastElement): boolean {\n return node.type === \"text\"\n ? node.value === \"\"\n : node.tagName === \"span\" && (node.children ?? []).every(emptyToken);\n}\n\ntype DiffTransformerContext = {\n source: string;\n options: { lang?: string };\n};\n\nconst diffLanguages = new Set([\"diff\", \"patch\"]);\n\n/**\n * The diff grammar colors individual tokens, but it does not expose a stable\n * whole-line selector. Add semantic modifiers so insertions and deletions can\n * receive subtle, full-width surfaces without hiding their +/- markers.\n */\nconst diffLineTransformer = {\n name: \"cookbook:diff-lines\",\n pre(this: DiffTransformerContext, element: HastElement): void {\n if (this.options.lang && diffLanguages.has(this.options.lang)) {\n element.properties[\"data-diff\"] = \"\";\n }\n },\n line(\n this: DiffTransformerContext,\n element: HastElement,\n lineNumber: number,\n ): void {\n if (!this.options.lang || !diffLanguages.has(this.options.lang)) return;\n\n const line = this.source.split(/\\r?\\n/)[lineNumber - 1] ?? \"\";\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) {\n element.properties[\"data-inserted\"] = \"\";\n } else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) {\n element.properties[\"data-deleted\"] = \"\";\n }\n },\n};\n\n/**\n * Astro loads fenced-code grammars lazily. MDX embeds TSX, but loading MDX by\n * itself leaves that embedded grammar unavailable and produces partially\n * highlighted imports and JSX. Preload TSX while preserving consumer-supplied\n * languages and transformers.\n */\nexport function cookbookShikiConfig(\n config: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const languages = Array.isArray(config?.langs) ? [...config.langs] : [];\n const transformers = Array.isArray(config?.transformers)\n ? [...config.transformers]\n : [];\n const hasTsx = languages.some(\n (language) =>\n language === \"tsx\" ||\n (typeof language === \"object\" &&\n language !== null &&\n \"name\" in language &&\n language.name === \"tsx\"),\n );\n\n if (!transformers.includes(bashPlaceholderTransformer)) {\n transformers.push(bashPlaceholderTransformer);\n }\n if (!transformers.includes(diffLineTransformer)) {\n transformers.push(diffLineTransformer);\n }\n if (!transformers.includes(tastyModifiersTransformer)) {\n transformers.push(tastyModifiersTransformer);\n }\n\n return {\n ...config,\n langs: hasTsx ? languages : [...languages, \"tsx\"],\n theme: tastyCodeTheme,\n transformers,\n };\n}\n\n/**\n * Shiki performs the grammatical classification, while every emitted color\n * remains a reference to a Glaze-generated token owned by Tasty.\n */\nconst tastyCodeTheme = {\n name: \"tasty-code\",\n type: \"light\" as const,\n fg: foreground,\n bg: background,\n colors: {\n \"editor.background\": background,\n \"editor.foreground\": foreground,\n },\n settings: [\n {\n scope: [\n \"comment\",\n \"comment.line\",\n \"comment.block\",\n \"punctuation.definition.comment\",\n ],\n settings: { foreground: comment, fontStyle: \"italic\" },\n },\n {\n scope: [\n \"keyword\",\n \"keyword.control\",\n \"keyword.other\",\n \"storage.type\",\n \"storage.modifier\",\n \"keyword.control.at-rule.tasty\",\n \"keyword.control.at-rule.media.tasty\",\n \"keyword.control.at-rule.media-type.tasty\",\n \"keyword.control.at-rule.starting.tasty\",\n \"keyword.control.state-alias.tasty\",\n ],\n settings: { foreground: keyword },\n },\n {\n scope: [\n \"string\",\n \"string.quoted\",\n \"string.template\",\n \"string.quoted.attribute-value.tasty\",\n \"string.unquoted.attribute-value.tasty\",\n ],\n settings: { foreground: string },\n },\n {\n scope: [\n \"support.constant.color.tasty-token\",\n \"support.constant.color.tasty-token.builtin\",\n \"constant.other.color.tasty-token\",\n \"constant.other.color.tasty\",\n \"constant.other.color.hex\",\n \"constant.other.color.rgb-value\",\n ],\n settings: { foreground: token },\n },\n {\n scope: [\n \"constant.numeric\",\n \"constant.numeric.tasty\",\n \"constant.numeric.custom-unit.tasty\",\n \"constant.numeric.css-with-unit\",\n \"constant.numeric.bare.tasty\",\n \"constant.numeric.css\",\n \"constant.numeric.keyframe-step.tasty\",\n \"constant.language.boolean.tasty\",\n ],\n settings: { foreground: number },\n },\n {\n scope: [\n \"support.type.property-name.tasty\",\n \"variable.other.constant.tasty\",\n \"entity.other.attribute-name.tsx\",\n \"entity.other.attribute-name.jsx\",\n ],\n settings: { foreground: property },\n },\n {\n scope: [\"variable\", \"variable.other\"],\n settings: { foreground },\n },\n {\n scope: [\n \"entity.name.function\",\n \"support.function\",\n \"support.function.misc.css\",\n \"entity.name.tag\",\n \"entity.name.tag.tsx\",\n \"support.class.component\",\n \"entity.name.type.tasty\",\n \"entity.name.tag.tasty\",\n ],\n settings: { foreground: func },\n },\n {\n scope: [\n \"support.constant.property-value.tasty\",\n \"support.constant.property-value.tasty-display\",\n \"support.constant.property-value.tasty-directional\",\n \"support.constant.property-value.tasty-preset\",\n \"support.constant.property-value.tasty-shape\",\n \"support.constant.property-value.tasty-scrollbar\",\n \"support.constant.property-value.tasty-state\",\n \"support.constant.property-value.tasty-cursor\",\n \"support.constant.property-value.tasty-overflow\",\n \"support.constant.property-value.tasty-position\",\n \"support.constant.property-value.tasty-flex\",\n \"support.constant.property-value.tasty-font\",\n \"support.constant.property-value.tasty-text\",\n \"support.constant.property-value.tasty-alignment\",\n \"support.constant.property-value.tasty-border-style\",\n \"support.constant.property-value.tasty-whitespace\",\n \"support.constant.property-value.tasty-global\",\n \"support.constant.property-value.tasty-transition\",\n \"support.constant.property-value.css-syntax\",\n \"entity.other.attribute-name\",\n \"entity.other.attribute-name.tasty\",\n \"entity.other.attribute-name.pseudo-class.tasty\",\n \"entity.other.attribute-name.pseudo-class.css\",\n \"entity.other.attribute-name.class.tasty\",\n \"entity.other.attribute-name.pseudo-element.css\",\n \"punctuation.definition.entity.css\",\n ],\n settings: { foreground: value },\n },\n {\n scope: [\n \"keyword.operator\",\n \"keyword.operator.logical.tasty\",\n \"keyword.operator.arithmetic.css\",\n \"keyword.operator.assignment\",\n \"keyword.operator.selector-affix.tasty\",\n \"keyword.operator.attribute-selector.tasty\",\n \"keyword.operator.comparison.tasty\",\n ],\n settings: { foreground: operator },\n },\n {\n scope: [\n \"punctuation.definition.string\",\n \"punctuation.separator\",\n \"punctuation.definition.block\",\n \"punctuation.definition.array\",\n \"punctuation.section\",\n \"punctuation.definition.auto-calc\",\n \"punctuation.definition.attribute-selector\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.pseudo-class\",\n \"punctuation.definition.fallback\",\n \"meta.brace\",\n ],\n settings: { foreground: punctuation },\n },\n {\n scope: [\"keyword.control.at-rule\", \"entity.name.tag.class.css\"],\n settings: { foreground: keyword },\n },\n {\n scope: [\"support.type.property-name.css\", \"meta.property-name.css\"],\n settings: { foreground: property },\n },\n {\n scope: [\"punctuation.definition.inserted.diff\"],\n settings: { foreground: inserted, fontStyle: \"bold\" },\n },\n {\n scope: [\"punctuation.definition.deleted.diff\"],\n settings: { foreground: deleted, fontStyle: \"bold\" },\n },\n ],\n};\n\n// Astro executes integrations and page modules in separate module graphs.\n// Share server-only transformer functions without serializing them into pages.\nconst sharedShiki = globalThis as typeof globalThis & {\n __tenphiCookbookShiki?: Record<string, unknown>;\n};\nexport function configureCodeHighlighting(config: Record<string, unknown>) {\n sharedShiki.__tenphiCookbookShiki = config;\n}\nexport function codeGroupHighlighting() {\n return sharedShiki.__tenphiCookbookShiki ?? cookbookShikiConfig(undefined);\n}\n"],"mappings":";AAAA,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,UAAU;AAQhB,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAM;CAAS;CAAe;AAAK,CAAC;AAC5E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a,KAAK,0BAA0B;CAE9C,IAAI,CAAC,aAAa,SAAS,mBAAmB,GAC5C,aAAa,KAAK,mBAAmB;CAEvC,IAAI,CAAC,aAAa,SAAS,yBAAyB,GAClD,aAAa,KAAK,yBAAyB;CAG7C,OAAO;EACL,GAAG;EACH,OAAO,SAAS,YAAY,CAAC,GAAG,WAAW,KAAK;EAChD,OAAO;EACP;CACF;AACF;;;;;AAMA,MAAM,iBAAiB;CACrB,MAAM;CACN,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,QAAQ;EACN,qBAAqB;EACrB,qBAAqB;CACvB;CACA,UAAU;EACR;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU;IAAE,YAAY;IAAS,WAAW;GAAS;EACvD;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,YAAY,gBAAgB;GACpC,UAAU,EAAE,WAAW;EACzB;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,KAAK;EAC/B;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,YAAY;EACtC;EACA;GACE,OAAO,CAAC,2BAA2B,2BAA2B;GAC9D,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO,CAAC,kCAAkC,wBAAwB;GAClE,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,sCAAsC;GAC9C,UAAU;IAAE,YAAY;IAAU,WAAW;GAAO;EACtD;EACA;GACE,OAAO,CAAC,qCAAqC;GAC7C,UAAU;IAAE,YAAY;IAAS,WAAW;GAAO;EACrD;CACF;AACF;AAIA,MAAM,cAAc;AAGpB,SAAgB,0BAA0B,QAAiC;CACzE,YAAY,wBAAwB;AACtC;AACA,SAAgB,wBAAwB;CACtC,OAAO,YAAY,yBAAyB,oBAAoB,KAAA,CAAS;AAC3E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/renderer",
3
- "version": "0.22.1",
3
+ "version": "0.24.0",
4
4
  "description": "Astro renderer and Tasty theme for Cookbook",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -61,10 +61,10 @@
61
61
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
62
62
  "@fontsource-variable/onest": "^5.3.0",
63
63
  "@pagefind/default-ui": "1.5.2",
64
- "@tenphi/docs": "0.22.1",
64
+ "@tenphi/docs": "0.24.0",
65
65
  "@tenphi/eslint-plugin-tasty": "1.6.0",
66
66
  "@tenphi/glaze": "2.0.1",
67
- "@tenphi/tasty": "3.9.9",
67
+ "@tenphi/tasty": "3.9.10",
68
68
  "beautiful-mermaid": "^1.1.3",
69
69
  "hast-util-from-html": "^2.0.3",
70
70
  "pagefind": "1.5.2",
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasty-states-_JhxFdK1.js","names":[],"sources":["../src/components/tasty-states.js"],"sourcesContent":["import { configure, getGlobalPredefinedStates } from \"@tenphi/tasty\";\nimport { resolveTypographyPresets } from \"../theme/defaults.js\";\nimport {\n TASTY_UNITS,\n TASTY_SPACING_PROPERTIES,\n} from \"../theme/tasty-config.js\";\n\nconst systemLight = \"@media(prefers-color-scheme: light)\";\nconst systemDark = \"@media(prefers-color-scheme: dark)\";\n\nexport const cookbookStates = {\n \"@system-light\": systemLight,\n \"@system-dark\": systemDark,\n \"@light\": `@root(theme=light) | (!@root(theme) & ${systemLight})`,\n \"@dark\": `@root(theme=dark) | (!@root(theme) & ${systemDark})`,\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@compact\": \"@media(w <= 23rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n \"@popover-open\": \":is(:popover-open)\",\n};\n\nlet configured = false;\nlet configuredRuntime;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n // Process-local server configuration shared across Astro/Vite module graphs.\n // The integration prevents this module from entering browser bundles.\n const runtime = globalThis.__tenphiCookbookTastyRuntime;\n if (configured && configuredRuntime === runtime) return;\n configure({\n presets: resolveTypographyPresets(),\n properties: TASTY_SPACING_PROPERTIES,\n ...runtime,\n units: { ...TASTY_UNITS, ...runtime?.units },\n });\n configuredRuntime = runtime;\n // The integration may have configured this runtime already, including\n // consumer overrides of built-in breakpoints. Only supply missing aliases.\n const existingStates = getGlobalPredefinedStates();\n const missingStates = Object.fromEntries(\n Object.entries(cookbookStates).filter(\n ([name]) => existingStates[name] === undefined,\n ),\n );\n if (Object.keys(missingStates).length) configure({ states: missingStates });\n configured = true;\n}\n"],"mappings":";;;;AAOA,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAa,iBAAiB;CAC5B,iBAAiB;CACjB,gBAAgB;CAChB,UAAU,yCAAyC,YAAY;CAC/D,SAAS,wCAAwC,WAAW;CAC5D,WAAW;CACX,YAAY;CACZ,UAAU;CACV,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;AACnB;AAEA,IAAI,aAAa;AACjB,IAAI;;AAGJ,SAAgB,0BAA0B;CAGxC,MAAM,UAAU,WAAW;CAC3B,IAAI,cAAc,sBAAsB,SAAS;CACjD,UAAU;EACR,SAAS,yBAAyB;EAClC,YAAY;EACZ,GAAG;EACH,OAAO;GAAE,GAAG;GAAa,GAAG,SAAS;EAAM;CAC7C,CAAC;CACD,oBAAoB;CAGpB,MAAM,iBAAiB,0BAA0B;CACjD,MAAM,gBAAgB,OAAO,YAC3B,OAAO,QAAQ,cAAc,CAAC,CAAC,QAC5B,CAAC,UAAU,eAAe,UAAU,KAAA,CACvC,CACF;CACA,IAAI,OAAO,KAAK,aAAa,CAAC,CAAC,QAAQ,UAAU,EAAE,QAAQ,cAAc,CAAC;CAC1E,aAAa;AACf"}