@turnipxenon/pineapple 3.0.0-alpha.2 → 3.0.0-alpha.20

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 (78) hide show
  1. package/dist/components/blog_template/BlogTemplate.svelte +3 -1
  2. package/dist/components/blog_template/BlogTemplate.svelte.d.ts +1 -1
  3. package/dist/components/blog_template/BlogTemplateInner.svelte +1 -1
  4. package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
  5. package/dist/components/dialog_manager/DialogManager.d.ts +2 -1
  6. package/dist/components/dialog_manager/DialogManagerStore.d.ts +0 -15
  7. package/dist/components/dialog_manager/DialogManagerStore.js +0 -15
  8. package/dist/components/dialog_manager/DialogMangerInit.d.ts +2 -0
  9. package/dist/components/dialog_manager/DialogMangerInit.js +21 -0
  10. package/dist/components/dialog_manager/IDialogManager.d.ts +39 -0
  11. package/dist/components/dialog_manager/IDialogManager.js +4 -0
  12. package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.d.ts +3 -0
  13. package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js +15 -3
  14. package/dist/components/dialog_overlay/DialogOverlay.svelte +31 -22
  15. package/dist/components/index.d.ts +1 -1
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -2
  18. package/dist/components/navigation_component/NavigationComponent.svelte +2 -1
  19. package/dist/components/navigation_component/NavigationControl.svelte +1 -1
  20. package/dist/components/pineapple/PineappleBaseLayout.svelte +3 -2
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +1 -0
  23. package/dist/styles/turnip-theme.css +64 -64
  24. package/dist/template/seaweed/SeaweedTemplate.svelte +1 -1
  25. package/dist/template/seaweed/entries/ThisWebpage.svelte +1 -1
  26. package/dist/template/seaweed/entries/WorkExperience.svelte +1 -1
  27. package/dist/ui/components/SocialSection.svelte +6 -2
  28. package/dist/ui/components/accordion/PinyaAccordion.svelte +21 -0
  29. package/dist/ui/components/accordion/PinyaAccordion.svelte.d.ts +8 -0
  30. package/dist/ui/components/accordion/PinyaAccordionItem.svelte +29 -0
  31. package/dist/ui/components/accordion/PinyaAccordionItem.svelte.d.ts +9 -0
  32. package/dist/ui/components/accordion/index.d.ts +2 -0
  33. package/dist/ui/components/accordion/index.js +2 -0
  34. package/dist/ui/components/index.d.ts +1 -0
  35. package/dist/ui/components/index.js +1 -0
  36. package/dist/{components/ElementVisbilityDetector.svelte → ui/elements/ElementVisibilityDetector.svelte} +6 -3
  37. package/dist/ui/elements/ElementVisibilityDetector.svelte.d.ts +8 -0
  38. package/dist/ui/elements/{pinya-button/component.svelte → PinyaButton/PinyaButton.svelte} +4 -3
  39. package/dist/ui/elements/PinyaButton/PinyaButton.svelte.d.ts +4 -0
  40. package/dist/ui/elements/{pinya-button/props.d.ts → PinyaButton/PinyaButtonProps.d.ts} +1 -0
  41. package/dist/ui/elements/PinyaButton/index.d.ts +2 -0
  42. package/dist/ui/elements/PinyaButton/index.js +2 -0
  43. package/dist/ui/elements/Placeholder.svelte +17 -0
  44. package/dist/ui/elements/Placeholder.svelte.d.ts +7 -0
  45. package/dist/ui/elements/index.d.ts +2 -1
  46. package/dist/ui/elements/index.js +2 -1
  47. package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +1 -0
  48. package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +7 -2
  49. package/dist/ui/modules/projects/Hepcat.svelte +5 -3
  50. package/dist/ui/modules/projects/Pengi.svelte +6 -4
  51. package/dist/ui/modules/projects/Pengi.svelte.d.ts +1 -1
  52. package/dist/ui/modules/projects/Soulwork.svelte +7 -5
  53. package/dist/ui/modules/projects/ThisWebpage.svelte +9 -8
  54. package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +1 -1
  55. package/dist/ui/modules/seaweed/ChumBucket.svelte +5 -4
  56. package/dist/ui/templates/{pinya-page-layout/component.svelte → PinyaPageLayout/PinyaPageLayout.svelte} +1 -1
  57. package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.d.ts +9 -0
  58. package/dist/ui/templates/PinyaPageLayout/index.d.ts +2 -0
  59. package/dist/ui/templates/PinyaPageLayout/index.js +2 -0
  60. package/dist/ui/templates/{pinya-page-layout → PinyaPageLayout}/runes.svelte.d.ts +1 -0
  61. package/dist/ui/templates/PinyaPageLayout/runes.svelte.js +4 -0
  62. package/dist/ui/templates/confirmation-modal/component.svelte +1 -1
  63. package/dist/ui/templates/index.d.ts +1 -1
  64. package/dist/ui/templates/index.js +1 -1
  65. package/dist/ui/templates/seaweed-layout/EntryGroup.svelte +5 -5
  66. package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte +92 -11
  67. package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte.d.ts +1 -1
  68. package/dist/ui/templates/seaweed-layout/props.d.ts +2 -0
  69. package/package.json +20 -16
  70. package/dist/components/ElementVisbilityDetector.svelte.d.ts +0 -7
  71. package/dist/ui/elements/pinya-button/component.svelte.d.ts +0 -4
  72. package/dist/ui/elements/pinya-button/index.d.ts +0 -2
  73. package/dist/ui/elements/pinya-button/index.js +0 -2
  74. package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +0 -9
  75. package/dist/ui/templates/pinya-page-layout/index.d.ts +0 -2
  76. package/dist/ui/templates/pinya-page-layout/index.js +0 -2
  77. package/dist/ui/templates/pinya-page-layout/runes.svelte.js +0 -3
  78. /package/dist/ui/elements/{pinya-button/props.js → PinyaButton/PinyaButtonProps.js} +0 -0
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ // noinspection ES6UnusedImports
3
+ import { Accordion } from "@skeletonlabs/skeleton-svelte";
4
+ import type { Snippet } from "svelte";
5
+
6
+ let {
7
+ value,
8
+ control: controlSnippet,
9
+ panel: panelSnippet,
10
+ }: {
11
+ value: string,
12
+ control: Snippet;
13
+ panel: Snippet;
14
+ } = $props();
15
+ </script>
16
+
17
+ <Accordion.Item
18
+ {value}
19
+ controlHover="hover:bg-primary-500 dark:hover:bg-secondary-600"
20
+ >
21
+ <!-- Control -->
22
+ {#snippet control()}
23
+ {@render controlSnippet()}
24
+ {/snippet}
25
+ <!-- Panel -->
26
+ {#snippet panel()}
27
+ {@render panelSnippet()}
28
+ {/snippet}
29
+ </Accordion.Item>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ value: string;
4
+ control: Snippet;
5
+ panel: Snippet;
6
+ };
7
+ declare const PinyaAccordionItem: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type PinyaAccordionItem = ReturnType<typeof PinyaAccordionItem>;
9
+ export default PinyaAccordionItem;
@@ -0,0 +1,2 @@
1
+ export { default as PinyaAccordion } from "./PinyaAccordion.svelte";
2
+ export { default as PinyaAccordionItem } from "./PinyaAccordionItem.svelte";
@@ -0,0 +1,2 @@
1
+ export { default as PinyaAccordion } from "./PinyaAccordion.svelte";
2
+ export { default as PinyaAccordionItem } from "./PinyaAccordionItem.svelte";
@@ -1,3 +1,4 @@
1
1
  export { default as ModalBase } from "./ModalBase.svelte";
2
2
  export { default as FourPartCard } from "./FourPartCard.svelte";
3
3
  export { default as SocialSection } from "./SocialSection.svelte";
4
+ export * from "./accordion";
@@ -1,3 +1,4 @@
1
1
  export { default as ModalBase } from "./ModalBase.svelte";
2
2
  export { default as FourPartCard } from "./FourPartCard.svelte";
3
3
  export { default as SocialSection } from "./SocialSection.svelte";
4
+ export * from "./accordion";
@@ -1,12 +1,15 @@
1
1
  <script lang="ts">
2
- import {onMount} from "svelte";
2
+ import { onMount, type Snippet } from "svelte";
3
3
 
4
4
  interface Props {
5
5
  isVisible?: boolean;
6
- children?: import('svelte').Snippet;
6
+ children?: Snippet;
7
7
  }
8
8
 
9
- let { isVisible = $bindable(true), children }: Props = $props();
9
+ let {
10
+ isVisible = $bindable(true),
11
+ children
12
+ }: Props = $props();
10
13
 
11
14
  let stickyElem: HTMLElement = $state();
12
15
 
@@ -0,0 +1,8 @@
1
+ import { type Snippet } from "svelte";
2
+ interface Props {
3
+ isVisible?: boolean;
4
+ children?: Snippet;
5
+ }
6
+ declare const ElementVisibilityDetector: import("svelte").Component<Props, {}, "isVisible">;
7
+ type ElementVisibilityDetector = ReturnType<typeof ElementVisibilityDetector>;
8
+ export default ElementVisibilityDetector;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import { ColorScheme } from '..';
3
- import { ButtonVariant, type PinyaButtonProps } from './props';
2
+ import { ButtonVariant, type PinyaButtonProps } from './PinyaButtonProps';
3
+ import { ColorScheme } from "../ColorScheme";
4
4
 
5
5
  let {
6
6
  children,
@@ -8,6 +8,7 @@
8
8
  paddingClass = '',
9
9
  buttonVariant = ButtonVariant.Default,
10
10
  colorClass = '',
11
+ classes = '',
11
12
  ...props
12
13
  }: PinyaButtonProps = $props();
13
14
 
@@ -41,7 +42,7 @@
41
42
  <button
42
43
  {...props}
43
44
  class:small-icon-button={buttonVariant === ButtonVariant.SmallIcon}
44
- class={`btn rounded-2xl text-xl font-bold ${tailwindClass} ${paddingClass}`}
45
+ class={`btn rounded-2xl text-xl font-bold ${tailwindClass} ${paddingClass} ${classes}`}
45
46
  >
46
47
  {@render children()}
47
48
  </button>
@@ -0,0 +1,4 @@
1
+ import { type PinyaButtonProps } from './PinyaButtonProps';
2
+ declare const PinyaButton: import("svelte").Component<PinyaButtonProps, {}, "">;
3
+ type PinyaButton = ReturnType<typeof PinyaButton>;
4
+ export default PinyaButton;
@@ -10,4 +10,5 @@ export type PinyaButtonProps = WrapperProps & HTMLButtonAttributes & GeneralUIPr
10
10
  paddingClass?: string;
11
11
  buttonVariant?: ButtonVariant;
12
12
  colorClass?: string;
13
+ classes?: string;
13
14
  };
