@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.
Files changed (536) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +35 -53
  3. package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
  4. package/assets/browser/favicon-wrapper.svg +4 -4
  5. package/assets/browser/favicon.svg +1 -1
  6. package/assets/browser/inter-LICENSE.txt +92 -0
  7. package/assets/browser/inter-variable-italic.woff2 +0 -0
  8. package/assets/browser/inter-variable.woff2 +0 -0
  9. package/assets/browser/mirror-ball.png +0 -0
  10. package/assets/builder-vite/iframe.html +8 -24
  11. package/assets/create/rendererAssets/common/Configure.mdx +100 -100
  12. package/assets/create/rendererAssets/common/button.css +7 -7
  13. package/assets/create/rendererAssets/common/header.css +6 -6
  14. package/assets/create/rendererAssets/common/page.css +12 -12
  15. package/assets/create/templates/react-native/index.expo.js +4 -4
  16. package/assets/create/templates/react-native/index.js +5 -5
  17. package/assets/server/base-preview-body.html +32 -32
  18. package/assets/server/base-preview-head.html +86 -86
  19. package/assets/server/template.ejs +31 -26
  20. package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-7FO5YFB5.js} +8 -8
  21. package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
  22. package/dist/_browser-chunks/WithTooltip-QWFSUQZP.js +199 -0
  23. package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
  24. package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
  25. package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
  26. package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
  27. package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
  28. package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
  29. package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-5Z3MWCFR.js} +12 -12
  30. package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
  31. package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
  32. package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
  33. package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
  34. package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
  35. package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-BSYOFSF6.js} +770 -720
  36. package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
  37. package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
  38. package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
  39. package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
  40. package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
  41. package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
  42. package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
  43. package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
  44. package/dist/_browser-chunks/chunk-FAOLWWRN.js +20 -0
  45. package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
  46. package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
  47. package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
  48. package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
  49. package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
  50. package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
  51. package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
  52. package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
  53. package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
  54. package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
  55. package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
  56. package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
  57. package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
  58. package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
  59. package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
  60. package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
  61. package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
  62. package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
  63. package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
  64. package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
  65. package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
  66. package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
  67. package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
  68. package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
  69. package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
  70. package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
  71. package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-ZIZCGWCG.js} +348 -170
  72. package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
  73. package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
  74. package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-UC2CB4GH.js} +37 -35
  75. package/dist/_node-chunks/builder-manager-S5UUKVOR.js +1174 -0
  76. package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-3335ZZIO.js} +6 -6
  77. package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-3D6N6P2R.js} +283 -306
  78. package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-3ER54PQM.js} +8 -8
  79. package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-3H5C52QU.js} +6 -6
  80. package/dist/_node-chunks/chunk-3UI3TQ7R.js +28 -0
  81. package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-4C3ACAHV.js} +6 -6
  82. package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-4UTCKJEQ.js} +7 -7
  83. package/dist/_node-chunks/chunk-53A5CYDK.js +572 -0
  84. package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-53PSBDRK.js} +140 -118
  85. package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-54MO4QLB.js} +6 -6
  86. package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-5CJMRQZ6.js} +6 -6
  87. package/dist/_node-chunks/chunk-5HOM7B4V.js +20 -0
  88. package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-5QG6AXK4.js} +7 -7
  89. package/dist/_node-chunks/chunk-67XVZZUO.js +405 -0
  90. package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-6HQJJDLH.js} +6 -6
  91. package/dist/_node-chunks/chunk-6IPHWCFI.js +29 -0
  92. package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-6XYOFBRD.js} +98 -129
  93. package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-7IAYDGYH.js} +6 -6
  94. package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-7P67PUU2.js} +7 -7
  95. package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-AAK5BBF2.js} +7 -7
  96. package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-BGUVBOOU.js} +10 -10
  97. package/dist/_node-chunks/chunk-BNGBOASQ.js +25 -0
  98. package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-BWZWCVVH.js} +9 -9
  99. package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-C6HQ6WLU.js} +8 -8
  100. package/dist/_node-chunks/chunk-CJHRH777.js +20 -0
  101. package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-COEW4ORP.js} +6 -6
  102. package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-CVHDAEDZ.js} +7 -7
  103. package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-CXGOQNGI.js} +7 -7
  104. package/dist/_node-chunks/chunk-D4XTQWRM.js +11 -0
  105. package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-D5V6CZ6U.js} +7 -7
  106. package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-DCTXJ4TT.js} +14 -16
  107. package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-DP6WFY3D.js} +7 -7
  108. package/dist/_node-chunks/chunk-E23GDXG6.js +271 -0
  109. package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-E3ZFMURC.js} +8 -8
  110. package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-E6O3NA44.js} +7 -7
  111. package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-ECS3WDOU.js} +8 -8
  112. package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-FB5YJWOH.js} +6 -6
  113. package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-FCK5FM6D.js} +7 -7
  114. package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-FJUGPEJK.js} +6 -6
  115. package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-FPYXI76E.js} +75 -75
  116. package/dist/_node-chunks/chunk-GEWVOY3F.js +62 -0
  117. package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-GHZ44BFB.js} +14 -13
  118. package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-GJMFISS3.js} +8 -8
  119. package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-GK2Y2RFX.js} +7 -7
  120. package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-GP6YBA2R.js} +6 -6
  121. package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-GQUFGJ4D.js} +6 -6
  122. package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-H4CRQDTK.js} +6 -6
  123. package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-HCDG54OG.js} +7 -7
  124. package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-HGJMP4EI.js} +506 -494
  125. package/dist/_node-chunks/chunk-HSX6BDBA.js +18 -0
  126. package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-IPFPWMT5.js} +1320 -437
  127. package/dist/_node-chunks/chunk-KRIOC4WF.js +281 -0
  128. package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-KUL2MJ6N.js} +6 -6
  129. package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-LUR6QTYB.js} +10 -10
  130. package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-LYS7TI35.js} +368 -321
  131. package/dist/_node-chunks/chunk-MDTXL6SN.js +2613 -0
  132. package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-MIIPXT4S.js} +9 -9
  133. package/dist/_node-chunks/chunk-MLWGAA2I.js +138 -0
  134. package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-MWUGCUB5.js} +52 -22
  135. package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-MX5MVLEK.js} +6 -6
  136. package/dist/_node-chunks/chunk-N44UIGCO.js +47 -0
  137. package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-NP2JHOFY.js} +37 -31
  138. package/dist/_node-chunks/chunk-OMNGOPNG.js +52 -0
  139. package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-OO2GTHUF.js} +9 -17
  140. package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-PC57BIYZ.js} +8 -8
  141. package/dist/_node-chunks/chunk-PHWMAF5C.js +49 -0
  142. package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-PLIQQETC.js} +7 -7
  143. package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-QMYCIS2U.js} +6 -6
  144. package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-QZIDK3GX.js} +89 -71
  145. package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-ROJ6RSIJ.js} +7 -7
  146. package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-S2NB6QEG.js} +542 -1049
  147. package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-S6VCOSQS.js} +6 -6
  148. package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-SEVOOOB2.js} +474 -479
  149. package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-SFT6ZAVN.js} +6 -6
  150. package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-SXBUK4F6.js} +7 -7
  151. package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-TGF6Q66I.js} +15 -9
  152. package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-TGFHWGGT.js} +9 -6
  153. package/dist/_node-chunks/chunk-TTLSBLPQ.js +620 -0
  154. package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-UUAEW2AR.js} +6 -6
  155. package/dist/_node-chunks/chunk-VQHM66NL.js +534 -0
  156. package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-VSTTY3TM.js} +6 -6
  157. package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-XDBSAFUB.js} +650 -9
  158. package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-XTQQGAUZ.js} +7 -7
  159. package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-YMJVSFJT.js} +6 -6
  160. package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-YXEKWVJQ.js} +7 -7
  161. package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-Z6CUUWJO.js} +34 -949
  162. package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-ZAIGR7EV.js} +64 -17
  163. package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-ZCFXEFR6.js} +33 -41
  164. package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-ZHUBOYOD.js} +6 -6
  165. package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-ZHUBTBP2.js} +25 -8
  166. package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-ZSTIFZHY.js} +21 -25
  167. package/dist/_node-chunks/dist-TRTHRODT.js +16 -0
  168. package/dist/_node-chunks/dist-XPLJ5T4W.js +27 -0
  169. package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-AC7MOWYK.js} +21 -22
  170. package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-ZW26VGEP.js} +2263 -130
  171. package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-T2KZK62Q.js} +12 -12
  172. 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
  173. package/dist/_node-chunks/optimized-tests-4AK3PFSX.js +22 -0
  174. package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-CMRGEXHM.js} +12 -12
  175. package/dist/_node-chunks/postinstallAddon-OUQENFYO.js +20 -0
  176. package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-LHOAIJ2E.js} +9 -9
  177. package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-K54MMYY6.js} +9 -9
  178. package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-TTL4PWH7.js} +12 -12
  179. package/dist/_node-chunks/{run-NL66VTNR.js → run-6DXBB5F7.js} +294 -30
  180. package/dist/_node-chunks/{run-KDTIZNSY.js → run-BMTV5ZAO.js} +18 -18
  181. package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-FDPYW25Y.js} +9 -9
  182. package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-2TCFWAAI.js} +9 -9
  183. package/dist/actions/decorator.js +18 -22
  184. package/dist/actions/index.d.ts +4 -4
  185. package/dist/actions/index.js +3 -2
  186. package/dist/addon-a11y/index.d.ts +3 -3
  187. package/dist/addon-a11y/index.js +3 -2
  188. package/dist/addon-a11y/manager.js +41 -38
  189. package/dist/addon-a11y/preset.js +7 -7
  190. package/dist/addon-a11y/preview.d.ts +8 -2
  191. package/dist/addon-a11y/preview.js +3 -2
  192. package/dist/addon-comments/manager.js +353 -0
  193. package/dist/addon-comments/preset.js +80 -0
  194. package/dist/addon-comments/preview.js +101 -0
  195. package/dist/addon-docs/blocks.d.ts +123 -85
  196. package/dist/addon-docs/blocks.js +159 -85
  197. package/dist/addon-docs/index.d.ts +21 -21
  198. package/dist/addon-docs/index.js +3 -3
  199. package/dist/addon-docs/manager.js +6 -6
  200. package/dist/addon-docs/preset.js +12 -12
  201. package/dist/addon-docs/preview.d.ts +3 -1
  202. package/dist/addon-docs/preview.js +1 -1
  203. package/dist/addon-links/index.d.ts +2 -1
  204. package/dist/addon-links/index.js +5 -2
  205. package/dist/addon-links/preview.d.ts +1 -1
  206. package/dist/addon-links/preview.js +5 -2
  207. package/dist/addon-links/react/index.js +4 -1
  208. package/dist/addon-mcp/preset.js +203 -84
  209. package/dist/addon-mcp/preview.js +1 -1
  210. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +71 -71
  211. package/dist/addon-ondevice-actions/index.js +5 -1
  212. package/dist/addon-ondevice-actions/register.js +5 -1
  213. package/dist/addon-ondevice-controls/index.js +1 -1
  214. package/dist/addon-ondevice-controls/register.js +1 -1
  215. package/dist/addon-pseudo-states/index.d.ts +1 -1
  216. package/dist/addon-pseudo-states/index.js +1 -1
  217. package/dist/addon-pseudo-states/manager.js +2 -2
  218. package/dist/addon-pseudo-states/preview.d.ts +1 -1
  219. package/dist/addon-pseudo-states/preview.js +1 -1
  220. package/dist/addon-themes/index.d.ts +7 -6
  221. package/dist/addon-themes/index.js +2 -2
  222. package/dist/addon-themes/manager.js +4 -4
  223. package/dist/addon-themes/postinstall.js +7 -7
  224. package/dist/addon-themes/preview.js +2 -2
  225. package/dist/addon-vitest/constants.js +8 -8
  226. package/dist/addon-vitest/manager.js +32 -23
  227. package/dist/addon-vitest/node/coverage-reporter.js +11 -11
  228. package/dist/addon-vitest/node/vitest.js +37 -37
  229. package/dist/addon-vitest/postinstall.js +10 -10
  230. package/dist/addon-vitest/preset.js +26 -26
  231. package/dist/addon-vitest/vitest-plugin/global-setup.js +23 -23
  232. package/dist/addon-vitest/vitest-plugin/index.js +83 -73
  233. package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
  234. package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
  235. package/dist/babel/index.d.ts +241 -995
  236. package/dist/babel/index.js +30583 -38
  237. package/dist/backgrounds/index.d.ts +1 -1
  238. package/dist/bin/core.js +122 -110
  239. package/dist/bin/dispatcher.js +18 -16
  240. package/dist/bin/loader.js +17 -16
  241. package/dist/builder-next/index.d.ts +59 -0
  242. package/dist/builder-next/index.js +201 -0
  243. package/dist/builder-vite/index.d.ts +8 -3
  244. package/dist/builder-vite/index.js +80 -25
  245. package/dist/builder-vite/preset.js +13 -13
  246. package/dist/channels/index.d.ts +3 -2
  247. package/dist/channels/index.js +97 -24
  248. package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
  249. package/dist/{chunk-C2p5r3Vt.d.ts → chunk-B53gRJBs.d.ts} +838 -703
  250. package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
  251. package/dist/chunk-BcYKnZln.d.ts +10 -0
  252. package/dist/{chunk-Bpi2tz-6.d.ts → chunk-BspNQvZn.d.ts} +21 -23
  253. package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
  254. package/dist/chunk-CFhJCPSB.d.ts +48 -0
  255. package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
  256. package/dist/{chunk-CwQKNaYL.d.ts → chunk-CMx6bGAU.d.ts} +2 -2
  257. package/dist/{chunk-DEVFdzxR.d.ts → chunk-CRmUwbkb.d.ts} +4 -4
  258. package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
  259. package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
  260. package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
  261. package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
  262. package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
  263. package/dist/chunk-DVIvUVkS.d.ts +195 -0
  264. package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
  265. package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
  266. package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
  267. package/dist/chunk-Susgfkap.d.ts +20 -0
  268. package/dist/{chunk-B2t1tGRh.d.ts → chunk-bhl-7rRD.d.ts} +40 -15
  269. package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
  270. package/dist/cli/index.d.ts +15 -904
  271. package/dist/cli/index.js +49 -5209
  272. package/dist/cli/skills/content/index.d.ts +3 -3
  273. package/dist/cli/skills/content/index.js +3 -3
  274. package/dist/cli/tools/sdk/child-host.d.ts +1 -1
  275. package/dist/cli/tools/sdk/child-host.js +17 -17
  276. package/dist/cli/tools/sdk/index.d.ts +4 -4
  277. package/dist/cli/tools/sdk/index.js +18 -18
  278. package/dist/cli-commands/bin/index.js +7 -7
  279. package/dist/client-logger/index.d.ts +20 -21
  280. package/dist/client-logger/index.js +5 -2
  281. package/dist/common/index.d.ts +32 -44
  282. package/dist/common/index.js +89 -98
  283. package/dist/components/index.d.ts +86 -272
  284. package/dist/components/index.js +2759 -8547
  285. package/dist/core-events/index.d.ts +16 -7
  286. package/dist/core-events/index.js +5 -5
  287. package/dist/core-server/index.d.ts +95 -26
  288. package/dist/core-server/index.js +1675 -408
  289. package/dist/core-server/presets/common-manager.js +837 -1335
  290. package/dist/core-server/presets/common-override-preset.js +12 -10
  291. package/dist/core-server/presets/common-preset.js +100 -282
  292. package/dist/create/bin/index.js +7 -7
  293. package/dist/create/index.js +15 -15
  294. package/dist/csf/csf-utils.d.ts +1 -1
  295. package/dist/csf/index.d.ts +6 -6
  296. package/dist/csf/index.js +90 -159
  297. package/dist/csf-tools/index.d.ts +66 -54
  298. package/dist/csf-tools/index.js +19 -17
  299. package/dist/docs-tools/index.d.ts +332 -16
  300. package/dist/docs-tools/index.js +3 -3
  301. package/dist/highlight/index.d.ts +1 -1
  302. package/dist/instrumenter/index.d.ts +5 -5
  303. package/dist/instrumenter/index.js +31 -19
  304. package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
  305. package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
  306. package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-BJ6EZqH7.js} +1035 -623
  307. package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BfXaq_CP.js} +2 -2
  308. package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-BkSn_Jpe.js} +411 -379
  309. package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
  310. package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
  311. package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
  312. package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
  313. package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
  314. package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-Cisw9IIE.js} +11 -11
  315. package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
  316. package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
  317. package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
  318. package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DpvE_zRs.js} +1013 -782
  319. package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
  320. package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
  321. package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
  322. package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-wV08sCKl.js} +715 -620
  323. package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-4OQZWibO.js} +1717 -1536
  324. package/dist/manager/_manager-chunks/runtime-BYxbyNm0.js +201 -0
  325. package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
  326. package/dist/manager/_manager-chunks/runtime-CM4Z8aKR.js +735 -0
  327. package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-Cjo1UL1u.js} +57 -76
  328. package/dist/manager/_manager-chunks/runtime-Cx1-wr6J.js +294 -0
  329. package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-Cxe_uJRb.js} +220 -406
  330. package/dist/manager/_manager-chunks/runtime-D702FFTO.js +551 -0
  331. package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-DnWFp6Zw.js} +8 -534
  332. package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DoYPE6g6.js} +232 -158
  333. package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
  334. package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-sppa-0ll.js} +741 -698
  335. package/dist/manager/globals-runtime.js +1 -1
  336. package/dist/manager/globals.d.ts +12 -12
  337. package/dist/manager/globals.js +12 -12
  338. package/dist/manager/runtime.js +1 -1
  339. package/dist/manager-api/index.d.ts +1 -1
  340. package/dist/manager-api/index.js +538 -528
  341. package/dist/manager-errors.d.ts +1 -1
  342. package/dist/manager-errors.js +2 -2
  343. package/dist/mcp/index.d.ts +10 -10
  344. package/dist/mcp/index.js +11 -11
  345. package/dist/mocking-utils/index.d.ts +7 -5
  346. package/dist/mocking-utils/index.js +34 -34
  347. package/dist/mocking-utils/mocker-runtime.js +2 -2
  348. package/dist/next/index.d.ts +231 -0
  349. package/dist/next/index.js +398 -0
  350. package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
  351. package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
  352. package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
  353. package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
  354. package/dist/nextjs-vite/index.d.ts +4 -4
  355. package/dist/nextjs-vite/index.js +10 -5
  356. package/dist/nextjs-vite/node/index.d.ts +2 -2
  357. package/dist/nextjs-vite/node/index.js +7 -7
  358. package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
  359. package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
  360. package/dist/nextjs-vite/preset.js +117 -15
  361. package/dist/nextjs-vite/preview.d.ts +2 -1
  362. package/dist/nextjs-vite/preview.js +1 -1
  363. package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
  364. package/dist/nextjs-vite/vite-plugin/index.js +9 -9
  365. package/dist/nextjs-vite-plugin/index.d.ts +2 -3
  366. package/dist/nextjs-vite-plugin/index.js +24 -49
  367. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
  368. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
  369. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
  370. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
  371. package/dist/node-logger/index.d.ts +89 -90
  372. package/dist/node-logger/index.js +11 -12
  373. package/dist/oxc-parser/index.js +15 -14
  374. package/dist/oxc-parser/worker.js +10 -10
  375. package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
  376. package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
  377. package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-Cbq5WjbL.js} +772 -418
  378. package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
  379. package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-DDEUZops.js} +453 -161
  380. package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
  381. package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-DsjyhLpG.js} +397 -176
  382. package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-Dwi6NFcX.js} +3 -3
  383. package/dist/preview/globals.d.ts +10 -10
  384. package/dist/preview/globals.js +10 -10
  385. package/dist/preview/runtime.js +1 -1
  386. package/dist/preview-api/index.d.ts +3 -3
  387. package/dist/preview-api/index.js +12 -10
  388. package/dist/preview-errors.d.ts +1 -1
  389. package/dist/preview-errors.js +2 -2
  390. package/dist/react/docgen/docgen-worker.js +11 -12
  391. package/dist/react/entry-preview-argtypes.js +1 -1
  392. package/dist/react/entry-preview-docs.js +1 -1
  393. package/dist/react/entry-preview.js +2 -1
  394. package/dist/react/index.d.ts +9 -11
  395. package/dist/react/index.js +8 -6
  396. package/dist/react/preset.js +13 -14
  397. package/dist/react/preview.d.ts +1 -1
  398. package/dist/react/preview.js +5 -4
  399. package/dist/react-native/bin/get-stories.js +12 -12
  400. package/dist/react-native/index.d.ts +48 -47
  401. package/dist/react-native/index.js +64 -249
  402. package/dist/react-native/metro/node.d.ts +3 -3
  403. package/dist/react-native/metro/node.js +10 -9
  404. package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
  405. package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
  406. package/dist/react-native/preview.js +4 -1
  407. package/dist/react-native/scripts/generate.d.ts +1 -1
  408. package/dist/react-native/scripts/generate.js +8 -8
  409. package/dist/react-native/stub.js +1 -1
  410. package/dist/react-native-theming/index.d.ts +2 -58
  411. package/dist/react-native-theming/index.js +63 -2338
  412. package/dist/react-native-ui/index.d.ts +14 -14
  413. package/dist/react-native-ui/index.js +8 -15
  414. package/dist/react-native-ui-common/index.d.ts +32 -12
  415. package/dist/react-native-ui-common/index.js +26 -31
  416. package/dist/react-vite/index.d.ts +2 -2
  417. package/dist/react-vite/node/index.d.ts +3 -3
  418. package/dist/react-vite/node/index.js +7 -7
  419. package/dist/react-vite/preset.d.ts +3 -1
  420. package/dist/react-vite/preset.js +16 -9
  421. package/dist/router/index.d.ts +80 -3
  422. package/dist/router/index.js +66 -12
  423. package/dist/server-errors.d.ts +1 -1
  424. package/dist/server-errors.js +9 -9
  425. package/dist/shared/open-service/index.d.ts +3 -3
  426. package/dist/shared/open-service/index.js +2 -2
  427. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
  428. package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
  429. package/dist/telemetry/index.d.ts +38 -274
  430. package/dist/telemetry/index.js +11 -68
  431. package/dist/test/index.d.ts +2 -2
  432. package/dist/test/index.js +765 -511
  433. package/dist/theming/create.d.ts +1 -1
  434. package/dist/theming/create.js +2 -1
  435. package/dist/theming/index.d.ts +6 -6
  436. package/dist/theming/index.js +41 -16
  437. package/dist/types/index.d.ts +2 -2
  438. package/dist/types/index.js +5 -5
  439. package/dist/viewport/index.d.ts +1 -1
  440. package/package.json +69 -69
  441. package/skills/setup/SKILL.md +14 -0
  442. package/skills/stories/SKILL.md +21 -0
  443. package/skills/write-story/SKILL.md +14 -0
  444. package/template/nextjs-vite/cli/js/Button.jsx +2 -2
  445. package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
  446. package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
  447. package/template/nextjs-vite/cli/js/Header.jsx +1 -1
  448. package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
  449. package/template/nextjs-vite/cli/js/Page.jsx +3 -3
  450. package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
  451. package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
  452. package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
  453. package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
  454. package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
  455. package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
  456. package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
  457. package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
  458. package/template/react/cli/js/Button.jsx +2 -2
  459. package/template/react/cli/js/Button.stories.js +6 -6
  460. package/template/react/cli/js/Header.jsx +1 -1
  461. package/template/react/cli/js/Header.stories.js +2 -2
  462. package/template/react/cli/js/Page.jsx +3 -3
  463. package/template/react/cli/js/Page.stories.js +2 -2
  464. package/template/react/cli/ts/Button.stories.ts +6 -6
  465. package/template/react/cli/ts/Button.tsx +2 -2
  466. package/template/react/cli/ts/Header.stories.ts +2 -2
  467. package/template/react/cli/ts/Header.tsx +1 -1
  468. package/template/react/cli/ts/Page.stories.ts +2 -2
  469. package/template/react/cli/ts/Page.tsx +3 -3
  470. package/template/react-vite/cli/js/Button.jsx +2 -2
  471. package/template/react-vite/cli/js/Button.stories.js +6 -6
  472. package/template/react-vite/cli/js/Header.jsx +1 -1
  473. package/template/react-vite/cli/js/Header.stories.js +2 -2
  474. package/template/react-vite/cli/js/Page.jsx +3 -3
  475. package/template/react-vite/cli/js/Page.stories.js +2 -2
  476. package/template/react-vite/cli/ts/Button.stories.ts +6 -6
  477. package/template/react-vite/cli/ts/Button.tsx +2 -2
  478. package/template/react-vite/cli/ts/Header.stories.ts +2 -2
  479. package/template/react-vite/cli/ts/Header.tsx +1 -1
  480. package/template/react-vite/cli/ts/Page.stories.ts +2 -2
  481. package/template/react-vite/cli/ts/Page.tsx +3 -3
  482. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  483. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  484. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  485. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  486. package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
  487. package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
  488. package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
  489. package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
  490. package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
  491. package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
  492. package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
  493. package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
  494. package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
  495. package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
  496. package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
  497. package/dist/_node-chunks/chunk-EHUNOMDD.js +0 -52345
  498. package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
  499. package/dist/_node-chunks/chunk-GRBLDJCR.js +0 -989
  500. package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
  501. package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
  502. package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
  503. package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
  504. package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
  505. package/dist/_node-chunks/chunk-RZMQ7S3L.js +0 -92
  506. package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
  507. package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
  508. package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
  509. package/dist/_node-chunks/chunk-UBOGWBEA.js +0 -148
  510. package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
  511. package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
  512. package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
  513. package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
  514. package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
  515. package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
  516. package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
  517. package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
  518. package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
  519. package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
  520. package/dist/chunk-BTVrWliM.d.ts +0 -115
  521. package/dist/chunk-BfBzpgct.d.ts +0 -916
  522. package/dist/chunk-BxWufQms.d.ts +0 -142
  523. package/dist/chunk-DaVb55-_.d.ts +0 -124
  524. package/dist/core-server/presets/common-manager.css +0 -170
  525. package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
  526. package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
  527. package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
  528. package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
  529. package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
  530. package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
  531. package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
  532. package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
  533. package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
  534. package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
  535. package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
  536. 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 mapValues, J as isEqual, Y as require_memoizerific, Z as pickBy, i as stringify, it as invariant, lt as dedent, n as init_main$1, o as parse, q as init_isEqual, rt as init_tiny_invariant, tt as isPlainObject, ut as init_esm } from "./runtime-BZSnICCg.js";
