@baybreezy/docd 0.0.10 → 0.0.12
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.
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
*/
|
|
46
46
|
export const fieldStyles = tv({
|
|
47
47
|
slots: {
|
|
48
|
-
base: "flex flex-col gap-2
|
|
48
|
+
base: "flex flex-col gap-2 p-4",
|
|
49
49
|
name: "flex flex-wrap items-center gap-2",
|
|
50
50
|
nameText: "font-semibold text-foreground",
|
|
51
51
|
typeBadge: "rounded-md px-1.5 py-0.5 text-[11px]",
|
|
@@ -59,11 +59,15 @@
|
|
|
59
59
|
* Optional icon name to display next to the filename
|
|
60
60
|
*/
|
|
61
61
|
icon?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Format the filename: strip the file extension and apply title case
|
|
64
|
+
*/
|
|
65
|
+
format?: boolean;
|
|
62
66
|
}>();
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* Parse meta string and create a lowercase key map for easy checking
|
|
66
|
-
* Example: "
|
|
70
|
+
* Example: "format hideHeader icon='lucide:code'" => Map { 'format' => true, 'hideheader' => true, 'icon' => 'lucide:code' }
|
|
67
71
|
*/
|
|
68
72
|
const metaMap = computed(() => {
|
|
69
73
|
const map = new Map<string, string | boolean>();
|
|
@@ -90,7 +94,7 @@
|
|
|
90
94
|
});
|
|
91
95
|
|
|
92
96
|
const hideCopyButton = ref(false);
|
|
93
|
-
const
|
|
97
|
+
const formatMeta = computed(() => metaMap.value.has("format"));
|
|
94
98
|
const hideHeaderMeta = computed(
|
|
95
99
|
() => metaMap.value.has("hideheader") || metaMap.value.has("noheader")
|
|
96
100
|
);
|
|
@@ -107,7 +111,7 @@
|
|
|
107
111
|
|
|
108
112
|
const fileNameEdited = computed(() => {
|
|
109
113
|
if (!props.filename) return;
|
|
110
|
-
if (
|
|
114
|
+
if (!props.format && !formatMeta.value) return props.filename;
|
|
111
115
|
|
|
112
116
|
let processedName = props.filename;
|
|
113
117
|
|
|
@@ -10,7 +10,7 @@ export const useDocPage = async () => {
|
|
|
10
10
|
|
|
11
11
|
const [{ data: page }, { data: surround }, { data: navigation }] = await Promise.all([
|
|
12
12
|
useAsyncData(
|
|
13
|
-
kebabCase(route.path),
|
|
13
|
+
kebabCase(route.path) || "root",
|
|
14
14
|
() =>
|
|
15
15
|
isLandingRoute
|
|
16
16
|
? queryCollection("landing" as keyof Collections)
|
|
@@ -22,7 +22,7 @@ export const useDocPage = async () => {
|
|
|
22
22
|
{ watch: [() => route.path] }
|
|
23
23
|
),
|
|
24
24
|
useAsyncData(
|
|
25
|
-
`${kebabCase(route.path)}-surround`,
|
|
25
|
+
`${kebabCase(route.path) || "root"}-surround`,
|
|
26
26
|
() => {
|
|
27
27
|
if (isLandingRoute) {
|
|
28
28
|
return Promise.resolve(null);
|