@functionalcms/svelte-components 2.29.0 → 2.30.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.
@@ -1,3 +1,3 @@
1
1
  import { type Handle } from '@sveltejs/kit';
2
- declare const authorizationHandle: (protectedPaths: Array<string>) => Handle;
2
+ declare const authorizationHandle: () => Handle;
3
3
  export default authorizationHandle;
@@ -1,14 +1,13 @@
1
1
  import { redirect } from '@sveltejs/kit';
2
- const authorizationHandle = (protectedPaths) => {
2
+ const authorizationHandle = () => {
3
3
  return async ({ event, resolve }) => {
4
4
  const path = event.url.pathname;
5
5
  if (path.startsWith('/auth/') === false) {
6
- for (let protectedPath of protectedPaths) {
7
- if (path.match(protectedPath)) {
8
- const session = event?.locals?.session;
9
- if (!session) {
10
- return new Response('Login user', { status: 303, headers: { location: '/auth/login' } });
11
- }
6
+ const route = event.route;
7
+ if (route.id.includes('/(protect)/')) {
8
+ const session = event?.locals?.session;
9
+ if (!session) {
10
+ return new Response('Login user', { status: 303, headers: { location: '/auth/login' } });
12
11
  }
13
12
  }
14
13
  }
@@ -9,20 +9,22 @@ export let orientation = Orientation.Column;
9
9
  export let localPages = [];
10
10
  $: showContent = false;
11
11
  $: showContentBeforeButton = contentPosition == Placement.Start;
12
- const contentKlasses = [contentCss].filter((c) => c).join(" ");
13
12
  </script>
14
13
 
15
14
  {#if showContent && showContentBeforeButton}
16
- <ColumnMenu {localPages} {orientation} css={contentKlasses} />
15
+ <ColumnMenu {localPages} {orientation} css={contentCss} />
17
16
  {/if}
18
-
19
- <Button css={buttonCss} on:click={() => (showContent = !showContent)}>
20
- <slot name="handle">&#9776;</slot>
21
- </Button>
22
-
17
+ <div>
18
+ <Button css={buttonCss} on:click={() => (showContent = !showContent)}>
19
+ <slot name="handle">&#9776;</slot>
20
+ </Button>
21
+ </div>
23
22
  {#if showContent && !showContentBeforeButton}
24
- <ColumnMenu {localPages} {orientation} css={contentKlasses} />
23
+ <ColumnMenu {localPages} {orientation} css={contentCss} />
25
24
  {/if}
26
25
 
27
26
  <style>
27
+ div {
28
+ margin: var(--fluid-8);
29
+ }
28
30
  </style>
@@ -1,6 +1,6 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { Orientation, Placement } from "../Styling.js";
3
- import { HeaderNavigationItem } from "./Menu.js";
2
+ import { Orientation, Placement } from '../Styling.js';
3
+ import { HeaderNavigationItem } from './Menu.js';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  buttonCss?: string;
@@ -18,9 +18,6 @@ const klasses = ["flex", orientation, css ? css : ""].filter((c) => c).join(" ")
18
18
  <Link href={pageItem.path} css={linkCss}>
19
19
  {pageItem.name}
20
20
  </Link>
21
- <!-- <a on:click={pageItem.action} href={pageItem.path}>
22
- {pageItem.name}
23
- </a> -->
24
21
  </li>
25
22
  {/each}
26
23
  </ul>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [