@memori.ai/memori-react 8.2.0 → 8.4.0-rc.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.
Files changed (146) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/Chat/Chat.js +8 -1
  3. package/dist/components/Chat/Chat.js.map +1 -1
  4. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
  5. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
  6. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +166 -0
  7. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
  8. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
  9. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
  10. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +115 -0
  11. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
  12. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
  13. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
  14. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +104 -0
  15. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
  16. package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
  17. package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
  18. package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +50 -0
  19. package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
  20. package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
  21. package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
  22. package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +78 -0
  23. package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
  24. package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
  25. package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +22 -0
  26. package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
  27. package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
  28. package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +288 -0
  29. package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
  30. package/dist/components/MemoriArtifactSystem/index.d.ts +9 -0
  31. package/dist/components/MemoriArtifactSystem/index.js +28 -0
  32. package/dist/components/MemoriArtifactSystem/index.js.map +1 -0
  33. package/dist/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
  34. package/dist/components/MemoriArtifactSystem/types/artifact.types.js +31 -0
  35. package/dist/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
  36. package/dist/components/icons/Print.d.ts +6 -0
  37. package/dist/components/icons/Print.js +6 -0
  38. package/dist/components/icons/Print.js.map +1 -0
  39. package/dist/components/layouts/Chat.js +29 -1
  40. package/dist/components/layouts/Chat.js.map +1 -1
  41. package/dist/components/layouts/FullPage.js +33 -1
  42. package/dist/components/layouts/FullPage.js.map +1 -1
  43. package/dist/components/layouts/ZoomedFullBody.js +29 -2
  44. package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
  45. package/dist/components/layouts/chat.css +335 -13
  46. package/dist/components/layouts/zoomed-full-body.css +1 -3
  47. package/dist/helpers/message.js +1 -0
  48. package/dist/helpers/message.js.map +1 -1
  49. package/dist/helpers/stt/useSTT.js +76 -9
  50. package/dist/helpers/stt/useSTT.js.map +1 -1
  51. package/dist/index.js +58 -15
  52. package/dist/index.js.map +1 -1
  53. package/dist/styles.css +5 -0
  54. package/esm/components/Chat/Chat.js +8 -1
  55. package/esm/components/Chat/Chat.js.map +1 -1
  56. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
  57. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
  58. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +163 -0
  59. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
  60. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
  61. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
  62. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +112 -0
  63. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
  64. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
  65. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
  66. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +101 -0
  67. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
  68. package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
  69. package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
  70. package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +47 -0
  71. package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
  72. package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
  73. package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
  74. package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +75 -0
  75. package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
  76. package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
  77. package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +17 -0
  78. package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
  79. package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
  80. package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +281 -0
  81. package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
  82. package/esm/components/MemoriArtifactSystem/index.d.ts +9 -0
  83. package/esm/components/MemoriArtifactSystem/index.js +9 -0
  84. package/esm/components/MemoriArtifactSystem/index.js.map +1 -0
  85. package/esm/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
  86. package/esm/components/MemoriArtifactSystem/types/artifact.types.js +28 -0
  87. package/esm/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
  88. package/esm/components/icons/Print.d.ts +6 -0
  89. package/esm/components/icons/Print.js +4 -0
  90. package/esm/components/icons/Print.js.map +1 -0
  91. package/esm/components/layouts/Chat.js +29 -1
  92. package/esm/components/layouts/Chat.js.map +1 -1
  93. package/esm/components/layouts/FullPage.js +33 -1
  94. package/esm/components/layouts/FullPage.js.map +1 -1
  95. package/esm/components/layouts/ZoomedFullBody.js +30 -3
  96. package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
  97. package/esm/components/layouts/chat.css +335 -13
  98. package/esm/components/layouts/zoomed-full-body.css +1 -3
  99. package/esm/helpers/message.js +1 -0
  100. package/esm/helpers/message.js.map +1 -1
  101. package/esm/helpers/stt/useSTT.js +76 -9
  102. package/esm/helpers/stt/useSTT.js.map +1 -1
  103. package/esm/index.js +58 -15
  104. package/esm/index.js.map +1 -1
  105. package/esm/styles.css +5 -0
  106. package/package.json +1 -1
  107. package/src/components/Avatar/Avatar.test.tsx +13 -0
  108. package/src/components/Chat/Chat.stories.tsx +33 -2
  109. package/src/components/Chat/Chat.test.tsx +340 -213
  110. package/src/components/Chat/Chat.tsx +27 -4
  111. package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
  112. package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +278 -0
  113. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
  114. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +308 -0
  115. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
  116. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +282 -0
  117. package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
  118. package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.tsx +178 -0
  119. package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
  120. package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +190 -0
  121. package/src/components/MemoriArtifactSystem/context/ArtifactSystemContext.tsx +57 -0
  122. package/src/components/MemoriArtifactSystem/hooks/useArtifactSystem.ts +419 -0
  123. package/src/components/MemoriArtifactSystem/index.ts +45 -0
  124. package/src/components/MemoriArtifactSystem/types/artifact.types.ts +180 -0
  125. package/src/components/icons/Print.tsx +34 -0
  126. package/src/components/layouts/Chat.test.tsx +13 -0
  127. package/src/components/layouts/Chat.tsx +80 -25
  128. package/src/components/layouts/FullPage.test.tsx +40 -11
  129. package/src/components/layouts/FullPage.tsx +92 -24
  130. package/src/components/layouts/HiddenChat.test.tsx +13 -0
  131. package/src/components/layouts/Totem.test.tsx +13 -0
  132. package/src/components/layouts/WebsiteAssistant.test.tsx +13 -0
  133. package/src/components/layouts/ZoomedFullBody.test.tsx +13 -0
  134. package/src/components/layouts/ZoomedFullBody.tsx +78 -14
  135. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +252 -248
  136. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +504 -496
  137. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +252 -248
  138. package/src/components/layouts/chat.css +335 -13
  139. package/src/components/layouts/layouts.stories.tsx +13 -2
  140. package/src/components/layouts/zoomed-full-body.css +1 -3
  141. package/src/helpers/message.ts +1 -0
  142. package/src/helpers/stt/useSTT.ts +101 -16
  143. package/src/index.stories.tsx +26 -22
  144. package/src/index.tsx +46 -0
  145. package/src/mocks/data.ts +258 -0
  146. package/src/styles.css +5 -0
