erudit 3.0.0-dev.5 → 3.0.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/app.vue +1 -1
- package/app/components/SiteMain.vue +2 -3
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +1 -1
- package/app/components/aside/minor/topic/TopicNav.vue +1 -1
- package/app/components/aside/minor/topic/TopicToc.vue +1 -1
- package/app/components/bitran/BitranContent.vue +10 -3
- package/app/components/main/topic/MainTopic.vue +1 -2
- package/app/components/main/topic/TopicPartSwitch.vue +1 -1
- package/app/components/main/utils/Breadcrumb.vue +1 -6
- package/app/components/main/utils/ContentPopovers.vue +12 -6
- package/app/components/preview/display/Unique.vue +7 -1
- package/app/composables/bitran.ts +37 -33
- package/app/composables/bitranContent.ts +16 -4
- package/app/composables/bitranLocation.ts +1 -1
- package/app/composables/contentRoute.ts +1 -1
- package/app/composables/externalApi.ts +1 -1
- package/app/pages/group/[...groupId].vue +3 -4
- package/app/public/favicon/article.svg +9 -9
- package/app/scripts/flag.ts +1 -1
- package/app/scripts/preview/data/unique.ts +6 -5
- package/bin/erudit.mjs +2 -0
- package/globalPath.ts +1 -1
- package/globals/bitran.ts +1 -1
- package/globals/content.ts +1 -1
- package/globals/contributor.ts +1 -1
- package/globals/erudit.ts +1 -1
- package/module/bitran.ts +2 -2
- package/module/config.ts +2 -2
- package/module/index.ts +4 -5
- package/module/logger.ts +1 -1
- package/nuxt.config.ts +1 -40
- package/package.json +14 -7
- package/server/api/aside/major/nav/global.ts +1 -1
- package/server/api/aside/minor/path.ts +1 -2
- package/server/api/preview/page/[...parts].ts +3 -2
- package/server/api/preview/unique/[location].ts +6 -3
- package/server/plugin/bitran/content.ts +49 -42
- package/server/plugin/bitran/location.ts +1 -1
- package/server/plugin/bitran/products/include.ts +13 -15
- package/server/plugin/bitran/products/link.ts +12 -12
- package/server/plugin/bitran/toc.ts +21 -29
- package/server/plugin/bitran/transpiler.ts +15 -19
- package/server/plugin/build/jobs/content/generic.ts +2 -2
- package/server/plugin/build/jobs/content/parse.ts +19 -10
- package/server/plugin/build/jobs/content/type/group.ts +1 -1
- package/server/plugin/build/jobs/content/type/topic.ts +1 -1
- package/server/plugin/build/jobs/contributors.ts +2 -2
- package/server/plugin/build/jobs/nav.ts +6 -2
- package/server/plugin/build/setup.ts +1 -0
- package/server/plugin/content/absoluteId.ts +2 -2
- package/server/plugin/content/context.ts +6 -2
- package/server/plugin/db/entities/Content.ts +1 -1
- package/server/plugin/db/entities/Group.ts +1 -1
- package/server/plugin/db/entities/Topic.ts +1 -1
- package/server/plugin/global.ts +1 -1
- package/server/plugin/logger.ts +1 -1
- package/server/plugin/nav/node.ts +1 -1
- package/server/plugin/repository/content.ts +1 -1
- package/server/plugin/repository/topic.ts +1 -1
- package/shared/aside/minor.ts +2 -1
- package/shared/bitran/stringContent.ts +6 -0
- package/shared/content/data/base.ts +1 -1
- package/shared/content/data/type/topic.ts +1 -1
- package/shared/frontNav.ts +1 -1
- package/shared/icons.ts +2 -2
- package/shared/link.ts +5 -2
- package/tsconfig.json +1 -1
- package/shared/bitran/context.ts +0 -8
- package/shared/bitran/default.ts +0 -46
- package/shared/bitran/link/Link.vue +0 -166
- package/shared/bitran/link/factory.ts +0 -24
- package/shared/bitran/link/icon.svg +0 -3
- package/shared/bitran/link/languages/en.ts +0 -7
- package/shared/bitran/link/languages/ru.ts +0 -7
- package/shared/bitran/link/renderer.ts +0 -21
- package/shared/bitran/link/shared.ts +0 -17
- package/shared/bitran/link/target.ts +0 -134
- package/shared/bitran/link/transpiler.ts +0 -10
- package/shared/bitran/location.ts +0 -166
- package/test/bitran/link/target.test.ts +0 -141
- package/test/bitran/location.test.ts +0 -143
package/app/app.vue
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
<style lang="scss" module>
|
|
13
13
|
@use '$/def/bp';
|
|
14
|
-
@use '@bitran-js/renderer-vue/scss/def' as bitranDef;
|
|
15
14
|
|
|
16
15
|
.main {
|
|
17
16
|
--_pMainBase: var(--gapBig);
|
|
@@ -24,8 +23,8 @@
|
|
|
24
23
|
font-size: 18px;
|
|
25
24
|
|
|
26
25
|
@include bp.below('mobile') {
|
|
27
|
-
--_pMainBase:
|
|
28
|
-
font-size:
|
|
26
|
+
--_pMainBase: var(--_bitran_asideWidth);
|
|
27
|
+
font-size: 14px;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
.mainInner {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { topicParts, type TopicPart } from 'erudit-cog/schema';
|
|
2
|
+
import { topicParts, type TopicPart } from '@erudit-js/cog/schema';
|
|
3
3
|
|
|
4
4
|
import { injectAsideData } from '@app/scripts/aside/minor/state';
|
|
5
5
|
import type { AsideMinorTopic } from '@shared/aside/minor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { headingName } from '@erudit-js/bitran-elements/heading/shared';
|
|
3
3
|
|
|
4
|
-
import { stringifyBitranLocation } from '@
|
|
4
|
+
import { stringifyBitranLocation } from '@erudit-js/cog/schema';
|
|
5
5
|
import type { TocItem } from '@erudit/shared/bitran/toc';
|
|
6
6
|
import { topicLocation } from '@app/scripts/aside/minor/topic';
|
|
7
7
|
import { injectAsideData } from '@app/scripts/aside/minor/state';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { Bitran, type BitranContent } from '@bitran-js/renderer-vue';
|
|
3
|
+
import type { BitranContext } from '@erudit-js/cog/schema';
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
+
import eruditConfig from '#erudit/config';
|
|
5
6
|
|
|
6
7
|
import RenderWrapper from './RenderWrapper.vue';
|
|
7
8
|
|
|
@@ -36,15 +37,16 @@ const isServer = import.meta.server;
|
|
|
36
37
|
:RenderWrapper
|
|
37
38
|
:isDev
|
|
38
39
|
:isServer
|
|
40
|
+
:language="eruditConfig.language"
|
|
39
41
|
/>
|
|
40
42
|
</template>
|
|
41
43
|
|
|
42
44
|
<style lang="scss" module>
|
|
43
|
-
@use '
|
|
45
|
+
@use '$/def/bp';
|
|
44
46
|
|
|
45
47
|
.eruditBitranContainer {
|
|
46
48
|
padding: var(--_pMainY) var(--_pMainX);
|
|
47
|
-
padding-left: calc(var(--_pMainX) -
|
|
49
|
+
padding-left: calc(var(--_pMainX) - var(--_bitran_asideWidth));
|
|
48
50
|
|
|
49
51
|
// Setting up Bitran
|
|
50
52
|
|
|
@@ -64,7 +66,12 @@ const isServer = import.meta.server;
|
|
|
64
66
|
--bitran_textMuted: var(--textMuted);
|
|
65
67
|
--bitran_textDimmed: var(--textDimmed);
|
|
66
68
|
--bitran_textDisabled: var(--textDisabled);
|
|
69
|
+
--bitran_textDeep: var(--textDeep);
|
|
67
70
|
|
|
68
71
|
--bitran_colorBrand: var(--brand);
|
|
72
|
+
|
|
73
|
+
@include bp.below('mobile') {
|
|
74
|
+
--bitran_gapBlocks: calc(22px);
|
|
75
|
+
}
|
|
69
76
|
}
|
|
70
77
|
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type
|
|
3
|
-
import { NO_ALIASES } from '@erudit-js/bitran-elements/aliases/shared';
|
|
2
|
+
import { NO_ALIASES, type TopicPart } from '@erudit-js/cog/schema';
|
|
4
3
|
|
|
5
4
|
import eruditConfig from '#erudit/config';
|
|
6
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { topicParts, type TopicPart } from 'erudit-cog/schema';
|
|
2
|
+
import { topicParts, type TopicPart } from '@erudit-js/cog/schema';
|
|
3
3
|
|
|
4
4
|
import type { TopicPartLinks } from '@erudit/shared/content/data/type/topic';
|
|
5
5
|
import { TOPIC_PART_ICON } from '@erudit/shared/icons';
|
|
@@ -56,18 +56,13 @@ function getIcon(contextIcon: string) {
|
|
|
56
56
|
|
|
57
57
|
@include transition(color);
|
|
58
58
|
|
|
59
|
-
// [my-icon]
|
|
60
|
-
// {
|
|
61
|
-
// position: relative;
|
|
62
|
-
// top: .6px;
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
59
|
&:hover {
|
|
66
60
|
color: var(--textMuted);
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
.sep {
|
|
65
|
+
flex-shrink: 0;
|
|
71
66
|
position: relative;
|
|
72
67
|
top: 0.5px;
|
|
73
68
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { ContentFlag } from 'erudit-cog/schema';
|
|
2
|
+
import type { ContentFlag } from '@erudit-js/cog/schema';
|
|
3
3
|
|
|
4
4
|
import type { ContentGenericData } from '@shared/content/data/base';
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ const phrase = await usePhrases(
|
|
|
24
24
|
|
|
25
25
|
const flagData: Record<ContentFlag, PopoverData> = {
|
|
26
26
|
dev: {
|
|
27
|
-
icon: <MyIconName>'
|
|
27
|
+
icon: <MyIconName>'construction',
|
|
28
28
|
color: 'var(--warn)',
|
|
29
29
|
title: phrase.flag_dev,
|
|
30
30
|
description: phrase.flag_dev_description,
|
|
@@ -70,6 +70,7 @@ const hasPopovers = computed(() => {
|
|
|
70
70
|
<ContentPopover v-if="generic?.dependencies" :data="dependenciesData">
|
|
71
71
|
<ul :class="$style.dependenciesList">
|
|
72
72
|
<li v-for="(value, key) in generic.dependencies">
|
|
73
|
+
<MyIcon :name="'arrow-left'" wrapper="span" />
|
|
73
74
|
<NuxtLink :prefetch="false" :to="key">{{ value }}</NuxtLink>
|
|
74
75
|
</li>
|
|
75
76
|
</ul>
|
|
@@ -87,18 +88,23 @@ const hasPopovers = computed(() => {
|
|
|
87
88
|
|
|
88
89
|
.dependenciesList {
|
|
89
90
|
margin-top: var(--gapSmall);
|
|
90
|
-
list-style-type:
|
|
91
|
+
list-style-type: none;
|
|
91
92
|
list-style-position: inside;
|
|
92
93
|
padding-inline-start: 0;
|
|
93
94
|
|
|
94
95
|
li {
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
display: flex;
|
|
97
|
+
gap: var(--gapSmall);
|
|
98
|
+
align-items: center;
|
|
99
|
+
|
|
100
|
+
[my-icon] {
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
font-size: 0.95em;
|
|
103
|
+
transform: scaleX(-1);
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
a {
|
|
100
107
|
color: inherit;
|
|
101
|
-
padding-left: var(--gapSmall);
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
110
|
}
|
|
@@ -5,6 +5,9 @@ import type { PreviewDataUnique } from '@app/scripts/preview/data/unique';
|
|
|
5
5
|
import type { PreviewDisplayProps } from '@app/scripts/preview/display';
|
|
6
6
|
|
|
7
7
|
const { data } = defineProps<PreviewDisplayProps<PreviewDataUnique>>();
|
|
8
|
+
|
|
9
|
+
const bitranTranspiler = await useBitranTranspiler();
|
|
10
|
+
const root = await bitranTranspiler.parser.parse(data.bitran.content.biCode);
|
|
8
11
|
</script>
|
|
9
12
|
|
|
10
13
|
<template>
|
|
@@ -16,7 +19,10 @@ const { data } = defineProps<PreviewDisplayProps<PreviewDataUnique>>();
|
|
|
16
19
|
]"
|
|
17
20
|
>
|
|
18
21
|
<BitranContent
|
|
19
|
-
:content="
|
|
22
|
+
:content="{
|
|
23
|
+
root,
|
|
24
|
+
preRenderData: data.bitran.content.preRenderData,
|
|
25
|
+
}"
|
|
20
26
|
:context="data.bitran.context"
|
|
21
27
|
/>
|
|
22
28
|
</div>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import eruditConfig from '#erudit/config';
|
|
2
|
-
import bitranConfig from '#erudit/client/bitran';
|
|
3
|
-
|
|
4
1
|
import {
|
|
5
2
|
createPhraseCaller,
|
|
6
|
-
getDefaultRenderers,
|
|
3
|
+
getDefaultRenderers as getDefaultBitranRenderers,
|
|
7
4
|
getElementIcon,
|
|
8
5
|
type ElementVueRenderers,
|
|
9
6
|
} from '@bitran-js/renderer-vue';
|
|
@@ -12,22 +9,23 @@ import {
|
|
|
12
9
|
type BitranTranspiler,
|
|
13
10
|
type ElementTranspilers,
|
|
14
11
|
} from '@bitran-js/transpiler';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { includeTranspiler } from '@erudit-js/bitran-elements/include/transpiler';
|
|
21
|
-
import { linkName } from '@erudit/shared/bitran/link/shared';
|
|
22
|
-
import { linkTranspiler } from '@erudit/shared/bitran/link/transpiler';
|
|
23
|
-
import { aliasesRenderer } from '@erudit-js/bitran-elements/aliases/renderer';
|
|
24
|
-
import { headingRenderer } from '@erudit-js/bitran-elements/heading/renderer';
|
|
25
|
-
import { includeRenderer } from '@erudit-js/bitran-elements/include/renderer';
|
|
26
|
-
import { linkRenderer } from '@erudit/shared/bitran/link/renderer';
|
|
12
|
+
import type { BitranElements } from '@erudit-js/cog/schema';
|
|
13
|
+
import { eruditDefaultElements } from '@erudit-js/bitran-elements/default';
|
|
14
|
+
|
|
15
|
+
import eruditConfig from '#erudit/config';
|
|
16
|
+
import bitranConfig from '#erudit/client/bitran';
|
|
27
17
|
|
|
18
|
+
let defaultElements!: BitranElements;
|
|
28
19
|
let bitranTranspiler!: BitranTranspiler;
|
|
29
20
|
let bitranRenderers!: ElementVueRenderers;
|
|
30
21
|
|
|
22
|
+
globalThis.useEruditConfig = () => eruditConfig;
|
|
23
|
+
|
|
24
|
+
export function getDefaultElements() {
|
|
25
|
+
if (!defaultElements) defaultElements = eruditDefaultElements();
|
|
26
|
+
return defaultElements;
|
|
27
|
+
}
|
|
28
|
+
|
|
31
29
|
//
|
|
32
30
|
// Transpiler
|
|
33
31
|
//
|
|
@@ -36,15 +34,7 @@ export async function useBitranTranspiler() {
|
|
|
36
34
|
if (bitranTranspiler) return bitranTranspiler;
|
|
37
35
|
|
|
38
36
|
const projectTranspilers = await getProjectTranspilers();
|
|
39
|
-
|
|
40
|
-
const defaultTranspilers = {
|
|
41
|
-
[aliasesName]: aliasesTranspiler,
|
|
42
|
-
[includeName]: includeTranspiler,
|
|
43
|
-
[headingName]: defineHeadingTranspiler({
|
|
44
|
-
language: eruditConfig?.language,
|
|
45
|
-
}),
|
|
46
|
-
[linkName]: linkTranspiler,
|
|
47
|
-
};
|
|
37
|
+
const defaultTranspilers = await getDefaultTranspilers();
|
|
48
38
|
|
|
49
39
|
bitranTranspiler = defineBitranTranspiler({
|
|
50
40
|
...projectTranspilers,
|
|
@@ -66,6 +56,16 @@ async function getProjectTranspilers(): Promise<ElementTranspilers> {
|
|
|
66
56
|
return projectTranspilers;
|
|
67
57
|
}
|
|
68
58
|
|
|
59
|
+
async function getDefaultTranspilers(): Promise<ElementTranspilers> {
|
|
60
|
+
const defaultElements = getDefaultElements();
|
|
61
|
+
const defaultTranspilers: ElementTranspilers = {};
|
|
62
|
+
|
|
63
|
+
for (const [name, bitranElement] of Object.entries(defaultElements))
|
|
64
|
+
defaultTranspilers[name] = await bitranElement.transpiler();
|
|
65
|
+
|
|
66
|
+
return defaultTranspilers;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
69
|
//
|
|
70
70
|
// Renderers
|
|
71
71
|
//
|
|
@@ -74,13 +74,7 @@ export async function useBitranRenderers() {
|
|
|
74
74
|
if (bitranRenderers) return bitranRenderers;
|
|
75
75
|
|
|
76
76
|
const projectRenderers = await getProjectRenderers();
|
|
77
|
-
|
|
78
|
-
const defaultRenderers = {
|
|
79
|
-
[aliasesName]: aliasesRenderer,
|
|
80
|
-
[includeName]: includeRenderer,
|
|
81
|
-
[headingName]: headingRenderer,
|
|
82
|
-
[linkName]: linkRenderer,
|
|
83
|
-
};
|
|
77
|
+
const defaultRenderers = await getDefaultRenderers();
|
|
84
78
|
|
|
85
79
|
// @ts-ignore
|
|
86
80
|
bitranRenderers = {
|
|
@@ -103,6 +97,16 @@ async function getProjectRenderers() {
|
|
|
103
97
|
return projectRenderers;
|
|
104
98
|
}
|
|
105
99
|
|
|
100
|
+
async function getDefaultRenderers() {
|
|
101
|
+
const defaultElements = getDefaultElements();
|
|
102
|
+
const defaultRenderers: ElementVueRenderers = {};
|
|
103
|
+
|
|
104
|
+
for (const [name, bitranElement] of Object.entries(defaultElements))
|
|
105
|
+
defaultRenderers[name] = await bitranElement.renderer();
|
|
106
|
+
|
|
107
|
+
return defaultRenderers;
|
|
108
|
+
}
|
|
109
|
+
|
|
106
110
|
//
|
|
107
111
|
// Utils
|
|
108
112
|
//
|
|
@@ -110,7 +114,7 @@ async function getProjectRenderers() {
|
|
|
110
114
|
export async function useBitranElementRenderer(productName: string) {
|
|
111
115
|
const renderer =
|
|
112
116
|
(await useBitranRenderers())[productName] ||
|
|
113
|
-
|
|
117
|
+
getDefaultBitranRenderers()[productName];
|
|
114
118
|
|
|
115
119
|
if (!renderer)
|
|
116
120
|
throw new Error(`Missing Bitran product render "${productName}"!`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ShallowRef } from 'vue';
|
|
2
2
|
import type { BitranContent } from '@bitran-js/renderer-vue';
|
|
3
|
-
|
|
4
3
|
import {
|
|
5
4
|
encodeBitranLocation,
|
|
6
5
|
stringifyBitranLocation,
|
|
7
6
|
type BitranLocation,
|
|
8
|
-
} from '@erudit/
|
|
7
|
+
} from '@erudit-js/cog/schema';
|
|
8
|
+
import type { StringBitranContent } from '@erudit/shared/bitran/stringContent';
|
|
9
9
|
|
|
10
10
|
export async function useBitranContent(
|
|
11
11
|
location: Ref<BitranLocation | undefined>,
|
|
@@ -26,11 +26,23 @@ export async function useBitranContent(
|
|
|
26
26
|
|
|
27
27
|
const apiRoute = `/api/bitran/content/${encodeBitranLocation(stringifyBitranLocation(location.value!))}`;
|
|
28
28
|
nuxtApp.runWithContext(() => prerenderRoutes(apiRoute));
|
|
29
|
+
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
contentPromise = (async () => {
|
|
31
|
-
|
|
32
|
+
const stringContent = (await $fetch(apiRoute, {
|
|
32
33
|
responseType: 'json',
|
|
33
|
-
})) as
|
|
34
|
+
})) as StringBitranContent;
|
|
35
|
+
|
|
36
|
+
const bitranTranspiler = await useBitranTranspiler();
|
|
37
|
+
const root = await bitranTranspiler.parser.parse(
|
|
38
|
+
stringContent.biCode,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
content.value = {
|
|
42
|
+
root,
|
|
43
|
+
preRenderData: stringContent.preRenderData,
|
|
44
|
+
};
|
|
45
|
+
|
|
34
46
|
return content;
|
|
35
47
|
})();
|
|
36
48
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { locationFromPath, type BitranLocation } from '@
|
|
1
|
+
import { locationFromPath, type BitranLocation } from '@erudit-js/cog/schema';
|
|
2
2
|
|
|
3
3
|
export function useBitranLocation(): ComputedRef<BitranLocation | undefined> {
|
|
4
4
|
const route = useRoute();
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { NO_ALIASES } from '@erudit-js/
|
|
3
|
-
|
|
4
|
-
import { type ContentGroupData } from '@shared/content/data/type/group';
|
|
2
|
+
import { NO_ALIASES } from '@erudit-js/cog/schema';
|
|
5
3
|
import eruditConfig from '#erudit/config';
|
|
6
4
|
|
|
5
|
+
import { type ContentGroupData } from '@shared/content/data/type/group';
|
|
6
|
+
import { locationIcon } from '@erudit/shared/icons';
|
|
7
7
|
import ContentDecoration from '@app/components/main/utils/ContentDecoration.vue';
|
|
8
8
|
import Breadcrumb from '@app/components/main/utils/Breadcrumb.vue';
|
|
9
9
|
import ContentTitle from '@app/components/main/utils/ContentTitle.vue';
|
|
10
10
|
import ContentDescription from '@app/components/main/utils/ContentDescription.vue';
|
|
11
11
|
import ContentPopovers from '@app/components/main/utils/ContentPopovers.vue';
|
|
12
12
|
import ContentSection from '@app/components/main/utils/ContentSection.vue';
|
|
13
|
-
import { locationIcon } from '@erudit/shared/icons';
|
|
14
13
|
|
|
15
14
|
const location = useBitranLocation();
|
|
16
15
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
-
<defs>
|
|
3
|
-
<linearGradient id="gradient" x1="75" y1="423" x2="437" y2="61" gradientUnits="userSpaceOnUse">
|
|
4
|
-
<stop offset="0" stop-color="#4aa44c"/>
|
|
5
|
-
<stop offset="1" stop-color="#1278b9"/>
|
|
6
|
-
</linearGradient>
|
|
7
|
-
</defs>
|
|
8
|
-
<circle fill="url(#gradient)" cx="256" cy="256" r="256"/>
|
|
9
|
-
<path fill="white" d="M372.4,179.3h-232.8c-6.6,0-12-5.4-12-12v-26.3c0-6.6,5.4-12,12-12h232.8c6.6,0,12,5.4,12,12v26.3c0,6.6-5.4,12-12,12ZM384.4,269.2v-26.3c0-6.6-5.4-12-12-12h-232.8c-6.6,0-12,5.4-12,12v26.3c0,6.6,5.4,12,12,12h232.8c6.6,0,12-5.4,12-12ZM384.4,371v-26.3c0-6.6-5.4-12-12-12h-232.8c-6.6,0-12,5.4-12,12v26.3c0,6.6,5.4,12,12,12h232.8c6.6,0,12-5.4,12-12Z"/>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="gradient" x1="75" y1="423" x2="437" y2="61" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop offset="0" stop-color="#4aa44c"/>
|
|
5
|
+
<stop offset="1" stop-color="#1278b9"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<circle fill="url(#gradient)" cx="256" cy="256" r="256"/>
|
|
9
|
+
<path fill="white" d="M372.4,179.3h-232.8c-6.6,0-12-5.4-12-12v-26.3c0-6.6,5.4-12,12-12h232.8c6.6,0,12,5.4,12,12v26.3c0,6.6-5.4,12-12,12ZM384.4,269.2v-26.3c0-6.6-5.4-12-12-12h-232.8c-6.6,0-12,5.4-12,12v26.3c0,6.6,5.4,12,12,12h232.8c6.6,0,12-5.4,12-12ZM384.4,371v-26.3c0-6.6-5.4-12-12-12h-232.8c-6.6,0-12,5.4-12,12v26.3c0,6.6,5.4,12,12,12h232.8c6.6,0,12-5.4,12-12Z"/>
|
|
10
10
|
</svg>
|
package/app/scripts/flag.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
encodeBitranLocation,
|
|
3
|
+
type BitranContext,
|
|
4
|
+
} from '@erudit-js/cog/schema';
|
|
4
5
|
|
|
5
6
|
import { PreviewDataType, type PreviewDataBase } from '../data';
|
|
6
7
|
import type { PreviewFooter } from '../footer';
|
|
7
8
|
import { PreviewRequestType, type PreviewRequest } from '../request';
|
|
8
|
-
import {
|
|
9
|
+
import type { StringBitranContent } from '@erudit/shared/bitran/stringContent';
|
|
9
10
|
|
|
10
11
|
export interface PreviewDataUnique extends PreviewDataBase {
|
|
11
12
|
type: PreviewDataType.Unique;
|
|
12
13
|
productName: string;
|
|
13
14
|
bitran: {
|
|
14
15
|
context: BitranContext;
|
|
15
|
-
content:
|
|
16
|
+
content: StringBitranContent;
|
|
16
17
|
};
|
|
17
18
|
footer: PreviewFooter;
|
|
18
19
|
}
|
package/bin/erudit.mjs
ADDED
package/globalPath.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import { resolvePaths } from 'erudit-cog/kit';
|
|
2
|
+
import { resolvePaths } from '@erudit-js/cog/kit';
|
|
3
3
|
|
|
4
4
|
export const ERUDIT_DIR = resolvePaths(fileURLToPath(import.meta.url), '..');
|
|
5
5
|
export const PROJECT_DIR = process.env.ERUDIT_PROJECT_DIR as string;
|
package/globals/bitran.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { defineBitranConfig, defineBitranElement } from 'erudit-cog/schema';
|
|
1
|
+
import { defineBitranConfig, defineBitranElement } from '@erudit-js/cog/schema';
|
|
2
2
|
export { defineBitranConfig, defineBitranElement };
|
package/globals/content.ts
CHANGED
package/globals/contributor.ts
CHANGED
package/globals/erudit.ts
CHANGED
package/module/bitran.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addTemplate } from 'nuxt/kit';
|
|
2
2
|
import type { Nuxt } from 'nuxt/schema';
|
|
3
|
-
import type { EruditBitranConfig } from 'erudit-cog/schema';
|
|
3
|
+
import type { EruditBitranConfig } from '@erudit-js/cog/schema';
|
|
4
4
|
|
|
5
5
|
import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
|
|
6
6
|
import { logger } from '@erudit/module/logger';
|
|
@@ -22,7 +22,7 @@ export async function setupBitranConfig(_nuxt: Nuxt) {
|
|
|
22
22
|
filename: templateFilename,
|
|
23
23
|
write: true,
|
|
24
24
|
getContents: () => `
|
|
25
|
-
import type { EruditBitranConfig } from 'erudit-cog/schema';
|
|
25
|
+
import type { EruditBitranConfig } from '@erudit-js/cog/schema';
|
|
26
26
|
${config ? `import bitranConfig from '${projectPath('bitran')}';` : ''}
|
|
27
27
|
export default ${config ? 'bitranConfig' : '{}'} as Partial<EruditBitranConfig>;
|
|
28
28
|
`,
|
package/module/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addTemplate } from 'nuxt/kit';
|
|
2
2
|
import type { Nuxt } from 'nuxt/schema';
|
|
3
|
-
import type { EruditConfig } from 'erudit-cog/schema';
|
|
3
|
+
import type { EruditConfig } from '@erudit-js/cog/schema';
|
|
4
4
|
|
|
5
5
|
import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
|
|
6
6
|
import { logger } from '@erudit/module/logger';
|
|
@@ -22,7 +22,7 @@ export async function setupEruditConfig(_nuxt: Nuxt) {
|
|
|
22
22
|
filename: templateFilename,
|
|
23
23
|
write: true,
|
|
24
24
|
getContents: () => `
|
|
25
|
-
import type { EruditConfig } from 'erudit-cog/schema';
|
|
25
|
+
import type { EruditConfig } from '@erudit-js/cog/schema';
|
|
26
26
|
export default ${JSON.stringify(config, null, ' ')} as Partial<EruditConfig>;
|
|
27
27
|
`,
|
|
28
28
|
});
|
package/module/index.ts
CHANGED
|
@@ -28,15 +28,14 @@ export default defineNuxtModule({
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
{
|
|
31
|
-
// Handle sub dependencies
|
|
32
|
-
const subDeps = eruditConfig.subDeps || [];
|
|
33
|
-
|
|
34
31
|
const transpile = (_nuxt.options.build.transpile ||= []);
|
|
35
32
|
const optimizeDeps = _nuxt.options.vite.optimizeDeps || {};
|
|
36
33
|
const optimizeDepsInclude = (optimizeDeps.include ||= []);
|
|
37
34
|
|
|
38
|
-
transpile.push(...
|
|
39
|
-
optimizeDepsInclude.push(
|
|
35
|
+
transpile.push(...(eruditConfig.nuxt?.transpile || []));
|
|
36
|
+
optimizeDepsInclude.push(
|
|
37
|
+
...(eruditConfig.nuxt?.optimizeDeps || []),
|
|
38
|
+
);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
// TODO: Watch for contributors folder and create/update template with their IDs
|
package/module/logger.ts
CHANGED
package/nuxt.config.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//import { elementPackages } from '@erudit-js/bitran-elements';
|
|
2
|
-
|
|
3
1
|
import { eruditPath, projectPath } from './globalPath';
|
|
4
2
|
|
|
5
3
|
export default defineNuxtConfig({
|
|
@@ -24,29 +22,11 @@ export default defineNuxtConfig({
|
|
|
24
22
|
include: [eruditPath('**/*'), projectPath('**/*')],
|
|
25
23
|
},
|
|
26
24
|
},
|
|
27
|
-
// modulesDir: [
|
|
28
|
-
// 'D:/code/erudit-js/erudit/node_modules',
|
|
29
|
-
// 'D:/code/erudit-js/bitran-elements/node_modules',
|
|
30
|
-
// ],
|
|
31
25
|
build: {
|
|
32
26
|
transpile: [
|
|
33
27
|
'yaml',
|
|
34
28
|
'@bitran-js/renderer-vue',
|
|
35
29
|
'@erudit-js/bitran-elements',
|
|
36
|
-
// '@bitran-js/renderer-vue',
|
|
37
|
-
// // '@erudit-js/bitran-elements',
|
|
38
|
-
// // '@erudit-js/bitran-elements/heading/renderer',
|
|
39
|
-
// 'yaml',
|
|
40
|
-
//...elementPackages,
|
|
41
|
-
// (ctx) => (ctx.isClient ? 'slugify' : false),
|
|
42
|
-
// 'katex',
|
|
43
|
-
// '@bitran-js/core',
|
|
44
|
-
// '@bitran-js/transpiler',
|
|
45
|
-
// '@bitran-js/renderer-vue',
|
|
46
|
-
// '@erudit-js/bitran-elements',
|
|
47
|
-
// '@erudit-js/bitran-elements/heading/shared',
|
|
48
|
-
// '@erudit-js/bitran-elements/heading/transpiler',
|
|
49
|
-
// '@erudit-js/bitran-elements/heading/renderer',
|
|
50
30
|
],
|
|
51
31
|
},
|
|
52
32
|
ignore: [
|
|
@@ -104,26 +84,7 @@ export default defineNuxtConfig({
|
|
|
104
84
|
vite: {
|
|
105
85
|
optimizeDeps: {
|
|
106
86
|
noDiscovery: true,
|
|
107
|
-
include: [
|
|
108
|
-
'yaml',
|
|
109
|
-
'@floating-ui/vue',
|
|
110
|
-
// '@bitran-js/core',
|
|
111
|
-
// '@bitran-js/transpiler',
|
|
112
|
-
// // '@bitran-js/renderer-vue',
|
|
113
|
-
// // '@erudit-js/bitran-elements',
|
|
114
|
-
// 'gradient-string',
|
|
115
|
-
// '@floating-ui/vue',
|
|
116
|
-
// 'yaml',
|
|
117
|
-
// //
|
|
118
|
-
//...elementPackages,
|
|
119
|
-
// '@bitran-js/core',
|
|
120
|
-
// '@bitran-js/transpiler',
|
|
121
|
-
// '@bitran-js/renderer-vue',
|
|
122
|
-
// '@erudit-js/bitran-elements',
|
|
123
|
-
// '@erudit-js/bitran-elements/heading/shared',
|
|
124
|
-
// '@erudit-js/bitran-elements/heading/transpiler',
|
|
125
|
-
// '@erudit-js/bitran-elements/heading/renderer',
|
|
126
|
-
],
|
|
87
|
+
include: ['yaml', '@floating-ui/vue'],
|
|
127
88
|
},
|
|
128
89
|
server: { fs: { strict: false } },
|
|
129
90
|
css: {
|