@erudit-js/prose 4.0.0-dev.5 → 4.0.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 (86) hide show
  1. package/dist/app/default/Inliners.vue +11 -11
  2. package/dist/app/default/Mix.vue +11 -11
  3. package/dist/app/default/Text.vue +25 -25
  4. package/dist/app/shared/Prose.vue +40 -40
  5. package/dist/app/shared/Render.vue +51 -51
  6. package/dist/app/shared/assets/block.svg +2 -2
  7. package/dist/app/shared/assets/check.svg +2 -2
  8. package/dist/app/shared/assets/inliner.svg +2 -2
  9. package/dist/app/shared/assets/plus.svg +2 -2
  10. package/dist/app/shared/block/AsideMenu.vue +44 -44
  11. package/dist/app/shared/block/AsideMenuButton.vue +51 -51
  12. package/dist/app/shared/block/AsideMenuCopyLink.vue +40 -40
  13. package/dist/app/shared/block/AsideMenuSeparator.vue +3 -3
  14. package/dist/app/shared/block/Block.vue +270 -270
  15. package/dist/app/shared/inliner/Inliner.vue +11 -11
  16. package/dist/app/shared/photoswipe/style.css +22 -22
  17. package/dist/elements/accent/Accent.vue +88 -88
  18. package/dist/elements/accent/AccentColumnSection.vue +61 -61
  19. package/dist/elements/accent/AccentRowSections.vue +64 -64
  20. package/dist/elements/callout/Callout.vue +81 -81
  21. package/dist/elements/callout/_global.d.ts +15 -15
  22. package/dist/elements/caption/Caption.vue +44 -44
  23. package/dist/elements/caption/_global.d.ts +26 -26
  24. package/dist/elements/details/Details.vue +49 -49
  25. package/dist/elements/details/_global.d.ts +27 -27
  26. package/dist/elements/details/icon.svg +2 -2
  27. package/dist/elements/diagram/Diagram.vue +360 -360
  28. package/dist/elements/diagram/_global.d.ts +19 -19
  29. package/dist/elements/emphasis/Emphasis.vue +25 -25
  30. package/dist/elements/emphasis/_global.d.ts +18 -18
  31. package/dist/elements/flex/Flex.vue +36 -36
  32. package/dist/elements/flex/_global.d.ts +23 -23
  33. package/dist/elements/gallery/Gallery.vue +56 -56
  34. package/dist/elements/gallery/_global.d.ts +18 -18
  35. package/dist/elements/heading/Heading.vue +44 -44
  36. package/dist/elements/heading/_global.d.ts +42 -42
  37. package/dist/elements/heading/icon.svg +2 -2
  38. package/dist/elements/horizontalLine/HorizontalLine.vue +6 -6
  39. package/dist/elements/horizontalLine/_global.d.ts +17 -17
  40. package/dist/elements/image/Image.vue +15 -15
  41. package/dist/elements/image/ImageElement.vue +80 -80
  42. package/dist/elements/image/_global.d.ts +18 -18
  43. package/dist/elements/lineBreak/LineBreak.vue +3 -3
  44. package/dist/elements/lineBreak/_global.d.ts +18 -18
  45. package/dist/elements/link/BlockLink.vue +108 -108
  46. package/dist/elements/link/Link.vue +92 -92
  47. package/dist/elements/link/dependency/_global.d.ts +47 -47
  48. package/dist/elements/link/reference/_global.d.ts +49 -49
  49. package/dist/elements/list/List.vue +58 -58
  50. package/dist/elements/list/_global.d.ts +50 -50
  51. package/dist/elements/math/_global.d.ts +72 -72
  52. package/dist/elements/math/_global.ts +3 -3
  53. package/dist/elements/math/components/BlockMath.vue +30 -30
  54. package/dist/elements/math/components/InlinerMath.vue +65 -65
  55. package/dist/elements/math/components/Katex.vue +88 -88
  56. package/dist/elements/math/components/MathGroup.vue +41 -41
  57. package/dist/elements/paragraph/Paragraph.vue +25 -25
  58. package/dist/elements/paragraph/_global.d.ts +27 -27
  59. package/dist/elements/paragraph/icon.svg +3 -3
  60. package/dist/elements/problem/_global.d.ts +112 -112
  61. package/dist/elements/problem/assets/actions/answer.svg +2 -2
  62. package/dist/elements/problem/assets/actions/check.svg +2 -2
  63. package/dist/elements/problem/assets/actions/generate.svg +2 -2
  64. package/dist/elements/problem/assets/actions/hint.svg +2 -2
  65. package/dist/elements/problem/assets/actions/note.svg +2 -2
  66. package/dist/elements/problem/assets/actions/solution.svg +2 -2
  67. package/dist/elements/problem/assets/icon.svg +2 -2
  68. package/dist/elements/problem/components/Problem.vue +22 -22
  69. package/dist/elements/problem/components/ProblemButton.vue +20 -20
  70. package/dist/elements/problem/components/ProblemContainer.vue +8 -8
  71. package/dist/elements/problem/components/ProblemContent.vue +356 -356
  72. package/dist/elements/problem/components/ProblemExpander.vue +7 -7
  73. package/dist/elements/problem/components/ProblemExpanderSection.vue +57 -57
  74. package/dist/elements/problem/components/ProblemHeader.vue +100 -100
  75. package/dist/elements/problem/components/Problems.vue +83 -83
  76. package/dist/elements/problem/components/SubProblem.vue +14 -14
  77. package/dist/elements/problem/components/expanders/Check.vue +153 -153
  78. package/dist/elements/problem/components/expanders/Checks.vue +146 -146
  79. package/dist/elements/problem/components/expanders/DefaultPlusSections.vue +38 -38
  80. package/dist/elements/problem/components/expanders/Hint.vue +26 -26
  81. package/dist/elements/table/Table.vue +100 -100
  82. package/dist/elements/table/_global.d.ts +36 -36
  83. package/dist/elements/video/Video.vue +110 -110
  84. package/dist/elements/video/_global.d.ts +18 -18
  85. package/package.json +4 -4
  86. package/types.d.ts +4 -4
