Commit Graph

116 Commits

Author SHA1 Message Date
Damien Elmes
a3d9f90af5 update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().

There are some downsides:

- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again.  Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.

Upsides:

- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.

Other changes:

- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.

Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-10-01 12:52:53 +10:00
Damien Elmes
604247482d handle changed aria-expanded typing 2021-09-29 12:20:27 +10:00
Henrik Giesel
60690e0557 Rename StickyBar and StickyBottom to StickyHeader and StickyFooter 2021-09-15 23:15:55 +02:00
Henrik Giesel
b502ceedca Make the ImageHandle and MathjaxHandle dropdowns perfectly touch the HandleSelection 2021-09-15 22:26:32 +02:00
Henrik Giesel
97647e7b24 Prevent hiding handles by clicking on handles 2021-09-15 17:56:56 +02:00
Henrik Giesel
ce9674f824 Correctly pass down dropdownObject... 2021-09-15 16:16:42 +02:00
Henrik Giesel
c227c7dc39 Make StickyBottom actually stick and make editor fullsize + flexbox 2021-09-15 15:21:37 +02:00
Henrik Giesel
71bdeeba39 Apply specific CSS to Mathjax CodeMirror 2021-09-15 13:46:04 +02:00
Henrik Giesel
1185593fee Use CodeMirror for Mathjax Editor 2021-09-15 13:33:18 +02:00
Henrik Giesel
dd280038a8 Prevent tooltip expanding body tag in editor 2021-09-15 02:24:09 +02:00
Henrik Giesel
69c6265111 Align suggestions with start of tag 2021-09-09 19:03:06 +02:00
Henrik Giesel
75ed24b7ea Do not use overflow-x on ButtonToolbar
* Fixes deck-options dropdown not showing.
  It seems like it's no longer necessary
2021-09-09 17:50:02 +02:00
Henrik Giesel
8fd4412dbe Fix bug where sometimes Autocomplete menu would not show even though suggestions exist 2021-09-09 15:38:11 +02:00
Henrik Giesel
7bdf9aaf00 Set disabled class on TagInput from WithAutocomplete 2021-09-09 15:38:10 +02:00
Henrik Giesel
eb3bc08420 Explicitly not support dropleft/dropright
We'll deal with it when we have a use case
2021-09-09 15:38:09 +02:00
Henrik Giesel
18b838a173 Correctly place dropdown and only update if there's activeInput 2021-09-09 15:38:09 +02:00
Henrik Giesel
96cbca8fb6 Update to use shortened SCSS paths for some components 2021-09-09 15:38:05 +02:00
Henrik Giesel
b49112a910 Refer to ./ instead of components/ from within components 2021-09-09 15:38:04 +02:00
Henrik Giesel
f5b58442ce Fix ts/components:svelte_check 2021-09-09 15:38:03 +02:00
Henrik Giesel
a0970e8515 Add scrollbar_lib to components 2021-09-09 15:38:03 +02:00
Henrik Giesel
04b75859cc Implement nowrap mode 2021-09-09 15:38:01 +02:00
Henrik Giesel
28b1c09cda Implement TagWithTooltip 2021-09-09 15:38:00 +02:00
Henrik Giesel
7058d14d25 Move WithTooltip to components 2021-09-09 15:38:00 +02:00
Henrik Giesel
ffb1f3bff2 Space out Sticky Bottom with Spacer component 2021-09-09 15:37:58 +02:00
Henrik Giesel
d40e0df11b Position stickyBottom fixed 2021-09-09 15:37:56 +02:00
Henrik Giesel
d15d6d1584 Improve positioning of tag editor badges 2021-09-09 15:37:56 +02:00
Henrik Giesel
63dc42cff6 Do not open autocomplete on clicking input 2021-09-09 15:37:55 +02:00
Henrik Giesel
95806c5176 Allow clicking on suggestion items 2021-09-09 15:37:54 +02:00
Henrik Giesel
3dff89fda5 Switch WithAutocomplete to WithDropdown and fix SelectedTagBadge 2021-09-09 15:37:53 +02:00
Henrik Giesel
874a315f83 Add SelectedTagBadge to offer context items for selected tags 2021-09-09 15:37:53 +02:00
Henrik Giesel
376f543680 Make automatic deselect when leaving tag editor 2021-09-09 15:37:52 +02:00
Henrik Giesel
e876a374e2 Disable toggle on clicking element (toggle) for WithAutocomplete 2021-09-09 15:37:51 +02:00
Henrik Giesel
b93646209a Introduce AutocompleteItem
* needs too much custom styling / behavior to be done with DropdownItem
2021-09-09 15:37:50 +02:00
Henrik Giesel
a515a9899b Don't allow Enter/Tab/Arrows for Autocomplete, if not active
Don't show Autocomplete, if there are no items available
2021-09-09 15:37:49 +02:00
Henrik Giesel
11c6fe880b Add some visual for TagAutocomplete 2021-09-09 15:37:39 +02:00
Henrik Giesel
281985480d Fix some WithDropdownMenu logic 2021-09-09 15:37:37 +02:00
Henrik Giesel
808d01c4fb Decouple TagInput from TagAutocomplete completely 2021-09-09 15:37:37 +02:00
Henrik Giesel
8d95503189 Add tabbable option to DropdownItem 2021-09-09 15:37:37 +02:00
Henrik Giesel
a5af3a9280 Fix issue with text showing below StickyBottom 2021-09-09 15:37:37 +02:00
Henrik Giesel
6c6062cc58 Make styling of DropdownMenu easier by introducing dropdown-content 2021-09-09 15:37:36 +02:00
Henrik Giesel
d705d049ce Delete when updating tagname to empty text 2021-09-09 15:37:35 +02:00
Henrik Giesel
3ad86dfb33 Use our DropdownMenu component for TagAutocomplete 2021-09-09 15:37:34 +02:00
Henrik Giesel
64a2ead2ca Remove TagInputEdit and TagInputNew 2021-09-09 15:37:34 +02:00
Henrik Giesel
f056851c1e Port Focus tags shortcut to webview 2021-09-09 15:37:34 +02:00
Henrik Giesel
9418b1491b Create AddTagBadge component 2021-09-09 15:37:33 +02:00
Henrik Giesel
77be86ec21 Enable tag delete icon 2021-09-09 15:37:33 +02:00
Henrik Giesel
1026d26793 Display a tag-outline icon in the bottom left 2021-09-09 15:37:33 +02:00
Henrik Giesel
bb6db5bd95 Add Tag DeleteIcon 2021-09-09 15:37:33 +02:00
Henrik Giesel
f9b320e105 Mount TagEditor 2021-09-09 15:37:33 +02:00
Henrik Giesel
f5ab78825a Fix Float buttons in rtl 2021-09-06 21:15:37 +10:00