@turnipxenon/pineapple 2.4.13 → 2.4.14

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.
Files changed (74) hide show
  1. package/.idea/discord.xml +1 -1
  2. package/.idea/workspace.xml +125 -110
  3. package/.svelte-kit/__package__/app.postcss +28 -2
  4. package/.svelte-kit/__package__/assets/icons/close.svg +1 -0
  5. package/.svelte-kit/__package__/components/Card.svelte +1 -1
  6. package/.svelte-kit/__package__/components/Chip.svelte +1 -0
  7. package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte +48 -24
  8. package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
  9. package/.svelte-kit/__package__/components/pineapple/overlay_manager/OverlayManager.js +1 -0
  10. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
  11. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.js +1 -0
  12. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte +48 -0
  13. package/.svelte-kit/__package__/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
  14. package/.svelte-kit/__package__/components/pineapple/toast/Toast.d.ts +27 -0
  15. package/.svelte-kit/__package__/components/pineapple/toast/Toast.js +37 -0
  16. package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte +89 -0
  17. package/.svelte-kit/__package__/components/pineapple/toast/Toast.svelte.d.ts +14 -0
  18. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
  19. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
  20. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  21. package/.svelte-kit/__package__/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
  22. package/.svelte-kit/__package__/index.d.ts +1 -1
  23. package/.svelte-kit/__package__/index.js +1 -1
  24. package/.svelte-kit/generated/client/app.js +1 -1
  25. package/.svelte-kit/generated/client/nodes/5.js +1 -1
  26. package/.svelte-kit/generated/server/internal.js +1 -1
  27. package/.svelte-kit/types/route_meta_data.json +1 -1
  28. package/.svelte-kit/types/src/routes/$types.d.ts +1 -1
  29. package/.svelte-kit/types/src/routes/(pineapple)/$types.d.ts +1 -1
  30. package/.svelte-kit/types/src/routes/(pineapple)/{personal → pineapple}/$types.d.ts +1 -1
  31. package/dist/app.postcss +28 -2
  32. package/dist/assets/icons/close.svg +1 -0
  33. package/dist/components/Card.svelte +1 -1
  34. package/dist/components/Chip.svelte +1 -0
  35. package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte +48 -24
  36. package/dist/components/pineapple/overlay_manager/OverlayManager.d.ts +0 -0
  37. package/dist/components/pineapple/overlay_manager/OverlayManager.js +1 -0
  38. package/dist/components/pineapple/toast/DefaultToastBody.d.ts +8 -0
  39. package/dist/components/pineapple/toast/DefaultToastBody.js +1 -0
  40. package/dist/components/pineapple/toast/DefaultToastBody.svelte +48 -0
  41. package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +20 -0
  42. package/dist/components/pineapple/toast/Toast.d.ts +27 -0
  43. package/dist/components/pineapple/toast/Toast.js +37 -0
  44. package/dist/components/pineapple/toast/Toast.svelte +89 -0
  45. package/dist/components/pineapple/toast/Toast.svelte.d.ts +14 -0
  46. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +5 -0
  47. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.js +1 -0
  48. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  49. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +23 -0
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +1 -1
  52. package/docs/OverlaySpec.md +23 -0
  53. package/docs/pull_request_template.md +34 -0
  54. package/package.json +1 -1
  55. package/src/lib/app.postcss +28 -2
  56. package/src/lib/assets/icons/close.svg +1 -0
  57. package/src/lib/components/Card.svelte +1 -1
  58. package/src/lib/components/Chip.svelte +1 -0
  59. package/src/lib/components/pineapple/PineappleBaseLayout.svelte +207 -0
  60. package/src/lib/components/pineapple/overlay_manager/OverlayManager.ts +0 -0
  61. package/src/lib/components/pineapple/toast/DefaultToastBody.svelte +43 -0
  62. package/src/lib/components/pineapple/toast/DefaultToastBody.ts +10 -0
  63. package/src/lib/components/pineapple/toast/Toast.svelte +113 -0
  64. package/src/lib/components/pineapple/toast/Toast.ts +57 -0
  65. package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.svelte +1 -0
  66. package/src/lib/components/pineapple/toast/custom-toast/TestCustomToast.ts +6 -0
  67. package/src/lib/index.ts +1 -1
  68. package/src/routes/(pineapple)/+layout.svelte +1 -1
  69. package/src/routes/(pineapple)/+page.svelte +2 -2
  70. package/src/routes/(pineapple)/pineapple/+page.svelte +44 -0
  71. package/src/lib/components/layouts/PineappleBaseLayout.svelte +0 -182
  72. package/src/routes/(pineapple)/personal/+page.svelte +0 -37
  73. /package/.svelte-kit/__package__/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
  74. /package/dist/components/{layouts → pineapple}/PineappleBaseLayout.svelte.d.ts +0 -0