@@ -1,11 +1,11 @@
1
- <script lang="ts" setup>
2
- import type { inlinersSchema, ProseElement } from '@jsprose/core';
3
-
4
- import Render from '../shared/Render.vue';
5
-
6
- defineProps<{ element: ProseElement<typeof inlinersSchema> }>();
7
- </script>
8
-
9
- <template>
10
- <Render v-for="child of element.children" :element="child" />
11
- </template>
1
+ <script lang="ts" setup>
2
+ import type { inlinersSchema, ProseElement } from '@jsprose/core';
3
+
4
+ import Render from '../shared/Render.vue';
5
+
6
+ defineProps<{ element: ProseElement<typeof inlinersSchema> }>();
7
+ </script>
8
+
9
+ <template>
10
+ <Render v-for="child of element.children" :element="child" />
11
+ </template>
@@ -1,11 +1,11 @@
1
- <script lang="ts" setup>
2
- import { type mixSchema, type ProseElement } from '@jsprose/core';
3
-
4
- import Render from '../shared/Render.vue';
5
-
6
- const { element } = defineProps<{ element: ProseElement<typeof mixSchema> }>();
7
- </script>
8
-
9
- <template>
10
- <Render v-for="child of element.children" :element="child" />
11
- </template>
1
+ <script lang="ts" setup>
2
+ import { type mixSchema, type ProseElement } from '@jsprose/core';
3
+
4
+ import Render from '../shared/Render.vue';
5
+
6
+ const { element } = defineProps<{ element: ProseElement<typeof mixSchema> }>();
7
+ </script>
8
+
9
+ <template>
10
+ <Render v-for="child of element.children" :element="child" />
11
+ </template>
@@ -1,25 +1,25 @@
1
- <script lang="ts" setup>
2
- import { Text, h } from 'vue';
3
- import type { ProseElement, textSchema } from '@jsprose/core';
4
-
5
- import {
6
- useFormatText,
7
- useFormatTextState,
8
- } from '../composables/formatText.js';
9
-
10
- const { element } = defineProps<{ element: ProseElement<typeof textSchema> }>();
11
- const formatTextState = useFormatTextState();
12
- const formatText = useFormatText();
13
-
14
- const originalText = element.data;
15
- const leadingSpace = originalText.match(/^(\s*)/)?.[1] ? ' ' : '';
16
- const trailingSpace = originalText.match(/(\s*)$/)?.[1] ? ' ' : '';
17
- const formattedText = formatText(originalText, formatTextState);
18
- const textWithSpaces = leadingSpace + formattedText + trailingSpace;
19
-
20
- const TextComponent = h(Text, textWithSpaces);
21
- </script>
22
-
23
- <template>
24
- <component :is="TextComponent" />
25
- </template>
1
+ <script lang="ts" setup>
2
+ import { Text, h } from 'vue';
3
+ import type { ProseElement, textSchema } from '@jsprose/core';
4
+
5
+ import {
6
+ useFormatText,
7
+ useFormatTextState,
8
+ } from '../composables/formatText.js';
9
+
10
+ const { element } = defineProps<{ element: ProseElement<typeof textSchema> }>();
11
+ const formatTextState = useFormatTextState();
12
+ const formatText = useFormatText();
13
+
14
+ const originalText = element.data;
15
+ const leadingSpace = originalText.match(/^(\s*)/)?.[1] ? ' ' : '';
16
+ const trailingSpace = originalText.match(/(\s*)$/)?.[1] ? ' ' : '';
17
+ const formattedText = formatText(originalText, formatTextState);
18
+ const textWithSpaces = leadingSpace + formattedText + trailingSpace;
19
+
20
+ const TextComponent = h(Text, textWithSpaces);
21
+ </script>
22
+
23
+ <template>
24
+ <component :is="TextComponent" />
25
+ </template>
@@ -1,40 +1,40 @@
1
- <script lang="ts" setup>
2
- import { provide } from 'vue';
3
- import type { AnySchema, GenericStorage, ProseElement } from '@jsprose/core';
4
- import { createFormatTextState } from '@erudit-js/core/formatText';
5
-
6
- import {
7
- proseContextSymbol,
8
- type ProseContext,
9
- } from '../composables/context.js';
10
- import { proseStorageSymbol } from '../composables/storage.js';
11
- import Render from './Render.vue';
12
- import { anchorStateSymbol, useAnchorState } from '../composables/anchor.js';
13
- import { formatTextStateSymbol } from '../composables/formatText.js';
14
-
15
- const { element, storage, context } = defineProps<{
16
- element: ProseElement<AnySchema>;
17
- storage: GenericStorage;
18
- context: ProseContext;
19
- }>();
20
-
21
- provide(proseContextSymbol, context);
22
- provide(proseStorageSymbol, storage);
23
-
24
- const anchorState = useAnchorState(context.hashUrl, element);
25
- provide(anchorStateSymbol, anchorState);
26
-
27
- provide(formatTextStateSymbol, createFormatTextState());
28
- </script>
29
-
30
- <template>
31
- <section
32
- :style="{ '--proseGap': 'none' }"
33
- :class="[
34
- /* Variables */
35
- 'micro:[--proseAsideWidth:20px] [--proseAsideWidth:16px]',
36
- ]"
37
- >
38
- <Render :element />
39
- </section>
40
- </template>
1
+ <script lang="ts" setup>
2
+ import { provide } from 'vue';
3
+ import type { AnySchema, GenericStorage, ProseElement } from '@jsprose/core';
4
+ import { createFormatTextState } from '@erudit-js/core/formatText';
5
+
6
+ import {
7
+ proseContextSymbol,
8
+ type ProseContext,
9
+ } from '../composables/context.js';
10
+ import { proseStorageSymbol } from '../composables/storage.js';
11
+ import Render from './Render.vue';
12
+ import { anchorStateSymbol, useAnchorState } from '../composables/anchor.js';
13
+ import { formatTextStateSymbol } from '../composables/formatText.js';
14
+
15
+ const { element, storage, context } = defineProps<{
16
+ element: ProseElement<AnySchema>;
17
+ storage: GenericStorage;
18
+ context: ProseContext;
19
+ }>();
20
+
21
+ provide(proseContextSymbol, context);
22
+ provide(proseStorageSymbol, storage);
23
+
24
+ const anchorState = useAnchorState(context.hashUrl, element);
25
+ provide(anchorStateSymbol, anchorState);
26
+
27
+ provide(formatTextStateSymbol, createFormatTextState());
28
+ </script>
29
+
30
+ <template>
31
+ <section
32
+ :style="{ '--proseGap': 'none' }"
33
+ :class="[
34
+ /* Variables */
35
+ 'micro:[--proseAsideWidth:20px] [--proseAsideWidth:16px]',
36
+ ]"
37
+ >
38
+ <Render :element />
39
+ </section>
40
+ </template>
@@ -1,51 +1,51 @@
1
- <script lang="ts" setup>
2
- import { h, type Component } from 'vue';
3
- import {
4
- inlinersSchema,
5
- mixSchema,
6
- textSchema,
7
- type AnySchema,
8
- type ProseElement,
9
- } from '@jsprose/core';
10
-
11
- import { useAppElement } from '../composables/appElement.js';
12
- import Mix from '../default/Mix.vue';
13
- import Inliners from '../default/Inliners.vue';
14
- import Text from '../default/Text.vue';
15
-
16
- const { element } = defineProps<{ element: ProseElement<AnySchema> }>();
17
-
18
- const ElementComponent: Component = await (async () => {
19
- switch (element.schemaName) {
20
- case mixSchema.name:
21
- return Mix;
22
- case inlinersSchema.name:
23
- return Inliners;
24
- case textSchema.name:
25
- return Text;
26
- }
27
-
28
- try {
29
- const appElement = useAppElement(element);
30
- return await appElement.component();
31
- } catch (error) {
32
- console.warn(
33
- `[Prose] [Render] Missing component for element schema: ${element.schemaName}`,
34
- );
35
-
36
- return {
37
- render() {
38
- return h(
39
- 'span',
40
- { class: 'text-red-500 font-semibold font-mono' },
41
- `<${element.schemaName}/>`,
42
- );
43
- },
44
- };
45
- }
46
- })();
47
- </script>
48
-
49
- <template>
50
- <ElementComponent :element />
51
- </template>
1
+ <script lang="ts" setup>
2
+ import { h, type Component } from 'vue';
3
+ import {
4
+ inlinersSchema,
5
+ mixSchema,
6
+ textSchema,
7
+ type AnySchema,
8
+ type ProseElement,
9
+ } from '@jsprose/core';
10
+
11
+ import { useAppElement } from '../composables/appElement.js';
12
+ import Mix from '../default/Mix.vue';
13
+ import Inliners from '../default/Inliners.vue';
14
+ import Text from '../default/Text.vue';
15
+
16
+ const { element } = defineProps<{ element: ProseElement<AnySchema> }>();
17
+
18
+ const ElementComponent: Component = await (async () => {
19
+ switch (element.schemaName) {
20
+ case mixSchema.name:
21
+ return Mix;
22
+ case inlinersSchema.name:
23
+ return Inliners;
24
+ case textSchema.name:
25
+ return Text;
26
+ }
27
+
28
+ try {
29
+ const appElement = useAppElement(element);
30
+ return await appElement.component();
31
+ } catch (error) {
32
+ console.warn(
33
+ `[Prose] [Render] Missing component for element schema: ${element.schemaName}`,
34
+ );
35
+
36
+ return {
37
+ render() {
38
+ return h(
39
+ 'span',
40
+ { class: 'text-red-500 font-semibold font-mono' },
41
+ `<${element.schemaName}/>`,
42
+ );
43
+ },
44
+ };
45
+ }
46
+ })();
47
+ </script>
48
+
49
+ <template>
50
+ <ElementComponent :element />
51
+ </template>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
- <path d="M11,19.43v-6.85l-6-3.48v6.85l6,3.48ZM13,19.43l6-3.48v-6.85l-6,3.48v6.85ZM12,10.85l5.93-3.43-5.93-3.43-5.93,3.43,5.93,3.43ZM4,17.7c-.32-.18-.56-.43-.74-.73s-.26-.63-.26-1v-7.95c0-.37.09-.7.26-1s.42-.54.74-.73l7-4.03c.32-.18.65-.28,1-.28s.68.09,1,.28l7,4.03c.32.18.56.43.74.73s.26.63.26,1v7.95c0,.37-.09.7-.26,1s-.42.54-.74.73l-7,4.03c-.32.18-.65.28-1,.28s-.68-.09-1-.28l-7-4.03Z"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <path d="M11,19.43v-6.85l-6-3.48v6.85l6,3.48ZM13,19.43l6-3.48v-6.85l-6,3.48v6.85ZM12,10.85l5.93-3.43-5.93-3.43-5.93,3.43,5.93,3.43ZM4,17.7c-.32-.18-.56-.43-.74-.73s-.26-.63-.26-1v-7.95c0-.37.09-.7.26-1s.42-.54.74-.73l7-4.03c.32-.18.65-.28,1-.28s.68.09,1,.28l7,4.03c.32.18.56.43.74.73s.26.63.26,1v7.95c0,.37-.09.7-.26,1s-.42.54-.74.73l-7,4.03c-.32.18-.65.28-1,.28s-.68-.09-1-.28l-7-4.03Z"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960">
2
- <path d="M353.82,643.31l437.65-437.65c10.33-10.33,22.38-15.49,36.15-15.49s25.82,5.16,36.15,15.49,15.49,22.59,15.49,36.79-5.16,26.47-15.49,36.79l-473.8,475.09c-10.33,10.33-22.38,15.49-36.15,15.49s-25.82-5.16-36.15-15.49l-222.05-222.05c-10.33-10.33-15.28-22.59-14.85-36.79s5.81-26.47,16.14-36.79,22.59-15.49,36.79-15.49,26.47,5.16,36.79,15.49l183.32,184.62Z"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960">
2
+ <path d="M353.82,643.31l437.65-437.65c10.33-10.33,22.38-15.49,36.15-15.49s25.82,5.16,36.15,15.49,15.49,22.59,15.49,36.79-5.16,26.47-15.49,36.79l-473.8,475.09c-10.33,10.33-22.38,15.49-36.15,15.49s-25.82-5.16-36.15-15.49l-222.05-222.05c-10.33-10.33-15.28-22.59-14.85-36.79s5.81-26.47,16.14-36.79,22.59-15.49,36.79-15.49,26.47,5.16,36.79,15.49l183.32,184.62Z"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
- <path d="M11.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM7.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,8.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,12.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29c.19.19.29.43.29.71s-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,16.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM11.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM7.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM3.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM16,21c-.28,0-.52-.1-.71-.29-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29h1s0-14,0-14h-1c-.28,0-.52-.1-.71-.29s-.29-.43-.29-.71.1-.52.29-.71.43-.29.71-.29h4c.28,0,.52.1.71.29.19.19.29.43.29.71s-.1.52-.29.71c-.19.19-.43.29-.71.29h-1s0,14,0,14h1c.28,0,.52.1.71.29.19.19.29.43.29.71s-.1.52-.29.71c-.19.19-.43.29-.71.29h-4Z"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <path d="M11.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM7.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,4.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,8.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,12.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29c.19.19.29.43.29.71s-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM3.29,16.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71-.43.29-.71.29-.52-.1-.71-.29ZM11.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71c.19-.19.43-.29.71-.29s.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM7.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM3.29,20.71c-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29.52.1.71.29.29.43.29.71-.1.52-.29.71c-.19.19-.43.29-.71.29s-.52-.1-.71-.29ZM16,21c-.28,0-.52-.1-.71-.29-.19-.19-.29-.43-.29-.71s.1-.52.29-.71.43-.29.71-.29h1s0-14,0-14h-1c-.28,0-.52-.1-.71-.29s-.29-.43-.29-.71.1-.52.29-.71.43-.29.71-.29h4c.28,0,.52.1.71.29.19.19.29.43.29.71s-.1.52-.29.71c-.19.19-.43.29-.71.29h-1s0,14,0,14h1c.28,0,.52.1.71.29.19.19.29.43.29.71s-.1.52-.29.71c-.19.19-.43.29-.71.29h-4Z"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
- <path d="M10.76,13.24h-6.18c-.35,0-.64-.12-.88-.36s-.36-.53-.36-.88.12-.64.36-.88.53-.36.88-.36h6.18v-6.18c0-.35.12-.64.36-.88s.53-.36.88-.36.64.12.88.36.36.53.36.88v6.18h6.18c.35,0,.64.12.88.36.23.23.36.53.36.88s-.12.64-.36.88-.53.36-.88.36h-6.18v6.18c0,.35-.12.64-.36.88-.23.23-.53.36-.88.36s-.64-.12-.88-.36-.36-.53-.36-.88v-6.18Z"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <path d="M10.76,13.24h-6.18c-.35,0-.64-.12-.88-.36s-.36-.53-.36-.88.12-.64.36-.88.53-.36.88-.36h6.18v-6.18c0-.35.12-.64.36-.88s.53-.36.88-.36.64.12.88.36.36.53.36.88v6.18h6.18c.35,0,.64.12.88.36.23.23.36.53.36.88s-.12.64-.36.88-.53.36-.88.36h-6.18v6.18c0,.35-.12.64-.36.88-.23.23-.53.36-.88.36s-.64-.12-.88-.36-.36-.53-.36-.88v-6.18Z"/>
3
3
  </svg>
