Skip to content

Commit d8a7796

Browse files
committed
multiple lines
1 parent e4bee8b commit d8a7796

46 files changed

Lines changed: 2281 additions & 1569 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

TODO.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Version 1.0.0
2+
13
- [x] Sort out glossing functionality
24
- [x] Improve sharing visuals
3-
- [ ] Check SEO
5+
- [x] Check SEO
46
- [x] Highlighting tokens when selecting (hovering) and when selected (with current color, which will be the link color)
57
- [x] Make sure instructions are clear and concise, up to date, and complete.
68
- [x] Add better examples - with complex links and advanced tokenization.
@@ -9,3 +11,35 @@
911
- [x] Dependency CVE check (`npm audit` / CI)
1012
- [x] Add QR code export method
1113
- [-] Add QR code to visualization exports (small in the corner - only site link; `siteLandingQrDataUrl` + `siteQrPngDataUri` in svg — wiring disabled in ExportMenu) - out of scope for now
14+
15+
# Version 2
16+
17+
Includes bugs and feature requests from the public.
18+
19+
Feature requests - high priority:
20+
- [ ] Add ability to add more than 2 lines
21+
- [ ] Improve support for longer sentences - currently non-svg export is low resolution when font is small
22+
- [ ] add special separator to combine words into a single token - it will be connected with 1 line in the visualization but still be written with a space or spaces
23+
- [ ] add ability to optionally tokenize punctuation as separate tokens
24+
- [ ] add transcription line support (probably can be solved by adding more than 2 lines)
25+
26+
Usability improvements - high priority:
27+
- [ ] Parameter card or other view should move to be next to the editor - currently on small screens you have to scroll back and forth between the editor and the parameters
28+
29+
Bug fixes - high priority:
30+
- [ ] Reportedly ligatures in custom fonts are not working in the export (but fine in preview) - investigate and fix
31+
- [ ] When color palette is depleted, it should cycle through the colors - currently uses the last color
32+
33+
Advanced features - medium priority:
34+
- [ ] Ability to create custom color palettes
35+
- [ ] Maybe parameter-line connection should be reworked to be more flexible - each line should have all the parameters configured separately.
36+
37+
General interface improvements - medium priority:
38+
- [ ] Interface languages - add pages for some major languages
39+
- [ ] Make interface more compact to accomodate more features
40+
- [ ] Probably add full screen mode for the preview - so that the user would be able to see it all and screenshot if needed - this will partially help if we won't be able to solve ligature problems
41+
42+
Considerations:
43+
- If we support multiple lines with independent parameters, we can deprecate separate gloss row and configuration - it will be just a single new line with the glosses. Then, the user would be able to add transcription and other annotations in the same manner.
44+
- In case of adding multiple lines, additional lines after the first 2 should be optional.
45+
- The ultimate fix for pdf export would be to use external resource like gotenberg. We can set up a server with it, but preferably this is to be avoided since it will add costs to support it.
Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<script lang="ts">
22
import { Card } from 'flowbite-svelte';
3-
import SentenceField from './SentenceField.svelte';
4-
import GlossInputRow from './GlossInputRow.svelte';
3+
import LineCard from './LineCard.svelte';
54
import { projectStore } from '$lib/state/project.svelte.js';
6-
import { settingsStore } from '$lib/state/settings.svelte.js';
5+
import { MAX_LINES } from '$lib/serialization/schema.js';
76
</script>
87

98
<Card class="w-full max-w-none p-4 sm:p-6" aria-labelledby="editor-heading">
@@ -32,47 +31,26 @@
3231
</div>
3332
</div>
3433
<p class="mb-4 w-full text-base text-gray-600 dark:text-gray-400">
35-
Edit the sentences here. To link words, click a word in the preview below, then click the
36-
matching word on the other line — the connector will appear. You can link a word to multiple
37-
words on the other side. Click a connector to remove it. Click a selected word again to deselect
38-
it.
34+
Each row is a line of text with its own font and size. In the preview, click a word, then click
35+
a word on an <strong>adjacent</strong> line to connect them. Connectors only run between neighboring
36+
lines. Click a connector to remove it. Click the same word again to deselect.
3937
</p>
40-
<div class="grid grid-cols-12 gap-4">
41-
<div class="col-span-12 md:col-span-6">
42-
<SentenceField
43-
label="Source sentence"
44-
side="source"
45-
rawText={projectStore.sourceTextRaw}
46-
tokens={projectStore.sourceTokens}
47-
onText={(v) => projectStore.setSourceText(v)}
48-
/>
49-
</div>
50-
<div class="col-span-12 md:col-span-6">
51-
<SentenceField
52-
label="Target sentence"
53-
side="target"
54-
rawText={projectStore.targetTextRaw}
55-
tokens={projectStore.targetTokens}
56-
onText={(v) => projectStore.setTargetText(v)}
57-
/>
58-
</div>
38+
{#each projectStore.lines as line, i (line.id)}
39+
<LineCard {line} index={i} total={projectStore.lines.length} />
40+
{/each}
41+
<div class="mt-2 flex flex-wrap items-center gap-3">
42+
<button
43+
type="button"
44+
class="rounded-none border border-primary-600 bg-primary-600 px-3 py-2 text-sm font-medium text-white hover:bg-primary-700 disabled:opacity-50 dark:border-primary-500 dark:bg-primary-600 dark:hover:bg-primary-500"
45+
disabled={projectStore.lines.length >= MAX_LINES}
46+
onclick={() => projectStore.addLine()}
47+
>
48+
Add line
49+
</button>
50+
{#if projectStore.lines.length >= MAX_LINES}
51+
<p class="text-sm text-amber-700 dark:text-amber-400">
52+
Soft limit: {MAX_LINES} lines — consider simplifying for shorter share links.
53+
</p>
54+
{/if}
5955
</div>
60-
{#if settingsStore.settings.showGloss}
61-
<div class="mt-4 grid grid-cols-12 gap-4">
62-
<div class="col-span-12 md:col-span-6">
63-
<p class="mb-2 text-base text-gray-600 dark:text-gray-400">Source glosses</p>
64-
<GlossInputRow
65-
tokens={projectStore.sourceTokens}
66-
onGloss={(id, v) => projectStore.setSourceGloss(id, v)}
67-
/>
68-
</div>
69-
<div class="col-span-12 md:col-span-6">
70-
<p class="mb-2 text-base text-gray-600 dark:text-gray-400">Target glosses</p>
71-
<GlossInputRow
72-
tokens={projectStore.targetTokens}
73-
onGloss={(id, v) => projectStore.setTargetGloss(id, v)}
74-
/>
75-
</div>
76-
</div>
77-
{/if}
7856
</Card>

bitext/src/lib/components/editor/GlossInputRow.svelte

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)