@erudit-js/prose 3.0.0-dev.30 → 4.0.0-dev.2
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/composables/context.d.ts +2 -1
- package/dist/app/composables/formatText.d.ts +5 -1
- package/dist/app/composables/formatText.js +5 -0
- package/dist/app/default/Text.vue +6 -2
- package/dist/app/shared/Prose.vue +4 -0
- package/dist/app/shared/block/Block.vue +5 -0
- package/dist/app/shared/invert.d.ts +2 -2
- package/dist/app/shared/invert.js +2 -2
- package/dist/app/shared/photoswipe/composable.js +1 -1
- package/dist/elements/accent/Accent.vue +2 -2
- package/dist/elements/accent/AccentColumnSection.vue +2 -2
- package/dist/elements/accent/AccentRowSections.vue +1 -1
- package/dist/elements/accent/core.d.ts +2 -2
- package/dist/elements/callout/Callout.vue +6 -9
- package/dist/elements/callout/core.d.ts +3 -3
- package/dist/elements/caption/Caption.vue +1 -1
- package/dist/elements/details/Details.vue +2 -3
- package/dist/elements/diagram/Diagram.vue +12 -2
- package/dist/elements/diagram/core.d.ts +3 -3
- package/dist/elements/emphasis/Emphasis.vue +1 -1
- package/dist/elements/emphasis/core.d.ts +6 -6
- package/dist/elements/flex/Flex.vue +8 -2
- package/dist/elements/flex/core.d.ts +7 -3
- package/dist/elements/flex/core.js +4 -0
- package/dist/elements/gallery/core.d.ts +3 -3
- package/dist/elements/heading/Heading.vue +1 -1
- package/dist/elements/heading/core.d.ts +9 -9
- package/dist/elements/heading/core.js +14 -10
- package/dist/elements/horizontalLine/HorizontalLine.vue +1 -1
- package/dist/elements/image/core.d.ts +3 -3
- package/dist/elements/link/BlockLink.vue +1 -2
- package/dist/elements/link/Link.vue +6 -3
- package/dist/elements/list/List.vue +10 -8
- package/dist/elements/list/core.d.ts +3 -3
- package/dist/elements/math/block.d.ts +9 -6
- package/dist/elements/math/block.js +2 -1
- package/dist/elements/math/components/BlockMath.vue +1 -1
- package/dist/elements/math/components/MathGroup.vue +5 -3
- package/dist/elements/math/core.d.ts +2 -2
- package/dist/elements/math/inliner.d.ts +2 -2
- package/dist/elements/paragraph/Paragraph.vue +1 -1
- package/dist/elements/paragraph/core.d.ts +3 -3
- package/dist/elements/problem/components/ProblemButton.vue +2 -2
- package/dist/elements/problem/components/ProblemContainer.vue +1 -2
- package/dist/elements/problem/components/ProblemExpander.vue +1 -1
- package/dist/elements/problem/components/ProblemExpanderSection.vue +2 -3
- package/dist/elements/problem/components/ProblemHeader.vue +2 -6
- package/dist/elements/problem/components/Problems.vue +3 -3
- package/dist/elements/problem/components/expanders/Check.vue +2 -3
- package/dist/elements/problem/components/expanders/Checks.vue +1 -1
- package/dist/elements/problem/core.d.ts +44 -8
- package/dist/elements/problem/problem.d.ts +3 -3
- package/dist/elements/problem/problem.js +3 -4
- package/dist/elements/problem/problemContent.d.ts +42 -37
- package/dist/elements/problem/problemContent.js +86 -2
- package/dist/elements/problem/problems.d.ts +3 -3
- package/dist/elements/problem/problems.js +3 -4
- package/dist/elements/table/Table.vue +2 -4
- package/dist/elements/table/core.d.ts +3 -3
- package/dist/elements/video/core.d.ts +3 -3
- package/dist/include.js +0 -1
- package/dist/snippet.d.ts +24 -34
- package/dist/snippet.js +60 -31
- package/dist/tag.d.ts +3 -3
- package/dist/tag.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type Component, type InjectionKey, type Ref } from 'vue';
|
|
2
2
|
import type { EruditLanguageCode } from '@erudit-js/core/eruditConfig/language';
|
|
3
3
|
import type { EruditMode } from '@erudit-js/core/mode';
|
|
4
|
+
import type { FormatText } from '@erudit-js/core/formatText';
|
|
4
5
|
import type { AppElement } from '../appElement.js';
|
|
5
6
|
export interface ProseContext {
|
|
6
7
|
mode: EruditMode;
|
|
7
8
|
languageCode: EruditLanguageCode;
|
|
8
9
|
appElements: Record<string, AppElement>;
|
|
9
|
-
formatText:
|
|
10
|
+
formatText: FormatText;
|
|
10
11
|
pathUrl: string;
|
|
11
12
|
baseUrl: string;
|
|
12
13
|
hashUrl: Ref<string | undefined>;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
import type { FormatTextState } from '@erudit-js/core/formatText';
|
|
3
|
+
export declare function useFormatText(): import("@erudit-js/core/formatText").FormatText;
|
|
4
|
+
export declare const formatTextStateSymbol: InjectionKey<FormatTextState>;
|
|
5
|
+
export declare function useFormatTextState(): FormatTextState;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
1
2
|
import { useProseContext } from "./context.js";
|
|
2
3
|
export function useFormatText() {
|
|
3
4
|
const { formatText } = useProseContext();
|
|
4
5
|
return formatText;
|
|
5
6
|
}
|
|
7
|
+
export const formatTextStateSymbol = Symbol();
|
|
8
|
+
export function useFormatTextState() {
|
|
9
|
+
return inject(formatTextStateSymbol);
|
|
10
|
+
}
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
import { Text, h } from 'vue';
|
|
3
3
|
import type { ProseElement, textSchema } from '@jsprose/core';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
useFormatText,
|
|
7
|
+
useFormatTextState,
|
|
8
|
+
} from '../composables/formatText.js';
|
|
6
9
|
|
|
7
10
|
const { element } = defineProps<{ element: ProseElement<typeof textSchema> }>();
|
|
11
|
+
const formatTextState = useFormatTextState();
|
|
8
12
|
const formatText = useFormatText();
|
|
9
13
|
|
|
10
14
|
const originalText = element.data;
|
|
11
15
|
const leadingSpace = originalText.match(/^(\s*)/)?.[1] ? ' ' : '';
|
|
12
16
|
const trailingSpace = originalText.match(/(\s*)$/)?.[1] ? ' ' : '';
|
|
13
|
-
const formattedText = formatText(originalText);
|
|
17
|
+
const formattedText = formatText(originalText, formatTextState);
|
|
14
18
|
const textWithSpaces = leadingSpace + formattedText + trailingSpace;
|
|
15
19
|
|
|
16
20
|
const TextComponent = h(Text, textWithSpaces);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { provide } from 'vue';
|
|
3
3
|
import type { AnySchema, GenericStorage, ProseElement } from '@jsprose/core';
|
|
4
|
+
import { createFormatTextState } from '@erudit-js/core/formatText';
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
proseContextSymbol,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
import { proseStorageSymbol } from '../composables/storage.js';
|
|
10
11
|
import Render from './Render.vue';
|
|
11
12
|
import { anchorStateSymbol, useAnchorState } from '../composables/anchor.js';
|
|
13
|
+
import { formatTextStateSymbol } from '../composables/formatText.js';
|
|
12
14
|
|
|
13
15
|
const { element, storage, context } = defineProps<{
|
|
14
16
|
element: ProseElement<AnySchema>;
|
|
@@ -21,6 +23,8 @@ provide(proseStorageSymbol, storage);
|
|
|
21
23
|
|
|
22
24
|
const anchorState = useAnchorState(context.hashUrl, element);
|
|
23
25
|
provide(anchorStateSymbol, anchorState);
|
|
26
|
+
|
|
27
|
+
provide(formatTextStateSymbol, createFormatTextState());
|
|
24
28
|
</script>
|
|
25
29
|
|
|
26
30
|
<template>
|
|
@@ -18,11 +18,16 @@ import {
|
|
|
18
18
|
useResolveAnchor,
|
|
19
19
|
} from '../../composables/anchor.js';
|
|
20
20
|
import AsideMenu from './AsideMenu.vue';
|
|
21
|
+
import { useFormatTextState } from '../../composables/formatText.js';
|
|
21
22
|
|
|
22
23
|
const { element } = defineProps<{ element: ProseElement<BlockSchema> }>();
|
|
23
24
|
const { EruditIcon, EruditTransition } = useProseContext();
|
|
24
25
|
const elementIcon = await useElementIcon(element);
|
|
25
26
|
|
|
27
|
+
const formatTextState = useFormatTextState();
|
|
28
|
+
// Reset quote state making sure any opened quote does not leak outside
|
|
29
|
+
formatTextState.quote = 'closed';
|
|
30
|
+
|
|
26
31
|
const blockElement = useTemplateRef('block');
|
|
27
32
|
const asideElement = useTemplateRef('aside');
|
|
28
33
|
const asideMenuElement = useTemplateRef('asideMenu');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const lightInvert = "not-dark:invert not-dark:hue-rotate-180
|
|
2
|
-
export declare const darkInvert = "dark:invert dark:hue-rotate-180
|
|
1
|
+
export declare const lightInvert = "not-dark:invert not-dark:hue-rotate-180";
|
|
2
|
+
export declare const darkInvert = "dark:invert dark:hue-rotate-180";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const lightInvert = "not-dark:invert not-dark:hue-rotate-180
|
|
2
|
-
export const darkInvert = "dark:invert dark:hue-rotate-180
|
|
1
|
+
export const lightInvert = "not-dark:invert not-dark:hue-rotate-180";
|
|
2
|
+
export const darkInvert = "dark:invert dark:hue-rotate-180";
|
|
@@ -22,7 +22,7 @@ export function usePhotoSwipe() {
|
|
|
22
22
|
lightbox.value.on("uiRegister", () => {
|
|
23
23
|
lightbox.value.pswp?.ui?.registerElement({
|
|
24
24
|
name: "caption",
|
|
25
|
-
className: "text-xs micro:text-sm absolute bottom-0 w-full text-center p-normal bg-bg-main/50 backdrop-blur-md",
|
|
25
|
+
className: "text-xs micro:text-sm absolute **:text-text-muted bottom-0 w-full text-center p-normal bg-bg-main/50 backdrop-blur-md",
|
|
26
26
|
order: 9,
|
|
27
27
|
isButton: false,
|
|
28
28
|
appendTo: "root",
|
|
@@ -60,13 +60,13 @@ const accentOptions = (appElement as any)['accent'] as AccentAppOptions;
|
|
|
60
60
|
}"
|
|
61
61
|
:class="[
|
|
62
62
|
`rounded-xl border border-(--accentBorder)
|
|
63
|
-
bg-(--accentBackground)
|
|
63
|
+
bg-(--accentBackground)`,
|
|
64
64
|
]"
|
|
65
65
|
>
|
|
66
66
|
<div
|
|
67
67
|
class="text-main-lg flex items-center gap-(--proseAsideWidth)
|
|
68
68
|
px-(--proseAsideWidth) py-(--proseAsideWidth) font-semibold
|
|
69
|
-
text-(--accentText)
|
|
69
|
+
text-(--accentText)"
|
|
70
70
|
>
|
|
71
71
|
<EruditIcon
|
|
72
72
|
:name="accentIcon"
|
|
@@ -31,7 +31,7 @@ watchEffect(() => {
|
|
|
31
31
|
@click="opened = !opened"
|
|
32
32
|
class="group relative flex cursor-pointer items-center border-t
|
|
33
33
|
border-(--accentBorder) p-(--proseAsideWidth) font-medium
|
|
34
|
-
text-(--accentText)
|
|
34
|
+
text-(--accentText)"
|
|
35
35
|
>
|
|
36
36
|
<div class="flex-1">{{ title }}</div>
|
|
37
37
|
<button
|
|
@@ -49,7 +49,7 @@ watchEffect(() => {
|
|
|
49
49
|
<div
|
|
50
50
|
:class="[
|
|
51
51
|
`absolute bottom-0 left-0 w-full border-b border-dashed
|
|
52
|
-
border-(--accentBorder)
|
|
52
|
+
border-(--accentBorder)`,
|
|
53
53
|
opened ? 'opacity-100' : 'opacity-0',
|
|
54
54
|
]"
|
|
55
55
|
></div>
|
|
@@ -106,7 +106,7 @@ export declare function defineAccentCore<const I extends string, const J extends
|
|
|
106
106
|
} | {
|
|
107
107
|
row?: undefined;
|
|
108
108
|
column?: true;
|
|
109
|
-
}) & TagChildren)) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
109
|
+
}) & TagChildren)) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
110
110
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
111
111
|
name: `accent_${TDefinition["name"]}`;
|
|
112
112
|
type: "block";
|
|
@@ -179,7 +179,7 @@ export declare function defineAccentCore<const I extends string, const J extends
|
|
|
179
179
|
} | {
|
|
180
180
|
row?: undefined;
|
|
181
181
|
column?: true;
|
|
182
|
-
}) & TagChildren)) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
182
|
+
}) & TagChildren)) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>, {
|
|
183
183
|
tagName: K;
|
|
184
184
|
}>; }, undefined>;
|
|
185
185
|
};
|
|
@@ -25,23 +25,20 @@ const formatText = useFormatText();
|
|
|
25
25
|
:src="calloutStorage.resolvedIconSrc"
|
|
26
26
|
loading="lazy"
|
|
27
27
|
class="outline-border size-[60px] rounded-full border-2
|
|
28
|
-
border-transparent outline-2
|
|
28
|
+
border-transparent outline-2"
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
31
|
<div
|
|
32
32
|
class="border-border/90 relative flex-1 rounded-xl border
|
|
33
|
-
bg-(--calloutBg) py-(--proseAsideWidth) font-serif
|
|
34
|
-
|
|
33
|
+
bg-(--calloutBg) py-(--proseAsideWidth) font-serif
|
|
34
|
+
shadow-md"
|
|
35
35
|
>
|
|
36
|
-
<div
|
|
37
|
-
:class="$style.
|
|
38
|
-
class="max-micro:hidden transition-[border]"
|
|
39
|
-
>
|
|
40
|
-
<div :class="$style.fill" class="transition-[border]"></div>
|
|
36
|
+
<div :class="$style.arrow" class="max-micro:hidden">
|
|
37
|
+
<div :class="$style.fill"></div>
|
|
41
38
|
</div>
|
|
42
39
|
<header
|
|
43
40
|
class="gap-small mb-(--proseAsideWidth) flex items-center
|
|
44
|
-
px-(--proseAsideWidth) font-semibold
|
|
41
|
+
px-(--proseAsideWidth) font-semibold"
|
|
45
42
|
>
|
|
46
43
|
<img
|
|
47
44
|
:src="calloutStorage.resolvedIconSrc"
|
|
@@ -27,7 +27,7 @@ export declare const Callout: import("@jsprose/core").Tag<"Callout", {
|
|
|
27
27
|
icon: string;
|
|
28
28
|
invert?: Invert;
|
|
29
29
|
title: string;
|
|
30
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
30
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
31
31
|
export declare const calloutRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
32
32
|
name: "callout";
|
|
33
33
|
type: "block";
|
|
@@ -47,7 +47,7 @@ export declare const calloutRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
47
47
|
icon: string;
|
|
48
48
|
invert?: Invert;
|
|
49
49
|
title: string;
|
|
50
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
50
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
51
51
|
}, undefined>;
|
|
52
52
|
declare const _default: {
|
|
53
53
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -69,7 +69,7 @@ declare const _default: {
|
|
|
69
69
|
icon: string;
|
|
70
70
|
invert?: Invert;
|
|
71
71
|
title: string;
|
|
72
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
72
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
73
73
|
}, undefined>;
|
|
74
74
|
};
|
|
75
75
|
export default _default;
|
|
@@ -30,7 +30,7 @@ onMounted(() => {
|
|
|
30
30
|
<template>
|
|
31
31
|
<div
|
|
32
32
|
ref="caption"
|
|
33
|
-
class="text-text-muted text-main-sm mt-small micro:mt-normal m-auto
|
|
33
|
+
class="**:text-text-muted text-main-sm mt-small micro:mt-normal m-auto
|
|
34
34
|
text-center"
|
|
35
35
|
v-bind="width ? { style: { width } } : {}"
|
|
36
36
|
>
|
|
@@ -27,11 +27,10 @@ const containsAnchor = useContainsAnchor(element);
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<Block :element v-if="isAnchor || containsAnchor || mode !== '
|
|
30
|
+
<Block :element v-if="isAnchor || containsAnchor || mode !== 'static'">
|
|
31
31
|
<div
|
|
32
32
|
class="border-border bg-bg-accent/30 rounded-xl border-2
|
|
33
|
-
border-dashed
|
|
34
|
-
dark:border-white/30 dark:bg-white/5"
|
|
33
|
+
border-dashed dark:border-white/30 dark:bg-white/5"
|
|
35
34
|
>
|
|
36
35
|
<div class="text-text-muted p-(--proseAsideWidth) font-medium">
|
|
37
36
|
<EruditIcon
|
|
@@ -26,6 +26,7 @@ const { EruditIcon, loadingSvg } = useProseContext();
|
|
|
26
26
|
const loading = ref(true);
|
|
27
27
|
const diagramRendering = ref(false);
|
|
28
28
|
const dummyMathHtml = ref('');
|
|
29
|
+
const dummyElement = useTemplateRef('dummy');
|
|
29
30
|
const diagramContent = ref(element.children[0].data);
|
|
30
31
|
const diagramSvgContent = ref('');
|
|
31
32
|
const diagramElement = useTemplateRef('diagram');
|
|
@@ -198,7 +199,11 @@ async function renderDiagram() {
|
|
|
198
199
|
theme: 'base',
|
|
199
200
|
});
|
|
200
201
|
|
|
201
|
-
const { svg } = await mermaid.render(
|
|
202
|
+
const { svg } = await mermaid.render(
|
|
203
|
+
diagramUid,
|
|
204
|
+
diagramContent.value,
|
|
205
|
+
dummyElement.value!,
|
|
206
|
+
);
|
|
202
207
|
|
|
203
208
|
diagramSvgContent.value = svg;
|
|
204
209
|
}
|
|
@@ -207,7 +212,8 @@ async function renderDiagram() {
|
|
|
207
212
|
<template>
|
|
208
213
|
<Block :element>
|
|
209
214
|
<div
|
|
210
|
-
|
|
215
|
+
ref="dummy"
|
|
216
|
+
:class="[$style.diagram, 'fixed -top-[9999px] -left-[9999px]']"
|
|
211
217
|
v-html="dummyMathHtml"
|
|
212
218
|
></div>
|
|
213
219
|
<div ref="diagram">
|
|
@@ -239,6 +245,10 @@ async function renderDiagram() {
|
|
|
239
245
|
cursor: pointer;
|
|
240
246
|
}
|
|
241
247
|
|
|
248
|
+
:global(.katex-display) {
|
|
249
|
+
margin: 0 !important;
|
|
250
|
+
}
|
|
251
|
+
|
|
242
252
|
/* Text color */
|
|
243
253
|
|
|
244
254
|
:global(.edgeLabel) {
|
|
@@ -56,7 +56,7 @@ export declare const Diagram: import("@jsprose/core").Tag<"Diagram", {
|
|
|
56
56
|
Storage: undefined;
|
|
57
57
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
58
58
|
}];
|
|
59
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
59
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
60
60
|
export declare const diagramRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
61
61
|
name: "diagram";
|
|
62
62
|
type: "block";
|
|
@@ -114,7 +114,7 @@ export declare const diagramRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
114
114
|
Storage: undefined;
|
|
115
115
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
116
116
|
}];
|
|
117
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
117
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
118
118
|
}, undefined>;
|
|
119
119
|
declare const _default: {
|
|
120
120
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -174,7 +174,7 @@ declare const _default: {
|
|
|
174
174
|
Storage: undefined;
|
|
175
175
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
176
176
|
}];
|
|
177
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
177
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
178
178
|
}, undefined>;
|
|
179
179
|
dependencies: {
|
|
180
180
|
mermaid: {
|
|
@@ -11,7 +11,7 @@ defineProps<{ element: ProseElement<typeof emphasisSchema> }>();
|
|
|
11
11
|
<strong
|
|
12
12
|
v-if="element.data.type === 'bold'"
|
|
13
13
|
:class="[
|
|
14
|
-
'font-semibold
|
|
14
|
+
'font-semibold',
|
|
15
15
|
element.data?.accent
|
|
16
16
|
? 'text-(--accentText,var(--color-text-deep))'
|
|
17
17
|
: 'text-text-deep',
|
|
@@ -22,7 +22,7 @@ export declare const B: import("@jsprose/core").Tag<"B", {
|
|
|
22
22
|
Children: InlinerSchema[];
|
|
23
23
|
}, {
|
|
24
24
|
accent?: boolean;
|
|
25
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
25
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
26
26
|
export declare const I: import("@jsprose/core").Tag<"I", {
|
|
27
27
|
name: "emphasis";
|
|
28
28
|
type: "inliner";
|
|
@@ -30,7 +30,7 @@ export declare const I: import("@jsprose/core").Tag<"I", {
|
|
|
30
30
|
Data: EmphasisData;
|
|
31
31
|
Storage: undefined;
|
|
32
32
|
Children: InlinerSchema[];
|
|
33
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
33
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
34
34
|
export declare const emphasisRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
35
35
|
name: "emphasis";
|
|
36
36
|
type: "inliner";
|
|
@@ -48,7 +48,7 @@ export declare const emphasisRegistryItem: import("@jsprose/core").RegistryItem<
|
|
|
48
48
|
Children: InlinerSchema[];
|
|
49
49
|
}, {
|
|
50
50
|
accent?: boolean;
|
|
51
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
51
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
52
52
|
I: import("@jsprose/core").Tag<"I", {
|
|
53
53
|
name: "emphasis";
|
|
54
54
|
type: "inliner";
|
|
@@ -56,7 +56,7 @@ export declare const emphasisRegistryItem: import("@jsprose/core").RegistryItem<
|
|
|
56
56
|
Data: EmphasisData;
|
|
57
57
|
Storage: undefined;
|
|
58
58
|
Children: InlinerSchema[];
|
|
59
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
59
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
60
60
|
}, undefined>;
|
|
61
61
|
declare const _default: {
|
|
62
62
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -76,7 +76,7 @@ declare const _default: {
|
|
|
76
76
|
Children: InlinerSchema[];
|
|
77
77
|
}, {
|
|
78
78
|
accent?: boolean;
|
|
79
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
79
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
80
80
|
I: import("@jsprose/core").Tag<"I", {
|
|
81
81
|
name: "emphasis";
|
|
82
82
|
type: "inliner";
|
|
@@ -84,7 +84,7 @@ declare const _default: {
|
|
|
84
84
|
Data: EmphasisData;
|
|
85
85
|
Storage: undefined;
|
|
86
86
|
Children: InlinerSchema[];
|
|
87
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
87
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
88
88
|
}, undefined>;
|
|
89
89
|
};
|
|
90
90
|
export default _default;
|
|
@@ -22,8 +22,14 @@ const gap = (() => {
|
|
|
22
22
|
:style="{ justifyContent: justify, gap }"
|
|
23
23
|
class="flex flex-wrap items-center"
|
|
24
24
|
>
|
|
25
|
-
<template v-for="item of element.children">
|
|
26
|
-
<div
|
|
25
|
+
<template v-for="(item, i) of element.children">
|
|
26
|
+
<div
|
|
27
|
+
:style="{
|
|
28
|
+
flex: element.data?.flexes
|
|
29
|
+
? element.data.flexes[i]
|
|
30
|
+
: undefined,
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
27
33
|
<Render :element="item" />
|
|
28
34
|
</div>
|
|
29
35
|
</template>
|
|
@@ -2,6 +2,7 @@ import { type BlockSchema, type TagChildren } from '@jsprose/core';
|
|
|
2
2
|
export interface FlexData {
|
|
3
3
|
gap?: string;
|
|
4
4
|
justifyContent?: string;
|
|
5
|
+
flexes?: string[];
|
|
5
6
|
}
|
|
6
7
|
export declare const flexSchema: {
|
|
7
8
|
name: "flex";
|
|
@@ -21,7 +22,8 @@ export declare const Flex: import("@jsprose/core").Tag<"Flex", {
|
|
|
21
22
|
}, {
|
|
22
23
|
gap?: string;
|
|
23
24
|
justify?: string;
|
|
24
|
-
|
|
25
|
+
flexes?: string[];
|
|
26
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
25
27
|
export declare const flexRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
26
28
|
name: "flex";
|
|
27
29
|
type: "block";
|
|
@@ -40,7 +42,8 @@ export declare const flexRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
40
42
|
}, {
|
|
41
43
|
gap?: string;
|
|
42
44
|
justify?: string;
|
|
43
|
-
|
|
45
|
+
flexes?: string[];
|
|
46
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
44
47
|
}, undefined>;
|
|
45
48
|
declare const _default: {
|
|
46
49
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -61,7 +64,8 @@ declare const _default: {
|
|
|
61
64
|
}, {
|
|
62
65
|
gap?: string;
|
|
63
66
|
justify?: string;
|
|
64
|
-
|
|
67
|
+
flexes?: string[];
|
|
68
|
+
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
65
69
|
}, undefined>;
|
|
66
70
|
};
|
|
67
71
|
export default _default;
|
|
@@ -20,6 +20,10 @@ export const Flex = defineEruditTag({
|
|
|
20
20
|
element.data = element.data || {};
|
|
21
21
|
element.data.justifyContent = props.justify;
|
|
22
22
|
}
|
|
23
|
+
if (props.flexes) {
|
|
24
|
+
element.data = element.data || {};
|
|
25
|
+
element.data.flexes = props.flexes;
|
|
26
|
+
}
|
|
23
27
|
});
|
|
24
28
|
export const flexRegistryItem = defineRegistryItem({
|
|
25
29
|
schema: flexSchema,
|
|
@@ -42,7 +42,7 @@ export declare const Gallery: import("@jsprose/core").Tag<"Gallery", {
|
|
|
42
42
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
43
43
|
}] | undefined;
|
|
44
44
|
}[];
|
|
45
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
45
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
46
46
|
export declare const galleryRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
47
47
|
name: "gallery";
|
|
48
48
|
type: "block";
|
|
@@ -86,7 +86,7 @@ export declare const galleryRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
86
86
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
87
87
|
}] | undefined;
|
|
88
88
|
}[];
|
|
89
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
89
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
90
90
|
}, undefined>;
|
|
91
91
|
declare const _default: {
|
|
92
92
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -132,7 +132,7 @@ declare const _default: {
|
|
|
132
132
|
Children: import("@jsprose/core").InlinerSchema[];
|
|
133
133
|
}] | undefined;
|
|
134
134
|
}[];
|
|
135
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet
|
|
135
|
+
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
136
136
|
}, undefined>;
|
|
137
137
|
};
|
|
138
138
|
export default _default;
|
|
@@ -20,7 +20,7 @@ export declare const H1: import("@jsprose/core").Tag<"H1", {
|
|
|
20
20
|
Data: HeadingData;
|
|
21
21
|
Storage: undefined;
|
|
22
22
|
Children: undefined;
|
|
23
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
23
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
24
24
|
export declare const H2: import("@jsprose/core").Tag<"H2", {
|
|
25
25
|
name: "heading";
|
|
26
26
|
type: "block";
|
|
@@ -28,7 +28,7 @@ export declare const H2: import("@jsprose/core").Tag<"H2", {
|
|
|
28
28
|
Data: HeadingData;
|
|
29
29
|
Storage: undefined;
|
|
30
30
|
Children: undefined;
|
|
31
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
31
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
32
32
|
export declare const H3: import("@jsprose/core").Tag<"H3", {
|
|
33
33
|
name: "heading";
|
|
34
34
|
type: "block";
|
|
@@ -36,7 +36,7 @@ export declare const H3: import("@jsprose/core").Tag<"H3", {
|
|
|
36
36
|
Data: HeadingData;
|
|
37
37
|
Storage: undefined;
|
|
38
38
|
Children: undefined;
|
|
39
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
39
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
40
40
|
export declare const headingRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
41
41
|
name: "heading";
|
|
42
42
|
type: "block";
|
|
@@ -52,7 +52,7 @@ export declare const headingRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
52
52
|
Data: HeadingData;
|
|
53
53
|
Storage: undefined;
|
|
54
54
|
Children: undefined;
|
|
55
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
55
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
56
56
|
H2: import("@jsprose/core").Tag<"H2", {
|
|
57
57
|
name: "heading";
|
|
58
58
|
type: "block";
|
|
@@ -60,7 +60,7 @@ export declare const headingRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
60
60
|
Data: HeadingData;
|
|
61
61
|
Storage: undefined;
|
|
62
62
|
Children: undefined;
|
|
63
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
63
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
64
64
|
H3: import("@jsprose/core").Tag<"H3", {
|
|
65
65
|
name: "heading";
|
|
66
66
|
type: "block";
|
|
@@ -68,7 +68,7 @@ export declare const headingRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
|
68
68
|
Data: HeadingData;
|
|
69
69
|
Storage: undefined;
|
|
70
70
|
Children: undefined;
|
|
71
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
71
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
72
72
|
}, undefined>;
|
|
73
73
|
declare const _default: {
|
|
74
74
|
registryItem: import("@jsprose/core").RegistryItem<{
|
|
@@ -86,7 +86,7 @@ declare const _default: {
|
|
|
86
86
|
Data: HeadingData;
|
|
87
87
|
Storage: undefined;
|
|
88
88
|
Children: undefined;
|
|
89
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
89
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
90
90
|
H2: import("@jsprose/core").Tag<"H2", {
|
|
91
91
|
name: "heading";
|
|
92
92
|
type: "block";
|
|
@@ -94,7 +94,7 @@ declare const _default: {
|
|
|
94
94
|
Data: HeadingData;
|
|
95
95
|
Storage: undefined;
|
|
96
96
|
Children: undefined;
|
|
97
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
97
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
98
98
|
H3: import("@jsprose/core").Tag<"H3", {
|
|
99
99
|
name: "heading";
|
|
100
100
|
type: "block";
|
|
@@ -102,7 +102,7 @@ declare const _default: {
|
|
|
102
102
|
Data: HeadingData;
|
|
103
103
|
Storage: undefined;
|
|
104
104
|
Children: undefined;
|
|
105
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet
|
|
105
|
+
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
106
106
|
}, undefined>;
|
|
107
107
|
};
|
|
108
108
|
export default _default;
|