@functionalcms/svelte-components 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -1,58 +1,20 @@
1
- # create-svelte
2
-
3
- Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4
-
5
- Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
6
-
7
- ## Creating a project
8
-
9
- If you're seeing this, you've probably already done this step. Congrats!
10
-
11
- ```bash
12
- # create a new project in the current directory
13
- npm create svelte@latest
14
-
15
- # create a new project in my-app
16
- npm create svelte@latest my-app
17
- ```
18
-
19
- ## Developing
20
-
21
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
-
23
- ```bash
24
- npm run dev
25
-
26
- # or start the server and open the app in a new browser tab
27
- npm run dev -- --open
28
- ```
29
-
30
- Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
-
32
- ## Building
33
-
34
- To build your library:
35
-
36
- ```bash
37
- npm run package
38
- ```
39
-
40
- To create a production version of your showcase app:
41
-
42
- ```bash
43
- npm run build
44
- ```
45
-
46
- You can preview the production build with `npm run preview`.
47
-
48
- > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
49
-
50
- ## Publishing
51
-
52
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
-
54
- To publish your library to [npm](https://www.npmjs.com):
55
-
56
- ```bash
57
- npm publish
58
- ```
1
+ # Introduction
2
+ TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.
3
+
4
+ # Getting Started
5
+ TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:
6
+ 1. Installation process
7
+ 2. Software dependencies
8
+ 3. Latest releases
9
+ 4. API references
10
+
11
+ # Build and Test
12
+ TODO: Describe and show how to build your code and run the tests.
13
+
14
+ # Contribute
15
+ TODO: Explain how other users and developers can contribute to make your code better.
16
+
17
+ If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files:
18
+ - [ASP.NET Core](https://github.com/aspnet/Home)
19
+ - [Visual Studio Code](https://github.com/Microsoft/vscode)
20
+ - [Chakra Core](https://github.com/Microsoft/ChakraCore)
@@ -1,13 +1,23 @@
1
1
  <script>
2
- import logo from '../assets/emblem-reverse.png';
3
- import { constants } from '../constants';
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;
4
14
  </script>
5
15
 
6
16
  <footer class="flex-shrink-0">
7
17
  <aside class="items-center grid-flow-col">
8
- <img src={logo} alt="logo" />
9
- <p>{constants.Motto}</p>
10
- <p>Copyright © 2023 - All right reserved by {constants.Company}</p>
18
+ <img src={logoUrl} alt={companyName} />
19
+ <p>{motto}</p>
20
+ <p>Copyright © 2023 - All right reserved by {companyName}</p>
11
21
  <p>Powerd by Functional CMS</p>
12
22
  </aside>
13
23
  </footer>
@@ -2,7 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} FooterEvents */
3
3
  /** @typedef {typeof __propDef.slots} FooterSlots */
4
4
  export default class Footer extends SvelteComponent<{
5
- [x: string]: never;
5
+ companyName: string;
6
+ motto: string;
7
+ logoUrl: string;
6
8
  }, {
7
9
  [evt: string]: CustomEvent<any>;
8
10
  }, {}> {
@@ -13,7 +15,9 @@ export type FooterSlots = typeof __propDef.slots;
13
15
  import { SvelteComponent } from "svelte";
14
16
  declare const __propDef: {
15
17
  props: {
16
- [x: string]: never;
18
+ companyName: string;
19
+ motto: string;
20
+ logoUrl: string;
17
21
  };
18
22
  events: {
19
23
  [evt: string]: CustomEvent<any>;
@@ -1,49 +1,61 @@
1
1
  <script>
2
2
  // @ts-nocheck
3
-
4
3
  import { Header, HeaderNav, HeaderNavItem } from "agnostic-svelte";
5
- import logo from "../assets/logo.png";
6
- import { constants } from "../constants";
4
+
5
+ /**
6
+ * @type {string}
7
+ */
8
+ export let companyName;
9
+ /**
10
+ * @type {string}
11
+ */
12
+ export let logoUrl;
13
+ /**
14
+ * @type {array}
15
+ */
16
+ export let pages;
17
+ // import logo from "../assets/logo.png";
18
+ // import { constants } from "../constants";
7
19
 
8
- const { url } = import.meta;
9
- const modules = import.meta.glob("../../routes/*/*.svelte");
10
- const navItems = constants.Navigation;
20
+ // const { url } = import.meta;
21
+ // const modules = import.meta.glob("../../routes/*/*.svelte");
22
+ // const navItems = constants.Navigation;
11
23
 
12
- function getPages(url, modules) {
13
- const directory = url
14
- .replace(/(.*?)\/src\/lib\/components\//, "/")
15
- .replace(/(.*?)\/src\/routes\//, "/")
16
- .replace(/(.*?)\/immutable\/pages\//, "/")
17
- .replace(/(.*?)\/var\/task\//, "/") // Vercel
18
- .replace(/\/([^/])*.svelte.*/, "/");
19
- const pageRegex = /\/\+page\.svelte$/;
20
- const paths = Object.keys(modules)
21
- .map((path) => path.replace(/^(.\/)/, directory))
22
- .filter((path) => !/\[.*\]/.test(path))
23
- .filter((path) => pageRegex.test(path))
24
- .map((path) => path.replace(pageRegex, ""))
25
- .map((path) => path || "/")
26
- .map((path) => path.replace("../../routes/", ""))
27
- .map((path) => path.replace("../../routes", ""))
28
- .filter((page) => navItems.hasOwnProperty(page))
29
- .sort();
30
- return paths;
31
- };
24
+ // function getPages(url, modules) {
25
+ // const directory = url
26
+ // .replace(/(.*?)\/src\/lib\/components\//, "/")
27
+ // .replace(/(.*?)\/src\/routes\//, "/")
28
+ // .replace(/(.*?)\/immutable\/pages\//, "/")
29
+ // .replace(/(.*?)\/var\/task\//, "/") // Vercel
30
+ // .replace(/\/([^/])*.svelte.*/, "/");
31
+ // const pageRegex = /\/\+page\.svelte$/;
32
+ // const paths = Object.keys(modules)
33
+ // .map((path) => path.replace(/^(.\/)/, directory))
34
+ // .filter((path) => !/\[.*\]/.test(path))
35
+ // .filter((path) => pageRegex.test(path))
36
+ // .map((path) => path.replace(pageRegex, ""))
37
+ // .map((path) => path || "/")
38
+ // .map((path) => path.replace("../../routes/", ""))
39
+ // .map((path) => path.replace("../../routes", ""))
40
+ // .filter((page) => navItems.hasOwnProperty(page))
41
+ // .sort();
42
+ // return paths;
43
+ // };
32
44
 
33
- const pages = getPages(url, modules);
45
+ // const pages = getPages(url, modules);
34
46
  </script>
35
47
 
36
48
  <div class="container">
37
49
  <Header>
38
50
  <div slot="logoleft">
39
51
  <a href="/">
40
- <img src={logo} alt="Functional IT Solutions" />
52
+ <img src={logoUrl} alt={companyName} />
41
53
  </a>
42
54
  </div>
43
55
  <HeaderNav css="nav-overrides">
44
56
  {#each pages as page}
45
57
  <HeaderNavItem
46
- ><a href={page}>{navItems[page]}</a></HeaderNavItem
58
+ ><a href={page.url}>{page.name}</a></HeaderNavItem
47
59
  >
48
60
  {/each}
49
61
  </HeaderNav>
@@ -2,7 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} HeaderEvents */
3
3
  /** @typedef {typeof __propDef.slots} HeaderSlots */
4
4
  export default class Header extends SvelteComponent<{
5
- [x: string]: never;
5
+ companyName: string;
6
+ logoUrl: string;
7
+ pages: any;
6
8
  }, {
7
9
  [evt: string]: CustomEvent<any>;
8
10
  }, {}> {
@@ -13,7 +15,9 @@ export type HeaderSlots = typeof __propDef.slots;
13
15
  import { SvelteComponent } from "svelte";
14
16
  declare const __propDef: {
15
17
  props: {
16
- [x: string]: never;
18
+ companyName: string;
19
+ logoUrl: string;
20
+ pages: any;
17
21
  };
18
22
  events: {
19
23
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },