erudit 2.0.0-dev.7
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 -0
- package/app/app.vue +172 -0
- package/app/assets/icons/alert.svg +3 -0
- package/app/assets/icons/angle-right.svg +3 -0
- package/app/assets/icons/arrow-in-text.svg +3 -0
- package/app/assets/icons/arrow-left.svg +3 -0
- package/app/assets/icons/arrow-up-to-right.svg +3 -0
- package/app/assets/icons/aside-open.svg +3 -0
- package/app/assets/icons/asterisk.svg +3 -0
- package/app/assets/icons/book-question.svg +3 -0
- package/app/assets/icons/book.svg +3 -0
- package/app/assets/icons/bug.svg +3 -0
- package/app/assets/icons/chip.svg +3 -0
- package/app/assets/icons/circle-help.svg +3 -0
- package/app/assets/icons/construction.svg +3 -0
- package/app/assets/icons/cross.svg +3 -0
- package/app/assets/icons/draw.svg +3 -0
- package/app/assets/icons/ellipsis-vertical.svg +3 -0
- package/app/assets/icons/file-check.svg +3 -0
- package/app/assets/icons/file-lines.svg +3 -0
- package/app/assets/icons/file-star.svg +3 -0
- package/app/assets/icons/folder-open.svg +3 -0
- package/app/assets/icons/folder.svg +3 -0
- package/app/assets/icons/globe.svg +3 -0
- package/app/assets/icons/house.svg +3 -0
- package/app/assets/icons/link-external.svg +3 -0
- package/app/assets/icons/link.svg +3 -0
- package/app/assets/icons/moon.svg +3 -0
- package/app/assets/icons/outline/book.svg +3 -0
- package/app/assets/icons/outline/file-lines.svg +3 -0
- package/app/assets/icons/pirate.svg +3 -0
- package/app/assets/icons/plus-circle.svg +3 -0
- package/app/assets/icons/plus.svg +3 -0
- package/app/assets/icons/puzzle.svg +3 -0
- package/app/assets/icons/search.svg +3 -0
- package/app/assets/icons/shuffle.svg +3 -0
- package/app/assets/icons/star.svg +3 -0
- package/app/assets/icons/sun-moon.svg +3 -0
- package/app/assets/icons/sun.svg +3 -0
- package/app/assets/icons/user.svg +3 -0
- package/app/assets/icons/users.svg +3 -0
- package/app/components/Loading.vue +23 -0
- package/app/components/SiteAside.vue +382 -0
- package/app/components/SiteMain.vue +35 -0
- package/app/components/ads/BannerTemplate.vue +51 -0
- package/app/components/ads/BottomBanner.vue +45 -0
- package/app/components/ads/LeftBanner.vue +50 -0
- package/app/components/aside/AsideListItem.vue +74 -0
- package/app/components/aside/AsideMajor.vue +56 -0
- package/app/components/aside/AsideMinor.vue +71 -0
- package/app/components/aside/major/PaneContentScroll.vue +23 -0
- package/app/components/aside/major/PaneSwitch.vue +54 -0
- package/app/components/aside/major/PaneSwitchButton.vue +63 -0
- package/app/components/aside/major/SiteInfo.vue +85 -0
- package/app/components/aside/major/panes/Language.vue +79 -0
- package/app/components/aside/major/panes/Pages.vue +34 -0
- package/app/components/aside/major/panes/Search.vue +3 -0
- package/app/components/aside/major/panes/nav/Nav.vue +91 -0
- package/app/components/aside/major/panes/nav/NavBook.vue +86 -0
- package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -0
- package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -0
- package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -0
- package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -0
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -0
- package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -0
- package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -0
- package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -0
- package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -0
- package/app/components/aside/major/panes/other/ItemContent.vue +29 -0
- package/app/components/aside/major/panes/other/ItemGenerator.vue +15 -0
- package/app/components/aside/major/panes/other/ItemTheme.vue +54 -0
- package/app/components/aside/major/panes/other/Other.vue +16 -0
- package/app/components/aside/minor/AsideMinorContributor.vue +5 -0
- package/app/components/aside/minor/AsideMinorNews.vue +11 -0
- package/app/components/aside/minor/AsideMinorPane.vue +16 -0
- package/app/components/aside/minor/AsideMinorTopLink.vue +67 -0
- package/app/components/aside/minor/Contribute.vue +145 -0
- package/app/components/aside/minor/content/AsideMinorContent.vue +92 -0
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +32 -0
- package/app/components/aside/minor/topic/TopicContributors.vue +177 -0
- package/app/components/aside/minor/topic/TopicNav.vue +49 -0
- package/app/components/aside/minor/topic/TopicToc.vue +202 -0
- package/app/components/aside/minor/topic/TopicTocItem.vue +31 -0
- package/app/components/aside/utils/AsideOverlayPane.vue +40 -0
- package/app/components/bitran/BitranContent.vue +64 -0
- package/app/components/bitran/RenderWrapper.vue +12 -0
- package/app/components/contributor/ContributorAvatar.vue +43 -0
- package/app/components/contributor/ContributorListItem.vue +35 -0
- package/app/components/main/topic/MainTopic.vue +79 -0
- package/app/components/main/topic/TopicPartSwitch.vue +118 -0
- package/app/components/main/utils/Breadcrumb.vue +75 -0
- package/app/components/main/utils/ContentDecoration.vue +29 -0
- package/app/components/main/utils/ContentDescription.vue +20 -0
- package/app/components/main/utils/ContentFlag.vue +16 -0
- package/app/components/main/utils/ContentPopover.vue +176 -0
- package/app/components/main/utils/ContentPopovers.vue +105 -0
- package/app/components/main/utils/ContentReferences.vue +76 -0
- package/app/components/main/utils/ContentSection.vue +42 -0
- package/app/components/main/utils/ContentTitle.vue +37 -0
- package/app/components/main/utils/reference/ReferenceGroup.vue +41 -0
- package/app/components/main/utils/reference/ReferenceItem.vue +64 -0
- package/app/components/main/utils/reference/ReferenceSource.vue +110 -0
- package/app/components/preview/Preview.vue +177 -0
- package/app/components/preview/PreviewDisplay.vue +139 -0
- package/app/components/preview/PreviewFooterAction.vue +73 -0
- package/app/components/preview/PreviewLoading.vue +15 -0
- package/app/components/preview/PreviewScreen.vue +99 -0
- package/app/components/preview/display/Alert.vue +50 -0
- package/app/components/preview/display/Custom.vue +18 -0
- package/app/components/preview/display/GenericLink.vue +48 -0
- package/app/components/preview/display/PageLink.vue +20 -0
- package/app/components/preview/display/Unique.vue +49 -0
- package/app/components/transition/Fade.vue +22 -0
- package/app/components/tree/TreeContainer.vue +12 -0
- package/app/components/tree/TreeItem.vue +89 -0
- package/app/composables/bitran.ts +132 -0
- package/app/composables/bitranContent.ts +36 -0
- package/app/composables/bitranLocation.ts +7 -0
- package/app/composables/contentData.ts +36 -0
- package/app/composables/contentPage.ts +156 -0
- package/app/composables/contentRoute.ts +45 -0
- package/app/composables/darkMagic.ts +24 -0
- package/app/composables/externalApi.ts +63 -0
- package/app/composables/favicon.ts +8 -0
- package/app/composables/formatText.ts +86 -0
- package/app/composables/majorPane.ts +60 -0
- package/app/composables/phrases.ts +80 -0
- package/app/composables/theme.ts +29 -0
- package/app/composables/url.ts +33 -0
- package/app/pages/_test/preview.vue +110 -0
- package/app/pages/article/[...articleId].vue +3 -0
- package/app/pages/book/[...bookId].vue +47 -0
- package/app/pages/group/[...groupId].vue +64 -0
- package/app/pages/index.vue +32 -0
- package/app/pages/members.vue +7 -0
- package/app/pages/practice/[...practice].vue +3 -0
- package/app/pages/summary/[...summaryId].vue +3 -0
- package/app/public/favicon/article.svg +10 -0
- package/app/public/favicon/default.svg +10 -0
- package/app/public/favicon/practice.svg +10 -0
- package/app/public/favicon/summary.svg +10 -0
- package/app/public/logotype.svg +17 -0
- package/app/public/og-default.png +0 -0
- package/app/public/user.svg +10 -0
- package/app/scripts/_immediate.js +4 -0
- package/app/scripts/aside/index.ts +59 -0
- package/app/scripts/aside/major/nav.ts +26 -0
- package/app/scripts/aside/minor/state.ts +37 -0
- package/app/scripts/aside/minor/topic.ts +3 -0
- package/app/scripts/flag.ts +28 -0
- package/app/scripts/og.ts +27 -0
- package/app/scripts/preview/build.ts +84 -0
- package/app/scripts/preview/data/alert.ts +19 -0
- package/app/scripts/preview/data/custom.ts +8 -0
- package/app/scripts/preview/data/genericLink.ts +24 -0
- package/app/scripts/preview/data/pageLink.ts +20 -0
- package/app/scripts/preview/data/unique.ts +70 -0
- package/app/scripts/preview/data.ts +26 -0
- package/app/scripts/preview/display.ts +39 -0
- package/app/scripts/preview/footer.ts +9 -0
- package/app/scripts/preview/request.ts +51 -0
- package/app/scripts/preview/state.ts +63 -0
- package/app/styles/_immediate.css +3 -0
- package/app/styles/_util.scss +50 -0
- package/app/styles/_utils.scss +44 -0
- package/app/styles/app.scss +91 -0
- package/app/styles/def/_bp.scss +24 -0
- package/app/styles/def/_size.scss +7 -0
- package/app/styles/def/_z.scss +5 -0
- package/app/styles/default.scss +85 -0
- package/app/styles/normalize.scss +63 -0
- package/app/styles/partials/_darkMagic.scss +7 -0
- package/app/styles/partials/_fnav.scss +18 -0
- package/app/styles/partials/_preview.scss +7 -0
- package/globalPath.ts +24 -0
- package/globals/bitran.ts +39 -0
- package/globals/content.ts +22 -0
- package/globals/contributor.ts +5 -0
- package/globals/erudit.ts +5 -0
- package/globals/register.ts +18 -0
- package/languages/en.ts +95 -0
- package/languages/ru.ts +99 -0
- package/module/bitran.ts +34 -0
- package/module/config.ts +34 -0
- package/module/imports.ts +46 -0
- package/module/index.ts +35 -0
- package/module/logger.ts +10 -0
- package/module/paths.ts +22 -0
- package/module/restart.ts +61 -0
- package/nuxt.config.ts +96 -0
- package/package.json +32 -0
- package/server/api/aside/major/nav/bookIds.ts +5 -0
- package/server/api/aside/major/nav/bookNav/[...bookId].ts +20 -0
- package/server/api/aside/major/nav/global.ts +7 -0
- package/server/api/aside/minor/news.ts +7 -0
- package/server/api/aside/minor/path.ts +78 -0
- package/server/api/bitran/content/[location].ts +7 -0
- package/server/api/bitran/toc/[location].ts +7 -0
- package/server/api/content/data.ts +72 -0
- package/server/api/contributor/count.ts +6 -0
- package/server/api/fake/content.ts +11 -0
- package/server/api/fake/shared/languages.ts +12 -0
- package/server/api/language/functions.ts +12 -0
- package/server/api/language/phrase/[phraseId].ts +19 -0
- package/server/api/language/phraseIds.ts +8 -0
- package/server/api/preview/page/[...parts].ts +51 -0
- package/server/api/preview/unique/[location].ts +55 -0
- package/server/plugin/bitran/content.ts +176 -0
- package/server/plugin/bitran/core.ts +51 -0
- package/server/plugin/bitran/location.ts +25 -0
- package/server/plugin/bitran/products/include.ts +229 -0
- package/server/plugin/bitran/products/link.ts +114 -0
- package/server/plugin/bitran/setup.ts +10 -0
- package/server/plugin/bitran/toc.ts +82 -0
- package/server/plugin/build/close.ts +10 -0
- package/server/plugin/build/jobs/content/builderArgs.ts +8 -0
- package/server/plugin/build/jobs/content/generic.ts +176 -0
- package/server/plugin/build/jobs/content/parse.ts +90 -0
- package/server/plugin/build/jobs/content/path.ts +6 -0
- package/server/plugin/build/jobs/content/type/book.ts +9 -0
- package/server/plugin/build/jobs/content/type/group.ts +37 -0
- package/server/plugin/build/jobs/content/type/topic.ts +36 -0
- package/server/plugin/build/jobs/contributors.ts +66 -0
- package/server/plugin/build/jobs/language.ts +36 -0
- package/server/plugin/build/jobs/nav.ts +209 -0
- package/server/plugin/build/process.ts +25 -0
- package/server/plugin/build/rebuild.ts +55 -0
- package/server/plugin/build/setup.ts +21 -0
- package/server/plugin/content/absoluteId.ts +94 -0
- package/server/plugin/content/context.ts +112 -0
- package/server/plugin/db/entities/Book.ts +7 -0
- package/server/plugin/db/entities/Content.ts +49 -0
- package/server/plugin/db/entities/Contribution.ts +10 -0
- package/server/plugin/db/entities/Contributor.ts +16 -0
- package/server/plugin/db/entities/Group.ts +14 -0
- package/server/plugin/db/entities/Hash.ts +15 -0
- package/server/plugin/db/entities/Topic.ts +20 -0
- package/server/plugin/db/entities/Unique.ts +21 -0
- package/server/plugin/db/setup.ts +34 -0
- package/server/plugin/global.ts +18 -0
- package/server/plugin/importer.ts +12 -0
- package/server/plugin/index.ts +9 -0
- package/server/plugin/logger.ts +23 -0
- package/server/plugin/nav/node.ts +26 -0
- package/server/plugin/nav/utils.ts +129 -0
- package/server/plugin/repository/book.ts +21 -0
- package/server/plugin/repository/content.ts +238 -0
- package/server/plugin/repository/contributor.ts +8 -0
- package/server/plugin/repository/frontNav.ts +148 -0
- package/server/plugin/repository/topic.ts +32 -0
- package/server/tsconfig.json +7 -0
- package/shared/aside/minor.ts +50 -0
- package/shared/asset.ts +15 -0
- package/shared/bitran/alias.ts +17 -0
- package/shared/bitran/context.ts +7 -0
- package/shared/bitran/location.ts +166 -0
- package/shared/bitran/products/alias/core/factory.ts +46 -0
- package/shared/bitran/products/alias/core/index.ts +13 -0
- package/shared/bitran/products/alias/render/Alias.vue +10 -0
- package/shared/bitran/products/alias/render/icon.svg +3 -0
- package/shared/bitran/products/alias/render/index.ts +17 -0
- package/shared/bitran/products/alias/render/languages/en.ts +5 -0
- package/shared/bitran/products/alias/render/languages/ru.ts +5 -0
- package/shared/bitran/products/alias/shared.ts +11 -0
- package/shared/bitran/products/heading/core/factory.ts +53 -0
- package/shared/bitran/products/heading/core/index.ts +19 -0
- package/shared/bitran/products/heading/render/Heading.vue +47 -0
- package/shared/bitran/products/heading/render/icon.svg +3 -0
- package/shared/bitran/products/heading/render/index.ts +17 -0
- package/shared/bitran/products/heading/render/languages/en.ts +5 -0
- package/shared/bitran/products/heading/render/languages/ru.ts +5 -0
- package/shared/bitran/products/heading/shared.ts +13 -0
- package/shared/bitran/products/include/core/factory.ts +61 -0
- package/shared/bitran/products/include/core/index.ts +13 -0
- package/shared/bitran/products/include/render/Include.vue +13 -0
- package/shared/bitran/products/include/render/icon.svg +3 -0
- package/shared/bitran/products/include/render/index.ts +18 -0
- package/shared/bitran/products/include/render/languages/en.ts +5 -0
- package/shared/bitran/products/include/render/languages/ru.ts +5 -0
- package/shared/bitran/products/include/shared.ts +15 -0
- package/shared/bitran/products/link/core/factory.ts +20 -0
- package/shared/bitran/products/link/core/index.ts +17 -0
- package/shared/bitran/products/link/render/Link.vue +174 -0
- package/shared/bitran/products/link/render/icon.svg +3 -0
- package/shared/bitran/products/link/render/index.ts +17 -0
- package/shared/bitran/products/link/render/languages/en.ts +5 -0
- package/shared/bitran/products/link/render/languages/ru.ts +5 -0
- package/shared/bitran/products/link/shared.ts +15 -0
- package/shared/bitran/products/link/target.ts +134 -0
- package/shared/bitran/toc.ts +8 -0
- package/shared/content/context.ts +9 -0
- package/shared/content/data/base.ts +32 -0
- package/shared/content/data/index.ts +5 -0
- package/shared/content/data/type/book.ts +5 -0
- package/shared/content/data/type/group.ts +6 -0
- package/shared/content/data/type/topic.ts +11 -0
- package/shared/content/previousNext.ts +9 -0
- package/shared/contributor.ts +5 -0
- package/shared/frontNav.ts +41 -0
- package/shared/icons.ts +38 -0
- package/shared/image.ts +5 -0
- package/shared/link.ts +25 -0
- package/shared/types/language.ts +75 -0
- package/shared/utils/objectsEqual.ts +4 -0
- package/shared/utils/stringColor.ts +9 -0
- package/test/bitran/alias.test.ts +44 -0
- package/test/bitran/location.test.ts +143 -0
- package/test/bitran/products/alias.test.ts +83 -0
- package/test/bitran/products/heading.test.ts +119 -0
- package/test/bitran/products/include.test.ts +77 -0
- package/test/bitran/products/link/factory.test.ts +30 -0
- package/test/bitran/products/link/target.test.ts +138 -0
- package/tsconfig.json +8 -0
- package/utils/stress.ts +9 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { AsideMinorData } from '@shared/asideMinor';
|
|
3
|
+
import { asideMinorKey } from '@app/scripts/aside/minor/state';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
LazyAsideMinorNews,
|
|
7
|
+
LazyAsideMinorTopic,
|
|
8
|
+
LazyAsideMinorContent,
|
|
9
|
+
LazyAsideMinorContributor,
|
|
10
|
+
} from '#components';
|
|
11
|
+
|
|
12
|
+
let setupI = 0;
|
|
13
|
+
|
|
14
|
+
const route = useRoute();
|
|
15
|
+
const nuxtApp = useNuxtApp();
|
|
16
|
+
|
|
17
|
+
const asideData = shallowRef<AsideMinorData>();
|
|
18
|
+
const AsideMinorPane = shallowRef<Component>();
|
|
19
|
+
|
|
20
|
+
async function setupAsideMinorData() {
|
|
21
|
+
const currentSetupI = ++setupI;
|
|
22
|
+
const path = route.path;
|
|
23
|
+
const payloadKey = 'aside-minor';
|
|
24
|
+
const asideMinorPayload =
|
|
25
|
+
(nuxtApp.static.data[payloadKey] ||=
|
|
26
|
+
nuxtApp.payload.data[payloadKey] ||=
|
|
27
|
+
{});
|
|
28
|
+
|
|
29
|
+
const data: AsideMinorData = await (async () => {
|
|
30
|
+
const payloadKeyValue: AsideMinorData | 'news' = (asideMinorPayload[
|
|
31
|
+
path
|
|
32
|
+
] ||= await $fetch(`/api/aside/minor/path`, { query: { path } }));
|
|
33
|
+
|
|
34
|
+
if (payloadKeyValue === 'news') {
|
|
35
|
+
// We do not save news in the payload as it will always have the same content.
|
|
36
|
+
// So we prerender news once and use the same data for all pages.
|
|
37
|
+
nuxtApp.runWithContext(() =>
|
|
38
|
+
prerenderRoutes('/api/aside/minor/news'),
|
|
39
|
+
);
|
|
40
|
+
return await $fetch('/api/aside/minor/news');
|
|
41
|
+
} else return payloadKeyValue;
|
|
42
|
+
})();
|
|
43
|
+
|
|
44
|
+
if (currentSetupI !== setupI) return; // This data is outdated because new `setupAsideMinorData` was called.
|
|
45
|
+
|
|
46
|
+
asideData.value = data;
|
|
47
|
+
|
|
48
|
+
AsideMinorPane.value = (() => {
|
|
49
|
+
switch (asideData.value.type) {
|
|
50
|
+
case 'topic':
|
|
51
|
+
return LazyAsideMinorTopic;
|
|
52
|
+
case 'book':
|
|
53
|
+
case 'group':
|
|
54
|
+
return LazyAsideMinorContent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return LazyAsideMinorNews;
|
|
58
|
+
})();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
watch(route, setupAsideMinorData);
|
|
62
|
+
await setupAsideMinorData();
|
|
63
|
+
|
|
64
|
+
provide(asideMinorKey, asideData);
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<TransitionFade>
|
|
69
|
+
<component :is="AsideMinorPane" />
|
|
70
|
+
</TransitionFade>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.paneContentScroll">
|
|
3
|
+
<div>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<style lang="scss" module>
|
|
10
|
+
.paneContentScroll {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
direction: rtl;
|
|
15
|
+
@include scroll;
|
|
16
|
+
|
|
17
|
+
> div {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import PaneSwitchButton from './PaneSwitchButton.vue';
|
|
3
|
+
|
|
4
|
+
const { panes, activePane, getPaneOrder } = useMajorPane();
|
|
5
|
+
|
|
6
|
+
const phrase = await usePhrases(
|
|
7
|
+
...Object.values(panes).map((pane) => pane.phrase),
|
|
8
|
+
);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<section :class="$style.paneSwitch">
|
|
13
|
+
<div :class="$style.inner">
|
|
14
|
+
<PaneSwitchButton
|
|
15
|
+
v-for="(pane, paneKey) of panes"
|
|
16
|
+
:paneKey
|
|
17
|
+
:icon="pane.icon"
|
|
18
|
+
:title="phrase[pane.phrase]"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
:class="$style.slider"
|
|
23
|
+
:style="{ '--_activePane': getPaneOrder(activePane) }"
|
|
24
|
+
></div>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" module>
|
|
30
|
+
.paneSwitch {
|
|
31
|
+
--buttonSize: 40px;
|
|
32
|
+
--gapSize: var(--gap);
|
|
33
|
+
|
|
34
|
+
border-bottom: 1px solid var(--border);
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
|
|
38
|
+
.inner {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: flex;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.slider {
|
|
44
|
+
position: absolute;
|
|
45
|
+
width: var(--buttonSize);
|
|
46
|
+
height: 3px;
|
|
47
|
+
bottom: -1px;
|
|
48
|
+
margin-left: calc(var(--gapSize) / 2);
|
|
49
|
+
background: var(--textMuted);
|
|
50
|
+
left: calc(var(--_activePane) * (var(--buttonSize) + var(--gapSize)));
|
|
51
|
+
@include transition(left);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { MyIconName } from '#my-icons';
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
paneKey: MajorPaneKey;
|
|
6
|
+
icon: MyIconName;
|
|
7
|
+
}>();
|
|
8
|
+
|
|
9
|
+
const { activePane } = useMajorPane();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<button
|
|
14
|
+
@click="activePane = paneKey"
|
|
15
|
+
:class="[
|
|
16
|
+
$style.paneSwtichButton,
|
|
17
|
+
paneKey === activePane ? $style.active : '',
|
|
18
|
+
]"
|
|
19
|
+
>
|
|
20
|
+
<MyIcon :name="icon" />
|
|
21
|
+
</button>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" module>
|
|
25
|
+
.paneSwtichButton {
|
|
26
|
+
--_padding: calc(var(--gapSize) / 2);
|
|
27
|
+
|
|
28
|
+
position: relative;
|
|
29
|
+
padding: var(--_padding);
|
|
30
|
+
color: var(--textMuted);
|
|
31
|
+
background: transparent;
|
|
32
|
+
border: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
@include transition(color);
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
content: '';
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: var(--_padding);
|
|
40
|
+
right: var(--_padding);
|
|
41
|
+
bottom: -1px;
|
|
42
|
+
height: 3px;
|
|
43
|
+
background: transparent;
|
|
44
|
+
@include transition(background);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:hover,
|
|
48
|
+
&.active {
|
|
49
|
+
color: var(--text);
|
|
50
|
+
&::after {
|
|
51
|
+
background: var(--border);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[my-icon] {
|
|
56
|
+
display: grid;
|
|
57
|
+
place-items: center;
|
|
58
|
+
width: var(--buttonSize);
|
|
59
|
+
height: var(--buttonSize);
|
|
60
|
+
font-size: 22px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import eruditConfig from '#erudit/config';
|
|
3
|
+
|
|
4
|
+
const baseUrlPath = useBaseUrlPath();
|
|
5
|
+
|
|
6
|
+
const phrase = await usePhrases('site_info_title', 'site_info_slogan');
|
|
7
|
+
|
|
8
|
+
interface SiteInfo {
|
|
9
|
+
title: string;
|
|
10
|
+
slogan?: string;
|
|
11
|
+
logotype?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const siteInfo = computed<SiteInfo>(() => {
|
|
15
|
+
if (!eruditConfig.site)
|
|
16
|
+
return {
|
|
17
|
+
logotype: eruditAsset('logotype.svg'),
|
|
18
|
+
title: phrase.site_info_title,
|
|
19
|
+
slogan: phrase.site_info_slogan,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
logotype: eruditConfig.site?.logotype,
|
|
24
|
+
title: eruditConfig.site?.title || phrase.site_info_title,
|
|
25
|
+
slogan: eruditConfig.site?.slogan,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<section :class="$style.siteInfo">
|
|
32
|
+
<NuxtLink v-if="siteInfo.logotype" to="/" :class="$style.logo">
|
|
33
|
+
<img :src="baseUrlPath(siteInfo.logotype)" :alt="siteInfo.title" />
|
|
34
|
+
</NuxtLink>
|
|
35
|
+
<div :class="[$style.textInfo, !siteInfo.logotype && $style.noLogo]">
|
|
36
|
+
<h1 :class="$style.title">
|
|
37
|
+
<NuxtLink to="/">{{
|
|
38
|
+
siteInfo.title || phrase.site_info_title
|
|
39
|
+
}}</NuxtLink>
|
|
40
|
+
</h1>
|
|
41
|
+
<div v-if="siteInfo.slogan" :class="$style.description">
|
|
42
|
+
{{ siteInfo.slogan }}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</section>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style lang="scss" module>
|
|
49
|
+
.siteInfo {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
gap: var(--gap);
|
|
54
|
+
padding: var(--gap);
|
|
55
|
+
padding-bottom: var(--gapSmall);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.logo {
|
|
59
|
+
width: 50px;
|
|
60
|
+
height: 50px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.textInfo {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
|
|
67
|
+
&.noLogo {
|
|
68
|
+
text-align: center;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.title {
|
|
72
|
+
font-weight: bold;
|
|
73
|
+
font-size: 1.25em;
|
|
74
|
+
color: var(--text);
|
|
75
|
+
|
|
76
|
+
a {
|
|
77
|
+
@include hoverLink;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.description {
|
|
82
|
+
color: var(--textMuted);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import PaneContentScroll from '../PaneContentScroll.vue';
|
|
3
|
+
|
|
4
|
+
const phrase = await usePhrases(
|
|
5
|
+
'_language_code',
|
|
6
|
+
'_language_title',
|
|
7
|
+
'add_translation',
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
interface ClientLanguage {
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
link?: string;
|
|
14
|
+
active?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function defineLanguage(clientLanguage: ClientLanguage): ClientLanguage {
|
|
18
|
+
if (phrase._language_code === clientLanguage.code)
|
|
19
|
+
clientLanguage.active = true;
|
|
20
|
+
|
|
21
|
+
return clientLanguage;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const languages = ref<ClientLanguage[]>([
|
|
25
|
+
defineLanguage({
|
|
26
|
+
code: phrase._language_code,
|
|
27
|
+
name: phrase._language_title,
|
|
28
|
+
}),
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
const apiLanguages = await useExternalApiLanguages();
|
|
32
|
+
|
|
33
|
+
for (const [code, data] of Object.entries(apiLanguages) as any) {
|
|
34
|
+
if (code === phrase._language_code) continue;
|
|
35
|
+
|
|
36
|
+
languages.value.push({
|
|
37
|
+
code,
|
|
38
|
+
name: data.name,
|
|
39
|
+
link: data.link,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function wip() {
|
|
44
|
+
alert(
|
|
45
|
+
'Work in progress. If you want to add your translation, contact me. Telegram: @math_head',
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<PaneContentScroll>
|
|
52
|
+
<AsideListItem
|
|
53
|
+
v-for="clientLanguage of languages"
|
|
54
|
+
:class="[clientLanguage.active ? $style.active : '']"
|
|
55
|
+
:link="clientLanguage.active ? undefined : clientLanguage.link"
|
|
56
|
+
>
|
|
57
|
+
<div :class="$style.code">{{ clientLanguage.code }}</div>
|
|
58
|
+
<div :class="$style.name">{{ clientLanguage.name }}</div>
|
|
59
|
+
</AsideListItem>
|
|
60
|
+
<AsideListItem
|
|
61
|
+
icon="plus-circle"
|
|
62
|
+
:main="phrase.add_translation"
|
|
63
|
+
@click="wip"
|
|
64
|
+
/>
|
|
65
|
+
</PaneContentScroll>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" module>
|
|
69
|
+
.active {
|
|
70
|
+
color: var(--brand) !important;
|
|
71
|
+
background: transparent !important;
|
|
72
|
+
cursor: default;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.code {
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
font-weight: 650;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PaneContentScroll from '../PaneContentScroll.vue';
|
|
3
|
+
|
|
4
|
+
const route = useRoute();
|
|
5
|
+
|
|
6
|
+
const phrase = await usePhrases('main_page', 'members');
|
|
7
|
+
|
|
8
|
+
const { data: memberCount } = await useAsyncData<number>('members-count', () =>
|
|
9
|
+
$fetch('/api/contributor/count'),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
function linkAttrs(link: string) {
|
|
13
|
+
return {
|
|
14
|
+
link,
|
|
15
|
+
active: route.path === link,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<PaneContentScroll>
|
|
22
|
+
<AsideListItem
|
|
23
|
+
icon="house"
|
|
24
|
+
v-bind="linkAttrs('/')"
|
|
25
|
+
:main="phrase.main_page"
|
|
26
|
+
/>
|
|
27
|
+
<AsideListItem
|
|
28
|
+
icon="users"
|
|
29
|
+
v-bind="linkAttrs('/members')"
|
|
30
|
+
:main="phrase.members + ':'"
|
|
31
|
+
:secondary="memberCount!.toString()"
|
|
32
|
+
/>
|
|
33
|
+
</PaneContentScroll>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { FrontNav } from '@shared/frontNav';
|
|
3
|
+
import {
|
|
4
|
+
getAsideMajorNavPayload,
|
|
5
|
+
insideNavBook,
|
|
6
|
+
navBookId,
|
|
7
|
+
navBookVisible,
|
|
8
|
+
} from '@app/scripts/aside/major/nav';
|
|
9
|
+
|
|
10
|
+
import NavGlobal from './NavGlobal.vue';
|
|
11
|
+
import NavBook from './NavBook.vue';
|
|
12
|
+
|
|
13
|
+
const contentRoute = useContentRoute();
|
|
14
|
+
const asideMajorNav = getAsideMajorNavPayload();
|
|
15
|
+
|
|
16
|
+
asideMajorNav.booksIds ||= (await $fetch(
|
|
17
|
+
'/api/aside/major/nav/bookIds',
|
|
18
|
+
)) as string[];
|
|
19
|
+
|
|
20
|
+
asideMajorNav.globalNav ||= (await $fetch(
|
|
21
|
+
'/api/aside/major/nav/global',
|
|
22
|
+
)) as FrontNav;
|
|
23
|
+
|
|
24
|
+
//
|
|
25
|
+
// Check if inside book from start
|
|
26
|
+
//
|
|
27
|
+
|
|
28
|
+
// Reset server-leaked state from other pages
|
|
29
|
+
navBookId.value = undefined;
|
|
30
|
+
insideNavBook.value = false;
|
|
31
|
+
|
|
32
|
+
if (contentRoute.value) {
|
|
33
|
+
for (const bookId of asideMajorNav.booksIds) {
|
|
34
|
+
if (contentRoute.value.contentId.startsWith(bookId)) {
|
|
35
|
+
navBookId.value = bookId;
|
|
36
|
+
insideNavBook.value = true;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
onMounted(() => {
|
|
43
|
+
watch(
|
|
44
|
+
contentRoute,
|
|
45
|
+
() =>
|
|
46
|
+
(insideNavBook.value = insideNavBook.value
|
|
47
|
+
? !!contentRoute.value
|
|
48
|
+
: false),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div :class="[$style.navHolder, navBookVisible && $style.navBookVisible]">
|
|
55
|
+
<NavGlobal :class="$style.navGlobal" />
|
|
56
|
+
<NavBook :class="$style.navBook" />
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<style lang="scss" module>
|
|
61
|
+
.navHolder {
|
|
62
|
+
position: relative;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
|
|
66
|
+
.navGlobal,
|
|
67
|
+
.navBook {
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 100%;
|
|
73
|
+
opacity: 1;
|
|
74
|
+
@include transition(left, opacity);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.navBookVisible {
|
|
78
|
+
.navGlobal {
|
|
79
|
+
left: calc(-1 * var(--wAside));
|
|
80
|
+
opacity: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:not(.navBookVisible) {
|
|
85
|
+
.navBook {
|
|
86
|
+
left: calc(1 * var(--wAside));
|
|
87
|
+
opacity: 0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { FrontNavBook } from '@shared/frontNav';
|
|
3
|
+
import { insideNavBook, navBookId } from '@app/scripts/aside/major/nav';
|
|
4
|
+
|
|
5
|
+
import PaneContentScroll from '../../PaneContentScroll.vue';
|
|
6
|
+
import FNav from './fnav/FNav.vue';
|
|
7
|
+
import FNavFlags from './fnav/FNavFlags.vue';
|
|
8
|
+
import NavBookLoading from './NavBookLoading.vue';
|
|
9
|
+
|
|
10
|
+
const loading = ref(true);
|
|
11
|
+
|
|
12
|
+
const nuxtApp = useNuxtApp();
|
|
13
|
+
const contentRoute = useContentRoute();
|
|
14
|
+
const book = shallowRef<FrontNavBook>();
|
|
15
|
+
|
|
16
|
+
async function setupNavBook() {
|
|
17
|
+
loading.value = true;
|
|
18
|
+
|
|
19
|
+
if (!navBookId.value) return;
|
|
20
|
+
|
|
21
|
+
nuxtApp.runWithContext(() =>
|
|
22
|
+
prerenderRoutes(`/api/aside/major/nav/bookNav/${navBookId.value}`),
|
|
23
|
+
);
|
|
24
|
+
book.value = await $fetch(
|
|
25
|
+
`/api/aside/major/nav/bookNav/${navBookId.value}`,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
loading.value = false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
watch(navBookId, setupNavBook);
|
|
32
|
+
await setupNavBook();
|
|
33
|
+
const pharse = await usePhrases('to_index', 'about_book');
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div>
|
|
38
|
+
<PaneContentScroll v-if="book">
|
|
39
|
+
<section :class="$style.bookHeader">
|
|
40
|
+
<div :class="$style.title">{{ book.label }}</div>
|
|
41
|
+
<FNavFlags
|
|
42
|
+
v-if="book.flags"
|
|
43
|
+
:flags="book.flags"
|
|
44
|
+
:class="$style.flags"
|
|
45
|
+
/>
|
|
46
|
+
</section>
|
|
47
|
+
<FNav :nav="book.children!" :contentId="contentRoute?.contentId">
|
|
48
|
+
<template v-slot:before>
|
|
49
|
+
<TreeItem
|
|
50
|
+
icon="arrow-left"
|
|
51
|
+
:label="pharse.to_index"
|
|
52
|
+
@click="insideNavBook = false"
|
|
53
|
+
/>
|
|
54
|
+
<TreeItem
|
|
55
|
+
icon="book-question"
|
|
56
|
+
:label="pharse.about_book"
|
|
57
|
+
:active="contentRoute?.contentId === book.id"
|
|
58
|
+
:link="`/book/${book.id}`"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
</FNav>
|
|
62
|
+
</PaneContentScroll>
|
|
63
|
+
<TransitionFade>
|
|
64
|
+
<NavBookLoading v-if="loading" />
|
|
65
|
+
</TransitionFade>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<style lang="scss" module>
|
|
70
|
+
.bookHeader {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
padding: var(--gap);
|
|
74
|
+
border-bottom: 1px solid var(--border);
|
|
75
|
+
|
|
76
|
+
.title {
|
|
77
|
+
flex: 1;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
color: var(--text);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.flags {
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.navBookLoading">
|
|
3
|
+
<Loading />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style lang="scss" module>
|
|
8
|
+
.navBookLoading {
|
|
9
|
+
position: absolute;
|
|
10
|
+
z-index: 100;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
background: var(--bgAside);
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
font-size: 60px;
|
|
21
|
+
|
|
22
|
+
@include transition(opacity, box-shadow);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { getAsideMajorNavPayload } from '@app/scripts/aside/major/nav';
|
|
3
|
+
|
|
4
|
+
import FNav from './fnav/FNav.vue';
|
|
5
|
+
import PaneContentScroll from '../../PaneContentScroll.vue';
|
|
6
|
+
|
|
7
|
+
const contentRoute = useContentRoute();
|
|
8
|
+
const asideMajorNav = getAsideMajorNavPayload();
|
|
9
|
+
const globalNav = asideMajorNav.globalNav;
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<PaneContentScroll>
|
|
14
|
+
<FNav :nav="globalNav" :contentId="contentRoute?.contentId" />
|
|
15
|
+
</PaneContentScroll>
|
|
16
|
+
</template>
|