@functionalcms/svelte-components 0.9.2 → 0.10.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.
@@ -1,26 +1,25 @@
1
1
  <script>import { Header, HeaderNav, HeaderNavItem, MenuItem } from "agnostic-svelte";
2
+ import Logo from "./Logo.svelte";
2
3
  import { Visiblity } from "./HeaderNavigationItem.js";
3
- import { get } from "svelte/store";
4
+ import { Position } from "./Position";
4
5
  export let companyName;
5
- export let logoUrl;
6
- export let pages;
7
- export let authentication;
8
- const selectVisible = (pages2, visiblity) => {
9
- console.log(visiblity);
10
- return pages2.filter((page) => page.visiblity === Visiblity.Always || page.visiblity === visiblity);
11
- };
6
+ export let pages = [];
7
+ export let authentication = false;
8
+ export let logoPosition = Position.Left;
9
+ const selectVisible = (pages2, visiblity) => pages2.filter(
10
+ (page) => page?.visiblity === Visiblity.Always || page?.visiblity === visiblity
11
+ );
12
12
  $:
13
13
  visibility = authentication ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
14
14
  $:
15
15
  visibleNavItems = selectVisible(pages, visibility);
16
16
  </script>
17
- <div class="header">
17
+
18
+ <header>
18
19
  <Header>
