@turnipxenon/pineapple 5.3.9 → 5.3.10
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/modules/parsnip/external-images/ParsnipImage.svelte +8 -3
- package/dist/modules/parsnip/external-images/ParsnipImageCollection.svelte +4 -4
- package/dist/modules/parsnip/external-images/externalImages.remote.d.ts.map +1 -1
- package/dist/modules/parsnip/external-images/externalImages.remote.js +18 -13
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (url.includes("rabiole") || url.includes("photo-gallery")) {
|
|
23
|
+
if (url.includes("rabiole") || url.includes("photo-gallery") || url.includes("photos")) {
|
|
24
24
|
getPhotoDetails(url).then(data => {
|
|
25
25
|
if (data) {
|
|
26
26
|
details = data;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
{#if details.tags.length}
|
|
43
43
|
<ul class="tags">
|
|
44
44
|
{#each details.tags as tag}
|
|
45
|
-
<li><a href="{galleryBase}/photos?tags={tag}" target="_blank">{tag}</a></li>
|
|
45
|
+
<li><a href="{galleryBase}/photos?tags={tag}" target="_blank" rel="external">{tag}</a></li>
|
|
46
46
|
{/each}
|
|
47
47
|
</ul>
|
|
48
48
|
{/if}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
border-radius: var(--radius-sm);
|
|
61
61
|
max-height: min(50vh, 24lh);
|
|
62
62
|
margin: auto;
|
|
63
|
-
|
|
63
|
+
object-fit: contain;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.parsnip-image-described {
|
|
@@ -76,6 +76,11 @@
|
|
|
76
76
|
display: flex;
|
|
77
77
|
flex-direction: column;
|
|
78
78
|
gap: 0.25rem;
|
|
79
|
+
|
|
80
|
+
a::after {
|
|
81
|
+
top: -0.125lh;
|
|
82
|
+
left: 0.2em;
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
.parsnip-image-meta p {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const { url, imageList }: { url?: string, imageList?: Image[] } = $props();
|
|
9
9
|
|
|
10
|
-
const withDescription = untrack(() => url?.includes(
|
|
10
|
+
const withDescription = untrack(() => url?.includes("with-description=true") ?? false);
|
|
11
11
|
|
|
12
12
|
let data = $state<{
|
|
13
13
|
photos: {
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
flex-direction: row;
|
|
52
52
|
flex-wrap: wrap;
|
|
53
53
|
justify-content: stretch;
|
|
54
|
-
|
|
54
|
+
gap: 0.5rem 0.5lh;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
:global {
|
|
58
58
|
.parsnip-image-collection > * {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
flex: 1 1 24rem;
|
|
60
|
+
width: 0;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"externalImages.remote.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/externalImages.remote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"externalImages.remote.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/externalImages.remote.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,eAAe;;;UARG,MAAM,EAAE;;SAQ0B,CAAC;AAElE,eAAO,MAAM,sBAAsB,0DAcjC,CAAC"}
|
|
@@ -10,15 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { query } from "$app/server";
|
|
11
11
|
import * as v from "valibot";
|
|
12
12
|
const UrlSchema = v.pipe(v.string(), v.url());
|
|
13
|
-
|
|
13
|
+
// todo: test this one itself
|
|
14
|
+
// todo: test with a fake parsed obsidian
|
|
15
|
+
const _getPhotoDetails = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
16
|
var _a, _b, _c, _d;
|
|
15
|
-
if (!url.includes("rabiole") && !url.includes("photos"))
|
|
17
|
+
if (!url.includes("rabiole") && !url.includes("photos") && !url.includes("photo-gallery"))
|
|
16
18
|
return null;
|
|
17
19
|
const apiUrl = url
|
|
18
|
-
.replace(/[?#].*$/,
|
|
19
|
-
.replace(/^(https?:\/\/)(rabiole|photos)\./,
|
|
20
|
-
.replace(
|
|
21
|
-
.replace(/\.(jpeg|png)$/,
|
|
20
|
+
.replace(/[?#].*$/, "")
|
|
21
|
+
.replace(/^(https?:\/\/)(rabiole|photos)\./, "$1photo-gallery.")
|
|
22
|
+
.replace("/photos/", "/api/photos/")
|
|
23
|
+
.replace(/\.(jpeg|png|jpg)$/, "");
|
|
22
24
|
try {
|
|
23
25
|
const resp = yield fetch(apiUrl);
|
|
24
26
|
const data = yield resp.json();
|
|
@@ -26,25 +28,28 @@ export const getPhotoDetails = query(UrlSchema, (url) => __awaiter(void 0, void
|
|
|
26
28
|
if (!photo)
|
|
27
29
|
return null;
|
|
28
30
|
return {
|
|
29
|
-
altText: (_a = photo.altText) !== null && _a !== void 0 ? _a :
|
|
30
|
-
description: (_b = photo.description) !== null && _b !== void 0 ? _b :
|
|
31
|
+
altText: (_a = photo.altText) !== null && _a !== void 0 ? _a : "",
|
|
32
|
+
description: (_b = photo.description) !== null && _b !== void 0 ? _b : "",
|
|
31
33
|
tags: ((_c = photo.tags) !== null && _c !== void 0 ? _c : []),
|
|
32
|
-
createdAt: (_d = photo.createdAt) !== null && _d !== void 0 ? _d :
|
|
34
|
+
createdAt: (_d = photo.createdAt) !== null && _d !== void 0 ? _d : ""
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
catch (_e) {
|
|
36
38
|
return null;
|
|
37
39
|
}
|
|
38
|
-
})
|
|
40
|
+
});
|
|
41
|
+
export const getPhotoDetails = query(UrlSchema, _getPhotoDetails);
|
|
39
42
|
export const getPhotoCollectionMeta = query(UrlSchema, (url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
43
|
if (!url.includes("photo-gallery")) {
|
|
41
|
-
return
|
|
44
|
+
return "";
|
|
42
45
|
}
|
|
46
|
+
const apiUrl = url
|
|
47
|
+
.replace("/photos/", "/api/photos/");
|
|
43
48
|
try {
|
|
44
|
-
const resp = yield fetch(
|
|
49
|
+
const resp = yield fetch(apiUrl);
|
|
45
50
|
return yield resp.json();
|
|
46
51
|
}
|
|
47
52
|
catch (_a) {
|
|
48
|
-
return
|
|
53
|
+
return "";
|
|
49
54
|
}
|
|
50
55
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "5.3.
|
|
4
|
+
"version": "5.3.10",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@commitlint/cli": "^19.8.1",
|
|
7
7
|
"@commitlint/config-conventional": "^19.8.1",
|