Commit Graph
56 Commits
Author SHA1 Message Date
David Lechner 9f538490e5 toolbar: remove OpenFileButton
This is no longer used.
2022-11-23 17:20:45 -06:00
David Lechner d323db4d1b toolbar/ActionButton: only disable using style
This removes use of the button disable property since it removes the
button from the accessibility tree and also makes tooltips not work.
The styling is kept the same by manually including the disable style.
2022-11-23 17:20:45 -06:00
David Lechner 03f6c004db sponsor: add new button and dialog
Issue: https://github.com/pybricks/support/issues/719
2022-10-28 18:01:39 -05:00
David Lechner 397ea60354 ReplButton: disable when hub doesn't support it
Fixes: https://github.com/pybricks/support/issues/743
2022-10-21 16:26:43 -05:00
David Lechner 960a3163ed add support for Pybricks Profile v1.2.0
This adds support to the BLE Pybricks Profile v1.2.0. This includes a
new method to download and run programs and a new file format for the
user program.

Code for the old download and run is kept for backwards compatibility.
However, the PnP ID characteristic is no longer optional, so the
minimum Pybricks Profile is now v1.1.0.
2022-10-14 16:21:18 -05:00
David Lechner b4e1c8293d replace use of deprecated IRef 2022-09-01 11:45:59 -05:00
David Lechner 92431298b2 toolbar/RunButton: enable only when active file
Before multi-file support, it was not possible to have no open file.
So we need to change the state logic to only enable the button when
there is an active file rather than when the editor "is ready".