@@ -0,0 +1,2 @@
1
+ export { default as PinyaButton } from './PinyaButton.svelte';
2
+ export * from './PinyaButtonProps';
@@ -0,0 +1,2 @@
1
+ export { default as PinyaButton } from './PinyaButton.svelte';
2
+ export * from './PinyaButtonProps';
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ let {
3
+ isCircle = false,
4
+ classes = '',
5
+ }: {
6
+ isCircle?: boolean;
7
+ classes?: string;
8
+ } = $props();
9
+ </script>
10
+
11
+ <div
12
+ class="
13
+ {isCircle ?'placeholder-circle' : 'placeholder'}
14
+ animate-pulse bg-surface-600 dark:bg-surface-800
15
+ {classes}
16
+ "
17
+ ></div>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ isCircle?: boolean;
3
+ classes?: string;
4
+ };
5
+ declare const Placeholder: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Placeholder = ReturnType<typeof Placeholder>;
7
+ export default Placeholder;
@@ -1,10 +1,11 @@
1
1
  export { default as ImageIcon } from "./ImageIcon.svelte";
2
2
  export { default as TextLink } from "./TextLink.svelte";
3
+ export { default as ElementVisibilityDetector } from "./ElementVisibilityDetector.svelte";
3
4
  export * from "./ColorScheme";
