From da076aa48e705092420a185d860b05b33fd5fe28 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 27 May 2021 13:55:13 +0200 Subject: [PATCH 01/63] Generalize ButtonToolbarItem to SectionItem --- ts/components/ButtonToolbar.svelte | 15 ++++++------- ...nToolbarItem.svelte => SectionItem.svelte} | 12 +++++----- ts/components/buttons.ts | 8 ++----- ts/components/contextKeys.ts | 2 +- ts/components/registration.ts | 14 ++++++++---- ts/deckoptions/ConfigSelector.svelte | 10 ++++----- ts/editor/EditorToolbar.svelte | 22 +++++++++---------- ts/editor/FormatBlockButtons.svelte | 10 ++++----- 8 files changed, 46 insertions(+), 47 deletions(-) rename ts/components/{ButtonToolbarItem.svelte => SectionItem.svelte} (68%) diff --git a/ts/components/ButtonToolbar.svelte b/ts/components/ButtonToolbar.svelte index f1685cfb0..19ce423bd 100644 --- a/ts/components/ButtonToolbar.svelte +++ b/ts/components/ButtonToolbar.svelte @@ -5,12 +5,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +
+ + {#each $dynamicItems as item} + + + + {/each} +
diff --git a/ts/components/identifier.ts b/ts/components/identifier.ts index deee14436..977d69a89 100644 --- a/ts/components/identifier.ts +++ b/ts/components/identifier.ts @@ -2,7 +2,7 @@ // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export type Identifier = string | number; -export function find( +export function findElement( collection: HTMLCollection, idOrIndex: Identifier ): [number, Element] | null { @@ -34,12 +34,12 @@ export function find( return result; } -export function insert( +export function insertElement( element: Element, collection: Element, idOrIndex: Identifier ): number { - const match = find(collection.children, idOrIndex); + const match = findElement(collection.children, idOrIndex); if (match) { const [index, reference] = match; @@ -51,12 +51,12 @@ export function insert( return -1; } -export function add( +export function appendElement( element: Element, collection: Element, idOrIndex: Identifier ): number { - const match = find(collection.children, idOrIndex); + const match = findElement(collection.children, idOrIndex); if (match) { const [index, before] = match; @@ -69,12 +69,12 @@ export function add( return -1; } -export function update( +export function updateElement( f: (element: Element) => void, collection: Element, idOrIndex: Identifier ): number { - const match = find(collection.children, idOrIndex); + const match = findElement(collection.children, idOrIndex); if (match) { const [index, element] = match; diff --git a/ts/components/registration.ts b/ts/components/registration.ts index bf3b3dfac..5b03b5f02 100644 --- a/ts/components/registration.ts +++ b/ts/components/registration.ts @@ -4,7 +4,7 @@ import type { SvelteComponentTyped } from "svelte/internal"; import type { Writable, Readable } from "svelte/store"; import { writable } from "svelte/store"; import type { Identifier } from "./identifier"; -import { find } from "./identifier"; +import { findElement } from "./identifier"; export interface SvelteComponent { component: SvelteComponentTyped; @@ -98,7 +98,7 @@ export function makeInterface( update: (registration: T) => void, position: Identifier ): void { - const match = find(elementRef.children, position); + const match = findElement(elementRef.children, position); if (match) { const [index] = match; diff --git a/ts/deckoptions/ConfigEditor.svelte b/ts/deckoptions/ConfigEditor.svelte index 8f3c143a2..582a57ca0 100644 --- a/ts/deckoptions/ConfigEditor.svelte +++ b/ts/deckoptions/ConfigEditor.svelte @@ -3,6 +3,9 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> -
- - - - +
+ + + + + + + + + + + + + + {#if state.v3Scheduler} - + + + {/if} - - - -
+ + + + + + + + + + + diff --git a/ts/deckoptions/DeckOptionsPage.svelte b/ts/deckoptions/DeckOptionsPage.svelte index 520335f69..93a474e90 100644 --- a/ts/deckoptions/DeckOptionsPage.svelte +++ b/ts/deckoptions/DeckOptionsPage.svelte @@ -31,7 +31,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html }, ]; } + + export const options = {}; - + diff --git a/ts/editor/EditorToolbar.svelte b/ts/editor/EditorToolbar.svelte index d87d02c59..a330f5052 100644 --- a/ts/editor/EditorToolbar.svelte +++ b/ts/editor/EditorToolbar.svelte @@ -41,15 +41,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import ColorButtons from "./ColorButtons.svelte"; import TemplateButtons from "./TemplateButtons.svelte"; + export let size = isApplePlatform() ? 1.6 : 2.0; + export let wrap = true; + export const toolbar = {}; export const notetypeButtons = {}; export const formatInlineButtons = {}; export const formatBlockButtons = {}; export const colorButtons = {}; export const templateButtons = {}; - - export let size = isApplePlatform() ? 1.6 : 2.0; - export let wrap = true; From b99b12f157e4331aa4c18ee441a737da6fe6945b Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 27 May 2021 16:15:41 +0200 Subject: [PATCH 03/63] Make API argument required in ConfigEditor --- ts/deckoptions/ConfigEditor.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/deckoptions/ConfigEditor.svelte b/ts/deckoptions/ConfigEditor.svelte index 582a57ca0..b8c5fd441 100644 --- a/ts/deckoptions/ConfigEditor.svelte +++ b/ts/deckoptions/ConfigEditor.svelte @@ -17,7 +17,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import type { DeckOptionsState } from "./lib"; export let state: DeckOptionsState; - export let options: Record | undefined = undefined; + export let options: Record;
From 7dacd9b72f55aed1b3b4146f53f5700de0bb4aa8 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 27 May 2021 20:11:29 +0200 Subject: [PATCH 04/63] Add container scss to deckoptions-base --- ts/deckoptions/deckoptions-base.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ts/deckoptions/deckoptions-base.scss b/ts/deckoptions/deckoptions-base.scss index 63b82a0a6..2bd3e59f5 100644 --- a/ts/deckoptions/deckoptions-base.scss +++ b/ts/deckoptions/deckoptions-base.scss @@ -3,6 +3,7 @@ @use "ts/sass/bootstrap-dark"; @import "ts/sass/base"; +@import "ts/sass/bootstrap/containers"; @import "ts/sass/bootstrap/dropdown"; @import "ts/sass/bootstrap/forms"; @import "ts/sass/bootstrap/buttons"; From 282de2167554219b5e9fad7e5d1dd7ac6bbfe1c4 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 27 May 2021 20:28:23 +0200 Subject: [PATCH 05/63] Use Bootstrap containers instead of CSS in base for deckoptions --- ts/components/ButtonToolbar.svelte | 2 +- ts/components/Section.svelte | 2 +- ts/components/SelectButton.svelte | 5 +++++ ts/components/StickyBar.svelte | 4 ++-- ts/deckoptions/deckoptions-base.scss | 21 --------------------- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/ts/components/ButtonToolbar.svelte b/ts/components/ButtonToolbar.svelte index d2e387e55..cfa9478a9 100644 --- a/ts/components/ButtonToolbar.svelte +++ b/ts/components/ButtonToolbar.svelte @@ -78,7 +78,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html