@erudit-js/prose 3.0.0-dev.30 → 4.0.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/app/composables/context.d.ts +2 -1
  2. package/dist/app/composables/formatText.d.ts +5 -1
  3. package/dist/app/composables/formatText.js +5 -0
  4. package/dist/app/default/Text.vue +6 -2
  5. package/dist/app/shared/Prose.vue +4 -0
  6. package/dist/app/shared/block/Block.vue +5 -0
  7. package/dist/app/shared/invert.d.ts +2 -2
  8. package/dist/app/shared/invert.js +2 -2
  9. package/dist/app/shared/photoswipe/composable.js +1 -1
  10. package/dist/elements/accent/Accent.vue +2 -2
  11. package/dist/elements/accent/AccentColumnSection.vue +2 -2
  12. package/dist/elements/accent/AccentRowSections.vue +1 -1
  13. package/dist/elements/accent/core.d.ts +2 -2
  14. package/dist/elements/callout/Callout.vue +6 -9
  15. package/dist/elements/callout/core.d.ts +3 -3
  16. package/dist/elements/caption/Caption.vue +1 -1
  17. package/dist/elements/details/Details.vue +2 -3
  18. package/dist/elements/diagram/Diagram.vue +12 -2
  19. package/dist/elements/diagram/core.d.ts +3 -3
  20. package/dist/elements/emphasis/Emphasis.vue +1 -1
  21. package/dist/elements/emphasis/core.d.ts +6 -6
  22. package/dist/elements/flex/Flex.vue +8 -2
  23. package/dist/elements/flex/core.d.ts +7 -3
  24. package/dist/elements/flex/core.js +4 -0
  25. package/dist/elements/gallery/core.d.ts +3 -3
  26. package/dist/elements/heading/Heading.vue +1 -1
  27. package/dist/elements/heading/core.d.ts +9 -9
  28. package/dist/elements/heading/core.js +14 -10
  29. package/dist/elements/horizontalLine/HorizontalLine.vue +1 -1
  30. package/dist/elements/image/core.d.ts +3 -3
  31. package/dist/elements/link/BlockLink.vue +1 -2
  32. package/dist/elements/link/Link.vue +6 -3
  33. package/dist/elements/list/List.vue +10 -8
  34. package/dist/elements/list/core.d.ts +3 -3
  35. package/dist/elements/math/block.d.ts +9 -6
  36. package/dist/elements/math/block.js +2 -1
  37. package/dist/elements/math/components/BlockMath.vue +1 -1
  38. package/dist/elements/math/components/MathGroup.vue +5 -3
  39. package/dist/elements/math/core.d.ts +2 -2
  40. package/dist/elements/math/inliner.d.ts +2 -2
  41. package/dist/elements/paragraph/Paragraph.vue +1 -1
  42. package/dist/elements/paragraph/core.d.ts +3 -3
  43. package/dist/elements/problem/components/ProblemButton.vue +2 -2
  44. package/dist/elements/problem/components/ProblemContainer.vue +1 -2
  45. package/dist/elements/problem/components/ProblemExpander.vue +1 -1
  46. package/dist/elements/problem/components/ProblemExpanderSection.vue +2 -3
  47. package/dist/elements/problem/components/ProblemHeader.vue +2 -6
  48. package/dist/elements/problem/components/Problems.vue +3 -3
  49. package/dist/elements/problem/components/expanders/Check.vue +2 -3
  50. package/dist/elements/problem/components/expanders/Checks.vue +1 -1
  51. package/dist/elements/problem/core.d.ts +44 -8
  52. package/dist/elements/problem/problem.d.ts +3 -3
  53. package/dist/elements/problem/problem.js +3 -4
  54. package/dist/elements/problem/problemContent.d.ts +42 -37
  55. package/dist/elements/problem/problemContent.js +86 -2
  56. package/dist/elements/problem/problems.d.ts +3 -3
  57. package/dist/elements/problem/problems.js +3 -4
  58. package/dist/elements/table/Table.vue +2 -4
  59. package/dist/elements/table/core.d.ts +3 -3
  60. package/dist/elements/video/core.d.ts +3 -3
  61. package/dist/include.js +0 -1
  62. package/dist/snippet.d.ts +24 -34
  63. package/dist/snippet.js +60 -31
  64. package/dist/tag.d.ts +3 -3
  65. package/dist/tag.js +1 -1
  66. package/package.json +2 -2
