vuetify-nuxt-module 0.5.15 → 0.5.16

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.ts CHANGED
@@ -250,7 +250,7 @@ interface MOptions {
250
250
  *
251
251
  * @default true
252
252
  */
253
- includeTransformAssetsUrls?: boolean;
253
+ includeTransformAssetsUrls?: boolean | Record<string, string[]>;
254
254
  /**
255
255
  * Vuetify SSR client hints.
256
256
  *
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.5.15"
7
+ "version": "0.5.16"
8
8
  }
package/dist/module.mjs CHANGED
@@ -12,7 +12,7 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
12
12
  import { isAbsolute, join, relative } from 'pathe';
13
13
  import { normalizePath as normalizePath$1 } from 'vite';
14
14
 
15
- const version = "0.5.15";
15
+ const version = "0.5.16";
16
16
 
17
17
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
18
18
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -670,6 +670,59 @@ function toKebabCase(str = "") {
670
670
  return kebab;
671
671
  }
672
672
  toKebabCase.cache = /* @__PURE__ */ new Map();
673
+ function camelize(str) {
674
+ if (camelize.cache.has(str))
675
+ return camelize.cache.get(str);
676
+ const camel = str.replace(/-([a-z0-9])/g, (g) => g[1].toUpperCase());
677
+ camelize.cache.set(str, camel);
678
+ return camel;
679
+ }
680
+ camelize.cache = /* @__PURE__ */ new Map();
681
+ function pascalize(str) {
682
+ if (pascalize.cache.has(str))
683
+ return pascalize.cache.get(str);
684
+ let pascal = camelize(str);
685
+ pascal = pascal.slice(0, 1).toUpperCase() + pascal.slice(1);
686
+ pascalize.cache.set(str, pascal);
687
+ return pascal;
688
+ }
689
+ pascalize.cache = /* @__PURE__ */ new Map();
690
+ function normalizeTransformAssetUrls(transformAssetUrls) {
691
+ const names = new Set(Object.keys(transformAssetUrls));
692
+ let kebab;
693
+ let pascal;
694
+ for (const name of names) {
695
+ transformAssetUrls[name] = normalizeTransformAssetUrlsAttrs(transformAssetUrls[name]);
696
+ kebab = toKebabCase(name);
697
+ pascal = pascalize(name);
698
+ if (!names.has(kebab))
699
+ transformAssetUrls[kebab] = [...transformAssetUrls[name]];
700
+ if (!names.has(pascal))
701
+ transformAssetUrls[pascal] = [...transformAssetUrls[name]];
702
+ }
703
+ return transformAssetUrls;
704
+ }
705
+ function normalizeTransformAssetUrlsAttrs(attrs) {
706
+ const result = /* @__PURE__ */ new Set();
707
+ let kebab;
708
+ let camel;
709
+ let bind;
710
+ let idx;
711
+ for (const attr of attrs) {
712
+ result.add(attr);
713
+ idx = attr.indexOf(":");
714
+ if (idx > 0)
715
+ continue;
716
+ bind = idx === 0;
717
+ kebab = toKebabCase(bind ? attr.slice(1) : attr);
718
+ camel = camelize(bind ? attr.slice(1) : attr);
719
+ result.add(kebab);
720
+ result.add(camel);
721
+ result.add(`:${kebab}`);
722
+ result.add(`:${camel}`);
723
+ }
724
+ return [...result];
725
+ }
673
726
 
674
727
  function vuetifyConfigurationPlugin(ctx) {
675
728
  return {
@@ -1185,7 +1238,9 @@ function configureNuxt(configKey, nuxt, ctx) {
1185
1238
  if (includeTransformAssetsUrls && typeof nuxt.options.vite.vue?.template?.transformAssetUrls === "undefined") {
1186
1239
  (_b = nuxt.options.vite).vue ?? (_b.vue = {});
1187
1240
  (_c = nuxt.options.vite.vue).template ?? (_c.template = {});
1188
- nuxt.options.vite.vue.template.transformAssetUrls = transformAssetUrls;
1241
+ nuxt.options.vite.vue.template.transformAssetUrls = normalizeTransformAssetUrls(
1242
+ typeof includeTransformAssetsUrls === "object" ? defu(includeTransformAssetsUrls, transformAssetUrls) : transformAssetUrls
1243
+ );
1189
1244
  }
1190
1245
  extendWebpackConfig(() => {
1191
1246
  throw new Error("Webpack is not supported: vuetify-nuxt-module module can only be used with Vite!");
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.5.15",
5
- "packageManager": "pnpm@8.9.0",
4
+ "version": "0.5.16",
5
+ "packageManager": "pnpm@8.9.2",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
8
8
  "license": "MIT",
@@ -128,4 +128,4 @@
128
128
  "installDependencies": false,
129
129
  "startCommand": "node .stackblitz.js && pnpm install && pnpm run dev"
130
130
  }
131
- }
131
+ }