@memori.ai/memori-react 8.4.1 → 8.5.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 +21 -0
- package/dist/components/LoginDrawer/LoginDrawer.d.ts +1 -2
- package/dist/components/LoginDrawer/LoginDrawer.js +2 -105
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -4
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +3 -3
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js +110 -8
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js +3 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js +42 -38
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +1 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/types.d.ts +2 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +428 -15
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +47 -8
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +150 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.d.ts +9 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.js +35 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +2 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +2 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +15 -26
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/context/ArtifactContext.js +1 -5
- package/dist/components/MemoriArtifactSystem/context/ArtifactContext.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/icons/Close.d.ts +2 -1
- package/dist/components/icons/Close.js +1 -1
- package/dist/components/icons/Close.js.map +1 -1
- package/dist/components/icons/MenuVertical.d.ts +7 -0
- package/dist/components/icons/MenuVertical.js +6 -0
- package/dist/components/icons/MenuVertical.js.map +1 -0
- package/dist/components/layouts/Chat.js +1 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +1 -1
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/ZoomedFullBody.js +1 -1
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/chat.css +73 -85
- package/dist/components/ui/Drawer.d.ts +1 -0
- package/dist/components/ui/Drawer.js +2 -2
- package/dist/components/ui/Drawer.js.map +1 -1
- package/dist/locales/de.json +37 -1
- package/dist/locales/en.json +37 -1
- package/dist/locales/es.json +37 -1
- package/dist/locales/fr.json +37 -1
- package/dist/locales/it.json +37 -1
- package/esm/components/LoginDrawer/LoginDrawer.d.ts +1 -2
- package/esm/components/LoginDrawer/LoginDrawer.js +3 -106
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -4
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +3 -3
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js +110 -8
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js +3 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js +42 -38
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +1 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/types.d.ts +2 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +428 -15
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +48 -9
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +150 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.d.ts +9 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.js +32 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +2 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +2 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +16 -27
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/context/ArtifactContext.js +1 -5
- package/esm/components/MemoriArtifactSystem/context/ArtifactContext.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/icons/Close.d.ts +2 -1
- package/esm/components/icons/Close.js +1 -1
- package/esm/components/icons/Close.js.map +1 -1
- package/esm/components/icons/MenuVertical.d.ts +7 -0
- package/esm/components/icons/MenuVertical.js +4 -0
- package/esm/components/icons/MenuVertical.js.map +1 -0
- package/esm/components/layouts/Chat.js +1 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +1 -1
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/ZoomedFullBody.js +1 -1
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/chat.css +73 -85
- package/esm/components/ui/Drawer.d.ts +1 -0
- package/esm/components/ui/Drawer.js +2 -2
- package/esm/components/ui/Drawer.js.map +1 -1
- package/esm/locales/de.json +37 -1
- package/esm/locales/en.json +37 -1
- package/esm/locales/es.json +37 -1
- package/esm/locales/fr.json +37 -1
- package/esm/locales/it.json +37 -1
- package/package.json +1 -1
- package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +9 -0
- package/src/components/LoginDrawer/LoginDrawer.tsx +46 -221
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +7 -5
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.tsx +148 -12
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.tsx +3 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts +54 -47
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +1 -2
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/types.ts +2 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +428 -15
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +240 -42
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +150 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.tsx +79 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +2 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +2 -41
- package/src/components/MemoriArtifactSystem/context/ArtifactContext.tsx +1 -5
- package/src/components/MemoriWidget/MemoriWidget.tsx +0 -1
- package/src/components/icons/Close.tsx +8 -1
- package/src/components/icons/MenuVertical.tsx +29 -0
- package/src/components/layouts/Chat.tsx +3 -1
- package/src/components/layouts/FullPage.tsx +7 -2
- package/src/components/layouts/ZoomedFullBody.tsx +8 -3
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +1 -1
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +112 -104
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +3 -0
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +56 -52
- package/src/components/layouts/chat.css +73 -85
- package/src/components/ui/Drawer.tsx +3 -1
- package/src/components/ui/__snapshots__/Alert.test.tsx.snap +3 -0
- package/src/locales/de.json +37 -1
- package/src/locales/en.json +37 -1
- package/src/locales/es.json +37 -1
- package/src/locales/fr.json +37 -1
- package/src/locales/it.json +38 -1
package/esm/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { pdfExporter } from '../utils/PDFExporter';
|
|
3
4
|
export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
5
|
+
const { t } = useTranslation();
|
|
4
6
|
const [copyState, setCopyState] = useState({
|
|
5
7
|
isOpen: false,
|
|
6
8
|
loading: false,
|
|
@@ -14,14 +16,14 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
14
16
|
case 'markdown':
|
|
15
17
|
baseFormats.push({
|
|
16
18
|
id: 'markdown',
|
|
17
|
-
label: 'Download as Markdown',
|
|
18
|
-
description: 'Download raw markdown text',
|
|
19
|
+
label: t('artifact.downloadAsMarkdown') || 'Download as Markdown',
|
|
20
|
+
description: t('artifact.downloadRawMarkdownText') || 'Download raw markdown text',
|
|
19
21
|
mimeType: 'text/markdown',
|
|
20
22
|
action: 'download',
|
|
21
23
|
}, {
|
|
22
24
|
id: 'pdf',
|
|
23
|
-
label: 'Download as PDF',
|
|
24
|
-
description: 'Export as PDF document',
|
|
25
|
+
label: t('artifact.downloadAsPdf') || 'Download as PDF',
|
|
26
|
+
description: t('artifact.exportAsPdfDocument') || 'Export as PDF document',
|
|
25
27
|
mimeType: 'application/pdf',
|
|
26
28
|
action: 'pdf',
|
|
27
29
|
isAsync: true,
|
|
@@ -30,8 +32,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
30
32
|
case 'html':
|
|
31
33
|
baseFormats.push({
|
|
32
34
|
id: 'html',
|
|
33
|
-
label: 'Download as HTML',
|
|
34
|
-
description: 'Download formatted HTML',
|
|
35
|
+
label: t('artifact.downloadAsHtml') || 'Download as HTML',
|
|
36
|
+
description: t('artifact.downloadFormattedHtml') || 'Download formatted HTML',
|
|
35
37
|
mimeType: 'text/html',
|
|
36
38
|
action: 'download',
|
|
37
39
|
});
|
|
@@ -39,8 +41,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
39
41
|
case 'json':
|
|
40
42
|
baseFormats.push({
|
|
41
43
|
id: 'json',
|
|
42
|
-
label: 'Download as JSON',
|
|
43
|
-
description: 'Download JSON data',
|
|
44
|
+
label: t('artifact.downloadAsJson') || 'Download as JSON',
|
|
45
|
+
description: t('artifact.downloadJsonData') || 'Download JSON data',
|
|
44
46
|
mimeType: 'application/json',
|
|
45
47
|
action: 'download',
|
|
46
48
|
});
|
|
@@ -48,8 +50,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
48
50
|
case 'image/png':
|
|
49
51
|
baseFormats.push({
|
|
50
52
|
id: 'png',
|
|
51
|
-
label: 'Download as PNG',
|
|
52
|
-
description: 'Download PNG image',
|
|
53
|
+
label: t('artifact.downloadAsPng') || 'Download as PNG',
|
|
54
|
+
description: t('artifact.downloadPngImage') || 'Download PNG image',
|
|
53
55
|
mimeType: 'image/png',
|
|
54
56
|
action: 'download',
|
|
55
57
|
});
|
|
@@ -57,8 +59,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
57
59
|
case 'image/jpeg':
|
|
58
60
|
baseFormats.push({
|
|
59
61
|
id: 'jpeg',
|
|
60
|
-
label: 'Download as JPEG',
|
|
61
|
-
description: 'Download JPEG image',
|
|
62
|
+
label: t('artifact.downloadAsJpeg') || 'Download as JPEG',
|
|
63
|
+
description: t('artifact.downloadJpegImage') || 'Download JPEG image',
|
|
62
64
|
mimeType: 'image/jpeg',
|
|
63
65
|
action: 'download',
|
|
64
66
|
});
|
|
@@ -66,8 +68,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
66
68
|
case 'image/gif':
|
|
67
69
|
baseFormats.push({
|
|
68
70
|
id: 'gif',
|
|
69
|
-
label: 'Download as GIF',
|
|
70
|
-
description: 'Download GIF image',
|
|
71
|
+
label: t('artifact.downloadAsGif') || 'Download as GIF',
|
|
72
|
+
description: t('artifact.downloadGifImage') || 'Download GIF image',
|
|
71
73
|
mimeType: 'image/gif',
|
|
72
74
|
action: 'download',
|
|
73
75
|
});
|
|
@@ -75,8 +77,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
75
77
|
case 'image/webp':
|
|
76
78
|
baseFormats.push({
|
|
77
79
|
id: 'webp',
|
|
78
|
-
label: 'Download as WebP',
|
|
79
|
-
description: 'Download WebP image',
|
|
80
|
+
label: t('artifact.downloadAsWebp') || 'Download as WebP',
|
|
81
|
+
description: t('artifact.downloadWebpImage') || 'Download WebP image',
|
|
80
82
|
mimeType: 'image/webp',
|
|
81
83
|
action: 'download',
|
|
82
84
|
});
|
|
@@ -84,14 +86,14 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
84
86
|
case 'image/svg+xml':
|
|
85
87
|
baseFormats.push({
|
|
86
88
|
id: 'svg',
|
|
87
|
-
label: 'Copy as SVG',
|
|
88
|
-
description: 'Copy SVG source code',
|
|
89
|
+
label: t('artifact.copyAsSvg') || 'Copy as SVG',
|
|
90
|
+
description: t('artifact.copySvgSourceCode') || 'Copy SVG source code',
|
|
89
91
|
mimeType: 'image/svg+xml',
|
|
90
92
|
action: 'copy',
|
|
91
93
|
}, {
|
|
92
94
|
id: 'plain',
|
|
93
|
-
label: 'Copy as Plain Text',
|
|
94
|
-
description: 'Copy as text',
|
|
95
|
+
label: t('artifact.copyAsPlainText') || 'Copy as Plain Text',
|
|
96
|
+
description: t('artifact.copyAsText') || 'Copy as text',
|
|
95
97
|
mimeType: 'text/plain',
|
|
96
98
|
action: 'copy',
|
|
97
99
|
});
|
|
@@ -101,14 +103,14 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
101
103
|
const language = artifact.mimeType.split('.').pop() || 'text';
|
|
102
104
|
baseFormats.push({
|
|
103
105
|
id: 'code',
|
|
104
|
-
label: `Copy as ${language.charAt(0).toUpperCase() + language.slice(1)}`,
|
|
105
|
-
description: `Copy ${language} code`,
|
|
106
|
+
label: t('artifact.copyAsLanguage', { language: language.charAt(0).toUpperCase() + language.slice(1) }) || `Copy as ${language.charAt(0).toUpperCase() + language.slice(1)}`,
|
|
107
|
+
description: t('artifact.copyLanguageCode', { language }) || `Copy ${language} code`,
|
|
106
108
|
mimeType: artifact.mimeType,
|
|
107
109
|
action: 'copy',
|
|
108
110
|
}, {
|
|
109
111
|
id: 'plain',
|
|
110
|
-
label: 'Copy as Plain Text',
|
|
111
|
-
description: 'Copy without syntax highlighting',
|
|
112
|
+
label: t('artifact.copyAsPlainText') || 'Copy as Plain Text',
|
|
113
|
+
description: t('artifact.copyWithoutSyntaxHighlighting') || 'Copy without syntax highlighting',
|
|
112
114
|
mimeType: 'text/plain',
|
|
113
115
|
action: 'copy',
|
|
114
116
|
});
|
|
@@ -116,8 +118,8 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
116
118
|
else {
|
|
117
119
|
baseFormats.push({
|
|
118
120
|
id: 'text',
|
|
119
|
-
label: 'Copy as Text',
|
|
120
|
-
description: 'Copy text content',
|
|
121
|
+
label: t('artifact.copyAsText') || 'Copy as Text',
|
|
122
|
+
description: t('artifact.copyTextContent') || 'Copy text content',
|
|
121
123
|
mimeType: 'text/plain',
|
|
122
124
|
action: 'copy',
|
|
123
125
|
});
|
|
@@ -125,7 +127,7 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
125
127
|
break;
|
|
126
128
|
}
|
|
127
129
|
return baseFormats;
|
|
128
|
-
}, [artifact.mimeType]);
|
|
130
|
+
}, [artifact.mimeType, t]);
|
|
129
131
|
const convertContent = useCallback((format) => {
|
|
130
132
|
const { content } = artifact;
|
|
131
133
|
switch (format.id) {
|
|
@@ -181,7 +183,7 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
181
183
|
try {
|
|
182
184
|
if (format.action === 'pdf') {
|
|
183
185
|
if (!pdfExporter.isSupported()) {
|
|
184
|
-
throw new Error('PDF export is not supported in this browser');
|
|
186
|
+
throw new Error(t('artifact.pdfExportNotSupported') || 'PDF export is not supported in this browser');
|
|
185
187
|
}
|
|
186
188
|
const pdfOptions = {
|
|
187
189
|
title: artifact.title || 'Artifact',
|
|
@@ -198,7 +200,7 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
198
200
|
const printContent = convertContent(format);
|
|
199
201
|
const printWindow = window.open('', '_blank');
|
|
200
202
|
if (!printWindow) {
|
|
201
|
-
throw new Error('Popup blocked! Please enable popups to print.');
|
|
203
|
+
throw new Error(t('artifact.popupBlocked') || 'Popup blocked! Please enable popups to print.');
|
|
202
204
|
}
|
|
203
205
|
const htmlContent = `
|
|
204
206
|
<!DOCTYPE html>
|
|
@@ -241,7 +243,7 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
241
243
|
URL.revokeObjectURL(url);
|
|
242
244
|
onDownload === null || onDownload === void 0 ? void 0 : onDownload();
|
|
243
245
|
}
|
|
244
|
-
else {
|
|
246
|
+
else if (format.action === 'copy') {
|
|
245
247
|
const contentToCopy = convertContent(format);
|
|
246
248
|
await copyToClipboard(contentToCopy);
|
|
247
249
|
onCopy === null || onCopy === void 0 ? void 0 : onCopy();
|
|
@@ -249,15 +251,17 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
249
251
|
setCopyState(prev => ({
|
|
250
252
|
...prev,
|
|
251
253
|
loading: false,
|
|
252
|
-
success:
|
|
254
|
+
success: format.action === 'copy',
|
|
253
255
|
error: null,
|
|
254
256
|
}));
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
if (format.action === 'copy') {
|
|
258
|
+
setTimeout(() => {
|
|
259
|
+
setCopyState(prev => ({
|
|
260
|
+
...prev,
|
|
261
|
+
success: false,
|
|
262
|
+
}));
|
|
263
|
+
}, 2000);
|
|
264
|
+
}
|
|
261
265
|
}
|
|
262
266
|
catch (error) {
|
|
263
267
|
console.error('Copy operation failed:', error);
|
|
@@ -274,7 +278,7 @@ export const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
274
278
|
}));
|
|
275
279
|
}, 3000);
|
|
276
280
|
}
|
|
277
|
-
}, [artifact, convertContent, copyToClipboard, onCopy, onPrint]);
|
|
281
|
+
}, [artifact, convertContent, copyToClipboard, onCopy, onPrint, t]);
|
|
278
282
|
const handleCopyClick = useCallback(async () => {
|
|
279
283
|
const contentToCopy = convertContent(formats[0]);
|
|
280
284
|
await copyToClipboard(contentToCopy);
|
package/esm/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCopyArtifact.js","sourceRoot":"","sources":["../../../../../../src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useCopyArtifact.js","sourceRoot":"","sources":["../../../../../../src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,OAAO,EAAE,WAAW,E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;
|
|
142
142
|
border-radius: 50%;
|
|
143
|
-
border-top: 2px solid #3b82f6;
|
|
144
143
|
animation: memori-copy-spin 1s linear infinite;
|
|
145
144
|
}
|
|
146
145
|
|
|
@@ -161,7 +160,7 @@
|
|
|
161
160
|
z-index: 10001;
|
|
162
161
|
top: 100%;
|
|
163
162
|
right: 0;
|
|
164
|
-
left: 0;
|
|
163
|
+
/* left: 0; */
|
|
165
164
|
overflow: hidden;
|
|
166
165
|
min-width: 280px;
|
|
167
166
|
max-width: 320px;
|
|
@@ -5,7 +5,7 @@ export interface CopyFormat {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
icon?: React.ReactNode | undefined;
|
|
7
7
|
mimeType: string;
|
|
8
|
-
action: 'copy' | 'pdf' | 'print' | 'download';
|
|
8
|
+
action: 'copy' | 'pdf' | 'print' | 'download' | 'link';
|
|
9
9
|
isAsync?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface CopyMenuItemProps {
|
|
@@ -23,6 +23,7 @@ export interface CopyButtonWithDropdownProps {
|
|
|
23
23
|
onCopy?: () => void;
|
|
24
24
|
onDownload?: () => void;
|
|
25
25
|
onPrint?: () => void;
|
|
26
|
+
onOpenExternal?: () => void;
|
|
26
27
|
loading?: boolean;
|
|
27
28
|
className?: string;
|
|
28
29
|
disabled?: boolean;
|