@farm.js/core 0.1.51-beta.3 → 0.1.60
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-handler-7JSKGSOW.mjs → agent-mcp-handler-7QMX2LUY.mjs} +7 -7
- package/dist/agent-mcp-handler-OV4WRFBL.cjs +18 -0
- package/dist/{agent-mcp.d-BJKChOrO.d.mts → agent-mcp.d-C-2S9bnP.d.mts} +1 -1
- package/dist/{agent-mcp.d-BAR9njbJ.d.ts → agent-mcp.d-SIoCUP1I.d.ts} +1 -1
- package/dist/agent-runtime.cjs +5 -5
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +4 -4
- package/dist/{analyzer-OTPEWH5W.mjs → analyzer-22BEYV7S.mjs} +116 -13
- package/dist/{analyzer-TSQXZCZN.cjs → analyzer-LCSI3NSH.cjs} +123 -20
- package/dist/api/client.cjs +5 -4
- package/dist/api/client.d.mts +1 -1
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.mjs +3 -2
- package/dist/api/client.native.cjs +45 -0
- package/dist/api/client.native.d.mts +23 -0
- package/dist/api/client.native.d.ts +23 -0
- package/dist/api/client.native.mjs +45 -0
- package/dist/api/route-manager.cjs +7 -7
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +6 -6
- package/dist/api/runtime.cjs +5 -5
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +4 -4
- package/dist/{api-client.d-CeA6tNA6.d.mts → api-client.d-BNLXNCXJ.d.mts} +1 -1
- package/dist/{api-client.d-BWcqZciH.d.ts → api-client.d-ddQBNGtu.d.ts} +1 -1
- package/dist/api.cjs +11 -11
- package/dist/api.d.mts +5 -5
- package/dist/api.d.ts +5 -5
- package/dist/api.mjs +10 -10
- package/dist/{app-manifest.d-DEQNnNhV.d.mts → app-manifest.d-DrSAHskY.d.mts} +1 -1
- package/dist/{app-manifest.d-BLFbaqx8.d.ts → app-manifest.d-Tb3CJpL4.d.ts} +1 -1
- package/dist/app-markdown.cjs +7 -7
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +6 -6
- package/dist/{app.d-CNPaUYaa.d.ts → app.d-CmWlYpZJ.d.ts} +9 -4
- package/dist/{app.d-CT7xDkj2.d.mts → app.d-D6QQM_kk.d.mts} +9 -4
- package/dist/{chunk-SN5VSO3Q.mjs → chunk-25T5VXOE.mjs} +7 -9
- package/dist/{chunk-OAMUSC7H.cjs → chunk-2FRLSDBT.cjs} +1 -1
- package/dist/{chunk-LM2YOGDK.mjs → chunk-2I6PUKWJ.mjs} +1 -1
- package/dist/{chunk-ZD2VKAUI.mjs → chunk-2KTYMMWT.mjs} +1 -1
- package/dist/{chunk-B5BBTPJQ.cjs → chunk-2OF5RPVU.cjs} +14 -14
- package/dist/{chunk-UQF3OJVE.mjs → chunk-37PYUEK5.mjs} +173 -29
- package/dist/{chunk-VSLM6BHX.cjs → chunk-3OJNNCDL.cjs} +9 -9
- package/dist/{chunk-X3JNB2TB.mjs → chunk-3PX4AIXO.mjs} +36 -5
- package/dist/{chunk-UQHIWZZ6.cjs → chunk-3TL3AH25.cjs} +12 -6
- package/dist/chunk-3YMLUNL2.cjs +251 -0
- package/dist/chunk-4JTQPOKO.cjs +137 -0
- package/dist/{chunk-7MD37P5V.cjs → chunk-4P23B7DU.cjs} +5 -5
- package/dist/{chunk-3BLEXUGE.mjs → chunk-55U5QIXQ.mjs} +1 -1
- package/dist/{chunk-TWHXBMLJ.cjs → chunk-5JNUYGNF.cjs} +4 -4
- package/dist/{chunk-53SACYBY.cjs → chunk-6BJJYOFL.cjs} +7 -7
- package/dist/chunk-6UUH4N4J.mjs +251 -0
- package/dist/{chunk-2NHOYYUT.mjs → chunk-7H45IJWO.mjs} +2 -2
- package/dist/{chunk-NN3MOPSI.mjs → chunk-A2MN5PQJ.mjs} +7 -7
- package/dist/{chunk-KY32FWK7.mjs → chunk-BHJAYPYU.mjs} +2 -2
- package/dist/{chunk-VAHBCI6X.mjs → chunk-BQWBHWEW.mjs} +26 -1
- package/dist/{chunk-KJMWAUKE.mjs → chunk-C7GJDVN4.mjs} +1 -1
- package/dist/{chunk-OYNNA4DD.cjs → chunk-CBKRS3M4.cjs} +9 -9
- package/dist/{chunk-I2DQGS56.cjs → chunk-CBOEJ5Z4.cjs} +39 -41
- package/dist/{chunk-UJL4JOXV.cjs → chunk-CI4UNQHO.cjs} +2 -2
- package/dist/{chunk-S5AQ7CAC.cjs → chunk-CNNBFGL5.cjs} +39 -14
- package/dist/chunk-D2X5MUF5.cjs +1457 -0
- package/dist/{chunk-LEIXUFJN.cjs → chunk-D4MRNBVF.cjs} +10 -9
- package/dist/{chunk-2KVDHNQS.mjs → chunk-D7LTCK3U.mjs} +2 -2
- package/dist/{chunk-4SEHMBL4.cjs → chunk-DPJ66FSI.cjs} +22 -22
- package/dist/{chunk-FFE2EMF7.cjs → chunk-DZPR2W6U.cjs} +5 -5
- package/dist/{chunk-3Z63X45F.mjs → chunk-E72UD6ME.mjs} +1 -1
- package/dist/{chunk-XXXRRVY6.mjs → chunk-EGVC4LIG.mjs} +5 -5
- package/dist/{chunk-72NBDVWQ.mjs → chunk-EXUONJYV.mjs} +3 -3
- package/dist/{chunk-VS7EHLLW.mjs → chunk-EZ34EHQP.mjs} +1 -1
- package/dist/{chunk-5FXPJIOT.mjs → chunk-F6Y7ZAPQ.mjs} +2 -2
- package/dist/{chunk-LMFJCXDD.mjs → chunk-FN5UEC7I.mjs} +1 -1
- package/dist/{chunk-3SMXQNFD.mjs → chunk-FORSVMEJ.mjs} +2 -2
- package/dist/{chunk-R4PHCZ3G.mjs → chunk-HPWB57PZ.mjs} +1 -1
- package/dist/{chunk-Y2G5SJFB.mjs → chunk-IFHPDLIS.mjs} +1 -1
- package/dist/{chunk-3XQ57EFI.cjs → chunk-IFXSBJPN.cjs} +16 -16
- package/dist/{chunk-3WSIYBMG.mjs → chunk-ILMTRGBG.mjs} +279 -48
- package/dist/{chunk-HLWOWZFX.cjs → chunk-JBK7UJOI.cjs} +14 -11
- package/dist/chunk-JI5D7MXY.mjs +137 -0
- package/dist/{chunk-QXJADAQB.cjs → chunk-JIBEFLQ7.cjs} +6 -2
- package/dist/{chunk-LZ4SB57H.mjs → chunk-JPIUGDK4.mjs} +1 -1
- package/dist/{chunk-Y3N5BFRJ.mjs → chunk-JSDV2NUN.mjs} +1 -1
- package/dist/{chunk-IRSS4HS4.mjs → chunk-K3RU5MOR.mjs} +1 -1
- package/dist/chunk-KPOMS5RO.cjs +237 -0
- package/dist/{chunk-YAJTD3ZG.mjs → chunk-KVW2M6PI.mjs} +1 -1
- package/dist/{chunk-5IONBVJY.cjs → chunk-LB3DPQP6.cjs} +22 -22
- package/dist/{chunk-CZ35L6PL.mjs → chunk-LJVNMGE3.mjs} +10 -4
- package/dist/{chunk-X2AMN2WV.cjs → chunk-LQNW3ABP.cjs} +10 -10
- package/dist/{chunk-6ONBZGVH.cjs → chunk-LRB5OVRT.cjs} +3 -3
- package/dist/{chunk-D7UQC4O6.cjs → chunk-LT4VAF5Z.cjs} +2 -2
- package/dist/{chunk-F6TLUMH7.mjs → chunk-M53MIIXY.mjs} +1 -1
- package/dist/{chunk-H33PJEXN.cjs → chunk-MEQN6DDA.cjs} +5 -5
- package/dist/{chunk-XLRLSTJ6.cjs → chunk-MGKW5XZE.cjs} +7 -7
- package/dist/{chunk-B3GZAQSC.cjs → chunk-MHLNWRCJ.cjs} +3 -3
- package/dist/{chunk-5ENW27SL.mjs → chunk-MMK4MZUN.mjs} +1 -1
- package/dist/{chunk-WGUHDWT5.cjs → chunk-MTWXOEI4.cjs} +527 -366
- package/dist/chunk-NHD7BAKD.mjs +1457 -0
- package/dist/{chunk-KLNFJDFM.cjs → chunk-NQJDO7K7.cjs} +31 -31
- package/dist/{chunk-TSFMFPRU.cjs → chunk-O27PLNQZ.cjs} +10 -10
- package/dist/{chunk-PIHKO25G.mjs → chunk-OM7WILES.mjs} +1 -1
- package/dist/{chunk-YUEYBL35.mjs → chunk-PCXIJKPM.mjs} +8 -8
- package/dist/{chunk-IWFV5ZED.cjs → chunk-PMJSG4JS.cjs} +1 -1
- package/dist/{chunk-B3GM5I6N.cjs → chunk-PRFNLQSP.cjs} +4 -4
- package/dist/{chunk-46KXZBOG.cjs → chunk-QAS7KE7J.cjs} +7 -7
- package/dist/chunk-QGOZLGVP.mjs +0 -0
- package/dist/{chunk-VQJYGZNX.cjs → chunk-QMNWKQL4.cjs} +1 -1
- package/dist/{chunk-XB24LZWI.cjs → chunk-QRX4JRBO.cjs} +3 -3
- package/dist/{chunk-LNM57D3H.cjs → chunk-R53QDV6T.cjs} +4 -4
- package/dist/{chunk-SUV6YO4Q.cjs → chunk-RAWWCDCT.cjs} +5 -5
- package/dist/{chunk-LJDIFIJ2.mjs → chunk-RPUJHJHE.mjs} +4 -4
- package/dist/{chunk-G2KTRMWA.mjs → chunk-RSEAX5MW.mjs} +4 -0
- package/dist/chunk-SJRCWF4Z.mjs +237 -0
- package/dist/{chunk-4353ZRE5.mjs → chunk-SX7EECTS.mjs} +8 -5
- package/dist/{chunk-LDNSSHEG.mjs → chunk-T4TBK5NY.mjs} +2 -2
- package/dist/{chunk-NOTSHVRN.mjs → chunk-T7I62A4C.mjs} +293 -132
- package/dist/{chunk-E36C43IX.cjs → chunk-U4BJKNIR.cjs} +6 -6
- package/dist/{chunk-4CGOMZP3.cjs → chunk-UDJY2ZGY.cjs} +487 -256
- package/dist/{chunk-SHS6KXOZ.mjs → chunk-UR25Z5Z6.mjs} +1 -1
- package/dist/{chunk-TQMI6BYO.cjs → chunk-UYSTTPYJ.cjs} +1262 -936
- package/dist/{chunk-E5DXF5GE.mjs → chunk-UZZ6IEQP.mjs} +3 -3
- package/dist/{chunk-EKJYE4Y7.cjs → chunk-VGG74PSU.cjs} +25 -25
- package/dist/{chunk-GAO7MS5O.mjs → chunk-VPTWKOCY.mjs} +19 -19
- package/dist/{chunk-UN6N623E.mjs → chunk-VQJHT2ND.mjs} +2 -2
- package/dist/{chunk-SJ23LJ3N.cjs → chunk-VVTJTMGQ.cjs} +3 -3
- package/dist/{chunk-KHXAJ2KA.cjs → chunk-W2RZ73IU.cjs} +12 -12
- package/dist/{chunk-JWI5PUO2.mjs → chunk-W2ZXMMHA.mjs} +2 -1
- package/dist/{chunk-BLD5GVCG.mjs → chunk-W6QLRQ3V.mjs} +1 -1
- package/dist/{chunk-AV26KHTG.mjs → chunk-X2CZTWQA.mjs} +2 -2
- package/dist/chunk-XPIPMWY3.cjs +1 -0
- package/dist/{chunk-JXEPLIXD.cjs → chunk-XTG73QZA.cjs} +183 -39
- package/dist/{chunk-XPMC4E2G.cjs → chunk-XVSBALOY.cjs} +3 -3
- package/dist/{chunk-XYL4HSVC.cjs → chunk-YI6FKTTN.cjs} +38 -7
- package/dist/{chunk-LPDKG6RA.mjs → chunk-YSXTNSXS.mjs} +1 -1
- package/dist/{chunk-EHB77D5U.cjs → chunk-ZDAEHG2O.cjs} +3 -3
- package/dist/{chunk-3TLKUBXG.mjs → chunk-ZFUKPWFC.mjs} +912 -586
- package/dist/{chunk-4TKAIO2F.mjs → chunk-ZMHAFH4R.mjs} +8 -8
- package/dist/{chunk-ZOWNWHK6.cjs → chunk-ZNH6NR3H.cjs} +2 -2
- package/dist/{chunk-PFV2KPDZ.cjs → chunk-ZOYKJBP5.cjs} +3 -3
- package/dist/{chunk-CECUDGXQ.cjs → chunk-ZP32GNJQ.cjs} +13 -13
- package/dist/{chunk-MRNDAJEV.mjs → chunk-ZZ2QKCKW.mjs} +1 -1
- package/dist/{client-plugins.d-DllmH8eM.d.mts → client-plugins.d-CgQQ-EAv.d.mts} +10 -2
- package/dist/{client-plugins.d-n3iWY1EJ.d.ts → client-plugins.d-vXrbcfJ1.d.ts} +10 -2
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +9 -9
- package/dist/client.d.mts +9 -9
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +9 -9
- package/dist/{config.d-DqKaCr1r.d.ts → config.d-DqZkLwef.d.mts} +139 -1
- package/dist/{config.d-DqKaCr1r.d.mts → config.d-DqZkLwef.d.ts} +139 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +3 -3
- package/dist/cron.d.mts +10 -0
- package/dist/cron.d.ts +10 -0
- package/dist/cron.mjs +2 -2
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-UESYARTF.mjs → devtools-KQZ6SRCJ.mjs} +16 -16
- package/dist/{devtools-TO6TAO32.cjs → devtools-UF6JYHUN.cjs} +18 -18
- package/dist/docs.cjs +19 -19
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +18 -18
- package/dist/index.cjs +96 -96
- package/dist/{index.d-BXsAXm1U.d.ts → index.d-DlCELfhf.d.ts} +1 -1
- package/dist/{index.d-BL7KKiwa.d.mts → index.d-Dmfb7Kb_.d.mts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +139 -139
- package/dist/integrations.cjs +5 -5
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +4 -4
- package/dist/internal/app-markdown-runtime.cjs +6 -6
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +5 -5
- package/dist/internal/build-runtime.cjs +50 -50
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +49 -49
- package/dist/internal/cli-runtime.cjs +28 -28
- package/dist/internal/cli-runtime.mjs +28 -28
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +20 -15
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/client-runtime.mjs +8 -3
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +18 -18
- package/dist/internal/config-runtime.d.mts +94 -6
- package/dist/internal/config-runtime.d.ts +94 -6
- package/dist/internal/config-runtime.mjs +17 -17
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-boot.cjs +211 -0
- package/dist/internal/islands-boot.d.mts +8 -0
- package/dist/internal/islands-boot.d.ts +8 -0
- package/dist/internal/islands-boot.mjs +211 -0
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +37 -101
- package/dist/internal/production-runtime.d.mts +17 -11
- package/dist/internal/production-runtime.d.ts +17 -11
- package/dist/internal/production-runtime.mjs +47 -111
- package/dist/markdown.cjs +5 -5
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +4 -4
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +9 -9
- package/dist/mobile.d.mts +27 -5
- package/dist/mobile.d.ts +27 -5
- package/dist/modules-VHD7BELU.mjs +13 -0
- package/dist/modules-WT5D3AWY.cjs +13 -0
- package/dist/native-specs-BD7HOTMJ.mjs +15 -0
- package/dist/native-specs-IQQRJOOW.cjs +15 -0
- package/dist/native-tree-6G5O53O3.cjs +27 -0
- package/dist/{native-tree-EBPDFTRW.mjs → native-tree-VWNW2MQ2.mjs} +10 -8
- package/dist/native.cjs +87 -0
- package/dist/native.d.mts +72 -0
- package/dist/native.d.ts +72 -0
- package/dist/native.mjs +87 -0
- package/dist/{navigation-delegate.d-C76gXTmO.d.mts → navigation-delegate.d-CnOTWOyi.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DIyDslxt.d.ts → navigation-delegate.d-JXx40JzR.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-R444AF3O.mjs → nitro-FLN6DRGJ.mjs} +7 -7
- package/dist/{nitro-CK7M4RMY.cjs → nitro-HXAZZQKY.cjs} +12 -12
- package/dist/plugin.cjs +42 -42
- package/dist/plugin.d.mts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.mjs +41 -41
- package/dist/port-C6GBH4C6.cjs +419 -0
- package/dist/port-WOOQ3V56.mjs +419 -0
- package/dist/{production-runtime.d-CDHztggO.d.mts → production-runtime.d-CP5s6RuY.d.mts} +1 -1
- package/dist/{production-runtime.d-tyaGdbk6.d.ts → production-runtime.d-N-cE3pmy.d.ts} +1 -1
- package/dist/{programmatic-routes-client.d-XfmIrCK1.d.ts → programmatic-routes-client.d-CLG2N1yH.d.ts} +2 -2
- package/dist/{programmatic-routes-client.d-aAWiDd64.d.mts → programmatic-routes-client.d-CPbNqtIi.d.mts} +2 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-Dr5WRjoV.d.ts → render-plan.d-B9lAP3uX.d.ts} +1 -1
- package/dist/{render-plan.d-Diwybxo8.d.mts → render-plan.d-DZ-qjjdG.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +6 -6
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request.d-D01fRn--.d.ts → request.d-BiicaNxb.d.ts} +1 -1
- package/dist/{request.d-Dd3AFR79.d.mts → request.d-DV0oeUit.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-BQ53lJ_D.d.mts → route-rendering.d-BrIKA51A.d.mts} +1 -1
- package/dist/{route-rendering.d-Bhx4QoJt.d.ts → route-rendering.d-Iss0C7GR.d.ts} +1 -1
- package/dist/{router.d-DQ3k7EYn.d.ts → router.d-DjGn_al7.d.ts} +1 -1
- package/dist/{router.d-Bi23a6Xc.d.mts → router.d-mNTbOGV_.d.mts} +1 -1
- package/dist/{routes.d-C7jMJFvP.d.ts → routes.d-BKSjHuH9.d.ts} +25 -2
- package/dist/{routes.d-BgTd7vI4.d.mts → routes.d-qd8Qf4LG.d.mts} +25 -2
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-OCZIT5OF.cjs → rsc-pipeline-SVLBTY7H.cjs} +21 -21
- package/dist/{rsc-pipeline-K3ER3Q4N.mjs → rsc-pipeline-WBLBDQXA.mjs} +20 -20
- package/dist/{runtime-DKNSIH7V.cjs → runtime-DGUOWSMF.cjs} +293 -41
- package/dist/{runtime-MKYDEUZT.mjs → runtime-HFZTVNFF.mjs} +283 -31
- package/dist/{runtime.d-B2Js6qZ2.d.mts → runtime.d-BNVbojF1.d.mts} +1 -1
- package/dist/{runtime.d-BL-CGwoi.d.ts → runtime.d-Bm_4hP5T.d.ts} +1 -1
- package/dist/{schema-dev-notice-F6QYSOAI.mjs → schema-dev-notice-JMXEQWIQ.mjs} +3 -3
- package/dist/{schema-dev-notice-UU7DMZEU.cjs → schema-dev-notice-PLBFDTOF.cjs} +6 -6
- package/dist/server-fn-client.d.mts +1 -1
- package/dist/server-fn-client.d.ts +1 -1
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server.cjs +81 -81
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +64 -64
- package/dist/session-2Q72D4QV.cjs +23 -0
- package/dist/{session-IGEDQ5PY.mjs → session-QZXZOPR2.mjs} +2 -2
- package/dist/shell-render.d-CG6bPiiA.d.mts +41 -0
- package/dist/shell-render.d-CG6bPiiA.d.ts +41 -0
- package/dist/{spa-router.d-DqZ6Lfs0.d.ts → spa-router.d-DAtnNoBe.d.ts} +11 -2
- package/dist/{spa-router.d-B2rIFGs0.d.mts → spa-router.d-DHDoXxDE.d.mts} +11 -2
- package/dist/testing.cjs +7 -7
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +6 -6
- package/dist/{utils.d-Bv2MPeLR.d.ts → utils.d-DwZ-KLSB.d.ts} +7 -1
- package/dist/{utils.d-fqXe8lNc.d.mts → utils.d-uKZcKJk4.d.mts} +7 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +42 -42
- package/dist/vite.d.mts +10 -5
- package/dist/vite.d.ts +10 -5
- package/dist/vite.mjs +41 -41
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +17 -3
- package/dist/agent-mcp-handler-YE4AGWHN.cjs +0 -18
- package/dist/chunk-MIGFX2FN.mjs +0 -758
- package/dist/chunk-P6MHI5O2.cjs +0 -758
- package/dist/native-tree-MMZS7S6W.cjs +0 -25
- package/dist/session-AAU7RNRO.cjs +0 -23
- package/dist/{chunk-7FVVQEVL.cjs → chunk-4BS3HSY7.cjs} +2 -2
- package/dist/{chunk-N7JQXQAV.cjs → chunk-5OJVKXFV.cjs} +2 -2
- package/dist/{chunk-WSDKXV4E.mjs → chunk-72KABRWN.mjs} +4 -4
- package/dist/{chunk-C3BOESDW.mjs → chunk-B4CWYGCG.mjs} +3 -3
|
@@ -0,0 +1,1457 @@
|
|
|
1
|
+
// src/mobile/native-theme.ts
|
|
2
|
+
var FARM_NATIVE_THEME = {
|
|
3
|
+
spacing: 4,
|
|
4
|
+
colors: {
|
|
5
|
+
"red-50": "#fef2f2",
|
|
6
|
+
"red-100": "#ffe2e2",
|
|
7
|
+
"red-200": "#ffc9c9",
|
|
8
|
+
"red-300": "#ffa2a2",
|
|
9
|
+
"red-400": "#ff6467",
|
|
10
|
+
"red-500": "#fb2c36",
|
|
11
|
+
"red-600": "#e7000b",
|
|
12
|
+
"red-700": "#c10007",
|
|
13
|
+
"red-800": "#9f0712",
|
|
14
|
+
"red-900": "#82181a",
|
|
15
|
+
"red-950": "#460809",
|
|
16
|
+
"orange-50": "#fff7ed",
|
|
17
|
+
"orange-100": "#ffedd4",
|
|
18
|
+
"orange-200": "#ffd6a7",
|
|
19
|
+
"orange-300": "#ffb86a",
|
|
20
|
+
"orange-400": "#ff8904",
|
|
21
|
+
"orange-500": "#ff6900",
|
|
22
|
+
"orange-600": "#f54900",
|
|
23
|
+
"orange-700": "#ca3500",
|
|
24
|
+
"orange-800": "#9f2d00",
|
|
25
|
+
"orange-900": "#7e2a0c",
|
|
26
|
+
"orange-950": "#441306",
|
|
27
|
+
"amber-50": "#fffbeb",
|
|
28
|
+
"amber-100": "#fef3c6",
|
|
29
|
+
"amber-200": "#fee685",
|
|
30
|
+
"amber-300": "#ffd230",
|
|
31
|
+
"amber-400": "#ffb900",
|
|
32
|
+
"amber-500": "#fe9a00",
|
|
33
|
+
"amber-600": "#e17100",
|
|
34
|
+
"amber-700": "#bb4d00",
|
|
35
|
+
"amber-800": "#973c00",
|
|
36
|
+
"amber-900": "#7b3306",
|
|
37
|
+
"amber-950": "#461901",
|
|
38
|
+
"yellow-50": "#fefce8",
|
|
39
|
+
"yellow-100": "#fef9c2",
|
|
40
|
+
"yellow-200": "#fff085",
|
|
41
|
+
"yellow-300": "#ffdf20",
|
|
42
|
+
"yellow-400": "#fdc700",
|
|
43
|
+
"yellow-500": "#f0b100",
|
|
44
|
+
"yellow-600": "#d08700",
|
|
45
|
+
"yellow-700": "#a65f00",
|
|
46
|
+
"yellow-800": "#894b00",
|
|
47
|
+
"yellow-900": "#733e0a",
|
|
48
|
+
"yellow-950": "#432004",
|
|
49
|
+
"lime-50": "#f7fee7",
|
|
50
|
+
"lime-100": "#ecfcca",
|
|
51
|
+
"lime-200": "#d8f999",
|
|
52
|
+
"lime-300": "#bbf451",
|
|
53
|
+
"lime-400": "#9ae600",
|
|
54
|
+
"lime-500": "#7ccf00",
|
|
55
|
+
"lime-600": "#5ea500",
|
|
56
|
+
"lime-700": "#497d00",
|
|
57
|
+
"lime-800": "#3c6300",
|
|
58
|
+
"lime-900": "#35530e",
|
|
59
|
+
"lime-950": "#192e03",
|
|
60
|
+
"green-50": "#f0fdf4",
|
|
61
|
+
"green-100": "#dcfce7",
|
|
62
|
+
"green-200": "#b9f8cf",
|
|
63
|
+
"green-300": "#7bf1a8",
|
|
64
|
+
"green-400": "#05df72",
|
|
65
|
+
"green-500": "#00c950",
|
|
66
|
+
"green-600": "#00a63e",
|
|
67
|
+
"green-700": "#008236",
|
|
68
|
+
"green-800": "#016630",
|
|
69
|
+
"green-900": "#0d542b",
|
|
70
|
+
"green-950": "#032e15",
|
|
71
|
+
"emerald-50": "#ecfdf5",
|
|
72
|
+
"emerald-100": "#d0fae5",
|
|
73
|
+
"emerald-200": "#a4f4cf",
|
|
74
|
+
"emerald-300": "#5ee9b5",
|
|
75
|
+
"emerald-400": "#00d492",
|
|
76
|
+
"emerald-500": "#00bc7d",
|
|
77
|
+
"emerald-600": "#009966",
|
|
78
|
+
"emerald-700": "#007a55",
|
|
79
|
+
"emerald-800": "#006045",
|
|
80
|
+
"emerald-900": "#004f3b",
|
|
81
|
+
"emerald-950": "#002c22",
|
|
82
|
+
"teal-50": "#f0fdfa",
|
|
83
|
+
"teal-100": "#cbfbf1",
|
|
84
|
+
"teal-200": "#96f7e4",
|
|
85
|
+
"teal-300": "#46ecd5",
|
|
86
|
+
"teal-400": "#00d5be",
|
|
87
|
+
"teal-500": "#00bba7",
|
|
88
|
+
"teal-600": "#009689",
|
|
89
|
+
"teal-700": "#00786f",
|
|
90
|
+
"teal-800": "#005f5a",
|
|
91
|
+
"teal-900": "#0b4f4a",
|
|
92
|
+
"teal-950": "#022f2e",
|
|
93
|
+
"cyan-50": "#ecfeff",
|
|
94
|
+
"cyan-100": "#cefafe",
|
|
95
|
+
"cyan-200": "#a2f4fd",
|
|
96
|
+
"cyan-300": "#53eafd",
|
|
97
|
+
"cyan-400": "#00d3f2",
|
|
98
|
+
"cyan-500": "#00b8db",
|
|
99
|
+
"cyan-600": "#0092b8",
|
|
100
|
+
"cyan-700": "#007595",
|
|
101
|
+
"cyan-800": "#005f78",
|
|
102
|
+
"cyan-900": "#104e64",
|
|
103
|
+
"cyan-950": "#053345",
|
|
104
|
+
"sky-50": "#f0f9ff",
|
|
105
|
+
"sky-100": "#dff2fe",
|
|
106
|
+
"sky-200": "#b8e6fe",
|
|
107
|
+
"sky-300": "#74d4ff",
|
|
108
|
+
"sky-400": "#00bcff",
|
|
109
|
+
"sky-500": "#00a6f4",
|
|
110
|
+
"sky-600": "#0084d1",
|
|
111
|
+
"sky-700": "#0069a8",
|
|
112
|
+
"sky-800": "#00598a",
|
|
113
|
+
"sky-900": "#024a70",
|
|
114
|
+
"sky-950": "#052f4a",
|
|
115
|
+
"blue-50": "#eff6ff",
|
|
116
|
+
"blue-100": "#dbeafe",
|
|
117
|
+
"blue-200": "#bedbff",
|
|
118
|
+
"blue-300": "#8ec5ff",
|
|
119
|
+
"blue-400": "#51a2ff",
|
|
120
|
+
"blue-500": "#2b7fff",
|
|
121
|
+
"blue-600": "#155dfc",
|
|
122
|
+
"blue-700": "#1447e6",
|
|
123
|
+
"blue-800": "#193cb8",
|
|
124
|
+
"blue-900": "#1c398e",
|
|
125
|
+
"blue-950": "#162456",
|
|
126
|
+
"indigo-50": "#eef2ff",
|
|
127
|
+
"indigo-100": "#e0e7ff",
|
|
128
|
+
"indigo-200": "#c6d2ff",
|
|
129
|
+
"indigo-300": "#a3b3ff",
|
|
130
|
+
"indigo-400": "#7c86ff",
|
|
131
|
+
"indigo-500": "#615fff",
|
|
132
|
+
"indigo-600": "#4f39f6",
|
|
133
|
+
"indigo-700": "#432dd7",
|
|
134
|
+
"indigo-800": "#372aac",
|
|
135
|
+
"indigo-900": "#312c85",
|
|
136
|
+
"indigo-950": "#1e1a4d",
|
|
137
|
+
"violet-50": "#f5f3ff",
|
|
138
|
+
"violet-100": "#ede9fe",
|
|
139
|
+
"violet-200": "#ddd6ff",
|
|
140
|
+
"violet-300": "#c4b4ff",
|
|
141
|
+
"violet-400": "#a684ff",
|
|
142
|
+
"violet-500": "#8e51ff",
|
|
143
|
+
"violet-600": "#7f22fe",
|
|
144
|
+
"violet-700": "#7008e7",
|
|
145
|
+
"violet-800": "#5d0ec0",
|
|
146
|
+
"violet-900": "#4d179a",
|
|
147
|
+
"violet-950": "#2f0d68",
|
|
148
|
+
"purple-50": "#faf5ff",
|
|
149
|
+
"purple-100": "#f3e8ff",
|
|
150
|
+
"purple-200": "#e9d4ff",
|
|
151
|
+
"purple-300": "#dab2ff",
|
|
152
|
+
"purple-400": "#c27aff",
|
|
153
|
+
"purple-500": "#ad46ff",
|
|
154
|
+
"purple-600": "#9810fa",
|
|
155
|
+
"purple-700": "#8200db",
|
|
156
|
+
"purple-800": "#6e11b0",
|
|
157
|
+
"purple-900": "#59168b",
|
|
158
|
+
"purple-950": "#3c0366",
|
|
159
|
+
"fuchsia-50": "#fdf4ff",
|
|
160
|
+
"fuchsia-100": "#fae8ff",
|
|
161
|
+
"fuchsia-200": "#f6cfff",
|
|
162
|
+
"fuchsia-300": "#f4a8ff",
|
|
163
|
+
"fuchsia-400": "#ed6aff",
|
|
164
|
+
"fuchsia-500": "#e12afb",
|
|
165
|
+
"fuchsia-600": "#c800de",
|
|
166
|
+
"fuchsia-700": "#a800b7",
|
|
167
|
+
"fuchsia-800": "#8a0194",
|
|
168
|
+
"fuchsia-900": "#721378",
|
|
169
|
+
"fuchsia-950": "#4b004f",
|
|
170
|
+
"pink-50": "#fdf2f8",
|
|
171
|
+
"pink-100": "#fce7f3",
|
|
172
|
+
"pink-200": "#fccee8",
|
|
173
|
+
"pink-300": "#fda5d5",
|
|
174
|
+
"pink-400": "#fb64b6",
|
|
175
|
+
"pink-500": "#f6339a",
|
|
176
|
+
"pink-600": "#e60076",
|
|
177
|
+
"pink-700": "#c6005c",
|
|
178
|
+
"pink-800": "#a3004c",
|
|
179
|
+
"pink-900": "#861043",
|
|
180
|
+
"pink-950": "#510424",
|
|
181
|
+
"rose-50": "#fff1f2",
|
|
182
|
+
"rose-100": "#ffe4e6",
|
|
183
|
+
"rose-200": "#ffccd3",
|
|
184
|
+
"rose-300": "#ffa1ad",
|
|
185
|
+
"rose-400": "#ff637e",
|
|
186
|
+
"rose-500": "#ff2056",
|
|
187
|
+
"rose-600": "#ec003f",
|
|
188
|
+
"rose-700": "#c70036",
|
|
189
|
+
"rose-800": "#a50036",
|
|
190
|
+
"rose-900": "#8b0836",
|
|
191
|
+
"rose-950": "#4d0218",
|
|
192
|
+
"slate-50": "#f8fafc",
|
|
193
|
+
"slate-100": "#f1f5f9",
|
|
194
|
+
"slate-200": "#e2e8f0",
|
|
195
|
+
"slate-300": "#cad5e2",
|
|
196
|
+
"slate-400": "#90a1b9",
|
|
197
|
+
"slate-500": "#62748e",
|
|
198
|
+
"slate-600": "#45556c",
|
|
199
|
+
"slate-700": "#314158",
|
|
200
|
+
"slate-800": "#1d293d",
|
|
201
|
+
"slate-900": "#0f172b",
|
|
202
|
+
"slate-950": "#020618",
|
|
203
|
+
"gray-50": "#f9fafb",
|
|
204
|
+
"gray-100": "#f3f4f6",
|
|
205
|
+
"gray-200": "#e5e7eb",
|
|
206
|
+
"gray-300": "#d1d5dc",
|
|
207
|
+
"gray-400": "#99a1af",
|
|
208
|
+
"gray-500": "#6a7282",
|
|
209
|
+
"gray-600": "#4a5565",
|
|
210
|
+
"gray-700": "#364153",
|
|
211
|
+
"gray-800": "#1e2939",
|
|
212
|
+
"gray-900": "#101828",
|
|
213
|
+
"gray-950": "#030712",
|
|
214
|
+
"zinc-50": "#fafafa",
|
|
215
|
+
"zinc-100": "#f4f4f5",
|
|
216
|
+
"zinc-200": "#e4e4e7",
|
|
217
|
+
"zinc-300": "#d4d4d8",
|
|
218
|
+
"zinc-400": "#9f9fa9",
|
|
219
|
+
"zinc-500": "#71717b",
|
|
220
|
+
"zinc-600": "#52525c",
|
|
221
|
+
"zinc-700": "#3f3f46",
|
|
222
|
+
"zinc-800": "#27272a",
|
|
223
|
+
"zinc-900": "#18181b",
|
|
224
|
+
"zinc-950": "#09090b",
|
|
225
|
+
"neutral-50": "#fafafa",
|
|
226
|
+
"neutral-100": "#f5f5f5",
|
|
227
|
+
"neutral-200": "#e5e5e5",
|
|
228
|
+
"neutral-300": "#d4d4d4",
|
|
229
|
+
"neutral-400": "#a1a1a1",
|
|
230
|
+
"neutral-500": "#737373",
|
|
231
|
+
"neutral-600": "#525252",
|
|
232
|
+
"neutral-700": "#404040",
|
|
233
|
+
"neutral-800": "#262626",
|
|
234
|
+
"neutral-900": "#171717",
|
|
235
|
+
"neutral-950": "#0a0a0a",
|
|
236
|
+
"stone-50": "#fafaf9",
|
|
237
|
+
"stone-100": "#f5f5f4",
|
|
238
|
+
"stone-200": "#e7e5e4",
|
|
239
|
+
"stone-300": "#d6d3d1",
|
|
240
|
+
"stone-400": "#a6a09b",
|
|
241
|
+
"stone-500": "#79716b",
|
|
242
|
+
"stone-600": "#57534d",
|
|
243
|
+
"stone-700": "#44403b",
|
|
244
|
+
"stone-800": "#292524",
|
|
245
|
+
"stone-900": "#1c1917",
|
|
246
|
+
"stone-950": "#0c0a09",
|
|
247
|
+
"mauve-50": "#fafafa",
|
|
248
|
+
"mauve-100": "#f3f1f3",
|
|
249
|
+
"mauve-200": "#e7e4e7",
|
|
250
|
+
"mauve-300": "#d7d0d7",
|
|
251
|
+
"mauve-400": "#a89ea9",
|
|
252
|
+
"mauve-500": "#79697b",
|
|
253
|
+
"mauve-600": "#594c5b",
|
|
254
|
+
"mauve-700": "#463947",
|
|
255
|
+
"mauve-800": "#2a212c",
|
|
256
|
+
"mauve-900": "#1d161e",
|
|
257
|
+
"mauve-950": "#0c090c",
|
|
258
|
+
"olive-50": "#fbfbf9",
|
|
259
|
+
"olive-100": "#f4f4f0",
|
|
260
|
+
"olive-200": "#e8e8e3",
|
|
261
|
+
"olive-300": "#d8d8d0",
|
|
262
|
+
"olive-400": "#abab9c",
|
|
263
|
+
"olive-500": "#7c7c67",
|
|
264
|
+
"olive-600": "#5b5b4b",
|
|
265
|
+
"olive-700": "#474739",
|
|
266
|
+
"olive-800": "#2b2b22",
|
|
267
|
+
"olive-900": "#1d1d16",
|
|
268
|
+
"olive-950": "#0c0c09",
|
|
269
|
+
"mist-50": "#f9fbfb",
|
|
270
|
+
"mist-100": "#f1f3f3",
|
|
271
|
+
"mist-200": "#e3e7e8",
|
|
272
|
+
"mist-300": "#d0d6d8",
|
|
273
|
+
"mist-400": "#9ca8ab",
|
|
274
|
+
"mist-500": "#67787c",
|
|
275
|
+
"mist-600": "#4b585b",
|
|
276
|
+
"mist-700": "#394447",
|
|
277
|
+
"mist-800": "#22292b",
|
|
278
|
+
"mist-900": "#161b1d",
|
|
279
|
+
"mist-950": "#090b0c",
|
|
280
|
+
"taupe-50": "#fbfaf9",
|
|
281
|
+
"taupe-100": "#f3f1f1",
|
|
282
|
+
"taupe-200": "#e8e4e3",
|
|
283
|
+
"taupe-300": "#d8d2d0",
|
|
284
|
+
"taupe-400": "#aba09c",
|
|
285
|
+
"taupe-500": "#7c6d67",
|
|
286
|
+
"taupe-600": "#5b4f4b",
|
|
287
|
+
"taupe-700": "#473c39",
|
|
288
|
+
"taupe-800": "#2b2422",
|
|
289
|
+
"taupe-900": "#1d1816",
|
|
290
|
+
"taupe-950": "#0c0a09",
|
|
291
|
+
black: "#000000",
|
|
292
|
+
white: "#ffffff"
|
|
293
|
+
},
|
|
294
|
+
text: {
|
|
295
|
+
xs: [12, 16],
|
|
296
|
+
sm: [14, 20],
|
|
297
|
+
base: [16, 24],
|
|
298
|
+
lg: [18, 28],
|
|
299
|
+
xl: [20, 28],
|
|
300
|
+
"2xl": [24, 32],
|
|
301
|
+
"3xl": [30, 36],
|
|
302
|
+
"4xl": [36, 40],
|
|
303
|
+
"5xl": [48, 48],
|
|
304
|
+
"6xl": [60, 60],
|
|
305
|
+
"7xl": [72, 72],
|
|
306
|
+
"8xl": [96, 96],
|
|
307
|
+
"9xl": [128, 128]
|
|
308
|
+
},
|
|
309
|
+
fontWeight: {
|
|
310
|
+
thin: 100,
|
|
311
|
+
extralight: 200,
|
|
312
|
+
light: 300,
|
|
313
|
+
normal: 400,
|
|
314
|
+
medium: 500,
|
|
315
|
+
semibold: 600,
|
|
316
|
+
bold: 700,
|
|
317
|
+
extrabold: 800,
|
|
318
|
+
black: 900
|
|
319
|
+
},
|
|
320
|
+
tracking: { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 },
|
|
321
|
+
leading: { tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 2 },
|
|
322
|
+
radius: { xs: 2, sm: 4, md: 6, lg: 8, xl: 12, "2xl": 16, "3xl": 24, "4xl": 32 },
|
|
323
|
+
container: {
|
|
324
|
+
"3xs": 256,
|
|
325
|
+
"2xs": 288,
|
|
326
|
+
xs: 320,
|
|
327
|
+
sm: 384,
|
|
328
|
+
md: 448,
|
|
329
|
+
lg: 512,
|
|
330
|
+
xl: 576,
|
|
331
|
+
"2xl": 672,
|
|
332
|
+
"3xl": 768,
|
|
333
|
+
"4xl": 896,
|
|
334
|
+
"5xl": 1024,
|
|
335
|
+
"6xl": 1152,
|
|
336
|
+
"7xl": 1280
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// src/mobile/native-style.ts
|
|
341
|
+
var FARM_NATIVE_TEXT_KEYS = /* @__PURE__ */ new Set([
|
|
342
|
+
"color",
|
|
343
|
+
"fontSize",
|
|
344
|
+
"lineHeight",
|
|
345
|
+
"fontWeight",
|
|
346
|
+
"fontStyle",
|
|
347
|
+
"fontFamily",
|
|
348
|
+
"textAlign",
|
|
349
|
+
"letterSpacing",
|
|
350
|
+
"textTransform",
|
|
351
|
+
"textDecorationLine",
|
|
352
|
+
// `leading-*`: a multiple of the font size, or a fixed height. Either wins over the line
|
|
353
|
+
// height a `text-*` size sets, as in Tailwind.
|
|
354
|
+
"lineHeightScale",
|
|
355
|
+
"lineHeightPx"
|
|
356
|
+
]);
|
|
357
|
+
var ALL_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
358
|
+
var ALL_CORNERS = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"];
|
|
359
|
+
var each = (keys, value) => Object.fromEntries(keys.map((key) => [key, value]));
|
|
360
|
+
var SIDES = {
|
|
361
|
+
t: ["Top"],
|
|
362
|
+
r: ["Right"],
|
|
363
|
+
b: ["Bottom"],
|
|
364
|
+
l: ["Left"],
|
|
365
|
+
x: ["Left", "Right"],
|
|
366
|
+
y: ["Top", "Bottom"],
|
|
367
|
+
s: ["Left"],
|
|
368
|
+
e: ["Right"]
|
|
369
|
+
};
|
|
370
|
+
var CORNERS = {
|
|
371
|
+
t: ["TopLeft", "TopRight"],
|
|
372
|
+
r: ["TopRight", "BottomRight"],
|
|
373
|
+
b: ["BottomLeft", "BottomRight"],
|
|
374
|
+
l: ["TopLeft", "BottomLeft"],
|
|
375
|
+
tl: ["TopLeft"],
|
|
376
|
+
tr: ["TopRight"],
|
|
377
|
+
br: ["BottomRight"],
|
|
378
|
+
bl: ["BottomLeft"]
|
|
379
|
+
};
|
|
380
|
+
var ALIGN = {
|
|
381
|
+
start: "flex-start",
|
|
382
|
+
end: "flex-end",
|
|
383
|
+
center: "center",
|
|
384
|
+
between: "space-between",
|
|
385
|
+
around: "space-around",
|
|
386
|
+
evenly: "space-evenly",
|
|
387
|
+
stretch: "stretch",
|
|
388
|
+
baseline: "baseline",
|
|
389
|
+
auto: "auto"
|
|
390
|
+
};
|
|
391
|
+
var DROPPED = /^(?:relative|cursor-.+|select-.+|outline-.+|pointer-events-.+)$/;
|
|
392
|
+
var DEFAULT_THEME = FARM_NATIVE_THEME;
|
|
393
|
+
var THEME = DEFAULT_THEME;
|
|
394
|
+
function withTheme(theme, run) {
|
|
395
|
+
const previous = THEME;
|
|
396
|
+
THEME = theme ?? DEFAULT_THEME;
|
|
397
|
+
try {
|
|
398
|
+
return run();
|
|
399
|
+
} finally {
|
|
400
|
+
THEME = previous;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function spacing(value) {
|
|
404
|
+
if (value === "px") return 1;
|
|
405
|
+
if (value === "auto") return "auto";
|
|
406
|
+
if (!/^\d+(?:\.5)?$/.test(value)) return void 0;
|
|
407
|
+
return Number(value) * THEME.spacing;
|
|
408
|
+
}
|
|
409
|
+
function size(value) {
|
|
410
|
+
if (value === "full") return "100%";
|
|
411
|
+
const fraction = /^(\d+)\/(\d+)$/.exec(value);
|
|
412
|
+
if (fraction) return `${Math.round(Number(fraction[1]) / Number(fraction[2]) * 1e4) / 100}%`;
|
|
413
|
+
return spacing(value);
|
|
414
|
+
}
|
|
415
|
+
function color(value) {
|
|
416
|
+
const [name, alpha] = value.split("/");
|
|
417
|
+
if (name === "transparent") return "transparent";
|
|
418
|
+
if (name === "current" || name === "inherit") return "currentColor";
|
|
419
|
+
const hex = THEME.colors[name];
|
|
420
|
+
if (!hex) return void 0;
|
|
421
|
+
if (alpha === void 0) return hex;
|
|
422
|
+
if (!/^\d{1,3}$/.test(alpha) || Number(alpha) > 100) return void 0;
|
|
423
|
+
return `${hex}${Math.round(Number(alpha) / 100 * 255).toString(16).padStart(2, "0")}`;
|
|
424
|
+
}
|
|
425
|
+
function utility(token) {
|
|
426
|
+
if (DROPPED.test(token)) return {};
|
|
427
|
+
switch (token) {
|
|
428
|
+
case "flex":
|
|
429
|
+
return { display: "flex", flexDirection: "row" };
|
|
430
|
+
case "flex-row":
|
|
431
|
+
return { flexDirection: "row" };
|
|
432
|
+
case "flex-col":
|
|
433
|
+
return { flexDirection: "column" };
|
|
434
|
+
case "flex-1":
|
|
435
|
+
return { flexGrow: 1, flexShrink: 1, flexBasis: 0 };
|
|
436
|
+
case "flex-auto":
|
|
437
|
+
return { flexGrow: 1, flexShrink: 1 };
|
|
438
|
+
case "flex-initial":
|
|
439
|
+
return { flexGrow: 0, flexShrink: 1 };
|
|
440
|
+
case "flex-none":
|
|
441
|
+
return { flexGrow: 0, flexShrink: 0 };
|
|
442
|
+
case "grow":
|
|
443
|
+
return { flexGrow: 1 };
|
|
444
|
+
case "grow-0":
|
|
445
|
+
return { flexGrow: 0 };
|
|
446
|
+
case "shrink":
|
|
447
|
+
return { flexShrink: 1 };
|
|
448
|
+
case "shrink-0":
|
|
449
|
+
return { flexShrink: 0 };
|
|
450
|
+
case "flex-nowrap":
|
|
451
|
+
return {};
|
|
452
|
+
case "flex-wrap":
|
|
453
|
+
return { flexWrap: "wrap" };
|
|
454
|
+
case "hidden":
|
|
455
|
+
return { display: "none" };
|
|
456
|
+
case "overflow-hidden":
|
|
457
|
+
return { overflow: "hidden" };
|
|
458
|
+
case "overflow-visible":
|
|
459
|
+
return { overflow: "visible" };
|
|
460
|
+
case "italic":
|
|
461
|
+
return { fontStyle: "italic" };
|
|
462
|
+
case "not-italic":
|
|
463
|
+
return { fontStyle: "normal" };
|
|
464
|
+
case "underline":
|
|
465
|
+
return { textDecorationLine: "underline" };
|
|
466
|
+
case "line-through":
|
|
467
|
+
return { textDecorationLine: "line-through" };
|
|
468
|
+
case "no-underline":
|
|
469
|
+
return { textDecorationLine: "none" };
|
|
470
|
+
case "uppercase":
|
|
471
|
+
case "lowercase":
|
|
472
|
+
case "capitalize":
|
|
473
|
+
return { textTransform: token };
|
|
474
|
+
case "normal-case":
|
|
475
|
+
return { textTransform: "none" };
|
|
476
|
+
case "text-left":
|
|
477
|
+
case "text-center":
|
|
478
|
+
case "text-right":
|
|
479
|
+
case "text-justify":
|
|
480
|
+
return { textAlign: token.slice(5) };
|
|
481
|
+
case "rounded":
|
|
482
|
+
return each(
|
|
483
|
+
ALL_CORNERS.map((corner) => `border${corner}Radius`),
|
|
484
|
+
THEME.radius.sm
|
|
485
|
+
);
|
|
486
|
+
case "border":
|
|
487
|
+
return {
|
|
488
|
+
...each(
|
|
489
|
+
ALL_SIDES.map((side) => `border${side}Width`),
|
|
490
|
+
1
|
|
491
|
+
),
|
|
492
|
+
...each(
|
|
493
|
+
ALL_SIDES.map((side) => `border${side}Color`),
|
|
494
|
+
"currentColor"
|
|
495
|
+
)
|
|
496
|
+
};
|
|
497
|
+
case "border-solid":
|
|
498
|
+
case "border-dashed":
|
|
499
|
+
case "border-dotted":
|
|
500
|
+
return { borderStyle: token.slice(7) };
|
|
501
|
+
case "border-none":
|
|
502
|
+
return { borderStyle: "none" };
|
|
503
|
+
}
|
|
504
|
+
let match = /^(items|justify|self)-([a-z]+)$/.exec(token);
|
|
505
|
+
if (match) {
|
|
506
|
+
const value = ALIGN[match[2]];
|
|
507
|
+
if (!value) return void 0;
|
|
508
|
+
const key = { items: "alignItems", justify: "justifyContent", self: "alignSelf" }[match[1]];
|
|
509
|
+
return { [key]: value };
|
|
510
|
+
}
|
|
511
|
+
match = /^(-?)(p|m)([trblxyse]?)-(.+)$/.exec(token);
|
|
512
|
+
if (match) {
|
|
513
|
+
const value = spacing(match[4]);
|
|
514
|
+
if (value === void 0 || match[2] === "p" && (value === "auto" || match[1]))
|
|
515
|
+
return void 0;
|
|
516
|
+
const signed = match[1] && typeof value === "number" ? -value : value;
|
|
517
|
+
const property = match[2] === "p" ? "padding" : "margin";
|
|
518
|
+
const sides2 = match[3] ? SIDES[match[3]] : ALL_SIDES;
|
|
519
|
+
return each(
|
|
520
|
+
sides2.map((side) => `${property}${side}`),
|
|
521
|
+
signed
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
match = /^gap(-[xy])?-(.+)$/.exec(token);
|
|
525
|
+
if (match) {
|
|
526
|
+
const value = spacing(match[2]);
|
|
527
|
+
if (typeof value !== "number") return void 0;
|
|
528
|
+
if (match[1] === "-x") return { columnGap: value };
|
|
529
|
+
if (match[1] === "-y") return { rowGap: value };
|
|
530
|
+
return { rowGap: value, columnGap: value };
|
|
531
|
+
}
|
|
532
|
+
match = /^(w|h|size|min-w|min-h|max-h)-(.+)$/.exec(token);
|
|
533
|
+
if (match) {
|
|
534
|
+
const value = size(match[2]);
|
|
535
|
+
if (value === void 0 || value === "auto" && match[1].includes("-")) return void 0;
|
|
536
|
+
if (match[1] === "size") return { width: value, height: value };
|
|
537
|
+
const key = {
|
|
538
|
+
w: "width",
|
|
539
|
+
h: "height",
|
|
540
|
+
"min-w": "minWidth",
|
|
541
|
+
"min-h": "minHeight",
|
|
542
|
+
"max-h": "maxHeight"
|
|
543
|
+
}[match[1]];
|
|
544
|
+
return value === "auto" ? {} : { [key]: value };
|
|
545
|
+
}
|
|
546
|
+
match = /^max-w-(.+)$/.exec(token);
|
|
547
|
+
if (match) {
|
|
548
|
+
if (match[1] === "none") return {};
|
|
549
|
+
if (match[1] === "full") return { maxWidth: "100%" };
|
|
550
|
+
const value = THEME.container[match[1]];
|
|
551
|
+
return value === void 0 ? void 0 : { maxWidth: value };
|
|
552
|
+
}
|
|
553
|
+
match = /^text-(.+)$/.exec(token);
|
|
554
|
+
if (match) {
|
|
555
|
+
const text = THEME.text[match[1]];
|
|
556
|
+
if (text) {
|
|
557
|
+
return Number.isFinite(text[1]) ? { fontSize: text[0], lineHeight: text[1] } : { fontSize: text[0] };
|
|
558
|
+
}
|
|
559
|
+
const value = color(match[1]);
|
|
560
|
+
return value === void 0 ? void 0 : { color: value };
|
|
561
|
+
}
|
|
562
|
+
match = /^font-(.+)$/.exec(token);
|
|
563
|
+
if (match) {
|
|
564
|
+
if (match[1] === "sans" || match[1] === "serif" || match[1] === "mono") {
|
|
565
|
+
return { fontFamily: match[1] };
|
|
566
|
+
}
|
|
567
|
+
const weight = THEME.fontWeight[match[1]];
|
|
568
|
+
return weight === void 0 ? void 0 : { fontWeight: weight };
|
|
569
|
+
}
|
|
570
|
+
match = /^leading-(.+)$/.exec(token);
|
|
571
|
+
if (match) {
|
|
572
|
+
if (match[1] === "none") return { lineHeightScale: 1 };
|
|
573
|
+
const scale = THEME.leading[match[1]];
|
|
574
|
+
if (scale !== void 0) return { lineHeightScale: scale };
|
|
575
|
+
const value = spacing(match[1]);
|
|
576
|
+
return typeof value === "number" ? { lineHeightPx: value } : void 0;
|
|
577
|
+
}
|
|
578
|
+
match = /^tracking-(.+)$/.exec(token);
|
|
579
|
+
if (match) {
|
|
580
|
+
const value = THEME.tracking[match[1]];
|
|
581
|
+
return value === void 0 ? void 0 : { letterSpacing: value };
|
|
582
|
+
}
|
|
583
|
+
match = /^bg-(.+)$/.exec(token);
|
|
584
|
+
if (match) {
|
|
585
|
+
const value = color(match[1]);
|
|
586
|
+
return value === void 0 ? void 0 : { backgroundColor: value };
|
|
587
|
+
}
|
|
588
|
+
match = /^border-([trblxy])$/.exec(token);
|
|
589
|
+
if (match) {
|
|
590
|
+
return each(
|
|
591
|
+
SIDES[match[1]].map((side) => `border${side}Width`),
|
|
592
|
+
1
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
match = /^border(?:-([trblxy]))?-(.+)$/.exec(token);
|
|
596
|
+
if (match) {
|
|
597
|
+
const sides2 = match[1] ? SIDES[match[1]] : ALL_SIDES;
|
|
598
|
+
if (/^(?:0|2|4|8)$/.test(match[2])) {
|
|
599
|
+
return Object.fromEntries(sides2.map((side) => [`border${side}Width`, Number(match[2])]));
|
|
600
|
+
}
|
|
601
|
+
const value = color(match[2]);
|
|
602
|
+
if (value === void 0) return void 0;
|
|
603
|
+
return Object.fromEntries(sides2.map((side) => [`border${side}Color`, value]));
|
|
604
|
+
}
|
|
605
|
+
match = /^rounded(?:-([trbl]{1,2}))?(?:-([a-z0-9]+))?$/.exec(token);
|
|
606
|
+
if (match) {
|
|
607
|
+
const radius = match[2] === void 0 ? THEME.radius.sm : match[2] === "none" ? 0 : match[2] === "full" ? 9999 : THEME.radius[match[2]];
|
|
608
|
+
if (radius === void 0) return void 0;
|
|
609
|
+
const corners = match[1] ? CORNERS[match[1]] : [...ALL_CORNERS];
|
|
610
|
+
if (!corners) return void 0;
|
|
611
|
+
return Object.fromEntries(corners.map((corner) => [`border${corner}Radius`, radius]));
|
|
612
|
+
}
|
|
613
|
+
match = /^opacity-(\d{1,3})$/.exec(token);
|
|
614
|
+
if (match && Number(match[1]) <= 100) return { opacity: Number(match[1]) / 100 };
|
|
615
|
+
return void 0;
|
|
616
|
+
}
|
|
617
|
+
function farmNativeClassProblem(token, theme) {
|
|
618
|
+
return withTheme(theme, () => classProblem(token));
|
|
619
|
+
}
|
|
620
|
+
function classProblem(token) {
|
|
621
|
+
const parts = token.split(":");
|
|
622
|
+
const base = parts.pop().replace(/^!/, "");
|
|
623
|
+
if (parts.some((variant) => variant !== "dark")) {
|
|
624
|
+
return `"${token}" needs a variant the native tier cannot apply`;
|
|
625
|
+
}
|
|
626
|
+
if (base.includes("[")) return `"${token}" is an arbitrary value`;
|
|
627
|
+
return utility(base) === void 0 ? `class "${token}" has no native-tier style` : void 0;
|
|
628
|
+
}
|
|
629
|
+
function resolveFarmNativeClasses(className, theme) {
|
|
630
|
+
return withTheme(theme, () => resolveClasses(className));
|
|
631
|
+
}
|
|
632
|
+
function resolveClasses(className) {
|
|
633
|
+
const light = [];
|
|
634
|
+
const darkParts = [];
|
|
635
|
+
const themedDark = [];
|
|
636
|
+
const darkTheme = THEME.darkColors ? { ...THEME, colors: { ...THEME.colors, ...THEME.darkColors } } : void 0;
|
|
637
|
+
const unsupported = [];
|
|
638
|
+
for (const token of className.split(/\s+/)) {
|
|
639
|
+
if (!token) continue;
|
|
640
|
+
if (classProblem(token)) {
|
|
641
|
+
unsupported.push(token);
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
const parts = token.split(":");
|
|
645
|
+
const base = parts.pop().replace(/^!/, "");
|
|
646
|
+
const resolved = utility(base);
|
|
647
|
+
(parts.length > 0 ? darkParts : light).push(resolved);
|
|
648
|
+
if (parts.length === 0 && darkTheme) {
|
|
649
|
+
const lightTheme = THEME;
|
|
650
|
+
THEME = darkTheme;
|
|
651
|
+
const dark2 = utility(base);
|
|
652
|
+
THEME = lightTheme;
|
|
653
|
+
if (dark2 && JSON.stringify(dark2) !== JSON.stringify(resolved)) themedDark.push(dark2);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
const merge = (parts) => Object.assign(
|
|
657
|
+
{},
|
|
658
|
+
...parts.sort((left, right) => Object.keys(right).length - Object.keys(left).length)
|
|
659
|
+
);
|
|
660
|
+
const style = merge(light);
|
|
661
|
+
const dark = { ...merge(themedDark), ...merge(darkParts) };
|
|
662
|
+
return { style, ...Object.keys(dark).length > 0 ? { dark } : {}, unsupported };
|
|
663
|
+
}
|
|
664
|
+
function longhands(style) {
|
|
665
|
+
const [[key, value]] = Object.entries(style);
|
|
666
|
+
if (key === "gap") return { rowGap: value, columnGap: value };
|
|
667
|
+
if (key === "borderWidth")
|
|
668
|
+
return each(
|
|
669
|
+
ALL_SIDES.map((side) => `border${side}Width`),
|
|
670
|
+
value
|
|
671
|
+
);
|
|
672
|
+
if (key === "borderColor")
|
|
673
|
+
return each(
|
|
674
|
+
ALL_SIDES.map((side) => `border${side}Color`),
|
|
675
|
+
value
|
|
676
|
+
);
|
|
677
|
+
if (key === "borderRadius") {
|
|
678
|
+
return each(
|
|
679
|
+
ALL_CORNERS.map((corner) => `border${corner}Radius`),
|
|
680
|
+
value
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
return style;
|
|
684
|
+
}
|
|
685
|
+
var PX = /^(-?\d*\.?\d+)px$/;
|
|
686
|
+
function cssLength(value) {
|
|
687
|
+
if (value === "0") return 0;
|
|
688
|
+
if (value === "auto") return "auto";
|
|
689
|
+
const px = PX.exec(value);
|
|
690
|
+
if (px) return Number(px[1]);
|
|
691
|
+
if (/^-?\d*\.?\d+%$/.test(value)) return value;
|
|
692
|
+
const rem = /^(-?\d*\.?\d+)rem$/.exec(value);
|
|
693
|
+
return rem ? Number(rem[1]) * 16 : void 0;
|
|
694
|
+
}
|
|
695
|
+
var CSS_LENGTHS = new Set(
|
|
696
|
+
"gap row-gap column-gap padding-top padding-right padding-bottom padding-left margin-top margin-right margin-bottom margin-left width height min-width min-height max-width max-height border-width border-top-width border-right-width border-bottom-width border-left-width border-radius font-size line-height letter-spacing flex-basis".split(" ")
|
|
697
|
+
);
|
|
698
|
+
var CSS_KEYWORDS = {
|
|
699
|
+
display: /* @__PURE__ */ new Set(["flex", "none"]),
|
|
700
|
+
"flex-direction": /* @__PURE__ */ new Set(["row", "column"]),
|
|
701
|
+
"align-items": /* @__PURE__ */ new Set(["flex-start", "flex-end", "center", "stretch", "baseline"]),
|
|
702
|
+
"align-self": /* @__PURE__ */ new Set(["auto", "flex-start", "flex-end", "center", "stretch", "baseline"]),
|
|
703
|
+
"justify-content": /* @__PURE__ */ new Set([
|
|
704
|
+
"flex-start",
|
|
705
|
+
"flex-end",
|
|
706
|
+
"center",
|
|
707
|
+
"space-between",
|
|
708
|
+
"space-around",
|
|
709
|
+
"space-evenly"
|
|
710
|
+
]),
|
|
711
|
+
"font-style": /* @__PURE__ */ new Set(["normal", "italic"]),
|
|
712
|
+
"text-align": /* @__PURE__ */ new Set(["left", "center", "right", "justify"]),
|
|
713
|
+
"text-transform": /* @__PURE__ */ new Set(["none", "uppercase", "lowercase", "capitalize"]),
|
|
714
|
+
"text-decoration-line": /* @__PURE__ */ new Set(["none", "underline", "line-through"]),
|
|
715
|
+
"border-style": /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "none"]),
|
|
716
|
+
overflow: /* @__PURE__ */ new Set(["hidden", "visible"])
|
|
717
|
+
};
|
|
718
|
+
var CSS_COLORS = /* @__PURE__ */ new Set(["color", "background-color", "border-color"]);
|
|
719
|
+
var CSS_NUMBERS = /* @__PURE__ */ new Set(["opacity", "flex-grow", "flex-shrink", "font-weight"]);
|
|
720
|
+
var SHORTHAND_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
721
|
+
var FARM_NATIVE_STYLE_PROPERTIES = new Set(
|
|
722
|
+
[
|
|
723
|
+
...CSS_LENGTHS,
|
|
724
|
+
...CSS_COLORS,
|
|
725
|
+
...CSS_NUMBERS,
|
|
726
|
+
...Object.keys(CSS_KEYWORDS),
|
|
727
|
+
"padding",
|
|
728
|
+
"margin",
|
|
729
|
+
"flex",
|
|
730
|
+
"flex-wrap"
|
|
731
|
+
].map((property) => property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()))
|
|
732
|
+
);
|
|
733
|
+
function camel(property) {
|
|
734
|
+
return property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
735
|
+
}
|
|
736
|
+
function cssColor(value) {
|
|
737
|
+
if (/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value)) return value.toLowerCase();
|
|
738
|
+
if (value === "transparent" || value === "currentcolor") {
|
|
739
|
+
return value === "currentcolor" ? "currentColor" : value;
|
|
740
|
+
}
|
|
741
|
+
const rgb = /^rgba?\((\d{1,3})[ ,]+(\d{1,3})[ ,]+(\d{1,3})(?:[ ,/]+([\d.]+%?))?\)$/i.exec(value);
|
|
742
|
+
if (!rgb) return value === "white" ? "#ffffff" : value === "black" ? "#000000" : void 0;
|
|
743
|
+
const hex = rgb.slice(1, 4).map((channel) => Math.min(255, Number(channel)).toString(16).padStart(2, "0")).join("");
|
|
744
|
+
if (rgb[4] === void 0) return `#${hex}`;
|
|
745
|
+
const alpha = rgb[4].endsWith("%") ? Number(rgb[4].slice(0, -1)) / 100 : Number(rgb[4]);
|
|
746
|
+
return `#${hex}${Math.round(Math.min(1, alpha) * 255).toString(16).padStart(2, "0")}`;
|
|
747
|
+
}
|
|
748
|
+
var IGNORED_PROPERTIES = /* @__PURE__ */ new Set([
|
|
749
|
+
// No effect on a static, touch-only screen, or the shell owns it.
|
|
750
|
+
"cursor",
|
|
751
|
+
"outline",
|
|
752
|
+
"outline-offset",
|
|
753
|
+
"user-select",
|
|
754
|
+
"-webkit-user-select",
|
|
755
|
+
"-webkit-tap-highlight-color",
|
|
756
|
+
"pointer-events",
|
|
757
|
+
"box-sizing",
|
|
758
|
+
"color-scheme",
|
|
759
|
+
"appearance",
|
|
760
|
+
"-webkit-appearance",
|
|
761
|
+
"transition",
|
|
762
|
+
"transition-property",
|
|
763
|
+
"transition-duration",
|
|
764
|
+
"transition-timing-function",
|
|
765
|
+
"will-change",
|
|
766
|
+
"-webkit-font-smoothing",
|
|
767
|
+
"-moz-osx-font-smoothing",
|
|
768
|
+
"text-rendering"
|
|
769
|
+
]);
|
|
770
|
+
var BORDER_STYLES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "none"]);
|
|
771
|
+
function sides(property, values) {
|
|
772
|
+
const [top, right = top, bottom = top, left = right] = values;
|
|
773
|
+
const ordered = [top, right, bottom, left];
|
|
774
|
+
return Object.fromEntries(
|
|
775
|
+
SHORTHAND_SIDES.map((side, index) => [property.replace("*", side), ordered[index]])
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
function border(value, side) {
|
|
779
|
+
const keys = side ? [side] : SHORTHAND_SIDES;
|
|
780
|
+
if (value === "none" || value === "0")
|
|
781
|
+
return each(
|
|
782
|
+
keys.map((key) => `border${key}Width`),
|
|
783
|
+
0
|
|
784
|
+
);
|
|
785
|
+
let width;
|
|
786
|
+
let style;
|
|
787
|
+
let color2;
|
|
788
|
+
for (const part of value.split(/\s+(?![^(]*\))/)) {
|
|
789
|
+
if (BORDER_STYLES.has(part)) style = part;
|
|
790
|
+
else if (cssLength(part) !== void 0 && width === void 0) width = cssLength(part);
|
|
791
|
+
else if (part === "thin") width = 1;
|
|
792
|
+
else if (cssColor(part)) color2 = cssColor(part);
|
|
793
|
+
else return void 0;
|
|
794
|
+
}
|
|
795
|
+
return {
|
|
796
|
+
...each(
|
|
797
|
+
keys.map((key) => `border${key}Width`),
|
|
798
|
+
style === "none" ? 0 : width ?? 3
|
|
799
|
+
),
|
|
800
|
+
...color2 ? each(
|
|
801
|
+
keys.map((key) => `border${key}Color`),
|
|
802
|
+
color2
|
|
803
|
+
) : {},
|
|
804
|
+
...style ? { borderStyle: style } : {}
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
function resolveFarmNativeDeclaration(property, value) {
|
|
808
|
+
if (IGNORED_PROPERTIES.has(property) || value === "inherit" || value === "unset") return null;
|
|
809
|
+
switch (property) {
|
|
810
|
+
case "padding":
|
|
811
|
+
case "margin": {
|
|
812
|
+
const parts = value.split(/\s+/).map(cssLength);
|
|
813
|
+
if (parts.length > 4 || parts.some((part) => part === void 0)) return void 0;
|
|
814
|
+
if (property === "padding" && parts.includes("auto")) return void 0;
|
|
815
|
+
return sides(`${property}*`, parts);
|
|
816
|
+
}
|
|
817
|
+
case "gap": {
|
|
818
|
+
const parts = value.split(/\s+/).map(cssLength);
|
|
819
|
+
if (parts.length > 2 || parts.some((part) => typeof part !== "number")) return void 0;
|
|
820
|
+
return { rowGap: parts[0], columnGap: parts[1] ?? parts[0] };
|
|
821
|
+
}
|
|
822
|
+
case "border-radius": {
|
|
823
|
+
const parts = value.split(/\s+/).map(cssLength);
|
|
824
|
+
if (parts.length > 4 || parts.some((part) => typeof part !== "number")) return void 0;
|
|
825
|
+
const [a, b = a, c = a, d = b] = parts;
|
|
826
|
+
return {
|
|
827
|
+
borderTopLeftRadius: a,
|
|
828
|
+
borderTopRightRadius: b,
|
|
829
|
+
borderBottomRightRadius: c,
|
|
830
|
+
borderBottomLeftRadius: d
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
case "border":
|
|
834
|
+
return border(value, "");
|
|
835
|
+
case "border-top":
|
|
836
|
+
case "border-right":
|
|
837
|
+
case "border-bottom":
|
|
838
|
+
case "border-left":
|
|
839
|
+
return border(value, property[7].toUpperCase() + property.slice(8));
|
|
840
|
+
case "background-color": {
|
|
841
|
+
const parsed = cssColor(value);
|
|
842
|
+
return parsed ? { backgroundColor: parsed } : void 0;
|
|
843
|
+
}
|
|
844
|
+
case "background": {
|
|
845
|
+
const parsed = cssColor(value);
|
|
846
|
+
if (parsed) return { backgroundColor: parsed };
|
|
847
|
+
return value.split(/\s+/).every((part) => /^(?:none|0(?:%|px)?)$/.test(part)) ? { backgroundColor: "transparent" } : void 0;
|
|
848
|
+
}
|
|
849
|
+
case "display":
|
|
850
|
+
if (value === "flex" || value === "inline-flex") return { display: "flex" };
|
|
851
|
+
if (value === "block" || value === "flow-root") return {};
|
|
852
|
+
return value === "none" ? { display: "none" } : void 0;
|
|
853
|
+
case "flex-wrap":
|
|
854
|
+
return value === "nowrap" ? {} : value === "wrap" ? { flexWrap: "wrap" } : void 0;
|
|
855
|
+
case "flex":
|
|
856
|
+
if (/^\d+$/.test(value)) return { flexGrow: Number(value), flexShrink: 1, flexBasis: 0 };
|
|
857
|
+
if (value === "none") return { flexGrow: 0, flexShrink: 0 };
|
|
858
|
+
if (value === "auto") return { flexGrow: 1, flexShrink: 1 };
|
|
859
|
+
return void 0;
|
|
860
|
+
case "font":
|
|
861
|
+
return void 0;
|
|
862
|
+
case "font-family":
|
|
863
|
+
return {
|
|
864
|
+
fontFamily: /mono/.test(value) ? "mono" : /(?:^|,\s*)serif\b|georgia|times/.test(value) ? "serif" : "sans"
|
|
865
|
+
};
|
|
866
|
+
case "font-weight":
|
|
867
|
+
if (value === "bold") return { fontWeight: 700 };
|
|
868
|
+
if (value === "normal") return { fontWeight: 400 };
|
|
869
|
+
return /^\d{3}$/.test(value) ? { fontWeight: Number(value) } : void 0;
|
|
870
|
+
case "line-height":
|
|
871
|
+
if (/^\d*\.?\d+$/.test(value)) return { lineHeightScale: Number(value) };
|
|
872
|
+
if (value === "normal") return null;
|
|
873
|
+
return typeof cssLength(value) === "number" ? { lineHeightPx: cssLength(value) } : void 0;
|
|
874
|
+
case "text-decoration":
|
|
875
|
+
case "text-decoration-line":
|
|
876
|
+
return CSS_KEYWORDS["text-decoration-line"].has(value) ? { textDecorationLine: value } : void 0;
|
|
877
|
+
case "list-style":
|
|
878
|
+
case "list-style-type":
|
|
879
|
+
return value === "none" ? null : void 0;
|
|
880
|
+
case "align-items":
|
|
881
|
+
case "align-self":
|
|
882
|
+
case "justify-content":
|
|
883
|
+
value = value === "start" ? "flex-start" : value === "end" ? "flex-end" : value;
|
|
884
|
+
break;
|
|
885
|
+
case "text-align":
|
|
886
|
+
value = value === "start" ? "left" : value === "end" ? "right" : value;
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
if (CSS_LENGTHS.has(property)) {
|
|
890
|
+
const length = cssLength(value);
|
|
891
|
+
return length === void 0 ? void 0 : longhands({ [camel(property)]: length });
|
|
892
|
+
}
|
|
893
|
+
if (CSS_COLORS.has(property)) {
|
|
894
|
+
const parsed = cssColor(value);
|
|
895
|
+
return parsed ? longhands({ [camel(property)]: parsed }) : void 0;
|
|
896
|
+
}
|
|
897
|
+
if (CSS_NUMBERS.has(property)) {
|
|
898
|
+
return /^\d*\.?\d+$/.test(value) ? { [camel(property)]: Number(value) } : void 0;
|
|
899
|
+
}
|
|
900
|
+
if (CSS_KEYWORDS[property]?.has(value)) return { [camel(property)]: value };
|
|
901
|
+
return void 0;
|
|
902
|
+
}
|
|
903
|
+
function splitFarmCssDeclarations(css) {
|
|
904
|
+
const out = [];
|
|
905
|
+
let depth = 0;
|
|
906
|
+
let start = 0;
|
|
907
|
+
const push = (end) => {
|
|
908
|
+
const text = css.slice(start, end);
|
|
909
|
+
const colon = text.indexOf(":");
|
|
910
|
+
if (colon > 0) {
|
|
911
|
+
out.push([
|
|
912
|
+
text.slice(0, colon).trim().toLowerCase(),
|
|
913
|
+
text.slice(colon + 1).replace(/\s*!important\s*$/i, "").trim()
|
|
914
|
+
]);
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
for (let index = 0; index < css.length; index += 1) {
|
|
918
|
+
const char = css[index];
|
|
919
|
+
if (char === "(") depth += 1;
|
|
920
|
+
else if (char === ")") depth = Math.max(0, depth - 1);
|
|
921
|
+
else if (char === ";" && depth === 0) {
|
|
922
|
+
push(index);
|
|
923
|
+
start = index + 1;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
push(css.length);
|
|
927
|
+
return out;
|
|
928
|
+
}
|
|
929
|
+
function resolveFarmNativeInlineStyle(css) {
|
|
930
|
+
const style = {};
|
|
931
|
+
const unsupported = [];
|
|
932
|
+
for (const [property, raw] of splitFarmCssDeclarations(css)) {
|
|
933
|
+
const value = raw.toLowerCase();
|
|
934
|
+
if (!property) continue;
|
|
935
|
+
const resolved = resolveFarmNativeDeclaration(property, value);
|
|
936
|
+
if (resolved) Object.assign(style, resolved);
|
|
937
|
+
else if (resolved === void 0) unsupported.push(`${property}: ${value}`);
|
|
938
|
+
}
|
|
939
|
+
return { style, unsupported };
|
|
940
|
+
}
|
|
941
|
+
function oklchToHex(value) {
|
|
942
|
+
const match = /^oklch\(\s*([\d.]+)(%?)\s+([\d.]+)\s+([\d.]+|none)(?:deg)?\s*(?:\/\s*([\d.]+)(%?))?\s*\)$/.exec(
|
|
943
|
+
value
|
|
944
|
+
);
|
|
945
|
+
if (!match) return void 0;
|
|
946
|
+
const l = Number(match[1]) / (match[2] ? 100 : 1);
|
|
947
|
+
const c = Number(match[3]);
|
|
948
|
+
const h = (match[4] === "none" ? 0 : Number(match[4])) * Math.PI / 180;
|
|
949
|
+
const a = c * Math.cos(h);
|
|
950
|
+
const b = c * Math.sin(h);
|
|
951
|
+
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
952
|
+
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
953
|
+
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
954
|
+
const linear = [
|
|
955
|
+
4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,
|
|
956
|
+
-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,
|
|
957
|
+
-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_
|
|
958
|
+
];
|
|
959
|
+
const hex = linear.map((channel) => {
|
|
960
|
+
const clamped = Math.min(1, Math.max(0, channel));
|
|
961
|
+
const gamma = clamped <= 31308e-7 ? 12.92 * clamped : 1.055 * clamped ** (1 / 2.4) - 0.055;
|
|
962
|
+
return Math.round(gamma * 255).toString(16).padStart(2, "0");
|
|
963
|
+
}).join("");
|
|
964
|
+
if (match[5] === void 0) return `#${hex}`;
|
|
965
|
+
const alpha = Number(match[5]) / (match[6] ? 100 : 1);
|
|
966
|
+
return `#${hex}${Math.round(Math.min(1, alpha) * 255).toString(16).padStart(2, "0")}`;
|
|
967
|
+
}
|
|
968
|
+
function themeColor(value) {
|
|
969
|
+
const parsed = cssColor(value.toLowerCase());
|
|
970
|
+
if (parsed && parsed !== "currentColor") return parsed;
|
|
971
|
+
return oklchToHex(value.toLowerCase());
|
|
972
|
+
}
|
|
973
|
+
function themeLength(value) {
|
|
974
|
+
const length = cssLength(value.trim());
|
|
975
|
+
return typeof length === "number" ? length : void 0;
|
|
976
|
+
}
|
|
977
|
+
function createFarmNativeTheme(declarations, vars = {
|
|
978
|
+
light: {},
|
|
979
|
+
dark: {}
|
|
980
|
+
}) {
|
|
981
|
+
const theme = {
|
|
982
|
+
spacing: DEFAULT_THEME.spacing,
|
|
983
|
+
colors: { ...DEFAULT_THEME.colors },
|
|
984
|
+
darkColors: {},
|
|
985
|
+
text: { ...DEFAULT_THEME.text },
|
|
986
|
+
fontWeight: { ...DEFAULT_THEME.fontWeight },
|
|
987
|
+
tracking: { ...DEFAULT_THEME.tracking },
|
|
988
|
+
leading: { ...DEFAULT_THEME.leading },
|
|
989
|
+
radius: { ...DEFAULT_THEME.radius },
|
|
990
|
+
container: { ...DEFAULT_THEME.container }
|
|
991
|
+
};
|
|
992
|
+
const namespaces = [
|
|
993
|
+
["color-", "colors"],
|
|
994
|
+
["text-", "text"],
|
|
995
|
+
["font-weight-", "fontWeight"],
|
|
996
|
+
["tracking-", "tracking"],
|
|
997
|
+
["leading-", "leading"],
|
|
998
|
+
["radius-", "radius"],
|
|
999
|
+
["container-", "container"]
|
|
1000
|
+
];
|
|
1001
|
+
const resolve = (value, scheme, depth = 0) => {
|
|
1002
|
+
const reference = /^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(value.trim());
|
|
1003
|
+
if (!reference) return value.trim();
|
|
1004
|
+
if (depth > 8) return void 0;
|
|
1005
|
+
const name = reference[1];
|
|
1006
|
+
const next = (scheme === "dark" ? vars.dark[name] ?? vars.light[name] : vars.light[name]) ?? reference[2];
|
|
1007
|
+
return next === void 0 ? void 0 : resolve(next, scheme, depth + 1);
|
|
1008
|
+
};
|
|
1009
|
+
const lineHeights = [];
|
|
1010
|
+
for (const [rawName, value] of declarations) {
|
|
1011
|
+
const name = rawName.replace(/^--/, "");
|
|
1012
|
+
if (value.trim() === "initial") {
|
|
1013
|
+
if (name === "*") {
|
|
1014
|
+
for (const [, key] of namespaces) theme[key] = {};
|
|
1015
|
+
continue;
|
|
1016
|
+
}
|
|
1017
|
+
for (const [prefix, key] of namespaces) {
|
|
1018
|
+
if (!name.startsWith(prefix)) continue;
|
|
1019
|
+
const rest2 = name.slice(prefix.length);
|
|
1020
|
+
const values = theme[key];
|
|
1021
|
+
if (rest2.endsWith("*")) {
|
|
1022
|
+
for (const entry of Object.keys(values)) {
|
|
1023
|
+
if (entry.startsWith(rest2.slice(0, -1))) delete values[entry];
|
|
1024
|
+
}
|
|
1025
|
+
} else delete values[rest2];
|
|
1026
|
+
}
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
const light = resolve(value, "light");
|
|
1030
|
+
if (name === "spacing") {
|
|
1031
|
+
const px = light === void 0 ? void 0 : themeLength(light);
|
|
1032
|
+
if (px !== void 0) theme.spacing = px;
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if (name.startsWith("color-")) {
|
|
1036
|
+
const key = name.slice(6);
|
|
1037
|
+
const color2 = light === void 0 ? void 0 : themeColor(light);
|
|
1038
|
+
const darkValue = resolve(value, "dark");
|
|
1039
|
+
const dark = darkValue === void 0 ? void 0 : themeColor(darkValue);
|
|
1040
|
+
delete theme.colors[key];
|
|
1041
|
+
delete theme.darkColors[key];
|
|
1042
|
+
if (color2) theme.colors[key] = color2;
|
|
1043
|
+
if (color2 && dark && dark !== color2) theme.darkColors[key] = dark;
|
|
1044
|
+
continue;
|
|
1045
|
+
}
|
|
1046
|
+
const lineHeight = /^text-(.+)--line-height$/.exec(name);
|
|
1047
|
+
if (lineHeight) {
|
|
1048
|
+
if (light !== void 0) lineHeights.push([lineHeight[1], light]);
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
if (name.startsWith("text-") && !name.includes("--")) {
|
|
1052
|
+
const px = light === void 0 ? void 0 : themeLength(light);
|
|
1053
|
+
const key = name.slice(5);
|
|
1054
|
+
if (px === void 0) delete theme.text[key];
|
|
1055
|
+
else theme.text[key] = [px, theme.text[key]?.[1] ?? Number.NaN];
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
const numeric = [
|
|
1059
|
+
["font-weight-", "fontWeight"],
|
|
1060
|
+
["leading-", "leading"]
|
|
1061
|
+
];
|
|
1062
|
+
const number = numeric.find(([prefix]) => name.startsWith(prefix));
|
|
1063
|
+
if (number) {
|
|
1064
|
+
const parsed = light === void 0 ? Number.NaN : Number(light);
|
|
1065
|
+
const key = name.slice(number[0].length);
|
|
1066
|
+
if (Number.isFinite(parsed)) theme[number[1]][key] = parsed;
|
|
1067
|
+
else delete theme[number[1]][key];
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
if (name.startsWith("tracking-")) {
|
|
1071
|
+
const em = light === void 0 ? void 0 : /^(-?[\d.]+)em$/.exec(light.trim());
|
|
1072
|
+
const key = name.slice(9);
|
|
1073
|
+
if (em) theme.tracking[key] = Number(em[1]);
|
|
1074
|
+
else delete theme.tracking[key];
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
for (const [prefix, key] of [
|
|
1078
|
+
["radius-", "radius"],
|
|
1079
|
+
["container-", "container"]
|
|
1080
|
+
]) {
|
|
1081
|
+
if (!name.startsWith(prefix)) continue;
|
|
1082
|
+
const px = light === void 0 ? void 0 : themeLength(light);
|
|
1083
|
+
if (px === void 0) delete theme[key][name.slice(prefix.length)];
|
|
1084
|
+
else theme[key][name.slice(prefix.length)] = px;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
for (const [size2, value] of lineHeights) {
|
|
1088
|
+
const text = theme.text[size2];
|
|
1089
|
+
if (!text) continue;
|
|
1090
|
+
const calc = /^calc\(\s*([\d.]+)\s*\/\s*([\d.]+)\s*\)$/.exec(value.trim());
|
|
1091
|
+
const ratio = calc ? Number(calc[1]) / Number(calc[2]) : Number(value);
|
|
1092
|
+
const px = Number.isFinite(ratio) ? Math.round(ratio * text[0] * 1e3) / 1e3 : themeLength(value);
|
|
1093
|
+
if (px !== void 0) theme.text[size2] = [text[0], px];
|
|
1094
|
+
}
|
|
1095
|
+
const { darkColors, ...rest } = theme;
|
|
1096
|
+
return Object.keys(darkColors).length > 0 ? { ...rest, darkColors } : rest;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// src/mobile/native-css.ts
|
|
1100
|
+
var IGNORED_PSEUDO = /^:(?:hover|focus|focus-visible|focus-within|active|visited|target|checked|placeholder-shown|disabled|enabled|empty)$/;
|
|
1101
|
+
var DROPPED_AT_RULES = /^@(?:font-face|keyframes|-webkit-keyframes|property|page|import|charset|namespace|tailwind|config|plugin|source|custom-variant|variant|utility|theme)\b/;
|
|
1102
|
+
function stripComments(css) {
|
|
1103
|
+
return css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
1104
|
+
}
|
|
1105
|
+
function splitList(text) {
|
|
1106
|
+
const parts = [];
|
|
1107
|
+
let depth = 0;
|
|
1108
|
+
let start = 0;
|
|
1109
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
1110
|
+
const char = text[index];
|
|
1111
|
+
if (char === "(" || char === "[") depth += 1;
|
|
1112
|
+
else if (char === ")" || char === "]") depth -= 1;
|
|
1113
|
+
else if (char === "," && depth === 0) {
|
|
1114
|
+
parts.push(text.slice(start, index).trim());
|
|
1115
|
+
start = index + 1;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
parts.push(text.slice(start).trim());
|
|
1119
|
+
return parts.filter(Boolean);
|
|
1120
|
+
}
|
|
1121
|
+
function parseCompound(text) {
|
|
1122
|
+
const compound = { classes: [], attributes: [], positions: [] };
|
|
1123
|
+
const token = /([a-zA-Z][\w-]*|\*)|#([\w-]+)|\.([\w-]+)|\[([\w-]+)(?:([~|^$*]?=)["']?([^"'\]]*)["']?)?\]|(::?[\w-]+)(\([^)]*\))?/gy;
|
|
1124
|
+
let match;
|
|
1125
|
+
let index = 0;
|
|
1126
|
+
while (index < text.length) {
|
|
1127
|
+
token.lastIndex = index;
|
|
1128
|
+
match = token.exec(text);
|
|
1129
|
+
if (!match) return void 0;
|
|
1130
|
+
index = token.lastIndex;
|
|
1131
|
+
if (match[1]) {
|
|
1132
|
+
if (match[1] !== "*") compound.tag = match[1].toLowerCase();
|
|
1133
|
+
} else if (match[2]) compound.id = match[2];
|
|
1134
|
+
else if (match[3]) compound.classes.push(match[3]);
|
|
1135
|
+
else if (match[4]) {
|
|
1136
|
+
if (match[5] && match[5] !== "=") return void 0;
|
|
1137
|
+
compound.attributes.push({ name: match[4].toLowerCase(), value: match[6] });
|
|
1138
|
+
} else if (match[7]) {
|
|
1139
|
+
if (match[8]) return void 0;
|
|
1140
|
+
if (match[7] === ":first-child" || match[7] === ":last-child") {
|
|
1141
|
+
compound.positions.push(match[7].slice(1));
|
|
1142
|
+
} else if (match[7] === ":root") compound.tag = "html";
|
|
1143
|
+
else if (IGNORED_PSEUDO.test(match[7])) return null;
|
|
1144
|
+
else return void 0;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return compound;
|
|
1148
|
+
}
|
|
1149
|
+
function parseSelector(text) {
|
|
1150
|
+
const steps = [];
|
|
1151
|
+
let specificity = 0;
|
|
1152
|
+
const parts = text.replace(/\s*([>+~])\s*/g, " $1 ").trim().split(/\s+/);
|
|
1153
|
+
let combinator;
|
|
1154
|
+
for (let index = parts.length - 1; index >= 0; index -= 1) {
|
|
1155
|
+
const part = parts[index];
|
|
1156
|
+
if (part === ">" || part === "+" || part === "~") {
|
|
1157
|
+
combinator = part;
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
const compound = parseCompound(part);
|
|
1161
|
+
if (compound === null) return null;
|
|
1162
|
+
if (compound === void 0) return void 0;
|
|
1163
|
+
if (steps.length > 0) steps[steps.length - 1].combinator = combinator ?? " ";
|
|
1164
|
+
steps.push({ compound });
|
|
1165
|
+
combinator = void 0;
|
|
1166
|
+
specificity += (compound.id ? 1e4 : 0) + (compound.classes.length + compound.attributes.length + compound.positions.length) * 100 + (compound.tag ? 1 : 0);
|
|
1167
|
+
}
|
|
1168
|
+
return steps.length > 0 ? { steps, specificity } : void 0;
|
|
1169
|
+
}
|
|
1170
|
+
function parseFarmNativeStylesheet(css) {
|
|
1171
|
+
const sheet = {
|
|
1172
|
+
rules: [],
|
|
1173
|
+
unknown: [],
|
|
1174
|
+
vars: { light: {}, dark: {} },
|
|
1175
|
+
layered: /* @__PURE__ */ new Set()
|
|
1176
|
+
};
|
|
1177
|
+
let order = 0;
|
|
1178
|
+
const walk = (text, context) => {
|
|
1179
|
+
let index = 0;
|
|
1180
|
+
while (index < text.length) {
|
|
1181
|
+
const open = text.indexOf("{", index);
|
|
1182
|
+
const semicolon = text.indexOf(";", index);
|
|
1183
|
+
if (open < 0) break;
|
|
1184
|
+
if (semicolon >= 0 && semicolon < open) {
|
|
1185
|
+
index = semicolon + 1;
|
|
1186
|
+
continue;
|
|
1187
|
+
}
|
|
1188
|
+
const prelude = text.slice(index, open).trim();
|
|
1189
|
+
let depth = 1;
|
|
1190
|
+
let close = open + 1;
|
|
1191
|
+
while (close < text.length && depth > 0) {
|
|
1192
|
+
if (text[close] === "{") depth += 1;
|
|
1193
|
+
else if (text[close] === "}") depth -= 1;
|
|
1194
|
+
close += 1;
|
|
1195
|
+
}
|
|
1196
|
+
const body = text.slice(open + 1, close - 1);
|
|
1197
|
+
index = close;
|
|
1198
|
+
if (prelude.startsWith("@")) {
|
|
1199
|
+
if (DROPPED_AT_RULES.test(prelude)) continue;
|
|
1200
|
+
if (/^@layer\b/.test(prelude)) {
|
|
1201
|
+
walk(body, { ...context, layered: true });
|
|
1202
|
+
} else if (/^@media\b/.test(prelude)) {
|
|
1203
|
+
const query = prelude.slice(6).trim();
|
|
1204
|
+
if (/^\(\s*prefers-color-scheme:\s*dark\s*\)$/.test(query))
|
|
1205
|
+
walk(body, { ...context, dark: true });
|
|
1206
|
+
else if (/^\(\s*prefers-color-scheme:\s*light\s*\)$/.test(query))
|
|
1207
|
+
walk(body, { ...context, light: true });
|
|
1208
|
+
else walk(body, { ...context, unknownMedia: prelude });
|
|
1209
|
+
} else if (/^@supports\b/.test(prelude)) {
|
|
1210
|
+
walk(body, context);
|
|
1211
|
+
} else {
|
|
1212
|
+
walk(body, { ...context, unknownMedia: prelude });
|
|
1213
|
+
}
|
|
1214
|
+
continue;
|
|
1215
|
+
}
|
|
1216
|
+
const declarations = splitFarmCssDeclarations(body);
|
|
1217
|
+
const applies = /@apply\b/.test(body);
|
|
1218
|
+
for (const text2 of splitList(prelude)) {
|
|
1219
|
+
const selector = parseSelector(text2);
|
|
1220
|
+
if (selector === null) continue;
|
|
1221
|
+
const subject = selector?.steps[0].compound;
|
|
1222
|
+
if (context.layered) {
|
|
1223
|
+
for (const name of subject?.classes ?? []) sheet.layered.add(name);
|
|
1224
|
+
continue;
|
|
1225
|
+
}
|
|
1226
|
+
if (selector && selector.steps.length === 1 && subject?.tag === "html" && !subject.classes.length) {
|
|
1227
|
+
for (const [property, value] of declarations) {
|
|
1228
|
+
if (property.startsWith("--")) {
|
|
1229
|
+
(context.dark ? sheet.vars.dark : sheet.vars.light)[property] = value;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
if (!selector || context.unknownMedia || applies) {
|
|
1234
|
+
const fallback = /(?:^|[\s>+~])([a-zA-Z][\w-]*)?((?:[.#:[][^\s>+~]*)?)$/.exec(text2);
|
|
1235
|
+
sheet.unknown.push({
|
|
1236
|
+
classes: [...(fallback?.[2] ?? "").matchAll(/\.([\w-]+)/g)].map((match) => match[1]),
|
|
1237
|
+
tag: fallback?.[1]?.toLowerCase(),
|
|
1238
|
+
text: context.unknownMedia ? `${context.unknownMedia} ${text2}` : applies ? `${text2} { @apply }` : text2
|
|
1239
|
+
});
|
|
1240
|
+
continue;
|
|
1241
|
+
}
|
|
1242
|
+
if (context.light) continue;
|
|
1243
|
+
const own = declarations.filter(([property]) => !property.startsWith("--"));
|
|
1244
|
+
if (own.length > 0) {
|
|
1245
|
+
sheet.rules.push({
|
|
1246
|
+
selector,
|
|
1247
|
+
text: text2,
|
|
1248
|
+
declarations: own,
|
|
1249
|
+
dark: context.dark,
|
|
1250
|
+
order: order++
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
walk(stripComments(css), {});
|
|
1257
|
+
return sheet;
|
|
1258
|
+
}
|
|
1259
|
+
function classesOf(element) {
|
|
1260
|
+
return (element.attributes.class ?? "").split(/\s+/).filter(Boolean);
|
|
1261
|
+
}
|
|
1262
|
+
function matchesCompound(compound, element) {
|
|
1263
|
+
if (compound.tag && compound.tag !== element.tag) return false;
|
|
1264
|
+
if (compound.id && element.attributes.id !== compound.id) return false;
|
|
1265
|
+
if (compound.classes.length > 0) {
|
|
1266
|
+
const classes = classesOf(element);
|
|
1267
|
+
if (!compound.classes.every((name) => classes.includes(name))) return false;
|
|
1268
|
+
}
|
|
1269
|
+
for (const attribute of compound.attributes) {
|
|
1270
|
+
const value = attribute.name === "data-farm-shell" && element.tag === "html" ? element.attributes[attribute.name] ?? "android" : element.attributes[attribute.name];
|
|
1271
|
+
if (value === void 0) return false;
|
|
1272
|
+
if (attribute.value !== void 0 && value !== attribute.value) return false;
|
|
1273
|
+
}
|
|
1274
|
+
for (const position of compound.positions) {
|
|
1275
|
+
if (position === "first-child" && element.previous) return false;
|
|
1276
|
+
if (position === "last-child" && !element.last) return false;
|
|
1277
|
+
}
|
|
1278
|
+
return true;
|
|
1279
|
+
}
|
|
1280
|
+
function matches(selector, element) {
|
|
1281
|
+
const step = (index, target) => {
|
|
1282
|
+
if (!target) return false;
|
|
1283
|
+
const { compound, combinator } = selector.steps[index];
|
|
1284
|
+
if (!matchesCompound(compound, target)) return false;
|
|
1285
|
+
if (index === selector.steps.length - 1) return true;
|
|
1286
|
+
switch (combinator) {
|
|
1287
|
+
case ">":
|
|
1288
|
+
return step(index + 1, target.parent);
|
|
1289
|
+
case "+":
|
|
1290
|
+
return step(index + 1, target.previous);
|
|
1291
|
+
case "~":
|
|
1292
|
+
for (let sibling = target.previous; sibling; sibling = sibling.previous) {
|
|
1293
|
+
if (step(index + 1, sibling)) return true;
|
|
1294
|
+
}
|
|
1295
|
+
return false;
|
|
1296
|
+
default:
|
|
1297
|
+
for (let ancestor = target.parent; ancestor; ancestor = ancestor.parent) {
|
|
1298
|
+
if (step(index + 1, ancestor)) return true;
|
|
1299
|
+
}
|
|
1300
|
+
return false;
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
return step(0, element);
|
|
1304
|
+
}
|
|
1305
|
+
function substitute(value, vars, depth = 0) {
|
|
1306
|
+
if (!value.includes("var(")) return value;
|
|
1307
|
+
if (depth > 8) return void 0;
|
|
1308
|
+
let missing = false;
|
|
1309
|
+
const replaced = value.replace(
|
|
1310
|
+
/var\(\s*(--[\w-]+)\s*(?:,\s*([^()]*(?:\([^()]*\))?[^()]*))?\)/g,
|
|
1311
|
+
(_, name, fallback) => {
|
|
1312
|
+
const resolved = vars[name] ?? fallback?.trim();
|
|
1313
|
+
if (resolved === void 0) {
|
|
1314
|
+
missing = true;
|
|
1315
|
+
return "";
|
|
1316
|
+
}
|
|
1317
|
+
return resolved;
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
return missing ? void 0 : substitute(replaced, vars, depth + 1);
|
|
1321
|
+
}
|
|
1322
|
+
function cascadeFarmNativeStylesheets(sheets, element) {
|
|
1323
|
+
const style = {};
|
|
1324
|
+
const dark = {};
|
|
1325
|
+
const unsupported = [];
|
|
1326
|
+
const classes = classesOf(element);
|
|
1327
|
+
const matched = [];
|
|
1328
|
+
sheets.forEach((sheet, index) => {
|
|
1329
|
+
for (const rule of sheet.rules) {
|
|
1330
|
+
if (matches(rule.selector, element)) matched.push({ rule, sheet, index });
|
|
1331
|
+
}
|
|
1332
|
+
for (const unknown of sheet.unknown) {
|
|
1333
|
+
const touches = unknown.classes.some((name) => classes.includes(name)) || unknown.classes.length === 0 && unknown.tag === element.tag;
|
|
1334
|
+
if (touches) unsupported.push(`selector "${unknown.text}"`);
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
matched.sort(
|
|
1338
|
+
(left, right) => left.rule.selector.specificity - right.rule.selector.specificity || left.index - right.index || left.rule.order - right.rule.order
|
|
1339
|
+
);
|
|
1340
|
+
for (const { rule, sheet } of matched) {
|
|
1341
|
+
for (const [property, raw] of rule.declarations) {
|
|
1342
|
+
const themes = rule.dark ? [dark] : [style, dark];
|
|
1343
|
+
for (const target of themes) {
|
|
1344
|
+
const vars = target === dark ? { ...sheet.vars.light, ...sheet.vars.dark } : sheet.vars.light;
|
|
1345
|
+
const value = substitute(raw, vars);
|
|
1346
|
+
const resolved = value === void 0 ? void 0 : resolveFarmNativeDeclaration(property, value.toLowerCase().trim());
|
|
1347
|
+
if (resolved === void 0) {
|
|
1348
|
+
const message = `${property}: ${raw}`;
|
|
1349
|
+
if (!unsupported.includes(message)) unsupported.push(message);
|
|
1350
|
+
break;
|
|
1351
|
+
}
|
|
1352
|
+
if (resolved) Object.assign(target, resolved);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
for (const key of Object.keys(dark)) {
|
|
1357
|
+
if (dark[key] === style[key]) delete dark[key];
|
|
1358
|
+
}
|
|
1359
|
+
const layered = classes.filter((name) => sheets.some((sheet) => sheet.layered.has(name)));
|
|
1360
|
+
return { style, dark, unsupported, layered };
|
|
1361
|
+
}
|
|
1362
|
+
function inspectFarmNativeStylesheets(sheets, target) {
|
|
1363
|
+
const problems = [];
|
|
1364
|
+
let styled = false;
|
|
1365
|
+
const touches = (compound, subject) => "class" in target ? compound.classes.includes(target.class) : subject && compound.tag === target.tag && compound.classes.length === 0;
|
|
1366
|
+
for (const sheet of sheets) {
|
|
1367
|
+
for (const rule of sheet.rules) {
|
|
1368
|
+
if (!rule.selector.steps.some((step, index) => touches(step.compound, index === 0))) continue;
|
|
1369
|
+
styled = true;
|
|
1370
|
+
for (const [property, raw] of rule.declarations) {
|
|
1371
|
+
for (const vars of [sheet.vars.light, { ...sheet.vars.light, ...sheet.vars.dark }]) {
|
|
1372
|
+
const value = substitute(raw, vars);
|
|
1373
|
+
if (value === void 0 || resolveFarmNativeDeclaration(property, value.toLowerCase().trim()) === void 0) {
|
|
1374
|
+
const message = `"${rule.text} { ${property}: ${raw} }" has no native-tier style`;
|
|
1375
|
+
if (!problems.includes(message)) problems.push(message);
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
for (const unknown of sheet.unknown) {
|
|
1382
|
+
const hit = "class" in target ? unknown.classes.includes(target.class) : unknown.classes.length === 0 && unknown.tag === target.tag;
|
|
1383
|
+
if (hit) {
|
|
1384
|
+
styled = true;
|
|
1385
|
+
problems.push(`"${unknown.text}" is CSS the native tier cannot apply`);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
return { styled, problems };
|
|
1390
|
+
}
|
|
1391
|
+
function cascadeFarmNativeStylesheetsForElement(sheets, element, contextClasses = /* @__PURE__ */ new Set()) {
|
|
1392
|
+
const { tag, classes = [] } = element;
|
|
1393
|
+
const problems = [];
|
|
1394
|
+
const inherit = /* @__PURE__ */ new Set();
|
|
1395
|
+
const problem = (message) => {
|
|
1396
|
+
if (!problems.includes(message)) problems.push(message);
|
|
1397
|
+
};
|
|
1398
|
+
for (const sheet of sheets) {
|
|
1399
|
+
for (const rule of sheet.rules) {
|
|
1400
|
+
const [subject, ...context] = rule.selector.steps;
|
|
1401
|
+
const compound = subject.compound;
|
|
1402
|
+
if (compound.tag && compound.tag !== tag || compound.classes.some((name) => !classes.includes(name))) {
|
|
1403
|
+
continue;
|
|
1404
|
+
}
|
|
1405
|
+
const unreachable = context.some(
|
|
1406
|
+
(step) => step.compound.classes.length > 0 && step.compound.classes.some((name) => !contextClasses.has(name))
|
|
1407
|
+
);
|
|
1408
|
+
if (unreachable) continue;
|
|
1409
|
+
const shellOnly = tag === "html" && compound.attributes.every((attribute) => attribute.name === "data-farm-shell");
|
|
1410
|
+
if (context.length > 0 || compound.id || compound.positions.length > 0 || compound.attributes.length > 0 && !shellOnly) {
|
|
1411
|
+
problem(`"${rule.text}" depends on where <${tag}> renders`);
|
|
1412
|
+
continue;
|
|
1413
|
+
}
|
|
1414
|
+
for (const [property, value] of rule.declarations) {
|
|
1415
|
+
if (value.trim().toLowerCase() !== "inherit") continue;
|
|
1416
|
+
for (const key of INHERITABLE[property] ?? []) inherit.add(key);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
for (const unknown of sheet.unknown) {
|
|
1420
|
+
const touches = unknown.classes.length > 0 ? unknown.classes.some((name) => classes.includes(name)) : !unknown.tag || unknown.tag === tag;
|
|
1421
|
+
if (touches) problem(`"${unknown.text}" is CSS a port cannot apply`);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
const { style, dark, unsupported } = cascadeFarmNativeStylesheets(sheets, {
|
|
1425
|
+
tag,
|
|
1426
|
+
attributes: {
|
|
1427
|
+
...tag === "html" ? { "data-farm-shell": "" } : {},
|
|
1428
|
+
...classes.length > 0 ? { class: classes.join(" ") } : {}
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
for (const message of unsupported) problem(`<${tag}> ${message}`);
|
|
1432
|
+
return { style, dark, inherit: [...inherit].sort(), problems };
|
|
1433
|
+
}
|
|
1434
|
+
var INHERITABLE = {
|
|
1435
|
+
font: ["fontFamily", "fontSize", "fontStyle", "fontWeight", "lineHeight"],
|
|
1436
|
+
"font-family": ["fontFamily"],
|
|
1437
|
+
"font-size": ["fontSize"],
|
|
1438
|
+
"font-style": ["fontStyle"],
|
|
1439
|
+
"font-weight": ["fontWeight"],
|
|
1440
|
+
"line-height": ["lineHeight"],
|
|
1441
|
+
"letter-spacing": ["letterSpacing"],
|
|
1442
|
+
color: ["color"],
|
|
1443
|
+
"text-align": ["textAlign"]
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
export {
|
|
1447
|
+
FARM_NATIVE_TEXT_KEYS,
|
|
1448
|
+
farmNativeClassProblem,
|
|
1449
|
+
resolveFarmNativeClasses,
|
|
1450
|
+
FARM_NATIVE_STYLE_PROPERTIES,
|
|
1451
|
+
resolveFarmNativeInlineStyle,
|
|
1452
|
+
createFarmNativeTheme,
|
|
1453
|
+
parseFarmNativeStylesheet,
|
|
1454
|
+
cascadeFarmNativeStylesheets,
|
|
1455
|
+
inspectFarmNativeStylesheets,
|
|
1456
|
+
cascadeFarmNativeStylesheetsForElement
|
|
1457
|
+
};
|