@erudit-js/prose 4.0.0-dev.4 → 4.0.0-dev.5
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/dist/app/default/Inliners.vue +11 -11
- package/dist/app/default/Mix.vue +11 -11
- package/dist/app/default/Text.vue +25 -25
- package/dist/app/shared/Prose.vue +40 -40
- package/dist/app/shared/Render.vue +51 -51
- package/dist/app/shared/block/AsideMenu.vue +44 -44
- package/dist/app/shared/block/AsideMenuButton.vue +51 -53
- package/dist/app/shared/block/AsideMenuCopyLink.vue +40 -40
- package/dist/app/shared/block/AsideMenuSeparator.vue +3 -3
- package/dist/app/shared/block/Block.vue +270 -275
- package/dist/app/shared/inliner/Inliner.vue +11 -11
- package/dist/app/shared/photoswipe/style.css +22 -26
- package/dist/elements/accent/Accent.vue +88 -92
- package/dist/elements/accent/AccentColumnSection.vue +61 -61
- package/dist/elements/accent/AccentRowSections.vue +64 -65
- package/dist/elements/callout/Callout.vue +81 -85
- package/dist/elements/callout/_global.d.ts +15 -15
- package/dist/elements/caption/Caption.vue +44 -47
- package/dist/elements/caption/_global.d.ts +26 -26
- package/dist/elements/details/Details.vue +49 -50
- package/dist/elements/details/_global.d.ts +27 -27
- package/dist/elements/diagram/Diagram.vue +360 -374
- package/dist/elements/diagram/_global.d.ts +19 -19
- package/dist/elements/diagram/core.d.ts +0 -4
- package/dist/elements/diagram/core.js +1 -7
- package/dist/elements/emphasis/Emphasis.vue +25 -25
- package/dist/elements/emphasis/_global.d.ts +18 -18
- package/dist/elements/flex/Flex.vue +36 -38
- package/dist/elements/flex/_global.d.ts +23 -23
- package/dist/elements/gallery/Gallery.vue +56 -56
- package/dist/elements/gallery/_global.d.ts +18 -18
- package/dist/elements/heading/Heading.vue +44 -44
- package/dist/elements/heading/_global.d.ts +42 -45
- package/dist/elements/heading/core.js +7 -14
- package/dist/elements/horizontalLine/HorizontalLine.vue +6 -6
- package/dist/elements/horizontalLine/_global.d.ts +17 -17
- package/dist/elements/image/Image.vue +15 -15
- package/dist/elements/image/ImageElement.vue +80 -80
- package/dist/elements/image/_global.d.ts +18 -18
- package/dist/elements/lineBreak/LineBreak.vue +3 -3
- package/dist/elements/lineBreak/_global.d.ts +18 -18
- package/dist/elements/link/BlockLink.vue +108 -110
- package/dist/elements/link/Link.vue +92 -96
- package/dist/elements/link/dependency/_global.d.ts +47 -47
- package/dist/elements/link/reference/_global.d.ts +49 -49
- package/dist/elements/list/List.vue +58 -65
- package/dist/elements/list/_global.d.ts +50 -50
- package/dist/elements/math/_global.d.ts +72 -72
- package/dist/elements/math/_global.ts +3 -3
- package/dist/elements/math/components/BlockMath.vue +30 -30
- package/dist/elements/math/components/InlinerMath.vue +65 -65
- package/dist/elements/math/components/Katex.vue +88 -89
- package/dist/elements/math/components/MathGroup.vue +41 -41
- package/dist/elements/math/katex.js +17 -6
- package/dist/elements/paragraph/Paragraph.vue +25 -27
- package/dist/elements/paragraph/_global.d.ts +27 -27
- package/dist/elements/problem/_global.d.ts +112 -112
- package/dist/elements/problem/components/Problem.vue +22 -22
- package/dist/elements/problem/components/ProblemButton.vue +20 -21
- package/dist/elements/problem/components/ProblemContainer.vue +8 -8
- package/dist/elements/problem/components/ProblemContent.vue +356 -371
- package/dist/elements/problem/components/ProblemExpander.vue +7 -7
- package/dist/elements/problem/components/ProblemExpanderSection.vue +57 -57
- package/dist/elements/problem/components/ProblemHeader.vue +100 -102
- package/dist/elements/problem/components/Problems.vue +83 -87
- package/dist/elements/problem/components/SubProblem.vue +14 -14
- package/dist/elements/problem/components/expanders/Check.vue +153 -150
- package/dist/elements/problem/components/expanders/Checks.vue +146 -83
- package/dist/elements/problem/components/expanders/DefaultPlusSections.vue +38 -38
- package/dist/elements/problem/components/expanders/Hint.vue +26 -26
- package/dist/elements/problem/core.d.ts +23 -23
- package/dist/elements/problem/problemContent.d.ts +134 -30
- package/dist/elements/problem/problemContent.js +157 -197
- package/dist/elements/problem/problemScript.d.ts +2 -2
- package/dist/elements/problem/problemScript.js +2 -2
- package/dist/elements/problem/rng.d.ts +1 -1
- package/dist/elements/problem/rng.js +1 -1
- package/dist/elements/table/Table.vue +100 -102
- package/dist/elements/table/_global.d.ts +36 -36
- package/dist/elements/video/Video.vue +110 -109
- package/dist/elements/video/_global.d.ts +18 -18
- package/package.json +42 -43
- package/types.d.ts +4 -4
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { onMounted, useTemplateRef } from 'vue';
|
|
3
|
-
import { isProseElement, type ProseElement } from '@jsprose/core';
|
|
4
|
-
|
|
5
|
-
import { captionSecondarySchema, type captionSchema } from './core.js';
|
|
6
|
-
import Render from '../../app/shared/Render.vue';
|
|
7
|
-
|
|
8
|
-
const { caption } = defineProps<{
|
|
9
|
-
|
|
10
|
-
}>();
|
|
11
|
-
|
|
12
|
-
const emit = defineEmits(['captionMounted']);
|
|
13
|
-
|
|
14
|
-
const captionElement = useTemplateRef('caption');
|
|
15
|
-
|
|
16
|
-
const captionSecondary = caption.children.find((child) =>
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
const mainInliners = caption.children.filter(
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
const width = caption.data?.width ? `min(${caption.data.width}, 100%)` : '';
|
|
24
|
-
|
|
25
|
-
onMounted(() => {
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onMounted, useTemplateRef } from 'vue';
|
|
3
|
+
import { isProseElement, type ProseElement } from '@jsprose/core';
|
|
4
|
+
|
|
5
|
+
import { captionSecondarySchema, type captionSchema } from './core.js';
|
|
6
|
+
import Render from '../../app/shared/Render.vue';
|
|
7
|
+
|
|
8
|
+
const { caption } = defineProps<{
|
|
9
|
+
caption: ProseElement<typeof captionSchema>;
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits(['captionMounted']);
|
|
13
|
+
|
|
14
|
+
const captionElement = useTemplateRef('caption');
|
|
15
|
+
|
|
16
|
+
const captionSecondary = caption.children.find((child) =>
|
|
17
|
+
isProseElement(child, captionSecondarySchema),
|
|
18
|
+
);
|
|
19
|
+
const mainInliners = caption.children.filter(
|
|
20
|
+
(child) => child !== captionSecondary,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const width = caption.data?.width ? `min(${caption.data.width}, 100%)` : '';
|
|
24
|
+
|
|
25
|
+
onMounted(() => {
|
|
26
|
+
emit('captionMounted', captionElement.value);
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div
|
|
32
|
+
ref="caption"
|
|
33
|
+
class="**:text-text-muted text-main-sm mt-small micro:mt-normal m-auto
|
|
34
|
+
text-center"
|
|
35
|
+
v-bind="width ? { style: { width } } : {}"
|
|
36
|
+
>
|
|
37
|
+
<div class="font-semibold">
|
|
38
|
+
<Render v-for="child of mainInliners" :element="child" />
|
|
39
|
+
</div>
|
|
40
|
+
<div v-if="captionSecondary">
|
|
41
|
+
<Render v-for="child of captionSecondary.children" :element="child" />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Captions are used to provide descriptive text for images, videos, and other media elements.
|
|
3
|
-
* They can contain content (which is treated as the main caption) and an optional secondary caption for additional context.
|
|
4
|
-
*
|
|
5
|
-
* @title Caption
|
|
6
|
-
* @layout inliner
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* <Image src={triangleA}>
|
|
10
|
-
* <Caption width="300px">
|
|
11
|
-
* A right-angled triangle with sides <M>A</M>, <M>B</M> and hypotenuse <M>C</M>.
|
|
12
|
-
* </Caption>
|
|
13
|
-
* </Image>
|
|
14
|
-
*
|
|
15
|
-
* <Video src={lawOfSines}>
|
|
16
|
-
* <Caption>
|
|
17
|
-
* Law of sines explanation.
|
|
18
|
-
* <CaptionSecondary>
|
|
19
|
-
* Pay attention to the angle notation!
|
|
20
|
-
* </CaptionSecondary>
|
|
21
|
-
* </Caption>
|
|
22
|
-
* </Video>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export const Caption = '_tag_';
|
|
26
|
-
export const CaptionSecondary = '_tag_';
|
|
1
|
+
/**
|
|
2
|
+
* Captions are used to provide descriptive text for images, videos, and other media elements.
|
|
3
|
+
* They can contain content (which is treated as the main caption) and an optional secondary caption for additional context.
|
|
4
|
+
*
|
|
5
|
+
* @title Caption
|
|
6
|
+
* @layout inliner
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Image src={triangleA}>
|
|
10
|
+
* <Caption width="300px">
|
|
11
|
+
* A right-angled triangle with sides <M>A</M>, <M>B</M> and hypotenuse <M>C</M>.
|
|
12
|
+
* </Caption>
|
|
13
|
+
* </Image>
|
|
14
|
+
*
|
|
15
|
+
* <Video src={lawOfSines}>
|
|
16
|
+
* <Caption>
|
|
17
|
+
* Law of sines explanation.
|
|
18
|
+
* <CaptionSecondary>
|
|
19
|
+
* Pay attention to the angle notation!
|
|
20
|
+
* </CaptionSecondary>
|
|
21
|
+
* </Caption>
|
|
22
|
+
* </Video>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const Caption = '_tag_';
|
|
26
|
+
export const CaptionSecondary = '_tag_';
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { ProseElement } from '@jsprose/core';
|
|
3
|
-
|
|
4
|
-
import type { detailsSchema } from './core.js';
|
|
5
|
-
import { useFormatText } from '../../app/composables/formatText.js';
|
|
6
|
-
import { useProseContext } from '../../app/composables/context.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from '../../app/composables/anchor.js';
|
|
11
|
-
import { useElementIcon } from '../../app/composables/elementIcon.js';
|
|
12
|
-
import { useElementPhrase } from '../../app/composables/language.js';
|
|
13
|
-
import Block from '../../app/shared/block/Block.vue';
|
|
14
|
-
import Render from '../../app/shared/Render.vue';
|
|
15
|
-
|
|
16
|
-
const { element } = defineProps<{
|
|
17
|
-
|
|
18
|
-
}>();
|
|
19
|
-
|
|
20
|
-
const { EruditIcon } = useProseContext();
|
|
21
|
-
const formatText = useFormatText();
|
|
22
|
-
const icon = await useElementIcon(element);
|
|
23
|
-
const phrase = await useElementPhrase(element);
|
|
24
|
-
const { mode } = useProseContext();
|
|
25
|
-
const isAnchor = useIsAnchor(element);
|
|
26
|
-
const containsAnchor = useContainsAnchor(element);
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { ProseElement } from '@jsprose/core';
|
|
3
|
+
|
|
4
|
+
import type { detailsSchema } from './core.js';
|
|
5
|
+
import { useFormatText } from '../../app/composables/formatText.js';
|
|
6
|
+
import { useProseContext } from '../../app/composables/context.js';
|
|
7
|
+
import {
|
|
8
|
+
useIsAnchor,
|
|
9
|
+
useContainsAnchor,
|
|
10
|
+
} from '../../app/composables/anchor.js';
|
|
11
|
+
import { useElementIcon } from '../../app/composables/elementIcon.js';
|
|
12
|
+
import { useElementPhrase } from '../../app/composables/language.js';
|
|
13
|
+
import Block from '../../app/shared/block/Block.vue';
|
|
14
|
+
import Render from '../../app/shared/Render.vue';
|
|
15
|
+
|
|
16
|
+
const { element } = defineProps<{
|
|
17
|
+
element: ProseElement<typeof detailsSchema>;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
const { EruditIcon } = useProseContext();
|
|
21
|
+
const formatText = useFormatText();
|
|
22
|
+
const icon = await useElementIcon(element);
|
|
23
|
+
const phrase = await useElementPhrase(element);
|
|
24
|
+
const { mode } = useProseContext();
|
|
25
|
+
const isAnchor = useIsAnchor(element);
|
|
26
|
+
const containsAnchor = useContainsAnchor(element);
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<Block :element v-if="isAnchor || containsAnchor || mode !== 'static'">
|
|
31
|
+
<div
|
|
32
|
+
class="border-border bg-bg-accent/30 rounded-xl border-2 border-dashed
|
|
33
|
+
dark:border-white/30 dark:bg-white/5"
|
|
34
|
+
>
|
|
35
|
+
<div class="text-text-muted p-(--proseAsideWidth) font-medium">
|
|
36
|
+
<EruditIcon
|
|
37
|
+
:name="icon"
|
|
38
|
+
class="text-main-sm mr-small relative top-0.5 inline align-baseline"
|
|
39
|
+
/>
|
|
40
|
+
<span>
|
|
41
|
+
{{ formatText(element.data.title || phrase.element_name) }}
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="pb-(--proseAsideWidth)">
|
|
45
|
+
<Render v-for="child in element.children" :element="child" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</Block>
|
|
49
|
+
</template>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Details are used to hide additional explanations or secondary content.
|
|
3
|
-
* Default title "Details" can be changed via `title` prop.
|
|
4
|
-
*
|
|
5
|
-
* Clicking on a link to the details block will show it in preview area.
|
|
6
|
-
* That is why **all** details blocks **have to be unique elements**!
|
|
7
|
-
* You can not create details block without unique attached to it.
|
|
8
|
-
*
|
|
9
|
-
* Opening a link to the details block in new tab will make it visible inside main prose content.
|
|
10
|
-
* Because of this you should place them near the link pointing to them to keep context.
|
|
11
|
-
*
|
|
12
|
-
* Details blocks can't be added to Table of Contents and can't have snippets.
|
|
13
|
-
*
|
|
14
|
-
* @title Details
|
|
15
|
-
* @layout block
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <P>
|
|
19
|
-
* The number 4 is even, which is <A to={{uniques.whyEven}}>obvious</A>.
|
|
20
|
-
* </P>
|
|
21
|
-
*
|
|
22
|
-
* <Details $={{uniques.whyEven}} title="Why is 4 even?">
|
|
23
|
-
* <P>Because it is divisible by 2 without a remainder.</P>
|
|
24
|
-
* </Details>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export const Details = '_tag_';
|
|
1
|
+
/**
|
|
2
|
+
* Details are used to hide additional explanations or secondary content.
|
|
3
|
+
* Default title "Details" can be changed via `title` prop.
|
|
4
|
+
*
|
|
5
|
+
* Clicking on a link to the details block will show it in preview area.
|
|
6
|
+
* That is why **all** details blocks **have to be unique elements**!
|
|
7
|
+
* You can not create details block without unique attached to it.
|
|
8
|
+
*
|
|
9
|
+
* Opening a link to the details block in new tab will make it visible inside main prose content.
|
|
10
|
+
* Because of this you should place them near the link pointing to them to keep context.
|
|
11
|
+
*
|
|
12
|
+
* Details blocks can't be added to Table of Contents and can't have snippets.
|
|
13
|
+
*
|
|
14
|
+
* @title Details
|
|
15
|
+
* @layout block
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <P>
|
|
19
|
+
* The number 4 is even, which is <A to={{uniques.whyEven}}>obvious</A>.
|
|
20
|
+
* </P>
|
|
21
|
+
*
|
|
22
|
+
* <Details $={{uniques.whyEven}} title="Why is 4 even?">
|
|
23
|
+
* <P>Because it is divisible by 2 without a remainder.</P>
|
|
24
|
+
* </Details>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const Details = '_tag_';
|