forked from fonsp/Pluto.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'original/main' into wat
- Loading branch information
Showing
73 changed files
with
3,696 additions
and
3,396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ on: | |
branches-ignore: | ||
- release | ||
|
||
env: | ||
JULIA_PLUTO_IGNORE_CDN_BUNDLE_WARNING: true | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name = "Pluto" | |
uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781" | ||
license = "MIT" | ||
authors = ["Fons van der Plas <[email protected]>"] | ||
version = "0.19.45" | ||
version = "0.19.46" | ||
|
||
[deps] | ||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" | ||
|
@@ -42,7 +42,7 @@ Dates = "0, 1" | |
Downloads = "1" | ||
ExpressionExplorer = "0.5, 0.6, 1" | ||
FileWatching = "1" | ||
FuzzyCompletions = "=0.5.4" | ||
FuzzyCompletions = "=0.5.5" | ||
HTTP = "^1.5.2" | ||
HypertextLiteral = "0.7, 0.8, 0.9" | ||
InteractiveUtils = "1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
import { useCallback, useEffect } from "../imports/Preact.js" | ||
|
||
/** | ||
* @typedef EventListenerAddable | ||
* @type Document | HTMLElement | Window | EventSource | MediaQueryList | null | ||
*/ | ||
|
||
export const useEventListener = ( | ||
/** @type {Document | HTMLElement | Window | EventSource | MediaQueryList | null} */ element, | ||
/** @type {EventListenerAddable | import("../imports/Preact.js").Ref<EventListenerAddable>} */ element, | ||
/** @type {string} */ event_name, | ||
/** @type {EventListenerOrEventListenerObject} */ handler, | ||
/** @type {any[] | undefined} */ deps | ||
) => { | ||
let handler_cached = useCallback(handler, deps) | ||
useEffect(() => { | ||
if (element == null) return | ||
element.addEventListener(event_name, handler_cached) | ||
return () => element.removeEventListener(event_name, handler_cached) | ||
const e = element | ||
const useme = | ||
e == null || e instanceof Document || e instanceof HTMLElement || e instanceof Window || e instanceof EventSource || e instanceof MediaQueryList | ||
? /** @type {EventListenerAddable} */ (e) | ||
: e.current | ||
|
||
if (useme == null) return | ||
useme.addEventListener(event_name, handler_cached) | ||
return () => useme.removeEventListener(event_name, handler_cached) | ||
}, [element, event_name, handler_cached]) | ||
} |
Oops, something went wrong.