From 3657d89a62b1bf619a61a34d8f916397a159c927 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Thu, 15 Aug 2024 12:55:09 +0530 Subject: [PATCH 01/20] init add new hook --- .../message/toolbar/MessageToolbar.tsx | 16 ++++- .../client/hooks/useAppActionButtons.ts | 60 +++++++++++++++++++ .../src/interactions/UserInteraction.ts | 17 +++++- 3 files changed, 90 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx index 183aea7190d9b..6633b1076db3f 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx @@ -1,7 +1,7 @@ import { useToolbar } from '@react-aria/toolbar'; import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; import { isThreadMessage, isRoomFederated, isVideoConfMessage, isE2EEMessage } from '@rocket.chat/core-typings'; -import { MessageToolbar as FuselageMessageToolbar, MessageToolbarItem } from '@rocket.chat/fuselage'; +import { MessageToolbar as FuselageMessageToolbar, MenuItem, MenuV2, MessageToolbarItem } from '@rocket.chat/fuselage'; import { useFeaturePreview } from '@rocket.chat/ui-client'; import { useUser, useSettings, useTranslation, useMethod, useLayoutHiddenActions } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; @@ -11,7 +11,7 @@ import React, { memo, useMemo, useRef } from 'react'; import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; import { useEmojiPickerData } from '../../../contexts/EmojiPickerContext'; -import { useMessageActionAppsActionButtons } from '../../../hooks/useAppActionButtons'; +import { useMessageActionAppsActionButtons, useMessageToolbarStarsAppsAction } from '../../../hooks/useAppActionButtons'; import { useEmbeddedLayout } from '../../../hooks/useEmbeddedLayout'; import EmojiElement from '../../../views/composer/EmojiPicker/EmojiElement'; import { useIsSelecting } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; @@ -77,7 +77,11 @@ const MessageToolbar = ({ const { quickReactions, addRecentEmoji } = useEmojiPickerData(); const actionButtonApps = useMessageActionAppsActionButtons(context); + // console.log(actionButtonApps); + const starsAction = useMessageToolbarStarsAppsAction(context); + + console.log('\n\nstarsAction', starsAction, '\n\n'); const { messageToolbox: hiddenActions } = useLayoutHiddenActions(); // TODO: move this to another place @@ -135,6 +139,14 @@ const MessageToolbar = ({ disabled={action?.disabled?.({ message, room, user, subscription, settings: mapSettings, chat, context })} /> ))} + {/* */} + {starsAction.data && starsAction.data.length > 0 && ( + + Test + + )} + {/* */} + {actionsQueryResult.isSuccess && actionsQueryResult.data.menu.length > 0 && ( ({ diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 5ee20f7772bf1..1cfa54728d185 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -219,3 +219,63 @@ export const useMessageActionAppsActionButtons = (context?: MessageActionContext data, } as UseQueryResult; }; + +export const useMessageToolbarStarsAppsAction = (context?: MessageActionContext) => { + const result = useAppActionButtons('messageToolbarStarsAction'); + const actionManager = useUiKitActionManager(); + const applyButtonFilters = useApplyButtonFilters(); + const dispatchToastMessage = useToastMessageDispatch(); + const { t } = useTranslation(); + const data = useMemo( + () => + result.data + ?.filter((action) => { + if ( + context && + !(action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes(context as any) + ) { + return false; + } + return applyButtonFilters(action); + }) + .map((action) => { + const item: MessageActionConfig = { + icon: undefined as any, + id: getIdForActionButton(action), + label: Utilities.getI18nKeyForApp(action.labelI18n, action.appId), + order: 7, + type: 'apps', + variant: action.variant, + action: (_, params) => { + void actionManager + .emitInteraction(action.appId, { + type: 'actionButton', + rid: params.message.rid, + tmid: params.message.tmid, + mid: params.message._id, + actionId: action.actionId, + payload: { context: action.context }, + }) + .catch(async (reason) => { + if (reason instanceof UiKitTriggerTimeoutError) { + dispatchToastMessage({ + type: 'error', + message: t('UIKit_Interaction_Timeout'), + }); + return; + } + + return reason; + }); + }, + }; + + return item; + }), + [actionManager, applyButtonFilters, context, dispatchToastMessage, result.data, t], + ); + return { + ...result, + data, + } as UseQueryResult; +}; diff --git a/packages/ui-kit/src/interactions/UserInteraction.ts b/packages/ui-kit/src/interactions/UserInteraction.ts index 384275e9d45fe..e3f71a6a19694 100644 --- a/packages/ui-kit/src/interactions/UserInteraction.ts +++ b/packages/ui-kit/src/interactions/UserInteraction.ts @@ -98,6 +98,19 @@ export type MesssageActionButtonUserInteraction = { triggerId: string; }; +export type MessageToolbarStarsActionButtonUserInteraction = { + type: 'actionButton'; + actionId: string; + payload: { + context: 'messageToolbarStarsAction'; + message?: undefined; + }; + mid: string; + tmid?: string; + rid: string; + triggerId: string; +}; + export type RoomActionButtonUserInteraction = { type: 'actionButton'; actionId: string; @@ -119,7 +132,8 @@ export type UserInteraction = | MessageBoxActionButtonUserInteraction | UserDropdownActionButtonUserInteraction | MesssageActionButtonUserInteraction - | RoomActionButtonUserInteraction; + | RoomActionButtonUserInteraction + | MessageToolbarStarsActionButtonUserInteraction; export const isMessageBlockActionUserInteraction = typia.createIs(); export const isViewBlockActionUserInteraction = typia.createIs(); @@ -129,3 +143,4 @@ export const isMessageBoxActionButtonUserInteraction = typia.createIs(); export const isMesssageActionButtonUserInteraction = typia.createIs(); export const isRoomActionButtonUserInteraction = typia.createIs(); +export const isMessageToolbarStarsActionButtonUserInteraction = typia.createIs(); From 01fd0c68021b95ce98b514169234d02a9f3dd9b2 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Thu, 15 Aug 2024 17:13:55 +0530 Subject: [PATCH 02/20] add message action menu --- .../message/toolbar/MessageToolbar.tsx | 20 ++-- .../toolbar/MessageToolbarStarsActionMenu.tsx | 98 +++++++++++++++++++ 2 files changed, 110 insertions(+), 8 deletions(-) create mode 100644 apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx index 6633b1076db3f..3390e459ccffd 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx @@ -1,7 +1,7 @@ import { useToolbar } from '@react-aria/toolbar'; import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; import { isThreadMessage, isRoomFederated, isVideoConfMessage, isE2EEMessage } from '@rocket.chat/core-typings'; -import { MessageToolbar as FuselageMessageToolbar, MenuItem, MenuV2, MessageToolbarItem } from '@rocket.chat/fuselage'; +import { MessageToolbar as FuselageMessageToolbar, MessageToolbarItem } from '@rocket.chat/fuselage'; import { useFeaturePreview } from '@rocket.chat/ui-client'; import { useUser, useSettings, useTranslation, useMethod, useLayoutHiddenActions } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; @@ -19,6 +19,7 @@ import { useAutoTranslate } from '../../../views/room/MessageList/hooks/useAutoT import { useChat } from '../../../views/room/contexts/ChatContext'; import { useRoomToolbox } from '../../../views/room/contexts/RoomToolboxContext'; import MessageActionMenu from './MessageActionMenu'; +import MessageToolbarStarsActionMenu from './MessageToolbarStarsActionMenu'; import { useWebDAVMessageAction } from './useWebDAVMessageAction'; const getMessageContext = (message: IMessage, room: IRoom, context?: MessageActionContext): MessageActionContext => { @@ -77,11 +78,9 @@ const MessageToolbar = ({ const { quickReactions, addRecentEmoji } = useEmojiPickerData(); const actionButtonApps = useMessageActionAppsActionButtons(context); - // console.log(actionButtonApps); const starsAction = useMessageToolbarStarsAppsAction(context); - console.log('\n\nstarsAction', starsAction, '\n\n'); const { messageToolbox: hiddenActions } = useLayoutHiddenActions(); // TODO: move this to another place @@ -139,13 +138,18 @@ const MessageToolbar = ({ disabled={action?.disabled?.({ message, room, user, subscription, settings: mapSettings, chat, context })} /> ))} - {/* */} {starsAction.data && starsAction.data.length > 0 && ( - - Test - + ({ + ...action, + action: (e) => action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions }), + }))} + onChangeMenuVisibility={onChangeMenuVisibility} + data-qa-type='message-action-stars-menu-options' + context={{ message, room, user, subscription, settings: mapSettings, chat, context }} + isMessageEncrypted={isE2EEMessage(message)} + /> )} - {/* */} {actionsQueryResult.isSuccess && actionsQueryResult.data.menu.length > 0 && ( & { + action: (e?: MouseEvent) => void; +}; + +type MessageActionSection = { + id: string; + title: string; + items: GenericMenuItemProps[]; +}; + +type MessageActionMenuProps = { + onChangeMenuVisibility: (visible: boolean) => void; + options: MessageActionConfigOption[]; + context: MessageActionConditionProps; + isMessageEncrypted: boolean; +}; + +const MessageToolbarStarsActionMenu = ({ + options, + onChangeMenuVisibility, + context, + isMessageEncrypted, +}: MessageActionMenuProps): ReactElement => { + const t = useTranslation(); + const id = useUniqueId(); + const groupOptions = options + .map((option) => ({ + variant: option.color === 'alert' ? 'danger' : '', + id: option.id, + icon: option.icon, + content: t(option.label), + onClick: option.action, + type: option.type, + ...(option.disabled && { disabled: option?.disabled?.(context) }), + ...(option.disabled && + option?.disabled?.(context) && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }), + })) + .reduce((acc, option) => { + const group = option.type ? option.type : ''; + const section = acc.find((section: { id: string }) => section.id === group); + if (section) { + section.items.push(option); + return acc; + } + + const newSection = { id: group, title: '', items: [option] }; + acc.push(newSection); + return acc; + }, [] as unknown as MessageActionSection[]) + .map((section) => { + if (section.id !== 'apps') { + return section; + } + + if (!isMessageEncrypted) { + return section; + } + + return { + id: 'apps', + title: t('Apps'), + items: [ + { + content: t('Unavailable'), + type: 'apps', + id, + disabled: true, + gap: false, + tooltip: t('Action_not_available_encrypted_content', { action: t('Apps') }), + }, + ], + }; + }); + + return ( + + ); +}; + +export default MessageToolbarStarsActionMenu; From 6bc0a97ca9d3958b370c1917b9d9ca75b9c78221 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Thu, 15 Aug 2024 20:45:32 +0530 Subject: [PATCH 03/20] Add AI Actions to en.i18n.json --- packages/i18n/src/locales/en.i18n.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 12f0dbf628c50..2c93e397baa5f 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -386,6 +386,7 @@ "Agent_Without_Extensions": "Agent Without Extensions", "Agents": "Agents", "Agree": "Agree", + "AI_Actions": "AI Actions", "Alerts": "Alerts", "Alias": "Alias", "Alias_Format": "Alias Format", @@ -6500,4 +6501,4 @@ "Incoming_Calls": "Incoming calls", "Advanced_settings": "Advanced settings", "Security_and_permissions": "Security and permissions" -} +} \ No newline at end of file From 822c21c602aa92459fbe9633b5a7514d50b16e4e Mon Sep 17 00:00:00 2001 From: Dnouv Date: Thu, 15 Aug 2024 21:08:21 +0530 Subject: [PATCH 04/20] add changeset --- .changeset/red-crews-behave.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/red-crews-behave.md diff --git a/.changeset/red-crews-behave.md b/.changeset/red-crews-behave.md new file mode 100644 index 0000000000000..721f7e4db0dc2 --- /dev/null +++ b/.changeset/red-crews-behave.md @@ -0,0 +1,7 @@ +--- +'@rocket.chat/ui-kit': minor +'@rocket.chat/i18n': minor +'@rocket.chat/meteor': minor +--- + +New UI context for Rocket.Chat Apps to register actions, specifically targeting AI Actions. From 5f54fbfcc176900ee7ef3820131acb0a11f5b0fa Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 21 Aug 2024 03:14:08 +0530 Subject: [PATCH 05/20] update apps engine --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/ddp-streamer/package.json | 2 +- ee/packages/presence/package.json | 2 +- packages/apps/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/rest-typings/package.json | 2 +- yarn.lock | 26 ++++++++++----------- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 76a0c59d54e61..4aaff739e4d06 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -18,7 +18,7 @@ "author": "Rocket.Chat", "license": "MIT", "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "~0.31.25", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 5addaf756f8a2..8f2138b47b7de 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -230,7 +230,7 @@ "@rocket.chat/agenda": "workspace:^", "@rocket.chat/api-client": "workspace:^", "@rocket.chat/apps": "workspace:^", - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/base64": "workspace:^", "@rocket.chat/cas-validate": "workspace:^", "@rocket.chat/core-services": "workspace:^", diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index fdee5d5d3b9a7..9bf49018ed0a6 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -15,7 +15,7 @@ ], "author": "Rocket.Chat", "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "~0.31.25", diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 21f1883b67046..ad160821647c0 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -6,7 +6,7 @@ "@babel/core": "~7.22.20", "@babel/preset-env": "~7.22.20", "@babel/preset-typescript": "~7.22.15", - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", "@types/node": "^14.18.63", diff --git a/packages/apps/package.json b/packages/apps/package.json index 15289501be4cc..0aca06fdf0704 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -18,7 +18,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/model-typings": "workspace:^" } diff --git a/packages/core-services/package.json b/packages/core-services/package.json index d576f87bef277..02176d6bf88c0 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -34,7 +34,7 @@ "extends": "../../package.json" }, "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/icons": "^0.36.0", "@rocket.chat/message-parser": "workspace:^", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 267e75e5c1771..499dab0156b6e 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -22,7 +22,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/icons": "^0.36.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~" diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 6d6b882c89d26..1017697680176 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -63,7 +63,7 @@ "@babel/preset-env": "~7.22.20", "@babel/preset-react": "~7.22.15", "@babel/preset-typescript": "~7.22.15", - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.57.0", diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 6a5bf5464e98a..896e789006260 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -23,7 +23,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.44.0", + "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~", diff --git a/yarn.lock b/yarn.lock index 00ca4ab5c550a..90a52b8636d69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8483,9 +8483,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/apps-engine@npm:1.44.0": - version: 1.44.0 - resolution: "@rocket.chat/apps-engine@npm:1.44.0" +"@rocket.chat/apps-engine@npm:1.45.0-alpha.864": + version: 1.45.0-alpha.864 + resolution: "@rocket.chat/apps-engine@npm:1.45.0-alpha.864" dependencies: "@msgpack/msgpack": 3.0.0-beta2 adm-zip: ^0.5.9 @@ -8501,7 +8501,7 @@ __metadata: uuid: ~8.3.2 peerDependencies: "@rocket.chat/ui-kit": "*" - checksum: f2b1b13c6a070c8d320a6d681ede6945a5882f9e2d42f2569bfc8c098229f761c7ef358589d3f1714d17b157fafa8e4869f28752408356f4a9286f62cb517f46 + checksum: 4f223dd0671d920e4eaafa465fe87584473f3295061252d1020c0d0e1c076c3b74ee98af1ee5aedfeb72b042e38c3f381d10a151b3a2abcf33a7de8ac6146fa1 languageName: node linkType: hard @@ -8509,7 +8509,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/apps@workspace:packages/apps" dependencies: - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/model-typings": "workspace:^" eslint: ~8.45.0 @@ -8582,7 +8582,7 @@ __metadata: "@babel/core": ~7.22.20 "@babel/preset-env": ~7.22.20 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/icons": ^0.36.0 @@ -8609,7 +8609,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/core-typings@workspace:packages/core-typings" dependencies: - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/icons": ^0.36.0 "@rocket.chat/message-parser": "workspace:^" @@ -8681,7 +8681,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer" dependencies: - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/ddp-client": "workspace:~" @@ -8879,7 +8879,7 @@ __metadata: "@babel/preset-env": ~7.22.20 "@babel/preset-react": ~7.22.15 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.57.0 @@ -9329,7 +9329,7 @@ __metadata: "@rocket.chat/agenda": "workspace:^" "@rocket.chat/api-client": "workspace:^" "@rocket.chat/apps": "workspace:^" - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/base64": "workspace:^" "@rocket.chat/cas-validate": "workspace:^" "@rocket.chat/core-services": "workspace:^" @@ -9953,7 +9953,7 @@ __metadata: "@babel/core": ~7.22.20 "@babel/preset-env": ~7.22.20 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" @@ -10067,7 +10067,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/rest-typings@workspace:packages/rest-typings" dependencies: - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:~" "@rocket.chat/message-parser": "workspace:^" @@ -36719,7 +36719,7 @@ __metadata: version: 0.0.0-use.local resolution: "rocketchat-services@workspace:apps/meteor/ee/server/services" dependencies: - "@rocket.chat/apps-engine": 1.44.0 + "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": ~0.31.25 From 7a16d5586010226fede3a182f35ebd4d692a6c48 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 21 Aug 2024 06:24:29 +0530 Subject: [PATCH 06/20] update rc-icons --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/packages/ui-theming/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/ui-client/package.json | 2 +- packages/ui-composer/package.json | 2 +- packages/ui-kit/package.json | 2 +- packages/ui-video-conf/package.json | 2 +- packages/uikit-playground/package.json | 2 +- yarn.lock | 30 ++++++++++----------- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 4aaff739e4d06..2d924d8304cd1 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -50,7 +50,7 @@ "ws": "^8.8.1" }, "devDependencies": { - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@types/cookie": "^0.5.3", "@types/cookie-parser": "^1.4.5", "@types/ejson": "^2.2.1", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 8f2138b47b7de..45c2586889fcc 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -249,7 +249,7 @@ "@rocket.chat/fuselage-ui-kit": "workspace:^", "@rocket.chat/gazzodown": "workspace:^", "@rocket.chat/i18n": "workspace:^", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/instance-status": "workspace:^", "@rocket.chat/jwt": "workspace:^", "@rocket.chat/layout": "~0.31.26", diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index d1929c8b93f09..ce0b2e7c207da 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -6,7 +6,7 @@ "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/ui-contexts": "workspace:~", "@types/react": "~17.0.69", "eslint": "~8.45.0", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 02176d6bf88c0..50859baf43481 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -36,7 +36,7 @@ "dependencies": { "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 499dab0156b6e..ba1a2a9a88833 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -23,7 +23,7 @@ ], "dependencies": { "@rocket.chat/apps-engine": "1.45.0-alpha.864", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~" }, diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 1017697680176..4049d513a0e51 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -69,7 +69,7 @@ "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", "@rocket.chat/fuselage-polyfills": "~0.31.25", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/prettier-config": "~0.31.25", diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 69ca7e8b7f5be..3c3036b6fef11 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -8,7 +8,7 @@ "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/ui-contexts": "workspace:~", diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 2b3fae217aaca..2121b5e69f7f8 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -20,7 +20,7 @@ "@react-aria/toolbar": "^3.0.0-beta.1", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.57.0", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@storybook/addon-actions": "~6.5.16", "@storybook/addon-docs": "~6.5.16", "@storybook/addon-essentials": "~6.5.16", diff --git a/packages/ui-kit/package.json b/packages/ui-kit/package.json index 44aac1e25d177..08e2d829c93c7 100644 --- a/packages/ui-kit/package.json +++ b/packages/ui-kit/package.json @@ -40,7 +40,7 @@ "@babel/plugin-transform-runtime": "~7.21.4", "@babel/preset-env": "~7.21.4", "@rocket.chat/eslint-config": "workspace:~", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/jest-presets": "workspace:~", "@types/jest": "~29.5.12", "babel-loader": "~9.1.2", diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index d0dc218808c94..a603654f7a8c1 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -8,7 +8,7 @@ "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 750f608931883..f6a227f7c1065 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -21,7 +21,7 @@ "@rocket.chat/fuselage-toastbar": "^0.33.0", "@rocket.chat/fuselage-tokens": "^0.33.1", "@rocket.chat/fuselage-ui-kit": "workspace:~", - "@rocket.chat/icons": "^0.36.0", + "@rocket.chat/icons": "^0.37.0", "@rocket.chat/logo": "^0.31.30", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", diff --git a/yarn.lock b/yarn.lock index 64d79a0d27e6e..1fe5f3687e147 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8585,7 +8585,7 @@ __metadata: "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/models": "workspace:^" @@ -8611,7 +8611,7 @@ __metadata: dependencies: "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/ui-kit": "workspace:~" eslint: ~8.45.0 @@ -8886,7 +8886,7 @@ __metadata: "@rocket.chat/fuselage-hooks": ^0.33.1 "@rocket.chat/fuselage-polyfills": ~0.31.25 "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/prettier-config": ~0.31.25 @@ -9039,10 +9039,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:^0.36.0": - version: 0.36.0 - resolution: "@rocket.chat/icons@npm:0.36.0" - checksum: ebec57fdfc9bac3b0b29ba43d9ac316b55f6e4177fa4456de195352d6add1e15e25c4d72e6a4fdc3d33abaabf8af0ca7eb0d36badb360113a19c15a13d68aed5 +"@rocket.chat/icons@npm:^0.37.0": + version: 0.37.0 + resolution: "@rocket.chat/icons@npm:0.37.0" + checksum: c80dee4298d960b3d7d6c030a0ca00e48c7723ab4f2d9b4086c0f0464000065f1d085b6a5d7ae0249071ccef0e499523bf9c838962f3c2999035eef53d3318d3 languageName: node linkType: hard @@ -9349,7 +9349,7 @@ __metadata: "@rocket.chat/fuselage-ui-kit": "workspace:^" "@rocket.chat/gazzodown": "workspace:^" "@rocket.chat/i18n": "workspace:^" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/instance-status": "workspace:^" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/jwt": "workspace:^" @@ -10242,7 +10242,7 @@ __metadata: "@rocket.chat/css-in-js": ~0.31.25 "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/ui-contexts": "workspace:~" @@ -10291,7 +10291,7 @@ __metadata: "@react-aria/toolbar": ^3.0.0-beta.1 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.57.0 - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@storybook/addon-actions": ~6.5.16 "@storybook/addon-docs": ~6.5.16 "@storybook/addon-essentials": ~6.5.16 @@ -10360,7 +10360,7 @@ __metadata: "@babel/plugin-transform-runtime": ~7.21.4 "@babel/preset-env": ~7.21.4 "@rocket.chat/eslint-config": "workspace:~" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/jest-presets": "workspace:~" "@types/jest": ~29.5.12 babel-loader: ~9.1.2 @@ -10387,7 +10387,7 @@ __metadata: "@rocket.chat/css-in-js": ~0.31.25 "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/ui-contexts": "workspace:~" "@types/react": ~17.0.69 eslint: ~8.45.0 @@ -10417,7 +10417,7 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/styled": ~0.31.25 "@rocket.chat/ui-avatar": "workspace:^" @@ -10470,7 +10470,7 @@ __metadata: "@rocket.chat/fuselage-toastbar": ^0.33.0 "@rocket.chat/fuselage-tokens": ^0.33.1 "@rocket.chat/fuselage-ui-kit": "workspace:~" - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/logo": ^0.31.30 "@rocket.chat/styled": ~0.31.25 "@rocket.chat/ui-avatar": "workspace:^" @@ -36736,7 +36736,7 @@ __metadata: "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": ~0.31.25 - "@rocket.chat/icons": ^0.36.0 + "@rocket.chat/icons": ^0.37.0 "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" From f99b4cdff45a8e56afaed2c24f8e2f8e1f120c39 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 21 Aug 2024 12:51:15 +0530 Subject: [PATCH 07/20] Revert "update rc-icons" This reverts commit 7a16d5586010226fede3a182f35ebd4d692a6c48. --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/packages/ui-theming/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/ui-client/package.json | 2 +- packages/ui-composer/package.json | 2 +- packages/ui-kit/package.json | 2 +- packages/ui-video-conf/package.json | 2 +- packages/uikit-playground/package.json | 2 +- yarn.lock | 30 ++++++++++----------- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 2d924d8304cd1..4aaff739e4d06 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -50,7 +50,7 @@ "ws": "^8.8.1" }, "devDependencies": { - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@types/cookie": "^0.5.3", "@types/cookie-parser": "^1.4.5", "@types/ejson": "^2.2.1", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 45c2586889fcc..8f2138b47b7de 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -249,7 +249,7 @@ "@rocket.chat/fuselage-ui-kit": "workspace:^", "@rocket.chat/gazzodown": "workspace:^", "@rocket.chat/i18n": "workspace:^", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/instance-status": "workspace:^", "@rocket.chat/jwt": "workspace:^", "@rocket.chat/layout": "~0.31.26", diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index ce0b2e7c207da..d1929c8b93f09 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -6,7 +6,7 @@ "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/ui-contexts": "workspace:~", "@types/react": "~17.0.69", "eslint": "~8.45.0", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 50859baf43481..02176d6bf88c0 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -36,7 +36,7 @@ "dependencies": { "@rocket.chat/apps-engine": "1.45.0-alpha.864", "@rocket.chat/core-typings": "workspace:^", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index ba1a2a9a88833..499dab0156b6e 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -23,7 +23,7 @@ ], "dependencies": { "@rocket.chat/apps-engine": "1.45.0-alpha.864", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~" }, diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 4049d513a0e51..1017697680176 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -69,7 +69,7 @@ "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", "@rocket.chat/fuselage-polyfills": "~0.31.25", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/prettier-config": "~0.31.25", diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 3c3036b6fef11..69ca7e8b7f5be 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -8,7 +8,7 @@ "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/ui-contexts": "workspace:~", diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 2121b5e69f7f8..2b3fae217aaca 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -20,7 +20,7 @@ "@react-aria/toolbar": "^3.0.0-beta.1", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.57.0", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@storybook/addon-actions": "~6.5.16", "@storybook/addon-docs": "~6.5.16", "@storybook/addon-essentials": "~6.5.16", diff --git a/packages/ui-kit/package.json b/packages/ui-kit/package.json index 08e2d829c93c7..44aac1e25d177 100644 --- a/packages/ui-kit/package.json +++ b/packages/ui-kit/package.json @@ -40,7 +40,7 @@ "@babel/plugin-transform-runtime": "~7.21.4", "@babel/preset-env": "~7.21.4", "@rocket.chat/eslint-config": "workspace:~", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/jest-presets": "workspace:~", "@types/jest": "~29.5.12", "babel-loader": "~9.1.2", diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index a603654f7a8c1..d0dc218808c94 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -8,7 +8,7 @@ "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.57.0", "@rocket.chat/fuselage-hooks": "^0.33.1", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index f6a227f7c1065..750f608931883 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -21,7 +21,7 @@ "@rocket.chat/fuselage-toastbar": "^0.33.0", "@rocket.chat/fuselage-tokens": "^0.33.1", "@rocket.chat/fuselage-ui-kit": "workspace:~", - "@rocket.chat/icons": "^0.37.0", + "@rocket.chat/icons": "^0.36.0", "@rocket.chat/logo": "^0.31.30", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", diff --git a/yarn.lock b/yarn.lock index 1fe5f3687e147..64d79a0d27e6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8585,7 +8585,7 @@ __metadata: "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/models": "workspace:^" @@ -8611,7 +8611,7 @@ __metadata: dependencies: "@rocket.chat/apps-engine": 1.45.0-alpha.864 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/ui-kit": "workspace:~" eslint: ~8.45.0 @@ -8886,7 +8886,7 @@ __metadata: "@rocket.chat/fuselage-hooks": ^0.33.1 "@rocket.chat/fuselage-polyfills": ~0.31.25 "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/prettier-config": ~0.31.25 @@ -9039,10 +9039,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:^0.37.0": - version: 0.37.0 - resolution: "@rocket.chat/icons@npm:0.37.0" - checksum: c80dee4298d960b3d7d6c030a0ca00e48c7723ab4f2d9b4086c0f0464000065f1d085b6a5d7ae0249071ccef0e499523bf9c838962f3c2999035eef53d3318d3 +"@rocket.chat/icons@npm:^0.36.0": + version: 0.36.0 + resolution: "@rocket.chat/icons@npm:0.36.0" + checksum: ebec57fdfc9bac3b0b29ba43d9ac316b55f6e4177fa4456de195352d6add1e15e25c4d72e6a4fdc3d33abaabf8af0ca7eb0d36badb360113a19c15a13d68aed5 languageName: node linkType: hard @@ -9349,7 +9349,7 @@ __metadata: "@rocket.chat/fuselage-ui-kit": "workspace:^" "@rocket.chat/gazzodown": "workspace:^" "@rocket.chat/i18n": "workspace:^" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/instance-status": "workspace:^" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/jwt": "workspace:^" @@ -10242,7 +10242,7 @@ __metadata: "@rocket.chat/css-in-js": ~0.31.25 "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/ui-contexts": "workspace:~" @@ -10291,7 +10291,7 @@ __metadata: "@react-aria/toolbar": ^3.0.0-beta.1 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.57.0 - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@storybook/addon-actions": ~6.5.16 "@storybook/addon-docs": ~6.5.16 "@storybook/addon-essentials": ~6.5.16 @@ -10360,7 +10360,7 @@ __metadata: "@babel/plugin-transform-runtime": ~7.21.4 "@babel/preset-env": ~7.21.4 "@rocket.chat/eslint-config": "workspace:~" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/jest-presets": "workspace:~" "@types/jest": ~29.5.12 babel-loader: ~9.1.2 @@ -10387,7 +10387,7 @@ __metadata: "@rocket.chat/css-in-js": ~0.31.25 "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/ui-contexts": "workspace:~" "@types/react": ~17.0.69 eslint: ~8.45.0 @@ -10417,7 +10417,7 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.57.0 "@rocket.chat/fuselage-hooks": ^0.33.1 - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/styled": ~0.31.25 "@rocket.chat/ui-avatar": "workspace:^" @@ -10470,7 +10470,7 @@ __metadata: "@rocket.chat/fuselage-toastbar": ^0.33.0 "@rocket.chat/fuselage-tokens": ^0.33.1 "@rocket.chat/fuselage-ui-kit": "workspace:~" - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/logo": ^0.31.30 "@rocket.chat/styled": ~0.31.25 "@rocket.chat/ui-avatar": "workspace:^" @@ -36736,7 +36736,7 @@ __metadata: "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": ~0.31.25 - "@rocket.chat/icons": ^0.37.0 + "@rocket.chat/icons": ^0.36.0 "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" From b126016ec77b5a44f8f95078ce19016a23af2bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=87=E3=83=AF=E3=83=B3=E3=82=B7=E3=83=A5?= <61188295+Dnouv@users.noreply.github.com> Date: Fri, 23 Aug 2024 07:35:02 +0530 Subject: [PATCH 08/20] Add blank space in en.i18n.json --- packages/i18n/src/locales/en.i18n.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 44a3e5bd86d79..7fc92474a95b9 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -6530,4 +6530,4 @@ "Incoming_Calls": "Incoming calls", "Advanced_settings": "Advanced settings", "Security_and_permissions": "Security and permissions" -} \ No newline at end of file +} From 7e60300598c88109fb35b3c02d029a8799b49efc Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 18 Sep 2024 19:12:04 +0530 Subject: [PATCH 09/20] update to use category --- .../message/toolbar/MessageToolbar.tsx | 5 +- .../client/hooks/useAppActionButtons.ts | 76 +++---------------- apps/meteor/client/hooks/useFilterActions.ts | 25 ++++++ 3 files changed, 37 insertions(+), 69 deletions(-) create mode 100644 apps/meteor/client/hooks/useFilterActions.ts diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx index 3390e459ccffd..4a73fe2d2ba55 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx @@ -1,4 +1,5 @@ import { useToolbar } from '@react-aria/toolbar'; +import { UIActionButtonCategory } from '@rocket.chat/apps-engine/definition/ui'; import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; import { isThreadMessage, isRoomFederated, isVideoConfMessage, isE2EEMessage } from '@rocket.chat/core-typings'; import { MessageToolbar as FuselageMessageToolbar, MessageToolbarItem } from '@rocket.chat/fuselage'; @@ -11,7 +12,7 @@ import React, { memo, useMemo, useRef } from 'react'; import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; import { useEmojiPickerData } from '../../../contexts/EmojiPickerContext'; -import { useMessageActionAppsActionButtons, useMessageToolbarStarsAppsAction } from '../../../hooks/useAppActionButtons'; +import { useMessageActionAppsActionButtons } from '../../../hooks/useAppActionButtons'; import { useEmbeddedLayout } from '../../../hooks/useEmbeddedLayout'; import EmojiElement from '../../../views/composer/EmojiPicker/EmojiElement'; import { useIsSelecting } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; @@ -79,7 +80,7 @@ const MessageToolbar = ({ const actionButtonApps = useMessageActionAppsActionButtons(context); - const starsAction = useMessageToolbarStarsAppsAction(context); + const starsAction = useMessageActionAppsActionButtons(context, UIActionButtonCategory.AI); const { messageToolbox: hiddenActions } = useLayoutHiddenActions(); diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 1cfa54728d185..8ed2868f4aa83 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -1,4 +1,4 @@ -import type { IUIActionButton, UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; +import { UIActionButtonCategory, type IUIActionButton, type UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useStream, useToastMessageDispatch, useUserId } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; @@ -13,6 +13,7 @@ import { Utilities } from '../../ee/lib/misc/Utilities'; import type { GenericMenuItemProps } from '../components/GenericMenu/GenericMenuItem'; import { useUiKitActionManager } from '../uikit/hooks/useUiKitActionManager'; import { useApplyButtonFilters, useApplyButtonAuthFilter } from './useApplyButtonFilters'; +import { useFilterActionsByContextAndCategory } from './useFilterActions'; const getIdForActionButton = ({ appId, actionId }: IUIActionButton): string => `${appId}/${actionId}`; @@ -160,20 +161,21 @@ export const useUserDropdownAppsActionButtons = () => { } as UseQueryResult; }; -export const useMessageActionAppsActionButtons = (context?: MessageActionContext) => { +export const useMessageActionAppsActionButtons = ( + context?: MessageActionContext, + category: UIActionButtonCategory = UIActionButtonCategory.DEFAULT, +) => { const result = useAppActionButtons('messageAction'); const actionManager = useUiKitActionManager(); const applyButtonFilters = useApplyButtonFilters(); const dispatchToastMessage = useToastMessageDispatch(); const { t } = useTranslation(); + const filterActionsByContextAndCategory = useFilterActionsByContextAndCategory(context, category); const data = useMemo( () => result.data ?.filter((action) => { - if ( - context && - !(action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes(context as any) - ) { + if (!filterActionsByContextAndCategory(action)) { return false; } return applyButtonFilters(action); @@ -212,67 +214,7 @@ export const useMessageActionAppsActionButtons = (context?: MessageActionContext return item; }), - [actionManager, applyButtonFilters, context, dispatchToastMessage, result.data, t], - ); - return { - ...result, - data, - } as UseQueryResult; -}; - -export const useMessageToolbarStarsAppsAction = (context?: MessageActionContext) => { - const result = useAppActionButtons('messageToolbarStarsAction'); - const actionManager = useUiKitActionManager(); - const applyButtonFilters = useApplyButtonFilters(); - const dispatchToastMessage = useToastMessageDispatch(); - const { t } = useTranslation(); - const data = useMemo( - () => - result.data - ?.filter((action) => { - if ( - context && - !(action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes(context as any) - ) { - return false; - } - return applyButtonFilters(action); - }) - .map((action) => { - const item: MessageActionConfig = { - icon: undefined as any, - id: getIdForActionButton(action), - label: Utilities.getI18nKeyForApp(action.labelI18n, action.appId), - order: 7, - type: 'apps', - variant: action.variant, - action: (_, params) => { - void actionManager - .emitInteraction(action.appId, { - type: 'actionButton', - rid: params.message.rid, - tmid: params.message.tmid, - mid: params.message._id, - actionId: action.actionId, - payload: { context: action.context }, - }) - .catch(async (reason) => { - if (reason instanceof UiKitTriggerTimeoutError) { - dispatchToastMessage({ - type: 'error', - message: t('UIKit_Interaction_Timeout'), - }); - return; - } - - return reason; - }); - }, - }; - - return item; - }), - [actionManager, applyButtonFilters, context, dispatchToastMessage, result.data, t], + [actionManager, applyButtonFilters, dispatchToastMessage, filterActionsByContextAndCategory, result.data, t], ); return { ...result, diff --git a/apps/meteor/client/hooks/useFilterActions.ts b/apps/meteor/client/hooks/useFilterActions.ts new file mode 100644 index 0000000000000..b95d68934b52c --- /dev/null +++ b/apps/meteor/client/hooks/useFilterActions.ts @@ -0,0 +1,25 @@ +import { UIActionButtonCategory } from '@rocket.chat/apps-engine/definition/ui'; +import type { IUIActionButton } from '@rocket.chat/apps-engine/definition/ui'; +import { useCallback } from 'react'; + +export const useFilterActionsByContextAndCategory = (context: string | undefined, category: UIActionButtonCategory) => { + return useCallback( + (action: IUIActionButton) => { + if (context) { + const isDefaultCategory = category === UIActionButtonCategory.DEFAULT; + const isCategoryMatch = isDefaultCategory + ? !action.category || action.category === UIActionButtonCategory.DEFAULT + : action?.category === category; + const isContextMatch = (action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes( + context as any, + ); + + if (!isContextMatch || !isCategoryMatch) { + return false; + } + } + return true; + }, + [context, category], + ); +}; From 81b0daa9c8d9e5bd013e1e9e6d3aab655a646718 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 18 Sep 2024 20:07:43 +0530 Subject: [PATCH 10/20] optimize bool checks --- apps/meteor/client/hooks/useFilterActions.ts | 25 ++++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/meteor/client/hooks/useFilterActions.ts b/apps/meteor/client/hooks/useFilterActions.ts index b95d68934b52c..071585dc53050 100644 --- a/apps/meteor/client/hooks/useFilterActions.ts +++ b/apps/meteor/client/hooks/useFilterActions.ts @@ -5,20 +5,19 @@ import { useCallback } from 'react'; export const useFilterActionsByContextAndCategory = (context: string | undefined, category: UIActionButtonCategory) => { return useCallback( (action: IUIActionButton) => { - if (context) { - const isDefaultCategory = category === UIActionButtonCategory.DEFAULT; - const isCategoryMatch = isDefaultCategory - ? !action.category || action.category === UIActionButtonCategory.DEFAULT - : action?.category === category; - const isContextMatch = (action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes( - context as any, - ); - - if (!isContextMatch || !isCategoryMatch) { - return false; - } + if (!context) { + return true; } - return true; + + const actionCategory = action?.category ?? UIActionButtonCategory.DEFAULT; + const isContextMatch = (action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes( + context as any, + ); + + const isCategoryMatch = + category === UIActionButtonCategory.DEFAULT ? actionCategory === UIActionButtonCategory.DEFAULT : actionCategory === category; + + return isContextMatch && isCategoryMatch; }, [context, category], ); From 06dc50129be325732ff318d59d5ddd9f10f30436 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 18 Sep 2024 20:11:31 +0530 Subject: [PATCH 11/20] update changeset --- .changeset/red-crews-behave.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/red-crews-behave.md b/.changeset/red-crews-behave.md index 721f7e4db0dc2..a7f2ef1af8890 100644 --- a/.changeset/red-crews-behave.md +++ b/.changeset/red-crews-behave.md @@ -4,4 +4,4 @@ '@rocket.chat/meteor': minor --- -New UI context for Rocket.Chat Apps to register actions, specifically targeting AI Actions. +New UI context for Rocket.Chat Apps to register actions, apps can use this new context by registering buttons under the `category: AI` From 290f5eda60244fc0f37b3cb656fce89e1b0c639e Mon Sep 17 00:00:00 2001 From: Dnouv Date: Thu, 26 Sep 2024 18:34:28 +0530 Subject: [PATCH 12/20] bump apps-engine --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/ddp-streamer/package.json | 2 +- ee/packages/presence/package.json | 2 +- packages/apps/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/rest-typings/package.json | 2 +- yarn.lock | 26 ++++++++++----------- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 390b2c646cd12..85495533541f9 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -18,7 +18,7 @@ "author": "Rocket.Chat", "license": "MIT", "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "~0.31.25", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 3767939a7e3c2..75311657f12f1 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -230,7 +230,7 @@ "@rocket.chat/agenda": "workspace:^", "@rocket.chat/api-client": "workspace:^", "@rocket.chat/apps": "workspace:^", - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/base64": "workspace:^", "@rocket.chat/cas-validate": "workspace:^", "@rocket.chat/core-services": "workspace:^", diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 36c244f411806..9ff8ad8990c66 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -15,7 +15,7 @@ ], "author": "Rocket.Chat", "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "~0.31.25", diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 912b4bf453fdc..62c747bc138ff 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -6,7 +6,7 @@ "@babel/core": "~7.22.20", "@babel/preset-env": "~7.22.20", "@babel/preset-typescript": "~7.22.15", - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", "@types/node": "^14.18.63", diff --git a/packages/apps/package.json b/packages/apps/package.json index af88aff27664a..d39714312999b 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -18,7 +18,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/model-typings": "workspace:^" } diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 2ee07033e7324..ffe11e739c6fd 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -32,7 +32,7 @@ "extends": "../../package.json" }, "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/icons": "~0.38.0", "@rocket.chat/message-parser": "workspace:^", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 0db23760066bc..baecd6d5de7fe 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -22,7 +22,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/icons": "~0.38.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~", diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 975051db933f3..79810443bf57f 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -63,7 +63,7 @@ "@babel/preset-env": "~7.22.20", "@babel/preset-react": "~7.22.15", "@babel/preset-typescript": "~7.22.15", - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.59.1", diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 30a448980c9bc..71365166145ae 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -23,7 +23,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/apps-engine": "1.45.0-alpha.868", + "@rocket.chat/apps-engine": "1.47.0-alpha.899", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~", diff --git a/yarn.lock b/yarn.lock index f6c5de3e9a44e..7140fd68de8f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8513,9 +8513,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/apps-engine@npm:1.45.0-alpha.868": - version: 1.45.0-alpha.868 - resolution: "@rocket.chat/apps-engine@npm:1.45.0-alpha.868" +"@rocket.chat/apps-engine@npm:1.47.0-alpha.899": + version: 1.47.0-alpha.899 + resolution: "@rocket.chat/apps-engine@npm:1.47.0-alpha.899" dependencies: "@msgpack/msgpack": 3.0.0-beta2 adm-zip: ^0.5.9 @@ -8531,7 +8531,7 @@ __metadata: uuid: ~8.3.2 peerDependencies: "@rocket.chat/ui-kit": "*" - checksum: 3ac41e3de76be67e856e4bca888f113360628e510f9d4c66d70ed71d84f25bda6ca6659ead6c7a87d21c117c47bfa090b4508cce66e8630d2e935d3ed3158835 + checksum: 8184ba411316990b7f2a8ea4f970961cbdd76bede55853db2e2596a8e7cd1e38db22deb4443af476f3d1759da0f51ed0b6d98893d3760efd932362a16b7ed888 languageName: node linkType: hard @@ -8539,7 +8539,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/apps@workspace:packages/apps" dependencies: - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/model-typings": "workspace:^" eslint: ~8.45.0 @@ -8613,7 +8613,7 @@ __metadata: "@babel/core": ~7.22.20 "@babel/preset-env": ~7.22.20 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/icons": ~0.38.0 @@ -8638,7 +8638,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/core-typings@workspace:packages/core-typings" dependencies: - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/icons": ~0.38.0 "@rocket.chat/message-parser": "workspace:^" @@ -8711,7 +8711,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer" dependencies: - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/ddp-client": "workspace:~" @@ -8910,7 +8910,7 @@ __metadata: "@babel/preset-env": ~7.22.20 "@babel/preset-react": ~7.22.15 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage": ^0.59.1 @@ -9363,7 +9363,7 @@ __metadata: "@rocket.chat/agenda": "workspace:^" "@rocket.chat/api-client": "workspace:^" "@rocket.chat/apps": "workspace:^" - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/base64": "workspace:^" "@rocket.chat/cas-validate": "workspace:^" "@rocket.chat/core-services": "workspace:^" @@ -10010,7 +10010,7 @@ __metadata: "@babel/core": ~7.22.20 "@babel/preset-env": ~7.22.20 "@babel/preset-typescript": ~7.22.15 - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" @@ -10125,7 +10125,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/rest-typings@workspace:packages/rest-typings" dependencies: - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:~" "@rocket.chat/message-parser": "workspace:^" @@ -37229,7 +37229,7 @@ __metadata: version: 0.0.0-use.local resolution: "rocketchat-services@workspace:apps/meteor/ee/server/services" dependencies: - "@rocket.chat/apps-engine": 1.45.0-alpha.868 + "@rocket.chat/apps-engine": 1.47.0-alpha.899 "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": ~0.31.25 From abb8b4f042a73455d8d3337643d8037e0f89c529 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Fri, 27 Sep 2024 15:44:42 +0530 Subject: [PATCH 13/20] fix generic menu import --- .../message/toolbar/MessageToolbarStarsActionMenu.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx index 9c65a2ca04594..2536d5363fe51 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx @@ -1,11 +1,10 @@ import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { GenericMenu, type GenericMenuItemProps } from '@rocket.chat/ui-client'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { MouseEvent, ReactElement } from 'react'; import React from 'react'; import type { MessageActionConditionProps, MessageActionConfig } from '../../../../app/ui-utils/client/lib/MessageAction'; -import GenericMenu from '../../GenericMenu/GenericMenu'; -import type { GenericMenuItemProps } from '../../GenericMenu/GenericMenuItem'; type MessageActionConfigOption = Omit & { action: (e?: MouseEvent) => void; From f2f7dff76a759730d3f7602c9d3ac5475321f7bc Mon Sep 17 00:00:00 2001 From: Dnouv Date: Fri, 27 Sep 2024 20:46:04 +0530 Subject: [PATCH 14/20] fix enum import --- .../components/message/toolbar/MessageToolbar.tsx | 3 +-- apps/meteor/client/hooks/useAppActionButtons.ts | 7 ++----- apps/meteor/client/hooks/useFilterActions.ts | 10 +++++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx index 4a73fe2d2ba55..17357be8b6ab7 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx @@ -1,5 +1,4 @@ import { useToolbar } from '@react-aria/toolbar'; -import { UIActionButtonCategory } from '@rocket.chat/apps-engine/definition/ui'; import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; import { isThreadMessage, isRoomFederated, isVideoConfMessage, isE2EEMessage } from '@rocket.chat/core-typings'; import { MessageToolbar as FuselageMessageToolbar, MessageToolbarItem } from '@rocket.chat/fuselage'; @@ -80,7 +79,7 @@ const MessageToolbar = ({ const actionButtonApps = useMessageActionAppsActionButtons(context); - const starsAction = useMessageActionAppsActionButtons(context, UIActionButtonCategory.AI); + const starsAction = useMessageActionAppsActionButtons(context, 'ai'); const { messageToolbox: hiddenActions } = useLayoutHiddenActions(); diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 8eb0eae11a5e2..3e21ca6a668d1 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -1,4 +1,4 @@ -import { UIActionButtonCategory, type IUIActionButton, type UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; +import { type IUIActionButton, type UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; import type { GenericMenuItemProps } from '@rocket.chat/ui-client'; import { useEndpoint, useStream, useToastMessageDispatch, useUserId } from '@rocket.chat/ui-contexts'; @@ -161,10 +161,7 @@ export const useUserDropdownAppsActionButtons = () => { } as UseQueryResult; }; -export const useMessageActionAppsActionButtons = ( - context?: MessageActionContext, - category: UIActionButtonCategory = UIActionButtonCategory.DEFAULT, -) => { +export const useMessageActionAppsActionButtons = (context?: MessageActionContext, category?: string) => { const result = useAppActionButtons('messageAction'); const actionManager = useUiKitActionManager(); const applyButtonFilters = useApplyButtonFilters(); diff --git a/apps/meteor/client/hooks/useFilterActions.ts b/apps/meteor/client/hooks/useFilterActions.ts index 071585dc53050..5b8c91f244ab0 100644 --- a/apps/meteor/client/hooks/useFilterActions.ts +++ b/apps/meteor/client/hooks/useFilterActions.ts @@ -1,21 +1,21 @@ -import { UIActionButtonCategory } from '@rocket.chat/apps-engine/definition/ui'; import type { IUIActionButton } from '@rocket.chat/apps-engine/definition/ui'; import { useCallback } from 'react'; -export const useFilterActionsByContextAndCategory = (context: string | undefined, category: UIActionButtonCategory) => { +const DEFAULT_CATEGORY = 'default'; + +export const useFilterActionsByContextAndCategory = (context: string | undefined, category = 'default') => { return useCallback( (action: IUIActionButton) => { if (!context) { return true; } - const actionCategory = action?.category ?? UIActionButtonCategory.DEFAULT; + const actionCategory = action?.category ?? DEFAULT_CATEGORY; const isContextMatch = (action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes( context as any, ); - const isCategoryMatch = - category === UIActionButtonCategory.DEFAULT ? actionCategory === UIActionButtonCategory.DEFAULT : actionCategory === category; + const isCategoryMatch = category === DEFAULT_CATEGORY ? actionCategory === DEFAULT_CATEGORY : actionCategory === category; return isContextMatch && isCategoryMatch; }, From d43a644c589283f6f1a6c11333ebbe2980968238 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Fri, 27 Sep 2024 22:50:01 +0530 Subject: [PATCH 15/20] remove unused interaction --- .../ui-kit/src/interactions/UserInteraction.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/ui-kit/src/interactions/UserInteraction.ts b/packages/ui-kit/src/interactions/UserInteraction.ts index e3f71a6a19694..384275e9d45fe 100644 --- a/packages/ui-kit/src/interactions/UserInteraction.ts +++ b/packages/ui-kit/src/interactions/UserInteraction.ts @@ -98,19 +98,6 @@ export type MesssageActionButtonUserInteraction = { triggerId: string; }; -export type MessageToolbarStarsActionButtonUserInteraction = { - type: 'actionButton'; - actionId: string; - payload: { - context: 'messageToolbarStarsAction'; - message?: undefined; - }; - mid: string; - tmid?: string; - rid: string; - triggerId: string; -}; - export type RoomActionButtonUserInteraction = { type: 'actionButton'; actionId: string; @@ -132,8 +119,7 @@ export type UserInteraction = | MessageBoxActionButtonUserInteraction | UserDropdownActionButtonUserInteraction | MesssageActionButtonUserInteraction - | RoomActionButtonUserInteraction - | MessageToolbarStarsActionButtonUserInteraction; + | RoomActionButtonUserInteraction; export const isMessageBlockActionUserInteraction = typia.createIs(); export const isViewBlockActionUserInteraction = typia.createIs(); @@ -143,4 +129,3 @@ export const isMessageBoxActionButtonUserInteraction = typia.createIs(); export const isMesssageActionButtonUserInteraction = typia.createIs(); export const isRoomActionButtonUserInteraction = typia.createIs(); -export const isMessageToolbarStarsActionButtonUserInteraction = typia.createIs(); From 6dcd1e2a42e5d594ea2e23325ce0d2552b0fabc8 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Mon, 30 Sep 2024 15:32:31 +0530 Subject: [PATCH 16/20] update changeset --- .changeset/red-crews-behave.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/red-crews-behave.md b/.changeset/red-crews-behave.md index a7f2ef1af8890..9e5c1f6f7bf78 100644 --- a/.changeset/red-crews-behave.md +++ b/.changeset/red-crews-behave.md @@ -4,4 +4,4 @@ '@rocket.chat/meteor': minor --- -New UI context for Rocket.Chat Apps to register actions, apps can use this new context by registering buttons under the `category: AI` +Introduces new UI context for Rocket.Chat Apps to register actions, apps can use this new context by registering buttons under the `category: AI` From 631a471a024c19fe85d7b93bfee53118d6e19ee4 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Mon, 30 Sep 2024 20:23:58 +0530 Subject: [PATCH 17/20] reduce reduce --- .../toolbar/MessageToolbarStarsActionMenu.tsx | 64 ++++++++----------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx index 2536d5363fe51..7c88d89ac2057 100644 --- a/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx @@ -31,8 +31,9 @@ const MessageToolbarStarsActionMenu = ({ }: MessageActionMenuProps): ReactElement => { const t = useTranslation(); const id = useUniqueId(); - const groupOptions = options - .map((option) => ({ + + const groupOptions = options.reduce((acc, option) => { + const transformedOption = { variant: option.color === 'alert' ? 'danger' : '', id: option.id, icon: option.icon, @@ -42,43 +43,34 @@ const MessageToolbarStarsActionMenu = ({ ...(option.disabled && { disabled: option?.disabled?.(context) }), ...(option.disabled && option?.disabled?.(context) && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }), - })) - .reduce((acc, option) => { - const group = option.type ? option.type : ''; - const section = acc.find((section: { id: string }) => section.id === group); - if (section) { - section.items.push(option); - return acc; - } + }; + + const group = option.type || ''; + let section = acc.find((section: { id: string }) => section.id === group); + + if (!section) { + section = { id: group, title: '', items: [] }; + acc.push(section); + } - const newSection = { id: group, title: '', items: [option] }; - acc.push(newSection); - return acc; - }, [] as unknown as MessageActionSection[]) - .map((section) => { - if (section.id !== 'apps') { - return section; - } + // Add option to the appropriate section + section.items.push(transformedOption); - if (!isMessageEncrypted) { - return section; - } + // Handle the "apps" section if message is encrypted + if (group === 'apps' && isMessageEncrypted) { + section.items = [ + { + content: t('Unavailable'), + id, + disabled: true, + gap: false, + tooltip: t('Action_not_available_encrypted_content', { action: t('Apps') }), + }, + ]; + } - return { - id: 'apps', - title: t('Apps'), - items: [ - { - content: t('Unavailable'), - type: 'apps', - id, - disabled: true, - gap: false, - tooltip: t('Action_not_available_encrypted_content', { action: t('Apps') }), - }, - ], - }; - }); + return acc; + }, [] as MessageActionSection[]); return ( Date: Mon, 30 Sep 2024 20:48:53 +0530 Subject: [PATCH 18/20] add newline --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/ddp-streamer/package.json | 2 +- ee/packages/presence/package.json | 2 +- packages/apps/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/rest-typings/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 4f9a8d39fbf59..9eb2e917819d8 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -68,4 +68,4 @@ "volta": { "extends": "../../../package.json" } -} \ No newline at end of file +} diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 6edd330923f7b..b5c9003b69748 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -468,4 +468,4 @@ "mobile": "4.39.0" } } -} \ No newline at end of file +} diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index e90f9f698598c..f250b9e331061 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -64,4 +64,4 @@ "files": [ "/dist" ] -} \ No newline at end of file +} diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 1e7abd3f63ec3..06bbc244fd48e 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -37,4 +37,4 @@ "@rocket.chat/models": "workspace:^", "mongodb": "^4.17.2" } -} \ No newline at end of file +} diff --git a/packages/apps/package.json b/packages/apps/package.json index 3cfcf0e551f2a..331893ac4d72b 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -22,4 +22,4 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/model-typings": "workspace:^" } -} \ No newline at end of file +} diff --git a/packages/core-services/package.json b/packages/core-services/package.json index e621efe96eb5f..77277f6a4b878 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -42,4 +42,4 @@ "@types/fibers": "^3.1.4", "fibers": "^5.0.3" } -} \ No newline at end of file +} diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 1e87959d263c9..f210ec03895a2 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -31,4 +31,4 @@ "volta": { "extends": "../../package.json" } -} \ No newline at end of file +} diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 4533ab7e215de..320f0ab03dbf8 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -115,4 +115,4 @@ "volta": { "extends": "../../package.json" } -} \ No newline at end of file +} diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index f93b091034936..30753325cdf4e 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -33,4 +33,4 @@ "volta": { "extends": "../../package.json" } -} \ No newline at end of file +} From f95c4f919a95afaf5c36ea4396ff298b82961afc Mon Sep 17 00:00:00 2001 From: Dnouv Date: Tue, 1 Oct 2024 09:54:32 +0530 Subject: [PATCH 19/20] update changeset --- .changeset/red-crews-behave.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/red-crews-behave.md b/.changeset/red-crews-behave.md index 9e5c1f6f7bf78..19608792e73d0 100644 --- a/.changeset/red-crews-behave.md +++ b/.changeset/red-crews-behave.md @@ -4,4 +4,4 @@ '@rocket.chat/meteor': minor --- -Introduces new UI context for Rocket.Chat Apps to register actions, apps can use this new context by registering buttons under the `category: AI` +Introduces new property `category` for Rocket.Chat Apps to register UI action buttons. This property is used to group buttons in the UI. From d23827745519fce37e9fa58c162d95f7703d7213 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 8 Oct 2024 12:11:32 -0300 Subject: [PATCH 20/20] Avoid any conversion --- apps/meteor/client/hooks/useFilterActions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/hooks/useFilterActions.ts b/apps/meteor/client/hooks/useFilterActions.ts index 5b8c91f244ab0..5eab0b795a59b 100644 --- a/apps/meteor/client/hooks/useFilterActions.ts +++ b/apps/meteor/client/hooks/useFilterActions.ts @@ -1,3 +1,4 @@ +import { MessageActionContext } from '@rocket.chat/apps-engine/definition/ui'; import type { IUIActionButton } from '@rocket.chat/apps-engine/definition/ui'; import { useCallback } from 'react'; @@ -11,9 +12,8 @@ export const useFilterActionsByContextAndCategory = (context: string | undefined } const actionCategory = action?.category ?? DEFAULT_CATEGORY; - const isContextMatch = (action.when?.messageActionContext || ['message', 'message-mobile', 'threads', 'starred']).includes( - context as any, - ); + const messageActionContext = action.when?.messageActionContext || Object.values(MessageActionContext); + const isContextMatch = messageActionContext.includes(context as MessageActionContext); const isCategoryMatch = category === DEFAULT_CATEGORY ? actionCategory === DEFAULT_CATEGORY : actionCategory === category;