@typed/router 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typed/router",
3
- "version": "0.9.5",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -21,14 +21,14 @@
21
21
  "dependencies": {
22
22
  "@effect/data": "^0.12.2",
23
23
  "@effect/io": "^0.20.0",
24
- "@typed/context": "0.9.2",
25
- "@typed/dom": "8.9.2",
26
- "@typed/fx": "1.9.2",
27
- "@typed/html": "3.9.4",
24
+ "@typed/context": "0.10.0",
25
+ "@typed/dom": "8.10.0",
26
+ "@typed/fx": "1.10.0",
27
+ "@typed/html": "3.10.0",
28
28
  "@typed/path": "0.3.0",
29
29
  "@typed/route": "0.7.1"
30
30
  },
31
- "gitHead": "1a69343e281acde118dcf91b8a4e2e91acbf134e",
31
+ "gitHead": "5b56dceb425beede0ecc881dc33b81fab1878822",
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
package/src/Link.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import * as Effect from '@effect/io/Effect'
2
+ import * as Scope from '@effect/io/Scope'
2
3
  import { assign } from '@typed/dom'
3
4
  import * as Fx from '@typed/fx'
4
- import { EventHandler, html, Hole, type Placeholder } from '@typed/html'
5
+ import { EventHandler, html, RenderContext, type Placeholder } from '@typed/html'
5
6
  import { pathJoin } from '@typed/path'
6
7
 
7
8
  import { Router, getBasePath } from './router.js'
8
9
 
9
10
  export function Link<R = never, E = never, R2 = never>(
10
11
  props: LinkProps<R, E, R2>,
11
- ): Fx.Fx<R | R2 | Location | Router, E, Hole> {
12
+ ): Fx.Fx<R | R2 | Document | RenderContext | Router | Scope.Scope, E, HTMLAnchorElement> {
12
13
  return Fx.gen(function* ($) {
13
14
  const useBase = props.useBase ?? true
14
15
  const href = useBase ? pathJoin(yield* $(getBasePath), props.href) || '/' : props.href
@@ -26,12 +27,11 @@ export function Link<R = never, E = never, R2 = never>(
26
27
  }
27
28
  })
28
29
 
29
- return html`<a
30
+ return html.as<HTMLAnchorElement>()`<a
30
31
  class=${props.className}
31
32
  href=${href}
32
33
  onclick=${EventHandler.preventDefault(clickHandler)}
33
- >${props.label}</a
34
- >`
34
+ >${props.label}</a>`
35
35
  })
36
36
  }
37
37