create-zudo-doc 0.2.21 → 1.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 (92) hide show
  1. package/dist/compose.d.ts +6 -3
  2. package/dist/compose.js +6 -4
  3. package/dist/features/image-enlarge.d.ts +22 -12
  4. package/dist/features/image-enlarge.js +23 -191
  5. package/dist/scaffold.d.ts +11 -0
  6. package/dist/scaffold.js +51 -24
  7. package/dist/settings-gen.js +4 -0
  8. package/dist/zfb-config-gen.d.ts +16 -10
  9. package/dist/zfb-config-gen.js +34 -239
  10. package/package.json +1 -1
  11. package/templates/base/pages/_mdx-components.ts +64 -185
  12. package/templates/base/pages/index.tsx +1 -1
  13. package/templates/base/pages/lib/_body-end-islands.tsx +6 -13
  14. package/templates/base/pages/lib/_category-nav.tsx +30 -115
  15. package/templates/base/pages/lib/_category-tree-nav.tsx +38 -65
  16. package/templates/base/pages/lib/_compose-meta-title.ts +2 -6
  17. package/templates/base/pages/lib/_doc-body-end.tsx +3 -35
  18. package/templates/base/pages/lib/_doc-content-header.tsx +10 -111
  19. package/templates/base/pages/lib/_doc-history-area.tsx +19 -211
  20. package/templates/base/pages/lib/_doc-metainfo-area.tsx +10 -113
  21. package/templates/base/pages/lib/_doc-page-renderer.tsx +22 -183
  22. package/templates/base/pages/lib/_doc-page-shell.tsx +17 -251
  23. package/templates/base/pages/lib/_doc-pager.tsx +4 -74
  24. package/templates/base/pages/lib/_doc-route-entries.ts +43 -177
  25. package/templates/base/pages/lib/_doc-route-paths.ts +16 -101
  26. package/templates/base/pages/lib/_doc-tags-area.tsx +14 -77
  27. package/templates/base/pages/lib/_extract-headings.ts +21 -295
  28. package/templates/base/pages/lib/_footer-with-defaults.tsx +37 -225
  29. package/templates/base/pages/lib/_frontmatter-preview-data.ts +5 -31
  30. package/templates/base/pages/lib/_head-with-defaults.tsx +13 -138
  31. package/templates/base/pages/lib/_header-with-defaults.tsx +24 -324
  32. package/templates/base/pages/lib/_inline-version-switcher.tsx +16 -78
  33. package/templates/base/pages/lib/_math-block.tsx +4 -63
  34. package/templates/base/pages/lib/_nav-data-prep.ts +32 -51
  35. package/templates/base/pages/lib/_nav-source-cache.ts +12 -57
  36. package/templates/base/pages/lib/_nav-source-docs.ts +33 -233
  37. package/templates/base/pages/lib/_search-widget-script.ts +2 -470
  38. package/templates/base/pages/lib/_search-widget.tsx +9 -195
  39. package/templates/base/pages/lib/_sidebar-prepaint.tsx +6 -59
  40. package/templates/base/pages/lib/_sidebar-with-defaults.tsx +16 -118
  41. package/templates/base/pages/lib/_site-tree-nav.tsx +29 -80
  42. package/templates/base/pages/lib/doc-page-props.ts +26 -44
  43. package/templates/base/pages/lib/locale-merge.ts +32 -145
  44. package/templates/base/pages/lib/route-enumerators.ts +52 -286
  45. package/templates/base/src/components/ai-chat-modal.tsx +9 -8
  46. package/templates/base/src/components/content/code-group.tsx +3 -76
  47. package/templates/base/src/components/content/content-admonition.tsx +4 -56
  48. package/templates/base/src/components/doc-history.tsx +9 -8
  49. package/templates/base/src/components/image-enlarge.tsx +11 -8
  50. package/templates/base/src/components/sidebar-toggle.tsx +6 -170
  51. package/templates/base/src/components/sidebar-tree.tsx +6 -548
  52. package/templates/base/src/config/color-scheme-utils.ts +34 -158
  53. package/templates/base/src/config/i18n.ts +9 -0
  54. package/templates/base/src/config/settings-types.ts +34 -172
  55. package/templates/base/src/config/z-index-tokens.ts +5 -4
  56. package/templates/base/src/styles/global.css +40 -587
  57. package/templates/base/src/utils/base.ts +1 -1
  58. package/templates/base/src/utils/docs.ts +47 -16
  59. package/templates/base/src/utils/github.ts +12 -9
  60. package/templates/base/src/utils/nav-scope.ts +13 -42
  61. package/templates/base/src/utils/sidebar.ts +18 -86
  62. package/templates/base/src/utils/slug.ts +10 -53
  63. package/templates/base/src/utils/smart-break.tsx +12 -120
  64. package/templates/base/src/utils/tags.ts +25 -68
  65. package/templates/features/bodyFootUtil/files/src/utils/github.ts +12 -9
  66. package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +13 -39
  67. package/templates/features/docHistory/files/src/components/doc-history.tsx +8 -636
  68. package/templates/features/docHistory/files/src/types/doc-history.ts +7 -23
  69. package/templates/features/docTags/files/pages/lib/_tag-pages.tsx +35 -201
  70. package/templates/features/i18n/files/pages/[locale]/index.tsx +1 -1
  71. package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +8 -269
  72. package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +6 -99
  73. package/templates/features/tagGovernance/files/scripts/tags-audit.ts +67 -515
  74. package/templates/features/versioning/files/pages/lib/_versions-page.tsx +21 -73
  75. package/templates/base/pages/404.tsx +0 -61
  76. package/templates/base/pages/robots.txt.tsx +0 -29
  77. package/templates/base/pages/sitemap.xml.tsx +0 -59
  78. package/templates/base/plugins/connect-adapter.mjs +0 -169
  79. package/templates/base/plugins/copy-public-plugin.mjs +0 -58
  80. package/templates/base/plugins/search-index-plugin.mjs +0 -66
  81. package/templates/base/scripts/gen-z-index.mjs +0 -157
  82. package/templates/base/src/components/mermaid-enlarge.tsx +0 -490
  83. package/templates/base/src/components/site-tree-nav.tsx +0 -220
  84. package/templates/features/claudeResources/files/plugins/claude-resources-plugin.mjs +0 -47
  85. package/templates/features/docHistory/files/plugins/doc-history-plugin.mjs +0 -111
  86. package/templates/features/docTags/files/pages/[locale]/docs/tags/[tag].tsx +0 -59
  87. package/templates/features/docTags/files/pages/[locale]/docs/tags/index.tsx +0 -39
  88. package/templates/features/docTags/files/pages/docs/tags/[tag].tsx +0 -43
  89. package/templates/features/docTags/files/pages/docs/tags/index.tsx +0 -20
  90. package/templates/features/llmsTxt/files/plugins/llms-txt-plugin.mjs +0 -93
  91. package/templates/features/versioning/files/pages/[locale]/docs/versions.tsx +0 -48
  92. package/templates/features/versioning/files/pages/docs/versions.tsx +0 -20