@@ -0,0 +1,281 @@
1
+ import { useState, useCallback, useRef, useEffect } from 'react';
2
+ import { DEFAULT_ARTIFACT_CONFIG, SUPPORTED_MIME_TYPES } from '../types/artifact.types';
3
+ export const useArtifactSystem = (config = {}) => {
4
+ console.log('Initializing artifact system with config:', config);
5
+ const mergedConfig = { ...DEFAULT_ARTIFACT_CONFIG, ...config };
6
+ const [state, setState] = useState({
7
+ history: [],
8
+ currentArtifact: null,
9
+ isDrawerOpen: false,
10
+ isFullscreen: false,
11
+ processedArtifacts: new Set(['artifact-1', 'artifact-2']),
12
+ artifactCounter: 2,
13
+ });
14
+ const processedArtifactsRef = useRef(new Set());
15
+ useEffect(() => {
16
+ console.log('Updating processed artifacts ref:', state.processedArtifacts);
17
+ processedArtifactsRef.current = state.processedArtifacts;
18
+ }, [state.processedArtifacts]);
19
+ const addArtifact = useCallback((artifact) => {
20
+ console.log('Adding artifact:', artifact);
21
+ setState(prevState => {
22
+ const existingIndex = prevState.history.findIndex(item => item.id === artifact.id);
23
+ let newHistory;
24
+ if (existingIndex >= 0) {
25
+ console.log('Updating existing artifact at index:', existingIndex);
26
+ newHistory = [...prevState.history];
27
+ newHistory[existingIndex] = { ...artifact, isActive: false };
28
+ }
29
+ else {
30
+ console.log('Adding new artifact to history');
31
+ newHistory = [
32
+ { ...artifact, isActive: false },
33
+ ...prevState.history.slice(0, (mergedConfig.maxHistoryItems || 50) - 1)
34
+ ];
35
+ }
36
+ return {
37
+ ...prevState,
38
+ history: newHistory,
39
+ artifactCounter: prevState.artifactCounter + 1,
40
+ };
41
+ });
42
+ }, [mergedConfig.maxHistoryItems]);
43
+ const selectArtifact = useCallback((artifact) => {
44
+ console.log('Selecting artifact:', artifact);
45
+ setState(prevState => {
46
+ const newHistory = prevState.history.map(item => ({
47
+ ...item,
48
+ isActive: item.id === artifact.id,
49
+ }));
50
+ return {
51
+ ...prevState,
52
+ currentArtifact: artifact,
53
+ isDrawerOpen: true,
54
+ history: newHistory,
55
+ };
56
+ });
57
+ }, []);
58
+ const closeDrawer = useCallback(() => {
59
+ console.log('Closing artifact drawer');
60
+ setState(prevState => ({
61
+ ...prevState,
62
+ isDrawerOpen: false,
63
+ isFullscreen: false,
64
+ currentArtifact: null,
65
+ history: prevState.history.map(item => ({ ...item, isActive: false })),
66
+ }));
67
+ }, []);
68
+ const toggleFullscreen = useCallback(() => {
69
+ console.log('Toggling fullscreen mode');
70
+ setState(prevState => ({
71
+ ...prevState,
72
+ isFullscreen: !prevState.isFullscreen,
73
+ }));
74
+ }, []);
75
+ const clearHistory = useCallback(() => {
76
+ console.log('Clearing artifact history');
77
+ setState(prevState => ({
78
+ ...prevState,
79
+ history: [],
80
+ currentArtifact: null,
81
+ isDrawerOpen: false,
82
+ isFullscreen: false,
83
+ processedArtifacts: new Set(),
84
+ artifactCounter: 0,
85
+ }));
86
+ processedArtifactsRef.current.clear();
87
+ }, []);
88
+ const removeArtifact = useCallback((id) => {
89
+ console.log('Removing artifact:', id);
90
+ setState(prevState => {
91
+ var _a;
92
+ const newHistory = prevState.history.filter(item => item.id !== id);
93
+ const isRemovingCurrent = ((_a = prevState.currentArtifact) === null || _a === void 0 ? void 0 : _a.id) === id;
94
+ return {
95
+ ...prevState,
96
+ history: newHistory,
97
+ currentArtifact: isRemovingCurrent ? null : prevState.currentArtifact,
98
+ isDrawerOpen: isRemovingCurrent ? false : prevState.isDrawerOpen,
99
+ };
100
+ });
101
+ }, []);
102
+ const actions = {
103
+ addArtifact,
104
+ selectArtifact,
105
+ closeDrawer,
106
+ toggleFullscreen,
107
+ clearHistory,
108
+ removeArtifact,
109
+ };
110
+ return {
111
+ state,
112
+ actions,
113
+ config: mergedConfig,
114
+ };
115
+ };
116
+ export const useArtifactCreator = () => {
117
+ const generateId = useCallback((content, mimeType) => {
118
+ console.log('Generating ID for content type:', mimeType);
119
+ const timestamp = Date.now();
120
+ const hash = content.substring(0, 100).split('').reduce((a, b) => {
121
+ a = ((a << 5) - a) + b.charCodeAt(0);
122
+ return a & a;
123
+ }, 0);
124
+ return `artifact-${mimeType}-${Math.abs(hash)}-${timestamp}`;
125
+ }, []);
126
+ const createArtifact = useCallback((content, mimeType, customTitle, messageID) => {
127
+ console.log('Creating artifact:', { mimeType, customTitle, messageID });
128
+ const typeInfo = SUPPORTED_MIME_TYPES[mimeType] || {
129
+ name: mimeType.toUpperCase(),
130
+ icon: '📄',
131
+ hasPreview: false,
132
+ language: 'text',
133
+ mimeType: 'text/plain',
134
+ };
135
+ const title = customTitle || `${typeInfo.icon} ${typeInfo.name} Artifact`;
136
+ const id = generateId(content, mimeType);
137
+ return {
138
+ id,
139
+ content,
140
+ mimeType: mimeType,
141
+ typeInfo,
142
+ title,
143
+ customTitle,
144
+ messageID: messageID || '',
145
+ timestamp: new Date(),
146
+ size: content.length,
147
+ };
148
+ }, [generateId]);
149
+ return { createArtifact };
150
+ };
151
+ export const useArtifactProcessor = () => {
152
+ const processedArtifacts = useRef(new Set());
153
+ const generateContentHash = useCallback((content) => {
154
+ console.log('Generating content hash');
155
+ let hash = 0;
156
+ const str = content.substring(0, 500);
157
+ for (let i = 0; i < str.length; i++) {
158
+ const char = str.charCodeAt(i);
159
+ hash = ((hash << 5) - hash) + char;
160
+ hash = hash & hash;
161
+ }
162
+ return hash.toString();
163
+ }, []);
164
+ const removeThinkTags = useCallback((text) => {
165
+ console.log('Removing think tags from text');
166
+ return text.replace(/<think>[\s\S]*?<\/think>/gi, '');
167
+ }, []);
168
+ const isValidArtifact = useCallback((content, mimeType) => {
169
+ console.log('Validating artifact:', { mimeType, contentLength: content.length });
170
+ if (content.length < 50) {
171
+ console.log('Artifact too small');
172
+ return false;
173
+ }
174
+ if (mimeType === 'html') {
175
+ if (!content.includes('<!DOCTYPE') && !content.includes('<html')) {
176
+ console.log('Invalid HTML: missing DOCTYPE or html tag');
177
+ return false;
178
+ }
179
+ if (content.includes('<!DOCTYPE') && !content.includes('</html>')) {
180
+ console.log('Invalid HTML: unclosed html tag');
181
+ return false;
182
+ }
183
+ }
184
+ if (mimeType === 'json') {
185
+ try {
186
+ JSON.parse(content);
187
+ }
188
+ catch (e) {
189
+ console.log('Invalid JSON:', e);
190
+ return false;
191
+ }
192
+ }
193
+ return true;
194
+ }, []);
195
+ const cleanArtifactContent = useCallback((content, mimeType) => {
196
+ console.log('Cleaning artifact content:', { mimeType });
197
+ if (!content)
198
+ return '';
199
+ content = content.replace(/<\/output>/gi, '');
200
+ if (mimeType === 'html') {
201
+ if (content.includes('<!DOCTYPE html') && !content.includes('</html>')) {
202
+ content += '\n</html>';
203
+ }
204
+ }
205
+ if (mimeType === 'json') {
206
+ try {
207
+ JSON.parse(content);
208
+ }
209
+ catch (e) {
210
+ console.log('Failed to parse JSON:', e);
211
+ return '';
212
+ }
213
+ }
214
+ return content.trim();
215
+ }, []);
216
+ const processArtifactContent = useCallback((emission, onArtifactFound) => {
217
+ console.log('Processing artifact content');
218
+ if (!emission || typeof emission !== 'string')
219
+ return false;
220
+ let processed = false;
221
+ const cleanedEmission = removeThinkTags(emission);
222
+ const outputRegex = /<output\s+class\s*=\s*["\']memori-artifact["\'][^>]*data-mimetype\s*=\s*["\']([^"']+)["\'][^>]*>([\s\S]*?)(?:<\/output>|$)/gi;
223
+ const foundArtifacts = [];
224
+ let match;
225
+ while ((match = outputRegex.exec(cleanedEmission)) !== null) {
226
+ console.log('Found artifact match:', { mimeType: match[1] });
227
+ const fullTag = match[0];
228
+ const mimeType = match[1];
229
+ let content = match[2].trim();
230
+ const titleMatch = fullTag.match(/data-title\s*=\s*["\']([^"']+)["\']/i);
231
+ const extractedTitle = titleMatch ? titleMatch[1] : undefined;
232
+ console.log('Extracted title:', extractedTitle);
233
+ content = cleanArtifactContent(content, mimeType);
234
+ if (!content || !isValidArtifact(content, mimeType)) {
235
+ console.log('Skipping invalid artifact');
236
+ continue;
237
+ }
238
+ foundArtifacts.push({
239
+ fullMatch: match[0],
240
+ mimeType,
241
+ content,
242
+ size: content.length,
243
+ extractedTitle,
244
+ });
245
+ }
246
+ foundArtifacts.sort((a, b) => b.size - a.size);
247
+ const uniqueByType = new Map();
248
+ for (const artifact of foundArtifacts) {
249
+ if (!uniqueByType.has(artifact.mimeType)) {
250
+ uniqueByType.set(artifact.mimeType, artifact);
251
+ }
252
+ }
253
+ for (const artifact of uniqueByType.values()) {
254
+ const hash = generateContentHash(artifact.fullMatch);
255
+ if (!processedArtifacts.current.has(hash)) {
256
+ console.log('Processing new artifact:', { mimeType: artifact.mimeType, hash });
257
+ processedArtifacts.current.add(hash);
258
+ onArtifactFound(artifact.content, artifact.mimeType, artifact.extractedTitle);
259
+ processed = true;
260
+ }
261
+ }
262
+ return processed;
263
+ }, [removeThinkTags, cleanArtifactContent, isValidArtifact, generateContentHash]);
264
+ return {
265
+ processArtifactContent,
266
+ processedArtifacts: processedArtifacts.current,
267
+ };
268
+ };
269
+ export const useArtifactDetector = () => {
270
+ const hasArtifacts = useCallback((messageText) => {
271
+ console.log('Checking for artifacts in message');
272
+ if (!messageText || typeof messageText !== 'string') {
273
+ return false;
274
+ }
275
+ const cleanedText = messageText.replace(/<think>[\s\S]*?<\/think>/gi, '');
276
+ const outputRegex = /<output\s+class\s*=\s*["\']memori-artifact["\'][^>]*data-mimetype\s*=\s*["\']([^"']+)["\'][^>]*>([\s\S]*?)(?:<\/output>|$)/gi;
277
+ return outputRegex.test(cleanedText);
278
+ }, []);
279
+ return { hasArtifacts };
280
+ };
281
+ //# sourceMappingURL=useArtifactSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArtifactSystem.js","sourceRoot":"","sources":["../../../../src/components/MemoriArtifactSystem/hooks/useArtifactSystem.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAOL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAwC,EAAE,EAAsB,EAAE;IAClG,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,MAAM,CAAC,CAAC;IAEjE,MAAM,YAAY,GAAG,EAAE,GAAG,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAAC;IAE/D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAsB;QACtD,OAAO,EAAE,EACR;QACD,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,KAAK;QACnB,kBAAkB,EAAE,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QACzD,eAAe,EAAE,CAAC;KACnB,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAG7D,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC3E,qBAAqB,CAAC,OAAO,GAAG,KAAK,CAAC,kBAAkB,CAAC;IAC3D,CAAC,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAK/B,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,QAAsB,EAAE,EAAE;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kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBACzC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/E,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrC,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;gBAC9E,SAAS,GAAG,IAAI,CAAC;aAClB;SACF;QAGD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAElF,OAAO;QACL,sBAAsB;QACtB,kBAAkB,EAAE,kBAAkB,CAAC,OAAO;KAC/C,CAAC;AACJ,CAAC,CAAC;AAKF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,WAAmB,EAAW,EAAE;QAChE,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnD,OAAO,KAAK,CAAC;SACd;QAGD,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;QAG1E,MAAM,WAAW,GAAG,8HAA8H,CAAC;QAEnJ,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { default as ArtifactDrawer } from './components/ArtifactDrawer/ArtifactDrawer';
2
+ export { default as ArtifactActions } from './components/ArtifactActions/ArtifactActions';
3
+ export { default as ArtifactPreview } from './components/ArtifactPreview/ArtifactPreview';
4
+ export { default as ArtifactHistory } from './components/ArtifactHistory/ArtifactHistory';
5
+ export { default as ArtifactHandler } from './components/ArtifactHandler/ArtifactHandler';
6
+ export { useArtifactSystem, useArtifactCreator, useArtifactProcessor } from './hooks/useArtifactSystem';
7
+ export { ArtifactSystemProvider, useArtifactSystemContext, ArtifactSystemContext } from './context/ArtifactSystemContext';
8
+ export type { ArtifactMimeType, ArtifactTypeInfo, ArtifactData, ArtifactHistoryEntry, ArtifactActionsProps, ArtifactPreviewProps, ArtifactHistoryProps, ArtifactHandlerProps, ArtifactSystemConfig, ArtifactSystemState, ArtifactSystemActions, ArtifactSystemHook, ArtifactEvent, MemoriNewDialogStateEvent, ArtifactTab, ArtifactValidationResult, ArtifactProcessingOptions, } from './types/artifact.types';
9
+ export { DEFAULT_ARTIFACT_CONFIG, SUPPORTED_MIME_TYPES } from './types/artifact.types';
@@ -0,0 +1,9 @@
1
+ export { default as ArtifactDrawer } from './components/ArtifactDrawer/ArtifactDrawer';
2
+ export { default as ArtifactActions } from './components/ArtifactActions/ArtifactActions';
3
+ export { default as ArtifactPreview } from './components/ArtifactPreview/ArtifactPreview';
4
+ export { default as ArtifactHistory } from './components/ArtifactHistory/ArtifactHistory';
5
+ export { default as ArtifactHandler } from './components/ArtifactHandler/ArtifactHandler';
6
+ export { useArtifactSystem, useArtifactCreator, useArtifactProcessor } from './hooks/useArtifactSystem';
7
+ export { ArtifactSystemProvider, useArtifactSystemContext, ArtifactSystemContext } from './context/ArtifactSystemContext';
8
+ export { DEFAULT_ARTIFACT_CONFIG, SUPPORTED_MIME_TYPES } from './types/artifact.types';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MemoriArtifactSystem/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAG1F,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AAwBzC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { Message } from "@memori.ai/memori-api-client/dist/types";
2
+ export type ArtifactMimeType = 'html' | 'json' | 'markdown' | 'css' | 'javascript' | 'typescript' | 'svg' | 'xml' | 'text' | 'python' | 'java' | 'cpp' | 'csharp' | 'php' | 'ruby' | 'go' | 'rust' | 'yaml' | 'sql';
3
+ export interface ArtifactTypeInfo {
4
+ name: string;
5
+ icon: string;
6
+ hasPreview: boolean;
7
+ language: string;
8
+ mimeType: string;
9
+ }
10
+ export interface ArtifactData {
11
+ id: string;
12
+ content: string;
13
+ mimeType: ArtifactMimeType;
14
+ typeInfo: ArtifactTypeInfo;
15
+ title: string;
16
+ customTitle?: string;
17
+ messageID: string;
18
+ timestamp: Date;
19
+ size: number;
20
+ }
21
+ export interface ArtifactHistoryEntry extends ArtifactData {
22
+ isActive?: boolean;
23
+ }
24
+ export interface ArtifactActionsProps {
25
+ artifact: ArtifactData;
26
+ onCopy: () => void;
27
+ onDownload: () => void;
28
+ onPrint: () => void;
29
+ onOpenExternal: () => void;
30
+ onToggleFullscreen: () => void;
31
+ isFullscreen: boolean;
32
+ loading?: boolean;
33
+ }
34
+ export interface ArtifactPreviewProps {
35
+ artifact: ArtifactData;
36
+ activeTab: 'code' | 'preview';
37
+ onTabChange: (tab: 'code' | 'preview') => void;
38
+ showLineNumbers?: boolean;
39
+ enableSyntaxHighlighting?: boolean;
40
+ }
41
+ export interface ArtifactHistoryProps {
42
+ history: ArtifactHistoryEntry[];
43
+ onSelectArtifact: (artifact: ArtifactData) => void;
44
+ onClearHistory?: () => void;
45
+ maxItems?: number;
46
+ }
47
+ export interface ArtifactHandlerProps {
48
+ artifact?: ArtifactData | null;
49
+ artifacts?: ArtifactHistoryEntry[];
50
+ content?: string;
51
+ mimeType?: ArtifactMimeType;
52
+ config: ArtifactSystemConfig;
53
+ actions: ArtifactSystemActions;
54
+ message: Message;
55
+ customTitle?: string;
56
+ onArtifactCreated?: (artifact: ArtifactData) => void;
57
+ }
58
+ export interface ArtifactSystemConfig {
59
+ maxHistoryItems?: number;
60
+ enableSyntaxHighlighting?: boolean;
61
+ showLineNumbers?: boolean;
62
+ autoOpenArtifacts?: boolean;
63
+ supportedMimeTypes?: Partial<Record<ArtifactMimeType, ArtifactTypeInfo>>;
64
+ }
65
+ export interface ArtifactSystemState {
66
+ history: ArtifactHistoryEntry[];
67
+ currentArtifact: ArtifactData | null;
68
+ isDrawerOpen: boolean;
69
+ isFullscreen: boolean;
70
+ processedArtifacts: Set<string>;
71
+ artifactCounter: number;
72
+ }
73
+ export interface ArtifactSystemActions {
74
+ addArtifact: (artifact: ArtifactData) => void;
75
+ selectArtifact: (artifact: ArtifactData) => void;
76
+ closeDrawer: () => void;
77
+ toggleFullscreen: () => void;
78
+ clearHistory: () => void;
79
+ removeArtifact: (id: string) => void;
80
+ }
81
+ export interface ArtifactSystemHook {
82
+ state: ArtifactSystemState;
83
+ actions: ArtifactSystemActions;
84
+ config: ArtifactSystemConfig;
85
+ }
86
+ export interface ArtifactEvent {
87
+ type: 'artifact-created' | 'artifact-selected' | 'artifact-closed' | 'history-cleared';
88
+ payload: any;
89
+ }
90
+ export interface MemoriNewDialogStateEvent extends CustomEvent {
91
+ detail: {
92
+ emission?: string;
93
+ };
94
+ }
95
+ export type ArtifactTab = 'code' | 'preview';
96
+ export interface ArtifactValidationResult {
97
+ isValid: boolean;
98
+ errors: string[];
99
+ warnings: string[];
100
+ }
101
+ export interface ArtifactProcessingOptions {
102
+ removeThinkTags?: boolean;
103
+ validateContent?: boolean;
104
+ deduplicate?: boolean;
105
+ minContentLength?: number;
106
+ }
107
+ export declare const DEFAULT_ARTIFACT_CONFIG: ArtifactSystemConfig;
108
+ export declare const SUPPORTED_MIME_TYPES: Record<ArtifactMimeType, ArtifactTypeInfo>;
@@ -0,0 +1,28 @@
1
+ export const DEFAULT_ARTIFACT_CONFIG = {
2
+ maxHistoryItems: 50,
3
+ enableSyntaxHighlighting: true,
4
+ showLineNumbers: false,
5
+ autoOpenArtifacts: true,
6
+ };
7
+ export const SUPPORTED_MIME_TYPES = {
8
+ html: { name: 'HTML', icon: '🌐', hasPreview: true, language: 'html', mimeType: 'application/xml' },
9
+ json: { name: 'JSON', icon: '📊', hasPreview: false, language: 'json', mimeType: 'application/json' },
10
+ markdown: { name: 'Markdown', icon: '📝', hasPreview: true, language: 'markdown', mimeType: 'text/markdown' },
11
+ css: { name: 'CSS', icon: '🎨', hasPreview: true, language: 'css', mimeType: 'text/css' },
12
+ javascript: { name: 'JavaScript', icon: '⚡', hasPreview: false, language: 'javascript', mimeType: 'text/javascript' },
13
+ typescript: { name: 'TypeScript', icon: '🔷', hasPreview: false, language: 'typescript', mimeType: 'text/typescript' },
14
+ svg: { name: 'SVG', icon: '🖼️', hasPreview: true, language: 'xml', mimeType: 'image/svg+xml' },
15
+ xml: { name: 'XML', icon: '📋', hasPreview: false, language: 'xml', mimeType: 'text/xml' },
16
+ text: { name: 'Text', icon: '📄', hasPreview: false, language: 'text', mimeType: 'text/plain' },
17
+ python: { name: 'Python', icon: '🐍', hasPreview: false, language: 'python', mimeType: 'text/x-python' },
18
+ java: { name: 'Java', icon: '☕', hasPreview: false, language: 'java', mimeType: 'text/x-java' },
19
+ cpp: { name: 'C++', icon: '⚙️', hasPreview: false, language: 'cpp', mimeType: 'text/x-c++' },
20
+ csharp: { name: 'C#', icon: '🔷', hasPreview: false, language: 'csharp', mimeType: 'text/x-csharp' },
21
+ php: { name: 'PHP', icon: '🐘', hasPreview: false, language: 'php', mimeType: 'text/x-php' },
22
+ ruby: { name: 'Ruby', icon: '💎', hasPreview: false, language: 'ruby', mimeType: 'text/x-ruby' },
23
+ go: { name: 'Go', icon: '🐹', hasPreview: false, language: 'go', mimeType: 'text/x-go' },
24
+ rust: { name: 'Rust', icon: '🦀', hasPreview: false, language: 'rust', mimeType: 'text/x-rust' },
25
+ yaml: { name: 'YAML', icon: '📝', hasPreview: false, language: 'yaml', mimeType: 'text/yaml' },
26
+ sql: { name: 'SQL', icon: '🗄️', hasPreview: false, language: 'sql', mimeType: 'text/x-sql' },
27
+ };
28
+ //# sourceMappingURL=artifact.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.types.js","sourceRoot":"","sources":["../../../../src/components/MemoriArtifactSystem/types/artifact.types.ts"],"names":[],"mappings":"AAwJA,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,eAAe,EAAE,EAAE;IACnB,wBAAwB,EAAE,IAAI;IAC9B,eAAe,EAAE,KAAK;IACtB,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAA+C;IAC9E,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE;IACnG,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE;IACrG,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EA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CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare const PrintIcon: React.FC<{
3
+ className?: string;
4
+ title?: string;
5
+ }>;
6
+ export default PrintIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const PrintIcon = ({ className, title }) => (_jsxs("svg", { ...(!title ? { 'aria-hidden': 'true' } : {}), "aria-label": title, className: className, viewBox: "0 -2 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("title", { children: title }), _jsx("desc", { children: "Created with Sketch Beta." }), _jsx("defs", {}), _jsx("g", { id: "Page-1", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd", children: _jsx("g", { id: "Icon-Set", transform: "translate(-100.000000, -205.000000)", fill: "#000000", children: _jsx("path", { d: "M130,226 C130,227.104 129.104,228 128,228 L125.858,228 C125.413,226.278 123.862,225 122,225 L110,225 C108.138,225 106.587,226.278 106.142,228 L104,228 C102.896,228 102,227.104 102,226 L102,224 C102,222.896 102.896,222 104,222 L128,222 C129.104,222 130,222.896 130,224 L130,226 L130,226 Z M122,231 L110,231 C108.896,231 108,230.104 108,229 C108,227.896 108.896,227 110,227 L122,227 C123.104,227 124,227.896 124,229 C124,230.104 123.104,231 122,231 L122,231 Z M108,209 C108,207.896 108.896,207 110,207 L122,207 C123.104,207 124,207.896 124,209 L124,220 L108,220 L108,209 L108,209 Z M128,220 L126,220 L126,209 C126,206.791 124.209,205 122,205 L110,205 C107.791,205 106,206.791 106,209 L106,220 L104,220 C101.791,220 100,221.791 100,224 L100,226 C100,228.209 101.791,230 104,230 L106.142,230 C106.587,231.723 108.138,233 110,233 L122,233 C123.862,233 125.413,231.723 125.858,230 L128,230 C130.209,230 132,228.209 132,226 L132,224 C132,221.791 130.209,220 128,220 L128,220 Z", id: "print" }) }) })] }));
3
+ export default PrintIcon;
4
+ //# sourceMappingURL=Print.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Print.js","sourceRoot":"","sources":["../../../src/components/icons/Print.tsx"],"names":[],"mappings":";AACA,MAAM,SAAS,GAAqD,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5F,kBACM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,gBACjC,KAAK,EACjB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,YAAY,EACpB,OAAO,EAAC,KAAK,EACb,KAAK,EAAC,4BAA4B,aAElC,0BAAQ,KAAK,GAAS,EACtB,uDAAsC,EACtC,gBAAa,EACb,YACE,EAAE,EAAC,QAAQ,EACX,MAAM,EAAC,MAAM,kBACA,GAAG,EAChB,IAAI,EAAC,MAAM,eACD,SAAS,YAEnB,YACE,EAAE,EAAC,UAAU,EACb,SAAS,EAAC,qCAAqC,EAC/C,IAAI,EAAC,SAAS,YAEd,eACE,CAAC,EAAC,28BAA28B,EAC78B,EAAE,EAAC,OAAO,GACJ,GACN,GACF,IACA,CACP,CAAC;AACF,eAAe,SAAS,CAAC"}
@@ -1,5 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
2
3
  import Spin from '../ui/Spin';
