* style: labels on added time

* style: remove mentions of PiP

* refactor: unify usage of ms for timers

* refactor: create events with 0 duration

* style: several small tweaks

* refactor: keep block when applying delays

* feat: blocks have titles

* style: improvements in time entry warnings

* style: override progress bar styles

* style: prevent overflow

* feat: show character count in editor

* refactor: provide initial payload

* refactor: lower test boundary

* refactor: get colour from swatches

* style: rename title block

* chore: version bump
This commit is contained in:
Carlos Valente
2023-04-05 22:08:13 +02:00
committed by GitHub
parent 0a68377b82
commit 5e481d49da
57 changed files with 556 additions and 276 deletions
+34 -2
View File
@@ -1,12 +1,18 @@
import { RuntimeStore } from 'ontime-types';
import { socket } from '../adapters/WebsocketAdapter.js';
import { eventTimer } from '../services/TimerService.js';
import { messageService } from '../services/message-service/MessageService.js';
import { eventLoader } from '../classes/event-loader/EventLoader.js';
const store: Partial<RuntimeStore> = {};
let store: Partial<RuntimeStore> = {};
/**
* A runtime store that broadcasts its payload
*/
export const eventStore = {
init(payload: RuntimeStore) {
store = payload;
},
get<T extends keyof RuntimeStore>(key: T) {
return store[key];
},
@@ -23,9 +29,35 @@ export const eventStore = {
return store;
},
broadcast() {
socket.send({
socket.sendAsJson({
type: 'ontime',
payload: store,
});
},
};
/**
* Module initialises the services and provides initial payload for the store
* Currently registered objects in store
* - Timer Service timer
* - Timer Service playback
* - Message Service timerMessage
* - Message Service publicMessage
* - Message Service lowerMessage
* - Message Service onAir
* - Event Loader loaded
* - Event Loader titles
* - Event Loader titlesPublic
*/
export const getInitialPayload = () => ({
timer: eventTimer.timer,
playback: eventTimer.playback,
timerMessage: messageService.timerMessage,
publicMessage: messageService.publicMessage,
lowerMessage: messageService.lowerMessage,
onAir: messageService.onAir,
loaded: eventLoader.loaded,
titles: eventLoader.titles,
titlesPublic: eventLoader.titlesPublic,
});