@luzmo/embed 6.13.5 → 7.0.0-es2021
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/CHANGELOG.md +14 -0
- package/README.md +54 -15
- package/index.cjs +109 -55
- package/index.js +109 -55
- package/luzmo-embed.min.js +325 -133
- package/package.json +9 -3
- package/src/lib/dashboard/dashboard-base.d.ts +1 -2
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +10 -11
- package/src/lib/viz-item/viz-item.base.d.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [7.0.0] - 2026-07-20
|
|
6
|
+
|
|
7
|
+
### Removed
|
|
8
|
+
- Removed the `accentColor` property and `accent-color` attribute from `<luzmo-embed-dashboard>`.
|
|
9
|
+
- Removed the `qeVersion` property and `qe-version` attribute from `<luzmo-embed-dashboard>`.
|
|
10
|
+
|
|
11
|
+
## [6.13.6] - 2026-07-03
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `getDashboardContext()` on `<luzmo-embed-dashboard>`, returning the live dashboard context as the unified `dashboard` aiprompt input (`{ type, value }`, where `value` carries the current screen mode as `value.currentScreenMode`) in both iframe and web-component embed modes.
|
|
15
|
+
- `getVizItemContext()` on `<luzmo-embed-viz-item>`, returning a flex chart's live context (id, type, slots, options, filters and datasetIds).
|
|
16
|
+
- `contextChanged` event on `<luzmo-embed-dashboard>` and `<luzmo-embed-viz-item>`, emitted on any change and carrying the full context.
|
|
17
|
+
- Context-aware IQ chat: `dashboardId`, `contextIds` and `availableDatasets` properties on `<luzmo-iq-embed-chat>` to auto-connect the chat to an embedded dashboard or flex charts on the same page, plus a `connectionStatusChanged` event reporting `standalone` / `connecting` / `connected` / `not-found`.
|
|
18
|
+
|
|
5
19
|
## [6.13.5] - 2026-06-09
|
|
6
20
|
|
|
7
21
|
### Fixed
|
package/README.md
CHANGED
|
@@ -82,13 +82,14 @@ Below a list of available properties on the viz item web component
|
|
|
82
82
|
|
|
83
83
|
### Events luzmo-embed-viz-item
|
|
84
84
|
|
|
85
|
-
| Name | Description
|
|
86
|
-
|
|
87
|
-
| changedFilters | Emitted when filters are changed
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
85
|
+
| Name | Description |
|
|
86
|
+
|----------------|-------------------------------------------------------------|
|
|
87
|
+
| changedFilters | Emitted when filters are changed |
|
|
88
|
+
| contextChanged | Emitted on any change, carries the full viz-item context |
|
|
89
|
+
| customEvent | Emitted when a custom event is fired |
|
|
90
|
+
| exported | Emitted when export completes or fails |
|
|
91
|
+
| rendered | Emitted when the item is rendered |
|
|
92
|
+
| load | Emitted when viz item is loaded |
|
|
92
93
|
|
|
93
94
|
<br/>
|
|
94
95
|
|
|
@@ -101,6 +102,10 @@ getData(): ItemData;
|
|
|
101
102
|
// Return an array of active filters on the viz item.
|
|
102
103
|
getFilters(): FilterGroup[];
|
|
103
104
|
|
|
105
|
+
// Return the live context of the viz item: id (contextId/DOM id), type, slots, options, filters and datasetIds.
|
|
106
|
+
// Used to feed a flex chart's context into an IQ chat or an /aiprompt call.
|
|
107
|
+
getVizItemContext(): VizItemContext;
|
|
108
|
+
|
|
104
109
|
// Refresh the data of the viz item.
|
|
105
110
|
refreshData(): void;
|
|
106
111
|
|
|
@@ -190,19 +195,19 @@ Below a list of available properties on the dashboard web component
|
|
|
190
195
|
| `apiHost` | string | API server to connect to (Default: 'https://api.luzmo.com/' , for US set apiHost to 'https://api.us.luzmo.com/') |
|
|
191
196
|
| `editMode` | string | Specifies if the embedded dashboard should be editable or not. Accepted values: "view" , "editLimited" , "editFull" . Use "view" if you don't want the embedded dashboard to be editable. (Default: "view" ) |
|
|
192
197
|
| `mainColor` | string | Optional override of the main color used in the whitelabeling of the embedded dashboard editor. If not provided, the main color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
|
|
193
|
-
| `accentColor` | string | Optional override of the accent color used in the whitelabeling of the embedded dashboard editor. If not provided, the accent color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
|
|
194
198
|
|
|
195
199
|
<br/>
|
|
196
200
|
|
|
197
201
|
### Events luzmo-embed-dashboard
|
|
198
202
|
|
|
199
|
-
| Name | Description
|
|
200
|
-
| -------------- |
|
|
201
|
-
| changedFilters | Emitted when filters are changed
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
203
|
+
| Name | Description | Event Arguments |
|
|
204
|
+
| -------------- | ------------------------------------------------------------ | ---------------------- |
|
|
205
|
+
| changedFilters | Emitted when filters are changed | `ChangedFiltersEvent` |
|
|
206
|
+
| contextChanged | Emitted on any dashboard change, carries the full context | `ContextChangedEvent` |
|
|
207
|
+
| customEvent | Emitted when a custom event is fired | `CustomEvent` |
|
|
208
|
+
| exported | Emitted when export completes or fails | `ExportedEvent` |
|
|
209
|
+
| itemsRendered | Emitted when all items are rendered | `ItemsRenderedEvent` |
|
|
210
|
+
| load | Emitted when dashboard is loaded | `LoadEvent` |
|
|
206
211
|
|
|
207
212
|
<br/>
|
|
208
213
|
|
|
@@ -218,6 +223,13 @@ getData(itemId: string): Promise<ItemData>;
|
|
|
218
223
|
// Returns an array of active filters.
|
|
219
224
|
getFilters(): Promise<FilterGroup[]>;
|
|
220
225
|
|
|
226
|
+
// Returns the live dashboard context (current views, runtime filters and titles) as the
|
|
227
|
+
// unified `dashboard` aiprompt input (`{ type: 'dashboard', value }`, where `value` carries
|
|
228
|
+
// the current screen mode as `value.currentScreenMode`).
|
|
229
|
+
// Works in both iframe and web-component embed modes. Feed it into an IQ chat (via its
|
|
230
|
+
// `dashboardContext` input) or an /aiprompt call.
|
|
231
|
+
getDashboardContext(): Promise<DashboardContext | undefined>;
|
|
232
|
+
|
|
221
233
|
// Changes the authorization of all or one dashboard. To fetch data based on new authorization parameters, reloadDashboard() or refreshData() needs to be called.
|
|
222
234
|
setAuthorization(key: string, token: string): Promise<void>;
|
|
223
235
|
|
|
@@ -354,6 +366,33 @@ All available properties for the IQ chat component can be seen in the table belo
|
|
|
354
366
|
| `apiHost` | string | Tenancy of Luzmo API to connect to (Default: 'https://api.luzmo.com/' , for US set apiHost to 'https://api.us.luzmo.com/') |
|
|
355
367
|
| `options` | IQChatOptions | Specifies the customization options of the IQ chat component that affect its appearance and functionality. |
|
|
356
368
|
| `initialSuggestionsDatasetId` | string | ID of a dataset that assists the AI service in generating automated, initial prompts based on the provided data. |
|
|
369
|
+
| `availableDatasets` | string[] | Restrict the analyst to these dataset ids. Accepts a JSON array string attribute. |
|
|
370
|
+
| `dashboardContext` | DashboardContext | A `dashboard-context` to answer over (manual API path). Accepts a JSON object string attribute. |
|
|
371
|
+
| `dashboardId` | string | Connect the chat to a dashboard embedded on the same page; it auto-reads live context and refreshes on change. |
|
|
372
|
+
| `contextIds` | string[] | Connect the chat to one or more flex charts by their `context-id`; a synthetic dashboard-context is assembled. JSON array. |
|
|
373
|
+
|
|
374
|
+
<br/>
|
|
375
|
+
|
|
376
|
+
#### Context-aware chat (dashboards & flex charts)
|
|
377
|
+
|
|
378
|
+
The IQ chat can answer using the **live context** of an embedded dashboard or one/more standalone flex charts on the same page. Connection is always explicit:
|
|
379
|
+
|
|
380
|
+
- Set neither `dashboardId` nor `contextIds` → standalone chat (no context).
|
|
381
|
+
- Set `dashboardId` → the chat finds the `luzmo-embed-dashboard` with that id, reads its context via `getDashboardContext()` and refreshes on each `contextChanged`.
|
|
382
|
+
- Set `contextIds` → the chat finds each `luzmo-embed-viz-item` whose `context-id` matches, reads each via `getVizItemContext()` and assembles a synthetic dashboard-context.
|
|
383
|
+
- If an id is not found on the page, the chat does not connect and surfaces a clear message; a `connectionStatusChanged` event reports the status (`standalone` / `connecting` / `connected` / `not-found`).
|
|
384
|
+
|
|
385
|
+
For a customer's own UI you can also skip auto-connect and forward context yourself: listen to the dashboard's `contextChanged` (or call `getDashboardContext()`), then pass the payload into the chat's `dashboardContext` input or into an `/aiprompt` call.
|
|
386
|
+
|
|
387
|
+
```html
|
|
388
|
+
<!-- Auto-connect to a dashboard on the same page -->
|
|
389
|
+
<luzmo-embed-dashboard dashboardId="<dashboard-id>" authKey="..." authToken="..."></luzmo-embed-dashboard>
|
|
390
|
+
<luzmo-iq-embed-chat dashboardId="<dashboard-id>" authKey="..." authToken="..."></luzmo-iq-embed-chat>
|
|
391
|
+
|
|
392
|
+
<!-- Auto-connect to one or more flex charts -->
|
|
393
|
+
<luzmo-embed-viz-item context-id="sales-by-product" authKey="..." authToken="..."></luzmo-embed-viz-item>
|
|
394
|
+
<luzmo-iq-embed-chat contextIds='["sales-by-product"]' authKey="..." authToken="..."></luzmo-iq-embed-chat>
|
|
395
|
+
```
|
|
357
396
|
|
|
358
397
|
<br/>
|
|
359
398
|
|
package/index.cjs
CHANGED
|
@@ -65,7 +65,7 @@ var import_decorators = require("lit/decorators.js");
|
|
|
65
65
|
var import_style_map = require("lit/directives/style-map.js");
|
|
66
66
|
|
|
67
67
|
// libs/embed-libs/embed/package.json
|
|
68
|
-
var version = "
|
|
68
|
+
var version = "7.0.0";
|
|
69
69
|
|
|
70
70
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
71
71
|
var SharedLib = __toESM(require("@luzmo/shared-embed"));
|
|
@@ -131,6 +131,14 @@ var _setEventHandler = () => {
|
|
|
131
131
|
);
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
|
+
case "dashboardContext": {
|
|
135
|
+
SharedLib.resolvePromise(
|
|
136
|
+
dashboardComponent,
|
|
137
|
+
event.data.requestId,
|
|
138
|
+
event.data.context
|
|
139
|
+
);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
134
142
|
case "getAccessibleDashboards": {
|
|
135
143
|
SharedLib.resolvePromise(
|
|
136
144
|
dashboardComponent,
|
|
@@ -170,6 +178,12 @@ var _setEventHandler = () => {
|
|
|
170
178
|
);
|
|
171
179
|
break;
|
|
172
180
|
}
|
|
181
|
+
case "contextChanged": {
|
|
182
|
+
dashboardComponent.dispatchEvent(
|
|
183
|
+
new CustomEvent("contextChanged", { detail: { data: event.data } })
|
|
184
|
+
);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
173
187
|
case "customEvent": {
|
|
174
188
|
dashboardComponent.dispatchEvent(
|
|
175
189
|
new CustomEvent("customEvent", { detail: { data: event.data } })
|
|
@@ -426,7 +440,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
426
440
|
itemId: "item-id",
|
|
427
441
|
language: "language",
|
|
428
442
|
editorLanguage: "editorLanguage",
|
|
429
|
-
qeVersion: "qe-version",
|
|
430
443
|
screenMode: "screen-mode",
|
|
431
444
|
switchScreenModeOnResize: "switch-screen-mode-on-resize",
|
|
432
445
|
authKey: "auth-key",
|
|
@@ -434,7 +447,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
434
447
|
editMode: "edit-mode",
|
|
435
448
|
theme: "theme",
|
|
436
449
|
mainColor: "main-color",
|
|
437
|
-
accentColor: "accent-color",
|
|
438
450
|
loaderBackground: "loader-background",
|
|
439
451
|
loaderFontColor: "loader-font-color",
|
|
440
452
|
loaderSpinnerColor: "loader-spinner-color",
|
|
@@ -565,6 +577,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
565
577
|
el.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
|
|
566
578
|
el.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
|
|
567
579
|
el.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
580
|
+
el.addEventListener("contextChanged", (payload) => this.dispatchEvent(new CustomEvent("contextChanged", payload)));
|
|
568
581
|
const container = this.renderRoot.querySelector("#dashboard-wc-container");
|
|
569
582
|
if (container) {
|
|
570
583
|
container.append(el);
|
|
@@ -626,7 +639,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
626
639
|
"itemId",
|
|
627
640
|
"language",
|
|
628
641
|
"editorLanguage",
|
|
629
|
-
"qeVersion",
|
|
630
642
|
"theme",
|
|
631
643
|
"editMode",
|
|
632
644
|
"screenMode",
|
|
@@ -713,9 +725,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
713
725
|
if (this.editorLanguage) {
|
|
714
726
|
defaultParameters.editorLanguage = this.editorLanguage;
|
|
715
727
|
}
|
|
716
|
-
if (this.qeVersion) {
|
|
717
|
-
defaultParameters.qeVersion = this.qeVersion;
|
|
718
|
-
}
|
|
719
728
|
if (this.screenMode) {
|
|
720
729
|
defaultParameters.screenMode = this.screenMode;
|
|
721
730
|
}
|
|
@@ -735,9 +744,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
735
744
|
if (this.mainColor) {
|
|
736
745
|
defaultParameters.mainColor = this.mainColor;
|
|
737
746
|
}
|
|
738
|
-
if (this.accentColor) {
|
|
739
|
-
defaultParameters.accentColor = this.accentColor;
|
|
740
|
-
}
|
|
741
747
|
if (this.loaderBackground) {
|
|
742
748
|
defaultParameters.loaderBackground = this.loaderBackground;
|
|
743
749
|
}
|
|
@@ -920,6 +926,15 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
920
926
|
}
|
|
921
927
|
return Promise.reject();
|
|
922
928
|
}
|
|
929
|
+
getDashboardContext() {
|
|
930
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
931
|
+
return this.dashboardReference.getDashboardContext();
|
|
932
|
+
}
|
|
933
|
+
if (!this.isWebComponentViewMode()) {
|
|
934
|
+
return SharedLib2.getDashboardContext(this, this.iframe);
|
|
935
|
+
}
|
|
936
|
+
return Promise.reject(new Error("getDashboardContext is not available: dashboard reference is not ready."));
|
|
937
|
+
}
|
|
923
938
|
setSelectedData(itemId, filters) {
|
|
924
939
|
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
925
940
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
@@ -1042,9 +1057,6 @@ __decorateClass([
|
|
|
1042
1057
|
__decorateClass([
|
|
1043
1058
|
(0, import_decorators.property)()
|
|
1044
1059
|
], LuzmoDashboard.prototype, "editorLanguage", 2);
|
|
1045
|
-
__decorateClass([
|
|
1046
|
-
(0, import_decorators.property)()
|
|
1047
|
-
], LuzmoDashboard.prototype, "qeVersion", 2);
|
|
1048
1060
|
__decorateClass([
|
|
1049
1061
|
(0, import_decorators.property)()
|
|
1050
1062
|
], LuzmoDashboard.prototype, "screenMode", 2);
|
|
@@ -1065,9 +1077,6 @@ __decorateClass([
|
|
|
1065
1077
|
__decorateClass([
|
|
1066
1078
|
(0, import_decorators.property)()
|
|
1067
1079
|
], LuzmoDashboard.prototype, "mainColor", 2);
|
|
1068
|
-
__decorateClass([
|
|
1069
|
-
(0, import_decorators.property)()
|
|
1070
|
-
], LuzmoDashboard.prototype, "accentColor", 2);
|
|
1071
1080
|
__decorateClass([
|
|
1072
1081
|
(0, import_decorators.property)()
|
|
1073
1082
|
], LuzmoDashboard.prototype, "authToken", 2);
|
|
@@ -1197,6 +1206,19 @@ var import_lit3 = require("lit");
|
|
|
1197
1206
|
var import_decorators2 = require("lit/decorators.js");
|
|
1198
1207
|
var dashboardContentsVersion = import_dashboard_contents_types.CONTENTS_VERSION;
|
|
1199
1208
|
var vizItemRemote = "VizItemApp";
|
|
1209
|
+
function collectVizItemDatasetIds(slots) {
|
|
1210
|
+
const ids = /* @__PURE__ */ new Set();
|
|
1211
|
+
for (const slot of slots ?? []) {
|
|
1212
|
+
for (const content of slot?.content ?? []) {
|
|
1213
|
+
const column = content;
|
|
1214
|
+
const datasetId = column.datasetId ?? column.set;
|
|
1215
|
+
if (datasetId) {
|
|
1216
|
+
ids.add(datasetId);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
return [...ids];
|
|
1221
|
+
}
|
|
1200
1222
|
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1201
1223
|
constructor() {
|
|
1202
1224
|
super(...arguments);
|
|
@@ -1208,22 +1230,6 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1208
1230
|
this.libVersion = version + "-wc-luzmo";
|
|
1209
1231
|
this.postInitCallQueue = [];
|
|
1210
1232
|
}
|
|
1211
|
-
static {
|
|
1212
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1213
|
-
this.styles = import_lit3.css`
|
|
1214
|
-
:host {
|
|
1215
|
-
display: block;
|
|
1216
|
-
width: 100%;
|
|
1217
|
-
height: 100%;
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
luzmo-embed-viz-item {
|
|
1221
|
-
width: 100%;
|
|
1222
|
-
height: 1000%;
|
|
1223
|
-
display: block;
|
|
1224
|
-
}
|
|
1225
|
-
`;
|
|
1226
|
-
}
|
|
1227
1233
|
createRenderRoot() {
|
|
1228
1234
|
if (!this.style.display) {
|
|
1229
1235
|
this.style.display = "block";
|
|
@@ -1242,6 +1248,22 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1242
1248
|
getFilters() {
|
|
1243
1249
|
return this.chartElement.getFilters();
|
|
1244
1250
|
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Snapshot of this flex chart's live context: its definition (type, slots,
|
|
1253
|
+
* options), current filters and the datasets it reads. Used by context-aware
|
|
1254
|
+
* embeds such as the Luzmo IQ chat component.
|
|
1255
|
+
*/
|
|
1256
|
+
getVizItemContext() {
|
|
1257
|
+
const slots = this.slots ?? [];
|
|
1258
|
+
return {
|
|
1259
|
+
id: this.contextId ?? this.getAttribute("context-id") ?? this.id ?? this.itemId ?? "",
|
|
1260
|
+
type: this.type,
|
|
1261
|
+
slots,
|
|
1262
|
+
options: this.options,
|
|
1263
|
+
filters: typeof this.chartElement?.getFilters === "function" ? this.getFilters() : this.filters ?? [],
|
|
1264
|
+
datasetIds: collectVizItemDatasetIds(slots)
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1245
1267
|
export(type = "png") {
|
|
1246
1268
|
return this.chartElement.export(type);
|
|
1247
1269
|
}
|
|
@@ -1294,7 +1316,12 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1294
1316
|
}
|
|
1295
1317
|
this.dispatchEvent(new CustomEvent("rendered", payload));
|
|
1296
1318
|
});
|
|
1297
|
-
this.chartElement.addEventListener("changedFilters", (payload) =>
|
|
1319
|
+
this.chartElement.addEventListener("changedFilters", (payload) => {
|
|
1320
|
+
this.dispatchEvent(new CustomEvent("changedFilters", payload));
|
|
1321
|
+
this.dispatchEvent(new CustomEvent("contextChanged", {
|
|
1322
|
+
detail: { data: { type: "contextChanged", context: this.getVizItemContext() } }
|
|
1323
|
+
}));
|
|
1324
|
+
});
|
|
1298
1325
|
this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
1299
1326
|
this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
1300
1327
|
this.chartElement.addEventListener("authorizationExpired", (payload) => this.dispatchEvent(new CustomEvent("authorizationExpired", payload)));
|
|
@@ -1334,6 +1361,20 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1334
1361
|
return import_lit3.html` `;
|
|
1335
1362
|
}
|
|
1336
1363
|
};
|
|
1364
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1365
|
+
LuzmoBaseVizItem.styles = import_lit3.css`
|
|
1366
|
+
:host {
|
|
1367
|
+
display: block;
|
|
1368
|
+
width: 100%;
|
|
1369
|
+
height: 100%;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
luzmo-embed-viz-item {
|
|
1373
|
+
width: 100%;
|
|
1374
|
+
height: 1000%;
|
|
1375
|
+
display: block;
|
|
1376
|
+
}
|
|
1377
|
+
`;
|
|
1337
1378
|
__decorateClass([
|
|
1338
1379
|
(0, import_decorators2.property)()
|
|
1339
1380
|
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
@@ -1417,7 +1458,9 @@ var inputMap = {
|
|
|
1417
1458
|
libVersion: "lib-version",
|
|
1418
1459
|
aydHost: "ayd-host",
|
|
1419
1460
|
availableDatasets: "available-datasets",
|
|
1420
|
-
dashboardContext: "dashboard-context"
|
|
1461
|
+
dashboardContext: "dashboard-context",
|
|
1462
|
+
dashboardId: "dashboard-id",
|
|
1463
|
+
contextIds: "context-ids"
|
|
1421
1464
|
};
|
|
1422
1465
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
1423
1466
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -1431,16 +1474,6 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1431
1474
|
this.remoteEntryServer = "http://localhost:4202/";
|
|
1432
1475
|
this.aydHost = "https://ayd.luzmo.com/";
|
|
1433
1476
|
}
|
|
1434
|
-
static {
|
|
1435
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1436
|
-
this.styles = import_lit4.css`
|
|
1437
|
-
:host {
|
|
1438
|
-
display: block;
|
|
1439
|
-
width: 100%;
|
|
1440
|
-
height: 100%;
|
|
1441
|
-
}
|
|
1442
|
-
`;
|
|
1443
|
-
}
|
|
1444
1477
|
createRenderRoot() {
|
|
1445
1478
|
return this;
|
|
1446
1479
|
}
|
|
@@ -1456,6 +1489,10 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1456
1489
|
if (!this.chartElement) {
|
|
1457
1490
|
this.chartElement = document.createElement(chatComponentTag);
|
|
1458
1491
|
this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
|
|
1492
|
+
this.chartElement.addEventListener(
|
|
1493
|
+
"connectionStatusChanged",
|
|
1494
|
+
(event) => this.dispatchEvent(new CustomEvent("connectionStatusChanged", { detail: event.detail }))
|
|
1495
|
+
);
|
|
1459
1496
|
this.updateVizItemProperties();
|
|
1460
1497
|
this.renderRoot.append(this.chartElement);
|
|
1461
1498
|
}
|
|
@@ -1478,7 +1515,12 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1478
1515
|
if (this.chartElement) {
|
|
1479
1516
|
for (const [propertyName] of changedProperties.entries()) {
|
|
1480
1517
|
const mappedAttributeName = inputMap[propertyName] ?? propertyName;
|
|
1481
|
-
const
|
|
1518
|
+
const propertyValue = this[propertyName];
|
|
1519
|
+
if (propertyValue == null) {
|
|
1520
|
+
this.chartElement.removeAttribute(mappedAttributeName);
|
|
1521
|
+
continue;
|
|
1522
|
+
}
|
|
1523
|
+
const attributeValue = typeof propertyValue === "object" ? JSON.stringify(propertyValue) : propertyValue.toString();
|
|
1482
1524
|
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1483
1525
|
}
|
|
1484
1526
|
} else {
|
|
@@ -1509,6 +1551,14 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1509
1551
|
observer.observe(embedChat, { childList: true, subtree: true });
|
|
1510
1552
|
}
|
|
1511
1553
|
};
|
|
1554
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1555
|
+
LuzmoIQEmbedChatComponent.styles = import_lit4.css`
|
|
1556
|
+
:host {
|
|
1557
|
+
display: block;
|
|
1558
|
+
width: 100%;
|
|
1559
|
+
height: 100%;
|
|
1560
|
+
}
|
|
1561
|
+
`;
|
|
1512
1562
|
__decorateClass([
|
|
1513
1563
|
(0, import_decorators3.property)()
|
|
1514
1564
|
], LuzmoIQEmbedChatComponent.prototype, "appServer", 2);
|
|
@@ -1548,6 +1598,12 @@ __decorateClass([
|
|
|
1548
1598
|
__decorateClass([
|
|
1549
1599
|
(0, import_decorators3.property)({ type: Object })
|
|
1550
1600
|
], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
|
|
1601
|
+
__decorateClass([
|
|
1602
|
+
(0, import_decorators3.property)()
|
|
1603
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardId", 2);
|
|
1604
|
+
__decorateClass([
|
|
1605
|
+
(0, import_decorators3.property)({ type: Array })
|
|
1606
|
+
], LuzmoIQEmbedChatComponent.prototype, "contextIds", 2);
|
|
1551
1607
|
if (!customElements.get(embedChatTag)) {
|
|
1552
1608
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
1553
1609
|
}
|
|
@@ -1577,16 +1633,6 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
|
|
|
1577
1633
|
this.libVersion = version + "-wc-luzmo";
|
|
1578
1634
|
this.remoteEntryServer = "http://localhost:4202";
|
|
1579
1635
|
}
|
|
1580
|
-
static {
|
|
1581
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1582
|
-
this.styles = import_lit5.css`
|
|
1583
|
-
:host {
|
|
1584
|
-
display: block;
|
|
1585
|
-
width: 100%;
|
|
1586
|
-
height: 100%;
|
|
1587
|
-
}
|
|
1588
|
-
`;
|
|
1589
|
-
}
|
|
1590
1636
|
createRenderRoot() {
|
|
1591
1637
|
return this;
|
|
1592
1638
|
}
|
|
@@ -1637,6 +1683,14 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
|
|
|
1637
1683
|
return import_lit5.html` `;
|
|
1638
1684
|
}
|
|
1639
1685
|
};
|
|
1686
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1687
|
+
LuzmoIQEmbedAnswerComponent.styles = import_lit5.css`
|
|
1688
|
+
:host {
|
|
1689
|
+
display: block;
|
|
1690
|
+
width: 100%;
|
|
1691
|
+
height: 100%;
|
|
1692
|
+
}
|
|
1693
|
+
`;
|
|
1640
1694
|
__decorateClass([
|
|
1641
1695
|
(0, import_decorators4.property)()
|
|
1642
1696
|
], LuzmoIQEmbedAnswerComponent.prototype, "appServer", 2);
|