3
- const ChatLayout = ({ Header, headerProps, Chat, chatProps, StartPanel, startPanelProps, integrationStyle, integrationBackground, sessionId, hasUserActivatedSpeak, loading = false, poweredBy, }) => (_jsxs(_Fragment, { children: [integrationStyle, integrationBackground, _jsxs(Spin, { spinning: loading, className: "memori-chat-layout", children: [poweredBy, _jsx("div", { className: "memori-chat-layout--header", children: Header && headerProps && _jsx(Header, { ...headerProps }) }), _jsx("div", { id: "extension" }), _jsx("div", { className: "memori-chat-layout--controls", children: sessionId && hasUserActivatedSpeak && Chat && chatProps ? (_jsx(Chat, { ...chatProps })) : startPanelProps ? (_jsx(StartPanel, { ...startPanelProps })) : null })] })] }));
4
+ import { ArtifactDrawer } from '../MemoriArtifactSystem';
5
+ import { useArtifactSystemContext } from '../MemoriArtifactSystem/context/ArtifactSystemContext';
6
+ const ChatLayout = ({ Header, headerProps, Chat, chatProps, StartPanel, startPanelProps, integrationStyle, integrationBackground, sessionId, hasUserActivatedSpeak, loading = false, poweredBy, }) => {
7
+ const { actions, state } = useArtifactSystemContext();
8
+ const [isMobile, setIsMobile] = useState(false);
9
+ useEffect(() => {
10
+ const handleResize = () => {
11
+ const newIsMobile = window.innerWidth < 769;
12
+ if (newIsMobile !== isMobile) {
13
+ setTimeout(() => {
14
+ setIsMobile(newIsMobile);
15
+ }, 300);
16
+ }
17
+ else {
18
+ setIsMobile(newIsMobile);
19
+ }
20
+ };
21
+ handleResize();
22
+ window.addEventListener('resize', handleResize);
23
+ return () => window.removeEventListener('resize', handleResize);
24
+ }, [isMobile]);
25
+ const hasArtifact = state.currentArtifact && !isMobile;
26
+ return (_jsxs(_Fragment, { children: [integrationStyle, integrationBackground, _jsxs(Spin, { spinning: loading, className: "memori-chat-layout", children: [poweredBy, _jsx("div", { className: "memori-chat-layout--header", children: Header && headerProps && _jsx(Header, { ...headerProps }) }), _jsx("div", { id: "extension" }), _jsxs("div", { className: `memori-chat-layout--main ${hasArtifact ? 'memori-chat-layout--main-with-artifact' : ''}`, children: [_jsx("div", { className: state.isFullscreen
27
+ ? `memori-chat-layout-controls-hide`
28
+ : `memori-chat-layout--controls ${hasArtifact
29
+ ? 'memori-chat-layout--controls-with-artifact'
30
+ : ''}`, children: sessionId && hasUserActivatedSpeak && Chat && chatProps ? (_jsx(Chat, { ...chatProps })) : startPanelProps ? (_jsx(StartPanel, { ...startPanelProps })) : null }), hasArtifact && (_jsx("div", { className: state.isFullscreen ? `memori-chat-layout-artifact-panel-full-screen` : `memori-chat-layout--artifact-panel memori-chat-layout--artifact-panel-enter`, children: _jsx(ArtifactDrawer, {}) }))] }), state.currentArtifact && isMobile && (_jsx("div", { className: "memori-chat-layout--artifact-drawer", children: _jsx(ArtifactDrawer, {}) }))] })] }));
31
+ };
4
32
  export default ChatLayout;
