quickblox-react-ui-kit 0.4.4-alpha.5 → 0.4.5-beta.2
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/.storybook/main.ts +91 -19
- package/.storybook/preview.ts +6 -1
- package/babel.config.js +7 -0
- package/dist/App.d.ts.map +1 -1
- package/dist/Data/Creator.d.ts.map +1 -1
- package/dist/Data/mapper/DialogRemoteDTOMapper.d.ts.map +1 -1
- package/dist/Data/repository/ConnectionRepository.d.ts.map +1 -1
- package/dist/Data/repository/DialogsRepository.d.ts +2 -1
- package/dist/Data/repository/DialogsRepository.d.ts.map +1 -1
- package/dist/Data/source/remote/IRemoteDataSource.d.ts +2 -1
- package/dist/Data/source/remote/IRemoteDataSource.d.ts.map +1 -1
- package/dist/Data/source/remote/Mapper/FileDTOMapper.d.ts.map +1 -1
- package/dist/Data/source/remote/Mapper/MessageDTOMapper.d.ts.map +1 -1
- package/dist/Data/source/remote/RemoteDataSource.d.ts +7 -1
- package/dist/Data/source/remote/RemoteDataSource.d.ts.map +1 -1
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts +3 -1
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts.map +1 -1
- package/dist/Presentation/Views/Dialog/useDialogViewModel.d.ts.map +1 -1
- package/dist/Presentation/Views/DialogList/useDialogListViewModel.d.ts.map +1 -1
- package/dist/Presentation/Views/PreviewDialog/PreviewDialog.d.ts.map +1 -1
- package/dist/Presentation/icons/contents/index.d.ts.map +1 -1
- package/dist/Presentation/icons/index.d.ts +1 -1
- package/dist/Presentation/icons/index.d.ts.map +1 -1
- package/dist/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Button/Button.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Button/Button.stories.d.ts +4 -4
- package/dist/Presentation/ui-components/Button/Button.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/CheckBox/CheckBox.d.ts.map +1 -1
- package/dist/Presentation/ui-components/DialogBanner/DialogBanner.d.ts.map +1 -1
- package/dist/Presentation/ui-components/DialogBanner/DialogBanner.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/DialogItemPreview/DialogItemPreview.d.ts.map +1 -1
- package/dist/Presentation/ui-components/DialogWindow/DialogWindow.d.ts +2 -2
- package/dist/Presentation/ui-components/DialogWindow/DialogWindow.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Dropdown/DropdownOption.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Header/Header.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Loader/Loader.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Loader/Loader.stories.d.ts +1 -1
- package/dist/Presentation/ui-components/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Message/FileUrl/FileUrl.d.ts.map +1 -1
- package/dist/Presentation/ui-components/MessageSeparator/MessageSeparator.d.ts.map +1 -1
- package/dist/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.d.ts +1 -1
- package/dist/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Placeholder/Placeholder.d.ts.map +1 -1
- package/dist/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.d.ts.map +1 -1
- package/dist/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/SettingsItem/SettingsItem.d.ts.map +1 -1
- package/dist/Presentation/ui-components/TextField/TextField.d.ts +2 -2
- package/dist/Presentation/ui-components/TextField/TextField.d.ts.map +1 -1
- package/dist/Presentation/ui-components/TextField/TextField.stories.d.ts.map +1 -1
- package/dist/Presentation/ui-components/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/Presentation/ui-components/UserListItem/UserListItem.d.ts.map +1 -1
- package/dist/Presentation/ui-components/UserListItem/UserListItem.stories.d.ts +2 -2
- package/dist/hooks/useQuickBloxUIKit.d.ts.map +1 -1
- package/dist/index-ui.js +78407 -2
- package/dist/qb-api-calls/index.d.ts +4 -1
- package/dist/qb-api-calls/index.d.ts.map +1 -1
- package/package.json +25 -11
- package/src/App.tsx +10 -1
- package/src/Data/Creator.ts +4 -1
- package/src/Data/Stubs.ts +6 -6
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +2 -1
- package/src/Data/repository/ConnectionRepository.ts +6 -2
- package/src/Data/repository/DialogsRepository.ts +3 -1
- package/src/Data/source/remote/IRemoteDataSource.ts +2 -1
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +3 -4
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +3 -1
- package/src/Data/source/remote/RemoteDataSource.ts +128 -12
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +6 -0
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +2 -2
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +40 -22
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +6 -2
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +2 -1
- package/src/Presentation/icons/contents/index.ts +2 -0
- package/src/Presentation/icons/index.ts +17 -1
- package/src/Presentation/layouts/TestStage/LoginView/Login.scss +6 -3
- package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +13 -0
- package/src/Presentation/ui-components/Avatar/Avatar.tsx +3 -0
- package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +3 -1
- package/src/Presentation/ui-components/Badge/Badge.stories.ts +3 -3
- package/src/Presentation/ui-components/Badge/Badge.tsx +1 -1
- package/src/Presentation/ui-components/Button/Button.stories.ts +4 -3
- package/src/Presentation/ui-components/Button/Button.tsx +1 -0
- package/src/Presentation/ui-components/CheckBox/CheckBox.tsx +1 -0
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +1 -1
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.tsx +1 -0
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +7 -5
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +1 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +2 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +2 -2
- package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +3 -2
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +1 -1
- package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +1 -0
- package/src/Presentation/ui-components/Header/Header.scss +5 -0
- package/src/Presentation/ui-components/Header/Header.stories.tsx +1 -0
- package/src/Presentation/ui-components/Header/Header.tsx +1 -1
- package/src/Presentation/ui-components/Loader/Loader.stories.ts +1 -0
- package/src/Presentation/ui-components/Loader/Loader.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +0 -1
- package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +1 -0
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +0 -3
- package/src/Presentation/ui-components/Message/FileUrl/FileUrl.tsx +1 -0
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +1 -0
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.tsx +1 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.scss +5 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +1 -0
- package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +1 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +4 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +3 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +1 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.scss +5 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +1 -0
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.tsx +1 -1
- package/src/Presentation/ui-components/TextField/TextField.stories.ts +3 -2
- package/src/Presentation/ui-components/TextField/TextField.tsx +1 -1
- package/src/Presentation/ui-components/Toast/Toast.stories.tsx +1 -0
- package/src/Presentation/ui-components/Toast/ToastProvider.tsx +1 -1
- package/src/Presentation/ui-components/UserListItem/UserListItem.stories.tsx +3 -3
- package/src/Presentation/ui-components/UserListItem/UserListItem.tsx +1 -0
- package/src/hooks/useQuickBloxUIKit.ts +109 -35
- package/src/qb-api-calls/index.ts +125 -0
- package/webpack.lib.config-debug.js +87 -0
- package/webpack.lib.config-prev.js +64 -0
- package/webpack.lib.config.js +80 -57
- package/dist/00bfe0e9c94dc6dfb230.svg +0 -3
- package/dist/07c8d1fe96b0b8bb5911.svg +0 -3
- package/dist/0c0256f00eeb75770ffc.svg +0 -3
- package/dist/100bd0fff933cbde8ad4.svg +0 -3
- package/dist/124e0351bd0e19ff4c5f.svg +0 -3
- package/dist/133519141541a9cd2f0e.svg +0 -3
- package/dist/17ed65506e902f17bb22.svg +0 -3
- package/dist/194d78057be6cd7968c8.svg +0 -3
- package/dist/19d5305cab6017d494ac.svg +0 -3
- package/dist/1b1a7438cd8eb6fee80e.svg +0 -3
- package/dist/1be3b599e21158807fdf.svg +0 -3
- package/dist/25663e60d71e01c64fdf.svg +0 -3
- package/dist/2785264246d708687179.svg +0 -3
- package/dist/27eb8c32999f10d05d6a.svg +0 -3
- package/dist/287c9b4b3b0e58cb081c.svg +0 -3
- package/dist/2bb9cc89b9f6398b4959.svg +0 -3
- package/dist/2c46a5df6c8397f5b908.svg +0 -3
- package/dist/2eb72391c5267453edb4.svg +0 -3
- package/dist/35619771e645b649c38e.svg +0 -3
- package/dist/40179c472f715fc74d4d.svg +0 -3
- package/dist/40a8b8104c3a448b8110.svg +0 -3
- package/dist/43120a68057427c89c88.svg +0 -3
- package/dist/43c26d404dd023e42aaa.svg +0 -3
- package/dist/43e60427600bcf7fd78f.svg +0 -3
- package/dist/45662989373aa524cd58.svg +0 -3
- package/dist/476c2854d7ad23f2afde.svg +0 -3
- package/dist/4a669a3a8cbd38b3309d.svg +0 -3
- package/dist/4ed9ad54ae110d9760b6.svg +0 -3
- package/dist/5005351d4fa6a7c074dd.svg +0 -3
- package/dist/551171aa8903b31746a5.svg +0 -6
- package/dist/55273926379e5f486ccf.svg +0 -7
- package/dist/59cd437f21fe7043682d.svg +0 -3
- package/dist/5a52100de3770550b3a5.svg +0 -4
- package/dist/5cbe1f2c489b81396863.svg +0 -3
- package/dist/60ca2d367a00d582f4b6.svg +0 -3
- package/dist/6355580a064a488b6317.svg +0 -3
- package/dist/64092dadd5215c8d3ba9.svg +0 -3
- package/dist/6b01c93e069421c69bda.svg +0 -3
- package/dist/6c4885bb0ea5ca85c896.svg +0 -3
- package/dist/6e955728d9ec086f34e9.svg +0 -3
- package/dist/700f4f8ce0cee0ae1ef5.svg +0 -3
- package/dist/74f567c3ee4366d79fb8.svg +0 -3
- package/dist/786f48518c96c8e70982.svg +0 -3
- package/dist/7a43a3d78885f40616ce.svg +0 -3
- package/dist/7a6ada7f30c44fb4a990.svg +0 -7
- package/dist/7ce8283aa267fb065c56.svg +0 -3
- package/dist/80442753ef6922df1913.svg +0 -3
- package/dist/8217e163c334852f143e.svg +0 -3
- package/dist/831e69b70db1b3eb72a4.svg +0 -3
- package/dist/8a7700757f02c941f03c.svg +0 -3
- package/dist/8afb62b142d786e90102.svg +0 -3
- package/dist/8d813af82ecab84303ee.svg +0 -3
- package/dist/8e01960815ce7620a103.svg +0 -3
- package/dist/911c7ae778615185b285.svg +0 -3
- package/dist/97a0eeea1f8daa2d31c8.svg +0 -3
- package/dist/9a202cbb16735f3c83ba.svg +0 -3
- package/dist/9f45e2152fe6c499a776.svg +0 -3
- package/dist/9f5fec07823796ad7896.svg +0 -3
- package/dist/a2e9d50a0930c24af43d.svg +0 -3
- package/dist/a58b8549f46ae5bbe93b.svg +0 -3
- package/dist/a5a215695fba60146e64.svg +0 -3
- package/dist/a849dd3a36ece08b992a.svg +0 -3
- package/dist/aaf0b778d198e7b8f632.svg +0 -3
- package/dist/ab8e847ae04e2bec9209.svg +0 -3
- package/dist/ae5422a12edec1b61484.svg +0 -3
- package/dist/b541e72fe05542e14557.svg +0 -3
- package/dist/b937c8a1f744050bec2c.svg +0 -3
- package/dist/bbcc2109285c18eea02e.svg +0 -3
- package/dist/bc084278a0d284b7901b.svg +0 -3
- package/dist/bc3a4652106f5c57d14b.svg +0 -3
- package/dist/bd9b60ff4e9eae911e4e.svg +0 -3
- package/dist/c145af996de81b25f393.svg +0 -3
- package/dist/c2f94264a7640ea1bbb2.svg +0 -3
- package/dist/c40bae61fea25455602a.svg +0 -3
- package/dist/c68f36baf025b9d20ad1.svg +0 -3
- package/dist/c7c74bfa1c833263f3ab.svg +0 -3
- package/dist/cab52453404524c345ec.svg +0 -4
- package/dist/cad7e87368501b96de2a.svg +0 -3
- package/dist/cb37ac3c577c87c80046.svg +0 -3
- package/dist/d0a72898f3c47a4194d1.svg +0 -3
- package/dist/d1be236e01dd924ba711.svg +0 -3
- package/dist/d298db52aafdb846a46c.svg +0 -3
- package/dist/d3953cb1cf830bcfc41c.svg +0 -3
- package/dist/dbd1f8c63a3769f9e9a0.svg +0 -3
- package/dist/ddd56e36fa505d618ab7.svg +0 -3
- package/dist/de1782527c4a7fa14101.svg +0 -3
- package/dist/e49ee7da793b2ce446a4.svg +0 -3
- package/dist/e537292693b3c89c023f.svg +0 -3
- package/dist/e5d2289a9e8cd755bd1e.svg +0 -3
- package/dist/e7e7b8b15edebe99cae9.svg +0 -3
- package/dist/e7ff48a73ca43188703b.svg +0 -3
- package/dist/e969511d74935af26ef3.svg +0 -3
- package/dist/ea9ffc856ad6cdbe8718.svg +0 -3
- package/dist/ec60e2052661b82f27b7.svg +0 -3
- package/dist/f04f56ba3f98ade5d7ce.svg +0 -3
- package/dist/f427753e5502fd7783a0.svg +0 -3
- package/dist/f43360dc87235a6cf574.svg +0 -3
- package/dist/fe84597c4b68f4f761e1.svg +0 -3
- package/dist/ff857f74e0ffdf8b8684.svg +0 -5
- package/dist/ffbdf37c0510c796138f.svg +0 -3
- package/dist/index-ui.js.LICENSE.txt +0 -44
- package/dist/stories/Button.d.ts +0 -15
- package/dist/stories/Button.d.ts.map +0 -1
- package/dist/stories/Button.stories.d.ts +0 -23
- package/dist/stories/Button.stories.d.ts.map +0 -1
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.d.ts.map +0 -1
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.d.ts.map +0 -1
- package/dist/stories/Page.d.ts +0 -4
- package/dist/stories/Page.d.ts.map +0 -1
- package/dist/stories/Page.stories.d.ts +0 -13
- package/dist/stories/Page.stories.d.ts.map +0 -1
- package/public/quickblox.js +0 -52585
- package/public/quickblox.min.js +0 -1
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -37
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/webpack.config.js +0 -71
|
@@ -37,6 +37,7 @@ import { DefaultConfigurations } from '../../../Data/DefaultConfigurations';
|
|
|
37
37
|
import { MessageDTOMapper } from '../../../Data/source/remote/Mapper/MessageDTOMapper';
|
|
38
38
|
import { UpdateCurrentDialogInDataSourceUseCase } from '../../../Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase';
|
|
39
39
|
import { RemoteDataSource } from '../../../Data/source/remote/RemoteDataSource';
|
|
40
|
+
import { QBUIKitConfig } from '../../../CommonTypes/CommonTypes';
|
|
40
41
|
|
|
41
42
|
export default function useDialogViewModel(
|
|
42
43
|
dialogType: DialogType,
|
|
@@ -55,7 +56,7 @@ export default function useDialogViewModel(
|
|
|
55
56
|
const currentContext = useQbInitializedDataContext();
|
|
56
57
|
const remoteDataSourceMock: RemoteDataSource =
|
|
57
58
|
currentContext.storage.REMOTE_DATA_SOURCE;
|
|
58
|
-
const QBConfig =
|
|
59
|
+
const QBConfig: QBUIKitConfig =
|
|
59
60
|
currentContext.InitParams.qbConfig ||
|
|
60
61
|
DefaultConfigurations.getDefaultQBConfig();
|
|
61
62
|
const { regexUserName } = QBConfig.appConfig;
|
|
@@ -68,6 +69,27 @@ export default function useDialogViewModel(
|
|
|
68
69
|
|
|
69
70
|
const [typingText, setTypingText] = useState<string>('');
|
|
70
71
|
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
|
|
73
|
+
function informDataSources(item: DialogEntity) {
|
|
74
|
+
const updateCurrentDialogInDataSourceUseCase: UpdateCurrentDialogInDataSourceUseCase =
|
|
75
|
+
new UpdateCurrentDialogInDataSourceUseCase(
|
|
76
|
+
new DialogsRepository(
|
|
77
|
+
currentContext.storage.LOCAL_DATA_SOURCE,
|
|
78
|
+
remoteDataSourceMock,
|
|
79
|
+
),
|
|
80
|
+
item as GroupDialogEntity,
|
|
81
|
+
QBConfig,
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
updateCurrentDialogInDataSourceUseCase.execute().catch((e) => {
|
|
85
|
+
console.log(
|
|
86
|
+
'useDialogViewModel Error updateCurrentDialogInDataSourceUseCase: ',
|
|
87
|
+
stringifyError(e),
|
|
88
|
+
);
|
|
89
|
+
throw new Error(stringifyError(e));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
71
93
|
async function getMessages(currentPagination?: Pagination) {
|
|
72
94
|
setLoading(true);
|
|
73
95
|
|
|
@@ -161,6 +183,19 @@ export default function useDialogViewModel(
|
|
|
161
183
|
|
|
162
184
|
return newItems;
|
|
163
185
|
});
|
|
186
|
+
// eslint-disable-next-line promise/always-return
|
|
187
|
+
// if (
|
|
188
|
+
// dialog?.type === DialogType.private ||
|
|
189
|
+
// dialog?.type === DialogType.group
|
|
190
|
+
// ) {
|
|
191
|
+
// const updDialog = { ...dialog };
|
|
192
|
+
//
|
|
193
|
+
// updDialog.unreadMessageCount = 0;
|
|
194
|
+
// setDialog(updDialog);
|
|
195
|
+
//
|
|
196
|
+
// informDataSources(updDialog);
|
|
197
|
+
//
|
|
198
|
+
// }
|
|
164
199
|
setLoading(false);
|
|
165
200
|
setPagination(data.CurrentPagination);
|
|
166
201
|
setError('');
|
|
@@ -385,26 +420,6 @@ export default function useDialogViewModel(
|
|
|
385
420
|
return Promise.resolve(resultEnity);
|
|
386
421
|
};
|
|
387
422
|
|
|
388
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
|
|
389
|
-
function informDataSources(item: DialogEntity) {
|
|
390
|
-
const updateCurrentDialogInDataSourceUseCase: UpdateCurrentDialogInDataSourceUseCase =
|
|
391
|
-
new UpdateCurrentDialogInDataSourceUseCase(
|
|
392
|
-
new DialogsRepository(
|
|
393
|
-
currentContext.storage.LOCAL_DATA_SOURCE,
|
|
394
|
-
remoteDataSourceMock,
|
|
395
|
-
),
|
|
396
|
-
item as GroupDialogEntity,
|
|
397
|
-
);
|
|
398
|
-
|
|
399
|
-
updateCurrentDialogInDataSourceUseCase.execute().catch((e) => {
|
|
400
|
-
console.log(
|
|
401
|
-
'useDialogViewModel Error updateCurrentDialogInDataSourceUseCase: ',
|
|
402
|
-
stringifyError(e),
|
|
403
|
-
);
|
|
404
|
-
throw new Error(stringifyError(e));
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
|
|
408
423
|
const sendMessage = (messageToSend: MessageEntity) => {
|
|
409
424
|
const sendTextMessageUseCase: SendTextMessageUseCase =
|
|
410
425
|
new SendTextMessageUseCase(
|
|
@@ -431,7 +446,10 @@ export default function useDialogViewModel(
|
|
|
431
446
|
|
|
432
447
|
return newState;
|
|
433
448
|
});
|
|
434
|
-
if (
|
|
449
|
+
if (
|
|
450
|
+
dialog?.type === DialogType.private ||
|
|
451
|
+
dialog?.type === DialogType.group
|
|
452
|
+
) {
|
|
435
453
|
const updDialog = { ...dialog };
|
|
436
454
|
|
|
437
455
|
updDialog.lastMessage.dateSent = messageEntity.date_sent / 1000;
|
|
@@ -543,6 +543,7 @@ export default function useDialogListViewModel(
|
|
|
543
543
|
remoteDataSourceMock,
|
|
544
544
|
),
|
|
545
545
|
item as GroupDialogEntity,
|
|
546
|
+
QBConfig,
|
|
546
547
|
);
|
|
547
548
|
|
|
548
549
|
updateCurrentDialogInDataSourceUseCase.execute().catch((e) => {
|
|
@@ -559,8 +560,11 @@ export default function useDialogListViewModel(
|
|
|
559
560
|
return newDialog as DialogEntity;
|
|
560
561
|
},
|
|
561
562
|
set entity(item) {
|
|
562
|
-
|
|
563
|
-
|
|
563
|
+
const updDialog = { ...item };
|
|
564
|
+
|
|
565
|
+
updDialog.unreadMessageCount = 0;
|
|
566
|
+
setNewDialog(updDialog);
|
|
567
|
+
informDataSources(updDialog);
|
|
564
568
|
},
|
|
565
569
|
dialogs,
|
|
566
570
|
loading,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
|
-
import QB from 'quickblox/quickblox';
|
|
4
3
|
import './PreviewDialog.scss';
|
|
5
4
|
import { DialogType } from '../../../Domain/entity/DialogTypes';
|
|
6
5
|
import PreviewDialogViewModel from './PreviewDialogViewModel';
|
|
@@ -17,6 +16,7 @@ import DialogItemPreview from '../../ui-components/DialogItemPreview/DialogItemP
|
|
|
17
16
|
import Dropdown from '../../ui-components/Dropdown/Dropdown';
|
|
18
17
|
import { GroupChatSvg, MoreSvg, PublicChannelSvg, UserSvg } from '../../icons';
|
|
19
18
|
import Avatar from '../../ui-components/Avatar/Avatar';
|
|
19
|
+
import { getQB } from '../../../qb-api-calls';
|
|
20
20
|
|
|
21
21
|
export type ThemeNames = 'light' | 'dark' | 'custom';
|
|
22
22
|
type PreviewDialogsColorTheme = {
|
|
@@ -171,6 +171,7 @@ const PreviewDialog = ({
|
|
|
171
171
|
|
|
172
172
|
async function getFileForPreview() {
|
|
173
173
|
const messageParts = getMessageParts(previewMessage || '');
|
|
174
|
+
const QB = getQB();
|
|
174
175
|
|
|
175
176
|
setMessageContentParts(messageParts);
|
|
176
177
|
|
|
@@ -12,6 +12,8 @@ import StreamFilledSvg from './stream-filled.svg?react';
|
|
|
12
12
|
import SteamSvg from './stream.svg?react';
|
|
13
13
|
import UserSvg from './user.svg?react';
|
|
14
14
|
|
|
15
|
+
console.log('UserSvg in contents/index.ts:', UserSvg); // <-- Добавляем отладку
|
|
16
|
+
|
|
15
17
|
export {
|
|
16
18
|
BroadcastSvg,
|
|
17
19
|
ChatFilledSvg,
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
export * from './actions';
|
|
2
|
-
export * from './contents';
|
|
2
|
+
// export * from './contents';
|
|
3
3
|
export * from './media';
|
|
4
4
|
export * from './moderation';
|
|
5
5
|
export * from './navigation';
|
|
6
6
|
export * from './status';
|
|
7
7
|
export * from './toggle';
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
BroadcastSvg,
|
|
11
|
+
ChatFilledSvg,
|
|
12
|
+
ChatSvg,
|
|
13
|
+
ConferenceSvg,
|
|
14
|
+
ContactFilledSvg,
|
|
15
|
+
ContactSvg,
|
|
16
|
+
GroupChatSvg,
|
|
17
|
+
NotificationsSvg,
|
|
18
|
+
PrivateChatSvg,
|
|
19
|
+
PublicChannelSvg,
|
|
20
|
+
StreamFilledSvg,
|
|
21
|
+
SteamSvg,
|
|
22
|
+
UserSvg,
|
|
23
|
+
} from './contents/index';
|
|
@@ -15,23 +15,26 @@ strong {
|
|
|
15
15
|
/* ---------- LOGIN ---------- */
|
|
16
16
|
|
|
17
17
|
#login {
|
|
18
|
-
border: 3px solid #6c38cc;
|
|
19
18
|
margin: 50px auto;
|
|
20
19
|
width: 100%;
|
|
21
20
|
}
|
|
22
21
|
|
|
22
|
+
form {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
form fieldset input[type="text"],
|
|
24
28
|
input[type="password"] {
|
|
25
29
|
appearance: none;
|
|
26
30
|
background: #e5e5e5;
|
|
27
|
-
border: none;
|
|
28
31
|
border-radius: 3px;
|
|
29
32
|
color: #5a5656;
|
|
30
33
|
font-family: inherit;
|
|
31
34
|
font-size: 14px;
|
|
32
35
|
height: 50px;
|
|
33
36
|
outline: none;
|
|
34
|
-
padding:
|
|
37
|
+
padding: 0;
|
|
35
38
|
width: 100%;
|
|
36
39
|
border: 1px solid #008dde;
|
|
37
40
|
margin: 1px;
|
|
@@ -16,6 +16,7 @@ import EventMessagesRepository from '../../../Data/repository/EventMessagesRepos
|
|
|
16
16
|
import { CallBackFunction } from '../../../Domain/use_cases/base/IUseCase';
|
|
17
17
|
import { DefaultConfigurations } from '../../../Data/DefaultConfigurations';
|
|
18
18
|
import { QBUIKitConfig } from '../../../CommonTypes/CommonTypes';
|
|
19
|
+
import { getQB, setQB } from '../../../qb-api-calls';
|
|
19
20
|
|
|
20
21
|
const initialValues = {
|
|
21
22
|
LOCAL_DATA_SOURCE: new LocalDataSource(), // localstorage or session storage
|
|
@@ -144,6 +145,18 @@ const initDataContext: QBDataContextType = {
|
|
|
144
145
|
},
|
|
145
146
|
authorize: async (authorizationData: AuthorizationData): Promise<void> => {
|
|
146
147
|
console.log('UI Kit authorize');
|
|
148
|
+
console.log('QB inside library:', getQB());
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
console.log('QB inside authorize:', window.QB);
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
if (typeof window !== 'undefined' && window.QB) {
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
156
|
+
// @ts-ignore
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
158
|
+
setQB(window.QB);
|
|
159
|
+
}
|
|
147
160
|
initialValues.REMOTE_DATA_SOURCE.authInformation = authorizationData;
|
|
148
161
|
initialValues.REMOTE_DATA_SOURCE.setAuthProcessedSuccessed();
|
|
149
162
|
//
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ReactElement } from 'react';
|
|
2
3
|
import cn from 'classnames';
|
|
3
4
|
import { UserSvg } from '../../icons';
|
|
4
5
|
import './Avatar.scss';
|
|
5
6
|
|
|
7
|
+
console.log('UserSvg:', UserSvg); // <-- Добавляем отладку
|
|
8
|
+
|
|
6
9
|
export interface AvatarProps {
|
|
7
10
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
8
11
|
icon?: ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
import {
|
|
@@ -73,6 +74,7 @@ export const AvatarIcon: StoryDefault = {
|
|
|
73
74
|
|
|
74
75
|
export const AvatarImage: StoryDefault = {
|
|
75
76
|
args: {
|
|
76
|
-
src: 'https://quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-messaging.svg',
|
|
77
|
+
// src: 'https://quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-messaging.svg',
|
|
78
|
+
src: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/custom-white-label-solution.jpg',
|
|
77
79
|
},
|
|
78
80
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
3
|
import Badge from './Badge';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Badge> = {
|
|
@@ -14,7 +14,7 @@ const meta: Meta<typeof Badge> = {
|
|
|
14
14
|
count: {
|
|
15
15
|
table: {
|
|
16
16
|
defaultValue: {
|
|
17
|
-
summary: 0,
|
|
17
|
+
summary: '0',
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
description: 'Number of unread messages',
|
|
@@ -22,7 +22,7 @@ const meta: Meta<typeof Badge> = {
|
|
|
22
22
|
limit: {
|
|
23
23
|
table: {
|
|
24
24
|
defaultValue: {
|
|
25
|
-
summary: 99,
|
|
25
|
+
summary: '99',
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
description: 'Limt of message count',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
import Button from './Button';
|
|
@@ -30,7 +31,7 @@ const meta = {
|
|
|
30
31
|
disabled: {
|
|
31
32
|
table: {
|
|
32
33
|
defaultValue: {
|
|
33
|
-
summary: false,
|
|
34
|
+
summary: 'false',
|
|
34
35
|
},
|
|
35
36
|
type: { summary: 'boolean' },
|
|
36
37
|
},
|
|
@@ -39,7 +40,7 @@ const meta = {
|
|
|
39
40
|
loading: {
|
|
40
41
|
table: {
|
|
41
42
|
defaultValue: {
|
|
42
|
-
summary: false,
|
|
43
|
+
summary: 'false',
|
|
43
44
|
},
|
|
44
45
|
type: { summary: 'boolean' },
|
|
45
46
|
},
|
|
@@ -57,7 +58,7 @@ const meta = {
|
|
|
57
58
|
children: {
|
|
58
59
|
table: {
|
|
59
60
|
defaultValue: {
|
|
60
|
-
summary:
|
|
61
|
+
summary: undefined,
|
|
61
62
|
},
|
|
62
63
|
type: { summary: 'ReactElement | string | number' },
|
|
63
64
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
|
3
4
|
import DialogItemPreview from './DialogItemPreview';
|
|
@@ -72,7 +73,7 @@ const meta: Meta<typeof DialogItemPreview> = {
|
|
|
72
73
|
active: {
|
|
73
74
|
table: {
|
|
74
75
|
defaultValue: {
|
|
75
|
-
summary: false,
|
|
76
|
+
summary: 'false',
|
|
76
77
|
},
|
|
77
78
|
type: { summary: 'boolean' },
|
|
78
79
|
},
|
|
@@ -118,7 +119,7 @@ export const DialogItemPreviewDefault: Story = {
|
|
|
118
119
|
},
|
|
119
120
|
render: (args) => {
|
|
120
121
|
// eslint-disable-next-line no-param-reassign
|
|
121
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
122
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
122
123
|
|
|
123
124
|
return <DialogItemPreview {...args} />;
|
|
124
125
|
},
|
|
@@ -133,6 +134,7 @@ export const DialogItemPreviewFullScreen: Story = {
|
|
|
133
134
|
"Hello, dear Mr. User. Thank you for choosing us. I'm here to assist with your order's delivery. Please provide your preferred address and any specific instructions. We offer standard, express, and same-day delivery in select areas. Let us know your convenience, and we'll ensure a smooth process.",
|
|
134
135
|
badge: <Badge count={5} />,
|
|
135
136
|
contextMenu: <MoreSvg />,
|
|
137
|
+
|
|
136
138
|
},
|
|
137
139
|
parameters: {
|
|
138
140
|
viewport: {
|
|
@@ -141,7 +143,7 @@ export const DialogItemPreviewFullScreen: Story = {
|
|
|
141
143
|
},
|
|
142
144
|
render: (args) => {
|
|
143
145
|
// eslint-disable-next-line no-param-reassign
|
|
144
|
-
args.date = new Date(
|
|
146
|
+
args.date = new Date().toLocaleDateString();
|
|
145
147
|
|
|
146
148
|
return <DialogItemPreview {...args} />;
|
|
147
149
|
},
|
|
@@ -164,7 +166,7 @@ export const DialogItemPreviewMobileScreen: Story = {
|
|
|
164
166
|
},
|
|
165
167
|
render: (args) => {
|
|
166
168
|
// eslint-disable-next-line no-param-reassign
|
|
167
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
169
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
168
170
|
|
|
169
171
|
return <DialogItemPreview {...args} />;
|
|
170
172
|
},
|
|
@@ -187,7 +189,7 @@ export const DialogItemPreviewMobileScreenIPad: Story = {
|
|
|
187
189
|
},
|
|
188
190
|
render: (args) => {
|
|
189
191
|
// eslint-disable-next-line no-param-reassign
|
|
190
|
-
args.date = new Date(args.date!).toLocaleDateString();
|
|
192
|
+
args.date = args.date ? new Date(args.date!).toLocaleDateString() : new Date().toLocaleDateString();
|
|
191
193
|
|
|
192
194
|
return <DialogItemPreview {...args} />;
|
|
193
195
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { useState } from 'react';
|
|
2
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
4
|
|
|
@@ -40,7 +41,7 @@ const meta: Meta<typeof DialogWindow> = {
|
|
|
40
41
|
open: {
|
|
41
42
|
table: {
|
|
42
43
|
defaultValue: {
|
|
43
|
-
summary: false,
|
|
44
|
+
summary: 'false',
|
|
44
45
|
},
|
|
45
46
|
type: { summary: 'boolean' },
|
|
46
47
|
},
|
|
@@ -22,7 +22,7 @@ export default function DialogWindow({
|
|
|
22
22
|
title,
|
|
23
23
|
className,
|
|
24
24
|
disableActions = false,
|
|
25
|
-
}: DialogWindowProps):
|
|
25
|
+
}: DialogWindowProps): React.JSX.Element | null {
|
|
26
26
|
if (!open) return null;
|
|
27
27
|
|
|
28
28
|
return createPortal(
|
|
@@ -40,5 +40,5 @@ export default function DialogWindow({
|
|
|
40
40
|
</div>
|
|
41
41
|
</div>,
|
|
42
42
|
document.body,
|
|
43
|
-
) as unknown as
|
|
43
|
+
) as unknown as React.JSX.Element | null;
|
|
44
44
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
import { LocationSvg, NextSVG } from '../../icons';
|
|
@@ -23,7 +24,7 @@ const meta: Meta<typeof Dropdown> = {
|
|
|
23
24
|
control: false,
|
|
24
25
|
table: {
|
|
25
26
|
defaultValue: {
|
|
26
|
-
summary:
|
|
27
|
+
summary: undefined,
|
|
27
28
|
},
|
|
28
29
|
type: { summary: 'ReactElement | string | number' },
|
|
29
30
|
},
|
|
@@ -54,7 +55,7 @@ const meta: Meta<typeof Dropdown> = {
|
|
|
54
55
|
disabled: {
|
|
55
56
|
table: {
|
|
56
57
|
defaultValue: {
|
|
57
|
-
summary: false,
|
|
58
|
+
summary: 'false',
|
|
58
59
|
},
|
|
59
60
|
type: { summary: 'boolean' },
|
|
60
61
|
},
|
|
@@ -11,11 +11,14 @@
|
|
|
11
11
|
background: var(--incoming-background, #e4e6e8);
|
|
12
12
|
border-radius: 8px;
|
|
13
13
|
flex-shrink: 0;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
&__icon {
|
|
17
19
|
fill: var(--caption);
|
|
18
|
-
|
|
20
|
+
width: 16px;
|
|
21
|
+
height: 16px;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
&__name {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
import PreviewFileMessage from './PreviewFileMessage';
|
|
3
4
|
|
|
@@ -71,7 +72,8 @@ export const PreviewFileMessageVideo: StoryDefault = {
|
|
|
71
72
|
export const PreviewFileMessageImage: StoryDefault = {
|
|
72
73
|
name: 'PreviewFileMessage Image',
|
|
73
74
|
args: {
|
|
74
|
-
src: 'https://quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-messaging.svg',
|
|
75
|
+
// src: 'https://quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-messaging.svg',
|
|
76
|
+
src: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/custom-white-label-solution.jpg',
|
|
75
77
|
name: 'screenshot.jpg',
|
|
76
78
|
},
|
|
77
79
|
};
|