create-zudo-doc 3.2.0 → 4.0.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 (137) hide show
  1. package/README.md +3 -2
  2. package/dist/api.d.ts +2 -0
  3. package/dist/api.js +9 -1
  4. package/dist/claude-md-gen.d.ts +8 -0
  5. package/dist/claude-md-gen.js +44 -26
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +11 -1
  8. package/dist/compose.d.ts +14 -20
  9. package/dist/compose.js +15 -25
  10. package/dist/constants.d.ts +6 -0
  11. package/dist/constants.js +123 -1
  12. package/dist/features/body-foot-util.d.ts +8 -4
  13. package/dist/features/body-foot-util.js +8 -4
  14. package/dist/features/claude-resources.d.ts +9 -0
  15. package/dist/features/claude-resources.js +10 -6
  16. package/dist/features/design-token-panel.d.ts +0 -12
  17. package/dist/features/design-token-panel.js +32 -93
  18. package/dist/features/doc-history.d.ts +19 -3
  19. package/dist/features/doc-history.js +49 -60
  20. package/dist/features/doc-tags.d.ts +9 -13
  21. package/dist/features/doc-tags.js +10 -26
  22. package/dist/features/dynamic-page-transition.d.ts +19 -30
  23. package/dist/features/dynamic-page-transition.js +21 -209
  24. package/dist/features/footer-taglist.d.ts +1 -1
  25. package/dist/features/footer-taglist.js +1 -1
  26. package/dist/features/footer.d.ts +3 -2
  27. package/dist/features/footer.js +3 -2
  28. package/dist/features/i18n.d.ts +13 -8
  29. package/dist/features/i18n.js +14 -9
  30. package/dist/features/image-enlarge.d.ts +7 -26
  31. package/dist/features/image-enlarge.js +7 -26
  32. package/dist/features/index.js +2 -0
  33. package/dist/features/llms-txt.d.ts +3 -5
  34. package/dist/features/llms-txt.js +3 -5
  35. package/dist/features/search.d.ts +7 -3
  36. package/dist/features/search.js +7 -3
  37. package/dist/features/sidebar-resizer.d.ts +4 -8
  38. package/dist/features/sidebar-resizer.js +4 -8
  39. package/dist/features/sidebar-toggle.d.ts +7 -7
  40. package/dist/features/sidebar-toggle.js +7 -7
  41. package/dist/features/tag-governance.d.ts +3 -8
  42. package/dist/features/tag-governance.js +37 -9
  43. package/dist/features/tauri.d.ts +13 -10
  44. package/dist/features/tauri.js +16 -52
  45. package/dist/features/theme-pack-switcher.d.ts +11 -0
  46. package/dist/features/theme-pack-switcher.js +13 -0
  47. package/dist/features/versioning.d.ts +12 -24
  48. package/dist/features/versioning.js +13 -39
  49. package/dist/index.js +5 -3
  50. package/dist/preset.d.ts +2 -0
  51. package/dist/preset.js +12 -1
  52. package/dist/prompts.d.ts +2 -0
  53. package/dist/prompts.js +22 -1
  54. package/dist/scaffold.d.ts +13 -6
  55. package/dist/scaffold.js +97 -78
  56. package/dist/utils.d.ts +10 -0
  57. package/dist/utils.js +14 -0
  58. package/dist/zfb-config-gen.d.ts +32 -20
  59. package/dist/zfb-config-gen.js +410 -53
  60. package/package.json +2 -2
  61. package/templates/base/pages/docs/[[...slug]].tsx +64 -0
  62. package/templates/base/pages/index.tsx +6 -41
  63. package/templates/base/src/styles/global.css +15 -340
  64. package/templates/base/tsconfig.json +3 -26
  65. package/templates/features/i18n/files/pages/[locale]/docs/[[...slug]].tsx +92 -0
  66. package/dist/settings-gen.d.ts +0 -2
  67. package/dist/settings-gen.js +0 -320
  68. package/templates/base/.htmlvalidate.json +0 -5
  69. package/templates/base/.zfb/doc-history-meta.json +0 -1
  70. package/templates/base/pages/_data.ts +0 -160
  71. package/templates/base/pages/lib/_body-end-islands.tsx +0 -165
  72. package/templates/base/pages/lib/_chrome.ts +0 -167
  73. package/templates/base/pages/lib/_details.tsx +0 -29
  74. package/templates/base/pages/lib/_doc-route-entries.ts +0 -10
  75. package/templates/base/pages/lib/_extract-headings.ts +0 -37
  76. package/templates/base/pages/lib/_frontmatter-preview-data.ts +0 -27
  77. package/templates/base/pages/lib/_nav-source-cache.ts +0 -100
  78. package/templates/base/pages/lib/_nav-source-docs.ts +0 -17
  79. package/templates/base/pages/lib/_preset-generator.tsx +0 -81
  80. package/templates/base/pages/lib/_route-context.ts +0 -32
  81. package/templates/base/pages/lib/_search-widget.tsx +0 -17
  82. package/templates/base/pages/lib/doc-page-props.ts +0 -30
  83. package/templates/base/pages/lib/locale-merge.ts +0 -59
  84. package/templates/base/scripts/run-b4push.sh +0 -102
  85. package/templates/base/src/components/ai-chat-modal.tsx +0 -18
  86. package/templates/base/src/components/content/code-group.tsx +0 -3
  87. package/templates/base/src/components/content/content-admonition.tsx +0 -4
  88. package/templates/base/src/components/desktop-sidebar-toggle.tsx +0 -15
  89. package/templates/base/src/components/doc-history.tsx +0 -21
  90. package/templates/base/src/components/image-enlarge.tsx +0 -24
  91. package/templates/base/src/components/preset-generator.tsx +0 -14
  92. package/templates/base/src/components/sidebar-toggle.tsx +0 -6
  93. package/templates/base/src/components/sidebar-tree.tsx +0 -6
  94. package/templates/base/src/config/color-scheme-utils.ts +0 -69
  95. package/templates/base/src/config/color-schemes.ts +0 -165
  96. package/templates/base/src/config/docs-schema.ts +0 -95
  97. package/templates/base/src/config/frontmatter-preview-defaults.ts +0 -27
  98. package/templates/base/src/config/frontmatter-preview-renderers.tsx +0 -46
  99. package/templates/base/src/config/i18n.ts +0 -239
  100. package/templates/base/src/config/settings-types.ts +0 -45
  101. package/templates/base/src/config/sidebars.ts +0 -66
  102. package/templates/base/src/config/tag-vocabulary-types.ts +0 -4
  103. package/templates/base/src/config/tag-vocabulary.ts +0 -20
  104. package/templates/base/src/config/z-index-tokens.ts +0 -128
  105. package/templates/base/src/types/docs-entry.ts +0 -28
  106. package/templates/base/src/types/heading.ts +0 -5
  107. package/templates/base/src/types/locale.ts +0 -10
  108. package/templates/base/src/utils/base.ts +0 -164
  109. package/templates/base/src/utils/docs.ts +0 -446
  110. package/templates/base/src/utils/git-info.ts +0 -70
  111. package/templates/base/src/utils/github.ts +0 -22
  112. package/templates/base/src/utils/nav-scope.ts +0 -34
  113. package/templates/base/src/utils/sidebar.ts +0 -36
  114. package/templates/base/src/utils/slug.ts +0 -10
  115. package/templates/base/src/utils/smart-break.tsx +0 -12
  116. package/templates/base/src/utils/tags.ts +0 -83
  117. package/templates/base/zfb-shim.d.ts +0 -183
  118. package/templates/features/bodyFootUtil/files/src/utils/github.ts +0 -22
  119. package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +0 -42
  120. package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +0 -752
  121. package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +0 -97
  122. package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +0 -735
  123. package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +0 -15
  124. package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +0 -435
  125. package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +0 -174
  126. package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +0 -30
  127. package/templates/features/docHistory/files/src/components/doc-history.tsx +0 -10
  128. package/templates/features/docHistory/files/src/types/doc-history.ts +0 -7
  129. package/templates/features/dynamicPageTransition/files/src/components/client-router-bootstrap.tsx +0 -72
  130. package/templates/features/i18n/files/pages/[locale]/index.tsx +0 -72
  131. package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +0 -11
  132. package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +0 -6
  133. package/templates/features/tagGovernance/files/scripts/tags-audit.ts +0 -131
  134. package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +0 -428
  135. package/templates/features/tauri/files/src/components/find-bar.tsx +0 -122
  136. package/templates/features/tauri/files/src/components/find-in-page-init.tsx +0 -59
  137. 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
- }