@baybreezy/docd 0.1.11 → 0.2.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/app/assets/css/shadcn.css +104 -0
- package/index.d.ts +2 -0
- package/modules/css.ts +65 -6
- package/package.json +16 -16
|
@@ -610,3 +610,107 @@
|
|
|
610
610
|
-webkit-text-fill-color: currentColor;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
+
|
|
614
|
+
/* Message entrance animations for the MessageScroller demos. */
|
|
615
|
+
@keyframes ms-anim-fade {
|
|
616
|
+
from {
|
|
617
|
+
opacity: 0;
|
|
618
|
+
}
|
|
619
|
+
to {
|
|
620
|
+
opacity: 1;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
@keyframes ms-anim-slide-up {
|
|
624
|
+
from {
|
|
625
|
+
opacity: 0;
|
|
626
|
+
transform: translateY(10px);
|
|
627
|
+
}
|
|
628
|
+
to {
|
|
629
|
+
opacity: 1;
|
|
630
|
+
transform: translateY(0);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
@keyframes ms-anim-slide-side {
|
|
634
|
+
from {
|
|
635
|
+
opacity: 0;
|
|
636
|
+
transform: translateX(18px);
|
|
637
|
+
}
|
|
638
|
+
to {
|
|
639
|
+
opacity: 1;
|
|
640
|
+
transform: translateX(0);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
@keyframes ms-anim-pop {
|
|
644
|
+
from {
|
|
645
|
+
opacity: 0;
|
|
646
|
+
transform: translateY(6px) scale(0.94);
|
|
647
|
+
}
|
|
648
|
+
to {
|
|
649
|
+
opacity: 1;
|
|
650
|
+
transform: translateY(0) scale(1);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
@keyframes ms-anim-spring-bounce {
|
|
654
|
+
0% {
|
|
655
|
+
opacity: 0;
|
|
656
|
+
transform: translateY(12px) scale(0.96);
|
|
657
|
+
}
|
|
658
|
+
60% {
|
|
659
|
+
opacity: 1;
|
|
660
|
+
transform: translateY(-2px) scale(1.01);
|
|
661
|
+
}
|
|
662
|
+
100% {
|
|
663
|
+
opacity: 1;
|
|
664
|
+
transform: translateY(0) scale(1);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
@keyframes ms-anim-blur-fade {
|
|
668
|
+
from {
|
|
669
|
+
opacity: 0;
|
|
670
|
+
filter: blur(4px);
|
|
671
|
+
transform: translateY(6px);
|
|
672
|
+
}
|
|
673
|
+
to {
|
|
674
|
+
opacity: 1;
|
|
675
|
+
filter: blur(0);
|
|
676
|
+
transform: translateY(0);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
@keyframes ms-anim-scale-fade {
|
|
680
|
+
from {
|
|
681
|
+
opacity: 0;
|
|
682
|
+
transform: scale(0.98);
|
|
683
|
+
}
|
|
684
|
+
to {
|
|
685
|
+
opacity: 1;
|
|
686
|
+
transform: scale(1);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.ms-anim-fade {
|
|
691
|
+
animation: ms-anim-fade 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
692
|
+
}
|
|
693
|
+
.ms-anim-slide-up {
|
|
694
|
+
animation: ms-anim-slide-up 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
695
|
+
}
|
|
696
|
+
.ms-anim-slide-side {
|
|
697
|
+
animation: ms-anim-slide-side 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
698
|
+
}
|
|
699
|
+
.ms-anim-pop {
|
|
700
|
+
animation: ms-anim-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
|
701
|
+
}
|
|
702
|
+
.ms-anim-spring-bounce {
|
|
703
|
+
animation: ms-anim-spring-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
|
704
|
+
}
|
|
705
|
+
.ms-anim-blur-fade {
|
|
706
|
+
animation: ms-anim-blur-fade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
707
|
+
}
|
|
708
|
+
.ms-anim-scale-fade {
|
|
709
|
+
animation: ms-anim-scale-fade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
@media (prefers-reduced-motion: reduce) {
|
|
713
|
+
[class*="ms-anim-"] {
|
|
714
|
+
animation: none;
|
|
715
|
+
}
|
|
716
|
+
}
|
package/index.d.ts
CHANGED
package/modules/css.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
1
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve as resolvePath } from "node:path";
|
|
2
4
|
|
|
3
|
-
import { addVitePlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
5
|
+
import { addVitePlugin, createResolver, defineNuxtModule, logger } from "@nuxt/kit";
|
|
6
|
+
import { defu } from "defu";
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export interface CssModuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Paths (relative to the consuming app root, or absolute) to CSS files that
|
|
11
|
+
* should be merged into the layer's Tailwind entry.
|
|
12
|
+
*
|
|
13
|
+
* Files that only use `@apply` already work without this — they get
|
|
14
|
+
* `@reference` injected automatically.
|
|
15
|
+
*
|
|
16
|
+
* Use `extend` for anything that needs
|
|
17
|
+
* more than that (`@theme`, `@utility`, `@custom-variant`, etc.), since those
|
|
18
|
+
* only take effect when the file is part of the same Tailwind build as the
|
|
19
|
+
* layer, not a separate one started by its own `@import "tailwindcss"`.
|
|
20
|
+
*/
|
|
21
|
+
extend?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const defaults: Required<CssModuleOptions> = {
|
|
25
|
+
extend: [],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const log = logger.withTag("Docd");
|
|
29
|
+
|
|
30
|
+
export default defineNuxtModule<CssModuleOptions>({
|
|
6
31
|
meta: {
|
|
7
32
|
name: "docd:css",
|
|
8
33
|
},
|
|
@@ -12,11 +37,30 @@ export default defineNuxtModule({
|
|
|
12
37
|
// Absolute path to the layer's tailwind entry — resolved from this module's
|
|
13
38
|
// location so it stays correct whether docd is local or installed from npm.
|
|
14
39
|
const tailwindCssPath = resolver.resolve("../app/assets/css/tailwind.css").replace(/\\/g, "/");
|
|
40
|
+
const tailwindCssDir = dirname(tailwindCssPath);
|
|
15
41
|
|
|
16
42
|
// Absolute paths that Tailwind needs to scan.
|
|
17
43
|
const rootDir = nuxt.options.rootDir.replace(/\\/g, "/");
|
|
18
44
|
const layerAppDir = resolver.resolve("../app").replace(/\\/g, "/");
|
|
19
45
|
|
|
46
|
+
const options = defu(
|
|
47
|
+
(nuxt.options as unknown as { docd?: { css?: CssModuleOptions } }).docd?.css,
|
|
48
|
+
defaults
|
|
49
|
+
) as Required<CssModuleOptions>;
|
|
50
|
+
|
|
51
|
+
// Resolve and validate consumer-provided files that opt into being merged
|
|
52
|
+
// into the layer's single Tailwind build.
|
|
53
|
+
const extendPaths = options.extend
|
|
54
|
+
.map((file) =>
|
|
55
|
+
(isAbsolute(file) ? file : resolvePath(nuxt.options.rootDir, file)).replace(/\\/g, "/")
|
|
56
|
+
)
|
|
57
|
+
.filter((file) => {
|
|
58
|
+
if (existsSync(file)) return true;
|
|
59
|
+
log.warn(`docd.css.extend: CSS file not found, skipping: ${file}`);
|
|
60
|
+
return false;
|
|
61
|
+
});
|
|
62
|
+
const extendPathSet = new Set(extendPaths);
|
|
63
|
+
|
|
20
64
|
// Use the `load` hook rather than `transform` so our modified source is
|
|
21
65
|
// visible to @tailwindcss/vite's transform hook (which has enforce:"pre"
|
|
22
66
|
// and is registered earlier). Vite always runs `load` before `transform`.
|
|
@@ -28,10 +72,21 @@ export default defineNuxtModule({
|
|
|
28
72
|
if (cleanId !== tailwindCssPath) return null;
|
|
29
73
|
|
|
30
74
|
const code = await readFile(tailwindCssPath, "utf8");
|
|
75
|
+
|
|
76
|
+
// `@import` each consumer-registered file so it's part of this same
|
|
77
|
+
// Tailwind compilation (one theme/base/utilities pass) instead of
|
|
78
|
+
// starting its own via a separate `@import "tailwindcss"`.
|
|
79
|
+
const extendImports = extendPaths.map((file) => {
|
|
80
|
+
this.addWatchFile(file);
|
|
81
|
+
const rel = relative(tailwindCssDir, file).replace(/\\/g, "/");
|
|
82
|
+
return `@import ${JSON.stringify(rel.startsWith(".") ? rel : `./${rel}`)};`;
|
|
83
|
+
});
|
|
84
|
+
|
|
31
85
|
return [
|
|
32
86
|
code,
|
|
33
87
|
`@source ${JSON.stringify(`${rootDir}/**/*`)};`,
|
|
34
88
|
`@source ${JSON.stringify(`${layerAppDir}/**/*`)};`,
|
|
89
|
+
...extendImports,
|
|
35
90
|
].join("\n");
|
|
36
91
|
},
|
|
37
92
|
});
|
|
@@ -48,6 +103,10 @@ export default defineNuxtModule({
|
|
|
48
103
|
if (!cleanId?.endsWith(".css")) return null;
|
|
49
104
|
// Skip the layer's own tailwind entry — it already has @import "tailwindcss".
|
|
50
105
|
if (cleanId === tailwindCssPath) return null;
|
|
106
|
+
// Skip files merged in via `docd.css.extend` — they're already `@import`ed
|
|
107
|
+
// into the tailwind entry above, so injecting `@reference` back to that
|
|
108
|
+
// same entry here would create a circular import.
|
|
109
|
+
if (extendPathSet.has(cleanId)) return null;
|
|
51
110
|
// Only touch files inside the consuming app root, not node_modules or the layer.
|
|
52
111
|
if (!cleanId.startsWith(`${rootDir}/`)) return null;
|
|
53
112
|
if (cleanId.startsWith(`${layerAppDir}/`)) return null;
|
|
@@ -76,11 +135,11 @@ export default defineNuxtModule({
|
|
|
76
135
|
|
|
77
136
|
// Suppress noisy Vite warnings produced during Tailwind's build pass.
|
|
78
137
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
79
|
-
const
|
|
80
|
-
if (!
|
|
138
|
+
const viteLogger = config.customLogger;
|
|
139
|
+
if (!viteLogger) return;
|
|
81
140
|
const ignore = ["@tailwindcss/vite:generate:build", "nuxt:module-preload-polyfill"];
|
|
82
|
-
const originalWarn =
|
|
83
|
-
|
|
141
|
+
const originalWarn = viteLogger.warn.bind(viteLogger);
|
|
142
|
+
viteLogger.warn = (msg, options) => {
|
|
84
143
|
if (ignore.some((p) => msg.includes(p))) return;
|
|
85
144
|
originalWarn(msg, options);
|
|
86
145
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baybreezy/docd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A Nuxt layer for building documentation sites with UI Thing.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,42 +31,42 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@baybreezy/file-extension-icon": "^0.0.5",
|
|
34
|
-
"@iconify-json/lucide": "^1.2.
|
|
35
|
-
"@iconify-json/material-icon-theme": "^1.2.
|
|
36
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
37
|
-
"@iconify/utils": "^3.1.
|
|
34
|
+
"@iconify-json/lucide": "^1.2.116",
|
|
35
|
+
"@iconify-json/material-icon-theme": "^1.2.69",
|
|
36
|
+
"@iconify-json/simple-icons": "^1.2.89",
|
|
37
|
+
"@iconify/utils": "^3.1.4",
|
|
38
38
|
"@morev/vue-transitions": "^3.0.5",
|
|
39
|
-
"@nuxt/content": "3.
|
|
39
|
+
"@nuxt/content": "3.15.0",
|
|
40
40
|
"@nuxt/fonts": "^0.14.0",
|
|
41
|
-
"@nuxt/icon": "^2.
|
|
41
|
+
"@nuxt/icon": "^2.3.1",
|
|
42
42
|
"@nuxt/image": "2.0.0",
|
|
43
43
|
"@nuxt/kit": "^4.4.8",
|
|
44
44
|
"@nuxtjs/color-mode": "^4.0.1",
|
|
45
45
|
"@nuxtjs/mcp-toolkit": "^0.17.2",
|
|
46
|
-
"@nuxtjs/mdc": "^0.22.
|
|
47
|
-
"@nuxtjs/robots": "^6.1.
|
|
46
|
+
"@nuxtjs/mdc": "^0.22.1",
|
|
47
|
+
"@nuxtjs/robots": "^6.1.2",
|
|
48
48
|
"@tailwindcss/forms": "^0.5.11",
|
|
49
49
|
"@tailwindcss/typography": "^0.5.20",
|
|
50
|
-
"@tailwindcss/vite": "^4.3.
|
|
51
|
-
"@takumi-rs/core": "^
|
|
50
|
+
"@tailwindcss/vite": "^4.3.2",
|
|
51
|
+
"@takumi-rs/core": "^2.0.3",
|
|
52
52
|
"@vueuse/core": "^14.3.0",
|
|
53
53
|
"@vueuse/nuxt": "^14.3.0",
|
|
54
54
|
"better-sqlite3": "^12.11.1",
|
|
55
55
|
"defu": "^6.1.7",
|
|
56
56
|
"git-url-parse": "^16.1.0",
|
|
57
57
|
"lodash-es": "^4.18.1",
|
|
58
|
-
"mermaid": "^11.
|
|
58
|
+
"mermaid": "^11.16.0",
|
|
59
59
|
"motion-v": "^2.3.0",
|
|
60
60
|
"nuxt-component-meta": "^0.17.2",
|
|
61
61
|
"nuxt-gtag": "4.1.0",
|
|
62
62
|
"nuxt-llms": "^0.2.0",
|
|
63
|
-
"nuxt-og-image": "^6.
|
|
63
|
+
"nuxt-og-image": "^6.7.2",
|
|
64
64
|
"pkg-types": "^2.3.1",
|
|
65
|
-
"reka-ui": "^2.10.
|
|
66
|
-
"shiki": "^4.
|
|
65
|
+
"reka-ui": "^2.10.1",
|
|
66
|
+
"shiki": "^4.3.1",
|
|
67
67
|
"tailwind-merge": "^3.6.0",
|
|
68
68
|
"tailwind-variants": "^3.2.2",
|
|
69
|
-
"tailwindcss": "^4.3.
|
|
69
|
+
"tailwindcss": "^4.3.2",
|
|
70
70
|
"tw-animate-css": "^1.4.0",
|
|
71
71
|
"ufo": "^1.6.4",
|
|
72
72
|
"vaul-vue": "^0.4.1",
|