@turnipxenon/pineapple 3.1.0-alpha.9 → 4.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.
Files changed (72) hide show
  1. package/README.md +10 -0
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.js +3 -3
  4. package/dist/ui/elements/CodeBlock/CodeBlock.svelte +2 -1
  5. package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +1 -1
  6. package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte +3 -6
  7. package/dist/{components → ui/modules}/dialog_overlay/DialogOverlay.svelte +11 -10
  8. package/dist/ui/modules/index.d.ts +2 -0
  9. package/dist/ui/modules/index.js +2 -0
  10. package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte +3 -2
  11. package/dist/{components → ui/templates}/blog_template/BlogTemplate.svelte +4 -4
  12. package/dist/{components → ui/templates}/blog_template/BlogTemplate.svelte.d.ts +1 -1
  13. package/dist/{components → ui/templates}/blog_template/BlogTemplateInner.svelte +1 -1
  14. package/dist/{components → ui/templates}/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
  15. package/package.json +1 -1
  16. package/dist/components/Card.svelte +0 -64
  17. package/dist/components/Card.svelte.d.ts +0 -12
  18. package/dist/components/CarouselElement.svelte +0 -28
  19. package/dist/components/CarouselElement.svelte.d.ts +0 -8
  20. package/dist/components/LazyAsset.svelte +0 -124
  21. package/dist/components/LazyAsset.svelte.d.ts +0 -10
  22. package/dist/components/LazyAssetType.d.ts +0 -10
  23. package/dist/components/LazyAssetType.js +0 -12
  24. package/dist/components/OnElementVisbilityChanged.d.ts +0 -1
  25. package/dist/components/OnElementVisbilityChanged.js +0 -1
  26. package/dist/components/PineappleSlideToggle.svelte +0 -30
  27. package/dist/components/PineappleSlideToggle.svelte.d.ts +0 -10
  28. package/dist/components/RandomizedBackground.svelte +0 -87
  29. package/dist/components/RandomizedBackground.svelte.d.ts +0 -7
  30. package/dist/components/RandomizedImage.svelte +0 -44
  31. package/dist/components/RandomizedImage.svelte.d.ts +0 -7
  32. package/dist/components/StickyElement.svelte +0 -45
  33. package/dist/components/StickyElement.svelte.d.ts +0 -7
  34. package/dist/components/ToggleableContent.svelte +0 -95
  35. package/dist/components/ToggleableContent.svelte.d.ts +0 -8
  36. package/dist/components/ToggleableContentType.d.ts +0 -4
  37. package/dist/components/ToggleableContentType.js +0 -5
  38. package/dist/components/chip/Chip.svelte +0 -71
  39. package/dist/components/chip/Chip.svelte.d.ts +0 -8
  40. package/dist/components/combo_box/ComboBox.svelte +0 -17
  41. package/dist/components/combo_box/ComboBox.svelte.d.ts +0 -8
  42. package/dist/components/combo_box/ComboBoxWithButton.svelte +0 -29
  43. package/dist/components/combo_box/ComboBoxWithButton.svelte.d.ts +0 -9
  44. package/dist/components/combo_box/combo-box.postcss +0 -22
  45. package/dist/components/index.d.ts +0 -8
  46. package/dist/components/index.js +0 -9
  47. package/dist/components/layouts/LayoutConstants.d.ts +0 -1
  48. package/dist/components/layouts/LayoutConstants.js +0 -1
  49. package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -115
  50. package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +0 -9
  51. package/dist/components/pineapple/PineappleBaseLayout.svelte +0 -216
  52. package/dist/components/pineapple/PineappleBaseLayout.svelte.d.ts +0 -7
  53. package/dist/components/pineapple/toast/DefaultToastBody.d.ts +0 -8
  54. package/dist/components/pineapple/toast/DefaultToastBody.js +0 -1
  55. package/dist/components/pineapple/toast/DefaultToastBody.svelte +0 -46
  56. package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +0 -10
  57. package/dist/components/pineapple/toast/Toast.d.ts +0 -26
  58. package/dist/components/pineapple/toast/Toast.js +0 -37
  59. package/dist/components/pineapple/toast/Toast.svelte +0 -120
  60. package/dist/components/pineapple/toast/Toast.svelte.d.ts +0 -3
  61. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.d.ts +0 -5
  62. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.js +0 -1
  63. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte +0 -1
  64. package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +0 -26
  65. /package/dist/{components → modules}/overrideable_meta/OverridableMeta.svelte +0 -0
  66. /package/dist/{components → modules}/overrideable_meta/OverridableMeta.svelte.d.ts +0 -0
  67. /package/dist/{components → modules}/overrideable_meta/OverridableMetaProps.d.ts +0 -0
  68. /package/dist/{components → modules}/overrideable_meta/OverridableMetaProps.js +0 -0
  69. /package/dist/{components → modules}/overrideable_meta/index.d.ts +0 -0
  70. /package/dist/{components → modules}/overrideable_meta/index.js +0 -0
  71. /package/dist/{components → ui/modules}/dialog_overlay/DialogOverlay.svelte.d.ts +0 -0
  72. /package/dist/{components → ui/templates}/blog_template/blog-template.css +0 -0
