@rr0/cms 0.1.13 → 0.1.15

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.
Files changed (244) hide show
  1. package/README.md +2 -0
  2. package/dist/BaseReplaceCommand.d.ts +2 -2
  3. package/dist/DefaultContentVisitor.d.ts +11 -11
  4. package/dist/DescriptionReplaceCommand.d.ts +3 -3
  5. package/dist/ImageCommand.d.ts +3 -3
  6. package/dist/MetaLinkReplaceCommand.d.ts +3 -3
  7. package/dist/OpenGraphCommand.d.ts +6 -6
  8. package/dist/OpenGraphCommand.js +1 -1
  9. package/dist/RR0ContentStep.d.ts +11 -11
  10. package/dist/RR0ContentStep.js +2 -2
  11. package/dist/{RR0SsgContext.d.ts → RR0Context.d.ts} +8 -8
  12. package/dist/{RR0SsgContext.js → RR0Context.js} +4 -4
  13. package/dist/anchor/AnchorHandler.d.ts +2 -2
  14. package/dist/anchor/AnchorReplaceCommand.d.ts +2 -2
  15. package/dist/anchor/AnchorReplacer.d.ts +3 -3
  16. package/dist/anchor/CaseAnchorHandler.d.ts +2 -2
  17. package/dist/anchor/CaseAnchorHandler.js +2 -2
  18. package/dist/anchor/DataAnchorHandler.d.ts +6 -6
  19. package/dist/book/BookContentVisitor.d.ts +2 -2
  20. package/dist/book/BookDirectoryStep.d.ts +5 -5
  21. package/dist/book/BookService.d.ts +3 -1
  22. package/dist/book/BookService.js +4 -4
  23. package/dist/book/Chapters.d.ts +3 -3
  24. package/dist/book/Chapters.js +2 -2
  25. package/dist/build.js +27 -8
  26. package/dist/data/AbstractDataFactory.d.ts +3 -2
  27. package/dist/data/AbstractDataFactory.js +1 -1
  28. package/dist/data/AbstractDataService.d.ts +2 -3
  29. package/dist/data/AbstractDataService.js +2 -8
  30. package/dist/data/RR0Data.d.ts +4 -3
  31. package/dist/data/TypedDataFactory.d.ts +3 -2
  32. package/dist/data/TypedDataFactory.js +4 -0
  33. package/dist/data/index.d.ts +1 -1
  34. package/dist/data/index.js +1 -1
  35. package/dist/index/IndexedReplacer.d.ts +4 -4
  36. package/dist/index/IndexedReplacerFactory.d.ts +2 -2
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/lang/LanguageReplaceCommand.d.ts +3 -3
  40. package/dist/lang/RR0Messages.d.ts +1 -1
  41. package/dist/lang/RR0Messages_en.d.ts +1 -1
  42. package/dist/lang/RR0Messages_en.js +1 -1
  43. package/dist/lang/RR0Messages_fr.d.ts +1 -1
  44. package/dist/lang/RR0Messages_fr.js +1 -1
  45. package/dist/lang/form.js +1 -1
  46. package/dist/note/NoteFileCounter.d.ts +2 -2
  47. package/dist/note/NoteRenderer.d.ts +2 -2
  48. package/dist/note/NoteReplacer.d.ts +2 -2
  49. package/dist/note/NoteReplacerFactory.d.ts +2 -2
  50. package/dist/org/OrgMessages.d.ts +2 -2
  51. package/dist/org/Organization.d.ts +3 -3
  52. package/dist/org/Organization.js +3 -3
  53. package/dist/org/OrganizationMessages.d.ts +3 -3
  54. package/dist/org/OrganizationService.d.ts +4 -3
  55. package/dist/org/OrganizationService.js +10 -9
  56. package/dist/org/au/Australia_en.d.ts +1 -1
  57. package/dist/org/au/Australia_fr.d.ts +1 -1
  58. package/dist/org/au/region/index.d.ts +4 -4
  59. package/dist/org/au/region/index.js +4 -4
  60. package/dist/org/au/region/nsw/NewSouthWalesMessages_en.d.ts +2 -2
  61. package/dist/org/au/region/nsw/NewSouthWalesMessages_en.js +2 -2
  62. package/dist/org/au/region/nsw/NewSouthWalesMessages_fr.d.ts +2 -2
  63. package/dist/org/au/region/nsw/NewSouthWalesMessages_fr.js +2 -2
  64. package/dist/org/au/region/nsw/index.d.ts +1 -1
  65. package/dist/org/au/region/nsw/index.js +1 -1
  66. package/dist/org/au/region/vic/index.d.ts +1 -1
  67. package/dist/org/au/region/vic/index.js +1 -1
  68. package/dist/org/br/region/cw/CentralWest.js +1 -1
  69. package/dist/org/br/region/se/SouthEast.js +1 -1
  70. package/dist/org/country/region/department/city/CityService.d.ts +2 -2
  71. package/dist/org/country/region/department/city/CityService.js +2 -1
  72. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummary.d.ts +1 -1
  73. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummaryRR0Mapper.d.ts +4 -4
  74. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummaryRR0Mapper.js +1 -1
  75. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseToSummaryMapper.d.ts +3 -3
  76. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseToSummaryMapper.js +1 -1
  77. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.d.ts +3 -3
  78. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanFileDatasource.d.ts +3 -3
  79. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanHttpDatasource.d.ts +6 -5
  80. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanSummaryToCaseMapper.d.ts +3 -3
  81. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanTestCases.js +1 -1
  82. package/dist/org/eu/fr/cnes/geipan/geipan/GeipanTestimonial.d.ts +1 -1
  83. package/dist/org/eu/fr/region/idf/77/SeineEtMarneCities.js +1 -1
  84. package/dist/org/eu/fr/region/idf/77/SeineEtMarneMessages.js +1 -1
  85. package/dist/org/eu/fr/region/idf/77/SivryCourtry/index.d.ts +2 -0
  86. package/dist/org/eu/fr/region/idf/77/SivryCourtry/index.js +2 -0
  87. package/dist/org/eu/fr/region/idf/77/index.d.ts +5 -0
  88. package/dist/org/eu/fr/region/idf/77/index.js +5 -0
  89. package/dist/org/us/region/fl/Florida.js +1 -1
  90. package/dist/org/us/region/hi/Hawaii.js +1 -1
  91. package/dist/org/us/region/in/Indiana.js +1 -1
  92. package/dist/org/us/region/va/Virginia.js +1 -1
  93. package/dist/org/us/region/wa/Washington.js +1 -1
  94. package/dist/org/us/region/wv/WestVirginia.js +1 -1
  95. package/dist/people/PeopleDirectoryStep.d.ts +4 -4
  96. package/dist/people/PeopleReplacer.d.ts +3 -3
  97. package/dist/people/PeopleReplacerFactory.d.ts +2 -2
  98. package/dist/people/PeopleService.d.ts +3 -4
  99. package/dist/people/PeopleService.js +3 -14
  100. package/dist/people/author/AuthorReplaceCommand.d.ts +2 -2
  101. package/dist/people/witness/WitnessReplacer.d.ts +2 -2
  102. package/dist/people/witness/WitnessReplacerFactory.d.ts +2 -2
  103. package/dist/place/GooglePlaceService.d.ts +1 -1
  104. package/dist/place/GooglePlaceService.js +1 -1
  105. package/dist/place/Place.d.ts +1 -1
  106. package/dist/place/Place.js +1 -1
  107. package/dist/place/PlaceService.d.ts +1 -1
  108. package/dist/place/PlaceService.js +1 -1
  109. package/dist/place/index.d.ts +0 -4
  110. package/dist/place/index.js +0 -4
  111. package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.d.ts +5 -5
  112. package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.js +1 -1
  113. package/dist/science/crypto/ufo/enquete/dossier/CaseService.d.ts +3 -3
  114. package/dist/science/crypto/ufo/enquete/dossier/CaseService.js +2 -2
  115. package/dist/search/SearchVisitor.d.ts +5 -5
  116. package/dist/source/Source.d.ts +1 -1
  117. package/dist/source/SourceFactory.d.ts +4 -4
  118. package/dist/source/SourceFactory.js +3 -2
  119. package/dist/source/SourceFileCounter.d.ts +2 -2
  120. package/dist/source/SourceRegistry.d.ts +2 -2
  121. package/dist/source/SourceRenderer.d.ts +3 -3
  122. package/dist/source/SourceRenderer.js +2 -2
  123. package/dist/source/SourceReplacer.d.ts +3 -3
  124. package/dist/source/SourceReplacerFactory.d.ts +2 -2
  125. package/dist/tech/info/soft/proj/impl/lang/CodeReplacer.d.ts +3 -3
  126. package/dist/tech/info/soft/proj/impl/lang/CodeReplacerFactory.d.ts +2 -2
  127. package/dist/time/CaseSummaryRenderer.d.ts +1 -1
  128. package/dist/time/EventRenderer.d.ts +7 -7
  129. package/dist/time/EventReplacerFactory.d.ts +4 -4
  130. package/dist/time/SsiTitleReplaceCommand.d.ts +2 -2
  131. package/dist/time/Time.d.ts +5 -3
  132. package/dist/time/Time.js +31 -5
  133. package/dist/time/TimeLinkDefaultHandler.d.ts +10 -9
  134. package/dist/time/TimeLinkDefaultHandler.js +8 -12
  135. package/dist/time/TimeService.d.ts +16 -7
  136. package/dist/time/TimeService.js +16 -22
  137. package/dist/time/TimeTestUtil.d.ts +16 -0
  138. package/dist/time/TimeTestUtil.js +29 -0
  139. package/dist/time/TimeUrlBuilder.d.ts +7 -3
  140. package/dist/time/TimeUrlBuilder.js +7 -4
  141. package/dist/time/datasource/AbstractDatasource.d.ts +6 -6
  142. package/dist/time/datasource/ChronologyReplacer.d.ts +6 -6
  143. package/dist/time/datasource/ChronologyReplacerFactory.d.ts +2 -2
  144. package/dist/time/datasource/ChronologyReplacerFactory.js +1 -1
  145. package/dist/time/datasource/ContextFilter.d.ts +3 -3
  146. package/dist/time/datasource/CsvFileSource.d.ts +2 -2
  147. package/dist/time/datasource/CsvMapper.d.ts +5 -5
  148. package/dist/time/datasource/CsvMapper.js +1 -1
  149. package/dist/time/datasource/Datasource.d.ts +2 -2
  150. package/dist/time/datasource/DatasourceTestCase.d.ts +8 -8
  151. package/dist/time/datasource/DatasourceTestCase.js +18 -16
  152. package/dist/time/datasource/FileDatasource.d.ts +2 -2
  153. package/dist/time/datasource/JsonMapper.d.ts +4 -4
  154. package/dist/time/datasource/TimeContextFilter.d.ts +3 -3
  155. package/dist/time/datasource/acufo/AcufoCase.d.ts +1 -1
  156. package/dist/time/datasource/acufo/AcufoDatasource.d.ts +3 -3
  157. package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummary.d.ts +1 -1
  158. package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryMapper.d.ts +3 -3
  159. package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryMapper.js +1 -1
  160. package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.d.ts +3 -3
  161. package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.js +1 -1
  162. package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.d.ts +2 -2
  163. package/dist/time/datasource/baseovnifrance/BaseOvniFranceHttpDatasource.d.ts +6 -6
  164. package/dist/time/datasource/baseovnifrance/BaseOvniFranceTestCases.js +1 -1
  165. package/dist/time/datasource/fufora/FuforaCaseSummary.d.ts +1 -1
  166. package/dist/time/datasource/fufora/FuforaCaseSummaryRR0Mapper.d.ts +3 -3
  167. package/dist/time/datasource/fufora/FuforaCaseSummaryRR0Mapper.js +1 -1
  168. package/dist/time/datasource/fufora/FuforaDatasource.d.ts +2 -2
  169. package/dist/time/datasource/fufora/FuforaHttpDatasource.d.ts +5 -5
  170. package/dist/time/datasource/fufora/FuforaTestCases.js +1 -1
  171. package/dist/time/datasource/nuforc/NuforcCaseSummary.d.ts +1 -1
  172. package/dist/time/datasource/nuforc/NuforcDatasource.d.ts +2 -2
  173. package/dist/time/datasource/nuforc/NuforcHttpDatasource.d.ts +6 -6
  174. package/dist/time/datasource/nuforc/NuforcRR0Mapper.d.ts +3 -3
  175. package/dist/time/datasource/nuforc/NuforcRR0Mapper.js +1 -1
  176. package/dist/time/datasource/nuforc/NuforcTestCases.js +1 -1
  177. package/dist/time/datasource/rr0/NamedPlace.d.ts +7 -0
  178. package/dist/time/datasource/rr0/RR0CaseMapping.d.ts +2 -2
  179. package/dist/time/datasource/rr0/RR0CaseSummary.d.ts +0 -7
  180. package/dist/time/datasource/rr0/RR0CaseSummaryMapper.d.ts +3 -3
  181. package/dist/time/datasource/rr0/RR0FileDatasource.d.ts +5 -5
  182. package/dist/time/datasource/rr0/RR0HttpDatasource.d.ts +10 -9
  183. package/dist/time/datasource/rr0/RR0HttpDatasource.js +3 -32
  184. package/dist/time/datasource/rr0/RR0TestCases.js +1 -1
  185. package/dist/time/datasource/rr0/index.d.ts +1 -0
  186. package/dist/time/datasource/sceau/SceauCaseSummaryRR0Mapper.d.ts +3 -3
  187. package/dist/time/datasource/sceau/SceauCaseSummaryRR0Mapper.js +1 -1
  188. package/dist/time/datasource/sceau/SceauDatasource.d.ts +4 -4
  189. package/dist/time/datasource/sceau/SceauDatasource.js +1 -1
  190. package/dist/time/datasource/sceau/SceauHttpDatasource.d.ts +5 -5
  191. package/dist/time/datasource/ufo-search/UfoSearchCase.d.ts +1 -1
  192. package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.d.ts +4 -4
  193. package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.js +10 -10
  194. package/dist/time/datasource/ufo-search/UfoSearchDatasource.d.ts +2 -2
  195. package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.d.ts +3 -3
  196. package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.js +1 -1
  197. package/dist/time/datasource/ufo-search/UfoSearchHttpDatasource.d.ts +4 -4
  198. package/dist/time/datasource/ufo-search/UfoSearchTestCases.js +1 -1
  199. package/dist/time/datasource/urecat/UrecatCase.d.ts +1 -1
  200. package/dist/time/datasource/urecat/UrecatHttpDatasource.d.ts +5 -5
  201. package/dist/time/datasource/urecat/UrecatHttpDatasource.js +1 -1
  202. package/dist/time/datasource/urecat/UrecatRR0Mapper.d.ts +3 -3
  203. package/dist/time/datasource/urecat/UrecatRR0Mapper.js +1 -1
  204. package/dist/time/datasource/urecat/UrecatTestCases.js +1 -1
  205. package/dist/time/html/TimeElementFactory.d.ts +15 -0
  206. package/dist/time/{TimeElementFactory.js → html/TimeElementFactory.js} +16 -22
  207. package/dist/time/html/TimeRenderer.d.ts +18 -0
  208. package/dist/time/html/TimeRenderer.js +46 -0
  209. package/dist/time/html/TimeReplacer.d.ts +12 -0
  210. package/dist/time/{TimeReplacer.js → html/TimeReplacer.js} +0 -3
  211. package/dist/time/{TimeReplacerFactory.d.ts → html/TimeReplacerFactory.d.ts} +2 -2
  212. package/dist/time/{TimeReplacerFactory.js → html/TimeReplacerFactory.js} +1 -1
  213. package/dist/time/html/index.d.ts +4 -0
  214. package/dist/time/html/index.js +4 -0
  215. package/dist/time/index.d.ts +3 -8
  216. package/dist/time/index.js +3 -8
  217. package/dist/time/{RelativeTimeTextBuilder.d.ts → text/RelativeTimeTextBuilder.d.ts} +2 -2
  218. package/dist/time/text/RelativeTimeTextBuilder.js +165 -0
  219. package/dist/time/{TimeTextBuilder.d.ts → text/TimeTextBuilder.d.ts} +2 -2
  220. package/dist/time/{TimeTextBuilder.js → text/TimeTextBuilder.js} +1 -1
  221. package/dist/time/text/index.d.ts +2 -0
  222. package/dist/time/text/index.js +2 -0
  223. package/dist/value/UnitReplaceCommand.d.ts +2 -2
  224. package/package.json +15 -12
  225. package/tsconfig.json +2 -1
  226. package/dist/place/PlaceLocation.d.ts +0 -26
  227. package/dist/place/PlaceLocation.js +0 -48
  228. package/dist/place/PlaceMessages.d.ts +0 -5
  229. package/dist/place/PlaceMessages_en.d.ts +0 -2
  230. package/dist/place/PlaceMessages_en.js +0 -4
  231. package/dist/place/PlaceMessages_fr.d.ts +0 -2
  232. package/dist/place/PlaceMessages_fr.js +0 -4
  233. package/dist/time/RelativeTimeTextBuilder.js +0 -166
  234. package/dist/time/TimeContext.d.ts +0 -59
  235. package/dist/time/TimeContext.js +0 -267
  236. package/dist/time/TimeElementFactory.d.ts +0 -15
  237. package/dist/time/TimeRenderer.d.ts +0 -19
  238. package/dist/time/TimeRenderer.js +0 -63
  239. package/dist/time/TimeReplacer.d.ts +0 -24
  240. /package/dist/org/eu/fr/region/idf/77/{paris → SivryCourtry}/SivryCourtry.d.ts +0 -0
  241. /package/dist/org/eu/fr/region/idf/77/{paris → SivryCourtry}/SivryCourtry.js +0 -0
  242. /package/dist/org/eu/fr/region/idf/77/{paris → SivryCourtry}/SivryCourtryMessages.d.ts +0 -0
  243. /package/dist/org/eu/fr/region/idf/77/{paris → SivryCourtry}/SivryCourtryMessages.js +0 -0
  244. /package/dist/{place/PlaceMessages.js → time/datasource/rr0/NamedPlace.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { SourceRenderer } from "./SourceRenderer.js";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../RR0Context.js";
3
3
  import { SourceFactory } from "./SourceFactory.js";
4
4
  import { ReferenceGenerator } from "../ReferenceGenerator.js";
5
5
  /**
@@ -12,6 +12,6 @@ export declare class SourceReplacer {
12
12
  protected readonly factory: SourceFactory;
13
13
  protected counter: ReferenceGenerator<any>;
14
14
  constructor(renderer: SourceRenderer, factory: SourceFactory, counter: ReferenceGenerator<any>);
15
- replacement(context: HtmlRR0SsgContext, original: HTMLElement): Promise<HTMLElement>;
16
- protected content(context: HtmlRR0SsgContext, original: HTMLElement, container: HTMLElement): Promise<void>;
15
+ replacement(context: HtmlRR0Context, original: HTMLElement): Promise<HTMLElement>;
16
+ protected content(context: HtmlRR0Context, original: HTMLElement, container: HTMLElement): Promise<void>;
17
17
  }
@@ -1,5 +1,5 @@
1
1
  import { DomReplacer, ReplacerFactory } from "ssg-api";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../RR0Context.js";
3
3
  import { SourceReplacer } from "./SourceReplacer.js";
4
4
  /**
5
5
  * Creates replacers for sources HTML in a given context.
@@ -7,5 +7,5 @@ import { SourceReplacer } from "./SourceReplacer.js";
7
7
  export declare class SourceReplacerFactory implements ReplacerFactory<DomReplacer> {
8
8
  protected replacer: SourceReplacer;
9
9
  constructor(replacer: SourceReplacer);
10
- create(context: HtmlRR0SsgContext): Promise<DomReplacer>;
10
+ create(context: HtmlRR0Context): Promise<DomReplacer>;
11
11
  }
@@ -1,10 +1,10 @@
1
1
  import { DomReplacement } from "../../../../../../time/DomReplacement.js";
2
- import { HtmlRR0SsgContext } from "../../../../../../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../../../../../../RR0Context.js";
3
3
  import { CodeParser } from "./CodeParser.js";
4
- export declare class CodeReplacer implements DomReplacement<HtmlRR0SsgContext> {
4
+ export declare class CodeReplacer implements DomReplacement<HtmlRR0Context> {
5
5
  protected parsers: CodeParser[];
6
6
  constructor(parsers: CodeParser[]);
7
- replacement(context: HtmlRR0SsgContext, codeElement: HTMLElement): Promise<HTMLElement>;
7
+ replacement(context: HtmlRR0Context, codeElement: HTMLElement): Promise<HTMLElement>;
8
8
  protected removeIndent(lines: string[]): void;
9
9
  protected trimEnd(lines: string[]): void;
10
10
  protected parse(lines: string[]): void;
@@ -1,6 +1,6 @@
1
1
  import { CodeReplacer } from "./CodeReplacer.js";
2
2
  import { DomReplacer, ReplacerFactory } from "ssg-api";
3
- import { HtmlRR0SsgContext } from "../../../../../../RR0SsgContext.js";
3
+ import { HtmlRR0Context } from "../../../../../../RR0Context.js";
4
4
  export declare class CodeReplacerFactory implements ReplacerFactory<DomReplacer> {
5
5
  protected readonly replacer: CodeReplacer;
6
6
  /**
@@ -8,5 +8,5 @@ export declare class CodeReplacerFactory implements ReplacerFactory<DomReplacer>
8
8
  *
9
9
  * @param context
10
10
  */
11
- create(context: HtmlRR0SsgContext): Promise<DomReplacer>;
11
+ create(context: HtmlRR0Context): Promise<DomReplacer>;
12
12
  }
