@glossarist/concept-browser 0.7.27 → 0.7.28

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.
@@ -0,0 +1,78 @@
1
+ <script setup lang="ts">
2
+ import type { Designation, Expression, ConceptSource } from 'glossarist';
3
+ import { designationTypeInfo, normativeStatusInfo, abbreviationDetails, termTypeInfo, grammarBadges, pronunciationLabel, pronunciationTooltip, sourceTypeInfo } from '../utils/designation-registry';
4
+ import { relationshipLabel } from '../utils/relationship-categories';
5
+ import { langName } from '../utils/lang';
6
+ import { getDesignationTarget } from '../adapters/model-bridge';
7
+ import CitationDisplay from './CitationDisplay.vue';
8
+
9
+ const props = defineProps<{
10
+ designations: Designation[];
11
+ renderedDesignations: Map<string, string>;
12
+ lang: string;
13
+ registerId: string;
14
+ }>();
15
+
16
+ const emit = defineEmits<{
17
+ (e: 'navigate-related', ref: { source: string | null; id: string | null }): void;
18
+ }>();
19
+
20
+ function resolvedLabel(dr: { content: string | null; ref: { source: string | null; id: string | null } | null }): string {
21
+ if (dr.content) return dr.content;
22
+ if (dr.ref?.source && dr.ref?.id) return `${dr.ref.source}/${dr.ref.id}`;
23
+ return '(ref)';
24
+ }
25
+ </script>
26
+
27
+ <template>
28
+ <div v-if="designations.length > 0" class="space-y-1.5 pl-[22px]">
29
+ <div v-for="(d, i) in designations" :key="i">
30
+ <div class="flex items-center gap-1.5 text-sm flex-wrap">
31
+ <span :class="d.normativeStatus === 'preferred' ? 'font-bold text-ink-800' : 'font-normal text-ink-700'" v-html="renderedDesignations.get(d.designation) ?? d.designation"></span>
32
+ <span class="badge text-[10px] flex-shrink-0" :class="designationTypeInfo(d).color" :title="designationTypeInfo(d).definition ?? ''">{{ designationTypeInfo(d).label }}</span>
33
+ <span class="badge text-[10px] flex-shrink-0" :class="normativeStatusInfo(d.normativeStatus).color" :title="normativeStatusInfo(d.normativeStatus).definition ?? ''">{{ normativeStatusInfo(d.normativeStatus).label }}</span>
34
+ <template v-if="abbreviationDetails(d).length">
35
+ <span v-for="abbr in abbreviationDetails(d)" :key="abbr" class="badge text-[10px] bg-amber-50 text-amber-600">{{ abbr }}</span>
36
+ </template>
37
+ <span v-if="d.termType" class="badge text-[10px] bg-gray-50 text-gray-600" :title="termTypeInfo(d.termType).definition ?? ''">{{ termTypeInfo(d.termType).label }}</span>
38
+ <template v-if="d.type === 'expression' && (d as Expression).grammarInfo?.length">
39
+ <template v-for="(gi, giIdx) in (d as Expression).grammarInfo" :key="giIdx">
40
+ <span v-for="badge in grammarBadges(gi)" :key="giIdx + '-' + badge.label"
41
+ class="badge text-[10px] bg-gray-50 text-gray-600" :title="badge.definition ?? ''">{{ badge.label }}</span>
42
+ </template>
43
+ </template>
44
+ <template v-if="d.pronunciations?.length">
45
+ <span v-for="(p, pi) in d.pronunciations" :key="'p'+pi"
46
+ class="text-xs text-ink-400 font-mono" :title="pronunciationTooltip(p)">{{ pronunciationLabel(p) }}</span>
47
+ </template>
48
+ <span v-if="d.international" class="badge text-[10px] bg-sky-50 text-sky-600">international</span>
49
+ <span v-if="d.absent" class="badge text-[10px] bg-red-50 text-red-600">absent</span>
50
+ <span v-if="d.geographicalArea" class="badge text-[10px] bg-gray-50 text-gray-600">{{ d.geographicalArea }}</span>
51
+ <span v-if="d.usageInfo" class="text-xs text-ink-300">{{ d.usageInfo }}</span>
52
+ <span v-if="d.fieldOfApplication" class="text-xs text-ink-300">field: {{ d.fieldOfApplication }}</span>
53
+ <template v-if="d.language && d.language !== lang">
54
+ <span class="badge text-[10px] bg-teal-50 text-teal-600">lang: {{ langName(d.language) }}</span>
55
+ </template>
56
+ <span v-if="d.script" class="badge text-[10px] bg-gray-50 text-gray-600">script: {{ d.script }}</span>
57
+ <span v-if="d.system" class="badge text-[10px] bg-gray-50 text-gray-600">system: {{ d.system }}</span>
58
+ </div>
59
+ <div v-if="d.sources?.length" class="mt-1 space-y-0.5">
60
+ <div v-for="(ds, dsi) in d.sources" :key="'ds'+dsi" class="text-xs text-ink-400 flex items-center gap-1.5">
61
+ <span v-if="ds.type" class="badge text-[9px]" :class="sourceTypeInfo(ds.type).color">{{ sourceTypeInfo(ds.type).label }}</span>
62
+ <CitationDisplay v-if="ds.origin" :citation="ds.origin" :register-id="registerId" />
63
+ <span v-else-if="ds.modification" class="text-ink-300">{{ ds.modification }}</span>
64
+ </div>
65
+ </div>
66
+ <div v-if="d.related?.length" class="mt-0.5 space-y-0.5">
67
+ <div v-for="(dr, dri) in d.related" :key="'dr'+dri" class="text-xs text-ink-400 flex items-center gap-1.5">
68
+ <span class="badge text-[9px] bg-gray-50 text-gray-600">{{ relationshipLabel(dr.type) }}</span>
69
+ <template v-if="getDesignationTarget(dr)">
70
+ <span class="italic">{{ getDesignationTarget(dr) }}</span>
71
+ </template>
72
+ <button v-else-if="dr.ref" @click="emit('navigate-related', dr.ref)" class="concept-link">{{ resolvedLabel(dr) }}</button>
73
+ <span v-else>{{ resolvedLabel(dr) }}</span>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </template>
@@ -310,6 +310,18 @@
310
310
  "disjointWith": null,
