@turnipxenon/pineapple 3.0.0-alpha.6 → 3.0.0-alpha.8
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 +3 -1
- package/dist/components/blog_template/BlogTemplate.svelte.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/layouts/SeaweedBaseLayout.svelte +0 -2
- package/dist/template/seaweed/entries/WorkExperience.svelte +1 -1
- package/dist/{components/ElementVisbilityDetector.svelte → ui/elements/ElementVisibilityDetector.svelte} +6 -3
- package/dist/ui/elements/ElementVisibilityDetector.svelte.d.ts +8 -0
- package/dist/ui/elements/index.d.ts +1 -0
- package/dist/ui/elements/index.js +1 -0
- package/dist/ui/templates/seaweed-layout/EntryGroup.svelte +5 -5
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte +89 -8
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte.d.ts +1 -1
- package/dist/ui/templates/seaweed-layout/props.d.ts +2 -0
- package/package.json +16 -10
- package/dist/components/ElementVisbilityDetector.svelte.d.ts +0 -7
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Card, enableDialogueOverlay, type SimplePageMeta } from "../..";
|
|
3
2
|
import "./blog-template.css";
|
|
4
3
|
import { enableBackground } from "../../store";
|
|
5
4
|
import { onDestroy, onMount } from "svelte";
|
|
6
5
|
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
6
|
+
import type { SimplePageMeta } from "../navigation_component/index";
|
|
7
|
+
import { enableDialogueOverlay } from "../dialog_manager/DialogManagerStore";
|
|
8
|
+
import { Card } from "../index";
|
|
7
9
|
|
|
8
10
|
// grab page meta from the adjacent meta.json
|
|
9
11
|
interface Props {
|
|
@@ -3,6 +3,6 @@ export { default as Card } from "./Card.svelte";
|
|
|
3
3
|
export { default as Chip } from "./chip/Chip.svelte";
|
|
4
4
|
export { default as PineappleSlideToggle } from "./PineappleSlideToggle.svelte";
|
|
5
5
|
export { default as SocialSection } from "../ui/components/SocialSection.svelte";
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as ElementVisibilityDetector } from "../ui/elements/ElementVisibilityDetector.svelte";
|
|
7
7
|
export { default as BlogTemplate } from "./blog_template/BlogTemplate.svelte";
|
|
8
8
|
export { default as DialogOverlay } from "./dialog_overlay/DialogOverlay.svelte";
|
package/dist/components/index.js
CHANGED
|
@@ -4,6 +4,6 @@ export { default as Card } from "./Card.svelte";
|
|
|
4
4
|
export { default as Chip } from "./chip/Chip.svelte";
|
|
5
5
|
export { default as PineappleSlideToggle } from "./PineappleSlideToggle.svelte";
|
|
6
6
|
export { default as SocialSection } from "../ui/components/SocialSection.svelte";
|
|
7
|
-
export { default as
|
|
7
|
+
export { default as ElementVisibilityDetector } from "../ui/elements/ElementVisibilityDetector.svelte";
|
|
8
8
|
export { default as BlogTemplate } from "./blog_template/BlogTemplate.svelte";
|
|
9
9
|
export { default as DialogOverlay } from "./dialog_overlay/DialogOverlay.svelte";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import SocialSection from "../../../ui/components/SocialSection.svelte";
|
|
3
3
|
import Card from "../../../components/Card.svelte";
|
|
4
|
-
import ElementVisibilityDetector from "../../../
|
|
4
|
+
import ElementVisibilityDetector from "../../../ui/elements/ElementVisibilityDetector.svelte";
|
|
5
5
|
import type { EntryProps } from "./EntryProps";
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import { onMount, type Snippet } from "svelte";
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
isVisible?: boolean;
|
|
6
|
-
children?:
|
|
6
|
+
children?: Snippet;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
let {
|
|
9
|
+
let {
|
|
10
|
+
isVisible = $bindable(true),
|
|
11
|
+
children
|
|
12
|
+
}: Props = $props();
|
|
10
13
|
|
|
11
14
|
let stickyElem: HTMLElement = $state();
|
|
12
15
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
interface Props {
|
|
3
|
+
isVisible?: boolean;
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
}
|
|
6
|
+
declare const ElementVisibilityDetector: import("svelte").Component<Props, {}, "isVisible">;
|
|
7
|
+
type ElementVisibilityDetector = ReturnType<typeof ElementVisibilityDetector>;
|
|
8
|
+
export default ElementVisibilityDetector;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ImageIcon } from "./ImageIcon.svelte";
|
|
2
2
|
export { default as TextLink } from "./TextLink.svelte";
|
|
3
|
+
export { default as ElementVisibilityDetector } from "./ElementVisibilityDetector.svelte";
|
|
3
4
|
export * from "./ColorScheme";
|
|
4
5
|
export * from "./GeneralUIProps";
|
|
5
6
|
export * from "./OnBackground";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ImageIcon } from "./ImageIcon.svelte";
|
|
2
2
|
export { default as TextLink } from "./TextLink.svelte";
|
|
3
|
+
export { default as ElementVisibilityDetector } from "./ElementVisibilityDetector.svelte";
|
|
3
4
|
export * from "./ColorScheme";
|
|
4
5
|
export * from "./GeneralUIProps";
|
|
5
6
|
export * from "./OnBackground";
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
entryList
|
|
8
8
|
}: ProjectGroup = $props();
|
|
9
9
|
|
|
10
|
-
const isSpecial = entryList.length % 3 === 1;
|
|
10
|
+
const isSpecial = $derived(entryList.length % 3 === 1);
|
|
11
11
|
|
|
12
|
-
let normalUiList: SnippetMeta[] = isSpecial
|
|
12
|
+
let normalUiList: SnippetMeta[] = $derived(isSpecial
|
|
13
13
|
? [...entryList.slice(0, -4)]
|
|
14
|
-
: [...entryList];
|
|
15
|
-
let overflowUiList: SnippetMeta[] = isSpecial
|
|
14
|
+
: [...entryList]);
|
|
15
|
+
let overflowUiList: SnippetMeta[] = $derived(isSpecial
|
|
16
16
|
? [...entryList.slice(-4)]
|
|
17
|
-
: [];
|
|
17
|
+
: []);
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
// <!--todo: implement in seaweedlayout #migration-->
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { fly } from "svelte/transition";
|
|
3
|
+
import type { ProjectGroup, SeaweedLayoutProps } from "./props";
|
|
3
4
|
import ChumBucket from "../../modules/seaweed/ChumBucket.svelte";
|
|
4
5
|
import { PinyaPageLayout } from "../index";
|
|
5
6
|
import { SocialSection } from "../../components/index";
|
|
@@ -9,16 +10,21 @@
|
|
|
9
10
|
import { SvelteMap } from "svelte/reactivity";
|
|
10
11
|
import EntryOrderConfig2 from "./EntryOrderConfig2.svelte";
|
|
11
12
|
import CreateUrlForm from "../../../template/seaweed/CreateUrlForm.svelte";
|
|
13
|
+
import { onMount } from "svelte";
|
|
14
|
+
import { page } from "$app/state";
|
|
12
15
|
|
|
13
16
|
let {
|
|
14
17
|
children,
|
|
15
18
|
sideSection,
|
|
16
19
|
entryList, // todo
|
|
17
|
-
layout
|
|
20
|
+
layout, // todo
|
|
18
21
|
domain = "http://localhost:5173/seaweed2",
|
|
19
|
-
queryTerms
|
|
22
|
+
queryTerms,
|
|
23
|
+
showMiniSocial = false,
|
|
24
|
+
serverParams = ""
|
|
20
25
|
}: SeaweedLayoutProps = $props();
|
|
21
26
|
|
|
27
|
+
let actualLayout = $state(layout);
|
|
22
28
|
let isAdvanceSettingOn = $state(true);
|
|
23
29
|
let orderUrl = $state("");
|
|
24
30
|
|
|
@@ -47,8 +53,8 @@
|
|
|
47
53
|
const chipList: string[] = [];
|
|
48
54
|
const termList: string[] = [];
|
|
49
55
|
queryStates.entries()
|
|
50
|
-
.filter(([
|
|
51
|
-
.forEach(([term
|
|
56
|
+
.filter(([, state]) => state)
|
|
57
|
+
.forEach(([term]) => {
|
|
52
58
|
const qtTerm = `.qt-${term}`;
|
|
53
59
|
termList.push(qtTerm);
|
|
54
60
|
chipList.push(`.text-chip${qtTerm}`);
|
|
@@ -78,6 +84,74 @@
|
|
|
78
84
|
});
|
|
79
85
|
|
|
80
86
|
let advancedUrl = $derived.by(() => `${domain}/?${advancedQuery}`);
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/** qt values and what they mean:
|
|
90
|
+
* undefined: set all qt terms to font-weight: bold
|
|
91
|
+
* todo: implement clear
|
|
92
|
+
* clear: unset all terms to font-weight: normal
|
|
93
|
+
* <term>: only set qt-<term> to bold
|
|
94
|
+
* <term1>,<term2>: only set qt-<term1> and qt-<term2> to bold,
|
|
95
|
+
*
|
|
96
|
+
* ONLY CALL INSIDE onMount()
|
|
97
|
+
**/
|
|
98
|
+
const filterSearchParams = (searchParams: URLSearchParams) => {
|
|
99
|
+
// region Order
|
|
100
|
+
const orderParam = searchParams.get("order")?.trim();
|
|
101
|
+
console.log(searchParams);
|
|
102
|
+
console.log(orderParam);
|
|
103
|
+
if (orderParam) {
|
|
104
|
+
actualLayout = [];
|
|
105
|
+
|
|
106
|
+
orderParam.split(",").forEach((groupDefinition, idx) => {
|
|
107
|
+
const pair = groupDefinition.split(":");
|
|
108
|
+
if (pair.length >= 2) {
|
|
109
|
+
const group: ProjectGroup = {
|
|
110
|
+
title: pair[0],
|
|
111
|
+
entryList: [],
|
|
112
|
+
key: `${pair[0]}-${idx}`
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
pair[1].split("|").forEach(key => {
|
|
116
|
+
const component = entryList.find(e => e.key === key);
|
|
117
|
+
if (component) {
|
|
118
|
+
group.entryList.push(component);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
actualLayout.push(group);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
actualLayout = [...actualLayout];
|
|
127
|
+
console.log(actualLayout);
|
|
128
|
+
}
|
|
129
|
+
// endregion
|
|
130
|
+
|
|
131
|
+
// region Bold terms
|
|
132
|
+
const qtValue = searchParams.get("qt")?.trim();
|
|
133
|
+
if (qtValue !== undefined) {
|
|
134
|
+
queryStates.keys()
|
|
135
|
+
.forEach(key => queryStates.set(key, false));
|
|
136
|
+
|
|
137
|
+
if (qtValue !== "clear") {
|
|
138
|
+
qtValue.split(",").forEach((term) => {
|
|
139
|
+
if (queryStates.has(term)) {
|
|
140
|
+
queryStates.set(term, true);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// endregion Bold terms
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
onMount(() => {
|
|
149
|
+
if (serverParams) {
|
|
150
|
+
filterSearchParams(new URLSearchParams(serverParams));
|
|
151
|
+
} else if (page.url.searchParams.size) {
|
|
152
|
+
filterSearchParams(page.url.searchParams);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
81
155
|
</script>
|
|
82
156
|
|
|
83
157
|
<svelte:head>
|
|
@@ -90,7 +164,14 @@
|
|
|
90
164
|
{/snippet}
|
|
91
165
|
<PinyaPageLayout>
|
|
92
166
|
{#snippet appBarLead()}
|
|
93
|
-
|
|
167
|
+
{#if showMiniSocial}
|
|
168
|
+
<div
|
|
169
|
+
class="flex flex-row"
|
|
170
|
+
transition:fly={{x:-10}}
|
|
171
|
+
>
|
|
172
|
+
<SocialSection isSmallVersion={true} />
|
|
173
|
+
</div>
|
|
174
|
+
{/if}
|
|
94
175
|
{/snippet}
|
|
95
176
|
|
|
96
177
|
<div id="upper-section">
|
|
@@ -105,7 +186,7 @@
|
|
|
105
186
|
</div>
|
|
106
187
|
|
|
107
188
|
<!--todo: render list #migration-->
|
|
108
|
-
{#each
|
|
189
|
+
{#each actualLayout as group (group.title)}
|
|
109
190
|
<EntryGroup {...group}></EntryGroup>
|
|
110
191
|
{/each}
|
|
111
192
|
|
|
@@ -143,7 +224,7 @@
|
|
|
143
224
|
</div>
|
|
144
225
|
|
|
145
226
|
<EntryOrderConfig2
|
|
146
|
-
{
|
|
227
|
+
bind:layout={actualLayout}
|
|
147
228
|
bind:orderUrl={orderUrl}
|
|
148
229
|
allEntries={entryList}
|
|
149
230
|
></EntryOrderConfig2>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SeaweedLayoutProps } from "./props";
|
|
2
|
-
declare const SeaweedLayout: import("svelte").Component<SeaweedLayoutProps, {}, "
|
|
2
|
+
declare const SeaweedLayout: import("svelte").Component<SeaweedLayoutProps, {}, "">;
|
|
3
3
|
type SeaweedLayout = ReturnType<typeof SeaweedLayout>;
|
|
4
4
|
export default SeaweedLayout;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "3.0.0-alpha.
|
|
4
|
+
"version": "3.0.0-alpha.8",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "vite build && yarn package",
|
|
@@ -18,21 +18,25 @@
|
|
|
18
18
|
"to-dev": "git checkout main && git pull origin main && git branch -d turnip/dev && git checkout -b turnip/dev"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@
|
|
21
|
+
"@eslint/compat": "^1.2.5",
|
|
22
|
+
"@eslint/js": "^9.18.0",
|
|
23
|
+
"@sveltejs/adapter-auto": "^4.0.0",
|
|
22
24
|
"@sveltejs/kit": "^2.5.27",
|
|
23
25
|
"@sveltejs/package": "^2.3.7",
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"eslint": "^
|
|
27
|
-
"eslint-
|
|
28
|
-
"
|
|
29
|
-
"prettier": "^3.2
|
|
30
|
-
"prettier-plugin-svelte": "^3.
|
|
26
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
27
|
+
"eslint": "^9.18.0",
|
|
28
|
+
"eslint-config-prettier": "^10.0.1",
|
|
29
|
+
"eslint-plugin-svelte": "^3.0.0",
|
|
30
|
+
"globals": "^16.0.0",
|
|
31
|
+
"prettier": "^3.4.2",
|
|
32
|
+
"prettier-plugin-svelte": "^3.3.3",
|
|
33
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
31
34
|
"prisma": "^5.12.1",
|
|
32
35
|
"svelte-check": "^4.0.0",
|
|
33
36
|
"svelte2tsx": "^0.6.20",
|
|
34
37
|
"tslib": "^2.4.1",
|
|
35
38
|
"typescript": "^5.5.0",
|
|
39
|
+
"typescript-eslint": "^8.20.0",
|
|
36
40
|
"vite": "^5.4.4"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
@@ -40,7 +44,6 @@
|
|
|
40
44
|
"@prisma/client": "^5.12.1",
|
|
41
45
|
"@skeletonlabs/skeleton": "^3.1.0",
|
|
42
46
|
"@skeletonlabs/skeleton-svelte": "^1.0.0",
|
|
43
|
-
"@sveltejs/kit": "^2.5.27",
|
|
44
47
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
45
48
|
"@tailwindcss/vite": "^4.0.14",
|
|
46
49
|
"@types/htmlparser2": "^3.10.7",
|
|
@@ -87,6 +90,9 @@
|
|
|
87
90
|
"src/lib/styles/app.css",
|
|
88
91
|
"src/lib/theme.css"
|
|
89
92
|
],
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">=22"
|
|
95
|
+
},
|
|
90
96
|
"repository": "https://github.com/TurnipXenon/pineapple",
|
|
91
97
|
"author": "turnipxenon <turnipxenon@gmail.com>",
|
|
92
98
|
"license": "MIT",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
isVisible?: boolean;
|
|
3
|
-
children?: import('svelte').Snippet;
|
|
4
|
-
}
|
|
5
|
-
declare const ElementVisbilityDetector: import("svelte").Component<Props, {}, "isVisible">;
|
|
6
|
-
type ElementVisbilityDetector = ReturnType<typeof ElementVisbilityDetector>;
|
|
7
|
-
export default ElementVisbilityDetector;
|