@glossarist/concept-browser 0.7.15 → 0.7.17

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.7.15",
3
+ "version": "0.7.17",
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": {
@@ -1126,21 +1126,32 @@ function processPages(config) {
1126
1126
 
1127
1127
  const processedPages = processPages(config);
1128
1128
 
1129
- // Auto-generate dataset about pages from {localPath}/about.md
1129
+ // Auto-generate dataset about pages from {localPath}/about-{lang}.md
1130
1130
  const _pagesDir = path.join(PUBLIC, 'pages');
1131
1131
  for (const ds of config.datasets || []) {
1132
1132
  if (!ds.localPath) continue;
1133
- const aboutSrc = path.resolve(ROOT, ds.localPath, 'about.md');
1134
- if (!fs.existsSync(aboutSrc)) continue;
1135
- const raw = fs.readFileSync(aboutSrc, 'utf8');
1136
- const html = renderMarkdown(stripFrontmatter(raw));
1133
+ const dsDir = path.resolve(ROOT, ds.localPath);
1134
+ const defaultLang = (ds.languages || ['eng'])[0];
1137
1135
  const route = `${ds.id}-about`;
1138
- writeJson(path.join(_pagesDir, `${route}.json`), { title: 'About', html });
1139
- console.log(` Auto-generated dataset about page: ${route}`);
1140
- const uiLangs = (config.uiLanguages || []).map(l => l.code).filter(l => l !== 'eng');
1141
1136
  const dsTranslations = ds.translations || {};
1137
+
1138
+ // Default-language about page: try about-{defaultLang}.md, fall back to about.md
1139
+ const defaultSrc = [
1140
+ path.join(dsDir, `about-${defaultLang}.md`),
1141
+ path.join(dsDir, 'about.md'),
1142
+ ].find(p => fs.existsSync(p));
1143
+
1144
+ if (defaultSrc) {
1145
+ const raw = fs.readFileSync(defaultSrc, 'utf8');
1146
+ const html = renderMarkdown(stripFrontmatter(raw));
1147
+ writeJson(path.join(_pagesDir, `${route}.json`), { title: 'About', html });
1148
+ console.log(` Auto-generated dataset about page: ${route} (from ${path.basename(defaultSrc)})`);
1149
+ }
1150
+
1151
+ // Translated about pages for all non-default UI languages
1152
+ const uiLangs = (config.uiLanguages || []).map(l => l.code).filter(l => l !== defaultLang);
1142
1153
  for (const lang of uiLangs) {
1143
- const trAboutSrc = path.resolve(ROOT, ds.localPath, `about-${lang}.md`);
1154
+ const trAboutSrc = path.join(dsDir, `about-${lang}.md`);
1144
1155
  if (!fs.existsSync(trAboutSrc)) continue;
1145
1156
  const trRaw = fs.readFileSync(trAboutSrc, 'utf8');
1146
1157
  const trHtml = renderMarkdown(stripFrontmatter(trRaw));
@@ -98,7 +98,25 @@ const conceptSources = computed(() => props.concept.sources);
98
98
  const conceptTags = computed(() => props.concept.tags ?? []);
99
99
 
100
100
  // Managed concept related (concept-level cross-references)
101
- const conceptRelated = computed(() => props.concept.relatedConcepts ?? []);
101
+ // Derives superseded_by from incoming supersedes edges instead of storing it.
102
+ const conceptRelated = computed(() => {
103
+ const direct = props.concept.relatedConcepts?.filter(rc => rc.type !== 'superseded_by') ?? [];
104
+ const derived = incomingEdges.value
105
+ .filter(e => e.type === 'supersedes')
106
+ .map(e => {
107
+ const parsed = factory.resolve(e.source, props.registerId);
108
+ const sourceUrn = parsed.type === 'internal'
109
+ ? store.manifests.get(parsed.registerId)?.datasetUri
110
+ : null;
111
+ const conceptId = e.source.match(/\/concept\/([^/]+)$/)?.[1];
112
+ return {
113
+ type: 'superseded_by' as const,
114
+ ref: sourceUrn && conceptId ? { source: sourceUrn, id: conceptId } : null,
115
+ content: '',
116
+ };
117
+ });
118
+ return [...direct, ...derived];
119
+ });
102
120
 
103
121
  function resolveRelatedRef(ref: { source: string | null; id: string | null } | null): { registerId: string; conceptId: string } | null {
104
122
  if (!ref?.source || !ref?.id) return null;