@turnipxenon/pineapple 2.10.0 → 3.0.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/assets/icons/icon-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 +19 -7
- package/dist/components/PineappleSlideToggle.svelte.d.ts +8 -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 +53 -0
- package/dist/styles/turnip-theme.css +323 -0
- package/dist/template/seaweed/CreateUrlForm.svelte +50 -38
- package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +5 -15
- package/dist/template/seaweed/SeaweedTemplate.svelte +244 -195
- package/dist/template/seaweed/SeaweedTemplate.svelte.d.ts +28 -25
- 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 +136 -259
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +10 -20
- 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/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/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 +8 -0
- package/dist/ui/elements/index.js +8 -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 +19 -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 +7 -0
- package/dist/ui/elements/pinya-card/props.js +1 -0
- package/dist/ui/modules/index.d.ts +1 -0
- package/dist/ui/modules/index.js +1 -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 +48 -0
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte.d.ts +3 -0
- package/dist/{template → ui/modules}/seaweed/ChumBucket.svelte +28 -28
- 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 +45 -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 +3 -0
- package/dist/ui/templates/index.js +3 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte +113 -0
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +8 -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/package.json +36 -18
- package/src/lib/styles/app.css +53 -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.d.ts +0 -14
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type CreateUrlRequest, CreateUrlResult, jsonToCreateUrlResponse } from "../../types/api/CreateUrl";
|
|
3
|
+
import { type ToastSettings } from "@skeletonlabs/skeleton-svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
queryParams?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { queryParams = "" }: Props = $props();
|
|
10
|
+
|
|
11
|
+
const toastStore = getToastStore();
|
|
12
|
+
|
|
13
|
+
let request: CreateUrlRequest = $state({
|
|
14
|
+
queryParams: "",
|
|
15
|
+
shortUrl: "",
|
|
16
|
+
password: ""
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
$effect(() => {
|
|
20
|
+
request.queryParams = queryParams;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const failToast: ToastSettings = {
|
|
25
|
+
message: "Adding new url failed"
|
|
26
|
+
};
|
|
27
|
+
const toastMap = new Map<CreateUrlResult, ToastSettings>([
|
|
28
|
+
[CreateUrlResult.Success, {
|
|
29
|
+
message: "Successfully added new url"
|
|
30
|
+
}],
|
|
31
|
+
[CreateUrlResult.Duplicate, {
|
|
32
|
+
message: "Short url already used; try again with another url"
|
|
33
|
+
}],
|
|
34
|
+
[CreateUrlResult.Fail, failToast]
|
|
35
|
+
]);
|
|
36
|
+
const post = () => {
|
|
37
|
+
fetch("/api/create-url", {
|
|
38
|
+
method: "POST",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json"
|
|
41
|
+
},
|
|
42
|
+
body: JSON.stringify(request)
|
|
43
|
+
}).then(resp =>
|
|
44
|
+
resp.json()
|
|
45
|
+
).then(json => {
|
|
46
|
+
const properResp = jsonToCreateUrlResponse(json);
|
|
47
|
+
toastStore.trigger(toastMap.get(properResp.result) ?? failToast);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
38
50
|
</script>
|
|
39
51
|
|
|
40
52
|
<div class="local-list">
|
|
@@ -50,7 +62,7 @@ const post = () => {
|
|
|
50
62
|
class="input"
|
|
51
63
|
type="password"
|
|
52
64
|
placeholder="ILoveTurnips" />
|
|
53
|
-
<button class="send-link btn
|
|
65
|
+
<button class="send-link btn preset-filled" onclick={post}>Send link</button>
|
|
54
66
|
</div>
|
|
55
67
|
|
|
56
68
|
<style>
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
queryParams?: string | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type CreateUrlFormProps = typeof __propDef.props;
|
|
12
|
-
export type CreateUrlFormEvents = typeof __propDef.events;
|
|
13
|
-
export type CreateUrlFormSlots = typeof __propDef.slots;
|
|
14
|
-
export default class CreateUrlForm extends SvelteComponent<CreateUrlFormProps, CreateUrlFormEvents, CreateUrlFormSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
queryParams?: string;
|
|
15
3
|
}
|
|
16
|
-
|
|
4
|
+
declare const CreateUrlForm: import("svelte").Component<Props, {}, "">;
|
|
5
|
+
type CreateUrlForm = ReturnType<typeof CreateUrlForm>;
|
|
6
|
+
export default CreateUrlForm;
|
|
@@ -1,175 +1,238 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { page } from "$app/stores";
|
|
9
|
-
import Card from "../../components/Card.svelte";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export let
|
|
24
|
-
export let
|
|
25
|
-
export let
|
|
26
|
-
export let
|
|
27
|
-
export let
|
|
28
|
-
export let
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
<!-- @migration-task Error while migrating Svelte code: Can't migrate code with afterUpdate. Please migrate by hand. -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import { afterUpdate, type ComponentType, onMount } from "svelte";
|
|
4
|
+
import EntryOrderConfig from "./entry_order_config/EntryOrderConfig.svelte";
|
|
5
|
+
import { runChaos } from "./RunChaos";
|
|
6
|
+
import SocialSection from "../../ui/components/SocialSection.svelte";
|
|
7
|
+
import SeaweedBaseLayout from "../../components/layouts/SeaweedBaseLayout.svelte";
|
|
8
|
+
import { page } from "$app/stores";
|
|
9
|
+
import Card from "../../components/Card.svelte";
|
|
10
|
+
import {
|
|
11
|
+
type ComponentMeta,
|
|
12
|
+
type EntryGroup,
|
|
13
|
+
type SeaweedTemplateData,
|
|
14
|
+
TurnGroupEntriesMutable
|
|
15
|
+
} from "./SeaweedTemplateData";
|
|
16
|
+
import type { EntryProps } from "./entries/EntryProps";
|
|
17
|
+
import { parseQueryTerms } from "./ParseQueryTerms";
|
|
18
|
+
import UrlShortenerForm from "./CreateUrlForm.svelte";
|
|
19
|
+
import PineappleSlideToggle from "../../components/PineappleSlideToggle.svelte";
|
|
20
|
+
import { Chip } from "../../index";
|
|
21
|
+
import ChumBucket from "../../ui/modules/seaweed/ChumBucket.svelte";
|
|
22
|
+
|
|
23
|
+
export let seaweedTemplateData: SeaweedTemplateData;
|
|
24
|
+
export let projectFirstGroupedEntries: ReadonlyArray<EntryGroup>;
|
|
25
|
+
export let getAllEntryFromGlobal: () => Map<string, ComponentMeta>;
|
|
26
|
+
export let getEntryFromGlobal: (name: string) => undefined | ComponentMeta;
|
|
27
|
+
export let letChaos = true;
|
|
28
|
+
export let name = "Turnip";
|
|
29
|
+
export let email = "turnipxenon@gmail.com";
|
|
30
|
+
export let linkedinSlug = "turnip-xenon";
|
|
31
|
+
export let domain = "http://localhost:5173/portfolio/actual/";
|
|
32
|
+
export let serverSideQueryParams = "";
|
|
33
|
+
export let experienceSection: ComponentType;
|
|
34
|
+
|
|
35
|
+
// region query params
|
|
36
|
+
let entryProps: EntryProps = {
|
|
37
|
+
email,
|
|
38
|
+
letChaos,
|
|
39
|
+
linkedinSlug,
|
|
40
|
+
name,
|
|
41
|
+
seaweedTemplateData
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
let isVisible = true;
|
|
45
|
+
const paramQTSet = new Set<string>();
|
|
46
|
+
|
|
47
|
+
let isAdvanceSettingOn = false;
|
|
48
|
+
$: isSocialsGone = !isVisible;
|
|
49
|
+
$: console.log("is visible", isVisible);
|
|
50
|
+
|
|
51
|
+
let qtfontWeight = "normal";
|
|
52
|
+
let additionalFontWeight = "";
|
|
53
|
+
|
|
54
|
+
let chaosDone = false;
|
|
55
|
+
let mainVisibility = "visible";
|
|
56
|
+
$: mainVisibility = letChaos && !chaosDone ? "hidden" : "visible";
|
|
57
|
+
|
|
58
|
+
const syncQT = () => {
|
|
59
|
+
if (seaweedTemplateData.queryTermMap.size === 0 || paramQTSet.size === 0) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
seaweedTemplateData.queryTermMap.forEach((_, k) => {
|
|
64
|
+
seaweedTemplateData.queryTermMap.set(k, paramQTSet.has(k));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// force svelte refresh
|
|
68
|
+
seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const parseQueryTermsLocal = async () => {
|
|
72
|
+
const qtSet = new Set<string>();
|
|
73
|
+
parseQueryTerms(document.body, qtSet);
|
|
74
|
+
qtSet.forEach(t => seaweedTemplateData.queryTermMap.set(t, true));
|
|
75
|
+
// force svelte update
|
|
76
|
+
seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
|
|
77
|
+
syncQT();
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** qt values and what they mean:
|
|
81
|
+
* undefined: set all qt terms to font-weight: bold
|
|
82
|
+
* todo: implement clear
|
|
83
|
+
* clear: unset all terms to font-weight: normal
|
|
84
|
+
* <term>: only set qt-<term> to bold
|
|
85
|
+
* <term1>,<term2>: only set qt-<term1> and qt-<term2> to bold,
|
|
86
|
+
*
|
|
87
|
+
* ONLY CALL INSIDE onMount()
|
|
88
|
+
**/
|
|
89
|
+
const filterSearchParams = (searchParams: URLSearchParams) => {
|
|
90
|
+
const isFunOn = searchParams.get("fun")?.trim();
|
|
91
|
+
if (isFunOn === "true") {
|
|
92
|
+
seaweedTemplateData.shouldAddFunNote = true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// region Order
|
|
96
|
+
const gameSectionFirstParam = searchParams.get("game-section-first")?.trim();
|
|
97
|
+
const orderParam = searchParams.get("order")?.trim();
|
|
98
|
+
if (orderParam) {
|
|
99
|
+
seaweedTemplateData.groupedEntries = [];
|
|
100
|
+
|
|
101
|
+
orderParam.split(",").forEach(groupDefinition => {
|
|
102
|
+
const pair = groupDefinition.split(":");
|
|
103
|
+
if (pair.length >= 2) {
|
|
104
|
+
const group: EntryGroup = {
|
|
105
|
+
name: pair[0],
|
|
106
|
+
items: [],
|
|
107
|
+
gridClass: pair[2]
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
pair[1].split("|").forEach(e => {
|
|
111
|
+
const component = getEntryFromGlobal(e);
|
|
112
|
+
if (component) {
|
|
113
|
+
group.items.push(component);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
seaweedTemplateData.groupedEntries.push(group);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
seaweedTemplateData.groupedEntries = seaweedTemplateData.groupedEntries;
|
|
123
|
+
} else if (gameSectionFirstParam === "false") {
|
|
124
|
+
seaweedTemplateData.groupedEntries = TurnGroupEntriesMutable(projectFirstGroupedEntries);
|
|
125
|
+
}
|
|
126
|
+
// endregion
|
|
127
|
+
|
|
128
|
+
// region Bold terms
|
|
129
|
+
const qtValue = searchParams.get("qt")?.trim();
|
|
130
|
+
if (qtValue !== undefined) {
|
|
131
|
+
qtfontWeight = "normal";
|
|
132
|
+
const dynamicStyle = qtValue.split(",").map((term) => {
|
|
133
|
+
// side-effect
|
|
134
|
+
paramQTSet.add(`qt-${term}`);
|
|
135
|
+
|
|
136
|
+
// main effect
|
|
137
|
+
return `span.qt-${term} { font-weight: bold !important; }`;
|
|
138
|
+
}).join("\n");
|
|
139
|
+
|
|
140
|
+
// https://stackoverflow.com/a/24285947/17836168
|
|
141
|
+
const style = document.createElement("style");
|
|
142
|
+
// noinspection JSDeprecatedSymbols
|
|
143
|
+
style.type = "text/css";
|
|
144
|
+
style.innerText = dynamicStyle;
|
|
145
|
+
document.head.appendChild(style);
|
|
146
|
+
syncQT();
|
|
147
|
+
} else {
|
|
148
|
+
qtfontWeight = "bold";
|
|
149
|
+
}
|
|
150
|
+
// endregion Bold terms
|
|
151
|
+
};
|
|
152
|
+
// endregion query params
|
|
153
|
+
|
|
154
|
+
/* region chaos scripts */
|
|
155
|
+
/* endregion chaos scripts */
|
|
156
|
+
|
|
157
|
+
onMount(async () => {
|
|
158
|
+
if (!letChaos && serverSideQueryParams) {
|
|
159
|
+
filterSearchParams(new URLSearchParams(serverSideQueryParams));
|
|
160
|
+
} else if (!letChaos && $page.url.searchParams) {
|
|
161
|
+
filterSearchParams($page.url.searchParams);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (letChaos) {
|
|
165
|
+
runChaos(document.body);
|
|
166
|
+
chaosDone = true;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// todo: figure out what this does #migration
|
|
171
|
+
// let isParsed = false;
|
|
172
|
+
// afterUpdate(async () => {
|
|
173
|
+
// if (!letChaos && !isParsed) {
|
|
174
|
+
// isParsed = true;
|
|
175
|
+
// await parseQueryTermsLocal();
|
|
176
|
+
// }
|
|
177
|
+
// });
|
|
178
|
+
|
|
179
|
+
const toggleTerm = (term: string) => {
|
|
180
|
+
seaweedTemplateData.queryTermMap.set(term, !seaweedTemplateData.queryTermMap.get(term));
|
|
181
|
+
seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// when either gameSectionFirst or the queryTerms are updated, update advancedUrl
|
|
185
|
+
let orderUrl = "";
|
|
186
|
+
let advancedUrl = domain;
|
|
187
|
+
let advancedQuery = "";
|
|
188
|
+
const updateUrl = (seaweedTemplateData: SeaweedTemplateData) => {
|
|
189
|
+
if (seaweedTemplateData === undefined) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const queryParams: string[] = [];
|
|
194
|
+
|
|
195
|
+
if (orderUrl) {
|
|
196
|
+
queryParams.push(orderUrl);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const qtList: string[] = [];
|
|
200
|
+
seaweedTemplateData.queryTermMap.forEach((shouldBold, term) => {
|
|
201
|
+
if (shouldBold) {
|
|
202
|
+
qtList.push(term);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
if (qtList.length === 0) {
|
|
207
|
+
queryParams.push("qt=clear");
|
|
208
|
+
} else if (seaweedTemplateData.queryTermMap.size !== qtList.length) {
|
|
209
|
+
// we'll only add if the lengths are not equal
|
|
210
|
+
// dont need to add query if all terms in qtMap is true
|
|
211
|
+
queryParams.push(`qt=${qtList.map(t => t.slice(3, t.length)).join(",")}`);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (seaweedTemplateData.shouldAddFunNote) {
|
|
215
|
+
queryParams.push("fun=true");
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (!seaweedTemplateData.gameSectionFirst) {
|
|
219
|
+
queryParams.push("game-section-first=false");
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (queryParams.length > 0) {
|
|
223
|
+
advancedQuery = queryParams.join("&");
|
|
224
|
+
advancedUrl = `${domain}?${advancedQuery}`;
|
|
225
|
+
} else {
|
|
226
|
+
advancedUrl = domain;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
$: updateUrl(seaweedTemplateData);
|
|
230
|
+
|
|
231
|
+
// eslint-disable-next-line
|
|
232
|
+
const updateSeaweedWhenFunNoteChanged = (_: boolean) => {
|
|
233
|
+
entryProps = entryProps;
|
|
234
|
+
};
|
|
235
|
+
$: updateSeaweedWhenFunNoteChanged(seaweedTemplateData.shouldAddFunNote);
|
|
173
236
|
</script>
|
|
174
237
|
|
|
175
238
|
<SeaweedBaseLayout bind:shouldDisplayLeadingIcons={isSocialsGone}>
|
|
@@ -235,7 +298,7 @@ $:
|
|
|
235
298
|
checked={shouldBold}>
|
|
236
299
|
<!-- todo: change shouldBold -->
|
|
237
300
|
<span style={`font-weight: ${shouldBold ? "bold" : "normal"}`}>
|
|
238
|
-
{#if (shouldBold)}
|
|
301
|
+
{#if (shouldBold)}✓{/if}
|
|
239
302
|
{term}
|
|
240
303
|
</span>
|
|
241
304
|
</Chip>
|
|
@@ -260,28 +323,14 @@ $:
|
|
|
260
323
|
{/if}
|
|
261
324
|
</main>
|
|
262
325
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
326
|
+
{#snippet extraLeadingIcons()}
|
|
327
|
+
<SocialSection
|
|
328
|
+
isSlot={true}
|
|
329
|
+
email={email}
|
|
330
|
+
linkedinSlug={linkedinSlug}
|
|
331
|
+
isSmallVersion={true}></SocialSection>
|
|
332
|
+
{/snippet}
|
|
268
333
|
</SeaweedBaseLayout>
|
|
269
334
|
|
|
270
|
-
<style
|
|
271
|
-
.advanced-setting {
|
|
272
|
-
display: flex;
|
|
273
|
-
flex-direction: column;
|
|
274
|
-
gap: 0.5lh;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
h3 {
|
|
278
|
-
font-size: 1.5em;
|
|
279
|
-
line-height: 1.5lh;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.query-term-grid {
|
|
283
|
-
display: flex;
|
|
284
|
-
gap: 0.25em;
|
|
285
|
-
flex-wrap: wrap;
|
|
286
|
-
}
|
|
335
|
+
<style>/*$$__STYLE_CONTENT__$$*/
|
|
287
336
|
</style>
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type ComponentType } from "svelte";
|
|
3
|
-
import "./seaweed.postcss";
|
|
4
2
|
import { type ComponentMeta, type EntryGroup, type SeaweedTemplateData } from "./SeaweedTemplateData";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
domain?: string | undefined;
|
|
16
|
-
serverSideQueryParams?: string | undefined;
|
|
17
|
-
experienceSection: ComponentType;
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
18
13
|
};
|
|
19
|
-
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
};
|
|
22
|
-
slots: {};
|
|
23
|
-
};
|
|
24
|
-
export type SeaweedTemplateProps = typeof __propDef.props;
|
|
25
|
-
export type SeaweedTemplateEvents = typeof __propDef.events;
|
|
26
|
-
export type SeaweedTemplateSlots = typeof __propDef.slots;
|
|
27
|
-
export default class SeaweedTemplate extends SvelteComponent<SeaweedTemplateProps, SeaweedTemplateEvents, SeaweedTemplateSlots> {
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
28
15
|
}
|
|
29
|
-
|
|
16
|
+
declare const SeaweedTemplate: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
seaweedTemplateData: SeaweedTemplateData;
|
|
18
|
+
projectFirstGroupedEntries: ReadonlyArray<EntryGroup>;
|
|
19
|
+
getAllEntryFromGlobal: () => Map<string, ComponentMeta>;
|
|
20
|
+
getEntryFromGlobal: (name: string) => undefined | ComponentMeta;
|
|
21
|
+
letChaos?: boolean;
|
|
22
|
+
name?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
linkedinSlug?: string;
|
|
25
|
+
domain?: string;
|
|
26
|
+
serverSideQueryParams?: string;
|
|
27
|
+
experienceSection: ComponentType;
|
|
28
|
+
}, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {}, {}, string>;
|
|
31
|
+
type SeaweedTemplate = InstanceType<typeof SeaweedTemplate>;
|
|
32
|
+
export default SeaweedTemplate;
|