@@ -9,22 +9,22 @@ export const headingSchema = defineSchema({
9
9
  export const H1 = defineEruditTag({
10
10
  tagName: "H1",
11
11
  schema: headingSchema
12
- })(({ tagName, element, children }) => {
13
- processHeadingElement(1, tagName, element, children);
12
+ })(({ tagName, element, props, children }) => {
13
+ processHeadingElement(1, tagName, props, element, children);
14
14
  });
15
15
  export const H2 = defineEruditTag({
16
16
  tagName: "H2",
17
17
  schema: headingSchema
18
- })(({ tagName, element, children }) => {
19
- processHeadingElement(2, tagName, element, children);
18
+ })(({ tagName, element, props, children }) => {
19
+ processHeadingElement(2, tagName, props, element, children);
20
20
  });
21
21
  export const H3 = defineEruditTag({
22
22
  tagName: "H3",
23
23
  schema: headingSchema
24
- })(({ tagName, element, children }) => {
25
- processHeadingElement(3, tagName, element, children);
24
+ })(({ tagName, element, props, children }) => {
25
+ processHeadingElement(3, tagName, props, element, children);
26
26
  });
27
- function processHeadingElement(level, tagName, element, children) {
27
+ function processHeadingElement(level, tagName, props, element, children) {
28
28
  ensureTagChild(tagName, children, textSchema);
29
29
  const child = children[0];
30
30
  const title = child.data.trim();
@@ -36,9 +36,13 @@ function processHeadingElement(level, tagName, element, children) {
36
36
  title
37
37
  };
38
38
  element.title = title;
39
- element.snippetFlags ||= {};
40
- element.snippetFlags.search ??= true;
41
- element.snippetFlags.seo ??= false;
39
+ element.snippet ||= {};
40
+ element.snippet.search ??= true;
41
+ // Only auto-enable SEO if quick is set in props
42
+ // Otherwise explicitly disable it to prevent auto-enablement from search flag
43
+ if (!props.snippet?.quick) {
44
+ element.snippet.seo ??= false;
45
+ }
42
46
  element.toc = { add: true };
43
47
  }
44
48
  export const headingRegistryItem = defineRegistryItem({
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <hr
3
3
  class="border-border mx-(--proseAsideWidth) mt-(--proseGap) rounded
4
- border-0 border-b transition-[background]"
4
+ border-0 border-b"
5
5
  />
6
6
  </template>
@@ -43,7 +43,7 @@ export declare const Image: import("@jsprose/core").Tag<"Image", {
43
43
  invert?: Invert;
44
44
  width?: string;
45
45
  children?: {};
46
- } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
46
+ } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
47
47
  export declare const imageRegistryItem: import("@jsprose/core").RegistryItem<{
48
48
  name: "image";
49
49
  type: "block";
@@ -78,7 +78,7 @@ export declare const imageRegistryItem: import("@jsprose/core").RegistryItem<{
78
78
  invert?: Invert;
79
79
  width?: string;
80
80
  children?: {};
81
- } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
81
+ } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
82
82
  }, undefined>;
83
83
  declare const _default: {
84
84
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -115,7 +115,7 @@ declare const _default: {
115
115
  invert?: Invert;
116
116
  width?: string;
117
117
  children?: {};
118
- } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
118
+ } & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
119
119
  }, undefined>;
120
120
  dependencies: {
121
121
  photoswipe: {
@@ -79,8 +79,7 @@ switch (linkStorage.type) {
79
79
  <EruditIcon
80
80
  name="arrow/outward"
81
81
  class="text-brand/15 group-hocus:text-brand/20 top-small
82
- right-small absolute shrink-0 text-[60px]
83
- transition-[color]"
82
+ right-small absolute shrink-0 text-[60px]"
84
83
  />
85
84
  <div
86
85
  class="text-brand/80 group-hocus:text-brand mb-small gap-small
@@ -79,15 +79,18 @@ function linkClick() {
79
79
  :style="{ '--tGap': '1px', '--xGap': '4px', '--bGap': '4px' }"
80
80
  class="text-brand hocus:bg-brand/15 relative
81
81
  -mx-[calc(var(--xGap)-3px)] -mt-(--tGap) -mb-(--bGap) rounded-sm
82
- bg-transparent px-(--xGap) pt-(--tGap) pb-(--bGap) underline
82
+ bg-transparent px-(--xGap) pt-(--tGap) pb-(--bGap)
83
+ whitespace-nowrap underline
83
84
  decoration-[color-mix(in_srgb,var(--color-brand)30%,transparent)]
84
- decoration-2 underline-offset-2 transition-[color,background]"
85
+ decoration-2 underline-offset-2 transition-[background]"
85
86
  >
86
87
  <EruditIcon
87
88
  :name="icon"
88
89
  class="micro:pr-1.5 inline pr-1 text-[1.3em]"
89
90
  />
90
- <span>{{ formatText(element.data.label) }}</span>
91
+ <span class="whitespace-normal">
92
+ {{ formatText(element.data.label) }}
93
+ </span>
91
94
  </EruditLink>
92
95
  </Inliner>
93
96
  </template>
@@ -14,9 +14,9 @@ defineProps<{ element: ProseElement<typeof listSchema> }>();
14
14
  :is="element.data.type"
15
15
  class="micro:[--proseGap:18px]"
16
16
  :style="{
17
- '--liBorder': 'var(--accentBorder, var(--color-border))',
17
+ '--liBorder': 'var(--color-text-disabled)',
18
18
  '--liBackground':
19
- 'color-mix(in hsl, var(--accentText, var(--color-text)) 12%, transparent)',
19
+ 'color-mix(in hsl, var(--accentText, var(--color-text)) 12%, var(--color-bg-main))',
20
20
  '--liText': 'var(--accentText, var(--color-text-muted))',
21
21
  }"
22
22
  v-bind="
@@ -27,16 +27,19 @@ defineProps<{ element: ProseElement<typeof listSchema> }>();
27
27
  >
28
28
  <li
29
29
  v-for="(listItem, i) of element.children"
30
- class="flex not-last-of-type:mb-(--proseGap)"
30
+ class="relative flex not-last-of-type:mb-(--proseGap)"
31
31
  >
32
- <div class="shrink-0">
32
+ <div
33
+ class="micro:left-[11px] bg-text-disabled micro:w-[2px]
34
+ absolute top-[3px] bottom-[5px] left-[9px] w-[1px]"
35
+ ></div>
36
+ <div class="relative shrink-0">
33
37
  <div
34
38
  class="micro:top-[1.5px] micro:size-[23px] relative
35
39
  top-[3px] flex size-[20px] items-center
36
40
  justify-center rounded-full border
37
41
  border-(--liBorder) bg-(--liBackground)
38
- font-semibold text-(--liText)
39
- transition-[border,background,color]"
42
+ font-semibold text-(--liText)"
40
43
  >
41
44
  <template v-if="element.data.type === 'ol'">
42
45
  <div class="micro:text-[13px] text-[10px]">
@@ -45,8 +48,7 @@ defineProps<{ element: ProseElement<typeof listSchema> }>();
45
48
  </template>
46
49
  <template v-else>
47
50
  <div
48
- class="size-1.5 rounded-full bg-(--liText)
49
- transition-[background]"
51
+ class="size-1.5 rounded-full bg-(--liText)"
50
52
  ></div>
51
53
  </template>
52
54
  </div>
@@ -56,7 +56,7 @@ export declare const List: import("@jsprose/core").Tag<"List", {
56
56
  start?: number;
57
57
  } | {
58
58
  type: "ul";
59
- }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
59
+ }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
60
60
  export declare const listItemRegistryItem: import("@jsprose/core").RegistryItem<{
61
61
  name: "listItem";
62
62
  type: "block";
@@ -108,7 +108,7 @@ export declare const listRegistryItem: import("@jsprose/core").RegistryItem<{
108
108
  start?: number;
109
109
  } | {
110
110
  type: "ul";
111
- }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
111
+ }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
112
112
  }, undefined>;
113
113
  declare const _default: [{
114
114
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -163,7 +163,7 @@ declare const _default: [{
163
163
  start?: number;
164
164
  } | {
165
165
  type: "ul";
166
- }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
166
+ }) & TagChildren) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
167
167
  }, undefined>;
168
168
  }];