19
- <div slot="logoleft">
20
- <a href="/">
21
- <img src={logoUrl} alt={companyName} />
22
- </a>
23
- </div>
20
+ {#if logoPosition == Position.Left}
21
+ <Logo slot="logoright" {companyName} />
22
+ {/if}
24
23
  <HeaderNav>
25
24
  {#each visibleNavItems as page}
26
25
  <HeaderNavItem>
@@ -30,5 +29,8 @@ $:
30
29
  </HeaderNavItem>
31
30
  {/each}
32
31
  </HeaderNav>
32
+ {#if logoPosition == Position.Right}
33
+ <Logo slot="logoright" {companyName} />
34
+ {/if}
33
35
  </Header>
34
- </div>
36
+ </header>
@@ -1,19 +1,20 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { Position } from "./Position";
2
3
  import type { HeaderNavigationItem } from './HeaderNavigationItem.js';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  /**
6
7
  * @type {string}
7
8
  */ companyName: string;
8
- /**
9
- * @type {string}
10
- */ logoUrl: string;
11
9
  /**
12
10
  * @type {HeaderNavigationItem[]}
13
- */ pages: HeaderNavigationItem[];
11
+ */ pages?: HeaderNavigationItem[] | undefined;
14
12
  /**
15
13
  * @type {Readonly<bool>}
16
- */ authentication: boolean;
14
+ */ authentication?: boolean | undefined;
15
+ /**
16
+ * @type {Position}
17
+ */ logoPosition?: Position | undefined;
17
18
  };
18
19
  events: {
19
20
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,10 @@
1
+ <script>import { Position } from "./Position";
2
+ import logoUrl from "../images/logo.png";
3
+ export let companyName;
4
+ </script>
5
+
6
+ <div>
7
+ <a href="/">
8
+ <img src={logoUrl} alt={companyName} />
9
+ </a>
10
+ </div>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ /**
5
+ * @type {string}
6
+ */ companyName: string;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {};
12
+ };
13
+ export type LogoProps = typeof __propDef.props;
14
+ export type LogoEvents = typeof __propDef.events;
15
+ export type LogoSlots = typeof __propDef.slots;
16
+ export default class Logo extends SvelteComponent<LogoProps, LogoEvents, LogoSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare enum Position {
2
+ Left = 0,
3
+ Middle = 1,
4
+ Right = 2
5
+ }
@@ -0,0 +1,6 @@
1
+ export var Position;
2
+ (function (Position) {
3
+ Position[Position["Left"] = 0] = "Left";
4
+ Position[Position["Middle"] = 1] = "Middle";
5
+ Position[Position["Right"] = 2] = "Right";
6
+ })(Position || (Position = {}));
@@ -0,0 +1,28 @@
1
+ <script>
2
+ /**
3
+ * @type {string}
4
+ */
5
+ export let companyName = "";
6
+ /**
7
+ * @type {string}
8
+ */
9
+ export let motto = "";
10
+
11
+ import logoUrl from '../images/logo_footer.png'
12
+ </script>
13
+
14
+ <footer class="footer">
15
+ <aside class="items-center grid-flow-col">
16
+ <img src={logoUrl} alt={companyName} />
17
+ <p>{motto}</p>
18
+ <p>Copyright © 2023 - All right reserved by {companyName}</p>
19
+ <p>Powerd by <a href="https://functional-cms.com">Functional CMS</a></p>
20
+ </aside>
21
+ </footer>
22
+
23
+ <style>
24
+ footer {
25
+ text-align: center;
26
+ font-size: smaller;
27
+ }
28
+ </style>
@@ -0,0 +1,25 @@
1
+ /** @typedef {typeof __propDef.props} SimpleFooterProps */
2
+ /** @typedef {typeof __propDef.events} SimpleFooterEvents */
3
+ /** @typedef {typeof __propDef.slots} SimpleFooterSlots */
4
+ export default class SimpleFooter extends SvelteComponent<{
5
+ companyName?: string | undefined;
6
+ motto?: string | undefined;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {}> {
10
+ }
11
+ export type SimpleFooterProps = typeof __propDef.props;
12
+ export type SimpleFooterEvents = typeof __propDef.events;
13
+ export type SimpleFooterSlots = typeof __propDef.slots;
14
+ import { SvelteComponent } from "svelte";
15
+ declare const __propDef: {
16
+ props: {
17
+ companyName?: string | undefined;
18
+ motto?: string | undefined;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {};
24
+ };
25
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import Box from './components/Box.svelte';
2
2
  import Hero from './components/Hero.svelte';
3
3
  import Header from './components/Header.svelte';
4
- import Footer from './components/Footer.svelte';
4
+ import SimpleFooter from './components/Footer.svelte';
5
5
  import { authStore } from './authStore.js';
6
6
  import { Visiblity, HeaderNavigationItem } from './components/HeaderNavigationItem.js';
7
- export { Box, Hero, Header, Footer, authStore, Visiblity, HeaderNavigationItem };
7
+ import { Position } from './components/Position.js';
8
+ export { Box, Hero, Header, SimpleFooter, authStore, Visiblity, HeaderNavigationItem, Position };
package/dist/index.js CHANGED
@@ -2,7 +2,8 @@
2
2
  import Box from './components/Box.svelte';
3
3
  import Hero from './components/Hero.svelte';
4
4
  import Header from './components/Header.svelte';
5
- import Footer from './components/Footer.svelte';
5
+ import SimpleFooter from './components/Footer.svelte';
6
6
  import { authStore } from './authStore.js';
7
7
  import { Visiblity, HeaderNavigationItem } from './components/HeaderNavigationItem.js';
8
- export { Box, Hero, Header, Footer, authStore, Visiblity, HeaderNavigationItem };
8
+ import { Position } from './components/Position.js';
9
+ export { Box, Hero, Header, SimpleFooter, authStore, Visiblity, HeaderNavigationItem, Position };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "0.9.2",
3
+ "version": "0.10.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,26 +0,0 @@
1
- <script>
2
- /**
3
- * @type {string}
4
- */
5
- export let companyName;
6
- /**
7
- * @type {string}
8
- */
9
- export let motto;
10
- /**
11
- * @type {string}
12
- */
13
- export let logoUrl;
14
- </script>
15
-
16
- <footer class="footer">
17
- <aside class="items-center grid-flow-col">
18
- <img src={logoUrl} alt={companyName} />
19
- <p>{motto}</p>
20
- <p>Copyright © 2023 - All right reserved by {companyName}</p>
21
- <p>Powerd by Functional CMS</p>
22
- </aside>
23
- </footer>
24
-
25
- <style>
26
- </style>
@@ -1,27 +0,0 @@
1
- /** @typedef {typeof __propDef.props} FooterProps */
2
- /** @typedef {typeof __propDef.events} FooterEvents */
3
- /** @typedef {typeof __propDef.slots} FooterSlots */
4
- export default class Footer extends SvelteComponent<{
5
- companyName: string;
6
- motto: string;
7
- logoUrl: string;
8
- }, {
9
- [evt: string]: CustomEvent<any>;
10
- }, {}> {
11
- }
12
- export type FooterProps = typeof __propDef.props;
13
- export type FooterEvents = typeof __propDef.events;
14
- export type FooterSlots = typeof __propDef.slots;
15
- import { SvelteComponent } from "svelte";
16
- declare const __propDef: {
17
- props: {
18
- companyName: string;
19
- motto: string;
20
- logoUrl: string;
21
- };
22
- events: {
23
- [evt: string]: CustomEvent<any>;
24
- };
25
- slots: {};
26
- };
27
- export {};