Commit Graph

343 Commits

Author SHA1 Message Date
Will Scullin
0f66e66c0e
Fix apple2shader types 2022-06-15 09:42:07 -07:00
Will Scullin
f3f470ffc1
Fix iOS Safari iCloud 2022-06-13 19:58:21 -07:00
Will Scullin
cc025447dc
Fix write error status 2022-06-12 19:39:03 -07:00
Will Scullin
cc46d040ca
Add drag and drop for disks (#130)
* Add drag and drop for disks

* Simplify storage state

* Switch to spawn, add abort signal to loads
2022-06-12 09:42:01 -07:00
Ian Flanigan
3048ec52e1
Interruptable spawn (#132)
* Add `spawn` as a way of calling promise-returning blocks

This change adds `spawn` which takes a no-argument, promise-returning
function, calls it, and returns `void`.  This makes it easy to call
async blocks from `useEffect` and other places that don't take async
functions, but also makes such calls explicit.

* Adds interruptability to `spawn`

Now, the task function passed to `spawn` can take an `Interrupted`
argument, which is merely a method that returns `true` if the task
should stop doing work. Likewise, `spawn` returns an `Interrupt`
function that causes the `Interrupted` function to return `true`.

* Change to using `AbortController` and `AbortSignal`

Before, `spawn` used functions to interrupt and determine interruption
state.  Now, based on feedback from @whscullin, it uses
`AbortController` and `AbortSignal`.

Tests now show how the controller can be used to abort long-running
tasks and API calls in the `spawn`.  The also show how signals can be
chained using `addEventListener`.

* Fix `Apple2.tsx`

Forgot to change it to use `AbortController` and `AbortSignal`.

Co-authored-by: Will Scullin <scullin@scullin.com>
2022-06-12 09:06:58 -07:00
Ian Flanigan
d7cb6997d1
Add spawn as a way of calling promise-returning blocks (#131)
This change adds `spawn` which takes a no-argument, promise-returning
function, calls it, and returns `void`.  This makes it easy to call
async blocks from `useEffect` and other places that don't take async
functions, but also makes such calls explicit.
2022-06-12 09:05:01 -07:00
Will Scullin
6f804758f1
Fix preact apple keys 2022-06-10 19:53:40 -07:00
Will Scullin
9686eda3a8
Preact printer (#129) 2022-06-09 12:22:59 -07:00
Ian Flanigan
c9b7987c4c
Fix 2mg header parsing and add tests (#127)
Before, the offset for `FLAGS` in `2mg.ts` was `0x0A`, which is
incorrect according to the spec at:

https://apple2.org.za/gswv/a2zine/Docs/DiskImage_2MG_Info.txt

Now, all of the fields in the 2mg header are described, including
their lengths and any constraints.  These constraints are enforced by
`read2MGHeader` and tested by new tests.
2022-06-06 18:10:06 -07:00
Will Scullin
66f3e04d8e
Preact mass storage (#125)
The major impetus for rewriting in UI, at least. Still some ironing to do, but much nicer than my attempt to do this using the old UI "framework".
2022-06-05 10:57:04 -07:00
Will Scullin
15b7f1e123
Fix mouse mode cursor 2022-06-04 18:39:04 -07:00
Will Scullin
dd10d490f0
Fix some buttons 2022-06-04 14:31:57 -07:00
Will Scullin
72cfbe9062
Fix reset button size 2022-06-04 12:04:47 -07:00
Will Scullin
9628b437b1
Fix drive light state 2022-06-04 11:38:59 -07:00
Will Scullin
c39d5804f6
Update Typescript 2022-06-04 11:34:17 -07:00
Will Scullin
d5c55082da
Readable class names for now 2022-06-04 11:08:18 -07:00
Will Scullin
451b2f1c31
Push some pixels 2022-06-04 11:07:40 -07:00
Will Scullin
cb615ce995
Fix file name display 2022-06-04 11:06:38 -07:00
Will Scullin
303838f63d
Use CSS modules (#123)
* Use CSS modules

* Fix tests

* Feedback
2022-06-03 15:30:39 -07:00
Ian Flanigan
203d89b8d9
Implement FileSystemFileHandle for file input (#124)
This removes the `FileSystemFileHandleLike` interface in preference to
just implementing the correct interface. The advantage of the
`FileSystemFileHandle` interface is that it can be passed to the
worker directly to load the file.
2022-06-03 10:12:30 -07:00
Will Scullin
3bbc77049d
Type touchups (#122)
* Type touchups

* Fix some type handling
2022-06-01 06:28:05 -07:00
Will Scullin
a3f3cfadb3
Fix mouse with non-gl mono 2022-05-31 19:49:04 -07:00
Will Scullin
ef404735cd
Preact error dialog (#120)
Add error dialog, fix dynamic hash updates.
2022-05-31 17:41:24 -07:00
Ian Flanigan
04ae0327c2
Add the recommended eslint plugins for TypeScript (#121)
This adds both the recommended TypeScript checks, plus the recommended
TypeScript checks that require type checking.  This latter addition
means that eslint essentially has to compile all of the TypeScript in
the project, causing it to be slower. This isn't much of a problem in
VS Code because there's a lot of caching being done, but it's clearly
slower when run on the commandline.

All of the errors are either fixed or suppressed.  Some errors are
suppressed because fixing them would be too laborious for the little
value gained.

The eslint config is also slightly refactored to separate the strictly
TypeScript checks from the JavaScript checks.
2022-05-31 08:38:40 -07:00
Will Scullin
d4db26574d
Jest lint (#118)
* Jest lint

* Feedback
2022-05-30 09:29:48 -07:00
Will Scullin
e525e12c3c
React linters (#117)
* React hook linter

* React linting

* Simplify config
2022-05-29 13:48:51 -07:00
Ian Flanigan
52a1c65fe4
Create a FileChooser component using showOpenFilePicker (#116)
* Create a FileChooser component using showOpenFilePicker

Before, `FileModal` always used a file input control for selecting
local files. This allowed the emulator to read from the file, but
precluded writing back to the file.

With this change, the `FileModal` delegates to the new `FileChooser`
component. The `FileChooser` will use `showOpenFilePicker` if it is
available and a regular file input if it's not.

Using `showOpenFilePicker` has the advantage of allowing the emulator
to write back to the file (if the user grants permission). While the
emulator does not yet take advantage of this write capability, that
will come.

* Addressed comments

*   useState() instead of direct DOM manipulation
*   backed out eslint changes in favor of suppressing the warning
2022-05-28 10:52:48 -07:00
Will Scullin
273854bcf6
Fix favicon 2022-05-28 10:48:19 -07:00
Will Scullin
98d7ec718f
Fix green screen 2022-05-28 09:44:53 -07:00
Will Scullin
2bd7fa59b7
Enforce strict equality (#115) 2022-05-18 08:19:45 -07:00
Will Scullin
41015864f2
Prohibit any 2022-05-17 19:08:28 -07:00
Will Scullin
9a940935af
Refactor some controls (#114)
* Refactor some controls

* Feedback
2022-05-15 14:57:21 -07:00
Will Scullin
c648735b8a
Add touch screen handling (#113)
* Add touch screen handling

* Feedback
2022-05-13 06:55:03 -07:00
Will Scullin
26796900a3
Add slinky and clock (#112) 2022-05-12 07:59:12 -07:00
Will Scullin
7e0901cfc2
Preact mouse support (#111) 2022-05-11 17:21:21 -07:00
Will Scullin
d44cae76a7
Turn on exactOptionalPropertyTypes (#110)
Turn on exactOptionalPropertyTypes
2022-05-11 17:20:49 -07:00
Will Scullin
a46b0df970
Apply semi rule to interfaces (#109) 2022-05-10 08:04:20 -07:00
Will Scullin
4a188a9a5c
Preact UI (#106)
First pass at a Preact UI, still short some major features but full proof of concept.
2022-05-10 06:52:06 -07:00
Will Scullin
702089224f
Clear whole screen during refresh (#108) 2022-05-09 11:51:12 -07:00
dependabot[bot]
c9a075fff9
Bump async from 2.6.3 to 2.6.4 (#105)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 12:43:32 -07:00
Will Scullin
33c5c3efd8 npm audit fixes 2022-04-02 17:59:59 -07:00
dependabot[bot]
ca9aa9c6d3
Bump node-fetch from 2.6.6 to 2.6.7 (#104)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-02 17:23:42 -07:00
dependabot[bot]
7562d24ce9
Bump minimist from 1.2.5 to 1.2.6 (#103)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-02 17:23:28 -07:00
dependabot[bot]
f8a02ccc81
Bump simple-get from 3.1.0 to 3.1.1 (#102)
Bumps [simple-get](https://github.com/feross/simple-get) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](https://github.com/feross/simple-get/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-02 17:23:09 -07:00
dependabot[bot]
a283c00276
Bump follow-redirects from 1.14.5 to 1.14.8 (#99)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.5...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-02 17:20:57 -07:00
dependabot[bot]
fb82ce1f5e
Bump node-forge from 1.0.0 to 1.3.0 (#101)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.0.0 to 1.3.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.0.0...v1.3.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: direct:development
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-02 17:20:45 -07:00
dependabot[bot]
959ccd6e98
Bump node-forge from 0.10.0 to 1.0.0 (#97)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 0.10.0 to 1.0.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/0.10.0...v1.0.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: direct:development
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-13 20:10:01 -08:00
Will Scullin
a9885dbfbd
Very crude mouse support. (#95) 2021-12-29 15:00:44 -08:00
Will Scullin
2c02567309
lint fixes 2021-12-25 13:35:12 -08:00
Will Scullin
7ceacec28e
Full page improvements (#96)
* Full page improvements

* Update fullscreen api calls, save fullpage state
2021-12-25 07:24:59 -08:00