4
5
  export * from "./GeneralUIProps";
5
6
  export * from "./OnBackground";
6
7
  export * from "./pinya-card/index";
7
8
  export * from "./WrapperProps";
8
- export * from "./pinya-button/index";
9
+ export * from "./PinyaButton/index";
9
10
  export * from "./text-chip";
10
11
  export * from "./CodeBlock";
@@ -1,10 +1,11 @@
1
1
  export { default as ImageIcon } from "./ImageIcon.svelte";
2
2
  export { default as TextLink } from "./TextLink.svelte";
3
+ export { default as ElementVisibilityDetector } from "./ElementVisibilityDetector.svelte";
3
4
  export * from "./ColorScheme";
4
5
  export * from "./GeneralUIProps";
5
6
  export * from "./OnBackground";
6
7
  export * from "./pinya-card/index";
7
8
  export * from "./WrapperProps";
8
- export * from "./pinya-button/index";
9
+ export * from "./PinyaButton/index";
9
10
  export * from "./text-chip";
10
11
  export * from "./CodeBlock";
@@ -15,4 +15,5 @@ export interface PinyaComboboxProps<T extends string> {
15
15
  onValueChange?: (selectedList: ValueChangeDetails<T>) => void;
16
16
  onValueChangeBase?: (selectedList: ValueChangeDetails<T>) => void;
17
17
  contentZIndex?: string;
18
+ disabled?: boolean;
18
19
  }
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
- import { getLocale, localizeHref } from "../../../../paraglide/runtime";
2
+ import { deLocalizeHref, getLocale, localizeHref } from "../../../../paraglide/runtime";
3
3
  import PinyaCombobox from "../../../elements/pinya-combobox/PinyaCombobox.svelte";
