@aussieljk/forkbook 0.0.1-2 → 0.0.1-20
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-KALNKPOV.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-66AWY4VQ.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-4ZGQ4YQ2.js +20 -0
- 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-CX37N6FG.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-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-KQ7CRO2B.js → chunk-OWWV6YG7.js} +12 -12
- 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-C3D4HEFY.js → chunk-TRXLBGLS.js} +344 -166
- 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/{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-YD6HKC4B.js} +33 -31
- package/dist/_node-chunks/builder-manager-UNJGYVTD.js +1176 -0
- package/dist/_node-chunks/chunk-25A7444H.js +47 -0
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-2CNN3CRI.js} +506 -494
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-2GA4VQCS.js} +9 -9
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-2VJHCGAK.js} +368 -321
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-33I6AQU7.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-3CQI3JH5.js} +6 -6
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-3ZOSFS7G.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-4BE3LRIQ.js} +86 -67
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-5LFJQCYN.js} +6 -6
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-65X3MXFT.js} +8 -8
- package/dist/_node-chunks/chunk-6FWJWEAG.js +52 -0
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-6NLQCV6A.js} +7 -7
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-6OQKMJJA.js} +474 -479
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-6RYD6ENB.js} +7 -7
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-75TTPKEA.js} +283 -306
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-7CWDZLIZ.js} +6 -6
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-7M3TOE4F.js} +6 -6
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-AGLGQNTY.js} +6 -6
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-AOYLA323.js} +9 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-AP4HJ3I3.js} +7 -7
- package/dist/_node-chunks/chunk-AVHJZUTH.js +2613 -0
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-B2EEX2SZ.js} +6 -6
- package/dist/_node-chunks/chunk-CGVVOUBC.js +18 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-CJDYU653.js} +6 -6
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-CPDP5SQS.js} +14 -16
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-DAYTIH6Z.js} +10 -10
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-DO3CPQAZ.js} +6 -6
- package/dist/_node-chunks/chunk-DQEUNKLX.js +347 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-EFCBUWOB.js} +7 -7
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-EG2WLN5V.js} +7 -7
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-EKYNX5NX.js} +9 -9
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-F762PHMI.js} +6 -6
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-FC3V4KZO.js} +14 -13
- package/dist/_node-chunks/chunk-FXW52X4U.js +281 -0
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-GEJBTN76.js} +62 -7
- package/dist/_node-chunks/chunk-GFEH7IBP.js +620 -0
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-GWT4HQZU.js} +6 -6
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-HHM5X5RQ.js} +140 -118
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-IBLUURAJ.js} +25 -8
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-IENHXJVB.js} +7 -7
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-IIGBIVK3.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-J6FGP2VM.js} +7 -7
- package/dist/_node-chunks/chunk-JOX7OETB.js +534 -0
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-JR7ZCQ77.js} +21 -25
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-JXZONVHW.js} +37 -31
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-KAALBGRE.js} +6 -6
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-L52VGA36.js} +34 -949
- package/dist/_node-chunks/chunk-LAJIVWUF.js +497 -0
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-LCNF6BLP.js} +7 -7
- package/dist/_node-chunks/chunk-LGHTKFSF.js +405 -0
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-LNGSV5UI.js} +7 -7
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-MC4BFUVH.js} +6 -6
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-MWKSSYPG.js} +8 -8
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-N25CZ3RC.js} +650 -9
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-N4LNGTYL.js} +7 -7
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-N5WU4BEY.js} +6 -6
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-NRXCMSAI.js} +6 -6
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-NZWK62R5.js} +542 -1049
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-OBPVOYJA.js} +7 -7
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-OMMQME7G.js} +33 -41
- package/dist/_node-chunks/chunk-PJRPETSU.js +62 -0
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-QDVIQG3B.js} +6 -6
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-QEYWG5C7.js} +6 -6
- package/dist/_node-chunks/{chunk-GRBLDJCR.js → chunk-QQNRWEHL.js} +132 -149
- package/dist/_node-chunks/{chunk-EHUNOMDD.js → chunk-RAIWLNFA.js} +29849 -51588
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-S7RGKBGT.js} +6 -6
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-SFXFL4TP.js} +8 -8
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-SPAHK37C.js} +6 -6
- package/dist/_node-chunks/chunk-SUQ4OM7Y.js +49 -0
- package/dist/_node-chunks/chunk-U54Q3F7E.js +20 -0
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-UZH2V3WY.js} +8 -8
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-VIMGLCNZ.js} +6 -6
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-VNZF62KE.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-VPFU5CEP.js} +10 -10
- package/dist/_node-chunks/{chunk-RZMQ7S3L.js → chunk-VYCVBW5Q.js} +8 -8
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-WDANLGYN.js} +7 -7
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-WMZJ2WK4.js} +96 -177
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-WTPHQ2NG.js} +8 -8
- package/dist/_node-chunks/chunk-WYCITRIE.js +11 -0
- package/dist/_node-chunks/chunk-WYRBOMQF.js +137 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-WZBMPROH.js} +9 -17
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-X2GGQZIN.js} +6 -6
- package/dist/_node-chunks/chunk-X6OGIC2G.js +28 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-XF7H5GZM.js} +52 -22
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-XUZB4FIX.js} +15 -9
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-XVSUIOZA.js} +7 -7
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-Z665R6AF.js} +75 -75
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-ZEYZWDOS.js} +6 -6
- package/dist/_node-chunks/{chunk-UBOGWBEA.js → chunk-ZHRCL7PG.js} +10 -10
- package/dist/_node-chunks/chunk-ZLC4JSBV.js +25 -0
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-ZN6YOIB2.js} +8 -8
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-ZX32M4O7.js} +7 -7
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-ZZ5XMIGW.js} +97 -111
- package/dist/_node-chunks/dist-HBFOS25E.js +16 -0
- package/dist/_node-chunks/dist-Q2XNFC24.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-4ETW6QTI.js} +19 -20
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-OOYTYMVU.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-3AWUYNFD.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-ORY3BAP5.js} +12 -12
- package/dist/_node-chunks/optimized-tests-DOKSUJAM.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-AY4DE7ME.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-L46G75CD.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-FGVC633L.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-2AZLMC5G.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-QI3YR6CU.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-QJJ4FOF3.js} +281 -19
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-WFJZYNZN.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-V5CRAJMV.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-LECBBF3L.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 +52 -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 +176 -57
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +70 -70
- 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 +35 -35
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +22 -22
- package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
- package/dist/addon-vitest/vitest-plugin/index.js +78 -68
- 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 +13 -19
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +118 -95
- 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-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-BsO65uOb.d.ts} +4 -4
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
- package/dist/chunk-CDMZhRke.d.ts +30 -0
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- 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-B2t1tGRh.d.ts → chunk-D2CQlXaR.d.ts} +13 -15
- 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-CwQKNaYL.d.ts → chunk-OksNJcvJ.d.ts} +2 -2
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-ge-rSPy0.d.ts} +818 -701
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +14 -867
- package/dist/cli/index.js +47 -4962
- package/dist/cli/skills/content/index.d.ts +2 -2
- package/dist/cli/skills/content/index.js +2 -2
- 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 +3 -3
- 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 +27 -39
- package/dist/common/index.js +35 -42
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +6 -4
- package/dist/core-events/index.js +5 -1
- package/dist/core-server/index.d.ts +58 -17
- package/dist/core-server/index.js +1500 -382
- package/dist/core-server/presets/common-manager.js +836 -1334
- 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 +86 -154
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +18 -16
- 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-sGpNlIJ1.js → globals-runtime-BDkYPr00.js} +715 -620
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BnWjPJUH.js} +2 -2
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-Bv2PBsx6.js} +411 -379
- 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-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-D6tkG2NO.js} +1033 -621
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-D9zzVzSP.js} +11 -11
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DafcXCKU.js} +1013 -778
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- 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/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-BhfRBP4G.js +294 -0
- package/dist/manager/_manager-chunks/runtime-BuPcYKCO.js +737 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-CGaGp83p.js} +57 -76
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-CXROgt6G.js} +220 -406
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-Cn5PJT3-.js} +741 -698
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-DJlTd1qE.js} +1717 -1536
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DTUm5K9J.js} +232 -158
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-Dc6lf19c.js} +8 -534
- package/dist/manager/_manager-chunks/runtime-DmpQacrn.js +553 -0
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/runtime-mjv_40eH.js +201 -0
- 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 +537 -527
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- 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 +83 -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-CsV4HZPV.js → runtime-BiYuZt-X.js} +392 -173
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-C88AzFBv.js} +772 -418
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-Cpzxe5eK.js} +447 -151
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-MYVHRAoo.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-FY6UXW6G.js +0 -11
- 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-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-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,12 +1,9 @@
|
|
|
1
1
|
import { a as __toESM, n as __esmMin, r as __exportAll } from "./runtime-BdGkqNEt.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import {
|
|
4
|
-
import { $ as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as init_defaults, c as PARAM_KEY, d as types_exports, i as MINIMAL_VIEWPORTS, l as init_constants, n as resolveViewport, r as toResolvedViewportDimensions, t as init_resolveViewport, u as init_types } from "./runtime-CxZK_Ln3.js";
|
|
8
|
-
import { n as require_ansi_to_html, t as require_browser_dtector_umd_min } from "./runtime-BIzIdDbb.js";
|
|
9
|
-
import { i as test_exports, r as init_test } from "./runtime-DuHdxMFA.js";
|
|
2
|
+
import { $ as isPlainObject, J as isEqual, Y as require_memoizerific, Z as mapValues, ct as init_esm, i as stringify, n as init_main$1, nt as invariant, o as parse, q as init_isEqual, st as dedent, tt as init_tiny_invariant } from "./runtime-Bvh_rfnQ.js";
|
|
3
|
+
import { C as init_test, D as Tag, H as global_exports, K as StorybookError, O as init_tags, S as registerService, U as init_global, V as global, a as groupEntriesByComponent, b as getService, c as isMdxEntry, d as init_autoTitle, f as userOrAutoTitle, i as init_iframe_resize, l as init_sortStories, o as init_story_grid, p as userOrAutoTitleFromSpecifier, q as init_storybook_error, r as iframeResizeViewportsEqual, s as init_story_index_filters, t as IFRAME_RESIZE_CONTEXT, u as sortStoriesV7, w as test_exports, x as init_preview } from "./runtime-C88AzFBv.js";
|
|
4
|
+
import { $ as ARGTYPES_INFO_REQUEST, At as STORY_UNCHANGED, Bt as init_client_logger, C as toId, Ct as STORY_INDEX_INVALIDATED, D as storyNameFromExport, Dt as STORY_RENDER_PHASE_CHANGED, E as isExportStory, Et as STORY_RENDERED, Ft as UPDATE_STORY_ARGS, G as channels_exports, Ht as once, It as core_events_exports, J as ensureChannel, K as init_channels, Lt as init_core_events, Mt as UNHANDLED_ERRORS_WHILE_PLAYING, Nt as UPDATE_GLOBALS, O as init_mock_channel, Ot as STORY_SPECIFIED, Pt as UPDATE_QUERY_PARAMS, Q as setChannel, Rt as client_logger_exports, S as sanitize, St as STORY_HOT_UPDATED, T as init_export_story, Tt as STORY_PREPARED, Vt as logger, X as init_channel_slot, Y as getChannel, Z as installNoopChannel, _t as SET_GLOBALS, at as DOCS_RENDERED, b as combineTags, bt as STORY_ERRORED, c as getCoreAnnotations, ct as GLOBALS_UPDATED, d as markAsComposedWithCoreAnnotations, dt as PLAY_FUNCTION_THREW_EXCEPTION, et as ARGTYPES_INFO_RESPONSE, ft as PRELOAD_ENTRIES, gt as SET_CURRENT_STORY, h as init_shared, ht as RESET_STORY_ARGS, i as getStoryChildren, it as DOCS_PREPARED, jt as TELEMETRY_ERROR, k as mockChannel, kt as STORY_THREW_EXCEPTION, l as hasCoreAnnotations, lt as MANAGER_INERT_ATTRIBUTE_CHANGED, m as SNIPPET_RENDERED, mt as PREVIEW_KEYDOWN, n as init_actions, nt as CURRENT_STORY_WAS_SET, o as isMeta, ot as FORCE_REMOUNT, pt as PREVIEW_INITIALIZED, q as clearChannel, rt as DOCS_PAGE_IN_VIEW, s as isStory, st as FORCE_RE_RENDER, t as actions_exports, tt as CONFIG_ERROR, u as init_core_annotations, ut as NAVIGATE_URL, v as includeConditionalArg, vt as STORY_ARGS_UPDATED, w as toTestId, wt as STORY_MISSING, x as init_csf_utils, xt as STORY_FINISHED, y as init_includeConditionalArg, yt as STORY_CHANGED, zt as deprecate } from "./runtime-Cpzxe5eK.js";
|
|
5
|
+
import { a as init_defaults, c as PARAM_KEY, d as types_exports, i as MINIMAL_VIEWPORTS, l as init_constants, n as resolveViewport, r as toResolvedViewportDimensions, t as init_resolveViewport, u as init_types } from "./runtime-MYVHRAoo.js";
|
|
6
|
+
import { n as require_ansi_to_html, t as require_browser_dtector_umd_min } from "./runtime-DS0s7U3c.js";
|
|
10
7
|
//#region src/preview-errors.ts
|
|
11
8
|
var preview_errors_exports = /* @__PURE__ */ __exportAll({
|
|
12
9
|
ArgTypesRemovedFromStoryContextError: () => ArgTypesRemovedFromStoryContextError,
|
|
@@ -91,7 +88,7 @@ function init_preview_errors() {
|
|
|
91
88
|
name: "ImplicitActionsDuringRendering",
|
|
92
89
|
category: "PREVIEW_API",
|
|
93
90
|
code: 2,
|
|
94
|
-
documentation: "https://
|
|
91
|
+
documentation: "https://forkbook.ljk.dev/docs/migration#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function",
|
|
95
92
|
message: dedent`
|
|
96
93
|
We detected that you use an implicit action arg while ${data.phase} of your story.
|
|
97
94
|
${data.deprecated ? `\nThis is deprecated and won't work in Forkbook 8 anymore.\n` : ``}
|
|
@@ -128,7 +125,7 @@ function init_preview_errors() {
|
|
|
128
125
|
Expected your framework's preset to export a \`renderToCanvas\` field.
|
|
129
126
|
|
|
130
127
|
Perhaps it needs to be upgraded for Forkbook 7.0?`,
|
|
131
|
-
documentation: "https://
|
|
128
|
+
documentation: "https://forkbook.ljk.dev/docs/migration#mainjs-framework-field"
|
|
132
129
|
});
|
|
133
130
|
}
|
|
134
131
|
};
|
|
@@ -267,7 +264,7 @@ function init_preview_errors() {
|
|
|
267
264
|
This is because destructuring statements and async/await usages are otherwise transpiled away,
|
|
268
265
|
which prevents Forkbook from recognizing your usage of \`mount\`.
|
|
269
266
|
|
|
270
|
-
More info: https://
|
|
267
|
+
More info: https://forkbook.ljk.dev/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered
|
|
271
268
|
|
|
272
269
|
Received the following play function:
|
|
273
270
|
${data.playFunction}`
|
|
@@ -330,7 +327,7 @@ function init_preview_errors() {
|
|
|
330
327
|
name: "ArgTypesRemovedFromStoryContextError",
|
|
331
328
|
category: "PREVIEW_API",
|
|
332
329
|
code: 17,
|
|
333
|
-
documentation: "https://
|
|
330
|
+
documentation: "https://forkbook.ljk.dev/docs/migration#argtypes-removed-from-loaders-beforeeach-play-and-aftereach",
|
|
334
331
|
message: dedent`
|
|
335
332
|
\`argTypes\` is no longer part of the story context passed to loaders, beforeEach, play and afterEach.
|
|
336
333
|
|
|
@@ -349,7 +346,7 @@ function init_preview_errors() {
|
|
|
349
346
|
name: "NextJsSharpError",
|
|
350
347
|
category: "FRAMEWORK_NEXTJS",
|
|
351
348
|
code: 1,
|
|
352
|
-
documentation: "https://
|
|
349
|
+
documentation: "https://forkbook.ljk.dev/docs/get-started/frameworks/nextjs#error-you-are-importing-avif-images-but-you-dont-have-sharp-installed-you-have-to-install-sharp-in-order-to-use-image-optimization-features-in-nextjs",
|
|
353
350
|
message: dedent`
|
|
354
351
|
You are importing avif images, but you don't have sharp installed.
|
|
355
352
|
|
|
@@ -413,7 +410,7 @@ function init_preview_errors() {
|
|
|
413
410
|
The Forkbook plugin only supports values in the following units:
|
|
414
411
|
- px, vh, vw, em, rem and %.
|
|
415
412
|
|
|
416
|
-
You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://
|
|
413
|
+
You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://forkbook.ljk.dev/docs/writing-stories/tags
|
|
417
414
|
`
|
|
418
415
|
});
|
|
419
416
|
this.data = data;
|
|
@@ -425,7 +422,7 @@ function init_preview_errors() {
|
|
|
425
422
|
name: "ProjectAnnotationsAlreadyAppliedError",
|
|
426
423
|
category: "ADDON_VITEST",
|
|
427
424
|
code: 2,
|
|
428
|
-
documentation: "https://
|
|
425
|
+
documentation: "https://forkbook.ljk.dev/docs/migration#vitest-addon-setprojectannotations-must-not-be-called-in-setup-files",
|
|
429
426
|
message: dedent`
|
|
430
427
|
setProjectAnnotations() was called from a Vitest setup file, but @aussieljk/forkbook/addon-vitest applies your project annotations itself: your .forkbook/preview file and the previews of the addons registered in .forkbook/main. Calling it again replaces those annotations, so the call has to go:
|
|
431
428
|
|
|
@@ -443,7 +440,7 @@ function init_preview_errors() {
|
|
|
443
440
|
name: "ElementA11yParameterError",
|
|
444
441
|
category: "ADDON_A11Y",
|
|
445
442
|
code: 1,
|
|
446
|
-
documentation: "https://
|
|
443
|
+
documentation: "https://forkbook.ljk.dev/docs/migration#a11y-addon-replace-element-parameter-with-context-parameter",
|
|
447
444
|
message: "The \"element\" parameter in parameters.a11y has been removed. Use \"context\" instead."
|
|
448
445
|
});
|
|
449
446
|
}
|
|
@@ -456,16 +453,16 @@ var globalsNameReferenceMap, globalPackages;
|
|
|
456
453
|
function init_globals() {
|
|
457
454
|
return (init_globals = __esmMin((() => {
|
|
458
455
|
globalsNameReferenceMap = {
|
|
459
|
-
"@storybook/global": "
|
|
460
|
-
"@aussieljk/forkbook/test": "
|
|
461
|
-
"@aussieljk/forkbook/actions": "
|
|
462
|
-
"@aussieljk/forkbook/preview-api": "
|
|
463
|
-
"@aussieljk/forkbook/internal/channels": "
|
|
464
|
-
"@aussieljk/forkbook/internal/client-logger": "
|
|
465
|
-
"@aussieljk/forkbook/internal/core-events": "
|
|
466
|
-
"@aussieljk/forkbook/internal/preview-errors": "
|
|
467
|
-
"@aussieljk/forkbook/internal/types": "
|
|
468
|
-
"@aussieljk/forkbook/internal/preview-api": "
|
|
456
|
+
"@storybook/global": "__FORKBOOK_MODULE_GLOBAL__",
|
|
457
|
+
"@aussieljk/forkbook/test": "__FORKBOOK_MODULE_TEST__",
|
|
458
|
+
"@aussieljk/forkbook/actions": "__FORKBOOK_MODULE_ACTIONS__",
|
|
459
|
+
"@aussieljk/forkbook/preview-api": "__FORKBOOK_MODULE_PREVIEW_API__",
|
|
460
|
+
"@aussieljk/forkbook/internal/channels": "__FORKBOOK_MODULE_CHANNELS__",
|
|
461
|
+
"@aussieljk/forkbook/internal/client-logger": "__FORKBOOK_MODULE_CLIENT_LOGGER__",
|
|
462
|
+
"@aussieljk/forkbook/internal/core-events": "__FORKBOOK_MODULE_CORE_EVENTS__",
|
|
463
|
+
"@aussieljk/forkbook/internal/preview-errors": "__FORKBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__",
|
|
464
|
+
"@aussieljk/forkbook/internal/types": "__FORKBOOK_MODULE_TYPES__",
|
|
465
|
+
"@aussieljk/forkbook/internal/preview-api": "__FORKBOOK_MODULE_PREVIEW_API__"
|
|
469
466
|
};
|
|
470
467
|
globalPackages = Object.keys(globalsNameReferenceMap);
|
|
471
468
|
})))();
|
|
@@ -505,7 +502,7 @@ function init_main() {
|
|
|
505
502
|
});
|
|
506
503
|
}
|
|
507
504
|
};
|
|
508
|
-
KEY = "
|
|
505
|
+
KEY = "__FORKBOOK_ADDONS_PREVIEW";
|
|
509
506
|
addons = getAddonsStore();
|
|
510
507
|
})))();
|
|
511
508
|
}
|
|
@@ -529,10 +526,10 @@ function hookify(fn) {
|
|
|
529
526
|
hooks.prevMountedDecorators.add(fn);
|
|
530
527
|
}
|
|
531
528
|
hooks.nextHookIndex = 0;
|
|
532
|
-
const prevContext =
|
|
533
|
-
|
|
529
|
+
const prevContext = global.FORKBOOK_HOOKS_CONTEXT;
|
|
530
|
+
global.FORKBOOK_HOOKS_CONTEXT = hooks;
|
|
534
531
|
const result = fn(...args);
|
|
535
|
-
|
|
532
|
+
global.FORKBOOK_HOOKS_CONTEXT = prevContext;
|
|
536
533
|
if (hooks.currentPhase === "UPDATE" && hooks.getNextHook() != null) throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
|
|
537
534
|
hooks.currentPhase = prevPhase;
|
|
538
535
|
hooks.currentHooks = prevHooks;
|
|
@@ -544,7 +541,7 @@ function hookify(fn) {
|
|
|
544
541
|
return hookified;
|
|
545
542
|
}
|
|
546
543
|
function getHooksContextOrNull() {
|
|
547
|
-
return
|
|
544
|
+
return global.FORKBOOK_HOOKS_CONTEXT || null;
|
|
548
545
|
}
|
|
549
546
|
function getHooksContextOrThrow() {
|
|
550
547
|
const hooks = getHooksContextOrNull();
|
|
@@ -598,7 +595,7 @@ function useMemoLike(name, nextCreate, deps) {
|
|
|
598
595
|
*
|
|
599
596
|
* @template T The type of the memoized value.
|
|
600
597
|
* @param {() => T} nextCreate A function that returns the memoized value.
|
|
601
|
-
* @param {
|
|
598
|
+
* @param {unknown[]} [deps] An optional array of dependencies. If any of the dependencies change, the
|
|
602
599
|
* memoized value will be recomputed.
|
|
603
600
|
* @returns {T} The memoized value.
|
|
604
601
|
*/
|
|
@@ -618,7 +615,7 @@ function useMemo(nextCreate, deps) {
|
|
|
618
615
|
*
|
|
619
616
|
* @template T The type of the callback function.
|
|
620
617
|
* @param {T} callback The callback function to memoize.
|
|
621
|
-
* @param {
|
|
618
|
+
* @param {unknown[]} [deps] An optional array of dependencies. If any of the dependencies change, the
|
|
622
619
|
* memoized callback will be recomputed.
|
|
623
620
|
* @returns {T} The memoized callback.
|
|
624
621
|
*/
|
|
@@ -703,7 +700,7 @@ function useReducer(reducer, initialArg, init) {
|
|
|
703
700
|
*
|
|
704
701
|
* @param {() => (() => void) | void} create A function that creates the effect. It should return a
|
|
705
702
|
* cleanup function, or nothing.
|
|
706
|
-
* @param {
|
|
703
|
+
* @param {unknown[]} [deps] An optional array of dependencies. If any of the dependencies change, the
|
|
707
704
|
* effect will be re-run.
|
|
708
705
|
* @returns {void}
|
|
709
706
|
*/
|
|
@@ -724,9 +721,9 @@ function useEffect(create, deps) {
|
|
|
724
721
|
* ```
|
|
725
722
|
*
|
|
726
723
|
* @param {EventMap} eventMap A map of event listeners to subscribe to.
|
|
727
|
-
* @param {
|
|
724
|
+
* @param {unknown[]} [deps=[]] An optional array of dependencies. If any of the dependencies change,
|
|
728
725
|
* the event listeners will be re-subscribed. Default is `[]`
|
|
729
|
-
* @returns {(...args:
|
|
726
|
+
* @returns {(...args: unknown[]) => void} A function to emit events to the Forkbook channel.
|
|
730
727
|
*/
|
|
731
728
|
function useChannel(eventMap, deps = []) {
|
|
732
729
|
const channel = addons.getChannel();
|
|
@@ -835,21 +832,10 @@ function init_hooks() {
|
|
|
835
832
|
return (init_hooks = __esmMin((() => {
|
|
836
833
|
init_client_logger();
|
|
837
834
|
init_core_events();
|
|
838
|
-
|
|
835
|
+
init_global();
|
|
839
836
|
init_main();
|
|
840
837
|
HooksContext = class {
|
|
841
838
|
constructor() {
|
|
842
|
-
this.hookListsMap = void 0;
|
|
843
|
-
this.mountedDecorators = void 0;
|
|
844
|
-
this.prevMountedDecorators = void 0;
|
|
845
|
-
this.currentHooks = void 0;
|
|
846
|
-
this.nextHookIndex = void 0;
|
|
847
|
-
this.currentPhase = void 0;
|
|
848
|
-
this.currentEffects = void 0;
|
|
849
|
-
this.prevEffects = void 0;
|
|
850
|
-
this.currentDecoratorName = void 0;
|
|
851
|
-
this.hasUpdates = void 0;
|
|
852
|
-
this.currentContext = void 0;
|
|
853
839
|
this.renderListener = (storyId) => {
|
|
854
840
|
if (storyId !== this.currentContext?.id) return;
|
|
855
841
|
this.triggerEffects();
|
|
@@ -944,11 +930,13 @@ function init_make_decorator() {
|
|
|
944
930
|
});
|
|
945
931
|
};
|
|
946
932
|
return (...args) => {
|
|
947
|
-
if (typeof args[0] === "function") return decorator()(
|
|
933
|
+
if (typeof args[0] === "function") return decorator()(args[0], args[1]);
|
|
948
934
|
return (...innerArgs) => {
|
|
935
|
+
const storyFn = innerArgs[0];
|
|
936
|
+
const context = innerArgs[1];
|
|
949
937
|
if (innerArgs.length > 1) {
|
|
950
|
-
if (args.length > 1) return decorator(args)(
|
|
951
|
-
return decorator(
|
|
938
|
+
if (args.length > 1) return decorator(args)(storyFn, context);
|
|
939
|
+
return decorator(args[0])(storyFn, context);
|
|
952
940
|
}
|
|
953
941
|
throw new Error(`Passing stories directly into ${name}() is not allowed,
|
|
954
942
|
instead use addDecorator(${name}) and pass options with the '${parameterName}' parameter`);
|
|
@@ -968,7 +956,7 @@ function groupArgsByTarget({ args, argTypes }) {
|
|
|
968
956
|
});
|
|
969
957
|
return groupedArgs;
|
|
970
958
|
}
|
|
971
|
-
var INCOMPATIBLE, map, mapArgsToTypes, combineArgs, validateOptions, DEEPLY_EQUAL, deepDiff, UNTARGETED;
|
|
959
|
+
var INCOMPATIBLE, map, mapArgsToTypes, combineValues, combineArgs, validateOptions, DEEPLY_EQUAL, deepDiff, UNTARGETED;
|
|
972
960
|
function init_args() {
|
|
973
961
|
return (init_args = __esmMin((() => {
|
|
974
962
|
init_client_logger();
|
|
@@ -1011,9 +999,9 @@ function init_args() {
|
|
|
1011
999
|
return mapped === INCOMPATIBLE ? acc : Object.assign(acc, { [key]: mapped });
|
|
1012
1000
|
}, {});
|
|
1013
1001
|
};
|
|
1014
|
-
|
|
1002
|
+
combineValues = (value, update) => {
|
|
1015
1003
|
if (Array.isArray(value) && Array.isArray(update)) return update.reduce((acc, upd, index) => {
|
|
1016
|
-
acc[index] =
|
|
1004
|
+
acc[index] = combineValues(value[index], update[index]);
|
|
1017
1005
|
return acc;
|
|
1018
1006
|
}, [...value]).filter((v) => v !== void 0);
|
|
1019
1007
|
if (!isPlainObject(value) || !isPlainObject(update)) return update;
|
|
@@ -1022,12 +1010,13 @@ function init_args() {
|
|
|
1022
1010
|
...update
|
|
1023
1011
|
}).reduce((acc, key) => {
|
|
1024
1012
|
if (key in update) {
|
|
1025
|
-
const combined =
|
|
1013
|
+
const combined = combineValues(value[key], update[key]);
|
|
1026
1014
|
if (combined !== void 0) acc[key] = combined;
|
|
1027
1015
|
} else acc[key] = value[key];
|
|
1028
1016
|
return acc;
|
|
1029
1017
|
}, {});
|
|
1030
1018
|
};
|
|
1019
|
+
combineArgs = (value, update) => combineValues(value, update);
|
|
1031
1020
|
validateOptions = (args, argTypes) => {
|
|
1032
1021
|
return Object.entries(argTypes).reduce((acc, [key, { options }]) => {
|
|
1033
1022
|
function allowArg() {
|
|
@@ -1039,7 +1028,7 @@ function init_args() {
|
|
|
1039
1028
|
once.error(dedent`
|
|
1040
1029
|
Invalid argType: '${key}.options' should be an array.
|
|
1041
1030
|
|
|
1042
|
-
More info: https://
|
|
1031
|
+
More info: https://forkbook.ljk.dev/docs/api/arg-types
|
|
1043
1032
|
`);
|
|
1044
1033
|
return allowArg();
|
|
1045
1034
|
}
|
|
@@ -1047,7 +1036,7 @@ function init_args() {
|
|
|
1047
1036
|
once.error(dedent`
|
|
1048
1037
|
Invalid argType: '${key}.options' should only contain primitives. Use a 'mapping' for complex values.
|
|
1049
1038
|
|
|
1050
|
-
More info: https://
|
|
1039
|
+
More info: https://forkbook.ljk.dev/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
1051
1040
|
`);
|
|
1052
1041
|
return allowArg();
|
|
1053
1042
|
}
|
|
@@ -1136,8 +1125,8 @@ function init_inferArgTypes() {
|
|
|
1136
1125
|
We've detected a cycle in arg '${name}'. Args should be JSON-serializable.
|
|
1137
1126
|
|
|
1138
1127
|
Consider using the mapping feature or fully custom args:
|
|
1139
|
-
- Mapping: https://
|
|
1140
|
-
- Custom args: https://
|
|
1128
|
+
- Mapping: https://forkbook.ljk.dev/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
1129
|
+
- Custom args: https://forkbook.ljk.dev/docs/essentials/controls#fully-custom-args
|
|
1141
1130
|
`);
|
|
1142
1131
|
return {
|
|
1143
1132
|
name: "other",
|
|
@@ -1188,10 +1177,10 @@ function deleteUndefined(obj) {
|
|
|
1188
1177
|
var argTypesForValidation, ArgsStore;
|
|
1189
1178
|
function init_ArgsStore() {
|
|
1190
1179
|
return (init_ArgsStore = __esmMin((() => {
|
|
1191
|
-
|
|
1180
|
+
init_global();
|
|
1192
1181
|
init_args();
|
|
1193
1182
|
init_inferArgTypes();
|
|
1194
|
-
argTypesForValidation = (story) =>
|
|
1183
|
+
argTypesForValidation = (story) => global.FEATURES?.docgenServer ? inferArgTypes({
|
|
1195
1184
|
id: story.id,
|
|
1196
1185
|
argTypes: story.argTypes,
|
|
1197
1186
|
initialArgs: story.initialArgs
|
|
@@ -1687,7 +1676,7 @@ function prepareMeta(componentAnnotations, projectAnnotations, moduleExport) {
|
|
|
1687
1676
|
}
|
|
1688
1677
|
function preparePartialAnnotations(storyAnnotations, componentAnnotations, projectAnnotations) {
|
|
1689
1678
|
const defaultTags = [Tag.DEV, Tag.TEST];
|
|
1690
|
-
const extraTags =
|
|
1679
|
+
const extraTags = global.DOCS_OPTIONS?.autodocs === true ? [Tag.AUTODOCS] : [];
|
|
1691
1680
|
/**
|
|
1692
1681
|
* DISCLAIMER: This feels like a hack but seems like it's the only way to override the autodocs
|
|
1693
1682
|
* tag for test-fn stories. That's because the Story index does not include negated tags e.g.
|
|
@@ -1728,7 +1717,7 @@ function preparePartialAnnotations(storyAnnotations, componentAnnotations, proje
|
|
|
1728
1717
|
storyGlobals
|
|
1729
1718
|
};
|
|
1730
1719
|
contextForEnhancers.argTypes = argTypesEnhancers.filter((enhancer) => {
|
|
1731
|
-
if (
|
|
1720
|
+
if (global.FEATURES?.docgenServer && enhancer.secondPass) return false;
|
|
1732
1721
|
return true;
|
|
1733
1722
|
}).reduce((accumulatedArgTypes, enhancer) => enhancer({
|
|
1734
1723
|
...contextForEnhancers,
|
|
@@ -1752,7 +1741,7 @@ function prepareContext(context) {
|
|
|
1752
1741
|
allArgs: void 0,
|
|
1753
1742
|
argsByTarget: void 0
|
|
1754
1743
|
};
|
|
1755
|
-
if (
|
|
1744
|
+
if (global.FEATURES?.argTypeTargetsV7) {
|
|
1756
1745
|
const argsByTarget = groupArgsByTarget(context);
|
|
1757
1746
|
targetedContext = {
|
|
1758
1747
|
...context,
|
|
@@ -1768,7 +1757,8 @@ function prepareContext(context) {
|
|
|
1768
1757
|
}
|
|
1769
1758
|
const mappingFn = (originalValue) => {
|
|
1770
1759
|
const mapping = targetedContext.argTypes[key].mapping;
|
|
1771
|
-
|
|
1760
|
+
const mappingKey = originalValue;
|
|
1761
|
+
return mapping && mappingKey in mapping ? mapping[mappingKey] : originalValue;
|
|
1772
1762
|
};
|
|
1773
1763
|
acc[key] = Array.isArray(val) ? val.map(mappingFn) : mappingFn(val);
|
|
1774
1764
|
return acc;
|
|
@@ -1788,7 +1778,7 @@ function init_prepareStory() {
|
|
|
1788
1778
|
return (init_prepareStory = __esmMin((() => {
|
|
1789
1779
|
init_csf_utils(), init_includeConditionalArg();
|
|
1790
1780
|
init_preview_errors();
|
|
1791
|
-
|
|
1781
|
+
init_global();
|
|
1792
1782
|
init_tags();
|
|
1793
1783
|
init_hooks();
|
|
1794
1784
|
init_args();
|
|
@@ -1831,10 +1821,10 @@ function init_filterArgTypes() {
|
|
|
1831
1821
|
matches = (name, descriptor) => Array.isArray(descriptor) ? descriptor.includes(name) : name.match(descriptor);
|
|
1832
1822
|
filterArgTypes = (argTypes, include, exclude) => {
|
|
1833
1823
|
if (!include && !exclude) return argTypes;
|
|
1834
|
-
return argTypes &&
|
|
1835
|
-
const name = argType.name || key
|
|
1824
|
+
return argTypes && Object.fromEntries(Object.entries(argTypes).filter(([key, argType]) => {
|
|
1825
|
+
const name = argType.name || key;
|
|
1836
1826
|
return !!(!include || matches(name, include)) && (!exclude || !matches(name, exclude));
|
|
1837
|
-
});
|
|
1827
|
+
}));
|
|
1838
1828
|
};
|
|
1839
1829
|
})))();
|
|
1840
1830
|
}
|
|
@@ -1962,14 +1952,12 @@ function composeStepRunners(stepRunners) {
|
|
|
1962
1952
|
}
|
|
1963
1953
|
//#endregion
|
|
1964
1954
|
//#region src/preview-api/modules/store/csf/composeConfigs.ts
|
|
1955
|
+
/** Gets the value of a field from each module. The caller names the type of the field. */
|
|
1965
1956
|
function getField(moduleExportList, field) {
|
|
1966
1957
|
return moduleExportList.map((xs) => xs.default?.[field] ?? xs[field]).filter(Boolean);
|
|
1967
1958
|
}
|
|
1968
1959
|
function getArrayField(moduleExportList, field) {
|
|
1969
|
-
return getField(moduleExportList, field).reduce((prev, cur) =>
|
|
1970
|
-
const normalized = normalizeArrays(cur);
|
|
1971
|
-
return [...prev, ...normalized];
|
|
1972
|
-
}, []);
|
|
1960
|
+
return getField(moduleExportList, field).reduce((prev, cur) => [...prev, ...normalizeArrays(cur)], []);
|
|
1973
1961
|
}
|
|
1974
1962
|
function getObjectField(moduleExportList, field) {
|
|
1975
1963
|
return Object.assign({}, ...getField(moduleExportList, field));
|
|
@@ -2167,8 +2155,8 @@ function setDefaultProjectAnnotations(_defaultProjectAnnotations) {
|
|
|
2167
2155
|
globalThis.defaultProjectAnnotations = _defaultProjectAnnotations;
|
|
2168
2156
|
}
|
|
2169
2157
|
function setProjectAnnotations(projectAnnotations) {
|
|
2170
|
-
if (globalThis.
|
|
2171
|
-
globalThis.
|
|
2158
|
+
if (globalThis.__FORKBOOK_ADDON_VITEST_PROJECT_ANNOTATIONS_APPLIED__) throw new ProjectAnnotationsAlreadyAppliedError();
|
|
2159
|
+
globalThis.__FORKBOOK_SET_PROJECT_ANNOTATIONS_CALLED__ = true;
|
|
2172
2160
|
const annotations = Array.isArray(projectAnnotations) ? projectAnnotations : [projectAnnotations];
|
|
2173
2161
|
globalThis.globalProjectAnnotations = composeProjectAnnotationsWithCore([globalThis.defaultProjectAnnotations ?? {}, ...annotations]);
|
|
2174
2162
|
return globalThis.globalProjectAnnotations ?? {};
|
|
@@ -2835,11 +2823,11 @@ function init_Preview() {
|
|
|
2835
2823
|
init_client_logger();
|
|
2836
2824
|
init_core_events();
|
|
2837
2825
|
init_preview_errors();
|
|
2838
|
-
|
|
2826
|
+
init_global();
|
|
2839
2827
|
init_StoryStore(), init_composeProjectAnnotationsWithCore();
|
|
2840
2828
|
init_main();
|
|
2841
2829
|
init_StoryRender();
|
|
2842
|
-
({fetch: fetch$1} =
|
|
2830
|
+
({fetch: fetch$1} = global);
|
|
2843
2831
|
STORY_INDEX_PATH = "./index.json";
|
|
2844
2832
|
Preview = class {
|
|
2845
2833
|
constructor(importFn, getProjectAnnotations, channel = addons.getChannel(), shouldInitialize = true) {
|
|
@@ -2877,6 +2865,13 @@ function init_Preview() {
|
|
|
2877
2865
|
ready() {
|
|
2878
2866
|
return this.storeInitializationPromise;
|
|
2879
2867
|
}
|
|
2868
|
+
/**
|
|
2869
|
+
* Uses another channel, for example the WebSocket channel of a React Native view. Call
|
|
2870
|
+
* `setupListeners()` after it, so that the preview listens on the new channel.
|
|
2871
|
+
*/
|
|
2872
|
+
setChannel(channel) {
|
|
2873
|
+
this.channel = channel;
|
|
2874
|
+
}
|
|
2880
2875
|
setupListeners() {
|
|
2881
2876
|
this.channel.on(STORY_INDEX_INVALIDATED, this.onStoryIndexChanged.bind(this));
|
|
2882
2877
|
this.channel.on(UPDATE_GLOBALS, this.onUpdateGlobals.bind(this));
|
|
@@ -2919,7 +2914,7 @@ function init_Preview() {
|
|
|
2919
2914
|
}
|
|
2920
2915
|
async getStoryIndexFromServer() {
|
|
2921
2916
|
const result = await fetch$1(STORY_INDEX_PATH);
|
|
2922
|
-
if (result.status === 200) return result.json();
|
|
2917
|
+
if (result.status === 200) return await result.json();
|
|
2923
2918
|
throw new StoryIndexFetchError({ text: await result.text() });
|
|
2924
2919
|
}
|
|
2925
2920
|
initializeWithStoryIndex(storyIndex) {
|
|
@@ -3082,36 +3077,67 @@ function init_Preview() {
|
|
|
3082
3077
|
})))();
|
|
3083
3078
|
}
|
|
3084
3079
|
//#endregion
|
|
3085
|
-
//#region src/preview-api/modules/preview-web/
|
|
3086
|
-
var
|
|
3087
|
-
function
|
|
3088
|
-
return (
|
|
3089
|
-
|
|
3090
|
-
|
|
3080
|
+
//#region src/preview-api/modules/preview-web/AllStories.ts
|
|
3081
|
+
var ALL_STORIES_PARAM, isAllStoriesMode, callbacks, AllStories;
|
|
3082
|
+
function init_AllStories() {
|
|
3083
|
+
return (init_AllStories = __esmMin((() => {
|
|
3084
|
+
init_client_logger();
|
|
3085
|
+
init_story_grid();
|
|
3086
|
+
ALL_STORIES_PARAM = "allStories";
|
|
3087
|
+
isAllStoriesMode = ({ search }) => new URLSearchParams(search).get(ALL_STORIES_PARAM) === "true";
|
|
3088
|
+
callbacks = {
|
|
3089
|
+
showStoryDuringRender: () => {},
|
|
3090
|
+
showMain: () => {},
|
|
3091
|
+
showError: ({ title }) => logger.error(title),
|
|
3092
|
+
showException: (err) => logger.error(err)
|
|
3091
3093
|
};
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3094
|
+
AllStories = class {
|
|
3095
|
+
constructor(store, renderStoryToElement) {
|
|
3096
|
+
this.store = store;
|
|
3097
|
+
this.renderStoryToElement = renderStoryToElement;
|
|
3098
|
+
this.teardowns = [];
|
|
3099
|
+
}
|
|
3100
|
+
async render(root) {
|
|
3101
|
+
await this.stop();
|
|
3102
|
+
root.replaceChildren();
|
|
3103
|
+
const doc = root.ownerDocument;
|
|
3104
|
+
const components = groupEntriesByComponent(Object.values(this.store.storyIndex.entries));
|
|
3105
|
+
for (const component of components) {
|
|
3106
|
+
if (component.storyIds.length === 0) continue;
|
|
3107
|
+
const section = doc.createElement("section");
|
|
3108
|
+
section.className = "fb-all-stories-component";
|
|
3109
|
+
section.style.padding = "16px 24px";
|
|
3110
|
+
const heading = doc.createElement("h2");
|
|
3111
|
+
heading.textContent = component.title;
|
|
3112
|
+
section.appendChild(heading);
|
|
3113
|
+
root.appendChild(section);
|
|
3114
|
+
for (const storyId of component.storyIds) {
|
|
3115
|
+
const entry = this.store.storyIndex.entries[storyId];
|
|
3116
|
+
const block = doc.createElement("div");
|
|
3117
|
+
block.className = "fb-all-stories-story";
|
|
3118
|
+
block.dataset.storyId = storyId;
|
|
3119
|
+
block.style.margin = "12px 0 24px";
|
|
3120
|
+
const name = doc.createElement("h3");
|
|
3121
|
+
name.textContent = entry?.name ?? storyId;
|
|
3122
|
+
const canvas = doc.createElement("div");
|
|
3123
|
+
block.append(name, canvas);
|
|
3124
|
+
section.appendChild(block);
|
|
3125
|
+
try {
|
|
3126
|
+
const story = await this.store.loadStory({ storyId });
|
|
3127
|
+
this.teardowns.push(this.renderStoryToElement(story, canvas, callbacks, {
|
|
3128
|
+
autoplay: true,
|
|
3129
|
+
forceInitialArgs: false
|
|
3130
|
+
}));
|
|
3131
|
+
} catch (err) {
|
|
3132
|
+
canvas.textContent = `Could not render this story: ${err.message}`;
|
|
3133
|
+
logger.error(err);
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
async stop() {
|
|
3139
|
+
await Promise.all(this.teardowns.splice(0).map((teardown) => teardown()));
|
|
3140
|
+
}
|
|
3115
3141
|
};
|
|
3116
3142
|
})))();
|
|
3117
3143
|
}
|
|
@@ -3456,12 +3482,152 @@ function init_MdxDocsRender() {
|
|
|
3456
3482
|
})))();
|
|
3457
3483
|
}
|
|
3458
3484
|
//#endregion
|
|
3485
|
+
//#region src/preview-api/modules/preview-web/InfiniteDocs.ts
|
|
3486
|
+
var document$4, IntersectionObserver, docsEntriesInOrder, nextDocsEntry, InfiniteDocs;
|
|
3487
|
+
function init_InfiniteDocs() {
|
|
3488
|
+
return (init_InfiniteDocs = __esmMin((() => {
|
|
3489
|
+
init_core_events();
|
|
3490
|
+
init_story_index_filters();
|
|
3491
|
+
init_CsfDocsRender();
|
|
3492
|
+
init_MdxDocsRender();
|
|
3493
|
+
({document: document$4, IntersectionObserver} = globalThis);
|
|
3494
|
+
docsEntriesInOrder = (entries) => {
|
|
3495
|
+
const docs = Object.values(entries).filter((entry) => entry.type === "docs");
|
|
3496
|
+
const isTopLevel = (entry) => !entry.title.includes("/");
|
|
3497
|
+
return [...docs.filter(isTopLevel), ...docs.filter((entry) => !isTopLevel(entry))];
|
|
3498
|
+
};
|
|
3499
|
+
nextDocsEntry = (entries, id) => {
|
|
3500
|
+
const docs = docsEntriesInOrder(entries);
|
|
3501
|
+
const index = docs.findIndex((entry) => entry.id === id);
|
|
3502
|
+
return index === -1 ? void 0 : docs[index + 1];
|
|
3503
|
+
};
|
|
3504
|
+
InfiniteDocs = class {
|
|
3505
|
+
constructor(channel, store, renderStoryToElement, callbacks) {
|
|
3506
|
+
this.channel = channel;
|
|
3507
|
+
this.store = store;
|
|
3508
|
+
this.renderStoryToElement = renderStoryToElement;
|
|
3509
|
+
this.callbacks = callbacks;
|
|
3510
|
+
this.renders = [];
|
|
3511
|
+
this.loading = false;
|
|
3512
|
+
}
|
|
3513
|
+
/** Starts after the main docs page `entry` rendered into `docsRoot`. */
|
|
3514
|
+
start(entry, docsRoot) {
|
|
3515
|
+
this.stop();
|
|
3516
|
+
if (typeof IntersectionObserver === "undefined" || typeof document$4 === "undefined" || !docsRoot?.dataset) return;
|
|
3517
|
+
if (this.store.projectAnnotations?.parameters?.docs?.infiniteScroll === false) return;
|
|
3518
|
+
this.lastId = entry.id;
|
|
3519
|
+
this.inViewId = entry.id;
|
|
3520
|
+
docsRoot.dataset.docsId = entry.id;
|
|
3521
|
+
const container = document$4.createElement("div");
|
|
3522
|
+
container.className = "fb-infinite-docs";
|
|
3523
|
+
const sentinel = document$4.createElement("div");
|
|
3524
|
+
sentinel.className = "fb-infinite-docs-sentinel";
|
|
3525
|
+
sentinel.style.height = "1px";
|
|
3526
|
+
container.appendChild(sentinel);
|
|
3527
|
+
docsRoot.after(container);
|
|
3528
|
+
this.container = container;
|
|
3529
|
+
this.pageObserver = new IntersectionObserver((records) => {
|
|
3530
|
+
for (const record of records) {
|
|
3531
|
+
const id = record.target.dataset.docsId;
|
|
3532
|
+
if (record.isIntersecting && id && id !== this.inViewId) {
|
|
3533
|
+
this.inViewId = id;
|
|
3534
|
+
this.channel.emit(DOCS_PAGE_IN_VIEW, { storyId: id });
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
}, { rootMargin: "-10% 0px -60% 0px" });
|
|
3538
|
+
this.pageObserver.observe(docsRoot);
|
|
3539
|
+
this.sentinelObserver = new IntersectionObserver((records) => {
|
|
3540
|
+
if (records.some((record) => record.isIntersecting)) this.loadNext();
|
|
3541
|
+
}, { rootMargin: "0px 0px 600px 0px" });
|
|
3542
|
+
this.sentinelObserver.observe(sentinel);
|
|
3543
|
+
}
|
|
3544
|
+
async loadNext() {
|
|
3545
|
+
const { container, lastId } = this;
|
|
3546
|
+
if (this.loading || !container || !lastId) return;
|
|
3547
|
+
const entry = nextDocsEntry(this.store.storyIndex.entries, lastId);
|
|
3548
|
+
if (!entry) {
|
|
3549
|
+
this.sentinelObserver?.disconnect();
|
|
3550
|
+
return;
|
|
3551
|
+
}
|
|
3552
|
+
this.loading = true;
|
|
3553
|
+
this.lastId = entry.id;
|
|
3554
|
+
const element = document$4.createElement("div");
|
|
3555
|
+
element.className = "fb-infinite-docs-page";
|
|
3556
|
+
element.dataset.docsId = entry.id;
|
|
3557
|
+
container.insertBefore(element, container.lastChild);
|
|
3558
|
+
const render = isMdxEntry(entry) ? new MdxDocsRender(this.channel, this.store, entry, this.callbacks(entry.id)) : new CsfDocsRender(this.channel, this.store, entry, this.callbacks(entry.id));
|
|
3559
|
+
this.renders.push(render);
|
|
3560
|
+
try {
|
|
3561
|
+
await render.prepare();
|
|
3562
|
+
if (this.container !== container) return;
|
|
3563
|
+
await render.renderToElement(element, this.renderStoryToElement);
|
|
3564
|
+
this.pageObserver?.observe(element);
|
|
3565
|
+
} catch (err) {
|
|
3566
|
+
this.sentinelObserver?.disconnect();
|
|
3567
|
+
} finally {
|
|
3568
|
+
this.loading = false;
|
|
3569
|
+
}
|
|
3570
|
+
const sentinel = container.lastElementChild;
|
|
3571
|
+
if (sentinel && sentinel.getBoundingClientRect().top < globalThis.innerHeight + 600) this.loadNext();
|
|
3572
|
+
}
|
|
3573
|
+
/** Removes the pages below the main page. */
|
|
3574
|
+
stop() {
|
|
3575
|
+
this.sentinelObserver?.disconnect();
|
|
3576
|
+
this.pageObserver?.disconnect();
|
|
3577
|
+
this.sentinelObserver = void 0;
|
|
3578
|
+
this.pageObserver = void 0;
|
|
3579
|
+
for (const render of this.renders) render.teardown({ viewModeChanged: true });
|
|
3580
|
+
this.renders = [];
|
|
3581
|
+
this.container?.remove();
|
|
3582
|
+
this.container = void 0;
|
|
3583
|
+
this.lastId = void 0;
|
|
3584
|
+
this.inViewId = void 0;
|
|
3585
|
+
this.loading = false;
|
|
3586
|
+
}
|
|
3587
|
+
};
|
|
3588
|
+
})))();
|
|
3589
|
+
}
|
|
3590
|
+
//#endregion
|
|
3591
|
+
//#region src/preview-api/modules/preview-web/embedMode.ts
|
|
3592
|
+
var shouldEmbed, shouldAutoplay;
|
|
3593
|
+
function init_embedMode() {
|
|
3594
|
+
return (init_embedMode = __esmMin((() => {
|
|
3595
|
+
shouldEmbed = ({ search }) => {
|
|
3596
|
+
return new URLSearchParams(search).get("embed") === "true";
|
|
3597
|
+
};
|
|
3598
|
+
shouldAutoplay = ({ search }) => !shouldEmbed({ search });
|
|
3599
|
+
})))();
|
|
3600
|
+
}
|
|
3601
|
+
//#endregion
|
|
3602
|
+
//#region src/preview-api/modules/preview-web/getEmbedResizeViewport.ts
|
|
3603
|
+
var getEmbedResizeViewport;
|
|
3604
|
+
function init_getEmbedResizeViewport() {
|
|
3605
|
+
return (init_getEmbedResizeViewport = __esmMin((() => {
|
|
3606
|
+
init_constants();
|
|
3607
|
+
init_defaults();
|
|
3608
|
+
init_resolveViewport();
|
|
3609
|
+
getEmbedResizeViewport = (storyStore, render, reference) => {
|
|
3610
|
+
if (!storyStore || !render?.story) return;
|
|
3611
|
+
const { globals, storyGlobals, userGlobals, parameters } = storyStore.getStoryContext(render.story);
|
|
3612
|
+
const viewportParameters = parameters[PARAM_KEY];
|
|
3613
|
+
return toResolvedViewportDimensions(resolveViewport({
|
|
3614
|
+
globals,
|
|
3615
|
+
storyGlobals,
|
|
3616
|
+
userGlobals,
|
|
3617
|
+
options: viewportParameters?.options ?? MINIMAL_VIEWPORTS,
|
|
3618
|
+
disable: viewportParameters?.disable ?? false,
|
|
3619
|
+
viewMode: "story"
|
|
3620
|
+
}), reference);
|
|
3621
|
+
};
|
|
3622
|
+
})))();
|
|
3623
|
+
}
|
|
3624
|
+
//#endregion
|
|
3459
3625
|
//#region src/preview-api/modules/preview-web/setupStoryFreezer.ts
|
|
3460
3626
|
var FREEZE_STYLE_ID, PRE_FREEZE_STYLE_ID, tryReplaceProperty, getQueryParam, shouldFreeze, stripScriptElements, stripInlineEventHandlers, addFreezeStyles, addPreFreezeStyles, finishAndPauseAnimations, blockInteractions, createStoryFreezer, setupStoryFreezer;
|
|
3461
3627
|
function init_setupStoryFreezer() {
|
|
3462
3628
|
return (init_setupStoryFreezer = __esmMin((() => {
|
|
3463
3629
|
init_core_events();
|
|
3464
|
-
|
|
3630
|
+
init_global();
|
|
3465
3631
|
FREEZE_STYLE_ID = "storybook-freeze-after-finished";
|
|
3466
3632
|
PRE_FREEZE_STYLE_ID = "storybook-freeze-end-frame-preload";
|
|
3467
3633
|
tryReplaceProperty = (target, key, value) => {
|
|
@@ -3647,8 +3813,8 @@ function init_setupStoryFreezer() {
|
|
|
3647
3813
|
return { freeze };
|
|
3648
3814
|
};
|
|
3649
3815
|
setupStoryFreezer = (channel, options = {}) => {
|
|
3650
|
-
const windowRef =
|
|
3651
|
-
const documentRef =
|
|
3816
|
+
const windowRef = global.window;
|
|
3817
|
+
const documentRef = global.document;
|
|
3652
3818
|
if (!windowRef || !documentRef) return false;
|
|
3653
3819
|
if (!shouldFreeze({ search: documentRef.location.search })) return false;
|
|
3654
3820
|
addPreFreezeStyles(documentRef);
|
|
@@ -3678,7 +3844,7 @@ function init_setupStoryFreezer() {
|
|
|
3678
3844
|
var EMBED_STYLE_ID, EMBED_UI_STYLE_ID, IGNORE_TAGS, REPLACED_OR_CONTROL_TAGS, BLOCK_LEVEL_TAGS, descendantSelector, isTransparentColor, hasVisibleDecoration, isReplacedOrControl, hasDirectText, isStretchedToParent, hasExplicitWidth, coversViewport, isViewportOverlayUnderlay, isPassThroughContainer, shouldExcludeFromMeasurement, getMeasurableElements, getBodyPadding, getDimensions, getTrackedElements, injectEmbedSizingStyles, removeEmbedSizingStyles, injectEmbedUiStyles, lastDimensions, sendResizeMessage, debounce, setupContentResizeBroadcast;
|
|
3679
3845
|
function init_setupContentResizeBroadcast() {
|
|
3680
3846
|
return (init_setupContentResizeBroadcast = __esmMin((() => {
|
|
3681
|
-
|
|
3847
|
+
init_global();
|
|
3682
3848
|
init_iframe_resize();
|
|
3683
3849
|
init_embedMode();
|
|
3684
3850
|
init_setupStoryFreezer();
|
|
@@ -3877,8 +4043,8 @@ function init_setupContentResizeBroadcast() {
|
|
|
3877
4043
|
const style = documentRef.createElement("style");
|
|
3878
4044
|
style.id = EMBED_UI_STYLE_ID;
|
|
3879
4045
|
style.textContent = `
|
|
3880
|
-
.
|
|
3881
|
-
.
|
|
4046
|
+
.fb-preparing-story,
|
|
4047
|
+
.fb-preparing-docs {
|
|
3882
4048
|
display: none !important;
|
|
3883
4049
|
}
|
|
3884
4050
|
`;
|
|
@@ -3926,8 +4092,8 @@ function init_setupContentResizeBroadcast() {
|
|
|
3926
4092
|
};
|
|
3927
4093
|
setupContentResizeBroadcast = (options = {}) => {
|
|
3928
4094
|
const { getViewport } = options;
|
|
3929
|
-
const windowRef =
|
|
3930
|
-
const documentRef =
|
|
4095
|
+
const windowRef = global.window;
|
|
4096
|
+
const documentRef = global.document;
|
|
3931
4097
|
if (!windowRef || !documentRef) return {};
|
|
3932
4098
|
if (!shouldEmbed({ search: documentRef.location.search })) return {};
|
|
3933
4099
|
lastDimensions = null;
|
|
@@ -3986,6 +4152,26 @@ function init_setupContentResizeBroadcast() {
|
|
|
3986
4152
|
})))();
|
|
3987
4153
|
}
|
|
3988
4154
|
//#endregion
|
|
4155
|
+
//#region src/preview-api/modules/preview-web/withFilePath.ts
|
|
4156
|
+
/**
|
|
4157
|
+
* Adds the story file path below the first line of an error message, so the error display in the
|
|
4158
|
+
* preview says which file to fix. The view shows the first line as the heading and the rest as
|
|
4159
|
+
* detail, so the stack moves into the detail.
|
|
4160
|
+
*/
|
|
4161
|
+
function withFilePath(error, importPath) {
|
|
4162
|
+
const message = error.message || String(error);
|
|
4163
|
+
const stack = error.stack ?? "";
|
|
4164
|
+
if (!importPath || message.includes(importPath)) return {
|
|
4165
|
+
message,
|
|
4166
|
+
stack
|
|
4167
|
+
};
|
|
4168
|
+
const [header, ...rest] = message.split("\n");
|
|
4169
|
+
return {
|
|
4170
|
+
message: `${header}\nIn ${importPath}\n\n${rest.length ? rest.join("\n").replace(/^\n/, "") : stack}`.trimEnd(),
|
|
4171
|
+
stack
|
|
4172
|
+
};
|
|
4173
|
+
}
|
|
4174
|
+
//#endregion
|
|
3989
4175
|
//#region src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
3990
4176
|
function focusInInput(event) {
|
|
3991
4177
|
const target = event.composedPath && event.composedPath()[0] || event.target;
|
|
@@ -4010,6 +4196,8 @@ function init_PreviewWithSelection() {
|
|
|
4010
4196
|
init_tags();
|
|
4011
4197
|
init_story_index_filters();
|
|
4012
4198
|
init_Preview();
|
|
4199
|
+
init_AllStories();
|
|
4200
|
+
init_InfiniteDocs();
|
|
4013
4201
|
init_embedMode();
|
|
4014
4202
|
init_getEmbedResizeViewport();
|
|
4015
4203
|
init_CsfDocsRender();
|
|
@@ -4060,6 +4248,10 @@ function init_PreviewWithSelection() {
|
|
|
4060
4248
|
}
|
|
4061
4249
|
async selectSpecifiedStory() {
|
|
4062
4250
|
if (!this.storyStoreValue) throw new CalledPreviewMethodBeforeInitializationError({ methodName: "selectSpecifiedStory" });
|
|
4251
|
+
if (isAllStoriesMode({ search: globalWindow.location?.search ?? "" })) {
|
|
4252
|
+
await this.renderAllStories();
|
|
4253
|
+
return;
|
|
4254
|
+
}
|
|
4063
4255
|
if (this.selectionStore.selection) {
|
|
4064
4256
|
await this.renderSelection();
|
|
4065
4257
|
return;
|
|
@@ -4084,6 +4276,13 @@ function init_PreviewWithSelection() {
|
|
|
4084
4276
|
this.channel.emit(CURRENT_STORY_WAS_SET, this.selectionStore.selection);
|
|
4085
4277
|
await this.renderSelection({ persistedArgs: args });
|
|
4086
4278
|
}
|
|
4279
|
+
/** Renders all stories in one page (`iframe.html?allStories=true`). */
|
|
4280
|
+
async renderAllStories() {
|
|
4281
|
+
if (!this.storyStoreValue) throw new CalledPreviewMethodBeforeInitializationError({ methodName: "renderAllStories" });
|
|
4282
|
+
this.allStories ??= new AllStories(this.storyStoreValue, this.renderStoryToElement.bind(this));
|
|
4283
|
+
const root = this.view.prepareForDocs({ scrollReset: false });
|
|
4284
|
+
await this.allStories.render(root);
|
|
4285
|
+
}
|
|
4087
4286
|
async onGetProjectAnnotationsChanged({ getProjectAnnotations }) {
|
|
4088
4287
|
await super.onGetProjectAnnotationsChanged({ getProjectAnnotations });
|
|
4089
4288
|
if (this.selectionStore.selection) this.renderSelection();
|
|
@@ -4158,6 +4357,7 @@ function init_PreviewWithSelection() {
|
|
|
4158
4357
|
const { selection } = this.selectionStore;
|
|
4159
4358
|
if (!selection) throw new Error("Cannot call renderSelection as no selection was made");
|
|
4160
4359
|
const { storyId } = selection;
|
|
4360
|
+
this.infiniteDocs?.stop();
|
|
4161
4361
|
let entry;
|
|
4162
4362
|
try {
|
|
4163
4363
|
entry = await this.storyStoreValue.storyIdToEntry(storyId);
|
|
@@ -4242,7 +4442,21 @@ function init_PreviewWithSelection() {
|
|
|
4242
4442
|
invariant(!!render.story);
|
|
4243
4443
|
this.storyRenders.push(render);
|
|
4244
4444
|
this.currentRender.renderToElement(this.view.prepareForStory(render.story, { scrollReset: storyIdChanged || viewModeChanged }));
|
|
4245
|
-
} else
|
|
4445
|
+
} else {
|
|
4446
|
+
const docsRoot = this.view.prepareForDocs({ scrollReset: storyIdChanged || viewModeChanged });
|
|
4447
|
+
const docsRender = this.currentRender;
|
|
4448
|
+
docsRender.renderToElement(docsRoot, this.renderStoryToElement.bind(this)).then(() => {
|
|
4449
|
+
if (this.currentRender === docsRender && this.storyStoreValue) {
|
|
4450
|
+
this.infiniteDocs ??= new InfiniteDocs(this.channel, this.storyStoreValue, this.renderStoryToElement.bind(this), () => ({
|
|
4451
|
+
showStoryDuringRender: () => {},
|
|
4452
|
+
showMain: () => {},
|
|
4453
|
+
showError: () => {},
|
|
4454
|
+
showException: (err) => logger.error(err)
|
|
4455
|
+
}));
|
|
4456
|
+
this.infiniteDocs.start(entry, docsRoot);
|
|
4457
|
+
}
|
|
4458
|
+
});
|
|
4459
|
+
}
|
|
4246
4460
|
}
|
|
4247
4461
|
async teardownRender(render, { viewModeChanged = false, keepRenderedDom = false } = {}) {
|
|
4248
4462
|
this.storyRenders = this.storyRenders.filter((r) => r !== render);
|
|
@@ -4267,9 +4481,14 @@ function init_PreviewWithSelection() {
|
|
|
4267
4481
|
this.view.showNoPreview();
|
|
4268
4482
|
this.channel.emit(STORY_MISSING);
|
|
4269
4483
|
}
|
|
4484
|
+
/** The story file of a story, so an error can say which file to fix. */
|
|
4485
|
+
importPathOf(storySpecifier) {
|
|
4486
|
+
if (typeof storySpecifier !== "string") return;
|
|
4487
|
+
return this.storyStoreValue?.storyIndex.entries[storySpecifier]?.importPath;
|
|
4488
|
+
}
|
|
4270
4489
|
renderStoryLoadingException(storySpecifier, err) {
|
|
4271
4490
|
logger.error(err);
|
|
4272
|
-
this.view.showErrorDisplay(err);
|
|
4491
|
+
this.view.showErrorDisplay(withFilePath(err, this.importPathOf(storySpecifier)));
|
|
4273
4492
|
this.channel.emit(STORY_MISSING, storySpecifier);
|
|
4274
4493
|
}
|
|
4275
4494
|
renderException(storyId, error) {
|
|
@@ -4285,7 +4504,7 @@ function init_PreviewWithSelection() {
|
|
|
4285
4504
|
renderId,
|
|
4286
4505
|
storyId
|
|
4287
4506
|
});
|
|
4288
|
-
this.view.showErrorDisplay(error);
|
|
4507
|
+
this.view.showErrorDisplay(withFilePath(error, this.importPathOf(storyId)));
|
|
4289
4508
|
logger.error(`Error rendering story '${storyId}':`);
|
|
4290
4509
|
logger.error(error);
|
|
4291
4510
|
}
|
|
@@ -4364,7 +4583,7 @@ function init_parseArgsParam() {
|
|
|
4364
4583
|
once.warn(dedent`
|
|
4365
4584
|
Omitted potentially unsafe URL args.
|
|
4366
4585
|
|
|
4367
|
-
More info: https://
|
|
4586
|
+
More info: https://forkbook.ljk.dev/docs/writing-stories/args#setting-args-through-the-url
|
|
4368
4587
|
`);
|
|
4369
4588
|
return acc;
|
|
4370
4589
|
}, {});
|
|
@@ -4384,10 +4603,10 @@ function pathToViewMode(path) {
|
|
|
4384
4603
|
var history, document$3, PATH_REGEX, getQueryString, setPath, isObject, getFirstString, getSelectionSpecifierFromPath, UrlStore;
|
|
4385
4604
|
function init_UrlStore() {
|
|
4386
4605
|
return (init_UrlStore = __esmMin((() => {
|
|
4387
|
-
|
|
4606
|
+
init_global();
|
|
4388
4607
|
init_main$1();
|
|
4389
4608
|
init_parseArgsParam();
|
|
4390
|
-
({history, document: document$3} =
|
|
4609
|
+
({history, document: document$3} = global);
|
|
4391
4610
|
PATH_REGEX = /^\/(story|docs)\/(.+)/;
|
|
4392
4611
|
getQueryString = ({ selection, extraParams }) => {
|
|
4393
4612
|
const search = document$3?.location.search.slice(1);
|
|
@@ -4457,11 +4676,11 @@ var import_ansi_to_html, document$2, PREPARING_DELAY, Mode, classes, layoutClass
|
|
|
4457
4676
|
function init_WebView() {
|
|
4458
4677
|
return (init_WebView = __esmMin((() => {
|
|
4459
4678
|
init_client_logger();
|
|
4460
|
-
|
|
4679
|
+
init_global();
|
|
4461
4680
|
import_ansi_to_html = /* @__PURE__ */ __toESM(require_ansi_to_html(), 1);
|
|
4462
4681
|
init_main$1();
|
|
4463
4682
|
init_esm();
|
|
4464
|
-
({document: document$2} =
|
|
4683
|
+
({document: document$2} = global);
|
|
4465
4684
|
PREPARING_DELAY = 100;
|
|
4466
4685
|
Mode = /* @__PURE__ */ function(Mode) {
|
|
4467
4686
|
Mode["MAIN"] = "MAIN";
|
|
@@ -4472,16 +4691,16 @@ function init_WebView() {
|
|
|
4472
4691
|
return Mode;
|
|
4473
4692
|
}(Mode || {});
|
|
4474
4693
|
classes = {
|
|
4475
|
-
PREPARING_STORY: "
|
|
4476
|
-
PREPARING_DOCS: "
|
|
4477
|
-
MAIN: "
|
|
4478
|
-
NOPREVIEW: "
|
|
4479
|
-
ERROR: "
|
|
4694
|
+
PREPARING_STORY: "fb-show-preparing-story",
|
|
4695
|
+
PREPARING_DOCS: "fb-show-preparing-docs",
|
|
4696
|
+
MAIN: "fb-show-main",
|
|
4697
|
+
NOPREVIEW: "fb-show-nopreview",
|
|
4698
|
+
ERROR: "fb-show-errordisplay"
|
|
4480
4699
|
};
|
|
4481
4700
|
layoutClassMap = {
|
|
4482
|
-
centered: "
|
|
4483
|
-
fullscreen: "
|
|
4484
|
-
padded: "
|
|
4701
|
+
centered: "fb-main-centered",
|
|
4702
|
+
fullscreen: "fb-main-fullscreen",
|
|
4703
|
+
padded: "fb-main-padded"
|
|
4485
4704
|
};
|
|
4486
4705
|
ansiConverter = new import_ansi_to_html.default({ escapeXML: true });
|
|
4487
4706
|
WebView = class {
|
|
@@ -4612,7 +4831,7 @@ function init_WebView() {
|
|
|
4612
4831
|
var PreviewWeb;
|
|
4613
4832
|
function init_PreviewWeb() {
|
|
4614
4833
|
return (init_PreviewWeb = __esmMin((() => {
|
|
4615
|
-
|
|
4834
|
+
init_global();
|
|
4616
4835
|
init_PreviewWithSelection();
|
|
4617
4836
|
init_UrlStore();
|
|
4618
4837
|
init_WebView();
|
|
@@ -4621,7 +4840,7 @@ function init_PreviewWeb() {
|
|
|
4621
4840
|
super(importFn, getProjectAnnotations, new UrlStore(), new WebView());
|
|
4622
4841
|
this.importFn = importFn;
|
|
4623
4842
|
this.getProjectAnnotations = getProjectAnnotations;
|
|
4624
|
-
|
|
4843
|
+
global.__FORKBOOK_PREVIEW__ = this;
|
|
4625
4844
|
}
|
|
4626
4845
|
};
|
|
4627
4846
|
})))();
|
|
@@ -4673,8 +4892,8 @@ function simulatePageLoad($container) {
|
|
|
4673
4892
|
var document$1, runScriptTypes, SCRIPT, SCRIPTS_ROOT_ID;
|
|
4674
4893
|
function init_simulate_pageload() {
|
|
4675
4894
|
return (init_simulate_pageload = __esmMin((() => {
|
|
4676
|
-
|
|
4677
|
-
({document: document$1} =
|
|
4895
|
+
init_global();
|
|
4896
|
+
({document: document$1} = global);
|
|
4678
4897
|
runScriptTypes = [
|
|
4679
4898
|
"application/javascript",
|
|
4680
4899
|
"application/ecmascript",
|
|
@@ -4806,12 +5025,12 @@ function init_runtime() {
|
|
|
4806
5025
|
init_core_events();
|
|
4807
5026
|
init_preview_errors();
|
|
4808
5027
|
init_types();
|
|
4809
|
-
|
|
5028
|
+
init_global();
|
|
4810
5029
|
init_actions();
|
|
4811
5030
|
init_preview_api();
|
|
4812
5031
|
init_test();
|
|
4813
5032
|
globalsNameValueMap = {
|
|
4814
|
-
"@storybook/global":
|
|
5033
|
+
"@storybook/global": global_exports,
|
|
4815
5034
|
"@aussieljk/forkbook/test": test_exports,
|
|
4816
5035
|
"@aussieljk/forkbook/actions": actions_exports,
|
|
4817
5036
|
"@aussieljk/forkbook/preview-api": preview_api_exports,
|
|
@@ -4828,8 +5047,8 @@ function init_runtime() {
|
|
|
4828
5047
|
//#region src/preview/preview-navigator.ts
|
|
4829
5048
|
async function maybeSetupPreviewNavigator() {
|
|
4830
5049
|
const url = new URL(window.location.href);
|
|
4831
|
-
if (url.searchParams.get("navigator") !== "true" || globalThis.
|
|
4832
|
-
globalThis.
|
|
5050
|
+
if (url.searchParams.get("navigator") !== "true" || globalThis.__FORKBOOK_PREVIEW_NAVIGATOR__) return;
|
|
5051
|
+
globalThis.__FORKBOOK_PREVIEW_NAVIGATOR__ = true;
|
|
4833
5052
|
const index = await (await fetch("./index.json")).json();
|
|
4834
5053
|
const currentEntryId = url.searchParams.get("id");
|
|
4835
5054
|
if (!currentEntryId) {
|
|
@@ -4850,14 +5069,14 @@ function init_preview_navigator() {
|
|
|
4850
5069
|
const li = document.createElement("li");
|
|
4851
5070
|
if ("entries" in node && "title" in node) {
|
|
4852
5071
|
const branchNode = node;
|
|
4853
|
-
li.className = "
|
|
5072
|
+
li.className = "fb-navigator-branch";
|
|
4854
5073
|
const details = document.createElement("details");
|
|
4855
5074
|
if (branchNode.isActive) details.open = true;
|
|
4856
5075
|
const summary = document.createElement("summary");
|
|
4857
|
-
summary.className = "
|
|
5076
|
+
summary.className = "fb-navigator-title";
|
|
4858
5077
|
summary.textContent = branchNode.title;
|
|
4859
5078
|
const ul = document.createElement("ul");
|
|
4860
|
-
ul.className = "
|
|
5079
|
+
ul.className = "fb-navigator-entries";
|
|
4861
5080
|
ul.setAttribute("aria-label", branchNode.title);
|
|
4862
5081
|
for (const child of Object.values(branchNode.entries)) ul.appendChild(createElementForNode(child));
|
|
4863
5082
|
details.appendChild(summary);
|
|
@@ -4865,10 +5084,10 @@ function init_preview_navigator() {
|
|
|
4865
5084
|
li.appendChild(details);
|
|
4866
5085
|
} else {
|
|
4867
5086
|
const leafNode = node;
|
|
4868
|
-
li.className = "
|
|
5087
|
+
li.className = "fb-navigator-story-item";
|
|
4869
5088
|
const a = document.createElement("a");
|
|
4870
5089
|
a.href = leafNode.href;
|
|
4871
|
-
a.className = `
|
|
5090
|
+
a.className = `fb-navigator-story-link${leafNode.isActive ? " active" : ""}`;
|
|
4872
5091
|
if (leafNode.isActive) a.setAttribute("aria-current", "location");
|
|
4873
5092
|
a.textContent = leafNode.name;
|
|
4874
5093
|
li.appendChild(a);
|
|
@@ -4903,21 +5122,21 @@ function init_preview_navigator() {
|
|
|
4903
5122
|
};
|
|
4904
5123
|
}
|
|
4905
5124
|
const navList = document.createElement("ul");
|
|
4906
|
-
navList.className = "
|
|
5125
|
+
navList.className = "fb-navigator-list";
|
|
4907
5126
|
for (const entry of Object.values(tree.entries)) navList.appendChild(createElementForNode(entry));
|
|
4908
5127
|
const nav = document.createElement("nav");
|
|
4909
|
-
nav.id = "
|
|
5128
|
+
nav.id = "fb-navigator-container";
|
|
4910
5129
|
nav.setAttribute("role", "navigation");
|
|
4911
5130
|
nav.setAttribute("aria-label", "Story navigation");
|
|
4912
5131
|
nav.appendChild(navList);
|
|
4913
5132
|
document.body.insertBefore(nav, document.body.firstChild);
|
|
4914
5133
|
const style = document.createElement("style");
|
|
4915
|
-
style.id = "
|
|
5134
|
+
style.id = "fb-navigator-style";
|
|
4916
5135
|
style.textContent = `
|
|
4917
5136
|
body {
|
|
4918
5137
|
display: grid !important;
|
|
4919
5138
|
grid-template-columns: 300px 1fr;
|
|
4920
|
-
font-family: '
|
|
5139
|
+
font-family: 'Inter Variable', sans-serif;
|
|
4921
5140
|
height: 100vh;
|
|
4922
5141
|
margin: 0;
|
|
4923
5142
|
|
|
@@ -4934,10 +5153,10 @@ function init_preview_navigator() {
|
|
|
4934
5153
|
max-height: 100vh;
|
|
4935
5154
|
max-width: 100%;
|
|
4936
5155
|
}
|
|
4937
|
-
#
|
|
5156
|
+
#fb-navigator-container, #fb-navigator-container * {
|
|
4938
5157
|
box-sizing: border-box;
|
|
4939
5158
|
}
|
|
4940
|
-
#
|
|
5159
|
+
#fb-navigator-container {
|
|
4941
5160
|
height: 100vh;
|
|
4942
5161
|
overflow-y: auto;
|
|
4943
5162
|
border-right: 1px solid #eee;
|
|
@@ -4948,50 +5167,50 @@ function init_preview_navigator() {
|
|
|
4948
5167
|
align-self: start;
|
|
4949
5168
|
z-index: 1000;
|
|
4950
5169
|
}
|
|
4951
|
-
.
|
|
5170
|
+
.fb-main-padded #fb-navigator-container {
|
|
4952
5171
|
margin: -1rem 1rem -1rem -1rem;
|
|
4953
5172
|
}
|
|
4954
|
-
.
|
|
5173
|
+
.fb-navigator-list {
|
|
4955
5174
|
list-style-type: none;
|
|
4956
5175
|
padding: 0;
|
|
4957
5176
|
margin: 0;
|
|
4958
5177
|
}
|
|
4959
|
-
.
|
|
5178
|
+
.fb-navigator-branch {
|
|
4960
5179
|
list-style-type: none;
|
|
4961
5180
|
}
|
|
4962
|
-
.
|
|
5181
|
+
.fb-navigator-item {
|
|
4963
5182
|
margin-bottom: 15px;
|
|
4964
5183
|
}
|
|
4965
|
-
.
|
|
5184
|
+
.fb-navigator-title {
|
|
4966
5185
|
color: var(--text-color);
|
|
4967
5186
|
text-decoration: none;
|
|
4968
5187
|
padding-block: 5px;
|
|
4969
5188
|
cursor: pointer;
|
|
4970
5189
|
}
|
|
4971
|
-
.
|
|
5190
|
+
.fb-navigator-entries {
|
|
4972
5191
|
padding-left: 15px;
|
|
4973
5192
|
}
|
|
4974
|
-
.
|
|
5193
|
+
.fb-navigator-story-item {
|
|
4975
5194
|
margin-bottom: 8px;
|
|
4976
5195
|
margin-left: 8px;
|
|
4977
5196
|
}
|
|
4978
|
-
.
|
|
5197
|
+
.fb-navigator-story-link {
|
|
4979
5198
|
color: var(--text-color);
|
|
4980
5199
|
}
|
|
4981
|
-
.
|
|
5200
|
+
.fb-navigator-story-link.active {
|
|
4982
5201
|
font-weight: bold;
|
|
4983
|
-
color:
|
|
5202
|
+
color: #007aff;
|
|
4984
5203
|
}
|
|
4985
5204
|
`;
|
|
4986
5205
|
document.head.appendChild(style);
|
|
4987
|
-
nav.querySelector(".
|
|
5206
|
+
nav.querySelector(".fb-navigator-story-link.active")?.closest("details")?.scrollIntoView({ block: "center" });
|
|
4988
5207
|
};
|
|
4989
5208
|
})))();
|
|
4990
5209
|
}
|
|
4991
5210
|
//#endregion
|
|
4992
5211
|
//#region src/preview/utils.ts
|
|
4993
5212
|
function getBrowserInfo() {
|
|
4994
|
-
if (!browserInfo) browserInfo = new import_browser_dtector_umd_min.default(
|
|
5213
|
+
if (!browserInfo) browserInfo = new import_browser_dtector_umd_min.default(global.navigator?.userAgent).getBrowserInfo();
|
|
4995
5214
|
return browserInfo;
|
|
4996
5215
|
}
|
|
4997
5216
|
function prepareForTelemetry(error) {
|
|
@@ -5001,7 +5220,7 @@ function prepareForTelemetry(error) {
|
|
|
5001
5220
|
var import_browser_dtector_umd_min, browserInfo;
|
|
5002
5221
|
function init_utils() {
|
|
5003
5222
|
return (init_utils = __esmMin((() => {
|
|
5004
|
-
|
|
5223
|
+
init_global();
|
|
5005
5224
|
import_browser_dtector_umd_min = /* @__PURE__ */ __toESM(require_browser_dtector_umd_min(), 1);
|
|
5006
5225
|
})))();
|
|
5007
5226
|
}
|
|
@@ -5011,23 +5230,23 @@ function setInert(inert) {
|
|
|
5011
5230
|
if (inert) document.body?.setAttribute("inert", "true");
|
|
5012
5231
|
else document.body?.removeAttribute("inert");
|
|
5013
5232
|
}
|
|
5014
|
-
function errorListener(
|
|
5015
|
-
const error =
|
|
5016
|
-
if (error.fromStorybook)
|
|
5233
|
+
function errorListener(event) {
|
|
5234
|
+
const error = event.error || event;
|
|
5235
|
+
if (error.fromStorybook) global.sendTelemetryError(error);
|
|
5017
5236
|
}
|
|
5018
5237
|
function unhandledRejectionListener({ reason }) {
|
|
5019
|
-
if (reason.fromStorybook)
|
|
5238
|
+
if (reason.fromStorybook) global.sendTelemetryError(reason);
|
|
5020
5239
|
}
|
|
5021
5240
|
function setup() {
|
|
5022
5241
|
globalPackages.forEach((key) => {
|
|
5023
|
-
|
|
5242
|
+
Object.assign(global, { [globalsNameReferenceMap[key]]: globalsNameValueMap[key] });
|
|
5024
5243
|
});
|
|
5025
|
-
|
|
5244
|
+
global.sendTelemetryError = (error) => {
|
|
5026
5245
|
const channel = getChannel();
|
|
5027
5246
|
if (!channel) return;
|
|
5028
5247
|
channel.emit(TELEMETRY_ERROR, prepareForTelemetry(error));
|
|
5029
5248
|
};
|
|
5030
|
-
const freeze = new URLSearchParams(
|
|
5249
|
+
const freeze = new URLSearchParams(global.location?.search ?? "").get("freeze") === "finished";
|
|
5031
5250
|
if (freeze) setInert(true);
|
|
5032
5251
|
/**
|
|
5033
5252
|
* Ensure we synchronise the preview runtime's inert state with the manager's. The inert attribute
|
|
@@ -5044,15 +5263,15 @@ function setup() {
|
|
|
5044
5263
|
setInert(freeze || isInert);
|
|
5045
5264
|
});
|
|
5046
5265
|
});
|
|
5047
|
-
|
|
5048
|
-
|
|
5266
|
+
global.addEventListener("error", errorListener);
|
|
5267
|
+
global.addEventListener("unhandledrejection", unhandledRejectionListener);
|
|
5049
5268
|
maybeSetupPreviewNavigator();
|
|
5050
5269
|
}
|
|
5051
5270
|
function init_runtime$1() {
|
|
5052
5271
|
return (init_runtime$1 = __esmMin((() => {
|
|
5053
5272
|
init_channels();
|
|
5054
5273
|
init_core_events();
|
|
5055
|
-
|
|
5274
|
+
init_global();
|
|
5056
5275
|
init_globals();
|
|
5057
5276
|
init_runtime();
|
|
5058
5277
|
init_preview_navigator();
|