Commit graph

1639 commits

Author SHA1 Message Date
Matthias Metelka
32ddbf5e5e Add back html icons, remove visual editor icons 2022-08-12 00:09:10 +02:00
Matthias Metelka
a319270391 Make LabelContainer sticky
to make field operations accessible on fields with a lot of content.
2022-08-12 00:04:04 +02:00
Matthias Metelka
c2a2edc4e1 Adjust field gutter/margins 2022-08-12 00:01:52 +02:00
Matthias Metelka
3793e19253 Move StickyBadge closer to field border 2022-08-12 00:01:23 +02:00
Matthias Metelka
12e192b170 Make StickyBadge feel more responsive 2022-08-12 00:01:07 +02:00
Matthias Metelka
170ef0b310 Fix aliasing issue on focused field corners 2022-08-11 23:58:49 +02:00
Matthias Metelka
9a2b3410d0 Add slide out animation to EditingArea, RichTextInput and PlainTextInput
only for collapsing, because it is choppy on expansion (common issue with Svelte transitions).
2022-08-11 23:57:53 +02:00
Matthias Metelka
3dca559f88 Create separate collapsed field state
this means users can collapse fields with the HTML editor open and it will stay open when the field is expanded again.
2022-08-11 23:52:38 +02:00
Matthias Metelka
4eae6981f8 Remove RichTextBadge.svelte 2022-08-11 20:41:03 +02:00
Matthias Metelka
82dde941d2 Show HTML toggle when PlainTextInput is active, regardless of hover/focus 2022-08-09 00:23:58 +02:00
Matthias Metelka
441956922b Merge branch 'fresh-fields' of https://github.com/kleinerpirat/anki into fresh-fields 2022-08-09 00:04:29 +02:00
Matthias Metelka
c289d3cc7c Reduce field height by two pixels 2022-08-09 00:03:36 +02:00
Matthias Metelka
1367e2f2b9
Merge branch 'main' into fresh-fields 2022-08-08 23:58:34 +02:00
Matthias Metelka
9f0322d17e Reduce field height by a few pixels 2022-08-08 23:58:02 +02:00
Matthias Metelka
d63e3c6d14 Implement more obvious HTML toggle on bottom right 2022-08-08 23:56:31 +02:00
RumovZ
4ea370959b
Fix flicker when remapping imported notetype field (#2005) 2022-08-08 01:01:25 +10:00
Matthias Metelka
dae8fef432 Use tweened SVG for triangle instead of CSS hack 2022-08-04 00:10:53 +02:00
Matthias Metelka
eba053a20b Show toggle only on hover
for mobile I'd like to implement a swipe mechanism.
2022-08-03 22:16:09 +02:00
Matthias Metelka
cf90c71e59 Don't show toggle when field is collapsed 2022-08-03 20:39:51 +02:00
Matthias Metelka
37c74e4fca Fix transition
and format
2022-08-03 20:09:40 +02:00
Matthias Metelka
2a94acd9e8 Make whole separator line clickable 2022-08-03 20:03:10 +02:00
Matthias Metelka
1280372129 Move PlainTextBadge between editing inputs
where it belongs :)
2022-08-03 20:02:44 +02:00
Matthias Metelka
26c5fbc367 Fix imports 2022-08-03 19:39:30 +02:00
Matthias Metelka
ffe20d6fbe Remove unused import 2022-08-03 18:24:10 +02:00
Matthias Metelka
3043789960 Redesign fields 2022-08-03 18:06:15 +02:00
Matthias Metelka
4cd47294e4 Remove code icons, keep one pin icon version 2022-08-03 17:46:22 +02:00
Matthias Metelka
89500f9dd6 Add chevron icons 2022-08-03 17:45:13 +02:00
Matthias Metelka
338c76e9f7 Use outline version for tag icon 2022-08-03 17:43:10 +02:00
Matthias Metelka
a3165d7f07 Remove unused function from #1476 2022-08-03 13:47:22 +02:00
Henrik Giesel
3e28605638
Use wavy flags (flag-alternative) (#1995) 2022-08-01 20:15:22 +10:00
Damien Elmes
2e2fc799e2 Only show basename of CSV file 2022-07-23 17:53:50 +10:00
Damien Elmes
340da23104 Wrap type answer output in code tag; remove extra div
This would make more sense as a class on the outer div, but existing
templates reference code#typeans, so avoid breaking things for now.
2022-07-22 20:37:56 +10:00
Damien Elmes
f582181ea4 Upgrade Svelte for CVE 2022-07-22 20:06:45 +10:00
RumovZ
cc929687ae
Deck-specific Limits (#1955)
* Add deck-specific limits to DeckNormal

* Add deck-specific limits to schema11

* Add DeckLimitsDialog

* deck_limits_qt6.py needs to be a symlink

* Clear duplicate deck setting keys on downgrade

* Export deck limits when exporting with scheduling

* Revert "deck_limits_qt6.py needs to be a symlink"

This reverts commit 4ee7be1e10.

* Revert "Add DeckLimitsDialog"

This reverts commit eb0e2a62d3.

* Add day limits to DeckNormal

* Add deck and day limits mock to deck options

* Revert "Add deck and day limits mock to deck options"

This reverts commit 0775814989.

* Add Tabs component for daily limits

* Add borders to tabs component

* Revert "Add borders to tabs component"

This reverts commit aaaf553893.

* Implement tabbed limits properly

* Add comment to translations

* Update rslib/src/decks/limits.rs

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* Fix camel case in clear_other_duplicates()

* day_limit → current_limit

* Also import day limits

* Remember last used day limits

* Add day limits to schema 11

* Tweak comment (dae)

* Exclude day limit in export (dae)

* Tweak tab wording (dae)

* Update preset limits on preset change

* Explain tabs in tooltip (dae)

* Omit deck and today limits if v2 is enabled

* Preserve deck limit when switching to today limit
2022-07-19 18:27:25 +10:00
RumovZ
cff04a288a
Fix card info not updating (#1957)
Update was not triggered if card id didn't change.
2022-07-12 10:34:48 +10:00
Damien Elmes
5ea78e1c8e Since DupeResolution is in CsvMetadata, we don't need to pass it separately
Follow-up to #1930
2022-06-27 17:15:54 +10:00
RumovZ
b6a7760cb4
Restore and save last dupe resolution setting (#1930)
* Restore dupe resolution setting

* Save dupe resolution setting

* Push config logic into backend (dae)
2022-06-24 15:10:06 +10:00
Matthias Metelka
e6f158e445
Fix descriptions overflowing field (#1925) 2022-06-23 13:32:07 +10:00
Henrik Giesel
c1e54e6842
Fix field description (#1923)
* Remove most of the original description placeholder implementation

* Move description showing logic to RichTextInput

- there is no need to propagate it to ContentEditable

* Remove the @html from field-description

This actually worked - however I removed it in case we'd rather offer
markdown support or something else in the future.

* Do not remove placeholder already on focus

- Other editors do not do it either

* Hide via hidden attribute instead of unmounting

* Do not pass content to ContentEditable

* Sort imports

* Change placeholder text color (dae)

In day mode, slightly-grey is almost indistinguishable from black
(at least on the monitor I'm using here)
2022-06-22 09:53:10 +10:00
RumovZ
1b8bab73d1
Csv import tweaks (#1920)
* Don't use special label for tags column

This was setting the label of whichever column the user chose for tags
to "Tags". Showing field content is more helpful.

* Map tags column automatically like fields
2022-06-22 09:44:12 +10:00
Damien Elmes
3eb8a6ce9d Pass content directly instead of its writable container 2022-06-21 12:24:00 +10:00
Damien Elmes
30c6bd58c9 Recalculate field map after delimeter changes
https://forums.ankiweb.net/t/anki-2-1-54-release-candidate/20861/8
2022-06-21 10:35:08 +10:00
Hikaru Y
bc5633e070
Fix field description not toggled properly (#1919)
It appears that a variable bound to the `innerHTML` property of
a contenteditable element is only updated when `input` event fires on
the element, and not when changes are made to the DOM programmatically.
2022-06-21 10:12:00 +10:00
Henrik Giesel
3969487e77
Join RichTextAPI and RichTextContextAPI + Expose anki/RichTextInput (#1918)
* Format scss correctly so it passes ts:format

* Use on and singleCallback in ImageHandle and MathjaxHandle

* Add a few comments

* Fix relict of partial commit

* Fix 'element not found' in ImageHandle

* Remove setting css on image handle twice

* Remove use of container in ImageHandle

* Remove use of container in MathjaxHandle

* Use unprefixed properties of RichTextInputAPI

* Inline api to get to RichTextInputAPI

* Join customStyles into RichTextInputAPI

* Export RichTextInput; Remove SetContext

* Address eslint and svelte_check
2022-06-20 16:11:27 +10:00
Henrik Giesel
336ad05693
Add EditorField export (#1915)
- This is useful when you want to set up hooks, etc. on the EditorField
  component
- Because when you can only use the NoteEditor export, you cannot notice
  when fields are mounted or destroyed
2022-06-20 12:07:07 +10:00
Henrik Giesel
ae69bb0834
Check event.key instead of event.code to detect Space in TagEditor (#1913)
* Closes #1901
2022-06-17 11:08:17 +10:00
Matthias Metelka
6d8fb35fab
Make field description a placeholder inside EditingArea (#1912)
* Move field description into EditingArea as placeholder

* Prevent insertion of breaks into empty fields

to allow :empty CSS selector to also work on fields other than the first one.

* Remove redundant setContext from EditingArea

* Fix import order

* Revert "Prevent insertion of breaks into empty fields"

This reverts commit 1615fd5cf4.

* Use class:empty instead of :empty CSS pseudo-class

* Restrict description to single line, ellipse overflow

* Make description in field dialog a bit clearer
2022-06-17 11:02:30 +10:00
Abdo
1bab947c9c
Fix JS drop event not firing in the reviewer (#1906)
* Allow webviews to opt in to default D&D handling

* Remove redundant webview.js include

* Block default drag & drop behavior in reviewing screens

* Fix mypy error
2022-06-10 23:33:53 +10:00
RumovZ
6da5e5b042
CSV import/export fixes and features (#1898)
* Fix footer moving upwards

* Fix column detection

Was broken because escaped line breaks were not considered.
Also removes delimiter detection on `#columns:` line. User must use tabs
or set delimiter beforehand.

* Add CSV preview

* Parse `#tags column:`

* Optionally export deck and notetype with CSV

* Avoid clones in CSV export

* Prevent bottom of page appearing under footer (dae)

* Increase padding to 1em (dae)

With 0.5em, when a vertical scrollbar is shown, it sits right next to
the right edge of the content, making it look like there's no right
margin.

* Experimental changes to make table fit+scroll (dae)

- limit individual cells to 15em, and show ellipses when truncated
- limit total table width to body width, so that inner table is shown
with scrollbar
- use class rather than id - ids are bad practice in Svelte components,
as more than one may be displayed on a single page

* Skip importing foreign notes with filtered decks

Were implicitly imported into the default deck before.
Also some refactoring to fetch deck ids and names beforehand.

* Hide spacer below hidden field mapping

* Fix guid being replaced when updating note

* Fix dupe identity check

Canonify tags before checking if dupe is identical, but only add update
tags later if appropriate.

* Fix deck export for notes with missing card 1

* Fix note lines starting with `#`

csv crate doesn't support escaping a leading comment char. :(

* Support import/export of guids

* Strip HTML from preview rows

* Fix initially set deck if current is filtered

* Make isHtml toggle reactive

* Fix `html_to_text_line()` stripping sound names

* Tweak export option labels

* Switch to patched rust-csv fork

Fixes writing lines starting with `#`, so revert 5ece10ad05.

* List column options with first column field

* Fix flag for exports with HTML stripped
2022-06-09 10:28:01 +10:00
Damien Elmes
496bce229b Override older protobufjs pulled in via @bazel/typescript 2022-06-03 13:15:48 +10:00