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.
Files changed (212) hide show
  1. package/.nuxtrc +1 -1
  2. package/app/app.vue +172 -172
  3. package/app/components/Loading.vue +23 -23
  4. package/app/components/SiteAside.vue +382 -382
  5. package/app/components/SiteMain.vue +35 -35
  6. package/app/components/ads/BannerTemplate.vue +51 -51
  7. package/app/components/ads/BottomBanner.vue +45 -45
  8. package/app/components/ads/LeftBanner.vue +50 -50
  9. package/app/components/aside/AsideListItem.vue +74 -74
  10. package/app/components/aside/AsideMajor.vue +56 -56
  11. package/app/components/aside/AsideMinor.vue +71 -71
  12. package/app/components/aside/major/PaneContentScroll.vue +23 -23
  13. package/app/components/aside/major/PaneSwitch.vue +54 -54
  14. package/app/components/aside/major/PaneSwitchButton.vue +63 -63
  15. package/app/components/aside/major/SiteInfo.vue +85 -85
  16. package/app/components/aside/major/panes/Language.vue +79 -79
  17. package/app/components/aside/major/panes/Pages.vue +34 -34
  18. package/app/components/aside/major/panes/Search.vue +2 -2
  19. package/app/components/aside/major/panes/nav/Nav.vue +91 -91
  20. package/app/components/aside/major/panes/nav/NavBook.vue +86 -86
  21. package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -24
  22. package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -16
  23. package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -105
  24. package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -32
  25. package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -40
  26. package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -60
  27. package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -34
  28. package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -80
  29. package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -24
  30. package/app/components/aside/major/panes/other/ItemContent.vue +29 -29
  31. package/app/components/aside/major/panes/other/ItemGenerator.vue +15 -15
  32. package/app/components/aside/major/panes/other/ItemTheme.vue +54 -54
  33. package/app/components/aside/major/panes/other/Other.vue +16 -16
  34. package/app/components/aside/minor/AsideMinorContributor.vue +4 -4
  35. package/app/components/aside/minor/AsideMinorNews.vue +11 -11
  36. package/app/components/aside/minor/AsideMinorPane.vue +15 -15
  37. package/app/components/aside/minor/AsideMinorTopLink.vue +67 -67
  38. package/app/components/aside/minor/Contribute.vue +145 -145
  39. package/app/components/aside/minor/content/AsideMinorContent.vue +92 -92
  40. package/app/components/aside/minor/topic/AsideMinorTopic.vue +32 -32
  41. package/app/components/aside/minor/topic/TopicContributors.vue +177 -177
  42. package/app/components/aside/minor/topic/TopicNav.vue +49 -49
  43. package/app/components/aside/minor/topic/TopicToc.vue +203 -202
  44. package/app/components/aside/minor/topic/TopicTocItem.vue +31 -31
  45. package/app/components/aside/utils/AsideOverlayPane.vue +40 -40
  46. package/app/components/bitran/BitranContent.vue +63 -64
  47. package/app/components/bitran/RenderWrapper.vue +10 -12
  48. package/app/components/contributor/ContributorAvatar.vue +43 -43
  49. package/app/components/contributor/ContributorListItem.vue +35 -35
  50. package/app/components/main/topic/MainTopic.vue +79 -79
  51. package/app/components/main/topic/TopicPartSwitch.vue +118 -118
  52. package/app/components/main/utils/Breadcrumb.vue +75 -75
  53. package/app/components/main/utils/ContentDecoration.vue +29 -29
  54. package/app/components/main/utils/ContentDescription.vue +19 -19
  55. package/app/components/main/utils/ContentFlag.vue +15 -15
  56. package/app/components/main/utils/ContentPopover.vue +176 -176
  57. package/app/components/main/utils/ContentPopovers.vue +105 -105
  58. package/app/components/main/utils/ContentReferences.vue +75 -75
  59. package/app/components/main/utils/ContentSection.vue +41 -41
  60. package/app/components/main/utils/ContentTitle.vue +36 -36
  61. package/app/components/main/utils/reference/ReferenceGroup.vue +40 -40
  62. package/app/components/main/utils/reference/ReferenceItem.vue +63 -63
  63. package/app/components/main/utils/reference/ReferenceSource.vue +109 -109
  64. package/app/components/preview/Preview.vue +177 -177
  65. package/app/components/preview/PreviewDisplay.vue +139 -139
  66. package/app/components/preview/PreviewFooterAction.vue +73 -73
  67. package/app/components/preview/PreviewLoading.vue +14 -14
  68. package/app/components/preview/PreviewScreen.vue +99 -99
  69. package/app/components/preview/display/Alert.vue +50 -50
  70. package/app/components/preview/display/Custom.vue +18 -18
  71. package/app/components/preview/display/GenericLink.vue +48 -48
  72. package/app/components/preview/display/PageLink.vue +20 -20
  73. package/app/components/preview/display/Unique.vue +49 -49
  74. package/app/components/transition/Fade.vue +21 -21
  75. package/app/components/tree/TreeContainer.vue +11 -11
  76. package/app/components/tree/TreeItem.vue +89 -89
  77. package/app/composables/bitran.ts +98 -103
  78. package/app/composables/bitranContent.ts +2 -1
  79. package/app/composables/contentPage.ts +1 -1
  80. package/app/composables/phrases.ts +80 -80
  81. package/app/pages/_test/preview.vue +110 -110
  82. package/app/pages/article/[...articleId].vue +2 -2
  83. package/app/pages/book/[...bookId].vue +47 -47
  84. package/app/pages/group/[...groupId].vue +65 -64
  85. package/app/pages/index.vue +32 -32
  86. package/app/pages/members.vue +6 -6
  87. package/app/pages/practice/[...practice].vue +2 -2
  88. package/app/pages/summary/[...summaryId].vue +2 -2
  89. package/app/public/favicon/article.svg +9 -9
  90. package/app/public/favicon/default.svg +9 -9
  91. package/app/public/favicon/practice.svg +9 -9
  92. package/app/public/favicon/summary.svg +9 -9
  93. package/app/public/logotype.svg +16 -16
  94. package/app/public/user.svg +9 -9
  95. package/app/scripts/_immediate.js +3 -3
  96. package/app/scripts/flag.ts +28 -28
  97. package/app/scripts/og.ts +27 -27
  98. package/app/scripts/preview/data/unique.ts +3 -3
  99. package/app/scripts/preview/display.ts +5 -7
  100. package/app/scripts/preview/request.ts +2 -2
  101. package/app/styles/_immediate.css +2 -2
  102. package/app/styles/_util.scss +49 -49
  103. package/app/styles/_utils.scss +44 -44
  104. package/app/styles/default.scss +84 -84
  105. package/app/styles/partials/_darkMagic.scss +6 -6
  106. package/app/styles/partials/_fnav.scss +17 -17
  107. package/app/styles/partials/_preview.scss +6 -6
  108. package/globalPath.ts +21 -24
  109. package/globals/bitran.ts +21 -13
  110. package/globals/erudit.ts +5 -5
  111. package/globals/register.ts +18 -18
  112. package/languages/en.ts +95 -95
  113. package/languages/ru.ts +99 -99
  114. package/module/config.ts +34 -34
  115. package/module/imports.ts +46 -46
  116. package/module/index.ts +47 -35
  117. package/module/logger.ts +10 -10
  118. package/module/restart.ts +61 -61
  119. package/nuxt.config.ts +107 -96
  120. package/package.json +9 -6
  121. package/server/api/aside/major/nav/bookIds.ts +5 -5
  122. package/server/api/aside/major/nav/bookNav/[...bookId].ts +20 -20
  123. package/server/api/aside/major/nav/global.ts +7 -7
  124. package/server/api/aside/minor/news.ts +7 -7
  125. package/server/api/aside/minor/path.ts +78 -78
  126. package/server/api/bitran/content/[location].ts +7 -7
  127. package/server/api/bitran/toc/[location].ts +7 -7
  128. package/server/api/content/data.ts +72 -72
  129. package/server/api/fake/content.ts +10 -10
  130. package/server/api/fake/shared/languages.ts +12 -12
  131. package/server/api/language/functions.ts +12 -12
  132. package/server/api/language/phrase/[phraseId].ts +19 -19
  133. package/server/api/language/phraseIds.ts +8 -8
  134. package/server/api/preview/page/[...parts].ts +51 -51
  135. package/server/api/preview/unique/[location].ts +55 -55
  136. package/server/plugin/bitran/content.ts +55 -44
  137. package/server/plugin/bitran/products/include.ts +28 -27
  138. package/server/plugin/bitran/products/link.ts +11 -9
  139. package/server/plugin/bitran/setup.ts +0 -1
  140. package/server/plugin/bitran/toc.ts +25 -24
  141. package/server/plugin/bitran/transpiler.ts +46 -0
  142. package/server/plugin/build/close.ts +10 -10
  143. package/server/plugin/build/jobs/content/parse.ts +37 -27
  144. package/server/plugin/build/jobs/language.ts +36 -36
  145. package/server/plugin/build/process.ts +25 -25
  146. package/server/plugin/build/rebuild.ts +55 -55
  147. package/server/plugin/build/setup.ts +21 -21
  148. package/server/plugin/global.ts +18 -18
  149. package/server/plugin/importer.ts +12 -12
  150. package/server/plugin/index.ts +9 -9
  151. package/server/plugin/logger.ts +23 -23
  152. package/server/tsconfig.json +7 -7
  153. package/shared/bitran/context.ts +3 -2
  154. package/shared/bitran/default.ts +46 -0
  155. package/shared/bitran/{products/link/render → link}/Link.vue +7 -14
  156. package/shared/bitran/link/factory.ts +24 -0
  157. package/shared/bitran/link/languages/en.ts +7 -0
  158. package/shared/bitran/link/languages/ru.ts +7 -0
  159. package/shared/bitran/link/renderer.ts +21 -0
  160. package/shared/bitran/link/shared.ts +17 -0
  161. package/shared/bitran/{products/link → link}/target.ts +1 -1
  162. package/shared/bitran/link/transpiler.ts +10 -0
  163. package/shared/content/context.ts +9 -9
  164. package/shared/content/data/base.ts +32 -32
  165. package/shared/content/data/index.ts +5 -5
  166. package/shared/content/data/type/book.ts +5 -5
  167. package/shared/content/data/type/group.ts +6 -6
  168. package/shared/content/data/type/topic.ts +11 -11
  169. package/shared/content/previousNext.ts +9 -9
  170. package/shared/link.ts +25 -25
  171. package/shared/types/language.ts +75 -75
  172. package/test/bitran/{products/link → link}/target.test.ts +5 -2
  173. package/tsconfig.json +8 -8
  174. package/utils/stress.ts +9 -9
  175. package/server/plugin/bitran/core.ts +0 -51
  176. package/shared/bitran/alias.ts +0 -17
  177. package/shared/bitran/products/alias/core/factory.ts +0 -46
  178. package/shared/bitran/products/alias/core/index.ts +0 -13
  179. package/shared/bitran/products/alias/render/Alias.vue +0 -10
  180. package/shared/bitran/products/alias/render/icon.svg +0 -3
  181. package/shared/bitran/products/alias/render/index.ts +0 -17
  182. package/shared/bitran/products/alias/render/languages/en.ts +0 -5
  183. package/shared/bitran/products/alias/render/languages/ru.ts +0 -5
  184. package/shared/bitran/products/alias/shared.ts +0 -11
  185. package/shared/bitran/products/heading/core/factory.ts +0 -53
  186. package/shared/bitran/products/heading/core/index.ts +0 -19
  187. package/shared/bitran/products/heading/render/Heading.vue +0 -47
  188. package/shared/bitran/products/heading/render/icon.svg +0 -3
  189. package/shared/bitran/products/heading/render/index.ts +0 -17
  190. package/shared/bitran/products/heading/render/languages/en.ts +0 -5
  191. package/shared/bitran/products/heading/render/languages/ru.ts +0 -5
  192. package/shared/bitran/products/heading/shared.ts +0 -13
  193. package/shared/bitran/products/include/core/factory.ts +0 -61
  194. package/shared/bitran/products/include/core/index.ts +0 -13
  195. package/shared/bitran/products/include/render/Include.vue +0 -13
  196. package/shared/bitran/products/include/render/icon.svg +0 -3
  197. package/shared/bitran/products/include/render/index.ts +0 -18
  198. package/shared/bitran/products/include/render/languages/en.ts +0 -5
  199. package/shared/bitran/products/include/render/languages/ru.ts +0 -5
  200. package/shared/bitran/products/include/shared.ts +0 -15
  201. package/shared/bitran/products/link/core/factory.ts +0 -20
  202. package/shared/bitran/products/link/core/index.ts +0 -17
  203. package/shared/bitran/products/link/render/index.ts +0 -17
  204. package/shared/bitran/products/link/render/languages/en.ts +0 -5
  205. package/shared/bitran/products/link/render/languages/ru.ts +0 -5
  206. package/shared/bitran/products/link/shared.ts +0 -15
  207. package/test/bitran/alias.test.ts +0 -44
  208. package/test/bitran/products/alias.test.ts +0 -83
  209. package/test/bitran/products/heading.test.ts +0 -119
  210. package/test/bitran/products/include.test.ts +0 -77
  211. package/test/bitran/products/link/factory.test.ts +0 -30
  212. /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 '@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
+ <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>