@symbo.ls/router 2.12.88 → 2.12.90

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 +7 -6
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -32,11 +32,12 @@ const defaultOptions = {
32
32
  authCheck: true,
33
33
  updateState: true,
34
34
  updateStateOptions: {
35
+ preventUpdate: ['Iframe'],
35
36
  preventUpdateTriggerStateUpdate: true
36
37
  // preventContentUpdate: true,
37
38
  // preventUpdate: ['MainHeaderCaptions', 'HeaderSubAside']
38
39
  },
39
- preventUpdate: ['Canvas'],
40
+ preventUpdate: ['Iframe'],
40
41
  setOptions: {},
41
42
  scrollToOffset: 120,
42
43
  scrollToOptions: { behavior: 'smooth' }
@@ -51,7 +52,9 @@ export const router = (
51
52
  const options = merge(passedOptions, defaultOptions)
52
53
  lastLevel = options.level
53
54
 
54
- const [pathname, hash] = path.split('#')
55
+ const urlObj = new options.window.URL(options.window.location.origin + path)
56
+ const { pathname, search, hash } = urlObj
57
+
55
58
  const rootRoute = getLocationPath(0, path)
56
59
  let routeArray = pathname.split('/')
57
60
 
@@ -72,7 +75,7 @@ export const router = (
72
75
 
73
76
  const wasModal = isModalRoute(options.window.location.pathname.split('#')[0], element)
74
77
  const isInitial = options.initialRender
75
- const hashChanged = hash && hash !== options.window.location.hash.slice(1)
78
+ const hashChanged = hash && hash !== options.window.location.hash
76
79
  const pathChanged = pathname !== lastPathname
77
80
  lastPathname = pathname
78
81
 
@@ -80,7 +83,7 @@ export const router = (
80
83
  if (options.pushState) {
81
84
  options.window.history.pushState({
82
85
  prevUrl: options.window.location.href, ...state
83
- }, null, route + (hash ? `#${hash}` : ''))
86
+ }, null, route + (search ? `${search}` : '') + (hash ? `${hash}` : ''))
84
87
  }
85
88
 
86
89
  const isModal = !!isModalRoute(pathname, element)
@@ -117,8 +120,6 @@ export const router = (
117
120
 
118
121
  if (!isModal && element.Modal?.content) {
119
122
  element.Modal.removeContent()
120
- } else if (isModal && element.content?.Tabs) {
121
- element.content.Tabs.update()
122
123
  }
123
124
  }
124
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/router",
3
- "version": "2.12.88",
3
+ "version": "2.12.90",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -11,6 +11,6 @@
11
11
  "@domql/utils": "latest",
12
12
  "@symbo.ls/auth-redirect": "latest"
13
13
  },
14
- "gitHead": "7bf6e50ec6bf6abe7b547da84cebddbafa1d363b",
14
+ "gitHead": "6de0312947251237cf3e2682fc02d5d51bcbebec",
15
15
  "source": "index.js"
16
16
  }