embeddedaichatux 1.5.2 → 1.6.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/EmbeddedChat.js CHANGED
@@ -16,6 +16,7 @@
16
16
  this.minimizedHeight = `${this.height * 0.3}px`; // 30% of the full height
17
17
  this.mouseInsideChat = false;
18
18
  this.hasRefreshed = false; // Flag to prevent endless loop
19
+ this.conversationId = null;
19
20
 
20
21
  // Determine transition styles
21
22
  const transitionStyle = this.enableAnimation ? 'transition: height 0.3s ease, opacity 0.3s ease;' : '';
@@ -44,7 +45,8 @@
44
45
 
45
46
  getStoredConversationId() {
46
47
  try {
47
- return localStorage.getItem(`conversationId_${this.chatId}`);
48
+ const storedId = localStorage.getItem(`conversationId_${this.chatId}`);
49
+ return storedId;
48
50
  } catch (error) {
49
51
  console.error('Error accessing localStorage:', error);
50
52
  return null;
@@ -59,6 +61,16 @@
59
61
  }
60
62
  }
61
63
 
64
+ setConversationId(newConversationId) {
65
+ const previousId = this.conversationId || 'null';
66
+
67
+ if (newConversationId !== previousId) {
68
+ // Separate block for changes to allow breakpoint placement
69
+ this.conversationId = newConversationId;
70
+ this.setStoredConversationId(newConversationId);
71
+ }
72
+ }
73
+
62
74
  init() {
63
75
  this.updateIframes();
64
76
  this.addEventListeners();
@@ -116,10 +128,11 @@
116
128
  if (this.sessionInfo !== null) {
117
129
  this.setSessionInfo(this.sessionInfo);
118
130
  }
119
- if (e.data.message === "show" && e.data.conversationId) {
120
- this.conversationId = e.data.conversationId;
121
- this.setStoredConversationId(this.conversationId);
122
- }
131
+ }
132
+
133
+ // Check and update conversationId after processing other conditions
134
+ if (e.data.conversationId) {
135
+ this.setConversationId(e.data.conversationId);
123
136
  }
