nuxt-glorious 1.2.9-8-1 → 1.2.9-8-4

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,5 +1,5 @@
1
1
  {
2
2
  "name": "nuxt-glorious",
3
3
  "configKey": "glorious",
4
- "version": "1.2.9-8-1"
4
+ "version": "1.2.9-8-4"
5
5
  }
@@ -10,7 +10,7 @@ const props: any = defineProps(_props)
10
10
  :aria-label="props.ariaLabel"
11
11
  :class="[
12
12
  `glorious-button`,
13
- `color-${props.color}`,
13
+ `button-color-${props.color}`,
14
14
  `size-${props.size}`,
15
15
  props.outline ? 'outline' : '',
16
16
  ]"
@@ -14,13 +14,17 @@ const defaultOptions = {
14
14
  bodyType: "normal",
15
15
  credentials: "same-origin"
16
16
  };
17
- export default function(url, options = defaultOptions) {
17
+ export default async function(url, options = defaultOptions) {
18
18
  const moduleConfig = useRuntimeConfig();
19
19
  options = defu(moduleConfig.public.glorious.fetch, options, defaultOptions);
20
20
  const gs = GloriousStore();
21
21
  const gKey = computeGKey(options.gKey, url);
22
22
  options.params = computeParams(options.params);
23
- options.headers = { ...options.headers, ...computeAuth() };
23
+ options.headers = {
24
+ ...options.headers,
25
+ ...computeAuth(),
26
+ ...await computeHeaderFetch()
27
+ };
24
28
  if (options.bodyType === "formData") options.body = computeFormData(options);
25
29
  const opt = {
26
30
  ...options,
@@ -96,3 +100,12 @@ function computeFormData(options) {
96
100
  });
97
101
  return form;
98
102
  }
103
+ async function computeHeaderFetch() {
104
+ const fetch = import.meta.glob("/glorious/fetch.ts");
105
+ let data = {};
106
+ if (typeof fetch["/glorious/fetch.ts"] !== "undefined") {
107
+ data = await fetch["/glorious/fetch.ts"]();
108
+ data = data.fetchHandler.headers();
109
+ }
110
+ return data;
111
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.9-8-1",
2
+ "version": "1.2.9-8-4",
3
3
  "name": "nuxt-glorious",
4
4
  "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
5
  "repository": "sajadhzj/nuxt-glorious",