@luzmo/embed 6.2.0 → 6.2.1-beta.0

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
@@ -1,5 +1,17 @@
1
1
  All notable changes to this project will be documented in this file.
2
2
 
3
+ ## [6.2.2] - 2024-12-10
4
+
5
+ ### Updates
6
+
7
+ - Enable Luzmo IQ custom chat widget button content with WebComponents slot
8
+
9
+ ## [6.2.1] - 2024-11-22
10
+
11
+ ### Updates
12
+
13
+ - Updated dependencies
14
+
3
15
  ## [6.2.0] - 2024-11-20
4
16
 
5
17
  ### Updates
package/index.cjs CHANGED
@@ -62,7 +62,7 @@ var import_style_map = require("lit/directives/style-map.js");
62
62
  var import_shared_embed = require("@luzmo/shared-embed");
63
63
 
64
64
  // libs/embed-libs/embed/package.json
65
- var version = "6.2.0";
65
+ var version = "6.2.1-beta.0";
66
66
 
67
67
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
68
68
  var LuzmoService = class {
@@ -1071,10 +1071,10 @@ if (!customElements.get("luzmo-embed-dashboard")) {
1071
1071
  var import_decorators2 = require("lit/decorators.js");
1072
1072
  var import_lit3 = require("lit");
1073
1073
  var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
1074
- var dashboardContentsVersion = "0.1.90";
1074
+ var dashboardContentsVersion = "0.1.91";
1075
1075
  var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1076
1076
  constructor() {
1077
- super();
1077
+ super(...arguments);
1078
1078
  this.appServer = "https://app.luzmo.com";
1079
1079
  this.apiHost = "https://api.luzmo.com";
1080
1080
  this.slots = [];
@@ -1240,7 +1240,7 @@ __decorateClass([
1240
1240
  converter: (value) => {
1241
1241
  try {
1242
1242
  return JSON.parse(value);
1243
- } catch (exc) {
1243
+ } catch {
1244
1244
  return value;
1245
1245
  }
1246
1246
  }
@@ -1351,7 +1351,9 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
1351
1351
  }
1352
1352
  }
1353
1353
  render() {
1354
- return import_lit4.html` `;
1354
+ return import_lit4.html`
1355
+ <slot name="custom-chat-widget-content"></slot>
1356
+ `;
1355
1357
  }
1356
1358
  };
1357
1359
  __decorateClass([
package/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  } from "@luzmo/shared-embed";
33
33
 
34
34
  // libs/embed-libs/embed/package.json
35
- var version = "6.2.0";
35
+ var version = "6.2.1-beta.0";
36
36
 
37
37
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
38
38
  var LuzmoService = class {
@@ -1041,10 +1041,10 @@ if (!customElements.get("luzmo-embed-dashboard")) {
1041
1041
  import { property as property2 } from "lit/decorators.js";
1042
1042
  import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
1043
1043
  import * as SharedLib3 from "@luzmo/shared-embed";
1044
- var dashboardContentsVersion = "0.1.90";
1044
+ var dashboardContentsVersion = "0.1.91";
1045
1045
  var LuzmoBaseVizItem = class extends LitElement2 {
1046
1046
  constructor() {
1047
- super();
1047
+ super(...arguments);
1048
1048
  this.appServer = "https://app.luzmo.com";
1049
1049
  this.apiHost = "https://api.luzmo.com";
1050
1050
  this.slots = [];
@@ -1210,7 +1210,7 @@ __decorateClass([
1210
1210
  converter: (value) => {
1211
1211
  try {
1212
1212
  return JSON.parse(value);
1213
- } catch (exc) {
1213
+ } catch {
1214
1214
  return value;
1215
1215
  }
1216
1216
  }
@@ -1321,7 +1321,9 @@ var LuzmoIQEmbedChatComponent = class extends LitElement3 {
1321
1321
  }
1322
1322
  }
1323
1323
  render() {
1324
- return html3` `;
1324
+ return html3`
1325
+ <slot name="custom-chat-widget-content"></slot>
1326
+ `;
1325
1327
  }
1326
1328
  };
1327
1329
  __decorateClass([
@@ -2015,7 +2015,7 @@ var se = e5(class extends i3 {
2015
2015
  });
2016
2016
 
2017
2017
  // libs/embed-libs/embed/package.json
2018
- var version = "6.2.0";
2018
+ var version = "6.2.1-beta.0";
2019
2019
 
2020
2020
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
2021
2021
  var LuzmoService = class {
@@ -3019,10 +3019,10 @@ if (!customElements.get("luzmo-embed-dashboard")) {
3019
3019
  }
3020
3020
 
3021
3021
  // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
3022
- var dashboardContentsVersion = "0.1.90";
3022
+ var dashboardContentsVersion = "0.1.91";
3023
3023
  var LuzmoBaseVizItem = class extends h3 {
3024
3024
  constructor() {
3025
- super();
3025
+ super(...arguments);
3026
3026
  this.appServer = "https://app.luzmo.com";
3027
3027
  this.apiHost = "https://api.luzmo.com";
3028
3028
  this.slots = [];
@@ -3188,7 +3188,7 @@ __decorateClass([
3188
3188
  converter: (value) => {
3189
3189
  try {
3190
3190
  return JSON.parse(value);
3191
- } catch (exc) {
3191
+ } catch {
3192
3192
  return value;
3193
3193
  }
3194
3194
  }
@@ -3296,7 +3296,9 @@ var LuzmoIQEmbedChatComponent = class extends h3 {
3296
3296
  }
3297
3297
  }
3298
3298
  render() {
3299
- return ke` `;
3299
+ return ke`
3300
+ <slot name="custom-chat-widget-content"></slot>
3301
+ `;
3300
3302
  }
3301
3303
  };
3302
3304
  __decorateClass([
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "6.2.0",
3
+ "version": "6.2.1-beta.0",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
- "@luzmo/shared-embed": "5.2.0",
7
- "@luzmo/dashboard-contents-types": "1.0.5"
6
+ "@luzmo/shared-embed": "5.2.1",
7
+ "@luzmo/dashboard-contents-types": "1.0.6"
8
8
  },
9
9
  "type": "module",
10
10
  "keywords": [
@@ -20,5 +20,7 @@
20
20
  "chart",
21
21
  "cumul.io",
22
22
  "component"
23
- ]
23
+ ],
24
+ "module": "./index.js",
25
+ "types": "./src/index.d.ts"
24
26
  }
@@ -1,6 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import * as SharedLib from '@luzmo/shared-embed';
3
- import type { VizItemType, VizItemSlots, FilterGroup, VizItemOptions } from '@luzmo/dashboard-contents-types';
3
+ import { VizItemType, FilterGroup, VizItemOptions, VizItemSlots } from '@luzmo/dashboard-contents-types';
4
4
  /**
5
5
  * The version of the dashboard contents that is linked to the current library.
6
6
  *
@@ -9,7 +9,7 @@ import type { VizItemType, VizItemSlots, FilterGroup, VizItemOptions } from '@lu
9
9
  * together with this dashboard contents version are passed to the dashboard app (https://app.luzmo.com/dashboard-app/remoteEntry.mjs)
10
10
  * and if needed the migration will be applied on the dashboard app level.
11
11
  */
12
- export declare const dashboardContentsVersion = "0.1.90";
12
+ export declare const dashboardContentsVersion = "0.1.91";
13
13
  type FunctionCall = [(...args: any) => any, any[]];
14
14
  interface LuzmoVizItemComponentInterface extends HTMLElement {
15
15
  options?: VizItemOptions;
@@ -54,7 +54,6 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
54
54
  };
55
55
  postInitCallQueue: FunctionCall[];
56
56
  static styles: import("lit").CSSResult;
57
- constructor();
58
57
  protected createRenderRoot(): HTMLElement | DocumentFragment;
59
58
  canInitializeVizItem(): boolean;
60
59
  getFilters(): FilterGroup[];
package/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export type * 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 } 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';
8
- export * from './lib/helper/json-schema-utils';
@@ -1,98 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export declare const dashboardStyles: import("lit").CSSResult;
@@ -1 +0,0 @@
1
- export declare const _setEventHandler: () => void;
@@ -1,64 +0,0 @@
1
- /**
2
- * Adds JSON schemas to cache.
3
- */
4
- export declare function addJSONSchemas(schemas: any): void;
5
- /**
6
- * Returns a cached JSON schema by URL/schema $id.
7
- */
8
- export declare function getCachedJSONSchema(schemaUrl: string): any;
9
- /**
10
- * Returns all the cached JSON schemas.
11
- */
12
- export declare function getCachedJSONSchemas(): Record<string, any>;
13
- /**
14
- * Returns a URL for a Luzmo JSON schema name.
15
- */
16
- export declare function getJSONSchemaUrl(schemaName: string): string;
17
- /**
18
- * Fetches a Luzmo JSON schema. If a schema is cached it's returned.
19
- *
20
- * Example usage:
21
- * const schema = await fetchJSONSchema('viz-item-type');
22
- *
23
- * In the example above, a schema https://developer.luzmo.com/assets/json-schemas/{version}/viz-item-type.schema.json
24
- * will be fetched and cached.
25
- */
26
- export declare function fetchJSONSchema(schemaName: string): Promise<any>;
27
- /**
28
- * If you need to dereference Luzmo JSON schemas in your application, you can use @apidevtools/json-schema-ref-parser
29
- * library and provide the following options for the refParser.dereference() method.
30
- *
31
- * Example usage:
32
- *
33
- * import * as refParser from '@apidevtools/json-schema-ref-parser';
34
- * import { fetchJSONSchema, luzmoRefParserOptions } from '@luzmo/embed';
35
- *
36
- * async function showDereferencedSchema() {
37
- * const schema = await fetchJSONSchema('text');
38
- * const dereferencedSchema = await refParser.dereference(schema, luzmoRefParserOptions);
39
- * console.log(dereferencedSchema);
40
- * }
41
- *
42
- * Another example:
43
- *
44
- * import * as refParser from '@apidevtools/json-schema-ref-parser';
45
- * import { addJSONSchemas, luzmoRefParserOptions } from '@luzmo/embed';
46
- * import { TextJSONSchema, TextOptionsJSONSchema } from "@luzmo/dashboard-contents-types";
47
- *
48
- * async function showDereferencedSchema() {
49
- * addJSONSchemas([TextJSONSchema, TextOptionsJSONSchema]);
50
- * const dereferencedSchema = await refParser.dereference(TextJSONSchema, luzmoRefParserOptions);
51
- * console.log(dereferencedSchema);
52
- * }
53
- */
54
- export declare const luzmoRefParserOptions: {
55
- mutateInputSchema: boolean;
56
- resolve: {
57
- luzmo: {
58
- order: number;
59
- canRead: (file: any) => boolean;
60
- read: (file: any, callback: any) => void;
61
- };
62
- external: boolean;
63
- };
64
- };
@@ -1,22 +0,0 @@
1
- import { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
2
- import { LitElement, PropertyValues } from 'lit';
3
- export declare class LuzmoIQEmbedAnswerComponent extends LitElement {
4
- appServer?: string;
5
- apiHost?: string;
6
- options?: IQAnswerOptions;
7
- aiEndPoint?: string;
8
- authKey?: string;
9
- authToken?: string;
10
- messages: 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
- }
@@ -1,23 +0,0 @@
1
- import { IQChatOptions } from '@luzmo/dashboard-contents-types';
2
- import { LitElement, PropertyValues } from 'lit';
3
- export declare class LuzmoIQEmbedChatComponent extends LitElement {
4
- appServer?: string;
5
- apiHost?: string;
6
- options?: 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
- }
@@ -1,6 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- import { LuzmoBaseVizItem } from './viz-item.base';
2
- export type { LuzmoVizItemComponentInterface } from './viz-item.base';
3
- export declare class LuzmoEmbedVizItem extends LuzmoBaseVizItem {
4
- }
@@ -1,72 +0,0 @@
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.90";
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
- }