@@ -2,7 +2,7 @@ import { RR0CaseSummary } from "./datasource/index.js";
2
2
  import { EventRenderer } from "./EventRenderer.js";
3
3
  import { SourceFactory, SourceRenderer } from "../source/index.js";
4
4
  import { NoteRenderer } from "../note/index.js";
5
- import { TimeElementFactory } from "./TimeElementFactory.js";
5
+ import { TimeElementFactory } from "./html/TimeElementFactory.js";
6
6
  /**
7
7
  * Render a case summary as HTML.
8
8
  */
@@ -1,9 +1,9 @@
1
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
1
+ import { HtmlRR0Context } from "../RR0Context.js";
2
2
  import { RR0Data } from "../data/index.js";
3
3
  import { Source, SourceFactory, SourceRenderer } from "../source/index.js";
4
4
  import { NoteRenderer } from "../note/index.js";
5
5
  import { NamedPlace } from "./datasource/index.js";
6
- import { TimeElementFactory } from "./TimeElementFactory.js";
6
+ import { TimeElementFactory } from "./html/TimeElementFactory.js";
7
7
  import { RR0Event } from "../event/index.js";
8
8
  /**
9
9
  * Render a case summary as HTML.
@@ -14,9 +14,9 @@ export declare class EventRenderer<E extends RR0Event> {
14
14
  readonly sourceRenderer: SourceRenderer;
15
15
  protected timeElementFactory: TimeElementFactory;
16
16
  constructor(noteRenderer: NoteRenderer, sourceFactory: SourceFactory, sourceRenderer: SourceRenderer, timeElementFactory: TimeElementFactory);
17
- placeElement(context: HtmlRR0SsgContext, namedPlace: NamedPlace): HTMLSpanElement;
18
- renderEnd(context: HtmlRR0SsgContext, event: RR0Data, container: HTMLElement): Promise<void>;
19
- render(context: HtmlRR0SsgContext, event: E, container: HTMLElement): Promise<void>;
20
- renderNotes(context: HtmlRR0SsgContext, notes: string[], container: HTMLElement): Promise<void>;
21
- renderSources(context: HtmlRR0SsgContext, sources: Source[], container: HTMLElement): Promise<void>;
17
+ placeElement(context: HtmlRR0Context, namedPlace: NamedPlace): HTMLSpanElement;
18
+ renderEnd(context: HtmlRR0Context, event: RR0Data, container: HTMLElement): Promise<void>;
19
+ render(context: HtmlRR0Context, event: E, container: HTMLElement): Promise<void>;
20
+ renderNotes(context: HtmlRR0Context, notes: string[], container: HTMLElement): Promise<void>;
21
+ renderSources(context: HtmlRR0Context, sources: Source[], container: HTMLElement): Promise<void>;
22
22
  }
@@ -1,5 +1,5 @@
1
1
  import { DomReplacer, ReplacerFactory } from "ssg-api";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../RR0Context.js";
3
3
  import { AllDataService } from "../data/index.js";
4
4
  import { EventRenderer } from "./EventRenderer.js";
5
5
  import { RR0Event } from "../event/index.js";
@@ -7,8 +7,8 @@ export declare class EventReplacer<D extends RR0Event> {
7
7
  protected renderer: EventRenderer<D>;
8
8
  protected dataService: AllDataService;
9
9
  constructor(renderer: EventRenderer<D>, dataService: AllDataService);
10
- replacement(context: HtmlRR0SsgContext, original: HTMLElement): Promise<HTMLElement>;
11
- protected sourceFromFile(context: HtmlRR0SsgContext, container: HTMLElement, href: string): Promise<void>;
10
+ replacement(context: HtmlRR0Context, original: HTMLElement): Promise<HTMLElement>;
11
+ protected sourceFromFile(context: HtmlRR0Context, container: HTMLElement, href: string): Promise<void>;
12
12
  }
13
13
  /**
14
14
  * Creates replacers for sources HTML in a given context.
@@ -16,5 +16,5 @@ export declare class EventReplacer<D extends RR0Event> {
16
16
  export declare class EventReplacerFactory<D extends RR0Event> implements ReplacerFactory<DomReplacer> {
17
17
  protected replacer: EventReplacer<D>;
18
18
  constructor(replacer: EventReplacer<D>);
19
- create(context: HtmlRR0SsgContext): Promise<DomReplacer>;
19
+ create(context: HtmlRR0Context): Promise<DomReplacer>;
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import { RegexReplacer, SsiEchoVarReplaceCommand, StringContextHandler } from "ssg-api";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../RR0Context.js";
3
3
  /**
4
4
  * Replaces the SSI expression "<!--#echo var="title" -->" by the page's <title> content,
5
5
  * with a link if there's a <meta name="url"> content.
@@ -7,5 +7,5 @@ import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
7
7
  export declare class SsiTitleReplaceCommand extends SsiEchoVarReplaceCommand {
8
8
  protected defaultHandlers: StringContextHandler[];
9
9
  constructor(defaultHandlers?: StringContextHandler[]);
10
- protected createReplacer(context: HtmlRR0SsgContext): Promise<RegexReplacer>;
10
+ protected createReplacer(context: HtmlRR0Context): Promise<RegexReplacer>;
11
11
  }
@@ -1,5 +1,6 @@
1
- import { TimeTextBuilder } from "./TimeTextBuilder.js";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
1
+ import { TimeTextBuilder } from "./text/TimeTextBuilder.js";
2
+ import { TimeContext } from "@rr0/time";
3
+ import { HtmlRR0Context } from "../RR0Context.js";
3
4
  export declare class Time {
4
5
  static readonly timePathRegex: RegExp;
5
6
  /**
@@ -11,5 +12,6 @@ export declare class Time {
11
12
  */
