@domql/router 2.3.69 → 2.3.71

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/dist/cjs/index.js CHANGED
@@ -33,7 +33,8 @@ const defaultOptions = {
33
33
  scrollToTop: true,
34
34
  scrollToNode: false,
35
35
  useFragment: false,
36
- updateState: true
36
+ updateState: true,
37
+ stateContentUpdate: false
37
38
  };
38
39
  const router = (element, path, state = {}, options = defaultOptions) => {
39
40
  (0, import_utils.merge)(options, defaultOptions);
@@ -46,7 +47,7 @@ const router = (element, path, state = {}, options = defaultOptions) => {
46
47
  import_globals.window.history.pushState(state, null, pathname + (hash ? `#${hash}` : ""));
47
48
  element.set({ tag: options.useFragment && "fragment", extend: content });
48
49
  if (options.updateState)
49
- element.state.update({ route, hash });
50
+ element.state.update({ route, hash }, { preventContentUpdate: !options.stateContentUpdate });
50
51
  const rootNode = element.node;
51
52
  if (options.scrollToTop)
52
53
  rootNode.scrollTo({ behavior: "smooth", top: 0, left: 0 });
package/index.js CHANGED
@@ -15,7 +15,8 @@ const defaultOptions = {
15
15
  scrollToTop: true,
16
16
  scrollToNode: false,
17
17
  useFragment: false,
18
- updateState: true
18
+ updateState: true,
19
+ stateContentUpdate: false
19
20
  }
20
21
 
21
22
  export const router = (
@@ -36,7 +37,7 @@ export const router = (
36
37
  if (options.pushState) window.history.pushState(state, null, pathname + (hash ? `#${hash}` : ''))
37
38
 
38
39
  element.set({ tag: options.useFragment && 'fragment', extend: content })
39
- if (options.updateState) element.state.update({ route, hash })
40
+ if (options.updateState) element.state.update({ route, hash }, { preventContentUpdate: !options.stateContentUpdate })
40
41
 
41
42
  const rootNode = element.node
42
43
  if (options.scrollToTop) rootNode.scrollTo({ behavior: 'smooth', top: 0, left: 0 })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/router",
3
- "version": "2.3.69",
3
+ "version": "2.3.71",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
@@ -22,7 +22,8 @@
22
22
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
23
23
  },
24
24
  "dependencies": {
25
+ "@domql/globals": "latest",
25
26
  "@domql/utils": "latest"
26
27
  },
27
- "gitHead": "7b43df6cfdae920a1602749f2cf29a9b44a40000"
28
+ "gitHead": "dca5db039e858002d2d7b2d6e827d0cef26faa98"
28
29
  }