Skip to content

Commit

Permalink
feat(extensible-area): add apps gallery extensible area
Browse files Browse the repository at this point in the history
Until now, the only way to add an item in the apps gallery was by
injecting a sidekick generic content. But as the concept of apps
expanded beyond sidebar contents, it was necessary to decouple the
gallery apps from the sidebar content(i.e. generic sidekick content).
So this commit adds an extensible area specifically for the apps gallery.
It has only one type, which is 'ENTRY' and corresponds to an apps gallery
entry that won't open a sidebar content when clicked.
  • Loading branch information
Arthurk12 committed Feb 13, 2025
1 parent dc07586 commit f989d6e
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ That being said, here are the extensible areas we have so far:

- Action bar items (button, separator)
- Action Button Dropdown Items (option, separator)
- Apps Gallery Items (entry)
- Audio settings dropdown items (option, separator)
- Camera settings dropdown items (option, separator)
- Options settings dropdown items (option, separator)
Expand Down
1 change: 1 addition & 0 deletions src/core/api/BbbPluginSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export abstract class BbbPluginSdk {
setActionButtonDropdownItems: () => [],
setActionsBarItems: () => [],
setAudioSettingsDropdownItems: () => [],
setAppsGalleryItems: () => [],
setPresentationDropdownItems: () => [],
setNavBarItems: () => [],
setScreenshareHelperItems: () => [],
Expand Down
7 changes: 6 additions & 1 deletion src/core/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { UseMeetingFunction } from '../../data-consumption/domain/meeting/from-c
import { ServerCommands } from '../../server-commands/types';
import { SendGenericDataForLearningAnalyticsDashboard } from '../../learning-analytics-dashboard/types';
import { UseUserCameraDomElementsFunction } from '../../dom-element-manipulation/user-camera/types';
import { ScreenshareHelperInterface, UserCameraHelperInterface } from '../../extensible-areas';
import { AppsGalleryInterface, ScreenshareHelperInterface, UserCameraHelperInterface } from '../../extensible-areas';
import { GetDataSource } from '../../remote-data/types';
import { PersistEventFunction } from '../../event-persistence/types';
import { PersistAssetFunction } from '../../asset-persistence/types';
Expand All @@ -54,6 +54,10 @@ export type SetAudioSettingsDropdownItems = (
audioSettingsDropdownItem: AudioSettingsDropdownInterface[]
) => string[];

export type SetAppsGalleryItems = (
appsGalleryItems: AppsGalleryInterface[]
) => string[];

export type SetPresentationDropdownItems = (
userListDropdownItem: PresentationDropdownInterface[]
) => string[];
Expand Down Expand Up @@ -101,6 +105,7 @@ export interface PluginApi {
setActionButtonDropdownItems: SetActionButtonDropdownItems;
setActionsBarItems: SetActionsBarItems;
setAudioSettingsDropdownItems: SetAudioSettingsDropdownItems;
setAppsGalleryItems: SetAppsGalleryItems;
setPresentationDropdownItems: SetPresentationDropdownItems;
setNavBarItems: SetNavBarItems;
setScreenshareHelperItems: SetScreenshareHelperItems;
Expand Down
34 changes: 34 additions & 0 deletions src/extensible-areas/apps-gallery-item/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { AppsGalleryType } from './enums';
import { AppsGalleryInterface, AppsGalleryItemProps } from './types';

export class AppsGalleryEntry implements AppsGalleryInterface {
id: string = '';

name: string = '';

type: AppsGalleryType = AppsGalleryType.ENTRY;

icon: string = '';

onClick: () => void;

constructor({
id,
name,
icon,
onClick,
}: AppsGalleryItemProps) {
if (id) {
this.id = id;
}
this.name = name;
this.icon = icon;
this.onClick = onClick;
}

setItemId(id: string): void {
this.id = id;
}
}

export default AppsGalleryEntry;
3 changes: 3 additions & 0 deletions src/extensible-areas/apps-gallery-item/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export enum AppsGalleryType {
ENTRY = 'APPS_GALLERY_ENTRY',
}
9 changes: 9 additions & 0 deletions src/extensible-areas/apps-gallery-item/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export {
AppsGalleryEntry,
} from './component';
export {
AppsGalleryInterface,
} from './types';
export {
AppsGalleryType,
} from './enums';
13 changes: 13 additions & 0 deletions src/extensible-areas/apps-gallery-item/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PluginProvidedUiItemDescriptor } from '../base';
import { AppsGalleryType } from './enums';

export interface AppsGalleryInterface extends PluginProvidedUiItemDescriptor {
type: AppsGalleryType;
}

export interface AppsGalleryItemProps {
id?: string;
name: string;
icon: string;
onClick: () => void;
}
7 changes: 4 additions & 3 deletions src/extensible-areas/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ActionButtonDropdownItemType } from './action-button-dropdown-item/enums';
import { ActionsBarItemType } from './actions-bar-item/enums';
import { AppsGalleryType } from './apps-gallery-item/enums';
import { AudioSettingsDropdownItemType } from './audio-settings-dropdown-item/enums';
import { CameraSettingsDropdownItemType } from './camera-settings-dropdown-item/enums';
import { FloatingWindowType } from './floating-window/enums';
Expand All @@ -16,9 +17,9 @@ import { UserListItemAdditionalInformationType } from './user-list-item-addition

type PluginProvidedUiItemType = PresentationToolbarItemType |
UserListDropdownItemType | ActionButtonDropdownItemType |
ActionsBarItemType | AudioSettingsDropdownItemType |
PresentationDropdownItemType | NavBarItemType | OptionsDropdownItemType |
CameraSettingsDropdownItemType | UserCameraDropdownItemType |
ActionsBarItemType | AppsGalleryType |
AudioSettingsDropdownItemType | PresentationDropdownItemType | NavBarItemType |
OptionsDropdownItemType | CameraSettingsDropdownItemType | UserCameraDropdownItemType |
UserListItemAdditionalInformationType | FloatingWindowType | GenericContentType |
ScreenshareHelperItemType | UserCameraHelperItemType;

Expand Down
1 change: 1 addition & 0 deletions src/extensible-areas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './presentation-toolbar-item';
export * from './user-list-dropdown-item';
export * from './action-button-dropdown-item';
export * from './actions-bar-item';
export * from './apps-gallery-item';
export * from './audio-settings-dropdown-item';
export * from './presentation-dropdown-item';
export * from './nav-bar-item';
Expand Down

0 comments on commit f989d6e

Please sign in to comment.