@beeport/widget 0.1.1 → 0.1.2
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/index.cjs +3 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/index.ts +5 -0
package/dist/index.cjs
CHANGED
|
@@ -51,6 +51,9 @@ function init(config) {
|
|
|
51
51
|
if (config.text !== void 0) {
|
|
52
52
|
script.setAttribute("data-text", config.text);
|
|
53
53
|
}
|
|
54
|
+
if (config.apiBase !== void 0) {
|
|
55
|
+
script.setAttribute("data-api-base", config.apiBase);
|
|
56
|
+
}
|
|
54
57
|
document.body.appendChild(script);
|
|
55
58
|
}
|
|
56
59
|
function destroy() {
|
package/dist/index.d.cts
CHANGED
|
@@ -21,6 +21,8 @@ interface BeePortConfig {
|
|
|
21
21
|
accent?: string;
|
|
22
22
|
/** Custom button label text. */
|
|
23
23
|
text?: string;
|
|
24
|
+
/** API base URL override (e.g. "https://api-dev.beeport.ai"). */
|
|
25
|
+
apiBase?: string;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Load and initialise the BeePort widget by injecting the CDN script tag.
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ interface BeePortConfig {
|
|
|
21
21
|
accent?: string;
|
|
22
22
|
/** Custom button label text. */
|
|
23
23
|
text?: string;
|
|
24
|
+
/** API base URL override (e.g. "https://api-dev.beeport.ai"). */
|
|
25
|
+
apiBase?: string;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Load and initialise the BeePort widget by injecting the CDN script tag.
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,9 @@ function init(config) {
|
|
|
23
23
|
if (config.text !== void 0) {
|
|
24
24
|
script.setAttribute("data-text", config.text);
|
|
25
25
|
}
|
|
26
|
+
if (config.apiBase !== void 0) {
|
|
27
|
+
script.setAttribute("data-api-base", config.apiBase);
|
|
28
|
+
}
|
|
26
29
|
document.body.appendChild(script);
|
|
27
30
|
}
|
|
28
31
|
function destroy() {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface BeePortConfig {
|
|
|
26
26
|
accent?: string;
|
|
27
27
|
/** Custom button label text. */
|
|
28
28
|
text?: string;
|
|
29
|
+
/** API base URL override (e.g. "https://api-dev.beeport.ai"). */
|
|
30
|
+
apiBase?: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
// ---------------------------------------------------------------------------
|
|
@@ -76,6 +78,9 @@ export function init(config: BeePortConfig): void {
|
|
|
76
78
|
if (config.text !== undefined) {
|
|
77
79
|
script.setAttribute("data-text", config.text);
|
|
78
80
|
}
|
|
81
|
+
if (config.apiBase !== undefined) {
|
|
82
|
+
script.setAttribute("data-api-base", config.apiBase);
|
|
83
|
+
}
|
|
79
84
|
|
|
80
85
|
document.body.appendChild(script);
|
|
81
86
|
}
|