4
+ import { appState } from "../../../templates/PinyaPageLayout/runes.svelte";
4
5
 
5
6
  interface ComboxData {
6
7
  label: string;
@@ -23,9 +24,12 @@
23
24
  const data = comboboxData.find((d) => d.value === e.value[0]);
24
25
  if (data) {
25
26
  selectedCountry = [data.value];
26
- location.href = localizeHref("./", { locale: data.value });
27
+ const pathname = deLocalizeHref(location.href);
28
+ location.href = localizeHref(pathname, { locale: data.value });
27
29
  }
28
30
  };
31
+
32
+ let disabled = $derived(!appState.isLanguagePickerAvailable);
29
33
  </script>
30
34
 
31
35
  <PinyaCombobox
@@ -35,4 +39,5 @@
35
39
  label="Select Language"
36
40
  placeholder="Select Language"
37
41
  {onValueChange}
42
+ {disabled}
38
43
  />
@@ -2,9 +2,11 @@
2
2
  import HeaderHepCat from "../../../assets/temp/header-hep-cat.mp4";
3
3
  import BitbucketIcon from "../../../assets/icons/bitbucket-icon.svg";
4
4
  import type { ProjectComponentProps } from "../../templates/seaweed-layout/ProjectComponentProps";
5
- import { FourPartCard } from "../../components/index.js";
6
- import { ButtonVariant, ImageIcon, PinyaButton } from "../../elements/index.js";
7
- import { ItchLogoHotLink } from "../../../consts.js";
5
+ import { default as FourPartCard } from "../../components/FourPartCard.svelte";
6
+ import { default as ImageIcon } from "../../elements/ImageIcon.svelte";
7
+ import { default as PinyaButton } from "../../elements/PinyaButton/PinyaButton.svelte";
8
+ import { ButtonVariant } from "../../elements/PinyaButton/PinyaButtonProps";
9
+ import { ItchLogoHotLink } from "../../../consts";
8
10
 
9
11
  const key = "Hepcat";
10
12
  export { component, key };
@@ -1,10 +1,12 @@
1
1
  <script module lang="ts">
2
2
  import HeaderPengi from "../../../assets/temp/header-pengi.mp4";
