mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-23 04:47:49 +00:00
Allow users to resize the custom panel by dragging a handle on its left edge, matching the chat panel's resize UX. The panel width is persisted via PersistenceRegistry so it survives page reloads. Architectural changes: - Split CustomPanel into container (resize/close) + CustomPanelContent (branding override) - Split functions.ts into core functions + functions.custom.ts (branding override) - Split middleware.web.ts into orchestrator + middleware.custom.web.ts (branding override) - Chat max size now accounts for custom panel width for mutual awareness test-localStorage1.html
83 lines
1.8 KiB
TypeScript
83 lines
1.8 KiB
TypeScript
import {
|
|
CUSTOM_PANEL_CLOSE,
|
|
CUSTOM_PANEL_OPEN,
|
|
SET_CUSTOM_PANEL_ENABLED,
|
|
SET_CUSTOM_PANEL_IS_RESIZING,
|
|
SET_CUSTOM_PANEL_WIDTH,
|
|
SET_USER_CUSTOM_PANEL_WIDTH
|
|
} from './actionTypes';
|
|
|
|
/**
|
|
* Action to close the custom panel.
|
|
*
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function close() {
|
|
return {
|
|
type: CUSTOM_PANEL_CLOSE
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Action to open the custom panel.
|
|
*
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function open() {
|
|
return {
|
|
type: CUSTOM_PANEL_OPEN
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Action to enable or disable the custom panel dynamically.
|
|
*
|
|
* @param {boolean} enabled - Whether the custom panel should be enabled.
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function setCustomPanelEnabled(enabled: boolean) {
|
|
return {
|
|
type: SET_CUSTOM_PANEL_ENABLED,
|
|
enabled
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Sets the custom panel width (used for responsive adjustments).
|
|
*
|
|
* @param {number} width - The new width of the custom panel.
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function setCustomPanelWidth(width: number) {
|
|
return {
|
|
type: SET_CUSTOM_PANEL_WIDTH,
|
|
width
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Sets the user-preferred custom panel width (triggered by user drag).
|
|
*
|
|
* @param {number} width - The new width of the custom panel.
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function setUserCustomPanelWidth(width: number) {
|
|
return {
|
|
type: SET_USER_CUSTOM_PANEL_WIDTH,
|
|
width
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Sets whether the user is currently resizing the custom panel.
|
|
*
|
|
* @param {boolean} resizing - Whether the panel is being resized.
|
|
* @returns {Object} The action object.
|
|
*/
|
|
export function setCustomPanelIsResizing(resizing: boolean) {
|
|
return {
|
|
type: SET_CUSTOM_PANEL_IS_RESIZING,
|
|
resizing
|
|
};
|
|
}
|