@turnipxenon/pineapple 5.3.3 → 5.3.4
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/components/dialog_manager/DialogManager.d.ts +5 -3
- package/dist/components/dialog_manager/DialogManager.d.ts.map +1 -1
- package/dist/components/dialog_manager/DialogManager.js +18 -10
- package/dist/components/reveal-info/RevealInfo.svelte +2 -1
- package/dist/components/reveal-info/RevealInfo.svelte.d.ts.map +1 -1
- package/dist/modules/overrideable_meta/OverridableMeta.svelte +27 -21
- package/dist/modules/overrideable_meta/OverridableMeta.svelte.d.ts.map +1 -1
- package/dist/modules/parsnip/ParsnipBlockChildren.svelte +16 -3
- package/dist/modules/parsnip/ParsnipBlockChildren.svelte.d.ts.map +1 -1
- package/dist/modules/parsnip/external-images/ParsnipImage.svelte +5 -4
- package/dist/modules/parsnip/external-images/ParsnipImage.svelte.d.ts.map +1 -1
- package/dist/modules/parsnip/external-images/ParsnipImageCollection.svelte +2 -1
- package/dist/modules/parsnip/external-images/ParsnipImageCollection.svelte.d.ts.map +1 -1
- package/dist/modules/parsnip/route-util/slugPageServerLoad.js +2 -2
- package/dist/ui/components/MeltToaster/MeltToaster.svelte +1 -1
- package/dist/ui/components/NestedNavigation.svelte +1 -1
- package/dist/ui/components/SocialSection.svelte +2 -2
- package/dist/ui/components/randomized-background/RandomizedImage.svelte +7 -5
- package/dist/ui/components/randomized-background/RandomizedImage.svelte.d.ts.map +1 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +1 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte.d.ts.map +1 -1
- package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +3 -1
- package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts.map +1 -1
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +3 -4
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte.d.ts.map +1 -1
- package/dist/ui/modules/NavigationMenu/LdSchema.d.ts +26 -0
- package/dist/ui/modules/NavigationMenu/LdSchema.d.ts.map +1 -0
- package/dist/ui/modules/NavigationMenu/LdSchema.js +18 -0
- package/dist/ui/modules/NavigationMenu/NavigationControl.svelte.d.ts +1 -1
- package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte +33 -29
- package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte.d.ts +1 -1
- package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte.d.ts.map +1 -1
- package/dist/ui/modules/NavigationMenu/PageMeta.d.ts +1 -9
- package/dist/ui/modules/NavigationMenu/PageMeta.d.ts.map +1 -1
- package/dist/ui/modules/NavigationMenu/PageMeta.js +1 -1
- package/dist/ui/modules/NavigationMenu/index.d.ts +1 -0
- package/dist/ui/modules/NavigationMenu/index.d.ts.map +1 -1
- package/dist/ui/modules/NavigationMenu/index.js +1 -0
- package/dist/ui/modules/universal-overlay/DialogPanel.svelte +58 -39
- package/dist/ui/modules/universal-overlay/DialogPanel.svelte.d.ts.map +1 -1
- package/dist/ui/templates/SeaweedLayout/EntryGroup.svelte +2 -2
- package/dist/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte +3 -2
- package/dist/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte.d.ts.map +1 -1
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.svelte +5 -9
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.svelte.d.ts.map +1 -1
- package/dist/ui/templates/blog_template/BlogTemplate.svelte +8 -6
- package/dist/ui/templates/blog_template/BlogTemplate.svelte.d.ts +1 -1
- package/dist/ui/templates/blog_template/BlogTemplate.svelte.d.ts.map +1 -1
- package/dist/ui/templates/blog_template/BlogTemplateInner.svelte +8 -5
- package/dist/ui/templates/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
- package/dist/ui/templates/blog_template/BlogTemplateInner.svelte.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DialogManager is the object we want to interact with in Svelte
|
|
3
3
|
*/
|
|
4
|
-
import { type DialogMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
|
|
5
|
-
import type { DialogDetail } from "../../types/pineapple_fiber/DialogDetail";
|
|
6
|
-
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
7
4
|
import { DialogProcessor } from "./DialogProcessor";
|
|
8
5
|
import type { IDialogManager } from "./IDialogManager";
|
|
6
|
+
import type { DialogDetail } from "../../types/pineapple_fiber/DialogDetail";
|
|
7
|
+
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
8
|
+
import { type DialogMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
|
|
9
9
|
export type OnSetDialogChoiceCallback = (newMessage: DialogDetail) => void;
|
|
10
10
|
export declare class DialogManager implements IDialogManager {
|
|
11
11
|
dialogMessageMap: Map<string, DialogDetail>;
|
|
@@ -16,6 +16,7 @@ export declare class DialogManager implements IDialogManager {
|
|
|
16
16
|
currentIndex: number;
|
|
17
17
|
previousTimestamp: number;
|
|
18
18
|
isDoneTransition: boolean;
|
|
19
|
+
isDoneTransitionWritable: import("svelte/store").Writable<boolean>;
|
|
19
20
|
currentPortrait: import("svelte/store").Writable<string>;
|
|
20
21
|
portraitMap: Map<string, string>;
|
|
21
22
|
currentState: DialogState;
|
|
@@ -30,6 +31,7 @@ export declare class DialogManager implements IDialogManager {
|
|
|
30
31
|
enableDialogueOverlayCache: boolean;
|
|
31
32
|
updateRate: number;
|
|
32
33
|
dialogVariableStore: DialogMapStore;
|
|
34
|
+
_choiceListenerController: AbortController | null;
|
|
33
35
|
constructor();
|
|
34
36
|
/**
|
|
35
37
|
* when users interact with the dialog, they can skip the transition like in a game
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogManager.d.ts","sourceRoot":"","sources":["../../../src/lib/components/dialog_manager/DialogManager.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"DialogManager.d.ts","sourceRoot":"","sources":["../../../src/lib/components/dialog_manager/DialogManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAQxG,MAAM,MAAM,yBAAyB,GAAG,CAAC,UAAU,EAAE,YAAY,KAAK,IAAI,CAAC;AAE3E,qBAAa,aAAc,YAAW,cAAc;IACnD,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IACxD,iBAAiB,EAAE,YAAY,EAAE,CAAwB;IACzD,kBAAkB,EAAE,MAAM,CAAuC;IACjE,kBAAkB,EAAE,YAAY,CAA2B;IAC3D,cAAc,0CAAgB;IAC9B,YAAY,SAAK;IACjB,iBAAiB,SAAK;IACtB,gBAAgB,UAAS;IACzB,wBAAwB,2CAAmB;IAC3C,eAAe,0CAAgB;IAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IAC7C,YAAY,cAAuB;IACnC,oBAAoB,+CAA+B;IACnD,WAAW,0CAGR;IACH,iBAAiB,0CAGd;IACH,kBAAkB,SAAK;IACvB,eAAe,EAAE,eAAe,CAAC;IAEjC,qBAAqB,EAAE,YAAY,EAAE,CAAM;IAC3C,qBAAqB,UAAS;IAC9B,oBAAoB,EAAE,yBAAyB,EAAE,CAAM;IACvD,0BAA0B,UAAS;IACnC,UAAU,SAAa;IACvB,mBAAmB,EAAE,cAAc,CAAC;IACpC,yBAAyB,EAAE,eAAe,GAAG,IAAI,CAAQ;;IAgCzD;;;OAGG;IACH,aAAa,aASX;IAEF;;;OAGG;IACH,YAAY,GAAI,cAAc,OAAO,UAEnC;IAEF;;;;;OAKG;IACH,aAAa,GAAI,eAAe,YAAY,EAAE,EAAE,qBAAiB,UAsC/D;IAEF;;;;OAIG;IACH,0BAA0B,GAAI,UAAU,yBAAyB,UAE/D;IAEF;;;;OAIG;IACH,4BAA4B,GAAI,UAAU,yBAAyB,UAOjE;IAEF;;;;;;OAMG;IACH,eAAe,GAAI,YAAY,YAAY,GAAG,SAAS,UAWrD;IAEF,mBAAmB,GAAI,UAAU,MAAM,UAOrC;IAEF,gBAAgB,aA8Cd;IAEF,kBAAkB,aAEhB;IAEF;;;;;;;;OAQG;IACH,MAAM,GAAI,WAAW,MAAM,UA2DzB;IAEF,mBAAmB,CAAC,MAAM,EAAE,OAAO;IAInC,mBAAmB;IAIb,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAQrF,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAiBnF,aAAa,CAAC,OAAO,EAAE,MAAM;CAG7B;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -10,24 +10,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
import { createNewMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
|
|
14
|
-
import { writable } from "svelte/store";
|
|
15
|
-
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
16
|
-
import { tweened } from "svelte/motion";
|
|
17
|
-
import { backOut, linear } from "svelte/easing";
|
|
18
|
-
import { PortraitType } from "../../types/pineapple_fiber/PortraitType";
|
|
19
|
-
import AresHappy from "../../assets/characters/ares/ares_happy.webp";
|
|
20
13
|
import AresBlushing from "../../assets/characters/ares/ares_blushing.webp";
|
|
21
14
|
import AresDisappointed from "../../assets/characters/ares/ares_disappointed.webp";
|
|
15
|
+
import AresHappy from "../../assets/characters/ares/ares_happy.webp";
|
|
22
16
|
import AresLetsGo from "../../assets/characters/ares/ares_lets_go.webp";
|
|
23
17
|
import AresMad from "../../assets/characters/ares/ares_mad.webp";
|
|
24
18
|
import AresNeutral from "../../assets/characters/ares/ares_neutral.webp";
|
|
25
19
|
import AresSlightlyMad from "../../assets/characters/ares/ares_slightly_mad.webp";
|
|
26
20
|
import AresSurprised from "../../assets/characters/ares/ares_surprised.webp";
|
|
27
21
|
import AresYay from "../../assets/characters/ares/ares_yay.webp";
|
|
28
|
-
import { defaultDialogMessage, enableUniversalOverlaySvelte4
|
|
22
|
+
import { defaultDialogMessage, enableUniversalOverlaySvelte4 } from "./DialogManagerStore";
|
|
29
23
|
import { DialogProcessor } from "./DialogProcessor";
|
|
30
24
|
import { parseYarn } from "../../scripts/pineapple_fiber/PineappleFiberParser";
|
|
25
|
+
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
26
|
+
import { createNewMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
|
|
27
|
+
import { PortraitType } from "../../types/pineapple_fiber/PortraitType";
|
|
28
|
+
import { backOut, linear } from "svelte/easing";
|
|
29
|
+
import { tweened } from "svelte/motion";
|
|
30
|
+
import { writable } from "svelte/store";
|
|
31
31
|
const shouldDebugYarn = false;
|
|
32
32
|
export class DialogManager {
|
|
33
33
|
constructor() {
|
|
@@ -39,6 +39,7 @@ export class DialogManager {
|
|
|
39
39
|
this.currentIndex = 0;
|
|
40
40
|
this.previousTimestamp = 0;
|
|
41
41
|
this.isDoneTransition = false;
|
|
42
|
+
this.isDoneTransitionWritable = writable(false);
|
|
42
43
|
this.currentPortrait = writable("");
|
|
43
44
|
this.portraitMap = new Map();
|
|
44
45
|
this.currentState = DialogState.Visible;
|
|
@@ -58,6 +59,7 @@ export class DialogManager {
|
|
|
58
59
|
this.onSetDialogListeners = [];
|
|
59
60
|
this.enableDialogueOverlayCache = false;
|
|
60
61
|
this.updateRate = 40 / 1000;
|
|
62
|
+
this._choiceListenerController = null;
|
|
61
63
|
/**
|
|
62
64
|
* when users interact with the dialog, they can skip the transition like in a game
|
|
63
65
|
* note that there is a cool down to this, check out skipNextActiveTime
|
|
@@ -183,7 +185,7 @@ export class DialogManager {
|
|
|
183
185
|
// set the portrait
|
|
184
186
|
let portraitValue = AresHappy;
|
|
185
187
|
if (this.currentMessageMeta.portraitType) {
|
|
186
|
-
portraitValue = (_b = this.portraitMap.get((_a = this.currentMessageMeta.portraitType) !== null && _a !== void 0 ? _a : AresHappy)) !== null && _b !== void 0 ? _b :
|
|
188
|
+
portraitValue = (_b = this.portraitMap.get((_a = this.currentMessageMeta.portraitType) !== null && _a !== void 0 ? _a : AresHappy)) !== null && _b !== void 0 ? _b : "";
|
|
187
189
|
}
|
|
188
190
|
if (portraitValue) {
|
|
189
191
|
this.currentPortrait.update(() => portraitValue);
|
|
@@ -194,6 +196,7 @@ export class DialogManager {
|
|
|
194
196
|
this.currentIndex = 0;
|
|
195
197
|
this.skipNextActiveTime = this.previousTimestamp + 1000; // guard
|
|
196
198
|
this.isDoneTransition = false; // must be after the guard
|
|
199
|
+
this.isDoneTransitionWritable.set(false);
|
|
197
200
|
if (shouldDebugYarn) {
|
|
198
201
|
console.info(`Currently processing node: ${this.currentMessageMeta.dialogId}`);
|
|
199
202
|
}
|
|
@@ -224,6 +227,7 @@ export class DialogManager {
|
|
|
224
227
|
* ISSUE #81 https://github.com/TurnipXenon/pineapple/issues/81
|
|
225
228
|
*/
|
|
226
229
|
this.update = (timestamp) => {
|
|
230
|
+
var _a;
|
|
227
231
|
if (this.currentState == DialogState.Invisible || this.currentState == DialogState.Busy) {
|
|
228
232
|
window.requestAnimationFrame(this.update);
|
|
229
233
|
return;
|
|
@@ -231,15 +235,19 @@ export class DialogManager {
|
|
|
231
235
|
// if visible
|
|
232
236
|
// text transition loop
|
|
233
237
|
if (!this.isDoneTransition && this.currentIndex > this.fullCurrentMessage.length) {
|
|
238
|
+
(_a = this._choiceListenerController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
239
|
+
this._choiceListenerController = new AbortController();
|
|
240
|
+
const { signal } = this._choiceListenerController;
|
|
234
241
|
const elementList = document.getElementsByClassName("dialog-choice");
|
|
235
242
|
for (const el of elementList) {
|
|
236
243
|
el.addEventListener("click", () => {
|
|
237
244
|
// todo: make more robust; for now we're assuming first class is our choice
|
|
238
245
|
const choice = el.classList[0].split("-")[1];
|
|
239
246
|
this.setDialogChoice(this.dialogMessageMap.get(choice));
|
|
240
|
-
});
|
|
247
|
+
}, { signal });
|
|
241
248
|
}
|
|
242
249
|
this.isDoneTransition = true;
|
|
250
|
+
this.isDoneTransitionWritable.set(true);
|
|
243
251
|
}
|
|
244
252
|
// guard: skip if done or if not yet time to update
|
|
245
253
|
if (this.currentIndex > this.fullCurrentMessage.length ||
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import VisibilityIcon from "../../assets/icons/icon-visibility.svg";
|
|
4
4
|
import { ButtonVariant, PinyaButton, type PinyaButtonProps } from "../../ui/elements/index";
|
|
5
5
|
import type { Snippet } from "svelte";
|
|
6
|
+
import { untrack } from "svelte";
|
|
6
7
|
import ImageIcon from "../../ui/elements/ImageIcon.svelte";
|
|
7
8
|
import { type RevealInfoRecord } from "./RevealInfoCollection";
|
|
8
9
|
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
|
|
22
23
|
type State = "ready" | "loading" | "error" | "done";
|
|
23
24
|
|
|
24
|
-
let revealValue = $state(infoRecord.placeholder);
|
|
25
|
+
let revealValue = $state(untrack(() => infoRecord.placeholder));
|
|
25
26
|
let _state = $state<State>("ready");
|
|
26
27
|
let uid = $props.id();
|
|
27
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevealInfo.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/reveal-info/RevealInfo.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"RevealInfo.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/reveal-info/RevealInfo.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,KAAK,gBAAgB,GAAI;IACxB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;CAChC,GAAG,IAAI,CAAC,gBAAgB,EAAI,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;AA4EhE,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -37,25 +37,31 @@ export const load = async (): Promise<OverridableMetaProps> => {
|
|
|
37
37
|
ogImage = []
|
|
38
38
|
}: Props = $props();
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
40
|
+
const updatePageMeta = () => {
|
|
41
|
+
if (rootUrl) {
|
|
42
|
+
pinyaHead.rootUrl = rootUrl;
|
|
43
|
+
}
|
|
44
|
+
if (title) {
|
|
45
|
+
pinyaHead.title = title;
|
|
46
|
+
}
|
|
47
|
+
if (ogTitle) {
|
|
48
|
+
pinyaHead.ogTitle = ogTitle;
|
|
49
|
+
}
|
|
50
|
+
if (ogDescription) {
|
|
51
|
+
pinyaHead.ogDescription = ogDescription;
|
|
52
|
+
}
|
|
53
|
+
if (ogImage) {
|
|
54
|
+
pinyaHead.ogImage = ogImage.map(img => {
|
|
55
|
+
if (img.startsWith("/")) {
|
|
56
|
+
return `${pinyaHead.rootUrl}${img}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return img;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
updatePageMeta();
|
|
65
|
+
|
|
66
|
+
$effect(updatePageMeta);
|
|
61
67
|
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverridableMeta.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/modules/overrideable_meta/OverridableMeta.svelte.ts"],"names":[],"mappings":"AAMC,UAAU,KAAK;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"OverridableMeta.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/modules/overrideable_meta/OverridableMeta.svelte.ts"],"names":[],"mappings":"AAMC,UAAU,KAAK;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AA8CF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -4,12 +4,27 @@
|
|
|
4
4
|
import ParsnipList from "./ParsnipList.svelte";
|
|
5
5
|
import ParsnipParagraph from "./ParsnipParagraph.svelte";
|
|
6
6
|
import ParsnipPhrasingChildren from "./ParsnipPhrasingChildren.svelte";
|
|
7
|
+
import type { CodeBlockLang } from "../../ui/elements/CodeBlock/CodeBlockProps";
|
|
7
8
|
import { CodeBlock } from "../../ui/elements/index";
|
|
8
9
|
import type { Content } from "mdast";
|
|
9
10
|
import Self from "./ParsnipBlockChildren.svelte";
|
|
10
11
|
|
|
11
12
|
const { blockChildren, shouldUnwrapParagraph = false }
|
|
12
13
|
: { blockChildren: Content[], shouldUnwrapParagraph?: boolean } = $props();
|
|
14
|
+
|
|
15
|
+
const KNOWN_BLOCK_TYPES = new Set(['paragraph', 'heading', 'thematicBreak', 'blockquote', 'yaml', 'code', 'list', 'imageCollection']);
|
|
16
|
+
|
|
17
|
+
$effect(() => {
|
|
18
|
+
for (const child of blockChildren) {
|
|
19
|
+
if (!KNOWN_BLOCK_TYPES.has(child.type)) {
|
|
20
|
+
console.warn('[Parsnip] Unknown block child type:', child.type, child);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function parseLang(lang: string | null | undefined): CodeBlockLang {
|
|
26
|
+
return (lang ?? 'markdown') as CodeBlockLang;
|
|
27
|
+
}
|
|
13
28
|
</script>
|
|
14
29
|
|
|
15
30
|
{#each blockChildren as child (child)}
|
|
@@ -31,12 +46,10 @@
|
|
|
31
46
|
{:else if child.type === 'yaml'}
|
|
32
47
|
<!-- do nothing -->
|
|
33
48
|
{:else if child.type === 'code'}
|
|
34
|
-
<CodeBlock code={child.value} lang={child.lang
|
|
49
|
+
<CodeBlock code={child.value} lang={parseLang(child.lang)} />
|
|
35
50
|
{:else if child.type === 'list'}
|
|
36
51
|
<ParsnipList list={child} />
|
|
37
52
|
{:else if child.type === 'imageCollection'}
|
|
38
53
|
<ParsnipImageCollection url="" imageList={child.children} />
|
|
39
|
-
{:else}
|
|
40
|
-
<p>{JSON.stringify(child, undefined, 2)}</p>
|
|
41
54
|
{/if}
|
|
42
55
|
{/each}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsnipBlockChildren.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/modules/parsnip/ParsnipBlockChildren.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ParsnipBlockChildren.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/modules/parsnip/ParsnipBlockChildren.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGpC,KAAK,gBAAgB,GAAI;IAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA2DxF,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
|
|
3
|
+
import { untrack } from "svelte";
|
|
3
4
|
import { getPhotoDetails } from "./externalImages.remote";
|
|
4
5
|
|
|
5
6
|
const { url, alt = "", withDescription = false }: { url: string, alt: string, withDescription?: boolean } = $props();
|
|
6
|
-
let _alt = $state(alt);
|
|
7
|
+
let _alt = $state(untrack(() => alt));
|
|
7
8
|
|
|
8
|
-
const showDescription = withDescription || url.includes("with-description=true");
|
|
9
|
+
const showDescription = untrack(() => withDescription || url.includes("with-description=true"));
|
|
9
10
|
|
|
10
|
-
const galleryBase = url
|
|
11
|
+
const galleryBase = untrack(() => url
|
|
11
12
|
.replace(/[?#].*$/, "")
|
|
12
13
|
.replace(/^(https?:\/\/)(rabiole|photos)\./, "$1photo-gallery.")
|
|
13
|
-
.replace(/\/(api\/)?photos\/.*$/, "");
|
|
14
|
+
.replace(/\/(api\/)?photos\/.*$/, ""));
|
|
14
15
|
|
|
15
16
|
let details = $state<{ altText: string, description: string, tags: string[], createdAt: string } | null>(null);
|
|
16
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsnipImage.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/ParsnipImage.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ParsnipImage.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/ParsnipImage.svelte.ts"],"names":[],"mappings":"AAOC,KAAK,gBAAgB,GAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA4DlF,QAAA,MAAM,YAAY,sDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
import { getPhotoCollectionMeta } from "./externalImages.remote";
|
|
4
4
|
import ParsnipImage from "./ParsnipImage.svelte";
|
|
5
5
|
import type { Image } from "mdast";
|
|
6
|
+
import { untrack } from "svelte";
|
|
6
7
|
|
|
7
8
|
const { url, imageList }: { url?: string, imageList?: Image[] } = $props();
|
|
8
9
|
|
|
9
|
-
const withDescription = url?.includes('with-description=true') ?? false;
|
|
10
|
+
const withDescription = untrack(() => url?.includes('with-description=true') ?? false);
|
|
10
11
|
|
|
11
12
|
let data = $state<{
|
|
12
13
|
photos: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsnipImageCollection.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/ParsnipImageCollection.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ParsnipImageCollection.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/modules/parsnip/external-images/ParsnipImageCollection.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAGlC,KAAK,gBAAgB,GAAI;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAA;CAAE,CAAC;AAoDhE,QAAA,MAAM,sBAAsB,sDAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
|
|
@@ -67,10 +67,10 @@ export const slugPageServerLoad = (_a) => __awaiter(void 0, [_a], void 0, functi
|
|
|
67
67
|
ogImage: imageUrl ? [imageUrl] : undefined
|
|
68
68
|
};
|
|
69
69
|
// process review metadata
|
|
70
|
-
if ((_b = parsnipEntry.tags) === null || _b === void 0 ? void 0 : _b.includes(
|
|
70
|
+
if ((_b = parsnipEntry.tags) === null || _b === void 0 ? void 0 : _b.includes("food-review")) {
|
|
71
71
|
// parsnipEntry.foodReviewJson =
|
|
72
72
|
try {
|
|
73
|
-
const foodReviewResp = yield fetch(`${baseUrl}/${entryMeta.path.replace(
|
|
73
|
+
const foodReviewResp = yield fetch(`${baseUrl}/${entryMeta.path.replace(".ast.", ".ld.")}`);
|
|
74
74
|
parsnipEntry.foodReviewJson = yield foodReviewResp.json();
|
|
75
75
|
parsnipEntry.datePublished = parsnipEntry.foodReviewJson.datePublished;
|
|
76
76
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
if (mutation.type === "childList") {
|
|
25
25
|
setTimeout(() => {
|
|
26
26
|
// get all toasterRoot children
|
|
27
|
-
const children = Array.from(toasterRoot.children);
|
|
27
|
+
const children = Array.from(toasterRoot.children) as HTMLElement[];
|
|
28
28
|
children.forEach((child, index) => {
|
|
29
29
|
const revNum = Math.min(Math.abs(children.length - 1 - index), 5);
|
|
30
30
|
child.style.setProperty("--toast-index", index.toString());
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
{#each layout as site (site.relativeLink)}
|
|
77
77
|
<!-- todo: add highlighted class when relativeLink === page.url -->
|
|
78
78
|
<PinyaAccordionItem
|
|
79
|
-
class=
|
|
79
|
+
class={currentPath === site.relativeLink ? 'highlighted' : ''}
|
|
80
80
|
hasNoChild={site.nestedPages.length === 0}
|
|
81
81
|
pinyaValue={site.relativeLink}>
|
|
82
82
|
{#snippet control()}
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
} as const;
|
|
48
48
|
|
|
49
49
|
let shouldShowExtra = $state(false);
|
|
50
|
-
const style = `
|
|
50
|
+
const style = $derived(`
|
|
51
51
|
--preferred-justify-content: ${isSlot ? "flex-start" : "center"};
|
|
52
52
|
--preferred-overall-margin-bottom: ${isSlot ? "0" : "0.75lh"};
|
|
53
|
-
|
|
53
|
+
`);
|
|
54
54
|
|
|
55
55
|
onMount(() => {
|
|
56
56
|
shouldShowExtra = window.screen.availWidth >= 440;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!-- TODO: Documentation: consider documentation showcase -->
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
+
import { untrack } from "svelte";
|
|
5
|
+
|
|
4
6
|
let {
|
|
5
7
|
src,
|
|
6
8
|
rng
|
|
@@ -8,11 +10,11 @@
|
|
|
8
10
|
src: string,
|
|
9
11
|
rng: () => number
|
|
10
12
|
} = $props();
|
|
11
|
-
let rotateRandom = rng() * 90 - 45;
|
|
13
|
+
let rotateRandom = untrack(() => rng() * 90 - 45);
|
|
12
14
|
|
|
13
|
-
const paddingLeft = 1 + rng() * 5;
|
|
14
|
-
const paddingRight = 1 + rng() * 5;
|
|
15
|
-
const paddingTop = 1 + rng() * 7;
|
|
15
|
+
const paddingLeft = untrack(() => 1 + rng() * 5);
|
|
16
|
+
const paddingRight = untrack(() => 1 + rng() * 5);
|
|
17
|
+
const paddingTop = untrack(() => 1 + rng() * 7);
|
|
16
18
|
</script>
|
|
17
19
|
|
|
18
20
|
<div
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
img {
|
|
36
|
-
|
|
38
|
+
--randomized-image-size: min(10vw, 10vh);
|
|
37
39
|
width: var(--randomized-image-size);
|
|
38
40
|
height: var(--randomized-image-size);
|
|
39
41
|
transform: rotate(var(--rotateRandom));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomizedImage.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/components/randomized-background/RandomizedImage.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RandomizedImage.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/components/randomized-background/RandomizedImage.svelte.ts"],"names":[],"mappings":"AAKC,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,MAAM,CAAA;CACjB,CAAC;AA2BH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<script lang="ts">
|
|
35
|
-
import { onMount } from "svelte";
|
|
36
35
|
import type { CodeBlockProps } from "./CodeBlockProps";
|
|
37
36
|
|
|
38
37
|
let {
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
class="pinya-code-block {base} {rounded} {shadow} {classes} {preBase} {prePadding} {preClasses}"
|
|
68
67
|
>
|
|
69
68
|
<!-- Output Shiki's Generated HTML -->
|
|
69
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
70
70
|
{@html generatedHtml}
|
|
71
71
|
</div>
|
|
72
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlock.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlock.svelte.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+CvD,kHAAkH;AAClH,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** Highlighting language keys supported by CodeBlock (must match langs loaded in CodeBlock.svelte). */
|
|
2
|
+
export type CodeBlockLang = 'console' | 'html' | 'css' | 'js' | 'ts' | 'markdown' | 'xml' | 'svelte' | 'json';
|
|
1
3
|
export interface CodeBlockProps {
|
|
2
4
|
/** Code string to render inside the block. */
|
|
3
5
|
code?: string;
|
|
4
6
|
/** Highlighting language key. */
|
|
5
|
-
lang?:
|
|
7
|
+
lang?: CodeBlockLang;
|
|
6
8
|
/** Base wrapper classes. */
|
|
7
9
|
base?: string;
|
|
8
10
|
/** Wrapper rounding classes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockProps.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlockProps.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeBlockProps.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlockProps.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9G,MAAM,WAAW,cAAc;IAC9B,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -28,16 +28,15 @@
|
|
|
28
28
|
|
|
29
29
|
return undefined;
|
|
30
30
|
})(),
|
|
31
|
-
|
|
32
|
-
onValueChange: (t: T | SvelteSet<T> | undefined) => {
|
|
31
|
+
onValueChange: (t) => {
|
|
33
32
|
if (t instanceof SvelteSet) {
|
|
34
33
|
if (t.size > 0) {
|
|
35
|
-
value = [...t];
|
|
34
|
+
value = [...t] as T[];
|
|
36
35
|
} else {
|
|
37
36
|
value = [];
|
|
38
37
|
}
|
|
39
38
|
} else if (t) {
|
|
40
|
-
value = [t];
|
|
39
|
+
value = [t as T];
|
|
41
40
|
} else {
|
|
42
41
|
value = [];
|
|
43
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinyaCombobox.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/pinya-combobox/PinyaCombobox.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAG7F,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM;
|
|
1
|
+
{"version":3,"file":"PinyaCombobox.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/pinya-combobox/PinyaCombobox.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAG7F,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM;WAuKL,kBAAkB,CAAC,CAAC,CAAC;;;;;EAAiF;AACnI,cAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM;IACpC,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3Y,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1I,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD;;;;GAIG;AACH,QAAA,MAAM,aAAa,EAAE,qBAAmC,CAAC;AACvC,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/E,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type FoodReviewJson = LdReview | LdBrand;
|
|
2
|
+
export interface LdReview {
|
|
3
|
+
"@type": "Review";
|
|
4
|
+
datePublished: string;
|
|
5
|
+
reviewRating: {
|
|
6
|
+
ratingValue: number;
|
|
7
|
+
};
|
|
8
|
+
itemReviewed: {
|
|
9
|
+
url?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface LdBrand {
|
|
13
|
+
"@type": "Brand";
|
|
14
|
+
datePublished: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
aggregateRating: {
|
|
17
|
+
ratingValue: number;
|
|
18
|
+
reviewCount?: number;
|
|
19
|
+
};
|
|
20
|
+
review: LdReview[];
|
|
21
|
+
}
|
|
22
|
+
export declare const LdSchemaUtil: {
|
|
23
|
+
readonly getReviewRating: (review: FoodReviewJson) => number;
|
|
24
|
+
readonly getUrl: (review: FoodReviewJson) => string | undefined;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=LdSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LdSchema.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/LdSchema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACxB,OAAO,EAAE,QAAQ,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,YAAY,EAAE;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;KACZ,CAAC;CACF;AAED,MAAM,WAAW,OAAO;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,EAAE;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,YAAY;uCACE,cAAc,KAAG,MAAM;8BAQhC,cAAc,KAAG,MAAM,GAAG,SAAS;CAO3C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const LdSchemaUtil = {
|
|
2
|
+
getReviewRating: (review) => {
|
|
3
|
+
if (review["@type"] === "Review") {
|
|
4
|
+
return review.reviewRating.ratingValue;
|
|
5
|
+
}
|
|
6
|
+
else { // Brand
|
|
7
|
+
return review.aggregateRating.ratingValue;
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
getUrl: (review) => {
|
|
11
|
+
if (review["@type"] === "Review") {
|
|
12
|
+
return review.itemReviewed.url;
|
|
13
|
+
}
|
|
14
|
+
else { // Brand
|
|
15
|
+
return review.url;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -5,7 +5,7 @@ interface Props {
|
|
|
5
5
|
selectedTags?: string[];
|
|
6
6
|
queryReady?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const NavigationControl: import("svelte").Component<Props, {}, "
|
|
8
|
+
declare const NavigationControl: import("svelte").Component<Props, {}, "selectedTags" | "currentIndex" | "pageSize" | "queryReady">;
|
|
9
9
|
type NavigationControl = ReturnType<typeof NavigationControl>;
|
|
10
10
|
export default NavigationControl;
|
|
11
11
|
//# sourceMappingURL=NavigationControl.svelte.d.ts.map
|
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
import { FourPartCard } from "../../components/index";
|
|
9
9
|
import { PinyaCard } from "../../elements/index";
|
|
10
10
|
import Placeholder from "../../elements/Placeholder.svelte";
|
|
11
|
+
import { type FoodReviewJson, LdSchemaUtil } from "../index";
|
|
11
12
|
import NavigationControl from "./NavigationControl.svelte";
|
|
12
13
|
import {
|
|
13
14
|
DefaultPageMetaSorter,
|
|
14
|
-
type FoodReviewJson,
|
|
15
15
|
type PageMeta,
|
|
16
16
|
parsePageMeta,
|
|
17
17
|
type ParsePageMetaCompareFn
|
|
18
18
|
} from "./PageMeta";
|
|
19
19
|
import { renderStar } from "../../../util/util";
|
|
20
|
+
import { untrack } from "svelte";
|
|
20
21
|
import { SvelteMap } from "svelte/reactivity";
|
|
21
22
|
|
|
22
23
|
interface Props {
|
|
@@ -74,33 +75,37 @@
|
|
|
74
75
|
return inlineTags.trim().length > 0;
|
|
75
76
|
})());
|
|
76
77
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
imageUrl
|
|
78
|
+
const pageFlatList = untrack(() => {
|
|
79
|
+
const fileBasedList = parsePageMeta(fileList, jsonList, imageMap, compareFn);
|
|
80
|
+
const parsnipBasedList = parsnipOverall?.files.map(pf => {
|
|
81
|
+
let imageUrl = pf.preview;
|
|
82
|
+
if (imageUrl && !imageUrl.includes("https://")) {
|
|
83
|
+
imageUrl = `${parsnipOverall.baseUrl}/${pf.preview}`;
|
|
84
|
+
}
|
|
85
|
+
const meta: PageMeta = {
|
|
86
|
+
title: pf.basename,
|
|
87
|
+
nestedPages: [],
|
|
88
|
+
relativeLink: `${parsnipBasePath}${pf.slug}`,
|
|
89
|
+
tags: pf.tags,
|
|
90
|
+
imageUrl,
|
|
91
|
+
imageAlt: pf.previewAlt,
|
|
92
|
+
datePublished: pf.datePublished ?? pf.stat.ctime ? new Date(pf.stat.ctime).toISOString().split("T")[0] : undefined,
|
|
93
|
+
lastUpdated: pf.lastUpdated ?? pf.stat.mtime ? new Date(pf.stat.mtime).toISOString().split("T")[0] : undefined,
|
|
94
|
+
description: pf.tagline,
|
|
95
|
+
priority: 0
|
|
96
|
+
};
|
|
97
|
+
return meta;
|
|
98
|
+
}) ?? [];
|
|
99
|
+
const list = fileBasedList.concat(parsnipBasedList);
|
|
100
|
+
|
|
101
|
+
if (compareFn) {
|
|
102
|
+
list.sort(compareFn);
|
|
103
|
+
} else {
|
|
104
|
+
list.sort(DefaultPageMetaSorter);
|
|
82
105
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
relativeLink: `${parsnipBasePath}${pf.slug}`,
|
|
87
|
-
tags: pf.tags,
|
|
88
|
-
imageUrl,
|
|
89
|
-
imageAlt: pf.previewAlt,
|
|
90
|
-
datePublished: pf.datePublished ?? pf.stat.ctime ? new Date(pf.stat.ctime).toISOString().split("T")[0] : undefined,
|
|
91
|
-
lastUpdated: pf.lastUpdated ?? pf.stat.mtime ? new Date(pf.stat.mtime).toISOString().split("T")[0] : undefined,
|
|
92
|
-
description: pf.tagline,
|
|
93
|
-
priority: 0
|
|
94
|
-
};
|
|
95
|
-
return meta;
|
|
96
|
-
}) ?? [];
|
|
97
|
-
const pageFlatList = fileBasedList.concat(parsnipBasedList);
|
|
98
|
-
|
|
99
|
-
if (compareFn) {
|
|
100
|
-
pageFlatList.sort(compareFn);
|
|
101
|
-
} else {
|
|
102
|
-
pageFlatList.sort(DefaultPageMetaSorter);
|
|
103
|
-
}
|
|
106
|
+
|
|
107
|
+
return list;
|
|
108
|
+
});
|
|
104
109
|
|
|
105
110
|
const selectedTagsSet = $derived(new Set(selectedTags.map(tag => tag.toLocaleLowerCase())));
|
|
106
111
|
const filteredPageFlatList = $derived(
|
|
@@ -146,7 +151,7 @@
|
|
|
146
151
|
fetch(`${parsnipOverall.baseUrl}/${parsnipMetadata.path}`.replaceAll(".ast.", ".ld."))
|
|
147
152
|
.then(data => data.json())
|
|
148
153
|
.then((data: FoodReviewJson) => {
|
|
149
|
-
ratingCache.set(vp.relativeLink, `${renderStar(data
|
|
154
|
+
ratingCache.set(vp.relativeLink, `${renderStar(LdSchemaUtil.getReviewRating(data))}`);
|
|
150
155
|
}).catch(err => {
|
|
151
156
|
console.warn(err);
|
|
152
157
|
}).finally(() => {
|
|
@@ -344,7 +349,6 @@
|
|
|
344
349
|
.blurb-text {
|
|
345
350
|
padding-top: 1lh;
|
|
346
351
|
padding-bottom: 1lh;
|
|
347
|
-
grow: 1;
|
|
348
352
|
white-space: initial;
|
|
349
353
|
min-width: 0;
|
|
350
354
|
display: flex;
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
parsnipOverall?: ParsnipOverall;
|
|
20
20
|
parsnipBasePath?: string;
|
|
21
21
|
}
|
|
22
|
-
declare const NavigationMenu: import("svelte").Component<Props, {}, "
|
|
22
|
+
declare const NavigationMenu: import("svelte").Component<Props, {}, "selectedTags" | "currentIndex" | "pageSize" | "queryReady">;
|
|
23
23
|
type NavigationMenu = ReturnType<typeof NavigationMenu>;
|
|
24
24
|
export default NavigationMenu;
|
|
25
25
|
//# sourceMappingURL=NavigationMenu.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenu.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/NavigationMenu.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationMenu.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/NavigationMenu.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAM1E,OAAO,EAIL,KAAK,sBAAsB,EAC3B,MAAM,yCAAyC,CAAC;AAMjD,UAAU,KAAK;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,SAAS,GAAG,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAkOF,QAAA,MAAM,cAAc,oGAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { ParsnipOverall } from "../../../modules/parsnip/ParsnipOverall";
|
|
2
|
-
|
|
3
|
-
datePublished: string;
|
|
4
|
-
reviewRating: {
|
|
5
|
-
ratingValue: number;
|
|
6
|
-
};
|
|
7
|
-
itemReviewed: {
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
2
|
+
import type { FoodReviewJson } from "../index";
|
|
11
3
|
export interface PageMeta {
|
|
12
4
|
datePublished?: string;
|
|
13
5
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageMeta.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/PageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"PageMeta.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/PageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,WAAW,QAAQ;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,QAAQ,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,QAAQ,EAAE,EAAE,OAAO,QAAQ,KAAG,OAiB5E,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,YAAY,sBAAsB,KAAG,QAAQ,EAoG3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB,KAAG,QAAQ,EA8CX,CAAC;AAKF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,sBA6BnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/NavigationMenu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -6,7 +6,10 @@ Layout and logic for DialogPanel. Some of the logics for the portraits are in Un
|
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import { dialogManager } from "../../../components/dialog_manager/DialogManager";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getAutoScrollPrefContext,
|
|
11
|
+
getTextSpeedContext
|
|
12
|
+
} from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
10
13
|
import { onMount, tick } from "svelte";
|
|
11
14
|
|
|
12
15
|
let currentMessage = $state("");
|
|
@@ -14,6 +17,7 @@ Layout and logic for DialogPanel. Some of the logics for the portraits are in Un
|
|
|
14
17
|
let autoScrollPrefContext = getAutoScrollPrefContext();
|
|
15
18
|
let dialogPanelElement: HTMLDivElement | null = null;
|
|
16
19
|
let shouldStickToBottom = true;
|
|
20
|
+
let divRole = $state<"button" | undefined>();
|
|
17
21
|
|
|
18
22
|
const onDialogClick = () => {
|
|
19
23
|
dialogManager?.skipAnimation();
|
|
@@ -34,14 +38,20 @@ Layout and logic for DialogPanel. Some of the logics for the portraits are in Un
|
|
|
34
38
|
currentMessage = value;
|
|
35
39
|
});
|
|
36
40
|
|
|
41
|
+
dialogManager.isDoneTransitionWritable.subscribe(value => {
|
|
42
|
+
divRole = value ? undefined : "button";
|
|
43
|
+
});
|
|
44
|
+
|
|
37
45
|
dialogManager.update(0);
|
|
38
46
|
});
|
|
39
47
|
|
|
40
48
|
$effect(() => {
|
|
41
|
-
dialogManager.setUpdateRate((16*10) - (textSpeedContext.value*16));
|
|
49
|
+
dialogManager.setUpdateRate((16 * 10) - (textSpeedContext.value * 16));
|
|
42
50
|
});
|
|
43
51
|
|
|
44
52
|
$effect(() => {
|
|
53
|
+
// funny loner variable below cause we want to trigger everything below when it changes
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
45
55
|
currentMessage;
|
|
46
56
|
|
|
47
57
|
tick().then(() => {
|
|
@@ -54,13 +64,21 @@ Layout and logic for DialogPanel. Some of the logics for the portraits are in Un
|
|
|
54
64
|
});
|
|
55
65
|
</script>
|
|
56
66
|
|
|
67
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
57
68
|
<div
|
|
58
|
-
tabindex="0
|
|
59
|
-
role=
|
|
69
|
+
tabindex={divRole === "button" ? 0 : undefined}
|
|
70
|
+
role={divRole}
|
|
71
|
+
aria-label={divRole === "button" ? "Skip text animation" : undefined}
|
|
60
72
|
id="dialog-panel"
|
|
61
73
|
bind:this={dialogPanelElement}
|
|
62
74
|
onclick={onDialogClick}
|
|
63
75
|
onscroll={onDialogScroll}
|
|
76
|
+
onkeydown={(e) => {
|
|
77
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
onDialogClick();
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
64
82
|
onkeyup={(e) => {
|
|
65
83
|
if (e.key === "j") {
|
|
66
84
|
onDialogClick();
|
|
@@ -70,44 +88,45 @@ Layout and logic for DialogPanel. Some of the logics for the portraits are in Un
|
|
|
70
88
|
<!-- Made for 140 characters, like the original tweets -->
|
|
71
89
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
72
90
|
<div id="reverse-dialog-wrapper">
|
|
91
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
73
92
|
{@html currentMessage}
|
|
74
93
|
</div>
|
|
75
94
|
</div>
|
|
76
95
|
|
|
77
96
|
<style>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
:global {
|
|
98
|
+
:root {
|
|
99
|
+
--color-dialog-bold: #6b8499;
|
|
100
|
+
--color-dialog-italic: #a55332;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
html.dark {
|
|
104
|
+
--color-dialog-bold: #85a1b6;
|
|
105
|
+
--color-dialog-italic: #f7b67c;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#reverse-dialog-wrapper {
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#dialog-panel {
|
|
113
|
+
overflow: auto;
|
|
114
|
+
display: block;
|
|
115
|
+
|
|
116
|
+
img,
|
|
117
|
+
video {
|
|
118
|
+
max-height: 3lh;
|
|
119
|
+
display: inline;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
b {
|
|
123
|
+
font-weight: bolder;
|
|
124
|
+
color: var(--color-dialog-bold);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
i {
|
|
128
|
+
color: var(--color-dialog-italic);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
113
132
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/universal-overlay/DialogPanel.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DialogPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/universal-overlay/DialogPanel.svelte.ts"],"names":[],"mappings":"AA8FA,4GAA4G;AAC5G,QAAA,MAAM,WAAW,2DAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { ProjectGroup, SnippetMeta } from "./";
|
|
8
8
|
import { SectionType } from "./props";
|
|
9
9
|
import { getCommitDate } from "../../../util/getCommitDate";
|
|
10
|
-
import { onMount } from "svelte";
|
|
10
|
+
import { onMount, untrack } from "svelte";
|
|
11
11
|
|
|
12
12
|
let {
|
|
13
13
|
title,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}: ProjectGroup = $props();
|
|
22
22
|
|
|
23
23
|
// State — resolvedEntryList allows date overrides after fetching from GitHub
|
|
24
|
-
let resolvedEntryList = $state<SnippetMeta[]>([...entryList]);
|
|
24
|
+
let resolvedEntryList = $state<SnippetMeta[]>(untrack(() => [...entryList]));
|
|
25
25
|
let selectedTags = $state<string[]>([]);
|
|
26
26
|
let sortBy = $state<string[]>(["default"]);
|
|
27
27
|
let isExpanded = $state(false);
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { PinyaCard } from "../../elements/PinyaCard";
|
|
9
9
|
import type { ProjectGroup, SnippetMeta } from "./";
|
|
10
10
|
import { addToast } from "../../components/MeltToaster/MeltToaster.svelte";
|
|
11
|
+
import { untrack } from "svelte";
|
|
11
12
|
|
|
12
13
|
interface Props {
|
|
13
14
|
layout: ProjectGroup[];
|
|
@@ -95,12 +96,12 @@
|
|
|
95
96
|
};
|
|
96
97
|
};
|
|
97
98
|
|
|
98
|
-
const comboboxData = allEntries.map(entry => {
|
|
99
|
+
const comboboxData = untrack(() => allEntries.map(entry => {
|
|
99
100
|
return {
|
|
100
101
|
label: entry.key,
|
|
101
102
|
value: entry.key
|
|
102
103
|
};
|
|
103
|
-
});
|
|
104
|
+
}));
|
|
104
105
|
|
|
105
106
|
let comboboxValue = $state([comboboxData[0].value]);
|
|
106
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectGroupConfig.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectGroupConfig.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAKhF,UAAU,KAAK;IACd,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACnB;AAmMF,QAAA,MAAM,kBAAkB,8DAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import ChumBucket from "./ChumBucket.svelte";
|
|
11
11
|
import EntryGroup from "./EntryGroup.svelte";
|
|
12
12
|
import EntryOrderConfig from "./EntryOrderConfig.svelte";
|
|
13
|
-
import { onDestroy, onMount } from "svelte";
|
|
13
|
+
import { onDestroy, onMount, untrack } from "svelte";
|
|
14
14
|
import { SvelteMap } from "svelte/reactivity";
|
|
15
15
|
import { fly } from "svelte/transition";
|
|
16
16
|
import { TextChip } from "../../elements/TextChip";
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
linkedinRemoteQuery
|
|
33
33
|
}: SeaweedLayoutProps = $props();
|
|
34
34
|
|
|
35
|
-
let actualLayout = $state(layout);
|
|
35
|
+
let actualLayout = $state(untrack(() => layout));
|
|
36
36
|
let isAdvanceSettingOn = $state(false);
|
|
37
37
|
let orderUrl = $state("");
|
|
38
38
|
|
|
39
|
-
let queryStates = new SvelteMap<string, boolean>(queryTerms.map(term => [term, true]));
|
|
39
|
+
let queryStates = new SvelteMap<string, boolean>(untrack(() => queryTerms.map(term => [term, true])));
|
|
40
40
|
let styleStr = $state("");
|
|
41
41
|
let queryQt = $derived.by(() => {
|
|
42
42
|
const qtArr = [...queryStates.entries()
|
|
@@ -176,12 +176,7 @@
|
|
|
176
176
|
filterSearchParams(page.url.searchParams);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
* Get the computed font size of an element in pixels.
|
|
181
|
-
* @param {HTMLElement} element The DOM element to check.
|
|
182
|
-
* @returns {number} The font size in pixels as a number.
|
|
183
|
-
*/
|
|
184
|
-
function getElementFontSize(element) {
|
|
179
|
+
const getElementFontSize = (element: HTMLElement) => {
|
|
185
180
|
// Use window.getComputedStyle() to get all resolved CSS properties.
|
|
186
181
|
const computedStyle = window.getComputedStyle(element);
|
|
187
182
|
// Get the 'font-size' property value (which will be in 'px').
|
|
@@ -219,6 +214,7 @@
|
|
|
219
214
|
</script>
|
|
220
215
|
|
|
221
216
|
<svelte:head>
|
|
217
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
222
218
|
{@html styleStr}
|
|
223
219
|
</svelte:head>
|
|
224
220
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeaweedLayout.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/SeaweedLayout/SeaweedLayout.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SeaweedLayout.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/SeaweedLayout/SeaweedLayout.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAmThE,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import "./blog-template.css";
|
|
5
5
|
import { browser } from "$app/environment";
|
|
6
|
+
import { enableUniversalOverlaySvelte4 } from "../../../components/dialog_manager/DialogManagerStore";
|
|
7
|
+
import type { SimplePageMeta } from "../../modules/NavigationMenu/index";
|
|
8
|
+
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
9
|
+
import { appState } from "../PinyaPageLayout/pinyaPageLayoutRunes.svelte.js";
|
|
6
10
|
import { setIgnoreOverlayOverride } from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
7
11
|
import { onDestroy, onMount, type Snippet } from "svelte";
|
|
8
|
-
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
9
|
-
import type { SimplePageMeta } from "../../modules/NavigationMenu/index";
|
|
10
|
-
import { enableUniversalOverlaySvelte4 } from "../../../components/dialog_manager/DialogManagerStore";
|
|
11
12
|
import PinyaCard from "../../elements/PinyaCard/PinyaCard.svelte";
|
|
12
|
-
import { appState } from "../PinyaPageLayout/pinyaPageLayoutRunes.svelte.js";
|
|
13
13
|
|
|
14
14
|
// grab page meta from the adjacent meta.json
|
|
15
15
|
interface Props {
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
$effect(() => {
|
|
48
|
+
appState.bgOpacity = shouldFillWholePage ? 0.2 : 1;
|
|
49
|
+
});
|
|
48
50
|
</script>
|
|
49
51
|
|
|
50
52
|
{#if shouldFillWholePage}
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
|
|
72
74
|
:global(.blog-template) {
|
|
73
75
|
max-width: 64em;
|
|
74
|
-
|
|
76
|
+
width: 100%;
|
|
75
77
|
margin: auto;
|
|
76
78
|
}
|
|
77
79
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./blog-template.css";
|
|
2
|
-
import { type Snippet } from "svelte";
|
|
3
2
|
import type { SimplePageMeta } from "../../modules/NavigationMenu/index";
|
|
3
|
+
import { type Snippet } from "svelte";
|
|
4
4
|
interface Props {
|
|
5
5
|
pageMeta: SimplePageMeta;
|
|
6
6
|
shouldFillWholePage?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogTemplate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAG7B,OAAO,
|
|
1
|
+
{"version":3,"file":"BlogTemplate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAI3E,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKzD,UAAU,KAAK;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AA8DF,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { localizeHref } from "../../../external/paraglide/runtime.js";
|
|
5
|
-
import type
|
|
5
|
+
import { LdSchemaUtil, type SimplePageMeta } from "../../modules/NavigationMenu/index";
|
|
6
6
|
import { getWebBaseUrl } from "../../../util/env-getter";
|
|
7
7
|
import { renderStar } from "../../../util/util";
|
|
8
8
|
import { SvelteURLSearchParams } from "svelte/reactivity";
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
// todo: improve graphics lol
|
|
25
|
-
let ratingsRenderer = $derived(
|
|
25
|
+
let ratingsRenderer = $derived(pageMeta.foodReviewJson
|
|
26
|
+
? renderStar(LdSchemaUtil.getReviewRating(pageMeta.foodReviewJson))
|
|
27
|
+
: 0
|
|
28
|
+
);
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<article>
|
|
@@ -42,11 +45,11 @@
|
|
|
42
45
|
Ratings: {ratingsRenderer}
|
|
43
46
|
</p>
|
|
44
47
|
{/if}
|
|
45
|
-
{#if pageMeta.foodReviewJson
|
|
48
|
+
{#if pageMeta.foodReviewJson && LdSchemaUtil.getUrl(pageMeta.foodReviewJson)}
|
|
46
49
|
<p>
|
|
47
|
-
<a href={pageMeta.foodReviewJson
|
|
50
|
+
<a href={LdSchemaUtil.getUrl(pageMeta.foodReviewJson)}
|
|
48
51
|
rel="external"
|
|
49
|
-
target="_blank">{pageMeta.foodReviewJson
|
|
52
|
+
target="_blank">{LdSchemaUtil.getUrl(pageMeta.foodReviewJson)}</a>
|
|
50
53
|
</p>
|
|
51
54
|
{/if}
|
|
52
55
|
{#if pageMeta.tags.length > 0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogTemplateInner.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplateInner.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"BlogTemplateInner.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplateInner.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAMxF,UAAU,KAAK;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,QAAQ,EAAE,OAAO,CAAC;CACpC;AAqEF,QAAA,MAAM,iBAAiB,2CAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
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.4",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@commitlint/cli": "^19.8.1",
|
|
7
7
|
"@commitlint/config-conventional": "^19.8.1",
|
|
@@ -129,6 +129,8 @@
|
|
|
129
129
|
"package": "svelte-kit sync && svelte-package && publint",
|
|
130
130
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
131
131
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
132
|
+
"check-baseline": "bash scripts/check-baseline.sh",
|
|
133
|
+
"check-snapshot": "bash scripts/update-check-snapshot.sh",
|
|
132
134
|
"lint": "eslint .",
|
|
133
135
|
"format": "prettier --plugin-search-dir . --write .",
|
|
134
136
|
"generate": "npx vite-node src/routes/blogs/blog_list_data_generator.ts && npx vite-node src/routes/toyay/toya_files_generator.ts && npm run generate-yarn",
|