@aussieljk/forkbook 0.0.1-2 → 0.0.1-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +35 -53
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
- package/assets/browser/favicon-wrapper.svg +4 -4
- package/assets/browser/favicon.svg +1 -1
- package/assets/browser/inter-LICENSE.txt +92 -0
- package/assets/browser/inter-variable-italic.woff2 +0 -0
- package/assets/browser/inter-variable.woff2 +0 -0
- package/assets/browser/mirror-ball.png +0 -0
- package/assets/builder-vite/iframe.html +8 -24
- package/assets/create/rendererAssets/common/Configure.mdx +100 -100
- package/assets/create/rendererAssets/common/button.css +7 -7
- package/assets/create/rendererAssets/common/header.css +6 -6
- package/assets/create/rendererAssets/common/page.css +12 -12
- package/assets/create/templates/react-native/index.expo.js +4 -4
- package/assets/create/templates/react-native/index.js +5 -5
- package/assets/server/base-preview-body.html +32 -32
- package/assets/server/base-preview-head.html +86 -86
- package/assets/server/template.ejs +31 -26
- package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-7FO5YFB5.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-QWFSUQZP.js +199 -0
- package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-5Z3MWCFR.js} +12 -12
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
- package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-BSYOFSF6.js} +770 -720
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
- package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
- package/dist/_browser-chunks/chunk-FAOLWWRN.js +20 -0
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
- package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
- package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
- package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
- package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
- package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
- package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
- package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
- package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
- package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
- package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-ZIZCGWCG.js} +348 -170
- package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
- package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-UC2CB4GH.js} +37 -35
- package/dist/_node-chunks/builder-manager-S5UUKVOR.js +1174 -0
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-3335ZZIO.js} +6 -6
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-3D6N6P2R.js} +283 -306
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-3ER54PQM.js} +8 -8
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-3H5C52QU.js} +6 -6
- package/dist/_node-chunks/chunk-3UI3TQ7R.js +28 -0
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-4C3ACAHV.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-4UTCKJEQ.js} +7 -7
- package/dist/_node-chunks/chunk-53A5CYDK.js +572 -0
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-53PSBDRK.js} +140 -118
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-54MO4QLB.js} +6 -6
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-5CJMRQZ6.js} +6 -6
- package/dist/_node-chunks/chunk-5HOM7B4V.js +20 -0
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-5QG6AXK4.js} +7 -7
- package/dist/_node-chunks/chunk-67XVZZUO.js +405 -0
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-6HQJJDLH.js} +6 -6
- package/dist/_node-chunks/chunk-6IPHWCFI.js +29 -0
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-6XYOFBRD.js} +98 -129
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-7IAYDGYH.js} +6 -6
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-7P67PUU2.js} +7 -7
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-AAK5BBF2.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-BGUVBOOU.js} +10 -10
- package/dist/_node-chunks/chunk-BNGBOASQ.js +25 -0
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-BWZWCVVH.js} +9 -9
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-C6HQ6WLU.js} +8 -8
- package/dist/_node-chunks/chunk-CJHRH777.js +20 -0
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-COEW4ORP.js} +6 -6
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-CVHDAEDZ.js} +7 -7
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-CXGOQNGI.js} +7 -7
- package/dist/_node-chunks/chunk-D4XTQWRM.js +11 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-D5V6CZ6U.js} +7 -7
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-DCTXJ4TT.js} +14 -16
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-DP6WFY3D.js} +7 -7
- package/dist/_node-chunks/chunk-E23GDXG6.js +271 -0
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-E3ZFMURC.js} +8 -8
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-E6O3NA44.js} +7 -7
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-ECS3WDOU.js} +8 -8
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-FB5YJWOH.js} +6 -6
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-FCK5FM6D.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-FJUGPEJK.js} +6 -6
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-FPYXI76E.js} +75 -75
- package/dist/_node-chunks/chunk-GEWVOY3F.js +62 -0
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-GHZ44BFB.js} +14 -13
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-GJMFISS3.js} +8 -8
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-GK2Y2RFX.js} +7 -7
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-GP6YBA2R.js} +6 -6
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-GQUFGJ4D.js} +6 -6
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-H4CRQDTK.js} +6 -6
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-HCDG54OG.js} +7 -7
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-HGJMP4EI.js} +506 -494
- package/dist/_node-chunks/chunk-HSX6BDBA.js +18 -0
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-IPFPWMT5.js} +1320 -437
- package/dist/_node-chunks/chunk-KRIOC4WF.js +281 -0
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-KUL2MJ6N.js} +6 -6
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-LUR6QTYB.js} +10 -10
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-LYS7TI35.js} +368 -321
- package/dist/_node-chunks/chunk-MDTXL6SN.js +2613 -0
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-MIIPXT4S.js} +9 -9
- package/dist/_node-chunks/chunk-MLWGAA2I.js +138 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-MWUGCUB5.js} +52 -22
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-MX5MVLEK.js} +6 -6
- package/dist/_node-chunks/chunk-N44UIGCO.js +47 -0
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-NP2JHOFY.js} +37 -31
- package/dist/_node-chunks/chunk-OMNGOPNG.js +52 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-OO2GTHUF.js} +9 -17
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-PC57BIYZ.js} +8 -8
- package/dist/_node-chunks/chunk-PHWMAF5C.js +49 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-PLIQQETC.js} +7 -7
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-QMYCIS2U.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-QZIDK3GX.js} +89 -71
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-ROJ6RSIJ.js} +7 -7
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-S2NB6QEG.js} +542 -1049
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-S6VCOSQS.js} +6 -6
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-SEVOOOB2.js} +474 -479
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-SFT6ZAVN.js} +6 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-SXBUK4F6.js} +7 -7
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-TGF6Q66I.js} +15 -9
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-TGFHWGGT.js} +9 -6
- package/dist/_node-chunks/chunk-TTLSBLPQ.js +620 -0
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-UUAEW2AR.js} +6 -6
- package/dist/_node-chunks/chunk-VQHM66NL.js +534 -0
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-VSTTY3TM.js} +6 -6
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-XDBSAFUB.js} +650 -9
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-XTQQGAUZ.js} +7 -7
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-YMJVSFJT.js} +6 -6
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-YXEKWVJQ.js} +7 -7
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-Z6CUUWJO.js} +34 -949
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-ZAIGR7EV.js} +64 -17
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-ZCFXEFR6.js} +33 -41
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-ZHUBOYOD.js} +6 -6
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-ZHUBTBP2.js} +25 -8
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-ZSTIFZHY.js} +21 -25
- package/dist/_node-chunks/dist-TRTHRODT.js +16 -0
- package/dist/_node-chunks/dist-XPLJ5T4W.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-AC7MOWYK.js} +21 -22
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-ZW26VGEP.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-T2KZK62Q.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-2CWUUF6H.js} +12 -12
- package/dist/_node-chunks/optimized-tests-4AK3PFSX.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-CMRGEXHM.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-OUQENFYO.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-LHOAIJ2E.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-K54MMYY6.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-TTL4PWH7.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-6DXBB5F7.js} +294 -30
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-BMTV5ZAO.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-FDPYW25Y.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-2TCFWAAI.js} +9 -9
- package/dist/actions/decorator.js +18 -22
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +3 -2
- package/dist/addon-a11y/manager.js +41 -38
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.d.ts +8 -2
- package/dist/addon-a11y/preview.js +3 -2
- package/dist/addon-comments/manager.js +353 -0
- package/dist/addon-comments/preset.js +80 -0
- package/dist/addon-comments/preview.js +101 -0
- package/dist/addon-docs/blocks.d.ts +123 -85
- package/dist/addon-docs/blocks.js +159 -85
- package/dist/addon-docs/index.d.ts +21 -21
- package/dist/addon-docs/index.js +3 -3
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +12 -12
- package/dist/addon-docs/preview.d.ts +3 -1
- package/dist/addon-docs/preview.js +1 -1
- package/dist/addon-links/index.d.ts +2 -1
- package/dist/addon-links/index.js +5 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +5 -2
- package/dist/addon-links/react/index.js +4 -1
- package/dist/addon-mcp/preset.js +203 -84
- package/dist/addon-mcp/preview.js +1 -1
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +71 -71
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-ondevice-controls/index.js +1 -1
- package/dist/addon-ondevice-controls/register.js +1 -1
- package/dist/addon-pseudo-states/index.d.ts +1 -1
- package/dist/addon-pseudo-states/index.js +1 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-pseudo-states/preview.js +1 -1
- package/dist/addon-themes/index.d.ts +7 -6
- package/dist/addon-themes/index.js +2 -2
- package/dist/addon-themes/manager.js +4 -4
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-themes/preview.js +2 -2
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +32 -23
- package/dist/addon-vitest/node/coverage-reporter.js +11 -11
- package/dist/addon-vitest/node/vitest.js +37 -37
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +26 -26
- package/dist/addon-vitest/vitest-plugin/global-setup.js +23 -23
- package/dist/addon-vitest/vitest-plugin/index.js +83 -73
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.d.ts +241 -995
- package/dist/babel/index.js +30583 -38
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +122 -110
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +201 -0
- package/dist/builder-vite/index.d.ts +8 -3
- package/dist/builder-vite/index.js +80 -25
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +97 -24
- package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-B53gRJBs.d.ts} +838 -703
- package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-BspNQvZn.d.ts} +21 -23
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-CMx6bGAU.d.ts} +2 -2
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-CRmUwbkb.d.ts} +4 -4
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
- package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
- package/dist/chunk-DVIvUVkS.d.ts +195 -0
- package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
- package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
- package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-bhl-7rRD.d.ts} +40 -15
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +15 -904
- package/dist/cli/index.js +49 -5209
- package/dist/cli/skills/content/index.d.ts +3 -3
- package/dist/cli/skills/content/index.js +3 -3
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +4 -4
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.d.ts +20 -21
- package/dist/client-logger/index.js +5 -2
- package/dist/common/index.d.ts +32 -44
- package/dist/common/index.js +89 -98
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +16 -7
- package/dist/core-events/index.js +5 -5
- package/dist/core-server/index.d.ts +95 -26
- package/dist/core-server/index.js +1675 -408
- package/dist/core-server/presets/common-manager.js +837 -1335
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +100 -282
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/csf-utils.d.ts +1 -1
- package/dist/csf/index.d.ts +6 -6
- package/dist/csf/index.js +90 -159
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +19 -17
- package/dist/docs-tools/index.d.ts +332 -16
- package/dist/docs-tools/index.js +3 -3
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.d.ts +5 -5
- package/dist/instrumenter/index.js +31 -19
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
- package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-BJ6EZqH7.js} +1035 -623
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BfXaq_CP.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-BkSn_Jpe.js} +411 -379
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-Cisw9IIE.js} +11 -11
- package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DpvE_zRs.js} +1013 -782
- package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
- package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
- package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
- package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-wV08sCKl.js} +715 -620
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-4OQZWibO.js} +1717 -1536
- package/dist/manager/_manager-chunks/runtime-BYxbyNm0.js +201 -0
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-CM4Z8aKR.js +735 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-Cjo1UL1u.js} +57 -76
- package/dist/manager/_manager-chunks/runtime-Cx1-wr6J.js +294 -0
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-Cxe_uJRb.js} +220 -406
- package/dist/manager/_manager-chunks/runtime-D702FFTO.js +551 -0
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-DnWFp6Zw.js} +8 -534
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DoYPE6g6.js} +232 -158
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-sppa-0ll.js} +741 -698
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +538 -528
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +10 -10
- package/dist/mcp/index.js +11 -11
- package/dist/mocking-utils/index.d.ts +7 -5
- package/dist/mocking-utils/index.js +34 -34
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/next/index.d.ts +231 -0
- package/dist/next/index.js +398 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
- package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
- package/dist/nextjs-vite/index.d.ts +4 -4
- package/dist/nextjs-vite/index.js +10 -5
- package/dist/nextjs-vite/node/index.d.ts +2 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +117 -15
- package/dist/nextjs-vite/preview.d.ts +2 -1
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
- package/dist/nextjs-vite/vite-plugin/index.js +9 -9
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +24 -49
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
- package/dist/node-logger/index.d.ts +89 -90
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +15 -14
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-Cbq5WjbL.js} +772 -418
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-DDEUZops.js} +453 -161
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-DsjyhLpG.js} +397 -176
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-Dwi6NFcX.js} +3 -3
- package/dist/preview/globals.d.ts +10 -10
- package/dist/preview/globals.js +10 -10
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +3 -3
- package/dist/preview-api/index.js +12 -10
- package/dist/preview-errors.d.ts +1 -1
- package/dist/preview-errors.js +2 -2
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview-argtypes.js +1 -1
- package/dist/react/entry-preview-docs.js +1 -1
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.d.ts +9 -11
- package/dist/react/index.js +8 -6
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +5 -4
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +48 -47
- package/dist/react-native/index.js +64 -249
- package/dist/react-native/metro/node.d.ts +3 -3
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
- package/dist/react-native/preview.js +4 -1
- package/dist/react-native/scripts/generate.d.ts +1 -1
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-native/stub.js +1 -1
- package/dist/react-native-theming/index.d.ts +2 -58
- package/dist/react-native-theming/index.js +63 -2338
- package/dist/react-native-ui/index.d.ts +14 -14
- package/dist/react-native-ui/index.js +8 -15
- package/dist/react-native-ui-common/index.d.ts +32 -12
- package/dist/react-native-ui-common/index.js +26 -31
- package/dist/react-vite/index.d.ts +2 -2
- package/dist/react-vite/node/index.d.ts +3 -3
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.d.ts +3 -1
- package/dist/react-vite/preset.js +16 -9
- package/dist/router/index.d.ts +80 -3
- package/dist/router/index.js +66 -12
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +3 -3
- package/dist/shared/open-service/index.js +2 -2
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
- package/dist/telemetry/index.d.ts +38 -274
- package/dist/telemetry/index.js +11 -68
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +765 -511
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +6 -6
- package/dist/theming/index.js +41 -16
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +5 -5
- package/dist/viewport/index.d.ts +1 -1
- package/package.json +69 -69
- package/skills/setup/SKILL.md +14 -0
- package/skills/stories/SKILL.md +21 -0
- package/skills/write-story/SKILL.md +14 -0
- package/template/nextjs-vite/cli/js/Button.jsx +2 -2
- package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
- package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
- package/template/nextjs-vite/cli/js/Header.jsx +1 -1
- package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +3 -3
- package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
- package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
- package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
- package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
- package/template/react/cli/js/Button.jsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.jsx +1 -1
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +3 -3
- package/template/react/cli/js/Page.stories.js +2 -2
- package/template/react/cli/ts/Button.stories.ts +6 -6
- package/template/react/cli/ts/Button.tsx +2 -2
- package/template/react/cli/ts/Header.stories.ts +2 -2
- package/template/react/cli/ts/Header.tsx +1 -1
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +3 -3
- package/template/react-vite/cli/js/Button.jsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.jsx +1 -1
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +3 -3
- package/template/react-vite/cli/js/Page.stories.js +2 -2
- package/template/react-vite/cli/ts/Button.stories.ts +6 -6
- package/template/react-vite/cli/ts/Button.tsx +2 -2
- package/template/react-vite/cli/ts/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Header.tsx +1 -1
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +3 -3
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
- package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
- package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
- package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
- package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
- package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
- package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
- package/dist/_node-chunks/chunk-EHUNOMDD.js +0 -52345
- package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
- package/dist/_node-chunks/chunk-GRBLDJCR.js +0 -989
- package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
- package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
- package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
- package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +0 -92
- package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
- package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
- package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
- package/dist/_node-chunks/chunk-UBOGWBEA.js +0 -148
- package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
- package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
- package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
- package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
- package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
- package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
- package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
- package/dist/chunk-BTVrWliM.d.ts +0 -115
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- package/dist/chunk-DaVb55-_.d.ts +0 -124
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +0 -387
|
@@ -8,23 +8,41 @@ import {
|
|
|
8
8
|
PARAM_KEY as PARAM_KEY5,
|
|
9
9
|
STATUS_TYPE_ID_COMPONENT_TEST
|
|
10
10
|
} from "../../_browser-chunks/chunk-MLBOOZL4.js";
|
|
11
|
-
import "../../_browser-chunks/chunk-OZZPSYQR.js";
|
|
12
11
|
import {
|
|
13
12
|
ArgsTable
|
|
14
|
-
} from "../../_browser-chunks/chunk-
|
|
13
|
+
} from "../../_browser-chunks/chunk-BSYOFSF6.js";
|
|
15
14
|
import "../../_browser-chunks/chunk-PJSMZ27A.js";
|
|
16
|
-
import "../../_browser-chunks/chunk-
|
|
15
|
+
import "../../_browser-chunks/chunk-2WZWS7GJ.js";
|
|
16
|
+
import "../../_browser-chunks/chunk-OZZPSYQR.js";
|
|
17
17
|
import {
|
|
18
18
|
defineService
|
|
19
19
|
} from "../../_browser-chunks/chunk-ZEHRUHTA.js";
|
|
20
20
|
import {
|
|
21
21
|
announce
|
|
22
22
|
} from "../../_browser-chunks/chunk-KBK7GKBN.js";
|
|
23
|
+
import {
|
|
24
|
+
useToolbarRootContext
|
|
25
|
+
} from "../../_browser-chunks/chunk-NPNIBOPF.js";
|
|
23
26
|
import "../../_browser-chunks/chunk-CNED6RYH.js";
|
|
24
27
|
import {
|
|
25
|
-
|
|
28
|
+
CompositeRoot,
|
|
29
|
+
useCompositeItem,
|
|
30
|
+
useControlled
|
|
31
|
+
} from "../../_browser-chunks/chunk-OOETBSA7.js";
|
|
32
|
+
import {
|
|
33
|
+
EMPTY_ARRAY,
|
|
34
|
+
EMPTY_OBJECT,
|
|
35
|
+
createChangeEventDetails,
|
|
36
|
+
error,
|
|
37
|
+
reason_parts_exports,
|
|
38
|
+
useBaseUiId,
|
|
39
|
+
useButton,
|
|
40
|
+
useRenderElement,
|
|
41
|
+
useStableCallback
|
|
42
|
+
} from "../../_browser-chunks/chunk-XTQCLWVH.js";
|
|
43
|
+
import {
|
|
26
44
|
registerService
|
|
27
|
-
} from "../../_browser-chunks/chunk-
|
|
45
|
+
} from "../../_browser-chunks/chunk-HZFHNYRC.js";
|
|
28
46
|
import "../../_browser-chunks/chunk-4ATQOMJB.js";
|
|
29
47
|
import {
|
|
30
48
|
ADDON_ID as ADDON_ID4,
|
|
@@ -40,16 +58,18 @@ import {
|
|
|
40
58
|
require_ansi_to_html,
|
|
41
59
|
resolveViewport
|
|
42
60
|
} from "../../_browser-chunks/chunk-FENFYI4X.js";
|
|
43
|
-
import "../../_browser-chunks/chunk-
|
|
44
|
-
import "../../_browser-chunks/chunk-
|
|
61
|
+
import "../../_browser-chunks/chunk-EW2M3URL.js";
|
|
62
|
+
import "../../_browser-chunks/chunk-PQRPDA4U.js";
|
|
45
63
|
import "../../_browser-chunks/chunk-QC4HFS6K.js";
|
|
46
|
-
import "../../_browser-chunks/chunk-
|
|
64
|
+
import "../../_browser-chunks/chunk-E6QKKKLO.js";
|
|
47
65
|
import {
|
|
48
66
|
mergeServiceArgTypes
|
|
49
|
-
} from "../../_browser-chunks/chunk-
|
|
50
|
-
import "../../_browser-chunks/chunk-
|
|
67
|
+
} from "../../_browser-chunks/chunk-4BOJAE7P.js";
|
|
68
|
+
import "../../_browser-chunks/chunk-PU7D2WDP.js";
|
|
51
69
|
import "../../_browser-chunks/chunk-IE4ULIOQ.js";
|
|
52
|
-
import
|
|
70
|
+
import {
|
|
71
|
+
isEqual
|
|
72
|
+
} from "../../_browser-chunks/chunk-B4AUNNU4.js";
|
|
53
73
|
import "../../_browser-chunks/chunk-NZMVUW5T.js";
|
|
54
74
|
import "../../_browser-chunks/chunk-JWSKPMPC.js";
|
|
55
75
|
import "../../_browser-chunks/chunk-JPUOQJUI.js";
|
|
@@ -59,8 +79,8 @@ import {
|
|
|
59
79
|
PARAM_KEY,
|
|
60
80
|
TOOL_ID
|
|
61
81
|
} from "../../_browser-chunks/chunk-QDXFODK4.js";
|
|
62
|
-
import "../../_browser-chunks/chunk-
|
|
63
|
-
import "../../_browser-chunks/chunk-
|
|
82
|
+
import "../../_browser-chunks/chunk-BNP234B4.js";
|
|
83
|
+
import "../../_browser-chunks/chunk-MJIDTL3X.js";
|
|
64
84
|
import "../../_browser-chunks/chunk-SC67XZST.js";
|
|
65
85
|
import {
|
|
66
86
|
ADDON_ID as ADDON_ID2,
|
|
@@ -68,252 +88,19 @@ import {
|
|
|
68
88
|
EVENT_ID,
|
|
69
89
|
PANEL_ID,
|
|
70
90
|
PARAM_KEY as PARAM_KEY2
|
|
71
|
-
} from "../../_browser-chunks/chunk-
|
|
91
|
+
} from "../../_browser-chunks/chunk-N5WQGLI7.js";
|
|
92
|
+
import {
|
|
93
|
+
global
|
|
94
|
+
} from "../../_browser-chunks/chunk-6AKCRYVX.js";
|
|
72
95
|
import {
|
|
73
96
|
ADDON_ID as ADDON_ID3,
|
|
74
97
|
DEFAULT_BACKGROUNDS,
|
|
75
98
|
PARAM_KEY as PARAM_KEY3
|
|
76
99
|
} from "../../_browser-chunks/chunk-LAWXTSXK.js";
|
|
77
100
|
import {
|
|
78
|
-
__commonJS,
|
|
79
101
|
__toESM
|
|
80
102
|
} from "../../_browser-chunks/chunk-IMSF75WX.js";
|
|
81
103
|
|
|
82
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/extends.js
|
|
83
|
-
var require_extends = __commonJS({
|
|
84
|
-
"../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
|
|
85
|
-
function _extends6() {
|
|
86
|
-
return module.exports = _extends6 = Object.assign || function(target) {
|
|
87
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
88
|
-
var source = arguments[i];
|
|
89
|
-
for (var key in source)
|
|
90
|
-
Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
|
|
91
|
-
}
|
|
92
|
-
return target;
|
|
93
|
-
}, _extends6.apply(this, arguments);
|
|
94
|
-
}
|
|
95
|
-
module.exports = _extends6;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
|
|
100
|
-
var require_objectWithoutPropertiesLoose = __commonJS({
|
|
101
|
-
"../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
|
|
102
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
103
|
-
if (source == null) return {};
|
|
104
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
105
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
106
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
107
|
-
return target;
|
|
108
|
-
}
|
|
109
|
-
module.exports = _objectWithoutPropertiesLoose;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
114
|
-
var require_objectWithoutProperties = __commonJS({
|
|
115
|
-
"../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"(exports, module) {
|
|
116
|
-
var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose();
|
|
117
|
-
function _objectWithoutProperties7(source, excluded) {
|
|
118
|
-
if (source == null) return {};
|
|
119
|
-
var target = objectWithoutPropertiesLoose(source, excluded), key, i;
|
|
120
|
-
if (Object.getOwnPropertySymbols) {
|
|
121
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
122
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
123
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
124
|
-
}
|
|
125
|
-
return target;
|
|
126
|
-
}
|
|
127
|
-
module.exports = _objectWithoutProperties7;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/defineProperty.js
|
|
132
|
-
var require_defineProperty = __commonJS({
|
|
133
|
-
"../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module) {
|
|
134
|
-
function _defineProperty(obj, key, value) {
|
|
135
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
136
|
-
value,
|
|
137
|
-
enumerable: !0,
|
|
138
|
-
configurable: !0,
|
|
139
|
-
writable: !0
|
|
140
|
-
}) : obj[key] = value, obj;
|
|
141
|
-
}
|
|
142
|
-
module.exports = _defineProperty;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
147
|
-
var require_objectSpread2 = __commonJS({
|
|
148
|
-
"../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectSpread2.js"(exports, module) {
|
|
149
|
-
var defineProperty = require_defineProperty();
|
|
150
|
-
function ownKeys(object2, enumerableOnly) {
|
|
151
|
-
var keys = Object.keys(object2);
|
|
152
|
-
if (Object.getOwnPropertySymbols) {
|
|
153
|
-
var symbols = Object.getOwnPropertySymbols(object2);
|
|
154
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
155
|
-
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
156
|
-
})), keys.push.apply(keys, symbols);
|
|
157
|
-
}
|
|
158
|
-
return keys;
|
|
159
|
-
}
|
|
160
|
-
function _objectSpread22(target) {
|
|
161
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
162
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
163
|
-
i % 2 ? ownKeys(source, !0).forEach(function(key) {
|
|
164
|
-
defineProperty(target, key, source[key]);
|
|
165
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) {
|
|
166
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return target;
|
|
170
|
-
}
|
|
171
|
-
module.exports = _objectSpread22;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
|
|
176
|
-
var require_objectWithoutPropertiesLoose2 = __commonJS({
|
|
177
|
-
"../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
|
|
178
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
179
|
-
if (source == null) return {};
|
|
180
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
181
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
182
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
183
|
-
return target;
|
|
184
|
-
}
|
|
185
|
-
module.exports = _objectWithoutPropertiesLoose;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
190
|
-
var require_objectWithoutProperties2 = __commonJS({
|
|
191
|
-
"../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"(exports, module) {
|
|
192
|
-
var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose2();
|
|
193
|
-
function _objectWithoutProperties7(source, excluded) {
|
|
194
|
-
if (source == null) return {};
|
|
195
|
-
var target = objectWithoutPropertiesLoose(source, excluded), key, i;
|
|
196
|
-
if (Object.getOwnPropertySymbols) {
|
|
197
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
198
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
199
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
200
|
-
}
|
|
201
|
-
return target;
|
|
202
|
-
}
|
|
203
|
-
module.exports = _objectWithoutProperties7;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/extends.js
|
|
208
|
-
var require_extends2 = __commonJS({
|
|
209
|
-
"../../node_modules/@devtools-ds/themes/node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
|
|
210
|
-
function _extends6() {
|
|
211
|
-
return module.exports = _extends6 = Object.assign || function(target) {
|
|
212
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
213
|
-
var source = arguments[i];
|
|
214
|
-
for (var key in source)
|
|
215
|
-
Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
|
|
216
|
-
}
|
|
217
|
-
return target;
|
|
218
|
-
}, _extends6.apply(this, arguments);
|
|
219
|
-
}
|
|
220
|
-
module.exports = _extends6;
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/defineProperty.js
|
|
225
|
-
var require_defineProperty2 = __commonJS({
|
|
226
|
-
"../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module) {
|
|
227
|
-
function _defineProperty(obj, key, value) {
|
|
228
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
229
|
-
value,
|
|
230
|
-
enumerable: !0,
|
|
231
|
-
configurable: !0,
|
|
232
|
-
writable: !0
|
|
233
|
-
}) : obj[key] = value, obj;
|
|
234
|
-
}
|
|
235
|
-
module.exports = _defineProperty;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
240
|
-
var require_objectSpread22 = __commonJS({
|
|
241
|
-
"../../node_modules/@devtools-ds/object-inspector/node_modules/@babel/runtime/helpers/objectSpread2.js"(exports, module) {
|
|
242
|
-
var defineProperty = require_defineProperty2();
|
|
243
|
-
function ownKeys(object2, enumerableOnly) {
|
|
244
|
-
var keys = Object.keys(object2);
|
|
245
|
-
if (Object.getOwnPropertySymbols) {
|
|
246
|
-
var symbols = Object.getOwnPropertySymbols(object2);
|
|
247
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
248
|
-
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
249
|
-
})), keys.push.apply(keys, symbols);
|
|
250
|
-
}
|
|
251
|
-
return keys;
|
|
252
|
-
}
|
|
253
|
-
function _objectSpread22(target) {
|
|
254
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
255
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
256
|
-
i % 2 ? ownKeys(source, !0).forEach(function(key) {
|
|
257
|
-
defineProperty(target, key, source[key]);
|
|
258
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) {
|
|
259
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
return target;
|
|
263
|
-
}
|
|
264
|
-
module.exports = _objectSpread22;
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
// ../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/extends.js
|
|
269
|
-
var require_extends3 = __commonJS({
|
|
270
|
-
"../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
|
|
271
|
-
function _extends6() {
|
|
272
|
-
return module.exports = _extends6 = Object.assign || function(target) {
|
|
273
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
274
|
-
var source = arguments[i];
|
|
275
|
-
for (var key in source)
|
|
276
|
-
Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
|
|
277
|
-
}
|
|
278
|
-
return target;
|
|
279
|
-
}, _extends6.apply(this, arguments);
|
|
280
|
-
}
|
|
281
|
-
module.exports = _extends6;
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
// ../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
|
|
286
|
-
var require_objectWithoutPropertiesLoose3 = __commonJS({
|
|
287
|
-
"../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
|
|
288
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
289
|
-
if (source == null) return {};
|
|
290
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
291
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
292
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
293
|
-
return target;
|
|
294
|
-
}
|
|
295
|
-
module.exports = _objectWithoutPropertiesLoose;
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
// ../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
300
|
-
var require_objectWithoutProperties3 = __commonJS({
|
|
301
|
-
"../../node_modules/@devtools-ds/tree/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"(exports, module) {
|
|
302
|
-
var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose3();
|
|
303
|
-
function _objectWithoutProperties7(source, excluded) {
|
|
304
|
-
if (source == null) return {};
|
|
305
|
-
var target = objectWithoutPropertiesLoose(source, excluded), key, i;
|
|
306
|
-
if (Object.getOwnPropertySymbols) {
|
|
307
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
308
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
309
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
310
|
-
}
|
|
311
|
-
return target;
|
|
312
|
-
}
|
|
313
|
-
module.exports = _objectWithoutProperties7;
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
|
|
317
104
|
// src/shared/open-service/services/docgen/manager.tsx
|
|
318
105
|
import { addons } from "@aussieljk/forkbook/manager-api";
|
|
319
106
|
var ADDON_ID7 = "core/docgen", manager_default = addons.register(ADDON_ID7, () => {
|
|
@@ -427,7 +214,7 @@ var ADDON_ID8 = "core/review", manager_default2 = addons2.register(ADDON_ID8, ()
|
|
|
427
214
|
// src/controls/manager.tsx
|
|
428
215
|
import { AddonPanel } from "@aussieljk/forkbook/internal/components";
|
|
429
216
|
import { SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE } from "@aussieljk/forkbook/internal/core-events";
|
|
430
|
-
import {
|
|
217
|
+
import { CircleCheckIcon, CircleXIcon } from "lucide-react";
|
|
431
218
|
import {
|
|
432
219
|
addons as addons3,
|
|
433
220
|
experimental_requestResponse,
|
|
@@ -439,7 +226,6 @@ import { color } from "@aussieljk/forkbook/theming";
|
|
|
439
226
|
// src/controls/components/ControlsPanel.tsx
|
|
440
227
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
441
228
|
import { STORY_FINISHED, STORY_PREPARED } from "@aussieljk/forkbook/internal/core-events";
|
|
442
|
-
import { global } from "@storybook/global";
|
|
443
229
|
import {
|
|
444
230
|
useArgTypes,
|
|
445
231
|
useArgs,
|
|
@@ -457,15 +243,15 @@ var ADDON_ID9 = "addon-controls", PARAM_KEY6 = "controls";
|
|
|
457
243
|
// src/controls/components/SaveStory.tsx
|
|
458
244
|
import React from "react";
|
|
459
245
|
import { Bar, Button, Form, Modal } from "@aussieljk/forkbook/internal/components";
|
|
460
|
-
import {
|
|
246
|
+
import { RotateCcwIcon, CheckIcon, PlusIcon } from "lucide-react";
|
|
461
247
|
|
|
462
|
-
//
|
|
248
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/controls/components/SaveStory.module.css
|
|
463
249
|
var id = "core/src/controls/components/SaveStory.module.css";
|
|
464
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
250
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id}"]`)) {
|
|
465
251
|
let style = document.createElement("style");
|
|
466
|
-
style.setAttribute("data-
|
|
252
|
+
style.setAttribute("data-fb-css", id), style.textContent = ".fb-zEgyLq-container{z-index:1;width:100%;height:41px;position:absolute;bottom:0;overflow:hidden;container-type:size}.fb-zEgyLq-bar{--highlight-bg-color:#e0f0ff;background:var(--fb-background-bar);border-top:1px solid var(--fb-app-border-color);font-size:var(--fb-size-s2);padding-inline:4px;animation:.3s fb-zEgyLq-slideIn,2s fb-zEgyLq-highlight;@container (width<=799px){flex-direction:row;justify-content:flex-end}}:where([data-fb-theme=dark]) .fb-zEgyLq-bar{--highlight-bg-color:#153b5b}.fb-zEgyLq-info{flex:99 0 auto;align-items:center;gap:6px;margin-inline:7px 10px;display:flex}.fb-zEgyLq-actions{color:var(--fb-text-muted-color);font-size:var(--fb-size-s2);flex:1 0 0;align-items:center;gap:2px;display:flex}.fb-zEgyLq-label{@container (width<=799px){text-indent:-9999px;line-height:0;&:after{content:attr(data-short-label);line-height:initial;text-indent:0;display:block}}}.fb-zEgyLq-modalInput{&::placeholder{color:var(--fb-color-mediumdark)}&:invalid:not(:placeholder-shown){box-shadow:var(--fb-color-negative) 0 0 0 1px inset}}@keyframes fb-zEgyLq-slideIn{0%{transform:translateY(40px)}to{transform:translateY(0)}}@keyframes fb-zEgyLq-highlight{0%{background:var(--highlight-bg-color)}}", document.head.appendChild(style);
|
|
467
253
|
}
|
|
468
|
-
var SaveStory_default = {
|
|
254
|
+
var SaveStory_default = { highlight: "fb-zEgyLq-highlight", label: "fb-zEgyLq-label", info: "fb-zEgyLq-info", modalInput: "fb-zEgyLq-modalInput", bar: "fb-zEgyLq-bar", actions: "fb-zEgyLq-actions", container: "fb-zEgyLq-container", slideIn: "fb-zEgyLq-slideIn" };
|
|
469
255
|
|
|
470
256
|
// src/controls/components/SaveStory.tsx
|
|
471
257
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -502,11 +288,11 @@ var SaveStory = ({ saveStory, createStory, resetArgs }) => {
|
|
|
502
288
|
jsx("div", { className: SaveStory_default.label, "data-short-label": "Save", children: "Update story" })
|
|
503
289
|
] }),
|
|
504
290
|
jsxs(Button, { ariaLabel: createLabel, tooltip: createLabel, onClick: onShowForm, children: [
|
|
505
|
-
jsx(
|
|
291
|
+
jsx(PlusIcon, {}),
|
|
506
292
|
jsx("div", { className: SaveStory_default.label, "data-short-label": "New", children: "Create new story" })
|
|
507
293
|
] }),
|
|
508
294
|
jsxs(Button, { ariaLabel: "Reset changes", onClick: () => resetArgs(), children: [
|
|
509
|
-
jsx(
|
|
295
|
+
jsx(RotateCcwIcon, {}),
|
|
510
296
|
jsx("span", { children: "Reset" })
|
|
511
297
|
] })
|
|
512
298
|
] }),
|
|
@@ -550,13 +336,13 @@ var SaveStory = ({ saveStory, createStory, resetArgs }) => {
|
|
|
550
336
|
) });
|
|
551
337
|
};
|
|
552
338
|
|
|
553
|
-
//
|
|
339
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/controls/components/ControlsPanel.module.css
|
|
554
340
|
var id2 = "core/src/controls/components/ControlsPanel.module.css";
|
|
555
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
341
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id2}"]`)) {
|
|
556
342
|
let style = document.createElement("style");
|
|
557
|
-
style.setAttribute("data-
|
|
343
|
+
style.setAttribute("data-fb-css", id2), style.textContent = ".fb-yARkZG-wrapper{background-color:var(--fb-background-content);min-height:100%;padding-bottom:0;&[data-save-from-ui]{padding-bottom:41px}& table{background-color:var(--fb-background-app)}}", document.head.appendChild(style);
|
|
558
344
|
}
|
|
559
|
-
var ControlsPanel_default = { wrapper: "
|
|
345
|
+
var ControlsPanel_default = { wrapper: "fb-yARkZG-wrapper" };
|
|
560
346
|
|
|
561
347
|
// src/controls/components/ControlsPanel.tsx
|
|
562
348
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -582,7 +368,7 @@ function ControlsPanelTable({
|
|
|
582
368
|
presetColors,
|
|
583
369
|
disableSaveFromUI = !1
|
|
584
370
|
} = useParameter(PARAM_KEY6, {}), { path } = useStorybookState(), storyData = useStorybookApi().getCurrentStoryData(), hasControls = hasAnyControl(rows), withPresetColors = applyPresetColors(rows, presetColors), hasUpdatedArgs = useMemo(
|
|
585
|
-
() => !!args && !!initialArgs && !
|
|
371
|
+
() => !!args && !!initialArgs && !isEqual(clean(args), clean(initialArgs)),
|
|
586
372
|
[args, initialArgs]
|
|
587
373
|
), showSaveFromUI = hasControls && storyData.type === "story" && storyData.subtype !== "test" && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== !0;
|
|
588
374
|
return jsxs2("div", { className: ControlsPanel_default.wrapper, "data-save-from-ui": showSaveFromUI || void 0, children: [
|
|
@@ -612,10 +398,10 @@ function LegacyControlsPanel(props) {
|
|
|
612
398
|
}
|
|
613
399
|
function DocgenQuery({
|
|
614
400
|
docgenService,
|
|
615
|
-
id:
|
|
401
|
+
id: id14,
|
|
616
402
|
onChange
|
|
617
403
|
}) {
|
|
618
|
-
let { data, isInitialLoading } = useServiceQuery(docgenService.queries.docgen, { id:
|
|
404
|
+
let { data, isInitialLoading } = useServiceQuery(docgenService.queries.docgen, { id: id14 });
|
|
619
405
|
return useEffect(() => {
|
|
620
406
|
onChange({ payload: data, isInitialLoading });
|
|
621
407
|
}, [data, isInitialLoading, onChange]), null;
|
|
@@ -635,10 +421,10 @@ function ServiceControlsPanel({
|
|
|
635
421
|
docgenService,
|
|
636
422
|
...props
|
|
637
423
|
}) {
|
|
638
|
-
let storyData = useStorybookApi().getCurrentStoryData(), [, , , initialArgs] = useArgs(), customArgTypes = useArgTypes(),
|
|
639
|
-
(state) => setDocgen({ id:
|
|
640
|
-
[
|
|
641
|
-
), current = queryReady && docgen?.id ===
|
|
424
|
+
let storyData = useStorybookApi().getCurrentStoryData(), [, , , initialArgs] = useArgs(), customArgTypes = useArgTypes(), id14 = storyData.id.split("--")[0], isStory = storyData.type === "story", isStoryPrepared = !(global.CONFIG_TYPE === "DEVELOPMENT") || (isStory ? storyData.prepared : !0), gateReady = useStoryDocgenGateReady(storyData.id), queryReady = !isStory || gateReady, [docgen, setDocgen] = useState(), onDocgenChange = useCallback(
|
|
425
|
+
(state) => setDocgen({ id: id14, ...state }),
|
|
426
|
+
[id14]
|
|
427
|
+
), current = queryReady && docgen?.id === id14 ? docgen : void 0, docgenPayload = current?.payload, docgenResolved = !!current && !current.isInitialLoading, rows = useMemo(
|
|
642
428
|
() => docgenResolved ? mergeServiceArgTypes({
|
|
643
429
|
payload: docgenPayload,
|
|
644
430
|
storyId: storyData.id,
|
|
@@ -649,7 +435,7 @@ function ServiceControlsPanel({
|
|
|
649
435
|
[docgenResolved, docgenPayload, initialArgs, storyData.id, storyData.parameters, customArgTypes]
|
|
650
436
|
), isDocgenLoading = !docgenResolved;
|
|
651
437
|
return jsxs2(Fragment, { children: [
|
|
652
|
-
queryReady && jsx2(DocgenQuery, { docgenService, id:
|
|
438
|
+
queryReady && jsx2(DocgenQuery, { docgenService, id: id14, onChange: onDocgenChange }),
|
|
653
439
|
jsx2(
|
|
654
440
|
ControlsPanelTable,
|
|
655
441
|
{
|
|
@@ -687,8 +473,14 @@ async function trySelectStory(selectStory, storyId, attempt = 1) {
|
|
|
687
473
|
}
|
|
688
474
|
}
|
|
689
475
|
|
|
476
|
+
// src/manager/utils/visible-panels.ts
|
|
477
|
+
var hasControllableArgs = (story) => story.prepared ? Object.values(story.argTypes ?? {}).some((argType) => {
|
|
478
|
+
let { control, table } = argType;
|
|
479
|
+
return table?.disable || !control ? !1 : !(typeof control == "object" && control.disable);
|
|
480
|
+
}) : !0;
|
|
481
|
+
|
|
690
482
|
// src/controls/stringifyArgs.tsx
|
|
691
|
-
var stringifyArgs = (args) => JSON.stringify(args, (_, value) => typeof value == "function" ? "
|
|
483
|
+
var stringifyArgs = (args) => JSON.stringify(args, (_, value) => typeof value == "function" ? "__fb_empty_function_arg__" : value);
|
|
692
484
|
|
|
693
485
|
// src/controls/manager.tsx
|
|
694
486
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -702,14 +494,14 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
702
494
|
let response = await experimental_requestResponse(channel, SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE, {
|
|
703
495
|
// Only send updated args
|
|
704
496
|
args: stringifyArgs(
|
|
705
|
-
Object.entries(data.args || {}).reduce((acc, [key, value]) => (
|
|
497
|
+
Object.entries(data.args || {}).reduce((acc, [key, value]) => (isEqual(value, data.initialArgs?.[key]) || (acc[key] = value), acc), {})
|
|
706
498
|
),
|
|
707
499
|
csfId: data.id,
|
|
708
500
|
importPath: data.importPath
|
|
709
501
|
});
|
|
710
502
|
api.addNotification({
|
|
711
503
|
id: "save-story-success",
|
|
712
|
-
icon: jsx4(
|
|
504
|
+
icon: jsx4(CircleCheckIcon, { color: color.positive }),
|
|
713
505
|
content: {
|
|
714
506
|
headline: "Story saved",
|
|
715
507
|
subHeadline: jsxs4(Fragment2, { children: [
|
|
@@ -720,16 +512,16 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
720
512
|
},
|
|
721
513
|
duration: 8e3
|
|
722
514
|
});
|
|
723
|
-
} catch (
|
|
515
|
+
} catch (error2) {
|
|
724
516
|
throw api.addNotification({
|
|
725
517
|
id: "save-story-error",
|
|
726
|
-
icon: jsx4(
|
|
518
|
+
icon: jsx4(CircleXIcon, { color: color.negative }),
|
|
727
519
|
content: {
|
|
728
520
|
headline: "Failed to save story",
|
|
729
|
-
subHeadline:
|
|
521
|
+
subHeadline: error2?.message || "Check the Forkbook process on the command line for more details."
|
|
730
522
|
},
|
|
731
523
|
duration: 8e3
|
|
732
|
-
}),
|
|
524
|
+
}), error2;
|
|
733
525
|
}
|
|
734
526
|
}, createStory = async (name) => {
|
|
735
527
|
let data = api.getCurrentStoryData();
|
|
@@ -743,7 +535,7 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
743
535
|
});
|
|
744
536
|
api.addNotification({
|
|
745
537
|
id: "save-story-success",
|
|
746
|
-
icon: jsx4(
|
|
538
|
+
icon: jsx4(CircleCheckIcon, { color: color.positive }),
|
|
747
539
|
content: {
|
|
748
540
|
headline: "Story created",
|
|
749
541
|
subHeadline: jsxs4(Fragment2, { children: [
|
|
@@ -764,6 +556,8 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
764
556
|
title: Title,
|
|
765
557
|
type: types.PANEL,
|
|
766
558
|
paramKey: PARAM_KEY6,
|
|
559
|
+
// Hide the tab when the story has no arg that a control can change.
|
|
560
|
+
disabled: (_parameters, story) => story ? !hasControllableArgs(story) : !1,
|
|
767
561
|
render: ({ active }) => !active || !api.getCurrentStoryData() ? null : jsx4(AddonPanel, { active, hasHorizontalScrollbar: !0, hasScrollbar: !0, children: jsx4(
|
|
768
562
|
ControlsPanel,
|
|
769
563
|
{
|
|
@@ -818,7 +612,7 @@ import { useParameter as useParameter2 } from "@aussieljk/forkbook/manager-api";
|
|
|
818
612
|
import { Fragment as Fragment3, useEffect as useEffect2, useRef } from "react";
|
|
819
613
|
import { ActionBar, ScrollArea } from "@aussieljk/forkbook/internal/components";
|
|
820
614
|
|
|
821
|
-
// ../../node_modules/react-inspector/dist/index.
|
|
615
|
+
// ../../node_modules/react-inspector/dist/index.js
|
|
822
616
|
import React9 from "react";
|
|
823
617
|
import React3, { useContext as useContext2, useCallback as useCallback2, useLayoutEffect, useState as useState2, memo as memo2 } from "react";
|
|
824
618
|
import { createContext } from "react";
|
|
@@ -836,24 +630,31 @@ import React11, { useCallback as useCallback22, useState as useState22 } from "r
|
|
|
836
630
|
import React15 from "react";
|
|
837
631
|
import React14 from "react";
|
|
838
632
|
import React16 from "react";
|
|
839
|
-
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty,
|
|
633
|
+
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
|
|
840
634
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
841
|
-
}, __export = (target,
|
|
842
|
-
for (var name in
|
|
843
|
-
__defProp(target, name, { get:
|
|
635
|
+
}, __export = (target, all) => {
|
|
636
|
+
for (var name in all)
|
|
637
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
844
638
|
}, __copyProps = (to, from, except, desc) => {
|
|
845
639
|
if (from && typeof from == "object" || typeof from == "function")
|
|
846
640
|
for (let key of __getOwnPropNames(from))
|
|
847
641
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
848
642
|
return to;
|
|
849
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
643
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
644
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
645
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
646
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
647
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
648
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
649
|
+
mod
|
|
650
|
+
)), require_is_object = __commonJS({
|
|
850
651
|
"node_modules/is-object/index.js"(exports, module) {
|
|
851
652
|
"use strict";
|
|
852
653
|
module.exports = function(x) {
|
|
853
654
|
return typeof x == "object" && x !== null;
|
|
854
655
|
};
|
|
855
656
|
}
|
|
856
|
-
}), require_is_window =
|
|
657
|
+
}), require_is_window = __commonJS({
|
|
857
658
|
"node_modules/is-window/index.js"(exports, module) {
|
|
858
659
|
"use strict";
|
|
859
660
|
module.exports = function(obj) {
|
|
@@ -863,11 +664,12 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
863
664
|
return o === o.window;
|
|
864
665
|
};
|
|
865
666
|
}
|
|
866
|
-
}), require_is_dom =
|
|
667
|
+
}), require_is_dom = __commonJS({
|
|
867
668
|
"node_modules/is-dom/index.js"(exports, module) {
|
|
868
|
-
|
|
669
|
+
"use strict";
|
|
670
|
+
var isObject = require_is_object(), isWindow = require_is_window();
|
|
869
671
|
function isNode(val) {
|
|
870
|
-
return !
|
|
672
|
+
return !isObject(val) || !isWindow(window) || typeof window.Node != "function" ? !1 : typeof val.nodeType == "number" && typeof val.nodeName == "string";
|
|
871
673
|
}
|
|
872
674
|
module.exports = isNode;
|
|
873
675
|
}
|
|
@@ -912,6 +714,7 @@ var theme = {
|
|
|
912
714
|
TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
|
|
913
715
|
TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
|
|
914
716
|
TABLE_SORT_ICON_COLOR: "black",
|
|
717
|
+
//'rgb(48, 57, 66)',
|
|
915
718
|
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
|
|
916
719
|
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
917
720
|
}, theme2 = {
|
|
@@ -983,6 +786,7 @@ var theme = {
|
|
|
983
786
|
color: theme3.HTML_TAG_COLOR
|
|
984
787
|
},
|
|
985
788
|
offsetLeft: {
|
|
789
|
+
/* hack: offset placeholder */
|
|
986
790
|
marginLeft: -theme3.TREENODE_PADDING_LEFT
|
|
987
791
|
},
|
|
988
792
|
tagName: {
|
|
@@ -1074,6 +878,7 @@ var theme = {
|
|
|
1074
878
|
base: {
|
|
1075
879
|
color: theme3.ARROW_COLOR,
|
|
1076
880
|
display: "inline-block",
|
|
881
|
+
// lineHeight: '14px',
|
|
1077
882
|
fontSize: theme3.ARROW_FONT_SIZE,
|
|
1078
883
|
marginRight: theme3.ARROW_MARGIN_RIGHT,
|
|
1079
884
|
...parseFloat(theme3.ARROW_ANIMATION_DURATION) > 0 ? {
|
|
@@ -1094,6 +899,7 @@ var theme = {
|
|
|
1094
899
|
},
|
|
1095
900
|
treeNodeChildNodesContainer: {
|
|
1096
901
|
margin: 0,
|
|
902
|
+
// reset user-agent style
|
|
1097
903
|
paddingLeft: theme3.TREENODE_PADDING_LEFT
|
|
1098
904
|
}
|
|
1099
905
|
},
|
|
@@ -1133,7 +939,9 @@ var theme = {
|
|
|
1133
939
|
td: {
|
|
1134
940
|
boxSizing: "border-box",
|
|
1135
941
|
border: "none",
|
|
942
|
+
// prevent overrides
|
|
1136
943
|
height: "16px",
|
|
944
|
+
// /* 0.5 * table.background-size height */
|
|
1137
945
|
verticalAlign: "top",
|
|
1138
946
|
padding: "1px 4px",
|
|
1139
947
|
WebkitUserSelect: "text",
|
|
@@ -1160,11 +968,14 @@ var theme = {
|
|
|
1160
968
|
bottom: 0,
|
|
1161
969
|
borderTop: "0 none transparent",
|
|
1162
970
|
margin: 0,
|
|
971
|
+
// prevent user agent stylesheet overrides
|
|
1163
972
|
backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
|
|
1164
973
|
backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
|
|
1165
974
|
tableLayout: "fixed",
|
|
975
|
+
// table
|
|
1166
976
|
borderSpacing: 0,
|
|
1167
977
|
borderCollapse: "separate",
|
|
978
|
+
// height: '100%',
|
|
1168
979
|
width: "100%",
|
|
1169
980
|
fontSize: theme3.BASE_FONT_SIZE,
|
|
1170
981
|
lineHeight: "120%"
|
|
@@ -1173,6 +984,7 @@ var theme = {
|
|
|
1173
984
|
TableInspectorTH: {
|
|
1174
985
|
base: {
|
|
1175
986
|
position: "relative",
|
|
987
|
+
// anchor for sort icon container
|
|
1176
988
|
height: "auto",
|
|
1177
989
|
textAlign: "left",
|
|
1178
990
|
backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
|
|
@@ -1192,6 +1004,7 @@ var theme = {
|
|
|
1192
1004
|
whiteSpace: "nowrap",
|
|
1193
1005
|
textOverflow: "ellipsis",
|
|
1194
1006
|
overflow: "hidden",
|
|
1007
|
+
// prevent user agent stylesheet overrides
|
|
1195
1008
|
fontSize: theme3.BASE_FONT_SIZE,
|
|
1196
1009
|
lineHeight: "120%"
|
|
1197
1010
|
}
|
|
@@ -1207,11 +1020,13 @@ var theme = {
|
|
|
1207
1020
|
TableInspectorSortIcon: {
|
|
1208
1021
|
display: "block",
|
|
1209
1022
|
marginRight: 3,
|
|
1023
|
+
// 4,
|
|
1210
1024
|
width: 8,
|
|
1211
1025
|
height: 7,
|
|
1212
1026
|
marginTop: -7,
|
|
1213
1027
|
color: theme3.TABLE_SORT_ICON_COLOR,
|
|
1214
1028
|
fontSize: 12,
|
|
1029
|
+
// lineHeight: 14
|
|
1215
1030
|
...unselectable
|
|
1216
1031
|
}
|
|
1217
1032
|
}), DEFAULT_THEME_NAME = "chromeLight", ThemeContext = createContext2(createTheme(themes_exports[DEFAULT_THEME_NAME])), useStyles = (baseStylesKey) => useContext(ThemeContext)[baseStylesKey], themeAcceptor = (WrappedComponent) => ({ theme: theme3 = DEFAULT_THEME_NAME, ...restProps }) => {
|
|
@@ -1225,17 +1040,17 @@ var theme = {
|
|
|
1225
1040
|
return createTheme(themes_exports[DEFAULT_THEME_NAME]);
|
|
1226
1041
|
}
|
|
1227
1042
|
}, [theme3]);
|
|
1228
|
-
return React4.createElement(ThemeContext.Provider, {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1043
|
+
return React4.createElement(ThemeContext.Provider, { value: themeStyles }, React4.createElement(WrappedComponent, { ...restProps }));
|
|
1044
|
+
}, Arrow = ({ expanded, styles }) => React22.createElement(
|
|
1045
|
+
"span",
|
|
1046
|
+
{
|
|
1047
|
+
style: {
|
|
1048
|
+
...styles.base,
|
|
1049
|
+
...expanded ? styles.expanded : styles.collapsed
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
"\u25B6"
|
|
1053
|
+
), TreeNode = memo((props) => {
|
|
1239
1054
|
props = {
|
|
1240
1055
|
expanded: !0,
|
|
1241
1056
|
nodeRenderer: ({ name }) => React22.createElement("span", null, name),
|
|
@@ -1246,30 +1061,15 @@ var theme = {
|
|
|
1246
1061
|
...props
|
|
1247
1062
|
};
|
|
1248
1063
|
let { expanded, onClick, children, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props, styles = useStyles("TreeNode"), NodeRenderer = nodeRenderer;
|
|
1249
|
-
return React22.createElement("li", {
|
|
1250
|
-
"aria-expanded": expanded,
|
|
1251
|
-
role: "treeitem",
|
|
1252
|
-
style: styles.treeNodeBase,
|
|
1253
|
-
title
|
|
1254
|
-
}, React22.createElement("div", {
|
|
1255
|
-
style: styles.treeNodePreviewContainer,
|
|
1256
|
-
onClick
|
|
1257
|
-
}, shouldShowArrow || Children.count(children) > 0 ? React22.createElement(Arrow, {
|
|
1258
|
-
expanded,
|
|
1259
|
-
styles: styles.treeNodeArrow
|
|
1260
|
-
}) : shouldShowPlaceholder && React22.createElement("span", {
|
|
1261
|
-
style: styles.treeNodePlaceholder
|
|
1262
|
-
}, "\xA0"), React22.createElement(NodeRenderer, {
|
|
1263
|
-
...props
|
|
1264
|
-
})), React22.createElement("ol", {
|
|
1265
|
-
role: "group",
|
|
1266
|
-
style: styles.treeNodeChildNodesContainer
|
|
1267
|
-
}, expanded ? children : void 0));
|
|
1064
|
+
return React22.createElement("li", { "aria-expanded": expanded, role: "treeitem", style: styles.treeNodeBase, title }, React22.createElement("div", { style: styles.treeNodePreviewContainer, onClick }, shouldShowArrow || Children.count(children) > 0 ? React22.createElement(Arrow, { expanded, styles: styles.treeNodeArrow }) : shouldShowPlaceholder && React22.createElement("span", { style: styles.treeNodePlaceholder }, "\xA0"), React22.createElement(NodeRenderer, { ...props })), React22.createElement("ol", { role: "group", style: styles.treeNodeChildNodesContainer }, expanded ? children : void 0));
|
|
1268
1065
|
}), DEFAULT_ROOT_PATH = "$", WILDCARD = "*";
|
|
1269
1066
|
function hasChildNodes(data, dataIterator) {
|
|
1270
1067
|
return !dataIterator(data).next().done;
|
|
1271
1068
|
}
|
|
1272
|
-
var wildcardPathsFromLevel = (level) => Array.from(
|
|
1069
|
+
var wildcardPathsFromLevel = (level) => Array.from(
|
|
1070
|
+
{ length: level },
|
|
1071
|
+
(_, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join(".")
|
|
1072
|
+
), getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
|
|
1273
1073
|
let wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path) => typeof path == "string"), expandedPaths = [];
|
|
1274
1074
|
return wildcardPaths.forEach((wildcardPath) => {
|
|
1275
1075
|
let keyPaths = wildcardPath.split("."), populatePaths = (curData, curPath, depth) => {
|
|
@@ -1289,92 +1089,87 @@ var wildcardPathsFromLevel = (level) => Array.from({ length: level }, (_, i) =>
|
|
|
1289
1089
|
}
|
|
1290
1090
|
};
|
|
1291
1091
|
populatePaths(data, "", 0);
|
|
1292
|
-
}), expandedPaths.reduce(
|
|
1092
|
+
}), expandedPaths.reduce(
|
|
1093
|
+
(obj, path) => (obj[path] = !0, obj),
|
|
1094
|
+
{ ...prevExpandedPaths }
|
|
1095
|
+
);
|
|
1293
1096
|
}, ConnectedTreeNode = memo2((props) => {
|
|
1294
|
-
let { data, dataIterator, path, depth, nodeRenderer } = props, [expandedPaths, setExpandedPaths] = useContext2(ExpandedPathsContext), nodeHasChildNodes = hasChildNodes(data, dataIterator), expanded = !!expandedPaths[path], handleClick = useCallback2(
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
expanded
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1097
|
+
let { data, dataIterator, path, depth, nodeRenderer } = props, [expandedPaths, setExpandedPaths] = useContext2(ExpandedPathsContext), nodeHasChildNodes = hasChildNodes(data, dataIterator), expanded = !!expandedPaths[path], handleClick = useCallback2(
|
|
1098
|
+
() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
|
|
1099
|
+
...prevExpandedPaths,
|
|
1100
|
+
[path]: !expanded
|
|
1101
|
+
})),
|
|
1102
|
+
[nodeHasChildNodes, setExpandedPaths, path, expanded]
|
|
1103
|
+
);
|
|
1104
|
+
return React3.createElement(
|
|
1105
|
+
TreeNode,
|
|
1106
|
+
{
|
|
1107
|
+
expanded,
|
|
1108
|
+
onClick: handleClick,
|
|
1109
|
+
shouldShowArrow: nodeHasChildNodes,
|
|
1110
|
+
shouldShowPlaceholder: depth > 0,
|
|
1111
|
+
nodeRenderer,
|
|
1112
|
+
...props
|
|
1113
|
+
},
|
|
1114
|
+
// only render if the node is expanded
|
|
1115
|
+
expanded ? [...dataIterator(data)].map(({ name, data: data2, ...renderNodeProps }) => React3.createElement(
|
|
1116
|
+
ConnectedTreeNode,
|
|
1117
|
+
{
|
|
1118
|
+
name,
|
|
1119
|
+
data: data2,
|
|
1120
|
+
depth: depth + 1,
|
|
1121
|
+
path: `${path}.${name}`,
|
|
1122
|
+
key: name,
|
|
1123
|
+
dataIterator,
|
|
1124
|
+
nodeRenderer,
|
|
1125
|
+
...renderNodeProps
|
|
1126
|
+
}
|
|
1127
|
+
)) : null
|
|
1128
|
+
);
|
|
1315
1129
|
}), TreeView = memo2(({ name, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
|
|
1316
1130
|
let styles = useStyles("TreeView"), stateAndSetter = useState2({}), [, setExpandedPaths] = stateAndSetter;
|
|
1317
|
-
return useLayoutEffect(
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
}, React3.createElement(
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1131
|
+
return useLayoutEffect(
|
|
1132
|
+
() => setExpandedPaths(
|
|
1133
|
+
(prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)
|
|
1134
|
+
),
|
|
1135
|
+
[data, dataIterator, expandPaths, expandLevel]
|
|
1136
|
+
), React3.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, React3.createElement("ol", { role: "tree", style: styles.treeViewOutline }, React3.createElement(
|
|
1137
|
+
ConnectedTreeNode,
|
|
1138
|
+
{
|
|
1139
|
+
name,
|
|
1140
|
+
data,
|
|
1141
|
+
dataIterator,
|
|
1142
|
+
depth: 0,
|
|
1143
|
+
path: DEFAULT_ROOT_PATH,
|
|
1144
|
+
nodeRenderer
|
|
1145
|
+
}
|
|
1146
|
+
)));
|
|
1330
1147
|
}), ObjectName = ({ name, dimmed = !1, styles = {} }) => {
|
|
1331
1148
|
let themeStyles = useStyles("ObjectName"), appliedStyles = {
|
|
1332
1149
|
...themeStyles.base,
|
|
1333
1150
|
...dimmed ? themeStyles.dimmed : {},
|
|
1334
1151
|
...styles
|
|
1335
1152
|
};
|
|
1336
|
-
return React42.createElement("span", {
|
|
1337
|
-
style: appliedStyles
|
|
1338
|
-
}, name);
|
|
1153
|
+
return React42.createElement("span", { style: appliedStyles }, name);
|
|
1339
1154
|
}, ObjectValue = ({ object: object2, styles }) => {
|
|
1340
1155
|
let themeStyles = useStyles("ObjectValue"), mkStyle = (key) => ({ ...themeStyles[key], ...styles });
|
|
1341
1156
|
switch (typeof object2) {
|
|
1342
1157
|
case "bigint":
|
|
1343
|
-
return React5.createElement("span", {
|
|
1344
|
-
style: mkStyle("objectValueNumber")
|
|
1345
|
-
}, String(object2), "n");
|
|
1158
|
+
return React5.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2), "n");
|
|
1346
1159
|
case "number":
|
|
1347
|
-
return React5.createElement("span", {
|
|
1348
|
-
style: mkStyle("objectValueNumber")
|
|
1349
|
-
}, String(object2));
|
|
1160
|
+
return React5.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2));
|
|
1350
1161
|
case "string":
|
|
1351
|
-
return React5.createElement("span", {
|
|
1352
|
-
style: mkStyle("objectValueString")
|
|
1353
|
-
}, '"', object2, '"');
|
|
1162
|
+
return React5.createElement("span", { style: mkStyle("objectValueString") }, '"', object2, '"');
|
|
1354
1163
|
case "boolean":
|
|
1355
|
-
return React5.createElement("span", {
|
|
1356
|
-
style: mkStyle("objectValueBoolean")
|
|
1357
|
-
}, String(object2));
|
|
1164
|
+
return React5.createElement("span", { style: mkStyle("objectValueBoolean") }, String(object2));
|
|
1358
1165
|
case "undefined":
|
|
1359
|
-
return React5.createElement("span", {
|
|
1360
|
-
style: mkStyle("objectValueUndefined")
|
|
1361
|
-
}, "undefined");
|
|
1166
|
+
return React5.createElement("span", { style: mkStyle("objectValueUndefined") }, "undefined");
|
|
1362
1167
|
case "object":
|
|
1363
|
-
return object2 === null ? React5.createElement("span", {
|
|
1364
|
-
style: mkStyle("objectValueNull")
|
|
1365
|
-
}, "null") : object2 instanceof Date ? React5.createElement("span", null, object2.toString()) : object2 instanceof RegExp ? React5.createElement("span", {
|
|
1366
|
-
style: mkStyle("objectValueRegExp")
|
|
1367
|
-
}, object2.toString()) : Array.isArray(object2) ? React5.createElement("span", null, `Array(${object2.length})`) : object2.constructor ? typeof object2.constructor.isBuffer == "function" && object2.constructor.isBuffer(object2) ? React5.createElement("span", null, `Buffer[${object2.length}]`) : React5.createElement("span", null, object2.constructor.name) : React5.createElement("span", null, "Object");
|
|
1168
|
+
return object2 === null ? React5.createElement("span", { style: mkStyle("objectValueNull") }, "null") : object2 instanceof Date ? React5.createElement("span", null, object2.toString()) : object2 instanceof RegExp ? React5.createElement("span", { style: mkStyle("objectValueRegExp") }, object2.toString()) : Array.isArray(object2) ? React5.createElement("span", null, `Array(${object2.length})`) : object2.constructor ? typeof object2.constructor.isBuffer == "function" && object2.constructor.isBuffer(object2) ? React5.createElement("span", null, `Buffer[${object2.length}]`) : React5.createElement("span", null, object2.constructor.name) : React5.createElement("span", null, "Object");
|
|
1368
1169
|
case "function":
|
|
1369
|
-
return React5.createElement("span", null, React5.createElement("span", {
|
|
1370
|
-
style: mkStyle("objectValueFunctionPrefix")
|
|
1371
|
-
}, "\u0192\xA0"), React5.createElement("span", {
|
|
1372
|
-
style: mkStyle("objectValueFunctionName")
|
|
1373
|
-
}, object2.name, "()"));
|
|
1170
|
+
return React5.createElement("span", null, React5.createElement("span", { style: mkStyle("objectValueFunctionPrefix") }, "\u0192\xA0"), React5.createElement("span", { style: mkStyle("objectValueFunctionName") }, object2.name, "()"));
|
|
1374
1171
|
case "symbol":
|
|
1375
|
-
return React5.createElement("span", {
|
|
1376
|
-
style: mkStyle("objectValueSymbol")
|
|
1377
|
-
}, object2.toString());
|
|
1172
|
+
return React5.createElement("span", { style: mkStyle("objectValueSymbol") }, object2.toString());
|
|
1378
1173
|
default:
|
|
1379
1174
|
return React5.createElement("span", null);
|
|
1380
1175
|
}
|
|
@@ -1395,67 +1190,31 @@ function intersperse(arr, sep) {
|
|
|
1395
1190
|
var ObjectPreview = ({ data }) => {
|
|
1396
1191
|
let styles = useStyles("ObjectPreview"), object2 = data;
|
|
1397
1192
|
if (typeof object2 != "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp)
|
|
1398
|
-
return React6.createElement(ObjectValue, {
|
|
1399
|
-
object: object2
|
|
1400
|
-
});
|
|
1193
|
+
return React6.createElement(ObjectValue, { object: object2 });
|
|
1401
1194
|
if (Array.isArray(object2)) {
|
|
1402
|
-
let maxProperties = styles.arrayMaxProperties, previewArray = object2.slice(0, maxProperties).map((element, index) => React6.createElement(ObjectValue, {
|
|
1403
|
-
|
|
1404
|
-
object: element
|
|
1405
|
-
}));
|
|
1406
|
-
object2.length > maxProperties && previewArray.push(React6.createElement("span", {
|
|
1407
|
-
key: "ellipsis"
|
|
1408
|
-
}, "\u2026"));
|
|
1195
|
+
let maxProperties = styles.arrayMaxProperties, previewArray = object2.slice(0, maxProperties).map((element, index) => React6.createElement(ObjectValue, { key: index, object: element }));
|
|
1196
|
+
object2.length > maxProperties && previewArray.push(React6.createElement("span", { key: "ellipsis" }, "\u2026"));
|
|
1409
1197
|
let arrayLength = object2.length;
|
|
1410
|
-
return React6.createElement(React6.Fragment, null, React6.createElement("span", {
|
|
1411
|
-
style: styles.objectDescription
|
|
1412
|
-
}, arrayLength === 0 ? "" : `(${arrayLength})\xA0`), React6.createElement("span", {
|
|
1413
|
-
style: styles.preview
|
|
1414
|
-
}, "[", intersperse(previewArray, ", "), "]"));
|
|
1198
|
+
return React6.createElement(React6.Fragment, null, React6.createElement("span", { style: styles.objectDescription }, arrayLength === 0 ? "" : `(${arrayLength})\xA0`), React6.createElement("span", { style: styles.preview }, "[", intersperse(previewArray, ", "), "]"));
|
|
1415
1199
|
} else {
|
|
1416
1200
|
let maxProperties = styles.objectMaxProperties, propertyNodes = [];
|
|
1417
1201
|
for (let propertyName in object2)
|
|
1418
1202
|
if (hasOwnProperty.call(object2, propertyName)) {
|
|
1419
1203
|
let ellipsis;
|
|
1420
|
-
propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties && (ellipsis = React6.createElement("span", {
|
|
1421
|
-
key: "ellipsis"
|
|
1422
|
-
}, "\u2026"));
|
|
1204
|
+
propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties && (ellipsis = React6.createElement("span", { key: "ellipsis" }, "\u2026"));
|
|
1423
1205
|
let propertyValue = getPropertyValue(object2, propertyName);
|
|
1424
|
-
if (propertyNodes.push(
|
|
1425
|
-
key: propertyName
|
|
1426
|
-
|
|
1427
|
-
name: propertyName || '""'
|
|
1428
|
-
}), ":\xA0", React6.createElement(ObjectValue, {
|
|
1429
|
-
object: propertyValue
|
|
1430
|
-
}), ellipsis)), ellipsis)
|
|
1431
|
-
break;
|
|
1206
|
+
if (propertyNodes.push(
|
|
1207
|
+
React6.createElement("span", { key: propertyName }, React6.createElement(ObjectName, { name: propertyName || '""' }), ":\xA0", React6.createElement(ObjectValue, { object: propertyValue }), ellipsis)
|
|
1208
|
+
), ellipsis) break;
|
|
1432
1209
|
}
|
|
1433
1210
|
let objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
|
|
1434
|
-
return React6.createElement(React6.Fragment, null, React6.createElement("span", {
|
|
1435
|
-
style: styles.objectDescription
|
|
1436
|
-
}, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), React6.createElement("span", {
|
|
1437
|
-
style: styles.preview
|
|
1438
|
-
}, "{", intersperse(propertyNodes, ", "), "}"));
|
|
1211
|
+
return React6.createElement(React6.Fragment, null, React6.createElement("span", { style: styles.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), React6.createElement("span", { style: styles.preview }, "{", intersperse(propertyNodes, ", "), "}"));
|
|
1439
1212
|
}
|
|
1440
|
-
}, ObjectRootLabel = ({ name, data }) => typeof name == "string" ? React7.createElement("span", null, React7.createElement(ObjectName, {
|
|
1441
|
-
name
|
|
1442
|
-
}), React7.createElement("span", null, ": "), React7.createElement(ObjectPreview, {
|
|
1443
|
-
data
|
|
1444
|
-
})) : React7.createElement(ObjectPreview, {
|
|
1445
|
-
data
|
|
1446
|
-
}), ObjectLabel = ({ name, data, isNonenumerable = !1 }) => {
|
|
1213
|
+
}, ObjectRootLabel = ({ name, data }) => typeof name == "string" ? React7.createElement("span", null, React7.createElement(ObjectName, { name }), React7.createElement("span", null, ": "), React7.createElement(ObjectPreview, { data })) : React7.createElement(ObjectPreview, { data }), ObjectLabel = ({ name, data, isNonenumerable = !1 }) => {
|
|
1447
1214
|
let object2 = data;
|
|
1448
|
-
return React8.createElement("span", null, typeof name == "string" ? React8.createElement(ObjectName, {
|
|
1449
|
-
name,
|
|
1450
|
-
dimmed: isNonenumerable
|
|
1451
|
-
}) : React8.createElement(ObjectPreview, {
|
|
1452
|
-
data: name
|
|
1453
|
-
}), React8.createElement("span", null, ": "), React8.createElement(ObjectValue, {
|
|
1454
|
-
object: object2
|
|
1455
|
-
}));
|
|
1215
|
+
return React8.createElement("span", null, typeof name == "string" ? React8.createElement(ObjectName, { name, dimmed: isNonenumerable }) : React8.createElement(ObjectPreview, { data: name }), React8.createElement("span", null, ": "), React8.createElement(ObjectValue, { object: object2 }));
|
|
1456
1216
|
}, createIterator = (showNonenumerable, sortObjectKeys) => function* (data) {
|
|
1457
|
-
if (!(typeof data == "object" && data !== null || typeof data == "function"))
|
|
1458
|
-
return;
|
|
1217
|
+
if (!(typeof data == "object" && data !== null || typeof data == "function")) return;
|
|
1459
1218
|
let dataIsArray = Array.isArray(data);
|
|
1460
1219
|
if (!dataIsArray && data[Symbol.iterator]) {
|
|
1461
1220
|
let i = 0;
|
|
@@ -1501,20 +1260,9 @@ var ObjectPreview = ({ data }) => {
|
|
|
1501
1260
|
isNonenumerable: !0
|
|
1502
1261
|
});
|
|
1503
1262
|
}
|
|
1504
|
-
}, defaultNodeRenderer = ({ depth, name, data, isNonenumerable }) => depth === 0 ? React9.createElement(ObjectRootLabel, {
|
|
1505
|
-
name,
|
|
1506
|
-
data
|
|
1507
|
-
}) : React9.createElement(ObjectLabel, {
|
|
1508
|
-
name,
|
|
1509
|
-
data,
|
|
1510
|
-
isNonenumerable
|
|
1511
|
-
}), ObjectInspector = ({ showNonenumerable = !1, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
|
|
1263
|
+
}, defaultNodeRenderer = ({ depth, name, data, isNonenumerable }) => depth === 0 ? React9.createElement(ObjectRootLabel, { name, data }) : React9.createElement(ObjectLabel, { name, data, isNonenumerable }), ObjectInspector = ({ showNonenumerable = !1, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
|
|
1512
1264
|
let dataIterator = createIterator(showNonenumerable, sortObjectKeys), renderer = nodeRenderer || defaultNodeRenderer;
|
|
1513
|
-
return React9.createElement(TreeView, {
|
|
1514
|
-
nodeRenderer: renderer,
|
|
1515
|
-
dataIterator,
|
|
1516
|
-
...treeViewProps
|
|
1517
|
-
});
|
|
1265
|
+
return React9.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
|
|
1518
1266
|
}, themedObjectInspector = themeAcceptor(ObjectInspector);
|
|
1519
1267
|
function getHeaders(data) {
|
|
1520
1268
|
if (typeof data == "object") {
|
|
@@ -1535,41 +1283,26 @@ function getHeaders(data) {
|
|
|
1535
1283
|
}
|
|
1536
1284
|
var DataContainer = ({ rows, columns, rowsData }) => {
|
|
1537
1285
|
let styles = useStyles("TableInspectorDataContainer"), borderStyles = useStyles("TableInspectorLeftBorder");
|
|
1538
|
-
return React10.createElement("div", {
|
|
1539
|
-
style: styles.div
|
|
1540
|
-
}, React10.createElement("table", {
|
|
1541
|
-
style: styles.table
|
|
1542
|
-
}, React10.createElement("colgroup", null), React10.createElement("tbody", null, rows.map((row, i) => React10.createElement("tr", {
|
|
1543
|
-
key: row,
|
|
1544
|
-
style: styles.tr
|
|
1545
|
-
}, React10.createElement("td", {
|
|
1546
|
-
style: { ...styles.td, ...borderStyles.none }
|
|
1547
|
-
}, row), columns.map((column) => {
|
|
1286
|
+
return React10.createElement("div", { style: styles.div }, React10.createElement("table", { style: styles.table }, React10.createElement("colgroup", null), React10.createElement("tbody", null, rows.map((row, i) => React10.createElement("tr", { key: row, style: styles.tr }, React10.createElement("td", { style: { ...styles.td, ...borderStyles.none } }, row), columns.map((column) => {
|
|
1548
1287
|
let rowData = rowsData[i];
|
|
1549
|
-
return typeof rowData == "object" && rowData !== null && hasOwnProperty.call(rowData, column) ? React10.createElement("td", {
|
|
1550
|
-
key: column,
|
|
1551
|
-
style: { ...styles.td, ...borderStyles.solid }
|
|
1552
|
-
}, React10.createElement(ObjectValue, {
|
|
1553
|
-
object: rowData[column]
|
|
1554
|
-
})) : React10.createElement("td", {
|
|
1555
|
-
key: column,
|
|
1556
|
-
style: { ...styles.td, ...borderStyles.solid }
|
|
1557
|
-
});
|
|
1288
|
+
return typeof rowData == "object" && rowData !== null && hasOwnProperty.call(rowData, column) ? React10.createElement("td", { key: column, style: { ...styles.td, ...borderStyles.solid } }, React10.createElement(ObjectValue, { object: rowData[column] })) : React10.createElement("td", { key: column, style: { ...styles.td, ...borderStyles.solid } });
|
|
1558
1289
|
}))))));
|
|
1559
|
-
}, SortIconContainer = (props) => React11.createElement(
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1290
|
+
}, SortIconContainer = (props) => React11.createElement(
|
|
1291
|
+
"div",
|
|
1292
|
+
{
|
|
1293
|
+
style: {
|
|
1294
|
+
position: "absolute",
|
|
1295
|
+
top: 1,
|
|
1296
|
+
right: 0,
|
|
1297
|
+
bottom: 1,
|
|
1298
|
+
display: "flex",
|
|
1299
|
+
alignItems: "center"
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
props.children
|
|
1303
|
+
), SortIcon = ({ sortAscending }) => {
|
|
1569
1304
|
let styles = useStyles("TableInspectorSortIcon"), glyph = sortAscending ? "\u25B2" : "\u25BC";
|
|
1570
|
-
return React11.createElement("div", {
|
|
1571
|
-
style: styles
|
|
1572
|
-
}, glyph);
|
|
1305
|
+
return React11.createElement("div", { style: styles }, glyph);
|
|
1573
1306
|
}, TH = ({
|
|
1574
1307
|
sortAscending = !1,
|
|
1575
1308
|
sorted = !1,
|
|
@@ -1579,21 +1312,22 @@ var DataContainer = ({ rows, columns, rowsData }) => {
|
|
|
1579
1312
|
...thProps
|
|
1580
1313
|
}) => {
|
|
1581
1314
|
let styles = useStyles("TableInspectorTH"), [hovered, setHovered] = useState22(!1), handleMouseEnter = useCallback22(() => setHovered(!0), []), handleMouseLeave = useCallback22(() => setHovered(!1), []);
|
|
1582
|
-
return React11.createElement(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
...
|
|
1586
|
-
|
|
1587
|
-
|
|
1315
|
+
return React11.createElement(
|
|
1316
|
+
"th",
|
|
1317
|
+
{
|
|
1318
|
+
...thProps,
|
|
1319
|
+
style: {
|
|
1320
|
+
...styles.base,
|
|
1321
|
+
...borderStyle,
|
|
1322
|
+
...hovered ? styles.base[":hover"] : {}
|
|
1323
|
+
},
|
|
1324
|
+
onMouseEnter: handleMouseEnter,
|
|
1325
|
+
onMouseLeave: handleMouseLeave,
|
|
1326
|
+
onClick
|
|
1588
1327
|
},
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
}, React11.createElement("div", {
|
|
1593
|
-
style: styles.div
|
|
1594
|
-
}, children), sorted && React11.createElement(SortIconContainer, null, React11.createElement(SortIcon, {
|
|
1595
|
-
sortAscending
|
|
1596
|
-
})));
|
|
1328
|
+
React11.createElement("div", { style: styles.div }, children),
|
|
1329
|
+
sorted && React11.createElement(SortIconContainer, null, React11.createElement(SortIcon, { sortAscending }))
|
|
1330
|
+
);
|
|
1597
1331
|
}, HeaderContainer = ({
|
|
1598
1332
|
indexColumnText = "(index)",
|
|
1599
1333
|
columns = [],
|
|
@@ -1605,43 +1339,56 @@ var DataContainer = ({ rows, columns, rowsData }) => {
|
|
|
1605
1339
|
onIndexTHClick
|
|
1606
1340
|
}) => {
|
|
1607
1341
|
let styles = useStyles("TableInspectorHeaderContainer"), borderStyles = useStyles("TableInspectorLeftBorder");
|
|
1608
|
-
return React12.createElement("div", {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1342
|
+
return React12.createElement("div", { style: styles.base }, React12.createElement("table", { style: styles.table }, React12.createElement("tbody", null, React12.createElement("tr", null, React12.createElement(
|
|
1343
|
+
TH,
|
|
1344
|
+
{
|
|
1345
|
+
borderStyle: borderStyles.none,
|
|
1346
|
+
sorted: sorted && sortIndexColumn,
|
|
1347
|
+
sortAscending,
|
|
1348
|
+
onClick: onIndexTHClick
|
|
1349
|
+
},
|
|
1350
|
+
indexColumnText
|
|
1351
|
+
), columns.map((column) => React12.createElement(
|
|
1352
|
+
TH,
|
|
1353
|
+
{
|
|
1354
|
+
borderStyle: borderStyles.solid,
|
|
1355
|
+
key: column,
|
|
1356
|
+
sorted: sorted && sortColumn === column,
|
|
1357
|
+
sortAscending,
|
|
1358
|
+
onClick: onTHClick.bind(null, column)
|
|
1359
|
+
},
|
|
1360
|
+
column
|
|
1361
|
+
))))));
|
|
1624
1362
|
}, TableInspector = ({
|
|
1363
|
+
// The JS object you would like to inspect, either an array or an object
|
|
1625
1364
|
data,
|
|
1365
|
+
// An array of the names of the columns you'd like to display in the table
|
|
1626
1366
|
columns
|
|
1627
1367
|
}) => {
|
|
1628
1368
|
let styles = useStyles("TableInspector"), [{ sorted, sortIndexColumn, sortColumn, sortAscending }, setState] = useState3({
|
|
1369
|
+
// has user ever clicked the <th> tag to sort?
|
|
1629
1370
|
sorted: !1,
|
|
1371
|
+
// is index column sorted?
|
|
1630
1372
|
sortIndexColumn: !1,
|
|
1373
|
+
// which column is sorted?
|
|
1631
1374
|
sortColumn: void 0,
|
|
1375
|
+
// is sorting ascending or descending?
|
|
1632
1376
|
sortAscending: !1
|
|
1633
1377
|
}), handleIndexTHClick = useCallback3(() => {
|
|
1634
1378
|
setState(({ sortIndexColumn: sortIndexColumn2, sortAscending: sortAscending2 }) => ({
|
|
1635
1379
|
sorted: !0,
|
|
1636
1380
|
sortIndexColumn: !0,
|
|
1637
1381
|
sortColumn: void 0,
|
|
1382
|
+
// when changed to a new column, default to asending
|
|
1638
1383
|
sortAscending: sortIndexColumn2 ? !sortAscending2 : !0
|
|
1639
1384
|
}));
|
|
1640
1385
|
}, []), handleTHClick = useCallback3((col) => {
|
|
1641
1386
|
setState(({ sortColumn: sortColumn2, sortAscending: sortAscending2 }) => ({
|
|
1642
1387
|
sorted: !0,
|
|
1643
1388
|
sortIndexColumn: !1,
|
|
1389
|
+
// update sort column
|
|
1644
1390
|
sortColumn: col,
|
|
1391
|
+
// when changed to a new column, default to asending
|
|
1645
1392
|
sortAscending: col === sortColumn2 ? !sortAscending2 : !0
|
|
1646
1393
|
}));
|
|
1647
1394
|
}, []);
|
|
@@ -1671,84 +1418,55 @@ var DataContainer = ({ rows, columns, rowsData }) => {
|
|
|
1671
1418
|
}, sortedRowIndexes = columnDataWithRowIndexes.sort(comparator((item) => item[0], sortAscending)).map((item) => item[1]);
|
|
1672
1419
|
rowHeaders = sortedRowIndexes.map((i) => rowHeaders[i]), rowsData = sortedRowIndexes.map((i) => rowsData[i]);
|
|
1673
1420
|
}
|
|
1674
|
-
return React13.createElement("div", {
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
rowsData
|
|
1688
|
-
}));
|
|
1689
|
-
}, themedTableInspector = themeAcceptor(TableInspector), TEXT_NODE_MAX_INLINE_CHARS = 80, shouldInline = (data) => data.childNodes.length === 0 || data.childNodes.length === 1 && data.childNodes[0].nodeType === Node.TEXT_NODE && data.textContent.length < TEXT_NODE_MAX_INLINE_CHARS, OpenTag = ({ tagName, attributes, styles }) => React14.createElement("span", {
|
|
1690
|
-
style: styles.base
|
|
1691
|
-
}, "<", React14.createElement("span", {
|
|
1692
|
-
style: styles.tagName
|
|
1693
|
-
}, tagName), (() => {
|
|
1421
|
+
return React13.createElement("div", { style: styles.base }, React13.createElement(
|
|
1422
|
+
HeaderContainer,
|
|
1423
|
+
{
|
|
1424
|
+
columns: colHeaders,
|
|
1425
|
+
sorted,
|
|
1426
|
+
sortIndexColumn,
|
|
1427
|
+
sortColumn,
|
|
1428
|
+
sortAscending,
|
|
1429
|
+
onTHClick: handleTHClick,
|
|
1430
|
+
onIndexTHClick: handleIndexTHClick
|
|
1431
|
+
}
|
|
1432
|
+
), React13.createElement(DataContainer, { rows: rowHeaders, columns: colHeaders, rowsData }));
|
|
1433
|
+
}, themedTableInspector = themeAcceptor(TableInspector), TEXT_NODE_MAX_INLINE_CHARS = 80, shouldInline = (data) => data.childNodes.length === 0 || data.childNodes.length === 1 && data.childNodes[0].nodeType === Node.TEXT_NODE && data.textContent.length < TEXT_NODE_MAX_INLINE_CHARS, OpenTag = ({ tagName, attributes, styles }) => React14.createElement("span", { style: styles.base }, "<", React14.createElement("span", { style: styles.tagName }, tagName), (() => {
|
|
1694
1434
|
if (attributes) {
|
|
1695
1435
|
let attributeNodes = [];
|
|
1696
1436
|
for (let i = 0; i < attributes.length; i++) {
|
|
1697
1437
|
let attribute = attributes[i];
|
|
1698
|
-
attributeNodes.push(
|
|
1699
|
-
key: i
|
|
1700
|
-
|
|
1701
|
-
style: styles.htmlAttributeName
|
|
1702
|
-
}, attribute.name), '="', React14.createElement("span", {
|
|
1703
|
-
style: styles.htmlAttributeValue
|
|
1704
|
-
}, attribute.value), '"'));
|
|
1438
|
+
attributeNodes.push(
|
|
1439
|
+
React14.createElement("span", { key: i }, " ", React14.createElement("span", { style: styles.htmlAttributeName }, attribute.name), '="', React14.createElement("span", { style: styles.htmlAttributeValue }, attribute.value), '"')
|
|
1440
|
+
);
|
|
1705
1441
|
}
|
|
1706
1442
|
return attributeNodes;
|
|
1707
1443
|
}
|
|
1708
|
-
})(), ">"), CloseTag = ({ tagName, isChildNode = !1, styles }) => React14.createElement("span", {
|
|
1709
|
-
style: Object.assign({}, styles.base, isChildNode && styles.offsetLeft)
|
|
1710
|
-
}, "</", React14.createElement("span", {
|
|
1711
|
-
style: styles.tagName
|
|
1712
|
-
}, tagName), ">"), nameByNodeType = {
|
|
1444
|
+
})(), ">"), CloseTag = ({ tagName, isChildNode = !1, styles }) => React14.createElement("span", { style: Object.assign({}, styles.base, isChildNode && styles.offsetLeft) }, "</", React14.createElement("span", { style: styles.tagName }, tagName), ">"), nameByNodeType = {
|
|
1713
1445
|
1: "ELEMENT_NODE",
|
|
1714
1446
|
3: "TEXT_NODE",
|
|
1715
1447
|
7: "PROCESSING_INSTRUCTION_NODE",
|
|
1716
1448
|
8: "COMMENT_NODE",
|
|
1717
1449
|
9: "DOCUMENT_NODE",
|
|
1718
1450
|
10: "DOCUMENT_TYPE_NODE",
|
|
1451
|
+
// http://stackoverflow.com/questions/6088972/get-doctype-of-an-html-as-string-with-javascript
|
|
1719
1452
|
11: "DOCUMENT_FRAGMENT_NODE"
|
|
1720
1453
|
}, DOMNodePreview = ({ isCloseTag, data, expanded }) => {
|
|
1721
1454
|
let styles = useStyles("DOMNodePreview");
|
|
1722
1455
|
if (isCloseTag)
|
|
1723
|
-
return React14.createElement(CloseTag, {
|
|
1724
|
-
styles: styles.htmlCloseTag,
|
|
1725
|
-
isChildNode: !0,
|
|
1726
|
-
tagName: data.tagName
|
|
1727
|
-
});
|
|
1456
|
+
return React14.createElement(CloseTag, { styles: styles.htmlCloseTag, isChildNode: !0, tagName: data.tagName });
|
|
1728
1457
|
switch (data.nodeType) {
|
|
1729
1458
|
case Node.ELEMENT_NODE:
|
|
1730
|
-
return React14.createElement("span", null, React14.createElement(OpenTag, {
|
|
1731
|
-
tagName: data.tagName,
|
|
1732
|
-
attributes: data.attributes,
|
|
1733
|
-
styles: styles.htmlOpenTag
|
|
1734
|
-
}), shouldInline(data) ? data.textContent : !expanded && "\u2026", !expanded && React14.createElement(CloseTag, {
|
|
1735
|
-
tagName: data.tagName,
|
|
1736
|
-
styles: styles.htmlCloseTag
|
|
1737
|
-
}));
|
|
1459
|
+
return React14.createElement("span", null, React14.createElement(OpenTag, { tagName: data.tagName, attributes: data.attributes, styles: styles.htmlOpenTag }), shouldInline(data) ? data.textContent : !expanded && "\u2026", !expanded && React14.createElement(CloseTag, { tagName: data.tagName, styles: styles.htmlCloseTag }));
|
|
1738
1460
|
case Node.TEXT_NODE:
|
|
1739
1461
|
return React14.createElement("span", null, data.textContent);
|
|
1740
1462
|
case Node.CDATA_SECTION_NODE:
|
|
1741
1463
|
return React14.createElement("span", null, "<![CDATA[" + data.textContent + "]]>");
|
|
1742
1464
|
case Node.COMMENT_NODE:
|
|
1743
|
-
return React14.createElement("span", {
|
|
1744
|
-
style: styles.htmlComment
|
|
1745
|
-
}, "<!--", data.textContent, "-->");
|
|
1465
|
+
return React14.createElement("span", { style: styles.htmlComment }, "<!--", data.textContent, "-->");
|
|
1746
1466
|
case Node.PROCESSING_INSTRUCTION_NODE:
|
|
1747
1467
|
return React14.createElement("span", null, data.nodeName);
|
|
1748
1468
|
case Node.DOCUMENT_TYPE_NODE:
|
|
1749
|
-
return React14.createElement("span", {
|
|
1750
|
-
style: styles.htmlDoctype
|
|
1751
|
-
}, "<!DOCTYPE ", data.name, data.publicId ? ` PUBLIC "${data.publicId}"` : "", !data.publicId && data.systemId ? " SYSTEM" : "", data.systemId ? ` "${data.systemId}"` : "", ">");
|
|
1469
|
+
return React14.createElement("span", { style: styles.htmlDoctype }, "<!DOCTYPE ", data.name, data.publicId ? ` PUBLIC "${data.publicId}"` : "", !data.publicId && data.systemId ? " SYSTEM" : "", data.systemId ? ` "${data.systemId}"` : "", ">");
|
|
1752
1470
|
case Node.DOCUMENT_NODE:
|
|
1753
1471
|
return React14.createElement("span", null, data.nodeName);
|
|
1754
1472
|
case Node.DOCUMENT_FRAGMENT_NODE:
|
|
@@ -1775,31 +1493,18 @@ var DataContainer = ({ rows, columns, rowsData }) => {
|
|
|
1775
1493
|
isCloseTag: !0
|
|
1776
1494
|
});
|
|
1777
1495
|
}
|
|
1778
|
-
}, DOMInspector = (props) => React15.createElement(TreeView, {
|
|
1779
|
-
nodeRenderer: DOMNodePreview,
|
|
1780
|
-
dataIterator: domIterator,
|
|
1781
|
-
...props
|
|
1782
|
-
}), themedDOMInspector = themeAcceptor(DOMInspector), import_is_dom = __toESM2(require_is_dom()), Inspector = ({ table = !1, data, ...rest }) => table ? React16.createElement(themedTableInspector, {
|
|
1783
|
-
data,
|
|
1784
|
-
...rest
|
|
1785
|
-
}) : (0, import_is_dom.default)(data) ? React16.createElement(themedDOMInspector, {
|
|
1786
|
-
data,
|
|
1787
|
-
...rest
|
|
1788
|
-
}) : React16.createElement(themedObjectInspector, {
|
|
1789
|
-
data,
|
|
1790
|
-
...rest
|
|
1791
|
-
});
|
|
1496
|
+
}, DOMInspector = (props) => React15.createElement(TreeView, { nodeRenderer: DOMNodePreview, dataIterator: domIterator, ...props }), themedDOMInspector = themeAcceptor(DOMInspector), import_is_dom = __toESM2(require_is_dom(), 1), Inspector = ({ table = !1, data, ...rest }) => table ? React16.createElement(themedTableInspector, { data, ...rest }) : (0, import_is_dom.default)(data) ? React16.createElement(themedDOMInspector, { data, ...rest }) : React16.createElement(themedObjectInspector, { data, ...rest });
|
|
1792
1497
|
|
|
1793
1498
|
// src/actions/components/ActionLogger/index.tsx
|
|
1794
1499
|
import { useTheme } from "@aussieljk/forkbook/theming";
|
|
1795
1500
|
|
|
1796
|
-
//
|
|
1501
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/actions/components/ActionLogger/index.module.css
|
|
1797
1502
|
var id3 = "core/src/actions/components/ActionLogger/index.module.css";
|
|
1798
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1503
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id3}"]`)) {
|
|
1799
1504
|
let style = document.createElement("style");
|
|
1800
|
-
style.setAttribute("data-
|
|
1505
|
+
style.setAttribute("data-fb-css", id3), style.textContent = ".fb-IaeYrG-wrapper{margin:0;padding:10px 5px 20px}.fb-IaeYrG-action{white-space:pre;border-bottom:1px solid #0000;border-left:5px solid #0000;align-items:flex-start;padding:0;transition:all .1s;display:flex}.fb-IaeYrG-counter{background-color:rgb(from var(--fb-app-border-color) r g b / calc(alpha + .5));color:var(--fb-color-inverse-text);font-size:var(--fb-size-s1);font-weight:var(--fb-weight-bold);border-radius:20px;margin:2px 0;padding:1px 5px;line-height:1}.fb-IaeYrG-inspectorContainer{flex:1;padding:0 0 0 5px}", document.head.appendChild(style);
|
|
1801
1506
|
}
|
|
1802
|
-
var ActionLogger_default = {
|
|
1507
|
+
var ActionLogger_default = { wrapper: "fb-IaeYrG-wrapper", action: "fb-IaeYrG-action", counter: "fb-IaeYrG-counter", inspectorContainer: "fb-IaeYrG-inspectorContainer" };
|
|
1803
1508
|
|
|
1804
1509
|
// src/actions/components/ActionLogger/index.tsx
|
|
1805
1510
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
@@ -1809,7 +1514,7 @@ var ThemedInspector = (props) => {
|
|
|
1809
1514
|
}, ActionLogger = ({ actions, expandLevel, onClear }) => {
|
|
1810
1515
|
let wrapperRef = useRef(null), wrapper = wrapperRef.current, wasAtBottom = wrapper && wrapper.scrollHeight - wrapper.scrollTop === wrapper.clientHeight;
|
|
1811
1516
|
return useEffect2(() => {
|
|
1812
|
-
wasAtBottom && (wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight);
|
|
1517
|
+
wasAtBottom && wrapperRef.current && (wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight);
|
|
1813
1518
|
}, [wasAtBottom, actions.length]), jsxs6(Fragment3, { children: [
|
|
1814
1519
|
jsx6(ScrollArea, { ref: wrapperRef, horizontal: !0, vertical: !0, className: ActionLogger_default.wrapper, children: actions.map((action) => jsxs6("div", { className: ActionLogger_default.action, children: [
|
|
1815
1520
|
action.count > 1 && jsx6("div", { className: ActionLogger_default.counter, children: action.count }),
|
|
@@ -1832,7 +1537,7 @@ var ThemedInspector = (props) => {
|
|
|
1832
1537
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1833
1538
|
var safeDeepEqual = (a, b) => {
|
|
1834
1539
|
try {
|
|
1835
|
-
return
|
|
1540
|
+
return isEqual(a, b);
|
|
1836
1541
|
} catch {
|
|
1837
1542
|
return !1;
|
|
1838
1543
|
}
|
|
@@ -1887,7 +1592,7 @@ import { AddonPanel as AddonPanel2 } from "@aussieljk/forkbook/internal/componen
|
|
|
1887
1592
|
import { Consumer, addons as addons5, types as types3 } from "@aussieljk/forkbook/manager-api";
|
|
1888
1593
|
|
|
1889
1594
|
// src/component-testing/components/Panel.tsx
|
|
1890
|
-
import { Fragment as Fragment8, memo as memo4, useEffect as
|
|
1595
|
+
import { Fragment as Fragment8, memo as memo4, useEffect as useEffect6, useMemo as useMemo4, useRef as useRef2, useState as useState7 } from "react";
|
|
1891
1596
|
import {
|
|
1892
1597
|
FORCE_REMOUNT,
|
|
1893
1598
|
PLAY_FUNCTION_THREW_EXCEPTION,
|
|
@@ -1895,7 +1600,6 @@ import {
|
|
|
1895
1600
|
STORY_THREW_EXCEPTION,
|
|
1896
1601
|
UNHANDLED_ERRORS_WHILE_PLAYING
|
|
1897
1602
|
} from "@aussieljk/forkbook/internal/core-events";
|
|
1898
|
-
import { global as global2 } from "@storybook/global";
|
|
1899
1603
|
import {
|
|
1900
1604
|
experimental_useStatusStore,
|
|
1901
1605
|
useAddonState as useAddonState2,
|
|
@@ -1906,7 +1610,7 @@ import {
|
|
|
1906
1610
|
} from "@aussieljk/forkbook/manager-api";
|
|
1907
1611
|
|
|
1908
1612
|
// src/component-testing/components/InteractionsPanel.tsx
|
|
1909
|
-
import * as
|
|
1613
|
+
import * as React23 from "react";
|
|
1910
1614
|
|
|
1911
1615
|
// src/component-testing/utils.ts
|
|
1912
1616
|
var import_ansi_to_html = __toESM(require_ansi_to_html(), 1);
|
|
@@ -1928,16 +1632,17 @@ function stripAnsi(string2) {
|
|
|
1928
1632
|
|
|
1929
1633
|
// src/component-testing/utils.ts
|
|
1930
1634
|
function isInteractionsDisabled(parameters) {
|
|
1931
|
-
|
|
1635
|
+
let interactions = parameters?.[PARAM_KEY5];
|
|
1636
|
+
return typeof interactions == "object" && interactions !== null && "disable" in interactions && !!interactions.disable;
|
|
1932
1637
|
}
|
|
1933
|
-
function isTestAssertionError(
|
|
1934
|
-
return isChaiError(
|
|
1638
|
+
function isTestAssertionError(error2) {
|
|
1639
|
+
return isChaiError(error2) || isJestError(error2);
|
|
1935
1640
|
}
|
|
1936
|
-
function isChaiError(
|
|
1937
|
-
return
|
|
1641
|
+
function isChaiError(error2) {
|
|
1642
|
+
return error2 && typeof error2 == "object" && "name" in error2 && typeof error2.name == "string" && error2.name === "AssertionError";
|
|
1938
1643
|
}
|
|
1939
|
-
function isJestError(
|
|
1940
|
-
return
|
|
1644
|
+
function isJestError(error2) {
|
|
1645
|
+
return error2 && typeof error2 == "object" && "message" in error2 && typeof error2.message == "string" && stripAnsi(error2.message).startsWith("expect(");
|
|
1941
1646
|
}
|
|
1942
1647
|
function createAnsiToHtmlFilter(theme3) {
|
|
1943
1648
|
return new import_ansi_to_html.default({
|
|
@@ -1954,18 +1659,18 @@ function useAnsiToHtmlFilter() {
|
|
|
1954
1659
|
// src/component-testing/components/DetachedDebuggerMessage.tsx
|
|
1955
1660
|
import { Link } from "@aussieljk/forkbook/internal/components";
|
|
1956
1661
|
|
|
1957
|
-
//
|
|
1662
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/DetachedDebuggerMessage.module.css
|
|
1958
1663
|
var id4 = "core/src/component-testing/components/DetachedDebuggerMessage.module.css";
|
|
1959
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1664
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id4}"]`)) {
|
|
1960
1665
|
let style = document.createElement("style");
|
|
1961
|
-
style.setAttribute("data-
|
|
1666
|
+
style.setAttribute("data-fb-css", id4), style.textContent = ".fb-McV2ua-message{text-align:start;font-size:calc(var(--fb-size-s2) - 1px);font-weight:var(--fb-weight-regular);background:var(--fb-background-app);border-bottom:1px solid var(--fb-color-border);color:var(--fb-color-default-text);background-clip:padding-box;padding:11px 15px;line-height:1rem;position:relative}", document.head.appendChild(style);
|
|
1962
1667
|
}
|
|
1963
|
-
var DetachedDebuggerMessage_default = { message: "
|
|
1668
|
+
var DetachedDebuggerMessage_default = { message: "fb-McV2ua-message" };
|
|
1964
1669
|
|
|
1965
1670
|
// src/component-testing/components/DetachedDebuggerMessage.tsx
|
|
1966
1671
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1967
1672
|
var DetachedDebuggerMessage = ({ storyUrl }) => jsxs7("div", { className: DetachedDebuggerMessage_default.message, children: [
|
|
1968
|
-
"Debugger controls are not available on composed
|
|
1673
|
+
"Debugger controls are not available on composed Forkbooks.",
|
|
1969
1674
|
" ",
|
|
1970
1675
|
jsx9(
|
|
1971
1676
|
Link,
|
|
@@ -1982,16 +1687,16 @@ var DetachedDebuggerMessage = ({ storyUrl }) => jsxs7("div", { className: Detach
|
|
|
1982
1687
|
// src/component-testing/components/EmptyState.tsx
|
|
1983
1688
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1984
1689
|
import { EmptyTabContent, Link as Link2 } from "@aussieljk/forkbook/internal/components";
|
|
1985
|
-
import {
|
|
1690
|
+
import { FileTextIcon } from "lucide-react";
|
|
1986
1691
|
import { useStorybookApi as useStorybookApi4 } from "@aussieljk/forkbook/manager-api";
|
|
1987
1692
|
|
|
1988
|
-
//
|
|
1693
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/EmptyState.module.css
|
|
1989
1694
|
var id5 = "core/src/component-testing/components/EmptyState.module.css";
|
|
1990
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1695
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id5}"]`)) {
|
|
1991
1696
|
let style = document.createElement("style");
|
|
1992
|
-
style.setAttribute("data-
|
|
1697
|
+
style.setAttribute("data-fb-css", id5), style.textContent = ".fb-m4u5Jq-links{font-size:calc(var(--fb-size-s2) - 1px);gap:25px;display:flex}", document.head.appendChild(style);
|
|
1993
1698
|
}
|
|
1994
|
-
var EmptyState_default = { links: "
|
|
1699
|
+
var EmptyState_default = { links: "fb-m4u5Jq-links" };
|
|
1995
1700
|
|
|
1996
1701
|
// src/component-testing/components/EmptyState.tsx
|
|
1997
1702
|
import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -2012,7 +1717,7 @@ var Empty = () => {
|
|
|
2012
1717
|
title: "Interactions",
|
|
2013
1718
|
description: jsx10(Fragment4, { children: "Interactions allow you to verify the functional aspects of UIs. Write a play function for your story and you'll see it run here." }),
|
|
2014
1719
|
footer: jsx10("div", { className: EmptyState_default.links, children: jsxs8(Link2, { href: docsUrl, target: "_blank", withArrow: !0, children: [
|
|
2015
|
-
jsx10(
|
|
1720
|
+
jsx10(FileTextIcon, {}),
|
|
2016
1721
|
" Read docs"
|
|
2017
1722
|
] }) })
|
|
2018
1723
|
}
|
|
@@ -2020,583 +1725,14 @@ var Empty = () => {
|
|
|
2020
1725
|
};
|
|
2021
1726
|
|
|
2022
1727
|
// src/component-testing/components/Interaction.tsx
|
|
2023
|
-
import * as
|
|
1728
|
+
import * as React21 from "react";
|
|
2024
1729
|
import { Button as Button2 } from "@aussieljk/forkbook/internal/components";
|
|
2025
|
-
import { ChevronDownIcon, ChevronUpIcon } from "
|
|
1730
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
2026
1731
|
|
|
2027
1732
|
// src/component-testing/components/MethodCall.tsx
|
|
2028
|
-
import
|
|
1733
|
+
import React20, { Fragment as Fragment5 } from "react";
|
|
2029
1734
|
import { logger } from "@aussieljk/forkbook/internal/client-logger";
|
|
2030
|
-
|
|
2031
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectInspector.js
|
|
2032
|
-
var import_extends5 = __toESM(require_extends()), import_objectWithoutProperties6 = __toESM(require_objectWithoutProperties());
|
|
2033
|
-
import React28, { useEffect as useEffect8, useState as useState9 } from "react";
|
|
2034
|
-
|
|
2035
|
-
// ../../node_modules/@devtools-ds/object-inspector/node_modules/clsx/dist/clsx.m.js
|
|
2036
|
-
function toVal(mix) {
|
|
2037
|
-
var k, y, str = "";
|
|
2038
|
-
if (mix)
|
|
2039
|
-
if (typeof mix == "object")
|
|
2040
|
-
if (Array.isArray(mix))
|
|
2041
|
-
for (k = 0; k < mix.length; k++)
|
|
2042
|
-
mix[k] && (y = toVal(mix[k])) && (str && (str += " "), str += y);
|
|
2043
|
-
else
|
|
2044
|
-
for (k in mix)
|
|
2045
|
-
mix[k] && (y = toVal(k)) && (str && (str += " "), str += y);
|
|
2046
|
-
else typeof mix != "boolean" && !mix.call && (str && (str += " "), str += mix);
|
|
2047
|
-
return str;
|
|
2048
|
-
}
|
|
2049
|
-
function clsx_m_default() {
|
|
2050
|
-
for (var i = 0, x, str = ""; i < arguments.length; )
|
|
2051
|
-
(x = toVal(arguments[i++])) && (str && (str += " "), str += x);
|
|
2052
|
-
return str;
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
// ../../node_modules/@devtools-ds/object-parser/dist/esm/index.js
|
|
2056
|
-
var isArray = (val) => Array.isArray(val) || // Detect https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
|
|
2057
|
-
ArrayBuffer.isView(val) && !(val instanceof DataView), isObject = (val) => val !== null && typeof val == "object" && !isArray(val) && !(val instanceof Date) && !(val instanceof RegExp) && !(val instanceof Error) && !(val instanceof WeakMap) && !(val instanceof WeakSet), isKnownObject = (val) => isObject(val) || isArray(val) || typeof val == "function" || val instanceof Promise, getPromiseState = (promise) => {
|
|
2058
|
-
let unique = /unique/;
|
|
2059
|
-
return Promise.race([promise, unique]).then((result) => result === unique ? ["pending"] : ["fulfilled", result], (e) => ["rejected", e]);
|
|
2060
|
-
}, buildAST = async (key, value, depth, sortKeys, isPrototype, showPrototype) => {
|
|
2061
|
-
let astNode = {
|
|
2062
|
-
key,
|
|
2063
|
-
depth,
|
|
2064
|
-
value,
|
|
2065
|
-
type: "value",
|
|
2066
|
-
parent: void 0
|
|
2067
|
-
};
|
|
2068
|
-
if (value && isKnownObject(value) && depth < 100) {
|
|
2069
|
-
let children = [], t = "object";
|
|
2070
|
-
if (isArray(value)) {
|
|
2071
|
-
for (let i = 0; i < value.length; i++)
|
|
2072
|
-
children.push(async () => {
|
|
2073
|
-
let child = await buildAST(i.toString(), value[i], depth + 1, sortKeys);
|
|
2074
|
-
return child.parent = astNode, child;
|
|
2075
|
-
});
|
|
2076
|
-
t = "array";
|
|
2077
|
-
} else {
|
|
2078
|
-
let keys = Object.getOwnPropertyNames(value);
|
|
2079
|
-
sortKeys && keys.sort();
|
|
2080
|
-
for (let i = 0; i < keys.length; i++) {
|
|
2081
|
-
let safeValue;
|
|
2082
|
-
try {
|
|
2083
|
-
safeValue = value[keys[i]];
|
|
2084
|
-
} catch {
|
|
2085
|
-
}
|
|
2086
|
-
children.push(async () => {
|
|
2087
|
-
let child = await buildAST(keys[i], safeValue, depth + 1, sortKeys);
|
|
2088
|
-
return child.parent = astNode, child;
|
|
2089
|
-
});
|
|
2090
|
-
}
|
|
2091
|
-
if (typeof value == "function" && (t = "function"), value instanceof Promise) {
|
|
2092
|
-
let [status, result] = await getPromiseState(value);
|
|
2093
|
-
children.push(async () => {
|
|
2094
|
-
let child = await buildAST("<state>", status, depth + 1, sortKeys);
|
|
2095
|
-
return child.parent = astNode, child;
|
|
2096
|
-
}), status !== "pending" && children.push(async () => {
|
|
2097
|
-
let child = await buildAST("<value>", result, depth + 1, sortKeys);
|
|
2098
|
-
return child.parent = astNode, child;
|
|
2099
|
-
}), t = "promise";
|
|
2100
|
-
}
|
|
2101
|
-
if (value instanceof Map) {
|
|
2102
|
-
let parsedEntries = Array.from(value.entries()).map((entry) => {
|
|
2103
|
-
let [entryKey, entryValue] = entry;
|
|
2104
|
-
return {
|
|
2105
|
-
"<key>": entryKey,
|
|
2106
|
-
"<value>": entryValue
|
|
2107
|
-
};
|
|
2108
|
-
});
|
|
2109
|
-
children.push(async () => {
|
|
2110
|
-
let child = await buildAST("<entries>", parsedEntries, depth + 1, sortKeys);
|
|
2111
|
-
return child.parent = astNode, child;
|
|
2112
|
-
}), children.push(async () => {
|
|
2113
|
-
let child = await buildAST("size", value.size, depth + 1, sortKeys);
|
|
2114
|
-
return child.parent = astNode, child;
|
|
2115
|
-
}), t = "map";
|
|
2116
|
-
}
|
|
2117
|
-
if (value instanceof Set) {
|
|
2118
|
-
let parsedEntries = Array.from(value.entries()).map((entry) => entry[1]);
|
|
2119
|
-
children.push(async () => {
|
|
2120
|
-
let child = await buildAST("<entries>", parsedEntries, depth + 1, sortKeys);
|
|
2121
|
-
return child.parent = astNode, child;
|
|
2122
|
-
}), children.push(async () => {
|
|
2123
|
-
let child = await buildAST("size", value.size, depth + 1, sortKeys);
|
|
2124
|
-
return child.parent = astNode, child;
|
|
2125
|
-
}), t = "set";
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
value !== Object.prototype && showPrototype && children.push(async () => {
|
|
2129
|
-
let child = await buildAST("<prototype>", Object.getPrototypeOf(value), depth + 1, sortKeys, !0);
|
|
2130
|
-
return child.parent = astNode, child;
|
|
2131
|
-
}), astNode.type = t, astNode.children = children, astNode.isPrototype = isPrototype;
|
|
2132
|
-
}
|
|
2133
|
-
return astNode;
|
|
2134
|
-
}, parse = (data, sortKeys, includePrototypes) => buildAST("root", data, 0, sortKeys === !1 ? sortKeys : !0, void 0, includePrototypes === !1 ? includePrototypes : !0);
|
|
2135
|
-
|
|
2136
|
-
// ../../node_modules/@devtools-ds/themes/dist/esm/utils.js
|
|
2137
|
-
var import_objectSpread2 = __toESM(require_objectSpread2()), import_objectWithoutProperties = __toESM(require_objectWithoutProperties2());
|
|
2138
|
-
import React20 from "react";
|
|
2139
|
-
|
|
2140
|
-
// ../../node_modules/@devtools-ds/themes/node_modules/clsx/dist/clsx.m.js
|
|
2141
|
-
function toVal2(mix) {
|
|
2142
|
-
var k, y, str = "";
|
|
2143
|
-
if (mix)
|
|
2144
|
-
if (typeof mix == "object")
|
|
2145
|
-
if (Array.isArray(mix))
|
|
2146
|
-
for (k = 0; k < mix.length; k++)
|
|
2147
|
-
mix[k] && (y = toVal2(mix[k])) && (str && (str += " "), str += y);
|
|
2148
|
-
else
|
|
2149
|
-
for (k in mix)
|
|
2150
|
-
mix[k] && (y = toVal2(k)) && (str && (str += " "), str += y);
|
|
2151
|
-
else typeof mix != "boolean" && !mix.call && (str && (str += " "), str += mix);
|
|
2152
|
-
return str;
|
|
2153
|
-
}
|
|
2154
|
-
function clsx_m_default2() {
|
|
2155
|
-
for (var i = 0, x, str = ""; i < arguments.length; )
|
|
2156
|
-
(x = toVal2(arguments[i++])) && (str && (str += " "), str += x);
|
|
2157
|
-
return str;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
// ../../node_modules/@devtools-ds/themes/dist/esm/utils.js
|
|
2161
|
-
var _excluded = ["children"];
|
|
2162
|
-
var ThemeContext2 = React20.createContext({
|
|
2163
|
-
theme: "chrome",
|
|
2164
|
-
colorScheme: "light"
|
|
2165
|
-
});
|
|
2166
|
-
var ThemeProvider = (_ref) => {
|
|
2167
|
-
let {
|
|
2168
|
-
children
|
|
2169
|
-
} = _ref, value = (0, import_objectWithoutProperties.default)(_ref, _excluded), wrappedTheme = React20.useContext(ThemeContext2);
|
|
2170
|
-
return React20.createElement(ThemeContext2.Provider, {
|
|
2171
|
-
value: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, wrappedTheme), value)
|
|
2172
|
-
}, children);
|
|
2173
|
-
}, useTheme3 = (props, styles = {}) => {
|
|
2174
|
-
let themeContext = React20.useContext(ThemeContext2), currentTheme = props.theme || themeContext.theme || "chrome", currentColorScheme = props.colorScheme || themeContext.colorScheme || "light", themeClass = clsx_m_default2(styles[currentTheme], styles[currentColorScheme]);
|
|
2175
|
-
return {
|
|
2176
|
-
currentColorScheme,
|
|
2177
|
-
currentTheme,
|
|
2178
|
-
themeClass
|
|
2179
|
-
};
|
|
2180
|
-
};
|
|
2181
|
-
|
|
2182
|
-
// ../../node_modules/@devtools-ds/themes/dist/esm/AutoThemeProvider.js
|
|
2183
|
-
var import_extends = __toESM(require_extends2()), import_objectWithoutProperties2 = __toESM(require_objectWithoutProperties2());
|
|
2184
|
-
import React21 from "react";
|
|
2185
|
-
|
|
2186
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectInspectorItem.js
|
|
2187
|
-
var import_objectSpread22 = __toESM(require_objectSpread22());
|
|
2188
|
-
import React27, { useEffect as useEffect7, useState as useState8 } from "react";
|
|
2189
|
-
|
|
2190
|
-
// ../../node_modules/@devtools-ds/tree/dist/esm/index.js
|
|
2191
|
-
var import_extends2 = __toESM(require_extends3()), import_objectWithoutProperties3 = __toESM(require_objectWithoutProperties3());
|
|
2192
|
-
import React24, { useState as useState6, useEffect as useEffect5 } from "react";
|
|
2193
|
-
|
|
2194
|
-
// ../../node_modules/@devtools-ds/tree/node_modules/clsx/dist/clsx.m.js
|
|
2195
|
-
function toVal3(mix) {
|
|
2196
|
-
var k, y, str = "";
|
|
2197
|
-
if (mix)
|
|
2198
|
-
if (typeof mix == "object")
|
|
2199
|
-
if (Array.isArray(mix))
|
|
2200
|
-
for (k = 0; k < mix.length; k++)
|
|
2201
|
-
mix[k] && (y = toVal3(mix[k])) && (str && (str += " "), str += y);
|
|
2202
|
-
else
|
|
2203
|
-
for (k in mix)
|
|
2204
|
-
mix[k] && (y = toVal3(k)) && (str && (str += " "), str += y);
|
|
2205
|
-
else typeof mix != "boolean" && !mix.call && (str && (str += " "), str += mix);
|
|
2206
|
-
return str;
|
|
2207
|
-
}
|
|
2208
|
-
function clsx_m_default3() {
|
|
2209
|
-
for (var i = 0, x, str = ""; i < arguments.length; )
|
|
2210
|
-
(x = toVal3(arguments[i++])) && (str && (str += " "), str += x);
|
|
2211
|
-
return str;
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
|
-
// ../../node_modules/@devtools-ds/tree/dist/esm/TreeContext.js
|
|
2215
|
-
import React23 from "react";
|
|
2216
|
-
var TreeContext = React23.createContext({
|
|
2217
|
-
isChild: !1,
|
|
2218
|
-
depth: 0,
|
|
2219
|
-
hasHover: !0
|
|
2220
|
-
}), TreeContext_default = TreeContext;
|
|
2221
|
-
|
|
2222
|
-
// ../../node_modules/@devtools-ds/tree/dist/esm/Tree.css.js
|
|
2223
|
-
var Tree_css_default = { tree: "Tree-tree-fbbbe38", item: "Tree-item-353d6f3", group: "Tree-group-d3c3d8a", label: "Tree-label-d819155", focusWhite: "Tree-focusWhite-f1e00c2", arrow: "Tree-arrow-03ab2e7", hover: "Tree-hover-3cc4e5d", open: "Tree-open-3f1a336", dark: "Tree-dark-1b4aa00", chrome: "Tree-chrome-bcbcac6", light: "Tree-light-09174ee" };
|
|
2224
|
-
|
|
2225
|
-
// ../../node_modules/@devtools-ds/tree/dist/esm/index.js
|
|
2226
|
-
var _excluded2 = ["theme", "hover", "colorScheme", "children", "label", "className", "onUpdate", "onSelect", "open"], Tree = (props) => {
|
|
2227
|
-
let {
|
|
2228
|
-
theme: theme3,
|
|
2229
|
-
hover,
|
|
2230
|
-
colorScheme,
|
|
2231
|
-
children,
|
|
2232
|
-
label,
|
|
2233
|
-
className,
|
|
2234
|
-
onUpdate,
|
|
2235
|
-
onSelect,
|
|
2236
|
-
open
|
|
2237
|
-
} = props, html = (0, import_objectWithoutProperties3.default)(props, _excluded2), {
|
|
2238
|
-
themeClass,
|
|
2239
|
-
currentTheme
|
|
2240
|
-
} = useTheme3({
|
|
2241
|
-
theme: theme3,
|
|
2242
|
-
colorScheme
|
|
2243
|
-
}, Tree_css_default), [isOpen, setOpen] = useState6(open);
|
|
2244
|
-
useEffect5(() => {
|
|
2245
|
-
setOpen(open);
|
|
2246
|
-
}, [open]);
|
|
2247
|
-
let updateState = (value) => {
|
|
2248
|
-
setOpen(value), onUpdate && onUpdate(value);
|
|
2249
|
-
}, hasChildren = React24.Children.count(children) > 0, updateFocus = (newNode, previousNode) => {
|
|
2250
|
-
if (newNode.isSameNode(previousNode || null)) return;
|
|
2251
|
-
let focusableNode = newNode.querySelector('[tabindex="-1"]');
|
|
2252
|
-
focusableNode?.focus(), newNode.setAttribute("aria-selected", "true"), previousNode?.removeAttribute("aria-selected");
|
|
2253
|
-
}, getParent = (node, role) => {
|
|
2254
|
-
let parent = node;
|
|
2255
|
-
for (; parent && parent.parentElement; ) {
|
|
2256
|
-
if (parent.getAttribute("role") === role)
|
|
2257
|
-
return parent;
|
|
2258
|
-
parent = parent.parentElement;
|
|
2259
|
-
}
|
|
2260
|
-
return null;
|
|
2261
|
-
}, getListElements = (node) => {
|
|
2262
|
-
let tree = getParent(node, "tree");
|
|
2263
|
-
return tree ? Array.from(tree.querySelectorAll("li")) : [];
|
|
2264
|
-
}, moveBack = (node) => {
|
|
2265
|
-
let group = getParent(node, "group"), toggle = group?.previousElementSibling;
|
|
2266
|
-
if (toggle && toggle.getAttribute("tabindex") === "-1") {
|
|
2267
|
-
let toggleParent = toggle.parentElement, nodeParent = node.parentElement;
|
|
2268
|
-
updateFocus(toggleParent, nodeParent);
|
|
2269
|
-
}
|
|
2270
|
-
}, moveHome = (node, direction) => {
|
|
2271
|
-
let elements = getListElements(node);
|
|
2272
|
-
elements.forEach((element) => {
|
|
2273
|
-
element.removeAttribute("aria-selected");
|
|
2274
|
-
}), direction === "start" && elements[0] && updateFocus(elements[0]), direction === "end" && elements[elements.length - 1] && updateFocus(elements[elements.length - 1]);
|
|
2275
|
-
}, moveFocusAdjacent = (node, direction) => {
|
|
2276
|
-
let elements = getListElements(node) || [];
|
|
2277
|
-
for (let i = 0; i < elements.length; i++) {
|
|
2278
|
-
let currentNode = elements[i];
|
|
2279
|
-
if (currentNode.getAttribute("aria-selected") === "true") {
|
|
2280
|
-
direction === "up" && elements[i - 1] ? updateFocus(elements[i - 1], currentNode) : direction === "down" && elements[i + 1] && updateFocus(elements[i + 1], currentNode);
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
updateFocus(elements[0]);
|
|
2285
|
-
}, handleKeypress = (event, isChild2) => {
|
|
2286
|
-
let node = event.target;
|
|
2287
|
-
(event.key === "Enter" || event.key === " ") && updateState(!isOpen), event.key === "ArrowRight" && isOpen && !isChild2 ? moveFocusAdjacent(node, "down") : event.key === "ArrowRight" && updateState(!0), event.key === "ArrowLeft" && (!isOpen || isChild2) ? moveBack(node) : event.key === "ArrowLeft" && updateState(!1), event.key === "ArrowDown" && moveFocusAdjacent(node, "down"), event.key === "ArrowUp" && moveFocusAdjacent(node, "up"), event.key === "Home" && moveHome(node, "start"), event.key === "End" && moveHome(node, "end");
|
|
2288
|
-
}, handleClick = (event, isChild2) => {
|
|
2289
|
-
let node = event.target, parent = getParent(node, "treeitem"), elements = getListElements(node) || [], found = !1;
|
|
2290
|
-
for (let i = 0; i < elements.length; i++) {
|
|
2291
|
-
let currentNode = elements[i];
|
|
2292
|
-
if (currentNode.getAttribute("aria-selected") === "true") {
|
|
2293
|
-
parent && (found = !0, updateFocus(parent, currentNode));
|
|
2294
|
-
break;
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
!found && parent && updateFocus(parent), isChild2 || updateState(!isOpen);
|
|
2298
|
-
}, handleBlur = (event) => {
|
|
2299
|
-
let node = event.currentTarget;
|
|
2300
|
-
!node.contains(document.activeElement) && node.getAttribute("role") === "tree" && node.setAttribute("tabindex", "0");
|
|
2301
|
-
}, handleFocus = (event) => {
|
|
2302
|
-
let node = event.target;
|
|
2303
|
-
if (node.getAttribute("role") === "tree") {
|
|
2304
|
-
let selected = node.querySelector('[aria-selected="true"]');
|
|
2305
|
-
selected ? updateFocus(selected) : moveFocusAdjacent(node, "down"), node.setAttribute("tabindex", "-1");
|
|
2306
|
-
}
|
|
2307
|
-
}, handleButtonFocus = () => {
|
|
2308
|
-
onSelect?.();
|
|
2309
|
-
}, getPaddingStyles = (depth2) => {
|
|
2310
|
-
let space = depth2 * 0.9 + 0.3;
|
|
2311
|
-
return {
|
|
2312
|
-
paddingLeft: `${space}em`,
|
|
2313
|
-
width: `calc(100% - ${space}em)`
|
|
2314
|
-
};
|
|
2315
|
-
}, {
|
|
2316
|
-
isChild,
|
|
2317
|
-
depth,
|
|
2318
|
-
hasHover
|
|
2319
|
-
} = React24.useContext(TreeContext_default), showHover = hasHover ? hover : !1;
|
|
2320
|
-
if (!isChild)
|
|
2321
|
-
return React24.createElement("ul", (0, import_extends2.default)({
|
|
2322
|
-
role: "tree",
|
|
2323
|
-
tabIndex: 0,
|
|
2324
|
-
className: clsx_m_default3(Tree_css_default.tree, Tree_css_default.group, themeClass, className),
|
|
2325
|
-
onFocus: handleFocus,
|
|
2326
|
-
onBlur: handleBlur
|
|
2327
|
-
}, html), React24.createElement(TreeContext_default.Provider, {
|
|
2328
|
-
value: {
|
|
2329
|
-
isChild: !0,
|
|
2330
|
-
depth: 0,
|
|
2331
|
-
hasHover: showHover
|
|
2332
|
-
}
|
|
2333
|
-
}, React24.createElement(Tree, props)));
|
|
2334
|
-
if (!hasChildren)
|
|
2335
|
-
return React24.createElement("li", (0, import_extends2.default)({
|
|
2336
|
-
role: "treeitem",
|
|
2337
|
-
className: Tree_css_default.item
|
|
2338
|
-
}, html), React24.createElement("div", {
|
|
2339
|
-
role: "button",
|
|
2340
|
-
className: clsx_m_default3(Tree_css_default.label, {
|
|
2341
|
-
[Tree_css_default.hover]: showHover,
|
|
2342
|
-
[Tree_css_default.focusWhite]: currentTheme === "firefox"
|
|
2343
|
-
}),
|
|
2344
|
-
tabIndex: -1,
|
|
2345
|
-
style: getPaddingStyles(depth),
|
|
2346
|
-
onKeyDown: (e) => {
|
|
2347
|
-
handleKeypress(e, isChild);
|
|
2348
|
-
},
|
|
2349
|
-
onClick: (e) => handleClick(e, !0),
|
|
2350
|
-
onFocus: handleButtonFocus
|
|
2351
|
-
}, React24.createElement("span", null, label)));
|
|
2352
|
-
let arrowClass = clsx_m_default3(Tree_css_default.arrow, {
|
|
2353
|
-
[Tree_css_default.open]: isOpen
|
|
2354
|
-
});
|
|
2355
|
-
return React24.createElement("li", {
|
|
2356
|
-
role: "treeitem",
|
|
2357
|
-
"aria-expanded": isOpen,
|
|
2358
|
-
className: Tree_css_default.item
|
|
2359
|
-
}, React24.createElement("div", {
|
|
2360
|
-
role: "button",
|
|
2361
|
-
tabIndex: -1,
|
|
2362
|
-
className: clsx_m_default3(Tree_css_default.label, {
|
|
2363
|
-
[Tree_css_default.hover]: showHover,
|
|
2364
|
-
[Tree_css_default.focusWhite]: currentTheme === "firefox"
|
|
2365
|
-
}),
|
|
2366
|
-
style: getPaddingStyles(depth),
|
|
2367
|
-
onClick: (e) => handleClick(e),
|
|
2368
|
-
onKeyDown: (e) => handleKeypress(e),
|
|
2369
|
-
onFocus: handleButtonFocus
|
|
2370
|
-
}, React24.createElement("span", null, React24.createElement("span", {
|
|
2371
|
-
"aria-hidden": !0,
|
|
2372
|
-
className: arrowClass
|
|
2373
|
-
}), React24.createElement("span", null, label))), React24.createElement("ul", (0, import_extends2.default)({
|
|
2374
|
-
role: "group",
|
|
2375
|
-
className: clsx_m_default3(className, Tree_css_default.group)
|
|
2376
|
-
}, html), isOpen && React24.Children.map(children, (child) => React24.createElement(TreeContext_default.Provider, {
|
|
2377
|
-
value: {
|
|
2378
|
-
isChild: !0,
|
|
2379
|
-
depth: depth + 1,
|
|
2380
|
-
hasHover: showHover
|
|
2381
|
-
}
|
|
2382
|
-
}, child))));
|
|
2383
|
-
};
|
|
2384
|
-
Tree.defaultProps = {
|
|
2385
|
-
open: !1,
|
|
2386
|
-
hover: !0
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectValue.js
|
|
2390
|
-
var import_extends3 = __toESM(require_extends()), import_objectWithoutProperties4 = __toESM(require_objectWithoutProperties());
|
|
2391
|
-
import React25, { useState as useState7, useEffect as useEffect6 } from "react";
|
|
2392
|
-
|
|
2393
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectInspector.css.js
|
|
2394
|
-
var ObjectInspector_css_default = { "object-inspector": "ObjectInspector-object-inspector-0c33e82", objectInspector: "ObjectInspector-object-inspector-0c33e82", "object-label": "ObjectInspector-object-label-b81482b", objectLabel: "ObjectInspector-object-label-b81482b", text: "ObjectInspector-text-25f57f3", key: "ObjectInspector-key-4f712bb", value: "ObjectInspector-value-f7ec2e5", string: "ObjectInspector-string-c496000", regex: "ObjectInspector-regex-59d45a3", error: "ObjectInspector-error-b818698", boolean: "ObjectInspector-boolean-2dd1642", number: "ObjectInspector-number-a6daabb", undefined: "ObjectInspector-undefined-3a68263", null: "ObjectInspector-null-74acb50", function: "ObjectInspector-function-07bbdcd", "function-decorator": "ObjectInspector-function-decorator-3d22c24", functionDecorator: "ObjectInspector-function-decorator-3d22c24", prototype: "ObjectInspector-prototype-f2449ee", dark: "ObjectInspector-dark-0c96c97", chrome: "ObjectInspector-chrome-2f3ca98", light: "ObjectInspector-light-78bef54" };
|
|
2395
|
-
|
|
2396
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectValue.js
|
|
2397
|
-
var _excluded3 = ["ast", "theme", "showKey", "colorScheme", "className"], buildValue = (key, value, valueClass, showKey, depth) => {
|
|
2398
|
-
let computedKey = key.includes("-") ? `"${key}"` : key, isRoot = depth <= 0;
|
|
2399
|
-
return React25.createElement("span", {
|
|
2400
|
-
className: ObjectInspector_css_default.text
|
|
2401
|
-
}, !isRoot && showKey && React25.createElement(React25.Fragment, null, React25.createElement("span", {
|
|
2402
|
-
className: ObjectInspector_css_default.key
|
|
2403
|
-
}, computedKey), React25.createElement("span", null, ":\xA0")), React25.createElement("span", {
|
|
2404
|
-
className: valueClass
|
|
2405
|
-
}, value));
|
|
2406
|
-
}, ObjectValue2 = (props) => {
|
|
2407
|
-
let {
|
|
2408
|
-
ast,
|
|
2409
|
-
theme: theme3,
|
|
2410
|
-
showKey,
|
|
2411
|
-
colorScheme,
|
|
2412
|
-
className
|
|
2413
|
-
} = props, html = (0, import_objectWithoutProperties4.default)(props, _excluded3), {
|
|
2414
|
-
themeClass
|
|
2415
|
-
} = useTheme3({
|
|
2416
|
-
theme: theme3,
|
|
2417
|
-
colorScheme
|
|
2418
|
-
}, ObjectInspector_css_default), [asyncValue, setAsyncValue] = useState7(React25.createElement("span", null)), value = React25.createElement("span", null);
|
|
2419
|
-
return useEffect6(() => {
|
|
2420
|
-
ast.value instanceof Promise && (async (promise) => {
|
|
2421
|
-
setAsyncValue(buildValue(ast.key, `Promise { "${await getPromiseState(promise)}" }`, ObjectInspector_css_default.key, showKey, ast.depth));
|
|
2422
|
-
})(ast.value);
|
|
2423
|
-
}, [ast, showKey]), typeof ast.value == "number" || typeof ast.value == "bigint" ? value = buildValue(ast.key, String(ast.value), ObjectInspector_css_default.number, showKey, ast.depth) : typeof ast.value == "boolean" ? value = buildValue(ast.key, String(ast.value), ObjectInspector_css_default.boolean, showKey, ast.depth) : typeof ast.value == "string" ? value = buildValue(ast.key, `"${ast.value}"`, ObjectInspector_css_default.string, showKey, ast.depth) : typeof ast.value > "u" ? value = buildValue(ast.key, "undefined", ObjectInspector_css_default.undefined, showKey, ast.depth) : typeof ast.value == "symbol" ? value = buildValue(ast.key, ast.value.toString(), ObjectInspector_css_default.string, showKey, ast.depth) : typeof ast.value == "function" ? value = buildValue(ast.key, `${ast.value.name}()`, ObjectInspector_css_default.key, showKey, ast.depth) : typeof ast.value == "object" && (ast.value === null ? value = buildValue(ast.key, "null", ObjectInspector_css_default.null, showKey, ast.depth) : Array.isArray(ast.value) ? value = buildValue(ast.key, `Array(${ast.value.length})`, ObjectInspector_css_default.key, showKey, ast.depth) : ast.value instanceof Date ? value = buildValue(ast.key, `Date ${ast.value.toString()}`, ObjectInspector_css_default.value, showKey, ast.depth) : ast.value instanceof RegExp ? value = buildValue(ast.key, ast.value.toString(), ObjectInspector_css_default.regex, showKey, ast.depth) : ast.value instanceof Error ? value = buildValue(ast.key, ast.value.toString(), ObjectInspector_css_default.error, showKey, ast.depth) : isObject(ast.value) ? value = buildValue(ast.key, "{\u2026}", ObjectInspector_css_default.key, showKey, ast.depth) : value = buildValue(ast.key, ast.value.constructor.name, ObjectInspector_css_default.key, showKey, ast.depth)), React25.createElement("span", (0, import_extends3.default)({
|
|
2424
|
-
className: clsx_m_default(themeClass, className)
|
|
2425
|
-
}, html), asyncValue, value);
|
|
2426
|
-
};
|
|
2427
|
-
ObjectValue2.defaultProps = {
|
|
2428
|
-
showKey: !0
|
|
2429
|
-
};
|
|
2430
|
-
var ObjectValue_default = ObjectValue2;
|
|
2431
|
-
|
|
2432
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectLabel.js
|
|
2433
|
-
var import_extends4 = __toESM(require_extends()), import_objectWithoutProperties5 = __toESM(require_objectWithoutProperties());
|
|
2434
|
-
import React26 from "react";
|
|
2435
|
-
var _excluded4 = ["ast", "theme", "previewMax", "open", "colorScheme", "className"], buildPreview = (children, previewMax, showKey) => {
|
|
2436
|
-
let previews = [];
|
|
2437
|
-
for (let i = 0; i < children.length; i++) {
|
|
2438
|
-
let child = children[i];
|
|
2439
|
-
if (child.isPrototype || (previews.push(React26.createElement(ObjectValue_default, {
|
|
2440
|
-
key: child.key,
|
|
2441
|
-
ast: child,
|
|
2442
|
-
showKey
|
|
2443
|
-
})), i < children.length - 1 ? previews.push(", ") : previews.push(" ")), child.isPrototype && i === children.length - 1 && (previews.pop(), previews.push(" ")), i === previewMax - 1 && children.length > previewMax) {
|
|
2444
|
-
previews.push("\u2026 ");
|
|
2445
|
-
break;
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
return previews;
|
|
2449
|
-
}, getArrayLabel = (ast, open, previewMax, theme3) => {
|
|
2450
|
-
let l = ast.value.length;
|
|
2451
|
-
return open ? React26.createElement("span", null, "Array(", l, ")") : React26.createElement(React26.Fragment, null, React26.createElement("span", null, `${theme3 === "firefox" ? "Array" : ""}(${l}) [ `), buildPreview(ast.children, previewMax, !1), React26.createElement("span", null, "]"));
|
|
2452
|
-
}, getObjectLabel = (ast, open, previewMax, theme3) => ast.isPrototype ? React26.createElement("span", null, `Object ${theme3 === "firefox" ? "{ \u2026 }" : ""}`) : open ? React26.createElement("span", null, "{\u2026}") : React26.createElement(React26.Fragment, null, React26.createElement("span", null, `${theme3 === "firefox" ? "Object " : ""}{ `), buildPreview(ast.children, previewMax, !0), React26.createElement("span", null, "}")), getPromiseLabel = (ast, open, previewMax) => open ? React26.createElement("span", null, `Promise { "${String(ast.children[0].value)}" }`) : React26.createElement(React26.Fragment, null, React26.createElement("span", null, "Promise { "), buildPreview(ast.children, previewMax, !0), React26.createElement("span", null, "}")), getMapLabel = (ast, open, previewMax, theme3) => {
|
|
2453
|
-
let {
|
|
2454
|
-
size
|
|
2455
|
-
} = ast.value;
|
|
2456
|
-
return open ? React26.createElement("span", null, `Map(${size})`) : React26.createElement(React26.Fragment, null, React26.createElement("span", null, `Map${theme3 === "chrome" ? `(${size})` : ""} { `), buildPreview(ast.children, previewMax, !0), React26.createElement("span", null, "}"));
|
|
2457
|
-
}, getSetLabel = (ast, open, previewMax) => {
|
|
2458
|
-
let {
|
|
2459
|
-
size
|
|
2460
|
-
} = ast.value;
|
|
2461
|
-
return open ? React26.createElement("span", null, "Set(", size, ")") : React26.createElement(React26.Fragment, null, React26.createElement("span", null, `Set(${ast.value.size}) {`), buildPreview(ast.children, previewMax, !0), React26.createElement("span", null, "}"));
|
|
2462
|
-
}, ObjectLabel2 = (props) => {
|
|
2463
|
-
let {
|
|
2464
|
-
ast,
|
|
2465
|
-
theme: theme3,
|
|
2466
|
-
previewMax,
|
|
2467
|
-
open,
|
|
2468
|
-
colorScheme,
|
|
2469
|
-
className
|
|
2470
|
-
} = props, html = (0, import_objectWithoutProperties5.default)(props, _excluded4), {
|
|
2471
|
-
themeClass,
|
|
2472
|
-
currentTheme
|
|
2473
|
-
} = useTheme3({
|
|
2474
|
-
theme: theme3,
|
|
2475
|
-
colorScheme
|
|
2476
|
-
}, ObjectInspector_css_default), isPrototype = ast.isPrototype || !1, classes = clsx_m_default(ObjectInspector_css_default.objectLabel, themeClass, className, {
|
|
2477
|
-
[ObjectInspector_css_default.prototype]: isPrototype
|
|
2478
|
-
}), isRoot = ast.depth <= 0, Key = () => React26.createElement("span", {
|
|
2479
|
-
className: isPrototype ? ObjectInspector_css_default.prototype : ObjectInspector_css_default.key
|
|
2480
|
-
}, isRoot ? "" : `${ast.key}: `);
|
|
2481
|
-
return ast.type === "array" ? React26.createElement("span", (0, import_extends4.default)({
|
|
2482
|
-
className: classes
|
|
2483
|
-
}, html), React26.createElement(Key, null), getArrayLabel(ast, open, previewMax, currentTheme)) : ast.type === "function" ? React26.createElement("span", (0, import_extends4.default)({
|
|
2484
|
-
className: classes
|
|
2485
|
-
}, html), React26.createElement(Key, null), currentTheme === "chrome" && React26.createElement("span", {
|
|
2486
|
-
className: ObjectInspector_css_default.functionDecorator
|
|
2487
|
-
}, "\u0192 "), React26.createElement("span", {
|
|
2488
|
-
className: clsx_m_default({
|
|
2489
|
-
[ObjectInspector_css_default.function]: !isPrototype
|
|
2490
|
-
})
|
|
2491
|
-
}, `${ast.value.name}()`)) : ast.type === "promise" ? React26.createElement("span", (0, import_extends4.default)({
|
|
2492
|
-
className: classes
|
|
2493
|
-
}, html), React26.createElement(Key, null), getPromiseLabel(ast, open, previewMax)) : ast.type === "map" ? React26.createElement("span", (0, import_extends4.default)({
|
|
2494
|
-
className: classes
|
|
2495
|
-
}, html), React26.createElement(Key, null), getMapLabel(ast, open, previewMax, currentTheme)) : ast.type === "set" ? React26.createElement("span", (0, import_extends4.default)({
|
|
2496
|
-
className: classes
|
|
2497
|
-
}, html), React26.createElement(Key, null), getSetLabel(ast, open, previewMax)) : React26.createElement("span", (0, import_extends4.default)({
|
|
2498
|
-
className: classes
|
|
2499
|
-
}, html), React26.createElement(Key, null), getObjectLabel(ast, open, previewMax, currentTheme));
|
|
2500
|
-
};
|
|
2501
|
-
ObjectLabel2.defaultProps = {
|
|
2502
|
-
previewMax: 8,
|
|
2503
|
-
open: !1
|
|
2504
|
-
};
|
|
2505
|
-
var ObjectLabel_default = ObjectLabel2;
|
|
2506
|
-
|
|
2507
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectInspectorItem.js
|
|
2508
|
-
var ObjectInspectorItem = (props) => {
|
|
2509
|
-
let {
|
|
2510
|
-
ast,
|
|
2511
|
-
expandLevel,
|
|
2512
|
-
depth
|
|
2513
|
-
} = props, [resolved, setResolved] = useState8(), [open, setOpen] = useState8(depth < expandLevel);
|
|
2514
|
-
return useEffect7(() => {
|
|
2515
|
-
(async () => {
|
|
2516
|
-
if (ast.type !== "value") {
|
|
2517
|
-
let promises = ast.children.map((f) => f()), children = await Promise.all(promises), r = (0, import_objectSpread22.default)((0, import_objectSpread22.default)({}, ast), {}, {
|
|
2518
|
-
children
|
|
2519
|
-
});
|
|
2520
|
-
setResolved(r);
|
|
2521
|
-
}
|
|
2522
|
-
})();
|
|
2523
|
-
}, [ast]), resolved ? React27.createElement(Tree, {
|
|
2524
|
-
hover: !1,
|
|
2525
|
-
open,
|
|
2526
|
-
label: React27.createElement(ObjectLabel_default, {
|
|
2527
|
-
open,
|
|
2528
|
-
ast: resolved
|
|
2529
|
-
}),
|
|
2530
|
-
onSelect: () => {
|
|
2531
|
-
var _props$onSelect;
|
|
2532
|
-
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, ast);
|
|
2533
|
-
},
|
|
2534
|
-
onUpdate: (value) => {
|
|
2535
|
-
setOpen(value);
|
|
2536
|
-
}
|
|
2537
|
-
}, resolved.children.map((child) => React27.createElement(ObjectInspectorItem, {
|
|
2538
|
-
key: child.key,
|
|
2539
|
-
ast: child,
|
|
2540
|
-
depth: depth + 1,
|
|
2541
|
-
expandLevel,
|
|
2542
|
-
onSelect: props.onSelect
|
|
2543
|
-
}))) : React27.createElement(Tree, {
|
|
2544
|
-
hover: !1,
|
|
2545
|
-
label: React27.createElement(ObjectValue_default, {
|
|
2546
|
-
ast
|
|
2547
|
-
}),
|
|
2548
|
-
onSelect: () => {
|
|
2549
|
-
var _props$onSelect2;
|
|
2550
|
-
(_props$onSelect2 = props.onSelect) === null || _props$onSelect2 === void 0 || _props$onSelect2.call(props, ast);
|
|
2551
|
-
}
|
|
2552
|
-
});
|
|
2553
|
-
};
|
|
2554
|
-
ObjectInspectorItem.defaultProps = {
|
|
2555
|
-
expandLevel: 0,
|
|
2556
|
-
depth: 0
|
|
2557
|
-
};
|
|
2558
|
-
var ObjectInspectorItem_default = ObjectInspectorItem;
|
|
2559
|
-
|
|
2560
|
-
// ../../node_modules/@devtools-ds/object-inspector/dist/esm/ObjectInspector.js
|
|
2561
|
-
var _excluded5 = ["data", "expandLevel", "sortKeys", "includePrototypes", "className", "theme", "colorScheme", "onSelect"], ObjectInspector2 = (props) => {
|
|
2562
|
-
let {
|
|
2563
|
-
data,
|
|
2564
|
-
expandLevel,
|
|
2565
|
-
sortKeys,
|
|
2566
|
-
includePrototypes,
|
|
2567
|
-
className,
|
|
2568
|
-
theme: theme3,
|
|
2569
|
-
colorScheme,
|
|
2570
|
-
onSelect
|
|
2571
|
-
} = props, html = (0, import_objectWithoutProperties6.default)(props, _excluded5), [ast, setAST] = useState9(void 0), {
|
|
2572
|
-
themeClass,
|
|
2573
|
-
currentTheme,
|
|
2574
|
-
currentColorScheme
|
|
2575
|
-
} = useTheme3({
|
|
2576
|
-
theme: theme3,
|
|
2577
|
-
colorScheme
|
|
2578
|
-
}, ObjectInspector_css_default);
|
|
2579
|
-
return useEffect8(() => {
|
|
2580
|
-
(async () => setAST(await parse(data, sortKeys, includePrototypes)))();
|
|
2581
|
-
}, [data, sortKeys, includePrototypes]), React28.createElement("div", (0, import_extends5.default)({
|
|
2582
|
-
className: clsx_m_default(ObjectInspector_css_default.objectInspector, className, themeClass)
|
|
2583
|
-
}, html), ast && React28.createElement(ThemeProvider, {
|
|
2584
|
-
theme: currentTheme,
|
|
2585
|
-
colorScheme: currentColorScheme
|
|
2586
|
-
}, React28.createElement(ObjectInspectorItem_default, {
|
|
2587
|
-
ast,
|
|
2588
|
-
expandLevel,
|
|
2589
|
-
onSelect
|
|
2590
|
-
})));
|
|
2591
|
-
};
|
|
2592
|
-
ObjectInspector2.defaultProps = {
|
|
2593
|
-
expandLevel: 0,
|
|
2594
|
-
sortKeys: !0,
|
|
2595
|
-
includePrototypes: !0
|
|
2596
|
-
};
|
|
2597
|
-
|
|
2598
|
-
// src/component-testing/components/MethodCall.tsx
|
|
2599
|
-
import { useTheme as useTheme4 } from "@aussieljk/forkbook/theming";
|
|
1735
|
+
import { useTheme as useTheme3 } from "@aussieljk/forkbook/theming";
|
|
2600
1736
|
import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2601
1737
|
var colorsLight = {
|
|
2602
1738
|
base: "#444",
|
|
@@ -2649,7 +1785,7 @@ var colorsLight = {
|
|
|
2649
1785
|
meta: "#FAD483",
|
|
2650
1786
|
method: "#5EC1FF"
|
|
2651
1787
|
}, useThemeColors = () => {
|
|
2652
|
-
let { base } =
|
|
1788
|
+
let { base } = useTheme3();
|
|
2653
1789
|
return base === "dark" ? colorsDark : colorsLight;
|
|
2654
1790
|
}, special = /[^A-Z0-9]/i, trimEnd = /[\s.,…]+$/gm, ellipsize = (string2, maxlength) => {
|
|
2655
1791
|
if (string2.length <= maxlength)
|
|
@@ -2664,8 +1800,8 @@ var colorsLight = {
|
|
|
2664
1800
|
} catch {
|
|
2665
1801
|
return String(value);
|
|
2666
1802
|
}
|
|
2667
|
-
}, interleave = (nodes, separator) => nodes.flatMap(
|
|
2668
|
-
(node, index) => index === nodes.length - 1 ? [node] : [node,
|
|
1803
|
+
}, isSerialized = (value, key) => value != null && Object.prototype.hasOwnProperty.call(value, key), interleave = (nodes, separator) => nodes.flatMap(
|
|
1804
|
+
(node, index) => index === nodes.length - 1 ? [node] : [node, React20.cloneElement(separator, { key: `sep${index}` })]
|
|
2669
1805
|
), Node2 = ({
|
|
2670
1806
|
value,
|
|
2671
1807
|
nested,
|
|
@@ -2686,23 +1822,23 @@ var colorsLight = {
|
|
|
2686
1822
|
return jsx11(NumberNode, { ...props, value });
|
|
2687
1823
|
case typeof value == "boolean":
|
|
2688
1824
|
return jsx11(BooleanNode, { ...props, value });
|
|
2689
|
-
case
|
|
1825
|
+
case isSerialized(value, "__date__"):
|
|
2690
1826
|
return jsx11(DateNode, { ...props, ...value.__date__ });
|
|
2691
|
-
case
|
|
1827
|
+
case isSerialized(value, "__error__"):
|
|
2692
1828
|
return jsx11(ErrorNode, { ...props, ...value.__error__ });
|
|
2693
|
-
case
|
|
1829
|
+
case isSerialized(value, "__regexp__"):
|
|
2694
1830
|
return jsx11(RegExpNode, { ...props, ...value.__regexp__ });
|
|
2695
|
-
case
|
|
1831
|
+
case isSerialized(value, "__function__"):
|
|
2696
1832
|
return jsx11(FunctionNode, { ...props, ...value.__function__ });
|
|
2697
|
-
case
|
|
1833
|
+
case isSerialized(value, "__symbol__"):
|
|
2698
1834
|
return jsx11(SymbolNode, { ...props, ...value.__symbol__ });
|
|
2699
|
-
case
|
|
1835
|
+
case isSerialized(value, "__element__"):
|
|
2700
1836
|
return jsx11(ElementNode, { ...props, ...value.__element__ });
|
|
2701
|
-
case
|
|
1837
|
+
case isSerialized(value, "__class__"):
|
|
2702
1838
|
return jsx11(ClassNode, { ...props, ...value.__class__ });
|
|
2703
|
-
case
|
|
1839
|
+
case isSerialized(value, "__callId__"):
|
|
2704
1840
|
return jsx11(MethodCall, { call: callsById?.get(value.__callId__), callsById });
|
|
2705
|
-
case Object.prototype.toString.call(value) === "[object Object]":
|
|
1841
|
+
case (typeof value == "object" && Object.prototype.toString.call(value) === "[object Object]"):
|
|
2706
1842
|
return jsx11(
|
|
2707
1843
|
ObjectNode,
|
|
2708
1844
|
{
|
|
@@ -2756,17 +1892,16 @@ var colorsLight = {
|
|
|
2756
1892
|
callsById,
|
|
2757
1893
|
nested = !1
|
|
2758
1894
|
}) => {
|
|
2759
|
-
let
|
|
1895
|
+
let { base, addonActionsTheme } = useTheme3(), isDarkMode = base === "dark", colors = useThemeColors();
|
|
2760
1896
|
if (showInspector)
|
|
2761
|
-
return jsx11(Fragment6, { children: jsx11(
|
|
2762
|
-
|
|
1897
|
+
return jsx11(Fragment6, { children: jsx11("span", { id: "interactions-object-inspector", children: jsx11(
|
|
1898
|
+
themedObjectInspector,
|
|
2763
1899
|
{
|
|
2764
|
-
id: "interactions-object-inspector",
|
|
2765
1900
|
data: value,
|
|
2766
|
-
|
|
2767
|
-
|
|
1901
|
+
showNonenumerable: !1,
|
|
1902
|
+
theme: addonActionsTheme ?? (isDarkMode ? "chromeDark" : "chromeLight")
|
|
2768
1903
|
}
|
|
2769
|
-
) });
|
|
1904
|
+
) }) });
|
|
2770
1905
|
if (nested)
|
|
2771
1906
|
return jsx11("span", { style: { color: colors.base }, children: "{\u2026}" });
|
|
2772
1907
|
let nodelist = interleave(
|
|
@@ -2800,7 +1935,7 @@ var colorsLight = {
|
|
|
2800
1935
|
}, ElementNode = ({
|
|
2801
1936
|
prefix,
|
|
2802
1937
|
localName,
|
|
2803
|
-
id:
|
|
1938
|
+
id: id14,
|
|
2804
1939
|
classNames = [],
|
|
2805
1940
|
innerText
|
|
2806
1941
|
}) => {
|
|
@@ -2808,9 +1943,9 @@ var colorsLight = {
|
|
|
2808
1943
|
return jsxs9("span", { style: { wordBreak: "keep-all" }, children: [
|
|
2809
1944
|
jsx11("span", { style: { color: colors.muted }, children: "<" }, `${name}_lt`),
|
|
2810
1945
|
jsx11("span", { style: { color: colors.tag.name }, children: name }, `${name}_tag`),
|
|
2811
|
-
jsx11("span", { style: { color: colors.tag.suffix }, children:
|
|
1946
|
+
jsx11("span", { style: { color: colors.tag.suffix }, children: id14 ? `#${id14}` : classNames.reduce((acc, className) => `${acc}.${className}`, "") }, `${name}_suffix`),
|
|
2812
1947
|
jsx11("span", { style: { color: colors.muted }, children: ">" }, `${name}_gt`),
|
|
2813
|
-
!
|
|
1948
|
+
!id14 && classNames.length === 0 && innerText && jsxs9(Fragment6, { children: [
|
|
2814
1949
|
jsx11("span", { children: innerText }, `${name}_text`),
|
|
2815
1950
|
jsx11("span", { style: { color: colors.muted }, children: "<" }, `${name}_close_lt`),
|
|
2816
1951
|
jsxs9("span", { style: { color: colors.tag.name }, children: [
|
|
@@ -2867,7 +2002,7 @@ var colorsLight = {
|
|
|
2867
2002
|
let colors = useThemeColors();
|
|
2868
2003
|
return jsx11("span", { style: { color: colors.meta }, children: stringify(value) });
|
|
2869
2004
|
}, StepNode = ({ label }) => {
|
|
2870
|
-
let colors = useThemeColors(), { typography } =
|
|
2005
|
+
let colors = useThemeColors(), { typography } = useTheme3();
|
|
2871
2006
|
return jsx11(
|
|
2872
2007
|
"span",
|
|
2873
2008
|
{
|
|
@@ -2886,11 +2021,11 @@ var colorsLight = {
|
|
|
2886
2021
|
if (!call)
|
|
2887
2022
|
return null;
|
|
2888
2023
|
if (call.method === "step" && call.path?.length === 0)
|
|
2889
|
-
return jsx11(StepNode, { label: call.args[0] });
|
|
2024
|
+
return jsx11(StepNode, { label: String(call.args[0]) });
|
|
2890
2025
|
let path = call.path?.flatMap((elem, index) => {
|
|
2891
2026
|
let callId = elem.__callId__;
|
|
2892
2027
|
return [
|
|
2893
|
-
callId ? jsx11(MethodCall, { call: callsById?.get(callId), callsById }, `elem${index}`) : jsx11("span", { children: elem }, `elem${index}`),
|
|
2028
|
+
callId ? jsx11(MethodCall, { call: callsById?.get(callId), callsById }, `elem${index}`) : jsx11("span", { children: String(elem) }, `elem${index}`),
|
|
2894
2029
|
jsx11("wbr", {}, `wbr${index}`),
|
|
2895
2030
|
jsx11("span", { children: "." }, `dot${index}`)
|
|
2896
2031
|
];
|
|
@@ -2911,13 +2046,13 @@ var colorsLight = {
|
|
|
2911
2046
|
] });
|
|
2912
2047
|
};
|
|
2913
2048
|
|
|
2914
|
-
//
|
|
2049
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/MatcherResult.module.css
|
|
2915
2050
|
var id6 = "core/src/component-testing/components/MatcherResult.module.css";
|
|
2916
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2051
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id6}"]`)) {
|
|
2917
2052
|
let style = document.createElement("style");
|
|
2918
|
-
style.setAttribute("data-
|
|
2053
|
+
style.setAttribute("data-fb-css", id6), style.textContent = ".fb-cs81pG-expected{color:var(--fb-color-positive-text)}.fb-cs81pG-received{color:var(--fb-color-negative-text)}:where([data-fb-theme=dark]){& .fb-cs81pG-expected{color:var(--fb-color-positive)}& .fb-cs81pG-received{color:var(--fb-color-negative)}}", document.head.appendChild(style);
|
|
2919
2054
|
}
|
|
2920
|
-
var MatcherResult_default = { received: "
|
|
2055
|
+
var MatcherResult_default = { received: "fb-cs81pG-received", expected: "fb-cs81pG-expected" };
|
|
2921
2056
|
|
|
2922
2057
|
// src/component-testing/components/MatcherResult.tsx
|
|
2923
2058
|
import { Fragment as Fragment7, jsx as jsx12 } from "react/jsx-runtime";
|
|
@@ -2932,7 +2067,13 @@ var getParams = (line, fromIndex = 0) => {
|
|
|
2932
2067
|
} catch {
|
|
2933
2068
|
return value;
|
|
2934
2069
|
}
|
|
2935
|
-
}, Received = (
|
|
2070
|
+
}, Received = (props) => props.parsed ? jsx12(Node2, { showObjectInspector: !0, value: props.value, style: { color: "#D43900" } }) : jsx12("span", { className: MatcherResult_default.received, children: props.value }), Expected = (props) => {
|
|
2071
|
+
if (props.parsed) {
|
|
2072
|
+
let { value } = props;
|
|
2073
|
+
return typeof value == "string" && value.startsWith("called with") ? jsx12(Fragment7, { children: value }) : jsx12(Node2, { showObjectInspector: !0, value, style: { color: "#16B242" } });
|
|
2074
|
+
}
|
|
2075
|
+
return jsx12("span", { className: MatcherResult_default.expected, children: props.value });
|
|
2076
|
+
}, MatcherResult = ({
|
|
2936
2077
|
message,
|
|
2937
2078
|
style = {}
|
|
2938
2079
|
}) => {
|
|
@@ -2944,7 +2085,7 @@ var getParams = (line, fromIndex = 0) => {
|
|
|
2944
2085
|
style: {
|
|
2945
2086
|
margin: 0,
|
|
2946
2087
|
padding: "8px 10px 8px 36px",
|
|
2947
|
-
fontSize: "var(--
|
|
2088
|
+
fontSize: "var(--fb-size-s1)",
|
|
2948
2089
|
...style
|
|
2949
2090
|
},
|
|
2950
2091
|
children: lines.flatMap((line, index) => {
|
|
@@ -3006,16 +2147,16 @@ var getParams = (line, fromIndex = 0) => {
|
|
|
3006
2147
|
};
|
|
3007
2148
|
|
|
3008
2149
|
// src/component-testing/components/StatusIcon.tsx
|
|
3009
|
-
import { CheckIcon as CheckIcon2, CircleIcon, PlayIcon,
|
|
3010
|
-
import { useTheme as
|
|
2150
|
+
import { CheckIcon as CheckIcon2, CircleIcon, PlayIcon, CircleStopIcon } from "lucide-react";
|
|
2151
|
+
import { useTheme as useTheme4 } from "@aussieljk/forkbook/theming";
|
|
3011
2152
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
3012
2153
|
var StatusIcon = ({ status }) => {
|
|
3013
|
-
let theme3 =
|
|
2154
|
+
let theme3 = useTheme4();
|
|
3014
2155
|
switch (status) {
|
|
3015
2156
|
case "done" /* DONE */:
|
|
3016
2157
|
return jsx13(CheckIcon2, { color: theme3.color.positive, "data-testid": "icon-done" });
|
|
3017
2158
|
case "error" /* ERROR */:
|
|
3018
|
-
return jsx13(
|
|
2159
|
+
return jsx13(CircleStopIcon, { color: theme3.color.negative, "data-testid": "icon-error" });
|
|
3019
2160
|
case "active" /* ACTIVE */:
|
|
3020
2161
|
return jsx13(PlayIcon, { color: theme3.color.secondary, "data-testid": "icon-active" });
|
|
3021
2162
|
case "waiting" /* WAITING */:
|
|
@@ -3038,13 +2179,13 @@ var StatusIcon = ({ status }) => {
|
|
|
3038
2179
|
}
|
|
3039
2180
|
};
|
|
3040
2181
|
|
|
3041
|
-
//
|
|
2182
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/Interaction.module.css
|
|
3042
2183
|
var id7 = "core/src/component-testing/components/Interaction.module.css";
|
|
3043
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2184
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id7}"]`)) {
|
|
3044
2185
|
let style = document.createElement("style");
|
|
3045
|
-
style.setAttribute("data-
|
|
2186
|
+
style.setAttribute("data-fb-css", id7), style.textContent = '.fb-PYwdvq-methodCall{font-family:var(--fb-font-mono);font-size:var(--fb-size-s1);overflow-wrap:break-word;inline-size:calc(100% - 40px)}.fb-PYwdvq-row{border-bottom:1px solid var(--fb-app-border-color);font-family:var(--fb-font-base);flex-direction:column;font-size:13px;list-style:none;display:flex;position:relative;&[data-status=error]{background-color:var(--fb-background-warning)}&[data-paused]:before{content:"";z-index:1;border-top:4.5px solid #0000;border-left:7px solid var(--fb-color-warning);border-bottom:4.5px solid #0000;position:absolute;top:-5px}&[data-paused]:after{content:"";z-index:1;border-top:1.5px solid var(--fb-color-warning);width:100%;position:absolute;top:-1px}}:where([data-fb-theme=dark]) .fb-PYwdvq-row[data-status=error]{background-color:rgb(from var(--fb-color-negative) r g b / calc(alpha - .93))}.fb-PYwdvq-rowHeader{display:flex;&:not([data-navigation-disabled]):hover{background:var(--fb-background-hoverable)}}.fb-PYwdvq-rowLabel{text-align:start;cursor:pointer;background:0 0;border:0;flex:1;grid-template-columns:15px 1fr;align-items:center;min-height:40px;margin:0;padding:8px 15px;display:grid;&:disabled,&[data-status=error]{cursor:default}&:focus-visible{box-shadow:inset 3px 0 0 0 var(--fb-color-secondary);background:var(--fb-background-hoverable);outline:0}&[data-status=error]:focus-visible{box-shadow:inset 3px 0 0 0 var(--fb-color-warning);background:0 0}&[data-status=waiting]>div{opacity:.5}}.fb-PYwdvq-rowActions{align-items:center;padding:6px;display:flex}.fb-PYwdvq-button{color:var(--fb-text-muted-color);margin:0 3px}.fb-PYwdvq-rowMessage{font-size:var(--fb-size-s1);color:var(--fb-color-default-text);padding:8px 10px 8px 36px;& pre{margin:0;padding:0}}.fb-PYwdvq-errorName{color:#0271b6}.fb-PYwdvq-errorMessage{color:#444}.fb-PYwdvq-errorExplainer{color:var(--fb-color-negative-text);font-size:var(--fb-size-s2);text-wrap:balance;max-width:500px}:where([data-fb-theme=dark]){& .fb-PYwdvq-errorName{color:#5ec1ff}& .fb-PYwdvq-errorMessage{color:#eee}& .fb-PYwdvq-errorExplainer{color:var(--fb-color-negative)}}', document.head.appendChild(style);
|
|
3046
2187
|
}
|
|
3047
|
-
var Interaction_default = {
|
|
2188
|
+
var Interaction_default = { rowLabel: "fb-PYwdvq-rowLabel", rowActions: "fb-PYwdvq-rowActions", errorName: "fb-PYwdvq-errorName", button: "fb-PYwdvq-button", errorMessage: "fb-PYwdvq-errorMessage", errorExplainer: "fb-PYwdvq-errorExplainer", row: "fb-PYwdvq-row", rowMessage: "fb-PYwdvq-rowMessage", rowHeader: "fb-PYwdvq-rowHeader", methodCall: "fb-PYwdvq-methodCall" };
|
|
3048
2189
|
|
|
3049
2190
|
// src/component-testing/components/Interaction.tsx
|
|
3050
2191
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
@@ -3116,7 +2257,7 @@ ${exception.diff}` : ""}`,
|
|
|
3116
2257
|
toggleCollapsed,
|
|
3117
2258
|
pausedAt
|
|
3118
2259
|
}) => {
|
|
3119
|
-
let [isHovered, setIsHovered] =
|
|
2260
|
+
let [isHovered, setIsHovered] = React21.useState(!1), isNavigationDisabled = !controlStates.goto || !call.interceptable || !!call.ancestors?.length, stepName = extractStepName(call), interactionStatus = getInteractionStatusText(call);
|
|
3120
2261
|
return isHidden || call.id === INTERNAL_RENDER_CALL_ID ? null : jsxs10(
|
|
3121
2262
|
"li",
|
|
3122
2263
|
{
|
|
@@ -3177,13 +2318,13 @@ ${exception.diff}` : ""}`,
|
|
|
3177
2318
|
import { Link as Link3 } from "@aussieljk/forkbook/internal/components";
|
|
3178
2319
|
import { useStorybookApi as useStorybookApi5 } from "@aussieljk/forkbook/manager-api";
|
|
3179
2320
|
|
|
3180
|
-
//
|
|
2321
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/TestDiscrepancyMessage.module.css
|
|
3181
2322
|
var id8 = "core/src/component-testing/components/TestDiscrepancyMessage.module.css";
|
|
3182
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2323
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id8}"]`)) {
|
|
3183
2324
|
let style = document.createElement("style");
|
|
3184
|
-
style.setAttribute("data-
|
|
2325
|
+
style.setAttribute("data-fb-css", id8), style.textContent = ".fb-wob9GG-message{text-align:start;font-size:calc(var(--fb-size-s2) - 1px);font-weight:var(--fb-weight-regular);background:var(--fb-background-app);border-bottom:1px solid var(--fb-color-border);color:var(--fb-color-default-text);background-clip:padding-box;padding:11px 15px;line-height:1rem;position:relative}.fb-wob9GG-message code{font-size:calc(var(--fb-size-s1) - 1px);color:inherit;background:#fffc;border-radius:2px;margin:0 .2em;padding:0 .2em;box-shadow:0 0 0 1px #0000001a}", document.head.appendChild(style);
|
|
3185
2326
|
}
|
|
3186
|
-
var TestDiscrepancyMessage_default = { message: "
|
|
2327
|
+
var TestDiscrepancyMessage_default = { message: "fb-wob9GG-message" };
|
|
3187
2328
|
|
|
3188
2329
|
// src/component-testing/components/TestDiscrepancyMessage.tsx
|
|
3189
2330
|
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -3212,24 +2353,24 @@ import {
|
|
|
3212
2353
|
Toolbar as SharedToolbar
|
|
3213
2354
|
} from "@aussieljk/forkbook/internal/components";
|
|
3214
2355
|
import {
|
|
2356
|
+
RefreshCwIcon,
|
|
3215
2357
|
FastForwardIcon,
|
|
3216
|
-
PlayBackIcon,
|
|
3217
|
-
PlayNextIcon,
|
|
3218
2358
|
RewindIcon,
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
2359
|
+
SkipBackIcon,
|
|
2360
|
+
SkipForwardIcon
|
|
2361
|
+
} from "lucide-react";
|
|
2362
|
+
import { useTheme as useTheme5 } from "@aussieljk/forkbook/theming";
|
|
3222
2363
|
|
|
3223
2364
|
// src/component-testing/components/StatusBadge.tsx
|
|
3224
2365
|
import { TooltipNote, WithTooltip } from "@aussieljk/forkbook/internal/components";
|
|
3225
2366
|
|
|
3226
|
-
//
|
|
2367
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/StatusBadge.module.css
|
|
3227
2368
|
var id9 = "core/src/component-testing/components/StatusBadge.module.css";
|
|
3228
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2369
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id9}"]`)) {
|
|
3229
2370
|
let style = document.createElement("style");
|
|
3230
|
-
style.setAttribute("data-
|
|
2371
|
+
style.setAttribute("data-fb-css", id9), style.textContent = ".fb-R5-BBa-badge{color:#fff;font-family:var(--fb-font-base);text-transform:uppercase;font-size:var(--fb-size-s1);letter-spacing:3px;font-weight:var(--fb-weight-bold);text-align:center;border-radius:4px;min-width:65px;padding:4px 6px 4px 8px;display:inline-block}", document.head.appendChild(style);
|
|
3231
2372
|
}
|
|
3232
|
-
var StatusBadge_default = { badge: "
|
|
2373
|
+
var StatusBadge_default = { badge: "fb-R5-BBa-badge" };
|
|
3233
2374
|
|
|
3234
2375
|
// src/component-testing/components/StatusBadge.tsx
|
|
3235
2376
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
@@ -3264,7 +2405,7 @@ var StatusColorMapping = {
|
|
|
3264
2405
|
"div",
|
|
3265
2406
|
{
|
|
3266
2407
|
className: StatusBadge_default.badge,
|
|
3267
|
-
style: { backgroundColor: `var(--
|
|
2408
|
+
style: { backgroundColor: `var(--fb-color-${StatusColorMapping[status]})` },
|
|
3268
2409
|
"aria-label": `Story status: ${badgeText}`,
|
|
3269
2410
|
children: badgeText
|
|
3270
2411
|
}
|
|
@@ -3273,13 +2414,13 @@ var StatusColorMapping = {
|
|
|
3273
2414
|
);
|
|
3274
2415
|
};
|
|
3275
2416
|
|
|
3276
|
-
//
|
|
2417
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/Toolbar.module.css
|
|
3277
2418
|
var id10 = "core/src/component-testing/components/Toolbar.module.css";
|
|
3278
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2419
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id10}"]`)) {
|
|
3279
2420
|
let style = document.createElement("style");
|
|
3280
|
-
style.setAttribute("data-
|
|
2421
|
+
style.setAttribute("data-fb-css", id10), style.textContent = ".fb-W9rv1G-wrapper{box-shadow:var(--fb-app-border-color) 0 -1px 0 0 inset;background:var(--fb-background-app);z-index:1;position:sticky;top:0}.fb-W9rv1G-controlsGroup{flex:1;align-items:center;gap:6px;display:flex}.fb-W9rv1G-iconButton{color:var(--fb-text-muted-color)}.fb-W9rv1G-rewindButton{margin-inline-start:3px;}.fb-W9rv1G-jumpToEndButton{color:var(--fb-text-muted-color);border-radius:4px;margin-inline:3px;padding:6px;line-height:12px;&:not(:disabled):hover,&:not(:disabled):focus-visible{color:var(--fb-color-secondary)}}.fb-W9rv1G-openInEditorButton{color:var(--fb-color-secondary);font-weight:var(--fb-weight-bold);text-align:right;white-space:nowrap;justify-content:flex-end;font-size:13px;line-height:24px}.fb-W9rv1G-location{color:var(--fb-text-muted-color);cursor:default;font-weight:var(--fb-weight-regular);text-align:right;white-space:nowrap;justify-content:flex-end;margin:0;font-size:13px}", document.head.appendChild(style);
|
|
3281
2422
|
}
|
|
3282
|
-
var Toolbar_default = {
|
|
2423
|
+
var Toolbar_default = { iconButton: "fb-W9rv1G-iconButton", wrapper: "fb-W9rv1G-wrapper", controlsGroup: "fb-W9rv1G-controlsGroup", jumpToEndButton: "fb-W9rv1G-jumpToEndButton", location: "fb-W9rv1G-location", openInEditorButton: "fb-W9rv1G-openInEditorButton", rewindButton: "fb-W9rv1G-rewindButton fb-W9rv1G-iconButton" };
|
|
3283
2424
|
|
|
3284
2425
|
// src/component-testing/components/Toolbar.tsx
|
|
3285
2426
|
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -3293,7 +2434,7 @@ var Toolbar = ({
|
|
|
3293
2434
|
canOpenInEditor,
|
|
3294
2435
|
api
|
|
3295
2436
|
}) => {
|
|
3296
|
-
let buttonText = status === "errored" ? "Scroll to error" : "Scroll to end", theme3 =
|
|
2437
|
+
let buttonText = status === "errored" ? "Scroll to error" : "Scroll to end", theme3 = useTheme5(), preventFocusLoss = (e) => e.preventDefault();
|
|
3297
2438
|
return jsx17("div", { className: Toolbar_default.wrapper, children: jsxs12(
|
|
3298
2439
|
SharedToolbar,
|
|
3299
2440
|
{
|
|
@@ -3338,7 +2479,7 @@ var Toolbar = ({
|
|
|
3338
2479
|
onClick: controls.back,
|
|
3339
2480
|
onPointerDown: preventFocusLoss,
|
|
3340
2481
|
disabled: !controlStates.back,
|
|
3341
|
-
children: jsx17(
|
|
2482
|
+
children: jsx17(SkipBackIcon, {})
|
|
3342
2483
|
}
|
|
3343
2484
|
),
|
|
3344
2485
|
jsx17(
|
|
@@ -3351,7 +2492,7 @@ var Toolbar = ({
|
|
|
3351
2492
|
onClick: controls.next,
|
|
3352
2493
|
onPointerDown: preventFocusLoss,
|
|
3353
2494
|
disabled: !controlStates.next,
|
|
3354
|
-
children: jsx17(
|
|
2495
|
+
children: jsx17(SkipForwardIcon, {})
|
|
3355
2496
|
}
|
|
3356
2497
|
),
|
|
3357
2498
|
jsx17(
|
|
@@ -3376,7 +2517,7 @@ var Toolbar = ({
|
|
|
3376
2517
|
ariaLabel: "Rerun",
|
|
3377
2518
|
onClick: controls.rerun,
|
|
3378
2519
|
onPointerDown: preventFocusLoss,
|
|
3379
|
-
children: jsx17(
|
|
2520
|
+
children: jsx17(RefreshCwIcon, {})
|
|
3380
2521
|
}
|
|
3381
2522
|
)
|
|
3382
2523
|
] }),
|
|
@@ -3401,13 +2542,13 @@ var Toolbar = ({
|
|
|
3401
2542
|
) });
|
|
3402
2543
|
};
|
|
3403
2544
|
|
|
3404
|
-
//
|
|
2545
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/InteractionsPanel.module.css
|
|
3405
2546
|
var id11 = "core/src/component-testing/components/InteractionsPanel.module.css";
|
|
3406
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2547
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id11}"]`)) {
|
|
3407
2548
|
let style = document.createElement("style");
|
|
3408
|
-
style.setAttribute("data-
|
|
2549
|
+
style.setAttribute("data-fb-css", id11), style.textContent = ".fb-RpIDLa-container{background:var(--fb-background-content);height:100%}.fb-RpIDLa-section{position:relative}.fb-RpIDLa-heading{white-space:nowrap;clip:rect(0, 0, 0, 0);clip-path:inset(50%);border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fb-RpIDLa-list{margin:0;padding:0}.fb-RpIDLa-caughtException{border-bottom:1px solid var(--fb-app-border-color);background-color:var(--fb-background-warning);font-size:calc(var(--fb-size-s2) - 1px);padding:15px;line-height:19px}:where([data-fb-theme=dark]) .fb-RpIDLa-caughtException{background-color:rgb(from var(--fb-color-negative) r g b / calc(alpha - .93))}.fb-RpIDLa-caughtExceptionCode{font-size:calc(var(--fb-size-s1) - 1px);vertical-align:top;border:1px solid var(--fb-app-border-color);background:#0000000d;border-radius:3px;margin:0 1px;padding:3px;line-height:1}.fb-RpIDLa-caughtExceptionTitle{padding-bottom:4px;font-weight:700}.fb-RpIDLa-caughtExceptionDescription{margin:0;padding:0 0 20px}.fb-RpIDLa-caughtExceptionStack{font-size:calc(var(--fb-size-s1) - 1px);margin:0;padding:0;&:not(:last-child){padding-bottom:16px}}", document.head.appendChild(style);
|
|
3409
2550
|
}
|
|
3410
|
-
var InteractionsPanel_default = {
|
|
2551
|
+
var InteractionsPanel_default = { container: "fb-RpIDLa-container", heading: "fb-RpIDLa-heading", caughtException: "fb-RpIDLa-caughtException", list: "fb-RpIDLa-list", caughtExceptionTitle: "fb-RpIDLa-caughtExceptionTitle", section: "fb-RpIDLa-section", caughtExceptionStack: "fb-RpIDLa-caughtExceptionStack", caughtExceptionCode: "fb-RpIDLa-caughtExceptionCode", caughtExceptionDescription: "fb-RpIDLa-caughtExceptionDescription" };
|
|
3411
2552
|
|
|
3412
2553
|
// src/component-testing/components/InteractionsPanel.tsx
|
|
3413
2554
|
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -3417,7 +2558,7 @@ var StatusAnnouncementMapping = {
|
|
|
3417
2558
|
completed: "Component test completed successfully.",
|
|
3418
2559
|
errored: "Component test failed.",
|
|
3419
2560
|
aborted: "Component test was aborted."
|
|
3420
|
-
}, getStatusAnnouncement = (status, hasException) => status === "completed" && hasException ? StatusAnnouncementMapping.errored : StatusAnnouncementMapping[status], InteractionsPanel =
|
|
2561
|
+
}, getStatusAnnouncement = (status, hasException) => status === "completed" && hasException ? StatusAnnouncementMapping.errored : StatusAnnouncementMapping[status], InteractionsPanel = React23.memo(
|
|
3421
2562
|
function({
|
|
3422
2563
|
storyUrl,
|
|
3423
2564
|
status,
|
|
@@ -3439,7 +2580,7 @@ var StatusAnnouncementMapping = {
|
|
|
3439
2580
|
api
|
|
3440
2581
|
}) {
|
|
3441
2582
|
let filter = useAnsiToHtmlFilter(), hasRealInteractions = interactions.some((i) => i.id !== INTERNAL_RENDER_CALL_ID), isListBusy = status === "rendering" || status === "playing", statusAnnouncement = getStatusAnnouncement(status, hasException), isStatusAlert = status === "errored" || status === "completed" && hasException;
|
|
3442
|
-
return
|
|
2583
|
+
return React23.useEffect(() => {
|
|
3443
2584
|
announce(statusAnnouncement, isStatusAlert ? "assertive" : "polite");
|
|
3444
2585
|
}, [statusAnnouncement, isStatusAlert]), jsxs13("div", { className: InteractionsPanel_default.container, children: [
|
|
3445
2586
|
hasResultMismatch && jsx18(TestDiscrepancyMessage, { browserTestStatus }),
|
|
@@ -3507,15 +2648,15 @@ var StatusAnnouncementMapping = {
|
|
|
3507
2648
|
jsx18("code", { className: InteractionsPanel_default.caughtExceptionCode, children: "true" }),
|
|
3508
2649
|
"."
|
|
3509
2650
|
] }),
|
|
3510
|
-
unhandledErrors.map((
|
|
2651
|
+
unhandledErrors.map((error2, i) => jsx18("pre", { className: InteractionsPanel_default.caughtExceptionStack, "data-chromatic": "ignore", children: printSerializedError(error2) }, i))
|
|
3511
2652
|
] }),
|
|
3512
2653
|
jsx18("div", { ref: endRef }),
|
|
3513
2654
|
status === "completed" && !caughtException && !hasRealInteractions && jsx18(Empty, {})
|
|
3514
2655
|
] });
|
|
3515
2656
|
}
|
|
3516
2657
|
);
|
|
3517
|
-
function printSerializedError(
|
|
3518
|
-
return
|
|
2658
|
+
function printSerializedError(error2) {
|
|
2659
|
+
return error2.stack || `${error2.name}: ${error2.message}`;
|
|
3519
2660
|
}
|
|
3520
2661
|
|
|
3521
2662
|
// src/component-testing/components/Panel.tsx
|
|
@@ -3576,7 +2717,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3576
2717
|
), trackRenderPhase = (tracker, event, currentStoryId) => {
|
|
3577
2718
|
if (event.storyId !== currentStoryId)
|
|
3578
2719
|
return { tracker, isCurrentRender: !1 };
|
|
3579
|
-
if (tracker.storyId === event.storyId && ["preparing", "loading"].includes(event.newPhase))
|
|
2720
|
+
if (tracker.storyId === event.storyId && ["preparing", "loading", "beforeEach"].includes(event.newPhase))
|
|
3580
2721
|
return { tracker, isCurrentRender: !1 };
|
|
3581
2722
|
let renderId = tracker.storyId === event.storyId ? Math.max(tracker.renderId, event.renderId || 0) : event.renderId || 0;
|
|
3582
2723
|
return {
|
|
@@ -3601,12 +2742,12 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3601
2742
|
}), Panel = memo4(
|
|
3602
2743
|
function({ refId, storyId, storyUrl }) {
|
|
3603
2744
|
let { statusValue, testRunId } = experimental_useStatusStore((state2) => {
|
|
3604
|
-
let storyStatus = refId ? void 0 : state2[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST];
|
|
2745
|
+
let storyStatus = refId ? void 0 : state2[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST], data2 = storyStatus?.data;
|
|
3605
2746
|
return {
|
|
3606
2747
|
statusValue: storyStatus?.value,
|
|
3607
|
-
testRunId:
|
|
2748
|
+
testRunId: typeof data2 == "object" && data2 !== null && "testRunId" in data2 ? data2.testRunId : void 0
|
|
3608
2749
|
};
|
|
3609
|
-
}), state = useStorybookState2(), api = useStorybookApi6(), importPath = api.getData(state.storyId, state.refId)?.importPath, canOpenInEditor =
|
|
2750
|
+
}), state = useStorybookState2(), api = useStorybookApi6(), importPath = api.getData(state.storyId, state.refId)?.importPath, canOpenInEditor = global.CONFIG_TYPE === "DEVELOPMENT" && !state.refId, [panelState, set] = useAddonState2(ADDON_ID6, {
|
|
3610
2751
|
status: "rendering",
|
|
3611
2752
|
controlStates: INITIAL_CONTROL_STATES,
|
|
3612
2753
|
interactions: [],
|
|
@@ -3615,7 +2756,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3615
2756
|
pausedAt: void 0,
|
|
3616
2757
|
caughtException: void 0,
|
|
3617
2758
|
unhandledErrors: void 0
|
|
3618
|
-
}), [scrollTarget, setScrollTarget] =
|
|
2759
|
+
}), [scrollTarget, setScrollTarget] = useState7(void 0), [collapsed, setCollapsed] = useState7(/* @__PURE__ */ new Set()), [hasResultMismatch, setResultMismatch] = useState7(!1), {
|
|
3619
2760
|
status = "rendering",
|
|
3620
2761
|
controlStates = INITIAL_CONTROL_STATES,
|
|
3621
2762
|
interactions = [],
|
|
@@ -3624,12 +2765,12 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3624
2765
|
unhandledErrors = void 0
|
|
3625
2766
|
} = panelState, log = useRef2([getInternalRenderLogItem("active" /* ACTIVE */)]), calls = useRef2(
|
|
3626
2767
|
/* @__PURE__ */ new Map([[INTERNAL_RENDER_CALL_ID, getInternalRenderCall(storyId)]])
|
|
3627
|
-
), setCall = ({ status: status2, ...call }) => calls.current.set(call.id, call), endRef = useRef2();
|
|
3628
|
-
|
|
2768
|
+
), setCall = ({ status: status2, ...call }) => calls.current.set(call.id, call), endRef = useRef2(null);
|
|
2769
|
+
useEffect6(() => {
|
|
3629
2770
|
let observer;
|
|
3630
|
-
return
|
|
2771
|
+
return global.IntersectionObserver && (observer = new global.IntersectionObserver(
|
|
3631
2772
|
([end]) => setScrollTarget(end.isIntersecting ? void 0 : end.target),
|
|
3632
|
-
{ root:
|
|
2773
|
+
{ root: global.document.querySelector('#storybook-panel-root [role="tabpanel"]') }
|
|
3633
2774
|
), endRef.current && observer.observe(endRef.current)), () => observer?.disconnect();
|
|
3634
2775
|
}, []);
|
|
3635
2776
|
let renderTracker = useRef2({ renderId: 0 }), emit = useChannel3(
|
|
@@ -3692,7 +2833,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3692
2833
|
},
|
|
3693
2834
|
[collapsed, storyId]
|
|
3694
2835
|
);
|
|
3695
|
-
|
|
2836
|
+
useEffect6(() => {
|
|
3696
2837
|
set(
|
|
3697
2838
|
(state2) => getPanelState(state2, { log: log.current, calls: calls.current, collapsed, setCollapsed })
|
|
3698
2839
|
);
|
|
@@ -3710,7 +2851,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3710
2851
|
}),
|
|
3711
2852
|
[emit, storyId]
|
|
3712
2853
|
), storyFilePath = useParameter3("fileName", ""), [fileName] = storyFilePath.toString().split("/").slice(-1), scrollToTarget = () => scrollTarget?.scrollIntoView({ behavior: "smooth", block: "end" }), hasException = !!caughtException || !!unhandledErrors || interactions.some((v2) => v2.status === "error" /* ERROR */), browserTestStatus = useMemo4(() => status !== "playing" && (interactions.length > 0 || hasException) ? hasException ? "error" /* ERROR */ : "done" /* DONE */ : status === "playing" ? "active" /* ACTIVE */ : void 0, [status, interactions, hasException]);
|
|
3713
|
-
return
|
|
2854
|
+
return useEffect6(() => {
|
|
3714
2855
|
if (browserTestStatus && statusValue && statusValue !== "status-value:pending" && statusValue !== storyStatusMap[browserTestStatus]) {
|
|
3715
2856
|
let timeout = setTimeout(
|
|
3716
2857
|
() => setResultMismatch((currentValue) => (currentValue || emit(FORKBOOK_ADDON_TEST_CHANNEL, {
|
|
@@ -3794,7 +2935,7 @@ import { addons as addons6, types as types4 } from "@aussieljk/forkbook/manager-
|
|
|
3794
2935
|
// src/backgrounds/components/Tool.tsx
|
|
3795
2936
|
import { Fragment as Fragment9, memo as memo5, useCallback as useCallback5 } from "react";
|
|
3796
2937
|
import { Select, ToggleButton } from "@aussieljk/forkbook/internal/components";
|
|
3797
|
-
import { CircleIcon as CircleIcon2,
|
|
2938
|
+
import { CircleIcon as CircleIcon2, Grid2x2Icon, ImageIcon } from "lucide-react";
|
|
3798
2939
|
import { useGlobals as useGlobals2, useParameter as useParameter4 } from "@aussieljk/forkbook/manager-api";
|
|
3799
2940
|
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3800
2941
|
var BackgroundTool = memo5(function() {
|
|
@@ -3845,7 +2986,7 @@ var BackgroundTool = memo5(function() {
|
|
|
3845
2986
|
ariaLabel: isLocked ? "Grid set by story parameters" : "Grid visibility",
|
|
3846
2987
|
tooltip: isLocked ? "Grid set by story parameters" : "Toggle grid visibility",
|
|
3847
2988
|
onClick: () => update({ value: backgroundName, grid: !isGrid }),
|
|
3848
|
-
children: jsx22(
|
|
2989
|
+
children: jsx22(Grid2x2Icon, {})
|
|
3849
2990
|
},
|
|
3850
2991
|
"grid"
|
|
3851
2992
|
),
|
|
@@ -3855,7 +2996,7 @@ var BackgroundTool = memo5(function() {
|
|
|
3855
2996
|
resetLabel: "Reset background",
|
|
3856
2997
|
onReset: () => update(void 0),
|
|
3857
2998
|
disabled: isLocked,
|
|
3858
|
-
icon: jsx22(
|
|
2999
|
+
icon: jsx22(ImageIcon, {}),
|
|
3859
3000
|
ariaLabel: isLocked ? "Background set by story parameters" : "Preview background",
|
|
3860
3001
|
tooltip: isLocked ? "Background set by story parameters" : "Change background",
|
|
3861
3002
|
defaultOptions: backgroundName,
|
|
@@ -3882,9 +3023,9 @@ var manager_default6 = addons6.register(ADDON_ID3, () => {
|
|
|
3882
3023
|
import { addons as addons7, types as types5 } from "@aussieljk/forkbook/manager-api";
|
|
3883
3024
|
|
|
3884
3025
|
// src/measure/Tool.tsx
|
|
3885
|
-
import { useCallback as useCallback6, useEffect as
|
|
3026
|
+
import { useCallback as useCallback6, useEffect as useEffect7 } from "react";
|
|
3886
3027
|
import { ToggleButton as ToggleButton2 } from "@aussieljk/forkbook/internal/components";
|
|
3887
|
-
import { RulerIcon } from "
|
|
3028
|
+
import { RulerIcon } from "lucide-react";
|
|
3888
3029
|
import { useGlobals as useGlobals3, useParameter as useParameter5, useStorybookApi as useStorybookApi8 } from "@aussieljk/forkbook/manager-api";
|
|
3889
3030
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3890
3031
|
var Tool = () => {
|
|
@@ -3894,7 +3035,7 @@ var Tool = () => {
|
|
|
3894
3035
|
}),
|
|
3895
3036
|
[updateGlobals, measureEnabled]
|
|
3896
3037
|
);
|
|
3897
|
-
return
|
|
3038
|
+
return useEffect7(() => {
|
|
3898
3039
|
isDisabled || api.setAddonShortcut(ADDON_ID4, {
|
|
3899
3040
|
label: "Toggle Measure",
|
|
3900
3041
|
defaultShortcut: ["M"],
|
|
@@ -3933,9 +3074,9 @@ var manager_default7 = addons7.register(ADDON_ID4, () => {
|
|
|
3933
3074
|
import { addons as addons8, types as types6 } from "@aussieljk/forkbook/manager-api";
|
|
3934
3075
|
|
|
3935
3076
|
// src/outline/OutlineSelector.tsx
|
|
3936
|
-
import { memo as memo6, useCallback as useCallback7, useEffect as
|
|
3077
|
+
import { memo as memo6, useCallback as useCallback7, useEffect as useEffect8 } from "react";
|
|
3937
3078
|
import { ToggleButton as ToggleButton3 } from "@aussieljk/forkbook/internal/components";
|
|
3938
|
-
import {
|
|
3079
|
+
import { SquareDashedIcon } from "lucide-react";
|
|
3939
3080
|
import { useGlobals as useGlobals4, useParameter as useParameter6, useStorybookApi as useStorybookApi9 } from "@aussieljk/forkbook/manager-api";
|
|
3940
3081
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3941
3082
|
var OutlineSelector = memo6(function() {
|
|
@@ -3945,7 +3086,7 @@ var OutlineSelector = memo6(function() {
|
|
|
3945
3086
|
}),
|
|
3946
3087
|
[isActive, updateGlobals]
|
|
3947
3088
|
);
|
|
3948
|
-
return
|
|
3089
|
+
return useEffect8(() => {
|
|
3949
3090
|
isDisabled || api.setAddonShortcut(ADDON_ID5, {
|
|
3950
3091
|
label: "Toggle Outline",
|
|
3951
3092
|
defaultShortcut: ["alt", "O"],
|
|
@@ -3963,7 +3104,7 @@ var OutlineSelector = memo6(function() {
|
|
|
3963
3104
|
ariaDescription: "When enabled, this tool displays the outline of every element in the preview area, which helps understand their layout.",
|
|
3964
3105
|
tooltip: "Toggle outline",
|
|
3965
3106
|
onClick: toggleOutline,
|
|
3966
|
-
children: jsx26(
|
|
3107
|
+
children: jsx26(SquareDashedIcon, {})
|
|
3967
3108
|
},
|
|
3968
3109
|
"outline"
|
|
3969
3110
|
);
|
|
@@ -3983,19 +3124,14 @@ var manager_default8 = addons8.register(ADDON_ID5, () => {
|
|
|
3983
3124
|
// src/viewport/manager.tsx
|
|
3984
3125
|
import { addons as addons9, types as types7 } from "@aussieljk/forkbook/manager-api";
|
|
3985
3126
|
|
|
3986
|
-
// src/viewport/components/Tool.tsx
|
|
3987
|
-
import { useMemo as useMemo6 } from "react";
|
|
3988
|
-
import { Select as Select2 } from "@aussieljk/forkbook/internal/components";
|
|
3989
|
-
import { GrowIcon } from "@storybook/icons";
|
|
3990
|
-
|
|
3991
3127
|
// src/viewport/useViewport.ts
|
|
3992
|
-
import { useCallback as useCallback8, useEffect as
|
|
3128
|
+
import { useCallback as useCallback8, useEffect as useEffect9, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
3993
3129
|
import { useGlobals as useGlobals5, useParameter as useParameter7, useStorybookApi as useStorybookApi10 } from "@aussieljk/forkbook/manager-api";
|
|
3994
3130
|
var cycle = (viewports, current, direction = 1) => {
|
|
3995
3131
|
let keys = Object.keys(viewports), nextIndex = (current ? keys.indexOf(current) : -1) + direction;
|
|
3996
3132
|
return nextIndex < 0 ? keys[keys.length - 1] : nextIndex >= keys.length ? keys[0] : keys[nextIndex];
|
|
3997
3133
|
}, normalizeGlobal = (value, defaultIsRotated) => typeof value == "string" ? { value, isRotated: defaultIsRotated } : { value: value?.value, isRotated: value?.isRotated ?? defaultIsRotated }, useViewport = () => {
|
|
3998
|
-
let api = useStorybookApi10(), { viewMode } = api.getUrlState(), lastSelectedOption = useRef3(), parameter = useParameter7(PARAM_KEY), [globals, updateGlobals, storyGlobals, userGlobals] = useGlobals5(), { options = MINIMAL_VIEWPORTS, disable = !1 } = parameter || {}, { name, type, width, height, value, option, isCustom, isDefault, isLocked, isRotated } = resolveViewport({
|
|
3134
|
+
let api = useStorybookApi10(), { viewMode } = api.getUrlState(), lastSelectedOption = useRef3(void 0), parameter = useParameter7(PARAM_KEY), [globals, updateGlobals, storyGlobals, userGlobals] = useGlobals5(), { options = MINIMAL_VIEWPORTS, disable = !1 } = parameter || {}, { name, type, width, height, value, option, isCustom, isDefault, isLocked, isRotated } = resolveViewport({
|
|
3999
3135
|
globals,
|
|
4000
3136
|
storyGlobals,
|
|
4001
3137
|
userGlobals,
|
|
@@ -4013,9 +3149,9 @@ var cycle = (viewports, current, direction = 1) => {
|
|
|
4013
3149
|
},
|
|
4014
3150
|
[update, isRotated]
|
|
4015
3151
|
);
|
|
4016
|
-
return
|
|
3152
|
+
return useEffect9(() => {
|
|
4017
3153
|
parameter && option && (Object.hasOwn(options, option) ? lastSelectedOption.current = option : (lastSelectedOption.current = void 0, PARAM_KEY in storyGlobals || update({ value: void 0, isRotated: !1 })));
|
|
4018
|
-
}, [parameter, storyGlobals, options, option, update]),
|
|
3154
|
+
}, [parameter, storyGlobals, options, option, update]), useEffect9(() => {
|
|
4019
3155
|
api.setAddonShortcut(ADDON_ID, {
|
|
4020
3156
|
label: "Next viewport",
|
|
4021
3157
|
defaultShortcut: ["alt", "V"],
|
|
@@ -4069,85 +3205,451 @@ var cycle = (viewports, current, direction = 1) => {
|
|
|
4069
3205
|
);
|
|
4070
3206
|
};
|
|
4071
3207
|
|
|
3208
|
+
// src/viewport/components/FrameSize.tsx
|
|
3209
|
+
import { useEffect as useEffect10, useState as useState8 } from "react";
|
|
3210
|
+
|
|
3211
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/viewport/components/FrameSize.module.css
|
|
3212
|
+
var id12 = "core/src/viewport/components/FrameSize.module.css";
|
|
3213
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id12}"]`)) {
|
|
3214
|
+
let style = document.createElement("style");
|
|
3215
|
+
style.setAttribute("data-fb-css", id12), style.textContent = ".fb-bVlzdq-wrapper{height:28px;font-family:var(--fb-font-mono);font-size:calc(var(--fb-size-s1) - 1px);font-variant-numeric:tabular-nums;color:var(--fb-text-muted-color);white-space:nowrap;align-items:center;gap:1px;padding-inline:4px;display:inline-flex}.fb-bVlzdq-times{opacity:.7}.fb-bVlzdq-value,.fb-bVlzdq-input{height:22px;font:inherit;color:inherit;border-radius:4px;padding-inline:3px}.fb-bVlzdq-value{cursor:text;background:0 0;border:none;&:hover:not(:disabled),&:focus-visible{background:var(--fb-input-background)}&:disabled{cursor:default}}.fb-bVlzdq-input{min-width:0;color:var(--fb-input-color);text-align:center;background:var(--fb-input-background);box-shadow:var(--fb-input-border) 0 0 0 1px inset;appearance:textfield;border:none;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}", document.head.appendChild(style);
|
|
3216
|
+
}
|
|
3217
|
+
var FrameSize_default = { input: "fb-bVlzdq-input", wrapper: "fb-bVlzdq-wrapper", times: "fb-bVlzdq-times", value: "fb-bVlzdq-value" };
|
|
3218
|
+
|
|
3219
|
+
// src/viewport/components/FrameSize.tsx
|
|
3220
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3221
|
+
var PREVIEW_IFRAME_ID = "storybook-preview-iframe", usePreviewFrameSize = (id14 = PREVIEW_IFRAME_ID) => {
|
|
3222
|
+
let [size, setSize] = useState8();
|
|
3223
|
+
return useEffect10(() => {
|
|
3224
|
+
let observed = null, resizeObserver = new ResizeObserver(() => {
|
|
3225
|
+
observed && setSize({ width: observed.clientWidth, height: observed.clientHeight });
|
|
3226
|
+
}), attach = () => {
|
|
3227
|
+
let el = document.getElementById(id14);
|
|
3228
|
+
el !== observed && (observed && resizeObserver.unobserve(observed), observed = el, el && resizeObserver.observe(el));
|
|
3229
|
+
};
|
|
3230
|
+
attach();
|
|
3231
|
+
let mutationObserver = new MutationObserver(attach);
|
|
3232
|
+
return mutationObserver.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
3233
|
+
mutationObserver.disconnect(), resizeObserver.disconnect();
|
|
3234
|
+
};
|
|
3235
|
+
}, [id14]), size;
|
|
3236
|
+
}, Dimension = ({
|
|
3237
|
+
label,
|
|
3238
|
+
value,
|
|
3239
|
+
disabled,
|
|
3240
|
+
onApply
|
|
3241
|
+
}) => {
|
|
3242
|
+
let [draft, setDraft] = useState8();
|
|
3243
|
+
if (draft === void 0)
|
|
3244
|
+
return jsx28(
|
|
3245
|
+
"button",
|
|
3246
|
+
{
|
|
3247
|
+
type: "button",
|
|
3248
|
+
className: FrameSize_default.value,
|
|
3249
|
+
"aria-label": `${label}: ${value}px. Click to edit.`,
|
|
3250
|
+
disabled,
|
|
3251
|
+
onClick: () => setDraft(String(value)),
|
|
3252
|
+
children: value
|
|
3253
|
+
}
|
|
3254
|
+
);
|
|
3255
|
+
let apply = () => {
|
|
3256
|
+
let next = Math.round(Number(draft));
|
|
3257
|
+
setDraft(void 0), draft.trim() !== "" && Number.isFinite(next) && next > 0 && next !== value && onApply(next);
|
|
3258
|
+
}, onKeyDown = (e) => {
|
|
3259
|
+
e.key === "Enter" ? (e.preventDefault(), apply()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), setDraft(void 0));
|
|
3260
|
+
};
|
|
3261
|
+
return jsx28(
|
|
3262
|
+
"input",
|
|
3263
|
+
{
|
|
3264
|
+
className: FrameSize_default.input,
|
|
3265
|
+
"aria-label": label,
|
|
3266
|
+
type: "number",
|
|
3267
|
+
min: 1,
|
|
3268
|
+
autoFocus: !0,
|
|
3269
|
+
value: draft,
|
|
3270
|
+
style: { width: `${Math.max(draft.length, 2) + 2}ch` },
|
|
3271
|
+
onChange: (e) => setDraft(e.target.value),
|
|
3272
|
+
onFocus: (e) => e.target.select(),
|
|
3273
|
+
onBlur: apply,
|
|
3274
|
+
onKeyDown
|
|
3275
|
+
}
|
|
3276
|
+
);
|
|
3277
|
+
}, FrameSize = ({
|
|
3278
|
+
size,
|
|
3279
|
+
disabled,
|
|
3280
|
+
onApply
|
|
3281
|
+
}) => size ? jsxs16("span", { className: FrameSize_default.wrapper, "data-testid": "frame-size", children: [
|
|
3282
|
+
jsx28(
|
|
3283
|
+
Dimension,
|
|
3284
|
+
{
|
|
3285
|
+
label: "Frame width",
|
|
3286
|
+
value: size.width,
|
|
3287
|
+
disabled,
|
|
3288
|
+
onApply: (width) => onApply({ ...size, width })
|
|
3289
|
+
}
|
|
3290
|
+
),
|
|
3291
|
+
jsx28("span", { "aria-hidden": !0, className: FrameSize_default.times, children: "\xD7" }),
|
|
3292
|
+
jsx28(
|
|
3293
|
+
Dimension,
|
|
3294
|
+
{
|
|
3295
|
+
label: "Frame height",
|
|
3296
|
+
value: size.height,
|
|
3297
|
+
disabled,
|
|
3298
|
+
onApply: (height) => onApply({ ...size, height })
|
|
3299
|
+
}
|
|
3300
|
+
)
|
|
3301
|
+
] }) : null;
|
|
3302
|
+
|
|
3303
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3304
|
+
import { useMemo as useMemo8 } from "react";
|
|
3305
|
+
import { Button as Button4, Select as Select2 } from "@aussieljk/forkbook/internal/components";
|
|
3306
|
+
|
|
3307
|
+
// ../../node_modules/@base-ui/react/toggle/Toggle.mjs
|
|
3308
|
+
import * as React30 from "react";
|
|
3309
|
+
|
|
3310
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroupContext.mjs
|
|
3311
|
+
import * as React29 from "react";
|
|
3312
|
+
var ToggleGroupContext = React29.createContext(void 0);
|
|
3313
|
+
process.env.NODE_ENV !== "production" && (ToggleGroupContext.displayName = "ToggleGroupContext");
|
|
3314
|
+
function useToggleGroupContext() {
|
|
3315
|
+
return React29.useContext(ToggleGroupContext);
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
// ../../node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
|
|
3319
|
+
function CompositeItem(componentProps) {
|
|
3320
|
+
let {
|
|
3321
|
+
render,
|
|
3322
|
+
className,
|
|
3323
|
+
style,
|
|
3324
|
+
state = EMPTY_OBJECT,
|
|
3325
|
+
props = EMPTY_ARRAY,
|
|
3326
|
+
refs = EMPTY_ARRAY,
|
|
3327
|
+
metadata,
|
|
3328
|
+
stateAttributesMapping,
|
|
3329
|
+
tag = "div",
|
|
3330
|
+
...elementProps
|
|
3331
|
+
} = componentProps, {
|
|
3332
|
+
compositeProps,
|
|
3333
|
+
compositeRef
|
|
3334
|
+
} = useCompositeItem({
|
|
3335
|
+
metadata
|
|
3336
|
+
});
|
|
3337
|
+
return useRenderElement(tag, componentProps, {
|
|
3338
|
+
state,
|
|
3339
|
+
// The composite ref attaches first so an outer item wins when nested items share a DOM node.
|
|
3340
|
+
ref: [compositeRef, ...refs],
|
|
3341
|
+
props: [compositeProps, ...props, elementProps],
|
|
3342
|
+
stateAttributesMapping
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
// ../../node_modules/@base-ui/react/toggle/Toggle.mjs
|
|
3347
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3348
|
+
var Toggle = React30.forwardRef(function(componentProps, forwardedRef) {
|
|
3349
|
+
let {
|
|
3350
|
+
className,
|
|
3351
|
+
defaultPressed = !1,
|
|
3352
|
+
disabled: disabledProp = !1,
|
|
3353
|
+
form,
|
|
3354
|
+
// never participates in form validation
|
|
3355
|
+
onPressedChange,
|
|
3356
|
+
pressed: pressedProp,
|
|
3357
|
+
render,
|
|
3358
|
+
type,
|
|
3359
|
+
// cannot change button type
|
|
3360
|
+
value: valueProp,
|
|
3361
|
+
nativeButton = !0,
|
|
3362
|
+
style,
|
|
3363
|
+
...elementProps
|
|
3364
|
+
} = componentProps, value = useBaseUiId(valueProp || void 0), groupContext = useToggleGroupContext(), groupValue = groupContext?.value ?? [], disabled = (disabledProp || groupContext?.disabled) ?? !1;
|
|
3365
|
+
process.env.NODE_ENV !== "production" && React30.useEffect(() => {
|
|
3366
|
+
groupContext && valueProp === void 0 && groupContext.isValueInitialized && error("A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.", "This will cause issues between the Toggle Group and Toggle values.", "Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.");
|
|
3367
|
+
}, [groupContext, valueProp, groupContext?.isValueInitialized]);
|
|
3368
|
+
let [pressed, setPressedState] = useControlled({
|
|
3369
|
+
controlled: groupContext ? value !== void 0 && groupValue.indexOf(value) > -1 : pressedProp,
|
|
3370
|
+
default: defaultPressed,
|
|
3371
|
+
name: "Toggle",
|
|
3372
|
+
state: "pressed"
|
|
3373
|
+
}), {
|
|
3374
|
+
getButtonProps,
|
|
3375
|
+
buttonRef
|
|
3376
|
+
} = useButton({
|
|
3377
|
+
disabled,
|
|
3378
|
+
native: nativeButton
|
|
3379
|
+
}), state = {
|
|
3380
|
+
disabled,
|
|
3381
|
+
pressed
|
|
3382
|
+
}, refs = [buttonRef, forwardedRef], props = [{
|
|
3383
|
+
"aria-pressed": pressed,
|
|
3384
|
+
onClick(event) {
|
|
3385
|
+
let nextPressed = !pressed, details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
|
|
3386
|
+
onPressedChange?.(nextPressed, details), !details.isCanceled && (value && groupContext?.setGroupValue?.(value, nextPressed, details), !details.isCanceled && setPressedState(nextPressed));
|
|
3387
|
+
}
|
|
3388
|
+
}, elementProps, getButtonProps], element = useRenderElement("button", componentProps, {
|
|
3389
|
+
enabled: !groupContext,
|
|
3390
|
+
state,
|
|
3391
|
+
ref: refs,
|
|
3392
|
+
props
|
|
3393
|
+
}), itemMetadata = React30.useMemo(() => ({
|
|
3394
|
+
disabled,
|
|
3395
|
+
focusableWhenDisabled: !1
|
|
3396
|
+
}), [disabled]);
|
|
3397
|
+
return groupContext ? _jsx(CompositeItem, {
|
|
3398
|
+
tag: "button",
|
|
3399
|
+
render,
|
|
3400
|
+
className,
|
|
3401
|
+
style,
|
|
3402
|
+
metadata: itemMetadata,
|
|
3403
|
+
state,
|
|
3404
|
+
refs,
|
|
3405
|
+
props
|
|
3406
|
+
}) : element;
|
|
3407
|
+
});
|
|
3408
|
+
process.env.NODE_ENV !== "production" && (Toggle.displayName = "Toggle");
|
|
3409
|
+
|
|
3410
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroup.mjs
|
|
3411
|
+
import * as React32 from "react";
|
|
3412
|
+
|
|
3413
|
+
// ../../node_modules/@base-ui/react/toolbar/group/ToolbarGroupContext.mjs
|
|
3414
|
+
import * as React31 from "react";
|
|
3415
|
+
var ToolbarGroupContext = React31.createContext(void 0);
|
|
3416
|
+
process.env.NODE_ENV !== "production" && (ToolbarGroupContext.displayName = "ToolbarGroupContext");
|
|
3417
|
+
function useToolbarGroupContext() {
|
|
3418
|
+
return React31.useContext(ToolbarGroupContext);
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroup.mjs
|
|
3422
|
+
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
3423
|
+
var ToggleGroup = React32.forwardRef(function(componentProps, forwardedRef) {
|
|
3424
|
+
let {
|
|
3425
|
+
defaultValue: defaultValueProp,
|
|
3426
|
+
disabled: disabledProp = !1,
|
|
3427
|
+
loopFocus = !0,
|
|
3428
|
+
onValueChange,
|
|
3429
|
+
orientation = "horizontal",
|
|
3430
|
+
multiple = !1,
|
|
3431
|
+
value: valueProp,
|
|
3432
|
+
className,
|
|
3433
|
+
render,
|
|
3434
|
+
style,
|
|
3435
|
+
...elementProps
|
|
3436
|
+
} = componentProps, toolbarContext = useToolbarRootContext(!0), toolbarGroupContext = useToolbarGroupContext(), defaultValue = defaultValueProp ?? EMPTY_ARRAY, isValueInitialized = valueProp !== void 0 || defaultValueProp !== void 0, disabled = (toolbarContext?.disabled ?? !1) || (toolbarGroupContext?.disabled ?? !1) || disabledProp, [groupValue, setValueState] = useControlled({
|
|
3437
|
+
controlled: valueProp,
|
|
3438
|
+
default: defaultValue,
|
|
3439
|
+
name: "ToggleGroup",
|
|
3440
|
+
state: "value"
|
|
3441
|
+
}), setGroupValue = useStableCallback((newValue, nextPressed, eventDetails) => {
|
|
3442
|
+
let newGroupValue;
|
|
3443
|
+
multiple ? (newGroupValue = groupValue.slice(), nextPressed ? newGroupValue.push(newValue) : newGroupValue.splice(groupValue.indexOf(newValue), 1)) : newGroupValue = nextPressed ? [newValue] : [], onValueChange?.(newGroupValue, eventDetails), !eventDetails.isCanceled && setValueState(newGroupValue);
|
|
3444
|
+
}), state = {
|
|
3445
|
+
disabled,
|
|
3446
|
+
multiple,
|
|
3447
|
+
orientation
|
|
3448
|
+
}, contextValue = React32.useMemo(() => ({
|
|
3449
|
+
disabled,
|
|
3450
|
+
setGroupValue,
|
|
3451
|
+
value: groupValue,
|
|
3452
|
+
isValueInitialized
|
|
3453
|
+
}), [disabled, setGroupValue, groupValue, isValueInitialized]), defaultProps = {
|
|
3454
|
+
role: "group"
|
|
3455
|
+
}, element = useRenderElement("div", componentProps, {
|
|
3456
|
+
enabled: !!toolbarContext,
|
|
3457
|
+
state,
|
|
3458
|
+
ref: forwardedRef,
|
|
3459
|
+
props: [defaultProps, elementProps]
|
|
3460
|
+
});
|
|
3461
|
+
return _jsx2(ToggleGroupContext.Provider, {
|
|
3462
|
+
value: contextValue,
|
|
3463
|
+
children: toolbarContext ? element : _jsx2(CompositeRoot, {
|
|
3464
|
+
render,
|
|
3465
|
+
className,
|
|
3466
|
+
style,
|
|
3467
|
+
state,
|
|
3468
|
+
refs: [forwardedRef],
|
|
3469
|
+
props: [defaultProps, elementProps],
|
|
3470
|
+
loopFocus,
|
|
3471
|
+
enableHomeAndEndKeys: !0,
|
|
3472
|
+
orientation
|
|
3473
|
+
})
|
|
3474
|
+
});
|
|
3475
|
+
});
|
|
3476
|
+
process.env.NODE_ENV !== "production" && (ToggleGroup.displayName = "ToggleGroup");
|
|
3477
|
+
|
|
3478
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3479
|
+
import { EllipsisIcon, Maximize2Icon, MonitorIcon, SmartphoneIcon as SmartphoneIcon2, TabletIcon as TabletIcon2 } from "lucide-react";
|
|
3480
|
+
|
|
4072
3481
|
// src/viewport/viewportIcons.tsx
|
|
4073
|
-
import {
|
|
4074
|
-
import { jsx as
|
|
3482
|
+
import { AppWindowIcon, SmartphoneIcon, TabletIcon, DiamondIcon, WatchIcon } from "lucide-react";
|
|
3483
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4075
3484
|
var iconsMap = {
|
|
4076
|
-
desktop:
|
|
4077
|
-
mobile:
|
|
4078
|
-
tablet:
|
|
4079
|
-
watch:
|
|
4080
|
-
other:
|
|
3485
|
+
desktop: jsx29(AppWindowIcon, {}),
|
|
3486
|
+
mobile: jsx29(SmartphoneIcon, {}),
|
|
3487
|
+
tablet: jsx29(TabletIcon, {}),
|
|
3488
|
+
watch: jsx29(WatchIcon, {}),
|
|
3489
|
+
other: jsx29(DiamondIcon, {})
|
|
3490
|
+
};
|
|
3491
|
+
|
|
3492
|
+
// src/viewport/components/segments.ts
|
|
3493
|
+
var SEGMENT_KINDS = ["mobile", "tablet", "desktop"], NAME_PATTERNS = {
|
|
3494
|
+
mobile: /mobile|phone/i,
|
|
3495
|
+
tablet: /tablet|ipad/i,
|
|
3496
|
+
desktop: /desktop|laptop/i
|
|
3497
|
+
}, mapSegments = (viewports) => {
|
|
3498
|
+
let keys = Object.keys(viewports), used = /* @__PURE__ */ new Set(), segments = {}, pick = (kind, test) => {
|
|
3499
|
+
if (segments[kind])
|
|
3500
|
+
return;
|
|
3501
|
+
let key = keys.find((k) => !used.has(k) && test(k));
|
|
3502
|
+
key && (segments[kind] = key, used.add(key));
|
|
3503
|
+
};
|
|
3504
|
+
for (let kind of SEGMENT_KINDS)
|
|
3505
|
+
pick(kind, (k) => viewports[k].type === kind);
|
|
3506
|
+
for (let kind of SEGMENT_KINDS)
|
|
3507
|
+
pick(kind, (k) => NAME_PATTERNS[kind].test(`${k} ${viewports[k].name}`));
|
|
3508
|
+
return { segments, overflow: keys.filter((k) => !used.has(k)) };
|
|
4081
3509
|
};
|
|
4082
3510
|
|
|
4083
|
-
//
|
|
4084
|
-
var
|
|
4085
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
3511
|
+
// forkbook-css:/home/runner/work/forkbook/forkbook/code/core/src/viewport/components/Tool.module.css
|
|
3512
|
+
var id13 = "core/src/viewport/components/Tool.module.css";
|
|
3513
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id13}"]`)) {
|
|
4086
3514
|
let style = document.createElement("style");
|
|
4087
|
-
style.setAttribute("data-
|
|
3515
|
+
style.setAttribute("data-fb-css", id13), style.textContent = ".fb-vBOFLW-dimensions{font-family:var(--fb-font-mono);font-size:calc(var(--fb-size-s1) - 1px);font-weight:var(--fb-weight-regular);color:var(--fb-text-muted-color);gap:2px;margin-left:20px;display:flex}.fb-vBOFLW-segments{box-shadow:var(--fb-app-border-color) 0 0 0 1px inset;border-radius:4px;align-items:center;gap:1px;padding:1px;display:inline-flex}.fb-vBOFLW-segment:where([data-pressed]){background:rgb(from var(--fb-bar-selected-color) r g b / calc(alpha - .93));color:var(--fb-bar-selected-color)}", document.head.appendChild(style);
|
|
4088
3516
|
}
|
|
4089
|
-
var Tool_default = { dimensions: "
|
|
3517
|
+
var Tool_default = { segment: "fb-vBOFLW-segment", dimensions: "fb-vBOFLW-dimensions", segments: "fb-vBOFLW-segments" };
|
|
3518
|
+
|
|
3519
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3520
|
+
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3521
|
+
var FULL = "full", SEGMENT_ICONS = {
|
|
3522
|
+
mobile: jsx30(SmartphoneIcon2, {}),
|
|
3523
|
+
tablet: jsx30(TabletIcon2, {}),
|
|
3524
|
+
desktop: jsx30(MonitorIcon, {})
|
|
3525
|
+
}, SEGMENT_LABELS = {
|
|
3526
|
+
mobile: "Mobile",
|
|
3527
|
+
tablet: "Tablet",
|
|
3528
|
+
desktop: "Desktop"
|
|
3529
|
+
}, ViewportSegments = ({
|
|
3530
|
+
viewports,
|
|
3531
|
+
value,
|
|
3532
|
+
isDefault,
|
|
3533
|
+
isLocked = !1,
|
|
3534
|
+
onSelect,
|
|
3535
|
+
onReset
|
|
3536
|
+
}) => {
|
|
3537
|
+
let { segments, overflow } = useMemo8(() => mapSegments(viewports), [viewports]), pressed = isDefault ? FULL : SEGMENT_KINDS.find((kind) => segments[kind] === value), overflowOptions = useMemo8(
|
|
3538
|
+
() => overflow.map((key) => ({
|
|
3539
|
+
value: key,
|
|
3540
|
+
title: viewports[key].name,
|
|
3541
|
+
icon: iconsMap[viewports[key].type ?? "other"],
|
|
3542
|
+
right: jsxs17("div", { className: Tool_default.dimensions, children: [
|
|
3543
|
+
jsx30("span", { children: viewports[key].styles.width.replace("px", "") }),
|
|
3544
|
+
jsx30("span", { children: "\xD7" }),
|
|
3545
|
+
jsx30("span", { children: viewports[key].styles.height.replace("px", "") })
|
|
3546
|
+
] })
|
|
3547
|
+
})),
|
|
3548
|
+
[overflow, viewports]
|
|
3549
|
+
), lockedNote = isLocked ? " (set by story parameters)" : "";
|
|
3550
|
+
return jsxs17(Fragment10, { children: [
|
|
3551
|
+
jsxs17(
|
|
3552
|
+
ToggleGroup,
|
|
3553
|
+
{
|
|
3554
|
+
className: Tool_default.segments,
|
|
3555
|
+
"aria-label": `Viewport size${lockedNote}`,
|
|
3556
|
+
value: pressed ? [pressed] : [],
|
|
3557
|
+
disabled: isLocked,
|
|
3558
|
+
onValueChange: (next) => {
|
|
3559
|
+
let [picked] = next;
|
|
3560
|
+
picked === FULL ? onReset() : picked && segments[picked] && onSelect(segments[picked]);
|
|
3561
|
+
},
|
|
3562
|
+
children: [
|
|
3563
|
+
SEGMENT_KINDS.filter((kind) => segments[kind]).map((kind) => jsx30(
|
|
3564
|
+
Toggle,
|
|
3565
|
+
{
|
|
3566
|
+
value: kind,
|
|
3567
|
+
className: Tool_default.segment,
|
|
3568
|
+
render: jsx30(
|
|
3569
|
+
Button4,
|
|
3570
|
+
{
|
|
3571
|
+
variant: "ghost",
|
|
3572
|
+
padding: "small",
|
|
3573
|
+
size: "small",
|
|
3574
|
+
ariaLabel: `${SEGMENT_LABELS[kind]}: ${viewports[segments[kind]].name}${lockedNote}`
|
|
3575
|
+
}
|
|
3576
|
+
),
|
|
3577
|
+
children: SEGMENT_ICONS[kind]
|
|
3578
|
+
},
|
|
3579
|
+
kind
|
|
3580
|
+
)),
|
|
3581
|
+
jsx30(
|
|
3582
|
+
Toggle,
|
|
3583
|
+
{
|
|
3584
|
+
value: FULL,
|
|
3585
|
+
className: Tool_default.segment,
|
|
3586
|
+
render: jsx30(
|
|
3587
|
+
Button4,
|
|
3588
|
+
{
|
|
3589
|
+
variant: "ghost",
|
|
3590
|
+
padding: "small",
|
|
3591
|
+
size: "small",
|
|
3592
|
+
ariaLabel: `Full size (reset viewport)${lockedNote}`
|
|
3593
|
+
}
|
|
3594
|
+
),
|
|
3595
|
+
children: jsx30(Maximize2Icon, {})
|
|
3596
|
+
}
|
|
3597
|
+
)
|
|
3598
|
+
]
|
|
3599
|
+
}
|
|
3600
|
+
),
|
|
3601
|
+
overflowOptions.length > 0 && jsx30(
|
|
3602
|
+
Select2,
|
|
3603
|
+
{
|
|
3604
|
+
padding: "small",
|
|
3605
|
+
disabled: isLocked,
|
|
3606
|
+
ariaLabel: `More viewports${lockedNote}`,
|
|
3607
|
+
tooltip: "More viewports",
|
|
3608
|
+
defaultOptions: value && overflow.includes(value) ? value : void 0,
|
|
3609
|
+
options: overflowOptions,
|
|
3610
|
+
onSelect: (selected) => onSelect(selected),
|
|
3611
|
+
icon: jsx30(EllipsisIcon, {})
|
|
3612
|
+
},
|
|
3613
|
+
"viewport-more"
|
|
3614
|
+
)
|
|
3615
|
+
] });
|
|
3616
|
+
};
|
|
4090
3617
|
|
|
4091
3618
|
// src/viewport/components/Tool.tsx
|
|
4092
|
-
import { jsx as
|
|
3619
|
+
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4093
3620
|
var ViewportTool = () => {
|
|
4094
|
-
let {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
isCustom,
|
|
4099
|
-
isLocked,
|
|
4100
|
-
options: viewportMap,
|
|
4101
|
-
reset,
|
|
4102
|
-
select
|
|
4103
|
-
} = useViewport(), options = useMemo6(() => {
|
|
4104
|
-
let presetOptions = Object.entries(viewportMap).map(([k, value2]) => ({
|
|
4105
|
-
value: k,
|
|
4106
|
-
title: value2.name,
|
|
4107
|
-
icon: iconsMap[value2.type],
|
|
4108
|
-
right: jsxs16("div", { className: Tool_default.dimensions, children: [
|
|
4109
|
-
jsx29("span", { children: value2.styles.width.replace("px", "") }),
|
|
4110
|
-
jsx29("span", { children: "\xD7" }),
|
|
4111
|
-
jsx29("span", { children: value2.styles.height.replace("px", "") })
|
|
4112
|
-
] })
|
|
4113
|
-
}));
|
|
4114
|
-
return isCustom && value ? [
|
|
4115
|
-
...presetOptions,
|
|
3621
|
+
let { option, isDefault, isLocked, options, reset, resize, select } = useViewport(), frameSize = usePreviewFrameSize();
|
|
3622
|
+
return jsxs18(Fragment11, { children: [
|
|
3623
|
+
jsx31(
|
|
3624
|
+
ViewportSegments,
|
|
4116
3625
|
{
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
3626
|
+
viewports: options,
|
|
3627
|
+
value: option,
|
|
3628
|
+
isDefault,
|
|
3629
|
+
isLocked,
|
|
3630
|
+
onSelect: select,
|
|
3631
|
+
onReset: reset
|
|
4121
3632
|
}
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
tooltip: isLocked ? "Viewport set by story parameters" : "Change viewport",
|
|
4133
|
-
defaultOptions: value,
|
|
4134
|
-
options,
|
|
4135
|
-
onSelect: (selected) => select(selected),
|
|
4136
|
-
icon: jsx29(GrowIcon, {}),
|
|
4137
|
-
children: isDefault ? null : name
|
|
4138
|
-
},
|
|
4139
|
-
"viewport"
|
|
4140
|
-
);
|
|
3633
|
+
),
|
|
3634
|
+
jsx31(
|
|
3635
|
+
FrameSize,
|
|
3636
|
+
{
|
|
3637
|
+
size: frameSize,
|
|
3638
|
+
disabled: isLocked,
|
|
3639
|
+
onApply: ({ width, height }) => resize(`${width}px`, `${height}px`)
|
|
3640
|
+
}
|
|
3641
|
+
)
|
|
3642
|
+
] });
|
|
4141
3643
|
};
|
|
4142
3644
|
|
|
4143
3645
|
// src/viewport/manager.tsx
|
|
4144
|
-
import { jsx as
|
|
3646
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
4145
3647
|
var manager_default9 = addons9.register(ADDON_ID, () => {
|
|
4146
3648
|
globalThis?.FEATURES?.viewport && addons9.add(TOOL_ID, {
|
|
4147
3649
|
title: "viewport / media-queries",
|
|
4148
3650
|
type: types7.TOOL,
|
|
4149
3651
|
match: ({ viewMode }) => viewMode === "story",
|
|
4150
|
-
render: () =>
|
|
3652
|
+
render: () => jsx32(ViewportTool, {})
|
|
4151
3653
|
});
|
|
4152
3654
|
});
|
|
4153
3655
|
|