discourse/plugins/chat/assets/stylesheets/common/index.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.2 KiB
SCSS
Raw Normal View History

@import "chat-unread-indicator";
@import "chat-height-mixin";
@import "base-common";
@import "chat-drawer-routes";
@import "chat-browse";
UX: improves composer and thread panel (#21210) This pull request is a full overhaul of the chat-composer and contains various improvements to the thread panel. They have been grouped in the same PR as lots of improvements/fixes to the thread panel needed an improved composer. This is meant as a first step. ### New features included in this PR - A resizable side panel - A clear dropzone area for uploads - A simplified design for image uploads, this is only a first step towards more redesign of this area in the future ### Notable fixes in this PR - Correct placeholder in thread panel - Allows to edit the last message of a thread with arrow up - Correctly focus composer when replying to a message - The reply indicator is added instantly in the channel when starting a thread - Prevents a large variety of bug where the composer could bug and prevent sending message or would clear your input while it has content ### Technical notes To achieve this PR, three important changes have been made: - `<ChatComposer>` has been fully rewritten and is now a glimmer component - The chat composer now takes a `ChatMessage` as input which can directly be used in other operations, it simplifies a lot of logic as we are always working a with a `ChatMessage` - `TextareaInteractor` has been created to wrap the existing `TextareaTextManipulation` mixin, it will make future migrations easier and allow us to have a less polluted `<ChatComposer>` Note ".chat-live-pane" has been renamed ".chat-channel" Design for upload dropzone is from @chapoi
2023-04-25 16:23:03 +08:00
@import "chat-channel";
@import "chat-channel-card";
@import "chat-channel-icon";
@import "chat-channel-info";
@import "chat-channel-name";
@import "chat-channel-preview-card";
@import "chat-channel-title";
@import "chat-composer-dropdown";
@import "chat-composer-upload";
@import "chat-composer-uploads";
@import "chat-thread-heading";
@import "chat-composer";
@import "chat-composer-button";
DEV: adds blocks support to chat messages (#29782) Blocks allow BOTS to augment the capacities of a chat message. At the moment only one block is available: `actions`, accepting only one type of element: `button`. <img width="708" alt="Screenshot 2024-11-15 at 19 14 02" src="https://github.com/user-attachments/assets/63f32a29-05b1-4f32-9edd-8d8e1007d705"> # Usage ```ruby Chat::CreateMessage.call( params: { message: "Welcome!", chat_channel_id: 2, blocks: [ { type: "actions", elements: [ { value: "foo", type: "button", text: { text: "How can I install themes?", type: "plain_text" } } ] } ] }, guardian: Discourse.system_user.guardian ) ``` # Documentation ## Blocks ### Actions Holds interactive elements: button. #### Fields | Field | Type | Description | Required? | |--------|--------|--------|--------| | type | string | For an actions block, type is always `actions` | Yes | | elements | array | An array of interactive elements, maximum 10 elements | Yes | | block_id | string | An unique identifier for the block, will be generated if not specified. It has to be unique per message | No | #### Example ```json { "type": "actions", "block_id": "actions_1", "elements": [...] } ``` ## Elements ### Button #### Fields | Field | Type | Description | Required? | |--------|--------|--------|--------| | type | string | For a button, type is always `button` | Yes | | text | object | A text object holding the type and text. Max 75 characters | Yes | | value | string | The value returned after the interaction has been validated. Maximum length is 2000 characters | No | | style | string | Can be `primary` , `success` or `danger` | No | | action_id | string | An unique identifier for the action, will be generated if not specified. It has to be unique per message | No | #### Example ```json { "type": "actions", "block_id": "actions_1", "elements": [ { "type": "button", "text": { "type": "plain_text", "text": "Ok" }, "value": "ok", "action_id": "button_1" } ] } ``` ## Interactions When a user interactions with a button the following flow will happen: - We send an interaction request to the server - Server checks if the user can make this interaction - If the user can make this interaction, the server will: * `DiscourseEvent.trigger(:chat_message_interaction, interaction)` * return a JSON document ```json { "interaction": { "user": { "id": 1, "username": "j.jaffeux" }, "channel": { "id": 1, "title": "Staff" }, "message": { "id": 1, "text": "test", "user_id": -1 }, "action": { "text": { "text": "How to install themes?", "type": "plain_text" }, "type": "button", "value": "click_me_123", "action_id": "bf4f30b9-de99-4959-b3f5-632a6a1add04" } } } ``` * Fire a `appEvents.trigger("chat:message_interaction", interaction)`
2024-11-19 14:07:58 +08:00
@import "chat-message-blocks";
@import "chat-drawer";
@import "chat-emoji-picker";
@import "chat-form";
@import "chat-index";
@import "chat-mention-warnings";
@import "chat-message-actions";
@import "chat-message-collapser";
@import "chat-message-images";
@import "chat-message-info";
@import "chat-message-left-gutter";
@import "chat-message-separator";
@import "chat-message-thread-indicator";
@import "chat-message";
@import "chat-notices";
@import "chat-onebox";
@import "chat-reply";
@import "chat-replying-indicator";
@import "chat-selection-manager";
@import "chat-skeleton";
@import "chat-thread";
UX: improves composer and thread panel (#21210) This pull request is a full overhaul of the chat-composer and contains various improvements to the thread panel. They have been grouped in the same PR as lots of improvements/fixes to the thread panel needed an improved composer. This is meant as a first step. ### New features included in this PR - A resizable side panel - A clear dropzone area for uploads - A simplified design for image uploads, this is only a first step towards more redesign of this area in the future ### Notable fixes in this PR - Correct placeholder in thread panel - Allows to edit the last message of a thread with arrow up - Correctly focus composer when replying to a message - The reply indicator is added instantly in the channel when starting a thread - Prevents a large variety of bug where the composer could bug and prevent sending message or would clear your input while it has content ### Technical notes To achieve this PR, three important changes have been made: - `<ChatComposer>` has been fully rewritten and is now a glimmer component - The chat composer now takes a `ChatMessage` as input which can directly be used in other operations, it simplifies a lot of logic as we are always working a with a `ChatMessage` - `TextareaInteractor` has been created to wrap the existing `TextareaTextManipulation` mixin, it will make future migrations easier and allow us to have a less polluted `<ChatComposer>` Note ".chat-live-pane" has been renamed ".chat-channel" Design for upload dropzone is from @chapoi
2023-04-25 16:23:03 +08:00
@import "chat-side-panel-resizer";
@import "chat-upload-drop-zone";
@import "chat-transcript";
@import "core-extensions";
@import "dc-filter-input";
@import "incoming-chat-webhooks";
@import "reviewable-chat-message";
@import "chat-thread-list-item";
@import "chat-threads-list";
@import "chat-composer-separator";
@import "chat-thread-header";
@import "chat-thread-list-header";
@import "chat-thread-unread-indicator";
@import "chat-thread-participants";
@import "chat-message-error";
@import "chat-message-creator";
@import "chat-user-avatar";
@import "chat-modal-new-message";
@import "chat-modal-archive-channel";
@import "chat-modal-edit-channel-description";
@import "chat-modal-create-channel";
@import "chat-modal-create-channel";
@import "chat-modal-channel-summary";
@import "chat-modal-move-message-to-channel";
@import "chat-scroll-to-bottom";
@import "chat-channel-row";
@import "chat-channel-members";
@import "chat-channel-settings";
@import "chat-user-threads";
@import "chat-navbar";
@import "chat-thread-title";
@import "chat-audio-upload";
@import "chat-message-text";
@import "chat-messages-scroller";
@import "chat-footer";