@turnipxenon/pineapple 2.10.0 → 3.0.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/assets/icons/icon-contrast.svg +1 -0
- package/dist/assets/icons/icon-dark-mode.svg +1 -0
- package/dist/assets/icons/icon-light-mode.svg +1 -0
- package/dist/assets/icons/icon-settings.svg +1 -0
- package/dist/components/Card.svelte +43 -41
- package/dist/components/Card.svelte.d.ts +11 -24
- package/dist/components/CarouselElement.svelte +15 -8
- package/dist/components/CarouselElement.svelte.d.ts +7 -18
- package/dist/components/ElementVisbilityDetector.svelte +23 -14
- package/dist/components/ElementVisbilityDetector.svelte.d.ts +6 -17
- package/dist/components/LazyAsset.svelte +93 -65
- package/dist/components/LazyAsset.svelte.d.ts +9 -19
- package/dist/components/PineappleSlideToggle.svelte +19 -7
- package/dist/components/PineappleSlideToggle.svelte.d.ts +8 -19
- package/dist/components/RandomizedBackground.svelte +46 -27
- package/dist/components/RandomizedBackground.svelte.d.ts +5 -15
- package/dist/components/RandomizedImage.svelte +15 -8
- package/dist/components/RandomizedImage.svelte.d.ts +6 -16
- package/dist/components/StickyElement.svelte +25 -16
- package/dist/components/StickyElement.svelte.d.ts +6 -17
- package/dist/components/ToggleableContent.svelte +88 -59
- package/dist/components/ToggleableContent.svelte.d.ts +6 -17
- package/dist/components/blog_template/BlogTemplate.svelte +45 -25
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +9 -20
- package/dist/components/blog_template/BlogTemplateInner.svelte +11 -3
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +6 -17
- package/dist/components/chip/Chip.svelte +33 -57
- package/dist/components/chip/Chip.svelte.d.ts +7 -18
- package/dist/components/combo_box/ComboBox.svelte +10 -4
- package/dist/components/combo_box/ComboBox.svelte.d.ts +6 -16
- package/dist/components/combo_box/ComboBoxWithButton.svelte +16 -9
- package/dist/components/combo_box/ComboBoxWithButton.svelte.d.ts +7 -17
- package/dist/components/combo_box/combo-box.postcss +2 -2
- package/dist/components/dialog_manager/DialogManager.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.js +1 -1
- package/dist/components/dialog_overlay/DialogOverlay.svelte +42 -34
- package/dist/components/dialog_overlay/DialogOverlay.svelte.d.ts +3 -14
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/layouts/SeaweedBaseLayout.svelte +80 -43
- package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +8 -21
- package/dist/components/navigation_component/NavigationComponent.svelte +52 -141
- package/dist/components/navigation_component/NavigationComponent.svelte.d.ts +17 -26
- package/dist/components/navigation_component/NavigationControl.svelte +52 -103
- package/dist/components/navigation_component/NavigationControl.svelte.d.ts +7 -17
- package/dist/components/overrideable_meta/OverridableMeta.svelte +37 -22
- package/dist/components/overrideable_meta/OverridableMeta.svelte.d.ts +9 -19
- package/dist/components/pineapple/PineappleBaseLayout.svelte +132 -188
- package/dist/components/pineapple/PineappleBaseLayout.svelte.d.ts +6 -17
- package/dist/components/pineapple/toast/DefaultToastBody.svelte +14 -16
- package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +7 -17
- package/dist/components/pineapple/toast/Toast.d.ts +0 -1
- package/dist/components/pineapple/toast/Toast.svelte +92 -64
- package/dist/components/pineapple/toast/Toast.svelte.d.ts +3 -14
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +22 -19
- package/dist/paraglide/messages/_index.d.ts +2 -0
- package/dist/paraglide/messages/_index.js +3 -0
- package/dist/paraglide/messages/example_message.d.ts +5 -0
- package/dist/paraglide/messages/example_message.js +39 -0
- package/dist/paraglide/messages/settings.d.ts +3 -0
- package/dist/paraglide/messages/settings.js +38 -0
- package/dist/paraglide/messages.d.ts +2 -0
- package/dist/paraglide/messages.js +4 -0
- package/dist/paraglide/registry.d.ts +21 -0
- package/dist/paraglide/registry.js +31 -0
- package/dist/paraglide/runtime.d.ts +400 -0
- package/dist/paraglide/runtime.js +1060 -0
- package/dist/paraglide/server.d.ts +64 -0
- package/dist/paraglide/server.js +161 -0
- package/dist/scripts/util/FileManagement.d.ts +1 -1
- package/dist/store.d.ts +0 -1
- package/dist/styles/app.css +53 -0
- package/dist/styles/turnip-theme.css +323 -0
- package/dist/template/seaweed/CreateUrlForm.svelte +50 -38
- package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +5 -15
- package/dist/template/seaweed/SeaweedTemplate.svelte +244 -195
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +28 -25
- package/dist/template/seaweed/entries/ChefWings.svelte +37 -39
- package/dist/template/seaweed/entries/ChefWings.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte +32 -24
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Hepcat.svelte +58 -49
- package/dist/template/seaweed/entries/Hepcat.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Pengi.svelte +51 -43
- package/dist/template/seaweed/entries/Pengi.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Soulwork.svelte +44 -36
- package/dist/template/seaweed/entries/Soulwork.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/ThisWebpage.svelte +47 -38
- package/dist/template/seaweed/entries/ThisWebpage.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/WorkExperience.svelte +109 -92
- package/dist/template/seaweed/entries/WorkExperience.svelte.d.ts +6 -16
- package/dist/template/seaweed/entries/Workset.svelte +51 -42
- package/dist/template/seaweed/entries/Workset.svelte.d.ts +5 -15
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +136 -259
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +10 -20
- package/dist/template/seaweed/seaweed.postcss +1 -9
- package/dist/{theme.postcss → theme.css} +1 -4
- package/dist/ui/components/FourPartCard.svelte +47 -0
- package/dist/ui/components/FourPartCard.svelte.d.ts +10 -0
- package/dist/ui/components/ModalBase.svelte +75 -0
- package/dist/ui/components/ModalBase.svelte.d.ts +8 -0
- package/dist/ui/components/SocialSection.svelte +87 -0
- package/dist/ui/components/SocialSection.svelte.d.ts +9 -0
- package/dist/ui/components/index.d.ts +3 -0
- package/dist/ui/components/index.js +3 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte +87 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte.d.ts +6 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte +42 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte.d.ts +7 -0
- package/dist/ui/elements/ColorScheme.d.ts +10 -0
- package/dist/ui/elements/ColorScheme.js +11 -0
- package/dist/ui/elements/GeneralUIProps.d.ts +12 -0
- package/dist/ui/elements/GeneralUIProps.js +1 -0
- package/dist/ui/elements/ImageIcon.svelte +54 -0
- package/dist/ui/elements/ImageIcon.svelte.d.ts +6 -0
- package/dist/ui/elements/OnBackground.d.ts +3 -0
- package/dist/ui/elements/OnBackground.js +4 -0
- package/dist/ui/elements/TextLink.svelte +17 -0
- package/dist/ui/elements/TextLink.svelte.d.ts +8 -0
- package/dist/ui/elements/WrapperProps.d.ts +4 -0
- package/dist/ui/elements/WrapperProps.js +1 -0
- package/dist/ui/elements/index.d.ts +8 -0
- package/dist/ui/elements/index.js +8 -0
- package/dist/ui/elements/pinya-button/component.svelte +47 -0
- package/dist/ui/elements/pinya-button/component.svelte.d.ts +4 -0
- package/dist/ui/elements/pinya-button/index.d.ts +2 -0
- package/dist/ui/elements/pinya-button/index.js +2 -0
- package/dist/ui/elements/pinya-button/props.d.ts +13 -0
- package/dist/ui/elements/pinya-button/props.js +6 -0
- package/dist/ui/elements/pinya-card/component.svelte +19 -0
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +7 -0
- package/dist/ui/elements/pinya-card/index.d.ts +2 -0
- package/dist/ui/elements/pinya-card/index.js +2 -0
- package/dist/ui/elements/pinya-card/props.d.ts +7 -0
- package/dist/ui/elements/pinya-card/props.js +1 -0
- package/dist/ui/modules/index.d.ts +1 -0
- package/dist/ui/modules/index.js +1 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +110 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte.d.ts +4 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +48 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte.d.ts +3 -0
- package/dist/{template → ui/modules}/seaweed/ChumBucket.svelte +28 -28
- package/dist/ui/modules/seaweed/ChumBucket.svelte.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.js +4 -0
- package/dist/ui/templates/PinyaBase.svelte +45 -0
- package/dist/ui/templates/PinyaBase.svelte.d.ts +7 -0
- package/dist/ui/templates/confirmation-modal/component.svelte +47 -0
- package/dist/ui/templates/confirmation-modal/component.svelte.d.ts +4 -0
- package/dist/ui/templates/confirmation-modal/index.d.ts +2 -0
- package/dist/ui/templates/confirmation-modal/index.js +2 -0
- package/dist/ui/templates/confirmation-modal/props.d.ts +10 -0
- package/dist/ui/templates/confirmation-modal/props.js +1 -0
- package/dist/ui/templates/index.d.ts +3 -0
- package/dist/ui/templates/index.js +3 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte +113 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +8 -0
- package/dist/ui/templates/pinya-page-layout/index.d.ts +2 -0
- package/dist/ui/templates/pinya-page-layout/index.js +2 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.d.ts +7 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.js +3 -0
- package/package.json +36 -18
- package/src/lib/styles/app.css +53 -0
- package/src/lib/theme.css +114 -0
- package/dist/app.postcss +0 -212
- package/dist/components/SocialSection.svelte +0 -166
- package/dist/components/SocialSection.svelte.d.ts +0 -31
- package/dist/postcss.d.ts +0 -3
- package/dist/styles/DefaultGridContainer.css +0 -61
- package/dist/template/seaweed/ChumBucket.svelte.d.ts +0 -14
|
@@ -1,59 +1,81 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { run } from "svelte/legacy";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// For auto dark/light mode
|
|
6
|
+
import { AppBar } from "@skeletonlabs/skeleton-svelte";
|
|
7
|
+
import RandomizedBackground from "../RandomizedBackground.svelte";
|
|
8
|
+
|
|
9
|
+
// navigation
|
|
10
|
+
import { page } from "$app/stores";
|
|
11
|
+
// store
|
|
12
|
+
import { enableBackground } from "../../store";
|
|
13
|
+
import type { BreadcrumbData } from "../../types/BreadcrumbData";
|
|
14
|
+
// assets
|
|
15
|
+
// import DialogOverlay from "../DialogOverlay.svelte";
|
|
16
|
+
import AresLogo from "../../assets/characters/ares/ares_logo.webp";
|
|
17
|
+
import FABIcon from "../../assets/bg_tiled/bg_tiled_turnip.png";
|
|
18
|
+
import CloseIcon from "../../assets/icons/close.svg";
|
|
19
|
+
import { dialogManager, enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
20
|
+
import Toast from "./toast/Toast.svelte";
|
|
21
|
+
import DialogOverlay from "../dialog_overlay/DialogOverlay.svelte";
|
|
22
|
+
import { fade } from "svelte/transition";
|
|
23
|
+
|
|
24
|
+
interface Props {
|
|
25
|
+
showDialogByDefault?: boolean;
|
|
26
|
+
children?: import("svelte").Snippet;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let { showDialogByDefault = false, children }: Props = $props();
|
|
30
|
+
// todo: clean up all these imports!
|
|
31
|
+
|
|
32
|
+
let pages: BreadcrumbData[] = $state([]);
|
|
33
|
+
|
|
34
|
+
const updateBreadcrumb = (pathname: string) => {
|
|
35
|
+
pages = [];
|
|
36
|
+
let basePath = "";
|
|
37
|
+
pathname.split("/").forEach((value, index) => {
|
|
38
|
+
if (index === 0) {
|
|
39
|
+
basePath = "/";
|
|
40
|
+
pages.push({
|
|
41
|
+
path: "/",
|
|
42
|
+
name: "Home"
|
|
43
|
+
});
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (value === "") {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
basePath += value + "/";
|
|
52
|
+
pages.push({
|
|
53
|
+
path: basePath,
|
|
54
|
+
name: value
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
pages = pages;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
run(() => {
|
|
61
|
+
updateBreadcrumb($page.url.pathname);
|
|
62
|
+
}); // run every time we navigate
|
|
63
|
+
|
|
64
|
+
let enableBackgroundValue = $state(true);
|
|
65
|
+
enableBackground.subscribe((value) => {
|
|
66
|
+
enableBackgroundValue = value;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
let enableDialogueOverlayValue = $state(true);
|
|
70
|
+
enableDialogueOverlay.subscribe((value) => {
|
|
71
|
+
enableDialogueOverlayValue = value;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
enableDialogueOverlay.set(showDialogByDefault);
|
|
48
75
|
</script>
|
|
49
76
|
|
|
50
|
-
<!-- App Shell -->
|
|
51
|
-
<svelte:head>
|
|
52
|
-
{@html `<script>${autoModeWatcher.toString()} autoModeWatcher();</script>`}
|
|
53
|
-
</svelte:head>
|
|
54
|
-
|
|
55
77
|
<!--todo: turn off hidden when it's time-->
|
|
56
|
-
<button class="fab"
|
|
78
|
+
<button class="fab" onclick={()=>{
|
|
57
79
|
dialogManager.toggleDialogOverlay()
|
|
58
80
|
}}>
|
|
59
81
|
{#if (enableDialogueOverlayValue)}
|
|
@@ -63,39 +85,42 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
63
85
|
{/if}
|
|
64
86
|
</button>
|
|
65
87
|
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{#
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
<div>
|
|
89
|
+
<!-- todo: header #migration -->
|
|
90
|
+
<!-- App Bar -->
|
|
91
|
+
<AppBar
|
|
92
|
+
background="bg-surface-600 dark:bg-surface-900">
|
|
93
|
+
{#snippet lead()}
|
|
94
|
+
|
|
95
|
+
<!--TODO: add logo or something for the lead in layout-->
|
|
96
|
+
<img
|
|
97
|
+
alt="Ares's head titled towards the left with his tongue out and winking"
|
|
98
|
+
class="ares-logo"
|
|
99
|
+
src={AresLogo}
|
|
100
|
+
/>
|
|
101
|
+
<span class="mr-2"></span>
|
|
102
|
+
<ol class="breadcrumb">
|
|
103
|
+
{#each pages as crumb, i}
|
|
104
|
+
{#if i < pages.length - 1}
|
|
105
|
+
<li class="crumb" in:fade>
|
|
106
|
+
<a href={crumb.path}>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</a>
|
|
107
|
+
›
|
|
108
|
+
</li>
|
|
109
|
+
{:else}
|
|
110
|
+
<li class="crumb" in:fade>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</li>
|
|
111
|
+
{/if}
|
|
112
|
+
{/each}
|
|
113
|
+
</ol>
|
|
114
|
+
|
|
115
|
+
{/snippet}
|
|
116
|
+
{#snippet trail()}
|
|
117
|
+
|
|
118
|
+
<!-- todo: light switch #migration -->
|
|
119
|
+
<!-- <LightSwitch bgLight="bg-surface-400" />-->
|
|
120
|
+
|
|
121
|
+
{/snippet}
|
|
122
|
+
</AppBar>
|
|
123
|
+
|
|
99
124
|
|
|
100
125
|
<RandomizedBackground enable={enableBackgroundValue} />
|
|
101
126
|
|
|
@@ -104,11 +129,11 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
104
129
|
<DialogOverlay></DialogOverlay>
|
|
105
130
|
|
|
106
131
|
<div class="default-page-container">
|
|
107
|
-
|
|
108
|
-
<div class="footer-space"
|
|
132
|
+
{@render children?.()}
|
|
133
|
+
<div class="footer-space"></div>
|
|
109
134
|
</div>
|
|
110
135
|
|
|
111
|
-
</
|
|
136
|
+
</div>
|
|
112
137
|
|
|
113
138
|
<style>
|
|
114
139
|
:root {
|
|
@@ -130,19 +155,18 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
130
155
|
--fab-margin: clamp(1em, 4.44vw, 2em);
|
|
131
156
|
}
|
|
132
157
|
|
|
158
|
+
/*todo*/
|
|
159
|
+
/*@apply flex justify-center items-center;*/
|
|
133
160
|
.default-page-container {
|
|
134
161
|
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: center;
|
|
137
162
|
width: 100%;
|
|
138
163
|
padding: 1lh clamp(8px, 10vw, 2em);
|
|
139
164
|
flex-direction: column;
|
|
140
165
|
z-index: 0;
|
|
141
|
-
}
|
|
166
|
+
}
|
|
142
167
|
|
|
143
168
|
.ares-logo {
|
|
144
|
-
|
|
145
|
-
object-fit: contain;
|
|
169
|
+
object-fit: contain;
|
|
146
170
|
height: 2em;
|
|
147
171
|
margin-inline-end: 0.5em;
|
|
148
172
|
}
|
|
@@ -154,116 +178,36 @@ enableDialogueOverlay.set(showDialogByDefault);
|
|
|
154
178
|
it likely disappeared due to code gen shenanigans and package magic */
|
|
155
179
|
.breadcrumb,
|
|
156
180
|
.breadcrumb-nonresponsive {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
overflow-x: auto;
|
|
161
|
-
/*@apply flex items-center space-x-4 w-full hide-scrollbar overflow-x-auto;*/
|
|
162
|
-
}
|
|
181
|
+
/*todo: */
|
|
182
|
+
/*@apply flex items-center w-full overflow-x-auto;*/
|
|
183
|
+
}
|
|
163
184
|
|
|
164
185
|
.crumb {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
justify-content: center;
|
|
186
|
+
/*todo: */
|
|
187
|
+
/*@apply flex justify-center items-center;*/
|
|
168
188
|
margin: 0.1em;
|
|
169
|
-
}
|
|
189
|
+
}
|
|
170
190
|
|
|
171
191
|
.crumb-separator {
|
|
172
|
-
|
|
192
|
+
/*todo: */
|
|
193
|
+
/*@apply flex;*/
|
|
173
194
|
color: var(--color-text-50);
|
|
174
|
-
}
|
|
195
|
+
}
|
|
175
196
|
|
|
176
197
|
/* === Auto-Responsive === */
|
|
177
198
|
|
|
178
199
|
.breadcrumb li {
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
@media (min-width: 768px) {
|
|
183
|
-
|
|
184
|
-
.breadcrumb li {
|
|
185
|
-
display: block;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
200
|
+
/*@apply hidden md:block;*/
|
|
201
|
+
}
|
|
188
202
|
|
|
189
203
|
.breadcrumb li:nth-last-child(3),
|
|
190
204
|
.breadcrumb li:nth-last-child(2),
|
|
191
205
|
.breadcrumb li:nth-last-child(1) {
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:is(.dark .fab) {
|
|
196
|
-
--tw-bg-opacity: 1;
|
|
197
|
-
background-color: rgb(var(--color-tertiary-500) / var(--tw-bg-opacity));
|
|
198
|
-
color: rgb(var(--on-tertiary));
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.fab:disabled {
|
|
202
|
-
cursor: not-allowed;
|
|
203
|
-
opacity: 0.5;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.fab:disabled:hover {
|
|
207
|
-
--tw-brightness: brightness(1);
|
|
208
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.fab:disabled:active {
|
|
212
|
-
--tw-scale-x: 1;
|
|
213
|
-
--tw-scale-y: 1;
|
|
214
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.fab {
|
|
218
|
-
font-size: 1rem;
|
|
219
|
-
line-height: 1.5rem;
|
|
220
|
-
padding-left: 1.25rem;
|
|
221
|
-
padding-right: 1.25rem;
|
|
222
|
-
padding-top: 9px;
|
|
223
|
-
padding-bottom: 9px;
|
|
224
|
-
white-space: nowrap;
|
|
225
|
-
text-align: center;
|
|
226
|
-
display: inline-flex;
|
|
227
|
-
align-items: center;
|
|
228
|
-
justify-content: center;
|
|
229
|
-
transition-property: all;
|
|
230
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
231
|
-
transition-duration: 150ms;
|
|
232
|
-
border-radius: var(--theme-rounded-base);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.fab > :not([hidden]) ~ :not([hidden]) {
|
|
236
|
-
--tw-space-x-reverse: 0;
|
|
237
|
-
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
238
|
-
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.fab:hover {
|
|
242
|
-
--tw-brightness: brightness(1.15);
|
|
243
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.fab:active {
|
|
247
|
-
--tw-scale-x: 95%;
|
|
248
|
-
--tw-scale-y: 95%;
|
|
249
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
250
|
-
--tw-brightness: brightness(.9);
|
|
251
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.fab {
|
|
255
|
-
--tw-bg-opacity: 1;
|
|
256
|
-
background-color: rgb(var(--color-tertiary-500) / var(--tw-bg-opacity));
|
|
257
|
-
color: rgb(var(--on-tertiary));
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
:is(.dark .fab) {
|
|
261
|
-
--tw-bg-opacity: 1;
|
|
262
|
-
background-color: rgb(var(--color-tertiary-500) / var(--tw-bg-opacity));
|
|
263
|
-
color: rgb(var(--on-tertiary));
|
|
264
|
-
}
|
|
206
|
+
/*@apply block;*/
|
|
207
|
+
}
|
|
265
208
|
|
|
266
209
|
.fab {
|
|
210
|
+
/*@apply btn preset-filled-tertiary-500;*/
|
|
267
211
|
padding: 0;
|
|
268
212
|
position: fixed;
|
|
269
213
|
bottom: var(--fab-margin);
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
showDialogByDefault?: boolean | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type PineappleBaseLayoutProps = typeof __propDef.props;
|
|
14
|
-
export type PineappleBaseLayoutEvents = typeof __propDef.events;
|
|
15
|
-
export type PineappleBaseLayoutSlots = typeof __propDef.slots;
|
|
16
|
-
export default class PineappleBaseLayout extends SvelteComponent<PineappleBaseLayoutProps, PineappleBaseLayoutEvents, PineappleBaseLayoutSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
showDialogByDefault?: boolean;
|
|
3
|
+
children?: import("svelte").Snippet;
|
|
17
4
|
}
|
|
18
|
-
|
|
5
|
+
declare const PineappleBaseLayout: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type PineappleBaseLayout = ReturnType<typeof PineappleBaseLayout>;
|
|
7
|
+
export default PineappleBaseLayout;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Props } from "./DefaultToastBody";
|
|
3
|
+
import type { DismissToastCallback } from "./Toast";
|
|
4
|
+
import CloseIcon from "../../../assets/icons/close.svg";
|
|
5
|
+
|
|
6
|
+
interface Props_1 {
|
|
7
|
+
props: Props;
|
|
8
|
+
dismissToastCallback: DismissToastCallback | undefined;
|
|
9
|
+
shouldEnableButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { props, dismissToastCallback, shouldEnableButton = false }: Props_1 = $props();
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<div class="body-container">
|
|
8
16
|
<!-- todo: support markdown? -->
|
|
9
|
-
<button class="btn"
|
|
17
|
+
<button class="btn bg-surface-100 dark:bg-surface-900"
|
|
10
18
|
disabled={!shouldEnableButton}
|
|
11
|
-
|
|
19
|
+
onclick={dismissToastCallback}>
|
|
12
20
|
<img class="img-icon" src={CloseIcon} alt="close button">
|
|
13
21
|
</button>
|
|
14
22
|
<div class="text-container">
|
|
@@ -31,16 +39,6 @@ export let shouldEnableButton = false;
|
|
|
31
39
|
margin-left: 1em;
|
|
32
40
|
}
|
|
33
41
|
|
|
34
|
-
.btn {
|
|
35
|
-
--tw-bg-opacity: 1;
|
|
36
|
-
background-color: rgb(var(--color-surface-100) / var(--tw-bg-opacity));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:is(.dark .btn) {
|
|
40
|
-
--tw-bg-opacity: 1;
|
|
41
|
-
background-color: rgb(var(--color-surface-900) / var(--tw-bg-opacity));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
42
|
.btn {
|
|
45
43
|
border-radius: 8px;
|
|
46
44
|
padding: 0.5em;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Props } from "./DefaultToastBody";
|
|
3
2
|
import type { DismissToastCallback } from "./Toast";
|
|
4
|
-
|
|
5
|
-
props:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
shouldEnableButton?: boolean | undefined;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export type DefaultToastBodyProps = typeof __propDef.props;
|
|
16
|
-
export type DefaultToastBodyEvents = typeof __propDef.events;
|
|
17
|
-
export type DefaultToastBodySlots = typeof __propDef.slots;
|
|
18
|
-
export default class DefaultToastBody extends SvelteComponent<DefaultToastBodyProps, DefaultToastBodyEvents, DefaultToastBodySlots> {
|
|
3
|
+
interface Props_1 {
|
|
4
|
+
props: Props;
|
|
5
|
+
dismissToastCallback: DismissToastCallback | undefined;
|
|
6
|
+
shouldEnableButton?: boolean;
|
|
19
7
|
}
|
|
20
|
-
|
|
8
|
+
declare const DefaultToastBody: import("svelte").Component<Props_1, {}, "">;
|
|
9
|
+
type DefaultToastBody = ReturnType<typeof DefaultToastBody>;
|
|
10
|
+
export default DefaultToastBody;
|
|
@@ -1,56 +1,80 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
activeToast,
|
|
4
|
+
type CustomToastPairs,
|
|
5
|
+
DefaultToastParamsDuration,
|
|
6
|
+
toastQueue
|
|
7
|
+
} from "./Toast";
|
|
8
|
+
import { type ComponentType } from "svelte";
|
|
9
|
+
import Card from "../../Card.svelte";
|
|
10
|
+
import { spring, tweened } from "svelte/motion";
|
|
11
|
+
|
|
12
|
+
let localComponent: ComponentType | undefined = $state();
|
|
13
|
+
let localProps: CustomToastPairs["props"] = $state();
|
|
14
|
+
|
|
15
|
+
// todo: make hidden value reliant on current vh
|
|
16
|
+
const HIDDEN_VALUE = -15;
|
|
17
|
+
const SHOWN_VALUE = 0;
|
|
18
|
+
const progress = tweened(0, { duration: DefaultToastParamsDuration });
|
|
19
|
+
const position = spring(HIDDEN_VALUE);
|
|
20
|
+
position.damping = 0.4;
|
|
21
|
+
let isDismissed = false;
|
|
22
|
+
let shouldEnableButton = $state(false);
|
|
23
|
+
|
|
24
|
+
const onToastDisappear = () => {
|
|
25
|
+
// clear the local component to undefined to make the component disappear
|
|
26
|
+
// also set activeToast to null to indicate to the system that it's ready to take new
|
|
27
|
+
// Toast requests
|
|
28
|
+
localComponent = undefined;
|
|
29
|
+
activeToast.update(() => {
|
|
30
|
+
if (toastQueue.length === 0) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return toastQueue.shift();
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
activeToast.subscribe((params) => {
|
|
38
|
+
if (!params) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (params.componentAndProps?.component === localComponent) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
localComponent = params.componentAndProps.component;
|
|
47
|
+
localProps = params.componentAndProps.props;
|
|
48
|
+
|
|
49
|
+
// todo: make unnested
|
|
50
|
+
// set progress to 0 before showing
|
|
51
|
+
progress.set(0, { duration: 0 }).then(() => {
|
|
52
|
+
// animate showing the toast
|
|
53
|
+
position.set(SHOWN_VALUE).then(() => {
|
|
54
|
+
shouldEnableButton = true;
|
|
55
|
+
|
|
56
|
+
// now animate the lifespan of the current toast
|
|
57
|
+
progress.set(100, { delay: 500, duration: params.duration ?? DefaultToastParamsDuration }).then(() => {
|
|
58
|
+
// during the lifecycle the button to cause dismissal can only happen when
|
|
59
|
+
// position is completely set SHOWN_VALUE and when progress has reached to 100
|
|
60
|
+
shouldEnableButton = false;
|
|
61
|
+
if (isDismissed) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// when the lifespan duration is over, animate hiding the toast by putting its bottom
|
|
66
|
+
// position out of bounds
|
|
67
|
+
position.set(HIDDEN_VALUE).then(onToastDisappear);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const dismissToast = () => {
|
|
74
|
+
shouldEnableButton = false;
|
|
75
|
+
isDismissed = true;
|
|
76
|
+
position.set(HIDDEN_VALUE).then(onToastDisappear);
|
|
77
|
+
};
|
|
54
78
|
</script>
|
|
55
79
|
|
|
56
80
|
{#if (localComponent !== undefined)}
|
|
@@ -59,17 +83,21 @@ const dismissToast = () => {
|
|
|
59
83
|
<Card marginBottom="1lh"
|
|
60
84
|
turnOnLightModeBorder={false}
|
|
61
85
|
overrideStyle="box-shadow: 3px 3px 3px var(--shadow-color);">
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
{#snippet content()}
|
|
87
|
+
<div >
|
|
88
|
+
{#if (localProps !== undefined)}
|
|
89
|
+
{@const SvelteComponent = localComponent}
|
|
90
|
+
<SvelteComponent
|
|
91
|
+
props={localProps}
|
|
92
|
+
dismissToastCallback={dismissToast}
|
|
93
|
+
shouldEnableButton={shouldEnableButton} />
|
|
94
|
+
{:else }
|
|
95
|
+
{@const SvelteComponent_1 = localComponent}
|
|
96
|
+
<SvelteComponent_1 />
|
|
97
|
+
{/if}
|
|
98
|
+
<progress id="toast-progress" value={$progress/100}></progress>
|
|
99
|
+
</div>
|
|
100
|
+
{/snippet}
|
|
73
101
|
</Card>
|
|
74
102
|
</div>
|
|
75
103
|
{/if}
|