hamzus-ui 0.0.144 → 0.0.146

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/index.d.ts CHANGED
@@ -63,7 +63,7 @@ export * as Sidebar from "./src/layout/Sidebar"
63
63
  export { default as Portal } from "./src/components/hamzus-ui/Portal/Portal.svelte"
64
64
 
65
65
  // utils
66
- export { config as config } from "./src/utils/hamzus.config.js"
66
+ export { config, init } from "./src/utils/hamzus.config.js";
67
67
  export { getCookie as getCookie } from "./src/utils/clientCookie.js"
68
68
  export { setCookie as setCookie } from "./src/utils/clientCookie.js"
69
69
  export { decode as decode } from "./src/utils/polyfill.js"
package/index.js CHANGED
@@ -60,7 +60,7 @@ export * as Sidebar from "./src/layout/Sidebar"
60
60
  export { default as Portal } from "./src/components/hamzus-ui/Portal/Portal.svelte"
61
61
 
62
62
  // utils
63
- export { config as config } from "./src/utils/hamzus.config.js"
63
+ export { config, init } from "./src/utils/hamzus.config.js";
64
64
  export { getCookie as getCookie } from "./src/utils/clientCookie.js"
65
65
  export { setCookie as setCookie } from "./src/utils/clientCookie.js"
66
66
  export { decode as decode } from "./src/utils/polyfill.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.144",
3
+ "version": "0.0.146",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -1,4 +1,12 @@
1
1
  export let config = {
2
- url: import.meta.env.VITE_API_URL || "http://localhost:8000",// default url for api request
3
- sessionTokenName: import.meta.env.VITE_TOKEN_NAME || "token", // cookie name where your token is stored
2
+ url: "http://localhost:8000",// default url for api request
3
+ sessionTokenName: "token", // cookie name where your token is stored
4
+ }
5
+
6
+ export function init(options = {
7
+ url : "http://localhost:8000",
8
+ sessionTokenName : "token"
9
+ }) {
10
+ config.url = options.url || "http://localhost:8000";
11
+ config.sessionTokenName = options.sessionTokenName || "token";
4
12
  }