@mevbg/nuxt-kit 0.4.2 → 0.5.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/module.d.mts CHANGED
@@ -9,7 +9,7 @@ interface NuxtKitOptions {
9
9
  designEssentials?: MasterGeneratorParams;
10
10
  colorScheme?: ColorSchemeOptions;
11
11
  toastify?: ToastContainerOptions;
12
- floating?: any;
12
+ floating?: unknown;
13
13
  }
14
14
 
15
15
  declare const _default: _nuxt_schema.NuxtModule<NuxtKitOptions, NuxtKitOptions, false>;
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mevbg/nuxt-kit",
3
3
  "configKey": "mevKit",
4
- "version": "0.4.2",
4
+ "version": "0.5.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
package/dist/module.mjs CHANGED
@@ -21,6 +21,8 @@ const module = defineNuxtModule({
21
21
  },
22
22
  async setup(options, nuxt) {
23
23
  nuxt.options.runtimeConfig.public.wm = options.wm;
24
+ nuxt.options.runtimeConfig.public.toastify = options.toastify;
25
+ nuxt.options.runtimeConfig.public.floating = options.floating;
24
26
  Promise.all([
25
27
  installModule("@vueuse/nuxt"),
26
28
  installModule("@mevbg/nuxt-color-scheme", {
@@ -50,8 +52,12 @@ const module = defineNuxtModule({
50
52
  from: resolver.resolve("./runtime/composables/useScrollDirectionUp")
51
53
  },
52
54
  {
53
- name: "useMetaData",
54
- from: resolver.resolve("./runtime/composables/useMetaData")
55
+ name: "useAppMeta",
56
+ from: resolver.resolve("./runtime/composables/useAppMeta")
57
+ },
58
+ {
59
+ name: "usePageMeta",
60
+ from: resolver.resolve("./runtime/composables/usePageMeta")
55
61
  },
56
62
  {
57
63
  name: "useHeadLinks",
@@ -1,6 +1,7 @@
1
1
  export * from './useErrorHandler.js';
2
2
  export * from './useHeadLinks.js';
3
- export * from './useMetaData.js';
3
+ export * from './useAppMeta.js';
4
+ export * from './usePageMeta.js';
4
5
  export * from './useNetworkListener.js';
5
6
  export * from './useNotificationSystem.js';
6
7
  export * from './useScrollDirectionUp.js';
@@ -1,6 +1,7 @@
1
1
  export * from "./useErrorHandler.js";
2
2
  export * from "./useHeadLinks.js";
3
- export * from "./useMetaData.js";
3
+ export * from "./useAppMeta.js";
4
+ export * from "./usePageMeta.js";
4
5
  export * from "./useNetworkListener.js";
5
6
  export * from "./useNotificationSystem.js";
6
7
  export * from "./useScrollDirectionUp.js";
@@ -1,17 +1,13 @@
1
- type MetaData = {
1
+ type AppMeta = {
2
2
  path: string;
3
3
  locale: string;
4
- homepage: string;
5
4
  themeColor: string;
6
5
  robots: boolean;
7
6
  siteTitle: string;
8
- siteDescription: string;
9
- siteKeywords: string;
10
7
  siteOwner: string;
11
- siteImage: string;
12
8
  googleSiteVerification?: string;
13
9
  };
14
- export declare function useMetaData({ path, locale, homepage, themeColor, robots, siteTitle, siteDescription, siteKeywords, siteOwner, siteImage, googleSiteVerification }: MetaData): ({
10
+ export declare function useAppMeta({ path, locale, themeColor, robots, siteTitle, siteOwner, googleSiteVerification }: AppMeta): ({
15
11
  charset: string;
16
12
  'http-equiv'?: undefined;
17
13
  content?: undefined;
@@ -1,14 +1,10 @@
1
- export function useMetaData({
1
+ export function useAppMeta({
2
2
  path = "/assets",
3
3
  locale,
4
- homepage,
5
4
  themeColor,
6
5
  robots,
7
6
  siteTitle,
8
- siteDescription,
9
- siteKeywords,
10
7
  siteOwner,
11
- siteImage,
12
8
  googleSiteVerification
13
9
  }) {
14
10
  return [
@@ -18,8 +14,6 @@ export function useMetaData({
18
14
  { name: "author", content: siteOwner },
19
15
  { name: "copyright", content: siteOwner },
20
16
  ...googleSiteVerification ? [{ name: "google-site-verification", content: googleSiteVerification }] : [],
21
- { name: "description", content: siteDescription },
22
- { name: "keywords", content: siteKeywords },
23
17
  ...!robots ? [{ name: "robots", content: "noindex,nofollow" }] : [],
24
18
  { name: "viewport", content: "width=device-width, initial-scale=1" },
25
19
  { name: "application-name", content: siteTitle },
@@ -33,19 +27,7 @@ export function useMetaData({
33
27
  { name: "msapplication-TileImage", content: `${path}/mstile-144x144.png` },
34
28
  { name: "msapplication-config", content: `${path}/browserconfig.xml` },
35
29
  { property: "og:site_name", content: siteTitle },
36
- { property: "og:title", content: siteTitle },
37
- { property: "og:description", content: siteDescription },
38
- { property: "og:type", content: "website" },
39
- { property: "og:url", content: homepage },
40
30
  { property: "og:locale", content: locale },
41
- { property: "og:image", content: siteImage },
42
- { property: "og:image:type", content: "image/png" },
43
- { property: "og:image:width", content: "1200" },
44
- { property: "og:image:height", content: "630" },
45
- { property: "og:image:alt", content: siteTitle },
46
- { name: "twitter:card", content: "summary_large_image" },
47
- { name: "twitter:title", content: siteTitle },
48
- { name: "twitter:description", content: siteDescription },
49
- { name: "twitter:image", content: siteImage }
31
+ { name: "twitter:card", content: "summary_large_image" }
50
32
  ];
51
33
  }
@@ -0,0 +1,18 @@
1
+ type PageMeta = {
2
+ pageType: string;
3
+ pageTitle: string;
4
+ pageUrl: string;
5
+ pageDescription: string;
6
+ pageKeywords: string;
7
+ pageImage?: string;
8
+ };
9
+ export declare function usePageMeta({ pageType, pageTitle, pageUrl, pageDescription, pageKeywords, pageImage }: PageMeta): ({
10
+ name: string;
11
+ content: string;
12
+ property?: undefined;
13
+ } | {
14
+ property: string;
15
+ content: string;
16
+ name?: undefined;
17
+ })[];
18
+ export {};
@@ -0,0 +1,27 @@
1
+ export function usePageMeta({
2
+ pageType,
3
+ pageTitle,
4
+ pageUrl,
5
+ pageDescription,
6
+ pageKeywords,
7
+ pageImage
8
+ }) {
9
+ return [
10
+ { name: "description", content: pageDescription },
11
+ { name: "keywords", content: pageKeywords },
12
+ { property: "og:title", content: pageTitle },
13
+ { property: "og:description", content: pageDescription },
14
+ { property: "og:type", content: pageType },
15
+ { property: "og:url", content: pageUrl },
16
+ ...pageImage ? [
17
+ { property: "og:image", content: pageImage },
18
+ { property: "og:image:type", content: "image/png" },
19
+ { property: "og:image:width", content: "1200" },
20
+ { property: "og:image:height", content: "630" },
21
+ { property: "og:image:alt", content: pageTitle }
22
+ ] : [],
23
+ { name: "twitter:title", content: pageTitle },
24
+ { name: "twitter:description", content: pageDescription },
25
+ ...pageImage ? [{ name: "twitter:image", content: pageImage }] : []
26
+ ];
27
+ }
@@ -1,11 +1,9 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig } from "#app";
2
2
  import FloatingVue from "floating-vue";
3
3
  import "floating-vue/dist/style.css";
4
- import { floatingVueDefaultConfig } from "../configs/floating-vue.config.js";
5
4
  export default defineNuxtPlugin((nuxtApp) => {
6
5
  const {
7
6
  public: { floating: floatingVueConfig }
8
7
  } = useRuntimeConfig();
9
- const config = Object.assign({}, floatingVueDefaultConfig, floatingVueConfig);
10
- nuxtApp.vueApp.use(FloatingVue, config);
8
+ nuxtApp.vueApp.use(FloatingVue, floatingVueConfig);
11
9
  });
@@ -1,13 +1,11 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig } from "#app";
2
2
  import Vue3Toastify, { toast } from "vue3-toastify";
3
3
  import "vue3-toastify/dist/index.css";
4
- import { toastifyDefaultConfig } from "../configs/vue3-toastify.config.js";
5
4
  export default defineNuxtPlugin((nuxtApp) => {
6
5
  const {
7
6
  public: { toastify: toastifyConfig }
8
7
  } = useRuntimeConfig();
9
- const config = Object.assign({}, toastifyDefaultConfig, toastifyConfig);
10
- nuxtApp.vueApp.use(Vue3Toastify, config);
8
+ nuxtApp.vueApp.use(Vue3Toastify, toastifyConfig);
11
9
  return {
12
10
  provide: { toast }
13
11
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mevbg/nuxt-kit",
3
3
  "title": "Mev’s Nuxt Kit",
4
- "version": "0.4.2",
4
+ "version": "0.5.0",
5
5
  "description": "Mev’s personal Nuxt kit module.",
6
6
  "keywords": [
7
7
  "nuxt kit",