erudit 3.0.0-dev.9 → 4.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/app.vue +24 -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 +16 -0
- package/app/components/FancyCard.vue +58 -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 +45 -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 +77 -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 +20 -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 +66 -0
- package/app/components/aside/minor/content/ButtonPaneContributions.vue +114 -0
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +120 -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 +91 -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 +132 -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 +47 -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 +91 -0
- package/app/components/main/MainQuickLinks.vue +40 -0
- package/app/components/main/MainQuote.vue +159 -0
- package/app/components/main/MainQuoteLoader.vue +86 -0
- package/app/components/main/MainSection.vue +44 -0
- package/app/components/main/MainSectionPreamble.vue +5 -0
- package/app/components/main/MainSubTitle.vue +12 -0
- package/app/components/main/MainTitle.vue +32 -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 +104 -0
- package/app/components/main/connections/MainConnections.vue +94 -0
- package/app/components/main/connections/MainConnectionsButton.vue +81 -0
- package/app/components/main/connections/ScrollPane.vue +10 -0
- package/app/components/main/contentStats/Item.vue +34 -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 +53 -0
- package/app/components/preview/Preview.vue +172 -186
- package/app/components/preview/PreviewError.vue +10 -0
- package/app/components/preview/PreviewLoading.vue +5 -14
- package/app/components/preview/PreviewScreen.vue +64 -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 +68 -0
- package/app/components/site/SiteAsideOverlay.vue +21 -0
- package/app/components/site/SiteMain.vue +13 -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 +182 -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 +150 -0
- package/app/pages/contributors.vue +99 -0
- package/app/pages/group/[...groupId].vue +53 -59
- package/app/pages/index.vue +111 -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 +172 -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 +161 -0
- package/server/erudit/config.ts +13 -0
- package/server/erudit/content/global/build.ts +297 -0
- package/server/erudit/content/global/singleton.ts +5 -0
- package/server/erudit/content/nav/build.ts +463 -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 +105 -0
- package/server/erudit/content/repository/externals.ts +50 -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 +290 -0
- package/server/erudit/content/resolve/page.ts +87 -0
- package/server/erudit/content/resolve/topic.ts +246 -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 +132 -0
- package/server/erudit/content/search.ts +163 -0
- package/server/erudit/contributors/build.ts +166 -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 +26 -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 +15 -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 +211 -0
- package/server/erudit/language/list/ru.ts +216 -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 +114 -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 +165 -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 +14 -0
- package/shared/types/frontContentNav.ts +38 -0
- package/shared/types/indexPage.ts +20 -0
- package/shared/types/language.ts +191 -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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { FinalizedProse } from '@jsprose/core';
|
|
2
|
+
import type { ContentType } from '@erudit-js/core/content/type';
|
|
3
|
+
import type { TopicPart } from '@erudit-js/core/content/topic';
|
|
4
|
+
import type { ContentFlags } from '@erudit-js/core/content/flags';
|
|
5
|
+
import type { ContentContribution } from '@erudit-js/core/content/contributions';
|
|
6
|
+
import type { ResolvedTocItem } from '@erudit-js/prose';
|
|
7
|
+
import type { ContentSeo } from '@erudit-js/core/content/seo';
|
|
8
|
+
|
|
9
|
+
export interface MainContentBase {
|
|
10
|
+
type: ContentType;
|
|
11
|
+
breadcrumbs: Breadcrumbs;
|
|
12
|
+
fullId: string;
|
|
13
|
+
shortId: string;
|
|
14
|
+
contentRelativePath: string;
|
|
15
|
+
title: string;
|
|
16
|
+
bookTitle?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
decoration?: string;
|
|
19
|
+
flags?: ContentFlags;
|
|
20
|
+
stats?: ContentStats;
|
|
21
|
+
connections?: ContentConnections;
|
|
22
|
+
contributions?: ContentContribution[];
|
|
23
|
+
seo?: ContentSeo;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MainContentChildrenItem {
|
|
27
|
+
type: ContentType;
|
|
28
|
+
link: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
quickLinks?: ElementSnippet[];
|
|
32
|
+
stats?: ContentStats;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//
|
|
36
|
+
//
|
|
37
|
+
//
|
|
38
|
+
|
|
39
|
+
export type MainContentTopicPart = MainContentBase &
|
|
40
|
+
FinalizedProse & {
|
|
41
|
+
type: 'topic';
|
|
42
|
+
part: TopicPart;
|
|
43
|
+
parts: TopicPart[];
|
|
44
|
+
snippets?: ElementSnippet[];
|
|
45
|
+
toc?: ResolvedTocItem[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type MainContentPage = MainContentBase &
|
|
49
|
+
FinalizedProse & {
|
|
50
|
+
type: 'page';
|
|
51
|
+
snippets?: ElementSnippet[];
|
|
52
|
+
toc?: ResolvedTocItem[];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type MainContentGroup = MainContentBase & {
|
|
56
|
+
type: 'group';
|
|
57
|
+
children: MainContentChildrenItem[];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type MainContentBook = MainContentBase & {
|
|
61
|
+
type: 'book';
|
|
62
|
+
children: MainContentChildrenItem[];
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type MainContent =
|
|
66
|
+
| MainContentTopicPart
|
|
67
|
+
| MainContentPage
|
|
68
|
+
| MainContentGroup
|
|
69
|
+
| MainContentBook;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FinalizedProse } from '@jsprose/core';
|
|
2
|
+
|
|
3
|
+
export interface NewsBatch {
|
|
4
|
+
items: NewsItem[];
|
|
5
|
+
nextIndex?: number;
|
|
6
|
+
/** Only present in the first batch with index 0! */
|
|
7
|
+
total?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface NewsItem {
|
|
11
|
+
date: string;
|
|
12
|
+
content: FinalizedProse;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FinalizedProse } from '@jsprose/core';
|
|
2
|
+
import type { PreviewRequest } from '@erudit-js/core/preview/request';
|
|
3
|
+
import type { ContentType } from '@erudit-js/core/content/type';
|
|
4
|
+
|
|
5
|
+
export type PreviewState = {
|
|
6
|
+
opened: boolean;
|
|
7
|
+
request: PreviewRequest | undefined;
|
|
8
|
+
history: PreviewRequest[];
|
|
9
|
+
blink: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type PreviewContentPage = {
|
|
13
|
+
content:
|
|
14
|
+
| { type: 'topic'; topicPart: string }
|
|
15
|
+
| { type: Exclude<ContentType, 'topic'> };
|
|
16
|
+
title: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
bookTitle?: string;
|
|
19
|
+
link: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type PreviewContentUnique = {
|
|
23
|
+
link: string;
|
|
24
|
+
contentTitle: string;
|
|
25
|
+
elementTitle?: string;
|
|
26
|
+
schemaName: string;
|
|
27
|
+
fadeOverlay?: boolean;
|
|
28
|
+
} & FinalizedProse;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { EruditMode } from '@erudit-js/core/mode';
|
|
2
|
+
import type { EruditAdsBanners } from '@erudit-js/core/eruditConfig/ads';
|
|
3
|
+
import type { EruditLanguage } from '@erudit-js/core/eruditConfig/language';
|
|
4
|
+
import type { EruditCustomLinks } from '@erudit-js/core/eruditConfig/links';
|
|
5
|
+
import type { EruditRepository } from '@erudit-js/core/eruditConfig/repository';
|
|
6
|
+
import type { EruditSponsors } from '@erudit-js/core/sponsor';
|
|
7
|
+
import type { EruditContributors } from '@erudit-js/core/contributor';
|
|
8
|
+
import type { EruditIndexPage } from '@erudit-js/core/eruditConfig/indexPage';
|
|
9
|
+
import type { EruditSiteFaviconResolved } from '@erudit-js/core/eruditConfig/site';
|
|
10
|
+
import type { EruditSeo } from '@erudit-js/core/eruditConfig/seo';
|
|
11
|
+
import type { EruditAnalytics } from '@erudit-js/core/eruditConfig/analytics';
|
|
12
|
+
|
|
13
|
+
export interface EruditRuntimeConfigPaths {
|
|
14
|
+
package: string;
|
|
15
|
+
module: string;
|
|
16
|
+
app: string;
|
|
17
|
+
server: string;
|
|
18
|
+
project: string;
|
|
19
|
+
build: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface EruditRuntimeConfig {
|
|
23
|
+
paths: EruditRuntimeConfigPaths;
|
|
24
|
+
project: {
|
|
25
|
+
elements: string[];
|
|
26
|
+
countElements: (string | string[])[];
|
|
27
|
+
indexPage?: EruditIndexPage;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface EruditPublicRuntimeConfig {
|
|
32
|
+
mode: EruditMode;
|
|
33
|
+
version: string;
|
|
34
|
+
project: {
|
|
35
|
+
language: EruditLanguage;
|
|
36
|
+
originUrl: string;
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
siteInfo: {
|
|
39
|
+
title?: string;
|
|
40
|
+
short?: string | false;
|
|
41
|
+
logotype?: string | false;
|
|
42
|
+
favicon?: EruditSiteFaviconResolved;
|
|
43
|
+
};
|
|
44
|
+
seo?: EruditSeo;
|
|
45
|
+
debug: {
|
|
46
|
+
log: boolean;
|
|
47
|
+
slowTransition: boolean;
|
|
48
|
+
ads: boolean;
|
|
49
|
+
fakeApi: {
|
|
50
|
+
repository: boolean;
|
|
51
|
+
};
|
|
52
|
+
analytics?: boolean;
|
|
53
|
+
};
|
|
54
|
+
repository?: EruditRepository & { _link: string };
|
|
55
|
+
style?: {
|
|
56
|
+
brandColor?: string;
|
|
57
|
+
};
|
|
58
|
+
customLinks?: EruditCustomLinks;
|
|
59
|
+
contributors?: EruditContributors;
|
|
60
|
+
sponsors?: EruditSponsors;
|
|
61
|
+
ads?: EruditAdsBanners;
|
|
62
|
+
analytics?: EruditAnalytics;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Commands
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { MaybeMyIconName } from '#my-icons';
|
|
6
|
+
|
|
7
|
+
export interface SearchCommandInit {
|
|
8
|
+
type: 'init';
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
cacheId: string;
|
|
11
|
+
language: LanguageCode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SearchCommandSearch {
|
|
15
|
+
type: 'search';
|
|
16
|
+
id: number;
|
|
17
|
+
query: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SearchCommandMore {
|
|
21
|
+
type: 'more';
|
|
22
|
+
id: number; // added: identify which search to paginate
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SearchCommand =
|
|
26
|
+
| SearchCommandInit
|
|
27
|
+
| SearchCommandSearch
|
|
28
|
+
| SearchCommandMore;
|
|
29
|
+
|
|
30
|
+
//
|
|
31
|
+
// Responses
|
|
32
|
+
//
|
|
33
|
+
|
|
34
|
+
export interface SearchResponseError {
|
|
35
|
+
type: 'error';
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SearchResponseResults {
|
|
40
|
+
type: 'results';
|
|
41
|
+
entries: SearchEntry[];
|
|
42
|
+
hasMore: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type SearchResponse = SearchResponseError | SearchResponseResults;
|
|
46
|
+
|
|
47
|
+
//
|
|
48
|
+
//
|
|
49
|
+
//
|
|
50
|
+
|
|
51
|
+
export interface SearchStatusVariant {
|
|
52
|
+
id: string;
|
|
53
|
+
icon?: MaybeMyIconName;
|
|
54
|
+
message?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface SearchEntry {
|
|
58
|
+
category: string;
|
|
59
|
+
title: string;
|
|
60
|
+
link: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
synonyms?: string[];
|
|
63
|
+
location?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ResolvedSearchEntry = SearchEntry & {
|
|
67
|
+
id: number;
|
|
68
|
+
categoryPriority: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export interface SearchEntryCategory {
|
|
72
|
+
id: string;
|
|
73
|
+
priority: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SearchEntriesList {
|
|
77
|
+
category: SearchEntryCategory;
|
|
78
|
+
entries: SearchEntry[];
|
|
79
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type TopicPart, isTopicPart } from '@erudit-js/core/content/topic';
|
|
2
|
+
import { type ContentType, isContentType } from '@erudit-js/core/content/type';
|
|
3
|
+
|
|
4
|
+
interface OtherContentTypePath {
|
|
5
|
+
type: 'book' | 'group' | 'page';
|
|
6
|
+
contentId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface TopicContentTypePath {
|
|
10
|
+
type: 'topic';
|
|
11
|
+
topicPart: TopicPart;
|
|
12
|
+
contentId: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ContentTypePath = OtherContentTypePath | TopicContentTypePath;
|
|
16
|
+
|
|
17
|
+
export function parseContentTypePath(contentPath: string): ContentTypePath {
|
|
18
|
+
const contentPathArray = contentPath.split('/');
|
|
19
|
+
const typeOrPart = contentPathArray.shift();
|
|
20
|
+
|
|
21
|
+
if (!isTopicPart(typeOrPart) && !isContentType(typeOrPart)) {
|
|
22
|
+
throw createError({
|
|
23
|
+
status: 400,
|
|
24
|
+
statusMessage: `Invalid content path type/topic part: "${contentPath}"!`,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeOrPart === 'topic') {
|
|
29
|
+
throw createError({
|
|
30
|
+
status: 400,
|
|
31
|
+
statusMessage: `Instead of "topic", use specific topic part (article, summary or practice) in content path: "${contentPath}"!`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const fullOrShortId = contentPathArray.join('/');
|
|
36
|
+
|
|
37
|
+
if (!fullOrShortId) {
|
|
38
|
+
throw createError({
|
|
39
|
+
status: 400,
|
|
40
|
+
statusMessage: `Falsy content path full/short ID: "${contentPath}"!`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (isTopicPart(typeOrPart)) {
|
|
45
|
+
return {
|
|
46
|
+
type: 'topic',
|
|
47
|
+
topicPart: typeOrPart,
|
|
48
|
+
contentId: fullOrShortId,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
type: typeOrPart,
|
|
54
|
+
contentId: fullOrShortId,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function stringifyContentTypePath(
|
|
59
|
+
typeOrPart: Omit<ContentType | TopicPart, 'topic'>,
|
|
60
|
+
fullOrShortId: string,
|
|
61
|
+
): string {
|
|
62
|
+
return `${typeOrPart}/${fullOrShortId}`;
|
|
63
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MaybeMyIconName } from '#my-icons';
|
|
2
|
+
|
|
3
|
+
export const ICONS = {
|
|
4
|
+
['book']: 'book-outline',
|
|
5
|
+
['group']: 'folder-open',
|
|
6
|
+
['page']: 'lines',
|
|
7
|
+
['topic']: 'array-lines',
|
|
8
|
+
['article']: 'array-lines',
|
|
9
|
+
['summary']: 'array-star',
|
|
10
|
+
['practice']: 'array-check',
|
|
11
|
+
} satisfies Record<string, MaybeMyIconName>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TopicPart } from '@erudit-js/core/content/topic';
|
|
2
|
+
|
|
3
|
+
export const PAGES = {
|
|
4
|
+
index: '/',
|
|
5
|
+
contributors: '/contributors/',
|
|
6
|
+
contributor: (contributorId?: string) => {
|
|
7
|
+
return slasher(`/contributor/${contributorId ?? ''}/`);
|
|
8
|
+
},
|
|
9
|
+
sponsors: '/sponsors/',
|
|
10
|
+
['book']: (shortId: string) => {
|
|
11
|
+
return slasher(`/book/${shortId}/`);
|
|
12
|
+
},
|
|
13
|
+
['group']: (shortId: string) => {
|
|
14
|
+
return slasher(`/group/${shortId}/`);
|
|
15
|
+
},
|
|
16
|
+
['page']: (shortId: string, elementId?: string) => {
|
|
17
|
+
return slasher(`/page/${shortId}/${elementId ? '#' + elementId : ''}`);
|
|
18
|
+
},
|
|
19
|
+
['topic']: (part: TopicPart, shortId: string, elementId?: string) => {
|
|
20
|
+
return slasher(
|
|
21
|
+
`/${part}/${shortId}/${elementId ? '#' + elementId : ''}`,
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface SlasherOptions {
|
|
2
|
+
leading?: boolean;
|
|
3
|
+
trailing?: boolean;
|
|
4
|
+
dedupe?: boolean;
|
|
5
|
+
toForward?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function slasher(str: string, options: SlasherOptions = {}): string {
|
|
9
|
+
const opts: Required<Pick<SlasherOptions, 'toForward' | 'dedupe'>> &
|
|
10
|
+
SlasherOptions = {
|
|
11
|
+
toForward: true,
|
|
12
|
+
dedupe: true,
|
|
13
|
+
...options,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let s = str ?? '';
|
|
17
|
+
|
|
18
|
+
// Normalize slashes direction
|
|
19
|
+
if (opts.toForward) {
|
|
20
|
+
s = s.replace(/\\/g, '/');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Collapse runs of slashes, but preserve protocol double slashes (http://, https://, file://)
|
|
24
|
+
if (opts.dedupe) {
|
|
25
|
+
// Temporarily replace protocols to protect them
|
|
26
|
+
const protocolPlaceholder = '\x00PROTOCOL\x00';
|
|
27
|
+
const protocols: string[] = [];
|
|
28
|
+
|
|
29
|
+
s = s.replace(/(https?|file):\/\//g, (match) => {
|
|
30
|
+
protocols.push(match);
|
|
31
|
+
return protocolPlaceholder;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Now dedupe slashes
|
|
35
|
+
s = s.replace(/\/{2,}/g, '/');
|
|
36
|
+
|
|
37
|
+
// Restore protocols
|
|
38
|
+
s = s.replace(
|
|
39
|
+
new RegExp(
|
|
40
|
+
protocolPlaceholder.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
|
|
41
|
+
'g',
|
|
42
|
+
),
|
|
43
|
+
() => protocols.shift()!,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Leading slash handling
|
|
48
|
+
if (options?.leading === true) {
|
|
49
|
+
s = s.replace(/^\/+/, '');
|
|
50
|
+
s = '/' + s;
|
|
51
|
+
} else if (options?.leading === false) {
|
|
52
|
+
s = s.replace(/^\/+/, '');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Trailing slash handling
|
|
56
|
+
if (options?.trailing === true) {
|
|
57
|
+
s = s.replace(/\/+$/, '');
|
|
58
|
+
s = s + '/';
|
|
59
|
+
} else if (options?.trailing === false) {
|
|
60
|
+
s = s.replace(/\/+$/, '');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return s;
|
|
64
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export function stringColor(text: string) {
|
|
2
|
-
let hash = 0;
|
|
3
|
-
|
|
4
|
-
for (let i = 0; i < text.length; i++) {
|
|
5
|
-
hash = text.charCodeAt(i) + ((hash << 5) - hash);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
export function stringColor(text: string) {
|
|
2
|
+
let hash = 0;
|
|
3
|
+
|
|
4
|
+
for (let i = 0; i < text.length; i++) {
|
|
5
|
+
hash = text.charCodeAt(i) + ((hash << 5) - hash);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const hue = hash % 360;
|
|
9
|
+
const lightColor = `hsl(${hue}, 70%, 35%)`; // Darker for white background
|
|
10
|
+
const darkColor = `hsl(${hue}, 75%, 70%)`; // Lighter for black background
|
|
11
|
+
|
|
12
|
+
return `light-dark(${lightColor}, ${darkColor})`;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function stringifyValue(value: unknown): string {
|
|
2
|
+
if (value === null || typeof value !== 'object') {
|
|
3
|
+
return JSON.stringify(value);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (Array.isArray(value)) {
|
|
7
|
+
return '[' + value.map(stringifyValue).join(',') + ']';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const obj = value as Record<string, unknown>;
|
|
11
|
+
const keys = Object.keys(obj).sort();
|
|
12
|
+
const props = keys.map(
|
|
13
|
+
(k) => JSON.stringify(k) + ':' + stringifyValue(obj[k]),
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
return '{' + props.join(',') + '}';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function toStringEqual(a: unknown, b: unknown): boolean {
|
|
20
|
+
return stringifyValue(a) === stringifyValue(b);
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export async function zip(text: string): Promise<string> {
|
|
2
|
+
const encoded = new TextEncoder().encode(text);
|
|
3
|
+
const compressedStream = new Blob([encoded.buffer as ArrayBuffer])
|
|
4
|
+
.stream()
|
|
5
|
+
.pipeThrough(new CompressionStream('gzip'));
|
|
6
|
+
const compressedBuffer = await new Response(compressedStream).arrayBuffer();
|
|
7
|
+
|
|
8
|
+
return toBase64(new Uint8Array(compressedBuffer));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function unzip(input: string): Promise<string> {
|
|
12
|
+
const gzBinary = fromBase64(input);
|
|
13
|
+
const decompressedStream = new Blob([gzBinary.buffer as ArrayBuffer])
|
|
14
|
+
.stream()
|
|
15
|
+
.pipeThrough(new DecompressionStream('gzip'));
|
|
16
|
+
const decompressedBuffer = await new Response(
|
|
17
|
+
decompressedStream,
|
|
18
|
+
).arrayBuffer();
|
|
19
|
+
|
|
20
|
+
return new TextDecoder().decode(decompressedBuffer);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Convert Uint8Array to base64 safely in both browser and Node.
|
|
25
|
+
*/
|
|
26
|
+
function toBase64(bytes: Uint8Array): string {
|
|
27
|
+
if (typeof Buffer !== 'undefined') {
|
|
28
|
+
// Node environment
|
|
29
|
+
return Buffer.from(bytes).toString('base64');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (typeof btoa !== 'undefined') {
|
|
33
|
+
// Browser environment
|
|
34
|
+
let binary = '';
|
|
35
|
+
const chunkSize = 0x8000;
|
|
36
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
37
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
38
|
+
}
|
|
39
|
+
return btoa(binary);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
throw new Error('No base64 encoding function available.');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Convert base64 string to Uint8Array safely in both browser and Node.
|
|
47
|
+
*/
|
|
48
|
+
function fromBase64(b64: string): Uint8Array {
|
|
49
|
+
if (typeof Buffer !== 'undefined') {
|
|
50
|
+
// Node environment
|
|
51
|
+
return new Uint8Array(Buffer.from(b64, 'base64'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof atob !== 'undefined') {
|
|
55
|
+
// Browser environment
|
|
56
|
+
const binary = atob(b64);
|
|
57
|
+
const len = binary.length;
|
|
58
|
+
const out = new Uint8Array(len);
|
|
59
|
+
for (let i = 0; i < len; i++) out[i] = binary.charCodeAt(i);
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
throw new Error('No base64 decoding function available.');
|
|
64
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { slasher } from '../../../shared/utils/slasher';
|
|
4
|
+
|
|
5
|
+
describe('slasher', () => {
|
|
6
|
+
it('converts backslashes to forward slashes and dedupes by default', () => {
|
|
7
|
+
expect(slasher('a\\b\\\\c')).toBe('a/b/c');
|
|
8
|
+
expect(slasher('a////b//c')).toBe('a/b/c');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('dedupes runs of slashes including leading and trailing by default', () => {
|
|
12
|
+
expect(slasher('///a////b//c///')).toBe('/a/b/c/');
|
|
13
|
+
expect(slasher('////')).toBe('/');
|
|
14
|
+
expect(slasher('/')).toBe('/');
|
|
15
|
+
expect(slasher('')).toBe('');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('respects leading: true (ensure exactly one leading slash)', () => {
|
|
19
|
+
expect(slasher('a/b', { leading: true })).toBe('/a/b');
|
|
20
|
+
expect(slasher('///a/b', { leading: true })).toBe('/a/b');
|
|
21
|
+
expect(slasher('', { leading: true })).toBe('/');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('respects leading: false (remove all leading slashes)', () => {
|
|
25
|
+
expect(slasher('///a/b', { leading: false })).toBe('a/b');
|
|
26
|
+
expect(slasher('/a', { leading: false })).toBe('a');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('respects trailing: true (ensure exactly one trailing slash)', () => {
|
|
30
|
+
expect(slasher('a/b', { trailing: true })).toBe('a/b/');
|
|
31
|
+
expect(slasher('a/b///', { trailing: true })).toBe('a/b/');
|
|
32
|
+
expect(slasher('', { trailing: true })).toBe('/');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('respects trailing: false (remove all trailing slashes)', () => {
|
|
36
|
+
expect(slasher('a/b///', { trailing: false })).toBe('a/b');
|
|
37
|
+
expect(slasher('/', { trailing: false })).toBe('');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('respects toForward: false (do not convert backslashes)', () => {
|
|
41
|
+
expect(slasher('a\\b\\\\c', { toForward: false })).toBe('a\\b\\\\c');
|
|
42
|
+
// Forward slashes are still deduped by default
|
|
43
|
+
expect(slasher('a\\b//c', { toForward: false })).toBe('a\\b/c');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('respects dedupe: false (keep multiple slashes)', () => {
|
|
47
|
+
expect(slasher('a////b//c', { dedupe: false })).toBe('a////b//c');
|
|
48
|
+
// Leading/trailing options still apply even when dedupe is false
|
|
49
|
+
expect(
|
|
50
|
+
slasher('///a////b//c///', {
|
|
51
|
+
leading: true,
|
|
52
|
+
trailing: true,
|
|
53
|
+
dedupe: false,
|
|
54
|
+
}),
|
|
55
|
+
).toBe('/a////b//c/');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('preserves protocol double slashes (http://, https://, file://)', () => {
|
|
59
|
+
expect(slasher('http://example.com/path')).toBe(
|
|
60
|
+
'http://example.com/path',
|
|
61
|
+
);
|
|
62
|
+
expect(slasher('https://example.com/path')).toBe(
|
|
63
|
+
'https://example.com/path',
|
|
64
|
+
);
|
|
65
|
+
expect(slasher('file://C:/path/to/file')).toBe(
|
|
66
|
+
'file://C:/path/to/file',
|
|
67
|
+
);
|
|
68
|
+
expect(slasher('http://example.com//path///to//resource')).toBe(
|
|
69
|
+
'http://example.com/path/to/resource',
|
|
70
|
+
);
|
|
71
|
+
expect(slasher('https://example.com/', { trailing: false })).toBe(
|
|
72
|
+
'https://example.com',
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
{
|
|
2
|
+
"files": [],
|
|
3
|
+
"references": [
|
|
4
|
+
{
|
|
5
|
+
"path": "../../playground/.erudit/nuxt/.nuxt/tsconfig.server.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"path": "../../playground/.erudit/nuxt/.nuxt/tsconfig.app.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"path": "../../playground/.erudit/nuxt/.nuxt/tsconfig.shared.json"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "../../playground/.erudit/nuxt/.nuxt/tsconfig.node.json"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
-
<path d="M1.4,22.3c-.2,0-.4,0-.6-.2-.2-.1-.3-.2-.4-.4s-.1-.4-.2-.6,0-.4.2-.6L11,2.3c.1-.2.3-.3.4-.4s.4-.1.6-.1.4,0,.6.1.3.2.4.4l10.6,18.3c.1.2.2.4.2.6s0,.4-.2.6-.2.3-.4.4c-.2.1-.4.2-.6.2H1.4ZM3.4,20h17.3L12,5.1,3.4,20ZM12,18.9c.3,0,.6-.1.8-.3.2-.2.3-.5.3-.8s-.1-.6-.3-.8c-.2-.2-.5-.3-.8-.3s-.6.1-.8.3-.3.5-.3.8.1.6.3.8c.2.2.5.3.8.3ZM12,15.4c.3,0,.6-.1.8-.3.2-.2.3-.5.3-.8v-3.4c0-.3-.1-.6-.3-.8-.2-.2-.5-.3-.8-.3s-.6.1-.8.3-.3.5-.3.8v3.4c0,.3.1.6.3.8s.5.3.8.3Z"/>
|
|
3
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
-
<path d="M10.2,17.6h5v-2.5h-5v2.5ZM10.2,12.6h8.7v-2.5h-8.7v2.5ZM6.5,7.7h12.4v-2.5H6.5v2.5ZM6,23.8c-1.6,0-3-.6-4.2-1.7S.1,19.5.1,17.9s.3-2.2.9-3.2,1.4-1.6,2.4-2.1H.3v-2.5h7.5v7.5h-2.5v-3c-.8.2-1.4.6-1.9,1.2s-.7,1.3-.7,2.1.3,1.8,1,2.4,1.5,1,2.4,1v2.5ZM10.2,22.6v-2.5h11.2V2.7H4v5H1.5V2.7c0-.7.2-1.3.7-1.8.5-.5,1.1-.7,1.8-.7h17.4c.7,0,1.3.2,1.8.7s.7,1.1.7,1.8v17.4c0,.7-.2,1.3-.7,1.8-.5.5-1.1.7-1.8.7h-11.2Z"/>
|
|
3
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
2
|
-
<path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" />
|
|
3
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
-
<path d="M334.5,430c8.8,3.8,19,2,26-4.6l144-136c4.8-4.5,7.5-10.8,7.5-17.4s-2.7-12.9-7.5-17.4l-144-136c-7-6.6-17.2-8.4-26-4.6-8.8,3.8-14.5,12.5-14.5,22v88h-192c-17.7,0-32-14.3-32-32v-80c0-17.7-14.3-32-32-32h-32C14.3,80,0,94.3,0,112v80c0,70.7,57.3,128,128,128h192s0,88,0,88c0,9.6,5.7,18.2,14.5,22Z"/>
|
|
3
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
-
<path d="M8.1,15.9v-7.9h7.9v7.9h-7.9ZM10.7,13.3h2.6v-2.6h-2.6v2.6ZM8.1,23.8v-2.6h-2.6c-.7,0-1.3-.3-1.9-.8s-.8-1.1-.8-1.9v-2.6H.2v-2.6h2.6v-2.6H.2v-2.6h2.6v-2.6c0-.7.3-1.3.8-1.9s1.1-.8,1.9-.8h2.6V.2h2.6v2.6h2.6V.2h2.6v2.6h2.6c.7,0,1.3.3,1.9.8s.8,1.1.8,1.9v2.6h2.6v2.6h-2.6v2.6h2.6v2.6h-2.6v2.6c0,.7-.3,1.3-.8,1.9s-1.1.8-1.9.8h-2.6v2.6h-2.6v-2.6h-2.6v2.6h-2.6ZM18.6,18.6V5.4H5.4v13.1h13.1Z"/>
|
|
3
|
-
</svg>
|