Henrik Giesel
ef90924f91
Use compile_sass and add flag to make editor-toolbar compile again
2021-04-15 13:09:50 +02:00
Henrik Giesel
7bf675d75e
Remove $$restProps and make explicit dropdown support in buttons
...
* Currently LabelButton, CommandIconButtton, and IconButton support dropdowns
2021-04-15 13:09:50 +02:00
Henrik Giesel
fa6ac2b27b
Add RawButton and hook old python hooks up to it
2021-04-15 13:09:50 +02:00
Henrik Giesel
98dc8a56f2
Introduce ToolbarItem as a better base type instead of DynamicSvelteComponent
2021-04-15 13:09:50 +02:00
Henrik Giesel
0e0f33022f
Switch from lazy loading of properties to wrapping the buttons in a function
2021-04-15 13:09:50 +02:00
Henrik Giesel
42e580430a
Add a button / buttonGroup insertion API
2021-04-15 13:09:50 +02:00
Henrik Giesel
d93aefdaaa
Fix sticky toolbar which was broken when introducing var(--toolbar-size)
2021-04-15 13:09:50 +02:00
Henrik Giesel
d1374d4b58
Show/Hide Cloze button depending on whether cloze type
2021-04-15 13:09:50 +02:00
Henrik Giesel
e8fb17c1eb
Move cloze logic and wrapping logic editor-toolbar
2021-04-15 13:09:50 +02:00
Henrik Giesel
fa00dbc01e
Make buttons and button groups easily toggleable through hidden web component
2021-04-15 13:09:50 +02:00
Henrik Giesel
8ba2b383eb
Remove props property in favor of $$restProps
2021-04-15 13:09:50 +02:00
Henrik Giesel
64fbbbfcd0
Get rid of types.d.ts in favor of DynamicSvelteComponent
2021-04-15 13:09:50 +02:00
Henrik Giesel
7646a81b7c
Pass button groups as actual button groups, not arrays
2021-04-15 13:09:50 +02:00
Henrik Giesel
5520863278
Pass wraps more similiar to how size is passed via CSS variables
2021-04-15 13:09:50 +02:00
Henrik Giesel
9ff521126d
Make wraps a passable prop to EditorToolbar
...
Can be set to nowrap via document.getElementByID("editorToolbar").component.$set({ wraps: false })
2021-04-15 13:09:50 +02:00
Henrik Giesel
fc3a272327
Give clearer type names to dynamicComponent
2021-04-15 13:09:50 +02:00
Henrik Giesel
38fe270937
Rename title to tooltip across editor toolbar components
2021-04-15 13:09:50 +02:00
Henrik Giesel
2b252d8b41
Rename types.ts to types.d.ts
2021-04-15 13:09:50 +02:00
Henrik Giesel
5d2d9396f9
Change overflow of button groups to overflow-y auto
...
Avoids erratic creation of scrollbars
2021-04-15 13:09:50 +02:00
Henrik Giesel
3fb052d736
Use dynamicComponent instead of withLazyProps
2021-04-15 13:09:50 +02:00
Henrik Giesel
c432831a19
Move enabled/disabled logic to EditorToolbar
2021-04-15 13:09:50 +02:00
Henrik Giesel
5bc7132a4f
Fix clicking the bold button immediately showing the updated button state
...
- rather than only after typing
2021-04-15 13:09:49 +02:00
Henrik Giesel
3c84e31bf4
Support building as external repo
2021-04-15 13:09:49 +02:00
Henrik Giesel
115757c327
Remove lazyProperties -> we use withLazyProperties instead
2021-04-15 13:09:49 +02:00
Henrik Giesel
cfb9376e5e
Fix some code quality issues
2021-04-15 13:09:49 +02:00
Henrik Giesel
90825cc95b
Pass in buttons and menus directly as stores
2021-04-15 13:09:49 +02:00
Henrik Giesel
77b45835f4
Make --toolbar-size a parameter
2021-04-15 13:09:49 +02:00
Henrik Giesel
162f13fee1
Add ButtonDropdown for dropdowns like the MathJax dropdown on AnkiMobile
2021-04-15 13:09:49 +02:00
Henrik Giesel
cd69c7ffa3
Add exports for add-ons
2021-04-15 13:09:49 +02:00
Henrik Giesel
c1aa8d7bf7
Make it easier to update buttons and menus
2021-04-15 13:09:49 +02:00
Henrik Giesel
b002994d30
Add labels and titles to all buttons
2021-04-15 13:09:49 +02:00
Henrik Giesel
5cecde34ed
Add titles to buttons with lazyProperties
2021-04-15 13:09:49 +02:00
Henrik Giesel
04aebbd7fe
Move logic from index.ts to their individual files
2021-04-15 13:09:49 +02:00
Henrik Giesel
cdb3221f82
Add first lazily loaded i18n strings
2021-04-15 13:09:49 +02:00
Henrik Giesel
a1d11edbdf
Give select an effect on :hover
2021-04-15 13:09:49 +02:00
Henrik Giesel
4544025fc2
Make select display inline-block
2021-04-15 13:09:49 +02:00
Henrik Giesel
bdcdcc7a56
Make Toolbar resizable through a single CSS variable --toolbar-size
2021-04-15 13:09:49 +02:00
Henrik Giesel
f033672045
Add SelectButton
2021-04-15 13:09:49 +02:00
Henrik Giesel
675ffca1fa
Add dropdown menu to mathjax button
2021-04-15 13:09:49 +02:00
Henrik Giesel
c61d5a501d
Make it so you can include DropdownMenus on all kinds of buttons
2021-04-15 13:09:49 +02:00
Henrik Giesel
a053332421
WIP: Turn DropdownMenu into a _decorator_ usable with all other button types
2021-04-15 13:09:49 +02:00
Henrik Giesel
ef9eb38d26
Utilize enableButtons disableButtons from Svelte component
2021-04-15 13:09:49 +02:00
Henrik Giesel
90c176c180
Display .active:active as :hover buttons
2021-04-15 13:09:49 +02:00
Henrik Giesel
95be25a2eb
Add active shadow on ColorPicker
2021-04-15 13:09:49 +02:00
Henrik Giesel
934b426541
Move display:flex from outer div to ButtonGroup ul
2021-04-15 13:09:49 +02:00
Henrik Giesel
9a0ae77db6
Add negative tabindex
2021-04-15 13:09:49 +02:00
Henrik Giesel
62198b29a0
Add mathjaxButton and htmlButton instead of more button
2021-04-15 13:09:49 +02:00
Henrik Giesel
91a5a20684
Make icons slightly smaller, so they are the same size as before
2021-04-15 13:09:49 +02:00
Henrik Giesel
6fbeeff1c5
Make all buttons functional
2021-04-15 13:09:49 +02:00
Henrik Giesel
904aa3d45a
Move initialization logic from EditorToolbar to index.ts
2021-04-15 13:09:49 +02:00
Henrik Giesel
d976dd711c
Simplify General Toolbar structure
2021-04-15 13:09:49 +02:00
Henrik Giesel
fefd2e5008
Merge buttons to one OuterButtonGroup
...
- keeping up the concept of left / right buttons might not be necessary anymore
- This might make it easier to display them on mobile, and simplifies the logic
2021-04-15 13:09:49 +02:00
Henrik Giesel
27188bef29
Make all Leaf buttons 30px high and give same vertical-align
2021-04-15 13:09:49 +02:00
Henrik Giesel
5290bc7d86
Rename IconButtonInner to InnerButton, as it does not necessarily contain an Icon
2021-04-15 13:09:49 +02:00
Henrik Giesel
87ab416bb3
Add hover and active effects
2021-04-15 13:09:49 +02:00
Henrik Giesel
14577c07ed
Display ButtonGroups inline-block
2021-04-15 13:09:49 +02:00
Henrik Giesel
50a2929e93
Add ButtonGroup for grouping of toolbar items
2021-04-15 13:09:49 +02:00
Henrik Giesel
9a52d0f345
Add CommandIconButton functionality
2021-04-15 13:09:49 +02:00
Henrik Giesel
9330a0bd47
Add color.ts for foreground color and color picker
2021-04-15 13:09:49 +02:00
Henrik Giesel
9c19c85f79
Add remaining icons for toolbar
2021-04-15 13:09:49 +02:00
Henrik Giesel
c06d500f0c
Include icons directly in ts lib
2021-04-15 13:09:49 +02:00
Henrik Giesel
e175c9348e
First implementation
2021-04-15 13:09:48 +02:00
Henrik Giesel
e1da2d0e01
Add ts/editor-toolbar
2021-04-15 13:09:48 +02:00
Damien Elmes
c046ce1c26
move bootstrap into ts/sass
2021-04-15 16:10:01 +10:00
Damien Elmes
130e960262
support external building of sass; node_modules->ts/bootstrap
2021-04-15 15:59:17 +10:00
Damien Elmes
9e0e3edb04
allow passing sass deps to svelte compile/check
2021-04-15 14:27:53 +10:00
Damien Elmes
59d6e15d50
update other ts deps
2021-04-15 10:59:29 +10:00
Damien Elmes
74c917239f
remove unused esbuild package, and update rules_nodejs packages
2021-04-15 10:57:19 +10:00
Damien Elmes
cc91868092
move esbuild into separate repo
...
Most of our changes have been upstreamed, but the toolchain change
probably won't be merged soon, and a separate git repo will make it
easier to track upstream changes.
@hgiesel output_css=True will need to be changed to output_css="foo.css"
instead
2021-04-15 10:53:49 +10:00
Damien Elmes
ac045e9e3f
fix initial ease not being updated
2021-04-14 23:01:03 +10:00
Damien Elmes
57a1651113
deck config prototype work in progress
...
Still in the early stages, and not hooked up yet.
2021-04-14 22:33:10 +10:00
Damien Elmes
64818290fc
Merge pull request #1128 from hgiesel/webviewcss3
...
Remove unnecessary exports from sass/BUILD.bazel
2021-04-14 21:28:25 +10:00
Damien Elmes
6523fed84c
experiment with making bootstrap scss available as a library
...
This will allow us to import the local sass lib, then use something
like the following in our sass:
@import "ts/bootstrap/functions";
@import "ts/bootstrap/variables";
@import "ts/bootstrap/mixins";
@import "ts/bootstrap/helpers";
@import "ts/bootstrap/dropdown";
@import "ts/bootstrap/forms";
@import "ts/bootstrap/buttons";
@import "ts/bootstrap/button-group";
I'm currently trialing it out on a prototype reimplementation of the
deck options screen. Unfortunately bootstrap don't seem to support the
@use syntax, so we need to @import everything
2021-04-14 21:27:34 +10:00
Henrik Giesel
d055bfa3c7
Remove unnecessary exports from sass/BUILD.bazel
...
I think these were just part of an unsuccessful experiment
Partially reverses fb26361274
2021-04-14 12:31:42 +02:00
Damien Elmes
cd4326c77e
run prettier on some sass files
2021-04-14 18:22:33 +10:00
Damien Elmes
2a43d42323
run black/isort on Python scripts
2021-04-14 18:22:02 +10:00
Damien Elmes
898b8d2e09
Merge pull request #1125 from hgiesel/scrollbarcorner
...
Color Scrollbar bottom right corner
2021-04-14 12:43:34 +10:00
Henrik Giesel
082fd8d28f
Color in the Scrollbar corner at the bottom right into the appropriate color
2021-04-13 21:41:15 +02:00
Henrik Giesel
fb26361274
Create explicit dependencies for the congrats,editor,graphs scss files
2021-04-13 19:47:03 +02:00
Henrik Giesel
19903986f9
Move compile_sass.bzl to /ts + Remove core.css from data/web (unused?)
2021-04-13 19:47:03 +02:00
Henrik Giesel
5bcb2f080f
Declare dependencies in data/web/css
2021-04-13 19:47:03 +02:00
Henrik Giesel
9cba0c2d29
Make h1 explicitly bold in Graph.svelte
2021-04-13 19:47:03 +02:00
Henrik Giesel
630ee9c6bb
Use graphs-base and congrats-base
2021-04-13 19:47:03 +02:00
Henrik Giesel
8efbcddbb4
Do not include webview.css for editor
2021-04-13 19:47:03 +02:00
Henrik Giesel
b14dc3f7cb
Move card_counts and split off fusion_vars
2021-04-13 19:47:03 +02:00
Henrik Giesel
c944eeb5f6
Add base.scss
2021-04-13 19:47:03 +02:00
Damien Elmes
eb6502bd6e
add missing copyright headers to *.svelte
2021-04-13 19:02:41 +10:00
Damien Elmes
1f475a1709
add missing copyright headers to *.ts
2021-04-13 18:57:08 +10:00
Damien Elmes
c6da01c4aa
disable Jest tests on Windows again
...
It looks like the templated_args change only masked the error last time;
Jest seems broken on Windows with both the patched .24 version, latest
stable, and the new beta version too, presumably because symlinks are
being handled differently on Windows somehow. It might be possible to
hack around the issue by patching the following file, but I'm not sure:
https://github.com/facebook/jest/blob/master/packages/jest-haste-map/src/crawlers/node.ts
2021-04-12 15:39:46 +10:00
Damien Elmes
9d03e266e3
add naturalWholeUnit() and basic tests to lib/time.ts
...
naturalWholeUnit() is not currently used
2021-04-12 14:42:06 +10:00
Damien Elmes
3c3258251d
force number in protobuf generation
...
Anki's object IDs and millisecond timestamps fit within MAX_SAFE_INTEGER.
2021-04-12 14:33:20 +10:00
Damien Elmes
43a8b8fec3
stop Svelte warnings from failing the build
...
+ check for them at test time
2021-04-12 14:28:09 +10:00
Damien Elmes
8c64cc38d7
fix jest
...
- templated_args was missing --node_modules= prefix, and was causing
tests to pass unconditionally
- update to beta of jest 27, which introduces an option to fix the
symlink handling, and is approx twice as fast to start up
2021-04-12 09:43:31 +10:00
Damien Elmes
dc8c0a2e73
switch esbuild to a toolchain
2021-04-07 15:19:23 +10:00
Damien Elmes
fb1111623f
update to latest esbuild
2021-04-07 14:54:40 +10:00
abdo
a6bdde68db
Fix graph labels display in RTL layout
2021-04-02 06:25:38 +03:00
Damien Elmes
188a8891fd
add docstring to forEditorField
2021-03-29 18:13:45 +10:00
Damien Elmes
efb8a4e61c
Merge pull request #1101 from Arthur-Milchior/TS_type
...
NF: add type ts
2021-03-29 18:09:56 +10:00
Damien Elmes
2e1104c724
move loader arg into esbuild() invocation
...
upstream.bzl should be kept as close to upstream as possible, so that
it's easier to send changes upstream and pull in future changes
2021-03-29 17:59:06 +10:00
Arthur Milchior
cfa2ee6774
NF: add type ts
2021-03-28 23:59:16 +02:00