erudit 4.0.0-dev.4 → 4.0.0-dev.5
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/.nuxtrc +1 -1
- package/app/app.vue +34 -34
- package/app/components/EruditLink.ts +7 -7
- package/app/components/FancyBold.vue +16 -16
- package/app/components/FancyCard.vue +52 -58
- package/app/components/FancyCardTag.vue +16 -16
- package/app/components/Loading.vue +7 -7
- package/app/components/Prose.vue +55 -52
- package/app/components/ScrollHolder.vue +13 -13
- package/app/components/SmartMedia.vue +107 -112
- package/app/components/ads/Ads.vue +17 -17
- package/app/components/ads/AdsBannerAside.vue +29 -29
- package/app/components/ads/AdsBannerBottom.vue +6 -6
- package/app/components/ads/AdsReplacer.vue +19 -21
- package/app/components/ads/provider/Custom.vue +9 -9
- package/app/components/ads/provider/Yandex.vue +56 -56
- package/app/components/aside/AsideListItem.vue +47 -52
- package/app/components/aside/AsideMajor.vue +6 -6
- package/app/components/aside/AsideMinor.vue +47 -52
- package/app/components/aside/AsidePlainMessage.vue +9 -9
- package/app/components/aside/AsideSwitch.vue +53 -54
- package/app/components/aside/major/PaneHolder.vue +61 -61
- package/app/components/aside/major/PaneSwitcher.vue +50 -55
- package/app/components/aside/major/PaneSwitcherButton.vue +24 -24
- package/app/components/aside/major/PaneTemplate.vue +3 -3
- package/app/components/aside/major/SiteInfo.vue +40 -42
- package/app/components/aside/major/contentNav/PaneBookNav.vue +107 -116
- package/app/components/aside/major/contentNav/PaneGlobalNav.vue +19 -19
- package/app/components/aside/major/contentNav/items/ContentNavBook.vue +8 -8
- package/app/components/aside/major/contentNav/items/ContentNavFolder.vue +55 -56
- package/app/components/aside/major/contentNav/items/ContentNavItem.vue +16 -16
- package/app/components/aside/major/contentNav/items/ContentNavPage.vue +2 -6
- package/app/components/aside/major/contentNav/items/ContentNavSeparator.vue +34 -35
- package/app/components/aside/major/contentNav/items/ContentNavTopic.vue +6 -6
- package/app/components/aside/major/contentNav/items/Flags.vue +31 -33
- package/app/components/aside/major/contentNav/items/ItemTemplate.vue +13 -13
- package/app/components/aside/major/languages/PaneLanguages.vue +40 -40
- package/app/components/aside/major/pages/PanePages.vue +45 -45
- package/app/components/aside/major/search/PaneSearch.vue +109 -100
- package/app/components/aside/major/search/SearchInput.vue +52 -53
- package/app/components/aside/major/search/SearchResult.vue +123 -75
- package/app/components/aside/major/search/SearchStatus.vue +28 -28
- package/app/components/aside/major/search/search.worker.ts +129 -129
- package/app/components/aside/major/settings/BuildTime.vue +15 -15
- package/app/components/aside/major/settings/EngineVersion.vue +8 -7
- package/app/components/aside/major/settings/PaneSettings.vue +8 -8
- package/app/components/aside/major/settings/ThemeSwitcher.vue +36 -36
- package/app/components/aside/major/settings/repository/Repository.vue +18 -18
- package/app/components/aside/major/settings/repository/SecondaryGitHub.vue +47 -47
- package/app/components/aside/minor/AsideMinorPane.vue +5 -5
- package/app/components/aside/minor/AsideMinorPlainHeader.vue +20 -20
- package/app/components/aside/minor/content/AsideMinorContentContributions.vue +47 -51
- package/app/components/aside/minor/content/AsideMinorContentPage.vue +37 -37
- package/app/components/aside/minor/content/AsideMinorContentTopic.vue +61 -66
- package/app/components/aside/minor/content/ButtonPaneContributions.vue +101 -114
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +112 -123
- package/app/components/aside/minor/content/Contribution.vue +36 -36
- package/app/components/aside/minor/content/Toc.vue +163 -163
- package/app/components/aside/minor/content/TocItem.vue +91 -91
- package/app/components/aside/minor/content/TopicPartButton.vue +35 -35
- package/app/components/aside/minor/contributor/AsideMinorContributor.vue +36 -39
- package/app/components/aside/minor/contributor/ItemBook.vue +33 -39
- package/app/components/aside/minor/contributor/ItemContent.vue +17 -17
- package/app/components/aside/minor/news/AsideMinorNews.vue +132 -132
- package/app/components/aside/minor/news/NewsItem.vue +69 -69
- package/app/components/aside/minor/news/RenderNewsElement.vue +42 -42
- package/app/components/aside/minor/news/elements/Mix.vue +11 -11
- package/app/components/aside/minor/news/elements/P.vue +14 -14
- package/app/components/aside/minor/news/elements/Ref.vue +59 -58
- package/app/components/aside/minor/news/elements/Text.vue +18 -18
- package/app/components/indexPage/IndexPagePersons.vue +116 -117
- package/app/components/main/MainAction.vue +26 -26
- package/app/components/main/MainBreadcrumbs.vue +28 -28
- package/app/components/main/MainContentChild.vue +44 -47
- package/app/components/main/MainContentChildren.vue +13 -14
- package/app/components/main/MainDecoration.vue +15 -15
- package/app/components/main/MainDescription.vue +13 -13
- package/app/components/main/MainFlag.vue +129 -133
- package/app/components/main/MainFlags.vue +17 -17
- package/app/components/main/MainGlow.vue +12 -12
- package/app/components/main/MainQuickLink.vue +90 -91
- package/app/components/main/MainQuickLinks.vue +40 -40
- package/app/components/main/MainQuote.vue +149 -161
- package/app/components/main/MainQuoteLoader.vue +86 -86
- package/app/components/main/MainSection.vue +44 -44
- package/app/components/main/MainSectionPreamble.vue +5 -5
- package/app/components/main/MainSubTitle.vue +11 -12
- package/app/components/main/MainTitle.vue +32 -32
- package/app/components/main/MainTopicPartPage.vue +88 -88
- package/app/components/main/MainTopicPartSwitch.vue +67 -71
- package/app/components/main/connections/Deps.vue +30 -34
- package/app/components/main/connections/Externals.vue +80 -104
- package/app/components/main/connections/MainConnections.vue +90 -94
- package/app/components/main/connections/MainConnectionsButton.vue +81 -81
- package/app/components/main/connections/ScrollPane.vue +10 -10
- package/app/components/main/contentStats/Item.vue +28 -34
- package/app/components/main/contentStats/ItemElement.vue +19 -19
- package/app/components/main/contentStats/ItemMaterials.vue +11 -11
- package/app/components/main/contentStats/MainContentStats.vue +50 -53
- package/app/components/preview/Preview.vue +110 -118
- package/app/components/preview/PreviewError.vue +4 -4
- package/app/components/preview/PreviewLoading.vue +3 -3
- package/app/components/preview/PreviewScreen.vue +48 -48
- package/app/components/preview/PreviewScreenButton.vue +27 -27
- package/app/components/preview/screen/ContentPage.vue +27 -30
- package/app/components/preview/screen/DirectLink.vue +13 -13
- package/app/components/preview/screen/Unique.vue +31 -32
- package/app/components/site/SiteAside.vue +50 -51
- package/app/components/site/SiteAsideOverlay.vue +8 -8
- package/app/components/site/SiteMain.vue +11 -11
- package/app/components/transition/Fade.vue +16 -16
- package/app/components/transition/Slide.vue +27 -27
- package/app/components/tree/TreeContainer.vue +3 -3
- package/app/components/tree/TreeItem.vue +27 -31
- package/app/composables/ads.ts +11 -11
- package/app/composables/analytics.ts +102 -102
- package/app/composables/appElements.ts +21 -21
- package/app/composables/aside.ts +15 -15
- package/app/composables/asideMajorPane.ts +82 -82
- package/app/composables/asideMinor.ts +109 -109
- package/app/composables/contentNav.ts +7 -7
- package/app/composables/favicon.ts +103 -108
- package/app/composables/file.ts +4 -3
- package/app/composables/formatText.ts +100 -100
- package/app/composables/loading.ts +26 -26
- package/app/composables/mainContent.ts +22 -22
- package/app/composables/og.ts +184 -182
- package/app/composables/phrases.ts +98 -98
- package/app/composables/preview.ts +44 -44
- package/app/composables/route.ts +4 -2
- package/app/composables/theme.ts +47 -51
- package/app/composables/url.ts +19 -11
- package/app/formatters/ru.ts +14 -14
- package/app/pages/article/[...articleId].vue +12 -12
- package/app/pages/book/[...bookId].vue +56 -56
- package/app/pages/contributor/[contributorId].vue +144 -150
- package/app/pages/contributors.vue +95 -102
- package/app/pages/group/[...groupId].vue +58 -58
- package/app/pages/index.vue +113 -117
- package/app/pages/page/[...pageId].vue +60 -60
- package/app/pages/practice/[...practiceId].vue +12 -12
- package/app/pages/sponsors.vue +88 -92
- package/app/pages/summary/[...summaryId].vue +12 -12
- package/app/plugins/appSetup/client/htmlBranding.ts +6 -6
- package/app/plugins/appSetup/client/welcome.ts +37 -35
- package/app/plugins/appSetup/config.ts +6 -6
- package/app/plugins/appSetup/global.ts +3 -3
- package/app/plugins/appSetup/index.ts +27 -28
- package/app/plugins/prerender.server.ts +40 -40
- package/app/router.options.ts +5 -5
- package/app/scripts/theme.js +21 -24
- package/app/styles/main.css +128 -124
- package/bin/erudit.js +12 -0
- package/modules/erudit/env.ts +8 -0
- package/modules/erudit/globals/content.ts +4 -4
- package/modules/erudit/globals/contributor.ts +1 -1
- package/modules/erudit/globals/eruditConfig.ts +5 -10
- package/modules/erudit/globals/problem.ts +1 -1
- package/modules/erudit/globals/prose.ts +1 -1
- package/modules/erudit/globals/public.ts +18 -18
- package/modules/erudit/index.ts +50 -60
- package/modules/erudit/logger.ts +10 -10
- package/modules/erudit/setup/elements/appTemplate.ts +44 -45
- package/modules/erudit/setup/elements/globalTemplate.ts +82 -82
- package/modules/erudit/setup/elements/globalTypes.ts +259 -273
- package/modules/erudit/setup/elements/setup.ts +163 -167
- package/modules/erudit/setup/elements/shared.ts +10 -10
- package/modules/erudit/setup/elements/tagsTable.ts +28 -28
- package/modules/erudit/setup/fullRestart.ts +61 -71
- package/modules/erudit/setup/globals.ts +206 -196
- package/modules/erudit/setup/publicAssets.ts +43 -52
- package/modules/erudit/setup/runtimeConfig.ts +106 -58
- package/modules/erudit/watcher.ts +20 -27
- package/nuxt.config.ts +102 -84
- package/package.json +51 -55
- package/server/api/aside/major/frontNav/book/[...shortId].ts +10 -10
- package/server/api/aside/major/frontNav/global.ts +5 -5
- package/server/api/aside/major/pages.ts +6 -6
- package/server/api/contributor/list.ts +60 -61
- package/server/api/contributor/page/[contributorId].ts +68 -68
- package/server/api/indexPage.ts +81 -81
- package/server/api/language/functions.ts +11 -11
- package/server/api/language/phrase/[phraseKey].ts +35 -35
- package/server/api/main/content/[...contentTypePath].ts +149 -153
- package/server/api/news/batch/[batchIndex].ts +5 -5
- package/server/api/pageSponsors.ts +56 -58
- package/server/api/prerender/content.ts +79 -82
- package/server/api/prerender/default.ts +35 -35
- package/server/api/prerender/files.ts +10 -10
- package/server/api/prerender/frontNav.ts +13 -13
- package/server/api/prerender/language.ts +7 -7
- package/server/api/prerender/news.ts +8 -8
- package/server/api/prerender/quotes.ts +15 -15
- package/server/api/preview/contentPage/[...contentTypePath].ts +63 -63
- package/server/api/preview/contentUnique/[...contentTypePathUnique].ts +73 -81
- package/server/api/problemScript/[...problemScriptPath].ts +88 -92
- package/server/api/quote/data/[quoteId].ts +84 -87
- package/server/api/quote/ids.ts +3 -3
- package/server/erudit/build.ts +132 -137
- package/server/erudit/cameos/build.ts +161 -161
- package/server/erudit/config.ts +13 -13
- package/server/erudit/content/global/build.ts +300 -297
- package/server/erudit/content/global/singleton.ts +5 -5
- package/server/erudit/content/nav/build.ts +459 -463
- package/server/erudit/content/nav/front.ts +125 -127
- package/server/erudit/content/nav/repository/books.ts +37 -40
- package/server/erudit/content/nav/repository/get.ts +33 -33
- package/server/erudit/content/nav/repository/hasChildren.ts +5 -5
- package/server/erudit/content/nav/repository/hasNav.ts +3 -3
- package/server/erudit/content/nav/repository/hasParent.ts +5 -5
- package/server/erudit/content/nav/repository/id.ts +9 -9
- package/server/erudit/content/nav/repository/index.ts +9 -9
- package/server/erudit/content/nav/repository/order.ts +14 -14
- package/server/erudit/content/nav/repository/previousNext.ts +35 -35
- package/server/erudit/content/nav/repository/walk.ts +127 -127
- package/server/erudit/content/nav/setup.ts +13 -13
- package/server/erudit/content/nav/types.ts +24 -24
- package/server/erudit/content/repository/breadcrumbs.ts +24 -24
- package/server/erudit/content/repository/children.ts +47 -47
- package/server/erudit/content/repository/connections.ts +35 -35
- package/server/erudit/content/repository/contentLink.ts +16 -16
- package/server/erudit/content/repository/decoration.ts +23 -23
- package/server/erudit/content/repository/deps.ts +121 -84
- package/server/erudit/content/repository/description.ts +11 -11
- package/server/erudit/content/repository/elementSnippets.ts +105 -105
- package/server/erudit/content/repository/externals.ts +50 -50
- package/server/erudit/content/repository/flags.ts +33 -33
- package/server/erudit/content/repository/seo.ts +12 -12
- package/server/erudit/content/repository/stats.ts +97 -97
- package/server/erudit/content/repository/title.ts +27 -27
- package/server/erudit/content/repository/topicParts.ts +39 -39
- package/server/erudit/content/repository/unique.ts +76 -76
- package/server/erudit/content/resolve/book.ts +29 -32
- package/server/erudit/content/resolve/group.ts +34 -39
- package/server/erudit/content/resolve/index.ts +272 -290
- package/server/erudit/content/resolve/page.ts +80 -87
- package/server/erudit/content/resolve/topic.ts +220 -246
- package/server/erudit/content/resolve/utils/contentError.ts +10 -10
- package/server/erudit/content/resolve/utils/insertContentItem.ts +113 -122
- package/server/erudit/content/resolve/utils/insertContentResolved.ts +126 -132
- package/server/erudit/content/search.ts +146 -163
- package/server/erudit/contributors/build.ts +158 -166
- package/server/erudit/contributors/global.ts +3 -3
- package/server/erudit/contributors/repository/avatarUrl.ts +10 -10
- package/server/erudit/contributors/repository/contributions.ts +171 -178
- package/server/erudit/contributors/repository/count.ts +3 -3
- package/server/erudit/contributors/search.ts +34 -34
- package/server/erudit/db/repository/pushFile.ts +23 -26
- package/server/erudit/db/repository/pushProblemScript.ts +19 -19
- package/server/erudit/db/repository/pushProseLink.ts +40 -40
- package/server/erudit/db/schema/cameos.ts +7 -7
- package/server/erudit/db/schema/content.ts +18 -18
- package/server/erudit/db/schema/contentContributions.ts +15 -15
- package/server/erudit/db/schema/contentDeps.ts +21 -21
- package/server/erudit/db/schema/contentElementStats.ts +20 -20
- package/server/erudit/db/schema/contentProseLinks.ts +23 -23
- package/server/erudit/db/schema/contentSnippets.ts +15 -15
- package/server/erudit/db/schema/contentToc.ts +16 -16
- package/server/erudit/db/schema/contentUniques.ts +19 -25
- package/server/erudit/db/schema/contributors.ts +12 -12
- package/server/erudit/db/schema/files.ts +11 -11
- package/server/erudit/db/schema/groups.ts +6 -6
- package/server/erudit/db/schema/index.ts +17 -17
- package/server/erudit/db/schema/news.ts +7 -7
- package/server/erudit/db/schema/pages.ts +7 -7
- package/server/erudit/db/schema/problemScripts.ts +14 -14
- package/server/erudit/db/schema/sponsors.ts +9 -9
- package/server/erudit/db/schema/topics.ts +9 -9
- package/server/erudit/db/setup.ts +62 -62
- package/server/erudit/db/types.ts +10 -10
- package/server/erudit/global.ts +38 -33
- package/server/erudit/importer.ts +94 -97
- package/server/erudit/index.ts +96 -90
- package/server/erudit/language/list/en.ts +116 -116
- package/server/erudit/language/list/ru.ts +120 -120
- package/server/erudit/language/list.ts +6 -6
- package/server/erudit/language/setup.ts +36 -36
- package/server/erudit/language/types.ts +16 -16
- package/server/erudit/logger.ts +73 -77
- package/server/erudit/news/build.ts +112 -114
- package/server/erudit/news/repository/batch.ts +61 -61
- package/server/erudit/path.ts +19 -0
- package/server/erudit/prose/repository/finalize.ts +68 -68
- package/server/erudit/prose/repository/get.ts +54 -54
- package/server/erudit/prose/repository/resolve.ts +17 -17
- package/server/erudit/prose/storage/callout.ts +16 -14
- package/server/erudit/prose/storage/image.ts +22 -20
- package/server/erudit/prose/storage/link.ts +222 -226
- package/server/erudit/prose/storage/problemScript.ts +23 -21
- package/server/erudit/prose/storage/video.ts +16 -14
- package/server/erudit/prose/transform/bundleProblemScript.ts +6 -6
- package/server/erudit/prose/transform/extensions.ts +15 -15
- package/server/erudit/quote/repository/ids.ts +31 -31
- package/server/erudit/repository.ts +96 -96
- package/server/erudit/sponsors/build.ts +161 -165
- package/server/erudit/sponsors/repository/avatarUrl.ts +10 -10
- package/server/erudit/sponsors/repository/count.ts +4 -4
- package/server/erudit/staticFile.ts +28 -28
- package/server/plugins/augmentCss.ts +17 -17
- package/server/plugins/lang.ts +5 -7
- package/server/plugins/metaViewport.ts +15 -15
- package/server/plugins/theme.ts +13 -13
- package/server/routes/file/[...path].ts +18 -18
- package/server/routes/robots.txt.ts +9 -9
- package/server/routes/search.json.gz.ts +76 -75
- package/server/routes/sitemap.xml.ts +83 -81
- package/shared/search/encoders.ts +10 -10
- package/shared/types/asideMajorPages.ts +2 -2
- package/shared/types/breadcrumbs.ts +3 -3
- package/shared/types/contentChildren.ts +10 -10
- package/shared/types/contentConnections.ts +27 -27
- package/shared/types/contentStats.ts +6 -6
- package/shared/types/elementSnippet.ts +14 -14
- package/shared/types/frontContentNav.ts +17 -17
- package/shared/types/indexPage.ts +20 -20
- package/shared/types/language.ts +174 -174
- package/shared/types/mainContent.ts +40 -40
- package/shared/types/news.ts +13 -13
- package/shared/types/preview.ts +28 -28
- package/shared/types/runtimeConfig.ts +29 -48
- package/shared/types/search.ts +32 -32
- package/shared/utils/contentTypePath.ts +44 -44
- package/shared/utils/icons.ts +7 -7
- package/shared/utils/pages.ts +19 -20
- package/shared/utils/stringColor.ts +8 -8
- package/shared/utils/toStringEqual.ts +13 -13
- package/shared/utils/zip.ts +64 -64
- package/test/shared/utils/zip.test.ts +8 -8
- package/tsconfig.json +15 -15
- package/bin/erudit.mjs +0 -2
- package/modules/erudit/setup/aliases.ts +0 -17
- package/modules/erudit/setup/baseUrl.ts +0 -19
- package/modules/erudit/setup/nuxtConfig.ts +0 -62
- package/modules/erudit/setup/projectConfig.ts +0 -115
- package/shared/utils/slasher.ts +0 -64
- package/test/shared/utils/slasher.test.ts +0 -75
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import type { EruditAds } from '@erudit-js/core/eruditConfig/ads';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
LazyAdsProviderCustom,
|
|
6
|
+
LazyAdsProviderYandex,
|
|
7
|
+
LazyAdsReplacer,
|
|
8
8
|
} from '#components';
|
|
9
9
|
|
|
10
10
|
const props = defineProps<{ data: EruditAds }>();
|
|
@@ -14,26 +14,26 @@ const adsKey = ref(0);
|
|
|
14
14
|
const AdsComponent = shallowRef<Component>();
|
|
15
15
|
|
|
16
16
|
function updateAds() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
AdsComponent.value = (() => {
|
|
18
|
+
switch (props.data?.provider) {
|
|
19
|
+
case 'replacer':
|
|
20
|
+
return LazyAdsReplacer;
|
|
21
|
+
case 'yandex':
|
|
22
|
+
return LazyAdsProviderYandex;
|
|
23
|
+
case 'custom':
|
|
24
|
+
return LazyAdsProviderCustom;
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return undefined;
|
|
28
|
+
})();
|
|
29
|
+
adsKey.value++;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
onMounted(() => {
|
|
33
|
-
|
|
33
|
+
watch(() => route.path, updateAds, { immediate: true });
|
|
34
34
|
});
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<template>
|
|
38
|
-
|
|
38
|
+
<AdsComponent v-if="AdsComponent" :data :key="adsKey" />
|
|
39
39
|
</template>
|
|
@@ -4,42 +4,42 @@ import type { EruditAds } from '@erudit-js/core/eruditConfig/ads';
|
|
|
4
4
|
const adsData = ref<EruditAds>();
|
|
5
5
|
|
|
6
6
|
onMounted(() => {
|
|
7
|
-
|
|
7
|
+
const asideAds = ERUDIT.config.ads!.aside!;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
if (asideAds.provider === 'custom') {
|
|
10
|
+
let banners =
|
|
11
|
+
window.innerHeight <= 700
|
|
12
|
+
? asideAds.banners.mobile
|
|
13
|
+
: asideAds.banners.full;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!banners) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
15
|
+
if (!banners) {
|
|
16
|
+
banners = asideAds.banners.full || asideAds.banners.mobile;
|
|
17
|
+
}
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
banners: banners,
|
|
26
|
-
};
|
|
27
|
-
} else {
|
|
28
|
-
adsData.value = asideAds;
|
|
19
|
+
if (!banners) {
|
|
20
|
+
return;
|
|
29
21
|
}
|
|
22
|
+
|
|
23
|
+
adsData.value = {
|
|
24
|
+
provider: 'custom',
|
|
25
|
+
banners: banners,
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
adsData.value = asideAds;
|
|
29
|
+
}
|
|
30
30
|
});
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<template>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<section
|
|
35
|
+
v-if="adsData"
|
|
36
|
+
class="p-small border-border border-t [@media(max-height:500px)]:hidden"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
class="relative max-h-[300px] overflow-hidden
|
|
40
|
+
[@media(max-height:700px)]:max-h-[100px]"
|
|
37
41
|
>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
<Ads :data="adsData" />
|
|
43
|
-
</div>
|
|
44
|
-
</section>
|
|
42
|
+
<Ads :data="adsData" />
|
|
43
|
+
</div>
|
|
44
|
+
</section>
|
|
45
45
|
</template>
|
|
@@ -4,14 +4,14 @@ import type { EruditAds } from '@erudit-js/core/eruditConfig/ads';
|
|
|
4
4
|
const adsData = ref<EruditAds>();
|
|
5
5
|
|
|
6
6
|
onMounted(() => {
|
|
7
|
-
|
|
7
|
+
adsData.value = ERUDIT.config.ads!.bottom!;
|
|
8
8
|
});
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
<section v-if="adsData" class="px-main py-main">
|
|
13
|
+
<div class="relative max-h-[300px] overflow-hidden">
|
|
14
|
+
<Ads :data="adsData" />
|
|
15
|
+
</div>
|
|
16
|
+
</section>
|
|
17
17
|
</template>
|
|
@@ -3,26 +3,24 @@ const phrase = await usePhrases('ads_replacer');
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
></div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
6
|
+
<div class="max-h-[inherit] overflow-hidden">
|
|
7
|
+
<div class="h-dvh w-dvw"></div>
|
|
8
|
+
<div class="[container-type:size] absolute top-0 left-0 h-full w-full">
|
|
9
|
+
<div
|
|
10
|
+
class="text-text-muted gap-normal @max-[550px]:gap-small flex h-full
|
|
11
|
+
w-full flex-row items-center justify-center bg-neutral-200
|
|
12
|
+
shadow-[inset_0px_0px_5px_0px_light-dark(rgba(0,0,0,0.12),rgba(255,255,255,0.08))]
|
|
13
|
+
@max-[550px]:flex-col @max-[550px]:text-center dark:bg-neutral-800"
|
|
14
|
+
>
|
|
15
|
+
<MyIcon
|
|
16
|
+
name="handshake"
|
|
17
|
+
class="text-[70px] [@container(max-height:150px)]:hidden"
|
|
18
|
+
/>
|
|
19
|
+
<div
|
|
20
|
+
v-html="phrase.ads_replacer"
|
|
21
|
+
class="p-small text-lg @max-[550px]:text-sm"
|
|
22
|
+
></div>
|
|
23
|
+
</div>
|
|
27
24
|
</div>
|
|
25
|
+
</div>
|
|
28
26
|
</template>
|
|
@@ -4,16 +4,16 @@ import type { EruditAdsCustom } from '@erudit-js/core/eruditConfig/ads';
|
|
|
4
4
|
const props = defineProps<{ data: EruditAdsCustom }>();
|
|
5
5
|
|
|
6
6
|
const randomBanner =
|
|
7
|
-
|
|
7
|
+
props.data.banners[Math.floor(Math.random() * props.data.banners.length)]!;
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
<div>
|
|
12
|
+
<a :href="randomBanner.link" target="_blank" class="block">
|
|
13
|
+
<img
|
|
14
|
+
:src="randomBanner.src"
|
|
15
|
+
class="mx-auto my-0 block object-contain object-center"
|
|
16
|
+
/>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
19
|
</template>
|
|
@@ -2,83 +2,83 @@
|
|
|
2
2
|
import type { EruditAdsYandex } from '@erudit-js/core/eruditConfig/ads';
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
interface Window {
|
|
6
|
+
yaContextCb: Array<() => void>;
|
|
7
|
+
__yandexScriptLoaded?: boolean;
|
|
8
|
+
__yandexScriptLoading?: boolean;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
var Ya: any;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const props = defineProps<{ data: EruditAdsYandex }>();
|
|
15
15
|
const uid = useId();
|
|
16
16
|
|
|
17
17
|
const loadYandexScript = (): Promise<void> => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
// Script already loaded
|
|
20
|
+
if (window.__yandexScriptLoaded) {
|
|
21
|
+
resolve();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
checkLoaded();
|
|
35
|
-
return;
|
|
25
|
+
// Script is currently loading, wait for it
|
|
26
|
+
if (window.__yandexScriptLoading) {
|
|
27
|
+
const checkLoaded = () => {
|
|
28
|
+
if (window.__yandexScriptLoaded) {
|
|
29
|
+
resolve();
|
|
30
|
+
} else {
|
|
31
|
+
setTimeout(checkLoaded, 50);
|
|
36
32
|
}
|
|
33
|
+
};
|
|
34
|
+
checkLoaded();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
// Load script for the first time
|
|
39
|
+
window.__yandexScriptLoading = true;
|
|
40
|
+
window.yaContextCb = window.yaContextCb || [];
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const script = document.createElement('script');
|
|
43
|
+
script.src = 'https://yandex.ru/ads/system/context.js';
|
|
44
|
+
script.async = true;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
script.onload = () => {
|
|
47
|
+
window.__yandexScriptLoaded = true;
|
|
48
|
+
window.__yandexScriptLoading = false;
|
|
49
|
+
resolve();
|
|
50
|
+
};
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
script.onerror = () => {
|
|
53
|
+
window.__yandexScriptLoading = false;
|
|
54
|
+
reject(new Error('Failed to load Yandex context script'));
|
|
55
|
+
};
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
document.head.appendChild(script);
|
|
58
|
+
});
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
onMounted(async () => {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
try {
|
|
63
|
+
await loadYandexScript();
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const { binaryTheme } = useTheme();
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
window.yaContextCb.push(() => {
|
|
68
|
+
Ya?.Context?.AdvManager?.render({
|
|
69
|
+
blockId: props.data.blockId,
|
|
70
|
+
renderTo: uid,
|
|
71
|
+
darkTheme: binaryTheme.value === 'dark',
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error('Failed to load Yandex ads:', error);
|
|
76
|
+
}
|
|
77
77
|
});
|
|
78
78
|
</script>
|
|
79
79
|
|
|
80
80
|
<template>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
<div :id="uid">
|
|
82
|
+
<AdsReplacer />
|
|
83
|
+
</div>
|
|
84
84
|
</template>
|
|
@@ -2,65 +2,60 @@
|
|
|
2
2
|
import type { MaybeMyIconName } from '#my-icons';
|
|
3
3
|
|
|
4
4
|
const { to, hoverable = true } = defineProps<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
to?: string;
|
|
6
|
+
icon?: MaybeMyIconName;
|
|
7
|
+
main?: string;
|
|
8
|
+
secondary?: string | number;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
hoverable?: boolean;
|
|
11
11
|
}>();
|
|
12
12
|
|
|
13
13
|
const isExternalLink = computed(() => {
|
|
14
|
-
|
|
14
|
+
return to?.startsWith('http');
|
|
15
15
|
});
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:name="icon"
|
|
38
|
-
class="shrink-0 text-[23px]"
|
|
39
|
-
/>
|
|
40
|
-
<slot name="icon" v-else-if="$slots.icon"></slot>
|
|
19
|
+
<EruditLink
|
|
20
|
+
:class="[
|
|
21
|
+
`border-border block min-h-(--h-min-aside-item) border-b bg-transparent
|
|
22
|
+
text-sm transition-[background,color]`,
|
|
23
|
+
hoverable && 'hocus:bg-bg-accent cursor-pointer',
|
|
24
|
+
active
|
|
25
|
+
? 'text-brand'
|
|
26
|
+
: ['text-text-muted', hoverable && 'hocus:text-text'],
|
|
27
|
+
]"
|
|
28
|
+
:to
|
|
29
|
+
>
|
|
30
|
+
<slot>
|
|
31
|
+
<div
|
|
32
|
+
class="gap-normal px-normal flex min-h-(--h-min-aside-item)
|
|
33
|
+
items-center"
|
|
34
|
+
>
|
|
35
|
+
<MaybeMyIcon v-if="icon" :name="icon" class="shrink-0 text-[23px]" />
|
|
36
|
+
<slot name="icon" v-else-if="$slots.icon"></slot>
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<slot name="main" v-else-if="$slots.main"></slot>
|
|
38
|
+
<span v-if="main" class="relative">
|
|
39
|
+
{{ main }}
|
|
40
|
+
<MyIcon
|
|
41
|
+
v-if="isExternalLink"
|
|
42
|
+
name="arrow/outward"
|
|
43
|
+
class="text-text-dimmed absolute -top-[1px] -right-[16px] text-xs"
|
|
44
|
+
/>
|
|
45
|
+
</span>
|
|
46
|
+
<slot name="main" v-else-if="$slots.main"></slot>
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
48
|
+
<span
|
|
49
|
+
v-if="secondary"
|
|
50
|
+
:class="[
|
|
51
|
+
'text-text-dimmed text-xs font-[500]',
|
|
52
|
+
isExternalLink && 'ps-[5px]',
|
|
53
|
+
]"
|
|
54
|
+
>
|
|
55
|
+
{{ secondary }}
|
|
56
|
+
</span>
|
|
57
|
+
<slot name="secondary" v-else-if="$slots.secondary"></slot>
|
|
58
|
+
</div>
|
|
59
|
+
</slot>
|
|
60
|
+
</EruditLink>
|
|
66
61
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<div class="flex h-full flex-col">
|
|
3
|
+
<AsideMajorSiteInfo />
|
|
4
|
+
<AsideMajorPaneSwitcher />
|
|
5
|
+
<AsideMajorPaneHolder />
|
|
6
|
+
<AdsBannerAside v-if="adsAsideAllowed()" />
|
|
7
|
+
</div>
|
|
8
8
|
</template>
|
|
@@ -6,68 +6,63 @@ const loadingIconDelay = 500;
|
|
|
6
6
|
let loadingTimer: ReturnType<typeof setTimeout> | null = null;
|
|
7
7
|
|
|
8
8
|
onMounted(() => {
|
|
9
|
-
|
|
9
|
+
mouted.value = true;
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
watch(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
asideMinorState,
|
|
14
|
+
() => {
|
|
15
|
+
if (loadingTimer) {
|
|
16
|
+
clearTimeout(loadingTimer);
|
|
17
|
+
loadingTimer = null;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
showLoadingIcon.value = false;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
loadingTimer = setTimeout(() => {
|
|
23
|
+
showLoadingIcon.value = true;
|
|
24
|
+
}, loadingIconDelay);
|
|
25
|
+
},
|
|
26
|
+
{ immediate: true },
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
onUnmounted(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if (loadingTimer) {
|
|
31
|
+
clearTimeout(loadingTimer);
|
|
32
|
+
}
|
|
33
33
|
});
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<div v-else></div>
|
|
69
|
-
</template>
|
|
70
|
-
</Suspense>
|
|
71
|
-
</TransitionFade>
|
|
72
|
-
</div>
|
|
37
|
+
<div class="absolute top-0 left-0 h-full w-full">
|
|
38
|
+
<TransitionFade>
|
|
39
|
+
<Suspense v-if="mouted" :key="asideMinorState?.type">
|
|
40
|
+
<template #default :timeout="10">
|
|
41
|
+
<LazyAsideMinorNews v-if="asideMinorState?.type === 'news'" />
|
|
42
|
+
<LazyAsideMinorContributor
|
|
43
|
+
v-else-if="asideMinorState?.type === 'contributor'"
|
|
44
|
+
/>
|
|
45
|
+
<LazyAsideMinorContentContributions
|
|
46
|
+
v-else-if="asideMinorState?.type === 'content-contributions'"
|
|
47
|
+
/>
|
|
48
|
+
<LazyAsideMinorContentPage
|
|
49
|
+
v-else-if="asideMinorState?.type === 'content-page'"
|
|
50
|
+
/>
|
|
51
|
+
<LazyAsideMinorContentTopic
|
|
52
|
+
v-else-if="asideMinorState?.type === 'content-topic'"
|
|
53
|
+
/>
|
|
54
|
+
<div v-else></div>
|
|
55
|
+
</template>
|
|
56
|
+
<template #fallback>
|
|
57
|
+
<div
|
|
58
|
+
v-if="showLoadingIcon"
|
|
59
|
+
class="absolute top-0 left-0 grid h-full w-full place-items-center"
|
|
60
|
+
>
|
|
61
|
+
<Loading class="text-text-disabled text-[65px]" />
|
|
62
|
+
</div>
|
|
63
|
+
<div v-else></div>
|
|
64
|
+
</template>
|
|
65
|
+
</Suspense>
|
|
66
|
+
</TransitionFade>
|
|
67
|
+
</div>
|
|
73
68
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
defineProps<{ text: string }>();
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
defineProps<{ text: string }>();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<p class="text-text-dimmed px-normal py-big text-center font-semibold">
|
|
7
|
+
{{ formatText(text) }}
|
|
8
|
+
</p>
|
|
9
|
+
</template>
|