@@ -1,19 +1,22 @@
1
- import { settings } from "@/config/settings";
1
+ // Host thin-stub see @takazudo/zudo-doc/github-helpers (epic #2344, S7).
2
+ //
3
+ // `buildGitHubRepoUrl` and `buildGitHubSourceUrl` are now parameterized pure
4
+ // functions in the package; this module wraps them with the host's
5
+ // `settings.githubUrl` singleton.
2
6
 
3
- function trimTrailingSlash(url: string): string {
4
- return url.replace(/\/+$/, "");
5
- }
7
+ import { settings } from "@/config/settings";
8
+ import {
9
+ buildGitHubRepoUrl as _buildGitHubRepoUrl,
10
+ buildGitHubSourceUrl as _buildGitHubSourceUrl,
11
+ } from "@takazudo/zudo-doc/github-helpers";
6
12
 
7
13
  export function buildGitHubRepoUrl(): string | null {
8
- if (!settings.githubUrl) return null;
9
- return trimTrailingSlash(settings.githubUrl as string);
14
+ return _buildGitHubRepoUrl(settings.githubUrl);
10
15
  }
11
16
 
12
17
  export function buildGitHubSourceUrl(
13
18
  contentDir: string,
14
19
  entryId: string,
15
20
  ): string | null {
16
- const repoUrl = buildGitHubRepoUrl();
17
- if (!repoUrl) return null;
18
- return `${repoUrl}/blob/HEAD/${contentDir}/${entryId}`;
21
+ return _buildGitHubSourceUrl(settings.githubUrl, contentDir, entryId);
19
22
  }
