@baziapi/widget 1.0.3 → 1.0.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/README.md CHANGED
@@ -23,7 +23,7 @@ Add the following snippet anywhere on your website:
23
23
  | Attribute | Type | Default | Description |
24
24
  | :-------------- | :------------------ | :--------------------------------- | :-------------------------------------------- |
25
25
  | `data-api-key` | string | **Required** | Your publishable BaZi API Key |
26
- | `data-base-url` | string | `"https://api.example.com/api/v1"` | API Base URL (for testing or proxy endpoints) |
26
+ | `data-base-url` | string | `"https://api.baziapi.pro/api/v1"` | API Base URL (for testing or proxy endpoints) |
27
27
  | `data-theme` | `'light' \| 'dark'` | `'light'` | Theme preference |
28
28
  | `data-lang` | `'en' \| 'zh'` | `'en'` | Default language for chart outputs |
29
29
 
package/dist/widget.cjs CHANGED
@@ -193,10 +193,8 @@
193
193
  const container = document.getElementById(WIDGET_CONTAINER_ID);
194
194
  if (!container) return;
195
195
  const apiKey = container.getAttribute("data-api-key") || "";
196
- const baseUrl = (container.getAttribute("data-base-url") || "https://api.example.com").replace(
197
- /\/$/,
198
- ""
199
- );
196
+ const rawBaseUrl = (container.getAttribute("data-base-url") || "https://api.baziapi.pro").trim().replace(/\/+$/, "");
197
+ const baseUrl = rawBaseUrl.replace(/\/api\/v1\/?$/, "").replace(/\/api\/?$/, "");
200
198
  injectStyles();
201
199
  container.innerHTML = `
202
200
  <div class="bazi-widget-container">
package/dist/widget.mjs CHANGED
@@ -191,10 +191,8 @@
191
191
  const container = document.getElementById(WIDGET_CONTAINER_ID);
192
192
  if (!container) return;
193
193
  const apiKey = container.getAttribute("data-api-key") || "";
194
- const baseUrl = (container.getAttribute("data-base-url") || "https://api.example.com").replace(
195
- /\/$/,
196
- ""
197
- );
194
+ const rawBaseUrl = (container.getAttribute("data-base-url") || "https://api.baziapi.pro").trim().replace(/\/+$/, "");
195
+ const baseUrl = rawBaseUrl.replace(/\/api\/v1\/?$/, "").replace(/\/api\/?$/, "");
198
196
  injectStyles();
199
197
  container.innerHTML = `
200
198
  <div class="bazi-widget-container">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baziapi/widget",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "Embeddable interactive Web Widget for BaZi Four Pillars calculator",
6
6
  "author": "Md. Nasir Uddin Shoyas",
@@ -14,22 +14,17 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
- "scripts": {
18
- "build": "unbuild",
19
- "dev": "unbuild --stub",
20
- "lint": "eslint src"
21
- },
22
17
  "devDependencies": {
23
18
  "typescript": "^5.6.3",
24
19
  "unbuild": "^3.0.0"
25
20
  },
26
- "homepage": "https://github.com/Shoyas/bazi-api-sdk#readme",
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/Shoyas/bazi-api-sdk.git",
30
- "directory": "packages/bazi-widget"
31
- },
21
+ "homepage": "https://baziapi.pro",
32
22
  "bugs": {
33
- "url": "https://github.com/Shoyas/bazi-api-sdk/issues"
23
+ "url": "https://baziapi.pro"
24
+ },
25
+ "scripts": {
26
+ "build": "unbuild",
27
+ "dev": "unbuild --stub",
28
+ "lint": "eslint src"
34
29
  }
35
- }
30
+ }