lkd-web-kit 0.7.16 → 0.7.17

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.
@@ -3,14 +3,13 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const navigation = require('next/navigation');
6
- const router = require('next/router');
7
6
  const React = require('react');
8
7
  const index = require('./index.cjs');
9
8
 
10
9
  const QP_BACK_URL_NAME = "backUrl";
11
10
  function useNavigationHistory() {
12
11
  const context = React.useContext(index.NavigationHistoryContext);
13
- const router$1 = router.useRouter();
12
+ const router = navigation.useRouter();
14
13
  if (!context) {
15
14
  throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
16
15
  }
@@ -19,20 +18,20 @@ function useNavigationHistory() {
19
18
  const goBack = (fallback) => {
20
19
  const returnUrl = searchParams.get(QP_BACK_URL_NAME);
21
20
  if (returnUrl) {
22
- router$1.push(returnUrl);
21
+ router.push(returnUrl);
23
22
  return;
24
23
  }
25
24
  if (history.length <= 1) {
26
- router$1.push(fallback ?? "/");
25
+ router.push(fallback ?? "/");
27
26
  return;
28
27
  }
29
28
  const previousRoute = history[history.length - 2];
30
29
  const currentRoute = history[history.length - 1];
31
30
  if (history.length >= 3 && history[history.length - 3] === currentRoute) {
32
- router$1.push(fallback ?? "/");
31
+ router.push(fallback ?? "/");
33
32
  return;
34
33
  }
35
- router$1.push(previousRoute ?? "/");
34
+ router.push(previousRoute ?? "/");
36
35
  };
37
36
  return {
38
37
  history,
@@ -1,5 +1,4 @@
1
- import { useSearchParams } from 'next/navigation';
2
- import { useRouter } from 'next/router';
1
+ import { useRouter, useSearchParams } from 'next/navigation';
3
2
  import { useContext } from 'react';
4
3
  import { NavigationHistoryContext } from './index.js';
5
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.7.16",
3
+ "version": "0.7.17",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",