@functionalcms/svelte-components 5.25.1 → 5.26.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.
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { m } from "../../paraglide/messages";
|
|
3
|
+
import {
|
|
4
|
+
ButtonGroup,
|
|
5
|
+
Spinner,
|
|
6
|
+
} from "@functionalcms/svelte-components";
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
children: Snippet<[Array<any>]>;
|
|
11
|
+
buttons: Snippet;
|
|
12
|
+
header: string;
|
|
13
|
+
content: Promise<any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { children, buttons, header, content }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#await content}
|
|
20
|
+
<div class="w-full h-full flex flex-col items-center justify-center">
|
|
21
|
+
<p>{m.common_loading({ item: "files" })}</p>
|
|
22
|
+
<Spinner size="16" type="bars" />
|
|
23
|
+
</div>
|
|
24
|
+
{:then items}
|
|
25
|
+
<article>
|
|
26
|
+
<header>
|
|
27
|
+
<h1>{header}</h1>
|
|
28
|
+
<ButtonGroup>
|
|
29
|
+
{@render buttons?.()}
|
|
30
|
+
</ButtonGroup>
|
|
31
|
+
</header>
|
|
32
|
+
<div>
|
|
33
|
+
{@render children?.(items)}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
</article>
|
|
37
|
+
{:catch err}
|
|
38
|
+
<p>Error: {err.message}</p>
|
|
39
|
+
{/await}
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
@reference "tailwindcss";
|
|
43
|
+
article {
|
|
44
|
+
height: 100%;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
}
|
|
48
|
+
article > div {
|
|
49
|
+
flex: 1;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
}
|
|
52
|
+
header {
|
|
53
|
+
@apply mt-6 flex shrink-0;
|
|
54
|
+
}
|
|
55
|
+
h1 {
|
|
56
|
+
@apply uppercase w-1/5;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type PageProps = typeof __propDef.props;
|
|
10
|
+
export type PageEvents = typeof __propDef.events;
|
|
11
|
+
export type PageSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Page extends SvelteComponentTyped<PageProps, PageEvents, PageSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { m } from "../../paraglide/messages";
|
|
3
|
+
import {
|
|
4
|
+
ButtonGroup,
|
|
5
|
+
Spinner,
|
|
6
|
+
} from "@functionalcms/svelte-components";
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
children: Snippet<[Array<any>]>;
|
|
11
|
+
buttons: Snippet;
|
|
12
|
+
header: string;
|
|
13
|
+
content: Promise<any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { children, buttons, header, content }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#await content}
|
|
20
|
+
<div class="w-full h-full flex flex-col items-center justify-center">
|
|
21
|
+
<p>{m.common_loading({ item: "files" })}</p>
|
|
22
|
+
<Spinner size="16" type="bars" />
|
|
23
|
+
</div>
|
|
24
|
+
{:then items}
|
|
25
|
+
<article>
|
|
26
|
+
<header>
|
|
27
|
+
<h1>{header}</h1>
|
|
28
|
+
<ButtonGroup>
|
|
29
|
+
{@render buttons?.()}
|
|
30
|
+
</ButtonGroup>
|
|
31
|
+
</header>
|
|
32
|
+
<div>
|
|
33
|
+
{@render children?.(items)}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
</article>
|
|
37
|
+
{:catch err}
|
|
38
|
+
<p>Error: {err.message}</p>
|
|
39
|
+
{/await}
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
@reference "tailwindcss";
|
|
43
|
+
article {
|
|
44
|
+
height: 100%;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
}
|
|
48
|
+
article > div {
|
|
49
|
+
flex: 1;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
}
|
|
52
|
+
header {
|
|
53
|
+
@apply mt-6 flex shrink-0;
|
|
54
|
+
}
|
|
55
|
+
h1 {
|
|
56
|
+
@apply uppercase w-1/5;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type PageProps = typeof __propDef.props;
|
|
10
|
+
export type PageEvents = typeof __propDef.events;
|
|
11
|
+
export type PageSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Page extends SvelteComponentTyped<PageProps, PageEvents, PageSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,3 +25,4 @@ export { type getTags } from './components/blog/blogService.js';
|
|
|
25
25
|
export { getPosts } from './components/blog/blogService.js';
|
|
26
26
|
export { Tree } from '@keenmate/svelte-treeview';
|
|
27
27
|
export { default as EmptyState } from './components/content/EmptyState.svelte';
|
|
28
|
+
export { default as Page } from './components/content/Page.svelte';
|
package/dist/index.js
CHANGED
|
@@ -24,3 +24,4 @@ export {} from './components/blog/blogService.js';
|
|
|
24
24
|
export { getPosts } from './components/blog/blogService.js';
|
|
25
25
|
export { Tree } from '@keenmate/svelte-treeview';
|
|
26
26
|
export { default as EmptyState } from './components/content/EmptyState.svelte';
|
|
27
|
+
export { default as Page } from './components/content/Page.svelte';
|