5
33
  //# sourceMappingURL=Chat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../../src/components/layouts/Chat.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,YAAY,CAAC;AAG9B,MAAM,UAAU,GAA0B,CAAC,EACzC,MAAM,EACN,WAAW,EACX,IAAI,EACJ,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,qBAAqB,EACrB,OAAO,GAAG,KAAK,EACf,SAAS,GACV,EAAE,EAAE,CAAC,CACJ,8BACG,gBAAgB,EAChB,qBAAqB,EAEtB,MAAC,IAAI,IAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAC,oBAAoB,aACpD,SAAS,EAEV,cAAK,SAAS,EAAC,4BAA4B,YACxC,MAAM,IAAI,WAAW,IAAI,KAAC,MAAM,OAAK,WAAW,GAAI,GACjD,EAEN,cAAK,EAAE,EAAC,WAAW,GAAG,EAEtB,cAAK,SAAS,EAAC,8BAA8B,YAC1C,SAAS,IAAI,qBAAqB,IAAI,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CACzD,KAAC,IAAI,OAAK,SAAS,GAAI,CACxB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CACpB,KAAC,UAAU,OAAK,eAAe,GAAI,CACpC,CAAC,CAAC,CAAC,IAAI,GACJ,IACD,IACN,CACJ,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../../src/components/layouts/Chat.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,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,OAAK,WAAW,GAAI,GACjD,EAEN,cAAK,EAAE,EAAC,WAAW,GAAG,EAEtB,eACE,SAAS,EAAE,4BACT,WAAW,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,EAC3D,EAAE,aAEF,cACE,SAAS,EACP,KAAK,CAAC,YAAY;oCAChB,CAAC,CAAC,kCAAkC;oCACpC,CAAC,CAAC,gCACE,WAAW;wCACT,CAAC,CAAC,4CAA4C;wCAC9C,CAAC,CAAC,EACN,EAAE,YAGP,SAAS,IAAI,qBAAqB,IAAI,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CACzD,KAAC,IAAI,OAAK,SAAS,GAAI,CACxB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CACpB,KAAC,UAAU,OAAK,eAAe,GAAI,CACpC,CAAC,CAAC,CAAC,IAAI,GACJ,EAEL,WAAW,IAAI,CACd,cAAK,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC,6EAA6E,YAClK,KAAC,cAAc,KAAG,GACd,CACP,IACG,EAGL,KAAK,CAAC,eAAe,IAAI,QAAQ,IAAI,CACpC,cAAK,SAAS,EAAC,qCAAqC,YAClD,KAAC,cAAc,KAAG,GACd,CACP,IACI,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,5 +1,37 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import Spin from '../ui/Spin';