3
- import { n as init_storybook_error, t as StorybookError } from "./runtime-BwSxqk3t.js";
4
- import { $ as RESET_STORY_ARGS, A as channels_exports, B as CONFIG_ERROR, C as toId, Ct as deprecate, D as storyNameFromExport, E as isExportStory, Et as once, F as init_channel_slot, G as FORCE_RE_RENDER, H as DOCS_PREPARED, I as installNoopChannel, J as NAVIGATE_URL, K as GLOBALS_UPDATED, L as setChannel, M as clearChannel, N as ensureChannel, O as init_mock_channel, P as getChannel, Q as PREVIEW_KEYDOWN, R as ARGTYPES_INFO_REQUEST, S as sanitize, St as client_logger_exports, T as init_export_story, Tt as logger, U as DOCS_RENDERED, V as CURRENT_STORY_WAS_SET, W as FORCE_REMOUNT, X as PRELOAD_ENTRIES, Y as PLAY_FUNCTION_THREW_EXCEPTION, Z as PREVIEW_INITIALIZED, _t as UPDATE_GLOBALS, at as STORY_FINISHED, b as combineTags, bt as core_events_exports, c as getCoreAnnotations, ct as STORY_MISSING, d as markAsComposedWithCoreAnnotations, dt as STORY_RENDER_PHASE_CHANGED, et as SET_CURRENT_STORY, ft as STORY_SPECIFIED, gt as UNHANDLED_ERRORS_WHILE_PLAYING, h as init_shared, ht as TELEMETRY_ERROR, i as getStoryChildren, it as STORY_ERRORED, j as init_channels, k as mockChannel, l as hasCoreAnnotations, lt as STORY_PREPARED, m as SNIPPET_RENDERED, mt as STORY_UNCHANGED, n as init_actions, nt as STORY_ARGS_UPDATED, o as isMeta, ot as STORY_HOT_UPDATED, pt as STORY_THREW_EXCEPTION, q as MANAGER_INERT_ATTRIBUTE_CHANGED, rt as STORY_CHANGED, s as isStory, st as STORY_INDEX_INVALIDATED, t as actions_exports, tt as SET_GLOBALS, u as init_core_annotations, ut as STORY_RENDERED, v as includeConditionalArg, vt as UPDATE_QUERY_PARAMS, w as toTestId, wt as init_client_logger, x as init_csf_utils, xt as init_core_events, y as init_includeConditionalArg, yt as UPDATE_STORY_ARGS, z as ARGTYPES_INFO_RESPONSE } from "./runtime-DrTjJkPY.js";
5
- import { _ as init_preview, a as init_story_index_filters, b as init_tags, c as sortStoriesV7, d as userOrAutoTitleFromSpecifier, g as getService, i as init_iframe_resize, l as init_autoTitle, o as isMdxEntry, r as iframeResizeViewportsEqual, s as init_sortStories, t as IFRAME_RESIZE_CONTEXT, u as userOrAutoTitle, v as registerService, y as Tag } from "./runtime-iXdo8CR8.js";
6
- import { h as scope, m as init_dist, p as dist_exports } from "./runtime-BTPtVY1p.js";
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-Cbq5WjbL.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-DDEUZops.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-Dwi6NFcX.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://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function",
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://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"
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://storybook.js.org/docs/writing-tests/interaction-testing?ref=error#run-code-before-the-component-gets-rendered
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://github.com/storybookjs/storybook/blob/next/MIGRATION.md#argtypes-removed-from-loaders-beforeeach-play-and-aftereach",
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://storybook.js.org/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",
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://storybook.js.org/docs/writing-stories/tags
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://github.com/storybookjs/storybook/blob/next/MIGRATION.md#vitest-addon-setprojectannotations-must-not-be-called-in-setup-files",
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://github.com/storybookjs/storybook/blob/next/MIGRATION.md#a11y-addon-replace-element-parameter-with-context-parameter",
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": "__STORYBOOK_MODULE_GLOBAL__",
460
- "@aussieljk/forkbook/test": "__STORYBOOK_MODULE_TEST__",
461
- "@aussieljk/forkbook/actions": "__STORYBOOK_MODULE_ACTIONS__",
462
- "@aussieljk/forkbook/preview-api": "__STORYBOOK_MODULE_PREVIEW_API__",
463
- "@aussieljk/forkbook/internal/channels": "__STORYBOOK_MODULE_CHANNELS__",
464
- "@aussieljk/forkbook/internal/client-logger": "__STORYBOOK_MODULE_CLIENT_LOGGER__",
465
- "@aussieljk/forkbook/internal/core-events": "__STORYBOOK_MODULE_CORE_EVENTS__",
466
- "@aussieljk/forkbook/internal/preview-errors": "__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__",
467
- "@aussieljk/forkbook/internal/types": "__STORYBOOK_MODULE_TYPES__",
468
- "@aussieljk/forkbook/internal/preview-api": "__STORYBOOK_MODULE_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 = "__STORYBOOK_ADDONS_PREVIEW";
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 = scope.FORKBOOK_HOOKS_CONTEXT;
533
- scope.FORKBOOK_HOOKS_CONTEXT = hooks;
529
+ const prevContext = global.FORKBOOK_HOOKS_CONTEXT;
530
+ global.FORKBOOK_HOOKS_CONTEXT = hooks;
534
531
  const result = fn(...args);
535
- scope.FORKBOOK_HOOKS_CONTEXT = prevContext;
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 scope.FORKBOOK_HOOKS_CONTEXT || null;
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 {any[]} [deps] An optional array of dependencies. If any of the dependencies change, the
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 {any[]} [deps] An optional array of dependencies. If any of the dependencies change, the
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 {any[]} [deps] An optional array of dependencies. If any of the dependencies change, the
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 {any[]} [deps=[]] An optional array of dependencies. If any of the dependencies change,
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: any[]) => void} A function to emit events to the Forkbook channel.
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
- init_dist();
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()(...args);
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)(...innerArgs);
951
- return decorator(...args)(...innerArgs);
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
- combineArgs = (value, update) => {
1002
+ combineValues = (value, update) => {
1015
1003
  if (Array.isArray(value) && Array.isArray(update)) return update.reduce((acc, upd, index) => {
1016
- acc[index] = combineArgs(value[index], update[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 = combineArgs(value[key], update[key]);
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://storybook.js.org/docs/api/arg-types?ref=error
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://storybook.js.org/docs/writing-stories/args?ref=error#mapping-to-complex-arg-values
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://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
1140
- - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
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
- init_dist();
1180
+ init_global();
1192
1181
  init_args();
1193
1182
  init_inferArgTypes();
1194
- argTypesForValidation = (story) => scope.FEATURES?.docgenServer ? inferArgTypes({
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 = scope.DOCS_OPTIONS?.autodocs === true ? [Tag.AUTODOCS] : [];
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 (scope.FEATURES?.docgenServer && enhancer.secondPass) return false;
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 (scope.FEATURES?.argTypeTargetsV7) {
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
- return mapping && originalValue in mapping ? mapping[originalValue] : originalValue;
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
- init_dist();
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 && pickBy(argTypes, (argType, key) => {
1835
- const name = argType.name || key.toString();
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.__STORYBOOK_ADDON_VITEST_PROJECT_ANNOTATIONS_APPLIED__) throw new ProjectAnnotationsAlreadyAppliedError();
2171
- globalThis.__STORYBOOK_SET_PROJECT_ANNOTATIONS_CALLED__ = true;
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 ?? {};
@@ -2711,9 +2699,11 @@ function init_StoryRender() {
2711
2699
  context.loaded = await applyLoaders(hookContext);
2712
2700
  });
2713
2701
  if (abortSignal.aborted) return;
2714
- const cleanupCallbacks = await applyBeforeEach(hookContext);
2715
- this.store.addCleanupCallbacks(story, ...cleanupCallbacks);
2716
- if (this.checkIfAborted(abortSignal)) return;
2702
+ await this.runPhase(abortSignal, "beforeEach", async () => {
2703
+ const cleanupCallbacks = await applyBeforeEach(hookContext);
2704
+ this.store.addCleanupCallbacks(story, ...cleanupCallbacks);
2705
+ });
2706
+ if (abortSignal.aborted) return;
2717
2707
  if (!mounted && !isMountDestructured) await context.mount();
2718
2708
  this.notYetRendered = false;
2719
2709
  if (abortSignal.aborted) return;
@@ -2835,11 +2825,11 @@ function init_Preview() {
2835
2825
  init_client_logger();
2836
2826
  init_core_events();
2837
2827
  init_preview_errors();
2838
- init_dist();
2828
+ init_global();
2839
2829
  init_StoryStore(), init_composeProjectAnnotationsWithCore();
2840
2830
  init_main();
2841
2831
  init_StoryRender();
2842
- ({fetch: fetch$1} = scope);
2832
+ ({fetch: fetch$1} = global);
2843
2833
  STORY_INDEX_PATH = "./index.json";
2844
2834
  Preview = class {
2845
2835
  constructor(importFn, getProjectAnnotations, channel = addons.getChannel(), shouldInitialize = true) {
@@ -2877,6 +2867,13 @@ function init_Preview() {
2877
2867
  ready() {
2878
2868
  return this.storeInitializationPromise;
2879
2869
  }
2870
+ /**
2871
+ * Uses another channel, for example the WebSocket channel of a React Native view. Call
2872
+ * `setupListeners()` after it, so that the preview listens on the new channel.
2873
+ */
2874
+ setChannel(channel) {
2875
+ this.channel = channel;
2876
+ }
2880
2877
  setupListeners() {
2881
2878
  this.channel.on(STORY_INDEX_INVALIDATED, this.onStoryIndexChanged.bind(this));
2882
2879
  this.channel.on(UPDATE_GLOBALS, this.onUpdateGlobals.bind(this));
@@ -2919,7 +2916,7 @@ function init_Preview() {
2919
2916
  }
2920
2917
  async getStoryIndexFromServer() {
2921
2918
  const result = await fetch$1(STORY_INDEX_PATH);
2922
- if (result.status === 200) return result.json();
2919
+ if (result.status === 200) return await result.json();
2923
2920
  throw new StoryIndexFetchError({ text: await result.text() });
2924
2921
  }
2925
2922
  initializeWithStoryIndex(storyIndex) {
@@ -3082,36 +3079,67 @@ function init_Preview() {
3082
3079
  })))();
3083
3080
  }
3084
3081
  //#endregion
3085
- //#region src/preview-api/modules/preview-web/embedMode.ts
3086
- var shouldEmbed, shouldAutoplay;
3087
- function init_embedMode() {
3088
- return (init_embedMode = __esmMin((() => {
3089
- shouldEmbed = ({ search }) => {
3090
- return new URLSearchParams(search).get("embed") === "true";
3082
+ //#region src/preview-api/modules/preview-web/AllStories.ts
3083
+ var ALL_STORIES_PARAM, isAllStoriesMode, callbacks, AllStories;
3084
+ function init_AllStories() {
3085
+ return (init_AllStories = __esmMin((() => {
3086
+ init_client_logger();
3087
+ init_story_grid();
3088
+ ALL_STORIES_PARAM = "allStories";
3089
+ isAllStoriesMode = ({ search }) => new URLSearchParams(search).get(ALL_STORIES_PARAM) === "true";
3090
+ callbacks = {
3091
+ showStoryDuringRender: () => {},
3092
+ showMain: () => {},
3093
+ showError: ({ title }) => logger.error(title),
3094
+ showException: (err) => logger.error(err)
3091
3095
  };
3092
- shouldAutoplay = ({ search }) => !shouldEmbed({ search });
3093
- })))();
3094
- }
3095
- //#endregion
3096
- //#region src/preview-api/modules/preview-web/getEmbedResizeViewport.ts
3097
- var getEmbedResizeViewport;
3098
- function init_getEmbedResizeViewport() {
3099
- return (init_getEmbedResizeViewport = __esmMin((() => {
3100
- init_constants();
3101
- init_defaults();
3102
- init_resolveViewport();
3103
- getEmbedResizeViewport = (storyStore, render, reference) => {
3104
- if (!storyStore || !render?.story) return;
3105
- const { globals, storyGlobals, userGlobals, parameters } = storyStore.getStoryContext(render.story);
3106
- const viewportParameters = parameters[PARAM_KEY];
3107
- return toResolvedViewportDimensions(resolveViewport({
3108
- globals,
3109
- storyGlobals,
3110
- userGlobals,
3111
- options: viewportParameters?.options ?? MINIMAL_VIEWPORTS,
3112
- disable: viewportParameters?.disable ?? false,
3113
- viewMode: "story"
3114
- }), reference);
3096
+ AllStories = class {
3097
+ constructor(store, renderStoryToElement) {
3098
+ this.store = store;
3099
+ this.renderStoryToElement = renderStoryToElement;
3100
+ this.teardowns = [];
3101
+ }
3102
+ async render(root) {
3103
+ await this.stop();
3104
+ root.replaceChildren();
3105
+ const doc = root.ownerDocument;
3106
+ const components = groupEntriesByComponent(Object.values(this.store.storyIndex.entries));
3107
+ for (const component of components) {
3108
+ if (component.storyIds.length === 0) continue;
3109
+ const section = doc.createElement("section");
3110
+ section.className = "fb-all-stories-component";
3111
+ section.style.padding = "16px 24px";
3112
+ const heading = doc.createElement("h2");
3113
+ heading.textContent = component.title;
3114
+ section.appendChild(heading);
3115
+ root.appendChild(section);
3116
+ for (const storyId of component.storyIds) {
3117
+ const entry = this.store.storyIndex.entries[storyId];
3118
+ const block = doc.createElement("div");
3119
+ block.className = "fb-all-stories-story";
3120
+ block.dataset.storyId = storyId;
3121
+ block.style.margin = "12px 0 24px";
3122
+ const name = doc.createElement("h3");
3123
+ name.textContent = entry?.name ?? storyId;
3124
+ const canvas = doc.createElement("div");
3125
+ block.append(name, canvas);
3126
+ section.appendChild(block);
3127
+ try {
3128
+ const story = await this.store.loadStory({ storyId });
3129
+ this.teardowns.push(this.renderStoryToElement(story, canvas, callbacks, {
3130
+ autoplay: true,
3131
+ forceInitialArgs: false
3132
+ }));
3133
+ } catch (err) {
3134
+ canvas.textContent = `Could not render this story: ${err.message}`;
3135
+ logger.error(err);
3136
+ }
3137
+ }
3138
+ }
3139
+ }
3140
+ async stop() {
3141
+ await Promise.all(this.teardowns.splice(0).map((teardown) => teardown()));
3142
+ }
3115
3143
  };
3116
3144
  })))();
3117
3145
  }
@@ -3456,12 +3484,152 @@ function init_MdxDocsRender() {
3456
3484
  })))();
3457
3485
  }
3458
3486
  //#endregion
3487
+ //#region src/preview-api/modules/preview-web/InfiniteDocs.ts
3488
+ var document$4, IntersectionObserver, docsEntriesInOrder, nextDocsEntry, InfiniteDocs;
3489
+ function init_InfiniteDocs() {
3490
+ return (init_InfiniteDocs = __esmMin((() => {
3491
+ init_core_events();
3492
+ init_story_index_filters();
3493
+ init_CsfDocsRender();
3494
+ init_MdxDocsRender();
3495
+ ({document: document$4, IntersectionObserver} = globalThis);
3496
+ docsEntriesInOrder = (entries) => {
3497
+ const docs = Object.values(entries).filter((entry) => entry.type === "docs");
3498
+ const isTopLevel = (entry) => !entry.title.includes("/");
3499
+ return [...docs.filter(isTopLevel), ...docs.filter((entry) => !isTopLevel(entry))];
3500
+ };
3501
+ nextDocsEntry = (entries, id) => {
3502
+ const docs = docsEntriesInOrder(entries);
3503
+ const index = docs.findIndex((entry) => entry.id === id);
3504
+ return index === -1 ? void 0 : docs[index + 1];
3505
+ };
3506
+ InfiniteDocs = class {
3507
+ constructor(channel, store, renderStoryToElement, callbacks) {
3508
+ this.channel = channel;
3509
+ this.store = store;
3510
+ this.renderStoryToElement = renderStoryToElement;
3511
+ this.callbacks = callbacks;
3512
+ this.renders = [];
3513
+ this.loading = false;
3514
+ }
3515
+ /** Starts after the main docs page `entry` rendered into `docsRoot`. */
3516
+ start(entry, docsRoot) {
3517
+ this.stop();
3518
+ if (typeof IntersectionObserver === "undefined" || typeof document$4 === "undefined" || !docsRoot?.dataset) return;
3519
+ if (this.store.projectAnnotations?.parameters?.docs?.infiniteScroll === false) return;
3520
+ this.lastId = entry.id;
3521
+ this.inViewId = entry.id;
3522
+ docsRoot.dataset.docsId = entry.id;
3523
+ const container = document$4.createElement("div");
3524
+ container.className = "fb-infinite-docs";
3525
+ const sentinel = document$4.createElement("div");
3526
+ sentinel.className = "fb-infinite-docs-sentinel";
3527
+ sentinel.style.height = "1px";
3528
+ container.appendChild(sentinel);
3529
+ docsRoot.after(container);
3530
+ this.container = container;
3531
+ this.pageObserver = new IntersectionObserver((records) => {
3532
+ for (const record of records) {
3533
+ const id = record.target.dataset.docsId;
3534
+ if (record.isIntersecting && id && id !== this.inViewId) {
3535
+ this.inViewId = id;
3536
+ this.channel.emit(DOCS_PAGE_IN_VIEW, { storyId: id });
3537
+ }
3538
+ }
3539
+ }, { rootMargin: "-10% 0px -60% 0px" });
3540
+ this.pageObserver.observe(docsRoot);
3541
+ this.sentinelObserver = new IntersectionObserver((records) => {
3542
+ if (records.some((record) => record.isIntersecting)) this.loadNext();
3543
+ }, { rootMargin: "0px 0px 600px 0px" });
3544
+ this.sentinelObserver.observe(sentinel);
3545
+ }
3546
+ async loadNext() {
3547
+ const { container, lastId } = this;
3548
+ if (this.loading || !container || !lastId) return;
3549
+ const entry = nextDocsEntry(this.store.storyIndex.entries, lastId);
3550
+ if (!entry) {
3551
+ this.sentinelObserver?.disconnect();
3552
+ return;
3553
+ }
3554
+ this.loading = true;
3555
+ this.lastId = entry.id;
3556
+ const element = document$4.createElement("div");
3557
+ element.className = "fb-infinite-docs-page";
3558
+ element.dataset.docsId = entry.id;
3559
+ container.insertBefore(element, container.lastChild);
3560
+ 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));
3561
+ this.renders.push(render);
3562
+ try {
3563
+ await render.prepare();
3564
+ if (this.container !== container) return;
3565
+ await render.renderToElement(element, this.renderStoryToElement);
3566
+ this.pageObserver?.observe(element);
3567
+ } catch (err) {
3568
+ this.sentinelObserver?.disconnect();
3569
+ } finally {
3570
+ this.loading = false;
3571
+ }
3572
+ const sentinel = container.lastElementChild;
3573
+ if (sentinel && sentinel.getBoundingClientRect().top < globalThis.innerHeight + 600) this.loadNext();
3574
+ }
3575
+ /** Removes the pages below the main page. */
3576
+ stop() {
3577
+ this.sentinelObserver?.disconnect();
3578
+ this.pageObserver?.disconnect();
3579
+ this.sentinelObserver = void 0;
3580
+ this.pageObserver = void 0;
3581
+ for (const render of this.renders) render.teardown({ viewModeChanged: true });
3582
+ this.renders = [];
3583
+ this.container?.remove();
3584
+ this.container = void 0;
3585
+ this.lastId = void 0;
3586
+ this.inViewId = void 0;
3587
+ this.loading = false;
3588
+ }
3589
+ };
3590
+ })))();
3591
+ }
3592
+ //#endregion
3593
+ //#region src/preview-api/modules/preview-web/embedMode.ts
3594
+ var shouldEmbed, shouldAutoplay;
3595
+ function init_embedMode() {
3596
+ return (init_embedMode = __esmMin((() => {
3597
+ shouldEmbed = ({ search }) => {
3598
+ return new URLSearchParams(search).get("embed") === "true";
3599
+ };
3600
+ shouldAutoplay = ({ search }) => !shouldEmbed({ search });
3601
+ })))();
3602
+ }
3603
+ //#endregion
3604
+ //#region src/preview-api/modules/preview-web/getEmbedResizeViewport.ts
3605
+ var getEmbedResizeViewport;
3606
+ function init_getEmbedResizeViewport() {
3607
+ return (init_getEmbedResizeViewport = __esmMin((() => {
3608
+ init_constants();
3609
+ init_defaults();
3610
+ init_resolveViewport();
3611
+ getEmbedResizeViewport = (storyStore, render, reference) => {
3612
+ if (!storyStore || !render?.story) return;
3613
+ const { globals, storyGlobals, userGlobals, parameters } = storyStore.getStoryContext(render.story);
3614
+ const viewportParameters = parameters[PARAM_KEY];
3615
+ return toResolvedViewportDimensions(resolveViewport({
3616
+ globals,
3617
+ storyGlobals,
3618
+ userGlobals,
3619
+ options: viewportParameters?.options ?? MINIMAL_VIEWPORTS,
3620
+ disable: viewportParameters?.disable ?? false,
3621
+ viewMode: "story"
3622
+ }), reference);
3623
+ };
3624
+ })))();
3625
+ }
3626
+ //#endregion
3459
3627
  //#region src/preview-api/modules/preview-web/setupStoryFreezer.ts
3460
3628
  var FREEZE_STYLE_ID, PRE_FREEZE_STYLE_ID, tryReplaceProperty, getQueryParam, shouldFreeze, stripScriptElements, stripInlineEventHandlers, addFreezeStyles, addPreFreezeStyles, finishAndPauseAnimations, blockInteractions, createStoryFreezer, setupStoryFreezer;
3461
3629
  function init_setupStoryFreezer() {
3462
3630
  return (init_setupStoryFreezer = __esmMin((() => {
3463
3631
  init_core_events();
3464
- init_dist();
3632
+ init_global();
3465
3633
  FREEZE_STYLE_ID = "storybook-freeze-after-finished";
3466
3634
  PRE_FREEZE_STYLE_ID = "storybook-freeze-end-frame-preload";
3467
3635
  tryReplaceProperty = (target, key, value) => {
@@ -3647,8 +3815,8 @@ function init_setupStoryFreezer() {
3647
3815
  return { freeze };
3648
3816
  };
3649
3817
  setupStoryFreezer = (channel, options = {}) => {
3650
- const windowRef = scope.window;
3651
- const documentRef = scope.document;
3818
+ const windowRef = global.window;
3819
+ const documentRef = global.document;
3652
3820
  if (!windowRef || !documentRef) return false;
3653
3821
  if (!shouldFreeze({ search: documentRef.location.search })) return false;
3654
3822
  addPreFreezeStyles(documentRef);
@@ -3678,7 +3846,7 @@ function init_setupStoryFreezer() {
3678
3846
  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
3847
  function init_setupContentResizeBroadcast() {
3680
3848
  return (init_setupContentResizeBroadcast = __esmMin((() => {
3681
- init_dist();
3849
+ init_global();
3682
3850
  init_iframe_resize();
3683
3851
  init_embedMode();
3684
3852
  init_setupStoryFreezer();
@@ -3877,8 +4045,8 @@ function init_setupContentResizeBroadcast() {
3877
4045
  const style = documentRef.createElement("style");
3878
4046
  style.id = EMBED_UI_STYLE_ID;
3879
4047
  style.textContent = `
3880
- .sb-preparing-story,
3881
- .sb-preparing-docs {
4048
+ .fb-preparing-story,
4049
+ .fb-preparing-docs {
3882
4050
  display: none !important;
3883
4051
  }
3884
4052
  `;
@@ -3926,8 +4094,8 @@ function init_setupContentResizeBroadcast() {
3926
4094
  };
3927
4095
  setupContentResizeBroadcast = (options = {}) => {
3928
4096
  const { getViewport } = options;
3929
- const windowRef = scope.window;
3930
- const documentRef = scope.document;
4097
+ const windowRef = global.window;
4098
+ const documentRef = global.document;
3931
4099
  if (!windowRef || !documentRef) return {};
3932
4100
  if (!shouldEmbed({ search: documentRef.location.search })) return {};
3933
4101
  lastDimensions = null;
@@ -3986,6 +4154,26 @@ function init_setupContentResizeBroadcast() {
3986
4154
  })))();
3987
4155
  }
3988
4156
  //#endregion
4157
+ //#region src/preview-api/modules/preview-web/withFilePath.ts
4158
+ /**
4159
+ * Adds the story file path below the first line of an error message, so the error display in the
4160
+ * preview says which file to fix. The view shows the first line as the heading and the rest as
4161
+ * detail, so the stack moves into the detail.
4162
+ */
4163
+ function withFilePath(error, importPath) {
4164
+ const message = error.message || String(error);
4165
+ const stack = error.stack ?? "";
4166
+ if (!importPath || message.includes(importPath)) return {
4167
+ message,
4168
+ stack
4169
+ };
4170
+ const [header, ...rest] = message.split("\n");
4171
+ return {
4172
+ message: `${header}\nIn ${importPath}\n\n${rest.length ? rest.join("\n").replace(/^\n/, "") : stack}`.trimEnd(),
4173
+ stack
4174
+ };
4175
+ }
4176
+ //#endregion
3989
4177
  //#region src/preview-api/modules/preview-web/PreviewWithSelection.tsx
3990
4178
  function focusInInput(event) {
3991
4179
  const target = event.composedPath && event.composedPath()[0] || event.target;
@@ -4010,6 +4198,8 @@ function init_PreviewWithSelection() {
4010
4198
  init_tags();
4011
4199
  init_story_index_filters();
4012
4200
  init_Preview();
4201
+ init_AllStories();
4202
+ init_InfiniteDocs();
4013
4203
  init_embedMode();
4014
4204
  init_getEmbedResizeViewport();
4015
4205
  init_CsfDocsRender();
@@ -4060,6 +4250,10 @@ function init_PreviewWithSelection() {
4060
4250
  }
4061
4251
  async selectSpecifiedStory() {
4062
4252
  if (!this.storyStoreValue) throw new CalledPreviewMethodBeforeInitializationError({ methodName: "selectSpecifiedStory" });
4253
+ if (isAllStoriesMode({ search: globalWindow.location?.search ?? "" })) {
4254
+ await this.renderAllStories();
4255
+ return;
4256
+ }
4063
4257
  if (this.selectionStore.selection) {
4064
4258
  await this.renderSelection();
4065
4259
  return;
@@ -4084,6 +4278,13 @@ function init_PreviewWithSelection() {
4084
4278
  this.channel.emit(CURRENT_STORY_WAS_SET, this.selectionStore.selection);
4085
4279
  await this.renderSelection({ persistedArgs: args });
4086
4280
  }
4281
+ /** Renders all stories in one page (`iframe.html?allStories=true`). */
4282
+ async renderAllStories() {
4283
+ if (!this.storyStoreValue) throw new CalledPreviewMethodBeforeInitializationError({ methodName: "renderAllStories" });
4284
+ this.allStories ??= new AllStories(this.storyStoreValue, this.renderStoryToElement.bind(this));
4285
+ const root = this.view.prepareForDocs({ scrollReset: false });
4286
+ await this.allStories.render(root);
4287
+ }
4087
4288
  async onGetProjectAnnotationsChanged({ getProjectAnnotations }) {
4088
4289
  await super.onGetProjectAnnotationsChanged({ getProjectAnnotations });
4089
4290
  if (this.selectionStore.selection) this.renderSelection();
@@ -4158,6 +4359,7 @@ function init_PreviewWithSelection() {
4158
4359
  const { selection } = this.selectionStore;
4159
4360
  if (!selection) throw new Error("Cannot call renderSelection as no selection was made");
4160
4361
  const { storyId } = selection;
4362
+ this.infiniteDocs?.stop();
4161
4363
  let entry;
4162
4364
  try {
4163
4365
  entry = await this.storyStoreValue.storyIdToEntry(storyId);
@@ -4242,7 +4444,21 @@ function init_PreviewWithSelection() {
4242
4444
  invariant(!!render.story);
4243
4445
  this.storyRenders.push(render);
4244
4446
  this.currentRender.renderToElement(this.view.prepareForStory(render.story, { scrollReset: storyIdChanged || viewModeChanged }));
4245
- } else this.currentRender.renderToElement(this.view.prepareForDocs({ scrollReset: storyIdChanged || viewModeChanged }), this.renderStoryToElement.bind(this));
4447
+ } else {
4448
+ const docsRoot = this.view.prepareForDocs({ scrollReset: storyIdChanged || viewModeChanged });
4449
+ const docsRender = this.currentRender;
4450
+ docsRender.renderToElement(docsRoot, this.renderStoryToElement.bind(this)).then(() => {
4451
+ if (this.currentRender === docsRender && this.storyStoreValue) {
4452
+ this.infiniteDocs ??= new InfiniteDocs(this.channel, this.storyStoreValue, this.renderStoryToElement.bind(this), () => ({
4453
+ showStoryDuringRender: () => {},
4454
+ showMain: () => {},
4455
+ showError: () => {},
4456
+ showException: (err) => logger.error(err)
4457
+ }));
4458
+ this.infiniteDocs.start(entry, docsRoot);
4459
+ }
4460
+ });
4461
+ }
4246
4462
  }
4247
4463
  async teardownRender(render, { viewModeChanged = false, keepRenderedDom = false } = {}) {
4248
4464
  this.storyRenders = this.storyRenders.filter((r) => r !== render);
@@ -4267,9 +4483,14 @@ function init_PreviewWithSelection() {
4267
4483
  this.view.showNoPreview();
4268
4484
  this.channel.emit(STORY_MISSING);
4269
4485
  }
4486
+ /** The story file of a story, so an error can say which file to fix. */
4487
+ importPathOf(storySpecifier) {
4488
+ if (typeof storySpecifier !== "string") return;
4489
+ return this.storyStoreValue?.storyIndex.entries[storySpecifier]?.importPath;
4490
+ }
4270
4491
  renderStoryLoadingException(storySpecifier, err) {
4271
4492
  logger.error(err);
4272
- this.view.showErrorDisplay(err);
4493
+ this.view.showErrorDisplay(withFilePath(err, this.importPathOf(storySpecifier)));
4273
4494
  this.channel.emit(STORY_MISSING, storySpecifier);
4274
4495
  }
4275
4496
  renderException(storyId, error) {
@@ -4285,7 +4506,7 @@ function init_PreviewWithSelection() {
4285
4506
  renderId,
4286
4507
  storyId
4287
4508
  });
4288
- this.view.showErrorDisplay(error);
4509
+ this.view.showErrorDisplay(withFilePath(error, this.importPathOf(storyId)));
4289
4510
  logger.error(`Error rendering story '${storyId}':`);
4290
4511
  logger.error(error);
4291
4512
  }
@@ -4364,7 +4585,7 @@ function init_parseArgsParam() {
4364
4585
  once.warn(dedent`
4365
4586
  Omitted potentially unsafe URL args.
4366
4587
 
4367
- More info: https://storybook.js.org/docs/writing-stories/args?ref=error#setting-args-through-the-url
4588
+ More info: https://forkbook.ljk.dev/docs/writing-stories/args#setting-args-through-the-url
4368
4589
  `);
4369
4590
  return acc;
4370
4591
  }, {});
@@ -4384,10 +4605,10 @@ function pathToViewMode(path) {
4384
4605
  var history, document$3, PATH_REGEX, getQueryString, setPath, isObject, getFirstString, getSelectionSpecifierFromPath, UrlStore;
4385
4606
  function init_UrlStore() {
4386
4607
  return (init_UrlStore = __esmMin((() => {
4387
- init_dist();
4608
+ init_global();
4388
4609
  init_main$1();
4389
4610
  init_parseArgsParam();
4390
- ({history, document: document$3} = scope);
4611
+ ({history, document: document$3} = global);
4391
4612
  PATH_REGEX = /^\/(story|docs)\/(.+)/;
4392
4613
  getQueryString = ({ selection, extraParams }) => {
4393
4614
  const search = document$3?.location.search.slice(1);
@@ -4457,11 +4678,11 @@ var import_ansi_to_html, document$2, PREPARING_DELAY, Mode, classes, layoutClass
4457
4678
  function init_WebView() {
4458
4679
  return (init_WebView = __esmMin((() => {
4459
4680
  init_client_logger();
4460
- init_dist();
4681
+ init_global();
4461
4682
  import_ansi_to_html = /* @__PURE__ */ __toESM(require_ansi_to_html(), 1);
4462
4683
  init_main$1();
4463
4684
  init_esm();
4464
- ({document: document$2} = scope);
4685
+ ({document: document$2} = global);
4465
4686
  PREPARING_DELAY = 100;
4466
4687
  Mode = /* @__PURE__ */ function(Mode) {
4467
4688
  Mode["MAIN"] = "MAIN";
@@ -4472,16 +4693,16 @@ function init_WebView() {
4472
4693
  return Mode;
4473
4694
  }(Mode || {});
4474
4695
  classes = {
4475
- PREPARING_STORY: "sb-show-preparing-story",
4476
- PREPARING_DOCS: "sb-show-preparing-docs",
4477
- MAIN: "sb-show-main",
4478
- NOPREVIEW: "sb-show-nopreview",
4479
- ERROR: "sb-show-errordisplay"
4696
+ PREPARING_STORY: "fb-show-preparing-story",
4697
+ PREPARING_DOCS: "fb-show-preparing-docs",
4698
+ MAIN: "fb-show-main",
4699
+ NOPREVIEW: "fb-show-nopreview",
4700
+ ERROR: "fb-show-errordisplay"
4480
4701
  };
4481
4702
  layoutClassMap = {
4482
- centered: "sb-main-centered",
4483
- fullscreen: "sb-main-fullscreen",
4484
- padded: "sb-main-padded"
4703
+ centered: "fb-main-centered",
4704
+ fullscreen: "fb-main-fullscreen",
4705
+ padded: "fb-main-padded"
4485
4706
  };
4486
4707
  ansiConverter = new import_ansi_to_html.default({ escapeXML: true });
4487
4708
  WebView = class {
@@ -4612,7 +4833,7 @@ function init_WebView() {
4612
4833
  var PreviewWeb;
4613
4834
  function init_PreviewWeb() {
4614
4835
  return (init_PreviewWeb = __esmMin((() => {
4615
- init_dist();
4836
+ init_global();
4616
4837
  init_PreviewWithSelection();
4617
4838
  init_UrlStore();
4618
4839
  init_WebView();
@@ -4621,7 +4842,7 @@ function init_PreviewWeb() {
4621
4842
  super(importFn, getProjectAnnotations, new UrlStore(), new WebView());
4622
4843
  this.importFn = importFn;
4623
4844
  this.getProjectAnnotations = getProjectAnnotations;
4624
- scope.__STORYBOOK_PREVIEW__ = this;
4845
+ global.__FORKBOOK_PREVIEW__ = this;
4625
4846
  }
4626
4847
  };
4627
4848
  })))();
@@ -4673,8 +4894,8 @@ function simulatePageLoad($container) {
4673
4894
  var document$1, runScriptTypes, SCRIPT, SCRIPTS_ROOT_ID;
4674
4895
  function init_simulate_pageload() {
4675
4896
  return (init_simulate_pageload = __esmMin((() => {
4676
- init_dist();
4677
- ({document: document$1} = scope);
4897
+ init_global();
4898
+ ({document: document$1} = global);
4678
4899
  runScriptTypes = [
4679
4900
  "application/javascript",
4680
4901
  "application/ecmascript",
@@ -4806,12 +5027,12 @@ function init_runtime() {
4806
5027
  init_core_events();
4807
5028
  init_preview_errors();
4808
5029
  init_types();
4809
- init_dist();
5030
+ init_global();
4810
5031
  init_actions();
4811
5032
  init_preview_api();
4812
5033
  init_test();
4813
5034
  globalsNameValueMap = {
4814
- "@storybook/global": dist_exports,
5035
+ "@storybook/global": global_exports,
4815
5036
  "@aussieljk/forkbook/test": test_exports,
4816
5037
  "@aussieljk/forkbook/actions": actions_exports,
4817
5038
  "@aussieljk/forkbook/preview-api": preview_api_exports,
@@ -4828,8 +5049,8 @@ function init_runtime() {
4828
5049
  //#region src/preview/preview-navigator.ts
4829
5050
  async function maybeSetupPreviewNavigator() {
4830
5051
  const url = new URL(window.location.href);
4831
- if (url.searchParams.get("navigator") !== "true" || globalThis.__STORYBOOK_PREVIEW_NAVIGATOR__) return;
4832
- globalThis.__STORYBOOK_PREVIEW_NAVIGATOR__ = true;
5052
+ if (url.searchParams.get("navigator") !== "true" || globalThis.__FORKBOOK_PREVIEW_NAVIGATOR__) return;
5053
+ globalThis.__FORKBOOK_PREVIEW_NAVIGATOR__ = true;
4833
5054
  const index = await (await fetch("./index.json")).json();
4834
5055
  const currentEntryId = url.searchParams.get("id");
4835
5056
  if (!currentEntryId) {
@@ -4850,14 +5071,14 @@ function init_preview_navigator() {
4850
5071
  const li = document.createElement("li");
4851
5072
  if ("entries" in node && "title" in node) {
4852
5073
  const branchNode = node;
4853
- li.className = "sb-navigator-branch";
5074
+ li.className = "fb-navigator-branch";
4854
5075
  const details = document.createElement("details");
4855
5076
  if (branchNode.isActive) details.open = true;
4856
5077
  const summary = document.createElement("summary");
4857
- summary.className = "sb-navigator-title";
5078
+ summary.className = "fb-navigator-title";
4858
5079
  summary.textContent = branchNode.title;
4859
5080
  const ul = document.createElement("ul");
4860
- ul.className = "sb-navigator-entries";
5081
+ ul.className = "fb-navigator-entries";
4861
5082
  ul.setAttribute("aria-label", branchNode.title);
4862
5083
  for (const child of Object.values(branchNode.entries)) ul.appendChild(createElementForNode(child));
4863
5084
  details.appendChild(summary);
@@ -4865,10 +5086,10 @@ function init_preview_navigator() {
4865
5086
  li.appendChild(details);
4866
5087
  } else {
4867
5088
  const leafNode = node;
4868
- li.className = "sb-navigator-story-item";
5089
+ li.className = "fb-navigator-story-item";
4869
5090
  const a = document.createElement("a");
4870
5091
  a.href = leafNode.href;
4871
- a.className = `sb-navigator-story-link${leafNode.isActive ? " active" : ""}`;
5092
+ a.className = `fb-navigator-story-link${leafNode.isActive ? " active" : ""}`;
4872
5093
  if (leafNode.isActive) a.setAttribute("aria-current", "location");
4873
5094
  a.textContent = leafNode.name;
4874
5095
  li.appendChild(a);
@@ -4903,21 +5124,21 @@ function init_preview_navigator() {
4903
5124
  };
4904
5125
  }
4905
5126
  const navList = document.createElement("ul");
4906
- navList.className = "sb-navigator-list";
5127
+ navList.className = "fb-navigator-list";
4907
5128
  for (const entry of Object.values(tree.entries)) navList.appendChild(createElementForNode(entry));
4908
5129
  const nav = document.createElement("nav");
4909
- nav.id = "sb-navigator-container";
5130
+ nav.id = "fb-navigator-container";
4910
5131
  nav.setAttribute("role", "navigation");
4911
5132
  nav.setAttribute("aria-label", "Story navigation");
4912
5133
  nav.appendChild(navList);
4913
5134
  document.body.insertBefore(nav, document.body.firstChild);
4914
5135
  const style = document.createElement("style");
4915
- style.id = "sb-navigator-style";
5136
+ style.id = "fb-navigator-style";
4916
5137
  style.textContent = `
4917
5138
  body {
4918
5139
  display: grid !important;
4919
5140
  grid-template-columns: 300px 1fr;
4920
- font-family: 'Nunito', sans-serif;
5141
+ font-family: 'Inter Variable', sans-serif;
4921
5142
  height: 100vh;
4922
5143
  margin: 0;
4923
5144
 
@@ -4934,10 +5155,10 @@ function init_preview_navigator() {
4934
5155
  max-height: 100vh;
4935
5156
  max-width: 100%;
4936
5157
  }
4937
- #sb-navigator-container, #sb-navigator-container * {
5158
+ #fb-navigator-container, #fb-navigator-container * {
4938
5159
  box-sizing: border-box;
4939
5160
  }
4940
- #sb-navigator-container {
5161
+ #fb-navigator-container {
4941
5162
  height: 100vh;
4942
5163
  overflow-y: auto;
4943
5164
  border-right: 1px solid #eee;
@@ -4948,50 +5169,50 @@ function init_preview_navigator() {
4948
5169
  align-self: start;
4949
5170
  z-index: 1000;
4950
5171
  }
4951
- .sb-main-padded #sb-navigator-container {
5172
+ .fb-main-padded #fb-navigator-container {
4952
5173
  margin: -1rem 1rem -1rem -1rem;
4953
5174
  }
4954
- .sb-navigator-list {
5175
+ .fb-navigator-list {
4955
5176
  list-style-type: none;
4956
5177
  padding: 0;
4957
5178
  margin: 0;
4958
5179
  }
4959
- .sb-navigator-branch {
5180
+ .fb-navigator-branch {
4960
5181
  list-style-type: none;
4961
5182
  }
4962
- .sb-navigator-item {
5183
+ .fb-navigator-item {
4963
5184
  margin-bottom: 15px;
4964
5185
  }
4965
- .sb-navigator-title {
5186
+ .fb-navigator-title {
4966
5187
  color: var(--text-color);
4967
5188
  text-decoration: none;
4968
5189
  padding-block: 5px;
4969
5190
  cursor: pointer;
4970
5191
  }
4971
- .sb-navigator-entries {
5192
+ .fb-navigator-entries {
4972
5193
  padding-left: 15px;
4973
5194
  }
4974
- .sb-navigator-story-item {
5195
+ .fb-navigator-story-item {
4975
5196
  margin-bottom: 8px;
4976
5197
  margin-left: 8px;
4977
5198
  }
4978
- .sb-navigator-story-link {
5199
+ .fb-navigator-story-link {
4979
5200
  color: var(--text-color);
4980
5201
  }
4981
- .sb-navigator-story-link.active {
5202
+ .fb-navigator-story-link.active {
4982
5203
  font-weight: bold;
4983
- color: hsl(212 100 46);
5204
+ color: #007aff;
4984
5205
  }
4985
5206
  `;
4986
5207
  document.head.appendChild(style);
4987
- nav.querySelector(".sb-navigator-story-link.active")?.closest("details")?.scrollIntoView({ block: "center" });
5208
+ nav.querySelector(".fb-navigator-story-link.active")?.closest("details")?.scrollIntoView({ block: "center" });
4988
5209
  };
4989
5210
  })))();
4990
5211
  }
4991
5212
  //#endregion
4992
5213
  //#region src/preview/utils.ts
4993
5214
  function getBrowserInfo() {
4994
- if (!browserInfo) browserInfo = new import_browser_dtector_umd_min.default(scope.navigator?.userAgent).getBrowserInfo();
5215
+ if (!browserInfo) browserInfo = new import_browser_dtector_umd_min.default(global.navigator?.userAgent).getBrowserInfo();
4995
5216
  return browserInfo;
4996
5217
  }
4997
5218
  function prepareForTelemetry(error) {
@@ -5001,7 +5222,7 @@ function prepareForTelemetry(error) {
5001
5222
  var import_browser_dtector_umd_min, browserInfo;
5002
5223
  function init_utils() {
5003
5224
  return (init_utils = __esmMin((() => {
5004
- init_dist();
5225
+ init_global();
5005
5226
  import_browser_dtector_umd_min = /* @__PURE__ */ __toESM(require_browser_dtector_umd_min(), 1);
5006
5227
  })))();
5007
5228
  }
@@ -5011,23 +5232,23 @@ function setInert(inert) {
5011
5232
  if (inert) document.body?.setAttribute("inert", "true");
5012
5233
  else document.body?.removeAttribute("inert");
5013
5234
  }
5014
- function errorListener(args) {
5015
- const error = args.error || args;
5016
- if (error.fromStorybook) scope.sendTelemetryError(error);
5235
+ function errorListener(event) {
5236
+ const error = event.error || event;
5237
+ if (error.fromStorybook) global.sendTelemetryError(error);
5017
5238
  }
5018
5239
  function unhandledRejectionListener({ reason }) {
5019
- if (reason.fromStorybook) scope.sendTelemetryError(reason);
5240
+ if (reason.fromStorybook) global.sendTelemetryError(reason);
5020
5241
  }
5021
5242
  function setup() {
5022
5243
  globalPackages.forEach((key) => {
5023
- scope[globalsNameReferenceMap[key]] = globalsNameValueMap[key];
5244
+ Object.assign(global, { [globalsNameReferenceMap[key]]: globalsNameValueMap[key] });
5024
5245
  });
5025
- scope.sendTelemetryError = (error) => {
5246
+ global.sendTelemetryError = (error) => {
5026
5247
  const channel = getChannel();
5027
5248
  if (!channel) return;
5028
5249
  channel.emit(TELEMETRY_ERROR, prepareForTelemetry(error));
5029
5250
  };
5030
- const freeze = new URLSearchParams(scope.location?.search ?? "").get("freeze") === "finished";
5251
+ const freeze = new URLSearchParams(global.location?.search ?? "").get("freeze") === "finished";
5031
5252
  if (freeze) setInert(true);
5032
5253
  /**
5033
5254
  * Ensure we synchronise the preview runtime's inert state with the manager's. The inert attribute
@@ -5044,15 +5265,15 @@ function setup() {
5044
5265
  setInert(freeze || isInert);
5045
5266
  });
5046
5267
  });
5047
- scope.addEventListener("error", errorListener);
5048
- scope.addEventListener("unhandledrejection", unhandledRejectionListener);
5268
+ global.addEventListener("error", errorListener);
5269
+ global.addEventListener("unhandledrejection", unhandledRejectionListener);
5049
5270
  maybeSetupPreviewNavigator();
5050
5271
  }
5051
5272
  function init_runtime$1() {
5052
5273
  return (init_runtime$1 = __esmMin((() => {
5053
5274
  init_channels();
5054
5275
  init_core_events();
5055
- init_dist();
5276
+ init_global();
5056
5277
  init_globals();
5057
5278
  init_runtime();
5058
5279
  init_preview_navigator();