@turnipxenon/pineapple 3.0.0-alpha.9 → 3.1.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.
- package/dist/components/blog_template/BlogTemplate.svelte +2 -2
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +1 -1
- package/dist/components/blog_template/BlogTemplateInner.svelte +1 -1
- package/dist/components/blog_template/BlogTemplateInner.svelte.d.ts +1 -1
- package/dist/components/dialog_manager/DialogManager.d.ts +2 -1
- package/dist/components/dialog_manager/DialogMangerInit.d.ts +2 -15
- package/dist/components/dialog_manager/DialogMangerInit.js +8 -2
- package/dist/components/dialog_manager/IDialogManager.d.ts +39 -0
- package/dist/components/dialog_manager/IDialogManager.js +4 -0
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.d.ts +3 -0
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js +15 -3
- package/dist/components/dialog_overlay/DialogOverlay.svelte +155 -36
- package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -6
- package/dist/components/pineapple/PineappleBaseLayout.svelte +2 -21
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -3
- package/dist/styles/app.css +9 -14
- package/dist/ui/components/ModalBase.svelte +74 -74
- package/dist/ui/components/SocialSection.svelte +6 -2
- package/dist/ui/components/accordion/PinyaAccordion.svelte +20 -20
- package/dist/ui/components/accordion/PinyaAccordionItem.svelte +28 -28
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +64 -64
- package/dist/ui/elements/ImageIcon.svelte +53 -53
- package/dist/ui/elements/{pinya-button/component.svelte → PinyaButton/PinyaButton.svelte} +4 -3
- package/dist/ui/elements/PinyaButton/PinyaButton.svelte.d.ts +4 -0
- package/dist/ui/elements/{pinya-button/props.d.ts → PinyaButton/PinyaButtonProps.d.ts} +1 -0
- package/dist/ui/elements/PinyaButton/index.d.ts +2 -0
- package/dist/ui/elements/PinyaButton/index.js +2 -0
- package/dist/ui/elements/{pinya-card/component.svelte → PinyaCard/PinyaCard.svelte} +21 -20
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte.d.ts +7 -0
- package/dist/ui/elements/PinyaCard/index.d.ts +2 -0
- package/dist/ui/elements/PinyaCard/index.js +2 -0
- package/dist/ui/elements/Placeholder.svelte +17 -17
- package/dist/ui/elements/TextLink.svelte +16 -16
- package/dist/ui/elements/index.d.ts +2 -2
- package/dist/ui/elements/index.js +2 -2
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +34 -34
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +1 -0
- package/dist/ui/elements/text-chip/TextChip.svelte +14 -14
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte +24 -20
- package/dist/{components/navigation_component/NavigationComponent.svelte → ui/modules/NavigationMenu/NavigationMenu.svelte} +69 -43
- package/dist/{components/navigation_component/NavigationComponent.svelte.d.ts → ui/modules/NavigationMenu/NavigationMenu.svelte.d.ts} +6 -6
- package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.d.ts +4 -4
- package/dist/ui/modules/NavigationMenu/index.d.ts +2 -0
- package/dist/ui/modules/NavigationMenu/index.js +2 -0
- package/dist/ui/modules/index.d.ts +1 -1
- package/dist/ui/modules/index.js +1 -1
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +109 -109
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +42 -37
- package/dist/ui/modules/projects/Hepcat.svelte +6 -4
- package/dist/ui/modules/projects/Hepcat.svelte.d.ts +1 -1
- package/dist/ui/modules/projects/Pengi.svelte +61 -59
- package/dist/ui/modules/projects/Pengi.svelte.d.ts +1 -1
- package/dist/ui/modules/projects/Soulwork.svelte +7 -5
- package/dist/ui/modules/projects/ThisWebpage.svelte +19 -16
- package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +1 -1
- package/dist/ui/templates/{pinya-page-layout/component.svelte → PinyaPageLayout/PinyaPageLayout.svelte} +1 -1
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.d.ts +9 -0
- package/dist/ui/templates/PinyaPageLayout/index.d.ts +2 -0
- package/dist/ui/templates/PinyaPageLayout/index.js +2 -0
- package/dist/ui/templates/{pinya-page-layout → PinyaPageLayout}/runes.svelte.d.ts +3 -0
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.js +4 -0
- package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte +1 -1
- package/dist/{template/seaweed → ui/templates/SeaweedLayout}/CreateUrlForm.svelte +2 -2
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/EntryGroup.svelte +65 -88
- package/dist/ui/templates/SeaweedLayout/EntryOrderConfig.svelte.d.ts +9 -0
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectComponentProps.d.ts +1 -0
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectGroupConfig.svelte +316 -316
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectGroupConfig.svelte.d.ts +1 -1
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.md +3 -3
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.svelte +278 -276
- package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/props.d.ts +2 -2
- package/dist/ui/templates/confirmation-modal/component.svelte +46 -46
- package/dist/ui/templates/index.d.ts +2 -2
- package/dist/ui/templates/index.js +2 -2
- package/package.json +3 -2
- package/src/lib/styles/app.css +9 -14
- package/dist/components/navigation_component/index.d.ts +0 -2
- package/dist/components/navigation_component/index.js +0 -3
- package/dist/template/seaweed/ParseQueryTerms.d.ts +0 -1
- package/dist/template/seaweed/ParseQueryTerms.js +0 -23
- package/dist/template/seaweed/RunChaos.d.ts +0 -1
- package/dist/template/seaweed/RunChaos.js +0 -41
- package/dist/template/seaweed/SeaweedTemplate.svelte +0 -336
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +0 -32
- package/dist/template/seaweed/SeaweedTemplateData.d.ts +0 -30
- package/dist/template/seaweed/SeaweedTemplateData.js +0 -79
- package/dist/template/seaweed/entries/ChefWings.svelte +0 -45
- package/dist/template/seaweed/entries/ChefWings.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte +0 -40
- package/dist/template/seaweed/entries/CustomizedYarnspinner.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/EntryProps.d.ts +0 -16
- package/dist/template/seaweed/entries/EntryProps.js +0 -5
- package/dist/template/seaweed/entries/Hepcat.svelte +0 -64
- package/dist/template/seaweed/entries/Hepcat.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/Pengi.svelte +0 -57
- package/dist/template/seaweed/entries/Pengi.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/Soulwork.svelte +0 -54
- package/dist/template/seaweed/entries/Soulwork.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/ThisWebpage.svelte +0 -55
- package/dist/template/seaweed/entries/ThisWebpage.svelte.d.ts +0 -7
- package/dist/template/seaweed/entries/WorkExperience.svelte +0 -130
- package/dist/template/seaweed/entries/WorkExperience.svelte.d.ts +0 -8
- package/dist/template/seaweed/entries/Workset.svelte +0 -57
- package/dist/template/seaweed/entries/Workset.svelte.d.ts +0 -7
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.d.ts +0 -1
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.js +0 -8
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +0 -297
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +0 -12
- package/dist/template/seaweed/entry_order_config/entry-order-config.postcss +0 -35
- package/dist/template/seaweed/index.d.ts +0 -4
- package/dist/template/seaweed/index.js +0 -4
- package/dist/template/seaweed/seaweed.postcss +0 -125
- package/dist/ui/elements/pinya-button/component.svelte.d.ts +0 -4
- package/dist/ui/elements/pinya-button/index.d.ts +0 -2
- package/dist/ui/elements/pinya-button/index.js +0 -2
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +0 -7
- package/dist/ui/elements/pinya-card/index.d.ts +0 -2
- package/dist/ui/elements/pinya-card/index.js +0 -2
- package/dist/ui/modules/seaweed/index.d.ts +0 -3
- package/dist/ui/modules/seaweed/index.js +0 -4
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +0 -9
- package/dist/ui/templates/pinya-page-layout/index.d.ts +0 -2
- package/dist/ui/templates/pinya-page-layout/index.js +0 -2
- package/dist/ui/templates/pinya-page-layout/runes.svelte.js +0 -3
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte.d.ts +0 -9
- /package/dist/ui/elements/{pinya-button/props.js → PinyaButton/PinyaButtonProps.js} +0 -0
- /package/dist/ui/elements/{pinya-card/props.d.ts → PinyaCard/PinyaCardProps.d.ts} +0 -0
- /package/dist/{template/seaweed/ToastSettings.js → ui/elements/PinyaCard/PinyaCardProps.js} +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/NavigationControl.svelte.d.ts +0 -0
- /package/dist/{components/navigation_component → ui/modules/NavigationMenu}/PageMeta.js +0 -0
- /package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte.d.ts +0 -0
- /package/dist/{template/seaweed → ui/templates/SeaweedLayout}/CreateUrlForm.svelte.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/EntryGroup.svelte.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout/EntryOrderConfig2.svelte → SeaweedLayout/EntryOrderConfig.svelte} +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/ProjectComponentProps.js +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/SeaweedLayout.svelte.d.ts +0 -0
- /package/dist/{template/seaweed → ui/templates/SeaweedLayout}/ToastSettings.d.ts +0 -0
- /package/dist/ui/{elements/pinya-card/props.js → templates/SeaweedLayout/ToastSettings.js} +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/index.d.ts +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/index.js +0 -0
- /package/dist/ui/templates/{seaweed-layout → SeaweedLayout}/props.js +0 -0
|
@@ -1,277 +1,279 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { fly } from "svelte/transition";
|
|
3
|
-
import type { ProjectGroup, SeaweedLayoutProps } from "./props";
|
|
4
|
-
import ChumBucket from "
|
|
5
|
-
import { PinyaPageLayout } from "../
|
|
6
|
-
import { SocialSection } from "../../components/
|
|
7
|
-
import EntryGroup from "./EntryGroup.svelte";
|
|
8
|
-
import PineappleSwitch from "../../elements/PineappleSwitch.svelte";
|
|
9
|
-
import { CodeBlock, TextChip } from "../../elements/index";
|
|
10
|
-
import { SvelteMap } from "svelte/reactivity";
|
|
11
|
-
import
|
|
12
|
-
import CreateUrlForm from "
|
|
13
|
-
import { onMount } from "svelte";
|
|
14
|
-
import { page } from "$app/state";
|
|
15
|
-
|
|
16
|
-
let {
|
|
17
|
-
children,
|
|
18
|
-
sideSection,
|
|
19
|
-
entryList, // todo
|
|
20
|
-
layout, // todo
|
|
21
|
-
domain = "http://localhost:5173/seaweed2",
|
|
22
|
-
queryTerms,
|
|
23
|
-
showMiniSocial = false,
|
|
24
|
-
serverParams = ""
|
|
25
|
-
}: SeaweedLayoutProps = $props();
|
|
26
|
-
|
|
27
|
-
let actualLayout = $state(layout);
|
|
28
|
-
let isAdvanceSettingOn = $state(false);
|
|
29
|
-
let orderUrl = $state("");
|
|
30
|
-
|
|
31
|
-
let queryStates = new SvelteMap<string, boolean>(queryTerms.map(term => [term, true]));
|
|
32
|
-
let styleStr = $state("");
|
|
33
|
-
let queryQt = $derived.by(() => {
|
|
34
|
-
const qtArr = [...queryStates.entries()
|
|
35
|
-
.filter(([, state]) => state)
|
|
36
|
-
.map(([term]) => term)
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
if (qtArr.length === queryStates.size) {
|
|
40
|
-
return "";
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const qtStr = qtArr.join(",");
|
|
44
|
-
|
|
45
|
-
if (qtStr) {
|
|
46
|
-
return `qt=${qtStr}`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return "qt=clear";
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
$effect(() => {
|
|
53
|
-
const chipList: string[] = [];
|
|
54
|
-
const termList: string[] = [];
|
|
55
|
-
queryStates.entries()
|
|
56
|
-
.filter(([, state]) => state)
|
|
57
|
-
.forEach(([term]) => {
|
|
58
|
-
const qtTerm = `.qt-${term}`;
|
|
59
|
-
termList.push(qtTerm);
|
|
60
|
-
chipList.push(`.text-chip${qtTerm}`);
|
|
61
|
-
});
|
|
62
|
-
styleStr = `<style>
|
|
63
|
-
${termList.join(", ")} {
|
|
64
|
-
font-weight: bolder;
|
|
65
|
-
color: var(--color-secondary-400);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
${chipList.join(", ")} {
|
|
69
|
-
background-color: var(--color-secondary-500) /* oklch(55.6% 0 0deg) = #737373 */;
|
|
70
|
-
color: var(--color-secondary-contrast-500) /* var(--color-secondary-contrast-light) */;
|
|
71
|
-
}
|
|
72
|
-
</style>`;
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
let advancedQuery = $derived.by(() => {
|
|
76
|
-
const query = [orderUrl, queryQt]
|
|
77
|
-
.filter(q => q)
|
|
78
|
-
.join("&");
|
|
79
|
-
if (query) {
|
|
80
|
-
return `${query}`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return "";
|
|
84
|
-
});
|
|
85
|
-
|
|
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
|
-
});
|
|
155
|
-
</script>
|
|
156
|
-
|
|
157
|
-
<svelte:head>
|
|
158
|
-
{@html styleStr}
|
|
159
|
-
</svelte:head>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
{#snippet socialSection()}
|
|
163
|
-
<SocialSection></SocialSection>
|
|
164
|
-
{/snippet}
|
|
165
|
-
<PinyaPageLayout>
|
|
166
|
-
{#snippet appBarLead()}
|
|
167
|
-
{#if showMiniSocial}
|
|
168
|
-
<div
|
|
169
|
-
class="flex flex-row"
|
|
170
|
-
transition:fly={{x:-10}}
|
|
171
|
-
>
|
|
172
|
-
<SocialSection isSmallVersion={true} />
|
|
173
|
-
</div>
|
|
174
|
-
{/if}
|
|
175
|
-
{/snippet}
|
|
176
|
-
|
|
177
|
-
<div id="upper-section">
|
|
178
|
-
|
|
179
|
-
<div class="upper-section-start">
|
|
180
|
-
{@render sideSection(socialSection)}
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
<div class="upper-section-end">
|
|
184
|
-
{@render children()}
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<!--todo: render list #migration-->
|
|
189
|
-
{#each actualLayout as group (group.title)}
|
|
190
|
-
<EntryGroup
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { fly } from "svelte/transition";
|
|
3
|
+
import type { ProjectGroup, SeaweedLayoutProps } from "./props";
|
|
4
|
+
import ChumBucket from "./ChumBucket.svelte";
|
|
5
|
+
import { default as PinyaPageLayout } from "../PinyaPageLayout/PinyaPageLayout.svelte";
|
|
6
|
+
import { default as SocialSection } from "../../components/SocialSection.svelte";
|
|
7
|
+
import EntryGroup from "./EntryGroup.svelte";
|
|
8
|
+
import PineappleSwitch from "../../elements/PineappleSwitch.svelte";
|
|
9
|
+
import { CodeBlock, TextChip } from "../../elements/index";
|
|
10
|
+
import { SvelteMap } from "svelte/reactivity";
|
|
11
|
+
import EntryOrderConfig from "./EntryOrderConfig.svelte";
|
|
12
|
+
import CreateUrlForm from "./CreateUrlForm.svelte";
|
|
13
|
+
import { onMount } from "svelte";
|
|
14
|
+
import { page } from "$app/state";
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
sideSection,
|
|
19
|
+
entryList, // todo
|
|
20
|
+
layout, // todo
|
|
21
|
+
domain = "http://localhost:5173/seaweed2",
|
|
22
|
+
queryTerms,
|
|
23
|
+
showMiniSocial = false,
|
|
24
|
+
serverParams = "",
|
|
25
|
+
}: SeaweedLayoutProps = $props();
|
|
26
|
+
|
|
27
|
+
let actualLayout = $state(layout);
|
|
28
|
+
let isAdvanceSettingOn = $state(false);
|
|
29
|
+
let orderUrl = $state("");
|
|
30
|
+
|
|
31
|
+
let queryStates = new SvelteMap<string, boolean>(queryTerms.map(term => [term, true]));
|
|
32
|
+
let styleStr = $state("");
|
|
33
|
+
let queryQt = $derived.by(() => {
|
|
34
|
+
const qtArr = [...queryStates.entries()
|
|
35
|
+
.filter(([, state]) => state)
|
|
36
|
+
.map(([term]) => term)
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
if (qtArr.length === queryStates.size) {
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const qtStr = qtArr.join(",");
|
|
44
|
+
|
|
45
|
+
if (qtStr) {
|
|
46
|
+
return `qt=${qtStr}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return "qt=clear";
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
$effect(() => {
|
|
53
|
+
const chipList: string[] = [];
|
|
54
|
+
const termList: string[] = [];
|
|
55
|
+
queryStates.entries()
|
|
56
|
+
.filter(([, state]) => state)
|
|
57
|
+
.forEach(([term]) => {
|
|
58
|
+
const qtTerm = `.qt-${term}`;
|
|
59
|
+
termList.push(qtTerm);
|
|
60
|
+
chipList.push(`.text-chip${qtTerm}`);
|
|
61
|
+
});
|
|
62
|
+
styleStr = `<style>
|
|
63
|
+
${termList.join(", ")} {
|
|
64
|
+
font-weight: bolder;
|
|
65
|
+
color: var(--color-secondary-400);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${chipList.join(", ")} {
|
|
69
|
+
background-color: var(--color-secondary-500) /* oklch(55.6% 0 0deg) = #737373 */;
|
|
70
|
+
color: var(--color-secondary-contrast-500) /* var(--color-secondary-contrast-light) */;
|
|
71
|
+
}
|
|
72
|
+
</style>`;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
let advancedQuery = $derived.by(() => {
|
|
76
|
+
const query = [orderUrl, queryQt]
|
|
77
|
+
.filter(q => q)
|
|
78
|
+
.join("&");
|
|
79
|
+
if (query) {
|
|
80
|
+
return `${query}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return "";
|
|
84
|
+
});
|
|
85
|
+
|
|
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
|
+
});
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<svelte:head>
|
|
158
|
+
{@html styleStr}
|
|
159
|
+
</svelte:head>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
{#snippet socialSection()}
|
|
163
|
+
<SocialSection></SocialSection>
|
|
164
|
+
{/snippet}
|
|
165
|
+
<PinyaPageLayout>
|
|
166
|
+
{#snippet appBarLead()}
|
|
167
|
+
{#if showMiniSocial}
|
|
168
|
+
<div
|
|
169
|
+
class="flex flex-row"
|
|
170
|
+
transition:fly={{x:-10}}
|
|
171
|
+
>
|
|
172
|
+
<SocialSection isSmallVersion={true} />
|
|
173
|
+
</div>
|
|
174
|
+
{/if}
|
|
175
|
+
{/snippet}
|
|
176
|
+
|
|
177
|
+
<div id="upper-section">
|
|
178
|
+
|
|
179
|
+
<div class="upper-section-start">
|
|
180
|
+
{@render sideSection(socialSection)}
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="upper-section-end">
|
|
184
|
+
{@render children()}
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<!--todo: render list #migration-->
|
|
189
|
+
{#each actualLayout as group (group.title)}
|
|
190
|
+
<EntryGroup
|
|
191
|
+
{...group}
|
|
192
|
+
/>
|
|
193
|
+
{/each}
|
|
194
|
+
|
|
195
|
+
{#snippet footer()}
|
|
196
|
+
<div class="footer">
|
|
197
|
+
<ChumBucket></ChumBucket>
|
|
198
|
+
|
|
199
|
+
<div class="default-card advanced-setting mt-16 mb-32">
|
|
200
|
+
<h1>Advanced settings</h1>
|
|
201
|
+
<p>This one is for those curious how I customize this page.</p>
|
|
202
|
+
|
|
203
|
+
<PineappleSwitch name="advanced-setting-slider"
|
|
204
|
+
bind:checked={isAdvanceSettingOn}>
|
|
205
|
+
</PineappleSwitch>
|
|
206
|
+
Advanced settings: {isAdvanceSettingOn ? "On" : "Off"}
|
|
207
|
+
|
|
208
|
+
{#if (isAdvanceSettingOn)}
|
|
209
|
+
|
|
210
|
+
<h3 class="mt-6">Query terms to bold</h3>
|
|
211
|
+
<div class="query-term-grid max-w-2xl">
|
|
212
|
+
{#each queryStates as [term, shouldBold] (term)}
|
|
213
|
+
<button
|
|
214
|
+
class="bg-transparent hover:brightness-110"
|
|
215
|
+
onclick={() => { queryStates.set(term, !shouldBold); }}
|
|
216
|
+
>
|
|
217
|
+
<TextChip queryClass={shouldBold ? 'highlight-chip' : ''}>
|
|
218
|
+
<!-- todo: change shouldBold -->
|
|
219
|
+
<span style={`font-weight: ${shouldBold ? "bold" : "normal"}`}>
|
|
220
|
+
{#if (shouldBold)}✓{/if}
|
|
221
|
+
{term}
|
|
222
|
+
</span>
|
|
223
|
+
</TextChip>
|
|
224
|
+
</button>
|
|
225
|
+
{/each}
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<EntryOrderConfig
|
|
229
|
+
bind:layout={actualLayout}
|
|
230
|
+
bind:orderUrl={orderUrl}
|
|
231
|
+
allEntries={entryList}
|
|
232
|
+
></EntryOrderConfig>
|
|
233
|
+
|
|
234
|
+
<br>
|
|
235
|
+
<p>Copy the url below and open a new page with it</p>
|
|
236
|
+
<CodeBlock code={advancedUrl} lang="markdown" classes="max-w-2xl" />
|
|
237
|
+
<CreateUrlForm queryParams={advancedQuery}></CreateUrlForm>
|
|
238
|
+
{/if}
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
{/snippet}
|
|
242
|
+
</PinyaPageLayout>
|
|
243
|
+
|
|
244
|
+
<style>
|
|
245
|
+
:global(html) {
|
|
246
|
+
--color-bg-footer: var(--color-surface-200);
|
|
247
|
+
--color-footer-border: var(--color-primary-500);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
:global(html.dark) {
|
|
251
|
+
--color-bg-footer: var(--color-surface-900);
|
|
252
|
+
--color-footer-border: var(--color-primary-950);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.footer {
|
|
256
|
+
width: 100vw;
|
|
257
|
+
display: flex;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
align-items: center;
|
|
260
|
+
margin-top: 3lh;
|
|
261
|
+
background-color: var(--color-bg-footer);
|
|
262
|
+
border-top: 2px solid var(--color-footer-border);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
#upper-section {
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: row;
|
|
268
|
+
flex-wrap: wrap;
|
|
269
|
+
gap: 2rem;
|
|
270
|
+
justify-content: center;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.query-term-grid {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-wrap: wrap;
|
|
276
|
+
gap: 0.25em;
|
|
277
|
+
margin-top: 1lh;
|
|
278
|
+
}
|
|
277
279
|
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
import type { ProjectComponentProps } from "../index";
|
|
4
3
|
type ComponentSnippet = Snippet<[ProjectComponentProps]>;
|
|
5
4
|
export interface SnippetMeta {
|
|
6
5
|
key: string;
|
|
@@ -10,6 +9,7 @@ export interface ProjectGroup {
|
|
|
10
9
|
key: string;
|
|
11
10
|
title: string;
|
|
12
11
|
entryList: SnippetMeta[];
|
|
12
|
+
projectComponentProps?: ProjectComponentProps;
|
|
13
13
|
}
|
|
14
14
|
export interface SeaweedLayoutProps {
|
|
15
15
|
name: string;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { ConfirmationModalProps } from './props';
|
|
3
|
-
import { ModalBase } from '../../components';
|
|
4
|
-
import { ColorScheme, PinyaButton } from '../../elements';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children,
|
|
8
|
-
confirm,
|
|
9
|
-
...props
|
|
10
|
-
}: ConfirmationModalProps = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<ModalBase {...props}>
|
|
14
|
-
<div class="prose-h2:mt-4 max-w-xl">
|
|
15
|
-
|
|
16
|
-
{@render children()}
|
|
17
|
-
|
|
18
|
-
<div class="actions">
|
|
19
|
-
<PinyaButton
|
|
20
|
-
onclick={() => {
|
|
21
|
-
confirm.onclick();
|
|
22
|
-
props.close();
|
|
23
|
-
}}
|
|
24
|
-
title={confirm.hoverOver ?? 'Ok'}
|
|
25
|
-
colorScheme={ColorScheme.Warning}
|
|
26
|
-
>
|
|
27
|
-
{confirm.text ?? 'Ok'}
|
|
28
|
-
</PinyaButton>
|
|
29
|
-
<PinyaButton
|
|
30
|
-
onclick={() => props.close()}
|
|
31
|
-
title="Close modal"
|
|
32
|
-
colorScheme={ColorScheme.Surface}
|
|
33
|
-
>
|
|
34
|
-
Close
|
|
35
|
-
</PinyaButton>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</ModalBase>
|
|
39
|
-
|
|
40
|
-
<style>
|
|
41
|
-
.actions {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: row-reverse;
|
|
44
|
-
margin-top: 1.4lh;
|
|
45
|
-
gap: 1rem;
|
|
46
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ConfirmationModalProps } from './props';
|
|
3
|
+
import { default as ModalBase } from '../../components/ModalBase.svelte';
|
|
4
|
+
import { ColorScheme, PinyaButton } from '../../elements';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
confirm,
|
|
9
|
+
...props
|
|
10
|
+
}: ConfirmationModalProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ModalBase {...props}>
|
|
14
|
+
<div class="prose-h2:mt-4 max-w-xl">
|
|
15
|
+
|
|
16
|
+
{@render children()}
|
|
17
|
+
|
|
18
|
+
<div class="actions">
|
|
19
|
+
<PinyaButton
|
|
20
|
+
onclick={() => {
|
|
21
|
+
confirm.onclick();
|
|
22
|
+
props.close();
|
|
23
|
+
}}
|
|
24
|
+
title={confirm.hoverOver ?? 'Ok'}
|
|
25
|
+
colorScheme={ColorScheme.Warning}
|
|
26
|
+
>
|
|
27
|
+
{confirm.text ?? 'Ok'}
|
|
28
|
+
</PinyaButton>
|
|
29
|
+
<PinyaButton
|
|
30
|
+
onclick={() => props.close()}
|
|
31
|
+
title="Close modal"
|
|
32
|
+
colorScheme={ColorScheme.Surface}
|
|
33
|
+
>
|
|
34
|
+
Close
|
|
35
|
+
</PinyaButton>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</ModalBase>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
.actions {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row-reverse;
|
|
44
|
+
margin-top: 1.4lh;
|
|
45
|
+
gap: 1rem;
|
|
46
|
+
}
|
|
47
47
|
</style>
|