flemo 1.5.3 → 1.5.4
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/index.mjs +8 -8
- package/dist/navigate/useNavigate.d.ts +2 -2
- package/package.json +8 -10
package/dist/index.mjs
CHANGED
|
@@ -1090,15 +1090,15 @@ function ot(n, e) {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
function Le() {
|
|
1092
1092
|
return {
|
|
1093
|
-
push: async (s, r, a
|
|
1093
|
+
push: async (s, r, a) => {
|
|
1094
1094
|
const { status: o, setStatus: u } = $.getState();
|
|
1095
1095
|
if (o !== "COMPLETED" && o !== "IDLE")
|
|
1096
1096
|
return;
|
|
1097
|
-
const { index: h, addHistory: l } = Q.getState(), w = wt.getState().defaultTransitionName, { transitionName: d = w, layoutId: c = null } = a, L = F.generateTaskId();
|
|
1097
|
+
const { index: h, addHistory: l } = Q.getState(), w = wt.getState().defaultTransitionName, { transitionName: d = w, layoutId: c = null } = a ?? {}, L = F.generateTaskId();
|
|
1098
1098
|
(await F.addTask(
|
|
1099
1099
|
async () => {
|
|
1100
1100
|
u("PUSHING");
|
|
1101
|
-
const { pathname: D, toPathname: I } = ot(s, r);
|
|
1101
|
+
const { pathname: D, toPathname: I } = ot(s, r ?? {});
|
|
1102
1102
|
return window.history.pushState(
|
|
1103
1103
|
{
|
|
1104
1104
|
id: L,
|
|
@@ -1113,7 +1113,7 @@ function Le() {
|
|
|
1113
1113
|
), l({
|
|
1114
1114
|
id: L,
|
|
1115
1115
|
pathname: I,
|
|
1116
|
-
params: r,
|
|
1116
|
+
params: r ?? {},
|
|
1117
1117
|
transitionName: d,
|
|
1118
1118
|
layoutId: c
|
|
1119
1119
|
}), () => {
|
|
@@ -1128,15 +1128,15 @@ function Le() {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
)).result?.();
|
|
1130
1130
|
},
|
|
1131
|
-
replace: async (s, r, a
|
|
1131
|
+
replace: async (s, r, a) => {
|
|
1132
1132
|
const { status: o, setStatus: u } = $.getState();
|
|
1133
1133
|
if (o !== "COMPLETED" && o !== "IDLE")
|
|
1134
1134
|
return;
|
|
1135
|
-
const { index: h, addHistory: l } = Q.getState(), w = Q.getState().replaceHistory, d = wt.getState().defaultTransitionName, { transitionName: c = d, layoutId: L = null } = a, D = F.generateTaskId();
|
|
1135
|
+
const { index: h, addHistory: l } = Q.getState(), w = Q.getState().replaceHistory, d = wt.getState().defaultTransitionName, { transitionName: c = d, layoutId: L = null } = a ?? {}, D = F.generateTaskId();
|
|
1136
1136
|
(await F.addTask(
|
|
1137
1137
|
async () => {
|
|
1138
1138
|
u("REPLACING");
|
|
1139
|
-
const { pathname: I, toPathname: v } = ot(s, r);
|
|
1139
|
+
const { pathname: I, toPathname: v } = ot(s, r ?? {});
|
|
1140
1140
|
return window.history.replaceState(
|
|
1141
1141
|
{
|
|
1142
1142
|
id: D,
|
|
@@ -1151,7 +1151,7 @@ function Le() {
|
|
|
1151
1151
|
), l({
|
|
1152
1152
|
id: D,
|
|
1153
1153
|
pathname: v,
|
|
1154
|
-
params: r,
|
|
1154
|
+
params: r ?? {},
|
|
1155
1155
|
transitionName: c,
|
|
1156
1156
|
layoutId: L
|
|
1157
1157
|
}), async () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RegisterRoute } from '../Route';
|
|
2
2
|
import { TransitionName } from '../transition/typing';
|
|
3
3
|
export default function useNavigate(): {
|
|
4
|
-
push: <T extends keyof RegisterRoute>(path: T, params
|
|
4
|
+
push: <T extends keyof RegisterRoute>(path: T, params?: RegisterRoute[T] | undefined, options?: {
|
|
5
5
|
layoutId?: string | number;
|
|
6
6
|
transitionName?: TransitionName;
|
|
7
7
|
}) => Promise<void>;
|
|
8
|
-
replace: <T extends keyof RegisterRoute>(path: T, params
|
|
8
|
+
replace: <T extends keyof RegisterRoute>(path: T, params?: RegisterRoute[T] | undefined, options?: {
|
|
9
9
|
layoutId?: string | number;
|
|
10
10
|
transitionName?: TransitionName;
|
|
11
11
|
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flemo",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "A modern React router library with built-in motion animations and smooth transitions",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -33,14 +33,6 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://flemo-dev.lovable.app",
|
|
35
35
|
"license": "MIT",
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "vite build",
|
|
38
|
-
"watch": "vite build --watch",
|
|
39
|
-
"prettier": "prettier --write --config ./.prettierrc \"**/*.{js,mjs,ts,jsx,tsx,mts,json}\"",
|
|
40
|
-
"convention": "pnpm prettier && eslint --fix \"**/*.{js,mjs,ts,jsx,tsx,mts,html}\"",
|
|
41
|
-
"prepare": "husky",
|
|
42
|
-
"prepublishOnly": "pnpm build"
|
|
43
|
-
},
|
|
44
36
|
"dependencies": {
|
|
45
37
|
"path-to-regexp": "^8.2.0",
|
|
46
38
|
"zustand": "^5.0.11"
|
|
@@ -75,5 +67,11 @@
|
|
|
75
67
|
"lint-staged": {
|
|
76
68
|
"*.{js,mjs,ts,jsx,tsx,mts,json}": "prettier --write",
|
|
77
69
|
"*.{js,mjs,ts,jsx,tsx,mts,html}": "eslint --fix"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "vite build",
|
|
73
|
+
"watch": "vite build --watch",
|
|
74
|
+
"prettier": "prettier --write --config ./.prettierrc \"**/*.{js,mjs,ts,jsx,tsx,mts,json}\"",
|
|
75
|
+
"convention": "pnpm prettier && eslint --fix \"**/*.{js,mjs,ts,jsx,tsx,mts,html}\""
|
|
78
76
|
}
|
|
79
|
-
}
|
|
77
|
+
}
|