@turnipxenon/pineapple 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-check-dark-contrast.svg +1 -0
- package/dist/assets/icons/icon-check-light-contrast.svg +1 -0
- package/dist/assets/icons/icon-copy-dark-contrast.svg +1 -0
- package/dist/assets/icons/icon-copy-light-contrast.svg +1 -0
- package/dist/components/PineappleSlideToggle.svelte +12 -6
- package/dist/components/PineappleSlideToggle.svelte.d.ts +3 -2
- package/dist/styles/app.css +92 -1
- package/dist/styles/turnip-theme.css +6 -2
- package/dist/template/seaweed/CreateUrlForm.svelte +17 -11
- package/dist/template/seaweed/CreateUrlForm.svelte.d.ts +4 -1
- package/dist/template/seaweed/ToastSettings.d.ts +15 -0
- package/dist/template/seaweed/ToastSettings.js +1 -0
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte +34 -1
- package/dist/template/seaweed/entry_order_config/EntryOrderConfig.svelte.d.ts +0 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +65 -0
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte.d.ts +5 -0
- package/dist/ui/elements/CodeBlock/CodeBlockProps.d.ts +11 -0
- package/dist/ui/elements/CodeBlock/CodeBlockProps.js +1 -0
- package/dist/ui/elements/CodeBlock/index.d.ts +2 -0
- package/dist/ui/elements/CodeBlock/index.js +2 -0
- package/dist/ui/elements/PineappleSwitch.svelte +29 -0
- package/dist/ui/elements/PineappleSwitch.svelte.d.ts +10 -0
- package/dist/ui/elements/index.d.ts +10 -8
- package/dist/ui/elements/index.js +10 -8
- package/dist/ui/elements/pinya-card/component.svelte +10 -8
- package/dist/ui/elements/pinya-card/component.svelte.d.ts +3 -3
- package/dist/ui/elements/pinya-card/props.d.ts +3 -0
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +35 -0
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte.d.ts +18 -0
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.d.ts +18 -0
- package/dist/ui/elements/pinya-combobox/PinyaComboboxProps.js +1 -0
- package/dist/ui/elements/text-chip/TextChip.svelte +15 -0
- package/dist/ui/elements/text-chip/TextChip.svelte.d.ts +4 -0
- package/dist/ui/elements/text-chip/TextChipProps.d.ts +4 -0
- package/dist/ui/elements/text-chip/TextChipProps.js +1 -0
- package/dist/ui/elements/text-chip/index.d.ts +2 -0
- package/dist/ui/elements/text-chip/index.js +2 -0
- package/dist/ui/modules/index.d.ts +2 -1
- package/dist/ui/modules/index.js +2 -1
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +10 -20
- package/dist/ui/modules/projects/Hepcat.svelte +71 -0
- package/dist/ui/modules/projects/Hepcat.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/Pengi.svelte +60 -0
- package/dist/ui/modules/projects/Pengi.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/Soulwork.svelte +55 -0
- package/dist/ui/modules/projects/Soulwork.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/ThisWebpage.svelte +62 -0
- package/dist/ui/modules/projects/ThisWebpage.svelte.d.ts +22 -0
- package/dist/ui/modules/projects/index.d.ts +4 -0
- package/dist/ui/modules/projects/index.js +4 -0
- package/dist/ui/modules/seaweed/ChumBucket.svelte +36 -37
- package/dist/ui/templates/PinyaBase.svelte +9 -6
- package/dist/ui/templates/PinyaBase.svelte.d.ts +1 -1
- package/dist/ui/templates/index.d.ts +3 -2
- package/dist/ui/templates/index.js +3 -2
- package/dist/ui/templates/pinya-page-layout/component.svelte +17 -10
- package/dist/ui/templates/pinya-page-layout/component.svelte.d.ts +2 -1
- package/dist/ui/templates/seaweed-layout/EntryGroup.svelte +89 -0
- package/dist/ui/templates/seaweed-layout/EntryGroup.svelte.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte +45 -0
- package/dist/ui/templates/seaweed-layout/EntryOrderConfig2.svelte.d.ts +9 -0
- package/dist/ui/templates/seaweed-layout/ProjectComponentProps.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/ProjectComponentProps.js +1 -0
- package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte +316 -0
- package/dist/ui/templates/seaweed-layout/ProjectGroupConfig.svelte.d.ts +14 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.md +4 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte +196 -0
- package/dist/ui/templates/seaweed-layout/SeaweedLayout.svelte.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/index.d.ts +4 -0
- package/dist/ui/templates/seaweed-layout/index.js +4 -0
- package/dist/ui/templates/seaweed-layout/props.d.ts +25 -0
- package/dist/ui/templates/seaweed-layout/props.js +1 -0
- package/dist/util/util.d.ts +1 -0
- package/dist/util/util.js +9 -0
- package/package.json +3 -1
- package/src/lib/styles/app.css +92 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { Snippet } from
|
|
3
|
-
import { m } from
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import { m } from "../../../paraglide/messages";
|
|
4
4
|
|
|
5
5
|
import AresLogo from "../../../assets/characters/ares/ares_logo.webp";
|
|
6
|
-
import SettingsLogo from
|
|
7
|
-
import RandomizedBackground from
|
|
8
|
-
import { modals } from
|
|
9
|
-
import GeneralSettingsModal from
|
|
10
|
-
import { localizeHref } from
|
|
11
|
-
import { appState } from
|
|
6
|
+
import SettingsLogo from "../../../assets/icons/icon-settings.svg";
|
|
7
|
+
import RandomizedBackground from "../../components/randomized-background/RandomizedBackground.svelte";
|
|
8
|
+
import { modals } from "svelte-modals";
|
|
9
|
+
import GeneralSettingsModal from "../../modules/modals/general-settings/GeneralSettingsModal.svelte";
|
|
10
|
+
import { localizeHref } from "../../../paraglide/runtime";
|
|
11
|
+
import { appState } from "..";
|
|
12
12
|
|
|
13
13
|
let {
|
|
14
14
|
children,
|
|
15
|
-
appBarLead = $bindable()
|
|
15
|
+
appBarLead = $bindable(),
|
|
16
|
+
footer
|
|
16
17
|
}: {
|
|
17
18
|
children: Snippet
|
|
18
19
|
appBarLead?: Snippet
|
|
20
|
+
footer?: Snippet
|
|
19
21
|
} = $props();
|
|
20
22
|
|
|
21
23
|
|
|
@@ -71,7 +73,12 @@
|
|
|
71
73
|
<div class="default-page-container">
|
|
72
74
|
{@render children?.()}
|
|
73
75
|
</div>
|
|
74
|
-
|
|
76
|
+
|
|
77
|
+
{#if footer}
|
|
78
|
+
{@render footer()}
|
|
79
|
+
{:else }
|
|
80
|
+
<div aria-hidden="true" class="footer-space"></div>
|
|
81
|
+
{/if}
|
|
75
82
|
|
|
76
83
|
|
|
77
84
|
<style>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
children: Snippet;
|
|
4
4
|
appBarLead?: Snippet;
|
|
5
|
+
footer?: Snippet;
|
|
5
6
|
};
|
|
6
7
|
declare const Component: import("svelte").Component<$$ComponentProps, {}, "appBarLead">;
|
|
7
8
|
type Component = ReturnType<typeof Component>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
3
|
+
import { PinyaCard } from "../../elements/index";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
title,
|
|
7
|
+
entryList
|
|
8
|
+
}: ProjectGroup = $props();
|
|
9
|
+
|
|
10
|
+
const isSpecial = entryList.length % 3 === 1;
|
|
11
|
+
|
|
12
|
+
let normalUiList: SnippetMeta[] = isSpecial
|
|
13
|
+
? [...entryList.slice(0, -4)]
|
|
14
|
+
: [...entryList];
|
|
15
|
+
let overflowUiList: SnippetMeta[] = isSpecial
|
|
16
|
+
? [...entryList.slice(-4)]
|
|
17
|
+
: [];
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// <!--todo: implement in seaweedlayout #migration-->
|
|
21
|
+
let inputValue = $state("");
|
|
22
|
+
let styleStr = $state("");
|
|
23
|
+
$effect(() => {
|
|
24
|
+
const termList = inputValue.split(",");
|
|
25
|
+
|
|
26
|
+
const chipList: string[] = [];
|
|
27
|
+
termList.forEach((_, idx) => {
|
|
28
|
+
termList[idx] = `.qt-${termList[idx]}`;
|
|
29
|
+
chipList.push(`.text-chip${termList[idx]}`);
|
|
30
|
+
});
|
|
31
|
+
styleStr = `<style>
|
|
32
|
+
${termList.join(", ")} {
|
|
33
|
+
font-weight: bold
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${chipList.join(", ")} {
|
|
37
|
+
background-color: var(--color-secondary-500) /* oklch(55.6% 0 0deg) = #737373 */;
|
|
38
|
+
color: var(--color-secondary-contrast-500) /* var(--color-secondary-contrast-light) */;
|
|
39
|
+
}
|
|
40
|
+
</style>`;
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div class="mt-8 flex flex-col items-center">
|
|
45
|
+
<PinyaCard widthClass="w-full" className="mb-8">
|
|
46
|
+
<h2>{title}</h2>
|
|
47
|
+
</PinyaCard>
|
|
48
|
+
<div class="normal-project-container">
|
|
49
|
+
{#each normalUiList as ui (ui.key)}
|
|
50
|
+
{@render ui.component({})}
|
|
51
|
+
{/each}
|
|
52
|
+
</div>
|
|
53
|
+
<div class="overflow-project-container">
|
|
54
|
+
{#each overflowUiList as ui (ui.key)}
|
|
55
|
+
{@render ui.component({})}
|
|
56
|
+
{/each}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<!--todo: implement in seaweedlayout #migration-->
|
|
61
|
+
<!--{@html styleStr}-->
|
|
62
|
+
|
|
63
|
+
<!-- Force tailwind to pickup some classes -->
|
|
64
|
+
<div class="hidden rounded-2xl hover:brightness-110"></div>
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
.normal-project-container {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
gap: 2rem;
|
|
71
|
+
margin: auto;
|
|
72
|
+
/* 3 containers + 2 gaps + extra rem */
|
|
73
|
+
max-width: calc((28rem * 3) + 5rem);
|
|
74
|
+
justify-content: center;
|
|
75
|
+
margin-bottom: 2rem;
|
|
76
|
+
align-items: start;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.overflow-project-container {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
gap: 2rem;
|
|
83
|
+
margin: auto;
|
|
84
|
+
/* 2 containers + 1 gap + extra rem */
|
|
85
|
+
max-width: calc((28rem * 2) + 3rem);
|
|
86
|
+
justify-content: center;
|
|
87
|
+
align-items: start;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
3
|
+
import ProjectGroupConfig from "./ProjectGroupConfig.svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
layout: ProjectGroup[];
|
|
7
|
+
orderUrl: string;
|
|
8
|
+
allEntries: SnippetMeta[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
layout = $bindable(),
|
|
13
|
+
orderUrl = $bindable(),
|
|
14
|
+
allEntries
|
|
15
|
+
}: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<br>
|
|
19
|
+
<h3>Site ordering</h3>
|
|
20
|
+
<blockquote>Sorry! This part of the website is still WIP, but here it is anyway. As long as it functions</blockquote>
|
|
21
|
+
|
|
22
|
+
<!-- formatting: group1:entry1|entry2,group2:entry3
|
|
23
|
+
: <= separates the group header, the entries, and the class
|
|
24
|
+
| <= separates each entries
|
|
25
|
+
, <= separates each group
|
|
26
|
+
-->
|
|
27
|
+
<div class="advanced-setting-list">
|
|
28
|
+
{#each layout as group, groupIndex (group.key)}
|
|
29
|
+
<ProjectGroupConfig
|
|
30
|
+
bind:layout={layout}
|
|
31
|
+
bind:orderUrl={orderUrl}
|
|
32
|
+
{allEntries}
|
|
33
|
+
{group}
|
|
34
|
+
{groupIndex}
|
|
35
|
+
/>
|
|
36
|
+
{/each}
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
.advanced-setting-list {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
2
|
+
interface Props {
|
|
3
|
+
layout: ProjectGroup[];
|
|
4
|
+
orderUrl: string;
|
|
5
|
+
allEntries: SnippetMeta[];
|
|
6
|
+
}
|
|
7
|
+
declare const EntryOrderConfig2: import("svelte").Component<Props, {}, "orderUrl" | "layout">;
|
|
8
|
+
type EntryOrderConfig2 = ReturnType<typeof EntryOrderConfig2>;
|
|
9
|
+
export default EntryOrderConfig2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CloseIcon from "../../../assets/icons/close.svg";
|
|
3
|
+
import UpwardIcon from "../../../assets/icons/arrow-upward.svg";
|
|
4
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
5
|
+
import { getContext, onMount } from "svelte";
|
|
6
|
+
import { PinyaCard } from "../../elements/index";
|
|
7
|
+
import PinyaCombobox from "../../elements/pinya-combobox/PinyaCombobox.svelte";
|
|
8
|
+
import { PinyaButton } from "../../elements/index.js";
|
|
9
|
+
import { type ToastContext } from "@skeletonlabs/skeleton-svelte";
|
|
10
|
+
|
|
11
|
+
export const toast: ToastContext = getContext("toast");
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
layout: ProjectGroup[];
|
|
15
|
+
orderUrl: string;
|
|
16
|
+
allEntries: SnippetMeta[];
|
|
17
|
+
group: ProjectGroup;
|
|
18
|
+
groupIndex: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
layout = $bindable(),
|
|
23
|
+
orderUrl = $bindable(),
|
|
24
|
+
allEntries,
|
|
25
|
+
group,
|
|
26
|
+
groupIndex
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
const updateOrderQuery = () => {
|
|
30
|
+
orderUrl = "order=" + layout.map(g => {
|
|
31
|
+
const groupUrl = g.entryList.map(e => e.key).join("|");
|
|
32
|
+
// the last item after : is a grid class but we're keeping it here for legacy reason
|
|
33
|
+
return `${g.title}:${groupUrl}:`;
|
|
34
|
+
}).join(",");
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const swapEntry = (index: number, group: ProjectGroup, shouldDecrement: boolean): (() => void) => {
|
|
38
|
+
return () => {
|
|
39
|
+
let newIndex = index;
|
|
40
|
+
if (shouldDecrement && index >= 1) {
|
|
41
|
+
newIndex--;
|
|
42
|
+
} else if (!shouldDecrement && index <= group.entryList.length - 2) {
|
|
43
|
+
newIndex++;
|
|
44
|
+
} else {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tempVar = group.entryList[newIndex];
|
|
49
|
+
group.entryList[newIndex] = group.entryList[index];
|
|
50
|
+
group.entryList[index] = tempVar;
|
|
51
|
+
layout = layout;
|
|
52
|
+
updateOrderQuery();
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const swapGroups = (index: number, shouldDecrement: boolean): (() => void) => {
|
|
56
|
+
return () => {
|
|
57
|
+
let newIndex = index;
|
|
58
|
+
if (shouldDecrement && index >= 1) {
|
|
59
|
+
newIndex--;
|
|
60
|
+
} else if (!shouldDecrement && index <= layout.length - 2) {
|
|
61
|
+
newIndex++;
|
|
62
|
+
} else {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const tempVar = layout[newIndex];
|
|
67
|
+
layout[newIndex] = layout[index];
|
|
68
|
+
layout[index] = tempVar;
|
|
69
|
+
layout = layout;
|
|
70
|
+
updateOrderQuery();
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const removeGroup = (group: ProjectGroup): (() => void) => {
|
|
75
|
+
return () => {
|
|
76
|
+
const index = layout.indexOf(group);
|
|
77
|
+
if (index === -1) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
layout.splice(index, 1);
|
|
82
|
+
layout = layout;
|
|
83
|
+
updateOrderQuery();
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const removeEntry = (entry: SnippetMeta, group: ProjectGroup): (() => void) => {
|
|
87
|
+
return () => {
|
|
88
|
+
for (let i = group.entryList.length - 1; i >= 0; i--) {
|
|
89
|
+
if (group.entryList[i].key === entry.key) {
|
|
90
|
+
group.entryList.splice(i, 1);
|
|
91
|
+
layout = layout;
|
|
92
|
+
updateOrderQuery();
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const comboboxData = allEntries.map(entry => {
|
|
100
|
+
return {
|
|
101
|
+
label: entry.key,
|
|
102
|
+
value: entry.key
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
let comboboxValue = $state([comboboxData[0].value]);
|
|
107
|
+
|
|
108
|
+
const addEntry = () => {
|
|
109
|
+
const c = allEntries.find(e => e.key === comboboxValue[0]);
|
|
110
|
+
|
|
111
|
+
if (!c) {
|
|
112
|
+
console.warn(`Unknown key: ${comboboxValue}`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (group.entryList.includes(c)) {
|
|
117
|
+
toast.create({
|
|
118
|
+
title: "Duplicate entry",
|
|
119
|
+
description: `The entry ${comboboxValue} is already in ${group.title}`,
|
|
120
|
+
type: "error"
|
|
121
|
+
});
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
group.entryList.push(c);
|
|
126
|
+
layout = layout;
|
|
127
|
+
updateOrderQuery();
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<PinyaCard
|
|
132
|
+
widthClass="max-w-2xl"
|
|
133
|
+
borderClass="border-[2px] border-primary-500"
|
|
134
|
+
marginClass="mt-4 mb-4"
|
|
135
|
+
paddingClass=""
|
|
136
|
+
>
|
|
137
|
+
|
|
138
|
+
<div class="m-4 flex flex-row gap-2">
|
|
139
|
+
<button title={`Remove ${group.title}`}
|
|
140
|
+
onclick={removeGroup(group)}>
|
|
141
|
+
<img class="img-icon" src={CloseIcon} alt={`Remove ${group.title}`}>
|
|
142
|
+
</button>
|
|
143
|
+
|
|
144
|
+
<button title={`Move group ${group.title} upwards`}
|
|
145
|
+
onclick={swapGroups(groupIndex, true)}
|
|
146
|
+
disabled="{groupIndex === 0}">
|
|
147
|
+
<img class="img-icon" src={UpwardIcon} alt={`Move group ${group.title} upwards`}>
|
|
148
|
+
</button>
|
|
149
|
+
|
|
150
|
+
<button title={`Move group ${group.title} downwards`}
|
|
151
|
+
disabled={groupIndex === layout.length - 1}
|
|
152
|
+
onclick={swapGroups(groupIndex, false)}>
|
|
153
|
+
<img
|
|
154
|
+
class="img-icon flipped-vertically"
|
|
155
|
+
src={UpwardIcon}
|
|
156
|
+
alt={`Move group ${group.title} downwards`}
|
|
157
|
+
>
|
|
158
|
+
</button>
|
|
159
|
+
|
|
160
|
+
<div class="fake-h3 ml-2">Group title: {group.title}</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<hr class="border-primary-500 border-1">
|
|
164
|
+
|
|
165
|
+
<table class="table">
|
|
166
|
+
<thead>
|
|
167
|
+
<tr>
|
|
168
|
+
<th class="fake-h4">Entries</th>
|
|
169
|
+
</tr>
|
|
170
|
+
</thead>
|
|
171
|
+
<tbody>
|
|
172
|
+
{#each group.entryList as entry, entryIndex (entry)}
|
|
173
|
+
<tr class="entry-row">
|
|
174
|
+
<td class="entry-data">
|
|
175
|
+
|
|
176
|
+
<button title={`Remove ${entry.key}`}
|
|
177
|
+
onclick={removeEntry(entry, group)}>
|
|
178
|
+
<img class="img-icon" src={CloseIcon} alt={`Remove ${entry.key}`}>
|
|
179
|
+
</button>
|
|
180
|
+
|
|
181
|
+
<button title={`Move ${entry.key} upwards`}
|
|
182
|
+
onclick={swapEntry(entryIndex, group, true)}
|
|
183
|
+
disabled="{entryIndex === 0}">
|
|
184
|
+
<img class="img-icon" src={UpwardIcon} alt={`Move ${entry.key} upwards`}>
|
|
185
|
+
</button>
|
|
186
|
+
|
|
187
|
+
<button title={`Move ${entry.key} downwards`}
|
|
188
|
+
disabled={entryIndex === group.key.length - 1}
|
|
189
|
+
onclick={swapEntry(entryIndex, group, false)}>
|
|
190
|
+
<img class="img-icon flipped-vertically" src={UpwardIcon} alt={`Move ${entry.key} downwards`}>
|
|
191
|
+
</button>
|
|
192
|
+
<div class="entry-name">
|
|
193
|
+
{entry.key}
|
|
194
|
+
</div>
|
|
195
|
+
</td>
|
|
196
|
+
</tr>
|
|
197
|
+
{/each}
|
|
198
|
+
</tbody>
|
|
199
|
+
|
|
200
|
+
<tfoot>
|
|
201
|
+
<tr>
|
|
202
|
+
<td class="combobox-container">
|
|
203
|
+
<PinyaButton onclick={addEntry}>Add Entry
|
|
204
|
+
</PinyaButton>
|
|
205
|
+
<PinyaCombobox
|
|
206
|
+
data={comboboxData}
|
|
207
|
+
defaultValue={comboboxValue}
|
|
208
|
+
bind:value={comboboxValue}
|
|
209
|
+
label="New entry"
|
|
210
|
+
placeholder="Add new entry"
|
|
211
|
+
contentZIndex="10"
|
|
212
|
+
/>
|
|
213
|
+
</td>
|
|
214
|
+
</tr>
|
|
215
|
+
</tfoot>
|
|
216
|
+
</table>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
</PinyaCard>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<style>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
.advanced-setting-list {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.btn-group-header {
|
|
231
|
+
@apply preset-filled-tertiary-500;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
margin-bottom: 0.5lh;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.btn-group-entry {
|
|
238
|
+
@apply ;
|
|
239
|
+
display: flex;
|
|
240
|
+
padding: 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.btn-group-entry > div {
|
|
244
|
+
padding: 1em;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.flipped-vertically {
|
|
248
|
+
transform: rotate(180deg);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.entry-group {
|
|
252
|
+
border-radius: var(--theme-rounded-container);
|
|
253
|
+
background-color: rgb(var(--color-surface-600));
|
|
254
|
+
margin-top: 1.5lh;
|
|
255
|
+
margin-bottom: 0.5lh;
|
|
256
|
+
padding: 0.5lh 0.5em;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.entry-name {
|
|
260
|
+
grow: 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
tr, td, th, table {
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
table {
|
|
268
|
+
margin-bottom: 1lh;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
tfoot > tr {
|
|
272
|
+
display: flex;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.btn-group > button {
|
|
276
|
+
padding: 0.3em 0.75em;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.btn-group-header > h2 {
|
|
280
|
+
font-weight: bolder;
|
|
281
|
+
padding-top: 1lh;
|
|
282
|
+
padding-bottom: 1lh;
|
|
283
|
+
margin-bottom: 0;
|
|
284
|
+
padding-inline-start: 1em;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.dark .btn-group-header > h2 {
|
|
288
|
+
color: rgb(var(--theme-font-color-dark));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.dark .entry-group {
|
|
292
|
+
background-color: rgb(var(--color-surface-800));
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
tbody tr:nth-child(odd) {
|
|
297
|
+
background-color: var(--color-surface-100-900);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
tbody tr:nth-child(even), thead {
|
|
301
|
+
background-color: var(--color-surface-300-700);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.entry-data {
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: row;
|
|
307
|
+
gap: 1rem;
|
|
308
|
+
align-items: center;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.combobox-container {
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: row;
|
|
314
|
+
gap: 1em;
|
|
315
|
+
}
|
|
316
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProjectGroup, SnippetMeta } from "../index";
|
|
2
|
+
import { type ToastContext } from "@skeletonlabs/skeleton-svelte";
|
|
3
|
+
interface Props {
|
|
4
|
+
layout: ProjectGroup[];
|
|
5
|
+
orderUrl: string;
|
|
6
|
+
allEntries: SnippetMeta[];
|
|
7
|
+
group: ProjectGroup;
|
|
8
|
+
groupIndex: number;
|
|
9
|
+
}
|
|
10
|
+
declare const ProjectGroupConfig: import("svelte").Component<Props, {
|
|
11
|
+
toast: ToastContext;
|
|
12
|
+
}, "orderUrl" | "layout">;
|
|
13
|
+
type ProjectGroupConfig = ReturnType<typeof ProjectGroupConfig>;
|
|
14
|
+
export default ProjectGroupConfig;
|