@aussieljk/forkbook 0.0.1-2 → 0.0.1-21
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/LICENSE +1 -1
- package/README.md +35 -53
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
- package/assets/browser/favicon-wrapper.svg +4 -4
- package/assets/browser/favicon.svg +1 -1
- package/assets/browser/inter-LICENSE.txt +92 -0
- package/assets/browser/inter-variable-italic.woff2 +0 -0
- package/assets/browser/inter-variable.woff2 +0 -0
- package/assets/browser/mirror-ball.png +0 -0
- package/assets/builder-vite/iframe.html +8 -24
- package/assets/create/rendererAssets/common/Configure.mdx +100 -100
- package/assets/create/rendererAssets/common/button.css +7 -7
- package/assets/create/rendererAssets/common/header.css +6 -6
- package/assets/create/rendererAssets/common/page.css +12 -12
- package/assets/create/templates/react-native/index.expo.js +4 -4
- package/assets/create/templates/react-native/index.js +5 -5
- package/assets/server/base-preview-body.html +32 -32
- package/assets/server/base-preview-head.html +86 -86
- package/assets/server/template.ejs +31 -26
- package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-7FO5YFB5.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-QWFSUQZP.js +199 -0
- package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-5Z3MWCFR.js} +12 -12
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
- package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-BSYOFSF6.js} +770 -720
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
- package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
- package/dist/_browser-chunks/chunk-FAOLWWRN.js +20 -0
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
- package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
- package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
- package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
- package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
- package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
- package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
- package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
- package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
- package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
- package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-ZIZCGWCG.js} +348 -170
- package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
- package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-UC2CB4GH.js} +37 -35
- package/dist/_node-chunks/builder-manager-S5UUKVOR.js +1174 -0
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-3335ZZIO.js} +6 -6
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-3D6N6P2R.js} +283 -306
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-3ER54PQM.js} +8 -8
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-3H5C52QU.js} +6 -6
- package/dist/_node-chunks/chunk-3UI3TQ7R.js +28 -0
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-4C3ACAHV.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-4UTCKJEQ.js} +7 -7
- package/dist/_node-chunks/chunk-53A5CYDK.js +572 -0
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-53PSBDRK.js} +140 -118
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-54MO4QLB.js} +6 -6
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-5CJMRQZ6.js} +6 -6
- package/dist/_node-chunks/chunk-5HOM7B4V.js +20 -0
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-5QG6AXK4.js} +7 -7
- package/dist/_node-chunks/chunk-67XVZZUO.js +405 -0
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-6HQJJDLH.js} +6 -6
- package/dist/_node-chunks/chunk-6IPHWCFI.js +29 -0
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-6XYOFBRD.js} +98 -129
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-7IAYDGYH.js} +6 -6
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-7P67PUU2.js} +7 -7
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-AAK5BBF2.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-BGUVBOOU.js} +10 -10
- package/dist/_node-chunks/chunk-BNGBOASQ.js +25 -0
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-BWZWCVVH.js} +9 -9
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-C6HQ6WLU.js} +8 -8
- package/dist/_node-chunks/chunk-CJHRH777.js +20 -0
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-COEW4ORP.js} +6 -6
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-CVHDAEDZ.js} +7 -7
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-CXGOQNGI.js} +7 -7
- package/dist/_node-chunks/chunk-D4XTQWRM.js +11 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-D5V6CZ6U.js} +7 -7
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-DCTXJ4TT.js} +14 -16
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-DP6WFY3D.js} +7 -7
- package/dist/_node-chunks/chunk-E23GDXG6.js +271 -0
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-E3ZFMURC.js} +8 -8
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-E6O3NA44.js} +7 -7
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-ECS3WDOU.js} +8 -8
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-FB5YJWOH.js} +6 -6
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-FCK5FM6D.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-FJUGPEJK.js} +6 -6
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-FPYXI76E.js} +75 -75
- package/dist/_node-chunks/chunk-GEWVOY3F.js +62 -0
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-GHZ44BFB.js} +14 -13
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-GJMFISS3.js} +8 -8
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-GK2Y2RFX.js} +7 -7
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-GP6YBA2R.js} +6 -6
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-GQUFGJ4D.js} +6 -6
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-H4CRQDTK.js} +6 -6
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-HCDG54OG.js} +7 -7
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-HGJMP4EI.js} +506 -494
- package/dist/_node-chunks/chunk-HSX6BDBA.js +18 -0
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-IPFPWMT5.js} +1320 -437
- package/dist/_node-chunks/chunk-KRIOC4WF.js +281 -0
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-KUL2MJ6N.js} +6 -6
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-LUR6QTYB.js} +10 -10
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-LYS7TI35.js} +368 -321
- package/dist/_node-chunks/chunk-MDTXL6SN.js +2613 -0
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-MIIPXT4S.js} +9 -9
- package/dist/_node-chunks/chunk-MLWGAA2I.js +138 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-MWUGCUB5.js} +52 -22
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-MX5MVLEK.js} +6 -6
- package/dist/_node-chunks/chunk-N44UIGCO.js +47 -0
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-NP2JHOFY.js} +37 -31
- package/dist/_node-chunks/chunk-OMNGOPNG.js +52 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-OO2GTHUF.js} +9 -17
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-PC57BIYZ.js} +8 -8
- package/dist/_node-chunks/chunk-PHWMAF5C.js +49 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-PLIQQETC.js} +7 -7
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-QMYCIS2U.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-QZIDK3GX.js} +89 -71
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-ROJ6RSIJ.js} +7 -7
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-S2NB6QEG.js} +542 -1049
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-S6VCOSQS.js} +6 -6
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-SEVOOOB2.js} +474 -479
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-SFT6ZAVN.js} +6 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-SXBUK4F6.js} +7 -7
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-TGF6Q66I.js} +15 -9
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-TGFHWGGT.js} +9 -6
- package/dist/_node-chunks/chunk-TTLSBLPQ.js +620 -0
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-UUAEW2AR.js} +6 -6
- package/dist/_node-chunks/chunk-VQHM66NL.js +534 -0
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-VSTTY3TM.js} +6 -6
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-XDBSAFUB.js} +650 -9
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-XTQQGAUZ.js} +7 -7
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-YMJVSFJT.js} +6 -6
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-YXEKWVJQ.js} +7 -7
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-Z6CUUWJO.js} +34 -949
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-ZAIGR7EV.js} +64 -17
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-ZCFXEFR6.js} +33 -41
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-ZHUBOYOD.js} +6 -6
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-ZHUBTBP2.js} +25 -8
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-ZSTIFZHY.js} +21 -25
- package/dist/_node-chunks/dist-TRTHRODT.js +16 -0
- package/dist/_node-chunks/dist-XPLJ5T4W.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-AC7MOWYK.js} +21 -22
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-ZW26VGEP.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-T2KZK62Q.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-2CWUUF6H.js} +12 -12
- package/dist/_node-chunks/optimized-tests-4AK3PFSX.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-CMRGEXHM.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-OUQENFYO.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-LHOAIJ2E.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-K54MMYY6.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-TTL4PWH7.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-6DXBB5F7.js} +294 -30
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-BMTV5ZAO.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-FDPYW25Y.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-2TCFWAAI.js} +9 -9
- package/dist/actions/decorator.js +18 -22
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +3 -2
- package/dist/addon-a11y/manager.js +41 -38
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.d.ts +8 -2
- package/dist/addon-a11y/preview.js +3 -2
- package/dist/addon-comments/manager.js +353 -0
- package/dist/addon-comments/preset.js +80 -0
- package/dist/addon-comments/preview.js +101 -0
- package/dist/addon-docs/blocks.d.ts +123 -85
- package/dist/addon-docs/blocks.js +159 -85
- package/dist/addon-docs/index.d.ts +21 -21
- package/dist/addon-docs/index.js +3 -3
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +12 -12
- package/dist/addon-docs/preview.d.ts +3 -1
- package/dist/addon-docs/preview.js +1 -1
- package/dist/addon-links/index.d.ts +2 -1
- package/dist/addon-links/index.js +5 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +5 -2
- package/dist/addon-links/react/index.js +4 -1
- package/dist/addon-mcp/preset.js +203 -84
- package/dist/addon-mcp/preview.js +1 -1
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +71 -71
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-ondevice-controls/index.js +1 -1
- package/dist/addon-ondevice-controls/register.js +1 -1
- package/dist/addon-pseudo-states/index.d.ts +1 -1
- package/dist/addon-pseudo-states/index.js +1 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-pseudo-states/preview.js +1 -1
- package/dist/addon-themes/index.d.ts +7 -6
- package/dist/addon-themes/index.js +2 -2
- package/dist/addon-themes/manager.js +4 -4
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-themes/preview.js +2 -2
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +32 -23
- package/dist/addon-vitest/node/coverage-reporter.js +11 -11
- package/dist/addon-vitest/node/vitest.js +37 -37
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +26 -26
- package/dist/addon-vitest/vitest-plugin/global-setup.js +23 -23
- package/dist/addon-vitest/vitest-plugin/index.js +83 -73
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.d.ts +241 -995
- package/dist/babel/index.js +30583 -38
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +122 -110
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +201 -0
- package/dist/builder-vite/index.d.ts +8 -3
- package/dist/builder-vite/index.js +80 -25
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +97 -24
- package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-B53gRJBs.d.ts} +838 -703
- package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-BspNQvZn.d.ts} +21 -23
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-CMx6bGAU.d.ts} +2 -2
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-CRmUwbkb.d.ts} +4 -4
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
- package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
- package/dist/chunk-DVIvUVkS.d.ts +195 -0
- package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
- package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
- package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-bhl-7rRD.d.ts} +40 -15
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +15 -904
- package/dist/cli/index.js +49 -5209
- package/dist/cli/skills/content/index.d.ts +3 -3
- package/dist/cli/skills/content/index.js +3 -3
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +4 -4
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.d.ts +20 -21
- package/dist/client-logger/index.js +5 -2
- package/dist/common/index.d.ts +32 -44
- package/dist/common/index.js +89 -98
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +16 -7
- package/dist/core-events/index.js +5 -5
- package/dist/core-server/index.d.ts +95 -26
- package/dist/core-server/index.js +1675 -408
- package/dist/core-server/presets/common-manager.js +837 -1335
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +100 -282
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/csf-utils.d.ts +1 -1
- package/dist/csf/index.d.ts +6 -6
- package/dist/csf/index.js +90 -159
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +19 -17
- package/dist/docs-tools/index.d.ts +332 -16
- package/dist/docs-tools/index.js +3 -3
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.d.ts +5 -5
- package/dist/instrumenter/index.js +31 -19
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
- package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-BJ6EZqH7.js} +1035 -623
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BfXaq_CP.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-BkSn_Jpe.js} +411 -379
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-Cisw9IIE.js} +11 -11
- package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DpvE_zRs.js} +1013 -782
- package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
- package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
- package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
- package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-wV08sCKl.js} +715 -620
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-4OQZWibO.js} +1717 -1536
- package/dist/manager/_manager-chunks/runtime-BYxbyNm0.js +201 -0
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-CM4Z8aKR.js +735 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-Cjo1UL1u.js} +57 -76
- package/dist/manager/_manager-chunks/runtime-Cx1-wr6J.js +294 -0
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-Cxe_uJRb.js} +220 -406
- package/dist/manager/_manager-chunks/runtime-D702FFTO.js +551 -0
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-DnWFp6Zw.js} +8 -534
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DoYPE6g6.js} +232 -158
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-sppa-0ll.js} +741 -698
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +538 -528
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +10 -10
- package/dist/mcp/index.js +11 -11
- package/dist/mocking-utils/index.d.ts +7 -5
- package/dist/mocking-utils/index.js +34 -34
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/next/index.d.ts +231 -0
- package/dist/next/index.js +398 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
- package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
- package/dist/nextjs-vite/index.d.ts +4 -4
- package/dist/nextjs-vite/index.js +10 -5
- package/dist/nextjs-vite/node/index.d.ts +2 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +117 -15
- package/dist/nextjs-vite/preview.d.ts +2 -1
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
- package/dist/nextjs-vite/vite-plugin/index.js +9 -9
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +24 -49
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
- package/dist/node-logger/index.d.ts +89 -90
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +15 -14
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-Cbq5WjbL.js} +772 -418
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-DDEUZops.js} +453 -161
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-DsjyhLpG.js} +397 -176
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-Dwi6NFcX.js} +3 -3
- package/dist/preview/globals.d.ts +10 -10
- package/dist/preview/globals.js +10 -10
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +3 -3
- package/dist/preview-api/index.js +12 -10
- package/dist/preview-errors.d.ts +1 -1
- package/dist/preview-errors.js +2 -2
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview-argtypes.js +1 -1
- package/dist/react/entry-preview-docs.js +1 -1
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.d.ts +9 -11
- package/dist/react/index.js +8 -6
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +5 -4
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +48 -47
- package/dist/react-native/index.js +64 -249
- package/dist/react-native/metro/node.d.ts +3 -3
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
- package/dist/react-native/preview.js +4 -1
- package/dist/react-native/scripts/generate.d.ts +1 -1
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-native/stub.js +1 -1
- package/dist/react-native-theming/index.d.ts +2 -58
- package/dist/react-native-theming/index.js +63 -2338
- package/dist/react-native-ui/index.d.ts +14 -14
- package/dist/react-native-ui/index.js +8 -15
- package/dist/react-native-ui-common/index.d.ts +32 -12
- package/dist/react-native-ui-common/index.js +26 -31
- package/dist/react-vite/index.d.ts +2 -2
- package/dist/react-vite/node/index.d.ts +3 -3
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.d.ts +3 -1
- package/dist/react-vite/preset.js +16 -9
- package/dist/router/index.d.ts +80 -3
- package/dist/router/index.js +66 -12
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +3 -3
- package/dist/shared/open-service/index.js +2 -2
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
- package/dist/telemetry/index.d.ts +38 -274
- package/dist/telemetry/index.js +11 -68
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +765 -511
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +6 -6
- package/dist/theming/index.js +41 -16
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +5 -5
- package/dist/viewport/index.d.ts +1 -1
- package/package.json +69 -69
- package/skills/setup/SKILL.md +14 -0
- package/skills/stories/SKILL.md +21 -0
- package/skills/write-story/SKILL.md +14 -0
- package/template/nextjs-vite/cli/js/Button.jsx +2 -2
- package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
- package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
- package/template/nextjs-vite/cli/js/Header.jsx +1 -1
- package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +3 -3
- package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
- package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
- package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
- package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
- package/template/react/cli/js/Button.jsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.jsx +1 -1
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +3 -3
- package/template/react/cli/js/Page.stories.js +2 -2
- package/template/react/cli/ts/Button.stories.ts +6 -6
- package/template/react/cli/ts/Button.tsx +2 -2
- package/template/react/cli/ts/Header.stories.ts +2 -2
- package/template/react/cli/ts/Header.tsx +1 -1
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +3 -3
- package/template/react-vite/cli/js/Button.jsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.jsx +1 -1
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +3 -3
- package/template/react-vite/cli/js/Page.stories.js +2 -2
- package/template/react-vite/cli/ts/Button.stories.ts +6 -6
- package/template/react-vite/cli/ts/Button.tsx +2 -2
- package/template/react-vite/cli/ts/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Header.tsx +1 -1
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +3 -3
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
- package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
- package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
- package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
- package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
- package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
- package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
- package/dist/_node-chunks/chunk-EHUNOMDD.js +0 -52345
- package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
- package/dist/_node-chunks/chunk-GRBLDJCR.js +0 -989
- package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
- package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
- package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
- package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +0 -92
- package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
- package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
- package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
- package/dist/_node-chunks/chunk-UBOGWBEA.js +0 -148
- package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
- package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
- package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
- package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
- package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
- package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
- package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
- package/dist/chunk-BTVrWliM.d.ts +0 -115
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- package/dist/chunk-DaVb55-_.d.ts +0 -124
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +0 -387
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_wrk1cj8d1xj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_wrk1cj8d1xj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_wrk1cj8d1xj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_wrk1cj8d1xj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_wrk1cj8d1xj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_wrk1cj8d1xj.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_lib
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XDBSAFUB.js";
|
|
15
15
|
import {
|
|
16
16
|
Parser,
|
|
17
17
|
init_acorn,
|
|
18
18
|
require_acorn_jsx
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DP6WFY3D.js";
|
|
20
20
|
import {
|
|
21
21
|
up2 as up
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MX5MVLEK.js";
|
|
23
23
|
import {
|
|
24
24
|
__commonJS,
|
|
25
25
|
__toESM
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YMJVSFJT.js";
|
|
27
27
|
|
|
28
28
|
// ../../node_modules/estraverse/estraverse.js
|
|
29
29
|
var require_estraverse = __commonJS({
|
|
@@ -2778,273 +2778,6 @@ var require_escodegen = __commonJS({
|
|
|
2778
2778
|
}
|
|
2779
2779
|
});
|
|
2780
2780
|
|
|
2781
|
-
// ../../node_modules/acorn-walk/dist/walk.js
|
|
2782
|
-
var require_walk = __commonJS({
|
|
2783
|
-
"../../node_modules/acorn-walk/dist/walk.js"(exports, module) {
|
|
2784
|
-
(function(global2, factory) {
|
|
2785
|
-
typeof exports == "object" && typeof module < "u" ? factory(exports) : typeof define == "function" && define.amd ? define(["exports"], factory) : (global2 = global2 || self, factory((global2.acorn = global2.acorn || {}, global2.acorn.walk = {})));
|
|
2786
|
-
})(exports, (function(exports2) {
|
|
2787
|
-
"use strict";
|
|
2788
|
-
function simple2(node, visitors, baseVisitor, state, override) {
|
|
2789
|
-
baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
|
|
2790
|
-
var type = override2 || node2.type, found = visitors[type];
|
|
2791
|
-
baseVisitor[type](node2, st, c), found && found(node2, st);
|
|
2792
|
-
})(node, state, override);
|
|
2793
|
-
}
|
|
2794
|
-
function ancestor2(node, visitors, baseVisitor, state, override) {
|
|
2795
|
-
var ancestors = [];
|
|
2796
|
-
baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
|
|
2797
|
-
var type = override2 || node2.type, found = visitors[type], isNew = node2 !== ancestors[ancestors.length - 1];
|
|
2798
|
-
isNew && ancestors.push(node2), baseVisitor[type](node2, st, c), found && found(node2, st || ancestors, ancestors), isNew && ancestors.pop();
|
|
2799
|
-
})(node, state, override);
|
|
2800
|
-
}
|
|
2801
|
-
function recursive(node, state, funcs, baseVisitor, override) {
|
|
2802
|
-
var visitor = funcs ? make(funcs, baseVisitor || void 0) : baseVisitor;
|
|
2803
|
-
(function c(node2, st, override2) {
|
|
2804
|
-
visitor[override2 || node2.type](node2, st, c);
|
|
2805
|
-
})(node, state, override);
|
|
2806
|
-
}
|
|
2807
|
-
function makeTest(test) {
|
|
2808
|
-
return typeof test == "string" ? function(type) {
|
|
2809
|
-
return type === test;
|
|
2810
|
-
} : test || function() {
|
|
2811
|
-
return !0;
|
|
2812
|
-
};
|
|
2813
|
-
}
|
|
2814
|
-
var Found = function(node, state) {
|
|
2815
|
-
this.node = node, this.state = state;
|
|
2816
|
-
};
|
|
2817
|
-
function full(node, callback, baseVisitor, state, override) {
|
|
2818
|
-
baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
|
|
2819
|
-
var type = override2 || node2.type;
|
|
2820
|
-
baseVisitor[type](node2, st, c), override2 || callback(node2, st, type);
|
|
2821
|
-
})(node, state, override);
|
|
2822
|
-
}
|
|
2823
|
-
function fullAncestor(node, callback, baseVisitor, state) {
|
|
2824
|
-
baseVisitor || (baseVisitor = base2);
|
|
2825
|
-
var ancestors = [];
|
|
2826
|
-
(function c(node2, st, override) {
|
|
2827
|
-
var type = override || node2.type, isNew = node2 !== ancestors[ancestors.length - 1];
|
|
2828
|
-
isNew && ancestors.push(node2), baseVisitor[type](node2, st, c), override || callback(node2, st || ancestors, ancestors, type), isNew && ancestors.pop();
|
|
2829
|
-
})(node, state);
|
|
2830
|
-
}
|
|
2831
|
-
function findNodeAt(node, start, end, test, baseVisitor, state) {
|
|
2832
|
-
baseVisitor || (baseVisitor = base2), test = makeTest(test);
|
|
2833
|
-
try {
|
|
2834
|
-
(function c(node2, st, override) {
|
|
2835
|
-
var type = override || node2.type;
|
|
2836
|
-
if ((start == null || node2.start <= start) && (end == null || node2.end >= end) && baseVisitor[type](node2, st, c), (start == null || node2.start === start) && (end == null || node2.end === end) && test(type, node2))
|
|
2837
|
-
throw new Found(node2, st);
|
|
2838
|
-
})(node, state);
|
|
2839
|
-
} catch (e) {
|
|
2840
|
-
if (e instanceof Found)
|
|
2841
|
-
return e;
|
|
2842
|
-
throw e;
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
function findNodeAround(node, pos, test, baseVisitor, state) {
|
|
2846
|
-
test = makeTest(test), baseVisitor || (baseVisitor = base2);
|
|
2847
|
-
try {
|
|
2848
|
-
(function c(node2, st, override) {
|
|
2849
|
-
var type = override || node2.type;
|
|
2850
|
-
if (!(node2.start > pos || node2.end < pos) && (baseVisitor[type](node2, st, c), test(type, node2)))
|
|
2851
|
-
throw new Found(node2, st);
|
|
2852
|
-
})(node, state);
|
|
2853
|
-
} catch (e) {
|
|
2854
|
-
if (e instanceof Found)
|
|
2855
|
-
return e;
|
|
2856
|
-
throw e;
|
|
2857
|
-
}
|
|
2858
|
-
}
|
|
2859
|
-
function findNodeAfter(node, pos, test, baseVisitor, state) {
|
|
2860
|
-
test = makeTest(test), baseVisitor || (baseVisitor = base2);
|
|
2861
|
-
try {
|
|
2862
|
-
(function c(node2, st, override) {
|
|
2863
|
-
if (!(node2.end < pos)) {
|
|
2864
|
-
var type = override || node2.type;
|
|
2865
|
-
if (node2.start >= pos && test(type, node2))
|
|
2866
|
-
throw new Found(node2, st);
|
|
2867
|
-
baseVisitor[type](node2, st, c);
|
|
2868
|
-
}
|
|
2869
|
-
})(node, state);
|
|
2870
|
-
} catch (e) {
|
|
2871
|
-
if (e instanceof Found)
|
|
2872
|
-
return e;
|
|
2873
|
-
throw e;
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
function findNodeBefore(node, pos, test, baseVisitor, state) {
|
|
2877
|
-
test = makeTest(test), baseVisitor || (baseVisitor = base2);
|
|
2878
|
-
var max;
|
|
2879
|
-
return (function c(node2, st, override) {
|
|
2880
|
-
if (!(node2.start > pos)) {
|
|
2881
|
-
var type = override || node2.type;
|
|
2882
|
-
node2.end <= pos && (!max || max.node.end < node2.end) && test(type, node2) && (max = new Found(node2, st)), baseVisitor[type](node2, st, c);
|
|
2883
|
-
}
|
|
2884
|
-
})(node, state), max;
|
|
2885
|
-
}
|
|
2886
|
-
var create = Object.create || function(proto) {
|
|
2887
|
-
function Ctor() {
|
|
2888
|
-
}
|
|
2889
|
-
return Ctor.prototype = proto, new Ctor();
|
|
2890
|
-
};
|
|
2891
|
-
function make(funcs, baseVisitor) {
|
|
2892
|
-
var visitor = create(baseVisitor || base2);
|
|
2893
|
-
for (var type in funcs)
|
|
2894
|
-
visitor[type] = funcs[type];
|
|
2895
|
-
return visitor;
|
|
2896
|
-
}
|
|
2897
|
-
function skipThrough(node, st, c) {
|
|
2898
|
-
c(node, st);
|
|
2899
|
-
}
|
|
2900
|
-
function ignore(_node, _st, _c) {
|
|
2901
|
-
}
|
|
2902
|
-
var base2 = {};
|
|
2903
|
-
base2.Program = base2.BlockStatement = function(node, st, c) {
|
|
2904
|
-
for (var i = 0, list = node.body; i < list.length; i += 1) {
|
|
2905
|
-
var stmt = list[i];
|
|
2906
|
-
c(stmt, st, "Statement");
|
|
2907
|
-
}
|
|
2908
|
-
}, base2.Statement = skipThrough, base2.EmptyStatement = ignore, base2.ExpressionStatement = base2.ParenthesizedExpression = base2.ChainExpression = function(node, st, c) {
|
|
2909
|
-
return c(node.expression, st, "Expression");
|
|
2910
|
-
}, base2.IfStatement = function(node, st, c) {
|
|
2911
|
-
c(node.test, st, "Expression"), c(node.consequent, st, "Statement"), node.alternate && c(node.alternate, st, "Statement");
|
|
2912
|
-
}, base2.LabeledStatement = function(node, st, c) {
|
|
2913
|
-
return c(node.body, st, "Statement");
|
|
2914
|
-
}, base2.BreakStatement = base2.ContinueStatement = ignore, base2.WithStatement = function(node, st, c) {
|
|
2915
|
-
c(node.object, st, "Expression"), c(node.body, st, "Statement");
|
|
2916
|
-
}, base2.SwitchStatement = function(node, st, c) {
|
|
2917
|
-
c(node.discriminant, st, "Expression");
|
|
2918
|
-
for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
|
|
2919
|
-
var cs = list$1[i$1];
|
|
2920
|
-
cs.test && c(cs.test, st, "Expression");
|
|
2921
|
-
for (var i = 0, list = cs.consequent; i < list.length; i += 1) {
|
|
2922
|
-
var cons = list[i];
|
|
2923
|
-
c(cons, st, "Statement");
|
|
2924
|
-
}
|
|
2925
|
-
}
|
|
2926
|
-
}, base2.SwitchCase = function(node, st, c) {
|
|
2927
|
-
node.test && c(node.test, st, "Expression");
|
|
2928
|
-
for (var i = 0, list = node.consequent; i < list.length; i += 1) {
|
|
2929
|
-
var cons = list[i];
|
|
2930
|
-
c(cons, st, "Statement");
|
|
2931
|
-
}
|
|
2932
|
-
}, base2.ReturnStatement = base2.YieldExpression = base2.AwaitExpression = function(node, st, c) {
|
|
2933
|
-
node.argument && c(node.argument, st, "Expression");
|
|
2934
|
-
}, base2.ThrowStatement = base2.SpreadElement = function(node, st, c) {
|
|
2935
|
-
return c(node.argument, st, "Expression");
|
|
2936
|
-
}, base2.TryStatement = function(node, st, c) {
|
|
2937
|
-
c(node.block, st, "Statement"), node.handler && c(node.handler, st), node.finalizer && c(node.finalizer, st, "Statement");
|
|
2938
|
-
}, base2.CatchClause = function(node, st, c) {
|
|
2939
|
-
node.param && c(node.param, st, "Pattern"), c(node.body, st, "Statement");
|
|
2940
|
-
}, base2.WhileStatement = base2.DoWhileStatement = function(node, st, c) {
|
|
2941
|
-
c(node.test, st, "Expression"), c(node.body, st, "Statement");
|
|
2942
|
-
}, base2.ForStatement = function(node, st, c) {
|
|
2943
|
-
node.init && c(node.init, st, "ForInit"), node.test && c(node.test, st, "Expression"), node.update && c(node.update, st, "Expression"), c(node.body, st, "Statement");
|
|
2944
|
-
}, base2.ForInStatement = base2.ForOfStatement = function(node, st, c) {
|
|
2945
|
-
c(node.left, st, "ForInit"), c(node.right, st, "Expression"), c(node.body, st, "Statement");
|
|
2946
|
-
}, base2.ForInit = function(node, st, c) {
|
|
2947
|
-
node.type === "VariableDeclaration" ? c(node, st) : c(node, st, "Expression");
|
|
2948
|
-
}, base2.DebuggerStatement = ignore, base2.FunctionDeclaration = function(node, st, c) {
|
|
2949
|
-
return c(node, st, "Function");
|
|
2950
|
-
}, base2.VariableDeclaration = function(node, st, c) {
|
|
2951
|
-
for (var i = 0, list = node.declarations; i < list.length; i += 1) {
|
|
2952
|
-
var decl = list[i];
|
|
2953
|
-
c(decl, st);
|
|
2954
|
-
}
|
|
2955
|
-
}, base2.VariableDeclarator = function(node, st, c) {
|
|
2956
|
-
c(node.id, st, "Pattern"), node.init && c(node.init, st, "Expression");
|
|
2957
|
-
}, base2.Function = function(node, st, c) {
|
|
2958
|
-
node.id && c(node.id, st, "Pattern");
|
|
2959
|
-
for (var i = 0, list = node.params; i < list.length; i += 1) {
|
|
2960
|
-
var param = list[i];
|
|
2961
|
-
c(param, st, "Pattern");
|
|
2962
|
-
}
|
|
2963
|
-
c(node.body, st, node.expression ? "Expression" : "Statement");
|
|
2964
|
-
}, base2.Pattern = function(node, st, c) {
|
|
2965
|
-
node.type === "Identifier" ? c(node, st, "VariablePattern") : node.type === "MemberExpression" ? c(node, st, "MemberPattern") : c(node, st);
|
|
2966
|
-
}, base2.VariablePattern = ignore, base2.MemberPattern = skipThrough, base2.RestElement = function(node, st, c) {
|
|
2967
|
-
return c(node.argument, st, "Pattern");
|
|
2968
|
-
}, base2.ArrayPattern = function(node, st, c) {
|
|
2969
|
-
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
|
2970
|
-
var elt = list[i];
|
|
2971
|
-
elt && c(elt, st, "Pattern");
|
|
2972
|
-
}
|
|
2973
|
-
}, base2.ObjectPattern = function(node, st, c) {
|
|
2974
|
-
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
2975
|
-
var prop = list[i];
|
|
2976
|
-
prop.type === "Property" ? (prop.computed && c(prop.key, st, "Expression"), c(prop.value, st, "Pattern")) : prop.type === "RestElement" && c(prop.argument, st, "Pattern");
|
|
2977
|
-
}
|
|
2978
|
-
}, base2.Expression = skipThrough, base2.ThisExpression = base2.Super = base2.MetaProperty = ignore, base2.ArrayExpression = function(node, st, c) {
|
|
2979
|
-
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
|
2980
|
-
var elt = list[i];
|
|
2981
|
-
elt && c(elt, st, "Expression");
|
|
2982
|
-
}
|
|
2983
|
-
}, base2.ObjectExpression = function(node, st, c) {
|
|
2984
|
-
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
2985
|
-
var prop = list[i];
|
|
2986
|
-
c(prop, st);
|
|
2987
|
-
}
|
|
2988
|
-
}, base2.FunctionExpression = base2.ArrowFunctionExpression = base2.FunctionDeclaration, base2.SequenceExpression = function(node, st, c) {
|
|
2989
|
-
for (var i = 0, list = node.expressions; i < list.length; i += 1) {
|
|
2990
|
-
var expr = list[i];
|
|
2991
|
-
c(expr, st, "Expression");
|
|
2992
|
-
}
|
|
2993
|
-
}, base2.TemplateLiteral = function(node, st, c) {
|
|
2994
|
-
for (var i = 0, list = node.quasis; i < list.length; i += 1) {
|
|
2995
|
-
var quasi = list[i];
|
|
2996
|
-
c(quasi, st);
|
|
2997
|
-
}
|
|
2998
|
-
for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) {
|
|
2999
|
-
var expr = list$1[i$1];
|
|
3000
|
-
c(expr, st, "Expression");
|
|
3001
|
-
}
|
|
3002
|
-
}, base2.TemplateElement = ignore, base2.UnaryExpression = base2.UpdateExpression = function(node, st, c) {
|
|
3003
|
-
c(node.argument, st, "Expression");
|
|
3004
|
-
}, base2.BinaryExpression = base2.LogicalExpression = function(node, st, c) {
|
|
3005
|
-
c(node.left, st, "Expression"), c(node.right, st, "Expression");
|
|
3006
|
-
}, base2.AssignmentExpression = base2.AssignmentPattern = function(node, st, c) {
|
|
3007
|
-
c(node.left, st, "Pattern"), c(node.right, st, "Expression");
|
|
3008
|
-
}, base2.ConditionalExpression = function(node, st, c) {
|
|
3009
|
-
c(node.test, st, "Expression"), c(node.consequent, st, "Expression"), c(node.alternate, st, "Expression");
|
|
3010
|
-
}, base2.NewExpression = base2.CallExpression = function(node, st, c) {
|
|
3011
|
-
if (c(node.callee, st, "Expression"), node.arguments)
|
|
3012
|
-
for (var i = 0, list = node.arguments; i < list.length; i += 1) {
|
|
3013
|
-
var arg = list[i];
|
|
3014
|
-
c(arg, st, "Expression");
|
|
3015
|
-
}
|
|
3016
|
-
}, base2.MemberExpression = function(node, st, c) {
|
|
3017
|
-
c(node.object, st, "Expression"), node.computed && c(node.property, st, "Expression");
|
|
3018
|
-
}, base2.ExportNamedDeclaration = base2.ExportDefaultDeclaration = function(node, st, c) {
|
|
3019
|
-
node.declaration && c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"), node.source && c(node.source, st, "Expression");
|
|
3020
|
-
}, base2.ExportAllDeclaration = function(node, st, c) {
|
|
3021
|
-
node.exported && c(node.exported, st), c(node.source, st, "Expression");
|
|
3022
|
-
}, base2.ImportDeclaration = function(node, st, c) {
|
|
3023
|
-
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
3024
|
-
var spec = list[i];
|
|
3025
|
-
c(spec, st);
|
|
3026
|
-
}
|
|
3027
|
-
c(node.source, st, "Expression");
|
|
3028
|
-
}, base2.ImportExpression = function(node, st, c) {
|
|
3029
|
-
c(node.source, st, "Expression");
|
|
3030
|
-
}, base2.ImportSpecifier = base2.ImportDefaultSpecifier = base2.ImportNamespaceSpecifier = base2.Identifier = base2.Literal = ignore, base2.TaggedTemplateExpression = function(node, st, c) {
|
|
3031
|
-
c(node.tag, st, "Expression"), c(node.quasi, st, "Expression");
|
|
3032
|
-
}, base2.ClassDeclaration = base2.ClassExpression = function(node, st, c) {
|
|
3033
|
-
return c(node, st, "Class");
|
|
3034
|
-
}, base2.Class = function(node, st, c) {
|
|
3035
|
-
node.id && c(node.id, st, "Pattern"), node.superClass && c(node.superClass, st, "Expression"), c(node.body, st);
|
|
3036
|
-
}, base2.ClassBody = function(node, st, c) {
|
|
3037
|
-
for (var i = 0, list = node.body; i < list.length; i += 1) {
|
|
3038
|
-
var elt = list[i];
|
|
3039
|
-
c(elt, st);
|
|
3040
|
-
}
|
|
3041
|
-
}, base2.MethodDefinition = base2.Property = function(node, st, c) {
|
|
3042
|
-
node.computed && c(node.key, st, "Expression"), c(node.value, st, "Expression");
|
|
3043
|
-
}, exports2.ancestor = ancestor2, exports2.base = base2, exports2.findNodeAfter = findNodeAfter, exports2.findNodeAround = findNodeAround, exports2.findNodeAt = findNodeAt, exports2.findNodeBefore = findNodeBefore, exports2.full = full, exports2.fullAncestor = fullAncestor, exports2.make = make, exports2.recursive = recursive, exports2.simple = simple2, Object.defineProperty(exports2, "__esModule", { value: !0 });
|
|
3044
|
-
}));
|
|
3045
|
-
}
|
|
3046
|
-
});
|
|
3047
|
-
|
|
3048
2781
|
// ../../node_modules/html-tags/html-tags.json
|
|
3049
2782
|
var require_html_tags = __commonJS({
|
|
3050
2783
|
"../../node_modules/html-tags/html-tags.json"(exports, module) {
|
|
@@ -3186,69 +2919,60 @@ import { API } from "typescript-native/unstable/sync";
|
|
|
3186
2919
|
|
|
3187
2920
|
// src/react/componentManifest/componentMeta/componentMetaExtractor.ts
|
|
3188
2921
|
import {
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
2922
|
+
SymbolFlags as SymbolFlags3
|
|
2923
|
+
} from "typescript-native/unstable/sync";
|
|
2924
|
+
|
|
2925
|
+
// src/react/componentManifest/componentMeta/defaultValues.ts
|
|
2926
|
+
import {
|
|
2927
|
+
SyntaxKind as SyntaxKind2,
|
|
2928
|
+
isArrowFunction as isArrowFunction2,
|
|
2929
|
+
isAsExpression as isAsExpression2,
|
|
3192
2930
|
isAwaitExpression,
|
|
3193
|
-
isBinaryExpression,
|
|
2931
|
+
isBinaryExpression as isBinaryExpression2,
|
|
3194
2932
|
isBindingElement,
|
|
3195
2933
|
isBlock,
|
|
3196
2934
|
isCallExpression,
|
|
3197
2935
|
isClassDeclaration,
|
|
3198
2936
|
isConditionalExpression,
|
|
3199
|
-
isEnumDeclaration,
|
|
3200
2937
|
isEnumMember,
|
|
3201
2938
|
isExportAssignment,
|
|
3202
2939
|
isExpressionStatement,
|
|
3203
2940
|
isFunctionDeclaration,
|
|
3204
|
-
isFunctionExpression,
|
|
3205
|
-
isIdentifier,
|
|
3206
|
-
isImportDeclaration,
|
|
3207
|
-
isInterfaceDeclaration,
|
|
3208
|
-
isJsxOpeningElement,
|
|
3209
|
-
isJsxSelfClosingElement,
|
|
3210
|
-
isLiteralTypeNode,
|
|
3211
|
-
isNamedImports,
|
|
3212
|
-
isNamespaceImport,
|
|
2941
|
+
isFunctionExpression as isFunctionExpression2,
|
|
2942
|
+
isIdentifier as isIdentifier2,
|
|
3213
2943
|
isNewExpression,
|
|
3214
|
-
isNonNullExpression,
|
|
3215
|
-
isNumericLiteral,
|
|
3216
2944
|
isObjectBindingPattern,
|
|
3217
2945
|
isObjectLiteralExpression,
|
|
3218
|
-
isParenthesizedExpression,
|
|
2946
|
+
isParenthesizedExpression as isParenthesizedExpression2,
|
|
3219
2947
|
isPropertyAccessExpression,
|
|
2948
|
+
isPropertyAssignment as isPropertyAssignment2,
|
|
2949
|
+
isPropertyDeclaration as isPropertyDeclaration2,
|
|
2950
|
+
isSatisfiesExpression as isSatisfiesExpression2,
|
|
2951
|
+
isShorthandPropertyAssignment as isShorthandPropertyAssignment2,
|
|
2952
|
+
isVariableDeclaration as isVariableDeclaration2,
|
|
2953
|
+
isVariableStatement
|
|
2954
|
+
} from "typescript-native/unstable/ast";
|
|
2955
|
+
|
|
2956
|
+
// src/react/componentManifest/componentMeta/symbols.ts
|
|
2957
|
+
import {
|
|
2958
|
+
SyntaxKind,
|
|
2959
|
+
isArrowFunction,
|
|
2960
|
+
isAsExpression,
|
|
2961
|
+
isBinaryExpression,
|
|
2962
|
+
isFunctionExpression,
|
|
2963
|
+
isIdentifier,
|
|
2964
|
+
isNonNullExpression,
|
|
2965
|
+
isParenthesizedExpression,
|
|
3220
2966
|
isPropertyAssignment,
|
|
3221
2967
|
isPropertyDeclaration,
|
|
3222
2968
|
isSatisfiesExpression,
|
|
3223
2969
|
isShorthandPropertyAssignment,
|
|
3224
|
-
|
|
3225
|
-
isTypeAliasDeclaration,
|
|
3226
|
-
isTypeReferenceNode,
|
|
3227
|
-
isUnionTypeNode,
|
|
3228
|
-
isVariableDeclaration,
|
|
3229
|
-
isVariableStatement
|
|
2970
|
+
isVariableDeclaration
|
|
3230
2971
|
} from "typescript-native/unstable/ast";
|
|
3231
2972
|
import {
|
|
3232
|
-
|
|
3233
|
-
SymbolFlags,
|
|
3234
|
-
TypeFlags,
|
|
3235
|
-
isUnionType
|
|
2973
|
+
SymbolFlags
|
|
3236
2974
|
} from "typescript-native/unstable/sync";
|
|
3237
2975
|
var LARGE_SOURCE_THRESHOLD = 30, MAX_DEPTH = 5;
|
|
3238
|
-
function extractComponentDocFromStory(project, storyPath, ref) {
|
|
3239
|
-
let storyFile = project.program.getSourceFile(storyPath);
|
|
3240
|
-
if (!storyFile || !ref.importName)
|
|
3241
|
-
return;
|
|
3242
|
-
let ctx = { project, checker: project.checker }, imported = findImport(ctx, storyFile, ref), resolved = (imported && resolveFromStoryJsx(ctx, storyFile, ref, imported.local)) ?? resolveFromMetaComponent(ctx, storyFile, ref, imported?.local) ?? (imported && resolveFromModuleExport(ctx, imported.module, ref));
|
|
3243
|
-
return resolved && serializeComponentDoc(ctx, resolved, ref.importName, ref, imported?.module);
|
|
3244
|
-
}
|
|
3245
|
-
function extractComponentDocFromFile(project, filePath, exportName = "default") {
|
|
3246
|
-
let sourceFile = project.program.getSourceFile(filePath), ctx = { project, checker: project.checker }, module = sourceFile && ctx.checker.getSymbolAtLocation(sourceFile);
|
|
3247
|
-
if (!module)
|
|
3248
|
-
return;
|
|
3249
|
-
let ref = { componentName: exportName, importName: exportName, isPackage: !1 }, resolved = resolveFromModuleExport(ctx, module, ref);
|
|
3250
|
-
return resolved && serializeComponentDoc(ctx, resolved, exportName, { ...ref, path: filePath }, module);
|
|
3251
|
-
}
|
|
3252
2976
|
function resolveAlias(ctx, symbol) {
|
|
3253
2977
|
if (!(symbol.flags & SymbolFlags.Alias))
|
|
3254
2978
|
return symbol;
|
|
@@ -3293,6 +3017,140 @@ function resolveComponentSymbol(ctx, symbol, depth = 0) {
|
|
|
3293
3017
|
let next;
|
|
3294
3018
|
return isShorthandPropertyAssignment(declaration) ? next = ctx.checker.getShorthandAssignmentValueSymbol(declaration) : isPropertyAssignment(declaration) ? next = ctx.checker.getSymbolAtLocation(skipWrappers(declaration.initializer)) : isBinaryExpression(declaration) && declaration.operatorToken.kind === SyntaxKind.EqualsToken ? next = ctx.checker.getSymbolAtLocation(skipWrappers(declaration.right)) : (declaration.kind === SyntaxKind.PropertySignature || isPropertyDeclaration(declaration)) && (next = ctx.checker.getTypeOfSymbol(resolved)?.getSymbol()), next && !sameSymbol(resolveAlias(ctx, next), resolved) ? resolveComponentSymbol(ctx, next, depth + 1) : resolved;
|
|
3295
3019
|
}
|
|
3020
|
+
|
|
3021
|
+
// src/react/componentManifest/componentMeta/defaultValues.ts
|
|
3022
|
+
function isFunctionLike(node) {
|
|
3023
|
+
return isArrowFunction2(node) || isFunctionExpression2(node) || isFunctionDeclaration(node);
|
|
3024
|
+
}
|
|
3025
|
+
function findFunction(ctx, node, depth = 0) {
|
|
3026
|
+
if (!(!node || depth > MAX_DEPTH)) {
|
|
3027
|
+
if (isFunctionLike(node))
|
|
3028
|
+
return node;
|
|
3029
|
+
if (isParenthesizedExpression2(node) || isAsExpression2(node) || isSatisfiesExpression2(node))
|
|
3030
|
+
return findFunction(ctx, node.expression, depth + 1);
|
|
3031
|
+
if (isCallExpression(node)) {
|
|
3032
|
+
for (let argument of node.arguments) {
|
|
3033
|
+
let fn = findFunction(ctx, argument, depth + 1);
|
|
3034
|
+
if (fn)
|
|
3035
|
+
return fn;
|
|
3036
|
+
}
|
|
3037
|
+
return;
|
|
3038
|
+
}
|
|
3039
|
+
if (isIdentifier2(node)) {
|
|
3040
|
+
let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol));
|
|
3041
|
+
if (declaration && isVariableDeclaration2(declaration))
|
|
3042
|
+
return findFunction(ctx, declaration.initializer, depth + 1);
|
|
3043
|
+
if (declaration && isFunctionDeclaration(declaration))
|
|
3044
|
+
return declaration;
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
function resolveLiteral(ctx, node, depth = 0) {
|
|
3049
|
+
return depth > MAX_DEPTH || !(isIdentifier2(node) || isPropertyAccessExpression(node)) ? node.getText() : isIdentifier2(node) && node.text === "undefined" ? "undefined" : resolveSymbolLiteral(ctx, ctx.checker.getSymbolAtLocation(node), node.getText(), depth);
|
|
3050
|
+
}
|
|
3051
|
+
function resolveSymbolLiteral(ctx, symbol, text, depth = 0) {
|
|
3052
|
+
let declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol)), initializer = declaration && (isVariableDeclaration2(declaration) || isEnumMember(declaration) || isBindingElement(declaration) || isPropertyAssignment2(declaration)) ? declaration.initializer : void 0;
|
|
3053
|
+
return initializer ? resolveLiteral(ctx, initializer, depth + 1) : text;
|
|
3054
|
+
}
|
|
3055
|
+
function collectBindingDefaults(ctx, pattern, defaults) {
|
|
3056
|
+
for (let element of pattern.elements)
|
|
3057
|
+
if (element.initializer && element.name) {
|
|
3058
|
+
let name = (element.propertyName ?? element.name).getText();
|
|
3059
|
+
defaults.set(name, resolveLiteral(ctx, element.initializer));
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
function readsProps(ctx, node, props) {
|
|
3063
|
+
let expression = skipWrappers(node);
|
|
3064
|
+
return isIdentifier2(expression) ? sameSymbol(ctx.checker.getSymbolAtLocation(expression), props) : isAwaitExpression(expression) ? readsProps(ctx, expression.expression, props) : isBinaryExpression2(expression) ? readsProps(ctx, expression.left, props) || readsProps(ctx, expression.right, props) : isConditionalExpression(expression) ? readsProps(ctx, expression.whenTrue, props) || readsProps(ctx, expression.whenFalse, props) : isCallExpression(expression) || isNewExpression(expression) ? expression.arguments?.some((argument) => readsProps(ctx, argument, props)) ?? !1 : !1;
|
|
3065
|
+
}
|
|
3066
|
+
function getDestructuringDefaults(ctx, component) {
|
|
3067
|
+
let defaults = /* @__PURE__ */ new Map(), declarations = getDeclarations(ctx, component), declaration = getDeclaration(ctx, component), fn;
|
|
3068
|
+
declaration && isFunctionDeclaration(declaration) ? fn = declarations.find(
|
|
3069
|
+
(node) => isFunctionDeclaration(node) && !!node.body
|
|
3070
|
+
) : declaration && isVariableDeclaration2(declaration) ? fn = findFunction(ctx, declaration.initializer) : declaration && isExportAssignment(declaration) && (fn = findFunction(ctx, declaration.expression));
|
|
3071
|
+
let [propsParameter] = fn?.parameters ?? [];
|
|
3072
|
+
if (!fn || !propsParameter)
|
|
3073
|
+
return defaults;
|
|
3074
|
+
if (isObjectBindingPattern(propsParameter.name))
|
|
3075
|
+
return collectBindingDefaults(ctx, propsParameter.name, defaults), defaults;
|
|
3076
|
+
let props = isIdentifier2(propsParameter.name) ? ctx.checker.getSymbolAtLocation(propsParameter.name) : void 0;
|
|
3077
|
+
if (!props || !fn.body || !isBlock(fn.body))
|
|
3078
|
+
return defaults;
|
|
3079
|
+
for (let statement of fn.body.statements)
|
|
3080
|
+
if (isVariableStatement(statement))
|
|
3081
|
+
for (let variable of statement.declarationList.declarations)
|
|
3082
|
+
isObjectBindingPattern(variable.name) && variable.initializer && readsProps(ctx, variable.initializer, props) && collectBindingDefaults(ctx, variable.name, defaults);
|
|
3083
|
+
return defaults;
|
|
3084
|
+
}
|
|
3085
|
+
function collectObjectDefaults(ctx, object, defaults) {
|
|
3086
|
+
for (let property of object.properties)
|
|
3087
|
+
if (isPropertyAssignment2(property))
|
|
3088
|
+
defaults.set(property.name.getText(), resolveLiteral(ctx, property.initializer));
|
|
3089
|
+
else if (isShorthandPropertyAssignment2(property)) {
|
|
3090
|
+
let name = property.name.getText(), symbol = ctx.checker.getShorthandAssignmentValueSymbol(property);
|
|
3091
|
+
defaults.set(name, resolveSymbolLiteral(ctx, symbol, name));
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
function toObjectLiteral(ctx, node) {
|
|
3095
|
+
if (node && isIdentifier2(node)) {
|
|
3096
|
+
let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, symbol);
|
|
3097
|
+
node = declaration && isVariableDeclaration2(declaration) ? declaration.initializer : void 0;
|
|
3098
|
+
}
|
|
3099
|
+
return node && isObjectLiteralExpression(node) ? node : void 0;
|
|
3100
|
+
}
|
|
3101
|
+
function getDefaultPropsDefaults(ctx, component) {
|
|
3102
|
+
let defaults = /* @__PURE__ */ new Map(), sourceFile = getDeclaration(ctx, component)?.getSourceFile();
|
|
3103
|
+
if (!sourceFile)
|
|
3104
|
+
return defaults;
|
|
3105
|
+
let isComponent = (node) => {
|
|
3106
|
+
let symbol = ctx.checker.getSymbolAtLocation(node);
|
|
3107
|
+
return !!symbol && sameSymbol(resolveAlias(ctx, symbol), component);
|
|
3108
|
+
};
|
|
3109
|
+
for (let statement of sourceFile.statements) {
|
|
3110
|
+
if (isClassDeclaration(statement) && statement.name && isComponent(statement.name)) {
|
|
3111
|
+
for (let member of statement.members)
|
|
3112
|
+
if (isPropertyDeclaration2(member) && member.name.getText() === "defaultProps") {
|
|
3113
|
+
let object = toObjectLiteral(ctx, member.initializer);
|
|
3114
|
+
object && collectObjectDefaults(ctx, object, defaults);
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
if (isExpressionStatement(statement) && isBinaryExpression2(statement.expression) && statement.expression.operatorToken.kind === SyntaxKind2.EqualsToken && isPropertyAccessExpression(statement.expression.left) && statement.expression.left.name.text === "defaultProps" && isComponent(statement.expression.left.expression)) {
|
|
3118
|
+
let object = toObjectLiteral(ctx, statement.expression.right);
|
|
3119
|
+
object && collectObjectDefaults(ctx, object, defaults);
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
return defaults;
|
|
3123
|
+
}
|
|
3124
|
+
function findImplementation(ctx, symbol) {
|
|
3125
|
+
let current = symbol;
|
|
3126
|
+
for (let depth = 0; depth <= MAX_DEPTH; depth++) {
|
|
3127
|
+
let declaration = getDeclaration(ctx, current);
|
|
3128
|
+
if (!declaration || !isVariableDeclaration2(declaration) || !declaration.initializer || !isIdentifier2(declaration.initializer))
|
|
3129
|
+
break;
|
|
3130
|
+
let next = ctx.checker.getSymbolAtLocation(declaration.initializer);
|
|
3131
|
+
if (!next)
|
|
3132
|
+
break;
|
|
3133
|
+
current = resolveAlias(ctx, next);
|
|
3134
|
+
}
|
|
3135
|
+
return current;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
// src/react/componentManifest/componentMeta/findPropsType.ts
|
|
3139
|
+
import {
|
|
3140
|
+
isIdentifier as isIdentifier3,
|
|
3141
|
+
isImportDeclaration,
|
|
3142
|
+
isJsxOpeningElement,
|
|
3143
|
+
isJsxSelfClosingElement,
|
|
3144
|
+
isNamedImports,
|
|
3145
|
+
isNamespaceImport,
|
|
3146
|
+
isPropertyAccessExpression as isPropertyAccessExpression2,
|
|
3147
|
+
isPropertyAssignment as isPropertyAssignment3,
|
|
3148
|
+
isStringLiteral
|
|
3149
|
+
} from "typescript-native/unstable/ast";
|
|
3150
|
+
import {
|
|
3151
|
+
SignatureKind,
|
|
3152
|
+
TypeFlags
|
|
3153
|
+
} from "typescript-native/unstable/sync";
|
|
3296
3154
|
function findImport(ctx, storyFile, ref) {
|
|
3297
3155
|
for (let statement of storyFile.statements) {
|
|
3298
3156
|
if (!isImportDeclaration(statement) || !isStringLiteral(statement.moduleSpecifier) || statement.moduleSpecifier.text !== ref.importId || !statement.importClause)
|
|
@@ -3310,9 +3168,9 @@ function resolveFromStoryJsx(ctx, storyFile, ref, local) {
|
|
|
3310
3168
|
let result, visit = (node) => {
|
|
3311
3169
|
if (!result) {
|
|
3312
3170
|
if (isJsxSelfClosingElement(node) || isJsxOpeningElement(node)) {
|
|
3313
|
-
let { tagName } = node, signature = (ref.member ?
|
|
3171
|
+
let { tagName } = node, signature = (ref.member ? isPropertyAccessExpression2(tagName) && tagName.name.text === ref.member && sameSymbol(ctx.checker.getSymbolAtLocation(tagName.expression), local) : isIdentifier3(tagName) && sameSymbol(ctx.checker.getSymbolAtLocation(tagName), local)) ? ctx.checker.getResolvedSignature(node) : void 0;
|
|
3314
3172
|
if (signature) {
|
|
3315
|
-
let [propsParameter] = signature.getParameters(), member = ref.member &&
|
|
3173
|
+
let [propsParameter] = signature.getParameters(), member = ref.member && isPropertyAccessExpression2(tagName) ? ctx.checker.getSymbolAtLocation(tagName.name) : void 0;
|
|
3316
3174
|
result = {
|
|
3317
3175
|
propsType: propsParameter ? ctx.checker.getTypeOfSymbolAtLocation(propsParameter, node) : void 0,
|
|
3318
3176
|
symbol: resolveComponentSymbol(ctx, member ?? local)
|
|
@@ -3327,13 +3185,13 @@ function resolveFromStoryJsx(ctx, storyFile, ref, local) {
|
|
|
3327
3185
|
}
|
|
3328
3186
|
function resolveFromMetaComponent(ctx, storyFile, ref, local) {
|
|
3329
3187
|
let module = ctx.checker.getSymbolAtLocation(storyFile), meta = module && getExport(ctx, module, "default"), metaType = meta && ctx.checker.getTypeOfSymbol(meta), componentProperty = metaType && getProperty(ctx, metaType, "component"), declaration = componentProperty && getDeclaration(ctx, componentProperty);
|
|
3330
|
-
if (!componentProperty || !declaration || !
|
|
3188
|
+
if (!componentProperty || !declaration || !isPropertyAssignment3(declaration))
|
|
3331
3189
|
return;
|
|
3332
|
-
let initializer = skipWrappers(declaration.initializer), metaName =
|
|
3190
|
+
let initializer = skipWrappers(declaration.initializer), metaName = isIdentifier3(initializer) ? initializer.text : isPropertyAccessExpression2(initializer) && isIdentifier3(initializer.expression) ? `${initializer.expression.text}.${initializer.name.text}` : void 0, initializerSymbol = ctx.checker.getSymbolAtLocation(initializer);
|
|
3333
3191
|
if (!(!ref.member && local && initializerSymbol ? sameSymbol(resolveAlias(ctx, local), resolveAlias(ctx, initializerSymbol)) : metaName === ref.componentName) || !initializerSymbol)
|
|
3334
3192
|
return;
|
|
3335
3193
|
let componentType = ctx.checker.getTypeOfSymbol(componentProperty), symbol = initializerSymbol;
|
|
3336
|
-
if (ref.member && !
|
|
3194
|
+
if (ref.member && !isPropertyAccessExpression2(initializer)) {
|
|
3337
3195
|
let member = componentType && getProperty(ctx, componentType, ref.member);
|
|
3338
3196
|
if (!member)
|
|
3339
3197
|
return;
|
|
@@ -3363,16 +3221,33 @@ function resolveFromComponentType(ctx, componentType, symbol) {
|
|
|
3363
3221
|
return { propsType, symbol };
|
|
3364
3222
|
}
|
|
3365
3223
|
}
|
|
3224
|
+
|
|
3225
|
+
// src/react/componentManifest/componentMeta/props.ts
|
|
3226
|
+
import {
|
|
3227
|
+
isEnumDeclaration,
|
|
3228
|
+
isInterfaceDeclaration,
|
|
3229
|
+
isLiteralTypeNode,
|
|
3230
|
+
isNumericLiteral,
|
|
3231
|
+
isStringLiteral as isStringLiteral2,
|
|
3232
|
+
isTypeAliasDeclaration,
|
|
3233
|
+
isTypeReferenceNode,
|
|
3234
|
+
isUnionTypeNode
|
|
3235
|
+
} from "typescript-native/unstable/ast";
|
|
3236
|
+
import {
|
|
3237
|
+
SymbolFlags as SymbolFlags2,
|
|
3238
|
+
TypeFlags as TypeFlags2,
|
|
3239
|
+
isUnionType
|
|
3240
|
+
} from "typescript-native/unstable/sync";
|
|
3366
3241
|
function getPropSymbols(ctx, propsType, location) {
|
|
3367
3242
|
let members = isUnionType(propsType) ? propsType.getTypes() : [];
|
|
3368
3243
|
if (members.length === 0) {
|
|
3369
3244
|
let apparent = ctx.checker.getApparentType(propsType) ?? propsType;
|
|
3370
3245
|
return ctx.checker.getPropertiesOfType(apparent).map((symbol) => ({ symbol, forceOptional: !1 }));
|
|
3371
3246
|
}
|
|
3372
|
-
let isDegraded = (symbol) => !!(ctx.checker.getTypeOfSymbolAtLocation(symbol, location).flags & (
|
|
3247
|
+
let isDegraded = (symbol) => !!(ctx.checker.getTypeOfSymbolAtLocation(symbol, location).flags & (TypeFlags2.Never | TypeFlags2.Undefined)), props = /* @__PURE__ */ new Map();
|
|
3373
3248
|
for (let member of members)
|
|
3374
3249
|
for (let symbol of ctx.checker.getPropertiesOfType(member)) {
|
|
3375
|
-
let degraded = isDegraded(symbol), optional = !!(symbol.flags &
|
|
3250
|
+
let degraded = isDegraded(symbol), optional = !!(symbol.flags & SymbolFlags2.Optional) || degraded, existing = props.get(symbol.name);
|
|
3376
3251
|
if (!existing) {
|
|
3377
3252
|
props.set(symbol.name, { symbol, forceOptional: optional, count: 1, degraded });
|
|
3378
3253
|
continue;
|
|
@@ -3421,7 +3296,7 @@ function getSourceLiteralOrder(ctx, prop) {
|
|
|
3421
3296
|
else if (isTypeReferenceNode(node)) {
|
|
3422
3297
|
let symbol = ctx.checker.getSymbolAtLocation(node.typeName), alias = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol));
|
|
3423
3298
|
alias && isTypeAliasDeclaration(alias) && visit(alias.type, depth + 1), alias && isEnumDeclaration(alias) && alias.members.forEach((member) => visit(member.initializer, depth + 1));
|
|
3424
|
-
} else (
|
|
3299
|
+
} else (isStringLiteral2(node) || isNumericLiteral(node)) && texts.push(node.getText());
|
|
3425
3300
|
}, declaration = getDeclaration(ctx, prop);
|
|
3426
3301
|
return declaration && "type" in declaration && visit(declaration.type, 0), texts.map((text) => text.replace(/^'(.*)'$/s, (_, value) => JSON.stringify(value)));
|
|
3427
3302
|
}
|
|
@@ -3430,11 +3305,11 @@ function serializeType(ctx, type, required, sourceOrder, depth = 0) {
|
|
|
3430
3305
|
if (depth > MAX_DEPTH)
|
|
3431
3306
|
return { name: checker.typeToString(type) };
|
|
3432
3307
|
if (isUnionType(type)) {
|
|
3433
|
-
let all = type.getTypes(), members = all.filter((member) => !(member.flags &
|
|
3434
|
-
if (members.length === 2 && members.every((member) => member.flags &
|
|
3308
|
+
let all = type.getTypes(), members = all.filter((member) => !(member.flags & TypeFlags2.Undefined));
|
|
3309
|
+
if (members.length === 2 && members.every((member) => member.flags & TypeFlags2.BooleanLiteral))
|
|
3435
3310
|
return { name: "boolean" };
|
|
3436
3311
|
let literals = members.filter(
|
|
3437
|
-
(member) => !!(member.flags & (
|
|
3312
|
+
(member) => !!(member.flags & (TypeFlags2.StringLiteral | TypeFlags2.NumberLiteral))
|
|
3438
3313
|
);
|
|
3439
3314
|
if (literals.length > 0 && literals.length === members.length) {
|
|
3440
3315
|
let order = sourceOrder(), position = (member) => {
|
|
@@ -3450,127 +3325,28 @@ function serializeType(ctx, type, required, sourceOrder, depth = 0) {
|
|
|
3450
3325
|
if (!required && members.length === 1 && members.length < all.length)
|
|
3451
3326
|
return { name: checker.typeToString(members[0]) };
|
|
3452
3327
|
}
|
|
3453
|
-
if (type.flags &
|
|
3328
|
+
if (type.flags & TypeFlags2.TypeParameter) {
|
|
3454
3329
|
let constraint = checker.getBaseConstraintOfType(type);
|
|
3455
3330
|
if (constraint && constraint.id !== type.id)
|
|
3456
3331
|
return serializeType(ctx, constraint, required, sourceOrder, depth + 1);
|
|
3457
3332
|
}
|
|
3458
3333
|
return { name: checker.typeToString(type) };
|
|
3459
3334
|
}
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
if (!
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
return findFunction(ctx, node.expression, depth + 1);
|
|
3469
|
-
if (isCallExpression(node)) {
|
|
3470
|
-
for (let argument of node.arguments) {
|
|
3471
|
-
let fn = findFunction(ctx, argument, depth + 1);
|
|
3472
|
-
if (fn)
|
|
3473
|
-
return fn;
|
|
3474
|
-
}
|
|
3475
|
-
return;
|
|
3476
|
-
}
|
|
3477
|
-
if (isIdentifier(node)) {
|
|
3478
|
-
let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol));
|
|
3479
|
-
if (declaration && isVariableDeclaration(declaration))
|
|
3480
|
-
return findFunction(ctx, declaration.initializer, depth + 1);
|
|
3481
|
-
if (declaration && isFunctionDeclaration(declaration))
|
|
3482
|
-
return declaration;
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
}
|
|
3486
|
-
function resolveLiteral(ctx, node, depth = 0) {
|
|
3487
|
-
return depth > MAX_DEPTH || !(isIdentifier(node) || isPropertyAccessExpression(node)) ? node.getText() : isIdentifier(node) && node.text === "undefined" ? "undefined" : resolveSymbolLiteral(ctx, ctx.checker.getSymbolAtLocation(node), node.getText(), depth);
|
|
3488
|
-
}
|
|
3489
|
-
function resolveSymbolLiteral(ctx, symbol, text, depth = 0) {
|
|
3490
|
-
let declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol)), initializer = declaration && (isVariableDeclaration(declaration) || isEnumMember(declaration) || isBindingElement(declaration) || isPropertyAssignment(declaration)) ? declaration.initializer : void 0;
|
|
3491
|
-
return initializer ? resolveLiteral(ctx, initializer, depth + 1) : text;
|
|
3492
|
-
}
|
|
3493
|
-
function collectBindingDefaults(ctx, pattern, defaults) {
|
|
3494
|
-
for (let element of pattern.elements)
|
|
3495
|
-
if (element.initializer && element.name) {
|
|
3496
|
-
let name = (element.propertyName ?? element.name).getText();
|
|
3497
|
-
defaults.set(name, resolveLiteral(ctx, element.initializer));
|
|
3498
|
-
}
|
|
3499
|
-
}
|
|
3500
|
-
function readsProps(ctx, node, props) {
|
|
3501
|
-
let expression = skipWrappers(node);
|
|
3502
|
-
return isIdentifier(expression) ? sameSymbol(ctx.checker.getSymbolAtLocation(expression), props) : isAwaitExpression(expression) ? readsProps(ctx, expression.expression, props) : isBinaryExpression(expression) ? readsProps(ctx, expression.left, props) || readsProps(ctx, expression.right, props) : isConditionalExpression(expression) ? readsProps(ctx, expression.whenTrue, props) || readsProps(ctx, expression.whenFalse, props) : isCallExpression(expression) || isNewExpression(expression) ? expression.arguments?.some((argument) => readsProps(ctx, argument, props)) ?? !1 : !1;
|
|
3503
|
-
}
|
|
3504
|
-
function getDestructuringDefaults(ctx, component) {
|
|
3505
|
-
let defaults = /* @__PURE__ */ new Map(), declarations = getDeclarations(ctx, component), declaration = getDeclaration(ctx, component), fn;
|
|
3506
|
-
declaration && isFunctionDeclaration(declaration) ? fn = declarations.find(
|
|
3507
|
-
(node) => isFunctionDeclaration(node) && !!node.body
|
|
3508
|
-
) : declaration && isVariableDeclaration(declaration) ? fn = findFunction(ctx, declaration.initializer) : declaration && isExportAssignment(declaration) && (fn = findFunction(ctx, declaration.expression));
|
|
3509
|
-
let [propsParameter] = fn?.parameters ?? [];
|
|
3510
|
-
if (!fn || !propsParameter)
|
|
3511
|
-
return defaults;
|
|
3512
|
-
if (isObjectBindingPattern(propsParameter.name))
|
|
3513
|
-
return collectBindingDefaults(ctx, propsParameter.name, defaults), defaults;
|
|
3514
|
-
let props = isIdentifier(propsParameter.name) ? ctx.checker.getSymbolAtLocation(propsParameter.name) : void 0;
|
|
3515
|
-
if (!props || !fn.body || !isBlock(fn.body))
|
|
3516
|
-
return defaults;
|
|
3517
|
-
for (let statement of fn.body.statements)
|
|
3518
|
-
if (isVariableStatement(statement))
|
|
3519
|
-
for (let variable of statement.declarationList.declarations)
|
|
3520
|
-
isObjectBindingPattern(variable.name) && variable.initializer && readsProps(ctx, variable.initializer, props) && collectBindingDefaults(ctx, variable.name, defaults);
|
|
3521
|
-
return defaults;
|
|
3522
|
-
}
|
|
3523
|
-
function collectObjectDefaults(ctx, object, defaults) {
|
|
3524
|
-
for (let property of object.properties)
|
|
3525
|
-
if (isPropertyAssignment(property))
|
|
3526
|
-
defaults.set(property.name.getText(), resolveLiteral(ctx, property.initializer));
|
|
3527
|
-
else if (isShorthandPropertyAssignment(property)) {
|
|
3528
|
-
let name = property.name.getText(), symbol = ctx.checker.getShorthandAssignmentValueSymbol(property);
|
|
3529
|
-
defaults.set(name, resolveSymbolLiteral(ctx, symbol, name));
|
|
3530
|
-
}
|
|
3531
|
-
}
|
|
3532
|
-
function toObjectLiteral(ctx, node) {
|
|
3533
|
-
if (node && isIdentifier(node)) {
|
|
3534
|
-
let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, symbol);
|
|
3535
|
-
node = declaration && isVariableDeclaration(declaration) ? declaration.initializer : void 0;
|
|
3536
|
-
}
|
|
3537
|
-
return node && isObjectLiteralExpression(node) ? node : void 0;
|
|
3538
|
-
}
|
|
3539
|
-
function getDefaultPropsDefaults(ctx, component) {
|
|
3540
|
-
let defaults = /* @__PURE__ */ new Map(), sourceFile = getDeclaration(ctx, component)?.getSourceFile();
|
|
3541
|
-
if (!sourceFile)
|
|
3542
|
-
return defaults;
|
|
3543
|
-
let isComponent = (node) => {
|
|
3544
|
-
let symbol = ctx.checker.getSymbolAtLocation(node);
|
|
3545
|
-
return !!symbol && sameSymbol(resolveAlias(ctx, symbol), component);
|
|
3546
|
-
};
|
|
3547
|
-
for (let statement of sourceFile.statements) {
|
|
3548
|
-
if (isClassDeclaration(statement) && statement.name && isComponent(statement.name)) {
|
|
3549
|
-
for (let member of statement.members)
|
|
3550
|
-
if (isPropertyDeclaration(member) && member.name.getText() === "defaultProps") {
|
|
3551
|
-
let object = toObjectLiteral(ctx, member.initializer);
|
|
3552
|
-
object && collectObjectDefaults(ctx, object, defaults);
|
|
3553
|
-
}
|
|
3554
|
-
}
|
|
3555
|
-
if (isExpressionStatement(statement) && isBinaryExpression(statement.expression) && statement.expression.operatorToken.kind === SyntaxKind.EqualsToken && isPropertyAccessExpression(statement.expression.left) && statement.expression.left.name.text === "defaultProps" && isComponent(statement.expression.left.expression)) {
|
|
3556
|
-
let object = toObjectLiteral(ctx, statement.expression.right);
|
|
3557
|
-
object && collectObjectDefaults(ctx, object, defaults);
|
|
3558
|
-
}
|
|
3559
|
-
}
|
|
3560
|
-
return defaults;
|
|
3335
|
+
|
|
3336
|
+
// src/react/componentManifest/componentMeta/componentMetaExtractor.ts
|
|
3337
|
+
function extractComponentDocFromStory(project, storyPath, ref) {
|
|
3338
|
+
let storyFile = project.program.getSourceFile(storyPath);
|
|
3339
|
+
if (!storyFile || !ref.importName)
|
|
3340
|
+
return;
|
|
3341
|
+
let ctx = { project, checker: project.checker }, imported = findImport(ctx, storyFile, ref), resolved = (imported && resolveFromStoryJsx(ctx, storyFile, ref, imported.local)) ?? resolveFromMetaComponent(ctx, storyFile, ref, imported?.local) ?? (imported && resolveFromModuleExport(ctx, imported.module, ref));
|
|
3342
|
+
return resolved && serializeComponentDoc(ctx, resolved, ref.importName, ref, imported?.module);
|
|
3561
3343
|
}
|
|
3562
|
-
function
|
|
3563
|
-
let
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
let next = ctx.checker.getSymbolAtLocation(declaration.initializer);
|
|
3569
|
-
if (!next)
|
|
3570
|
-
break;
|
|
3571
|
-
current = resolveAlias(ctx, next);
|
|
3572
|
-
}
|
|
3573
|
-
return current;
|
|
3344
|
+
function extractComponentDocFromFile(project, filePath, exportName = "default") {
|
|
3345
|
+
let sourceFile = project.program.getSourceFile(filePath), ctx = { project, checker: project.checker }, module = sourceFile && ctx.checker.getSymbolAtLocation(sourceFile);
|
|
3346
|
+
if (!module)
|
|
3347
|
+
return;
|
|
3348
|
+
let ref = { componentName: exportName, importName: exportName, isPackage: !1 }, resolved = resolveFromModuleExport(ctx, module, ref);
|
|
3349
|
+
return resolved && serializeComponentDoc(ctx, resolved, exportName, { ...ref, path: filePath }, module);
|
|
3574
3350
|
}
|
|
3575
3351
|
function getJsDocTags(ctx, symbol) {
|
|
3576
3352
|
let tags = {};
|
|
@@ -3600,7 +3376,7 @@ function serializeComponentDoc(ctx, { propsType, symbol }, exportName, ref, impo
|
|
|
3600
3376
|
let tags = ctx.checker.getJsDocTagsOfSymbol(prop);
|
|
3601
3377
|
if (tags.some((tag) => tag.name === "ignore"))
|
|
3602
3378
|
continue;
|
|
3603
|
-
let required = !(prop.flags &
|
|
3379
|
+
let required = !(prop.flags & SymbolFlags3.Optional) && !forceOptional, propType = type ?? ctx.checker.getTypeOfSymbolAtLocation(prop, location), jsDocDefault = tags.find((tag) => tag.name === "default" || tag.name === "defaultValue"), defaultValue = defaults.get(prop.name) ?? (jsDocDefault?.text?.trim() || void 0);
|
|
3604
3380
|
props[prop.name] = {
|
|
3605
3381
|
name: prop.name,
|
|
3606
3382
|
required,
|
|
@@ -4388,29 +4164,268 @@ function generateCompactArrayCode(ast) {
|
|
|
4388
4164
|
|
|
4389
4165
|
// src/react/docs/lib/inspection/acornParser.ts
|
|
4390
4166
|
init_acorn();
|
|
4391
|
-
var import_acorn_jsx = __toESM(require_acorn_jsx(), 1)
|
|
4167
|
+
var import_acorn_jsx = __toESM(require_acorn_jsx(), 1);
|
|
4168
|
+
|
|
4169
|
+
// ../../node_modules/acorn-walk/dist/walk.mjs
|
|
4170
|
+
function simple(node, visitors, baseVisitor, state, override) {
|
|
4171
|
+
baseVisitor || (baseVisitor = base), (function c(node2, st, override2) {
|
|
4172
|
+
var type = override2 || node2.type;
|
|
4173
|
+
visitNode(baseVisitor, type, node2, st, c), visitors[type] && visitors[type](node2, st);
|
|
4174
|
+
})(node, state, override);
|
|
4175
|
+
}
|
|
4176
|
+
function ancestor(node, visitors, baseVisitor, state, override) {
|
|
4177
|
+
var ancestors = [];
|
|
4178
|
+
baseVisitor || (baseVisitor = base), (function c(node2, st, override2) {
|
|
4179
|
+
var type = override2 || node2.type, isNew = node2 !== ancestors[ancestors.length - 1];
|
|
4180
|
+
isNew && ancestors.push(node2), visitNode(baseVisitor, type, node2, st, c), visitors[type] && visitors[type](node2, st || ancestors, ancestors), isNew && ancestors.pop();
|
|
4181
|
+
})(node, state, override);
|
|
4182
|
+
}
|
|
4183
|
+
function skipThrough(node, st, c) {
|
|
4184
|
+
c(node, st);
|
|
4185
|
+
}
|
|
4186
|
+
function ignore(_node, _st, _c) {
|
|
4187
|
+
}
|
|
4188
|
+
function visitNode(baseVisitor, type, node, st, c) {
|
|
4189
|
+
if (baseVisitor[type] == null)
|
|
4190
|
+
throw new Error("No walker function defined for node type " + type);
|
|
4191
|
+
baseVisitor[type](node, st, c);
|
|
4192
|
+
}
|
|
4193
|
+
var base = {};
|
|
4194
|
+
base.Program = base.BlockStatement = base.StaticBlock = function(node, st, c) {
|
|
4195
|
+
for (var i = 0, list = node.body; i < list.length; i += 1) {
|
|
4196
|
+
var stmt = list[i];
|
|
4197
|
+
c(stmt, st, "Statement");
|
|
4198
|
+
}
|
|
4199
|
+
};
|
|
4200
|
+
base.Statement = skipThrough;
|
|
4201
|
+
base.EmptyStatement = ignore;
|
|
4202
|
+
base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = function(node, st, c) {
|
|
4203
|
+
return c(node.expression, st, "Expression");
|
|
4204
|
+
};
|
|
4205
|
+
base.IfStatement = function(node, st, c) {
|
|
4206
|
+
c(node.test, st, "Expression"), c(node.consequent, st, "Statement"), node.alternate && c(node.alternate, st, "Statement");
|
|
4207
|
+
};
|
|
4208
|
+
base.LabeledStatement = function(node, st, c) {
|
|
4209
|
+
return c(node.body, st, "Statement");
|
|
4210
|
+
};
|
|
4211
|
+
base.BreakStatement = base.ContinueStatement = ignore;
|
|
4212
|
+
base.WithStatement = function(node, st, c) {
|
|
4213
|
+
c(node.object, st, "Expression"), c(node.body, st, "Statement");
|
|
4214
|
+
};
|
|
4215
|
+
base.SwitchStatement = function(node, st, c) {
|
|
4216
|
+
c(node.discriminant, st, "Expression");
|
|
4217
|
+
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
|
4218
|
+
var cs = list[i];
|
|
4219
|
+
c(cs, st);
|
|
4220
|
+
}
|
|
4221
|
+
};
|
|
4222
|
+
base.SwitchCase = function(node, st, c) {
|
|
4223
|
+
node.test && c(node.test, st, "Expression");
|
|
4224
|
+
for (var i = 0, list = node.consequent; i < list.length; i += 1) {
|
|
4225
|
+
var cons = list[i];
|
|
4226
|
+
c(cons, st, "Statement");
|
|
4227
|
+
}
|
|
4228
|
+
};
|
|
4229
|
+
base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function(node, st, c) {
|
|
4230
|
+
node.argument && c(node.argument, st, "Expression");
|
|
4231
|
+
};
|
|
4232
|
+
base.ThrowStatement = base.SpreadElement = function(node, st, c) {
|
|
4233
|
+
return c(node.argument, st, "Expression");
|
|
4234
|
+
};
|
|
4235
|
+
base.TryStatement = function(node, st, c) {
|
|
4236
|
+
c(node.block, st, "Statement"), node.handler && c(node.handler, st), node.finalizer && c(node.finalizer, st, "Statement");
|
|
4237
|
+
};
|
|
4238
|
+
base.CatchClause = function(node, st, c) {
|
|
4239
|
+
node.param && c(node.param, st, "Pattern"), c(node.body, st, "Statement");
|
|
4240
|
+
};
|
|
4241
|
+
base.WhileStatement = base.DoWhileStatement = function(node, st, c) {
|
|
4242
|
+
c(node.test, st, "Expression"), c(node.body, st, "Statement");
|
|
4243
|
+
};
|
|
4244
|
+
base.ForStatement = function(node, st, c) {
|
|
4245
|
+
node.init && c(node.init, st, "ForInit"), node.test && c(node.test, st, "Expression"), node.update && c(node.update, st, "Expression"), c(node.body, st, "Statement");
|
|
4246
|
+
};
|
|
4247
|
+
base.ForInStatement = base.ForOfStatement = function(node, st, c) {
|
|
4248
|
+
c(node.left, st, "ForInit"), c(node.right, st, "Expression"), c(node.body, st, "Statement");
|
|
4249
|
+
};
|
|
4250
|
+
base.ForInit = function(node, st, c) {
|
|
4251
|
+
node.type === "VariableDeclaration" ? c(node, st) : c(node, st, "Expression");
|
|
4252
|
+
};
|
|
4253
|
+
base.DebuggerStatement = ignore;
|
|
4254
|
+
base.FunctionDeclaration = function(node, st, c) {
|
|
4255
|
+
return c(node, st, "Function");
|
|
4256
|
+
};
|
|
4257
|
+
base.VariableDeclaration = function(node, st, c) {
|
|
4258
|
+
for (var i = 0, list = node.declarations; i < list.length; i += 1) {
|
|
4259
|
+
var decl = list[i];
|
|
4260
|
+
c(decl, st);
|
|
4261
|
+
}
|
|
4262
|
+
};
|
|
4263
|
+
base.VariableDeclarator = function(node, st, c) {
|
|
4264
|
+
c(node.id, st, "Pattern"), node.init && c(node.init, st, "Expression");
|
|
4265
|
+
};
|
|
4266
|
+
base.Function = function(node, st, c) {
|
|
4267
|
+
node.id && c(node.id, st, "Pattern");
|
|
4268
|
+
for (var i = 0, list = node.params; i < list.length; i += 1) {
|
|
4269
|
+
var param = list[i];
|
|
4270
|
+
c(param, st, "Pattern");
|
|
4271
|
+
}
|
|
4272
|
+
c(node.body, st, node.expression ? "Expression" : "Statement");
|
|
4273
|
+
};
|
|
4274
|
+
base.Pattern = function(node, st, c) {
|
|
4275
|
+
node.type === "Identifier" ? c(node, st, "VariablePattern") : node.type === "MemberExpression" ? c(node, st, "MemberPattern") : c(node, st);
|
|
4276
|
+
};
|
|
4277
|
+
base.VariablePattern = ignore;
|
|
4278
|
+
base.MemberPattern = skipThrough;
|
|
4279
|
+
base.RestElement = function(node, st, c) {
|
|
4280
|
+
return c(node.argument, st, "Pattern");
|
|
4281
|
+
};
|
|
4282
|
+
base.ArrayPattern = function(node, st, c) {
|
|
4283
|
+
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
|
4284
|
+
var elt = list[i];
|
|
4285
|
+
elt && c(elt, st, "Pattern");
|
|
4286
|
+
}
|
|
4287
|
+
};
|
|
4288
|
+
base.ObjectPattern = function(node, st, c) {
|
|
4289
|
+
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
4290
|
+
var prop = list[i];
|
|
4291
|
+
prop.type === "Property" ? (prop.computed && c(prop.key, st, "Expression"), c(prop.value, st, "Pattern")) : prop.type === "RestElement" && c(prop.argument, st, "Pattern");
|
|
4292
|
+
}
|
|
4293
|
+
};
|
|
4294
|
+
base.Expression = skipThrough;
|
|
4295
|
+
base.ThisExpression = base.Super = base.MetaProperty = ignore;
|
|
4296
|
+
base.ArrayExpression = function(node, st, c) {
|
|
4297
|
+
for (var i = 0, list = node.elements; i < list.length; i += 1) {
|
|
4298
|
+
var elt = list[i];
|
|
4299
|
+
elt && c(elt, st, "Expression");
|
|
4300
|
+
}
|
|
4301
|
+
};
|
|
4302
|
+
base.ObjectExpression = function(node, st, c) {
|
|
4303
|
+
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
4304
|
+
var prop = list[i];
|
|
4305
|
+
c(prop, st);
|
|
4306
|
+
}
|
|
4307
|
+
};
|
|
4308
|
+
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
|
4309
|
+
base.SequenceExpression = function(node, st, c) {
|
|
4310
|
+
for (var i = 0, list = node.expressions; i < list.length; i += 1) {
|
|
4311
|
+
var expr = list[i];
|
|
4312
|
+
c(expr, st, "Expression");
|
|
4313
|
+
}
|
|
4314
|
+
};
|
|
4315
|
+
base.TemplateLiteral = function(node, st, c) {
|
|
4316
|
+
for (var i = 0, list = node.quasis; i < list.length; i += 1) {
|
|
4317
|
+
var quasi = list[i];
|
|
4318
|
+
c(quasi, st);
|
|
4319
|
+
}
|
|
4320
|
+
for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) {
|
|
4321
|
+
var expr = list$1[i$1];
|
|
4322
|
+
c(expr, st, "Expression");
|
|
4323
|
+
}
|
|
4324
|
+
};
|
|
4325
|
+
base.TemplateElement = ignore;
|
|
4326
|
+
base.UnaryExpression = base.UpdateExpression = function(node, st, c) {
|
|
4327
|
+
c(node.argument, st, "Expression");
|
|
4328
|
+
};
|
|
4329
|
+
base.BinaryExpression = base.LogicalExpression = function(node, st, c) {
|
|
4330
|
+
c(node.left, st, "Expression"), c(node.right, st, "Expression");
|
|
4331
|
+
};
|
|
4332
|
+
base.AssignmentExpression = base.AssignmentPattern = function(node, st, c) {
|
|
4333
|
+
c(node.left, st, "Pattern"), c(node.right, st, "Expression");
|
|
4334
|
+
};
|
|
4335
|
+
base.ConditionalExpression = function(node, st, c) {
|
|
4336
|
+
c(node.test, st, "Expression"), c(node.consequent, st, "Expression"), c(node.alternate, st, "Expression");
|
|
4337
|
+
};
|
|
4338
|
+
base.NewExpression = base.CallExpression = function(node, st, c) {
|
|
4339
|
+
if (c(node.callee, st, "Expression"), node.arguments)
|
|
4340
|
+
for (var i = 0, list = node.arguments; i < list.length; i += 1) {
|
|
4341
|
+
var arg = list[i];
|
|
4342
|
+
c(arg, st, "Expression");
|
|
4343
|
+
}
|
|
4344
|
+
};
|
|
4345
|
+
base.MemberExpression = function(node, st, c) {
|
|
4346
|
+
c(node.object, st, "Expression"), node.computed && c(node.property, st, "Expression");
|
|
4347
|
+
};
|
|
4348
|
+
base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function(node, st, c) {
|
|
4349
|
+
if (node.declaration && c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"), node.source && c(node.source, st, "Expression"), node.attributes)
|
|
4350
|
+
for (var i = 0, list = node.attributes; i < list.length; i += 1) {
|
|
4351
|
+
var attr = list[i];
|
|
4352
|
+
c(attr, st);
|
|
4353
|
+
}
|
|
4354
|
+
};
|
|
4355
|
+
base.ExportAllDeclaration = function(node, st, c) {
|
|
4356
|
+
if (node.exported && c(node.exported, st), c(node.source, st, "Expression"), node.attributes)
|
|
4357
|
+
for (var i = 0, list = node.attributes; i < list.length; i += 1) {
|
|
4358
|
+
var attr = list[i];
|
|
4359
|
+
c(attr, st);
|
|
4360
|
+
}
|
|
4361
|
+
};
|
|
4362
|
+
base.ImportAttribute = function(node, st, c) {
|
|
4363
|
+
c(node.value, st, "Expression");
|
|
4364
|
+
};
|
|
4365
|
+
base.ImportDeclaration = function(node, st, c) {
|
|
4366
|
+
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
4367
|
+
var spec = list[i];
|
|
4368
|
+
c(spec, st);
|
|
4369
|
+
}
|
|
4370
|
+
if (c(node.source, st, "Expression"), node.attributes)
|
|
4371
|
+
for (var i$1 = 0, list$1 = node.attributes; i$1 < list$1.length; i$1 += 1) {
|
|
4372
|
+
var attr = list$1[i$1];
|
|
4373
|
+
c(attr, st);
|
|
4374
|
+
}
|
|
4375
|
+
};
|
|
4376
|
+
base.ImportExpression = function(node, st, c) {
|
|
4377
|
+
c(node.source, st, "Expression"), node.options && c(node.options, st, "Expression");
|
|
4378
|
+
};
|
|
4379
|
+
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore;
|
|
4380
|
+
base.TaggedTemplateExpression = function(node, st, c) {
|
|
4381
|
+
c(node.tag, st, "Expression"), c(node.quasi, st, "Expression");
|
|
4382
|
+
};
|
|
4383
|
+
base.ClassDeclaration = base.ClassExpression = function(node, st, c) {
|
|
4384
|
+
return c(node, st, "Class");
|
|
4385
|
+
};
|
|
4386
|
+
base.Class = function(node, st, c) {
|
|
4387
|
+
node.id && c(node.id, st, "Pattern"), node.superClass && c(node.superClass, st, "Expression"), c(node.body, st);
|
|
4388
|
+
};
|
|
4389
|
+
base.ClassBody = function(node, st, c) {
|
|
4390
|
+
for (var i = 0, list = node.body; i < list.length; i += 1) {
|
|
4391
|
+
var elt = list[i];
|
|
4392
|
+
c(elt, st);
|
|
4393
|
+
}
|
|
4394
|
+
};
|
|
4395
|
+
base.MethodDefinition = base.PropertyDefinition = base.Property = function(node, st, c) {
|
|
4396
|
+
node.computed && c(node.key, st, "Expression"), node.value && c(node.value, st, "Expression");
|
|
4397
|
+
};
|
|
4398
|
+
|
|
4399
|
+
// src/react/docs/lib/inspection/acornParser.ts
|
|
4392
4400
|
var ACORN_WALK_VISITORS = {
|
|
4393
|
-
|
|
4394
|
-
...acornWalk.base,
|
|
4401
|
+
...base,
|
|
4395
4402
|
JSXElement: () => {
|
|
4396
4403
|
}
|
|
4397
|
-
}
|
|
4404
|
+
};
|
|
4405
|
+
var acornParser = Parser.extend((0, import_acorn_jsx.default)());
|
|
4406
|
+
function hasJsxElement(node) {
|
|
4407
|
+
let found = !1, visitors = {
|
|
4408
|
+
JSXElement() {
|
|
4409
|
+
found = !0;
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
return simple(node, visitors, ACORN_WALK_VISITORS), found;
|
|
4413
|
+
}
|
|
4398
4414
|
function extractIdentifierName(identifierNode) {
|
|
4399
|
-
return identifierNode != null ? identifierNode.name : null;
|
|
4415
|
+
return identifierNode != null && "name" in identifierNode ? identifierNode.name : null;
|
|
4400
4416
|
}
|
|
4401
4417
|
function filterAncestors(ancestors) {
|
|
4402
4418
|
return ancestors.filter((x) => x.type === "ObjectExpression" || x.type === "ArrayExpression");
|
|
4403
4419
|
}
|
|
4404
4420
|
function calculateNodeDepth(node) {
|
|
4405
4421
|
let depths = [];
|
|
4406
|
-
return
|
|
4407
|
-
// @ts-expect-error (Converted from ts-ignore)
|
|
4422
|
+
return ancestor(
|
|
4408
4423
|
node,
|
|
4409
4424
|
{
|
|
4410
|
-
ObjectExpression(_, ancestors) {
|
|
4425
|
+
ObjectExpression(_, __, ancestors) {
|
|
4411
4426
|
depths.push(filterAncestors(ancestors).length);
|
|
4412
4427
|
},
|
|
4413
|
-
ArrayExpression(_, ancestors) {
|
|
4428
|
+
ArrayExpression(_, __, ancestors) {
|
|
4414
4429
|
depths.push(filterAncestors(ancestors).length);
|
|
4415
4430
|
}
|
|
4416
4431
|
},
|
|
@@ -4421,7 +4436,7 @@ function parseIdentifier(identifierNode) {
|
|
|
4421
4436
|
return {
|
|
4422
4437
|
inferredType: {
|
|
4423
4438
|
type: "Identifier" /* IDENTIFIER */,
|
|
4424
|
-
identifier:
|
|
4439
|
+
identifier: identifierNode.name
|
|
4425
4440
|
},
|
|
4426
4441
|
ast: identifierNode
|
|
4427
4442
|
};
|
|
@@ -4433,19 +4448,8 @@ function parseLiteral(literalNode) {
|
|
|
4433
4448
|
};
|
|
4434
4449
|
}
|
|
4435
4450
|
function parseFunction(funcNode) {
|
|
4436
|
-
let innerJsxElementNode;
|
|
4437
|
-
acornWalk.simple(
|
|
4438
|
-
// @ts-expect-error (Converted from ts-ignore)
|
|
4439
|
-
funcNode.body,
|
|
4440
|
-
{
|
|
4441
|
-
JSXElement(node) {
|
|
4442
|
-
innerJsxElementNode = node;
|
|
4443
|
-
}
|
|
4444
|
-
},
|
|
4445
|
-
ACORN_WALK_VISITORS
|
|
4446
|
-
);
|
|
4447
4451
|
let inferredType = {
|
|
4448
|
-
type:
|
|
4452
|
+
type: hasJsxElement(funcNode.body) ? "Element" /* ELEMENT */ : "Function" /* FUNCTION */,
|
|
4449
4453
|
params: funcNode.params,
|
|
4450
4454
|
hasParams: funcNode.params.length !== 0
|
|
4451
4455
|
}, identifierName = extractIdentifierName(funcNode.id);
|
|
@@ -4455,19 +4459,10 @@ function parseFunction(funcNode) {
|
|
|
4455
4459
|
};
|
|
4456
4460
|
}
|
|
4457
4461
|
function parseClass(classNode) {
|
|
4458
|
-
|
|
4459
|
-
return acornWalk.simple(
|
|
4460
|
-
// @ts-expect-error (Converted from ts-ignore)
|
|
4461
|
-
classNode.body,
|
|
4462
|
-
{
|
|
4463
|
-
JSXElement(node) {
|
|
4464
|
-
innerJsxElementNode = node;
|
|
4465
|
-
}
|
|
4466
|
-
},
|
|
4467
|
-
ACORN_WALK_VISITORS
|
|
4468
|
-
), {
|
|
4462
|
+
return {
|
|
4469
4463
|
inferredType: {
|
|
4470
|
-
type:
|
|
4464
|
+
type: hasJsxElement(classNode.body) ? "Element" /* ELEMENT */ : "Class" /* CLASS */,
|
|
4465
|
+
// An anonymous class gives null. Callers check the identifier for null before they use it.
|
|
4471
4466
|
identifier: extractIdentifierName(classNode.id)
|
|
4472
4467
|
},
|
|
4473
4468
|
ast: classNode
|
|
@@ -4659,7 +4654,7 @@ var extractArgTypes = (component) => {
|
|
|
4659
4654
|
{
|
|
4660
4655
|
name,
|
|
4661
4656
|
description,
|
|
4662
|
-
type: { required, ...sbType },
|
|
4657
|
+
type: sbType && { required, ...sbType },
|
|
4663
4658
|
table: {
|
|
4664
4659
|
type: type ?? void 0,
|
|
4665
4660
|
jsDocTags,
|