File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
3
"strict" : true ,
4
+ "checkJs" : true ,
4
5
"target" : " ESNext" ,
5
6
"module" : " ESNext" ,
6
7
"moduleResolution" : " NodeNext" ,
7
8
"allowSyntheticDefaultImports" : true ,
8
9
"esModuleInterop" : true ,
9
10
"jsx" : " preserve" ,
10
11
"jsxImportSource" : " pota" ,
11
- "types" : [" vite/client" , " pota" ],
12
+ "types" : [" vite/client" , " pota" , " ./types.ts " ],
12
13
"noEmit" : true ,
13
14
"isolatedModules" : true
14
15
}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Router } from 'pota/web'
3
3
4
4
import logo from './assets/logo.svg'
5
5
import styles from './index.module.css'
6
+ import 'pota/plugin/clickOutside'
6
7
7
8
function App ( ) {
8
9
return (
@@ -11,7 +12,13 @@ function App() {
11
12
< img src = { logo } alt = "logo" />
12
13
</ header >
13
14
< p >
14
- < a alt = "pota comes from potable" href = "https://pota.quack.uy" >
15
+ < a
16
+ clickOutside = { ( event , node ) =>
17
+ console . log ( 'clickOutside demo' , event , node )
18
+ }
19
+ title = "pota comes from potable"
20
+ href = "https://pota.quack.uy"
21
+ >
15
22
https://pota.quack.uy
16
23
</ a >
17
24
</ p >
Original file line number Diff line number Diff line change
1
+ import type { JSX } from 'pota/jsx-runtime'
2
+
3
+ declare module 'pota/jsx-runtime' {
4
+ namespace JSX {
5
+ /** Adds an attribute to all HTML elements */
6
+ interface IntrinsicHTMLAttributes {
7
+ clickOutside ?: ( event : Event , node : HTMLElement ) => void
8
+ }
9
+
10
+ /** Adds an attribute to all SVG elements */
11
+ interface IntrinsicSVGAttributes {
12
+ clickOutside ?: ( event : Event , node : HTMLElement ) => void
13
+ }
14
+
15
+ /** Adds an attribute to all MathML elements */
16
+ interface IntrinsicMathMLAttributes {
17
+ clickOutside ?: ( event : Event , node : HTMLElement ) => void
18
+ }
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments