create-zudo-doc 3.1.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.
- package/dist/claude-md-gen.d.ts +8 -0
- package/dist/claude-md-gen.js +43 -26
- package/dist/compose.d.ts +14 -20
- package/dist/compose.js +15 -25
- package/dist/features/body-foot-util.d.ts +8 -4
- package/dist/features/body-foot-util.js +8 -4
- package/dist/features/claude-resources.d.ts +12 -0
- package/dist/features/claude-resources.js +13 -6
- package/dist/features/design-token-panel.d.ts +0 -12
- package/dist/features/design-token-panel.js +32 -93
- package/dist/features/doc-history.d.ts +18 -3
- package/dist/features/doc-history.js +45 -60
- package/dist/features/doc-tags.d.ts +9 -13
- package/dist/features/doc-tags.js +10 -26
- package/dist/features/dynamic-page-transition.d.ts +19 -30
- package/dist/features/dynamic-page-transition.js +21 -209
- package/dist/features/footer-taglist.d.ts +1 -1
- package/dist/features/footer-taglist.js +1 -1
- package/dist/features/footer.d.ts +3 -2
- package/dist/features/footer.js +3 -2
- package/dist/features/i18n.d.ts +13 -8
- package/dist/features/i18n.js +14 -9
- package/dist/features/image-enlarge.d.ts +7 -26
- package/dist/features/image-enlarge.js +7 -26
- package/dist/features/llms-txt.d.ts +3 -5
- package/dist/features/llms-txt.js +3 -5
- package/dist/features/search.d.ts +7 -3
- package/dist/features/search.js +7 -3
- package/dist/features/sidebar-resizer.d.ts +4 -8
- package/dist/features/sidebar-resizer.js +4 -8
- package/dist/features/sidebar-toggle.d.ts +7 -7
- package/dist/features/sidebar-toggle.js +7 -7
- package/dist/features/tag-governance.d.ts +14 -7
- package/dist/features/tag-governance.js +52 -8
- package/dist/features/tauri.d.ts +13 -10
- package/dist/features/tauri.js +16 -52
- package/dist/features/versioning.d.ts +12 -24
- package/dist/features/versioning.js +13 -39
- package/dist/index.js +2 -3
- package/dist/preset.d.ts +1 -0
- package/dist/preset.js +5 -0
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.js +1 -0
- package/dist/scaffold.d.ts +13 -6
- package/dist/scaffold.js +78 -59
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +14 -0
- package/dist/zfb-config-gen.d.ts +32 -20
- package/dist/zfb-config-gen.js +400 -53
- package/package.json +2 -2
- package/templates/base/pages/docs/[[...slug]].tsx +59 -0
- package/templates/base/pages/index.tsx +6 -41
- package/templates/base/scripts/setup-doc-skill.sh +261 -0
- package/templates/base/src/styles/global.css +15 -340
- package/templates/base/tsconfig.json +3 -26
- package/templates/features/i18n/files/pages/[locale]/docs/[[...slug]].tsx +88 -0
- package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +3 -1
- package/dist/settings-gen.d.ts +0 -2
- package/dist/settings-gen.js +0 -319
- package/templates/base/.htmlvalidate.json +0 -5
- package/templates/base/.zfb/doc-history-meta.json +0 -1
- package/templates/base/pages/_data.ts +0 -160
- package/templates/base/pages/lib/_body-end-islands.tsx +0 -165
- package/templates/base/pages/lib/_chrome.ts +0 -167
- package/templates/base/pages/lib/_details.tsx +0 -29
- package/templates/base/pages/lib/_doc-route-entries.ts +0 -10
- package/templates/base/pages/lib/_extract-headings.ts +0 -37
- package/templates/base/pages/lib/_frontmatter-preview-data.ts +0 -27
- package/templates/base/pages/lib/_nav-source-cache.ts +0 -100
- package/templates/base/pages/lib/_nav-source-docs.ts +0 -17
- package/templates/base/pages/lib/_preset-generator.tsx +0 -81
- package/templates/base/pages/lib/_route-context.ts +0 -32
- package/templates/base/pages/lib/_search-widget.tsx +0 -17
- package/templates/base/pages/lib/doc-page-props.ts +0 -30
- package/templates/base/pages/lib/locale-merge.ts +0 -59
- package/templates/base/scripts/run-b4push.sh +0 -102
- package/templates/base/src/components/ai-chat-modal.tsx +0 -18
- package/templates/base/src/components/content/code-group.tsx +0 -3
- package/templates/base/src/components/content/content-admonition.tsx +0 -4
- package/templates/base/src/components/desktop-sidebar-toggle.tsx +0 -15
- package/templates/base/src/components/doc-history.tsx +0 -21
- package/templates/base/src/components/image-enlarge.tsx +0 -24
- package/templates/base/src/components/preset-generator.tsx +0 -14
- package/templates/base/src/components/sidebar-toggle.tsx +0 -6
- package/templates/base/src/components/sidebar-tree.tsx +0 -6
- package/templates/base/src/config/color-scheme-utils.ts +0 -69
- package/templates/base/src/config/color-schemes.ts +0 -165
- package/templates/base/src/config/docs-schema.ts +0 -95
- package/templates/base/src/config/frontmatter-preview-defaults.ts +0 -27
- package/templates/base/src/config/frontmatter-preview-renderers.tsx +0 -46
- package/templates/base/src/config/i18n.ts +0 -239
- package/templates/base/src/config/settings-types.ts +0 -45
- package/templates/base/src/config/sidebars.ts +0 -66
- package/templates/base/src/config/tag-vocabulary-types.ts +0 -4
- package/templates/base/src/config/tag-vocabulary.ts +0 -20
- package/templates/base/src/config/z-index-tokens.ts +0 -128
- package/templates/base/src/types/docs-entry.ts +0 -28
- package/templates/base/src/types/heading.ts +0 -5
- package/templates/base/src/types/locale.ts +0 -10
- package/templates/base/src/utils/base.ts +0 -164
- package/templates/base/src/utils/docs.ts +0 -446
- package/templates/base/src/utils/git-info.ts +0 -70
- package/templates/base/src/utils/github.ts +0 -22
- package/templates/base/src/utils/nav-scope.ts +0 -34
- package/templates/base/src/utils/sidebar.ts +0 -36
- package/templates/base/src/utils/slug.ts +0 -10
- package/templates/base/src/utils/smart-break.tsx +0 -12
- package/templates/base/src/utils/tags.ts +0 -83
- package/templates/base/zfb-shim.d.ts +0 -178
- package/templates/features/bodyFootUtil/files/src/utils/github.ts +0 -22
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +0 -42
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +0 -752
- package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +0 -97
- package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +0 -735
- package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +0 -15
- package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +0 -435
- package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +0 -174
- package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +0 -30
- package/templates/features/docHistory/files/src/components/doc-history.tsx +0 -10
- package/templates/features/docHistory/files/src/types/doc-history.ts +0 -7
- package/templates/features/dynamicPageTransition/files/src/components/client-router-bootstrap.tsx +0 -72
- package/templates/features/i18n/files/pages/[locale]/index.tsx +0 -72
- package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +0 -11
- package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +0 -6
- package/templates/features/tauri/files/src/components/find-bar.tsx +0 -122
- package/templates/features/tauri/files/src/components/find-in-page-init.tsx +0 -59
- package/templates/features/tauri/files/src/utils/find-in-page.ts +0 -175
package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts
DELETED
|
@@ -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, "<").replace(/>/g, ">");
|
|
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 `</${name}>`;
|
|
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, "<").replace(/>/g, ">");
|
|
80
|
-
},
|
|
81
|
-
)
|
|
82
|
-
.replace(/<(-+|=+)/g, "<$1")
|
|
83
|
-
.replace(/<(\d)/g, "<$1")
|
|
84
|
-
// Escape curly braces (MDX interprets them as JSX expressions)
|
|
85
|
-
.replace(/\{/g, "{")
|
|
86
|
-
.replace(/\}/g, "}");
|
|
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
|
-
}
|