@aussieljk/forkbook 0.0.1-2 → 0.0.1-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +35 -53
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
- package/assets/browser/favicon-wrapper.svg +4 -4
- package/assets/browser/favicon.svg +1 -1
- package/assets/browser/inter-LICENSE.txt +92 -0
- package/assets/browser/inter-variable-italic.woff2 +0 -0
- package/assets/browser/inter-variable.woff2 +0 -0
- package/assets/browser/mirror-ball.png +0 -0
- package/assets/builder-vite/iframe.html +8 -24
- package/assets/create/rendererAssets/common/Configure.mdx +100 -100
- package/assets/create/rendererAssets/common/button.css +7 -7
- package/assets/create/rendererAssets/common/header.css +6 -6
- package/assets/create/rendererAssets/common/page.css +12 -12
- package/assets/create/templates/react-native/index.expo.js +4 -4
- package/assets/create/templates/react-native/index.js +5 -5
- package/assets/server/base-preview-body.html +32 -32
- package/assets/server/base-preview-head.html +86 -86
- package/assets/server/template.ejs +31 -26
- package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-KALNKPOV.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-66AWY4VQ.js +199 -0
- package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/chunk-4ZGQ4YQ2.js +20 -0
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
- package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-CX37N6FG.js} +770 -720
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
- package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
- package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
- package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
- package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
- package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
- package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
- package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
- package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-OWWV6YG7.js} +12 -12
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
- package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
- package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
- package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-TRXLBGLS.js} +344 -166
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
- package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
- package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-YD6HKC4B.js} +33 -31
- package/dist/_node-chunks/builder-manager-UNJGYVTD.js +1176 -0
- package/dist/_node-chunks/chunk-25A7444H.js +47 -0
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-2CNN3CRI.js} +506 -494
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-2GA4VQCS.js} +9 -9
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-2VJHCGAK.js} +368 -321
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-33I6AQU7.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-3CQI3JH5.js} +6 -6
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-3ZOSFS7G.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-4BE3LRIQ.js} +86 -67
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-5LFJQCYN.js} +6 -6
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-65X3MXFT.js} +8 -8
- package/dist/_node-chunks/chunk-6FWJWEAG.js +52 -0
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-6NLQCV6A.js} +7 -7
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-6OQKMJJA.js} +474 -479
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-6RYD6ENB.js} +7 -7
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-75TTPKEA.js} +283 -306
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-7CWDZLIZ.js} +6 -6
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-7M3TOE4F.js} +6 -6
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-AGLGQNTY.js} +6 -6
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-AOYLA323.js} +9 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-AP4HJ3I3.js} +7 -7
- package/dist/_node-chunks/chunk-AVHJZUTH.js +2613 -0
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-B2EEX2SZ.js} +6 -6
- package/dist/_node-chunks/chunk-CGVVOUBC.js +18 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-CJDYU653.js} +6 -6
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-CPDP5SQS.js} +14 -16
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-DAYTIH6Z.js} +10 -10
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-DO3CPQAZ.js} +6 -6
- package/dist/_node-chunks/chunk-DQEUNKLX.js +347 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-EFCBUWOB.js} +7 -7
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-EG2WLN5V.js} +7 -7
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-EKYNX5NX.js} +9 -9
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-F762PHMI.js} +6 -6
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-FC3V4KZO.js} +14 -13
- package/dist/_node-chunks/chunk-FXW52X4U.js +281 -0
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-GEJBTN76.js} +62 -7
- package/dist/_node-chunks/chunk-GFEH7IBP.js +620 -0
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-GWT4HQZU.js} +6 -6
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-HHM5X5RQ.js} +140 -118
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-IBLUURAJ.js} +25 -8
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-IENHXJVB.js} +7 -7
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-IIGBIVK3.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-J6FGP2VM.js} +7 -7
- package/dist/_node-chunks/chunk-JOX7OETB.js +534 -0
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-JR7ZCQ77.js} +21 -25
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-JXZONVHW.js} +37 -31
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-KAALBGRE.js} +6 -6
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-L52VGA36.js} +34 -949
- package/dist/_node-chunks/chunk-LAJIVWUF.js +497 -0
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-LCNF6BLP.js} +7 -7
- package/dist/_node-chunks/chunk-LGHTKFSF.js +405 -0
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-LNGSV5UI.js} +7 -7
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-MC4BFUVH.js} +6 -6
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-MWKSSYPG.js} +8 -8
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-N25CZ3RC.js} +650 -9
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-N4LNGTYL.js} +7 -7
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-N5WU4BEY.js} +6 -6
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-NRXCMSAI.js} +6 -6
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-NZWK62R5.js} +542 -1049
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-OBPVOYJA.js} +7 -7
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-OMMQME7G.js} +33 -41
- package/dist/_node-chunks/chunk-PJRPETSU.js +62 -0
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-QDVIQG3B.js} +6 -6
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-QEYWG5C7.js} +6 -6
- package/dist/_node-chunks/{chunk-GRBLDJCR.js → chunk-QQNRWEHL.js} +132 -149
- package/dist/_node-chunks/{chunk-EHUNOMDD.js → chunk-RAIWLNFA.js} +29849 -51588
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-S7RGKBGT.js} +6 -6
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-SFXFL4TP.js} +8 -8
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-SPAHK37C.js} +6 -6
- package/dist/_node-chunks/chunk-SUQ4OM7Y.js +49 -0
- package/dist/_node-chunks/chunk-U54Q3F7E.js +20 -0
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-UZH2V3WY.js} +8 -8
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-VIMGLCNZ.js} +6 -6
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-VNZF62KE.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-VPFU5CEP.js} +10 -10
- package/dist/_node-chunks/{chunk-RZMQ7S3L.js → chunk-VYCVBW5Q.js} +8 -8
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-WDANLGYN.js} +7 -7
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-WMZJ2WK4.js} +96 -177
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-WTPHQ2NG.js} +8 -8
- package/dist/_node-chunks/chunk-WYCITRIE.js +11 -0
- package/dist/_node-chunks/chunk-WYRBOMQF.js +137 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-WZBMPROH.js} +9 -17
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-X2GGQZIN.js} +6 -6
- package/dist/_node-chunks/chunk-X6OGIC2G.js +28 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-XF7H5GZM.js} +52 -22
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-XUZB4FIX.js} +15 -9
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-XVSUIOZA.js} +7 -7
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-Z665R6AF.js} +75 -75
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-ZEYZWDOS.js} +6 -6
- package/dist/_node-chunks/{chunk-UBOGWBEA.js → chunk-ZHRCL7PG.js} +10 -10
- package/dist/_node-chunks/chunk-ZLC4JSBV.js +25 -0
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-ZN6YOIB2.js} +8 -8
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-ZX32M4O7.js} +7 -7
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-ZZ5XMIGW.js} +97 -111
- package/dist/_node-chunks/dist-HBFOS25E.js +16 -0
- package/dist/_node-chunks/dist-Q2XNFC24.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-4ETW6QTI.js} +19 -20
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-OOYTYMVU.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-3AWUYNFD.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-ORY3BAP5.js} +12 -12
- package/dist/_node-chunks/optimized-tests-DOKSUJAM.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-AY4DE7ME.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-L46G75CD.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-FGVC633L.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-2AZLMC5G.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-QI3YR6CU.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-QJJ4FOF3.js} +281 -19
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-WFJZYNZN.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-V5CRAJMV.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-LECBBF3L.js} +9 -9
- package/dist/actions/decorator.js +18 -22
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +3 -2
- package/dist/addon-a11y/manager.js +41 -38
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.d.ts +8 -2
- package/dist/addon-a11y/preview.js +3 -2
- package/dist/addon-comments/manager.js +353 -0
- package/dist/addon-comments/preset.js +52 -0
- package/dist/addon-comments/preview.js +101 -0
- package/dist/addon-docs/blocks.d.ts +123 -85
- package/dist/addon-docs/blocks.js +159 -85
- package/dist/addon-docs/index.d.ts +21 -21
- package/dist/addon-docs/index.js +3 -3
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +12 -12
- package/dist/addon-docs/preview.d.ts +3 -1
- package/dist/addon-docs/preview.js +1 -1
- package/dist/addon-links/index.d.ts +2 -1
- package/dist/addon-links/index.js +5 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +5 -2
- package/dist/addon-links/react/index.js +4 -1
- package/dist/addon-mcp/preset.js +176 -57
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +70 -70
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-ondevice-controls/index.js +1 -1
- package/dist/addon-ondevice-controls/register.js +1 -1
- package/dist/addon-pseudo-states/index.d.ts +1 -1
- package/dist/addon-pseudo-states/index.js +1 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-pseudo-states/preview.js +1 -1
- package/dist/addon-themes/index.d.ts +7 -6
- package/dist/addon-themes/index.js +2 -2
- package/dist/addon-themes/manager.js +4 -4
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-themes/preview.js +2 -2
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +32 -23
- package/dist/addon-vitest/node/coverage-reporter.js +11 -11
- package/dist/addon-vitest/node/vitest.js +35 -35
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +22 -22
- package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
- package/dist/addon-vitest/vitest-plugin/index.js +78 -68
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.d.ts +241 -995
- package/dist/babel/index.js +13 -19
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +118 -95
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +201 -0
- package/dist/builder-vite/index.d.ts +8 -3
- package/dist/builder-vite/index.js +80 -25
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +97 -24
- package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
- package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-BsO65uOb.d.ts} +4 -4
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
- package/dist/chunk-CDMZhRke.d.ts +30 -0
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-D2CQlXaR.d.ts} +13 -15
- package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
- package/dist/chunk-DVIvUVkS.d.ts +195 -0
- package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
- package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
- package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-OksNJcvJ.d.ts} +2 -2
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-ge-rSPy0.d.ts} +818 -701
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +14 -867
- package/dist/cli/index.js +47 -4962
- package/dist/cli/skills/content/index.d.ts +2 -2
- package/dist/cli/skills/content/index.js +2 -2
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +3 -3
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.d.ts +20 -21
- package/dist/client-logger/index.js +5 -2
- package/dist/common/index.d.ts +27 -39
- package/dist/common/index.js +35 -42
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +6 -4
- package/dist/core-events/index.js +5 -1
- package/dist/core-server/index.d.ts +58 -17
- package/dist/core-server/index.js +1500 -382
- package/dist/core-server/presets/common-manager.js +836 -1334
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +100 -282
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/csf-utils.d.ts +1 -1
- package/dist/csf/index.d.ts +6 -6
- package/dist/csf/index.js +86 -154
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +18 -16
- package/dist/docs-tools/index.d.ts +332 -16
- package/dist/docs-tools/index.js +3 -3
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.d.ts +5 -5
- package/dist/instrumenter/index.js +31 -19
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
- package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
- package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-BDkYPr00.js} +715 -620
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BnWjPJUH.js} +2 -2
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-Bv2PBsx6.js} +411 -379
- package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
- package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-D6tkG2NO.js} +1033 -621
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-D9zzVzSP.js} +11 -11
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DafcXCKU.js} +1013 -778
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
- package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
- package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-BhfRBP4G.js +294 -0
- package/dist/manager/_manager-chunks/runtime-BuPcYKCO.js +737 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-CGaGp83p.js} +57 -76
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-CXROgt6G.js} +220 -406
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-Cn5PJT3-.js} +741 -698
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-DJlTd1qE.js} +1717 -1536
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DTUm5K9J.js} +232 -158
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-Dc6lf19c.js} +8 -534
- package/dist/manager/_manager-chunks/runtime-DmpQacrn.js +553 -0
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/runtime-mjv_40eH.js +201 -0
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +537 -527
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mocking-utils/index.d.ts +7 -5
- package/dist/mocking-utils/index.js +34 -34
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/next/index.d.ts +231 -0
- package/dist/next/index.js +398 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
- package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
- package/dist/nextjs-vite/index.d.ts +4 -4
- package/dist/nextjs-vite/index.js +10 -5
- package/dist/nextjs-vite/node/index.d.ts +2 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +117 -15
- package/dist/nextjs-vite/preview.d.ts +2 -1
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
- package/dist/nextjs-vite/vite-plugin/index.js +9 -9
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +24 -49
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
- package/dist/node-logger/index.d.ts +83 -90
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +15 -14
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-BiYuZt-X.js} +392 -173
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-C88AzFBv.js} +772 -418
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-Cpzxe5eK.js} +447 -151
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-MYVHRAoo.js} +3 -3
- package/dist/preview/globals.d.ts +10 -10
- package/dist/preview/globals.js +10 -10
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +3 -3
- package/dist/preview-api/index.js +12 -10
- package/dist/preview-errors.d.ts +1 -1
- package/dist/preview-errors.js +2 -2
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview-argtypes.js +1 -1
- package/dist/react/entry-preview-docs.js +1 -1
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.d.ts +9 -11
- package/dist/react/index.js +8 -6
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +5 -4
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +48 -47
- package/dist/react-native/index.js +64 -249
- package/dist/react-native/metro/node.d.ts +3 -3
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
- package/dist/react-native/preview.js +4 -1
- package/dist/react-native/scripts/generate.d.ts +1 -1
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-native/stub.js +1 -1
- package/dist/react-native-theming/index.d.ts +2 -58
- package/dist/react-native-theming/index.js +63 -2338
- package/dist/react-native-ui/index.d.ts +14 -14
- package/dist/react-native-ui/index.js +8 -15
- package/dist/react-native-ui-common/index.d.ts +32 -12
- package/dist/react-native-ui-common/index.js +26 -31
- package/dist/react-vite/index.d.ts +2 -2
- package/dist/react-vite/node/index.d.ts +3 -3
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.d.ts +3 -1
- package/dist/react-vite/preset.js +16 -9
- package/dist/router/index.d.ts +80 -3
- package/dist/router/index.js +66 -12
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +3 -3
- package/dist/shared/open-service/index.js +2 -2
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
- package/dist/telemetry/index.d.ts +38 -274
- package/dist/telemetry/index.js +11 -68
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +765 -511
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +6 -6
- package/dist/theming/index.js +41 -16
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +5 -5
- package/dist/viewport/index.d.ts +1 -1
- package/package.json +69 -69
- package/skills/setup/SKILL.md +14 -0
- package/skills/stories/SKILL.md +21 -0
- package/skills/write-story/SKILL.md +14 -0
- package/template/nextjs-vite/cli/js/Button.jsx +2 -2
- package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
- package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
- package/template/nextjs-vite/cli/js/Header.jsx +1 -1
- package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +3 -3
- package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
- package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
- package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
- package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
- package/template/react/cli/js/Button.jsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.jsx +1 -1
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +3 -3
- package/template/react/cli/js/Page.stories.js +2 -2
- package/template/react/cli/ts/Button.stories.ts +6 -6
- package/template/react/cli/ts/Button.tsx +2 -2
- package/template/react/cli/ts/Header.stories.ts +2 -2
- package/template/react/cli/ts/Header.tsx +1 -1
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +3 -3
- package/template/react-vite/cli/js/Button.jsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.jsx +1 -1
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +3 -3
- package/template/react-vite/cli/js/Page.stories.js +2 -2
- package/template/react-vite/cli/ts/Button.stories.ts +6 -6
- package/template/react-vite/cli/ts/Button.tsx +2 -2
- package/template/react-vite/cli/ts/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Header.tsx +1 -1
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +3 -3
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
- package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
- package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
- package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
- package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
- package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
- package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
- package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
- package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
- package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
- package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
- package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
- package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
- package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
- package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
- package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
- package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
- package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
- package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
- package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
- package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
- package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
- package/dist/chunk-BTVrWliM.d.ts +0 -115
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- package/dist/chunk-DaVb55-_.d.ts +0 -124
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +0 -387
|
@@ -1,9 +1,61 @@
|
|
|
1
|
-
import { n as __esmMin } from "./runtime-BdGkqNEt.js";
|
|
2
|
-
import { A as variant, C as pipe, D as string, E as safeParse, J as isEqual, M as init_index_browser, N as nanoid, O as undefined_, S as optional, T as safeInteger, _ as looseObject, b as number, c as slash, d as l, f as array, g as literal, h as init_dist, j as void_, k as unknown, l as g,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
1
|
+
import { n as __esmMin, r as __exportAll } from "./runtime-BdGkqNEt.js";
|
|
2
|
+
import { A as variant, B as T, C as pipe, D as string, E as safeParse, J as isEqual, M as init_index_browser, N as nanoid, O as undefined_, S as optional, T as safeInteger, V as init_dist, _ as looseObject, b as number, c as slash, ct as init_esm, d as l, f as array, g as literal, h as init_dist$1, j as void_, k as unknown, l as g, m as custom, p as check, q as init_isEqual, st as dedent, u as init_deepsignal_core_module, v as minLength, w as record, x as object, y as minValue } from "./runtime-Bvh_rfnQ.js";
|
|
3
|
+
import { A as OpenServiceAsyncRecipeError, B as OpenServiceRemoteCommandDisconnectedError, Bt as init_client_logger, F as OpenServiceLoadedDrainExceededError, Gt as UniversalStoreFollowerTimeoutError, H as OpenServiceUnimplementedOperationError, Ht as once, I as OpenServiceMissingChannelError, Kt as init_manager_errors, L as OpenServiceMissingServiceError, M as OpenServiceCyclicStateError, N as OpenServiceInternalServiceError, P as OpenServiceInvalidStaticPathError, R as OpenServiceOperationNameCollisionError, U as OpenServiceValidationError, Ut as OpenServiceStaticSnapshotInvalidError, V as OpenServiceRemoteCommandUnhandledError, Vt as logger, W as init_open_service, Wt as OpenServiceStaticSnapshotLoadError, X as init_channel_slot, Y as getChannel, _ as instrument, f as init_storyDocsCodePanel, g as init_instrumenter, j as OpenServiceAsyncSchemaError, p as shouldSkipStoryDocsEmit, r as definePreviewAddon, z as OpenServiceRemoteCommandConfigDriftError } from "./runtime-Cpzxe5eK.js";
|
|
4
|
+
import { i as emitTransformCode, r as init_preview_api } from "./runtime-BiYuZt-X.js";
|
|
5
|
+
import { a as customMatchers, c as setState, d as isMockFunction, f as mocks, i as JestExtend, l as fn$1, n as JestAsymmetricMatchers, o as getState, p as spyOn$1, r as JestChaiExpect, s as init_dist$2, t as GLOBAL_EXPECT, u as init_dist$3 } from "./runtime-D2MPrqbU.js";
|
|
6
|
+
import { a as Assertion, c as init_chai, l as use, o as assert, s as expect$2, u as utils_exports } from "./runtime-DS0s7U3c.js";
|
|
7
|
+
import { c as init_esm$1, d as dom_esm_exports, f as init_dom_esm, i as j, m as matchers_exports, n as g$1, o as n, p as init_matchers, r as init_signals_core_module, s as y, t as f, u as userEvent$1 } from "./runtime-BYRCSYBN.js";
|
|
8
|
+
//#region src/storybook-error.ts
|
|
9
|
+
function parseErrorCode({ code, category }) {
|
|
10
|
+
return `FB_${category}_${String(code).padStart(4, "0")}`;
|
|
11
|
+
}
|
|
12
|
+
var StorybookError;
|
|
13
|
+
function init_storybook_error() {
|
|
14
|
+
return (init_storybook_error = __esmMin((() => {
|
|
15
|
+
StorybookError = class StorybookError extends Error {
|
|
16
|
+
get fullErrorCode() {
|
|
17
|
+
return parseErrorCode({
|
|
18
|
+
code: this.code,
|
|
19
|
+
category: this.category
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** Overrides the default `Error.name` property in the format: FB_<CATEGORY>_<CODE>. */
|
|
23
|
+
get name() {
|
|
24
|
+
const errorName = this._name || this.constructor.name;
|
|
25
|
+
return `${this.fullErrorCode} (${errorName})`;
|
|
26
|
+
}
|
|
27
|
+
set name(name) {
|
|
28
|
+
this._name = name;
|
|
29
|
+
}
|
|
30
|
+
constructor(props) {
|
|
31
|
+
super(StorybookError.getFullMessage(props), props.cause === void 0 ? void 0 : { cause: props.cause });
|
|
32
|
+
this.data = {};
|
|
33
|
+
this.fromStorybook = true;
|
|
34
|
+
this.isHandledError = false;
|
|
35
|
+
this.subErrors = [];
|
|
36
|
+
this.category = props.category;
|
|
37
|
+
this.documentation = props.documentation ?? false;
|
|
38
|
+
this.code = props.code;
|
|
39
|
+
this.isHandledError = props.isHandledError ?? false;
|
|
40
|
+
this.agentFacing = props.agentFacing ?? false;
|
|
41
|
+
this.name = props.name;
|
|
42
|
+
this.subErrors = props.subErrors ?? [];
|
|
43
|
+
}
|
|
44
|
+
/** Generates the error message along with additional documentation link (if applicable). */
|
|
45
|
+
static getFullMessage({ documentation, code, category, message }) {
|
|
46
|
+
let page;
|
|
47
|
+
if (documentation === true) page = `https://forkbook.ljk.dev/error/${parseErrorCode({
|
|
48
|
+
code,
|
|
49
|
+
category
|
|
50
|
+
})}`;
|
|
51
|
+
else if (typeof documentation === "string") page = documentation;
|
|
52
|
+
else if (Array.isArray(documentation)) page = `\n${documentation.map((doc) => `\t- ${doc}`).join("\n")}`;
|
|
53
|
+
return `${message}${page != null ? `\n\nMore info: ${page}\n` : ""}`;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
})))();
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
7
59
|
//#region src/shared/universal-store/first-party-store-ids.ts
|
|
8
60
|
var FIRST_PARTY_STORE_IDS, isFirstPartyStoreId;
|
|
9
61
|
function init_first_party_store_ids() {
|
|
@@ -26,6 +78,13 @@ function init_instances() {
|
|
|
26
78
|
}
|
|
27
79
|
//#endregion
|
|
28
80
|
//#region src/shared/universal-store/index.ts
|
|
81
|
+
/**
|
|
82
|
+
* Whether `event` has the type `type`. A custom event's `type` is any string, so a `switch` on
|
|
83
|
+
* `event.type` cannot narrow an event union to one payload, but this check can.
|
|
84
|
+
*/
|
|
85
|
+
function hasType(event, type) {
|
|
86
|
+
return event.type === type;
|
|
87
|
+
}
|
|
29
88
|
var CHANNEL_EVENT_PREFIX, ProgressState, UniversalStore;
|
|
30
89
|
function init_universal_store() {
|
|
31
90
|
return (init_universal_store = __esmMin((() => {
|
|
@@ -305,8 +364,8 @@ function init_universal_store() {
|
|
|
305
364
|
*/
|
|
306
365
|
onStateChange(listener) {
|
|
307
366
|
this.debug("onStateChange", { listener });
|
|
308
|
-
return this.subscribe(UniversalStore.InternalEventType.SET_STATE, (
|
|
309
|
-
listener(payload.state, payload.previousState, eventInfo);
|
|
367
|
+
return this.subscribe(UniversalStore.InternalEventType.SET_STATE, (event, eventInfo) => {
|
|
368
|
+
if (hasType(event, UniversalStore.InternalEventType.SET_STATE)) listener(event.payload.state, event.payload.previousState, eventInfo);
|
|
310
369
|
});
|
|
311
370
|
}
|
|
312
371
|
emitToChannel(event, eventInfo) {
|
|
@@ -389,10 +448,9 @@ function init_universal_store() {
|
|
|
389
448
|
});
|
|
390
449
|
}
|
|
391
450
|
}
|
|
392
|
-
if (this.actor.type === UniversalStore.ActorType.FOLLOWER
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (this.syncing?.state !== ProgressState.PENDING) break;
|
|
451
|
+
if (this.actor.type === UniversalStore.ActorType.FOLLOWER && hasType(event, UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE)) {
|
|
452
|
+
this.debug("handleChannelEvents: Setting state from leader's existing state response", { event });
|
|
453
|
+
if (this.syncing?.state === ProgressState.PENDING) {
|
|
396
454
|
this.syncing.resolve?.();
|
|
397
455
|
const setStateEvent = {
|
|
398
456
|
type: UniversalStore.InternalEventType.SET_STATE,
|
|
@@ -403,11 +461,11 @@ function init_universal_store() {
|
|
|
403
461
|
};
|
|
404
462
|
this.state = event.payload;
|
|
405
463
|
this.emitToListeners(setStateEvent, eventInfo);
|
|
464
|
+
}
|
|
406
465
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
this.state = event.payload.state;
|
|
466
|
+
if (hasType(event, UniversalStore.InternalEventType.SET_STATE)) {
|
|
467
|
+
this.debug("handleChannelEvents: Setting state", { event });
|
|
468
|
+
this.state = event.payload.state;
|
|
411
469
|
}
|
|
412
470
|
this.emitToListeners(event, { actor: eventInfo.actor });
|
|
413
471
|
}
|
|
@@ -434,6 +492,15 @@ function init_universal_store() {
|
|
|
434
492
|
})))();
|
|
435
493
|
}
|
|
436
494
|
//#endregion
|
|
495
|
+
//#region src/shared/global.ts
|
|
496
|
+
var global_exports = /* @__PURE__ */ __exportAll({ global: () => global });
|
|
497
|
+
var global;
|
|
498
|
+
function init_global() {
|
|
499
|
+
return (init_global = __esmMin((() => {
|
|
500
|
+
global = globalThis;
|
|
501
|
+
})))();
|
|
502
|
+
}
|
|
503
|
+
//#endregion
|
|
437
504
|
//#region src/shared/utils/local-hosts.ts
|
|
438
505
|
var LOOPBACK_HOSTNAMES, matchesHostname;
|
|
439
506
|
function init_local_hosts() {
|
|
@@ -471,165 +538,8 @@ function formatIssues(issues) {
|
|
|
471
538
|
return path === "" ? issue.message : `${path}: ${issue.message}`;
|
|
472
539
|
}).join("\n");
|
|
473
540
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
var OpenServiceValidationError, OpenServiceMissingServiceError, OpenServiceInternalServiceError, OpenServiceUnimplementedOperationError, OpenServiceInvalidStaticPathError, OpenServiceAsyncSchemaError, OpenServiceLoadedDrainExceededError, OpenServiceMissingChannelError, OpenServiceRemoteCommandDisconnectedError, OpenServiceRemoteCommandUnhandledError, OpenServiceRemoteCommandConfigDriftError, OpenServiceAsyncRecipeError, OpenServiceCyclicStateError, OpenServiceOperationNameCollisionError;
|
|
477
|
-
function init_server_errors() {
|
|
478
|
-
return (init_server_errors = __esmMin((() => {
|
|
479
|
-
init_storybook_error();
|
|
480
|
-
OpenServiceValidationError = class extends StorybookError {
|
|
481
|
-
constructor(data) {
|
|
482
|
-
super({
|
|
483
|
-
name: "OpenServiceValidationError",
|
|
484
|
-
category: "CORE-COMMON",
|
|
485
|
-
code: 5,
|
|
486
|
-
message: `Invalid ${data.phase} for ${data.kind} "${data.serviceId}.${data.name}":\n${formatIssues(data.issues)}`
|
|
487
|
-
});
|
|
488
|
-
this.data = data;
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
OpenServiceMissingServiceError = class extends StorybookError {
|
|
492
|
-
constructor(data) {
|
|
493
|
-
super({
|
|
494
|
-
name: "OpenServiceMissingServiceError",
|
|
495
|
-
category: "CORE-COMMON",
|
|
496
|
-
code: 7,
|
|
497
|
-
message: `No registered service with id "${data.serviceId}" exists in this environment.`
|
|
498
|
-
});
|
|
499
|
-
this.data = data;
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
OpenServiceInternalServiceError = class extends StorybookError {
|
|
503
|
-
constructor(data) {
|
|
504
|
-
super({
|
|
505
|
-
name: "OpenServiceInternalServiceError",
|
|
506
|
-
category: "CORE-COMMON",
|
|
507
|
-
code: 19,
|
|
508
|
-
message: `Service "${data.serviceId}" is internal. Pass { internal: true } to getService() only if you intentionally depend on an unstable OSA surface. Internal services may change without notice.`
|
|
509
|
-
});
|
|
510
|
-
this.data = data;
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
OpenServiceUnimplementedOperationError = class extends StorybookError {
|
|
514
|
-
constructor(data) {
|
|
515
|
-
super({
|
|
516
|
-
name: "OpenServiceUnimplementedOperationError",
|
|
517
|
-
category: "CORE-COMMON",
|
|
518
|
-
code: 8,
|
|
519
|
-
message: `${data.kind[0].toUpperCase()}${data.kind.slice(1)} "${data.serviceId}.${data.name}" is not implemented for this environment.`
|
|
520
|
-
});
|
|
521
|
-
this.data = data;
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
OpenServiceInvalidStaticPathError = class extends StorybookError {
|
|
525
|
-
constructor(data) {
|
|
526
|
-
super({
|
|
527
|
-
name: "OpenServiceInvalidStaticPathError",
|
|
528
|
-
category: "CORE-COMMON",
|
|
529
|
-
code: 10,
|
|
530
|
-
message: `Invalid static path "${data.path}" for query "${data.serviceId}.${data.name}": use a relative path with forward slashes and no ".." segments.`
|
|
531
|
-
});
|
|
532
|
-
this.data = data;
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
OpenServiceAsyncSchemaError = class extends StorybookError {
|
|
536
|
-
constructor(data) {
|
|
537
|
-
super({
|
|
538
|
-
name: "OpenServiceAsyncSchemaError",
|
|
539
|
-
category: "CORE-COMMON",
|
|
540
|
-
code: 9,
|
|
541
|
-
message: `Async schema for ${data.kind} "${data.serviceId}.${data.name}" (${data.phase}): query input and output schemas must validate synchronously.`
|
|
542
|
-
});
|
|
543
|
-
this.data = data;
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
OpenServiceLoadedDrainExceededError = class extends StorybookError {
|
|
547
|
-
constructor(data) {
|
|
548
|
-
super({
|
|
549
|
-
name: "OpenServiceLoadedDrainExceededError",
|
|
550
|
-
category: "CORE-COMMON",
|
|
551
|
-
code: 11,
|
|
552
|
-
message: `Query "${data.serviceId}.${data.name}".loaded(...) did not settle after ${data.iterations} drain iterations. Check for handlers that keep discovering new dependencies after every state change.`
|
|
553
|
-
});
|
|
554
|
-
this.data = data;
|
|
555
|
-
}
|
|
556
|
-
};
|
|
557
|
-
OpenServiceMissingChannelError = class extends StorybookError {
|
|
558
|
-
constructor(data = {}) {
|
|
559
|
-
super({
|
|
560
|
-
name: "OpenServiceMissingChannelError",
|
|
561
|
-
category: "CORE-COMMON",
|
|
562
|
-
code: 13,
|
|
563
|
-
message: data.serviceId ? `Cannot register service "${data.serviceId}": the Forkbook addons channel is not installed in this runtime.` : "The Forkbook addons channel is not installed in this runtime."
|
|
564
|
-
});
|
|
565
|
-
this.data = data;
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
OpenServiceRemoteCommandDisconnectedError = class extends StorybookError {
|
|
569
|
-
constructor(data) {
|
|
570
|
-
super({
|
|
571
|
-
name: "OpenServiceRemoteCommandDisconnectedError",
|
|
572
|
-
category: "CORE-COMMON",
|
|
573
|
-
code: 14,
|
|
574
|
-
message: `Service "${data.serviceId}" was unregistered before a remote command resolved.`
|
|
575
|
-
});
|
|
576
|
-
this.data = data;
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
OpenServiceRemoteCommandUnhandledError = class extends StorybookError {
|
|
580
|
-
constructor(data) {
|
|
581
|
-
super({
|
|
582
|
-
name: "OpenServiceRemoteCommandUnhandledError",
|
|
583
|
-
category: "CORE-COMMON",
|
|
584
|
-
code: 15,
|
|
585
|
-
message: data.delegated ? `The Forkbook this runtime is attached to did not acknowledge remote command "${data.serviceId}.${data.commandName}" in time — it may be busy or unreachable. Retry; note the command may still have executed on that instance.` : `No runtime acknowledged remote command "${data.serviceId}.${data.commandName}"; its handler is not implemented in any connected runtime.`
|
|
586
|
-
});
|
|
587
|
-
this.data = data;
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
OpenServiceRemoteCommandConfigDriftError = class extends StorybookError {
|
|
591
|
-
constructor(data) {
|
|
592
|
-
super({
|
|
593
|
-
name: "OpenServiceRemoteCommandConfigDriftError",
|
|
594
|
-
category: "CORE-COMMON",
|
|
595
|
-
code: 30,
|
|
596
|
-
message: `The Forkbook this runtime is attached to reported it has no handler for remote command "${data.serviceId}.${data.commandName}". The two processes are running different configurations (for example a feature flag enabled in one but not the other). Restart the attached Forkbook with a configuration matching this process.`
|
|
597
|
-
});
|
|
598
|
-
this.data = data;
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
OpenServiceAsyncRecipeError = class extends StorybookError {
|
|
602
|
-
constructor() {
|
|
603
|
-
super({
|
|
604
|
-
name: "OpenServiceAsyncRecipeError",
|
|
605
|
-
category: "CORE-COMMON",
|
|
606
|
-
code: 31,
|
|
607
|
-
message: "setState recipes must be synchronous. A write after an await would change state without authoring a sync entry. Split the command into one setState per synchronous step."
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
OpenServiceCyclicStateError = class extends StorybookError {
|
|
612
|
-
constructor() {
|
|
613
|
-
super({
|
|
614
|
-
name: "OpenServiceCyclicStateError",
|
|
615
|
-
category: "CORE-COMMON",
|
|
616
|
-
code: 32,
|
|
617
|
-
message: "Service state must be JSON-serializable, but the value is cyclic or nested more than 256 levels deep. Store an id and look the value up in a query instead of a reference."
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
OpenServiceOperationNameCollisionError = class extends StorybookError {
|
|
622
|
-
constructor(data) {
|
|
623
|
-
super({
|
|
624
|
-
name: "OpenServiceOperationNameCollisionError",
|
|
625
|
-
category: "CORE-COMMON",
|
|
626
|
-
code: 16,
|
|
627
|
-
message: `Service "${data.serviceId}" cannot register "${data.operationName}" as both a query and a command.`
|
|
628
|
-
});
|
|
629
|
-
this.data = data;
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
})))();
|
|
541
|
+
function init_errors() {
|
|
542
|
+
return (init_errors = __esmMin((() => {})))();
|
|
633
543
|
}
|
|
634
544
|
//#endregion
|
|
635
545
|
//#region src/shared/status-store/index.ts
|
|
@@ -676,6 +586,296 @@ function init_tags() {
|
|
|
676
586
|
})))();
|
|
677
587
|
}
|
|
678
588
|
//#endregion
|
|
589
|
+
//#region src/test/expect.ts
|
|
590
|
+
function createExpect() {
|
|
591
|
+
use(JestExtend);
|
|
592
|
+
use(JestChaiExpect);
|
|
593
|
+
use(JestAsymmetricMatchers);
|
|
594
|
+
const expect = ((value, message) => {
|
|
595
|
+
const { assertionCalls } = getState(expect);
|
|
596
|
+
setState({
|
|
597
|
+
assertionCalls: assertionCalls + 1,
|
|
598
|
+
soft: false
|
|
599
|
+
}, expect);
|
|
600
|
+
return expect$2(value, message);
|
|
601
|
+
});
|
|
602
|
+
Object.assign(expect, expect$2);
|
|
603
|
+
expect.getState = () => getState(expect);
|
|
604
|
+
expect.setState = (state) => setState(state, expect);
|
|
605
|
+
const chaiExpect = expect$2;
|
|
606
|
+
expect.extend = (expects) => chaiExpect.extend(expect, expects);
|
|
607
|
+
Object.assign(expect, { soft: (value, message) => {
|
|
608
|
+
const assert = expect(value, message);
|
|
609
|
+
expect.setState({ soft: true });
|
|
610
|
+
return assert;
|
|
611
|
+
} });
|
|
612
|
+
expect.extend(customMatchers);
|
|
613
|
+
Object.assign(expect, { unreachable: (message) => {
|
|
614
|
+
assert.fail(`expected${message ? ` "${message}" ` : " "}not to be reached`);
|
|
615
|
+
} });
|
|
616
|
+
function assertions(expected) {
|
|
617
|
+
const errorGen = () => /* @__PURE__ */ new Error(`expected number of assertions to be ${expected}, but got ${expect.getState().assertionCalls}`);
|
|
618
|
+
if ("captureStackTrace" in Error && typeof Error.captureStackTrace === "function") Error.captureStackTrace(errorGen(), assertions);
|
|
619
|
+
expect.setState({
|
|
620
|
+
expectedAssertionsNumber: expected,
|
|
621
|
+
expectedAssertionsNumberErrorGen: errorGen
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
function hasAssertions() {
|
|
625
|
+
const error = /* @__PURE__ */ new Error("expected any number of assertion, but got none");
|
|
626
|
+
if ("captureStackTrace" in Error && typeof Error.captureStackTrace === "function") Error.captureStackTrace(error, hasAssertions);
|
|
627
|
+
expect.setState({
|
|
628
|
+
isExpectingAssertions: true,
|
|
629
|
+
isExpectingAssertionsError: error
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
setState({
|
|
633
|
+
assertionCalls: 0,
|
|
634
|
+
isExpectingAssertions: false,
|
|
635
|
+
isExpectingAssertionsError: null,
|
|
636
|
+
expectedAssertionsNumber: null,
|
|
637
|
+
expectedAssertionsNumberErrorGen: null
|
|
638
|
+
}, expect);
|
|
639
|
+
utils_exports.addMethod(expect, "assertions", assertions);
|
|
640
|
+
utils_exports.addMethod(expect, "hasAssertions", hasAssertions);
|
|
641
|
+
expect.extend(matchers_exports);
|
|
642
|
+
return expect;
|
|
643
|
+
}
|
|
644
|
+
var expect$1;
|
|
645
|
+
function init_expect() {
|
|
646
|
+
return (init_expect = __esmMin((() => {
|
|
647
|
+
init_matchers();
|
|
648
|
+
init_dist$2();
|
|
649
|
+
init_chai();
|
|
650
|
+
expect$1 = createExpect();
|
|
651
|
+
// @vitest/expect expects this to be set
|
|
652
|
+
Object.defineProperty(globalThis, GLOBAL_EXPECT, {
|
|
653
|
+
value: expect$1,
|
|
654
|
+
writable: true,
|
|
655
|
+
configurable: true
|
|
656
|
+
});
|
|
657
|
+
})))();
|
|
658
|
+
}
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/test/spy.ts
|
|
661
|
+
function onMockCall(callback) {
|
|
662
|
+
listeners.add(callback);
|
|
663
|
+
return () => void listeners.delete(callback);
|
|
664
|
+
}
|
|
665
|
+
function fn(implementation) {
|
|
666
|
+
return reactiveMock(implementation ? fn$1(implementation) : fn$1());
|
|
667
|
+
}
|
|
668
|
+
function reactiveMock(mock) {
|
|
669
|
+
const reactive = listenWhenCalled(mock);
|
|
670
|
+
const originalMockImplementation = reactive.mockImplementation.bind(null);
|
|
671
|
+
reactive.mockImplementation = (fn) => listenWhenCalled(originalMockImplementation(fn));
|
|
672
|
+
return reactive;
|
|
673
|
+
}
|
|
674
|
+
function listenWhenCalled(mock) {
|
|
675
|
+
const state = T(mock);
|
|
676
|
+
const impl = state.impl;
|
|
677
|
+
state.willCall(function(...args) {
|
|
678
|
+
listeners.forEach((listener) => listener(mock, args));
|
|
679
|
+
return impl?.apply(this, args);
|
|
680
|
+
});
|
|
681
|
+
return mock;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will
|
|
685
|
+
* only empty `.mock` state, it will not reset implementation.
|
|
686
|
+
*
|
|
687
|
+
* It is useful if you need to clean up mock between different assertions.
|
|
688
|
+
*/
|
|
689
|
+
function clearAllMocks() {
|
|
690
|
+
mocks.forEach((spy) => spy.mockClear());
|
|
691
|
+
moduleMockSpies.forEach((spy) => spy.mockClear());
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function. This will
|
|
695
|
+
* empty `.mock` state, reset "once" implementations and force the base implementation to return
|
|
696
|
+
* `undefined` when invoked.
|
|
697
|
+
*
|
|
698
|
+
* This is useful when you want to completely reset a mock to the default state.
|
|
699
|
+
*/
|
|
700
|
+
function resetAllMocks() {
|
|
701
|
+
mocks.forEach((spy) => spy.mockReset());
|
|
702
|
+
moduleMockSpies.forEach((spy) => spy.mockReset());
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function. This
|
|
706
|
+
* will restore all original implementations.
|
|
707
|
+
*/
|
|
708
|
+
function restoreAllMocks() {
|
|
709
|
+
mocks.forEach((spy) => spy.mockRestore());
|
|
710
|
+
moduleMockSpies.forEach((spy) => spy.mockClear());
|
|
711
|
+
}
|
|
712
|
+
function mocked(item, _options = {}) {
|
|
713
|
+
return item;
|
|
714
|
+
}
|
|
715
|
+
var moduleMockSpies, listeners, spyOn;
|
|
716
|
+
function init_spy() {
|
|
717
|
+
return (init_spy = __esmMin((() => {
|
|
718
|
+
init_dist$3();
|
|
719
|
+
init_dist();
|
|
720
|
+
moduleMockSpies = globalThis.__FORKBOOK_MODULE_MOCK_SPIES__ ??= /* @__PURE__ */ new Set();
|
|
721
|
+
listeners = /* @__PURE__ */ new Set();
|
|
722
|
+
spyOn = ((...args) => {
|
|
723
|
+
return reactiveMock(spyOn$1(...args));
|
|
724
|
+
});
|
|
725
|
+
})))();
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/test/testing-library.ts
|
|
729
|
+
var testingLibrary, buildQueries$1, configure, createEvent, fireEvent, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, prettyDOM, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, waitFor, waitForElementToBeRemoved, within, prettyFormat, uninstrumentedUserEvent, userEvent;
|
|
730
|
+
function init_testing_library() {
|
|
731
|
+
return (init_testing_library = __esmMin((() => {
|
|
732
|
+
init_dom_esm();
|
|
733
|
+
init_esm$1();
|
|
734
|
+
init_client_logger();
|
|
735
|
+
init_instrumenter();
|
|
736
|
+
init_esm();
|
|
737
|
+
testingLibrary = instrument({ ...dom_esm_exports }, {
|
|
738
|
+
getKeys: (obj) => Object.keys(obj).filter((key) => key !== "eventWrapper"),
|
|
739
|
+
intercept: (method, path) => path[0] === "fireEvent" || method.startsWith("find") || method.startsWith("waitFor")
|
|
740
|
+
});
|
|
741
|
+
testingLibrary.screen = new Proxy(testingLibrary.screen, { get(target, prop, receiver) {
|
|
742
|
+
if (typeof window !== "undefined" && globalThis.location?.href?.includes("viewMode=docs")) once.warn(dedent`
|
|
743
|
+
You are using Testing Library's \`screen\` object while the story is rendered in docs mode. This will likely lead to issues, as multiple stories are rendered in the same page and therefore screen will potentially find multiple elements. Use the \`canvas\` utility from the story context instead, which will scope the queries to each story's canvas.
|
|
744
|
+
|
|
745
|
+
More info: https://forkbook.ljk.dev/docs/writing-tests/interaction-testing#querying-the-canvas
|
|
746
|
+
`);
|
|
747
|
+
return Reflect.get(target, prop, receiver);
|
|
748
|
+
} });
|
|
749
|
+
({buildQueries: buildQueries$1, configure, createEvent, fireEvent, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, prettyDOM, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, waitFor, waitForElementToBeRemoved, within, prettyFormat} = testingLibrary);
|
|
750
|
+
uninstrumentedUserEvent = userEvent$1;
|
|
751
|
+
({userEvent} = instrument({ userEvent: userEvent$1 }, {
|
|
752
|
+
intercept: true,
|
|
753
|
+
getKeys: (obj) => Object.keys(obj).filter((key) => key !== "eventWrapper")
|
|
754
|
+
}));
|
|
755
|
+
})))();
|
|
756
|
+
}
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/test/index.ts
|
|
759
|
+
var test_exports = /* @__PURE__ */ __exportAll({
|
|
760
|
+
buildQueries: () => buildQueries$1,
|
|
761
|
+
clearAllMocks: () => clearAllMocks,
|
|
762
|
+
configure: () => configure,
|
|
763
|
+
createEvent: () => createEvent,
|
|
764
|
+
expect: () => expect,
|
|
765
|
+
findAllByAltText: () => findAllByAltText,
|
|
766
|
+
findAllByDisplayValue: () => findAllByDisplayValue,
|
|
767
|
+
findAllByLabelText: () => findAllByLabelText,
|
|
768
|
+
findAllByPlaceholderText: () => findAllByPlaceholderText,
|
|
769
|
+
findAllByRole: () => findAllByRole,
|
|
770
|
+
findAllByTestId: () => findAllByTestId,
|
|
771
|
+
findAllByText: () => findAllByText,
|
|
772
|
+
findAllByTitle: () => findAllByTitle,
|
|
773
|
+
findByAltText: () => findByAltText,
|
|
774
|
+
findByDisplayValue: () => findByDisplayValue,
|
|
775
|
+
findByLabelText: () => findByLabelText,
|
|
776
|
+
findByPlaceholderText: () => findByPlaceholderText,
|
|
777
|
+
findByRole: () => findByRole,
|
|
778
|
+
findByTestId: () => findByTestId,
|
|
779
|
+
findByText: () => findByText,
|
|
780
|
+
findByTitle: () => findByTitle,
|
|
781
|
+
fireEvent: () => fireEvent,
|
|
782
|
+
fn: () => fn,
|
|
783
|
+
getAllByAltText: () => getAllByAltText,
|
|
784
|
+
getAllByDisplayValue: () => getAllByDisplayValue,
|
|
785
|
+
getAllByLabelText: () => getAllByLabelText,
|
|
786
|
+
getAllByPlaceholderText: () => getAllByPlaceholderText,
|
|
787
|
+
getAllByRole: () => getAllByRole,
|
|
788
|
+
getAllByTestId: () => getAllByTestId,
|
|
789
|
+
getAllByText: () => getAllByText,
|
|
790
|
+
getAllByTitle: () => getAllByTitle,
|
|
791
|
+
getByAltText: () => getByAltText,
|
|
792
|
+
getByDisplayValue: () => getByDisplayValue,
|
|
793
|
+
getByLabelText: () => getByLabelText,
|
|
794
|
+
getByPlaceholderText: () => getByPlaceholderText,
|
|
795
|
+
getByRole: () => getByRole,
|
|
796
|
+
getByTestId: () => getByTestId,
|
|
797
|
+
getByText: () => getByText,
|
|
798
|
+
getByTitle: () => getByTitle,
|
|
799
|
+
getConfig: () => getConfig,
|
|
800
|
+
getDefaultNormalizer: () => getDefaultNormalizer,
|
|
801
|
+
getElementError: () => getElementError,
|
|
802
|
+
getNodeText: () => getNodeText,
|
|
803
|
+
getQueriesForElement: () => getQueriesForElement,
|
|
804
|
+
getRoles: () => getRoles,
|
|
805
|
+
getSuggestedQuery: () => getSuggestedQuery,
|
|
806
|
+
isInaccessible: () => isInaccessible,
|
|
807
|
+
isMockFunction: () => isMockFunction,
|
|
808
|
+
logDOM: () => logDOM,
|
|
809
|
+
logRoles: () => logRoles,
|
|
810
|
+
mocked: () => mocked,
|
|
811
|
+
mocks: () => mocks,
|
|
812
|
+
onMockCall: () => onMockCall,
|
|
813
|
+
prettyDOM: () => prettyDOM,
|
|
814
|
+
prettyFormat: () => prettyFormat,
|
|
815
|
+
queries: () => queries,
|
|
816
|
+
queryAllByAltText: () => queryAllByAltText,
|
|
817
|
+
queryAllByAttribute: () => queryAllByAttribute,
|
|
818
|
+
queryAllByDisplayValue: () => queryAllByDisplayValue,
|
|
819
|
+
queryAllByLabelText: () => queryAllByLabelText,
|
|
820
|
+
queryAllByPlaceholderText: () => queryAllByPlaceholderText,
|
|
821
|
+
queryAllByRole: () => queryAllByRole,
|
|
822
|
+
queryAllByTestId: () => queryAllByTestId,
|
|
823
|
+
queryAllByText: () => queryAllByText,
|
|
824
|
+
queryAllByTitle: () => queryAllByTitle,
|
|
825
|
+
queryByAltText: () => queryByAltText,
|
|
826
|
+
queryByAttribute: () => queryByAttribute,
|
|
827
|
+
queryByDisplayValue: () => queryByDisplayValue,
|
|
828
|
+
queryByLabelText: () => queryByLabelText,
|
|
829
|
+
queryByPlaceholderText: () => queryByPlaceholderText,
|
|
830
|
+
queryByRole: () => queryByRole,
|
|
831
|
+
queryByTestId: () => queryByTestId,
|
|
832
|
+
queryByText: () => queryByText,
|
|
833
|
+
queryByTitle: () => queryByTitle,
|
|
834
|
+
queryHelpers: () => queryHelpers,
|
|
835
|
+
resetAllMocks: () => resetAllMocks,
|
|
836
|
+
restoreAllMocks: () => restoreAllMocks,
|
|
837
|
+
sb: () => sb,
|
|
838
|
+
screen: () => screen,
|
|
839
|
+
spyOn: () => spyOn,
|
|
840
|
+
uninstrumentedUserEvent: () => uninstrumentedUserEvent,
|
|
841
|
+
userEvent: () => userEvent,
|
|
842
|
+
waitFor: () => waitFor,
|
|
843
|
+
waitForElementToBeRemoved: () => waitForElementToBeRemoved,
|
|
844
|
+
within: () => within
|
|
845
|
+
});
|
|
846
|
+
function getChaiAssertionKeys(obj, depth) {
|
|
847
|
+
return [...Object.keys(Object.getPrototypeOf(obj)).filter((key) => !chaiAssertionPrivateApi.includes(key)), ...["not"].slice(depth / 3)];
|
|
848
|
+
}
|
|
849
|
+
function getObjectKeys(obj) {
|
|
850
|
+
return Object.keys(obj).filter((key) => key !== "any");
|
|
851
|
+
}
|
|
852
|
+
function getKeys(obj, depth) {
|
|
853
|
+
if ("constructor" in obj && obj.constructor === Assertion) return getChaiAssertionKeys(obj, depth);
|
|
854
|
+
return getObjectKeys(obj);
|
|
855
|
+
}
|
|
856
|
+
var chaiAssertionPrivateApi, expect, sb;
|
|
857
|
+
function init_test() {
|
|
858
|
+
return (init_test = __esmMin((() => {
|
|
859
|
+
init_instrumenter();
|
|
860
|
+
init_chai();
|
|
861
|
+
init_expect();
|
|
862
|
+
init_spy();
|
|
863
|
+
init_testing_library();
|
|
864
|
+
chaiAssertionPrivateApi = [
|
|
865
|
+
"assert",
|
|
866
|
+
"__methods",
|
|
867
|
+
"__flags",
|
|
868
|
+
"_obj"
|
|
869
|
+
];
|
|
870
|
+
({expect} = instrument({ expect: expect$1 }, {
|
|
871
|
+
getKeys,
|
|
872
|
+
mutate: true,
|
|
873
|
+
intercept: (method) => method !== "expect"
|
|
874
|
+
}));
|
|
875
|
+
sb = { mock: () => {} };
|
|
876
|
+
})))();
|
|
877
|
+
}
|
|
878
|
+
//#endregion
|
|
679
879
|
//#region src/shared/open-service/plain-object.ts
|
|
680
880
|
function isReservedKey(key) {
|
|
681
881
|
return FORBIDDEN_KEYS.has(key) || key.startsWith("$");
|
|
@@ -719,7 +919,7 @@ function clonePlain(value, depth = 0) {
|
|
|
719
919
|
var FORBIDDEN_KEYS, MAX_DEPTH;
|
|
720
920
|
function init_plain_object() {
|
|
721
921
|
return (init_plain_object = __esmMin((() => {
|
|
722
|
-
|
|
922
|
+
init_open_service();
|
|
723
923
|
FORBIDDEN_KEYS = /* @__PURE__ */ new Set([
|
|
724
924
|
"__proto__",
|
|
725
925
|
"constructor",
|
|
@@ -769,7 +969,7 @@ var SERVICE_SYNC_REQUEST, SERVICE_SYNC_REPLY, SERVICE_ENTRY, SERVICE_COMMAND_INV
|
|
|
769
969
|
function init_service_channel() {
|
|
770
970
|
return (init_service_channel = __esmMin((() => {
|
|
771
971
|
init_index_browser();
|
|
772
|
-
init_dist();
|
|
972
|
+
init_dist$1();
|
|
773
973
|
init_plain_object();
|
|
774
974
|
SERVICE_SYNC_REQUEST = "services:sync-request";
|
|
775
975
|
SERVICE_SYNC_REPLY = "services:sync-reply";
|
|
@@ -1100,49 +1300,13 @@ function init_patch_recorder() {
|
|
|
1100
1300
|
return (init_patch_recorder = __esmMin((() => {
|
|
1101
1301
|
init_signals_core_module();
|
|
1102
1302
|
init_deepsignal_core_module();
|
|
1103
|
-
|
|
1303
|
+
init_open_service();
|
|
1104
1304
|
init_plain_object();
|
|
1105
1305
|
init_service_channel();
|
|
1106
1306
|
activeDrafts = /* @__PURE__ */ new WeakMap();
|
|
1107
1307
|
})))();
|
|
1108
1308
|
}
|
|
1109
1309
|
//#endregion
|
|
1110
|
-
//#region src/shared/open-service/query-state.ts
|
|
1111
|
-
/**
|
|
1112
|
-
* Expands a `(data, lifecycle)` pair into the full {@link QueryState} surfaced to subscribers.
|
|
1113
|
-
*
|
|
1114
|
-
* The single source of truth for the derived booleans, shared by the runtime's subscription
|
|
1115
|
-
* emissions and `useServiceQuery`'s first-render seed so they can never drift apart. The booleans
|
|
1116
|
-
* intentionally follow our `load` vocabulary: `isLoading` is "any load in flight" (TanStack's
|
|
1117
|
-
* `isFetching`) and `isInitialLoading` is "the first load with nothing to show yet".
|
|
1118
|
-
*
|
|
1119
|
-
* Unlike TanStack Query, a subscription here can attach to a query whose `data` is already cached in
|
|
1120
|
-
* service state (e.g. revisiting an already-extracted component): its per-subscription lifecycle
|
|
1121
|
-
* still starts `pending`/`loading`, but `data` is present from the first emission. `isInitialLoading`
|
|
1122
|
-
* therefore also requires `data === undefined`, so consumers gate a "nothing yet" skeleton on it
|
|
1123
|
-
* without flashing it over already-available data while a background (re)load runs.
|
|
1124
|
-
*/
|
|
1125
|
-
function buildQueryState(data, lifecycle) {
|
|
1126
|
-
const isPending = lifecycle.status === "pending";
|
|
1127
|
-
const isLoading = lifecycle.loadStatus === "loading";
|
|
1128
|
-
return {
|
|
1129
|
-
data,
|
|
1130
|
-
error: lifecycle.error,
|
|
1131
|
-
status: lifecycle.status,
|
|
1132
|
-
loadStatus: lifecycle.loadStatus,
|
|
1133
|
-
isPending,
|
|
1134
|
-
isSuccess: lifecycle.status === "success",
|
|
1135
|
-
isError: lifecycle.status === "error",
|
|
1136
|
-
isLoading,
|
|
1137
|
-
isInitialLoading: isPending && isLoading && data === void 0,
|
|
1138
|
-
isRefreshing: isLoading && !isPending
|
|
1139
|
-
};
|
|
1140
|
-
}
|
|
1141
|
-
/** Coerces an unknown thrown value into an `Error` for the `error` field of a {@link QueryState}. */
|
|
1142
|
-
function toError(value) {
|
|
1143
|
-
return value instanceof Error ? value : new Error(String(value));
|
|
1144
|
-
}
|
|
1145
|
-
//#endregion
|
|
1146
1310
|
//#region src/shared/open-service/service-validation.ts
|
|
1147
1311
|
/**
|
|
1148
1312
|
* Re-throws asynchronous subscription failures on the microtask queue so they are not silently
|
|
@@ -1190,11 +1354,11 @@ function validateSchemaSync(schema, value, meta) {
|
|
|
1190
1354
|
}
|
|
1191
1355
|
function init_service_validation() {
|
|
1192
1356
|
return (init_service_validation = __esmMin((() => {
|
|
1193
|
-
|
|
1357
|
+
init_open_service();
|
|
1194
1358
|
})))();
|
|
1195
1359
|
}
|
|
1196
1360
|
//#endregion
|
|
1197
|
-
//#region src/shared/open-service/query-
|
|
1361
|
+
//#region src/shared/open-service/query-load-registry.ts
|
|
1198
1362
|
/**
|
|
1199
1363
|
* Returns a deterministic JSON encoding so the same logical input always produces the same key.
|
|
1200
1364
|
*
|
|
@@ -1258,10 +1422,10 @@ function surfaceRejections(settlements) {
|
|
|
1258
1422
|
async function drainCollector(collector, settledKeys, serviceId, queryName) {
|
|
1259
1423
|
let iterations = 0;
|
|
1260
1424
|
while (collector.size > 0) {
|
|
1261
|
-
if (iterations++ >
|
|
1425
|
+
if (iterations++ > 32) throw new OpenServiceLoadedDrainExceededError({
|
|
1262
1426
|
serviceId,
|
|
1263
1427
|
name: queryName,
|
|
1264
|
-
iterations:
|
|
1428
|
+
iterations: 32
|
|
1265
1429
|
});
|
|
1266
1430
|
const pending = [...collector];
|
|
1267
1431
|
collector.clear();
|
|
@@ -1286,6 +1450,18 @@ function detachSnapshot(value) {
|
|
|
1286
1450
|
if (value === null || typeof value !== "object") return value;
|
|
1287
1451
|
return JSON.parse(JSON.stringify(value));
|
|
1288
1452
|
}
|
|
1453
|
+
var inFlightLoads, nextLoadScopeSequence, nextLoadScopeId, EMPTY_SET;
|
|
1454
|
+
function init_query_load_registry() {
|
|
1455
|
+
return (init_query_load_registry = __esmMin((() => {
|
|
1456
|
+
init_open_service();
|
|
1457
|
+
inFlightLoads = /* @__PURE__ */ new Map();
|
|
1458
|
+
nextLoadScopeSequence = 0;
|
|
1459
|
+
nextLoadScopeId = () => String(nextLoadScopeSequence += 1);
|
|
1460
|
+
EMPTY_SET = /* @__PURE__ */ new Set();
|
|
1461
|
+
})))();
|
|
1462
|
+
}
|
|
1463
|
+
//#endregion
|
|
1464
|
+
//#region src/shared/open-service/query-handler.ts
|
|
1289
1465
|
/**
|
|
1290
1466
|
* Validates query input synchronously, falling through to the dedicated async-schema error if a
|
|
1291
1467
|
* schema returns a Promise.
|
|
@@ -1318,39 +1494,240 @@ function runHandlerSync(refs, queryName, queryDef, validatedInput, selfQueries,
|
|
|
1318
1494
|
serviceId: refs.serviceId,
|
|
1319
1495
|
name: queryName
|
|
1320
1496
|
});
|
|
1321
|
-
const handlerCtx = {
|
|
1322
|
-
self: {
|
|
1323
|
-
get state() {
|
|
1324
|
-
return refs.state;
|
|
1325
|
-
},
|
|
1326
|
-
queries: selfQueries
|
|
1327
|
-
},
|
|
1328
|
-
getService
|
|
1497
|
+
const handlerCtx = {
|
|
1498
|
+
self: {
|
|
1499
|
+
get state() {
|
|
1500
|
+
return refs.state;
|
|
1501
|
+
},
|
|
1502
|
+
queries: selfQueries
|
|
1503
|
+
},
|
|
1504
|
+
getService
|
|
1505
|
+
};
|
|
1506
|
+
return queryDef.handler(validatedInput, handlerCtx);
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Builds the shared synchronous `get(input)` for a query: validate input → fire the load per the
|
|
1510
|
+
* caller's policy → run the handler against `selfQueries` → validate output.
|
|
1511
|
+
*
|
|
1512
|
+
* The three query surfaces — the default consumer query ({@link createDefaultQuery}), the reactive
|
|
1513
|
+
* subscription-load wrappers ({@link buildReactiveLoadQueries}), and the awaited load-body wrappers
|
|
1514
|
+
* ({@link buildLoadWrappedQueries}) — differ only in (a) which `self.queries` map the handler sees
|
|
1515
|
+
* and (b) how a load-backed read fires its `load`. Everything else (the validate → run → validate
|
|
1516
|
+
* skeleton, the zero-arg input resolution) is identical, so each surface passes its own `selfQueries`
|
|
1517
|
+
* map and `fireLoad` policy and shares this body.
|
|
1518
|
+
*
|
|
1519
|
+
* `fireLoad` is invoked only for queries that declare a `load`; queries without one skip it. Pass
|
|
1520
|
+
* `selfQueries` by reference even when it is the same map being populated by the caller — `get`
|
|
1521
|
+
* closes over the reference, which is fully built by the time any handler runs.
|
|
1522
|
+
*/
|
|
1523
|
+
function createQueryGet(refs, queryName, queryDef, selfQueries, fireLoad) {
|
|
1524
|
+
return function get(input) {
|
|
1525
|
+
const validatedInput = validateQueryInput(refs, queryName, queryDef, arguments.length === 0 ? void 0 : input);
|
|
1526
|
+
if (queryDef.load) fireLoad?.(validatedInput);
|
|
1527
|
+
return validateQueryOutput(refs, queryName, queryDef, runHandlerSync(refs, queryName, queryDef, validatedInput, selfQueries, refs.registryApi.getService));
|
|
1528
|
+
};
|
|
1529
|
+
}
|
|
1530
|
+
function init_query_handler() {
|
|
1531
|
+
return (init_query_handler = __esmMin((() => {
|
|
1532
|
+
init_open_service();
|
|
1533
|
+
init_service_validation();
|
|
1534
|
+
})))();
|
|
1535
|
+
}
|
|
1536
|
+
//#endregion
|
|
1537
|
+
//#region src/shared/open-service/query-state.ts
|
|
1538
|
+
/**
|
|
1539
|
+
* Expands a `(data, lifecycle)` pair into the full {@link QueryState} surfaced to subscribers.
|
|
1540
|
+
*
|
|
1541
|
+
* The single source of truth for the derived booleans, shared by the runtime's subscription
|
|
1542
|
+
* emissions and `useServiceQuery`'s first-render seed so they can never drift apart. The booleans
|
|
1543
|
+
* intentionally follow our `load` vocabulary: `isLoading` is "any load in flight" (TanStack's
|
|
1544
|
+
* `isFetching`) and `isInitialLoading` is "the first load with nothing to show yet".
|
|
1545
|
+
*
|
|
1546
|
+
* Unlike TanStack Query, a subscription here can attach to a query whose `data` is already cached in
|
|
1547
|
+
* service state (e.g. revisiting an already-extracted component): its per-subscription lifecycle
|
|
1548
|
+
* still starts `pending`/`loading`, but `data` is present from the first emission. `isInitialLoading`
|
|
1549
|
+
* therefore also requires `data === undefined`, so consumers gate a "nothing yet" skeleton on it
|
|
1550
|
+
* without flashing it over already-available data while a background (re)load runs.
|
|
1551
|
+
*/
|
|
1552
|
+
function buildQueryState(data, lifecycle) {
|
|
1553
|
+
const isPending = lifecycle.status === "pending";
|
|
1554
|
+
const isLoading = lifecycle.loadStatus === "loading";
|
|
1555
|
+
return {
|
|
1556
|
+
data,
|
|
1557
|
+
error: lifecycle.error,
|
|
1558
|
+
status: lifecycle.status,
|
|
1559
|
+
loadStatus: lifecycle.loadStatus,
|
|
1560
|
+
isPending,
|
|
1561
|
+
isSuccess: lifecycle.status === "success",
|
|
1562
|
+
isError: lifecycle.status === "error",
|
|
1563
|
+
isLoading,
|
|
1564
|
+
isInitialLoading: isPending && isLoading && data === void 0,
|
|
1565
|
+
isRefreshing: isLoading && !isPending
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
/** Coerces an unknown thrown value into an `Error` for the `error` field of a {@link QueryState}. */
|
|
1569
|
+
function toError(value) {
|
|
1570
|
+
return value instanceof Error ? value : new Error(String(value));
|
|
1571
|
+
}
|
|
1572
|
+
//#endregion
|
|
1573
|
+
//#region src/shared/open-service/query-subscribe.ts
|
|
1574
|
+
/**
|
|
1575
|
+
* Runs a query's `load` as the body of a subscription's reactive effect.
|
|
1576
|
+
*
|
|
1577
|
+
* Unlike {@link runLoadBody}, this is invoked synchronously inside an `effect()`, so the external
|
|
1578
|
+
* signals the load reads in its synchronous prefix are tracked — when they later change, the effect
|
|
1579
|
+
* re-runs and the load re-fires, turning it into a reactive async resource. Loads are therefore an
|
|
1580
|
+
* idempotent warming step (the documented guideline, now a hard contract); one-shot side effects
|
|
1581
|
+
* belong in a command.
|
|
1582
|
+
*
|
|
1583
|
+
* Writes go through gated commands: if `isCurrent()` flips to false because a newer run started
|
|
1584
|
+
* (deps changed again), this run's later writes are dropped, so a slow stale load cannot clobber the
|
|
1585
|
+
* newer result. Sibling reads use the default queries — their loads fire-and-forget — so transitive
|
|
1586
|
+
* dependencies stay warm without the `.loaded()` drain, which is only meaningful for awaited pulls.
|
|
1587
|
+
*/
|
|
1588
|
+
async function runReactiveLoad(refs, queryName, queryDef, validatedInput, isCurrent) {
|
|
1589
|
+
if (!queryDef.load) return;
|
|
1590
|
+
const loadCtx = {
|
|
1591
|
+
self: {
|
|
1592
|
+
get state() {
|
|
1593
|
+
return refs.state;
|
|
1594
|
+
},
|
|
1595
|
+
queries: refs.reactiveLoadQueries,
|
|
1596
|
+
commands: refs.buildGatedCommands(isCurrent)
|
|
1597
|
+
},
|
|
1598
|
+
getService: refs.registryApi.getService
|
|
1599
|
+
};
|
|
1600
|
+
await Promise.resolve(queryDef.load(validatedInput, loadCtx));
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Subscribes to a query by running its handler inside a deep-signal-aware `computed()` and
|
|
1604
|
+
* notifying through an `effect()`. The callback receives a {@link QueryState} combining the current
|
|
1605
|
+
* `data` (the synchronous handler result, or the selected slice) with the per-subscription `load`
|
|
1606
|
+
* lifecycle (`status` / `loadStatus` / `error`).
|
|
1607
|
+
*
|
|
1608
|
+
* The first emission is **synchronous**: `subscribe()` invokes the callback once with the current
|
|
1609
|
+
* {@link QueryState} before it returns the unsubscribe handle. The runtime kicks `load` off in the
|
|
1610
|
+
* background but does not wait for it — subscribers see the current state immediately (a load-backed
|
|
1611
|
+
* query already reads `loading`, since the reactive-load effect runs synchronously here) and
|
|
1612
|
+
* follow-up emissions as the load settles (or re-fires) and tracked state changes.
|
|
1613
|
+
*
|
|
1614
|
+
* Three layers keep emissions precise:
|
|
1615
|
+
*
|
|
1616
|
+
* 1. **Fine-grained reads** — the handler (and the optional `selector`) read through the deep-signal
|
|
1617
|
+
* proxy, so the computed only re-runs when the exact fields it touched change. A write to an
|
|
1618
|
+
* unrelated key or field never re-runs the handler.
|
|
1619
|
+
* 2. **Lifecycle signal** — a separate per-subscription signal carries `status`/`loadStatus`/`error`,
|
|
1620
|
+
* updated by the reactive-load effect. The emit effect reads both it and the data computed, so a
|
|
1621
|
+
* status change (e.g. a background re-load) fires the callback even when the selected slice is
|
|
1622
|
+
* unchanged.
|
|
1623
|
+
* 3. **Object dedup** — the whole emitted `QueryState` is compared with the previously emitted one via
|
|
1624
|
+
* `isEqual`; a re-run that produces a deeply-equal state (e.g. a load rewriting an equal payload
|
|
1625
|
+
* with no status change) does not fire the callback.
|
|
1626
|
+
*
|
|
1627
|
+
* Error sources all surface as `status: 'error'` (keeping the last successful `data`): input
|
|
1628
|
+
* validation failure, a synchronous handler / output-validation throw, and a `load` rejection.
|
|
1629
|
+
*/
|
|
1630
|
+
function subscribeToQuery(refs, queryName, queryDef, rawInput, selector, callback) {
|
|
1631
|
+
let active = true;
|
|
1632
|
+
let validatedInput;
|
|
1633
|
+
try {
|
|
1634
|
+
validatedInput = validateQueryInput(refs, queryName, queryDef, rawInput);
|
|
1635
|
+
} catch (error) {
|
|
1636
|
+
callback(buildQueryState(void 0, {
|
|
1637
|
+
status: "error",
|
|
1638
|
+
error: toError(error),
|
|
1639
|
+
loadStatus: "idle"
|
|
1640
|
+
}));
|
|
1641
|
+
return () => {
|
|
1642
|
+
active = false;
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
const lifecycle = y({
|
|
1646
|
+
status: queryDef.load ? "pending" : "success",
|
|
1647
|
+
error: void 0,
|
|
1648
|
+
loadStatus: "idle"
|
|
1649
|
+
});
|
|
1650
|
+
let loadTeardown;
|
|
1651
|
+
if (queryDef.load) {
|
|
1652
|
+
let epoch = 0;
|
|
1653
|
+
loadTeardown = j(() => {
|
|
1654
|
+
const myEpoch = ++epoch;
|
|
1655
|
+
const isCurrent = () => myEpoch === epoch;
|
|
1656
|
+
const previous = f(() => lifecycle.value);
|
|
1657
|
+
lifecycle.value = {
|
|
1658
|
+
status: previous.status,
|
|
1659
|
+
error: previous.error,
|
|
1660
|
+
loadStatus: "loading"
|
|
1661
|
+
};
|
|
1662
|
+
runReactiveLoad(refs, queryName, queryDef, validatedInput, isCurrent).then(() => {
|
|
1663
|
+
if (!isCurrent()) return;
|
|
1664
|
+
lifecycle.value = {
|
|
1665
|
+
status: "success",
|
|
1666
|
+
error: void 0,
|
|
1667
|
+
loadStatus: "idle"
|
|
1668
|
+
};
|
|
1669
|
+
}, (error) => {
|
|
1670
|
+
if (!isCurrent()) return;
|
|
1671
|
+
lifecycle.value = {
|
|
1672
|
+
status: "error",
|
|
1673
|
+
error: toError(error),
|
|
1674
|
+
loadStatus: "idle"
|
|
1675
|
+
};
|
|
1676
|
+
});
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
const comp = g$1(() => {
|
|
1680
|
+
const output = runHandlerSync(refs, queryName, queryDef, validatedInput, refs.defaultQueries, refs.registryApi.getService);
|
|
1681
|
+
if (selector) {
|
|
1682
|
+
const validated = f(() => validateQueryOutput(refs, queryName, queryDef, output));
|
|
1683
|
+
selector(output);
|
|
1684
|
+
return detachSnapshot(selector(validated));
|
|
1685
|
+
}
|
|
1686
|
+
return detachSnapshot(validateQueryOutput(refs, queryName, queryDef, output));
|
|
1687
|
+
});
|
|
1688
|
+
let hasEmitted = false;
|
|
1689
|
+
let lastEmitted;
|
|
1690
|
+
let lastData;
|
|
1691
|
+
const teardown = j(() => {
|
|
1692
|
+
const life = lifecycle.value;
|
|
1693
|
+
let data;
|
|
1694
|
+
let status = life.status;
|
|
1695
|
+
let error = life.error;
|
|
1696
|
+
try {
|
|
1697
|
+
data = comp.value;
|
|
1698
|
+
lastData = data;
|
|
1699
|
+
} catch (handlerError) {
|
|
1700
|
+
data = lastData;
|
|
1701
|
+
status = "error";
|
|
1702
|
+
error = toError(handlerError);
|
|
1703
|
+
}
|
|
1704
|
+
if (!active) return;
|
|
1705
|
+
const state = buildQueryState(data, {
|
|
1706
|
+
status,
|
|
1707
|
+
error,
|
|
1708
|
+
loadStatus: life.loadStatus
|
|
1709
|
+
});
|
|
1710
|
+
if (hasEmitted && isEqual(state, lastEmitted)) return;
|
|
1711
|
+
hasEmitted = true;
|
|
1712
|
+
lastEmitted = state;
|
|
1713
|
+
callback(state);
|
|
1714
|
+
});
|
|
1715
|
+
return () => {
|
|
1716
|
+
active = false;
|
|
1717
|
+
teardown();
|
|
1718
|
+
loadTeardown?.();
|
|
1329
1719
|
};
|
|
1330
|
-
return queryDef.handler(validatedInput, handlerCtx);
|
|
1331
1720
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
* and (b) how a load-backed read fires its `load`. Everything else (the validate → run → validate
|
|
1340
|
-
* skeleton, the zero-arg input resolution) is identical, so each surface passes its own `selfQueries`
|
|
1341
|
-
* map and `fireLoad` policy and shares this body.
|
|
1342
|
-
*
|
|
1343
|
-
* `fireLoad` is invoked only for queries that declare a `load`; queries without one skip it. Pass
|
|
1344
|
-
* `selfQueries` by reference even when it is the same map being populated by the caller — `get`
|
|
1345
|
-
* closes over the reference, which is fully built by the time any handler runs.
|
|
1346
|
-
*/
|
|
1347
|
-
function createQueryGet(refs, queryName, queryDef, selfQueries, fireLoad) {
|
|
1348
|
-
return function get(input) {
|
|
1349
|
-
const validatedInput = validateQueryInput(refs, queryName, queryDef, arguments.length === 0 ? void 0 : input);
|
|
1350
|
-
if (queryDef.load) fireLoad?.(validatedInput);
|
|
1351
|
-
return validateQueryOutput(refs, queryName, queryDef, runHandlerSync(refs, queryName, queryDef, validatedInput, selfQueries, refs.registryApi.getService));
|
|
1352
|
-
};
|
|
1721
|
+
function init_query_subscribe() {
|
|
1722
|
+
return (init_query_subscribe = __esmMin((() => {
|
|
1723
|
+
init_signals_core_module();
|
|
1724
|
+
init_isEqual();
|
|
1725
|
+
init_query_load_registry();
|
|
1726
|
+
init_query_handler();
|
|
1727
|
+
})))();
|
|
1353
1728
|
}
|
|
1729
|
+
//#endregion
|
|
1730
|
+
//#region src/shared/open-service/query-runtime.ts
|
|
1354
1731
|
/**
|
|
1355
1732
|
* Triggers a `load` if one is not already in flight for the same key, or returns the existing
|
|
1356
1733
|
* promise so concurrent callers share the work.
|
|
@@ -1429,34 +1806,6 @@ async function runLoadBody(refs, queryName, queryDef, validatedInput, ancestorCh
|
|
|
1429
1806
|
await drainCollector(collector, void 0, refs.serviceId, queryName);
|
|
1430
1807
|
}
|
|
1431
1808
|
/**
|
|
1432
|
-
* Runs a query's `load` as the body of a subscription's reactive effect.
|
|
1433
|
-
*
|
|
1434
|
-
* Unlike {@link runLoadBody}, this is invoked synchronously inside an `effect()`, so the external
|
|
1435
|
-
* signals the load reads in its synchronous prefix are tracked — when they later change, the effect
|
|
1436
|
-
* re-runs and the load re-fires, turning it into a reactive async resource. Loads are therefore an
|
|
1437
|
-
* idempotent warming step (the documented guideline, now a hard contract); one-shot side effects
|
|
1438
|
-
* belong in a command.
|
|
1439
|
-
*
|
|
1440
|
-
* Writes go through gated commands: if `isCurrent()` flips to false because a newer run started
|
|
1441
|
-
* (deps changed again), this run's later writes are dropped, so a slow stale load cannot clobber the
|
|
1442
|
-
* newer result. Sibling reads use the default queries — their loads fire-and-forget — so transitive
|
|
1443
|
-
* dependencies stay warm without the `.loaded()` drain, which is only meaningful for awaited pulls.
|
|
1444
|
-
*/
|
|
1445
|
-
async function runReactiveLoad(refs, queryName, queryDef, validatedInput, isCurrent) {
|
|
1446
|
-
if (!queryDef.load) return;
|
|
1447
|
-
const loadCtx = {
|
|
1448
|
-
self: {
|
|
1449
|
-
get state() {
|
|
1450
|
-
return refs.state;
|
|
1451
|
-
},
|
|
1452
|
-
queries: refs.reactiveLoadQueries,
|
|
1453
|
-
commands: refs.buildGatedCommands(isCurrent)
|
|
1454
|
-
},
|
|
1455
|
-
getService: refs.registryApi.getService
|
|
1456
|
-
};
|
|
1457
|
-
await Promise.resolve(queryDef.load(validatedInput, loadCtx));
|
|
1458
|
-
}
|
|
1459
|
-
/**
|
|
1460
1809
|
* Builds the `ctx.self.queries` map used inside a *reactive subscription load* body.
|
|
1461
1810
|
*
|
|
1462
1811
|
* `.get()` here fires the dependency's `load` fire-and-forget (deduped via {@link inFlightLoads}),
|
|
@@ -1608,10 +1957,10 @@ async function runLoaded(refs, queryName, queryDef, rawInput, parentAncestorChai
|
|
|
1608
1957
|
let iterations = 0;
|
|
1609
1958
|
let hasMoreWork = true;
|
|
1610
1959
|
while (hasMoreWork) {
|
|
1611
|
-
if (iterations++ >
|
|
1960
|
+
if (iterations++ > 32) throw new OpenServiceLoadedDrainExceededError({
|
|
1612
1961
|
serviceId: refs.serviceId,
|
|
1613
1962
|
name: queryName,
|
|
1614
|
-
iterations:
|
|
1963
|
+
iterations: 32
|
|
1615
1964
|
});
|
|
1616
1965
|
while (session.collector.size > 0) {
|
|
1617
1966
|
const pending = [...session.collector];
|
|
@@ -1681,143 +2030,20 @@ function createDefaultQuery(refs, queryName, queryDef) {
|
|
|
1681
2030
|
subscribe
|
|
1682
2031
|
};
|
|
1683
2032
|
}
|
|
1684
|
-
/**
|
|
1685
|
-
* Subscribes to a query by running its handler inside a deep-signal-aware `computed()` and
|
|
1686
|
-
* notifying through an `effect()`. The callback receives a {@link QueryState} combining the current
|
|
1687
|
-
* `data` (the synchronous handler result, or the selected slice) with the per-subscription `load`
|
|
1688
|
-
* lifecycle (`status` / `loadStatus` / `error`).
|
|
1689
|
-
*
|
|
1690
|
-
* The first emission is **synchronous**: `subscribe()` invokes the callback once with the current
|
|
1691
|
-
* {@link QueryState} before it returns the unsubscribe handle. The runtime kicks `load` off in the
|
|
1692
|
-
* background but does not wait for it — subscribers see the current state immediately (a load-backed
|
|
1693
|
-
* query already reads `loading`, since the reactive-load effect runs synchronously here) and
|
|
1694
|
-
* follow-up emissions as the load settles (or re-fires) and tracked state changes.
|
|
1695
|
-
*
|
|
1696
|
-
* Three layers keep emissions precise:
|
|
1697
|
-
*
|
|
1698
|
-
* 1. **Fine-grained reads** — the handler (and the optional `selector`) read through the deep-signal
|
|
1699
|
-
* proxy, so the computed only re-runs when the exact fields it touched change. A write to an
|
|
1700
|
-
* unrelated key or field never re-runs the handler.
|
|
1701
|
-
* 2. **Lifecycle signal** — a separate per-subscription signal carries `status`/`loadStatus`/`error`,
|
|
1702
|
-
* updated by the reactive-load effect. The emit effect reads both it and the data computed, so a
|
|
1703
|
-
* status change (e.g. a background re-load) fires the callback even when the selected slice is
|
|
1704
|
-
* unchanged.
|
|
1705
|
-
* 3. **Object dedup** — the whole emitted `QueryState` is compared with the previously emitted one via
|
|
1706
|
-
* `isEqual`; a re-run that produces a deeply-equal state (e.g. a load rewriting an equal payload
|
|
1707
|
-
* with no status change) does not fire the callback.
|
|
1708
|
-
*
|
|
1709
|
-
* Error sources all surface as `status: 'error'` (keeping the last successful `data`): input
|
|
1710
|
-
* validation failure, a synchronous handler / output-validation throw, and a `load` rejection.
|
|
1711
|
-
*/
|
|
1712
|
-
function subscribeToQuery(refs, queryName, queryDef, rawInput, selector, callback) {
|
|
1713
|
-
let active = true;
|
|
1714
|
-
let validatedInput;
|
|
1715
|
-
try {
|
|
1716
|
-
validatedInput = validateQueryInput(refs, queryName, queryDef, rawInput);
|
|
1717
|
-
} catch (error) {
|
|
1718
|
-
callback(buildQueryState(void 0, {
|
|
1719
|
-
status: "error",
|
|
1720
|
-
error: toError(error),
|
|
1721
|
-
loadStatus: "idle"
|
|
1722
|
-
}));
|
|
1723
|
-
return () => {
|
|
1724
|
-
active = false;
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
const lifecycle = y({
|
|
1728
|
-
status: queryDef.load ? "pending" : "success",
|
|
1729
|
-
error: void 0,
|
|
1730
|
-
loadStatus: "idle"
|
|
1731
|
-
});
|
|
1732
|
-
let loadTeardown;
|
|
1733
|
-
if (queryDef.load) {
|
|
1734
|
-
let epoch = 0;
|
|
1735
|
-
loadTeardown = j(() => {
|
|
1736
|
-
const myEpoch = ++epoch;
|
|
1737
|
-
const isCurrent = () => myEpoch === epoch;
|
|
1738
|
-
const previous = f(() => lifecycle.value);
|
|
1739
|
-
lifecycle.value = {
|
|
1740
|
-
status: previous.status,
|
|
1741
|
-
error: previous.error,
|
|
1742
|
-
loadStatus: "loading"
|
|
1743
|
-
};
|
|
1744
|
-
runReactiveLoad(refs, queryName, queryDef, validatedInput, isCurrent).then(() => {
|
|
1745
|
-
if (!isCurrent()) return;
|
|
1746
|
-
lifecycle.value = {
|
|
1747
|
-
status: "success",
|
|
1748
|
-
error: void 0,
|
|
1749
|
-
loadStatus: "idle"
|
|
1750
|
-
};
|
|
1751
|
-
}, (error) => {
|
|
1752
|
-
if (!isCurrent()) return;
|
|
1753
|
-
lifecycle.value = {
|
|
1754
|
-
status: "error",
|
|
1755
|
-
error: toError(error),
|
|
1756
|
-
loadStatus: "idle"
|
|
1757
|
-
};
|
|
1758
|
-
});
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
const comp = g$1(() => {
|
|
1762
|
-
const output = runHandlerSync(refs, queryName, queryDef, validatedInput, refs.defaultQueries, refs.registryApi.getService);
|
|
1763
|
-
if (selector) {
|
|
1764
|
-
const validated = f(() => validateQueryOutput(refs, queryName, queryDef, output));
|
|
1765
|
-
selector(output);
|
|
1766
|
-
return detachSnapshot(selector(validated));
|
|
1767
|
-
}
|
|
1768
|
-
return detachSnapshot(validateQueryOutput(refs, queryName, queryDef, output));
|
|
1769
|
-
});
|
|
1770
|
-
let hasEmitted = false;
|
|
1771
|
-
let lastEmitted;
|
|
1772
|
-
let lastData;
|
|
1773
|
-
const teardown = j(() => {
|
|
1774
|
-
const life = lifecycle.value;
|
|
1775
|
-
let data;
|
|
1776
|
-
let status = life.status;
|
|
1777
|
-
let error = life.error;
|
|
1778
|
-
try {
|
|
1779
|
-
data = comp.value;
|
|
1780
|
-
lastData = data;
|
|
1781
|
-
} catch (handlerError) {
|
|
1782
|
-
data = lastData;
|
|
1783
|
-
status = "error";
|
|
1784
|
-
error = toError(handlerError);
|
|
1785
|
-
}
|
|
1786
|
-
if (!active) return;
|
|
1787
|
-
const state = buildQueryState(data, {
|
|
1788
|
-
status,
|
|
1789
|
-
error,
|
|
1790
|
-
loadStatus: life.loadStatus
|
|
1791
|
-
});
|
|
1792
|
-
if (hasEmitted && isEqual(state, lastEmitted)) return;
|
|
1793
|
-
hasEmitted = true;
|
|
1794
|
-
lastEmitted = state;
|
|
1795
|
-
callback(state);
|
|
1796
|
-
});
|
|
1797
|
-
return () => {
|
|
1798
|
-
active = false;
|
|
1799
|
-
teardown();
|
|
1800
|
-
loadTeardown?.();
|
|
1801
|
-
};
|
|
1802
|
-
}
|
|
1803
2033
|
/** Builds the runtime query map for one service runtime. */
|
|
1804
2034
|
function buildQueries(refs) {
|
|
1805
2035
|
const result = {};
|
|
1806
2036
|
for (const [name, queryDef] of refs.queryDefinitions) result[name] = createDefaultQuery(refs, name, queryDef);
|
|
1807
2037
|
return result;
|
|
1808
2038
|
}
|
|
1809
|
-
var
|
|
2039
|
+
var activeHandlerLoadSession;
|
|
1810
2040
|
function init_query_runtime() {
|
|
1811
2041
|
return (init_query_runtime = __esmMin((() => {
|
|
1812
|
-
|
|
1813
|
-
init_isEqual();
|
|
1814
|
-
init_server_errors();
|
|
2042
|
+
init_open_service();
|
|
1815
2043
|
init_service_validation();
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
nextLoadScopeId = () => String(nextLoadScopeSequence += 1);
|
|
1820
|
-
EMPTY_SET = /* @__PURE__ */ new Set();
|
|
2044
|
+
init_query_load_registry();
|
|
2045
|
+
init_query_handler();
|
|
2046
|
+
init_query_subscribe();
|
|
1821
2047
|
})))();
|
|
1822
2048
|
}
|
|
1823
2049
|
//#endregion
|
|
@@ -2420,7 +2646,7 @@ function init_service_runtime() {
|
|
|
2420
2646
|
return (init_service_runtime = __esmMin((() => {
|
|
2421
2647
|
init_signals_core_module();
|
|
2422
2648
|
init_deepsignal_core_module();
|
|
2423
|
-
|
|
2649
|
+
init_open_service();
|
|
2424
2650
|
init_patch_recorder();
|
|
2425
2651
|
init_plain_object();
|
|
2426
2652
|
init_query_runtime();
|
|
@@ -2899,9 +3125,9 @@ function connectServiceToChannel(context) {
|
|
|
2899
3125
|
var SYNC_REQUEST_SILENCE_MS;
|
|
2900
3126
|
function init_service_transport() {
|
|
2901
3127
|
return (init_service_transport = __esmMin((() => {
|
|
2902
|
-
init_dist();
|
|
3128
|
+
init_dist$1();
|
|
2903
3129
|
init_client_logger();
|
|
2904
|
-
|
|
3130
|
+
init_open_service();
|
|
2905
3131
|
init_service_channel();
|
|
2906
3132
|
init_service_error_serialization();
|
|
2907
3133
|
init_service_sync();
|
|
@@ -3105,7 +3331,7 @@ var REGISTRY_SYMBOL, serviceRegistryApi;
|
|
|
3105
3331
|
function init_service_registry() {
|
|
3106
3332
|
return (init_service_registry = __esmMin((() => {
|
|
3107
3333
|
init_channel_slot();
|
|
3108
|
-
|
|
3334
|
+
init_open_service();
|
|
3109
3335
|
init_service_channel();
|
|
3110
3336
|
init_service_runtime();
|
|
3111
3337
|
init_service_sync();
|
|
@@ -3248,7 +3474,7 @@ function init_paths() {
|
|
|
3248
3474
|
var docgenInputSchema, argTypesSchema, docgenErrorSchema, docgenJsDocTagsSchema, docgenComponentFields, docgenSubcomponentFields, docgenSubcomponentSchema, docgenPayloadSchema, docgenOutputSchema, docgenServiceDef;
|
|
3249
3475
|
function init_definition() {
|
|
3250
3476
|
return (init_definition = __esmMin((() => {
|
|
3251
|
-
init_dist();
|
|
3477
|
+
init_dist$1();
|
|
3252
3478
|
init_service_definition();
|
|
3253
3479
|
init_paths();
|
|
3254
3480
|
docgenInputSchema = object({ id: string() });
|
|
@@ -3321,12 +3547,12 @@ function init_definition() {
|
|
|
3321
3547
|
}
|
|
3322
3548
|
//#endregion
|
|
3323
3549
|
//#region src/shared/open-service/services/docgen/preview.ts
|
|
3324
|
-
var preview_default$
|
|
3550
|
+
var preview_default$2;
|
|
3325
3551
|
function init_preview$1() {
|
|
3326
3552
|
return (init_preview$1 = __esmMin((() => {
|
|
3327
3553
|
init_preview();
|
|
3328
3554
|
init_definition();
|
|
3329
|
-
preview_default$
|
|
3555
|
+
preview_default$2 = () => definePreviewAddon({ beforeAll: () => {
|
|
3330
3556
|
if (globalThis.FEATURES?.docgenServer) registerService(docgenServiceDef);
|
|
3331
3557
|
} });
|
|
3332
3558
|
})))();
|
|
@@ -3348,7 +3574,7 @@ function init_paths$1() {
|
|
|
3348
3574
|
var storyDocsInputSchema, storyDocsErrorSchema, storyDocSchema, storyDocsPayloadSchema, storyDocsOutputSchema, storyDocsServiceDef;
|
|
3349
3575
|
function init_definition$1() {
|
|
3350
3576
|
return (init_definition$1 = __esmMin((() => {
|
|
3351
|
-
init_dist();
|
|
3577
|
+
init_dist$1();
|
|
3352
3578
|
init_service_definition();
|
|
3353
3579
|
init_paths$1();
|
|
3354
3580
|
storyDocsInputSchema = object({ id: string() });
|
|
@@ -3459,13 +3685,13 @@ function init_story_docs_source_before_each() {
|
|
|
3459
3685
|
}
|
|
3460
3686
|
//#endregion
|
|
3461
3687
|
//#region src/shared/open-service/services/story-docs/preview.ts
|
|
3462
|
-
var preview_default;
|
|
3688
|
+
var preview_default$1;
|
|
3463
3689
|
function init_preview$2() {
|
|
3464
3690
|
return (init_preview$2 = __esmMin((() => {
|
|
3465
3691
|
init_preview();
|
|
3466
3692
|
init_definition$1();
|
|
3467
3693
|
init_story_docs_source_before_each();
|
|
3468
|
-
preview_default = () => {
|
|
3694
|
+
preview_default$1 = () => {
|
|
3469
3695
|
if (!("FEATURES" in globalThis && globalThis.FEATURES?.docgenServer)) return definePreviewAddon({});
|
|
3470
3696
|
return definePreviewAddon({
|
|
3471
3697
|
beforeAll: () => {
|
|
@@ -3477,6 +3703,97 @@ function init_preview$2() {
|
|
|
3477
3703
|
})))();
|
|
3478
3704
|
}
|
|
3479
3705
|
//#endregion
|
|
3706
|
+
//#region src/test/preview.ts
|
|
3707
|
+
var resetAllMocksLoader, isExplicitAction, traverseArgs, nameSpiesAndWrapActionsInSpies, patchedFocus, enhanceContext, preview_default;
|
|
3708
|
+
function init_preview$3() {
|
|
3709
|
+
return (init_preview$3 = __esmMin((() => {
|
|
3710
|
+
init_instrumenter();
|
|
3711
|
+
init_test();
|
|
3712
|
+
resetAllMocksLoader = ({ parameters }) => {
|
|
3713
|
+
if (parameters?.test?.mockReset === true) resetAllMocks();
|
|
3714
|
+
else if (parameters?.test?.clearMocks === true) clearAllMocks();
|
|
3715
|
+
else if (parameters?.test?.restoreMocks !== false) restoreAllMocks();
|
|
3716
|
+
};
|
|
3717
|
+
isExplicitAction = (value) => typeof value === "function" && "isAction" in value && !!value.isAction && !("implicit" in value && value.implicit);
|
|
3718
|
+
traverseArgs = (value, depth = 0, key) => {
|
|
3719
|
+
if (depth > 5) return value;
|
|
3720
|
+
if (value == null) return value;
|
|
3721
|
+
if (isMockFunction(value)) {
|
|
3722
|
+
if (key) value.mockName(key);
|
|
3723
|
+
return value;
|
|
3724
|
+
}
|
|
3725
|
+
if (isExplicitAction(value)) {
|
|
3726
|
+
const mock = fn(value);
|
|
3727
|
+
if (key) mock.mockName(key);
|
|
3728
|
+
return mock;
|
|
3729
|
+
}
|
|
3730
|
+
if (Array.isArray(value)) {
|
|
3731
|
+
depth++;
|
|
3732
|
+
for (let i = 0; i < value.length; i++) if (Object.getOwnPropertyDescriptor(value, i)?.writable) value[i] = traverseArgs(value[i], depth);
|
|
3733
|
+
return value;
|
|
3734
|
+
}
|
|
3735
|
+
if (typeof value === "object" && value.constructor === Object) {
|
|
3736
|
+
depth++;
|
|
3737
|
+
for (const [k, v] of Object.entries(value)) if (Object.getOwnPropertyDescriptor(value, k)?.writable) value[k] = traverseArgs(v, depth, k);
|
|
3738
|
+
return value;
|
|
3739
|
+
}
|
|
3740
|
+
return value;
|
|
3741
|
+
};
|
|
3742
|
+
nameSpiesAndWrapActionsInSpies = ({ initialArgs }) => {
|
|
3743
|
+
traverseArgs(initialArgs);
|
|
3744
|
+
};
|
|
3745
|
+
patchedFocus = false;
|
|
3746
|
+
enhanceContext = async (context) => {
|
|
3747
|
+
if (globalThis.HTMLElement && context.canvasElement instanceof globalThis.HTMLElement) context.canvas = within(context.canvasElement);
|
|
3748
|
+
try {
|
|
3749
|
+
const clipboard = globalThis.window?.navigator?.clipboard;
|
|
3750
|
+
if (clipboard) {
|
|
3751
|
+
context.userEvent = instrument({ userEvent: uninstrumentedUserEvent.setup() }, {
|
|
3752
|
+
intercept: true,
|
|
3753
|
+
getKeys: (obj) => Object.keys(obj).filter((key) => key !== "eventWrapper")
|
|
3754
|
+
}).userEvent;
|
|
3755
|
+
Object.defineProperty(globalThis.window.navigator, "clipboard", {
|
|
3756
|
+
get: () => clipboard,
|
|
3757
|
+
configurable: true
|
|
3758
|
+
});
|
|
3759
|
+
if (!patchedFocus) {
|
|
3760
|
+
const originalFocus = HTMLElement.prototype.focus;
|
|
3761
|
+
let currentFocus = HTMLElement.prototype.focus;
|
|
3762
|
+
const noopFocus = () => {};
|
|
3763
|
+
const focusingElements = /* @__PURE__ */ new Set();
|
|
3764
|
+
Object.defineProperties(HTMLElement.prototype, { focus: {
|
|
3765
|
+
configurable: true,
|
|
3766
|
+
set: (newFocus) => {
|
|
3767
|
+
currentFocus = newFocus;
|
|
3768
|
+
},
|
|
3769
|
+
get() {
|
|
3770
|
+
if (this === HTMLElement.prototype) return currentFocus;
|
|
3771
|
+
let browsingContext;
|
|
3772
|
+
try {
|
|
3773
|
+
browsingContext = this.ownerDocument?.defaultView;
|
|
3774
|
+
} catch {
|
|
3775
|
+
return currentFocus;
|
|
3776
|
+
}
|
|
3777
|
+
if (!browsingContext) return noopFocus;
|
|
3778
|
+
if (focusingElements.has(this)) return originalFocus;
|
|
3779
|
+
focusingElements.add(this);
|
|
3780
|
+
setTimeout(() => focusingElements.delete(this), 0);
|
|
3781
|
+
return currentFocus;
|
|
3782
|
+
}
|
|
3783
|
+
} });
|
|
3784
|
+
patchedFocus = true;
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
} catch {}
|
|
3788
|
+
};
|
|
3789
|
+
preview_default = () => definePreviewAddon({ loaders: [
|
|
3790
|
+
resetAllMocksLoader,
|
|
3791
|
+
nameSpiesAndWrapActionsInSpies,
|
|
3792
|
+
enhanceContext
|
|
3793
|
+
] });
|
|
3794
|
+
})))();
|
|
3795
|
+
}
|
|
3796
|
+
//#endregion
|
|
3480
3797
|
//#region src/shared/story-index/autoTitle.ts
|
|
3481
3798
|
/**
|
|
3482
3799
|
* Combines path parts together, without duplicating separators (slashes). Used instead of
|
|
@@ -3600,7 +3917,7 @@ function init_sortStories() {
|
|
|
3600
3917
|
|
|
3601
3918
|
Are you using a V6-style sort function in V7 mode?
|
|
3602
3919
|
|
|
3603
|
-
More info: https://
|
|
3920
|
+
More info: https://forkbook.ljk.dev/docs/migration#v7-style-story-sort
|
|
3604
3921
|
`);
|
|
3605
3922
|
}
|
|
3606
3923
|
};
|
|
@@ -3618,6 +3935,43 @@ function init_story_index_filters() {
|
|
|
3618
3935
|
})))();
|
|
3619
3936
|
}
|
|
3620
3937
|
//#endregion
|
|
3938
|
+
//#region src/shared/story-grid.ts
|
|
3939
|
+
var isGridEntry, groupEntriesByComponent;
|
|
3940
|
+
function init_story_grid() {
|
|
3941
|
+
return (init_story_grid = __esmMin((() => {
|
|
3942
|
+
isGridEntry = (entry, hiddenImportPath) => entry.importPath !== hiddenImportPath && (entry.type === "docs" || entry.type === "story" && entry.subtype !== "test");
|
|
3943
|
+
groupEntriesByComponent = (entries, { hiddenImportPath } = {}) => {
|
|
3944
|
+
const byTitle = /* @__PURE__ */ new Map();
|
|
3945
|
+
for (const entry of entries) {
|
|
3946
|
+
if (!isGridEntry(entry, hiddenImportPath)) continue;
|
|
3947
|
+
let component = byTitle.get(entry.title);
|
|
3948
|
+
if (!component) {
|
|
3949
|
+
component = {
|
|
3950
|
+
title: entry.title,
|
|
3951
|
+
name: entry.title.split("/").pop() ?? entry.title,
|
|
3952
|
+
entryId: entry.id,
|
|
3953
|
+
viewMode: entry.type,
|
|
3954
|
+
storyIds: []
|
|
3955
|
+
};
|
|
3956
|
+
byTitle.set(entry.title, component);
|
|
3957
|
+
}
|
|
3958
|
+
if (entry.type === "docs" && component.viewMode !== "docs") {
|
|
3959
|
+
component.entryId = entry.id;
|
|
3960
|
+
component.viewMode = "docs";
|
|
3961
|
+
}
|
|
3962
|
+
if (entry.type === "story") {
|
|
3963
|
+
component.storyIds.push(entry.id);
|
|
3964
|
+
if (!component.firstStoryId) {
|
|
3965
|
+
component.firstStoryId = entry.id;
|
|
3966
|
+
component.thumbnail = entry.thumbnail ?? component.thumbnail;
|
|
3967
|
+
}
|
|
3968
|
+
} else component.thumbnail ??= entry.thumbnail;
|
|
3969
|
+
}
|
|
3970
|
+
return [...byTitle.values()];
|
|
3971
|
+
};
|
|
3972
|
+
})))();
|
|
3973
|
+
}
|
|
3974
|
+
//#endregion
|
|
3621
3975
|
//#region src/shared/constants/iframe-resize.ts
|
|
3622
3976
|
var IFRAME_RESIZE_CONTEXT, IFRAME_RESIZE_REQUEST_CONTEXT, iframeResizeViewportsEqual;
|
|
3623
3977
|
function init_iframe_resize() {
|
|
@@ -3632,4 +3986,4 @@ function init_iframe_resize() {
|
|
|
3632
3986
|
})))();
|
|
3633
3987
|
}
|
|
3634
3988
|
//#endregion
|
|
3635
|
-
export {
|
|
3989
|
+
export { REVIEW_NAMESPACE as A, matchesHostname as B, init_test as C, Tag as D, onMockCall as E, init_status_store as F, init_universal_store as G, global_exports as H, formatIssues as I, StorybookError as K, init_errors as L, CHANGE_DETECTION_STATUS_TYPE_ID as M, NON_AGGREGATED_STATUS_TYPE_IDS as N, init_tags as O, REVIEW_STATUS_TYPE_ID as P, LOOPBACK_HOSTNAMES as R, registerService as S, init_spy as T, init_global as U, global as V, UniversalStore as W, preview_default$1 as _, groupEntriesByComponent as a, getService as b, isMdxEntry as c, init_autoTitle as d, userOrAutoTitle as f, init_preview$2 as g, preview_default as h, init_iframe_resize as i, init_events as j, REVIEW_EVENTS as k, init_sortStories as l, init_preview$3 as m, IFRAME_RESIZE_REQUEST_CONTEXT as n, init_story_grid as o, userOrAutoTitleFromSpecifier as p, init_storybook_error as q, iframeResizeViewportsEqual as r, init_story_index_filters as s, IFRAME_RESIZE_CONTEXT as t, sortStoriesV7 as u, init_preview$1 as v, test_exports as w, init_preview as x, preview_default$2 as y, init_local_hosts as z };
|