@turnipxenon/pineapple 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (112) hide show
  1. package/dist/assets/icons/icon-check-dark-contrast.svg +1 -0
  2. package/dist/assets/icons/icon-check-light-contrast.svg +1 -0
  3. package/dist/assets/icons/icon-copy-dark-contrast.svg +1 -0
  4. package/dist/assets/icons/icon-copy-light-contrast.svg +1 -0
  5. package/dist/components/PineappleSlideToggle.svelte +12 -6
  6. package/dist/components/PineappleSlideToggle.svelte.d.ts +3 -2
  7. package/dist/components/blog_template/BlogTemplate.svelte +3 -1
  8. package/dist/components/blog_template/BlogTemplate.svelte.d.ts +1 -1
  9. package/dist/components/blog_template/BlogTemplateInner.svelte +1 -1
  10. package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
  11. package/dist/components/dialog_manager/DialogManagerStore.d.ts +0 -15
  12. package/dist/components/dialog_manager/DialogManagerStore.js +0 -15
  13. package/dist/components/dialog_manager/DialogMangerInit.d.ts +15 -0
  14. package/dist/components/dialog_manager/DialogMangerInit.js +15 -0
  15. package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js +1 -1
  16. package/dist/components/dialog_overlay/DialogOverlay.svelte +1 -1
  17. package/dist/components/index.d.ts +1 -1
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -2
  20. package/dist/components/navigation_component/NavigationComponent.svelte +2 -1
  21. package/dist/components/navigation_component/NavigationControl.svelte +1 -1
  22. package/dist/components/pineapple/PineappleBaseLayout.svelte +2 -1
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +1 -0
  25. package/dist/styles/app.css +92 -1
  26. package/dist/styles/turnip-theme.css +65 -61
  27. package/dist/template/seaweed/CreateUrlForm.svelte +17 -11
  28. package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +4 -1
  29. package/dist/template/seaweed/ToastSettings.d.ts +15 -0
  30. package/dist/template/seaweed/ToastSettings.js +1 -0
  31. package/dist/template/seaweed/entries/ThisWebpage.svelte +1 -1
  32. package/dist/template/seaweed/entries/WorkExperience.svelte +1 -1
  33. package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +34 -1
  34. package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +0 -1
  35. package/dist/ui/components/SocialSection.svelte +4 -1
  36. package/dist/ui/components/accordion/PinyaAccordion.svelte +21 -0
  37. package/dist/ui/components/accordion/PinyaAccordion.svelte.d.ts +8 -0
  38. package/dist/ui/components/accordion/PinyaAccordionItem.svelte +29 -0
  39. package/dist/ui/components/accordion/PinyaAccordionItem.svelte.d.ts +9 -0
  40. package/dist/ui/components/accordion/index.d.ts +2 -0
  41. package/dist/ui/components/accordion/index.js +2 -0
  42. package/dist/ui/components/index.d.ts +1 -0
  43. package/dist/ui/components/index.js +1 -0
  44. package/dist/ui/elements/CodeBlock/CodeBlock.svelte +65 -0
  45. package/dist/ui/elements/CodeBlock/CodeBlock.svelte.d.ts +5 -0
  46. package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +11 -0
  47. package/dist/ui/elements/CodeBlock/CodeBlockProps.js +1 -0
  48. package/dist/ui/elements/CodeBlock/index.d.ts +2 -0
  49. package/dist/ui/elements/CodeBlock/index.js +2 -0
  50. package/dist/{components/ElementVisbilityDetector.svelte → ui/elements/ElementVisibilityDetector.svelte} +6 -3
  51. package/dist/ui/elements/ElementVisibilityDetector.svelte.d.ts +8 -0
  52. package/dist/ui/elements/PineappleSwitch.svelte +29 -0
  53. package/dist/ui/elements/PineappleSwitch.svelte.d.ts +10 -0
  54. package/dist/ui/elements/Placeholder.svelte +17 -0
  55. package/dist/ui/elements/Placeholder.svelte.d.ts +7 -0
  56. package/dist/ui/elements/index.d.ts +11 -8
  57. package/dist/ui/elements/index.js +11 -8
  58. package/dist/ui/elements/pinya-button/component.svelte +2 -1
  59. package/dist/ui/elements/pinya-button/props.d.ts +1 -0
  60. package/dist/ui/elements/pinya-card/component.svelte +10 -8
  61. package/dist/ui/elements/pinya-card/component.svelte.d.ts +3 -3
  62. package/dist/ui/elements/pinya-card/props.d.ts +3 -0
  63. package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +35 -0
  64. package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte.d.ts +18 -0
  65. package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +18 -0
  66. package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.js +1 -0
  67. package/dist/ui/elements/text-chip/TextChip.svelte +15 -0
  68. package/dist/ui/elements/text-chip/TextChip.svelte.d.ts +4 -0
  69. package/dist/ui/elements/text-chip/TextChipProps.d.ts +4 -0
  70. package/dist/ui/elements/text-chip/TextChipProps.js +1 -0
  71. package/dist/ui/elements/text-chip/index.d.ts +2 -0
  72. package/dist/ui/elements/text-chip/index.js +2 -0
  73. package/dist/ui/modules/index.d.ts +2 -1
  74. package/dist/ui/modules/index.js +2 -1
  75. package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +10 -20
  76. package/dist/ui/modules/projects/Hepcat.svelte +71 -0
  77. package/dist/ui/modules/projects/Hepcat.svelte.d.ts +22 -0
  78. package/dist/ui/modules/projects/Pengi.svelte +60 -0
  79. package/dist/ui/modules/projects/Pengi.svelte.d.ts +22 -0
  80. package/dist/ui/modules/projects/Soulwork.svelte +55 -0
  81. package/dist/ui/modules/projects/Soulwork.svelte.d.ts +22 -0
  82. package/dist/ui/modules/projects/ThisWebpage.svelte +62 -0
  83. package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +22 -0
  84. package/dist/ui/modules/projects/index.d.ts +4 -0
  85. package/dist/ui/modules/projects/index.js +4 -0
  86. package/dist/ui/modules/seaweed/ChumBucket.svelte +38 -38
  87. package/dist/ui/templates/PinyaBase.svelte +9 -6
  88. package/dist/ui/templates/PinyaBase.svelte.d.ts +1 -1
  89. package/dist/ui/templates/index.d.ts +3 -2
  90. package/dist/ui/templates/index.js +3 -2
  91. package/dist/ui/templates/pinya-page-layout/component.svelte +17 -10
  92. package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +2 -1
  93. package/dist/ui/templates/seaweed-layout/EntryGroup.svelte +89 -0
  94. package/dist/ui/templates/seaweed-layout/EntryGroup.svelte.d.ts +4 -0
  95. package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte +45 -0
  96. package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte.d.ts +9 -0
  97. package/dist/ui/templates/seaweed-layout/ProjectComponentProps.d.ts +4 -0
  98. package/dist/ui/templates/seaweed-layout/ProjectComponentProps.js +1 -0
  99. package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte +316 -0
  100. package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte.d.ts +14 -0
  101. package/dist/ui/templates/seaweed-layout/SeaweedLayout.md +4 -0
  102. package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte +277 -0
  103. package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte.d.ts +4 -0
  104. package/dist/ui/templates/seaweed-layout/index.d.ts +4 -0
  105. package/dist/ui/templates/seaweed-layout/index.js +4 -0
  106. package/dist/ui/templates/seaweed-layout/props.d.ts +27 -0
  107. package/dist/ui/templates/seaweed-layout/props.js +1 -0
  108. package/dist/util/util.d.ts +1 -0
  109. package/dist/util/util.js +9 -0
  110. package/package.json +20 -15
  111. package/src/lib/styles/app.css +92 -1
  112. package/dist/components/ElementVisbilityDetector.svelte.d.ts +0 -7
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFDF6"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#4C473B"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFDF6"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#4C473B"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"/></svg>
@@ -1,24 +1,30 @@
1
1
  <script lang="ts">
