Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions samples/sample-floating-window-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ import * as ReactDOM from 'react-dom/client';
import { SampleGenericContentSidekickPluginProps } from './types';
import { GenericContentSidekickExample } from '../generic-content-sidekick-example/component';

function BatteryIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1}
stroke="currentColor"
>
<path strokeLinecap="round" strokeLinejoin="round" d="M21 10.5h.375c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125H21M4.5 10.5H18V15H4.5v-4.5ZM3.75 18h15A2.25 2.25 0 0 0 21 15.75v-6a2.25 2.25 0 0 0-2.25-2.25h-15A2.25 2.25 0 0 0 1.5 9.75v6A2.25 2.25 0 0 0 3.75 18Z" />
</svg>
);
}

function SampleGenericContentSidekickPlugin(
{ pluginUuid: uuid }: SampleGenericContentSidekickPluginProps,
): React.ReactNode {
Expand All @@ -29,7 +43,9 @@ function SampleGenericContentSidekickPlugin(
name: 'Generic Content 1',
section: 'Section 1',
dataTest: 'section-1-generic-content-sidekick-abc',
buttonIcon: 'video',
buttonIcon: {
svgContent: <BatteryIcon />,
},
open: false,
contentFunction: (element: HTMLElement) => {
const root = ReactDOM.createRoot(element);
Expand Down
4 changes: 3 additions & 1 deletion scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" pack
npm install

# Publishes to npm
npm publish
npm publish --tag tmp
npm dist-tag add bigbluebutton-html-plugin-sdk@$NEW_VERSION latest
npm dist-tag rm bigbluebutton-html-plugin-sdk tmp

echo "Sleeping 120 seconds to allow npm replicate internally"
sleep 120
Expand Down
19 changes: 12 additions & 7 deletions src/extensible-areas/actions-bar-item/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
SelectOption,
ToggleGroupOption,
ActionsBarToggleGroupProps,
ActionsBarIconType,
} from './types';
import { PluginIconType } from '../common/icon';

// ActionsBar Extensible Area

Expand All @@ -34,18 +34,20 @@ class ActionsBarItem implements ActionsBarInterface {
this.dataTest = dataTest;
}

setItemId(id: string):void {
setItemId(id: string): void {
this.id = `ActionsBar${this.type}_${id}`;
}
}

export class ActionsBarButton extends ActionsBarItem {
icon: ActionsBarIconType;
icon: PluginIconType;

tooltip: string;

onClick: () => void;

color: string;

/**
* Returns object to be used in the setter for action bar. In this case,
* a button.
Expand All @@ -56,11 +58,13 @@ export class ActionsBarButton extends ActionsBarItem {
* @param dataTest - string attribute to be used for testing
* @param onClick - function to be called when clicking the button
* @param position - position that this button will be displayed, see {@link ActionsBarPosition}
* @param color - button color variant, defaults to 'primary'
*
* @returns Object that will be interpreted by the core of Bigbluebutton (HTML5)
*/
constructor({
id, icon, tooltip = '', dataTest = '', onClick = () => {}, position = ActionsBarPosition.RIGHT,
id, icon, tooltip = '', dataTest = '', onClick = () => { }, position = ActionsBarPosition.RIGHT,
color = 'primary',
}: ActionsBarButtonProps) {
super({
id, type: ActionsBarItemType.BUTTON, position, dataTest,
Expand All @@ -69,11 +73,12 @@ export class ActionsBarButton extends ActionsBarItem {
this.tooltip = tooltip;
this.dataTest = dataTest;
this.onClick = onClick;
this.color = color;
}
}

export class ActionsBarSeparator extends ActionsBarItem {
icon: string;
icon: PluginIconType;

/**
* Returns object to be used in the setter for action bar. In this case,
Expand Down Expand Up @@ -129,7 +134,7 @@ export class ActionsBarSelector extends ActionsBarItem {
options = [],
defaultOption = options[0],
dataTest = '',
onChange = () => {},
onChange = () => { },
position = ActionsBarPosition.RIGHT,
width = 140,
}: ActionsBarSelectorProps) {
Expand Down Expand Up @@ -179,7 +184,7 @@ export class ActionsBarToggleGroup extends ActionsBarItem {
options = [],
defaultOption = options[0],
dataTest = '',
onChange = () => {},
onChange = () => { },
position = ActionsBarPosition.RIGHT,
}: ActionsBarToggleGroupProps) {
super({
Expand Down
19 changes: 4 additions & 15 deletions src/extensible-areas/actions-bar-item/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChangeEvent, MouseEvent } from 'react';
import { PluginProvidedUiItemDescriptor } from '../base';
import { ActionsBarItemType, ActionsBarPosition } from './enums';
import { PluginIconType } from '../common/icon';

/**
* Interface for the generic Actions bar item. (`position` is mandatory)
Expand All @@ -16,31 +17,19 @@ export interface ActionsBarItemProps {
dataTest?: string;
}

export interface ActionsBarButtonIconSvg {
svgContent: React.SVGProps<SVGSVGElement>;
}

export interface ActionsBarButtonIconName {
/**
* Default icon name defined by BBB (see options there).
*/
iconName: string;
}

export type ActionsBarIconType = ActionsBarButtonIconSvg | ActionsBarButtonIconName

export interface ActionsBarButtonProps {
id?: string;
icon: ActionsBarIconType;
icon: PluginIconType;
tooltip: string;
position: ActionsBarPosition;
dataTest?: string;
onClick: () => void;
color?: string;
}

export interface ActionsBarSeparatorProps {
position: ActionsBarPosition;
icon?: string;
icon?: PluginIconType;
dataTest?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AudioSettingsDropdownItemType } from './enums';
import {
AudioSettingsDropdownInterface, AudioSettingsDropdownOptionProps,
} from './types';
import { PluginIconType } from '../common/icon';

// AudioSettingsDropdown Extensible Area

Expand All @@ -12,7 +13,7 @@ export class AudioSettingsDropdownOption implements AudioSettingsDropdownInterfa

label: string;

icon: string;
icon: PluginIconType;

dataTest: string;

Expand Down
5 changes: 3 additions & 2 deletions src/extensible-areas/audio-settings-dropdown-item/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PluginProvidedUiItemDescriptor } from '../base';
import { PluginIconType } from '../common/icon';

/**
* Audio Settings Dropdown Item - The general Audio settings extensible area
Expand All @@ -7,13 +8,13 @@ import { PluginProvidedUiItemDescriptor } from '../base';
* To make this dropdown appear, the user needs to enter with audio, either listen only
* or microphone. This will make a small downward arrow appear (chevron).
*/
export interface AudioSettingsDropdownInterface extends PluginProvidedUiItemDescriptor{
export interface AudioSettingsDropdownInterface extends PluginProvidedUiItemDescriptor {
}

export interface AudioSettingsDropdownOptionProps {
id?: string;
label: string;
icon: string;
icon: PluginIconType;
dataTest?: string;
onClick: () => void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CameraSettingsDropdownItemType } from './enums';
import {
CameraSettingsDropdownInterface, CameraSettingsDropdownOptionProps,
} from './types';
import { PluginIconType } from '../common/icon';

// CameraSettingsDropdown Extensible Area

Expand All @@ -12,7 +13,7 @@ export class CameraSettingsDropdownOption implements CameraSettingsDropdownInter

label: string;

icon: string;
icon: PluginIconType;

dataTest: string = '';

Expand All @@ -30,7 +31,7 @@ export class CameraSettingsDropdownOption implements CameraSettingsDropdownInter
* @returns Object that will be interpreted by the core of Bigbluebutton (HTML5).
*/
constructor({
id, label = '', icon = '', dataTest = '', onClick = () => {},
id, label = '', icon = '', dataTest = '', onClick = () => { },
}: CameraSettingsDropdownOptionProps) {
if (id) {
this.id = id;
Expand Down
5 changes: 3 additions & 2 deletions src/extensible-areas/camera-settings-dropdown-item/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PluginProvidedUiItemDescriptor } from '../base';
import { PluginIconType } from '../common/icon';

/**
* Camera Settings Dropdown Item - The general Camera settings extensible area
Expand All @@ -7,13 +8,13 @@ import { PluginProvidedUiItemDescriptor } from '../base';
* To make this dropdown appear, the user needs to enter with webcam.
* This will make a small downward arrow appear in the camera icon (the chevron).
*/
export interface CameraSettingsDropdownInterface extends PluginProvidedUiItemDescriptor{
export interface CameraSettingsDropdownInterface extends PluginProvidedUiItemDescriptor {
}

export interface CameraSettingsDropdownOptionProps {
id?: string;
label: string;
icon: string;
icon: PluginIconType;
dataTest?: string;
onClick: () => void;
}
1 change: 1 addition & 0 deletions src/extensible-areas/common/icon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './types';
11 changes: 11 additions & 0 deletions src/extensible-areas/common/icon/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';

export interface PluginIconName {
iconName: string;
}

export interface PluginIconSvgContent {
svgContent: React.SVGProps<SVGSVGElement>;
}

export type PluginIconType = string | PluginIconName | PluginIconSvgContent;
1 change: 1 addition & 0 deletions src/extensible-areas/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './icon';
3 changes: 2 additions & 1 deletion src/extensible-areas/generic-content-item/component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as ReactDOM from 'react-dom/client';
import { GenericContentType } from './enums';
import { GenericContentInterface, GenericContentMainAreaProps, GenericContentSidekickAreaProps } from './types';
import { PluginIconType } from '../common/icon';

// GenericContent Extensible Area

Expand Down Expand Up @@ -48,7 +49,7 @@ export class GenericContentSidekickArea implements GenericContentInterface {

section: string = '';

buttonIcon: string = '';
buttonIcon: PluginIconType = '';

open: boolean = false;

Expand Down
3 changes: 2 additions & 1 deletion src/extensible-areas/generic-content-item/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as ReactDOM from 'react-dom/client';
import { PluginProvidedUiItemDescriptor } from '../base';
import { PluginIconType } from '../common/icon';

export interface GenericContentInterface extends PluginProvidedUiItemDescriptor {
}
Expand All @@ -15,7 +16,7 @@ export interface GenericContentSidekickAreaProps {
contentFunction: (element: HTMLElement) => ReactDOM.Root;
name: string;
section: string;
buttonIcon: string;
buttonIcon: PluginIconType;
open: boolean;
dataTest?: string;
}
1 change: 1 addition & 0 deletions src/extensible-areas/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './common/icon';
export * from './presentation-toolbar-item';
export * from './user-list-dropdown-item';
export * from './media-area-item';
Expand Down
5 changes: 3 additions & 2 deletions src/extensible-areas/media-area-item/component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MediaAreaItemType } from './enums';
import {
MediaAreaInterface, MediaAreaOptionProps, MediaAreaIconType,
MediaAreaInterface, MediaAreaOptionProps,
} from './types';
import { PluginIconType } from '../common/icon';

// MediaArea Extensible Area

Expand All @@ -12,7 +13,7 @@ export class MediaAreaOption implements MediaAreaInterface {

label: string;

icon: MediaAreaIconType;
icon: PluginIconType;

tooltip: string;

Expand Down
5 changes: 2 additions & 3 deletions src/extensible-areas/media-area-item/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PluginProvidedUiItemDescriptor } from '../base';
import { PluginIconType } from '../common/icon';

/**
* Interface for a generic item for the media area.
Expand All @@ -17,12 +18,10 @@ export interface MediaAreaButtonIconName {
iconName: string;
}

export type MediaAreaIconType = MediaAreaButtonIconSvg | MediaAreaButtonIconName

export interface MediaAreaOptionProps {
id?: string;
label: string;
icon: MediaAreaIconType;
icon: PluginIconType;
tooltip: string;
dataTest?: string;
allowed: boolean;
Expand Down
5 changes: 3 additions & 2 deletions src/extensible-areas/nav-bar-item/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
NavBarInterface, NavBarButtonProps,
NavBarInfoProps,
} from './types';
import { PluginIconType } from '../common/icon';

// NavBar Extensible Area

Expand All @@ -13,7 +14,7 @@ export class NavBarButton implements NavBarInterface {

label: string;

icon: string;
icon: PluginIconType;

tooltip: string;

Expand Down Expand Up @@ -45,7 +46,7 @@ export class NavBarButton implements NavBarInterface {
* @returns Object that will be interpreted by the core of Bigbluebutton (HTML5).
*/
constructor({
id, label = '', icon = '', tooltip = '', disabled = true, dataTest = '', onClick = () => {},
id, label = '', icon = '', tooltip = '', disabled = true, dataTest = '', onClick = () => { },
position = NavBarItemPosition.RIGHT, hasSeparator = true,
}: NavBarButtonProps) {
if (id) {
Expand Down
Loading
Loading