Skip to content

Commit 7b1cd38

Browse files
authored
Merge pull request #2 from tinygodsdev/v2
V2
2 parents e4bee8b + d5d0418 commit 7b1cd38

92 files changed

Lines changed: 5744 additions & 1822 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Changelog
2+
3+
Short notes for changes on branch **`v2`** relative to **`main`** (no dedicated git version tag). For an exact file list, run: `git diff main...v2 --stat`.
4+
5+
## [v2] — vs `main`
6+
7+
### Added
8+
9+
- **Multi-line alignment** — projects and preview support more than two lines; links only between vertically adjacent lines.
10+
- **Line editor** — line cards (`LineCard`), modal text editing (`LineEditModal`), line settings (font, size, spacing, LTR/RTL, etc.) via popover/sheet.
11+
- **Per-pair line controls** — vertical gap slider (`LinePairGapSlider`), toggling connector visibility for each adjacent line pair (`pairControls`).
12+
- **Tokenization settings** — Tokens tab (word split characters, join character, optional punctuation tokenization); “?” hints (`SettingsFieldHint`).
13+
- **Built-in examples** — expanded set in `examples.ts` (simple, Turkish interlinear with glosses/IPA, RTL Hebrew/Arabic/English, Tagalog with hyphen inside words, CJK).
14+
- **`/about` page** — Aligner documentation, screenshots, table of contents, SEO; links from header and footer.
15+
- **`/privacy` page** — dedicated route and navigation updates.
16+
- **Raster export****2×–6×** scale for **PNG** and **PDF** (default 2×); tooltip explaining vector SVG/HTML.
17+
- **Share** — export project data as JSON for presets and debugging (`ShareDialog`).
18+
- **Custom fonts in exports****harfbuzzjs** for shaping (ligatures / OpenType closer to the browser), glyph outlines via **opentype.js** `glyph.getPath` at HarfBuzz glyph IDs (correct SVG orientation).
19+
- **Domain & state**`lines-helpers`, broader `schema`/project/link-selection plumbing, `layoutExport`, jump-to Tokens tab (`settingsNav`), editor UI (`editorUi`), `viewport` where needed.
20+
- **Serialization** — state format evolution (including `compact-v3`, expanded `schema`), updated roundtrip and migration tests.
21+
- **Tests** — token/palette coverage, harfbuzz export smoke; `docs/v2-manual-qa.md`.
22+
- **Static assets** — screenshots for about, `sitemap.xml` updates.
23+
24+
### Changed
25+
26+
- **Home & SEO** — copy aligned with current UX (multi-line, adjacent links, terminology); Aligner (Bitext Align) branding; `SeoIntro`, `SeoSections`, `JsonLd`, `metadata.ts`.
27+
- **Preview**`AlignmentPreview`, token markup (`TokenView`, `TokenRow`), link layer (`AlignmentSvg`) with pairs and line order; line reorder and line actions; **in-preview controls follow preview light/dark background**, not only the page theme.
28+
- **SVG export** — respects `pairControls`, background, line weight/opacity, optional embedded fonts, etc. (`svg.ts`, `ExportMenu`).
29+
- **Settings** — Style / Colors / Tokens / Fonts tabs; icons (gear for editor tokenization settings, split-cells for Tokens); **Flowbite `Tabs`**: `classes.content` instead of deprecated `contentClass`.
30+
- **Link palette** — when colors run out, the palette **cycles** (`palettes`).
31+
- **OG image** — SVG generation tweaks for social previews (`og-svg.ts`).
32+
33+
### Fixed
34+
35+
- Ligatures and complex OpenType shaping for **user fonts** in PNG/PDF/SVG/HTML exports (HarfBuzz + opentype outlines).
36+
- Incorrect glyph orientation when using only harfbuzzjs `glyphToPath` (outlines now come from opentype per shaped glyph).
37+
38+
### Removed / replaced
39+
40+
- Older narrow editor/preview pieces for a single-sentence model (`GlossInputRow`, `SentenceField`, `GlossRow`) — replaced by **multi-line cards** and token rows in preview.
41+
- **Preview background image** — removed from Style settings (legacy shares / compact `bg:2` decode as light).
42+
43+
### Dependencies (`bitext`)
44+
45+
- Added: **`harfbuzzjs`** (^0.10.3).
46+
- **`opentype.js`** pinned to **1.3.4** (avoid resolving to mistaken **1.3.5** or problematic **2.x** for exports).
47+
48+
### Known limitations
49+
50+
- **PDF** is still a **raster page** (PNG embedded in PDF), not pure vector SVG→PDF.
51+
- Very large PNG/PDF scales increase file size and browser memory use.
52+
53+
---
54+
55+
Commit range on this branch vs `main` (messages are terse):
56+
57+
`d8a7796``9df3353` — multiple lines → new editor → merge better-editor → new interface / UI updates → about updates.