2
2
 
3
3
  import { Switch } from "@skeletonlabs/skeleton-svelte";
4
+ import type { Snippet } from "svelte";
5
+
4
6
  interface Props {
5
7
  checked?: boolean;
6
8
  name: string;
7
- onChange?: undefined | (() => void);
8
- children?: import('svelte').Snippet;
9
+ onChange?: (() => void);
10
+ children?: Snippet;
9
11
  }
10
12
 
11
13
  let {
12
14
  checked = $bindable(false),
13
15
  name,
14
16
  onChange = undefined,
15
- children
17
+ children = undefined,
16
18
  }: Props = $props();
17
19
  </script>
18
20
 
19
21
  <Switch name={name}
20
- background="bg-surface-700 dark:bg-surface-700"
21
- bind:checked={checked}
22
- on:change={onChange}>
22
+ controlBase="bg-red-500"
23
+ checked={checked}
24
+ onCheckedChange={(e) => {
25
+ checked = e.checked;
26
+ onChange?.();
27
+ }}
28
+ >
23
29
  {@render children?.()}
24
30
  </Switch>
@@ -1,8 +1,9 @@
1
+ import type { Snippet } from "svelte";
1
2
  interface Props {
2
3
  checked?: boolean;
3
4
  name: string;
4
- onChange?: undefined | (() => void);
5
- children?: import('svelte').Snippet;
5
+ onChange?: (() => void);
6
+ children?: Snippet;
6
7
  }
