erudit 3.0.0-dev.8 → 4.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/app.vue +25 -185
- package/app/assets/icons/array-check.svg +3 -0
- package/app/assets/icons/array-lines.svg +3 -0
- package/app/assets/icons/array-star.svg +3 -0
- package/app/assets/icons/arrow/from-circle.svg +3 -0
- package/app/assets/icons/arrow/left.svg +3 -0
- package/app/assets/icons/arrow/outward-box.svg +3 -0
- package/app/assets/icons/arrow/outward.svg +3 -0
- package/app/assets/icons/arrow/to-circle.svg +3 -0
- package/app/assets/icons/arrow/up-to-right.svg +3 -0
- package/app/assets/icons/aside-open.svg +2 -2
- package/app/assets/icons/asterisk.svg +2 -2
- package/app/assets/icons/bell.svg +3 -0
- package/app/assets/icons/book-outline.svg +3 -0
- package/app/assets/icons/book-question.svg +2 -2
- package/app/assets/icons/book.svg +2 -2
- package/app/assets/icons/box.svg +3 -0
- package/app/assets/icons/bug.svg +2 -2
- package/app/assets/icons/chevron-right.svg +3 -0
- package/app/assets/icons/cog.svg +3 -0
- package/app/assets/icons/construction.svg +2 -2
- package/app/assets/icons/diamond.svg +3 -0
- package/app/assets/icons/draw.svg +2 -2
- package/app/assets/icons/erudit.svg +3 -0
- package/app/assets/icons/file-lines.svg +2 -2
- package/app/assets/icons/files.svg +3 -0
- package/app/assets/icons/flame.svg +3 -0
- package/app/assets/icons/folder-open.svg +2 -2
- package/app/assets/icons/folder.svg +2 -2
- package/app/assets/icons/globe.svg +2 -2
- package/app/assets/icons/graduation.svg +3 -0
- package/app/assets/icons/handshake.svg +3 -0
- package/app/assets/icons/house.svg +2 -2
- package/app/assets/icons/lines.svg +3 -0
- package/app/assets/icons/moon.svg +2 -2
- package/app/assets/icons/plus-circle.svg +2 -2
- package/app/assets/icons/plus.svg +2 -2
- package/app/assets/icons/puzzle.svg +2 -2
- package/app/assets/icons/question-circle.svg +3 -0
- package/app/assets/icons/rocket.svg +3 -0
- package/app/assets/icons/search/check.svg +3 -0
- package/app/assets/icons/search/dead.svg +3 -0
- package/app/assets/icons/search/glass.svg +3 -0
- package/app/assets/icons/search/wtf.svg +3 -0
- package/app/assets/icons/sun-moon.svg +2 -2
- package/app/assets/icons/sun.svg +2 -2
- package/app/assets/icons/translate.svg +3 -0
- package/app/assets/icons/user.svg +2 -2
- package/app/assets/icons/users.svg +2 -2
- package/app/assets/icons/warning.svg +3 -0
- package/app/components/EruditLink.ts +9 -0
- package/app/components/FancyBold.vue +17 -0
- package/app/components/FancyCard.vue +59 -0
- package/app/components/FancyCardTag.vue +16 -0
- package/app/components/Prose.vue +51 -0
- package/app/components/ScrollHolder.vue +20 -0
- package/app/components/SmartMedia.vue +112 -0
- package/app/components/ads/Ads.vue +39 -0
- package/app/components/ads/AdsBannerAside.vue +46 -0
- package/app/components/ads/AdsBannerBottom.vue +17 -0
- package/app/components/ads/AdsReplacer.vue +28 -0
- package/app/components/ads/provider/Custom.vue +19 -0
- package/app/components/ads/provider/Yandex.vue +84 -0
- package/app/components/aside/AsideListItem.vue +66 -74
- package/app/components/aside/AsideMajor.vue +8 -56
- package/app/components/aside/AsideMinor.vue +76 -71
- package/app/components/aside/AsidePlainMessage.vue +9 -0
- package/app/components/aside/AsideSwitch.vue +67 -0
- package/app/components/aside/major/PaneHolder.vue +106 -0
- package/app/components/aside/major/PaneSwitcher.vue +73 -0
- package/app/components/aside/major/PaneSwitcherButton.vue +38 -0
- package/app/components/aside/major/PaneTemplate.vue +5 -0
- package/app/components/aside/major/SiteInfo.vue +68 -85
- package/app/components/aside/major/contentNav/PaneBookNav.vue +116 -0
- package/app/components/aside/major/contentNav/PaneGlobalNav.vue +19 -0
- package/app/components/aside/major/contentNav/items/ContentNavBook.vue +21 -0
- package/app/components/aside/major/contentNav/items/ContentNavFolder.vue +92 -0
- package/app/components/aside/major/contentNav/items/ContentNavItem.vue +33 -0
- package/app/components/aside/major/contentNav/items/ContentNavPage.vue +18 -0
- package/app/components/aside/major/contentNav/items/ContentNavSeparator.vue +62 -0
- package/app/components/aside/major/contentNav/items/ContentNavTopic.vue +18 -0
- package/app/components/aside/major/contentNav/items/Flags.vue +52 -0
- package/app/components/aside/major/contentNav/items/ItemTemplate.vue +27 -0
- package/app/components/aside/major/languages/PaneLanguages.vue +55 -0
- package/app/components/aside/major/pages/PanePages.vue +60 -0
- package/app/components/aside/major/search/PaneSearch.vue +145 -0
- package/app/components/aside/major/search/SearchInput.vue +104 -0
- package/app/components/aside/major/search/SearchResult.vue +103 -0
- package/app/components/aside/major/search/SearchStatus.vue +48 -0
- package/app/components/aside/major/search/search.worker.ts +164 -0
- package/app/components/aside/major/settings/BuildTime.vue +25 -0
- package/app/components/aside/major/settings/EngineVersion.vue +13 -0
- package/app/components/aside/major/settings/PaneSettings.vue +17 -0
- package/app/components/aside/major/settings/ThemeSwitcher.vue +53 -0
- package/app/components/aside/major/settings/repository/Repository.vue +33 -0
- package/app/components/aside/major/settings/repository/SecondaryGitHub.vue +71 -0
- package/app/components/aside/minor/AsideMinorPane.vue +1 -11
- package/app/components/aside/minor/AsideMinorPlainHeader.vue +21 -0
- package/app/components/aside/minor/content/AsideMinorContentContributions.vue +51 -0
- package/app/components/aside/minor/content/AsideMinorContentPage.vue +37 -0
- package/app/components/aside/minor/content/AsideMinorContentTopic.vue +69 -0
- package/app/components/aside/minor/content/ButtonPaneContributions.vue +116 -0
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +121 -0
- package/app/components/aside/minor/content/Contribution.vue +36 -0
- package/app/components/aside/minor/content/Toc.vue +163 -0
- package/app/components/aside/minor/content/TocItem.vue +77 -0
- package/app/components/aside/minor/content/TopicPartButton.vue +35 -0
- package/app/components/aside/minor/contributor/AsideMinorContributor.vue +39 -0
- package/app/components/aside/minor/contributor/ItemBook.vue +39 -0
- package/app/components/aside/minor/contributor/ItemContent.vue +17 -0
- package/app/components/aside/minor/news/AsideMinorNews.vue +133 -0
- package/app/components/aside/minor/news/NewsItem.vue +69 -0
- package/app/components/aside/minor/news/RenderNewsElement.vue +42 -0
- package/app/components/aside/minor/news/elements/Mix.vue +11 -0
- package/app/components/aside/minor/news/elements/P.vue +14 -0
- package/app/components/aside/minor/news/elements/Ref.vue +58 -0
- package/app/components/aside/minor/news/elements/Text.vue +18 -0
- package/app/components/indexPage/IndexPagePersons.vue +117 -0
- package/app/components/main/MainAction.vue +20 -0
- package/app/components/main/MainBreadcrumbs.vue +28 -0
- package/app/components/main/MainContentChild.vue +48 -0
- package/app/components/main/MainContentChildren.vue +14 -0
- package/app/components/main/MainDecoration.vue +15 -0
- package/app/components/main/MainDescription.vue +13 -0
- package/app/components/main/MainFlag.vue +133 -0
- package/app/components/main/MainFlags.vue +17 -0
- package/app/components/main/MainGlow.vue +12 -0
- package/app/components/main/MainQuickLink.vue +76 -0
- package/app/components/main/MainQuickLinks.vue +42 -0
- package/app/components/main/MainQuote.vue +162 -0
- package/app/components/main/MainQuoteLoader.vue +86 -0
- package/app/components/main/MainSection.vue +59 -0
- package/app/components/main/MainSectionPreamble.vue +5 -0
- package/app/components/main/MainSubTitle.vue +12 -0
- package/app/components/main/MainTitle.vue +33 -0
- package/app/components/main/MainTopicPartPage.vue +88 -0
- package/app/components/main/MainTopicPartSwitch.vue +71 -0
- package/app/components/main/connections/Deps.vue +34 -0
- package/app/components/main/connections/Externals.vue +46 -0
- package/app/components/main/connections/MainConnections.vue +41 -0
- package/app/components/main/connections/MainConnectionsButton.vue +80 -0
- package/app/components/main/connections/ScrollPane.vue +11 -0
- package/app/components/main/contentStats/Item.vue +35 -0
- package/app/components/main/contentStats/ItemElement.vue +19 -0
- package/app/components/main/contentStats/ItemMaterials.vue +11 -0
- package/app/components/main/contentStats/MainContentStats.vue +50 -0
- package/app/components/preview/Preview.vue +173 -186
- package/app/components/preview/PreviewError.vue +10 -0
- package/app/components/preview/PreviewLoading.vue +5 -14
- package/app/components/preview/PreviewScreen.vue +65 -141
- package/app/components/preview/PreviewScreenButton.vue +39 -0
- package/app/components/preview/screen/ContentPage.vue +50 -0
- package/app/components/preview/screen/DirectLink.vue +23 -0
- package/app/components/preview/screen/Unique.vue +54 -0
- package/app/components/site/SiteAside.vue +70 -0
- package/app/components/site/SiteAsideOverlay.vue +21 -0
- package/app/components/site/SiteMain.vue +16 -0
- package/app/components/transition/Fade.vue +30 -19
- package/app/components/transition/Slide.vue +47 -0
- package/app/components/tree/TreeContainer.vue +5 -11
- package/app/components/tree/TreeItem.vue +40 -89
- package/app/composables/ads.ts +23 -0
- package/app/composables/analytics.ts +102 -0
- package/app/composables/appElements.ts +40 -0
- package/app/composables/aside.ts +28 -0
- package/app/composables/asideMajorPane.ts +135 -0
- package/app/composables/asideMinor.ts +109 -0
- package/app/composables/contentNav.ts +7 -0
- package/app/composables/favicon.ts +104 -4
- package/app/composables/file.ts +3 -0
- package/app/composables/formatText.ts +85 -71
- package/app/composables/loading.ts +2 -0
- package/app/composables/mainContent.ts +31 -0
- package/app/composables/og.ts +165 -0
- package/app/composables/phrases.ts +126 -81
- package/app/composables/preview.ts +53 -0
- package/app/composables/route.ts +4 -0
- package/app/composables/theme.ts +71 -29
- package/app/composables/url.ts +22 -33
- package/app/formatters/ru.ts +14 -0
- package/app/pages/article/[...articleId].vue +10 -1
- package/app/pages/book/[...bookId].vue +52 -43
- package/app/pages/contributor/[contributorId].vue +151 -0
- package/app/pages/contributors.vue +99 -0
- package/app/pages/group/[...groupId].vue +53 -59
- package/app/pages/index.vue +114 -26
- package/app/pages/page/[...pageId].vue +60 -0
- package/app/pages/practice/[...practiceId].vue +12 -0
- package/app/pages/sponsors.vue +91 -0
- package/app/pages/summary/[...summaryId].vue +10 -1
- package/app/plugins/appSetup/client/htmlBranding.ts +6 -0
- package/app/plugins/appSetup/client/welcome.ts +35 -0
- package/app/plugins/appSetup/config.ts +6 -0
- package/app/plugins/appSetup/global.ts +3 -0
- package/app/plugins/appSetup/index.ts +28 -0
- package/app/plugins/prerender.server.ts +40 -0
- package/app/router.options.ts +5 -0
- package/app/scripts/theme.js +33 -0
- package/app/styles/main.css +173 -0
- package/bin/erudit.mjs +2 -2
- package/modules/erudit/globals/content.ts +4 -0
- package/modules/erudit/globals/contributor.ts +1 -0
- package/modules/erudit/globals/eruditConfig.ts +10 -0
- package/modules/erudit/globals/problem.ts +1 -0
- package/modules/erudit/globals/prose.ts +1 -0
- package/modules/erudit/globals/public.ts +18 -0
- package/modules/erudit/index.ts +60 -0
- package/{module → modules/erudit}/logger.ts +2 -2
- package/modules/erudit/setup/aliases.ts +17 -0
- package/modules/erudit/setup/baseUrl.ts +19 -0
- package/modules/erudit/setup/elements/appTemplate.ts +45 -0
- package/modules/erudit/setup/elements/globalTemplate.ts +82 -0
- package/modules/erudit/setup/elements/globalTypes.ts +273 -0
- package/modules/erudit/setup/elements/setup.ts +167 -0
- package/modules/erudit/setup/elements/shared.ts +10 -0
- package/modules/erudit/setup/elements/tagsTable.ts +28 -0
- package/modules/erudit/setup/fullRestart.ts +71 -0
- package/modules/erudit/setup/globals.ts +196 -0
- package/modules/erudit/setup/nuxtConfig.ts +62 -0
- package/modules/erudit/setup/projectConfig.ts +114 -0
- package/modules/erudit/setup/publicAssets.ts +52 -0
- package/modules/erudit/setup/runtimeConfig.ts +58 -0
- package/modules/erudit/watcher.ts +27 -0
- package/nuxt.config.ts +66 -87
- package/package.json +38 -19
- package/proxy/prose.app.ts +1 -0
- package/proxy/prose.ts +1 -0
- package/public/favicons/default.svg +1 -0
- package/{app/public → public}/logotype.svg +1 -1
- package/public/og.png +0 -0
- package/server/api/aside/major/frontNav/book/[...shortId].ts +10 -0
- package/server/api/aside/major/frontNav/global.ts +5 -0
- package/server/api/aside/major/pages.ts +6 -0
- package/server/api/contributor/list.ts +61 -0
- package/server/api/contributor/page/[contributorId].ts +68 -0
- package/server/api/indexPage.ts +81 -0
- package/server/api/language/functions.ts +6 -7
- package/server/api/language/phrase/[phraseKey].ts +32 -0
- package/server/api/main/content/[...contentTypePath].ts +153 -0
- package/server/api/news/batch/[batchIndex].ts +5 -0
- package/server/api/pageSponsors.ts +58 -0
- package/server/api/prerender/content.ts +82 -0
- package/server/api/prerender/default.ts +35 -0
- package/server/api/prerender/files.ts +10 -0
- package/server/api/prerender/frontNav.ts +13 -0
- package/server/api/prerender/language.ts +7 -0
- package/server/api/prerender/news.ts +8 -0
- package/server/api/prerender/quotes.ts +15 -0
- package/server/api/preview/contentPage/[...contentTypePath].ts +63 -0
- package/server/api/preview/contentUnique/[...contentTypePathUnique].ts +81 -0
- package/server/api/problemScript/[...problemScriptPath].ts +92 -0
- package/server/api/quote/data/[quoteId].ts +87 -0
- package/server/api/quote/ids.ts +3 -0
- package/server/erudit/build.ts +137 -0
- package/server/erudit/cameos/build.ts +111 -0
- package/server/erudit/config.ts +13 -0
- package/server/erudit/content/global/build.ts +271 -0
- package/server/erudit/content/global/singleton.ts +5 -0
- package/server/erudit/content/nav/build.ts +431 -0
- package/server/erudit/content/nav/front.ts +127 -0
- package/server/erudit/content/nav/repository/books.ts +40 -0
- package/server/erudit/content/nav/repository/get.ts +33 -0
- package/server/erudit/content/nav/repository/hasChildren.ts +5 -0
- package/server/erudit/content/nav/repository/hasNav.ts +3 -0
- package/server/erudit/content/nav/repository/hasParent.ts +5 -0
- package/server/erudit/content/nav/repository/id.ts +9 -0
- package/server/erudit/content/nav/repository/index.ts +9 -0
- package/server/erudit/content/nav/repository/order.ts +14 -0
- package/server/erudit/content/nav/repository/previousNext.ts +35 -0
- package/server/erudit/content/nav/repository/walk.ts +127 -0
- package/server/erudit/content/nav/setup.ts +13 -0
- package/server/erudit/content/nav/types.ts +24 -0
- package/server/erudit/content/repository/breadcrumbs.ts +24 -0
- package/server/erudit/content/repository/children.ts +47 -0
- package/server/erudit/content/repository/connections.ts +35 -0
- package/server/erudit/content/repository/contentLink.ts +16 -0
- package/server/erudit/content/repository/decoration.ts +23 -0
- package/server/erudit/content/repository/deps.ts +84 -0
- package/server/erudit/content/repository/description.ts +11 -0
- package/server/erudit/content/repository/elementSnippets.ts +65 -0
- package/server/erudit/content/repository/externals.ts +21 -0
- package/server/erudit/content/repository/flags.ts +33 -0
- package/server/erudit/content/repository/seo.ts +12 -0
- package/server/erudit/content/repository/stats.ts +97 -0
- package/server/erudit/content/repository/title.ts +27 -0
- package/server/erudit/content/repository/topicParts.ts +39 -0
- package/server/erudit/content/repository/unique.ts +76 -0
- package/server/erudit/content/resolve/book.ts +32 -0
- package/server/erudit/content/resolve/group.ts +39 -0
- package/server/erudit/content/resolve/index.ts +139 -0
- package/server/erudit/content/resolve/page.ts +87 -0
- package/server/erudit/content/resolve/topic.ts +185 -0
- package/server/erudit/content/resolve/utils/contentError.ts +10 -0
- package/server/erudit/content/resolve/utils/insertContentItem.ts +122 -0
- package/server/erudit/content/resolve/utils/insertContentResolved.ts +93 -0
- package/server/erudit/content/search.ts +135 -0
- package/server/erudit/contributors/build.ts +111 -0
- package/server/erudit/contributors/global.ts +3 -0
- package/server/erudit/contributors/repository/avatarUrl.ts +10 -0
- package/server/erudit/contributors/repository/contributions.ts +178 -0
- package/server/erudit/contributors/repository/count.ts +3 -0
- package/server/erudit/contributors/search.ts +34 -0
- package/server/erudit/db/repository/pushFile.ts +23 -0
- package/server/erudit/db/repository/pushProblemScript.ts +19 -0
- package/server/erudit/db/repository/pushProseLink.ts +40 -0
- package/server/erudit/db/schema/cameos.ts +7 -0
- package/server/erudit/db/schema/content.ts +18 -0
- package/server/erudit/db/schema/contentContributions.ts +15 -0
- package/server/erudit/db/schema/contentDeps.ts +21 -0
- package/server/erudit/db/schema/contentElementStats.ts +20 -0
- package/server/erudit/db/schema/contentProseLinks.ts +23 -0
- package/server/erudit/db/schema/contentSnippets.ts +16 -0
- package/server/erudit/db/schema/contentToc.ts +16 -0
- package/server/erudit/db/schema/contentUniques.ts +25 -0
- package/server/erudit/db/schema/contributors.ts +12 -0
- package/server/erudit/db/schema/files.ts +11 -0
- package/server/erudit/db/schema/groups.ts +6 -0
- package/server/erudit/db/schema/index.ts +17 -0
- package/server/erudit/db/schema/news.ts +7 -0
- package/server/erudit/db/schema/pages.ts +7 -0
- package/server/erudit/db/schema/problemScripts.ts +14 -0
- package/server/erudit/db/schema/sponsors.ts +9 -0
- package/server/erudit/db/schema/topics.ts +9 -0
- package/server/erudit/db/setup.ts +62 -0
- package/server/erudit/db/types.ts +10 -0
- package/server/erudit/global.ts +33 -0
- package/server/erudit/importer.ts +97 -0
- package/server/erudit/index.ts +90 -0
- package/server/erudit/language/list/en.ts +209 -0
- package/server/erudit/language/list/ru.ts +214 -0
- package/server/erudit/language/list.ts +6 -0
- package/server/erudit/language/setup.ts +36 -0
- package/server/erudit/language/types.ts +16 -0
- package/server/erudit/logger.ts +77 -0
- package/server/erudit/news/build.ts +77 -0
- package/server/erudit/news/repository/batch.ts +61 -0
- package/server/erudit/prose/repository/finalize.ts +68 -0
- package/server/erudit/prose/repository/get.ts +54 -0
- package/server/erudit/prose/repository/resolve.ts +17 -0
- package/server/erudit/prose/storage/callout.ts +14 -0
- package/server/erudit/prose/storage/image.ts +20 -0
- package/server/erudit/prose/storage/link.ts +226 -0
- package/server/erudit/prose/storage/problemScript.ts +21 -0
- package/server/erudit/prose/storage/video.ts +14 -0
- package/server/erudit/prose/transform/bundleProblemScript.ts +6 -0
- package/server/erudit/prose/transform/extensions.ts +15 -0
- package/server/erudit/quote/repository/ids.ts +31 -0
- package/server/erudit/repository.ts +96 -0
- package/server/erudit/sponsors/build.ts +114 -0
- package/server/erudit/sponsors/repository/avatarUrl.ts +10 -0
- package/server/erudit/sponsors/repository/count.ts +4 -0
- package/server/erudit/staticFile.ts +28 -0
- package/server/plugins/augmentCss.ts +17 -0
- package/server/plugins/lang.ts +7 -0
- package/server/plugins/metaViewport.ts +15 -0
- package/server/plugins/theme.ts +13 -0
- package/server/routes/file/[...path].ts +18 -0
- package/server/routes/robots.txt.ts +9 -0
- package/server/routes/search.json.gz.ts +73 -0
- package/server/routes/sitemap.xml.ts +81 -0
- package/shared/search/encoders.ts +20 -0
- package/shared/types/asideMajorPages.ts +4 -0
- package/shared/types/breadcrumbs.ts +9 -0
- package/shared/types/contentChildren.ts +10 -0
- package/shared/types/contentConnections.ts +27 -0
- package/shared/types/contentStats.ts +6 -0
- package/shared/types/elementSnippet.ts +8 -0
- package/shared/types/frontContentNav.ts +38 -0
- package/shared/types/indexPage.ts +20 -0
- package/shared/types/language.ts +189 -75
- package/shared/types/mainContent.ts +69 -0
- package/shared/types/news.ts +13 -0
- package/shared/types/preview.ts +28 -0
- package/shared/types/runtimeConfig.ts +64 -0
- package/shared/types/search.ts +79 -0
- package/shared/utils/contentTypePath.ts +63 -0
- package/shared/utils/icons.ts +11 -0
- package/shared/utils/pages.ts +24 -0
- package/shared/utils/slasher.ts +64 -0
- package/shared/utils/stringColor.ts +13 -9
- package/shared/utils/toStringEqual.ts +21 -0
- package/shared/utils/zip.ts +64 -0
- package/test/shared/utils/slasher.test.ts +75 -0
- package/test/shared/utils/zip.test.ts +8 -0
- package/tsconfig.json +17 -8
- package/app/assets/icons/alert.svg +0 -3
- package/app/assets/icons/angle-right.svg +0 -3
- package/app/assets/icons/arrow-in-text.svg +0 -3
- package/app/assets/icons/arrow-left.svg +0 -3
- package/app/assets/icons/arrow-up-to-right.svg +0 -3
- package/app/assets/icons/chip.svg +0 -3
- package/app/assets/icons/circle-help.svg +0 -3
- package/app/assets/icons/cross.svg +0 -3
- package/app/assets/icons/ellipsis-vertical.svg +0 -3
- package/app/assets/icons/file-check.svg +0 -3
- package/app/assets/icons/file-star.svg +0 -3
- package/app/assets/icons/link-external.svg +0 -3
- package/app/assets/icons/link.svg +0 -3
- package/app/assets/icons/outline/book.svg +0 -3
- package/app/assets/icons/outline/file-lines.svg +0 -3
- package/app/assets/icons/pirate.svg +0 -3
- package/app/assets/icons/search.svg +0 -3
- package/app/assets/icons/shuffle.svg +0 -3
- package/app/assets/icons/star.svg +0 -3
- package/app/components/Loading.vue +0 -23
- package/app/components/SiteAside.vue +0 -393
- package/app/components/SiteMain.vue +0 -34
- package/app/components/ads/BannerTemplate.vue +0 -51
- package/app/components/ads/BottomBanner.vue +0 -45
- package/app/components/ads/LeftBanner.vue +0 -50
- package/app/components/aside/major/PaneContentScroll.vue +0 -23
- package/app/components/aside/major/PaneSwitch.vue +0 -54
- package/app/components/aside/major/PaneSwitchButton.vue +0 -63
- package/app/components/aside/major/panes/Language.vue +0 -79
- package/app/components/aside/major/panes/Pages.vue +0 -34
- package/app/components/aside/major/panes/Search.vue +0 -11
- package/app/components/aside/major/panes/nav/Nav.vue +0 -87
- package/app/components/aside/major/panes/nav/NavBook.vue +0 -87
- package/app/components/aside/major/panes/nav/NavBookLoading.vue +0 -24
- package/app/components/aside/major/panes/nav/NavGlobal.vue +0 -16
- package/app/components/aside/major/panes/nav/fnav/FNav.vue +0 -105
- package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +0 -32
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +0 -40
- package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +0 -60
- package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +0 -34
- package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +0 -80
- package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +0 -24
- package/app/components/aside/major/panes/other/ItemContent.vue +0 -29
- package/app/components/aside/major/panes/other/ItemGenerator.vue +0 -15
- package/app/components/aside/major/panes/other/ItemTheme.vue +0 -54
- package/app/components/aside/major/panes/other/Other.vue +0 -16
- package/app/components/aside/minor/AsideMinorContributor.vue +0 -5
- package/app/components/aside/minor/AsideMinorNews.vue +0 -11
- package/app/components/aside/minor/AsideMinorTopLink.vue +0 -67
- package/app/components/aside/minor/Contribute.vue +0 -145
- package/app/components/aside/minor/content/AsideMinorContent.vue +0 -92
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +0 -32
- package/app/components/aside/minor/topic/TopicContributors.vue +0 -177
- package/app/components/aside/minor/topic/TopicNav.vue +0 -49
- package/app/components/aside/minor/topic/TopicToc.vue +0 -219
- package/app/components/aside/minor/topic/TopicTocItem.vue +0 -30
- package/app/components/aside/utils/AsideOverlayPane.vue +0 -40
- package/app/components/bitran/BitranContent.vue +0 -77
- package/app/components/bitran/RenderWrapper.vue +0 -10
- package/app/components/contributor/ContributorAvatar.vue +0 -43
- package/app/components/contributor/ContributorListItem.vue +0 -35
- package/app/components/main/topic/MainTopic.vue +0 -78
- package/app/components/main/topic/TopicPartSwitch.vue +0 -118
- package/app/components/main/utils/Breadcrumb.vue +0 -70
- package/app/components/main/utils/ContentDecoration.vue +0 -29
- package/app/components/main/utils/ContentDescription.vue +0 -19
- package/app/components/main/utils/ContentPopover.vue +0 -188
- package/app/components/main/utils/ContentPopovers.vue +0 -111
- package/app/components/main/utils/ContentReferences.vue +0 -70
- package/app/components/main/utils/ContentSection.vue +0 -45
- package/app/components/main/utils/ContentTitle.vue +0 -63
- package/app/components/main/utils/reference/ReferenceGroup.vue +0 -38
- package/app/components/main/utils/reference/ReferenceItem.vue +0 -68
- package/app/components/main/utils/reference/ReferenceSource.vue +0 -116
- package/app/components/preview/PreviewDisplay.vue +0 -139
- package/app/components/preview/PreviewFooterAction.vue +0 -73
- package/app/components/preview/display/Alert.vue +0 -50
- package/app/components/preview/display/Custom.vue +0 -18
- package/app/components/preview/display/GenericLink.vue +0 -48
- package/app/components/preview/display/PageLink.vue +0 -20
- package/app/components/preview/display/Unique.vue +0 -55
- package/app/composables/bitran.ts +0 -105
- package/app/composables/bitranContent.ts +0 -51
- package/app/composables/bitranLocation.ts +0 -7
- package/app/composables/contentData.ts +0 -36
- package/app/composables/contentPage.ts +0 -157
- package/app/composables/contentRoute.ts +0 -45
- package/app/composables/darkMagic.ts +0 -24
- package/app/composables/externalApi.ts +0 -63
- package/app/composables/majorPane.ts +0 -60
- package/app/pages/_test/preview.vue +0 -110
- package/app/pages/members.vue +0 -6
- package/app/pages/practice/[...practice].vue +0 -3
- package/app/public/favicon/article.svg +0 -10
- package/app/public/favicon/default.svg +0 -10
- package/app/public/favicon/practice.svg +0 -10
- package/app/public/favicon/summary.svg +0 -10
- package/app/public/og-default.png +0 -0
- package/app/public/user.svg +0 -10
- package/app/scripts/_immediate.js +0 -9
- package/app/scripts/aside/index.ts +0 -59
- package/app/scripts/aside/major/nav.ts +0 -26
- package/app/scripts/aside/minor/state.ts +0 -37
- package/app/scripts/aside/minor/topic.ts +0 -3
- package/app/scripts/flag.ts +0 -28
- package/app/scripts/og.ts +0 -27
- package/app/scripts/preview/build.ts +0 -73
- package/app/scripts/preview/data/alert.ts +0 -19
- package/app/scripts/preview/data/custom.ts +0 -8
- package/app/scripts/preview/data/genericLink.ts +0 -24
- package/app/scripts/preview/data/pageLink.ts +0 -22
- package/app/scripts/preview/data/unique.ts +0 -72
- package/app/scripts/preview/data.ts +0 -24
- package/app/scripts/preview/display.ts +0 -37
- package/app/scripts/preview/footer.ts +0 -9
- package/app/scripts/preview/request.ts +0 -51
- package/app/scripts/preview/state.ts +0 -63
- package/app/styles/_immediate.css +0 -7
- package/app/styles/_util.scss +0 -43
- package/app/styles/_utils.scss +0 -44
- package/app/styles/app.scss +0 -91
- package/app/styles/def/_bp.scss +0 -27
- package/app/styles/def/_size.scss +0 -7
- package/app/styles/def/_z.scss +0 -5
- package/app/styles/normalize.scss +0 -63
- package/app/styles/partials/_darkMagic.scss +0 -5
- package/app/styles/partials/_fnav.scss +0 -15
- package/app/styles/partials/_preview.scss +0 -5
- package/globalPath.ts +0 -21
- package/globals/bitran.ts +0 -2
- package/globals/content.ts +0 -22
- package/globals/contributor.ts +0 -5
- package/globals/erudit.ts +0 -5
- package/globals/register.ts +0 -18
- package/languages/en.ts +0 -95
- package/languages/ru.ts +0 -99
- package/module/bitran.ts +0 -36
- package/module/config.ts +0 -35
- package/module/imports.ts +0 -50
- package/module/index.ts +0 -47
- package/module/paths.ts +0 -22
- package/module/restart.ts +0 -61
- package/server/api/aside/major/nav/bookIds.ts +0 -5
- package/server/api/aside/major/nav/bookNav/[...bookId].ts +0 -20
- package/server/api/aside/major/nav/global.ts +0 -7
- package/server/api/aside/minor/news.ts +0 -7
- package/server/api/aside/minor/path.ts +0 -77
- package/server/api/bitran/content/[location].ts +0 -8
- package/server/api/bitran/toc/[location].ts +0 -7
- package/server/api/content/data.ts +0 -72
- package/server/api/contributor/count.ts +0 -6
- package/server/api/fake/content.ts +0 -11
- package/server/api/fake/shared/languages.ts +0 -12
- package/server/api/language/phrase/[phraseId].ts +0 -19
- package/server/api/language/phraseIds.ts +0 -8
- package/server/api/preview/page/[...parts].ts +0 -52
- package/server/api/preview/unique/[location].ts +0 -60
- package/server/plugin/bitran/content.ts +0 -194
- package/server/plugin/bitran/location.ts +0 -25
- package/server/plugin/bitran/products/include.ts +0 -228
- package/server/plugin/bitran/products/link.ts +0 -116
- package/server/plugin/bitran/setup.ts +0 -11
- package/server/plugin/bitran/toc.ts +0 -75
- package/server/plugin/bitran/transpiler.ts +0 -30
- package/server/plugin/build/close.ts +0 -10
- package/server/plugin/build/jobs/content/builderArgs.ts +0 -8
- package/server/plugin/build/jobs/content/generic.ts +0 -176
- package/server/plugin/build/jobs/content/parse.ts +0 -109
- package/server/plugin/build/jobs/content/path.ts +0 -6
- package/server/plugin/build/jobs/content/type/book.ts +0 -9
- package/server/plugin/build/jobs/content/type/group.ts +0 -37
- package/server/plugin/build/jobs/content/type/topic.ts +0 -36
- package/server/plugin/build/jobs/contributors.ts +0 -66
- package/server/plugin/build/jobs/language.ts +0 -36
- package/server/plugin/build/jobs/nav.ts +0 -214
- package/server/plugin/build/process.ts +0 -25
- package/server/plugin/build/rebuild.ts +0 -55
- package/server/plugin/build/setup.ts +0 -22
- package/server/plugin/content/absoluteId.ts +0 -94
- package/server/plugin/content/context.ts +0 -116
- package/server/plugin/db/entities/Book.ts +0 -7
- package/server/plugin/db/entities/Content.ts +0 -49
- package/server/plugin/db/entities/Contribution.ts +0 -10
- package/server/plugin/db/entities/Contributor.ts +0 -16
- package/server/plugin/db/entities/Group.ts +0 -14
- package/server/plugin/db/entities/Hash.ts +0 -15
- package/server/plugin/db/entities/Topic.ts +0 -20
- package/server/plugin/db/entities/Unique.ts +0 -21
- package/server/plugin/db/setup.ts +0 -34
- package/server/plugin/global.ts +0 -17
- package/server/plugin/importer.ts +0 -12
- package/server/plugin/index.ts +0 -9
- package/server/plugin/logger.ts +0 -23
- package/server/plugin/nav/node.ts +0 -26
- package/server/plugin/nav/utils.ts +0 -129
- package/server/plugin/repository/book.ts +0 -21
- package/server/plugin/repository/content.ts +0 -238
- package/server/plugin/repository/contributor.ts +0 -8
- package/server/plugin/repository/frontNav.ts +0 -148
- package/server/plugin/repository/topic.ts +0 -32
- package/server/tsconfig.json +0 -9
- package/shared/aside/minor.ts +0 -51
- package/shared/asset.ts +0 -15
- package/shared/bitran/stringContent.ts +0 -6
- package/shared/bitran/toc.ts +0 -8
- package/shared/content/context.ts +0 -9
- package/shared/content/data/base.ts +0 -32
- package/shared/content/data/index.ts +0 -5
- package/shared/content/data/type/book.ts +0 -5
- package/shared/content/data/type/group.ts +0 -6
- package/shared/content/data/type/topic.ts +0 -11
- package/shared/content/previousNext.ts +0 -9
- package/shared/contributor.ts +0 -5
- package/shared/frontNav.ts +0 -41
- package/shared/icons.ts +0 -38
- package/shared/image.ts +0 -5
- package/shared/link.ts +0 -28
- package/shared/popover.ts +0 -8
- package/shared/utils/objectsEqual.ts +0 -4
- package/utils/stress.ts +0 -9
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { isTopicPart } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
parseBitranLocation,
|
|
5
|
-
stringifyBitranLocation,
|
|
6
|
-
type BitranLocation,
|
|
7
|
-
} from '@erudit-js/cog/schema';
|
|
8
|
-
import { getNavBookOf } from '../nav/utils';
|
|
9
|
-
|
|
10
|
-
export function toAbsoluteContentLocation<T extends string | BitranLocation>(
|
|
11
|
-
location: T,
|
|
12
|
-
contextContentId: string,
|
|
13
|
-
): T {
|
|
14
|
-
const isLocationStr = typeof location === 'string';
|
|
15
|
-
const parsedLocation = isLocationStr
|
|
16
|
-
? parseBitranLocation(location)
|
|
17
|
-
: (location as BitranLocation);
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
isTopicPart(parsedLocation.type) ||
|
|
21
|
-
['book', 'group', 'topic'].includes(parsedLocation.type)
|
|
22
|
-
) {
|
|
23
|
-
parsedLocation.path = toAbsoluteContentId(
|
|
24
|
-
parsedLocation.path!,
|
|
25
|
-
contextContentId,
|
|
26
|
-
);
|
|
27
|
-
return (
|
|
28
|
-
isLocationStr
|
|
29
|
-
? stringifyBitranLocation(parsedLocation)
|
|
30
|
-
: parsedLocation
|
|
31
|
-
) as T;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return location;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function toAbsoluteContentId(
|
|
38
|
-
path: string,
|
|
39
|
-
contextContentId: string = '',
|
|
40
|
-
) {
|
|
41
|
-
const fullPath = (() => {
|
|
42
|
-
if (path.startsWith('..'))
|
|
43
|
-
return (contextContentId ? contextContentId + '/' : '') + path;
|
|
44
|
-
|
|
45
|
-
if (path.startsWith('.'))
|
|
46
|
-
return trimEdgeSlashes(contextContentId + path.substring(1));
|
|
47
|
-
|
|
48
|
-
if (path.startsWith('~'))
|
|
49
|
-
return trimEdgeSlashes(
|
|
50
|
-
tryGetParentBook(contextContentId) + path.substring(1),
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return path;
|
|
54
|
-
})();
|
|
55
|
-
|
|
56
|
-
const reversePathParts = fullPath.split('/').reverse();
|
|
57
|
-
const finalParts: string[] = [];
|
|
58
|
-
|
|
59
|
-
let skipCounter = 0;
|
|
60
|
-
|
|
61
|
-
for (let i = 0; i < reversePathParts.length; i++) {
|
|
62
|
-
const part = reversePathParts[i];
|
|
63
|
-
|
|
64
|
-
if (part === '..') {
|
|
65
|
-
skipCounter++;
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (skipCounter) {
|
|
70
|
-
skipCounter--;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
finalParts.unshift(part!);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return finalParts.join('/');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function trimEdgeSlashes(path: string) {
|
|
81
|
-
if (path.startsWith('/')) path = path.substring(1);
|
|
82
|
-
|
|
83
|
-
if (path.endsWith('/')) path = path.substring(0, path.length - 1);
|
|
84
|
-
|
|
85
|
-
return path;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function tryGetParentBook(contentId: string): string {
|
|
89
|
-
const navBook = getNavBookOf(contentId);
|
|
90
|
-
|
|
91
|
-
if (!navBook) return '';
|
|
92
|
-
|
|
93
|
-
return navBook.id;
|
|
94
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isContentType,
|
|
3
|
-
isTopicPart,
|
|
4
|
-
type BitranLocation,
|
|
5
|
-
type TopicPart,
|
|
6
|
-
} from '@erudit-js/cog/schema';
|
|
7
|
-
|
|
8
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
9
|
-
import { getIdsUp, isSkipId } from '@server/nav/utils';
|
|
10
|
-
import { DbContent } from '@server/db/entities/Content';
|
|
11
|
-
import { DbContributor } from '@server/db/entities/Contributor';
|
|
12
|
-
|
|
13
|
-
import type { Context } from '@shared/content/context';
|
|
14
|
-
import {
|
|
15
|
-
createContentLink,
|
|
16
|
-
createContributorLink,
|
|
17
|
-
createTopicPartLink,
|
|
18
|
-
} from '@shared/link';
|
|
19
|
-
import { CONTENT_TYPE_ICON, ICON, TOPIC_PART_ICON } from '@erudit/shared/icons';
|
|
20
|
-
|
|
21
|
-
export async function getContentContext(contentId: string): Promise<Context> {
|
|
22
|
-
const context: Context = [];
|
|
23
|
-
|
|
24
|
-
for (const _contentId of (await getIdsUp(contentId)).reverse()) {
|
|
25
|
-
const dbContent = await getDbContent(_contentId);
|
|
26
|
-
|
|
27
|
-
context.push({
|
|
28
|
-
type: ERUDIT_SERVER.LANGUAGE.phrases[dbContent.type],
|
|
29
|
-
icon: isTopicPart(dbContent.type)
|
|
30
|
-
? TOPIC_PART_ICON[dbContent.type]
|
|
31
|
-
: isContentType(dbContent.type)
|
|
32
|
-
? CONTENT_TYPE_ICON[dbContent.type]
|
|
33
|
-
: '',
|
|
34
|
-
title: dbContent.title || dbContent.contentId,
|
|
35
|
-
href: createContentLink(dbContent.type, dbContent.contentId),
|
|
36
|
-
hidden: await isSkipId(dbContent.contentId),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return context;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function getTopicPartContext(
|
|
44
|
-
topicPart: TopicPart,
|
|
45
|
-
contentId: string,
|
|
46
|
-
): Promise<Context> {
|
|
47
|
-
const context = await getContentContext(contentId);
|
|
48
|
-
const topicItem = context.pop()!;
|
|
49
|
-
|
|
50
|
-
topicItem.type = ERUDIT_SERVER.LANGUAGE.phrases[topicPart];
|
|
51
|
-
topicItem.icon = TOPIC_PART_ICON[topicPart];
|
|
52
|
-
topicItem.href = createTopicPartLink(topicPart, contentId);
|
|
53
|
-
|
|
54
|
-
return context.concat([topicItem]);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export async function getContributorContext(
|
|
58
|
-
contributorId: string,
|
|
59
|
-
): Promise<Context> {
|
|
60
|
-
const dbContributor = await ERUDIT_SERVER.DB.manager.findOne(
|
|
61
|
-
DbContributor,
|
|
62
|
-
{
|
|
63
|
-
select: ['displayName'],
|
|
64
|
-
where: { contributorId },
|
|
65
|
-
},
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
if (!dbContributor)
|
|
69
|
-
throw new Error(`Contributor "${contributorId}" not found!`);
|
|
70
|
-
|
|
71
|
-
return [
|
|
72
|
-
{
|
|
73
|
-
type: ERUDIT_SERVER.LANGUAGE.phrases.contributor,
|
|
74
|
-
icon: ICON.contributor,
|
|
75
|
-
title: dbContributor.displayName || contributorId,
|
|
76
|
-
href: createContributorLink(contributorId),
|
|
77
|
-
hidden: false,
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export async function getLocationContext(
|
|
83
|
-
location: BitranLocation,
|
|
84
|
-
): Promise<Context> {
|
|
85
|
-
const contentId = location.path!;
|
|
86
|
-
|
|
87
|
-
switch (location.type) {
|
|
88
|
-
case 'article':
|
|
89
|
-
case 'summary':
|
|
90
|
-
case 'practice':
|
|
91
|
-
return await getTopicPartContext(location.type, contentId);
|
|
92
|
-
case 'group':
|
|
93
|
-
return await getContentContext(contentId);
|
|
94
|
-
case 'contributor':
|
|
95
|
-
return await getContributorContext(contentId);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
throw new Error(
|
|
99
|
-
`Cant' build context for location unknown type "${location.type}"!`,
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
async function getDbContent(contentId: string): Promise<DbContent> {
|
|
108
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
109
|
-
select: ['type', 'title', 'fullId', 'contentId'],
|
|
110
|
-
where: { contentId },
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
if (!dbContent) throw new Error(`Content "${contentId}" not found!`);
|
|
114
|
-
|
|
115
|
-
return dbContent;
|
|
116
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
|
|
2
|
-
import type {
|
|
3
|
-
ContentFlag,
|
|
4
|
-
ContentReferences,
|
|
5
|
-
ContentSeo,
|
|
6
|
-
ContentType,
|
|
7
|
-
} from '@erudit-js/cog/schema';
|
|
8
|
-
|
|
9
|
-
import type { ImageData } from '@erudit/shared/image';
|
|
10
|
-
|
|
11
|
-
@Entity('content')
|
|
12
|
-
export class DbContent {
|
|
13
|
-
@PrimaryColumn('varchar')
|
|
14
|
-
contentId!: string;
|
|
15
|
-
|
|
16
|
-
@Column('varchar')
|
|
17
|
-
@Index({ unique: true })
|
|
18
|
-
fullId!: string;
|
|
19
|
-
|
|
20
|
-
@Column('varchar')
|
|
21
|
-
type!: ContentType;
|
|
22
|
-
|
|
23
|
-
@Column('varchar', { nullable: true })
|
|
24
|
-
title?: string;
|
|
25
|
-
|
|
26
|
-
@Column('varchar', { nullable: true })
|
|
27
|
-
navTitle?: string;
|
|
28
|
-
|
|
29
|
-
@Column('text', { nullable: true })
|
|
30
|
-
description?: string;
|
|
31
|
-
|
|
32
|
-
@Column('simple-json', { nullable: true })
|
|
33
|
-
flags?: Partial<Record<ContentFlag, boolean>>;
|
|
34
|
-
|
|
35
|
-
@Column('varchar', { nullable: true })
|
|
36
|
-
decoration?: string;
|
|
37
|
-
|
|
38
|
-
@Column('simple-json', { nullable: true })
|
|
39
|
-
seo?: Partial<ContentSeo>;
|
|
40
|
-
|
|
41
|
-
@Column('simple-json', { nullable: true })
|
|
42
|
-
ogImage?: ImageData;
|
|
43
|
-
|
|
44
|
-
@Column('simple-array', { nullable: true })
|
|
45
|
-
dependencies?: string[];
|
|
46
|
-
|
|
47
|
-
@Column('simple-json', { nullable: true })
|
|
48
|
-
references?: ContentReferences;
|
|
49
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity('contributor')
|
|
4
|
-
export class DbContributor {
|
|
5
|
-
@PrimaryColumn('varchar')
|
|
6
|
-
contributorId!: string;
|
|
7
|
-
|
|
8
|
-
@Column('varchar', { nullable: true })
|
|
9
|
-
displayName?: string;
|
|
10
|
-
|
|
11
|
-
@Column('text', { nullable: true })
|
|
12
|
-
description?: string;
|
|
13
|
-
|
|
14
|
-
@Column('varchar', { nullable: true })
|
|
15
|
-
avatar?: string;
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
2
|
-
import type { GroupType } from '@erudit-js/cog/schema';
|
|
3
|
-
|
|
4
|
-
@Entity('group')
|
|
5
|
-
export class DbGroup {
|
|
6
|
-
@PrimaryColumn('varchar')
|
|
7
|
-
contentId!: string;
|
|
8
|
-
|
|
9
|
-
@Column('varchar')
|
|
10
|
-
type!: GroupType;
|
|
11
|
-
|
|
12
|
-
@Column('text', { nullable: true })
|
|
13
|
-
content?: string;
|
|
14
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* TODO:
|
|
5
|
-
* Create hash of Bitran content of content items and use it to distinguish between content item version.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
@Entity('hash')
|
|
9
|
-
export class DbHash {
|
|
10
|
-
@PrimaryColumn('varchar')
|
|
11
|
-
id!: string;
|
|
12
|
-
|
|
13
|
-
@Column('varchar')
|
|
14
|
-
hash!: string;
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
2
|
-
import type { TopicPart } from '@erudit-js/cog/schema';
|
|
3
|
-
|
|
4
|
-
@Entity('topic')
|
|
5
|
-
export class DbTopic {
|
|
6
|
-
@PrimaryColumn('varchar')
|
|
7
|
-
contentId!: string;
|
|
8
|
-
|
|
9
|
-
@Column('simple-array')
|
|
10
|
-
parts!: TopicPart[];
|
|
11
|
-
|
|
12
|
-
@Column('text', { nullable: true })
|
|
13
|
-
article?: string;
|
|
14
|
-
|
|
15
|
-
@Column('text', { nullable: true })
|
|
16
|
-
summary?: string;
|
|
17
|
-
|
|
18
|
-
@Column('text', { nullable: true })
|
|
19
|
-
practice?: string;
|
|
20
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
import type { BitranContext } from '@erudit/shared/bitran/context';
|
|
4
|
-
|
|
5
|
-
@Entity('unique')
|
|
6
|
-
export class DbUnique {
|
|
7
|
-
@PrimaryColumn('varchar')
|
|
8
|
-
location!: string;
|
|
9
|
-
|
|
10
|
-
@Column('varchar')
|
|
11
|
-
productName!: string;
|
|
12
|
-
|
|
13
|
-
@Column('text')
|
|
14
|
-
content!: string;
|
|
15
|
-
|
|
16
|
-
@Column('simple-json')
|
|
17
|
-
context!: BitranContext;
|
|
18
|
-
|
|
19
|
-
@Column('varchar', { nullable: true })
|
|
20
|
-
title?: string;
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { DataSource } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
import { PROJECT_DIR } from '#erudit/globalPaths';
|
|
4
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
5
|
-
|
|
6
|
-
// Database Entities
|
|
7
|
-
import { DbContributor } from './entities/Contributor';
|
|
8
|
-
import { DbBook } from './entities/Book';
|
|
9
|
-
import { DbContent } from './entities/Content';
|
|
10
|
-
import { DbContribution } from './entities/Contribution';
|
|
11
|
-
import { DbGroup } from './entities/Group';
|
|
12
|
-
import { DbHash } from './entities/Hash';
|
|
13
|
-
import { DbTopic } from './entities/Topic';
|
|
14
|
-
import { DbUnique } from './entities/Unique';
|
|
15
|
-
|
|
16
|
-
export async function setupDatabase() {
|
|
17
|
-
ERUDIT_SERVER.DB = new DataSource({
|
|
18
|
-
type: 'sqlite',
|
|
19
|
-
database: PROJECT_DIR + '/.erudit/data.sqlite',
|
|
20
|
-
synchronize: true,
|
|
21
|
-
entities: [
|
|
22
|
-
DbBook,
|
|
23
|
-
DbContent,
|
|
24
|
-
DbContribution,
|
|
25
|
-
DbContributor,
|
|
26
|
-
DbGroup,
|
|
27
|
-
DbHash,
|
|
28
|
-
DbTopic,
|
|
29
|
-
DbUnique,
|
|
30
|
-
],
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
await ERUDIT_SERVER.DB.initialize();
|
|
34
|
-
}
|
package/server/plugin/global.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { DataSource } from 'typeorm';
|
|
2
|
-
import type { EruditBitranConfig, EruditConfig } from '@erudit-js/cog/schema';
|
|
3
|
-
|
|
4
|
-
import type { EruditPhrases } from '@shared/types/language';
|
|
5
|
-
import type { NavNode, RootNavNode } from '@server/nav/node';
|
|
6
|
-
|
|
7
|
-
interface EruditServer {
|
|
8
|
-
BUILD_PROMISE: Promise<void>;
|
|
9
|
-
CONFIG: Partial<EruditConfig>;
|
|
10
|
-
LANGUAGE: { phrases: EruditPhrases; functions: Record<string, Function> };
|
|
11
|
-
DB: DataSource;
|
|
12
|
-
NAV?: RootNavNode;
|
|
13
|
-
NAV_BOOKS?: Record<string, NavNode>;
|
|
14
|
-
BITRAN_CONFIG?: Partial<EruditBitranConfig>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const ERUDIT_SERVER: EruditServer = {} as any;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createJiti } from 'jiti';
|
|
2
|
-
import { ERUDIT_DIR } from '#erudit/globalPaths';
|
|
3
|
-
|
|
4
|
-
const jiti = createJiti(ERUDIT_DIR, {
|
|
5
|
-
// Enable reimporting same files during process in development mode
|
|
6
|
-
fsCache: !import.meta.dev,
|
|
7
|
-
moduleCache: !import.meta.dev,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export async function IMPORT(...args: Parameters<typeof jiti.import>) {
|
|
11
|
-
return jiti.import(...args) as Promise<any>;
|
|
12
|
-
}
|
package/server/plugin/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ERUDIT_SERVER } from './global';
|
|
2
|
-
import { build } from './build/process';
|
|
3
|
-
import { close } from './build/close';
|
|
4
|
-
|
|
5
|
-
export default defineNitroPlugin((_nitro) => {
|
|
6
|
-
ERUDIT_SERVER.BUILD_PROMISE = build();
|
|
7
|
-
_nitro.hooks.hook('request', async () => await ERUDIT_SERVER.BUILD_PROMISE);
|
|
8
|
-
_nitro.hooks.hook('close', close);
|
|
9
|
-
});
|
package/server/plugin/logger.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { createConsola } from 'consola';
|
|
3
|
-
import { brandColorTitle } from '@erudit-js/cog/utils/brandNode';
|
|
4
|
-
|
|
5
|
-
import eruditConfig from '#erudit/config';
|
|
6
|
-
|
|
7
|
-
// TODO: Consola has buggy behaviour when called inside Nitro
|
|
8
|
-
// @see https://github.com/nitrojs/nitro/issues/3079
|
|
9
|
-
|
|
10
|
-
export const logger = createConsola({
|
|
11
|
-
defaults: {
|
|
12
|
-
//tag: brandColorTitle + ' Server',
|
|
13
|
-
message: chalk.gray(`[${brandColorTitle} Server]`),
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const debug = createConsola({
|
|
18
|
-
defaults: {
|
|
19
|
-
//tag: brandColorTitle + ' Server Debug',
|
|
20
|
-
message: chalk.gray(`[${brandColorTitle} Server Debug]`),
|
|
21
|
-
level: eruditConfig?.debug?.log ? 3 : -999,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ContentType } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
export interface NavNode {
|
|
4
|
-
type: ContentType;
|
|
5
|
-
path: string;
|
|
6
|
-
id: string;
|
|
7
|
-
fullId: string;
|
|
8
|
-
skip: boolean;
|
|
9
|
-
children?: NavNode[];
|
|
10
|
-
parent?: NavNode | RootNavNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface RootNavNode {
|
|
14
|
-
type: '#root';
|
|
15
|
-
children?: NavNode[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function isRootNode(node: NavNode | RootNavNode) {
|
|
19
|
-
return node?.type === '#root';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function createRootNode(): RootNavNode {
|
|
23
|
-
return {
|
|
24
|
-
type: '#root',
|
|
25
|
-
};
|
|
26
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
2
|
-
import { isRootNode, type NavNode } from '@server/nav/node';
|
|
3
|
-
|
|
4
|
-
export async function walkNav(
|
|
5
|
-
step: (node: NavNode) => Promise<void | false>,
|
|
6
|
-
from: NavNode | typeof ERUDIT_SERVER.NAV = ERUDIT_SERVER.NAV,
|
|
7
|
-
) {
|
|
8
|
-
if (!from) return;
|
|
9
|
-
|
|
10
|
-
const stepResult = isRootNode(from) ? true : await step(from);
|
|
11
|
-
|
|
12
|
-
if (stepResult !== false)
|
|
13
|
-
if (from.children)
|
|
14
|
-
for (const child of from.children) await walkNav(step, child);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
export function getNavBookOf(target: string | NavNode): NavNode | undefined {
|
|
22
|
-
const id = typeof target === 'string' ? target : target.id;
|
|
23
|
-
|
|
24
|
-
if (!id || !ERUDIT_SERVER.NAV_BOOKS) return undefined;
|
|
25
|
-
|
|
26
|
-
const idParts = id.split('/');
|
|
27
|
-
|
|
28
|
-
while (idParts.length > 0) {
|
|
29
|
-
const book = ERUDIT_SERVER.NAV_BOOKS[idParts.join('/')];
|
|
30
|
-
|
|
31
|
-
if (book) return book;
|
|
32
|
-
|
|
33
|
-
idParts.pop();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function getPreviousNextNav(contentId: string) {
|
|
40
|
-
let previousNav: NavNode | undefined, nextNav: NavNode | undefined;
|
|
41
|
-
let book: NavNode | undefined;
|
|
42
|
-
let finish = false;
|
|
43
|
-
|
|
44
|
-
await walkNav(async (navNode) => {
|
|
45
|
-
if (navNode.id === contentId) {
|
|
46
|
-
book = getNavBookOf(navNode);
|
|
47
|
-
finish = true;
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (finish && !nextNav) {
|
|
52
|
-
nextNav = navNode;
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!finish) previousNav = navNode;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
if (book) {
|
|
60
|
-
//
|
|
61
|
-
// Can't lead out of current book (if givent content item is inside the book)
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
if (previousNav)
|
|
65
|
-
if (getNavBookOf(previousNav)?.fullId !== book.fullId)
|
|
66
|
-
previousNav = undefined;
|
|
67
|
-
|
|
68
|
-
if (nextNav)
|
|
69
|
-
if (getNavBookOf(nextNav)?.fullId !== book.fullId)
|
|
70
|
-
nextNav = undefined;
|
|
71
|
-
} else {
|
|
72
|
-
//
|
|
73
|
-
// If not inside the book and tries to lead inside a book, then force lead to book's about page
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
if (previousNav) previousNav = getNavBookOf(previousNav) || previousNav;
|
|
77
|
-
|
|
78
|
-
if (nextNav) nextNav = getNavBookOf(nextNav) || nextNav;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
previousNav,
|
|
83
|
-
nextNav,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export async function getNavNode(
|
|
88
|
-
contentId: string,
|
|
89
|
-
): Promise<NavNode | undefined> {
|
|
90
|
-
let navNode: NavNode | undefined;
|
|
91
|
-
|
|
92
|
-
await walkNav(async (_navNode) => {
|
|
93
|
-
if (_navNode.id === contentId) {
|
|
94
|
-
navNode = _navNode;
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
return navNode;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export async function getIdsUp(contentId: string): Promise<string[]> {
|
|
103
|
-
const startNavNode = await getNavNode(contentId);
|
|
104
|
-
|
|
105
|
-
if (!startNavNode) return [];
|
|
106
|
-
|
|
107
|
-
const ids: string[] = [];
|
|
108
|
-
|
|
109
|
-
let currentNavNode: any = startNavNode;
|
|
110
|
-
while (currentNavNode?.id) {
|
|
111
|
-
ids.push(currentNavNode.id);
|
|
112
|
-
currentNavNode = currentNavNode.parent;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return ids;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export async function isSkipId(contentId: string) {
|
|
119
|
-
let hidden = false;
|
|
120
|
-
|
|
121
|
-
await walkNav(async (navNode) => {
|
|
122
|
-
if (navNode.id === contentId) {
|
|
123
|
-
hidden = navNode.skip;
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
return hidden;
|
|
129
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
2
|
-
import { getNavBookOf } from '@server/nav/utils';
|
|
3
|
-
import { DbContent } from '@server/db/entities/Content';
|
|
4
|
-
|
|
5
|
-
export async function getContentBookFor(contentId: string) {
|
|
6
|
-
const navBook = getNavBookOf(contentId);
|
|
7
|
-
|
|
8
|
-
if (!navBook) return undefined;
|
|
9
|
-
|
|
10
|
-
const bookId = navBook.id;
|
|
11
|
-
|
|
12
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
13
|
-
select: ['title'],
|
|
14
|
-
where: { contentId: bookId },
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
contentId: bookId,
|
|
19
|
-
title: dbContent?.title || bookId,
|
|
20
|
-
};
|
|
21
|
-
}
|