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.
Files changed (314) hide show
  1. package/.nuxtrc +1 -0
  2. package/app/app.vue +172 -0
  3. package/app/assets/icons/alert.svg +3 -0
  4. package/app/assets/icons/angle-right.svg +3 -0
  5. package/app/assets/icons/arrow-in-text.svg +3 -0
  6. package/app/assets/icons/arrow-left.svg +3 -0
  7. package/app/assets/icons/arrow-up-to-right.svg +3 -0
  8. package/app/assets/icons/aside-open.svg +3 -0
  9. package/app/assets/icons/asterisk.svg +3 -0
  10. package/app/assets/icons/book-question.svg +3 -0
  11. package/app/assets/icons/book.svg +3 -0
  12. package/app/assets/icons/bug.svg +3 -0
  13. package/app/assets/icons/chip.svg +3 -0
  14. package/app/assets/icons/circle-help.svg +3 -0
  15. package/app/assets/icons/construction.svg +3 -0
  16. package/app/assets/icons/cross.svg +3 -0
  17. package/app/assets/icons/draw.svg +3 -0
  18. package/app/assets/icons/ellipsis-vertical.svg +3 -0
  19. package/app/assets/icons/file-check.svg +3 -0
  20. package/app/assets/icons/file-lines.svg +3 -0
  21. package/app/assets/icons/file-star.svg +3 -0
  22. package/app/assets/icons/folder-open.svg +3 -0
  23. package/app/assets/icons/folder.svg +3 -0
  24. package/app/assets/icons/globe.svg +3 -0
  25. package/app/assets/icons/house.svg +3 -0
  26. package/app/assets/icons/link-external.svg +3 -0
  27. package/app/assets/icons/link.svg +3 -0
  28. package/app/assets/icons/moon.svg +3 -0
  29. package/app/assets/icons/outline/book.svg +3 -0
  30. package/app/assets/icons/outline/file-lines.svg +3 -0
  31. package/app/assets/icons/pirate.svg +3 -0
  32. package/app/assets/icons/plus-circle.svg +3 -0
  33. package/app/assets/icons/plus.svg +3 -0
  34. package/app/assets/icons/puzzle.svg +3 -0
  35. package/app/assets/icons/search.svg +3 -0
  36. package/app/assets/icons/shuffle.svg +3 -0
  37. package/app/assets/icons/star.svg +3 -0
  38. package/app/assets/icons/sun-moon.svg +3 -0
  39. package/app/assets/icons/sun.svg +3 -0
  40. package/app/assets/icons/user.svg +3 -0
  41. package/app/assets/icons/users.svg +3 -0
  42. package/app/components/Loading.vue +23 -0
  43. package/app/components/SiteAside.vue +382 -0
  44. package/app/components/SiteMain.vue +35 -0
  45. package/app/components/ads/BannerTemplate.vue +51 -0
  46. package/app/components/ads/BottomBanner.vue +45 -0
  47. package/app/components/ads/LeftBanner.vue +50 -0
  48. package/app/components/aside/AsideListItem.vue +74 -0
  49. package/app/components/aside/AsideMajor.vue +56 -0
  50. package/app/components/aside/AsideMinor.vue +71 -0
  51. package/app/components/aside/major/PaneContentScroll.vue +23 -0
  52. package/app/components/aside/major/PaneSwitch.vue +54 -0
  53. package/app/components/aside/major/PaneSwitchButton.vue +63 -0
  54. package/app/components/aside/major/SiteInfo.vue +85 -0
  55. package/app/components/aside/major/panes/Language.vue +79 -0
  56. package/app/components/aside/major/panes/Pages.vue +34 -0
  57. package/app/components/aside/major/panes/Search.vue +3 -0
  58. package/app/components/aside/major/panes/nav/Nav.vue +91 -0
  59. package/app/components/aside/major/panes/nav/NavBook.vue +86 -0
  60. package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -0
  61. package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -0
  62. package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -0
  63. package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -0
  64. package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -0
  65. package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -0
  66. package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -0
  67. package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -0
  68. package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -0
  69. package/app/components/aside/major/panes/other/ItemContent.vue +29 -0
  70. package/app/components/aside/major/panes/other/ItemGenerator.vue +15 -0
  71. package/app/components/aside/major/panes/other/ItemTheme.vue +54 -0
  72. package/app/components/aside/major/panes/other/Other.vue +16 -0
  73. package/app/components/aside/minor/AsideMinorContributor.vue +5 -0
  74. package/app/components/aside/minor/AsideMinorNews.vue +11 -0
  75. package/app/components/aside/minor/AsideMinorPane.vue +16 -0
  76. package/app/components/aside/minor/AsideMinorTopLink.vue +67 -0
  77. package/app/components/aside/minor/Contribute.vue +145 -0
  78. package/app/components/aside/minor/content/AsideMinorContent.vue +92 -0
  79. package/app/components/aside/minor/topic/AsideMinorTopic.vue +32 -0
  80. package/app/components/aside/minor/topic/TopicContributors.vue +177 -0
  81. package/app/components/aside/minor/topic/TopicNav.vue +49 -0
  82. package/app/components/aside/minor/topic/TopicToc.vue +202 -0
  83. package/app/components/aside/minor/topic/TopicTocItem.vue +31 -0
  84. package/app/components/aside/utils/AsideOverlayPane.vue +40 -0
  85. package/app/components/bitran/BitranContent.vue +64 -0
  86. package/app/components/bitran/RenderWrapper.vue +12 -0
  87. package/app/components/contributor/ContributorAvatar.vue +43 -0
  88. package/app/components/contributor/ContributorListItem.vue +35 -0
  89. package/app/components/main/topic/MainTopic.vue +79 -0
  90. package/app/components/main/topic/TopicPartSwitch.vue +118 -0
  91. package/app/components/main/utils/Breadcrumb.vue +75 -0
  92. package/app/components/main/utils/ContentDecoration.vue +29 -0
  93. package/app/components/main/utils/ContentDescription.vue +20 -0
  94. package/app/components/main/utils/ContentFlag.vue +16 -0
  95. package/app/components/main/utils/ContentPopover.vue +176 -0
  96. package/app/components/main/utils/ContentPopovers.vue +105 -0
  97. package/app/components/main/utils/ContentReferences.vue +76 -0
  98. package/app/components/main/utils/ContentSection.vue +42 -0
  99. package/app/components/main/utils/ContentTitle.vue +37 -0
  100. package/app/components/main/utils/reference/ReferenceGroup.vue +41 -0
  101. package/app/components/main/utils/reference/ReferenceItem.vue +64 -0
  102. package/app/components/main/utils/reference/ReferenceSource.vue +110 -0
  103. package/app/components/preview/Preview.vue +177 -0
  104. package/app/components/preview/PreviewDisplay.vue +139 -0
  105. package/app/components/preview/PreviewFooterAction.vue +73 -0
  106. package/app/components/preview/PreviewLoading.vue +15 -0
  107. package/app/components/preview/PreviewScreen.vue +99 -0
  108. package/app/components/preview/display/Alert.vue +50 -0
  109. package/app/components/preview/display/Custom.vue +18 -0
  110. package/app/components/preview/display/GenericLink.vue +48 -0
  111. package/app/components/preview/display/PageLink.vue +20 -0
  112. package/app/components/preview/display/Unique.vue +49 -0
  113. package/app/components/transition/Fade.vue +22 -0
  114. package/app/components/tree/TreeContainer.vue +12 -0
  115. package/app/components/tree/TreeItem.vue +89 -0
  116. package/app/composables/bitran.ts +132 -0
  117. package/app/composables/bitranContent.ts +36 -0
  118. package/app/composables/bitranLocation.ts +7 -0
  119. package/app/composables/contentData.ts +36 -0
  120. package/app/composables/contentPage.ts +156 -0
  121. package/app/composables/contentRoute.ts +45 -0
  122. package/app/composables/darkMagic.ts +24 -0
  123. package/app/composables/externalApi.ts +63 -0
  124. package/app/composables/favicon.ts +8 -0
  125. package/app/composables/formatText.ts +86 -0
  126. package/app/composables/majorPane.ts +60 -0
  127. package/app/composables/phrases.ts +80 -0
  128. package/app/composables/theme.ts +29 -0
  129. package/app/composables/url.ts +33 -0
  130. package/app/pages/_test/preview.vue +110 -0
  131. package/app/pages/article/[...articleId].vue +3 -0
  132. package/app/pages/book/[...bookId].vue +47 -0
  133. package/app/pages/group/[...groupId].vue +64 -0
  134. package/app/pages/index.vue +32 -0
  135. package/app/pages/members.vue +7 -0
  136. package/app/pages/practice/[...practice].vue +3 -0
  137. package/app/pages/summary/[...summaryId].vue +3 -0
  138. package/app/public/favicon/article.svg +10 -0
  139. package/app/public/favicon/default.svg +10 -0
  140. package/app/public/favicon/practice.svg +10 -0
  141. package/app/public/favicon/summary.svg +10 -0
  142. package/app/public/logotype.svg +17 -0
  143. package/app/public/og-default.png +0 -0
  144. package/app/public/user.svg +10 -0
  145. package/app/scripts/_immediate.js +4 -0
  146. package/app/scripts/aside/index.ts +59 -0
  147. package/app/scripts/aside/major/nav.ts +26 -0
  148. package/app/scripts/aside/minor/state.ts +37 -0
  149. package/app/scripts/aside/minor/topic.ts +3 -0
  150. package/app/scripts/flag.ts +28 -0
  151. package/app/scripts/og.ts +27 -0
  152. package/app/scripts/preview/build.ts +84 -0
  153. package/app/scripts/preview/data/alert.ts +19 -0
  154. package/app/scripts/preview/data/custom.ts +8 -0
  155. package/app/scripts/preview/data/genericLink.ts +24 -0
  156. package/app/scripts/preview/data/pageLink.ts +20 -0
  157. package/app/scripts/preview/data/unique.ts +70 -0
  158. package/app/scripts/preview/data.ts +26 -0
  159. package/app/scripts/preview/display.ts +39 -0
  160. package/app/scripts/preview/footer.ts +9 -0
  161. package/app/scripts/preview/request.ts +51 -0
  162. package/app/scripts/preview/state.ts +63 -0
  163. package/app/styles/_immediate.css +3 -0
  164. package/app/styles/_util.scss +50 -0
  165. package/app/styles/_utils.scss +44 -0
  166. package/app/styles/app.scss +91 -0
  167. package/app/styles/def/_bp.scss +24 -0
  168. package/app/styles/def/_size.scss +7 -0
  169. package/app/styles/def/_z.scss +5 -0
  170. package/app/styles/default.scss +85 -0
  171. package/app/styles/normalize.scss +63 -0
  172. package/app/styles/partials/_darkMagic.scss +7 -0
  173. package/app/styles/partials/_fnav.scss +18 -0
  174. package/app/styles/partials/_preview.scss +7 -0
  175. package/globalPath.ts +24 -0
  176. package/globals/bitran.ts +39 -0
  177. package/globals/content.ts +22 -0
  178. package/globals/contributor.ts +5 -0
  179. package/globals/erudit.ts +5 -0
  180. package/globals/register.ts +18 -0
  181. package/languages/en.ts +95 -0
  182. package/languages/ru.ts +99 -0
  183. package/module/bitran.ts +34 -0
  184. package/module/config.ts +34 -0
  185. package/module/imports.ts +46 -0
  186. package/module/index.ts +35 -0
  187. package/module/logger.ts +10 -0
  188. package/module/paths.ts +22 -0
  189. package/module/restart.ts +61 -0
  190. package/nuxt.config.ts +96 -0
  191. package/package.json +32 -0
  192. package/server/api/aside/major/nav/bookIds.ts +5 -0
  193. package/server/api/aside/major/nav/bookNav/[...bookId].ts +20 -0
  194. package/server/api/aside/major/nav/global.ts +7 -0
  195. package/server/api/aside/minor/news.ts +7 -0
  196. package/server/api/aside/minor/path.ts +78 -0
  197. package/server/api/bitran/content/[location].ts +7 -0
  198. package/server/api/bitran/toc/[location].ts +7 -0
  199. package/server/api/content/data.ts +72 -0
  200. package/server/api/contributor/count.ts +6 -0
  201. package/server/api/fake/content.ts +11 -0
  202. package/server/api/fake/shared/languages.ts +12 -0
  203. package/server/api/language/functions.ts +12 -0
  204. package/server/api/language/phrase/[phraseId].ts +19 -0
  205. package/server/api/language/phraseIds.ts +8 -0
  206. package/server/api/preview/page/[...parts].ts +51 -0
  207. package/server/api/preview/unique/[location].ts +55 -0
  208. package/server/plugin/bitran/content.ts +176 -0
  209. package/server/plugin/bitran/core.ts +51 -0
  210. package/server/plugin/bitran/location.ts +25 -0
  211. package/server/plugin/bitran/products/include.ts +229 -0
  212. package/server/plugin/bitran/products/link.ts +114 -0
  213. package/server/plugin/bitran/setup.ts +10 -0
  214. package/server/plugin/bitran/toc.ts +82 -0
  215. package/server/plugin/build/close.ts +10 -0
  216. package/server/plugin/build/jobs/content/builderArgs.ts +8 -0
  217. package/server/plugin/build/jobs/content/generic.ts +176 -0
  218. package/server/plugin/build/jobs/content/parse.ts +90 -0
  219. package/server/plugin/build/jobs/content/path.ts +6 -0
  220. package/server/plugin/build/jobs/content/type/book.ts +9 -0
  221. package/server/plugin/build/jobs/content/type/group.ts +37 -0
  222. package/server/plugin/build/jobs/content/type/topic.ts +36 -0
  223. package/server/plugin/build/jobs/contributors.ts +66 -0
  224. package/server/plugin/build/jobs/language.ts +36 -0
  225. package/server/plugin/build/jobs/nav.ts +209 -0
  226. package/server/plugin/build/process.ts +25 -0
  227. package/server/plugin/build/rebuild.ts +55 -0
  228. package/server/plugin/build/setup.ts +21 -0
  229. package/server/plugin/content/absoluteId.ts +94 -0
  230. package/server/plugin/content/context.ts +112 -0
  231. package/server/plugin/db/entities/Book.ts +7 -0
  232. package/server/plugin/db/entities/Content.ts +49 -0
  233. package/server/plugin/db/entities/Contribution.ts +10 -0
  234. package/server/plugin/db/entities/Contributor.ts +16 -0
  235. package/server/plugin/db/entities/Group.ts +14 -0
  236. package/server/plugin/db/entities/Hash.ts +15 -0
  237. package/server/plugin/db/entities/Topic.ts +20 -0
  238. package/server/plugin/db/entities/Unique.ts +21 -0
  239. package/server/plugin/db/setup.ts +34 -0
  240. package/server/plugin/global.ts +18 -0
  241. package/server/plugin/importer.ts +12 -0
  242. package/server/plugin/index.ts +9 -0
  243. package/server/plugin/logger.ts +23 -0
  244. package/server/plugin/nav/node.ts +26 -0
  245. package/server/plugin/nav/utils.ts +129 -0
  246. package/server/plugin/repository/book.ts +21 -0
  247. package/server/plugin/repository/content.ts +238 -0
  248. package/server/plugin/repository/contributor.ts +8 -0
  249. package/server/plugin/repository/frontNav.ts +148 -0
  250. package/server/plugin/repository/topic.ts +32 -0
  251. package/server/tsconfig.json +7 -0
  252. package/shared/aside/minor.ts +50 -0
  253. package/shared/asset.ts +15 -0
  254. package/shared/bitran/alias.ts +17 -0
  255. package/shared/bitran/context.ts +7 -0
  256. package/shared/bitran/location.ts +166 -0
  257. package/shared/bitran/products/alias/core/factory.ts +46 -0
  258. package/shared/bitran/products/alias/core/index.ts +13 -0
  259. package/shared/bitran/products/alias/render/Alias.vue +10 -0
  260. package/shared/bitran/products/alias/render/icon.svg +3 -0
  261. package/shared/bitran/products/alias/render/index.ts +17 -0
  262. package/shared/bitran/products/alias/render/languages/en.ts +5 -0
  263. package/shared/bitran/products/alias/render/languages/ru.ts +5 -0
  264. package/shared/bitran/products/alias/shared.ts +11 -0
  265. package/shared/bitran/products/heading/core/factory.ts +53 -0
  266. package/shared/bitran/products/heading/core/index.ts +19 -0
  267. package/shared/bitran/products/heading/render/Heading.vue +47 -0
  268. package/shared/bitran/products/heading/render/icon.svg +3 -0
  269. package/shared/bitran/products/heading/render/index.ts +17 -0
  270. package/shared/bitran/products/heading/render/languages/en.ts +5 -0
  271. package/shared/bitran/products/heading/render/languages/ru.ts +5 -0
  272. package/shared/bitran/products/heading/shared.ts +13 -0
  273. package/shared/bitran/products/include/core/factory.ts +61 -0
  274. package/shared/bitran/products/include/core/index.ts +13 -0
  275. package/shared/bitran/products/include/render/Include.vue +13 -0
  276. package/shared/bitran/products/include/render/icon.svg +3 -0
  277. package/shared/bitran/products/include/render/index.ts +18 -0
  278. package/shared/bitran/products/include/render/languages/en.ts +5 -0
  279. package/shared/bitran/products/include/render/languages/ru.ts +5 -0
  280. package/shared/bitran/products/include/shared.ts +15 -0
  281. package/shared/bitran/products/link/core/factory.ts +20 -0
  282. package/shared/bitran/products/link/core/index.ts +17 -0
  283. package/shared/bitran/products/link/render/Link.vue +174 -0
  284. package/shared/bitran/products/link/render/icon.svg +3 -0
  285. package/shared/bitran/products/link/render/index.ts +17 -0
  286. package/shared/bitran/products/link/render/languages/en.ts +5 -0
  287. package/shared/bitran/products/link/render/languages/ru.ts +5 -0
  288. package/shared/bitran/products/link/shared.ts +15 -0
  289. package/shared/bitran/products/link/target.ts +134 -0
  290. package/shared/bitran/toc.ts +8 -0
  291. package/shared/content/context.ts +9 -0
  292. package/shared/content/data/base.ts +32 -0
  293. package/shared/content/data/index.ts +5 -0
  294. package/shared/content/data/type/book.ts +5 -0
  295. package/shared/content/data/type/group.ts +6 -0
  296. package/shared/content/data/type/topic.ts +11 -0
  297. package/shared/content/previousNext.ts +9 -0
  298. package/shared/contributor.ts +5 -0
  299. package/shared/frontNav.ts +41 -0
  300. package/shared/icons.ts +38 -0
  301. package/shared/image.ts +5 -0
  302. package/shared/link.ts +25 -0
  303. package/shared/types/language.ts +75 -0
  304. package/shared/utils/objectsEqual.ts +4 -0
  305. package/shared/utils/stringColor.ts +9 -0
  306. package/test/bitran/alias.test.ts +44 -0
  307. package/test/bitran/location.test.ts +143 -0
  308. package/test/bitran/products/alias.test.ts +83 -0
  309. package/test/bitran/products/heading.test.ts +119 -0
  310. package/test/bitran/products/include.test.ts +77 -0
  311. package/test/bitran/products/link/factory.test.ts +30 -0
  312. package/test/bitran/products/link/target.test.ts +138 -0
  313. package/tsconfig.json +8 -0
  314. package/utils/stress.ts +9 -0
