26
26
</div >
27
27
<div v-else :class =" $style.inputContainer" >
28
28
<message-input-left-controls
29
- v-model:is-expanded =" isLeftControlsExpanded"
29
+ v-model:is-left-controls- expanded =" isLeftControlsExpanded"
30
30
v-model:is-preview-shown =" isPreviewShown"
31
+ v-model:is-input-text-area-expanded =" isInputTextAreaExpanded"
32
+ :show-text-area-expand-button =" showTextAreaExpandButton"
31
33
:class =" $style.leftControls"
32
34
@click-add-attachment =" addAttachment"
35
+ @toggle-left-controls-expanded ="
36
+ textareaComponentRef?.textareaAutosizeRef?.autosizeUpdateTextarea
37
+ "
33
38
/>
34
39
<message-input-text-area
35
40
ref =" textareaComponentRef"
36
41
v-model =" state.text"
42
+ v-model:show-text-area-expand-button =" showTextAreaExpandButton"
37
43
:channel-id =" channelId"
38
44
:is-posting =" isPosting"
39
45
:shrink-to-one-line ="
40
46
(forceMobileStyle || isMobile) && isLeftControlsExpanded
41
47
"
48
+ :is-input-text-area-expanded =" isInputTextAreaExpanded"
42
49
@focus =" onFocus"
43
50
@blur =" onBlur"
44
51
@add-attachments =" onAddAttachments"
58
65
</template >
59
66
60
67
<script lang="ts" setup>
61
- import MessageInputLeftControls from ' ./MessageInputLeftControls.vue'
62
- import MessageInputPreview from ' ./MessageInputPreview.vue'
63
- import MessageInputTypingUsers from ' ./MessageInputTypingUsers.vue'
64
- import MessageInputKeyGuide from ' ./MessageInputKeyGuide.vue'
65
- import MessageInputTextArea from ' ./MessageInputTextArea.vue'
66
- import MessageInputRightControls from ' ./MessageInputRightControls.vue'
67
- import MessageInputFileList from ' ./MessageInputFileList.vue'
68
- import MessageInputUploadProgress from ' ./MessageInputUploadProgress.vue'
69
- import AIcon from ' /@/components/UI/AIcon.vue'
70
68
import { computed , ref , toRef , watch , watchEffect } from ' vue'
71
- import type { ChannelId , DMChannelId , UserId } from ' /@/types/entity-ids'
72
- import { useResponsiveStore } from ' /@/store/ui/responsive'
73
69
import useTextStampPickerInvoker from ' ../composables/useTextStampPickerInvoker'
74
70
import useAttachments from ' ./composables/useAttachments'
75
71
import useModifierKey from ' ./composables/useModifierKey'
76
72
import usePostMessage from ' ./composables/usePostMessage'
73
+ import MessageInputFileList from ' ./MessageInputFileList.vue'
74
+ import MessageInputKeyGuide from ' ./MessageInputKeyGuide.vue'
75
+ import MessageInputLeftControls from ' ./MessageInputLeftControls.vue'
76
+ import MessageInputPreview from ' ./MessageInputPreview.vue'
77
+ import MessageInputRightControls from ' ./MessageInputRightControls.vue'
78
+ import MessageInputTextArea from ' ./MessageInputTextArea.vue'
79
+ import MessageInputTypingUsers from ' ./MessageInputTypingUsers.vue'
80
+ import MessageInputUploadProgress from ' ./MessageInputUploadProgress.vue'
81
+ import { $boolAttr } from ' /@/bool-attr'
82
+ import AIcon from ' /@/components/UI/AIcon.vue'
77
83
import useFocus from ' /@/composables/dom/useFocus'
78
- import { useToastStore } from ' /@/store/ui/toast'
79
84
import useMessageInputState from ' /@/composables/messageInputState/useMessageInputState'
80
85
import useMessageInputStateAttachment from ' /@/composables/messageInputState/useMessageInputStateAttachment'
81
86
import { useBrowserSettings } from ' /@/store/app/browserSettings'
82
- import { useChannelsStore } from ' /@/store/entities/channels'
83
87
import { useViewStateSenderStore } from ' /@/store/domain/viewStateSenderStore'
84
- import { $boolAttr } from ' /@/bool-attr'
88
+ import { useChannelsStore } from ' /@/store/entities/channels'
89
+ import { useResponsiveStore } from ' /@/store/ui/responsive'
90
+ import { useToastStore } from ' /@/store/ui/toast'
91
+ import type { ChannelId , DMChannelId , UserId } from ' /@/types/entity-ids'
85
92
86
93
const props = defineProps <{
87
94
channelId: ChannelId | DMChannelId
@@ -108,6 +115,8 @@ const { sendWithModifierKey } = useBrowserSettings()
108
115
const { channelsMap } = useChannelsStore ()
109
116
const isLeftControlsExpanded = ref (false )
110
117
const isPreviewShown = ref (false )
118
+ const isInputTextAreaExpanded = ref (true )
119
+ const showTextAreaExpandButton = ref (false )
111
120
112
121
const isArchived = computed (
113
122
() => channelsMap .value .get (props .channelId )?.archived ?? false
@@ -147,13 +156,11 @@ const showKeyGuide = computed(
147
156
(sendWithModifierKey .value !== ' modifier' || canPostMessage .value )
148
157
)
149
158
150
- const textareaComponentRef = ref <{
151
- textareaAutosizeRef: { $el: HTMLTextAreaElement }
152
- }>()
159
+ const textareaComponentRef = ref <InstanceType <typeof MessageInputTextArea >>()
153
160
const containerEle = ref <HTMLDivElement >()
154
161
const { toggleStampPicker } = useTextStampPickerInvoker (
155
162
toRef (state , ' text' ),
156
- computed (() => textareaComponentRef .value ?.textareaAutosizeRef .$el ),
163
+ computed (() => textareaComponentRef .value ?.textareaAutosizeRef ? .$el ),
157
164
containerEle
158
165
)
159
166
@@ -194,7 +201,6 @@ $radius: 4px;
194
201
display : flex ;
195
202
flex-direction : row ;
196
203
justify-content : space-between ;
197
- align-items : flex-end ;
198
204
199
205
& [data-is-archived ] {
200
206
@include color-ui-secondary-inactive ;
@@ -219,7 +225,7 @@ $radius: 4px;
219
225
}
220
226
}
221
227
.leftControls {
222
- margin : 8 px 8px 8px 0 ;
228
+ margin : 2 px 8px 8px 0 ;
223
229
}
224
230
.rightControls {
225
231
position : absolute ;
0 commit comments