12
13
  static dateFromIso(isoDate: string): Date;
13
14
  static parseFileName(fileName: string): RegExpExecArray | null;
14
- static titleFromFile(context: HtmlRR0SsgContext, fileName: string, timeTextBuilder: TimeTextBuilder): string | undefined;
15
+ static titleFromFile(context: HtmlRR0Context, fileName: string, timeTextBuilder: TimeTextBuilder): string | undefined;
16
+ static contextFromFileName(context: HtmlRR0Context, fileName?: string): TimeContext | undefined;
15
17
  }
package/dist/time/Time.js CHANGED
@@ -1,5 +1,4 @@
1
- import { TimeContext } from "./TimeContext.js";
2
- import { RR0SsgContextImpl } from "../RR0SsgContext.js";
1
+ import { RR0ContextImpl } from "../RR0Context.js";
3
2
  import { StringUtil } from "../util/string/StringUtil.js";
4
3
  export class Time {
5
4
  /**
@@ -21,13 +20,40 @@ export class Time {
21
20
  }
22
21
  static titleFromFile(context, fileName, timeTextBuilder) {
23
22
  let title;
24
- const timeContext = TimeContext.fromFileName(context, fileName);
23
+ const timeContext = Time.contextFromFileName(context, fileName);
25
24
  if (timeContext) {
26
- const pageContext = new RR0SsgContextImpl(context.locale, timeContext, context.config, context.people, context.file);
27
- title = timeTextBuilder.build(pageContext);
25
+ const pageContext = new RR0ContextImpl(context.locale, timeContext, context.config, context.people, context.file);
26
+ title = timeTextBuilder.build(pageContext, true);
28
27
  title = StringUtil.capitalizeFirstLetter(title);
29
28
  }
30
29
  return title;
31
30
  }
31
+ static contextFromFileName(context, fileName = context.file.name) {
32
+ let timeContext;
33
+ let elems;
34
+ if (fileName.endsWith("index.html")) {
35
+ while ((elems = fileName.split("/")).length < 6) {
36
+ fileName = elems.slice(0, elems.length - 1).join("/") + "/0/index.html";
37
+ }
38
+ }
39
+ const timeExec = Time.parseFileName(fileName);
40
+ if (timeExec && timeExec.length > 5) {
41
+ const pageContext = context.clone();
42
+ timeContext = pageContext.time;
43
+ const m = parseInt(timeExec[2], 10);
44
+ const c = parseInt(timeExec[3], 10);
45
+ const d = parseInt(timeExec[4], 10);
46
+ const u = parseInt(timeExec[5], 10);
47
+ const year = (timeExec[1] ? -1 : 1) * (m * 1000 + c * 100 + d * 10 + u);
48
+ timeContext.setYear(year);
49
+ const monthStr = timeExec[6];
50
+ timeContext.setMonth(monthStr ? parseInt(monthStr, 10) : undefined);
51
+ const dayStr = timeExec[7];
52
+ timeContext.setDayOfMonth(dayStr ? parseInt(dayStr, 10) : undefined);
53
+ timeContext.setHour(undefined);
54
+ timeContext.setMinutes(undefined);
55
+ }
56
+ return timeContext;
57
+ }
32
58
  }
33
59
  Time.timePathRegex = /time\/(-)?(\d)\/(\d)\/(\d)\/(\d)\/?(\d{2})?\/?(\d{2})?\/?(index(_[a-z]{2})?.html)?/;
@@ -1,14 +1,15 @@
1
1
  import { LinkHandler } from "../MetaLinkReplaceCommand.js";
2
- import { HtmlRR0SsgContext } from "../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../RR0Context.js";
3
3
  import { Link } from "ssg-api";
4
- import { TimeTextBuilder } from "./TimeTextBuilder.js";
5
- export declare class TimeLinkDefaultHandler implements LinkHandler<HtmlRR0SsgContext> {
6
- protected timeFiles: string[];
4
+ import { TimeTextBuilder } from "./text/TimeTextBuilder.js";
5
+ import { TimeService } from "./TimeService";
6
+ export declare class TimeLinkDefaultHandler implements LinkHandler<HtmlRR0Context> {
7
+ protected service: TimeService;
7
8
  protected timeTextBuilder: TimeTextBuilder;
8
- constructor(timeFiles: string[], timeTextBuilder: TimeTextBuilder);
9
- contents(context: HtmlRR0SsgContext): Link | undefined;
10
- next(context: HtmlRR0SsgContext): Link | undefined;
11
- prev(context: HtmlRR0SsgContext): Link | undefined;
12
- start(context: HtmlRR0SsgContext): Link | undefined;
9
+ constructor(service: TimeService, timeTextBuilder: TimeTextBuilder);
10
+ contents(context: HtmlRR0Context): Link | undefined;
11
+ next(context: HtmlRR0Context): Link | undefined;
12
+ prev(context: HtmlRR0Context): Link | undefined;
13
+ start(context: HtmlRR0Context): Link | undefined;
13
14
  protected isTimeFile(fileName: string): boolean;
14
15
  }
@@ -1,19 +1,15 @@
1
1
  import { Time } from "./Time.js";
2
2
  import { LinkType } from "ssg-api";
3
3
  export class TimeLinkDefaultHandler {
4
- constructor(timeFiles, timeTextBuilder) {
5
- this.timeFiles = timeFiles;
4
+ constructor(service, timeTextBuilder) {
5
+ this.service = service;
6
6
  this.timeTextBuilder = timeTextBuilder;
7
7
  }
8
8
  contents(context) {
9
9
  const prevLink = this.prev(context);
10
10
  if (prevLink) {
11
- let contentUrl = prevLink.url.substring(1);
12
- do {
13
- const slash = contentUrl.lastIndexOf("/");
14
- contentUrl = contentUrl.substring(0, slash);
15
- } while (this.timeFiles.indexOf(contentUrl) < 0 && contentUrl !== "time");
16
- if (contentUrl != "time") {
11
+ let contentUrl = this.service.matchExistingTimeFile(prevLink.url.substring(1));
12
+ if (contentUrl != this.service.root) {
17
13
  const text = Time.titleFromFile(context, contentUrl, this.timeTextBuilder);
18
14
  if (text) {
19
15
  return { type: LinkType.prev, text, url: "/" + contentUrl };
@@ -24,9 +20,9 @@ export class TimeLinkDefaultHandler {
24
20
  next(context) {
25
21
  let fileName = context.file.name;
26
22
  if (this.isTimeFile(fileName)) {
27
- const pos = this.timeFiles.indexOf(fileName);
23
+ const pos = this.service.files.indexOf(fileName);
28
24
  if (pos >= 0) {
29
- const nextFile = this.timeFiles[pos + 1];
25
+ const nextFile = this.service.files[pos + 1];
30
26
  if (nextFile) {
31
27
  const text = Time.titleFromFile(context, nextFile, this.timeTextBuilder);
32
28
  return { type: LinkType.next, text, url: "/" + nextFile };
@@ -37,9 +33,9 @@ export class TimeLinkDefaultHandler {
37
33
  prev(context) {
38
34
  let fileName = context.file.name;
39
35
  if (this.isTimeFile(fileName)) {
40
- const pos = this.timeFiles.indexOf(fileName);
36
+ const pos = this.service.files.indexOf(fileName);
41
37
  if (pos >= 0) {
42
- const prevFile = this.timeFiles[pos - 1];
38
+ const prevFile = this.service.files[pos - 1];
43
39
  if (prevFile) {
44
40
  const text = Time.titleFromFile(context, prevFile, this.timeTextBuilder);
45
41
  if (text) {
@@ -1,12 +1,21 @@
1
- import { TimeRenderer } from "./TimeRenderer.js";
2
- import { TimeTextBuilder } from "./TimeTextBuilder.js";
1
+ import { TimeRenderer } from "./html/TimeRenderer.js";
2
+ import { TimeTextBuilder } from "./text/TimeTextBuilder.js";
3
3
  import { AbstractDataService, AllDataService } from "../data/index.js";
4
4
  import { RR0Event } from "../event/index.js";
5
+ import { TimeUrlBuilder } from "./TimeUrlBuilder";
6
+ export type TimeServiceOptions = {
7
+ readonly root: string;
8
+ readonly files: string[];
9
+ };
5
10
  export declare class TimeService extends AbstractDataService<RR0Event> {
6
11
  readonly textBuilder: TimeTextBuilder;
7
- constructor(dataService: AllDataService, textBuilder: TimeTextBuilder);
8
- protected _renderer: TimeRenderer;
9
- get renderer(): TimeRenderer;
10
- getFiles(): Promise<string[]>;
11
- isTimeFile(filePath: string): Promise<boolean>;
12
+ readonly urlBuilder: TimeUrlBuilder;
13
+ readonly renderer: TimeRenderer;
14
+ readonly root: string;
15
+ constructor(dataService: AllDataService, textBuilder: TimeTextBuilder, urlBuilder: TimeUrlBuilder, options: TimeServiceOptions);
16
+ isTimeFile(filePath: string): boolean;
17
+ /**
18
+ * @return the found time URL or undefined if not found.
19
+ */
20
+ matchExistingTimeFile(url: string): string | undefined;
12
21
  }