@@ -0,0 +1,176 @@
1
+ <script lang="ts" setup>
2
+ import { useFloating, autoUpdate, arrow, shift } from '@floating-ui/vue';
3
+
4
+ import type { PopoverData } from '@shared/popover';
5
+ import { isMyIcon } from '#my-icons';
6
+
7
+ defineProps<{ data: PopoverData }>();
8
+
9
+ const referenceElement = useTemplateRef('reference');
10
+ const popoverElement = useTemplateRef('popover');
11
+ const arrowElement = useTemplateRef('popover-arrow');
12
+
13
+ const { floatingStyles, middlewareData } = useFloating(
14
+ referenceElement,
15
+ popoverElement,
16
+ {
17
+ whileElementsMounted: autoUpdate,
18
+ middleware: [
19
+ shift({
20
+ boundary: document?.querySelector('[erudit-main]'),
21
+ padding: 15,
22
+ }),
23
+ arrow({ element: arrowElement }),
24
+ ],
25
+ },
26
+ );
27
+
28
+ const popoverVisible = ref(false);
29
+
30
+ const hideDelay = 100;
31
+ let hideTimeout;
32
+
33
+ function showPopover() {
34
+ clearTimeout(hideTimeout);
35
+ popoverVisible.value = true;
36
+ }
37
+
38
+ function hidePopover() {
39
+ hideTimeout = setTimeout(() => {
40
+ popoverVisible.value = false;
41
+ }, hideDelay);
42
+ }
43
+ </script>
44
+
45
+ <template>
46
+ <div
47
+ ref="reference"
48
+ :class="$style.reference"
49
+ :style="`--popoverColor: ${data.color}`"
50
+ @mouseenter="showPopover"
51
+ @mouseleave="hidePopover"
52
+ >
53
+ <MyIcon v-if="isMyIcon(data.icon)" :name="data.icon as any" />
54
+ <MyRuntimeIcon v-else name="popover-icon" :svg="data.icon" />
55
+
56
+ {{ data.title }}
57
+
58
+ <TransitionFade>
59
+ <div
60
+ v-if="popoverVisible"
61
+ ref="popover"
62
+ :class="$style.popover"
63
+ :style="floatingStyles"
64
+ >
65
+ <div
66
+ ref="popover-arrow"
67
+ :class="$style.arrow"
68
+ :style="{
69
+ position: 'absolute',
70
+ top:
71
+ middlewareData.arrow?.y != null
72
+ ? `${middlewareData.arrow.y}px`
73
+ : '',
74
+ left:
75
+ middlewareData.arrow?.x != null
76
+ ? `${middlewareData.arrow.x}px`
77
+ : '',
78
+ }"
79
+ ></div>
80
+
81
+ <div :class="$style.inner">
82
+ <MyIcon
83
+ :class="$style.floatIcon"
84
+ v-if="isMyIcon(data.icon)"
85
+ :name="data.icon as any"
86
+ />
87
+ <MyRuntimeIcon
88
+ :class="$style.floatIcon"
89
+ v-else
90
+ name="popover-icon"
91
+ :svg="data.icon"
92
+ />
93
+
94
+ <div :class="$style.title">{{ data.title }}</div>
95
+ <div v-if="data.description">{{ data.description }}</div>
96
+
97
+ <slot></slot>
98
+ </div>
99
+ </div>
100
+ </TransitionFade>
101
+ </div>
102
+ </template>
103
+
104
+ <style lang="scss" module>
105
+ .reference {
106
+ --_baseColor: color-mix(in srgb, var(--popoverColor), var(--invert) 35%);
107
+ --_bgColor: color-mix(in srgb, var(--popoverColor), var(--bgAside) 85%);
108
+ }
109
+
110
+ .reference {
111
+ display: flex;
112
+ align-items: center;
113
+ flex-shrink: 0;
114
+ gap: var(--gapSmall);
115
+ padding: var(--gapSmall);
116
+
117
+ background: var(--_bgColor);
118
+ color: var(--_baseColor);
119
+ font-size: 0.9em;
120
+ line-height: 0;
121
+
122
+ border: 1px solid var(--_baseColor);
123
+ border-radius: 3px;
124
+ cursor: help;
125
+ }
126
+
127
+ .popover {
128
+ cursor: auto;
129
+
130
+ position: absolute;
131
+ z-index: 999;
132
+ min-width: 300px;
133
+ max-width: 320px;
134
+ padding-top: var(--gap);
135
+ line-height: normal;
136
+
137
+ .arrow {
138
+ position: absolute;
139
+ top: 14px;
140
+ left: 0;
141
+ background: var(--_baseColor);
142
+ width: 32px;
143
+ height: 32px;
144
+ transform: rotate(45deg);
145
+ }
146
+
147
+ .inner {
148
+ position: relative;
149
+ z-index: 1;
150
+ box-shadow: 0 0 18px
151
+ color-mix(
152
+ in srgb,
153
+ color-mix(in srgb, var(--popoverColor), var(--invert) 50%),
154
+ transparent 70%
155
+ );
156
+ padding: var(--gapSmall);
157
+ border: 2px solid var(--_baseColor);
158
+ border-radius: 3px;
159
+ background: linear-gradient(45deg, var(--bgAside), var(--_bgColor) 70%);
160
+
161
+ font-size: 0.9em;
162
+
163
+ .floatIcon {
164
+ float: right;
165
+ margin: 5px 5px 10px 10px;
166
+ font-size: 30px;
167
+ opacity: 0.3;
168
+ }
169
+
170
+ .title {
171
+ font-weight: 600;
172
+ margin-bottom: var(--gapSmall);
173
+ }
174
+ }
175
+ }
176
+ </style>
@@ -0,0 +1,105 @@
1
+ <script lang="ts" setup>
2
+ import type { ContentFlag } from '@package';
3
+
4
+ import type { ContentGenericData } from '@shared/content/data/base';
5
+
6
+ import ContentPopover from './ContentPopover.vue';
7
+ import type { PopoverData } from '@shared/popover';
8
+ import { type MyIconName } from '#my-icons';
9
+
10
+ const props = defineProps<{
11
+ generic: ContentGenericData /* TODO: customPopovers[] */;
12
+ }>();
13
+
14
+ const phrase = await usePhrases(
15
+ 'flag_dev',
16
+ 'flag_dev_description',
17
+ 'flag_advanced',
18
+ 'flag_advanced_description',
19
+ 'flag_secondary',
20
+ 'flag_secondary_description',
21
+ 'popover_dependencies',
22
+ 'popover_dependencies_description',
23
+ );
24
+
25
+ const flagData: Record<ContentFlag, PopoverData> = {
26
+ dev: {
27
+ icon: <MyIconName>'alert',
28
+ color: 'var(--warn)',
29
+ title: phrase.flag_dev,
30
+ description: phrase.flag_dev_description,
31
+ },
32
+ advanced: {
33
+ icon: <MyIconName>'asterisk',
34
+ color: '#7c67ac',
35
+ title: phrase.flag_advanced,
36
+ description: phrase.flag_advanced_description,
37
+ },
38
+ secondary: {
39
+ icon: <MyIconName>'puzzle',
40
+ color: '#7faf35',
41
+ title: phrase.flag_secondary,
42
+ description: phrase.flag_secondary_description,
43
+ },
44
+ };
45
+
46
+ const dependenciesData: PopoverData = {
47
+ icon: <MyIconName>'shuffle',
48
+ color: '#47baa9',
49
+ title: phrase.popover_dependencies,
50
+ description: phrase.popover_dependencies_description,
51
+ };
52
+
53
+ const hasPopovers = computed(() => {
54
+ if (props.generic?.flags && Object.keys(props.generic.flags)?.length)
55
+ return true;
56
+
57
+ if (props.generic?.dependencies) return true;
58
+
59
+ return false;
60
+ });
61
+ </script>
62
+
63
+ <template>
64
+ <section v-if="hasPopovers" :class="$style.popovers">
65
+ <ContentPopover
66
+ v-for="flagName of Object.keys(generic.flags)"
67
+ :data="flagData[flagName]"
68
+ />
69
+
70
+ <ContentPopover v-if="generic?.dependencies" :data="dependenciesData">
71
+ <ul :class="$style.dependenciesList">
72
+ <li v-for="(value, key) in generic.dependencies">
73
+ <NuxtLink :prefetch="false" :to="key">{{ value }}</NuxtLink>
74
+ </li>
75
+ </ul>
76
+ </ContentPopover>
77
+ </section>
78
+ </template>
79
+
80
+ <style lang="scss" module>
81
+ .popovers {
82
+ display: flex;
83
+ flex-wrap: wrap;
84
+ gap: var(--gap);
85
+ padding: var(--_pMainY) var(--_pMainX);
86
+ }
87
+
88
+ .dependenciesList {
89
+ margin-top: var(--gapSmall);
90
+ list-style-type: square;
91
+ list-style-position: inside;
92
+ padding-inline-start: 0;
93
+
94
+ li {
95
+ &::marker {
96
+ content: '↪';
97
+ }
98
+
99
+ a {
100
+ color: inherit;
101
+ padding-left: var(--gapSmall);
102
+ }
103
+ }
104
+ }
105
+ </style>
@@ -0,0 +1,76 @@
1
+ <script lang="ts" setup>
2
+ import type { ContentReferences } from '@package';
3
+
4
+ import ReferenceGroup from './reference/ReferenceGroup.vue';
5
+
6
+ const props = defineProps<{ references: ContentReferences; }>();
7
+
8
+ const count = computed(() => {
9
+ return props.references.reduce((sum, referenceGroup) => sum + (referenceGroup.references.length || 0), 0);
10
+ });
11
+
12
+ const phrase = await usePhrases(
13
+ 'references',
14
+ 'references_description',
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <h2 :class="$style.heading">
20
+ <MyIcon name="link-external" :class="$style.icon" />
21
+ <span :class="$style.title">{{ phrase.references }}</span>
22
+ <span :class="$style.count">{{ count }}</span>
23
+ </h2>
24
+
25
+ <p :class="$style.description">{{ phrase.references_description }}</p>
26
+
27
+ <section :class="$style.referenceGroups">
28
+ <ReferenceGroup v-for="group of references" :group />
29
+ </section>
30
+ </template>
31
+
32
+ <style lang="scss" module>
33
+ .heading
34
+ {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: var(--gap);
38
+ padding: var(--_pMainY) var(--_pMainX);
39
+
40
+ .icon
41
+ {
42
+ font-size: .9em;
43
+ color: var(--textMuted);
44
+ }
45
+
46
+ .count
47
+ {
48
+ position: relative;
49
+ top: 1px;
50
+ font-weight: 550;
51
+ font-size: .6em;
52
+ background: color-mix(in srgb, var(--textDimmed), transparent 65%) ;
53
+ border-radius: 20px;
54
+ padding: 2px 10px;
55
+ }
56
+ }
57
+
58
+ .description
59
+ {
60
+ padding: var(--_pMainY) var(--_pMainX);
61
+ }
62
+
63
+ .referenceGroups
64
+ {
65
+ display: flex;
66
+ flex-direction: column;
67
+ padding: var(--_pMainY) var(--_pMainX);
68
+
69
+ > *:not(:last-of-type)
70
+ {
71
+ padding-bottom: var(--gap);
72
+ margin-bottom: var(--gap);
73
+ border-bottom: 1px solid var(--border);
74
+ }
75
+ }
76
+ </style>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <hr :class="$style.hr">
3
+ <slot></slot>
4
+ </template>
5
+
6
+ <style lang="scss" module>
7
+ @mixin shade
8
+ {
9
+ height: 50px;
10
+ border-bottom: 2px solid var(--border);
11
+ background: linear-gradient(to bottom, transparent, var(--bgAside));
12
+ }
13
+
14
+ @mixin simple
15
+ {
16
+ height: var(--gap);
17
+ }
18
+
19
+ .hr
20
+ {
21
+ border: none;
22
+
23
+ &::before,
24
+ &::after
25
+ {
26
+ display: block;
27
+ content: '';
28
+ }
29
+
30
+ &:nth-of-type(even)
31
+ {
32
+ &::before { @include shade; }
33
+ &::after { @include simple; }
34
+ }
35
+
36
+ &:nth-of-type(odd)
37
+ {
38
+ &::before { @include simple; }
39
+ &::after { @include shade; transform: scaleY(-1); }
40
+ }
41
+ }
42
+ </style>
@@ -0,0 +1,37 @@
1
+ <script lang="ts" setup>
2
+ import { isMyIcon } from '#my-icons';
3
+
4
+ defineProps<{ icon: string; title: string; hint?: string; }>();
5
+ </script>
6
+
7
+ <template>
8
+ <section :class="$style.contentTitle">
9
+ <MyIcon v-if="isMyIcon(icon)" :name="icon as any" :title="hint" />
10
+ <MyRuntimeIcon v-else name="content-title-icon" :svg="icon" :title="hint" />
11
+ <h1>{{ title }}</h1>
12
+ </section>
13
+ </template>
14
+
15
+ <style lang="scss" module>
16
+ .contentTitle
17
+ {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: var(--gap);
21
+ padding: 0 var(--_pMainX);
22
+
23
+ [my-icon]
24
+ {
25
+ font-size: 1.65em;
26
+ color: var(--textMuted);
27
+ position: relative;
28
+ top: 1px;
29
+ cursor: help;
30
+ }
31
+
32
+ h1
33
+ {
34
+ font-size: 1.925em;
35
+ }
36
+ }
37
+ </style>
@@ -0,0 +1,41 @@
1
+ <script lang="ts" setup>
2
+ import type { ContentReferenceGroup } from '@package';
3
+
4
+ import ReferenceSource from './ReferenceSource.vue';
5
+ import ReferenceItem from './ReferenceItem.vue';
6
+
7
+ defineProps<{ group: ContentReferenceGroup; }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div :class="$style.group">
12
+ <ReferenceSource :source="group.source" />
13
+ <div :class="$style.references">
14
+ <ReferenceItem v-for="reference of group.references" :reference />
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <style lang="scss" module>
20
+ @use '$/def/bp';
21
+
22
+ .group
23
+ {
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: var(--gap);
27
+ }
28
+
29
+ .references
30
+ {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: var(--gap);
34
+ margin-left: 34px;
35
+
36
+ @include bp.below(mobile)
37
+ {
38
+ margin-left: 0;
39
+ }
40
+ }
41
+ </style>
@@ -0,0 +1,64 @@
1
+ <script lang="ts" setup>
2
+ import type { ContentReferenceItem } from '@package';
3
+
4
+ defineProps<{ reference: ContentReferenceItem; }>();
5
+ </script>
6
+
7
+ <template>
8
+ <div :class="$style.reference">
9
+ <MyIcon name="arrow-up-to-right" :class="$style.icon" />
10
+ <div :class="$style.body">
11
+ <div :class="$style.header">
12
+ <a :href="reference.link" target="_blank">{{ reference.title }}</a>
13
+ <MyIcon v-if="reference.link" name="link-external" :class="$style.linkIcon" />
14
+ </div>
15
+ <div v-if="reference.description" :class="$style.description">{{ reference.description }}</div>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <style lang="scss" module>
21
+ .reference
22
+ {
23
+ font-size: .92em;
24
+ display: flex;
25
+ align-items: start;
26
+ gap: var(--gap);
27
+
28
+ .icon
29
+ {
30
+ position: relative;
31
+ top: 4px;
32
+ flex-shrink: 0;
33
+ color: var(--textMuted);
34
+ }
35
+
36
+ .body
37
+ {
38
+ .header
39
+ {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: var(--gap);
43
+ font-weight: 550;
44
+
45
+ a[href] { @include hoverLink; }
46
+
47
+ .linkIcon
48
+ {
49
+ position: relative;
50
+ left: -3px;
51
+ flex-shrink: 0;
52
+ color: var(--textDimmed);
53
+ font-size: .85em;
54
+ opacity: .6;
55
+ }
56
+ }
57
+
58
+ .description
59
+ {
60
+ color: var(--textMuted);
61
+ }
62
+ }
63
+ }
64
+ </style>
@@ -0,0 +1,110 @@
1
+ <script lang="ts" setup>
2
+ import { type MyIconName } from '#my-icons';
3
+ import type { ContentReferenceSource } from '@package';
4
+
5
+ const props = defineProps<{ source: ContentReferenceSource; }>();
6
+
7
+ const typeIcon = computed<MyIconName>(() => {
8
+ switch (props.source.type)
9
+ {
10
+ case 'book': return 'book';
11
+ case 'site': return 'globe';
12
+ default: return 'file-lines';
13
+ }
14
+ });
15
+
16
+ const phrase = await usePhrases('reference_source_featured');
17
+ </script>
18
+
19
+ <template>
20
+ <div :class="$style.source">
21
+ <div :class="$style.typeIcon">
22
+ <MyIcon :name="typeIcon" />
23
+ </div>
24
+ <div :class="$style.body">
25
+ <div :class="$style.header">
26
+ <MyIcon :name="typeIcon" :class="$style.headerTypeIcon" />
27
+ <a :href="source.link" target="_blank">{{ source.title }}</a>
28
+ <MyIcon v-if="source.featured" name="star" style="cursor: help;" :title="phrase.reference_source_featured" />
29
+ <MyIcon v-if="source.link" name="link-external" :class="$style.linkIcon" />
30
+ </div>
31
+ <div v-if="source.description" :class="$style.description">{{ source.description }}</div>
32
+ <div v-if="source.comment" :class="$style.comment">{{ source.comment }}</div>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <style lang="scss" module>
38
+ @use '$/def/bp';
39
+
40
+ .source
41
+ {
42
+ display: flex;
43
+ align-items: start;
44
+ gap: var(--gap);
45
+
46
+ .typeIcon
47
+ {
48
+ flex-shrink: 0;
49
+ position: relative;
50
+ top: 4px;
51
+ color: var(--textMuted);
52
+
53
+ @include bp.below(mobile)
54
+ {
55
+ display: none;
56
+ }
57
+ }
58
+
59
+ .body
60
+ {
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: var(--gapSmall);
64
+
65
+ .header
66
+ {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: var(--gap);
70
+ font-weight: 550;
71
+
72
+ a[href] { @include hoverLink; }
73
+
74
+ [my-icon]
75
+ {
76
+ flex-shrink: 0;
77
+ font-size: 1em;
78
+ color: var(--textDimmed);
79
+ }
80
+
81
+ .headerTypeIcon
82
+ {
83
+ color: var(--textMuted);
84
+ display: none;
85
+ @include bp.below(mobile)
86
+ {
87
+ display: initial;
88
+ }
89
+ }
90
+
91
+ .linkIcon
92
+ {
93
+ font-size: .85em;
94
+ opacity: .6;
95
+ }
96
+ }
97
+
98
+ .description,
99
+ .comment
100
+ {
101
+ color: var(--textMuted);
102
+ }
103
+
104
+ .comment
105
+ {
106
+ font-style: italic;
107
+ }
108
+ }
109
+ }
110
+ </style>