3
3
  import GithubIcon from "../../../assets/icons/github-mark.svg";
4
- import type { ProjectComponentProps } from "../../templates/index";
5
- import { FourPartCard } from "../../components/index.js";
6
- import { ButtonVariant, ImageIcon, PinyaButton } from "../../elements/index.js";
7
- import { ItchLogoHotLink } from "../../../consts.js";
4
+ import type { ProjectComponentProps } from "../../templates/seaweed-layout/ProjectComponentProps";
5
+ import { default as FourPartCard } from "../../components/FourPartCard.svelte";
6
+ import { default as ImageIcon } from "../../elements/ImageIcon.svelte";
7
+ import { default as PinyaButton } from "../../elements/PinyaButton/PinyaButton.svelte";
8
+ import { ButtonVariant } from "../../elements/PinyaButton/PinyaButtonProps";
9
+ import { ItchLogoHotLink } from "../../../consts";
8
10
 
9
11
  const key = "Pengi";
10
12
  export { component, key };
@@ -1,4 +1,4 @@
1
- import type { ProjectComponentProps } from "../../templates/index";
1
+ import type { ProjectComponentProps } from "../../templates/seaweed-layout/ProjectComponentProps";
2
2
  declare const key = "Pengi";
3
3
  export { component, key };
4
4
  declare const component: (props: ProjectComponentProps) => ReturnType<import("svelte").Snippet>;
@@ -1,10 +1,12 @@
1
1
  <script module lang="ts">
2
- import HeaderSoulwork from '../../../assets/temp/header-soulwork.mp4';
3
- import GithubIcon from '../../../assets/icons/github-mark.svg';
2
+ import HeaderSoulwork from "../../../assets/temp/header-soulwork.mp4";
3
+ import GithubIcon from "../../../assets/icons/github-mark.svg";
4
4
  import type { ProjectComponentProps } from "../../templates/index";
5
- import { FourPartCard } from "../../components/index";
6
- import { ButtonVariant, ImageIcon, PinyaButton } from "../../elements/index.js";
7
- import { ItchLogoHotLink } from "../../../consts.js";
5
+ import { default as FourPartCard } from "../../components/FourPartCard.svelte";
6
+ import { default as ImageIcon } from "../../elements/ImageIcon.svelte";
7
+ import { default as PinyaButton } from "../../elements/PinyaButton/PinyaButton.svelte";
8
+ import { ButtonVariant } from "../../elements/PinyaButton/PinyaButtonProps";
9
+ import { ItchLogoHotLink } from "../../../consts";
8
10
 
9
11
  const key = "Soulwork";
10
12
  export { component, key };
@@ -1,15 +1,16 @@
1
1
  <script module lang="ts">
2
- import GithubIcon from '../../../assets/icons/github-mark.svg';
3
- import ThisWebsiteFootage from '../../../assets/others/seaweed-showcase.mp4';
4
- import type { ProjectComponentProps } from '../../templates/seaweed-layout/ProjectComponentProps';
2
+ import GithubIcon from "../../../assets/icons/github-mark.svg";
3
+ import ThisWebsiteFootage from "../../../assets/others/seaweed-showcase.mp4";
4
+ import type { ProjectComponentProps } from "../../templates/seaweed-layout/ProjectComponentProps";
5
+ import { default as FourPartCard } from "../../components/FourPartCard.svelte";
6
+ import { default as ImageIcon } from "../../elements/ImageIcon.svelte";
7
+ import { default as PinyaButton } from "../../elements/PinyaButton/PinyaButton.svelte";
8
+ import { ButtonVariant } from "../../elements/PinyaButton/PinyaButtonProps";
9
+ import { default as TextChip } from "../../elements/text-chip/TextChip.svelte";
5
10
 
6
- const key = 'This Webpage';
11
+ const key = "This Webpage";
7
12
  export { component, key };
8
13
  </script>
9
- <script>
10
- import { FourPartCard } from "../../components/index";
11
- import { ButtonVariant, ImageIcon, PinyaButton, TextChip } from "../../elements/index.js";
12
- </script>
13
14
 