TODO.md

Lines changed: 44 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,44 @@
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+
- [x] Add ability to add more than 2 lines
21+
- [x] Improve support for longer sentences - currently non-svg export is low resolution when font is small
22+
- [x] 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+
- [x] add ability to optionally tokenize punctuation as separate tokens
24+
- [x] add transcription line support (probably can be solved by adding more than 2 lines)
25+
26+
Usability improvements - high priority:
27+
- [x] 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+
- [x] Reportedly ligatures in custom fonts are not working in the export (but fine in preview) — custom font `<text>` → paths now uses **harfbuzzjs** for shaping + `glyphToPath`, with **opentype.js** 1.3.4 only for metrics / fallback. Pin stays on `opentype.js@1.3.4` (avoid mistaken 1.3.5 & 2.x). Remaining edge cases: exotic scripts / SVG `text-anchor` with RTL may still differ slightly from browser.
31+
- [x] When color palette is depleted, it should cycle through the colors - currently uses the last color
32+
33+
Advanced features - medium priority:
34+
35+
- [x] Maybe parameter-line connection should be reworked to be more flexible - each line should have all the parameters configured separately.
36+
- [x] Add ability to hide preview controls so that the user can see the entire visualization and screenshot it if needed. In this mode - add the credit to the bottom of the visualization, like in exports.
37+
38+
General interface improvements - medium priority:
39+
40+
- [x] Make interface more compact to accomodate more features
41+
- [x] 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
42+
- [x] Create privacy policy page and link to it from the footer. We don't collect any data, but we should have a page for it. We use Google Analytics, Google Ads (probably in the future) and Tally for feedback.
43+
- [x] Add alternative color marking - don't color the text, color the background of the token. This should correctly work on dark mode as well. The mode can be changed in the settings (probably in colors tab).
44+
45+
Considerations:
46+
- 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.
47+
- In case of adding multiple lines, additional lines after the first 2 should be optional.
48+
- 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.
49+
50+
51+
Version 2.1:
52+
53+
- [ ] Interface languages - add pages for some major languages
54+
- [ ] Ability to create custom color palettes

bitext/package-lock.json

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitext/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
"dependencies": {
5050
"@resvg/resvg-js": "^2.6.2",
5151
"fflate": "^0.8.2",
52+
"harfbuzzjs": "^0.10.3",
5253
"idb-keyval": "^6.2.1",
5354
"jspdf": "^4.2.1",
54-
"opentype.js": "^1.3.4",
55+
"opentype.js": "1.3.4",
5556
"qrcode": "^1.5.4"
5657
}
5758
}

bitext/src/app.css

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
@import 'flowbite/src/themes/default.css';
44
@custom-variant dark (&:where(.dark, .dark *));
55

