@luzmo/embed 6.1.2-beta.6 → 6.1.2-beta.7

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.
Files changed (45) hide show
  1. package/index.cjs +56871 -0
  2. package/index.d.ts +7 -0
  3. package/index.js +56841 -0
  4. package/lib/dashboard-component/dashboard-base.d.ts +98 -0
  5. package/lib/dashboard-component/dashboard-component.d.ts +8 -0
  6. package/lib/dashboard-component/dashboard-styles.d.ts +1 -0
  7. package/lib/helper/event-bus-handler.d.ts +1 -0
  8. package/lib/luzmo-iq-components/luzmo-iq-answer.d.ts +22 -0
  9. package/lib/luzmo-iq-components/luzmo-iq-chat.d.ts +23 -0
  10. package/lib/luzmo-service.d.ts +6 -0
  11. package/lib/viz-item/viz-item-component.d.ts +4 -0
  12. package/lib/viz-item/viz-item.base.d.ts +72 -0
  13. package/luzmo-embed.min.js +58912 -0
  14. package/package.json +2 -2
  15. package/src/index.d.ts +7 -0
  16. package/src/lib/dashboard-component/dashboard-base.d.ts +98 -0
  17. package/src/lib/dashboard-component/dashboard-component.d.ts +8 -0
  18. package/src/lib/dashboard-component/dashboard-styles.d.ts +1 -0
  19. package/src/lib/helper/event-bus-handler.d.ts +1 -0
  20. package/src/lib/luzmo-iq-components/luzmo-iq-answer.d.ts +22 -0
  21. package/src/lib/luzmo-iq-components/luzmo-iq-chat.d.ts +23 -0
  22. package/src/lib/luzmo-service.d.ts +6 -0
  23. package/src/lib/viz-item/viz-item-component.d.ts +4 -0
  24. package/src/lib/viz-item/viz-item.base.d.ts +72 -0
  25. package/.prettierignore +0 -4
  26. package/esbuild.config.cjs +0 -13
  27. package/eslint.config.cjs +0 -8
  28. package/jest.config.ts +0 -11
  29. package/project.json +0 -50
  30. package/src/index.ts +0 -46
  31. package/src/lib/dashboard-component/dashboard-base.ts +0 -827
  32. package/src/lib/dashboard-component/dashboard-component.spec.ts +0 -27
  33. package/src/lib/dashboard-component/dashboard-component.ts +0 -12
  34. package/src/lib/dashboard-component/dashboard-styles.ts +0 -117
  35. package/src/lib/helper/event-bus-handler.ts +0 -184
  36. package/src/lib/luzmo-iq-components/luzmo-iq-answer.ts +0 -105
  37. package/src/lib/luzmo-iq-components/luzmo-iq-chat.ts +0 -105
  38. package/src/lib/luzmo-service.ts +0 -7
  39. package/src/lib/viz-item/viz-item-component.ts +0 -9
  40. package/src/lib/viz-item/viz-item.base.ts +0 -231
  41. package/src/vite-env.d.ts +0 -1
  42. package/tsconfig.json +0 -27
  43. package/tsconfig.lib.json +0 -10
  44. package/tsconfig.spec.json +0 -9
  45. package/tsconfig.typings.json +0 -11
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "6.1.2-beta.6",
3
+ "version": "6.1.2-beta.7",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
- "@luzmo/shared-embed": "5.1.2-beta.6",
6
+ "@luzmo/shared-embed": "5.1.2-beta.7",
7
7
  "@luzmo/dashboard-contents-types": "1.0.3"
8
8
  },
9
9
  "type": "module",
