@symbo.ls/link 2.10.163 → 2.10.188

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.
Files changed (2) hide show
  1. package/index.js +9 -8
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { router } from '@domql/router'
3
+ import { router as defaultRouter } from '@domql/router'
4
4
  import { Focusable } from '@symbo.ls/atoms'
5
5
 
6
6
  export const Link = {
@@ -14,9 +14,9 @@ export const Link = {
14
14
  draggable: true
15
15
  },
16
16
  attr: {
17
- href: element => {
18
- const { exec } = element.context.utils
19
- return exec(element.props.href, element) || exec(element.props, element).href
17
+ href: (el, s, ctx) => {
18
+ const { exec } = ctx.utils
19
+ return exec(el.props.href, el) || exec(el.props, el).href
20
20
  },
21
21
  target: ({ props }) => props.target,
22
22
  'aria-label': ({ props }) => props.aria ? props.aria.label : props.text,
@@ -26,12 +26,13 @@ export const Link = {
26
26
 
27
27
  export const RouterLink = {
28
28
  on: {
29
- click: (event, element, state) => {
30
- const root = element.__ref.__root
31
- const { href } = element.props
29
+ click: (event, el, s, ctx) => {
30
+ const { router } = ctx.utils
31
+ const root = el.__ref.__root
32
+ const { href } = el.props
32
33
  const firstThree = href[0] + href[1] + href[2]
33
34
  if (href && firstThree !== 'htt' && firstThree !== 'ske') {
34
- router(root, href, {})
35
+ (router || defaultRouter)(root, href, {})
35
36
  event.preventDefault()
36
37
  }
37
38
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/link",
3
- "version": "2.10.163",
3
+ "version": "2.10.188",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "9b654d48bb8ba26e3b1b7095b5ed7b813b61e1e0",
6
+ "gitHead": "101a03940d79cdd43dfcfb78c2086f4d13a0142d",
7
7
  "dependencies": {
8
8
  "@domql/router": "latest",
9
9
  "@symbo.ls/atoms": "latest"