create-zudo-doc 3.2.0 → 3.3.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 (122) hide show
  1. package/dist/claude-md-gen.d.ts +8 -0
  2. package/dist/claude-md-gen.js +43 -26
  3. package/dist/compose.d.ts +14 -20
  4. package/dist/compose.js +15 -25
  5. package/dist/features/body-foot-util.d.ts +8 -4
  6. package/dist/features/body-foot-util.js +8 -4
  7. package/dist/features/claude-resources.d.ts +12 -0
  8. package/dist/features/claude-resources.js +13 -6
  9. package/dist/features/design-token-panel.d.ts +0 -12
  10. package/dist/features/design-token-panel.js +32 -93
  11. package/dist/features/doc-history.d.ts +18 -3
  12. package/dist/features/doc-history.js +45 -60
  13. package/dist/features/doc-tags.d.ts +9 -13
  14. package/dist/features/doc-tags.js +10 -26
  15. package/dist/features/dynamic-page-transition.d.ts +19 -30
  16. package/dist/features/dynamic-page-transition.js +21 -209
  17. package/dist/features/footer-taglist.d.ts +1 -1
  18. package/dist/features/footer-taglist.js +1 -1
  19. package/dist/features/footer.d.ts +3 -2
  20. package/dist/features/footer.js +3 -2
  21. package/dist/features/i18n.d.ts +13 -8
  22. package/dist/features/i18n.js +14 -9
  23. package/dist/features/image-enlarge.d.ts +7 -26
  24. package/dist/features/image-enlarge.js +7 -26
  25. package/dist/features/llms-txt.d.ts +3 -5
  26. package/dist/features/llms-txt.js +3 -5
  27. package/dist/features/search.d.ts +7 -3
  28. package/dist/features/search.js +7 -3
  29. package/dist/features/sidebar-resizer.d.ts +4 -8
  30. package/dist/features/sidebar-resizer.js +4 -8
  31. package/dist/features/sidebar-toggle.d.ts +7 -7
  32. package/dist/features/sidebar-toggle.js +7 -7
  33. package/dist/features/tag-governance.d.ts +14 -7
  34. package/dist/features/tag-governance.js +52 -8
  35. package/dist/features/tauri.d.ts +13 -10
  36. package/dist/features/tauri.js +16 -52
  37. package/dist/features/versioning.d.ts +12 -24
  38. package/dist/features/versioning.js +13 -39
  39. package/dist/index.js +2 -3
  40. package/dist/scaffold.d.ts +13 -6
  41. package/dist/scaffold.js +64 -45
  42. package/dist/utils.d.ts +10 -0
  43. package/dist/utils.js +14 -0
  44. package/dist/zfb-config-gen.d.ts +32 -20
  45. package/dist/zfb-config-gen.js +400 -53
  46. package/package.json +2 -2
  47. package/templates/base/pages/docs/[[...slug]].tsx +59 -0
  48. package/templates/base/pages/index.tsx +6 -41
  49. package/templates/base/src/styles/global.css +15 -340
  50. package/templates/base/tsconfig.json +3 -26
  51. package/templates/features/i18n/files/pages/[locale]/docs/[[...slug]].tsx +88 -0
  52. package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +3 -1
  53. package/dist/settings-gen.d.ts +0 -2
  54. package/dist/settings-gen.js +0 -320
  55. package/templates/base/.htmlvalidate.json +0 -5
  56. package/templates/base/.zfb/doc-history-meta.json +0 -1
  57. package/templates/base/pages/_data.ts +0 -160
  58. package/templates/base/pages/lib/_body-end-islands.tsx +0 -165
  59. package/templates/base/pages/lib/_chrome.ts +0 -167
  60. package/templates/base/pages/lib/_details.tsx +0 -29
  61. package/templates/base/pages/lib/_doc-route-entries.ts +0 -10
  62. package/templates/base/pages/lib/_extract-headings.ts +0 -37
  63. package/templates/base/pages/lib/_frontmatter-preview-data.ts +0 -27
  64. package/templates/base/pages/lib/_nav-source-cache.ts +0 -100
  65. package/templates/base/pages/lib/_nav-source-docs.ts +0 -17
  66. package/templates/base/pages/lib/_preset-generator.tsx +0 -81
  67. package/templates/base/pages/lib/_route-context.ts +0 -32
  68. package/templates/base/pages/lib/_search-widget.tsx +0 -17
  69. package/templates/base/pages/lib/doc-page-props.ts +0 -30
  70. package/templates/base/pages/lib/locale-merge.ts +0 -59
  71. package/templates/base/scripts/run-b4push.sh +0 -102
  72. package/templates/base/src/components/ai-chat-modal.tsx +0 -18
  73. package/templates/base/src/components/content/code-group.tsx +0 -3
  74. package/templates/base/src/components/content/content-admonition.tsx +0 -4
  75. package/templates/base/src/components/desktop-sidebar-toggle.tsx +0 -15
  76. package/templates/base/src/components/doc-history.tsx +0 -21
  77. package/templates/base/src/components/image-enlarge.tsx +0 -24
  78. package/templates/base/src/components/preset-generator.tsx +0 -14
  79. package/templates/base/src/components/sidebar-toggle.tsx +0 -6
  80. package/templates/base/src/components/sidebar-tree.tsx +0 -6
  81. package/templates/base/src/config/color-scheme-utils.ts +0 -69
  82. package/templates/base/src/config/color-schemes.ts +0 -165
  83. package/templates/base/src/config/docs-schema.ts +0 -95
  84. package/templates/base/src/config/frontmatter-preview-defaults.ts +0 -27
  85. package/templates/base/src/config/frontmatter-preview-renderers.tsx +0 -46
  86. package/templates/base/src/config/i18n.ts +0 -239
  87. package/templates/base/src/config/settings-types.ts +0 -45
  88. package/templates/base/src/config/sidebars.ts +0 -66
  89. package/templates/base/src/config/tag-vocabulary-types.ts +0 -4
  90. package/templates/base/src/config/tag-vocabulary.ts +0 -20
  91. package/templates/base/src/config/z-index-tokens.ts +0 -128
  92. package/templates/base/src/types/docs-entry.ts +0 -28
  93. package/templates/base/src/types/heading.ts +0 -5
  94. package/templates/base/src/types/locale.ts +0 -10
  95. package/templates/base/src/utils/base.ts +0 -164
  96. package/templates/base/src/utils/docs.ts +0 -446
  97. package/templates/base/src/utils/git-info.ts +0 -70
  98. package/templates/base/src/utils/github.ts +0 -22
  99. package/templates/base/src/utils/nav-scope.ts +0 -34
  100. package/templates/base/src/utils/sidebar.ts +0 -36
  101. package/templates/base/src/utils/slug.ts +0 -10
  102. package/templates/base/src/utils/smart-break.tsx +0 -12
  103. package/templates/base/src/utils/tags.ts +0 -83
  104. package/templates/base/zfb-shim.d.ts +0 -183
  105. package/templates/features/bodyFootUtil/files/src/utils/github.ts +0 -22
  106. package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +0 -42
  107. package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +0 -752
  108. package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +0 -97
  109. package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +0 -735
  110. package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +0 -15
  111. package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +0 -435
  112. package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +0 -174
  113. package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +0 -30
  114. package/templates/features/docHistory/files/src/components/doc-history.tsx +0 -10
  115. package/templates/features/docHistory/files/src/types/doc-history.ts +0 -7
  116. package/templates/features/dynamicPageTransition/files/src/components/client-router-bootstrap.tsx +0 -72
  117. package/templates/features/i18n/files/pages/[locale]/index.tsx +0 -72
  118. package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +0 -11
  119. package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +0 -6
  120. package/templates/features/tauri/files/src/components/find-bar.tsx +0 -122
  121. package/templates/features/tauri/files/src/components/find-in-page-init.tsx +0 -59
  122. package/templates/features/tauri/files/src/utils/find-in-page.ts +0 -175