311
311
  "children": [],
312
312
  "ancestors": []
313
+ },
314
+ "gloss:DesignationRelationship": {
315
+ "iri": "https://www.glossarist.org/ontologies/DesignationRelationship",
316
+ "compact": "gloss:DesignationRelationship",
317
+ "label": "Designation Relationship",
318
+ "comment": "A typed relationship between designations (e.g. abbreviated_form_for, short_form_for). The target is a designation string, not a concept reference.",
319
+ "subClassOf": "gloss:RelatedConcept",
320
+ "disjointWith": null,
321
+ "children": [],
322
+ "ancestors": [
323
+ "gloss:RelatedConcept"
324
+ ]
313
325
  }
314
326
  },
315
327
  "classHierarchyRoots": [
@@ -323,6 +335,7 @@
323
335
  "gloss:ConceptSource",
324
336
  "gloss:Reference",
325
337
  "gloss:RelatedConcept",
338
+ "gloss:DesignationRelationship",
326
339
  "gloss:ConceptDate",
327
340
  "gloss:NonVerbalRepresentation",
328
341
  "gloss:Citation",
@@ -1619,6 +1632,42 @@
1619
1632
  "range": "gloss:Designation",
1620
1633
  "rangeUnion": null,
1621
1634
  "inverseOf": "gloss:abbreviatedFormFor"
1635
+ },
1636
+ "gloss:relationshipTarget": {
1637
+ "iri": "https://www.glossarist.org/ontologies/relationshipTarget",
1638
+ "compact": "gloss:relationshipTarget",
1639
+ "label": "relationship target",
1640
+ "comment": "The target designation text for a designation-level relationship (string, not a concept ref).",
1641
+ "type": "datatype",
1642
+ "domain": "gloss:DesignationRelationship",
1643
+ "domainUnion": null,
1644
+ "range": "xsd:string",
1645
+ "rangeUnion": null,
1646
+ "inverseOf": null
1647
+ },
1648
+ "gloss:conceptRefText": {
1649
+ "iri": "https://www.glossarist.org/ontologies/conceptRefText",
1650
+ "compact": "gloss:conceptRefText",
1651
+ "label": "concept ref text",
1652
+ "comment": "Human-readable text label for the referenced concept (e.g. the term or designation).",
1653
+ "type": "datatype",
1654
+ "domain": "gloss:ConceptRef",
1655
+ "domainUnion": null,
1656
+ "range": "xsd:string",
1657
+ "rangeUnion": null,
1658
+ "inverseOf": null
1659
+ },
1660
+ "gloss:hasAnnotation": {
1661
+ "iri": "https://www.glossarist.org/ontologies/hasAnnotation",
1662
+ "compact": "gloss:hasAnnotation",
1663
+ "label": "has annotation",
1664
+ "comment": "Links a localized concept to an annotation (editorial or explanatory note).",
1665
+ "type": "object",
1666
+ "domain": "gloss:LocalizedConcept",
1667
+ "domainUnion": null,
1668
+ "range": "gloss:DetailedDefinition",
1669
+ "rangeUnion": null,
1670
+ "inverseOf": null
1622
1671
  }
