@luzmo/embed 6.13.3 → 6.13.5
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 +10 -0
- package/index.cjs +79 -6
- package/index.js +78 -5
- package/luzmo-embed.min.js +80 -4
- package/package.json +1 -1
- package/src/lib/dashboard/dashboard-base.d.ts +5 -0
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +12 -0
- package/src/lib/viz-item/viz-item.base.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [6.13.5] - 2026-06-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed IQ analyst panel positioning and dashboard sizing. The dashboard now fills its container (removing overflowing charts and the double scrollbar) and the analyst panel stays pinned to the visible viewport while scrolling.
|
|
9
|
+
|
|
10
|
+
## [6.13.4] - 2026-05-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added the `dashboardContext` property on `<luzmo-iq-embed-chat>` to pass the current dashboard layout, metadata and runtime filters to the IQ chat for context-aware answers.
|
|
14
|
+
|
|
5
15
|
## [6.13.3] - 2026-05-27
|
|
6
16
|
|
|
7
17
|
### Changed
|
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 = "6.13.
|
|
68
|
+
var version = "6.13.5";
|
|
69
69
|
|
|
70
70
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
71
71
|
var SharedLib = __toESM(require("@luzmo/shared-embed"));
|
|
@@ -211,6 +211,14 @@ var _setEventHandler = () => {
|
|
|
211
211
|
SharedLib._setCalculatedDimensions(dashboardComponent);
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
|
+
case "trackViewport": {
|
|
215
|
+
if (event.data.enabled) {
|
|
216
|
+
dashboardComponent._startViewportTracking();
|
|
217
|
+
} else {
|
|
218
|
+
dashboardComponent._stopViewportTracking();
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
214
222
|
case "setSelectedData":
|
|
215
223
|
case "setFilters": {
|
|
216
224
|
if (event.data.error) {
|
|
@@ -297,6 +305,24 @@ var dashboardStyles = import_lit.css`
|
|
|
297
305
|
height: 100%;
|
|
298
306
|
}
|
|
299
307
|
|
|
308
|
+
/*
|
|
309
|
+
* Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
|
|
310
|
+
* sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
|
|
311
|
+
* dashboard height - exactly like the iframe gets its height. Without this the app collapses to
|
|
312
|
+
* its intrinsic size and its inner scroll container produces a second scrollbar, and content can
|
|
313
|
+
* spill outside the container.
|
|
314
|
+
*/
|
|
315
|
+
#dashboard-wc-container {
|
|
316
|
+
width: 100%;
|
|
317
|
+
height: 100%;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
#dashboard-wc-container dashboard-component {
|
|
321
|
+
display: block;
|
|
322
|
+
width: 100%;
|
|
323
|
+
height: 100%;
|
|
324
|
+
}
|
|
325
|
+
|
|
300
326
|
.luzmo-container-loader {
|
|
301
327
|
width: 100%;
|
|
302
328
|
position: relative;
|
|
@@ -421,6 +447,12 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
421
447
|
this.loaderSize = 32;
|
|
422
448
|
this.borderWidth = 3;
|
|
423
449
|
this.minHeight = 400;
|
|
450
|
+
this._viewportTrackingActive = false;
|
|
451
|
+
// Post synchronously on scroll/resize (not via requestAnimationFrame) so the iframe receives the
|
|
452
|
+
// new slice as early as possible in the frame, minimizing the lag of the pinned analyst panel.
|
|
453
|
+
this._onViewportChange = () => {
|
|
454
|
+
this._postViewport();
|
|
455
|
+
};
|
|
424
456
|
this._containerId = SharedLib2.uuidv4();
|
|
425
457
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
426
458
|
this.iframeLoaded = false;
|
|
@@ -463,12 +495,48 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
463
495
|
disconnectedCallback() {
|
|
464
496
|
super.disconnectedCallback();
|
|
465
497
|
this._resizeObserver.disconnect();
|
|
498
|
+
this._stopViewportTracking();
|
|
466
499
|
for (const promiseKey of Object.keys(this.promises)) {
|
|
467
500
|
this.promises[promiseKey].reject(
|
|
468
501
|
new Error("Dashboard component was removed")
|
|
469
502
|
);
|
|
470
503
|
}
|
|
471
504
|
}
|
|
505
|
+
// Relay the iframe's visible slice within the host viewport to the dashboard app, so embedded
|
|
506
|
+
// overlays (e.g. the IQ analyst) can pin themselves to the visible area while the host page
|
|
507
|
+
// scrolls the full-height iframe. Opt-in: started when the iframe requests it via 'trackViewport'.
|
|
508
|
+
_startViewportTracking() {
|
|
509
|
+
if (this.embedMode !== "iframe") {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (!this._viewportTrackingActive) {
|
|
513
|
+
this._viewportTrackingActive = true;
|
|
514
|
+
window.addEventListener("scroll", this._onViewportChange, { passive: true, capture: true });
|
|
515
|
+
window.addEventListener("resize", this._onViewportChange, { passive: true });
|
|
516
|
+
}
|
|
517
|
+
this._postViewport();
|
|
518
|
+
}
|
|
519
|
+
_stopViewportTracking() {
|
|
520
|
+
if (!this._viewportTrackingActive) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
this._viewportTrackingActive = false;
|
|
524
|
+
window.removeEventListener("scroll", this._onViewportChange, { capture: true });
|
|
525
|
+
window.removeEventListener("resize", this._onViewportChange);
|
|
526
|
+
}
|
|
527
|
+
_postViewport() {
|
|
528
|
+
const contentWindow = this.iframe?.contentWindow;
|
|
529
|
+
if (!contentWindow) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
const rect = this.iframe.getBoundingClientRect();
|
|
533
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
534
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
535
|
+
const visibleBottom = Math.min(rect.bottom, viewportHeight);
|
|
536
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
537
|
+
const offsetTop = Math.min(Math.max(-rect.top, 0), rect.height);
|
|
538
|
+
contentWindow.postMessage({ action: "setViewport", offsetTop, visibleHeight }, "*");
|
|
539
|
+
}
|
|
472
540
|
firstUpdated() {
|
|
473
541
|
this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
|
|
474
542
|
this._loaderStyles();
|
|
@@ -1122,14 +1190,12 @@ if (!customElements.get("luzmo-embed-dashboard")) {
|
|
|
1122
1190
|
customElements.define("luzmo-embed-dashboard", LuzmoEmbedDashboard);
|
|
1123
1191
|
}
|
|
1124
1192
|
|
|
1125
|
-
// libs/dashboard-contents-types/src/lib/shared/version.ts
|
|
1126
|
-
var CONTENTS_VERSION = "0.1.100";
|
|
1127
|
-
|
|
1128
1193
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1194
|
+
var import_dashboard_contents_types = require("@luzmo/dashboard-contents-types");
|
|
1129
1195
|
var SharedLib3 = __toESM(require("@luzmo/shared-embed"));
|
|
1130
1196
|
var import_lit3 = require("lit");
|
|
1131
1197
|
var import_decorators2 = require("lit/decorators.js");
|
|
1132
|
-
var dashboardContentsVersion = CONTENTS_VERSION;
|
|
1198
|
+
var dashboardContentsVersion = import_dashboard_contents_types.CONTENTS_VERSION;
|
|
1133
1199
|
var vizItemRemote = "VizItemApp";
|
|
1134
1200
|
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1135
1201
|
constructor() {
|
|
@@ -1315,6 +1381,9 @@ __decorateClass([
|
|
|
1315
1381
|
__decorateClass([
|
|
1316
1382
|
(0, import_decorators2.property)()
|
|
1317
1383
|
], LuzmoBaseVizItem.prototype, "itemId", 2);
|
|
1384
|
+
__decorateClass([
|
|
1385
|
+
(0, import_decorators2.property)({ attribute: "ai-message-asset-id" })
|
|
1386
|
+
], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
|
|
1318
1387
|
__decorateClass([
|
|
1319
1388
|
(0, import_decorators2.property)({ type: Object })
|
|
1320
1389
|
], LuzmoBaseVizItem.prototype, "selectedData", 2);
|
|
@@ -1347,7 +1416,8 @@ var inputMap = {
|
|
|
1347
1416
|
version: "version",
|
|
1348
1417
|
libVersion: "lib-version",
|
|
1349
1418
|
aydHost: "ayd-host",
|
|
1350
|
-
availableDatasets: "available-datasets"
|
|
1419
|
+
availableDatasets: "available-datasets",
|
|
1420
|
+
dashboardContext: "dashboard-context"
|
|
1351
1421
|
};
|
|
1352
1422
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
1353
1423
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -1475,6 +1545,9 @@ __decorateClass([
|
|
|
1475
1545
|
__decorateClass([
|
|
1476
1546
|
(0, import_decorators3.property)({ type: Array })
|
|
1477
1547
|
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
1548
|
+
__decorateClass([
|
|
1549
|
+
(0, import_decorators3.property)({ type: Object })
|
|
1550
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
|
|
1478
1551
|
if (!customElements.get(embedChatTag)) {
|
|
1479
1552
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
1480
1553
|
}
|
package/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { property, query, state } from "lit/decorators.js";
|
|
|
23
23
|
import { styleMap } from "lit/directives/style-map.js";
|
|
24
24
|
|
|
25
25
|
// libs/embed-libs/embed/package.json
|
|
26
|
-
var version = "6.13.
|
|
26
|
+
var version = "6.13.5";
|
|
27
27
|
|
|
28
28
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
29
29
|
import * as SharedLib from "@luzmo/shared-embed";
|
|
@@ -169,6 +169,14 @@ var _setEventHandler = () => {
|
|
|
169
169
|
SharedLib._setCalculatedDimensions(dashboardComponent);
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
+
case "trackViewport": {
|
|
173
|
+
if (event.data.enabled) {
|
|
174
|
+
dashboardComponent._startViewportTracking();
|
|
175
|
+
} else {
|
|
176
|
+
dashboardComponent._stopViewportTracking();
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
172
180
|
case "setSelectedData":
|
|
173
181
|
case "setFilters": {
|
|
174
182
|
if (event.data.error) {
|
|
@@ -255,6 +263,24 @@ var dashboardStyles = css`
|
|
|
255
263
|
height: 100%;
|
|
256
264
|
}
|
|
257
265
|
|
|
266
|
+
/*
|
|
267
|
+
* Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
|
|
268
|
+
* sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
|
|
269
|
+
* dashboard height - exactly like the iframe gets its height. Without this the app collapses to
|
|
270
|
+
* its intrinsic size and its inner scroll container produces a second scrollbar, and content can
|
|
271
|
+
* spill outside the container.
|
|
272
|
+
*/
|
|
273
|
+
#dashboard-wc-container {
|
|
274
|
+
width: 100%;
|
|
275
|
+
height: 100%;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
#dashboard-wc-container dashboard-component {
|
|
279
|
+
display: block;
|
|
280
|
+
width: 100%;
|
|
281
|
+
height: 100%;
|
|
282
|
+
}
|
|
283
|
+
|
|
258
284
|
.luzmo-container-loader {
|
|
259
285
|
width: 100%;
|
|
260
286
|
position: relative;
|
|
@@ -379,6 +405,12 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
379
405
|
this.loaderSize = 32;
|
|
380
406
|
this.borderWidth = 3;
|
|
381
407
|
this.minHeight = 400;
|
|
408
|
+
this._viewportTrackingActive = false;
|
|
409
|
+
// Post synchronously on scroll/resize (not via requestAnimationFrame) so the iframe receives the
|
|
410
|
+
// new slice as early as possible in the frame, minimizing the lag of the pinned analyst panel.
|
|
411
|
+
this._onViewportChange = () => {
|
|
412
|
+
this._postViewport();
|
|
413
|
+
};
|
|
382
414
|
this._containerId = SharedLib2.uuidv4();
|
|
383
415
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
384
416
|
this.iframeLoaded = false;
|
|
@@ -421,12 +453,48 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
421
453
|
disconnectedCallback() {
|
|
422
454
|
super.disconnectedCallback();
|
|
423
455
|
this._resizeObserver.disconnect();
|
|
456
|
+
this._stopViewportTracking();
|
|
424
457
|
for (const promiseKey of Object.keys(this.promises)) {
|
|
425
458
|
this.promises[promiseKey].reject(
|
|
426
459
|
new Error("Dashboard component was removed")
|
|
427
460
|
);
|
|
428
461
|
}
|
|
429
462
|
}
|
|
463
|
+
// Relay the iframe's visible slice within the host viewport to the dashboard app, so embedded
|
|
464
|
+
// overlays (e.g. the IQ analyst) can pin themselves to the visible area while the host page
|
|
465
|
+
// scrolls the full-height iframe. Opt-in: started when the iframe requests it via 'trackViewport'.
|
|
466
|
+
_startViewportTracking() {
|
|
467
|
+
if (this.embedMode !== "iframe") {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (!this._viewportTrackingActive) {
|
|
471
|
+
this._viewportTrackingActive = true;
|
|
472
|
+
window.addEventListener("scroll", this._onViewportChange, { passive: true, capture: true });
|
|
473
|
+
window.addEventListener("resize", this._onViewportChange, { passive: true });
|
|
474
|
+
}
|
|
475
|
+
this._postViewport();
|
|
476
|
+
}
|
|
477
|
+
_stopViewportTracking() {
|
|
478
|
+
if (!this._viewportTrackingActive) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
this._viewportTrackingActive = false;
|
|
482
|
+
window.removeEventListener("scroll", this._onViewportChange, { capture: true });
|
|
483
|
+
window.removeEventListener("resize", this._onViewportChange);
|
|
484
|
+
}
|
|
485
|
+
_postViewport() {
|
|
486
|
+
const contentWindow = this.iframe?.contentWindow;
|
|
487
|
+
if (!contentWindow) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const rect = this.iframe.getBoundingClientRect();
|
|
491
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
492
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
493
|
+
const visibleBottom = Math.min(rect.bottom, viewportHeight);
|
|
494
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
495
|
+
const offsetTop = Math.min(Math.max(-rect.top, 0), rect.height);
|
|
496
|
+
contentWindow.postMessage({ action: "setViewport", offsetTop, visibleHeight }, "*");
|
|
497
|
+
}
|
|
430
498
|
firstUpdated() {
|
|
431
499
|
this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
|
|
432
500
|
this._loaderStyles();
|
|
@@ -1080,10 +1148,8 @@ if (!customElements.get("luzmo-embed-dashboard")) {
|
|
|
1080
1148
|
customElements.define("luzmo-embed-dashboard", LuzmoEmbedDashboard);
|
|
1081
1149
|
}
|
|
1082
1150
|
|
|
1083
|
-
// libs/dashboard-contents-types/src/lib/shared/version.ts
|
|
1084
|
-
var CONTENTS_VERSION = "0.1.100";
|
|
1085
|
-
|
|
1086
1151
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1152
|
+
import { CONTENTS_VERSION } from "@luzmo/dashboard-contents-types";
|
|
1087
1153
|
import * as SharedLib3 from "@luzmo/shared-embed";
|
|
1088
1154
|
import { css as css2, html as html2, LitElement as LitElement2 } from "lit";
|
|
1089
1155
|
import { property as property2 } from "lit/decorators.js";
|
|
@@ -1273,6 +1339,9 @@ __decorateClass([
|
|
|
1273
1339
|
__decorateClass([
|
|
1274
1340
|
property2()
|
|
1275
1341
|
], LuzmoBaseVizItem.prototype, "itemId", 2);
|
|
1342
|
+
__decorateClass([
|
|
1343
|
+
property2({ attribute: "ai-message-asset-id" })
|
|
1344
|
+
], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
|
|
1276
1345
|
__decorateClass([
|
|
1277
1346
|
property2({ type: Object })
|
|
1278
1347
|
], LuzmoBaseVizItem.prototype, "selectedData", 2);
|
|
@@ -1305,7 +1374,8 @@ var inputMap = {
|
|
|
1305
1374
|
version: "version",
|
|
1306
1375
|
libVersion: "lib-version",
|
|
1307
1376
|
aydHost: "ayd-host",
|
|
1308
|
-
availableDatasets: "available-datasets"
|
|
1377
|
+
availableDatasets: "available-datasets",
|
|
1378
|
+
dashboardContext: "dashboard-context"
|
|
1309
1379
|
};
|
|
1310
1380
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
1311
1381
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -1433,6 +1503,9 @@ __decorateClass([
|
|
|
1433
1503
|
__decorateClass([
|
|
1434
1504
|
property3({ type: Array })
|
|
1435
1505
|
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
1506
|
+
__decorateClass([
|
|
1507
|
+
property3({ type: Object })
|
|
1508
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
|
|
1436
1509
|
if (!customElements.get(embedChatTag)) {
|
|
1437
1510
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
1438
1511
|
}
|
package/luzmo-embed.min.js
CHANGED
|
@@ -1255,6 +1255,7 @@ var libraryTypeToWebComponentTypeMapping = {
|
|
|
1255
1255
|
filters: "filters",
|
|
1256
1256
|
dashboardId: "dashboard-id",
|
|
1257
1257
|
itemId: "item-id",
|
|
1258
|
+
aiMessageAssetId: "ai-message-asset-id",
|
|
1258
1259
|
dashboardContentsVersion: "dashboard-contents-version",
|
|
1259
1260
|
libVersion: "lib-version"
|
|
1260
1261
|
};
|
|
@@ -2026,7 +2027,7 @@ function getGlobalFederationConstructor() {
|
|
|
2026
2027
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
2027
2028
|
if (isDebug) {
|
|
2028
2029
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
2029
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.
|
|
2030
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.1";
|
|
2030
2031
|
}
|
|
2031
2032
|
}
|
|
2032
2033
|
function getInfoWithoutType(target, key) {
|
|
@@ -4841,7 +4842,7 @@ var ModuleFederation = class {
|
|
|
4841
4842
|
beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
|
|
4842
4843
|
initContainer: new AsyncWaterfallHook("initContainer")
|
|
4843
4844
|
});
|
|
4844
|
-
this.version = "2.5.
|
|
4845
|
+
this.version = "2.5.1";
|
|
4845
4846
|
this.moduleCache = /* @__PURE__ */ new Map();
|
|
4846
4847
|
this.loaderHook = new PluginSystem({
|
|
4847
4848
|
getModuleInfo: new SyncHook(),
|
|
@@ -5742,7 +5743,7 @@ var o6 = e6(class extends i5 {
|
|
|
5742
5743
|
});
|
|
5743
5744
|
|
|
5744
5745
|
// libs/embed-libs/embed/package.json
|
|
5745
|
-
var version = "6.13.
|
|
5746
|
+
var version = "6.13.5";
|
|
5746
5747
|
|
|
5747
5748
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
5748
5749
|
var LuzmoDashboardService = class {
|
|
@@ -5885,6 +5886,14 @@ var _setEventHandler = () => {
|
|
|
5885
5886
|
_setCalculatedDimensions(dashboardComponent);
|
|
5886
5887
|
break;
|
|
5887
5888
|
}
|
|
5889
|
+
case "trackViewport": {
|
|
5890
|
+
if (event.data.enabled) {
|
|
5891
|
+
dashboardComponent._startViewportTracking();
|
|
5892
|
+
} else {
|
|
5893
|
+
dashboardComponent._stopViewportTracking();
|
|
5894
|
+
}
|
|
5895
|
+
break;
|
|
5896
|
+
}
|
|
5888
5897
|
case "setSelectedData":
|
|
5889
5898
|
case "setFilters": {
|
|
5890
5899
|
if (event.data.error) {
|
|
@@ -5970,6 +5979,24 @@ var dashboardStyles = i`
|
|
|
5970
5979
|
height: 100%;
|
|
5971
5980
|
}
|
|
5972
5981
|
|
|
5982
|
+
/*
|
|
5983
|
+
* Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
|
|
5984
|
+
* sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
|
|
5985
|
+
* dashboard height - exactly like the iframe gets its height. Without this the app collapses to
|
|
5986
|
+
* its intrinsic size and its inner scroll container produces a second scrollbar, and content can
|
|
5987
|
+
* spill outside the container.
|
|
5988
|
+
*/
|
|
5989
|
+
#dashboard-wc-container {
|
|
5990
|
+
width: 100%;
|
|
5991
|
+
height: 100%;
|
|
5992
|
+
}
|
|
5993
|
+
|
|
5994
|
+
#dashboard-wc-container dashboard-component {
|
|
5995
|
+
display: block;
|
|
5996
|
+
width: 100%;
|
|
5997
|
+
height: 100%;
|
|
5998
|
+
}
|
|
5999
|
+
|
|
5973
6000
|
.luzmo-container-loader {
|
|
5974
6001
|
width: 100%;
|
|
5975
6002
|
position: relative;
|
|
@@ -6094,6 +6121,12 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6094
6121
|
this.loaderSize = 32;
|
|
6095
6122
|
this.borderWidth = 3;
|
|
6096
6123
|
this.minHeight = 400;
|
|
6124
|
+
this._viewportTrackingActive = false;
|
|
6125
|
+
// Post synchronously on scroll/resize (not via requestAnimationFrame) so the iframe receives the
|
|
6126
|
+
// new slice as early as possible in the frame, minimizing the lag of the pinned analyst panel.
|
|
6127
|
+
this._onViewportChange = () => {
|
|
6128
|
+
this._postViewport();
|
|
6129
|
+
};
|
|
6097
6130
|
this._containerId = uuidv4();
|
|
6098
6131
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
6099
6132
|
this.iframeLoaded = false;
|
|
@@ -6136,12 +6169,48 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6136
6169
|
disconnectedCallback() {
|
|
6137
6170
|
super.disconnectedCallback();
|
|
6138
6171
|
this._resizeObserver.disconnect();
|
|
6172
|
+
this._stopViewportTracking();
|
|
6139
6173
|
for (const promiseKey of Object.keys(this.promises)) {
|
|
6140
6174
|
this.promises[promiseKey].reject(
|
|
6141
6175
|
new Error("Dashboard component was removed")
|
|
6142
6176
|
);
|
|
6143
6177
|
}
|
|
6144
6178
|
}
|
|
6179
|
+
// Relay the iframe's visible slice within the host viewport to the dashboard app, so embedded
|
|
6180
|
+
// overlays (e.g. the IQ analyst) can pin themselves to the visible area while the host page
|
|
6181
|
+
// scrolls the full-height iframe. Opt-in: started when the iframe requests it via 'trackViewport'.
|
|
6182
|
+
_startViewportTracking() {
|
|
6183
|
+
if (this.embedMode !== "iframe") {
|
|
6184
|
+
return;
|
|
6185
|
+
}
|
|
6186
|
+
if (!this._viewportTrackingActive) {
|
|
6187
|
+
this._viewportTrackingActive = true;
|
|
6188
|
+
window.addEventListener("scroll", this._onViewportChange, { passive: true, capture: true });
|
|
6189
|
+
window.addEventListener("resize", this._onViewportChange, { passive: true });
|
|
6190
|
+
}
|
|
6191
|
+
this._postViewport();
|
|
6192
|
+
}
|
|
6193
|
+
_stopViewportTracking() {
|
|
6194
|
+
if (!this._viewportTrackingActive) {
|
|
6195
|
+
return;
|
|
6196
|
+
}
|
|
6197
|
+
this._viewportTrackingActive = false;
|
|
6198
|
+
window.removeEventListener("scroll", this._onViewportChange, { capture: true });
|
|
6199
|
+
window.removeEventListener("resize", this._onViewportChange);
|
|
6200
|
+
}
|
|
6201
|
+
_postViewport() {
|
|
6202
|
+
const contentWindow = this.iframe?.contentWindow;
|
|
6203
|
+
if (!contentWindow) {
|
|
6204
|
+
return;
|
|
6205
|
+
}
|
|
6206
|
+
const rect = this.iframe.getBoundingClientRect();
|
|
6207
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
6208
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
6209
|
+
const visibleBottom = Math.min(rect.bottom, viewportHeight);
|
|
6210
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
6211
|
+
const offsetTop = Math.min(Math.max(-rect.top, 0), rect.height);
|
|
6212
|
+
contentWindow.postMessage({ action: "setViewport", offsetTop, visibleHeight }, "*");
|
|
6213
|
+
}
|
|
6145
6214
|
firstUpdated() {
|
|
6146
6215
|
this._loaderMsg = getLoader(this)?.loadingMsg;
|
|
6147
6216
|
this._loaderStyles();
|
|
@@ -6985,6 +7054,9 @@ __decorateClass([
|
|
|
6985
7054
|
__decorateClass([
|
|
6986
7055
|
n4()
|
|
6987
7056
|
], LuzmoBaseVizItem.prototype, "itemId", 2);
|
|
7057
|
+
__decorateClass([
|
|
7058
|
+
n4({ attribute: "ai-message-asset-id" })
|
|
7059
|
+
], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
|
|
6988
7060
|
__decorateClass([
|
|
6989
7061
|
n4({ type: Object })
|
|
6990
7062
|
], LuzmoBaseVizItem.prototype, "selectedData", 2);
|
|
@@ -7014,7 +7086,8 @@ var inputMap = {
|
|
|
7014
7086
|
version: "version",
|
|
7015
7087
|
libVersion: "lib-version",
|
|
7016
7088
|
aydHost: "ayd-host",
|
|
7017
|
-
availableDatasets: "available-datasets"
|
|
7089
|
+
availableDatasets: "available-datasets",
|
|
7090
|
+
dashboardContext: "dashboard-context"
|
|
7018
7091
|
};
|
|
7019
7092
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
7020
7093
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -7142,6 +7215,9 @@ __decorateClass([
|
|
|
7142
7215
|
__decorateClass([
|
|
7143
7216
|
n4({ type: Array })
|
|
7144
7217
|
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
7218
|
+
__decorateClass([
|
|
7219
|
+
n4({ type: Object })
|
|
7220
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
|
|
7145
7221
|
if (!customElements.get(embedChatTag)) {
|
|
7146
7222
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
7147
7223
|
}
|
package/package.json
CHANGED
|
@@ -65,9 +65,14 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
65
65
|
iframeHeight?: string;
|
|
66
66
|
iframeWidth?: string;
|
|
67
67
|
_resizeObserver: ResizeObserver;
|
|
68
|
+
private _viewportTrackingActive;
|
|
69
|
+
private _onViewportChange;
|
|
68
70
|
constructor();
|
|
69
71
|
connectedCallback(): void;
|
|
70
72
|
disconnectedCallback(): void;
|
|
73
|
+
_startViewportTracking(): void;
|
|
74
|
+
_stopViewportTracking(): void;
|
|
75
|
+
private _postViewport;
|
|
71
76
|
firstUpdated(): void;
|
|
72
77
|
initComponent(): void;
|
|
73
78
|
setAllAttributes(): void;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { IQChatOptions } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
3
|
import type { TemplateResult } from 'lit-html';
|
|
4
|
+
export interface SerializedDashboardContext {
|
|
5
|
+
type: 'dashboard-context';
|
|
6
|
+
id: string;
|
|
7
|
+
json: unknown;
|
|
8
|
+
screen_mode?: string;
|
|
9
|
+
meta?: {
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
};
|
|
13
|
+
runtime_filters?: unknown[];
|
|
14
|
+
}
|
|
4
15
|
export declare class LuzmoIQEmbedChatComponent extends LitElement {
|
|
5
16
|
appServer?: string;
|
|
6
17
|
apiHost?: string;
|
|
@@ -14,6 +25,7 @@ export declare class LuzmoIQEmbedChatComponent extends LitElement {
|
|
|
14
25
|
remoteEntryServer: string;
|
|
15
26
|
aydHost: string;
|
|
16
27
|
availableDatasets?: string[];
|
|
28
|
+
dashboardContext?: SerializedDashboardContext;
|
|
17
29
|
chartElement: HTMLElement;
|
|
18
30
|
static styles: import("lit").CSSResult;
|
|
19
31
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
@@ -24,6 +24,7 @@ interface LuzmoVizItemComponentInterface extends HTMLElement {
|
|
|
24
24
|
authToken?: string;
|
|
25
25
|
dashboardId?: string;
|
|
26
26
|
itemId?: string;
|
|
27
|
+
aiMessageAssetId?: string;
|
|
27
28
|
getFilters: () => FilterGroup[];
|
|
28
29
|
export: (type?: VizItemExportType) => Promise<string | void>;
|
|
29
30
|
refreshData: () => void;
|
|
@@ -46,6 +47,7 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
|
|
|
46
47
|
filters?: FilterGroup[];
|
|
47
48
|
dashboardId?: string;
|
|
48
49
|
itemId?: string;
|
|
50
|
+
aiMessageAssetId?: string;
|
|
49
51
|
selectedData: SharedLib.SelectedDataInput;
|
|
50
52
|
dashboardContentsVersion?: string;
|
|
51
53
|
libVersion?: string;
|