@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.
Files changed (208) hide show
  1. package/dist/app/appElement.d.ts +7 -6
  2. package/dist/app/appElement.js +1 -1
  3. package/dist/app/composables/anchor.d.ts +7 -7
  4. package/dist/app/composables/appElement.d.ts +4 -4
  5. package/dist/app/composables/appElement.js +3 -3
  6. package/dist/app/composables/context.d.ts +3 -2
  7. package/dist/app/composables/elementIcon.d.ts +2 -2
  8. package/dist/app/composables/elementIcon.js +1 -1
  9. package/dist/app/composables/language.d.ts +2 -2
  10. package/dist/app/composables/language.js +1 -1
  11. package/dist/app/composables/storage.d.ts +4 -4
  12. package/dist/app/composables/storage.js +0 -4
  13. package/dist/app/default/Mix.vue +2 -2
  14. package/dist/app/default/Text.vue +2 -2
  15. package/dist/app/shared/Prose.vue +3 -3
  16. package/dist/app/shared/Render.vue +5 -14
  17. package/dist/app/shared/block/AsideMenu.vue +2 -2
  18. package/dist/app/shared/block/AsideMenuCopyLink.vue +1 -1
  19. package/dist/app/shared/block/Block.vue +4 -4
  20. package/dist/app/shared/inliner/Inliner.vue +2 -2
  21. package/dist/coreElement.d.ts +25 -7
  22. package/dist/coreElement.js +2 -2
  23. package/dist/elements/accent/Accent.vue +4 -4
  24. package/dist/elements/accent/AccentColumnSection.vue +2 -2
  25. package/dist/elements/accent/AccentRowSections.vue +2 -2
  26. package/dist/elements/accent/app.d.ts +3 -3
  27. package/dist/elements/accent/app.js +2 -2
  28. package/dist/elements/accent/core.d.ts +61 -300
  29. package/dist/elements/accent/core.js +83 -68
  30. package/dist/elements/callout/Callout.vue +4 -4
  31. package/dist/elements/callout/app.d.ts +1 -8
  32. package/dist/elements/callout/app.js +2 -2
  33. package/dist/elements/callout/core.d.ts +21 -59
  34. package/dist/elements/callout/core.js +18 -17
  35. package/dist/elements/caption/Caption.vue +3 -3
  36. package/dist/elements/caption/app.d.ts +1 -8
  37. package/dist/elements/caption/app.js +2 -2
  38. package/dist/elements/caption/core.d.ts +21 -99
  39. package/dist/elements/caption/core.js +18 -22
  40. package/dist/elements/details/Details.vue +3 -3
  41. package/dist/elements/details/app.d.ts +1 -8
  42. package/dist/elements/details/app.js +2 -2
  43. package/dist/elements/details/core.d.ts +18 -61
  44. package/dist/elements/details/core.js +16 -11
  45. package/dist/elements/diagram/Diagram.vue +14 -11
  46. package/dist/elements/diagram/app.d.ts +1 -29
  47. package/dist/elements/diagram/app.js +2 -2
  48. package/dist/elements/diagram/core.d.ts +14 -177
  49. package/dist/elements/diagram/core.js +5 -8
  50. package/dist/elements/emphasis/Emphasis.vue +3 -3
  51. package/dist/elements/emphasis/app.d.ts +1 -8
  52. package/dist/elements/emphasis/app.js +2 -2
  53. package/dist/elements/emphasis/core.d.ts +13 -76
  54. package/dist/elements/emphasis/core.js +8 -9
  55. package/dist/elements/flex/Flex.vue +3 -3
  56. package/dist/elements/flex/app.d.ts +1 -8
  57. package/dist/elements/flex/app.js +2 -2
  58. package/dist/elements/flex/core.d.ts +16 -58
  59. package/dist/elements/flex/core.js +6 -7
  60. package/dist/elements/gallery/Gallery.vue +3 -3
  61. package/dist/elements/gallery/app.d.ts +1 -22
  62. package/dist/elements/gallery/app.js +2 -2
  63. package/dist/elements/gallery/core.d.ts +11 -132
  64. package/dist/elements/gallery/core.js +4 -5
  65. package/dist/elements/heading/Heading.vue +3 -3
  66. package/dist/elements/heading/_global.d.ts +2 -2
  67. package/dist/elements/heading/app.d.ts +1 -8
  68. package/dist/elements/heading/app.js +2 -2
  69. package/dist/elements/heading/core.d.ts +13 -97
  70. package/dist/elements/heading/core.js +8 -8
  71. package/dist/elements/horizontalLine/app.d.ts +1 -8
  72. package/dist/elements/horizontalLine/app.js +2 -2
  73. package/dist/elements/horizontalLine/core.d.ts +9 -47
  74. package/dist/elements/horizontalLine/core.js +4 -5
  75. package/dist/elements/image/Image.vue +3 -3
  76. package/dist/elements/image/ImageElement.vue +4 -4
  77. package/dist/elements/image/app.d.ts +1 -15
  78. package/dist/elements/image/app.js +2 -2
  79. package/dist/elements/image/core.d.ts +29 -108
  80. package/dist/elements/image/core.js +12 -19
  81. package/dist/elements/image/storage.d.ts +1 -1
  82. package/dist/elements/image/storage.js +6 -6
  83. package/dist/elements/lineBreak/app.d.ts +1 -8
  84. package/dist/elements/lineBreak/app.js +2 -2
  85. package/dist/elements/lineBreak/core.d.ts +9 -47
  86. package/dist/elements/lineBreak/core.js +4 -5
  87. package/dist/elements/link/BlockLink.vue +4 -6
  88. package/dist/elements/link/Link.vue +4 -4
  89. package/dist/elements/link/core.d.ts +8 -7
  90. package/dist/elements/link/core.js +5 -4
  91. package/dist/elements/link/dependency/app.d.ts +1 -15
  92. package/dist/elements/link/dependency/app.js +3 -3
  93. package/dist/elements/link/dependency/core.d.ts +30 -108
  94. package/dist/elements/link/dependency/core.js +6 -8
  95. package/dist/elements/link/hook.d.ts +12 -0
  96. package/dist/elements/link/hook.js +45 -0
  97. package/dist/elements/link/reference/app.d.ts +1 -15
  98. package/dist/elements/link/reference/app.js +3 -3
  99. package/dist/elements/link/reference/core.d.ts +24 -103
  100. package/dist/elements/link/reference/core.js +6 -8
  101. package/dist/elements/link/storage.js +1 -1
  102. package/dist/elements/list/List.vue +7 -5
  103. package/dist/elements/list/_global.d.ts +3 -3
  104. package/dist/elements/list/app.d.ts +1 -15
  105. package/dist/elements/list/app.js +2 -2
  106. package/dist/elements/list/core.d.ts +33 -155
  107. package/dist/elements/list/core.js +20 -18
  108. package/dist/elements/math/app.d.ts +1 -15
  109. package/dist/elements/math/app.js +3 -3
  110. package/dist/elements/math/block.d.ts +31 -43
  111. package/dist/elements/math/block.js +10 -9
  112. package/dist/elements/math/components/BlockMath.vue +4 -4
  113. package/dist/elements/math/components/InlinerMath.vue +4 -4
  114. package/dist/elements/math/core.d.ts +25 -53
  115. package/dist/elements/math/core.js +3 -11
  116. package/dist/elements/math/inliner.d.ts +24 -36
  117. package/dist/elements/math/inliner.js +10 -12
  118. package/dist/elements/paragraph/Paragraph.vue +3 -3
  119. package/dist/elements/paragraph/app.d.ts +1 -8
  120. package/dist/elements/paragraph/app.js +2 -2
  121. package/dist/elements/paragraph/core.d.ts +12 -53
  122. package/dist/elements/paragraph/core.js +6 -7
  123. package/dist/elements/problem/app.d.ts +1 -29
  124. package/dist/elements/problem/app.js +4 -4
  125. package/dist/elements/problem/components/Problem.vue +3 -3
  126. package/dist/elements/problem/components/ProblemContent.vue +15 -21
  127. package/dist/elements/problem/components/ProblemExpanderSection.vue +2 -2
  128. package/dist/elements/problem/components/Problems.vue +11 -7
  129. package/dist/elements/problem/components/SubProblem.vue +3 -4
  130. package/dist/elements/problem/components/expanders/Check.vue +3 -3
  131. package/dist/elements/problem/components/expanders/Checks.vue +6 -3
  132. package/dist/elements/problem/components/expanders/DefaultPlusSections.vue +3 -7
  133. package/dist/elements/problem/components/expanders/Hint.vue +3 -3
  134. package/dist/elements/problem/composables/problemScript.d.ts +2 -2
  135. package/dist/elements/problem/core.d.ts +63 -299
  136. package/dist/elements/problem/core.js +9 -11
  137. package/dist/elements/problem/hook.d.ts +1 -0
  138. package/dist/elements/problem/hook.js +14 -0
  139. package/dist/elements/problem/problem.d.ts +20 -77
  140. package/dist/elements/problem/problem.js +6 -6
  141. package/dist/elements/problem/problemCheck.d.ts +33 -83
  142. package/dist/elements/problem/problemCheck.js +16 -10
  143. package/dist/elements/problem/problemContent.d.ts +54 -401
  144. package/dist/elements/problem/problemContent.js +47 -56
  145. package/dist/elements/problem/problemScript.d.ts +18 -10
  146. package/dist/elements/problem/problemScript.js +15 -26
  147. package/dist/elements/problem/problems.d.ts +29 -188
  148. package/dist/elements/problem/problems.js +11 -15
  149. package/dist/elements/problem/storage.d.ts +1 -1
  150. package/dist/elements/problem/storage.js +2 -3
  151. package/dist/elements/table/Table.vue +3 -3
  152. package/dist/elements/table/app.d.ts +1 -29
  153. package/dist/elements/table/app.js +2 -2
  154. package/dist/elements/table/core.d.ts +28 -309
  155. package/dist/elements/table/core.js +17 -29
  156. package/dist/elements/video/Video.vue +4 -4
  157. package/dist/elements/video/app.d.ts +1 -15
  158. package/dist/elements/video/app.js +2 -2
  159. package/dist/elements/video/core.d.ts +26 -106
  160. package/dist/elements/video/core.js +11 -16
  161. package/dist/elements/video/storage.d.ts +1 -1
  162. package/dist/elements/video/storage.js +2 -3
  163. package/dist/error.d.ts +3 -0
  164. package/dist/error.js +6 -0
  165. package/dist/include.d.ts +4 -4
  166. package/dist/include.js +6 -12
  167. package/dist/index.d.ts +11 -11
  168. package/dist/index.js +11 -11
  169. package/dist/rawElement.d.ts +9 -6
  170. package/dist/rawElement.js +4 -0
  171. package/dist/rawToProse/countSchemas.d.ts +1 -0
  172. package/dist/rawToProse/countSchemas.js +11 -0
  173. package/dist/rawToProse/hook.d.ts +39 -0
  174. package/dist/rawToProse/hook.js +6 -0
  175. package/dist/rawToProse/index.d.ts +34 -0
  176. package/dist/rawToProse/index.js +92 -0
  177. package/dist/rawToProse/uniqueTitles.d.ts +1 -0
  178. package/dist/rawToProse/uniqueTitles.js +11 -0
  179. package/dist/shared/filePath.js +2 -2
  180. package/dist/shared/paragraphWrap.d.ts +3 -3
  181. package/dist/shared/paragraphWrap.js +7 -12
  182. package/dist/slugify/index.d.ts +3 -1
  183. package/dist/slugify/index.js +5 -6
  184. package/dist/slugify/languages/en.js +1 -1
  185. package/dist/slugify/languages/ru.js +1 -1
  186. package/dist/snippet.d.ts +39 -33
  187. package/dist/snippet.js +139 -73
  188. package/dist/tag.d.ts +22 -19
  189. package/dist/tag.js +19 -15
  190. package/dist/toc.d.ts +12 -18
  191. package/dist/toc.js +120 -42
  192. package/package.json +7 -6
  193. package/dist/app/default/Inliners.vue +0 -11
  194. package/dist/context.d.ts +0 -4
  195. package/dist/context.js +0 -1
  196. package/dist/elements/link/step.d.ts +0 -16
  197. package/dist/elements/link/step.js +0 -36
  198. package/dist/elements/problem/step.d.ts +0 -5
  199. package/dist/elements/problem/step.js +0 -13
  200. package/dist/resolve.d.ts +0 -21
  201. package/dist/resolve.js +0 -102
  202. package/dist/resolveStep.d.ts +0 -9
  203. package/dist/resolveStep.js +0 -3
  204. package/dist/title.d.ts +0 -8
  205. package/dist/title.js +0 -6
  206. package/dist/utils/docs.d.ts +0 -1
  207. package/dist/utils/docs.js +0 -22
  208. package/types.d.ts +0 -4
