@functionalcms/svelte-components 2.22.0 → 2.23.0
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/auth/redisSessionProvider.js +1 -1
- package/dist/components/menu/CollapsibleMenu.svelte +22 -0
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +22 -0
- package/dist/components/menu/ColumnMenu.svelte +13 -11
- package/dist/components/menu/ColumnMenu.svelte.d.ts +2 -0
- package/dist/components/menu/HamburgerButton.svelte +15 -0
- package/dist/components/menu/HamburgerButton.svelte.d.ts +19 -0
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ async function createSession(session, maxAge) {
|
|
|
14
14
|
data: session,
|
|
15
15
|
invalidAt: Date.now() + maxAge
|
|
16
16
|
};
|
|
17
|
-
await redis.set(sid, JSON.stringify(sessionObject));
|
|
17
|
+
await redis.set(sid, JSON.stringify(sessionObject), "EX", maxAge);
|
|
18
18
|
return sid;
|
|
19
19
|
}
|
|
20
20
|
async function getSession(sid) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import {
|
|
2
|
+
HeaderNavigationItem,
|
|
3
|
+
Drawer,
|
|
4
|
+
Button,
|
|
5
|
+
Placement,
|
|
6
|
+
ColumnMenu
|
|
7
|
+
} from "@functionalcms/svelte-components";
|
|
8
|
+
export let buttonCss = "";
|
|
9
|
+
export let contentCss = "";
|
|
10
|
+
export let noBorder = false;
|
|
11
|
+
export let localPages = [];
|
|
12
|
+
$: showContent = false;
|
|
13
|
+
let drawer = null;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<Button css={buttonCss} on:click={() => (showContent = !showContent)}>☰</Button>
|
|
17
|
+
{#if showContent}
|
|
18
|
+
<ColumnMenu {localPages} css={contentCss} />
|
|
19
|
+
{/if}
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { HeaderNavigationItem } from "@functionalcms/svelte-components";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
buttonCss?: string;
|
|
6
|
+
contentCss?: string;
|
|
7
|
+
noBorder?: boolean;
|
|
8
|
+
localPages?: Array<HeaderNavigationItem>;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type CollapsibleMenuProps = typeof __propDef.props;
|
|
18
|
+
export type CollapsibleMenuEvents = typeof __propDef.events;
|
|
19
|
+
export type CollapsibleMenuSlots = typeof __propDef.slots;
|
|
20
|
+
export default class CollapsibleMenu extends SvelteComponent<CollapsibleMenuProps, CollapsibleMenuEvents, CollapsibleMenuSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
<script>import { HeaderNavigationItem } from "./Menu.js";
|
|
2
2
|
import { page } from "$app/stores";
|
|
3
3
|
import { isSelected } from "./MenuFunctions.js";
|
|
4
|
+
import { Orientation } from "../Styling.js";
|
|
4
5
|
export let css = "";
|
|
5
6
|
export let localPages = [];
|
|
7
|
+
export let orientation = Orientation.Column;
|
|
6
8
|
export let includeSubpagesForSelect = false;
|
|
7
|
-
const klasses = ["flex",
|
|
9
|
+
const klasses = ["flex", orientation, css ? css : ""].filter((c) => c).join(" ");
|
|
8
10
|
</script>
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
<ul class={klasses}>
|
|
13
|
+
{#each localPages as pageItem}
|
|
14
|
+
<li aria-current={isSelected(includeSubpagesForSelect, $page, pageItem)}>
|
|
15
|
+
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
16
|
+
<a on:click={pageItem.action} href={pageItem.path}>
|
|
17
|
+
{pageItem.name}
|
|
18
|
+
</a>
|
|
19
|
+
</li>
|
|
20
|
+
{/each}
|
|
21
|
+
</ul>
|
|
20
22
|
|
|
21
23
|
<style>
|
|
22
24
|
ul {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { HeaderNavigationItem } from './Menu.js';
|
|
3
|
+
import { Orientation } from '../Styling.js';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
css?: string;
|
|
6
7
|
localPages?: Array<HeaderNavigationItem>;
|
|
8
|
+
orientation?: Orientation;
|
|
7
9
|
includeSubpagesForSelect?: boolean;
|
|
8
10
|
};
|
|
9
11
|
events: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>import { Button } from "@functionalcms/svelte-components";
|
|
2
|
+
export let css = "";
|
|
3
|
+
export let noBorder = false;
|
|
4
|
+
const klasses = [css ? css : "", noBorder ? "no-border" : ""].filter((c) => c).join(" ");
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<Button
|
|
8
|
+
type="button"
|
|
9
|
+
data-a11y-dialog-show="hamburger-menu"
|
|
10
|
+
mode="primary"
|
|
11
|
+
noBorder
|
|
12
|
+
css={klasses}
|
|
13
|
+
>
|
|
14
|
+
☰
|
|
15
|
+
</Button>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
css?: string;
|
|
5
|
+
noBorder?: boolean;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type HamburgerButtonProps = typeof __propDef.props;
|
|
15
|
+
export type HamburgerButtonEvents = typeof __propDef.events;
|
|
16
|
+
export type HamburgerButtonSlots = typeof __propDef.slots;
|
|
17
|
+
export default class HamburgerButton extends SvelteComponent<HamburgerButtonProps, HamburgerButtonEvents, HamburgerButtonSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|