@@ -1,216 +0,0 @@
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 { 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
- import { dialogManager } from "../dialog_manager/DialogManager";
24
-
25
- interface Props {
26
- showDialogByDefault?: boolean;
27
- children?: import("svelte").Snippet;
28
- }
29
-
30
- let { showDialogByDefault = false, children }: Props = $props();
31
- // todo: clean up all these imports!
32
-
33
- let pages: BreadcrumbData[] = $state([]);
34
-
35
- const updateBreadcrumb = (pathname: string) => {
36
- pages = [];
37
- let basePath = "";
38
- pathname.split("/").forEach((value, index) => {
39
- if (index === 0) {
40
- basePath = "/";
41
- pages.push({
42
- path: "/",
43
- name: "Home"
44
- });
45
- return;
46
- }
47
-
48
- if (value === "") {
49
- return;
50
- }
51
-
52
- basePath += value + "/";
53
- pages.push({
54
- path: basePath,
55
- name: value
56
- });
57
- });
58
- pages = pages;
59
- };
60
-
61
- run(() => {
62
- updateBreadcrumb($page.url.pathname);
63
- }); // run every time we navigate
64
-
65
- let enableBackgroundValue = $state(true);
66
- enableBackground.subscribe((value) => {
67
- enableBackgroundValue = value;
68
- });
69
-
70
- let enableDialogueOverlayValue = $state(true);
71
- enableDialogueOverlay.subscribe((value) => {
72
- enableDialogueOverlayValue = value;
73
- });
74
-
75
- enableDialogueOverlay.set(showDialogByDefault);
76
- </script>
77
-
78
- <!--todo: turn off hidden when it's time-->
79
- <button class="fab" onclick={()=>{
80
- dialogManager.toggleDialogOverlay();
81
- }}>
82
- {#if (enableDialogueOverlayValue)}
83
- <img class="turnip-icon" src={CloseIcon} alt="interactive floating action button represented as a turnip">
84
- {:else }
85
- <img class="turnip-icon" src={FABIcon} alt="interactive floating action button represented as a turnip">
86
- {/if}
87
- </button>
88
-
89
- <div>
90
- <!-- todo: header #migration -->
91
- <!-- App Bar -->
92
- <AppBar
93
- background="bg-surface-600 dark:bg-surface-900">
94
- {#snippet lead()}
95
-
96
- <!--TODO: add logo or something for the lead in layout-->
97
- <img
98
- alt="Ares's head titled towards the left with his tongue out and winking"
99
- class="ares-logo"
100
- src={AresLogo}
101
- />
102
- <span class="mr-2"></span>
103
- <ol class="breadcrumb">
104
- {#each pages as crumb, i}
105
- {#if i < pages.length - 1}
106
- <li class="crumb" in:fade>
107
- <a href={crumb.path}>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</a>
108
-  › 
109
- </li>
110
- {:else}
111
- <li class="crumb" in:fade>{crumb.name.charAt(0).toUpperCase() + crumb.name.slice(1)}</li>
112
- {/if}
113
- {/each}
114
- </ol>
115
-
116
- {/snippet}
117
- {#snippet trail()}
118
-
119
- <!-- todo: light switch #migration -->
120
- <!-- <LightSwitch bgLight="bg-surface-400" />-->
121
-
122
- {/snippet}
123
- </AppBar>
124
-
125
-
126
- <RandomizedBackground enable={enableBackgroundValue} />
127
-
128
- <Toast></Toast>
129
-
130
- <DialogOverlay></DialogOverlay>
131
-
132
- <div class="default-page-container">
133
- {@render children?.()}
134
- <div class="footer-space"></div>
135
- </div>
136
-
137
- </div>
138
-
139
- <style>
140
- /*todo*/
141
- /*@apply flex justify-center items-center;*/
142
- .default-page-container {
143
- display: flex;
144
- width: 100%;
145
- padding: 1lh clamp(8px, 10vw, 2em);
146
- flex-direction: column;
147
- z-index: 0;
148
- }
149
-
150
- .ares-logo {
151
- object-fit: contain;
152
- height: 2em;
153
- margin-inline-end: 0.5em;
154
- }
155
-
156
- /* breadcrumb does not work due to a lot of magic stuff i do
157
- the code below is from skeleton's tailwind css:
158
- https://github.com/skeletonlabs/skeleton/blob/54f4ecedabf2be6d94a670b56dc8821095ca3fc9/packages/plugin/src/styles/components/breadcrumbs.css
159
-
160
- it likely disappeared due to code gen shenanigans and package magic */
161
- .breadcrumb,
162
- .breadcrumb-nonresponsive {
163
- /*todo: */
164
- /*@apply flex items-center w-full overflow-x-auto;*/
165
- }
166
-
167
- .crumb {
168
- /*todo: */
169
- /*@apply flex justify-center items-center;*/
170
- margin: 0.1em;
171
- }
172
-
173
- .crumb-separator {
174
- /*todo: */
175
- /*@apply flex;*/
176
- color: var(--color-text-50);
177
- }
178
-
179
- /* === Auto-Responsive === */
180
-
181
- .breadcrumb li {
182
- /*@apply hidden md:block;*/
183
- }
184
-
185
- .breadcrumb li:nth-last-child(3),
186
- .breadcrumb li:nth-last-child(2),
187
- .breadcrumb li:nth-last-child(1) {
188
- /*@apply block;*/
189
- }
190
-
191
- .fab {
192
- /*@apply btn preset-filled-tertiary-500;*/
193
- padding: 0;
194
- position: fixed;
195
- bottom: var(--fab-margin);
196
- width: 4em;
197
- border-radius: 50%;
198
- z-index: 100;
199
- }
200
-
201
- .fab > img {
202
- width: 100%;
203
- }
204
-
205
- .fab:dir(ltr) {
206
- right: var(--fab-margin);
207
- }
208
-
209
- .fab:dir(rtl) {
210
- left: var(--fab-margin);
211
- }
212
-
213
- .turnip-icon {
214
- margin: 4px;
215
- }
216
- </style>
@@ -1,7 +0,0 @@
1
- interface Props {
2
- showDialogByDefault?: boolean;
3
- children?: import("svelte").Snippet;
4
- }
5
- declare const PineappleBaseLayout: import("svelte").Component<Props, {}, "">;
6
- type PineappleBaseLayout = ReturnType<typeof PineappleBaseLayout>;
7
- export default PineappleBaseLayout;
@@ -1,8 +0,0 @@
1
- import DefaultToastBody from "./DefaultToastBody.svelte";
2
- export interface Props {
3
- message: string;
4
- }
5
- export interface DefaultToastPair {
6
- component: typeof DefaultToastBody;
7
- props: Props;
8
- }
@@ -1 +0,0 @@
1
- import DefaultToastBody from "./DefaultToastBody.svelte";
@@ -1,46 +0,0 @@
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();
13
- </script>
14
-
15
- <div class="body-container">
16
- <!-- todo: support markdown? -->
17
- <button class="btn bg-surface-100 dark:bg-surface-900"
18
- disabled={!shouldEnableButton}
19
- onclick={dismissToastCallback}>
20
- <img class="img-icon" src={CloseIcon} alt="close button">
21
- </button>
22
- <div class="text-container">
23
- <span>{props.message}</span>
24
- </div>
25
- </div>
26
-
27
- <style>
28
- .body-container {
29
- display: flex;
30
- gap: 1em;
31
- }
32
-
33
- .text-container {
34
- margin-top: 0.25lh;
35
- margin-right: 1em;
36
- }
37
-
38
- .text-container:dir(rtl) {
39
- margin-left: 1em;
40
- }
41
-
42
- .btn {
43
- border-radius: 8px;
44
- padding: 0.5em;
45
- }
46
- </style>
@@ -1,10 +0,0 @@
1
- import type { Props } from "./DefaultToastBody";
2
- import type { DismissToastCallback } from "./Toast";
3
- interface Props_1 {
4
- props: Props;
5
- dismissToastCallback: DismissToastCallback | undefined;
6
- shouldEnableButton?: boolean;
7
- }
8
- declare const DefaultToastBody: import("svelte").Component<Props_1, {}, "">;
9
- type DefaultToastBody = ReturnType<typeof DefaultToastBody>;
10
- export default DefaultToastBody;
@@ -1,26 +0,0 @@
1
- import type { DefaultToastPair } from "./DefaultToastBody";
2
- import type { TestCustomToastPair } from "./custom-toast/TestCustomToast";
3
- /**
4
- * Default toast duration is 5 seconds
5
- */
6
- export declare const DefaultToastParamsDuration = 5000;
7
- export type CustomToastPairs = DefaultToastPair | TestCustomToastPair;
8
- export type DismissToastCallback = () => void;
9
- export interface ToastParams {
10
- componentAndProps: CustomToastPairs;
11
- /**
12
- * Time in millisecond. If undefined, defaults to DefaultToastParamsDuration
13
- */
14
- duration?: number;
15
- }
16
- /**
17
- * todo: do not call directly documentation
18
- */
19
- export declare const activeToast: import("svelte/store").Writable<ToastParams | undefined>;
20
- export declare const toastQueue: ToastParams[];
21
- /**
22
- *
23
- * @param newToast
24
- */
25
- export declare const showComponentInToast: (newToast: ToastParams) => void;
26
- export declare const showTextInToast: (message: string) => void;
@@ -1,37 +0,0 @@
1
- import { writable } from "svelte/store";
2
- import DefaultToastBody from "./DefaultToastBody.svelte";
3
- /**
4
- * Default toast duration is 5 seconds
5
- */
6
- export const DefaultToastParamsDuration = 5000;
7
- /**
8
- * todo: do not call directly documentation
9
- */
10
- export const activeToast = writable();
11
- export const toastQueue = [];
12
- /**
13
- *
14
- * @param newToast
15
- */
16
- export const showComponentInToast = (newToast) => {
17
- // todo: queue component
18
- activeToast.update((currentToast) => {
19
- if (currentToast !== undefined) {
20
- toastQueue.push(newToast);
21
- return currentToast;
22
- }
23
- else {
24
- return newToast;
25
- }
26
- });
27
- };
28
- export const showTextInToast = (message) => {
29
- showComponentInToast({
30
- componentAndProps: {
31
- component: DefaultToastBody,
32
- props: {
33
- message
34
- }
35
- }
36
- });
37
- };
@@ -1,120 +0,0 @@
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
- };
78
- </script>
79
-
80
- {#if (localComponent !== undefined)}
81
- <div class="toast-positioner" style={`bottom: ${$position}lh;`}>
82
- <!-- todo: adjust shadow to be more dynamic or transparent -->
83
- <Card marginBottom="1lh"
84
- turnOnLightModeBorder={false}
85
- overrideStyle="box-shadow: 3px 3px 3px var(--shadow-color);">
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}
101
- </Card>
102
- </div>
103
- {/if}
104
-
105
- <style>
106
- .toast-positioner {
107
- position: fixed;
108
- /* 12em = this component's margin (4em) + fab margin + width (8em) */
109
- max-width: calc(100vw - 12em);
110
- z-index: 100;
111
- }
112
-
113
- .toast-positioner:dir(ltr) {
114
- left: 2em;
115
- }
116
-
117
- .toast-positioner:dir(rtl) {
118
- right: 2em;
119
- }
120
- </style>
@@ -1,3 +0,0 @@
1
- declare const Toast: import("svelte").Component<Record<string, never>, {}, "">;
2
- type Toast = ReturnType<typeof Toast>;
3
- export default Toast;
@@ -1,5 +0,0 @@
1
- import TestCustomToast from "./TestCustomToast.svelte";
2
- export interface TestCustomToastPair {
3
- component: typeof TestCustomToast;
4
- props: undefined;
5
- }
@@ -1 +0,0 @@
1
- import TestCustomToast from "./TestCustomToast.svelte";
@@ -1 +0,0 @@
1
- <h1>Testing bad custom card</h1>
@@ -1,26 +0,0 @@
1
- export default TestCustomToast;
2
- type TestCustomToast = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const TestCustomToast: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }