foxact 0.2.12 → 0.2.13
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/package.json +28 -19
- package/sizes.json +1 -1
- package/use-react-router-enable-concurrent-navigation/index.cjs +2 -0
- package/use-react-router-enable-concurrent-navigation/index.d.ts +7 -0
- package/use-react-router-enable-concurrent-navigation/index.js +2 -0
- package/use-react-router-enable-concurrent-navigation/index.mjs +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxact",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -65,6 +65,15 @@
|
|
|
65
65
|
"require": "./create-context-state/index.cjs",
|
|
66
66
|
"default": "./create-context-state/index.js"
|
|
67
67
|
},
|
|
68
|
+
"./noop": {
|
|
69
|
+
"types": "./noop/index.d.ts",
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./noop/index.d.ts",
|
|
72
|
+
"default": "./noop/index.mjs"
|
|
73
|
+
},
|
|
74
|
+
"require": "./noop/index.cjs",
|
|
75
|
+
"default": "./noop/index.js"
|
|
76
|
+
},
|
|
68
77
|
"./request-idle-callback": {
|
|
69
78
|
"types": "./request-idle-callback/index.d.ts",
|
|
70
79
|
"import": {
|
|
@@ -119,15 +128,6 @@
|
|
|
119
128
|
"require": "./use-composition-input/index.cjs",
|
|
120
129
|
"default": "./use-composition-input/index.js"
|
|
121
130
|
},
|
|
122
|
-
"./use-debounced-value": {
|
|
123
|
-
"types": "./use-debounced-value/index.d.ts",
|
|
124
|
-
"import": {
|
|
125
|
-
"types": "./use-debounced-value/index.d.ts",
|
|
126
|
-
"default": "./use-debounced-value/index.mjs"
|
|
127
|
-
},
|
|
128
|
-
"require": "./use-debounced-value/index.cjs",
|
|
129
|
-
"default": "./use-debounced-value/index.js"
|
|
130
|
-
},
|
|
131
131
|
"./use-debounced-state": {
|
|
132
132
|
"types": "./use-debounced-state/index.d.ts",
|
|
133
133
|
"import": {
|
|
@@ -137,6 +137,15 @@
|
|
|
137
137
|
"require": "./use-debounced-state/index.cjs",
|
|
138
138
|
"default": "./use-debounced-state/index.js"
|
|
139
139
|
},
|
|
140
|
+
"./use-debounced-value": {
|
|
141
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
142
|
+
"import": {
|
|
143
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
144
|
+
"default": "./use-debounced-value/index.mjs"
|
|
145
|
+
},
|
|
146
|
+
"require": "./use-debounced-value/index.cjs",
|
|
147
|
+
"default": "./use-debounced-value/index.js"
|
|
148
|
+
},
|
|
140
149
|
"./use-error-boundary": {
|
|
141
150
|
"types": "./use-error-boundary/index.d.ts",
|
|
142
151
|
"import": {
|
|
@@ -155,15 +164,6 @@
|
|
|
155
164
|
"require": "./use-intersection/index.cjs",
|
|
156
165
|
"default": "./use-intersection/index.js"
|
|
157
166
|
},
|
|
158
|
-
"./noop": {
|
|
159
|
-
"types": "./noop/index.d.ts",
|
|
160
|
-
"import": {
|
|
161
|
-
"types": "./noop/index.d.ts",
|
|
162
|
-
"default": "./noop/index.mjs"
|
|
163
|
-
},
|
|
164
|
-
"require": "./noop/index.cjs",
|
|
165
|
-
"default": "./noop/index.js"
|
|
166
|
-
},
|
|
167
167
|
"./use-isomorphic-layout-effect": {
|
|
168
168
|
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
169
169
|
"import": {
|
|
@@ -182,6 +182,15 @@
|
|
|
182
182
|
"require": "./use-map/index.cjs",
|
|
183
183
|
"default": "./use-map/index.js"
|
|
184
184
|
},
|
|
185
|
+
"./use-react-router-enable-concurrent-navigation": {
|
|
186
|
+
"types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
|
|
187
|
+
"import": {
|
|
188
|
+
"types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
|
|
189
|
+
"default": "./use-react-router-enable-concurrent-navigation/index.mjs"
|
|
190
|
+
},
|
|
191
|
+
"require": "./use-react-router-enable-concurrent-navigation/index.cjs",
|
|
192
|
+
"default": "./use-react-router-enable-concurrent-navigation/index.js"
|
|
193
|
+
},
|
|
185
194
|
"./use-react-router-is-match": {
|
|
186
195
|
"types": "./use-react-router-is-match/index.d.ts",
|
|
187
196
|
"import": {
|
package/sizes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"total":{"raw":
|
|
1
|
+
{"total":{"raw":8437,"gzip":5449,"br":0},"exports":{"context-state":{"raw":371,"gzip":240,"br":204},"create-context-state":{"raw":146,"gzip":116,"br":102},"noop":{"raw":32,"gzip":52,"br":36},"request-idle-callback":{"raw":407,"gzip":231,"br":180},"typescript-happy-forward-ref":{"raw":118,"gzip":102,"br":87},"use":{"raw":279,"gzip":175,"br":151},"use-array":{"raw":329,"gzip":242,"br":201},"use-clipboard":{"raw":1071,"gzip":614,"br":527},"use-composition-input":{"raw":420,"gzip":262,"br":230},"use-debounced-state":{"raw":380,"gzip":275,"br":231},"use-debounced-value":{"raw":370,"gzip":263,"br":214},"use-error-boundary":{"raw":172,"gzip":157,"br":148},"use-intersection":{"raw":1214,"gzip":652,"br":592},"use-isomorphic-layout-effect":{"raw":177,"gzip":143,"br":120},"use-map":{"raw":348,"gzip":243,"br":210},"use-react-router-enable-concurrent-navigation":{"raw":790,"gzip":377,"br":310},"use-react-router-is-match":{"raw":502,"gzip":337,"br":284},"use-retimer":{"raw":197,"gzip":165,"br":125},"use-set":{"raw":349,"gzip":242,"br":203},"use-uncontrolled":{"raw":304,"gzip":236,"br":201},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":461,"gzip":325,"br":256}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";require("client-only");var r=require("react"),t=require("react-router-dom");const e=()=>{let{navigator:e}=r.useContext(t.UNSAFE_NavigationContext);r.useEffect(()=>{let t=e.go.bind(e),n=e.push.bind(e),a=e.replace.bind(e);return e.go=function(){for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];return r.startTransition(()=>t.apply(e,a))},e.push=function(){for(var t=arguments.length,a=Array(t),o=0;o<t;o++)a[o]=arguments[o];return r.startTransition(()=>n.apply(e,a))},e.replace=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return r.startTransition(()=>a.apply(e,n))},()=>{e.go=t,e.push=n,e.replace=a}},[e])};exports.ReactRouterConcurrentNavigationProvider=r=>{let{children:t}=r;return e(),t},exports.useReactRouterEnableConcurrentNavigation=e;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/** @see https://foxact.skk.moe/use-react-router-enable-concurrent-navigation */
|
|
4
|
+
declare const useReactRouterEnableConcurrentNavigation: () => void;
|
|
5
|
+
declare const ReactRouterConcurrentNavigationProvider: ({ children }: React.PropsWithChildren) => react.ReactNode;
|
|
6
|
+
|
|
7
|
+
export { ReactRouterConcurrentNavigationProvider, useReactRouterEnableConcurrentNavigation };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";require("client-only");var r=require("react"),t=require("react-router-dom");const e=()=>{let{navigator:e}=r.useContext(t.UNSAFE_NavigationContext);r.useEffect(()=>{let t=e.go.bind(e),n=e.push.bind(e),a=e.replace.bind(e);return e.go=function(){for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];return r.startTransition(()=>t.apply(e,a))},e.push=function(){for(var t=arguments.length,a=Array(t),o=0;o<t;o++)a[o]=arguments[o];return r.startTransition(()=>n.apply(e,a))},e.replace=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return r.startTransition(()=>a.apply(e,n))},()=>{e.go=t,e.push=n,e.replace=a}},[e])};exports.ReactRouterConcurrentNavigationProvider=r=>{let{children:t}=r;return e(),t},exports.useReactRouterEnableConcurrentNavigation=e;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import"client-only";import{useContext as r,useEffect as e,startTransition as t}from"react";import{UNSAFE_NavigationContext as n}from"react-router-dom";let o=()=>{let{navigator:o}=r(n);e(()=>{let r=o.go.bind(o),e=o.push.bind(o),n=o.replace.bind(o);return o.go=function(){for(var e=arguments.length,n=Array(e),a=0;a<e;a++)n[a]=arguments[a];return t(()=>r.apply(o,n))},o.push=function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];return t(()=>e.apply(o,n))},o.replace=function(){for(var r=arguments.length,e=Array(r),a=0;a<r;a++)e[a]=arguments[a];return t(()=>n.apply(o,e))},()=>{o.go=r,o.push=e,o.replace=n}},[o])},a=r=>{let{children:e}=r;return o(),e};export{a as ReactRouterConcurrentNavigationProvider,o as useReactRouterEnableConcurrentNavigation};
|