@turnipxenon/pineapple 3.0.0 → 3.1.0-alpha.10
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/README.md +103 -0
- package/dist/components/RandomizedBackground.svelte +4 -0
- package/dist/components/RandomizedBackground.svelte.d.ts +1 -0
- package/dist/components/blog_template/BlogTemplate.svelte +15 -18
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +3 -2
- 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 +3 -2
- package/dist/components/dialog_manager/DialogManager.js +6 -4
- package/dist/components/dialog_manager/DialogProcessor.d.ts +4 -2
- package/dist/components/dialog_manager/DialogProcessor.js +23 -18
- package/dist/components/dialog_manager/IDialogManager.d.ts +1 -2
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.d.ts +2 -2
- package/dist/components/dialog_manager/behavior_tree/line_processors/commands/JumpCommand.js +4 -5
- package/dist/components/dialog_overlay/DialogOverlay.svelte +149 -51
- package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -6
- package/dist/components/pineapple/PineappleBaseLayout.svelte +3 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/scripts/pineapple_fiber/PineappleWeaver.js +1 -2
- package/dist/styles/app.css +11 -14
- package/dist/styles/turnip-theme.css +17 -7
- package/dist/ui/components/ModalBase.svelte +74 -74
- package/dist/ui/components/SocialSection.svelte +2 -1
- package/dist/ui/components/accordion/PinyaAccordion.svelte +20 -20
- package/dist/ui/components/accordion/PinyaAccordionItem.svelte +28 -28
- package/dist/ui/components/randomized-background/RandomizedBackground.svelte +9 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +65 -64
- package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +1 -1
- package/dist/ui/elements/ImageIcon.svelte +53 -53
- package/dist/ui/elements/ImageIcon.svelte.d.ts +1 -1
- package/dist/ui/elements/PinyaAnchorButton/PinyaAnchorButton.svelte +25 -0
- package/dist/ui/elements/PinyaAnchorButton/PinyaAnchorButton.svelte.d.ts +4 -0
- package/dist/ui/elements/PinyaAnchorButton/PinyaAnchorButtonProps.d.ts +4 -0
- package/dist/ui/elements/PinyaAnchorButton/index.d.ts +2 -0
- package/dist/ui/elements/PinyaAnchorButton/index.js +2 -0
- package/dist/ui/elements/PinyaButton/PinyaButton.svelte +8 -31
- package/dist/ui/elements/PinyaButton/PinyaButton.svelte.d.ts +1 -1
- package/dist/ui/elements/PinyaButton/PinyaButtonProps.d.ts +4 -14
- package/dist/ui/elements/PinyaButton/PinyaButtonProps.js +1 -6
- package/dist/ui/elements/PinyaButtonCommon/ButtonVariant.d.ts +5 -0
- package/dist/ui/elements/PinyaButtonCommon/ButtonVariant.js +6 -0
- package/dist/ui/elements/PinyaButtonCommon/PinyaButtonCommonProps.d.ts +8 -0
- package/dist/ui/elements/PinyaButtonCommon/PinyaButtonCommonProps.js +2 -0
- package/dist/ui/elements/PinyaButtonCommon/createButtonClass.d.ts +2 -0
- package/dist/ui/elements/PinyaButtonCommon/createButtonClass.js +31 -0
- package/dist/ui/elements/PinyaButtonCommon/index.d.ts +3 -0
- package/dist/ui/elements/PinyaButtonCommon/index.js +3 -0
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte +30 -0
- package/dist/ui/elements/PinyaCard/PinyaCard.svelte.d.ts +7 -0
- package/dist/ui/elements/{pinya-card/props.d.ts → PinyaCard/PinyaCardProps.d.ts} +1 -0
- package/dist/ui/elements/PinyaCard/PinyaCardProps.js +1 -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 +7 -5
- package/dist/ui/elements/index.js +9 -5
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +34 -34
- 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 -42
- package/dist/ui/modules/projects/Hepcat.svelte +1 -1
- package/dist/ui/modules/projects/Pengi.svelte +61 -61
- package/dist/ui/modules/projects/Soulwork.svelte +1 -1
- package/dist/ui/modules/projects/ThisWebpage.svelte +11 -9
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte +7 -3
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.d.ts +3 -0
- package/dist/ui/templates/PinyaPageLayout/runes.svelte.js +1 -0
- package/dist/ui/{modules/seaweed → templates/SeaweedLayout}/ChumBucket.svelte +1 -1
- package/dist/ui/templates/SeaweedLayout/EntryGroup.svelte +65 -88
- package/dist/ui/templates/SeaweedLayout/ProjectComponentProps.d.ts +1 -0
- package/dist/ui/templates/SeaweedLayout/ProjectGroupConfig.svelte +316 -316
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.md +3 -3
- package/dist/ui/templates/SeaweedLayout/SeaweedLayout.svelte +278 -276
- package/dist/ui/templates/SeaweedLayout/props.d.ts +2 -2
- package/dist/ui/templates/confirmation-modal/component.svelte +46 -46
- package/package.json +1 -1
- package/src/lib/styles/app.css +11 -14
- package/dist/components/dialog_manager/DialogMangerInit.d.ts +0 -2
- package/dist/components/dialog_manager/DialogMangerInit.js +0 -21
- package/dist/components/navigation_component/index.d.ts +0 -2
- package/dist/components/navigation_component/index.js +0 -3
- package/dist/ui/elements/pinya-card/component.svelte +0 -21
- 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/elements/{pinya-card/props.js → PinyaAnchorButton/PinyaAnchorButtonProps.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
|
@@ -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 { 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
|
-
|
|
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 { 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
|
-
}
|
|
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>
|
package/package.json
CHANGED