Skip to content

Commit

Permalink
Bug fixes, updates and additions to the documentation (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <[email protected]>

* Fix an issue where the play button couldn't set its item

Signed-off-by: Axel Boberg <[email protected]>

* Update dependencies

Signed-off-by: Axel Boberg <[email protected]>

* Add documentation regarding bundled types

Signed-off-by: Axel Boberg <[email protected]>

---------

Signed-off-by: Axel Boberg <[email protected]>
Signed-off-by: Axel Boberg <[email protected]>
Co-authored-by: Axel Boberg <[email protected]>
  • Loading branch information
axelboberg and Axel Boberg authored Dec 30, 2024
1 parent 7906327 commit 834dee4
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 41 deletions.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ Welcome to the full documentation for Bridge. Whether you want to build your own
## Internals
- [Architecture](/docs/architecture.md)
- [Project structure](/docs/structure.md)
- [Types](/docs/types.md)

## Terminology
![Methodology](/media/docs/architecture/methodology.png)

### Workspace
Workspaces are everything you set up for a project. They can be saved and shared as workspace files. A workspace is synced in real time between users connected to the same instance of Bridge.

### Item
Items are the underlying data structure that can be rendered as lists in the rundown or plain buttons. Most items can be played and stopped, doing so will emit an event that can be acted upon by plugins. All items belong to a [type](#type).

### Type
Types are blueprints for items. They define what data an item can contain and in some cases how the UI should be rendered. Types are defined by plugins and can be added and inherited.

[Read more about types](/docs/types.md)

### Tab
A workspace can have one or many tabs containing widgets. Tabs can be rearranged and different tabs can be opened in different windows.

Expand Down
16 changes: 16 additions & 0 deletions docs/types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Types
All items have a type. It's a blueprint for the data it contains and in some cases how it should be rendered in the UI. Bridge comes with a set of server agnostic bundled types.

## Bundled types

### Groups
The group type is a container for multiple items that belong together. Groups can be nested and provides alternatives for playing their children.

### Divider
Items of this type cannot be played. They are simply dividers with a name, color and note.

### Variable
Variables set a value to the state when played. Their values can be used throughout the application.

### Reference
A reference is a pointer to another item. It's useful when an item needs to be present as more than one instance but without duplicating its data.
90 changes: 50 additions & 40 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion plugins/button/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default function App () {
}, [])

React.useEffect(() => {
if (!itemId) {
return
}

async function getItem (itemId) {
const item = await bridge.items.getItem(itemId)
setItem(item)
Expand All @@ -29,7 +33,6 @@ export default function App () {
}
setItem(newItem)
}

bridge.events.on('item.change', handleItemChange)
return () => {
bridge.events.off('item.change', handleItemChange)
Expand Down

0 comments on commit 834dee4

Please sign in to comment.