erudit 2.0.0-dev.7 → 2.0.0-dev.9
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 +172 -172
- package/app/components/Loading.vue +23 -23
- package/app/components/SiteAside.vue +382 -382
- package/app/components/SiteMain.vue +35 -35
- package/app/components/ads/BannerTemplate.vue +51 -51
- package/app/components/ads/BottomBanner.vue +45 -45
- package/app/components/ads/LeftBanner.vue +50 -50
- package/app/components/aside/AsideListItem.vue +74 -74
- package/app/components/aside/AsideMajor.vue +56 -56
- package/app/components/aside/AsideMinor.vue +71 -71
- package/app/components/aside/major/PaneContentScroll.vue +23 -23
- package/app/components/aside/major/PaneSwitch.vue +54 -54
- package/app/components/aside/major/PaneSwitchButton.vue +63 -63
- package/app/components/aside/major/SiteInfo.vue +85 -85
- package/app/components/aside/major/panes/Language.vue +79 -79
- package/app/components/aside/major/panes/Pages.vue +34 -34
- package/app/components/aside/major/panes/Search.vue +2 -2
- package/app/components/aside/major/panes/nav/Nav.vue +91 -91
- package/app/components/aside/major/panes/nav/NavBook.vue +86 -86
- package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -24
- package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -16
- package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -105
- package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -32
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -40
- package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -60
- package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -34
- package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -80
- package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -24
- package/app/components/aside/major/panes/other/ItemContent.vue +29 -29
- package/app/components/aside/major/panes/other/ItemGenerator.vue +15 -15
- package/app/components/aside/major/panes/other/ItemTheme.vue +54 -54
- package/app/components/aside/major/panes/other/Other.vue +16 -16
- package/app/components/aside/minor/AsideMinorContributor.vue +4 -4
- package/app/components/aside/minor/AsideMinorNews.vue +11 -11
- package/app/components/aside/minor/AsideMinorPane.vue +15 -15
- package/app/components/aside/minor/AsideMinorTopLink.vue +67 -67
- package/app/components/aside/minor/Contribute.vue +145 -145
- package/app/components/aside/minor/content/AsideMinorContent.vue +92 -92
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +32 -32
- package/app/components/aside/minor/topic/TopicContributors.vue +177 -177
- package/app/components/aside/minor/topic/TopicNav.vue +49 -49
- package/app/components/aside/minor/topic/TopicToc.vue +203 -202
- package/app/components/aside/minor/topic/TopicTocItem.vue +31 -31
- package/app/components/aside/utils/AsideOverlayPane.vue +40 -40
- package/app/components/bitran/BitranContent.vue +63 -64
- package/app/components/bitran/RenderWrapper.vue +10 -12
- package/app/components/contributor/ContributorAvatar.vue +43 -43
- package/app/components/contributor/ContributorListItem.vue +35 -35
- package/app/components/main/topic/MainTopic.vue +79 -79
- package/app/components/main/topic/TopicPartSwitch.vue +118 -118
- package/app/components/main/utils/Breadcrumb.vue +75 -75
- package/app/components/main/utils/ContentDecoration.vue +29 -29
- package/app/components/main/utils/ContentDescription.vue +19 -19
- package/app/components/main/utils/ContentFlag.vue +15 -15
- package/app/components/main/utils/ContentPopover.vue +176 -176
- package/app/components/main/utils/ContentPopovers.vue +105 -105
- package/app/components/main/utils/ContentReferences.vue +75 -75
- package/app/components/main/utils/ContentSection.vue +41 -41
- package/app/components/main/utils/ContentTitle.vue +36 -36
- package/app/components/main/utils/reference/ReferenceGroup.vue +40 -40
- package/app/components/main/utils/reference/ReferenceItem.vue +63 -63
- package/app/components/main/utils/reference/ReferenceSource.vue +109 -109
- package/app/components/preview/Preview.vue +177 -177
- package/app/components/preview/PreviewDisplay.vue +139 -139
- package/app/components/preview/PreviewFooterAction.vue +73 -73
- package/app/components/preview/PreviewLoading.vue +14 -14
- package/app/components/preview/PreviewScreen.vue +99 -99
- package/app/components/preview/display/Alert.vue +50 -50
- package/app/components/preview/display/Custom.vue +18 -18
- package/app/components/preview/display/GenericLink.vue +48 -48
- package/app/components/preview/display/PageLink.vue +20 -20
- package/app/components/preview/display/Unique.vue +49 -49
- package/app/components/transition/Fade.vue +21 -21
- package/app/components/tree/TreeContainer.vue +11 -11
- package/app/components/tree/TreeItem.vue +89 -89
- package/app/composables/bitran.ts +98 -103
- package/app/composables/bitranContent.ts +2 -1
- package/app/composables/contentPage.ts +1 -1
- package/app/composables/phrases.ts +80 -80
- package/app/pages/_test/preview.vue +110 -110
- package/app/pages/article/[...articleId].vue +2 -2
- package/app/pages/book/[...bookId].vue +47 -47
- package/app/pages/group/[...groupId].vue +65 -64
- package/app/pages/index.vue +32 -32
- package/app/pages/members.vue +6 -6
- package/app/pages/practice/[...practice].vue +2 -2
- package/app/pages/summary/[...summaryId].vue +2 -2
- package/app/public/favicon/article.svg +9 -9
- package/app/public/favicon/default.svg +9 -9
- package/app/public/favicon/practice.svg +9 -9
- package/app/public/favicon/summary.svg +9 -9
- package/app/public/logotype.svg +16 -16
- package/app/public/user.svg +9 -9
- package/app/scripts/_immediate.js +3 -3
- package/app/scripts/flag.ts +28 -28
- package/app/scripts/og.ts +27 -27
- package/app/scripts/preview/data/unique.ts +3 -3
- package/app/scripts/preview/display.ts +5 -7
- package/app/scripts/preview/request.ts +2 -2
- package/app/styles/_immediate.css +2 -2
- package/app/styles/_util.scss +49 -49
- package/app/styles/_utils.scss +44 -44
- package/app/styles/default.scss +84 -84
- package/app/styles/partials/_darkMagic.scss +6 -6
- package/app/styles/partials/_fnav.scss +17 -17
- package/app/styles/partials/_preview.scss +6 -6
- package/globalPath.ts +21 -24
- package/globals/bitran.ts +21 -13
- package/globals/erudit.ts +5 -5
- package/globals/register.ts +18 -18
- package/languages/en.ts +95 -95
- package/languages/ru.ts +99 -99
- package/module/config.ts +34 -34
- package/module/imports.ts +46 -46
- package/module/index.ts +47 -35
- package/module/logger.ts +10 -10
- package/module/restart.ts +61 -61
- package/nuxt.config.ts +107 -96
- package/package.json +9 -6
- package/server/api/aside/major/nav/bookIds.ts +5 -5
- package/server/api/aside/major/nav/bookNav/[...bookId].ts +20 -20
- package/server/api/aside/major/nav/global.ts +7 -7
- package/server/api/aside/minor/news.ts +7 -7
- package/server/api/aside/minor/path.ts +78 -78
- package/server/api/bitran/content/[location].ts +7 -7
- package/server/api/bitran/toc/[location].ts +7 -7
- package/server/api/content/data.ts +72 -72
- package/server/api/fake/content.ts +10 -10
- package/server/api/fake/shared/languages.ts +12 -12
- package/server/api/language/functions.ts +12 -12
- package/server/api/language/phrase/[phraseId].ts +19 -19
- package/server/api/language/phraseIds.ts +8 -8
- package/server/api/preview/page/[...parts].ts +51 -51
- package/server/api/preview/unique/[location].ts +55 -55
- package/server/plugin/bitran/content.ts +55 -44
- package/server/plugin/bitran/products/include.ts +28 -27
- package/server/plugin/bitran/products/link.ts +11 -9
- package/server/plugin/bitran/setup.ts +0 -1
- package/server/plugin/bitran/toc.ts +25 -24
- package/server/plugin/bitran/transpiler.ts +46 -0
- package/server/plugin/build/close.ts +10 -10
- package/server/plugin/build/jobs/content/parse.ts +37 -27
- package/server/plugin/build/jobs/language.ts +36 -36
- package/server/plugin/build/process.ts +25 -25
- package/server/plugin/build/rebuild.ts +55 -55
- package/server/plugin/build/setup.ts +21 -21
- package/server/plugin/global.ts +18 -18
- package/server/plugin/importer.ts +12 -12
- package/server/plugin/index.ts +9 -9
- package/server/plugin/logger.ts +23 -23
- package/server/tsconfig.json +7 -7
- package/shared/bitran/context.ts +3 -2
- package/shared/bitran/default.ts +46 -0
- package/shared/bitran/{products/link/render → link}/Link.vue +7 -14
- package/shared/bitran/link/factory.ts +24 -0
- package/shared/bitran/link/languages/en.ts +7 -0
- package/shared/bitran/link/languages/ru.ts +7 -0
- package/shared/bitran/link/renderer.ts +21 -0
- package/shared/bitran/link/shared.ts +17 -0
- package/shared/bitran/{products/link → link}/target.ts +1 -1
- package/shared/bitran/link/transpiler.ts +10 -0
- package/shared/content/context.ts +9 -9
- package/shared/content/data/base.ts +32 -32
- package/shared/content/data/index.ts +5 -5
- package/shared/content/data/type/book.ts +5 -5
- package/shared/content/data/type/group.ts +6 -6
- package/shared/content/data/type/topic.ts +11 -11
- package/shared/content/previousNext.ts +9 -9
- package/shared/link.ts +25 -25
- package/shared/types/language.ts +75 -75
- package/test/bitran/{products/link → link}/target.test.ts +5 -2
- package/tsconfig.json +8 -8
- package/utils/stress.ts +9 -9
- package/server/plugin/bitran/core.ts +0 -51
- package/shared/bitran/alias.ts +0 -17
- package/shared/bitran/products/alias/core/factory.ts +0 -46
- package/shared/bitran/products/alias/core/index.ts +0 -13
- package/shared/bitran/products/alias/render/Alias.vue +0 -10
- package/shared/bitran/products/alias/render/icon.svg +0 -3
- package/shared/bitran/products/alias/render/index.ts +0 -17
- package/shared/bitran/products/alias/render/languages/en.ts +0 -5
- package/shared/bitran/products/alias/render/languages/ru.ts +0 -5
- package/shared/bitran/products/alias/shared.ts +0 -11
- package/shared/bitran/products/heading/core/factory.ts +0 -53
- package/shared/bitran/products/heading/core/index.ts +0 -19
- package/shared/bitran/products/heading/render/Heading.vue +0 -47
- package/shared/bitran/products/heading/render/icon.svg +0 -3
- package/shared/bitran/products/heading/render/index.ts +0 -17
- package/shared/bitran/products/heading/render/languages/en.ts +0 -5
- package/shared/bitran/products/heading/render/languages/ru.ts +0 -5
- package/shared/bitran/products/heading/shared.ts +0 -13
- package/shared/bitran/products/include/core/factory.ts +0 -61
- package/shared/bitran/products/include/core/index.ts +0 -13
- package/shared/bitran/products/include/render/Include.vue +0 -13
- package/shared/bitran/products/include/render/icon.svg +0 -3
- package/shared/bitran/products/include/render/index.ts +0 -18
- package/shared/bitran/products/include/render/languages/en.ts +0 -5
- package/shared/bitran/products/include/render/languages/ru.ts +0 -5
- package/shared/bitran/products/include/shared.ts +0 -15
- package/shared/bitran/products/link/core/factory.ts +0 -20
- package/shared/bitran/products/link/core/index.ts +0 -17
- package/shared/bitran/products/link/render/index.ts +0 -17
- package/shared/bitran/products/link/render/languages/en.ts +0 -5
- package/shared/bitran/products/link/render/languages/ru.ts +0 -5
- package/shared/bitran/products/link/shared.ts +0 -15
- package/test/bitran/alias.test.ts +0 -44
- package/test/bitran/products/alias.test.ts +0 -83
- package/test/bitran/products/heading.test.ts +0 -119
- package/test/bitran/products/include.test.ts +0 -77
- package/test/bitran/products/link/factory.test.ts +0 -30
- /package/shared/bitran/{products/link/render → link}/icon.svg +0 -0
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { AsideMinorData } from '@shared/asideMinor';
|
|
3
|
-
import { asideMinorKey } from '
|
|
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>
|
|
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>
|
|
@@ -1,23 +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>
|
|
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>
|
|
@@ -1,54 +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>
|
|
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>
|
|
@@ -1,63 +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>
|
|
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>
|
|
@@ -1,85 +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>
|
|
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>
|