@farm.js/core 0.1.31 → 0.1.34
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/README.md +1 -1
- package/dist/agent-runtime.cjs +69 -14
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +58 -3
- package/dist/api/route-manager.cjs +16 -13
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +15 -12
- package/dist/api/runtime.cjs +9 -7
- package/dist/api/runtime.d.mts +1 -1
- package/dist/api/runtime.d.ts +1 -1
- package/dist/api/runtime.mjs +8 -6
- package/dist/api.cjs +19 -16
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +18 -15
- package/dist/{app-sUJ3jnTZ.d.ts → app-DgotYGbq.d.ts} +3 -3
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +7 -5
- package/dist/{app-DAuUTIZf.d.mts → app-q4rmZlXK.d.mts} +3 -3
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/chunk-2NQQ5H5G.cjs +86 -0
- package/dist/{chunk-IFI5FXEZ.cjs → chunk-36MK5YCW.cjs} +334 -163
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-5LJCOSKT.mjs → chunk-3VSKDFAT.mjs} +1 -1
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-657WJNRY.mjs} +10 -4
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-6VVL3MHY.mjs} +3 -3
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-KZLND3D2.cjs → chunk-7BT4H4P7.cjs} +7 -5
- package/dist/{chunk-A777V5WU.cjs → chunk-7M52YUMY.cjs} +2 -2
- package/dist/{chunk-VUMAE7NC.mjs → chunk-7Y6ZNFPX.mjs} +81 -30
- package/dist/{chunk-MXDTKXO6.cjs → chunk-A5FGU2WU.cjs} +74 -23
- package/dist/{chunk-7QOCTYBS.mjs → chunk-AGC75XAE.mjs} +37 -1
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-O3DTUAX2.mjs → chunk-AQZFOP7S.mjs} +6 -77
- package/dist/{chunk-WNLBF77X.cjs → chunk-ATK2R4CH.cjs} +14 -12
- package/dist/{chunk-SORB3MAR.cjs → chunk-AWC4VUZL.cjs} +17 -17
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-FYRBX5IY.cjs → chunk-BTAG7LI7.cjs} +2 -2
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-JATSG2ZO.mjs → chunk-CLJYVZAD.mjs} +4 -2
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/{chunk-JLRDISQL.cjs → chunk-DZ4DTRJ5.cjs} +7 -7
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-PZNCMPJF.cjs → chunk-G26MUMKL.cjs} +14 -8
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-JLCQGPXE.mjs → chunk-GNSDTTWZ.mjs} +50 -61
- package/dist/{chunk-TEN4FIZU.mjs → chunk-GOABMOX3.mjs} +151 -3
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-GZYH4OER.mjs → chunk-HR5KPHC2.mjs} +1 -1
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/{chunk-DGXN3L4D.mjs → chunk-JDPAKVS4.mjs} +4 -4
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/{chunk-QG5HNS7P.mjs → chunk-LHODW25H.mjs} +2 -2
- package/dist/{chunk-BXFWA23T.mjs → chunk-LMJ7VRHZ.mjs} +3 -3
- package/dist/{chunk-WG2KHOMN.mjs → chunk-LR5QSC2P.mjs} +380 -209
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/{chunk-5MKEDGLD.cjs → chunk-M64YUMA4.cjs} +11 -6
- package/dist/{chunk-EXLKRR4U.cjs → chunk-MIDIZJZC.cjs} +12 -12
- package/dist/{chunk-ES4B2IXW.cjs → chunk-MOKLYNHV.cjs} +2 -2
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-6VYZOPOT.mjs → chunk-NGVORZVZ.mjs} +1 -1
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/{chunk-AHAJGAYD.mjs → chunk-O27L4YAA.mjs} +1 -1
- package/dist/{chunk-VYZSOYR4.cjs → chunk-ODBZYBAB.cjs} +1 -1
- package/dist/{chunk-YVGAEAA5.cjs → chunk-P64MIF5B.cjs} +154 -6
- package/dist/{chunk-DFLLARUK.cjs → chunk-PQDFUSXD.cjs} +14 -14
- package/dist/{chunk-F6XEGFHO.mjs → chunk-PXKIEXZD.mjs} +10 -0
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-QGYRXFU2.cjs} +9 -9
- package/dist/{chunk-CTV2TTNP.cjs → chunk-QJ3J6MZT.cjs} +16 -87
- package/dist/{chunk-O6XNAMBV.mjs → chunk-QLQ32WC4.mjs} +8 -3
- package/dist/{chunk-IMB4PIAR.cjs → chunk-SJVKK4JE.cjs} +839 -420
- package/dist/{chunk-3FCFQP5V.cjs → chunk-TA5G2HWD.cjs} +21 -21
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-TDFPACVX.cjs} +62 -73
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-UAFSBWNT.mjs → chunk-U4PTAHW3.mjs} +64 -13
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-U74I55WB.cjs} +86 -35
- package/dist/chunk-UBO4SGH4.mjs +86 -0
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-X7KZBF63.cjs → chunk-UX5S4JEO.cjs} +40 -4
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-L4DVIHOC.mjs → chunk-VCCUOMQN.mjs} +1 -1
- package/dist/{chunk-4V7GIE2U.mjs → chunk-VHANUNEG.mjs} +2 -2
- package/dist/{chunk-FXUUWYAX.cjs → chunk-VKNHTSAP.cjs} +10 -0
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-WNNYOOIB.mjs} +5 -3
- package/dist/{chunk-VA62MHFV.mjs → chunk-X242HVD5.mjs} +1 -1
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-6L6DQR5W.mjs → chunk-XV5DJTBX.mjs} +539 -121
- package/dist/{chunk-KJ2TIHZZ.cjs → chunk-XXJU7FCC.cjs} +3 -2
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/{chunk-2FXWWUE5.cjs → chunk-Z2YLTERK.cjs} +4 -4
- package/dist/{chunk-CUMINO7Z.cjs → chunk-ZHPHJPQP.cjs} +4 -4
- package/dist/{chunk-FJZ3DQLK.mjs → chunk-ZKP7C2B6.mjs} +4 -4
- package/dist/{chunk-JBC2FKRW.mjs → chunk-ZUSJDQ2Q.mjs} +2 -1
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CLObcuCq.d.mts} +26 -2
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-DZjHC4Mi.d.ts} +26 -2
- 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-EWRDHCD5.cjs → devtools-HU6Y2MNV.cjs} +11 -9
- package/dist/{devtools-BPBCYOU6.mjs → devtools-RNXCTS4R.mjs} +10 -8
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +5 -0
- package/dist/docs.d.ts +5 -0
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +67 -55
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +70 -58
- package/dist/integrations.cjs +6 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +7 -4
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +14 -3
- package/dist/internal/app-markdown-runtime.d.ts +14 -3
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +38 -35
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +37 -34
- package/dist/internal/cli-runtime.cjs +20 -17
- package/dist/internal/cli-runtime.mjs +19 -16
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +3 -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 +11 -9
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +10 -8
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +20 -14
- package/dist/internal/production-runtime.d.mts +115 -8
- package/dist/internal/production-runtime.d.ts +115 -8
- package/dist/internal/production-runtime.mjs +19 -13
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-2HSU2i_w.d.mts} +1 -1
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-Cjs8JMRM.d.ts} +1 -1
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +24 -5
- package/dist/middleware.d.ts +24 -5
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-NAKCRVHX.mjs → nitro-4XGPNIK4.mjs} +3 -3
- package/dist/{nitro-VYDZGYFY.cjs → nitro-HSAQFXSS.cjs} +4 -4
- package/dist/plugin.cjs +33 -30
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +32 -29
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-BU5ETAK9.d.ts} +8 -1
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-CysZl3EV.d.mts} +8 -1
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-CKr4ltOd.d.mts} +1 -1
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-D72O1qm4.d.ts} +1 -1
- package/dist/renderer-client.cjs +39 -19
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +28 -8
- package/dist/{request-CFy1BltJ.d.mts → request-Be83WafN.d.mts} +7 -2
- package/dist/{request-BcY4RYPC.d.ts → request-DbyOYI2j.d.ts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-BG56SzvJ.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-CtVMpV-k.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ALUvm8gC.d.mts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-D94-SDlW.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +60 -57
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +37 -34
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-CxK3USIz.d.ts} +2 -2
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-DbxNRKOB.d.mts} +2 -2
- package/dist/testing.cjs +19 -17
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +16 -14
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{utils-DMD1Hzta.d.ts → utils-311Y8eoK.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-4wVRcpOw.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +33 -30
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +32 -29
- package/package.json +2 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFarmMarkdownViewResponse,
|
|
3
3
|
requestAcceptsMarkdown
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZUSJDQ2Q.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__name
|
|
7
7
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -107,6 +107,11 @@ function createFarmMarkdownRouteModule(input) {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
__name(createFarmMarkdownRouteModule, "createFarmMarkdownRouteModule");
|
|
110
|
+
var publicSourceResponses = /* @__PURE__ */ new WeakSet();
|
|
111
|
+
function isFarmMarkdownPublicSourceResponse(response) {
|
|
112
|
+
return publicSourceResponses.has(response);
|
|
113
|
+
}
|
|
114
|
+
__name(isFarmMarkdownPublicSourceResponse, "isFarmMarkdownPublicSourceResponse");
|
|
110
115
|
async function createFarmMarkdownSourceResponse(options) {
|
|
111
116
|
if (options.request.method !== "GET" && options.request.method !== "HEAD") {
|
|
112
117
|
return null;
|
|
@@ -124,6 +129,36 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
124
129
|
if (!source) {
|
|
125
130
|
return null;
|
|
126
131
|
}
|
|
132
|
+
const anonymous = !options.request.headers.has("cookie") && !options.request.headers.has("authorization");
|
|
133
|
+
if (options.renderPage && (hasMarkdownExtension || !anonymous)) {
|
|
134
|
+
const publicUrl = new URL(url);
|
|
135
|
+
publicUrl.pathname = targetPathname;
|
|
136
|
+
const publicHeaders = new Headers(options.request.headers);
|
|
137
|
+
publicHeaders.delete("cookie");
|
|
138
|
+
publicHeaders.delete("authorization");
|
|
139
|
+
publicHeaders.set("accept", "text/markdown");
|
|
140
|
+
const publicResponse = await options.renderPage(
|
|
141
|
+
new Request(publicUrl, {
|
|
142
|
+
method: options.request.method,
|
|
143
|
+
headers: publicHeaders,
|
|
144
|
+
signal: options.request.signal
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
if (publicResponse.headers.get("X-Farm-Markdown-Route") === targetPathname) {
|
|
148
|
+
publicSourceResponses.add(publicResponse);
|
|
149
|
+
return publicResponse;
|
|
150
|
+
}
|
|
151
|
+
await publicResponse.body?.cancel();
|
|
152
|
+
if (!hasMarkdownExtension) return null;
|
|
153
|
+
return new Response(`No public Markdown version of ${targetPathname}.
|
|
154
|
+
`, {
|
|
155
|
+
status: 404,
|
|
156
|
+
headers: {
|
|
157
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
158
|
+
"Cache-Control": "private, no-store"
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
127
162
|
const headers = new Headers({
|
|
128
163
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
129
164
|
"Content-Location": targetPathname === "/" ? "/index.md" : `${targetPathname}.md`,
|
|
@@ -152,5 +187,6 @@ export {
|
|
|
152
187
|
titleFromMarkdown,
|
|
153
188
|
createMarkdownMetadata,
|
|
154
189
|
createFarmMarkdownRouteModule,
|
|
190
|
+
isFarmMarkdownPublicSourceResponse,
|
|
155
191
|
createFarmMarkdownSourceResponse
|
|
156
192
|
};
|
|
@@ -9,17 +9,23 @@ function parseRequestCookieHeader(header) {
|
|
|
9
9
|
const separatorIndex = part.indexOf("=");
|
|
10
10
|
if (separatorIndex === -1) {
|
|
11
11
|
return {
|
|
12
|
-
name:
|
|
12
|
+
name: decodeCookieName(part),
|
|
13
13
|
value: ""
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
name:
|
|
17
|
+
name: decodeCookieName(part.slice(0, separatorIndex).trim()),
|
|
18
18
|
value: decodeCookiePart(part.slice(separatorIndex + 1).trim())
|
|
19
19
|
};
|
|
20
20
|
}).filter((cookie) => cookie.name.length > 0);
|
|
21
21
|
}
|
|
22
22
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRequestCookieHeader, "parseRequestCookieHeader");
|
|
23
|
+
var RESERVED_PREFIX = /^__(host|secure)-/i;
|
|
24
|
+
function decodeCookieName(raw) {
|
|
25
|
+
const decoded = decodeCookiePart(raw);
|
|
26
|
+
return RESERVED_PREFIX.test(decoded) && !RESERVED_PREFIX.test(raw) ? raw : decoded;
|
|
27
|
+
}
|
|
28
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, decodeCookieName, "decodeCookieName");
|
|
23
29
|
function decodeCookiePart(value) {
|
|
24
30
|
try {
|
|
25
31
|
return decodeURIComponent(value);
|
|
@@ -31,4 +37,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, decodeCookiePart, "decodeCookiePart");
|
|
|
31
37
|
|
|
32
38
|
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
|
|
41
|
+
exports.parseRequestCookieHeader = parseRequestCookieHeader; exports.decodeCookieName = decodeCookieName;
|
|
@@ -24,15 +24,18 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
resolveFarmComponentExtensions
|
|
26
26
|
} from "./chunk-DAATZTKJ.mjs";
|
|
27
|
+
import {
|
|
28
|
+
parseRouteSlotFile
|
|
29
|
+
} from "./chunk-UBO4SGH4.mjs";
|
|
27
30
|
import {
|
|
28
31
|
discoverProgrammaticRoutePaths
|
|
29
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-UDNPLXW7.mjs";
|
|
30
33
|
import {
|
|
31
34
|
readFarmI18nCatalogs
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QCFBDFRS.mjs";
|
|
33
36
|
import {
|
|
34
37
|
resolvePluginRoutes
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3UEVPCGW.mjs";
|
|
36
39
|
import {
|
|
37
40
|
parseRoutePath
|
|
38
41
|
} from "./chunk-KI3MESHB.mjs";
|
|
@@ -645,78 +648,6 @@ __name(matchSSGPage, "matchSSGPage");
|
|
|
645
648
|
// src/routing/generate-route-types.ts
|
|
646
649
|
import * as path from "path";
|
|
647
650
|
import * as fs from "fs";
|
|
648
|
-
|
|
649
|
-
// src/routing/route-slots.ts
|
|
650
|
-
var SLOT_SEGMENT = /^@([A-Za-z][A-Za-z0-9_-]*)$/;
|
|
651
|
-
function parseRouteSlotFile(filePath) {
|
|
652
|
-
const normalized = filePath.replace(/\\/g, "/");
|
|
653
|
-
const parts = normalized.split("/").filter(Boolean);
|
|
654
|
-
const fileName = parts.at(-1) ?? "";
|
|
655
|
-
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte)$/, "");
|
|
656
|
-
if (baseName !== "page" && baseName !== "default") return null;
|
|
657
|
-
const slotIndex = parts.findIndex((part) => SLOT_SEGMENT.test(part));
|
|
658
|
-
if (slotIndex < 0) return null;
|
|
659
|
-
if (parts.slice(slotIndex + 1, -1).some((part) => SLOT_SEGMENT.test(part))) {
|
|
660
|
-
throw new Error(`Nested route slots are not supported in "${filePath}"`);
|
|
661
|
-
}
|
|
662
|
-
const slotMatch = parts[slotIndex].match(SLOT_SEGMENT);
|
|
663
|
-
const name = slotMatch?.[1];
|
|
664
|
-
if (!name) return null;
|
|
665
|
-
const ownerParts = parts.slice(0, slotIndex);
|
|
666
|
-
const contentParts = parts.slice(slotIndex + 1, -1);
|
|
667
|
-
const marker = parseInterceptionMarker(contentParts[0]);
|
|
668
|
-
let targetBase = ownerParts;
|
|
669
|
-
let targetParts = contentParts;
|
|
670
|
-
if (marker) {
|
|
671
|
-
targetBase = marker.root === true ? [] : ownerParts.slice(0, Math.max(0, ownerParts.length - marker.up));
|
|
672
|
-
targetParts = [...marker.remainder ? [marker.remainder] : [], ...contentParts.slice(1)];
|
|
673
|
-
}
|
|
674
|
-
const ownerFile = [...ownerParts, "layout.tsx"].join("/");
|
|
675
|
-
const routeFile = [
|
|
676
|
-
...baseName === "default" ? ownerParts : targetBase,
|
|
677
|
-
...baseName === "default" ? [] : targetParts,
|
|
678
|
-
"page.tsx"
|
|
679
|
-
].join("/");
|
|
680
|
-
return {
|
|
681
|
-
name,
|
|
682
|
-
ownerRoute: parseRoutePath(ownerFile || "layout.tsx"),
|
|
683
|
-
route: parseRoutePath(routeFile || "page.tsx"),
|
|
684
|
-
interception: marker !== null,
|
|
685
|
-
fallback: baseName === "default"
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
__name(parseRouteSlotFile, "parseRouteSlotFile");
|
|
689
|
-
function createRouteSlotContainerId(name, ownerPattern) {
|
|
690
|
-
const owner = ownerPattern === "/" ? "root" : ownerPattern.replace(/^\//, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
691
|
-
return `__farm_slot_${name}_${owner || "root"}__`;
|
|
692
|
-
}
|
|
693
|
-
__name(createRouteSlotContainerId, "createRouteSlotContainerId");
|
|
694
|
-
function parseInterceptionMarker(segment) {
|
|
695
|
-
if (!segment) return null;
|
|
696
|
-
if (segment.startsWith("(...)")) {
|
|
697
|
-
return {
|
|
698
|
-
up: 0,
|
|
699
|
-
root: true,
|
|
700
|
-
remainder: segment.slice(5)
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
if (segment.startsWith("(.)")) {
|
|
704
|
-
return {
|
|
705
|
-
up: 0,
|
|
706
|
-
remainder: segment.slice(3)
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
let remainder = segment;
|
|
710
|
-
let up = 0;
|
|
711
|
-
while (remainder.startsWith("(..)")) {
|
|
712
|
-
up += 1;
|
|
713
|
-
remainder = remainder.slice(4);
|
|
714
|
-
}
|
|
715
|
-
return up > 0 ? { up, remainder } : null;
|
|
716
|
-
}
|
|
717
|
-
__name(parseInterceptionMarker, "parseInterceptionMarker");
|
|
718
|
-
|
|
719
|
-
// src/routing/generate-route-types.ts
|
|
720
651
|
function routeSegmentsToTsTypeLiteral(segments) {
|
|
721
652
|
if (segments.length === 0) return '"/"';
|
|
722
653
|
const hasDynamic = segments.some((s) => s.startsWith("["));
|
|
@@ -1405,8 +1336,6 @@ export {
|
|
|
1405
1336
|
hasPPR,
|
|
1406
1337
|
generateSSGManifest,
|
|
1407
1338
|
matchSSGPage,
|
|
1408
|
-
parseRouteSlotFile,
|
|
1409
|
-
createRouteSlotContainerId,
|
|
1410
1339
|
generateRouteTypes,
|
|
1411
1340
|
generateFarmImageTypes,
|
|
1412
1341
|
createFarmImageTypeDeclarations,
|
|
@@ -1,14 +1,15 @@
|
|
|
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 _chunkFFFW3OQ7cjs = require('./chunk-FFFW3OQ7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkR5A5KNVXcjs = require('./chunk-R5A5KNVX.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkC4SPBWFMcjs = require('./chunk-C4SPBWFM.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
@@ -216,11 +217,12 @@ var _SPARouter = class _SPARouter {
|
|
|
216
217
|
viewTransition = false,
|
|
217
218
|
refresh = false
|
|
218
219
|
} = options;
|
|
219
|
-
const url =
|
|
220
|
+
const url = _chunkC4SPBWFMcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
221
|
+
if (_chunkC4SPBWFMcjs.isFarmBlockedNavigationURL.call(void 0, url)) return;
|
|
220
222
|
const pathname = url.pathname;
|
|
221
223
|
const search = url.search;
|
|
222
224
|
const fullPath = pathname + search;
|
|
223
|
-
if (
|
|
225
|
+
if (_chunkC4SPBWFMcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin) || _chunkFFFW3OQ7cjs.isFarmLocaleChangeHref.call(void 0, url.toString()) || this.options.shouldUseDocumentNavigation(pathname)) {
|
|
224
226
|
this.cancelActiveNavigation();
|
|
225
227
|
if (replace) window.location.replace(url.toString());
|
|
226
228
|
else window.location.assign(url.toString());
|
|
@@ -324,9 +326,9 @@ var _SPARouter = class _SPARouter {
|
|
|
324
326
|
*/
|
|
325
327
|
async prefetch(href) {
|
|
326
328
|
if (this.destroyed) return;
|
|
327
|
-
if (
|
|
328
|
-
const url =
|
|
329
|
-
if (
|
|
329
|
+
if (_chunkFFFW3OQ7cjs.isFarmLocaleChangeHref.call(void 0, href)) return;
|
|
330
|
+
const url = _chunkC4SPBWFMcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
331
|
+
if (_chunkC4SPBWFMcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin)) return;
|
|
330
332
|
if (this.options.shouldUseDocumentNavigation(url.pathname)) return;
|
|
331
333
|
const fullPath = url.pathname + url.search;
|
|
332
334
|
const interceptFrom = window.location.pathname + window.location.search;
|
|
@@ -485,7 +487,7 @@ var _SPARouter = class _SPARouter {
|
|
|
485
487
|
this.writePageState(action, readPageState(), href, false);
|
|
486
488
|
}
|
|
487
489
|
async commitNavigation(options) {
|
|
488
|
-
const historyUrl =
|
|
490
|
+
const historyUrl = _chunkC4SPBWFMcjs.resolveFarmNavigationURL.call(void 0,
|
|
489
491
|
options.pageData.canonicalPath || options.fullPath,
|
|
490
492
|
window.location.href
|
|
491
493
|
);
|
|
@@ -507,13 +509,13 @@ var _SPARouter = class _SPARouter {
|
|
|
507
509
|
window.history.pushState(historyState, "", historyPath);
|
|
508
510
|
}
|
|
509
511
|
this.currentHistoryIndex = nextHistoryIndex;
|
|
510
|
-
const resolvedHistoryUrl =
|
|
512
|
+
const resolvedHistoryUrl = _chunkC4SPBWFMcjs.resolveFarmNavigationURL.call(void 0, historyPath, window.location.href);
|
|
511
513
|
this.currentHistoryPath = resolvedHistoryUrl.pathname + resolvedHistoryUrl.search;
|
|
512
514
|
this.currentHistoryHash = resolvedHistoryUrl.hash;
|
|
513
515
|
this.currentInterceptFrom = historyState[FARM_INTERCEPT_FROM_KEY];
|
|
514
516
|
notifyRouterHistoryChange();
|
|
515
517
|
this.updateDocumentMetadata(options.pageData.metadata);
|
|
516
|
-
|
|
518
|
+
_chunkFFFW3OQ7cjs._hydrateFarmI18n.call(void 0, options.pageData.i18n);
|
|
517
519
|
if (this.onNavigate) {
|
|
518
520
|
await this.onNavigate(options.pageData);
|
|
519
521
|
}
|
|
@@ -745,7 +747,7 @@ var _SPARouter = class _SPARouter {
|
|
|
745
747
|
}
|
|
746
748
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
747
749
|
this.updateDocumentMetadata(pageData.metadata);
|
|
748
|
-
|
|
750
|
+
_chunkFFFW3OQ7cjs._hydrateFarmI18n.call(void 0, pageData.i18n);
|
|
749
751
|
if (this.onNavigate) {
|
|
750
752
|
await this.onNavigate(pageData);
|
|
751
753
|
}
|
|
@@ -860,7 +862,7 @@ var _SPARouter = class _SPARouter {
|
|
|
860
862
|
}
|
|
861
863
|
writePageState(action, state, href, notify = true) {
|
|
862
864
|
if (typeof window === "undefined") return;
|
|
863
|
-
const url = href ?
|
|
865
|
+
const url = href ? _chunkC4SPBWFMcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href).toString() : window.location.href;
|
|
864
866
|
const parsedUrl = new URL(url);
|
|
865
867
|
const nextPath = parsedUrl.pathname + parsedUrl.search;
|
|
866
868
|
const historyPath = nextPath + parsedUrl.hash;
|
|
@@ -7,10 +7,10 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkATK2R4CHcjs = require('./chunk-ATK2R4CH.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkFFFW3OQ7cjs = require('./chunk-FFFW3OQ7.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunkU4KT7QP3cjs = require('./chunk-U4KT7QP3.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 = _chunkATK2R4CHcjs.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
|
+
_chunkATK2R4CHcjs.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 = _chunkATK2R4CHcjs.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
|
+
_chunkATK2R4CHcjs.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
|
+
_chunkATK2R4CHcjs.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, () => _chunkATK2R4CHcjs.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(_chunkATK2R4CHcjs.readPageState.call(void 0, ));
|
|
132
132
|
}, "handlePopState");
|
|
133
133
|
handlePopState();
|
|
134
|
-
return
|
|
134
|
+
return _chunkATK2R4CHcjs.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
|
+
() => _chunkATK2R4CHcjs.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 _chunkATK2R4CHcjs.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 _chunkATK2R4CHcjs.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 _chunkATK2R4CHcjs.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 =
|
|
199
|
-
const routePathname = i18n ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, pathname, i18n) : pathname;
|
|
198
|
+
const i18n = _chunkFFFW3OQ7cjs.getFarmI18nClientState.call(void 0, );
|
|
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 : _chunkATK2R4CHcjs.readPageState.call(void 0, )
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouterState, "readRouterState");
|
|
@@ -52,6 +52,9 @@ function resolveFarmI18nConfig(input, options = {}) {
|
|
|
52
52
|
if (sameSite !== "lax" && sameSite !== "strict" && sameSite !== "none") {
|
|
53
53
|
throw new Error('i18n.cookie.sameSite must be "lax", "strict", or "none".');
|
|
54
54
|
}
|
|
55
|
+
if (sameSite === "none" && input.cookie?.secure === false) {
|
|
56
|
+
throw new Error('i18n.cookie.secure cannot be false when i18n.cookie.sameSite is "none".');
|
|
57
|
+
}
|
|
55
58
|
const direction = {};
|
|
56
59
|
for (const [rawLocale, value] of Object.entries(input.direction || {})) {
|
|
57
60
|
const locale = canonicalizeLocale(rawLocale);
|
|
@@ -82,7 +85,7 @@ function resolveFarmI18nConfig(input, options = {}) {
|
|
|
82
85
|
),
|
|
83
86
|
path: normalizeCookiePath(input.cookie?.path),
|
|
84
87
|
sameSite,
|
|
85
|
-
secure: input.cookie?.secure ?? options.mode === "production"
|
|
88
|
+
secure: input.cookie?.secure ?? (sameSite === "none" || options.mode === "production")
|
|
86
89
|
},
|
|
87
90
|
direction
|
|
88
91
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
-
var
|
|
3
|
+
var _chunkUX5S4JEOcjs = require('./chunk-UX5S4JEO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
11
11
|
var _url = require('url');
|
|
12
12
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
13
13
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
14
|
-
return
|
|
14
|
+
return _chunkUX5S4JEOcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -25,6 +25,19 @@ function resolveFarmAPICanonicalPathname(pathname, serverBasePath = DEFAULT_FARM
|
|
|
25
25
|
return pathname;
|
|
26
26
|
}
|
|
27
27
|
__name(resolveFarmAPICanonicalPathname, "resolveFarmAPICanonicalPathname");
|
|
28
|
+
function createFarmAPIMiddlewarePathnames(serverBasePath = DEFAULT_FARM_API_BASE_PATH) {
|
|
29
|
+
const basePath = normalizeFarmAPIBasePath(serverBasePath);
|
|
30
|
+
if (basePath === DEFAULT_FARM_API_BASE_PATH) return (pathname) => [pathname];
|
|
31
|
+
const prefix = DEFAULT_FARM_API_BASE_PATH;
|
|
32
|
+
return (pathname) => {
|
|
33
|
+
const canonical = resolveFarmAPICanonicalPathname(pathname, basePath);
|
|
34
|
+
if (canonical !== prefix && !canonical.startsWith(`${prefix}/`)) return [pathname];
|
|
35
|
+
const suffix = canonical.slice(prefix.length);
|
|
36
|
+
const publicPath = basePath === "/" ? suffix || "/" : `${basePath}${suffix}`;
|
|
37
|
+
return [.../* @__PURE__ */ new Set([pathname, canonical, publicPath])];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
__name(createFarmAPIMiddlewarePathnames, "createFarmAPIMiddlewarePathnames");
|
|
28
41
|
function resolveFarmAPIServerRoutePath(routePath, serverBasePath = DEFAULT_FARM_API_BASE_PATH) {
|
|
29
42
|
return resolveFarmAPIRequestURL(routePath, serverBasePath).pathname;
|
|
30
43
|
}
|
|
@@ -33,5 +46,6 @@ __name(resolveFarmAPIServerRoutePath, "resolveFarmAPIServerRoutePath");
|
|
|
33
46
|
export {
|
|
34
47
|
resolveFarmAPIServerBasePath,
|
|
35
48
|
resolveFarmAPICanonicalPathname,
|
|
49
|
+
createFarmAPIMiddlewarePathnames,
|
|
36
50
|
resolveFarmAPIServerRoutePath
|
|
37
51
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/client/navigation-url.ts
|
|
6
|
+
var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
7
|
+
function isFarmBlockedNavigationURL(url) {
|
|
8
|
+
if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
|
|
9
|
+
console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmBlockedNavigationURL, "isFarmBlockedNavigationURL");
|
|
13
|
+
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
14
|
+
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
15
|
+
}
|
|
16
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmExternalNavigationURL, "isFarmExternalNavigationURL");
|
|
17
|
+
function resolveFarmNavigationURL(href, documentUrl) {
|
|
18
|
+
return new URL(href, documentUrl);
|
|
19
|
+
}
|
|
20
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNavigationURL, "resolveFarmNavigationURL");
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.isFarmBlockedNavigationURL = isFarmBlockedNavigationURL; exports.isFarmExternalNavigationURL = isFarmExternalNavigationURL; exports.resolveFarmNavigationURL = resolveFarmNavigationURL;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_hydrateFarmI18n,
|
|
3
3
|
isFarmLocaleChangeHref
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F2SE2VDO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getHashTargetElement
|
|
7
7
|
} from "./chunk-2PQNJXFM.mjs";
|
|
8
8
|
import {
|
|
9
|
+
isFarmBlockedNavigationURL,
|
|
9
10
|
isFarmExternalNavigationURL,
|
|
10
11
|
resolveFarmNavigationURL
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5SJWVY6R.mjs";
|
|
12
13
|
import {
|
|
13
14
|
createClientCancellation
|
|
14
15
|
} from "./chunk-QVYLBY73.mjs";
|
|
@@ -217,6 +218,7 @@ var _SPARouter = class _SPARouter {
|
|
|
217
218
|
refresh = false
|
|
218
219
|
} = options;
|
|
219
220
|
const url = resolveFarmNavigationURL(href, window.location.href);
|
|
221
|
+
if (isFarmBlockedNavigationURL(url)) return;
|
|
220
222
|
const pathname = url.pathname;
|
|
221
223
|
const search = url.search;
|
|
222
224
|
const fullPath = pathname + search;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUXFQ3UDAcjs = require('./chunk-UXFQ3UDA.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
10
10
|
|
|
11
11
|
// src/headers.ts
|
|
12
12
|
function headers() {
|
|
13
|
-
return new Headers(
|
|
13
|
+
return new Headers(_chunkUXFQ3UDAcjs.getCurrentRequest.call(void 0, ).headers);
|
|
14
14
|
}
|
|
15
15
|
_chunkS3JO3N4Hcjs.__name.call(void 0, headers, "headers");
|
|
16
16
|
function cookies() {
|
|
17
|
-
const cookieHeader =
|
|
18
|
-
const parsed =
|
|
17
|
+
const cookieHeader = _chunkUXFQ3UDAcjs.getCurrentRequest.call(void 0, ).headers.get("cookie") || "";
|
|
18
|
+
const parsed = _chunkAI7QMY7Ocjs.parseRequestCookieHeader.call(void 0, cookieHeader);
|
|
19
19
|
return {
|
|
20
20
|
get(name) {
|
|
21
21
|
return parsed.find((cookie) => cookie.name === name);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAWC4VUZLcjs = require('./chunk-AWC4VUZL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkATK2R4CHcjs = require('./chunk-ATK2R4CH.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -13,7 +13,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
13
13
|
|
|
14
14
|
// src/navigation.ts
|
|
15
15
|
function useRouter2() {
|
|
16
|
-
const router =
|
|
16
|
+
const router = _chunkAWC4VUZLcjs.useRouter.call(void 0, );
|
|
17
17
|
return {
|
|
18
18
|
push: router.push,
|
|
19
19
|
replace: router.replace,
|
|
@@ -21,21 +21,21 @@ function useRouter2() {
|
|
|
21
21
|
forward: router.forward,
|
|
22
22
|
refresh() {
|
|
23
23
|
if (typeof window === "undefined") return Promise.resolve();
|
|
24
|
-
return
|
|
24
|
+
return _chunkATK2R4CHcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkATK2R4CHcjs.getRouter.call(void 0, ).prefetch(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter2, "useRouter");
|
|
33
33
|
function usePathname() {
|
|
34
|
-
return
|
|
34
|
+
return _chunkAWC4VUZLcjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkAWC4VUZLcjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|