feat(editor): « Citer » button and family labels in references
This commit is contained in:
1 parent
240c2ba0e7
commit
8c3fcca0b9
16 files changed
+507
-53
No files matched your search
@@ -198,6 +198,16 @@ export function isCitable(key: ElementKey): boolean {
|
||||
return key.kind === 'finding' && key.path.length > 0
|
||||
}
|
||||
|
||||
/** A family: a finding key of one id (read from the key, so a vanished family is one too). */
|
||||
export function isFamilyKey(key: ElementKey): boolean {
|
||||
return key.kind === 'finding' && key.path.length === 1
|
||||
}
|
||||
|
||||
/** The label key that names `key`: its `_family` variant for a family (Rev 6). */
|
||||
export function elementLabel(label: string, key: ElementKey | null): string {
|
||||
return key && isFamilyKey(key) ? `${label}_family` : label
|
||||
}
|
||||
|
||||
/** Only a citable element has a citations dialog: any other key leaves the state as it is. */
|
||||
function openCitations(state: NavigationState, citedBy: ElementKey) {
|
||||
const finding = { key: citedBy, citations: true }
|
||||
|
||||
Reference in new issue
Block a user