@memori.ai/memori-react 9.0.0-alpha.21 → 9.0.0-alpha.22
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 +18 -0
- package/dist/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/dist/components/Auth/Auth.css +12 -5
- package/dist/components/Auth/Auth.d.ts +1 -1
- package/dist/components/Auth/Auth.js +46 -32
- package/dist/components/Auth/Auth.js.map +1 -1
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/dist/components/Chat/Chat.css +1 -0
- package/dist/components/Chat/Chat.js +1 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/ChatBubble/ChatBubble.css +32 -5
- package/dist/components/ChatBubble/ChatBubble.js +2 -4
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
- package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.js +10 -1
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/ChatTextArea/ChatTextArea.css +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/dist/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/dist/components/Header/Header.css +8 -3
- package/dist/components/Header/Header.js +15 -18
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/KnownFacts/KnownFacts.css +1 -1
- package/dist/components/KnownFacts/KnownFacts.js +2 -5
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
- package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
- package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +35 -31
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/dist/components/PositionPopover/PositionPopover.css +3 -3
- package/dist/components/PositionPopover/PositionPopover.js +38 -25
- package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
- package/dist/components/Snippet/Snippet.css +1 -1
- package/dist/components/StartPanel/StartPanel.css +19 -3
- package/dist/components/StartPanel/StartPanel.js +12 -18
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/dist/components/layouts/totem.css +43 -9
- package/dist/helpers/positionPopover.d.ts +2 -1
- package/dist/helpers/positionPopover.js +10 -2
- package/dist/helpers/positionPopover.js.map +1 -1
- package/dist/icons/MemoriIcon.js +1 -1
- package/dist/icons/MemoriIcon.js.map +1 -1
- package/dist/locales/de.json +4 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/es.json +3 -1
- package/dist/locales/fr.json +3 -1
- package/dist/locales/it.json +3 -1
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
- package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
- package/esm/components/Auth/Auth.css +12 -5
- package/esm/components/Auth/Auth.d.ts +1 -1
- package/esm/components/Auth/Auth.js +47 -33
- package/esm/components/Auth/Auth.js.map +1 -1
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/esm/components/Chat/Chat.css +1 -0
- package/esm/components/Chat/Chat.js +1 -1
- package/esm/components/Chat/Chat.js.map +1 -1
- package/esm/components/ChatBubble/ChatBubble.css +32 -5
- package/esm/components/ChatBubble/ChatBubble.js +2 -4
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
- package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.js +11 -2
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
- package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
- package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/esm/components/Header/Header.css +8 -3
- package/esm/components/Header/Header.js +15 -18
- package/esm/components/Header/Header.js.map +1 -1
- package/esm/components/IconButton/IconButton.d.ts +1 -1
- package/esm/components/KnownFacts/KnownFacts.css +1 -1
- package/esm/components/KnownFacts/KnownFacts.js +2 -5
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
- package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
- package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +36 -32
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/esm/components/PositionPopover/PositionPopover.css +3 -3
- package/esm/components/PositionPopover/PositionPopover.js +39 -26
- package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
- package/esm/components/Snippet/Snippet.css +1 -1
- package/esm/components/StartPanel/StartPanel.css +19 -3
- package/esm/components/StartPanel/StartPanel.js +12 -18
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/esm/components/layouts/totem.css +43 -9
- package/esm/helpers/positionPopover.d.ts +2 -1
- package/esm/helpers/positionPopover.js +9 -2
- package/esm/helpers/positionPopover.js.map +1 -1
- package/esm/icons/MemoriIcon.js +1 -1
- package/esm/icons/MemoriIcon.js.map +1 -1
- package/esm/locales/de.json +4 -1
- package/esm/locales/en.json +3 -1
- package/esm/locales/es.json +3 -1
- package/esm/locales/fr.json +3 -1
- package/esm/locales/it.json +3 -1
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +5 -3
- package/src/Live/Agents.stories.tsx +49 -0
- package/src/Live/KnownFacts.stories.tsx +50 -0
- package/src/Showcase.stories.tsx +3 -14
- package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
- package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
- package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
- package/src/components/Auth/Auth.css +12 -5
- package/src/components/Auth/Auth.stories.tsx +1 -1
- package/src/components/Auth/Auth.test.tsx +68 -1
- package/src/components/Auth/Auth.tsx +69 -54
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -18
- package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
- package/src/components/Blob/Blob.stories.tsx +1 -1
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
- package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
- package/src/components/Chat/Chat.css +1 -0
- package/src/components/Chat/Chat.stories.tsx +61 -7
- package/src/components/Chat/Chat.tsx +1 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +80 -80
- package/src/components/ChatBubble/ChatBubble.css +32 -5
- package/src/components/ChatBubble/ChatBubble.stories.tsx +13 -2
- package/src/components/ChatBubble/ChatBubble.test.tsx +21 -1
- package/src/components/ChatBubble/ChatBubble.tsx +7 -13
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +158 -185
- package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
- package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
- package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
- package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
- package/src/components/ChatInputs/ChatInputs.tsx +12 -2
- package/src/components/ChatTextArea/ChatTextArea.css +1 -1
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
- package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
- package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
- package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
- package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
- package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
- package/src/components/Header/Header.css +8 -3
- package/src/components/Header/Header.stories.tsx +1 -1
- package/src/components/Header/Header.tsx +146 -117
- package/src/components/KnownFacts/KnownFacts.css +1 -1
- package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
- package/src/components/KnownFacts/KnownFacts.tsx +4 -9
- package/src/components/LoginDrawer/LoginDrawer.css +16 -14
- package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
- package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
- package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
- package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
- package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
- package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
- package/src/components/MemoriWidget/MemoriWidget.tsx +49 -44
- package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
- package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
- package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
- package/src/components/PositionPopover/PositionPopover.css +3 -3
- package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
- package/src/components/PositionPopover/PositionPopover.tsx +50 -28
- package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
- package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
- package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
- package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
- package/src/components/Snippet/Snippet.css +1 -1
- package/src/components/Snippet/Snippet.stories.tsx +1 -1
- package/src/components/StartPanel/StartPanel.css +19 -3
- package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
- package/src/components/StartPanel/StartPanel.tsx +22 -35
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
- package/src/components/Typing/Typing.stories.tsx +1 -1
- package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
- package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
- package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
- package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
- package/src/components/layouts/layouts.stories.tsx +96 -179
- package/src/components/layouts/totem.css +43 -9
- package/src/helpers/positionPopover.test.ts +36 -1
- package/src/helpers/positionPopover.ts +21 -4
- package/src/i18n.knownFacts.test.ts +40 -0
- package/src/icons/MemoriIcon.tsx +1 -1
- package/src/index.stories.tsx +1 -47
- package/src/locales/de.json +4 -1
- package/src/locales/en.json +3 -1
- package/src/locales/es.json +3 -1
- package/src/locales/fr.json +3 -1
- package/src/locales/it.json +3 -1
- package/src/styles.css +13 -27
- package/src/version.ts +1 -1
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
- package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
- package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
- package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
- package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
- package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
|
@@ -180,6 +180,11 @@
|
|
|
180
180
|
internal scroll instead of pushing the scene up. */
|
|
181
181
|
.memori-totem-layout--controls {
|
|
182
182
|
z-index: 100;
|
|
183
|
+
display: flex;
|
|
184
|
+
width: 100%;
|
|
185
|
+
min-height: 0;
|
|
186
|
+
max-height: 48vh;
|
|
187
|
+
flex-direction: column;
|
|
183
188
|
flex-shrink: 0;
|
|
184
189
|
}
|
|
185
190
|
|
|
@@ -187,6 +192,8 @@
|
|
|
187
192
|
SECTION 2–3 — Single unified panel + shared alignment axis
|
|
188
193
|
One container (surface + 1px border + 12px radius). Inner sections have
|
|
189
194
|
NO border/shadow/width of their own, only 1px dividers between them.
|
|
195
|
+
A definite height (not just max-height) is required so nested overflow-y
|
|
196
|
+
auto actually scrolls instead of clipping.
|
|
190
197
|
========================================================================== */
|
|
191
198
|
.memori-totem-layout--controls .memori-chat--wrapper,
|
|
192
199
|
.memori-totem-layout--controls .memori--start-panel {
|
|
@@ -194,8 +201,11 @@
|
|
|
194
201
|
overflow: hidden;
|
|
195
202
|
width: 100%;
|
|
196
203
|
max-width: var(--memori-totem-max-width, 600px);
|
|
204
|
+
height: 48vh;
|
|
205
|
+
min-height: 0;
|
|
197
206
|
max-height: 48vh;
|
|
198
207
|
box-sizing: border-box;
|
|
208
|
+
flex: 1 1 auto;
|
|
199
209
|
flex-direction: column;
|
|
200
210
|
padding: 0;
|
|
201
211
|
border: 1px solid var(--memori-border-color);
|
|
@@ -206,34 +216,53 @@
|
|
|
206
216
|
|
|
207
217
|
/* Nested conversation column must not add its own axis/padding/surface. */
|
|
208
218
|
.memori-totem-layout--controls .memori-conversation-column {
|
|
219
|
+
display: flex;
|
|
220
|
+
overflow: hidden;
|
|
209
221
|
width: 100%;
|
|
210
222
|
max-width: none;
|
|
211
223
|
height: auto;
|
|
212
224
|
min-height: 0;
|
|
225
|
+
flex: 1 1 0%;
|
|
226
|
+
flex-direction: column;
|
|
213
227
|
padding: 0;
|
|
214
228
|
margin: 0;
|
|
215
229
|
}
|
|
216
230
|
|
|
217
|
-
/* Messages section:
|
|
218
|
-
.memori-totem-layout--controls .memori-chat--history
|
|
219
|
-
|
|
231
|
+
/* Messages section: remaining panel height; children must not size to content. */
|
|
232
|
+
.memori-totem-layout--controls .memori-chat--history,
|
|
233
|
+
.memori-totem-layout--controls .memori-chat--history.memori-chat--history-touch {
|
|
234
|
+
display: flex;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
height: auto !important;
|
|
220
237
|
min-height: 0;
|
|
221
|
-
flex: 1 1
|
|
238
|
+
flex: 1 1 0%;
|
|
239
|
+
flex-direction: column;
|
|
222
240
|
border: none;
|
|
223
241
|
border-radius: 0;
|
|
224
242
|
margin: 0;
|
|
225
243
|
background: transparent;
|
|
226
244
|
}
|
|
227
245
|
|
|
228
|
-
.memori-totem-layout--controls .memori-chat--content
|
|
229
|
-
|
|
246
|
+
.memori-totem-layout--controls .memori-chat--content,
|
|
247
|
+
.memori-totem-layout--controls .memori-chat--content.memori-chat--content-touch {
|
|
248
|
+
height: 0;
|
|
249
|
+
min-height: 0;
|
|
230
250
|
max-height: none;
|
|
251
|
+
flex: 1 1 auto;
|
|
231
252
|
padding: var(--memori-spacing-md);
|
|
232
253
|
background: transparent;
|
|
254
|
+
overflow-x: hidden;
|
|
255
|
+
overflow-y: auto;
|
|
256
|
+
overscroll-behavior: contain;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.memori-totem-layout--controls .memori-chat--content > * {
|
|
260
|
+
flex-shrink: 0;
|
|
233
261
|
}
|
|
234
262
|
|
|
235
263
|
/* Input section: 1px divider above, no own surface. */
|
|
236
264
|
.memori-totem-layout--controls .memori-chat-inputs-wrapper {
|
|
265
|
+
flex-shrink: 0;
|
|
237
266
|
padding: var(--memori-spacing-md);
|
|
238
267
|
border-top: 1px solid var(--memori-border-color);
|
|
239
268
|
background: transparent;
|
|
@@ -244,10 +273,15 @@
|
|
|
244
273
|
border-radius: 8px;
|
|
245
274
|
}
|
|
246
275
|
|
|
276
|
+
.memori-totem-layout--controls .memori-chat--bubble,
|
|
277
|
+
.memori-totem-layout--controls .memori-chat--bubble.memori-chat--user-bubble {
|
|
278
|
+
font-size: 1.125rem;
|
|
279
|
+
}
|
|
280
|
+
|
|
247
281
|
/* Start-panel body scrolls internally instead of stretching the panel. */
|
|
248
282
|
.memori-totem-layout--controls .memori--start-panel__body {
|
|
249
283
|
min-height: 0;
|
|
250
|
-
flex: 1 1
|
|
284
|
+
flex: 1 1 0%;
|
|
251
285
|
overflow-y: auto;
|
|
252
286
|
}
|
|
253
287
|
|
|
@@ -259,11 +293,11 @@
|
|
|
259
293
|
}
|
|
260
294
|
|
|
261
295
|
@media (max-width: 480px) {
|
|
262
|
-
.memori-totem-
|
|
296
|
+
.memori-totem-layout .memori-send-on-enter-menu {
|
|
263
297
|
display: none;
|
|
264
298
|
}
|
|
265
299
|
|
|
266
|
-
.memori-totem-
|
|
300
|
+
.memori-totem-layout .memori-header--button-settings {
|
|
267
301
|
display: none;
|
|
268
302
|
}
|
|
269
303
|
}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
shouldHoldAutoStartForPosition,
|
|
3
|
+
shouldRestartSessionOnPositionPopoverClose,
|
|
4
|
+
} from './positionPopover';
|
|
5
|
+
|
|
6
|
+
describe('shouldHoldAutoStartForPosition', () => {
|
|
7
|
+
it('holds auto-start when position is required and none is stored', () => {
|
|
8
|
+
expect(shouldHoldAutoStartForPosition(true, false)).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not hold when a position (or skip) is already stored', () => {
|
|
12
|
+
expect(shouldHoldAutoStartForPosition(true, true)).toBe(false);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('does not hold when the agent does not require a position', () => {
|
|
16
|
+
expect(shouldHoldAutoStartForPosition(false, false)).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
2
19
|
|
|
3
20
|
describe('shouldRestartSessionOnPositionPopoverClose', () => {
|
|
4
21
|
it('restarts only when closing an open popover with autoStart and no session', () => {
|
|
@@ -36,4 +53,22 @@ describe('shouldRestartSessionOnPositionPopoverClose', () => {
|
|
|
36
53
|
false
|
|
37
54
|
);
|
|
38
55
|
});
|
|
56
|
+
|
|
57
|
+
it('does not restart when closing without a stored position', () => {
|
|
58
|
+
expect(
|
|
59
|
+
shouldRestartSessionOnPositionPopoverClose(
|
|
60
|
+
true,
|
|
61
|
+
false,
|
|
62
|
+
true,
|
|
63
|
+
false,
|
|
64
|
+
false
|
|
65
|
+
)
|
|
66
|
+
).toBe(false);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('restarts when closing after a position was stored', () => {
|
|
70
|
+
expect(
|
|
71
|
+
shouldRestartSessionOnPositionPopoverClose(true, false, true, false, true)
|
|
72
|
+
).toBe(true);
|
|
73
|
+
});
|
|
39
74
|
});
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-start must wait on the start panel when the agent requires a location
|
|
3
|
+
* and none has been stored yet (share or skip). The start panel is the place
|
|
4
|
+
* to collect that preference; do not open the header popover instead.
|
|
5
|
+
*/
|
|
6
|
+
export function shouldHoldAutoStartForPosition(
|
|
7
|
+
needsPosition: boolean,
|
|
8
|
+
hasPosition: boolean
|
|
9
|
+
): boolean {
|
|
10
|
+
return !!needsPosition && !hasPosition;
|
|
11
|
+
}
|
|
12
|
+
|
|
1
13
|
/**
|
|
2
14
|
* Whether closing the position popover should re-run autoStart (`onClickStart`).
|
|
3
15
|
* Only true on a real open → closed transition when a session has not started yet
|
|
4
|
-
* (
|
|
5
|
-
* must not wipe chat history.
|
|
16
|
+
* and a position (or skip) is already stored. Closing during an active session
|
|
17
|
+
* must not wipe chat history. Closing without a position leaves the start panel.
|
|
6
18
|
*/
|
|
7
19
|
export function shouldRestartSessionOnPositionPopoverClose(
|
|
8
20
|
wasOpen: boolean,
|
|
9
21
|
nextOpen: boolean,
|
|
10
22
|
autoStart: boolean,
|
|
11
|
-
sessionAlreadyStarted = false
|
|
23
|
+
sessionAlreadyStarted = false,
|
|
24
|
+
hasPosition = true
|
|
12
25
|
): boolean {
|
|
13
26
|
return (
|
|
14
|
-
wasOpen &&
|
|
27
|
+
wasOpen &&
|
|
28
|
+
!nextOpen &&
|
|
29
|
+
!!autoStart &&
|
|
30
|
+
!sessionAlreadyStarted &&
|
|
31
|
+
hasPosition
|
|
15
32
|
);
|
|
16
33
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import i18n from './i18n';
|
|
2
|
+
|
|
3
|
+
describe('known facts bulk delete translations', () => {
|
|
4
|
+
afterEach(async () => {
|
|
5
|
+
await i18n.changeLanguage('en');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('keeps the selected-rows count in the same language as the confirm message', async () => {
|
|
9
|
+
await i18n.changeLanguage('it');
|
|
10
|
+
|
|
11
|
+
const selectedRows = i18n.t('knownFacts.selectedRows', { count: 10 });
|
|
12
|
+
const confirm = i18n.t('knownFacts.deleteSelectedConfirmMessage');
|
|
13
|
+
const message = `${selectedRows}. ${confirm}`;
|
|
14
|
+
|
|
15
|
+
expect(selectedRows).toBe('10 righe selezionate');
|
|
16
|
+
expect(message).not.toMatch(/rows selected/i);
|
|
17
|
+
expect(message).toBe(
|
|
18
|
+
'10 righe selezionate. Confermi di voler eliminare i fatti noti selezionati?'
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it.each([
|
|
23
|
+
['en', 1, '1 row selected'],
|
|
24
|
+
['en', 10, '10 rows selected'],
|
|
25
|
+
['it', 1, '1 riga selezionata'],
|
|
26
|
+
['it', 10, '10 righe selezionate'],
|
|
27
|
+
['fr', 1, '1 ligne sélectionnée'],
|
|
28
|
+
['fr', 10, '10 lignes sélectionnées'],
|
|
29
|
+
['de', 1, '1 Zeile ausgewählt'],
|
|
30
|
+
['de', 10, '10 Zeilen ausgewählt'],
|
|
31
|
+
['es', 1, '1 fila seleccionada'],
|
|
32
|
+
['es', 10, '10 filas seleccionadas'],
|
|
33
|
+
] as const)(
|
|
34
|
+
'translates %s selectedRows for count %i',
|
|
35
|
+
async (lng, count, expected) => {
|
|
36
|
+
await i18n.changeLanguage(lng);
|
|
37
|
+
expect(i18n.t('knownFacts.selectedRows', { count })).toBe(expected);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
});
|
package/src/icons/MemoriIcon.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const MemoriIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
|
12
12
|
<defs>
|
|
13
13
|
<style>
|
|
14
14
|
{
|
|
15
|
-
"\n .cls-1 {\n fill: url(#Sfumatura_senza_nome_6);\n }\n\n .cls-1,\n .cls-2 {\n stroke-width: 0px;\n }\n\n .cls-2 {\n fill: var(--memori-
|
|
15
|
+
"\n .cls-1 {\n fill: url(#Sfumatura_senza_nome_6);\n }\n\n .cls-1,\n .cls-2 {\n stroke-width: 0px;\n }\n\n .cls-2 {\n fill: var(--memori-text-color, '#744c99');\n }\n "
|
|
16
16
|
}
|
|
17
17
|
</style>
|
|
18
18
|
<linearGradient
|
package/src/index.stories.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Meta, Story } from '@storybook/react';
|
|
|
3
3
|
import Memori, { Props } from './index';
|
|
4
4
|
|
|
5
5
|
const meta: Meta = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Live/Functionalities',
|
|
7
7
|
component: Memori,
|
|
8
8
|
argTypes: {
|
|
9
9
|
AZURE_COGNITIVE_SERVICES_TTS_KEY: {
|
|
@@ -88,21 +88,6 @@ WithChatHistory.args = {
|
|
|
88
88
|
showChatHistory: true,
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
export const WithUploadNoTotalPayloadLimit = Template.bind({});
|
|
92
|
-
WithUploadNoTotalPayloadLimit.args = {
|
|
93
|
-
ownerUserName: 'nzambello',
|
|
94
|
-
memoriName: 'Nicola',
|
|
95
|
-
tenantID: 'www.aisuru.com',
|
|
96
|
-
engineURL: 'https://engine.memori.ai',
|
|
97
|
-
apiURL: 'https://backend.memori.ai',
|
|
98
|
-
baseURL: 'https://www.aisuru.com',
|
|
99
|
-
layout: 'FULLPAGE',
|
|
100
|
-
uiLang: 'IT',
|
|
101
|
-
spokenLang: 'IT',
|
|
102
|
-
enableAudio: true,
|
|
103
|
-
showUpload: true,
|
|
104
|
-
};
|
|
105
|
-
|
|
106
91
|
export const WithMaxTextareaCharacters = Template.bind({});
|
|
107
92
|
WithMaxTextareaCharacters.args = {
|
|
108
93
|
ownerUserName: 'nzambello',
|
|
@@ -193,34 +178,3 @@ WithPiiDetection.args = {
|
|
|
193
178
|
},
|
|
194
179
|
};
|
|
195
180
|
|
|
196
|
-
export const WithLocalNats = Template.bind({});
|
|
197
|
-
WithLocalNats.args = {
|
|
198
|
-
memoriName: 'test324',
|
|
199
|
-
ownerUserName: 'andrea.patini',
|
|
200
|
-
memoriID: 'd661a9ca-e907-4396-a986-5095ccd582d6',
|
|
201
|
-
ownerUserID: '69fcc557-9cb6-4e5e-b8ab-140cff975492',
|
|
202
|
-
tenantID: 'localhost:3000',
|
|
203
|
-
engineURL: 'http://localhost:7778/memori/v2',
|
|
204
|
-
apiURL: 'http://localhost:7778/api/v2',
|
|
205
|
-
baseURL: 'http://localhost:3000',
|
|
206
|
-
layout: 'FULLPAGE',
|
|
207
|
-
uiLang: 'IT',
|
|
208
|
-
spokenLang: 'IT',
|
|
209
|
-
integrationID: 'ee1c3d98-7819-4506-ba28-818e79ba86cb',
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export const WithFunctionalities = Template.bind({});
|
|
213
|
-
WithFunctionalities.args = {
|
|
214
|
-
memoriName: 'test324',
|
|
215
|
-
ownerUserName: 'andrea.patini',
|
|
216
|
-
memoriID: 'd661a9ca-e907-4396-a986-5095ccd582d6',
|
|
217
|
-
ownerUserID: '69fcc557-9cb6-4e5e-b8ab-140cff975492',
|
|
218
|
-
tenantID: 'localhost:3000',
|
|
219
|
-
engineURL: 'http://localhost:7778/memori/v2',
|
|
220
|
-
apiURL: 'http://localhost:7778/api/v2',
|
|
221
|
-
baseURL: 'http://localhost:3000',
|
|
222
|
-
layout: 'FULLPAGE',
|
|
223
|
-
uiLang: 'IT',
|
|
224
|
-
spokenLang: 'IT',
|
|
225
|
-
integrationID: 'ee1c3d98-7819-4506-ba28-818e79ba86cb',
|
|
226
|
-
};
|
package/src/locales/de.json
CHANGED
|
@@ -116,7 +116,9 @@
|
|
|
116
116
|
"deleteConfirmTitle": "Bekannte Tatsache löschen",
|
|
117
117
|
"deleteConfirmMessage": "Sind Sie sicher, dass Sie diese bekannte Tatsache löschen möchten?",
|
|
118
118
|
"deleteSelectedConfirmTitle": "Ausgewählte bekannte Fakten löschen",
|
|
119
|
-
"deleteSelectedConfirmMessage": "Sind Sie sicher, dass Sie die ausgewählten bekannten Fakten löschen möchten?"
|
|
119
|
+
"deleteSelectedConfirmMessage": "Sind Sie sicher, dass Sie die ausgewählten bekannten Fakten löschen möchten?",
|
|
120
|
+
"selectedRows_one": "{{count}} Zeile ausgewählt",
|
|
121
|
+
"selectedRows_other": "{{count}} Zeilen ausgewählt"
|
|
120
122
|
},
|
|
121
123
|
"auth": {
|
|
122
124
|
"title": "Authentifizierung",
|
|
@@ -411,6 +413,7 @@
|
|
|
411
413
|
"otpTimer": "Code läuft in {{seconds}} Sekunden ab",
|
|
412
414
|
"otpInvalidFormat": "Bitte geben Sie einen gültigen 4-stelligen Code ein",
|
|
413
415
|
"otpInvalid": "Ungültiger Bestätigungscode",
|
|
416
|
+
"otpExpired": "Der Bestätigungscode ist abgelaufen",
|
|
414
417
|
"otpError": "Fehler bei der Code-Validierung. Bitte versuchen Sie es erneut.",
|
|
415
418
|
"otpSuccess": "Anmeldung erfolgreich!",
|
|
416
419
|
"password": "Passwort",
|
package/src/locales/en.json
CHANGED
|
@@ -118,7 +118,9 @@
|
|
|
118
118
|
"deleteConfirmTitle": "Delete known fact",
|
|
119
119
|
"deleteConfirmMessage": "Are you sure you want to delete this known fact?",
|
|
120
120
|
"deleteSelectedConfirmTitle": "Delete selected known facts",
|
|
121
|
-
"deleteSelectedConfirmMessage": "Are you sure you want to delete the selected known facts?"
|
|
121
|
+
"deleteSelectedConfirmMessage": "Are you sure you want to delete the selected known facts?",
|
|
122
|
+
"selectedRows_one": "{{count}} row selected",
|
|
123
|
+
"selectedRows_other": "{{count}} rows selected"
|
|
122
124
|
},
|
|
123
125
|
"auth": {
|
|
124
126
|
"title": "Authentication",
|
package/src/locales/es.json
CHANGED
|
@@ -116,7 +116,9 @@
|
|
|
116
116
|
"deleteConfirmTitle": "Eliminar hecho conocido",
|
|
117
117
|
"deleteConfirmMessage": "¿Está seguro de que desea eliminar este hecho conocido?",
|
|
118
118
|
"deleteSelectedConfirmTitle": "Eliminar hechos conocidos seleccionados",
|
|
119
|
-
"deleteSelectedConfirmMessage": "¿Está seguro de que desea eliminar los hechos conocidos seleccionados?"
|
|
119
|
+
"deleteSelectedConfirmMessage": "¿Está seguro de que desea eliminar los hechos conocidos seleccionados?",
|
|
120
|
+
"selectedRows_one": "{{count}} fila seleccionada",
|
|
121
|
+
"selectedRows_other": "{{count}} filas seleccionadas"
|
|
120
122
|
},
|
|
121
123
|
"auth": {
|
|
122
124
|
"title": "Autenticación",
|
package/src/locales/fr.json
CHANGED
|
@@ -115,7 +115,9 @@
|
|
|
115
115
|
"deleteConfirmTitle": "Supprimer un fait connu",
|
|
116
116
|
"deleteConfirmMessage": "Êtes-vous sûr de vouloir supprimer ce fait connu ?",
|
|
117
117
|
"deleteSelectedConfirmTitle": "Supprimer les faits connus sélectionnés",
|
|
118
|
-
"deleteSelectedConfirmMessage": "Etes-vous sûr de vouloir supprimer les faits connus sélectionnés ?"
|
|
118
|
+
"deleteSelectedConfirmMessage": "Etes-vous sûr de vouloir supprimer les faits connus sélectionnés ?",
|
|
119
|
+
"selectedRows_one": "{{count}} ligne sélectionnée",
|
|
120
|
+
"selectedRows_other": "{{count}} lignes sélectionnées"
|
|
119
121
|
},
|
|
120
122
|
"auth": {
|
|
121
123
|
"title": "Authentification",
|
package/src/locales/it.json
CHANGED
|
@@ -119,7 +119,9 @@
|
|
|
119
119
|
"deleteConfirmTitle": "Elimina il fatto noto",
|
|
120
120
|
"deleteConfirmMessage": "Confermi di voler eliminare questo fatto noto?",
|
|
121
121
|
"deleteSelectedConfirmTitle": "Elimina i fatti noti selezionati",
|
|
122
|
-
"deleteSelectedConfirmMessage": "Confermi di voler eliminare i fatti noti selezionati?"
|
|
122
|
+
"deleteSelectedConfirmMessage": "Confermi di voler eliminare i fatti noti selezionati?",
|
|
123
|
+
"selectedRows_one": "{{count}} riga selezionata",
|
|
124
|
+
"selectedRows_other": "{{count}} righe selezionate"
|
|
123
125
|
},
|
|
124
126
|
"auth": {
|
|
125
127
|
"title": "Autenticazione",
|
package/src/styles.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
MEMORI REACT – FOGLIO DI STILE GLOBALE
|
|
3
3
|
========================================================================== */
|
|
4
|
-
/* Layer order: theme
|
|
5
|
-
@layer theme,
|
|
4
|
+
/* Layer order matches @memori.ai/ui: theme < components < host overrides */
|
|
5
|
+
@layer memori.theme, memori.components, memori.overrides;
|
|
6
6
|
|
|
7
7
|
/* --- 1. Design system esterno (variabili, reset, token) ---
|
|
8
8
|
NOTE: the bundler-style specifier below is intentional for dev/Storybook.
|
|
@@ -113,6 +113,11 @@
|
|
|
113
113
|
flex-direction: column;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/*
|
|
117
|
+
* Nested dialogs: use Modal stacking="stacked" from @memori.ai/ui (z-index 1600).
|
|
118
|
+
* Do not reintroduce max int z-index overrides here.
|
|
119
|
+
*/
|
|
120
|
+
|
|
116
121
|
.memori.memori-widget.memori-layout-chat > .memori-widget__surface,
|
|
117
122
|
.memori.memori-widget.memori-layout-fullpage > .memori-widget__surface,
|
|
118
123
|
.memori.memori-widget.memori-layout-zoomed_full_body > .memori-widget__surface {
|
|
@@ -122,6 +127,7 @@
|
|
|
122
127
|
/* After inserting .memori-widget__surface, Spin is no longer a direct child of
|
|
123
128
|
.memori-widget — keep it a stretching flex column so fullpage/chat fill the viewport. */
|
|
124
129
|
.memori-widget > .memori-widget__surface > .memori-spin {
|
|
130
|
+
position: relative;
|
|
125
131
|
display: flex !important;
|
|
126
132
|
overflow: hidden;
|
|
127
133
|
width: 100%;
|
|
@@ -142,8 +148,8 @@
|
|
|
142
148
|
flex-shrink: 0;
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
/* --- 6. Base: brand e tema di default (in layer così
|
|
146
|
-
@layer
|
|
151
|
+
/* --- 6. Base: brand e tema di default (in layer così overrides possono sovrascrivere --memori-primary) --- */
|
|
152
|
+
@layer memori.overrides {
|
|
147
153
|
:root,
|
|
148
154
|
body,
|
|
149
155
|
memori-client,
|
|
@@ -172,15 +178,14 @@
|
|
|
172
178
|
background-color: var(--memori-secondary-background);
|
|
173
179
|
}
|
|
174
180
|
|
|
175
|
-
/* --- 8. Dark mode:
|
|
176
|
-
@layer
|
|
181
|
+
/* --- 8. Dark mode: surface contrast only — keep --memori-primary on the brand hook --- */
|
|
182
|
+
@layer memori.overrides {
|
|
177
183
|
[data-theme='dark'] memori-client,
|
|
178
184
|
[data-theme='dark'] memori-client #root,
|
|
179
185
|
[data-theme='dark'] #headlessui-portal-root,
|
|
180
186
|
[data-theme='dark'] .memori-widget,
|
|
181
187
|
memori-client[data-theme='dark'],
|
|
182
188
|
.memori-widget[data-theme='dark'] {
|
|
183
|
-
--memori-primary: var(--memori-primary-hover);
|
|
184
189
|
/* Align with @memori.ai/ui: contrast = ink, inverse = surface */
|
|
185
190
|
--memori-surface-contrast: #fff;
|
|
186
191
|
--memori-surface-contrast-inverse: #000;
|
|
@@ -200,26 +205,7 @@
|
|
|
200
205
|
);
|
|
201
206
|
} */
|
|
202
207
|
|
|
203
|
-
/*
|
|
204
|
-
* Both layouts park their UI in position:fixed children, so .memori-widget
|
|
205
|
-
* (MemoriUIProvider portal root) often collapses to a near-zero in-flow box.
|
|
206
|
-
* Base UI tooltips position with position:absolute inside that root, so the
|
|
207
|
-
* popup shrink-to-fits to a tiny width and overflow-wrap:anywhere (from
|
|
208
|
-
* @memori.ai/ui) stacks each letter vertically. Force content-sized popups. */
|
|
209
|
-
.memori-widget.memori-layout-hidden_chat .memori-tooltip__popup,
|
|
210
|
-
.memori-widget.memori-layout-website_assistant .memori-tooltip__popup {
|
|
211
|
-
width: max-content;
|
|
212
|
-
max-width: min(20rem, calc(100vw - 2rem));
|
|
213
|
-
overflow-wrap: break-word;
|
|
214
|
-
text-orientation: mixed;
|
|
215
|
-
word-break: normal;
|
|
216
|
-
writing-mode: horizontal-tb;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.memori-widget.memori-layout-hidden_chat .memori-tooltip__surface,
|
|
220
|
-
.memori-widget.memori-layout-website_assistant .memori-tooltip__surface {
|
|
221
|
-
max-width: none;
|
|
222
|
-
}
|
|
208
|
+
/* Tooltip width/wrap is fixed in @memori.ai/ui 1.17 — no consumer patch. */
|
|
223
209
|
|
|
224
210
|
/* --- 11. Utility responsive --- */
|
|
225
211
|
@media (max-width: 768px) {
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const version = '9.0.0-alpha.
|
|
2
|
+
export const version = '9.0.0-alpha.22';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import ChatTextArea, { Props } from './ChatTextArea';
|
|
4
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
5
|
-
import './ChatTextArea.css';
|
|
6
|
-
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: 'Widget/Chat textarea',
|
|
9
|
-
component: ChatTextArea,
|
|
10
|
-
argTypes: {
|
|
11
|
-
disabled: {
|
|
12
|
-
control: {
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
parameters: {
|
|
18
|
-
controls: { expanded: true },
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
const Template: Story<Props> = args => {
|
|
25
|
-
const [userMessage, setUserMessage] = React.useState(args.value);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<I18nWrapper>
|
|
29
|
-
<div style={{ paddingTop: '10rem' }}>
|
|
30
|
-
<ChatTextArea {...args} value={userMessage} onChange={setUserMessage} />
|
|
31
|
-
</div>
|
|
32
|
-
</I18nWrapper>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
37
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
38
|
-
export const Default = Template.bind({});
|
|
39
|
-
Default.args = {
|
|
40
|
-
value: '',
|
|
41
|
-
onChange: () => {},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const WithValue = Template.bind({});
|
|
45
|
-
WithValue.args = {
|
|
46
|
-
value: 'Suspendisse sit amet volutpat velit.',
|
|
47
|
-
onChange: () => {},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const WithLongText = Template.bind({});
|
|
51
|
-
WithLongText.args = {
|
|
52
|
-
value:
|
|
53
|
-
'Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur.',
|
|
54
|
-
onChange: () => {},
|
|
55
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import ModelViewer, { Props } from './ModelViewer';
|
|
4
|
-
import './ModelViewer.css';
|
|
5
|
-
|
|
6
|
-
const meta: Meta = {
|
|
7
|
-
title: 'Custom GLB Avatar',
|
|
8
|
-
component: ModelViewer,
|
|
9
|
-
argTypes: {
|
|
10
|
-
src: {
|
|
11
|
-
control: {
|
|
12
|
-
type: 'text',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
poster: {
|
|
16
|
-
control: {
|
|
17
|
-
type: 'text',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
alt: {
|
|
21
|
-
control: {
|
|
22
|
-
type: 'text',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
parameters: {
|
|
27
|
-
controls: { expanded: true },
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default meta;
|
|
32
|
-
|
|
33
|
-
const Template: Story<Props> = args => {
|
|
34
|
-
const [hydrated, setHydrated] = React.useState(false);
|
|
35
|
-
React.useEffect(() => {
|
|
36
|
-
setHydrated(true);
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
return hydrated ? (
|
|
40
|
-
<ModelViewer
|
|
41
|
-
{...args}
|
|
42
|
-
src={args.src + `#${new Date(Date.now()).toISOString()}`}
|
|
43
|
-
key={Date.now()}
|
|
44
|
-
/>
|
|
45
|
-
) : (
|
|
46
|
-
<></>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
51
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
52
|
-
export const Default = Template.bind({});
|
|
53
|
-
Default.args = {
|
|
54
|
-
alt: '',
|
|
55
|
-
src: 'https://assets.memori.ai/api/v2/asset/7383f05a-0788-49b0-b9b9-3bfc402c7ddf.glb#1669136149862',
|
|
56
|
-
poster:
|
|
57
|
-
'https://assets.memori.ai/api/v2/asset/596382ce-381a-4a66-9740-c7adc3bfa4a8.png',
|
|
58
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
|
-
import DateSelector, { Props } from './DateSelector';
|
|
5
|
-
|
|
6
|
-
import './DateSelector.css';
|
|
7
|
-
|
|
8
|
-
const meta: Meta = {
|
|
9
|
-
title: 'DateSelector',
|
|
10
|
-
component: DateSelector,
|
|
11
|
-
parameters: {
|
|
12
|
-
controls: { expanded: true },
|
|
13
|
-
layout: 'fullscreen',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
|
|
19
|
-
const Template: Story<Props> = args => (
|
|
20
|
-
<I18nWrapper>
|
|
21
|
-
<DateSelector {...args} />
|
|
22
|
-
</I18nWrapper>
|
|
23
|
-
);
|
|
24
|
-
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
|
|
25
|
-
// https://storybook.js.org/docs/react/workflows/unit-testing
|
|
26
|
-
export const Default = Template.bind({});
|
|
27
|
-
Default.args = {
|
|
28
|
-
defaultDate: '1990-06-15',
|
|
29
|
-
minAge: 18,
|
|
30
|
-
onChange: console.log,
|
|
31
|
-
disabled: false,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const MinAge14 = Template.bind({});
|
|
35
|
-
MinAge14.args = {
|
|
36
|
-
minAge: 14,
|
|
37
|
-
onChange: console.log,
|
|
38
|
-
disabled: false,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Disabled = Template.bind({});
|
|
42
|
-
Disabled.args = {
|
|
43
|
-
defaultDate: '1990-06-15',
|
|
44
|
-
minAge: 18,
|
|
45
|
-
onChange: () => {},
|
|
46
|
-
disabled: true,
|
|
47
|
-
};
|