@nuxtify/core 0.1.9 → 0.1.11
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 +43 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +51 -42
- package/dist/runtime/components/app/AppLogo.vue.d.ts +1 -1
- package/dist/runtime/composables/nuxtify.js +1 -2
- package/dist/runtime/composables/util.d.ts +1 -0
- package/dist/runtime/composables/util.js +12 -0
- package/dist/runtime/utils/text.d.ts +16 -2
- package/dist/runtime/utils/text.js +33 -15
- package/package.json +16 -15
package/dist/module.d.mts
CHANGED
|
@@ -116,6 +116,48 @@ interface ModuleOptions {
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions,
|
|
119
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, {
|
|
120
|
+
verboseLogs: false;
|
|
121
|
+
brand: {
|
|
122
|
+
name: string;
|
|
123
|
+
domain: string;
|
|
124
|
+
tagline: string;
|
|
125
|
+
logo: {
|
|
126
|
+
lightUrl: string;
|
|
127
|
+
darkUrl: string;
|
|
128
|
+
width: number;
|
|
129
|
+
mobileWidth: number;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
policies: {
|
|
133
|
+
privacyUrl: string;
|
|
134
|
+
termsUrl: string;
|
|
135
|
+
};
|
|
136
|
+
announcement: {
|
|
137
|
+
show: false;
|
|
138
|
+
message: string;
|
|
139
|
+
buttonText: string;
|
|
140
|
+
buttonUrl: string;
|
|
141
|
+
};
|
|
142
|
+
navigation: {
|
|
143
|
+
primary: never[];
|
|
144
|
+
secondary: never[];
|
|
145
|
+
altPrimary: never[];
|
|
146
|
+
altSecondary: never[];
|
|
147
|
+
};
|
|
148
|
+
credits: {
|
|
149
|
+
creator: {
|
|
150
|
+
name: string;
|
|
151
|
+
domain: string;
|
|
152
|
+
};
|
|
153
|
+
prependText: string;
|
|
154
|
+
appendText: string;
|
|
155
|
+
showPoweredBy: true;
|
|
156
|
+
};
|
|
157
|
+
email: {
|
|
158
|
+
general: string;
|
|
159
|
+
support: string;
|
|
160
|
+
};
|
|
161
|
+
}, true>;
|
|
120
162
|
|
|
121
163
|
export { _default as default };
|
package/dist/module.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtify/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"configKey": "nuxtifyCore",
|
|
5
5
|
"compatibility": {
|
|
6
6
|
"nuxt": ">=3.16.0",
|
|
7
7
|
"bridge": false
|
|
8
8
|
},
|
|
9
9
|
"builder": {
|
|
10
|
-
"@nuxt/module-builder": "1.0.
|
|
11
|
-
"unbuild": "
|
|
10
|
+
"@nuxt/module-builder": "1.0.2",
|
|
11
|
+
"unbuild": "unknown"
|
|
12
12
|
}
|
|
13
13
|
}
|
package/dist/module.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver,
|
|
1
|
+
import { defineNuxtModule, createResolver, useLogger, addComponentsDir, addImportsDir, addServerImportsDir, addRouteMiddleware } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
|
|
4
4
|
const name = "@nuxtify/core";
|
|
5
|
-
const version = "0.1.
|
|
5
|
+
const version = "0.1.11";
|
|
6
6
|
|
|
7
|
-
const module = defineNuxtModule({
|
|
7
|
+
const module$1 = defineNuxtModule().with({
|
|
8
8
|
meta: {
|
|
9
9
|
name,
|
|
10
10
|
version,
|
|
@@ -14,6 +14,41 @@ const module = defineNuxtModule({
|
|
|
14
14
|
bridge: false
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
+
moduleDependencies: {
|
|
18
|
+
"vuetify-nuxt-module": {
|
|
19
|
+
version: ">=0.19.2",
|
|
20
|
+
defaults: {
|
|
21
|
+
vuetifyOptions: {
|
|
22
|
+
icons: {
|
|
23
|
+
defaultSet: "mdi-svg"
|
|
24
|
+
},
|
|
25
|
+
theme: {
|
|
26
|
+
themes: {
|
|
27
|
+
light: {
|
|
28
|
+
colors: {
|
|
29
|
+
primary: "#020420",
|
|
30
|
+
secondary: "#00DC82",
|
|
31
|
+
background: "#fff"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaults: {
|
|
37
|
+
VBtn: { color: "secondary", variant: "flat", class: "text-none" },
|
|
38
|
+
VAlert: {
|
|
39
|
+
VBtn: { color: "inherit" }
|
|
40
|
+
},
|
|
41
|
+
VFooter: {
|
|
42
|
+
VBtn: { color: "inherit" }
|
|
43
|
+
},
|
|
44
|
+
VNumberInput: {
|
|
45
|
+
VBtn: { color: "inherit", variant: "inherit" }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
17
52
|
defaults: {
|
|
18
53
|
// Logs
|
|
19
54
|
verboseLogs: false,
|
|
@@ -64,52 +99,26 @@ const module = defineNuxtModule({
|
|
|
64
99
|
support: ""
|
|
65
100
|
}
|
|
66
101
|
},
|
|
67
|
-
async setup(
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
defaultSet: "mdi-svg"
|
|
74
|
-
},
|
|
75
|
-
theme: {
|
|
76
|
-
themes: {
|
|
77
|
-
light: {
|
|
78
|
-
colors: {
|
|
79
|
-
primary: "#020420",
|
|
80
|
-
secondary: "#00DC82",
|
|
81
|
-
background: "#fff"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
defaults: {
|
|
87
|
-
VBtn: { color: "secondary", variant: "flat", class: "text-none" },
|
|
88
|
-
VAlert: {
|
|
89
|
-
VBtn: { color: "inherit" }
|
|
90
|
-
},
|
|
91
|
-
VFooter: {
|
|
92
|
-
VBtn: { color: "inherit" }
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
_nuxt.options.appConfig.nuxtify = defu(_nuxt.options.appConfig.nuxtify, {
|
|
98
|
-
..._options
|
|
102
|
+
async setup(resolvedOptions, nuxt) {
|
|
103
|
+
const { resolve } = createResolver(import.meta.url);
|
|
104
|
+
const logger = useLogger("nuxtify-core");
|
|
105
|
+
if (resolvedOptions.verboseLogs) logger.info("Verbose logging enabled.");
|
|
106
|
+
nuxt.options.appConfig.nuxtify = defu(nuxt.options.appConfig.nuxtify || {}, {
|
|
107
|
+
...resolvedOptions
|
|
99
108
|
});
|
|
100
109
|
addComponentsDir({
|
|
101
|
-
path:
|
|
110
|
+
path: resolve("./runtime/components")
|
|
102
111
|
});
|
|
103
|
-
addImportsDir(
|
|
104
|
-
addServerImportsDir(
|
|
105
|
-
addImportsDir(
|
|
106
|
-
addServerImportsDir(
|
|
112
|
+
addImportsDir(resolve("./runtime/composables"));
|
|
113
|
+
addServerImportsDir(resolve("./runtime/server/composables"));
|
|
114
|
+
addImportsDir(resolve("./runtime/utils"));
|
|
115
|
+
addServerImportsDir(resolve("./runtime/server/utils"));
|
|
107
116
|
addRouteMiddleware({
|
|
108
117
|
name: "setup",
|
|
109
|
-
path:
|
|
118
|
+
path: resolve("./runtime/middleware/setup"),
|
|
110
119
|
global: true
|
|
111
120
|
});
|
|
112
121
|
}
|
|
113
122
|
});
|
|
114
123
|
|
|
115
|
-
export { module as default };
|
|
124
|
+
export { module$1 as default };
|
|
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
default: undefined;
|
|
18
18
|
};
|
|
19
19
|
}>> & Readonly<{}>, {
|
|
20
|
-
width: number;
|
|
21
20
|
dark: boolean;
|
|
21
|
+
width: number;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
23
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCopyText: (text: string, label?: string) => Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useToast } from "#imports";
|
|
2
|
+
export const useCopyText = async (text, label = "Text") => {
|
|
3
|
+
const toast = useToast();
|
|
4
|
+
if (!navigator.clipboard) {
|
|
5
|
+
toast.value.message = "Error: Clipboard access is not available.";
|
|
6
|
+
toast.value.show = true;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
await navigator.clipboard.writeText(text);
|
|
10
|
+
toast.value.message = `${label} copied!`;
|
|
11
|
+
toast.value.show = true;
|
|
12
|
+
};
|
|
@@ -13,8 +13,22 @@ export declare function getPronouns(gender: string): {
|
|
|
13
13
|
possessivePlural: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const formatPhone: (input: string, separator?: string) => string;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Formats a date or a date-time using the Intl.DateTimeFormat API.
|
|
18
|
+
*
|
|
19
|
+
* @param date The date to format (number, string, or Date).
|
|
20
|
+
* @param config Optional configuration object.
|
|
21
|
+
* @param config.type The format to use: 'date' (default) or 'datetime'.
|
|
22
|
+
* @param config.locale A string with a BCP 47 language tag (e.g., 'en-US').
|
|
23
|
+
* @param config.options Custom formatting options to override the default.
|
|
24
|
+
* @param config.defaultString The string to return if the date is invalid.
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatDate(date: number | string | Date, { type, locale, options, defaultString, }?: {
|
|
27
|
+
type?: 'date' | 'datetime';
|
|
28
|
+
locale?: string;
|
|
29
|
+
options?: Intl.DateTimeFormatOptions;
|
|
30
|
+
defaultString?: string;
|
|
31
|
+
}): string;
|
|
18
32
|
export declare function booleanToText(bool: boolean): "Yes" | "No";
|
|
19
33
|
export declare const truncate: (text: string, maxLength?: number, ellipses?: boolean) => string;
|
|
20
34
|
export declare const slugify: (text: string) => string;
|
|
@@ -84,21 +84,39 @@ export const formatPhone = (input, separator = "-") => {
|
|
|
84
84
|
}
|
|
85
85
|
return phone;
|
|
86
86
|
};
|
|
87
|
-
export function formatDate(date,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
export function formatDate(date, {
|
|
88
|
+
type = "date",
|
|
89
|
+
locale = "en-US",
|
|
90
|
+
options,
|
|
91
|
+
defaultString = "-"
|
|
92
|
+
} = {}) {
|
|
93
|
+
if (date === null || date === void 0) {
|
|
94
|
+
return defaultString;
|
|
95
|
+
}
|
|
96
|
+
const dateObj = new Date(date);
|
|
97
|
+
if (Number.isNaN(dateObj.getTime())) {
|
|
98
|
+
return defaultString;
|
|
99
|
+
}
|
|
100
|
+
const defaultOptions = {
|
|
101
|
+
date: {
|
|
102
|
+
year: "numeric",
|
|
103
|
+
month: "long",
|
|
104
|
+
day: "numeric"
|
|
105
|
+
},
|
|
106
|
+
datetime: {
|
|
107
|
+
year: "numeric",
|
|
108
|
+
month: "short",
|
|
109
|
+
day: "numeric",
|
|
110
|
+
hour: "numeric",
|
|
111
|
+
minute: "numeric"
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const formatOptions = { ...defaultOptions[type], ...options };
|
|
115
|
+
try {
|
|
116
|
+
return new Intl.DateTimeFormat(locale, formatOptions).format(dateObj);
|
|
117
|
+
} catch {
|
|
118
|
+
return defaultString;
|
|
119
|
+
}
|
|
102
120
|
}
|
|
103
121
|
export function booleanToText(bool) {
|
|
104
122
|
return bool ? "Yes" : "No";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtify/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
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>",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
39
39
|
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
40
40
|
"lint": "eslint .",
|
|
41
|
+
"lint:fix": "eslint . --fix",
|
|
41
42
|
"test": "vitest run",
|
|
42
43
|
"test:watch": "vitest watch",
|
|
43
44
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
@@ -45,22 +46,22 @@
|
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@mdi/js": "^7.4.47",
|
|
47
48
|
"defu": "^6.1.4",
|
|
48
|
-
"vuetify-nuxt-module": "^0.
|
|
49
|
+
"vuetify-nuxt-module": "^0.19.2"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@nuxt/devtools": "^2.
|
|
52
|
-
"@nuxt/eslint": "^1.
|
|
52
|
+
"@nuxt/devtools": "^2.7.0",
|
|
53
|
+
"@nuxt/eslint": "^1.12.1",
|
|
53
54
|
"@nuxt/eslint-config": "^1.3.1",
|
|
54
|
-
"@nuxt/kit": "^3.
|
|
55
|
-
"@nuxt/module-builder": "^1.0.
|
|
56
|
-
"@nuxt/schema": "^3.
|
|
57
|
-
"@nuxt/test-utils": "^3.
|
|
58
|
-
"@types/node": "^22.
|
|
59
|
-
"changelogen": "^0.6.
|
|
60
|
-
"eslint": "^9.
|
|
61
|
-
"nuxt": "^3.
|
|
62
|
-
"typescript": "
|
|
63
|
-
"vitest": "^3.2.
|
|
64
|
-
"vue-tsc": "^2.2.
|
|
55
|
+
"@nuxt/kit": "^3.20.2",
|
|
56
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
57
|
+
"@nuxt/schema": "^3.20.2",
|
|
58
|
+
"@nuxt/test-utils": "^3.23.0",
|
|
59
|
+
"@types/node": "^22.19.7",
|
|
60
|
+
"changelogen": "^0.6.2",
|
|
61
|
+
"eslint": "^9.39.2",
|
|
62
|
+
"nuxt": "^3.20.2",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vitest": "^3.2.4",
|
|
65
|
+
"vue-tsc": "^2.2.12"
|
|
65
66
|
}
|
|
66
67
|
}
|