@glossarist/concept-browser 0.2.5 → 0.2.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glossarist/concept-browser",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Vue SPA for browsing Glossarist terminology datasets with cross-reference resolution, graph visualization, and multi-language support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -106,37 +106,40 @@ async function loadConfig(): Promise<RuntimeSiteConfig | null> {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
function synthesizeGlobalPages(features?: Record<string, unknown>, pages?: PageConfig[]): PageConfig[] {
|
|
109
|
-
|
|
109
|
+
const declared = pages?.filter(p => !p.datasetScoped) ?? [];
|
|
110
|
+
const declaredRoutes = new Set(declared.map(p => p.route));
|
|
110
111
|
|
|
111
112
|
const result: PageConfig[] = [
|
|
112
113
|
{ type: 'custom', route: '', title: 'Home', icon: 'home' },
|
|
113
114
|
];
|
|
114
|
-
if (features?.search !== false) {
|
|
115
|
+
if (features?.search !== false && !declaredRoutes.has('search')) {
|
|
115
116
|
result.push({ type: 'custom', route: 'search', title: 'Search', icon: 'search' });
|
|
116
117
|
}
|
|
117
|
-
if (features?.graph !== false) {
|
|
118
|
+
if (features?.graph !== false && !declaredRoutes.has('graph')) {
|
|
118
119
|
result.push({ type: 'custom', route: 'graph', title: 'Graph', icon: 'graph' });
|
|
119
120
|
}
|
|
120
|
-
if (features?.news) {
|
|
121
|
+
if (features?.news && !declaredRoutes.has('news')) {
|
|
121
122
|
result.push({ type: 'news', route: 'news', title: 'News', icon: 'newspaper' });
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
|
|
125
|
+
return [...result, ...declared];
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
function synthesizeDatasetPages(features?: Record<string, unknown>, pages?: PageConfig[]): PageConfig[] {
|
|
127
129
|
const declared = pages?.filter(p => p.datasetScoped) ?? [];
|
|
128
|
-
|
|
130
|
+
const declaredRoutes = new Set(declared.map(p => p.route));
|
|
129
131
|
|
|
130
132
|
const result: PageConfig[] = [
|
|
131
133
|
{ type: 'custom', route: '', title: 'Concepts', icon: 'list', datasetScoped: true },
|
|
132
134
|
];
|
|
133
|
-
if (features?.stats !== false) {
|
|
135
|
+
if (features?.stats !== false && !declaredRoutes.has('stats')) {
|
|
134
136
|
result.push({ type: 'stats', route: 'stats', title: 'Statistics', icon: 'chart', datasetScoped: true });
|
|
135
137
|
}
|
|
136
|
-
if (features?.about !== false) {
|
|
138
|
+
if (features?.about !== false && !declaredRoutes.has('about')) {
|
|
137
139
|
result.push({ type: 'about', route: 'about', title: 'About', icon: 'info', datasetScoped: true });
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
|
|
142
|
+
return [...result, ...declared];
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
export function useSiteConfig() {
|
package/src/router/index.ts
CHANGED
|
@@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [
|
|
|
27
27
|
{
|
|
28
28
|
path: '/dataset/:registerId/about',
|
|
29
29
|
name: 'about',
|
|
30
|
-
component: () => import('../views/
|
|
30
|
+
component: () => import('../views/PageView.vue'),
|
|
31
31
|
props: true,
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -53,7 +53,7 @@ const routes: RouteRecordRaw[] = [
|
|
|
53
53
|
{
|
|
54
54
|
path: '/about',
|
|
55
55
|
name: 'about-global',
|
|
56
|
-
component: () => import('../views/
|
|
56
|
+
component: () => import('../views/PageView.vue'),
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
path: '/stats',
|
package/src/views/PageView.vue
CHANGED
|
@@ -8,7 +8,14 @@ interface PageData {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const route = useRoute();
|
|
11
|
-
const slug = computed(() =>
|
|
11
|
+
const slug = computed(() => {
|
|
12
|
+
if (route.params.slug) return route.params.slug as string;
|
|
13
|
+
if (route.params.page) return route.params.page as string;
|
|
14
|
+
if (route.name === 'about' || route.name === 'about-global') return 'about';
|
|
15
|
+
const path = route.path.replace(/^\//, '').replace(/\/$/, '');
|
|
16
|
+
const lastSegment = path.split('/').pop() || '';
|
|
17
|
+
return lastSegment;
|
|
18
|
+
});
|
|
12
19
|
const data = ref<PageData | null>(null);
|
|
13
20
|
const loading = ref(true);
|
|
14
21
|
const notFound = ref(false);
|