@@ -74,17 +75,17 @@ const topLevelImages = computed(() => (entity.value as Figure | null)?.images ??
diff --git a/src/components/figure/FigureImages.vue b/src/components/figure/FigureImages.vue
index 1ddffcd..21a72ff 100644
--- a/src/components/figure/FigureImages.vue
+++ b/src/components/figure/FigureImages.vue
@@ -1,12 +1,15 @@
diff --git a/src/components/figure/figure-image-pick.ts b/src/components/figure/figure-image-pick.ts
index afe9f8d..ba2192a 100644
--- a/src/components/figure/figure-image-pick.ts
+++ b/src/components/figure/figure-image-pick.ts
@@ -11,7 +11,7 @@
* The `print` role is reserved for print stylesheets (selected via CSS
* @media print in FigureImages.vue), not picked here.
*/
-import type { FigureImage } from '../../adapters/non-verbal/types';
+import type { FigureImage } from 'glossarist';
export interface PickOptions {
prefersDark?: boolean;
diff --git a/src/components/figure/figure-layout.ts b/src/components/figure/figure-layout.ts
index d1836f7..34d7f58 100644
--- a/src/components/figure/figure-layout.ts
+++ b/src/components/figure/figure-layout.ts
@@ -12,7 +12,7 @@
* Authors who want different behavior can split a composite figure into
* multiple top-level figures. V1 does not expose a `layout` field.
*/
-import type { Figure } from '../../adapters/non-verbal/types';
+import type { Figure } from 'glossarist';
export type FigureLayout = 'single' | 'row' | 'column' | 'grid';
diff --git a/src/components/formula/FormulaDisplay.vue b/src/components/formula/FormulaDisplay.vue
index 139cbcd..27dd53c 100644
--- a/src/components/formula/FormulaDisplay.vue
+++ b/src/components/formula/FormulaDisplay.vue
@@ -7,7 +7,8 @@
* `
` receives the anchor ID for `{{formula:id}}` mentions.
*/
import { computed } from 'vue';
-import type { Formula } from '../../adapters/non-verbal/types';
+import type { Formula } from 'glossarist';
+import type { FormulaNotation } from '../../adapters/non-verbal/types';
import { useNonVerbalEntity } from '../../composables/use-non-verbal-entity';
import { resolveFallbackChain } from '../../utils/locale';
import { anchorId } from '../../utils/non-verbal-anchor';
@@ -27,37 +28,38 @@ const k = () => 'formula' as const;
const { entity, state, error } = useNonVerbalEntity(k, () => props.datasetId, () => props.entityId);
const fallbackChain = computed(() => resolveFallbackChain(props.datasetLocales));
+const form = computed(() => entity.value as Formula | null);
const anchor = computed(() => anchorId('formula', props.datasetId, props.entityId));
const descriptionId = computed(() => `${anchor.value}-desc`);
diff --git a/src/components/formula/FormulaExpression.vue b/src/components/formula/FormulaExpression.vue
index 3ecaf2c..3b7a46c 100644
--- a/src/components/formula/FormulaExpression.vue
+++ b/src/components/formula/FormulaExpression.vue
@@ -16,13 +16,13 @@ import { pickLocaleMap, localeToBcp47 } from '../../utils/locale';
import { loadPlurimath } from '../../utils/plurimath';
const props = defineProps<{
- expression: LocalizedString;
- notation: FormulaNotation;
+ expression: LocalizedString | null;
+ notation: FormulaNotation | null;
locale: string;
fallbackChain?: readonly string[];
}>();
-const resolved = computed(() => pickLocaleMap(props.expression, props.locale, props.fallbackChain));
+const resolved = computed(() => pickLocaleMap(props.expression ?? undefined, props.locale, props.fallbackChain));
const html = ref('');
const lang = computed(() => resolved.value ? localeToBcp47(resolved.value.locale) : undefined);
@@ -34,7 +34,7 @@ const PLURIMATH_FORMAT: Record = {
async function render() {
const r = resolved.value;
- if (!r) { html.value = ''; return; }
+ if (!r || !props.notation) { html.value = ''; return; }
try {
const Plurimath = await loadPlurimath();
const p = new Plurimath(r.text, PLURIMATH_FORMAT[props.notation]);
diff --git a/src/components/non-verbal/NonVerbalCaption.vue b/src/components/non-verbal/NonVerbalCaption.vue
index 3476ff4..1f57d39 100644
--- a/src/components/non-verbal/NonVerbalCaption.vue
+++ b/src/components/non-verbal/NonVerbalCaption.vue
@@ -22,20 +22,20 @@ import type { LocalizedString } from '../../adapters/non-verbal/types';
import { pickLocaleMap, localeToBcp47 } from '../../utils/locale';
const props = defineProps<{
- identifier?: string;
- caption?: LocalizedString;
- description?: LocalizedString;
+ identifier?: string | null;
+ caption?: LocalizedString | null;
+ description?: LocalizedString | null;
locale: string;
fallbackChain?: readonly string[];
descriptionId?: string;
}>();
const captionResolved = computed(() =>
- pickLocaleMap(props.caption, props.locale, props.fallbackChain),
+ pickLocaleMap(props.caption ?? undefined, props.locale, props.fallbackChain),
);
const descriptionResolved = computed(() =>
- pickLocaleMap(props.description, props.locale, props.fallbackChain),
+ pickLocaleMap(props.description ?? undefined, props.locale, props.fallbackChain),
);
const captionLang = computed(() =>
diff --git a/src/components/non-verbal/NonVerbalSources.vue b/src/components/non-verbal/NonVerbalSources.vue
index 0d5def2..b7fbd3b 100644
--- a/src/components/non-verbal/NonVerbalSources.vue
+++ b/src/components/non-verbal/NonVerbalSources.vue
@@ -6,20 +6,12 @@
* so the rendering matches the rest of the app. Each source may carry a
* modification note (e.g. "Adapted.") which is rendered alongside.
*/
-import type { Citation } from 'glossarist';
-import type { NonVerbalSource } from '../../adapters/non-verbal/types';
+import type { ConceptSource } from 'glossarist';
import CitationDisplay from '../CitationDisplay.vue';
defineProps<{
- sources: NonVerbalSource[];
+ sources: ConceptSource[];
}>();
-
-// CitationDisplay expects glossarist's Citation class. NonVerbalSource.origin
-// is wire-compatible at runtime but typed differently on the consumer side;
-// cast once at this boundary.
-function asCitation(origin: NonVerbalSource['origin']): Citation | null {
- return (origin as unknown as Citation) ?? null;
-}
@@ -27,7 +19,7 @@ function asCitation(origin: NonVerbalSource['origin']): Citation | null {
Sources
-
-
+
— {{ src.modification }}
diff --git a/src/components/table/TableDisplay.vue b/src/components/table/TableDisplay.vue
index b1ae790..86b6ff3 100644
--- a/src/components/table/TableDisplay.vue
+++ b/src/components/table/TableDisplay.vue
@@ -6,7 +6,8 @@
* TableMarkup (HTML / Markdown / AsciiDoc) based on `content.kind`.
*/
import { computed } from 'vue';
-import type { Table } from '../../adapters/non-verbal/types';
+import type { Table } from 'glossarist';
+import type { TableContent, TableFormat } from '../../adapters/non-verbal/types';
import { useNonVerbalEntity } from '../../composables/use-non-verbal-entity';
import { resolveFallbackChain } from '../../utils/locale';
import { anchorId } from '../../utils/non-verbal-anchor';
@@ -31,12 +32,13 @@ const anchor = computed(() => anchorId('table', props.datasetId, props.entityId)
const descriptionId = computed(() => `${anchor.value}-desc`);
const table = computed
(() => entity.value as Table | null);
+const content = computed(() => (table.value?.content ?? null) as TableContent | null);
const structuredContent = computed(() => {
- const c = table.value?.content;
+ const c = content.value;
return c && c.kind === 'structured' ? c : null;
});
const markup = computed(() => {
- const c = table.value?.content;
+ const c = content.value;
return c && c.kind === 'markup' ? c.markup : null;
});
@@ -56,7 +58,7 @@ const markup = computed(() => {
diff --git a/src/components/table/TableMarkup.vue b/src/components/table/TableMarkup.vue
index 61375cb..302b2f9 100644
--- a/src/components/table/TableMarkup.vue
+++ b/src/components/table/TableMarkup.vue
@@ -18,7 +18,7 @@ import { renderAsciiDocLite } from '../../utils/asciidoc-lite';
const props = defineProps<{
content: LocalizedString;
- format?: TableFormat;
+ format?: TableFormat | null;
locale: string;
fallbackChain?: readonly string[];
}>();
diff --git a/src/composables/use-non-verbal-entity.ts b/src/composables/use-non-verbal-entity.ts
index 26f92ef..6b6c71c 100644
--- a/src/composables/use-non-verbal-entity.ts
+++ b/src/composables/use-non-verbal-entity.ts
@@ -8,7 +8,8 @@
*/
import { ref, watch, shallowRef } from 'vue';
import { getFactory } from '../adapters/factory';
-import type { NonVerbalEntity, NonVerbalKind } from '../adapters/non-verbal/types';
+import type { NonVerbalKind } from '../adapters/non-verbal/types';
+import type { NonVerbalEntity } from 'glossarist';
export type LoadState = 'loading' | 'loaded' | 'not-found' | 'error';