@@ -1,97 +0,0 @@
1
- const htmlTags = new Set([
2
- "div", "span", "p", "a", "img", "br", "hr", "ul", "ol", "li",
3
- "h1", "h2", "h3", "h4", "h5", "h6", "code", "pre", "blockquote",
4
- "table", "tr", "td", "th", "thead", "tbody", "tfoot", "colgroup", "col",
5
- "strong", "em", "b", "i", "u", "s", "del", "ins", "sub", "sup",
6
- "details", "summary", "figure", "figcaption", "mark", "small",
7
- "cite", "q", "abbr", "dfn", "time", "var", "samp", "kbd",
8
- "section", "article", "aside", "header", "footer", "nav", "main",
9
- "form", "input", "button", "select", "option", "textarea", "label",
10
- "fieldset", "legend", "dl", "dt", "dd", "caption",
11
- ]);
12
-
13
- /**
14
- * Escape angle brackets and curly braces in content for MDX compatibility.
15
- * Preserves content inside code blocks (``` ... ```) and inline code (` ... `).
16
- * Handles 3+ backtick fenced blocks correctly.
17
- */
18
- export function escapeForMdx(content: string): string {
19
- // Extract code blocks (supports 3+ backtick fences via backreference)
20
- const codeBlocks: string[] = [];
21
- const placeholder = "\x00CODEBLOCK_";
22
- const codeBlockRegex = /(`{3,})[^\n]*\n[\s\S]*?\1/g;
23
- const withPlaceholders = content.replace(codeBlockRegex, (match) => {
24
- const idx = codeBlocks.length;
25
- codeBlocks.push(match);
26
- return `${placeholder}${idx}\x00`;
27
- });
28
- const parts = withPlaceholders.split(
29
- new RegExp(`(${placeholder}\\d+\x00)`, "g"),
30
- );
31
-
32
- return parts
33
- .map((part) => {
34
- const placeholderMatch = part.match(
35
- new RegExp(`^${placeholder}(\\d+)\x00$`),
36
- );
37
- if (placeholderMatch) return codeBlocks[Number(placeholderMatch[1])];
38
-
39
- // For non-code-block text, split on inline code to preserve it.
40
- // Supports multi-backtick inline code (`` `code` ``, ``` ``code`` ```).
41
- const inlineCodeRegex = /(`{1,3})(?!`)([\s\S]*?[^`])\1(?!`)/g;
42
- const inlineCodes: string[] = [];
43
- const inlinePlaceholder = "\x00INLINE_";
44
- const withInlinePlaceholders = part.replace(
45
- inlineCodeRegex,
46
- (match) => {
47
- const idx = inlineCodes.length;
48
- inlineCodes.push(match);
49
- return `${inlinePlaceholder}${idx}\x00`;
50
- },
51
- );
52
-
53
- let escaped = withInlinePlaceholders
54
- // Escape opening tags: <Name>, <Name attr="val">
55
- .replace(
56
- /<([A-Za-z][A-Za-z0-9_-]*)(\s[^>]*)?>/g,
57
- (match, name: string) => {
58
- if (htmlTags.has(name.toLowerCase())) return match;
59
- return match.replace(/</g, "&lt;").replace(/>/g, "&gt;");
60
- },
61
- )
62
- // Escape closing tags: </Name>
63
- .replace(
64
- /<\/([A-Za-z][A-Za-z0-9_-]*)>/g,
65
- (match, name: string) => {
66
- if (htmlTags.has(name.toLowerCase())) return match;
67
- return `&lt;/${name}&gt;`;
68
- },
69
- )
70
- // Escape self-closing tags. The spaced form <Foo /> is already handled
71
- // by the opening-tag regex above ((\s[^>]*)? matches " /", then > closes),
72
- // but the COMPACT form <Foo/> (no space before the slash) is NOT — the
73
- // name is consumed, (\s[^>]*)? matches empty, then the regex needs ">"
74
- // and finds "/". So this branch is still required for the compact form.
75
- .replace(
76
- /<([A-Za-z][A-Za-z0-9_-]*)(\s[^>]*)?\s*\/>/g,
77
- (match, name: string) => {
78
- if (htmlTags.has(name.toLowerCase())) return match;
79
- return match.replace(/</g, "&lt;").replace(/>/g, "&gt;");
80
- },
81
- )
82
- .replace(/<(-+|=+)/g, "&lt;$1")
83
- .replace(/<(\d)/g, "&lt;$1")
84
- // Escape curly braces (MDX interprets them as JSX expressions)
85
- .replace(/\{/g, "&#123;")
86
- .replace(/\}/g, "&#125;");
87
-
88
- // Restore inline code placeholders
89
- escaped = escaped.replace(
90
- new RegExp(`${inlinePlaceholder}(\\d+)\x00`, "g"),
91
- (_, idx: string) => inlineCodes[Number(idx)] ?? "",
92
- );
93
-
94
- return escaped;
95
- })
96
- .join("");
97
- }