erudit 3.0.0-dev.23 → 3.0.0-dev.26

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 (669) hide show
  1. package/app/app.vue +25 -185
  2. package/app/assets/icons/array-check.svg +3 -0
  3. package/app/assets/icons/array-lines.svg +3 -0
  4. package/app/assets/icons/array-star.svg +3 -0
  5. package/app/assets/icons/arrow/from-circle.svg +3 -0
  6. package/app/assets/icons/arrow/left.svg +3 -0
  7. package/app/assets/icons/arrow/outward-box.svg +3 -0
  8. package/app/assets/icons/arrow/outward.svg +3 -0
  9. package/app/assets/icons/arrow/to-circle.svg +3 -0
  10. package/app/assets/icons/arrow/up-to-right.svg +3 -0
  11. package/app/assets/icons/aside-open.svg +2 -2
  12. package/app/assets/icons/asterisk.svg +2 -2
  13. package/app/assets/icons/bell.svg +3 -0
  14. package/app/assets/icons/book-outline.svg +3 -0
  15. package/app/assets/icons/book-question.svg +2 -2
  16. package/app/assets/icons/book.svg +2 -2
  17. package/app/assets/icons/box.svg +3 -0
  18. package/app/assets/icons/bug.svg +2 -2
  19. package/app/assets/icons/chevron-right.svg +3 -0
  20. package/app/assets/icons/cog.svg +3 -0
  21. package/app/assets/icons/construction.svg +2 -2
  22. package/app/assets/icons/diamond.svg +2 -2
  23. package/app/assets/icons/draw.svg +2 -2
  24. package/app/assets/icons/erudit.svg +3 -0
  25. package/app/assets/icons/file-lines.svg +2 -2
  26. package/app/assets/icons/files.svg +2 -4
  27. package/app/assets/icons/flame.svg +3 -0
  28. package/app/assets/icons/folder-open.svg +2 -2
  29. package/app/assets/icons/folder.svg +2 -2
  30. package/app/assets/icons/globe.svg +2 -2
  31. package/app/assets/icons/graduation.svg +2 -2
  32. package/app/assets/icons/handshake.svg +3 -0
  33. package/app/assets/icons/house.svg +2 -2
  34. package/app/assets/icons/lines.svg +3 -0
  35. package/app/assets/icons/moon.svg +2 -2
  36. package/app/assets/icons/plus-circle.svg +2 -2
  37. package/app/assets/icons/plus.svg +2 -2
  38. package/app/assets/icons/puzzle.svg +2 -2
  39. package/app/assets/icons/question-circle.svg +3 -0
  40. package/app/assets/icons/rocket.svg +3 -1
  41. package/app/assets/icons/search/check.svg +3 -0
  42. package/app/assets/icons/search/dead.svg +3 -0
  43. package/app/assets/icons/search/glass.svg +3 -0
  44. package/app/assets/icons/search/wtf.svg +3 -0
  45. package/app/assets/icons/sun-moon.svg +2 -2
  46. package/app/assets/icons/sun.svg +2 -2
  47. package/app/assets/icons/translate.svg +3 -0
  48. package/app/assets/icons/user.svg +2 -2
  49. package/app/assets/icons/users.svg +2 -2
  50. package/app/assets/icons/warning.svg +3 -0
  51. package/app/components/EruditLink.ts +9 -0
  52. package/app/components/FancyBold.vue +17 -0
  53. package/app/components/FancyCard.vue +58 -0
  54. package/app/components/FancyCardTag.vue +16 -0
  55. package/app/components/Prose.vue +51 -0
  56. package/app/components/ScrollHolder.vue +20 -0
  57. package/app/components/SmartMedia.vue +112 -0
  58. package/app/components/ads/Ads.vue +39 -33
  59. package/app/components/ads/AdsBannerAside.vue +46 -61
  60. package/app/components/ads/AdsBannerBottom.vue +17 -22
  61. package/app/components/ads/AdsReplacer.vue +28 -73
  62. package/app/components/ads/provider/Custom.vue +19 -0
  63. package/app/components/ads/{AdsProviderYandex.vue → provider/Yandex.vue} +84 -91
  64. package/app/components/aside/AsideListItem.vue +66 -91
  65. package/app/components/aside/AsideMajor.vue +8 -56
  66. package/app/components/aside/AsideMinor.vue +76 -97
  67. package/app/components/aside/AsideSwitch.vue +67 -0
  68. package/app/components/aside/major/PaneHolder.vue +106 -0
  69. package/app/components/aside/major/PaneSwitcher.vue +73 -0
  70. package/app/components/aside/major/PaneSwitcherButton.vue +38 -0
  71. package/app/components/aside/major/PaneTemplate.vue +5 -0
  72. package/app/components/aside/major/SiteInfo.vue +68 -85
  73. package/app/components/aside/major/contentNav/PaneBookNav.vue +116 -0
  74. package/app/components/aside/major/contentNav/PaneGlobalNav.vue +24 -0
  75. package/app/components/aside/major/contentNav/items/ContentNavBook.vue +21 -0
  76. package/app/components/aside/major/contentNav/items/ContentNavFolder.vue +92 -0
  77. package/app/components/aside/major/contentNav/items/ContentNavItem.vue +33 -0
  78. package/app/components/aside/major/contentNav/items/ContentNavPage.vue +18 -0
  79. package/app/components/aside/major/contentNav/items/ContentNavSeparator.vue +62 -0
  80. package/app/components/aside/major/contentNav/items/ContentNavTopic.vue +18 -0
  81. package/app/components/aside/major/contentNav/items/Flags.vue +52 -0
  82. package/app/components/aside/major/contentNav/items/ItemTemplate.vue +27 -0
  83. package/app/components/aside/major/languages/PaneLanguages.vue +55 -0
  84. package/app/components/aside/major/pages/PanePages.vue +60 -0
  85. package/app/components/aside/major/search/PaneSearch.vue +145 -0
  86. package/app/components/aside/major/search/SearchInput.vue +104 -0
  87. package/app/components/aside/major/search/SearchResult.vue +103 -0
  88. package/app/components/aside/major/search/SearchStatus.vue +48 -0
  89. package/app/components/aside/major/search/search.worker.ts +164 -0
  90. package/app/components/aside/major/settings/BuildTime.vue +25 -0
  91. package/app/components/aside/major/settings/EngineVersion.vue +13 -0
  92. package/app/components/aside/major/settings/PaneSettings.vue +17 -0
  93. package/app/components/aside/major/settings/ThemeSwitcher.vue +53 -0
  94. package/app/components/aside/major/settings/repository/Repository.vue +33 -0
  95. package/app/components/aside/major/settings/repository/SecondaryGitHub.vue +71 -0
  96. package/app/components/aside/minor/AsideMinorPane.vue +1 -11
  97. package/app/components/aside/minor/AsideMinorPlainHeader.vue +21 -0
  98. package/app/components/aside/minor/content/AsideMinorContentContributions.vue +53 -0
  99. package/app/components/aside/minor/content/AsideMinorContentPage.vue +37 -0
  100. package/app/components/aside/minor/content/AsideMinorContentTopic.vue +66 -0
  101. package/app/components/aside/minor/content/ButtonPaneContributions.vue +116 -0
  102. package/app/components/aside/minor/content/ButtonPaneImprove.vue +121 -0
  103. package/app/components/aside/minor/content/Contribution.vue +34 -0
  104. package/app/components/aside/minor/content/Toc.vue +165 -0
  105. package/app/components/aside/minor/content/TocItem.vue +77 -0
  106. package/app/components/aside/minor/content/TopicPartButton.vue +35 -0
  107. package/app/components/aside/minor/contributor/AsideMinorContributor.vue +31 -68
  108. package/app/components/aside/minor/contributor/ItemBook.vue +39 -0
  109. package/app/components/aside/minor/contributor/ItemContent.vue +17 -0
  110. package/app/components/aside/minor/news/AsideMinorNews.vue +135 -0
  111. package/app/components/aside/minor/news/NewsItem.vue +69 -0
  112. package/app/components/aside/minor/news/RenderNewsElement.vue +42 -0
  113. package/app/components/aside/minor/news/elements/Mix.vue +11 -0
  114. package/app/components/aside/minor/news/elements/P.vue +14 -0
  115. package/app/components/aside/minor/news/elements/Ref.vue +58 -0
  116. package/app/components/aside/minor/news/elements/Text.vue +18 -0
  117. package/app/components/indexPage/IndexPagePersons.vue +117 -0
  118. package/app/components/main/MainAction.vue +20 -0
  119. package/app/components/main/MainBreadcrumbs.vue +28 -0
  120. package/app/components/main/MainContentChild.vue +48 -0
  121. package/app/components/main/MainContentChildren.vue +14 -0
  122. package/app/components/main/MainDecoration.vue +15 -0
  123. package/app/components/main/MainDescription.vue +6 -23
  124. package/app/components/main/MainFlag.vue +133 -0
  125. package/app/components/main/MainFlags.vue +17 -0
  126. package/app/components/main/MainGlow.vue +12 -0
  127. package/app/components/main/MainQuickLink.vue +76 -0
  128. package/app/components/main/MainQuickLinks.vue +42 -0
  129. package/app/components/main/MainQuote.vue +160 -0
  130. package/app/components/main/MainQuoteLoader.vue +86 -0
  131. package/app/components/main/MainSection.vue +39 -42
  132. package/app/components/main/MainSectionPreamble.vue +5 -0
  133. package/app/components/main/MainSubTitle.vue +12 -0
  134. package/app/components/main/MainTitle.vue +26 -69
  135. package/app/components/main/MainTopicPartPage.vue +88 -0
  136. package/app/components/main/MainTopicPartSwitch.vue +71 -0
  137. package/app/components/main/connections/Deps.vue +34 -0
  138. package/app/components/main/connections/Externals.vue +46 -0
  139. package/app/components/main/connections/MainConnections.vue +41 -0
  140. package/app/components/main/connections/MainConnectionsButton.vue +80 -0
  141. package/app/components/main/connections/ScrollPane.vue +11 -0
  142. package/app/components/main/contentStats/Item.vue +35 -0
  143. package/app/components/main/contentStats/ItemElement.vue +19 -0
  144. package/app/components/main/contentStats/ItemMaterials.vue +11 -0
  145. package/app/components/main/contentStats/MainContentStats.vue +50 -0
  146. package/app/components/preview/Preview.vue +173 -186
  147. package/app/components/preview/PreviewError.vue +10 -0
  148. package/app/components/preview/PreviewLoading.vue +5 -14
  149. package/app/components/preview/PreviewScreen.vue +65 -141
  150. package/app/components/preview/PreviewScreenButton.vue +39 -0
  151. package/app/components/preview/screen/ContentPage.vue +50 -0
  152. package/app/components/preview/screen/DirectLink.vue +23 -0
  153. package/app/components/preview/screen/Unique.vue +54 -0
  154. package/app/components/site/SiteAside.vue +70 -0
  155. package/app/components/site/SiteAsideOverlay.vue +21 -0
  156. package/app/components/site/SiteMain.vue +16 -0
  157. package/app/components/transition/Fade.vue +30 -19
  158. package/app/components/transition/Slide.vue +47 -0
  159. package/app/components/tree/TreeContainer.vue +5 -11
  160. package/app/components/tree/TreeItem.vue +40 -93
  161. package/app/composables/ads.ts +17 -0
  162. package/app/composables/analytics.ts +102 -0
  163. package/app/composables/appElements.ts +40 -0
  164. package/app/composables/aside.ts +28 -0
  165. package/app/composables/asideMajorPane.ts +135 -0
  166. package/app/composables/asideMinor.ts +109 -0
  167. package/app/composables/contentNav.ts +7 -0
  168. package/app/composables/favicon.ts +104 -4
  169. package/app/composables/file.ts +3 -0
  170. package/app/composables/formatText.ts +78 -81
  171. package/app/composables/loading.ts +2 -0
  172. package/app/composables/mainContent.ts +31 -0
  173. package/app/composables/og.ts +169 -0
  174. package/app/composables/phrases.ts +126 -77
  175. package/app/composables/preview.ts +53 -0
  176. package/app/composables/route.ts +4 -0
  177. package/app/composables/theme.ts +71 -50
  178. package/app/composables/url.ts +22 -43
  179. package/app/formatters/ru.ts +14 -0
  180. package/app/pages/article/[...articleId].vue +10 -1
  181. package/app/pages/book/[...bookId].vue +50 -11
  182. package/app/pages/contributor/[contributorId].vue +127 -203
  183. package/app/pages/contributors.vue +80 -164
  184. package/app/pages/group/[...groupId].vue +52 -11
  185. package/app/pages/index.vue +101 -186
  186. package/app/pages/page/[...pageId].vue +60 -0
  187. package/app/pages/practice/[...practiceId].vue +12 -0
  188. package/app/pages/sponsors.vue +66 -76
  189. package/app/pages/summary/[...summaryId].vue +10 -1
  190. package/app/plugins/appSetup/client/htmlBranding.ts +6 -0
  191. package/app/plugins/appSetup/client/welcome.ts +35 -0
  192. package/app/plugins/appSetup/config.ts +6 -0
  193. package/app/plugins/appSetup/global.ts +3 -0
  194. package/app/plugins/appSetup/index.ts +28 -0
  195. package/app/plugins/prerender.server.ts +16 -11
  196. package/app/router.options.ts +5 -0
  197. package/app/scripts/theme.js +33 -0
  198. package/app/styles/main.css +173 -0
  199. package/bin/erudit.mjs +2 -2
  200. package/modules/erudit/globals/content.ts +4 -0
  201. package/modules/erudit/globals/contributor.ts +1 -0
  202. package/modules/erudit/globals/eruditConfig.ts +10 -0
  203. package/modules/erudit/globals/problem.ts +1 -0
  204. package/modules/erudit/globals/prose.ts +1 -0
  205. package/modules/erudit/globals/public.ts +18 -0
  206. package/modules/erudit/index.ts +60 -0
  207. package/{module → modules/erudit}/logger.ts +2 -2
  208. package/modules/erudit/setup/aliases.ts +17 -0
  209. package/modules/erudit/setup/baseUrl.ts +19 -0
  210. package/modules/erudit/setup/elements/appTemplate.ts +45 -0
  211. package/modules/erudit/setup/elements/globalTemplate.ts +82 -0
  212. package/modules/erudit/setup/elements/globalTypes.ts +273 -0
  213. package/modules/erudit/setup/elements/setup.ts +167 -0
  214. package/modules/erudit/setup/elements/shared.ts +10 -0
  215. package/modules/erudit/setup/elements/tagsTable.ts +28 -0
  216. package/modules/erudit/setup/fullRestart.ts +71 -0
  217. package/modules/erudit/setup/globals.ts +196 -0
  218. package/modules/erudit/setup/nuxtConfig.ts +48 -0
  219. package/modules/erudit/setup/projectConfig.ts +114 -0
  220. package/modules/erudit/setup/publicAssets.ts +52 -0
  221. package/modules/erudit/setup/runtimeConfig.ts +58 -0
  222. package/modules/erudit/watcher.ts +27 -0
  223. package/nuxt.config.ts +66 -102
  224. package/package.json +36 -18
  225. package/proxy/prose.app.ts +1 -0
  226. package/proxy/prose.ts +1 -0
  227. package/public/favicons/default.svg +1 -0
  228. package/{app/public → public}/logotype.svg +1 -1
  229. package/public/og.png +0 -0
  230. package/server/api/aside/major/frontNav/book/[...shortId].ts +10 -0
  231. package/server/api/aside/major/frontNav/global.ts +5 -0
  232. package/server/api/aside/major/pages.ts +6 -0
  233. package/server/api/contributor/list.ts +36 -35
  234. package/server/api/contributor/page/[contributorId].ts +58 -4
  235. package/server/api/indexPage.ts +81 -0
  236. package/server/api/language/functions.ts +6 -7
  237. package/server/api/language/phrase/[phraseKey].ts +32 -0
  238. package/server/api/main/content/[...contentTypePath].ts +153 -0
  239. package/server/api/news/batch/[batchIndex].ts +5 -0
  240. package/server/api/pageSponsors.ts +56 -0
  241. package/server/api/prerender/content.ts +82 -0
  242. package/server/api/prerender/files.ts +10 -0
  243. package/server/api/prerender/frontNav.ts +13 -0
  244. package/server/api/prerender/language.ts +3 -5
  245. package/server/api/prerender/news.ts +8 -0
  246. package/server/api/prerender/quotes.ts +15 -0
  247. package/server/api/preview/contentPage/[...contentTypePath].ts +63 -0
  248. package/server/api/preview/contentUnique/[...contentTypePathUnique].ts +81 -0
  249. package/server/api/problemScript/[...problemScriptPath].ts +92 -0
  250. package/server/api/quote/data/[quoteId].ts +87 -0
  251. package/server/api/quote/ids.ts +3 -0
  252. package/server/erudit/build.ts +135 -0
  253. package/server/erudit/cameos/build.ts +111 -0
  254. package/server/erudit/config.ts +11 -0
  255. package/server/erudit/content/global/build.ts +271 -0
  256. package/server/erudit/content/global/singleton.ts +5 -0
  257. package/server/erudit/content/nav/build.ts +431 -0
  258. package/server/erudit/content/nav/front.ts +130 -0
  259. package/server/erudit/content/nav/repository/books.ts +40 -0
  260. package/server/erudit/content/nav/repository/get.ts +33 -0
  261. package/server/erudit/content/nav/repository/hasChildren.ts +5 -0
  262. package/server/erudit/content/nav/repository/hasNav.ts +3 -0
  263. package/server/erudit/content/nav/repository/hasParent.ts +5 -0
  264. package/server/erudit/content/nav/repository/id.ts +9 -0
  265. package/server/erudit/content/nav/repository/index.ts +9 -0
  266. package/server/erudit/content/nav/repository/order.ts +14 -0
  267. package/server/erudit/content/nav/repository/previousNext.ts +35 -0
  268. package/server/erudit/content/nav/repository/walk.ts +127 -0
  269. package/server/erudit/content/nav/setup.ts +13 -0
  270. package/server/erudit/content/nav/types.ts +24 -0
  271. package/server/erudit/content/repository/breadcrumbs.ts +24 -0
  272. package/server/erudit/content/repository/children.ts +47 -0
  273. package/server/erudit/content/repository/connections.ts +35 -0
  274. package/server/erudit/content/repository/contentLink.ts +16 -0
  275. package/server/erudit/content/repository/decoration.ts +23 -0
  276. package/server/erudit/content/repository/deps.ts +84 -0
  277. package/server/erudit/content/repository/description.ts +11 -0
  278. package/server/erudit/content/repository/elementSnippets.ts +64 -0
  279. package/server/erudit/content/repository/externals.ts +25 -0
  280. package/server/erudit/content/repository/flags.ts +33 -0
  281. package/server/erudit/content/repository/seo.ts +12 -0
  282. package/server/erudit/content/repository/stats.ts +97 -0
  283. package/server/erudit/content/repository/title.ts +27 -0
  284. package/server/erudit/content/repository/topicParts.ts +39 -0
  285. package/server/erudit/content/repository/unique.ts +76 -0
  286. package/server/erudit/content/resolve/book.ts +32 -0
  287. package/server/erudit/content/resolve/group.ts +39 -0
  288. package/server/erudit/content/resolve/index.ts +139 -0
  289. package/server/erudit/content/resolve/page.ts +87 -0
  290. package/server/erudit/content/resolve/topic.ts +113 -0
  291. package/server/erudit/content/resolve/utils/contentError.ts +10 -0
  292. package/server/erudit/content/resolve/utils/insertContentItem.ts +122 -0
  293. package/server/erudit/content/resolve/utils/insertContentResolved.ts +93 -0
  294. package/server/erudit/content/search.ts +135 -0
  295. package/server/erudit/contributors/build.ts +111 -0
  296. package/server/erudit/contributors/global.ts +3 -0
  297. package/server/erudit/contributors/repository/avatarUrl.ts +10 -0
  298. package/server/erudit/contributors/repository/contributions.ts +178 -0
  299. package/server/erudit/contributors/repository/count.ts +3 -0
  300. package/server/erudit/contributors/search.ts +34 -0
  301. package/server/erudit/db/repository/pushFile.ts +23 -0
  302. package/server/erudit/db/repository/pushProblemScript.ts +19 -0
  303. package/server/erudit/db/repository/pushProseLink.ts +40 -0
  304. package/server/erudit/db/schema/cameos.ts +7 -0
  305. package/server/erudit/db/schema/content.ts +18 -0
  306. package/server/erudit/db/schema/contentContributions.ts +15 -0
  307. package/server/erudit/db/schema/contentDeps.ts +21 -0
  308. package/server/erudit/db/schema/contentElementStats.ts +20 -0
  309. package/server/erudit/db/schema/contentProseLinks.ts +23 -0
  310. package/server/erudit/db/schema/contentSnippets.ts +32 -0
  311. package/server/erudit/db/schema/contentToc.ts +16 -0
  312. package/server/erudit/db/schema/contentUniques.ts +25 -0
  313. package/server/erudit/db/schema/contributors.ts +12 -0
  314. package/server/erudit/db/schema/files.ts +11 -0
  315. package/server/erudit/db/schema/groups.ts +6 -0
  316. package/server/erudit/db/schema/index.ts +17 -0
  317. package/server/erudit/db/schema/news.ts +7 -0
  318. package/server/erudit/db/schema/pages.ts +7 -0
  319. package/server/erudit/db/schema/problemScripts.ts +14 -0
  320. package/server/erudit/db/schema/sponsors.ts +9 -0
  321. package/server/erudit/db/schema/topics.ts +9 -0
  322. package/server/erudit/db/setup.ts +62 -0
  323. package/server/erudit/db/types.ts +10 -0
  324. package/server/erudit/global.ts +33 -0
  325. package/server/erudit/importer.ts +97 -0
  326. package/server/erudit/index.ts +90 -0
  327. package/server/erudit/language/list/en.ts +209 -0
  328. package/server/erudit/language/list/ru.ts +214 -0
  329. package/server/erudit/language/list.ts +6 -0
  330. package/server/erudit/language/setup.ts +36 -0
  331. package/server/erudit/language/types.ts +16 -0
  332. package/server/erudit/logger.ts +77 -0
  333. package/server/erudit/news/build.ts +77 -0
  334. package/server/erudit/news/repository/batch.ts +61 -0
  335. package/server/erudit/prose/repository/finalize.ts +68 -0
  336. package/server/erudit/prose/repository/get.ts +54 -0
  337. package/server/erudit/prose/repository/resolve.ts +17 -0
  338. package/server/erudit/prose/storage/callout.ts +14 -0
  339. package/server/erudit/prose/storage/image.ts +20 -0
  340. package/server/erudit/prose/storage/link.ts +226 -0
  341. package/server/erudit/prose/storage/problemScript.ts +21 -0
  342. package/server/erudit/prose/storage/video.ts +14 -0
  343. package/server/erudit/prose/transform/bundleProblemScript.ts +6 -0
  344. package/server/erudit/prose/transform/extensions.ts +15 -0
  345. package/server/erudit/quote/repository/ids.ts +31 -0
  346. package/server/erudit/repository.ts +96 -0
  347. package/server/erudit/sponsors/build.ts +114 -0
  348. package/server/erudit/sponsors/repository/avatarUrl.ts +10 -0
  349. package/server/erudit/sponsors/repository/count.ts +4 -0
  350. package/server/erudit/staticFile.ts +28 -0
  351. package/server/plugins/augmentCss.ts +17 -0
  352. package/server/plugins/lang.ts +7 -0
  353. package/server/plugins/metaViewport.ts +15 -0
  354. package/server/plugins/theme.ts +13 -0
  355. package/server/routes/file/[...path].ts +18 -0
  356. package/server/routes/robots.txt.ts +1 -1
  357. package/server/routes/search.json.gz.ts +72 -0
  358. package/server/routes/sitemap.xml.ts +61 -90
  359. package/shared/search/encoders.ts +20 -0
  360. package/shared/types/asideMajorPages.ts +4 -0
  361. package/shared/types/breadcrumbs.ts +9 -0
  362. package/shared/types/contentChildren.ts +10 -0
  363. package/shared/types/contentConnections.ts +27 -0
  364. package/shared/types/contentStats.ts +6 -0
  365. package/shared/types/elementSnippet.ts +8 -0
  366. package/shared/types/frontContentNav.ts +38 -0
  367. package/shared/types/indexPage.ts +20 -0
  368. package/shared/types/language.ts +189 -89
  369. package/shared/types/mainContent.ts +69 -0
  370. package/shared/types/news.ts +13 -0
  371. package/shared/types/preview.ts +28 -0
  372. package/shared/types/runtimeConfig.ts +64 -0
  373. package/shared/types/search.ts +79 -0
  374. package/shared/utils/contentTypePath.ts +63 -0
  375. package/shared/utils/icons.ts +11 -0
  376. package/shared/utils/pages.ts +24 -0
  377. package/shared/utils/slasher.ts +64 -0
  378. package/shared/utils/stringColor.ts +13 -9
  379. package/shared/utils/toStringEqual.ts +21 -0
  380. package/shared/utils/zip.ts +64 -0
  381. package/test/shared/utils/slasher.test.ts +75 -0
  382. package/test/shared/utils/zip.test.ts +8 -0
  383. package/tsconfig.json +17 -8
  384. package/app/assets/icons/alert.svg +0 -3
  385. package/app/assets/icons/angle-right.svg +0 -3
  386. package/app/assets/icons/arrow-in-text.svg +0 -3
  387. package/app/assets/icons/arrow-left.svg +0 -3
  388. package/app/assets/icons/arrow-up-to-right.svg +0 -3
  389. package/app/assets/icons/cameo-add.svg +0 -3
  390. package/app/assets/icons/chip.svg +0 -3
  391. package/app/assets/icons/circle-help.svg +0 -3
  392. package/app/assets/icons/cross.svg +0 -3
  393. package/app/assets/icons/ellipsis-vertical.svg +0 -3
  394. package/app/assets/icons/file-check.svg +0 -3
  395. package/app/assets/icons/file-star.svg +0 -3
  396. package/app/assets/icons/link-external.svg +0 -3
  397. package/app/assets/icons/link.svg +0 -3
  398. package/app/assets/icons/list-squared.svg +0 -3
  399. package/app/assets/icons/outline/book.svg +0 -3
  400. package/app/assets/icons/outline/file-lines.svg +0 -3
  401. package/app/assets/icons/pirate.svg +0 -3
  402. package/app/assets/icons/search.svg +0 -3
  403. package/app/assets/icons/shuffle.svg +0 -3
  404. package/app/assets/icons/star.svg +0 -3
  405. package/app/components/Avatar.vue +0 -118
  406. package/app/components/EruditLink.vue +0 -17
  407. package/app/components/GroupLikePage.vue +0 -70
  408. package/app/components/Loading.vue +0 -23
  409. package/app/components/QuickLinks.vue +0 -99
  410. package/app/components/SiteAside.vue +0 -393
  411. package/app/components/SiteMain.vue +0 -32
  412. package/app/components/ads/AdsProviderCustom.vue +0 -35
  413. package/app/components/aside/major/PaneContentScroll.vue +0 -23
  414. package/app/components/aside/major/PaneSwitch.vue +0 -54
  415. package/app/components/aside/major/PaneSwitchButton.vue +0 -63
  416. package/app/components/aside/major/panes/Language.vue +0 -79
  417. package/app/components/aside/major/panes/Pages.vue +0 -50
  418. package/app/components/aside/major/panes/Search.vue +0 -11
  419. package/app/components/aside/major/panes/nav/Nav.vue +0 -92
  420. package/app/components/aside/major/panes/nav/NavBook.vue +0 -95
  421. package/app/components/aside/major/panes/nav/NavBookLoading.vue +0 -24
  422. package/app/components/aside/major/panes/nav/NavGlobal.vue +0 -16
  423. package/app/components/aside/major/panes/nav/fnav/FNav.vue +0 -105
  424. package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +0 -32
  425. package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +0 -40
  426. package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +0 -60
  427. package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +0 -34
  428. package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +0 -80
  429. package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +0 -24
  430. package/app/components/aside/major/panes/other/ItemContent.vue +0 -29
  431. package/app/components/aside/major/panes/other/ItemGenerator.vue +0 -13
  432. package/app/components/aside/major/panes/other/ItemTheme.vue +0 -49
  433. package/app/components/aside/major/panes/other/Other.vue +0 -16
  434. package/app/components/aside/minor/AsideMinorContribute.vue +0 -175
  435. package/app/components/aside/minor/AsideMinorNews.vue +0 -11
  436. package/app/components/aside/minor/AsideMinorTopLink.vue +0 -66
  437. package/app/components/aside/minor/content/AsideMinorContent.vue +0 -89
  438. package/app/components/aside/minor/contributor/BookContribution.vue +0 -64
  439. package/app/components/aside/minor/topic/AsideMinorTopic.vue +0 -31
  440. package/app/components/aside/minor/topic/TopicContributors.vue +0 -183
  441. package/app/components/aside/minor/topic/TopicNav.vue +0 -49
  442. package/app/components/aside/minor/topic/TopicToc.vue +0 -212
  443. package/app/components/aside/minor/topic/TopicTocItem.vue +0 -19
  444. package/app/components/aside/utils/AsideOverlayPane.vue +0 -40
  445. package/app/components/bitran/BitranContent.vue +0 -90
  446. package/app/components/bitran/RenderWrapper.vue +0 -10
  447. package/app/components/contributor/ContributorListItem.vue +0 -43
  448. package/app/components/index/IndexAvatars.vue +0 -143
  449. package/app/components/main/MainActionButton.vue +0 -53
  450. package/app/components/main/MainBitranContent.vue +0 -68
  451. package/app/components/main/MainBreadcrumb.vue +0 -63
  452. package/app/components/main/MainSectionTitle.vue +0 -50
  453. package/app/components/main/MainSourceUsages.vue +0 -119
  454. package/app/components/main/MainSourcesUsage.vue +0 -60
  455. package/app/components/main/MainToc.vue +0 -135
  456. package/app/components/main/cameo/MainCameo.vue +0 -135
  457. package/app/components/main/cameo/MainCameoData.vue +0 -232
  458. package/app/components/main/content/ContentBreadcrumb.vue +0 -28
  459. package/app/components/main/content/ContentDecoration.vue +0 -29
  460. package/app/components/main/content/ContentPopover.vue +0 -188
  461. package/app/components/main/content/ContentPopovers.vue +0 -118
  462. package/app/components/main/content/ContentReferences.vue +0 -44
  463. package/app/components/main/content/reference/ReferenceGroup.vue +0 -39
  464. package/app/components/main/content/reference/ReferenceItem.vue +0 -70
  465. package/app/components/main/content/reference/ReferenceSource.vue +0 -121
  466. package/app/components/main/topic/MainTopic.vue +0 -73
  467. package/app/components/main/topic/MainTopicQuickLinks.vue +0 -24
  468. package/app/components/main/topic/TopicPartSwitch.vue +0 -119
  469. package/app/components/preview/PreviewDisplay.vue +0 -139
  470. package/app/components/preview/PreviewFooterAction.vue +0 -73
  471. package/app/components/preview/display/Alert.vue +0 -50
  472. package/app/components/preview/display/Custom.vue +0 -18
  473. package/app/components/preview/display/GenericLink.vue +0 -48
  474. package/app/components/preview/display/PageLink.vue +0 -22
  475. package/app/components/preview/display/Unique.vue +0 -46
  476. package/app/components/sponsor/SponsorTier1.vue +0 -89
  477. package/app/components/sponsor/SponsorTier2.vue +0 -109
  478. package/app/components/stats/Stats.vue +0 -21
  479. package/app/components/stats/StatsGroupLike.vue +0 -24
  480. package/app/components/stats/StatsItem.vue +0 -33
  481. package/app/components/stats/StatsItemElement.vue +0 -13
  482. package/app/composables/adsAllowed.ts +0 -11
  483. package/app/composables/asset.ts +0 -12
  484. package/app/composables/bitran.ts +0 -108
  485. package/app/composables/bitranLocation.ts +0 -6
  486. package/app/composables/contentData.ts +0 -38
  487. package/app/composables/contentPage.ts +0 -169
  488. package/app/composables/contentRoute.ts +0 -45
  489. package/app/composables/darkMagic.ts +0 -24
  490. package/app/composables/externalApi.ts +0 -69
  491. package/app/composables/head.ts +0 -24
  492. package/app/composables/majorPane.ts +0 -62
  493. package/app/pages/_test/preview.vue +0 -110
  494. package/app/pages/practice/[...practice].vue +0 -3
  495. package/app/plugins/analytics.ts +0 -95
  496. package/app/public/favicon/article.svg +0 -10
  497. package/app/public/favicon/default.svg +0 -10
  498. package/app/public/favicon/practice.svg +0 -10
  499. package/app/public/favicon/summary.svg +0 -10
  500. package/app/public/og-default.png +0 -0
  501. package/app/scripts/_immediate.js +0 -9
  502. package/app/scripts/aside/index.ts +0 -59
  503. package/app/scripts/aside/major/nav.ts +0 -26
  504. package/app/scripts/aside/minor/state.ts +0 -37
  505. package/app/scripts/flag.ts +0 -28
  506. package/app/scripts/og.ts +0 -28
  507. package/app/scripts/preview/build.ts +0 -76
  508. package/app/scripts/preview/data/alert.ts +0 -19
  509. package/app/scripts/preview/data/custom.ts +0 -8
  510. package/app/scripts/preview/data/genericLink.ts +0 -24
  511. package/app/scripts/preview/data/pageLink.ts +0 -24
  512. package/app/scripts/preview/data/unique.ts +0 -69
  513. package/app/scripts/preview/data.ts +0 -24
  514. package/app/scripts/preview/display.ts +0 -37
  515. package/app/scripts/preview/footer.ts +0 -9
  516. package/app/scripts/preview/request.ts +0 -51
  517. package/app/scripts/preview/state.ts +0 -63
  518. package/app/styles/_immediate.css +0 -7
  519. package/app/styles/_util.scss +0 -43
  520. package/app/styles/_utils.scss +0 -44
  521. package/app/styles/app.scss +0 -91
  522. package/app/styles/def/_bp.scss +0 -27
  523. package/app/styles/def/_size.scss +0 -7
  524. package/app/styles/def/_z.scss +0 -5
  525. package/app/styles/normalize.scss +0 -49
  526. package/app/styles/partials/_darkMagic.scss +0 -5
  527. package/app/styles/partials/_fnav.scss +0 -15
  528. package/app/styles/partials/_preview.scss +0 -5
  529. package/const.ts +0 -3
  530. package/globalPath.ts +0 -21
  531. package/globals/bitran.ts +0 -1
  532. package/globals/cameo.ts +0 -5
  533. package/globals/content.ts +0 -27
  534. package/globals/contributor.ts +0 -5
  535. package/globals/erudit.ts +0 -5
  536. package/globals/register.ts +0 -23
  537. package/globals/sponsor.ts +0 -17
  538. package/languages/en.ts +0 -114
  539. package/languages/ru.ts +0 -119
  540. package/module/bitran.ts +0 -66
  541. package/module/config.ts +0 -35
  542. package/module/imports.ts +0 -74
  543. package/module/index.ts +0 -47
  544. package/module/paths.ts +0 -22
  545. package/module/restart.ts +0 -61
  546. package/server/api/aside/major/nav/bookIds.ts +0 -5
  547. package/server/api/aside/major/nav/bookNav/[...bookId].ts +0 -17
  548. package/server/api/aside/major/nav/global.ts +0 -7
  549. package/server/api/aside/minor/book/[...bookId].ts +0 -18
  550. package/server/api/aside/minor/contributor/[contributorId].ts +0 -18
  551. package/server/api/aside/minor/group/[...groupId].ts +0 -18
  552. package/server/api/aside/minor/news.ts +0 -7
  553. package/server/api/aside/minor/topic.ts +0 -36
  554. package/server/api/bitran/content/[...location].ts +0 -13
  555. package/server/api/bitran/toc/[...location].ts +0 -9
  556. package/server/api/cameo/data/[cameoId].ts +0 -42
  557. package/server/api/cameo/ids.ts +0 -5
  558. package/server/api/content/data.ts +0 -97
  559. package/server/api/contributor/count.ts +0 -6
  560. package/server/api/fake/content.ts +0 -11
  561. package/server/api/fake/shared/languages.ts +0 -12
  562. package/server/api/index/data.ts +0 -46
  563. package/server/api/language/phrase/[phraseId].ts +0 -19
  564. package/server/api/language/phraseIds.ts +0 -8
  565. package/server/api/prerender/assets/cameo.ts +0 -14
  566. package/server/api/prerender/assets/contributor.ts +0 -12
  567. package/server/api/prerender/assets/sponsor.ts +0 -13
  568. package/server/api/prerender/cameos.ts +0 -12
  569. package/server/api/preview/page/[...parts].ts +0 -78
  570. package/server/api/preview/unique/[...location].ts +0 -48
  571. package/server/api/problem/generator/[...path].ts +0 -26
  572. package/server/api/sponsor/cameo/data/[sponsorId].ts +0 -51
  573. package/server/api/sponsor/cameo/ids.ts +0 -5
  574. package/server/api/sponsor/count.ts +0 -5
  575. package/server/api/sponsor/list.ts +0 -36
  576. package/server/plugin/bitran/content.ts +0 -238
  577. package/server/plugin/bitran/elements/include.ts +0 -229
  578. package/server/plugin/bitran/location.ts +0 -40
  579. package/server/plugin/bitran/toc.ts +0 -94
  580. package/server/plugin/bitran/transpiler.ts +0 -18
  581. package/server/plugin/build/close.ts +0 -12
  582. package/server/plugin/build/jobs/content/builderArgs.ts +0 -8
  583. package/server/plugin/build/jobs/content/generic.ts +0 -191
  584. package/server/plugin/build/jobs/content/parse.ts +0 -207
  585. package/server/plugin/build/jobs/content/path.ts +0 -6
  586. package/server/plugin/build/jobs/content/type/book.ts +0 -9
  587. package/server/plugin/build/jobs/content/type/group.ts +0 -16
  588. package/server/plugin/build/jobs/content/type/topic.ts +0 -36
  589. package/server/plugin/build/jobs/contributors.ts +0 -69
  590. package/server/plugin/build/jobs/language.ts +0 -36
  591. package/server/plugin/build/jobs/nav.ts +0 -345
  592. package/server/plugin/build/process.ts +0 -34
  593. package/server/plugin/build/rebuild.ts +0 -68
  594. package/server/plugin/build/setup.ts +0 -19
  595. package/server/plugin/content/context.ts +0 -116
  596. package/server/plugin/db/entities/Book.ts +0 -7
  597. package/server/plugin/db/entities/Content.ts +0 -45
  598. package/server/plugin/db/entities/Contribution.ts +0 -10
  599. package/server/plugin/db/entities/Contributor.ts +0 -25
  600. package/server/plugin/db/entities/File.ts +0 -10
  601. package/server/plugin/db/entities/Group.ts +0 -11
  602. package/server/plugin/db/entities/Hash.ts +0 -15
  603. package/server/plugin/db/entities/QuickLink.ts +0 -19
  604. package/server/plugin/db/entities/Stat.ts +0 -13
  605. package/server/plugin/db/entities/Topic.ts +0 -20
  606. package/server/plugin/db/entities/Unique.ts +0 -21
  607. package/server/plugin/db/reset.ts +0 -12
  608. package/server/plugin/db/setup.ts +0 -53
  609. package/server/plugin/global.ts +0 -18
  610. package/server/plugin/importer.ts +0 -16
  611. package/server/plugin/index.ts +0 -9
  612. package/server/plugin/logger.ts +0 -23
  613. package/server/plugin/nav/node.ts +0 -27
  614. package/server/plugin/nav/utils.ts +0 -179
  615. package/server/plugin/repository/asideMinor.ts +0 -51
  616. package/server/plugin/repository/book.ts +0 -39
  617. package/server/plugin/repository/cameo.ts +0 -16
  618. package/server/plugin/repository/content.ts +0 -240
  619. package/server/plugin/repository/contentId.ts +0 -40
  620. package/server/plugin/repository/contentToc.ts +0 -90
  621. package/server/plugin/repository/contributor.ts +0 -129
  622. package/server/plugin/repository/elementStats.ts +0 -80
  623. package/server/plugin/repository/file.ts +0 -10
  624. package/server/plugin/repository/frontNav.ts +0 -145
  625. package/server/plugin/repository/link.ts +0 -20
  626. package/server/plugin/repository/quickLink.ts +0 -36
  627. package/server/plugin/repository/readLink.ts +0 -17
  628. package/server/plugin/repository/reference.ts +0 -78
  629. package/server/plugin/repository/topic.ts +0 -35
  630. package/server/plugin/repository/topicCount.ts +0 -19
  631. package/server/plugin/sponsor/build.ts +0 -82
  632. package/server/plugin/sponsor/index.ts +0 -5
  633. package/server/plugin/sponsor/repository.ts +0 -56
  634. package/server/routes/asset/[...assetPath].ts +0 -34
  635. package/server/tsconfig.json +0 -9
  636. package/shared/aside/minor.ts +0 -55
  637. package/shared/asset.ts +0 -17
  638. package/shared/bitran/content.ts +0 -9
  639. package/shared/bitran/contentId.ts +0 -56
  640. package/shared/bitran/toc.ts +0 -8
  641. package/shared/breadcrumb.ts +0 -7
  642. package/shared/content/bookId.ts +0 -12
  643. package/shared/content/context.ts +0 -9
  644. package/shared/content/data/base.ts +0 -32
  645. package/shared/content/data/groupLike.ts +0 -11
  646. package/shared/content/data/index.ts +0 -5
  647. package/shared/content/data/type/book.ts +0 -7
  648. package/shared/content/data/type/group.ts +0 -8
  649. package/shared/content/data/type/topic.ts +0 -13
  650. package/shared/content/previousNext.ts +0 -9
  651. package/shared/content/reference.ts +0 -18
  652. package/shared/content/toc.ts +0 -35
  653. package/shared/contributor.ts +0 -34
  654. package/shared/frontNav.ts +0 -41
  655. package/shared/icons.ts +0 -38
  656. package/shared/image.ts +0 -5
  657. package/shared/indexData.ts +0 -10
  658. package/shared/link.ts +0 -29
  659. package/shared/popover.ts +0 -8
  660. package/shared/quickLink.ts +0 -7
  661. package/shared/stat.ts +0 -23
  662. package/shared/utils/objectsEqual.ts +0 -4
  663. package/test/contentId.test.ts +0 -91
  664. package/test/utils/url.test.ts +0 -99
  665. package/utils/contentPath.ts +0 -67
  666. package/utils/ext.ts +0 -41
  667. package/utils/normalize.ts +0 -7
  668. package/utils/stress.ts +0 -9
  669. package/utils/url.ts +0 -23