6+
/* Reserve scrollbar width so horizontal padding stays visually symmetric when scrollbars appear */
7+
html {
8+
scrollbar-gutter: stable;
9+
}
10+
611
/*
712
* Central theme: edit primary scale + app shell here.
813
* Flowbite plugin forms/range use --color-brand*; Flowbite Svelte uses Tailwind `primary-*` for buttons/tabs.
@@ -77,7 +82,6 @@
7782
.preview-frame {
7883
position: relative;
7984
width: 100%;
80-
max-width: 64rem;
8185
margin-inline: auto;
8286
border-radius: 0;
8387
border: 1px solid var(--color-card-border);
@@ -97,18 +101,25 @@
97101
border-color: rgb(55 65 81);
98102
}
99103

100-
.preview-frame__image-overlay {
101-
position: absolute;
102-
inset: 0;
103-
backdrop-filter: blur(1px);
104-
}
105-
106-
.preview-frame--light .preview-frame__image-overlay {
107-
background: color-mix(in srgb, #ffffff 82%, transparent);
104+
/* Floating link hint — no panel chrome; halo keeps text readable on busy previews */
105+
.preview-frame__link-hint {
106+
margin: 0;
107+
border: none;
108+
background: none;
109+
box-shadow: none;
110+
color: #374151;
111+
text-shadow:
112+
0 0 6px #fff,
113+
0 0 14px #fff,
114+
0 1px 2px rgb(255 255 255 / 0.95);
108115
}
109116

110-
.preview-frame--dark .preview-frame__image-overlay {
111-
background: color-mix(in srgb, #1e1e1e 82%, transparent);
117+
.preview-frame--dark .preview-frame__link-hint {
118+
color: #e5e7eb;
119+
text-shadow:
120+
0 0 8px rgb(0 0 0 / 0.85),
121+
0 0 18px rgb(0 0 0 / 0.75),
122+
0 1px 3px rgb(0 0 0 / 0.9);
112123
}
113124

114125
.preview-stack {
@@ -119,6 +130,39 @@
119130
align-items: stretch;
120131
}
121132

133+
.preview-frame__attribution {
134+
position: relative;
135+
z-index: 3;
136+
margin-top: 1rem;
137+
text-align: center;
138+
font-family: var(--font-body, system-ui, sans-serif);
139+
font-size: 0.75rem;
140+
line-height: 1.4;
141+
opacity: 0.72;
142+
}
143+
144+
.preview-frame--light .preview-frame__attribution {
145+
color: #64748b;
146+
}
147+
148+
.preview-frame--dark .preview-frame__attribution {
149+
color: #94a3b8;
150+
}
151+
152+
.preview-frame__attribution-link {
153+
text-decoration: underline;
154+
text-underline-offset: 2px;
155+
cursor: pointer;
156+
}
157+
158+
.preview-frame--light .preview-frame__attribution-link {
159+
color: #475569;
160+
}
161+
162+
.preview-frame--dark .preview-frame__attribution-link {
163+
color: #cbd5e1;
164+
}
165+
122166
.preview-gloss-wrap {
123167
width: 100%;
124168
display: flex;
@@ -135,6 +179,15 @@
135179
overflow: visible;
136180
}
137181

182+
/* Range between lines: tint follows preview background, not site dark mode */
183+
.preview-frame--light .line-gap-range input[type='range'] {
184+
accent-color: rgb(79 70 229);
185+
}
186+
187+
.preview-frame--dark .line-gap-range input[type='range'] {
188+
accent-color: rgb(165 180 252);
189+
}
190+
138191
.preview-svg-layer .link-hit {
139192
pointer-events: none;
140193
}

bitext/src/lib/brand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export const ALIGNER_SITE_URL = 'https://aligner.tinygods.dev';
44
/** Host label for attribution text in raster/SVG exports. */
55
export const ALIGNER_SITE_HOST = 'aligner.tinygods.dev';
66

7+
/** Plain attribution line (matches standalone SVG export footer text). */
8+
export const EXPORT_ATTRIBUTION_PLAIN = `Created with ${ALIGNER_SITE_HOST}`;
9+
710
/** Google Analytics 4 measurement ID (gtag). */
811
export const GA_MEASUREMENT_ID = 'G-6Z5775NY39';
912

0 commit comments

Comments
 (0)