124
137
  } else if (typeof e.data === "string") {
125
138
  if (e.data === "minimize") {
@@ -162,6 +175,8 @@
162
175
 
163
176
  this.iframe.style.height = `${this.height}px`;
164
177
  this.iframe.style.opacity = '1';
178
+
179
+ this.iframe.contentWindow.postMessage({ message: "show" }, "*");
165
180
  }
166
181
 
167
182
  applyScale(scale) {
@@ -187,7 +202,6 @@
187
202
  const iframe = this.containerDiv.querySelector("#embedded-chat");
188
203
 
189
204
  const postMessage = () => {
190
- console.log('Posting message to iframe:', { type: 'setSessionInfo', sessionInfo: sessionInfo });
191
205
  iframe.contentWindow.postMessage({ type: 'setSessionInfo', sessionInfo: sessionInfo }, "*");
192
206
  };
193
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "embeddedaichatux",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "A lightweight and customizable embedded AI chat UI component that seamlessly integrates into web applications, offering minimized and expanded views, with iframe-based content rendering.",
5
5
  "main": "EmbeddedChat.js",
6
6
  "scripts": {
@@ -1,72 +0,0 @@
1
- {
2
- "format": 1,
3
- "restore": {
4
- "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj": {}
5
- },
6
- "projects": {
7
- "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj": {
8
- "version": "1.0.0",
9
- "restore": {
10
- "projectUniqueName": "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj",
11
- "projectName": "AIChat.npm",
12
- "projectPath": "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj",
13
- "packagesPath": "C:\\Users\\esipo\\.nuget\\packages\\",
14
- "outputPath": "C:\\Git\\AIChat\\AIChat.npm\\obj\\",
15
- "projectStyle": "PackageReference",
16
- "configFilePaths": [
17
- "C:\\Users\\esipo\\AppData\\Roaming\\NuGet\\NuGet.Config",
18
- "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
19
- ],
20
- "originalTargetFrameworks": [
21
- "net7.0"
22
- ],
23
- "sources": {
24
- "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
25
- "C:\\Program Files\\dotnet\\library-packs": {},
26
- "https://api.nuget.org/v3/index.json": {}
27
- },
28
- "frameworks": {
29
- "net7.0": {
30
- "targetAlias": "net7.0",
31
- "projectReferences": {}
32
- }
33
- },
34
- "warningProperties": {
35
- "warnAsError": [
36
- "NU1605"
37
- ]
38
- },
39
- "restoreAuditProperties": {
40
- "enableAudit": "true",
41
- "auditLevel": "low",
42
- "auditMode": "direct"
43
- }
44
- },
45
- "frameworks": {
46
- "net7.0": {
47
- "targetAlias": "net7.0",
48
- "imports": [
49
- "net461",
50
- "net462",
51
- "net47",
52
- "net471",
53
- "net472",
54
- "net48",
55
- "net481"
56
- ],
57
- "assetTargetFallback": true,
58
- "warn": true,
59
- "frameworkReferences": {
60
- "Microsoft.AspNetCore.App": {
61
- "privateAssets": "none"
62
- },
63
- "Microsoft.NETCore.App": {
64
- "privateAssets": "all"
65
- }
66
- },
67
- "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.302\\RuntimeIdentifierGraph.json"
68
- }
69
- }
70
- }
71
- }
72
- }
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="no"?>
2
- <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
4
- <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
5
- <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6
- <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
7
- <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
8
- <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\esipo\.nuget\packages\</NuGetPackageFolders>
9
- <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
10
- <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
11
- </PropertyGroup>
12
- <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
13
- <SourceRoot Include="C:\Users\esipo\.nuget\packages\" />
14
- </ItemGroup>
15
- </Project>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="no"?>
2
- <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -1,4 +0,0 @@
1
- // <autogenerated />
2
- using System;
3
- using System.Reflection;
4
- [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
@@ -1,23 +0,0 @@
1
- //------------------------------------------------------------------------------
2
- // <auto-generated>
3
- // This code was generated by a tool.
4
- // Runtime Version:4.0.30319.42000
5
- //
6
- // Changes to this file may cause incorrect behavior and will be lost if
7
- // the code is regenerated.
8
- // </auto-generated>
9
- //------------------------------------------------------------------------------
10
-
11
- using System;
12
- using System.Reflection;
13
-
14
- [assembly: System.Reflection.AssemblyCompanyAttribute("AIChat.npm")]
15
- [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
16
- [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17
- [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ed2e2b2718adc480daaa0babfd2447befc969197")]
18
- [assembly: System.Reflection.AssemblyProductAttribute("AIChat.npm")]
19
- [assembly: System.Reflection.AssemblyTitleAttribute("AIChat.npm")]
20
- [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
21
-
22
- // Generated by the MSBuild WriteCodeFragment class.
23
-
@@ -1 +0,0 @@
1
- f06fa2a1072fc32fb1c791674c951c64759966ce991b3d6dc890b7fc56801ae1
@@ -1,19 +0,0 @@
1
- is_global = true
2
- build_property.TargetFramework = net7.0
3
- build_property.TargetPlatformMinVersion =
4
- build_property.UsingMicrosoftNETSdkWeb = true
5
- build_property.ProjectTypeGuids =
6
- build_property.InvariantGlobalization =
7
- build_property.PlatformNeutralAssembly =
8
- build_property.EnforceExtendedAnalyzerRules =
9
- build_property._SupportedPlatformList = Linux,macOS,Windows
10
- build_property.RootNamespace = AIChat.npm
11
- build_property.RootNamespace = AIChat.npm
12
- build_property.ProjectDir = C:\Git\AIChat\AIChat.npm\
13
- build_property.EnableComHosting =
14
- build_property.EnableGeneratedComInterfaceComImportInterop =
15
- build_property.RazorLangVersion = 7.0
16
- build_property.SupportLocalizedComponentNames =
17
- build_property.GenerateRazorMetadataSourceChecksumAttributes =
18
- build_property.MSBuildProjectDirectory = C:\Git\AIChat\AIChat.npm
19
- build_property._RazorSourceGeneratorDebug =
@@ -1,17 +0,0 @@
1
- // <auto-generated/>
2
- global using global::Microsoft.AspNetCore.Builder;
3
- global using global::Microsoft.AspNetCore.Hosting;
4
- global using global::Microsoft.AspNetCore.Http;
5
- global using global::Microsoft.AspNetCore.Routing;
6
- global using global::Microsoft.Extensions.Configuration;
7
- global using global::Microsoft.Extensions.DependencyInjection;
8
- global using global::Microsoft.Extensions.Hosting;
9
- global using global::Microsoft.Extensions.Logging;
10
- global using global::System;
11
- global using global::System.Collections.Generic;
12
- global using global::System.IO;
13
- global using global::System.Linq;
14
- global using global::System.Net.Http;
15
- global using global::System.Net.Http.Json;
16
- global using global::System.Threading;
17
- global using global::System.Threading.Tasks;
@@ -1,77 +0,0 @@
1
- {
2
- "version": 3,
3
- "targets": {
4
- "net7.0": {}
5
- },
6
- "libraries": {},
7
- "projectFileDependencyGroups": {
8
- "net7.0": []
9
- },
10
- "packageFolders": {
11
- "C:\\Users\\esipo\\.nuget\\packages\\": {}
12
- },
13
- "project": {
14
- "version": "1.0.0",
15
- "restore": {
16
- "projectUniqueName": "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj",
17
- "projectName": "AIChat.npm",
18
- "projectPath": "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj",
19
- "packagesPath": "C:\\Users\\esipo\\.nuget\\packages\\",
20
- "outputPath": "C:\\Git\\AIChat\\AIChat.npm\\obj\\",
21
- "projectStyle": "PackageReference",
22
- "configFilePaths": [
23
- "C:\\Users\\esipo\\AppData\\Roaming\\NuGet\\NuGet.Config",
24
- "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
25
- ],
26
- "originalTargetFrameworks": [
27
- "net7.0"
28
- ],
29
- "sources": {
30
- "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
31
- "C:\\Program Files\\dotnet\\library-packs": {},
32
- "https://api.nuget.org/v3/index.json": {}
33
- },
34
- "frameworks": {
35
- "net7.0": {
36
- "targetAlias": "net7.0",
37
- "projectReferences": {}
38
- }
39
- },
40
- "warningProperties": {
41
- "warnAsError": [
42
- "NU1605"
43
- ]
44
- },
45
- "restoreAuditProperties": {
46
- "enableAudit": "true",
47
- "auditLevel": "low",
48
- "auditMode": "direct"
49
- }
50
- },
51
- "frameworks": {
52
- "net7.0": {
53
- "targetAlias": "net7.0",
54
- "imports": [
55
- "net461",
56
- "net462",
57
- "net47",
58
- "net471",
59
- "net472",
60
- "net48",
61
- "net481"
62
- ],
63
- "assetTargetFallback": true,
64
- "warn": true,
65
- "frameworkReferences": {
66
- "Microsoft.AspNetCore.App": {
67
- "privateAssets": "none"
68
- },
69
- "Microsoft.NETCore.App": {
70
- "privateAssets": "all"
71
- }
72
- },
73
- "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.302\\RuntimeIdentifierGraph.json"
74
- }
75
- }
76
- }
77
- }
@@ -1,8 +0,0 @@
1
- {
2
- "version": 2,
3
- "dgSpecHash": "LYPshyDILX4=",
4
- "success": true,
5
- "projectFilePath": "C:\\Git\\AIChat\\AIChat.npm\\AIChat.npm.csproj",
6
- "expectedPackageFiles": [],
7
- "logs": []
8
- }