3
- const FullPageLayout = ({ Header, headerProps, Avatar, avatarProps, Chat, chatProps, StartPanel, startPanelProps, integrationStyle, integrationBackground, sessionId, hasUserActivatedSpeak, loading = false, poweredBy, }) => (_jsxs(_Fragment, { children: [integrationStyle, integrationBackground, _jsxs(Spin, { spinning: loading, children: [Header && headerProps && _jsx(Header, { ...headerProps }), _jsxs("div", { className: "memori--grid", children: [_jsxs("div", { className: "memori--grid-column memori--grid-column-left", children: [Avatar && avatarProps && _jsx(Avatar, { chatProps: chatProps, ...avatarProps }), _jsx("div", { id: "extension" })] }), _jsx("div", { className: "memori--grid-column memori--grid-column-right", children: sessionId && hasUserActivatedSpeak && Chat && chatProps ? (_jsx(Chat, { ...chatProps })) : startPanelProps ? (_jsx(StartPanel, { ...startPanelProps })) : null }), poweredBy] })] })] }));
4
+ import { ArtifactDrawer, useArtifactSystemContext, } from '../MemoriArtifactSystem';
5
+ const FullPageLayout = ({ Header, headerProps, Avatar, avatarProps, Chat, chatProps, StartPanel, startPanelProps, integrationStyle, integrationBackground, sessionId, hasUserActivatedSpeak, loading = false, poweredBy, }) => {
6
+ const { state } = useArtifactSystemContext();
7
+ const [isMobile, setIsMobile] = useState(false);
8
+ const [isAnimating, setIsAnimating] = useState(false);
9
+ useEffect(() => {
10
+ const handleResize = () => {
11
+ const newIsMobile = window.innerWidth < 769;
12
+ if (newIsMobile !== isMobile) {
13
+ setIsAnimating(true);
14
+ setTimeout(() => {
15
+ setIsMobile(newIsMobile);
16
+ setIsAnimating(false);
17
+ }, 300);
18
+ }
19
+ else {
20
+ setIsMobile(newIsMobile);
21
+ }
22
+ };
23
+ handleResize();
24
+ window.addEventListener('resize', handleResize);
25
+ return () => window.removeEventListener('resize', handleResize);
26
+ }, [isMobile]);
27
+ const hasArtifact = state.currentArtifact && !isMobile;
28
+ return (_jsxs(_Fragment, { children: [integrationStyle, integrationBackground, _jsxs(Spin, { spinning: loading, children: [Header && headerProps && _jsx(Header, { ...headerProps }), _jsxs("div", { className: "memori--grid", children: [!hasArtifact && (_jsxs("div", { className: "memori--grid-column memori--grid-column-left", children: [Avatar && avatarProps && !hasArtifact && (_jsx(Avatar, { chatProps: chatProps, ...avatarProps })), _jsx("div", { id: "extension" })] })), _jsxs("div", { className: `memori-chat-layout--main ${hasArtifact ? 'memori-chat-layout--main-with-artifact' : ''}`, children: [_jsx("div", { className: state.isFullscreen
29
+ ? `memori-chat-layout-controls-hide`
30
+ : `memori-chat-layout--controls ${hasArtifact
31
+ ? 'memori-chat-layout--controls-with-artifact'
32
+ : ''}`, children: sessionId && hasUserActivatedSpeak && Chat && chatProps ? (_jsx(Chat, { ...chatProps })) : startPanelProps ? (_jsx(StartPanel, { ...startPanelProps })) : null }), hasArtifact && (_jsx("div", { className: state.isFullscreen
33
+ ? `memori-chat-layout-artifact-panel-full-screen`
34
+ : `memori-chat-layout--artifact-panel memori-chat-layout--artifact-panel-enter`, children: _jsx(ArtifactDrawer, {}) }))] }), state.currentArtifact && isMobile && (_jsx("div", { className: "memori-chat-layout--artifact-drawer", children: _jsx(ArtifactDrawer, {}) })), poweredBy] })] })] }));
35
+ };
4
36
  export default FullPageLayout;
