From 8e0c03e66e3d0c0ff46ce3b003362cc402c925fa Mon Sep 17 00:00:00 2001 From: Jan Starzak Date: Mon, 22 Jan 2024 16:07:54 +0100 Subject: [PATCH] feat(Output): support flipping, dynamic font size --- .../src/data-stores/OutputSettingsStore.ts | 6 ++--- packages/apps/client/src/PrompterStyles.css | 8 ++++++ .../CurrentRundown/CurrentRundown.tsx | 4 +-- .../src/components/CurrentRundown/Segment.tsx | 10 ++++--- packages/apps/client/src/index.scss | 10 +++++++ .../apps/client/src/stores/RundownStore.ts | 3 +-- .../src/views/Output/Output.module.scss | 8 ++++++ .../apps/client/src/views/Output/Output.tsx | 26 ++++++++++++++++--- 8 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 packages/apps/client/src/views/Output/Output.module.scss diff --git a/packages/apps/backend/src/data-stores/OutputSettingsStore.ts b/packages/apps/backend/src/data-stores/OutputSettingsStore.ts index 99949d0..a760606 100644 --- a/packages/apps/backend/src/data-stores/OutputSettingsStore.ts +++ b/packages/apps/backend/src/data-stores/OutputSettingsStore.ts @@ -7,7 +7,7 @@ export class OutputSettingsStore { // _id: '', // TODO: load these from persistent store upon startup? - fontSize: 10, + fontSize: 7, mirrorHorizontally: false, mirrorVertically: false, @@ -15,8 +15,8 @@ export class OutputSettingsStore { focusPosition: 'center', showFocusPosition: false, - marginHorizontal: 5, - marginVertical: 5, + marginHorizontal: 1, + marginVertical: 1, activeRundownPlaylistId: null, }) diff --git a/packages/apps/client/src/PrompterStyles.css b/packages/apps/client/src/PrompterStyles.css index 79ea868..97a62f4 100644 --- a/packages/apps/client/src/PrompterStyles.css +++ b/packages/apps/client/src/PrompterStyles.css @@ -20,6 +20,14 @@ font-size: var(--prompter-font-size-base); line-height: var(--prompter-line-height); + + /* These are needed to maintain compatibility with Prose-mirror's text layout */ + word-wrap: break-word; + white-space: pre-wrap; + white-space: break-spaces; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; + font-feature-settings: 'liga' 0; } .Prompter p { diff --git a/packages/apps/client/src/components/CurrentRundown/CurrentRundown.tsx b/packages/apps/client/src/components/CurrentRundown/CurrentRundown.tsx index be48e92..c2adbc2 100644 --- a/packages/apps/client/src/components/CurrentRundown/CurrentRundown.tsx +++ b/packages/apps/client/src/components/CurrentRundown/CurrentRundown.tsx @@ -37,9 +37,9 @@ const CurrentRundown = observer((): React.JSX.Element => {

-