14
15
  {#snippet component(props: ProjectComponentProps)}
15
16
  <FourPartCard>
@@ -1,4 +1,4 @@
1
- import type { ProjectComponentProps } from '../../templates/seaweed-layout/ProjectComponentProps';
1
+ import type { ProjectComponentProps } from "../../templates/seaweed-layout/ProjectComponentProps";
2
2
  declare const key = "This Webpage";
3
3
  export { component, key };
4
4
  declare const component: (props: ProjectComponentProps) => ReturnType<import("svelte").Snippet>;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
- import { type PageMeta } from "../../..";
2
+ import { type PageMeta } from "../../../components/navigation_component/index";
3
3
  import { onMount } from "svelte";
4
+ import Placeholder from "../../elements/Placeholder.svelte";
4
5
 
5
6
  let hasTriedGettingChumBucket = $state(false);
6
7
  let pageMetaList: PageMeta[] = $state([]);
@@ -27,7 +28,7 @@
27
28
 
28
29
  <div class="chum-bucket-grid">
29
30
  {#if hasTriedGettingChumBucket}
30
- {#each pageMetaList as pageMeta}
31
+ {#each pageMetaList as pageMeta (pageMeta.title)}
31
32
  <div class="chum-bucket-item">
32
33
  {#if pageMeta.imageUrl}
33
34
  <img src={`https://turnipxenon.com${pageMeta.imageUrl}`}
@@ -48,8 +49,8 @@
48
49
  </div>
49
50
  {/each}
50
51
  {:else}
51
- {#each { length: 10 } as _}
52
- <div class="placeholder"></div>
52
+ {#each { length: 10 } as _, idx (idx)}
53
+ <Placeholder classes="mb-2" />
53
54
  {/each}
54
55
  {/if}
55
56
  </div>
@@ -8,7 +8,7 @@
8
8
  import { modals } from "svelte-modals";
9
9
  import GeneralSettingsModal from "../../modules/modals/general-settings/GeneralSettingsModal.svelte";
10
10
  import { localizeHref } from "../../../paraglide/runtime";
11
- import { appState } from "..";
11
+ import { appState } from "./runes.svelte";
12
12
 
13
13
  let {
14
14
  children,
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ children: Snippet;
4
+ appBarLead?: Snippet;
5
+ footer?: Snippet;
6
+ };
7
+ declare const PinyaPageLayout: import("svelte").Component<$$ComponentProps, {}, "appBarLead">;
8
+ type PinyaPageLayout = ReturnType<typeof PinyaPageLayout>;
9
+ export default PinyaPageLayout;
@@ -0,0 +1,2 @@
1
+ export { default as PinyaPageLayout } from "./PinyaPageLayout.svelte";
2
+ export * from "./runes.svelte";
@@ -0,0 +1,2 @@
1
+ export { default as PinyaPageLayout } from "./PinyaPageLayout.svelte";
2
+ export * from "./runes.svelte";
@@ -2,6 +2,7 @@ import type { Snippet } from 'svelte';
2
2
  interface AppStore {
3
3
  title: string;
4
4
  lead?: Snippet;
5
+ isLanguagePickerAvailable: boolean;
5
6
  }
6
7
  export declare const appState: AppStore;
7
8
  export {};
@@ -0,0 +1,4 @@
1
+ export const appState = $state({
2
+ title: '',
3
+ isLanguagePickerAvailable: true,
4
+ });
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { ConfirmationModalProps } from './props';
3
- import { ModalBase } from '../../components';
3
+ import { default as ModalBase } from '../../components/ModalBase.svelte';
4
4
  import { ColorScheme, PinyaButton } from '../../elements';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
1
  export { default as PinyaBase } from "./PinyaBase.svelte";
2
- export * from "./pinya-page-layout";
2
+ export * from "./PinyaPageLayout";
3
3
  export * from "./seaweed-layout";
4
4
  export * from "./confirmation-modal";
@@ -1,4 +1,4 @@
1
1
  export { default as PinyaBase } from "./PinyaBase.svelte";
2
- export * from "./pinya-page-layout";
2
+ export * from "./PinyaPageLayout";
3
3
  export * from "./seaweed-layout";
4
4
  export * from "./confirmation-modal";
@@ -7,14 +7,14 @@
7
7
  entryList
8
8
  }: ProjectGroup = $props();
9
9
 
10
- const isSpecial = entryList.length % 3 === 1;
10
+ const isSpecial = $derived(entryList.length % 3 === 1);
11
11
 
12
- let normalUiList: SnippetMeta[] = isSpecial
12
+ let normalUiList: SnippetMeta[] = $derived(isSpecial
13
13
  ? [...entryList.slice(0, -4)]
14
- : [...entryList];
15
- let overflowUiList: SnippetMeta[] = isSpecial
14
+ : [...entryList]);
15
+ let overflowUiList: SnippetMeta[] = $derived(isSpecial
16
16
  ? [...entryList.slice(-4)]
17
- : [];
17
+ : []);
18
18
 
19
19
 
20
20
  // <!--todo: implement in seaweedlayout #migration-->
@@ -1,25 +1,31 @@
1
1
  <script lang="ts">
2
- import type { SeaweedLayoutProps } from "./props";
2
+ import { fly } from "svelte/transition";
3
+ import type { ProjectGroup, SeaweedLayoutProps } from "./props";
3
4
  import ChumBucket from "../../modules/seaweed/ChumBucket.svelte";
4
- import { PinyaPageLayout } from "../index";
5
- import { SocialSection } from "../../components/index";
5
+ import { default as PinyaPageLayout } from "../PinyaPageLayout/PinyaPageLayout.svelte";
6
+ import { default as SocialSection } from "../../components/SocialSection.svelte";
6
7
  import EntryGroup from "./EntryGroup.svelte";
7
8
  import PineappleSwitch from "../../elements/PineappleSwitch.svelte";
8
9
  import { CodeBlock, TextChip } from "../../elements/index";
9
10
  import { SvelteMap } from "svelte/reactivity";
10
11
  import EntryOrderConfig2 from "./EntryOrderConfig2.svelte";
11
12
  import CreateUrlForm from "../../../template/seaweed/CreateUrlForm.svelte";
13
+ import { onMount } from "svelte";
14
+ import { page } from "$app/state";
12
15
 
13
16
  let {
14
17
  children,
15
18
  sideSection,
16
19
  entryList, // todo
17
- layout = $bindable(), // todo
20
+ layout, // todo
18
21
  domain = "http://localhost:5173/seaweed2",
19
- queryTerms
22
+ queryTerms,
23
+ showMiniSocial = false,
24
+ serverParams = ""
20
25
  }: SeaweedLayoutProps = $props();
21
26
 
22
- let isAdvanceSettingOn = $state(true);
27
+ let actualLayout = $state(layout);
28
+ let isAdvanceSettingOn = $state(false);
23
29
  let orderUrl = $state("");
24
30
 
25
31
  let queryStates = new SvelteMap<string, boolean>(queryTerms.map(term => [term, true]));
@@ -47,8 +53,8 @@
47
53
  const chipList: string[] = [];
48
54
  const termList: string[] = [];
49
55
  queryStates.entries()
50
- .filter(([_, state]) => state)
51
- .forEach(([term, state], idx) => {
56
+ .filter(([, state]) => state)
57
+ .forEach(([term]) => {
52
58
  const qtTerm = `.qt-${term}`;
53
59
  termList.push(qtTerm);
54
60
  chipList.push(`.text-chip${qtTerm}`);
@@ -78,6 +84,74 @@
78
84
  });
79
85
 
80
86
  let advancedUrl = $derived.by(() => `${domain}/?${advancedQuery}`);
87
+
88
+
89
+ /** qt values and what they mean:
90
+ * undefined: set all qt terms to font-weight: bold
91
+ * todo: implement clear
92
+ * clear: unset all terms to font-weight: normal
93
+ * <term>: only set qt-<term> to bold
94
+ * <term1>,<term2>: only set qt-<term1> and qt-<term2> to bold,
95
+ *
96
+ * ONLY CALL INSIDE onMount()
97
+ **/
98
+ const filterSearchParams = (searchParams: URLSearchParams) => {
99
+ // region Order
100
+ const orderParam = searchParams.get("order")?.trim();
101
+ console.log(searchParams);
102
+ console.log(orderParam);
103
+ if (orderParam) {
104
+ actualLayout = [];
105
+
106
+ orderParam.split(",").forEach((groupDefinition, idx) => {
107
+ const pair = groupDefinition.split(":");
108
+ if (pair.length >= 2) {
109
+ const group: ProjectGroup = {
110
+ title: pair[0],
111
+ entryList: [],
112
+ key: `${pair[0]}-${idx}`
113
+ };
114
+
115
+ pair[1].split("|").forEach(key => {
116
+ const component = entryList.find(e => e.key === key);
117
+ if (component) {
118
+ group.entryList.push(component);
119
+ }
120
+ });
121
+
122
+ actualLayout.push(group);
123
+ }
124
+ });
125
+
126
+ actualLayout = [...actualLayout];
127
+ console.log(actualLayout);
128
+ }
129
+ // endregion
130
+
131
+ // region Bold terms
132
+ const qtValue = searchParams.get("qt")?.trim();
133
+ if (qtValue !== undefined) {
134
+ queryStates.keys()
135
+ .forEach(key => queryStates.set(key, false));
136
+
137
+ if (qtValue !== "clear") {
138
+ qtValue.split(",").forEach((term) => {
139
+ if (queryStates.has(term)) {
140
+ queryStates.set(term, true);
141
+ }
142
+ });
143
+ }
144
+ }
145
+ // endregion Bold terms
146
+ };
147
+
148
+ onMount(() => {
149
+ if (serverParams) {
150
+ filterSearchParams(new URLSearchParams(serverParams));
151
+ } else if (page.url.searchParams.size) {
152
+ filterSearchParams(page.url.searchParams);
153
+ }
154
+ });
81
155
  </script>
82
156
 
83
157
  <svelte:head>
@@ -90,7 +164,14 @@
90
164
  {/snippet}
91
165
  <PinyaPageLayout>
92
166
  {#snippet appBarLead()}
93
- <div></div>
167
+ {#if showMiniSocial}
168
+ <div
169
+ class="flex flex-row"
170
+ transition:fly={{x:-10}}
171
+ >
172
+ <SocialSection isSmallVersion={true} />
173
+ </div>
174
+ {/if}
94
175
  {/snippet}
95
176
 
96
177
  <div id="upper-section">
@@ -105,7 +186,7 @@
105
186
  </div>
106
187
 
107
188
  <!--todo: render list #migration-->
108
- {#each layout as group (group.title)}
189
+ {#each actualLayout as group (group.title)}
109
190
  <EntryGroup {...group}></EntryGroup>
110
191
  {/each}
111
192
 
@@ -143,7 +224,7 @@
143
224
  </div>
144
225
 
145
226
  <EntryOrderConfig2
146
- {layout}
227
+ bind:layout={actualLayout}
147
228
  bind:orderUrl={orderUrl}
148
229
  allEntries={entryList}
149
230
  ></EntryOrderConfig2>
@@ -1,4 +1,4 @@
1
1
  import type { SeaweedLayoutProps } from "./props";
2
- declare const SeaweedLayout: import("svelte").Component<SeaweedLayoutProps, {}, "layout">;
2
+ declare const SeaweedLayout: import("svelte").Component<SeaweedLayoutProps, {}, "">;
3
3
  type SeaweedLayout = ReturnType<typeof SeaweedLayout>;
4
4
  export default SeaweedLayout;
@@ -21,5 +21,7 @@ export interface SeaweedLayoutProps {
21
21
  entryList: SnippetMeta[];
22
22
  layout: ProjectGroup[];
23
23
  queryTerms: string[];
24
+ showMiniSocial?: boolean;
25
+ serverParams?: string;
24
26
  }
25
27
  export {};