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,175 +0,0 @@
1
- export interface FindResult {
2
- matches: number;
3
- activeMatchOrdinal: number; // 1-based
4
- }
5
-
6
- export interface FindInPage {
7
- find(container: HTMLElement, query: string): FindResult;
8
- next(): FindResult;
9
- prev(): FindResult;
10
- stop(): void;
11
- }
12
-
13
- const MATCH_CLASS = "find-match";
14
- const ACTIVE_CLASS = "find-match-active";
15
- const MATCH_ATTR = "data-find-match";
16
- const ACTIVE_ATTR = "data-find-active";
17
-
18
- const EMPTY_RESULT: FindResult = Object.freeze({ matches: 0, activeMatchOrdinal: 0 });
19
-
20
- /**
21
- * Create a DOM-based find-in-page utility.
22
- *
23
- * Limitation: only matches within single text nodes. Cross-element matching
24
- * (e.g. "Hello world" spanning `<strong>Hello</strong> world`) is not supported.
25
- */
26
- export function createFindInPage(): FindInPage {
27
- let matchElements: HTMLElement[] = [];
28
- let activeIndex = -1;
29
-
30
- function clearMarks(): void {
31
- const parentsToNormalize = new Set<Node>();
32
-
33
- for (let i = matchElements.length - 1; i >= 0; i--) {
34
- const mark = matchElements[i];
35
- const parent = mark.parentNode;
36
- if (parent) {
37
- const textNode = document.createTextNode(mark.textContent || "");
38
- parent.replaceChild(textNode, mark);
39
- parentsToNormalize.add(parent);
40
- }
41
- }
42
- for (const parent of parentsToNormalize) {
43
- (parent as Element).normalize();
44
- }
45
- matchElements = [];
46
- activeIndex = -1;
47
- }
48
-
49
- function setActive(index: number): void {
50
- if (activeIndex >= 0 && activeIndex < matchElements.length) {
51
- const prev = matchElements[activeIndex];
52
- prev.classList.remove(ACTIVE_CLASS);
53
- prev.removeAttribute(ACTIVE_ATTR);
54
- }
55
- activeIndex = index;
56
- if (activeIndex >= 0 && activeIndex < matchElements.length) {
57
- const current = matchElements[activeIndex];
58
- current.classList.add(ACTIVE_CLASS);
59
- current.setAttribute(ACTIVE_ATTR, "true");
60
- current.scrollIntoView?.({ block: "center" });
61
- }
62
- }
63
-
64
- function currentResult(): FindResult {
65
- if (matchElements.length === 0) {
66
- return EMPTY_RESULT;
67
- }
68
- return {
69
- matches: matchElements.length,
70
- activeMatchOrdinal: activeIndex + 1,
71
- };
72
- }
73
-
74
- function find(container: HTMLElement, query: string): FindResult {
75
- clearMarks();
76
-
77
- if (!query) {
78
- return EMPTY_RESULT;
79
- }
80
-
81
- const lowerQuery = query.toLowerCase();
82
-
83
- const walker = document.createTreeWalker(
84
- container,
85
- NodeFilter.SHOW_TEXT,
86
- null,
87
- );
88
-
89
- const textNodes: Text[] = [];
90
- let node: Text | null;
91
- while ((node = walker.nextNode() as Text | null)) {
92
- textNodes.push(node);
93
- }
94
-
95
- for (const textNode of textNodes) {
96
- const text = textNode.textContent || "";
97
- const lowerText = text.toLowerCase();
98
-
99
- const positions: number[] = [];
100
- let searchFrom = 0;
101
- while (searchFrom < lowerText.length) {
102
- const idx = lowerText.indexOf(lowerQuery, searchFrom);
103
- if (idx === -1) break;
104
- positions.push(idx);
105
- searchFrom = idx + lowerQuery.length;
106
- }
107
-
108
- if (positions.length === 0) continue;
109
-
110
- const parent = textNode.parentNode;
111
- if (!parent) continue;
112
-
113
- let remainingNode: Text = textNode;
114
- const nodeMarks: HTMLElement[] = [];
115
-
116
- for (let i = positions.length - 1; i >= 0; i--) {
117
- const pos = positions[i];
118
- const matchLen = query.length;
119
-
120
- if (pos + matchLen < remainingNode.length) {
121
- remainingNode.splitText(pos + matchLen);
122
- }
123
-
124
- let matchNode: Text;
125
- if (pos > 0) {
126
- matchNode = remainingNode.splitText(pos);
127
- } else {
128
- matchNode = remainingNode;
129
- }
130
-
131
- const mark = document.createElement("mark");
132
- mark.className = MATCH_CLASS;
133
- mark.setAttribute(MATCH_ATTR, "true");
134
- mark.textContent = matchNode.textContent;
135
-
136
- parent.replaceChild(mark, matchNode);
137
- nodeMarks.unshift(mark);
138
- }
139
-
140
- matchElements.push(...nodeMarks);
141
- }
142
-
143
- if (matchElements.length === 0) {
144
- return EMPTY_RESULT;
145
- }
146
-
147
- setActive(0);
148
- return currentResult();
149
- }
150
-
151
- function next(): FindResult {
152
- if (matchElements.length === 0) {
153
- return EMPTY_RESULT;
154
- }
155
- const newIndex = (activeIndex + 1) % matchElements.length;
156
- setActive(newIndex);
157
- return currentResult();
158
- }
159
-
160
- function prev(): FindResult {
161
- if (matchElements.length === 0) {
162
- return EMPTY_RESULT;
163
- }
164
- const newIndex =
165
- (activeIndex - 1 + matchElements.length) % matchElements.length;
166
- setActive(newIndex);
167
- return currentResult();
168
- }
169
-
170
- function stop(): void {
171
- clearMarks();
172
- }
173
-
174
- return { find, next, prev, stop };
175
- }