From ea9f83cb7eb6c3c2223dce700334e12c38b69df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Preu=C3=9F?= Date: Fri, 17 Feb 2023 20:19:34 +0100 Subject: [PATCH] chore(release): v0.0.3 --- dist/module.json | 2 +- dist/module.mjs | 2 +- .../BitinflowThirdLevelMenu.vue.d.ts | 6 ++++- dist/runtime/composables/index.d.ts | 3 ++- dist/runtime/composables/index.mjs | 15 +++++------ dist/runtime/stores/menu.d.ts | 7 ++--- dist/runtime/stores/menu.mjs | 27 +++++++++---------- package.json | 2 +- src/module.ts | 5 ++-- src/{ => runtime}/colors.ts | 0 src/runtime/composables/index.js | 8 ------ src/runtime/composables/index.ts | 9 +++++++ src/runtime/stores/{menu.js => menu.ts} | 7 ++--- src/types.ts | 9 +++++++ 14 files changed, 58 insertions(+), 44 deletions(-) rename src/{ => runtime}/colors.ts (100%) delete mode 100644 src/runtime/composables/index.js create mode 100644 src/runtime/composables/index.ts rename src/runtime/stores/{menu.js => menu.ts} (56%) create mode 100644 src/types.ts diff --git a/dist/module.json b/dist/module.json index 57374b8..dc98b19 100644 --- a/dist/module.json +++ b/dist/module.json @@ -1,5 +1,5 @@ { "name": "@bitinflow/ui", "configKey": "ui", - "version": "1.0.0" + "version": "0.0.2" } \ No newline at end of file diff --git a/dist/module.mjs b/dist/module.mjs index c6c3587..281cd06 100644 --- a/dist/module.mjs +++ b/dist/module.mjs @@ -21,7 +21,7 @@ const module = defineNuxtModule({ }).then((r) => { console.log(r); }); - logger.success("Session setup complete"); + logger.success("@bitinflow/ui module loaded"); } }); diff --git a/dist/runtime/components/BitinflowThirdLevelMenu.vue.d.ts b/dist/runtime/components/BitinflowThirdLevelMenu.vue.d.ts index 3317bd4..ec84cd1 100644 --- a/dist/runtime/components/BitinflowThirdLevelMenu.vue.d.ts +++ b/dist/runtime/components/BitinflowThirdLevelMenu.vue.d.ts @@ -7,7 +7,11 @@ declare namespace _default { link: string; }; namespace computed { - const thirdLevelLinks: () => never[]; + const thirdLevelLinks: () => { + name: string; + icon: string; + to: string; + }[]; } namespace methods { function onChange(event: any): void; diff --git a/dist/runtime/composables/index.d.ts b/dist/runtime/composables/index.d.ts index a35825b..8115a92 100644 --- a/dist/runtime/composables/index.d.ts +++ b/dist/runtime/composables/index.d.ts @@ -1 +1,2 @@ -export function useMenu(data: any): void; +import { MenuOptions } from "../../types"; +export declare const useMenu: (options: MenuOptions) => void; diff --git a/dist/runtime/composables/index.mjs b/dist/runtime/composables/index.mjs index ef68e14..7beabef 100644 --- a/dist/runtime/composables/index.mjs +++ b/dist/runtime/composables/index.mjs @@ -1,8 +1,7 @@ -import {useMenuStore} from "../stores/menu.js"; - -export const useMenu = (data) => { - const menu = useMenuStore() - if (data.thirdLevelLinks) { - menu.updateThirdLevelLinks(data.thirdLevelLinks) - } -} \ No newline at end of file +import { useMenuStore } from "../stores/menu.mjs"; +export const useMenu = (options) => { + const menu = useMenuStore(); + if (options.thirdLevelLinks) { + menu.updateThirdLevelLinks(options.thirdLevelLinks); + } +}; diff --git a/dist/runtime/stores/menu.d.ts b/dist/runtime/stores/menu.d.ts index 6ff4045..6524418 100644 --- a/dist/runtime/stores/menu.d.ts +++ b/dist/runtime/stores/menu.d.ts @@ -1,5 +1,6 @@ -export const useMenuStore: import("pinia").StoreDefinition<"menu", { - thirdLevelLinks: never[]; +import { ThirdLevelLink } from "../../types"; +export declare const useMenuStore: import("pinia").StoreDefinition<"menu", { + thirdLevelLinks: ThirdLevelLink[]; }, {}, { - updateThirdLevelLinks(links: any): void; + updateThirdLevelLinks(links: Array): void; }>; diff --git a/dist/runtime/stores/menu.mjs b/dist/runtime/stores/menu.mjs index 2a4a8ea..36bd260 100644 --- a/dist/runtime/stores/menu.mjs +++ b/dist/runtime/stores/menu.mjs @@ -1,14 +1,13 @@ -import {defineStore} from 'pinia'; - -export const useMenuStore = defineStore('menu', { - state: () => { - return { - thirdLevelLinks: [] - } - }, - actions: { - updateThirdLevelLinks(links) { - this.thirdLevelLinks = links; - }, - }, -}) \ No newline at end of file +import { defineStore } from "pinia"; +export const useMenuStore = defineStore("menu", { + state: () => { + return { + thirdLevelLinks: [] + }; + }, + actions: { + updateThirdLevelLinks(links) { + this.thirdLevelLinks = links; + } + } +}); diff --git a/package.json b/package.json index 79150bb..0449d62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitinflow/ui", - "version": "0.0.2", + "version": "0.0.3", "description": "bitinflow UI Kit", "license": "Apache-2.0", "type": "module", diff --git a/src/module.ts b/src/module.ts index 3ce29b0..c284e46 100644 --- a/src/module.ts +++ b/src/module.ts @@ -4,8 +4,7 @@ import { createResolver, useLogger, addImportsDir, - addComponent, - resolveFiles, addComponentsDir + addComponentsDir } from '@nuxt/kit' // Module options TypeScript inteface definition @@ -38,6 +37,6 @@ export default defineNuxtModule({ console.log(r) }); - logger.success('Session setup complete') + logger.success('@bitinflow/ui module loaded') } }) diff --git a/src/colors.ts b/src/runtime/colors.ts similarity index 100% rename from src/colors.ts rename to src/runtime/colors.ts diff --git a/src/runtime/composables/index.js b/src/runtime/composables/index.js deleted file mode 100644 index ef68e14..0000000 --- a/src/runtime/composables/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import {useMenuStore} from "../stores/menu.js"; - -export const useMenu = (data) => { - const menu = useMenuStore() - if (data.thirdLevelLinks) { - menu.updateThirdLevelLinks(data.thirdLevelLinks) - } -} \ No newline at end of file diff --git a/src/runtime/composables/index.ts b/src/runtime/composables/index.ts new file mode 100644 index 0000000..41a8eb2 --- /dev/null +++ b/src/runtime/composables/index.ts @@ -0,0 +1,9 @@ +import {useMenuStore} from "../stores/menu"; +import {MenuOptions} from "../../types"; + +export const useMenu = (options: MenuOptions) => { + const menu = useMenuStore() + if (options.thirdLevelLinks) { + menu.updateThirdLevelLinks(options.thirdLevelLinks) + } +} diff --git a/src/runtime/stores/menu.js b/src/runtime/stores/menu.ts similarity index 56% rename from src/runtime/stores/menu.js rename to src/runtime/stores/menu.ts index 2a4a8ea..74de2b7 100644 --- a/src/runtime/stores/menu.js +++ b/src/runtime/stores/menu.ts @@ -1,14 +1,15 @@ import {defineStore} from 'pinia'; +import {ThirdLevelLink} from "../../types"; export const useMenuStore = defineStore('menu', { state: () => { return { - thirdLevelLinks: [] + thirdLevelLinks: [] as Array } }, actions: { - updateThirdLevelLinks(links) { + updateThirdLevelLinks(links: Array) { this.thirdLevelLinks = links; }, }, -}) \ No newline at end of file +}) diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..898540e --- /dev/null +++ b/src/types.ts @@ -0,0 +1,9 @@ +export interface MenuOptions { + thirdLevelLinks: Array; +} + +export interface ThirdLevelLink { + name: string; + icon: string; + to: string; +}