Fixes: https://github.com/pybricks/support/issues/691
2022-08-12 18:00:57 -05:00
David Lechner e3fece1517 toolbar/TourButton: fix test when env var set
The name depends on the environment and this test failed during release.
2022-07-28 10:32:19 -05:00
David Lechner 8bece7d957 tour: add new tour component 2022-07-27 15:19:36 -05:00
David Lechner d6df128860 i18n: use automatic type inference of translation keys
Finally figured out a way to make typescript strongly type translation
keys so we can avoid the tedium of creating enums of translation keys.
2022-07-22 13:48:50 -05:00
David Lechner 85deb42f76 firmware: add multi-step dialog 2022-07-20 12:32:17 -05:00
David Lechner 90cd4865e8 Add support for MPY ABI v6.
Pybricks firmware v3.2.0b2 has updated to MicroPython 1.19 which
includes breaking changes to the MPY binary file format.
2022-07-06 12:51:01 -05:00
David Lechner 883807b4b4 fix breaking changes for user-event v14 2022-06-02 18:45:28 -05:00
dependabot[bot]andDavid Lechner 0149842803 build(deps): bump react-dropzone from 12.0.4 to 14.2.1 (#843)
* build(deps): bump react-dropzone from 12.0.4 to 14.2.1

Bumps [react-dropzone](https://github.com/react-dropzone/react-dropzone) from 12.0.4 to 14.2.1.
- [Release notes](https://github.com/react-dropzone/react-dropzone/releases)
- [Commits](https://github.com/react-dropzone/react-dropzone/compare/v12.0.4...v14.2.1)

---
updated-dependencies:
- dependency-name: react-dropzone
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* toolbar: update for breaking changes in ReactDropZone

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Lechner <david@pybricks.com>
2022-06-02 19:58:06 +00:00
David Lechner a3e55c828a move useI18n to i18n.ts
Since we are using the react-i18n babel loader plugin, useI18n can only
be used once per file. Also we have to remember to add the istanbul
ignore next comment each time we use it. By moving this to a common
file, it can be easily copied and pasted when a new submodule is
created and we don't have to remember the rules when calling it.
2022-05-21 13:57:58 -05:00
David Lechner 0839392183 rework roving tab index to use react-aria 2022-05-17 23:20:09 -05:00
David Lechner f7dcf8b0f7 components/toolbar: move from utils
This is a better home.
2022-05-17 11:28:21 -05:00
David Lechner 404818bcdf toolbar: use roving focus 2022-05-13 23:28:12 -05:00
David Lechner dc2daf2fe4 toolbar: hide icons from a11y tools
There are already ARIA labels, so the icons should be hidden.
2022-05-13 14:44:26 -05:00
David Lechner 7322c9d667 utils: drop pointerEventsNone
Not sure why this was used in the first place, but causes non-default
behavior which can be confusing.
2022-05-13 14:39:35 -05:00
David Lechner cd88789be7 toolbar: override aria-haspopup
The Tooltip2 component incorrectly sets this attribute which should
not be set for tooltips.
2022-05-13 14:38:12 -05:00
David Lechner 5dc6b2e4cb util: drop preventBrowserNativeContextMenu
This is done once at the top-level app, so is no longer needed.
2022-05-12 19:20:46 -05:00
David Lechner edd8ebfd64 Add Activities
This adds a new Activities tab list and view similar to VS code. The
Explorer and Settings are migrated to this view.
2022-05-12 12:33:21 -05:00
David Lechner 65623f801d update for breaking blueprintjs style changes
it is no longer feasible to build the blueprintjs css ourselves, so we
just use all of the default variable values and override things using
selectors instead.
2022-05-11 18:13:36 -05:00
David Lechner 5ee74187eb optimize svgs
The new webpack doesn't like the xml namespaces and refuses to compile
so we have to save the svg files in optimized form.
2022-05-10 20:26:58 -05:00
David Lechner 79d5b06136 editor: move isReady state from app
This is a step towards getting rid of the 'editor' context.
2022-03-26 12:03:08 -05:00
David Lechner f36e774d1e coverage: ignore useI18n 2022-03-25 15:54:04 -05:00
David Lechner 5dd61fa4c3 toolbar/buttons: consolidate buttons 2022-03-25 15:54:04 -05:00
David Lechner 9f254f035f i18n: use babel-loader plugin 2022-03-25 15:54:04 -05:00
David Lechner c3c9a8fd7c improve dialog accessability 2022-03-17 11:08:31 -05:00
David Lechner 46faff981d toolbar: add label to buttons
This improves accessability by letting us get buttons by the label.
2022-03-16 15:24:48 -05:00
David Lechner 675d01013d utils/react: drop preventFocusOnClick
We can fix this better with css tweaks.
2022-03-15 21:39:24 -05:00
David Lechner 8e4045449c src: use prop unpacking pattern
This makes the code a bit shorter by not having to use `props.` all of
the time. Also make everything VoidFunctionComponent while we are
touching this.
2022-03-12 16:07:31 -06:00
David Lechner 228ba4ebb8 toolbar: change button order
The flash and bluetooth buttons are moved to the left. This way, the
run button is closer to the text editor.
2022-03-12 15:47:47 -06:00
David Lechner cf8438c689 toolbar: drop open and saveAs buttons
These have been replace by the explorer.
2022-03-12 15:45:36 -06:00
David Lechner a2ccd3afdb utils/react: add pointerEventsNone helper
This should prevent some unnecessary rerendering by not creating a new
inline object.
2022-03-12 15:26:48 -06:00
David Lechner c51669c357 fix deps in hotkeys memos 2022-03-12 15:19:50 -06:00
David Lechner de7e046d31 avoid lambda props
This fixes the simple cases of callback props using lambda functions.
This will prevent rerendering in some cases since a new callback
function is not created on each call.
2022-03-12 15:19:50 -06:00
David Lechner c229d407cf utils/react: add preventDefault helpers
These can be used instead of always having to add a comment explaining
what preventDefault does in a given context.
2022-03-12 14:57:30 -06:00
David Lechner 02d7672155 react-dropzone: fix for breaking change in v12
This fixes a breaking change from upgrading to react-dropzone to v12.
2022-02-28 11:01:59 -06:00
David Lechner a0a1ae7126 "@blueprintjs/core": "^3.53.0"
This allows us to drop the monkey patch to work around an upstream bug.
2022-02-22 14:23:20 -06:00
David Lechner fd09783a45 toolbar: work around tooltip bugs
This works around several bugs where tooltips don't close when expected.

Fixes: https://github.com/pybricks/pybricks-code/issues/275
2021-12-28 18:55:20 -06:00
David Lechner 09b46ed5be toolbar: make buttons scale with screen size
This is very basic, just 2 sizes. But it makes things a bit better
on phones.

Fixes: https://github.com/pybricks/support/issues/300
2021-12-27 12:38:51 -06:00
David Lechner dfa497fcf6 toolbar: drop no-box-shadow
This is now applied to all descendets of pb-toolbar so we don't need the
utility class.
2021-12-27 12:38:51 -06:00
David Lechner 6d0e97f50e app: fix pb-app div size and background color 2021-12-27 12:38:51 -06:00
David Lechner 6dc4dcb2e5 toolbar: specify image width/height
This make the button the right size while waiting for the image to download.

Fixes: https://github.com/pybricks/support/issues/369
2021-12-27 12:38:50 -06:00
David Lechner 11e0fefb1d toolbar: use function form of Dropzone 2021-12-27 12:38:50 -06:00
David Lechner eb9ea2876e toolbar: remove unuse buttonRef in ActionButton 2021-12-27 12:38:50 -06:00
David Lechner 9be6ba3640 update to Tooltip2
Tooltip has been deprecated so trying out the new Tooltip2.
2021-12-27 12:38:50 -06:00
David Lechner 534d3f80e6 toolbar: convert Toolbar to function 2021-12-27 12:38:50 -06:00