@erudit-js/prose 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/dist/app/appElement.d.ts +7 -6
- package/dist/app/appElement.js +1 -1
- package/dist/app/composables/anchor.d.ts +7 -7
- package/dist/app/composables/appElement.d.ts +4 -4
- package/dist/app/composables/appElement.js +3 -3
- package/dist/app/composables/context.d.ts +3 -2
- package/dist/app/composables/elementIcon.d.ts +2 -2
- package/dist/app/composables/elementIcon.js +1 -1
- package/dist/app/composables/language.d.ts +2 -2
- package/dist/app/composables/language.js +1 -1
- package/dist/app/composables/storage.d.ts +4 -4
- package/dist/app/composables/storage.js +0 -4
- package/dist/app/default/Mix.vue +2 -2
- package/dist/app/default/Text.vue +2 -2
- package/dist/app/shared/Prose.vue +3 -3
- package/dist/app/shared/Render.vue +5 -14
- package/dist/app/shared/block/AsideMenu.vue +2 -2
- package/dist/app/shared/block/AsideMenuCopyLink.vue +1 -1
- package/dist/app/shared/block/Block.vue +4 -4
- package/dist/app/shared/inliner/Inliner.vue +2 -2
- package/dist/coreElement.d.ts +25 -7
- package/dist/coreElement.js +2 -2
- package/dist/elements/accent/Accent.vue +4 -4
- package/dist/elements/accent/AccentColumnSection.vue +2 -2
- package/dist/elements/accent/AccentRowSections.vue +2 -2
- package/dist/elements/accent/app.d.ts +3 -3
- package/dist/elements/accent/app.js +2 -2
- package/dist/elements/accent/core.d.ts +61 -300
- package/dist/elements/accent/core.js +83 -68
- package/dist/elements/callout/Callout.vue +4 -4
- package/dist/elements/callout/app.d.ts +1 -8
- package/dist/elements/callout/app.js +2 -2
- package/dist/elements/callout/core.d.ts +21 -59
- package/dist/elements/callout/core.js +18 -17
- package/dist/elements/caption/Caption.vue +3 -3
- package/dist/elements/caption/app.d.ts +1 -8
- package/dist/elements/caption/app.js +2 -2
- package/dist/elements/caption/core.d.ts +21 -99
- package/dist/elements/caption/core.js +18 -22
- package/dist/elements/details/Details.vue +3 -3
- package/dist/elements/details/app.d.ts +1 -8
- package/dist/elements/details/app.js +2 -2
- package/dist/elements/details/core.d.ts +18 -61
- package/dist/elements/details/core.js +16 -11
- package/dist/elements/diagram/Diagram.vue +14 -11
- package/dist/elements/diagram/app.d.ts +1 -29
- package/dist/elements/diagram/app.js +2 -2
- package/dist/elements/diagram/core.d.ts +14 -177
- package/dist/elements/diagram/core.js +5 -8
- package/dist/elements/emphasis/Emphasis.vue +3 -3
- package/dist/elements/emphasis/app.d.ts +1 -8
- package/dist/elements/emphasis/app.js +2 -2
- package/dist/elements/emphasis/core.d.ts +13 -76
- package/dist/elements/emphasis/core.js +8 -9
- package/dist/elements/flex/Flex.vue +3 -3
- package/dist/elements/flex/app.d.ts +1 -8
- package/dist/elements/flex/app.js +2 -2
- package/dist/elements/flex/core.d.ts +16 -58
- package/dist/elements/flex/core.js +6 -7
- package/dist/elements/gallery/Gallery.vue +3 -3
- package/dist/elements/gallery/app.d.ts +1 -22
- package/dist/elements/gallery/app.js +2 -2
- package/dist/elements/gallery/core.d.ts +11 -132
- package/dist/elements/gallery/core.js +4 -5
- package/dist/elements/heading/Heading.vue +3 -3
- package/dist/elements/heading/_global.d.ts +2 -2
- package/dist/elements/heading/app.d.ts +1 -8
- package/dist/elements/heading/app.js +2 -2
- package/dist/elements/heading/core.d.ts +13 -97
- package/dist/elements/heading/core.js +8 -8
- package/dist/elements/horizontalLine/app.d.ts +1 -8
- package/dist/elements/horizontalLine/app.js +2 -2
- package/dist/elements/horizontalLine/core.d.ts +9 -47
- package/dist/elements/horizontalLine/core.js +4 -5
- package/dist/elements/image/Image.vue +3 -3
- package/dist/elements/image/ImageElement.vue +4 -4
- package/dist/elements/image/app.d.ts +1 -15
- package/dist/elements/image/app.js +2 -2
- package/dist/elements/image/core.d.ts +29 -108
- package/dist/elements/image/core.js +12 -19
- package/dist/elements/image/storage.d.ts +1 -1
- package/dist/elements/image/storage.js +6 -6
- package/dist/elements/lineBreak/app.d.ts +1 -8
- package/dist/elements/lineBreak/app.js +2 -2
- package/dist/elements/lineBreak/core.d.ts +9 -47
- package/dist/elements/lineBreak/core.js +4 -5
- package/dist/elements/link/BlockLink.vue +4 -6
- package/dist/elements/link/Link.vue +4 -4
- package/dist/elements/link/core.d.ts +8 -7
- package/dist/elements/link/core.js +5 -4
- package/dist/elements/link/dependency/app.d.ts +1 -15
- package/dist/elements/link/dependency/app.js +3 -3
- package/dist/elements/link/dependency/core.d.ts +30 -108
- package/dist/elements/link/dependency/core.js +6 -8
- package/dist/elements/link/hook.d.ts +12 -0
- package/dist/elements/link/hook.js +45 -0
- package/dist/elements/link/reference/app.d.ts +1 -15
- package/dist/elements/link/reference/app.js +3 -3
- package/dist/elements/link/reference/core.d.ts +24 -103
- package/dist/elements/link/reference/core.js +6 -8
- package/dist/elements/link/storage.js +1 -1
- package/dist/elements/list/List.vue +7 -5
- package/dist/elements/list/_global.d.ts +3 -3
- package/dist/elements/list/app.d.ts +1 -15
- package/dist/elements/list/app.js +2 -2
- package/dist/elements/list/core.d.ts +33 -155
- package/dist/elements/list/core.js +20 -18
- package/dist/elements/math/app.d.ts +1 -15
- package/dist/elements/math/app.js +3 -3
- package/dist/elements/math/block.d.ts +31 -43
- package/dist/elements/math/block.js +10 -9
- package/dist/elements/math/components/BlockMath.vue +4 -4
- package/dist/elements/math/components/InlinerMath.vue +4 -4
- package/dist/elements/math/core.d.ts +25 -53
- package/dist/elements/math/core.js +3 -11
- package/dist/elements/math/inliner.d.ts +24 -36
- package/dist/elements/math/inliner.js +10 -12
- package/dist/elements/paragraph/Paragraph.vue +3 -3
- package/dist/elements/paragraph/app.d.ts +1 -8
- package/dist/elements/paragraph/app.js +2 -2
- package/dist/elements/paragraph/core.d.ts +12 -53
- package/dist/elements/paragraph/core.js +6 -7
- package/dist/elements/problem/app.d.ts +1 -29
- package/dist/elements/problem/app.js +4 -4
- package/dist/elements/problem/components/Problem.vue +3 -3
- package/dist/elements/problem/components/ProblemContent.vue +15 -21
- package/dist/elements/problem/components/ProblemExpanderSection.vue +2 -2
- package/dist/elements/problem/components/Problems.vue +11 -7
- package/dist/elements/problem/components/SubProblem.vue +3 -4
- package/dist/elements/problem/components/expanders/Check.vue +3 -3
- package/dist/elements/problem/components/expanders/Checks.vue +6 -3
- package/dist/elements/problem/components/expanders/DefaultPlusSections.vue +3 -7
- package/dist/elements/problem/components/expanders/Hint.vue +3 -3
- package/dist/elements/problem/composables/problemScript.d.ts +2 -2
- package/dist/elements/problem/core.d.ts +63 -299
- package/dist/elements/problem/core.js +9 -11
- package/dist/elements/problem/hook.d.ts +1 -0
- package/dist/elements/problem/hook.js +14 -0
- package/dist/elements/problem/problem.d.ts +20 -77
- package/dist/elements/problem/problem.js +6 -6
- package/dist/elements/problem/problemCheck.d.ts +33 -83
- package/dist/elements/problem/problemCheck.js +16 -10
- package/dist/elements/problem/problemContent.d.ts +54 -401
- package/dist/elements/problem/problemContent.js +47 -56
- package/dist/elements/problem/problemScript.d.ts +18 -10
- package/dist/elements/problem/problemScript.js +15 -26
- package/dist/elements/problem/problems.d.ts +29 -188
- package/dist/elements/problem/problems.js +11 -15
- package/dist/elements/problem/storage.d.ts +1 -1
- package/dist/elements/problem/storage.js +2 -3
- package/dist/elements/table/Table.vue +3 -3
- package/dist/elements/table/app.d.ts +1 -29
- package/dist/elements/table/app.js +2 -2
- package/dist/elements/table/core.d.ts +28 -309
- package/dist/elements/table/core.js +17 -29
- package/dist/elements/video/Video.vue +4 -4
- package/dist/elements/video/app.d.ts +1 -15
- package/dist/elements/video/app.js +2 -2
- package/dist/elements/video/core.d.ts +26 -106
- package/dist/elements/video/core.js +11 -16
- package/dist/elements/video/storage.d.ts +1 -1
- package/dist/elements/video/storage.js +2 -3
- package/dist/error.d.ts +3 -0
- package/dist/error.js +6 -0
- package/dist/include.d.ts +4 -4
- package/dist/include.js +6 -12
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/rawElement.d.ts +9 -6
- package/dist/rawElement.js +4 -0
- package/dist/rawToProse/countSchemas.d.ts +1 -0
- package/dist/rawToProse/countSchemas.js +11 -0
- package/dist/rawToProse/hook.d.ts +39 -0
- package/dist/rawToProse/hook.js +6 -0
- package/dist/rawToProse/index.d.ts +34 -0
- package/dist/rawToProse/index.js +92 -0
- package/dist/rawToProse/uniqueTitles.d.ts +1 -0
- package/dist/rawToProse/uniqueTitles.js +11 -0
- package/dist/shared/filePath.js +2 -2
- package/dist/shared/paragraphWrap.d.ts +3 -3
- package/dist/shared/paragraphWrap.js +7 -12
- package/dist/slugify/index.d.ts +3 -1
- package/dist/slugify/index.js +5 -6
- package/dist/slugify/languages/en.js +1 -1
- package/dist/slugify/languages/ru.js +1 -1
- package/dist/snippet.d.ts +39 -33
- package/dist/snippet.js +139 -73
- package/dist/tag.d.ts +22 -19
- package/dist/tag.js +19 -15
- package/dist/toc.d.ts +12 -18
- package/dist/toc.js +120 -42
- package/package.json +7 -6
- package/dist/app/default/Inliners.vue +0 -11
- package/dist/context.d.ts +0 -4
- package/dist/context.js +0 -1
- package/dist/elements/link/step.d.ts +0 -16
- package/dist/elements/link/step.js +0 -36
- package/dist/elements/problem/step.d.ts +0 -5
- package/dist/elements/problem/step.js +0 -13
- package/dist/resolve.d.ts +0 -21
- package/dist/resolve.js +0 -102
- package/dist/resolveStep.d.ts +0 -9
- package/dist/resolveStep.js +0 -3
- package/dist/title.d.ts +0 -8
- package/dist/title.js +0 -6
- package/dist/utils/docs.d.ts +0 -1
- package/dist/utils/docs.js +0 -22
- package/types.d.ts +0 -4
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "callout";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: true;
|
|
5
|
-
Data: import("./core.js").CalloutData;
|
|
6
|
-
Storage: import("./core.js").CalloutStorage;
|
|
7
|
-
Children: import("@jsprose/core").BlockSchema[];
|
|
8
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").CalloutSchema>;
|
|
9
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { calloutSchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: calloutSchema,
|
|
5
5
|
component: () => import("./Callout.vue"),
|
|
6
6
|
languages: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BlockSchema, type
|
|
1
|
+
import { type BlockSchema, type Schema } from 'tsprose';
|
|
2
2
|
import type { Invert } from '../../shared/invert.js';
|
|
3
3
|
export interface CalloutData {
|
|
4
4
|
iconSrc: string;
|
|
@@ -8,73 +8,35 @@ export interface CalloutData {
|
|
|
8
8
|
export interface CalloutStorage {
|
|
9
9
|
resolvedIconSrc: string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
name:
|
|
13
|
-
type:
|
|
11
|
+
export interface CalloutSchema extends Schema {
|
|
12
|
+
name: 'callout';
|
|
13
|
+
type: 'block';
|
|
14
14
|
linkable: true;
|
|
15
15
|
Data: CalloutData;
|
|
16
16
|
Storage: CalloutStorage;
|
|
17
17
|
Children: BlockSchema[];
|
|
18
|
-
}
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
type: "block";
|
|
22
|
-
linkable: true;
|
|
23
|
-
Data: CalloutData;
|
|
24
|
-
Storage: CalloutStorage;
|
|
25
|
-
Children: BlockSchema[];
|
|
26
|
-
}, {
|
|
18
|
+
}
|
|
19
|
+
export declare const calloutSchema: CalloutSchema;
|
|
20
|
+
export declare const Callout: import("../../tag.js").ToEruditTag<CalloutSchema, "Callout", {
|
|
27
21
|
icon: string;
|
|
28
22
|
invert?: Invert;
|
|
29
23
|
title: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
linkable: true;
|
|
35
|
-
Data: CalloutData;
|
|
36
|
-
Storage: CalloutStorage;
|
|
37
|
-
Children: BlockSchema[];
|
|
38
|
-
}, {
|
|
39
|
-
Callout: import("@jsprose/core").Tag<"Callout", {
|
|
40
|
-
name: "callout";
|
|
41
|
-
type: "block";
|
|
42
|
-
linkable: true;
|
|
43
|
-
Data: CalloutData;
|
|
44
|
-
Storage: CalloutStorage;
|
|
45
|
-
Children: BlockSchema[];
|
|
46
|
-
}, {
|
|
24
|
+
}>;
|
|
25
|
+
declare const _default: {
|
|
26
|
+
readonly schema: CalloutSchema;
|
|
27
|
+
readonly tags: [import("../../tag.js").ToEruditTag<CalloutSchema, "Callout", {
|
|
47
28
|
icon: string;
|
|
48
29
|
invert?: Invert;
|
|
49
30
|
title: string;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, {
|
|
61
|
-
Callout: import("@jsprose/core").Tag<"Callout", {
|
|
62
|
-
name: "callout";
|
|
63
|
-
type: "block";
|
|
64
|
-
linkable: true;
|
|
65
|
-
Data: CalloutData;
|
|
66
|
-
Storage: CalloutStorage;
|
|
67
|
-
Children: BlockSchema[];
|
|
68
|
-
}, {
|
|
69
|
-
icon: string;
|
|
70
|
-
invert?: Invert;
|
|
71
|
-
title: string;
|
|
72
|
-
} & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
73
|
-
}, undefined>;
|
|
31
|
+
}>];
|
|
32
|
+
readonly rawToProseHook: ({ result }: {
|
|
33
|
+
task: import("../../index.js").EruditRawToProseTask;
|
|
34
|
+
result: import("../../index.js").EruditRawToProseResult;
|
|
35
|
+
}) => {
|
|
36
|
+
matchStep: ({ rawElement }: {
|
|
37
|
+
rawElement: import("../../rawElement.js").ToEruditRawElement<CalloutSchema>;
|
|
38
|
+
proseElement: import("tsprose").ProseElement;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
74
41
|
};
|
|
75
42
|
export default _default;
|
|
76
|
-
export declare const calloutIconSrcStep: ({ rawElement }: {
|
|
77
|
-
context: import("../../context.js").EruditProseContext;
|
|
78
|
-
rawElement: import("../../rawElement.js").EruditRawElement<import("@jsprose/core").AnySchema>;
|
|
79
|
-
proseElement: import("@jsprose/core").ProseElement<import("@jsprose/core").AnySchema>;
|
|
80
|
-
}) => string | undefined;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineSchema, ensureTagBlockChildren } from "tsprose";
|
|
2
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
4
|
+
import { paragraphWrap } from "../../shared/paragraphWrap.js";
|
|
5
5
|
export const calloutSchema = defineSchema({
|
|
6
6
|
name: "callout",
|
|
7
7
|
type: "block",
|
|
8
8
|
linkable: true
|
|
9
|
-
})
|
|
9
|
+
});
|
|
10
10
|
export const Callout = defineEruditTag({
|
|
11
11
|
tagName: "Callout",
|
|
12
12
|
schema: calloutSchema
|
|
13
|
-
})(({ element, tagName, props, children
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
})(({ element, tagName, props, children }) => {
|
|
14
|
+
const wrap = paragraphWrap(children);
|
|
15
|
+
if (wrap) {
|
|
16
|
+
element.children = wrap;
|
|
17
|
+
} else {
|
|
18
|
+
ensureTagBlockChildren(tagName, children);
|
|
19
|
+
element.children = children;
|
|
20
|
+
}
|
|
16
21
|
element.data = {
|
|
17
22
|
iconSrc: props.icon,
|
|
18
23
|
title: props.title
|
|
@@ -22,16 +27,12 @@ export const Callout = defineEruditTag({
|
|
|
22
27
|
element.data.iconInvert = props.invert;
|
|
23
28
|
}
|
|
24
29
|
});
|
|
25
|
-
export
|
|
30
|
+
export default defineProseCoreElement({
|
|
26
31
|
schema: calloutSchema,
|
|
27
|
-
tags: [Callout]
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
export const calloutIconSrcStep = defineResolveStep(({ rawElement }) => {
|
|
34
|
-
if (isRawElement(rawElement, calloutSchema)) {
|
|
35
|
-
return rawElement.data.iconSrc;
|
|
32
|
+
tags: [Callout],
|
|
33
|
+
rawToProseHook: ({ result }) => {
|
|
34
|
+
return { matchStep: ({ rawElement }) => {
|
|
35
|
+
result.files.add(rawElement.data.iconSrc);
|
|
36
|
+
} };
|
|
36
37
|
}
|
|
37
38
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { onMounted, useTemplateRef } from 'vue';
|
|
3
|
-
import { isProseElement, type
|
|
3
|
+
import { isProseElement, type ToProseElement } from 'tsprose';
|
|
4
4
|
|
|
5
|
-
import { captionSecondarySchema, type
|
|
5
|
+
import { captionSecondarySchema, type CaptionSchema } from './core.js';
|
|
6
6
|
import Render from '../../app/shared/Render.vue';
|
|
7
7
|
|
|
8
8
|
const { caption } = defineProps<{
|
|
9
|
-
caption:
|
|
9
|
+
caption: ToProseElement<CaptionSchema>;
|
|
10
10
|
}>();
|
|
11
11
|
|
|
12
12
|
const emit = defineEmits(['captionMounted']);
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "caption";
|
|
3
|
-
type: "inliner";
|
|
4
|
-
linkable: false;
|
|
5
|
-
Data: import("./core.js").CaptionData | undefined;
|
|
6
|
-
Storage: undefined;
|
|
7
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
8
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").CaptionSchema>;
|
|
9
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { captionSchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: captionSchema,
|
|
5
5
|
component: () => import("./Caption.vue")
|
|
6
6
|
});
|
|
@@ -1,114 +1,36 @@
|
|
|
1
|
-
import { type InlinerSchema, type
|
|
2
|
-
export
|
|
3
|
-
name:
|
|
4
|
-
type:
|
|
1
|
+
import { type InlinerSchema, type Schema } from 'tsprose';
|
|
2
|
+
export interface CaptionSecondarySchema extends Schema {
|
|
3
|
+
name: 'captionSecondary';
|
|
4
|
+
type: 'inliner';
|
|
5
5
|
linkable: false;
|
|
6
6
|
Data: undefined;
|
|
7
7
|
Storage: undefined;
|
|
8
8
|
Children: InlinerSchema[];
|
|
9
|
-
}
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Storage: undefined;
|
|
16
|
-
Children: InlinerSchema[];
|
|
17
|
-
}, TagChildren>;
|
|
18
|
-
export declare const captionSecondaryRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
19
|
-
name: "captionSecondary";
|
|
20
|
-
type: "inliner";
|
|
9
|
+
}
|
|
10
|
+
export declare const captionSecondarySchema: CaptionSecondarySchema;
|
|
11
|
+
export declare const CaptionSecondary: import("../../tag.js").ToEruditTag<CaptionSecondarySchema, "CaptionSecondary", unknown>;
|
|
12
|
+
export interface CaptionSchema extends Schema {
|
|
13
|
+
name: 'caption';
|
|
14
|
+
type: 'inliner';
|
|
21
15
|
linkable: false;
|
|
22
|
-
Data: undefined;
|
|
16
|
+
Data: CaptionData | undefined;
|
|
23
17
|
Storage: undefined;
|
|
24
18
|
Children: InlinerSchema[];
|
|
25
|
-
}
|
|
26
|
-
CaptionSecondary: import("@jsprose/core").Tag<"CaptionSecondary", {
|
|
27
|
-
name: "captionSecondary";
|
|
28
|
-
type: "inliner";
|
|
29
|
-
linkable: false;
|
|
30
|
-
Data: undefined;
|
|
31
|
-
Storage: undefined;
|
|
32
|
-
Children: InlinerSchema[];
|
|
33
|
-
}, TagChildren>;
|
|
34
|
-
}, undefined>;
|
|
19
|
+
}
|
|
35
20
|
export interface CaptionData {
|
|
36
21
|
width?: string;
|
|
37
22
|
}
|
|
38
|
-
export declare const captionSchema:
|
|
39
|
-
|
|
40
|
-
type: "inliner";
|
|
41
|
-
linkable: false;
|
|
42
|
-
Data: CaptionData | undefined;
|
|
43
|
-
Storage: undefined;
|
|
44
|
-
Children: InlinerSchema[];
|
|
45
|
-
};
|
|
46
|
-
export declare const Caption: import("@jsprose/core").Tag<"Caption", {
|
|
47
|
-
name: "caption";
|
|
48
|
-
type: "inliner";
|
|
49
|
-
linkable: false;
|
|
50
|
-
Data: CaptionData | undefined;
|
|
51
|
-
Storage: undefined;
|
|
52
|
-
Children: InlinerSchema[];
|
|
53
|
-
}, {
|
|
23
|
+
export declare const captionSchema: CaptionSchema;
|
|
24
|
+
export declare const Caption: import("../../tag.js").ToEruditTag<CaptionSchema, "Caption", {
|
|
54
25
|
width?: string;
|
|
55
|
-
}
|
|
56
|
-
export declare const captionRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
57
|
-
name: "caption";
|
|
58
|
-
type: "inliner";
|
|
59
|
-
linkable: false;
|
|
60
|
-
Data: CaptionData | undefined;
|
|
61
|
-
Storage: undefined;
|
|
62
|
-
Children: InlinerSchema[];
|
|
63
|
-
}, {
|
|
64
|
-
Caption: import("@jsprose/core").Tag<"Caption", {
|
|
65
|
-
name: "caption";
|
|
66
|
-
type: "inliner";
|
|
67
|
-
linkable: false;
|
|
68
|
-
Data: CaptionData | undefined;
|
|
69
|
-
Storage: undefined;
|
|
70
|
-
Children: InlinerSchema[];
|
|
71
|
-
}, {
|
|
72
|
-
width?: string;
|
|
73
|
-
} & TagChildren>;
|
|
74
|
-
}, undefined>;
|
|
26
|
+
}>;
|
|
75
27
|
declare const _default: [{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
type: "inliner";
|
|
79
|
-
linkable: false;
|
|
80
|
-
Data: CaptionData | undefined;
|
|
81
|
-
Storage: undefined;
|
|
82
|
-
Children: InlinerSchema[];
|
|
83
|
-
}, {
|
|
84
|
-
Caption: import("@jsprose/core").Tag<"Caption", {
|
|
85
|
-
name: "caption";
|
|
86
|
-
type: "inliner";
|
|
87
|
-
linkable: false;
|
|
88
|
-
Data: CaptionData | undefined;
|
|
89
|
-
Storage: undefined;
|
|
90
|
-
Children: InlinerSchema[];
|
|
91
|
-
}, {
|
|
92
|
-
width?: string;
|
|
93
|
-
} & TagChildren>;
|
|
94
|
-
}, undefined>;
|
|
28
|
+
readonly schema: CaptionSecondarySchema;
|
|
29
|
+
readonly tags: [import("../../tag.js").ToEruditTag<CaptionSecondarySchema, "CaptionSecondary", unknown>];
|
|
95
30
|
}, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Data: undefined;
|
|
101
|
-
Storage: undefined;
|
|
102
|
-
Children: InlinerSchema[];
|
|
103
|
-
}, {
|
|
104
|
-
CaptionSecondary: import("@jsprose/core").Tag<"CaptionSecondary", {
|
|
105
|
-
name: "captionSecondary";
|
|
106
|
-
type: "inliner";
|
|
107
|
-
linkable: false;
|
|
108
|
-
Data: undefined;
|
|
109
|
-
Storage: undefined;
|
|
110
|
-
Children: InlinerSchema[];
|
|
111
|
-
}, TagChildren>;
|
|
112
|
-
}, undefined>;
|
|
31
|
+
readonly schema: CaptionSchema;
|
|
32
|
+
readonly tags: [import("../../tag.js").ToEruditTag<CaptionSchema, "Caption", {
|
|
33
|
+
width?: string;
|
|
34
|
+
}>];
|
|
113
35
|
}];
|
|
114
36
|
export default _default;
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineSchema, ensureTagInlinerChildren, isRawElement } from "tsprose";
|
|
2
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
// Caption Secondary
|
|
6
|
-
//
|
|
3
|
+
import { EruditProseError } from "../../error.js";
|
|
4
|
+
import { defineProseCoreElements } from "../../coreElement.js";
|
|
7
5
|
export const captionSecondarySchema = defineSchema({
|
|
8
6
|
name: "captionSecondary",
|
|
9
7
|
type: "inliner",
|
|
10
8
|
linkable: false
|
|
11
|
-
})
|
|
9
|
+
});
|
|
12
10
|
export const CaptionSecondary = defineEruditTag({
|
|
13
11
|
tagName: "CaptionSecondary",
|
|
14
12
|
schema: captionSecondarySchema
|
|
15
|
-
})(({ element, tagName, children
|
|
16
|
-
ensureTagInlinerChildren(tagName, children
|
|
13
|
+
})(({ element, tagName, children }) => {
|
|
14
|
+
ensureTagInlinerChildren(tagName, children);
|
|
17
15
|
element.children = children;
|
|
18
16
|
});
|
|
19
|
-
export const captionSecondaryRegistryItem = defineRegistryItem({
|
|
20
|
-
schema: captionSecondarySchema,
|
|
21
|
-
tags: [CaptionSecondary]
|
|
22
|
-
});
|
|
23
17
|
export const captionSchema = defineSchema({
|
|
24
18
|
name: "caption",
|
|
25
19
|
type: "inliner",
|
|
26
20
|
linkable: false
|
|
27
|
-
})
|
|
21
|
+
});
|
|
28
22
|
export const Caption = defineEruditTag({
|
|
29
23
|
tagName: "Caption",
|
|
30
24
|
schema: captionSchema
|
|
31
|
-
})(({ tagName, element, props, children
|
|
32
|
-
ensureTagInlinerChildren(tagName, children
|
|
25
|
+
})(({ tagName, element, props, children }) => {
|
|
26
|
+
ensureTagInlinerChildren(tagName, children);
|
|
33
27
|
let containsNonSecondary = false;
|
|
34
28
|
let containsSecondary = false;
|
|
35
29
|
for (const child of children) {
|
|
36
30
|
if (isRawElement(child, captionSecondarySchema)) {
|
|
37
31
|
if (containsSecondary) {
|
|
38
|
-
throw new
|
|
32
|
+
throw new EruditProseError(`Duplicate <${CaptionSecondary.tagName}> detected!`);
|
|
39
33
|
}
|
|
40
34
|
containsSecondary = true;
|
|
41
35
|
} else {
|
|
@@ -43,7 +37,7 @@ export const Caption = defineEruditTag({
|
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
39
|
if (containsSecondary && !containsNonSecondary) {
|
|
46
|
-
throw new
|
|
40
|
+
throw new EruditProseError(`Cannot have a <${CaptionSecondary.tagName}> without a main caption content!`);
|
|
47
41
|
}
|
|
48
42
|
element.children = children;
|
|
49
43
|
if (props.width) {
|
|
@@ -51,11 +45,13 @@ export const Caption = defineEruditTag({
|
|
|
51
45
|
element.data.width = props.width;
|
|
52
46
|
}
|
|
53
47
|
});
|
|
54
|
-
|
|
48
|
+
//
|
|
49
|
+
// Core Elements
|
|
50
|
+
//
|
|
51
|
+
export default defineProseCoreElements({
|
|
52
|
+
schema: captionSecondarySchema,
|
|
53
|
+
tags: [CaptionSecondary]
|
|
54
|
+
}, {
|
|
55
55
|
schema: captionSchema,
|
|
56
56
|
tags: [Caption]
|
|
57
57
|
});
|
|
58
|
-
//
|
|
59
|
-
// Erudit Core Elements
|
|
60
|
-
//
|
|
61
|
-
export default defineEruditProseCoreElements({ registryItem: captionRegistryItem }, { registryItem: captionSecondaryRegistryItem });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type {
|
|
2
|
+
import type { ToProseElement } from 'tsprose';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { DetailsSchema } from './core.js';
|
|
5
5
|
import { useFormatText } from '../../app/composables/formatText.js';
|
|
6
6
|
import { useProseContext } from '../../app/composables/context.js';
|
|
7
7
|
import {
|
|
@@ -14,7 +14,7 @@ import Block from '../../app/shared/block/Block.vue';
|
|
|
14
14
|
import Render from '../../app/shared/Render.vue';
|
|
15
15
|
|
|
16
16
|
const { element } = defineProps<{
|
|
17
|
-
element:
|
|
17
|
+
element: ToProseElement<DetailsSchema>;
|
|
18
18
|
}>();
|
|
19
19
|
|
|
20
20
|
const { EruditIcon } = useProseContext();
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "details";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: true;
|
|
5
|
-
Data: import("./core.js").DetailsData;
|
|
6
|
-
Storage: undefined;
|
|
7
|
-
Children: import("@jsprose/core").AnySchema[];
|
|
8
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").DetailsSchema>;
|
|
9
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { detailsSchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: detailsSchema,
|
|
5
5
|
component: () => import("./Details.vue"),
|
|
6
6
|
languages: {
|
|
@@ -1,68 +1,25 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import
|
|
1
|
+
import { type BlockSchema, type Schema } from 'tsprose';
|
|
2
|
+
import type { NoToc } from '../../toc.js';
|
|
3
|
+
import type { NoSnippet } from '../../snippet.js';
|
|
4
|
+
export interface DetailsSchema extends Schema {
|
|
5
|
+
name: 'details';
|
|
6
|
+
type: 'block';
|
|
7
|
+
linkable: 'always';
|
|
8
|
+
Data: DetailsData;
|
|
9
|
+
Storage: undefined;
|
|
10
|
+
Children: BlockSchema[];
|
|
11
|
+
}
|
|
3
12
|
export interface DetailsData {
|
|
4
13
|
title?: string;
|
|
5
14
|
}
|
|
6
|
-
export declare const detailsSchema:
|
|
7
|
-
|
|
8
|
-
type: "block";
|
|
9
|
-
linkable: true;
|
|
10
|
-
Data: DetailsData;
|
|
11
|
-
Storage: undefined;
|
|
12
|
-
Children: AnySchema[];
|
|
13
|
-
};
|
|
14
|
-
export declare const detailsTagName = "Details";
|
|
15
|
-
export declare const Details: Tag<"Details", {
|
|
16
|
-
name: "details";
|
|
17
|
-
type: "block";
|
|
18
|
-
linkable: true;
|
|
19
|
-
Data: DetailsData;
|
|
20
|
-
Storage: undefined;
|
|
21
|
-
Children: AnySchema[];
|
|
22
|
-
}, {
|
|
15
|
+
export declare const detailsSchema: DetailsSchema;
|
|
16
|
+
export declare const Details: import("../../tag.js").ToEruditTag<DetailsSchema, "Details", {
|
|
23
17
|
title?: string;
|
|
24
|
-
|
|
25
|
-
} & TagChildren & NoToc & NoSnippet>;
|
|
26
|
-
export declare const detailsRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
27
|
-
name: "details";
|
|
28
|
-
type: "block";
|
|
29
|
-
linkable: true;
|
|
30
|
-
Data: DetailsData;
|
|
31
|
-
Storage: undefined;
|
|
32
|
-
Children: AnySchema[];
|
|
33
|
-
}, {
|
|
34
|
-
Details: Tag<"Details", {
|
|
35
|
-
name: "details";
|
|
36
|
-
type: "block";
|
|
37
|
-
linkable: true;
|
|
38
|
-
Data: DetailsData;
|
|
39
|
-
Storage: undefined;
|
|
40
|
-
Children: AnySchema[];
|
|
41
|
-
}, {
|
|
42
|
-
title?: string;
|
|
43
|
-
$: Unique<Tag<typeof detailsTagName, typeof detailsSchema, any>>;
|
|
44
|
-
} & TagChildren & NoToc & NoSnippet>;
|
|
45
|
-
}, undefined>;
|
|
18
|
+
} & NoToc & NoSnippet>;
|
|
46
19
|
declare const _default: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Data: DetailsData;
|
|
52
|
-
Storage: undefined;
|
|
53
|
-
Children: AnySchema[];
|
|
54
|
-
}, {
|
|
55
|
-
Details: Tag<"Details", {
|
|
56
|
-
name: "details";
|
|
57
|
-
type: "block";
|
|
58
|
-
linkable: true;
|
|
59
|
-
Data: DetailsData;
|
|
60
|
-
Storage: undefined;
|
|
61
|
-
Children: AnySchema[];
|
|
62
|
-
}, {
|
|
63
|
-
title?: string;
|
|
64
|
-
$: Unique<Tag<typeof detailsTagName, typeof detailsSchema, any>>;
|
|
65
|
-
} & TagChildren & NoToc & NoSnippet>;
|
|
66
|
-
}, undefined>;
|
|
20
|
+
readonly schema: DetailsSchema;
|
|
21
|
+
readonly tags: [import("../../tag.js").ToEruditTag<DetailsSchema, "Details", {
|
|
22
|
+
title?: string;
|
|
23
|
+
} & NoToc & NoSnippet>];
|
|
67
24
|
};
|
|
68
25
|
export default _default;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineEruditProseCoreElement } from "../../coreElement.js";
|
|
1
|
+
import { defineSchema, ensureTagBlockChildren } from "tsprose";
|
|
3
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
+
import { EruditProseError } from "../../error.js";
|
|
4
|
+
import { paragraphWrap } from "../../shared/paragraphWrap.js";
|
|
5
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
4
6
|
export const detailsSchema = defineSchema({
|
|
5
7
|
name: "details",
|
|
6
8
|
type: "block",
|
|
7
|
-
linkable:
|
|
8
|
-
})
|
|
9
|
-
export const detailsTagName = "Details";
|
|
9
|
+
linkable: "always"
|
|
10
|
+
});
|
|
10
11
|
export const Details = defineEruditTag({
|
|
11
|
-
tagName:
|
|
12
|
+
tagName: "Details",
|
|
12
13
|
schema: detailsSchema
|
|
13
14
|
})(({ element, tagName, children, props }) => {
|
|
14
15
|
if (!element.uniqueName) {
|
|
15
|
-
throw new
|
|
16
|
+
throw new EruditProseError(`<${tagName}> must be connected to unique!`);
|
|
17
|
+
}
|
|
18
|
+
const wrap = paragraphWrap(children);
|
|
19
|
+
if (wrap) {
|
|
20
|
+
element.children = wrap;
|
|
21
|
+
} else {
|
|
22
|
+
ensureTagBlockChildren(tagName, children);
|
|
23
|
+
element.children = children;
|
|
16
24
|
}
|
|
17
|
-
ensureTagChildren(tagName, children);
|
|
18
|
-
element.children = children;
|
|
19
25
|
const title = props.title?.trim();
|
|
20
26
|
if (title) {
|
|
21
27
|
element.data = { title };
|
|
@@ -23,8 +29,7 @@ export const Details = defineEruditTag({
|
|
|
23
29
|
element.title = title;
|
|
24
30
|
}
|
|
25
31
|
});
|
|
26
|
-
export
|
|
32
|
+
export default defineProseCoreElement({
|
|
27
33
|
schema: detailsSchema,
|
|
28
34
|
tags: [Details]
|
|
29
35
|
});
|
|
30
|
-
export default defineEruditProseCoreElement({ registryItem: detailsRegistryItem });
|