@erudit-js/prose 4.1.1 → 4.2.0
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 +6 -6
- package/dist/elements/link/core.js +4 -3
- 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 +27 -105
- 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 -58
- 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 +31 -4
- 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 +8 -7
- 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 → raw.d.ts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineSchema, ensureTagBlockChildren } from "tsprose";
|
|
2
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
-
import {
|
|
3
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
4
4
|
export const flexSchema = defineSchema({
|
|
5
5
|
name: "flex",
|
|
6
6
|
type: "block",
|
|
7
7
|
linkable: true
|
|
8
|
-
})
|
|
8
|
+
});
|
|
9
9
|
export const Flex = defineEruditTag({
|
|
10
10
|
tagName: "Flex",
|
|
11
11
|
schema: flexSchema
|
|
12
|
-
})(({ element, tagName, children, props
|
|
13
|
-
ensureTagBlockChildren(tagName, children
|
|
12
|
+
})(({ element, tagName, children, props }) => {
|
|
13
|
+
ensureTagBlockChildren(tagName, children);
|
|
14
14
|
element.children = children;
|
|
15
15
|
if (props.gap) {
|
|
16
16
|
element.data = element.data || {};
|
|
@@ -25,8 +25,7 @@ export const Flex = defineEruditTag({
|
|
|
25
25
|
element.data.flexes = props.flexes;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
export
|
|
28
|
+
export default defineProseCoreElement({
|
|
29
29
|
schema: flexSchema,
|
|
30
30
|
tags: [Flex]
|
|
31
31
|
});
|
|
32
|
-
export default defineEruditProseCoreElement({ registryItem: flexRegistryItem });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { ref } from 'vue';
|
|
3
|
-
import type { ProseElement } from '@jsprose/core';
|
|
4
3
|
|
|
5
|
-
import type {
|
|
4
|
+
import type { GallerySchema } from './core.js';
|
|
6
5
|
import { useElementStorage } from '../../app/composables/storage.js';
|
|
7
6
|
import { darkInvert, lightInvert } from '../../app/shared/invert.js';
|
|
8
7
|
import Block from '../../app/shared/block/Block.vue';
|
|
9
8
|
import ImageElement from '../image/ImageElement.vue';
|
|
9
|
+
import type { ToProseElement } from 'tsprose';
|
|
10
10
|
|
|
11
11
|
const { element } = defineProps<{
|
|
12
|
-
element:
|
|
12
|
+
element: ToProseElement<GallerySchema>;
|
|
13
13
|
}>();
|
|
14
14
|
|
|
15
15
|
const resolvedSources: string[] = [];
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "gallery";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: true;
|
|
5
|
-
Data: undefined;
|
|
6
|
-
Storage: undefined;
|
|
7
|
-
Children: {
|
|
8
|
-
name: "image";
|
|
9
|
-
type: "block";
|
|
10
|
-
linkable: true;
|
|
11
|
-
Data: import("../image/core.js").ImageData;
|
|
12
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
13
|
-
Children: [{
|
|
14
|
-
name: "caption";
|
|
15
|
-
type: "inliner";
|
|
16
|
-
linkable: false;
|
|
17
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
18
|
-
Storage: undefined;
|
|
19
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
20
|
-
}] | undefined;
|
|
21
|
-
}[];
|
|
22
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").GallerySchema>;
|
|
23
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { gallerySchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: gallerySchema,
|
|
5
5
|
component: () => import("./Gallery.vue"),
|
|
6
6
|
languages: {
|
|
@@ -1,138 +1,17 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type Schema } from 'tsprose';
|
|
2
|
+
import { imageSchema } from '../image/core.js';
|
|
3
|
+
export interface GallerySchema extends Schema {
|
|
4
|
+
name: 'gallery';
|
|
5
|
+
type: 'block';
|
|
5
6
|
linkable: true;
|
|
6
7
|
Data: undefined;
|
|
7
8
|
Storage: undefined;
|
|
8
|
-
Children:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Data: import("../image/core.js").ImageData;
|
|
13
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
14
|
-
Children: [{
|
|
15
|
-
name: "caption";
|
|
16
|
-
type: "inliner";
|
|
17
|
-
linkable: false;
|
|
18
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
19
|
-
Storage: undefined;
|
|
20
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
21
|
-
}] | undefined;
|
|
22
|
-
}[];
|
|
23
|
-
};
|
|
24
|
-
export declare const Gallery: import("@jsprose/core").Tag<"Gallery", {
|
|
25
|
-
name: "gallery";
|
|
26
|
-
type: "block";
|
|
27
|
-
linkable: true;
|
|
28
|
-
Data: undefined;
|
|
29
|
-
Storage: undefined;
|
|
30
|
-
Children: {
|
|
31
|
-
name: "image";
|
|
32
|
-
type: "block";
|
|
33
|
-
linkable: true;
|
|
34
|
-
Data: import("../image/core.js").ImageData;
|
|
35
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
36
|
-
Children: [{
|
|
37
|
-
name: "caption";
|
|
38
|
-
type: "inliner";
|
|
39
|
-
linkable: false;
|
|
40
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
41
|
-
Storage: undefined;
|
|
42
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
43
|
-
}] | undefined;
|
|
44
|
-
}[];
|
|
45
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
46
|
-
export declare const galleryRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
47
|
-
name: "gallery";
|
|
48
|
-
type: "block";
|
|
49
|
-
linkable: true;
|
|
50
|
-
Data: undefined;
|
|
51
|
-
Storage: undefined;
|
|
52
|
-
Children: {
|
|
53
|
-
name: "image";
|
|
54
|
-
type: "block";
|
|
55
|
-
linkable: true;
|
|
56
|
-
Data: import("../image/core.js").ImageData;
|
|
57
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
58
|
-
Children: [{
|
|
59
|
-
name: "caption";
|
|
60
|
-
type: "inliner";
|
|
61
|
-
linkable: false;
|
|
62
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
63
|
-
Storage: undefined;
|
|
64
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
65
|
-
}] | undefined;
|
|
66
|
-
}[];
|
|
67
|
-
}, {
|
|
68
|
-
Gallery: import("@jsprose/core").Tag<"Gallery", {
|
|
69
|
-
name: "gallery";
|
|
70
|
-
type: "block";
|
|
71
|
-
linkable: true;
|
|
72
|
-
Data: undefined;
|
|
73
|
-
Storage: undefined;
|
|
74
|
-
Children: {
|
|
75
|
-
name: "image";
|
|
76
|
-
type: "block";
|
|
77
|
-
linkable: true;
|
|
78
|
-
Data: import("../image/core.js").ImageData;
|
|
79
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
80
|
-
Children: [{
|
|
81
|
-
name: "caption";
|
|
82
|
-
type: "inliner";
|
|
83
|
-
linkable: false;
|
|
84
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
85
|
-
Storage: undefined;
|
|
86
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
87
|
-
}] | undefined;
|
|
88
|
-
}[];
|
|
89
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
90
|
-
}, undefined>;
|
|
9
|
+
Children: (typeof imageSchema)[];
|
|
10
|
+
}
|
|
11
|
+
export declare const gallerySchema: GallerySchema;
|
|
12
|
+
export declare const Gallery: import("../../tag.js").ToEruditTag<GallerySchema, "Gallery", unknown>;
|
|
91
13
|
declare const _default: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
type: "block";
|
|
95
|
-
linkable: true;
|
|
96
|
-
Data: undefined;
|
|
97
|
-
Storage: undefined;
|
|
98
|
-
Children: {
|
|
99
|
-
name: "image";
|
|
100
|
-
type: "block";
|
|
101
|
-
linkable: true;
|
|
102
|
-
Data: import("../image/core.js").ImageData;
|
|
103
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
104
|
-
Children: [{
|
|
105
|
-
name: "caption";
|
|
106
|
-
type: "inliner";
|
|
107
|
-
linkable: false;
|
|
108
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
109
|
-
Storage: undefined;
|
|
110
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
111
|
-
}] | undefined;
|
|
112
|
-
}[];
|
|
113
|
-
}, {
|
|
114
|
-
Gallery: import("@jsprose/core").Tag<"Gallery", {
|
|
115
|
-
name: "gallery";
|
|
116
|
-
type: "block";
|
|
117
|
-
linkable: true;
|
|
118
|
-
Data: undefined;
|
|
119
|
-
Storage: undefined;
|
|
120
|
-
Children: {
|
|
121
|
-
name: "image";
|
|
122
|
-
type: "block";
|
|
123
|
-
linkable: true;
|
|
124
|
-
Data: import("../image/core.js").ImageData;
|
|
125
|
-
Storage: import("../image/core.js").ImageStorage;
|
|
126
|
-
Children: [{
|
|
127
|
-
name: "caption";
|
|
128
|
-
type: "inliner";
|
|
129
|
-
linkable: false;
|
|
130
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
131
|
-
Storage: undefined;
|
|
132
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
133
|
-
}] | undefined;
|
|
134
|
-
}[];
|
|
135
|
-
}, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
|
|
136
|
-
}, undefined>;
|
|
14
|
+
readonly schema: GallerySchema;
|
|
15
|
+
readonly tags: [import("../../tag.js").ToEruditTag<GallerySchema, "Gallery", unknown>];
|
|
137
16
|
};
|
|
138
17
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineSchema, ensureTagChildren } from "tsprose";
|
|
2
2
|
import { imageSchema } from "../image/core.js";
|
|
3
3
|
import { defineEruditTag } from "../../tag.js";
|
|
4
|
-
import {
|
|
4
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
5
5
|
export const gallerySchema = defineSchema({
|
|
6
6
|
name: "gallery",
|
|
7
7
|
type: "block",
|
|
8
8
|
linkable: true
|
|
9
|
-
})
|
|
9
|
+
});
|
|
10
10
|
export const Gallery = defineEruditTag({
|
|
11
11
|
tagName: "Gallery",
|
|
12
12
|
schema: gallerySchema
|
|
@@ -14,8 +14,7 @@ export const Gallery = defineEruditTag({
|
|
|
14
14
|
ensureTagChildren(tagName, children, imageSchema);
|
|
15
15
|
element.children = children;
|
|
16
16
|
});
|
|
17
|
-
export
|
|
17
|
+
export default defineProseCoreElement({
|
|
18
18
|
schema: gallerySchema,
|
|
19
19
|
tags: [Gallery]
|
|
20
20
|
});
|
|
21
|
-
export default defineEruditProseCoreElement({ registryItem: galleryRegistryItem });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { h } from 'vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToProseElement } from 'tsprose';
|
|
4
4
|
|
|
5
5
|
import { useFormatText } from '../../app/composables/formatText.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { HeadingSchema } from './core.js';
|
|
7
7
|
import Block from '../../app/shared/block/Block.vue';
|
|
8
8
|
|
|
9
9
|
const { element } = defineProps<{
|
|
10
|
-
element:
|
|
10
|
+
element: ToProseElement<HeadingSchema>;
|
|
11
11
|
}>();
|
|
12
12
|
|
|
13
13
|
const formatText = useFormatText();
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "heading";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: true;
|
|
5
|
-
Data: import("./core.js").HeadingData;
|
|
6
|
-
Storage: undefined;
|
|
7
|
-
Children: undefined;
|
|
8
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").HeadingSchema>;
|
|
9
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { headingSchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: headingSchema,
|
|
5
5
|
component: () => import("./Heading.vue"),
|
|
6
6
|
languages: {
|
|
@@ -1,108 +1,24 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
name:
|
|
5
|
-
type:
|
|
1
|
+
import { type RequiredChildren, type Schema } from 'tsprose';
|
|
2
|
+
import type { NoToc } from '../../toc.js';
|
|
3
|
+
export interface HeadingSchema extends Schema {
|
|
4
|
+
name: 'heading';
|
|
5
|
+
type: 'block';
|
|
6
6
|
linkable: true;
|
|
7
7
|
Data: HeadingData;
|
|
8
8
|
Storage: undefined;
|
|
9
9
|
Children: undefined;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
export declare const headingSchema: HeadingSchema;
|
|
11
12
|
export interface HeadingData {
|
|
12
13
|
level: 1 | 2 | 3;
|
|
13
14
|
title: string;
|
|
14
15
|
}
|
|
15
|
-
export type HeadingProps =
|
|
16
|
-
export declare const H1: import("
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
linkable: true;
|
|
20
|
-
Data: HeadingData;
|
|
21
|
-
Storage: undefined;
|
|
22
|
-
Children: undefined;
|
|
23
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
24
|
-
export declare const H2: import("@jsprose/core").Tag<"H2", {
|
|
25
|
-
name: "heading";
|
|
26
|
-
type: "block";
|
|
27
|
-
linkable: true;
|
|
28
|
-
Data: HeadingData;
|
|
29
|
-
Storage: undefined;
|
|
30
|
-
Children: undefined;
|
|
31
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
32
|
-
export declare const H3: import("@jsprose/core").Tag<"H3", {
|
|
33
|
-
name: "heading";
|
|
34
|
-
type: "block";
|
|
35
|
-
linkable: true;
|
|
36
|
-
Data: HeadingData;
|
|
37
|
-
Storage: undefined;
|
|
38
|
-
Children: undefined;
|
|
39
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
40
|
-
export declare const headingRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
41
|
-
name: "heading";
|
|
42
|
-
type: "block";
|
|
43
|
-
linkable: true;
|
|
44
|
-
Data: HeadingData;
|
|
45
|
-
Storage: undefined;
|
|
46
|
-
Children: undefined;
|
|
47
|
-
}, {
|
|
48
|
-
H1: import("@jsprose/core").Tag<"H1", {
|
|
49
|
-
name: "heading";
|
|
50
|
-
type: "block";
|
|
51
|
-
linkable: true;
|
|
52
|
-
Data: HeadingData;
|
|
53
|
-
Storage: undefined;
|
|
54
|
-
Children: undefined;
|
|
55
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
56
|
-
H2: import("@jsprose/core").Tag<"H2", {
|
|
57
|
-
name: "heading";
|
|
58
|
-
type: "block";
|
|
59
|
-
linkable: true;
|
|
60
|
-
Data: HeadingData;
|
|
61
|
-
Storage: undefined;
|
|
62
|
-
Children: undefined;
|
|
63
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
64
|
-
H3: import("@jsprose/core").Tag<"H3", {
|
|
65
|
-
name: "heading";
|
|
66
|
-
type: "block";
|
|
67
|
-
linkable: true;
|
|
68
|
-
Data: HeadingData;
|
|
69
|
-
Storage: undefined;
|
|
70
|
-
Children: undefined;
|
|
71
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
72
|
-
}, undefined>;
|
|
16
|
+
export type HeadingProps = NoToc & RequiredChildren;
|
|
17
|
+
export declare const H1: import("../../tag.js").ToEruditTag<HeadingSchema, "H1", HeadingProps>;
|
|
18
|
+
export declare const H2: import("../../tag.js").ToEruditTag<HeadingSchema, "H2", HeadingProps>;
|
|
19
|
+
export declare const H3: import("../../tag.js").ToEruditTag<HeadingSchema, "H3", HeadingProps>;
|
|
73
20
|
declare const _default: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
type: "block";
|
|
77
|
-
linkable: true;
|
|
78
|
-
Data: HeadingData;
|
|
79
|
-
Storage: undefined;
|
|
80
|
-
Children: undefined;
|
|
81
|
-
}, {
|
|
82
|
-
H1: import("@jsprose/core").Tag<"H1", {
|
|
83
|
-
name: "heading";
|
|
84
|
-
type: "block";
|
|
85
|
-
linkable: true;
|
|
86
|
-
Data: HeadingData;
|
|
87
|
-
Storage: undefined;
|
|
88
|
-
Children: undefined;
|
|
89
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
90
|
-
H2: import("@jsprose/core").Tag<"H2", {
|
|
91
|
-
name: "heading";
|
|
92
|
-
type: "block";
|
|
93
|
-
linkable: true;
|
|
94
|
-
Data: HeadingData;
|
|
95
|
-
Storage: undefined;
|
|
96
|
-
Children: undefined;
|
|
97
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
98
|
-
H3: import("@jsprose/core").Tag<"H3", {
|
|
99
|
-
name: "heading";
|
|
100
|
-
type: "block";
|
|
101
|
-
linkable: true;
|
|
102
|
-
Data: HeadingData;
|
|
103
|
-
Storage: undefined;
|
|
104
|
-
Children: undefined;
|
|
105
|
-
}, TagChildren & NoToc & import("../../snippet.js").ObjPropSnippet>;
|
|
106
|
-
}, undefined>;
|
|
21
|
+
readonly schema: HeadingSchema;
|
|
22
|
+
readonly tags: [import("../../tag.js").ToEruditTag<HeadingSchema, "H1", HeadingProps>, import("../../tag.js").ToEruditTag<HeadingSchema, "H2", HeadingProps>, import("../../tag.js").ToEruditTag<HeadingSchema, "H3", HeadingProps>];
|
|
107
23
|
};
|
|
108
24
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineSchema, ensureTagSingleChild, textSchema } from "tsprose";
|
|
2
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
-
import {
|
|
3
|
+
import { EruditProseError } from "../../error.js";
|
|
4
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
4
5
|
export const headingSchema = defineSchema({
|
|
5
6
|
name: "heading",
|
|
6
7
|
type: "block",
|
|
7
8
|
linkable: true
|
|
8
|
-
})
|
|
9
|
+
});
|
|
9
10
|
export const H1 = defineEruditTag({
|
|
10
11
|
tagName: "H1",
|
|
11
12
|
schema: headingSchema
|
|
@@ -25,20 +26,20 @@ export const H3 = defineEruditTag({
|
|
|
25
26
|
processHeadingElement(3, tagName, element, children);
|
|
26
27
|
});
|
|
27
28
|
function processHeadingElement(level, tagName, element, children) {
|
|
28
|
-
|
|
29
|
+
ensureTagSingleChild(tagName, children, textSchema);
|
|
29
30
|
const child = children[0];
|
|
30
31
|
const title = child.data.trim();
|
|
31
32
|
if (!title) {
|
|
32
|
-
throw new
|
|
33
|
+
throw new EruditProseError(`<${tagName}> title cannot be empty!`);
|
|
33
34
|
}
|
|
34
35
|
element.data = {
|
|
35
36
|
level,
|
|
36
37
|
title
|
|
37
38
|
};
|
|
38
39
|
element.title = title;
|
|
39
|
-
element.toc =
|
|
40
|
+
element.toc = true;
|
|
40
41
|
}
|
|
41
|
-
export
|
|
42
|
+
export default defineProseCoreElement({
|
|
42
43
|
schema: headingSchema,
|
|
43
44
|
tags: [
|
|
44
45
|
H1,
|
|
@@ -46,4 +47,3 @@ export const headingRegistryItem = defineRegistryItem({
|
|
|
46
47
|
H3
|
|
47
48
|
]
|
|
48
49
|
});
|
|
49
|
-
export default defineEruditProseCoreElement({ registryItem: headingRegistryItem });
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "hr";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: false;
|
|
5
|
-
Data: undefined;
|
|
6
|
-
Storage: undefined;
|
|
7
|
-
Children: undefined;
|
|
8
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").HrSchema>;
|
|
9
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineProseAppElement } from "../../app/appElement.js";
|
|
2
2
|
import { hrSchema } from "./core.js";
|
|
3
|
-
export default
|
|
3
|
+
export default defineProseAppElement({
|
|
4
4
|
schema: hrSchema,
|
|
5
5
|
component: () => import("./HorizontalLine.vue")
|
|
6
6
|
});
|
|
@@ -1,54 +1,16 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export
|
|
3
|
-
name:
|
|
4
|
-
type:
|
|
1
|
+
import { type Schema } from 'tsprose';
|
|
2
|
+
export interface HrSchema extends Schema {
|
|
3
|
+
name: 'hr';
|
|
4
|
+
type: 'block';
|
|
5
5
|
linkable: false;
|
|
6
6
|
Data: undefined;
|
|
7
7
|
Storage: undefined;
|
|
8
8
|
Children: undefined;
|
|
9
|
-
}
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
type: "block";
|
|
13
|
-
linkable: false;
|
|
14
|
-
Data: undefined;
|
|
15
|
-
Storage: undefined;
|
|
16
|
-
Children: undefined;
|
|
17
|
-
}, NoTagChildren>;
|
|
18
|
-
export declare const hrRegistryItem: import("@jsprose/core").RegistryItem<{
|
|
19
|
-
name: "hr";
|
|
20
|
-
type: "block";
|
|
21
|
-
linkable: false;
|
|
22
|
-
Data: undefined;
|
|
23
|
-
Storage: undefined;
|
|
24
|
-
Children: undefined;
|
|
25
|
-
}, {
|
|
26
|
-
Hr: import("@jsprose/core").Tag<"Hr", {
|
|
27
|
-
name: "hr";
|
|
28
|
-
type: "block";
|
|
29
|
-
linkable: false;
|
|
30
|
-
Data: undefined;
|
|
31
|
-
Storage: undefined;
|
|
32
|
-
Children: undefined;
|
|
33
|
-
}, NoTagChildren>;
|
|
34
|
-
}, undefined>;
|
|
9
|
+
}
|
|
10
|
+
export declare const hrSchema: HrSchema;
|
|
11
|
+
export declare const Hr: import("../../tag.js").ToEruditTag<HrSchema, "Hr", unknown>;
|
|
35
12
|
declare const _default: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: "block";
|
|
39
|
-
linkable: false;
|
|
40
|
-
Data: undefined;
|
|
41
|
-
Storage: undefined;
|
|
42
|
-
Children: undefined;
|
|
43
|
-
}, {
|
|
44
|
-
Hr: import("@jsprose/core").Tag<"Hr", {
|
|
45
|
-
name: "hr";
|
|
46
|
-
type: "block";
|
|
47
|
-
linkable: false;
|
|
48
|
-
Data: undefined;
|
|
49
|
-
Storage: undefined;
|
|
50
|
-
Children: undefined;
|
|
51
|
-
}, NoTagChildren>;
|
|
52
|
-
}, undefined>;
|
|
13
|
+
readonly schema: HrSchema;
|
|
14
|
+
readonly tags: [import("../../tag.js").ToEruditTag<HrSchema, "Hr", unknown>];
|
|
53
15
|
};
|
|
54
16
|
export default _default;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineEruditProseCoreElement } from "../../coreElement.js";
|
|
1
|
+
import { defineSchema, ensureTagNoChildren } from "tsprose";
|
|
3
2
|
import { defineEruditTag } from "../../tag.js";
|
|
3
|
+
import { defineProseCoreElement } from "../../coreElement.js";
|
|
4
4
|
export const hrSchema = defineSchema({
|
|
5
5
|
name: "hr",
|
|
6
6
|
type: "block",
|
|
7
7
|
linkable: false
|
|
8
|
-
})
|
|
8
|
+
});
|
|
9
9
|
export const Hr = defineEruditTag({
|
|
10
10
|
tagName: "Hr",
|
|
11
11
|
schema: hrSchema
|
|
12
12
|
})(({ tagName, children }) => {
|
|
13
13
|
ensureTagNoChildren(tagName, children);
|
|
14
14
|
});
|
|
15
|
-
export
|
|
15
|
+
export default defineProseCoreElement({
|
|
16
16
|
schema: hrSchema,
|
|
17
17
|
tags: [Hr]
|
|
18
18
|
});
|
|
19
|
-
export default defineEruditProseCoreElement({ registryItem: hrRegistryItem });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { ToProseElement } from 'tsprose';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { ImageSchema } from './core.js';
|
|
5
5
|
import Block from '../../app/shared/block/Block.vue';
|
|
6
6
|
import ImageElement from './ImageElement.vue';
|
|
7
7
|
|
|
8
|
-
defineProps<{ element:
|
|
8
|
+
defineProps<{ element: ToProseElement<ImageSchema> }>();
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { shallowRef } from 'vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToProseElement } from 'tsprose';
|
|
4
4
|
|
|
5
|
-
import type { imageSchema } from './core.js';
|
|
5
|
+
import type { ImageSchema, imageSchema } from './core.js';
|
|
6
6
|
import { useElementStorage } from '../../app/composables/storage.js';
|
|
7
7
|
import { usePhotoSwipe } from '../../app/shared/photoswipe/composable.js';
|
|
8
8
|
import { lightInvert, darkInvert } from '../../app/shared/invert.js';
|
|
9
9
|
import Caption from '../caption/Caption.vue';
|
|
10
10
|
|
|
11
11
|
const { element } = defineProps<{
|
|
12
|
-
element:
|
|
12
|
+
element: ToProseElement<ImageSchema>;
|
|
13
13
|
}>();
|
|
14
|
-
const imageStorage = await useElementStorage
|
|
14
|
+
const imageStorage = await useElementStorage(element);
|
|
15
15
|
|
|
16
16
|
const captionElement = shallowRef<HTMLElement>();
|
|
17
17
|
const { lightbox, initLightbox } = usePhotoSwipe();
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
declare const _default: import("../../app/appElement.js").
|
|
2
|
-
name: "image";
|
|
3
|
-
type: "block";
|
|
4
|
-
linkable: true;
|
|
5
|
-
Data: import("./core.js").ImageData;
|
|
6
|
-
Storage: import("./core.js").ImageStorage;
|
|
7
|
-
Children: [{
|
|
8
|
-
name: "caption";
|
|
9
|
-
type: "inliner";
|
|
10
|
-
linkable: false;
|
|
11
|
-
Data: import("../caption/core.js").CaptionData | undefined;
|
|
12
|
-
Storage: undefined;
|
|
13
|
-
Children: import("@jsprose/core").InlinerSchema[];
|
|
14
|
-
}] | undefined;
|
|
15
|
-
}>;
|
|
1
|
+
declare const _default: import("../../app/appElement.js").ProseAppElement<import("./core.js").ImageSchema>;
|
|
16
2
|
export default _default;
|