create-zudo-doc 0.2.21 → 0.2.22

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 (71) hide show
  1. package/dist/features/image-enlarge.d.ts +10 -2
  2. package/dist/features/image-enlarge.js +10 -2
  3. package/dist/scaffold.js +20 -22
  4. package/dist/zfb-config-gen.d.ts +16 -10
  5. package/dist/zfb-config-gen.js +34 -239
  6. package/package.json +1 -1
  7. package/templates/base/pages/lib/_body-end-islands.tsx +6 -13
  8. package/templates/base/pages/lib/_category-nav.tsx +30 -115
  9. package/templates/base/pages/lib/_category-tree-nav.tsx +38 -65
  10. package/templates/base/pages/lib/_compose-meta-title.ts +2 -6
  11. package/templates/base/pages/lib/_doc-body-end.tsx +3 -35
  12. package/templates/base/pages/lib/_doc-content-header.tsx +10 -111
  13. package/templates/base/pages/lib/_doc-history-area.tsx +19 -211
  14. package/templates/base/pages/lib/_doc-metainfo-area.tsx +10 -113
  15. package/templates/base/pages/lib/_doc-page-renderer.tsx +22 -183
  16. package/templates/base/pages/lib/_doc-page-shell.tsx +17 -251
  17. package/templates/base/pages/lib/_doc-pager.tsx +4 -74
  18. package/templates/base/pages/lib/_doc-route-entries.ts +43 -177
  19. package/templates/base/pages/lib/_doc-route-paths.ts +16 -101
  20. package/templates/base/pages/lib/_doc-tags-area.tsx +14 -77
  21. package/templates/base/pages/lib/_footer-with-defaults.tsx +37 -225
  22. package/templates/base/pages/lib/_frontmatter-preview-data.ts +5 -31
  23. package/templates/base/pages/lib/_head-with-defaults.tsx +13 -138
  24. package/templates/base/pages/lib/_header-with-defaults.tsx +24 -324
  25. package/templates/base/pages/lib/_inline-version-switcher.tsx +16 -78
  26. package/templates/base/pages/lib/_nav-data-prep.ts +32 -51
  27. package/templates/base/pages/lib/_nav-source-cache.ts +12 -57
  28. package/templates/base/pages/lib/_nav-source-docs.ts +33 -233
  29. package/templates/base/pages/lib/_search-widget-script.ts +2 -470
  30. package/templates/base/pages/lib/_search-widget.tsx +9 -195
  31. package/templates/base/pages/lib/_sidebar-prepaint.tsx +6 -59
  32. package/templates/base/pages/lib/_sidebar-with-defaults.tsx +16 -118
  33. package/templates/base/pages/lib/_site-tree-nav.tsx +29 -80
  34. package/templates/base/pages/lib/doc-page-props.ts +26 -44
  35. package/templates/base/pages/lib/locale-merge.ts +32 -145
  36. package/templates/base/pages/lib/route-enumerators.ts +52 -286
  37. package/templates/base/pages/robots.txt.tsx +2 -26
  38. package/templates/base/src/components/ai-chat-modal.tsx +9 -8
  39. package/templates/base/src/components/doc-history.tsx +9 -8
  40. package/templates/base/src/components/image-enlarge.tsx +11 -8
  41. package/templates/base/src/components/sidebar-toggle.tsx +6 -170
  42. package/templates/base/src/components/sidebar-tree.tsx +6 -548
  43. package/templates/base/src/components/site-tree-nav.tsx +6 -220
  44. package/templates/base/src/config/color-scheme-utils.ts +34 -158
  45. package/templates/base/src/config/i18n.ts +9 -0
  46. package/templates/base/src/config/z-index-tokens.ts +5 -4
  47. package/templates/base/src/styles/global.css +5 -579
  48. package/templates/base/src/utils/base.ts +1 -1
  49. package/templates/base/src/utils/docs.ts +47 -16
  50. package/templates/base/src/utils/github.ts +12 -9
  51. package/templates/base/src/utils/nav-scope.ts +13 -42
  52. package/templates/base/src/utils/sidebar.ts +18 -86
  53. package/templates/base/src/utils/slug.ts +10 -53
  54. package/templates/base/src/utils/smart-break.tsx +12 -120
  55. package/templates/base/src/utils/tags.ts +25 -68
  56. package/templates/features/bodyFootUtil/files/src/utils/github.ts +12 -9
  57. package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +13 -39
  58. package/templates/features/docHistory/files/src/components/doc-history.tsx +8 -636
  59. package/templates/features/docHistory/files/src/types/doc-history.ts +7 -23
  60. package/templates/features/docTags/files/pages/lib/_tag-pages.tsx +35 -201
  61. package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +8 -269
  62. package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +6 -99
  63. package/templates/features/tagGovernance/files/scripts/tags-audit.ts +67 -515
  64. package/templates/features/versioning/files/pages/lib/_versions-page.tsx +21 -73
  65. package/templates/base/plugins/connect-adapter.mjs +0 -169
  66. package/templates/base/plugins/search-index-plugin.mjs +0 -66
  67. package/templates/base/scripts/gen-z-index.mjs +0 -157
  68. package/templates/base/src/components/mermaid-enlarge.tsx +0 -490
  69. package/templates/features/claudeResources/files/plugins/claude-resources-plugin.mjs +0 -47
  70. package/templates/features/docHistory/files/plugins/doc-history-plugin.mjs +0 -111
  71. package/templates/features/llmsTxt/files/plugins/llms-txt-plugin.mjs +0 -93
@@ -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);