@luzmo/embed 7.5.0 → 8.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 +91 -0
- package/README.md +2 -2
- package/index.cjs +1619 -179
- package/index.js +1613 -165
- package/index.rn.cjs +1375 -0
- package/index.rn.js +1305 -0
- package/index.shared.cjs +1486 -0
- package/index.shared.js +1412 -0
- package/luzmo-embed.min.js +227 -132
- package/package.json +29 -3
- package/src/index.common.d.ts +18 -0
- package/src/index.d.ts +3 -3
- package/src/index.rn.d.ts +1 -0
- package/src/index.shared.d.ts +2 -0
- package/src/lib/dashboard/dashboard-base.d.ts +5 -1
- package/src/lib/iq-components/luzmo-iq-answer.d.ts +1 -2
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +1 -1
- package/src/lib/shared/constants/class-constants.d.ts +1 -0
- package/src/lib/shared/helpers/browser-check.d.ts +2 -0
- package/src/lib/shared/helpers/default-parameters.d.ts +2 -0
- package/src/lib/shared/helpers/error.d.ts +5 -0
- package/src/lib/shared/helpers/extents.d.ts +7 -0
- package/src/lib/shared/helpers/get-loader.d.ts +5 -0
- package/src/lib/shared/helpers/iframe-url.d.ts +1 -0
- package/src/lib/shared/helpers/promise-dispatch.d.ts +3 -0
- package/src/lib/shared/helpers/remote-federation.d.ts +56 -0
- package/src/lib/shared/helpers/set-selected-data-utils.d.ts +7 -0
- package/src/lib/shared/helpers/styles.d.ts +8 -0
- package/src/lib/shared/helpers/translations.d.ts +24 -0
- package/src/lib/shared/helpers/update-iframe-url.d.ts +1 -0
- package/src/lib/shared/helpers/utils.d.ts +27 -0
- package/src/lib/shared/methods/export-dashboard.d.ts +5 -0
- package/src/lib/shared/methods/get-accessible-dashboards.d.ts +3 -0
- package/src/lib/shared/methods/get-dashboard-context.d.ts +3 -0
- package/src/lib/shared/methods/get-data.d.ts +3 -0
- package/src/lib/shared/methods/get-filters.d.ts +3 -0
- package/src/lib/shared/methods/get-insights.d.ts +3 -0
- package/src/lib/shared/methods/index.d.ts +13 -0
- package/src/lib/shared/methods/refresh-data.d.ts +2 -0
- package/src/lib/shared/methods/reload-dashboard.d.ts +2 -0
- package/src/lib/shared/methods/send-export-email.d.ts +4 -0
- package/src/lib/shared/methods/set-authorization.d.ts +2 -0
- package/src/lib/shared/methods/set-edit-mode.d.ts +3 -0
- package/src/lib/shared/methods/set-preview.d.ts +3 -0
- package/src/lib/shared/methods/set-selected-data.d.ts +4 -0
- package/src/lib/shared/models/common.model.d.ts +105 -0
- package/src/lib/shared/models/dashboard-context.model.d.ts +50 -0
- package/src/lib/shared/models/dashboard.model.d.ts +59 -0
- package/src/lib/shared/models/embed-error-event.model.d.ts +17 -0
- package/src/lib/shared/models/events.model.d.ts +94 -0
- package/src/lib/shared/models/filter-input.model.d.ts +101 -0
- package/src/lib/shared/models/filter-output.model.d.ts +17 -0
- package/src/lib/shared/models/filters.model.d.ts +26 -0
- package/src/lib/shared/models/index.d.ts +12 -0
- package/src/lib/shared/models/styles.model.d.ts +32 -0
- package/src/lib/shared/models/translation.model.d.ts +2 -0
- package/src/lib/shared/models/viz-item-post-message.model.d.ts +56 -0
- package/src/lib/shared/models/viz-item.model.d.ts +8 -0
- package/src/lib/shared/models/viz-items/areachart.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/barchart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/choroplethmap.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/circlepack.model.d.ts +2 -0
- package/src/lib/shared/models/viz-items/columnchart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/datetime.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/donutchart.model.d.ts +2 -0
- package/src/lib/shared/models/viz-items/dropdownfilter.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/index.d.ts +36 -0
- package/src/lib/shared/models/viz-items/linechart.model.d.ts +36 -0
- package/src/lib/shared/models/viz-items/parallelcoordinatesplot.model.d.ts +14 -0
- package/src/lib/shared/models/viz-items/piechart.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/scatterplot.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/slicer.model.d.ts +24 -0
- package/src/lib/shared/models/viz-items/slider.model.d.ts +13 -0
- package/src/lib/shared/models/viz-items/stripplot.model.d.ts +15 -0
- package/src/lib/shared/models/viz-items/sunburst.model.d.ts +14 -0
- package/src/lib/shared/models/viz-items/treemap.model.d.ts +24 -0
- package/src/lib/shared/service/calculate-dimensions.d.ts +1 -0
- package/src/lib/shared/service/extend-and-validate.d.ts +2 -0
- package/src/lib/{helper → utils}/embed-error.utils.d.ts +1 -1
- package/src/lib/viz-item/viz-item.base.d.ts +2 -2
- /package/src/lib/{helper → utils}/event-bus-handler.d.ts +0 -0
- /package/src/lib/{helper → utils}/json-schema-utils.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luzmo/embed",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-es2021",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"lit": "^3.3.1",
|
|
6
|
-
"@
|
|
6
|
+
"@module-federation/runtime": "^2.9.0",
|
|
7
|
+
"@luzmo/dashboard-contents-types": "1.0.41"
|
|
7
8
|
},
|
|
8
9
|
"keywords": [
|
|
10
|
+
"es2021",
|
|
11
|
+
"safari-compatible",
|
|
9
12
|
"es6",
|
|
10
13
|
"web-component",
|
|
11
14
|
"lit",
|
|
@@ -21,5 +24,28 @@
|
|
|
21
24
|
],
|
|
22
25
|
"module": "./index.js",
|
|
23
26
|
"types": "./src/index.d.ts",
|
|
24
|
-
"
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./src/index.d.ts",
|
|
30
|
+
"import": "./index.js",
|
|
31
|
+
"require": "./index.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./shared": {
|
|
34
|
+
"types": "./src/index.shared.d.ts",
|
|
35
|
+
"import": "./index.shared.js",
|
|
36
|
+
"require": "./index.shared.cjs",
|
|
37
|
+
"default": "./index.shared.js"
|
|
38
|
+
},
|
|
39
|
+
"./rn": {
|
|
40
|
+
"types": "./src/index.rn.d.ts",
|
|
41
|
+
"import": "./index.rn.js",
|
|
42
|
+
"require": "./index.rn.cjs",
|
|
43
|
+
"default": "./index.rn.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
47
|
+
"description": "ES2021 build for Safari < 16.3 compatibility",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"tag": "es2021"
|
|
50
|
+
}
|
|
25
51
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './lib/shared/helpers/browser-check';
|
|
2
|
+
export * from './lib/shared/helpers/default-parameters';
|
|
3
|
+
export * from './lib/shared/helpers/error';
|
|
4
|
+
export * from './lib/shared/helpers/extents';
|
|
5
|
+
export * from './lib/shared/helpers/translations';
|
|
6
|
+
export * from './lib/shared/helpers/utils';
|
|
7
|
+
export * from './lib/shared/helpers/iframe-url';
|
|
8
|
+
export * from './lib/shared/helpers/get-loader';
|
|
9
|
+
export * from './lib/shared/helpers/promise-dispatch';
|
|
10
|
+
export * from './lib/shared/helpers/styles';
|
|
11
|
+
export * from './lib/shared/helpers/update-iframe-url';
|
|
12
|
+
export * from './lib/shared/helpers/set-selected-data-utils';
|
|
13
|
+
export * from './lib/shared/methods';
|
|
14
|
+
export * from './lib/shared/service/calculate-dimensions';
|
|
15
|
+
export * from './lib/shared/service/extend-and-validate';
|
|
16
|
+
export * from './lib/shared/models';
|
|
17
|
+
export * from './lib/shared/models/viz-items';
|
|
18
|
+
export * from './lib/shared/constants/class-constants';
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type * from '@luzmo/dashboard-contents-types';
|
|
2
|
-
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, CleanFilter, CleanFilterClauseGroup, CleanFilterGroup, CleanRetrievedFilterGroup, DashboardFilterOutput, ItemFilterOutput, SelectedDataInput, ExportType, DashboardExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode, SetSelectedData, DashboardEditMode, VizItemPostMessageLoadEvent, VizItemPostMessageRenderedEvent, VizItemPostMessageExportedEvent, VizItemPostMessageChangedFiltersEvent, VizItemPostMessageCustomEventEvent, VizItemPostMessageAuthorizationExpiredEvent, VizItemPostMessageErrorEvent, EmbedErrorEvent, EmbedErrorEventData } from '
|
|
3
|
-
export { selectedDataUtils, preloadDashboard, preloadVizItem, preloadIQ } from '
|
|
2
|
+
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, CleanFilter, CleanFilterClauseGroup, CleanFilterGroup, CleanRetrievedFilterGroup, DashboardFilterOutput, ItemFilterOutput, SelectedDataInput, ExportType, DashboardExportType, ItemData, ExportDashboard, AccessibleDashboard, AddFilters, PartialRecord, SendExportEmailType, SetEditMode, SetPreview, SetSelectedData, DashboardEditMode, SupportedLanguage, VizItemPostMessageLoadEvent, VizItemPostMessageRenderedEvent, VizItemPostMessageExportedEvent, VizItemPostMessageChangedFiltersEvent, VizItemPostMessageCustomEventEvent, VizItemPostMessageAuthorizationExpiredEvent, VizItemPostMessageErrorEvent, EmbedErrorEvent, EmbedErrorEventData } from './index.shared';
|
|
3
|
+
export { selectedDataUtils, preloadDashboard, preloadVizItem, preloadIQ } from './index.shared';
|
|
4
4
|
export * from './lib/dashboard/dashboard-component';
|
|
5
5
|
export * from './lib/viz-item/viz-item-component';
|
|
6
6
|
export * from './lib/iq-components/luzmo-iq-chat';
|
|
7
7
|
export * from './lib/iq-components/luzmo-iq-answer';
|
|
8
|
-
export * from './lib/
|
|
8
|
+
export * from './lib/utils/json-schema-utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.common';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as SharedLib from '@luzmo/shared-embed';
|
|
2
1
|
import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import * as SharedLib from '../../index.shared';
|
|
3
3
|
export declare class LuzmoDashboard extends LitElement implements SharedLib.WebComponentLuzmoDashboard {
|
|
4
4
|
container: HTMLElement;
|
|
5
5
|
luzmoEmbedContainer: HTMLElement;
|
|
@@ -45,6 +45,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
45
45
|
browserError: boolean;
|
|
46
46
|
browserErrorMsg: string;
|
|
47
47
|
dashboardError: boolean;
|
|
48
|
+
dashboardErrorMsg: string;
|
|
48
49
|
browserNotSupported: any[];
|
|
49
50
|
libVersion: string;
|
|
50
51
|
protected isLibraryLoaded: boolean;
|
|
@@ -62,6 +63,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
62
63
|
iframeWidth?: string;
|
|
63
64
|
_resizeObserver: ResizeObserver;
|
|
64
65
|
private _viewportTrackingActive;
|
|
66
|
+
private _webComponentLibraryLoadId;
|
|
65
67
|
private _onViewportChange;
|
|
66
68
|
constructor();
|
|
67
69
|
connectedCallback(): void;
|
|
@@ -73,6 +75,8 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
73
75
|
initComponent(): void;
|
|
74
76
|
setAllAttributes(): void;
|
|
75
77
|
setAllAttributesOnElement(el: SharedLib.LuzmoElement): void;
|
|
78
|
+
private getAttributeValue;
|
|
79
|
+
private setAttributeOnElement;
|
|
76
80
|
updated(changedProperties: PropertyValues): void;
|
|
77
81
|
_reloadIframeContent(): void;
|
|
78
82
|
_setOptions(): SharedLib.DashboardContentParams;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
|
-
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
4
3
|
import type { TemplateResult } from 'lit-html';
|
|
5
4
|
export declare class LuzmoIQEmbedAnswerComponent extends LitElement {
|
|
6
5
|
appServer?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IQChatOptions } from '@luzmo/dashboard-contents-types';
|
|
2
|
-
import { type DashboardContext } from '@luzmo/shared-embed';
|
|
3
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
3
|
import type { TemplateResult } from 'lit-html';
|
|
4
|
+
import { type DashboardContext } from '../../index.shared';
|
|
5
5
|
/**
|
|
6
6
|
* Dashboard context accepted by the embedded IQ chat. Alias of the shared embed
|
|
7
7
|
* {@link DashboardContext} so the published contract stays in lockstep with
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const luzmoEmbedContainerClass = "luzmo-embed-container";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createIframeUrl: (dashboardContent: any) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
2
|
+
export declare function resolvePromise<T extends LuzmoDashboard>(dashboardComponent: T, requestId: string, data: unknown): void;
|
|
3
|
+
export declare function rejectPromise<T extends LuzmoDashboard>(dashboardComponent: T, requestId: string, data: unknown): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type RemoteApp = 'DashboardApp' | 'VizItemApp' | 'IQApp';
|
|
2
|
+
export declare function loadLibrary(appServer: string, componentName?: RemoteApp): Promise<any>;
|
|
3
|
+
/**
|
|
4
|
+
* Eagerly starts loading the Dashboard remote module without blocking.
|
|
5
|
+
*
|
|
6
|
+
* Call this as early as possible in your application — ideally at the module
|
|
7
|
+
* top level before any Luzmo components are rendered — so the network fetch
|
|
8
|
+
* overlaps with the host app's own JS execution rather than being serialized
|
|
9
|
+
* after it. Pass a custom `appServer` if you are not using the default
|
|
10
|
+
* `https://app.luzmo.com`.
|
|
11
|
+
*
|
|
12
|
+
* Safe to call multiple times for the same `appServer`; subsequent calls are no-ops.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // index.tsx — module top level, before any component trees render
|
|
16
|
+
* import { preloadDashboard } from '@luzmo/react-embed';
|
|
17
|
+
* preloadDashboard(); // default appServer
|
|
18
|
+
* preloadDashboard('https://app.eu.luzmo.com'); // custom appServer
|
|
19
|
+
*/
|
|
20
|
+
export declare function preloadDashboard(appServer?: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Eagerly starts loading the VizItem remote module without blocking.
|
|
23
|
+
*
|
|
24
|
+
* Call this as early as possible in your application — ideally at the module
|
|
25
|
+
* top level before any Luzmo components are rendered — so the network fetch
|
|
26
|
+
* overlaps with the host app's own JS execution rather than being serialized
|
|
27
|
+
* after it. Pass a custom `appServer` if you are not using the default
|
|
28
|
+
* `https://app.luzmo.com`.
|
|
29
|
+
*
|
|
30
|
+
* Safe to call multiple times for the same `appServer`; subsequent calls are no-ops.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // index.tsx — module top level, before any component trees render
|
|
34
|
+
* import { preloadVizItem } from '@luzmo/react-embed';
|
|
35
|
+
* preloadVizItem(); // default appServer
|
|
36
|
+
* preloadVizItem('https://app.eu.luzmo.com'); // custom appServer
|
|
37
|
+
*/
|
|
38
|
+
export declare function preloadVizItem(appServer?: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Eagerly starts loading the IQ remote module without blocking.
|
|
41
|
+
*
|
|
42
|
+
* Call this as early as possible in your application — ideally at the module
|
|
43
|
+
* top level before any Luzmo components are rendered — so the network fetch
|
|
44
|
+
* overlaps with the host app's own JS execution rather than being serialized
|
|
45
|
+
* after it. Pass a custom `appServer` if you are not using the default
|
|
46
|
+
* `https://app.luzmo.com`.
|
|
47
|
+
*
|
|
48
|
+
* Safe to call multiple times for the same `appServer`; subsequent calls are no-ops.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // index.tsx — module top level, before any component trees render
|
|
52
|
+
* import { preloadIQ } from '@luzmo/react-embed';
|
|
53
|
+
* preloadIQ(); // default appServer
|
|
54
|
+
* preloadIQ('https://app.eu.luzmo.com'); // custom appServer
|
|
55
|
+
*/
|
|
56
|
+
export declare function preloadIQ(appServer?: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SelectedDataInput, AvailableSlots } from '../models/filters.model';
|
|
2
|
+
export declare const selectedDataUtils: {
|
|
3
|
+
merge(...filters: SelectedDataInput[]): SelectedDataInput;
|
|
4
|
+
isIn(slot: AvailableSlots, values: string[] | number[], otherOptions?: any): SelectedDataInput;
|
|
5
|
+
between(slot: AvailableSlots, values: [string | number, string | number], otherOptions?: any): SelectedDataInput;
|
|
6
|
+
range(slot: AvailableSlots, values: [string | number, string | number], otherOptions?: any): SelectedDataInput;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContainerLoaderStyles, ContainerStyles, IframeStyles, LcStyles, LoaderStyles, PlStyles } from '../models/styles.model';
|
|
2
|
+
import { CommonLuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
export declare function containerStyles(dashboardComponent: CommonLuzmoDashboard): ContainerStyles;
|
|
4
|
+
export declare function containerLoaderStyles(dashboardComponent: CommonLuzmoDashboard): ContainerLoaderStyles;
|
|
5
|
+
export declare function loaderStyles(dashboardComponent: CommonLuzmoDashboard): LoaderStyles;
|
|
6
|
+
export declare function plStyles(dashboardComponent: CommonLuzmoDashboard): PlStyles;
|
|
7
|
+
export declare function lcStyles(dashboardComponent: CommonLuzmoDashboard): LcStyles;
|
|
8
|
+
export declare function calculateIframeStyles(dashboardComponent: CommonLuzmoDashboard): IframeStyles;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const TRANSLATIONS: {
|
|
2
|
+
initializing: {
|
|
3
|
+
en: string;
|
|
4
|
+
nl: string;
|
|
5
|
+
fr: string;
|
|
6
|
+
de: string;
|
|
7
|
+
es: string;
|
|
8
|
+
};
|
|
9
|
+
errorDashboard: {
|
|
10
|
+
en: string;
|
|
11
|
+
nl: string;
|
|
12
|
+
fr: string;
|
|
13
|
+
de: string;
|
|
14
|
+
es: string;
|
|
15
|
+
};
|
|
16
|
+
errorItem: {
|
|
17
|
+
en: string;
|
|
18
|
+
nl: string;
|
|
19
|
+
fr: string;
|
|
20
|
+
de: string;
|
|
21
|
+
es: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default TRANSLATIONS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const updateIframeUrl: (iframe: HTMLIFrameElement, iframeUrl?: string) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
2
|
+
export declare const addTrailingSlash: (serverUrl?: string) => string;
|
|
3
|
+
export declare const removeTrailingSlash: (serverUrl?: string) => string;
|
|
4
|
+
export declare const formatDashboardList: (dashboards: any[], integrationId: string, user: any, dashboardComponent: LuzmoDashboard) => {
|
|
5
|
+
accessibleBy: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
model: "User" | "Group" | "Integration";
|
|
9
|
+
}[];
|
|
10
|
+
accessRights: {
|
|
11
|
+
flagRead?: boolean;
|
|
12
|
+
flagUse?: boolean;
|
|
13
|
+
flagModify?: boolean;
|
|
14
|
+
flagOwn?: boolean;
|
|
15
|
+
};
|
|
16
|
+
id: string;
|
|
17
|
+
modifiedAt: string;
|
|
18
|
+
name: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
tags: string[];
|
|
21
|
+
}[];
|
|
22
|
+
export declare const VERSION = "0.0.0-unknown-luzmo";
|
|
23
|
+
export declare const sanitizeUrl: (url: string) => string;
|
|
24
|
+
export declare const cloneDeep: <T>(obj: T) => T;
|
|
25
|
+
export declare const defaultsDeep: <T extends object>(target: T, defaults: T) => T;
|
|
26
|
+
export declare const s4: () => string;
|
|
27
|
+
export declare const uuidv4: () => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExportDashboard } from '../models/common.model';
|
|
2
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
export type DashboardExportType = 'pdf' | 'png';
|
|
4
|
+
export type ExportType = DashboardExportType;
|
|
5
|
+
export declare const exportDashboard: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement, format?: DashboardExportType) => Promise<ExportDashboard>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DashboardContext } from '../models/dashboard-context.model';
|
|
2
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
export declare const getDashboardContext: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement) => Promise<DashboardContext | undefined>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
2
|
+
import type { DashboardFilterOutput } from '../models/filter-output.model';
|
|
3
|
+
export declare const getFilters: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement) => Promise<DashboardFilterOutput>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LuzmoDashboard } from '../models/dashboard.model';
|
|
2
|
+
import type { GetInsightsOptions } from '../models/viz-item.model';
|
|
3
|
+
export declare const getInsights: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement, options?: GetInsightsOptions) => Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './export-dashboard';
|
|
2
|
+
export * from './get-accessible-dashboards';
|
|
3
|
+
export * from './get-dashboard-context';
|
|
4
|
+
export * from './get-data';
|
|
5
|
+
export * from './get-filters';
|
|
6
|
+
export * from './get-insights';
|
|
7
|
+
export * from './refresh-data';
|
|
8
|
+
export * from './reload-dashboard';
|
|
9
|
+
export * from './send-export-email';
|
|
10
|
+
export * from './set-authorization';
|
|
11
|
+
export * from './set-edit-mode';
|
|
12
|
+
export * from './set-preview';
|
|
13
|
+
export * from './set-selected-data';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PartialRecord, SupportedLanguage } from '../models';
|
|
2
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
export type SendExportEmailType = 'once' | 'scheduled';
|
|
4
|
+
export declare const sendExportEmail: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement, type?: SendExportEmailType, subject?: PartialRecord<SupportedLanguage, string>, message?: PartialRecord<SupportedLanguage, string>) => Promise<void>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DashboardEditMode, SetEditMode } from '../models/common.model';
|
|
2
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
export declare const setEditMode: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement, editMode?: DashboardEditMode) => Promise<SetEditMode>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SetSelectedData } from '../models/common.model';
|
|
2
|
+
import { LuzmoDashboard } from '../models/dashboard.model';
|
|
3
|
+
import { SelectedDataInput } from '../models/filters.model';
|
|
4
|
+
export declare const setSelectedData: <T extends LuzmoDashboard>(dashboardComponent: T, iframe: HTMLIFrameElement, itemId: string, filters: SelectedDataInput) => Promise<SetSelectedData>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { FilterGroup, ItemData as DashboardItemData, ScreenMode as DashboardScreenMode } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
export type ScreenMode = DashboardScreenMode | 'auto';
|
|
3
|
+
export type DashboardDimensions = Record<Exclude<ScreenMode, 'auto'>, [
|
|
4
|
+
number,
|
|
5
|
+
number,
|
|
6
|
+
string
|
|
7
|
+
]>;
|
|
8
|
+
export type CommonReturnType = {
|
|
9
|
+
dashboardId?: string;
|
|
10
|
+
dashboardSlug?: string;
|
|
11
|
+
integrationId?: string;
|
|
12
|
+
itemId?: string;
|
|
13
|
+
language?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
requestId?: string;
|
|
16
|
+
screenMode?: ScreenMode;
|
|
17
|
+
type?: string;
|
|
18
|
+
error?: boolean;
|
|
19
|
+
msg?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ExportDashboard = {
|
|
22
|
+
type: 'export';
|
|
23
|
+
} & CommonReturnType;
|
|
24
|
+
export type AccessibleDashboard = {
|
|
25
|
+
accessibleBy?: {
|
|
26
|
+
model?: 'User' | 'Group' | 'Integration';
|
|
27
|
+
id?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
}[];
|
|
30
|
+
accessRights?: {
|
|
31
|
+
flagRead?: boolean;
|
|
32
|
+
flagUse?: boolean;
|
|
33
|
+
flagModify?: boolean;
|
|
34
|
+
flagOwn?: boolean;
|
|
35
|
+
};
|
|
36
|
+
id?: string;
|
|
37
|
+
modifiedAt?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
slug?: string | null;
|
|
40
|
+
tags: string[];
|
|
41
|
+
};
|
|
42
|
+
export type ItemData = DashboardItemData;
|
|
43
|
+
export type DashboardEditMode = 'editFull' | 'editLimited' | 'view';
|
|
44
|
+
export type DashboardEmbedMode = 'webComponent' | 'iframe';
|
|
45
|
+
export type SetEditMode = {
|
|
46
|
+
type?: 'setEditMode';
|
|
47
|
+
editMode?: DashboardEditMode;
|
|
48
|
+
} & CommonReturnType;
|
|
49
|
+
export type SetSelectedData = {
|
|
50
|
+
filters?: FilterGroup[];
|
|
51
|
+
} & CommonReturnType;
|
|
52
|
+
export type SetPreview = {
|
|
53
|
+
type: 'setPreview';
|
|
54
|
+
preview?: boolean;
|
|
55
|
+
} & CommonReturnType;
|
|
56
|
+
export type AddFilters = {
|
|
57
|
+
type: 'AddFilters';
|
|
58
|
+
origin: 'itemFilter';
|
|
59
|
+
item: string;
|
|
60
|
+
filters: FilterGroup[];
|
|
61
|
+
};
|
|
62
|
+
export type DashboardPromises = Record<string, {
|
|
63
|
+
resolve: (value?: unknown | PromiseLike<unknown>) => void;
|
|
64
|
+
reject: (reason: any) => void;
|
|
65
|
+
}>;
|
|
66
|
+
export type BrowserCheckKey = 'svg' | 'flexbox' | 'postMessage';
|
|
67
|
+
export interface DashboardInputs {
|
|
68
|
+
appServer?: string;
|
|
69
|
+
apiHost?: string;
|
|
70
|
+
itemId?: string;
|
|
71
|
+
theme?: string;
|
|
72
|
+
mainColor?: string;
|
|
73
|
+
language?: string;
|
|
74
|
+
editorLanguage?: string;
|
|
75
|
+
editMode?: DashboardEditMode;
|
|
76
|
+
screenMode?: ScreenMode;
|
|
77
|
+
switchScreenModeOnResize?: boolean;
|
|
78
|
+
dashboardId?: string;
|
|
79
|
+
dashboardSlug?: string;
|
|
80
|
+
itemDimensions?: {
|
|
81
|
+
width: number | 'auto';
|
|
82
|
+
height: number | 'auto';
|
|
83
|
+
};
|
|
84
|
+
timezoneId?: string;
|
|
85
|
+
loaderBackground?: string;
|
|
86
|
+
loaderFontColor?: string;
|
|
87
|
+
loaderSpinnerColor?: string;
|
|
88
|
+
loaderSpinnerBackground?: string;
|
|
89
|
+
authKey?: string;
|
|
90
|
+
authToken?: string;
|
|
91
|
+
embedMode?: DashboardEmbedMode;
|
|
92
|
+
}
|
|
93
|
+
export interface DashboardContentParams extends Exclude<DashboardInputs, 'authKey' | 'authToken' | 'loaderBackground' | 'loaderFontColor' | 'loaderSpinnerColor' | 'loaderSpinnerBackground'> {
|
|
94
|
+
key?: DashboardInputs['authKey'];
|
|
95
|
+
token?: DashboardInputs['authToken'];
|
|
96
|
+
itemEmbedding?: boolean;
|
|
97
|
+
loaderBackground?: DashboardInputs['loaderBackground'];
|
|
98
|
+
loaderFontColor?: DashboardInputs['loaderFontColor'];
|
|
99
|
+
loaderSpinnerColor?: DashboardInputs['loaderSpinnerColor'];
|
|
100
|
+
loaderSpinnerBackground?: DashboardInputs['loaderSpinnerBackground'];
|
|
101
|
+
error?: boolean;
|
|
102
|
+
container?: string;
|
|
103
|
+
contextId?: string;
|
|
104
|
+
}
|
|
105
|
+
export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DashboardFilterOutput } from './filter-output.model';
|
|
2
|
+
/**
|
|
3
|
+
* The dashboard-state payload carried by the unified `dashboard` aiprompt input.
|
|
4
|
+
* `views` are the live dashboard-contents views, while `runtimeFilters` and
|
|
5
|
+
* `meta` are analyst read context that rides along so answers can be grounded.
|
|
6
|
+
*/
|
|
7
|
+
export interface DashboardContextValue {
|
|
8
|
+
/** Target securable id, echoed back on an edit response for the update API. */
|
|
9
|
+
id?: string;
|
|
10
|
+
views: unknown[];
|
|
11
|
+
syncScreenModes?: boolean;
|
|
12
|
+
currentScreenMode?: 'desktop' | 'tablet' | 'mobile';
|
|
13
|
+
theme?: Record<string, unknown>;
|
|
14
|
+
name?: Record<string, string>;
|
|
15
|
+
runtimeFilters?: DashboardFilterOutput;
|
|
16
|
+
meta?: {
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
};
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Canonical dashboard context shape exposed by `getDashboardContext()` and the
|
|
24
|
+
* `contextChanged` event. It mirrors the aiprompt analyst's unified `dashboard`
|
|
25
|
+
* input so the value can be forwarded straight into an AI Prompt call or into
|
|
26
|
+
* the Luzmo IQ chat component.
|
|
27
|
+
*
|
|
28
|
+
* The object itself is built inside the dashboard app; this is the published
|
|
29
|
+
* contract consumers receive over the embed boundary.
|
|
30
|
+
*/
|
|
31
|
+
export interface DashboardContext {
|
|
32
|
+
type: 'dashboard';
|
|
33
|
+
value: DashboardContextValue;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Live context of a single standalone flex chart (`luzmo-embed-viz-item`).
|
|
37
|
+
*
|
|
38
|
+
* Flex charts have no saved securable id, so `id` is the user-assigned
|
|
39
|
+
* `context-id` (or DOM `id`) used to reference the chart. Consumers (e.g. the
|
|
40
|
+
* Luzmo IQ chat component) collect one of these per tracked chart and wrap them
|
|
41
|
+
* into a synthetic dashboard-context for the analyst.
|
|
42
|
+
*/
|
|
43
|
+
export interface VizItemContext {
|
|
44
|
+
id: string;
|
|
45
|
+
type?: string;
|
|
46
|
+
slots?: unknown;
|
|
47
|
+
options?: Record<string, unknown>;
|
|
48
|
+
filters?: DashboardFilterOutput;
|
|
49
|
+
datasetIds: string[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DashboardExportType } from '../methods/export-dashboard';
|
|
2
|
+
import { SendExportEmailType } from '../methods/send-export-email';
|
|
3
|
+
import { DashboardContext } from './dashboard-context.model';
|
|
4
|
+
import { AccessibleDashboard, AddFilters, BrowserCheckKey, DashboardContentParams, DashboardDimensions, DashboardEditMode, DashboardInputs, DashboardPromises, ExportDashboard, ItemData, PartialRecord, ScreenMode, SetEditMode, SetPreview, SetSelectedData } from './common.model';
|
|
5
|
+
import type { FilterInput } from './filter-input.model';
|
|
6
|
+
import type { DashboardFilterOutput } from './filter-output.model';
|
|
7
|
+
import { IframeStyles } from './styles.model';
|
|
8
|
+
import { SupportedLanguage } from './translation.model';
|
|
9
|
+
import { CombinedSelectedDataInput } from './viz-items';
|
|
10
|
+
import { GetInsightsOptions } from './viz-item.model';
|
|
11
|
+
export interface CommonLuzmoDashboard extends DashboardInputs {
|
|
12
|
+
libVersion?: string;
|
|
13
|
+
promises?: DashboardPromises;
|
|
14
|
+
params?: DashboardContentParams;
|
|
15
|
+
iframeLoaded?: boolean;
|
|
16
|
+
loaderSize?: number;
|
|
17
|
+
borderWidth?: number;
|
|
18
|
+
minHeight?: number;
|
|
19
|
+
iframeWidth?: string;
|
|
20
|
+
iframeHeight?: string;
|
|
21
|
+
error?: boolean;
|
|
22
|
+
browserNotSupported?: BrowserCheckKey[];
|
|
23
|
+
dimensions?: DashboardDimensions;
|
|
24
|
+
currentScreenMode?: ScreenMode;
|
|
25
|
+
iframeStyle?: IframeStyles;
|
|
26
|
+
currentAuthKey?: string;
|
|
27
|
+
currentAuthToken?: string;
|
|
28
|
+
updateComplete?: Promise<boolean>;
|
|
29
|
+
}
|
|
30
|
+
export interface NgxLuzmoDashboard extends CommonLuzmoDashboard {
|
|
31
|
+
dashboardReference?: HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Will be removed in next major release. Use "WebComponentLuzmoDashboard" instead.
|
|
35
|
+
*/
|
|
36
|
+
export interface ES6LuzmoDashboard extends CommonLuzmoDashboard {
|
|
37
|
+
}
|
|
38
|
+
export interface WebComponentLuzmoDashboard extends CommonLuzmoDashboard {
|
|
39
|
+
}
|
|
40
|
+
export interface VueLuzmoDashboard extends CommonLuzmoDashboard {
|
|
41
|
+
}
|
|
42
|
+
export type LuzmoDashboard = NgxLuzmoDashboard | WebComponentLuzmoDashboard | VueLuzmoDashboard;
|
|
43
|
+
export interface LuzmoElement extends HTMLElement {
|
|
44
|
+
exportDashboard(format?: DashboardExportType): Promise<ExportDashboard>;
|
|
45
|
+
getAccessibleDashboards(): Promise<AccessibleDashboard[]>;
|
|
46
|
+
getDashboards(): Promise<LuzmoDashboard[]>;
|
|
47
|
+
getData(itemId: string): Promise<ItemData>;
|
|
48
|
+
getDashboardContext(): Promise<DashboardContext | undefined>;
|
|
49
|
+
getFilters(): Promise<DashboardFilterOutput>;
|
|
50
|
+
getInsights(options?: GetInsightsOptions): Promise<string>;
|
|
51
|
+
refreshData(itemId?: string): Promise<void>;
|
|
52
|
+
reloadDashboard(): Promise<void>;
|
|
53
|
+
sendExportEmail(type: SendExportEmailType, subject?: PartialRecord<SupportedLanguage, string>, message?: PartialRecord<SupportedLanguage, string>): Promise<void>;
|
|
54
|
+
setAuthorization(key: string, token: string): Promise<void>;
|
|
55
|
+
setEditMode(editMode: DashboardEditMode): Promise<SetEditMode>;
|
|
56
|
+
setPreview(preview: boolean): Promise<SetPreview>;
|
|
57
|
+
addFilters(itemId: string, filters: FilterInput): Promise<AddFilters>;
|
|
58
|
+
setSelectedData<K extends CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SetSelectedData>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface EmbedErrorEventData {
|
|
2
|
+
type: 'error';
|
|
3
|
+
errorMsg: string;
|
|
4
|
+
error: {
|
|
5
|
+
msg: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Payload exposed as `event.detail` by the public `error` event on Luzmo embed
|
|
10
|
+
* components (`<luzmo-embed-dashboard>`, `<luzmo-embed-viz-item>`, etc.).
|
|
11
|
+
*
|
|
12
|
+
* Fired when the embed cannot be loaded or hits a fatal error (connectivity,
|
|
13
|
+
* permissions, invalid configuration, etc.). Inspect `errorMsg` for details.
|
|
14
|
+
*/
|
|
15
|
+
export interface EmbedErrorEvent extends EmbedErrorEventData {
|
|
16
|
+
data: EmbedErrorEventData;
|
|
17
|
+
}
|