Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into colophons
Browse files Browse the repository at this point in the history
  • Loading branch information
khoidt committed Apr 12, 2024
2 parents 0e1aba7 + 0da6560 commit 2863ff8
Show file tree
Hide file tree
Showing 23 changed files with 424 additions and 94 deletions.
Binary file modified src/Assurbanipal.ttf
Binary file not shown.
Binary file modified src/Assurbanipal.woff
Binary file not shown.
Binary file modified src/Assurbanipal.woff2
Binary file not shown.
Binary file modified src/JunicodeVF-Bold.woff2
Binary file not shown.
Binary file modified src/JunicodeVF-BoldItalic.woff2
Binary file not shown.
Binary file modified src/JunicodeVF-Italic.woff2
Binary file not shown.
Binary file modified src/JunicodeVF-Roman.woff2
Binary file not shown.
13 changes: 13 additions & 0 deletions src/common/BlobImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ export default function BlobImage({
image
)
}

export function ThumbnailImage({
photo,
url,
alt,
}: {
photo: Blob
url?: string
alt?: string
}): JSX.Element {
const image = <Image src={useObjectUrl(photo)} alt={alt} fluid />
return url ? <ExternalLink href={url}>{image}</ExternalLink> : image
}
141 changes: 138 additions & 3 deletions src/corpus/domain/provenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const Provenances = {
Borsippa: { name: 'Borsippa', abbreviation: 'Bor', parent: 'Babylonia' },
Cutha: { name: 'Cutha', abbreviation: 'Cut', parent: 'Babylonia' },
Dilbat: { name: 'Dilbat', abbreviation: 'Dil', parent: 'Babylonia' },
Diqdiqqah: { name: 'Diqdiqqah', abbreviation: 'Diqd', parent: 'Babylonia' },
'Dūr-Kurigalzu': {
name: 'Dūr-Kurigalzu',
abbreviation: 'Dku',
Expand All @@ -55,7 +56,22 @@ export const Provenances = {
parent: 'Babylonia',
},
Irisagrig: { name: 'Irisagrig', abbreviation: 'Irs', parent: 'Babylonia' },
'Ishān Miziyad': {
name: 'Ishān Miziyad',
abbreviation: 'Miz',
parent: 'Babylonia',
},
Isin: { name: 'Isin', abbreviation: 'Isn', parent: 'Babylonia' },
'Ishān Hāfudh': {
name: 'Ishān Hāfudh',
abbreviation: 'Haf',
parent: 'Babylonia',
},
'Jamdat Naṣr': {
name: 'Jamdat Naṣr',
abbreviation: 'Nasr',
parent: 'Babylonia',
},
Kisurra: { name: 'Kisurra', abbreviation: 'Ksr', parent: 'Babylonia' },
Kiš: { name: 'Kiš', abbreviation: 'Kiš', parent: 'Babylonia' },
Kutalla: { name: 'Kutalla', abbreviation: 'Kut', parent: 'Babylonia' },
Expand All @@ -70,6 +86,11 @@ export const Provenances = {
parent: 'Babylonia',
},
Meturan: { name: 'Meturan', abbreviation: 'Met', parent: 'Babylonia' },
'Meturan (Tell al-Sib)': {
name: 'Meturan (Tell al-Sib)',
abbreviation: 'MetS',
parent: 'Babylonia',
},
Nērebtum: { name: 'Nērebtum', abbreviation: 'Nēr', parent: 'Babylonia' },
Nigin: { name: 'Nigin', abbreviation: 'Nig', parent: 'Babylonia' },
Nippur: { name: 'Nippur', abbreviation: 'Nip', parent: 'Babylonia' },
Expand All @@ -85,50 +106,164 @@ export const Provenances = {
abbreviation: 'Sipam',
parent: 'Babylonia',
},
Sulaiymah: { name: 'Sulaiymah', abbreviation: 'Sul', parent: 'Babylonia' },
Šaduppûm: { name: 'Šaduppûm', abbreviation: 'Šad', parent: 'Babylonia' },
Šaḫrīnu: { name: 'Šaḫrīnu', abbreviation: 'Šah', parent: 'Babylonia' },
Šuruppak: { name: 'Šuruppak', abbreviation: 'Šur', parent: 'Babylonia' },
'Meturan (Tell al-Sib)': {
name: 'Meturan (Tell al-Sib)',
abbreviation: 'MetS',
'Tall Abū Ṣālabīkh': {
name: 'Tall Abū Ṣālabīkh',
abbreviation: 'Abs',
parent: 'Babylonia',
},
'Tall Ajrab': {
name: 'Tall Ajrab',
abbreviation: 'Ajr',
parent: 'Babylonia',
},
'Tall Imlīḥiyah': {
name: 'Tall Imlīḥiyah',
abbreviation: 'Iml',
parent: 'Babylonia',
},
'Tall Jidar': {
name: 'Tall Jidar',
abbreviation: 'Jid',
parent: 'Babylonia',
},
'Tall Khaibar': {
name: 'Tall Khaibar',
abbreviation: 'Kha',
parent: 'Babylonia',
},
'Tall al-Laḥam': {
name: 'Tall al-Laḥam',
abbreviation: 'Lah',
parent: 'Babylonia',
},
'Tall Muḥamad': {
name: 'Tall Muḥamad',
abbreviation: 'Muh',
parent: 'Babylonia',
},
'Tall al-ʻUbaīd': {
name: 'Tall al-ʻUbaīd',
abbreviation: 'Ubd',
parent: 'Babylonia',
},
'Tall Umm al-ʻAjarib': {
name: 'Tall Umm al-ʻAjarib',
abbreviation: 'Uaaj',
parent: 'Babylonia',
},
'Tall ʻUqair': {
name: 'Tall ʻUqair',
abbreviation: 'Uqa',
parent: 'Babylonia',
},
'Tulūl al-Baqarāt': {
name: 'Tulūl al-Baqarāt',
abbreviation: 'Baq',
parent: 'Babylonia',
},
'Tulūl Khaṭāb': {
name: 'Tulūl Khaṭāb',
abbreviation: 'Khat',
parent: 'Babylonia',
},
Tummal: { name: 'Tummal', abbreviation: 'Tum', parent: 'Babylonia' },
Tutub: { name: 'Tutub', abbreviation: 'Ttb', parent: 'Babylonia' },
Umma: { name: 'Umma', abbreviation: 'Umm', parent: 'Babylonia' },
'Umm al-Ḥafriyāt': {
name: 'Umm al-Ḥafriyāt',
abbreviation: 'Hafr',
parent: 'Babylonia',
},
'Umm al-Wawiya': {
name: 'Umm al-Wawiya',
abbreviation: 'Waw',
parent: 'Babylonia',
},
Ur: { name: 'Ur', abbreviation: 'Ur', parent: 'Babylonia' },
Uruk: { name: 'Uruk', abbreviation: 'Urk', parent: 'Babylonia' },
Yelkhi: { name: 'Yelkhi', abbreviation: 'Ylk', parent: 'Babylonia' },
Zabalam: { name: 'Zabalam', abbreviation: 'Zab', parent: 'Babylonia' },
Zaralulu: { name: 'Zaralulu', abbreviation: 'Zar', parent: 'Babylonia' },
Periphery: { name: 'Periphery', abbreviation: '', parent: null },
Alalakh: { name: 'Alalakh', abbreviation: 'Ala', parent: 'Periphery' },
'Tell el-Amarna': {
name: 'Tell el-Amarna',
abbreviation: 'Ama',
parent: 'Periphery',
},
'‘Anah': { name: '‘Anah', abbreviation: 'Anh', parent: 'Periphery' },
Anšan: { name: 'Anšan', abbreviation: 'Anš', parent: 'Periphery' },
'Bakr Āwā': { name: 'Bakr Āwā', abbreviation: 'Bakr', parent: 'Periphery' },
Bārah: { name: 'Bārah', abbreviation: 'Bar', parent: 'Periphery' },
Bitwātā: { name: 'Bitwātā', abbreviation: 'Bitw', parent: 'Periphery' },
Dēr: { name: 'Dēr', abbreviation: 'Der', parent: 'Periphery' },
Dugirdkhan: { name: 'Dugirdkhan', abbreviation: 'Dgr', parent: 'Periphery' },
'Dūr-Untaš': { name: 'Dūr-Untaš', abbreviation: 'Dun', parent: 'Periphery' },
Ebla: { name: 'Ebla', abbreviation: 'Ebl', parent: 'Periphery' },
Elam: { name: 'Elam', abbreviation: 'Elam', parent: 'Periphery' },
Emar: { name: 'Emar', abbreviation: 'Emr', parent: 'Periphery' },
'Glay‘a': { name: 'Glay‘a', abbreviation: 'Gla', parent: 'Periphery' },
Hamath: { name: 'Hamath', abbreviation: 'Ham', parent: 'Periphery' },
Ḫattuša: { name: 'Ḫattuša', abbreviation: 'Hat', parent: 'Periphery' },
Kaneš: { name: 'Kaneš', abbreviation: 'Kan', parent: 'Periphery' },
Karkemiš: { name: 'Karkemiš', abbreviation: 'Kar', parent: 'Periphery' },
Kimūnah: { name: 'Kimūnah', abbreviation: 'Kmn', parent: 'Periphery' },
Mardaman: { name: 'Mardaman', abbreviation: 'Mard', parent: 'Periphery' },
Mari: { name: 'Mari', abbreviation: 'Mar', parent: 'Periphery' },
Megiddo: { name: 'Megiddo', abbreviation: 'Meg', parent: 'Periphery' },
'Mila Mergi': {
name: 'Mila Mergi',
abbreviation: 'Milm',
parent: 'Periphery',
},
Nuzi: { name: 'Nuzi', abbreviation: 'Nuzi', parent: 'Periphery' },
Pašime: { name: 'Pašime', abbreviation: 'Paš', parent: 'Periphery' },
Persepolis: { name: 'Persepolis', abbreviation: 'Per', parent: 'Periphery' },
Qatara: { name: 'Qatara', abbreviation: 'Qat', parent: 'Periphery' },
Qaṭnā: { name: 'Qaṭnā', abbreviation: 'Qaṭ', parent: 'Periphery' },
'Sur Jar‘a': { name: 'Sur Jar‘a', abbreviation: 'Surj', parent: 'Periphery' },
Susa: { name: 'Susa', abbreviation: 'Sus', parent: 'Periphery' },
Shīshīn: { name: 'Shīshīn', abbreviation: 'Shn', parent: 'Periphery' },
Šušarra: { name: 'Šušarra', abbreviation: 'Šuš', parent: 'Periphery' },
'Tall Bāz Musiyān': {
name: 'Tall Bāz Musiyān',
abbreviation: 'Bazm',
parent: 'Periphery',
},
'Tall al-Fakhar': {
name: 'Tall al-Fakhar',
abbreviation: 'Fakh',
parent: 'Periphery',
},
'Tall Ghaḍaiyrīfah': {
name: 'Tall Ghaḍaiyrīfah',
abbreviation: 'Ghad',
parent: 'Periphery',
},
'Tall al-Hawa': {
name: 'Tall al-Hawa',
abbreviation: 'Haw',
parent: 'Periphery',
},
'Tall Ibrāhīm Bayis': {
name: 'Tall Ibrāhīm Bayis',
abbreviation: 'Iba',
parent: 'Periphery',
},
'Tepe Gotvand': {
name: 'Tepe Gotvand',
abbreviation: 'Tgo',
parent: 'Periphery',
},
Terqa: { name: 'Terqa', abbreviation: 'Ter', parent: 'Periphery' },
Tikrīt: { name: 'Tikrīt', abbreviation: 'Tikr', parent: 'Periphery' },
Tuttul: { name: 'Tuttul', abbreviation: 'Ttl', parent: 'Periphery' },
Ugarit: { name: 'Ugarit', abbreviation: 'Uga', parent: 'Periphery' },
Zawiyah: { name: 'Zawiyah', abbreviation: 'Zaw', parent: 'Periphery' },
Uncertain: { name: 'Uncertain', abbreviation: 'Unc', parent: null },
} as const
export type Provenance = typeof Provenances[keyof typeof Provenances]
Expand Down
112 changes: 73 additions & 39 deletions src/corpus/ui/Chapters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { ChapterId } from 'transliteration/domain/chapter-id'
import './Chapters.sass'
import ManuscriptJoins from './ManuscriptJoins'
import ManuscriptReferences from './ManuscriptReferences'
import produce, { castDraft } from 'immer'
import { Join } from 'fragmentarium/domain/join'

function ProvenanceHeading({
id,
Expand All @@ -40,6 +42,34 @@ function ProvenanceHeading({
)
}

function excludeIndirectJoins(manuscripts: Manuscript[]): Manuscript[] {
type JoinGroup = readonly Join[]
const uniqueJoinGroups: JoinGroup[] = _(manuscripts)
.flatMap('joins')
.map((join) => [join])
.thru((values) => _.xorWith(...(values as [JoinGroup[]]), _.isEqual))
.value()

function isUniqueJoin(other: JoinGroup): boolean {
return _.some(uniqueJoinGroups, (group) => _.isEqual(group, other))
}

return manuscripts.map((manuscript) =>
produce(manuscript, (draft) => {
function isPrimaryJoin(joins: JoinGroup): boolean {
return _.some(
joins.map((join) => join.museumNumber === manuscript.museumNumber)
)
}
draft.joins = castDraft(
manuscript.joins.filter(
(joinGroup) => isPrimaryJoin(joinGroup) || isUniqueJoin(joinGroup)
)
)
})
)
}

const Manuscripts = withData<
{
uncertainFragments: readonly UncertainFragment[]
Expand Down Expand Up @@ -121,46 +151,50 @@ const Manuscripts = withData<
<ProvenanceHeading id={provenanceId}>
{provenance}
</ProvenanceHeading>
{manuscripts.map((manuscript, index) => {
const rowId = _.uniqueId('row-')
return (
<tr key={`${provenance} ${index}`}>
<th
id={rowId}
headers={[provenanceId, siglumId].join(' ')}
scope="row"
className="list-of-manuscripts__siglum-heading"
>
{manuscript.siglum}
</th>
<td
headers={[provenanceId, rowId, museumNumberId].join(
' '
)}
className="list-of-manuscripts__museum-numbers"
>
<ManuscriptJoins manuscript={manuscript} />
<ManuscriptReferences
references={manuscript.references}
/>
</td>
<td
headers={[extantLinesId, rowId, museumNumberId].join(
' '
)}
className="list-of-manuscripts__extant-lines"
>
{extantLines ? (
<ExtantLinesList
extantLines={extantLines[manuscript.siglum]}
{excludeIndirectJoins(manuscripts).map(
(manuscript, index) => {
const rowId = _.uniqueId('row-')
return (
<tr key={`${provenance} ${index}`}>
<th
id={rowId}
headers={[provenanceId, siglumId].join(' ')}
scope="row"
className="list-of-manuscripts__siglum-heading"
>
{manuscript.siglum}
</th>
<td
headers={[provenanceId, rowId, museumNumberId].join(
' '
)}
className="list-of-manuscripts__museum-numbers"
>
<ManuscriptJoins manuscript={manuscript} />
<ManuscriptReferences
references={manuscript.references}
/>
) : (
<Spinner />
)}
</td>
</tr>
)
})}
</td>
<td
headers={[
extantLinesId,
rowId,
museumNumberId,
].join(' ')}
className="list-of-manuscripts__extant-lines"
>
{extantLines ? (
<ExtantLinesList
extantLines={extantLines[manuscript.siglum]}
/>
) : (
<Spinner />
)}
</td>
</tr>
)
}
)}
</React.Fragment>
)
})
Expand Down
8 changes: 8 additions & 0 deletions src/fragmentarium/application/FragmentService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const imageRepository = {
find: jest.fn(),
findFolio: jest.fn(),
findPhoto: jest.fn(),
findThumbnail: jest.fn(),
}
const bibliographyService = new (BibliographyService as jest.Mock)()
const wordRepository = new (WordRepository as jest.Mock)()
Expand Down Expand Up @@ -115,6 +116,13 @@ const testData: TestData<FragmentService>[] = [
new TestData('findPhoto', [fragment], imageRepository.findPhoto, resultStub, [
fragment.number,
]),
new TestData(
'findThumbnail',
[fragment, 'small'],
imageRepository.findThumbnail,
resultStub,
[fragment.number, 'small']
),
new TestData(
'folioPager',
[folio, 'K.1'],
Expand Down
Loading

0 comments on commit 2863ff8

Please sign in to comment.