@eka-care/medassist-widget-embed 0.0.0 → 0.0.1
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.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/src/medassist-widget.js +16 -16
- package/dist/src/medassist-widget.js.map +1 -1
- package/index.ts +6 -5
- package/package.json +2 -2
- package/src/medassist-widget.js +16 -16
- package/src/medassist-widget.js.map +1 -1
- package/test.html +5 -1
package/index.ts
CHANGED
|
@@ -108,7 +108,7 @@ class MedAssistWidgetLoader extends HTMLElement {
|
|
|
108
108
|
border-radius: 50%;
|
|
109
109
|
border: none;
|
|
110
110
|
cursor: pointer;
|
|
111
|
-
background-color:
|
|
111
|
+
background-color:rgb(255, 255, 255);
|
|
112
112
|
padding: 0;
|
|
113
113
|
display: flex;
|
|
114
114
|
align-items: center;
|
|
@@ -126,7 +126,7 @@ class MedAssistWidgetLoader extends HTMLElement {
|
|
|
126
126
|
z-index: 200000;
|
|
127
127
|
}
|
|
128
128
|
#medassist-open-btn:hover {
|
|
129
|
-
background-color:
|
|
129
|
+
background-color:rgb(239, 237, 245);
|
|
130
130
|
}
|
|
131
131
|
.hidden {
|
|
132
132
|
display: none;
|
|
@@ -163,7 +163,8 @@ class MedAssistWidgetLoader extends HTMLElement {
|
|
|
163
163
|
const button = shadowRoot.getElementById("medassist-open-btn");
|
|
164
164
|
const rootElement = shadowRoot.getElementById("medassist-widget-root");
|
|
165
165
|
const agentId = this.getAttribute("agent-id");
|
|
166
|
-
|
|
166
|
+
const iconUrl = this.getAttribute("icon-url") || this.defaultIconUrl;
|
|
167
|
+
console.log("iconUrl", iconUrl, this.defaultIconUrl);
|
|
167
168
|
if (!agentId) {
|
|
168
169
|
console.error("Agent ID is required");
|
|
169
170
|
return;
|
|
@@ -178,7 +179,7 @@ class MedAssistWidgetLoader extends HTMLElement {
|
|
|
178
179
|
rootElement.classList.remove("hidden");
|
|
179
180
|
|
|
180
181
|
if (this.widgetLoaded) {
|
|
181
|
-
window.renderMedAssist?.(rootElement, agentId);
|
|
182
|
+
window.renderMedAssist?.(rootElement, agentId, iconUrl);
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
185
|
|
|
@@ -188,7 +189,7 @@ class MedAssistWidgetLoader extends HTMLElement {
|
|
|
188
189
|
throw new Error("renderMedAssist is not available on window");
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
window.renderMedAssist(rootElement, agentId);
|
|
192
|
+
window.renderMedAssist(rootElement, agentId, iconUrl);
|
|
192
193
|
this.widgetLoaded = true;
|
|
193
194
|
} catch (error) {
|
|
194
195
|
console.error("Failed to load MedAssist widget", error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eka-care/medassist-widget-embed",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Embeddable MedAssist widget loader built with Web Components.",
|
|
5
5
|
"author": "Geethanjali S",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"build": "tsc -p tsconfig.json && node ./scripts/copy-widget-assets.mjs",
|
|
47
47
|
"verify-assets": "node ./scripts/verify-assets.mjs",
|
|
48
48
|
"prepublishOnly": "npm run verify-assets && npm run build",
|
|
49
|
-
"test": "cd ../widget && npm run build-dev && npm run build"
|
|
49
|
+
"test": "cd ../widget && npm run build-dev && cd ../widget-embed && npm run build"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|