@bytexbyte/nxtlinq-ai-agent-sdk 1.4.5 → 1.4.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.
- package/dist/components/context/ChatBotContext.d.ts.map +1 -1
- package/dist/components/context/ChatBotContext.js +94 -49
- package/dist/components/types/ChatBotTypes.d.ts +2 -1
- package/dist/components/types/ChatBotTypes.d.ts.map +1 -1
- package/dist/components/types/ChatBotTypes.js +16 -0
- package/dist/components/ui/MessageList.d.ts.map +1 -1
- package/dist/components/ui/MessageList.js +20 -8
- package/dist/core/lib/useSessionStorage.d.ts +11 -0
- package/dist/core/lib/useSessionStorage.d.ts.map +1 -0
- package/dist/core/lib/useSessionStorage.js +37 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
- package/umd/nxtlinq-ai-agent.umd.js +3 -3
- package/dist/core/utils/__tests__/urlUtils.test.d.ts +0 -5
- package/dist/core/utils/__tests__/urlUtils.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/urlUtils.test.js +0 -57
- package/dist/setupTests.d.ts +0 -2
- package/dist/setupTests.d.ts.map +0 -1
- package/dist/setupTests.js +0 -16
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"urlUtils.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/urlUtils.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for URL utility functions
|
|
3
|
-
*/
|
|
4
|
-
import { containsUrls, convertUrlsToLinks, convertUrlsToHtml } from '../urlUtils';
|
|
5
|
-
describe('URL Utils', () => {
|
|
6
|
-
describe('containsUrls', () => {
|
|
7
|
-
it('should detect URLs with http protocol', () => {
|
|
8
|
-
expect(containsUrls('Visit https://example.com for more info')).toBe(true);
|
|
9
|
-
expect(containsUrls('Check out http://test.org')).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it('should detect URLs with www', () => {
|
|
12
|
-
expect(containsUrls('Go to www.google.com')).toBe(true);
|
|
13
|
-
expect(containsUrls('Visit www.example.org')).toBe(true);
|
|
14
|
-
});
|
|
15
|
-
it('should detect domain names', () => {
|
|
16
|
-
expect(containsUrls('Contact us at support@company.com')).toBe(false);
|
|
17
|
-
expect(containsUrls('Visit company.com for details')).toBe(true);
|
|
18
|
-
});
|
|
19
|
-
it('should return false for text without URLs', () => {
|
|
20
|
-
expect(containsUrls('This is just plain text')).toBe(false);
|
|
21
|
-
expect(containsUrls('No URLs here')).toBe(false);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe('convertUrlsToHtml', () => {
|
|
25
|
-
it('should convert URLs to HTML anchor tags', () => {
|
|
26
|
-
const text = 'Visit https://example.com for more info';
|
|
27
|
-
const result = convertUrlsToHtml(text);
|
|
28
|
-
expect(result).toContain('<a href="https://example.com"');
|
|
29
|
-
expect(result).toContain('target="_blank"');
|
|
30
|
-
expect(result).toContain('rel="noopener noreferrer"');
|
|
31
|
-
});
|
|
32
|
-
it('should handle www URLs', () => {
|
|
33
|
-
const text = 'Go to www.google.com';
|
|
34
|
-
const result = convertUrlsToHtml(text);
|
|
35
|
-
expect(result).toContain('<a href="https://www.google.com"');
|
|
36
|
-
});
|
|
37
|
-
it('should handle multiple URLs', () => {
|
|
38
|
-
const text = 'Visit https://example.com and www.google.com';
|
|
39
|
-
const result = convertUrlsToHtml(text);
|
|
40
|
-
expect(result).toContain('https://example.com');
|
|
41
|
-
expect(result).toContain('https://www.google.com');
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('convertUrlsToLinks', () => {
|
|
45
|
-
it('should return array with mixed content', () => {
|
|
46
|
-
const text = 'Visit https://example.com for more info';
|
|
47
|
-
const result = convertUrlsToLinks(text);
|
|
48
|
-
expect(Array.isArray(result)).toBe(true);
|
|
49
|
-
expect(result.length).toBeGreaterThan(0);
|
|
50
|
-
});
|
|
51
|
-
it('should handle text without URLs', () => {
|
|
52
|
-
const text = 'This is just plain text';
|
|
53
|
-
const result = convertUrlsToLinks(text);
|
|
54
|
-
expect(result).toEqual([text]);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
});
|
package/dist/setupTests.d.ts
DELETED
package/dist/setupTests.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../src/setupTests.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAC"}
|
package/dist/setupTests.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Test setup file for Jest
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
// Mock window.open for URL tests
|
|
4
|
-
Object.defineProperty(window, 'open', {
|
|
5
|
-
writable: true,
|
|
6
|
-
value: jest.fn(),
|
|
7
|
-
});
|
|
8
|
-
// Mock console methods to avoid noise in tests
|
|
9
|
-
global.console = {
|
|
10
|
-
...console,
|
|
11
|
-
log: jest.fn(),
|
|
12
|
-
debug: jest.fn(),
|
|
13
|
-
info: jest.fn(),
|
|
14
|
-
warn: jest.fn(),
|
|
15
|
-
error: jest.fn(),
|
|
16
|
-
};
|