@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.
- package/CHANGELOG.md +27 -0
- package/dist/components/Chat/Chat.js +8 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +166 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +115 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +104 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +50 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +78 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +22 -0
- package/dist/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +288 -0
- package/dist/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/dist/components/MemoriArtifactSystem/index.js +28 -0
- package/dist/components/MemoriArtifactSystem/index.js.map +1 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js +31 -0
- package/dist/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/dist/components/icons/Print.d.ts +6 -0
- package/dist/components/icons/Print.js +6 -0
- package/dist/components/icons/Print.js.map +1 -0
- package/dist/components/layouts/Chat.js +29 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/FullPage.js +33 -1
- package/dist/components/layouts/FullPage.js.map +1 -1
- package/dist/components/layouts/ZoomedFullBody.js +29 -2
- package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
- package/dist/components/layouts/chat.css +335 -13
- package/dist/components/layouts/zoomed-full-body.css +1 -3
- package/dist/helpers/message.js +1 -0
- package/dist/helpers/message.js.map +1 -1
- package/dist/helpers/stt/useSTT.js +76 -9
- package/dist/helpers/stt/useSTT.js.map +1 -1
- package/dist/index.js +58 -15
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -0
- package/esm/components/Chat/Chat.js +8 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js +163 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.d.ts +3 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +112 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +101 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js +47 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.d.ts +4 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +75 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js +17 -0
- package/esm/components/MemoriArtifactSystem/context/ArtifactSystemContext.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.d.ts +12 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js +281 -0
- package/esm/components/MemoriArtifactSystem/hooks/useArtifactSystem.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/index.d.ts +9 -0
- package/esm/components/MemoriArtifactSystem/index.js +9 -0
- package/esm/components/MemoriArtifactSystem/index.js.map +1 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.d.ts +108 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js +28 -0
- package/esm/components/MemoriArtifactSystem/types/artifact.types.js.map +1 -0
- package/esm/components/icons/Print.d.ts +6 -0
- package/esm/components/icons/Print.js +4 -0
- package/esm/components/icons/Print.js.map +1 -0
- package/esm/components/layouts/Chat.js +29 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/FullPage.js +33 -1
- package/esm/components/layouts/FullPage.js.map +1 -1
- package/esm/components/layouts/ZoomedFullBody.js +30 -3
- package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
- package/esm/components/layouts/chat.css +335 -13
- package/esm/components/layouts/zoomed-full-body.css +1 -3
- package/esm/helpers/message.js +1 -0
- package/esm/helpers/message.js.map +1 -1
- package/esm/helpers/stt/useSTT.js +76 -9
- package/esm/helpers/stt/useSTT.js.map +1 -1
- package/esm/index.js +58 -15
- package/esm/index.js.map +1 -1
- package/esm/styles.css +5 -0
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.test.tsx +13 -0
- package/src/components/Chat/Chat.stories.tsx +33 -2
- package/src/components/Chat/Chat.test.tsx +340 -213
- package/src/components/Chat/Chat.tsx +27 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +160 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +278 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +877 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +308 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +238 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +282 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.css +319 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactHistory/ArtifactHistory.tsx +178 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +343 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +190 -0
- package/src/components/MemoriArtifactSystem/context/ArtifactSystemContext.tsx +57 -0
- package/src/components/MemoriArtifactSystem/hooks/useArtifactSystem.ts +419 -0
- package/src/components/MemoriArtifactSystem/index.ts +45 -0
- package/src/components/MemoriArtifactSystem/types/artifact.types.ts +180 -0
- package/src/components/icons/Print.tsx +34 -0
- package/src/components/layouts/Chat.test.tsx +13 -0
- package/src/components/layouts/Chat.tsx +80 -25
- package/src/components/layouts/FullPage.test.tsx +40 -11
- package/src/components/layouts/FullPage.tsx +92 -24
- package/src/components/layouts/HiddenChat.test.tsx +13 -0
- package/src/components/layouts/Totem.test.tsx +13 -0
- package/src/components/layouts/WebsiteAssistant.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.test.tsx +13 -0
- package/src/components/layouts/ZoomedFullBody.tsx +78 -14
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +252 -248
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +504 -496
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +252 -248
- package/src/components/layouts/chat.css +335 -13
- package/src/components/layouts/layouts.stories.tsx +13 -2
- package/src/components/layouts/zoomed-full-body.css +1 -3
- package/src/helpers/message.ts +1 -0
- package/src/helpers/stt/useSTT.ts +101 -16
- package/src/index.stories.tsx +26 -22
- package/src/index.tsx +46 -0
- package/src/mocks/data.ts +258 -0
- package/src/styles.css +5 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArtifactPreview CSS Styles
|
|
3
|
+
* Following the project's design system and CSS patterns
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.memori-artifact-preview {
|
|
7
|
+
display: flex;
|
|
8
|
+
height: 100%;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Tabs */
|
|
14
|
+
.memori-artifact-tabs {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: flex-end;
|
|
17
|
+
padding: 0.5rem;
|
|
18
|
+
/* border-bottom: 1px solid var(--memori-button-border-color, #e9ecef); */
|
|
19
|
+
border-radius: var(--memori-border-radius, 6px) var(--memori-border-radius, 6px) 0 0;
|
|
20
|
+
background: var(--memori-inner-bg, #f8f9fa);
|
|
21
|
+
gap: 0.25rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.memori-artifact-tab-icon{
|
|
25
|
+
width: 16px;
|
|
26
|
+
height: 16px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.memori-artifact-tab {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 0.75rem 1rem;
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: var(--memori-border-radius, 4px);
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: var(--memori-text-color, #666);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
gap: 0.5rem;
|
|
41
|
+
transition: all 0.2s ease;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* .memori-artifact-tab:hover:not(.memori-artifact-tab--active) {
|
|
46
|
+
background: rgba(0, 123, 255, 0.05);
|
|
47
|
+
color: var(--memori-text-color, #333);
|
|
48
|
+
} */
|
|
49
|
+
|
|
50
|
+
.memori-artifact-tab--active, .memori-artifact-tab:hover, .memori-artifact-tab:active, .memori-artifact-tab:focus {
|
|
51
|
+
background: var(--memori-chat-bubble-bg, #fff);
|
|
52
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
53
|
+
color: var(--memori-primary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Content */
|
|
57
|
+
.memori-artifact-content {
|
|
58
|
+
display: flex;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
min-height: 0;
|
|
61
|
+
flex: 1;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
border-radius: 0 0 var(--memori-border-radius, 6px) var(--memori-border-radius, 6px);
|
|
64
|
+
background: var(--memori-chat-bubble-bg, #fff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.memori-artifact-tab-content {
|
|
68
|
+
display: none;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
min-height: 0;
|
|
71
|
+
flex: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.memori-artifact-tab-content--active {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Code Content */
|
|
80
|
+
.memori-artifact-code {
|
|
81
|
+
overflow: auto;
|
|
82
|
+
flex: 1;
|
|
83
|
+
border: 1px solid var(--memori-button-border-color, #e9ecef);
|
|
84
|
+
border-radius: var(--memori-border-radius, 6px);
|
|
85
|
+
margin: 1rem;
|
|
86
|
+
background: var(--memori-chat-bubble-bg, #fff);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.memori-artifact-code-content {
|
|
90
|
+
padding: 1rem;
|
|
91
|
+
margin: 0;
|
|
92
|
+
color: var(--memori-text-color, #333);
|
|
93
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
|
|
94
|
+
font-size: 0.875rem;
|
|
95
|
+
line-height: 1.5;
|
|
96
|
+
overflow-wrap: break-word;
|
|
97
|
+
white-space: pre-wrap;
|
|
98
|
+
word-wrap: break-word;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Preview Content */
|
|
102
|
+
.memori-artifact-preview-content {
|
|
103
|
+
position: relative;
|
|
104
|
+
overflow: auto;
|
|
105
|
+
flex: 1;
|
|
106
|
+
border: 1px solid var(--memori-button-border-color, #e9ecef);
|
|
107
|
+
border-radius: var(--memori-border-radius, 6px);
|
|
108
|
+
margin: 1rem;
|
|
109
|
+
background: var(--memori-chat-bubble-bg, #fff);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Markdown Preview */
|
|
113
|
+
.memori-artifact-preview-markdown {
|
|
114
|
+
padding: 1rem;
|
|
115
|
+
color: var(--memori-text-color, #333);
|
|
116
|
+
font-family: var(--memori-font-family);
|
|
117
|
+
line-height: 1.6;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.memori-artifact-preview-markdown h1,
|
|
121
|
+
.memori-artifact-preview-markdown h2,
|
|
122
|
+
.memori-artifact-preview-markdown h3,
|
|
123
|
+
.memori-artifact-preview-markdown h4,
|
|
124
|
+
.memori-artifact-preview-markdown h5,
|
|
125
|
+
.memori-artifact-preview-markdown h6 {
|
|
126
|
+
margin: 1.5rem 0 0.5rem;
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
line-height: 1.3;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.memori-artifact-preview-css-content h3 {
|
|
132
|
+
margin: 0 0 1rem;
|
|
133
|
+
font-size: 1.125rem;
|
|
134
|
+
font-weight: 600;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.memori-artifact-preview-markdown h1:first-child,
|
|
138
|
+
.memori-artifact-preview-markdown h2:first-child,
|
|
139
|
+
.memori-artifact-preview-markdown h3:first-child {
|
|
140
|
+
margin-top: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.memori-artifact-preview-markdown p {
|
|
144
|
+
margin: 0 0 1rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.memori-artifact-preview-markdown code {
|
|
148
|
+
padding: 0.125rem 0.25rem;
|
|
149
|
+
border-radius: 3px;
|
|
150
|
+
background: var(--memori-inner-bg, #f1f3f4);
|
|
151
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
152
|
+
font-size: 0.875em;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.memori-artifact-preview-markdown pre {
|
|
156
|
+
padding: 1rem;
|
|
157
|
+
border-radius: var(--memori-border-radius, 6px);
|
|
158
|
+
margin: 1rem 0;
|
|
159
|
+
background: var(--memori-inner-bg, #f1f3f4);
|
|
160
|
+
overflow-x: auto;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.memori-artifact-preview-markdown pre code {
|
|
164
|
+
padding: 0;
|
|
165
|
+
background: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.memori-artifact-preview-markdown a {
|
|
169
|
+
color: var(--memori-primary);
|
|
170
|
+
text-decoration: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.memori-artifact-preview-markdown a:hover {
|
|
174
|
+
text-decoration: underline;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* SVG Preview */
|
|
178
|
+
.memori-artifact-preview-svg {
|
|
179
|
+
display: flex;
|
|
180
|
+
min-height: 200px;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
padding: 1rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.memori-artifact-preview-svg svg {
|
|
187
|
+
max-width: 100%;
|
|
188
|
+
max-height: 100%;
|
|
189
|
+
border: 1px solid var(--memori-button-border-color, #e9ecef);
|
|
190
|
+
border-radius: var(--memori-border-radius, 6px);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* CSS Preview */
|
|
194
|
+
.memori-artifact-preview-css {
|
|
195
|
+
padding: 1rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.memori-artifact-preview-css-demo {
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
border: 1px solid var(--memori-button-border-color, #e9ecef);
|
|
201
|
+
border-radius: var(--memori-border-radius, 6px);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.memori-artifact-preview-css-content {
|
|
205
|
+
padding: 1rem;
|
|
206
|
+
color: var(--memori-text-color, #333);
|
|
207
|
+
font-family: var(--memori-font-family);
|
|
208
|
+
line-height: 1.6;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.memori-artifact-preview-css-content p {
|
|
212
|
+
margin: 0 0 1rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.memori-artifact-preview-css-content button {
|
|
216
|
+
padding: 0.5rem 1rem;
|
|
217
|
+
border: none;
|
|
218
|
+
border-radius: var(--memori-border-radius, 4px);
|
|
219
|
+
margin: 0.5rem 0;
|
|
220
|
+
background: var(--memori-primary);
|
|
221
|
+
color: var(--memori-primary-text);
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.memori-artifact-preview-css-container {
|
|
226
|
+
padding: 1rem;
|
|
227
|
+
border-radius: var(--memori-border-radius, 4px);
|
|
228
|
+
margin: 1rem 0;
|
|
229
|
+
background: var(--memori-inner-bg, #f1f3f4);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Text Preview */
|
|
233
|
+
.memori-artifact-preview-text {
|
|
234
|
+
padding: 1rem;
|
|
235
|
+
color: var(--memori-text-color, #333);
|
|
236
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
237
|
+
font-size: 0.875rem;
|
|
238
|
+
line-height: 1.5;
|
|
239
|
+
white-space: pre-wrap;
|
|
240
|
+
word-wrap: break-word;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Syntax Highlighting */
|
|
244
|
+
.memori-artifact--comment {
|
|
245
|
+
color: #6a737d;
|
|
246
|
+
font-style: italic;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.memori-artifact--keyword {
|
|
250
|
+
color: #d73a49;
|
|
251
|
+
font-weight: 600;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.memori-artifact--string {
|
|
255
|
+
color: #032f62;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.memori-artifact--number {
|
|
259
|
+
color: #005cc5;
|
|
260
|
+
font-weight: 500;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.memori-artifact--function {
|
|
264
|
+
color: #6f42c1;
|
|
265
|
+
font-weight: 600;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.memori-artifact--operator {
|
|
269
|
+
color: #d73a49;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.memori-artifact--property {
|
|
273
|
+
color: #005cc5;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.memori-artifact--selector {
|
|
277
|
+
color: #6f42c1;
|
|
278
|
+
font-weight: 600;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.memori-artifact--tag {
|
|
282
|
+
color: #22863a;
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.memori-artifact--line-number {
|
|
287
|
+
margin-right: 1rem;
|
|
288
|
+
color: #6a737d;
|
|
289
|
+
user-select: none;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* Responsive Design */
|
|
293
|
+
@media (max-width: 768px) {
|
|
294
|
+
|
|
295
|
+
.memori-artifact-tab {
|
|
296
|
+
min-height: 42px;
|
|
297
|
+
padding: 0.5rem 0.75rem;
|
|
298
|
+
font-size: 0.75rem;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.memori-artifact-code,
|
|
302
|
+
.memori-artifact-preview-content {
|
|
303
|
+
margin: 0.5rem;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.memori-artifact-code-content {
|
|
307
|
+
padding: 0.75rem;
|
|
308
|
+
font-size: 0.75rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.memori-artifact-preview-markdown,
|
|
312
|
+
.memori-artifact-preview-css,
|
|
313
|
+
.memori-artifact-preview-text {
|
|
314
|
+
padding: 0.75rem;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Dark Mode Support */
|
|
319
|
+
@media (prefers-color-scheme: dark) {
|
|
320
|
+
.memori-artifact-tabs {
|
|
321
|
+
border-bottom-color: var(--memori-button-border-color, #404040);
|
|
322
|
+
background: rgba(255, 255, 255, 0.86);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/* .memori-artifact-tab--active {
|
|
326
|
+
background: var(--memori-chat-bubble-bg, #1a1a1a);
|
|
327
|
+
} */
|
|
328
|
+
|
|
329
|
+
.memori-artifact-code,
|
|
330
|
+
.memori-artifact-preview-content {
|
|
331
|
+
border-color: var(--memori-button-border-color, #404040);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.memori-artifact-preview-markdown code,
|
|
335
|
+
.memori-artifact-preview-css-demo {
|
|
336
|
+
border-color: var(--memori-button-border-color, #404040);
|
|
337
|
+
background: var(--memori-inner-bg, #2a2a2a);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.memori-artifact-preview-css-container {
|
|
341
|
+
background: var(--memori-inner-bg, #2a2a2a);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_i18next_1 = require("react-i18next");
|
|
7
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
+
const Button_1 = tslib_1.__importDefault(require("../../../ui/Button"));
|
|
9
|
+
const artifact_types_1 = require("../../types/artifact.types");
|
|
10
|
+
const Code_1 = tslib_1.__importDefault(require("../../../icons/Code"));
|
|
11
|
+
const Preview_1 = require("../../../icons/Preview");
|
|
12
|
+
const Snippet_1 = tslib_1.__importDefault(require("../../../Snippet/Snippet"));
|
|
13
|
+
const ArtifactPreview = ({ artifact, activeTab, onTabChange, }) => {
|
|
14
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
|
+
const handleTabChange = (0, react_1.useCallback)((tab) => {
|
|
16
|
+
onTabChange(tab);
|
|
17
|
+
}, [onTabChange]);
|
|
18
|
+
const renderPreview = (0, react_1.useCallback)(() => {
|
|
19
|
+
switch (artifact.mimeType) {
|
|
20
|
+
case 'html':
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("iframe", { srcDoc: artifact.content, style: {
|
|
22
|
+
width: '100%',
|
|
23
|
+
height: '100%',
|
|
24
|
+
border: 'none',
|
|
25
|
+
borderRadius: '6px',
|
|
26
|
+
}, title: `${artifact.title} Preview` }));
|
|
27
|
+
case 'markdown':
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-markdown", dangerouslySetInnerHTML: { __html: renderMarkdown(artifact.content) } }));
|
|
29
|
+
case 'svg':
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-svg", dangerouslySetInnerHTML: { __html: artifact.content } }));
|
|
31
|
+
case 'css':
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-css", children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-artifact-preview-css-demo", children: [(0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: { __html: artifact.content } }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-artifact-preview-css-content", children: [(0, jsx_runtime_1.jsx)("h3", { children: "CSS Preview" }), (0, jsx_runtime_1.jsx)("p", { children: "This is an example of text to see the CSS effect." }), (0, jsx_runtime_1.jsx)("button", { children: "Example Button" }), (0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-css-container", children: "Example Container" })] })] }) }));
|
|
33
|
+
default:
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-text", children: (0, jsx_runtime_1.jsx)("pre", { children: artifact.content }) }));
|
|
35
|
+
}
|
|
36
|
+
}, [artifact]);
|
|
37
|
+
const renderMarkdown = (0, react_1.useCallback)((markdown) => {
|
|
38
|
+
return markdown
|
|
39
|
+
.replace(/^# (.*$)/gim, '<h1>$1</h1>')
|
|
40
|
+
.replace(/^## (.*$)/gim, '<h2>$1</h2>')
|
|
41
|
+
.replace(/^### (.*$)/gim, '<h3>$1</h3>')
|
|
42
|
+
.replace(/^#### (.*$)/gim, '<h4>$1</h4>')
|
|
43
|
+
.replace(/^##### (.*$)/gim, '<h5>$1</h5>')
|
|
44
|
+
.replace(/^###### (.*$)/gim, '<h6>$1</h6>')
|
|
45
|
+
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
|
46
|
+
.replace(/\*(.*?)\*/g, '<em>$1</em>')
|
|
47
|
+
.replace(/`(.*?)`/g, '<code>$1</code>')
|
|
48
|
+
.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
|
|
49
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')
|
|
50
|
+
.replace(/\n/g, '<br>');
|
|
51
|
+
}, []);
|
|
52
|
+
const hasPreview = (0, react_1.useMemo)(() => {
|
|
53
|
+
return artifact.typeInfo.hasPreview;
|
|
54
|
+
}, [artifact.typeInfo.hasPreview]);
|
|
55
|
+
const mapArtifactMimeType = (0, react_1.useCallback)((mimeType) => {
|
|
56
|
+
return artifact_types_1.SUPPORTED_MIME_TYPES[mimeType].mimeType;
|
|
57
|
+
}, []);
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "memori-artifact-preview", children: [hasPreview && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-artifact-tabs", children: [(0, jsx_runtime_1.jsxs)(Button_1.default, { onClick: () => handleTabChange('code'), className: (0, classnames_1.default)('memori-artifact-tab', {
|
|
59
|
+
'memori-artifact-tab--active': activeTab === 'code',
|
|
60
|
+
}), ghost: true, children: [(0, jsx_runtime_1.jsx)(Code_1.default, { className: "memori-artifact-tab-icon" }), (0, jsx_runtime_1.jsx)("span", { className: "memori-artifact-tab-text", children: t('artifact.code', 'Code') })] }), (0, jsx_runtime_1.jsxs)(Button_1.default, { onClick: () => handleTabChange('preview'), className: (0, classnames_1.default)('memori-artifact-tab', {
|
|
61
|
+
'memori-artifact-tab--active': activeTab === 'preview',
|
|
62
|
+
}), ghost: true, children: [(0, jsx_runtime_1.jsx)(Preview_1.PreviewIcon, { className: "memori-artifact-tab-icon" }), (0, jsx_runtime_1.jsx)("span", { className: "memori-artifact-tab-text", children: t('artifact.preview', 'Preview') })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "memori-artifact-content", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('memori-artifact-tab-content', {
|
|
63
|
+
'memori-artifact-tab-content--active': activeTab === 'code' || !hasPreview,
|
|
64
|
+
}), children: (0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-code", children: (0, jsx_runtime_1.jsx)(Snippet_1.default, { medium: {
|
|
65
|
+
mediumID: artifact.id,
|
|
66
|
+
mimeType: mapArtifactMimeType(artifact.mimeType),
|
|
67
|
+
content: artifact.content,
|
|
68
|
+
title: artifact.title,
|
|
69
|
+
creationTimestamp: artifact.timestamp.toISOString(),
|
|
70
|
+
creationName: 'System',
|
|
71
|
+
lastChangeTimestamp: artifact.timestamp.toISOString(),
|
|
72
|
+
lastChangeName: 'System',
|
|
73
|
+
} }) }) }), hasPreview && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('memori-artifact-tab-content', {
|
|
74
|
+
'memori-artifact-tab-content--active': activeTab === 'preview',
|
|
75
|
+
}), children: (0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-content", children: renderPreview() }) }))] })] }));
|
|
76
|
+
};
|
|
77
|
+
exports.default = ArtifactPreview;
|
|
78
|
+
//# sourceMappingURL=ArtifactPreview.js.map
|
package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactPreview.js","sourceRoot":"","sources":["../../../../../src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ArtifactSystemConfig, ArtifactSystemHook } from '../types/artifact.types';
|
|
3
|
+
interface ArtifactSystemContextType extends ArtifactSystemHook {
|
|
4
|
+
}
|
|
5
|
+
declare const ArtifactSystemContext: React.Context<ArtifactSystemContextType | null>;
|
|
6
|
+
interface ArtifactSystemProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
config?: Partial<ArtifactSystemConfig>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ArtifactSystemProvider: React.FC<ArtifactSystemProviderProps>;
|
|
11
|
+
export declare const useArtifactSystemContext: () => ArtifactSystemContextType;
|
|
12
|
+
export { ArtifactSystemContext };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArtifactSystemContext = exports.useArtifactSystemContext = exports.ArtifactSystemProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const useArtifactSystem_1 = require("../hooks/useArtifactSystem");
|
|
7
|
+
const ArtifactSystemContext = (0, react_1.createContext)(null);
|
|
8
|
+
exports.ArtifactSystemContext = ArtifactSystemContext;
|
|
9
|
+
const ArtifactSystemProvider = ({ children, config = {} }) => {
|
|
10
|
+
const artifactSystem = (0, useArtifactSystem_1.useArtifactSystem)(config);
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(ArtifactSystemContext.Provider, { value: artifactSystem, children: children }));
|
|
12
|
+
};
|
|
13
|
+
exports.ArtifactSystemProvider = ArtifactSystemProvider;
|
|
14
|
+
const useArtifactSystemContext = () => {
|
|
15
|
+
const context = (0, react_1.useContext)(ArtifactSystemContext);
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error('useArtifactSystemContext must be used within an ArtifactSystemProvider');
|
|
18
|
+
}
|
|
19
|
+
return context;
|
|
20
|
+
};
|
|
21
|
+
exports.useArtifactSystemContext = useArtifactSystemContext;
|
|
22
|
+
//# sourceMappingURL=ArtifactSystemContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactSystemContext.js","sourceRoot":"","sources":["../../../../src/components/MemoriArtifactSystem/context/ArtifactSystemContext.tsx"],"names":[],"mappings":";;;;AAKA,iCAAoE;AAOpE,kEAA+D;AAQ/D,MAAM,qBAAqB,GAAG,IAAA,qBAAa,EAAmC,IAAI,CAAC,CAAC;AAoC3E,sDAAqB;AA3BvB,MAAM,sBAAsB,GAA0C,CAAC,EAC5E,QAAQ,EACR,MAAM,GAAG,EAAE,EACZ,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,IAAA,qCAAiB,EAAC,MAAM,CAAC,CAAC;IAEjD,OAAO,CACL,uBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,cAAc,YAClD,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC;AAGK,MAAM,wBAAwB,GAAG,GAA8B,EAAE;IACtE,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,qBAAqB,CAAC,CAAC;IAElD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArtifactSystemConfig, ArtifactSystemHook, ArtifactData } from '../types/artifact.types';
|
|
2
|
+
export declare const useArtifactSystem: (config?: Partial<ArtifactSystemConfig>) => ArtifactSystemHook;
|
|
3
|
+
export declare const useArtifactCreator: () => {
|
|
4
|
+
createArtifact: (content: string, mimeType: string, customTitle?: string, messageID?: string) => ArtifactData;
|
|
5
|
+
};
|
|
6
|
+
export declare const useArtifactProcessor: () => {
|
|
7
|
+
processArtifactContent: (emission: string, onArtifactFound: (content: string, mimeType: string, title?: string) => void) => boolean;
|
|
8
|
+
processedArtifacts: Set<string>;
|
|
9
|
+
};
|
|
10
|
+
export declare const useArtifactDetector: () => {
|
|
11
|
+
hasArtifacts: (messageText: string) => boolean;
|
|
12
|
+
};
|