package/src/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from '@luzmo/dashboard-contents-types';
2
+ export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, SelectedDataInput, ExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode, SetSelectedData, VizItemPostMessageLoadEvent, VizItemPostMessageRenderedEvent, VizItemPostMessageExportedEvent, VizItemPostMessageChangedFiltersEvent, VizItemPostMessageCustomEventEvent, IQChatOptions, IQAnswerOptions, IQMessage, IQSuggestion } from '@luzmo/shared-embed';
3
+ export { selectedDataUtils } from '@luzmo/shared-embed';
4
+ export * from './lib/dashboard-component/dashboard-component';
5
+ export * from './lib/viz-item/viz-item-component';
6
+ export * from './lib/luzmo-iq-components/luzmo-iq-chat';
7
+ export * from './lib/luzmo-iq-components/luzmo-iq-answer';
@@ -0,0 +1,98 @@
1
+ import * as SharedLib from '@luzmo/shared-embed';
2
+ import { LitElement, PropertyValues, TemplateResult } from 'lit';
3
+ import { LuzmoElement, CombinedSelectedDataInput } from '@luzmo/shared-embed';
4
+ import type { FilterGroup } from '@luzmo/dashboard-contents-types';
5
+ /**
6
+ * Luzmo Dashboard
7
+ * Base component isn't registered in customEvents registry so that it can be reused.
8
+ */
9
+ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6LuzmoDashboard {
10
+ container: HTMLElement;
11
+ luzmoEmbedContainer: HTMLElement;
12
+ iframe: HTMLIFrameElement;
13
+ dashboardId?: SharedLib.DashboardInputs['dashboardId'];
14
+ dashboardSlug?: SharedLib.DashboardInputs['dashboardSlug'];
15
+ itemId?: SharedLib.DashboardInputs['itemId'];
16
+ language: SharedLib.DashboardInputs['language'];
17
+ qeVersion: SharedLib.DashboardInputs['qeVersion'];
18
+ screenMode: SharedLib.DashboardInputs['screenMode'];
19
+ switchScreenModeOnResize: boolean;
20
+ editMode: SharedLib.DashboardInputs['editMode'];
21
+ mainColor?: SharedLib.DashboardInputs['mainColor'];
22
+ accentColor?: SharedLib.DashboardInputs['accentColor'];
23
+ authToken?: SharedLib.DashboardInputs['authToken'];
24
+ authKey?: SharedLib.DashboardInputs['authKey'];
25
+ loaderBackground?: SharedLib.DashboardInputs['loaderBackground'];
26
+ loaderFontColor?: SharedLib.DashboardInputs['loaderFontColor'];
27
+ loaderSpinnerColor?: SharedLib.DashboardInputs['loaderSpinnerColor'];
28
+ loaderSpinnerBackground?: SharedLib.DashboardInputs['loaderSpinnerBackground'];
29
+ appServer?: SharedLib.DashboardInputs['appServer'];
30
+ timezoneId?: SharedLib.DashboardInputs['timezoneId'];
31
+ apiHost?: SharedLib.DashboardInputs['apiHost'];
32
+ itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
33
+ experimental: boolean;
34
+ _containerId: string;
35
+ _iframeId: string;
36
+ params: SharedLib.DashboardContentParams;
37
+ _iframeUrl?: string;
38
+ iframeLoaded: boolean;
39
+ promises: SharedLib.DashboardPromises;
40
+ iframeStyle: SharedLib.IframeStyles;
41
+ _containerStyle: SharedLib.ContainerStyles;
42
+ _loaderStyle: SharedLib.LoaderStyles;
43
+ _lcStyle: SharedLib.LcStyles;
44
+ _loadingCircleStyle: SharedLib.PlStyles;
45
+ _containerLoaderStyle: SharedLib.ContainerLoaderStyles;
46
+ _loaderMsg: string;
47
+ containerWidth?: number;
48
+ dimensions?: SharedLib.DashboardDimensions;
49
+ currentScreenMode?: SharedLib.ScreenMode;
50
+ _itemEmbedding: boolean;
51
+ browserError: boolean;
52
+ browserErrorMsg: string;
53
+ dashboardError: boolean;
54
+ browserNotSupported: any[];
55
+ libVersion: string;
56
+ protected isLibraryLoaded: boolean;
57
+ protected dashboardReference: LuzmoElement;
58
+ currentAuthKey: string;
59
+ currentAuthToken: string;
60
+ isInitCalled: boolean;
61
+ private attributesMap;
62
+ _loadTimeoutHandle?: number;
63
+ _onResize: () => void;
64
+ loaderSize: number;
65
+ borderWidth: number;
66
+ minHeight: number;
67
+ iframeHeight?: string;
68
+ iframeWidth?: string;
69
+ _resizeObserver: ResizeObserver;
70
+ constructor();
71
+ connectedCallback(): void;
72
+ disconnectedCallback(): void;
73
+ firstUpdated(): void;
74
+ initComponent(): void;
75
+ setAllAttributes(): void;
76
+ updated(changedProperties: PropertyValues): void;
77
+ _setOptions(): SharedLib.DashboardContentParams;
78
+ _updateIframeUrl(): void;
79
+ _setupLoader(): void;
80
+ _displayError(): void;
81
+ _calculateDimAfterDashboardLoaded(): void;
82
+ _loaderStyles(): void;
83
+ static get styles(): import("lit").CSSResult[];
84
+ render(): TemplateResult;
85
+ getDashboards(): Promise<LuzmoDashboard[]>;
86
+ getData(itemId: string): Promise<SharedLib.ItemData>;
87
+ getFilters(): Promise<FilterGroup[]>;
88
+ setSelectedData<K extends CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
89
+ setAuthorization(key: string, token: string): Promise<void>;
90
+ refreshData(itemId?: string): Promise<void>;
91
+ reloadDashboard(): Promise<void>;
92
+ exportDashboard(format?: SharedLib.ExportType): Promise<SharedLib.ExportDashboard>;
93
+ getAccessibleDashboards(): Promise<SharedLib.AccessibleDashboard[]>;
94
+ addFilters(itemId: string, filters: FilterGroup[]): Promise<SharedLib.AddFilters>;
95
+ setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
96
+ setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
97
+ getIsViewMode(): boolean;
98
+ }
@@ -0,0 +1,8 @@
1
+ import { LuzmoDashboard } from './dashboard-base';
2
+ /**!
3
+ * @element luzmo-embed-dashboard
4
+ * @description Exposed by @luzmo/embed lib to everyone.
5
+ *
6
+ */
7
+ export declare class LuzmoEmbedDashboard extends LuzmoDashboard {
8
+ }
@@ -0,0 +1 @@
1
+ export declare const dashboardStyles: import("lit").CSSResult;
@@ -0,0 +1 @@
1
+ export declare const _setEventHandler: () => void;
@@ -0,0 +1,22 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import * as SharedLib from '@luzmo/shared-embed';
3
+ export declare class LuzmoIQEmbedAnswerComponent extends LitElement {
4
+ appServer?: string;
5
+ apiHost?: string;
6
+ options?: SharedLib.IQAnswerOptions;
7
+ aiEndPoint?: string;
8
+ authKey?: string;
9
+ authToken?: string;
10
+ messages: SharedLib.IQMessage[];
11
+ version?: string;
12
+ libVersion?: string;
13
+ remoteEntryServer: string;
14
+ chartElement: HTMLElement;
15
+ static styles: import("lit").CSSResult;
16
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
17
+ protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
18
+ private createAndAppendElement;
19
+ private updateVizItemProperties;
20
+ updated(changedProperties: PropertyValues): Promise<void>;
21
+ protected render(): unknown;
22
+ }
@@ -0,0 +1,23 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import * as SharedLib from '@luzmo/shared-embed';
3
+ export declare class LuzmoIQEmbedChatComponent extends LitElement {
4
+ appServer?: string;
5
+ apiHost?: string;
6
+ options?: SharedLib.IQChatOptions;
7
+ initialSuggestionsDatasetId?: string;
8
+ aiEndpoint?: string;
9
+ authKey?: string;
10
+ authToken?: string;
11
+ version?: string;
12
+ libVersion?: string;
13
+ remoteEntryServer: string;
14
+ aydHost: string;
15
+ chartElement: HTMLElement;
16
+ static styles: import("lit").CSSResult;
17
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
18
+ protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
19
+ private createAndAppendElement;
20
+ private updateVizItemProperties;
21
+ updated(changedProperties: PropertyValues): Promise<void>;
22
+ protected render(): unknown;
23
+ }
@@ -0,0 +1,6 @@
1
+ import { LuzmoDashboard } from './dashboard-component/dashboard-base';
2
+ declare class LuzmoService {
3
+ _components: LuzmoDashboard[];
4
+ }
5
+ declare const _default: LuzmoService;
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { LuzmoBaseVizItem } from './viz-item.base';
2
+ export type { LuzmoVizItemComponentInterface } from './viz-item.base';
3
+ export declare class LuzmoEmbedVizItem extends LuzmoBaseVizItem {
4
+ }
@@ -0,0 +1,72 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import * as SharedLib from '@luzmo/shared-embed';
3
+ import type { VizItemType, VizItemSlots, FilterGroup, VizItemOptions } from '@luzmo/dashboard-contents-types';
4
+ /**
5
+ * The version of the dashboard contents that is linked to the current library.
6
+ *
7
+ * If custom options/slots/etc. are passed to the component, the library assumes that
8
+ * they are using this dashboard contents version. Then custom options/slots/etc.
9
+ * together with this dashboard contents version are passed to the dashboard app (https://app.luzmo.com/dashboard-app/remoteEntry.mjs)
10
+ * and if needed the migration will be applied on the dashboard app level.
11
+ */
12
+ export declare const dashboardContentsVersion = "0.1.89";
13
+ type FunctionCall = [(...args: any) => any, any[]];
14
+ interface LuzmoVizItemComponentInterface extends HTMLElement {
15
+ options?: VizItemOptions;
16
+ type?: VizItemType;
17
+ appServer?: string;
18
+ apiHost?: string;
19
+ slots?: VizItemSlots;
20
+ canFilter?: string[] | 'all';
21
+ filters?: FilterGroup[];
22
+ contextId?: string;
23
+ authKey?: string;
24
+ authToken?: string;
25
+ dashboardId?: string;
26
+ itemId?: string;
27
+ getFilters: () => FilterGroup[];
28
+ export: () => void;
29
+ refreshData: () => void;
30
+ getData: () => SharedLib.ItemData;
31
+ setSelectedData: (selectedDataInput: SharedLib.SelectedDataInput) => SharedLib.SetSelectedData;
32
+ setAuthorization: (key: string, token: string) => void;
33
+ }
34
+ export type { LuzmoVizItemComponentInterface };
35
+ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItemComponentInterface {
36
+ appServer?: string;
37
+ apiHost?: string;
38
+ slots?: VizItemSlots;
39
+ options?: VizItemOptions;
40
+ type?: VizItemType;
41
+ authKey?: string;
42
+ authToken?: string;
43
+ version?: string;
44
+ contextId?: string;
45
+ canFilter?: SharedLib.CanFilter;
46
+ filters?: FilterGroup[];
47
+ dashboardId?: string;
48
+ itemId?: string;
49
+ selectedData: SharedLib.SelectedDataInput;
50
+ dashboardContentsVersion?: string;
51
+ libVersion?: string;
52
+ chartElement: HTMLElement & Partial<LuzmoVizItemComponentInterface> & {
53
+ setSelectedData?: (itemId?: string, filters?: SharedLib.SelectedDataInput) => SharedLib.SetSelectedData;
54
+ };
55
+ postInitCallQueue: FunctionCall[];
56
+ static styles: import("lit").CSSResult;
57
+ constructor();
58
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
59
+ canInitializeVizItem(): boolean;
60
+ getFilters(): FilterGroup[];
61
+ export(): void;
62
+ getData(): any;
63
+ refreshData(): void;
64
+ setSelectedData(selectedDataInput: SharedLib.SelectedDataInput): SharedLib.SetSelectedData;
65
+ setAuthorization(key: string, token: string): void;
66
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
67
+ protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
68
+ private createAndAppendElement;
69
+ private updateVizItemProperties;
70
+ updated(changedProperties: PropertyValues): Promise<void>;
71
+ protected render(): unknown;
72
+ }
package/.prettierignore DELETED
@@ -1,4 +0,0 @@
1
- # Add files here to ignore them from prettier formatting
2
-
3
- # Ignore all ts files as we use eslint formatting
4
- **/*.ts
@@ -1,13 +0,0 @@
1
- const esbuild = require("esbuild");
2
- const { umdWrapper } = require("esbuild-plugin-umd-wrapper");
3
-
4
- esbuild
5
- .build({
6
- entryPoints: ["libs/embed-libs/embed/src/index.ts"],
7
- outfile: "dist/libs/embed-libs/embed/luzmo-embed.min.js",
8
- format: "umd", // or "cjs"
9
- bundle: true,
10
- plugins: [umdWrapper()],
11
- })
12
- .then((result) => console.log(result))
13
- .catch(() => process.exit(1));
package/eslint.config.cjs DELETED
@@ -1,8 +0,0 @@
1
- const nx = require('@nx/eslint-plugin');
2
- const baseConfig = require('../../../eslint.config.js');
3
- const eslintUtilsConfig = require('../../../eslint-utils-config');
4
-
5
- module.exports = [
6
- ...baseConfig,
7
- eslintUtilsConfig.methods.getNoRestrictedImportsConfig(['@luzmo/embed'])
8
- ];
package/jest.config.ts DELETED
@@ -1,11 +0,0 @@
1
- /* eslint-disable */
2
- export default {
3
- displayName: 'embed',
4
- preset: '../../../jest.preset.js',
5
- testEnvironment: 'node',
6
- transform: {
7
- '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
8
- },
9
- moduleFileExtensions: ['ts', 'js', 'html'],
10
- coverageDirectory: '../../../coverage/libs/embed-libs/embed'
11
- };
package/project.json DELETED
@@ -1,50 +0,0 @@
1
- {
2
- "name": "embed-libs-embed",
3
- "$schema": "../../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "libs/embed-libs/embed/src",
5
- "projectType": "library",
6
- "tags": [],
7
- "targets": {
8
- "build": {
9
- "executor": "@nx/esbuild:esbuild",
10
- "outputs": ["{options.outputPath}"],
11
- "options": {
12
- "outputPath": "dist/libs/embed-libs/embed",
13
- "main": "libs/embed-libs/embed/src/index.ts",
14
- "tsConfig": "libs/embed-libs/embed/tsconfig.lib.json",
15
- "assets": ["libs/embed-libs/embed/*.md"],
16
- "generatePackageJson": false,
17
- "format": ["esm", "cjs"],
18
- "external": ["lit"]
19
- }
20
- },
21
- "build-min": {
22
- "executor": "nx:run-commands",
23
- "options": {
24
- "commands": ["node libs/embed-libs/embed/esbuild.config.cjs"]
25
- }
26
- },
27
- "types": {
28
- "executor": "nx:run-commands",
29
- "options": {
30
- "parallel": false,
31
- "commands": [
32
- "tsc -d --declarationDir dist/ --emitDeclarationOnly --p libs/embed-libs/embed/tsconfig.typings.json",
33
- "cp -r dist/libs/embed-libs/embed/src/* dist/libs/embed-libs/embed/",
34
- "rm -rf dist/libs/embed-libs/embed/src"
35
- ]
36
- }
37
- },
38
- "test": {
39
- "options": {
40
- "passWithNoTests": true
41
- },
42
- "configurations": {
43
- "ci": {
44
- "ci": true,
45
- "coverage": true
46
- }
47
- }
48
- }
49
- }
50
- }
package/src/index.ts DELETED
@@ -1,46 +0,0 @@
1
- export * from '@luzmo/dashboard-contents-types';
2
- export type {
3
- // region Events
4
- LoadEvent,
5
- ChangedFiltersEvent,
6
- CustomEvent,
7
- ItemsRenderedEvent,
8
- ExportedEvent,
9
- DashboardActionEvent,
10
- // endregion
11
-
12
- // region Filters
13
- SelectedDataInput,
14
- // endregion
15
-
16
- // region Common
17
- ExportType,
18
- ItemData,
19
- ExportDashboard,
20
- AccessibleDashboard,
21
- SetEditMode,
22
- SetSelectedData,
23
- // endregion
24
-
25
- // region VizItemPostMessage
26
- VizItemPostMessageLoadEvent,
27
- VizItemPostMessageRenderedEvent,
28
- VizItemPostMessageExportedEvent,
29
- VizItemPostMessageChangedFiltersEvent,
30
- VizItemPostMessageCustomEventEvent,
31
- // endregion
32
-
33
- // region IQ components
34
- IQChatOptions,
35
- IQAnswerOptions,
36
- IQMessage,
37
- IQSuggestion
38
- // endregion
39
- } from '@luzmo/shared-embed';
40
-
41
- export { selectedDataUtils } from '@luzmo/shared-embed';
42
-
43
- export * from './lib/dashboard-component/dashboard-component';
44
- export * from './lib/viz-item/viz-item-component';
45
- export * from './lib/luzmo-iq-components/luzmo-iq-chat';
46
- export * from './lib/luzmo-iq-components/luzmo-iq-answer';