erudit 4.1.0 → 4.2.0-dev.1
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/app/assets/icons/update.svg +3 -0
- package/app/components/Prose.vue +7 -7
- package/app/components/SmartMedia.vue +4 -4
- package/app/components/aside/major/contentNav/PaneBookNav.vue +1 -4
- package/app/components/aside/minor/content/Toc.vue +24 -1
- package/app/components/aside/minor/content/TocItem.vue +2 -1
- package/app/components/aside/minor/news/AsideMinorNews.vue +1 -3
- package/app/components/aside/minor/news/NewsItem.vue +3 -4
- package/app/components/aside/minor/news/RenderNewsElement.vue +4 -11
- package/app/components/aside/minor/news/elements/Mix.vue +2 -3
- package/app/components/aside/minor/news/elements/P.vue +3 -3
- package/app/components/aside/minor/news/elements/Ref.vue +3 -3
- package/app/components/aside/minor/news/elements/Text.vue +2 -2
- package/app/components/main/MainContentChild.vue +3 -3
- package/app/components/main/{MainQuickLink.vue → MainKeyLink.vue} +11 -11
- package/app/components/main/{MainQuickLinks.vue → MainKeyLinks.vue} +7 -7
- package/app/components/main/MainQuoteLoader.vue +2 -4
- package/app/components/main/MainStickyHeader.vue +1 -1
- package/app/components/main/MainStickyHeaderPreamble.vue +6 -2
- package/app/components/main/MainTopicPartPage.vue +8 -3
- package/app/components/main/connections/DepUnique.vue +45 -0
- package/app/components/main/connections/Deps.vue +15 -5
- package/app/components/main/connections/Externals.vue +4 -4
- package/app/components/main/connections/MainConnections.vue +1 -0
- package/app/components/main/contentStats/ItemLastChanged.vue +68 -0
- package/app/components/main/contentStats/MainContentStats.vue +36 -28
- package/app/components/preview/PreviewScreen.vue +2 -2
- package/app/components/preview/screen/ContentPage.vue +1 -4
- package/app/components/preview/screen/Unique.vue +3 -5
- package/app/composables/appElements.ts +2 -4
- package/app/composables/asideMajorPane.ts +3 -3
- package/app/composables/fetchJson.ts +4 -0
- package/app/composables/lastChanged.ts +28 -0
- package/app/composables/mainContent.ts +1 -4
- package/app/composables/og.ts +43 -35
- package/app/composables/phrases.ts +0 -3
- package/app/composables/scrollUp.ts +1 -1
- package/app/pages/book/[...bookId].vue +5 -1
- package/app/pages/contributor/[contributorId].vue +3 -5
- package/app/pages/contributors.vue +1 -1
- package/app/pages/group/[...groupId].vue +5 -1
- package/app/pages/index.vue +1 -1
- package/app/pages/page/[...pageId].vue +8 -3
- package/app/pages/sponsors.vue +1 -1
- package/app/plugins/appSetup/index.ts +0 -5
- package/app/plugins/fetchJson.ts +11 -0
- package/app/plugins/prerender.server.ts +1 -1
- package/app/router.options.ts +1 -1
- package/modules/erudit/globals/prose.ts +3 -4
- package/modules/erudit/setup/elements/appTemplate.ts +6 -7
- package/modules/erudit/setup/elements/{globalTypes.ts → elementGlobalTypes.ts} +21 -21
- package/modules/erudit/setup/elements/globalTemplate.ts +29 -23
- package/modules/erudit/setup/elements/setup.ts +18 -16
- package/modules/erudit/setup/elements/shared.ts +2 -2
- package/modules/erudit/setup/elements/tagsTable.ts +1 -1
- package/modules/erudit/setup/runtimeConfig.ts +2 -0
- package/nuxt.config.ts +2 -2
- package/package.json +14 -13
- package/server/api/main/content/[...contentTypePath].ts +5 -4
- package/server/api/prerender/content.ts +1 -3
- package/server/api/preview/contentPage/[...contentTypePath].ts +1 -2
- package/server/api/preview/contentUnique/[...contentTypePathUnique].ts +16 -31
- package/server/api/problemScript/[...problemScriptPath].ts +73 -4
- package/server/erudit/content/global/build.ts +21 -7
- package/server/erudit/content/nav/build.ts +4 -4
- package/server/erudit/content/repository/children.ts +3 -3
- package/server/erudit/content/repository/deps.ts +127 -39
- package/server/erudit/content/repository/elementSnippets.ts +16 -16
- package/server/erudit/content/repository/stats.ts +30 -22
- package/server/erudit/content/repository/topicParts.ts +1 -1
- package/server/erudit/content/repository/unique.ts +14 -15
- package/server/erudit/content/resolve/index.ts +6 -1
- package/server/erudit/content/resolve/page.ts +15 -35
- package/server/erudit/content/resolve/topic.ts +33 -164
- package/server/erudit/content/resolve/utils/insertContentItem.ts +2 -2
- package/server/erudit/content/resolve/utils/insertContentResolved.ts +82 -31
- package/server/erudit/content/search.ts +5 -22
- package/server/erudit/contributors/build.ts +7 -8
- package/server/erudit/db/repository/pushFile.ts +10 -3
- package/server/erudit/db/repository/pushProblemScript.ts +14 -3
- package/server/erudit/db/schema/contentDeps.ts +3 -0
- package/server/erudit/db/schema/contentSnippets.ts +3 -3
- package/server/erudit/db/schema/contentUniques.ts +2 -2
- package/server/erudit/db/schema/contributors.ts +2 -2
- package/server/erudit/db/schema/news.ts +2 -2
- package/server/erudit/db/schema/pages.ts +2 -2
- package/server/erudit/db/schema/topics.ts +4 -4
- package/server/erudit/global.ts +4 -0
- package/server/erudit/importer.ts +16 -8
- package/server/erudit/index.ts +0 -3
- package/server/erudit/language/list/en.ts +1 -0
- package/server/erudit/language/list/ru.ts +1 -0
- package/server/erudit/news/build.ts +6 -6
- package/server/erudit/news/repository/batch.ts +2 -2
- package/server/erudit/prose/repository/finalize.ts +22 -25
- package/server/erudit/prose/repository/get.ts +3 -5
- package/server/erudit/prose/repository/rawToProse.ts +31 -0
- package/server/erudit/prose/storage/callout.ts +9 -7
- package/server/erudit/prose/storage/image.ts +8 -11
- package/server/erudit/prose/storage/link.ts +24 -32
- package/server/erudit/prose/storage/problemScript.ts +8 -14
- package/server/erudit/prose/storage/video.ts +9 -7
- package/server/erudit/repository.ts +4 -4
- package/server/routes/file/[...path].ts +1 -1
- package/shared/types/contentChildren.ts +5 -2
- package/shared/types/contentConnections.ts +9 -0
- package/shared/types/elementSnippet.ts +1 -1
- package/shared/types/indexPage.ts +3 -0
- package/shared/types/language.ts +1 -83
- package/shared/types/mainContent.ts +11 -5
- package/shared/types/news.ts +2 -2
- package/shared/types/preview.ts +3 -2
- package/shared/types/runtimeConfig.ts +1 -0
- package/shared/types/search.ts +2 -0
- package/shared/utils/pages.ts +4 -2
- package/shared/utils/stringColor.ts +16 -6
- package/server/erudit/prose/repository/resolve.ts +0 -17
- package/server/erudit/prose/transform/bundleProblemScript.ts +0 -6
package/shared/types/language.ts
CHANGED
|
@@ -79,6 +79,7 @@ export type LanguagePhrases = Phrases<{
|
|
|
79
79
|
no_contribution: string;
|
|
80
80
|
editor: string;
|
|
81
81
|
materials: string;
|
|
82
|
+
updated: string;
|
|
82
83
|
x_sponsors: (count: number) => string;
|
|
83
84
|
x_contributors: (count: number) => string;
|
|
84
85
|
news: string;
|
|
@@ -99,89 +100,6 @@ export type LanguagePhrases = Phrases<{
|
|
|
99
100
|
default_index_title: string;
|
|
100
101
|
default_index_short: string;
|
|
101
102
|
default_site_info_short: string;
|
|
102
|
-
|
|
103
|
-
// _language_title: string;
|
|
104
|
-
// _language_code: string;
|
|
105
|
-
// site_info_title: string;
|
|
106
|
-
// site_info_slogan: string;
|
|
107
|
-
// seo_index_title: string;
|
|
108
|
-
// seo_index_description: string;
|
|
109
|
-
// seo_article_description: (contentTitle: string) => string;
|
|
110
|
-
// seo_summary_description: (contentTitle: string) => string;
|
|
111
|
-
// seo_practice_description: (contentTitle: string) => string;
|
|
112
|
-
// index: string;
|
|
113
|
-
// pages: string;
|
|
114
|
-
// search: string;
|
|
115
|
-
// language: string;
|
|
116
|
-
// other: string;
|
|
117
|
-
// ads_replacer: string;
|
|
118
|
-
// theme: string;
|
|
119
|
-
// theme_system: string;
|
|
120
|
-
// theme_light: string;
|
|
121
|
-
// theme_dark: string;
|
|
122
|
-
// content: string;
|
|
123
|
-
// main_page: string;
|
|
124
|
-
// contributors: string;
|
|
125
|
-
// contributors_page_description: string;
|
|
126
|
-
// contributors_page_invite: string;
|
|
127
|
-
// become_contributor: string;
|
|
128
|
-
// contributor: string;
|
|
129
|
-
// contribution: string;
|
|
130
|
-
// contributions_explain: (count: number) => string;
|
|
131
|
-
// contributor_description: (name: string) => string;
|
|
132
|
-
// editor: string;
|
|
133
|
-
// add_translation: string;
|
|
134
|
-
// empty_nav: string;
|
|
135
|
-
// flag_dev: string;
|
|
136
|
-
// flag_dev_description: string;
|
|
137
|
-
// flag_advanced: string;
|
|
138
|
-
// flag_advanced_description: string;
|
|
139
|
-
// flag_secondary: string;
|
|
140
|
-
// flag_secondary_description: string;
|
|
141
|
-
// popover_dependencies: string;
|
|
142
|
-
// popover_dependencies_description: string;
|
|
143
|
-
// close: string;
|
|
144
|
-
// back: string;
|
|
145
|
-
// goto: string;
|
|
146
|
-
// error: string;
|
|
147
|
-
// external_link: string;
|
|
148
|
-
// external_link_warn: string;
|
|
149
|
-
// internal_link: string;
|
|
150
|
-
// internal_link_warn: string;
|
|
151
|
-
// book: string;
|
|
152
|
-
// group: string;
|
|
153
|
-
// topic: string;
|
|
154
|
-
// topics: string;
|
|
155
|
-
// article: string;
|
|
156
|
-
// summary: string;
|
|
157
|
-
// practice: string;
|
|
158
|
-
// element_id: string;
|
|
159
|
-
// preview_missing_title: string;
|
|
160
|
-
// preview_missing_explain: string;
|
|
161
|
-
// preview_missing_explain_mismatch: string;
|
|
162
|
-
// preview_hash_mismatch_title: string;
|
|
163
|
-
// preview_hash_mismatch_explain: string;
|
|
164
|
-
// current_page_hash: string;
|
|
165
|
-
// expected_page_hash: string;
|
|
166
|
-
// empty_toc: string;
|
|
167
|
-
// no_contributors: string;
|
|
168
|
-
// make_contribution: string;
|
|
169
|
-
// material_improvement: string;
|
|
170
|
-
// how_to_improve: string;
|
|
171
|
-
// edit_page: string;
|
|
172
|
-
// report_problem: string;
|
|
173
|
-
// references: string;
|
|
174
|
-
// reference_source_featured: string;
|
|
175
|
-
// references_description: string;
|
|
176
|
-
// sponsors: string;
|
|
177
|
-
// sponsors_description: string;
|
|
178
|
-
// become_sponsor: string;
|
|
179
|
-
// toc: string;
|
|
180
|
-
// mentions: (conte: number) => string;
|
|
181
|
-
// start_learning: string;
|
|
182
|
-
// x_contributors: (count: number) => string;
|
|
183
|
-
// x_sponsors: (count: number) => string;
|
|
184
|
-
// show_all: string;
|
|
185
103
|
}>;
|
|
186
104
|
|
|
187
105
|
//
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProseWithStorage } from 'tsprose';
|
|
2
|
+
|
|
3
|
+
import type { ContentSeo } from '@erudit-js/core/content/seo';
|
|
2
4
|
import type { ContentType } from '@erudit-js/core/content/type';
|
|
3
5
|
import type { TopicPart } from '@erudit-js/core/content/topic';
|
|
4
6
|
import type { ContentFlags } from '@erudit-js/core/content/flags';
|
|
5
7
|
import type { ContentContribution } from '@erudit-js/core/content/contributions';
|
|
6
8
|
import type { ResolvedTocItem } from '@erudit-js/prose';
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
import type { Breadcrumbs } from './breadcrumbs';
|
|
11
|
+
import type { ContentStats } from './contentStats';
|
|
12
|
+
import type { ContentConnections } from './contentConnections';
|
|
13
|
+
import type { ElementSnippet } from './elementSnippet';
|
|
8
14
|
|
|
9
15
|
export interface MainContentBase {
|
|
10
16
|
type: ContentType;
|
|
@@ -28,7 +34,7 @@ export interface MainContentChildrenItem {
|
|
|
28
34
|
link: string;
|
|
29
35
|
title: string;
|
|
30
36
|
description?: string;
|
|
31
|
-
|
|
37
|
+
keyLinks?: ElementSnippet[];
|
|
32
38
|
stats?: ContentStats;
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -37,7 +43,7 @@ export interface MainContentChildrenItem {
|
|
|
37
43
|
//
|
|
38
44
|
|
|
39
45
|
export type MainContentTopicPart = MainContentBase &
|
|
40
|
-
|
|
46
|
+
ProseWithStorage & {
|
|
41
47
|
type: 'topic';
|
|
42
48
|
part: TopicPart;
|
|
43
49
|
parts: TopicPart[];
|
|
@@ -46,7 +52,7 @@ export type MainContentTopicPart = MainContentBase &
|
|
|
46
52
|
};
|
|
47
53
|
|
|
48
54
|
export type MainContentPage = MainContentBase &
|
|
49
|
-
|
|
55
|
+
ProseWithStorage & {
|
|
50
56
|
type: 'page';
|
|
51
57
|
snippets?: ElementSnippet[];
|
|
52
58
|
toc?: ResolvedTocItem[];
|
package/shared/types/news.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProseWithStorage } from 'tsprose';
|
|
2
2
|
|
|
3
3
|
export interface NewsBatch {
|
|
4
4
|
items: NewsItem[];
|
|
@@ -9,5 +9,5 @@ export interface NewsBatch {
|
|
|
9
9
|
|
|
10
10
|
export interface NewsItem {
|
|
11
11
|
date: string;
|
|
12
|
-
content:
|
|
12
|
+
content: ProseWithStorage;
|
|
13
13
|
}
|
package/shared/types/preview.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProseWithStorage } from 'tsprose';
|
|
2
|
+
|
|
2
3
|
import type { PreviewRequest } from '@erudit-js/core/preview/request';
|
|
3
4
|
import type { ContentType } from '@erudit-js/core/content/type';
|
|
4
5
|
|
|
@@ -25,4 +26,4 @@ export type PreviewContentUnique = {
|
|
|
25
26
|
elementTitle?: string;
|
|
26
27
|
schemaName: string;
|
|
27
28
|
fadeOverlay?: boolean;
|
|
28
|
-
} &
|
|
29
|
+
} & ProseWithStorage;
|
package/shared/types/search.ts
CHANGED
package/shared/utils/pages.ts
CHANGED
|
@@ -15,9 +15,11 @@ export const PAGES = {
|
|
|
15
15
|
return sn(`/group/${shortId}/`);
|
|
16
16
|
},
|
|
17
17
|
['page']: (shortId: string, elementId?: string) => {
|
|
18
|
-
return sn(`/page/${shortId}/${elementId ? '
|
|
18
|
+
return sn(`/page/${shortId}/${elementId ? '?element=' + elementId : ''}`);
|
|
19
19
|
},
|
|
20
20
|
['topic']: (part: TopicPart, shortId: string, elementId?: string) => {
|
|
21
|
-
return sn(
|
|
21
|
+
return sn(
|
|
22
|
+
`/${part}/${shortId}/${elementId ? '?element=' + elementId : ''}`,
|
|
23
|
+
);
|
|
22
24
|
},
|
|
23
25
|
};
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
export function stringColor(text: string) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// FNV-1a — >>> 0 after every step keeps values in unsigned 32-bit space
|
|
3
|
+
let hash = 0x811c9dc5 >>> 0;
|
|
4
4
|
for (let i = 0; i < text.length; i++) {
|
|
5
|
-
hash = text.charCodeAt(i)
|
|
5
|
+
hash = (hash ^ text.charCodeAt(i)) >>> 0;
|
|
6
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Wang hash finalizer — avalanche remaining bit clusters
|
|
10
|
+
hash = (hash ^ (hash >>> 16)) >>> 0;
|
|
11
|
+
hash = Math.imul(hash, 0x45d9f3b) >>> 0;
|
|
12
|
+
hash = (hash ^ (hash >>> 16)) >>> 0;
|
|
13
|
+
|
|
14
|
+
// Divide full uint32 range by 2^32 → uniform [0, 1) → full 360° hue wheel
|
|
15
|
+
const h = Math.floor((hash / 0x100000000) * 360);
|
|
16
|
+
// Use a non-overlapping slice of bits for saturation variance
|
|
17
|
+
const s = 55 + Math.floor(((hash >>> 22) / 0x400) * 20); // 55–74%
|
|
18
|
+
|
|
19
|
+
const lightColor = `hsl(${h}, 70%, 35%)`;
|
|
20
|
+
const darkColor = `hsl(${h}, 70%, 68%)`;
|
|
11
21
|
|
|
12
22
|
return `light-dark(${lightColor}, ${darkColor})`;
|
|
13
23
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AnySchema, RawElement } from '@jsprose/core';
|
|
2
|
-
import { resolveEruditRawElement, type ResolveStep } from '@erudit-js/prose';
|
|
3
|
-
|
|
4
|
-
export async function resolveEruditProse(
|
|
5
|
-
rawElement: RawElement<AnySchema>,
|
|
6
|
-
linkable: boolean,
|
|
7
|
-
step?: ResolveStep,
|
|
8
|
-
) {
|
|
9
|
-
return await resolveEruditRawElement({
|
|
10
|
-
context: {
|
|
11
|
-
language: ERUDIT.config.public.language.current,
|
|
12
|
-
linkable,
|
|
13
|
-
},
|
|
14
|
-
rawElement,
|
|
15
|
-
step,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export async function bundleProblemScript(problemId: string) {
|
|
2
|
-
// Создаем фейковый stdin для esbuild, в котором импортирует требуемый скрипт из файла, где он объявлен
|
|
3
|
-
// Так на выходе получим только бандл скрипта, без лишних зависимостей
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
// Функция для вызова ESBuild бандлера, чтобы собирать problem скрипты и прочее
|