2023-11-29 02:31:28 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
import { PluginProvidedUiItemDescriptor } from 'bigbluebutton-html-plugin-sdk/dist/cjs/extensible-areas/base';
|
2024-03-26 05:13:57 +08:00
|
|
|
import * as uuidLib from 'uuid';
|
2023-11-29 02:31:28 +08:00
|
|
|
|
2024-01-16 01:12:39 +08:00
|
|
|
import PresentationToolbarPluginStateContainer from './components/presentation-toolbar/manager';
|
|
|
|
import UserListDropdownPluginStateContainer from './components/user-list-dropdown/manager';
|
|
|
|
import ActionButtonDropdownPluginStateContainer from './components/action-button-dropdown/manager';
|
|
|
|
import AudioSettingsDropdownPluginStateContainer from './components/audio-settings-dropdown/manager';
|
|
|
|
import ActionBarPluginStateContainer from './components/action-bar/manager';
|
|
|
|
import PresentationDropdownPluginStateContainer from './components/presentation-dropdown/manager';
|
|
|
|
import NavBarPluginStateContainer from './components/nav-bar/manager';
|
|
|
|
import OptionsDropdownPluginStateContainer from './components/options-dropdown/manager';
|
|
|
|
import CameraSettingsDropdownPluginStateContainer from './components/camera-settings-dropdown/manager';
|
|
|
|
import UserCameraDropdownPluginStateContainer from './components/user-camera-dropdown/manager';
|
|
|
|
import UserListItemAdditionalInformationPluginStateContainer from './components/user-list-item-additional-information/manager';
|
2023-11-29 02:31:28 +08:00
|
|
|
import {
|
|
|
|
ExtensibleArea, ExtensibleAreaStateManagerProps,
|
|
|
|
ExtensibleAreaComponentManager, ExtensibleAreaMap,
|
2024-01-16 01:12:39 +08:00
|
|
|
} from './types';
|
|
|
|
import FloatingWindowPluginStateContainer from './components/floating-window/manager';
|
2024-06-11 03:31:30 +08:00
|
|
|
import GenericContentPluginStateContainer from './components/generic-content/manager';
|
2024-08-01 01:47:54 +08:00
|
|
|
import ScreenshareHelperPluginStateContainer from './components/screenshare-helper/manager';
|
2023-11-29 02:31:28 +08:00
|
|
|
|
|
|
|
const extensibleAreaMap: ExtensibleAreaMap = {};
|
|
|
|
|
|
|
|
const extensibleAreaComponentManagers: ExtensibleAreaComponentManager[] = [
|
|
|
|
PresentationToolbarPluginStateContainer,
|
|
|
|
UserListDropdownPluginStateContainer,
|
|
|
|
ActionButtonDropdownPluginStateContainer,
|
|
|
|
AudioSettingsDropdownPluginStateContainer,
|
|
|
|
ActionBarPluginStateContainer,
|
|
|
|
PresentationDropdownPluginStateContainer,
|
|
|
|
NavBarPluginStateContainer,
|
|
|
|
OptionsDropdownPluginStateContainer,
|
|
|
|
CameraSettingsDropdownPluginStateContainer,
|
|
|
|
UserCameraDropdownPluginStateContainer,
|
|
|
|
UserListItemAdditionalInformationPluginStateContainer,
|
2023-12-16 01:04:33 +08:00
|
|
|
FloatingWindowPluginStateContainer,
|
2024-06-11 03:31:30 +08:00
|
|
|
GenericContentPluginStateContainer,
|
2024-08-01 01:47:54 +08:00
|
|
|
ScreenshareHelperPluginStateContainer,
|
2023-11-29 02:31:28 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
function generateItemWithId<T extends PluginProvidedUiItemDescriptor>(
|
2024-03-26 05:13:57 +08:00
|
|
|
item: T,
|
2023-11-29 02:31:28 +08:00
|
|
|
): T {
|
2024-03-26 05:13:57 +08:00
|
|
|
item.setItemId(uuidLib.v4());
|
2023-11-29 02:31:28 +08:00
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ExtensibleAreaStateManager = (props: ExtensibleAreaStateManagerProps) => {
|
|
|
|
const {
|
|
|
|
uuid,
|
|
|
|
pluginApi,
|
|
|
|
} = props;
|
|
|
|
if (!extensibleAreaMap[uuid]) {
|
|
|
|
extensibleAreaMap[uuid] = {} as ExtensibleArea;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{
|
|
|
|
extensibleAreaComponentManagers.map(
|
|
|
|
(ExtensibleAreaComponentManagerChild: ExtensibleAreaComponentManager, index: number) => (
|
|
|
|
<ExtensibleAreaComponentManagerChild
|
|
|
|
{
|
|
|
|
...{
|
|
|
|
key: `${uuid}-${index}`,
|
|
|
|
uuid,
|
|
|
|
generateItemWithId,
|
|
|
|
extensibleAreaMap,
|
|
|
|
pluginApi,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ExtensibleAreaStateManager;
|