diff --git a/frontend/src/lib/editor.svelte b/frontend/src/lib/editor.svelte
index 53d4cc4..eda9e46 100644
--- a/frontend/src/lib/editor.svelte
+++ b/frontend/src/lib/editor.svelte
@@ -11,6 +11,8 @@
import SettingsCard from '$lib/editor/settings-card.svelte';
import QuizCard from '$lib/editor/card.svelte';
import Spinner from './Spinner.svelte';
+ import { elementSelection } from '$lib/stores.js';
+ import ElementSelection from '$lib/editor/slides/element_selection.svelte';
let schemaInvalid = false;
let yupErrorMessage = '';
@@ -187,3 +189,7 @@
{/await}
+
+{#if $elementSelection.data === null}
+
+{/if}
diff --git a/frontend/src/lib/editor/card.svelte b/frontend/src/lib/editor/card.svelte
index 03b99ea..a79b74f 100644
--- a/frontend/src/lib/editor/card.svelte
+++ b/frontend/src/lib/editor/card.svelte
@@ -12,6 +12,7 @@
import Spinner from '../Spinner.svelte';
import { createTippy } from 'svelte-tippy';
import { getLocalization } from '$lib/i18n';
+ import Slide from './slide.svelte';
const { t } = getLocalization();
@@ -51,9 +52,9 @@
*/
-
+
-
+
-
-
- {#await import('$lib/inline-editor.svelte')}
-
- {:then c}
-
-
+
+ {#await import('$lib/inline-editor.svelte')}
+
+ {:then c}
+
+
+
+ {/await}
+
+ {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''}
+
+

{
+ data.questions[selected_question].image = '';
+ }}
/>
- {/await}
-
- {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''}
-
-

{
- data.questions[selected_question].image = '';
- }}
- />
-
- {:else if pow_data === undefined}
-
-
-
- {:else}
- {#await import('$lib/editor/uploader.svelte')}
-
- {:then c}
-
- {/await}
- {/if}
-
-
-
-
-
-
-
-
-
-
- {#if data.questions[selected_question].type === QuizQuestionType.ABCD}
- {#await import('$lib/editor/ABCDEditorPart.svelte')}
-
- {:then c}
-
- {/await}
- {:else if data.questions[selected_question].type === QuizQuestionType.RANGE}
-
- {:else if data.questions[selected_question].type === QuizQuestionType.VOTING}
- {#await import('$lib/editor/VotingEditorPart.svelte')}
-
- {:then c}
-
{/await}
{/if}
+
+
+
+
+
+ {#if data.questions[selected_question].type === QuizQuestionType.ABCD}
+ {#await import('$lib/editor/ABCDEditorPart.svelte')}
+
+ {:then c}
+
+ {/await}
+ {:else if data.questions[selected_question].type === QuizQuestionType.RANGE}
+
+ {:else if data.questions[selected_question].type === QuizQuestionType.VOTING}
+ {#await import('$lib/editor/VotingEditorPart.svelte')}
+
+ {:then c}
+
+ {/await}
+ {/if}
+
+
+ {$t('editor_page.right_click_to_delete')}
+
-
{$t('editor_page.right_click_to_delete')}
-
+ {:else}
+
+ {/if}
diff --git a/frontend/src/lib/editor/sidebar.svelte b/frontend/src/lib/editor/sidebar.svelte
index c575606..0b0aa6f 100644
--- a/frontend/src/lib/editor/sidebar.svelte
+++ b/frontend/src/lib/editor/sidebar.svelte
@@ -242,7 +242,7 @@
{/each}
+
diff --git a/frontend/src/lib/editor/slide.svelte b/frontend/src/lib/editor/slide.svelte
new file mode 100644
index 0000000..97063f1
--- /dev/null
+++ b/frontend/src/lib/editor/slide.svelte
@@ -0,0 +1,205 @@
+
+
+
+
+
+ {#each elements as el, i}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if el.type === ElementTypes.Text}
+
Text
+
+ {:else if el.type === ElementTypes.Headline}
+
Headline
+
+ {/if}
+
+ {/each}
+
+
+ {#each ghost_elements as el, i}
+
+
+
+ {/each}
+
+
diff --git a/frontend/src/lib/editor/slides/element_selection.svelte b/frontend/src/lib/editor/slides/element_selection.svelte
new file mode 100644
index 0000000..2639ac5
--- /dev/null
+++ b/frontend/src/lib/editor/slides/element_selection.svelte
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
Select the element you want to add
+
+
+ {#each element_list as el}
+ - {
+ elementSelection.set({ data: el.type });
+ }}
+ >
+
+
{el.name}
+
{el.description}
+
+ {el.shortcut}
+
+ {/each}
+
+
+
diff --git a/frontend/src/lib/editor/slides/types/headline.svelte b/frontend/src/lib/editor/slides/types/headline.svelte
new file mode 100644
index 0000000..2272baf
--- /dev/null
+++ b/frontend/src/lib/editor/slides/types/headline.svelte
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/frontend/src/lib/editor/slides/types/text.svelte b/frontend/src/lib/editor/slides/types/text.svelte
new file mode 100644
index 0000000..6990f86
--- /dev/null
+++ b/frontend/src/lib/editor/slides/types/text.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+
+
diff --git a/frontend/src/lib/editor/types.ts b/frontend/src/lib/editor/types.ts
new file mode 100644
index 0000000..a5a5cab
--- /dev/null
+++ b/frontend/src/lib/editor/types.ts
@@ -0,0 +1,11 @@
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ */
+
+export enum ElementTypes {
+ Text = 'TEXT',
+ Headline = 'HEADLINE',
+ Image = 'IMAGE'
+}
diff --git a/frontend/src/lib/quiz_types.ts b/frontend/src/lib/quiz_types.ts
index 5793508..cca3897 100644
--- a/frontend/src/lib/quiz_types.ts
+++ b/frontend/src/lib/quiz_types.ts
@@ -52,7 +52,7 @@ export interface EditorData {
public: boolean;
title: string;
description: string;
- questions: Question[];
+ questions: (Question | object)[];
cover_image?: string;
background_color?: string;
}
diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts
index b17548f..cb32835 100644
--- a/frontend/src/lib/stores.ts
+++ b/frontend/src/lib/stores.ts
@@ -11,6 +11,7 @@ export const signedIn = writable(false);
export const pathname = writable('/');
export const alertModal = writable({ open: false, title: '', body: '' });
+export const elementSelection = writable({ data: undefined });
import { goto } from '$app/navigation';
import { page } from '$app/stores';