@luzmo/embed 6.13.2 → 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 CHANGED
@@ -2,6 +2,21 @@
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
+
15
+ ## [6.13.3] - 2026-05-27
16
+
17
+ ### Changed
18
+ - Revert changes in `6.13.2`
19
+
5
20
  ## [6.13.2] - 2026-05-25
6
21
 
7
22
  ### Fixed
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.2";
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();
@@ -1313,6 +1381,9 @@ __decorateClass([
1313
1381
  __decorateClass([
1314
1382
  (0, import_decorators2.property)()
1315
1383
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1384
+ __decorateClass([
1385
+ (0, import_decorators2.property)({ attribute: "ai-message-asset-id" })
1386
+ ], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
1316
1387
  __decorateClass([
1317
1388
  (0, import_decorators2.property)({ type: Object })
1318
1389
  ], LuzmoBaseVizItem.prototype, "selectedData", 2);
@@ -1345,7 +1416,8 @@ var inputMap = {
1345
1416
  version: "version",
1346
1417
  libVersion: "lib-version",
1347
1418
  aydHost: "ayd-host",
1348
- availableDatasets: "available-datasets"
1419
+ availableDatasets: "available-datasets",
1420
+ dashboardContext: "dashboard-context"
1349
1421
  };
1350
1422
  var embedChatTag = "luzmo-iq-embed-chat";
1351
1423
  var chatComponentTag = "luzmo-iq-chat-component";
@@ -1473,6 +1545,9 @@ __decorateClass([
1473
1545
  __decorateClass([
1474
1546
  (0, import_decorators3.property)({ type: Array })
1475
1547
  ], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
1548
+ __decorateClass([
1549
+ (0, import_decorators3.property)({ type: Object })
1550
+ ], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
1476
1551
  if (!customElements.get(embedChatTag)) {
1477
1552
  customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
1478
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.2";
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();
@@ -1271,6 +1339,9 @@ __decorateClass([
1271
1339
  __decorateClass([
1272
1340
  property2()
1273
1341
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1342
+ __decorateClass([
1343
+ property2({ attribute: "ai-message-asset-id" })
1344
+ ], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
1274
1345
  __decorateClass([
1275
1346
  property2({ type: Object })
1276
1347
  ], LuzmoBaseVizItem.prototype, "selectedData", 2);
@@ -1303,7 +1374,8 @@ var inputMap = {
1303
1374
  version: "version",
1304
1375
  libVersion: "lib-version",
1305
1376
  aydHost: "ayd-host",
1306
- availableDatasets: "available-datasets"
1377
+ availableDatasets: "available-datasets",
1378
+ dashboardContext: "dashboard-context"
1307
1379
  };
1308
1380
  var embedChatTag = "luzmo-iq-embed-chat";
1309
1381
  var chatComponentTag = "luzmo-iq-chat-component";
@@ -1431,6 +1503,9 @@ __decorateClass([
1431
1503
  __decorateClass([
1432
1504
  property3({ type: Array })
1433
1505
  ], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
1506
+ __decorateClass([
1507
+ property3({ type: Object })
1508
+ ], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
1434
1509
  if (!customElements.get(embedChatTag)) {
1435
1510
  customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
1436
1511
  }