@turnipxenon/pineapple 3.0.0-alpha.9 → 3.1.0-alpha.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/components/blog_template/BlogTemplate.svelte +2 -2
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +1 -1
- package/dist/components/blog_template/BlogTemplateInner.svelte +1 -1
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
- package/dist/components/dialog_manager/DialogManager.d.ts +2 -1
- package/dist/components/dialog_manager/DialogMangerInit.d.ts +2 -15
- package/dist/components/dialog_manager/DialogMangerInit.js +8 -2
- package/dist/components/dialog_manager/IDialogManager.d.ts +39 -0
- package/dist/components/dialog_manager/IDialogManager.js +4 -0
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.d.ts +3 -0
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js +15 -3
- package/dist/components/dialog_overlay/DialogOverlay.svelte +155 -36
- package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -6
- package/dist/components/pineapple/PineappleBaseLayout.svelte +2 -21
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -3
- package/dist/styles/app.css +9 -14
- package/dist/ui/components/ModalBase.svelte +74 -74
- package/dist/ui/components/SocialSection.svelte +6 -2
- package/dist/ui/components/accordion/PinyaAccordion.svelte +20 -20
- package/dist/ui/components/accordion/PinyaAccordionItem.svelte +28 -28
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +64 -64
- package/dist/ui/elements/ImageIcon.svelte +53 -53
- package/dist/ui/elements/{pinya-button/component.svelte → PinyaButton/PinyaButton.svelte} +4 -3
- package/dist/ui/elements/PinyaButton/PinyaButton.svelte.d.ts +4 -0
- package/dist/ui/elements/{pinya-button/props.d.ts → PinyaButton/PinyaButtonProps.d.ts} +1 -0
- package/dist/ui/elements/PinyaButton/index.d.ts +2 -0
- package/dist/ui/elements/PinyaButton/index.js +2 -0
- package/dist/ui/elements/{pinya-card/component.svelte → PinyaCard/PinyaCard.svelte} +21 -20
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte.d.ts +7 -0
- package/dist/ui/elements/PinyaCard/index.d.ts +2 -0
- package/dist/ui/elements/PinyaCard/index.js +2 -0
- package/dist/ui/elements/Placeholder.svelte +17 -17
- package/dist/ui/elements/TextLink.svelte +16 -16
- package/dist/ui/elements/index.d.ts +2 -2
- package/dist/ui/elements/index.js +2 -2
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +34 -34
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +1 -0
- package/dist/ui/elements/text-chip/TextChip.svelte +14 -14
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte +24 -20
- package/dist/{components/navigation_component/NavigationComponent.svelte → ui/modules/NavigationMenu/NavigationMenu.svelte} +69 -43
- package/dist/{components/navigation_component/NavigationComponent.svelte.d.ts → ui/modules/NavigationMenu/NavigationMenu.svelte.d.ts} +6 -6
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.d.ts +4 -4
- package/dist/ui/modules/NavigationMenu/index.d.ts +2 -0
- package/dist/ui/modules/NavigationMenu/index.js +2 -0
- package/dist/ui/modules/index.d.ts +1 -1
- package/dist/ui/modules/index.js +1 -1
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +109 -109
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +42 -37
- package/dist/ui/modules/projects/Hepcat.svelte +6 -4
- package/dist/ui/modules/projects/Hepcat.svelte.d.ts +1 -1
- package/dist/ui/modules/projects/Pengi.svelte +61 -59
- package/dist/ui/modules/projects/Pengi.svelte.d.ts +1 -1
- package/dist/ui/modules/projects/Soulwork.svelte +7 -5
- package/dist/ui/modules/projects/ThisWebpage.svelte +19 -16
- package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +1 -1
- package/dist/ui/templates/{pinya-page-layout/component.svelte → PinyaPageLayout/PinyaPageLayout.svelte} +1 -1
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.d.ts +9 -0
- package/dist/ui/templates/PinyaPageLayout/index.d.ts +2 -0
- package/dist/ui/templates/PinyaPageLayout/index.js +2 -0
- package/dist/ui/templates/{pinya-page-layout → PinyaPageLayout}/runes.svelte.d.ts +3 -0
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.js +4 -0
- package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte +1 -1
- package/dist/{template/seaweed → ui/templates/SeaweedLayout}/CreateUrlForm.svelte +2 -2
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/EntryGroup.svelte +65 -88
- package/dist/ui/templates/SeaweedLayout/EntryOrderConfig.svelte.d.ts +9 -0
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectComponentProps.d.ts +1 -0
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectGroupConfig.svelte +316 -316
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectGroupConfig.svelte.d.ts +1 -1
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.md +3 -3
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.svelte +278 -276
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/props.d.ts +2 -2
- package/dist/ui/templates/confirmation-modal/component.svelte +46 -46
- package/dist/ui/templates/index.d.ts +2 -2
- package/dist/ui/templates/index.js +2 -2
- package/package.json +3 -2
- package/src/lib/styles/app.css +9 -14
- package/dist/components/navigation_component/index.d.ts +0 -2
- package/dist/components/navigation_component/index.js +0 -3
- package/dist/template/seaweed/ParseQueryTerms.d.ts +0 -1
- package/dist/template/seaweed/ParseQueryTerms.js +0 -23
- package/dist/template/seaweed/RunChaos.d.ts +0 -1
- package/dist/template/seaweed/RunChaos.js +0 -41
- package/dist/template/seaweed/SeaweedTemplate.svelte +0 -336
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +0 -32
- package/dist/template/seaweed/SeaweedTemplateData.d.ts +0 -30
- package/dist/template/seaweed/SeaweedTemplateData.js +0 -79
- package/dist/template/seaweed/entries/ChefWings.svelte +0 -45
- package/dist/template/seaweed/entries/ChefWings.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte +0 -40
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/EntryProps.d.ts +0 -16
- package/dist/template/seaweed/entries/EntryProps.js +0 -5
- package/dist/template/seaweed/entries/Hepcat.svelte +0 -64
- package/dist/template/seaweed/entries/Hepcat.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/Pengi.svelte +0 -57
- package/dist/template/seaweed/entries/Pengi.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/Soulwork.svelte +0 -54
- package/dist/template/seaweed/entries/Soulwork.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/ThisWebpage.svelte +0 -55
- package/dist/template/seaweed/entries/ThisWebpage.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/WorkExperience.svelte +0 -130
- package/dist/template/seaweed/entries/WorkExperience.svelte.d.ts +0 -8
- package/dist/template/seaweed/entries/Workset.svelte +0 -57
- package/dist/template/seaweed/entries/Workset.svelte.d.ts +0 -7
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.d.ts +0 -1
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.js +0 -8
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +0 -297
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +0 -12
- package/dist/template/seaweed/entry_order_config/entry-order-config.postcss +0 -35
- package/dist/template/seaweed/index.d.ts +0 -4
- package/dist/template/seaweed/index.js +0 -4
- package/dist/template/seaweed/seaweed.postcss +0 -125
- package/dist/ui/elements/pinya-button/component.svelte.d.ts +0 -4
- package/dist/ui/elements/pinya-button/index.d.ts +0 -2
- package/dist/ui/elements/pinya-button/index.js +0 -2
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +0 -7
- package/dist/ui/elements/pinya-card/index.d.ts +0 -2
- package/dist/ui/elements/pinya-card/index.js +0 -2
- package/dist/ui/modules/seaweed/index.d.ts +0 -3
- package/dist/ui/modules/seaweed/index.js +0 -4
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +0 -9
- package/dist/ui/templates/pinya-page-layout/index.d.ts +0 -2
- package/dist/ui/templates/pinya-page-layout/index.js +0 -2
- package/dist/ui/templates/pinya-page-layout/runes.svelte.js +0 -3
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte.d.ts +0 -9
- /package/dist/ui/elements/{pinya-button/props.js → PinyaButton/PinyaButtonProps.js} +0 -0
- /package/dist/ui/elements/{pinya-card/props.d.ts → PinyaCard/PinyaCardProps.d.ts} +0 -0
- /package/dist/{template/seaweed/ToastSettings.js → ui/elements/PinyaCard/PinyaCardProps.js} +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte.d.ts +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.js +0 -0
- /package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte.d.ts +0 -0
- /package/dist/{template/seaweed → ui/templates/SeaweedLayout}/CreateUrlForm.svelte.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/EntryGroup.svelte.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout/EntryOrderConfig2.svelte → SeaweedLayout/EntryOrderConfig.svelte} +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectComponentProps.js +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.svelte.d.ts +0 -0
- /package/dist/{template/seaweed → ui/templates/SeaweedLayout}/ToastSettings.d.ts +0 -0
- /package/dist/ui/{elements/pinya-card/props.js → templates/SeaweedLayout/ToastSettings.js} +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/index.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/index.js +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/props.js +0 -0
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { enableBackground } from "../../store";
|
|
4
4
|
import { onDestroy, onMount } from "svelte";
|
|
5
5
|
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
6
|
-
import type { SimplePageMeta } from "
|
|
6
|
+
import type { SimplePageMeta } from "../../ui/modules/NavigationMenu/index";
|
|
7
7
|
import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
8
|
-
import { Card } from "../
|
|
8
|
+
import { default as Card } from "../Card.svelte";
|
|
9
9
|
|
|
10
10
|
// grab page meta from the adjacent meta.json
|
|
11
11
|
interface Props {
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
import type { DialogDetail } from "../../types/pineapple_fiber/DialogDetail";
|
|
5
5
|
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
6
6
|
import { DialogProcessor } from "./DialogProcessor";
|
|
7
|
+
import type { IDialogManager } from "./IDialogManager";
|
|
7
8
|
export type OnSetDialogChoiceCallback = (newMessage: DialogDetail) => void;
|
|
8
|
-
export declare class DialogManager {
|
|
9
|
+
export declare class DialogManager implements IDialogManager {
|
|
9
10
|
dialogMessageMap: Map<string, DialogDetail>;
|
|
10
11
|
currentDialogTree: DialogDetail[];
|
|
11
12
|
fullCurrentMessage: string;
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* strictly must be declared last! or you might receive a weird error that looks like:
|
|
4
|
-
*
|
|
5
|
-
* 2:04:21 AM [vite] Error when evaluating SSR module /src/lib/components/dialog_manager/DialogManagerStore.ts:
|
|
6
|
-
* |- TypeError: Cannot read properties of undefined (reading '0')
|
|
7
|
-
* at <instance_members_initializer> (/src/lib/components/dialog_manager/DialogManager.ts:38:67)
|
|
8
|
-
* at new DialogManager (/src/lib/components/dialog_manager/DialogManager.ts:53:14)
|
|
9
|
-
* at eval (/src/lib/components/dialog_manager/DialogManagerStore.ts:15:23)
|
|
10
|
-
* at async instantiateModule (file:///C:/Users/Pumpkin/Projects/Web/pineapple/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:54360:9)
|
|
11
|
-
*
|
|
12
|
-
* what this means is that one member of dialogManager cannot be initialized. in our case, it was the
|
|
13
|
-
* defaultDialogMessage not yet being initialized
|
|
14
|
-
*/
|
|
15
|
-
export declare const dialogManager: DialogManager;
|
|
1
|
+
import type { IDialogManager } from "./IDialogManager";
|
|
2
|
+
export declare const getDialogManager: () => Promise<IDialogManager | undefined>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DialogManager } from "./DialogManager";
|
|
2
1
|
/**
|
|
3
2
|
* strictly must be declared last! or you might receive a weird error that looks like:
|
|
4
3
|
*
|
|
@@ -12,4 +11,11 @@ import { DialogManager } from "./DialogManager";
|
|
|
12
11
|
* what this means is that one member of dialogManager cannot be initialized. in our case, it was the
|
|
13
12
|
* defaultDialogMessage not yet being initialized
|
|
14
13
|
*/
|
|
15
|
-
|
|
14
|
+
let _dialogManager = undefined;
|
|
15
|
+
export const getDialogManager = async () => {
|
|
16
|
+
if (_dialogManager === undefined) {
|
|
17
|
+
const dm = await import('./DialogManager');
|
|
18
|
+
_dialogManager = new dm.DialogManager();
|
|
19
|
+
}
|
|
20
|
+
return _dialogManager;
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DialogDetail } from "../../types/pineapple_fiber/DialogDetail";
|
|
2
|
+
import { type Writable } from "svelte/store";
|
|
3
|
+
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
4
|
+
import { type Tweened } from "svelte/motion";
|
|
5
|
+
import { DialogProcessor } from "./DialogProcessor";
|
|
6
|
+
import type { OnSetDialogChoiceCallback } from "./DialogManager";
|
|
7
|
+
export interface IDialogManager {
|
|
8
|
+
dialogMessageMap: Map<string, DialogDetail>;
|
|
9
|
+
currentDialogTree: DialogDetail[];
|
|
10
|
+
fullCurrentMessage: string;
|
|
11
|
+
currentMessageMeta: DialogDetail;
|
|
12
|
+
currentMessage: Writable<string>;
|
|
13
|
+
currentIndex: number;
|
|
14
|
+
previousTimestamp: number;
|
|
15
|
+
isDoneTransition: boolean;
|
|
16
|
+
currentPortrait: Writable<string>;
|
|
17
|
+
portraitMap: Map<string, any>;
|
|
18
|
+
currentState: DialogState;
|
|
19
|
+
currentReadableState: Writable<DialogState>;
|
|
20
|
+
hidePercent: Tweened<number>;
|
|
21
|
+
skipNextActiveTime: number;
|
|
22
|
+
dialogProcessor: DialogProcessor;
|
|
23
|
+
_setDialogChoiceQueue: DialogDetail[];
|
|
24
|
+
_setDialogChoiceMutex: boolean;
|
|
25
|
+
onSetDialogListeners: OnSetDialogChoiceCallback[];
|
|
26
|
+
enableDialogueOverlayCache: boolean;
|
|
27
|
+
skipAnimation: () => void;
|
|
28
|
+
enableDialog: (shouldEnable: boolean) => void;
|
|
29
|
+
setDialogTree: (newDialogTree: DialogDetail[]) => void;
|
|
30
|
+
subscribeToSetDialogChoice: (callback: OnSetDialogChoiceCallback) => void;
|
|
31
|
+
unsubscribeToSetDialogChoice: (callback: OnSetDialogChoiceCallback) => void;
|
|
32
|
+
setDialogChoice: (newMessage: (DialogDetail | undefined)) => void;
|
|
33
|
+
_setDialogChoice: () => void;
|
|
34
|
+
setDialogToDefault: () => void;
|
|
35
|
+
update: (timestamp: number) => void;
|
|
36
|
+
enableDialogOverlay(enable: boolean): void;
|
|
37
|
+
toggleDialogOverlay(): void;
|
|
38
|
+
parseAndSetDialogTree(dialogYarn: string): Promise<DialogDetail[]>;
|
|
39
|
+
}
|
package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import type { LineBehaviorNode } from "../../line_core/LineBehaviorNode";
|
|
|
2
2
|
import type { LineNodeArguments } from "../../line_core/LineNodeArguments";
|
|
3
3
|
import type { LineBehaviorResult } from "../../line_core/LineBehaviorResult";
|
|
4
4
|
import { SetVariableNode } from "../SetVariableNode";
|
|
5
|
+
import type { IDialogManager } from "../../../IDialogManager";
|
|
5
6
|
export declare class JumpCommand implements LineBehaviorNode {
|
|
6
7
|
setVariableNode: SetVariableNode;
|
|
8
|
+
dialogManager: undefined | IDialogManager;
|
|
9
|
+
constructor();
|
|
7
10
|
process(nodeArgs: LineNodeArguments): LineBehaviorResult;
|
|
8
11
|
}
|
package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { BehaviorStatus } from "../../core/BehaviorStatus";
|
|
2
2
|
import { SetVariableNode } from "../SetVariableNode";
|
|
3
3
|
import { btreeUtils } from "../../core/BTreeUtils";
|
|
4
|
-
import {
|
|
4
|
+
import { getDialogManager } from "../../../DialogMangerInit";
|
|
5
5
|
export class JumpCommand {
|
|
6
6
|
setVariableNode = new SetVariableNode();
|
|
7
|
+
dialogManager = undefined;
|
|
8
|
+
constructor() {
|
|
9
|
+
getDialogManager().then(dm => this.dialogManager = dm);
|
|
10
|
+
}
|
|
7
11
|
process(nodeArgs) {
|
|
12
|
+
if (this.dialogManager === undefined) {
|
|
13
|
+
console.warn('Dialog Manger not yet initialized');
|
|
14
|
+
return {
|
|
15
|
+
renderedLine: "",
|
|
16
|
+
nextState: nodeArgs.initState,
|
|
17
|
+
status: BehaviorStatus.Failure
|
|
18
|
+
};
|
|
19
|
+
}
|
|
8
20
|
if (!nodeArgs.line.startsWith("<<jump")) {
|
|
9
21
|
return {
|
|
10
22
|
renderedLine: "",
|
|
@@ -23,10 +35,10 @@ export class JumpCommand {
|
|
|
23
35
|
.slice("<<jump ".length, nodeArgs.line.length - ">>".length)
|
|
24
36
|
.replace(/^\{/, "") // remove possible " at the start: https://stackoverflow.com/a/2182602
|
|
25
37
|
.replace(/}$/, ""); // remove possible " at the end: https://stackoverflow.com/a/12249011;
|
|
26
|
-
const dialogChoice = dialogManager.dialogMessageMap.get(btreeUtils.simplifyToken(choiceName));
|
|
38
|
+
const dialogChoice = this.dialogManager.dialogMessageMap.get(btreeUtils.simplifyToken(choiceName));
|
|
27
39
|
if (dialogChoice !== undefined) {
|
|
28
40
|
// force choice
|
|
29
|
-
dialogManager.setDialogChoice(dialogChoice);
|
|
41
|
+
this.dialogManager.setDialogChoice(dialogChoice);
|
|
30
42
|
}
|
|
31
43
|
else {
|
|
32
44
|
console.error(`Unknown jump node at line ${nodeArgs.lineIndex + 1}: ${choiceName} or ${btreeUtils.simplifyToken(choiceName)}`);
|
|
@@ -2,39 +2,63 @@
|
|
|
2
2
|
import AresHappy from "../../assets/characters/ares/ares_happy.webp";
|
|
3
3
|
import { onMount } from "svelte";
|
|
4
4
|
import { DialogState } from "../../types/pineapple_fiber/DialogState";
|
|
5
|
-
import {
|
|
5
|
+
import { getDialogManager } from "../dialog_manager/DialogMangerInit";
|
|
6
|
+
import type { IDialogManager } from "../dialog_manager/IDialogManager";
|
|
7
|
+
import PinyaCard from "../../ui/elements/PinyaCard/PinyaCard.svelte";
|
|
8
|
+
import { appState } from "../../ui/templates/index";
|
|
9
|
+
import CloseIcon from "../../assets/icons/close.svg";
|
|
10
|
+
import FABIcon from "../../assets/bg_tiled/bg_tiled_turnip.png";
|
|
11
|
+
import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
12
|
+
import { PinyaButton } from "../../ui/elements/index";
|
|
13
|
+
import { slide } from "svelte/transition";
|
|
6
14
|
|
|
7
15
|
let currentMessage = $state("");
|
|
8
|
-
dialogManager.currentMessage.subscribe((value) => {
|
|
9
|
-
currentMessage = value;
|
|
10
|
-
});
|
|
11
|
-
|
|
12
16
|
let currentPortrait = $state(AresHappy);
|
|
13
|
-
|
|
14
|
-
if (value) {
|
|
15
|
-
currentPortrait = value;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
17
|
+
let isMounted = $state(false);
|
|
18
18
|
|
|
19
19
|
let hidePercent = $state(100);
|
|
20
20
|
let isHidden = $state(true);
|
|
21
|
+
let dialogManager: IDialogManager | undefined = $state(undefined);
|
|
21
22
|
onMount(() => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
getDialogManager()
|
|
24
|
+
.then(dm => {
|
|
25
|
+
dialogManager = dm;
|
|
26
|
+
|
|
27
|
+
dialogManager.currentMessage.subscribe((value) => {
|
|
28
|
+
currentMessage = value;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
dialogManager.currentPortrait.subscribe((value) => {
|
|
32
|
+
if (value) {
|
|
33
|
+
currentPortrait = value;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
dialogManager.hidePercent.subscribe((value) => {
|
|
38
|
+
hidePercent = value * 0.4;
|
|
39
|
+
isHidden = false;
|
|
40
|
+
});
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
dialogManager.currentReadableState.subscribe((value) => {
|
|
43
|
+
isHidden = value === DialogState.Invisible;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
dialogManager.update(0);
|
|
47
|
+
isMounted = true;
|
|
48
|
+
});
|
|
30
49
|
|
|
31
|
-
dialogManager.update(0);
|
|
32
50
|
});
|
|
33
51
|
|
|
34
52
|
const onDialogClick = () => {
|
|
35
|
-
dialogManager
|
|
53
|
+
dialogManager?.skipAnimation();
|
|
36
54
|
};
|
|
37
55
|
|
|
56
|
+
let enableDialogueOverlayValue = $state(true);
|
|
57
|
+
enableDialogueOverlay.subscribe((value) => {
|
|
58
|
+
enableDialogueOverlayValue = value;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
enableDialogueOverlay.set(appState.enableDialogOnByDefault ?? false);
|
|
38
62
|
</script>
|
|
39
63
|
|
|
40
64
|
<div class="dialog-elements"
|
|
@@ -44,18 +68,64 @@
|
|
|
44
68
|
<div class="dialog-portrait-container">
|
|
45
69
|
<img src={currentPortrait} alt="Ares" class="dialog-portrait" />
|
|
46
70
|
</div>
|
|
47
|
-
<div
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
71
|
+
<div
|
|
72
|
+
tabindex="0"
|
|
73
|
+
role="button"
|
|
74
|
+
class="dialog-box"
|
|
75
|
+
onclick={onDialogClick}
|
|
76
|
+
onkeyup={(e) => {
|
|
77
|
+
if (e.key === 'j') {
|
|
78
|
+
onDialogClick()
|
|
79
|
+
; }
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<PinyaCard
|
|
83
|
+
widthClass=""
|
|
84
|
+
paddingClass=""
|
|
85
|
+
className="dialog-name"
|
|
86
|
+
>
|
|
87
|
+
<div>
|
|
88
|
+
<b class="fake-h1">Turnip</b>
|
|
89
|
+
</div>
|
|
90
|
+
</PinyaCard>
|
|
91
|
+
<PinyaCard
|
|
92
|
+
widthClass="w-full"
|
|
93
|
+
className="dialog-text"
|
|
94
|
+
>
|
|
52
95
|
<!-- Made for 140 characters, like the original tweets -->
|
|
53
96
|
{@html currentMessage}
|
|
54
|
-
</
|
|
97
|
+
</PinyaCard>
|
|
55
98
|
</div>
|
|
56
99
|
</div>
|
|
57
100
|
|
|
101
|
+
|
|
102
|
+
{#if appState.allowDialog && isMounted}
|
|
103
|
+
<div class="fab-container" in:slide>
|
|
104
|
+
<PinyaButton
|
|
105
|
+
classes="fab"
|
|
106
|
+
onclick={()=>{
|
|
107
|
+
getDialogManager().then(dm => dm.toggleDialogOverlay());
|
|
108
|
+
}}>
|
|
109
|
+
{#if (enableDialogueOverlayValue)}
|
|
110
|
+
<img class="turnip-icon" src={CloseIcon} alt="interactive floating action button represented as a turnip">
|
|
111
|
+
{:else }
|
|
112
|
+
<img class="turnip-icon" src={FABIcon} alt="interactive floating action button represented as a turnip">
|
|
113
|
+
{/if}
|
|
114
|
+
</PinyaButton>
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
58
118
|
<style>
|
|
119
|
+
:global(.dialog-text) {
|
|
120
|
+
height: 100%;
|
|
121
|
+
padding: 1.2lh 2rem 0.5lh;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:global(.dialog-box *,.dialog-name *) {
|
|
125
|
+
font-size: clamp(1em, 5vw, 1.3em);
|
|
126
|
+
line-height: 1.5em;
|
|
127
|
+
}
|
|
128
|
+
|
|
59
129
|
.dialog-elements {
|
|
60
130
|
position: fixed;
|
|
61
131
|
z-index: 10;
|
|
@@ -73,11 +143,6 @@
|
|
|
73
143
|
transform: translateY(var(--hidePercentHeight));
|
|
74
144
|
}
|
|
75
145
|
|
|
76
|
-
.dialog-box *,
|
|
77
|
-
.dialog-name * {
|
|
78
|
-
font-size: clamp(1em, 5vw, 1.3em);
|
|
79
|
-
line-height: 1.5em;
|
|
80
|
-
}
|
|
81
146
|
|
|
82
147
|
.dialog-padding :global(p) {
|
|
83
148
|
font-size: clamp(1em, 5vw, 1.3em) !important;
|
|
@@ -88,19 +153,18 @@
|
|
|
88
153
|
padding: clamp(1.5em, 5vw, 1.75em) clamp(0em, 5vw - 0.5em, 2em) 0;
|
|
89
154
|
}
|
|
90
155
|
|
|
91
|
-
.dialog-name {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
padding-right: 4rem;
|
|
156
|
+
:global(.dialog-name) {
|
|
157
|
+
padding-left: 2rem;
|
|
158
|
+
padding-right: 2rem;
|
|
95
159
|
position: fixed;
|
|
96
160
|
}
|
|
97
161
|
|
|
98
|
-
.dialog-name:dir(ltr) {
|
|
162
|
+
:global(.dialog-name:dir(ltr)) {
|
|
99
163
|
/* for centering vertically */
|
|
100
164
|
transform: translateX(clamp(0em, 5vw - 0.5em, 1em)) translateY(-50%);
|
|
101
165
|
}
|
|
102
166
|
|
|
103
|
-
.dialog-name:dir(rtl) {
|
|
167
|
+
:global(.dialog-name:dir(rtl)) {
|
|
104
168
|
/* for centering vertically */
|
|
105
169
|
transform: translateX(calc(clamp(0em, 5vw - 0.5em, 1em) * -1)) translateY(-50%);
|
|
106
170
|
}
|
|
@@ -129,4 +193,59 @@
|
|
|
129
193
|
.dialog-portrait:dir(rtl) {
|
|
130
194
|
transform: scaleX(-1);
|
|
131
195
|
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
.dialog-box {
|
|
199
|
+
background-color: var(--color-surface-500);
|
|
200
|
+
position: fixed;
|
|
201
|
+
bottom: 0;
|
|
202
|
+
width: var(--dialog-box-width); /*75em + 4em padding*/
|
|
203
|
+
height: var(--dialog-box-height);
|
|
204
|
+
max-width: calc(100vw - ((var(--fab-margin) * 2) + 4em));
|
|
205
|
+
border-radius: 1rem;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.dark .dialog-box {
|
|
209
|
+
background-color: rgb(var(--color-surface-900) / 0.95);
|
|
210
|
+
--tw-ring-color: rgb(var(--color-text-400));
|
|
211
|
+
/*background-color: red;*/
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:global(.fab) {
|
|
215
|
+
/*@apply btn preset-filled-tertiary-500;*/
|
|
216
|
+
background-color: var(--color-tertiary-500);
|
|
217
|
+
padding: 0.3rem;
|
|
218
|
+
width: 4em;
|
|
219
|
+
border-radius: 50%;
|
|
220
|
+
z-index: 100;
|
|
221
|
+
box-shadow: 3px 3px 3px var(--shadow-color);
|
|
222
|
+
margin-bottom: var(--fab-margin);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.fab-container {
|
|
226
|
+
position: fixed;
|
|
227
|
+
bottom: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.fab-container:dir(ltr) {
|
|
231
|
+
right: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.fab-container:dir(rtl) {
|
|
235
|
+
left: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
:global(.fab > img) {
|
|
239
|
+
width: 100%;
|
|
240
|
+
filter: brightness(0) invert(1);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:global(.fab:dir(ltr)) {
|
|
244
|
+
margin-right: var(--fab-margin);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:global(.fab:dir(rtl)) {
|
|
248
|
+
margin-left: var(--fab-margin);
|
|
249
|
+
}
|
|
250
|
+
|
|
132
251
|
</style>
|
|
@@ -90,12 +90,6 @@
|
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
92
|
<style>
|
|
93
|
-
:root {
|
|
94
|
-
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
95
|
-
--dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-start-pad) - var(--theme-border-base)));
|
|
96
|
-
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
93
|
.default-page-container {
|
|
100
94
|
max-width: 2100px;
|
|
101
95
|
margin: 4em auto;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import Toast from "./toast/Toast.svelte";
|
|
21
21
|
import DialogOverlay from "../dialog_overlay/DialogOverlay.svelte";
|
|
22
22
|
import { fade } from "svelte/transition";
|
|
23
|
-
import {
|
|
23
|
+
import { getDialogManager } from "../dialog_manager/DialogMangerInit";
|
|
24
24
|
|
|
25
25
|
interface Props {
|
|
26
26
|
showDialogByDefault?: boolean;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
|
|
78
78
|
<!--todo: turn off hidden when it's time-->
|
|
79
79
|
<button class="fab" onclick={()=>{
|
|
80
|
-
|
|
80
|
+
getDialogManager().then(dm => dm.toggleDialogOverlay());
|
|
81
81
|
}}>
|
|
82
82
|
{#if (enableDialogueOverlayValue)}
|
|
83
83
|
<img class="turnip-icon" src={CloseIcon} alt="interactive floating action button represented as a turnip">
|
|
@@ -137,25 +137,6 @@
|
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
139
|
<style>
|
|
140
|
-
:root {
|
|
141
|
-
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
142
|
-
--dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-start-pad) - var(--theme-border-base)));
|
|
143
|
-
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
144
|
-
|
|
145
|
-
/** FAB icon margin/position calculation origin:
|
|
146
|
-
Criteria:
|
|
147
|
-
- We want at mobile (360px) our margin to be at 1em (16px)
|
|
148
|
-
- We want at web (1960px) our margin to be at 2em (32px)
|
|
149
|
-
|
|
150
|
-
A useful scaling factor might vw. At 360px, 16px would be around 4.44vw (360/16).
|
|
151
|
-
At 360px: margin is at 16px or 1em.
|
|
152
|
-
At 1960px: 4.44vw is at 87px but that will be clamped to 32px or 2em.
|
|
153
|
-
The calculation implies that the natural point that the margin becomes 2em is clamped on
|
|
154
|
-
wider screens is at 727px.
|
|
155
|
-
*/
|
|
156
|
-
--fab-margin: clamp(1em, 4.44vw, 2em);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
140
|
/*todo*/
|
|
160
141
|
/*@apply flex justify-center items-center;*/
|
|
161
142
|
.default-page-container {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
2
2
|
export * from "./components/index";
|
|
3
3
|
export * from "./components/overrideable_meta/index";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./ui/modules/NavigationMenu/index";
|
|
5
5
|
export * from "./types/api/index";
|
|
6
6
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
7
7
|
export * from "./components/dialog_manager/DialogManager";
|
|
@@ -10,5 +10,5 @@ export * from "./types/pineapple_fiber/PortraitType";
|
|
|
10
10
|
export * from "./types/pineapple_fiber/DialogDetail";
|
|
11
11
|
export * from "./util/util";
|
|
12
12
|
export * from "./api/index";
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
13
|
+
export type { IDialogManager } from "./components/dialog_manager/IDialogManager";
|
|
14
|
+
export { getDialogManager } from "./components/dialog_manager/DialogMangerInit";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
|
|
3
3
|
export * from "./components/index";
|
|
4
4
|
export * from "./components/overrideable_meta/index";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./ui/modules/NavigationMenu/index";
|
|
6
6
|
export * from "./types/api/index";
|
|
7
7
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
8
8
|
export * from "./components/dialog_manager/DialogManager";
|
|
@@ -11,5 +11,4 @@ export * from "./types/pineapple_fiber/PortraitType";
|
|
|
11
11
|
export * from "./types/pineapple_fiber/DialogDetail";
|
|
12
12
|
export * from "./util/util";
|
|
13
13
|
export * from "./api/index";
|
|
14
|
-
export
|
|
15
|
-
export { dialogManager } from "./components/dialog_manager/DialogMangerInit";
|
|
14
|
+
export { getDialogManager } from "./components/dialog_manager/DialogMangerInit";
|
package/dist/styles/app.css
CHANGED
|
@@ -10,16 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
@custom-variant turnip (&:where([data-theme=turnip], [data-theme=turnip] *));
|
|
12
12
|
|
|
13
|
+
html {
|
|
14
|
+
--dialog-start-pad: clamp(0em, 5vw, 2em);
|
|
15
|
+
--dialog-box-width: min(calc(54em), calc(100vw - var(--dialog-start-pad) - 2px));
|
|
16
|
+
--dialog-box-height: clamp(15em, 50vw, 18em);
|
|
17
|
+
--fab-margin: 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
.footer-space {
|
|
14
21
|
width: 100%;
|
|
15
22
|
height: calc(var(--dialog-box-height) + 4em);
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
a.dialog-choice {
|
|
26
|
+
font-size: inherit;
|
|
19
27
|
cursor: url("$pkg/assets/icons/chat-cursor.svg"), auto;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
a.external-link {
|
|
31
|
+
font-size: inherit;
|
|
23
32
|
cursor: url("$pkg/assets/icons/external-link.svg"), auto;
|
|
24
33
|
}
|
|
25
34
|
|
|
@@ -37,20 +46,6 @@ a.external-link {
|
|
|
37
46
|
background: rgba(var(--color-secondary-500));
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
.dialog-box {
|
|
41
|
-
background-color: rgb(var(--color-surface-500) / 0.9);
|
|
42
|
-
position: fixed;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
width: var(--dialog-box-width); /*75em + 4em padding*/
|
|
45
|
-
height: var(--dialog-box-height);
|
|
46
|
-
max-width: calc(100vw - ((var(--fab-margin) * 2) + 4em));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.dark .dialog-box {
|
|
50
|
-
background-color: rgb(var(--color-surface-900) / 0.95);
|
|
51
|
-
--tw-ring-color: rgb(var(--color-text-400));
|
|
52
|
-
/*background-color: red;*/
|
|
53
|
-
}
|
|
54
49
|
|
|
55
50
|
@layer base {
|
|
56
51
|
.game-link-section {
|