Commit graph

287 commits

Author SHA1 Message Date
Henrik Giesel
0ffa5030e5 During resizing, make the smaller dimension decide the new dimensions 2021-09-06 21:15:37 +10:00
Henrik Giesel
a7fa217306 Reset height, so it defaults to "auto"
* This allows more flexible dynamic resizing for the image in the (p)reviewer
2021-09-06 21:15:37 +10:00
Henrik Giesel
3fe1180f39 Add margin to other side of dimensions 2021-09-06 21:15:37 +10:00
Henrik Giesel
63fed87b48 Do not allow for resizing when in constrained mode 2021-09-06 21:15:37 +10:00
Henrik Giesel
c4f47be673 Don't show same dimensions twice if there are no custom dimensions 2021-09-06 21:15:37 +10:00
Henrik Giesel
db558c869d Change position of float buttons and dimension
* So we can show dimensions at lower image sizes
2021-09-06 21:15:37 +10:00
Henrik Giesel
fce63ed718 Deal with case where no style.{width,height} is set for size dimensions 2021-09-06 21:15:37 +10:00
Henrik Giesel
460b6f33c9 Dispaly "actualHeight / actualWidth" even in constrained mode 2021-09-06 21:15:37 +10:00
Henrik Giesel
2a548f2ebd Turn off no-explicit-warning for editing-area 2021-09-06 21:15:36 +10:00
Henrik Giesel
e8ec6b61a7 Use ResizeObserver to resize overlay if necessary 2021-09-06 21:15:36 +10:00
Henrik Giesel
2224d1c287 Reset image handle on keydown and blur 2021-09-06 21:15:36 +10:00
Henrik Giesel
796037649a Better RTL support 2021-09-06 21:15:36 +10:00
Henrik Giesel
9342d19504 Move selector / active logic up to ImageHandle 2021-09-06 21:15:36 +10:00
Henrik Giesel
47cd308251 Do not use width/height auto important to avoid enlarging smaller images 2021-09-06 21:15:36 +10:00
Henrik Giesel
7696a181f3 Implement Maximum image size mechanism 2021-09-06 21:15:36 +10:00
Henrik Giesel
a6b071d849 Add float tooltips 2021-09-06 21:15:36 +10:00
Henrik Giesel
5257a4db26 Allow SW resize 2021-09-06 21:15:36 +10:00
Henrik Giesel
5e91108a79 Bind to style properties instead of events 2021-09-06 21:15:36 +10:00
Henrik Giesel
b919b9cb7f Add functionality to set float of image 2021-09-06 21:15:36 +10:00
Henrik Giesel
2a81273115 Image resizes preserves ratio 2021-09-06 21:15:36 +10:00
Henrik Giesel
9b97320438 Add image-handle-dimensions to show dimensions directly on image 2021-09-06 21:15:36 +10:00
Henrik Giesel
53d1435aa7 First implementation of ImageHandle 2021-09-06 21:15:36 +10:00
Damien Elmes
3e5a2a92c7 Introduce editable-container
Contains the shadow root, and references to the styles.
Is ignorant of Editable.
Is necessary, so our we editable.scss does not need to contain
information about Codable, ImageHandle or all those other things which
have nothing to do with Editable
2021-09-06 21:15:36 +10:00
Henrik Giesel
1f34b666b9 Uniformly shorten SCSS imports/uses 2021-09-02 23:37:17 +02:00
Henrik Giesel
0667706d60 Add source for block level elements 2021-09-02 22:31:25 +10:00
Henrik Giesel
f7954af1be Remove special treatment of empty anki-editable 2021-09-02 22:31:25 +10:00
Henrik Giesel
47252983c5 Check for non-existence of block tags instead of exclusive existence of inline tags in editable 2021-09-02 22:31:25 +10:00
Damien Elmes
f5bbeba218 Merge pull request #1350 from hgiesel/exportshortcuts
Implement register-package and export some packages
2021-09-02 22:23:12 +10:00
Damien Elmes
575ddb6cc6 Merge pull request #1351 from hgiesel/fontisinline
Add FONT as an inline tag
2021-09-02 22:22:19 +10:00
Damien Elmes
3fc1ead668 don't allow | in generic family 2021-09-02 21:05:17 +10:00
Henrik Giesel
bafbdb3835 Add FONT as an inline tag 2021-08-31 13:59:07 +02:00
Henrik Giesel
76ca1356ac Implement register-package and export some packages
Exported packages are:
* anki/packages
* anki/shortcuts
* anki/bridgecommand
2021-08-30 14:41:40 +02:00
Damien Elmes
aaa6ecb7e6 Merge pull request #1340 from hgiesel/exportinternal
Export Svelte internals
2021-08-24 10:42:17 +10:00
Damien Elmes
875fd62264 expose require() instead of the svelte global
- Means add-on authors should not need to inject any code in their build
- Should be more flexible - we can export multiple libraries if we wish,
and don't have to worry about require() being clobbered by old add-ons.
2021-08-24 10:22:07 +10:00
Henrik Giesel
119d2e0eb4 Rename cross-unit to export-internal 2021-08-23 23:45:50 +02:00
Henrik Giesel
0585a5da3e Export WithShortcut 2021-08-23 21:23:04 +02:00
Henrik Giesel
5c987896cf Export svelte_internal as library on window object
Closes https://github.com/ankitects/anki/issues/1328.
2021-08-23 21:16:15 +02:00
hikaru-y
0331da21e6 Quote font family names, except for generic families
Fixes https://forums.ankiweb.net/t/font-script-is-not-changing-in-the-anki-windows/12465
2021-08-20 04:31:11 +09:00
Henrik Giesel
b396ef558c Satisfy eslint 2021-08-03 06:12:04 +02:00
Henrik Giesel
00b990b79e Add tooltip for Toggly sticky icon 2021-08-03 06:02:29 +02:00
Henrik Giesel
485460870c Increase inactive opacity a little for better discoverability 2021-08-03 05:52:57 +02:00
Henrik Giesel
2649dc0ad7 Add toggle sticky shortcuts F9 and Shift+F9 2021-08-03 05:52:07 +02:00
Damien Elmes
9a809af6ab Merge pull request #1320 from hgiesel/colorpickerplus
Remember last text and highlight color again
2021-08-03 09:07:46 +10:00
Henrik Giesel
39566638f3 Remember last text and highlight color again 2021-08-02 23:12:00 +02:00
Henrik Giesel
94eff9a864 Install Ctrl+Shfit+V paste only on Apple platforms 2021-07-31 03:43:10 +02:00
Henrik Giesel
8c6df4461d Remove registerShortcut for Ctrl+C/V/A/X from editor/index.ts 2021-07-30 22:28:40 +02:00
Damien Elmes
83a4e510da Merge pull request #1312 from hgiesel/smalleditorrefactors
Use :host instead of :host-context
2021-07-28 13:19:04 +10:00
Damien Elmes
cd784dd652 show warning when trying to indent plain text
https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/55
2021-07-28 12:18:04 +10:00
Henrik Giesel
f682cdf755 Use :host instead of :host-context 2021-07-26 16:06:50 +02:00
Henrik Giesel
8335f81396 Use event object in createShortcut, fix F8 for highlight 2021-07-26 06:15:30 +02:00