@@ -0,0 +1,57 @@
1
+ import { writable } from "svelte/store";
2
+ import type { DefaultToastPair } from "$pkg/components/pineapple/toast/DefaultToastBody";
3
+ import DefaultToastBody from "$pkg/components/pineapple/toast/DefaultToastBody.svelte";
4
+ import type { TestCustomToastPair } from "$pkg/components/pineapple/toast/custom-toast/TestCustomToast";
5
+
6
+ /**
7
+ * Default toast duration is 5 seconds
8
+ */
9
+ export const DefaultToastParamsDuration = 5000;
10
+
11
+ export type CustomToastPairs = DefaultToastPair
12
+ | TestCustomToastPair;
13
+
14
+ export type DismissToastCallback = () => void;
15
+
16
+ // todo: note may not be possible
17
+ export interface ToastParams {
18
+ componentAndProps: CustomToastPairs;
19
+ /**
20
+ * Time in millisecond. If undefined, defaults to DefaultToastParamsDuration
21
+ */
22
+ duration?: number;
23
+ }
24
+
25
+ /**
26
+ * todo: do not call directly documentation
27
+ */
28
+ export const activeToast = writable<ToastParams | undefined>();
29
+
30
+ export const toastQueue: ToastParams[] = [];
31
+
32
+ /**
33
+ *
34
+ * @param newToast
35
+ */
36
+ export const showComponentInToast = (newToast: ToastParams) => {
37
+ // todo: queue component
38
+ activeToast.update((currentToast) => {
39
+ if (currentToast !== undefined) {
40
+ toastQueue.push(newToast);
41
+ return currentToast;
42
+ } else {
43
+ return newToast;
44
+ }
45
+ });
46
+ };
47
+
48
+ export const showTextInToast = (message: string) => {
49
+ showComponentInToast({
50
+ componentAndProps: {
51
+ component: DefaultToastBody,
52
+ props: {
53
+ message
54
+ }
55
+ }
56
+ });
57
+ };
@@ -0,0 +1 @@
1
+ <h1>Testing bad custom card</h1>
@@ -0,0 +1,6 @@
1
+ import TestCustomToast from "./TestCustomToast.svelte";
2
+
3
+ export interface TestCustomToastPair {
4
+ component: typeof TestCustomToast;
5
+ props: undefined;
6
+ }
package/src/lib/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as PineappleLayoutBase } from "./components/layouts/PineappleBaseLayout.svelte";
1
+ export { default as PineappleLayoutBase } from "./components/pineapple/PineappleBaseLayout.svelte";
2
2
  export { default as SeaweedTemplate } from "./template/SeaweedTemplate.svelte";
3
3
  export { default as LazyAsset } from "./components/LazyAsset.svelte";
4
4
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import PinyaBaseLayout from "$pkg/components/layouts/PineappleBaseLayout.svelte";
2
+ import PinyaBaseLayout from "$pkg/components/pineapple/PineappleBaseLayout.svelte";
3
3
  import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
4
4
  </script>
5
5
 
@@ -2,7 +2,7 @@
2
2
  import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
3
3
 
4
4
  import { createGoToFunction } from "$pkg/util/create_go_to_function";
5
- import PineappleBaseLayout from "$pkg/components/layouts/PineappleBaseLayout.svelte";
5
+ import PineappleBaseLayout from "$pkg/components/pineapple/PineappleBaseLayout.svelte";
6
6
  </script>
7
7
 
8
8
  <svelte:head>
@@ -18,7 +18,7 @@
18
18
  <h1 class="mb-8">Directory</h1>
19
19
 
20
20
  <div class="btn-group-vertical variant-filled-secondary">
21
- <button on:click={createGoToFunction("personal")}><h2>Personal</h2></button>
21
+ <button on:click={createGoToFunction("pineapple")}><h2>Personal</h2></button>
22
22
  <button on:click={createGoToFunction("portfolio")}><h2>Portfolio</h2></button>
23
23
  </div>
