@nuxtify/core 0.1.7 → 0.1.8

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtify/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "configKey": "nuxtifyCore",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.16.0",
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addComponentsDir, addI
2
2
  import { defu } from 'defu';
3
3
 
4
4
  const name = "@nuxtify/core";
5
- const version = "0.1.7";
5
+ const version = "0.1.8";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -0,0 +1,55 @@
1
+ <script setup>
2
+ import { useNuxtifyConfig } from "#imports";
3
+ defineProps({
4
+ brandOpacity: {
5
+ type: Number,
6
+ default: 1
7
+ }
8
+ });
9
+ const nuxtifyConfig = useNuxtifyConfig();
10
+ </script>
11
+
12
+ <template>
13
+ <div v-if="nuxtifyConfig.credits?.prependText || nuxtifyConfig.credits?.creator?.name || nuxtifyConfig.credits?.appendText || nuxtifyConfig.credits?.showPoweredBy">
14
+ <small>
15
+ <!-- Prepend text -->
16
+ <span
17
+ v-if="nuxtifyConfig.credits.prependText"
18
+ >
19
+ {{ nuxtifyConfig.credits.prependText + " " }}
20
+ </span>
21
+
22
+ <!-- Creator name -->
23
+ <span v-if="nuxtifyConfig.credits.creator?.name">
24
+ <a
25
+ v-if="nuxtifyConfig.credits.creator.domain"
26
+ id="brand-name"
27
+ :href="`https://${nuxtifyConfig.credits.creator.domain}/?utm_source=${nuxtifyConfig.brand?.domain}&utm_medium=referral`"
28
+ target="_blank"
29
+ rel="noopener noreferrer"
30
+ class="font-weight-bold"
31
+ >{{ nuxtifyConfig.credits.creator.name }}</a><span v-else>{{ nuxtifyConfig.credits.creator.name }}</span>.
32
+ </span>
33
+
34
+ <!-- Append text -->
35
+ <span
36
+ v-if="nuxtifyConfig.credits.appendText"
37
+ >
38
+ {{ nuxtifyConfig.credits.appendText + " " }}
39
+ </span>
40
+
41
+ <!-- Powered by -->
42
+ <span v-if="nuxtifyConfig.credits.showPoweredBy">
43
+ <a
44
+ :href="`https://nuxtify.dev/?utm_source=${nuxtifyConfig.brand?.domain}&utm_medium=referral&utm_campaign=poweredby`"
45
+ target="_blank"
46
+ rel="noopener nofollow"
47
+ >Powered by Nuxtify</a>.
48
+ </span>
49
+ </small>
50
+ </div>
51
+ </template>
52
+
53
+ <style scoped>
54
+ a{color:inherit;justify-content:start;text-decoration:none}.v-btn:hover,a:hover{text-decoration:underline;text-underline-offset:4px}#brand-name{opacity:v-bind(brandOpacity)}#brand-name:hover{opacity:1}
55
+ </style>
@@ -0,0 +1,14 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ brandOpacity: {
3
+ type: NumberConstructor;
4
+ default: number;
5
+ };
6
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ brandOpacity: {
8
+ type: NumberConstructor;
9
+ default: number;
10
+ };
11
+ }>> & Readonly<{}>, {
12
+ brandOpacity: number;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
@@ -1,2 +1,6 @@
1
1
  import type { ModuleOptions } from '../../types.js';
2
2
  export declare const useNuxtifyConfig: () => ModuleOptions;
3
+ export declare const useNuxtifySiteTitle: ({ separator, siteName, }?: {
4
+ separator?: string;
5
+ siteName?: string;
6
+ }) => void;
@@ -1,2 +1,17 @@
1
- import { useAppConfig } from "#imports";
1
+ import { useAppConfig, useHead } from "#imports";
2
2
  export const useNuxtifyConfig = () => useAppConfig().nuxtify;
3
+ export const useNuxtifySiteTitle = ({
4
+ separator = "|",
5
+ siteName = ""
6
+ } = {}) => {
7
+ const nuxtifyConfig = useNuxtifyConfig();
8
+ useHead({
9
+ titleTemplate: (titleChunk) => {
10
+ return titleChunk ? `${titleChunk} %separator %siteName` : "%siteName";
11
+ },
12
+ templateParams: {
13
+ siteName: siteName || nuxtifyConfig.brand?.name,
14
+ separator
15
+ }
16
+ });
17
+ };
@@ -11,6 +11,8 @@ export declare const formRules: {
11
11
  maxLength300: (v: string) => true | "Must not be longer than 300 characters";
12
12
  maxLength600: (v: string) => true | "Must not be longer than 600 characters";
13
13
  maxLength1200: (v: string) => true | "Must not be longer than 1200 characters";
14
+ maxLength5000: (v: string) => true | "Must not be longer than 5000 characters";
15
+ maxLength10000: (v: string) => true | "Must not be longer than 10,000 characters";
14
16
  isInteger: (v: string) => true | "Must be an integer";
15
17
  gt0: (v: string) => true | "Must be greater than 0";
16
18
  gte6: (v: string) => true | "Must be greater than or equal to 6";
@@ -14,6 +14,8 @@ export const formRules = {
14
14
  maxLength300: (v) => v ? v.length <= 300 || "Must not be longer than 300 characters" : true,
15
15
  maxLength600: (v) => v ? v.length <= 600 || "Must not be longer than 600 characters" : true,
16
16
  maxLength1200: (v) => v ? v.length <= 1200 || "Must not be longer than 1200 characters" : true,
17
+ maxLength5000: (v) => v ? v.length <= 5e3 || "Must not be longer than 5000 characters" : true,
18
+ maxLength10000: (v) => v ? v.length <= 1e4 || "Must not be longer than 10,000 characters" : true,
17
19
  // Number
18
20
  isInteger: (v) => Number.isInteger(+v) || "Must be an integer",
19
21
  gt0: (v) => Number.parseFloat(v) > 0 || "Must be greater than 0",
@@ -5,3 +5,11 @@ export declare const addOrReplaceArrayItem: (array: {
5
5
  id: string | number;
6
6
  [key: string]: unknown;
7
7
  }) => void;
8
+ /**
9
+ * Returns a random integer between min (inclusive) and max (inclusive).
10
+ * The value is no lower than min (or the next integer greater than min
11
+ * if min isn't an integer) and no greater than max (or the next integer
12
+ * lower than max if max isn't an integer).
13
+ * Using Math.round() will give you a non-uniform distribution!
14
+ */
15
+ export declare const getRandomInt: (min: number, max: number) => number;
@@ -3,3 +3,8 @@ export const addOrReplaceArrayItem = (array, element) => {
3
3
  if (i > -1) array[i] = element;
4
4
  else array.push(element);
5
5
  };
6
+ export const getRandomInt = (min, max) => {
7
+ min = Math.ceil(min);
8
+ max = Math.floor(max);
9
+ return Math.floor(Math.random() * (max - min + 1)) + min;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtify/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Nuxtify core module powered by Nuxt and Vuetify.",
5
5
  "homepage": "https://nuxtify.dev",
6
6
  "author": "Nuxtify.dev <hello@nuxtify.dev>",
@@ -44,23 +44,23 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@mdi/js": "^7.4.47",
47
- "@nuxt/kit": "^3.17.3",
48
47
  "defu": "^6.1.4",
49
- "vuetify-nuxt-module": "^0.18.6"
48
+ "vuetify-nuxt-module": "^0.18.7"
50
49
  },
51
50
  "devDependencies": {
52
- "@nuxt/devtools": "^2.4.0",
51
+ "@nuxt/devtools": "^2.5.0",
53
52
  "@nuxt/eslint": "^1.4.1",
54
53
  "@nuxt/eslint-config": "^1.3.1",
54
+ "@nuxt/kit": "^3.17.5",
55
55
  "@nuxt/module-builder": "^1.0.1",
56
- "@nuxt/schema": "^3.17.3",
57
- "@nuxt/test-utils": "^3.19.0",
58
- "@types/node": "^22.15.19",
56
+ "@nuxt/schema": "^3.17.5",
57
+ "@nuxt/test-utils": "^3.19.1",
58
+ "@types/node": "^22.15.32",
59
59
  "changelogen": "^0.6.1",
60
- "eslint": "^9.27.0",
61
- "nuxt": "^3.17.3",
60
+ "eslint": "^9.29.0",
61
+ "nuxt": "^3.17.5",
62
62
  "typescript": "~5.8.3",
63
- "vitest": "^3.1.4",
63
+ "vitest": "^3.2.3",
64
64
  "vue-tsc": "^2.2.10"
65
65
  }
66
66
  }