7
8
  declare const PineappleSlideToggle: import("svelte").Component<Props, {}, "checked">;
8
9
  type PineappleSlideToggle = ReturnType<typeof PineappleSlideToggle>;
@@ -1,9 +1,11 @@
1
1
  <script lang="ts">
2
- import { Card, enableDialogueOverlay, type SimplePageMeta } from "../..";
3
2
  import "./blog-template.css";
4
3
  import { enableBackground } from "../../store";
5
4
  import { onDestroy, onMount } from "svelte";
6
5
  import BlogTemplateInner from "./BlogTemplateInner.svelte";
6
+ import type { SimplePageMeta } from "../navigation_component/index";
7
+ import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
8
+ import { Card } from "../index";
7
9
 
8
10
  // grab page meta from the adjacent meta.json
9
11
  interface Props {
@@ -1,5 +1,5 @@
1
- import { type SimplePageMeta } from "../..";
2
1
  import "./blog-template.css";
2
+ import type { SimplePageMeta } from "../navigation_component/index";
3
3
  interface Props {
4
4
  pageMeta: SimplePageMeta;
5
5
  shouldFillWholePage?: boolean;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { SimplePageMeta } from "../..";
2
+ import type { SimplePageMeta } from "../navigation_component/index";
3
3
 
4
4
  interface Props {
5
5
  pageMeta: SimplePageMeta;
@@ -1,4 +1,4 @@
1
- import type { SimplePageMeta } from "../..";
1
+ import type { SimplePageMeta } from "../navigation_component/index";
2
2
  interface Props {
3
3
  pageMeta: SimplePageMeta;
4
4
  children?: import('svelte').Snippet;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import type { DialogMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
6
6
  import type { DialogDetail } from "../../types/pineapple_fiber/DialogDetail";
7
- import { DialogManager } from "./DialogManager";
8
7
  /**
9
8
  * Enables the dialogue overlay
10
9
  *
@@ -24,17 +23,3 @@ export declare const enableDialogueOverlay: import("svelte/store").Writable<bool
24
23
  export declare const dialogVariableStore: DialogMapStore;
25
24
  export declare const updateRate: number;
26
25
  export declare const defaultDialogMessage: DialogDetail[];
27
- /**
28
- * strictly must be declared last! or you might receive a weird error that looks like:
29
- *
30
- * 2:04:21 AM [vite] Error when evaluating SSR module /src/lib/components/dialog_manager/DialogManagerStore.ts:
31
- * |- TypeError: Cannot read properties of undefined (reading '0')
32
- * at <instance_members_initializer> (/src/lib/components/dialog_manager/DialogManager.ts:38:67)
33
- * at new DialogManager (/src/lib/components/dialog_manager/DialogManager.ts:53:14)
34
- * at eval (/src/lib/components/dialog_manager/DialogManagerStore.ts:15:23)
35
- * at async instantiateModule (file:///C:/Users/Pumpkin/Projects/Web/pineapple/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:54360:9)
36
- *
37
- * what this means is that one member of dialogManager cannot be initialized. in our case, it was the
38
- * defaultDialogMessage not yet being initialized
39
- */
40
- export declare const dialogManager: DialogManager;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { createNewMapStore } from "../../types/pineapple_fiber/DialogVariableStore";
6
6
  import { writable } from "svelte/store";
7
- import { DialogManager } from "./DialogManager";
8
7
  /**
9
8
  * Enables the dialogue overlay
10
9
  *
@@ -29,17 +28,3 @@ export const defaultDialogMessage = [
29
28
  textContent: `<p>I don't really have anything to say. Have you drank water? Or perhaps, you've checked out <a target="_blank" class="external-link" href="http://crouton.net">one of the best webpages</a> out there?`
30
29
  }
31
30
  ];
32
- /**
33
- * strictly must be declared last! or you might receive a weird error that looks like:
34
- *
35
- * 2:04:21 AM [vite] Error when evaluating SSR module /src/lib/components/dialog_manager/DialogManagerStore.ts:
36
- * |- TypeError: Cannot read properties of undefined (reading '0')
37
- * at <instance_members_initializer> (/src/lib/components/dialog_manager/DialogManager.ts:38:67)
38
- * at new DialogManager (/src/lib/components/dialog_manager/DialogManager.ts:53:14)
39
- * at eval (/src/lib/components/dialog_manager/DialogManagerStore.ts:15:23)
40
- * at async instantiateModule (file:///C:/Users/Pumpkin/Projects/Web/pineapple/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:54360:9)
41
- *
42
- * what this means is that one member of dialogManager cannot be initialized. in our case, it was the
43
- * defaultDialogMessage not yet being initialized
44
- */
45
- export const dialogManager = new DialogManager();
@@ -0,0 +1,15 @@
1
+ import { DialogManager } from "./DialogManager";
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;
@@ -0,0 +1,15 @@
1
+ import { DialogManager } from "./DialogManager";
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 const dialogManager = new DialogManager();
@@ -1,7 +1,7 @@
1
1
  import { BehaviorStatus } from "../../core/BehaviorStatus";
2
2
  import { SetVariableNode } from "../SetVariableNode";
3
- import { dialogManager } from "../../../DialogManagerStore";
4
3
  import { btreeUtils } from "../../core/BTreeUtils";
4
+ import { dialogManager } from "../../../DialogMangerInit";
5
5
  export class JumpCommand {
6
6
  setVariableNode = new SetVariableNode();
7
7
  process(nodeArgs) {
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
2
  import AresHappy from "../../assets/characters/ares/ares_happy.webp";
3
3
  import { onMount } from "svelte";
4
- import { dialogManager } from "../dialog_manager/DialogManagerStore";
5
4
  import { DialogState } from "../../types/pineapple_fiber/DialogState";
5
+ import { dialogManager } from "../dialog_manager/DialogMangerInit";
6
6
 
7
7
  let currentMessage = $state("");
8
8
  dialogManager.currentMessage.subscribe((value) => {
@@ -3,6 +3,6 @@ export { default as Card } from "./Card.svelte";
3
3
  export { default as Chip } from "./chip/Chip.svelte";
4
4
  export { default as PineappleSlideToggle } from "./PineappleSlideToggle.svelte";
5
5
  export { default as SocialSection } from "../ui/components/SocialSection.svelte";
6
- export { default as ElementVisbilityDetector } from "./ElementVisbilityDetector.svelte";
6
+ export { default as ElementVisibilityDetector } from "../ui/elements/ElementVisibilityDetector.svelte";
7
7
  export { default as BlogTemplate } from "./blog_template/BlogTemplate.svelte";
8
8
  export { default as DialogOverlay } from "./dialog_overlay/DialogOverlay.svelte";
@@ -4,6 +4,6 @@ export { default as Card } from "./Card.svelte";
4
4
  export { default as Chip } from "./chip/Chip.svelte";
5
5
  export { default as PineappleSlideToggle } from "./PineappleSlideToggle.svelte";
6
6
  export { default as SocialSection } from "../ui/components/SocialSection.svelte";
7
- export { default as ElementVisbilityDetector } from "./ElementVisbilityDetector.svelte";
7
+ export { default as ElementVisibilityDetector } from "../ui/elements/ElementVisibilityDetector.svelte";
8
8
  export { default as BlogTemplate } from "./blog_template/BlogTemplate.svelte";
9
9
  export { default as DialogOverlay } from "./dialog_overlay/DialogOverlay.svelte";
@@ -27,8 +27,6 @@
27
27
  children
28
28
  }: Props = $props();
29
29
 
30
- $inspect("inside: should display:", shouldDisplayLeadingIcons, !!extraLeadingIcons);
31
-
32
30
  $effect(() => {
33
31
  if (extraLeadingIcons && shouldDisplayLeadingIcons) {
34
32
  appState.lead = extraLeadingIcons;
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
2
  import NavigationControl from "./NavigationControl.svelte";
3
- import { Card, createGoToFunction } from "../..";
4
3
  import { parsePageMeta, type ParsePageMetaCompareFn } from "./PageMeta";
4
+ import { Card } from "../index";
5
+ import { createGoToFunction } from "../../util/util";
5
6
 
6
7
 
7
8
 
@@ -2,7 +2,7 @@
2
2
  import { onMount } from "svelte";
3
3
  import { page } from "$app/state";
4
4
 
5
- import { Card } from "../..";
5
+ import { Card } from "../index";
6
6
  import { goto } from "$app/navigation";
7
7
 
8
8
  interface Props {
@@ -16,10 +16,11 @@
16
16
  import AresLogo from "../../assets/characters/ares/ares_logo.webp";
17
17
  import FABIcon from "../../assets/bg_tiled/bg_tiled_turnip.png";
18
18
  import CloseIcon from "../../assets/icons/close.svg";
19
- import { dialogManager, enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
19
+ import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
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 { dialogManager } from "../dialog_manager/DialogMangerInit";
23
24
 
24
25
  interface Props {
25
26
  showDialogByDefault?: boolean;
package/dist/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from "./types/pineapple_fiber/DialogDetail";
11
11
  export * from "./util/util";
12
12
  export * from "./api/index";
13
13
  export * from "./template/seaweed/index";
14
+ export { dialogManager } from "./components/dialog_manager/DialogMangerInit";
package/dist/index.js CHANGED
@@ -12,3 +12,4 @@ export * from "./types/pineapple_fiber/DialogDetail";
12
12
  export * from "./util/util";
13
13
  export * from "./api/index";
14
14
  export * from "./template/seaweed/index";
15
+ export { dialogManager } from "./components/dialog_manager/DialogMangerInit";
@@ -4,7 +4,7 @@
4
4
  @import "@skeletonlabs/skeleton/themes/crimson";
5
5
  @import "./turnip-theme.css";
6
6
 
7
- @source "../node_modules/@skeletonlabs/skeleton-svelte/dist";
7
+ @source "../../../node_modules/@skeletonlabs/skeleton-svelte/dist";
8
8
 
9
9
  @custom-variant dark (&:where(.dark, .dark *));
10
10
 
@@ -51,3 +51,94 @@ a.external-link {
51
51
  --tw-ring-color: rgb(var(--color-text-400));
52
52
  /*background-color: red;*/
53
53
  }
54
+
55
+ @layer base {
56
+ .game-link-section {
57
+ @apply mt-6 flex gap-2 justify-center;
58
+ }
59
+
60
+ .game-video-cover {
61
+ @apply rounded-t-lg max-h-64 object-cover w-full;
62
+ }
63
+
64
+ .text-chip-container {
65
+ display: flex;
66
+ flex-wrap: wrap;
67
+ gap: 0.5rem;
68
+ }
69
+
70
+ .text-chip {
71
+ background-color: var(--color-secondary-50-950) /* light-dark(var(--color-secondary-50), var(--color-secondary-950)) */;
72
+ color: var(--color-secondary-950-50) /* light-dark(var(--color-secondary-950), var(--color-secondary-50)) */;
73
+ }
74
+ }
75
+
76
+ /*https://shiki.style/guide/dual-themes*/
77
+ html.dark .shiki,
78
+ html.dark .shiki span {
79
+ color: var(--shiki-dark) !important;
80
+ background-color: var(--shiki-dark-bg) !important;
81
+ /* Optional, if you also want font styles */
82
+ font-style: var(--shiki-dark-font-style) !important;
83
+ font-weight: var(--shiki-dark-font-weight) !important;
84
+ text-decoration: var(--shiki-dark-text-decoration) !important;
85
+ }
86
+
87
+ .shiki {
88
+ span {
89
+ white-space: pre-wrap;
90
+ word-wrap: break-word;
91
+ }
92
+ }
93
+
94
+ /* region shiki copy button */
95
+ pre:has(code) {
96
+ position: relative;
97
+ }
98
+
99
+ pre button.copy {
100
+ position: absolute;
101
+ right: 16px;
102
+ top: 16px;
103
+ height: 28px;
104
+ width: 28px;
105
+ padding: 0;
106
+ display: flex;
107
+
108
+ & span {
109
+ width: 100%;
110
+ aspect-ratio: 1 / 1;
111
+ background-repeat: no-repeat;
112
+ background-position: center;
113
+ background-size: cover;
114
+ }
115
+
116
+ & .ready {
117
+ background-image: url("$pkg/assets/icons/icon-copy-light-contrast.svg");
118
+
119
+ @variant dark {
120
+ background-image: url("$pkg/assets/icons/icon-copy-dark-contrast.svg");
121
+ }
122
+ }
123
+
124
+ & .success {
125
+ display: none;
126
+ background-image: url("$pkg/assets/icons/icon-check-light-contrast.svg");
127
+
128
+ @variant dark {
129
+ background-image: url("$pkg/assets/icons/icon-check-dark-contrast.svg");
130
+ }
131
+ }
132
+
133
+ &.copied {
134
+ & .success {
135
+ display: block;
136
+ }
137
+
138
+ & .ready {
139
+ display: none;
140
+ }
141
+ }
142
+ }
143
+
144
+ /* endregion shiki copy button */
@@ -237,85 +237,89 @@ html.dark {
237
237
  @variant dark {
238
238
  color: var(--color-surface-950);
239
239
  }
240
+ /* endregion components */
241
+ }
242
+ }
240
243
 
241
- blockquote {
242
- @apply mb-4;
243
- font-style: italic;
244
- border: 0;
245
- text-align: center;
246
- filter: brightness(140%);
247
- }
248
244
 
249
- h1, h2, h3, h4, h5, h6, .fake-h2, .fake-h3 {
250
- text-align: center;
251
- margin-top: 0;
252
- font-weight: bolder;
253
- color: var(--color-primary-900);
245
+ blockquote {
246
+ @apply mb-4;
247
+ font-style: italic;
248
+ border: 0;
249
+ text-align: center;
250
+ filter: brightness(140%);
251
+ }
254
252
 
255
- @variant dark {
256
- color: var(--color-primary-100);
257
- }
258
- }
253
+ h1, h2, h3, h4, h5, h6, .fake-h2, .fake-h3, .fake-h4 {
254
+ text-align: center;
255
+ margin-top: 0;
256
+ font-weight: bolder;
257
+ color: var(--color-primary-900);
259
258
 
260
- h1 {
261
- @apply text-4xl;
262
- }
259
+ @variant dark {
260
+ color: var(--color-primary-100);
261
+ }
262
+ }
263
263
 
264
- h2, .fake-h2 {
265
- @apply text-3xl;
266
- }
264
+ h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p, .fake-h2 + p, .fake-h3 + p, .fake-h4 + p {
265
+ margin-top: 0.5lh;
266
+ }
267
267
 
268
- h3, .fake-h3 {
269
- @apply text-2xl;
270
- }
268
+ h1 {
269
+ @apply text-4xl;
270
+ }
271
271
 
272
- h4 {
273
- @apply text-xl;
274
- }
272
+ h2, .fake-h2 {
273
+ @apply text-3xl;
274
+ }
275
275
 
276
- h5 {
277
- @apply text-lg;
278
- }
276
+ h3, .fake-h3 {
277
+ @apply text-2xl;
278
+ }
279
279
 
280
- h6 {
281
- text-decoration: underline;
282
- }
280
+ h4, .fake-h4 {
281
+ @apply text-xl;
282
+ }
283
283
 
284
- a {
285
- text-decoration: underline;
286
- color: var(--color-secondary-500);
284
+ h5 {
285
+ @apply text-lg;
286
+ }
287
287
 
288
- @variant dark {
289
- color: var(--color-secondary-300);
290
- }
291
- }
288
+ h6 {
289
+ text-decoration: underline;
290
+ }
292
291
 
293
- a:hover, a:focus {
294
- filter: brightness(150%);
295
- }
292
+ a {
293
+ text-decoration: underline;
294
+ color: var(--color-secondary-500);
296
295
 
297
- a:visited {
298
- color: var(--color-secondary-950);
296
+ @variant dark {
297
+ color: var(--color-secondary-300);
298
+ }
299
+ }
299
300
 
300
- @variant dark {
301
- color: var(--color-secondary-200);
302
- }
303
- }
301
+ a:hover, a:focus {
302
+ filter: brightness(150%);
303
+ }
304
304
 
305
- ul {
306
- list-style: inside;
307
- }
305
+ a:visited {
306
+ color: var(--color-secondary-950);
308
307
 
309
- ol {
310
- list-style: decimal inside;
311
- }
308
+ @variant dark {
309
+ color: var(--color-secondary-200);
310
+ }
311
+ }
312
312
 
313
- p{
314
- @apply mb-3;
315
- }
313
+ ul {
314
+ list-style: inside;
315
+ }
316
316
 
317
- /* endregion components */
318
- }
317
+ ol {
318
+ list-style: decimal inside;
319
+ }
320
+
321
+ p{
322
+ @apply mb-3;
319
323
  }
320
324
 
321
325
  @theme {
@@ -1,6 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { type CreateUrlRequest, CreateUrlResult, jsonToCreateUrlResponse } from "../../types/api/CreateUrl";
3
- import { type ToastSettings } from "@skeletonlabs/skeleton-svelte";
3
+ import type { ToastContext } from "@skeletonlabs/skeleton-svelte";
4
+ import { getContext } from "svelte";
5
+ import type { ToastSettings } from "./ToastSettings";
6
+ import { PinyaButton } from "../../ui/elements/index";
7
+
8
+ export const toast: ToastContext = getContext("toast");
9
+
4
10
 
5
11
  interface Props {
6
12
  queryParams?: string;
@@ -8,8 +14,6 @@
8
14
 
9
15
  let { queryParams = "" }: Props = $props();
10
16
 
11
- const toastStore = getToastStore();
12
-
13
17
  let request: CreateUrlRequest = $state({
14
18
  queryParams: "",
15
19
  shortUrl: "",
@@ -22,14 +26,15 @@
22
26
 
23
27
 
24
28
  const failToast: ToastSettings = {
25
- message: "Adding new url failed"
29
+ title: "Adding new url failed",
30
+ type: "error"
26
31
  };
27
32
  const toastMap = new Map<CreateUrlResult, ToastSettings>([
28
33
  [CreateUrlResult.Success, {
29
- message: "Successfully added new url"
34
+ title: "Successfully added new url"
30
35
  }],
31
36
  [CreateUrlResult.Duplicate, {
32
- message: "Short url already used; try again with another url"
37
+ title: "Short url already used; try again with another url"
33
38
  }],
34
39
  [CreateUrlResult.Fail, failToast]
35
40
  ]);
@@ -44,7 +49,7 @@
44
49
  resp.json()
45
50
  ).then(json => {
46
51
  const properResp = jsonToCreateUrlResponse(json);
47
- toastStore.trigger(toastMap.get(properResp.result) ?? failToast);
52
+ toast.create(toastMap.get(properResp.result) ?? failToast);
48
53
  });
49
54
  };
50
55
  </script>
@@ -53,23 +58,24 @@
53
58
  <label for="short-url">Short URL for url shortener</label>
54
59
  <input bind:value={request.shortUrl}
55
60
  name="short-url"
56
- class="input"
61
+ class="input border-[2px] border-primary-500"
57
62
  type="text"
58
63
  placeholder="short-url" />
59
64
  <label for="password">Password</label>
60
65
  <input bind:value={request.password}
61
66
  name="password"
62
- class="input"
67
+ class="input border-[2px] border-primary-500"
63
68
  type="password"
64
69
  placeholder="ILoveTurnips" />
65
- <button class="send-link btn preset-filled" onclick={post}>Send link</button>
70
+ <PinyaButton onclick={post}>Send link</PinyaButton>
66
71
  </div>
67
72
 
68
73
  <style>
69
74
  .local-list {
70
75
  display: flex;
71
76
  flex-direction: column;
72
- gap: 0.25lh;
77
+ gap: 0.5lh;
78
+ margin-top: 1lh;
73
79
  }
74
80
 
75
81
  .send-link {
@@ -1,6 +1,9 @@
1
+ import type { ToastContext } from "@skeletonlabs/skeleton-svelte";
1
2
  interface Props {
2
3
  queryParams?: string;
3
4
  }
4
- declare const CreateUrlForm: import("svelte").Component<Props, {}, "">;
5
+ declare const CreateUrlForm: import("svelte").Component<Props, {
6
+ toast: ToastContext;
7
+ }, "">;
5
8
  type CreateUrlForm = ReturnType<typeof CreateUrlForm>;
6
9
  export default CreateUrlForm;
@@ -0,0 +1,15 @@
1
+ export interface ToastSettings {
2
+ /** The unique toast ID. */
3
+ id?: string;
4
+ /** The unique toast title text. */
5
+ title?: string;
6
+ /** The unique toast description text. */
7
+ description?: string;
8
+ /**
9
+ * Define the toast type.
10
+ * @default info
11
+ */
12
+ type?: "info" | "error" | "success";
13
+ /** The duration of the toast. Default varies by type. */
14
+ duration?: number;
15
+ }
@@ -0,0 +1 @@
1
+ export {};