@@ -3,47 +3,21 @@
3
3
  *
4
4
  * Imported as a side-effect from the body-end islands helper when
5
5
  * settings.designTokenPanel is truthy. The dynamic import is gated there so
6
- * this module is only bundled
7
- * when the feature is enabled.
6
+ * this module is only bundled when the feature is enabled.
8
7
  *
9
- * Lifecycle adapter: wires zdtp's navigation hooks to zfb's own navigation
10
- * events via setLifecycleAdapter(). onBeforeSwap maps to zfb:before-preparation
11
- * and onPageLoad maps to zfb:after-swap so zdtp re-applies persisted token
12
- * overrides on every soft navigation without depending on Astro events.
8
+ * The wiring MECHANISM (configurePanel + setLifecycleAdapter) now lives in the
9
+ * package at `@takazudo/zudo-doc/design-token-panel-bootstrap`. This file
10
+ * passes the project's PanelConfig DATA to that mechanism.
11
+ *
12
+ * S9a package-first migration — zudolab/zudo-doc#2333.
13
+ *
14
+ * CSS is pulled via `@import "@takazudo/zdtp/styles.css"` in
15
+ * src/styles/global.css so the panel chrome lands in the main page CSS bundle
16
+ * (not a deferred chunk). Vite library mode strips the source CSS import from
17
+ * the emitted JS, so the explicit CSS-side import is the required pull point.
13
18
  */
14
19
 
15
- import { configurePanel, setLifecycleAdapter, type LifecycleAdapter } from "@takazudo/zdtp";
16
- // CSS is pulled via `@import "@takazudo/zdtp/styles.css"` in
17
- // src/styles/global.css so the panel chrome lands in the main page CSS bundle
18
- // (not a deferred chunk). Vite library mode strips the source CSS import from
19
- // the emitted JS, so the explicit CSS-side import is the required pull point.
20
+ import { bootstrapDesignTokenPanel } from "@takazudo/zudo-doc/design-token-panel-bootstrap";
20
21
  import { designTokenPanelConfig } from "@/config/design-token-panel-config";
21
22
 
22
- configurePanel(designTokenPanelConfig);
23
-
24
- // Drain the pre-hydration click queue. If the user clicked the palette button
25
- // before this module evaluated, a pre-hydration shim captured the event as a
26
- // single boolean flag. Calling __zdtpReadyClicks() here removes the shim
27
- // listener and re-dispatches once (at most) so the now-registered zdtp
28
- // listener picks it up and mounts the panel.
29
- if (typeof window !== "undefined") {
30
- (window as { __zdtpReadyClicks?: () => void }).__zdtpReadyClicks?.();
31
- }
32
-
33
- // zfb fires "zfb:before-preparation" (before nav) and "zfb:after-swap" (after nav).
34
- // Adjust these event names if your zfb version uses different names.
35
- if (typeof document !== "undefined") {
36
- const adapter: LifecycleAdapter = {
37
- onBeforeSwap(cb) {
38
- const handler = () => cb();
39
- document.addEventListener("zfb:before-preparation", handler);
40
- return () => document.removeEventListener("zfb:before-preparation", handler);
41
- },
42
- onPageLoad(cb) {
43
- const handler = () => cb();
44
- document.addEventListener("zfb:after-swap", handler);
45
- return () => document.removeEventListener("zfb:after-swap", handler);
46
- },
47
- };
48
- setLifecycleAdapter(adapter);
49
- }
23
+ bootstrapDesignTokenPanel(designTokenPanelConfig);