24
24
  </div>
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { PUBLIC_CRINGE_USERNAME } from "$env/static/public";
3
+ import { showComponentInToast, showTextInToast } from "$pkg/components/pineapple/toast/Toast";
4
+ import TestCard from "$pkg/components/pineapple/toast/custom-toast/TestCustomToast.svelte";
5
+
6
+ let testingQueueNumber = 1;
7
+ const testingRandomPhrases = [
8
+ "Niko",
9
+ "Niko the Baikal seal",
10
+ "Niko the Baikal seal\nfrom Toba Aquarium"
11
+ ];
12
+ </script>
13
+
14
+ <svelte:head>
15
+ <title>Welcome to {PUBLIC_CRINGE_USERNAME}'s Home</title>
16
+ <meta content="Welcome to {PUBLIC_CRINGE_USERNAME}'s Home" name="og:title" />
17
+ <meta
18
+ content="Welcome to {PUBLIC_CRINGE_USERNAME}'s home! It's a neat place to be at if you're feeling lost. Come hang around!"
19
+ name="og:description"
20
+ />
21
+ </svelte:head>
22
+
23
+ <div class="card default-card">
24
+
25
+ <button
26
+ class="btn variant-filled-secondary"
27
+ on:click={() => {
28
+ showComponentInToast({componentAndProps: {component: TestCard, props: undefined}});
29
+ }}><h3>Test custom toast</h3></button>
30
+ <button
31
+ class="btn variant-filled-secondary"
32
+ on:click={() => {
33
+ showTextInToast(`${testingQueueNumber} ${testingRandomPhrases[testingQueueNumber]}`);
34
+ testingQueueNumber = (testingQueueNumber + 1) % testingRandomPhrases.length;
35
+ }}><h3>Handy toast</h3></button>
36
+ </div>
37
+
38
+ <style lang="postcss">
39
+ .default-card {
40
+ display: flex;
41
+ flex-wrap: wrap;
42
+ gap: 2em;
43
+ }
44
+ </style>
@@ -1,182 +0,0 @@
1
- <script lang="ts">
2
- // For auto dark/light mode
3
- import {AppBar, AppShell, autoModeWatcher, LightSwitch} from "@skeletonlabs/skeleton";
4
- import RandomizedBackground from "$lib/components/RandomizedBackground.svelte";
5
-
6
- // navigation
7
- import {page} from "$app/stores";
8
- // store
9
- import {enableBackground} from "$lib/store";
10
- import type {BreadcrumbData} from "$lib/types/BreadcrumbData";
11
- // assets
12
- import DialogOverlay from "$lib/components/DialogOverlay.svelte";
13
- import AresLogo from "$lib/assets/characters/ares/ares_logo.webp";
14
- import FABIcon from "$lib/assets/placeholder/placeholder_circle.png";
15
- import {enableDialogueOverlay} from "$lib/components/dialog_manager/DialogManagerStore";
16
- // todo: clean up all these imports!
17
-
18
- let pages: BreadcrumbData[] = [];
19
-
20
- const updateBreadcrumb = (pathname: string) => {
21
- pages = [];
22
- let basePath = "";
23
- pathname.split("/").forEach((value, index) => {
24
- if (index === 0) {
25
- basePath = "/";
26
- pages.push({
27
- path: "/",
28
- name: "Home"
29
- });
30
- return;
31
- }
32
-
33
- if (value === "") {
34
- return;
35
- }
36
-
37
- basePath += value + "/";
38
- pages.push({
39
- path: basePath,
40
- name: value
41
- });
42
- });
43
- pages = pages;
44
- };
45
-
46
- $: updateBreadcrumb($page.url.pathname); // run every time we navigate
47
-
48
- let enableBackgroundValue = true;
49
- enableBackground.subscribe((value) => {
50
- enableBackgroundValue = value;
51
- });
52
-
53
- let enableDialogueOverlayValue = true;
54
- enableDialogueOverlay.subscribe((value) => {
55
- enableDialogueOverlayValue = value;
56
- });
57
- </script>
58
-
59
- <!-- App Shell -->
60
- <svelte:head>
61
- {@html `<script>${autoModeWatcher.toString()} autoModeWatcher();</script>`}
62
- </svelte:head>
63
-
64
- <!--todo: turn off hidden when it's time-->
65
- <button type="button" class="fab" on:click={()=>{
66
- enableDialogueOverlay.set(!enableDialogueOverlayValue);
67
- }}>
68
- <img src={FABIcon} alt="interactive floating action button represented as a turnip">
69
- </button>
70
-
71
- <AppShell>
72
- <svelte:fragment slot="header">
73
- <!-- App Bar -->
74
- <AppBar slotDefault="place-content-start" slotTrail="place-content-end">
75
- <svelte:fragment slot="lead">
76
- <!--TODO: add logo or something for the lead in layout-->
77
- <img
78
- alt="Ares's head titled towards the left with his tongue out and winking"
79
- class="ares-logo"
80
- src={AresLogo}
81
- />
82
- <span class="mr-2"/>
83
- <ol class="breadcrumb">
84
- {#each pages as crumb, i}
85
- {#if i < pages.length - 1}
86
- <li class="crumb">
87
- <a href={crumb.path}>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</a>
88
- </li>
89
- <li class="crumb-separator" aria-hidden="true">&rsaquo;</li>
90
- {:else}
91
- <li class="crumb">{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</li>
92
- {/if}
93
- {/each}
94
- </ol>
95
- </svelte:fragment>
96
- <svelte:fragment slot="trail">
97
- <LightSwitch bgLight="bg-surface-400"/>
98
- </svelte:fragment>
99
- </AppBar>
100
- </svelte:fragment>
101
-
102
- <RandomizedBackground enable={enableBackgroundValue}/>
103
-
104
- {#if enableDialogueOverlayValue}
105
- <!-- Page Route Content -->
106
- <div class="default-page-container">
107
- <slot/>
108
- <div class="footer-space"/>
109
- </div>
110
- <DialogOverlay/>
111
- {:else}
112
- <DialogOverlay/>
113
- <slot/>
114
- {/if}
115
- </AppShell>
116
-
117
- <style lang="postcss">
118
- :root {
119
- --dialog-left-pad: clamp(0em, 5vw, 2em);
120
- --dialog-box-width: min(calc(50em + 4em), calc(100vw - var(--dialog-left-pad) - var(--theme-border-base)));
121
- --dialog-box-height: clamp(15em, 50vw, 18em);
122
- }
123
-
124
- .default-page-container {
125
- @apply flex justify-center items-center;
126
- margin-top: 4em;
127
- margin-left: clamp(1em, 15vw, 10em);
128
- margin-right: 1em;
129
- flex-direction: column;
130
- z-index: 0;
131
- }
132
-
133
- .ares-logo {
134
- object-fit: contain;
135
- height: 2em;
136
- margin-inline-end: 0.5em;
137
- }
138
-
139
- /* breadcrumb does not work due to a lot of magic stuff i do
140
- the code below is from skeleton's tailwind css:
141
- https://github.com/skeletonlabs/skeleton/blob/54f4ecedabf2be6d94a670b56dc8821095ca3fc9/packages/plugin/src/styles/components/breadcrumbs.css
142
-
143
- it likely disappeared due to code gen shenanigans and package magic */
144
- .breadcrumb,
145
- .breadcrumb-nonresponsive {
146
- @apply flex items-center space-x-4 w-full overflow-x-auto;
147
- /*@apply flex items-center space-x-4 w-full hide-scrollbar overflow-x-auto;*/
148
- }
149
-
150
- .crumb {
151
- @apply flex justify-center items-center space-x-2;
152
- }
153
-
154
- .crumb-separator {
155
- @apply flex text-surface-700-200-token opacity-50;
156
- }
157
-
158
- /* === Auto-Responsive === */
159
-
160
- .breadcrumb li {
161
- @apply hidden md:block;
162
- }
163
-
164
- .breadcrumb li:nth-last-child(3),
165
- .breadcrumb li:nth-last-child(2),
166
- .breadcrumb li:nth-last-child(1) {
167
- @apply block;
168
- }
169
-
170
- .fab {
171
- position: fixed;
172
- bottom: 2em;
173
- }
174
-
175
- .fab:dir(ltr) {
176
- right: 2em;
177
- }
178
-
179
- .fab:dir(rtl) {
180
- left: 2em;
181
- }
182
- </style>
@@ -1,37 +0,0 @@
1
- <script>
2
- import {PUBLIC_CRINGE_USERNAME} from "$env/static/public";
3
- </script>
4
-
5
- <svelte:head>
6
- <title>Welcome to {PUBLIC_CRINGE_USERNAME}'s Home</title>
7
- <meta content="Welcome to {PUBLIC_CRINGE_USERNAME}'s Home" name="og:title"/>
8
- <meta
9
- content="Welcome to {PUBLIC_CRINGE_USERNAME}'s home! It's a neat place to be at if you're feeling lost. Come hang around!"
10
- name="og:description"
11
- />
12
- </svelte:head>
13
-
14
- <div class="card default-card">
15
-
16
- <h1 class="mb-8">Directory</h1>
17
-
18
- <div class="btn-group-vertical variant-filled-secondary">
19
- <button onclick="location.href='/about'"><h2>About</h2></button>
20
- <button onclick="location.href='/socials'"><h2>Socials</h2></button>
21
- <button onclick="location.href='/game-dev'"><h2>Game development</h2></button>
22
- <button onclick="location.href='/blogs'"><h2>Blogs</h2></button>
23
- <button onclick="location.href='/misc'"><h2>Miscellaneous</h2></button>
24
- </div>
25
- </div>
26
-
27
- <style lang="postcss">
28
- .btn-group-vertical button {
29
- padding: 2em;
30
- }
31
-
32
- .default-card {
33
- text-align: center;
34
- padding-inline-end: 0;
35
- @apply p-16;
36
- }
37
- </style>