@turnipxenon/pineapple 2.10.0 → 3.0.0-alpha-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-check-dark-contrast.svg +1 -0
- package/dist/assets/icons/icon-check-light-contrast.svg +1 -0
- package/dist/assets/icons/icon-contrast.svg +1 -0
- package/dist/assets/icons/icon-copy-dark-contrast.svg +1 -0
- package/dist/assets/icons/icon-copy-light-contrast.svg +1 -0
- package/dist/assets/icons/icon-dark-mode.svg +1 -0
- package/dist/assets/icons/icon-light-mode.svg +1 -0
- package/dist/assets/icons/icon-settings.svg +1 -0
- package/dist/components/Card.svelte +43 -41
- package/dist/components/Card.svelte.d.ts +11 -24
- package/dist/components/CarouselElement.svelte +15 -8
- package/dist/components/CarouselElement.svelte.d.ts +7 -18
- package/dist/components/ElementVisbilityDetector.svelte +23 -14
- package/dist/components/ElementVisbilityDetector.svelte.d.ts +6 -17
- package/dist/components/LazyAsset.svelte +93 -65
- package/dist/components/LazyAsset.svelte.d.ts +9 -19
- package/dist/components/PineappleSlideToggle.svelte +28 -10
- package/dist/components/PineappleSlideToggle.svelte.d.ts +9 -19
- package/dist/components/RandomizedBackground.svelte +46 -27
- package/dist/components/RandomizedBackground.svelte.d.ts +5 -15
- package/dist/components/RandomizedImage.svelte +15 -8
- package/dist/components/RandomizedImage.svelte.d.ts +6 -16
- package/dist/components/StickyElement.svelte +25 -16
- package/dist/components/StickyElement.svelte.d.ts +6 -17
- package/dist/components/ToggleableContent.svelte +88 -59
- package/dist/components/ToggleableContent.svelte.d.ts +6 -17
- package/dist/components/blog_template/BlogTemplate.svelte +45 -25
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +9 -20
- package/dist/components/blog_template/BlogTemplateInner.svelte +11 -3
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +6 -17
- package/dist/components/chip/Chip.svelte +33 -57
- package/dist/components/chip/Chip.svelte.d.ts +7 -18
- package/dist/components/combo_box/ComboBox.svelte +10 -4
- package/dist/components/combo_box/ComboBox.svelte.d.ts +6 -16
- package/dist/components/combo_box/ComboBoxWithButton.svelte +16 -9
- package/dist/components/combo_box/ComboBoxWithButton.svelte.d.ts +7 -17
- package/dist/components/combo_box/combo-box.postcss +2 -2
- package/dist/components/dialog_manager/DialogManager.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.d.ts +0 -1
- package/dist/components/dialog_manager/DialogManagerStore.js +1 -1
- package/dist/components/dialog_overlay/DialogOverlay.svelte +42 -34
- package/dist/components/dialog_overlay/DialogOverlay.svelte.d.ts +3 -14
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/layouts/SeaweedBaseLayout.svelte +80 -43
- package/dist/components/layouts/SeaweedBaseLayout.svelte.d.ts +8 -21
- package/dist/components/navigation_component/NavigationComponent.svelte +52 -141
- package/dist/components/navigation_component/NavigationComponent.svelte.d.ts +17 -26
- package/dist/components/navigation_component/NavigationControl.svelte +52 -103
- package/dist/components/navigation_component/NavigationControl.svelte.d.ts +7 -17
- package/dist/components/overrideable_meta/OverridableMeta.svelte +37 -22
- package/dist/components/overrideable_meta/OverridableMeta.svelte.d.ts +9 -19
- package/dist/components/pineapple/PineappleBaseLayout.svelte +132 -188
- package/dist/components/pineapple/PineappleBaseLayout.svelte.d.ts +6 -17
- package/dist/components/pineapple/toast/DefaultToastBody.svelte +14 -16
- package/dist/components/pineapple/toast/DefaultToastBody.svelte.d.ts +7 -17
- package/dist/components/pineapple/toast/Toast.d.ts +0 -1
- package/dist/components/pineapple/toast/Toast.svelte +92 -64
- package/dist/components/pineapple/toast/Toast.svelte.d.ts +3 -14
- package/dist/components/pineapple/toast/custom-toast/TestCustomToast.svelte.d.ts +22 -19
- package/dist/paraglide/messages/_index.d.ts +2 -0
- package/dist/paraglide/messages/_index.js +3 -0
- package/dist/paraglide/messages/example_message.d.ts +5 -0
- package/dist/paraglide/messages/example_message.js +39 -0
- package/dist/paraglide/messages/settings.d.ts +3 -0
- package/dist/paraglide/messages/settings.js +38 -0
- package/dist/paraglide/messages.d.ts +2 -0
- package/dist/paraglide/messages.js +4 -0
- package/dist/paraglide/registry.d.ts +21 -0
- package/dist/paraglide/registry.js +31 -0
- package/dist/paraglide/runtime.d.ts +400 -0
- package/dist/paraglide/runtime.js +1060 -0
- package/dist/paraglide/server.d.ts +64 -0
- package/dist/paraglide/server.js +161 -0
- package/dist/scripts/util/FileManagement.d.ts +1 -1
- package/dist/store.d.ts +0 -1
- package/dist/styles/app.css +144 -0
- package/dist/styles/turnip-theme.css +327 -0
- package/dist/template/seaweed/CreateUrlForm.svelte +59 -41
- package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +8 -15
- package/dist/template/seaweed/SeaweedTemplate.svelte +244 -195
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +28 -25
- package/dist/template/seaweed/ToastSettings.d.ts +15 -0
- package/dist/template/seaweed/ToastSettings.js +1 -0
- package/dist/template/seaweed/entries/ChefWings.svelte +37 -39
- package/dist/template/seaweed/entries/ChefWings.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte +32 -24
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Hepcat.svelte +58 -49
- package/dist/template/seaweed/entries/Hepcat.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Pengi.svelte +51 -43
- package/dist/template/seaweed/entries/Pengi.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/Soulwork.svelte +44 -36
- package/dist/template/seaweed/entries/Soulwork.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/ThisWebpage.svelte +47 -38
- package/dist/template/seaweed/entries/ThisWebpage.svelte.d.ts +5 -15
- package/dist/template/seaweed/entries/WorkExperience.svelte +109 -92
- package/dist/template/seaweed/entries/WorkExperience.svelte.d.ts +6 -16
- package/dist/template/seaweed/entries/Workset.svelte +51 -42
- package/dist/template/seaweed/entries/Workset.svelte.d.ts +5 -15
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +169 -259
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +10 -21
- package/dist/template/seaweed/seaweed.postcss +1 -9
- package/dist/{theme.postcss → theme.css} +1 -4
- package/dist/ui/components/FourPartCard.svelte +47 -0
- package/dist/ui/components/FourPartCard.svelte.d.ts +10 -0
- package/dist/ui/components/ModalBase.svelte +75 -0
- package/dist/ui/components/ModalBase.svelte.d.ts +8 -0
- package/dist/ui/components/SocialSection.svelte +87 -0
- package/dist/ui/components/SocialSection.svelte.d.ts +9 -0
- package/dist/ui/components/index.d.ts +3 -0
- package/dist/ui/components/index.js +3 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte +87 -0
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte.d.ts +6 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte +42 -0
- package/dist/ui/components/randomized-background/RandomizedImage.svelte.d.ts +7 -0
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +65 -0
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte.d.ts +5 -0
- package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +11 -0
- package/dist/ui/elements/CodeBlock/CodeBlockProps.js +1 -0
- package/dist/ui/elements/CodeBlock/index.d.ts +2 -0
- package/dist/ui/elements/CodeBlock/index.js +2 -0
- package/dist/ui/elements/ColorScheme.d.ts +10 -0
- package/dist/ui/elements/ColorScheme.js +11 -0
- package/dist/ui/elements/GeneralUIProps.d.ts +12 -0
- package/dist/ui/elements/GeneralUIProps.js +1 -0
- package/dist/ui/elements/ImageIcon.svelte +54 -0
- package/dist/ui/elements/ImageIcon.svelte.d.ts +6 -0
- package/dist/ui/elements/OnBackground.d.ts +3 -0
- package/dist/ui/elements/OnBackground.js +4 -0
- package/dist/ui/elements/PineappleSwitch.svelte +29 -0
- package/dist/ui/elements/PineappleSwitch.svelte.d.ts +10 -0
- package/dist/ui/elements/TextLink.svelte +17 -0
- package/dist/ui/elements/TextLink.svelte.d.ts +8 -0
- package/dist/ui/elements/WrapperProps.d.ts +4 -0
- package/dist/ui/elements/WrapperProps.js +1 -0
- package/dist/ui/elements/index.d.ts +10 -0
- package/dist/ui/elements/index.js +10 -0
- package/dist/ui/elements/pinya-button/component.svelte +47 -0
- package/dist/ui/elements/pinya-button/component.svelte.d.ts +4 -0
- package/dist/ui/elements/pinya-button/index.d.ts +2 -0
- package/dist/ui/elements/pinya-button/index.js +2 -0
- package/dist/ui/elements/pinya-button/props.d.ts +13 -0
- package/dist/ui/elements/pinya-button/props.js +6 -0
- package/dist/ui/elements/pinya-card/component.svelte +21 -0
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +7 -0
- package/dist/ui/elements/pinya-card/index.d.ts +2 -0
- package/dist/ui/elements/pinya-card/index.js +2 -0
- package/dist/ui/elements/pinya-card/props.d.ts +10 -0
- package/dist/ui/elements/pinya-card/props.js +1 -0
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +35 -0
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte.d.ts +18 -0
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +18 -0
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.js +1 -0
- package/dist/ui/elements/text-chip/TextChip.svelte +15 -0
- package/dist/ui/elements/text-chip/TextChip.svelte.d.ts +4 -0
- package/dist/ui/elements/text-chip/TextChipProps.d.ts +4 -0
- package/dist/ui/elements/text-chip/TextChipProps.js +1 -0
- package/dist/ui/elements/text-chip/index.d.ts +2 -0
- package/dist/ui/elements/text-chip/index.js +2 -0
- package/dist/ui/modules/index.d.ts +2 -0
- package/dist/ui/modules/index.js +2 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +110 -0
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte.d.ts +4 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +38 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte.d.ts +3 -0
- package/dist/ui/modules/projects/Hepcat.svelte +71 -0
- package/dist/ui/modules/projects/Hepcat.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/Pengi.svelte +60 -0
- package/dist/ui/modules/projects/Pengi.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/Soulwork.svelte +55 -0
- package/dist/ui/modules/projects/Soulwork.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/ThisWebpage.svelte +62 -0
- package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/index.d.ts +4 -0
- package/dist/ui/modules/projects/index.js +4 -0
- package/dist/ui/modules/seaweed/ChumBucket.svelte +86 -0
- package/dist/ui/modules/seaweed/ChumBucket.svelte.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.d.ts +3 -0
- package/dist/ui/modules/seaweed/index.js +4 -0
- package/dist/ui/templates/PinyaBase.svelte +48 -0
- package/dist/ui/templates/PinyaBase.svelte.d.ts +7 -0
- package/dist/ui/templates/confirmation-modal/component.svelte +47 -0
- package/dist/ui/templates/confirmation-modal/component.svelte.d.ts +4 -0
- package/dist/ui/templates/confirmation-modal/index.d.ts +2 -0
- package/dist/ui/templates/confirmation-modal/index.js +2 -0
- package/dist/ui/templates/confirmation-modal/props.d.ts +10 -0
- package/dist/ui/templates/confirmation-modal/props.js +1 -0
- package/dist/ui/templates/index.d.ts +4 -0
- package/dist/ui/templates/index.js +4 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte +120 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +9 -0
- package/dist/ui/templates/pinya-page-layout/index.d.ts +2 -0
- package/dist/ui/templates/pinya-page-layout/index.js +2 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.d.ts +7 -0
- package/dist/ui/templates/pinya-page-layout/runes.svelte.js +3 -0
- package/dist/ui/templates/seaweed-layout/EntryGroup.svelte +89 -0
- package/dist/ui/templates/seaweed-layout/EntryGroup.svelte.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte +45 -0
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte.d.ts +9 -0
- package/dist/ui/templates/seaweed-layout/ProjectComponentProps.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/ProjectComponentProps.js +1 -0
- package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte +316 -0
- package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte.d.ts +14 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.md +4 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte +196 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/index.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/index.js +4 -0
- package/dist/ui/templates/seaweed-layout/props.d.ts +25 -0
- package/dist/ui/templates/seaweed-layout/props.js +1 -0
- package/dist/util/util.d.ts +1 -0
- package/dist/util/util.js +9 -0
- package/package.json +37 -20
- package/src/lib/styles/app.css +144 -0
- package/src/lib/theme.css +114 -0
- package/dist/app.postcss +0 -212
- package/dist/components/SocialSection.svelte +0 -166
- package/dist/components/SocialSection.svelte.d.ts +0 -31
- package/dist/postcss.d.ts +0 -3
- package/dist/styles/DefaultGridContainer.css +0 -61
- package/dist/template/seaweed/ChumBucket.svelte +0 -87
- package/dist/template/seaweed/ChumBucket.svelte.d.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CloseIcon from "../../../assets/icons/close.svg";
|
|
3
|
+
import UpwardIcon from "../../../assets/icons/arrow-upward.svg";
|
|
4
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
5
|
+
import { getContext, onMount } from "svelte";
|
|
6
|
+
import { PinyaCard } from "../../elements/index";
|
|
7
|
+
import PinyaCombobox from "../../elements/pinya-combobox/PinyaCombobox.svelte";
|
|
8
|
+
import { PinyaButton } from "../../elements/index.js";
|
|
9
|
+
import { type ToastContext } from "@skeletonlabs/skeleton-svelte";
|
|
10
|
+
|
|
11
|
+
export const toast: ToastContext = getContext("toast");
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
layout: ProjectGroup[];
|
|
15
|
+
orderUrl: string;
|
|
16
|
+
allEntries: SnippetMeta[];
|
|
17
|
+
group: ProjectGroup;
|
|
18
|
+
groupIndex: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
layout = $bindable(),
|
|
23
|
+
orderUrl = $bindable(),
|
|
24
|
+
allEntries,
|
|
25
|
+
group,
|
|
26
|
+
groupIndex
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
const updateOrderQuery = () => {
|
|
30
|
+
orderUrl = "order=" + layout.map(g => {
|
|
31
|
+
const groupUrl = g.entryList.map(e => e.key).join("|");
|
|
32
|
+
// the last item after : is a grid class but we're keeping it here for legacy reason
|
|
33
|
+
return `${g.title}:${groupUrl}:`;
|
|
34
|
+
}).join(",");
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const swapEntry = (index: number, group: ProjectGroup, shouldDecrement: boolean): (() => void) => {
|
|
38
|
+
return () => {
|
|
39
|
+
let newIndex = index;
|
|
40
|
+
if (shouldDecrement && index >= 1) {
|
|
41
|
+
newIndex--;
|
|
42
|
+
} else if (!shouldDecrement && index <= group.entryList.length - 2) {
|
|
43
|
+
newIndex++;
|
|
44
|
+
} else {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tempVar = group.entryList[newIndex];
|
|
49
|
+
group.entryList[newIndex] = group.entryList[index];
|
|
50
|
+
group.entryList[index] = tempVar;
|
|
51
|
+
layout = layout;
|
|
52
|
+
updateOrderQuery();
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const swapGroups = (index: number, shouldDecrement: boolean): (() => void) => {
|
|
56
|
+
return () => {
|
|
57
|
+
let newIndex = index;
|
|
58
|
+
if (shouldDecrement && index >= 1) {
|
|
59
|
+
newIndex--;
|
|
60
|
+
} else if (!shouldDecrement && index <= layout.length - 2) {
|
|
61
|
+
newIndex++;
|
|
62
|
+
} else {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const tempVar = layout[newIndex];
|
|
67
|
+
layout[newIndex] = layout[index];
|
|
68
|
+
layout[index] = tempVar;
|
|
69
|
+
layout = layout;
|
|
70
|
+
updateOrderQuery();
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const removeGroup = (group: ProjectGroup): (() => void) => {
|
|
75
|
+
return () => {
|
|
76
|
+
const index = layout.indexOf(group);
|
|
77
|
+
if (index === -1) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
layout.splice(index, 1);
|
|
82
|
+
layout = layout;
|
|
83
|
+
updateOrderQuery();
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const removeEntry = (entry: SnippetMeta, group: ProjectGroup): (() => void) => {
|
|
87
|
+
return () => {
|
|
88
|
+
for (let i = group.entryList.length - 1; i >= 0; i--) {
|
|
89
|
+
if (group.entryList[i].key === entry.key) {
|
|
90
|
+
group.entryList.splice(i, 1);
|
|
91
|
+
layout = layout;
|
|
92
|
+
updateOrderQuery();
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const comboboxData = allEntries.map(entry => {
|
|
100
|
+
return {
|
|
101
|
+
label: entry.key,
|
|
102
|
+
value: entry.key
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
let comboboxValue = $state([comboboxData[0].value]);
|
|
107
|
+
|
|
108
|
+
const addEntry = () => {
|
|
109
|
+
const c = allEntries.find(e => e.key === comboboxValue[0]);
|
|
110
|
+
|
|
111
|
+
if (!c) {
|
|
112
|
+
console.warn(`Unknown key: ${comboboxValue}`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (group.entryList.includes(c)) {
|
|
117
|
+
toast.create({
|
|
118
|
+
title: "Duplicate entry",
|
|
119
|
+
description: `The entry ${comboboxValue} is already in ${group.title}`,
|
|
120
|
+
type: "error"
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
group.entryList.push(c);
|
|
126
|
+
layout = layout;
|
|
127
|
+
updateOrderQuery();
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<PinyaCard
|
|
132
|
+
widthClass="max-w-2xl"
|
|
133
|
+
borderClass="border-[2px] border-primary-500"
|
|
134
|
+
marginClass="mt-4 mb-4"
|
|
135
|
+
paddingClass=""
|
|
136
|
+
>
|
|
137
|
+
|
|
138
|
+
<div class="m-4 flex flex-row gap-2">
|
|
139
|
+
<button title={`Remove ${group.title}`}
|
|
140
|
+
onclick={removeGroup(group)}>
|
|
141
|
+
<img class="img-icon" src={CloseIcon} alt={`Remove ${group.title}`}>
|
|
142
|
+
</button>
|
|
143
|
+
|
|
144
|
+
<button title={`Move group ${group.title} upwards`}
|
|
145
|
+
onclick={swapGroups(groupIndex, true)}
|
|
146
|
+
disabled="{groupIndex === 0}">
|
|
147
|
+
<img class="img-icon" src={UpwardIcon} alt={`Move group ${group.title} upwards`}>
|
|
148
|
+
</button>
|
|
149
|
+
|
|
150
|
+
<button title={`Move group ${group.title} downwards`}
|
|
151
|
+
disabled={groupIndex === layout.length - 1}
|
|
152
|
+
onclick={swapGroups(groupIndex, false)}>
|
|
153
|
+
<img
|
|
154
|
+
class="img-icon flipped-vertically"
|
|
155
|
+
src={UpwardIcon}
|
|
156
|
+
alt={`Move group ${group.title} downwards`}
|
|
157
|
+
>
|
|
158
|
+
</button>
|
|
159
|
+
|
|
160
|
+
<div class="fake-h3 ml-2">Group title: {group.title}</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<hr class="border-primary-500 border-1">
|
|
164
|
+
|
|
165
|
+
<table class="table">
|
|
166
|
+
<thead>
|
|
167
|
+
<tr>
|
|
168
|
+
<th class="fake-h4">Entries</th>
|
|
169
|
+
</tr>
|
|
170
|
+
</thead>
|
|
171
|
+
<tbody>
|
|
172
|
+
{#each group.entryList as entry, entryIndex (entry)}
|
|
173
|
+
<tr class="entry-row">
|
|
174
|
+
<td class="entry-data">
|
|
175
|
+
|
|
176
|
+
<button title={`Remove ${entry.key}`}
|
|
177
|
+
onclick={removeEntry(entry, group)}>
|
|
178
|
+
<img class="img-icon" src={CloseIcon} alt={`Remove ${entry.key}`}>
|
|
179
|
+
</button>
|
|
180
|
+
|
|
181
|
+
<button title={`Move ${entry.key} upwards`}
|
|
182
|
+
onclick={swapEntry(entryIndex, group, true)}
|
|
183
|
+
disabled="{entryIndex === 0}">
|
|
184
|
+
<img class="img-icon" src={UpwardIcon} alt={`Move ${entry.key} upwards`}>
|
|
185
|
+
</button>
|
|
186
|
+
|
|
187
|
+
<button title={`Move ${entry.key} downwards`}
|
|
188
|
+
disabled={entryIndex === group.key.length - 1}
|
|
189
|
+
onclick={swapEntry(entryIndex, group, false)}>
|
|
190
|
+
<img class="img-icon flipped-vertically" src={UpwardIcon} alt={`Move ${entry.key} downwards`}>
|
|
191
|
+
</button>
|
|
192
|
+
<div class="entry-name">
|
|
193
|
+
{entry.key}
|
|
194
|
+
</div>
|
|
195
|
+
</td>
|
|
196
|
+
</tr>
|
|
197
|
+
{/each}
|
|
198
|
+
</tbody>
|
|
199
|
+
|
|
200
|
+
<tfoot>
|
|
201
|
+
<tr>
|
|
202
|
+
<td class="combobox-container">
|
|
203
|
+
<PinyaButton onclick={addEntry}>Add Entry
|
|
204
|
+
</PinyaButton>
|
|
205
|
+
<PinyaCombobox
|
|
206
|
+
data={comboboxData}
|
|
207
|
+
defaultValue={comboboxValue}
|
|
208
|
+
bind:value={comboboxValue}
|
|
209
|
+
label="New entry"
|
|
210
|
+
placeholder="Add new entry"
|
|
211
|
+
contentZIndex="10"
|
|
212
|
+
/>
|
|
213
|
+
</td>
|
|
214
|
+
</tr>
|
|
215
|
+
</tfoot>
|
|
216
|
+
</table>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
</PinyaCard>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<style>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
.advanced-setting-list {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.btn-group-header {
|
|
231
|
+
@apply preset-filled-tertiary-500;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
margin-bottom: 0.5lh;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.btn-group-entry {
|
|
238
|
+
@apply ;
|
|
239
|
+
display: flex;
|
|
240
|
+
padding: 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.btn-group-entry > div {
|
|
244
|
+
padding: 1em;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.flipped-vertically {
|
|
248
|
+
transform: rotate(180deg);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.entry-group {
|
|
252
|
+
border-radius: var(--theme-rounded-container);
|
|
253
|
+
background-color: rgb(var(--color-surface-600));
|
|
254
|
+
margin-top: 1.5lh;
|
|
255
|
+
margin-bottom: 0.5lh;
|
|
256
|
+
padding: 0.5lh 0.5em;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.entry-name {
|
|
260
|
+
grow: 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
tr, td, th, table {
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
table {
|
|
268
|
+
margin-bottom: 1lh;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
tfoot > tr {
|
|
272
|
+
display: flex;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.btn-group > button {
|
|
276
|
+
padding: 0.3em 0.75em;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.btn-group-header > h2 {
|
|
280
|
+
font-weight: bolder;
|
|
281
|
+
padding-top: 1lh;
|
|
282
|
+
padding-bottom: 1lh;
|
|
283
|
+
margin-bottom: 0;
|
|
284
|
+
padding-inline-start: 1em;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.dark .btn-group-header > h2 {
|
|
288
|
+
color: rgb(var(--theme-font-color-dark));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.dark .entry-group {
|
|
292
|
+
background-color: rgb(var(--color-surface-800));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
tbody tr:nth-child(odd) {
|
|
297
|
+
background-color: var(--color-surface-100-900);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
tbody tr:nth-child(even), thead {
|
|
301
|
+
background-color: var(--color-surface-300-700);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.entry-data {
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: row;
|
|
307
|
+
gap: 1rem;
|
|
308
|
+
align-items: center;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.combobox-container {
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: row;
|
|
314
|
+
gap: 1em;
|
|
315
|
+
}
|
|
316
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
2
|
+
import { type ToastContext } from "@skeletonlabs/skeleton-svelte";
|
|
3
|
+
interface Props {
|
|
4
|
+
layout: ProjectGroup[];
|
|
5
|
+
orderUrl: string;
|
|
6
|
+
allEntries: SnippetMeta[];
|
|
7
|
+
group: ProjectGroup;
|
|
8
|
+
groupIndex: number;
|
|
9
|
+
}
|
|
10
|
+
declare const ProjectGroupConfig: import("svelte").Component<Props, {
|
|
11
|
+
toast: ToastContext;
|
|
12
|
+
}, "orderUrl" | "layout">;
|
|
13
|
+
type ProjectGroupConfig = ReturnType<typeof ProjectGroupConfig>;
|
|
14
|
+
export default ProjectGroupConfig;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SeaweedLayoutProps } from "./props";
|
|
3
|
+
import ChumBucket from "../../modules/seaweed/ChumBucket.svelte";
|
|
4
|
+
import { PinyaPageLayout } from "../index";
|
|
5
|
+
import { SocialSection } from "../../components/index";
|
|
6
|
+
import EntryGroup from "./EntryGroup.svelte";
|
|
7
|
+
import PineappleSwitch from "../../elements/PineappleSwitch.svelte";
|
|
8
|
+
import { CodeBlock, TextChip } from "../../elements/index";
|
|
9
|
+
import { SvelteMap } from "svelte/reactivity";
|
|
10
|
+
import EntryOrderConfig2 from "./EntryOrderConfig2.svelte";
|
|
11
|
+
import CreateUrlForm from "../../../template/seaweed/CreateUrlForm.svelte";
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
sideSection,
|
|
16
|
+
entryList, // todo
|
|
17
|
+
layout = $bindable(), // todo
|
|
18
|
+
domain = "http://localhost:5173/seaweed2",
|
|
19
|
+
queryTerms
|
|
20
|
+
}: SeaweedLayoutProps = $props();
|
|
21
|
+
|
|
22
|
+
let isAdvanceSettingOn = $state(true);
|
|
23
|
+
let orderUrl = $state("");
|
|
24
|
+
|
|
25
|
+
let queryStates = new SvelteMap<string, boolean>(queryTerms.map(term => [term, true]));
|
|
26
|
+
let styleStr = $state("");
|
|
27
|
+
let queryQt = $derived.by(() => {
|
|
28
|
+
const qtArr = [...queryStates.entries()
|
|
29
|
+
.filter(([, state]) => state)
|
|
30
|
+
.map(([term]) => term)
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
if (qtArr.length === queryStates.size) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const qtStr = qtArr.join(",");
|
|
38
|
+
|
|
39
|
+
if (qtStr) {
|
|
40
|
+
return `qt=${qtStr}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return "qt=clear";
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
$effect(() => {
|
|
47
|
+
const chipList: string[] = [];
|
|
48
|
+
const termList: string[] = [];
|
|
49
|
+
queryStates.entries()
|
|
50
|
+
.filter(([_, state]) => state)
|
|
51
|
+
.forEach(([term, state], idx) => {
|
|
52
|
+
const qtTerm = `.qt-${term}`;
|
|
53
|
+
termList.push(qtTerm);
|
|
54
|
+
chipList.push(`.text-chip${qtTerm}`);
|
|
55
|
+
});
|
|
56
|
+
styleStr = `<style>
|
|
57
|
+
${termList.join(", ")} {
|
|
58
|
+
font-weight: bolder;
|
|
59
|
+
color: var(--color-secondary-400);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${chipList.join(", ")} {
|
|
63
|
+
background-color: var(--color-secondary-500) /* oklch(55.6% 0 0deg) = #737373 */;
|
|
64
|
+
color: var(--color-secondary-contrast-500) /* var(--color-secondary-contrast-light) */;
|
|
65
|
+
}
|
|
66
|
+
</style>`;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
let advancedQuery = $derived.by(() => {
|
|
70
|
+
const query = [orderUrl, queryQt]
|
|
71
|
+
.filter(q => q)
|
|
72
|
+
.join("&");
|
|
73
|
+
if (query) {
|
|
74
|
+
return `${query}`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return "";
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
let advancedUrl = $derived.by(() => `${domain}/?${advancedQuery}`);
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<svelte:head>
|
|
84
|
+
{@html styleStr}
|
|
85
|
+
</svelte:head>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
{#snippet socialSection()}
|
|
89
|
+
<SocialSection></SocialSection>
|
|
90
|
+
{/snippet}
|
|
91
|
+
<PinyaPageLayout>
|
|
92
|
+
{#snippet appBarLead()}
|
|
93
|
+
<div></div>
|
|
94
|
+
{/snippet}
|
|
95
|
+
|
|
96
|
+
<div id="upper-section">
|
|
97
|
+
|
|
98
|
+
<div class="upper-section-start">
|
|
99
|
+
{@render sideSection(socialSection)}
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="upper-section-end">
|
|
103
|
+
{@render children()}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<!--todo: render list #migration-->
|
|
108
|
+
{#each layout as group (group.title)}
|
|
109
|
+
<EntryGroup {...group}></EntryGroup>
|
|
110
|
+
{/each}
|
|
111
|
+
|
|
112
|
+
{#snippet footer()}
|
|
113
|
+
<div class="footer">
|
|
114
|
+
<ChumBucket></ChumBucket>
|
|
115
|
+
|
|
116
|
+
<div class="default-card advanced-setting mt-16 mb-32">
|
|
117
|
+
<h1>Advanced settings</h1>
|
|
118
|
+
<p>This one is for those curious how I customize this page.</p>
|
|
119
|
+
|
|
120
|
+
<PineappleSwitch name="advanced-setting-slider"
|
|
121
|
+
bind:checked={isAdvanceSettingOn}>
|
|
122
|
+
</PineappleSwitch>
|
|
123
|
+
Advanced settings: {isAdvanceSettingOn ? "On" : "Off"}
|
|
124
|
+
|
|
125
|
+
{#if (isAdvanceSettingOn)}
|
|
126
|
+
|
|
127
|
+
<h3 class="mt-6">Query terms to bold</h3>
|
|
128
|
+
<div class="query-term-grid max-w-2xl">
|
|
129
|
+
{#each queryStates as [term, shouldBold] (term)}
|
|
130
|
+
<button
|
|
131
|
+
class="bg-transparent hover:brightness-110"
|
|
132
|
+
onclick={() => { queryStates.set(term, !shouldBold); }}
|
|
133
|
+
>
|
|
134
|
+
<TextChip queryClass={shouldBold ? 'highlight-chip' : ''}>
|
|
135
|
+
<!-- todo: change shouldBold -->
|
|
136
|
+
<span style={`font-weight: ${shouldBold ? "bold" : "normal"}`}>
|
|
137
|
+
{#if (shouldBold)}✓{/if}
|
|
138
|
+
{term}
|
|
139
|
+
</span>
|
|
140
|
+
</TextChip>
|
|
141
|
+
</button>
|
|
142
|
+
{/each}
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<EntryOrderConfig2
|
|
146
|
+
{layout}
|
|
147
|
+
bind:orderUrl={orderUrl}
|
|
148
|
+
allEntries={entryList}
|
|
149
|
+
></EntryOrderConfig2>
|
|
150
|
+
|
|
151
|
+
<br>
|
|
152
|
+
<p>Copy the url below and open a new page with it</p>
|
|
153
|
+
<CodeBlock code={advancedUrl} lang="markdown" classes="max-w-2xl" />
|
|
154
|
+
<CreateUrlForm queryParams={advancedQuery}></CreateUrlForm>
|
|
155
|
+
{/if}
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
{/snippet}
|
|
159
|
+
</PinyaPageLayout>
|
|
160
|
+
|
|
161
|
+
<style>
|
|
162
|
+
:global(html) {
|
|
163
|
+
--color-bg-footer: var(--color-surface-200);
|
|
164
|
+
--color-footer-border: var(--color-primary-500);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:global(html.dark) {
|
|
168
|
+
--color-bg-footer: var(--color-surface-900);
|
|
169
|
+
--color-footer-border: var(--color-primary-950);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.footer {
|
|
173
|
+
width: 100vw;
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
align-items: center;
|
|
177
|
+
margin-top: 3lh;
|
|
178
|
+
background-color: var(--color-bg-footer);
|
|
179
|
+
border-top: 2px solid var(--color-footer-border);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
#upper-section {
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-direction: row;
|
|
185
|
+
flex-wrap: wrap;
|
|
186
|
+
gap: 2rem;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.query-term-grid {
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-wrap: wrap;
|
|
193
|
+
gap: 0.25em;
|
|
194
|
+
margin-top: 1lh;
|
|
195
|
+
}
|
|
196
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
interface ProjectComponentProps {
|
|
3
|
+
}
|
|
4
|
+
type ComponentSnippet = Snippet<[ProjectComponentProps]>;
|
|
5
|
+
export interface SnippetMeta {
|
|
6
|
+
key: string;
|
|
7
|
+
component: ComponentSnippet;
|
|
8
|
+
}
|
|
9
|
+
export interface ProjectGroup {
|
|
10
|
+
key: string;
|
|
11
|
+
title: string;
|
|
12
|
+
entryList: SnippetMeta[];
|
|
13
|
+
}
|
|
14
|
+
export interface SeaweedLayoutProps {
|
|
15
|
+
name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
linkedinSlug: string;
|
|
18
|
+
domain: string;
|
|
19
|
+
sideSection: Snippet<[Snippet]>;
|
|
20
|
+
children: Snippet;
|
|
21
|
+
entryList: SnippetMeta[];
|
|
22
|
+
layout: ProjectGroup[];
|
|
23
|
+
queryTerms: string[];
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/util/util.d.ts
CHANGED
package/dist/util/util.js
CHANGED
|
@@ -25,3 +25,12 @@ export const createExternalLinkWarningFunction = (args) => {
|
|
|
25
25
|
location.href = args.href;
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
+
export const getQueryTerms = (modules) => {
|
|
29
|
+
const re = new RegExp("qt-(\\w+)+", "g");
|
|
30
|
+
const queryTerms = new Set();
|
|
31
|
+
for (const path in modules) {
|
|
32
|
+
const modStr = modules[path];
|
|
33
|
+
[...modStr.matchAll(re).map(i => i[1])].forEach(term => queryTerms.add(term));
|
|
34
|
+
}
|
|
35
|
+
return [...queryTerms].sort();
|
|
36
|
+
};
|