@erudit-js/prose 4.3.0-dev.1 → 4.3.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/shared/block/AsideMenu.vue +4 -1
- package/dist/elements/callout/Callout.vue +21 -0
- package/dist/elements/callout/core.d.ts +1 -0
- package/dist/elements/callout/storage.js +11 -1
- package/dist/slugify/languages/en.js +1 -1
- package/dist/slugify/languages/ru.js +1 -1
- package/package.json +8 -8
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import type { ProseElement } from 'tsprose';
|
|
4
4
|
|
|
5
|
+
import { useProseContext } from '../../composables/context.js';
|
|
5
6
|
import { useElementPhrase } from '../../composables/language.js';
|
|
6
7
|
import AsideMenuSeparator from './AsideMenuSeparator.vue';
|
|
7
8
|
import AsideMenuCopyLink from './AsideMenuCopyLink.vue';
|
|
@@ -10,8 +11,10 @@ const { element } = defineProps<{
|
|
|
10
11
|
element: ProseElement;
|
|
11
12
|
}>();
|
|
12
13
|
|
|
14
|
+
const { setHtmlIds } = useProseContext();
|
|
15
|
+
|
|
13
16
|
const hasLink = computed(() => {
|
|
14
|
-
return Boolean(element.id);
|
|
17
|
+
return setHtmlIds && Boolean(element.id);
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
const hasButtons = computed(() => {
|
|
@@ -21,7 +21,18 @@ const formatText = useFormatText();
|
|
|
21
21
|
class="gap-big flex"
|
|
22
22
|
>
|
|
23
23
|
<div class="max-micro:hidden shrink-0">
|
|
24
|
+
<video
|
|
25
|
+
v-if="calloutStorage.videoIcon"
|
|
26
|
+
:src="calloutStorage.resolvedIconSrc"
|
|
27
|
+
autoplay
|
|
28
|
+
loop
|
|
29
|
+
muted
|
|
30
|
+
playsinline
|
|
31
|
+
class="outline-border size-[60px] rounded-full border-2
|
|
32
|
+
border-transparent object-cover outline-2"
|
|
33
|
+
/>
|
|
24
34
|
<img
|
|
35
|
+
v-else
|
|
25
36
|
:src="calloutStorage.resolvedIconSrc"
|
|
26
37
|
loading="lazy"
|
|
27
38
|
class="outline-border size-[60px] rounded-full border-2
|
|
@@ -39,7 +50,17 @@ const formatText = useFormatText();
|
|
|
39
50
|
class="gap-small mb-(--proseAsideWidth) flex items-center
|
|
40
51
|
px-(--proseAsideWidth) font-semibold"
|
|
41
52
|
>
|
|
53
|
+
<video
|
|
54
|
+
v-if="calloutStorage.videoIcon"
|
|
55
|
+
:src="calloutStorage.resolvedIconSrc"
|
|
56
|
+
autoplay
|
|
57
|
+
loop
|
|
58
|
+
muted
|
|
59
|
+
playsinline
|
|
60
|
+
class="micro:hidden size-[30px] shrink-0 rounded-full object-cover"
|
|
61
|
+
/>
|
|
42
62
|
<img
|
|
63
|
+
v-else
|
|
43
64
|
:src="calloutStorage.resolvedIconSrc"
|
|
44
65
|
class="micro:hidden size-[30px] shrink-0 rounded-full"
|
|
45
66
|
/>
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { projectRelFilePath } from "../../shared/filePath.js";
|
|
2
|
+
const videoExtensions = [
|
|
3
|
+
"mp4",
|
|
4
|
+
"webm",
|
|
5
|
+
"ogg"
|
|
6
|
+
];
|
|
2
7
|
export function createCalloutStorage(projectAbsPath, projectBaseUrl, calloutAbsoluteIconSrc) {
|
|
3
8
|
const resolvedIconSrc = projectBaseUrl + "file/" + projectRelFilePath(projectAbsPath, calloutAbsoluteIconSrc);
|
|
4
|
-
|
|
9
|
+
const ext = calloutAbsoluteIconSrc.split(".").pop()?.toLowerCase() ?? "";
|
|
10
|
+
const videoIcon = videoExtensions.includes(ext);
|
|
11
|
+
return {
|
|
12
|
+
resolvedIconSrc,
|
|
13
|
+
videoIcon
|
|
14
|
+
};
|
|
5
15
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export default (text) => {
|
|
2
|
-
return text.replace(/(\p{Lu}{2,})(\p{Ll})/gu, "$1-$2").replace(/(\p{Ll})(\p{Lu})/gu, "$1-$2").replace(/(\p{L})(\d)/gu, "$1-$2").replace(/(\d)(\p{L})/gu, "$1-$2").toLowerCase().replace(/[
|
|
2
|
+
return text.replace(/(\p{Lu}{2,})(\p{Ll})/gu, "$1-$2").replace(/(\p{Ll})(\p{Lu})/gu, "$1-$2").replace(/(\p{L})(\d)/gu, "$1-$2").replace(/(\d)(\p{L})/gu, "$1-$2").toLowerCase().replace(/[^\p{L}0-9]/gu, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3
3
|
};
|
|
@@ -34,5 +34,5 @@ export default (text) => {
|
|
|
34
34
|
ю: "yu",
|
|
35
35
|
я: "ya"
|
|
36
36
|
};
|
|
37
|
-
return text.replace(/(\p{Lu}{2,})(\p{Ll})/gu, "$1-$2").replace(/(\p{Ll})(\p{Lu})/gu, "$1-$2").replace(/(\p{L})(\d)/gu, "$1-$2").replace(/(\d)(\p{L})/gu, "$1-$2").toLowerCase().split("").map((char) => cyrillicToLatin[char] !== undefined ? cyrillicToLatin[char] : /[
|
|
37
|
+
return text.replace(/(\p{Lu}{2,})(\p{Ll})/gu, "$1-$2").replace(/(\p{Ll})(\p{Lu})/gu, "$1-$2").replace(/(\p{L})(\d)/gu, "$1-$2").replace(/(\d)(\p{L})/gu, "$1-$2").toLowerCase().split("").map((char) => cyrillicToLatin[char] !== undefined ? cyrillicToLatin[char] : /[\p{L}0-9]/u.test(char) ? char : "-").join("").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
38
38
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@erudit-js/prose",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.1-dev.1",
|
|
5
5
|
"description": "📝 JSX prose subsystem for Erudit sites",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"prepack": "bun run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@erudit-js/core": "4.3.
|
|
36
|
-
"@floating-ui/vue": "^1.1.
|
|
35
|
+
"@erudit-js/core": "4.3.1-dev.1",
|
|
36
|
+
"@floating-ui/vue": "^1.1.11",
|
|
37
37
|
"image-size": "^2.0.2",
|
|
38
|
-
"katex": "^0.16.
|
|
39
|
-
"mermaid": "^11.
|
|
38
|
+
"katex": "^0.16.38",
|
|
39
|
+
"mermaid": "^11.13.0",
|
|
40
40
|
"photoswipe": "^5.4.4",
|
|
41
41
|
"tsprose": "^1.0.1",
|
|
42
|
-
"vue": "
|
|
42
|
+
"vue": "latest"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"glob": "13.0.
|
|
46
|
-
"oxc-transform": "0.
|
|
45
|
+
"glob": "^13.0.6",
|
|
46
|
+
"oxc-transform": "0.119.0",
|
|
47
47
|
"ts-xor": "^1.3.0"
|
|
48
48
|
}
|
|
49
49
|
}
|