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,238 +0,0 @@
|
|
|
1
|
-
import type { ContentType } from '@erudit-js/cog/schema';
|
|
2
|
-
import { Like } from 'typeorm';
|
|
3
|
-
|
|
4
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
5
|
-
import { DbContent } from '@server/db/entities/Content';
|
|
6
|
-
import { DbContribution } from '@server/db/entities/Contribution';
|
|
7
|
-
|
|
8
|
-
import { getContentContext } from '@server/content/context';
|
|
9
|
-
import type { ContentGenericData } from '@shared/content/data/base';
|
|
10
|
-
import { getIdsUp, getPreviousNextNav } from '../nav/utils';
|
|
11
|
-
import { createContentLink, createTopicPartLink } from '@erudit/shared/link';
|
|
12
|
-
import { getTopicPart } from './topic';
|
|
13
|
-
import type { PreviousNextItem } from '@erudit/shared/content/previousNext';
|
|
14
|
-
import type { NavNode } from '../nav/node';
|
|
15
|
-
import { toAbsoluteContentId } from '../content/absoluteId';
|
|
16
|
-
|
|
17
|
-
import type { ContentContributor } from '@erudit/shared/contributor';
|
|
18
|
-
import { DbContributor } from '../db/entities/Contributor';
|
|
19
|
-
|
|
20
|
-
export async function getContentGenericData(
|
|
21
|
-
contentId: string,
|
|
22
|
-
): Promise<ContentGenericData> {
|
|
23
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
24
|
-
where: { contentId },
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (!dbContent)
|
|
28
|
-
throw createError({
|
|
29
|
-
statusCode: 404,
|
|
30
|
-
message: `Content item "${contentId}" not found!`,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const previousNext = await getPreviousNext(contentId);
|
|
34
|
-
const decoration = await getContentDecoration(contentId);
|
|
35
|
-
const flags = await getContentFlags(contentId);
|
|
36
|
-
|
|
37
|
-
const contentPage: ContentGenericData = {
|
|
38
|
-
contentId,
|
|
39
|
-
type: dbContent.type,
|
|
40
|
-
title: dbContent.title || undefined,
|
|
41
|
-
description: dbContent.description || undefined,
|
|
42
|
-
flags,
|
|
43
|
-
previousNext,
|
|
44
|
-
decoration,
|
|
45
|
-
context: await getContentContext(contentId),
|
|
46
|
-
seo: dbContent.seo,
|
|
47
|
-
ogImage: dbContent.ogImage,
|
|
48
|
-
dependencies: dbContent.dependencies
|
|
49
|
-
? await getContentDependencies(contentId, dbContent.dependencies)
|
|
50
|
-
: undefined,
|
|
51
|
-
references: dbContent.references,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return contentPage;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export async function getPreviousNext(contentId: string) {
|
|
58
|
-
const { previousNav, nextNav } = await getPreviousNextNav(contentId);
|
|
59
|
-
|
|
60
|
-
async function getItemData(navNode: NavNode): Promise<PreviousNextItem> {
|
|
61
|
-
const title = await getContentTitle(navNode.id);
|
|
62
|
-
|
|
63
|
-
const link = await (async () => {
|
|
64
|
-
if (navNode.type === 'topic')
|
|
65
|
-
return createTopicPartLink(
|
|
66
|
-
await getTopicPart(navNode.id),
|
|
67
|
-
navNode.id,
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return createContentLink(navNode.type, navNode.id);
|
|
71
|
-
})();
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
title,
|
|
75
|
-
link,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
previous: previousNav ? await getItemData(previousNav) : undefined,
|
|
81
|
-
next: nextNav ? await getItemData(nextNav) : undefined,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export async function getContentDecoration(contentId: string) {
|
|
86
|
-
const idsUp = await getIdsUp(contentId);
|
|
87
|
-
|
|
88
|
-
for (const id of idsUp) {
|
|
89
|
-
const decoration = (
|
|
90
|
-
await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
91
|
-
select: ['decoration'],
|
|
92
|
-
where: { contentId: id },
|
|
93
|
-
})
|
|
94
|
-
)?.decoration;
|
|
95
|
-
|
|
96
|
-
if (decoration) return decoration;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export async function getContentFlags(contentId: string) {
|
|
103
|
-
const idsUp = await getIdsUp(contentId);
|
|
104
|
-
const flags: any = {};
|
|
105
|
-
|
|
106
|
-
for (const id of idsUp.reverse()) {
|
|
107
|
-
const dbFlags = (
|
|
108
|
-
await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
109
|
-
select: ['flags'],
|
|
110
|
-
where: { contentId: id },
|
|
111
|
-
})
|
|
112
|
-
)?.flags;
|
|
113
|
-
|
|
114
|
-
if (dbFlags)
|
|
115
|
-
for (const [flagName, flagValue] of Object.entries(dbFlags))
|
|
116
|
-
flags[flagName] = flagValue;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
for (const [flagName, flagValue] of Object.entries(flags))
|
|
120
|
-
if (flagValue === false) delete flags[flagName];
|
|
121
|
-
|
|
122
|
-
return flags;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export async function getContentDependencies(
|
|
126
|
-
contentId: string,
|
|
127
|
-
strDependencies: string[],
|
|
128
|
-
) {
|
|
129
|
-
const dependencyIds = strDependencies.map((rawDependency) =>
|
|
130
|
-
toAbsoluteContentId(rawDependency, contentId),
|
|
131
|
-
);
|
|
132
|
-
const dependencies: Record<string, string> = {};
|
|
133
|
-
|
|
134
|
-
for (const dependencyId of dependencyIds)
|
|
135
|
-
dependencies[await getContentLink(dependencyId)] =
|
|
136
|
-
await getContentTitle(dependencyId);
|
|
137
|
-
|
|
138
|
-
return dependencies;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export async function getContentTitle(contentId: string) {
|
|
142
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
143
|
-
select: ['title'],
|
|
144
|
-
where: { contentId },
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
return dbContent?.title || contentId.split('/').pop()!;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export async function getContentLink(contentId: string) {
|
|
151
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
152
|
-
select: ['type'],
|
|
153
|
-
where: { contentId },
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
if (!dbContent)
|
|
157
|
-
throw createError({
|
|
158
|
-
statusCode: 404,
|
|
159
|
-
statusText: `Missing "${contentId}" content item!`,
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
if (dbContent.type !== 'topic')
|
|
163
|
-
return createContentLink(dbContent.type, contentId);
|
|
164
|
-
|
|
165
|
-
const topicPart = await getTopicPart(contentId);
|
|
166
|
-
|
|
167
|
-
return createTopicPartLink(topicPart, contentId);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export async function getFullContentId(contentId: string) {
|
|
171
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
172
|
-
select: ['fullId'],
|
|
173
|
-
where: { contentId },
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
return dbContent?.fullId;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export async function getContentContributors(contentId: string) {
|
|
180
|
-
const contributorIds = await (async () => {
|
|
181
|
-
const idHash: Record<string, true> = {};
|
|
182
|
-
|
|
183
|
-
(
|
|
184
|
-
await ERUDIT_SERVER.DB.manager.find(DbContribution, {
|
|
185
|
-
select: ['contributorId'],
|
|
186
|
-
where: { contentId },
|
|
187
|
-
})
|
|
188
|
-
).forEach(
|
|
189
|
-
(contribution) => (idHash[contribution.contributorId] = true),
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
const type: ContentType = (await ERUDIT_SERVER.DB.manager.findOne(
|
|
193
|
-
DbContent,
|
|
194
|
-
{
|
|
195
|
-
select: ['type'],
|
|
196
|
-
where: { contentId },
|
|
197
|
-
},
|
|
198
|
-
))!.type;
|
|
199
|
-
|
|
200
|
-
if (type === 'book' || type === 'group') {
|
|
201
|
-
// Collecting contributors for all sub-content items
|
|
202
|
-
(
|
|
203
|
-
await ERUDIT_SERVER.DB.manager.find(DbContribution, {
|
|
204
|
-
select: ['contributorId'],
|
|
205
|
-
where: { contentId: Like(`${contentId}/%`) },
|
|
206
|
-
})
|
|
207
|
-
).forEach(
|
|
208
|
-
(contribution) => (idHash[contribution.contributorId] = true),
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return Object.keys(idHash);
|
|
213
|
-
})();
|
|
214
|
-
|
|
215
|
-
const contentContributors: ContentContributor[] = [];
|
|
216
|
-
|
|
217
|
-
for (const contributorId of contributorIds) {
|
|
218
|
-
const dbContributor = (await ERUDIT_SERVER.DB.manager.findOne(
|
|
219
|
-
DbContributor,
|
|
220
|
-
{
|
|
221
|
-
select: ['contributorId', 'displayName', 'avatar'],
|
|
222
|
-
where: { contributorId },
|
|
223
|
-
},
|
|
224
|
-
))!;
|
|
225
|
-
|
|
226
|
-
const contentContributor: ContentContributor = { contributorId };
|
|
227
|
-
|
|
228
|
-
if (dbContributor.displayName)
|
|
229
|
-
contentContributor.displayName = dbContributor.displayName;
|
|
230
|
-
|
|
231
|
-
if (dbContributor.avatar)
|
|
232
|
-
contentContributor.avatar = dbContributor.avatar;
|
|
233
|
-
|
|
234
|
-
contentContributors.push(contentContributor);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return contentContributors.length ? contentContributors : undefined;
|
|
238
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DbContributor } from '@server/db/entities/Contributor';
|
|
2
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
3
|
-
|
|
4
|
-
export async function contributorExists(contributorId: string) {
|
|
5
|
-
return await ERUDIT_SERVER.DB.manager.exists(DbContributor, {
|
|
6
|
-
where: { contributorId },
|
|
7
|
-
});
|
|
8
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
FrontNav,
|
|
3
|
-
FrontNavBase,
|
|
4
|
-
FrontNavBook,
|
|
5
|
-
FrontNavFolder,
|
|
6
|
-
FrontNavItem,
|
|
7
|
-
FrontNavSeparator,
|
|
8
|
-
FrontNavTopic,
|
|
9
|
-
} from '@erudit/shared/frontNav';
|
|
10
|
-
|
|
11
|
-
import type { NavNode, RootNavNode } from '@server/nav/node';
|
|
12
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
13
|
-
import { DbContent } from '@server/db/entities/Content';
|
|
14
|
-
import { DbGroup } from '@server/db/entities/Group';
|
|
15
|
-
|
|
16
|
-
import { getTopicPart } from './topic';
|
|
17
|
-
|
|
18
|
-
export async function createGlobalFrontNav(
|
|
19
|
-
from: RootNavNode | NavNode | undefined,
|
|
20
|
-
): Promise<FrontNav | []> {
|
|
21
|
-
if (!from || !from.children) return [];
|
|
22
|
-
|
|
23
|
-
return await Promise.all(
|
|
24
|
-
from.children.map((node) =>
|
|
25
|
-
toFrontNavItem({ node, level: 0, includeBookNav: true }),
|
|
26
|
-
),
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function createBookFrontNav(from: NavNode): Promise<FrontNavBook> {
|
|
31
|
-
return await toFrontNavBook({ node: from, level: 0, includeBookNav: true });
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
type ToFuncArg = {
|
|
35
|
-
node: NavNode;
|
|
36
|
-
level: number;
|
|
37
|
-
includeBookNav?: boolean;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
async function toFrontNavItem(arg: ToFuncArg): Promise<FrontNavItem> {
|
|
41
|
-
switch (arg.node.type) {
|
|
42
|
-
case 'book':
|
|
43
|
-
return await toFrontNavBook(arg);
|
|
44
|
-
case 'topic':
|
|
45
|
-
return await toFrontNavTopic(arg);
|
|
46
|
-
case 'group':
|
|
47
|
-
const dbGroup = await ERUDIT_SERVER.DB.manager.findOne(DbGroup, {
|
|
48
|
-
select: ['type'],
|
|
49
|
-
where: { contentId: arg.node.id },
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (!dbGroup)
|
|
53
|
-
throw new Error(
|
|
54
|
-
`Missing group content item "${arg.node.id}" when creating front nav!`,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
if (dbGroup.type === 'folder') return await toFrontNavFolder(arg);
|
|
58
|
-
else return await toFrontNavSeparator(arg);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function toFrontNavBook({
|
|
63
|
-
node,
|
|
64
|
-
level,
|
|
65
|
-
includeBookNav,
|
|
66
|
-
}: ToFuncArg): Promise<FrontNavBook> {
|
|
67
|
-
return {
|
|
68
|
-
type: 'book',
|
|
69
|
-
children: await toFrontNavChildren({
|
|
70
|
-
node,
|
|
71
|
-
level: 0,
|
|
72
|
-
includeBookNav,
|
|
73
|
-
}),
|
|
74
|
-
...(await toFrontNavBase({ node, level })),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function toFrontNavSeparator({
|
|
79
|
-
node,
|
|
80
|
-
level,
|
|
81
|
-
includeBookNav,
|
|
82
|
-
}: ToFuncArg): Promise<FrontNavSeparator> {
|
|
83
|
-
return {
|
|
84
|
-
type: 'separator',
|
|
85
|
-
children: await toFrontNavChildren({ node, level, includeBookNav }),
|
|
86
|
-
...(await toFrontNavBase({ node, level })),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function toFrontNavFolder({
|
|
91
|
-
node,
|
|
92
|
-
level,
|
|
93
|
-
includeBookNav,
|
|
94
|
-
}: ToFuncArg): Promise<FrontNavFolder> {
|
|
95
|
-
return {
|
|
96
|
-
type: 'folder',
|
|
97
|
-
children: await toFrontNavChildren({
|
|
98
|
-
node,
|
|
99
|
-
level: level + 1,
|
|
100
|
-
includeBookNav,
|
|
101
|
-
}),
|
|
102
|
-
...(await toFrontNavBase({ node, level })),
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async function toFrontNavTopic({
|
|
107
|
-
node,
|
|
108
|
-
level,
|
|
109
|
-
}: ToFuncArg): Promise<FrontNavTopic> {
|
|
110
|
-
const topicPart = await getTopicPart(node.id);
|
|
111
|
-
return {
|
|
112
|
-
type: 'topic',
|
|
113
|
-
part: topicPart,
|
|
114
|
-
...(await toFrontNavBase({ node, level })),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async function toFrontNavBase({
|
|
119
|
-
node,
|
|
120
|
-
level,
|
|
121
|
-
}: ToFuncArg): Promise<Omit<FrontNavBase, 'type'>> {
|
|
122
|
-
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
123
|
-
select: ['title', 'navTitle', 'flags'],
|
|
124
|
-
where: { contentId: node.id },
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
return {
|
|
128
|
-
id: node.id,
|
|
129
|
-
fullId: node.fullId,
|
|
130
|
-
level,
|
|
131
|
-
flags: dbContent?.flags,
|
|
132
|
-
label:
|
|
133
|
-
dbContent?.navTitle ||
|
|
134
|
-
dbContent?.title ||
|
|
135
|
-
node.id.split('/').pop()!,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async function toFrontNavChildren({ node, includeBookNav, level }: ToFuncArg) {
|
|
140
|
-
if (node.type === 'book' && !includeBookNav) return undefined;
|
|
141
|
-
if (!node.children) return undefined;
|
|
142
|
-
|
|
143
|
-
return Promise.all(
|
|
144
|
-
node.children!.map((child) =>
|
|
145
|
-
toFrontNavItem({ node: child, level, includeBookNav }),
|
|
146
|
-
),
|
|
147
|
-
);
|
|
148
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { TopicPart } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
4
|
-
import { DbTopic } from '@server/db/entities/Topic';
|
|
5
|
-
import type { TopicPartLinks } from '@shared/content/data/type/topic';
|
|
6
|
-
import { createTopicPartLink } from '@shared/link';
|
|
7
|
-
|
|
8
|
-
export async function getTopicParts(contentId: string) {
|
|
9
|
-
const dbTopic = await ERUDIT_SERVER.DB.manager.findOne(DbTopic, {
|
|
10
|
-
select: ['parts'],
|
|
11
|
-
where: { contentId },
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
if (!dbTopic) throw new Error(`Missing topic "${contentId}".`);
|
|
15
|
-
|
|
16
|
-
return dbTopic.parts;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export async function getTopicPart(contentId: string): Promise<TopicPart> {
|
|
20
|
-
const topicParts = await getTopicParts(contentId);
|
|
21
|
-
return topicParts.shift()!;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function getTopicPartsLinks(topicId: string) {
|
|
25
|
-
const existingTopicParts = await getTopicParts(topicId);
|
|
26
|
-
const links: TopicPartLinks = {};
|
|
27
|
-
|
|
28
|
-
for (const topicPart of existingTopicParts)
|
|
29
|
-
links[topicPart] = createTopicPartLink(topicPart, topicId);
|
|
30
|
-
|
|
31
|
-
return links;
|
|
32
|
-
}
|
package/server/tsconfig.json
DELETED
package/shared/aside/minor.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { BitranLocation } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
import type { Toc } from '../bitran/toc';
|
|
4
|
-
import type { PreviousNextItem } from '../content/previousNext';
|
|
5
|
-
import type { ContentContributor } from '../contributor';
|
|
6
|
-
|
|
7
|
-
interface AsideMinorBase {
|
|
8
|
-
type: AsideMinorType;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type AsideMinorType =
|
|
12
|
-
| 'topic'
|
|
13
|
-
| 'group'
|
|
14
|
-
| 'book'
|
|
15
|
-
| 'contributor'
|
|
16
|
-
| 'news';
|
|
17
|
-
|
|
18
|
-
export interface AsideMinorTopic extends AsideMinorBase {
|
|
19
|
-
type: 'topic';
|
|
20
|
-
fullContentId: string;
|
|
21
|
-
location: BitranLocation;
|
|
22
|
-
nav: Partial<{
|
|
23
|
-
previous: PreviousNextItem;
|
|
24
|
-
next: PreviousNextItem;
|
|
25
|
-
article: string;
|
|
26
|
-
summary: string;
|
|
27
|
-
practice: string;
|
|
28
|
-
}>;
|
|
29
|
-
toc: Toc;
|
|
30
|
-
contributors?: ContentContributor[];
|
|
31
|
-
// todos: TodoItem[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface AsideMinorContent extends AsideMinorBase {
|
|
35
|
-
type: 'group' | 'book';
|
|
36
|
-
fullContentId: string;
|
|
37
|
-
nav: Partial<{
|
|
38
|
-
previous: PreviousNextItem;
|
|
39
|
-
next: PreviousNextItem;
|
|
40
|
-
}>;
|
|
41
|
-
contributors?: ContentContributor[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface AsideMinorNews extends AsideMinorBase {
|
|
45
|
-
type: 'news';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type AsideMinorData =
|
|
49
|
-
| AsideMinorTopic
|
|
50
|
-
| AsideMinorContent
|
|
51
|
-
| AsideMinorNews;
|
package/shared/asset.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function eruditAsset(path: string) {
|
|
2
|
-
return '/_erudit-asset/' + path;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function contributorAsset(path: string) {
|
|
6
|
-
return '/_user-asset/contributor/' + path;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function contentAsset(path: string) {
|
|
10
|
-
return '/_user-asset/content/' + path;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function publicAsset(path: string) {
|
|
14
|
-
return '/_user-asset/public/' + path;
|
|
15
|
-
}
|
package/shared/bitran/toc.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ContentFlag,
|
|
3
|
-
ContentReferences,
|
|
4
|
-
ContentSeo,
|
|
5
|
-
ContentType,
|
|
6
|
-
TopicPart,
|
|
7
|
-
} from '@erudit-js/cog/schema';
|
|
8
|
-
|
|
9
|
-
import type { Context } from '@shared/content/context';
|
|
10
|
-
import type { PreviousNext } from '@shared/content/previousNext';
|
|
11
|
-
import type { ImageData } from '@shared/image';
|
|
12
|
-
|
|
13
|
-
export interface ContentGenericData {
|
|
14
|
-
contentId: string;
|
|
15
|
-
title?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
decoration?: string;
|
|
18
|
-
type: ContentType;
|
|
19
|
-
context: Context;
|
|
20
|
-
flags: Record<ContentFlag, boolean>;
|
|
21
|
-
topicPart?: TopicPart;
|
|
22
|
-
seo?: Partial<ContentSeo>;
|
|
23
|
-
ogImage?: ImageData;
|
|
24
|
-
previousNext: PreviousNext;
|
|
25
|
-
dependencies?: Record<string, string>;
|
|
26
|
-
references?: ContentReferences;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ContentBaseData {
|
|
30
|
-
type: ContentType;
|
|
31
|
-
generic: ContentGenericData;
|
|
32
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TopicPart } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
import type { ContentBaseData } from '../base';
|
|
4
|
-
|
|
5
|
-
export type TopicPartLinks = Partial<Record<TopicPart, string>>;
|
|
6
|
-
|
|
7
|
-
export interface ContentTopicData extends ContentBaseData {
|
|
8
|
-
type: 'topic';
|
|
9
|
-
topicPartLinks: TopicPartLinks;
|
|
10
|
-
bookTitle?: string;
|
|
11
|
-
}
|
package/shared/contributor.ts
DELETED
package/shared/frontNav.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ContentFlag, TopicPart } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
export type FrontNavType = 'book' | 'topic' | 'separator' | 'folder';
|
|
4
|
-
|
|
5
|
-
export interface FrontNavBase {
|
|
6
|
-
type: FrontNavType;
|
|
7
|
-
id: string;
|
|
8
|
-
fullId: string;
|
|
9
|
-
label: string;
|
|
10
|
-
level: number;
|
|
11
|
-
flags?: Record<ContentFlag, boolean>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface FrontNavTopic extends FrontNavBase {
|
|
15
|
-
type: 'topic';
|
|
16
|
-
part: TopicPart;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface FrontNavContainer extends FrontNavBase {
|
|
20
|
-
children?: FrontNavItem[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface FrontNavBook extends FrontNavContainer {
|
|
24
|
-
type: 'book';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface FrontNavSeparator extends FrontNavContainer {
|
|
28
|
-
type: 'separator';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface FrontNavFolder extends FrontNavContainer {
|
|
32
|
-
type: 'folder';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type FrontNavItem =
|
|
36
|
-
| FrontNavTopic
|
|
37
|
-
| FrontNavBook
|
|
38
|
-
| FrontNavSeparator
|
|
39
|
-
| FrontNavFolder;
|
|
40
|
-
|
|
41
|
-
export type FrontNav = FrontNavItem[];
|