5
37
  //# sourceMappingURL=FullPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FullPage.js","sourceRoot":"","sources":["../../../src/components/layouts/FullPage.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,YAAY,CAAC;AAG9B,MAAM,cAAc,GAA0B,CAAC,EAC7C,MAAM,EACN,WAAW,EACX,MAAM,EACN,WAAW,EACX,IAAI,EACJ,SAAS,EACT,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,qBAAqB,EACrB,OAAO,GAAG,KAAK,EACf,SAAS,GACV,EAAE,EAAE,CAAC,CACJ,8BACG,gBAAgB,EAChB,qBAAqB,EAEtB,MAAC,IAAI,IAAC,QAAQ,EAAE,OAAO,aACpB,MAAM,IAAI,WAAW,IAAI,KAAC,MAAM,OAAK,WAAW,GAAI,EAErD,eAAK,SAAS,EAAC,cAAc,aAC3B,eAAK,SAAS,EAAC,8CAA8C,aAC1D,MAAM,IAAI,WAAW,IAAI,KAAC,MAAM,IAAC,SAAS,EAAE,SAAS,KAAO,WAAW,GAAI,EAE5E,cAAK,EAAE,EAAC,WAAW,GAAG,IAClB,EACN,cAAK,SAAS,EAAC,+CAA+C,YAC3D,SAAS,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