1623
1672
  },
1624
1673
  "propertiesByDomain": {
@@ -1648,7 +1697,8 @@
1648
1697
  "gloss:hasNote",
1649
1698
  "gloss:hasExample",
1650
1699
  "gloss:hasNonVerbalRep",
1651
- "gloss:hasReference"
1700
+ "gloss:hasReference",
1701
+ "gloss:hasAnnotation"
1652
1702
  ],
1653
1703
  "datatype": [
1654
1704
  "gloss:domain",
@@ -1667,9 +1717,7 @@
1667
1717
  "gloss:hasSource",
1668
1718
  "gloss:normativeStatus",
1669
1719
  "gloss:hasPronunciation",
1670
- "gloss:hasTermType",
1671
- "gloss:abbreviatedFormFor",
1672
- "gloss:shortFormFor"
1720
+ "gloss:hasTermType"
1673
1721
  ],
1674
1722
  "datatype": [
1675
1723
  "gloss:language",
@@ -1797,7 +1845,8 @@
1797
1845
  "object": [],
1798
1846
  "datatype": [
1799
1847
  "gloss:conceptRefSource",
1800
- "gloss:conceptRefId"
1848
+ "gloss:conceptRefId",
1849
+ "gloss:conceptRefText"
1801
1850
  ]
1802
1851
  },
1803
1852
  "gloss:CustomLocality": {
@@ -1856,6 +1905,15 @@
1856
1905
  "gloss:relatedConceptNarrower"
1857
1906
  ],
1858
1907
  "datatype": []
1908
+ },
1909
+ "gloss:DesignationRelationship": {
1910
+ "object": [
1911
+ "gloss:relationshipType"
1912
+ ],
1913
+ "datatype": [
1914
+ "gloss:relationshipTarget",
1915
+ "gloss:relationshipContent"
1916
+ ]
1859
1917
  }
1860
1918
  },
1861
1919
  "shapes": {
@@ -3110,9 +3168,9 @@
3110
3168
  }
3111
3169
  ],
3112
3170
  "stats": {
3113
- "classCount": 24,
3114
- "objectPropertyCount": 45,
3115
- "datatypePropertyCount": 60,
3171
+ "classCount": 25,
3172
+ "objectPropertyCount": 46,
3173
+ "datatypePropertyCount": 62,
3116
3174
  "shapeCount": 22,
3117
3175
  "annotationPropertyCount": 11
3118
3176
  }