@katlux/toolkit 0.1.0-beta.3 → 0.1.0-beta.5

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.
@@ -0,0 +1,11 @@
1
+ export const useDebounce = (callback, delay) => {
2
+ let timeoutId = null;
3
+ return function(...args) {
4
+ if (timeoutId !== null) {
5
+ clearTimeout(timeoutId);
6
+ }
7
+ timeoutId = setTimeout(() => {
8
+ callback.apply(this, args);
9
+ }, delay);
10
+ };
11
+ };
@@ -0,0 +1,170 @@
1
+ import { EDataFilterOperator } from "@katlux/providers";
2
+ export const useFilterLogic = () => {
3
+ const evaluateFilter = (filter, row) => {
4
+ if (filter.operator === EDataFilterOperator.And || filter.operator === EDataFilterOperator.Or || filter.operator === EDataFilterOperator.Nand || filter.operator === EDataFilterOperator.Nor) {
5
+ return !filter.active || applyOperator(filter.operator, row, filter.field);
6
+ }
7
+ if ("operator" in filter.field && "field" in filter.field) {
8
+ return !filter.active || evaluateFilter(filter.field, row);
9
+ }
10
+ const field = filter.field;
11
+ const fieldKeys = Object.keys(field);
12
+ return !filter.active || fieldKeys.every((key) => {
13
+ const filterValue = field[key];
14
+ const rowValue = row[key];
15
+ return applyOperator(filter.operator, rowValue, filterValue);
16
+ });
17
+ };
18
+ const applyOperator = (operator, rowValue, filterValue) => {
19
+ switch (operator) {
20
+ case EDataFilterOperator.And:
21
+ return compareAnd(rowValue, filterValue);
22
+ case EDataFilterOperator.Or:
23
+ return compareOr(rowValue, filterValue);
24
+ case EDataFilterOperator.Nand:
25
+ return !compareAnd(rowValue, filterValue);
26
+ case EDataFilterOperator.Nor:
27
+ return !compareOr(rowValue, filterValue);
28
+ case EDataFilterOperator.Equal:
29
+ return compareEqual(rowValue, filterValue);
30
+ case EDataFilterOperator.NotEqual:
31
+ return !compareEqual(rowValue, filterValue);
32
+ case EDataFilterOperator.GreaterThan:
33
+ return compareValues(rowValue, filterValue) > 0;
34
+ case EDataFilterOperator.LessThan:
35
+ return compareValues(rowValue, filterValue) < 0;
36
+ case EDataFilterOperator.GreaterThanOrEqual:
37
+ return compareValues(rowValue, filterValue) >= 0;
38
+ case EDataFilterOperator.LessThanOrEqual:
39
+ return compareValues(rowValue, filterValue) <= 0;
40
+ case EDataFilterOperator.In:
41
+ return compareIn(rowValue, filterValue);
42
+ case EDataFilterOperator.NotIn:
43
+ return !compareIn(rowValue, filterValue);
44
+ default:
45
+ return compareEqual(rowValue, filterValue);
46
+ }
47
+ };
48
+ const compareAnd = (row, nested) => {
49
+ const subFilters = Array.isArray(nested) ? nested : nested && typeof nested === "object" ? Object.values(nested) : [];
50
+ const validFilters = subFilters.filter((f) => f && typeof f === "object" && "operator" in f && "field" in f);
51
+ if (validFilters.length === 0) return true;
52
+ return validFilters.every((f) => {
53
+ const active = f.active !== false;
54
+ return active ? evaluateFilter(f, row) : true;
55
+ });
56
+ };
57
+ const compareOr = (row, nested) => {
58
+ const subFilters = Array.isArray(nested) ? nested : nested && typeof nested === "object" ? Object.values(nested) : [];
59
+ const validFilters = subFilters.filter((f) => f && typeof f === "object" && "operator" in f && "field" in f);
60
+ const activeFilters = validFilters.filter((f) => f.active !== false);
61
+ if (activeFilters.length === 0) return true;
62
+ return activeFilters.some((f) => {
63
+ return evaluateFilter(f, row);
64
+ });
65
+ };
66
+ const compareIn = (rowValue, filterValue) => {
67
+ if (typeof rowValue === "string" && typeof filterValue === "string") {
68
+ return rowValue.toLowerCase().includes(filterValue.toLowerCase());
69
+ }
70
+ return false;
71
+ };
72
+ const compareEqual = (rowValue, filterValue) => {
73
+ if (typeof rowValue === "string" && typeof filterValue === "string") {
74
+ return rowValue.toLowerCase() == filterValue.toLowerCase();
75
+ }
76
+ if (typeof rowValue === "number" && typeof filterValue === "number") {
77
+ return rowValue === filterValue;
78
+ }
79
+ if (typeof rowValue === "boolean" && typeof filterValue === "boolean") {
80
+ return rowValue === filterValue;
81
+ }
82
+ return rowValue === filterValue;
83
+ };
84
+ const compareValues = (rowValue, filterValue) => {
85
+ if (rowValue == null || filterValue == null) {
86
+ return rowValue == null ? -1 : 1;
87
+ }
88
+ if (typeof rowValue === "string" && typeof filterValue === "string") {
89
+ return rowValue.localeCompare(filterValue);
90
+ }
91
+ if (typeof rowValue === "number" && typeof filterValue === "number") {
92
+ return rowValue - filterValue;
93
+ }
94
+ return String(rowValue).localeCompare(String(filterValue));
95
+ };
96
+ const filterTreeData = (nodes, filter, options) => {
97
+ const { idKey, parentKey } = options;
98
+ const nodeMap = new Map(nodes.map((node) => [node[idKey], node]));
99
+ const childrenMap = /* @__PURE__ */ new Map();
100
+ nodes.forEach((node) => {
101
+ const pId = node[parentKey];
102
+ if (pId != null) {
103
+ if (!childrenMap.has(pId)) {
104
+ childrenMap.set(pId, []);
105
+ }
106
+ childrenMap.get(pId).push(node);
107
+ }
108
+ });
109
+ const matchingNodeIds = /* @__PURE__ */ new Set();
110
+ const expandedNodes = /* @__PURE__ */ new Set();
111
+ const visibleNodeIds = /* @__PURE__ */ new Set();
112
+ nodes.forEach((node) => {
113
+ const evalRow = node.data ? { ...node.data, ...node } : node;
114
+ if (evaluateFilter(filter, evalRow)) {
115
+ matchingNodeIds.add(node[idKey]);
116
+ }
117
+ });
118
+ const addDescendants = (nodeId) => {
119
+ const children = childrenMap.get(nodeId);
120
+ if (children && children.length > 0) {
121
+ expandedNodes.add(nodeId);
122
+ children.forEach((child) => {
123
+ visibleNodeIds.add(child[idKey]);
124
+ addDescendants(child[idKey]);
125
+ });
126
+ }
127
+ };
128
+ matchingNodeIds.forEach((id) => {
129
+ visibleNodeIds.add(id);
130
+ addDescendants(id);
131
+ let currentId = id;
132
+ while (currentId != null) {
133
+ visibleNodeIds.add(currentId);
134
+ const node = nodeMap.get(currentId);
135
+ if (node) {
136
+ if (node[parentKey] != null) {
137
+ expandedNodes.add(node[parentKey]);
138
+ currentId = node[parentKey];
139
+ } else {
140
+ currentId = null;
141
+ }
142
+ } else {
143
+ break;
144
+ }
145
+ }
146
+ });
147
+ const visibleNodes = nodes.filter((node) => visibleNodeIds.has(node[idKey]));
148
+ return {
149
+ visibleNodes,
150
+ expandedNodes
151
+ };
152
+ };
153
+ const filterData = (data, filter, options) => {
154
+ if (options?.treeOptions) {
155
+ const { visibleNodes, expandedNodes } = filterTreeData(
156
+ data,
157
+ filter,
158
+ options.treeOptions
159
+ );
160
+ return { results: visibleNodes, expandedNodes };
161
+ }
162
+ const results = data.filter((row) => evaluateFilter(filter, row));
163
+ return { results };
164
+ };
165
+ return {
166
+ evaluateFilter,
167
+ filterTreeData,
168
+ filterData
169
+ };
170
+ };
@@ -0,0 +1,36 @@
1
+ import { computed, defineAsyncComponent } from "vue";
2
+ import { useAppConfig } from "#app";
3
+ const componentCache = /* @__PURE__ */ new Map();
4
+ const modernComponents = import.meta.glob("../../../../katlux-preset-modern/src/runtime/components/**/*.vue");
5
+ const toolkitPresets = import.meta.glob("../presets/**/*.vue");
6
+ export function usePresetComponent(componentBaseName, defaultComponent) {
7
+ const appConfig = useAppConfig();
8
+ const activePreset = computed(() => appConfig.katluxToolkit?.activePreset || "default");
9
+ return computed(() => {
10
+ if (activePreset.value === "default") {
11
+ return defaultComponent;
12
+ }
13
+ const cacheKey = `${activePreset.value}:${componentBaseName}`;
14
+ if (componentCache.has(cacheKey)) {
15
+ return componentCache.get(cacheKey);
16
+ }
17
+ let loader;
18
+ if (activePreset.value === "modern") {
19
+ const path = `../../../../katlux-preset-modern/src/runtime/components/${componentBaseName}/${componentBaseName}.vue`;
20
+ loader = modernComponents[path];
21
+ } else {
22
+ const path = `../presets/${activePreset.value}/components/${componentBaseName}/${componentBaseName}.vue`;
23
+ loader = toolkitPresets[path];
24
+ }
25
+ if (!loader) {
26
+ console.warn(`[${componentBaseName}] Preset "${activePreset.value}" not found, falling back to default`);
27
+ return defaultComponent;
28
+ }
29
+ const asyncComp = defineAsyncComponent({
30
+ loader,
31
+ errorComponent: defaultComponent
32
+ });
33
+ componentCache.set(cacheKey, asyncComp);
34
+ return asyncComp;
35
+ });
36
+ }
@@ -0,0 +1,17 @@
1
+ export const useRemainingTime = () => {
2
+ const formatRemainingTime = (ms) => {
3
+ if (ms <= 0) return "expired";
4
+ const seconds = Math.floor(ms / 1e3);
5
+ const minutes = Math.floor(seconds / 60);
6
+ const hours = Math.floor(minutes / 60);
7
+ const days = Math.floor(hours / 24);
8
+ if (days > 0) return `${days}d`;
9
+ if (hours > 0) return `${hours}h`;
10
+ if (minutes > 0) return `${minutes}m`;
11
+ if (seconds > 0) return `${seconds}s`;
12
+ return "0s";
13
+ };
14
+ return {
15
+ formatRemainingTime
16
+ };
17
+ };
@@ -0,0 +1,55 @@
1
+ export const useSortLogic = () => {
2
+ const sortData = (sortList, rows) => {
3
+ if (!sortList || sortList.length === 0 || !rows || rows.length === 0) {
4
+ return rows;
5
+ }
6
+ const sortedRows = [...rows];
7
+ const compare = (a, b) => {
8
+ for (const sort of sortList) {
9
+ const aVal = a[sort.field];
10
+ const bVal = b[sort.field];
11
+ if (aVal === null || aVal === void 0) {
12
+ if (bVal === null || bVal === void 0) continue;
13
+ return sort.direction === "asc" ? -1 : 1;
14
+ }
15
+ if (bVal === null || bVal === void 0) {
16
+ return sort.direction === "asc" ? 1 : -1;
17
+ }
18
+ if (aVal < bVal) {
19
+ return sort.direction === "asc" ? -1 : 1;
20
+ } else if (aVal > bVal) {
21
+ return sort.direction === "asc" ? 1 : -1;
22
+ }
23
+ }
24
+ return 0;
25
+ };
26
+ const merge = (left, right) => {
27
+ const result = [];
28
+ let leftIndex = 0;
29
+ let rightIndex = 0;
30
+ while (leftIndex < left.length && rightIndex < right.length) {
31
+ if (compare(left[leftIndex], right[rightIndex]) <= 0) {
32
+ result.push(left[leftIndex]);
33
+ leftIndex++;
34
+ } else {
35
+ result.push(right[rightIndex]);
36
+ rightIndex++;
37
+ }
38
+ }
39
+ return result.concat(left.slice(leftIndex)).concat(right.slice(rightIndex));
40
+ };
41
+ const mergeSort = (arr) => {
42
+ if (arr.length <= 1) {
43
+ return arr;
44
+ }
45
+ const mid = Math.floor(arr.length / 2);
46
+ const left = mergeSort(arr.slice(0, mid));
47
+ const right = mergeSort(arr.slice(mid));
48
+ return merge(left, right);
49
+ };
50
+ return mergeSort(sortedRows);
51
+ };
52
+ return {
53
+ sortData
54
+ };
55
+ };
@@ -0,0 +1,70 @@
1
+ import { ref, computed, onMounted } from "vue";
2
+ import { useTemplateResolver } from "../utils/TemplateResolver";
3
+ export function useTemplate(options) {
4
+ const { componentName, fallbackToDefault = true } = options;
5
+ const resolver = useTemplateResolver();
6
+ const metadata = ref(resolver.resolveTemplate(componentName));
7
+ const isLoading = ref(false);
8
+ const error = ref(null);
9
+ const isCustomTemplate = computed(() => {
10
+ return metadata.value.hasCustomTemplate && metadata.value.templateName !== "default";
11
+ });
12
+ const templateName = computed(() => {
13
+ return metadata.value.templateName;
14
+ });
15
+ const refreshTemplate = () => {
16
+ try {
17
+ isLoading.value = true;
18
+ error.value = null;
19
+ resolver.clearCache();
20
+ metadata.value = resolver.resolveTemplate(componentName);
21
+ } catch (e) {
22
+ error.value = e;
23
+ console.error(`Failed to refresh template for ${componentName}:`, e);
24
+ if (fallbackToDefault) {
25
+ console.warn(`Falling back to default template for ${componentName}`);
26
+ resolver.setActiveTemplate("default");
27
+ metadata.value = resolver.resolveTemplate(componentName);
28
+ }
29
+ } finally {
30
+ isLoading.value = false;
31
+ }
32
+ };
33
+ onMounted(() => {
34
+ refreshTemplate();
35
+ });
36
+ return {
37
+ metadata,
38
+ isCustomTemplate,
39
+ templateName,
40
+ isLoading,
41
+ error,
42
+ refreshTemplate
43
+ };
44
+ }
45
+ export function useTemplateStyles(componentName) {
46
+ const resolver = useTemplateResolver();
47
+ const metadata = resolver.resolveTemplate(componentName);
48
+ const isLoaded = ref(false);
49
+ const error = ref(null);
50
+ const loadStyles = async () => {
51
+ if (!metadata.hasCustomStyles || !metadata.stylesPath) {
52
+ isLoaded.value = true;
53
+ return;
54
+ }
55
+ try {
56
+ isLoaded.value = true;
57
+ } catch (e) {
58
+ error.value = e;
59
+ console.error(`Failed to load styles for ${componentName}:`, e);
60
+ }
61
+ };
62
+ onMounted(() => {
63
+ loadStyles();
64
+ });
65
+ return {
66
+ isLoaded,
67
+ error,
68
+ loadStyles
69
+ };
70
+ }
@@ -0,0 +1,100 @@
1
+ import { useRuntimeConfig, useAppConfig, useCookie, useNuxtApp } from "#app";
2
+ export class PresetResolver {
3
+ cache = {};
4
+ activePreset = "default";
5
+ presetsDir = "~/presets";
6
+ constructor() {
7
+ this.initialize();
8
+ }
9
+ /**
10
+ * Initialize the preset resolver with configuration
11
+ */
12
+ initialize() {
13
+ try {
14
+ const appConfig = useAppConfig();
15
+ const runtimeConfig = useRuntimeConfig();
16
+ const presetCookie = useCookie("katlux-active-preset");
17
+ if (presetCookie.value) {
18
+ this.activePreset = presetCookie.value;
19
+ } else if (appConfig.katluxToolkit?.activePreset) {
20
+ this.activePreset = appConfig.katluxToolkit.activePreset;
21
+ }
22
+ const publicConfig = runtimeConfig.public;
23
+ if (publicConfig?.katluxToolkit?.presetsDir) {
24
+ this.presetsDir = publicConfig.katluxToolkit.presetsDir;
25
+ }
26
+ } catch (error) {
27
+ console.warn("PresetResolver: Could not load configuration, using defaults", error);
28
+ }
29
+ }
30
+ /**
31
+ * Resolve preset metadata for a given component
32
+ * @param componentName - Name of the component (e.g., 'KButton')
33
+ * @returns Preset metadata including paths and availability
34
+ */
35
+ resolvePreset(componentName) {
36
+ const cacheKey = `${this.activePreset}:${componentName}`;
37
+ if (this.cache[cacheKey]) {
38
+ return this.cache[cacheKey];
39
+ }
40
+ const metadata = {
41
+ componentName,
42
+ presetName: this.activePreset,
43
+ hasCustomPreset: false,
44
+ hasCustomStyles: false
45
+ };
46
+ if (this.activePreset !== "default") {
47
+ const customPresetPath = `${this.presetsDir}/${this.activePreset}/${componentName}.pug`;
48
+ const customStylesPath = `${this.presetsDir}/${this.activePreset}/${componentName}.scss`;
49
+ metadata.presetPath = customPresetPath;
50
+ metadata.stylesPath = customStylesPath;
51
+ metadata.hasCustomPreset = true;
52
+ metadata.hasCustomStyles = true;
53
+ }
54
+ this.cache[cacheKey] = metadata;
55
+ return metadata;
56
+ }
57
+ /**
58
+ * Get the active preset name
59
+ */
60
+ getActivePreset() {
61
+ return this.activePreset;
62
+ }
63
+ /**
64
+ * Set the active preset (useful for runtime switching)
65
+ * @param presetName - Name of the preset to activate
66
+ */
67
+ setActivePreset(presetName) {
68
+ if (this.activePreset !== presetName) {
69
+ this.activePreset = presetName;
70
+ this.clearCache();
71
+ const presetCookie = useCookie("katlux-active-preset");
72
+ presetCookie.value = presetName;
73
+ }
74
+ }
75
+ /**
76
+ * Clear the preset cache (useful when presets change in dev mode)
77
+ */
78
+ clearCache() {
79
+ this.cache = {};
80
+ }
81
+ /**
82
+ * Get all cached preset metadata
83
+ */
84
+ getCachedPresets() {
85
+ return { ...this.cache };
86
+ }
87
+ /**
88
+ * Check if a custom preset exists for a component
89
+ * @param componentName - Name of the component
90
+ * @returns True if custom preset exists
91
+ */
92
+ hasCustomPreset(componentName) {
93
+ const metadata = this.resolvePreset(componentName);
94
+ return metadata.hasCustomPreset;
95
+ }
96
+ }
97
+ export function usePresetResolver() {
98
+ const nuxtApp = useNuxtApp();
99
+ return nuxtApp.$presetResolver;
100
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ const kit = require('@nuxt/kit');
4
+
5
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
+ const module$1 = kit.defineNuxtModule({
7
+ meta: {
8
+ name: "@katlux/toolkit",
9
+ configKey: "katluxToolkit"
10
+ },
11
+ setup(options, nuxt) {
12
+ const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
13
+ kit.addComponentsDir({
14
+ path: resolve("./runtime/components"),
15
+ pathPrefix: false,
16
+ extensions: ["vue"],
17
+ global: true
18
+ });
19
+ kit.addImportsDir(resolve("./runtime/composables"));
20
+ kit.addPlugin(resolve("./runtime/plugins/registerDirectives"));
21
+ kit.addPlugin(resolve("./runtime/plugins/PresetPlugin"));
22
+ nuxt.options.alias["#toolkit"] = resolve("./runtime");
23
+ nuxt.hook("prepare:types", (options2) => {
24
+ options2.tsConfig.compilerOptions = options2.tsConfig.compilerOptions || {};
25
+ options2.tsConfig.compilerOptions.allowArbitraryExtensions = true;
26
+ });
27
+ }
28
+ });
29
+
30
+ module.exports = module$1;
@@ -0,0 +1,5 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
4
+
5
+ export = _default;
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.0-beta.1",
4
+ "version": "0.1.0-beta.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  }>> & Readonly<{
47
47
  onClick?: (() => any) | undefined;
48
48
  }>, {
49
- size: "large" | "medium" | "small" | undefined;
49
+ size: "small" | "large" | "medium" | undefined;
50
50
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
51
51
  disabled: boolean;
52
52
  href: string;
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
46
46
  }>> & Readonly<{
47
47
  onClick?: (() => any) | undefined;
48
48
  }>, {
49
- size: "large" | "medium" | "small" | undefined;
49
+ size: "small" | "large" | "medium" | undefined;
50
50
  type: "info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | undefined;
51
51
  disabled: boolean;
52
52
  href: string;
@@ -22,7 +22,7 @@ export interface KButtonEmits {
22
22
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
23
23
  isLink: import("vue").ComputedRef<boolean>;
24
24
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
25
- buttonClasses: import("vue").ComputedRef<("info" | "default" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | "small" | {
25
+ buttonClasses: import("vue").ComputedRef<("info" | "default" | "small" | "primary" | "danger" | "success" | "warning" | "light" | "dark" | "large" | "medium" | {
26
26
  disabled: boolean | undefined;
27
27
  })[]>;
28
28
  onClick: () => void;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ bulkActions: IKDatatableAction[];
14
15
  search: string;
15
16
  loading: boolean;
16
- bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
@@ -11,9 +11,9 @@ interface Props {
11
11
  page?: number;
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ bulkActions: IKDatatableAction[];
14
15
  search: string;
15
16
  loading: boolean;
16
- bulkActions: IKDatatableAction[];
17
17
  visibleFields: Array<string> | null;
18
18
  rowActions: IKDatatableAction[];
19
19
  itemsPerPage: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",
@@ -9,9 +9,10 @@
9
9
  },
10
10
  "main": "./dist/module.mjs",
11
11
  "scripts": {
12
- "build": "nuxt-module-build build",
12
+ "build": "nuxt-module-build build && unbuild",
13
13
  "dev": "nuxt-module-build build --stub",
14
- "prepare": "nuxi prepare"
14
+ "prepare": "nuxi prepare",
15
+ "prepublishOnly": "npm run build"
15
16
  },
16
17
  "exports": {
17
18
  ".": {
@@ -23,12 +24,12 @@
23
24
  "./components/*": "./dist/runtime/components/*",
24
25
  "./composables/*": {
25
26
  "types": "./dist/runtime/composables/*.d.ts",
26
- "default": "./dist/runtime/composables/*.ts"
27
+ "default": "./dist/compiled/composables/*.mjs"
27
28
  },
28
29
  "./plugins/*": "./dist/runtime/plugins/*",
29
30
  "./utils/*": {
30
31
  "types": "./dist/runtime/utils/*.d.ts",
31
- "default": "./dist/runtime/utils/*.ts"
32
+ "default": "./dist/compiled/utils/*.mjs"
32
33
  },
33
34
  "./presets/*": "./dist/runtime/presets/*",
34
35
  "./dist/runtime/presets/*": "./dist/runtime/presets/*"