169
169
  export default _default;
@@ -1,11 +1,14 @@
1
1
  import { type TagChildren } from '@jsprose/core';
2
- export declare const mathGroupTypes: readonly ["zero", "normal", "big"];
2
+ export declare const mathGroupTypes: readonly ["0", "small", "normal", "big"];
3
3
  export type MathGroupGapType = (typeof mathGroupTypes)[number] | 'custom';
4
4
  export interface MathGroupGapTemplate {
5
5
  type: MathGroupGapType;
6
6
  }
7
- export interface MathGroupGapNone extends MathGroupGapTemplate {
8
- type: 'zero';
7
+ export interface MathGroupGapZero extends MathGroupGapTemplate {
8
+ type: '0';
9
+ }
10
+ export interface MathGroupGapSmall extends MathGroupGapTemplate {
11
+ type: 'small';
9
12
  }
10
13
  export interface MathGroupGapNormal extends MathGroupGapTemplate {
11
14
  type: 'normal';
@@ -17,7 +20,7 @@ export interface MathGroupGapCustom extends MathGroupGapTemplate {
17
20
  type: 'custom';
18
21
  size: string;
19
22
  }
20
- export type MathGroupGap = MathGroupGapNone | MathGroupGapNormal | MathGroupGapBig | MathGroupGapCustom;
23
+ export type MathGroupGap = MathGroupGapZero | MathGroupGapSmall | MathGroupGapNormal | MathGroupGapBig | MathGroupGapCustom;
21
24
  export type MathGroupPart = string | MathGroup;
22
25
  export interface MathGroup {
23
26
  gap: MathGroupGap;
@@ -45,7 +48,7 @@ export declare const BlockMath: import("@jsprose/core").Tag<"BlockMath", {
45
48
  Children: undefined;
46
49
  }, {
47
50
  freeze?: boolean;
48
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
51
+ } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
49
52
  export declare const blockMathRegistryItem: import("@jsprose/core").RegistryItem<{
50
53
  name: "blockMath";
51
54
  type: "block";
@@ -63,7 +66,7 @@ export declare const blockMathRegistryItem: import("@jsprose/core").RegistryItem
63
66
  Children: undefined;
64
67
  }, {
65
68
  freeze?: boolean;
66
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
69
+ } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
67
70
  }, (element: import("@jsprose/core").ProseElement<{
68
71
  name: "blockMath";
69
72
  type: "block";
@@ -2,7 +2,8 @@ import { defineRegistryItem, defineSchema, ensureTagChild, ProseError, textSchem
2
2
  import { latexToHtml, normalizeKatex } from "./katex.js";
3
3
  import { defineEruditTag } from "../../tag.js";
4
4
  export const mathGroupTypes = [
5
- "zero",
5
+ "0",
6
+ "small",
6
7
  "normal",
7
8
  "big"
8
9
  ];
@@ -23,7 +23,7 @@ const mathGroup: _MathGroup = blockMathStorage;
23
23
 
24
24
  <template>
25
25
  <Block :element>
26
- <div :style="{ '--mathRowGap': '.6em' }">
26
+ <div :style="{ '--mathRowGap': '1em' }">
27
27
  <MathGroup :mathGroup :freeze="Boolean(element.data.freeze)" />
28
28
  </div>
29
29
  </Block>
@@ -9,12 +9,14 @@ const { mathGroup } = defineProps<{
9
9
 
10
10
  const columnGap = (() => {
11
11
  switch (mathGroup.gap.type) {
12
- case 'zero':
12
+ case '0':
13
13
  return '0px';
14
- case 'normal':
14
+ case 'small':
15
15
  return 'var(--proseAsideWidth)';
16
- case 'big':
16
+ case 'normal':
17
17
  return 'calc(var(--proseAsideWidth) * 2)';
18
+ case 'big':
19
+ return 'calc(var(--proseAsideWidth) * 4)';
18
20
  case 'custom':
19
21
  return mathGroup.gap.size;
20
22
  }
@@ -14,7 +14,7 @@ declare const _default: [{
14
14
  Data: string;
15
15
  Storage: import("./inliner.js").InlinerMathStorage;
16
16
  Children: undefined;
17
- }, import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
17
+ }, import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
18
18
  }, (element: import("@jsprose/core").ProseElement<{
19
19
  name: "inlinerMath";
20
20
  type: "inliner";
@@ -47,7 +47,7 @@ declare const _default: [{
47
47
  Children: undefined;
48
48
  }, {
49
49
  freeze?: boolean;
50
- } & import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
50
+ } & import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
51
51
  }, (element: import("@jsprose/core").ProseElement<{
52
52
  name: "blockMath";
53
53
  type: "block";
@@ -35,7 +35,7 @@ export declare const M: import("@jsprose/core").Tag<"M", {
35
35
  Data: string;
36
36
  Storage: InlinerMathStorage;
37
37
  Children: undefined;
38
- }, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
38
+ }, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
39
39
  export declare const inlinerMathRegistryItem: import("@jsprose/core").RegistryItem<{
40
40
  name: "inlinerMath";
41
41
  type: "inliner";
@@ -51,7 +51,7 @@ export declare const inlinerMathRegistryItem: import("@jsprose/core").RegistryIt
51
51
  Data: string;
52
52
  Storage: InlinerMathStorage;
53
53
  Children: undefined;
54
- }, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
54
+ }, TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
55
55
  }, (element: import("@jsprose/core").ProseElement<{
56
56
  name: "inlinerMath";
57
57
  type: "inliner";
@@ -12,7 +12,7 @@ defineProps<{ element: ProseElement<typeof paragraphSchema> }>();
12
12
  <Block :element>
13
13
  <div
14
14
  :class="[
15
- 'wrap-break-word transition-[color]',
15
+ 'wrap-break-word',
16
16
  element.data?.center
17
17
  ? 'text-center'
18
18
  : 'micro:text-justify text-left',
@@ -21,7 +21,7 @@ export declare const P: import("@jsprose/core").Tag<"P", {
21
21
  }, {
22
22
  center?: true;
23
23
  serif?: true;
24
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
24
+ } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
25
25
  export declare const paragraphRegistryItem: import("@jsprose/core").RegistryItem<{
26
26
  name: "paragraph";
27
27
  type: "block";
@@ -40,7 +40,7 @@ export declare const paragraphRegistryItem: import("@jsprose/core").RegistryItem
40
40
  }, {
41
41
  center?: true;
42
42
  serif?: true;
43
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
43
+ } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
44
44
  }, undefined>;
45
45
  declare const _default: {
46
46
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -61,7 +61,7 @@ declare const _default: {
61
61
  }, {
62
62
  center?: true;
63
63
  serif?: true;
64
- } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
64
+ } & TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
65
65
  }, undefined>;
66
66
  };
67
67
  export default _default;
@@ -5,8 +5,8 @@ defineProps<{ active?: boolean }>();
5
5
  <template>
6
6
  <button
7
7
  :class="[
8
- `bg-bg-main border-border/80 text-main-xs min-w-[50px]
9
- cursor-pointer rounded border px-2.5 py-[5px] font-semibold shadow
8
+ `bg-bg-main border-border/80 text-main-xs micro:px-2.5 min-w-[30px]
9
+ cursor-pointer rounded border px-1.5 py-[5px] font-semibold shadow
10
10
  shadow-[light-dark(#d9d9d9,#3c3c3c)]
11
11
  transition-[color,background,border,box-shadow]`,
12
12
  {
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="bg-bg-accent/30 dark:bg-bg-accent/50 border-border/50
4
- dark:border-border/90 rounded-xl border
5
- transition-[background,border]"
4
+ dark:border-border/90 rounded-xl border"
6
5
  >
7
6
  <slot></slot>
8
7
  </div>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <div class="border-border border-t transition-[border]">
3
+ <div class="border-border border-t">
4
4
  <slot></slot>
5
5
  </div>
6
6
  </div>
@@ -30,7 +30,7 @@ watchEffect(() => {
30
30
  @click="opened = !opened"
31
31
  class="group border-border text-text-muted relative flex cursor-pointer
32
32
  items-center border-t p-(--proseAsideWidth) font-semibold
33
- transition-[border] first:border-t-0"
33
+ first:border-t-0"
34
34
  >
35
35
  <div class="flex-1">{{ formatText(title) }}</div>
36
36
  <button
@@ -49,8 +49,7 @@ watchEffect(() => {
49
49
  <Suspense>
50
50
  <div
51
51
  v-if="opened"
52
- class="border-border border-t border-dashed py-(--proseAsideWidth)
53
- transition-[border]"
52
+ class="border-border border-t border-dashed py-(--proseAsideWidth)"
54
53
  >
55
54
  <Render v-for="child of element.children" :element="child" />
56
55
  </div>
@@ -46,10 +46,7 @@ const levelColors: Record<ProblemLevel, string> = {
46
46
  class="micro:flex-row micro:items-center micro:gap-normal gap-small flex
47
47
  flex-col flex-wrap p-(--proseAsideWidth) pb-0"
48
48
  >
49
- <h2
50
- class="text-text-deep text-main-lg flex-1 font-bold
51
- transition-[color]"
52
- >
49
+ <h2 class="text-text-deep text-main-lg flex-1 font-bold">
53
50
  {{ formatText(info.title) }}
54
51
  </h2>
55
52
  <div
@@ -67,8 +64,7 @@ const levelColors: Record<ProblemLevel, string> = {
67
64
  class="border-border/60 bg-bg-main text-main-xs text-text-muted
68
65
  flex h-(--labelHeight) cursor-help items-center gap-1
69
66
  rounded-xl border px-2 shadow
70
- shadow-[light-dark(#d9d9d9,#3c3c3c)]
71
- transition-[background,border,color,box-shadow]"
67
+ shadow-[light-dark(#d9d9d9,#3c3c3c)]"
72
68
  >
73
69
  <EruditIcon
74
70
  v-if="typeof attribute === 'string' || attribute.icon"
@@ -60,9 +60,9 @@ watchEffect(() => {
60
60
  />
61
61
  </div>
62
62
  <div
63
- class="gap-normal border-border flex flex-wrap border-b
64
- px-(--proseAsideWidth) py-(--proseAsideWidth)
65
- transition-[border]"
63
+ class="gap-small micro:gap-normal border-border micro:*:px-4
64
+ flex flex-wrap border-b px-(--proseAsideWidth)
65
+ py-(--proseAsideWidth)"
66
66
  >
67
67
  <ProblemButton
68
68
  v-for="(subProblem, i) of subProblems"
@@ -2,7 +2,7 @@
2
2
  import { useTemplateRef, ref, watch } from 'vue';
3
3
  import type { ProseElement } from '@jsprose/core';
4
4
 
5
- import type { problemCheckSchema } from '../../problemContent.js';
5
+ import { checkValue, type problemCheckSchema } from '../../problemContent.js';
6
6
  import checkIcon from '../../assets/actions/check.svg?raw';
7
7
  import plusIcon from '../../../../app/shared/assets/plus.svg?raw';
8
8
  import successIcon from '../../../../app/shared/assets/check.svg?raw';
@@ -81,8 +81,7 @@ function doCheck() {
81
81
  return;
82
82
  }
83
83
 
84
- const isCorrect = check.data.answers?.includes(newInput);
85
- state.value = isCorrect ? 'correct' : 'wrong';
84
+ state.value = checkValue(newInput, check.data) ? 'correct' : 'wrong';
86
85
  }
87
86
  </script>
88
87
 
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, watchEffect } from 'vue';
2
+ import { ref } from 'vue';
3
3
  import type { ProseElement } from '@jsprose/core';
4
4
 
5
5
  import type {
@@ -108,19 +108,55 @@ declare const _default: [{
108
108
  label?: string;
109
109
  hint?: string;
110
110
  placeholder?: string;
111
- } & (({
112
- answer: string | number;
111
+ } & (((Pick<{
112
+ answer: string | number | RegExp;
113
+ answers: (string | number | RegExp)[];
114
+ set: (string | number | RegExp | (string | number | RegExp)[])[] | {
115
+ separator: string;
116
+ values: (string | number | RegExp | (string | number | RegExp)[])[];
117
+ };
118
+ script: string;
119
+ }, "answer"> & {
113
120
  answers?: undefined;
121
+ set?: undefined;
114
122
  script?: undefined;
115
- } | {
116
- answers: (string | number)[];
123
+ }) | (Pick<{
124
+ answer: string | number | RegExp;
125
+ answers: (string | number | RegExp)[];
126
+ set: (string | number | RegExp | (string | number | RegExp)[])[] | {
127
+ separator: string;
128
+ values: (string | number | RegExp | (string | number | RegExp)[])[];
129
+ };
130
+ script: string;
131
+ }, "answers"> & {
117
132
  answer?: undefined;
133
+ set?: undefined;
118
134
  script?: undefined;
119
- } | {
135
+ }) | (Pick<{
136
+ answer: string | number | RegExp;
137
+ answers: (string | number | RegExp)[];
138
+ set: (string | number | RegExp | (string | number | RegExp)[])[] | {
139
+ separator: string;
140
+ values: (string | number | RegExp | (string | number | RegExp)[])[];
141
+ };
120
142
  script: string;
143
+ }, "set"> & {
144
+ answer?: undefined;
121
145
  answers?: undefined;
146
+ script?: undefined;
147
+ }) | (Pick<{
148
+ answer: string | number | RegExp;
149
+ answers: (string | number | RegExp)[];
150
+ set: (string | number | RegExp | (string | number | RegExp)[])[] | {
151
+ separator: string;
152
+ values: (string | number | RegExp | (string | number | RegExp)[])[];
153
+ };
154
+ script: string;
155
+ }, "script"> & {
122
156
  answer?: undefined;
123
- }) & import("@jsprose/core").NoTagChildren)) & {}>;
157
+ answers?: undefined;
158
+ set?: undefined;
159
+ })) & import("@jsprose/core").NoTagChildren)) & {}>;
124
160
  }, undefined>;
125
161
  }, {
126
162
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -173,7 +209,7 @@ declare const _default: [{
173
209
  } | {
174
210
  script: import("./problemScript.js").ProblemScriptInstance;
175
211
  children?: undefined;
176
- })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
212
+ })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
177
213
  }, undefined>;
178
214
  }, {
179
215
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -242,7 +278,7 @@ declare const _default: [{
242
278
  applied?: true | undefined;
243
279
  method?: true | undefined;
244
280
  inter?: true | undefined;
245
- } & import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
281
+ } & import("@jsprose/core").TagChildren & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
246
282
  }, undefined>;
247
283
  }];
248
284
  export default _default;
@@ -37,7 +37,7 @@ export declare const Problem: import("@jsprose/core").Tag<"Problem", {
37
37
  } | {
38
38
  script: ProblemScriptInstance;
39
39
  children?: undefined;
40
- })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
40
+ })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
41
41
  export declare const problemRegistryItem: import("@jsprose/core").RegistryItem<{
42
42
  name: "problem";
43
43
  type: "block";
@@ -68,7 +68,7 @@ export declare const problemRegistryItem: import("@jsprose/core").RegistryItem<{
68
68
  } | {
69
69
  script: ProblemScriptInstance;
70
70
  children?: undefined;
71
- })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
71
+ })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
72
72
  }, undefined>;
73
73
  export declare const problemCoreElement: {
74
74
  registryItem: import("@jsprose/core").RegistryItem<{
@@ -101,6 +101,6 @@ export declare const problemCoreElement: {
101
101
  } | {
102
102
  script: ProblemScriptInstance;
103
103
  children?: undefined;
104
- })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet & import("../../snippet.js").ObjPropSearch & import("../../snippet.js").ObjPropQuick & import("../../snippet.js").ObjPropSeo>;
104
+ })) & import("../../toc.js").ObjPropToc & import("../../snippet.js").ObjPropSnippet>;
105
105
  }, undefined>;
106
106
  };
@@ -14,10 +14,9 @@ export const Problem = defineEruditTag({
14
14
  tagName: "Problem",
15
15
  schema: problemSchema
16
16
  })(({ element, tagName, props, children }) => {
17
- element.data = { info: problemProps2Info(props) };
18
- element.title = element.data.info.title;
19
- element.snippet = {};
20
- element.toc = { add: true };
17
+ const problemInfo = problemProps2Info(props);
18
+ element.data = { info: problemInfo };
19
+ element.title = problemInfo.title;
21
20
  if (children && props.script) {
22
21
  throw new ProseError(`<${tagName}> cannot have both script and children in Problem element!`);
23
22
  }