@@ -1,30 +1,24 @@
1
- import { TimeRenderer } from "./TimeRenderer.js";
1
+ import { TimeRenderer } from "./html/TimeRenderer.js";
2
2
  import { AbstractDataService } from "../data/index.js";
3
- import { glob } from "glob";
4
3
  export class TimeService extends AbstractDataService {
5
- constructor(dataService, textBuilder) {
6
- super(dataService, null);
4
+ constructor(dataService, textBuilder, urlBuilder, options) {
5
+ super(dataService, null, options.files);
7
6
  this.textBuilder = textBuilder;
7
+ this.urlBuilder = urlBuilder;
8
+ this.root = options.root;
9
+ this.renderer = new TimeRenderer(this, this.textBuilder);
8
10
  }
9
- get renderer() {
10
- return this._renderer;
11
+ isTimeFile(filePath) {
12
+ return this.files.includes(filePath);
11
13
  }
12
- async getFiles() {
13
- if (!this.files) {
14
- const minusYearFiles = await glob("time/-?/?/?/?/index.html");
15
- const year1Files = await glob("time/?/index.html");
16
- const year2Files = await glob("time/?/?/index.html");
17
- const year3Files = await glob("time/?/?/?/index.html");
18
- const year4Files = await glob("time/?/?/?/?/index.html");
19
- const monthFiles = await glob("time/?/?/?/?/??/index.html");
20
- const dayFiles = await glob("time/?/?/?/?/??/??/index.html");
21
- const files = this.files = year1Files.concat(year2Files).concat(year3Files).concat(year4Files).concat(minusYearFiles).concat(monthFiles).concat(dayFiles).sort();
22
- this._renderer = new TimeRenderer(files, this.textBuilder);
14
+ /**
15
+ * @return the found time URL or undefined if not found.
16
+ */
17
+ matchExistingTimeFile(url) {
18
+ while (url && url !== this.root && this.files.indexOf(`${url}/index.html`) < 0) {
19
+ const slash = url.lastIndexOf("/");
20
+ url = url.substring(0, slash);
23
21
  }
24
- return this.files;
25
- }
26
- async isTimeFile(filePath) {
27
- const files = await this.getFiles();
28
- return files.includes(filePath);
22
+ return url === this.root ? undefined : url;
29
23
  }
30
24
  }
@@ -0,0 +1,16 @@
1
+ import { TimeElementFactory, TimeService, TimeServiceOptions, TimeTextBuilder, TimeUrlBuilder } from "../time/index.js";
2
+ import { RR0TestUtil } from "../test";
3
+ import { HtmlRR0Context } from "../RR0Context";
4
+ export declare class TimeTestUtil {
5
+ readonly timeTextBuilder: TimeTextBuilder;
6
+ timeElementFactory: TimeElementFactory;
7
+ timeOptions: TimeServiceOptions;
8
+ urlBuilder: TimeUrlBuilder;
9
+ protected timeService: TimeService;
10
+ fullRoot: string;
11
+ constructor(rr0TestUtil: RR0TestUtil);
12
+ newHtmlContext(inputFileName: string, contents?: string): HtmlRR0Context;
13
+ filePath(inputFileName: string): string;
14
+ url(inputFileName: string): string;
15
+ getService(options?: TimeServiceOptions): TimeService;
16
+ }
@@ -0,0 +1,29 @@
1
+ import path from "path";
2
+ import { TimeElementFactory, TimeService, TimeTextBuilder, TimeUrlBuilder } from "../time/index.js";
3
+ import { rr0TestUtil } from "../test";
4
+ export class TimeTestUtil {
5
+ constructor(rr0TestUtil) {
6
+ this.timeOptions = { root: "time", files: [] };
7
+ this.urlBuilder = new TimeUrlBuilder({ rootDir: this.timeOptions.root });
8
+ this.timeTextBuilder = new TimeTextBuilder(rr0TestUtil.intlOptions);
9
+ this.fullRoot = path.join(rr0TestUtil.rootDir, this.timeOptions.root);
10
+ }
11
+ newHtmlContext(inputFileName, contents) {
12
+ return rr0TestUtil.newHtmlContext(this.filePath(inputFileName), contents);
13
+ }
14
+ filePath(inputFileName) {
15
+ return path.join(this.timeOptions.root, inputFileName);
16
+ }
17
+ url(inputFileName) {
18
+ return path.join("/", this.filePath(inputFileName));
19
+ }
20
+ getService(options = this.timeOptions) {
21
+ if (!this.timeService
22
+ || this.timeService.root !== options.root
23
+ || JSON.stringify(this.timeService.files) !== JSON.stringify(options.files)) {
24
+ this.timeService = new TimeService(rr0TestUtil.dataService, this.timeTextBuilder, this.urlBuilder, options);
25
+ this.timeElementFactory = new TimeElementFactory(this.timeService.renderer);
26
+ }
27
+ return this.timeService;
28
+ }
29
+ }
@@ -1,5 +1,9 @@
1
- import { TimeContext } from "./TimeContext.js";
1
+ import { TimeContext } from "@rr0/time";
2
+ export type TimeUrlBuilderOptions = {
3
+ rootDir: string;
4
+ };
2
5
  export declare class TimeUrlBuilder {
3
- static readonly root = "time/";
4
- static fromContext(time: TimeContext): string;
6
+ readonly options: TimeUrlBuilderOptions;
7
+ constructor(options: TimeUrlBuilderOptions);
8
+ fromContext(time: TimeContext): string;
5
9
  }
@@ -1,9 +1,13 @@
1
+ import path from "path";
1
2
  export class TimeUrlBuilder {
2
- static fromContext(time) {
3
- let url = this.root;
3
+ constructor(options) {
4
+ this.options = options;
5
+ }
6
+ fromContext(time) {
7
+ let url = this.options.rootDir;
4
8
  const year = time.getYear();
5
9
  if (year) {
6
- url += year.toString().split("").join("/");
10
+ url = path.join(url, year.toString().split("").join("/"));
7
11
  }
8
12
  let month = time.getMonth();
9
13
  if (month) {
@@ -16,4 +20,3 @@ export class TimeUrlBuilder {
16
20
  return url;
17
21
  }
18
22
  }
19
- TimeUrlBuilder.root = "time/";
@@ -1,5 +1,5 @@
1
1
  import { Datasource } from "./Datasource";
2
- import { HtmlRR0SsgContext } from "../../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../../RR0Context.js";
3
3
  import { ContextFilter } from "./ContextFilter.js";
4
4
  /**
5
5
  * Cache cases which were already fetched, and filter out cases in memory according to (time) context.
@@ -9,9 +9,9 @@ export declare abstract class AbstractDatasource<S> implements Datasource<S> {
9
9
  readonly copyright: string;
10
10
  protected readonly cases: Map<string, S[]>;
11
11
  protected constructor(authors: string[], copyright: string);
12
- getCases(context: HtmlRR0SsgContext): Promise<S[]>;
13
- fetch(context: HtmlRR0SsgContext): Promise<S[]>;
14
- protected createFilter(context: HtmlRR0SsgContext): ContextFilter<S>;
15
- protected contextKey(context: HtmlRR0SsgContext): string;
16
- protected abstract readCases(context: HtmlRR0SsgContext): Promise<S[]>;
12
+ getCases(context: HtmlRR0Context): Promise<S[]>;
13
+ fetch(context: HtmlRR0Context): Promise<S[]>;
14
+ protected createFilter(context: HtmlRR0Context): ContextFilter<S>;
15
+ protected contextKey(context: HtmlRR0Context): string;
16
+ protected abstract readCases(context: HtmlRR0Context): Promise<S[]>;
17
17
  }
@@ -1,12 +1,12 @@
1
1
  import { DomReplacement } from "../DomReplacement.js";
2
- import { HtmlRR0SsgContext } from "../../RR0SsgContext.js";
2
+ import { HtmlRR0Context } from "../../RR0Context.js";
3
3
  import { CaseSummaryRenderer } from "../CaseSummaryRenderer.js";
4
4
  import { RR0CaseSummary } from "./rr0/RR0CaseSummary.js";
5
5
  import { RR0CaseMapping } from "./rr0/RR0CaseMapping.js";
6
6
  /**
7
7
  * Replaces a (ul) tag from (chronology) files with case summaries from external datasources.
8
8
  */
9
- export declare class ChronologyReplacer implements DomReplacement<HtmlRR0SsgContext, HTMLUListElement> {
9
+ export declare class ChronologyReplacer implements DomReplacement<HtmlRR0Context, HTMLUListElement> {
10
10
  protected mappings: RR0CaseMapping<any>[];
11
11
  protected renderer: CaseSummaryRenderer;
12
12
  /**
@@ -16,8 +16,8 @@ export declare class ChronologyReplacer implements DomReplacement<HtmlRR0SsgCont
16
16
  */
17
17
  protected readonly done: Set<string>;
18
18
  constructor(mappings: RR0CaseMapping<any>[], renderer: CaseSummaryRenderer);
19
- replacement(context: HtmlRR0SsgContext, element: HTMLUListElement): Promise<HTMLUListElement>;
20
- protected aggregate(context: HtmlRR0SsgContext, element: HTMLUListElement): Promise<void>;
21
- protected aggregateDatasource(mapping: RR0CaseMapping<any>, context: HtmlRR0SsgContext, existingCases: RR0CaseSummary[], casesToAdd: RR0CaseSummary[]): Promise<void>;
22
- protected merge(context: HtmlRR0SsgContext, sourceCases: any[], fetchTime: Date, mapping: RR0CaseMapping<any>, existingCases: RR0CaseSummary[]): RR0CaseSummary[];
19
+ replacement(context: HtmlRR0Context, element: HTMLUListElement): Promise<HTMLUListElement>;
20
+ protected aggregate(context: HtmlRR0Context, element: HTMLUListElement): Promise<void>;
21
+ protected aggregateDatasource(mapping: RR0CaseMapping<any>, context: HtmlRR0Context, existingCases: RR0CaseSummary[], casesToAdd: RR0CaseSummary[]): Promise<void>;
22
+ protected merge(context: HtmlRR0Context, sourceCases: any[], fetchTime: Date, mapping: RR0CaseMapping<any>, existingCases: RR0CaseSummary[]): RR0CaseSummary[];
23
23
  }
@@ -1,6 +1,6 @@
1
1
  import { DomReplacer, ReplacerFactory } from "ssg-api";
2
2
  import { ChronologyReplacer } from "./ChronologyReplacer.js";
3
- import { HtmlRR0SsgContext } from "../../RR0SsgContext.js";
3
+ import { HtmlRR0Context } from "../../RR0Context.js";
4
4
  import { CaseSummaryRenderer } from "../CaseSummaryRenderer.js";
5
5
  import { TimeService } from "../TimeService.js";
6
6
  import { RR0CaseMapping } from "./rr0/RR0CaseMapping.js";
@@ -13,5 +13,5 @@ export declare class ChronologyReplacerFactory implements ReplacerFactory<DomRep
13
13
  *
14
14
  * @param context
15
15
  */
16
- create(context: HtmlRR0SsgContext): Promise<DomReplacer>;
16
+ create(context: HtmlRR0Context): Promise<DomReplacer>;
17
17
  }
@@ -12,7 +12,7 @@ export class ChronologyReplacerFactory {
12
12
  async create(context) {
13
13
  return {
14
14
  replace: async (ul) => {
15
- const isTimeFile = await this.timeService.isTimeFile(context.file.name);
15
+ const isTimeFile = this.timeService.isTimeFile(context.file.name);
16
16
  if (isTimeFile) {
17
17
  ul = await this.replacer.replacement(context, ul);
18
18
  }
@@ -1,12 +1,12 @@
1
1
  import { UfoCaseFilter } from "./UfoCaseFilter.js";
2
- import { RR0SsgContext } from "../../RR0SsgContext.js";
2
+ import { RR0Context } from "../../RR0Context.js";
3
3
  export declare abstract class ContextFilter<T> implements UfoCaseFilter<T> {
4
- protected context: RR0SsgContext;
4
+ protected context: RR0Context;
5
5
  /**
6
6
  * @param context The context to match
7
7
  * @protected
8
8
  */
9
- protected constructor(context: RR0SsgContext);
9
+ protected constructor(context: RR0Context);
10
10
  /**
11
11
  * @param ufoCase
12
12
  * @return if that UFO case matches the filter.
@@ -1,4 +1,4 @@
1
- import { HtmlRR0SsgContext } from "../../RR0SsgContext.js";
1
+ import { HtmlRR0Context } from "../../RR0Context.js";
2
2
  import { Datasource } from "./Datasource.js";
3
3
  import { CsvMapper } from "./CsvMapper.js";
4
4
  import { FileSource } from "./FileSource.js";
@@ -15,5 +15,5 @@ export declare class CsvFileSource<S> extends FileSource {
15
15
  * @protected
16
16
  */
17
17
  fileName(context: HtmlSsgContext, datasource: Datasource<S>): string;
18
- write(context: HtmlRR0SsgContext, datasourceCases: S[], fetchTime: Date, datasource: Datasource<any>): void;
18
+ write(context: HtmlRR0Context, datasourceCases: S[], fetchTime: Date, datasource: Datasource<any>): void;
19
19
  }
@@ -1,12 +1,12 @@
1
1
  import { CaseMapper } from "./CaseMapper.js";
2
- import { RR0SsgContext } from "../../RR0SsgContext.js";
3
- export declare class CsvMapper<S> implements CaseMapper<RR0SsgContext, S, string> {
2
+ import { RR0Context } from "../../RR0Context.js";
3
+ export declare class CsvMapper<S> implements CaseMapper<RR0Context, S, string> {
4
4
  readonly sep: string;
5
5
  readonly escapeStr: string;
6
6
  readonly prefix: string;
7
7
  readonly fields: Set<string>;
8
8
  constructor(sep?: string, escapeStr?: string, prefix?: string);
9
- readonly fieldMapper: (context: RR0SsgContext, key: string, value: any, sourceTime: Date) => string;
9
+ readonly fieldMapper: (context: RR0Context, key: string, value: any, sourceTime: Date) => string;
10
10
  /**
11
11
  * Map a case to a CSV row.
12
12
  *
@@ -14,7 +14,7 @@ export declare class CsvMapper<S> implements CaseMapper<RR0SsgContext, S, string
14
14
  * @param sourceCase
15
15
  * @param sourceTime
16
16
  */
17
- map(context: RR0SsgContext, sourceCase: S, sourceTime: Date): string;
17
+ map(context: RR0Context, sourceCase: S, sourceTime: Date): string;
18
18
  /**
19
19
  * Reduce a set of cases to a CSV string.
20
20
  *
@@ -22,7 +22,7 @@ export declare class CsvMapper<S> implements CaseMapper<RR0SsgContext, S, string
22
22
  * @param sourceCases
23
23
  * @param sourceTime
24
24
  */
25
- mapAll(context: RR0SsgContext, sourceCases: S[], sourceTime: Date): string;
25
+ mapAll(context: RR0Context, sourceCases: S[], sourceTime: Date): string;
26
26
  escape(value: string, force?: boolean): string;
27
27
  /**
28
28
  * Converts CSV contents to a list of cases.
@@ -1,4 +1,4 @@
1
- import { TimeContext } from "../TimeContext.js";
1
+ import { TimeContext } from "@rr0/time";
2
2
  export class CsvMapper {
3
3
  constructor(sep = ",", escapeStr = "\"", prefix = "") {
4
4
  this.sep = sep;
@@ -1,4 +1,4 @@
1
- import { HtmlRR0SsgContext } from "../../RR0SsgContext.js";
1
+ import { HtmlRR0Context } from "../../RR0Context.js";
2
2
  /**
3
3
  * A source for cases.
4
4
  *
@@ -19,5 +19,5 @@ export interface Datasource<S> {
19
19
  * @param context
20
20
  * @return Promise<S[]>
21
21
  */
22
- fetch(context: HtmlRR0SsgContext): Promise<S[]>;
22
+ fetch(context: HtmlRR0Context): Promise<S[]>;
23
23
  }