@beinformed/ui 1.62.0 → 1.62.2
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/CHANGELOG.md +15 -0
- package/esm/constants/Settings.js +2 -1
- package/esm/constants/Settings.js.flow +2 -0
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.d.ts +4 -7
- package/esm/models/concepts/ConceptLinkModel.js +7 -1
- package/esm/models/concepts/ConceptLinkModel.js.flow +8 -8
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.d.ts +3 -0
- package/esm/models/concepts/SourceReferenceModel.js +8 -2
- package/esm/models/concepts/SourceReferenceModel.js.flow +13 -9
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/concepts/__tests__/RelatedConcepts.spec.js.flow +6 -8
- package/esm/models/concepts/__tests__/SourceReferenceModel.spec.js.flow +72 -31
- package/esm/models/content/ContentLinkModel.js +13 -1
- package/esm/models/content/ContentLinkModel.js.flow +13 -1
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/__tests__/Formalsource.spec.js.flow +30 -0
- package/esm/models/types.d.ts +0 -1
- package/esm/models/types.js.flow +0 -1
- package/esm/models/types.js.map +1 -1
- package/lib/constants/Settings.js +2 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.d.ts +4 -7
- package/lib/models/concepts/ConceptLinkModel.js +7 -1
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.d.ts +3 -0
- package/lib/models/concepts/SourceReferenceModel.js +8 -2
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +13 -1
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/types.d.ts +0 -1
- package/lib/models/types.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/Settings.js +2 -0
- package/src/models/concepts/ConceptLinkModel.js +8 -8
- package/src/models/concepts/SourceReferenceModel.js +13 -9
- package/src/models/concepts/__mock__/related_concepts_data.json +871 -755
- package/src/models/concepts/__tests__/RelatedConcepts.spec.js +6 -8
- package/src/models/concepts/__tests__/SourceReferenceModel.spec.js +72 -31
- package/src/models/content/ContentLinkModel.js +13 -1
- package/src/models/content/__tests__/Formalsource.spec.js +30 -0
- package/src/models/types.js +0 -1
|
@@ -9,16 +9,10 @@ import type {
|
|
|
9
9
|
IModelWithChildModels,
|
|
10
10
|
ModelOptions,
|
|
11
11
|
ModularUIModel,
|
|
12
|
+
SectionFragment,
|
|
12
13
|
} from "../types";
|
|
13
14
|
import type Href from "../href/Href";
|
|
14
15
|
|
|
15
|
-
type SectionFragment = {
|
|
16
|
-
sectionId: string,
|
|
17
|
-
text: string,
|
|
18
|
-
startOffset: number,
|
|
19
|
-
endOffset: number,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
16
|
/**
|
|
23
17
|
* Link to a concept
|
|
24
18
|
*/
|
|
@@ -199,10 +193,16 @@ export default class ConceptLinkModel
|
|
|
199
193
|
return this.getData("modelCategory");
|
|
200
194
|
}
|
|
201
195
|
|
|
196
|
+
/**
|
|
197
|
+
*/
|
|
198
|
+
get sectionId(): string {
|
|
199
|
+
return this.data.section?._id;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
202
|
/**
|
|
203
203
|
*
|
|
204
204
|
*/
|
|
205
205
|
get fragment(): SectionFragment {
|
|
206
|
-
return this.
|
|
206
|
+
return this.data.section?.fragment;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -31,10 +31,12 @@ class SourceReferenceModel {
|
|
|
31
31
|
/**
|
|
32
32
|
*/
|
|
33
33
|
get link(): ContentLinkModel {
|
|
34
|
-
const section =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const section =
|
|
35
|
+
this.sectionId ||
|
|
36
|
+
this._sourceReference._links.self.href.replace(
|
|
37
|
+
`${this._sourceReference._links.content.href}/`,
|
|
38
|
+
"",
|
|
39
|
+
);
|
|
38
40
|
|
|
39
41
|
return new ContentLinkModel(
|
|
40
42
|
{
|
|
@@ -49,11 +51,7 @@ class SourceReferenceModel {
|
|
|
49
51
|
/**
|
|
50
52
|
*/
|
|
51
53
|
get selfhref(): Href {
|
|
52
|
-
return
|
|
53
|
-
this._sourceReference._links.self.href,
|
|
54
|
-
"SourceReference",
|
|
55
|
-
this._modelOptions,
|
|
56
|
-
);
|
|
54
|
+
return this.link.selfhref;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
/**
|
|
@@ -87,6 +85,12 @@ class SourceReferenceModel {
|
|
|
87
85
|
return createHashFromHref(this.selfhref);
|
|
88
86
|
}
|
|
89
87
|
|
|
88
|
+
/**
|
|
89
|
+
*/
|
|
90
|
+
get sectionId(): string {
|
|
91
|
+
return this._sourceReference.sectionId;
|
|
92
|
+
}
|
|
93
|
+
|
|
90
94
|
/**
|
|
91
95
|
*
|
|
92
96
|
*/
|