@flamingo-stack/openframe-frontend-core 0.0.584-1973.5461.1 → 0.0.584
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/chat-protocol/events.d.ts +2 -8
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +0 -188
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +0 -188
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-U7MJV2V7.cjs → chunk-33DHEEMP.cjs} +33 -33
- package/dist/{chunk-U7MJV2V7.cjs.map → chunk-33DHEEMP.cjs.map} +1 -1
- package/dist/{chunk-23VBGHBL.js → chunk-3ELW4VML.js} +2 -2
- package/dist/{chunk-7KBKLN2Z.cjs → chunk-3ZA2OYRE.cjs} +3 -3
- package/dist/{chunk-7KBKLN2Z.cjs.map → chunk-3ZA2OYRE.cjs.map} +1 -1
- package/dist/{chunk-73XDYWYG.js → chunk-4T5KOD3G.js} +5 -5
- package/dist/{chunk-MI6PPL3P.js → chunk-5CJKZHWO.js} +5 -5
- package/dist/{chunk-E7Q24T4G.js → chunk-6BJYPG2V.js} +3 -3
- package/dist/{chunk-YXNMLGFI.cjs → chunk-7X5TCK4R.cjs} +10 -10
- package/dist/{chunk-YXNMLGFI.cjs.map → chunk-7X5TCK4R.cjs.map} +1 -1
- package/dist/{chunk-7DEGEI7G.js → chunk-EJKEDCTH.js} +6 -6
- package/dist/{chunk-XIV5VDWL.cjs → chunk-HCKEDTKJ.cjs} +10 -10
- package/dist/{chunk-XIV5VDWL.cjs.map → chunk-HCKEDTKJ.cjs.map} +1 -1
- package/dist/{chunk-EQGAYDTC.cjs → chunk-IIT5HWLY.cjs} +9 -9
- package/dist/{chunk-EQGAYDTC.cjs.map → chunk-IIT5HWLY.cjs.map} +1 -1
- package/dist/{chunk-7SMYBCYH.cjs → chunk-IKUSKKFZ.cjs} +540 -883
- package/dist/chunk-IKUSKKFZ.cjs.map +1 -0
- package/dist/{chunk-JKYALZB7.cjs → chunk-JAJQ5P2Q.cjs} +22 -22
- package/dist/{chunk-JKYALZB7.cjs.map → chunk-JAJQ5P2Q.cjs.map} +1 -1
- package/dist/{chunk-WAXL3E3B.cjs → chunk-JFKK3ZOA.cjs} +43 -43
- package/dist/{chunk-WAXL3E3B.cjs.map → chunk-JFKK3ZOA.cjs.map} +1 -1
- package/dist/{chunk-AWAHYAII.js → chunk-JVWRMLQZ.js} +2 -2
- package/dist/{chunk-PZ27ELFP.cjs → chunk-JWKAJTNA.cjs} +43 -33
- package/dist/chunk-JWKAJTNA.cjs.map +1 -0
- package/dist/{chunk-PISJGXXI.js → chunk-KP6VJP36.js} +3 -3
- package/dist/{chunk-NSDZAUJK.js → chunk-LNKULR4V.js} +2 -2
- package/dist/{chunk-AFQB4YL7.cjs → chunk-MEJFHD5N.cjs} +15 -15
- package/dist/{chunk-AFQB4YL7.cjs.map → chunk-MEJFHD5N.cjs.map} +1 -1
- package/dist/{chunk-5VHCSN44.js → chunk-MYEG5ZDT.js} +2 -2
- package/dist/{chunk-MMA3MTJD.cjs → chunk-P2VRLSAP.cjs} +21 -21
- package/dist/{chunk-MMA3MTJD.cjs.map → chunk-P2VRLSAP.cjs.map} +1 -1
- package/dist/{chunk-7Q34BVL7.cjs → chunk-Q66AMADB.cjs} +4 -4
- package/dist/{chunk-7Q34BVL7.cjs.map → chunk-Q66AMADB.cjs.map} +1 -1
- package/dist/{chunk-4ARYZTGV.cjs → chunk-QJR32JM2.cjs} +159 -159
- package/dist/{chunk-4ARYZTGV.cjs.map → chunk-QJR32JM2.cjs.map} +1 -1
- package/dist/{chunk-M4IIK3B7.js → chunk-RURZ6QLN.js} +3 -3
- package/dist/{chunk-TCEU6DCF.js → chunk-TLKHLGAB.js} +3 -3
- package/dist/{chunk-JCWUJHOD.js → chunk-TOUD3AGK.js} +23 -13
- package/dist/chunk-TOUD3AGK.js.map +1 -0
- package/dist/{chunk-CHI7GJ3K.cjs → chunk-UCNEQKIT.cjs} +5 -5
- package/dist/{chunk-CHI7GJ3K.cjs.map → chunk-UCNEQKIT.cjs.map} +1 -1
- package/dist/{chunk-ZRGBLM6W.cjs → chunk-VOAZU46B.cjs} +69 -69
- package/dist/{chunk-ZRGBLM6W.cjs.map → chunk-VOAZU46B.cjs.map} +1 -1
- package/dist/{chunk-GYJVLFK5.js → chunk-VZSTL5VG.js} +2 -2
- package/dist/{chunk-3CAC3AAE.js → chunk-XPJKQ63S.js} +3 -3
- package/dist/{chunk-KSC5LNSY.js → chunk-XWBND4G5.js} +187 -530
- package/dist/chunk-XWBND4G5.js.map +1 -0
- package/dist/{chunk-22DWXIV3.js → chunk-YFZDIEVC.js} +5 -5
- package/dist/{chunk-7J7XDGY6.cjs → chunk-ZHUBNWEX.cjs} +3 -3
- package/dist/{chunk-7J7XDGY6.cjs.map → chunk-ZHUBNWEX.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +1 -4
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-slash-commands.d.ts +3 -3
- package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +28 -2
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +0 -4
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +1 -35
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +3 -3
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +36 -36
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/navigation/navigation-sidebar-item.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/hover-dropdown.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +0 -130
- package/src/chat-protocol/events.ts +1 -9
- package/src/chat-protocol/nats-decoder.ts +0 -7
- package/src/components/chat/__tests__/chat-message-list.test.tsx +0 -70
- package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +0 -86
- package/src/components/chat/chat-message-enhanced.tsx +13 -28
- package/src/components/chat/chat-message-list.tsx +22 -27
- package/src/components/chat/embeddable-chat.tsx +36 -55
- package/src/components/chat/entity-cards/dispatch.tsx +17 -86
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +0 -7
- package/src/components/chat/hooks/use-slash-commands.ts +5 -9
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +29 -2
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +0 -56
- package/src/components/chat/stream/chat-stream-reducer.ts +0 -31
- package/src/components/chat/tool-execution-display.tsx +2 -5
- package/src/components/chat/types/component.types.ts +0 -4
- package/src/components/chat/types/message.types.ts +0 -39
- package/src/components/chat/types/unified-chat-state.types.ts +3 -4
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +0 -57
- package/src/components/chat/utils/process-historical-messages.ts +1 -19
- package/src/components/navigation/navigation-sidebar-item.tsx +19 -9
- package/src/components/ui/hover-dropdown.tsx +3 -8
- package/dist/chat-protocol/source-metadata.d.ts +0 -5
- package/dist/chat-protocol/source-metadata.d.ts.map +0 -1
- package/dist/chunk-7SMYBCYH.cjs.map +0 -1
- package/dist/chunk-JCWUJHOD.js.map +0 -1
- package/dist/chunk-KSC5LNSY.js.map +0 -1
- package/dist/chunk-PZ27ELFP.cjs.map +0 -1
- package/dist/components/chat/utils/chat-source-metadata.d.ts +0 -5
- package/dist/components/chat/utils/chat-source-metadata.d.ts.map +0 -1
- package/src/chat-protocol/__tests__/source-metadata.test.ts +0 -74
- package/src/chat-protocol/source-metadata.ts +0 -202
- package/src/components/chat/__tests__/embeddable-chat-sources.test.tsx +0 -411
- package/src/components/chat/__tests__/tool-execution-display.test.tsx +0 -93
- package/src/components/chat/entity-cards/__tests__/dispatch-video-refs.test.tsx +0 -74
- package/src/components/chat/hooks/__tests__/use-slash-commands.test.ts +0 -64
- package/src/components/chat/utils/chat-source-metadata.ts +0 -19
- /package/dist/{chunk-23VBGHBL.js.map → chunk-3ELW4VML.js.map} +0 -0
- /package/dist/{chunk-73XDYWYG.js.map → chunk-4T5KOD3G.js.map} +0 -0
- /package/dist/{chunk-MI6PPL3P.js.map → chunk-5CJKZHWO.js.map} +0 -0
- /package/dist/{chunk-E7Q24T4G.js.map → chunk-6BJYPG2V.js.map} +0 -0
- /package/dist/{chunk-7DEGEI7G.js.map → chunk-EJKEDCTH.js.map} +0 -0
- /package/dist/{chunk-AWAHYAII.js.map → chunk-JVWRMLQZ.js.map} +0 -0
- /package/dist/{chunk-PISJGXXI.js.map → chunk-KP6VJP36.js.map} +0 -0
- /package/dist/{chunk-NSDZAUJK.js.map → chunk-LNKULR4V.js.map} +0 -0
- /package/dist/{chunk-5VHCSN44.js.map → chunk-MYEG5ZDT.js.map} +0 -0
- /package/dist/{chunk-M4IIK3B7.js.map → chunk-RURZ6QLN.js.map} +0 -0
- /package/dist/{chunk-TCEU6DCF.js.map → chunk-TLKHLGAB.js.map} +0 -0
- /package/dist/{chunk-GYJVLFK5.js.map → chunk-VZSTL5VG.js.map} +0 -0
- /package/dist/{chunk-3CAC3AAE.js.map → chunk-XPJKQ63S.js.map} +0 -0
- /package/dist/{chunk-22DWXIV3.js.map → chunk-YFZDIEVC.js.map} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import type { ChatRef } from '../../chat-ref.types';
|
|
4
|
-
import { BlockCard } from '../block-card';
|
|
5
|
-
import { ChatVideoEntityCard } from '../chat-video-entity-card';
|
|
6
|
-
import { renderChatInlineEntityCard } from '../dispatch';
|
|
7
|
-
|
|
8
|
-
describe('renderChatInlineEntityCard video refs', () => {
|
|
9
|
-
it.each([
|
|
10
|
-
{
|
|
11
|
-
id: 'MdFJNoJeqZQ',
|
|
12
|
-
url: 'https://www.youtube.com/watch?v=MdFJNoJeqZQ',
|
|
13
|
-
metadata: { youtubeUrl: 'MdFJNoJeqZQ' },
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'mux-9b6586b494',
|
|
17
|
-
url: 'https://stream.mux.com/playback-id.m3u8',
|
|
18
|
-
metadata: { videoUrl: 'https://stream.mux.com/playback-id.m3u8' },
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: 'mp4-1b2047dc1b',
|
|
22
|
-
url: 'https://cdn.example.test/product-overview.mp4',
|
|
23
|
-
metadata: { videoUrl: 'https://cdn.example.test/product-overview.mp4' },
|
|
24
|
-
},
|
|
25
|
-
])('passes playable metadata for $id to the video card', ({ id, url, metadata }) => {
|
|
26
|
-
const ref: ChatRef = { type: 'video', id, title: 'Video', url, metadata };
|
|
27
|
-
|
|
28
|
-
const result = renderChatInlineEntityCard(ref);
|
|
29
|
-
|
|
30
|
-
expect(React.isValidElement(result)).toBe(true);
|
|
31
|
-
const block = result as React.ReactElement<React.ComponentProps<typeof BlockCard>>;
|
|
32
|
-
expect(block.type).toBe(BlockCard);
|
|
33
|
-
const video = block.props.children as React.ReactElement<React.ComponentProps<typeof ChatVideoEntityCard>>;
|
|
34
|
-
expect(video.type).toBe(ChatVideoEntityCard);
|
|
35
|
-
expect(video.props.chatRef.metadata).toMatchObject(metadata);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('lets a validated top-level URL override conflicting route metadata', () => {
|
|
39
|
-
const ref: ChatRef = {
|
|
40
|
-
type: 'video',
|
|
41
|
-
id: 'mux-9b6586b494',
|
|
42
|
-
title: 'Video',
|
|
43
|
-
url: 'https://stream.mux.com/trusted-playback.m3u8',
|
|
44
|
-
metadata: {
|
|
45
|
-
videoUrl: 'https://cdn.example.test/untrusted.mp4',
|
|
46
|
-
youtubeUrl: 'untrustedId',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const result = renderChatInlineEntityCard(ref);
|
|
51
|
-
const block = result as React.ReactElement<React.ComponentProps<typeof BlockCard>>;
|
|
52
|
-
const video = block.props.children as React.ReactElement<React.ComponentProps<typeof ChatVideoEntityCard>>;
|
|
53
|
-
|
|
54
|
-
expect(video.props.chatRef.metadata).toEqual({
|
|
55
|
-
videoUrl: 'https://stream.mux.com/trusted-playback.m3u8',
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('keeps a direct-video URL direct when its query mentions a YouTube URL', () => {
|
|
60
|
-
const directUrl = 'https://cdn.example.test/product-overview.mp4?source=youtube.com/watch?v=MdFJNoJeqZQ';
|
|
61
|
-
const ref: ChatRef = {
|
|
62
|
-
type: 'video',
|
|
63
|
-
id: 'mp4-direct',
|
|
64
|
-
title: 'Product overview',
|
|
65
|
-
url: directUrl,
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const result = renderChatInlineEntityCard(ref);
|
|
69
|
-
const block = result as React.ReactElement<React.ComponentProps<typeof BlockCard>>;
|
|
70
|
-
const video = block.props.children as React.ReactElement<React.ComponentProps<typeof ChatVideoEntityCard>>;
|
|
71
|
-
|
|
72
|
-
expect(video.props.chatRef.metadata).toEqual({ videoUrl: directUrl });
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import type { SlashCommandSummary } from '../../types/component.types';
|
|
3
|
-
|
|
4
|
-
const { embedAuthedFetchMock } = vi.hoisted(() => ({
|
|
5
|
-
embedAuthedFetchMock: vi.fn(),
|
|
6
|
-
}));
|
|
7
|
-
|
|
8
|
-
vi.mock('../../../../utils/embed-authed-fetch', () => ({
|
|
9
|
-
embedAuthedFetch: embedAuthedFetchMock,
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
import { fetchSlashCommands } from '../use-slash-commands';
|
|
13
|
-
|
|
14
|
-
const command = (id: string): SlashCommandSummary => ({
|
|
15
|
-
id,
|
|
16
|
-
description: `${id} description`,
|
|
17
|
-
actions: [{ id: 'browse', label: 'Recent' }],
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const commandsUrl = 'https://hub.example/api/docs/commands';
|
|
21
|
-
|
|
22
|
-
describe('fetchSlashCommands', () => {
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
embedAuthedFetchMock.mockReset();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('fetches the full registry and filters normalized prefixes locally', async () => {
|
|
28
|
-
embedAuthedFetchMock.mockResolvedValue({
|
|
29
|
-
ok: true,
|
|
30
|
-
json: () => Promise.resolve({ commands: [command('roadmap'), command('webinars')] }),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const commands = await fetchSlashCommands(' W ', undefined, commandsUrl);
|
|
34
|
-
|
|
35
|
-
expect(commands.map(({ id }) => id)).toEqual(['webinars']);
|
|
36
|
-
expect(embedAuthedFetchMock).toHaveBeenCalledTimes(1);
|
|
37
|
-
const [requestedUrl] = embedAuthedFetchMock.mock.calls[0] as [string];
|
|
38
|
-
expect(new URL(requestedUrl).search).toBe('');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('returns every command for an empty prefix', async () => {
|
|
42
|
-
const registry = [command('roadmap'), command('webinars')];
|
|
43
|
-
embedAuthedFetchMock.mockResolvedValue({
|
|
44
|
-
ok: true,
|
|
45
|
-
json: () => Promise.resolve({ commands: registry }),
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
await expect(fetchSlashCommands('', undefined, commandsUrl)).resolves.toEqual(registry);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('caps non-empty prefix matches at ten commands', async () => {
|
|
52
|
-
embedAuthedFetchMock.mockResolvedValue({
|
|
53
|
-
ok: true,
|
|
54
|
-
json: () =>
|
|
55
|
-
Promise.resolve({
|
|
56
|
-
commands: Array.from({ length: 12 }, (_, index) => command(`webinar-${index}`)),
|
|
57
|
-
}),
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const commands = await fetchSlashCommands('webinar', undefined, commandsUrl);
|
|
61
|
-
|
|
62
|
-
expect(commands).toHaveLength(10);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ChatRef } from '../chat-ref.types';
|
|
2
|
-
import type { ChatSource } from '../types/message.types';
|
|
3
|
-
|
|
4
|
-
export function mergeChatSources(current: ChatSource[] | undefined, incoming: ChatSource[]): ChatSource[] {
|
|
5
|
-
const sourcesByIndex = new Map((current ?? []).map(source => [source.index, source]));
|
|
6
|
-
incoming.forEach(source => {
|
|
7
|
-
if (!sourcesByIndex.has(source.index)) sourcesByIndex.set(source.index, source);
|
|
8
|
-
});
|
|
9
|
-
return Array.from(sourcesByIndex.values());
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function mergeChatRefs(current: ChatRef[] | undefined, incoming: ChatRef[]): ChatRef[] {
|
|
13
|
-
const refsByIdentity = new Map((current ?? []).map(ref => [`${ref.type}:${ref.id}`, ref]));
|
|
14
|
-
incoming.forEach(ref => {
|
|
15
|
-
const identity = `${ref.type}:${ref.id}`;
|
|
16
|
-
if (!refsByIdentity.has(identity)) refsByIdentity.set(identity, ref);
|
|
17
|
-
});
|
|
18
|
-
return Array.from(refsByIdentity.values());
|
|
19
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|