@symbo.ls/link 2.11.315 → 2.11.358

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 -5
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,11 +1,9 @@
1
1
  'use strict'
2
2
 
3
3
  import { router as defaultRouter } from '@domql/router'
4
- import { exec, isDefined } from '@domql/utils'
5
- import { Focusable } from '@symbo.ls/atoms'
6
4
 
7
5
  export const Link = {
8
- extend: Focusable,
6
+ extend: 'Focusable',
9
7
  tag: 'a',
10
8
  props: {
11
9
  aria: {},
@@ -31,11 +29,17 @@ export const RouterLink = {
31
29
  click: (event, el, s) => {
32
30
  const { props, context: ctx } = el
33
31
  const { href: h, scrollToTop, stopPropagation } = props
34
- const href = exec(h, el, s)
32
+ const { exec, isString, replaceLiteralsWithObjectFields, isDefined } = ctx.utils
33
+ let href = exec(h, el, s)
34
+
35
+ if (isString(href) && href.includes('{{')) {
36
+ href = replaceLiteralsWithObjectFields(href, s)
37
+ }
38
+
35
39
  if (stopPropagation) event.stopPropagation()
36
40
  if (!href) return
37
41
  const { utils, snippets, routerOptions } = ctx
38
- const root = el.__ref.__root
42
+ const root = el.__ref.root
39
43
  const linkIsExternal = href.includes('http://') ||
40
44
  href.includes('https://') ||
41
45
  href.includes('mailto:') ||
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/link",
3
- "version": "2.11.315",
3
+ "version": "2.11.358",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "f7e5836ff0fad163a721cd8a823e2da1a7f346ef",
6
+ "gitHead": "87d35aa05d75b0023b44ec251df1f5739b8c6aa4",
7
7
  "dependencies": {
8
8
  "@domql/router": "latest",
9
9
  "@symbo.ls/atoms": "latest"