cozy-search 2.10.0 → 2.11.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/dist/assets/conversation.svg +1 -0
- package/dist/components/Assistant/AssistantContainer.js +1 -3
- package/dist/components/AssistantDesktop.d.ts +1 -0
- package/dist/components/AssistantDesktop.js +2 -1
- package/dist/components/AssistantMobile.js +1 -2
- package/dist/components/AssistantProvider.d.ts +1 -0
- package/dist/components/AssistantProvider.js +6 -3
- package/dist/components/Conversations/Conversation.js +17 -9
- package/dist/components/Conversations/ConversationActions.js +1 -0
- package/dist/components/Conversations/ConversationBar.d.ts +2 -4
- package/dist/components/Conversations/ConversationBar.js +23 -8
- package/dist/components/Conversations/ConversationComposer.js +14 -73
- package/dist/components/Conversations/ConversationComposerCompact.d.ts +1 -0
- package/dist/components/Conversations/ConversationComposerCompact.js +120 -0
- package/dist/components/Conversations/ConversationComposerRoot.d.ts +4 -0
- package/dist/components/Conversations/ConversationComposerRoot.js +86 -0
- package/dist/components/Conversations/ConversationListItem.js +17 -5
- package/dist/components/Conversations/ConversationListItemWider.js +5 -0
- package/dist/components/Conversations/ConversationSendButton.d.ts +1 -0
- package/dist/components/Conversations/ConversationSendButton.js +49 -0
- package/dist/components/Conversations/styles.styl +32 -1
- package/dist/components/Messages/AssistantMessage.js +0 -2
- package/dist/components/Messages/UserMessage.js +1 -12
- package/dist/components/Messages/styles.styl +3 -7
- package/dist/components/Search/NotFoundConversation.js +71 -25
- package/dist/components/Search/SearchBarDesktop.d.ts +2 -1
- package/dist/components/Search/SearchBarDesktop.js +4 -4
- package/dist/components/Search/SearchBarMobile.js +5 -0
- package/dist/components/Search/SearchConversation.js +2 -3
- package/dist/components/Search/SuggestionsPlaceholder.js +1 -2
- package/dist/components/Search/styles.styl +0 -5
- package/dist/components/Sidebar/SidebarConversations.d.ts +1 -0
- package/dist/components/Sidebar/SidebarConversations.js +84 -0
- package/dist/components/Sidebar/SidebarDesktop.d.ts +7 -0
- package/dist/components/Sidebar/SidebarDesktop.js +57 -0
- package/dist/components/Sidebar/SidebarHeader.d.ts +6 -0
- package/dist/components/Sidebar/SidebarHeader.js +67 -0
- package/dist/components/Sidebar/SidebarMobile.d.ts +8 -0
- package/dist/components/Sidebar/SidebarMobile.js +79 -0
- package/dist/components/Sidebar/SidebarMobileToolbar.d.ts +3 -0
- package/dist/components/Sidebar/SidebarMobileToolbar.js +55 -0
- package/dist/components/Sidebar/SidebarNewChatButton.d.ts +4 -0
- package/dist/components/Sidebar/SidebarNewChatButton.js +68 -0
- package/dist/components/Sidebar/SidebarToggleButton.d.ts +3 -0
- package/dist/components/Sidebar/SidebarToggleButton.js +35 -0
- package/dist/components/Sidebar/index.js +26 -167
- package/dist/components/Sidebar/styles.styl +29 -28
- package/dist/components/Views/AssistantView.d.ts +7 -1
- package/dist/components/Views/AssistantView.js +11 -2
- package/dist/stylesheet.css +56 -43
- package/package.json +3 -3
- package/dist/components/Containers/PrettyScrollbar.d.ts +0 -5
- package/dist/components/Containers/PrettyScrollbar.js +0 -27
- package/dist/components/Containers/styles.styl +0 -7
|
@@ -15,6 +15,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _ListItem = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItem"));
|
|
17
17
|
|
|
18
|
+
var _ListItemSecondaryAction = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemSecondaryAction"));
|
|
19
|
+
|
|
18
20
|
var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemText"));
|
|
19
21
|
|
|
20
22
|
var _ConversationActions = _interopRequireDefault(require("./ConversationActions"));
|
|
@@ -25,6 +27,8 @@ var styles = {
|
|
|
25
27
|
"composerContainer": "styles__composerContainer___3bNfY",
|
|
26
28
|
"composerContainer--mobile": "styles__composerContainer--mobile___nIYa-",
|
|
27
29
|
"composerContainer--mobile-dark": "styles__composerContainer--mobile-dark___12Go9",
|
|
30
|
+
"composerContainer--compact": "styles__composerContainer--compact___35e18",
|
|
31
|
+
"composerContainer--single-line": "styles__composerContainer--single-line___2yeWP",
|
|
28
32
|
"composer-dock": "styles__composer-dock___2nPT8",
|
|
29
33
|
"composerActions": "styles__composerActions___2xQEH",
|
|
30
34
|
"welcome": "styles__welcome___ozY_t",
|
|
@@ -57,6 +61,9 @@ var styles = {
|
|
|
57
61
|
"conversation-list-item-action": "styles__conversation-list-item-action___qiuKm",
|
|
58
62
|
"conversation-list-item--selected": "styles__conversation-list-item--selected___2D5_3",
|
|
59
63
|
"conversation-list-item--wider": "styles__conversation-list-item--wider___2Tl2c",
|
|
64
|
+
"conversation-list-item-container": "styles__conversation-list-item-container___36VTD",
|
|
65
|
+
"conversation-list-item-menu-button": "styles__conversation-list-item-menu-button___2ZYvH",
|
|
66
|
+
"conversation-list-item-secondary-action": "styles__conversation-list-item-secondary-action___2vwnw",
|
|
60
67
|
"conversation-list-item-text": "styles__conversation-list-item-text___31VBM",
|
|
61
68
|
"conversation-list-item-title": "styles__conversation-list-item-title___3je_6",
|
|
62
69
|
"conversation-list-item-subtitle": "styles__conversation-list-item-subtitle___3e_h0",
|
|
@@ -77,11 +84,11 @@ var ConversationListItem = function ConversationListItem(_ref) {
|
|
|
77
84
|
return onOpenConversation(conversation._id);
|
|
78
85
|
},
|
|
79
86
|
className: (0, _classnames.default)('u-ov-hidden u-ph-half', styles['conversation-list-item'], (0, _defineProperty2.default)({}, styles['conversation-list-item--selected'], selected)),
|
|
87
|
+
ContainerProps: {
|
|
88
|
+
className: styles['conversation-list-item-container']
|
|
89
|
+
},
|
|
80
90
|
selected: selected
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
82
|
-
buttonClassName: styles['conversation-list-item-action'],
|
|
83
|
-
conversation: conversation
|
|
84
|
-
}), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
85
92
|
className: "u-m-0",
|
|
86
93
|
primaryTypographyProps: {
|
|
87
94
|
component: 'div',
|
|
@@ -90,7 +97,12 @@ var ConversationListItem = function ConversationListItem(_ref) {
|
|
|
90
97
|
primary: /*#__PURE__*/_react.default.createElement("span", {
|
|
91
98
|
className: (0, _classnames.default)('u-ellipsis u-db', styles['conversation-list-item-title'])
|
|
92
99
|
}, (0, _helpers.getNameOfConversation)(conversation))
|
|
93
|
-
})
|
|
100
|
+
}), /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, {
|
|
101
|
+
className: styles['conversation-list-item-secondary-action']
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_ConversationActions.default, {
|
|
103
|
+
buttonClassName: styles['conversation-list-item-menu-button'],
|
|
104
|
+
conversation: conversation
|
|
105
|
+
})));
|
|
94
106
|
}; // Memoized so a re-render of the conversation list only re-renders items
|
|
95
107
|
// whose props actually changed (typically just the previously- and
|
|
96
108
|
// newly-selected items). This avoids rebuilding every item's ActionsMenu
|
|
@@ -33,6 +33,8 @@ var styles = {
|
|
|
33
33
|
"composerContainer": "styles__composerContainer___3bNfY",
|
|
34
34
|
"composerContainer--mobile": "styles__composerContainer--mobile___nIYa-",
|
|
35
35
|
"composerContainer--mobile-dark": "styles__composerContainer--mobile-dark___12Go9",
|
|
36
|
+
"composerContainer--compact": "styles__composerContainer--compact___35e18",
|
|
37
|
+
"composerContainer--single-line": "styles__composerContainer--single-line___2yeWP",
|
|
36
38
|
"composer-dock": "styles__composer-dock___2nPT8",
|
|
37
39
|
"composerActions": "styles__composerActions___2xQEH",
|
|
38
40
|
"welcome": "styles__welcome___ozY_t",
|
|
@@ -65,6 +67,9 @@ var styles = {
|
|
|
65
67
|
"conversation-list-item-action": "styles__conversation-list-item-action___qiuKm",
|
|
66
68
|
"conversation-list-item--selected": "styles__conversation-list-item--selected___2D5_3",
|
|
67
69
|
"conversation-list-item--wider": "styles__conversation-list-item--wider___2Tl2c",
|
|
70
|
+
"conversation-list-item-container": "styles__conversation-list-item-container___36VTD",
|
|
71
|
+
"conversation-list-item-menu-button": "styles__conversation-list-item-menu-button___2ZYvH",
|
|
72
|
+
"conversation-list-item-secondary-action": "styles__conversation-list-item-secondary-action___2vwnw",
|
|
68
73
|
"conversation-list-item-text": "styles__conversation-list-item-text___31VBM",
|
|
69
74
|
"conversation-list-item-title": "styles__conversation-list-item-title___3je_6",
|
|
70
75
|
"conversation-list-item-subtitle": "styles__conversation-list-item-subtitle___3e_h0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function ConversationSendButton(): JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ConversationSendButton = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = require("@assistant-ui/react");
|
|
11
|
+
|
|
12
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
15
|
+
|
|
16
|
+
var _Buttons = _interopRequireDefault(require("cozy-ui/transpiled/react/Buttons"));
|
|
17
|
+
|
|
18
|
+
var ConversationSendButton = function ConversationSendButton() {
|
|
19
|
+
var composerRuntime = (0, _react.useComposerRuntime)();
|
|
20
|
+
var isRunning = (0, _react.useThread)(function (state) {
|
|
21
|
+
return state.isRunning;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
var handleSend = function handleSend() {
|
|
25
|
+
composerRuntime.send();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var handleCancel = function handleCancel() {
|
|
29
|
+
composerRuntime.cancel();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return /*#__PURE__*/_react2.default.createElement(_Buttons.default, {
|
|
33
|
+
size: "small",
|
|
34
|
+
className: "u-miw-auto u-w-2 u-h-2 u-bdrs-circle u-flex-shrink-0",
|
|
35
|
+
classes: {
|
|
36
|
+
label: 'u-flex u-w-auto'
|
|
37
|
+
},
|
|
38
|
+
label: isRunning ? /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
|
|
39
|
+
icon: _twakeIcons.Stop,
|
|
40
|
+
size: 12
|
|
41
|
+
}) : /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
|
|
42
|
+
icon: _twakeIcons.ArrowUp,
|
|
43
|
+
size: 16
|
|
44
|
+
}),
|
|
45
|
+
onClick: isRunning ? handleCancel : handleSend
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.ConversationSendButton = ConversationSendButton;
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
// The shadows vanish on a dark background: keep a border there
|
|
22
22
|
border-color var(--borderMainColor)
|
|
23
23
|
|
|
24
|
+
&--compact
|
|
25
|
+
// The mobile 8px are for the chips row, which the compact composer
|
|
26
|
+
// does not have
|
|
27
|
+
padding-bottom 12px
|
|
28
|
+
|
|
29
|
+
&--single-line
|
|
30
|
+
border-radius 9999px
|
|
31
|
+
|
|
24
32
|
.composer-dock
|
|
25
33
|
// The composer and the disclaimer sit on a fade: the conversation runs
|
|
26
34
|
// under them and dissolves into the background over the 32px above the
|
|
@@ -49,7 +57,7 @@
|
|
|
49
57
|
width 100%
|
|
50
58
|
max-width 629px
|
|
51
59
|
height 166px
|
|
52
|
-
transform translate(-50%, -50%)
|
|
60
|
+
transform translate(-50%, calc(-50% - 32px))
|
|
53
61
|
border-radius 9999px
|
|
54
62
|
opacity 0.5
|
|
55
63
|
filter blur(62.5px)
|
|
@@ -218,6 +226,29 @@
|
|
|
218
226
|
opacity 0
|
|
219
227
|
pointer-events none
|
|
220
228
|
|
|
229
|
+
// The secondary action is a sibling of the item, not inside it: hovering
|
|
230
|
+
// it must still highlight the item
|
|
231
|
+
.conversation-list-item-container
|
|
232
|
+
&:hover .conversation-list-item
|
|
233
|
+
background-color var(--actionColorHover)
|
|
234
|
+
|
|
235
|
+
&:hover .conversation-list-item-menu-button
|
|
236
|
+
opacity 1
|
|
237
|
+
pointer-events auto
|
|
238
|
+
|
|
239
|
+
.conversation-list-item-secondary-action
|
|
240
|
+
right 4px !important
|
|
241
|
+
|
|
242
|
+
.conversation-list-item-menu-button
|
|
243
|
+
opacity 0
|
|
244
|
+
pointer-events none
|
|
245
|
+
|
|
246
|
+
// Its open menu takes the hover away from the item
|
|
247
|
+
&[aria-expanded='true'],
|
|
248
|
+
&:focus-visible
|
|
249
|
+
opacity 1
|
|
250
|
+
pointer-events auto
|
|
251
|
+
|
|
221
252
|
.conversation-list-item-text
|
|
222
253
|
overflow hidden
|
|
223
254
|
margin-right 24px !important
|
|
@@ -23,8 +23,6 @@ var _Sources = _interopRequireDefault(require("../Conversations/Sources/Sources"
|
|
|
23
23
|
|
|
24
24
|
var styles = {
|
|
25
25
|
"cozyThread-user-messages": "styles__cozyThread-user-messages___3Hfj-",
|
|
26
|
-
"cozyThread-user-messages--light": "styles__cozyThread-user-messages--light___1jBny",
|
|
27
|
-
"cozyThread-user-messages--dark": "styles__cozyThread-user-messages--dark___1Om3B",
|
|
28
26
|
"thinking-dots": "styles__thinking-dots___1HwKW",
|
|
29
27
|
"thinking-dot": "styles__thinking-dot___1muTY",
|
|
30
28
|
"thinking-bounce": "styles__thinking-bounce___2IfNu"
|
|
@@ -17,29 +17,18 @@ var _Box = _interopRequireDefault(require("cozy-ui/transpiled/react/Box"));
|
|
|
17
17
|
|
|
18
18
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
19
19
|
|
|
20
|
-
var _CozyTheme = require("cozy-ui-plus/dist/providers/CozyTheme");
|
|
21
|
-
|
|
22
20
|
var styles = {
|
|
23
21
|
"cozyThread-user-messages": "styles__cozyThread-user-messages___3Hfj-",
|
|
24
|
-
"cozyThread-user-messages--light": "styles__cozyThread-user-messages--light___1jBny",
|
|
25
|
-
"cozyThread-user-messages--dark": "styles__cozyThread-user-messages--dark___1Om3B",
|
|
26
22
|
"thinking-dots": "styles__thinking-dots___1HwKW",
|
|
27
23
|
"thinking-dot": "styles__thinking-dot___1muTY",
|
|
28
24
|
"thinking-bounce": "styles__thinking-bounce___2IfNu"
|
|
29
25
|
};
|
|
30
26
|
|
|
31
27
|
var UserMessage = function UserMessage() {
|
|
32
|
-
var _useCozyTheme = (0, _CozyTheme.useCozyTheme)(),
|
|
33
|
-
theme = _useCozyTheme.type;
|
|
34
|
-
|
|
35
28
|
return /*#__PURE__*/_react2.default.createElement(_react.MessagePrimitive.Root, {
|
|
36
29
|
className: "u-mt-1"
|
|
37
30
|
}, /*#__PURE__*/_react2.default.createElement(_Box.default, {
|
|
38
|
-
|
|
39
|
-
border: 0,
|
|
40
|
-
borderRadius: 10,
|
|
41
|
-
padding: 0.5,
|
|
42
|
-
className: (0, _classnames.default)('u-ml-auto', styles['cozyThread-user-messages'], styles["cozyThread-user-messages--".concat(theme)])
|
|
31
|
+
className: (0, _classnames.default)('u-ml-auto u-pv-1 u-ph-1-half', styles['cozyThread-user-messages'])
|
|
43
32
|
}, /*#__PURE__*/_react2.default.createElement(_react.MessagePrimitive.Parts, {
|
|
44
33
|
components: {
|
|
45
34
|
Text: function Text(_ref) {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
.cozyThread-user-messages
|
|
2
|
-
max-width
|
|
2
|
+
max-width 80%
|
|
3
3
|
width fit-content
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
background var(--grey100)
|
|
7
|
-
|
|
8
|
-
&--dark
|
|
9
|
-
background var(--grey900)
|
|
4
|
+
border-radius 26px
|
|
5
|
+
background var(--defaultBackgroundColor)
|
|
10
6
|
|
|
11
7
|
// The 24px "icon animation" of the design: three 3.8px dots, 6.09px apart,
|
|
12
8
|
// each rising 2.855px and growing to 115% over 250ms then falling back,
|
|
@@ -7,44 +7,90 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
|
|
14
12
|
var _twakeIcons = require("@linagora/twake-icons");
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _Avatar = _interopRequireDefault(require("cozy-ui/transpiled/react/Avatar"));
|
|
15
|
+
|
|
16
|
+
var _Empty = _interopRequireDefault(require("cozy-ui/transpiled/react/Empty"));
|
|
17
|
+
|
|
18
|
+
var _styles = require("cozy-ui/transpiled/react/styles");
|
|
17
19
|
|
|
18
20
|
var _twakeI18n = require("twake-i18n");
|
|
19
21
|
|
|
20
|
-
var
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
22
|
+
var ConversationIcon = function ConversationIcon(props) {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
24
|
+
fill: "url(#paint0_linear_37801_44158)",
|
|
25
|
+
fillOpacity: ".9",
|
|
26
|
+
d: "M21.222 0c3.175 0 4.702.295 6.289 1.143a8.06 8.06 0 0 1 3.346 3.346C31.705 6.076 32 7.602 32 10.778v10.444c0 3.175-.295 4.702-1.143 6.289a8.06 8.06 0 0 1-3.346 3.346C25.924 31.705 24.398 32 21.222 32H10.778c-3.176 0-4.702-.295-6.289-1.143a8.06 8.06 0 0 1-3.346-3.346C.295 25.924 0 24.398 0 21.222V10.778c0-3.176.295-4.702 1.143-6.289A8.06 8.06 0 0 1 4.49 1.143C6.076.295 7.602 0 10.778 0zm0 2.91H10.778c-2.736 0-3.81.206-4.917.799A5.15 5.15 0 0 0 3.71 5.86c-.593 1.107-.8 2.18-.8 4.917v10.444c0 2.736.207 3.81.8 4.917a5.15 5.15 0 0 0 2.15 2.152c1.107.593 2.18.8 4.917.8h10.444c2.736 0 3.81-.207 4.917-.8a5.15 5.15 0 0 0 2.152-2.152c.593-1.107.8-2.18.8-4.917V10.778c0-2.736-.207-3.81-.8-4.917a5.15 5.15 0 0 0-2.15-2.151c-1.107-.593-2.18-.8-4.917-.8m-6.677 18.18a1.455 1.455 0 0 1 0 2.91H8.728a1.455 1.455 0 1 1 0-2.91zm8.728-6.544a1.455 1.455 0 1 1 0 2.909H8.727a1.455 1.455 0 1 1 0-2.91zm0-6.546a1.455 1.455 0 1 1 0 2.91H8.727a1.455 1.455 0 1 1 0-2.91z"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
fill: "url(#paint1_linear_37801_44158)",
|
|
29
|
+
fillOpacity: ".9",
|
|
30
|
+
d: "M22.167 20.006a.44.44 0 0 0-.355.316l-.001.006-.465 1.806a.3.3 0 0 1-.212.212l-1.806.466-.007.002a.442.442 0 0 0 0 .85l.007.001 1.806.466a.3.3 0 0 1 .212.211l.465 1.806.001.006a.441.441 0 0 0 .85 0l.002-.006.466-1.806a.3.3 0 0 1 .212-.211l1.806-.466.004-.001a.442.442 0 0 0 0-.852h-.004l-1.807-.466a.3.3 0 0 1-.211-.212l-.465-1.806-.002-.006a.44.44 0 0 0-.497-.316"
|
|
31
|
+
}), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
|
32
|
+
id: "paint0_linear_37801_44158",
|
|
33
|
+
x2: "86.619",
|
|
34
|
+
y1: "16",
|
|
35
|
+
y2: "78.512",
|
|
36
|
+
gradientUnits: "userSpaceOnUse"
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
38
|
+
stopColor: "#25c3f8"
|
|
39
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
40
|
+
offset: ".319",
|
|
41
|
+
stopColor: "#666fde"
|
|
42
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
43
|
+
offset: "1",
|
|
44
|
+
stopColor: "#ff0"
|
|
45
|
+
})), /*#__PURE__*/_react.default.createElement("linearGradient", {
|
|
46
|
+
id: "paint1_linear_37801_44158",
|
|
47
|
+
x1: "19",
|
|
48
|
+
x2: "36.531",
|
|
49
|
+
y1: "23.238",
|
|
50
|
+
y2: "35.89",
|
|
51
|
+
gradientUnits: "userSpaceOnUse"
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
53
|
+
stopColor: "#00b7ff"
|
|
54
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
55
|
+
offset: ".567",
|
|
56
|
+
stopColor: "#6a70e0"
|
|
57
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
58
|
+
offset: "1",
|
|
59
|
+
stopColor: "#ff0"
|
|
60
|
+
}))));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
ConversationIcon.defaultProps = {
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
width: "32",
|
|
66
|
+
height: "32",
|
|
67
|
+
fill: "none",
|
|
68
|
+
viewBox: "0 0 32 32"
|
|
26
69
|
};
|
|
27
70
|
|
|
28
71
|
var NotFoundConversation = function NotFoundConversation() {
|
|
29
72
|
var _useI18n = (0, _twakeI18n.useI18n)(),
|
|
30
73
|
t = _useI18n.t;
|
|
31
74
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
75
|
+
var theme = (0, _styles.useTheme)();
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_Empty.default, {
|
|
77
|
+
className: "u-h-100 u-bxz",
|
|
78
|
+
icon: /*#__PURE__*/_react.default.createElement(_Avatar.default, {
|
|
79
|
+
size: 64,
|
|
80
|
+
color: (0, _styles.alpha)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
82
|
+
icon: ConversationIcon,
|
|
83
|
+
size: 32,
|
|
84
|
+
preserveColor: true
|
|
85
|
+
})),
|
|
86
|
+
title: t('assistant.search_conversation.not_found_title'),
|
|
87
|
+
text: t('assistant.search_conversation.not_found_desc'),
|
|
88
|
+
componentsProps: {
|
|
89
|
+
title: {
|
|
90
|
+
variant: 'h4'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
48
94
|
};
|
|
49
95
|
|
|
50
96
|
var _default = NotFoundConversation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default SearchBarDesktop;
|
|
2
|
-
declare function SearchBarDesktop({ value, onClear, onChange, elevation, size, hasHalfBorderRadius, className, disabledHover }: {
|
|
2
|
+
declare function SearchBarDesktop({ value, onClear, onChange, elevation, size, hasHalfBorderRadius, className, disabledHover, disabledAssistantButton }: {
|
|
3
3
|
value: any;
|
|
4
4
|
onClear: any;
|
|
5
5
|
onChange: any;
|
|
@@ -8,6 +8,7 @@ declare function SearchBarDesktop({ value, onClear, onChange, elevation, size, h
|
|
|
8
8
|
hasHalfBorderRadius: any;
|
|
9
9
|
className: any;
|
|
10
10
|
disabledHover: any;
|
|
11
|
+
disabledAssistantButton: any;
|
|
11
12
|
}): JSX.Element;
|
|
12
13
|
declare namespace SearchBarDesktop {
|
|
13
14
|
namespace defaultProps {
|
|
@@ -33,8 +33,7 @@ var styles = {
|
|
|
33
33
|
"searchBarDesktop--result": "styles__searchBarDesktop--result___2bQQy",
|
|
34
34
|
"suggestionsPlaceholder": "styles__suggestionsPlaceholder___y-vsv",
|
|
35
35
|
"search-bar-icon": "styles__search-bar-icon___1affF",
|
|
36
|
-
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
37
|
-
"not-found-icon": "styles__not-found-icon___1as3P"
|
|
36
|
+
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
@@ -45,7 +44,8 @@ var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
|
45
44
|
size = _ref.size,
|
|
46
45
|
hasHalfBorderRadius = _ref.hasHalfBorderRadius,
|
|
47
46
|
className = _ref.className,
|
|
48
|
-
disabledHover = _ref.disabledHover
|
|
47
|
+
disabledHover = _ref.disabledHover,
|
|
48
|
+
disabledAssistantButton = _ref.disabledAssistantButton;
|
|
49
49
|
|
|
50
50
|
var _useSearch = (0, _SearchProvider.useSearch)(),
|
|
51
51
|
searchValue = _useSearch.searchValue,
|
|
@@ -123,7 +123,7 @@ var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
|
123
123
|
componentsProps: {
|
|
124
124
|
inputBase: {
|
|
125
125
|
onKeyDown: handleKeyDown,
|
|
126
|
-
endAdornment: (0, _helpers.isAssistantEnabled)() && /*#__PURE__*/_react.default.createElement(_AssistantButton.AssistantButton, {
|
|
126
|
+
endAdornment: (0, _helpers.isAssistantEnabled)() && !disabledAssistantButton && /*#__PURE__*/_react.default.createElement(_AssistantButton.AssistantButton, {
|
|
127
127
|
size: size
|
|
128
128
|
})
|
|
129
129
|
}
|
|
@@ -15,6 +15,8 @@ var styles = {
|
|
|
15
15
|
"composerContainer": "styles__composerContainer___3bNfY",
|
|
16
16
|
"composerContainer--mobile": "styles__composerContainer--mobile___nIYa-",
|
|
17
17
|
"composerContainer--mobile-dark": "styles__composerContainer--mobile-dark___12Go9",
|
|
18
|
+
"composerContainer--compact": "styles__composerContainer--compact___35e18",
|
|
19
|
+
"composerContainer--single-line": "styles__composerContainer--single-line___2yeWP",
|
|
18
20
|
"composer-dock": "styles__composer-dock___2nPT8",
|
|
19
21
|
"composerActions": "styles__composerActions___2xQEH",
|
|
20
22
|
"welcome": "styles__welcome___ozY_t",
|
|
@@ -47,6 +49,9 @@ var styles = {
|
|
|
47
49
|
"conversation-list-item-action": "styles__conversation-list-item-action___qiuKm",
|
|
48
50
|
"conversation-list-item--selected": "styles__conversation-list-item--selected___2D5_3",
|
|
49
51
|
"conversation-list-item--wider": "styles__conversation-list-item--wider___2Tl2c",
|
|
52
|
+
"conversation-list-item-container": "styles__conversation-list-item-container___36VTD",
|
|
53
|
+
"conversation-list-item-menu-button": "styles__conversation-list-item-menu-button___2ZYvH",
|
|
54
|
+
"conversation-list-item-secondary-action": "styles__conversation-list-item-secondary-action___2vwnw",
|
|
50
55
|
"conversation-list-item-text": "styles__conversation-list-item-text___31VBM",
|
|
51
56
|
"conversation-list-item-title": "styles__conversation-list-item-title___3je_6",
|
|
52
57
|
"conversation-list-item-subtitle": "styles__conversation-list-item-subtitle___3e_h0",
|
|
@@ -63,8 +63,7 @@ var styles = {
|
|
|
63
63
|
"searchBarDesktop--result": "styles__searchBarDesktop--result___2bQQy",
|
|
64
64
|
"suggestionsPlaceholder": "styles__suggestionsPlaceholder___y-vsv",
|
|
65
65
|
"search-bar-icon": "styles__search-bar-icon___1affF",
|
|
66
|
-
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
67
|
-
"not-found-icon": "styles__not-found-icon___1as3P"
|
|
66
|
+
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
68
67
|
};
|
|
69
68
|
|
|
70
69
|
var SearchConversationContainer = function SearchConversationContainer(_ref) {
|
|
@@ -167,7 +166,7 @@ var SearchConversation = function SearchConversation() {
|
|
|
167
166
|
return /*#__PURE__*/_react.default.createElement(SearchConversationContainer, {
|
|
168
167
|
isMobile: isMobile
|
|
169
168
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
-
className: (0, _classnames.default)('u-h-100 u-flex u-flex-column u-flex-items-start u-
|
|
169
|
+
className: (0, _classnames.default)('u-h-100 u-flex u-flex-column u-flex-items-start u-w-100', {
|
|
171
170
|
'u-maw-7': !isMobile
|
|
172
171
|
})
|
|
173
172
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -27,8 +27,7 @@ var styles = {
|
|
|
27
27
|
"searchBarDesktop--result": "styles__searchBarDesktop--result___2bQQy",
|
|
28
28
|
"suggestionsPlaceholder": "styles__suggestionsPlaceholder___y-vsv",
|
|
29
29
|
"search-bar-icon": "styles__search-bar-icon___1affF",
|
|
30
|
-
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
31
|
-
"not-found-icon": "styles__not-found-icon___1as3P"
|
|
30
|
+
"search-bar--mobile": "styles__search-bar--mobile___1CSb2"
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
var SuggestionsPlaceholder = function SuggestionsPlaceholder() {
|
|
@@ -12,8 +12,3 @@
|
|
|
12
12
|
.search-bar--mobile
|
|
13
13
|
border-radius 24px !important
|
|
14
14
|
height 48px
|
|
15
|
-
|
|
16
|
-
.not-found-icon
|
|
17
|
-
// The primary color at its hover opacity, as the design's token. unquote()
|
|
18
|
-
// keeps Stylus from parsing `in` as an operator.
|
|
19
|
-
background-color unquote('color-mix(in srgb, var(--primaryColor) 8%, transparent)')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function SidebarConversations(): JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SidebarConversations = void 0;
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _reactRouterDom = require("react-router-dom");
|
|
15
|
+
|
|
16
|
+
var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
17
|
+
|
|
18
|
+
var _LoadMore = _interopRequireDefault(require("cozy-ui/transpiled/react/LoadMore"));
|
|
19
|
+
|
|
20
|
+
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
21
|
+
|
|
22
|
+
var _twakeI18n = require("twake-i18n");
|
|
23
|
+
|
|
24
|
+
var _useConversation2 = _interopRequireDefault(require("../../hooks/useConversation"));
|
|
25
|
+
|
|
26
|
+
var _useFetchConversations = _interopRequireDefault(require("../../hooks/useFetchConversations"));
|
|
27
|
+
|
|
28
|
+
var _AssistantSidebarItem = _interopRequireDefault(require("../Assistant/AssistantSidebarItem"));
|
|
29
|
+
|
|
30
|
+
var _AssistantProvider = require("../AssistantProvider");
|
|
31
|
+
|
|
32
|
+
var _ConversationList = _interopRequireDefault(require("../Conversations/ConversationList"));
|
|
33
|
+
|
|
34
|
+
var styles = {
|
|
35
|
+
"sidebar-paper": "styles__sidebar-paper___3ymy8",
|
|
36
|
+
"sidebar-paper--docked": "styles__sidebar-paper--docked___1ESDJ",
|
|
37
|
+
"sidebar-paper--rail": "styles__sidebar-paper--rail___2xD9L",
|
|
38
|
+
"sidebar-paper--mobile": "styles__sidebar-paper--mobile___1pP8g",
|
|
39
|
+
"sidebar-drawer--mobile": "styles__sidebar-drawer--mobile___2Dziz",
|
|
40
|
+
"sidebar-conversations": "styles__sidebar-conversations___181kF",
|
|
41
|
+
"sidebar-new-chat": "styles__sidebar-new-chat___wlZiB",
|
|
42
|
+
"sidebar-mobile-toolbar": "styles__sidebar-mobile-toolbar___CHiUZ"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var SidebarConversations = function SidebarConversations() {
|
|
46
|
+
var _useI18n = (0, _twakeI18n.useI18n)(),
|
|
47
|
+
t = _useI18n.t;
|
|
48
|
+
|
|
49
|
+
var _useParams = (0, _reactRouterDom.useParams)(),
|
|
50
|
+
conversationId = _useParams.conversationId;
|
|
51
|
+
|
|
52
|
+
var _useAssistant = (0, _AssistantProvider.useAssistant)(),
|
|
53
|
+
isOpenSearchConversation = _useAssistant.isOpenSearchConversation;
|
|
54
|
+
|
|
55
|
+
var _useConversation = (0, _useConversation2.default)(),
|
|
56
|
+
goToConversation = _useConversation.goToConversation;
|
|
57
|
+
|
|
58
|
+
var _useFetchConversation = (0, _useFetchConversations.default)(),
|
|
59
|
+
conversations = _useFetchConversation.conversations,
|
|
60
|
+
hasMore = _useFetchConversation.hasMore,
|
|
61
|
+
fetchMore = _useFetchConversation.fetchMore;
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _cozyFlags.default)('cozy.assistant.create-assistant.enabled') && /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: "u-ph-1 u-mt-1"
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_AssistantSidebarItem.default, null)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
66
|
+
variant: "caption",
|
|
67
|
+
color: "textSecondary",
|
|
68
|
+
component: "h2",
|
|
69
|
+
className: "u-ph-1 u-mt-1 u-mb-half"
|
|
70
|
+
}, t('assistant.sidebar.recent_chats')), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
className: (0, _classnames.default)('u-flex-auto u-ov-auto u-ph-1 u-pb-half', styles['sidebar-conversations'])
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_ConversationList.default, {
|
|
73
|
+
conversations: conversations,
|
|
74
|
+
currentConversationId: isOpenSearchConversation ? null : conversationId,
|
|
75
|
+
onOpenConversation: goToConversation
|
|
76
|
+
}), hasMore && /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "u-flex u-flex-items-center u-flex-justify-center u-mt-1"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_LoadMore.default, {
|
|
79
|
+
fetchMore: fetchMore,
|
|
80
|
+
label: t('assistant.sidebar.conversation.actions.load_more')
|
|
81
|
+
}))));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.SidebarConversations = SidebarConversations;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SidebarDesktop = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _Drawer = _interopRequireDefault(require("cozy-ui/transpiled/react/Drawer"));
|
|
17
|
+
|
|
18
|
+
var _SidebarConversations = require("./SidebarConversations");
|
|
19
|
+
|
|
20
|
+
var _SidebarHeader = require("./SidebarHeader");
|
|
21
|
+
|
|
22
|
+
var _SidebarNewChatButton = require("./SidebarNewChatButton");
|
|
23
|
+
|
|
24
|
+
var styles = {
|
|
25
|
+
"sidebar-paper": "styles__sidebar-paper___3ymy8",
|
|
26
|
+
"sidebar-paper--docked": "styles__sidebar-paper--docked___1ESDJ",
|
|
27
|
+
"sidebar-paper--rail": "styles__sidebar-paper--rail___2xD9L",
|
|
28
|
+
"sidebar-paper--mobile": "styles__sidebar-paper--mobile___1pP8g",
|
|
29
|
+
"sidebar-drawer--mobile": "styles__sidebar-drawer--mobile___2Dziz",
|
|
30
|
+
"sidebar-conversations": "styles__sidebar-conversations___181kF",
|
|
31
|
+
"sidebar-new-chat": "styles__sidebar-new-chat___wlZiB",
|
|
32
|
+
"sidebar-mobile-toolbar": "styles__sidebar-mobile-toolbar___CHiUZ"
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var SidebarDesktop = function SidebarDesktop(_ref) {
|
|
36
|
+
var className = _ref.className,
|
|
37
|
+
open = _ref.open,
|
|
38
|
+
onToggle = _ref.onToggle,
|
|
39
|
+
onToggleSearch = _ref.onToggleSearch,
|
|
40
|
+
onCreateNewConversation = _ref.onCreateNewConversation;
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_Drawer.default, {
|
|
42
|
+
variant: "permanent",
|
|
43
|
+
className: "u-h-100",
|
|
44
|
+
classes: {
|
|
45
|
+
paper: (0, _classnames.default)(styles['sidebar-paper'], styles['sidebar-paper--docked'], (0, _defineProperty2.default)({}, styles['sidebar-paper--rail'], !open), className)
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(_SidebarHeader.SidebarHeader, {
|
|
48
|
+
isExpanded: open,
|
|
49
|
+
onToggle: onToggle,
|
|
50
|
+
onToggleSearch: onToggleSearch
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_SidebarNewChatButton.SidebarNewChatButton, {
|
|
52
|
+
isExpanded: open,
|
|
53
|
+
onClick: onCreateNewConversation
|
|
54
|
+
}), open && /*#__PURE__*/_react.default.createElement(_SidebarConversations.SidebarConversations, null));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.SidebarDesktop = SidebarDesktop;
|