@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/dist/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCopyArtifact = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const react_i18next_1 = require("react-i18next");
|
|
5
6
|
const PDFExporter_1 = require("../utils/PDFExporter");
|
|
6
7
|
const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
8
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
7
9
|
const [copyState, setCopyState] = (0, react_1.useState)({
|
|
8
10
|
isOpen: false,
|
|
9
11
|
loading: false,
|
|
@@ -17,14 +19,14 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
17
19
|
case 'markdown':
|
|
18
20
|
baseFormats.push({
|
|
19
21
|
id: 'markdown',
|
|
20
|
-
label: 'Download as Markdown',
|
|
21
|
-
description: 'Download raw markdown text',
|
|
22
|
+
label: t('artifact.downloadAsMarkdown') || 'Download as Markdown',
|
|
23
|
+
description: t('artifact.downloadRawMarkdownText') || 'Download raw markdown text',
|
|
22
24
|
mimeType: 'text/markdown',
|
|
23
25
|
action: 'download',
|
|
24
26
|
}, {
|
|
25
27
|
id: 'pdf',
|
|
26
|
-
label: 'Download as PDF',
|
|
27
|
-
description: 'Export as PDF document',
|
|
28
|
+
label: t('artifact.downloadAsPdf') || 'Download as PDF',
|
|
29
|
+
description: t('artifact.exportAsPdfDocument') || 'Export as PDF document',
|
|
28
30
|
mimeType: 'application/pdf',
|
|
29
31
|
action: 'pdf',
|
|
30
32
|
isAsync: true,
|
|
@@ -33,8 +35,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
33
35
|
case 'html':
|
|
34
36
|
baseFormats.push({
|
|
35
37
|
id: 'html',
|
|
36
|
-
label: 'Download as HTML',
|
|
37
|
-
description: 'Download formatted HTML',
|
|
38
|
+
label: t('artifact.downloadAsHtml') || 'Download as HTML',
|
|
39
|
+
description: t('artifact.downloadFormattedHtml') || 'Download formatted HTML',
|
|
38
40
|
mimeType: 'text/html',
|
|
39
41
|
action: 'download',
|
|
40
42
|
});
|
|
@@ -42,8 +44,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
42
44
|
case 'json':
|
|
43
45
|
baseFormats.push({
|
|
44
46
|
id: 'json',
|
|
45
|
-
label: 'Download as JSON',
|
|
46
|
-
description: 'Download JSON data',
|
|
47
|
+
label: t('artifact.downloadAsJson') || 'Download as JSON',
|
|
48
|
+
description: t('artifact.downloadJsonData') || 'Download JSON data',
|
|
47
49
|
mimeType: 'application/json',
|
|
48
50
|
action: 'download',
|
|
49
51
|
});
|
|
@@ -51,8 +53,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
51
53
|
case 'image/png':
|
|
52
54
|
baseFormats.push({
|
|
53
55
|
id: 'png',
|
|
54
|
-
label: 'Download as PNG',
|
|
55
|
-
description: 'Download PNG image',
|
|
56
|
+
label: t('artifact.downloadAsPng') || 'Download as PNG',
|
|
57
|
+
description: t('artifact.downloadPngImage') || 'Download PNG image',
|
|
56
58
|
mimeType: 'image/png',
|
|
57
59
|
action: 'download',
|
|
58
60
|
});
|
|
@@ -60,8 +62,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
60
62
|
case 'image/jpeg':
|
|
61
63
|
baseFormats.push({
|
|
62
64
|
id: 'jpeg',
|
|
63
|
-
label: 'Download as JPEG',
|
|
64
|
-
description: 'Download JPEG image',
|
|
65
|
+
label: t('artifact.downloadAsJpeg') || 'Download as JPEG',
|
|
66
|
+
description: t('artifact.downloadJpegImage') || 'Download JPEG image',
|
|
65
67
|
mimeType: 'image/jpeg',
|
|
66
68
|
action: 'download',
|
|
67
69
|
});
|
|
@@ -69,8 +71,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
69
71
|
case 'image/gif':
|
|
70
72
|
baseFormats.push({
|
|
71
73
|
id: 'gif',
|
|
72
|
-
label: 'Download as GIF',
|
|
73
|
-
description: 'Download GIF image',
|
|
74
|
+
label: t('artifact.downloadAsGif') || 'Download as GIF',
|
|
75
|
+
description: t('artifact.downloadGifImage') || 'Download GIF image',
|
|
74
76
|
mimeType: 'image/gif',
|
|
75
77
|
action: 'download',
|
|
76
78
|
});
|
|
@@ -78,8 +80,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
78
80
|
case 'image/webp':
|
|
79
81
|
baseFormats.push({
|
|
80
82
|
id: 'webp',
|
|
81
|
-
label: 'Download as WebP',
|
|
82
|
-
description: 'Download WebP image',
|
|
83
|
+
label: t('artifact.downloadAsWebp') || 'Download as WebP',
|
|
84
|
+
description: t('artifact.downloadWebpImage') || 'Download WebP image',
|
|
83
85
|
mimeType: 'image/webp',
|
|
84
86
|
action: 'download',
|
|
85
87
|
});
|
|
@@ -87,14 +89,14 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
87
89
|
case 'image/svg+xml':
|
|
88
90
|
baseFormats.push({
|
|
89
91
|
id: 'svg',
|
|
90
|
-
label: 'Copy as SVG',
|
|
91
|
-
description: 'Copy SVG source code',
|
|
92
|
+
label: t('artifact.copyAsSvg') || 'Copy as SVG',
|
|
93
|
+
description: t('artifact.copySvgSourceCode') || 'Copy SVG source code',
|
|
92
94
|
mimeType: 'image/svg+xml',
|
|
93
95
|
action: 'copy',
|
|
94
96
|
}, {
|
|
95
97
|
id: 'plain',
|
|
96
|
-
label: 'Copy as Plain Text',
|
|
97
|
-
description: 'Copy as text',
|
|
98
|
+
label: t('artifact.copyAsPlainText') || 'Copy as Plain Text',
|
|
99
|
+
description: t('artifact.copyAsText') || 'Copy as text',
|
|
98
100
|
mimeType: 'text/plain',
|
|
99
101
|
action: 'copy',
|
|
100
102
|
});
|
|
@@ -104,14 +106,14 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
104
106
|
const language = artifact.mimeType.split('.').pop() || 'text';
|
|
105
107
|
baseFormats.push({
|
|
106
108
|
id: 'code',
|
|
107
|
-
label: `Copy as ${language.charAt(0).toUpperCase() + language.slice(1)}`,
|
|
108
|
-
description: `Copy ${language} code`,
|
|
109
|
+
label: t('artifact.copyAsLanguage', { language: language.charAt(0).toUpperCase() + language.slice(1) }) || `Copy as ${language.charAt(0).toUpperCase() + language.slice(1)}`,
|
|
110
|
+
description: t('artifact.copyLanguageCode', { language }) || `Copy ${language} code`,
|
|
109
111
|
mimeType: artifact.mimeType,
|
|
110
112
|
action: 'copy',
|
|
111
113
|
}, {
|
|
112
114
|
id: 'plain',
|
|
113
|
-
label: 'Copy as Plain Text',
|
|
114
|
-
description: 'Copy without syntax highlighting',
|
|
115
|
+
label: t('artifact.copyAsPlainText') || 'Copy as Plain Text',
|
|
116
|
+
description: t('artifact.copyWithoutSyntaxHighlighting') || 'Copy without syntax highlighting',
|
|
115
117
|
mimeType: 'text/plain',
|
|
116
118
|
action: 'copy',
|
|
117
119
|
});
|
|
@@ -119,8 +121,8 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
119
121
|
else {
|
|
120
122
|
baseFormats.push({
|
|
121
123
|
id: 'text',
|
|
122
|
-
label: 'Copy as Text',
|
|
123
|
-
description: 'Copy text content',
|
|
124
|
+
label: t('artifact.copyAsText') || 'Copy as Text',
|
|
125
|
+
description: t('artifact.copyTextContent') || 'Copy text content',
|
|
124
126
|
mimeType: 'text/plain',
|
|
125
127
|
action: 'copy',
|
|
126
128
|
});
|
|
@@ -128,7 +130,7 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
128
130
|
break;
|
|
129
131
|
}
|
|
130
132
|
return baseFormats;
|
|
131
|
-
}, [artifact.mimeType]);
|
|
133
|
+
}, [artifact.mimeType, t]);
|
|
132
134
|
const convertContent = (0, react_1.useCallback)((format) => {
|
|
133
135
|
const { content } = artifact;
|
|
134
136
|
switch (format.id) {
|
|
@@ -184,7 +186,7 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
184
186
|
try {
|
|
185
187
|
if (format.action === 'pdf') {
|
|
186
188
|
if (!PDFExporter_1.pdfExporter.isSupported()) {
|
|
187
|
-
throw new Error('PDF export is not supported in this browser');
|
|
189
|
+
throw new Error(t('artifact.pdfExportNotSupported') || 'PDF export is not supported in this browser');
|
|
188
190
|
}
|
|
189
191
|
const pdfOptions = {
|
|
190
192
|
title: artifact.title || 'Artifact',
|
|
@@ -201,7 +203,7 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
201
203
|
const printContent = convertContent(format);
|
|
202
204
|
const printWindow = window.open('', '_blank');
|
|
203
205
|
if (!printWindow) {
|
|
204
|
-
throw new Error('Popup blocked! Please enable popups to print.');
|
|
206
|
+
throw new Error(t('artifact.popupBlocked') || 'Popup blocked! Please enable popups to print.');
|
|
205
207
|
}
|
|
206
208
|
const htmlContent = `
|
|
207
209
|
<!DOCTYPE html>
|
|
@@ -244,7 +246,7 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
244
246
|
URL.revokeObjectURL(url);
|
|
245
247
|
onDownload === null || onDownload === void 0 ? void 0 : onDownload();
|
|
246
248
|
}
|
|
247
|
-
else {
|
|
249
|
+
else if (format.action === 'copy') {
|
|
248
250
|
const contentToCopy = convertContent(format);
|
|
249
251
|
await copyToClipboard(contentToCopy);
|
|
250
252
|
onCopy === null || onCopy === void 0 ? void 0 : onCopy();
|
|
@@ -252,15 +254,17 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
252
254
|
setCopyState(prev => ({
|
|
253
255
|
...prev,
|
|
254
256
|
loading: false,
|
|
255
|
-
success:
|
|
257
|
+
success: format.action === 'copy',
|
|
256
258
|
error: null,
|
|
257
259
|
}));
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
if (format.action === 'copy') {
|
|
261
|
+
setTimeout(() => {
|
|
262
|
+
setCopyState(prev => ({
|
|
263
|
+
...prev,
|
|
264
|
+
success: false,
|
|
265
|
+
}));
|
|
266
|
+
}, 2000);
|
|
267
|
+
}
|
|
264
268
|
}
|
|
265
269
|
catch (error) {
|
|
266
270
|
console.error('Copy operation failed:', error);
|
|
@@ -277,7 +281,7 @@ const useCopyArtifact = (artifact, onCopy, onDownload, onPrint) => {
|
|
|
277
281
|
}));
|
|
278
282
|
}, 3000);
|
|
279
283
|
}
|
|
280
|
-
}, [artifact, convertContent, copyToClipboard, onCopy, onPrint]);
|
|
284
|
+
}, [artifact, convertContent, copyToClipboard, onCopy, onPrint, t]);
|
|
281
285
|
const handleCopyClick = (0, react_1.useCallback)(async () => {
|
|
282
286
|
const contentToCopy = convertContent(formats[0]);
|
|
283
287
|
await copyToClipboard(contentToCopy);
|
package/dist/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,iCAAuD;
|
|
1
|
+
{"version":3,"file":"useCopyArtifact.js","sourceRoot":"","sources":["../../../../../../src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts"],"names":[],"mappings":";;;AAKA,iCAAuD;AACvD,iDAA+C;AAO/C,sDAAmD;AAE5C,MAAM,eAAe,GAAG,CAC7B,QAA+D,EAC/D,MAAmB,EACnB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e7eb;
|
|
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;
|