@@ -0,0 +1,209 @@
1
+ const en: LanguagePhrases = {
2
+ language_code: 'en',
3
+ language_name: 'English',
4
+ erudit: 'Erudit',
5
+ content_nav: 'Content navigation',
6
+ pages: 'Pages',
7
+ search: 'Search',
8
+ languages: 'Languages',
9
+ settings: 'Settings',
10
+ theme: 'Theme',
11
+ theme_light: 'Light',
12
+ theme_dark: 'Dark',
13
+ theme_system: 'System',
14
+ built: 'Built',
15
+ content: 'Content',
16
+ add_translation: 'Add translation',
17
+ main_page: 'Main page',
18
+ contributors: 'Contributors',
19
+ sponsors: 'Sponsors',
20
+ search_the_site: 'Search the site...',
21
+ searching_more: 'Searching more...',
22
+ no_results: 'No results found',
23
+ no_more_results: 'No more results',
24
+ no_content: 'No content',
25
+ to_index: 'To index',
26
+ about_textbook: 'About textbook',
27
+ flag_title_dev: 'Development',
28
+ flag_hint_dev:
29
+ 'This material is not complete, may contain error and will change in the future! Use with caution!',
30
+ flag_title_advanced: 'Advanced',
31
+ flag_hint_advanced:
32
+ 'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
33
+ flag_title_secondary: 'Additional',
34
+ flag_hint_secondary:
35
+ 'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
36
+ ads_replacer:
37
+ 'We help you. Help us back.<br><strong style="color: inherit;">Disable your ads blocker!</strong>',
38
+ direct_link: 'Direct link',
39
+ direct_link_explain: 'You are about to open a direct link:',
40
+ book: 'Textbook',
41
+ group: 'Category',
42
+ topic: 'Topic',
43
+ article: 'Article',
44
+ summary: 'Summary',
45
+ practice: 'Practice',
46
+ page: 'Page',
47
+ preview_content_page_description: 'You are about to open a content page:',
48
+ begin_learning: 'Begin Learning!',
49
+ flag_dev: 'Development',
50
+ flag_dev_description:
51
+ 'This material is in development! It may change in the future and even contain errors!',
52
+ flag_advanced: 'Advanced',
53
+ flag_advanced_description:
54
+ 'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
55
+ flag_secondary: 'Additional',
56
+ flag_secondary_description:
57
+ 'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
58
+ key_elements: 'Key elements',
59
+ stats: 'Statistics',
60
+ connections: 'Connections',
61
+ need_to_know: 'Need to know',
62
+ depends_on: 'Depends on',
63
+ used_by: 'Used by',
64
+ externals: 'Externals',
65
+ add_quote: 'Add your own message!',
66
+ next_quote: 'Next quote',
67
+ sponsors_description:
68
+ 'List of people and organizations that support the project financially. Thanks to them, the project can exist and develop. If you want to help the project, you can become a sponsor and get on this page too!',
69
+ become_sponsor: 'Become a sponsor',
70
+ no_sponsors: 'There are no sponsors yet. You can be the first one!',
71
+ contributors_description:
72
+ 'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
73
+ contributors_invite:
74
+ 'You can also help the project, make a contribution and get on this page!',
75
+ contributor_page_description: (name: string) =>
76
+ `Personal page of contributor "${name}" with information about their contributions to the project.`,
77
+ become_contributor: 'Become a contributor',
78
+ no_contributors: 'There are no contributors yet. You can be the first one!',
79
+ contribution: 'Contribution',
80
+ no_contribution: 'No contributions yet.',
81
+ editor: 'Editor',
82
+ materials: 'Materials',
83
+ x_sponsors: (count: number) => m(count, 'Sponsor', 'Sponsors'),
84
+ x_contributors: (count: number) => m(count, 'Contributor', 'Contributors'),
85
+ news: 'News',
86
+ no_news: 'No news available.',
87
+ show_more: 'Show more',
88
+ make_contribution: 'Make a contribution',
89
+ improve_material: 'Improve material',
90
+ how_to_improve: 'How to improve?',
91
+ report_issue: 'Report an issue',
92
+ edit_page: 'Edit page',
93
+ no_toc: 'TOC is empty.',
94
+ article_seo_description: (contentTitle: string) =>
95
+ `Clear and interesting explanation of the topic "${contentTitle}". Clear examples, important terms and statements, interesting facts, life applications.`,
96
+ summary_seo_description: (contentTitle: string) =>
97
+ `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
98
+ practice_seo_description: (contentTitle: string) =>
99
+ `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
100
+
101
+ default_index_title: 'Erudit',
102
+ default_index_short: 'Modern digital textbooks!',
103
+ default_site_info_short: 'Modern textbook',
104
+
105
+ // _language_title: 'English',
106
+ // _language_code: 'en',
107
+ // site_info_title: 'Erudit',
108
+ // site_info_slogan: 'Modern textbook',
109
+ // seo_index_title: 'Erudit - CMS for eductional sites',
110
+ // seo_index_description:
111
+ // 'Erudit is a CMS for creating and managing perfect educational sites, maintained by the community.',
112
+ // seo_article_description: (contentTitle) =>
113
+ // `Clear and interesting explanation of the topic "${contentTitle}". Illustrative examples, important properties, interesting facts, life applications, clear proofs. Here you will definitely understand the topic!`,
114
+ // seo_summary_description: (contentTitle) =>
115
+ // `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
116
+ // seo_practice_description: (contentTitle) =>
117
+ // `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
118
+ // index: 'Index',
119
+ // pages: 'Pages',
120
+ // search: 'Search',
121
+ // language: 'Language',
122
+ // other: 'Other',
123
+ // ads_replacer:
124
+ // 'Help us develop the project.<br><strong>Disable your ads blocker!</strong>',
125
+ // theme: 'Theme',
126
+ // theme_system: 'System',
127
+ // theme_light: 'Light',
128
+ // theme_dark: 'Dark',
129
+ // content: 'Content',
130
+ // main_page: 'Main page',
131
+ // contributors: 'Contributors',
132
+ // contributors_page_description:
133
+ // 'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
134
+ // contributors_page_invite:
135
+ // 'You can also help the project, make a contribution and get on this page!',
136
+ // become_contributor: 'Become a contributor',
137
+ // contributor: 'Contributor',
138
+ // contribution: 'Contribution',
139
+ // contributions_explain: (count) =>
140
+ // `Contributed to ${m(count, 'material', 'materials')}`,
141
+ // contributor_description: (name) =>
142
+ // `Page with information about the contributor "${name}" and his contribution to the project.`,
143
+ // editor: 'Editor',
144
+ // add_translation: 'Add translation',
145
+ // empty_nav: 'Empty navigation',
146
+
147
+ // popover_dependencies: 'Dependencies',
148
+ // popover_dependencies_description:
149
+ // 'There is no royal way into this topic! You can only figure it out if you know the following topics:',
150
+ // to_index: 'To index',
151
+ // about_book: 'About book',
152
+ // close: 'Close',
153
+ // back: 'Back',
154
+ // goto: 'Go to',
155
+ // error: 'Error!',
156
+ // external_link: 'External link',
157
+ // external_link_warn: 'You are going to visit external resource!',
158
+ // internal_link: 'Internal link',
159
+ // internal_link_warn: 'You are going to visit internal site page!',
160
+ // book: 'Textbook',
161
+ // group: 'Group',
162
+ // topic: 'Topic',
163
+ // topics: 'Topics',
164
+ // article: 'Article',
165
+ // summary: 'Summary',
166
+ // practice: 'Practice',
167
+ // element_id: 'Element ID',
168
+ // preview_missing_title: 'Element not found!',
169
+ // preview_missing_explain: `Can't find the element with specified ID in this page!<br>Perhaps the element ID is specified incorrectly or the element has been changed/deleted.`,
170
+ // preview_missing_explain_mismatch: `Can't find the element with specified ID in this page!<br>The version of the linked page is different from the current version of the page!<br>This is most likely the cause of the error.`,
171
+ // preview_hash_mismatch_title: 'Page version mismatch!',
172
+ // preview_hash_mismatch_explain:
173
+ // 'The version of the page you see now is different from the version of the page the original link led to!<br>The content may be different from what you expected to see.',
174
+ // current_page_hash: 'Current hash',
175
+ // expected_page_hash: 'Expected hash',
176
+ // empty_toc: 'Empty table of contents...',
177
+ // no_contributors: 'No contributors...',
178
+ // make_contribution: 'Make a contribution',
179
+ // material_improvement: 'Material improvement',
180
+ // how_to_improve: 'How to improve?',
181
+ // edit_page: 'Edit page',
182
+ // report_problem: 'Report a problem',
183
+ // references: 'References',
184
+ // reference_source_featured: 'Featured source',
185
+ // references_description:
186
+ // 'A list of external sources that were used to write this material. If there is an asterisk next to the title, it is a featured source and is worth reading if you want to delve deeper into the material.',
187
+ // sponsors: 'Sponsors',
188
+ // sponsors_description:
189
+ // 'People and organizations that support the project financially. Thanks to them, we can continue to develop the project and improve the quality of materials. If you want to support the project, you can become a sponsor too!',
190
+ // become_sponsor: 'Become a sponsor',
191
+ // toc: 'Table of contents',
192
+ // mentions: (count) => m(count, 'mention', 'mentions'),
193
+ // start_learning: 'Start learning!',
194
+ // x_contributors: (count) => m(count, 'Contributor', 'Contributors'),
195
+ // x_sponsors: (count) => m(count, 'Sponsor', 'Sponsors'),
196
+ // show_all: 'Show all',
197
+ };
198
+
199
+ export default en;
200
+
201
+ export function m(
202
+ number: number,
203
+ one: string,
204
+ few: string,
205
+ includeNumber = true,
206
+ ) {
207
+ const text = number === 1 ? one : few;
208
+ return includeNumber ? `${number} ${text}` : text;
209
+ }
@@ -0,0 +1,214 @@
1
+ const ru: LanguagePhrases = {
2
+ language_code: 'ru',
3
+ language_name: 'Русский',
4
+ erudit: 'Erudit',
5
+ content_nav: 'Оглавление',
6
+ pages: 'Страницы',
7
+ search: 'Поиск',
8
+ languages: 'Языки',
9
+ settings: 'Настройки',
10
+ theme: 'Тема',
11
+ theme_light: 'Светлая',
12
+ theme_dark: 'Темная',
13
+ theme_system: 'Системная',
14
+ built: 'Собрано',
15
+ content: 'Контент',
16
+ add_translation: 'Добавить перевод',
17
+ main_page: 'Главная страница',
18
+ contributors: 'Авторы',
19
+ sponsors: 'Спонсоры',
20
+ search_the_site: 'Поиск по сайту...',
21
+ searching_more: 'Ищем еще...',
22
+ no_results: 'Ничего не найдено',
23
+ no_more_results: 'Больше результатов нет',
24
+ no_content: 'Нет контента',
25
+ to_index: 'К оглавлению',
26
+ about_textbook: 'Об учебнике',
27
+ flag_title_dev: 'Разработка',
28
+ flag_hint_dev:
29
+ 'Этот материал не завершен, может содержать ошибки и измениться в будущем! Используйте с осторожностью!',
30
+ flag_title_advanced: 'Профиль',
31
+ flag_hint_advanced:
32
+ 'Этот материал предназначен для учеников с хорошим уровнем понимания предмета. Информация здесь не предназначена для новичков!',
33
+ flag_title_secondary: 'Дополнение',
34
+ flag_hint_secondary:
35
+ 'Это материал для тех, кто хочет глубже погрузиться предмет и получить дополнительные знания и контекст.',
36
+ ads_replacer:
37
+ 'Помогите улучшить проект.<br><strong style="color: inherit;">Включите показ рекламы!</strong>',
38
+ direct_link: 'Прямая ссылка',
39
+ direct_link_explain: 'Вы собираетесь открыть прямую ссылку:',
40
+ book: 'Учебник',
41
+ group: 'Категория',
42
+ topic: 'Тема',
43
+ article: 'Статья',
44
+ summary: 'Конспект',
45
+ practice: 'Задачи',
46
+ page: 'Страница',
47
+ preview_content_page_description:
48
+ 'Вы собираетесь перейти на страницу контента:',
49
+ begin_learning: 'Начать изучение!',
50
+ flag_dev: 'Разработка',
51
+ flag_dev_description:
52
+ 'Этот материал в разработке! Он может измениться в будущем и даже содержать ошибки!',
53
+ flag_advanced: 'Профиль',
54
+ flag_advanced_description:
55
+ 'Этот материал предназначен для учеников с высоким уровнем понимания предмета. Информация здесь не предназначена для новичков!',
56
+ flag_secondary: 'Дополнение',
57
+ flag_secondary_description:
58
+ 'Это дополнительный материал для тех, кто хочет глубже погрузиться предмет и получить дополнительные знания и контекст.',
59
+ key_elements: 'Ключевые элементы',
60
+ stats: 'Статистика',
61
+ connections: 'Связи',
62
+ need_to_know: 'Надо знать',
63
+ depends_on: 'Зависит от',
64
+ used_by: 'Используется в',
65
+ externals: 'Внешние',
66
+ add_quote: 'Добавить свое сообщение!',
67
+ next_quote: 'Следующая цитата',
68
+ sponsors_description:
69
+ 'Список людей и организаций, которые поддерживают проект финансово. Благодаря им проект может существовать и развиваться. Если вы хотите помочь проекту, то тоже можете стать спонсором и попасть на эту страницу!',
70
+ become_sponsor: 'Стать спонсором',
71
+ no_sponsors: 'Пока что спонсоров нет. Вы можете стать первым!',
72
+ contributors_description:
73
+ 'Список людей, которые внесли вклад в материалы проекта: предложили ценные идеи, вносили корректировки в существующий материал или же написали собственный!',
74
+ contributors_invite:
75
+ 'Вы тоже можете помочь проекту, внести свой вклад и попасть на эту страницу!',
76
+ contributor_page_description: (name: string) =>
77
+ `Персональная страница автора "${name}" с данными о вкладе в проект.`,
78
+ become_contributor: 'Стать автором',
79
+ no_contributors: 'Пока что авторов нет. Вы можете стать первым!',
80
+ contribution: 'Вклад',
81
+ no_contribution: 'Пока что вклада нет.',
82
+ editor: 'Редактор',
83
+ materials: 'Материалы',
84
+ x_sponsors: (count: number) => m(count, 'Спонсор', 'Спонсора', 'Спонсоров'),
85
+ x_contributors: (count: number) => m(count, 'Автор', 'Автора', 'Авторов'),
86
+ news: 'Новости',
87
+ no_news: 'Новостей пока нет.',
88
+ show_more: 'Показать больше',
89
+ make_contribution: 'Внести свой вклад',
90
+ improve_material: 'Улучшить материал',
91
+ how_to_improve: 'Как улучшить?',
92
+ report_issue: 'Сообщить о проблеме',
93
+ edit_page: 'Редактировать страницу',
94
+ no_toc: 'Содержание пусто.',
95
+ article_seo_description: (contentTitle: string) =>
96
+ `Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
97
+ summary_seo_description: (contentTitle: string) =>
98
+ `Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
99
+ practice_seo_description: (contentTitle: string) =>
100
+ `Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
101
+
102
+ default_index_title: 'Erudit',
103
+ default_index_short: 'Современные цифровые учебники!',
104
+ default_site_info_short: 'Современный учебник',
105
+
106
+ // _language_title: 'Русский',
107
+ // _language_code: 'ru',
108
+ // site_info_title: 'Erudit',
109
+ // site_info_slogan: 'Современный учебник',
110
+ // seo_index_title: 'Erudit - CMS для образовательных сайтов',
111
+ // seo_index_description:
112
+ // 'Erudit — CMS для создания и управления идеальными образовательными сайтами, которые поддерживаются сообществом.',
113
+ // seo_article_description: (contentTitle) =>
114
+ // `Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
115
+ // seo_summary_description: (contentTitle) =>
116
+ // `Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
117
+ // seo_practice_description: (contentTitle) =>
118
+ // `Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
119
+ // index: 'Оглавление',
120
+ // pages: 'Страницы',
121
+ // search: 'Поиск',
122
+ // language: 'Язык',
123
+ // other: 'Другое',
124
+ // ads_replacer:
125
+ // 'Помогите улучшать проект.<br><strong>Включите показ рекламы!</strong>',
126
+ // theme: 'Тема',
127
+ // theme_system: 'Системная',
128
+ // theme_light: 'Светлая',
129
+ // theme_dark: 'Темная',
130
+ // content: 'Контент',
131
+ // main_page: 'Главная страница',
132
+ // contributors: 'Авторы',
133
+ // contributors_page_description:
134
+ // 'Список людей, которые внесли вклад в материалы проекта: предложили ценные идеи, вносили корректировки в существующий материал или же написали собственный!',
135
+ // contributors_page_invite:
136
+ // 'Вы тоже можете помочь проекту, внести свой вклад и попасть на эту страницу!',
137
+ // become_contributor: 'Стать автором',
138
+ // contributor: 'Автор',
139
+ // contribution: 'Вклад',
140
+ // contributions_explain: (count) =>
141
+ // `Вклад в ${m(count, 'материал', 'материала', 'материалов')}`,
142
+ // contributor_description: (name) =>
143
+ // `Страница с информацией о авторе "${name}" и его вкладе в проект.`,
144
+ // editor: 'Редактор',
145
+ // add_translation: 'Добавить перевод',
146
+ // empty_nav: 'Пустая навигация',
147
+ // popover_dependencies: 'Зависимости',
148
+ // popover_dependencies_description:
149
+ // 'Царского пути в эту тему нет! Вы сможете разобраться только если знаете следующие темы:',
150
+ // to_index: 'К оглавлению',
151
+ // about_book: 'Об учебнике',
152
+ // close: 'Закрыть',
153
+ // back: 'Назад',
154
+ // goto: 'Перейти',
155
+ // error: 'Ошибка!',
156
+ // external_link: 'Внешняя ссылка',
157
+ // external_link_warn: 'Вы собираетесь перейти на внешний ресурс!',
158
+ // internal_link: 'Внутренняя ссылка',
159
+ // internal_link_warn: 'Вы собираетесь перейти на внутреннюю страницу сайта!',
160
+ // book: 'Учебник',
161
+ // group: 'Группа',
162
+ // topic: 'Тема',
163
+ // topics: 'Темы',
164
+ // article: 'Статья',
165
+ // summary: 'Конспект',
166
+ // practice: 'Задачи',
167
+ // element_id: 'ID элемента',
168
+ // preview_missing_title: 'Элемент не найден!',
169
+ // preview_missing_explain:
170
+ // 'Не удалось найти на этой странице элемент с указанным ID!<br>Возможно, ID элемента указан неправильно или элемент был изменен/удален.',
171
+ // preview_missing_explain_mismatch: `Не удалось найти на этой странице элемент с указанным ID!<br>Версия страницы, на которую вела ссылка, отличается от текущей версии страницы!<br>Скорее всего, именно это и является причиной ошибки.`,
172
+ // preview_hash_mismatch_title: 'Несовпадение версий страницы!',
173
+ // preview_hash_mismatch_explain:
174
+ // 'Версия страницы, которую вы видите сейчас отличается от версии страницы, на которую вела исходная ссылка!<br>Содержимое может отличаться от того, что вы ожидали увидеть.',
175
+ // current_page_hash: 'Текущий хеш',
176
+ // expected_page_hash: 'Ожидаемый хеш',
177
+ // empty_toc: 'Пустая таблица содержимого...',
178
+ // no_contributors: 'Авторов нет...',
179
+ // make_contribution: 'Внести свой вклад',
180
+ // material_improvement: 'Улучшение материала',
181
+ // how_to_improve: 'Как улучшить?',
182
+ // edit_page: 'Редактировать страницу',
183
+ // report_problem: 'Сообщить о проблеме',
184
+ // references: 'Источники',
185
+ // reference_source_featured: 'Избранный источник',
186
+ // references_description:
187
+ // 'Список внешних источников, которые использовались при написании этого материала. Если рядом с названием стоит звездочка, то это избранный источник и с ним стоит ознакомиться, если вы хотите глубже погрузиться в материал.',
188
+ // sponsors: 'Спонсоры',
189
+ // sponsors_description:
190
+ // 'Список людей и организаций, которые поддерживают проект финансово. Благодаря им проект может существовать и развиваться. Если вы хотите помочь проекту, то тоже можете стать спонсором и попасть на эту страницу!',
191
+ // become_sponsor: 'Стать спонсором',
192
+ // toc: 'Содержание',
193
+ // mentions: (count: number) =>
194
+ // m(count, 'упоминание', 'упоминания', 'упоминаний'),
195
+ // start_learning: 'Начать изучение!',
196
+ // x_contributors: (count: number) => m(count, 'Автор', 'Автора', 'Авторов'),
197
+ // x_sponsors: (count: number) => m(count, 'Спонсор', 'Спонсора', 'Спонсоров'),
198
+ // show_all: 'Показать все',
199
+ };
200
+
201
+ export default ru;
202
+
203
+ export function m(
204
+ number: number,
205
+ one: string,
206
+ two: string,
207
+ five: string,
208
+ includeNumber = true,
209
+ ) {
210
+ const text = [five, one, two, two, two, five][
211
+ number % 100 > 10 && number % 100 < 20 ? 0 : Math.min(number % 10, 5)
212
+ ]!;
213
+ return includeNumber ? `${number} ${text}` : text;
214
+ }
@@ -0,0 +1,6 @@
1
+ import type { ServerLanguageModules } from './types';
2
+
3
+ export const serverLanguages: ServerLanguageModules = {
4
+ en: () => import('./list/en'),
5
+ ru: () => import('./list/ru'),
6
+ };
@@ -0,0 +1,36 @@
1
+ import { serverLanguages } from './list';
2
+
3
+ export async function setupServerLanguage() {
4
+ ERUDIT.language = {
5
+ phrases: {},
6
+ functions: {},
7
+ };
8
+
9
+ try {
10
+ const targetLanguage = ERUDIT.config.public.project.language.current;
11
+
12
+ if (!targetLanguage.trim()) {
13
+ throw new Error('No language specified in Erudit config!');
14
+ }
15
+
16
+ if (!(targetLanguage in serverLanguages)) {
17
+ throw new Error(`Language ${targetLanguage} is not supported!`);
18
+ }
19
+
20
+ const languageModule = await serverLanguages[targetLanguage]();
21
+
22
+ ERUDIT.language.phrases = languageModule.default;
23
+
24
+ for (const [funcKey, funcValue] of Object.entries(languageModule)) {
25
+ if (typeof funcValue === 'function') {
26
+ ERUDIT.language.functions[funcKey] = funcValue;
27
+ }
28
+ }
29
+
30
+ ERUDIT.log.success(
31
+ `Language "${ERUDIT.log.stress(targetLanguage)}" setup complete!`,
32
+ );
33
+ } catch (error) {
34
+ ERUDIT.log.error(`Failed to setup server language:\n${error}`);
35
+ }
36
+ }
@@ -0,0 +1,16 @@
1
+ import type { EruditLanguageCode } from '@erudit-js/core/eruditConfig/language';
2
+
3
+ export interface EruditServerLanguage {
4
+ phrases: LanguagePhrases;
5
+ functions: Record<string, Function>;
6
+ }
7
+
8
+ export interface ServerLanguageModule {
9
+ default: LanguagePhrases;
10
+ [key: string]: any;
11
+ }
12
+
13
+ export type ServerLanguageModules = Record<
14
+ EruditLanguageCode,
15
+ () => Promise<ServerLanguageModule>
16
+ >;
@@ -0,0 +1,77 @@
1
+ import chalk from 'chalk';
2
+ import { brandColorTitle } from '@erudit-js/core/brandTerminal';
3
+
4
+ interface Logger {
5
+ info(message: any): void;
6
+ start(message: any): void;
7
+ success(message: any): void;
8
+ warn(message: any): void;
9
+ error(message: any): void;
10
+ stress(message: any): string;
11
+ }
12
+
13
+ export type EruditServerLogger = Logger & {
14
+ debug: Logger;
15
+ };
16
+
17
+ export async function setupServerLogger() {
18
+ const serverLogger = createLogger(brandColorTitle + ' Server');
19
+ const serverDebugLogger = createLogger(brandColorTitle + ' Server Debug');
20
+ const debugLogEnabled = !!ERUDIT.config.public.project.debug.log;
21
+
22
+ ERUDIT.log = new Proxy(serverLogger, {
23
+ get(target, prop) {
24
+ if (prop === 'debug') {
25
+ if (!debugLogEnabled) {
26
+ return new Proxy(
27
+ {},
28
+ {
29
+ get() {
30
+ return () => {};
31
+ },
32
+ },
33
+ );
34
+ }
35
+ return serverDebugLogger;
36
+ }
37
+ return target[prop as keyof typeof target];
38
+ },
39
+ }) as EruditServerLogger;
40
+
41
+ ERUDIT.log.success('Logger setup complete!');
42
+ }
43
+
44
+ function createLogger(tag: string): Logger {
45
+ const formattedTag = chalk.gray(`[${tag}]`);
46
+
47
+ return {
48
+ info(message: any) {
49
+ console.log(`${formattedTag} ${chalk.blueBright('ℹ')} ${message}`);
50
+ },
51
+ start(message: any) {
52
+ console.log(
53
+ `${formattedTag} ${chalk.magentaBright('◐')} ${message}`,
54
+ );
55
+ },
56
+ success(message: any) {
57
+ console.log(
58
+ `${formattedTag} ${chalk.greenBright('✔')} ${message}`,
59
+ );
60
+ },
61
+ warn(message: any) {
62
+ console.log(
63
+ `${formattedTag} ${chalk.bgYellowBright.black(' WARN ')} ${message}`,
64
+ );
65
+ },
66
+ error(message: any) {
67
+ console.log();
68
+ console.log(
69
+ `${formattedTag} ${chalk.bgRed.whiteBright(' ERROR ')} ${message}`,
70
+ );
71
+ console.log();
72
+ },
73
+ stress(message: any) {
74
+ return chalk.cyanBright(message);
75
+ },
76
+ };
77
+ }
@@ -0,0 +1,77 @@
1
+ import { inArray } from 'drizzle-orm';
2
+ import { globSync } from 'glob';
3
+ import type { AnySchema, RawElement } from '@jsprose/core';
4
+
5
+ import { resolveEruditProse } from '../prose/repository/resolve';
6
+
7
+ let initialBuild = true;
8
+
9
+ export async function buildNews() {
10
+ ERUDIT.log.debug.start('Building news...');
11
+
12
+ const newsFilenames = new Set<string>();
13
+
14
+ if (initialBuild) {
15
+ initialBuild = false;
16
+ globSync(`[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9].tsx`, {
17
+ posix: true,
18
+ cwd: ERUDIT.config.paths.project + '/news',
19
+ }).forEach((filePath) => newsFilenames.add(filePath));
20
+ } else {
21
+ for (const changedFile of ERUDIT.changedFiles.values()) {
22
+ if (
23
+ changedFile.startsWith(ERUDIT.config.paths.project + '/news/')
24
+ ) {
25
+ const relativePath = changedFile.replace(
26
+ ERUDIT.config.paths.project + '/news/',
27
+ '',
28
+ );
29
+
30
+ if (relativePath.match(/^[0-9]{4}\.[0-9]{2}\.[0-9]{2}\.tsx$/)) {
31
+ newsFilenames.add(relativePath);
32
+ }
33
+ }
34
+ }
35
+
36
+ await ERUDIT.db.delete(ERUDIT.db.schema.news).where(
37
+ inArray(
38
+ ERUDIT.db.schema.news.date,
39
+ Array.from(newsFilenames).map((filename) =>
40
+ filename.replace('.tsx', ''),
41
+ ),
42
+ ),
43
+ );
44
+ }
45
+
46
+ for (const filename of newsFilenames) {
47
+ await buildNewsItem(filename);
48
+ }
49
+ }
50
+
51
+ export async function buildNewsItem(filename: string) {
52
+ ERUDIT.log.debug.start(
53
+ `Building news item ${ERUDIT.log.stress(filename)}...`,
54
+ );
55
+
56
+ try {
57
+ const newsModule = await ERUDIT.import<{
58
+ default: RawElement<AnySchema>;
59
+ }>(`${ERUDIT.config.paths.project}/news/${filename}`);
60
+
61
+ const resolvedProse = await resolveEruditProse(
62
+ newsModule.default,
63
+ false,
64
+ );
65
+
66
+ await ERUDIT.db.insert(ERUDIT.db.schema.news).values({
67
+ date: filename.replace('.tsx', ''),
68
+ prose: resolvedProse.proseElement,
69
+ });
70
+ } catch (error) {
71
+ ERUDIT.log.error(
72
+ `Failed to build news item ${ERUDIT.log.stress(filename)}!\n` +
73
+ String(error),
74
+ );
75
+ return;
76
+ }
77
+ }