-
Notifications
You must be signed in to change notification settings - Fork 7
Add some module interfaces #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
38e1082
Add some experimental module interfaces
dbkr 864a2dd
Maybe make api-extractor happy
dbkr 8633ba0
New interface for adding space panel items
dbkr 6732407
Tweak api so it can be called multiple times
dbkr 79d1cfa
Tweak doc
dbkr 081c33b
Add more docs
dbkr 91efe7e
More doc
dbkr d8df089
Fix public/alpha statuses
dbkr 5532950
Rename contextMenuTooltip to just tooltip
dbkr a733ea5
Update docs
dbkr d46ca1e
docs
dbkr 1d5a6db
Make onSelected non-optional
dbkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| Copyright 2025 New Vector Ltd. | ||
|
|
||
| SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial | ||
| Please see LICENSE files in the repository root for full details. | ||
| */ | ||
|
|
||
| /** | ||
| * The props that must be passed to a RoomView component. | ||
| * @alpha Subject to change. | ||
| */ | ||
| export interface RoomViewProps { | ||
| /** | ||
| * The ID of the room to render. | ||
| */ | ||
| roomId?: string; | ||
| } | ||
|
|
||
| /** | ||
| * Exposes components and classes that are part of Element Web to allow modules to | ||
| * render the components as part of their custom components or use the classes | ||
| * (because they can't import the components from Element Web since it would cause | ||
| * a dependency cycle) | ||
| * @alpha | ||
| */ | ||
| export interface BuiltinsApi { | ||
| /** | ||
| * Returns the RoomView component used by Element Web to render a room such that | ||
| * modules can render it as part of their own custom room views. | ||
| * | ||
| * @alpha | ||
| * @returns The RoomView component. | ||
| */ | ||
| getRoomViewComponent(): React.ComponentType<RoomViewProps>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| Copyright 2025 New Vector Ltd. | ||
|
|
||
| SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial | ||
| Please see LICENSE files in the repository root for full details. | ||
| */ | ||
|
|
||
| import { JSX } from "react"; | ||
|
|
||
| /** | ||
| * Properties of an item added to the Space panel | ||
| * @alpha | ||
| */ | ||
| export interface SpacePanelItemProps { | ||
| /** | ||
| * A CSS class name for the item | ||
| */ | ||
| className?: string; | ||
|
|
||
| /** | ||
| * An icon to show in the item. If not provided, no icon will be shown. | ||
| */ | ||
| icon?: JSX.Element; | ||
|
|
||
| /** | ||
| * The label to show in the item | ||
| */ | ||
| label: string; | ||
|
|
||
| /** | ||
| * A tooltip to show when hovering over the item | ||
| */ | ||
| tooltip?: string; | ||
|
|
||
| /** | ||
| * Styles to apply to the item | ||
| */ | ||
| style?: React.CSSProperties; | ||
|
|
||
| /** | ||
| * Callback when the item is selected | ||
| */ | ||
| onSelected: () => void; | ||
| } | ||
|
|
||
| /** | ||
| * API for inserting extra UI into Element Web. | ||
| * @alpha Subject to change. | ||
| */ | ||
| export interface ExtrasApi { | ||
| /** | ||
| * Inserts an item into the space panel as if it were a space button, below | ||
| * buttons for other spaces. | ||
| * If called again with the same spaceKey, will update the existing item. | ||
| * @param spaceKey - A key to identify this space-like item. | ||
| * @param props - Properties of the item to add. | ||
| */ | ||
| setSpacePanelItem(spaceKey: string, props: SpacePanelItemProps): void; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.