@farm.js/core 0.1.36 → 0.1.37
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/{agent-mcp-BVExL8rZ.d.mts → agent-mcp-BC0bAGVF.d.mts} +1 -1
- package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-jyDHbQKe.d.ts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +6 -6
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +8 -7
- package/dist/{app-Yfa2dsFy.d.ts → app-CKO3iN1c.d.ts} +3 -3
- package/dist/{app-BukwkFIu.d.mts → app-Cbkj9ufe.d.mts} +3 -3
- package/dist/app-markdown.cjs +5 -3
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +4 -2
- package/dist/{chunk-UVW64BCB.cjs → chunk-3A4KGQYI.cjs} +2 -2
- package/dist/{chunk-AO6RYU5N.cjs → chunk-3IP27TCG.cjs} +30 -22
- package/dist/{chunk-FDR64H6B.mjs → chunk-3KGDJLJK.mjs} +41 -2
- package/dist/{chunk-KXWRO25S.cjs → chunk-4GPOC4LN.cjs} +3 -3
- package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
- package/dist/{chunk-276VJSM6.mjs → chunk-4P6ULFMD.mjs} +43 -30
- package/dist/{chunk-BPMATOP2.cjs → chunk-5BXGGEC7.cjs} +25 -20
- package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
- package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
- package/dist/{chunk-BO36SELV.cjs → chunk-6LGFV2CQ.cjs} +2 -2
- package/dist/{chunk-2YTDKNH3.cjs → chunk-6TJITR2B.cjs} +192 -120
- package/dist/{chunk-JZVADIOD.cjs → chunk-75X755YZ.cjs} +2 -2
- package/dist/{chunk-VQLJWDVW.cjs → chunk-7DWNJI73.cjs} +2 -2
- package/dist/{chunk-N2NAS2AM.cjs → chunk-7O5M4UKW.cjs} +2 -2
- package/dist/{chunk-BJPBQNIE.cjs → chunk-7SQ5SGYZ.cjs} +2 -2
- package/dist/{chunk-27ZWSI3W.cjs → chunk-ADOAUDQ6.cjs} +2 -2
- package/dist/{chunk-YKX5BK66.cjs → chunk-ATWHHSY2.cjs} +7 -7
- package/dist/{chunk-42NHY7HW.cjs → chunk-B5PFZLKV.cjs} +40 -9
- package/dist/{chunk-FNO7A7CM.cjs → chunk-BHY547NB.cjs} +34 -16
- package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
- package/dist/{chunk-D2BB47NB.cjs → chunk-CVH2BXPY.cjs} +6 -6
- package/dist/{chunk-TKSCR644.cjs → chunk-D3C5LBQY.cjs} +2 -2
- package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
- package/dist/{chunk-GQ3Z3IZI.cjs → chunk-EMMQ64QW.cjs} +18 -18
- package/dist/{chunk-OHLSEQ57.mjs → chunk-EXG5LD6B.mjs} +1 -1
- package/dist/{chunk-WZ77PUAM.mjs → chunk-FBOJ55OM.mjs} +1 -1
- package/dist/{chunk-OTC5BDGO.mjs → chunk-FGRYBX5X.mjs} +12 -7
- package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
- package/dist/{chunk-3BU22U3M.cjs → chunk-G2TEB74S.cjs} +5 -2
- package/dist/{chunk-O6I6VWKK.mjs → chunk-HEVMCTSR.mjs} +1 -1
- package/dist/{chunk-W7LF2J2S.mjs → chunk-HMRSWN47.mjs} +1 -1
- package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
- package/dist/{chunk-35GKZR22.mjs → chunk-IAIYV4RZ.mjs} +1 -1
- package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
- package/dist/{chunk-2NNMOPDN.mjs → chunk-J3ANCZKA.mjs} +4 -1
- package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
- package/dist/{chunk-SC2WYWPF.mjs → chunk-JPNFPAZ4.mjs} +3 -3
- package/dist/{chunk-HOXTWRGB.mjs → chunk-K3SAEIM3.mjs} +5 -2
- package/dist/{chunk-35WV46VL.mjs → chunk-K4I4O5TS.mjs} +98 -26
- package/dist/{chunk-KN7K4VQN.mjs → chunk-KDTBF3UU.mjs} +1 -1
- package/dist/{chunk-QORUJDIV.mjs → chunk-KPFKMDM7.mjs} +2 -2
- package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
- package/dist/{chunk-YDQZGSDS.mjs → chunk-LBDP3YT3.mjs} +1 -1
- package/dist/{chunk-LSZAVSGY.mjs → chunk-LBGILORX.mjs} +1 -1
- package/dist/{chunk-ADEA7PN3.cjs → chunk-LOFKRKO7.cjs} +2 -2
- package/dist/{chunk-ZWM5KGAA.cjs → chunk-LPFV45AY.cjs} +23 -20
- package/dist/{chunk-3KZS4SUS.mjs → chunk-MCIZVNOQ.mjs} +1 -1
- package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
- package/dist/{chunk-S6VYG6XU.cjs → chunk-NDILNQ4L.cjs} +2 -2
- package/dist/{chunk-BPOF5U4N.mjs → chunk-NFMDCAOS.mjs} +10 -7
- package/dist/{chunk-UXFQ3UDA.cjs → chunk-NICDYKBS.cjs} +42 -3
- package/dist/{chunk-EZDQRNQ7.mjs → chunk-NNSAQX3U.mjs} +23 -5
- package/dist/{chunk-DZ5ZVB2K.cjs → chunk-NQ6QFZWD.cjs} +1 -1
- package/dist/{chunk-U4KT7QP3.cjs → chunk-OW67PDDS.cjs} +14 -1
- package/dist/{chunk-77GNHH2Z.cjs → chunk-PMQHMWZU.cjs} +3 -3
- package/dist/{chunk-NMHWYWDR.cjs → chunk-Q5FYSK45.cjs} +169 -156
- package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
- package/dist/{chunk-EWET4D2Y.mjs → chunk-RRMVL6CJ.mjs} +3 -3
- package/dist/{chunk-IZY3V5XW.mjs → chunk-S3VWVTVA.mjs} +14 -1
- package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
- package/dist/chunk-SGBZPZUW.mjs +75 -0
- package/dist/{chunk-2ELDTQRN.mjs → chunk-TDNWPAVR.mjs} +1 -1
- package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
- package/dist/{chunk-4WCZJQUO.mjs → chunk-TPLJVC7E.mjs} +37 -6
- package/dist/{chunk-NRSN7G7E.mjs → chunk-TW4GYDBJ.mjs} +1 -1
- package/dist/{chunk-FO427P6I.cjs → chunk-U6MPZ35Q.cjs} +10 -10
- package/dist/{chunk-CBJJH36A.cjs → chunk-UJZLSXUB.cjs} +3 -3
- package/dist/chunk-UXHS27O6.cjs +75 -0
- package/dist/{chunk-DQQOKWYA.cjs → chunk-VR4GD5I3.cjs} +3 -3
- package/dist/{chunk-T4OGRVNS.mjs → chunk-VXAWRDK7.mjs} +2 -2
- package/dist/{chunk-4NU4GGTC.cjs → chunk-W2YDNK66.cjs} +6 -3
- package/dist/{chunk-GQRWBCWK.mjs → chunk-WQ7T2263.mjs} +13 -5
- package/dist/chunk-WRPHYQVY.mjs +109 -0
- package/dist/chunk-WT4TGLXT.cjs +109 -0
- package/dist/{chunk-4E5AEDKY.mjs → chunk-XOPOIFTJ.mjs} +1 -1
- package/dist/{chunk-OO7GXVSR.mjs → chunk-YCKO6FRS.mjs} +1 -1
- package/dist/{chunk-MKYBIIAQ.mjs → chunk-Z5BEWYVO.mjs} +1 -1
- package/dist/{chunk-VILIPRS6.mjs → chunk-Z7LA7MHQ.mjs} +1 -1
- package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-C8DjftDF.d.ts} +14 -0
- package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-CV4eJ9De.d.mts} +14 -0
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-JZJJY5CK.cjs → devtools-JXFQNWSH.cjs} +4 -4
- package/dist/{devtools-ERIKFEXX.mjs → devtools-KVOY2TCZ.mjs} +3 -3
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +4 -4
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +11 -11
- package/dist/i18n/client.mjs +3 -3
- package/dist/index.cjs +42 -39
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +41 -38
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +4 -2
- package/dist/internal/app-markdown-runtime.d.mts +19 -5
- package/dist/internal/app-markdown-runtime.d.ts +19 -5
- package/dist/internal/app-markdown-runtime.mjs +3 -1
- package/dist/internal/build-runtime.cjs +25 -23
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +24 -22
- package/dist/internal/cli-runtime.cjs +8 -8
- package/dist/internal/cli-runtime.mjs +7 -7
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +15 -50
- package/dist/internal/production-runtime.d.mts +8 -8
- package/dist/internal/production-runtime.d.ts +8 -8
- package/dist/internal/production-runtime.mjs +11 -46
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +8 -8
- package/dist/middleware.d.mts +6 -4
- package/dist/middleware.d.ts +6 -4
- package/dist/middleware.mjs +7 -7
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +6 -6
- package/dist/plugin.cjs +19 -18
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +18 -17
- package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-C2kkrPVZ.d.ts} +1 -1
- package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-Du_FHb2-.d.mts} +1 -1
- package/dist/query/client.cjs +9 -9
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-BnnPTpus.d.ts} +1 -1
- package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-Cgx7v8tJ.d.mts} +1 -1
- package/dist/renderer-client.cjs +12 -12
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +4 -4
- package/dist/{request-Bkg-hERy.d.ts → request-BNWr7r5e.d.ts} +1 -1
- package/dist/{request-CsGARcAw.d.mts → request-sKayKcop.d.mts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bx4Auw6Q.d.ts} +1 -1
- package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-DWFp3Yq4.d.mts} +1 -1
- package/dist/{router-Cp6yRE8A.d.mts → router-BK6K42Ij.d.mts} +1 -1
- package/dist/{router-B8CR9GbD.d.ts → router-DnW_2tQi.d.ts} +1 -1
- package/dist/routes.cjs +2 -2
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/{runtime-CQVsT330.d.ts → runtime-CA3Ei5k_.d.ts} +1 -1
- package/dist/{runtime-CAEv36S_.d.mts → runtime-DJDaCMd_.d.mts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +45 -44
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +23 -22
- package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-D6fUA4Rn.d.mts} +2 -2
- package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-Mwbd7g2L.d.ts} +2 -2
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +6 -6
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-CaoWKtYM.d.ts → utils-BwVcAfUR.d.ts} +1 -1
- package/dist/{utils-B9V0S_yL.d.mts → utils-p9Hs-jCc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +19 -18
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +18 -17
- package/package.json +1 -1
- package/types/middleware.d.ts +5 -1
- package/dist/chunk-FXEF4PPL.mjs +0 -47
- package/dist/chunk-XD32KALF.cjs +0 -47
- /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
- /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
|
@@ -7,13 +7,13 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkFWE7LEQCcjs = require('./chunk-FWE7LEQC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkOW67PDDScjs = require('./chunk-OW67PDDS.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -52,7 +52,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, shouldBlockUnload, "shouldBlockUnload");
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunkFWE7LEQCcjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -65,7 +65,7 @@ function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
|
65
65
|
} else {
|
|
66
66
|
window.history.pushState(null, "", url);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkFWE7LEQCcjs.notifyHistoryChange.call(void 0, "url-search");
|
|
69
69
|
}
|
|
70
70
|
_chunkS3JO3N4Hcjs.__name.call(void 0, navigateViaRouter, "navigateViaRouter");
|
|
71
71
|
function useRouter(options = {}) {
|
|
@@ -85,7 +85,7 @@ function useRouter(options = {}) {
|
|
|
85
85
|
setState(readRouterState(basePath, routeMatcher));
|
|
86
86
|
}, "handlePopState");
|
|
87
87
|
handlePopState();
|
|
88
|
-
const unsubscribe =
|
|
88
|
+
const unsubscribe = _chunkFWE7LEQCcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
89
89
|
return unsubscribe;
|
|
90
90
|
}, [basePath, routeMatcher]);
|
|
91
91
|
const push = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href, navigateOptions) => {
|
|
@@ -96,11 +96,11 @@ function useRouter(options = {}) {
|
|
|
96
96
|
}, "replace");
|
|
97
97
|
const pushState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
98
98
|
if (typeof window === "undefined") return;
|
|
99
|
-
|
|
99
|
+
_chunkFWE7LEQCcjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
100
100
|
}, "pushState");
|
|
101
101
|
const replaceState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
102
102
|
if (typeof window === "undefined") return;
|
|
103
|
-
|
|
103
|
+
_chunkFWE7LEQCcjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
104
104
|
}, "replaceState");
|
|
105
105
|
const back = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
106
106
|
if (typeof window !== "undefined") {
|
|
@@ -124,25 +124,25 @@ function useRouter(options = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter, "useRouter");
|
|
126
126
|
function usePageState() {
|
|
127
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
127
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunkFWE7LEQCcjs.readPageState.call(void 0, ));
|
|
128
128
|
_react.useEffect.call(void 0, () => {
|
|
129
129
|
if (typeof window === "undefined") return;
|
|
130
130
|
const handlePopState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
131
|
-
setState(
|
|
131
|
+
setState(_chunkFWE7LEQCcjs.readPageState.call(void 0, ));
|
|
132
132
|
}, "handlePopState");
|
|
133
133
|
handlePopState();
|
|
134
|
-
return
|
|
134
|
+
return _chunkFWE7LEQCcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
135
135
|
}, []);
|
|
136
136
|
return state;
|
|
137
137
|
}
|
|
138
138
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePageState, "usePageState");
|
|
139
139
|
function useNavigation() {
|
|
140
140
|
const [state, setState] = _react.useState.call(void 0,
|
|
141
|
-
() =>
|
|
141
|
+
() => _chunkFWE7LEQCcjs.getRouter.call(void 0, ).getNavigationState()
|
|
142
142
|
);
|
|
143
143
|
_react.useEffect.call(void 0, () => {
|
|
144
144
|
if (typeof window === "undefined") return;
|
|
145
|
-
return
|
|
145
|
+
return _chunkFWE7LEQCcjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
146
146
|
}, []);
|
|
147
147
|
return state;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ function useBlocker(options) {
|
|
|
155
155
|
if (typeof window === "undefined" || !active) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return _chunkFWE7LEQCcjs.getRouter.call(void 0, ).addBlocker(
|
|
159
159
|
async (context) => {
|
|
160
160
|
const current = optionsRef.current;
|
|
161
161
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -179,7 +179,7 @@ function useScrollRestoration(key) {
|
|
|
179
179
|
_react.useEffect.call(void 0, () => {
|
|
180
180
|
const element = ref.current;
|
|
181
181
|
if (!element) return;
|
|
182
|
-
return
|
|
182
|
+
return _chunkFWE7LEQCcjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
183
183
|
}, [key]);
|
|
184
184
|
return ref;
|
|
185
185
|
}
|
|
@@ -195,13 +195,13 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
const pathname = normalizeClientPathname(url.pathname, basePath);
|
|
198
|
-
const i18n =
|
|
198
|
+
const i18n = _chunkS6FJO323cjs.getFarmI18nClientState.call(void 0, );
|
|
199
199
|
const routePathname = i18n ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, pathname, { ...i18n, basePath: "/" }) : pathname;
|
|
200
200
|
return {
|
|
201
201
|
pathname,
|
|
202
202
|
searchParams: url.searchParams,
|
|
203
203
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
204
|
-
pageState: typeof window === "undefined" ? null :
|
|
204
|
+
pageState: typeof window === "undefined" ? null : _chunkFWE7LEQCcjs.readPageState.call(void 0, )
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouterState, "readRouterState");
|
|
@@ -213,7 +213,7 @@ function readCurrentUrl() {
|
|
|
213
213
|
return void 0;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
const request =
|
|
216
|
+
const request = _chunkOW67PDDScjs._resolveCurrentRequest.call(void 0, );
|
|
217
217
|
if (!request) return void 0;
|
|
218
218
|
try {
|
|
219
219
|
return new URL(request.url);
|
|
@@ -3,14 +3,15 @@ import {
|
|
|
3
3
|
parseMiddlewareCookieHeader,
|
|
4
4
|
serializeMiddlewareCookie,
|
|
5
5
|
serializeMiddlewareCookieDeletion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J3ANCZKA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
compileMiddlewareConfig,
|
|
9
9
|
compileMiddlewareRoute,
|
|
10
10
|
matchesMiddlewareConfig,
|
|
11
11
|
matchesMiddlewareConfigAt,
|
|
12
|
-
matchesMiddlewareRouteAt
|
|
13
|
-
|
|
12
|
+
matchesMiddlewareRouteAt,
|
|
13
|
+
toMiddlewareRoutePathname
|
|
14
|
+
} from "./chunk-HZFM2LWQ.mjs";
|
|
14
15
|
import {
|
|
15
16
|
emitFarmEvent
|
|
16
17
|
} from "./chunk-FUZEBRP3.mjs";
|
|
@@ -260,7 +261,7 @@ function createHandledResponse(body, init, headers) {
|
|
|
260
261
|
return new Response(body, { ...init, headers: responseHeaders });
|
|
261
262
|
}
|
|
262
263
|
__name(createHandledResponse, "createHandledResponse");
|
|
263
|
-
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress) {
|
|
264
|
+
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress, toRoutePathname) {
|
|
264
265
|
let currentRequest = withNodeRequestShape(request, trustProxy, clientAddress);
|
|
265
266
|
let handledResponse = null;
|
|
266
267
|
const url = new URL(currentRequest.url);
|
|
@@ -281,6 +282,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
281
282
|
response: responseShim.response,
|
|
282
283
|
url,
|
|
283
284
|
pathname: url.pathname,
|
|
285
|
+
routePathname: toMiddlewareRoutePathname(url.pathname, toRoutePathname),
|
|
284
286
|
searchParams: url.searchParams,
|
|
285
287
|
method: currentRequest.method || "GET",
|
|
286
288
|
params: {},
|
|
@@ -323,6 +325,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
323
325
|
ctx.request = currentRequest;
|
|
324
326
|
ctx.url = nextUrl;
|
|
325
327
|
ctx.pathname = nextUrl.pathname;
|
|
328
|
+
ctx.routePathname = toMiddlewareRoutePathname(nextUrl.pathname, toRoutePathname);
|
|
326
329
|
ctx.searchParams = nextUrl.searchParams;
|
|
327
330
|
ctx.route = nextUrl.pathname;
|
|
328
331
|
},
|
|
@@ -480,15 +483,16 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
480
483
|
if (!globalConfig && entries.length === 0) {
|
|
481
484
|
return emptyResult(request);
|
|
482
485
|
}
|
|
486
|
+
const toRoutePathname = /* @__PURE__ */ __name((pathname) => options.i18n?.enabled ? stripFarmLocaleFromPathname(pathname, options.i18n) : stripFarmBasePath(pathname, options.i18n?.basePath ?? "/"), "toRoutePathname");
|
|
483
487
|
let contextState = createWebMiddlewareContext(
|
|
484
488
|
request,
|
|
485
489
|
void 0,
|
|
486
490
|
options.server?.trustProxy === true,
|
|
487
|
-
requestOptions.clientAddress
|
|
491
|
+
requestOptions.clientAddress,
|
|
492
|
+
toRoutePathname
|
|
488
493
|
);
|
|
489
494
|
let ctx = contextState.ctx;
|
|
490
495
|
let currentRequest = contextState.getRequest();
|
|
491
|
-
const toRoutePathname = /* @__PURE__ */ __name((pathname) => options.i18n?.enabled ? stripFarmLocaleFromPathname(pathname, options.i18n) : stripFarmBasePath(pathname, options.i18n?.basePath ?? "/"), "toRoutePathname");
|
|
492
496
|
const initialRequestPathname = ctx.pathname;
|
|
493
497
|
const initialPathname = toRoutePathname(initialRequestPathname);
|
|
494
498
|
const matchPathnames = /* @__PURE__ */ __name((pathname, requestPathname) => options.rawPathRouting && requestPathname !== pathname ? [
|
|
@@ -542,7 +546,8 @@ function createProductionMiddlewareRunner(options = {}) {
|
|
|
542
546
|
currentRequest,
|
|
543
547
|
parentData,
|
|
544
548
|
options.server?.trustProxy === true,
|
|
545
|
-
requestOptions.clientAddress
|
|
549
|
+
requestOptions.clientAddress,
|
|
550
|
+
toRoutePathname
|
|
546
551
|
);
|
|
547
552
|
ctx = contextState.ctx;
|
|
548
553
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkR5A5KNVXcjs = require('./chunk-R5A5KNVX.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkR5A5KNVXcjs = require('./chunk-R5A5KNVX.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkJEZO6VURcjs = require('./chunk-JEZO6VUR.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
@@ -227,12 +227,12 @@ var _SPARouter = class _SPARouter {
|
|
|
227
227
|
viewTransition = false,
|
|
228
228
|
refresh = false
|
|
229
229
|
} = options;
|
|
230
|
-
const url =
|
|
231
|
-
if (
|
|
230
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
231
|
+
if (_chunkJEZO6VURcjs.isFarmBlockedNavigationURL.call(void 0, url)) return;
|
|
232
232
|
const pathname = url.pathname;
|
|
233
233
|
const search = url.search;
|
|
234
234
|
const fullPath = pathname + search;
|
|
235
|
-
if (
|
|
235
|
+
if (_chunkJEZO6VURcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin) || _chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, url.toString()) || this.options.shouldUseDocumentNavigation(pathname)) {
|
|
236
236
|
this.cancelActiveNavigation();
|
|
237
237
|
if (replace) window.location.replace(url.toString());
|
|
238
238
|
else window.location.assign(url.toString());
|
|
@@ -336,9 +336,9 @@ var _SPARouter = class _SPARouter {
|
|
|
336
336
|
*/
|
|
337
337
|
async prefetch(href) {
|
|
338
338
|
if (this.destroyed) return;
|
|
339
|
-
if (
|
|
340
|
-
const url =
|
|
341
|
-
if (
|
|
339
|
+
if (_chunkS6FJO323cjs.isFarmLocaleChangeHref.call(void 0, href)) return;
|
|
340
|
+
const url = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
341
|
+
if (_chunkJEZO6VURcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin)) return;
|
|
342
342
|
if (this.options.shouldUseDocumentNavigation(url.pathname)) return;
|
|
343
343
|
const fullPath = url.pathname + url.search;
|
|
344
344
|
const interceptFrom = window.location.pathname + window.location.search;
|
|
@@ -497,7 +497,7 @@ var _SPARouter = class _SPARouter {
|
|
|
497
497
|
this.writePageState(action, readPageState(), href, false);
|
|
498
498
|
}
|
|
499
499
|
async commitNavigation(options) {
|
|
500
|
-
const historyUrl =
|
|
500
|
+
const historyUrl = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0,
|
|
501
501
|
options.pageData.canonicalPath || options.fullPath,
|
|
502
502
|
window.location.href
|
|
503
503
|
);
|
|
@@ -519,13 +519,13 @@ var _SPARouter = class _SPARouter {
|
|
|
519
519
|
window.history.pushState(historyState, "", historyPath);
|
|
520
520
|
}
|
|
521
521
|
this.currentHistoryIndex = nextHistoryIndex;
|
|
522
|
-
const resolvedHistoryUrl =
|
|
522
|
+
const resolvedHistoryUrl = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, historyPath, window.location.href);
|
|
523
523
|
this.currentHistoryPath = resolvedHistoryUrl.pathname + resolvedHistoryUrl.search;
|
|
524
524
|
this.currentHistoryHash = resolvedHistoryUrl.hash;
|
|
525
525
|
this.currentInterceptFrom = historyState[FARM_INTERCEPT_FROM_KEY];
|
|
526
526
|
notifyRouterHistoryChange();
|
|
527
527
|
this.updateDocumentMetadata(options.pageData.metadata);
|
|
528
|
-
|
|
528
|
+
_chunkS6FJO323cjs._hydrateFarmI18n.call(void 0, options.pageData.i18n);
|
|
529
529
|
if (this.onNavigate) {
|
|
530
530
|
await this.onNavigate(options.pageData);
|
|
531
531
|
}
|
|
@@ -757,7 +757,7 @@ var _SPARouter = class _SPARouter {
|
|
|
757
757
|
}
|
|
758
758
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
759
759
|
this.updateDocumentMetadata(pageData.metadata);
|
|
760
|
-
|
|
760
|
+
_chunkS6FJO323cjs._hydrateFarmI18n.call(void 0, pageData.i18n);
|
|
761
761
|
if (this.onNavigate) {
|
|
762
762
|
await this.onNavigate(pageData);
|
|
763
763
|
}
|
|
@@ -872,7 +872,7 @@ var _SPARouter = class _SPARouter {
|
|
|
872
872
|
}
|
|
873
873
|
writePageState(action, state, href, notify = true) {
|
|
874
874
|
if (typeof window === "undefined") return;
|
|
875
|
-
const url = href ?
|
|
875
|
+
const url = href ? _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href).toString() : window.location.href;
|
|
876
876
|
const parsedUrl = new URL(url);
|
|
877
877
|
const nextPath = parsedUrl.pathname + parsedUrl.search;
|
|
878
878
|
const historyPath = nextPath + parsedUrl.hash;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -112,7 +112,7 @@ function toWebRequest(ctx) {
|
|
|
112
112
|
if (isWebRequest(ctx.request)) {
|
|
113
113
|
return ctx.request;
|
|
114
114
|
}
|
|
115
|
-
return
|
|
115
|
+
return _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, ctx.request, { origin: ctx.url.origin });
|
|
116
116
|
}
|
|
117
117
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toWebRequest, "toWebRequest");
|
|
118
118
|
function createRequestMiddlewareContext(ctx) {
|
|
@@ -123,6 +123,9 @@ function createRequestMiddlewareContext(ctx) {
|
|
|
123
123
|
get pathname() {
|
|
124
124
|
return ctx.pathname;
|
|
125
125
|
},
|
|
126
|
+
get routePathname() {
|
|
127
|
+
return ctx.routePathname;
|
|
128
|
+
},
|
|
126
129
|
get searchParams() {
|
|
127
130
|
return ctx.searchParams;
|
|
128
131
|
},
|
|
@@ -183,6 +183,25 @@ function matchPattern(pattern, pathname) {
|
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
__name(matchPattern, "matchPattern");
|
|
186
|
+
function withRoutePathname(ctx, routePathname) {
|
|
187
|
+
return new Proxy(ctx, {
|
|
188
|
+
get(target, key) {
|
|
189
|
+
return key === "pathname" || key === "routePathname" ? routePathname : Reflect.get(target, key, target);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
__name(withRoutePathname, "withRoutePathname");
|
|
194
|
+
function matchesMiddlewarePredicate(predicate, ctx, getRoutePathname = () => ctx.routePathname) {
|
|
195
|
+
if (predicate(ctx)) return true;
|
|
196
|
+
const routePathname = getRoutePathname();
|
|
197
|
+
if (routePathname === void 0 || routePathname === ctx.pathname) return false;
|
|
198
|
+
return Boolean(predicate(withRoutePathname(ctx, routePathname)));
|
|
199
|
+
}
|
|
200
|
+
__name(matchesMiddlewarePredicate, "matchesMiddlewarePredicate");
|
|
201
|
+
function toMiddlewareRoutePathname(pathname, toRoutePathname = (value) => value) {
|
|
202
|
+
return canonicalizeRequestPathname(toRoutePathname(pathname));
|
|
203
|
+
}
|
|
204
|
+
__name(toMiddlewareRoutePathname, "toMiddlewareRoutePathname");
|
|
186
205
|
function matchesCompiledMiddlewareConfig(pathname, config, ctx) {
|
|
187
206
|
let canonicalPathname;
|
|
188
207
|
const getCanonicalPathname = /* @__PURE__ */ __name(() => canonicalPathname ?? (canonicalPathname = canonicalizeRequestPathname(pathname)), "getCanonicalPathname");
|
|
@@ -196,7 +215,7 @@ function matchesCompiledMiddlewareConfig(pathname, config, ctx) {
|
|
|
196
215
|
if (config.matcher) {
|
|
197
216
|
for (const matcher of config.matcher) {
|
|
198
217
|
if (typeof matcher === "function") {
|
|
199
|
-
if (matcher
|
|
218
|
+
if (matchesMiddlewarePredicate(matcher, ctx, getCanonicalPathname)) {
|
|
200
219
|
return { matched: true };
|
|
201
220
|
}
|
|
202
221
|
continue;
|
|
@@ -232,6 +251,8 @@ export {
|
|
|
232
251
|
matchesMiddlewareRoute,
|
|
233
252
|
matchesMiddlewareRouteAt,
|
|
234
253
|
compileMiddlewareConfig,
|
|
254
|
+
matchesMiddlewarePredicate,
|
|
255
|
+
toMiddlewareRoutePathname,
|
|
235
256
|
matchesCompiledMiddlewareConfig,
|
|
236
257
|
matchesMiddlewareConfig,
|
|
237
258
|
matchesMiddlewareConfigAt
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-JM5XPKWH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createWebRequestFromFarmRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3KGDJLJK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -123,6 +123,9 @@ function createRequestMiddlewareContext(ctx) {
|
|
|
123
123
|
get pathname() {
|
|
124
124
|
return ctx.pathname;
|
|
125
125
|
},
|
|
126
|
+
get routePathname() {
|
|
127
|
+
return ctx.routePathname;
|
|
128
|
+
},
|
|
126
129
|
get searchParams() {
|
|
127
130
|
return ctx.searchParams;
|
|
128
131
|
},
|
|
@@ -10,6 +10,14 @@ function isFarmBlockedNavigationURL(url) {
|
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmBlockedNavigationURL, "isFarmBlockedNavigationURL");
|
|
13
|
+
function isFarmScriptURL(href) {
|
|
14
|
+
try {
|
|
15
|
+
return new URL(href, "http://farm.invalid").protocol === "javascript:";
|
|
16
|
+
} catch (e) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmScriptURL, "isFarmScriptURL");
|
|
13
21
|
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
14
22
|
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
15
23
|
}
|
|
@@ -23,4 +31,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNavigationURL, "resolveFarmNavi
|
|
|
23
31
|
|
|
24
32
|
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
|
|
35
|
+
exports.isFarmBlockedNavigationURL = isFarmBlockedNavigationURL; exports.isFarmScriptURL = isFarmScriptURL; exports.isFarmExternalNavigationURL = isFarmExternalNavigationURL; exports.resolveFarmNavigationURL = resolveFarmNavigationURL;
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
notifyHistoryChange,
|
|
8
8
|
readPageState,
|
|
9
9
|
subscribeHistoryChange
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ND2CWPOD.mjs";
|
|
11
11
|
import {
|
|
12
12
|
getFarmI18nClientState
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IHQIOZLC.mjs";
|
|
14
14
|
import {
|
|
15
15
|
_resolveCurrentRequest
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-S3VWVTVA.mjs";
|
|
17
17
|
import {
|
|
18
18
|
stripFarmLocaleFromPathname
|
|
19
19
|
} from "./chunk-L3KT7IXV.mjs";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MiddlewareManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NFMDCAOS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
matchesMiddlewarePredicate
|
|
6
|
+
} from "./chunk-HZFM2LWQ.mjs";
|
|
4
7
|
import {
|
|
5
8
|
resolveFarmI18nConfig
|
|
6
9
|
} from "./chunk-BCMSYSN2.mjs";
|
|
@@ -210,7 +213,7 @@ var _MiddlewareChainImpl = class _MiddlewareChainImpl {
|
|
|
210
213
|
*/
|
|
211
214
|
when(condition, fn) {
|
|
212
215
|
const conditionalMiddleware = /* @__PURE__ */ __name(async (ctx, next) => {
|
|
213
|
-
const shouldRun = typeof condition === "function" ? condition
|
|
216
|
+
const shouldRun = typeof condition === "function" ? matchesMiddlewarePredicate(condition, ctx) : condition;
|
|
214
217
|
if (!shouldRun) {
|
|
215
218
|
return next();
|
|
216
219
|
}
|