@@ -1,9 +1,2 @@
1
- declare const _default: import("../../app/appElement.js").AppElement<{
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 { defineEruditProseAppElement } from "../../app/appElement.js";
1
+ import { defineProseAppElement } from "../../app/appElement.js";
2
2
  import { calloutSchema } from "./core.js";
3
- export default defineEruditProseAppElement({
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 TagChildren } from '@jsprose/core';
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 declare const calloutSchema: {
12
- name: "callout";
13
- type: "block";
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 Callout: import("@jsprose/core").Tag<"Callout", {
20
- name: "callout";
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
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
31
- export declare const calloutRegistryItem: import("@jsprose/core").RegistryItem<{
32
- name: "callout";
33
- type: "block";
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
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
51
- }, undefined>;
52
- declare const _default: {
53
- registryItem: import("@jsprose/core").RegistryItem<{
54
- name: "callout";
55
- type: "block";
56
- linkable: true;
57
- Data: CalloutData;
58
- Storage: CalloutStorage;
59
- Children: BlockSchema[];
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 { defineRegistryItem, defineSchema, ensureTagBlockChildren, isRawElement } from "@jsprose/core";
1
+ import { defineSchema, ensureTagBlockChildren } from "tsprose";
2
2
  import { defineEruditTag } from "../../tag.js";
3
- import { defineEruditProseCoreElement } from "../../coreElement.js";
4
- import { defineResolveStep } from "../../resolveStep.js";
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, registry }) => {
14
- ensureTagBlockChildren(tagName, children, registry);
15
- element.children = children;
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 const calloutRegistryItem = defineRegistryItem({
30
+ export default defineProseCoreElement({
26
31
  schema: calloutSchema,
27
- tags: [Callout]
28
- });
29
- export default defineEruditProseCoreElement({ registryItem: calloutRegistryItem });
30
- //
31
- // Resolve
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 ProseElement } from '@jsprose/core';
3
+ import { isProseElement, type ToProseElement } from 'tsprose';
4
4
 
5
- import { captionSecondarySchema, type captionSchema } from './core.js';
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: ProseElement<typeof captionSchema>;
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").AppElement<{
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 { defineEruditProseAppElement } from "../../app/appElement.js";
1
+ import { defineProseAppElement } from "../../app/appElement.js";
2
2
  import { captionSchema } from "./core.js";
3
- export default defineEruditProseAppElement({
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 TagChildren } from '@jsprose/core';
2
- export declare const captionSecondarySchema: {
3
- name: "captionSecondary";
4
- type: "inliner";
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 CaptionSecondary: import("@jsprose/core").Tag<"CaptionSecondary", {
11
- name: "captionSecondary";
12
- type: "inliner";
13
- linkable: false;
14
- Data: undefined;
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
- name: "caption";
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
- } & TagChildren>;
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
- registryItem: import("@jsprose/core").RegistryItem<{
77
- name: "caption";
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
- registryItem: import("@jsprose/core").RegistryItem<{
97
- name: "captionSecondary";
98
- type: "inliner";
99
- linkable: false;
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 { defineRegistryItem, defineSchema, ensureTagInlinerChildren, isRawElement, ProseError } from "@jsprose/core";
1
+ import { defineSchema, ensureTagInlinerChildren, isRawElement } from "tsprose";
2
2
  import { defineEruditTag } from "../../tag.js";
3
- import { defineEruditProseCoreElements } from "../../coreElement.js";
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, registry }) => {
16
- ensureTagInlinerChildren(tagName, children, registry);
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, registry }) => {
32
- ensureTagInlinerChildren(tagName, children, registry);
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 ProseError(`Duplicate <${CaptionSecondary.tagName}> detected!`);
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 ProseError(`Cannot have a <${CaptionSecondary.tagName}> without a main caption content!`);
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
- export const captionRegistryItem = defineRegistryItem({
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 { ProseElement } from '@jsprose/core';
2
+ import type { ToProseElement } from 'tsprose';
3
3
 
4
- import type { detailsSchema } from './core.js';
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: ProseElement<typeof detailsSchema>;
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").AppElement<{
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 { defineEruditProseAppElement } from "../../app/appElement.js";
1
+ import { defineProseAppElement } from "../../app/appElement.js";
2
2
  import { detailsSchema } from "./core.js";
3
- export default defineEruditProseAppElement({
3
+ export default defineProseAppElement({
4
4
  schema: detailsSchema,
5
5
  component: () => import("./Details.vue"),
6
6
  languages: {
@@ -1,68 +1,25 @@
1
- import { type AnySchema, type Tag, type TagChildren, type Unique } from '@jsprose/core';
2
- import { type NoSnippet, type NoToc } from '../../tag.js';
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
- name: "details";
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
- $: Unique<Tag<typeof detailsTagName, typeof detailsSchema, any>>;
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
- registryItem: import("@jsprose/core").RegistryItem<{
48
- name: "details";
49
- type: "block";
50
- linkable: true;
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 { defineRegistryItem, defineSchema, ensureTagChildren, ProseError } from "@jsprose/core";
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: true
8
- })();
9
- export const detailsTagName = "Details";
9
+ linkable: "always"
10
+ });
10
11
  export const Details = defineEruditTag({
11
- tagName: detailsTagName,
12
+ tagName: "Details",
12
13
  schema: detailsSchema
13
14
  })(({ element, tagName, children, props }) => {
14
15
  if (!element.uniqueName) {
15
- throw new ProseError(`<${tagName}> must be connected to unique!`);
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 const detailsRegistryItem = defineRegistryItem({
32
+ export default defineProseCoreElement({
27
33
  schema: detailsSchema,
28
34
  tags: [Details]
29
35
  });
30
- export default defineEruditProseCoreElement({ registryItem: detailsRegistryItem });