@@ -1,44 +1,44 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue';
3
- import type { AnySchema, ProseElement } from '@jsprose/core';
4
-
5
- import { useElementPhrase } from '../../composables/language.js';
6
- import AsideMenuSeparator from './AsideMenuSeparator.vue';
7
- import AsideMenuCopyLink from './AsideMenuCopyLink.vue';
8
-
9
- const { element } = defineProps<{
10
- element: ProseElement<AnySchema>;
11
- }>();
12
-
13
- const hasLink = computed(() => {
14
- return Boolean(element.id);
15
- });
16
-
17
- const hasButtons = computed(() => {
18
- return hasLink.value;
19
- });
20
-
21
- const phrase = await useElementPhrase(element);
22
- </script>
23
-
24
- <template>
25
- <div
26
- :style="{
27
- '--asideMenuGap': '5px',
28
- '--asideMenuGapBig': 'calc(var(--asideMenuGap) * 2)',
29
- }"
30
- class="bg-bg-main border-border flex w-40 flex-col rounded-sm border
31
- py-(--asideMenuGap) font-sans
32
- shadow-[0_0_12px_5px_light-dark(rgba(0,0,0,0.12),rgba(255,255,255,0.08))]
33
- backface-hidden"
34
- >
35
- <div
36
- class="flex items-center gap-(--asideMenuGapBig) px-(--asideMenuGapBig)
37
- py-(--asideMenuGap) text-xs font-medium"
38
- >
39
- <div>{{ phrase.element_name }}</div>
40
- </div>
41
- <AsideMenuSeparator v-if="hasButtons" />
42
- <AsideMenuCopyLink v-if="hasLink" :elementId="element.id!" />
43
- </div>
44
- </template>
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+ import type { AnySchema, ProseElement } from '@jsprose/core';
4
+
5
+ import { useElementPhrase } from '../../composables/language.js';
6
+ import AsideMenuSeparator from './AsideMenuSeparator.vue';
7
+ import AsideMenuCopyLink from './AsideMenuCopyLink.vue';
8
+
9
+ const { element } = defineProps<{
10
+ element: ProseElement<AnySchema>;
11
+ }>();
12
+
13
+ const hasLink = computed(() => {
14
+ return Boolean(element.id);
15
+ });
16
+
17
+ const hasButtons = computed(() => {
18
+ return hasLink.value;
19
+ });
20
+
21
+ const phrase = await useElementPhrase(element);
22
+ </script>
23
+
24
+ <template>
25
+ <div
26
+ :style="{
27
+ '--asideMenuGap': '5px',
28
+ '--asideMenuGapBig': 'calc(var(--asideMenuGap) * 2)',
29
+ }"
30
+ class="bg-bg-main border-border flex w-40 flex-col rounded-sm border
31
+ py-(--asideMenuGap) font-sans
32
+ shadow-[0_0_12px_5px_light-dark(rgba(0,0,0,0.12),rgba(255,255,255,0.08))]
33
+ backface-hidden"
34
+ >
35
+ <div
36
+ class="flex items-center gap-(--asideMenuGapBig) px-(--asideMenuGapBig)
37
+ py-(--asideMenuGap) text-xs font-medium"
38
+ >
39
+ <div>{{ phrase.element_name }}</div>
40
+ </div>
41
+ <AsideMenuSeparator v-if="hasButtons" />
42
+ <AsideMenuCopyLink v-if="hasLink" :elementId="element.id!" />
43
+ </div>
44
+ </template>
@@ -1,51 +1,51 @@
1
- <script lang="ts" setup>
2
- import { ref, watch } from 'vue';
3
-
4
- import { useProseContext } from '../../composables/context.js';
5
-
6
- const { icon, title } = defineProps<{
7
- icon: string;
8
- title: string;
9
- brand?: boolean;
10
- }>();
11
-
12
- const { EruditIcon, EruditTransition } = useProseContext();
13
-
14
- const key = ref(0);
15
- watch(
16
- () => [icon, title],
17
- () => {
18
- key.value++;
19
- },
20
- );
21
- </script>
22
-
23
- <template>
24
- <button
25
- :class="[
26
- 'relative cursor-pointer text-left text-xs transition-[color,background]',
27
- brand
28
- ? 'text-brand bg-brand/10'
29
- : 'hocus:bg-bg-accent text-text-muted hocus:text-text',
30
- ]"
31
- >
32
- <div
33
- class="pointer-events-none invisible flex touch-none flex-wrap
34
- items-center gap-(--asideMenuGapBig) px-(--asideMenuGapBig)
35
- py-(--asideMenuGap)"
36
- >
37
- <EruditIcon :name="icon" class="shrink-0 text-[1.2em]" />
38
- <div>{{ title }}</div>
39
- </div>
40
- <EruditTransition>
41
- <div
42
- :key
43
- class="absolute top-0 left-0 flex flex-wrap items-center
44
- gap-(--asideMenuGapBig) px-(--asideMenuGapBig) py-(--asideMenuGap)"
45
- >
46
- <EruditIcon :name="icon" class="shrink-0 text-[1.2em]" />
47
- <div>{{ title }}</div>
48
- </div>
49
- </EruditTransition>
50
- </button>
51
- </template>
1
+ <script lang="ts" setup>
2
+ import { ref, watch } from 'vue';
3
+
4
+ import { useProseContext } from '../../composables/context.js';
5
+
6
+ const { icon, title } = defineProps<{
7
+ icon: string;
8
+ title: string;
9
+ brand?: boolean;
10
+ }>();
11
+
12
+ const { EruditIcon, EruditTransition } = useProseContext();
13
+
14
+ const key = ref(0);
15
+ watch(
16
+ () => [icon, title],
17
+ () => {
18
+ key.value++;
19
+ },
20
+ );
21
+ </script>
22
+
23
+ <template>
24
+ <button
25
+ :class="[
26
+ 'relative cursor-pointer text-left text-xs transition-[color,background]',
27
+ brand
28
+ ? 'text-brand bg-brand/10'
29
+ : 'hocus:bg-bg-accent text-text-muted hocus:text-text',
30
+ ]"
31
+ >
32
+ <div
33
+ class="pointer-events-none invisible flex touch-none flex-wrap
34
+ items-center gap-(--asideMenuGapBig) px-(--asideMenuGapBig)
35
+ py-(--asideMenuGap)"
36
+ >
37
+ <EruditIcon :name="icon" class="shrink-0 text-[1.2em]" />
38
+ <div>{{ title }}</div>
39
+ </div>
40
+ <EruditTransition>
41
+ <div
42
+ :key
43
+ class="absolute top-0 left-0 flex flex-wrap items-center
44
+ gap-(--asideMenuGapBig) px-(--asideMenuGapBig) py-(--asideMenuGap)"
45
+ >
46
+ <EruditIcon :name="icon" class="shrink-0 text-[1.2em]" />
47
+ <div>{{ title }}</div>
48
+ </div>
49
+ </EruditTransition>
50
+ </button>
51
+ </template>
@@ -1,40 +1,40 @@
1
- <script lang="ts" setup>
2
- import { ref } from 'vue';
3
-
4
- import { useProseContext } from '../../composables/context.js';
5
- import { useProseLanguage } from '../../composables/language.js';
6
- import AsideMenuButton from './AsideMenuButton.vue';
7
- import shareIcon from '../assets/share.svg?raw';
8
- import checkIcon from '../assets/check.svg?raw';
9
-
10
- const { elementId } = defineProps<{
11
- elementId: string;
12
- }>();
13
-
14
- const { pathUrl, baseUrl } = useProseContext();
15
- const prosePhrase = await useProseLanguage();
16
-
17
- const copied = ref(false);
18
- let resetTimer: number | undefined;
19
-
20
- async function copyLink() {
21
- await navigator.clipboard.writeText(
22
- location.origin + baseUrl + pathUrl.substring(1) + '#' + elementId,
23
- );
24
- copied.value = true;
25
- if (resetTimer) clearTimeout(resetTimer);
26
- resetTimer = window.setTimeout(() => {
27
- copied.value = false;
28
- resetTimer = undefined;
29
- }, 2500);
30
- }
31
- </script>
32
-
33
- <template>
34
- <AsideMenuButton
35
- :brand="copied"
36
- :icon="copied ? checkIcon : shareIcon"
37
- :title="copied ? prosePhrase.copied : prosePhrase.copy_link"
38
- @click="copyLink"
39
- />
40
- </template>
1
+ <script lang="ts" setup>
2
+ import { ref } from 'vue';
3
+
4
+ import { useProseContext } from '../../composables/context.js';
5
+ import { useProseLanguage } from '../../composables/language.js';
6
+ import AsideMenuButton from './AsideMenuButton.vue';
7
+ import shareIcon from '../assets/share.svg?raw';
8
+ import checkIcon from '../assets/check.svg?raw';
9
+
10
+ const { elementId } = defineProps<{
11
+ elementId: string;
12
+ }>();
13
+
14
+ const { pathUrl, baseUrl } = useProseContext();
15
+ const prosePhrase = await useProseLanguage();
16
+
17
+ const copied = ref(false);
18
+ let resetTimer: number | undefined;
19
+
20
+ async function copyLink() {
21
+ await navigator.clipboard.writeText(
22
+ location.origin + baseUrl + pathUrl.substring(1) + '#' + elementId,
23
+ );
24
+ copied.value = true;
25
+ if (resetTimer) clearTimeout(resetTimer);
26
+ resetTimer = window.setTimeout(() => {
27
+ copied.value = false;
28
+ resetTimer = undefined;
29
+ }, 2500);
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <AsideMenuButton
35
+ :brand="copied"
36
+ :icon="copied ? checkIcon : shareIcon"
37
+ :title="copied ? prosePhrase.copied : prosePhrase.copy_link"
38
+ @click="copyLink"
39
+ />
40
+ </template>
@@ -1,3 +1,3 @@
1
- <template>
2
- <hr class="border-border/80 my-(--asideMenuGap)" />
3
- </template>
1
+ <template>
2
+ <hr class="border-border/80 my-(--asideMenuGap)" />
3
+ </template>